Built motion from commit 1ea47bf4.|2.6.34
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index eea02ce..e082f1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d98=['AccountId','Subjects','channel','Descriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','password','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','assign','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','true','sys_choice?sysparm_query=name=incident^element=','value','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','ServicenowConfiguration','pick','filter','getConfigurations','hasOwnProperty','addConfiguration'];(function(_0x347d91,_0x5c6a2d){var _0x2048d5=function(_0x2b8299){while(--_0x2b8299){_0x347d91['push'](_0x347d91['shift']());}};_0x2048d5(++_0x5c6a2d);}(_0x0d98,0x1e1));var _0x80d9=function(_0x46f599,_0x559556){_0x46f599=_0x46f599-0x0;var _0x1af1c0=_0x0d98[_0x46f599];return _0x1af1c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80d9('0x0'));var zipdir=require(_0x80d9('0x1'));var jsonpatch=require(_0x80d9('0x2'));var rp=require('request-promise');var moment=require(_0x80d9('0x3'));var BPromise=require(_0x80d9('0x4'));var Mustache=require(_0x80d9('0x5'));var util=require(_0x80d9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x80d9('0x7'));var ejs=require(_0x80d9('0x8'));var fs=require('fs');var fs_extra=require(_0x80d9('0x9'));var _=require(_0x80d9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x80d9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x80d9('0x7'));var querystring=require(_0x80d9('0xc'));var Papa=require(_0x80d9('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x80d9('0xe'));var as=require(_0x80d9('0xf'));var hardwareService=require(_0x80d9('0x10'));var logger=require(_0x80d9('0x11'))(_0x80d9('0x12'));var utils=require(_0x80d9('0x13'));var config=require(_0x80d9('0x14'));var licenseUtil=require(_0x80d9('0x15'));var db=require(_0x80d9('0x16'))['db'];var integrations=require(_0x80d9('0x17'));function respondWithStatusCode(_0xf5fb77,_0x269f45){_0x269f45=_0x269f45||0xcc;return function(_0x2dc5cf){if(_0x2dc5cf){return _0xf5fb77[_0x80d9('0x18')](_0x269f45);}return _0xf5fb77[_0x80d9('0x19')](_0x269f45)[_0x80d9('0x1a')]();};}function respondWithResult(_0x542e45,_0x50c2fc){_0x50c2fc=_0x50c2fc||0xc8;return function(_0x6883a6){if(_0x6883a6){return _0x542e45['status'](_0x50c2fc)[_0x80d9('0x1b')](_0x6883a6);}};}function respondWithFilteredResult(_0x38c5bf,_0x17713b){return function(_0x5759a9){if(_0x5759a9){var _0x40708d=typeof _0x17713b['offset']===_0x80d9('0x1c')&&typeof _0x17713b['limit']==='undefined';var _0x49f9bb=_0x5759a9[_0x80d9('0x1d')];var _0x1d3fb9=_0x40708d?0x0:_0x17713b[_0x80d9('0x1e')];var _0x3d9677=_0x40708d?_0x5759a9[_0x80d9('0x1d')]:_0x17713b[_0x80d9('0x1e')]+_0x17713b[_0x80d9('0x1f')];var _0x1ebfc5;if(_0x3d9677>=_0x49f9bb){_0x3d9677=_0x49f9bb;_0x1ebfc5=0xc8;}else{_0x1ebfc5=0xce;}_0x38c5bf['status'](_0x1ebfc5);return _0x38c5bf[_0x80d9('0x20')](_0x80d9('0x21'),_0x1d3fb9+'-'+_0x3d9677+'/'+_0x49f9bb)[_0x80d9('0x1b')](_0x5759a9);}return null;};}function patchUpdates(_0x30ed82){return function(_0x56f149){try{jsonpatch['apply'](_0x56f149,_0x30ed82,!![]);}catch(_0x4620d9){return BPromise[_0x80d9('0x22')](_0x4620d9);}return _0x56f149[_0x80d9('0x23')]();};}function saveUpdates(_0x477e5e,_0x596390){return function(_0x5aabff){if(_0x5aabff){return _0x5aabff[_0x80d9('0x24')](_0x477e5e)[_0x80d9('0x25')](function(_0x510253){return _0x510253;});}return null;};}function removeEntity(_0x1c0316,_0x1cddc8){return function(_0x3e6595){if(_0x3e6595){return _0x3e6595[_0x80d9('0x26')]()[_0x80d9('0x25')](function(){_0x1c0316[_0x80d9('0x19')](0xcc)[_0x80d9('0x1a')]();});}};}function handleEntityNotFound(_0x1a4e9e,_0x232ec7){return function(_0x35f1eb){if(!_0x35f1eb){_0x1a4e9e['sendStatus'](0x194);}return _0x35f1eb;};}function handleError(_0x247188,_0x4e3518){_0x4e3518=_0x4e3518||0x1f4;return function(_0x5320a5){logger[_0x80d9('0x27')](_0x5320a5['stack']);if(_0x5320a5[_0x80d9('0x28')]){delete _0x5320a5['name'];}_0x247188['status'](_0x4e3518)[_0x80d9('0x29')](_0x5320a5);};}exports['index']=function(_0x213a76,_0x46ee3b){var _0x52db01={},_0x3e2321={},_0x62fc73={'count':0x0,'rows':[]};var _0x1dc72f=_[_0x80d9('0x2a')](db[_0x80d9('0x2b')][_0x80d9('0x2c')],function(_0x214e26){return{'name':_0x214e26[_0x80d9('0x2d')],'type':_0x214e26[_0x80d9('0x2e')][_0x80d9('0x2f')]};});_0x3e2321[_0x80d9('0x30')]=_[_0x80d9('0x2a')](_0x1dc72f,'name');_0x3e2321[_0x80d9('0x31')]=_[_0x80d9('0x32')](_0x213a76['query']);_0x3e2321[_0x80d9('0x33')]=_['intersection'](_0x3e2321[_0x80d9('0x30')],_0x3e2321[_0x80d9('0x31')]);_0x52db01[_0x80d9('0x34')]=_[_0x80d9('0x35')](_0x3e2321[_0x80d9('0x30')],qs[_0x80d9('0x36')](_0x213a76[_0x80d9('0x31')][_0x80d9('0x36')]));_0x52db01[_0x80d9('0x34')]=_0x52db01[_0x80d9('0x34')][_0x80d9('0x37')]?_0x52db01['attributes']:_0x3e2321['model'];if(!_0x213a76[_0x80d9('0x31')]['hasOwnProperty'](_0x80d9('0x38'))){_0x52db01[_0x80d9('0x1f')]=qs['limit'](_0x213a76[_0x80d9('0x31')][_0x80d9('0x1f')]);_0x52db01[_0x80d9('0x1e')]=qs[_0x80d9('0x1e')](_0x213a76[_0x80d9('0x31')][_0x80d9('0x1e')]);}_0x52db01[_0x80d9('0x39')]=qs[_0x80d9('0x3a')](_0x213a76['query'][_0x80d9('0x3a')]);_0x52db01['where']=qs['filters'](_['pick'](_0x213a76[_0x80d9('0x31')],_0x3e2321[_0x80d9('0x33')]),_0x1dc72f);if(_0x213a76[_0x80d9('0x31')]['filter']){_0x52db01[_0x80d9('0x3b')]=_[_0x80d9('0x3c')](_0x52db01['where'],{'$or':_[_0x80d9('0x2a')](_0x1dc72f,function(_0x397451){if(_0x397451['type']!==_0x80d9('0x3d')){var _0x3d3610={};_0x3d3610[_0x397451[_0x80d9('0x28')]]={'$like':'%'+_0x213a76[_0x80d9('0x31')]['filter']+'%'};return _0x3d3610;}})});}_0x52db01=_[_0x80d9('0x3c')]({},_0x52db01,_0x213a76[_0x80d9('0x3e')]);var _0x234cd1={'where':_0x52db01[_0x80d9('0x3b')]};return db['ServicenowAccount'][_0x80d9('0x1d')](_0x234cd1)['then'](function(_0x3c630d){_0x62fc73[_0x80d9('0x1d')]=_0x3c630d;if(_0x213a76[_0x80d9('0x31')][_0x80d9('0x3f')]){_0x52db01[_0x80d9('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x80d9('0x41')](_0x52db01);})[_0x80d9('0x25')](function(_0x277e89){_0x62fc73[_0x80d9('0x42')]=_0x277e89;return _0x62fc73;})[_0x80d9('0x25')](respondWithFilteredResult(_0x46ee3b,_0x52db01))['catch'](handleError(_0x46ee3b,null));};exports[_0x80d9('0x43')]=function(_0x45fc48,_0x2d18e5){var _0x13fb04={'raw':![],'where':{'id':_0x45fc48[_0x80d9('0x44')]['id']}},_0x2a8ba3={};_0x2a8ba3['model']=_['keys'](db['ServicenowAccount'][_0x80d9('0x2c')]);_0x2a8ba3[_0x80d9('0x31')]=_['keys'](_0x45fc48[_0x80d9('0x31')]);_0x2a8ba3[_0x80d9('0x33')]=_[_0x80d9('0x35')](_0x2a8ba3[_0x80d9('0x30')],_0x2a8ba3[_0x80d9('0x31')]);_0x13fb04[_0x80d9('0x34')]=_[_0x80d9('0x35')](_0x2a8ba3[_0x80d9('0x30')],qs[_0x80d9('0x36')](_0x45fc48[_0x80d9('0x31')]['fields']));_0x13fb04[_0x80d9('0x34')]=_0x13fb04[_0x80d9('0x34')][_0x80d9('0x37')]?_0x13fb04[_0x80d9('0x34')]:_0x2a8ba3[_0x80d9('0x30')];if(_0x45fc48[_0x80d9('0x31')][_0x80d9('0x3f')]){_0x13fb04[_0x80d9('0x40')]=[{'all':!![]}];}_0x13fb04=_[_0x80d9('0x3c')]({},_0x13fb04,_0x45fc48[_0x80d9('0x3e')]);return db[_0x80d9('0x2b')][_0x80d9('0x45')](_0x13fb04)[_0x80d9('0x25')](handleEntityNotFound(_0x2d18e5,null))[_0x80d9('0x25')](respondWithResult(_0x2d18e5,null))[_0x80d9('0x46')](handleError(_0x2d18e5,null));};exports[_0x80d9('0x47')]=function(_0x59cd1d,_0x3f4eea){return db[_0x80d9('0x2b')][_0x80d9('0x47')](_0x59cd1d[_0x80d9('0x48')],{})['then'](respondWithResult(_0x3f4eea,0xc9))[_0x80d9('0x46')](handleError(_0x3f4eea,null));};exports['update']=function(_0x505b57,_0x53595a){if(_0x505b57[_0x80d9('0x48')]['id']){delete _0x505b57['body']['id'];}return db[_0x80d9('0x2b')][_0x80d9('0x45')]({'where':{'id':_0x505b57['params']['id']}})['then'](handleEntityNotFound(_0x53595a,null))['then'](saveUpdates(_0x505b57[_0x80d9('0x48')],null))['then'](respondWithResult(_0x53595a,null))['catch'](handleError(_0x53595a,null));};exports[_0x80d9('0x26')]=function(_0x42bc59,_0xf72b9e){return db['ServicenowAccount'][_0x80d9('0x45')]({'where':{'id':_0x42bc59[_0x80d9('0x44')]['id']}})[_0x80d9('0x25')](handleEntityNotFound(_0xf72b9e,null))['then'](removeEntity(_0xf72b9e,null))['catch'](handleError(_0xf72b9e,null));};exports['getConfigurations']=function(_0x8344b1,_0x1e46e0,_0x4a5fbe){var _0x2e0fbb={};var _0x2d8a25={};var _0x24d7a5;var _0x1cdad9;return db[_0x80d9('0x2b')][_0x80d9('0x49')]({'where':{'id':_0x8344b1['params']['id']}})[_0x80d9('0x25')](handleEntityNotFound(_0x1e46e0,null))[_0x80d9('0x25')](function(_0x1e517a){if(_0x1e517a){_0x24d7a5=_0x1e517a;_0x2d8a25['model']=_[_0x80d9('0x32')](db[_0x80d9('0x4a')][_0x80d9('0x2c')]);_0x2d8a25[_0x80d9('0x31')]=_[_0x80d9('0x32')](_0x8344b1[_0x80d9('0x31')]);_0x2d8a25[_0x80d9('0x33')]=_[_0x80d9('0x35')](_0x2d8a25['model'],_0x2d8a25[_0x80d9('0x31')]);_0x2e0fbb[_0x80d9('0x34')]=_[_0x80d9('0x35')](_0x2d8a25['model'],qs[_0x80d9('0x36')](_0x8344b1['query']['fields']));_0x2e0fbb[_0x80d9('0x34')]=_0x2e0fbb[_0x80d9('0x34')][_0x80d9('0x37')]?_0x2e0fbb['attributes']:_0x2d8a25['model'];_0x2e0fbb['order']=qs[_0x80d9('0x3a')](_0x8344b1[_0x80d9('0x31')][_0x80d9('0x3a')]);_0x2e0fbb[_0x80d9('0x3b')]=qs[_0x80d9('0x33')](_[_0x80d9('0x4b')](_0x8344b1[_0x80d9('0x31')],_0x2d8a25[_0x80d9('0x33')]));if(_0x8344b1[_0x80d9('0x31')][_0x80d9('0x4c')]){_0x2e0fbb[_0x80d9('0x3b')]=_[_0x80d9('0x3c')](_0x2e0fbb[_0x80d9('0x3b')],{'$or':_[_0x80d9('0x2a')](_0x2e0fbb[_0x80d9('0x34')],function(_0x51814b){var _0x3ddb15={};_0x3ddb15[_0x51814b]={'$like':'%'+_0x8344b1['query'][_0x80d9('0x4c')]+'%'};return _0x3ddb15;})});}_0x2e0fbb=_['merge']({},_0x2e0fbb,_0x8344b1[_0x80d9('0x3e')]);return _0x24d7a5[_0x80d9('0x4d')](_0x2e0fbb);}})[_0x80d9('0x25')](function(_0x43629f){if(_0x43629f){_0x1cdad9=_0x43629f[_0x80d9('0x37')];if(!_0x8344b1[_0x80d9('0x31')][_0x80d9('0x4e')]('nolimit')){_0x2e0fbb[_0x80d9('0x1f')]=qs[_0x80d9('0x1f')](_0x8344b1['query'][_0x80d9('0x1f')]);_0x2e0fbb[_0x80d9('0x1e')]=qs[_0x80d9('0x1e')](_0x8344b1['query'][_0x80d9('0x1e')]);}return _0x24d7a5[_0x80d9('0x4d')](_0x2e0fbb);}})['then'](function(_0x44d7e6){if(_0x44d7e6){return _0x44d7e6?{'count':_0x1cdad9,'rows':_0x44d7e6}:null;}})[_0x80d9('0x25')](respondWithResult(_0x1e46e0,null))[_0x80d9('0x46')](handleError(_0x1e46e0,null));};exports[_0x80d9('0x4f')]=function(_0x2c6cbc,_0x3645cd,_0x40190c){if(_0x2c6cbc['body']['id']){delete _0x2c6cbc[_0x80d9('0x48')]['id'];}return db[_0x80d9('0x2b')][_0x80d9('0x49')]({'where':{'id':_0x2c6cbc[_0x80d9('0x44')]['id']}})[_0x80d9('0x25')](handleEntityNotFound(_0x3645cd,null))[_0x80d9('0x25')](function(_0x2963cb){if(_0x2963cb){_0x2c6cbc[_0x80d9('0x48')][_0x80d9('0x50')]=_0x2963cb['id'];_0x2c6cbc[_0x80d9('0x48')][_0x80d9('0x51')]=integrations['getSubjects'](_0x2c6cbc[_0x80d9('0x48')][_0x80d9('0x52')],_0x2c6cbc[_0x80d9('0x48')][_0x80d9('0x2e')]);_0x2c6cbc[_0x80d9('0x48')][_0x80d9('0x53')]=integrations['getDescriptions'](_0x2c6cbc[_0x80d9('0x48')]['channel'],_0x2c6cbc['body']['type']);return db[_0x80d9('0x4a')][_0x80d9('0x47')](_0x2c6cbc[_0x80d9('0x48')],{'include':[{'model':db[_0x80d9('0x54')],'as':_0x80d9('0x51')},{'model':db[_0x80d9('0x54')],'as':'Descriptions'}]});}return null;})[_0x80d9('0x25')](respondWithResult(_0x3645cd,null))[_0x80d9('0x46')](handleError(_0x3645cd,null));};exports[_0x80d9('0x55')]=function(_0xb07123,_0xe434e0,_0x3f5082){var _0x1e97af=[_0x80d9('0x56'),'hold_reason',_0x80d9('0x57'),_0x80d9('0x58'),_0x80d9('0x59'),_0x80d9('0x5a'),_0x80d9('0x5b'),'severity',_0x80d9('0x5c')];var _0x3647f7=[_0x80d9('0x5d'),_0x80d9('0x56'),_0x80d9('0x5e'),_0x80d9('0x5f'),_0x80d9('0x60'),_0x80d9('0x61'),'child_incidents','hold_reason',_0x80d9('0x62'),_0x80d9('0x63'),_0x80d9('0x64'),_0x80d9('0x65'),_0x80d9('0x66'),_0x80d9('0x67'),_0x80d9('0x68'),'sys_domain',_0x80d9('0x69'),_0x80d9('0x6a'),_0x80d9('0x57'),_0x80d9('0x39'),_0x80d9('0x6b'),_0x80d9('0x6c'),_0x80d9('0x6d'),_0x80d9('0x6e'),'impact',_0x80d9('0x6f'),_0x80d9('0x70'),_0x80d9('0x71'),_0x80d9('0x72'),_0x80d9('0x73'),_0x80d9('0x74'),_0x80d9('0x75'),_0x80d9('0x76'),_0x80d9('0x77'),_0x80d9('0x78'),_0x80d9('0x79'),_0x80d9('0x7a'),_0x80d9('0x7b'),_0x80d9('0x7c'),_0x80d9('0x7d'),_0x80d9('0x7e'),_0x80d9('0x58'),_0x80d9('0x7f'),'short_description',_0x80d9('0x59'),_0x80d9('0x80'),_0x80d9('0x81'),_0x80d9('0x82'),'assignment_group',_0x80d9('0x83'),_0x80d9('0x84'),_0x80d9('0x85'),'calendar_duration',_0x80d9('0x5a'),_0x80d9('0x86'),'close_notes','closed_by',_0x80d9('0x87'),_0x80d9('0x88'),'sys_id',_0x80d9('0x89'),_0x80d9('0x8a'),_0x80d9('0x5b'),_0x80d9('0x8b'),_0x80d9('0x8c'),_0x80d9('0x8d'),_0x80d9('0x8e'),_0x80d9('0x8f'),_0x80d9('0x90'),_0x80d9('0x91'),_0x80d9('0x92'),_0x80d9('0x93'),'approval',_0x80d9('0x94'),'due_date',_0x80d9('0x95'),_0x80d9('0x96'),_0x80d9('0x97'),_0x80d9('0x98'),'upon_approval',_0x80d9('0x99'),_0x80d9('0x9a'),_0x80d9('0x5c')];var _0x3472c2='';var _0x4718b8='';var _0x56ae7d=[];var _0x107373='';var _0x3e3f67='';var _0x2605bc=[];var _0x35e409='';var _0x31c924='';var _0x5cb87b={};var _0xcdf6e='';return db[_0x80d9('0x2b')][_0x80d9('0x49')]({'where':{'id':_0xb07123['params']['id']},'attributes':['id','username','password',_0x80d9('0x9b'),_0x80d9('0x9c'),_0x80d9('0x9d')]})[_0x80d9('0x25')](handleEntityNotFound(_0xe434e0,null))['then'](function(_0x5866e2){if(_0x5866e2){_0xcdf6e=_0x5866e2[_0x80d9('0x9c')];var _0x107d99=_0xcdf6e[_0x80d9('0x9e')](-0x1);if(_0x107d99==='/'){_0xcdf6e=_0xcdf6e[_0x80d9('0x9f')](0x0,_0xcdf6e[_0x80d9('0xa0')](_0x107d99));}_0x31c924=util[_0x80d9('0xa1')]('%s/api/now/doc/table/schema/',_0xcdf6e);_0x35e409=util[_0x80d9('0xa1')](_0x80d9('0xa2'),_0xcdf6e);_0x5cb87b={'user':_0x5866e2[_0x80d9('0xa3')],'pass':_0x5866e2[_0x80d9('0xa4')]};var _0x1809ea={'method':'GET','uri':_0x31c924+'incident?sysparm_display_value=all','auth':_0x5cb87b,'json':!![]};return rp(_0x1809ea);}})[_0x80d9('0x25')](function(_0x4f67f8){if(_0x4f67f8['result'][_0x80d9('0x37')]>0x0){_0x3472c2=_0x4f67f8[_0x80d9('0xa5')];}console[_0x80d9('0xa6')](_0x80d9('0xa7'),_0x3472c2);_0x2605bc=[];_0x4718b8=Object['assign']([],_0x3472c2);_[_0x80d9('0xa8')](_0x4718b8,function(_0x17c4e0){return!_0x1e97af['includes'](_0x17c4e0[_0x80d9('0x28')]);});_0x4718b8[_0x80d9('0xa9')](function(_0x422833){var _0x38dfed=createFieldObject(_0x35e409,_0x5cb87b,_0x422833[_0x80d9('0xaa')],_0x422833[_0x80d9('0x28')],_0x422833[_0x80d9('0xab')],![]);_0x2605bc[_0x80d9('0xac')](_0x38dfed);});return Promise[_0x80d9('0xad')](_0x2605bc);})[_0x80d9('0x25')](function(_0x313783){_0x56ae7d=_0x313783;_0x107373=Object[_0x80d9('0xae')]([],_0x3472c2);console[_0x80d9('0xa6')](_0x80d9('0xaf'),_0x3472c2);_[_0x80d9('0xa8')](_0x107373,function(_0x4d27af){return _0x3647f7[_0x80d9('0xb0')](_0x4d27af['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x107373);_0x2605bc=[];_0x107373['forEach'](function(_0x75b4c1){var _0x505d7d=createFieldObject(_0x35e409,_0x5cb87b,_0x75b4c1[_0x80d9('0xaa')],_0x75b4c1[_0x80d9('0x28')],_0x75b4c1[_0x80d9('0xab')],!![]);_0x2605bc[_0x80d9('0xac')](_0x505d7d);});return Promise[_0x80d9('0xad')](_0x2605bc);})['then'](function(_0x4c3059){_0x3e3f67=_0x4c3059;var _0x5e3928=_0x56ae7d[_0x80d9('0xb1')](_0x3e3f67);return{'count':_0x5e3928[_0x80d9('0x37')],'rows':_0x5e3928};})[_0x80d9('0x25')](respondWithResult(_0xe434e0,null))[_0x80d9('0x46')](function(_0x3f00b9){console['log'](_0x80d9('0xb2')+_0x3f00b9);var _0x1e4e27=_0xb07123['query'][_0x80d9('0xb3')]?0x1f4:_0x3f00b9['statusCode']||0x1f4;logger[_0x80d9('0x27')](_0x3f00b9[_0x80d9('0xb4')]);delete _0x3f00b9[_0x80d9('0x28')];if(_0x1e4e27===0x191){_0x1e4e27=0x190;}_0xe434e0[_0x80d9('0x19')](_0x1e4e27)[_0x80d9('0x29')](_0xb07123[_0x80d9('0x31')]['test']?{'message':_0x80d9('0xb5'),'statusCode':_0x3f00b9[_0x80d9('0xb6')]}:_0x3f00b9);});};function createFieldObject(_0x4c91b0,_0x3ac0fd,_0x56366,_0x38701b,_0x13a48d,_0x52d494){return new Promise(function(_0xd2f452,_0x40e1f3){var _0x1e7884={'id':_0x38701b,'name':_0x13a48d,'custom':_0x52d494};if(_0x56366===_0x80d9('0xb7')){_0x1e7884[_0x80d9('0x3e')]=[{'name':'True','value':_0x80d9('0xb8')},{'name':'False','value':'false'}];_0xd2f452(_0x1e7884);}else{var _0x4a1168={'method':'GET','uri':_0x4c91b0+_0x80d9('0xb9')+_0x38701b,'auth':_0x3ac0fd,'json':!![]};return rp(_0x4a1168)[_0x80d9('0x25')](function(_0x224f03){var _0x742d95=[];if(_0x224f03['result'][_0x80d9('0x37')]>0x0){_0x224f03['result'][_0x80d9('0xa9')](function(_0x311558){if(_0x311558['inactive']==='false'){var _0x3205ff={'name':_0x311558[_0x80d9('0xab')],'value':_0x311558[_0x80d9('0xba')]};_0x742d95[_0x80d9('0xac')](_0x3205ff);}});}_0x1e7884[_0x80d9('0x3e')]=_0x742d95;if(_0x1e7884[_0x80d9('0x3e')][_0x80d9('0x37')]>0x0){_0xd2f452(_0x1e7884);}else{if(_0x52d494==![]){_0xd2f452();}else{_0xd2f452(_0x1e7884);}}});}});}
\ No newline at end of file
+var _0x28cf=['sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','error','stack','name','send','ServicenowAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','map','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','destroy','getConfigurations','findOne','pick','addConfiguration','getSubjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','knowledge','close_code','severity','category','parent','made_sla','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','calendar_stc','cmdb_ci','delivery_plan','business_service','sys_domain_path','rfc','time_worked','group_list','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','delivery_task','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','sys_id','reopened_by','urgency','problem_id','assigned_to','comments','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','correlation_id','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','False','false'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x28cf,0x155));var _0xf28c=function(_0xb775ad,_0xbd08e5){_0xb775ad=_0xb775ad-0x0;var _0x177404=_0x28cf[_0xb775ad];return _0x177404;};'use strict';var emlformat=require(_0xf28c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf28c('0x1'));var jsonpatch=require(_0xf28c('0x2'));var rp=require(_0xf28c('0x3'));var moment=require(_0xf28c('0x4'));var BPromise=require(_0xf28c('0x5'));var Mustache=require(_0xf28c('0x6'));var util=require(_0xf28c('0x7'));var path=require(_0xf28c('0x8'));var sox=require(_0xf28c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf28c('0xa'));var squel=require(_0xf28c('0xb'));var crypto=require(_0xf28c('0xc'));var jsforce=require(_0xf28c('0xd'));var deskjs=require(_0xf28c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf28c('0xf'));var Papa=require(_0xf28c('0x10'));var Redis=require(_0xf28c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf28c('0x12'));var as=require(_0xf28c('0x13'));var hardwareService=require(_0xf28c('0x14'));var logger=require(_0xf28c('0x15'))(_0xf28c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf28c('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf28c('0x18'));function respondWithStatusCode(_0x4268fa,_0x581415){_0x581415=_0x581415||0xcc;return function(_0x19e4bd){if(_0x19e4bd){return _0x4268fa[_0xf28c('0x19')](_0x581415);}return _0x4268fa[_0xf28c('0x1a')](_0x581415)[_0xf28c('0x1b')]();};}function respondWithResult(_0x242213,_0x218455){_0x218455=_0x218455||0xc8;return function(_0x373b47){if(_0x373b47){return _0x242213[_0xf28c('0x1a')](_0x218455)['json'](_0x373b47);}};}function respondWithFilteredResult(_0x3bb3cd,_0x9a5d58){return function(_0x4e0b13){if(_0x4e0b13){var _0xa9cc3a=typeof _0x9a5d58[_0xf28c('0x1c')]===_0xf28c('0x1d')&&typeof _0x9a5d58[_0xf28c('0x1e')]===_0xf28c('0x1d');var _0x55fa55=_0x4e0b13[_0xf28c('0x1f')];var _0x61ed59=_0xa9cc3a?0x0:_0x9a5d58[_0xf28c('0x1c')];var _0x26e8a8=_0xa9cc3a?_0x4e0b13[_0xf28c('0x1f')]:_0x9a5d58['offset']+_0x9a5d58['limit'];var _0x447220;if(_0x26e8a8>=_0x55fa55){_0x26e8a8=_0x55fa55;_0x447220=0xc8;}else{_0x447220=0xce;}_0x3bb3cd['status'](_0x447220);return _0x3bb3cd['set'](_0xf28c('0x20'),_0x61ed59+'-'+_0x26e8a8+'/'+_0x55fa55)[_0xf28c('0x21')](_0x4e0b13);}return null;};}function patchUpdates(_0x589381){return function(_0x37e3a0){try{jsonpatch[_0xf28c('0x22')](_0x37e3a0,_0x589381,!![]);}catch(_0x31eed1){return BPromise[_0xf28c('0x23')](_0x31eed1);}return _0x37e3a0['save']();};}function saveUpdates(_0x24097a,_0x370618){return function(_0x5d7451){if(_0x5d7451){return _0x5d7451['update'](_0x24097a)[_0xf28c('0x24')](function(_0xbc9211){return _0xbc9211;});}return null;};}function removeEntity(_0x52a4fb,_0x150ef5){return function(_0x3b1541){if(_0x3b1541){return _0x3b1541['destroy']()[_0xf28c('0x24')](function(){_0x52a4fb[_0xf28c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59bf42,_0x239478){return function(_0x273eec){if(!_0x273eec){_0x59bf42[_0xf28c('0x19')](0x194);}return _0x273eec;};}function handleError(_0x21c6b9,_0x3f943f){_0x3f943f=_0x3f943f||0x1f4;return function(_0x5de864){logger[_0xf28c('0x25')](_0x5de864[_0xf28c('0x26')]);if(_0x5de864[_0xf28c('0x27')]){delete _0x5de864['name'];}_0x21c6b9[_0xf28c('0x1a')](_0x3f943f)[_0xf28c('0x28')](_0x5de864);};}exports['index']=function(_0x5d47d5,_0x1712d8){var _0x53080b={},_0x36a152={},_0x1059a5={'count':0x0,'rows':[]};var _0x171fb6=_['map'](db[_0xf28c('0x29')]['rawAttributes'],function(_0x41eaa6){return{'name':_0x41eaa6[_0xf28c('0x2a')],'type':_0x41eaa6[_0xf28c('0x2b')]['key']};});_0x36a152[_0xf28c('0x2c')]=_['map'](_0x171fb6,_0xf28c('0x27'));_0x36a152[_0xf28c('0x2d')]=_[_0xf28c('0x2e')](_0x5d47d5[_0xf28c('0x2d')]);_0x36a152[_0xf28c('0x2f')]=_[_0xf28c('0x30')](_0x36a152[_0xf28c('0x2c')],_0x36a152[_0xf28c('0x2d')]);_0x53080b['attributes']=_[_0xf28c('0x30')](_0x36a152['model'],qs[_0xf28c('0x31')](_0x5d47d5['query']['fields']));_0x53080b[_0xf28c('0x32')]=_0x53080b[_0xf28c('0x32')][_0xf28c('0x33')]?_0x53080b['attributes']:_0x36a152[_0xf28c('0x2c')];if(!_0x5d47d5[_0xf28c('0x2d')][_0xf28c('0x34')](_0xf28c('0x35'))){_0x53080b[_0xf28c('0x1e')]=qs['limit'](_0x5d47d5[_0xf28c('0x2d')][_0xf28c('0x1e')]);_0x53080b[_0xf28c('0x1c')]=qs[_0xf28c('0x1c')](_0x5d47d5[_0xf28c('0x2d')][_0xf28c('0x1c')]);}_0x53080b[_0xf28c('0x36')]=qs[_0xf28c('0x37')](_0x5d47d5[_0xf28c('0x2d')]['sort']);_0x53080b['where']=qs['filters'](_['pick'](_0x5d47d5[_0xf28c('0x2d')],_0x36a152[_0xf28c('0x2f')]),_0x171fb6);if(_0x5d47d5['query'][_0xf28c('0x38')]){_0x53080b[_0xf28c('0x39')]=_['merge'](_0x53080b[_0xf28c('0x39')],{'$or':_[_0xf28c('0x3a')](_0x171fb6,function(_0x5da3f5){if(_0x5da3f5[_0xf28c('0x2b')]!=='VIRTUAL'){var _0xd08d71={};_0xd08d71[_0x5da3f5['name']]={'$like':'%'+_0x5d47d5[_0xf28c('0x2d')][_0xf28c('0x38')]+'%'};return _0xd08d71;}})});}_0x53080b=_[_0xf28c('0x3b')]({},_0x53080b,_0x5d47d5[_0xf28c('0x3c')]);var _0x2e78f2={'where':_0x53080b[_0xf28c('0x39')]};return db['ServicenowAccount'][_0xf28c('0x1f')](_0x2e78f2)[_0xf28c('0x24')](function(_0x454614){_0x1059a5[_0xf28c('0x1f')]=_0x454614;if(_0x5d47d5[_0xf28c('0x2d')][_0xf28c('0x3d')]){_0x53080b[_0xf28c('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xf28c('0x3f')](_0x53080b);})[_0xf28c('0x24')](function(_0x592bd6){_0x1059a5['rows']=_0x592bd6;return _0x1059a5;})[_0xf28c('0x24')](respondWithFilteredResult(_0x1712d8,_0x53080b))[_0xf28c('0x40')](handleError(_0x1712d8,null));};exports[_0xf28c('0x41')]=function(_0x2eb072,_0x5a3df6){var _0x1f1601={'raw':![],'where':{'id':_0x2eb072[_0xf28c('0x42')]['id']}},_0x32b838={};_0x32b838[_0xf28c('0x2c')]=_[_0xf28c('0x2e')](db[_0xf28c('0x29')][_0xf28c('0x43')]);_0x32b838['query']=_[_0xf28c('0x2e')](_0x2eb072[_0xf28c('0x2d')]);_0x32b838[_0xf28c('0x2f')]=_['intersection'](_0x32b838['model'],_0x32b838[_0xf28c('0x2d')]);_0x1f1601['attributes']=_[_0xf28c('0x30')](_0x32b838[_0xf28c('0x2c')],qs[_0xf28c('0x31')](_0x2eb072[_0xf28c('0x2d')][_0xf28c('0x31')]));_0x1f1601[_0xf28c('0x32')]=_0x1f1601[_0xf28c('0x32')][_0xf28c('0x33')]?_0x1f1601[_0xf28c('0x32')]:_0x32b838[_0xf28c('0x2c')];if(_0x2eb072[_0xf28c('0x2d')][_0xf28c('0x3d')]){_0x1f1601[_0xf28c('0x3e')]=[{'all':!![]}];}_0x1f1601=_['merge']({},_0x1f1601,_0x2eb072[_0xf28c('0x3c')]);return db['ServicenowAccount']['find'](_0x1f1601)[_0xf28c('0x24')](handleEntityNotFound(_0x5a3df6,null))[_0xf28c('0x24')](respondWithResult(_0x5a3df6,null))[_0xf28c('0x40')](handleError(_0x5a3df6,null));};exports[_0xf28c('0x44')]=function(_0x16e0af,_0x23dc4c){return db[_0xf28c('0x29')][_0xf28c('0x44')](_0x16e0af['body'],{})['then'](respondWithResult(_0x23dc4c,0xc9))[_0xf28c('0x40')](handleError(_0x23dc4c,null));};exports['update']=function(_0x209c58,_0xf23844){if(_0x209c58[_0xf28c('0x45')]['id']){delete _0x209c58[_0xf28c('0x45')]['id'];}return db[_0xf28c('0x29')][_0xf28c('0x46')]({'where':{'id':_0x209c58[_0xf28c('0x42')]['id']}})[_0xf28c('0x24')](handleEntityNotFound(_0xf23844,null))['then'](saveUpdates(_0x209c58[_0xf28c('0x45')],null))[_0xf28c('0x24')](respondWithResult(_0xf23844,null))[_0xf28c('0x40')](handleError(_0xf23844,null));};exports[_0xf28c('0x47')]=function(_0x4eb70a,_0x21fdb6){return db[_0xf28c('0x29')]['find']({'where':{'id':_0x4eb70a[_0xf28c('0x42')]['id']}})[_0xf28c('0x24')](handleEntityNotFound(_0x21fdb6,null))['then'](removeEntity(_0x21fdb6,null))['catch'](handleError(_0x21fdb6,null));};exports[_0xf28c('0x48')]=function(_0x4e1b8d,_0x2eba74,_0x1d3b7f){var _0x3edbe9={};var _0xb10282={};var _0x2c276e;var _0x58a055;return db[_0xf28c('0x29')][_0xf28c('0x49')]({'where':{'id':_0x4e1b8d['params']['id']}})[_0xf28c('0x24')](handleEntityNotFound(_0x2eba74,null))[_0xf28c('0x24')](function(_0x6d170c){if(_0x6d170c){_0x2c276e=_0x6d170c;_0xb10282[_0xf28c('0x2c')]=_[_0xf28c('0x2e')](db['ServicenowConfiguration']['rawAttributes']);_0xb10282[_0xf28c('0x2d')]=_[_0xf28c('0x2e')](_0x4e1b8d[_0xf28c('0x2d')]);_0xb10282[_0xf28c('0x2f')]=_['intersection'](_0xb10282[_0xf28c('0x2c')],_0xb10282[_0xf28c('0x2d')]);_0x3edbe9['attributes']=_[_0xf28c('0x30')](_0xb10282[_0xf28c('0x2c')],qs[_0xf28c('0x31')](_0x4e1b8d[_0xf28c('0x2d')][_0xf28c('0x31')]));_0x3edbe9[_0xf28c('0x32')]=_0x3edbe9[_0xf28c('0x32')][_0xf28c('0x33')]?_0x3edbe9[_0xf28c('0x32')]:_0xb10282[_0xf28c('0x2c')];_0x3edbe9[_0xf28c('0x36')]=qs[_0xf28c('0x37')](_0x4e1b8d[_0xf28c('0x2d')]['sort']);_0x3edbe9[_0xf28c('0x39')]=qs[_0xf28c('0x2f')](_[_0xf28c('0x4a')](_0x4e1b8d[_0xf28c('0x2d')],_0xb10282[_0xf28c('0x2f')]));if(_0x4e1b8d[_0xf28c('0x2d')][_0xf28c('0x38')]){_0x3edbe9[_0xf28c('0x39')]=_['merge'](_0x3edbe9['where'],{'$or':_['map'](_0x3edbe9['attributes'],function(_0x2aa2e5){var _0x414c5d={};_0x414c5d[_0x2aa2e5]={'$like':'%'+_0x4e1b8d[_0xf28c('0x2d')][_0xf28c('0x38')]+'%'};return _0x414c5d;})});}_0x3edbe9=_[_0xf28c('0x3b')]({},_0x3edbe9,_0x4e1b8d[_0xf28c('0x3c')]);return _0x2c276e['getConfigurations'](_0x3edbe9);}})[_0xf28c('0x24')](function(_0x372b1b){if(_0x372b1b){_0x58a055=_0x372b1b['length'];if(!_0x4e1b8d[_0xf28c('0x2d')]['hasOwnProperty'](_0xf28c('0x35'))){_0x3edbe9[_0xf28c('0x1e')]=qs['limit'](_0x4e1b8d[_0xf28c('0x2d')][_0xf28c('0x1e')]);_0x3edbe9[_0xf28c('0x1c')]=qs['offset'](_0x4e1b8d[_0xf28c('0x2d')][_0xf28c('0x1c')]);}return _0x2c276e[_0xf28c('0x48')](_0x3edbe9);}})[_0xf28c('0x24')](function(_0x24c341){if(_0x24c341){return _0x24c341?{'count':_0x58a055,'rows':_0x24c341}:null;}})[_0xf28c('0x24')](respondWithResult(_0x2eba74,null))[_0xf28c('0x40')](handleError(_0x2eba74,null));};exports[_0xf28c('0x4b')]=function(_0x5a962c,_0x58de1a,_0x786a0e){if(_0x5a962c[_0xf28c('0x45')]['id']){delete _0x5a962c[_0xf28c('0x45')]['id'];}return db['ServicenowAccount'][_0xf28c('0x49')]({'where':{'id':_0x5a962c['params']['id']}})[_0xf28c('0x24')](handleEntityNotFound(_0x58de1a,null))[_0xf28c('0x24')](function(_0x38fbf1){if(_0x38fbf1){_0x5a962c[_0xf28c('0x45')]['AccountId']=_0x38fbf1['id'];_0x5a962c['body']['Subjects']=integrations[_0xf28c('0x4c')](_0x5a962c[_0xf28c('0x45')][_0xf28c('0x4d')],_0x5a962c[_0xf28c('0x45')][_0xf28c('0x2b')]);_0x5a962c[_0xf28c('0x45')][_0xf28c('0x4e')]=integrations['getDescriptions'](_0x5a962c[_0xf28c('0x45')]['channel'],_0x5a962c[_0xf28c('0x45')][_0xf28c('0x2b')]);return db[_0xf28c('0x4f')][_0xf28c('0x44')](_0x5a962c[_0xf28c('0x45')],{'include':[{'model':db[_0xf28c('0x50')],'as':'Subjects'},{'model':db[_0xf28c('0x50')],'as':_0xf28c('0x4e')}]});}return null;})[_0xf28c('0x24')](respondWithResult(_0x58de1a,null))[_0xf28c('0x40')](handleError(_0x58de1a,null));};exports[_0xf28c('0x51')]=function(_0x42af51,_0x10c810,_0x6cb8f5){var _0x1460b4=['made_sla',_0xf28c('0x52'),_0xf28c('0x53'),'subcategory',_0xf28c('0x54'),'notify','incident_state',_0xf28c('0x55'),_0xf28c('0x56')];var _0x48291d=[_0xf28c('0x57'),_0xf28c('0x58'),_0xf28c('0x59'),_0xf28c('0x5a'),'upon_reject',_0xf28c('0x5b'),_0xf28c('0x5c'),'hold_reason',_0xf28c('0x5d'),_0xf28c('0x5e'),_0xf28c('0x5f'),'sys_updated_by',_0xf28c('0x60'),_0xf28c('0x61'),_0xf28c('0x62'),_0xf28c('0x63'),'state','sys_created_by',_0xf28c('0x53'),_0xf28c('0x36'),_0xf28c('0x64'),'closed_at',_0xf28c('0x65'),_0xf28c('0x66'),'impact','active','work_notes_list',_0xf28c('0x67'),'priority',_0xf28c('0x68'),_0xf28c('0x69'),_0xf28c('0x6a'),'expected_start','opened_at','business_duration',_0xf28c('0x6b'),'work_end',_0xf28c('0x6c'),_0xf28c('0x6d'),_0xf28c('0x6e'),_0xf28c('0x6f'),_0xf28c('0x70'),_0xf28c('0x71'),_0xf28c('0x72'),_0xf28c('0x54'),'correlation_display',_0xf28c('0x73'),'work_start','assignment_group','business_stc','additional_assignee_list',_0xf28c('0x74'),_0xf28c('0x75'),_0xf28c('0x76'),_0xf28c('0x77'),_0xf28c('0x78'),_0xf28c('0x79'),_0xf28c('0x7a'),'parent_incident',_0xf28c('0x7b'),'contact_type',_0xf28c('0x7c'),'incident_state',_0xf28c('0x7d'),_0xf28c('0x7e'),'company','reassignment_count','activity_due',_0xf28c('0x7f'),_0xf28c('0x55'),_0xf28c('0x80'),'sla_due',_0xf28c('0x81'),_0xf28c('0x82'),_0xf28c('0x83'),'sys_mod_count',_0xf28c('0x84'),_0xf28c('0x85'),'escalation','upon_approval',_0xf28c('0x86'),'location',_0xf28c('0x56')];var _0x1f476a='';var _0x1a395b='';var _0x414d01=[];var _0x309c9d='';var _0x3a7b84='';var _0x5f3ad6=[];var _0xa1e4e9='';var _0x287fe9='';var _0x450d9f={};var _0x3056d8='';return db[_0xf28c('0x29')]['findOne']({'where':{'id':_0x42af51['params']['id']},'attributes':['id',_0xf28c('0x87'),'password',_0xf28c('0x88'),_0xf28c('0x89'),_0xf28c('0x8a')]})[_0xf28c('0x24')](handleEntityNotFound(_0x10c810,null))[_0xf28c('0x24')](function(_0x5d3f19){if(_0x5d3f19){_0x3056d8=_0x5d3f19[_0xf28c('0x89')];var _0xcd1269=_0x3056d8['slice'](-0x1);if(_0xcd1269==='/'){_0x3056d8=_0x3056d8[_0xf28c('0x8b')](0x0,_0x3056d8[_0xf28c('0x8c')](_0xcd1269));}_0x287fe9=util[_0xf28c('0x8d')](_0xf28c('0x8e'),_0x3056d8);_0xa1e4e9=util[_0xf28c('0x8d')](_0xf28c('0x8f'),_0x3056d8);_0x450d9f={'user':_0x5d3f19[_0xf28c('0x87')],'pass':_0x5d3f19[_0xf28c('0x90')]};var _0x5c654b={'method':_0xf28c('0x91'),'uri':_0x287fe9+_0xf28c('0x92'),'auth':_0x450d9f,'json':!![]};return rp(_0x5c654b);}})[_0xf28c('0x24')](function(_0x2b9bff){if(_0x2b9bff[_0xf28c('0x93')][_0xf28c('0x33')]>0x0){_0x1f476a=_0x2b9bff[_0xf28c('0x93')];}console[_0xf28c('0x94')](_0xf28c('0x95'),_0x1f476a);_0x5f3ad6=[];_0x1a395b=Object[_0xf28c('0x96')]([],_0x1f476a);_['remove'](_0x1a395b,function(_0x3179d7){return!_0x1460b4[_0xf28c('0x97')](_0x3179d7[_0xf28c('0x27')]);});_0x1a395b[_0xf28c('0x98')](function(_0x347b65){var _0x1db345=createFieldObject(_0xa1e4e9,_0x450d9f,_0x347b65['internalType'],_0x347b65[_0xf28c('0x27')],_0x347b65[_0xf28c('0x99')],![]);_0x5f3ad6['push'](_0x1db345);});return Promise[_0xf28c('0x9a')](_0x5f3ad6);})['then'](function(_0x379318){_0x414d01=_0x379318;_0x309c9d=Object['assign']([],_0x1f476a);console[_0xf28c('0x94')](_0xf28c('0x9b'),_0x1f476a);_[_0xf28c('0x9c')](_0x309c9d,function(_0xa9e77){return _0x48291d[_0xf28c('0x97')](_0xa9e77[_0xf28c('0x27')]);});console[_0xf28c('0x94')](_0xf28c('0x9d'),_0x309c9d);_0x5f3ad6=[];_0x309c9d['forEach'](function(_0x5423b9){var _0x29f1bb=createFieldObject(_0xa1e4e9,_0x450d9f,_0x5423b9['internalType'],_0x5423b9[_0xf28c('0x27')],_0x5423b9[_0xf28c('0x99')],!![]);_0x5f3ad6[_0xf28c('0x9e')](_0x29f1bb);});return Promise[_0xf28c('0x9a')](_0x5f3ad6);})[_0xf28c('0x24')](function(_0x5f3adb){_0x3a7b84=_0x5f3adb;var _0x30d4c3=_0x414d01[_0xf28c('0x9f')](_0x3a7b84);return{'count':_0x30d4c3[_0xf28c('0x33')],'rows':_0x30d4c3};})[_0xf28c('0x24')](respondWithResult(_0x10c810,null))[_0xf28c('0x40')](function(_0x330086){console['log'](_0xf28c('0xa0')+_0x330086);var _0x45c348=_0x42af51['query'][_0xf28c('0xa1')]?0x1f4:_0x330086[_0xf28c('0xa2')]||0x1f4;logger[_0xf28c('0x25')](_0x330086[_0xf28c('0x26')]);delete _0x330086[_0xf28c('0x27')];if(_0x45c348===0x191){_0x45c348=0x190;}_0x10c810[_0xf28c('0x1a')](_0x45c348)[_0xf28c('0x28')](_0x42af51[_0xf28c('0x2d')][_0xf28c('0xa1')]?{'message':'Wrong\x20credentials','statusCode':_0x330086[_0xf28c('0xa2')]}:_0x330086);});};function createFieldObject(_0x31f092,_0x5eed15,_0x349488,_0x32670b,_0x100712,_0x445359){return new Promise(function(_0x450b3f,_0x39eb63){var _0x4336b2={'id':_0x32670b,'name':_0x100712,'custom':_0x445359};if(_0x349488===_0xf28c('0xa3')){_0x4336b2[_0xf28c('0x3c')]=[{'name':'True','value':'true'},{'name':_0xf28c('0xa4'),'value':_0xf28c('0xa5')}];_0x450b3f(_0x4336b2);}else{var _0x252a71={'method':_0xf28c('0x91'),'uri':_0x31f092+_0xf28c('0xa6')+_0x32670b,'auth':_0x5eed15,'json':!![]};return rp(_0x252a71)[_0xf28c('0x24')](function(_0x43051c){var _0x1871eb=[];if(_0x43051c['result'][_0xf28c('0x33')]>0x0){_0x43051c[_0xf28c('0x93')]['forEach'](function(_0x33547b){if(_0x33547b[_0xf28c('0xa7')]===_0xf28c('0xa5')){var _0x1b807b={'name':_0x33547b[_0xf28c('0x99')],'value':_0x33547b[_0xf28c('0xa8')]};_0x1871eb[_0xf28c('0x9e')](_0x1b807b);}});}_0x4336b2[_0xf28c('0x3c')]=_0x1871eb;if(_0x4336b2['options'][_0xf28c('0x33')]>0x0){_0x450b3f(_0x4336b2);}else{if(_0x445359==![]){_0x450b3f();}else{_0x450b3f(_0x4336b2);}}});}});}
\ No newline at end of file