Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 578e02b..42dbcf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f38=['destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','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','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4f38,0x1ef));var _0x84f3=function(_0x43f9ab,_0x277c47){_0x43f9ab=_0x43f9ab-0x0;var _0x2e339a=_0x4f38[_0x43f9ab];return _0x2e339a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x84f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84f3('0x1'));var Mustache=require(_0x84f3('0x2'));var util=require(_0x84f3('0x3'));var path=require(_0x84f3('0x4'));var sox=require(_0x84f3('0x5'));var csv=require('to-csv');var ejs=require(_0x84f3('0x6'));var fs=require('fs');var fs_extra=require(_0x84f3('0x7'));var _=require(_0x84f3('0x8'));var squel=require(_0x84f3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84f3('0xa'));var Papa=require(_0x84f3('0xb'));var Redis=require(_0x84f3('0xc'));var authService=require(_0x84f3('0xd'));var qs=require(_0x84f3('0xe'));var as=require(_0x84f3('0xf'));var hardwareService=require(_0x84f3('0x10'));var logger=require(_0x84f3('0x11'))(_0x84f3('0x12'));var utils=require(_0x84f3('0x13'));var config=require(_0x84f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x84f3('0x15'))['db'];var integrations=require(_0x84f3('0x16'));function respondWithStatusCode(_0x2c3b2e,_0x5aea88){_0x5aea88=_0x5aea88||0xcc;return function(_0x476004){if(_0x476004){return _0x2c3b2e[_0x84f3('0x17')](_0x5aea88);}return _0x2c3b2e[_0x84f3('0x18')](_0x5aea88)[_0x84f3('0x19')]();};}function respondWithResult(_0x510b28,_0x14bee3){_0x14bee3=_0x14bee3||0xc8;return function(_0x43665e){if(_0x43665e){return _0x510b28[_0x84f3('0x18')](_0x14bee3)['json'](_0x43665e);}};}function respondWithFilteredResult(_0x5a0e27,_0x1c746e){return function(_0x4041ff){if(_0x4041ff){var _0x4d284f=typeof _0x1c746e[_0x84f3('0x1a')]===_0x84f3('0x1b')&&typeof _0x1c746e[_0x84f3('0x1c')]==='undefined';var _0x4bd63f=_0x4041ff[_0x84f3('0x1d')];var _0x3e20a7=_0x4d284f?0x0:_0x1c746e['offset'];var _0x543cd8=_0x4d284f?_0x4041ff[_0x84f3('0x1d')]:_0x1c746e[_0x84f3('0x1a')]+_0x1c746e[_0x84f3('0x1c')];var _0x5e2d7d;if(_0x543cd8>=_0x4bd63f){_0x543cd8=_0x4bd63f;_0x5e2d7d=0xc8;}else{_0x5e2d7d=0xce;}_0x5a0e27[_0x84f3('0x18')](_0x5e2d7d);return _0x5a0e27['set'](_0x84f3('0x1e'),_0x3e20a7+'-'+_0x543cd8+'/'+_0x4bd63f)[_0x84f3('0x1f')](_0x4041ff);}return null;};}function patchUpdates(_0x5436c3){return function(_0x2c8ae0){try{jsonpatch[_0x84f3('0x20')](_0x2c8ae0,_0x5436c3,!![]);}catch(_0x50f706){return BPromise[_0x84f3('0x21')](_0x50f706);}return _0x2c8ae0[_0x84f3('0x22')]();};}function saveUpdates(_0x1274f6,_0x56083a){return function(_0x474d14){if(_0x474d14){return _0x474d14[_0x84f3('0x23')](_0x1274f6)[_0x84f3('0x24')](function(_0x1b9cb2){return _0x1b9cb2;});}return null;};}function removeEntity(_0x5d84c3,_0x2b5cd9){return function(_0x5cc3ed){if(_0x5cc3ed){return _0x5cc3ed['destroy']()[_0x84f3('0x24')](function(){_0x5d84c3[_0x84f3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4470fc,_0xced51){return function(_0x39097c){if(!_0x39097c){_0x4470fc[_0x84f3('0x17')](0x194);}return _0x39097c;};}function handleError(_0x3212cd,_0x52ceed){_0x52ceed=_0x52ceed||0x1f4;return function(_0x3b74d1){logger['error'](_0x3b74d1[_0x84f3('0x25')]);if(_0x3b74d1[_0x84f3('0x26')]){delete _0x3b74d1[_0x84f3('0x26')];}_0x3212cd['status'](_0x52ceed)[_0x84f3('0x27')](_0x3b74d1);};}exports['index']=function(_0x1690e5,_0x15bc5e){var _0x3f86c7={},_0x5ccb2b={},_0x30580b={'count':0x0,'rows':[]};var _0x79a1d1=_[_0x84f3('0x28')](db[_0x84f3('0x29')][_0x84f3('0x2a')],function(_0x24d3e4){return{'name':_0x24d3e4[_0x84f3('0x2b')],'type':_0x24d3e4[_0x84f3('0x2c')][_0x84f3('0x2d')]};});_0x5ccb2b[_0x84f3('0x2e')]=_[_0x84f3('0x28')](_0x79a1d1,_0x84f3('0x26'));_0x5ccb2b[_0x84f3('0x2f')]=_['keys'](_0x1690e5['query']);_0x5ccb2b[_0x84f3('0x30')]=_[_0x84f3('0x31')](_0x5ccb2b[_0x84f3('0x2e')],_0x5ccb2b[_0x84f3('0x2f')]);_0x3f86c7['attributes']=_['intersection'](_0x5ccb2b[_0x84f3('0x2e')],qs[_0x84f3('0x32')](_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x32')]));_0x3f86c7[_0x84f3('0x33')]=_0x3f86c7[_0x84f3('0x33')][_0x84f3('0x34')]?_0x3f86c7[_0x84f3('0x33')]:_0x5ccb2b[_0x84f3('0x2e')];if(!_0x1690e5['query'][_0x84f3('0x35')](_0x84f3('0x36'))){_0x3f86c7[_0x84f3('0x1c')]=qs[_0x84f3('0x1c')](_0x1690e5['query'][_0x84f3('0x1c')]);_0x3f86c7[_0x84f3('0x1a')]=qs[_0x84f3('0x1a')](_0x1690e5[_0x84f3('0x2f')]['offset']);}_0x3f86c7[_0x84f3('0x37')]=qs[_0x84f3('0x38')](_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x38')]);_0x3f86c7[_0x84f3('0x39')]=qs[_0x84f3('0x30')](_[_0x84f3('0x3a')](_0x1690e5[_0x84f3('0x2f')],_0x5ccb2b[_0x84f3('0x30')]),_0x79a1d1);if(_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x3b')]){_0x3f86c7[_0x84f3('0x39')]=_[_0x84f3('0x3c')](_0x3f86c7[_0x84f3('0x39')],{'$or':_[_0x84f3('0x28')](_0x79a1d1,function(_0x4444df){if(_0x4444df[_0x84f3('0x2c')]!==_0x84f3('0x3d')){var _0x1982c6={};_0x1982c6[_0x4444df[_0x84f3('0x26')]]={'$like':'%'+_0x1690e5[_0x84f3('0x2f')]['filter']+'%'};return _0x1982c6;}})});}_0x3f86c7=_[_0x84f3('0x3c')]({},_0x3f86c7,_0x1690e5[_0x84f3('0x3e')]);var _0x271e16={'where':_0x3f86c7['where']};return db['ServicenowAccount'][_0x84f3('0x1d')](_0x271e16)[_0x84f3('0x24')](function(_0x1c86cf){_0x30580b['count']=_0x1c86cf;if(_0x1690e5['query'][_0x84f3('0x3f')]){_0x3f86c7[_0x84f3('0x40')]=[{'all':!![]}];}return db[_0x84f3('0x29')][_0x84f3('0x41')](_0x3f86c7);})[_0x84f3('0x24')](function(_0x2f234a){_0x30580b['rows']=_0x2f234a;return _0x30580b;})[_0x84f3('0x24')](respondWithFilteredResult(_0x15bc5e,_0x3f86c7))['catch'](handleError(_0x15bc5e,null));};exports[_0x84f3('0x42')]=function(_0x2091f0,_0x4b2d2c){var _0x4e3d04={'raw':![],'where':{'id':_0x2091f0[_0x84f3('0x43')]['id']}},_0xc12bc7={};_0xc12bc7[_0x84f3('0x2e')]=_[_0x84f3('0x44')](db[_0x84f3('0x29')]['rawAttributes']);_0xc12bc7['query']=_[_0x84f3('0x44')](_0x2091f0[_0x84f3('0x2f')]);_0xc12bc7['filters']=_[_0x84f3('0x31')](_0xc12bc7['model'],_0xc12bc7[_0x84f3('0x2f')]);_0x4e3d04[_0x84f3('0x33')]=_['intersection'](_0xc12bc7[_0x84f3('0x2e')],qs[_0x84f3('0x32')](_0x2091f0['query'][_0x84f3('0x32')]));_0x4e3d04[_0x84f3('0x33')]=_0x4e3d04[_0x84f3('0x33')][_0x84f3('0x34')]?_0x4e3d04['attributes']:_0xc12bc7[_0x84f3('0x2e')];if(_0x2091f0[_0x84f3('0x2f')][_0x84f3('0x3f')]){_0x4e3d04['include']=[{'all':!![]}];}_0x4e3d04=_[_0x84f3('0x3c')]({},_0x4e3d04,_0x2091f0[_0x84f3('0x3e')]);return db[_0x84f3('0x29')][_0x84f3('0x45')](_0x4e3d04)[_0x84f3('0x24')](handleEntityNotFound(_0x4b2d2c,null))[_0x84f3('0x24')](respondWithResult(_0x4b2d2c,null))[_0x84f3('0x46')](handleError(_0x4b2d2c,null));};exports[_0x84f3('0x47')]=function(_0x1e7de5,_0x10b04c){return db[_0x84f3('0x29')][_0x84f3('0x47')](_0x1e7de5['body'],{})[_0x84f3('0x24')](respondWithResult(_0x10b04c,0xc9))[_0x84f3('0x46')](handleError(_0x10b04c,null));};exports[_0x84f3('0x23')]=function(_0x14547e,_0x5ca27b){if(_0x14547e['body']['id']){delete _0x14547e['body']['id'];}return db[_0x84f3('0x29')]['find']({'where':{'id':_0x14547e[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x5ca27b,null))[_0x84f3('0x24')](saveUpdates(_0x14547e['body'],null))[_0x84f3('0x24')](respondWithResult(_0x5ca27b,null))[_0x84f3('0x46')](handleError(_0x5ca27b,null));};exports[_0x84f3('0x48')]=function(_0xa25419,_0x13d477){return db[_0x84f3('0x29')][_0x84f3('0x45')]({'where':{'id':_0xa25419[_0x84f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x13d477,null))[_0x84f3('0x24')](removeEntity(_0x13d477,null))['catch'](handleError(_0x13d477,null));};exports[_0x84f3('0x49')]=function(_0x305fb3,_0x495f63,_0x1359a){var _0x3b90c1={};var _0x4edf83={};var _0x38c997;var _0x38b294;return db[_0x84f3('0x29')][_0x84f3('0x4a')]({'where':{'id':_0x305fb3[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x495f63,null))[_0x84f3('0x24')](function(_0x436613){if(_0x436613){_0x38c997=_0x436613;_0x4edf83[_0x84f3('0x2e')]=_[_0x84f3('0x44')](db[_0x84f3('0x4b')][_0x84f3('0x2a')]);_0x4edf83[_0x84f3('0x2f')]=_[_0x84f3('0x44')](_0x305fb3[_0x84f3('0x2f')]);_0x4edf83[_0x84f3('0x30')]=_[_0x84f3('0x31')](_0x4edf83[_0x84f3('0x2e')],_0x4edf83[_0x84f3('0x2f')]);_0x3b90c1[_0x84f3('0x33')]=_[_0x84f3('0x31')](_0x4edf83['model'],qs[_0x84f3('0x32')](_0x305fb3['query']['fields']));_0x3b90c1[_0x84f3('0x33')]=_0x3b90c1[_0x84f3('0x33')][_0x84f3('0x34')]?_0x3b90c1[_0x84f3('0x33')]:_0x4edf83[_0x84f3('0x2e')];_0x3b90c1[_0x84f3('0x37')]=qs['sort'](_0x305fb3[_0x84f3('0x2f')]['sort']);_0x3b90c1['where']=qs[_0x84f3('0x30')](_[_0x84f3('0x3a')](_0x305fb3[_0x84f3('0x2f')],_0x4edf83['filters']));if(_0x305fb3[_0x84f3('0x2f')]['filter']){_0x3b90c1[_0x84f3('0x39')]=_[_0x84f3('0x3c')](_0x3b90c1['where'],{'$or':_[_0x84f3('0x28')](_0x3b90c1['attributes'],function(_0x359a29){var _0x5baa96={};_0x5baa96[_0x359a29]={'$like':'%'+_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x3b')]+'%'};return _0x5baa96;})});}_0x3b90c1=_['merge']({},_0x3b90c1,_0x305fb3[_0x84f3('0x3e')]);return _0x38c997[_0x84f3('0x49')](_0x3b90c1);}})['then'](function(_0x34de8f){if(_0x34de8f){_0x38b294=_0x34de8f['length'];if(!_0x305fb3[_0x84f3('0x2f')]['hasOwnProperty'](_0x84f3('0x36'))){_0x3b90c1[_0x84f3('0x1c')]=qs[_0x84f3('0x1c')](_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x1c')]);_0x3b90c1[_0x84f3('0x1a')]=qs[_0x84f3('0x1a')](_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x1a')]);}return _0x38c997[_0x84f3('0x49')](_0x3b90c1);}})[_0x84f3('0x24')](function(_0x67ac46){if(_0x67ac46){return _0x67ac46?{'count':_0x38b294,'rows':_0x67ac46}:null;}})[_0x84f3('0x24')](respondWithResult(_0x495f63,null))['catch'](handleError(_0x495f63,null));};exports[_0x84f3('0x4c')]=function(_0x4caf09,_0x2078a2,_0x115a20){if(_0x4caf09[_0x84f3('0x4d')]['id']){delete _0x4caf09[_0x84f3('0x4d')]['id'];}return db[_0x84f3('0x29')]['findOne']({'where':{'id':_0x4caf09[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x2078a2,null))['then'](function(_0x1557bf){if(_0x1557bf){_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x4e')]=_0x1557bf['id'];_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x4f')]=integrations[_0x84f3('0x50')](_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x51')],_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x2c')]);_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x52')]=integrations[_0x84f3('0x53')](_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x51')],_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x2c')]);return db['ServicenowConfiguration'][_0x84f3('0x47')](_0x4caf09[_0x84f3('0x4d')],{'include':[{'model':db[_0x84f3('0x54')],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x84f3('0x24')](respondWithResult(_0x2078a2,null))[_0x84f3('0x46')](handleError(_0x2078a2,null));};exports['getFields']=function(_0x540092,_0xbb8cd8,_0x3a8e21){var _0x447441=[_0x84f3('0x55'),_0x84f3('0x56'),'knowledge',_0x84f3('0x57'),_0x84f3('0x58'),'notify',_0x84f3('0x59'),_0x84f3('0x5a'),_0x84f3('0x5b')];var _0x388e86=[_0x84f3('0x5c'),'made_sla',_0x84f3('0x5d'),_0x84f3('0x5e'),_0x84f3('0x5f'),_0x84f3('0x60'),_0x84f3('0x61'),_0x84f3('0x56'),_0x84f3('0x62'),_0x84f3('0x63'),_0x84f3('0x64'),'sys_updated_by',_0x84f3('0x65'),_0x84f3('0x66'),_0x84f3('0x67'),_0x84f3('0x68'),_0x84f3('0x69'),'sys_created_by','knowledge',_0x84f3('0x37'),_0x84f3('0x6a'),_0x84f3('0x6b'),_0x84f3('0x6c'),_0x84f3('0x6d'),_0x84f3('0x6e'),_0x84f3('0x6f'),'work_notes_list',_0x84f3('0x70'),_0x84f3('0x71'),_0x84f3('0x72'),_0x84f3('0x73'),_0x84f3('0x74'),_0x84f3('0x75'),_0x84f3('0x76'),_0x84f3('0x77'),_0x84f3('0x78'),_0x84f3('0x79'),_0x84f3('0x7a'),_0x84f3('0x7b'),_0x84f3('0x7c'),_0x84f3('0x7d'),_0x84f3('0x57'),_0x84f3('0x7e'),_0x84f3('0x7f'),_0x84f3('0x58'),_0x84f3('0x80'),_0x84f3('0x81'),_0x84f3('0x82'),_0x84f3('0x83'),_0x84f3('0x84'),_0x84f3('0x85'),_0x84f3('0x86'),_0x84f3('0x87'),'notify','sys_class_name',_0x84f3('0x88'),_0x84f3('0x89'),'follow_up','parent_incident',_0x84f3('0x8a'),_0x84f3('0x8b'),_0x84f3('0x8c'),_0x84f3('0x59'),_0x84f3('0x8d'),_0x84f3('0x8e'),_0x84f3('0x8f'),_0x84f3('0x90'),_0x84f3('0x91'),_0x84f3('0x92'),_0x84f3('0x5a'),_0x84f3('0x93'),_0x84f3('0x94'),_0x84f3('0x95'),_0x84f3('0x96'),'due_date','sys_mod_count',_0x84f3('0x97'),_0x84f3('0x98'),'escalation','upon_approval',_0x84f3('0x99'),'location',_0x84f3('0x5b')];var _0x3ecdf6='';var _0x3bb40a='';var _0x1f2e34=[];var _0x29ce8d='';var _0x534bb1='';var _0x15cb12=[];var _0x4f1503='';var _0x2d3ca4='';var _0xab5c32={};var _0x39a3e5='';return db[_0x84f3('0x29')][_0x84f3('0x4a')]({'where':{'id':_0x540092['params']['id']},'attributes':['id','username',_0x84f3('0x9a'),_0x84f3('0x9b'),_0x84f3('0x9c'),_0x84f3('0x9d')]})[_0x84f3('0x24')](handleEntityNotFound(_0xbb8cd8,null))[_0x84f3('0x24')](function(_0x5f2bd1){if(_0x5f2bd1){_0x39a3e5=_0x5f2bd1[_0x84f3('0x9c')];var _0x252714=_0x39a3e5[_0x84f3('0x9e')](-0x1);if(_0x252714==='/'){_0x39a3e5=_0x39a3e5[_0x84f3('0x9f')](0x0,_0x39a3e5[_0x84f3('0xa0')](_0x252714));}_0x2d3ca4=util[_0x84f3('0xa1')](_0x84f3('0xa2'),_0x39a3e5);_0x4f1503=util[_0x84f3('0xa1')](_0x84f3('0xa3'),_0x39a3e5);_0xab5c32={'user':_0x5f2bd1[_0x84f3('0xa4')],'pass':_0x5f2bd1['password']};var _0x1b58d2={'method':'GET','uri':_0x2d3ca4+_0x84f3('0xa5'),'auth':_0xab5c32,'json':!![]};return rp(_0x1b58d2);}})[_0x84f3('0x24')](function(_0xe7f552){if(_0xe7f552[_0x84f3('0xa6')][_0x84f3('0x34')]>0x0){_0x3ecdf6=_0xe7f552[_0x84f3('0xa6')];}console[_0x84f3('0xa7')](_0x84f3('0xa8'),_0x3ecdf6);_0x15cb12=[];_0x3bb40a=Object[_0x84f3('0xa9')]([],_0x3ecdf6);_[_0x84f3('0xaa')](_0x3bb40a,function(_0x222c94){return!_0x447441[_0x84f3('0xab')](_0x222c94[_0x84f3('0x26')]);});_0x3bb40a['forEach'](function(_0x521ffc){var _0x972474=createFieldObject(_0x4f1503,_0xab5c32,_0x521ffc['internalType'],_0x521ffc[_0x84f3('0x26')],_0x521ffc[_0x84f3('0xac')],![]);_0x15cb12[_0x84f3('0xad')](_0x972474);});return Promise['all'](_0x15cb12);})[_0x84f3('0x24')](function(_0xf1fa03){_0x1f2e34=_0xf1fa03;_0x29ce8d=Object[_0x84f3('0xa9')]([],_0x3ecdf6);console['log']('TCL:\x20_object',_0x3ecdf6);_[_0x84f3('0xaa')](_0x29ce8d,function(_0x37de33){return _0x388e86[_0x84f3('0xab')](_0x37de33[_0x84f3('0x26')]);});console[_0x84f3('0xa7')](_0x84f3('0xae'),_0x29ce8d);_0x15cb12=[];_0x29ce8d[_0x84f3('0xaf')](function(_0xa35071){var _0x29ef6d=createFieldObject(_0x4f1503,_0xab5c32,_0xa35071[_0x84f3('0xb0')],_0xa35071[_0x84f3('0x26')],_0xa35071[_0x84f3('0xac')],!![]);_0x15cb12[_0x84f3('0xad')](_0x29ef6d);});return Promise['all'](_0x15cb12);})['then'](function(_0x2709cf){_0x534bb1=_0x2709cf;var _0x1e191a=_0x1f2e34[_0x84f3('0xb1')](_0x534bb1);return{'count':_0x1e191a[_0x84f3('0x34')],'rows':_0x1e191a};})[_0x84f3('0x24')](respondWithResult(_0xbb8cd8,null))[_0x84f3('0x46')](function(_0x4dab2f){console[_0x84f3('0xa7')](_0x84f3('0xb2')+_0x4dab2f);var _0x5f765a=_0x540092['query']['test']?0x1f4:_0x4dab2f[_0x84f3('0xb3')]||0x1f4;logger[_0x84f3('0xb4')](_0x4dab2f[_0x84f3('0x25')]);delete _0x4dab2f[_0x84f3('0x26')];if(_0x5f765a===0x191){_0x5f765a=0x190;}_0xbb8cd8['status'](_0x5f765a)['send'](_0x540092[_0x84f3('0x2f')][_0x84f3('0xb5')]?{'message':_0x84f3('0xb6'),'statusCode':_0x4dab2f['statusCode']}:_0x4dab2f);});};function createFieldObject(_0x2c689b,_0x1ee3a4,_0x3b6bfc,_0x4124be,_0x888976,_0x1e6194){return new Promise(function(_0xb49a50,_0x5c57b3){var _0x31477b={'id':_0x4124be,'name':_0x888976,'custom':_0x1e6194};if(_0x3b6bfc===_0x84f3('0xb7')){_0x31477b[_0x84f3('0x3e')]=[{'name':'True','value':'true'},{'name':_0x84f3('0xb8'),'value':'false'}];_0xb49a50(_0x31477b);}else{var _0x49de70={'method':_0x84f3('0xb9'),'uri':_0x2c689b+_0x84f3('0xba')+_0x4124be,'auth':_0x1ee3a4,'json':!![]};return rp(_0x49de70)[_0x84f3('0x24')](function(_0x3f13d6){var _0x581099=[];if(_0x3f13d6[_0x84f3('0xa6')]['length']>0x0){_0x3f13d6[_0x84f3('0xa6')][_0x84f3('0xaf')](function(_0x4486b4){if(_0x4486b4[_0x84f3('0xbb')]==='false'){var _0x23e9ac={'name':_0x4486b4['label'],'value':_0x4486b4[_0x84f3('0xbc')]};_0x581099[_0x84f3('0xad')](_0x23e9ac);}});}_0x31477b[_0x84f3('0x3e')]=_0x581099;if(_0x31477b[_0x84f3('0x3e')][_0x84f3('0x34')]>0x0){_0xb49a50(_0x31477b);}else{if(_0x1e6194==![]){_0xb49a50();}else{_0xb49a50(_0x31477b);}}});}});}
\ No newline at end of file
+var _0xcb8e=['findOne','ServicenowConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','made_sla','knowledge','subcategory','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','impact','active','work_notes_list','business_service','priority','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','rows','catch','include','options','create','body','find','params'];(function(_0x47da89,_0x280bbb){var _0x453dfc=function(_0x461ce7){while(--_0x461ce7){_0x47da89['push'](_0x47da89['shift']());}};_0x453dfc(++_0x280bbb);}(_0xcb8e,0x125));var _0xecb8=function(_0x28d13e,_0x176c4d){_0x28d13e=_0x28d13e-0x0;var _0x950800=_0xcb8e[_0x28d13e];return _0x950800;};'use strict';var emlformat=require(_0xecb8('0x0'));var rimraf=require(_0xecb8('0x1'));var zipdir=require(_0xecb8('0x2'));var jsonpatch=require(_0xecb8('0x3'));var rp=require('request-promise');var moment=require(_0xecb8('0x4'));var BPromise=require(_0xecb8('0x5'));var Mustache=require(_0xecb8('0x6'));var util=require(_0xecb8('0x7'));var path=require(_0xecb8('0x8'));var sox=require(_0xecb8('0x9'));var csv=require(_0xecb8('0xa'));var ejs=require(_0xecb8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecb8('0xc'));var squel=require(_0xecb8('0xd'));var crypto=require(_0xecb8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xecb8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecb8('0xf'));var authService=require(_0xecb8('0x10'));var qs=require(_0xecb8('0x11'));var as=require(_0xecb8('0x12'));var hardwareService=require(_0xecb8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xecb8('0x14'));var config=require(_0xecb8('0x15'));var licenseUtil=require(_0xecb8('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3aeda4,_0x4a2d76){_0x4a2d76=_0x4a2d76||0xcc;return function(_0x5599a5){if(_0x5599a5){return _0x3aeda4['sendStatus'](_0x4a2d76);}return _0x3aeda4[_0xecb8('0x17')](_0x4a2d76)[_0xecb8('0x18')]();};}function respondWithResult(_0x58897b,_0x56825c){_0x56825c=_0x56825c||0xc8;return function(_0x330b70){if(_0x330b70){return _0x58897b['status'](_0x56825c)['json'](_0x330b70);}};}function respondWithFilteredResult(_0x3bfd19,_0x28af60){return function(_0xf879ec){if(_0xf879ec){var _0x3f5189=typeof _0x28af60['offset']===_0xecb8('0x19')&&typeof _0x28af60['limit']==='undefined';var _0x3a8b20=_0xf879ec[_0xecb8('0x1a')];var _0x1cc3e4=_0x3f5189?0x0:_0x28af60['offset'];var _0x165aca=_0x3f5189?_0xf879ec[_0xecb8('0x1a')]:_0x28af60[_0xecb8('0x1b')]+_0x28af60[_0xecb8('0x1c')];var _0x131032;if(_0x165aca>=_0x3a8b20){_0x165aca=_0x3a8b20;_0x131032=0xc8;}else{_0x131032=0xce;}_0x3bfd19['status'](_0x131032);return _0x3bfd19[_0xecb8('0x1d')](_0xecb8('0x1e'),_0x1cc3e4+'-'+_0x165aca+'/'+_0x3a8b20)[_0xecb8('0x1f')](_0xf879ec);}return null;};}function patchUpdates(_0x524b70){return function(_0x424a12){try{jsonpatch[_0xecb8('0x20')](_0x424a12,_0x524b70,!![]);}catch(_0x293f25){return BPromise[_0xecb8('0x21')](_0x293f25);}return _0x424a12[_0xecb8('0x22')]();};}function saveUpdates(_0x1db595,_0x5349f4){return function(_0xb74f2f){if(_0xb74f2f){return _0xb74f2f[_0xecb8('0x23')](_0x1db595)['then'](function(_0x28b8b7){return _0x28b8b7;});}return null;};}function removeEntity(_0x1a58d1,_0x3a97c7){return function(_0x40fcd8){if(_0x40fcd8){return _0x40fcd8[_0xecb8('0x24')]()[_0xecb8('0x25')](function(){_0x1a58d1[_0xecb8('0x17')](0xcc)[_0xecb8('0x18')]();});}};}function handleEntityNotFound(_0x449cde,_0x554dcf){return function(_0x570733){if(!_0x570733){_0x449cde[_0xecb8('0x26')](0x194);}return _0x570733;};}function handleError(_0x43704d,_0x1208ab){_0x1208ab=_0x1208ab||0x1f4;return function(_0x2190c9){logger[_0xecb8('0x27')](_0x2190c9[_0xecb8('0x28')]);if(_0x2190c9[_0xecb8('0x29')]){delete _0x2190c9[_0xecb8('0x29')];}_0x43704d['status'](_0x1208ab)[_0xecb8('0x2a')](_0x2190c9);};}exports['index']=function(_0x33db9a,_0x2cb6fe){var _0x4f71a6={},_0x42ab79={},_0xbc350e={'count':0x0,'rows':[]};var _0xe431f8=_['map'](db[_0xecb8('0x2b')][_0xecb8('0x2c')],function(_0x681035){return{'name':_0x681035[_0xecb8('0x2d')],'type':_0x681035[_0xecb8('0x2e')]['key']};});_0x42ab79[_0xecb8('0x2f')]=_[_0xecb8('0x30')](_0xe431f8,_0xecb8('0x29'));_0x42ab79[_0xecb8('0x31')]=_[_0xecb8('0x32')](_0x33db9a[_0xecb8('0x31')]);_0x42ab79[_0xecb8('0x33')]=_[_0xecb8('0x34')](_0x42ab79[_0xecb8('0x2f')],_0x42ab79['query']);_0x4f71a6[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x42ab79['model'],qs['fields'](_0x33db9a['query'][_0xecb8('0x36')]));_0x4f71a6[_0xecb8('0x35')]=_0x4f71a6['attributes'][_0xecb8('0x37')]?_0x4f71a6[_0xecb8('0x35')]:_0x42ab79[_0xecb8('0x2f')];if(!_0x33db9a[_0xecb8('0x31')]['hasOwnProperty'](_0xecb8('0x38'))){_0x4f71a6[_0xecb8('0x1c')]=qs[_0xecb8('0x1c')](_0x33db9a['query']['limit']);_0x4f71a6[_0xecb8('0x1b')]=qs[_0xecb8('0x1b')](_0x33db9a[_0xecb8('0x31')][_0xecb8('0x1b')]);}_0x4f71a6[_0xecb8('0x39')]=qs[_0xecb8('0x3a')](_0x33db9a[_0xecb8('0x31')]['sort']);_0x4f71a6['where']=qs[_0xecb8('0x33')](_[_0xecb8('0x3b')](_0x33db9a[_0xecb8('0x31')],_0x42ab79['filters']),_0xe431f8);if(_0x33db9a['query'][_0xecb8('0x3c')]){_0x4f71a6[_0xecb8('0x3d')]=_[_0xecb8('0x3e')](_0x4f71a6[_0xecb8('0x3d')],{'$or':_[_0xecb8('0x30')](_0xe431f8,function(_0xb34781){if(_0xb34781[_0xecb8('0x2e')]!=='VIRTUAL'){var _0x1dca8d={};_0x1dca8d[_0xb34781['name']]={'$like':'%'+_0x33db9a[_0xecb8('0x31')]['filter']+'%'};return _0x1dca8d;}})});}_0x4f71a6=_[_0xecb8('0x3e')]({},_0x4f71a6,_0x33db9a['options']);var _0x56fea7={'where':_0x4f71a6[_0xecb8('0x3d')]};return db[_0xecb8('0x2b')]['count'](_0x56fea7)[_0xecb8('0x25')](function(_0x51ec1a){_0xbc350e[_0xecb8('0x1a')]=_0x51ec1a;if(_0x33db9a[_0xecb8('0x31')]['includeAll']){_0x4f71a6['include']=[{'all':!![]}];}return db[_0xecb8('0x2b')]['findAll'](_0x4f71a6);})[_0xecb8('0x25')](function(_0x293895){_0xbc350e[_0xecb8('0x3f')]=_0x293895;return _0xbc350e;})['then'](respondWithFilteredResult(_0x2cb6fe,_0x4f71a6))[_0xecb8('0x40')](handleError(_0x2cb6fe,null));};exports['show']=function(_0x43deab,_0x1667c3){var _0x4acfae={'raw':![],'where':{'id':_0x43deab['params']['id']}},_0x44ef3b={};_0x44ef3b[_0xecb8('0x2f')]=_['keys'](db[_0xecb8('0x2b')]['rawAttributes']);_0x44ef3b['query']=_[_0xecb8('0x32')](_0x43deab[_0xecb8('0x31')]);_0x44ef3b[_0xecb8('0x33')]=_['intersection'](_0x44ef3b[_0xecb8('0x2f')],_0x44ef3b[_0xecb8('0x31')]);_0x4acfae[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x44ef3b['model'],qs['fields'](_0x43deab[_0xecb8('0x31')]['fields']));_0x4acfae[_0xecb8('0x35')]=_0x4acfae[_0xecb8('0x35')][_0xecb8('0x37')]?_0x4acfae[_0xecb8('0x35')]:_0x44ef3b[_0xecb8('0x2f')];if(_0x43deab['query']['includeAll']){_0x4acfae[_0xecb8('0x41')]=[{'all':!![]}];}_0x4acfae=_['merge']({},_0x4acfae,_0x43deab[_0xecb8('0x42')]);return db[_0xecb8('0x2b')]['find'](_0x4acfae)[_0xecb8('0x25')](handleEntityNotFound(_0x1667c3,null))[_0xecb8('0x25')](respondWithResult(_0x1667c3,null))['catch'](handleError(_0x1667c3,null));};exports[_0xecb8('0x43')]=function(_0x23a77c,_0xa40dbb){return db['ServicenowAccount'][_0xecb8('0x43')](_0x23a77c[_0xecb8('0x44')],{})['then'](respondWithResult(_0xa40dbb,0xc9))[_0xecb8('0x40')](handleError(_0xa40dbb,null));};exports['update']=function(_0x59f90b,_0x5be5b6){if(_0x59f90b[_0xecb8('0x44')]['id']){delete _0x59f90b[_0xecb8('0x44')]['id'];}return db['ServicenowAccount'][_0xecb8('0x45')]({'where':{'id':_0x59f90b['params']['id']}})['then'](handleEntityNotFound(_0x5be5b6,null))[_0xecb8('0x25')](saveUpdates(_0x59f90b[_0xecb8('0x44')],null))[_0xecb8('0x25')](respondWithResult(_0x5be5b6,null))[_0xecb8('0x40')](handleError(_0x5be5b6,null));};exports['destroy']=function(_0x587498,_0x54bd7e){return db[_0xecb8('0x2b')][_0xecb8('0x45')]({'where':{'id':_0x587498[_0xecb8('0x46')]['id']}})[_0xecb8('0x25')](handleEntityNotFound(_0x54bd7e,null))[_0xecb8('0x25')](removeEntity(_0x54bd7e,null))[_0xecb8('0x40')](handleError(_0x54bd7e,null));};exports['getConfigurations']=function(_0x6f8278,_0x3063a0,_0x2c36b3){var _0x62a7df={};var _0x88b6fb={};var _0x266450;var _0x441c71;return db[_0xecb8('0x2b')][_0xecb8('0x47')]({'where':{'id':_0x6f8278[_0xecb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3063a0,null))['then'](function(_0x4dc92a){if(_0x4dc92a){_0x266450=_0x4dc92a;_0x88b6fb[_0xecb8('0x2f')]=_['keys'](db[_0xecb8('0x48')][_0xecb8('0x2c')]);_0x88b6fb[_0xecb8('0x31')]=_['keys'](_0x6f8278[_0xecb8('0x31')]);_0x88b6fb[_0xecb8('0x33')]=_[_0xecb8('0x34')](_0x88b6fb[_0xecb8('0x2f')],_0x88b6fb['query']);_0x62a7df[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x88b6fb[_0xecb8('0x2f')],qs[_0xecb8('0x36')](_0x6f8278[_0xecb8('0x31')]['fields']));_0x62a7df['attributes']=_0x62a7df[_0xecb8('0x35')][_0xecb8('0x37')]?_0x62a7df[_0xecb8('0x35')]:_0x88b6fb['model'];_0x62a7df['order']=qs[_0xecb8('0x3a')](_0x6f8278[_0xecb8('0x31')][_0xecb8('0x3a')]);_0x62a7df[_0xecb8('0x3d')]=qs[_0xecb8('0x33')](_[_0xecb8('0x3b')](_0x6f8278[_0xecb8('0x31')],_0x88b6fb[_0xecb8('0x33')]));if(_0x6f8278[_0xecb8('0x31')]['filter']){_0x62a7df[_0xecb8('0x3d')]=_[_0xecb8('0x3e')](_0x62a7df['where'],{'$or':_[_0xecb8('0x30')](_0x62a7df[_0xecb8('0x35')],function(_0x358439){var _0x2b9012={};_0x2b9012[_0x358439]={'$like':'%'+_0x6f8278[_0xecb8('0x31')][_0xecb8('0x3c')]+'%'};return _0x2b9012;})});}_0x62a7df=_[_0xecb8('0x3e')]({},_0x62a7df,_0x6f8278[_0xecb8('0x42')]);return _0x266450[_0xecb8('0x49')](_0x62a7df);}})[_0xecb8('0x25')](function(_0x22a50b){if(_0x22a50b){_0x441c71=_0x22a50b[_0xecb8('0x37')];if(!_0x6f8278['query'][_0xecb8('0x4a')](_0xecb8('0x38'))){_0x62a7df[_0xecb8('0x1c')]=qs['limit'](_0x6f8278[_0xecb8('0x31')]['limit']);_0x62a7df[_0xecb8('0x1b')]=qs[_0xecb8('0x1b')](_0x6f8278[_0xecb8('0x31')][_0xecb8('0x1b')]);}return _0x266450['getConfigurations'](_0x62a7df);}})[_0xecb8('0x25')](function(_0x5189d5){if(_0x5189d5){return _0x5189d5?{'count':_0x441c71,'rows':_0x5189d5}:null;}})[_0xecb8('0x25')](respondWithResult(_0x3063a0,null))['catch'](handleError(_0x3063a0,null));};exports[_0xecb8('0x4b')]=function(_0x3ba763,_0xdd1402,_0x57d152){if(_0x3ba763[_0xecb8('0x44')]['id']){delete _0x3ba763['body']['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3ba763[_0xecb8('0x46')]['id']}})[_0xecb8('0x25')](handleEntityNotFound(_0xdd1402,null))[_0xecb8('0x25')](function(_0x3df72e){if(_0x3df72e){_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4c')]=_0x3df72e['id'];_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4d')]=integrations[_0xecb8('0x4e')](_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4f')],_0x3ba763[_0xecb8('0x44')]['type']);_0x3ba763[_0xecb8('0x44')]['Descriptions']=integrations['getDescriptions'](_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4f')],_0x3ba763[_0xecb8('0x44')][_0xecb8('0x2e')]);return db['ServicenowConfiguration']['create'](_0x3ba763[_0xecb8('0x44')],{'include':[{'model':db[_0xecb8('0x50')],'as':_0xecb8('0x4d')},{'model':db[_0xecb8('0x50')],'as':'Descriptions'}]});}return null;})[_0xecb8('0x25')](respondWithResult(_0xdd1402,null))[_0xecb8('0x40')](handleError(_0xdd1402,null));};exports['getFields']=function(_0x40b4cd,_0x48be6e,_0x3e2648){var _0x5969a3=[_0xecb8('0x51'),'hold_reason',_0xecb8('0x52'),_0xecb8('0x53'),'close_code',_0xecb8('0x54'),_0xecb8('0x55'),_0xecb8('0x56'),'category'];var _0x4854d5=[_0xecb8('0x57'),'made_sla',_0xecb8('0x58'),_0xecb8('0x59'),_0xecb8('0x5a'),_0xecb8('0x5b'),_0xecb8('0x5c'),'hold_reason',_0xecb8('0x5d'),_0xecb8('0x5e'),'resolved_by',_0xecb8('0x5f'),_0xecb8('0x60'),_0xecb8('0x61'),'sys_created_on',_0xecb8('0x62'),_0xecb8('0x63'),_0xecb8('0x64'),_0xecb8('0x52'),_0xecb8('0x39'),_0xecb8('0x65'),_0xecb8('0x66'),'cmdb_ci','delivery_plan',_0xecb8('0x67'),_0xecb8('0x68'),_0xecb8('0x69'),_0xecb8('0x6a'),_0xecb8('0x6b'),'sys_domain_path','rfc','time_worked',_0xecb8('0x6c'),_0xecb8('0x6d'),'business_duration',_0xecb8('0x6e'),_0xecb8('0x6f'),_0xecb8('0x70'),_0xecb8('0x71'),_0xecb8('0x72'),'approval_set',_0xecb8('0x53'),_0xecb8('0x73'),_0xecb8('0x74'),_0xecb8('0x75'),_0xecb8('0x76'),_0xecb8('0x77'),_0xecb8('0x78'),_0xecb8('0x79'),_0xecb8('0x7a'),_0xecb8('0x7b'),'description',_0xecb8('0x7c'),_0xecb8('0x54'),_0xecb8('0x7d'),_0xecb8('0x7e'),_0xecb8('0x7f'),'follow_up','parent_incident',_0xecb8('0x80'),_0xecb8('0x81'),_0xecb8('0x82'),_0xecb8('0x55'),_0xecb8('0x83'),_0xecb8('0x84'),_0xecb8('0x85'),_0xecb8('0x86'),'activity_due',_0xecb8('0x87'),'severity',_0xecb8('0x88'),'sla_due',_0xecb8('0x89'),_0xecb8('0x8a'),_0xecb8('0x8b'),_0xecb8('0x8c'),_0xecb8('0x8d'),_0xecb8('0x8e'),'escalation',_0xecb8('0x8f'),_0xecb8('0x90'),_0xecb8('0x91'),'category'];var _0xeceeb4='';var _0x4e5a2a='';var _0x40ae9d=[];var _0x283f96='';var _0x423e3f='';var _0x45de77=[];var _0x2f0fb0='';var _0x43f8da='';var _0x17121f={};var _0x5a8677='';return db['ServicenowAccount'][_0xecb8('0x47')]({'where':{'id':_0x40b4cd[_0xecb8('0x46')]['id']},'attributes':['id',_0xecb8('0x92'),_0xecb8('0x93'),_0xecb8('0x94'),_0xecb8('0x95'),_0xecb8('0x96')]})[_0xecb8('0x25')](handleEntityNotFound(_0x48be6e,null))[_0xecb8('0x25')](function(_0x51db2d){if(_0x51db2d){_0x5a8677=_0x51db2d['remoteUri'];var _0x35176c=_0x5a8677[_0xecb8('0x97')](-0x1);if(_0x35176c==='/'){_0x5a8677=_0x5a8677[_0xecb8('0x98')](0x0,_0x5a8677[_0xecb8('0x99')](_0x35176c));}_0x43f8da=util[_0xecb8('0x9a')](_0xecb8('0x9b'),_0x5a8677);_0x2f0fb0=util[_0xecb8('0x9a')](_0xecb8('0x9c'),_0x5a8677);_0x17121f={'user':_0x51db2d[_0xecb8('0x92')],'pass':_0x51db2d[_0xecb8('0x93')]};var _0x3579b0={'method':_0xecb8('0x9d'),'uri':_0x43f8da+_0xecb8('0x9e'),'auth':_0x17121f,'json':!![]};return rp(_0x3579b0);}})[_0xecb8('0x25')](function(_0x46addb){if(_0x46addb[_0xecb8('0x9f')][_0xecb8('0x37')]>0x0){_0xeceeb4=_0x46addb['result'];}console[_0xecb8('0xa0')](_0xecb8('0xa1'),_0xeceeb4);_0x45de77=[];_0x4e5a2a=Object[_0xecb8('0xa2')]([],_0xeceeb4);_[_0xecb8('0xa3')](_0x4e5a2a,function(_0x196294){return!_0x5969a3['includes'](_0x196294[_0xecb8('0x29')]);});_0x4e5a2a[_0xecb8('0xa4')](function(_0x2bb132){var _0x382c37=createFieldObject(_0x2f0fb0,_0x17121f,_0x2bb132[_0xecb8('0xa5')],_0x2bb132[_0xecb8('0x29')],_0x2bb132[_0xecb8('0xa6')],![]);_0x45de77[_0xecb8('0xa7')](_0x382c37);});return Promise[_0xecb8('0xa8')](_0x45de77);})[_0xecb8('0x25')](function(_0x4767dc){_0x40ae9d=_0x4767dc;_0x283f96=Object[_0xecb8('0xa2')]([],_0xeceeb4);console[_0xecb8('0xa0')](_0xecb8('0xa9'),_0xeceeb4);_['remove'](_0x283f96,function(_0x3ffc59){return _0x4854d5[_0xecb8('0xaa')](_0x3ffc59['name']);});console[_0xecb8('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x283f96);_0x45de77=[];_0x283f96[_0xecb8('0xa4')](function(_0x400047){var _0xc25104=createFieldObject(_0x2f0fb0,_0x17121f,_0x400047[_0xecb8('0xa5')],_0x400047[_0xecb8('0x29')],_0x400047[_0xecb8('0xa6')],!![]);_0x45de77[_0xecb8('0xa7')](_0xc25104);});return Promise[_0xecb8('0xa8')](_0x45de77);})[_0xecb8('0x25')](function(_0x364645){_0x423e3f=_0x364645;var _0x450a0a=_0x40ae9d['concat'](_0x423e3f);return{'count':_0x450a0a['length'],'rows':_0x450a0a};})[_0xecb8('0x25')](respondWithResult(_0x48be6e,null))['catch'](function(_0x3ddac0){console[_0xecb8('0xa0')](_0xecb8('0xab')+_0x3ddac0);var _0x5123ef=_0x40b4cd['query'][_0xecb8('0xac')]?0x1f4:_0x3ddac0['statusCode']||0x1f4;logger[_0xecb8('0x27')](_0x3ddac0[_0xecb8('0x28')]);delete _0x3ddac0[_0xecb8('0x29')];if(_0x5123ef===0x191){_0x5123ef=0x190;}_0x48be6e[_0xecb8('0x17')](_0x5123ef)[_0xecb8('0x2a')](_0x40b4cd[_0xecb8('0x31')][_0xecb8('0xac')]?{'message':_0xecb8('0xad'),'statusCode':_0x3ddac0['statusCode']}:_0x3ddac0);});};function createFieldObject(_0x10fe81,_0x22eb8e,_0x3d46d0,_0x3af48a,_0x509378,_0x1b8b77){return new Promise(function(_0x3034df,_0x573dac){var _0xab88c0={'id':_0x3af48a,'name':_0x509378,'custom':_0x1b8b77};if(_0x3d46d0===_0xecb8('0xae')){_0xab88c0[_0xecb8('0x42')]=[{'name':_0xecb8('0xaf'),'value':_0xecb8('0xb0')},{'name':_0xecb8('0xb1'),'value':_0xecb8('0xb2')}];_0x3034df(_0xab88c0);}else{var _0x3b9de7={'method':_0xecb8('0x9d'),'uri':_0x10fe81+_0xecb8('0xb3')+_0x3af48a,'auth':_0x22eb8e,'json':!![]};return rp(_0x3b9de7)[_0xecb8('0x25')](function(_0x42e50b){var _0x4879b9=[];if(_0x42e50b[_0xecb8('0x9f')]['length']>0x0){_0x42e50b['result'][_0xecb8('0xa4')](function(_0x371cba){if(_0x371cba[_0xecb8('0xb4')]===_0xecb8('0xb2')){var _0x4a5012={'name':_0x371cba[_0xecb8('0xa6')],'value':_0x371cba[_0xecb8('0xb5')]};_0x4879b9[_0xecb8('0xa7')](_0x4a5012);}});}_0xab88c0['options']=_0x4879b9;if(_0xab88c0['options'][_0xecb8('0x37')]>0x0){_0x3034df(_0xab88c0);}else{if(_0x1b8b77==![]){_0x3034df();}else{_0x3034df(_0xab88c0);}}});}});}
\ No newline at end of file