6daf8b98e82ce306592f6b67d7613bd29218282d
[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 _0x8d7d=['clientSecret','access_token','serverUrl','code','host','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','picklist','pick_list_values','test','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','Content-Range','apply','update','then','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x8d7d,0x9e));var _0xd8d7=function(_0x2f1498,_0x295045){_0x2f1498=_0x2f1498-0x0;var _0x4d5648=_0x8d7d[_0x2f1498];return _0x4d5648;};'use strict';var emlformat=require(_0xd8d7('0x0'));var rimraf=require(_0xd8d7('0x1'));var zipdir=require(_0xd8d7('0x2'));var jsonpatch=require(_0xd8d7('0x3'));var rp=require(_0xd8d7('0x4'));var moment=require(_0xd8d7('0x5'));var BPromise=require(_0xd8d7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd8d7('0x7'));var csv=require('to-csv');var ejs=require(_0xd8d7('0x8'));var fs=require('fs');var fs_extra=require(_0xd8d7('0x9'));var _=require(_0xd8d7('0xa'));var squel=require(_0xd8d7('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8d7('0xc'));var deskjs=require(_0xd8d7('0xd'));var toCsv=require(_0xd8d7('0xe'));var querystring=require(_0xd8d7('0xf'));var Papa=require(_0xd8d7('0x10'));var Redis=require(_0xd8d7('0x11'));var authService=require(_0xd8d7('0x12'));var qs=require(_0xd8d7('0x13'));var as=require(_0xd8d7('0x14'));var hardwareService=require(_0xd8d7('0x15'));var logger=require(_0xd8d7('0x16'))('api');var utils=require(_0xd8d7('0x17'));var config=require(_0xd8d7('0x18'));var licenseUtil=require(_0xd8d7('0x19'));var db=require(_0xd8d7('0x1a'))['db'];var integrations=require(_0xd8d7('0x1b'));function respondWithStatusCode(_0x41b885,_0xb90b77){_0xb90b77=_0xb90b77||0xcc;return function(_0x41e5ae){if(_0x41e5ae){return _0x41b885[_0xd8d7('0x1c')](_0xb90b77);}return _0x41b885[_0xd8d7('0x1d')](_0xb90b77)['end']();};}function respondWithResult(_0x3ceeed,_0x1dee2d){_0x1dee2d=_0x1dee2d||0xc8;return function(_0x4186cc){if(_0x4186cc){return _0x3ceeed['status'](_0x1dee2d)[_0xd8d7('0x1e')](_0x4186cc);}};}function respondWithFilteredResult(_0x2eaeb3,_0x1993be){return function(_0x231011){if(_0x231011){var _0x7918a9=typeof _0x1993be[_0xd8d7('0x1f')]==='undefined'&&typeof _0x1993be[_0xd8d7('0x20')]==='undefined';var _0x575f16=_0x231011['count'];var _0x1877d=_0x7918a9?0x0:_0x1993be[_0xd8d7('0x1f')];var _0x2ac45a=_0x7918a9?_0x231011[_0xd8d7('0x21')]:_0x1993be[_0xd8d7('0x1f')]+_0x1993be[_0xd8d7('0x20')];var _0x2607f0;if(_0x2ac45a>=_0x575f16){_0x2ac45a=_0x575f16;_0x2607f0=0xc8;}else{_0x2607f0=0xce;}_0x2eaeb3[_0xd8d7('0x1d')](_0x2607f0);return _0x2eaeb3['set'](_0xd8d7('0x22'),_0x1877d+'-'+_0x2ac45a+'/'+_0x575f16)[_0xd8d7('0x1e')](_0x231011);}return null;};}function patchUpdates(_0x40f8a7){return function(_0x4753c5){try{jsonpatch[_0xd8d7('0x23')](_0x4753c5,_0x40f8a7,!![]);}catch(_0x587d9b){return BPromise['reject'](_0x587d9b);}return _0x4753c5['save']();};}function saveUpdates(_0x1d3dc0,_0x1d0123){return function(_0xdc7972){if(_0xdc7972){return _0xdc7972[_0xd8d7('0x24')](_0x1d3dc0)[_0xd8d7('0x25')](function(_0x4ab8c9){return _0x4ab8c9;});}return null;};}function removeEntity(_0x46fae8,_0x13eaa2){return function(_0x4c65d2){if(_0x4c65d2){return _0x4c65d2['destroy']()[_0xd8d7('0x25')](function(){_0x46fae8[_0xd8d7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fe81,_0x6e75ea){return function(_0x9b0a19){if(!_0x9b0a19){_0x42fe81[_0xd8d7('0x1c')](0x194);}return _0x9b0a19;};}function handleError(_0x2b8ebc,_0xdca6b3){_0xdca6b3=_0xdca6b3||0x1f4;return function(_0x5256cd){logger[_0xd8d7('0x26')](_0x5256cd[_0xd8d7('0x27')]);if(_0x5256cd[_0xd8d7('0x28')]){delete _0x5256cd[_0xd8d7('0x28')];}_0x2b8ebc[_0xd8d7('0x1d')](_0xdca6b3)['send'](_0x5256cd);};}exports[_0xd8d7('0x29')]=function(_0x219adb,_0x57dd63){var _0x3d7802={},_0x26b1ed={},_0x5db7ab={'count':0x0,'rows':[]};var _0x169e3f=_[_0xd8d7('0x2a')](db[_0xd8d7('0x2b')][_0xd8d7('0x2c')],function(_0x29692b){return{'name':_0x29692b[_0xd8d7('0x2d')],'type':_0x29692b[_0xd8d7('0x2e')][_0xd8d7('0x2f')]};});_0x26b1ed[_0xd8d7('0x30')]=_['map'](_0x169e3f,_0xd8d7('0x28'));_0x26b1ed[_0xd8d7('0x31')]=_[_0xd8d7('0x32')](_0x219adb[_0xd8d7('0x31')]);_0x26b1ed[_0xd8d7('0x33')]=_['intersection'](_0x26b1ed[_0xd8d7('0x30')],_0x26b1ed[_0xd8d7('0x31')]);_0x3d7802[_0xd8d7('0x34')]=_['intersection'](_0x26b1ed['model'],qs['fields'](_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x35')]));_0x3d7802[_0xd8d7('0x34')]=_0x3d7802['attributes'][_0xd8d7('0x36')]?_0x3d7802[_0xd8d7('0x34')]:_0x26b1ed[_0xd8d7('0x30')];if(!_0x219adb['query'][_0xd8d7('0x37')]('nolimit')){_0x3d7802[_0xd8d7('0x20')]=qs[_0xd8d7('0x20')](_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x20')]);_0x3d7802[_0xd8d7('0x1f')]=qs['offset'](_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x1f')]);}_0x3d7802['order']=qs['sort'](_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x38')]);_0x3d7802[_0xd8d7('0x39')]=qs[_0xd8d7('0x33')](_[_0xd8d7('0x3a')](_0x219adb[_0xd8d7('0x31')],_0x26b1ed[_0xd8d7('0x33')]),_0x169e3f);if(_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x3b')]){_0x3d7802[_0xd8d7('0x39')]=_[_0xd8d7('0x3c')](_0x3d7802[_0xd8d7('0x39')],{'$or':_[_0xd8d7('0x2a')](_0x169e3f,function(_0x47037e){if(_0x47037e[_0xd8d7('0x2e')]!==_0xd8d7('0x3d')){var _0x500099={};_0x500099[_0x47037e[_0xd8d7('0x28')]]={'$like':'%'+_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x3b')]+'%'};return _0x500099;}})});}_0x3d7802=_['merge']({},_0x3d7802,_0x219adb[_0xd8d7('0x3e')]);var _0x440590={'where':_0x3d7802[_0xd8d7('0x39')]};return db['ZohoAccount'][_0xd8d7('0x21')](_0x440590)[_0xd8d7('0x25')](function(_0x1ec02a){_0x5db7ab[_0xd8d7('0x21')]=_0x1ec02a;if(_0x219adb[_0xd8d7('0x31')][_0xd8d7('0x3f')]){_0x3d7802['include']=[{'all':!![]}];}return db[_0xd8d7('0x2b')][_0xd8d7('0x40')](_0x3d7802);})[_0xd8d7('0x25')](function(_0x48da5c){_0x5db7ab[_0xd8d7('0x41')]=_0x48da5c;return _0x5db7ab;})[_0xd8d7('0x25')](respondWithFilteredResult(_0x57dd63,_0x3d7802))[_0xd8d7('0x42')](handleError(_0x57dd63,null));};exports[_0xd8d7('0x43')]=function(_0x13b40e,_0x3eab10){var _0x3f8ba0={'raw':![],'where':{'id':_0x13b40e[_0xd8d7('0x44')]['id']}},_0x36a4c1={};_0x36a4c1['model']=_[_0xd8d7('0x32')](db[_0xd8d7('0x2b')][_0xd8d7('0x2c')]);_0x36a4c1[_0xd8d7('0x31')]=_[_0xd8d7('0x32')](_0x13b40e[_0xd8d7('0x31')]);_0x36a4c1[_0xd8d7('0x33')]=_[_0xd8d7('0x45')](_0x36a4c1[_0xd8d7('0x30')],_0x36a4c1[_0xd8d7('0x31')]);_0x3f8ba0[_0xd8d7('0x34')]=_['intersection'](_0x36a4c1[_0xd8d7('0x30')],qs[_0xd8d7('0x35')](_0x13b40e[_0xd8d7('0x31')][_0xd8d7('0x35')]));_0x3f8ba0['attributes']=_0x3f8ba0[_0xd8d7('0x34')][_0xd8d7('0x36')]?_0x3f8ba0[_0xd8d7('0x34')]:_0x36a4c1['model'];if(_0x13b40e[_0xd8d7('0x31')][_0xd8d7('0x3f')]){_0x3f8ba0[_0xd8d7('0x46')]=[{'all':!![]}];}_0x3f8ba0=_['merge']({},_0x3f8ba0,_0x13b40e['options']);return db[_0xd8d7('0x2b')][_0xd8d7('0x47')](_0x3f8ba0)['then'](handleEntityNotFound(_0x3eab10,null))[_0xd8d7('0x25')](respondWithResult(_0x3eab10,null))['catch'](handleError(_0x3eab10,null));};exports[_0xd8d7('0x48')]=function(_0xe8da7a,_0x4d5754){return db['ZohoAccount'][_0xd8d7('0x48')](_0xe8da7a[_0xd8d7('0x49')],{})[_0xd8d7('0x25')](respondWithResult(_0x4d5754,0xc9))[_0xd8d7('0x42')](handleError(_0x4d5754,null));};exports['update']=function(_0x581be1,_0xbdae6b){if(_0x581be1['body']['id']){delete _0x581be1[_0xd8d7('0x49')]['id'];}return db[_0xd8d7('0x2b')][_0xd8d7('0x47')]({'where':{'id':_0x581be1[_0xd8d7('0x44')]['id']}})[_0xd8d7('0x25')](handleEntityNotFound(_0xbdae6b,null))['then'](saveUpdates(_0x581be1[_0xd8d7('0x49')],null))[_0xd8d7('0x25')](respondWithResult(_0xbdae6b,null))[_0xd8d7('0x42')](handleError(_0xbdae6b,null));};exports[_0xd8d7('0x4a')]=function(_0x2ed109,_0x4cf105){return db[_0xd8d7('0x2b')]['find']({'where':{'id':_0x2ed109[_0xd8d7('0x44')]['id']}})[_0xd8d7('0x25')](handleEntityNotFound(_0x4cf105,null))['then'](removeEntity(_0x4cf105,null))[_0xd8d7('0x42')](handleError(_0x4cf105,null));};exports[_0xd8d7('0x4b')]=function(_0x5c26a0,_0x2e8473,_0x317d30){var _0x575e9a={};var _0xf8c3dc={};var _0x578322;var _0x2c2f3a;return db['ZohoAccount'][_0xd8d7('0x4c')]({'where':{'id':_0x5c26a0[_0xd8d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e8473,null))[_0xd8d7('0x25')](function(_0x465954){if(_0x465954){_0x578322=_0x465954;_0xf8c3dc[_0xd8d7('0x30')]=_[_0xd8d7('0x32')](db[_0xd8d7('0x4d')][_0xd8d7('0x2c')]);_0xf8c3dc[_0xd8d7('0x31')]=_['keys'](_0x5c26a0[_0xd8d7('0x31')]);_0xf8c3dc[_0xd8d7('0x33')]=_['intersection'](_0xf8c3dc[_0xd8d7('0x30')],_0xf8c3dc[_0xd8d7('0x31')]);_0x575e9a[_0xd8d7('0x34')]=_[_0xd8d7('0x45')](_0xf8c3dc[_0xd8d7('0x30')],qs[_0xd8d7('0x35')](_0x5c26a0[_0xd8d7('0x31')][_0xd8d7('0x35')]));_0x575e9a['attributes']=_0x575e9a[_0xd8d7('0x34')]['length']?_0x575e9a[_0xd8d7('0x34')]:_0xf8c3dc[_0xd8d7('0x30')];_0x575e9a[_0xd8d7('0x4e')]=qs[_0xd8d7('0x38')](_0x5c26a0[_0xd8d7('0x31')][_0xd8d7('0x38')]);_0x575e9a[_0xd8d7('0x39')]=qs[_0xd8d7('0x33')](_[_0xd8d7('0x3a')](_0x5c26a0[_0xd8d7('0x31')],_0xf8c3dc[_0xd8d7('0x33')]));if(_0x5c26a0['query'][_0xd8d7('0x3b')]){_0x575e9a[_0xd8d7('0x39')]=_[_0xd8d7('0x3c')](_0x575e9a[_0xd8d7('0x39')],{'$or':_['map'](_0x575e9a[_0xd8d7('0x34')],function(_0x46dd75){var _0x3bd981={};_0x3bd981[_0x46dd75]={'$like':'%'+_0x5c26a0[_0xd8d7('0x31')]['filter']+'%'};return _0x3bd981;})});}_0x575e9a=_[_0xd8d7('0x3c')]({},_0x575e9a,_0x5c26a0[_0xd8d7('0x3e')]);return _0x578322[_0xd8d7('0x4b')](_0x575e9a);}})[_0xd8d7('0x25')](function(_0x36a352){if(_0x36a352){_0x2c2f3a=_0x36a352[_0xd8d7('0x36')];if(!_0x5c26a0[_0xd8d7('0x31')][_0xd8d7('0x37')](_0xd8d7('0x4f'))){_0x575e9a[_0xd8d7('0x20')]=qs[_0xd8d7('0x20')](_0x5c26a0['query']['limit']);_0x575e9a[_0xd8d7('0x1f')]=qs[_0xd8d7('0x1f')](_0x5c26a0[_0xd8d7('0x31')][_0xd8d7('0x1f')]);}return _0x578322['getConfigurations'](_0x575e9a);}})[_0xd8d7('0x25')](function(_0x58421b){if(_0x58421b){return _0x58421b?{'count':_0x2c2f3a,'rows':_0x58421b}:null;}})[_0xd8d7('0x25')](respondWithResult(_0x2e8473,null))['catch'](handleError(_0x2e8473,null));};exports[_0xd8d7('0x50')]=function(_0x583981,_0x44c497,_0x530eae){if(_0x583981[_0xd8d7('0x49')]['id']){delete _0x583981[_0xd8d7('0x49')]['id'];}return db[_0xd8d7('0x2b')][_0xd8d7('0x4c')]({'where':{'id':_0x583981[_0xd8d7('0x44')]['id']}})[_0xd8d7('0x25')](handleEntityNotFound(_0x44c497,null))[_0xd8d7('0x25')](function(_0x3f7266){if(_0x3f7266){_0x583981[_0xd8d7('0x49')][_0xd8d7('0x51')]=_0x3f7266['id'];_0x583981[_0xd8d7('0x49')][_0xd8d7('0x52')]=integrations[_0xd8d7('0x53')](_0x583981['body'][_0xd8d7('0x54')],_0x583981[_0xd8d7('0x49')]['type']);_0x583981[_0xd8d7('0x49')][_0xd8d7('0x55')]=integrations['getDescriptions'](_0x583981[_0xd8d7('0x49')][_0xd8d7('0x54')],_0x583981[_0xd8d7('0x49')][_0xd8d7('0x2e')]);return db[_0xd8d7('0x4d')][_0xd8d7('0x48')](_0x583981[_0xd8d7('0x49')],{'include':[{'model':db[_0xd8d7('0x56')],'as':_0xd8d7('0x52')},{'model':db[_0xd8d7('0x56')],'as':_0xd8d7('0x55')}]});}return null;})[_0xd8d7('0x25')](respondWithResult(_0x44c497,null))[_0xd8d7('0x42')](handleError(_0x44c497,null));};function getAccessToken(_0x10cf82){return new Promise(function(_0xda4c4,_0xd945a6){var _0x58495e;switch(_0x10cf82[_0xd8d7('0x57')]){case'US':_0x58495e=_0xd8d7('0x58');break;case'AU':_0x58495e=_0xd8d7('0x59');break;case'EU':_0x58495e=_0xd8d7('0x5a');break;case'IN':_0x58495e='https://accounts.zoho.in';break;case'CN':_0x58495e='https://accounts.zoho.com.cn';break;default:_0x58495e='https://accounts.zoho.eu';break;}var _0x3aebd3={'method':'POST','uri':_0x58495e+_0xd8d7('0x5b'),'qs':{'refresh_token':_0x10cf82[_0xd8d7('0x5c')],'client_id':_0x10cf82[_0xd8d7('0x5d')],'client_secret':_0x10cf82[_0xd8d7('0x5e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3aebd3)[_0xd8d7('0x25')](function(_0x53ef59){if(_0x53ef59[_0xd8d7('0x5f')]){_0xda4c4(_0x53ef59[_0xd8d7('0x5f')]);}else{_0xd945a6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xd8d7('0x42')](function(_0x553e45){_0xd945a6(_0x553e45);});});}exports['getFields']=function(_0x1cd210,_0x23e399,_0x2d2e47){var _0x3b9cc4,_0x3c9bd2,_0x167e5a,_0x1ab0cd,_0xc3d40d;return db[_0xd8d7('0x2b')][_0xd8d7('0x4c')]({'where':{'id':_0x1cd210[_0xd8d7('0x44')]['id']},'attributes':['id','host',_0xd8d7('0x57'),'clientId',_0xd8d7('0x5e'),_0xd8d7('0x60'),_0xd8d7('0x61'),_0xd8d7('0x5c')]})[_0xd8d7('0x25')](handleEntityNotFound(_0x23e399,null))[_0xd8d7('0x25')](function(_0xc96692){_0xc3d40d=_0xc96692;_0x3b9cc4=_0xc3d40d[_0xd8d7('0x62')];_0x3c9bd2=_0x3b9cc4==='zoho.eu'?'eu':_0xd8d7('0x63');_0x167e5a=_0xc3d40d[_0xd8d7('0x60')];var _0x2901b3=_0x167e5a['slice'](-0x1);if(_0x2901b3==='/'||_0x2901b3==='\x5c'||_0x2901b3===':'){_0x167e5a=_0x167e5a[_0xd8d7('0x64')](0x0,_0x167e5a[_0xd8d7('0x65')](_0x2901b3));}if(!_0xc3d40d['refreshToken']){throw new Error(_0xd8d7('0x66'));}return getAccessToken(_0xc3d40d);})['then'](function(_0x373546){if(_0x373546){return rp({'method':'GET','uri':util[_0xd8d7('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3c9bd2),'qs':{'module':_0xd8d7('0x68')},'headers':{'Authorization':_0xd8d7('0x69')+_0x373546},'json':!![]});}})['then'](function(_0x214d12){if(_0x214d12){if(_0x214d12[_0xd8d7('0x6a')]&&_0x214d12[_0xd8d7('0x6a')][_0xd8d7('0x26')]){throw new Error(_0x214d12[_0xd8d7('0x6a')][_0xd8d7('0x26')][_0xd8d7('0x6b')]);}var _0x11640f=[];var _0x26ba7b=[];var _0x460451=[_0xd8d7('0x6c'),_0xd8d7('0x6d'),'Description',_0xd8d7('0x6e'),'Call_Duration',_0xd8d7('0x6f'),_0xd8d7('0x70'),_0xd8d7('0x71')];_0x26ba7b=_['remove'](_0x214d12['fields'],function(_0x2ec30c){return _0x460451[_0xd8d7('0x72')](_0x2ec30c[_0xd8d7('0x73')]);});for(var _0x41901a=0x0;_0x41901a<_0x26ba7b['length'];_0x41901a++){if(_0x26ba7b[_0x41901a][_0xd8d7('0x74')]===![]){_0x11640f[_0xd8d7('0x75')]({'id':_0x26ba7b[_0x41901a]['id'],'name':_0x26ba7b[_0x41901a]['display_label'],'custom':_0x26ba7b[_0x41901a]['custom_field'],'options':_0x26ba7b[_0x41901a]['data_type']===_0xd8d7('0x76')&&_0x26ba7b[_0x41901a][_0xd8d7('0x77')][_0xd8d7('0x36')]>-0x1?_[_0xd8d7('0x2a')](_0x26ba7b[_0x41901a]['pick_list_values'],function(_0x125d27){return{'name':_0x125d27,'value':_0x125d27};}):[]});}}return{'count':_0x11640f[_0xd8d7('0x36')],'rows':_0x11640f};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x23e399,null))[_0xd8d7('0x42')](function(_0x5f2da3){var _0xff1a7=_0x1cd210['query'][_0xd8d7('0x78')]?0x1f4:_0x5f2da3['statusCode']||0x1f4;logger[_0xd8d7('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xd8d7('0x79'),_0xff1a7,JSON[_0xd8d7('0x7a')](_0x5f2da3));delete _0x5f2da3[_0xd8d7('0x28')];if(_0xff1a7===0x191){_0xff1a7=0x190;}_0x23e399['status'](_0xff1a7)[_0xd8d7('0x7b')](_0x1cd210[_0xd8d7('0x31')][_0xd8d7('0x78')]?{'message':_0xd8d7('0x7c'),'statusCode':_0x5f2da3[_0xd8d7('0x7d')]}:_0x5f2da3);});};