b88d3d82a39bd7bcbeff44c93b7f993bd2588a77
[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 _0x2cf3=['exports','define','MailAccount','mail_accounts','provider','host','Smtp','port','secure','authentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','pass','./mailAccount.attributes'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2cf3,0x87));var _0x32cf=function(_0x1d9ebd,_0x5d2079){_0x1d9ebd=_0x1d9ebd-0x0;var _0x1abdce=_0x2cf3[_0x1d9ebd];return _0x1abdce;};'use strict';var attributes=require(_0x32cf('0x0'));module[_0x32cf('0x1')]=function(_0x318593){return _0x318593[_0x32cf('0x2')](_0x32cf('0x3'),attributes,{'tableName':_0x32cf('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2e71b7=this;var _0x4a1cbd={'id':_0x2e71b7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e71b7[_0x32cf('0x5')]!=='custom'){_0x4a1cbd['service']=_0x2e71b7['provider'];}else{_0x4a1cbd[_0x32cf('0x6')]=_0x2e71b7[_0x32cf('0x7')][_0x32cf('0x6')];_0x4a1cbd[_0x32cf('0x8')]=_0x2e71b7[_0x32cf('0x7')][_0x32cf('0x8')];_0x4a1cbd[_0x32cf('0x9')]=_0x2e71b7['Smtp']['secure'];}if(_0x2e71b7[_0x32cf('0x7')][_0x32cf('0xa')]){if(_0x2e71b7[_0x32cf('0x7')]['modernAuthentication']){if(!_0x2e71b7[_0x32cf('0x7')]['CloudProvider'])throw new Error(_0x32cf('0xb'));_0x4a1cbd[_0x32cf('0xc')]={'type':_0x32cf('0xd'),'user':_0x2e71b7[_0x32cf('0x7')]['user'],'accessToken':_0x2e71b7[_0x32cf('0x7')]['CloudProvider'][_0x32cf('0xe')]};}else{_0x4a1cbd[_0x32cf('0xc')]={'user':_0x2e71b7[_0x32cf('0x7')][_0x32cf('0xf')],'pass':_0x2e71b7[_0x32cf('0x7')][_0x32cf('0x10')]};}}return _0x4a1cbd;}}});};