Built motion from commit b0a9a629.|2.6.33
[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 _0xd805=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','mail_accounts','provider','custom','service','Smtp','host','port','secure','authentication','modernAuthentication'];(function(_0x244214,_0x3358aa){var _0x3377e5=function(_0x781c2b){while(--_0x781c2b){_0x244214['push'](_0x244214['shift']());}};_0x3377e5(++_0x3358aa);}(_0xd805,0x1e1));var _0x5d80=function(_0x44650b,_0x5af069){_0x44650b=_0x44650b-0x0;var _0x13b205=_0xd805[_0x44650b];return _0x13b205;};'use strict';var attributes=require(_0x5d80('0x0'));module[_0x5d80('0x1')]=function(_0x19b839){return _0x19b839[_0x5d80('0x2')]('MailAccount',attributes,{'tableName':_0x5d80('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x34163d=this;var _0x1b704e={'id':_0x34163d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x34163d[_0x5d80('0x4')]!==_0x5d80('0x5')){_0x1b704e[_0x5d80('0x6')]=_0x34163d['provider'];}else{_0x1b704e['host']=_0x34163d[_0x5d80('0x7')][_0x5d80('0x8')];_0x1b704e[_0x5d80('0x9')]=_0x34163d['Smtp'][_0x5d80('0x9')];_0x1b704e[_0x5d80('0xa')]=_0x34163d[_0x5d80('0x7')][_0x5d80('0xa')];}if(_0x34163d['Smtp'][_0x5d80('0xb')]){if(_0x34163d['Smtp'][_0x5d80('0xc')]){if(!_0x34163d[_0x5d80('0x7')][_0x5d80('0xd')])throw new Error(_0x5d80('0xe'));_0x1b704e['auth']={'type':_0x5d80('0xf'),'user':_0x34163d['Smtp'][_0x5d80('0x10')],'accessToken':_0x34163d[_0x5d80('0x7')][_0x5d80('0xd')][_0x5d80('0x11')]};}else{_0x1b704e['auth']={'user':_0x34163d[_0x5d80('0x7')][_0x5d80('0x10')],'pass':_0x34163d[_0x5d80('0x7')][_0x5d80('0x12')]};}}return _0x1b704e;}}});};