215a52f6402fe1eb319bf0805a866c43a781eeac
[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 _0xc524=['user','./mailAccount.attributes','exports','define','MailAccount','provider','service','host','port','Smtp','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xc524,0xa1));var _0x4c52=function(_0x4e6de3,_0x206f46){_0x4e6de3=_0x4e6de3-0x0;var _0x1a79a0=_0xc524[_0x4e6de3];return _0x1a79a0;};'use strict';var attributes=require(_0x4c52('0x0'));module[_0x4c52('0x1')]=function(_0x9e9dac){return _0x9e9dac[_0x4c52('0x2')](_0x4c52('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5c6ec0=this;var _0x294e52={'id':_0x5c6ec0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c6ec0[_0x4c52('0x4')]!=='custom'){_0x294e52[_0x4c52('0x5')]=_0x5c6ec0[_0x4c52('0x4')];}else{_0x294e52[_0x4c52('0x6')]=_0x5c6ec0['Smtp']['host'];_0x294e52[_0x4c52('0x7')]=_0x5c6ec0[_0x4c52('0x8')]['port'];_0x294e52[_0x4c52('0x9')]=_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0x9')];}if(_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0xa')]){if(_0x5c6ec0[_0x4c52('0x8')]['modernAuthentication']){if(!_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0xb')])throw new Error(_0x4c52('0xc'));_0x294e52[_0x4c52('0xd')]={'type':_0x4c52('0xe'),'user':_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0xf')],'accessToken':_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0xb')]['data5']};}else{_0x294e52['auth']={'user':_0x5c6ec0[_0x4c52('0x8')][_0x4c52('0xf')],'pass':_0x5c6ec0[_0x4c52('0x8')]['pass']};}}return _0x294e52;}}});};