Built motion from commit dc14b02d.|2.6.27
[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 _0x60c1=['data5','./mailAccount.attributes','define','mail_accounts','custom','service','provider','host','port','Smtp','secure','modernAuthentication','CloudProvider','auth','user'];(function(_0x5deb52,_0x3d267b){var _0x51b405=function(_0x2c145a){while(--_0x2c145a){_0x5deb52['push'](_0x5deb52['shift']());}};_0x51b405(++_0x3d267b);}(_0x60c1,0x13c));var _0x160c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x60c1[_0x59ee6f];return _0x4c0979;};'use strict';var attributes=require(_0x160c('0x0'));module['exports']=function(_0x135597){return _0x135597[_0x160c('0x1')]('MailAccount',attributes,{'tableName':_0x160c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x49ab6d=this;var _0x2a7149={'id':_0x49ab6d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x49ab6d['provider']!==_0x160c('0x3')){_0x2a7149[_0x160c('0x4')]=_0x49ab6d[_0x160c('0x5')];}else{_0x2a7149[_0x160c('0x6')]=_0x49ab6d['Smtp'][_0x160c('0x6')];_0x2a7149[_0x160c('0x7')]=_0x49ab6d[_0x160c('0x8')]['port'];_0x2a7149[_0x160c('0x9')]=_0x49ab6d['Smtp'][_0x160c('0x9')];}if(_0x49ab6d[_0x160c('0x8')]['authentication']){if(_0x49ab6d[_0x160c('0x8')][_0x160c('0xa')]){if(!_0x49ab6d[_0x160c('0x8')][_0x160c('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x2a7149[_0x160c('0xc')]={'type':'OAuth2','user':_0x49ab6d[_0x160c('0x8')][_0x160c('0xd')],'accessToken':_0x49ab6d['Smtp']['CloudProvider'][_0x160c('0xe')]};}else{_0x2a7149[_0x160c('0xc')]={'user':_0x49ab6d[_0x160c('0x8')]['user'],'pass':_0x49ab6d['Smtp']['pass']};}}return _0x2a7149;}}});};