Built motion from commit 47436d59.|2.6.7
[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 _0xd15c=['Smtp','port','secure','CloudProvider','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0xd15c,0x1a9));var _0xcd15=function(_0x293d56,_0x3b9311){_0x293d56=_0x293d56-0x0;var _0x5a268f=_0xd15c[_0x293d56];return _0x5a268f;};'use strict';var attributes=require(_0xcd15('0x0'));module[_0xcd15('0x1')]=function(_0x4c91cf){return _0x4c91cf[_0xcd15('0x2')](_0xcd15('0x3'),attributes,{'tableName':_0xcd15('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x11893f=this;var _0x3e5c01={'id':_0x11893f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x11893f['provider']!=='custom'){_0x3e5c01['service']=_0x11893f[_0xcd15('0x5')];}else{_0x3e5c01[_0xcd15('0x6')]=_0x11893f[_0xcd15('0x7')][_0xcd15('0x6')];_0x3e5c01[_0xcd15('0x8')]=_0x11893f['Smtp'][_0xcd15('0x8')];_0x3e5c01[_0xcd15('0x9')]=_0x11893f[_0xcd15('0x7')][_0xcd15('0x9')];}if(_0x11893f[_0xcd15('0x7')]['authentication']){if(_0x11893f['Smtp']['modernAuthentication']){if(!_0x11893f[_0xcd15('0x7')][_0xcd15('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3e5c01[_0xcd15('0xb')]={'type':_0xcd15('0xc'),'user':_0x11893f[_0xcd15('0x7')][_0xcd15('0xd')],'accessToken':_0x11893f[_0xcd15('0x7')][_0xcd15('0xa')][_0xcd15('0xe')]};}else{_0x3e5c01[_0xcd15('0xb')]={'user':_0x11893f[_0xcd15('0x7')][_0xcd15('0xd')],'pass':_0x11893f['Smtp'][_0xcd15('0xf')]};}}return _0x3e5c01;}}});};