62b6e25a0cddd9665663e16867b7a6f42e7d6259
[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 _0x0b3a=['auth','OAuth2','user','data5','exports','MailAccount','mail_accounts','provider','service','Smtp','host','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x4a5e16,_0x4a68a4){var _0xb7817f=function(_0x18c233){while(--_0x18c233){_0x4a5e16['push'](_0x4a5e16['shift']());}};_0xb7817f(++_0x4a68a4);}(_0x0b3a,0x1a4));var _0xa0b3=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x0b3a[_0x75f869];return _0x10af8b;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xa0b3('0x0')]=function(_0x3996be){return _0x3996be['define'](_0xa0b3('0x1'),attributes,{'tableName':_0xa0b3('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33a15a=this;var _0x49f90a={'id':_0x33a15a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33a15a[_0xa0b3('0x3')]!=='custom'){_0x49f90a[_0xa0b3('0x4')]=_0x33a15a['provider'];}else{_0x49f90a['host']=_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x6')];_0x49f90a[_0xa0b3('0x7')]=_0x33a15a['Smtp'][_0xa0b3('0x7')];_0x49f90a[_0xa0b3('0x8')]=_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x8')];}if(_0x33a15a[_0xa0b3('0x5')]['authentication']){if(_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x9')]){if(!_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xa')])throw new Error(_0xa0b3('0xb'));_0x49f90a[_0xa0b3('0xc')]={'type':_0xa0b3('0xd'),'user':_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xe')],'accessToken':_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xa')][_0xa0b3('0xf')]};}else{_0x49f90a[_0xa0b3('0xc')]={'user':_0x33a15a['Smtp'][_0xa0b3('0xe')],'pass':_0x33a15a[_0xa0b3('0x5')]['pass']};}}return _0x49f90a;}}});};