Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 483dbeb..9fdf445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa832=['sys_domain','state','calendar_stc','cmdb_ci','impact','work_notes_list','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','correlation_id','location','password','email','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','apply','reject','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','findAll','show','params','include','find','create','body','update','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on'];(function(_0x306523,_0x37d635){var _0x1c695e=function(_0x4a3688){while(--_0x4a3688){_0x306523['push'](_0x306523['shift']());}};_0x1c695e(++_0x37d635);}(_0xa832,0x1bb));var _0x2a83=function(_0x39bb0f,_0x47a7d3){_0x39bb0f=_0x39bb0f-0x0;var _0x5d4734=_0xa832[_0x39bb0f];return _0x5d4734;};'use strict';var pdf=require(_0x2a83('0x0'));var emlformat=require(_0x2a83('0x1'));var rimraf=require(_0x2a83('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a83('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2a83('0x4'));var util=require(_0x2a83('0x5'));var path=require(_0x2a83('0x6'));var sox=require('sox');var csv=require(_0x2a83('0x7'));var ejs=require(_0x2a83('0x8'));var fs=require('fs');var _=require(_0x2a83('0x9'));var squel=require(_0x2a83('0xa'));var crypto=require(_0x2a83('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a83('0x7'));var querystring=require('querystring');var Papa=require(_0x2a83('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a83('0xd'));var as=require(_0x2a83('0xe'));var hardwareService=require(_0x2a83('0xf'));var logger=require(_0x2a83('0x10'))(_0x2a83('0x11'));var utils=require(_0x2a83('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2a83('0x13'));var db=require(_0x2a83('0x14'))['db'];var integrations=require(_0x2a83('0x15'));var jayson=require(_0x2a83('0x16'));var client=jayson[_0x2a83('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ae86a,_0x49f44f,_0x454514,_0x1a5089){return new BPromise(function(_0x5c71b4,_0x2e3d07){var _0x336c8c=_0x1a5089||client;return _0x336c8c[_0x2a83('0x18')](_0x4ae86a,_0x454514)[_0x2a83('0x19')](function(_0x397c9e){logger[_0x2a83('0x1a')](_0x2a83('0x1b'),_0x49f44f,_0x2a83('0x1c'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x49f44f,_0x2a83('0x1c'),JSON[_0x2a83('0x1d')](_0x397c9e));if(_0x397c9e['error']){if(_0x397c9e[_0x2a83('0x1e')][_0x2a83('0x1f')]===0x1f4){logger[_0x2a83('0x1e')](_0x2a83('0x1b'),_0x49f44f,_0x397c9e[_0x2a83('0x1e')][_0x2a83('0x20')]);return _0x2e3d07(_0x397c9e[_0x2a83('0x1e')][_0x2a83('0x20')]);}logger[_0x2a83('0x1e')](_0x2a83('0x1b'),_0x49f44f,_0x397c9e['error'][_0x2a83('0x20')]);return _0x5c71b4(_0x397c9e['error'][_0x2a83('0x20')]);}else{logger[_0x2a83('0x1a')](_0x2a83('0x1b'),_0x49f44f,_0x2a83('0x1c'));_0x5c71b4(_0x397c9e[_0x2a83('0x21')][_0x2a83('0x20')]);}})[_0x2a83('0x22')](function(_0xd73c88){logger[_0x2a83('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x49f44f,_0xd73c88);_0x2e3d07(_0xd73c88);});});}function respondWithStatusCode(_0x55a1cc,_0x43ee6f){_0x43ee6f=_0x43ee6f||0xcc;return function(_0x1369ec){if(_0x1369ec){return _0x55a1cc['sendStatus'](_0x43ee6f);}return _0x55a1cc[_0x2a83('0x23')](_0x43ee6f)[_0x2a83('0x24')]();};}function respondWithResult(_0x37cf2c,_0xef2d1a){_0xef2d1a=_0xef2d1a||0xc8;return function(_0x189d1c){if(_0x189d1c){return _0x37cf2c[_0x2a83('0x23')](_0xef2d1a)['json'](_0x189d1c);}};}function respondWithFilteredResult(_0x50cab6,_0x11f52a){return function(_0x5d56e2){if(_0x5d56e2){var _0x182c49=_0x5d56e2[_0x2a83('0x25')],_0x5342ea=_0x11f52a['offset'],_0xd6aa16=_0x11f52a[_0x2a83('0x26')]+_0x11f52a[_0x2a83('0x27')],_0x566d9e;if(_0xd6aa16>=_0x182c49){_0xd6aa16=_0x182c49;_0x566d9e=0xc8;}else{_0x566d9e=0xce;}_0x50cab6[_0x2a83('0x23')](_0x566d9e);return _0x50cab6[_0x2a83('0x28')](_0x2a83('0x29'),_0x5342ea+'-'+_0xd6aa16+'/'+_0x182c49)['json'](_0x5d56e2);}return null;};}function patchUpdates(_0x19e983){return function(_0x59d3e3){try{jsonpatch[_0x2a83('0x2a')](_0x59d3e3,_0x19e983,!![]);}catch(_0x469204){return BPromise[_0x2a83('0x2b')](_0x469204);}return _0x59d3e3['save']();};}function saveUpdates(_0x5e0a5d,_0x50e28b){return function(_0x25cdbb){if(_0x25cdbb){return _0x25cdbb['update'](_0x5e0a5d)[_0x2a83('0x19')](function(_0x1526ca){return _0x1526ca;});}return null;};}function removeEntity(_0x4d2b1b,_0x2c7979){return function(_0x28fb37){if(_0x28fb37){return _0x28fb37[_0x2a83('0x2c')]()[_0x2a83('0x19')](function(){_0x4d2b1b[_0x2a83('0x23')](0xcc)[_0x2a83('0x24')]();});}};}function handleEntityNotFound(_0x299499,_0x5e165c){return function(_0x22fcb9){if(!_0x22fcb9){_0x299499[_0x2a83('0x2d')](0x194);}return _0x22fcb9;};}function handleError(_0x1653ee,_0x15cde3){_0x15cde3=_0x15cde3||0x1f4;return function(_0x2ab050){logger[_0x2a83('0x1e')](_0x2ab050[_0x2a83('0x2e')]);if(_0x2ab050[_0x2a83('0x2f')]){delete _0x2ab050[_0x2a83('0x2f')];}_0x1653ee[_0x2a83('0x23')](_0x15cde3)[_0x2a83('0x30')](_0x2ab050);};}exports['index']=function(_0x58819e,_0xac7216){var _0x75aa4={},_0x1900ec={},_0x1997da={'count':0x0,'rows':[]};var _0x2af152=_['map'](db['ServicenowAccount'][_0x2a83('0x31')],function(_0x24d763){return{'name':_0x24d763[_0x2a83('0x32')],'type':_0x24d763[_0x2a83('0x33')][_0x2a83('0x34')]};});_0x1900ec[_0x2a83('0x35')]=_[_0x2a83('0x36')](_0x2af152,_0x2a83('0x2f'));_0x1900ec['query']=_[_0x2a83('0x37')](_0x58819e[_0x2a83('0x38')]);_0x1900ec[_0x2a83('0x39')]=_[_0x2a83('0x3a')](_0x1900ec['model'],_0x1900ec[_0x2a83('0x38')]);_0x75aa4[_0x2a83('0x3b')]=_['intersection'](_0x1900ec[_0x2a83('0x35')],qs[_0x2a83('0x3c')](_0x58819e[_0x2a83('0x38')][_0x2a83('0x3c')]));_0x75aa4[_0x2a83('0x3b')]=_0x75aa4[_0x2a83('0x3b')][_0x2a83('0x3d')]?_0x75aa4['attributes']:_0x1900ec[_0x2a83('0x35')];if(!_0x58819e[_0x2a83('0x38')][_0x2a83('0x3e')](_0x2a83('0x3f'))){_0x75aa4[_0x2a83('0x27')]=qs[_0x2a83('0x27')](_0x58819e[_0x2a83('0x38')][_0x2a83('0x27')]);_0x75aa4[_0x2a83('0x26')]=qs[_0x2a83('0x26')](_0x58819e['query']['offset']);}_0x75aa4[_0x2a83('0x40')]=qs[_0x2a83('0x41')](_0x58819e[_0x2a83('0x38')][_0x2a83('0x41')]);_0x75aa4[_0x2a83('0x42')]=qs[_0x2a83('0x39')](_[_0x2a83('0x43')](_0x58819e[_0x2a83('0x38')],_0x1900ec[_0x2a83('0x39')]),_0x2af152);if(_0x58819e['query'][_0x2a83('0x44')]){_0x75aa4[_0x2a83('0x42')]=_[_0x2a83('0x45')](_0x75aa4[_0x2a83('0x42')],{'$or':_[_0x2a83('0x36')](_0x2af152,function(_0x1b8170){if(_0x1b8170[_0x2a83('0x33')]!==_0x2a83('0x46')){var _0x1472f0={};_0x1472f0[_0x1b8170['name']]={'$like':'%'+_0x58819e[_0x2a83('0x38')][_0x2a83('0x44')]+'%'};return _0x1472f0;}})});}_0x75aa4=_[_0x2a83('0x45')]({},_0x75aa4,_0x58819e[_0x2a83('0x47')]);var _0x3d9820={'where':_0x75aa4[_0x2a83('0x42')]};return db[_0x2a83('0x48')][_0x2a83('0x25')](_0x3d9820)[_0x2a83('0x19')](function(_0x355fa4){_0x1997da[_0x2a83('0x25')]=_0x355fa4;if(_0x58819e[_0x2a83('0x38')][_0x2a83('0x49')]){_0x75aa4['include']=[{'all':!![]}];}return db[_0x2a83('0x48')][_0x2a83('0x4a')](_0x75aa4);})[_0x2a83('0x19')](function(_0x44e6b3){_0x1997da['rows']=_0x44e6b3;return _0x1997da;})['then'](respondWithFilteredResult(_0xac7216,_0x75aa4))[_0x2a83('0x22')](handleError(_0xac7216,null));};exports[_0x2a83('0x4b')]=function(_0x52239d,_0x29f1df){var _0x3d4f46={'raw':![],'where':{'id':_0x52239d[_0x2a83('0x4c')]['id']}},_0x1d40a8={};_0x1d40a8[_0x2a83('0x35')]=_[_0x2a83('0x37')](db[_0x2a83('0x48')][_0x2a83('0x31')]);_0x1d40a8[_0x2a83('0x38')]=_[_0x2a83('0x37')](_0x52239d[_0x2a83('0x38')]);_0x1d40a8['filters']=_[_0x2a83('0x3a')](_0x1d40a8['model'],_0x1d40a8[_0x2a83('0x38')]);_0x3d4f46['attributes']=_['intersection'](_0x1d40a8[_0x2a83('0x35')],qs['fields'](_0x52239d[_0x2a83('0x38')]['fields']));_0x3d4f46[_0x2a83('0x3b')]=_0x3d4f46[_0x2a83('0x3b')][_0x2a83('0x3d')]?_0x3d4f46['attributes']:_0x1d40a8[_0x2a83('0x35')];if(_0x52239d[_0x2a83('0x38')]['includeAll']){_0x3d4f46[_0x2a83('0x4d')]=[{'all':!![]}];}_0x3d4f46=_[_0x2a83('0x45')]({},_0x3d4f46,_0x52239d[_0x2a83('0x47')]);return db[_0x2a83('0x48')][_0x2a83('0x4e')](_0x3d4f46)[_0x2a83('0x19')](handleEntityNotFound(_0x29f1df,null))[_0x2a83('0x19')](respondWithResult(_0x29f1df,null))[_0x2a83('0x22')](handleError(_0x29f1df,null));};exports['create']=function(_0x5e254e,_0x3412ee){return db[_0x2a83('0x48')][_0x2a83('0x4f')](_0x5e254e[_0x2a83('0x50')],{})[_0x2a83('0x19')](respondWithResult(_0x3412ee,0xc9))[_0x2a83('0x22')](handleError(_0x3412ee,null));};exports[_0x2a83('0x51')]=function(_0x7890d7,_0x24902a){if(_0x7890d7[_0x2a83('0x50')]['id']){delete _0x7890d7[_0x2a83('0x50')]['id'];}return db[_0x2a83('0x48')]['find']({'where':{'id':_0x7890d7[_0x2a83('0x4c')]['id']}})[_0x2a83('0x19')](handleEntityNotFound(_0x24902a,null))[_0x2a83('0x19')](saveUpdates(_0x7890d7[_0x2a83('0x50')],null))['then'](respondWithResult(_0x24902a,null))[_0x2a83('0x22')](handleError(_0x24902a,null));};exports[_0x2a83('0x2c')]=function(_0x43d5cf,_0x1cb5ee){return db[_0x2a83('0x48')][_0x2a83('0x4e')]({'where':{'id':_0x43d5cf['params']['id']}})[_0x2a83('0x19')](handleEntityNotFound(_0x1cb5ee,null))[_0x2a83('0x19')](removeEntity(_0x1cb5ee,null))[_0x2a83('0x22')](handleError(_0x1cb5ee,null));};exports[_0x2a83('0x52')]=function(_0x3c7e25,_0xf1c89a,_0x13d944){var _0x2e56c2={};var _0x2e53d1={};var _0xcbf3ba;var _0x3600b8;return db[_0x2a83('0x48')][_0x2a83('0x53')]({'where':{'id':_0x3c7e25[_0x2a83('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf1c89a,null))[_0x2a83('0x19')](function(_0x3be20b){if(_0x3be20b){_0xcbf3ba=_0x3be20b;_0x2e53d1[_0x2a83('0x35')]=_[_0x2a83('0x37')](db['ServicenowConfiguration'][_0x2a83('0x31')]);_0x2e53d1['query']=_[_0x2a83('0x37')](_0x3c7e25['query']);_0x2e53d1[_0x2a83('0x39')]=_[_0x2a83('0x3a')](_0x2e53d1[_0x2a83('0x35')],_0x2e53d1[_0x2a83('0x38')]);_0x2e56c2[_0x2a83('0x3b')]=_['intersection'](_0x2e53d1['model'],qs[_0x2a83('0x3c')](_0x3c7e25[_0x2a83('0x38')][_0x2a83('0x3c')]));_0x2e56c2[_0x2a83('0x3b')]=_0x2e56c2[_0x2a83('0x3b')][_0x2a83('0x3d')]?_0x2e56c2[_0x2a83('0x3b')]:_0x2e53d1[_0x2a83('0x35')];_0x2e56c2[_0x2a83('0x40')]=qs['sort'](_0x3c7e25['query'][_0x2a83('0x41')]);_0x2e56c2[_0x2a83('0x42')]=qs[_0x2a83('0x39')](_['pick'](_0x3c7e25[_0x2a83('0x38')],_0x2e53d1['filters']));if(_0x3c7e25[_0x2a83('0x38')][_0x2a83('0x44')]){_0x2e56c2[_0x2a83('0x42')]=_[_0x2a83('0x45')](_0x2e56c2[_0x2a83('0x42')],{'$or':_[_0x2a83('0x36')](_0x2e56c2[_0x2a83('0x3b')],function(_0x14c139){var _0x5f3a20={};_0x5f3a20[_0x14c139]={'$like':'%'+_0x3c7e25[_0x2a83('0x38')][_0x2a83('0x44')]+'%'};return _0x5f3a20;})});}_0x2e56c2=_['merge']({},_0x2e56c2,_0x3c7e25[_0x2a83('0x47')]);return _0xcbf3ba[_0x2a83('0x52')](_0x2e56c2);}})[_0x2a83('0x19')](function(_0x1116b9){if(_0x1116b9){_0x3600b8=_0x1116b9[_0x2a83('0x3d')];if(!_0x3c7e25[_0x2a83('0x38')][_0x2a83('0x3e')](_0x2a83('0x3f'))){_0x2e56c2[_0x2a83('0x27')]=qs[_0x2a83('0x27')](_0x3c7e25[_0x2a83('0x38')]['limit']);_0x2e56c2['offset']=qs['offset'](_0x3c7e25['query'][_0x2a83('0x26')]);}return _0xcbf3ba[_0x2a83('0x52')](_0x2e56c2);}})[_0x2a83('0x19')](function(_0x304bb0){if(_0x304bb0){return _0x304bb0?{'count':_0x3600b8,'rows':_0x304bb0}:null;}})[_0x2a83('0x19')](respondWithResult(_0xf1c89a,null))[_0x2a83('0x22')](handleError(_0xf1c89a,null));};exports[_0x2a83('0x54')]=function(_0x21c3a5,_0x430adf,_0x2877d8){if(_0x21c3a5[_0x2a83('0x50')]['id']){delete _0x21c3a5[_0x2a83('0x50')]['id'];}return db[_0x2a83('0x48')][_0x2a83('0x53')]({'where':{'id':_0x21c3a5[_0x2a83('0x4c')]['id']}})[_0x2a83('0x19')](handleEntityNotFound(_0x430adf,null))[_0x2a83('0x19')](function(_0x3acd6a){if(_0x3acd6a){_0x21c3a5['body'][_0x2a83('0x55')]=_0x3acd6a['id'];_0x21c3a5[_0x2a83('0x50')][_0x2a83('0x56')]=integrations[_0x2a83('0x57')](_0x21c3a5[_0x2a83('0x50')]['channel'],_0x21c3a5['body'][_0x2a83('0x33')]);_0x21c3a5[_0x2a83('0x50')][_0x2a83('0x58')]=integrations[_0x2a83('0x59')](_0x21c3a5[_0x2a83('0x50')][_0x2a83('0x5a')],_0x21c3a5[_0x2a83('0x50')]['type']);return db['ServicenowConfiguration'][_0x2a83('0x4f')](_0x21c3a5[_0x2a83('0x50')],{'include':[{'model':db[_0x2a83('0x5b')],'as':'Subjects'},{'model':db[_0x2a83('0x5b')],'as':'Descriptions'}]});}return null;})[_0x2a83('0x19')](respondWithResult(_0x430adf,null))[_0x2a83('0x22')](handleError(_0x430adf,null));};exports[_0x2a83('0x5c')]=function(_0xf32e9c,_0x84f9a5,_0x1230ff){var _0xfd081a=[_0x2a83('0x5d'),_0x2a83('0x5e'),_0x2a83('0x5f'),_0x2a83('0x60'),_0x2a83('0x61'),_0x2a83('0x62'),_0x2a83('0x63'),_0x2a83('0x64'),_0x2a83('0x65')];var _0x350eb8=[_0x2a83('0x66'),_0x2a83('0x5d'),'caused_by','watch_list',_0x2a83('0x67'),_0x2a83('0x68'),_0x2a83('0x69'),'hold_reason','approval_history',_0x2a83('0x6a'),_0x2a83('0x6b'),_0x2a83('0x6c'),_0x2a83('0x6d'),_0x2a83('0x6e'),_0x2a83('0x6f'),_0x2a83('0x70'),_0x2a83('0x71'),'sys_created_by',_0x2a83('0x5f'),'order',_0x2a83('0x72'),'closed_at',_0x2a83('0x73'),'delivery_plan',_0x2a83('0x74'),'active',_0x2a83('0x75'),'business_service',_0x2a83('0x76'),_0x2a83('0x77'),_0x2a83('0x78'),'time_worked',_0x2a83('0x79'),'opened_at',_0x2a83('0x7a'),_0x2a83('0x7b'),_0x2a83('0x7c'),_0x2a83('0x7d'),_0x2a83('0x7e'),_0x2a83('0x7f'),_0x2a83('0x80'),'subcategory',_0x2a83('0x81'),_0x2a83('0x82'),_0x2a83('0x61'),'correlation_display','delivery_task',_0x2a83('0x83'),_0x2a83('0x84'),_0x2a83('0x85'),'additional_assignee_list','description',_0x2a83('0x86'),_0x2a83('0x62'),_0x2a83('0x87'),_0x2a83('0x88'),_0x2a83('0x89'),_0x2a83('0x8a'),'parent_incident',_0x2a83('0x8b'),_0x2a83('0x8c'),_0x2a83('0x8d'),_0x2a83('0x63'),'urgency',_0x2a83('0x8e'),_0x2a83('0x8f'),_0x2a83('0x90'),_0x2a83('0x91'),'assigned_to','severity',_0x2a83('0x92'),_0x2a83('0x93'),_0x2a83('0x94'),_0x2a83('0x95'),'due_date',_0x2a83('0x96'),_0x2a83('0x97'),'sys_tags',_0x2a83('0x98'),'upon_approval',_0x2a83('0x99'),_0x2a83('0x9a'),_0x2a83('0x65')];var _0xef265f='';var _0x543a93='';var _0x3c98cf=[];var _0x44afcd='';var _0x252d37='';var _0x41c5ea=[];var _0xc8598f='';var _0x1a00f8='';var _0x5e6dba={};var _0x491922='';return db[_0x2a83('0x48')]['findOne']({'where':{'id':_0xf32e9c[_0x2a83('0x4c')]['id']},'attributes':['id','username',_0x2a83('0x9b'),_0x2a83('0x9c'),_0x2a83('0x9d'),'serverUrl']})['then'](handleEntityNotFound(_0x84f9a5,null))[_0x2a83('0x19')](function(_0x5e6fb9){if(_0x5e6fb9){_0x491922=_0x5e6fb9[_0x2a83('0x9d')];var _0x3ba92a=_0x491922[_0x2a83('0x9e')](-0x1);if(_0x3ba92a==='/'){_0x491922=_0x491922[_0x2a83('0x9f')](0x0,_0x491922[_0x2a83('0xa0')](_0x3ba92a));}_0x1a00f8=util['format'](_0x2a83('0xa1'),_0x491922);_0xc8598f=util[_0x2a83('0xa2')](_0x2a83('0xa3'),_0x491922);_0x5e6dba={'user':_0x5e6fb9['username'],'pass':_0x5e6fb9[_0x2a83('0x9b')]};var _0x101664={'method':_0x2a83('0xa4'),'uri':_0x1a00f8+_0x2a83('0xa5'),'auth':_0x5e6dba,'json':!![]};return rp(_0x101664);}})[_0x2a83('0x19')](function(_0x26df73){if(_0x26df73[_0x2a83('0x21')]['length']>0x0){_0xef265f=_0x26df73[_0x2a83('0x21')];}console[_0x2a83('0xa6')](_0x2a83('0xa7'),_0xef265f);_0x41c5ea=[];_0x543a93=Object[_0x2a83('0xa8')]([],_0xef265f);_['remove'](_0x543a93,function(_0x89fcb2){return!_0xfd081a[_0x2a83('0xa9')](_0x89fcb2[_0x2a83('0x2f')]);});_0x543a93[_0x2a83('0xaa')](function(_0x5d5145){var _0x5dae51=createFieldObject(_0xc8598f,_0x5e6dba,_0x5d5145[_0x2a83('0xab')],_0x5d5145[_0x2a83('0x2f')],_0x5d5145[_0x2a83('0xac')],![]);_0x41c5ea[_0x2a83('0xad')](_0x5dae51);});return Promise[_0x2a83('0xae')](_0x41c5ea);})['then'](function(_0x375c10){_0x3c98cf=_0x375c10;_0x44afcd=Object[_0x2a83('0xa8')]([],_0xef265f);console['log']('TCL:\x20_object',_0xef265f);_[_0x2a83('0xaf')](_0x44afcd,function(_0xca0782){return _0x350eb8[_0x2a83('0xa9')](_0xca0782[_0x2a83('0x2f')]);});console[_0x2a83('0xa6')](_0x2a83('0xb0'),_0x44afcd);_0x41c5ea=[];_0x44afcd[_0x2a83('0xaa')](function(_0x4762d5){var _0x25d3f0=createFieldObject(_0xc8598f,_0x5e6dba,_0x4762d5[_0x2a83('0xab')],_0x4762d5[_0x2a83('0x2f')],_0x4762d5['label'],!![]);_0x41c5ea[_0x2a83('0xad')](_0x25d3f0);});return Promise[_0x2a83('0xae')](_0x41c5ea);})['then'](function(_0x49898b){_0x252d37=_0x49898b;var _0x31a8bb=_0x3c98cf['concat'](_0x252d37);return{'count':_0x31a8bb['length'],'rows':_0x31a8bb};})['then'](respondWithResult(_0x84f9a5,null))['catch'](function(_0x366083){console['log']('ServiceNow\x20error:\x20'+_0x366083);var _0x1a92f2=_0xf32e9c[_0x2a83('0x38')]['test']?0x1f4:_0x366083['statusCode']||0x1f4;logger[_0x2a83('0x1e')](_0x366083[_0x2a83('0x2e')]);delete _0x366083[_0x2a83('0x2f')];if(_0x1a92f2===0x191){_0x1a92f2=0x190;}_0x84f9a5[_0x2a83('0x23')](_0x1a92f2)['send'](_0xf32e9c[_0x2a83('0x38')][_0x2a83('0xb1')]?{'message':'Wrong\x20credentials','statusCode':_0x366083[_0x2a83('0xb2')]}:_0x366083);});};function createFieldObject(_0x115da6,_0x3c307e,_0x1b8496,_0x23b112,_0x36f40b,_0x17fbf5){return new Promise(function(_0xe26692,_0x2ee328){var _0x439483={'id':_0x23b112,'name':_0x36f40b,'custom':_0x17fbf5};if(_0x1b8496===_0x2a83('0xb3')){_0x439483[_0x2a83('0x47')]=[{'name':_0x2a83('0xb4'),'value':'true'},{'name':_0x2a83('0xb5'),'value':_0x2a83('0xb6')}];_0xe26692(_0x439483);}else{var _0x36d139={'method':_0x2a83('0xa4'),'uri':_0x115da6+_0x2a83('0xb7')+_0x23b112,'auth':_0x3c307e,'json':!![]};return rp(_0x36d139)[_0x2a83('0x19')](function(_0x972824){var _0x4e0ad3=[];if(_0x972824[_0x2a83('0x21')][_0x2a83('0x3d')]>0x0){_0x972824[_0x2a83('0x21')]['forEach'](function(_0x27c539){if(_0x27c539['inactive']===_0x2a83('0xb6')){var _0x1541da={'name':_0x27c539['label'],'value':_0x27c539[_0x2a83('0xb8')]};_0x4e0ad3[_0x2a83('0xad')](_0x1541da);}});}_0x439483[_0x2a83('0x47')]=_0x4e0ad3;if(_0x439483[_0x2a83('0x47')][_0x2a83('0x3d')]>0x0){_0xe26692(_0x439483);}else{if(_0x17fbf5==![]){_0xe26692();}else{_0xe26692(_0x439483);}}});}});}
\ No newline at end of file
+var _0x2bd9=['apply','reject','save','then','destroy','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','name','keys','query','filters','attributes','model','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','intersection','find','catch','create','body','update','getConfigurations','findOne','ServicenowConfiguration','fields','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','state','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','business_duration','work_end','reopened_time','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','company','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','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','forEach','internalType','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','statusCode','error','test','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0x5d26d0,_0x257267){var _0x1ab0e3=function(_0x38d24b){while(--_0x38d24b){_0x5d26d0['push'](_0x5d26d0['shift']());}};_0x1ab0e3(++_0x257267);}(_0x2bd9,0x150));var _0x92bd=function(_0x773ceb,_0x371147){_0x773ceb=_0x773ceb-0x0;var _0x5505f5=_0x2bd9[_0x773ceb];return _0x5505f5;};'use strict';var emlformat=require(_0x92bd('0x0'));var rimraf=require(_0x92bd('0x1'));var zipdir=require(_0x92bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92bd('0x3'));var moment=require('moment');var BPromise=require(_0x92bd('0x4'));var Mustache=require(_0x92bd('0x5'));var util=require(_0x92bd('0x6'));var path=require('path');var sox=require(_0x92bd('0x7'));var csv=require(_0x92bd('0x8'));var ejs=require(_0x92bd('0x9'));var fs=require('fs');var fs_extra=require(_0x92bd('0xa'));var _=require(_0x92bd('0xb'));var squel=require(_0x92bd('0xc'));var crypto=require(_0x92bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x92bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x92bd('0xf'));var Papa=require(_0x92bd('0x10'));var Redis=require('ioredis');var authService=require(_0x92bd('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92bd('0x12'));var logger=require(_0x92bd('0x13'))(_0x92bd('0x14'));var utils=require(_0x92bd('0x15'));var config=require(_0x92bd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x92bd('0x17'))['db'];var integrations=require(_0x92bd('0x18'));function respondWithStatusCode(_0xfaa157,_0x57960a){_0x57960a=_0x57960a||0xcc;return function(_0x18844c){if(_0x18844c){return _0xfaa157[_0x92bd('0x19')](_0x57960a);}return _0xfaa157[_0x92bd('0x1a')](_0x57960a)[_0x92bd('0x1b')]();};}function respondWithResult(_0x2fbe04,_0x251856){_0x251856=_0x251856||0xc8;return function(_0x9ac570){if(_0x9ac570){return _0x2fbe04['status'](_0x251856)[_0x92bd('0x1c')](_0x9ac570);}};}function respondWithFilteredResult(_0xe8e969,_0x244378){return function(_0x1e0913){if(_0x1e0913){var _0x4f97fd=typeof _0x244378[_0x92bd('0x1d')]===_0x92bd('0x1e')&&typeof _0x244378[_0x92bd('0x1f')]===_0x92bd('0x1e');var _0x26c4db=_0x1e0913['count'];var _0x2b9a0f=_0x4f97fd?0x0:_0x244378[_0x92bd('0x1d')];var _0x2348ea=_0x4f97fd?_0x1e0913['count']:_0x244378['offset']+_0x244378[_0x92bd('0x1f')];var _0x3a0447;if(_0x2348ea>=_0x26c4db){_0x2348ea=_0x26c4db;_0x3a0447=0xc8;}else{_0x3a0447=0xce;}_0xe8e969[_0x92bd('0x1a')](_0x3a0447);return _0xe8e969[_0x92bd('0x20')](_0x92bd('0x21'),_0x2b9a0f+'-'+_0x2348ea+'/'+_0x26c4db)[_0x92bd('0x1c')](_0x1e0913);}return null;};}function patchUpdates(_0x4ff694){return function(_0x2620ae){try{jsonpatch[_0x92bd('0x22')](_0x2620ae,_0x4ff694,!![]);}catch(_0x2cd518){return BPromise[_0x92bd('0x23')](_0x2cd518);}return _0x2620ae[_0x92bd('0x24')]();};}function saveUpdates(_0x4b4b8c,_0x12083f){return function(_0x43c992){if(_0x43c992){return _0x43c992['update'](_0x4b4b8c)[_0x92bd('0x25')](function(_0xdb9970){return _0xdb9970;});}return null;};}function removeEntity(_0x80f15a,_0x40a1a1){return function(_0x17edfa){if(_0x17edfa){return _0x17edfa[_0x92bd('0x26')]()[_0x92bd('0x25')](function(){_0x80f15a['status'](0xcc)[_0x92bd('0x1b')]();});}};}function handleEntityNotFound(_0x4b1d15,_0x5d249){return function(_0x3ca4b4){if(!_0x3ca4b4){_0x4b1d15['sendStatus'](0x194);}return _0x3ca4b4;};}function handleError(_0x257f6e,_0x56566f){_0x56566f=_0x56566f||0x1f4;return function(_0x2c6a21){logger['error'](_0x2c6a21[_0x92bd('0x27')]);if(_0x2c6a21['name']){delete _0x2c6a21['name'];}_0x257f6e[_0x92bd('0x1a')](_0x56566f)[_0x92bd('0x28')](_0x2c6a21);};}exports[_0x92bd('0x29')]=function(_0x34ea78,_0x1b3de8){var _0x5d85f7={},_0x51286a={},_0x3a579c={'count':0x0,'rows':[]};var _0x55c515=_[_0x92bd('0x2a')](db[_0x92bd('0x2b')][_0x92bd('0x2c')],function(_0x44beb0){return{'name':_0x44beb0[_0x92bd('0x2d')],'type':_0x44beb0[_0x92bd('0x2e')]['key']};});_0x51286a['model']=_[_0x92bd('0x2a')](_0x55c515,_0x92bd('0x2f'));_0x51286a['query']=_[_0x92bd('0x30')](_0x34ea78[_0x92bd('0x31')]);_0x51286a[_0x92bd('0x32')]=_['intersection'](_0x51286a['model'],_0x51286a['query']);_0x5d85f7[_0x92bd('0x33')]=_['intersection'](_0x51286a[_0x92bd('0x34')],qs['fields'](_0x34ea78['query']['fields']));_0x5d85f7['attributes']=_0x5d85f7['attributes'][_0x92bd('0x35')]?_0x5d85f7[_0x92bd('0x33')]:_0x51286a['model'];if(!_0x34ea78['query']['hasOwnProperty'](_0x92bd('0x36'))){_0x5d85f7[_0x92bd('0x1f')]=qs['limit'](_0x34ea78[_0x92bd('0x31')][_0x92bd('0x1f')]);_0x5d85f7[_0x92bd('0x1d')]=qs[_0x92bd('0x1d')](_0x34ea78[_0x92bd('0x31')][_0x92bd('0x1d')]);}_0x5d85f7[_0x92bd('0x37')]=qs[_0x92bd('0x38')](_0x34ea78[_0x92bd('0x31')][_0x92bd('0x38')]);_0x5d85f7[_0x92bd('0x39')]=qs['filters'](_[_0x92bd('0x3a')](_0x34ea78[_0x92bd('0x31')],_0x51286a[_0x92bd('0x32')]),_0x55c515);if(_0x34ea78[_0x92bd('0x31')][_0x92bd('0x3b')]){_0x5d85f7['where']=_[_0x92bd('0x3c')](_0x5d85f7[_0x92bd('0x39')],{'$or':_['map'](_0x55c515,function(_0x26dc36){if(_0x26dc36[_0x92bd('0x2e')]!==_0x92bd('0x3d')){var _0x4ea02f={};_0x4ea02f[_0x26dc36[_0x92bd('0x2f')]]={'$like':'%'+_0x34ea78[_0x92bd('0x31')][_0x92bd('0x3b')]+'%'};return _0x4ea02f;}})});}_0x5d85f7=_[_0x92bd('0x3c')]({},_0x5d85f7,_0x34ea78[_0x92bd('0x3e')]);var _0x301477={'where':_0x5d85f7['where']};return db[_0x92bd('0x2b')]['count'](_0x301477)[_0x92bd('0x25')](function(_0x1b07a0){_0x3a579c[_0x92bd('0x3f')]=_0x1b07a0;if(_0x34ea78[_0x92bd('0x31')][_0x92bd('0x40')]){_0x5d85f7[_0x92bd('0x41')]=[{'all':!![]}];}return db[_0x92bd('0x2b')]['findAll'](_0x5d85f7);})[_0x92bd('0x25')](function(_0x31560a){_0x3a579c[_0x92bd('0x42')]=_0x31560a;return _0x3a579c;})[_0x92bd('0x25')](respondWithFilteredResult(_0x1b3de8,_0x5d85f7))['catch'](handleError(_0x1b3de8,null));};exports[_0x92bd('0x43')]=function(_0x4c8295,_0x4b078e){var _0x4f735c={'raw':![],'where':{'id':_0x4c8295[_0x92bd('0x44')]['id']}},_0x16b765={};_0x16b765[_0x92bd('0x34')]=_['keys'](db[_0x92bd('0x2b')][_0x92bd('0x2c')]);_0x16b765[_0x92bd('0x31')]=_[_0x92bd('0x30')](_0x4c8295[_0x92bd('0x31')]);_0x16b765[_0x92bd('0x32')]=_['intersection'](_0x16b765[_0x92bd('0x34')],_0x16b765[_0x92bd('0x31')]);_0x4f735c[_0x92bd('0x33')]=_[_0x92bd('0x45')](_0x16b765[_0x92bd('0x34')],qs['fields'](_0x4c8295[_0x92bd('0x31')]['fields']));_0x4f735c[_0x92bd('0x33')]=_0x4f735c[_0x92bd('0x33')]['length']?_0x4f735c[_0x92bd('0x33')]:_0x16b765[_0x92bd('0x34')];if(_0x4c8295[_0x92bd('0x31')]['includeAll']){_0x4f735c[_0x92bd('0x41')]=[{'all':!![]}];}_0x4f735c=_[_0x92bd('0x3c')]({},_0x4f735c,_0x4c8295[_0x92bd('0x3e')]);return db[_0x92bd('0x2b')][_0x92bd('0x46')](_0x4f735c)[_0x92bd('0x25')](handleEntityNotFound(_0x4b078e,null))['then'](respondWithResult(_0x4b078e,null))[_0x92bd('0x47')](handleError(_0x4b078e,null));};exports['create']=function(_0x209be2,_0x459005){return db[_0x92bd('0x2b')][_0x92bd('0x48')](_0x209be2[_0x92bd('0x49')],{})[_0x92bd('0x25')](respondWithResult(_0x459005,0xc9))[_0x92bd('0x47')](handleError(_0x459005,null));};exports[_0x92bd('0x4a')]=function(_0x1a711a,_0x11570a){if(_0x1a711a['body']['id']){delete _0x1a711a[_0x92bd('0x49')]['id'];}return db['ServicenowAccount'][_0x92bd('0x46')]({'where':{'id':_0x1a711a['params']['id']}})['then'](handleEntityNotFound(_0x11570a,null))['then'](saveUpdates(_0x1a711a[_0x92bd('0x49')],null))['then'](respondWithResult(_0x11570a,null))[_0x92bd('0x47')](handleError(_0x11570a,null));};exports[_0x92bd('0x26')]=function(_0x5d82c1,_0x320117){return db[_0x92bd('0x2b')][_0x92bd('0x46')]({'where':{'id':_0x5d82c1[_0x92bd('0x44')]['id']}})[_0x92bd('0x25')](handleEntityNotFound(_0x320117,null))['then'](removeEntity(_0x320117,null))[_0x92bd('0x47')](handleError(_0x320117,null));};exports[_0x92bd('0x4b')]=function(_0x52d2a3,_0xcf66f7,_0x3b968a){var _0x39cab9={};var _0xdce632={};var _0x491009;var _0x44df08;return db[_0x92bd('0x2b')][_0x92bd('0x4c')]({'where':{'id':_0x52d2a3[_0x92bd('0x44')]['id']}})[_0x92bd('0x25')](handleEntityNotFound(_0xcf66f7,null))[_0x92bd('0x25')](function(_0x1a14c8){if(_0x1a14c8){_0x491009=_0x1a14c8;_0xdce632[_0x92bd('0x34')]=_['keys'](db[_0x92bd('0x4d')][_0x92bd('0x2c')]);_0xdce632[_0x92bd('0x31')]=_[_0x92bd('0x30')](_0x52d2a3[_0x92bd('0x31')]);_0xdce632[_0x92bd('0x32')]=_[_0x92bd('0x45')](_0xdce632[_0x92bd('0x34')],_0xdce632[_0x92bd('0x31')]);_0x39cab9[_0x92bd('0x33')]=_[_0x92bd('0x45')](_0xdce632['model'],qs['fields'](_0x52d2a3[_0x92bd('0x31')][_0x92bd('0x4e')]));_0x39cab9['attributes']=_0x39cab9[_0x92bd('0x33')][_0x92bd('0x35')]?_0x39cab9[_0x92bd('0x33')]:_0xdce632['model'];_0x39cab9[_0x92bd('0x37')]=qs[_0x92bd('0x38')](_0x52d2a3[_0x92bd('0x31')][_0x92bd('0x38')]);_0x39cab9[_0x92bd('0x39')]=qs[_0x92bd('0x32')](_[_0x92bd('0x3a')](_0x52d2a3[_0x92bd('0x31')],_0xdce632['filters']));if(_0x52d2a3['query'][_0x92bd('0x3b')]){_0x39cab9[_0x92bd('0x39')]=_[_0x92bd('0x3c')](_0x39cab9['where'],{'$or':_[_0x92bd('0x2a')](_0x39cab9[_0x92bd('0x33')],function(_0x9ce8db){var _0x32ac86={};_0x32ac86[_0x9ce8db]={'$like':'%'+_0x52d2a3[_0x92bd('0x31')][_0x92bd('0x3b')]+'%'};return _0x32ac86;})});}_0x39cab9=_[_0x92bd('0x3c')]({},_0x39cab9,_0x52d2a3['options']);return _0x491009['getConfigurations'](_0x39cab9);}})['then'](function(_0x30eebd){if(_0x30eebd){_0x44df08=_0x30eebd[_0x92bd('0x35')];if(!_0x52d2a3['query'][_0x92bd('0x4f')](_0x92bd('0x36'))){_0x39cab9[_0x92bd('0x1f')]=qs[_0x92bd('0x1f')](_0x52d2a3[_0x92bd('0x31')][_0x92bd('0x1f')]);_0x39cab9['offset']=qs[_0x92bd('0x1d')](_0x52d2a3[_0x92bd('0x31')][_0x92bd('0x1d')]);}return _0x491009[_0x92bd('0x4b')](_0x39cab9);}})[_0x92bd('0x25')](function(_0x3880b0){if(_0x3880b0){return _0x3880b0?{'count':_0x44df08,'rows':_0x3880b0}:null;}})[_0x92bd('0x25')](respondWithResult(_0xcf66f7,null))['catch'](handleError(_0xcf66f7,null));};exports[_0x92bd('0x50')]=function(_0x13bd72,_0x20f209,_0x1e969a){if(_0x13bd72[_0x92bd('0x49')]['id']){delete _0x13bd72['body']['id'];}return db['ServicenowAccount'][_0x92bd('0x4c')]({'where':{'id':_0x13bd72[_0x92bd('0x44')]['id']}})[_0x92bd('0x25')](handleEntityNotFound(_0x20f209,null))[_0x92bd('0x25')](function(_0x29ee76){if(_0x29ee76){_0x13bd72[_0x92bd('0x49')][_0x92bd('0x51')]=_0x29ee76['id'];_0x13bd72[_0x92bd('0x49')][_0x92bd('0x52')]=integrations['getSubjects'](_0x13bd72['body'][_0x92bd('0x53')],_0x13bd72[_0x92bd('0x49')]['type']);_0x13bd72[_0x92bd('0x49')]['Descriptions']=integrations[_0x92bd('0x54')](_0x13bd72[_0x92bd('0x49')]['channel'],_0x13bd72['body'][_0x92bd('0x2e')]);return db[_0x92bd('0x4d')][_0x92bd('0x48')](_0x13bd72['body'],{'include':[{'model':db[_0x92bd('0x55')],'as':_0x92bd('0x52')},{'model':db[_0x92bd('0x55')],'as':_0x92bd('0x56')}]});}return null;})[_0x92bd('0x25')](respondWithResult(_0x20f209,null))['catch'](handleError(_0x20f209,null));};exports[_0x92bd('0x57')]=function(_0x46356b,_0x185d97,_0x343388){var _0x39dd5f=[_0x92bd('0x58'),_0x92bd('0x59'),'knowledge',_0x92bd('0x5a'),_0x92bd('0x5b'),_0x92bd('0x5c'),_0x92bd('0x5d'),_0x92bd('0x5e'),'category'];var _0x1c9059=[_0x92bd('0x5f'),'made_sla',_0x92bd('0x60'),'watch_list',_0x92bd('0x61'),_0x92bd('0x62'),_0x92bd('0x63'),_0x92bd('0x59'),_0x92bd('0x64'),_0x92bd('0x65'),'resolved_by',_0x92bd('0x66'),_0x92bd('0x67'),_0x92bd('0x68'),'sys_created_on','sys_domain',_0x92bd('0x69'),'sys_created_by',_0x92bd('0x6a'),_0x92bd('0x37'),_0x92bd('0x6b'),_0x92bd('0x6c'),_0x92bd('0x6d'),_0x92bd('0x6e'),_0x92bd('0x6f'),'active',_0x92bd('0x70'),_0x92bd('0x71'),_0x92bd('0x72'),_0x92bd('0x73'),_0x92bd('0x74'),'time_worked','expected_start','opened_at',_0x92bd('0x75'),'group_list',_0x92bd('0x76'),_0x92bd('0x77'),'resolved_at','caller_id',_0x92bd('0x78'),'subcategory','work_notes',_0x92bd('0x79'),_0x92bd('0x5b'),_0x92bd('0x7a'),_0x92bd('0x7b'),_0x92bd('0x7c'),_0x92bd('0x7d'),_0x92bd('0x7e'),'additional_assignee_list',_0x92bd('0x7f'),'calendar_duration',_0x92bd('0x5c'),_0x92bd('0x80'),_0x92bd('0x81'),'closed_by',_0x92bd('0x82'),_0x92bd('0x83'),_0x92bd('0x84'),_0x92bd('0x85'),_0x92bd('0x86'),_0x92bd('0x5d'),'urgency','problem_id',_0x92bd('0x87'),'reassignment_count',_0x92bd('0x88'),_0x92bd('0x89'),_0x92bd('0x5e'),_0x92bd('0x8a'),_0x92bd('0x8b'),'approval',_0x92bd('0x8c'),_0x92bd('0x8d'),_0x92bd('0x8e'),_0x92bd('0x8f'),_0x92bd('0x90'),_0x92bd('0x91'),_0x92bd('0x92'),_0x92bd('0x93'),_0x92bd('0x94'),'category'];var _0x5cf339='';var _0x323260='';var _0x948a61=[];var _0x4e30ed='';var _0x4dc5bb='';var _0x3e4b4b=[];var _0x4b9b92='';var _0x478c4b='';var _0x12db0e={};var _0x37bc92='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x46356b[_0x92bd('0x44')]['id']},'attributes':['id',_0x92bd('0x95'),_0x92bd('0x96'),_0x92bd('0x97'),'remoteUri',_0x92bd('0x98')]})['then'](handleEntityNotFound(_0x185d97,null))['then'](function(_0x44c1ae){if(_0x44c1ae){_0x37bc92=_0x44c1ae[_0x92bd('0x99')];var _0x2d3e51=_0x37bc92[_0x92bd('0x9a')](-0x1);if(_0x2d3e51==='/'){_0x37bc92=_0x37bc92[_0x92bd('0x9b')](0x0,_0x37bc92[_0x92bd('0x9c')](_0x2d3e51));}_0x478c4b=util[_0x92bd('0x9d')](_0x92bd('0x9e'),_0x37bc92);_0x4b9b92=util[_0x92bd('0x9d')](_0x92bd('0x9f'),_0x37bc92);_0x12db0e={'user':_0x44c1ae['username'],'pass':_0x44c1ae[_0x92bd('0x96')]};var _0x1c1513={'method':_0x92bd('0xa0'),'uri':_0x478c4b+_0x92bd('0xa1'),'auth':_0x12db0e,'json':!![]};return rp(_0x1c1513);}})[_0x92bd('0x25')](function(_0x346ddc){if(_0x346ddc[_0x92bd('0xa2')][_0x92bd('0x35')]>0x0){_0x5cf339=_0x346ddc[_0x92bd('0xa2')];}console[_0x92bd('0xa3')](_0x92bd('0xa4'),_0x5cf339);_0x3e4b4b=[];_0x323260=Object[_0x92bd('0xa5')]([],_0x5cf339);_[_0x92bd('0xa6')](_0x323260,function(_0x4396bf){return!_0x39dd5f[_0x92bd('0xa7')](_0x4396bf[_0x92bd('0x2f')]);});_0x323260[_0x92bd('0xa8')](function(_0x39a1e2){var _0xcda360=createFieldObject(_0x4b9b92,_0x12db0e,_0x39a1e2[_0x92bd('0xa9')],_0x39a1e2[_0x92bd('0x2f')],_0x39a1e2['label'],![]);_0x3e4b4b[_0x92bd('0xaa')](_0xcda360);});return Promise['all'](_0x3e4b4b);})[_0x92bd('0x25')](function(_0x34f75b){_0x948a61=_0x34f75b;_0x4e30ed=Object['assign']([],_0x5cf339);console[_0x92bd('0xa3')]('TCL:\x20_object',_0x5cf339);_[_0x92bd('0xa6')](_0x4e30ed,function(_0x347536){return _0x1c9059[_0x92bd('0xa7')](_0x347536[_0x92bd('0x2f')]);});console[_0x92bd('0xa3')](_0x92bd('0xab'),_0x4e30ed);_0x3e4b4b=[];_0x4e30ed['forEach'](function(_0x1d456c){var _0x2479ce=createFieldObject(_0x4b9b92,_0x12db0e,_0x1d456c[_0x92bd('0xa9')],_0x1d456c[_0x92bd('0x2f')],_0x1d456c[_0x92bd('0xac')],!![]);_0x3e4b4b['push'](_0x2479ce);});return Promise['all'](_0x3e4b4b);})[_0x92bd('0x25')](function(_0x2069fc){_0x4dc5bb=_0x2069fc;var _0x31c220=_0x948a61[_0x92bd('0xad')](_0x4dc5bb);return{'count':_0x31c220['length'],'rows':_0x31c220};})[_0x92bd('0x25')](respondWithResult(_0x185d97,null))[_0x92bd('0x47')](function(_0x15a796){console['log']('ServiceNow\x20error:\x20'+_0x15a796);var _0x28dd64=_0x46356b[_0x92bd('0x31')]['test']?0x1f4:_0x15a796[_0x92bd('0xae')]||0x1f4;logger[_0x92bd('0xaf')](_0x15a796['stack']);delete _0x15a796[_0x92bd('0x2f')];if(_0x28dd64===0x191){_0x28dd64=0x190;}_0x185d97[_0x92bd('0x1a')](_0x28dd64)['send'](_0x46356b[_0x92bd('0x31')][_0x92bd('0xb0')]?{'message':_0x92bd('0xb1'),'statusCode':_0x15a796[_0x92bd('0xae')]}:_0x15a796);});};function createFieldObject(_0x20309a,_0x28e5f4,_0x1974b3,_0x3d0399,_0xd3d9b3,_0x4b6063){return new Promise(function(_0xe34605,_0x4eab0f){var _0x54a168={'id':_0x3d0399,'name':_0xd3d9b3,'custom':_0x4b6063};if(_0x1974b3===_0x92bd('0xb2')){_0x54a168[_0x92bd('0x3e')]=[{'name':_0x92bd('0xb3'),'value':'true'},{'name':_0x92bd('0xb4'),'value':_0x92bd('0xb5')}];_0xe34605(_0x54a168);}else{var _0x1f85d3={'method':_0x92bd('0xa0'),'uri':_0x20309a+_0x92bd('0xb6')+_0x3d0399,'auth':_0x28e5f4,'json':!![]};return rp(_0x1f85d3)[_0x92bd('0x25')](function(_0x4d6b11){var _0x2a1083=[];if(_0x4d6b11[_0x92bd('0xa2')]['length']>0x0){_0x4d6b11['result'][_0x92bd('0xa8')](function(_0x4a61d8){if(_0x4a61d8[_0x92bd('0xb7')]===_0x92bd('0xb5')){var _0x60f123={'name':_0x4a61d8['label'],'value':_0x4a61d8[_0x92bd('0xb8')]};_0x2a1083[_0x92bd('0xaa')](_0x60f123);}});}_0x54a168[_0x92bd('0x3e')]=_0x2a1083;if(_0x54a168[_0x92bd('0x3e')][_0x92bd('0x35')]>0x0){_0xe34605(_0x54a168);}else{if(_0x4b6063==![]){_0xe34605();}else{_0xe34605(_0x54a168);}}});}});}
\ No newline at end of file