Built motion from commit 20b39a97.|2.6.29
[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 _0x7b62=['exports','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','authentication','CloudProvider','auth','OAuth2','data5','user','pass','./mailAccount.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b62,0x197));var _0x27b6=function(_0x36a9bf,_0x2edc43){_0x36a9bf=_0x36a9bf-0x0;var _0x24b93c=_0x7b62[_0x36a9bf];return _0x24b93c;};'use strict';var attributes=require(_0x27b6('0x0'));module[_0x27b6('0x1')]=function(_0x3d21fc){return _0x3d21fc['define'](_0x27b6('0x2'),attributes,{'tableName':_0x27b6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x44c0ac=this;var _0x3112a8={'id':_0x44c0ac['id'],'tls':{'rejectUnauthorized':![]}};if(_0x44c0ac[_0x27b6('0x4')]!==_0x27b6('0x5')){_0x3112a8[_0x27b6('0x6')]=_0x44c0ac[_0x27b6('0x4')];}else{_0x3112a8[_0x27b6('0x7')]=_0x44c0ac[_0x27b6('0x8')]['host'];_0x3112a8[_0x27b6('0x9')]=_0x44c0ac['Smtp'][_0x27b6('0x9')];_0x3112a8['secure']=_0x44c0ac['Smtp']['secure'];}if(_0x44c0ac[_0x27b6('0x8')][_0x27b6('0xa')]){if(_0x44c0ac[_0x27b6('0x8')]['modernAuthentication']){if(!_0x44c0ac[_0x27b6('0x8')][_0x27b6('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3112a8[_0x27b6('0xc')]={'type':_0x27b6('0xd'),'user':_0x44c0ac[_0x27b6('0x8')]['user'],'accessToken':_0x44c0ac[_0x27b6('0x8')][_0x27b6('0xb')][_0x27b6('0xe')]};}else{_0x3112a8[_0x27b6('0xc')]={'user':_0x44c0ac[_0x27b6('0x8')][_0x27b6('0xf')],'pass':_0x44c0ac[_0x27b6('0x8')][_0x27b6('0x10')]};}}return _0x3112a8;}}});};