9e99f917a5afaac45e4aacbc865b7fa5d02ed497
[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 _0xff3d=['modernAuthentication','CloudProvider','user','auth','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','service','port','Smtp','secure','authentication'];(function(_0x547648,_0x7cb734){var _0x2b59bf=function(_0x100193){while(--_0x100193){_0x547648['push'](_0x547648['shift']());}};_0x2b59bf(++_0x7cb734);}(_0xff3d,0x122));var _0xdff3=function(_0x5305e6,_0x12781f){_0x5305e6=_0x5305e6-0x0;var _0x30c6f2=_0xff3d[_0x5305e6];return _0x30c6f2;};'use strict';var attributes=require(_0xdff3('0x0'));module['exports']=function(_0x18490b){return _0x18490b[_0xdff3('0x1')](_0xdff3('0x2'),attributes,{'tableName':_0xdff3('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2fab86=this;var _0x52ea65={'id':_0x2fab86['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2fab86[_0xdff3('0x4')]!=='custom'){_0x52ea65[_0xdff3('0x5')]=_0x2fab86[_0xdff3('0x4')];}else{_0x52ea65['host']=_0x2fab86['Smtp']['host'];_0x52ea65[_0xdff3('0x6')]=_0x2fab86[_0xdff3('0x7')]['port'];_0x52ea65[_0xdff3('0x8')]=_0x2fab86['Smtp']['secure'];}if(_0x2fab86['Smtp'][_0xdff3('0x9')]){if(_0x2fab86['Smtp'][_0xdff3('0xa')]){if(!_0x2fab86[_0xdff3('0x7')][_0xdff3('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x52ea65['auth']={'type':'OAuth2','user':_0x2fab86['Smtp'][_0xdff3('0xc')],'accessToken':_0x2fab86[_0xdff3('0x7')][_0xdff3('0xb')]['data5']};}else{_0x52ea65[_0xdff3('0xd')]={'user':_0x2fab86[_0xdff3('0x7')]['user'],'pass':_0x2fab86[_0xdff3('0x7')][_0xdff3('0xe')]};}}return _0x52ea65;}}});};