ca792b4f3c5aac68de854f0477666be716f46767
[motion2.git] / server / api / intZohoAccount / intZohoAccount.controller.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 _0xb0dc=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','name','send','map','ZohoAccount','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','type','VIRTUAL','merge','options','where','includeAll','findAll','rows','catch','show','intersection','find','create','body','update','destroy','params','getConfigurations','findOne','ZohoConfiguration','rawAttributes','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientSecret','serverUrl','code','refreshToken','host','zoho.eu','com','slice','substring','lastIndexOf','GET','format','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0xb0dc,0x101));var _0xcb0d=function(_0x17b012,_0x276485){_0x17b012=_0x17b012-0x0;var _0x5f3943=_0xb0dc[_0x17b012];return _0x5f3943;};'use strict';var emlformat=require(_0xcb0d('0x0'));var rimraf=require(_0xcb0d('0x1'));var zipdir=require(_0xcb0d('0x2'));var jsonpatch=require(_0xcb0d('0x3'));var rp=require(_0xcb0d('0x4'));var moment=require(_0xcb0d('0x5'));var BPromise=require(_0xcb0d('0x6'));var Mustache=require(_0xcb0d('0x7'));var util=require('util');var path=require(_0xcb0d('0x8'));var sox=require(_0xcb0d('0x9'));var csv=require(_0xcb0d('0xa'));var ejs=require(_0xcb0d('0xb'));var fs=require('fs');var fs_extra=require(_0xcb0d('0xc'));var _=require(_0xcb0d('0xd'));var squel=require(_0xcb0d('0xe'));var crypto=require(_0xcb0d('0xf'));var jsforce=require(_0xcb0d('0x10'));var deskjs=require(_0xcb0d('0x11'));var toCsv=require('to-csv');var querystring=require(_0xcb0d('0x12'));var Papa=require(_0xcb0d('0x13'));var Redis=require(_0xcb0d('0x14'));var authService=require(_0xcb0d('0x15'));var qs=require(_0xcb0d('0x16'));var as=require(_0xcb0d('0x17'));var hardwareService=require(_0xcb0d('0x18'));var logger=require(_0xcb0d('0x19'))('api');var utils=require(_0xcb0d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb0d('0x1b'))['db'];var integrations=require(_0xcb0d('0x1c'));function respondWithStatusCode(_0x906558,_0x38ab08){_0x38ab08=_0x38ab08||0xcc;return function(_0x8890b){if(_0x8890b){return _0x906558['sendStatus'](_0x38ab08);}return _0x906558[_0xcb0d('0x1d')](_0x38ab08)[_0xcb0d('0x1e')]();};}function respondWithResult(_0x4afd3e,_0x5e9d85){_0x5e9d85=_0x5e9d85||0xc8;return function(_0x25ddbe){if(_0x25ddbe){return _0x4afd3e[_0xcb0d('0x1d')](_0x5e9d85)[_0xcb0d('0x1f')](_0x25ddbe);}};}function respondWithFilteredResult(_0x5208e2,_0x516b2e){return function(_0x4fae7a){if(_0x4fae7a){var _0x251f74=typeof _0x516b2e[_0xcb0d('0x20')]===_0xcb0d('0x21')&&typeof _0x516b2e[_0xcb0d('0x22')]===_0xcb0d('0x21');var _0x1bdfac=_0x4fae7a[_0xcb0d('0x23')];var _0x41e5f3=_0x251f74?0x0:_0x516b2e[_0xcb0d('0x20')];var _0x16408c=_0x251f74?_0x4fae7a['count']:_0x516b2e[_0xcb0d('0x20')]+_0x516b2e[_0xcb0d('0x22')];var _0x30320b;if(_0x16408c>=_0x1bdfac){_0x16408c=_0x1bdfac;_0x30320b=0xc8;}else{_0x30320b=0xce;}_0x5208e2[_0xcb0d('0x1d')](_0x30320b);return _0x5208e2[_0xcb0d('0x24')](_0xcb0d('0x25'),_0x41e5f3+'-'+_0x16408c+'/'+_0x1bdfac)[_0xcb0d('0x1f')](_0x4fae7a);}return null;};}function patchUpdates(_0x5ac809){return function(_0xedaea2){try{jsonpatch[_0xcb0d('0x26')](_0xedaea2,_0x5ac809,!![]);}catch(_0x3307ad){return BPromise['reject'](_0x3307ad);}return _0xedaea2[_0xcb0d('0x27')]();};}function saveUpdates(_0x2e708f,_0x4ee7be){return function(_0x334159){if(_0x334159){return _0x334159['update'](_0x2e708f)[_0xcb0d('0x28')](function(_0x15ff4a){return _0x15ff4a;});}return null;};}function removeEntity(_0x55a8a1,_0x303a8f){return function(_0x7579d8){if(_0x7579d8){return _0x7579d8['destroy']()[_0xcb0d('0x28')](function(){_0x55a8a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37505b,_0x244c89){return function(_0x1fe77e){if(!_0x1fe77e){_0x37505b[_0xcb0d('0x29')](0x194);}return _0x1fe77e;};}function handleError(_0x5dbb61,_0xcafaa1){_0xcafaa1=_0xcafaa1||0x1f4;return function(_0x458f08){logger['error'](_0x458f08['stack']);if(_0x458f08[_0xcb0d('0x2a')]){delete _0x458f08['name'];}_0x5dbb61['status'](_0xcafaa1)[_0xcb0d('0x2b')](_0x458f08);};}exports['index']=function(_0x3ac2e2,_0x3a63e3){var _0x2a7e60={},_0x3241ec={},_0x27373b={'count':0x0,'rows':[]};var _0x140140=_[_0xcb0d('0x2c')](db[_0xcb0d('0x2d')]['rawAttributes'],function(_0x490a2f){return{'name':_0x490a2f[_0xcb0d('0x2e')],'type':_0x490a2f['type']['key']};});_0x3241ec[_0xcb0d('0x2f')]=_[_0xcb0d('0x2c')](_0x140140,_0xcb0d('0x2a'));_0x3241ec[_0xcb0d('0x30')]=_[_0xcb0d('0x31')](_0x3ac2e2[_0xcb0d('0x30')]);_0x3241ec[_0xcb0d('0x32')]=_['intersection'](_0x3241ec[_0xcb0d('0x2f')],_0x3241ec[_0xcb0d('0x30')]);_0x2a7e60[_0xcb0d('0x33')]=_['intersection'](_0x3241ec[_0xcb0d('0x2f')],qs['fields'](_0x3ac2e2[_0xcb0d('0x30')][_0xcb0d('0x34')]));_0x2a7e60['attributes']=_0x2a7e60['attributes'][_0xcb0d('0x35')]?_0x2a7e60['attributes']:_0x3241ec['model'];if(!_0x3ac2e2[_0xcb0d('0x30')][_0xcb0d('0x36')](_0xcb0d('0x37'))){_0x2a7e60[_0xcb0d('0x22')]=qs[_0xcb0d('0x22')](_0x3ac2e2[_0xcb0d('0x30')][_0xcb0d('0x22')]);_0x2a7e60[_0xcb0d('0x20')]=qs[_0xcb0d('0x20')](_0x3ac2e2[_0xcb0d('0x30')][_0xcb0d('0x20')]);}_0x2a7e60[_0xcb0d('0x38')]=qs['sort'](_0x3ac2e2['query'][_0xcb0d('0x39')]);_0x2a7e60['where']=qs[_0xcb0d('0x32')](_['pick'](_0x3ac2e2[_0xcb0d('0x30')],_0x3241ec[_0xcb0d('0x32')]),_0x140140);if(_0x3ac2e2['query'][_0xcb0d('0x3a')]){_0x2a7e60['where']=_['merge'](_0x2a7e60['where'],{'$or':_[_0xcb0d('0x2c')](_0x140140,function(_0x32bea3){if(_0x32bea3[_0xcb0d('0x3b')]!==_0xcb0d('0x3c')){var _0xa8d737={};_0xa8d737[_0x32bea3[_0xcb0d('0x2a')]]={'$like':'%'+_0x3ac2e2[_0xcb0d('0x30')][_0xcb0d('0x3a')]+'%'};return _0xa8d737;}})});}_0x2a7e60=_[_0xcb0d('0x3d')]({},_0x2a7e60,_0x3ac2e2[_0xcb0d('0x3e')]);var _0x41a50a={'where':_0x2a7e60[_0xcb0d('0x3f')]};return db[_0xcb0d('0x2d')]['count'](_0x41a50a)['then'](function(_0x44d658){_0x27373b[_0xcb0d('0x23')]=_0x44d658;if(_0x3ac2e2['query'][_0xcb0d('0x40')]){_0x2a7e60['include']=[{'all':!![]}];}return db[_0xcb0d('0x2d')][_0xcb0d('0x41')](_0x2a7e60);})[_0xcb0d('0x28')](function(_0x2cae07){_0x27373b[_0xcb0d('0x42')]=_0x2cae07;return _0x27373b;})[_0xcb0d('0x28')](respondWithFilteredResult(_0x3a63e3,_0x2a7e60))[_0xcb0d('0x43')](handleError(_0x3a63e3,null));};exports[_0xcb0d('0x44')]=function(_0x141e6d,_0x609b51){var _0x245987={'raw':![],'where':{'id':_0x141e6d['params']['id']}},_0xc35c8={};_0xc35c8[_0xcb0d('0x2f')]=_[_0xcb0d('0x31')](db[_0xcb0d('0x2d')]['rawAttributes']);_0xc35c8[_0xcb0d('0x30')]=_[_0xcb0d('0x31')](_0x141e6d[_0xcb0d('0x30')]);_0xc35c8['filters']=_[_0xcb0d('0x45')](_0xc35c8[_0xcb0d('0x2f')],_0xc35c8[_0xcb0d('0x30')]);_0x245987[_0xcb0d('0x33')]=_[_0xcb0d('0x45')](_0xc35c8[_0xcb0d('0x2f')],qs[_0xcb0d('0x34')](_0x141e6d[_0xcb0d('0x30')]['fields']));_0x245987['attributes']=_0x245987['attributes'][_0xcb0d('0x35')]?_0x245987[_0xcb0d('0x33')]:_0xc35c8['model'];if(_0x141e6d[_0xcb0d('0x30')][_0xcb0d('0x40')]){_0x245987['include']=[{'all':!![]}];}_0x245987=_['merge']({},_0x245987,_0x141e6d[_0xcb0d('0x3e')]);return db[_0xcb0d('0x2d')][_0xcb0d('0x46')](_0x245987)['then'](handleEntityNotFound(_0x609b51,null))[_0xcb0d('0x28')](respondWithResult(_0x609b51,null))[_0xcb0d('0x43')](handleError(_0x609b51,null));};exports[_0xcb0d('0x47')]=function(_0x1c3eb8,_0x52605d){return db['ZohoAccount']['create'](_0x1c3eb8[_0xcb0d('0x48')],{})[_0xcb0d('0x28')](respondWithResult(_0x52605d,0xc9))['catch'](handleError(_0x52605d,null));};exports[_0xcb0d('0x49')]=function(_0x4ed77e,_0x480714){if(_0x4ed77e[_0xcb0d('0x48')]['id']){delete _0x4ed77e[_0xcb0d('0x48')]['id'];}return db['ZohoAccount'][_0xcb0d('0x46')]({'where':{'id':_0x4ed77e['params']['id']}})[_0xcb0d('0x28')](handleEntityNotFound(_0x480714,null))[_0xcb0d('0x28')](saveUpdates(_0x4ed77e['body'],null))[_0xcb0d('0x28')](respondWithResult(_0x480714,null))[_0xcb0d('0x43')](handleError(_0x480714,null));};exports[_0xcb0d('0x4a')]=function(_0x35852e,_0x52bf36){return db[_0xcb0d('0x2d')][_0xcb0d('0x46')]({'where':{'id':_0x35852e[_0xcb0d('0x4b')]['id']}})[_0xcb0d('0x28')](handleEntityNotFound(_0x52bf36,null))[_0xcb0d('0x28')](removeEntity(_0x52bf36,null))[_0xcb0d('0x43')](handleError(_0x52bf36,null));};exports[_0xcb0d('0x4c')]=function(_0x38eb43,_0x5a05a8,_0x67a652){var _0x49e879={};var _0x17db81={};var _0x1ae2b0;var _0x4cbda1;return db[_0xcb0d('0x2d')][_0xcb0d('0x4d')]({'where':{'id':_0x38eb43[_0xcb0d('0x4b')]['id']}})[_0xcb0d('0x28')](handleEntityNotFound(_0x5a05a8,null))[_0xcb0d('0x28')](function(_0x35f48c){if(_0x35f48c){_0x1ae2b0=_0x35f48c;_0x17db81[_0xcb0d('0x2f')]=_[_0xcb0d('0x31')](db[_0xcb0d('0x4e')][_0xcb0d('0x4f')]);_0x17db81[_0xcb0d('0x30')]=_[_0xcb0d('0x31')](_0x38eb43[_0xcb0d('0x30')]);_0x17db81[_0xcb0d('0x32')]=_[_0xcb0d('0x45')](_0x17db81[_0xcb0d('0x2f')],_0x17db81[_0xcb0d('0x30')]);_0x49e879[_0xcb0d('0x33')]=_[_0xcb0d('0x45')](_0x17db81[_0xcb0d('0x2f')],qs[_0xcb0d('0x34')](_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x34')]));_0x49e879[_0xcb0d('0x33')]=_0x49e879['attributes'][_0xcb0d('0x35')]?_0x49e879[_0xcb0d('0x33')]:_0x17db81['model'];_0x49e879[_0xcb0d('0x38')]=qs[_0xcb0d('0x39')](_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x39')]);_0x49e879[_0xcb0d('0x3f')]=qs['filters'](_[_0xcb0d('0x50')](_0x38eb43[_0xcb0d('0x30')],_0x17db81[_0xcb0d('0x32')]));if(_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x3a')]){_0x49e879[_0xcb0d('0x3f')]=_[_0xcb0d('0x3d')](_0x49e879[_0xcb0d('0x3f')],{'$or':_[_0xcb0d('0x2c')](_0x49e879[_0xcb0d('0x33')],function(_0x47d9e6){var _0x16a4fc={};_0x16a4fc[_0x47d9e6]={'$like':'%'+_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x3a')]+'%'};return _0x16a4fc;})});}_0x49e879=_[_0xcb0d('0x3d')]({},_0x49e879,_0x38eb43[_0xcb0d('0x3e')]);return _0x1ae2b0['getConfigurations'](_0x49e879);}})[_0xcb0d('0x28')](function(_0x54592b){if(_0x54592b){_0x4cbda1=_0x54592b[_0xcb0d('0x35')];if(!_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x36')]('nolimit')){_0x49e879['limit']=qs[_0xcb0d('0x22')](_0x38eb43[_0xcb0d('0x30')]['limit']);_0x49e879[_0xcb0d('0x20')]=qs[_0xcb0d('0x20')](_0x38eb43[_0xcb0d('0x30')][_0xcb0d('0x20')]);}return _0x1ae2b0[_0xcb0d('0x4c')](_0x49e879);}})[_0xcb0d('0x28')](function(_0x563723){if(_0x563723){return _0x563723?{'count':_0x4cbda1,'rows':_0x563723}:null;}})['then'](respondWithResult(_0x5a05a8,null))[_0xcb0d('0x43')](handleError(_0x5a05a8,null));};exports['addConfiguration']=function(_0x3b198e,_0x37d2f6,_0x4a2658){if(_0x3b198e[_0xcb0d('0x48')]['id']){delete _0x3b198e[_0xcb0d('0x48')]['id'];}return db['ZohoAccount'][_0xcb0d('0x4d')]({'where':{'id':_0x3b198e['params']['id']}})[_0xcb0d('0x28')](handleEntityNotFound(_0x37d2f6,null))[_0xcb0d('0x28')](function(_0x1cc4b9){if(_0x1cc4b9){_0x3b198e[_0xcb0d('0x48')][_0xcb0d('0x51')]=_0x1cc4b9['id'];_0x3b198e[_0xcb0d('0x48')][_0xcb0d('0x52')]=integrations[_0xcb0d('0x53')](_0x3b198e[_0xcb0d('0x48')][_0xcb0d('0x54')],_0x3b198e[_0xcb0d('0x48')][_0xcb0d('0x3b')]);_0x3b198e['body']['Descriptions']=integrations[_0xcb0d('0x55')](_0x3b198e[_0xcb0d('0x48')]['channel'],_0x3b198e[_0xcb0d('0x48')][_0xcb0d('0x3b')]);return db[_0xcb0d('0x4e')]['create'](_0x3b198e['body'],{'include':[{'model':db[_0xcb0d('0x56')],'as':'Subjects'},{'model':db[_0xcb0d('0x56')],'as':_0xcb0d('0x57')}]});}return null;})[_0xcb0d('0x28')](respondWithResult(_0x37d2f6,null))[_0xcb0d('0x43')](handleError(_0x37d2f6,null));};function getAccessToken(_0x16c4ae){return new Promise(function(_0x4adf5a,_0x5183ab){var _0x2f0a4a;switch(_0x16c4ae[_0xcb0d('0x58')]){case'US':_0x2f0a4a=_0xcb0d('0x59');break;case'AU':_0x2f0a4a=_0xcb0d('0x5a');break;case'EU':_0x2f0a4a=_0xcb0d('0x5b');break;case'IN':_0x2f0a4a=_0xcb0d('0x5c');break;case'CN':_0x2f0a4a='https://accounts.zoho.com.cn';break;default:_0x2f0a4a=_0xcb0d('0x5b');break;}var _0xc6e636={'method':_0xcb0d('0x5d'),'uri':_0x2f0a4a+_0xcb0d('0x5e'),'qs':{'refresh_token':_0x16c4ae['refreshToken'],'client_id':_0x16c4ae[_0xcb0d('0x5f')],'client_secret':_0x16c4ae['clientSecret'],'grant_type':_0xcb0d('0x60')},'json':!![]};return rp(_0xc6e636)[_0xcb0d('0x28')](function(_0x49b422){if(_0x49b422[_0xcb0d('0x61')]){_0x4adf5a(_0x49b422[_0xcb0d('0x61')]);}else{_0x5183ab(_0xcb0d('0x62'));}})[_0xcb0d('0x43')](function(_0x5d6a0b){_0x5183ab(_0x5d6a0b);});});}exports['getFields']=function(_0x3972a2,_0x4d9f5e,_0x2bc1d9){var _0x475dc0,_0x46b55c,_0x4dc1b7,_0x4ded2c,_0x591c40;return db[_0xcb0d('0x2d')][_0xcb0d('0x4d')]({'where':{'id':_0x3972a2[_0xcb0d('0x4b')]['id']},'attributes':['id','host',_0xcb0d('0x58'),_0xcb0d('0x5f'),_0xcb0d('0x63'),_0xcb0d('0x64'),_0xcb0d('0x65'),_0xcb0d('0x66')]})['then'](handleEntityNotFound(_0x4d9f5e,null))[_0xcb0d('0x28')](function(_0x312ac5){_0x591c40=_0x312ac5;_0x475dc0=_0x591c40[_0xcb0d('0x67')];_0x46b55c=_0x475dc0===_0xcb0d('0x68')?'eu':_0xcb0d('0x69');_0x4dc1b7=_0x591c40[_0xcb0d('0x64')];var _0x54e5ed=_0x4dc1b7[_0xcb0d('0x6a')](-0x1);if(_0x54e5ed==='/'||_0x54e5ed==='\x5c'||_0x54e5ed===':'){_0x4dc1b7=_0x4dc1b7[_0xcb0d('0x6b')](0x0,_0x4dc1b7[_0xcb0d('0x6c')](_0x54e5ed));}if(!_0x591c40[_0xcb0d('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x591c40);})[_0xcb0d('0x28')](function(_0x550db2){if(_0x550db2){return rp({'method':_0xcb0d('0x6d'),'uri':util[_0xcb0d('0x6e')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x46b55c),'qs':{'module':'Calls'},'headers':{'Authorization':_0xcb0d('0x6f')+_0x550db2},'json':!![]});}})[_0xcb0d('0x28')](function(_0x43a6d1){if(_0x43a6d1){if(_0x43a6d1[_0xcb0d('0x70')]&&_0x43a6d1['response'][_0xcb0d('0x71')]){throw new Error(_0x43a6d1[_0xcb0d('0x70')][_0xcb0d('0x71')][_0xcb0d('0x72')]);}var _0x24c46f=[];var _0x227202=[];var _0x5935a3=[_0xcb0d('0x73'),_0xcb0d('0x74'),_0xcb0d('0x75'),_0xcb0d('0x76'),_0xcb0d('0x77'),'Call_Result','Call_Start_Time',_0xcb0d('0x78')];_0x227202=_['remove'](_0x43a6d1[_0xcb0d('0x34')],function(_0x30b9bb){return _0x5935a3[_0xcb0d('0x79')](_0x30b9bb[_0xcb0d('0x7a')]);});for(var _0x3d6652=0x0;_0x3d6652<_0x227202[_0xcb0d('0x35')];_0x3d6652++){if(_0x227202[_0x3d6652][_0xcb0d('0x7b')]===![]){_0x24c46f[_0xcb0d('0x7c')]({'id':_0x227202[_0x3d6652]['id'],'name':_0x227202[_0x3d6652][_0xcb0d('0x7d')],'custom':_0x227202[_0x3d6652][_0xcb0d('0x7e')],'options':_0x227202[_0x3d6652][_0xcb0d('0x7f')]===_0xcb0d('0x80')&&_0x227202[_0x3d6652]['pick_list_values'][_0xcb0d('0x35')]>-0x1?_[_0xcb0d('0x2c')](_0x227202[_0x3d6652]['pick_list_values'],function(_0x1f7ba5){return{'name':_0x1f7ba5,'value':_0x1f7ba5};}):[]});}}return{'count':_0x24c46f[_0xcb0d('0x35')],'rows':_0x24c46f};}else{return{'count':0x0,'rows':[]};}})[_0xcb0d('0x28')](respondWithResult(_0x4d9f5e,null))[_0xcb0d('0x43')](function(_0x384754){var _0xd502fe=_0x3972a2[_0xcb0d('0x30')][_0xcb0d('0x81')]?0x1f4:_0x384754[_0xcb0d('0x82')]||0x1f4;logger[_0xcb0d('0x71')](_0xcb0d('0x83'),'getFields',_0xd502fe,JSON[_0xcb0d('0x84')](_0x384754));delete _0x384754['name'];if(_0xd502fe===0x191){_0xd502fe=0x190;}_0x4d9f5e[_0xcb0d('0x1d')](_0xd502fe)[_0xcb0d('0x2b')](_0x3972a2[_0xcb0d('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x384754['statusCode']}:_0x384754);});};