Built motion from commit 953226e6.|2.6.32
[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 _0xa979=['service','provider','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','auth','user','data5','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','custom'];(function(_0x118858,_0x22d304){var _0x611d35=function(_0x127b09){while(--_0x127b09){_0x118858['push'](_0x118858['shift']());}};_0x611d35(++_0x22d304);}(_0xa979,0x1cf));var _0x9a97=function(_0x1aa617,_0x23271a){_0x1aa617=_0x1aa617-0x0;var _0x38653c=_0xa979[_0x1aa617];return _0x38653c;};'use strict';var attributes=require(_0x9a97('0x0'));module[_0x9a97('0x1')]=function(_0x51742d){return _0x51742d['define'](_0x9a97('0x2'),attributes,{'tableName':_0x9a97('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x193bb1=this;var _0x274b91={'id':_0x193bb1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x193bb1['provider']!==_0x9a97('0x4')){_0x274b91[_0x9a97('0x5')]=_0x193bb1[_0x9a97('0x6')];}else{_0x274b91['host']=_0x193bb1[_0x9a97('0x7')][_0x9a97('0x8')];_0x274b91[_0x9a97('0x9')]=_0x193bb1[_0x9a97('0x7')]['port'];_0x274b91[_0x9a97('0xa')]=_0x193bb1[_0x9a97('0x7')][_0x9a97('0xa')];}if(_0x193bb1[_0x9a97('0x7')][_0x9a97('0xb')]){if(_0x193bb1[_0x9a97('0x7')][_0x9a97('0xc')]){if(!_0x193bb1[_0x9a97('0x7')][_0x9a97('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x274b91[_0x9a97('0xe')]={'type':'OAuth2','user':_0x193bb1[_0x9a97('0x7')][_0x9a97('0xf')],'accessToken':_0x193bb1[_0x9a97('0x7')][_0x9a97('0xd')][_0x9a97('0x10')]};}else{_0x274b91[_0x9a97('0xe')]={'user':_0x193bb1[_0x9a97('0x7')][_0x9a97('0xf')],'pass':_0x193bb1['Smtp'][_0x9a97('0x11')]};}}return _0x274b91;}}});};