Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 0dc7528..9fdf445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa2=['work_notes_list','sys_domain_path','rfc','expected_start','opened_at','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','username','incident?sysparm_display_value=all','result','assign','remove','includes','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','ServicenowConfiguration','pick','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active'];(function(_0x3e0aa6,_0x1a542b){var _0x2443cb=function(_0x3578ec){while(--_0x3578ec){_0x3e0aa6['push'](_0x3e0aa6['shift']());}};_0x2443cb(++_0x1a542b);}(_0x3aa2,0x1d3));var _0x23aa=function(_0x2558ee,_0x2a2574){_0x2558ee=_0x2558ee-0x0;var _0x431306=_0x3aa2[_0x2558ee];return _0x431306;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x23aa('0x0'));var rimraf=require(_0x23aa('0x1'));var zipdir=require(_0x23aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23aa('0x3'));var moment=require(_0x23aa('0x4'));var BPromise=require(_0x23aa('0x5'));var Mustache=require(_0x23aa('0x6'));var util=require(_0x23aa('0x7'));var path=require(_0x23aa('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x23aa('0x9'));var crypto=require(_0x23aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x23aa('0xb'));var toCsv=require(_0x23aa('0xc'));var querystring=require('querystring');var Papa=require(_0x23aa('0xd'));var Redis=require(_0x23aa('0xe'));var authService=require(_0x23aa('0xf'));var qs=require(_0x23aa('0x10'));var as=require(_0x23aa('0x11'));var hardwareService=require(_0x23aa('0x12'));var logger=require(_0x23aa('0x13'))('api');var utils=require(_0x23aa('0x14'));var config=require(_0x23aa('0x15'));var db=require(_0x23aa('0x16'))['db'];var integrations=require(_0x23aa('0x17'));var jayson=require(_0x23aa('0x18'));var client=jayson[_0x23aa('0x19')][_0x23aa('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x52a66c,_0x39592c,_0x156421){if(_0x156421){var _0x500492=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x500492['test'](_0x39592c)){return _0x52a66c;}else{throw new db[(_0x23aa('0x1b'))][(_0x23aa('0x1c'))](_0x23aa('0x1d'));}}else{return _0x52a66c;}}function respondWithRpcPromise(_0x1288b5,_0xba99,_0x8673da,_0x5f5405){return new BPromise(function(_0x6c26ef,_0x487d1d){var _0x3e15fe=_0x5f5405||client;return _0x3e15fe[_0x23aa('0x1e')](_0x1288b5,_0x8673da)['then'](function(_0x5eb853){logger[_0x23aa('0x1f')](_0x23aa('0x20'),_0xba99,_0x23aa('0x21'));logger[_0x23aa('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xba99,_0x23aa('0x21'),JSON['stringify'](_0x5eb853));if(_0x5eb853[_0x23aa('0x23')]){if(_0x5eb853[_0x23aa('0x23')]['code']===0x1f4){logger[_0x23aa('0x23')](_0x23aa('0x20'),_0xba99,_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);return _0x487d1d(_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);}logger[_0x23aa('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0xba99,_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);return _0x6c26ef(_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);}else{logger[_0x23aa('0x1f')](_0x23aa('0x20'),_0xba99,_0x23aa('0x21'));_0x6c26ef(_0x5eb853['result'][_0x23aa('0x24')]);}})['catch'](function(_0x2488a5){logger[_0x23aa('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0xba99,_0x2488a5);_0x487d1d(_0x2488a5);});});}function respondWithStatusCode(_0x43a2a0,_0x4ee74f){_0x4ee74f=_0x4ee74f||0xcc;return function(_0x30e5a6){if(_0x30e5a6){return _0x43a2a0[_0x23aa('0x25')](_0x4ee74f);}return _0x43a2a0[_0x23aa('0x26')](_0x4ee74f)[_0x23aa('0x27')]();};}function respondWithResult(_0x5f461a,_0x4b6f9f){_0x4b6f9f=_0x4b6f9f||0xc8;return function(_0x4b9ccc){if(_0x4b9ccc){return _0x5f461a[_0x23aa('0x26')](_0x4b6f9f)[_0x23aa('0x28')](_0x4b9ccc);}};}function respondWithFilteredResult(_0x38c5ce,_0x45e398){return function(_0x422053){if(_0x422053){var _0x5bd0e9=_0x422053[_0x23aa('0x29')],_0x54e881=_0x45e398[_0x23aa('0x2a')],_0x4901d3=_0x45e398[_0x23aa('0x2a')]+_0x45e398['limit'],_0x8caa3;if(_0x4901d3>=_0x5bd0e9){_0x4901d3=_0x5bd0e9;_0x8caa3=0xc8;}else{_0x8caa3=0xce;}_0x38c5ce['status'](_0x8caa3);return _0x38c5ce[_0x23aa('0x2b')](_0x23aa('0x2c'),_0x54e881+'-'+_0x4901d3+'/'+_0x5bd0e9)[_0x23aa('0x28')](_0x422053);}return null;};}function patchUpdates(_0x45f5d4){return function(_0x1a3aff){try{jsonpatch[_0x23aa('0x2d')](_0x1a3aff,_0x45f5d4,!![]);}catch(_0x3c3bb8){return BPromise[_0x23aa('0x2e')](_0x3c3bb8);}return _0x1a3aff[_0x23aa('0x2f')]();};}function saveUpdates(_0x48e3e2,_0x1bc388){return function(_0x1f3255){if(_0x1f3255){return _0x1f3255[_0x23aa('0x30')](_0x48e3e2)[_0x23aa('0x31')](function(_0x5534d8){return _0x5534d8;});}return null;};}function removeEntity(_0x25884b,_0x4e2126){return function(_0x31c809){if(_0x31c809){return _0x31c809[_0x23aa('0x32')]()['then'](function(){_0x25884b[_0x23aa('0x26')](0xcc)[_0x23aa('0x27')]();});}};}function handleEntityNotFound(_0x45636,_0x3f8f86){return function(_0x486874){if(!_0x486874){_0x45636[_0x23aa('0x25')](0x194);}return _0x486874;};}function handleError(_0x4b867a,_0x2137a7){_0x2137a7=_0x2137a7||0x1f4;return function(_0x18eb08){logger[_0x23aa('0x23')](_0x18eb08['stack']);if(_0x18eb08[_0x23aa('0x33')]){delete _0x18eb08['name'];}_0x4b867a[_0x23aa('0x26')](_0x2137a7)[_0x23aa('0x34')](_0x18eb08);};}exports[_0x23aa('0x35')]=function(_0x38de51,_0x5ee551){var _0xa51583={},_0x2776d4={},_0xddbe76={'count':0x0,'rows':[]};var _0xc1c266=_[_0x23aa('0x36')](db[_0x23aa('0x37')][_0x23aa('0x38')],function(_0x109914){return{'name':_0x109914[_0x23aa('0x39')],'type':_0x109914[_0x23aa('0x3a')][_0x23aa('0x3b')]};});_0x2776d4[_0x23aa('0x3c')]=_[_0x23aa('0x36')](_0xc1c266,_0x23aa('0x33'));_0x2776d4[_0x23aa('0x3d')]=_[_0x23aa('0x3e')](_0x38de51[_0x23aa('0x3d')]);_0x2776d4[_0x23aa('0x3f')]=_[_0x23aa('0x40')](_0x2776d4[_0x23aa('0x3c')],_0x2776d4['query']);_0xa51583[_0x23aa('0x41')]=_[_0x23aa('0x40')](_0x2776d4[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x38de51['query']['fields']));_0xa51583[_0x23aa('0x41')]=_0xa51583[_0x23aa('0x41')][_0x23aa('0x43')]?_0xa51583[_0x23aa('0x41')]:_0x2776d4['model'];if(!_0x38de51[_0x23aa('0x3d')][_0x23aa('0x44')](_0x23aa('0x45'))){_0xa51583['limit']=qs['limit'](_0x38de51['query'][_0x23aa('0x46')]);_0xa51583[_0x23aa('0x2a')]=qs[_0x23aa('0x2a')](_0x38de51[_0x23aa('0x3d')]['offset']);}_0xa51583[_0x23aa('0x47')]=qs[_0x23aa('0x48')](_0x38de51[_0x23aa('0x3d')][_0x23aa('0x48')]);_0xa51583[_0x23aa('0x49')]=qs['filters'](_['pick'](_0x38de51[_0x23aa('0x3d')],_0x2776d4['filters']));if(_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4a')]){_0xa51583[_0x23aa('0x49')]=_[_0x23aa('0x4b')](_0xa51583['where'],{'$or':_[_0x23aa('0x36')](_0xc1c266,function(_0x3c6d3f){if(_0x3c6d3f['type']!==_0x23aa('0x4c')){var _0x315102={};_0x315102[_0x3c6d3f['name']]={'$like':'%'+_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4a')]+'%'};return _0x315102;}})});}_0xa51583=_[_0x23aa('0x4b')]({},_0xa51583,_0x38de51[_0x23aa('0x4d')]);var _0x285615={'where':_0xa51583[_0x23aa('0x49')]};return db[_0x23aa('0x37')][_0x23aa('0x29')](_0x285615)[_0x23aa('0x31')](function(_0x2b8185){_0xddbe76[_0x23aa('0x29')]=_0x2b8185;if(_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4e')]){_0xa51583['include']=[{'all':!![]}];}return db[_0x23aa('0x37')]['findAll'](_0xa51583);})[_0x23aa('0x31')](function(_0x395a9f){_0xddbe76[_0x23aa('0x4f')]=_0x395a9f;return _0xddbe76;})[_0x23aa('0x31')](respondWithFilteredResult(_0x5ee551,_0xa51583))['catch'](handleError(_0x5ee551,null));};exports[_0x23aa('0x50')]=function(_0x1d46e,_0x5c58e0){var _0x462e58={'raw':![],'where':{'id':_0x1d46e[_0x23aa('0x51')]['id']}},_0x115a7f={};_0x115a7f['model']=_[_0x23aa('0x3e')](db[_0x23aa('0x37')]['rawAttributes']);_0x115a7f[_0x23aa('0x3d')]=_['keys'](_0x1d46e[_0x23aa('0x3d')]);_0x115a7f[_0x23aa('0x3f')]=_[_0x23aa('0x40')](_0x115a7f[_0x23aa('0x3c')],_0x115a7f[_0x23aa('0x3d')]);_0x462e58[_0x23aa('0x41')]=_[_0x23aa('0x40')](_0x115a7f[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x1d46e[_0x23aa('0x3d')][_0x23aa('0x42')]));_0x462e58[_0x23aa('0x41')]=_0x462e58['attributes']['length']?_0x462e58['attributes']:_0x115a7f[_0x23aa('0x3c')];if(_0x1d46e['query'][_0x23aa('0x4e')]){_0x462e58[_0x23aa('0x52')]=[{'all':!![]}];}_0x462e58=_[_0x23aa('0x4b')]({},_0x462e58,_0x1d46e[_0x23aa('0x4d')]);return db[_0x23aa('0x37')][_0x23aa('0x53')](_0x462e58)['then'](handleEntityNotFound(_0x5c58e0,null))[_0x23aa('0x31')](respondWithResult(_0x5c58e0,null))[_0x23aa('0x54')](handleError(_0x5c58e0,null));};exports['create']=function(_0x1311df,_0x3e2eaa){return db[_0x23aa('0x37')][_0x23aa('0x55')](_0x1311df[_0x23aa('0x56')],{})['then'](respondWithResult(_0x3e2eaa,0xc9))['catch'](handleError(_0x3e2eaa,null));};exports[_0x23aa('0x30')]=function(_0x4dad55,_0x2aed59){if(_0x4dad55[_0x23aa('0x56')]['id']){delete _0x4dad55[_0x23aa('0x56')]['id'];}return db[_0x23aa('0x37')][_0x23aa('0x53')]({'where':{'id':_0x4dad55[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x2aed59,null))[_0x23aa('0x31')](saveUpdates(_0x4dad55[_0x23aa('0x56')],null))['then'](respondWithResult(_0x2aed59,null))['catch'](handleError(_0x2aed59,null));};exports[_0x23aa('0x32')]=function(_0x1cf933,_0x497940){return db[_0x23aa('0x37')][_0x23aa('0x53')]({'where':{'id':_0x1cf933[_0x23aa('0x51')]['id']}})['then'](handleEntityNotFound(_0x497940,null))['then'](removeEntity(_0x497940,null))[_0x23aa('0x54')](handleError(_0x497940,null));};exports['getConfigurations']=function(_0x34adc6,_0x4ad30e,_0x18227c){var _0x4c0e12={};var _0x2b355d={};var _0x6df981;var _0x5a1107;return db[_0x23aa('0x37')]['findOne']({'where':{'id':_0x34adc6[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x4ad30e,null))[_0x23aa('0x31')](function(_0x5db3bb){if(_0x5db3bb){_0x6df981=_0x5db3bb;_0x2b355d[_0x23aa('0x3c')]=_[_0x23aa('0x3e')](db[_0x23aa('0x57')][_0x23aa('0x38')]);_0x2b355d[_0x23aa('0x3d')]=_[_0x23aa('0x3e')](_0x34adc6['query']);_0x2b355d['filters']=_[_0x23aa('0x40')](_0x2b355d[_0x23aa('0x3c')],_0x2b355d['query']);_0x4c0e12[_0x23aa('0x41')]=_['intersection'](_0x2b355d[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x34adc6['query'][_0x23aa('0x42')]));_0x4c0e12[_0x23aa('0x41')]=_0x4c0e12[_0x23aa('0x41')]['length']?_0x4c0e12[_0x23aa('0x41')]:_0x2b355d[_0x23aa('0x3c')];_0x4c0e12[_0x23aa('0x47')]=qs[_0x23aa('0x48')](_0x34adc6['query']['sort']);_0x4c0e12[_0x23aa('0x49')]=qs[_0x23aa('0x3f')](_[_0x23aa('0x58')](_0x34adc6[_0x23aa('0x3d')],_0x2b355d[_0x23aa('0x3f')]));if(_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x4a')]){_0x4c0e12[_0x23aa('0x49')]=_[_0x23aa('0x4b')](_0x4c0e12['where'],{'$or':_[_0x23aa('0x36')](_0x4c0e12['attributes'],function(_0x469950){var _0x550bd2={};_0x550bd2[_0x469950]={'$like':'%'+_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x4a')]+'%'};return _0x550bd2;})});}_0x4c0e12=_['merge']({},_0x4c0e12,_0x34adc6[_0x23aa('0x4d')]);return _0x6df981[_0x23aa('0x59')](_0x4c0e12);}})[_0x23aa('0x31')](function(_0x2d5987){if(_0x2d5987){_0x5a1107=_0x2d5987['length'];if(!_0x34adc6['query'][_0x23aa('0x44')](_0x23aa('0x45'))){_0x4c0e12[_0x23aa('0x46')]=qs[_0x23aa('0x46')](_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x46')]);_0x4c0e12[_0x23aa('0x2a')]=qs[_0x23aa('0x2a')](_0x34adc6['query']['offset']);}return _0x6df981[_0x23aa('0x59')](_0x4c0e12);}})[_0x23aa('0x31')](function(_0x181ae5){if(_0x181ae5){return _0x181ae5?{'count':_0x5a1107,'rows':_0x181ae5}:null;}})[_0x23aa('0x31')](respondWithResult(_0x4ad30e,null))[_0x23aa('0x54')](handleError(_0x4ad30e,null));};exports['addConfiguration']=function(_0x26b666,_0x3e92e2,_0x2d9bed){if(_0x26b666[_0x23aa('0x56')]['id']){delete _0x26b666[_0x23aa('0x56')]['id'];}return db[_0x23aa('0x37')][_0x23aa('0x5a')]({'where':{'id':_0x26b666[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x3e92e2,null))[_0x23aa('0x31')](function(_0x2638da){if(_0x2638da){_0x26b666[_0x23aa('0x56')][_0x23aa('0x5b')]=_0x2638da['id'];_0x26b666[_0x23aa('0x56')][_0x23aa('0x5c')]=integrations[_0x23aa('0x5d')](_0x26b666[_0x23aa('0x56')][_0x23aa('0x5e')],_0x26b666[_0x23aa('0x56')][_0x23aa('0x3a')]);_0x26b666[_0x23aa('0x56')][_0x23aa('0x5f')]=integrations[_0x23aa('0x60')](_0x26b666[_0x23aa('0x56')][_0x23aa('0x5e')],_0x26b666[_0x23aa('0x56')][_0x23aa('0x3a')]);return db['ServicenowConfiguration']['create'](_0x26b666[_0x23aa('0x56')],{'include':[{'model':db[_0x23aa('0x61')],'as':'Subjects'},{'model':db[_0x23aa('0x61')],'as':_0x23aa('0x5f')}]});}return null;})[_0x23aa('0x31')](respondWithResult(_0x3e92e2,null))[_0x23aa('0x54')](handleError(_0x3e92e2,null));};exports[_0x23aa('0x62')]=function(_0x5f240a,_0x152e6c,_0x4def90){var _0x4729c7=[_0x23aa('0x63'),_0x23aa('0x64'),'knowledge',_0x23aa('0x65'),_0x23aa('0x66'),_0x23aa('0x67'),_0x23aa('0x68'),'severity',_0x23aa('0x69')];var _0xe88a69=[_0x23aa('0x6a'),_0x23aa('0x63'),_0x23aa('0x6b'),_0x23aa('0x6c'),_0x23aa('0x6d'),_0x23aa('0x6e'),_0x23aa('0x6f'),'hold_reason',_0x23aa('0x70'),_0x23aa('0x71'),_0x23aa('0x72'),_0x23aa('0x73'),_0x23aa('0x74'),_0x23aa('0x75'),'sys_created_on',_0x23aa('0x76'),'state',_0x23aa('0x77'),_0x23aa('0x78'),_0x23aa('0x47'),_0x23aa('0x79'),_0x23aa('0x7a'),_0x23aa('0x7b'),_0x23aa('0x7c'),_0x23aa('0x7d'),_0x23aa('0x7e'),_0x23aa('0x7f'),'business_service','priority',_0x23aa('0x80'),_0x23aa('0x81'),'time_worked',_0x23aa('0x82'),_0x23aa('0x83'),'business_duration',_0x23aa('0x84'),'work_end',_0x23aa('0x85'),'resolved_at',_0x23aa('0x86'),_0x23aa('0x87'),'subcategory',_0x23aa('0x88'),_0x23aa('0x89'),_0x23aa('0x66'),'correlation_display','delivery_task',_0x23aa('0x8a'),_0x23aa('0x8b'),_0x23aa('0x8c'),_0x23aa('0x8d'),_0x23aa('0x8e'),_0x23aa('0x8f'),_0x23aa('0x67'),_0x23aa('0x90'),'close_notes',_0x23aa('0x91'),_0x23aa('0x92'),_0x23aa('0x93'),_0x23aa('0x94'),_0x23aa('0x95'),_0x23aa('0x96'),_0x23aa('0x68'),_0x23aa('0x97'),_0x23aa('0x98'),_0x23aa('0x99'),_0x23aa('0x9a'),_0x23aa('0x9b'),'assigned_to',_0x23aa('0x9c'),_0x23aa('0x9d'),_0x23aa('0x9e'),'approval',_0x23aa('0x9f'),_0x23aa('0xa0'),'sys_mod_count',_0x23aa('0xa1'),_0x23aa('0xa2'),_0x23aa('0xa3'),_0x23aa('0xa4'),_0x23aa('0xa5'),_0x23aa('0xa6'),_0x23aa('0x69')];var _0x535dbe='';var _0x1aa017='';var _0x21eaff=[];var _0x316c19='';var _0x134091='';var _0x248d80=[];var _0x40fbe1='';var _0x145da3='';var _0x3b0149={};var _0x5894af='';return db[_0x23aa('0x37')]['findOne']({'where':{'id':_0x5f240a[_0x23aa('0x51')]['id']},'attributes':['id','username','password',_0x23aa('0xa7'),'remoteUri',_0x23aa('0xa8')]})[_0x23aa('0x31')](handleEntityNotFound(_0x152e6c,null))[_0x23aa('0x31')](function(_0x499e9f){if(_0x499e9f){_0x5894af=_0x499e9f[_0x23aa('0xa9')];var _0x30ec75=_0x5894af[_0x23aa('0xaa')](-0x1);if(_0x30ec75==='/'){_0x5894af=_0x5894af[_0x23aa('0xab')](0x0,_0x5894af['lastIndexOf'](_0x30ec75));}_0x145da3=util[_0x23aa('0xac')](_0x23aa('0xad'),_0x5894af);_0x40fbe1=util['format']('%s/api/now/table/',_0x5894af);_0x3b0149={'user':_0x499e9f[_0x23aa('0xae')],'pass':_0x499e9f['password']};var _0x517f17={'method':'GET','uri':_0x145da3+_0x23aa('0xaf'),'auth':_0x3b0149,'json':!![]};return rp(_0x517f17);}})[_0x23aa('0x31')](function(_0x358eb3){if(_0x358eb3[_0x23aa('0xb0')][_0x23aa('0x43')]>0x0){_0x535dbe=_0x358eb3[_0x23aa('0xb0')];}console['log']('incident\x20table\x20objects',_0x535dbe);_0x248d80=[];_0x1aa017=Object[_0x23aa('0xb1')]([],_0x535dbe);_[_0x23aa('0xb2')](_0x1aa017,function(_0x5e63ad){return!_0x4729c7[_0x23aa('0xb3')](_0x5e63ad[_0x23aa('0x33')]);});_0x1aa017['forEach'](function(_0x39e7a5){var _0x4ec974=createFieldObject(_0x40fbe1,_0x3b0149,_0x39e7a5['internalType'],_0x39e7a5['name'],_0x39e7a5[_0x23aa('0xb4')],![]);_0x248d80[_0x23aa('0xb5')](_0x4ec974);});return Promise[_0x23aa('0xb6')](_0x248d80);})[_0x23aa('0x31')](function(_0xf84230){_0x21eaff=_0xf84230;_0x316c19=Object[_0x23aa('0xb1')]([],_0x535dbe);console[_0x23aa('0xb7')]('TCL:\x20_object',_0x535dbe);_[_0x23aa('0xb2')](_0x316c19,function(_0x41adf7){return _0xe88a69[_0x23aa('0xb3')](_0x41adf7[_0x23aa('0x33')]);});console[_0x23aa('0xb7')](_0x23aa('0xb8'),_0x316c19);_0x248d80=[];_0x316c19[_0x23aa('0xb9')](function(_0x5134d1){var _0xaf8d7=createFieldObject(_0x40fbe1,_0x3b0149,_0x5134d1[_0x23aa('0xba')],_0x5134d1[_0x23aa('0x33')],_0x5134d1['label'],!![]);_0x248d80[_0x23aa('0xb5')](_0xaf8d7);});return Promise[_0x23aa('0xb6')](_0x248d80);})[_0x23aa('0x31')](function(_0x384d80){_0x134091=_0x384d80;var _0x3a51ee=_0x21eaff['concat'](_0x134091);return{'count':_0x3a51ee['length'],'rows':_0x3a51ee};})[_0x23aa('0x31')](respondWithResult(_0x152e6c,null))[_0x23aa('0x54')](function(_0x2e1ceb){console[_0x23aa('0xb7')](_0x23aa('0xbb')+_0x2e1ceb);var _0x532325=_0x5f240a[_0x23aa('0x3d')][_0x23aa('0xbc')]?0x1f4:_0x2e1ceb[_0x23aa('0xbd')]||0x1f4;logger['error'](_0x2e1ceb[_0x23aa('0xbe')]);delete _0x2e1ceb[_0x23aa('0x33')];if(_0x532325===0x191){_0x532325=0x190;}_0x152e6c[_0x23aa('0x26')](_0x532325)['send'](_0x5f240a[_0x23aa('0x3d')][_0x23aa('0xbc')]?{'message':_0x23aa('0xbf'),'statusCode':_0x2e1ceb[_0x23aa('0xbd')]}:_0x2e1ceb);});};function createFieldObject(_0x14517e,_0x1cb0a7,_0x3585d0,_0x5a49a9,_0x385c86,_0xadeddf){return new Promise(function(_0x5da15d,_0x1cc6d7){var _0xa7527b={'id':_0x5a49a9,'name':_0x385c86,'custom':_0xadeddf};if(_0x3585d0===_0x23aa('0xc0')){_0xa7527b[_0x23aa('0x4d')]=[{'name':'True','value':'true'},{'name':_0x23aa('0xc1'),'value':_0x23aa('0xc2')}];_0x5da15d(_0xa7527b);}else{var _0x43b8e4={'method':_0x23aa('0xc3'),'uri':_0x14517e+_0x23aa('0xc4')+_0x5a49a9,'auth':_0x1cb0a7,'json':!![]};return rp(_0x43b8e4)[_0x23aa('0x31')](function(_0x33223a){var _0x1d2d27=[];if(_0x33223a[_0x23aa('0xb0')][_0x23aa('0x43')]>0x0){_0x33223a['result'][_0x23aa('0xb9')](function(_0x5d1e9c){if(_0x5d1e9c['inactive']===_0x23aa('0xc2')){var _0x5cf26d={'name':_0x5d1e9c[_0x23aa('0xb4')],'value':_0x5d1e9c[_0x23aa('0xc5')]};_0x1d2d27[_0x23aa('0xb5')](_0x5cf26d);}});}_0xa7527b['options']=_0x1d2d27;if(_0xa7527b[_0x23aa('0x4d')][_0x23aa('0x43')]>0x0){_0x5da15d(_0xa7527b);}else{if(_0xadeddf==![]){_0x5da15d();}else{_0x5da15d(_0xa7527b);}}});}});}
\ 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