Built motion from commit 00bf23f6.|2.6.16
[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 _0xd1aa=['authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','auth','./mailAccount.attributes','define','mail_accounts','provider','custom','host','Smtp','port','secure'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1aa,0x157));var _0xad1a=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0xd1aa[_0x4da382];return _0x10073f;};'use strict';var attributes=require(_0xad1a('0x0'));module['exports']=function(_0x9c9471){return _0x9c9471[_0xad1a('0x1')]('MailAccount',attributes,{'tableName':_0xad1a('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x29e345=this;var _0x2991ed={'id':_0x29e345['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29e345[_0xad1a('0x3')]!==_0xad1a('0x4')){_0x2991ed['service']=_0x29e345[_0xad1a('0x3')];}else{_0x2991ed[_0xad1a('0x5')]=_0x29e345[_0xad1a('0x6')][_0xad1a('0x5')];_0x2991ed[_0xad1a('0x7')]=_0x29e345[_0xad1a('0x6')][_0xad1a('0x7')];_0x2991ed[_0xad1a('0x8')]=_0x29e345['Smtp']['secure'];}if(_0x29e345['Smtp'][_0xad1a('0x9')]){if(_0x29e345[_0xad1a('0x6')][_0xad1a('0xa')]){if(!_0x29e345[_0xad1a('0x6')][_0xad1a('0xb')])throw new Error(_0xad1a('0xc'));_0x2991ed['auth']={'type':_0xad1a('0xd'),'user':_0x29e345['Smtp'][_0xad1a('0xe')],'accessToken':_0x29e345[_0xad1a('0x6')][_0xad1a('0xb')]['data5']};}else{_0x2991ed[_0xad1a('0xf')]={'user':_0x29e345[_0xad1a('0x6')][_0xad1a('0xe')],'pass':_0x29e345[_0xad1a('0x6')]['pass']};}}return _0x2991ed;}}});};