7e3b81126c1322fe15d9cfdee9187ad785d13541
[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 _0x7592=['service','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','mail_accounts','provider','custom'];(function(_0x1de88e,_0x2fa517){var _0x12ac65=function(_0x25988b){while(--_0x25988b){_0x1de88e['push'](_0x1de88e['shift']());}};_0x12ac65(++_0x2fa517);}(_0x7592,0x19e));var _0x2759=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x7592[_0x372515];return _0xa3bf4e;};'use strict';var attributes=require(_0x2759('0x0'));module[_0x2759('0x1')]=function(_0x219e69){return _0x219e69[_0x2759('0x2')]('MailAccount',attributes,{'tableName':_0x2759('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4a212c=this;var _0x37eef8={'id':_0x4a212c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4a212c[_0x2759('0x4')]!==_0x2759('0x5')){_0x37eef8[_0x2759('0x6')]=_0x4a212c['provider'];}else{_0x37eef8['host']=_0x4a212c[_0x2759('0x7')][_0x2759('0x8')];_0x37eef8['port']=_0x4a212c[_0x2759('0x7')][_0x2759('0x9')];_0x37eef8[_0x2759('0xa')]=_0x4a212c[_0x2759('0x7')]['secure'];}if(_0x4a212c['Smtp'][_0x2759('0xb')]){if(_0x4a212c[_0x2759('0x7')][_0x2759('0xc')]){if(!_0x4a212c[_0x2759('0x7')][_0x2759('0xd')])throw new Error(_0x2759('0xe'));_0x37eef8[_0x2759('0xf')]={'type':_0x2759('0x10'),'user':_0x4a212c['Smtp'][_0x2759('0x11')],'accessToken':_0x4a212c['Smtp'][_0x2759('0xd')][_0x2759('0x12')]};}else{_0x37eef8[_0x2759('0xf')]={'user':_0x4a212c[_0x2759('0x7')][_0x2759('0x11')],'pass':_0x4a212c[_0x2759('0x7')][_0x2759('0x13')]};}}return _0x37eef8;}}});};