Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index a0b0d6d..79878ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0xbafc=['then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','ServicenowConfiguration','getConfigurations','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','parent','child_incidents','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','category','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','true','false','inactive','value','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x1f09fa,_0x3265ca){var _0x197c8d=function(_0x91c3b){while(--_0x91c3b){_0x1f09fa['push'](_0x1f09fa['shift']());}};_0x197c8d(++_0x3265ca);}(_0xbafc,0x1c8));var _0xcbaf=function(_0x3efd98,_0x5a231a){_0x3efd98=_0x3efd98-0x0;var _0x3d99b7=_0xbafc[_0x3efd98];return _0x3d99b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbaf('0x0'));var jsonpatch=require(_0xcbaf('0x1'));var rp=require('request-promise');var moment=require(_0xcbaf('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcbaf('0x3'));var sox=require(_0xcbaf('0x4'));var csv=require(_0xcbaf('0x5'));var ejs=require(_0xcbaf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbaf('0x7'));var squel=require(_0xcbaf('0x8'));var crypto=require('crypto');var jsforce=require(_0xcbaf('0x9'));var deskjs=require(_0xcbaf('0xa'));var toCsv=require(_0xcbaf('0x5'));var querystring=require(_0xcbaf('0xb'));var Papa=require(_0xcbaf('0xc'));var Redis=require(_0xcbaf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcbaf('0xe'));var as=require(_0xcbaf('0xf'));var hardwareService=require(_0xcbaf('0x10'));var logger=require(_0xcbaf('0x11'))(_0xcbaf('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcbaf('0x13'))['db'];var integrations=require(_0xcbaf('0x14'));function respondWithStatusCode(_0x3d7899,_0xad7d3b){_0xad7d3b=_0xad7d3b||0xcc;return function(_0x294149){if(_0x294149){return _0x3d7899['sendStatus'](_0xad7d3b);}return _0x3d7899[_0xcbaf('0x15')](_0xad7d3b)['end']();};}function respondWithResult(_0x140d8f,_0x5a0533){_0x5a0533=_0x5a0533||0xc8;return function(_0x31330d){if(_0x31330d){return _0x140d8f[_0xcbaf('0x15')](_0x5a0533)[_0xcbaf('0x16')](_0x31330d);}};}function respondWithFilteredResult(_0x3838c0,_0x513004){return function(_0x1cb9c0){if(_0x1cb9c0){var _0xeb912c=typeof _0x513004[_0xcbaf('0x17')]===_0xcbaf('0x18')&&typeof _0x513004[_0xcbaf('0x19')]==='undefined';var _0x450d33=_0x1cb9c0[_0xcbaf('0x1a')];var _0x3036b3=_0xeb912c?0x0:_0x513004['offset'];var _0x33df1f=_0xeb912c?_0x1cb9c0[_0xcbaf('0x1a')]:_0x513004[_0xcbaf('0x17')]+_0x513004[_0xcbaf('0x19')];var _0x21ff13;if(_0x33df1f>=_0x450d33){_0x33df1f=_0x450d33;_0x21ff13=0xc8;}else{_0x21ff13=0xce;}_0x3838c0[_0xcbaf('0x15')](_0x21ff13);return _0x3838c0[_0xcbaf('0x1b')](_0xcbaf('0x1c'),_0x3036b3+'-'+_0x33df1f+'/'+_0x450d33)[_0xcbaf('0x16')](_0x1cb9c0);}return null;};}function patchUpdates(_0x5da568){return function(_0xb0dc44){try{jsonpatch[_0xcbaf('0x1d')](_0xb0dc44,_0x5da568,!![]);}catch(_0x4cea79){return BPromise[_0xcbaf('0x1e')](_0x4cea79);}return _0xb0dc44['save']();};}function saveUpdates(_0x562f6c,_0x181351){return function(_0x4be06d){if(_0x4be06d){return _0x4be06d[_0xcbaf('0x1f')](_0x562f6c)['then'](function(_0x2ccfa9){return _0x2ccfa9;});}return null;};}function removeEntity(_0x25971e,_0x1f84ee){return function(_0x4e28f2){if(_0x4e28f2){return _0x4e28f2['destroy']()['then'](function(){_0x25971e[_0xcbaf('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a62f,_0x1ea64c){return function(_0x2a3ebd){if(!_0x2a3ebd){_0x24a62f['sendStatus'](0x194);}return _0x2a3ebd;};}function handleError(_0xb9d022,_0x5e6ac6){_0x5e6ac6=_0x5e6ac6||0x1f4;return function(_0x3ab4fa){logger[_0xcbaf('0x20')](_0x3ab4fa['stack']);if(_0x3ab4fa[_0xcbaf('0x21')]){delete _0x3ab4fa[_0xcbaf('0x21')];}_0xb9d022[_0xcbaf('0x15')](_0x5e6ac6)[_0xcbaf('0x22')](_0x3ab4fa);};}exports['index']=function(_0x5e1413,_0x4acc15){var _0x3b3eaa={},_0x52f43e={},_0x59c107={'count':0x0,'rows':[]};var _0x234195=_[_0xcbaf('0x23')](db[_0xcbaf('0x24')][_0xcbaf('0x25')],function(_0x18c575){return{'name':_0x18c575[_0xcbaf('0x26')],'type':_0x18c575[_0xcbaf('0x27')]['key']};});_0x52f43e['model']=_['map'](_0x234195,_0xcbaf('0x21'));_0x52f43e[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x5e1413[_0xcbaf('0x28')]);_0x52f43e[_0xcbaf('0x2a')]=_['intersection'](_0x52f43e[_0xcbaf('0x2b')],_0x52f43e['query']);_0x3b3eaa[_0xcbaf('0x2c')]=_[_0xcbaf('0x2d')](_0x52f43e[_0xcbaf('0x2b')],qs[_0xcbaf('0x2e')](_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0x3b3eaa[_0xcbaf('0x2c')]=_0x3b3eaa[_0xcbaf('0x2c')][_0xcbaf('0x2f')]?_0x3b3eaa[_0xcbaf('0x2c')]:_0x52f43e[_0xcbaf('0x2b')];if(!_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x30')](_0xcbaf('0x31'))){_0x3b3eaa['limit']=qs[_0xcbaf('0x19')](_0x5e1413['query'][_0xcbaf('0x19')]);_0x3b3eaa[_0xcbaf('0x17')]=qs[_0xcbaf('0x17')](_0x5e1413['query'][_0xcbaf('0x17')]);}_0x3b3eaa[_0xcbaf('0x32')]=qs[_0xcbaf('0x33')](_0x5e1413['query'][_0xcbaf('0x33')]);_0x3b3eaa[_0xcbaf('0x34')]=qs[_0xcbaf('0x2a')](_[_0xcbaf('0x35')](_0x5e1413[_0xcbaf('0x28')],_0x52f43e[_0xcbaf('0x2a')]),_0x234195);if(_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x36')]){_0x3b3eaa[_0xcbaf('0x34')]=_[_0xcbaf('0x37')](_0x3b3eaa['where'],{'$or':_[_0xcbaf('0x23')](_0x234195,function(_0x3c76af){if(_0x3c76af[_0xcbaf('0x27')]!=='VIRTUAL'){var _0x45c29c={};_0x45c29c[_0x3c76af[_0xcbaf('0x21')]]={'$like':'%'+_0x5e1413[_0xcbaf('0x28')]['filter']+'%'};return _0x45c29c;}})});}_0x3b3eaa=_['merge']({},_0x3b3eaa,_0x5e1413[_0xcbaf('0x38')]);var _0x10631b={'where':_0x3b3eaa[_0xcbaf('0x34')]};return db[_0xcbaf('0x24')][_0xcbaf('0x1a')](_0x10631b)[_0xcbaf('0x39')](function(_0x327b9e){_0x59c107[_0xcbaf('0x1a')]=_0x327b9e;if(_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x3a')]){_0x3b3eaa[_0xcbaf('0x3b')]=[{'all':!![]}];}return db[_0xcbaf('0x24')][_0xcbaf('0x3c')](_0x3b3eaa);})[_0xcbaf('0x39')](function(_0x318a2f){_0x59c107[_0xcbaf('0x3d')]=_0x318a2f;return _0x59c107;})[_0xcbaf('0x39')](respondWithFilteredResult(_0x4acc15,_0x3b3eaa))[_0xcbaf('0x3e')](handleError(_0x4acc15,null));};exports[_0xcbaf('0x3f')]=function(_0x200ef3,_0x39a993){var _0x2de4f1={'raw':![],'where':{'id':_0x200ef3[_0xcbaf('0x40')]['id']}},_0x4e05a7={};_0x4e05a7['model']=_[_0xcbaf('0x29')](db[_0xcbaf('0x24')][_0xcbaf('0x25')]);_0x4e05a7[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x200ef3[_0xcbaf('0x28')]);_0x4e05a7[_0xcbaf('0x2a')]=_[_0xcbaf('0x2d')](_0x4e05a7['model'],_0x4e05a7[_0xcbaf('0x28')]);_0x2de4f1[_0xcbaf('0x2c')]=_[_0xcbaf('0x2d')](_0x4e05a7[_0xcbaf('0x2b')],qs['fields'](_0x200ef3[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0x2de4f1[_0xcbaf('0x2c')]=_0x2de4f1[_0xcbaf('0x2c')]['length']?_0x2de4f1[_0xcbaf('0x2c')]:_0x4e05a7['model'];if(_0x200ef3[_0xcbaf('0x28')]['includeAll']){_0x2de4f1[_0xcbaf('0x3b')]=[{'all':!![]}];}_0x2de4f1=_[_0xcbaf('0x37')]({},_0x2de4f1,_0x200ef3[_0xcbaf('0x38')]);return db[_0xcbaf('0x24')][_0xcbaf('0x41')](_0x2de4f1)[_0xcbaf('0x39')](handleEntityNotFound(_0x39a993,null))[_0xcbaf('0x39')](respondWithResult(_0x39a993,null))[_0xcbaf('0x3e')](handleError(_0x39a993,null));};exports[_0xcbaf('0x42')]=function(_0x5d007f,_0x261d23){return db[_0xcbaf('0x24')][_0xcbaf('0x42')](_0x5d007f[_0xcbaf('0x43')],{})[_0xcbaf('0x39')](respondWithResult(_0x261d23,0xc9))['catch'](handleError(_0x261d23,null));};exports['update']=function(_0xca83fc,_0x30cc1c){if(_0xca83fc[_0xcbaf('0x43')]['id']){delete _0xca83fc['body']['id'];}return db['ServicenowAccount'][_0xcbaf('0x41')]({'where':{'id':_0xca83fc[_0xcbaf('0x40')]['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x30cc1c,null))[_0xcbaf('0x39')](saveUpdates(_0xca83fc[_0xcbaf('0x43')],null))['then'](respondWithResult(_0x30cc1c,null))[_0xcbaf('0x3e')](handleError(_0x30cc1c,null));};exports[_0xcbaf('0x44')]=function(_0x87aae5,_0x43252c){return db[_0xcbaf('0x24')][_0xcbaf('0x41')]({'where':{'id':_0x87aae5['params']['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x43252c,null))[_0xcbaf('0x39')](removeEntity(_0x43252c,null))[_0xcbaf('0x3e')](handleError(_0x43252c,null));};exports['getConfigurations']=function(_0x1a90bd,_0x494da5,_0x25ecd0){var _0xab0e9d={};var _0x5a0114={};var _0x29ddf5;var _0x1a7d3b;return db[_0xcbaf('0x24')]['findOne']({'where':{'id':_0x1a90bd[_0xcbaf('0x40')]['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x494da5,null))['then'](function(_0x424e0f){if(_0x424e0f){_0x29ddf5=_0x424e0f;_0x5a0114[_0xcbaf('0x2b')]=_[_0xcbaf('0x29')](db[_0xcbaf('0x45')][_0xcbaf('0x25')]);_0x5a0114[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x1a90bd['query']);_0x5a0114[_0xcbaf('0x2a')]=_[_0xcbaf('0x2d')](_0x5a0114[_0xcbaf('0x2b')],_0x5a0114[_0xcbaf('0x28')]);_0xab0e9d['attributes']=_[_0xcbaf('0x2d')](_0x5a0114[_0xcbaf('0x2b')],qs[_0xcbaf('0x2e')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0xab0e9d['attributes']=_0xab0e9d[_0xcbaf('0x2c')]['length']?_0xab0e9d['attributes']:_0x5a0114[_0xcbaf('0x2b')];_0xab0e9d[_0xcbaf('0x32')]=qs[_0xcbaf('0x33')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x33')]);_0xab0e9d[_0xcbaf('0x34')]=qs[_0xcbaf('0x2a')](_[_0xcbaf('0x35')](_0x1a90bd[_0xcbaf('0x28')],_0x5a0114[_0xcbaf('0x2a')]));if(_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x36')]){_0xab0e9d[_0xcbaf('0x34')]=_[_0xcbaf('0x37')](_0xab0e9d[_0xcbaf('0x34')],{'$or':_[_0xcbaf('0x23')](_0xab0e9d[_0xcbaf('0x2c')],function(_0x18d6e9){var _0x121e42={};_0x121e42[_0x18d6e9]={'$like':'%'+_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x36')]+'%'};return _0x121e42;})});}_0xab0e9d=_[_0xcbaf('0x37')]({},_0xab0e9d,_0x1a90bd[_0xcbaf('0x38')]);return _0x29ddf5[_0xcbaf('0x46')](_0xab0e9d);}})[_0xcbaf('0x39')](function(_0x1379af){if(_0x1379af){_0x1a7d3b=_0x1379af[_0xcbaf('0x2f')];if(!_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x30')](_0xcbaf('0x31'))){_0xab0e9d[_0xcbaf('0x19')]=qs[_0xcbaf('0x19')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x19')]);_0xab0e9d[_0xcbaf('0x17')]=qs[_0xcbaf('0x17')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x17')]);}return _0x29ddf5[_0xcbaf('0x46')](_0xab0e9d);}})[_0xcbaf('0x39')](function(_0x2b19c9){if(_0x2b19c9){return _0x2b19c9?{'count':_0x1a7d3b,'rows':_0x2b19c9}:null;}})['then'](respondWithResult(_0x494da5,null))['catch'](handleError(_0x494da5,null));};exports['addConfiguration']=function(_0x2a8ebc,_0x16bc57,_0x12ea13){if(_0x2a8ebc[_0xcbaf('0x43')]['id']){delete _0x2a8ebc['body']['id'];}return db[_0xcbaf('0x24')][_0xcbaf('0x47')]({'where':{'id':_0x2a8ebc[_0xcbaf('0x40')]['id']}})['then'](handleEntityNotFound(_0x16bc57,null))[_0xcbaf('0x39')](function(_0x1d28db){if(_0x1d28db){_0x2a8ebc[_0xcbaf('0x43')]['AccountId']=_0x1d28db['id'];_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x48')]=integrations[_0xcbaf('0x49')](_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x4a')],_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x27')]);_0x2a8ebc['body']['Descriptions']=integrations[_0xcbaf('0x4b')](_0x2a8ebc[_0xcbaf('0x43')]['channel'],_0x2a8ebc[_0xcbaf('0x43')]['type']);return db[_0xcbaf('0x45')][_0xcbaf('0x42')](_0x2a8ebc[_0xcbaf('0x43')],{'include':[{'model':db[_0xcbaf('0x4c')],'as':_0xcbaf('0x48')},{'model':db[_0xcbaf('0x4c')],'as':_0xcbaf('0x4d')}]});}return null;})[_0xcbaf('0x39')](respondWithResult(_0x16bc57,null))[_0xcbaf('0x3e')](handleError(_0x16bc57,null));};exports[_0xcbaf('0x4e')]=function(_0x4e11a3,_0x323199,_0x41e784){var _0x1d6c24=[_0xcbaf('0x4f'),_0xcbaf('0x50'),'knowledge',_0xcbaf('0x51'),_0xcbaf('0x52'),'notify',_0xcbaf('0x53'),_0xcbaf('0x54'),'category'];var _0x32b9fe=[_0xcbaf('0x55'),_0xcbaf('0x4f'),'caused_by','watch_list','upon_reject','sys_updated_on',_0xcbaf('0x56'),_0xcbaf('0x50'),'approval_history',_0xcbaf('0x57'),'resolved_by',_0xcbaf('0x58'),_0xcbaf('0x59'),_0xcbaf('0x5a'),_0xcbaf('0x5b'),_0xcbaf('0x5c'),_0xcbaf('0x5d'),_0xcbaf('0x5e'),_0xcbaf('0x5f'),_0xcbaf('0x32'),_0xcbaf('0x60'),'closed_at',_0xcbaf('0x61'),'delivery_plan',_0xcbaf('0x62'),_0xcbaf('0x63'),_0xcbaf('0x64'),_0xcbaf('0x65'),_0xcbaf('0x66'),'sys_domain_path',_0xcbaf('0x67'),_0xcbaf('0x68'),'expected_start',_0xcbaf('0x69'),_0xcbaf('0x6a'),_0xcbaf('0x6b'),'work_end',_0xcbaf('0x6c'),_0xcbaf('0x6d'),'caller_id',_0xcbaf('0x6e'),'subcategory',_0xcbaf('0x6f'),_0xcbaf('0x70'),_0xcbaf('0x52'),'correlation_display',_0xcbaf('0x71'),_0xcbaf('0x72'),'assignment_group',_0xcbaf('0x73'),'additional_assignee_list',_0xcbaf('0x74'),_0xcbaf('0x75'),'notify','sys_class_name',_0xcbaf('0x76'),_0xcbaf('0x77'),_0xcbaf('0x78'),'parent_incident',_0xcbaf('0x79'),_0xcbaf('0x7a'),_0xcbaf('0x7b'),_0xcbaf('0x53'),_0xcbaf('0x7c'),_0xcbaf('0x7d'),_0xcbaf('0x7e'),_0xcbaf('0x7f'),'activity_due','assigned_to',_0xcbaf('0x54'),'comments',_0xcbaf('0x80'),_0xcbaf('0x81'),_0xcbaf('0x82'),_0xcbaf('0x83'),_0xcbaf('0x84'),_0xcbaf('0x85'),'sys_tags','escalation',_0xcbaf('0x86'),_0xcbaf('0x87'),_0xcbaf('0x88'),_0xcbaf('0x89')];var _0x239911='';var _0x286987='';var _0x48769d=[];var _0x44e32d='';var _0x2046ce='';var _0x1e28a7=[];var _0x53c274='';var _0x3d6b8b='';var _0x4c6c1a={};var _0x2eec73='';return db[_0xcbaf('0x24')][_0xcbaf('0x47')]({'where':{'id':_0x4e11a3[_0xcbaf('0x40')]['id']},'attributes':['id','username',_0xcbaf('0x8a'),_0xcbaf('0x8b'),'remoteUri',_0xcbaf('0x8c')]})['then'](handleEntityNotFound(_0x323199,null))[_0xcbaf('0x39')](function(_0x253b84){if(_0x253b84){_0x2eec73=_0x253b84['remoteUri'];var _0x43781c=_0x2eec73[_0xcbaf('0x8d')](-0x1);if(_0x43781c==='/'){_0x2eec73=_0x2eec73[_0xcbaf('0x8e')](0x0,_0x2eec73[_0xcbaf('0x8f')](_0x43781c));}_0x3d6b8b=util[_0xcbaf('0x90')](_0xcbaf('0x91'),_0x2eec73);_0x53c274=util[_0xcbaf('0x90')](_0xcbaf('0x92'),_0x2eec73);_0x4c6c1a={'user':_0x253b84[_0xcbaf('0x93')],'pass':_0x253b84[_0xcbaf('0x8a')]};var _0x57aec2={'method':_0xcbaf('0x94'),'uri':_0x3d6b8b+_0xcbaf('0x95'),'auth':_0x4c6c1a,'json':!![]};return rp(_0x57aec2);}})[_0xcbaf('0x39')](function(_0xaead83){if(_0xaead83[_0xcbaf('0x96')][_0xcbaf('0x2f')]>0x0){_0x239911=_0xaead83[_0xcbaf('0x96')];}console[_0xcbaf('0x97')](_0xcbaf('0x98'),_0x239911);_0x1e28a7=[];_0x286987=Object[_0xcbaf('0x99')]([],_0x239911);_['remove'](_0x286987,function(_0x39fc85){return!_0x1d6c24[_0xcbaf('0x9a')](_0x39fc85[_0xcbaf('0x21')]);});_0x286987[_0xcbaf('0x9b')](function(_0x523c4f){var _0x47b2c4=createFieldObject(_0x53c274,_0x4c6c1a,_0x523c4f[_0xcbaf('0x9c')],_0x523c4f[_0xcbaf('0x21')],_0x523c4f[_0xcbaf('0x9d')],![]);_0x1e28a7[_0xcbaf('0x9e')](_0x47b2c4);});return Promise[_0xcbaf('0x9f')](_0x1e28a7);})[_0xcbaf('0x39')](function(_0x43baba){_0x48769d=_0x43baba;_0x44e32d=Object[_0xcbaf('0x99')]([],_0x239911);console[_0xcbaf('0x97')](_0xcbaf('0xa0'),_0x239911);_[_0xcbaf('0xa1')](_0x44e32d,function(_0x35ca86){return _0x32b9fe[_0xcbaf('0x9a')](_0x35ca86[_0xcbaf('0x21')]);});console[_0xcbaf('0x97')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x44e32d);_0x1e28a7=[];_0x44e32d[_0xcbaf('0x9b')](function(_0x25a080){var _0x508ac7=createFieldObject(_0x53c274,_0x4c6c1a,_0x25a080[_0xcbaf('0x9c')],_0x25a080[_0xcbaf('0x21')],_0x25a080[_0xcbaf('0x9d')],!![]);_0x1e28a7['push'](_0x508ac7);});return Promise[_0xcbaf('0x9f')](_0x1e28a7);})[_0xcbaf('0x39')](function(_0x41b5b1){_0x2046ce=_0x41b5b1;var _0x3720b4=_0x48769d[_0xcbaf('0xa2')](_0x2046ce);return{'count':_0x3720b4[_0xcbaf('0x2f')],'rows':_0x3720b4};})[_0xcbaf('0x39')](respondWithResult(_0x323199,null))[_0xcbaf('0x3e')](function(_0x44d3e4){console[_0xcbaf('0x97')](_0xcbaf('0xa3')+_0x44d3e4);var _0x2e2473=_0x4e11a3['query'][_0xcbaf('0xa4')]?0x1f4:_0x44d3e4[_0xcbaf('0xa5')]||0x1f4;logger[_0xcbaf('0x20')](_0x44d3e4['stack']);delete _0x44d3e4['name'];if(_0x2e2473===0x191){_0x2e2473=0x190;}_0x323199['status'](_0x2e2473)[_0xcbaf('0x22')](_0x4e11a3[_0xcbaf('0x28')][_0xcbaf('0xa4')]?{'message':_0xcbaf('0xa6'),'statusCode':_0x44d3e4[_0xcbaf('0xa5')]}:_0x44d3e4);});};function createFieldObject(_0x26612b,_0x29a35e,_0x3b734f,_0x5bc534,_0x5c3f81,_0x5d4057){return new Promise(function(_0x5d63ff,_0x277481){var _0x5096d9={'id':_0x5bc534,'name':_0x5c3f81,'custom':_0x5d4057};if(_0x3b734f==='boolean'){_0x5096d9[_0xcbaf('0x38')]=[{'name':'True','value':_0xcbaf('0xa7')},{'name':'False','value':_0xcbaf('0xa8')}];_0x5d63ff(_0x5096d9);}else{var _0x2acf51={'method':_0xcbaf('0x94'),'uri':_0x26612b+'sys_choice?sysparm_query=name=incident^element='+_0x5bc534,'auth':_0x29a35e,'json':!![]};return rp(_0x2acf51)[_0xcbaf('0x39')](function(_0x45debb){var _0x269d5e=[];if(_0x45debb[_0xcbaf('0x96')][_0xcbaf('0x2f')]>0x0){_0x45debb[_0xcbaf('0x96')][_0xcbaf('0x9b')](function(_0x40fc6e){if(_0x40fc6e[_0xcbaf('0xa9')]==='false'){var _0x48da96={'name':_0x40fc6e['label'],'value':_0x40fc6e[_0xcbaf('0xaa')]};_0x269d5e[_0xcbaf('0x9e')](_0x48da96);}});}_0x5096d9[_0xcbaf('0x38')]=_0x269d5e;if(_0x5096d9[_0xcbaf('0x38')][_0xcbaf('0x2f')]>0x0){_0x5d63ff(_0x5096d9);}else{if(_0x5d4057==![]){_0x5d63ff();}else{_0x5d63ff(_0x5096d9);}}});}});}
\ No newline at end of file