719da181413fc0ad91fc0bc41e66341ff4fa6044
[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 _0x0f1b=['CloudProvider','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0f1b,0x88));var _0xb0f1=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x0f1b[_0x4a53d];return _0x27410e;};'use strict';var attributes=require(_0xb0f1('0x0'));module['exports']=function(_0x1f30fc){return _0x1f30fc[_0xb0f1('0x1')](_0xb0f1('0x2'),attributes,{'tableName':_0xb0f1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x59c7af=this;var _0x2f98ba={'id':_0x59c7af['id'],'tls':{'rejectUnauthorized':![]}};if(_0x59c7af[_0xb0f1('0x4')]!==_0xb0f1('0x5')){_0x2f98ba[_0xb0f1('0x6')]=_0x59c7af[_0xb0f1('0x4')];}else{_0x2f98ba[_0xb0f1('0x7')]=_0x59c7af[_0xb0f1('0x8')][_0xb0f1('0x7')];_0x2f98ba[_0xb0f1('0x9')]=_0x59c7af[_0xb0f1('0x8')][_0xb0f1('0x9')];_0x2f98ba['secure']=_0x59c7af[_0xb0f1('0x8')][_0xb0f1('0xa')];}if(_0x59c7af['Smtp'][_0xb0f1('0xb')]){if(_0x59c7af[_0xb0f1('0x8')][_0xb0f1('0xc')]){if(!_0x59c7af[_0xb0f1('0x8')]['CloudProvider'])throw new Error(_0xb0f1('0xd'));_0x2f98ba[_0xb0f1('0xe')]={'type':_0xb0f1('0xf'),'user':_0x59c7af[_0xb0f1('0x8')]['user'],'accessToken':_0x59c7af['Smtp'][_0xb0f1('0x10')][_0xb0f1('0x11')]};}else{_0x2f98ba['auth']={'user':_0x59c7af[_0xb0f1('0x8')]['user'],'pass':_0x59c7af[_0xb0f1('0x8')][_0xb0f1('0x12')]};}}return _0x2f98ba;}}});};