Built motion from commit aab208717af8d15f4fa224cdb6a202877019af9b. Version 3.0.0...
[motion-next.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 5967fe4..c2c3364 100644 (file)
@@ -1 +1 @@
-const a294_0x2bb2=['util','../../config/logger','remoteUri','count','remove','assignment_group','../../mysqldb','getConfigurations','sys_mod_count','sys_class_name','%s/api/now/table/','sys_updated_by','key','keys','inactive','ServicenowField','sys_id','rows','additional_assignee_list','length','short_description','sort','impact','business_stc','incident\x20table\x20objects','format','internalType','VIRTUAL','parent_incident','undefined','limit','catch','cmdb_ci','includes','attributes','findAll','incident_state','caller_id','statusCode','problem_id','order','Subjects','then','true','business_duration','stack','ServicenowConfiguration','group_list','work_notes_list','company','subcategory','approval_history','opened_at','offset','time_worked','Content-Range','all','reopen_count','knowledge','destroy','findOne','intersection','close_code','approval_set','rfc','reassignment_count','assign','log','fields','slice','ServicenowAccount','getFields','send','channel','addConfiguration','Descriptions','includeAll','like','active','query','result','type','reopened_by','nolimit','comments','location','work_notes','sys_updated_on','label','json','sys_domain_path','incident?sysparm_display_value=all','rawAttributes','fieldName','concat','options','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','calendar_stc','work_end','user_input','upon_reject','closed_at','watch_list','password','lodash','boolean','forEach','where','sys_created_by','%s/api/now/doc/table/schema/','email','../../components/parsers/qs','include','status','delivery_task','body','Wrong\x20credentials','reopened_time','description','filters','false','lastIndexOf','merge','calendar_duration','sequelize','hold_reason','sys_created_on','params','delivery_plan','upon_approval','TCL:\x20_object','made_sla','resolved_by','test','map','closed_by','work_start','severity','pick','update','sys_tags','set','parent','name','sla_due','push','index','api','sys_domain','due_date','resolved_at','value','filter','correlation_display','notify','business_service','error','correlation_id','getDescriptions','category','create','sendStatus','username','expected_start','caused_by','False','model'];(function(_0x3b4f37,_0x2bb2f5){const _0x4e25d5=function(_0x5436ab){while(--_0x5436ab){_0x3b4f37['push'](_0x3b4f37['shift']());}};_0x4e25d5(++_0x2bb2f5);}(a294_0x2bb2,0x79));const a294_0x4e25=function(_0x3b4f37,_0x2bb2f5){_0x3b4f37=_0x3b4f37-0x0;let _0x4e25d5=a294_0x2bb2[_0x3b4f37];return _0x4e25d5;};const _0x271061=a294_0x4e25;'use strict';const rp=require('request-promise-native'),util=require(_0x271061('0x2e')),_=require(_0x271061('0x96')),qs=require(_0x271061('0x9d')),logger=require(_0x271061('0x2f'))(_0x271061('0x1a')),db=require(_0x271061('0x34'))['db'],{Op}=require(_0x271061('0x3')),integrations=require('../../components/integrations/configuration');function respondWithResult(_0x5436ab,_0xa1c282){return _0xa1c282=_0xa1c282||0xc8,function(_0x21e38e){const _0x125dab=a294_0x4e25;if(_0x21e38e)return _0x5436ab['status'](_0xa1c282)[_0x125dab('0x87')](_0x21e38e);};}function respondWithFilteredResult(_0x4c991a,_0xed78e5){return function(_0x6d0f8){const _0x4e4ba6=a294_0x4e25;if(_0x6d0f8){const _0x20a505=_0x6d0f8[_0x4e4ba6('0x31')],_0x3b9e55=_0xed78e5[_0x4e4ba6('0x63')];let _0x1496cc=_0xed78e5[_0x4e4ba6('0x63')]+_0xed78e5['limit'],_0x2f0d8f;return _0x1496cc>=_0x20a505?(_0x1496cc=_0x20a505,_0x2f0d8f=0xc8):_0x2f0d8f=0xce,_0x4c991a[_0x4e4ba6('0x9f')](_0x2f0d8f),_0x4c991a[_0x4e4ba6('0x14')](_0x4e4ba6('0x65'),_0x3b9e55+'-'+_0x1496cc+'/'+_0x20a505)['json'](_0x6d0f8);}return null;};}function saveUpdates(_0x2b02f7){return function(_0x4f4f3d){const _0x59d643=a294_0x4e25;if(_0x4f4f3d)return _0x4f4f3d[_0x59d643('0x12')](_0x2b02f7)[_0x59d643('0x58')](function(_0x6ada87){return _0x6ada87;});return null;};}function removeEntity(_0x597bbb){return function(_0x39db3f){const _0x3b118a=a294_0x4e25;if(_0x39db3f)return _0x39db3f[_0x3b118a('0x69')]()[_0x3b118a('0x58')](function(){const _0x65b524=_0x3b118a;_0x597bbb[_0x65b524('0x9f')](0xcc)['end']();});};}function handleEntityNotFound(_0x51ffcb){return function(_0x2363ff){const _0x52bbf7=a294_0x4e25;return!_0x2363ff&&_0x51ffcb[_0x52bbf7('0x28')](0x194),_0x2363ff;};}function handleError(_0x3a3e5c,_0x534761){return _0x534761=_0x534761||0x1f4,function(_0x452e0e){const _0x53066d=a294_0x4e25;logger[_0x53066d('0x23')](_0x452e0e[_0x53066d('0x5b')]),_0x452e0e[_0x53066d('0x16')]&&delete _0x452e0e[_0x53066d('0x16')],_0x3a3e5c[_0x53066d('0x9f')](_0x534761)[_0x53066d('0x76')](_0x452e0e);};}exports[_0x271061('0x19')]=function(_0xfffe24,_0xf0f033){const _0x361e69=_0x271061;let _0x4e8ba5={};const _0x52537c={},_0x2a1b0c={'count':0x0,'rows':[]},_0x52f5e6=_[_0x361e69('0xd')](db[_0x361e69('0x74')][_0x361e69('0x8a')],function(_0x6bb11){const _0x61039e=_0x361e69;return{'name':_0x6bb11[_0x61039e('0x8b')],'type':_0x6bb11[_0x61039e('0x7f')][_0x61039e('0x3a')]};});_0x52537c[_0x361e69('0x2d')]=_[_0x361e69('0xd')](_0x52f5e6,'name'),_0x52537c[_0x361e69('0x7d')]=_[_0x361e69('0x3b')](_0xfffe24[_0x361e69('0x7d')]),_0x52537c[_0x361e69('0xa5')]=_[_0x361e69('0x6b')](_0x52537c[_0x361e69('0x2d')],_0x52537c['query']),_0x4e8ba5[_0x361e69('0x50')]=_[_0x361e69('0x6b')](_0x52537c[_0x361e69('0x2d')],qs[_0x361e69('0x72')](_0xfffe24[_0x361e69('0x7d')][_0x361e69('0x72')])),_0x4e8ba5['attributes']=_0x4e8ba5[_0x361e69('0x50')][_0x361e69('0x41')]?_0x4e8ba5['attributes']:_0x52537c[_0x361e69('0x2d')];typeof _0xfffe24[_0x361e69('0x7d')][_0x361e69('0x81')]==='undefined'&&(_0x4e8ba5[_0x361e69('0x4c')]=qs[_0x361e69('0x4c')](_0xfffe24[_0x361e69('0x7d')][_0x361e69('0x4c')]),_0x4e8ba5[_0x361e69('0x63')]=qs['offset'](_0xfffe24[_0x361e69('0x7d')][_0x361e69('0x63')]));_0x4e8ba5['order']=qs['sort'](_0xfffe24[_0x361e69('0x7d')][_0x361e69('0x43')]),_0x4e8ba5[_0x361e69('0x99')]=qs[_0x361e69('0xa5')](_[_0x361e69('0x11')](_0xfffe24[_0x361e69('0x7d')],_0x52537c['filters']),_0x52f5e6);_0xfffe24[_0x361e69('0x7d')][_0x361e69('0x1f')]&&(_0x4e8ba5[_0x361e69('0x99')]=_[_0x361e69('0x1')](_0x4e8ba5['where'],{[Op['or']]:_[_0x361e69('0xd')](_0x52f5e6,function(_0x1f8c99){const _0x4120de=_0x361e69;if(_0x1f8c99['type']!==_0x4120de('0x49')){const _0x5ae1da={};return _0x5ae1da[_0x1f8c99['name']]={[Op[_0x4120de('0x7b')]]:'%'+_0xfffe24['query'][_0x4120de('0x1f')]+'%'},_0x5ae1da;}})}));_0x4e8ba5=_['merge']({},_0x4e8ba5,_0xfffe24['options']);const _0x1e1df6={'where':_0x4e8ba5[_0x361e69('0x99')]};return db['ServicenowAccount'][_0x361e69('0x31')](_0x1e1df6)[_0x361e69('0x58')](function(_0x185539){const _0x54d97d=_0x361e69;return _0x2a1b0c['count']=_0x185539,_0xfffe24[_0x54d97d('0x7d')][_0x54d97d('0x7a')]&&(_0x4e8ba5[_0x54d97d('0x9e')]=[{'all':!![]}]),db[_0x54d97d('0x74')][_0x54d97d('0x51')](_0x4e8ba5);})[_0x361e69('0x58')](function(_0x473ae4){const _0xc3742d=_0x361e69;return _0x2a1b0c[_0xc3742d('0x3f')]=_0x473ae4,_0x2a1b0c;})[_0x361e69('0x58')](respondWithFilteredResult(_0xf0f033,_0x4e8ba5))[_0x361e69('0x4d')](handleError(_0xf0f033,null));},exports['show']=function(_0x35aab3,_0x360101){const _0x1424e1=_0x271061;let _0x16d6d9={'raw':![],'where':{'id':_0x35aab3[_0x1424e1('0x6')]['id']}};const _0x571d8c={};return _0x571d8c[_0x1424e1('0x2d')]=_[_0x1424e1('0x3b')](db['ServicenowAccount'][_0x1424e1('0x8a')]),_0x571d8c[_0x1424e1('0x7d')]=_[_0x1424e1('0x3b')](_0x35aab3[_0x1424e1('0x7d')]),_0x571d8c[_0x1424e1('0xa5')]=_[_0x1424e1('0x6b')](_0x571d8c[_0x1424e1('0x2d')],_0x571d8c[_0x1424e1('0x7d')]),_0x16d6d9[_0x1424e1('0x50')]=_['intersection'](_0x571d8c[_0x1424e1('0x2d')],qs['fields'](_0x35aab3[_0x1424e1('0x7d')]['fields'])),_0x16d6d9[_0x1424e1('0x50')]=_0x16d6d9['attributes'][_0x1424e1('0x41')]?_0x16d6d9[_0x1424e1('0x50')]:_0x571d8c[_0x1424e1('0x2d')],_0x35aab3[_0x1424e1('0x7d')][_0x1424e1('0x7a')]&&(_0x16d6d9['include']=[{'all':!![]}]),_0x16d6d9=_['merge']({},_0x16d6d9,_0x35aab3['options']),db[_0x1424e1('0x74')]['findOne'](_0x16d6d9)[_0x1424e1('0x58')](handleEntityNotFound(_0x360101,null))[_0x1424e1('0x58')](respondWithResult(_0x360101,null))[_0x1424e1('0x4d')](handleError(_0x360101,null));},exports[_0x271061('0x27')]=function(_0x33ab85,_0x286c5a){const _0x3ff7c7=_0x271061;return db[_0x3ff7c7('0x74')]['create'](_0x33ab85[_0x3ff7c7('0xa1')],{})['then'](respondWithResult(_0x286c5a,0xc9))[_0x3ff7c7('0x4d')](handleError(_0x286c5a,null));},exports[_0x271061('0x12')]=function(_0x35992c,_0x3844d9){const _0x3edb19=_0x271061;return _0x35992c[_0x3edb19('0xa1')]['id']&&delete _0x35992c[_0x3edb19('0xa1')]['id'],db['ServicenowAccount'][_0x3edb19('0x6a')]({'where':{'id':_0x35992c[_0x3edb19('0x6')]['id']}})[_0x3edb19('0x58')](handleEntityNotFound(_0x3844d9,null))[_0x3edb19('0x58')](saveUpdates(_0x35992c[_0x3edb19('0xa1')],null))[_0x3edb19('0x58')](respondWithResult(_0x3844d9,null))[_0x3edb19('0x4d')](handleError(_0x3844d9,null));},exports[_0x271061('0x69')]=function(_0x1b6663,_0x4ef859){const _0x30f35c=_0x271061;return db['ServicenowAccount'][_0x30f35c('0x6a')]({'where':{'id':_0x1b6663[_0x30f35c('0x6')]['id']}})[_0x30f35c('0x58')](handleEntityNotFound(_0x4ef859,null))[_0x30f35c('0x58')](removeEntity(_0x4ef859,null))[_0x30f35c('0x4d')](handleError(_0x4ef859,null));},exports[_0x271061('0x35')]=function(_0x1db662,_0x427bd){const _0x70e060=_0x271061;let _0x5e10e4={};const _0x36c4f8={};let _0x96fef6,_0x16bf72;return db[_0x70e060('0x74')][_0x70e060('0x6a')]({'where':{'id':_0x1db662['params']['id']}})[_0x70e060('0x58')](handleEntityNotFound(_0x427bd,null))[_0x70e060('0x58')](function(_0x32b2a2){const _0x3eb4ac=_0x70e060;if(_0x32b2a2)return _0x96fef6=_0x32b2a2,_0x36c4f8[_0x3eb4ac('0x2d')]=_[_0x3eb4ac('0x3b')](db[_0x3eb4ac('0x5c')][_0x3eb4ac('0x8a')]),_0x36c4f8[_0x3eb4ac('0x7d')]=_[_0x3eb4ac('0x3b')](_0x1db662[_0x3eb4ac('0x7d')]),_0x36c4f8[_0x3eb4ac('0xa5')]=_[_0x3eb4ac('0x6b')](_0x36c4f8['model'],_0x36c4f8[_0x3eb4ac('0x7d')]),_0x5e10e4[_0x3eb4ac('0x50')]=_[_0x3eb4ac('0x6b')](_0x36c4f8[_0x3eb4ac('0x2d')],qs[_0x3eb4ac('0x72')](_0x1db662[_0x3eb4ac('0x7d')]['fields'])),_0x5e10e4[_0x3eb4ac('0x50')]=_0x5e10e4[_0x3eb4ac('0x50')][_0x3eb4ac('0x41')]?_0x5e10e4[_0x3eb4ac('0x50')]:_0x36c4f8[_0x3eb4ac('0x2d')],_0x5e10e4[_0x3eb4ac('0x56')]=qs[_0x3eb4ac('0x43')](_0x1db662[_0x3eb4ac('0x7d')][_0x3eb4ac('0x43')]),_0x5e10e4[_0x3eb4ac('0x99')]=qs[_0x3eb4ac('0xa5')](_[_0x3eb4ac('0x11')](_0x1db662['query'],_0x36c4f8[_0x3eb4ac('0xa5')])),_0x1db662[_0x3eb4ac('0x7d')][_0x3eb4ac('0x1f')]&&(_0x5e10e4[_0x3eb4ac('0x99')]=_[_0x3eb4ac('0x1')](_0x5e10e4[_0x3eb4ac('0x99')],{[Op['or']]:_[_0x3eb4ac('0xd')](_0x5e10e4[_0x3eb4ac('0x50')],function(_0x383df7){const _0x5018a2=_0x3eb4ac,_0x2939c2={};return _0x2939c2[_0x383df7]={[Op[_0x5018a2('0x7b')]]:'%'+_0x1db662[_0x5018a2('0x7d')][_0x5018a2('0x1f')]+'%'},_0x2939c2;})})),_0x5e10e4=_['merge']({},_0x5e10e4,_0x1db662[_0x3eb4ac('0x8d')]),_0x96fef6[_0x3eb4ac('0x35')](_0x5e10e4);})[_0x70e060('0x58')](function(_0x13a234){const _0x4dba90=_0x70e060;if(_0x13a234)return _0x16bf72=_0x13a234[_0x4dba90('0x41')],typeof _0x1db662[_0x4dba90('0x7d')][_0x4dba90('0x81')]===_0x4dba90('0x4b')&&(_0x5e10e4[_0x4dba90('0x4c')]=qs[_0x4dba90('0x4c')](_0x1db662[_0x4dba90('0x7d')][_0x4dba90('0x4c')]),_0x5e10e4['offset']=qs[_0x4dba90('0x63')](_0x1db662['query'][_0x4dba90('0x63')])),_0x96fef6['getConfigurations'](_0x5e10e4);})['then'](function(_0x2ccb7c){if(_0x2ccb7c)return _0x2ccb7c?{'count':_0x16bf72,'rows':_0x2ccb7c}:null;})[_0x70e060('0x58')](respondWithResult(_0x427bd,null))[_0x70e060('0x4d')](handleError(_0x427bd,null));},exports[_0x271061('0x78')]=function(_0x47376e,_0x132ec8){const _0x1f6809=_0x271061;return _0x47376e[_0x1f6809('0xa1')]['id']&&delete _0x47376e[_0x1f6809('0xa1')]['id'],db[_0x1f6809('0x74')]['findOne']({'where':{'id':_0x47376e['params']['id']}})['then'](handleEntityNotFound(_0x132ec8,null))[_0x1f6809('0x58')](function(_0x3a22a6){const _0x26ddeb=_0x1f6809;if(_0x3a22a6)return _0x47376e[_0x26ddeb('0xa1')]['AccountId']=_0x3a22a6['id'],_0x47376e['body'][_0x26ddeb('0x57')]=integrations['getSubjects'](_0x47376e['body']['channel'],_0x47376e[_0x26ddeb('0xa1')][_0x26ddeb('0x7f')]),_0x47376e[_0x26ddeb('0xa1')][_0x26ddeb('0x79')]=integrations[_0x26ddeb('0x25')](_0x47376e[_0x26ddeb('0xa1')][_0x26ddeb('0x77')],_0x47376e[_0x26ddeb('0xa1')]['type']),db[_0x26ddeb('0x5c')][_0x26ddeb('0x27')](_0x47376e['body'],{'include':[{'model':db[_0x26ddeb('0x3d')],'as':_0x26ddeb('0x57')},{'model':db[_0x26ddeb('0x3d')],'as':'Descriptions'}]});return null;})[_0x1f6809('0x58')](respondWithResult(_0x132ec8,null))[_0x1f6809('0x4d')](handleError(_0x132ec8,null));},exports[_0x271061('0x75')]=function(_0x276e28,_0x2e61de){const _0x2c7b5f=_0x271061,_0x41976c=['made_sla','hold_reason',_0x2c7b5f('0x68'),_0x2c7b5f('0x60'),_0x2c7b5f('0x6c'),_0x2c7b5f('0x21'),_0x2c7b5f('0x52'),'severity',_0x2c7b5f('0x26')],_0x18a12d=[_0x2c7b5f('0x15'),_0x2c7b5f('0xa'),_0x2c7b5f('0x2b'),_0x2c7b5f('0x94'),_0x2c7b5f('0x92'),_0x2c7b5f('0x85'),'child_incidents',_0x2c7b5f('0x4'),_0x2c7b5f('0x61'),'number',_0x2c7b5f('0xb'),_0x2c7b5f('0x39'),'opened_by',_0x2c7b5f('0x91'),_0x2c7b5f('0x5'),_0x2c7b5f('0x1b'),'state',_0x2c7b5f('0x9a'),'knowledge',_0x2c7b5f('0x56'),_0x2c7b5f('0x8f'),_0x2c7b5f('0x93'),_0x2c7b5f('0x4e'),_0x2c7b5f('0x7'),_0x2c7b5f('0x44'),_0x2c7b5f('0x7c'),_0x2c7b5f('0x5e'),_0x2c7b5f('0x22'),'priority',_0x2c7b5f('0x88'),_0x2c7b5f('0x6e'),_0x2c7b5f('0x64'),_0x2c7b5f('0x2a'),_0x2c7b5f('0x62'),_0x2c7b5f('0x5a'),_0x2c7b5f('0x5d'),_0x2c7b5f('0x90'),_0x2c7b5f('0xa3'),_0x2c7b5f('0x1d'),_0x2c7b5f('0x53'),_0x2c7b5f('0x6d'),'subcategory',_0x2c7b5f('0x84'),_0x2c7b5f('0x42'),_0x2c7b5f('0x6c'),_0x2c7b5f('0x20'),_0x2c7b5f('0xa0'),_0x2c7b5f('0xf'),_0x2c7b5f('0x33'),_0x2c7b5f('0x45'),_0x2c7b5f('0x40'),_0x2c7b5f('0xa4'),_0x2c7b5f('0x2'),_0x2c7b5f('0x21'),_0x2c7b5f('0x37'),'close_notes',_0x2c7b5f('0xe'),'follow_up',_0x2c7b5f('0x4a'),_0x2c7b5f('0x3e'),'contact_type',_0x2c7b5f('0x80'),_0x2c7b5f('0x52'),'urgency',_0x2c7b5f('0x55'),_0x2c7b5f('0x5f'),_0x2c7b5f('0x6f'),'activity_due','assigned_to',_0x2c7b5f('0x10'),_0x2c7b5f('0x82'),_0x2c7b5f('0x17'),'approval','comments_and_work_notes',_0x2c7b5f('0x1c'),_0x2c7b5f('0x36'),_0x2c7b5f('0x67'),_0x2c7b5f('0x13'),'escalation',_0x2c7b5f('0x8'),_0x2c7b5f('0x24'),_0x2c7b5f('0x83'),'category'];let _0x551e95='',_0x991791='',_0x3360cb=[],_0x680e8b='',_0x4ad29e='',_0x304c45=[],_0x278616='',_0x381776='',_0x32eaba={},_0x4a2685='';return db[_0x2c7b5f('0x74')][_0x2c7b5f('0x6a')]({'where':{'id':_0x276e28[_0x2c7b5f('0x6')]['id']},'attributes':['id',_0x2c7b5f('0x29'),'password',_0x2c7b5f('0x9c'),_0x2c7b5f('0x30'),'serverUrl']})[_0x2c7b5f('0x58')](handleEntityNotFound(_0x2e61de,null))[_0x2c7b5f('0x58')](function(_0xfe9e6a){const _0x3f8352=_0x2c7b5f;if(_0xfe9e6a){_0x4a2685=_0xfe9e6a[_0x3f8352('0x30')];const _0x3b03ac=_0x4a2685[_0x3f8352('0x73')](-0x1);_0x3b03ac==='/'&&(_0x4a2685=_0x4a2685['substring'](0x0,_0x4a2685[_0x3f8352('0x0')](_0x3b03ac)));_0x381776=util[_0x3f8352('0x47')](_0x3f8352('0x9b'),_0x4a2685),_0x278616=util['format'](_0x3f8352('0x38'),_0x4a2685),_0x32eaba={'user':_0xfe9e6a[_0x3f8352('0x29')],'pass':_0xfe9e6a[_0x3f8352('0x95')]};const _0x38cb6c={'method':'GET','uri':_0x381776+_0x3f8352('0x89'),'auth':_0x32eaba,'json':!![]};return rp(_0x38cb6c);}})[_0x2c7b5f('0x58')](function(_0x2b4e31){const _0x6089a4=_0x2c7b5f;return _0x2b4e31['result']['length']>0x0&&(_0x551e95=_0x2b4e31[_0x6089a4('0x7e')]),console[_0x6089a4('0x71')](_0x6089a4('0x46'),_0x551e95),_0x304c45=[],_0x991791=Object['assign']([],_0x551e95),_[_0x6089a4('0x32')](_0x991791,function(_0x5d302b){const _0x3f5b34=_0x6089a4;return!_0x41976c[_0x3f5b34('0x4f')](_0x5d302b[_0x3f5b34('0x16')]);}),_0x991791[_0x6089a4('0x98')](function(_0x37bb22){const _0x4b9625=_0x6089a4,_0xc36cd8=createFieldObject(_0x278616,_0x32eaba,_0x37bb22[_0x4b9625('0x48')],_0x37bb22[_0x4b9625('0x16')],_0x37bb22[_0x4b9625('0x86')],![]);_0x304c45[_0x4b9625('0x18')](_0xc36cd8);}),Promise[_0x6089a4('0x66')](_0x304c45);})['then'](function(_0x5c55bc){const _0x32a6f8=_0x2c7b5f;return _0x3360cb=_0x5c55bc,_0x680e8b=Object[_0x32a6f8('0x70')]([],_0x551e95),console[_0x32a6f8('0x71')](_0x32a6f8('0x9'),_0x551e95),_[_0x32a6f8('0x32')](_0x680e8b,function(_0x220d8e){return _0x18a12d['includes'](_0x220d8e['name']);}),console[_0x32a6f8('0x71')](_0x32a6f8('0x8e'),_0x680e8b),_0x304c45=[],_0x680e8b['forEach'](function(_0x5f5528){const _0x9667c5=_0x32a6f8,_0x129e5c=createFieldObject(_0x278616,_0x32eaba,_0x5f5528[_0x9667c5('0x48')],_0x5f5528[_0x9667c5('0x16')],_0x5f5528[_0x9667c5('0x86')],!![]);_0x304c45[_0x9667c5('0x18')](_0x129e5c);}),Promise[_0x32a6f8('0x66')](_0x304c45);})['then'](function(_0x152f5c){const _0x1343c9=_0x2c7b5f;_0x4ad29e=_0x152f5c;const _0x418ee1=_0x3360cb[_0x1343c9('0x8c')](_0x4ad29e);return{'count':_0x418ee1['length'],'rows':_0x418ee1};})[_0x2c7b5f('0x58')](respondWithResult(_0x2e61de,null))[_0x2c7b5f('0x4d')](function(_0x425c52){const _0x17da5c=_0x2c7b5f;console[_0x17da5c('0x71')]('ServiceNow\x20error:\x20'+_0x425c52);let _0x308f65=_0x276e28[_0x17da5c('0x7d')][_0x17da5c('0xc')]?0x1f4:_0x425c52[_0x17da5c('0x54')]||0x1f4;logger[_0x17da5c('0x23')](_0x425c52[_0x17da5c('0x5b')]),delete _0x425c52[_0x17da5c('0x16')],_0x308f65===0x191&&(_0x308f65=0x190),_0x2e61de[_0x17da5c('0x9f')](_0x308f65)[_0x17da5c('0x76')](_0x276e28[_0x17da5c('0x7d')][_0x17da5c('0xc')]?{'message':_0x17da5c('0xa2'),'statusCode':_0x425c52[_0x17da5c('0x54')]}:_0x425c52);});};function createFieldObject(_0x120757,_0x121b76,_0x4c995e,_0x4d2823,_0x527870,_0x262cef){return new Promise(function(_0x275226){const _0x4f8c75=a294_0x4e25,_0x2bc13d={'id':_0x4d2823,'name':_0x527870,'custom':_0x262cef};if(_0x4c995e===_0x4f8c75('0x97'))_0x2bc13d[_0x4f8c75('0x8d')]=[{'name':'True','value':_0x4f8c75('0x59')},{'name':_0x4f8c75('0x2c'),'value':_0x4f8c75('0xa6')}],_0x275226(_0x2bc13d);else{const _0x30c1fc={'method':'GET','uri':_0x120757+'sys_choice?sysparm_query=name=incident^element='+_0x4d2823,'auth':_0x121b76,'json':!![]};return rp(_0x30c1fc)['then'](function(_0x3dd8a7){const _0x3f096c=_0x4f8c75,_0x17b283=[];_0x3dd8a7[_0x3f096c('0x7e')][_0x3f096c('0x41')]>0x0&&_0x3dd8a7[_0x3f096c('0x7e')][_0x3f096c('0x98')](function(_0x18be22){const _0x2d9d3a=_0x3f096c;if(_0x18be22[_0x2d9d3a('0x3c')]===_0x2d9d3a('0xa6')){const _0x5f1431={'name':_0x18be22[_0x2d9d3a('0x86')],'value':_0x18be22[_0x2d9d3a('0x1e')]};_0x17b283[_0x2d9d3a('0x18')](_0x5f1431);}}),_0x2bc13d[_0x3f096c('0x8d')]=_0x17b283,_0x2bc13d[_0x3f096c('0x8d')][_0x3f096c('0x41')]>0x0?_0x275226(_0x2bc13d):_0x262cef==![]?_0x275226():_0x275226(_0x2bc13d);});}});}
\ No newline at end of file
+const a294_0x3529=['push','true','parent','params','close_notes','sys_updated_on','result','includes','caused_by','user_input','then','escalation','sys_tags','fields','incident\x20table\x20objects','options','assigned_to','sendStatus','ServicenowAccount','due_date','impact','work_end','Descriptions','sys_id','correlation_id','forEach','reopened_time','ServicenowField','contact_type','resolved_at','parent_incident','comments','active','body','concat','label','caller_id','upon_approval','findOne','upon_reject','approval_history','child_incidents','follow_up','pick','resolved_by','inactive','activity_due','query','show','closed_by','delivery_plan','catch','statusCode','notify','Wrong\x20credentials','closed_at','correlation_display','Subjects','key','update','comments_and_work_notes','type','work_start','create','attributes','nolimit','format','index','stack','where','sort','sys_mod_count','knowledge','expected_start','boolean','work_notes_list','VIRTUAL','map','additional_assignee_list','../../components/parsers/qs','lodash','business_duration','undefined','getSubjects','order','getFields','incident?sysparm_display_value=all','hold_reason','sys_created_on','assign','username','length','false','password','../../mysqldb','json','internalType','count','model','api','include','rawAttributes','filters','send','findAll','False','test','incident_state','made_sla','close_code','cmdb_ci','business_service','log','rfc','remove','Content-Range','business_stc','state','like','sys_class_name','GET','offset','sequelize','error','getConfigurations','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','opened_by','util','TCL:\x20_object','approval_set','limit','calendar_stc','../../config/logger','lastIndexOf','status','group_list','filter','intersection','includeAll','sys_choice?sysparm_query=name=incident^element=','severity','name','category','keys','subcategory','delivery_task','getDescriptions','all','%s/api/now/table/','True','merge','sys_domain_path','destroy'];(function(_0x1a8b6e,_0x35295b){const _0x2c4dda=function(_0x51d7f7){while(--_0x51d7f7){_0x1a8b6e['push'](_0x1a8b6e['shift']());}};_0x2c4dda(++_0x35295b);}(a294_0x3529,0x166));const a294_0x2c4d=function(_0x1a8b6e,_0x35295b){_0x1a8b6e=_0x1a8b6e-0x0;let _0x2c4dda=a294_0x3529[_0x1a8b6e];return _0x2c4dda;};const _0x1c473f=a294_0x2c4d;'use strict';const rp=require('request-promise-native'),util=require(_0x1c473f('0x4b')),_=require(_0x1c473f('0x1c')),qs=require(_0x1c473f('0x1b')),logger=require(_0x1c473f('0x50'))(_0x1c473f('0x2f')),db=require(_0x1c473f('0x2a'))['db'],{Op}=require(_0x1c473f('0x46')),integrations=require('../../components/integrations/configuration');function respondWithResult(_0x51d7f7,_0x397961){return _0x397961=_0x397961||0xc8,function(_0x47e584){const _0x4de6de=a294_0x2c4d;if(_0x47e584)return _0x51d7f7[_0x4de6de('0x52')](_0x397961)[_0x4de6de('0x2b')](_0x47e584);};}function respondWithFilteredResult(_0xdae419,_0x598d68){return function(_0x5e738c){const _0x3bd244=a294_0x2c4d;if(_0x5e738c){const _0x116f74=_0x5e738c[_0x3bd244('0x2d')],_0x1f0960=_0x598d68[_0x3bd244('0x45')];let _0x267d17=_0x598d68['offset']+_0x598d68[_0x3bd244('0x4e')],_0x35d527;return _0x267d17>=_0x116f74?(_0x267d17=_0x116f74,_0x35d527=0xc8):_0x35d527=0xce,_0xdae419[_0x3bd244('0x52')](_0x35d527),_0xdae419['set'](_0x3bd244('0x3f'),_0x1f0960+'-'+_0x267d17+'/'+_0x116f74)[_0x3bd244('0x2b')](_0x5e738c);}return null;};}function saveUpdates(_0xf8fa85){return function(_0x2b9dc3){const _0x545cb9=a294_0x2c4d;if(_0x2b9dc3)return _0x2b9dc3['update'](_0xf8fa85)[_0x545cb9('0x6f')](function(_0x2481ec){return _0x2481ec;});return null;};}function removeEntity(_0x3bcf71){return function(_0x10310e){const _0x5e0081=a294_0x2c4d;if(_0x10310e)return _0x10310e['destroy']()[_0x5e0081('0x6f')](function(){const _0xa1a8fd=_0x5e0081;_0x3bcf71[_0xa1a8fd('0x52')](0xcc)['end']();});};}function handleEntityNotFound(_0x16158f){return function(_0x2ec0ca){const _0xa847b3=a294_0x2c4d;return!_0x2ec0ca&&_0x16158f[_0xa847b3('0x76')](0x194),_0x2ec0ca;};}function handleError(_0x243a5a,_0x541278){return _0x541278=_0x541278||0x1f4,function(_0x88988d){const _0x5cdeb4=a294_0x2c4d;logger[_0x5cdeb4('0x47')](_0x88988d[_0x5cdeb4('0x10')]),_0x88988d['name']&&delete _0x88988d[_0x5cdeb4('0x59')],_0x243a5a[_0x5cdeb4('0x52')](_0x541278)[_0x5cdeb4('0x33')](_0x88988d);};}exports[_0x1c473f('0xf')]=function(_0x401169,_0x32db8a){const _0x23eb2b=_0x1c473f;let _0x291a2f={};const _0x5adba1={},_0x508b0e={'count':0x0,'rows':[]},_0x238f87=_[_0x23eb2b('0x19')](db[_0x23eb2b('0x77')][_0x23eb2b('0x31')],function(_0x4eeb9e){const _0x453230=_0x23eb2b;return{'name':_0x4eeb9e['fieldName'],'type':_0x4eeb9e[_0x453230('0x9')][_0x453230('0x6')]};});_0x5adba1[_0x23eb2b('0x2e')]=_[_0x23eb2b('0x19')](_0x238f87,_0x23eb2b('0x59')),_0x5adba1[_0x23eb2b('0x94')]=_[_0x23eb2b('0x5b')](_0x401169[_0x23eb2b('0x94')]),_0x5adba1[_0x23eb2b('0x32')]=_[_0x23eb2b('0x55')](_0x5adba1[_0x23eb2b('0x2e')],_0x5adba1['query']),_0x291a2f['attributes']=_['intersection'](_0x5adba1[_0x23eb2b('0x2e')],qs[_0x23eb2b('0x72')](_0x401169[_0x23eb2b('0x94')]['fields'])),_0x291a2f[_0x23eb2b('0xc')]=_0x291a2f[_0x23eb2b('0xc')][_0x23eb2b('0x27')]?_0x291a2f[_0x23eb2b('0xc')]:_0x5adba1['model'];typeof _0x401169[_0x23eb2b('0x94')][_0x23eb2b('0xd')]===_0x23eb2b('0x1e')&&(_0x291a2f[_0x23eb2b('0x4e')]=qs['limit'](_0x401169[_0x23eb2b('0x94')]['limit']),_0x291a2f[_0x23eb2b('0x45')]=qs[_0x23eb2b('0x45')](_0x401169[_0x23eb2b('0x94')][_0x23eb2b('0x45')]));_0x291a2f[_0x23eb2b('0x20')]=qs[_0x23eb2b('0x12')](_0x401169[_0x23eb2b('0x94')][_0x23eb2b('0x12')]),_0x291a2f[_0x23eb2b('0x11')]=qs[_0x23eb2b('0x32')](_[_0x23eb2b('0x90')](_0x401169[_0x23eb2b('0x94')],_0x5adba1[_0x23eb2b('0x32')]),_0x238f87);_0x401169['query']['filter']&&(_0x291a2f[_0x23eb2b('0x11')]=_[_0x23eb2b('0x62')](_0x291a2f['where'],{[Op['or']]:_[_0x23eb2b('0x19')](_0x238f87,function(_0x5b69dc){const _0x3c2801=_0x23eb2b;if(_0x5b69dc['type']!==_0x3c2801('0x18')){const _0x1a02e9={};return _0x1a02e9[_0x5b69dc[_0x3c2801('0x59')]]={[Op[_0x3c2801('0x42')]]:'%'+_0x401169[_0x3c2801('0x94')]['filter']+'%'},_0x1a02e9;}})}));_0x291a2f=_[_0x23eb2b('0x62')]({},_0x291a2f,_0x401169[_0x23eb2b('0x74')]);const _0x45216f={'where':_0x291a2f[_0x23eb2b('0x11')]};return db[_0x23eb2b('0x77')][_0x23eb2b('0x2d')](_0x45216f)[_0x23eb2b('0x6f')](function(_0x14a9d7){const _0x2c90e4=_0x23eb2b;return _0x508b0e[_0x2c90e4('0x2d')]=_0x14a9d7,_0x401169[_0x2c90e4('0x94')][_0x2c90e4('0x56')]&&(_0x291a2f[_0x2c90e4('0x30')]=[{'all':!![]}]),db['ServicenowAccount'][_0x2c90e4('0x34')](_0x291a2f);})['then'](function(_0x35cd92){return _0x508b0e['rows']=_0x35cd92,_0x508b0e;})['then'](respondWithFilteredResult(_0x32db8a,_0x291a2f))[_0x23eb2b('0x98')](handleError(_0x32db8a,null));},exports[_0x1c473f('0x95')]=function(_0x177d90,_0x3c2799){const _0x3f1fe0=_0x1c473f;let _0x3d66e6={'raw':![],'where':{'id':_0x177d90[_0x3f1fe0('0x68')]['id']}};const _0x59f43a={};return _0x59f43a[_0x3f1fe0('0x2e')]=_['keys'](db['ServicenowAccount'][_0x3f1fe0('0x31')]),_0x59f43a['query']=_['keys'](_0x177d90['query']),_0x59f43a[_0x3f1fe0('0x32')]=_['intersection'](_0x59f43a[_0x3f1fe0('0x2e')],_0x59f43a[_0x3f1fe0('0x94')]),_0x3d66e6[_0x3f1fe0('0xc')]=_[_0x3f1fe0('0x55')](_0x59f43a['model'],qs[_0x3f1fe0('0x72')](_0x177d90['query'][_0x3f1fe0('0x72')])),_0x3d66e6[_0x3f1fe0('0xc')]=_0x3d66e6[_0x3f1fe0('0xc')][_0x3f1fe0('0x27')]?_0x3d66e6[_0x3f1fe0('0xc')]:_0x59f43a[_0x3f1fe0('0x2e')],_0x177d90[_0x3f1fe0('0x94')]['includeAll']&&(_0x3d66e6['include']=[{'all':!![]}]),_0x3d66e6=_['merge']({},_0x3d66e6,_0x177d90[_0x3f1fe0('0x74')]),db[_0x3f1fe0('0x77')][_0x3f1fe0('0x8b')](_0x3d66e6)[_0x3f1fe0('0x6f')](handleEntityNotFound(_0x3c2799,null))[_0x3f1fe0('0x6f')](respondWithResult(_0x3c2799,null))['catch'](handleError(_0x3c2799,null));},exports['create']=function(_0x4fd82b,_0x27e653){const _0x550c28=_0x1c473f;return db[_0x550c28('0x77')][_0x550c28('0xb')](_0x4fd82b['body'],{})[_0x550c28('0x6f')](respondWithResult(_0x27e653,0xc9))[_0x550c28('0x98')](handleError(_0x27e653,null));},exports[_0x1c473f('0x7')]=function(_0x5118f9,_0x394149){const _0x46ea53=_0x1c473f;return _0x5118f9[_0x46ea53('0x86')]['id']&&delete _0x5118f9[_0x46ea53('0x86')]['id'],db['ServicenowAccount']['findOne']({'where':{'id':_0x5118f9[_0x46ea53('0x68')]['id']}})[_0x46ea53('0x6f')](handleEntityNotFound(_0x394149,null))['then'](saveUpdates(_0x5118f9[_0x46ea53('0x86')],null))[_0x46ea53('0x6f')](respondWithResult(_0x394149,null))[_0x46ea53('0x98')](handleError(_0x394149,null));},exports[_0x1c473f('0x64')]=function(_0x29fa18,_0x34b4a4){const _0xa84f8e=_0x1c473f;return db[_0xa84f8e('0x77')][_0xa84f8e('0x8b')]({'where':{'id':_0x29fa18[_0xa84f8e('0x68')]['id']}})['then'](handleEntityNotFound(_0x34b4a4,null))['then'](removeEntity(_0x34b4a4,null))[_0xa84f8e('0x98')](handleError(_0x34b4a4,null));},exports['getConfigurations']=function(_0xc4750d,_0x867245){const _0x4ee9b9=_0x1c473f;let _0x1971da={};const _0xfdda82={};let _0x5a1d77,_0x36ec09;return db['ServicenowAccount'][_0x4ee9b9('0x8b')]({'where':{'id':_0xc4750d[_0x4ee9b9('0x68')]['id']}})[_0x4ee9b9('0x6f')](handleEntityNotFound(_0x867245,null))[_0x4ee9b9('0x6f')](function(_0x44b6e8){const _0x6a72ca=_0x4ee9b9;if(_0x44b6e8)return _0x5a1d77=_0x44b6e8,_0xfdda82[_0x6a72ca('0x2e')]=_[_0x6a72ca('0x5b')](db['ServicenowConfiguration'][_0x6a72ca('0x31')]),_0xfdda82[_0x6a72ca('0x94')]=_['keys'](_0xc4750d[_0x6a72ca('0x94')]),_0xfdda82[_0x6a72ca('0x32')]=_[_0x6a72ca('0x55')](_0xfdda82[_0x6a72ca('0x2e')],_0xfdda82[_0x6a72ca('0x94')]),_0x1971da[_0x6a72ca('0xc')]=_[_0x6a72ca('0x55')](_0xfdda82[_0x6a72ca('0x2e')],qs['fields'](_0xc4750d[_0x6a72ca('0x94')][_0x6a72ca('0x72')])),_0x1971da[_0x6a72ca('0xc')]=_0x1971da[_0x6a72ca('0xc')]['length']?_0x1971da[_0x6a72ca('0xc')]:_0xfdda82[_0x6a72ca('0x2e')],_0x1971da[_0x6a72ca('0x20')]=qs[_0x6a72ca('0x12')](_0xc4750d[_0x6a72ca('0x94')]['sort']),_0x1971da[_0x6a72ca('0x11')]=qs['filters'](_[_0x6a72ca('0x90')](_0xc4750d['query'],_0xfdda82[_0x6a72ca('0x32')])),_0xc4750d[_0x6a72ca('0x94')][_0x6a72ca('0x54')]&&(_0x1971da[_0x6a72ca('0x11')]=_['merge'](_0x1971da['where'],{[Op['or']]:_[_0x6a72ca('0x19')](_0x1971da[_0x6a72ca('0xc')],function(_0x4173d3){const _0x394e2d=_0x6a72ca,_0xe4f5c0={};return _0xe4f5c0[_0x4173d3]={[Op['like']]:'%'+_0xc4750d[_0x394e2d('0x94')][_0x394e2d('0x54')]+'%'},_0xe4f5c0;})})),_0x1971da=_[_0x6a72ca('0x62')]({},_0x1971da,_0xc4750d['options']),_0x5a1d77[_0x6a72ca('0x48')](_0x1971da);})[_0x4ee9b9('0x6f')](function(_0x56108f){const _0x346a54=_0x4ee9b9;if(_0x56108f)return _0x36ec09=_0x56108f['length'],typeof _0xc4750d[_0x346a54('0x94')][_0x346a54('0xd')]===_0x346a54('0x1e')&&(_0x1971da[_0x346a54('0x4e')]=qs[_0x346a54('0x4e')](_0xc4750d[_0x346a54('0x94')][_0x346a54('0x4e')]),_0x1971da[_0x346a54('0x45')]=qs[_0x346a54('0x45')](_0xc4750d['query']['offset'])),_0x5a1d77[_0x346a54('0x48')](_0x1971da);})[_0x4ee9b9('0x6f')](function(_0x23ee63){if(_0x23ee63)return _0x23ee63?{'count':_0x36ec09,'rows':_0x23ee63}:null;})[_0x4ee9b9('0x6f')](respondWithResult(_0x867245,null))[_0x4ee9b9('0x98')](handleError(_0x867245,null));},exports['addConfiguration']=function(_0x1069af,_0x6a64f2){const _0x4e5732=_0x1c473f;return _0x1069af[_0x4e5732('0x86')]['id']&&delete _0x1069af[_0x4e5732('0x86')]['id'],db[_0x4e5732('0x77')]['findOne']({'where':{'id':_0x1069af[_0x4e5732('0x68')]['id']}})['then'](handleEntityNotFound(_0x6a64f2,null))[_0x4e5732('0x6f')](function(_0x18fbdb){const _0x43acc6=_0x4e5732;if(_0x18fbdb)return _0x1069af[_0x43acc6('0x86')]['AccountId']=_0x18fbdb['id'],_0x1069af['body']['Subjects']=integrations[_0x43acc6('0x1f')](_0x1069af[_0x43acc6('0x86')]['channel'],_0x1069af['body'][_0x43acc6('0x9')]),_0x1069af[_0x43acc6('0x86')][_0x43acc6('0x7b')]=integrations[_0x43acc6('0x5e')](_0x1069af[_0x43acc6('0x86')]['channel'],_0x1069af[_0x43acc6('0x86')][_0x43acc6('0x9')]),db['ServicenowConfiguration'][_0x43acc6('0xb')](_0x1069af[_0x43acc6('0x86')],{'include':[{'model':db[_0x43acc6('0x80')],'as':_0x43acc6('0x5')},{'model':db[_0x43acc6('0x80')],'as':'Descriptions'}]});return null;})[_0x4e5732('0x6f')](respondWithResult(_0x6a64f2,null))[_0x4e5732('0x98')](handleError(_0x6a64f2,null));},exports[_0x1c473f('0x21')]=function(_0x2ffa03,_0x50b535){const _0x12c6a8=_0x1c473f,_0x59ffb0=[_0x12c6a8('0x38'),_0x12c6a8('0x23'),_0x12c6a8('0x14'),_0x12c6a8('0x5c'),_0x12c6a8('0x39'),_0x12c6a8('0x1'),_0x12c6a8('0x37'),_0x12c6a8('0x58'),_0x12c6a8('0x5a')],_0x4fca38=[_0x12c6a8('0x67'),_0x12c6a8('0x38'),_0x12c6a8('0x6d'),'watch_list',_0x12c6a8('0x8c'),_0x12c6a8('0x6a'),_0x12c6a8('0x8e'),_0x12c6a8('0x23'),_0x12c6a8('0x8d'),'number',_0x12c6a8('0x91'),'sys_updated_by',_0x12c6a8('0x4a'),_0x12c6a8('0x6e'),_0x12c6a8('0x24'),'sys_domain',_0x12c6a8('0x41'),'sys_created_by',_0x12c6a8('0x14'),'order',_0x12c6a8('0x4f'),_0x12c6a8('0x3'),_0x12c6a8('0x3a'),_0x12c6a8('0x97'),_0x12c6a8('0x79'),_0x12c6a8('0x85'),_0x12c6a8('0x17'),_0x12c6a8('0x3b'),'priority',_0x12c6a8('0x63'),_0x12c6a8('0x3d'),'time_worked',_0x12c6a8('0x15'),'opened_at',_0x12c6a8('0x1d'),_0x12c6a8('0x53'),_0x12c6a8('0x7a'),_0x12c6a8('0x7f'),_0x12c6a8('0x82'),_0x12c6a8('0x89'),_0x12c6a8('0x4d'),_0x12c6a8('0x5c'),'work_notes','short_description',_0x12c6a8('0x39'),_0x12c6a8('0x4'),_0x12c6a8('0x5d'),_0x12c6a8('0xa'),'assignment_group',_0x12c6a8('0x40'),_0x12c6a8('0x1a'),'description','calendar_duration',_0x12c6a8('0x1'),_0x12c6a8('0x43'),_0x12c6a8('0x69'),_0x12c6a8('0x96'),_0x12c6a8('0x8f'),_0x12c6a8('0x83'),_0x12c6a8('0x7c'),_0x12c6a8('0x81'),'reopened_by',_0x12c6a8('0x37'),'urgency','problem_id','company','reassignment_count',_0x12c6a8('0x93'),_0x12c6a8('0x75'),_0x12c6a8('0x58'),_0x12c6a8('0x84'),'sla_due','approval',_0x12c6a8('0x8'),_0x12c6a8('0x78'),_0x12c6a8('0x13'),'reopen_count',_0x12c6a8('0x71'),_0x12c6a8('0x70'),_0x12c6a8('0x8a'),_0x12c6a8('0x7d'),'location',_0x12c6a8('0x5a')];let _0x2846c3='',_0x5a8c49='',_0x10f86f=[],_0x20d928='',_0x4b7df8='',_0x59035f=[],_0x1836fc='',_0x3a3abd='',_0x1d81d5={},_0x5ed8be='';return db[_0x12c6a8('0x77')][_0x12c6a8('0x8b')]({'where':{'id':_0x2ffa03[_0x12c6a8('0x68')]['id']},'attributes':['id',_0x12c6a8('0x26'),_0x12c6a8('0x29'),'email','remoteUri','serverUrl']})[_0x12c6a8('0x6f')](handleEntityNotFound(_0x50b535,null))[_0x12c6a8('0x6f')](function(_0x288c1c){const _0x4a83a4=_0x12c6a8;if(_0x288c1c){_0x5ed8be=_0x288c1c['remoteUri'];const _0x4c11b7=_0x5ed8be['slice'](-0x1);_0x4c11b7==='/'&&(_0x5ed8be=_0x5ed8be['substring'](0x0,_0x5ed8be[_0x4a83a4('0x51')](_0x4c11b7)));_0x3a3abd=util[_0x4a83a4('0xe')]('%s/api/now/doc/table/schema/',_0x5ed8be),_0x1836fc=util[_0x4a83a4('0xe')](_0x4a83a4('0x60'),_0x5ed8be),_0x1d81d5={'user':_0x288c1c[_0x4a83a4('0x26')],'pass':_0x288c1c[_0x4a83a4('0x29')]};const _0x4e7b5f={'method':_0x4a83a4('0x44'),'uri':_0x3a3abd+_0x4a83a4('0x22'),'auth':_0x1d81d5,'json':!![]};return rp(_0x4e7b5f);}})['then'](function(_0x76d18c){const _0x2cbd98=_0x12c6a8;return _0x76d18c[_0x2cbd98('0x6b')][_0x2cbd98('0x27')]>0x0&&(_0x2846c3=_0x76d18c[_0x2cbd98('0x6b')]),console[_0x2cbd98('0x3c')](_0x2cbd98('0x73'),_0x2846c3),_0x59035f=[],_0x5a8c49=Object[_0x2cbd98('0x25')]([],_0x2846c3),_[_0x2cbd98('0x3e')](_0x5a8c49,function(_0x516fba){const _0xaf1667=_0x2cbd98;return!_0x59ffb0[_0xaf1667('0x6c')](_0x516fba[_0xaf1667('0x59')]);}),_0x5a8c49[_0x2cbd98('0x7e')](function(_0x401854){const _0x2cbf90=_0x2cbd98,_0x58131c=createFieldObject(_0x1836fc,_0x1d81d5,_0x401854[_0x2cbf90('0x2c')],_0x401854['name'],_0x401854[_0x2cbf90('0x88')],![]);_0x59035f[_0x2cbf90('0x65')](_0x58131c);}),Promise[_0x2cbd98('0x5f')](_0x59035f);})['then'](function(_0xd1ad4c){const _0x288f91=_0x12c6a8;return _0x10f86f=_0xd1ad4c,_0x20d928=Object[_0x288f91('0x25')]([],_0x2846c3),console[_0x288f91('0x3c')](_0x288f91('0x4c'),_0x2846c3),_['remove'](_0x20d928,function(_0x4732f6){const _0xdbd307=_0x288f91;return _0x4fca38[_0xdbd307('0x6c')](_0x4732f6[_0xdbd307('0x59')]);}),console[_0x288f91('0x3c')](_0x288f91('0x49'),_0x20d928),_0x59035f=[],_0x20d928[_0x288f91('0x7e')](function(_0x37c0b6){const _0x409cea=_0x288f91,_0x491468=createFieldObject(_0x1836fc,_0x1d81d5,_0x37c0b6['internalType'],_0x37c0b6[_0x409cea('0x59')],_0x37c0b6['label'],!![]);_0x59035f[_0x409cea('0x65')](_0x491468);}),Promise[_0x288f91('0x5f')](_0x59035f);})[_0x12c6a8('0x6f')](function(_0x22884a){const _0x15a5f8=_0x12c6a8;_0x4b7df8=_0x22884a;const _0x278f8e=_0x10f86f[_0x15a5f8('0x87')](_0x4b7df8);return{'count':_0x278f8e[_0x15a5f8('0x27')],'rows':_0x278f8e};})[_0x12c6a8('0x6f')](respondWithResult(_0x50b535,null))['catch'](function(_0x5a09b7){const _0x579bea=_0x12c6a8;console[_0x579bea('0x3c')]('ServiceNow\x20error:\x20'+_0x5a09b7);let _0x440915=_0x2ffa03['query'][_0x579bea('0x36')]?0x1f4:_0x5a09b7['statusCode']||0x1f4;logger[_0x579bea('0x47')](_0x5a09b7[_0x579bea('0x10')]),delete _0x5a09b7[_0x579bea('0x59')],_0x440915===0x191&&(_0x440915=0x190),_0x50b535[_0x579bea('0x52')](_0x440915)[_0x579bea('0x33')](_0x2ffa03[_0x579bea('0x94')][_0x579bea('0x36')]?{'message':_0x579bea('0x2'),'statusCode':_0x5a09b7[_0x579bea('0x0')]}:_0x5a09b7);});};function createFieldObject(_0x34eb67,_0x2cc98a,_0x2f0538,_0x3aaf7a,_0x3ff64f,_0x410b4b){return new Promise(function(_0x577474){const _0x4490e5=a294_0x2c4d,_0x114fe5={'id':_0x3aaf7a,'name':_0x3ff64f,'custom':_0x410b4b};if(_0x2f0538===_0x4490e5('0x16'))_0x114fe5[_0x4490e5('0x74')]=[{'name':_0x4490e5('0x61'),'value':_0x4490e5('0x66')},{'name':_0x4490e5('0x35'),'value':_0x4490e5('0x28')}],_0x577474(_0x114fe5);else{const _0x1d7772={'method':_0x4490e5('0x44'),'uri':_0x34eb67+_0x4490e5('0x57')+_0x3aaf7a,'auth':_0x2cc98a,'json':!![]};return rp(_0x1d7772)['then'](function(_0x3dc88a){const _0x2dbcb4=_0x4490e5,_0x2c9894=[];_0x3dc88a[_0x2dbcb4('0x6b')]['length']>0x0&&_0x3dc88a[_0x2dbcb4('0x6b')]['forEach'](function(_0x4fadd4){const _0xd6af20=_0x2dbcb4;if(_0x4fadd4[_0xd6af20('0x92')]===_0xd6af20('0x28')){const _0x348228={'name':_0x4fadd4[_0xd6af20('0x88')],'value':_0x4fadd4['value']};_0x2c9894[_0xd6af20('0x65')](_0x348228);}}),_0x114fe5[_0x2dbcb4('0x74')]=_0x2c9894,_0x114fe5[_0x2dbcb4('0x74')][_0x2dbcb4('0x27')]>0x0?_0x577474(_0x114fe5):_0x410b4b==![]?_0x577474():_0x577474(_0x114fe5);});}});}
\ No newline at end of file