6861b4fb89f0a04c2261ddd5022bc396ea5442cc
[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 _0x879a=['secure','authentication','modernAuthentication','CloudProvider','OAuth2','user','data5','auth','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','Smtp','host','port'];(function(_0x5820ff,_0x344938){var _0x5f50e1=function(_0x3934fc){while(--_0x3934fc){_0x5820ff['push'](_0x5820ff['shift']());}};_0x5f50e1(++_0x344938);}(_0x879a,0xa1));var _0xa879=function(_0x8c8995,_0x2a31ca){_0x8c8995=_0x8c8995-0x0;var _0x4777cf=_0x879a[_0x8c8995];return _0x4777cf;};'use strict';var attributes=require(_0xa879('0x0'));module['exports']=function(_0x39698e){return _0x39698e[_0xa879('0x1')](_0xa879('0x2'),attributes,{'tableName':_0xa879('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3b37b3=this;var _0x22d556={'id':_0x3b37b3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b37b3[_0xa879('0x4')]!==_0xa879('0x5')){_0x22d556[_0xa879('0x6')]=_0x3b37b3[_0xa879('0x4')];}else{_0x22d556['host']=_0x3b37b3[_0xa879('0x7')][_0xa879('0x8')];_0x22d556[_0xa879('0x9')]=_0x3b37b3[_0xa879('0x7')][_0xa879('0x9')];_0x22d556[_0xa879('0xa')]=_0x3b37b3['Smtp'][_0xa879('0xa')];}if(_0x3b37b3[_0xa879('0x7')][_0xa879('0xb')]){if(_0x3b37b3[_0xa879('0x7')][_0xa879('0xc')]){if(!_0x3b37b3[_0xa879('0x7')][_0xa879('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x22d556['auth']={'type':_0xa879('0xe'),'user':_0x3b37b3[_0xa879('0x7')][_0xa879('0xf')],'accessToken':_0x3b37b3[_0xa879('0x7')]['CloudProvider'][_0xa879('0x10')]};}else{_0x22d556[_0xa879('0x11')]={'user':_0x3b37b3[_0xa879('0x7')][_0xa879('0xf')],'pass':_0x3b37b3[_0xa879('0x7')][_0xa879('0x12')]};}}return _0x22d556;}}});};