Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / mailAccount / mailAccount.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xca93=['service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','OAuth2','user','data5','pass','exports','MailAccount','mail_accounts','provider','custom'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xca93,0x72));var _0x3ca9=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xca93[_0x43d11d];return _0x38cd08;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x3ca9('0x0')]=function(_0x3c289b){return _0x3c289b['define'](_0x3ca9('0x1'),attributes,{'tableName':_0x3ca9('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2425e9=this;var _0x3c61ef={'id':_0x2425e9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2425e9[_0x3ca9('0x3')]!==_0x3ca9('0x4')){_0x3c61ef[_0x3ca9('0x5')]=_0x2425e9['provider'];}else{_0x3c61ef[_0x3ca9('0x6')]=_0x2425e9[_0x3ca9('0x7')]['host'];_0x3c61ef[_0x3ca9('0x8')]=_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0x8')];_0x3c61ef[_0x3ca9('0x9')]=_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0x9')];}if(_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0xa')]){if(_0x2425e9['Smtp'][_0x3ca9('0xb')]){if(!_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3c61ef['auth']={'type':_0x3ca9('0xd'),'user':_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0xe')],'accessToken':_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0xc')][_0x3ca9('0xf')]};}else{_0x3c61ef['auth']={'user':_0x2425e9['Smtp'][_0x3ca9('0xe')],'pass':_0x2425e9[_0x3ca9('0x7')][_0x3ca9('0x10')]};}}return _0x3c61ef;}}});};