0279903cad3fe5895e388a9d82052b348d9db749
[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 _0xf2ba=['secure','modernAuthentication','CloudProvider','auth','user','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xf2ba,0x106));var _0xaf2b=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0xf2ba[_0x6148ee];return _0x5afc74;};'use strict';var attributes=require(_0xaf2b('0x0'));module[_0xaf2b('0x1')]=function(_0x24cce4){return _0x24cce4['define'](_0xaf2b('0x2'),attributes,{'tableName':_0xaf2b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x52ffa6=this;var _0x60e7d5={'id':_0x52ffa6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x52ffa6[_0xaf2b('0x4')]!==_0xaf2b('0x5')){_0x60e7d5[_0xaf2b('0x6')]=_0x52ffa6[_0xaf2b('0x4')];}else{_0x60e7d5[_0xaf2b('0x7')]=_0x52ffa6[_0xaf2b('0x8')][_0xaf2b('0x7')];_0x60e7d5[_0xaf2b('0x9')]=_0x52ffa6['Smtp'][_0xaf2b('0x9')];_0x60e7d5[_0xaf2b('0xa')]=_0x52ffa6[_0xaf2b('0x8')][_0xaf2b('0xa')];}if(_0x52ffa6[_0xaf2b('0x8')]['authentication']){if(_0x52ffa6[_0xaf2b('0x8')][_0xaf2b('0xb')]){if(!_0x52ffa6['Smtp'][_0xaf2b('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x60e7d5[_0xaf2b('0xd')]={'type':'OAuth2','user':_0x52ffa6['Smtp'][_0xaf2b('0xe')],'accessToken':_0x52ffa6['Smtp'][_0xaf2b('0xc')]['data5']};}else{_0x60e7d5[_0xaf2b('0xd')]={'user':_0x52ffa6[_0xaf2b('0x8')][_0xaf2b('0xe')],'pass':_0x52ffa6[_0xaf2b('0x8')][_0xaf2b('0xf')]};}}return _0x60e7d5;}}});};