Built motion from commit 97153652.|2.6.26
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 7e535c9..a0b0d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc685=['includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','incident_state','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','GET','result','log','incident\x20table\x20objects','remove','includes','internalType','label','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','forEach','value','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc685,0x71));var _0x5c68=function(_0x38d17b,_0x2fee22){_0x38d17b=_0x38d17b-0x0;var _0x3895be=_0xc685[_0x38d17b];return _0x3895be;};'use strict';var emlformat=require(_0x5c68('0x0'));var rimraf=require(_0x5c68('0x1'));var zipdir=require(_0x5c68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c68('0x3'));var moment=require('moment');var BPromise=require(_0x5c68('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5c68('0x5'));var sox=require('sox');var csv=require(_0x5c68('0x6'));var ejs=require(_0x5c68('0x7'));var fs=require('fs');var fs_extra=require(_0x5c68('0x8'));var _=require(_0x5c68('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c68('0xa'));var deskjs=require(_0x5c68('0xb'));var toCsv=require(_0x5c68('0x6'));var querystring=require(_0x5c68('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c68('0xd'));var qs=require(_0x5c68('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c68('0xf'));var logger=require(_0x5c68('0x10'))(_0x5c68('0x11'));var utils=require(_0x5c68('0x12'));var config=require(_0x5c68('0x13'));var licenseUtil=require(_0x5c68('0x14'));var db=require(_0x5c68('0x15'))['db'];var integrations=require(_0x5c68('0x16'));function respondWithStatusCode(_0x46ab29,_0x33e9f1){_0x33e9f1=_0x33e9f1||0xcc;return function(_0x51568b){if(_0x51568b){return _0x46ab29[_0x5c68('0x17')](_0x33e9f1);}return _0x46ab29[_0x5c68('0x18')](_0x33e9f1)[_0x5c68('0x19')]();};}function respondWithResult(_0x12b1f6,_0x2ecf34){_0x2ecf34=_0x2ecf34||0xc8;return function(_0x280ecb){if(_0x280ecb){return _0x12b1f6[_0x5c68('0x18')](_0x2ecf34)[_0x5c68('0x1a')](_0x280ecb);}};}function respondWithFilteredResult(_0x42b358,_0xcfbf64){return function(_0x4108ff){if(_0x4108ff){var _0x51e339=typeof _0xcfbf64[_0x5c68('0x1b')]===_0x5c68('0x1c')&&typeof _0xcfbf64[_0x5c68('0x1d')]===_0x5c68('0x1c');var _0x4f7798=_0x4108ff[_0x5c68('0x1e')];var _0x5e4042=_0x51e339?0x0:_0xcfbf64['offset'];var _0x2beffb=_0x51e339?_0x4108ff[_0x5c68('0x1e')]:_0xcfbf64[_0x5c68('0x1b')]+_0xcfbf64[_0x5c68('0x1d')];var _0x5e8fa9;if(_0x2beffb>=_0x4f7798){_0x2beffb=_0x4f7798;_0x5e8fa9=0xc8;}else{_0x5e8fa9=0xce;}_0x42b358[_0x5c68('0x18')](_0x5e8fa9);return _0x42b358[_0x5c68('0x1f')]('Content-Range',_0x5e4042+'-'+_0x2beffb+'/'+_0x4f7798)[_0x5c68('0x1a')](_0x4108ff);}return null;};}function patchUpdates(_0x2e4f31){return function(_0x53eb21){try{jsonpatch[_0x5c68('0x20')](_0x53eb21,_0x2e4f31,!![]);}catch(_0x3ecb8c){return BPromise[_0x5c68('0x21')](_0x3ecb8c);}return _0x53eb21['save']();};}function saveUpdates(_0x3d3f02,_0x381714){return function(_0x24bc13){if(_0x24bc13){return _0x24bc13[_0x5c68('0x22')](_0x3d3f02)['then'](function(_0xcefa15){return _0xcefa15;});}return null;};}function removeEntity(_0x541593,_0x37c6f8){return function(_0x2790d4){if(_0x2790d4){return _0x2790d4[_0x5c68('0x23')]()[_0x5c68('0x24')](function(){_0x541593[_0x5c68('0x18')](0xcc)[_0x5c68('0x19')]();});}};}function handleEntityNotFound(_0x3ade8b,_0xf1e7ad){return function(_0x284870){if(!_0x284870){_0x3ade8b[_0x5c68('0x17')](0x194);}return _0x284870;};}function handleError(_0x476c58,_0x473854){_0x473854=_0x473854||0x1f4;return function(_0x49f572){logger['error'](_0x49f572[_0x5c68('0x25')]);if(_0x49f572['name']){delete _0x49f572[_0x5c68('0x26')];}_0x476c58[_0x5c68('0x18')](_0x473854)[_0x5c68('0x27')](_0x49f572);};}exports[_0x5c68('0x28')]=function(_0x1fa535,_0x208fb2){var _0x56b09e={},_0xd81305={},_0x31adf7={'count':0x0,'rows':[]};var _0x405c17=_[_0x5c68('0x29')](db[_0x5c68('0x2a')][_0x5c68('0x2b')],function(_0x3b2784){return{'name':_0x3b2784[_0x5c68('0x2c')],'type':_0x3b2784[_0x5c68('0x2d')]['key']};});_0xd81305['model']=_[_0x5c68('0x29')](_0x405c17,'name');_0xd81305[_0x5c68('0x2e')]=_[_0x5c68('0x2f')](_0x1fa535[_0x5c68('0x2e')]);_0xd81305[_0x5c68('0x30')]=_[_0x5c68('0x31')](_0xd81305[_0x5c68('0x32')],_0xd81305[_0x5c68('0x2e')]);_0x56b09e['attributes']=_[_0x5c68('0x31')](_0xd81305[_0x5c68('0x32')],qs['fields'](_0x1fa535[_0x5c68('0x2e')][_0x5c68('0x33')]));_0x56b09e[_0x5c68('0x34')]=_0x56b09e[_0x5c68('0x34')][_0x5c68('0x35')]?_0x56b09e[_0x5c68('0x34')]:_0xd81305[_0x5c68('0x32')];if(!_0x1fa535['query'][_0x5c68('0x36')](_0x5c68('0x37'))){_0x56b09e[_0x5c68('0x1d')]=qs['limit'](_0x1fa535['query'][_0x5c68('0x1d')]);_0x56b09e[_0x5c68('0x1b')]=qs['offset'](_0x1fa535[_0x5c68('0x2e')][_0x5c68('0x1b')]);}_0x56b09e[_0x5c68('0x38')]=qs[_0x5c68('0x39')](_0x1fa535[_0x5c68('0x2e')]['sort']);_0x56b09e[_0x5c68('0x3a')]=qs[_0x5c68('0x30')](_['pick'](_0x1fa535[_0x5c68('0x2e')],_0xd81305[_0x5c68('0x30')]),_0x405c17);if(_0x1fa535[_0x5c68('0x2e')][_0x5c68('0x3b')]){_0x56b09e[_0x5c68('0x3a')]=_[_0x5c68('0x3c')](_0x56b09e[_0x5c68('0x3a')],{'$or':_[_0x5c68('0x29')](_0x405c17,function(_0x8b89c8){if(_0x8b89c8['type']!==_0x5c68('0x3d')){var _0x52e12e={};_0x52e12e[_0x8b89c8[_0x5c68('0x26')]]={'$like':'%'+_0x1fa535[_0x5c68('0x2e')][_0x5c68('0x3b')]+'%'};return _0x52e12e;}})});}_0x56b09e=_['merge']({},_0x56b09e,_0x1fa535[_0x5c68('0x3e')]);var _0x1a39cc={'where':_0x56b09e[_0x5c68('0x3a')]};return db[_0x5c68('0x2a')]['count'](_0x1a39cc)[_0x5c68('0x24')](function(_0x226caf){_0x31adf7['count']=_0x226caf;if(_0x1fa535[_0x5c68('0x2e')][_0x5c68('0x3f')]){_0x56b09e[_0x5c68('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x5c68('0x41')](_0x56b09e);})[_0x5c68('0x24')](function(_0xe90c09){_0x31adf7[_0x5c68('0x42')]=_0xe90c09;return _0x31adf7;})[_0x5c68('0x24')](respondWithFilteredResult(_0x208fb2,_0x56b09e))[_0x5c68('0x43')](handleError(_0x208fb2,null));};exports[_0x5c68('0x44')]=function(_0x319436,_0x2fff1e){var _0x3d8eff={'raw':![],'where':{'id':_0x319436['params']['id']}},_0x235eb7={};_0x235eb7[_0x5c68('0x32')]=_[_0x5c68('0x2f')](db['ServicenowAccount'][_0x5c68('0x2b')]);_0x235eb7[_0x5c68('0x2e')]=_[_0x5c68('0x2f')](_0x319436[_0x5c68('0x2e')]);_0x235eb7[_0x5c68('0x30')]=_['intersection'](_0x235eb7[_0x5c68('0x32')],_0x235eb7['query']);_0x3d8eff[_0x5c68('0x34')]=_[_0x5c68('0x31')](_0x235eb7[_0x5c68('0x32')],qs[_0x5c68('0x33')](_0x319436[_0x5c68('0x2e')][_0x5c68('0x33')]));_0x3d8eff[_0x5c68('0x34')]=_0x3d8eff[_0x5c68('0x34')][_0x5c68('0x35')]?_0x3d8eff['attributes']:_0x235eb7[_0x5c68('0x32')];if(_0x319436[_0x5c68('0x2e')]['includeAll']){_0x3d8eff[_0x5c68('0x40')]=[{'all':!![]}];}_0x3d8eff=_[_0x5c68('0x3c')]({},_0x3d8eff,_0x319436['options']);return db[_0x5c68('0x2a')][_0x5c68('0x45')](_0x3d8eff)['then'](handleEntityNotFound(_0x2fff1e,null))[_0x5c68('0x24')](respondWithResult(_0x2fff1e,null))[_0x5c68('0x43')](handleError(_0x2fff1e,null));};exports['create']=function(_0x29c093,_0x55cad7){return db['ServicenowAccount'][_0x5c68('0x46')](_0x29c093['body'],{})[_0x5c68('0x24')](respondWithResult(_0x55cad7,0xc9))['catch'](handleError(_0x55cad7,null));};exports[_0x5c68('0x22')]=function(_0x2e3622,_0xf22e31){if(_0x2e3622[_0x5c68('0x47')]['id']){delete _0x2e3622[_0x5c68('0x47')]['id'];}return db[_0x5c68('0x2a')][_0x5c68('0x45')]({'where':{'id':_0x2e3622['params']['id']}})[_0x5c68('0x24')](handleEntityNotFound(_0xf22e31,null))[_0x5c68('0x24')](saveUpdates(_0x2e3622[_0x5c68('0x47')],null))[_0x5c68('0x24')](respondWithResult(_0xf22e31,null))['catch'](handleError(_0xf22e31,null));};exports['destroy']=function(_0x55c650,_0x31a2c1){return db[_0x5c68('0x2a')][_0x5c68('0x45')]({'where':{'id':_0x55c650[_0x5c68('0x48')]['id']}})[_0x5c68('0x24')](handleEntityNotFound(_0x31a2c1,null))[_0x5c68('0x24')](removeEntity(_0x31a2c1,null))[_0x5c68('0x43')](handleError(_0x31a2c1,null));};exports[_0x5c68('0x49')]=function(_0x11ef44,_0x2189a5,_0x53b9af){var _0xb62c72={};var _0x8eac4c={};var _0x59256b;var _0x388a1c;return db[_0x5c68('0x2a')][_0x5c68('0x4a')]({'where':{'id':_0x11ef44[_0x5c68('0x48')]['id']}})['then'](handleEntityNotFound(_0x2189a5,null))[_0x5c68('0x24')](function(_0x384271){if(_0x384271){_0x59256b=_0x384271;_0x8eac4c[_0x5c68('0x32')]=_[_0x5c68('0x2f')](db['ServicenowConfiguration'][_0x5c68('0x2b')]);_0x8eac4c[_0x5c68('0x2e')]=_[_0x5c68('0x2f')](_0x11ef44[_0x5c68('0x2e')]);_0x8eac4c[_0x5c68('0x30')]=_['intersection'](_0x8eac4c[_0x5c68('0x32')],_0x8eac4c[_0x5c68('0x2e')]);_0xb62c72[_0x5c68('0x34')]=_[_0x5c68('0x31')](_0x8eac4c['model'],qs[_0x5c68('0x33')](_0x11ef44[_0x5c68('0x2e')]['fields']));_0xb62c72[_0x5c68('0x34')]=_0xb62c72[_0x5c68('0x34')][_0x5c68('0x35')]?_0xb62c72['attributes']:_0x8eac4c['model'];_0xb62c72[_0x5c68('0x38')]=qs['sort'](_0x11ef44[_0x5c68('0x2e')][_0x5c68('0x39')]);_0xb62c72[_0x5c68('0x3a')]=qs[_0x5c68('0x30')](_[_0x5c68('0x4b')](_0x11ef44[_0x5c68('0x2e')],_0x8eac4c[_0x5c68('0x30')]));if(_0x11ef44[_0x5c68('0x2e')]['filter']){_0xb62c72[_0x5c68('0x3a')]=_[_0x5c68('0x3c')](_0xb62c72[_0x5c68('0x3a')],{'$or':_[_0x5c68('0x29')](_0xb62c72['attributes'],function(_0x2768dd){var _0x1e45ed={};_0x1e45ed[_0x2768dd]={'$like':'%'+_0x11ef44[_0x5c68('0x2e')][_0x5c68('0x3b')]+'%'};return _0x1e45ed;})});}_0xb62c72=_[_0x5c68('0x3c')]({},_0xb62c72,_0x11ef44[_0x5c68('0x3e')]);return _0x59256b['getConfigurations'](_0xb62c72);}})[_0x5c68('0x24')](function(_0x58c812){if(_0x58c812){_0x388a1c=_0x58c812[_0x5c68('0x35')];if(!_0x11ef44[_0x5c68('0x2e')][_0x5c68('0x36')](_0x5c68('0x37'))){_0xb62c72[_0x5c68('0x1d')]=qs[_0x5c68('0x1d')](_0x11ef44['query'][_0x5c68('0x1d')]);_0xb62c72[_0x5c68('0x1b')]=qs['offset'](_0x11ef44['query'][_0x5c68('0x1b')]);}return _0x59256b[_0x5c68('0x49')](_0xb62c72);}})[_0x5c68('0x24')](function(_0x5ef82a){if(_0x5ef82a){return _0x5ef82a?{'count':_0x388a1c,'rows':_0x5ef82a}:null;}})[_0x5c68('0x24')](respondWithResult(_0x2189a5,null))[_0x5c68('0x43')](handleError(_0x2189a5,null));};exports[_0x5c68('0x4c')]=function(_0xab667d,_0x2ea7cc,_0x16b703){if(_0xab667d[_0x5c68('0x47')]['id']){delete _0xab667d['body']['id'];}return db[_0x5c68('0x2a')][_0x5c68('0x4a')]({'where':{'id':_0xab667d['params']['id']}})[_0x5c68('0x24')](handleEntityNotFound(_0x2ea7cc,null))[_0x5c68('0x24')](function(_0x5442f6){if(_0x5442f6){_0xab667d[_0x5c68('0x47')]['AccountId']=_0x5442f6['id'];_0xab667d[_0x5c68('0x47')][_0x5c68('0x4d')]=integrations[_0x5c68('0x4e')](_0xab667d[_0x5c68('0x47')][_0x5c68('0x4f')],_0xab667d[_0x5c68('0x47')][_0x5c68('0x2d')]);_0xab667d[_0x5c68('0x47')][_0x5c68('0x50')]=integrations[_0x5c68('0x51')](_0xab667d[_0x5c68('0x47')]['channel'],_0xab667d[_0x5c68('0x47')][_0x5c68('0x2d')]);return db[_0x5c68('0x52')][_0x5c68('0x46')](_0xab667d[_0x5c68('0x47')],{'include':[{'model':db[_0x5c68('0x53')],'as':'Subjects'},{'model':db[_0x5c68('0x53')],'as':'Descriptions'}]});}return null;})[_0x5c68('0x24')](respondWithResult(_0x2ea7cc,null))[_0x5c68('0x43')](handleError(_0x2ea7cc,null));};exports[_0x5c68('0x54')]=function(_0x57024a,_0x5ca723,_0x4bc51f){var _0x10325a=[_0x5c68('0x55'),_0x5c68('0x56'),_0x5c68('0x57'),'subcategory','close_code',_0x5c68('0x58'),_0x5c68('0x59'),'severity',_0x5c68('0x5a')];var _0x8201e=['parent',_0x5c68('0x55'),_0x5c68('0x5b'),'watch_list',_0x5c68('0x5c'),_0x5c68('0x5d'),_0x5c68('0x5e'),_0x5c68('0x56'),_0x5c68('0x5f'),_0x5c68('0x60'),_0x5c68('0x61'),'sys_updated_by',_0x5c68('0x62'),'user_input',_0x5c68('0x63'),'sys_domain','state','sys_created_by',_0x5c68('0x57'),'order',_0x5c68('0x64'),'closed_at',_0x5c68('0x65'),_0x5c68('0x66'),_0x5c68('0x67'),_0x5c68('0x68'),_0x5c68('0x69'),_0x5c68('0x6a'),_0x5c68('0x6b'),'sys_domain_path',_0x5c68('0x6c'),_0x5c68('0x6d'),_0x5c68('0x6e'),_0x5c68('0x6f'),_0x5c68('0x70'),_0x5c68('0x71'),'work_end',_0x5c68('0x72'),'resolved_at',_0x5c68('0x73'),_0x5c68('0x74'),_0x5c68('0x75'),_0x5c68('0x76'),_0x5c68('0x77'),_0x5c68('0x78'),_0x5c68('0x79'),_0x5c68('0x7a'),_0x5c68('0x7b'),'assignment_group','business_stc',_0x5c68('0x7c'),_0x5c68('0x7d'),_0x5c68('0x7e'),_0x5c68('0x58'),_0x5c68('0x7f'),_0x5c68('0x80'),_0x5c68('0x81'),'follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state',_0x5c68('0x82'),_0x5c68('0x83'),_0x5c68('0x84'),_0x5c68('0x85'),_0x5c68('0x86'),_0x5c68('0x87'),'severity',_0x5c68('0x88'),'sla_due','approval',_0x5c68('0x89'),'due_date',_0x5c68('0x8a'),_0x5c68('0x8b'),_0x5c68('0x8c'),'escalation',_0x5c68('0x8d'),_0x5c68('0x8e'),'location',_0x5c68('0x5a')];var _0x3c5e1b='';var _0x44b5a8='';var _0x4556ea=[];var _0x163dc4='';var _0x710a74='';var _0x17fc20=[];var _0x12ce4a='';var _0x2bcaf4='';var _0x6cac81={};var _0x33d63b='';return db[_0x5c68('0x2a')][_0x5c68('0x4a')]({'where':{'id':_0x57024a[_0x5c68('0x48')]['id']},'attributes':['id',_0x5c68('0x8f'),_0x5c68('0x90'),_0x5c68('0x91'),_0x5c68('0x92'),_0x5c68('0x93')]})[_0x5c68('0x24')](handleEntityNotFound(_0x5ca723,null))[_0x5c68('0x24')](function(_0x5d35da){if(_0x5d35da){_0x33d63b=_0x5d35da[_0x5c68('0x92')];var _0x23c139=_0x33d63b[_0x5c68('0x94')](-0x1);if(_0x23c139==='/'){_0x33d63b=_0x33d63b['substring'](0x0,_0x33d63b[_0x5c68('0x95')](_0x23c139));}_0x2bcaf4=util[_0x5c68('0x96')]('%s/api/now/doc/table/schema/',_0x33d63b);_0x12ce4a=util[_0x5c68('0x96')]('%s/api/now/table/',_0x33d63b);_0x6cac81={'user':_0x5d35da['username'],'pass':_0x5d35da[_0x5c68('0x90')]};var _0x4c2fce={'method':_0x5c68('0x97'),'uri':_0x2bcaf4+'incident?sysparm_display_value=all','auth':_0x6cac81,'json':!![]};return rp(_0x4c2fce);}})['then'](function(_0x117687){if(_0x117687[_0x5c68('0x98')][_0x5c68('0x35')]>0x0){_0x3c5e1b=_0x117687[_0x5c68('0x98')];}console[_0x5c68('0x99')](_0x5c68('0x9a'),_0x3c5e1b);_0x17fc20=[];_0x44b5a8=Object['assign']([],_0x3c5e1b);_[_0x5c68('0x9b')](_0x44b5a8,function(_0x2cc992){return!_0x10325a[_0x5c68('0x9c')](_0x2cc992[_0x5c68('0x26')]);});_0x44b5a8['forEach'](function(_0x353222){var _0x2efa0a=createFieldObject(_0x12ce4a,_0x6cac81,_0x353222[_0x5c68('0x9d')],_0x353222[_0x5c68('0x26')],_0x353222[_0x5c68('0x9e')],![]);_0x17fc20['push'](_0x2efa0a);});return Promise['all'](_0x17fc20);})[_0x5c68('0x24')](function(_0x11c6b9){_0x4556ea=_0x11c6b9;_0x163dc4=Object[_0x5c68('0x9f')]([],_0x3c5e1b);console[_0x5c68('0x99')](_0x5c68('0xa0'),_0x3c5e1b);_[_0x5c68('0x9b')](_0x163dc4,function(_0x296700){return _0x8201e[_0x5c68('0x9c')](_0x296700[_0x5c68('0x26')]);});console[_0x5c68('0x99')](_0x5c68('0xa1'),_0x163dc4);_0x17fc20=[];_0x163dc4['forEach'](function(_0x24657d){var _0xe8092c=createFieldObject(_0x12ce4a,_0x6cac81,_0x24657d['internalType'],_0x24657d['name'],_0x24657d[_0x5c68('0x9e')],!![]);_0x17fc20[_0x5c68('0xa2')](_0xe8092c);});return Promise[_0x5c68('0xa3')](_0x17fc20);})[_0x5c68('0x24')](function(_0x1e73b1){_0x710a74=_0x1e73b1;var _0x46c2ae=_0x4556ea[_0x5c68('0xa4')](_0x710a74);return{'count':_0x46c2ae[_0x5c68('0x35')],'rows':_0x46c2ae};})[_0x5c68('0x24')](respondWithResult(_0x5ca723,null))[_0x5c68('0x43')](function(_0x476ac5){console[_0x5c68('0x99')](_0x5c68('0xa5')+_0x476ac5);var _0x1c6655=_0x57024a[_0x5c68('0x2e')][_0x5c68('0xa6')]?0x1f4:_0x476ac5[_0x5c68('0xa7')]||0x1f4;logger['error'](_0x476ac5[_0x5c68('0x25')]);delete _0x476ac5[_0x5c68('0x26')];if(_0x1c6655===0x191){_0x1c6655=0x190;}_0x5ca723['status'](_0x1c6655)[_0x5c68('0x27')](_0x57024a[_0x5c68('0x2e')][_0x5c68('0xa6')]?{'message':_0x5c68('0xa8'),'statusCode':_0x476ac5[_0x5c68('0xa7')]}:_0x476ac5);});};function createFieldObject(_0xb4709f,_0x35dd09,_0x529d55,_0x35c789,_0x3e6577,_0x1bb4c7){return new Promise(function(_0x45b3aa,_0x418db0){var _0x2daffd={'id':_0x35c789,'name':_0x3e6577,'custom':_0x1bb4c7};if(_0x529d55===_0x5c68('0xa9')){_0x2daffd[_0x5c68('0x3e')]=[{'name':_0x5c68('0xaa'),'value':_0x5c68('0xab')},{'name':_0x5c68('0xac'),'value':_0x5c68('0xad')}];_0x45b3aa(_0x2daffd);}else{var _0x1fc5eb={'method':_0x5c68('0x97'),'uri':_0xb4709f+'sys_choice?sysparm_query=name=incident^element='+_0x35c789,'auth':_0x35dd09,'json':!![]};return rp(_0x1fc5eb)['then'](function(_0x2b551){var _0x2107a5=[];if(_0x2b551['result']['length']>0x0){_0x2b551[_0x5c68('0x98')][_0x5c68('0xae')](function(_0x4d0358){if(_0x4d0358['inactive']===_0x5c68('0xad')){var _0x5ebf0d={'name':_0x4d0358[_0x5c68('0x9e')],'value':_0x4d0358[_0x5c68('0xaf')]};_0x2107a5[_0x5c68('0xa2')](_0x5ebf0d);}});}_0x2daffd[_0x5c68('0x3e')]=_0x2107a5;if(_0x2daffd[_0x5c68('0x3e')][_0x5c68('0x35')]>0x0){_0x45b3aa(_0x2daffd);}else{if(_0x1bb4c7==![]){_0x45b3aa();}else{_0x45b3aa(_0x2daffd);}}});}});}
\ No newline at end of file
+var _0xfc58=['findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','hold_reason','subcategory','close_code','severity','category','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','correlation_display','work_start','assignment_group','business_stc','description','notify','sys_class_name','close_notes','parent_incident','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xfc58,0x1c1));var _0x8fc5=function(_0x7eb3ad,_0x571c4e){_0x7eb3ad=_0x7eb3ad-0x0;var _0x19816b=_0xfc58[_0x7eb3ad];return _0x19816b;};'use strict';var emlformat=require(_0x8fc5('0x0'));var rimraf=require(_0x8fc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8fc5('0x2'));var moment=require(_0x8fc5('0x3'));var BPromise=require(_0x8fc5('0x4'));var Mustache=require('mustache');var util=require(_0x8fc5('0x5'));var path=require('path');var sox=require(_0x8fc5('0x6'));var csv=require(_0x8fc5('0x7'));var ejs=require(_0x8fc5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fc5('0x9'));var squel=require(_0x8fc5('0xa'));var crypto=require(_0x8fc5('0xb'));var jsforce=require(_0x8fc5('0xc'));var deskjs=require(_0x8fc5('0xd'));var toCsv=require(_0x8fc5('0x7'));var querystring=require(_0x8fc5('0xe'));var Papa=require(_0x8fc5('0xf'));var Redis=require('ioredis');var authService=require(_0x8fc5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8fc5('0x11'));var hardwareService=require(_0x8fc5('0x12'));var logger=require(_0x8fc5('0x13'))(_0x8fc5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8fc5('0x15'));var db=require(_0x8fc5('0x16'))['db'];var integrations=require(_0x8fc5('0x17'));function respondWithStatusCode(_0x474c7c,_0x44c747){_0x44c747=_0x44c747||0xcc;return function(_0x6db857){if(_0x6db857){return _0x474c7c[_0x8fc5('0x18')](_0x44c747);}return _0x474c7c[_0x8fc5('0x19')](_0x44c747)[_0x8fc5('0x1a')]();};}function respondWithResult(_0xb77bdf,_0x567b29){_0x567b29=_0x567b29||0xc8;return function(_0x49e8a1){if(_0x49e8a1){return _0xb77bdf[_0x8fc5('0x19')](_0x567b29)[_0x8fc5('0x1b')](_0x49e8a1);}};}function respondWithFilteredResult(_0x53a054,_0x5ea7ca){return function(_0x5e6581){if(_0x5e6581){var _0x5e04e2=typeof _0x5ea7ca[_0x8fc5('0x1c')]===_0x8fc5('0x1d')&&typeof _0x5ea7ca[_0x8fc5('0x1e')]==='undefined';var _0x4edbc5=_0x5e6581[_0x8fc5('0x1f')];var _0x20156b=_0x5e04e2?0x0:_0x5ea7ca[_0x8fc5('0x1c')];var _0x2305e9=_0x5e04e2?_0x5e6581[_0x8fc5('0x1f')]:_0x5ea7ca['offset']+_0x5ea7ca['limit'];var _0x5e21f2;if(_0x2305e9>=_0x4edbc5){_0x2305e9=_0x4edbc5;_0x5e21f2=0xc8;}else{_0x5e21f2=0xce;}_0x53a054[_0x8fc5('0x19')](_0x5e21f2);return _0x53a054['set'](_0x8fc5('0x20'),_0x20156b+'-'+_0x2305e9+'/'+_0x4edbc5)[_0x8fc5('0x1b')](_0x5e6581);}return null;};}function patchUpdates(_0x1dc57e){return function(_0x2c857a){try{jsonpatch[_0x8fc5('0x21')](_0x2c857a,_0x1dc57e,!![]);}catch(_0x16346e){return BPromise[_0x8fc5('0x22')](_0x16346e);}return _0x2c857a['save']();};}function saveUpdates(_0x5726c0,_0x24f197){return function(_0x385a4a){if(_0x385a4a){return _0x385a4a[_0x8fc5('0x23')](_0x5726c0)[_0x8fc5('0x24')](function(_0x35e509){return _0x35e509;});}return null;};}function removeEntity(_0x364231,_0x34b140){return function(_0x29dc72){if(_0x29dc72){return _0x29dc72[_0x8fc5('0x25')]()[_0x8fc5('0x24')](function(){_0x364231[_0x8fc5('0x19')](0xcc)[_0x8fc5('0x1a')]();});}};}function handleEntityNotFound(_0x34429e,_0x447821){return function(_0xa71486){if(!_0xa71486){_0x34429e[_0x8fc5('0x18')](0x194);}return _0xa71486;};}function handleError(_0x2873c9,_0x207de9){_0x207de9=_0x207de9||0x1f4;return function(_0xb0112c){logger[_0x8fc5('0x26')](_0xb0112c[_0x8fc5('0x27')]);if(_0xb0112c['name']){delete _0xb0112c[_0x8fc5('0x28')];}_0x2873c9[_0x8fc5('0x19')](_0x207de9)[_0x8fc5('0x29')](_0xb0112c);};}exports['index']=function(_0x4803e8,_0x5c8a87){var _0x339ca4={},_0x34c820={},_0x314eeb={'count':0x0,'rows':[]};var _0x573e79=_['map'](db[_0x8fc5('0x2a')][_0x8fc5('0x2b')],function(_0x86569d){return{'name':_0x86569d[_0x8fc5('0x2c')],'type':_0x86569d['type'][_0x8fc5('0x2d')]};});_0x34c820[_0x8fc5('0x2e')]=_['map'](_0x573e79,_0x8fc5('0x28'));_0x34c820[_0x8fc5('0x2f')]=_[_0x8fc5('0x30')](_0x4803e8['query']);_0x34c820[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x34c820[_0x8fc5('0x2e')],_0x34c820['query']);_0x339ca4[_0x8fc5('0x33')]=_['intersection'](_0x34c820[_0x8fc5('0x2e')],qs[_0x8fc5('0x34')](_0x4803e8[_0x8fc5('0x2f')]['fields']));_0x339ca4['attributes']=_0x339ca4[_0x8fc5('0x33')]['length']?_0x339ca4['attributes']:_0x34c820['model'];if(!_0x4803e8['query'][_0x8fc5('0x35')](_0x8fc5('0x36'))){_0x339ca4[_0x8fc5('0x1e')]=qs[_0x8fc5('0x1e')](_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x1e')]);_0x339ca4['offset']=qs[_0x8fc5('0x1c')](_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x1c')]);}_0x339ca4[_0x8fc5('0x37')]=qs[_0x8fc5('0x38')](_0x4803e8[_0x8fc5('0x2f')]['sort']);_0x339ca4[_0x8fc5('0x39')]=qs[_0x8fc5('0x31')](_[_0x8fc5('0x3a')](_0x4803e8[_0x8fc5('0x2f')],_0x34c820['filters']),_0x573e79);if(_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x3b')]){_0x339ca4[_0x8fc5('0x39')]=_[_0x8fc5('0x3c')](_0x339ca4[_0x8fc5('0x39')],{'$or':_[_0x8fc5('0x3d')](_0x573e79,function(_0x4979c2){if(_0x4979c2[_0x8fc5('0x3e')]!=='VIRTUAL'){var _0x432ad7={};_0x432ad7[_0x4979c2['name']]={'$like':'%'+_0x4803e8[_0x8fc5('0x2f')]['filter']+'%'};return _0x432ad7;}})});}_0x339ca4=_[_0x8fc5('0x3c')]({},_0x339ca4,_0x4803e8[_0x8fc5('0x3f')]);var _0x53ccce={'where':_0x339ca4[_0x8fc5('0x39')]};return db[_0x8fc5('0x2a')][_0x8fc5('0x1f')](_0x53ccce)[_0x8fc5('0x24')](function(_0x53528f){_0x314eeb[_0x8fc5('0x1f')]=_0x53528f;if(_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x40')]){_0x339ca4[_0x8fc5('0x41')]=[{'all':!![]}];}return db[_0x8fc5('0x2a')][_0x8fc5('0x42')](_0x339ca4);})[_0x8fc5('0x24')](function(_0x172c45){_0x314eeb[_0x8fc5('0x43')]=_0x172c45;return _0x314eeb;})[_0x8fc5('0x24')](respondWithFilteredResult(_0x5c8a87,_0x339ca4))[_0x8fc5('0x44')](handleError(_0x5c8a87,null));};exports[_0x8fc5('0x45')]=function(_0xb49562,_0x1e5d39){var _0x293758={'raw':![],'where':{'id':_0xb49562[_0x8fc5('0x46')]['id']}},_0x1cd1a0={};_0x1cd1a0[_0x8fc5('0x2e')]=_['keys'](db[_0x8fc5('0x2a')][_0x8fc5('0x2b')]);_0x1cd1a0[_0x8fc5('0x2f')]=_[_0x8fc5('0x30')](_0xb49562[_0x8fc5('0x2f')]);_0x1cd1a0[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x1cd1a0[_0x8fc5('0x2e')],_0x1cd1a0['query']);_0x293758[_0x8fc5('0x33')]=_[_0x8fc5('0x32')](_0x1cd1a0[_0x8fc5('0x2e')],qs[_0x8fc5('0x34')](_0xb49562['query']['fields']));_0x293758[_0x8fc5('0x33')]=_0x293758['attributes'][_0x8fc5('0x47')]?_0x293758[_0x8fc5('0x33')]:_0x1cd1a0[_0x8fc5('0x2e')];if(_0xb49562[_0x8fc5('0x2f')][_0x8fc5('0x40')]){_0x293758['include']=[{'all':!![]}];}_0x293758=_[_0x8fc5('0x3c')]({},_0x293758,_0xb49562[_0x8fc5('0x3f')]);return db['ServicenowAccount']['find'](_0x293758)[_0x8fc5('0x24')](handleEntityNotFound(_0x1e5d39,null))[_0x8fc5('0x24')](respondWithResult(_0x1e5d39,null))['catch'](handleError(_0x1e5d39,null));};exports[_0x8fc5('0x48')]=function(_0xb75b50,_0x2ba526){return db[_0x8fc5('0x2a')][_0x8fc5('0x48')](_0xb75b50[_0x8fc5('0x49')],{})['then'](respondWithResult(_0x2ba526,0xc9))[_0x8fc5('0x44')](handleError(_0x2ba526,null));};exports[_0x8fc5('0x23')]=function(_0x53eecb,_0x4fc4fc){if(_0x53eecb['body']['id']){delete _0x53eecb['body']['id'];}return db[_0x8fc5('0x2a')][_0x8fc5('0x4a')]({'where':{'id':_0x53eecb['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0x4fc4fc,null))['then'](saveUpdates(_0x53eecb[_0x8fc5('0x49')],null))[_0x8fc5('0x24')](respondWithResult(_0x4fc4fc,null))[_0x8fc5('0x44')](handleError(_0x4fc4fc,null));};exports[_0x8fc5('0x25')]=function(_0x73f84e,_0x2913b9){return db[_0x8fc5('0x2a')][_0x8fc5('0x4a')]({'where':{'id':_0x73f84e['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0x2913b9,null))[_0x8fc5('0x24')](removeEntity(_0x2913b9,null))['catch'](handleError(_0x2913b9,null));};exports[_0x8fc5('0x4b')]=function(_0x48af05,_0xa834dd,_0x380205){var _0x5a241f={};var _0x99d9f4={};var _0x1202ac;var _0x29375c;return db['ServicenowAccount'][_0x8fc5('0x4c')]({'where':{'id':_0x48af05[_0x8fc5('0x46')]['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0xa834dd,null))[_0x8fc5('0x24')](function(_0x16abc8){if(_0x16abc8){_0x1202ac=_0x16abc8;_0x99d9f4[_0x8fc5('0x2e')]=_[_0x8fc5('0x30')](db[_0x8fc5('0x4d')][_0x8fc5('0x2b')]);_0x99d9f4[_0x8fc5('0x2f')]=_['keys'](_0x48af05[_0x8fc5('0x2f')]);_0x99d9f4[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x99d9f4[_0x8fc5('0x2e')],_0x99d9f4[_0x8fc5('0x2f')]);_0x5a241f[_0x8fc5('0x33')]=_[_0x8fc5('0x32')](_0x99d9f4['model'],qs[_0x8fc5('0x34')](_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x34')]));_0x5a241f[_0x8fc5('0x33')]=_0x5a241f[_0x8fc5('0x33')][_0x8fc5('0x47')]?_0x5a241f[_0x8fc5('0x33')]:_0x99d9f4[_0x8fc5('0x2e')];_0x5a241f[_0x8fc5('0x37')]=qs[_0x8fc5('0x38')](_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x38')]);_0x5a241f[_0x8fc5('0x39')]=qs[_0x8fc5('0x31')](_[_0x8fc5('0x3a')](_0x48af05[_0x8fc5('0x2f')],_0x99d9f4['filters']));if(_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x3b')]){_0x5a241f[_0x8fc5('0x39')]=_[_0x8fc5('0x3c')](_0x5a241f['where'],{'$or':_[_0x8fc5('0x3d')](_0x5a241f[_0x8fc5('0x33')],function(_0x4907a3){var _0x3a073c={};_0x3a073c[_0x4907a3]={'$like':'%'+_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x3b')]+'%'};return _0x3a073c;})});}_0x5a241f=_[_0x8fc5('0x3c')]({},_0x5a241f,_0x48af05[_0x8fc5('0x3f')]);return _0x1202ac[_0x8fc5('0x4b')](_0x5a241f);}})[_0x8fc5('0x24')](function(_0x39193e){if(_0x39193e){_0x29375c=_0x39193e['length'];if(!_0x48af05[_0x8fc5('0x2f')]['hasOwnProperty'](_0x8fc5('0x36'))){_0x5a241f[_0x8fc5('0x1e')]=qs[_0x8fc5('0x1e')](_0x48af05['query'][_0x8fc5('0x1e')]);_0x5a241f[_0x8fc5('0x1c')]=qs[_0x8fc5('0x1c')](_0x48af05['query'][_0x8fc5('0x1c')]);}return _0x1202ac[_0x8fc5('0x4b')](_0x5a241f);}})[_0x8fc5('0x24')](function(_0x1a5218){if(_0x1a5218){return _0x1a5218?{'count':_0x29375c,'rows':_0x1a5218}:null;}})[_0x8fc5('0x24')](respondWithResult(_0xa834dd,null))[_0x8fc5('0x44')](handleError(_0xa834dd,null));};exports[_0x8fc5('0x4e')]=function(_0x50aad5,_0xca28ed,_0x4ec229){if(_0x50aad5[_0x8fc5('0x49')]['id']){delete _0x50aad5[_0x8fc5('0x49')]['id'];}return db[_0x8fc5('0x2a')][_0x8fc5('0x4c')]({'where':{'id':_0x50aad5['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0xca28ed,null))['then'](function(_0xcbf213){if(_0xcbf213){_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x4f')]=_0xcbf213['id'];_0x50aad5['body']['Subjects']=integrations[_0x8fc5('0x50')](_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x51')],_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x3e')]);_0x50aad5['body'][_0x8fc5('0x52')]=integrations[_0x8fc5('0x53')](_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x51')],_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x3e')]);return db[_0x8fc5('0x4d')][_0x8fc5('0x48')](_0x50aad5[_0x8fc5('0x49')],{'include':[{'model':db[_0x8fc5('0x54')],'as':_0x8fc5('0x55')},{'model':db[_0x8fc5('0x54')],'as':_0x8fc5('0x52')}]});}return null;})[_0x8fc5('0x24')](respondWithResult(_0xca28ed,null))['catch'](handleError(_0xca28ed,null));};exports['getFields']=function(_0x371e98,_0x37189f,_0x5adcf5){var _0x1657b2=[_0x8fc5('0x56'),_0x8fc5('0x57'),'knowledge',_0x8fc5('0x58'),_0x8fc5('0x59'),'notify','incident_state',_0x8fc5('0x5a'),_0x8fc5('0x5b')];var _0x11e258=[_0x8fc5('0x5c'),_0x8fc5('0x56'),'caused_by','watch_list',_0x8fc5('0x5d'),_0x8fc5('0x5e'),_0x8fc5('0x5f'),'hold_reason',_0x8fc5('0x60'),_0x8fc5('0x61'),_0x8fc5('0x62'),'sys_updated_by',_0x8fc5('0x63'),'user_input',_0x8fc5('0x64'),_0x8fc5('0x65'),_0x8fc5('0x66'),_0x8fc5('0x67'),'knowledge','order',_0x8fc5('0x68'),'closed_at',_0x8fc5('0x69'),_0x8fc5('0x6a'),_0x8fc5('0x6b'),_0x8fc5('0x6c'),_0x8fc5('0x6d'),'business_service',_0x8fc5('0x6e'),'sys_domain_path',_0x8fc5('0x6f'),_0x8fc5('0x70'),_0x8fc5('0x71'),_0x8fc5('0x72'),_0x8fc5('0x73'),_0x8fc5('0x74'),_0x8fc5('0x75'),_0x8fc5('0x76'),_0x8fc5('0x77'),_0x8fc5('0x78'),'approval_set',_0x8fc5('0x58'),_0x8fc5('0x79'),'short_description',_0x8fc5('0x59'),_0x8fc5('0x7a'),'delivery_task',_0x8fc5('0x7b'),_0x8fc5('0x7c'),_0x8fc5('0x7d'),'additional_assignee_list',_0x8fc5('0x7e'),'calendar_duration',_0x8fc5('0x7f'),_0x8fc5('0x80'),_0x8fc5('0x81'),'closed_by','follow_up',_0x8fc5('0x82'),'sys_id','contact_type',_0x8fc5('0x83'),_0x8fc5('0x84'),_0x8fc5('0x85'),_0x8fc5('0x86'),_0x8fc5('0x87'),_0x8fc5('0x88'),_0x8fc5('0x89'),_0x8fc5('0x8a'),_0x8fc5('0x5a'),'comments',_0x8fc5('0x8b'),'approval','comments_and_work_notes',_0x8fc5('0x8c'),_0x8fc5('0x8d'),_0x8fc5('0x8e'),_0x8fc5('0x8f'),_0x8fc5('0x90'),_0x8fc5('0x91'),_0x8fc5('0x92'),_0x8fc5('0x93'),_0x8fc5('0x5b')];var _0x228c14='';var _0x1c273c='';var _0x19d0da=[];var _0x3e3eef='';var _0x4e5b5b='';var _0x37f633=[];var _0x2f0ba4='';var _0x3a7ca0='';var _0x56785d={};var _0x2d17da='';return db[_0x8fc5('0x2a')]['findOne']({'where':{'id':_0x371e98[_0x8fc5('0x46')]['id']},'attributes':['id',_0x8fc5('0x94'),'password',_0x8fc5('0x95'),_0x8fc5('0x96'),_0x8fc5('0x97')]})[_0x8fc5('0x24')](handleEntityNotFound(_0x37189f,null))[_0x8fc5('0x24')](function(_0x351158){if(_0x351158){_0x2d17da=_0x351158[_0x8fc5('0x96')];var _0x53b96c=_0x2d17da['slice'](-0x1);if(_0x53b96c==='/'){_0x2d17da=_0x2d17da[_0x8fc5('0x98')](0x0,_0x2d17da[_0x8fc5('0x99')](_0x53b96c));}_0x3a7ca0=util[_0x8fc5('0x9a')]('%s/api/now/doc/table/schema/',_0x2d17da);_0x2f0ba4=util[_0x8fc5('0x9a')](_0x8fc5('0x9b'),_0x2d17da);_0x56785d={'user':_0x351158[_0x8fc5('0x94')],'pass':_0x351158['password']};var _0x3ba7cf={'method':_0x8fc5('0x9c'),'uri':_0x3a7ca0+_0x8fc5('0x9d'),'auth':_0x56785d,'json':!![]};return rp(_0x3ba7cf);}})[_0x8fc5('0x24')](function(_0x383e73){if(_0x383e73[_0x8fc5('0x9e')][_0x8fc5('0x47')]>0x0){_0x228c14=_0x383e73[_0x8fc5('0x9e')];}console['log']('incident\x20table\x20objects',_0x228c14);_0x37f633=[];_0x1c273c=Object[_0x8fc5('0x9f')]([],_0x228c14);_['remove'](_0x1c273c,function(_0xe62b40){return!_0x1657b2[_0x8fc5('0xa0')](_0xe62b40[_0x8fc5('0x28')]);});_0x1c273c[_0x8fc5('0xa1')](function(_0x3ee0e8){var _0x2ebf10=createFieldObject(_0x2f0ba4,_0x56785d,_0x3ee0e8['internalType'],_0x3ee0e8[_0x8fc5('0x28')],_0x3ee0e8[_0x8fc5('0xa2')],![]);_0x37f633[_0x8fc5('0xa3')](_0x2ebf10);});return Promise[_0x8fc5('0xa4')](_0x37f633);})['then'](function(_0x5b6593){_0x19d0da=_0x5b6593;_0x3e3eef=Object[_0x8fc5('0x9f')]([],_0x228c14);console[_0x8fc5('0xa5')]('TCL:\x20_object',_0x228c14);_['remove'](_0x3e3eef,function(_0x51598b){return _0x11e258[_0x8fc5('0xa0')](_0x51598b['name']);});console[_0x8fc5('0xa5')](_0x8fc5('0xa6'),_0x3e3eef);_0x37f633=[];_0x3e3eef[_0x8fc5('0xa1')](function(_0x5e32db){var _0x5683d7=createFieldObject(_0x2f0ba4,_0x56785d,_0x5e32db['internalType'],_0x5e32db['name'],_0x5e32db[_0x8fc5('0xa2')],!![]);_0x37f633[_0x8fc5('0xa3')](_0x5683d7);});return Promise[_0x8fc5('0xa4')](_0x37f633);})[_0x8fc5('0x24')](function(_0x1a355f){_0x4e5b5b=_0x1a355f;var _0x7cc71c=_0x19d0da['concat'](_0x4e5b5b);return{'count':_0x7cc71c[_0x8fc5('0x47')],'rows':_0x7cc71c};})[_0x8fc5('0x24')](respondWithResult(_0x37189f,null))[_0x8fc5('0x44')](function(_0x51c0e4){console['log']('ServiceNow\x20error:\x20'+_0x51c0e4);var _0xf8e9ce=_0x371e98[_0x8fc5('0x2f')][_0x8fc5('0xa7')]?0x1f4:_0x51c0e4[_0x8fc5('0xa8')]||0x1f4;logger[_0x8fc5('0x26')](_0x51c0e4[_0x8fc5('0x27')]);delete _0x51c0e4[_0x8fc5('0x28')];if(_0xf8e9ce===0x191){_0xf8e9ce=0x190;}_0x37189f[_0x8fc5('0x19')](_0xf8e9ce)[_0x8fc5('0x29')](_0x371e98[_0x8fc5('0x2f')][_0x8fc5('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x51c0e4[_0x8fc5('0xa8')]}:_0x51c0e4);});};function createFieldObject(_0x28b4f7,_0x1fd959,_0xc1f30d,_0x3da690,_0x3a9e5c,_0x57c8de){return new Promise(function(_0x288b4d,_0x5bd684){var _0x5e8aa0={'id':_0x3da690,'name':_0x3a9e5c,'custom':_0x57c8de};if(_0xc1f30d===_0x8fc5('0xa9')){_0x5e8aa0['options']=[{'name':_0x8fc5('0xaa'),'value':'true'},{'name':_0x8fc5('0xab'),'value':_0x8fc5('0xac')}];_0x288b4d(_0x5e8aa0);}else{var _0x3c202d={'method':_0x8fc5('0x9c'),'uri':_0x28b4f7+_0x8fc5('0xad')+_0x3da690,'auth':_0x1fd959,'json':!![]};return rp(_0x3c202d)[_0x8fc5('0x24')](function(_0x42e4d7){var _0x96d0de=[];if(_0x42e4d7['result'][_0x8fc5('0x47')]>0x0){_0x42e4d7[_0x8fc5('0x9e')][_0x8fc5('0xa1')](function(_0x1cc50e){if(_0x1cc50e[_0x8fc5('0xae')]===_0x8fc5('0xac')){var _0x585c0f={'name':_0x1cc50e[_0x8fc5('0xa2')],'value':_0x1cc50e['value']};_0x96d0de[_0x8fc5('0xa3')](_0x585c0f);}});}_0x5e8aa0['options']=_0x96d0de;if(_0x5e8aa0['options'][_0x8fc5('0x47')]>0x0){_0x288b4d(_0x5e8aa0);}else{if(_0x57c8de==![]){_0x288b4d();}else{_0x288b4d(_0x5e8aa0);}}});}});}
\ No newline at end of file