Built motion from commit 88aa8522.|2.5.37
[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 _0xaf6e=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','ZohoAccount','type','map','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','catch','show','keys','length','includeAll','find','create','body','update','params','getConfigurations','findOne','ZohoConfiguration','rawAttributes','nolimit','addConfiguration','AccountId','channel','Descriptions','ZohoField','Subjects','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x478d90,_0x5d095c){var _0x30950f=function(_0x2b696b){while(--_0x2b696b){_0x478d90['push'](_0x478d90['shift']());}};_0x30950f(++_0x5d095c);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x39d62f,_0x109768){_0x39d62f=_0x39d62f-0x0;var _0xacf8b=_0xaf6e[_0x39d62f];return _0xacf8b;};'use strict';var emlformat=require(_0xeaf6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeaf6('0x1'));var rp=require(_0xeaf6('0x2'));var moment=require(_0xeaf6('0x3'));var BPromise=require(_0xeaf6('0x4'));var Mustache=require('mustache');var util=require(_0xeaf6('0x5'));var path=require(_0xeaf6('0x6'));var sox=require(_0xeaf6('0x7'));var csv=require(_0xeaf6('0x8'));var ejs=require(_0xeaf6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xeaf6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xeaf6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xeaf6('0xc'));var Papa=require(_0xeaf6('0xd'));var Redis=require(_0xeaf6('0xe'));var authService=require(_0xeaf6('0xf'));var qs=require(_0xeaf6('0x10'));var as=require(_0xeaf6('0x11'));var hardwareService=require(_0xeaf6('0x12'));var logger=require(_0xeaf6('0x13'))(_0xeaf6('0x14'));var utils=require(_0xeaf6('0x15'));var config=require(_0xeaf6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xeaf6('0x17'))['db'];var integrations=require(_0xeaf6('0x18'));function respondWithStatusCode(_0x1ba525,_0x1c550b){_0x1c550b=_0x1c550b||0xcc;return function(_0x20ac58){if(_0x20ac58){return _0x1ba525[_0xeaf6('0x19')](_0x1c550b);}return _0x1ba525[_0xeaf6('0x1a')](_0x1c550b)[_0xeaf6('0x1b')]();};}function respondWithResult(_0x5ed8ce,_0x4a7e50){_0x4a7e50=_0x4a7e50||0xc8;return function(_0x3626e7){if(_0x3626e7){return _0x5ed8ce[_0xeaf6('0x1a')](_0x4a7e50)[_0xeaf6('0x1c')](_0x3626e7);}};}function respondWithFilteredResult(_0x46418d,_0xd862fb){return function(_0x49c1c5){if(_0x49c1c5){var _0x1437f9=typeof _0xd862fb[_0xeaf6('0x1d')]===_0xeaf6('0x1e')&&typeof _0xd862fb[_0xeaf6('0x1f')]===_0xeaf6('0x1e');var _0x3ee990=_0x49c1c5[_0xeaf6('0x20')];var _0x5cc9eb=_0x1437f9?0x0:_0xd862fb[_0xeaf6('0x1d')];var _0x1c2ba9=_0x1437f9?_0x49c1c5[_0xeaf6('0x20')]:_0xd862fb['offset']+_0xd862fb['limit'];var _0x12a425;if(_0x1c2ba9>=_0x3ee990){_0x1c2ba9=_0x3ee990;_0x12a425=0xc8;}else{_0x12a425=0xce;}_0x46418d[_0xeaf6('0x1a')](_0x12a425);return _0x46418d[_0xeaf6('0x21')](_0xeaf6('0x22'),_0x5cc9eb+'-'+_0x1c2ba9+'/'+_0x3ee990)[_0xeaf6('0x1c')](_0x49c1c5);}return null;};}function patchUpdates(_0x28bfde){return function(_0x2258f3){try{jsonpatch[_0xeaf6('0x23')](_0x2258f3,_0x28bfde,!![]);}catch(_0x3c96d8){return BPromise[_0xeaf6('0x24')](_0x3c96d8);}return _0x2258f3[_0xeaf6('0x25')]();};}function saveUpdates(_0x39fb66,_0x4756ee){return function(_0x497f7a){if(_0x497f7a){return _0x497f7a['update'](_0x39fb66)['then'](function(_0x22a5a9){return _0x22a5a9;});}return null;};}function removeEntity(_0x114f45,_0x14b82d){return function(_0x38ba28){if(_0x38ba28){return _0x38ba28[_0xeaf6('0x26')]()[_0xeaf6('0x27')](function(){_0x114f45['status'](0xcc)[_0xeaf6('0x1b')]();});}};}function handleEntityNotFound(_0x28df58,_0x2a3706){return function(_0x233e86){if(!_0x233e86){_0x28df58['sendStatus'](0x194);}return _0x233e86;};}function handleError(_0xf5fe2c,_0x2e0713){_0x2e0713=_0x2e0713||0x1f4;return function(_0x497373){logger[_0xeaf6('0x28')](_0x497373[_0xeaf6('0x29')]);if(_0x497373[_0xeaf6('0x2a')]){delete _0x497373[_0xeaf6('0x2a')];}_0xf5fe2c[_0xeaf6('0x1a')](_0x2e0713)[_0xeaf6('0x2b')](_0x497373);};}exports[_0xeaf6('0x2c')]=function(_0x339884,_0x38d7c1){var _0x1cc040={},_0xa47042={},_0x3451f4={'count':0x0,'rows':[]};var _0x35a124=_['map'](db[_0xeaf6('0x2d')]['rawAttributes'],function(_0x2efb28){return{'name':_0x2efb28['fieldName'],'type':_0x2efb28[_0xeaf6('0x2e')]['key']};});_0xa47042['model']=_[_0xeaf6('0x2f')](_0x35a124,_0xeaf6('0x2a'));_0xa47042[_0xeaf6('0x30')]=_['keys'](_0x339884['query']);_0xa47042['filters']=_[_0xeaf6('0x31')](_0xa47042[_0xeaf6('0x32')],_0xa47042[_0xeaf6('0x30')]);_0x1cc040[_0xeaf6('0x33')]=_['intersection'](_0xa47042[_0xeaf6('0x32')],qs[_0xeaf6('0x34')](_0x339884[_0xeaf6('0x30')][_0xeaf6('0x34')]));_0x1cc040['attributes']=_0x1cc040['attributes']['length']?_0x1cc040[_0xeaf6('0x33')]:_0xa47042[_0xeaf6('0x32')];if(!_0x339884[_0xeaf6('0x30')][_0xeaf6('0x35')]('nolimit')){_0x1cc040[_0xeaf6('0x1f')]=qs[_0xeaf6('0x1f')](_0x339884[_0xeaf6('0x30')]['limit']);_0x1cc040[_0xeaf6('0x1d')]=qs[_0xeaf6('0x1d')](_0x339884[_0xeaf6('0x30')][_0xeaf6('0x1d')]);}_0x1cc040[_0xeaf6('0x36')]=qs[_0xeaf6('0x37')](_0x339884[_0xeaf6('0x30')][_0xeaf6('0x37')]);_0x1cc040[_0xeaf6('0x38')]=qs['filters'](_[_0xeaf6('0x39')](_0x339884['query'],_0xa47042[_0xeaf6('0x3a')]),_0x35a124);if(_0x339884['query'][_0xeaf6('0x3b')]){_0x1cc040[_0xeaf6('0x38')]=_[_0xeaf6('0x3c')](_0x1cc040['where'],{'$or':_[_0xeaf6('0x2f')](_0x35a124,function(_0x34dc0e){if(_0x34dc0e[_0xeaf6('0x2e')]!==_0xeaf6('0x3d')){var _0x23c5ad={};_0x23c5ad[_0x34dc0e[_0xeaf6('0x2a')]]={'$like':'%'+_0x339884[_0xeaf6('0x30')][_0xeaf6('0x3b')]+'%'};return _0x23c5ad;}})});}_0x1cc040=_[_0xeaf6('0x3c')]({},_0x1cc040,_0x339884[_0xeaf6('0x3e')]);var _0x48f8dd={'where':_0x1cc040[_0xeaf6('0x38')]};return db[_0xeaf6('0x2d')][_0xeaf6('0x20')](_0x48f8dd)[_0xeaf6('0x27')](function(_0x45160b){_0x3451f4[_0xeaf6('0x20')]=_0x45160b;if(_0x339884[_0xeaf6('0x30')]['includeAll']){_0x1cc040[_0xeaf6('0x3f')]=[{'all':!![]}];}return db[_0xeaf6('0x2d')]['findAll'](_0x1cc040);})[_0xeaf6('0x27')](function(_0x416818){_0x3451f4['rows']=_0x416818;return _0x3451f4;})['then'](respondWithFilteredResult(_0x38d7c1,_0x1cc040))[_0xeaf6('0x40')](handleError(_0x38d7c1,null));};exports[_0xeaf6('0x41')]=function(_0x1acd59,_0x289d58){var _0x399b74={'raw':![],'where':{'id':_0x1acd59['params']['id']}},_0x1ad237={};_0x1ad237['model']=_[_0xeaf6('0x42')](db['ZohoAccount']['rawAttributes']);_0x1ad237[_0xeaf6('0x30')]=_['keys'](_0x1acd59[_0xeaf6('0x30')]);_0x1ad237[_0xeaf6('0x3a')]=_[_0xeaf6('0x31')](_0x1ad237[_0xeaf6('0x32')],_0x1ad237[_0xeaf6('0x30')]);_0x399b74[_0xeaf6('0x33')]=_[_0xeaf6('0x31')](_0x1ad237['model'],qs[_0xeaf6('0x34')](_0x1acd59[_0xeaf6('0x30')][_0xeaf6('0x34')]));_0x399b74[_0xeaf6('0x33')]=_0x399b74[_0xeaf6('0x33')][_0xeaf6('0x43')]?_0x399b74[_0xeaf6('0x33')]:_0x1ad237['model'];if(_0x1acd59[_0xeaf6('0x30')][_0xeaf6('0x44')]){_0x399b74[_0xeaf6('0x3f')]=[{'all':!![]}];}_0x399b74=_[_0xeaf6('0x3c')]({},_0x399b74,_0x1acd59[_0xeaf6('0x3e')]);return db[_0xeaf6('0x2d')][_0xeaf6('0x45')](_0x399b74)['then'](handleEntityNotFound(_0x289d58,null))[_0xeaf6('0x27')](respondWithResult(_0x289d58,null))[_0xeaf6('0x40')](handleError(_0x289d58,null));};exports[_0xeaf6('0x46')]=function(_0xb98911,_0x278dee){return db[_0xeaf6('0x2d')][_0xeaf6('0x46')](_0xb98911[_0xeaf6('0x47')],{})[_0xeaf6('0x27')](respondWithResult(_0x278dee,0xc9))[_0xeaf6('0x40')](handleError(_0x278dee,null));};exports[_0xeaf6('0x48')]=function(_0x487a2d,_0x5087f2){if(_0x487a2d[_0xeaf6('0x47')]['id']){delete _0x487a2d[_0xeaf6('0x47')]['id'];}return db[_0xeaf6('0x2d')][_0xeaf6('0x45')]({'where':{'id':_0x487a2d[_0xeaf6('0x49')]['id']}})[_0xeaf6('0x27')](handleEntityNotFound(_0x5087f2,null))[_0xeaf6('0x27')](saveUpdates(_0x487a2d[_0xeaf6('0x47')],null))[_0xeaf6('0x27')](respondWithResult(_0x5087f2,null))[_0xeaf6('0x40')](handleError(_0x5087f2,null));};exports[_0xeaf6('0x26')]=function(_0x39d1ed,_0x579236){return db[_0xeaf6('0x2d')]['find']({'where':{'id':_0x39d1ed[_0xeaf6('0x49')]['id']}})['then'](handleEntityNotFound(_0x579236,null))[_0xeaf6('0x27')](removeEntity(_0x579236,null))[_0xeaf6('0x40')](handleError(_0x579236,null));};exports[_0xeaf6('0x4a')]=function(_0x53c390,_0x43c2ed,_0x137f10){var _0x50bf14={};var _0x162efb={};var _0xd4fb40;var _0x6a959f;return db[_0xeaf6('0x2d')][_0xeaf6('0x4b')]({'where':{'id':_0x53c390[_0xeaf6('0x49')]['id']}})[_0xeaf6('0x27')](handleEntityNotFound(_0x43c2ed,null))[_0xeaf6('0x27')](function(_0x5acb3f){if(_0x5acb3f){_0xd4fb40=_0x5acb3f;_0x162efb[_0xeaf6('0x32')]=_[_0xeaf6('0x42')](db[_0xeaf6('0x4c')][_0xeaf6('0x4d')]);_0x162efb['query']=_[_0xeaf6('0x42')](_0x53c390[_0xeaf6('0x30')]);_0x162efb[_0xeaf6('0x3a')]=_[_0xeaf6('0x31')](_0x162efb[_0xeaf6('0x32')],_0x162efb[_0xeaf6('0x30')]);_0x50bf14['attributes']=_[_0xeaf6('0x31')](_0x162efb['model'],qs[_0xeaf6('0x34')](_0x53c390[_0xeaf6('0x30')]['fields']));_0x50bf14[_0xeaf6('0x33')]=_0x50bf14[_0xeaf6('0x33')][_0xeaf6('0x43')]?_0x50bf14[_0xeaf6('0x33')]:_0x162efb[_0xeaf6('0x32')];_0x50bf14[_0xeaf6('0x36')]=qs[_0xeaf6('0x37')](_0x53c390['query'][_0xeaf6('0x37')]);_0x50bf14[_0xeaf6('0x38')]=qs[_0xeaf6('0x3a')](_['pick'](_0x53c390[_0xeaf6('0x30')],_0x162efb[_0xeaf6('0x3a')]));if(_0x53c390[_0xeaf6('0x30')][_0xeaf6('0x3b')]){_0x50bf14[_0xeaf6('0x38')]=_[_0xeaf6('0x3c')](_0x50bf14[_0xeaf6('0x38')],{'$or':_[_0xeaf6('0x2f')](_0x50bf14[_0xeaf6('0x33')],function(_0x5e2522){var _0x3f8c13={};_0x3f8c13[_0x5e2522]={'$like':'%'+_0x53c390['query'][_0xeaf6('0x3b')]+'%'};return _0x3f8c13;})});}_0x50bf14=_[_0xeaf6('0x3c')]({},_0x50bf14,_0x53c390[_0xeaf6('0x3e')]);return _0xd4fb40[_0xeaf6('0x4a')](_0x50bf14);}})[_0xeaf6('0x27')](function(_0x5e7a14){if(_0x5e7a14){_0x6a959f=_0x5e7a14[_0xeaf6('0x43')];if(!_0x53c390[_0xeaf6('0x30')][_0xeaf6('0x35')](_0xeaf6('0x4e'))){_0x50bf14[_0xeaf6('0x1f')]=qs['limit'](_0x53c390['query'][_0xeaf6('0x1f')]);_0x50bf14[_0xeaf6('0x1d')]=qs[_0xeaf6('0x1d')](_0x53c390[_0xeaf6('0x30')][_0xeaf6('0x1d')]);}return _0xd4fb40[_0xeaf6('0x4a')](_0x50bf14);}})[_0xeaf6('0x27')](function(_0x25d7a2){if(_0x25d7a2){return _0x25d7a2?{'count':_0x6a959f,'rows':_0x25d7a2}:null;}})[_0xeaf6('0x27')](respondWithResult(_0x43c2ed,null))[_0xeaf6('0x40')](handleError(_0x43c2ed,null));};exports[_0xeaf6('0x4f')]=function(_0x1a8a8f,_0x33d1f8,_0xee3aad){if(_0x1a8a8f[_0xeaf6('0x47')]['id']){delete _0x1a8a8f['body']['id'];}return db['ZohoAccount'][_0xeaf6('0x4b')]({'where':{'id':_0x1a8a8f[_0xeaf6('0x49')]['id']}})[_0xeaf6('0x27')](handleEntityNotFound(_0x33d1f8,null))[_0xeaf6('0x27')](function(_0x4a590d){if(_0x4a590d){_0x1a8a8f['body'][_0xeaf6('0x50')]=_0x4a590d['id'];_0x1a8a8f[_0xeaf6('0x47')]['Subjects']=integrations['getSubjects'](_0x1a8a8f[_0xeaf6('0x47')][_0xeaf6('0x51')],_0x1a8a8f[_0xeaf6('0x47')]['type']);_0x1a8a8f['body'][_0xeaf6('0x52')]=integrations['getDescriptions'](_0x1a8a8f[_0xeaf6('0x47')][_0xeaf6('0x51')],_0x1a8a8f[_0xeaf6('0x47')][_0xeaf6('0x2e')]);return db[_0xeaf6('0x4c')][_0xeaf6('0x46')](_0x1a8a8f[_0xeaf6('0x47')],{'include':[{'model':db[_0xeaf6('0x53')],'as':_0xeaf6('0x54')},{'model':db['ZohoField'],'as':_0xeaf6('0x52')}]});}return null;})['then'](respondWithResult(_0x33d1f8,null))[_0xeaf6('0x40')](handleError(_0x33d1f8,null));};function getAccessToken(_0x273a77){return new Promise(function(_0x3e0c4b,_0x6073d3){var _0x2974d9;switch(_0x273a77[_0xeaf6('0x55')]){case'US':_0x2974d9='https://accounts.zoho.com';break;case'AU':_0x2974d9=_0xeaf6('0x56');break;case'EU':_0x2974d9='https://accounts.zoho.eu';break;case'IN':_0x2974d9=_0xeaf6('0x57');break;case'CN':_0x2974d9='https://accounts.zoho.com.cn';break;default:_0x2974d9=_0xeaf6('0x58');break;}var _0x2dd8b9={'method':_0xeaf6('0x59'),'uri':_0x2974d9+'/oauth/v2/token','qs':{'refresh_token':_0x273a77[_0xeaf6('0x5a')],'client_id':_0x273a77[_0xeaf6('0x5b')],'client_secret':_0x273a77[_0xeaf6('0x5c')],'grant_type':_0xeaf6('0x5d')},'json':!![]};return rp(_0x2dd8b9)[_0xeaf6('0x27')](function(_0x55c07a){if(_0x55c07a[_0xeaf6('0x5e')]){_0x3e0c4b(_0x55c07a[_0xeaf6('0x5e')]);}else{_0x6073d3(_0xeaf6('0x5f'));}})[_0xeaf6('0x40')](function(_0x7f5acb){_0x6073d3(_0x7f5acb);});});}exports[_0xeaf6('0x60')]=function(_0x3d214c,_0x28fb49,_0x3dc2f2){var _0x4f49d9,_0x6c065e,_0x3beb48,_0x144aa4,_0x134414;return db[_0xeaf6('0x2d')]['findOne']({'where':{'id':_0x3d214c[_0xeaf6('0x49')]['id']},'attributes':['id','host',_0xeaf6('0x55'),_0xeaf6('0x5b'),_0xeaf6('0x5c'),'serverUrl','code',_0xeaf6('0x5a')]})['then'](handleEntityNotFound(_0x28fb49,null))[_0xeaf6('0x27')](function(_0x5ea8a8){_0x134414=_0x5ea8a8;_0x4f49d9=_0x134414[_0xeaf6('0x61')];_0x6c065e=_0x4f49d9==='zoho.eu'?'eu':_0xeaf6('0x62');_0x3beb48=_0x134414[_0xeaf6('0x63')];var _0x5242d2=_0x3beb48[_0xeaf6('0x64')](-0x1);if(_0x5242d2==='/'||_0x5242d2==='\x5c'||_0x5242d2===':'){_0x3beb48=_0x3beb48[_0xeaf6('0x65')](0x0,_0x3beb48[_0xeaf6('0x66')](_0x5242d2));}if(!_0x134414[_0xeaf6('0x5a')]){throw new Error(_0xeaf6('0x67'));}return getAccessToken(_0x134414);})[_0xeaf6('0x27')](function(_0x25891b){if(_0x25891b){return rp({'method':_0xeaf6('0x68'),'uri':util[_0xeaf6('0x69')](_0xeaf6('0x6a'),_0x6c065e),'qs':{'module':_0xeaf6('0x6b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x25891b},'json':!![]});}})[_0xeaf6('0x27')](function(_0x10f211){if(_0x10f211){if(_0x10f211['response']&&_0x10f211[_0xeaf6('0x6c')][_0xeaf6('0x28')]){throw new Error(_0x10f211['response'][_0xeaf6('0x28')][_0xeaf6('0x6d')]);}var _0x19d659=[];var _0x5e908e=[];var _0x107724=[_0xeaf6('0x6e'),_0xeaf6('0x6f'),_0xeaf6('0x70'),_0xeaf6('0x71'),_0xeaf6('0x72'),_0xeaf6('0x73'),_0xeaf6('0x74'),'Call_Type'];_0x5e908e=_[_0xeaf6('0x75')](_0x10f211[_0xeaf6('0x34')],function(_0x25b657){return _0x107724[_0xeaf6('0x76')](_0x25b657[_0xeaf6('0x77')]);});for(var _0x18be06=0x0;_0x18be06<_0x5e908e[_0xeaf6('0x43')];_0x18be06++){if(_0x5e908e[_0x18be06][_0xeaf6('0x78')]===![]){_0x19d659[_0xeaf6('0x79')]({'id':_0x5e908e[_0x18be06]['id'],'name':_0x5e908e[_0x18be06][_0xeaf6('0x7a')],'custom':_0x5e908e[_0x18be06][_0xeaf6('0x7b')],'options':_0x5e908e[_0x18be06][_0xeaf6('0x7c')]===_0xeaf6('0x7d')&&_0x5e908e[_0x18be06][_0xeaf6('0x7e')][_0xeaf6('0x43')]>-0x1?_[_0xeaf6('0x2f')](_0x5e908e[_0x18be06]['pick_list_values'],function(_0x5592f3){return{'name':_0x5592f3,'value':_0x5592f3};}):[]});}}return{'count':_0x19d659[_0xeaf6('0x43')],'rows':_0x19d659};}else{return{'count':0x0,'rows':[]};}})[_0xeaf6('0x27')](respondWithResult(_0x28fb49,null))['catch'](function(_0x4fa1da){var _0x532bfa=_0x3d214c[_0xeaf6('0x30')][_0xeaf6('0x7f')]?0x1f4:_0x4fa1da[_0xeaf6('0x80')]||0x1f4;logger[_0xeaf6('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xeaf6('0x60'),_0x532bfa,JSON[_0xeaf6('0x81')](_0x4fa1da));delete _0x4fa1da['name'];if(_0x532bfa===0x191){_0x532bfa=0x190;}_0x28fb49[_0xeaf6('0x1a')](_0x532bfa)['send'](_0x3d214c['query'][_0xeaf6('0x7f')]?{'message':'Wrong\x20credentials','statusCode':_0x4fa1da[_0xeaf6('0x80')]}:_0x4fa1da);});};