Built motion from commit a679711e.|2.6.15
[motion2.git] / server / api / intZohoAccount / intZohoAccount.controller.js
index 38b28f3..828ddf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ff=['../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','getFields','host','clientId','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x1bd2e3,_0x1587d4){var _0x3db57e=function(_0x11eb3f){while(--_0x11eb3f){_0x1bd2e3['push'](_0x1bd2e3['shift']());}};_0x3db57e(++_0x1587d4);}(_0xc2ff,0x77));var _0xfc2f=function(_0x886835,_0x522d9a){_0x886835=_0x886835-0x0;var _0x1e81df=_0xc2ff[_0x886835];return _0x1e81df;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc2f('0x0'));var rimraf=require(_0xfc2f('0x1'));var zipdir=require(_0xfc2f('0x2'));var jsonpatch=require(_0xfc2f('0x3'));var rp=require(_0xfc2f('0x4'));var moment=require(_0xfc2f('0x5'));var BPromise=require(_0xfc2f('0x6'));var Mustache=require('mustache');var util=require(_0xfc2f('0x7'));var path=require(_0xfc2f('0x8'));var sox=require(_0xfc2f('0x9'));var csv=require(_0xfc2f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc2f('0xb'));var squel=require(_0xfc2f('0xc'));var crypto=require(_0xfc2f('0xd'));var jsforce=require(_0xfc2f('0xe'));var deskjs=require(_0xfc2f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfc2f('0x10'));var Papa=require(_0xfc2f('0x11'));var Redis=require('ioredis');var authService=require(_0xfc2f('0x12'));var qs=require(_0xfc2f('0x13'));var as=require(_0xfc2f('0x14'));var hardwareService=require(_0xfc2f('0x15'));var logger=require('../../config/logger')(_0xfc2f('0x16'));var utils=require('../../config/utils');var config=require(_0xfc2f('0x17'));var db=require(_0xfc2f('0x18'))['db'];var integrations=require(_0xfc2f('0x19'));var jayson=require(_0xfc2f('0x1a'));var client=jayson['client'][_0xfc2f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x320a49,_0x570896,_0x19ae3b){if(_0x19ae3b){var _0x375e55=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x375e55[_0xfc2f('0x1c')](_0x570896)){return _0x320a49;}else{throw new db[(_0xfc2f('0x1d'))][(_0xfc2f('0x1e'))](_0xfc2f('0x1f'));}}else{return _0x320a49;}}function respondWithRpcPromise(_0x4b3b90,_0xc02778,_0x1f013c,_0x25e4df){return new BPromise(function(_0x429151,_0x6e76b8){var _0x4fe58e=_0x25e4df||client;return _0x4fe58e[_0xfc2f('0x20')](_0x4b3b90,_0x1f013c)[_0xfc2f('0x21')](function(_0x21b020){logger[_0xfc2f('0x22')](_0xfc2f('0x23'),_0xc02778,_0xfc2f('0x24'));logger[_0xfc2f('0x25')](_0xfc2f('0x26'),_0xc02778,_0xfc2f('0x24'),JSON[_0xfc2f('0x27')](_0x21b020));if(_0x21b020['error']){if(_0x21b020['error'][_0xfc2f('0x28')]===0x1f4){logger['error'](_0xfc2f('0x23'),_0xc02778,_0x21b020[_0xfc2f('0x29')][_0xfc2f('0x2a')]);return _0x6e76b8(_0x21b020[_0xfc2f('0x29')][_0xfc2f('0x2a')]);}logger[_0xfc2f('0x29')](_0xfc2f('0x23'),_0xc02778,_0x21b020[_0xfc2f('0x29')][_0xfc2f('0x2a')]);return _0x429151(_0x21b020[_0xfc2f('0x29')][_0xfc2f('0x2a')]);}else{logger['info'](_0xfc2f('0x23'),_0xc02778,_0xfc2f('0x24'));_0x429151(_0x21b020[_0xfc2f('0x2b')]['message']);}})[_0xfc2f('0x2c')](function(_0x442a1d){logger['error'](_0xfc2f('0x23'),_0xc02778,_0x442a1d);_0x6e76b8(_0x442a1d);});});}function respondWithStatusCode(_0x56d6c3,_0x46175b){_0x46175b=_0x46175b||0xcc;return function(_0x311e6a){if(_0x311e6a){return _0x56d6c3[_0xfc2f('0x2d')](_0x46175b);}return _0x56d6c3[_0xfc2f('0x2e')](_0x46175b)['end']();};}function respondWithResult(_0x5c505f,_0x131f96){_0x131f96=_0x131f96||0xc8;return function(_0x3c247f){if(_0x3c247f){return _0x5c505f[_0xfc2f('0x2e')](_0x131f96)[_0xfc2f('0x2f')](_0x3c247f);}};}function respondWithFilteredResult(_0x582c4b,_0x24f2b9){return function(_0x3514b1){if(_0x3514b1){var _0x148694=_0x3514b1[_0xfc2f('0x30')],_0x4ee2b9=_0x24f2b9[_0xfc2f('0x31')],_0x2b55a2=_0x24f2b9[_0xfc2f('0x31')]+_0x24f2b9[_0xfc2f('0x32')],_0x57bdb3;if(_0x2b55a2>=_0x148694){_0x2b55a2=_0x148694;_0x57bdb3=0xc8;}else{_0x57bdb3=0xce;}_0x582c4b[_0xfc2f('0x2e')](_0x57bdb3);return _0x582c4b[_0xfc2f('0x33')](_0xfc2f('0x34'),_0x4ee2b9+'-'+_0x2b55a2+'/'+_0x148694)[_0xfc2f('0x2f')](_0x3514b1);}return null;};}function patchUpdates(_0x1b6680){return function(_0x2b2513){try{jsonpatch[_0xfc2f('0x35')](_0x2b2513,_0x1b6680,!![]);}catch(_0x6ea808){return BPromise[_0xfc2f('0x36')](_0x6ea808);}return _0x2b2513['save']();};}function saveUpdates(_0xe02ca6,_0x3d8b69){return function(_0x1534c5){if(_0x1534c5){return _0x1534c5[_0xfc2f('0x37')](_0xe02ca6)[_0xfc2f('0x21')](function(_0x5d5274){return _0x5d5274;});}return null;};}function removeEntity(_0x494e0c,_0x11b50c){return function(_0x1ffe6c){if(_0x1ffe6c){return _0x1ffe6c['destroy']()[_0xfc2f('0x21')](function(){_0x494e0c[_0xfc2f('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x230e24,_0x549c90){return function(_0x288caa){if(!_0x288caa){_0x230e24[_0xfc2f('0x2d')](0x194);}return _0x288caa;};}function handleError(_0x2be196,_0x2f49d2){_0x2f49d2=_0x2f49d2||0x1f4;return function(_0x48a67c){logger[_0xfc2f('0x29')](_0x48a67c[_0xfc2f('0x38')]);if(_0x48a67c[_0xfc2f('0x39')]){delete _0x48a67c[_0xfc2f('0x39')];}_0x2be196[_0xfc2f('0x2e')](_0x2f49d2)[_0xfc2f('0x3a')](_0x48a67c);};}exports[_0xfc2f('0x3b')]=function(_0x19178e,_0x6e04fa){var _0xf83c22={},_0x214df6={},_0x43197c={'count':0x0,'rows':[]};var _0xa195eb=_[_0xfc2f('0x3c')](db['ZohoAccount'][_0xfc2f('0x3d')],function(_0x2af548){return{'name':_0x2af548[_0xfc2f('0x3e')],'type':_0x2af548[_0xfc2f('0x3f')][_0xfc2f('0x40')]};});_0x214df6[_0xfc2f('0x41')]=_[_0xfc2f('0x3c')](_0xa195eb,'name');_0x214df6[_0xfc2f('0x42')]=_[_0xfc2f('0x43')](_0x19178e[_0xfc2f('0x42')]);_0x214df6[_0xfc2f('0x44')]=_['intersection'](_0x214df6[_0xfc2f('0x41')],_0x214df6[_0xfc2f('0x42')]);_0xf83c22[_0xfc2f('0x45')]=_[_0xfc2f('0x46')](_0x214df6[_0xfc2f('0x41')],qs[_0xfc2f('0x47')](_0x19178e[_0xfc2f('0x42')][_0xfc2f('0x47')]));_0xf83c22['attributes']=_0xf83c22[_0xfc2f('0x45')][_0xfc2f('0x48')]?_0xf83c22[_0xfc2f('0x45')]:_0x214df6[_0xfc2f('0x41')];if(!_0x19178e['query'][_0xfc2f('0x49')](_0xfc2f('0x4a'))){_0xf83c22[_0xfc2f('0x32')]=qs[_0xfc2f('0x32')](_0x19178e[_0xfc2f('0x42')][_0xfc2f('0x32')]);_0xf83c22[_0xfc2f('0x31')]=qs[_0xfc2f('0x31')](_0x19178e[_0xfc2f('0x42')][_0xfc2f('0x31')]);}_0xf83c22[_0xfc2f('0x4b')]=qs[_0xfc2f('0x4c')](_0x19178e[_0xfc2f('0x42')][_0xfc2f('0x4c')]);_0xf83c22[_0xfc2f('0x4d')]=qs[_0xfc2f('0x44')](_[_0xfc2f('0x4e')](_0x19178e[_0xfc2f('0x42')],_0x214df6[_0xfc2f('0x44')]),_0xa195eb);if(_0x19178e[_0xfc2f('0x42')]['filter']){_0xf83c22[_0xfc2f('0x4d')]=_[_0xfc2f('0x4f')](_0xf83c22[_0xfc2f('0x4d')],{'$or':_[_0xfc2f('0x3c')](_0xa195eb,function(_0x36ff86){if(_0x36ff86['type']!==_0xfc2f('0x50')){var _0x5c298f={};_0x5c298f[_0x36ff86[_0xfc2f('0x39')]]={'$like':'%'+_0x19178e['query'][_0xfc2f('0x51')]+'%'};return _0x5c298f;}})});}_0xf83c22=_[_0xfc2f('0x4f')]({},_0xf83c22,_0x19178e[_0xfc2f('0x52')]);var _0x4a93e1={'where':_0xf83c22['where']};return db[_0xfc2f('0x53')][_0xfc2f('0x30')](_0x4a93e1)[_0xfc2f('0x21')](function(_0x3dc149){_0x43197c['count']=_0x3dc149;if(_0x19178e[_0xfc2f('0x42')][_0xfc2f('0x54')]){_0xf83c22['include']=[{'all':!![]}];}return db[_0xfc2f('0x53')][_0xfc2f('0x55')](_0xf83c22);})[_0xfc2f('0x21')](function(_0x2f56f7){_0x43197c[_0xfc2f('0x56')]=_0x2f56f7;return _0x43197c;})[_0xfc2f('0x21')](respondWithFilteredResult(_0x6e04fa,_0xf83c22))[_0xfc2f('0x2c')](handleError(_0x6e04fa,null));};exports[_0xfc2f('0x57')]=function(_0x390107,_0x292782){var _0x317e97={'raw':![],'where':{'id':_0x390107[_0xfc2f('0x58')]['id']}},_0x37f005={};_0x37f005['model']=_[_0xfc2f('0x43')](db['ZohoAccount'][_0xfc2f('0x3d')]);_0x37f005[_0xfc2f('0x42')]=_['keys'](_0x390107[_0xfc2f('0x42')]);_0x37f005[_0xfc2f('0x44')]=_[_0xfc2f('0x46')](_0x37f005[_0xfc2f('0x41')],_0x37f005['query']);_0x317e97[_0xfc2f('0x45')]=_[_0xfc2f('0x46')](_0x37f005['model'],qs[_0xfc2f('0x47')](_0x390107['query']['fields']));_0x317e97[_0xfc2f('0x45')]=_0x317e97[_0xfc2f('0x45')][_0xfc2f('0x48')]?_0x317e97[_0xfc2f('0x45')]:_0x37f005[_0xfc2f('0x41')];if(_0x390107[_0xfc2f('0x42')][_0xfc2f('0x54')]){_0x317e97[_0xfc2f('0x59')]=[{'all':!![]}];}_0x317e97=_['merge']({},_0x317e97,_0x390107['options']);return db[_0xfc2f('0x53')][_0xfc2f('0x5a')](_0x317e97)[_0xfc2f('0x21')](handleEntityNotFound(_0x292782,null))[_0xfc2f('0x21')](respondWithResult(_0x292782,null))['catch'](handleError(_0x292782,null));};exports[_0xfc2f('0x5b')]=function(_0x1c1b4b,_0x493bf3){return db[_0xfc2f('0x53')][_0xfc2f('0x5b')](_0x1c1b4b[_0xfc2f('0x5c')],{})[_0xfc2f('0x21')](respondWithResult(_0x493bf3,0xc9))[_0xfc2f('0x2c')](handleError(_0x493bf3,null));};exports[_0xfc2f('0x37')]=function(_0x34f990,_0xe70e13){if(_0x34f990[_0xfc2f('0x5c')]['id']){delete _0x34f990['body']['id'];}return db[_0xfc2f('0x53')]['find']({'where':{'id':_0x34f990[_0xfc2f('0x58')]['id']}})[_0xfc2f('0x21')](handleEntityNotFound(_0xe70e13,null))['then'](saveUpdates(_0x34f990[_0xfc2f('0x5c')],null))['then'](respondWithResult(_0xe70e13,null))[_0xfc2f('0x2c')](handleError(_0xe70e13,null));};exports['destroy']=function(_0x2d4d94,_0x15bcd9){return db[_0xfc2f('0x53')][_0xfc2f('0x5a')]({'where':{'id':_0x2d4d94[_0xfc2f('0x58')]['id']}})[_0xfc2f('0x21')](handleEntityNotFound(_0x15bcd9,null))[_0xfc2f('0x21')](removeEntity(_0x15bcd9,null))[_0xfc2f('0x2c')](handleError(_0x15bcd9,null));};exports[_0xfc2f('0x5d')]=function(_0x86aac0,_0x5707a9,_0x40e5b6){var _0x26bed6={};var _0x118ecc={};var _0x3b85d5;var _0x468c03;return db[_0xfc2f('0x53')]['findOne']({'where':{'id':_0x86aac0['params']['id']}})[_0xfc2f('0x21')](handleEntityNotFound(_0x5707a9,null))[_0xfc2f('0x21')](function(_0xecc747){if(_0xecc747){_0x3b85d5=_0xecc747;_0x118ecc[_0xfc2f('0x41')]=_[_0xfc2f('0x43')](db[_0xfc2f('0x5e')][_0xfc2f('0x3d')]);_0x118ecc[_0xfc2f('0x42')]=_[_0xfc2f('0x43')](_0x86aac0['query']);_0x118ecc[_0xfc2f('0x44')]=_[_0xfc2f('0x46')](_0x118ecc['model'],_0x118ecc[_0xfc2f('0x42')]);_0x26bed6['attributes']=_[_0xfc2f('0x46')](_0x118ecc[_0xfc2f('0x41')],qs[_0xfc2f('0x47')](_0x86aac0[_0xfc2f('0x42')][_0xfc2f('0x47')]));_0x26bed6[_0xfc2f('0x45')]=_0x26bed6[_0xfc2f('0x45')]['length']?_0x26bed6[_0xfc2f('0x45')]:_0x118ecc[_0xfc2f('0x41')];_0x26bed6[_0xfc2f('0x4b')]=qs[_0xfc2f('0x4c')](_0x86aac0[_0xfc2f('0x42')][_0xfc2f('0x4c')]);_0x26bed6[_0xfc2f('0x4d')]=qs[_0xfc2f('0x44')](_[_0xfc2f('0x4e')](_0x86aac0[_0xfc2f('0x42')],_0x118ecc[_0xfc2f('0x44')]));if(_0x86aac0[_0xfc2f('0x42')][_0xfc2f('0x51')]){_0x26bed6[_0xfc2f('0x4d')]=_[_0xfc2f('0x4f')](_0x26bed6[_0xfc2f('0x4d')],{'$or':_['map'](_0x26bed6['attributes'],function(_0x43cd9){var _0x549820={};_0x549820[_0x43cd9]={'$like':'%'+_0x86aac0['query'][_0xfc2f('0x51')]+'%'};return _0x549820;})});}_0x26bed6=_[_0xfc2f('0x4f')]({},_0x26bed6,_0x86aac0[_0xfc2f('0x52')]);return _0x3b85d5['getConfigurations'](_0x26bed6);}})[_0xfc2f('0x21')](function(_0x3e5a4a){if(_0x3e5a4a){_0x468c03=_0x3e5a4a[_0xfc2f('0x48')];if(!_0x86aac0[_0xfc2f('0x42')][_0xfc2f('0x49')](_0xfc2f('0x4a'))){_0x26bed6['limit']=qs['limit'](_0x86aac0['query'][_0xfc2f('0x32')]);_0x26bed6[_0xfc2f('0x31')]=qs['offset'](_0x86aac0[_0xfc2f('0x42')]['offset']);}return _0x3b85d5[_0xfc2f('0x5d')](_0x26bed6);}})[_0xfc2f('0x21')](function(_0x327481){if(_0x327481){return _0x327481?{'count':_0x468c03,'rows':_0x327481}:null;}})[_0xfc2f('0x21')](respondWithResult(_0x5707a9,null))[_0xfc2f('0x2c')](handleError(_0x5707a9,null));};exports[_0xfc2f('0x5f')]=function(_0xbf6e23,_0x586ee1,_0x4edfd6){if(_0xbf6e23[_0xfc2f('0x5c')]['id']){delete _0xbf6e23[_0xfc2f('0x5c')]['id'];}return db[_0xfc2f('0x53')][_0xfc2f('0x60')]({'where':{'id':_0xbf6e23['params']['id']}})[_0xfc2f('0x21')](handleEntityNotFound(_0x586ee1,null))[_0xfc2f('0x21')](function(_0x484cc8){if(_0x484cc8){_0xbf6e23[_0xfc2f('0x5c')][_0xfc2f('0x61')]=_0x484cc8['id'];_0xbf6e23[_0xfc2f('0x5c')][_0xfc2f('0x62')]=integrations['getSubjects'](_0xbf6e23[_0xfc2f('0x5c')]['channel'],_0xbf6e23[_0xfc2f('0x5c')]['type']);_0xbf6e23[_0xfc2f('0x5c')]['Descriptions']=integrations['getDescriptions'](_0xbf6e23[_0xfc2f('0x5c')][_0xfc2f('0x63')],_0xbf6e23[_0xfc2f('0x5c')]['type']);return db[_0xfc2f('0x5e')][_0xfc2f('0x5b')](_0xbf6e23['body'],{'include':[{'model':db['ZohoField'],'as':_0xfc2f('0x62')},{'model':db[_0xfc2f('0x64')],'as':_0xfc2f('0x65')}]});}return null;})[_0xfc2f('0x21')](respondWithResult(_0x586ee1,null))[_0xfc2f('0x2c')](handleError(_0x586ee1,null));};function getAccessToken(_0xce99c5){return new Promise(function(_0x3d8177,_0x3edc3d){var _0x3d32af;switch(_0xce99c5[_0xfc2f('0x66')]){case'US':_0x3d32af=_0xfc2f('0x67');break;case'AU':_0x3d32af=_0xfc2f('0x68');break;case'EU':_0x3d32af=_0xfc2f('0x69');break;case'IN':_0x3d32af='https://accounts.zoho.in';break;case'CN':_0x3d32af=_0xfc2f('0x6a');break;default:_0x3d32af=_0xfc2f('0x69');break;}var _0x47978a={'method':_0xfc2f('0x6b'),'uri':_0x3d32af+_0xfc2f('0x6c'),'qs':{'refresh_token':_0xce99c5[_0xfc2f('0x6d')],'client_id':_0xce99c5['clientId'],'client_secret':_0xce99c5[_0xfc2f('0x6e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x47978a)[_0xfc2f('0x21')](function(_0x46906f){if(_0x46906f[_0xfc2f('0x6f')]){_0x3d8177(_0x46906f['access_token']);}else{_0x3edc3d('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0xe586d0){_0x3edc3d(_0xe586d0);});});}exports[_0xfc2f('0x70')]=function(_0x5b2525,_0x1df8c6,_0x2927ef){var _0x11413b,_0x273ec1,_0x2d4847,_0x22a6ab,_0x4d09ac;return db[_0xfc2f('0x53')][_0xfc2f('0x60')]({'where':{'id':_0x5b2525['params']['id']},'attributes':['id',_0xfc2f('0x71'),_0xfc2f('0x66'),_0xfc2f('0x72'),_0xfc2f('0x6e'),_0xfc2f('0x73'),_0xfc2f('0x28'),_0xfc2f('0x6d')]})[_0xfc2f('0x21')](handleEntityNotFound(_0x1df8c6,null))[_0xfc2f('0x21')](function(_0x23e13f){_0x4d09ac=_0x23e13f;_0x11413b=_0x4d09ac[_0xfc2f('0x71')];_0x273ec1=_0x11413b===_0xfc2f('0x74')?'eu':_0xfc2f('0x75');_0x2d4847=_0x4d09ac[_0xfc2f('0x73')];var _0x366cbf=_0x2d4847[_0xfc2f('0x76')](-0x1);if(_0x366cbf==='/'||_0x366cbf==='\x5c'||_0x366cbf===':'){_0x2d4847=_0x2d4847[_0xfc2f('0x77')](0x0,_0x2d4847[_0xfc2f('0x78')](_0x366cbf));}if(!_0x4d09ac['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4d09ac);})['then'](function(_0x297297){if(_0x297297){return rp({'method':_0xfc2f('0x79'),'uri':util['format'](_0xfc2f('0x7a'),_0x273ec1),'qs':{'module':_0xfc2f('0x7b')},'headers':{'Authorization':_0xfc2f('0x7c')+_0x297297},'json':!![]});}})[_0xfc2f('0x21')](function(_0x37646f){if(_0x37646f){if(_0x37646f['response']&&_0x37646f[_0xfc2f('0x7d')][_0xfc2f('0x29')]){throw new Error(_0x37646f['response'][_0xfc2f('0x29')][_0xfc2f('0x2a')]);}var _0xee855=[];var _0x79c362=[];var _0xdb5e02=['Owner',_0xfc2f('0x7e'),_0xfc2f('0x7f'),_0xfc2f('0x80'),_0xfc2f('0x81'),_0xfc2f('0x82'),_0xfc2f('0x83'),_0xfc2f('0x84')];_0x79c362=_[_0xfc2f('0x85')](_0x37646f[_0xfc2f('0x47')],function(_0xa0a30f){return _0xdb5e02[_0xfc2f('0x86')](_0xa0a30f[_0xfc2f('0x87')]);});for(var _0x56ae49=0x0;_0x56ae49<_0x79c362[_0xfc2f('0x48')];_0x56ae49++){if(_0x79c362[_0x56ae49][_0xfc2f('0x88')]===![]){_0xee855[_0xfc2f('0x89')]({'id':_0x79c362[_0x56ae49]['id'],'name':_0x79c362[_0x56ae49]['display_label'],'custom':_0x79c362[_0x56ae49][_0xfc2f('0x8a')],'options':_0x79c362[_0x56ae49][_0xfc2f('0x8b')]==='picklist'&&_0x79c362[_0x56ae49][_0xfc2f('0x8c')]['length']>-0x1?_[_0xfc2f('0x3c')](_0x79c362[_0x56ae49][_0xfc2f('0x8c')],function(_0x50cc73){return{'name':_0x50cc73,'value':_0x50cc73};}):[]});}}return{'count':_0xee855[_0xfc2f('0x48')],'rows':_0xee855};}else{return{'count':0x0,'rows':[]};}})[_0xfc2f('0x21')](respondWithResult(_0x1df8c6,null))['catch'](function(_0x137f0f){var _0x41707e=_0x5b2525['query'][_0xfc2f('0x1c')]?0x1f4:_0x137f0f[_0xfc2f('0x8d')]||0x1f4;logger[_0xfc2f('0x29')](_0xfc2f('0x8e'),_0xfc2f('0x70'),_0x41707e,JSON[_0xfc2f('0x27')](_0x137f0f));delete _0x137f0f[_0xfc2f('0x39')];if(_0x41707e===0x191){_0x41707e=0x190;}_0x1df8c6[_0xfc2f('0x2e')](_0x41707e)[_0xfc2f('0x3a')](_0x5b2525['query'][_0xfc2f('0x1c')]?{'message':_0xfc2f('0x8f'),'statusCode':_0x137f0f[_0xfc2f('0x8d')]}:_0x137f0f);});};
\ No newline at end of file
+var _0xc206=['pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','update','destroy','then','error','name','send','map','ZohoAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','serverUrl','code','refreshToken','host','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','api_name','system_mandatory','push','display_label','custom_field','picklist'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc206,0x174));var _0x6c20=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xc206[_0x3b1b23];return _0x1efc85;};'use strict';var emlformat=require(_0x6c20('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c20('0x1'));var rp=require(_0x6c20('0x2'));var moment=require(_0x6c20('0x3'));var BPromise=require(_0x6c20('0x4'));var Mustache=require(_0x6c20('0x5'));var util=require(_0x6c20('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c20('0x7'));var _=require(_0x6c20('0x8'));var squel=require(_0x6c20('0x9'));var crypto=require('crypto');var jsforce=require(_0x6c20('0xa'));var deskjs=require(_0x6c20('0xb'));var toCsv=require(_0x6c20('0xc'));var querystring=require(_0x6c20('0xd'));var Papa=require(_0x6c20('0xe'));var Redis=require('ioredis');var authService=require(_0x6c20('0xf'));var qs=require(_0x6c20('0x10'));var as=require(_0x6c20('0x11'));var hardwareService=require(_0x6c20('0x12'));var logger=require(_0x6c20('0x13'))(_0x6c20('0x14'));var utils=require(_0x6c20('0x15'));var config=require(_0x6c20('0x16'));var licenseUtil=require(_0x6c20('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6c20('0x18'));function respondWithStatusCode(_0x49aa0e,_0x40f61f){_0x40f61f=_0x40f61f||0xcc;return function(_0x5a0b82){if(_0x5a0b82){return _0x49aa0e['sendStatus'](_0x40f61f);}return _0x49aa0e[_0x6c20('0x19')](_0x40f61f)[_0x6c20('0x1a')]();};}function respondWithResult(_0x11c089,_0x25d8be){_0x25d8be=_0x25d8be||0xc8;return function(_0x2a9378){if(_0x2a9378){return _0x11c089[_0x6c20('0x19')](_0x25d8be)[_0x6c20('0x1b')](_0x2a9378);}};}function respondWithFilteredResult(_0x52ab90,_0x3c9f51){return function(_0x99126d){if(_0x99126d){var _0x2a9a48=typeof _0x3c9f51[_0x6c20('0x1c')]==='undefined'&&typeof _0x3c9f51[_0x6c20('0x1d')]===_0x6c20('0x1e');var _0x31ed4c=_0x99126d[_0x6c20('0x1f')];var _0xd59953=_0x2a9a48?0x0:_0x3c9f51[_0x6c20('0x1c')];var _0x377b88=_0x2a9a48?_0x99126d[_0x6c20('0x1f')]:_0x3c9f51['offset']+_0x3c9f51[_0x6c20('0x1d')];var _0xd0f11d;if(_0x377b88>=_0x31ed4c){_0x377b88=_0x31ed4c;_0xd0f11d=0xc8;}else{_0xd0f11d=0xce;}_0x52ab90[_0x6c20('0x19')](_0xd0f11d);return _0x52ab90[_0x6c20('0x20')]('Content-Range',_0xd59953+'-'+_0x377b88+'/'+_0x31ed4c)[_0x6c20('0x1b')](_0x99126d);}return null;};}function patchUpdates(_0x3deec2){return function(_0x115d5d){try{jsonpatch['apply'](_0x115d5d,_0x3deec2,!![]);}catch(_0x5ea27a){return BPromise['reject'](_0x5ea27a);}return _0x115d5d['save']();};}function saveUpdates(_0x3aa292,_0x23cba4){return function(_0x2e5b28){if(_0x2e5b28){return _0x2e5b28[_0x6c20('0x21')](_0x3aa292)['then'](function(_0x718119){return _0x718119;});}return null;};}function removeEntity(_0x3b92d6,_0x5a3d38){return function(_0x5531c8){if(_0x5531c8){return _0x5531c8[_0x6c20('0x22')]()[_0x6c20('0x23')](function(){_0x3b92d6[_0x6c20('0x19')](0xcc)[_0x6c20('0x1a')]();});}};}function handleEntityNotFound(_0x5b44b6,_0x462407){return function(_0x2760c8){if(!_0x2760c8){_0x5b44b6['sendStatus'](0x194);}return _0x2760c8;};}function handleError(_0x13f889,_0x513fa4){_0x513fa4=_0x513fa4||0x1f4;return function(_0x29fb12){logger[_0x6c20('0x24')](_0x29fb12['stack']);if(_0x29fb12[_0x6c20('0x25')]){delete _0x29fb12[_0x6c20('0x25')];}_0x13f889[_0x6c20('0x19')](_0x513fa4)[_0x6c20('0x26')](_0x29fb12);};}exports['index']=function(_0x104cbb,_0x5be8ad){var _0x1d3b59={},_0x26c0b6={},_0x362217={'count':0x0,'rows':[]};var _0x111d58=_[_0x6c20('0x27')](db[_0x6c20('0x28')]['rawAttributes'],function(_0x2e4ce8){return{'name':_0x2e4ce8['fieldName'],'type':_0x2e4ce8[_0x6c20('0x29')][_0x6c20('0x2a')]};});_0x26c0b6[_0x6c20('0x2b')]=_[_0x6c20('0x27')](_0x111d58,_0x6c20('0x25'));_0x26c0b6[_0x6c20('0x2c')]=_[_0x6c20('0x2d')](_0x104cbb[_0x6c20('0x2c')]);_0x26c0b6[_0x6c20('0x2e')]=_[_0x6c20('0x2f')](_0x26c0b6[_0x6c20('0x2b')],_0x26c0b6['query']);_0x1d3b59[_0x6c20('0x30')]=_['intersection'](_0x26c0b6['model'],qs[_0x6c20('0x31')](_0x104cbb[_0x6c20('0x2c')][_0x6c20('0x31')]));_0x1d3b59[_0x6c20('0x30')]=_0x1d3b59[_0x6c20('0x30')][_0x6c20('0x32')]?_0x1d3b59['attributes']:_0x26c0b6[_0x6c20('0x2b')];if(!_0x104cbb[_0x6c20('0x2c')][_0x6c20('0x33')]('nolimit')){_0x1d3b59[_0x6c20('0x1d')]=qs[_0x6c20('0x1d')](_0x104cbb['query'][_0x6c20('0x1d')]);_0x1d3b59[_0x6c20('0x1c')]=qs[_0x6c20('0x1c')](_0x104cbb[_0x6c20('0x2c')][_0x6c20('0x1c')]);}_0x1d3b59[_0x6c20('0x34')]=qs[_0x6c20('0x35')](_0x104cbb[_0x6c20('0x2c')][_0x6c20('0x35')]);_0x1d3b59[_0x6c20('0x36')]=qs['filters'](_[_0x6c20('0x37')](_0x104cbb[_0x6c20('0x2c')],_0x26c0b6[_0x6c20('0x2e')]),_0x111d58);if(_0x104cbb[_0x6c20('0x2c')][_0x6c20('0x38')]){_0x1d3b59['where']=_[_0x6c20('0x39')](_0x1d3b59[_0x6c20('0x36')],{'$or':_[_0x6c20('0x27')](_0x111d58,function(_0x44eb89){if(_0x44eb89[_0x6c20('0x29')]!==_0x6c20('0x3a')){var _0x27f80f={};_0x27f80f[_0x44eb89[_0x6c20('0x25')]]={'$like':'%'+_0x104cbb[_0x6c20('0x2c')]['filter']+'%'};return _0x27f80f;}})});}_0x1d3b59=_[_0x6c20('0x39')]({},_0x1d3b59,_0x104cbb[_0x6c20('0x3b')]);var _0x3577f6={'where':_0x1d3b59[_0x6c20('0x36')]};return db[_0x6c20('0x28')][_0x6c20('0x1f')](_0x3577f6)[_0x6c20('0x23')](function(_0x11ba59){_0x362217['count']=_0x11ba59;if(_0x104cbb[_0x6c20('0x2c')]['includeAll']){_0x1d3b59[_0x6c20('0x3c')]=[{'all':!![]}];}return db[_0x6c20('0x28')][_0x6c20('0x3d')](_0x1d3b59);})[_0x6c20('0x23')](function(_0x1b7940){_0x362217[_0x6c20('0x3e')]=_0x1b7940;return _0x362217;})['then'](respondWithFilteredResult(_0x5be8ad,_0x1d3b59))[_0x6c20('0x3f')](handleError(_0x5be8ad,null));};exports[_0x6c20('0x40')]=function(_0x20ce96,_0x272155){var _0x5d3e43={'raw':![],'where':{'id':_0x20ce96[_0x6c20('0x41')]['id']}},_0x1c3586={};_0x1c3586[_0x6c20('0x2b')]=_[_0x6c20('0x2d')](db[_0x6c20('0x28')][_0x6c20('0x42')]);_0x1c3586[_0x6c20('0x2c')]=_[_0x6c20('0x2d')](_0x20ce96[_0x6c20('0x2c')]);_0x1c3586[_0x6c20('0x2e')]=_[_0x6c20('0x2f')](_0x1c3586['model'],_0x1c3586[_0x6c20('0x2c')]);_0x5d3e43['attributes']=_['intersection'](_0x1c3586['model'],qs[_0x6c20('0x31')](_0x20ce96[_0x6c20('0x2c')][_0x6c20('0x31')]));_0x5d3e43[_0x6c20('0x30')]=_0x5d3e43[_0x6c20('0x30')][_0x6c20('0x32')]?_0x5d3e43[_0x6c20('0x30')]:_0x1c3586['model'];if(_0x20ce96[_0x6c20('0x2c')][_0x6c20('0x43')]){_0x5d3e43['include']=[{'all':!![]}];}_0x5d3e43=_[_0x6c20('0x39')]({},_0x5d3e43,_0x20ce96[_0x6c20('0x3b')]);return db['ZohoAccount'][_0x6c20('0x44')](_0x5d3e43)[_0x6c20('0x23')](handleEntityNotFound(_0x272155,null))[_0x6c20('0x23')](respondWithResult(_0x272155,null))[_0x6c20('0x3f')](handleError(_0x272155,null));};exports['create']=function(_0x160401,_0x205b3f){return db['ZohoAccount'][_0x6c20('0x45')](_0x160401[_0x6c20('0x46')],{})[_0x6c20('0x23')](respondWithResult(_0x205b3f,0xc9))['catch'](handleError(_0x205b3f,null));};exports['update']=function(_0x367cf4,_0x2e6299){if(_0x367cf4[_0x6c20('0x46')]['id']){delete _0x367cf4['body']['id'];}return db['ZohoAccount'][_0x6c20('0x44')]({'where':{'id':_0x367cf4[_0x6c20('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e6299,null))['then'](saveUpdates(_0x367cf4['body'],null))[_0x6c20('0x23')](respondWithResult(_0x2e6299,null))[_0x6c20('0x3f')](handleError(_0x2e6299,null));};exports['destroy']=function(_0x3b655e,_0x4cc599){return db['ZohoAccount']['find']({'where':{'id':_0x3b655e[_0x6c20('0x41')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x4cc599,null))[_0x6c20('0x23')](removeEntity(_0x4cc599,null))[_0x6c20('0x3f')](handleError(_0x4cc599,null));};exports[_0x6c20('0x47')]=function(_0x1202d3,_0x193888,_0x2ac8e1){var _0x2ea08f={};var _0x39803e={};var _0x24d509;var _0x13a7d8;return db['ZohoAccount'][_0x6c20('0x48')]({'where':{'id':_0x1202d3[_0x6c20('0x41')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x193888,null))[_0x6c20('0x23')](function(_0x1557e1){if(_0x1557e1){_0x24d509=_0x1557e1;_0x39803e[_0x6c20('0x2b')]=_[_0x6c20('0x2d')](db['ZohoConfiguration'][_0x6c20('0x42')]);_0x39803e[_0x6c20('0x2c')]=_[_0x6c20('0x2d')](_0x1202d3['query']);_0x39803e[_0x6c20('0x2e')]=_[_0x6c20('0x2f')](_0x39803e[_0x6c20('0x2b')],_0x39803e[_0x6c20('0x2c')]);_0x2ea08f[_0x6c20('0x30')]=_[_0x6c20('0x2f')](_0x39803e[_0x6c20('0x2b')],qs[_0x6c20('0x31')](_0x1202d3[_0x6c20('0x2c')][_0x6c20('0x31')]));_0x2ea08f[_0x6c20('0x30')]=_0x2ea08f['attributes'][_0x6c20('0x32')]?_0x2ea08f['attributes']:_0x39803e[_0x6c20('0x2b')];_0x2ea08f[_0x6c20('0x34')]=qs[_0x6c20('0x35')](_0x1202d3[_0x6c20('0x2c')][_0x6c20('0x35')]);_0x2ea08f[_0x6c20('0x36')]=qs[_0x6c20('0x2e')](_['pick'](_0x1202d3[_0x6c20('0x2c')],_0x39803e[_0x6c20('0x2e')]));if(_0x1202d3[_0x6c20('0x2c')][_0x6c20('0x38')]){_0x2ea08f[_0x6c20('0x36')]=_[_0x6c20('0x39')](_0x2ea08f['where'],{'$or':_['map'](_0x2ea08f[_0x6c20('0x30')],function(_0x20b9c1){var _0x15a047={};_0x15a047[_0x20b9c1]={'$like':'%'+_0x1202d3[_0x6c20('0x2c')]['filter']+'%'};return _0x15a047;})});}_0x2ea08f=_[_0x6c20('0x39')]({},_0x2ea08f,_0x1202d3['options']);return _0x24d509['getConfigurations'](_0x2ea08f);}})[_0x6c20('0x23')](function(_0x40ea96){if(_0x40ea96){_0x13a7d8=_0x40ea96[_0x6c20('0x32')];if(!_0x1202d3['query'][_0x6c20('0x33')]('nolimit')){_0x2ea08f['limit']=qs[_0x6c20('0x1d')](_0x1202d3[_0x6c20('0x2c')][_0x6c20('0x1d')]);_0x2ea08f[_0x6c20('0x1c')]=qs[_0x6c20('0x1c')](_0x1202d3[_0x6c20('0x2c')]['offset']);}return _0x24d509[_0x6c20('0x47')](_0x2ea08f);}})[_0x6c20('0x23')](function(_0x4f62fd){if(_0x4f62fd){return _0x4f62fd?{'count':_0x13a7d8,'rows':_0x4f62fd}:null;}})[_0x6c20('0x23')](respondWithResult(_0x193888,null))[_0x6c20('0x3f')](handleError(_0x193888,null));};exports[_0x6c20('0x49')]=function(_0x301e89,_0x4f5f48,_0x2a5256){if(_0x301e89[_0x6c20('0x46')]['id']){delete _0x301e89['body']['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x301e89[_0x6c20('0x41')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x4f5f48,null))[_0x6c20('0x23')](function(_0x457bf4){if(_0x457bf4){_0x301e89[_0x6c20('0x46')][_0x6c20('0x4a')]=_0x457bf4['id'];_0x301e89[_0x6c20('0x46')][_0x6c20('0x4b')]=integrations['getSubjects'](_0x301e89['body']['channel'],_0x301e89[_0x6c20('0x46')][_0x6c20('0x29')]);_0x301e89['body'][_0x6c20('0x4c')]=integrations[_0x6c20('0x4d')](_0x301e89[_0x6c20('0x46')][_0x6c20('0x4e')],_0x301e89[_0x6c20('0x46')]['type']);return db['ZohoConfiguration'][_0x6c20('0x45')](_0x301e89['body'],{'include':[{'model':db[_0x6c20('0x4f')],'as':'Subjects'},{'model':db[_0x6c20('0x4f')],'as':_0x6c20('0x4c')}]});}return null;})[_0x6c20('0x23')](respondWithResult(_0x4f5f48,null))[_0x6c20('0x3f')](handleError(_0x4f5f48,null));};function getAccessToken(_0x51a810){return new Promise(function(_0x47cbb8,_0x55f692){var _0x4c9783;switch(_0x51a810[_0x6c20('0x50')]){case'US':_0x4c9783=_0x6c20('0x51');break;case'AU':_0x4c9783='https://accounts.zoho.com.au';break;case'EU':_0x4c9783=_0x6c20('0x52');break;case'IN':_0x4c9783=_0x6c20('0x53');break;case'CN':_0x4c9783=_0x6c20('0x54');break;default:_0x4c9783=_0x6c20('0x52');break;}var _0x43a23d={'method':_0x6c20('0x55'),'uri':_0x4c9783+_0x6c20('0x56'),'qs':{'refresh_token':_0x51a810['refreshToken'],'client_id':_0x51a810[_0x6c20('0x57')],'client_secret':_0x51a810[_0x6c20('0x58')],'grant_type':_0x6c20('0x59')},'json':!![]};return rp(_0x43a23d)[_0x6c20('0x23')](function(_0x51d73e){if(_0x51d73e[_0x6c20('0x5a')]){_0x47cbb8(_0x51d73e[_0x6c20('0x5a')]);}else{_0x55f692('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x6c20('0x3f')](function(_0x2f53df){_0x55f692(_0x2f53df);});});}exports['getFields']=function(_0x3efebf,_0x2d6233,_0x3a7f23){var _0x307025,_0x4055a1,_0x281066,_0x327c39,_0x350ccc;return db[_0x6c20('0x28')][_0x6c20('0x48')]({'where':{'id':_0x3efebf['params']['id']},'attributes':['id','host',_0x6c20('0x50'),'clientId',_0x6c20('0x58'),_0x6c20('0x5b'),_0x6c20('0x5c'),_0x6c20('0x5d')]})[_0x6c20('0x23')](handleEntityNotFound(_0x2d6233,null))['then'](function(_0x8d9b3e){_0x350ccc=_0x8d9b3e;_0x307025=_0x350ccc[_0x6c20('0x5e')];_0x4055a1=_0x307025===_0x6c20('0x5f')?'eu':'com';_0x281066=_0x350ccc[_0x6c20('0x5b')];var _0x1ce4dc=_0x281066[_0x6c20('0x60')](-0x1);if(_0x1ce4dc==='/'||_0x1ce4dc==='\x5c'||_0x1ce4dc===':'){_0x281066=_0x281066['substring'](0x0,_0x281066[_0x6c20('0x61')](_0x1ce4dc));}if(!_0x350ccc[_0x6c20('0x5d')]){throw new Error(_0x6c20('0x62'));}return getAccessToken(_0x350ccc);})[_0x6c20('0x23')](function(_0x38d632){if(_0x38d632){return rp({'method':'GET','uri':util['format'](_0x6c20('0x63'),_0x4055a1),'qs':{'module':_0x6c20('0x64')},'headers':{'Authorization':_0x6c20('0x65')+_0x38d632},'json':!![]});}})[_0x6c20('0x23')](function(_0xeaf326){if(_0xeaf326){if(_0xeaf326[_0x6c20('0x66')]&&_0xeaf326['response']['error']){throw new Error(_0xeaf326[_0x6c20('0x66')][_0x6c20('0x24')]['message']);}var _0x1efa24=[];var _0x24f104=[];var _0x3ca004=[_0x6c20('0x67'),_0x6c20('0x68'),_0x6c20('0x69'),'WhoId',_0x6c20('0x6a'),_0x6c20('0x6b'),_0x6c20('0x6c'),_0x6c20('0x6d')];_0x24f104=_['remove'](_0xeaf326['fields'],function(_0x47baf8){return _0x3ca004['includes'](_0x47baf8[_0x6c20('0x6e')]);});for(var _0x39b38f=0x0;_0x39b38f<_0x24f104[_0x6c20('0x32')];_0x39b38f++){if(_0x24f104[_0x39b38f][_0x6c20('0x6f')]===![]){_0x1efa24[_0x6c20('0x70')]({'id':_0x24f104[_0x39b38f]['id'],'name':_0x24f104[_0x39b38f][_0x6c20('0x71')],'custom':_0x24f104[_0x39b38f][_0x6c20('0x72')],'options':_0x24f104[_0x39b38f]['data_type']===_0x6c20('0x73')&&_0x24f104[_0x39b38f][_0x6c20('0x74')]['length']>-0x1?_[_0x6c20('0x27')](_0x24f104[_0x39b38f][_0x6c20('0x74')],function(_0xaa4558){return{'name':_0xaa4558,'value':_0xaa4558};}):[]});}}return{'count':_0x1efa24[_0x6c20('0x32')],'rows':_0x1efa24};}else{return{'count':0x0,'rows':[]};}})[_0x6c20('0x23')](respondWithResult(_0x2d6233,null))[_0x6c20('0x3f')](function(_0x243526){var _0x3d59c1=_0x3efebf[_0x6c20('0x2c')][_0x6c20('0x75')]?0x1f4:_0x243526['statusCode']||0x1f4;logger[_0x6c20('0x24')](_0x6c20('0x76'),_0x6c20('0x77'),_0x3d59c1,JSON[_0x6c20('0x78')](_0x243526));delete _0x243526[_0x6c20('0x25')];if(_0x3d59c1===0x191){_0x3d59c1=0x190;}_0x2d6233[_0x6c20('0x19')](_0x3d59c1)['send'](_0x3efebf[_0x6c20('0x2c')][_0x6c20('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x243526[_0x6c20('0x79')]}:_0x243526);});};
\ No newline at end of file