7f3a41b2ee7a5b38e2c6d7d9b63cb6b11fc4f6cd
[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 _0x6971=['port','secure','modernAuthentication','CloudProvider','OAuth2','user','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','custom','service','provider','host','Smtp'];(function(_0x4329ad,_0x130811){var _0xfe8f61=function(_0x33f3d2){while(--_0x33f3d2){_0x4329ad['push'](_0x4329ad['shift']());}};_0xfe8f61(++_0x130811);}(_0x6971,0x87));var _0x1697=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0x6971[_0x3bc3b4];return _0x4c546b;};'use strict';var attributes=require(_0x1697('0x0'));module['exports']=function(_0xc45639){return _0xc45639[_0x1697('0x1')](_0x1697('0x2'),attributes,{'tableName':_0x1697('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5f293c=this;var _0xa73388={'id':_0x5f293c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5f293c['provider']!==_0x1697('0x4')){_0xa73388[_0x1697('0x5')]=_0x5f293c[_0x1697('0x6')];}else{_0xa73388[_0x1697('0x7')]=_0x5f293c[_0x1697('0x8')][_0x1697('0x7')];_0xa73388[_0x1697('0x9')]=_0x5f293c[_0x1697('0x8')][_0x1697('0x9')];_0xa73388[_0x1697('0xa')]=_0x5f293c[_0x1697('0x8')][_0x1697('0xa')];}if(_0x5f293c['Smtp']['authentication']){if(_0x5f293c['Smtp'][_0x1697('0xb')]){if(!_0x5f293c[_0x1697('0x8')][_0x1697('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0xa73388['auth']={'type':_0x1697('0xd'),'user':_0x5f293c[_0x1697('0x8')]['user'],'accessToken':_0x5f293c[_0x1697('0x8')][_0x1697('0xc')]['data5']};}else{_0xa73388['auth']={'user':_0x5f293c[_0x1697('0x8')][_0x1697('0xe')],'pass':_0x5f293c[_0x1697('0x8')][_0x1697('0xf')]};}}return _0xa73388;}}});};