33a554126b22dcbca43c268f8a280ff1b183968d
[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 _0x243c=['provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','exports','define','mail_accounts'];(function(_0x7bbd1d,_0x4195ef){var _0x327f16=function(_0x4b274d){while(--_0x4b274d){_0x7bbd1d['push'](_0x7bbd1d['shift']());}};_0x327f16(++_0x4195ef);}(_0x243c,0x140));var _0xc243=function(_0x432258,_0x2ed4ea){_0x432258=_0x432258-0x0;var _0x1a10e3=_0x243c[_0x432258];return _0x1a10e3;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xc243('0x0')]=function(_0x411b7d){return _0x411b7d[_0xc243('0x1')]('MailAccount',attributes,{'tableName':_0xc243('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x895c7=this;var _0x46f22f={'id':_0x895c7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x895c7[_0xc243('0x3')]!==_0xc243('0x4')){_0x46f22f[_0xc243('0x5')]=_0x895c7['provider'];}else{_0x46f22f[_0xc243('0x6')]=_0x895c7[_0xc243('0x7')][_0xc243('0x6')];_0x46f22f[_0xc243('0x8')]=_0x895c7[_0xc243('0x7')][_0xc243('0x8')];_0x46f22f['secure']=_0x895c7[_0xc243('0x7')][_0xc243('0x9')];}if(_0x895c7[_0xc243('0x7')][_0xc243('0xa')]){if(_0x895c7['Smtp'][_0xc243('0xb')]){if(!_0x895c7[_0xc243('0x7')][_0xc243('0xc')])throw new Error(_0xc243('0xd'));_0x46f22f[_0xc243('0xe')]={'type':'OAuth2','user':_0x895c7[_0xc243('0x7')]['user'],'accessToken':_0x895c7[_0xc243('0x7')]['CloudProvider'][_0xc243('0xf')]};}else{_0x46f22f[_0xc243('0xe')]={'user':_0x895c7[_0xc243('0x7')][_0xc243('0x10')],'pass':_0x895c7['Smtp']['pass']};}}return _0x46f22f;}}});};