Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
1 const a294_0x4b25=['ServicenowConfiguration','incident_state','send','forEach','severity','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','../../components/parsers/qs','escalation','ServicenowAccount','catch','push','result','correlation_display','sys_mod_count','lastIndexOf','getConfigurations','stack','closed_at','getSubjects','GET','assign','urgency','model','destroy','subcategory','length','channel','%s/api/now/doc/table/schema/','company','filter','calendar_stc','work_notes','incident\x20table\x20objects','sys_choice?sysparm_query=name=incident^element=','substring','all','state','../../config/logger','query','hold_reason','ServicenowField','offset','inactive','sequelize','resolved_by','Wrong\x20credentials','fieldName','sys_created_by','options','rows','attributes','expected_start','sla_due','assignment_group','correlation_id','request-promise-native','sys_domain_path','findOne','business_stc','params','label','description','parent','close_notes','addConfiguration','approval','includes','undefined','priority','sys_domain','short_description','work_start','resolved_at','update','approval_set','upon_approval','remoteUri','password','sys_tags','name','log','false','%s/api/now/table/','calendar_duration','AccountId','keys','key','work_notes_list','business_duration','username','util','rawAttributes','boolean','sort','format','pick','test','sys_updated_on','type','sys_id','TCL:\x20_object','close_code','additional_assignee_list','active','False','work_end','body','reopened_time','VIRTUAL','status','internalType','set','comments_and_work_notes','../../mysqldb','sys_class_name','category','where','getFields','statusCode','business_service','end','ServiceNow\x20error:\x20','cmdb_ci','opened_by','limit','True','json','count','intersection','Subjects','findAll','filters','knowledge','opened_at','order','fields','api','includeAll','closed_by','merge','user_input','create','like','due_date','slice','activity_due','include','sys_updated_by','reassignment_count','comments','then','location','time_worked','show','map','number'];(function(_0x2925c7,_0x4b25ea){const _0x413792=function(_0x3a984b){while(--_0x3a984b){_0x2925c7['push'](_0x2925c7['shift']());}};_0x413792(++_0x4b25ea);}(a294_0x4b25,0xa7));const a294_0x4137=function(_0x2925c7,_0x4b25ea){_0x2925c7=_0x2925c7-0x0;let _0x413792=a294_0x4b25[_0x2925c7];return _0x413792;};const _0x1f4b5e=a294_0x4137;'use strict';const rp=require(_0x1f4b5e('0x2c')),util=require(_0x1f4b5e('0x4f')),_=require('lodash'),qs=require(_0x1f4b5e('0x97')),logger=require(_0x1f4b5e('0x1a'))(_0x1f4b5e('0x7d')),db=require(_0x1f4b5e('0x66'))['db'],{Op}=require(_0x1f4b5e('0x20')),integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3a984b,_0x57db61){return _0x57db61=_0x57db61||0xc8,function(_0x5c44e3){const _0x294055=a294_0x4137;if(_0x5c44e3)return _0x3a984b['status'](_0x57db61)[_0x294055('0x73')](_0x5c44e3);};}function respondWithFilteredResult(_0x18111e,_0x5d1573){return function(_0x3d1a1f){const _0x46a376=a294_0x4137;if(_0x3d1a1f){const _0x19febd=_0x3d1a1f[_0x46a376('0x74')],_0x18ee15=_0x5d1573[_0x46a376('0x1e')];let _0x188e26=_0x5d1573[_0x46a376('0x1e')]+_0x5d1573[_0x46a376('0x71')],_0x164661;return _0x188e26>=_0x19febd?(_0x188e26=_0x19febd,_0x164661=0xc8):_0x164661=0xce,_0x18111e[_0x46a376('0x62')](_0x164661),_0x18111e[_0x46a376('0x64')]('Content-Range',_0x18ee15+'-'+_0x188e26+'/'+_0x19febd)['json'](_0x3d1a1f);}return null;};}function saveUpdates(_0x2feb64){return function(_0x4d80c1){const _0x3885ce=a294_0x4137;if(_0x4d80c1)return _0x4d80c1['update'](_0x2feb64)[_0x3885ce('0x8b')](function(_0x302694){return _0x302694;});return null;};}function removeEntity(_0x1b56e5){return function(_0x4bdb13){const _0x26db2f=a294_0x4137;if(_0x4bdb13)return _0x4bdb13[_0x26db2f('0xc')]()[_0x26db2f('0x8b')](function(){const _0x3b3377=_0x26db2f;_0x1b56e5[_0x3b3377('0x62')](0xcc)[_0x3b3377('0x6d')]();});};}function handleEntityNotFound(_0x28314c){return function(_0x2734a1){return!_0x2734a1&&_0x28314c['sendStatus'](0x194),_0x2734a1;};}function handleError(_0x1519e6,_0xf1fdee){return _0xf1fdee=_0xf1fdee||0x1f4,function(_0x24abdb){const _0xdb6bb8=a294_0x4137;logger['error'](_0x24abdb['stack']),_0x24abdb['name']&&delete _0x24abdb[_0xdb6bb8('0x44')],_0x1519e6[_0xdb6bb8('0x62')](_0xf1fdee)['send'](_0x24abdb);};}exports['index']=function(_0x4b606e,_0x3957f7){const _0x3ce4e0=_0x1f4b5e;let _0x3b6239={};const _0x3b7a2c={},_0x4ecd02={'count':0x0,'rows':[]},_0x2eb591=_['map'](db[_0x3ce4e0('0x99')][_0x3ce4e0('0x50')],function(_0x229975){const _0x4941cb=_0x3ce4e0;return{'name':_0x229975[_0x4941cb('0x23')],'type':_0x229975[_0x4941cb('0x57')][_0x4941cb('0x4b')]};});_0x3b7a2c[_0x3ce4e0('0xb')]=_[_0x3ce4e0('0x8f')](_0x2eb591,'name'),_0x3b7a2c[_0x3ce4e0('0x1b')]=_[_0x3ce4e0('0x4a')](_0x4b606e[_0x3ce4e0('0x1b')]),_0x3b7a2c[_0x3ce4e0('0x78')]=_['intersection'](_0x3b7a2c[_0x3ce4e0('0xb')],_0x3b7a2c[_0x3ce4e0('0x1b')]),_0x3b6239['attributes']=_[_0x3ce4e0('0x75')](_0x3b7a2c['model'],qs[_0x3ce4e0('0x7c')](_0x4b606e[_0x3ce4e0('0x1b')][_0x3ce4e0('0x7c')])),_0x3b6239['attributes']=_0x3b6239[_0x3ce4e0('0x27')][_0x3ce4e0('0xe')]?_0x3b6239['attributes']:_0x3b7a2c[_0x3ce4e0('0xb')];typeof _0x4b606e[_0x3ce4e0('0x1b')]['nolimit']===_0x3ce4e0('0x38')&&(_0x3b6239[_0x3ce4e0('0x71')]=qs[_0x3ce4e0('0x71')](_0x4b606e['query'][_0x3ce4e0('0x71')]),_0x3b6239[_0x3ce4e0('0x1e')]=qs[_0x3ce4e0('0x1e')](_0x4b606e['query'][_0x3ce4e0('0x1e')]));_0x3b6239[_0x3ce4e0('0x7b')]=qs['sort'](_0x4b606e[_0x3ce4e0('0x1b')]['sort']),_0x3b6239[_0x3ce4e0('0x69')]=qs['filters'](_['pick'](_0x4b606e['query'],_0x3b7a2c[_0x3ce4e0('0x78')]),_0x2eb591);_0x4b606e[_0x3ce4e0('0x1b')][_0x3ce4e0('0x12')]&&(_0x3b6239['where']=_['merge'](_0x3b6239['where'],{[Op['or']]:_[_0x3ce4e0('0x8f')](_0x2eb591,function(_0x18d889){const _0x679dcd=_0x3ce4e0;if(_0x18d889[_0x679dcd('0x57')]!==_0x679dcd('0x61')){const _0x4dd6a3={};return _0x4dd6a3[_0x18d889[_0x679dcd('0x44')]]={[Op[_0x679dcd('0x83')]]:'%'+_0x4b606e[_0x679dcd('0x1b')][_0x679dcd('0x12')]+'%'},_0x4dd6a3;}})}));_0x3b6239=_[_0x3ce4e0('0x80')]({},_0x3b6239,_0x4b606e[_0x3ce4e0('0x25')]);const _0x177609={'where':_0x3b6239[_0x3ce4e0('0x69')]};return db[_0x3ce4e0('0x99')][_0x3ce4e0('0x74')](_0x177609)[_0x3ce4e0('0x8b')](function(_0x4f3891){const _0x52ea87=_0x3ce4e0;return _0x4ecd02['count']=_0x4f3891,_0x4b606e[_0x52ea87('0x1b')]['includeAll']&&(_0x3b6239['include']=[{'all':!![]}]),db[_0x52ea87('0x99')][_0x52ea87('0x77')](_0x3b6239);})['then'](function(_0x178f40){const _0x4236c8=_0x3ce4e0;return _0x4ecd02[_0x4236c8('0x26')]=_0x178f40,_0x4ecd02;})['then'](respondWithFilteredResult(_0x3957f7,_0x3b6239))['catch'](handleError(_0x3957f7,null));},exports[_0x1f4b5e('0x8e')]=function(_0x4d0e95,_0x72adda){const _0x3c731c=_0x1f4b5e;let _0xd76650={'raw':![],'where':{'id':_0x4d0e95[_0x3c731c('0x30')]['id']}};const _0xbe782e={};return _0xbe782e[_0x3c731c('0xb')]=_[_0x3c731c('0x4a')](db[_0x3c731c('0x99')][_0x3c731c('0x50')]),_0xbe782e[_0x3c731c('0x1b')]=_[_0x3c731c('0x4a')](_0x4d0e95[_0x3c731c('0x1b')]),_0xbe782e[_0x3c731c('0x78')]=_[_0x3c731c('0x75')](_0xbe782e['model'],_0xbe782e[_0x3c731c('0x1b')]),_0xd76650['attributes']=_[_0x3c731c('0x75')](_0xbe782e[_0x3c731c('0xb')],qs[_0x3c731c('0x7c')](_0x4d0e95[_0x3c731c('0x1b')][_0x3c731c('0x7c')])),_0xd76650[_0x3c731c('0x27')]=_0xd76650[_0x3c731c('0x27')][_0x3c731c('0xe')]?_0xd76650[_0x3c731c('0x27')]:_0xbe782e[_0x3c731c('0xb')],_0x4d0e95[_0x3c731c('0x1b')][_0x3c731c('0x7e')]&&(_0xd76650[_0x3c731c('0x87')]=[{'all':!![]}]),_0xd76650=_[_0x3c731c('0x80')]({},_0xd76650,_0x4d0e95[_0x3c731c('0x25')]),db[_0x3c731c('0x99')][_0x3c731c('0x2e')](_0xd76650)[_0x3c731c('0x8b')](handleEntityNotFound(_0x72adda,null))[_0x3c731c('0x8b')](respondWithResult(_0x72adda,null))[_0x3c731c('0x9a')](handleError(_0x72adda,null));},exports[_0x1f4b5e('0x82')]=function(_0x231e51,_0x1fc8bf){const _0x4eb907=_0x1f4b5e;return db[_0x4eb907('0x99')][_0x4eb907('0x82')](_0x231e51[_0x4eb907('0x5f')],{})['then'](respondWithResult(_0x1fc8bf,0xc9))[_0x4eb907('0x9a')](handleError(_0x1fc8bf,null));},exports[_0x1f4b5e('0x3e')]=function(_0x55481d,_0x22149c){const _0x10f32c=_0x1f4b5e;return _0x55481d[_0x10f32c('0x5f')]['id']&&delete _0x55481d['body']['id'],db[_0x10f32c('0x99')]['findOne']({'where':{'id':_0x55481d['params']['id']}})[_0x10f32c('0x8b')](handleEntityNotFound(_0x22149c,null))[_0x10f32c('0x8b')](saveUpdates(_0x55481d['body'],null))[_0x10f32c('0x8b')](respondWithResult(_0x22149c,null))[_0x10f32c('0x9a')](handleError(_0x22149c,null));},exports[_0x1f4b5e('0xc')]=function(_0x253a65,_0x3e8a25){const _0x132812=_0x1f4b5e;return db[_0x132812('0x99')][_0x132812('0x2e')]({'where':{'id':_0x253a65[_0x132812('0x30')]['id']}})[_0x132812('0x8b')](handleEntityNotFound(_0x3e8a25,null))[_0x132812('0x8b')](removeEntity(_0x3e8a25,null))[_0x132812('0x9a')](handleError(_0x3e8a25,null));},exports[_0x1f4b5e('0x4')]=function(_0x5ddbb1,_0x59954b){const _0x4f5ae3=_0x1f4b5e;let _0x595694={};const _0x3096ff={};let _0x4f0daa,_0x285d39;return db[_0x4f5ae3('0x99')]['findOne']({'where':{'id':_0x5ddbb1[_0x4f5ae3('0x30')]['id']}})[_0x4f5ae3('0x8b')](handleEntityNotFound(_0x59954b,null))[_0x4f5ae3('0x8b')](function(_0x9e0cd){const _0x200ec1=_0x4f5ae3;if(_0x9e0cd)return _0x4f0daa=_0x9e0cd,_0x3096ff[_0x200ec1('0xb')]=_[_0x200ec1('0x4a')](db[_0x200ec1('0x91')][_0x200ec1('0x50')]),_0x3096ff[_0x200ec1('0x1b')]=_['keys'](_0x5ddbb1['query']),_0x3096ff[_0x200ec1('0x78')]=_[_0x200ec1('0x75')](_0x3096ff['model'],_0x3096ff['query']),_0x595694[_0x200ec1('0x27')]=_[_0x200ec1('0x75')](_0x3096ff[_0x200ec1('0xb')],qs[_0x200ec1('0x7c')](_0x5ddbb1[_0x200ec1('0x1b')][_0x200ec1('0x7c')])),_0x595694[_0x200ec1('0x27')]=_0x595694[_0x200ec1('0x27')][_0x200ec1('0xe')]?_0x595694[_0x200ec1('0x27')]:_0x3096ff[_0x200ec1('0xb')],_0x595694[_0x200ec1('0x7b')]=qs[_0x200ec1('0x52')](_0x5ddbb1[_0x200ec1('0x1b')][_0x200ec1('0x52')]),_0x595694[_0x200ec1('0x69')]=qs[_0x200ec1('0x78')](_[_0x200ec1('0x54')](_0x5ddbb1[_0x200ec1('0x1b')],_0x3096ff['filters'])),_0x5ddbb1[_0x200ec1('0x1b')][_0x200ec1('0x12')]&&(_0x595694['where']=_[_0x200ec1('0x80')](_0x595694['where'],{[Op['or']]:_[_0x200ec1('0x8f')](_0x595694[_0x200ec1('0x27')],function(_0x48e2b2){const _0x54cec5=_0x200ec1,_0x1c941f={};return _0x1c941f[_0x48e2b2]={[Op[_0x54cec5('0x83')]]:'%'+_0x5ddbb1['query'][_0x54cec5('0x12')]+'%'},_0x1c941f;})})),_0x595694=_[_0x200ec1('0x80')]({},_0x595694,_0x5ddbb1[_0x200ec1('0x25')]),_0x4f0daa[_0x200ec1('0x4')](_0x595694);})[_0x4f5ae3('0x8b')](function(_0x11e1d7){const _0x1edba=_0x4f5ae3;if(_0x11e1d7)return _0x285d39=_0x11e1d7['length'],typeof _0x5ddbb1[_0x1edba('0x1b')]['nolimit']===_0x1edba('0x38')&&(_0x595694[_0x1edba('0x71')]=qs['limit'](_0x5ddbb1['query'][_0x1edba('0x71')]),_0x595694[_0x1edba('0x1e')]=qs[_0x1edba('0x1e')](_0x5ddbb1[_0x1edba('0x1b')][_0x1edba('0x1e')])),_0x4f0daa[_0x1edba('0x4')](_0x595694);})['then'](function(_0x4b4fbe){if(_0x4b4fbe)return _0x4b4fbe?{'count':_0x285d39,'rows':_0x4b4fbe}:null;})[_0x4f5ae3('0x8b')](respondWithResult(_0x59954b,null))[_0x4f5ae3('0x9a')](handleError(_0x59954b,null));},exports[_0x1f4b5e('0x35')]=function(_0x40778e,_0x51ac30){const _0x200488=_0x1f4b5e;return _0x40778e[_0x200488('0x5f')]['id']&&delete _0x40778e[_0x200488('0x5f')]['id'],db['ServicenowAccount'][_0x200488('0x2e')]({'where':{'id':_0x40778e[_0x200488('0x30')]['id']}})[_0x200488('0x8b')](handleEntityNotFound(_0x51ac30,null))['then'](function(_0x2d616c){const _0x967da8=_0x200488;if(_0x2d616c)return _0x40778e['body'][_0x967da8('0x49')]=_0x2d616c['id'],_0x40778e[_0x967da8('0x5f')][_0x967da8('0x76')]=integrations[_0x967da8('0x7')](_0x40778e['body'][_0x967da8('0xf')],_0x40778e['body'][_0x967da8('0x57')]),_0x40778e[_0x967da8('0x5f')]['Descriptions']=integrations['getDescriptions'](_0x40778e[_0x967da8('0x5f')]['channel'],_0x40778e[_0x967da8('0x5f')][_0x967da8('0x57')]),db[_0x967da8('0x91')][_0x967da8('0x82')](_0x40778e[_0x967da8('0x5f')],{'include':[{'model':db[_0x967da8('0x1d')],'as':'Subjects'},{'model':db[_0x967da8('0x1d')],'as':'Descriptions'}]});return null;})['then'](respondWithResult(_0x51ac30,null))[_0x200488('0x9a')](handleError(_0x51ac30,null));},exports[_0x1f4b5e('0x6a')]=function(_0x22a336,_0x666c8c){const _0x4a8668=_0x1f4b5e,_0x52a4af=['made_sla',_0x4a8668('0x1c'),'knowledge',_0x4a8668('0xd'),'close_code','notify',_0x4a8668('0x92'),_0x4a8668('0x95'),_0x4a8668('0x68')],_0x68caa9=[_0x4a8668('0x33'),'made_sla','caused_by','watch_list','upon_reject',_0x4a8668('0x56'),'child_incidents',_0x4a8668('0x1c'),'approval_history',_0x4a8668('0x90'),_0x4a8668('0x21'),_0x4a8668('0x88'),_0x4a8668('0x70'),_0x4a8668('0x81'),'sys_created_on',_0x4a8668('0x3a'),_0x4a8668('0x19'),_0x4a8668('0x24'),_0x4a8668('0x79'),_0x4a8668('0x7b'),_0x4a8668('0x13'),_0x4a8668('0x6'),_0x4a8668('0x6f'),'delivery_plan','impact',_0x4a8668('0x5c'),_0x4a8668('0x4c'),_0x4a8668('0x6c'),_0x4a8668('0x39'),_0x4a8668('0x2d'),'rfc',_0x4a8668('0x8d'),_0x4a8668('0x28'),_0x4a8668('0x7a'),_0x4a8668('0x4d'),'group_list',_0x4a8668('0x5e'),_0x4a8668('0x60'),_0x4a8668('0x3d'),'caller_id',_0x4a8668('0x3f'),'subcategory',_0x4a8668('0x14'),_0x4a8668('0x3b'),_0x4a8668('0x5a'),_0x4a8668('0x1'),'delivery_task',_0x4a8668('0x3c'),_0x4a8668('0x2a'),_0x4a8668('0x2f'),_0x4a8668('0x5b'),_0x4a8668('0x32'),_0x4a8668('0x48'),'notify',_0x4a8668('0x67'),_0x4a8668('0x34'),_0x4a8668('0x7f'),'follow_up','parent_incident',_0x4a8668('0x58'),'contact_type','reopened_by',_0x4a8668('0x92'),_0x4a8668('0xa'),'problem_id',_0x4a8668('0x11'),_0x4a8668('0x89'),_0x4a8668('0x86'),'assigned_to',_0x4a8668('0x95'),_0x4a8668('0x8a'),_0x4a8668('0x29'),_0x4a8668('0x36'),_0x4a8668('0x65'),_0x4a8668('0x84'),_0x4a8668('0x2'),'reopen_count',_0x4a8668('0x43'),_0x4a8668('0x98'),_0x4a8668('0x40'),_0x4a8668('0x2b'),_0x4a8668('0x8c'),_0x4a8668('0x68')];let _0x52f49b='',_0x22d3ce='',_0x508d92=[],_0x5e5fb7='',_0x15295f='',_0xc981fa=[],_0x29413e='',_0x160d84='',_0x178b17={},_0x118a3d='';return db[_0x4a8668('0x99')][_0x4a8668('0x2e')]({'where':{'id':_0x22a336['params']['id']},'attributes':['id',_0x4a8668('0x4e'),_0x4a8668('0x42'),'email',_0x4a8668('0x41'),'serverUrl']})[_0x4a8668('0x8b')](handleEntityNotFound(_0x666c8c,null))[_0x4a8668('0x8b')](function(_0x34f1ca){const _0x2854ac=_0x4a8668;if(_0x34f1ca){_0x118a3d=_0x34f1ca[_0x2854ac('0x41')];const _0x2bf422=_0x118a3d[_0x2854ac('0x85')](-0x1);_0x2bf422==='/'&&(_0x118a3d=_0x118a3d[_0x2854ac('0x17')](0x0,_0x118a3d[_0x2854ac('0x3')](_0x2bf422)));_0x160d84=util[_0x2854ac('0x53')](_0x2854ac('0x10'),_0x118a3d),_0x29413e=util[_0x2854ac('0x53')](_0x2854ac('0x47'),_0x118a3d),_0x178b17={'user':_0x34f1ca[_0x2854ac('0x4e')],'pass':_0x34f1ca['password']};const _0x430bc0={'method':_0x2854ac('0x8'),'uri':_0x160d84+'incident?sysparm_display_value=all','auth':_0x178b17,'json':!![]};return rp(_0x430bc0);}})[_0x4a8668('0x8b')](function(_0x537b54){const _0x5af64b=_0x4a8668;return _0x537b54[_0x5af64b('0x0')]['length']>0x0&&(_0x52f49b=_0x537b54[_0x5af64b('0x0')]),console['log'](_0x5af64b('0x15'),_0x52f49b),_0xc981fa=[],_0x22d3ce=Object['assign']([],_0x52f49b),_['remove'](_0x22d3ce,function(_0x240cdc){const _0x2543e7=_0x5af64b;return!_0x52a4af[_0x2543e7('0x37')](_0x240cdc['name']);}),_0x22d3ce[_0x5af64b('0x94')](function(_0x2f86ce){const _0x300849=_0x5af64b,_0x233aa9=createFieldObject(_0x29413e,_0x178b17,_0x2f86ce[_0x300849('0x63')],_0x2f86ce['name'],_0x2f86ce[_0x300849('0x31')],![]);_0xc981fa[_0x300849('0x9b')](_0x233aa9);}),Promise['all'](_0xc981fa);})[_0x4a8668('0x8b')](function(_0x4205e2){const _0x3985e4=_0x4a8668;return _0x508d92=_0x4205e2,_0x5e5fb7=Object[_0x3985e4('0x9')]([],_0x52f49b),console[_0x3985e4('0x45')](_0x3985e4('0x59'),_0x52f49b),_['remove'](_0x5e5fb7,function(_0x5b0709){const _0x2ba609=_0x3985e4;return _0x68caa9['includes'](_0x5b0709[_0x2ba609('0x44')]);}),console[_0x3985e4('0x45')](_0x3985e4('0x96'),_0x5e5fb7),_0xc981fa=[],_0x5e5fb7[_0x3985e4('0x94')](function(_0x5b2b33){const _0x1bb45e=_0x3985e4,_0x1a1b2a=createFieldObject(_0x29413e,_0x178b17,_0x5b2b33[_0x1bb45e('0x63')],_0x5b2b33['name'],_0x5b2b33[_0x1bb45e('0x31')],!![]);_0xc981fa[_0x1bb45e('0x9b')](_0x1a1b2a);}),Promise[_0x3985e4('0x18')](_0xc981fa);})[_0x4a8668('0x8b')](function(_0x2707e6){_0x15295f=_0x2707e6;const _0x4f6bcc=_0x508d92['concat'](_0x15295f);return{'count':_0x4f6bcc['length'],'rows':_0x4f6bcc};})['then'](respondWithResult(_0x666c8c,null))[_0x4a8668('0x9a')](function(_0x24b704){const _0x46931b=_0x4a8668;console['log'](_0x46931b('0x6e')+_0x24b704);let _0x587659=_0x22a336[_0x46931b('0x1b')][_0x46931b('0x55')]?0x1f4:_0x24b704[_0x46931b('0x6b')]||0x1f4;logger['error'](_0x24b704[_0x46931b('0x5')]),delete _0x24b704[_0x46931b('0x44')],_0x587659===0x191&&(_0x587659=0x190),_0x666c8c[_0x46931b('0x62')](_0x587659)[_0x46931b('0x93')](_0x22a336['query'][_0x46931b('0x55')]?{'message':_0x46931b('0x22'),'statusCode':_0x24b704[_0x46931b('0x6b')]}:_0x24b704);});};function createFieldObject(_0x1d0d36,_0x4ee415,_0x579808,_0x811919,_0x116b08,_0x4bd28f){return new Promise(function(_0x1b647c){const _0x3763f8=a294_0x4137,_0x41845d={'id':_0x811919,'name':_0x116b08,'custom':_0x4bd28f};if(_0x579808===_0x3763f8('0x51'))_0x41845d[_0x3763f8('0x25')]=[{'name':_0x3763f8('0x72'),'value':'true'},{'name':_0x3763f8('0x5d'),'value':_0x3763f8('0x46')}],_0x1b647c(_0x41845d);else{const _0x5b96a8={'method':'GET','uri':_0x1d0d36+_0x3763f8('0x16')+_0x811919,'auth':_0x4ee415,'json':!![]};return rp(_0x5b96a8)[_0x3763f8('0x8b')](function(_0x2ca04b){const _0x57541b=_0x3763f8,_0x4244c3=[];_0x2ca04b[_0x57541b('0x0')][_0x57541b('0xe')]>0x0&&_0x2ca04b['result']['forEach'](function(_0x53ed37){const _0x406675=_0x57541b;if(_0x53ed37[_0x406675('0x1f')]===_0x406675('0x46')){const _0x123dfa={'name':_0x53ed37[_0x406675('0x31')],'value':_0x53ed37['value']};_0x4244c3[_0x406675('0x9b')](_0x123dfa);}}),_0x41845d['options']=_0x4244c3,_0x41845d[_0x57541b('0x25')][_0x57541b('0xe')]>0x0?_0x1b647c(_0x41845d):_0x4bd28f==![]?_0x1b647c():_0x1b647c(_0x41845d);});}});}