9c0088c074d7904c1804fc85f9711fb9dc6e4e07
[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 _0x713a=['MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','define'];(function(_0x1a2906,_0x5ee08f){var _0x82a462=function(_0x3c7a12){while(--_0x3c7a12){_0x1a2906['push'](_0x1a2906['shift']());}};_0x82a462(++_0x5ee08f);}(_0x713a,0x1ae));var _0xa713=function(_0x36bfe4,_0x2166d0){_0x36bfe4=_0x36bfe4-0x0;var _0x35eece=_0x713a[_0x36bfe4];return _0x35eece;};'use strict';var attributes=require(_0xa713('0x0'));module['exports']=function(_0x8d7191){return _0x8d7191[_0xa713('0x1')](_0xa713('0x2'),attributes,{'tableName':_0xa713('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x55e57a=this;var _0x58f394={'id':_0x55e57a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x55e57a[_0xa713('0x4')]!==_0xa713('0x5')){_0x58f394[_0xa713('0x6')]=_0x55e57a['provider'];}else{_0x58f394['host']=_0x55e57a['Smtp'][_0xa713('0x7')];_0x58f394[_0xa713('0x8')]=_0x55e57a[_0xa713('0x9')]['port'];_0x58f394[_0xa713('0xa')]=_0x55e57a[_0xa713('0x9')][_0xa713('0xa')];}if(_0x55e57a[_0xa713('0x9')]['authentication']){if(_0x55e57a['Smtp'][_0xa713('0xb')]){if(!_0x55e57a[_0xa713('0x9')][_0xa713('0xc')])throw new Error(_0xa713('0xd'));_0x58f394[_0xa713('0xe')]={'type':_0xa713('0xf'),'user':_0x55e57a[_0xa713('0x9')][_0xa713('0x10')],'accessToken':_0x55e57a['Smtp'][_0xa713('0xc')]['data5']};}else{_0x58f394[_0xa713('0xe')]={'user':_0x55e57a[_0xa713('0x9')][_0xa713('0x10')],'pass':_0x55e57a[_0xa713('0x9')][_0xa713('0x11')]};}}return _0x58f394;}}});};