c5cc4de14488a3e66b6c3fbb9db17ea75e996c52
[motion-next.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
1 const a294_0x1192=['then','VIRTUAL','request-promise-native','caller_id','send','map','GET','problem_id','business_service','watch_list','assignment_group','assign','findAll','label','resolved_at','ServicenowConfiguration','statusCode','work_end','getSubjects','catch','type','include','opened_by','cmdb_ci','made_sla','forEach','severity','intersection','sys_mod_count','location','expected_start','close_notes','undefined','sys_id','ServicenowAccount','stack','rawAttributes','closed_by','limit','opened_at','findOne','company','sys_updated_on','work_start','reopened_by','set','lastIndexOf','correlation_display','log','count','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','delivery_plan','slice','fieldName','format','create','destroy','nolimit','filter','username','comments','substring','concat','approval_history','user_input','false','reopen_count','util','approval_set','sort','body','rfc','order','reassignment_count','ServicenowField','serverUrl','sys_domain_path','../../mysqldb','rows','internalType','due_date','email','parent_incident','upon_approval','caused_by','getConfigurations','Wrong\x20credentials','reopened_time','subcategory','fields','getDescriptions','close_code','value','False','update','business_stc','keys','includeAll','sys_domain','additional_assignee_list','calendar_stc','urgency','calendar_duration','model','inactive','sla_due','remoteUri','all','json','show','sys_updated_by','channel','query','TCL:\x20_object','approval','name','knowledge','end','delivery_task','sys_created_on','sendStatus','length','lodash','upon_reject','AccountId','incident_state','attributes','password','remove','index','pick','notify','resolved_by','test','active','Content-Range','offset','number','addConfiguration','params','Descriptions','merge','escalation','hold_reason','push','Subjects','%s/api/now/table/','error','api','where','../../components/parsers/qs','like','incident\x20table\x20objects','result','../../components/integrations/configuration','assigned_to','boolean','category','child_incidents','options','status','work_notes_list','impact','short_description','filters','group_list','sequelize','follow_up','sys_tags','includes'];(function(_0x54b275,_0x1192b4){const _0x31af13=function(_0x1df992){while(--_0x1df992){_0x54b275['push'](_0x54b275['shift']());}};_0x31af13(++_0x1192b4);}(a294_0x1192,0x174));const a294_0x31af=function(_0x54b275,_0x1192b4){_0x54b275=_0x54b275-0x0;let _0x31af13=a294_0x1192[_0x54b275];return _0x31af13;};const _0x5625e5=a294_0x31af;'use strict';const rp=require(_0x5625e5('0x8c')),util=require(_0x5625e5('0x23')),_=require(_0x5625e5('0x5a')),qs=require(_0x5625e5('0x76')),logger=require('../../config/logger')(_0x5625e5('0x74')),db=require(_0x5625e5('0x2d'))['db'],{Op}=require(_0x5625e5('0x86')),integrations=require(_0x5625e5('0x7a'));function respondWithResult(_0x1df992,_0x172978){return _0x172978=_0x172978||0xc8,function(_0x310e49){const _0x1b138f=a294_0x31af;if(_0x310e49)return _0x1df992[_0x1b138f('0x80')](_0x172978)[_0x1b138f('0x4c')](_0x310e49);};}function respondWithFilteredResult(_0x49f3d8,_0x4d1bb8){return function(_0x105424){const _0x5c8f20=a294_0x31af;if(_0x105424){const _0x2d6e60=_0x105424[_0x5c8f20('0x11')],_0x315891=_0x4d1bb8[_0x5c8f20('0x68')];let _0x12fb05=_0x4d1bb8[_0x5c8f20('0x68')]+_0x4d1bb8[_0x5c8f20('0x6')],_0x3fa803;return _0x12fb05>=_0x2d6e60?(_0x12fb05=_0x2d6e60,_0x3fa803=0xc8):_0x3fa803=0xce,_0x49f3d8[_0x5c8f20('0x80')](_0x3fa803),_0x49f3d8[_0x5c8f20('0xd')](_0x5c8f20('0x67'),_0x315891+'-'+_0x12fb05+'/'+_0x2d6e60)['json'](_0x105424);}return null;};}function saveUpdates(_0x103a25){return function(_0x3e1d9e){const _0x16c04c=a294_0x31af;if(_0x3e1d9e)return _0x3e1d9e[_0x16c04c('0x3e')](_0x103a25)[_0x16c04c('0x8a')](function(_0x44c0f5){return _0x44c0f5;});return null;};}function removeEntity(_0x56a94a){return function(_0x26b42c){const _0x4c11ef=a294_0x31af;if(_0x26b42c)return _0x26b42c[_0x4c11ef('0x18')]()[_0x4c11ef('0x8a')](function(){const _0x3e73e2=_0x4c11ef;_0x56a94a[_0x3e73e2('0x80')](0xcc)[_0x3e73e2('0x55')]();});};}function handleEntityNotFound(_0x39bbd0){return function(_0x287bb6){const _0xb7d3ce=a294_0x31af;return!_0x287bb6&&_0x39bbd0[_0xb7d3ce('0x58')](0x194),_0x287bb6;};}function handleError(_0x538c90,_0x105b57){return _0x105b57=_0x105b57||0x1f4,function(_0x2550a8){const _0x33c3fc=a294_0x31af;logger[_0x33c3fc('0x73')](_0x2550a8[_0x33c3fc('0x3')]),_0x2550a8['name']&&delete _0x2550a8[_0x33c3fc('0x53')],_0x538c90[_0x33c3fc('0x80')](_0x105b57)[_0x33c3fc('0x8e')](_0x2550a8);};}exports[_0x5625e5('0x61')]=function(_0x226aae,_0x135e45){const _0x55cf1f=_0x5625e5;let _0x304475={};const _0x481033={},_0x29e5d0={'count':0x0,'rows':[]},_0x2b9fd8=_[_0x55cf1f('0x8f')](db[_0x55cf1f('0x2')][_0x55cf1f('0x4')],function(_0x41b66a){const _0x302573=_0x55cf1f;return{'name':_0x41b66a[_0x302573('0x15')],'type':_0x41b66a[_0x302573('0x9e')]['key']};});_0x481033['model']=_[_0x55cf1f('0x8f')](_0x2b9fd8,'name'),_0x481033[_0x55cf1f('0x50')]=_['keys'](_0x226aae[_0x55cf1f('0x50')]),_0x481033[_0x55cf1f('0x84')]=_['intersection'](_0x481033[_0x55cf1f('0x47')],_0x481033[_0x55cf1f('0x50')]),_0x304475[_0x55cf1f('0x5e')]=_[_0x55cf1f('0xa5')](_0x481033[_0x55cf1f('0x47')],qs['fields'](_0x226aae[_0x55cf1f('0x50')][_0x55cf1f('0x39')])),_0x304475[_0x55cf1f('0x5e')]=_0x304475[_0x55cf1f('0x5e')][_0x55cf1f('0x59')]?_0x304475[_0x55cf1f('0x5e')]:_0x481033[_0x55cf1f('0x47')];typeof _0x226aae[_0x55cf1f('0x50')][_0x55cf1f('0x19')]==='undefined'&&(_0x304475['limit']=qs[_0x55cf1f('0x6')](_0x226aae['query'][_0x55cf1f('0x6')]),_0x304475[_0x55cf1f('0x68')]=qs[_0x55cf1f('0x68')](_0x226aae[_0x55cf1f('0x50')][_0x55cf1f('0x68')]));_0x304475[_0x55cf1f('0x28')]=qs[_0x55cf1f('0x25')](_0x226aae[_0x55cf1f('0x50')][_0x55cf1f('0x25')]),_0x304475[_0x55cf1f('0x75')]=qs[_0x55cf1f('0x84')](_['pick'](_0x226aae[_0x55cf1f('0x50')],_0x481033[_0x55cf1f('0x84')]),_0x2b9fd8);_0x226aae[_0x55cf1f('0x50')][_0x55cf1f('0x1a')]&&(_0x304475[_0x55cf1f('0x75')]=_['merge'](_0x304475[_0x55cf1f('0x75')],{[Op['or']]:_[_0x55cf1f('0x8f')](_0x2b9fd8,function(_0x47748d){const _0x15f8d6=_0x55cf1f;if(_0x47748d[_0x15f8d6('0x9e')]!==_0x15f8d6('0x8b')){const _0x1b831a={};return _0x1b831a[_0x47748d[_0x15f8d6('0x53')]]={[Op[_0x15f8d6('0x77')]]:'%'+_0x226aae[_0x15f8d6('0x50')]['filter']+'%'},_0x1b831a;}})}));_0x304475=_[_0x55cf1f('0x6d')]({},_0x304475,_0x226aae[_0x55cf1f('0x7f')]);const _0x373ad8={'where':_0x304475['where']};return db[_0x55cf1f('0x2')][_0x55cf1f('0x11')](_0x373ad8)[_0x55cf1f('0x8a')](function(_0x52edff){const _0x59f369=_0x55cf1f;return _0x29e5d0[_0x59f369('0x11')]=_0x52edff,_0x226aae['query'][_0x59f369('0x41')]&&(_0x304475[_0x59f369('0x9f')]=[{'all':!![]}]),db[_0x59f369('0x2')][_0x59f369('0x96')](_0x304475);})[_0x55cf1f('0x8a')](function(_0x8cf972){const _0x3b1b50=_0x55cf1f;return _0x29e5d0[_0x3b1b50('0x2e')]=_0x8cf972,_0x29e5d0;})[_0x55cf1f('0x8a')](respondWithFilteredResult(_0x135e45,_0x304475))['catch'](handleError(_0x135e45,null));},exports[_0x5625e5('0x4d')]=function(_0x21694a,_0x327573){const _0x340081=_0x5625e5;let _0x104103={'raw':![],'where':{'id':_0x21694a[_0x340081('0x6b')]['id']}};const _0xddf086={};return _0xddf086[_0x340081('0x47')]=_[_0x340081('0x40')](db[_0x340081('0x2')][_0x340081('0x4')]),_0xddf086[_0x340081('0x50')]=_[_0x340081('0x40')](_0x21694a[_0x340081('0x50')]),_0xddf086[_0x340081('0x84')]=_[_0x340081('0xa5')](_0xddf086[_0x340081('0x47')],_0xddf086['query']),_0x104103[_0x340081('0x5e')]=_['intersection'](_0xddf086[_0x340081('0x47')],qs[_0x340081('0x39')](_0x21694a[_0x340081('0x50')][_0x340081('0x39')])),_0x104103['attributes']=_0x104103[_0x340081('0x5e')][_0x340081('0x59')]?_0x104103[_0x340081('0x5e')]:_0xddf086[_0x340081('0x47')],_0x21694a[_0x340081('0x50')][_0x340081('0x41')]&&(_0x104103['include']=[{'all':!![]}]),_0x104103=_[_0x340081('0x6d')]({},_0x104103,_0x21694a[_0x340081('0x7f')]),db[_0x340081('0x2')][_0x340081('0x8')](_0x104103)[_0x340081('0x8a')](handleEntityNotFound(_0x327573,null))[_0x340081('0x8a')](respondWithResult(_0x327573,null))['catch'](handleError(_0x327573,null));},exports[_0x5625e5('0x17')]=function(_0x36f540,_0x1d9595){const _0x91f601=_0x5625e5;return db['ServicenowAccount']['create'](_0x36f540['body'],{})['then'](respondWithResult(_0x1d9595,0xc9))[_0x91f601('0x9d')](handleError(_0x1d9595,null));},exports[_0x5625e5('0x3e')]=function(_0x24e7d7,_0x82af97){const _0x48dc56=_0x5625e5;return _0x24e7d7['body']['id']&&delete _0x24e7d7[_0x48dc56('0x26')]['id'],db[_0x48dc56('0x2')][_0x48dc56('0x8')]({'where':{'id':_0x24e7d7[_0x48dc56('0x6b')]['id']}})[_0x48dc56('0x8a')](handleEntityNotFound(_0x82af97,null))['then'](saveUpdates(_0x24e7d7[_0x48dc56('0x26')],null))[_0x48dc56('0x8a')](respondWithResult(_0x82af97,null))[_0x48dc56('0x9d')](handleError(_0x82af97,null));},exports[_0x5625e5('0x18')]=function(_0xdfaecd,_0x1d85b7){const _0x3e49a4=_0x5625e5;return db[_0x3e49a4('0x2')][_0x3e49a4('0x8')]({'where':{'id':_0xdfaecd['params']['id']}})['then'](handleEntityNotFound(_0x1d85b7,null))[_0x3e49a4('0x8a')](removeEntity(_0x1d85b7,null))[_0x3e49a4('0x9d')](handleError(_0x1d85b7,null));},exports[_0x5625e5('0x35')]=function(_0x11e8dc,_0x4c5c34){const _0x5bc330=_0x5625e5;let _0x5ad9da={};const _0x33d755={};let _0x582dc6,_0x2f754f;return db[_0x5bc330('0x2')][_0x5bc330('0x8')]({'where':{'id':_0x11e8dc['params']['id']}})[_0x5bc330('0x8a')](handleEntityNotFound(_0x4c5c34,null))[_0x5bc330('0x8a')](function(_0x129cb7){const _0x3ae4b5=_0x5bc330;if(_0x129cb7)return _0x582dc6=_0x129cb7,_0x33d755[_0x3ae4b5('0x47')]=_[_0x3ae4b5('0x40')](db[_0x3ae4b5('0x99')][_0x3ae4b5('0x4')]),_0x33d755[_0x3ae4b5('0x50')]=_[_0x3ae4b5('0x40')](_0x11e8dc[_0x3ae4b5('0x50')]),_0x33d755['filters']=_['intersection'](_0x33d755[_0x3ae4b5('0x47')],_0x33d755[_0x3ae4b5('0x50')]),_0x5ad9da['attributes']=_[_0x3ae4b5('0xa5')](_0x33d755[_0x3ae4b5('0x47')],qs[_0x3ae4b5('0x39')](_0x11e8dc[_0x3ae4b5('0x50')][_0x3ae4b5('0x39')])),_0x5ad9da[_0x3ae4b5('0x5e')]=_0x5ad9da[_0x3ae4b5('0x5e')][_0x3ae4b5('0x59')]?_0x5ad9da['attributes']:_0x33d755['model'],_0x5ad9da[_0x3ae4b5('0x28')]=qs[_0x3ae4b5('0x25')](_0x11e8dc[_0x3ae4b5('0x50')][_0x3ae4b5('0x25')]),_0x5ad9da[_0x3ae4b5('0x75')]=qs[_0x3ae4b5('0x84')](_[_0x3ae4b5('0x62')](_0x11e8dc[_0x3ae4b5('0x50')],_0x33d755[_0x3ae4b5('0x84')])),_0x11e8dc[_0x3ae4b5('0x50')][_0x3ae4b5('0x1a')]&&(_0x5ad9da[_0x3ae4b5('0x75')]=_[_0x3ae4b5('0x6d')](_0x5ad9da['where'],{[Op['or']]:_['map'](_0x5ad9da['attributes'],function(_0x32413f){const _0x1ac670=_0x3ae4b5,_0x568150={};return _0x568150[_0x32413f]={[Op[_0x1ac670('0x77')]]:'%'+_0x11e8dc[_0x1ac670('0x50')][_0x1ac670('0x1a')]+'%'},_0x568150;})})),_0x5ad9da=_['merge']({},_0x5ad9da,_0x11e8dc[_0x3ae4b5('0x7f')]),_0x582dc6['getConfigurations'](_0x5ad9da);})[_0x5bc330('0x8a')](function(_0xbdb913){const _0x545880=_0x5bc330;if(_0xbdb913)return _0x2f754f=_0xbdb913[_0x545880('0x59')],typeof _0x11e8dc[_0x545880('0x50')][_0x545880('0x19')]===_0x545880('0x0')&&(_0x5ad9da[_0x545880('0x6')]=qs[_0x545880('0x6')](_0x11e8dc[_0x545880('0x50')]['limit']),_0x5ad9da[_0x545880('0x68')]=qs['offset'](_0x11e8dc['query'][_0x545880('0x68')])),_0x582dc6['getConfigurations'](_0x5ad9da);})[_0x5bc330('0x8a')](function(_0xc2315d){if(_0xc2315d)return _0xc2315d?{'count':_0x2f754f,'rows':_0xc2315d}:null;})['then'](respondWithResult(_0x4c5c34,null))['catch'](handleError(_0x4c5c34,null));},exports[_0x5625e5('0x6a')]=function(_0x379f3b,_0x38bc7d){const _0x5ae195=_0x5625e5;return _0x379f3b['body']['id']&&delete _0x379f3b[_0x5ae195('0x26')]['id'],db[_0x5ae195('0x2')][_0x5ae195('0x8')]({'where':{'id':_0x379f3b[_0x5ae195('0x6b')]['id']}})[_0x5ae195('0x8a')](handleEntityNotFound(_0x38bc7d,null))[_0x5ae195('0x8a')](function(_0x386980){const _0x3ed530=_0x5ae195;if(_0x386980)return _0x379f3b[_0x3ed530('0x26')][_0x3ed530('0x5c')]=_0x386980['id'],_0x379f3b[_0x3ed530('0x26')][_0x3ed530('0x71')]=integrations[_0x3ed530('0x9c')](_0x379f3b[_0x3ed530('0x26')][_0x3ed530('0x4f')],_0x379f3b[_0x3ed530('0x26')][_0x3ed530('0x9e')]),_0x379f3b['body'][_0x3ed530('0x6c')]=integrations[_0x3ed530('0x3a')](_0x379f3b[_0x3ed530('0x26')]['channel'],_0x379f3b[_0x3ed530('0x26')][_0x3ed530('0x9e')]),db[_0x3ed530('0x99')]['create'](_0x379f3b['body'],{'include':[{'model':db[_0x3ed530('0x2a')],'as':_0x3ed530('0x71')},{'model':db['ServicenowField'],'as':_0x3ed530('0x6c')}]});return null;})['then'](respondWithResult(_0x38bc7d,null))[_0x5ae195('0x9d')](handleError(_0x38bc7d,null));},exports['getFields']=function(_0x528ab1,_0x5b6c08){const _0x486796=_0x5625e5,_0x188c50=[_0x486796('0xa2'),_0x486796('0x6f'),_0x486796('0x54'),'subcategory','close_code',_0x486796('0x63'),_0x486796('0x5d'),_0x486796('0xa4'),_0x486796('0x7d')],_0x444661=['parent',_0x486796('0xa2'),_0x486796('0x34'),_0x486796('0x93'),_0x486796('0x5b'),_0x486796('0xa'),_0x486796('0x7e'),'hold_reason',_0x486796('0x1f'),_0x486796('0x69'),_0x486796('0x64'),_0x486796('0x4e'),_0x486796('0xa0'),_0x486796('0x20'),_0x486796('0x57'),_0x486796('0x42'),'state','sys_created_by',_0x486796('0x54'),_0x486796('0x28'),_0x486796('0x44'),'closed_at',_0x486796('0xa1'),_0x486796('0x13'),_0x486796('0x82'),_0x486796('0x66'),_0x486796('0x81'),_0x486796('0x92'),'priority',_0x486796('0x2c'),_0x486796('0x27'),'time_worked',_0x486796('0xa8'),_0x486796('0x7'),'business_duration',_0x486796('0x85'),_0x486796('0x9b'),_0x486796('0x37'),_0x486796('0x98'),_0x486796('0x8d'),_0x486796('0x24'),_0x486796('0x38'),'work_notes',_0x486796('0x83'),_0x486796('0x3b'),_0x486796('0xf'),_0x486796('0x56'),_0x486796('0xb'),_0x486796('0x94'),_0x486796('0x3f'),_0x486796('0x43'),'description',_0x486796('0x46'),'notify','sys_class_name',_0x486796('0xa9'),_0x486796('0x5'),_0x486796('0x87'),_0x486796('0x32'),_0x486796('0x1'),'contact_type',_0x486796('0xc'),_0x486796('0x5d'),_0x486796('0x45'),_0x486796('0x91'),_0x486796('0x9'),_0x486796('0x29'),'activity_due',_0x486796('0x7b'),'severity',_0x486796('0x1c'),_0x486796('0x49'),_0x486796('0x52'),'comments_and_work_notes',_0x486796('0x30'),_0x486796('0xa6'),_0x486796('0x22'),_0x486796('0x88'),_0x486796('0x6e'),_0x486796('0x33'),'correlation_id',_0x486796('0xa7'),_0x486796('0x7d')];let _0xad8ea2='',_0x2d2bb0='',_0x1ef721=[],_0x526efd='',_0x108c0a='',_0xeafe76=[],_0x3b9fb3='',_0x34da16='',_0x384ba9={},_0x2e1d62='';return db[_0x486796('0x2')][_0x486796('0x8')]({'where':{'id':_0x528ab1[_0x486796('0x6b')]['id']},'attributes':['id',_0x486796('0x1b'),'password',_0x486796('0x31'),'remoteUri',_0x486796('0x2b')]})[_0x486796('0x8a')](handleEntityNotFound(_0x5b6c08,null))[_0x486796('0x8a')](function(_0x4853e7){const _0x57e8b8=_0x486796;if(_0x4853e7){_0x2e1d62=_0x4853e7[_0x57e8b8('0x4a')];const _0x238c96=_0x2e1d62[_0x57e8b8('0x14')](-0x1);_0x238c96==='/'&&(_0x2e1d62=_0x2e1d62[_0x57e8b8('0x1d')](0x0,_0x2e1d62[_0x57e8b8('0xe')](_0x238c96)));_0x34da16=util[_0x57e8b8('0x16')]('%s/api/now/doc/table/schema/',_0x2e1d62),_0x3b9fb3=util[_0x57e8b8('0x16')](_0x57e8b8('0x72'),_0x2e1d62),_0x384ba9={'user':_0x4853e7['username'],'pass':_0x4853e7[_0x57e8b8('0x5f')]};const _0x1a1f83={'method':_0x57e8b8('0x90'),'uri':_0x34da16+'incident?sysparm_display_value=all','auth':_0x384ba9,'json':!![]};return rp(_0x1a1f83);}})[_0x486796('0x8a')](function(_0x370ee7){const _0x3b2d9e=_0x486796;return _0x370ee7['result'][_0x3b2d9e('0x59')]>0x0&&(_0xad8ea2=_0x370ee7['result']),console[_0x3b2d9e('0x10')](_0x3b2d9e('0x78'),_0xad8ea2),_0xeafe76=[],_0x2d2bb0=Object['assign']([],_0xad8ea2),_[_0x3b2d9e('0x60')](_0x2d2bb0,function(_0x528be2){const _0x15af4=_0x3b2d9e;return!_0x188c50[_0x15af4('0x89')](_0x528be2[_0x15af4('0x53')]);}),_0x2d2bb0[_0x3b2d9e('0xa3')](function(_0xe8d732){const _0x3b9398=_0x3b2d9e,_0x3ebd02=createFieldObject(_0x3b9fb3,_0x384ba9,_0xe8d732[_0x3b9398('0x2f')],_0xe8d732[_0x3b9398('0x53')],_0xe8d732[_0x3b9398('0x97')],![]);_0xeafe76['push'](_0x3ebd02);}),Promise[_0x3b2d9e('0x4b')](_0xeafe76);})[_0x486796('0x8a')](function(_0x9d2114){const _0x5716d5=_0x486796;return _0x1ef721=_0x9d2114,_0x526efd=Object[_0x5716d5('0x95')]([],_0xad8ea2),console[_0x5716d5('0x10')](_0x5716d5('0x51'),_0xad8ea2),_[_0x5716d5('0x60')](_0x526efd,function(_0x3cdb10){const _0x21e26d=_0x5716d5;return _0x444661[_0x21e26d('0x89')](_0x3cdb10[_0x21e26d('0x53')]);}),console[_0x5716d5('0x10')](_0x5716d5('0x12'),_0x526efd),_0xeafe76=[],_0x526efd[_0x5716d5('0xa3')](function(_0x49bdeb){const _0x39ac9e=_0x5716d5,_0x25e342=createFieldObject(_0x3b9fb3,_0x384ba9,_0x49bdeb[_0x39ac9e('0x2f')],_0x49bdeb[_0x39ac9e('0x53')],_0x49bdeb[_0x39ac9e('0x97')],!![]);_0xeafe76[_0x39ac9e('0x70')](_0x25e342);}),Promise['all'](_0xeafe76);})['then'](function(_0x3005bf){const _0x23ed29=_0x486796;_0x108c0a=_0x3005bf;const _0x57bad6=_0x1ef721[_0x23ed29('0x1e')](_0x108c0a);return{'count':_0x57bad6[_0x23ed29('0x59')],'rows':_0x57bad6};})[_0x486796('0x8a')](respondWithResult(_0x5b6c08,null))['catch'](function(_0x186bb5){const _0x45ec9f=_0x486796;console[_0x45ec9f('0x10')]('ServiceNow\x20error:\x20'+_0x186bb5);let _0x1ca3ae=_0x528ab1[_0x45ec9f('0x50')][_0x45ec9f('0x65')]?0x1f4:_0x186bb5[_0x45ec9f('0x9a')]||0x1f4;logger[_0x45ec9f('0x73')](_0x186bb5[_0x45ec9f('0x3')]),delete _0x186bb5[_0x45ec9f('0x53')],_0x1ca3ae===0x191&&(_0x1ca3ae=0x190),_0x5b6c08[_0x45ec9f('0x80')](_0x1ca3ae)[_0x45ec9f('0x8e')](_0x528ab1[_0x45ec9f('0x50')][_0x45ec9f('0x65')]?{'message':_0x45ec9f('0x36'),'statusCode':_0x186bb5[_0x45ec9f('0x9a')]}:_0x186bb5);});};function createFieldObject(_0x2c6a61,_0x9af1bf,_0x4a913b,_0x4056e7,_0x9298c3,_0x37b96c){return new Promise(function(_0x4bfb38){const _0x486fcd=a294_0x31af,_0x2bac0={'id':_0x4056e7,'name':_0x9298c3,'custom':_0x37b96c};if(_0x4a913b===_0x486fcd('0x7c'))_0x2bac0[_0x486fcd('0x7f')]=[{'name':'True','value':'true'},{'name':_0x486fcd('0x3d'),'value':'false'}],_0x4bfb38(_0x2bac0);else{const _0x265a54={'method':'GET','uri':_0x2c6a61+'sys_choice?sysparm_query=name=incident^element='+_0x4056e7,'auth':_0x9af1bf,'json':!![]};return rp(_0x265a54)['then'](function(_0x4a1a3b){const _0x326cda=_0x486fcd,_0x183636=[];_0x4a1a3b[_0x326cda('0x79')]['length']>0x0&&_0x4a1a3b[_0x326cda('0x79')][_0x326cda('0xa3')](function(_0x552004){const _0x5b524f=_0x326cda;if(_0x552004[_0x5b524f('0x48')]===_0x5b524f('0x21')){const _0x3d93b8={'name':_0x552004['label'],'value':_0x552004[_0x5b524f('0x3c')]};_0x183636['push'](_0x3d93b8);}}),_0x2bac0[_0x326cda('0x7f')]=_0x183636,_0x2bac0[_0x326cda('0x7f')]['length']>0x0?_0x4bfb38(_0x2bac0):_0x37b96c==![]?_0x4bfb38():_0x4bfb38(_0x2bac0);});}});}