2e97a5d2d623475da82aedbbae536cf1adf215d5
[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 _0x618b=['pass','./mailAccount.attributes','exports','define','provider','custom','service','Smtp','host','port','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','auth','user'];(function(_0x5b519e,_0x276cbf){var _0x4d38fc=function(_0x503bbe){while(--_0x503bbe){_0x5b519e['push'](_0x5b519e['shift']());}};_0x4d38fc(++_0x276cbf);}(_0x618b,0x1bb));var _0xb618=function(_0x599ad,_0x287761){_0x599ad=_0x599ad-0x0;var _0x56e9d5=_0x618b[_0x599ad];return _0x56e9d5;};'use strict';var attributes=require(_0xb618('0x0'));module[_0xb618('0x1')]=function(_0x4558bf){return _0x4558bf[_0xb618('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x8d454=this;var _0x4528e7={'id':_0x8d454['id'],'tls':{'rejectUnauthorized':![]}};if(_0x8d454[_0xb618('0x3')]!==_0xb618('0x4')){_0x4528e7[_0xb618('0x5')]=_0x8d454[_0xb618('0x3')];}else{_0x4528e7['host']=_0x8d454[_0xb618('0x6')][_0xb618('0x7')];_0x4528e7[_0xb618('0x8')]=_0x8d454[_0xb618('0x6')]['port'];_0x4528e7['secure']=_0x8d454[_0xb618('0x6')]['secure'];}if(_0x8d454['Smtp'][_0xb618('0x9')]){if(_0x8d454[_0xb618('0x6')][_0xb618('0xa')]){if(!_0x8d454[_0xb618('0x6')][_0xb618('0xb')])throw new Error(_0xb618('0xc'));_0x4528e7['auth']={'type':_0xb618('0xd'),'user':_0x8d454['Smtp']['user'],'accessToken':_0x8d454[_0xb618('0x6')][_0xb618('0xb')]['data5']};}else{_0x4528e7[_0xb618('0xe')]={'user':_0x8d454[_0xb618('0x6')][_0xb618('0xf')],'pass':_0x8d454['Smtp'][_0xb618('0x10')]};}}return _0x4528e7;}}});};