1caf12688bee039c739596bd0de9dc257b83cef3
[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 _0x2c9b=['provider','custom','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass','./mailAccount.attributes','exports','define','mail_accounts'];(function(_0x21e001,_0x247a51){var _0x5aa04b=function(_0x4656f5){while(--_0x4656f5){_0x21e001['push'](_0x21e001['shift']());}};_0x5aa04b(++_0x247a51);}(_0x2c9b,0x19a));var _0xb2c9=function(_0xf19e26,_0x9050e7){_0xf19e26=_0xf19e26-0x0;var _0x6acaba=_0x2c9b[_0xf19e26];return _0x6acaba;};'use strict';var attributes=require(_0xb2c9('0x0'));module[_0xb2c9('0x1')]=function(_0x3985b6){return _0x3985b6[_0xb2c9('0x2')]('MailAccount',attributes,{'tableName':_0xb2c9('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3f1fe6=this;var _0x142d5e={'id':_0x3f1fe6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3f1fe6[_0xb2c9('0x4')]!==_0xb2c9('0x5')){_0x142d5e['service']=_0x3f1fe6[_0xb2c9('0x4')];}else{_0x142d5e[_0xb2c9('0x6')]=_0x3f1fe6['Smtp'][_0xb2c9('0x6')];_0x142d5e[_0xb2c9('0x7')]=_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x7')];_0x142d5e[_0xb2c9('0x9')]=_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x9')];}if(_0x3f1fe6['Smtp'][_0xb2c9('0xa')]){if(_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0xb')]){if(!_0x3f1fe6['Smtp'][_0xb2c9('0xc')])throw new Error(_0xb2c9('0xd'));_0x142d5e[_0xb2c9('0xe')]={'type':'OAuth2','user':_0x3f1fe6[_0xb2c9('0x8')]['user'],'accessToken':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0xc')][_0xb2c9('0xf')]};}else{_0x142d5e[_0xb2c9('0xe')]={'user':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x10')],'pass':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x11')]};}}return _0x142d5e;}}});};