098fabbd7775bb81c27251d9134353593bd500df
[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 _0xf9e1=['modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','pass','./mailAccount.attributes','MailAccount','mail_accounts','provider','host','port','Smtp','secure','authentication'];(function(_0x379580,_0x1704a2){var _0x5ae2fa=function(_0xcfb79f){while(--_0xcfb79f){_0x379580['push'](_0x379580['shift']());}};_0x5ae2fa(++_0x1704a2);}(_0xf9e1,0x1d3));var _0x1f9e=function(_0x472331,_0x13b6ce){_0x472331=_0x472331-0x0;var _0xf19956=_0xf9e1[_0x472331];return _0xf19956;};'use strict';var attributes=require(_0x1f9e('0x0'));module['exports']=function(_0x5e2a25){return _0x5e2a25['define'](_0x1f9e('0x1'),attributes,{'tableName':_0x1f9e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xc976e1=this;var _0x50cef5={'id':_0xc976e1['id'],'tls':{'rejectUnauthorized':![]}};if(_0xc976e1[_0x1f9e('0x3')]!=='custom'){_0x50cef5['service']=_0xc976e1[_0x1f9e('0x3')];}else{_0x50cef5[_0x1f9e('0x4')]=_0xc976e1['Smtp'][_0x1f9e('0x4')];_0x50cef5[_0x1f9e('0x5')]=_0xc976e1[_0x1f9e('0x6')][_0x1f9e('0x5')];_0x50cef5['secure']=_0xc976e1[_0x1f9e('0x6')][_0x1f9e('0x7')];}if(_0xc976e1['Smtp'][_0x1f9e('0x8')]){if(_0xc976e1[_0x1f9e('0x6')][_0x1f9e('0x9')]){if(!_0xc976e1[_0x1f9e('0x6')][_0x1f9e('0xa')])throw new Error(_0x1f9e('0xb'));_0x50cef5['auth']={'type':_0x1f9e('0xc'),'user':_0xc976e1['Smtp'][_0x1f9e('0xd')],'accessToken':_0xc976e1['Smtp'][_0x1f9e('0xa')][_0x1f9e('0xe')]};}else{_0x50cef5[_0x1f9e('0xf')]={'user':_0xc976e1[_0x1f9e('0x6')][_0x1f9e('0xd')],'pass':_0xc976e1['Smtp'][_0x1f9e('0x10')]};}}return _0x50cef5;}}});};