cfca198124a38762afa497dc45217287c1fc7af9
[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 _0x5cd9=['secure','Smtp','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','exports','define','MailAccount','mail_accounts','provider','service','host','port'];(function(_0x5bccb9,_0x1eb18f){var _0x531ac6=function(_0x3b4b02){while(--_0x3b4b02){_0x5bccb9['push'](_0x5bccb9['shift']());}};_0x531ac6(++_0x1eb18f);}(_0x5cd9,0x128));var _0x95cd=function(_0xf2dbdb,_0x1e4877){_0xf2dbdb=_0xf2dbdb-0x0;var _0x33662f=_0x5cd9[_0xf2dbdb];return _0x33662f;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x95cd('0x0')]=function(_0x2984e0){return _0x2984e0[_0x95cd('0x1')](_0x95cd('0x2'),attributes,{'tableName':_0x95cd('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4a3dfa=this;var _0x4ee1f5={'id':_0x4a3dfa['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4a3dfa[_0x95cd('0x4')]!=='custom'){_0x4ee1f5[_0x95cd('0x5')]=_0x4a3dfa[_0x95cd('0x4')];}else{_0x4ee1f5[_0x95cd('0x6')]=_0x4a3dfa['Smtp'][_0x95cd('0x6')];_0x4ee1f5[_0x95cd('0x7')]=_0x4a3dfa['Smtp'][_0x95cd('0x7')];_0x4ee1f5[_0x95cd('0x8')]=_0x4a3dfa[_0x95cd('0x9')][_0x95cd('0x8')];}if(_0x4a3dfa[_0x95cd('0x9')]['authentication']){if(_0x4a3dfa[_0x95cd('0x9')][_0x95cd('0xa')]){if(!_0x4a3dfa[_0x95cd('0x9')][_0x95cd('0xb')])throw new Error(_0x95cd('0xc'));_0x4ee1f5[_0x95cd('0xd')]={'type':'OAuth2','user':_0x4a3dfa[_0x95cd('0x9')][_0x95cd('0xe')],'accessToken':_0x4a3dfa['Smtp'][_0x95cd('0xb')][_0x95cd('0xf')]};}else{_0x4ee1f5['auth']={'user':_0x4a3dfa['Smtp']['user'],'pass':_0x4a3dfa['Smtp']['pass']};}}return _0x4ee1f5;}}});};