Built motion from commit 639a1a7f.|2.6.19
[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 _0x779f=['define','mail_accounts','provider','service','host','Smtp','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x779f,0x14a));var _0xf779=function(_0x2f81e6,_0x4f1c93){_0x2f81e6=_0x2f81e6-0x0;var _0x151638=_0x779f[_0x2f81e6];return _0x151638;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x799354){return _0x799354[_0xf779('0x0')]('MailAccount',attributes,{'tableName':_0xf779('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x55db8c=this;var _0x2662ec={'id':_0x55db8c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x55db8c[_0xf779('0x2')]!=='custom'){_0x2662ec[_0xf779('0x3')]=_0x55db8c[_0xf779('0x2')];}else{_0x2662ec[_0xf779('0x4')]=_0x55db8c[_0xf779('0x5')][_0xf779('0x4')];_0x2662ec['port']=_0x55db8c[_0xf779('0x5')]['port'];_0x2662ec[_0xf779('0x6')]=_0x55db8c[_0xf779('0x5')][_0xf779('0x6')];}if(_0x55db8c[_0xf779('0x5')]['authentication']){if(_0x55db8c[_0xf779('0x5')][_0xf779('0x7')]){if(!_0x55db8c['Smtp'][_0xf779('0x8')])throw new Error(_0xf779('0x9'));_0x2662ec[_0xf779('0xa')]={'type':_0xf779('0xb'),'user':_0x55db8c[_0xf779('0x5')][_0xf779('0xc')],'accessToken':_0x55db8c[_0xf779('0x5')][_0xf779('0x8')][_0xf779('0xd')]};}else{_0x2662ec['auth']={'user':_0x55db8c[_0xf779('0x5')][_0xf779('0xc')],'pass':_0x55db8c[_0xf779('0x5')][_0xf779('0xe')]};}}return _0x2662ec;}}});};