9061c740db06f483664f17b96071d75c7bd8438d
[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 _0x0e75=['Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','Smtp','host','port','secure','modernAuthentication','CloudProvider'];(function(_0x508c41,_0x27a103){var _0xead227=function(_0x221c3f){while(--_0x221c3f){_0x508c41['push'](_0x508c41['shift']());}};_0xead227(++_0x27a103);}(_0x0e75,0x149));var _0x50e7=function(_0x32e5c3,_0x3fbf14){_0x32e5c3=_0x32e5c3-0x0;var _0x510383=_0x0e75[_0x32e5c3];return _0x510383;};'use strict';var attributes=require(_0x50e7('0x0'));module['exports']=function(_0x456ca3){return _0x456ca3[_0x50e7('0x1')](_0x50e7('0x2'),attributes,{'tableName':_0x50e7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x22c778=this;var _0x547564={'id':_0x22c778['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22c778[_0x50e7('0x4')]!==_0x50e7('0x5')){_0x547564[_0x50e7('0x6')]=_0x22c778[_0x50e7('0x4')];}else{_0x547564['host']=_0x22c778[_0x50e7('0x7')][_0x50e7('0x8')];_0x547564[_0x50e7('0x9')]=_0x22c778[_0x50e7('0x7')][_0x50e7('0x9')];_0x547564[_0x50e7('0xa')]=_0x22c778[_0x50e7('0x7')]['secure'];}if(_0x22c778[_0x50e7('0x7')]['authentication']){if(_0x22c778['Smtp'][_0x50e7('0xb')]){if(!_0x22c778['Smtp'][_0x50e7('0xc')])throw new Error(_0x50e7('0xd'));_0x547564[_0x50e7('0xe')]={'type':'OAuth2','user':_0x22c778['Smtp'][_0x50e7('0xf')],'accessToken':_0x22c778['Smtp'][_0x50e7('0xc')][_0x50e7('0x10')]};}else{_0x547564[_0x50e7('0xe')]={'user':_0x22c778[_0x50e7('0x7')]['user'],'pass':_0x22c778[_0x50e7('0x7')][_0x50e7('0x11')]};}}return _0x547564;}}});};