7c483e7d6d32f904e63b2b4ecba2b7d90cb7e424
[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 _0x975e=['CloudProvider','auth','OAuth2','user','data5','./mailAccount.attributes','exports','define','mail_accounts','provider','custom','host','Smtp','port','secure','authentication'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0x975e,0xf5));var _0xe975=function(_0x3c84ad,_0x2601d9){_0x3c84ad=_0x3c84ad-0x0;var _0x3b1154=_0x975e[_0x3c84ad];return _0x3b1154;};'use strict';var attributes=require(_0xe975('0x0'));module[_0xe975('0x1')]=function(_0x4528fa){return _0x4528fa[_0xe975('0x2')]('MailAccount',attributes,{'tableName':_0xe975('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2fefef=this;var _0x33074c={'id':_0x2fefef['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2fefef[_0xe975('0x4')]!==_0xe975('0x5')){_0x33074c['service']=_0x2fefef[_0xe975('0x4')];}else{_0x33074c[_0xe975('0x6')]=_0x2fefef[_0xe975('0x7')]['host'];_0x33074c[_0xe975('0x8')]=_0x2fefef[_0xe975('0x7')][_0xe975('0x8')];_0x33074c[_0xe975('0x9')]=_0x2fefef['Smtp']['secure'];}if(_0x2fefef['Smtp'][_0xe975('0xa')]){if(_0x2fefef[_0xe975('0x7')]['modernAuthentication']){if(!_0x2fefef[_0xe975('0x7')][_0xe975('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x33074c[_0xe975('0xc')]={'type':_0xe975('0xd'),'user':_0x2fefef[_0xe975('0x7')][_0xe975('0xe')],'accessToken':_0x2fefef[_0xe975('0x7')]['CloudProvider'][_0xe975('0xf')]};}else{_0x33074c[_0xe975('0xc')]={'user':_0x2fefef['Smtp'][_0xe975('0xe')],'pass':_0x2fefef[_0xe975('0x7')]['pass']};}}return _0x33074c;}}});};