Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 916fb21..16bba09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4cb=['../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','limit','count','offset','set','json','apply','reject','save','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','params','intersection','create','update','body','find','destroy','getConfigurations','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','approval_set','work_notes','short_description','delivery_task','assignment_group','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','problem_id','reassignment_count','activity_due','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','password','email','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','username','GET','result','assign','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','true','False','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis'];(function(_0x36d09a,_0x4cd6c3){var _0x1a4b8a=function(_0x2f3a04){while(--_0x2f3a04){_0x36d09a['push'](_0x36d09a['shift']());}};_0x1a4b8a(++_0x4cd6c3);}(_0xa4cb,0x154));var _0xba4c=function(_0x52efc7,_0x5ae099){_0x52efc7=_0x52efc7-0x0;var _0x23c956=_0xa4cb[_0x52efc7];return _0x23c956;};'use strict';var emlformat=require(_0xba4c('0x0'));var rimraf=require(_0xba4c('0x1'));var zipdir=require(_0xba4c('0x2'));var jsonpatch=require(_0xba4c('0x3'));var rp=require(_0xba4c('0x4'));var moment=require(_0xba4c('0x5'));var BPromise=require(_0xba4c('0x6'));var Mustache=require(_0xba4c('0x7'));var util=require(_0xba4c('0x8'));var path=require(_0xba4c('0x9'));var sox=require(_0xba4c('0xa'));var csv=require(_0xba4c('0xb'));var ejs=require(_0xba4c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba4c('0xd'));var squel=require(_0xba4c('0xe'));var crypto=require('crypto');var jsforce=require(_0xba4c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xba4c('0xb'));var querystring=require('querystring');var Papa=require(_0xba4c('0x10'));var Redis=require(_0xba4c('0x11'));var authService=require(_0xba4c('0x12'));var qs=require(_0xba4c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba4c('0x14'));var utils=require(_0xba4c('0x15'));var config=require(_0xba4c('0x16'));var licenseUtil=require(_0xba4c('0x17'));var db=require(_0xba4c('0x18'))['db'];var integrations=require(_0xba4c('0x19'));function respondWithStatusCode(_0x3db2b1,_0xe6b68b){_0xe6b68b=_0xe6b68b||0xcc;return function(_0x447c14){if(_0x447c14){return _0x3db2b1[_0xba4c('0x1a')](_0xe6b68b);}return _0x3db2b1['status'](_0xe6b68b)[_0xba4c('0x1b')]();};}function respondWithResult(_0x324483,_0x1a05fd){_0x1a05fd=_0x1a05fd||0xc8;return function(_0x324619){if(_0x324619){return _0x324483[_0xba4c('0x1c')](_0x1a05fd)['json'](_0x324619);}};}function respondWithFilteredResult(_0x37a8ee,_0x1c6b45){return function(_0x4b94b2){if(_0x4b94b2){var _0x1b8e20=typeof _0x1c6b45['offset']==='undefined'&&typeof _0x1c6b45[_0xba4c('0x1d')]==='undefined';var _0x142150=_0x4b94b2[_0xba4c('0x1e')];var _0xcdda0f=_0x1b8e20?0x0:_0x1c6b45[_0xba4c('0x1f')];var _0x26c6bd=_0x1b8e20?_0x4b94b2['count']:_0x1c6b45[_0xba4c('0x1f')]+_0x1c6b45[_0xba4c('0x1d')];var _0x32a212;if(_0x26c6bd>=_0x142150){_0x26c6bd=_0x142150;_0x32a212=0xc8;}else{_0x32a212=0xce;}_0x37a8ee[_0xba4c('0x1c')](_0x32a212);return _0x37a8ee[_0xba4c('0x20')]('Content-Range',_0xcdda0f+'-'+_0x26c6bd+'/'+_0x142150)[_0xba4c('0x21')](_0x4b94b2);}return null;};}function patchUpdates(_0x321c60){return function(_0x141b66){try{jsonpatch[_0xba4c('0x22')](_0x141b66,_0x321c60,!![]);}catch(_0x25b7a1){return BPromise[_0xba4c('0x23')](_0x25b7a1);}return _0x141b66[_0xba4c('0x24')]();};}function saveUpdates(_0x488594,_0x389836){return function(_0x3fd023){if(_0x3fd023){return _0x3fd023['update'](_0x488594)['then'](function(_0xd35aa8){return _0xd35aa8;});}return null;};}function removeEntity(_0x14b9e8,_0x820157){return function(_0x750a55){if(_0x750a55){return _0x750a55['destroy']()['then'](function(){_0x14b9e8[_0xba4c('0x1c')](0xcc)[_0xba4c('0x1b')]();});}};}function handleEntityNotFound(_0x401e71,_0x26fc44){return function(_0x3e680d){if(!_0x3e680d){_0x401e71[_0xba4c('0x1a')](0x194);}return _0x3e680d;};}function handleError(_0x1f825e,_0x13df78){_0x13df78=_0x13df78||0x1f4;return function(_0x46cb35){logger[_0xba4c('0x25')](_0x46cb35[_0xba4c('0x26')]);if(_0x46cb35[_0xba4c('0x27')]){delete _0x46cb35[_0xba4c('0x27')];}_0x1f825e[_0xba4c('0x1c')](_0x13df78)[_0xba4c('0x28')](_0x46cb35);};}exports['index']=function(_0x5415d5,_0x58a858){var _0x32d85d={},_0x3e8cc5={},_0x170f37={'count':0x0,'rows':[]};var _0xec246e=_[_0xba4c('0x29')](db[_0xba4c('0x2a')][_0xba4c('0x2b')],function(_0x2ddd16){return{'name':_0x2ddd16[_0xba4c('0x2c')],'type':_0x2ddd16['type'][_0xba4c('0x2d')]};});_0x3e8cc5[_0xba4c('0x2e')]=_[_0xba4c('0x29')](_0xec246e,'name');_0x3e8cc5[_0xba4c('0x2f')]=_[_0xba4c('0x30')](_0x5415d5['query']);_0x3e8cc5[_0xba4c('0x31')]=_['intersection'](_0x3e8cc5[_0xba4c('0x2e')],_0x3e8cc5[_0xba4c('0x2f')]);_0x32d85d[_0xba4c('0x32')]=_['intersection'](_0x3e8cc5[_0xba4c('0x2e')],qs[_0xba4c('0x33')](_0x5415d5[_0xba4c('0x2f')][_0xba4c('0x33')]));_0x32d85d['attributes']=_0x32d85d[_0xba4c('0x32')][_0xba4c('0x34')]?_0x32d85d[_0xba4c('0x32')]:_0x3e8cc5['model'];if(!_0x5415d5['query'][_0xba4c('0x35')](_0xba4c('0x36'))){_0x32d85d[_0xba4c('0x1d')]=qs[_0xba4c('0x1d')](_0x5415d5[_0xba4c('0x2f')][_0xba4c('0x1d')]);_0x32d85d['offset']=qs[_0xba4c('0x1f')](_0x5415d5[_0xba4c('0x2f')][_0xba4c('0x1f')]);}_0x32d85d[_0xba4c('0x37')]=qs['sort'](_0x5415d5[_0xba4c('0x2f')][_0xba4c('0x38')]);_0x32d85d[_0xba4c('0x39')]=qs[_0xba4c('0x31')](_[_0xba4c('0x3a')](_0x5415d5[_0xba4c('0x2f')],_0x3e8cc5[_0xba4c('0x31')]),_0xec246e);if(_0x5415d5[_0xba4c('0x2f')]['filter']){_0x32d85d['where']=_[_0xba4c('0x3b')](_0x32d85d[_0xba4c('0x39')],{'$or':_['map'](_0xec246e,function(_0x29e86c){if(_0x29e86c[_0xba4c('0x3c')]!==_0xba4c('0x3d')){var _0x26335a={};_0x26335a[_0x29e86c[_0xba4c('0x27')]]={'$like':'%'+_0x5415d5['query'][_0xba4c('0x3e')]+'%'};return _0x26335a;}})});}_0x32d85d=_[_0xba4c('0x3b')]({},_0x32d85d,_0x5415d5[_0xba4c('0x3f')]);var _0x4ee0d6={'where':_0x32d85d[_0xba4c('0x39')]};return db['ServicenowAccount'][_0xba4c('0x1e')](_0x4ee0d6)['then'](function(_0x357c6d){_0x170f37['count']=_0x357c6d;if(_0x5415d5['query'][_0xba4c('0x40')]){_0x32d85d[_0xba4c('0x41')]=[{'all':!![]}];}return db[_0xba4c('0x2a')][_0xba4c('0x42')](_0x32d85d);})[_0xba4c('0x43')](function(_0x4f89a3){_0x170f37[_0xba4c('0x44')]=_0x4f89a3;return _0x170f37;})[_0xba4c('0x43')](respondWithFilteredResult(_0x58a858,_0x32d85d))[_0xba4c('0x45')](handleError(_0x58a858,null));};exports['show']=function(_0x48fdae,_0x3b40fb){var _0x2e3bb3={'raw':![],'where':{'id':_0x48fdae[_0xba4c('0x46')]['id']}},_0x2ac1f1={};_0x2ac1f1[_0xba4c('0x2e')]=_['keys'](db[_0xba4c('0x2a')][_0xba4c('0x2b')]);_0x2ac1f1[_0xba4c('0x2f')]=_[_0xba4c('0x30')](_0x48fdae[_0xba4c('0x2f')]);_0x2ac1f1[_0xba4c('0x31')]=_[_0xba4c('0x47')](_0x2ac1f1[_0xba4c('0x2e')],_0x2ac1f1[_0xba4c('0x2f')]);_0x2e3bb3[_0xba4c('0x32')]=_[_0xba4c('0x47')](_0x2ac1f1['model'],qs[_0xba4c('0x33')](_0x48fdae['query']['fields']));_0x2e3bb3[_0xba4c('0x32')]=_0x2e3bb3[_0xba4c('0x32')][_0xba4c('0x34')]?_0x2e3bb3[_0xba4c('0x32')]:_0x2ac1f1[_0xba4c('0x2e')];if(_0x48fdae['query'][_0xba4c('0x40')]){_0x2e3bb3[_0xba4c('0x41')]=[{'all':!![]}];}_0x2e3bb3=_['merge']({},_0x2e3bb3,_0x48fdae[_0xba4c('0x3f')]);return db[_0xba4c('0x2a')]['find'](_0x2e3bb3)[_0xba4c('0x43')](handleEntityNotFound(_0x3b40fb,null))[_0xba4c('0x43')](respondWithResult(_0x3b40fb,null))[_0xba4c('0x45')](handleError(_0x3b40fb,null));};exports[_0xba4c('0x48')]=function(_0x32fc37,_0x4c663d){return db[_0xba4c('0x2a')][_0xba4c('0x48')](_0x32fc37['body'],{})['then'](respondWithResult(_0x4c663d,0xc9))[_0xba4c('0x45')](handleError(_0x4c663d,null));};exports[_0xba4c('0x49')]=function(_0x4bcbac,_0x22ef00){if(_0x4bcbac[_0xba4c('0x4a')]['id']){delete _0x4bcbac['body']['id'];}return db[_0xba4c('0x2a')][_0xba4c('0x4b')]({'where':{'id':_0x4bcbac['params']['id']}})[_0xba4c('0x43')](handleEntityNotFound(_0x22ef00,null))[_0xba4c('0x43')](saveUpdates(_0x4bcbac[_0xba4c('0x4a')],null))[_0xba4c('0x43')](respondWithResult(_0x22ef00,null))[_0xba4c('0x45')](handleError(_0x22ef00,null));};exports[_0xba4c('0x4c')]=function(_0x22a864,_0x4ecb5d){return db[_0xba4c('0x2a')][_0xba4c('0x4b')]({'where':{'id':_0x22a864[_0xba4c('0x46')]['id']}})[_0xba4c('0x43')](handleEntityNotFound(_0x4ecb5d,null))[_0xba4c('0x43')](removeEntity(_0x4ecb5d,null))[_0xba4c('0x45')](handleError(_0x4ecb5d,null));};exports[_0xba4c('0x4d')]=function(_0x18c027,_0x241acf,_0x2148b4){var _0x5b7ff5={};var _0x22a767={};var _0x139650;var _0xb609fa;return db[_0xba4c('0x2a')]['findOne']({'where':{'id':_0x18c027['params']['id']}})[_0xba4c('0x43')](handleEntityNotFound(_0x241acf,null))['then'](function(_0x1d7b55){if(_0x1d7b55){_0x139650=_0x1d7b55;_0x22a767['model']=_[_0xba4c('0x30')](db[_0xba4c('0x4e')][_0xba4c('0x2b')]);_0x22a767['query']=_[_0xba4c('0x30')](_0x18c027['query']);_0x22a767[_0xba4c('0x31')]=_[_0xba4c('0x47')](_0x22a767['model'],_0x22a767[_0xba4c('0x2f')]);_0x5b7ff5['attributes']=_[_0xba4c('0x47')](_0x22a767[_0xba4c('0x2e')],qs['fields'](_0x18c027[_0xba4c('0x2f')][_0xba4c('0x33')]));_0x5b7ff5[_0xba4c('0x32')]=_0x5b7ff5['attributes'][_0xba4c('0x34')]?_0x5b7ff5[_0xba4c('0x32')]:_0x22a767['model'];_0x5b7ff5[_0xba4c('0x37')]=qs[_0xba4c('0x38')](_0x18c027['query'][_0xba4c('0x38')]);_0x5b7ff5[_0xba4c('0x39')]=qs[_0xba4c('0x31')](_[_0xba4c('0x3a')](_0x18c027[_0xba4c('0x2f')],_0x22a767[_0xba4c('0x31')]));if(_0x18c027[_0xba4c('0x2f')][_0xba4c('0x3e')]){_0x5b7ff5[_0xba4c('0x39')]=_['merge'](_0x5b7ff5[_0xba4c('0x39')],{'$or':_[_0xba4c('0x29')](_0x5b7ff5[_0xba4c('0x32')],function(_0x2bb06c){var _0xed2126={};_0xed2126[_0x2bb06c]={'$like':'%'+_0x18c027[_0xba4c('0x2f')]['filter']+'%'};return _0xed2126;})});}_0x5b7ff5=_[_0xba4c('0x3b')]({},_0x5b7ff5,_0x18c027[_0xba4c('0x3f')]);return _0x139650[_0xba4c('0x4d')](_0x5b7ff5);}})[_0xba4c('0x43')](function(_0x415f97){if(_0x415f97){_0xb609fa=_0x415f97[_0xba4c('0x34')];if(!_0x18c027[_0xba4c('0x2f')][_0xba4c('0x35')](_0xba4c('0x36'))){_0x5b7ff5['limit']=qs[_0xba4c('0x1d')](_0x18c027[_0xba4c('0x2f')]['limit']);_0x5b7ff5['offset']=qs[_0xba4c('0x1f')](_0x18c027[_0xba4c('0x2f')][_0xba4c('0x1f')]);}return _0x139650['getConfigurations'](_0x5b7ff5);}})[_0xba4c('0x43')](function(_0x1783c0){if(_0x1783c0){return _0x1783c0?{'count':_0xb609fa,'rows':_0x1783c0}:null;}})[_0xba4c('0x43')](respondWithResult(_0x241acf,null))[_0xba4c('0x45')](handleError(_0x241acf,null));};exports[_0xba4c('0x4f')]=function(_0x4bc76f,_0xe8af8e,_0x2ed3bf){if(_0x4bc76f['body']['id']){delete _0x4bc76f['body']['id'];}return db[_0xba4c('0x2a')]['findOne']({'where':{'id':_0x4bc76f[_0xba4c('0x46')]['id']}})[_0xba4c('0x43')](handleEntityNotFound(_0xe8af8e,null))[_0xba4c('0x43')](function(_0xb0d56a){if(_0xb0d56a){_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x50')]=_0xb0d56a['id'];_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x51')]=integrations[_0xba4c('0x52')](_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x53')],_0x4bc76f[_0xba4c('0x4a')]['type']);_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x54')]=integrations[_0xba4c('0x55')](_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x53')],_0x4bc76f[_0xba4c('0x4a')][_0xba4c('0x3c')]);return db[_0xba4c('0x4e')]['create'](_0x4bc76f['body'],{'include':[{'model':db[_0xba4c('0x56')],'as':_0xba4c('0x51')},{'model':db[_0xba4c('0x56')],'as':'Descriptions'}]});}return null;})[_0xba4c('0x43')](respondWithResult(_0xe8af8e,null))[_0xba4c('0x45')](handleError(_0xe8af8e,null));};exports[_0xba4c('0x57')]=function(_0x396b55,_0x3bfd76,_0x831bc7){var _0x54441b=[_0xba4c('0x58'),_0xba4c('0x59'),_0xba4c('0x5a'),_0xba4c('0x5b'),_0xba4c('0x5c'),'notify',_0xba4c('0x5d'),_0xba4c('0x5e'),_0xba4c('0x5f')];var _0x173ad6=[_0xba4c('0x60'),_0xba4c('0x58'),_0xba4c('0x61'),_0xba4c('0x62'),'upon_reject','sys_updated_on',_0xba4c('0x63'),_0xba4c('0x59'),_0xba4c('0x64'),_0xba4c('0x65'),_0xba4c('0x66'),_0xba4c('0x67'),_0xba4c('0x68'),_0xba4c('0x69'),'sys_created_on',_0xba4c('0x6a'),_0xba4c('0x6b'),'sys_created_by',_0xba4c('0x5a'),_0xba4c('0x37'),_0xba4c('0x6c'),_0xba4c('0x6d'),_0xba4c('0x6e'),_0xba4c('0x6f'),_0xba4c('0x70'),_0xba4c('0x71'),_0xba4c('0x72'),_0xba4c('0x73'),'priority',_0xba4c('0x74'),_0xba4c('0x75'),_0xba4c('0x76'),_0xba4c('0x77'),_0xba4c('0x78'),_0xba4c('0x79'),'group_list',_0xba4c('0x7a'),'reopened_time','resolved_at','caller_id',_0xba4c('0x7b'),_0xba4c('0x5b'),_0xba4c('0x7c'),_0xba4c('0x7d'),_0xba4c('0x5c'),'correlation_display',_0xba4c('0x7e'),'work_start',_0xba4c('0x7f'),'business_stc',_0xba4c('0x80'),_0xba4c('0x81'),_0xba4c('0x82'),_0xba4c('0x83'),_0xba4c('0x84'),_0xba4c('0x85'),'closed_by',_0xba4c('0x86'),_0xba4c('0x87'),_0xba4c('0x88'),_0xba4c('0x89'),'reopened_by',_0xba4c('0x5d'),'urgency',_0xba4c('0x8a'),'company',_0xba4c('0x8b'),_0xba4c('0x8c'),'assigned_to','severity',_0xba4c('0x8d'),'sla_due',_0xba4c('0x8e'),'comments_and_work_notes',_0xba4c('0x8f'),_0xba4c('0x90'),_0xba4c('0x91'),_0xba4c('0x92'),_0xba4c('0x93'),'upon_approval',_0xba4c('0x94'),'location',_0xba4c('0x5f')];var _0x3319fa='';var _0x27a808='';var _0x374fd5=[];var _0x3c5523='';var _0xe566c9='';var _0x1f6e21=[];var _0x1c397e='';var _0x1f9b81='';var _0x45d8b4={};var _0x34bd28='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x396b55[_0xba4c('0x46')]['id']},'attributes':['id','username',_0xba4c('0x95'),_0xba4c('0x96'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x3bfd76,null))['then'](function(_0x4e75d9){if(_0x4e75d9){_0x34bd28=_0x4e75d9[_0xba4c('0x97')];var _0x39fb16=_0x34bd28[_0xba4c('0x98')](-0x1);if(_0x39fb16==='/'){_0x34bd28=_0x34bd28[_0xba4c('0x99')](0x0,_0x34bd28[_0xba4c('0x9a')](_0x39fb16));}_0x1f9b81=util['format'](_0xba4c('0x9b'),_0x34bd28);_0x1c397e=util[_0xba4c('0x9c')]('%s/api/now/table/',_0x34bd28);_0x45d8b4={'user':_0x4e75d9[_0xba4c('0x9d')],'pass':_0x4e75d9[_0xba4c('0x95')]};var _0x3f5341={'method':_0xba4c('0x9e'),'uri':_0x1f9b81+'incident?sysparm_display_value=all','auth':_0x45d8b4,'json':!![]};return rp(_0x3f5341);}})[_0xba4c('0x43')](function(_0xf3830c){if(_0xf3830c[_0xba4c('0x9f')]['length']>0x0){_0x3319fa=_0xf3830c['result'];}console['log']('incident\x20table\x20objects',_0x3319fa);_0x1f6e21=[];_0x27a808=Object[_0xba4c('0xa0')]([],_0x3319fa);_['remove'](_0x27a808,function(_0x52e3fc){return!_0x54441b['includes'](_0x52e3fc[_0xba4c('0x27')]);});_0x27a808[_0xba4c('0xa1')](function(_0x1cdd16){var _0x51c9ab=createFieldObject(_0x1c397e,_0x45d8b4,_0x1cdd16[_0xba4c('0xa2')],_0x1cdd16[_0xba4c('0x27')],_0x1cdd16[_0xba4c('0xa3')],![]);_0x1f6e21[_0xba4c('0xa4')](_0x51c9ab);});return Promise[_0xba4c('0xa5')](_0x1f6e21);})[_0xba4c('0x43')](function(_0x435bd7){_0x374fd5=_0x435bd7;_0x3c5523=Object[_0xba4c('0xa0')]([],_0x3319fa);console[_0xba4c('0xa6')](_0xba4c('0xa7'),_0x3319fa);_['remove'](_0x3c5523,function(_0xcfe5ce){return _0x173ad6[_0xba4c('0xa8')](_0xcfe5ce[_0xba4c('0x27')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3c5523);_0x1f6e21=[];_0x3c5523[_0xba4c('0xa1')](function(_0xb0647e){var _0x17a9c6=createFieldObject(_0x1c397e,_0x45d8b4,_0xb0647e[_0xba4c('0xa2')],_0xb0647e['name'],_0xb0647e['label'],!![]);_0x1f6e21[_0xba4c('0xa4')](_0x17a9c6);});return Promise['all'](_0x1f6e21);})[_0xba4c('0x43')](function(_0x5b2ac7){_0xe566c9=_0x5b2ac7;var _0x54203f=_0x374fd5[_0xba4c('0xa9')](_0xe566c9);return{'count':_0x54203f['length'],'rows':_0x54203f};})[_0xba4c('0x43')](respondWithResult(_0x3bfd76,null))[_0xba4c('0x45')](function(_0x32018c){console[_0xba4c('0xa6')](_0xba4c('0xaa')+_0x32018c);var _0x564a79=_0x396b55[_0xba4c('0x2f')][_0xba4c('0xab')]?0x1f4:_0x32018c[_0xba4c('0xac')]||0x1f4;logger['error'](_0x32018c[_0xba4c('0x26')]);delete _0x32018c[_0xba4c('0x27')];if(_0x564a79===0x191){_0x564a79=0x190;}_0x3bfd76[_0xba4c('0x1c')](_0x564a79)['send'](_0x396b55[_0xba4c('0x2f')][_0xba4c('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x32018c[_0xba4c('0xac')]}:_0x32018c);});};function createFieldObject(_0x2d2d04,_0x13b8bf,_0x581119,_0x2ee58a,_0x24b949,_0x3ba856){return new Promise(function(_0x4e35a4,_0x22c259){var _0x5001c0={'id':_0x2ee58a,'name':_0x24b949,'custom':_0x3ba856};if(_0x581119===_0xba4c('0xad')){_0x5001c0[_0xba4c('0x3f')]=[{'name':'True','value':_0xba4c('0xae')},{'name':_0xba4c('0xaf'),'value':'false'}];_0x4e35a4(_0x5001c0);}else{var _0x4bb44c={'method':_0xba4c('0x9e'),'uri':_0x2d2d04+_0xba4c('0xb0')+_0x2ee58a,'auth':_0x13b8bf,'json':!![]};return rp(_0x4bb44c)[_0xba4c('0x43')](function(_0x1d78fd){var _0x4231e9=[];if(_0x1d78fd[_0xba4c('0x9f')]['length']>0x0){_0x1d78fd[_0xba4c('0x9f')][_0xba4c('0xa1')](function(_0x4a692a){if(_0x4a692a['inactive']===_0xba4c('0xb1')){var _0xc4af4b={'name':_0x4a692a['label'],'value':_0x4a692a[_0xba4c('0xb2')]};_0x4231e9[_0xba4c('0xa4')](_0xc4af4b);}});}_0x5001c0[_0xba4c('0x3f')]=_0x4231e9;if(_0x5001c0['options']['length']>0x0){_0x4e35a4(_0x5001c0);}else{if(_0x3ba856==![]){_0x4e35a4();}else{_0x4e35a4(_0x5001c0);}}});}});}
\ No newline at end of file
+var _0x9b62=['problem_id','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','username','password','remoteUri','serverUrl','slice','lastIndexOf','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','push','all','TCL:\x20_object','label','concat','ServiceNow\x20error:\x20','test','statusCode','True','False','false','GET','sys_choice?sysparm_query=name=incident^element=','forEach','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','error','stack','name','index','ServicenowAccount','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','incident_state','severity','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_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','business_duration','group_list','reopened_time','resolved_at','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency'];(function(_0x38a0d2,_0x20315a){var _0xd9b0c1=function(_0xe3c61e){while(--_0xe3c61e){_0x38a0d2['push'](_0x38a0d2['shift']());}};_0xd9b0c1(++_0x20315a);}(_0x9b62,0xe0));var _0x29b6=function(_0x1642b0,_0x10559e){_0x1642b0=_0x1642b0-0x0;var _0x2394b5=_0x9b62[_0x1642b0];return _0x2394b5;};'use strict';var emlformat=require(_0x29b6('0x0'));var rimraf=require(_0x29b6('0x1'));var zipdir=require(_0x29b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29b6('0x3'));var moment=require(_0x29b6('0x4'));var BPromise=require(_0x29b6('0x5'));var Mustache=require('mustache');var util=require(_0x29b6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x29b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29b6('0x8'));var _=require('lodash');var squel=require(_0x29b6('0x9'));var crypto=require(_0x29b6('0xa'));var jsforce=require(_0x29b6('0xb'));var deskjs=require(_0x29b6('0xc'));var toCsv=require(_0x29b6('0x7'));var querystring=require(_0x29b6('0xd'));var Papa=require(_0x29b6('0xe'));var Redis=require(_0x29b6('0xf'));var authService=require(_0x29b6('0x10'));var qs=require(_0x29b6('0x11'));var as=require(_0x29b6('0x12'));var hardwareService=require(_0x29b6('0x13'));var logger=require(_0x29b6('0x14'))(_0x29b6('0x15'));var utils=require('../../config/utils');var config=require(_0x29b6('0x16'));var licenseUtil=require(_0x29b6('0x17'));var db=require(_0x29b6('0x18'))['db'];var integrations=require(_0x29b6('0x19'));function respondWithStatusCode(_0x19171a,_0xa6cde2){_0xa6cde2=_0xa6cde2||0xcc;return function(_0x37fe9f){if(_0x37fe9f){return _0x19171a[_0x29b6('0x1a')](_0xa6cde2);}return _0x19171a[_0x29b6('0x1b')](_0xa6cde2)[_0x29b6('0x1c')]();};}function respondWithResult(_0x302cea,_0x2b2a1a){_0x2b2a1a=_0x2b2a1a||0xc8;return function(_0x99f21b){if(_0x99f21b){return _0x302cea['status'](_0x2b2a1a)[_0x29b6('0x1d')](_0x99f21b);}};}function respondWithFilteredResult(_0x522d25,_0x5779d9){return function(_0x1008ff){if(_0x1008ff){var _0xe8015d=typeof _0x5779d9[_0x29b6('0x1e')]===_0x29b6('0x1f')&&typeof _0x5779d9['limit']===_0x29b6('0x1f');var _0x29e24b=_0x1008ff[_0x29b6('0x20')];var _0x19defd=_0xe8015d?0x0:_0x5779d9[_0x29b6('0x1e')];var _0x118411=_0xe8015d?_0x1008ff[_0x29b6('0x20')]:_0x5779d9[_0x29b6('0x1e')]+_0x5779d9[_0x29b6('0x21')];var _0x13a13d;if(_0x118411>=_0x29e24b){_0x118411=_0x29e24b;_0x13a13d=0xc8;}else{_0x13a13d=0xce;}_0x522d25[_0x29b6('0x1b')](_0x13a13d);return _0x522d25['set']('Content-Range',_0x19defd+'-'+_0x118411+'/'+_0x29e24b)[_0x29b6('0x1d')](_0x1008ff);}return null;};}function patchUpdates(_0x443c28){return function(_0xba2693){try{jsonpatch['apply'](_0xba2693,_0x443c28,!![]);}catch(_0xdd985c){return BPromise[_0x29b6('0x22')](_0xdd985c);}return _0xba2693[_0x29b6('0x23')]();};}function saveUpdates(_0xc198ac,_0x1986de){return function(_0x3945dd){if(_0x3945dd){return _0x3945dd[_0x29b6('0x24')](_0xc198ac)[_0x29b6('0x25')](function(_0x20cd03){return _0x20cd03;});}return null;};}function removeEntity(_0x3d8563,_0x1a78a3){return function(_0x444a3f){if(_0x444a3f){return _0x444a3f[_0x29b6('0x26')]()[_0x29b6('0x25')](function(){_0x3d8563['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e04a6,_0x533dfd){return function(_0x321fa6){if(!_0x321fa6){_0x5e04a6['sendStatus'](0x194);}return _0x321fa6;};}function handleError(_0x15f706,_0xd5a753){_0xd5a753=_0xd5a753||0x1f4;return function(_0x3a9e8b){logger[_0x29b6('0x27')](_0x3a9e8b[_0x29b6('0x28')]);if(_0x3a9e8b[_0x29b6('0x29')]){delete _0x3a9e8b[_0x29b6('0x29')];}_0x15f706[_0x29b6('0x1b')](_0xd5a753)['send'](_0x3a9e8b);};}exports[_0x29b6('0x2a')]=function(_0x1660a0,_0x1862a8){var _0x2c2db9={},_0x222e42={},_0x42c235={'count':0x0,'rows':[]};var _0x13872c=_['map'](db[_0x29b6('0x2b')]['rawAttributes'],function(_0x34f50d){return{'name':_0x34f50d[_0x29b6('0x2c')],'type':_0x34f50d[_0x29b6('0x2d')]['key']};});_0x222e42['model']=_['map'](_0x13872c,'name');_0x222e42[_0x29b6('0x2e')]=_[_0x29b6('0x2f')](_0x1660a0[_0x29b6('0x2e')]);_0x222e42[_0x29b6('0x30')]=_[_0x29b6('0x31')](_0x222e42[_0x29b6('0x32')],_0x222e42[_0x29b6('0x2e')]);_0x2c2db9[_0x29b6('0x33')]=_[_0x29b6('0x31')](_0x222e42[_0x29b6('0x32')],qs['fields'](_0x1660a0[_0x29b6('0x2e')][_0x29b6('0x34')]));_0x2c2db9[_0x29b6('0x33')]=_0x2c2db9['attributes'][_0x29b6('0x35')]?_0x2c2db9[_0x29b6('0x33')]:_0x222e42['model'];if(!_0x1660a0[_0x29b6('0x2e')]['hasOwnProperty']('nolimit')){_0x2c2db9[_0x29b6('0x21')]=qs[_0x29b6('0x21')](_0x1660a0[_0x29b6('0x2e')]['limit']);_0x2c2db9[_0x29b6('0x1e')]=qs[_0x29b6('0x1e')](_0x1660a0[_0x29b6('0x2e')]['offset']);}_0x2c2db9[_0x29b6('0x36')]=qs[_0x29b6('0x37')](_0x1660a0[_0x29b6('0x2e')]['sort']);_0x2c2db9[_0x29b6('0x38')]=qs[_0x29b6('0x30')](_[_0x29b6('0x39')](_0x1660a0[_0x29b6('0x2e')],_0x222e42[_0x29b6('0x30')]),_0x13872c);if(_0x1660a0[_0x29b6('0x2e')]['filter']){_0x2c2db9[_0x29b6('0x38')]=_[_0x29b6('0x3a')](_0x2c2db9['where'],{'$or':_[_0x29b6('0x3b')](_0x13872c,function(_0x17c684){if(_0x17c684[_0x29b6('0x2d')]!==_0x29b6('0x3c')){var _0x1ef065={};_0x1ef065[_0x17c684['name']]={'$like':'%'+_0x1660a0[_0x29b6('0x2e')]['filter']+'%'};return _0x1ef065;}})});}_0x2c2db9=_[_0x29b6('0x3a')]({},_0x2c2db9,_0x1660a0[_0x29b6('0x3d')]);var _0x4ce45c={'where':_0x2c2db9[_0x29b6('0x38')]};return db[_0x29b6('0x2b')][_0x29b6('0x20')](_0x4ce45c)['then'](function(_0x1034db){_0x42c235[_0x29b6('0x20')]=_0x1034db;if(_0x1660a0['query'][_0x29b6('0x3e')]){_0x2c2db9[_0x29b6('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x29b6('0x40')](_0x2c2db9);})[_0x29b6('0x25')](function(_0x28504c){_0x42c235[_0x29b6('0x41')]=_0x28504c;return _0x42c235;})[_0x29b6('0x25')](respondWithFilteredResult(_0x1862a8,_0x2c2db9))['catch'](handleError(_0x1862a8,null));};exports[_0x29b6('0x42')]=function(_0x33b44c,_0x11ab44){var _0xe89ea9={'raw':![],'where':{'id':_0x33b44c[_0x29b6('0x43')]['id']}},_0x20144c={};_0x20144c[_0x29b6('0x32')]=_[_0x29b6('0x2f')](db[_0x29b6('0x2b')][_0x29b6('0x44')]);_0x20144c[_0x29b6('0x2e')]=_['keys'](_0x33b44c[_0x29b6('0x2e')]);_0x20144c[_0x29b6('0x30')]=_[_0x29b6('0x31')](_0x20144c[_0x29b6('0x32')],_0x20144c[_0x29b6('0x2e')]);_0xe89ea9['attributes']=_[_0x29b6('0x31')](_0x20144c['model'],qs[_0x29b6('0x34')](_0x33b44c['query'][_0x29b6('0x34')]));_0xe89ea9[_0x29b6('0x33')]=_0xe89ea9[_0x29b6('0x33')][_0x29b6('0x35')]?_0xe89ea9[_0x29b6('0x33')]:_0x20144c[_0x29b6('0x32')];if(_0x33b44c[_0x29b6('0x2e')][_0x29b6('0x3e')]){_0xe89ea9[_0x29b6('0x3f')]=[{'all':!![]}];}_0xe89ea9=_[_0x29b6('0x3a')]({},_0xe89ea9,_0x33b44c[_0x29b6('0x3d')]);return db[_0x29b6('0x2b')][_0x29b6('0x45')](_0xe89ea9)[_0x29b6('0x25')](handleEntityNotFound(_0x11ab44,null))[_0x29b6('0x25')](respondWithResult(_0x11ab44,null))[_0x29b6('0x46')](handleError(_0x11ab44,null));};exports[_0x29b6('0x47')]=function(_0x25ac4e,_0x36f5c5){return db['ServicenowAccount'][_0x29b6('0x47')](_0x25ac4e[_0x29b6('0x48')],{})[_0x29b6('0x25')](respondWithResult(_0x36f5c5,0xc9))[_0x29b6('0x46')](handleError(_0x36f5c5,null));};exports[_0x29b6('0x24')]=function(_0x2063eb,_0x449886){if(_0x2063eb[_0x29b6('0x48')]['id']){delete _0x2063eb[_0x29b6('0x48')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x2063eb[_0x29b6('0x43')]['id']}})[_0x29b6('0x25')](handleEntityNotFound(_0x449886,null))[_0x29b6('0x25')](saveUpdates(_0x2063eb[_0x29b6('0x48')],null))['then'](respondWithResult(_0x449886,null))[_0x29b6('0x46')](handleError(_0x449886,null));};exports['destroy']=function(_0x279fc9,_0x2893ad){return db[_0x29b6('0x2b')][_0x29b6('0x45')]({'where':{'id':_0x279fc9[_0x29b6('0x43')]['id']}})[_0x29b6('0x25')](handleEntityNotFound(_0x2893ad,null))['then'](removeEntity(_0x2893ad,null))['catch'](handleError(_0x2893ad,null));};exports[_0x29b6('0x49')]=function(_0x3362c1,_0x278acf,_0x32c6a3){var _0x1f5db4={};var _0x38e7c9={};var _0x1440a7;var _0x542038;return db['ServicenowAccount'][_0x29b6('0x4a')]({'where':{'id':_0x3362c1['params']['id']}})['then'](handleEntityNotFound(_0x278acf,null))['then'](function(_0x3e908f){if(_0x3e908f){_0x1440a7=_0x3e908f;_0x38e7c9[_0x29b6('0x32')]=_[_0x29b6('0x2f')](db['ServicenowConfiguration'][_0x29b6('0x44')]);_0x38e7c9[_0x29b6('0x2e')]=_[_0x29b6('0x2f')](_0x3362c1[_0x29b6('0x2e')]);_0x38e7c9['filters']=_['intersection'](_0x38e7c9[_0x29b6('0x32')],_0x38e7c9[_0x29b6('0x2e')]);_0x1f5db4['attributes']=_[_0x29b6('0x31')](_0x38e7c9[_0x29b6('0x32')],qs[_0x29b6('0x34')](_0x3362c1['query'][_0x29b6('0x34')]));_0x1f5db4[_0x29b6('0x33')]=_0x1f5db4[_0x29b6('0x33')]['length']?_0x1f5db4[_0x29b6('0x33')]:_0x38e7c9[_0x29b6('0x32')];_0x1f5db4['order']=qs[_0x29b6('0x37')](_0x3362c1['query'][_0x29b6('0x37')]);_0x1f5db4[_0x29b6('0x38')]=qs['filters'](_[_0x29b6('0x39')](_0x3362c1['query'],_0x38e7c9[_0x29b6('0x30')]));if(_0x3362c1[_0x29b6('0x2e')]['filter']){_0x1f5db4[_0x29b6('0x38')]=_[_0x29b6('0x3a')](_0x1f5db4[_0x29b6('0x38')],{'$or':_['map'](_0x1f5db4[_0x29b6('0x33')],function(_0x4dee58){var _0x4856c2={};_0x4856c2[_0x4dee58]={'$like':'%'+_0x3362c1[_0x29b6('0x2e')]['filter']+'%'};return _0x4856c2;})});}_0x1f5db4=_[_0x29b6('0x3a')]({},_0x1f5db4,_0x3362c1['options']);return _0x1440a7[_0x29b6('0x49')](_0x1f5db4);}})['then'](function(_0x3913df){if(_0x3913df){_0x542038=_0x3913df[_0x29b6('0x35')];if(!_0x3362c1[_0x29b6('0x2e')][_0x29b6('0x4b')](_0x29b6('0x4c'))){_0x1f5db4['limit']=qs[_0x29b6('0x21')](_0x3362c1[_0x29b6('0x2e')][_0x29b6('0x21')]);_0x1f5db4[_0x29b6('0x1e')]=qs[_0x29b6('0x1e')](_0x3362c1[_0x29b6('0x2e')][_0x29b6('0x1e')]);}return _0x1440a7['getConfigurations'](_0x1f5db4);}})['then'](function(_0x27174b){if(_0x27174b){return _0x27174b?{'count':_0x542038,'rows':_0x27174b}:null;}})[_0x29b6('0x25')](respondWithResult(_0x278acf,null))['catch'](handleError(_0x278acf,null));};exports[_0x29b6('0x4d')]=function(_0x2e117b,_0x15a045,_0x38bca8){if(_0x2e117b[_0x29b6('0x48')]['id']){delete _0x2e117b[_0x29b6('0x48')]['id'];}return db['ServicenowAccount'][_0x29b6('0x4a')]({'where':{'id':_0x2e117b[_0x29b6('0x43')]['id']}})['then'](handleEntityNotFound(_0x15a045,null))[_0x29b6('0x25')](function(_0x36eb31){if(_0x36eb31){_0x2e117b[_0x29b6('0x48')][_0x29b6('0x4e')]=_0x36eb31['id'];_0x2e117b['body'][_0x29b6('0x4f')]=integrations['getSubjects'](_0x2e117b['body'][_0x29b6('0x50')],_0x2e117b[_0x29b6('0x48')][_0x29b6('0x2d')]);_0x2e117b[_0x29b6('0x48')][_0x29b6('0x51')]=integrations['getDescriptions'](_0x2e117b['body'][_0x29b6('0x50')],_0x2e117b['body'][_0x29b6('0x2d')]);return db[_0x29b6('0x52')][_0x29b6('0x47')](_0x2e117b[_0x29b6('0x48')],{'include':[{'model':db['ServicenowField'],'as':_0x29b6('0x4f')},{'model':db[_0x29b6('0x53')],'as':_0x29b6('0x51')}]});}return null;})[_0x29b6('0x25')](respondWithResult(_0x15a045,null))[_0x29b6('0x46')](handleError(_0x15a045,null));};exports[_0x29b6('0x54')]=function(_0x482db8,_0x10cc10,_0x412aba){var _0x5d518f=[_0x29b6('0x55'),_0x29b6('0x56'),_0x29b6('0x57'),'subcategory','close_code',_0x29b6('0x58'),_0x29b6('0x59'),_0x29b6('0x5a'),'category'];var _0xbae473=[_0x29b6('0x5b'),_0x29b6('0x55'),_0x29b6('0x5c'),_0x29b6('0x5d'),_0x29b6('0x5e'),_0x29b6('0x5f'),_0x29b6('0x60'),_0x29b6('0x56'),_0x29b6('0x61'),_0x29b6('0x62'),_0x29b6('0x63'),'sys_updated_by',_0x29b6('0x64'),_0x29b6('0x65'),_0x29b6('0x66'),'sys_domain','state',_0x29b6('0x67'),_0x29b6('0x57'),_0x29b6('0x36'),_0x29b6('0x68'),_0x29b6('0x69'),'cmdb_ci',_0x29b6('0x6a'),_0x29b6('0x6b'),_0x29b6('0x6c'),_0x29b6('0x6d'),'business_service',_0x29b6('0x6e'),'sys_domain_path',_0x29b6('0x6f'),_0x29b6('0x70'),_0x29b6('0x71'),'opened_at',_0x29b6('0x72'),_0x29b6('0x73'),'work_end',_0x29b6('0x74'),_0x29b6('0x75'),'caller_id',_0x29b6('0x76'),_0x29b6('0x77'),_0x29b6('0x78'),_0x29b6('0x79'),_0x29b6('0x7a'),_0x29b6('0x7b'),_0x29b6('0x7c'),_0x29b6('0x7d'),_0x29b6('0x7e'),_0x29b6('0x7f'),_0x29b6('0x80'),_0x29b6('0x81'),_0x29b6('0x82'),_0x29b6('0x58'),_0x29b6('0x83'),_0x29b6('0x84'),_0x29b6('0x85'),_0x29b6('0x86'),_0x29b6('0x87'),_0x29b6('0x88'),_0x29b6('0x89'),_0x29b6('0x8a'),_0x29b6('0x59'),_0x29b6('0x8b'),_0x29b6('0x8c'),'company',_0x29b6('0x8d'),_0x29b6('0x8e'),'assigned_to',_0x29b6('0x5a'),_0x29b6('0x8f'),_0x29b6('0x90'),_0x29b6('0x91'),_0x29b6('0x92'),_0x29b6('0x93'),_0x29b6('0x94'),_0x29b6('0x95'),_0x29b6('0x96'),_0x29b6('0x97'),_0x29b6('0x98'),_0x29b6('0x99'),'location',_0x29b6('0x9a')];var _0x4b9fbf='';var _0x2da270='';var _0x2123bd=[];var _0x3e903f='';var _0x18c63b='';var _0x23bf22=[];var _0xe56148='';var _0x493737='';var _0x29027a={};var _0xbca2e5='';return db[_0x29b6('0x2b')][_0x29b6('0x4a')]({'where':{'id':_0x482db8[_0x29b6('0x43')]['id']},'attributes':['id',_0x29b6('0x9b'),_0x29b6('0x9c'),'email',_0x29b6('0x9d'),_0x29b6('0x9e')]})[_0x29b6('0x25')](handleEntityNotFound(_0x10cc10,null))[_0x29b6('0x25')](function(_0x17e5a1){if(_0x17e5a1){_0xbca2e5=_0x17e5a1[_0x29b6('0x9d')];var _0x5bcf09=_0xbca2e5[_0x29b6('0x9f')](-0x1);if(_0x5bcf09==='/'){_0xbca2e5=_0xbca2e5['substring'](0x0,_0xbca2e5[_0x29b6('0xa0')](_0x5bcf09));}_0x493737=util['format']('%s/api/now/doc/table/schema/',_0xbca2e5);_0xe56148=util['format']('%s/api/now/table/',_0xbca2e5);_0x29027a={'user':_0x17e5a1[_0x29b6('0x9b')],'pass':_0x17e5a1[_0x29b6('0x9c')]};var _0x1b7a3a={'method':'GET','uri':_0x493737+_0x29b6('0xa1'),'auth':_0x29027a,'json':!![]};return rp(_0x1b7a3a);}})[_0x29b6('0x25')](function(_0xd98a0b){if(_0xd98a0b['result'][_0x29b6('0x35')]>0x0){_0x4b9fbf=_0xd98a0b[_0x29b6('0xa2')];}console[_0x29b6('0xa3')](_0x29b6('0xa4'),_0x4b9fbf);_0x23bf22=[];_0x2da270=Object[_0x29b6('0xa5')]([],_0x4b9fbf);_[_0x29b6('0xa6')](_0x2da270,function(_0x466a34){return!_0x5d518f[_0x29b6('0xa7')](_0x466a34[_0x29b6('0x29')]);});_0x2da270['forEach'](function(_0x5ee24f){var _0x5e4da5=createFieldObject(_0xe56148,_0x29027a,_0x5ee24f['internalType'],_0x5ee24f['name'],_0x5ee24f['label'],![]);_0x23bf22[_0x29b6('0xa8')](_0x5e4da5);});return Promise[_0x29b6('0xa9')](_0x23bf22);})[_0x29b6('0x25')](function(_0x36d55f){_0x2123bd=_0x36d55f;_0x3e903f=Object[_0x29b6('0xa5')]([],_0x4b9fbf);console[_0x29b6('0xa3')](_0x29b6('0xaa'),_0x4b9fbf);_[_0x29b6('0xa6')](_0x3e903f,function(_0xe2479b){return _0xbae473[_0x29b6('0xa7')](_0xe2479b['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3e903f);_0x23bf22=[];_0x3e903f['forEach'](function(_0xafd570){var _0x47c4da=createFieldObject(_0xe56148,_0x29027a,_0xafd570['internalType'],_0xafd570['name'],_0xafd570[_0x29b6('0xab')],!![]);_0x23bf22[_0x29b6('0xa8')](_0x47c4da);});return Promise['all'](_0x23bf22);})[_0x29b6('0x25')](function(_0x407582){_0x18c63b=_0x407582;var _0x1b80a0=_0x2123bd[_0x29b6('0xac')](_0x18c63b);return{'count':_0x1b80a0[_0x29b6('0x35')],'rows':_0x1b80a0};})[_0x29b6('0x25')](respondWithResult(_0x10cc10,null))[_0x29b6('0x46')](function(_0x5c56be){console['log'](_0x29b6('0xad')+_0x5c56be);var _0x2db591=_0x482db8['query'][_0x29b6('0xae')]?0x1f4:_0x5c56be[_0x29b6('0xaf')]||0x1f4;logger[_0x29b6('0x27')](_0x5c56be[_0x29b6('0x28')]);delete _0x5c56be[_0x29b6('0x29')];if(_0x2db591===0x191){_0x2db591=0x190;}_0x10cc10[_0x29b6('0x1b')](_0x2db591)['send'](_0x482db8[_0x29b6('0x2e')][_0x29b6('0xae')]?{'message':'Wrong\x20credentials','statusCode':_0x5c56be[_0x29b6('0xaf')]}:_0x5c56be);});};function createFieldObject(_0x1b92a3,_0x3a0c79,_0x493d5a,_0x136b79,_0x197c7d,_0xf5bc53){return new Promise(function(_0x110dd5,_0x127e17){var _0x513dc3={'id':_0x136b79,'name':_0x197c7d,'custom':_0xf5bc53};if(_0x493d5a==='boolean'){_0x513dc3[_0x29b6('0x3d')]=[{'name':_0x29b6('0xb0'),'value':'true'},{'name':_0x29b6('0xb1'),'value':_0x29b6('0xb2')}];_0x110dd5(_0x513dc3);}else{var _0x30cfb8={'method':_0x29b6('0xb3'),'uri':_0x1b92a3+_0x29b6('0xb4')+_0x136b79,'auth':_0x3a0c79,'json':!![]};return rp(_0x30cfb8)[_0x29b6('0x25')](function(_0x5ae25d){var _0x433d2a=[];if(_0x5ae25d['result'][_0x29b6('0x35')]>0x0){_0x5ae25d[_0x29b6('0xa2')][_0x29b6('0xb5')](function(_0x2f6237){if(_0x2f6237['inactive']===_0x29b6('0xb2')){var _0x33c50c={'name':_0x2f6237[_0x29b6('0xab')],'value':_0x2f6237['value']};_0x433d2a['push'](_0x33c50c);}});}_0x513dc3['options']=_0x433d2a;if(_0x513dc3[_0x29b6('0x3d')][_0x29b6('0x35')]>0x0){_0x110dd5(_0x513dc3);}else{if(_0xf5bc53==![]){_0x110dd5();}else{_0x110dd5(_0x513dc3);}}});}});}
\ No newline at end of file