155b74125d75d1c65522dabb59ba69a95b86b700
[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 _0x58bf=['mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','OAuth2','user','CloudProvider','auth','pass','./mailAccount.attributes','exports','define'];(function(_0x263904,_0x52bb61){var _0x33bef8=function(_0x5850ef){while(--_0x5850ef){_0x263904['push'](_0x263904['shift']());}};_0x33bef8(++_0x52bb61);}(_0x58bf,0xc3));var _0xf58b=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x58bf[_0x165c96];return _0x5c2420;};'use strict';var attributes=require(_0xf58b('0x0'));module[_0xf58b('0x1')]=function(_0x4ee0a4){return _0x4ee0a4[_0xf58b('0x2')]('MailAccount',attributes,{'tableName':_0xf58b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe3848b=this;var _0x242471={'id':_0xe3848b['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe3848b[_0xf58b('0x4')]!==_0xf58b('0x5')){_0x242471[_0xf58b('0x6')]=_0xe3848b[_0xf58b('0x4')];}else{_0x242471['host']=_0xe3848b['Smtp'][_0xf58b('0x7')];_0x242471[_0xf58b('0x8')]=_0xe3848b[_0xf58b('0x9')][_0xf58b('0x8')];_0x242471[_0xf58b('0xa')]=_0xe3848b['Smtp']['secure'];}if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xb')]){if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xc')]){if(!_0xe3848b[_0xf58b('0x9')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x242471['auth']={'type':_0xf58b('0xd'),'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'accessToken':_0xe3848b['Smtp'][_0xf58b('0xf')]['data5']};}else{_0x242471[_0xf58b('0x10')]={'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'pass':_0xe3848b[_0xf58b('0x9')][_0xf58b('0x11')]};}}return _0x242471;}}});};