4ce7276c4152b1c4f6b8adc98c06dda59a5b962b
[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 _0x1dc1=['modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','pass','./mailAccount.attributes','exports','define','mail_accounts','custom','service','provider','host','Smtp','port','secure','authentication'];(function(_0x5f0287,_0xed094d){var _0x4336a9=function(_0x46b287){while(--_0x46b287){_0x5f0287['push'](_0x5f0287['shift']());}};_0x4336a9(++_0xed094d);}(_0x1dc1,0x1ec));var _0x11dc=function(_0x5547b5,_0x1fac07){_0x5547b5=_0x5547b5-0x0;var _0x5cb692=_0x1dc1[_0x5547b5];return _0x5cb692;};'use strict';var attributes=require(_0x11dc('0x0'));module[_0x11dc('0x1')]=function(_0xd20906){return _0xd20906[_0x11dc('0x2')]('MailAccount',attributes,{'tableName':_0x11dc('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x44095d=this;var _0x33fc61={'id':_0x44095d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x44095d['provider']!==_0x11dc('0x4')){_0x33fc61[_0x11dc('0x5')]=_0x44095d[_0x11dc('0x6')];}else{_0x33fc61[_0x11dc('0x7')]=_0x44095d[_0x11dc('0x8')]['host'];_0x33fc61[_0x11dc('0x9')]=_0x44095d[_0x11dc('0x8')][_0x11dc('0x9')];_0x33fc61[_0x11dc('0xa')]=_0x44095d['Smtp']['secure'];}if(_0x44095d[_0x11dc('0x8')][_0x11dc('0xb')]){if(_0x44095d[_0x11dc('0x8')][_0x11dc('0xc')]){if(!_0x44095d[_0x11dc('0x8')][_0x11dc('0xd')])throw new Error(_0x11dc('0xe'));_0x33fc61[_0x11dc('0xf')]={'type':'OAuth2','user':_0x44095d['Smtp'][_0x11dc('0x10')],'accessToken':_0x44095d[_0x11dc('0x8')][_0x11dc('0xd')]['data5']};}else{_0x33fc61[_0x11dc('0xf')]={'user':_0x44095d[_0x11dc('0x8')][_0x11dc('0x10')],'pass':_0x44095d['Smtp'][_0x11dc('0x11')]};}}return _0x33fc61;}}});};