Built motion from commit e1760111.|2.6.18
[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 _0xd57b=['./mailAccount.attributes','exports','define','mail_accounts','custom','service','Smtp','host','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','user','CloudProvider','data5'];(function(_0x5653da,_0x3a0b8f){var _0x1199b5=function(_0x42c50d){while(--_0x42c50d){_0x5653da['push'](_0x5653da['shift']());}};_0x1199b5(++_0x3a0b8f);}(_0xd57b,0xd0));var _0xbd57=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0xd57b[_0x223461];return _0x4dbe0a;};'use strict';var attributes=require(_0xbd57('0x0'));module[_0xbd57('0x1')]=function(_0x20c95f){return _0x20c95f[_0xbd57('0x2')]('MailAccount',attributes,{'tableName':_0xbd57('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3565fd=this;var _0x3259a3={'id':_0x3565fd['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3565fd['provider']!==_0xbd57('0x4')){_0x3259a3[_0xbd57('0x5')]=_0x3565fd['provider'];}else{_0x3259a3['host']=_0x3565fd[_0xbd57('0x6')][_0xbd57('0x7')];_0x3259a3['port']=_0x3565fd[_0xbd57('0x6')][_0xbd57('0x8')];_0x3259a3[_0xbd57('0x9')]=_0x3565fd[_0xbd57('0x6')][_0xbd57('0x9')];}if(_0x3565fd[_0xbd57('0x6')][_0xbd57('0xa')]){if(_0x3565fd['Smtp'][_0xbd57('0xb')]){if(!_0x3565fd['Smtp']['CloudProvider'])throw new Error(_0xbd57('0xc'));_0x3259a3['auth']={'type':'OAuth2','user':_0x3565fd['Smtp'][_0xbd57('0xd')],'accessToken':_0x3565fd[_0xbd57('0x6')][_0xbd57('0xe')][_0xbd57('0xf')]};}else{_0x3259a3['auth']={'user':_0x3565fd[_0xbd57('0x6')][_0xbd57('0xd')],'pass':_0x3565fd['Smtp']['pass']};}}return _0x3259a3;}}});};