c0e8b5e3907e833c04f5c3f33f4fcd7b2897d12c
[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 _0x2624=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','Smtp'];(function(_0x5904fb,_0x16fccf){var _0x57b287=function(_0x2f88e1){while(--_0x2f88e1){_0x5904fb['push'](_0x5904fb['shift']());}};_0x57b287(++_0x16fccf);}(_0x2624,0x90));var _0x4262=function(_0x30a84e,_0x36d779){_0x30a84e=_0x30a84e-0x0;var _0xe600fa=_0x2624[_0x30a84e];return _0xe600fa;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x4262('0x0')]=function(_0xfd2105){return _0xfd2105[_0x4262('0x1')](_0x4262('0x2'),attributes,{'tableName':_0x4262('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x148d32=this;var _0x2e3d89={'id':_0x148d32['id'],'tls':{'rejectUnauthorized':![]}};if(_0x148d32[_0x4262('0x4')]!==_0x4262('0x5')){_0x2e3d89[_0x4262('0x6')]=_0x148d32[_0x4262('0x4')];}else{_0x2e3d89['host']=_0x148d32[_0x4262('0x7')][_0x4262('0x8')];_0x2e3d89[_0x4262('0x9')]=_0x148d32['Smtp'][_0x4262('0x9')];_0x2e3d89[_0x4262('0xa')]=_0x148d32[_0x4262('0x7')][_0x4262('0xa')];}if(_0x148d32[_0x4262('0x7')][_0x4262('0xb')]){if(_0x148d32[_0x4262('0x7')][_0x4262('0xc')]){if(!_0x148d32[_0x4262('0x7')][_0x4262('0xd')])throw new Error(_0x4262('0xe'));_0x2e3d89[_0x4262('0xf')]={'type':_0x4262('0x10'),'user':_0x148d32['Smtp'][_0x4262('0x11')],'accessToken':_0x148d32[_0x4262('0x7')][_0x4262('0xd')]['data5']};}else{_0x2e3d89['auth']={'user':_0x148d32[_0x4262('0x7')][_0x4262('0x11')],'pass':_0x148d32['Smtp'][_0x4262('0x12')]};}}return _0x2e3d89;}}});};