Built motion from commit 39adb707.|2.6.14
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index cf44f02..a84ed26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f40=['sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','fields','create','body','find','findOne','ServicenowConfiguration','pick','getConfigurations','addConfiguration','AccountId','Descriptions','getDescriptions','channel','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_updated_by','sys_created_on','state','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at','caller_id','approval_set','short_description','delivery_task','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','correlation_id','location','username','password','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','TCL:\x20_object','push','all','concat','ServiceNow\x20error:\x20','test','statusCode','true','False','false','inactive','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x206bd1,_0x45237e){var _0x27df15=function(_0x35b1d2){while(--_0x35b1d2){_0x206bd1['push'](_0x206bd1['shift']());}};_0x27df15(++_0x45237e);}(_0x9f40,0x1e2));var _0x09f4=function(_0x58030d,_0x28ba40){_0x58030d=_0x58030d-0x0;var _0x3c9cf=_0x9f40[_0x58030d];return _0x3c9cf;};'use strict';var emlformat=require(_0x09f4('0x0'));var rimraf=require(_0x09f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09f4('0x2'));var rp=require(_0x09f4('0x3'));var moment=require(_0x09f4('0x4'));var BPromise=require(_0x09f4('0x5'));var Mustache=require('mustache');var util=require(_0x09f4('0x6'));var path=require(_0x09f4('0x7'));var sox=require(_0x09f4('0x8'));var csv=require(_0x09f4('0x9'));var ejs=require(_0x09f4('0xa'));var fs=require('fs');var fs_extra=require(_0x09f4('0xb'));var _=require(_0x09f4('0xc'));var squel=require('squel');var crypto=require(_0x09f4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x09f4('0xe'));var toCsv=require(_0x09f4('0x9'));var querystring=require('querystring');var Papa=require(_0x09f4('0xf'));var Redis=require(_0x09f4('0x10'));var authService=require(_0x09f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x09f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09f4('0x13'))('api');var utils=require(_0x09f4('0x14'));var config=require(_0x09f4('0x15'));var licenseUtil=require(_0x09f4('0x16'));var db=require(_0x09f4('0x17'))['db'];var integrations=require(_0x09f4('0x18'));function respondWithStatusCode(_0x43eaf0,_0x77e658){_0x77e658=_0x77e658||0xcc;return function(_0x44bf71){if(_0x44bf71){return _0x43eaf0[_0x09f4('0x19')](_0x77e658);}return _0x43eaf0[_0x09f4('0x1a')](_0x77e658)[_0x09f4('0x1b')]();};}function respondWithResult(_0x21129c,_0x2e0dc1){_0x2e0dc1=_0x2e0dc1||0xc8;return function(_0x41c72e){if(_0x41c72e){return _0x21129c[_0x09f4('0x1a')](_0x2e0dc1)['json'](_0x41c72e);}};}function respondWithFilteredResult(_0x176a94,_0x537489){return function(_0xa55b90){if(_0xa55b90){var _0x44daea=typeof _0x537489[_0x09f4('0x1c')]==='undefined'&&typeof _0x537489['limit']===_0x09f4('0x1d');var _0x4990b2=_0xa55b90[_0x09f4('0x1e')];var _0x303dbc=_0x44daea?0x0:_0x537489['offset'];var _0xde3717=_0x44daea?_0xa55b90[_0x09f4('0x1e')]:_0x537489[_0x09f4('0x1c')]+_0x537489[_0x09f4('0x1f')];var _0x577bed;if(_0xde3717>=_0x4990b2){_0xde3717=_0x4990b2;_0x577bed=0xc8;}else{_0x577bed=0xce;}_0x176a94['status'](_0x577bed);return _0x176a94[_0x09f4('0x20')](_0x09f4('0x21'),_0x303dbc+'-'+_0xde3717+'/'+_0x4990b2)[_0x09f4('0x22')](_0xa55b90);}return null;};}function patchUpdates(_0x268c4b){return function(_0x20f503){try{jsonpatch[_0x09f4('0x23')](_0x20f503,_0x268c4b,!![]);}catch(_0x151126){return BPromise['reject'](_0x151126);}return _0x20f503['save']();};}function saveUpdates(_0x21b3b7,_0x3bdba1){return function(_0x4161ca){if(_0x4161ca){return _0x4161ca[_0x09f4('0x24')](_0x21b3b7)[_0x09f4('0x25')](function(_0x51eaf5){return _0x51eaf5;});}return null;};}function removeEntity(_0x495419,_0xca3ef9){return function(_0x565a6d){if(_0x565a6d){return _0x565a6d[_0x09f4('0x26')]()['then'](function(){_0x495419[_0x09f4('0x1a')](0xcc)[_0x09f4('0x1b')]();});}};}function handleEntityNotFound(_0x136af9,_0xbbe2d){return function(_0x4d4b03){if(!_0x4d4b03){_0x136af9[_0x09f4('0x19')](0x194);}return _0x4d4b03;};}function handleError(_0x53c3b2,_0x27f98e){_0x27f98e=_0x27f98e||0x1f4;return function(_0x1e1a7c){logger[_0x09f4('0x27')](_0x1e1a7c[_0x09f4('0x28')]);if(_0x1e1a7c[_0x09f4('0x29')]){delete _0x1e1a7c['name'];}_0x53c3b2[_0x09f4('0x1a')](_0x27f98e)[_0x09f4('0x2a')](_0x1e1a7c);};}exports['index']=function(_0x623a97,_0x2453a9){var _0xbcbdb4={},_0x5a1d97={},_0xc47926={'count':0x0,'rows':[]};var _0x3bdf76=_[_0x09f4('0x2b')](db[_0x09f4('0x2c')][_0x09f4('0x2d')],function(_0x115947){return{'name':_0x115947[_0x09f4('0x2e')],'type':_0x115947[_0x09f4('0x2f')][_0x09f4('0x30')]};});_0x5a1d97['model']=_['map'](_0x3bdf76,_0x09f4('0x29'));_0x5a1d97[_0x09f4('0x31')]=_['keys'](_0x623a97[_0x09f4('0x31')]);_0x5a1d97[_0x09f4('0x32')]=_[_0x09f4('0x33')](_0x5a1d97[_0x09f4('0x34')],_0x5a1d97[_0x09f4('0x31')]);_0xbcbdb4[_0x09f4('0x35')]=_[_0x09f4('0x33')](_0x5a1d97[_0x09f4('0x34')],qs['fields'](_0x623a97['query']['fields']));_0xbcbdb4[_0x09f4('0x35')]=_0xbcbdb4[_0x09f4('0x35')][_0x09f4('0x36')]?_0xbcbdb4[_0x09f4('0x35')]:_0x5a1d97[_0x09f4('0x34')];if(!_0x623a97['query'][_0x09f4('0x37')](_0x09f4('0x38'))){_0xbcbdb4[_0x09f4('0x1f')]=qs[_0x09f4('0x1f')](_0x623a97[_0x09f4('0x31')][_0x09f4('0x1f')]);_0xbcbdb4[_0x09f4('0x1c')]=qs[_0x09f4('0x1c')](_0x623a97[_0x09f4('0x31')][_0x09f4('0x1c')]);}_0xbcbdb4[_0x09f4('0x39')]=qs['sort'](_0x623a97[_0x09f4('0x31')][_0x09f4('0x3a')]);_0xbcbdb4[_0x09f4('0x3b')]=qs[_0x09f4('0x32')](_['pick'](_0x623a97[_0x09f4('0x31')],_0x5a1d97['filters']),_0x3bdf76);if(_0x623a97[_0x09f4('0x31')]['filter']){_0xbcbdb4[_0x09f4('0x3b')]=_[_0x09f4('0x3c')](_0xbcbdb4[_0x09f4('0x3b')],{'$or':_[_0x09f4('0x2b')](_0x3bdf76,function(_0x1314e8){if(_0x1314e8[_0x09f4('0x2f')]!==_0x09f4('0x3d')){var _0x4a260a={};_0x4a260a[_0x1314e8[_0x09f4('0x29')]]={'$like':'%'+_0x623a97[_0x09f4('0x31')][_0x09f4('0x3e')]+'%'};return _0x4a260a;}})});}_0xbcbdb4=_[_0x09f4('0x3c')]({},_0xbcbdb4,_0x623a97[_0x09f4('0x3f')]);var _0x51416e={'where':_0xbcbdb4[_0x09f4('0x3b')]};return db[_0x09f4('0x2c')][_0x09f4('0x1e')](_0x51416e)[_0x09f4('0x25')](function(_0x495888){_0xc47926[_0x09f4('0x1e')]=_0x495888;if(_0x623a97['query'][_0x09f4('0x40')]){_0xbcbdb4[_0x09f4('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x09f4('0x42')](_0xbcbdb4);})[_0x09f4('0x25')](function(_0x2f4887){_0xc47926['rows']=_0x2f4887;return _0xc47926;})['then'](respondWithFilteredResult(_0x2453a9,_0xbcbdb4))[_0x09f4('0x43')](handleError(_0x2453a9,null));};exports[_0x09f4('0x44')]=function(_0xfc08db,_0x3a171d){var _0x721462={'raw':![],'where':{'id':_0xfc08db[_0x09f4('0x45')]['id']}},_0x53c445={};_0x53c445[_0x09f4('0x34')]=_[_0x09f4('0x46')](db[_0x09f4('0x2c')]['rawAttributes']);_0x53c445[_0x09f4('0x31')]=_[_0x09f4('0x46')](_0xfc08db[_0x09f4('0x31')]);_0x53c445[_0x09f4('0x32')]=_[_0x09f4('0x33')](_0x53c445[_0x09f4('0x34')],_0x53c445[_0x09f4('0x31')]);_0x721462['attributes']=_[_0x09f4('0x33')](_0x53c445[_0x09f4('0x34')],qs[_0x09f4('0x47')](_0xfc08db['query'][_0x09f4('0x47')]));_0x721462[_0x09f4('0x35')]=_0x721462['attributes'][_0x09f4('0x36')]?_0x721462['attributes']:_0x53c445[_0x09f4('0x34')];if(_0xfc08db[_0x09f4('0x31')]['includeAll']){_0x721462['include']=[{'all':!![]}];}_0x721462=_[_0x09f4('0x3c')]({},_0x721462,_0xfc08db[_0x09f4('0x3f')]);return db[_0x09f4('0x2c')]['find'](_0x721462)[_0x09f4('0x25')](handleEntityNotFound(_0x3a171d,null))[_0x09f4('0x25')](respondWithResult(_0x3a171d,null))[_0x09f4('0x43')](handleError(_0x3a171d,null));};exports['create']=function(_0x5ef650,_0x5d33cc){return db['ServicenowAccount'][_0x09f4('0x48')](_0x5ef650[_0x09f4('0x49')],{})[_0x09f4('0x25')](respondWithResult(_0x5d33cc,0xc9))['catch'](handleError(_0x5d33cc,null));};exports[_0x09f4('0x24')]=function(_0x1e47f0,_0x45959a){if(_0x1e47f0[_0x09f4('0x49')]['id']){delete _0x1e47f0[_0x09f4('0x49')]['id'];}return db[_0x09f4('0x2c')][_0x09f4('0x4a')]({'where':{'id':_0x1e47f0['params']['id']}})[_0x09f4('0x25')](handleEntityNotFound(_0x45959a,null))['then'](saveUpdates(_0x1e47f0['body'],null))[_0x09f4('0x25')](respondWithResult(_0x45959a,null))[_0x09f4('0x43')](handleError(_0x45959a,null));};exports['destroy']=function(_0x3d86dc,_0x117a84){return db['ServicenowAccount'][_0x09f4('0x4a')]({'where':{'id':_0x3d86dc[_0x09f4('0x45')]['id']}})['then'](handleEntityNotFound(_0x117a84,null))['then'](removeEntity(_0x117a84,null))[_0x09f4('0x43')](handleError(_0x117a84,null));};exports['getConfigurations']=function(_0x3ba51c,_0x2b7319,_0x3f4d24){var _0x3d6e39={};var _0x554592={};var _0x4763bf;var _0x4b277f;return db[_0x09f4('0x2c')][_0x09f4('0x4b')]({'where':{'id':_0x3ba51c[_0x09f4('0x45')]['id']}})[_0x09f4('0x25')](handleEntityNotFound(_0x2b7319,null))[_0x09f4('0x25')](function(_0x57eb75){if(_0x57eb75){_0x4763bf=_0x57eb75;_0x554592['model']=_['keys'](db[_0x09f4('0x4c')][_0x09f4('0x2d')]);_0x554592[_0x09f4('0x31')]=_['keys'](_0x3ba51c[_0x09f4('0x31')]);_0x554592[_0x09f4('0x32')]=_['intersection'](_0x554592[_0x09f4('0x34')],_0x554592[_0x09f4('0x31')]);_0x3d6e39['attributes']=_[_0x09f4('0x33')](_0x554592['model'],qs[_0x09f4('0x47')](_0x3ba51c[_0x09f4('0x31')][_0x09f4('0x47')]));_0x3d6e39[_0x09f4('0x35')]=_0x3d6e39[_0x09f4('0x35')]['length']?_0x3d6e39['attributes']:_0x554592[_0x09f4('0x34')];_0x3d6e39['order']=qs[_0x09f4('0x3a')](_0x3ba51c[_0x09f4('0x31')][_0x09f4('0x3a')]);_0x3d6e39[_0x09f4('0x3b')]=qs[_0x09f4('0x32')](_[_0x09f4('0x4d')](_0x3ba51c[_0x09f4('0x31')],_0x554592[_0x09f4('0x32')]));if(_0x3ba51c[_0x09f4('0x31')][_0x09f4('0x3e')]){_0x3d6e39[_0x09f4('0x3b')]=_[_0x09f4('0x3c')](_0x3d6e39[_0x09f4('0x3b')],{'$or':_[_0x09f4('0x2b')](_0x3d6e39['attributes'],function(_0x52da97){var _0x338d35={};_0x338d35[_0x52da97]={'$like':'%'+_0x3ba51c[_0x09f4('0x31')][_0x09f4('0x3e')]+'%'};return _0x338d35;})});}_0x3d6e39=_[_0x09f4('0x3c')]({},_0x3d6e39,_0x3ba51c['options']);return _0x4763bf[_0x09f4('0x4e')](_0x3d6e39);}})['then'](function(_0x211d80){if(_0x211d80){_0x4b277f=_0x211d80['length'];if(!_0x3ba51c[_0x09f4('0x31')]['hasOwnProperty'](_0x09f4('0x38'))){_0x3d6e39[_0x09f4('0x1f')]=qs['limit'](_0x3ba51c['query'][_0x09f4('0x1f')]);_0x3d6e39[_0x09f4('0x1c')]=qs[_0x09f4('0x1c')](_0x3ba51c[_0x09f4('0x31')][_0x09f4('0x1c')]);}return _0x4763bf['getConfigurations'](_0x3d6e39);}})[_0x09f4('0x25')](function(_0x5b10e5){if(_0x5b10e5){return _0x5b10e5?{'count':_0x4b277f,'rows':_0x5b10e5}:null;}})[_0x09f4('0x25')](respondWithResult(_0x2b7319,null))['catch'](handleError(_0x2b7319,null));};exports[_0x09f4('0x4f')]=function(_0x2ed251,_0x2b77a7,_0x16343a){if(_0x2ed251['body']['id']){delete _0x2ed251[_0x09f4('0x49')]['id'];}return db['ServicenowAccount'][_0x09f4('0x4b')]({'where':{'id':_0x2ed251[_0x09f4('0x45')]['id']}})[_0x09f4('0x25')](handleEntityNotFound(_0x2b77a7,null))[_0x09f4('0x25')](function(_0x4e1628){if(_0x4e1628){_0x2ed251[_0x09f4('0x49')][_0x09f4('0x50')]=_0x4e1628['id'];_0x2ed251[_0x09f4('0x49')]['Subjects']=integrations['getSubjects'](_0x2ed251[_0x09f4('0x49')]['channel'],_0x2ed251['body'][_0x09f4('0x2f')]);_0x2ed251[_0x09f4('0x49')][_0x09f4('0x51')]=integrations[_0x09f4('0x52')](_0x2ed251[_0x09f4('0x49')][_0x09f4('0x53')],_0x2ed251[_0x09f4('0x49')]['type']);return db[_0x09f4('0x4c')][_0x09f4('0x48')](_0x2ed251[_0x09f4('0x49')],{'include':[{'model':db[_0x09f4('0x54')],'as':_0x09f4('0x55')},{'model':db[_0x09f4('0x54')],'as':_0x09f4('0x51')}]});}return null;})[_0x09f4('0x25')](respondWithResult(_0x2b77a7,null))[_0x09f4('0x43')](handleError(_0x2b77a7,null));};exports[_0x09f4('0x56')]=function(_0x5bd02f,_0x31d71a,_0x2b9c54){var _0x211c35=[_0x09f4('0x57'),_0x09f4('0x58'),_0x09f4('0x59'),_0x09f4('0x5a'),_0x09f4('0x5b'),_0x09f4('0x5c'),_0x09f4('0x5d'),_0x09f4('0x5e'),_0x09f4('0x5f')];var _0x402e6b=[_0x09f4('0x60'),_0x09f4('0x57'),_0x09f4('0x61'),_0x09f4('0x62'),_0x09f4('0x63'),_0x09f4('0x64'),_0x09f4('0x65'),_0x09f4('0x58'),'approval_history','number',_0x09f4('0x66'),_0x09f4('0x67'),'opened_by','user_input',_0x09f4('0x68'),'sys_domain',_0x09f4('0x69'),'sys_created_by',_0x09f4('0x59'),_0x09f4('0x39'),'calendar_stc',_0x09f4('0x6a'),_0x09f4('0x6b'),_0x09f4('0x6c'),_0x09f4('0x6d'),_0x09f4('0x6e'),_0x09f4('0x6f'),'business_service',_0x09f4('0x70'),_0x09f4('0x71'),_0x09f4('0x72'),_0x09f4('0x73'),_0x09f4('0x74'),_0x09f4('0x75'),_0x09f4('0x76'),'group_list','work_end',_0x09f4('0x77'),_0x09f4('0x78'),_0x09f4('0x79'),_0x09f4('0x7a'),'subcategory','work_notes',_0x09f4('0x7b'),_0x09f4('0x5b'),'correlation_display',_0x09f4('0x7c'),'work_start',_0x09f4('0x7d'),'business_stc',_0x09f4('0x7e'),_0x09f4('0x7f'),'calendar_duration','notify',_0x09f4('0x80'),_0x09f4('0x81'),_0x09f4('0x82'),_0x09f4('0x83'),_0x09f4('0x84'),_0x09f4('0x85'),_0x09f4('0x86'),'reopened_by',_0x09f4('0x5d'),_0x09f4('0x87'),_0x09f4('0x88'),_0x09f4('0x89'),_0x09f4('0x8a'),_0x09f4('0x8b'),'assigned_to',_0x09f4('0x5e'),_0x09f4('0x8c'),_0x09f4('0x8d'),_0x09f4('0x8e'),_0x09f4('0x8f'),_0x09f4('0x90'),_0x09f4('0x91'),_0x09f4('0x92'),'sys_tags',_0x09f4('0x93'),'upon_approval',_0x09f4('0x94'),_0x09f4('0x95'),_0x09f4('0x5f')];var _0x2f74d2='';var _0x3b47cd='';var _0x575016=[];var _0x4184ca='';var _0x21c60f='';var _0x187836=[];var _0x354b08='';var _0x400550='';var _0x15d6c6={};var _0x310a17='';return db['ServicenowAccount'][_0x09f4('0x4b')]({'where':{'id':_0x5bd02f[_0x09f4('0x45')]['id']},'attributes':['id',_0x09f4('0x96'),_0x09f4('0x97'),'email','remoteUri',_0x09f4('0x98')]})[_0x09f4('0x25')](handleEntityNotFound(_0x31d71a,null))[_0x09f4('0x25')](function(_0x578443){if(_0x578443){_0x310a17=_0x578443['remoteUri'];var _0x88eb3f=_0x310a17[_0x09f4('0x99')](-0x1);if(_0x88eb3f==='/'){_0x310a17=_0x310a17[_0x09f4('0x9a')](0x0,_0x310a17[_0x09f4('0x9b')](_0x88eb3f));}_0x400550=util[_0x09f4('0x9c')](_0x09f4('0x9d'),_0x310a17);_0x354b08=util['format'](_0x09f4('0x9e'),_0x310a17);_0x15d6c6={'user':_0x578443[_0x09f4('0x96')],'pass':_0x578443[_0x09f4('0x97')]};var _0x3a3b47={'method':_0x09f4('0x9f'),'uri':_0x400550+_0x09f4('0xa0'),'auth':_0x15d6c6,'json':!![]};return rp(_0x3a3b47);}})['then'](function(_0x271dfd){if(_0x271dfd[_0x09f4('0xa1')][_0x09f4('0x36')]>0x0){_0x2f74d2=_0x271dfd[_0x09f4('0xa1')];}console[_0x09f4('0xa2')](_0x09f4('0xa3'),_0x2f74d2);_0x187836=[];_0x3b47cd=Object[_0x09f4('0xa4')]([],_0x2f74d2);_[_0x09f4('0xa5')](_0x3b47cd,function(_0x5ce61b){return!_0x211c35[_0x09f4('0xa6')](_0x5ce61b['name']);});_0x3b47cd['forEach'](function(_0xeb0fdd){var _0x56914e=createFieldObject(_0x354b08,_0x15d6c6,_0xeb0fdd[_0x09f4('0xa7')],_0xeb0fdd[_0x09f4('0x29')],_0xeb0fdd[_0x09f4('0xa8')],![]);_0x187836['push'](_0x56914e);});return Promise['all'](_0x187836);})[_0x09f4('0x25')](function(_0x24ec47){_0x575016=_0x24ec47;_0x4184ca=Object['assign']([],_0x2f74d2);console['log'](_0x09f4('0xa9'),_0x2f74d2);_[_0x09f4('0xa5')](_0x4184ca,function(_0x456538){return _0x402e6b['includes'](_0x456538[_0x09f4('0x29')]);});console[_0x09f4('0xa2')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4184ca);_0x187836=[];_0x4184ca['forEach'](function(_0x46929a){var _0x371d18=createFieldObject(_0x354b08,_0x15d6c6,_0x46929a[_0x09f4('0xa7')],_0x46929a['name'],_0x46929a[_0x09f4('0xa8')],!![]);_0x187836[_0x09f4('0xaa')](_0x371d18);});return Promise[_0x09f4('0xab')](_0x187836);})[_0x09f4('0x25')](function(_0x398b44){_0x21c60f=_0x398b44;var _0x4f722e=_0x575016[_0x09f4('0xac')](_0x21c60f);return{'count':_0x4f722e[_0x09f4('0x36')],'rows':_0x4f722e};})[_0x09f4('0x25')](respondWithResult(_0x31d71a,null))[_0x09f4('0x43')](function(_0x354162){console['log'](_0x09f4('0xad')+_0x354162);var _0x11f778=_0x5bd02f['query'][_0x09f4('0xae')]?0x1f4:_0x354162[_0x09f4('0xaf')]||0x1f4;logger[_0x09f4('0x27')](_0x354162[_0x09f4('0x28')]);delete _0x354162[_0x09f4('0x29')];if(_0x11f778===0x191){_0x11f778=0x190;}_0x31d71a[_0x09f4('0x1a')](_0x11f778)[_0x09f4('0x2a')](_0x5bd02f['query'][_0x09f4('0xae')]?{'message':'Wrong\x20credentials','statusCode':_0x354162[_0x09f4('0xaf')]}:_0x354162);});};function createFieldObject(_0xa2e02c,_0x390743,_0x4b2c82,_0x161f3b,_0x316082,_0x5a2e8d){return new Promise(function(_0x26d51e,_0x1038d0){var _0x109cb2={'id':_0x161f3b,'name':_0x316082,'custom':_0x5a2e8d};if(_0x4b2c82==='boolean'){_0x109cb2[_0x09f4('0x3f')]=[{'name':'True','value':_0x09f4('0xb0')},{'name':_0x09f4('0xb1'),'value':_0x09f4('0xb2')}];_0x26d51e(_0x109cb2);}else{var _0xfeaabc={'method':_0x09f4('0x9f'),'uri':_0xa2e02c+'sys_choice?sysparm_query=name=incident^element='+_0x161f3b,'auth':_0x390743,'json':!![]};return rp(_0xfeaabc)[_0x09f4('0x25')](function(_0x2cdc42){var _0x38a2cc=[];if(_0x2cdc42[_0x09f4('0xa1')][_0x09f4('0x36')]>0x0){_0x2cdc42[_0x09f4('0xa1')]['forEach'](function(_0x23e614){if(_0x23e614[_0x09f4('0xb3')]===_0x09f4('0xb2')){var _0x32b136={'name':_0x23e614[_0x09f4('0xa8')],'value':_0x23e614['value']};_0x38a2cc[_0x09f4('0xaa')](_0x32b136);}});}_0x109cb2[_0x09f4('0x3f')]=_0x38a2cc;if(_0x109cb2['options'][_0x09f4('0x36')]>0x0){_0x26d51e(_0x109cb2);}else{if(_0x5a2e8d==![]){_0x26d51e();}else{_0x26d51e(_0x109cb2);}}});}});}
\ No newline at end of file
+var _0x6c47=['reopened_time','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','work_start','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','approval','due_date','sys_tags','escalation','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','send','Wrong\x20credentials','statusCode','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','ServicenowAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','filter','addConfiguration','AccountId','Subjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','subcategory','notify','incident_state','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','state','sys_created_by','calendar_stc','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','group_list','work_end'];(function(_0x380246,_0x5cccce){var _0x56b2db=function(_0x3c63e5){while(--_0x3c63e5){_0x380246['push'](_0x380246['shift']());}};_0x56b2db(++_0x5cccce);}(_0x6c47,0x194));var _0x76c4=function(_0x1db3d2,_0x2ae108){_0x1db3d2=_0x1db3d2-0x0;var _0x3d7b8a=_0x6c47[_0x1db3d2];return _0x3d7b8a;};'use strict';var emlformat=require(_0x76c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76c4('0x2'));var moment=require('moment');var BPromise=require(_0x76c4('0x3'));var Mustache=require(_0x76c4('0x4'));var util=require(_0x76c4('0x5'));var path=require(_0x76c4('0x6'));var sox=require('sox');var csv=require(_0x76c4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x76c4('0x8'));var crypto=require('crypto');var jsforce=require(_0x76c4('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x76c4('0x7'));var querystring=require(_0x76c4('0xa'));var Papa=require(_0x76c4('0xb'));var Redis=require(_0x76c4('0xc'));var authService=require(_0x76c4('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x76c4('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76c4('0xf'));var utils=require(_0x76c4('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x76c4('0x11'));var db=require(_0x76c4('0x12'))['db'];var integrations=require(_0x76c4('0x13'));function respondWithStatusCode(_0x214c4c,_0x333815){_0x333815=_0x333815||0xcc;return function(_0x489e6b){if(_0x489e6b){return _0x214c4c[_0x76c4('0x14')](_0x333815);}return _0x214c4c[_0x76c4('0x15')](_0x333815)[_0x76c4('0x16')]();};}function respondWithResult(_0x22ff78,_0x20bbf9){_0x20bbf9=_0x20bbf9||0xc8;return function(_0x16f8ec){if(_0x16f8ec){return _0x22ff78['status'](_0x20bbf9)[_0x76c4('0x17')](_0x16f8ec);}};}function respondWithFilteredResult(_0x1ccf83,_0x5ad396){return function(_0x512743){if(_0x512743){var _0x140b59=typeof _0x5ad396[_0x76c4('0x18')]===_0x76c4('0x19')&&typeof _0x5ad396['limit']===_0x76c4('0x19');var _0xde824b=_0x512743['count'];var _0x2c324f=_0x140b59?0x0:_0x5ad396['offset'];var _0x730897=_0x140b59?_0x512743[_0x76c4('0x1a')]:_0x5ad396['offset']+_0x5ad396[_0x76c4('0x1b')];var _0x168103;if(_0x730897>=_0xde824b){_0x730897=_0xde824b;_0x168103=0xc8;}else{_0x168103=0xce;}_0x1ccf83[_0x76c4('0x15')](_0x168103);return _0x1ccf83[_0x76c4('0x1c')](_0x76c4('0x1d'),_0x2c324f+'-'+_0x730897+'/'+_0xde824b)[_0x76c4('0x17')](_0x512743);}return null;};}function patchUpdates(_0x3cc836){return function(_0x36f5a8){try{jsonpatch[_0x76c4('0x1e')](_0x36f5a8,_0x3cc836,!![]);}catch(_0x1cf15a){return BPromise['reject'](_0x1cf15a);}return _0x36f5a8[_0x76c4('0x1f')]();};}function saveUpdates(_0x4dfed4,_0x28a33e){return function(_0x2bebb8){if(_0x2bebb8){return _0x2bebb8['update'](_0x4dfed4)[_0x76c4('0x20')](function(_0x5c789b){return _0x5c789b;});}return null;};}function removeEntity(_0x32cd98,_0x57cccb){return function(_0x2fb30c){if(_0x2fb30c){return _0x2fb30c[_0x76c4('0x21')]()[_0x76c4('0x20')](function(){_0x32cd98[_0x76c4('0x15')](0xcc)[_0x76c4('0x16')]();});}};}function handleEntityNotFound(_0x49f564,_0x5d1085){return function(_0x3fb89d){if(!_0x3fb89d){_0x49f564[_0x76c4('0x14')](0x194);}return _0x3fb89d;};}function handleError(_0x2a8766,_0xc9db77){_0xc9db77=_0xc9db77||0x1f4;return function(_0x26277d){logger[_0x76c4('0x22')](_0x26277d[_0x76c4('0x23')]);if(_0x26277d[_0x76c4('0x24')]){delete _0x26277d[_0x76c4('0x24')];}_0x2a8766[_0x76c4('0x15')](_0xc9db77)['send'](_0x26277d);};}exports[_0x76c4('0x25')]=function(_0x3a47a3,_0x1e4024){var _0x1e4922={},_0x7caef9={},_0x91a1f7={'count':0x0,'rows':[]};var _0x4ae540=_[_0x76c4('0x26')](db[_0x76c4('0x27')][_0x76c4('0x28')],function(_0x289918){return{'name':_0x289918['fieldName'],'type':_0x289918[_0x76c4('0x29')]['key']};});_0x7caef9[_0x76c4('0x2a')]=_[_0x76c4('0x26')](_0x4ae540,_0x76c4('0x24'));_0x7caef9[_0x76c4('0x2b')]=_[_0x76c4('0x2c')](_0x3a47a3[_0x76c4('0x2b')]);_0x7caef9[_0x76c4('0x2d')]=_[_0x76c4('0x2e')](_0x7caef9[_0x76c4('0x2a')],_0x7caef9['query']);_0x1e4922['attributes']=_[_0x76c4('0x2e')](_0x7caef9[_0x76c4('0x2a')],qs[_0x76c4('0x2f')](_0x3a47a3[_0x76c4('0x2b')][_0x76c4('0x2f')]));_0x1e4922[_0x76c4('0x30')]=_0x1e4922['attributes'][_0x76c4('0x31')]?_0x1e4922[_0x76c4('0x30')]:_0x7caef9[_0x76c4('0x2a')];if(!_0x3a47a3['query'][_0x76c4('0x32')](_0x76c4('0x33'))){_0x1e4922[_0x76c4('0x1b')]=qs[_0x76c4('0x1b')](_0x3a47a3['query']['limit']);_0x1e4922['offset']=qs[_0x76c4('0x18')](_0x3a47a3[_0x76c4('0x2b')][_0x76c4('0x18')]);}_0x1e4922[_0x76c4('0x34')]=qs[_0x76c4('0x35')](_0x3a47a3[_0x76c4('0x2b')][_0x76c4('0x35')]);_0x1e4922[_0x76c4('0x36')]=qs[_0x76c4('0x2d')](_[_0x76c4('0x37')](_0x3a47a3[_0x76c4('0x2b')],_0x7caef9['filters']),_0x4ae540);if(_0x3a47a3[_0x76c4('0x2b')]['filter']){_0x1e4922[_0x76c4('0x36')]=_[_0x76c4('0x38')](_0x1e4922[_0x76c4('0x36')],{'$or':_[_0x76c4('0x26')](_0x4ae540,function(_0x2b882a){if(_0x2b882a['type']!=='VIRTUAL'){var _0x59ee21={};_0x59ee21[_0x2b882a[_0x76c4('0x24')]]={'$like':'%'+_0x3a47a3['query']['filter']+'%'};return _0x59ee21;}})});}_0x1e4922=_[_0x76c4('0x38')]({},_0x1e4922,_0x3a47a3[_0x76c4('0x39')]);var _0x5c6dbd={'where':_0x1e4922[_0x76c4('0x36')]};return db['ServicenowAccount'][_0x76c4('0x1a')](_0x5c6dbd)['then'](function(_0x3af1f6){_0x91a1f7[_0x76c4('0x1a')]=_0x3af1f6;if(_0x3a47a3[_0x76c4('0x2b')][_0x76c4('0x3a')]){_0x1e4922[_0x76c4('0x3b')]=[{'all':!![]}];}return db[_0x76c4('0x27')][_0x76c4('0x3c')](_0x1e4922);})[_0x76c4('0x20')](function(_0x11d003){_0x91a1f7[_0x76c4('0x3d')]=_0x11d003;return _0x91a1f7;})[_0x76c4('0x20')](respondWithFilteredResult(_0x1e4024,_0x1e4922))[_0x76c4('0x3e')](handleError(_0x1e4024,null));};exports[_0x76c4('0x3f')]=function(_0x53f979,_0x42ba79){var _0x193f93={'raw':![],'where':{'id':_0x53f979[_0x76c4('0x40')]['id']}},_0x28a97d={};_0x28a97d['model']=_[_0x76c4('0x2c')](db['ServicenowAccount']['rawAttributes']);_0x28a97d[_0x76c4('0x2b')]=_[_0x76c4('0x2c')](_0x53f979[_0x76c4('0x2b')]);_0x28a97d[_0x76c4('0x2d')]=_[_0x76c4('0x2e')](_0x28a97d[_0x76c4('0x2a')],_0x28a97d[_0x76c4('0x2b')]);_0x193f93[_0x76c4('0x30')]=_[_0x76c4('0x2e')](_0x28a97d[_0x76c4('0x2a')],qs[_0x76c4('0x2f')](_0x53f979['query'][_0x76c4('0x2f')]));_0x193f93['attributes']=_0x193f93['attributes'][_0x76c4('0x31')]?_0x193f93[_0x76c4('0x30')]:_0x28a97d[_0x76c4('0x2a')];if(_0x53f979[_0x76c4('0x2b')][_0x76c4('0x3a')]){_0x193f93[_0x76c4('0x3b')]=[{'all':!![]}];}_0x193f93=_[_0x76c4('0x38')]({},_0x193f93,_0x53f979[_0x76c4('0x39')]);return db[_0x76c4('0x27')][_0x76c4('0x41')](_0x193f93)['then'](handleEntityNotFound(_0x42ba79,null))[_0x76c4('0x20')](respondWithResult(_0x42ba79,null))['catch'](handleError(_0x42ba79,null));};exports[_0x76c4('0x42')]=function(_0x260934,_0x4df035){return db[_0x76c4('0x27')]['create'](_0x260934[_0x76c4('0x43')],{})['then'](respondWithResult(_0x4df035,0xc9))[_0x76c4('0x3e')](handleError(_0x4df035,null));};exports['update']=function(_0xf7820b,_0x2956e3){if(_0xf7820b['body']['id']){delete _0xf7820b[_0x76c4('0x43')]['id'];}return db[_0x76c4('0x27')][_0x76c4('0x41')]({'where':{'id':_0xf7820b['params']['id']}})[_0x76c4('0x20')](handleEntityNotFound(_0x2956e3,null))['then'](saveUpdates(_0xf7820b[_0x76c4('0x43')],null))['then'](respondWithResult(_0x2956e3,null))[_0x76c4('0x3e')](handleError(_0x2956e3,null));};exports[_0x76c4('0x21')]=function(_0x5df743,_0x335cfc){return db[_0x76c4('0x27')][_0x76c4('0x41')]({'where':{'id':_0x5df743['params']['id']}})[_0x76c4('0x20')](handleEntityNotFound(_0x335cfc,null))['then'](removeEntity(_0x335cfc,null))[_0x76c4('0x3e')](handleError(_0x335cfc,null));};exports[_0x76c4('0x44')]=function(_0x1e2383,_0x4065af,_0x452c2c){var _0x2e7607={};var _0x8dfed5={};var _0x4dd50b;var _0x914d30;return db[_0x76c4('0x27')][_0x76c4('0x45')]({'where':{'id':_0x1e2383['params']['id']}})[_0x76c4('0x20')](handleEntityNotFound(_0x4065af,null))[_0x76c4('0x20')](function(_0x51c5f2){if(_0x51c5f2){_0x4dd50b=_0x51c5f2;_0x8dfed5[_0x76c4('0x2a')]=_[_0x76c4('0x2c')](db[_0x76c4('0x46')][_0x76c4('0x28')]);_0x8dfed5[_0x76c4('0x2b')]=_[_0x76c4('0x2c')](_0x1e2383[_0x76c4('0x2b')]);_0x8dfed5[_0x76c4('0x2d')]=_['intersection'](_0x8dfed5[_0x76c4('0x2a')],_0x8dfed5[_0x76c4('0x2b')]);_0x2e7607[_0x76c4('0x30')]=_['intersection'](_0x8dfed5['model'],qs['fields'](_0x1e2383['query'][_0x76c4('0x2f')]));_0x2e7607[_0x76c4('0x30')]=_0x2e7607[_0x76c4('0x30')]['length']?_0x2e7607[_0x76c4('0x30')]:_0x8dfed5[_0x76c4('0x2a')];_0x2e7607['order']=qs[_0x76c4('0x35')](_0x1e2383[_0x76c4('0x2b')][_0x76c4('0x35')]);_0x2e7607[_0x76c4('0x36')]=qs[_0x76c4('0x2d')](_[_0x76c4('0x37')](_0x1e2383[_0x76c4('0x2b')],_0x8dfed5[_0x76c4('0x2d')]));if(_0x1e2383['query'][_0x76c4('0x47')]){_0x2e7607[_0x76c4('0x36')]=_[_0x76c4('0x38')](_0x2e7607['where'],{'$or':_[_0x76c4('0x26')](_0x2e7607[_0x76c4('0x30')],function(_0x5897c5){var _0xada42c={};_0xada42c[_0x5897c5]={'$like':'%'+_0x1e2383[_0x76c4('0x2b')][_0x76c4('0x47')]+'%'};return _0xada42c;})});}_0x2e7607=_[_0x76c4('0x38')]({},_0x2e7607,_0x1e2383['options']);return _0x4dd50b[_0x76c4('0x44')](_0x2e7607);}})[_0x76c4('0x20')](function(_0x1c55b7){if(_0x1c55b7){_0x914d30=_0x1c55b7[_0x76c4('0x31')];if(!_0x1e2383[_0x76c4('0x2b')]['hasOwnProperty'](_0x76c4('0x33'))){_0x2e7607[_0x76c4('0x1b')]=qs[_0x76c4('0x1b')](_0x1e2383[_0x76c4('0x2b')]['limit']);_0x2e7607['offset']=qs[_0x76c4('0x18')](_0x1e2383[_0x76c4('0x2b')][_0x76c4('0x18')]);}return _0x4dd50b[_0x76c4('0x44')](_0x2e7607);}})['then'](function(_0x234f62){if(_0x234f62){return _0x234f62?{'count':_0x914d30,'rows':_0x234f62}:null;}})[_0x76c4('0x20')](respondWithResult(_0x4065af,null))['catch'](handleError(_0x4065af,null));};exports[_0x76c4('0x48')]=function(_0x1ea30b,_0xc37b79,_0x1cf95f){if(_0x1ea30b[_0x76c4('0x43')]['id']){delete _0x1ea30b[_0x76c4('0x43')]['id'];}return db[_0x76c4('0x27')][_0x76c4('0x45')]({'where':{'id':_0x1ea30b[_0x76c4('0x40')]['id']}})['then'](handleEntityNotFound(_0xc37b79,null))[_0x76c4('0x20')](function(_0xd97135){if(_0xd97135){_0x1ea30b[_0x76c4('0x43')][_0x76c4('0x49')]=_0xd97135['id'];_0x1ea30b[_0x76c4('0x43')][_0x76c4('0x4a')]=integrations['getSubjects'](_0x1ea30b[_0x76c4('0x43')]['channel'],_0x1ea30b[_0x76c4('0x43')][_0x76c4('0x29')]);_0x1ea30b[_0x76c4('0x43')][_0x76c4('0x4b')]=integrations['getDescriptions'](_0x1ea30b[_0x76c4('0x43')][_0x76c4('0x4c')],_0x1ea30b[_0x76c4('0x43')]['type']);return db[_0x76c4('0x46')][_0x76c4('0x42')](_0x1ea30b[_0x76c4('0x43')],{'include':[{'model':db[_0x76c4('0x4d')],'as':_0x76c4('0x4a')},{'model':db['ServicenowField'],'as':_0x76c4('0x4b')}]});}return null;})['then'](respondWithResult(_0xc37b79,null))[_0x76c4('0x3e')](handleError(_0xc37b79,null));};exports[_0x76c4('0x4e')]=function(_0x10dfd4,_0x32160a,_0x16ccf5){var _0x3160d7=[_0x76c4('0x4f'),_0x76c4('0x50'),'knowledge',_0x76c4('0x51'),'close_code',_0x76c4('0x52'),_0x76c4('0x53'),'severity','category'];var _0x464dbf=[_0x76c4('0x54'),'made_sla',_0x76c4('0x55'),'watch_list',_0x76c4('0x56'),_0x76c4('0x57'),_0x76c4('0x58'),_0x76c4('0x50'),'approval_history',_0x76c4('0x59'),_0x76c4('0x5a'),_0x76c4('0x5b'),_0x76c4('0x5c'),'user_input','sys_created_on','sys_domain',_0x76c4('0x5d'),_0x76c4('0x5e'),'knowledge',_0x76c4('0x34'),_0x76c4('0x5f'),'closed_at','cmdb_ci',_0x76c4('0x60'),_0x76c4('0x61'),'active',_0x76c4('0x62'),_0x76c4('0x63'),_0x76c4('0x64'),_0x76c4('0x65'),_0x76c4('0x66'),_0x76c4('0x67'),'expected_start','opened_at','business_duration',_0x76c4('0x68'),_0x76c4('0x69'),_0x76c4('0x6a'),_0x76c4('0x6b'),_0x76c4('0x6c'),'approval_set',_0x76c4('0x51'),_0x76c4('0x6d'),_0x76c4('0x6e'),_0x76c4('0x6f'),_0x76c4('0x70'),'delivery_task',_0x76c4('0x71'),_0x76c4('0x72'),'business_stc',_0x76c4('0x73'),'description',_0x76c4('0x74'),_0x76c4('0x52'),_0x76c4('0x75'),_0x76c4('0x76'),_0x76c4('0x77'),'follow_up','parent_incident','sys_id','contact_type',_0x76c4('0x78'),_0x76c4('0x53'),_0x76c4('0x79'),_0x76c4('0x7a'),_0x76c4('0x7b'),_0x76c4('0x7c'),_0x76c4('0x7d'),'assigned_to',_0x76c4('0x7e'),_0x76c4('0x7f'),_0x76c4('0x80'),_0x76c4('0x81'),'comments_and_work_notes',_0x76c4('0x82'),'sys_mod_count','reopen_count',_0x76c4('0x83'),_0x76c4('0x84'),'upon_approval',_0x76c4('0x85'),_0x76c4('0x86'),_0x76c4('0x87')];var _0x2d7743='';var _0x43758c='';var _0x397e84=[];var _0x20325b='';var _0x238cca='';var _0x1a9d52=[];var _0x37985a='';var _0x54aadb='';var _0x13de2f={};var _0x1f0450='';return db[_0x76c4('0x27')]['findOne']({'where':{'id':_0x10dfd4[_0x76c4('0x40')]['id']},'attributes':['id','username',_0x76c4('0x88'),_0x76c4('0x89'),_0x76c4('0x8a'),_0x76c4('0x8b')]})[_0x76c4('0x20')](handleEntityNotFound(_0x32160a,null))['then'](function(_0xcf0ab2){if(_0xcf0ab2){_0x1f0450=_0xcf0ab2[_0x76c4('0x8a')];var _0x17330e=_0x1f0450[_0x76c4('0x8c')](-0x1);if(_0x17330e==='/'){_0x1f0450=_0x1f0450[_0x76c4('0x8d')](0x0,_0x1f0450[_0x76c4('0x8e')](_0x17330e));}_0x54aadb=util[_0x76c4('0x8f')]('%s/api/now/doc/table/schema/',_0x1f0450);_0x37985a=util[_0x76c4('0x8f')]('%s/api/now/table/',_0x1f0450);_0x13de2f={'user':_0xcf0ab2[_0x76c4('0x90')],'pass':_0xcf0ab2[_0x76c4('0x88')]};var _0x5b22b4={'method':_0x76c4('0x91'),'uri':_0x54aadb+_0x76c4('0x92'),'auth':_0x13de2f,'json':!![]};return rp(_0x5b22b4);}})[_0x76c4('0x20')](function(_0x3143bf){if(_0x3143bf[_0x76c4('0x93')][_0x76c4('0x31')]>0x0){_0x2d7743=_0x3143bf[_0x76c4('0x93')];}console[_0x76c4('0x94')](_0x76c4('0x95'),_0x2d7743);_0x1a9d52=[];_0x43758c=Object[_0x76c4('0x96')]([],_0x2d7743);_[_0x76c4('0x97')](_0x43758c,function(_0x4badd3){return!_0x3160d7[_0x76c4('0x98')](_0x4badd3[_0x76c4('0x24')]);});_0x43758c[_0x76c4('0x99')](function(_0x27f068){var _0x309925=createFieldObject(_0x37985a,_0x13de2f,_0x27f068[_0x76c4('0x9a')],_0x27f068[_0x76c4('0x24')],_0x27f068[_0x76c4('0x9b')],![]);_0x1a9d52[_0x76c4('0x9c')](_0x309925);});return Promise[_0x76c4('0x9d')](_0x1a9d52);})['then'](function(_0x173673){_0x397e84=_0x173673;_0x20325b=Object['assign']([],_0x2d7743);console[_0x76c4('0x94')](_0x76c4('0x9e'),_0x2d7743);_['remove'](_0x20325b,function(_0x593d1d){return _0x464dbf['includes'](_0x593d1d['name']);});console[_0x76c4('0x94')](_0x76c4('0x9f'),_0x20325b);_0x1a9d52=[];_0x20325b[_0x76c4('0x99')](function(_0x2b0e83){var _0x54741d=createFieldObject(_0x37985a,_0x13de2f,_0x2b0e83[_0x76c4('0x9a')],_0x2b0e83[_0x76c4('0x24')],_0x2b0e83[_0x76c4('0x9b')],!![]);_0x1a9d52['push'](_0x54741d);});return Promise['all'](_0x1a9d52);})['then'](function(_0x21a102){_0x238cca=_0x21a102;var _0x377877=_0x397e84['concat'](_0x238cca);return{'count':_0x377877[_0x76c4('0x31')],'rows':_0x377877};})[_0x76c4('0x20')](respondWithResult(_0x32160a,null))[_0x76c4('0x3e')](function(_0x5d6fc0){console[_0x76c4('0x94')]('ServiceNow\x20error:\x20'+_0x5d6fc0);var _0x41ca01=_0x10dfd4[_0x76c4('0x2b')][_0x76c4('0xa0')]?0x1f4:_0x5d6fc0['statusCode']||0x1f4;logger[_0x76c4('0x22')](_0x5d6fc0[_0x76c4('0x23')]);delete _0x5d6fc0['name'];if(_0x41ca01===0x191){_0x41ca01=0x190;}_0x32160a[_0x76c4('0x15')](_0x41ca01)[_0x76c4('0xa1')](_0x10dfd4[_0x76c4('0x2b')][_0x76c4('0xa0')]?{'message':_0x76c4('0xa2'),'statusCode':_0x5d6fc0[_0x76c4('0xa3')]}:_0x5d6fc0);});};function createFieldObject(_0x2cbbf8,_0x482813,_0x1ff110,_0x5c7641,_0x1bd48d,_0x58768c){return new Promise(function(_0x3d1758,_0x174675){var _0x61810={'id':_0x5c7641,'name':_0x1bd48d,'custom':_0x58768c};if(_0x1ff110==='boolean'){_0x61810[_0x76c4('0x39')]=[{'name':_0x76c4('0xa4'),'value':'true'},{'name':_0x76c4('0xa5'),'value':_0x76c4('0xa6')}];_0x3d1758(_0x61810);}else{var _0x1245d8={'method':_0x76c4('0x91'),'uri':_0x2cbbf8+_0x76c4('0xa7')+_0x5c7641,'auth':_0x482813,'json':!![]};return rp(_0x1245d8)[_0x76c4('0x20')](function(_0x2abb16){var _0x20638a=[];if(_0x2abb16[_0x76c4('0x93')][_0x76c4('0x31')]>0x0){_0x2abb16[_0x76c4('0x93')][_0x76c4('0x99')](function(_0x26acac){if(_0x26acac[_0x76c4('0xa8')]==='false'){var _0x557893={'name':_0x26acac['label'],'value':_0x26acac[_0x76c4('0xa9')]};_0x20638a[_0x76c4('0x9c')](_0x557893);}});}_0x61810['options']=_0x20638a;if(_0x61810[_0x76c4('0x39')][_0x76c4('0x31')]>0x0){_0x3d1758(_0x61810);}else{if(_0x58768c==![]){_0x3d1758();}else{_0x3d1758(_0x61810);}}});}});}
\ No newline at end of file