Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index 98b87a3..c448e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ca=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','business_service','sys_domain_path','rfc','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','destroy','then','send','index','map','ServicenowAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection'];(function(_0x17574d,_0x3b86af){var _0x41ae10=function(_0x456ec5){while(--_0x456ec5){_0x17574d['push'](_0x17574d['shift']());}};_0x41ae10(++_0x3b86af);}(_0xc8ca,0x14b));var _0xac8c=function(_0x257e8f,_0xdc7fc9){_0x257e8f=_0x257e8f-0x0;var _0x2d8b1e=_0xc8ca[_0x257e8f];return _0x2d8b1e;};'use strict';var pdf=require(_0xac8c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xac8c('0x1'));var zipdir=require(_0xac8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac8c('0x3'));var moment=require(_0xac8c('0x4'));var BPromise=require(_0xac8c('0x5'));var Mustache=require(_0xac8c('0x6'));var util=require(_0xac8c('0x7'));var path=require(_0xac8c('0x8'));var sox=require(_0xac8c('0x9'));var csv=require(_0xac8c('0xa'));var ejs=require(_0xac8c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xac8c('0xc'));var crypto=require(_0xac8c('0xd'));var jsforce=require(_0xac8c('0xe'));var deskjs=require(_0xac8c('0xf'));var toCsv=require(_0xac8c('0xa'));var querystring=require('querystring');var Papa=require(_0xac8c('0x10'));var Redis=require(_0xac8c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xac8c('0x12'));var as=require(_0xac8c('0x13'));var hardwareService=require(_0xac8c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xac8c('0x15'));var config=require(_0xac8c('0x16'));var licenseUtil=require(_0xac8c('0x17'));var db=require(_0xac8c('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xac8c('0x19'));var client=jayson[_0xac8c('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2f52,_0x491655,_0x4a3d99,_0x5dd597){return new BPromise(function(_0x390aac,_0xa9ff5a){var _0x4c87d0=_0x5dd597||client;return _0x4c87d0[_0xac8c('0x1b')](_0x4e2f52,_0x4a3d99)['then'](function(_0xdce0ae){logger[_0xac8c('0x1c')](_0xac8c('0x1d'),_0x491655,'request\x20sent');logger[_0xac8c('0x1e')](_0xac8c('0x1f'),_0x491655,_0xac8c('0x20'),JSON[_0xac8c('0x21')](_0xdce0ae));if(_0xdce0ae[_0xac8c('0x22')]){if(_0xdce0ae['error'][_0xac8c('0x23')]===0x1f4){logger[_0xac8c('0x22')](_0xac8c('0x1d'),_0x491655,_0xdce0ae[_0xac8c('0x22')][_0xac8c('0x24')]);return _0xa9ff5a(_0xdce0ae[_0xac8c('0x22')][_0xac8c('0x24')]);}logger[_0xac8c('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x491655,_0xdce0ae[_0xac8c('0x22')]['message']);return _0x390aac(_0xdce0ae['error'][_0xac8c('0x24')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x491655,_0xac8c('0x20'));_0x390aac(_0xdce0ae[_0xac8c('0x25')][_0xac8c('0x24')]);}})['catch'](function(_0x15ec33){logger[_0xac8c('0x22')](_0xac8c('0x1d'),_0x491655,_0x15ec33);_0xa9ff5a(_0x15ec33);});});}function respondWithStatusCode(_0xfddb2e,_0x7916cc){_0x7916cc=_0x7916cc||0xcc;return function(_0x2de56c){if(_0x2de56c){return _0xfddb2e[_0xac8c('0x26')](_0x7916cc);}return _0xfddb2e[_0xac8c('0x27')](_0x7916cc)[_0xac8c('0x28')]();};}function respondWithResult(_0x569f36,_0x17e18d){_0x17e18d=_0x17e18d||0xc8;return function(_0x1c9155){if(_0x1c9155){return _0x569f36[_0xac8c('0x27')](_0x17e18d)[_0xac8c('0x29')](_0x1c9155);}};}function respondWithFilteredResult(_0x3b5a86,_0x4d5a1a){return function(_0x309dd5){if(_0x309dd5){var _0x4ddb8b=_0x309dd5['count'],_0x4374a6=_0x4d5a1a[_0xac8c('0x2a')],_0x493cd4=_0x4d5a1a[_0xac8c('0x2a')]+_0x4d5a1a[_0xac8c('0x2b')],_0xc5984;if(_0x493cd4>=_0x4ddb8b){_0x493cd4=_0x4ddb8b;_0xc5984=0xc8;}else{_0xc5984=0xce;}_0x3b5a86['status'](_0xc5984);return _0x3b5a86[_0xac8c('0x2c')](_0xac8c('0x2d'),_0x4374a6+'-'+_0x493cd4+'/'+_0x4ddb8b)[_0xac8c('0x29')](_0x309dd5);}return null;};}function patchUpdates(_0x4ad9dd){return function(_0xb53c77){try{jsonpatch['apply'](_0xb53c77,_0x4ad9dd,!![]);}catch(_0x371e7f){return BPromise['reject'](_0x371e7f);}return _0xb53c77[_0xac8c('0x2e')]();};}function saveUpdates(_0x42d806,_0x2803b4){return function(_0x2865fd){if(_0x2865fd){return _0x2865fd[_0xac8c('0x2f')](_0x42d806)['then'](function(_0x27996b){return _0x27996b;});}return null;};}function removeEntity(_0x340f01,_0x1dc9b2){return function(_0x131843){if(_0x131843){return _0x131843[_0xac8c('0x30')]()[_0xac8c('0x31')](function(){_0x340f01[_0xac8c('0x27')](0xcc)[_0xac8c('0x28')]();});}};}function handleEntityNotFound(_0xe4c126,_0x57e3c7){return function(_0x498482){if(!_0x498482){_0xe4c126['sendStatus'](0x194);}return _0x498482;};}function handleError(_0x4ed314,_0x25428d){_0x25428d=_0x25428d||0x1f4;return function(_0x2cd9ec){logger[_0xac8c('0x22')](_0x2cd9ec['stack']);if(_0x2cd9ec['name']){delete _0x2cd9ec['name'];}_0x4ed314[_0xac8c('0x27')](_0x25428d)[_0xac8c('0x32')](_0x2cd9ec);};}exports[_0xac8c('0x33')]=function(_0x3ac40c,_0x536369){var _0x5419b2={},_0x4d4194={},_0x246d37={'count':0x0,'rows':[]};var _0x1301e4=_[_0xac8c('0x34')](db[_0xac8c('0x35')][_0xac8c('0x36')],function(_0x4b6eb9){return{'name':_0x4b6eb9['fieldName'],'type':_0x4b6eb9[_0xac8c('0x37')][_0xac8c('0x38')]};});_0x4d4194[_0xac8c('0x39')]=_[_0xac8c('0x34')](_0x1301e4,_0xac8c('0x3a'));_0x4d4194[_0xac8c('0x3b')]=_[_0xac8c('0x3c')](_0x3ac40c[_0xac8c('0x3b')]);_0x4d4194[_0xac8c('0x3d')]=_[_0xac8c('0x3e')](_0x4d4194[_0xac8c('0x39')],_0x4d4194[_0xac8c('0x3b')]);_0x5419b2[_0xac8c('0x3f')]=_[_0xac8c('0x3e')](_0x4d4194[_0xac8c('0x39')],qs[_0xac8c('0x40')](_0x3ac40c[_0xac8c('0x3b')][_0xac8c('0x40')]));_0x5419b2['attributes']=_0x5419b2[_0xac8c('0x3f')][_0xac8c('0x41')]?_0x5419b2[_0xac8c('0x3f')]:_0x4d4194[_0xac8c('0x39')];if(!_0x3ac40c['query'][_0xac8c('0x42')]('nolimit')){_0x5419b2[_0xac8c('0x2b')]=qs['limit'](_0x3ac40c[_0xac8c('0x3b')][_0xac8c('0x2b')]);_0x5419b2[_0xac8c('0x2a')]=qs['offset'](_0x3ac40c[_0xac8c('0x3b')]['offset']);}_0x5419b2[_0xac8c('0x43')]=qs['sort'](_0x3ac40c[_0xac8c('0x3b')][_0xac8c('0x44')]);_0x5419b2[_0xac8c('0x45')]=qs[_0xac8c('0x3d')](_[_0xac8c('0x46')](_0x3ac40c[_0xac8c('0x3b')],_0x4d4194[_0xac8c('0x3d')]),_0x1301e4);if(_0x3ac40c['query'][_0xac8c('0x47')]){_0x5419b2['where']=_[_0xac8c('0x48')](_0x5419b2[_0xac8c('0x45')],{'$or':_['map'](_0x1301e4,function(_0x195d0b){if(_0x195d0b[_0xac8c('0x37')]!=='VIRTUAL'){var _0x268204={};_0x268204[_0x195d0b['name']]={'$like':'%'+_0x3ac40c['query']['filter']+'%'};return _0x268204;}})});}_0x5419b2=_[_0xac8c('0x48')]({},_0x5419b2,_0x3ac40c[_0xac8c('0x49')]);var _0x5b467c={'where':_0x5419b2[_0xac8c('0x45')]};return db[_0xac8c('0x35')][_0xac8c('0x4a')](_0x5b467c)[_0xac8c('0x31')](function(_0x139255){_0x246d37[_0xac8c('0x4a')]=_0x139255;if(_0x3ac40c[_0xac8c('0x3b')][_0xac8c('0x4b')]){_0x5419b2[_0xac8c('0x4c')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xac8c('0x4d')](_0x5419b2);})[_0xac8c('0x31')](function(_0x1ad520){_0x246d37[_0xac8c('0x4e')]=_0x1ad520;return _0x246d37;})[_0xac8c('0x31')](respondWithFilteredResult(_0x536369,_0x5419b2))[_0xac8c('0x4f')](handleError(_0x536369,null));};exports[_0xac8c('0x50')]=function(_0x23eed0,_0x128de1){var _0x5a167f={'raw':![],'where':{'id':_0x23eed0[_0xac8c('0x51')]['id']}},_0x2178cf={};_0x2178cf['model']=_['keys'](db['ServicenowAccount'][_0xac8c('0x36')]);_0x2178cf[_0xac8c('0x3b')]=_[_0xac8c('0x3c')](_0x23eed0[_0xac8c('0x3b')]);_0x2178cf[_0xac8c('0x3d')]=_[_0xac8c('0x3e')](_0x2178cf[_0xac8c('0x39')],_0x2178cf[_0xac8c('0x3b')]);_0x5a167f['attributes']=_[_0xac8c('0x3e')](_0x2178cf[_0xac8c('0x39')],qs['fields'](_0x23eed0[_0xac8c('0x3b')][_0xac8c('0x40')]));_0x5a167f['attributes']=_0x5a167f[_0xac8c('0x3f')]['length']?_0x5a167f[_0xac8c('0x3f')]:_0x2178cf['model'];if(_0x23eed0['query'][_0xac8c('0x4b')]){_0x5a167f['include']=[{'all':!![]}];}_0x5a167f=_[_0xac8c('0x48')]({},_0x5a167f,_0x23eed0[_0xac8c('0x49')]);return db[_0xac8c('0x35')][_0xac8c('0x52')](_0x5a167f)[_0xac8c('0x31')](handleEntityNotFound(_0x128de1,null))[_0xac8c('0x31')](respondWithResult(_0x128de1,null))[_0xac8c('0x4f')](handleError(_0x128de1,null));};exports['create']=function(_0x348622,_0x3c5fbe){return db[_0xac8c('0x35')][_0xac8c('0x53')](_0x348622[_0xac8c('0x54')],{})['then'](respondWithResult(_0x3c5fbe,0xc9))['catch'](handleError(_0x3c5fbe,null));};exports[_0xac8c('0x2f')]=function(_0x5ebb75,_0x767918){if(_0x5ebb75[_0xac8c('0x54')]['id']){delete _0x5ebb75['body']['id'];}return db[_0xac8c('0x35')][_0xac8c('0x52')]({'where':{'id':_0x5ebb75['params']['id']}})[_0xac8c('0x31')](handleEntityNotFound(_0x767918,null))[_0xac8c('0x31')](saveUpdates(_0x5ebb75[_0xac8c('0x54')],null))[_0xac8c('0x31')](respondWithResult(_0x767918,null))[_0xac8c('0x4f')](handleError(_0x767918,null));};exports[_0xac8c('0x30')]=function(_0x2ca6ac,_0x443ad5){return db[_0xac8c('0x35')][_0xac8c('0x52')]({'where':{'id':_0x2ca6ac[_0xac8c('0x51')]['id']}})[_0xac8c('0x31')](handleEntityNotFound(_0x443ad5,null))[_0xac8c('0x31')](removeEntity(_0x443ad5,null))[_0xac8c('0x4f')](handleError(_0x443ad5,null));};exports[_0xac8c('0x55')]=function(_0x128573,_0x12b827,_0x43ae6f){var _0x5f178d={};var _0x435793={};var _0x103128;var _0xe04711;return db[_0xac8c('0x35')][_0xac8c('0x56')]({'where':{'id':_0x128573[_0xac8c('0x51')]['id']}})[_0xac8c('0x31')](handleEntityNotFound(_0x12b827,null))[_0xac8c('0x31')](function(_0x4966c3){if(_0x4966c3){_0x103128=_0x4966c3;_0x435793[_0xac8c('0x39')]=_[_0xac8c('0x3c')](db[_0xac8c('0x57')][_0xac8c('0x36')]);_0x435793[_0xac8c('0x3b')]=_[_0xac8c('0x3c')](_0x128573[_0xac8c('0x3b')]);_0x435793['filters']=_['intersection'](_0x435793[_0xac8c('0x39')],_0x435793[_0xac8c('0x3b')]);_0x5f178d[_0xac8c('0x3f')]=_[_0xac8c('0x3e')](_0x435793[_0xac8c('0x39')],qs[_0xac8c('0x40')](_0x128573[_0xac8c('0x3b')][_0xac8c('0x40')]));_0x5f178d[_0xac8c('0x3f')]=_0x5f178d['attributes'][_0xac8c('0x41')]?_0x5f178d[_0xac8c('0x3f')]:_0x435793[_0xac8c('0x39')];_0x5f178d[_0xac8c('0x43')]=qs[_0xac8c('0x44')](_0x128573[_0xac8c('0x3b')][_0xac8c('0x44')]);_0x5f178d[_0xac8c('0x45')]=qs[_0xac8c('0x3d')](_['pick'](_0x128573[_0xac8c('0x3b')],_0x435793[_0xac8c('0x3d')]));if(_0x128573[_0xac8c('0x3b')]['filter']){_0x5f178d[_0xac8c('0x45')]=_[_0xac8c('0x48')](_0x5f178d[_0xac8c('0x45')],{'$or':_['map'](_0x5f178d[_0xac8c('0x3f')],function(_0x1bd54c){var _0x114778={};_0x114778[_0x1bd54c]={'$like':'%'+_0x128573[_0xac8c('0x3b')][_0xac8c('0x47')]+'%'};return _0x114778;})});}_0x5f178d=_['merge']({},_0x5f178d,_0x128573[_0xac8c('0x49')]);return _0x103128['getConfigurations'](_0x5f178d);}})[_0xac8c('0x31')](function(_0x566e17){if(_0x566e17){_0xe04711=_0x566e17['length'];if(!_0x128573['query']['hasOwnProperty'](_0xac8c('0x58'))){_0x5f178d[_0xac8c('0x2b')]=qs[_0xac8c('0x2b')](_0x128573[_0xac8c('0x3b')][_0xac8c('0x2b')]);_0x5f178d[_0xac8c('0x2a')]=qs[_0xac8c('0x2a')](_0x128573[_0xac8c('0x3b')][_0xac8c('0x2a')]);}return _0x103128[_0xac8c('0x55')](_0x5f178d);}})['then'](function(_0x51071a){if(_0x51071a){return _0x51071a?{'count':_0xe04711,'rows':_0x51071a}:null;}})['then'](respondWithResult(_0x12b827,null))[_0xac8c('0x4f')](handleError(_0x12b827,null));};exports[_0xac8c('0x59')]=function(_0x462434,_0x3ce76c,_0x1944b7){if(_0x462434[_0xac8c('0x54')]['id']){delete _0x462434[_0xac8c('0x54')]['id'];}return db[_0xac8c('0x35')]['findOne']({'where':{'id':_0x462434[_0xac8c('0x51')]['id']}})[_0xac8c('0x31')](handleEntityNotFound(_0x3ce76c,null))[_0xac8c('0x31')](function(_0x539cac){if(_0x539cac){_0x462434['body'][_0xac8c('0x5a')]=_0x539cac['id'];_0x462434[_0xac8c('0x54')][_0xac8c('0x5b')]=integrations[_0xac8c('0x5c')](_0x462434[_0xac8c('0x54')][_0xac8c('0x5d')],_0x462434[_0xac8c('0x54')][_0xac8c('0x37')]);_0x462434[_0xac8c('0x54')][_0xac8c('0x5e')]=integrations['getDescriptions'](_0x462434['body']['channel'],_0x462434['body'][_0xac8c('0x37')]);return db[_0xac8c('0x57')]['create'](_0x462434['body'],{'include':[{'model':db['ServicenowField'],'as':_0xac8c('0x5b')},{'model':db[_0xac8c('0x5f')],'as':_0xac8c('0x5e')}]});}return null;})[_0xac8c('0x31')](respondWithResult(_0x3ce76c,null))[_0xac8c('0x4f')](handleError(_0x3ce76c,null));};exports[_0xac8c('0x60')]=function(_0x3f5c8e,_0x569c1a,_0x415c8a){var _0x548358=[_0xac8c('0x61'),_0xac8c('0x62'),_0xac8c('0x63'),'subcategory','close_code',_0xac8c('0x64'),'incident_state','severity','category'];var _0x999ca0=[_0xac8c('0x65'),_0xac8c('0x61'),_0xac8c('0x66'),_0xac8c('0x67'),'upon_reject',_0xac8c('0x68'),_0xac8c('0x69'),_0xac8c('0x62'),_0xac8c('0x6a'),_0xac8c('0x6b'),'resolved_by',_0xac8c('0x6c'),_0xac8c('0x6d'),_0xac8c('0x6e'),_0xac8c('0x6f'),_0xac8c('0x70'),_0xac8c('0x71'),_0xac8c('0x72'),'knowledge',_0xac8c('0x43'),_0xac8c('0x73'),_0xac8c('0x74'),_0xac8c('0x75'),_0xac8c('0x76'),'impact',_0xac8c('0x77'),'work_notes_list',_0xac8c('0x78'),'priority',_0xac8c('0x79'),_0xac8c('0x7a'),'time_worked',_0xac8c('0x7b'),_0xac8c('0x7c'),'business_duration',_0xac8c('0x7d'),_0xac8c('0x7e'),_0xac8c('0x7f'),_0xac8c('0x80'),_0xac8c('0x81'),_0xac8c('0x82'),'subcategory',_0xac8c('0x83'),_0xac8c('0x84'),'close_code',_0xac8c('0x85'),_0xac8c('0x86'),'work_start',_0xac8c('0x87'),_0xac8c('0x88'),'additional_assignee_list',_0xac8c('0x89'),'calendar_duration','notify',_0xac8c('0x8a'),_0xac8c('0x8b'),_0xac8c('0x8c'),_0xac8c('0x8d'),'parent_incident',_0xac8c('0x8e'),_0xac8c('0x8f'),'reopened_by','incident_state','urgency',_0xac8c('0x90'),_0xac8c('0x91'),_0xac8c('0x92'),_0xac8c('0x93'),_0xac8c('0x94'),_0xac8c('0x95'),_0xac8c('0x96'),_0xac8c('0x97'),_0xac8c('0x98'),_0xac8c('0x99'),'due_date',_0xac8c('0x9a'),_0xac8c('0x9b'),_0xac8c('0x9c'),_0xac8c('0x9d'),_0xac8c('0x9e'),_0xac8c('0x9f'),_0xac8c('0xa0'),_0xac8c('0xa1')];var _0x52053c='';var _0x4638ab='';var _0x188926=[];var _0x3a5683='';var _0x24c0d3='';var _0x53353c=[];var _0x3d1ad9='';var _0x392bcd='';var _0x145985={};var _0x5d927a='';return db['ServicenowAccount'][_0xac8c('0x56')]({'where':{'id':_0x3f5c8e[_0xac8c('0x51')]['id']},'attributes':['id',_0xac8c('0xa2'),_0xac8c('0xa3'),_0xac8c('0xa4'),_0xac8c('0xa5'),_0xac8c('0xa6')]})[_0xac8c('0x31')](handleEntityNotFound(_0x569c1a,null))[_0xac8c('0x31')](function(_0x5d819f){if(_0x5d819f){_0x5d927a=_0x5d819f[_0xac8c('0xa5')];var _0x312083=_0x5d927a[_0xac8c('0xa7')](-0x1);if(_0x312083==='/'){_0x5d927a=_0x5d927a[_0xac8c('0xa8')](0x0,_0x5d927a[_0xac8c('0xa9')](_0x312083));}_0x392bcd=util['format'](_0xac8c('0xaa'),_0x5d927a);_0x3d1ad9=util['format']('%s/api/now/table/',_0x5d927a);_0x145985={'user':_0x5d819f[_0xac8c('0xa2')],'pass':_0x5d819f[_0xac8c('0xa3')]};var _0x19e30c={'method':'GET','uri':_0x392bcd+_0xac8c('0xab'),'auth':_0x145985,'json':!![]};return rp(_0x19e30c);}})[_0xac8c('0x31')](function(_0x586380){if(_0x586380['result'][_0xac8c('0x41')]>0x0){_0x52053c=_0x586380[_0xac8c('0x25')];}console[_0xac8c('0xac')](_0xac8c('0xad'),_0x52053c);_0x53353c=[];_0x4638ab=Object[_0xac8c('0xae')]([],_0x52053c);_[_0xac8c('0xaf')](_0x4638ab,function(_0x2c1468){return!_0x548358[_0xac8c('0xb0')](_0x2c1468[_0xac8c('0x3a')]);});_0x4638ab[_0xac8c('0xb1')](function(_0x57e4fd){var _0x1d3595=createFieldObject(_0x3d1ad9,_0x145985,_0x57e4fd[_0xac8c('0xb2')],_0x57e4fd['name'],_0x57e4fd[_0xac8c('0xb3')],![]);_0x53353c[_0xac8c('0xb4')](_0x1d3595);});return Promise[_0xac8c('0xb5')](_0x53353c);})[_0xac8c('0x31')](function(_0x4a2e32){_0x188926=_0x4a2e32;_0x3a5683=Object[_0xac8c('0xae')]([],_0x52053c);console['log'](_0xac8c('0xb6'),_0x52053c);_[_0xac8c('0xaf')](_0x3a5683,function(_0x397c30){return _0x999ca0[_0xac8c('0xb0')](_0x397c30['name']);});console[_0xac8c('0xac')](_0xac8c('0xb7'),_0x3a5683);_0x53353c=[];_0x3a5683[_0xac8c('0xb1')](function(_0x3be6fe){var _0x3c4cfc=createFieldObject(_0x3d1ad9,_0x145985,_0x3be6fe[_0xac8c('0xb2')],_0x3be6fe[_0xac8c('0x3a')],_0x3be6fe[_0xac8c('0xb3')],!![]);_0x53353c[_0xac8c('0xb4')](_0x3c4cfc);});return Promise['all'](_0x53353c);})[_0xac8c('0x31')](function(_0x2bfa3c){_0x24c0d3=_0x2bfa3c;var _0x61dde=_0x188926[_0xac8c('0xb8')](_0x24c0d3);return{'count':_0x61dde[_0xac8c('0x41')],'rows':_0x61dde};})[_0xac8c('0x31')](respondWithResult(_0x569c1a,null))['catch'](function(_0x4497c9){console['log'](_0xac8c('0xb9')+_0x4497c9);var _0x307ed8=_0x3f5c8e[_0xac8c('0x3b')][_0xac8c('0xba')]?0x1f4:_0x4497c9['statusCode']||0x1f4;logger[_0xac8c('0x22')](_0x4497c9[_0xac8c('0xbb')]);delete _0x4497c9[_0xac8c('0x3a')];if(_0x307ed8===0x191){_0x307ed8=0x190;}_0x569c1a[_0xac8c('0x27')](_0x307ed8)[_0xac8c('0x32')](_0x3f5c8e[_0xac8c('0x3b')]['test']?{'message':_0xac8c('0xbc'),'statusCode':_0x4497c9['statusCode']}:_0x4497c9);});};function createFieldObject(_0x4969d6,_0x201f89,_0x3e54ab,_0x1578c7,_0xafecf3,_0x3aae4a){return new Promise(function(_0x58a132,_0x569394){var _0x379173={'id':_0x1578c7,'name':_0xafecf3,'custom':_0x3aae4a};if(_0x3e54ab==='boolean'){_0x379173[_0xac8c('0x49')]=[{'name':_0xac8c('0xbd'),'value':_0xac8c('0xbe')},{'name':_0xac8c('0xbf'),'value':_0xac8c('0xc0')}];_0x58a132(_0x379173);}else{var _0x47a7ca={'method':_0xac8c('0xc1'),'uri':_0x4969d6+_0xac8c('0xc2')+_0x1578c7,'auth':_0x201f89,'json':!![]};return rp(_0x47a7ca)[_0xac8c('0x31')](function(_0x1f57d0){var _0x35ffc1=[];if(_0x1f57d0[_0xac8c('0x25')][_0xac8c('0x41')]>0x0){_0x1f57d0[_0xac8c('0x25')][_0xac8c('0xb1')](function(_0x557bfe){if(_0x557bfe[_0xac8c('0xc3')]===_0xac8c('0xc0')){var _0x3c5d02={'name':_0x557bfe[_0xac8c('0xb3')],'value':_0x557bfe[_0xac8c('0xc4')]};_0x35ffc1['push'](_0x3c5d02);}});}_0x379173[_0xac8c('0x49')]=_0x35ffc1;if(_0x379173[_0xac8c('0x49')][_0xac8c('0x41')]>0x0){_0x58a132(_0x379173);}else{if(_0x3aae4a==![]){_0x58a132();}else{_0x58a132(_0x379173);}}});}});}
\ No newline at end of file
+var _0xf8c7=['problem_id','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','location','username','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','password','result','log','assign','remove','includes','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','create','body','update','find','params','destroy','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','ServicenowConfiguration','Descriptions','getFields','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','made_sla','watch_list','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','reopened_by','urgency'];(function(_0x2ef16e,_0x5b1018){var _0x5787b9=function(_0xdfe85e){while(--_0xdfe85e){_0x2ef16e['push'](_0x2ef16e['shift']());}};_0x5787b9(++_0x5b1018);}(_0xf8c7,0x19e));var _0x7f8c=function(_0x3256ca,_0x49677d){_0x3256ca=_0x3256ca-0x0;var _0x323732=_0xf8c7[_0x3256ca];return _0x323732;};'use strict';var emlformat=require(_0x7f8c('0x0'));var rimraf=require(_0x7f8c('0x1'));var zipdir=require(_0x7f8c('0x2'));var jsonpatch=require(_0x7f8c('0x3'));var rp=require(_0x7f8c('0x4'));var moment=require(_0x7f8c('0x5'));var BPromise=require(_0x7f8c('0x6'));var Mustache=require(_0x7f8c('0x7'));var util=require(_0x7f8c('0x8'));var path=require(_0x7f8c('0x9'));var sox=require('sox');var csv=require(_0x7f8c('0xa'));var ejs=require(_0x7f8c('0xb'));var fs=require('fs');var fs_extra=require(_0x7f8c('0xc'));var _=require('lodash');var squel=require(_0x7f8c('0xd'));var crypto=require(_0x7f8c('0xe'));var jsforce=require(_0x7f8c('0xf'));var deskjs=require(_0x7f8c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f8c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7f8c('0x12'));var qs=require(_0x7f8c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f8c('0x14'))(_0x7f8c('0x15'));var utils=require(_0x7f8c('0x16'));var config=require(_0x7f8c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f8c('0x18'))['db'];var integrations=require(_0x7f8c('0x19'));function respondWithStatusCode(_0x152400,_0x2d5545){_0x2d5545=_0x2d5545||0xcc;return function(_0x3acf3c){if(_0x3acf3c){return _0x152400[_0x7f8c('0x1a')](_0x2d5545);}return _0x152400['status'](_0x2d5545)['end']();};}function respondWithResult(_0x46d976,_0x51995c){_0x51995c=_0x51995c||0xc8;return function(_0x44306a){if(_0x44306a){return _0x46d976[_0x7f8c('0x1b')](_0x51995c)[_0x7f8c('0x1c')](_0x44306a);}};}function respondWithFilteredResult(_0x1c1fff,_0x391b32){return function(_0x5350d1){if(_0x5350d1){var _0x544d88=typeof _0x391b32[_0x7f8c('0x1d')]==='undefined'&&typeof _0x391b32[_0x7f8c('0x1e')]===_0x7f8c('0x1f');var _0x2d4e50=_0x5350d1[_0x7f8c('0x20')];var _0xa33e78=_0x544d88?0x0:_0x391b32[_0x7f8c('0x1d')];var _0x3b7150=_0x544d88?_0x5350d1[_0x7f8c('0x20')]:_0x391b32['offset']+_0x391b32[_0x7f8c('0x1e')];var _0x5c0f11;if(_0x3b7150>=_0x2d4e50){_0x3b7150=_0x2d4e50;_0x5c0f11=0xc8;}else{_0x5c0f11=0xce;}_0x1c1fff['status'](_0x5c0f11);return _0x1c1fff[_0x7f8c('0x21')](_0x7f8c('0x22'),_0xa33e78+'-'+_0x3b7150+'/'+_0x2d4e50)[_0x7f8c('0x1c')](_0x5350d1);}return null;};}function patchUpdates(_0x18ac75){return function(_0x466a03){try{jsonpatch[_0x7f8c('0x23')](_0x466a03,_0x18ac75,!![]);}catch(_0x5aabef){return BPromise[_0x7f8c('0x24')](_0x5aabef);}return _0x466a03[_0x7f8c('0x25')]();};}function saveUpdates(_0x46baae,_0x3402ba){return function(_0x3717b2){if(_0x3717b2){return _0x3717b2['update'](_0x46baae)[_0x7f8c('0x26')](function(_0x5344e9){return _0x5344e9;});}return null;};}function removeEntity(_0x2e3514,_0x31d4a3){return function(_0x2eee59){if(_0x2eee59){return _0x2eee59['destroy']()[_0x7f8c('0x26')](function(){_0x2e3514[_0x7f8c('0x1b')](0xcc)[_0x7f8c('0x27')]();});}};}function handleEntityNotFound(_0x2e365e,_0x47b0c4){return function(_0x512418){if(!_0x512418){_0x2e365e[_0x7f8c('0x1a')](0x194);}return _0x512418;};}function handleError(_0x53bd4f,_0x243ed8){_0x243ed8=_0x243ed8||0x1f4;return function(_0x4ff59f){logger['error'](_0x4ff59f[_0x7f8c('0x28')]);if(_0x4ff59f[_0x7f8c('0x29')]){delete _0x4ff59f[_0x7f8c('0x29')];}_0x53bd4f[_0x7f8c('0x1b')](_0x243ed8)[_0x7f8c('0x2a')](_0x4ff59f);};}exports[_0x7f8c('0x2b')]=function(_0x3c5db9,_0x584918){var _0xb528d={},_0x200746={},_0x5010d1={'count':0x0,'rows':[]};var _0x588ce1=_[_0x7f8c('0x2c')](db[_0x7f8c('0x2d')][_0x7f8c('0x2e')],function(_0x38797a){return{'name':_0x38797a[_0x7f8c('0x2f')],'type':_0x38797a[_0x7f8c('0x30')][_0x7f8c('0x31')]};});_0x200746[_0x7f8c('0x32')]=_[_0x7f8c('0x2c')](_0x588ce1,_0x7f8c('0x29'));_0x200746['query']=_[_0x7f8c('0x33')](_0x3c5db9[_0x7f8c('0x34')]);_0x200746[_0x7f8c('0x35')]=_[_0x7f8c('0x36')](_0x200746[_0x7f8c('0x32')],_0x200746[_0x7f8c('0x34')]);_0xb528d['attributes']=_[_0x7f8c('0x36')](_0x200746[_0x7f8c('0x32')],qs['fields'](_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x37')]));_0xb528d[_0x7f8c('0x38')]=_0xb528d['attributes'][_0x7f8c('0x39')]?_0xb528d[_0x7f8c('0x38')]:_0x200746[_0x7f8c('0x32')];if(!_0x3c5db9[_0x7f8c('0x34')]['hasOwnProperty'](_0x7f8c('0x3a'))){_0xb528d['limit']=qs[_0x7f8c('0x1e')](_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x1e')]);_0xb528d[_0x7f8c('0x1d')]=qs['offset'](_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x1d')]);}_0xb528d[_0x7f8c('0x3b')]=qs[_0x7f8c('0x3c')](_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x3c')]);_0xb528d[_0x7f8c('0x3d')]=qs['filters'](_[_0x7f8c('0x3e')](_0x3c5db9['query'],_0x200746[_0x7f8c('0x35')]),_0x588ce1);if(_0x3c5db9['query'][_0x7f8c('0x3f')]){_0xb528d[_0x7f8c('0x3d')]=_['merge'](_0xb528d[_0x7f8c('0x3d')],{'$or':_[_0x7f8c('0x2c')](_0x588ce1,function(_0x169bc5){if(_0x169bc5['type']!==_0x7f8c('0x40')){var _0x350e1a={};_0x350e1a[_0x169bc5[_0x7f8c('0x29')]]={'$like':'%'+_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x3f')]+'%'};return _0x350e1a;}})});}_0xb528d=_[_0x7f8c('0x41')]({},_0xb528d,_0x3c5db9[_0x7f8c('0x42')]);var _0x31df41={'where':_0xb528d[_0x7f8c('0x3d')]};return db[_0x7f8c('0x2d')][_0x7f8c('0x20')](_0x31df41)[_0x7f8c('0x26')](function(_0x28c66){_0x5010d1[_0x7f8c('0x20')]=_0x28c66;if(_0x3c5db9[_0x7f8c('0x34')][_0x7f8c('0x43')]){_0xb528d['include']=[{'all':!![]}];}return db[_0x7f8c('0x2d')][_0x7f8c('0x44')](_0xb528d);})['then'](function(_0xf1159a){_0x5010d1[_0x7f8c('0x45')]=_0xf1159a;return _0x5010d1;})[_0x7f8c('0x26')](respondWithFilteredResult(_0x584918,_0xb528d))[_0x7f8c('0x46')](handleError(_0x584918,null));};exports[_0x7f8c('0x47')]=function(_0x48791d,_0x2427d8){var _0x43490d={'raw':![],'where':{'id':_0x48791d['params']['id']}},_0xfabc3f={};_0xfabc3f[_0x7f8c('0x32')]=_[_0x7f8c('0x33')](db[_0x7f8c('0x2d')]['rawAttributes']);_0xfabc3f['query']=_[_0x7f8c('0x33')](_0x48791d[_0x7f8c('0x34')]);_0xfabc3f['filters']=_[_0x7f8c('0x36')](_0xfabc3f[_0x7f8c('0x32')],_0xfabc3f['query']);_0x43490d['attributes']=_[_0x7f8c('0x36')](_0xfabc3f[_0x7f8c('0x32')],qs[_0x7f8c('0x37')](_0x48791d[_0x7f8c('0x34')]['fields']));_0x43490d['attributes']=_0x43490d['attributes'][_0x7f8c('0x39')]?_0x43490d[_0x7f8c('0x38')]:_0xfabc3f['model'];if(_0x48791d[_0x7f8c('0x34')][_0x7f8c('0x43')]){_0x43490d[_0x7f8c('0x48')]=[{'all':!![]}];}_0x43490d=_['merge']({},_0x43490d,_0x48791d['options']);return db[_0x7f8c('0x2d')]['find'](_0x43490d)[_0x7f8c('0x26')](handleEntityNotFound(_0x2427d8,null))[_0x7f8c('0x26')](respondWithResult(_0x2427d8,null))[_0x7f8c('0x46')](handleError(_0x2427d8,null));};exports[_0x7f8c('0x49')]=function(_0x1985ae,_0x3bd80f){return db[_0x7f8c('0x2d')][_0x7f8c('0x49')](_0x1985ae[_0x7f8c('0x4a')],{})['then'](respondWithResult(_0x3bd80f,0xc9))[_0x7f8c('0x46')](handleError(_0x3bd80f,null));};exports[_0x7f8c('0x4b')]=function(_0x1ea94a,_0x548923){if(_0x1ea94a[_0x7f8c('0x4a')]['id']){delete _0x1ea94a[_0x7f8c('0x4a')]['id'];}return db[_0x7f8c('0x2d')][_0x7f8c('0x4c')]({'where':{'id':_0x1ea94a[_0x7f8c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x548923,null))[_0x7f8c('0x26')](saveUpdates(_0x1ea94a[_0x7f8c('0x4a')],null))[_0x7f8c('0x26')](respondWithResult(_0x548923,null))[_0x7f8c('0x46')](handleError(_0x548923,null));};exports[_0x7f8c('0x4e')]=function(_0x2367d8,_0x3332ea){return db[_0x7f8c('0x2d')]['find']({'where':{'id':_0x2367d8[_0x7f8c('0x4d')]['id']}})[_0x7f8c('0x26')](handleEntityNotFound(_0x3332ea,null))[_0x7f8c('0x26')](removeEntity(_0x3332ea,null))[_0x7f8c('0x46')](handleError(_0x3332ea,null));};exports['getConfigurations']=function(_0x2b3dfa,_0x519768,_0x309b28){var _0x9d9a53={};var _0x542b7f={};var _0x3884d2;var _0x8c3a79;return db[_0x7f8c('0x2d')][_0x7f8c('0x4f')]({'where':{'id':_0x2b3dfa[_0x7f8c('0x4d')]['id']}})[_0x7f8c('0x26')](handleEntityNotFound(_0x519768,null))[_0x7f8c('0x26')](function(_0x142d1c){if(_0x142d1c){_0x3884d2=_0x142d1c;_0x542b7f[_0x7f8c('0x32')]=_[_0x7f8c('0x33')](db['ServicenowConfiguration'][_0x7f8c('0x2e')]);_0x542b7f['query']=_[_0x7f8c('0x33')](_0x2b3dfa[_0x7f8c('0x34')]);_0x542b7f[_0x7f8c('0x35')]=_['intersection'](_0x542b7f[_0x7f8c('0x32')],_0x542b7f[_0x7f8c('0x34')]);_0x9d9a53[_0x7f8c('0x38')]=_[_0x7f8c('0x36')](_0x542b7f['model'],qs[_0x7f8c('0x37')](_0x2b3dfa['query']['fields']));_0x9d9a53[_0x7f8c('0x38')]=_0x9d9a53[_0x7f8c('0x38')][_0x7f8c('0x39')]?_0x9d9a53[_0x7f8c('0x38')]:_0x542b7f[_0x7f8c('0x32')];_0x9d9a53[_0x7f8c('0x3b')]=qs['sort'](_0x2b3dfa['query'][_0x7f8c('0x3c')]);_0x9d9a53['where']=qs[_0x7f8c('0x35')](_[_0x7f8c('0x3e')](_0x2b3dfa['query'],_0x542b7f[_0x7f8c('0x35')]));if(_0x2b3dfa[_0x7f8c('0x34')]['filter']){_0x9d9a53[_0x7f8c('0x3d')]=_[_0x7f8c('0x41')](_0x9d9a53[_0x7f8c('0x3d')],{'$or':_[_0x7f8c('0x2c')](_0x9d9a53['attributes'],function(_0x44cdeb){var _0x1cb63d={};_0x1cb63d[_0x44cdeb]={'$like':'%'+_0x2b3dfa[_0x7f8c('0x34')][_0x7f8c('0x3f')]+'%'};return _0x1cb63d;})});}_0x9d9a53=_[_0x7f8c('0x41')]({},_0x9d9a53,_0x2b3dfa['options']);return _0x3884d2[_0x7f8c('0x50')](_0x9d9a53);}})['then'](function(_0x21bdd1){if(_0x21bdd1){_0x8c3a79=_0x21bdd1['length'];if(!_0x2b3dfa[_0x7f8c('0x34')][_0x7f8c('0x51')](_0x7f8c('0x3a'))){_0x9d9a53[_0x7f8c('0x1e')]=qs[_0x7f8c('0x1e')](_0x2b3dfa['query'][_0x7f8c('0x1e')]);_0x9d9a53[_0x7f8c('0x1d')]=qs[_0x7f8c('0x1d')](_0x2b3dfa[_0x7f8c('0x34')]['offset']);}return _0x3884d2[_0x7f8c('0x50')](_0x9d9a53);}})['then'](function(_0x4be3b6){if(_0x4be3b6){return _0x4be3b6?{'count':_0x8c3a79,'rows':_0x4be3b6}:null;}})[_0x7f8c('0x26')](respondWithResult(_0x519768,null))[_0x7f8c('0x46')](handleError(_0x519768,null));};exports[_0x7f8c('0x52')]=function(_0x16d700,_0x34f249,_0x551c47){if(_0x16d700[_0x7f8c('0x4a')]['id']){delete _0x16d700[_0x7f8c('0x4a')]['id'];}return db[_0x7f8c('0x2d')][_0x7f8c('0x4f')]({'where':{'id':_0x16d700[_0x7f8c('0x4d')]['id']}})[_0x7f8c('0x26')](handleEntityNotFound(_0x34f249,null))['then'](function(_0x4c0961){if(_0x4c0961){_0x16d700[_0x7f8c('0x4a')][_0x7f8c('0x53')]=_0x4c0961['id'];_0x16d700[_0x7f8c('0x4a')][_0x7f8c('0x54')]=integrations['getSubjects'](_0x16d700[_0x7f8c('0x4a')][_0x7f8c('0x55')],_0x16d700[_0x7f8c('0x4a')][_0x7f8c('0x30')]);_0x16d700[_0x7f8c('0x4a')]['Descriptions']=integrations[_0x7f8c('0x56')](_0x16d700['body'][_0x7f8c('0x55')],_0x16d700[_0x7f8c('0x4a')][_0x7f8c('0x30')]);return db[_0x7f8c('0x57')]['create'](_0x16d700[_0x7f8c('0x4a')],{'include':[{'model':db['ServicenowField'],'as':_0x7f8c('0x54')},{'model':db['ServicenowField'],'as':_0x7f8c('0x58')}]});}return null;})['then'](respondWithResult(_0x34f249,null))['catch'](handleError(_0x34f249,null));};exports[_0x7f8c('0x59')]=function(_0x26a0e5,_0x8059c1,_0xf9535){var _0x556b16=['made_sla',_0x7f8c('0x5a'),_0x7f8c('0x5b'),'subcategory',_0x7f8c('0x5c'),_0x7f8c('0x5d'),_0x7f8c('0x5e'),_0x7f8c('0x5f'),_0x7f8c('0x60')];var _0x103d63=[_0x7f8c('0x61'),_0x7f8c('0x62'),'caused_by',_0x7f8c('0x63'),_0x7f8c('0x64'),_0x7f8c('0x65'),'child_incidents',_0x7f8c('0x5a'),_0x7f8c('0x66'),_0x7f8c('0x67'),'resolved_by',_0x7f8c('0x68'),'opened_by',_0x7f8c('0x69'),_0x7f8c('0x6a'),_0x7f8c('0x6b'),_0x7f8c('0x6c'),_0x7f8c('0x6d'),_0x7f8c('0x5b'),'order','calendar_stc',_0x7f8c('0x6e'),_0x7f8c('0x6f'),_0x7f8c('0x70'),'impact',_0x7f8c('0x71'),_0x7f8c('0x72'),'business_service',_0x7f8c('0x73'),_0x7f8c('0x74'),_0x7f8c('0x75'),_0x7f8c('0x76'),_0x7f8c('0x77'),'opened_at','business_duration',_0x7f8c('0x78'),_0x7f8c('0x79'),_0x7f8c('0x7a'),_0x7f8c('0x7b'),_0x7f8c('0x7c'),_0x7f8c('0x7d'),'subcategory',_0x7f8c('0x7e'),_0x7f8c('0x7f'),_0x7f8c('0x5c'),_0x7f8c('0x80'),'delivery_task',_0x7f8c('0x81'),_0x7f8c('0x82'),_0x7f8c('0x83'),_0x7f8c('0x84'),'description',_0x7f8c('0x85'),_0x7f8c('0x5d'),_0x7f8c('0x86'),_0x7f8c('0x87'),_0x7f8c('0x88'),_0x7f8c('0x89'),'parent_incident',_0x7f8c('0x8a'),'contact_type',_0x7f8c('0x8b'),_0x7f8c('0x5e'),_0x7f8c('0x8c'),_0x7f8c('0x8d'),'company',_0x7f8c('0x8e'),_0x7f8c('0x8f'),'assigned_to',_0x7f8c('0x5f'),_0x7f8c('0x90'),_0x7f8c('0x91'),_0x7f8c('0x92'),_0x7f8c('0x93'),_0x7f8c('0x94'),_0x7f8c('0x95'),'reopen_count',_0x7f8c('0x96'),_0x7f8c('0x97'),'upon_approval','correlation_id',_0x7f8c('0x98'),_0x7f8c('0x60')];var _0x58afb8='';var _0x584ac8='';var _0x1b9b34=[];var _0x18a278='';var _0x3644c0='';var _0x2f52c1=[];var _0x1000f6='';var _0x4e4402='';var _0x26f3e6={};var _0x4d8b63='';return db[_0x7f8c('0x2d')][_0x7f8c('0x4f')]({'where':{'id':_0x26a0e5['params']['id']},'attributes':['id',_0x7f8c('0x99'),'password','email',_0x7f8c('0x9a'),'serverUrl']})[_0x7f8c('0x26')](handleEntityNotFound(_0x8059c1,null))['then'](function(_0x15b36a){if(_0x15b36a){_0x4d8b63=_0x15b36a[_0x7f8c('0x9a')];var _0x3d1935=_0x4d8b63[_0x7f8c('0x9b')](-0x1);if(_0x3d1935==='/'){_0x4d8b63=_0x4d8b63[_0x7f8c('0x9c')](0x0,_0x4d8b63['lastIndexOf'](_0x3d1935));}_0x4e4402=util[_0x7f8c('0x9d')](_0x7f8c('0x9e'),_0x4d8b63);_0x1000f6=util[_0x7f8c('0x9d')]('%s/api/now/table/',_0x4d8b63);_0x26f3e6={'user':_0x15b36a[_0x7f8c('0x99')],'pass':_0x15b36a[_0x7f8c('0x9f')]};var _0x37d3a0={'method':'GET','uri':_0x4e4402+'incident?sysparm_display_value=all','auth':_0x26f3e6,'json':!![]};return rp(_0x37d3a0);}})['then'](function(_0x41d9ec){if(_0x41d9ec['result'][_0x7f8c('0x39')]>0x0){_0x58afb8=_0x41d9ec[_0x7f8c('0xa0')];}console[_0x7f8c('0xa1')]('incident\x20table\x20objects',_0x58afb8);_0x2f52c1=[];_0x584ac8=Object[_0x7f8c('0xa2')]([],_0x58afb8);_[_0x7f8c('0xa3')](_0x584ac8,function(_0x3e2c6d){return!_0x556b16[_0x7f8c('0xa4')](_0x3e2c6d[_0x7f8c('0x29')]);});_0x584ac8['forEach'](function(_0x2af368){var _0x3ef84b=createFieldObject(_0x1000f6,_0x26f3e6,_0x2af368['internalType'],_0x2af368[_0x7f8c('0x29')],_0x2af368[_0x7f8c('0xa5')],![]);_0x2f52c1[_0x7f8c('0xa6')](_0x3ef84b);});return Promise[_0x7f8c('0xa7')](_0x2f52c1);})[_0x7f8c('0x26')](function(_0x284ea2){_0x1b9b34=_0x284ea2;_0x18a278=Object[_0x7f8c('0xa2')]([],_0x58afb8);console[_0x7f8c('0xa1')](_0x7f8c('0xa8'),_0x58afb8);_['remove'](_0x18a278,function(_0x25f15f){return _0x103d63[_0x7f8c('0xa4')](_0x25f15f[_0x7f8c('0x29')]);});console[_0x7f8c('0xa1')](_0x7f8c('0xa9'),_0x18a278);_0x2f52c1=[];_0x18a278[_0x7f8c('0xaa')](function(_0x274243){var _0x15a98e=createFieldObject(_0x1000f6,_0x26f3e6,_0x274243[_0x7f8c('0xab')],_0x274243[_0x7f8c('0x29')],_0x274243[_0x7f8c('0xa5')],!![]);_0x2f52c1[_0x7f8c('0xa6')](_0x15a98e);});return Promise[_0x7f8c('0xa7')](_0x2f52c1);})[_0x7f8c('0x26')](function(_0x51e0d4){_0x3644c0=_0x51e0d4;var _0x596553=_0x1b9b34[_0x7f8c('0xac')](_0x3644c0);return{'count':_0x596553['length'],'rows':_0x596553};})[_0x7f8c('0x26')](respondWithResult(_0x8059c1,null))['catch'](function(_0x189689){console['log'](_0x7f8c('0xad')+_0x189689);var _0x442ea0=_0x26a0e5['query'][_0x7f8c('0xae')]?0x1f4:_0x189689[_0x7f8c('0xaf')]||0x1f4;logger[_0x7f8c('0xb0')](_0x189689[_0x7f8c('0x28')]);delete _0x189689[_0x7f8c('0x29')];if(_0x442ea0===0x191){_0x442ea0=0x190;}_0x8059c1[_0x7f8c('0x1b')](_0x442ea0)['send'](_0x26a0e5[_0x7f8c('0x34')][_0x7f8c('0xae')]?{'message':_0x7f8c('0xb1'),'statusCode':_0x189689[_0x7f8c('0xaf')]}:_0x189689);});};function createFieldObject(_0x2ebc28,_0xb95faf,_0x42e645,_0x1b4245,_0x251ee6,_0x204853){return new Promise(function(_0x21f90c,_0x42e0db){var _0x2a2568={'id':_0x1b4245,'name':_0x251ee6,'custom':_0x204853};if(_0x42e645===_0x7f8c('0xb2')){_0x2a2568[_0x7f8c('0x42')]=[{'name':_0x7f8c('0xb3'),'value':_0x7f8c('0xb4')},{'name':_0x7f8c('0xb5'),'value':_0x7f8c('0xb6')}];_0x21f90c(_0x2a2568);}else{var _0x96c888={'method':'GET','uri':_0x2ebc28+'sys_choice?sysparm_query=name=incident^element='+_0x1b4245,'auth':_0xb95faf,'json':!![]};return rp(_0x96c888)[_0x7f8c('0x26')](function(_0x298a04){var _0x2e68ba=[];if(_0x298a04['result'][_0x7f8c('0x39')]>0x0){_0x298a04[_0x7f8c('0xa0')][_0x7f8c('0xaa')](function(_0x3acf14){if(_0x3acf14[_0x7f8c('0xb7')]===_0x7f8c('0xb6')){var _0x12dd5e={'name':_0x3acf14[_0x7f8c('0xa5')],'value':_0x3acf14[_0x7f8c('0xb8')]};_0x2e68ba[_0x7f8c('0xa6')](_0x12dd5e);}});}_0x2a2568['options']=_0x2e68ba;if(_0x2a2568[_0x7f8c('0x42')][_0x7f8c('0x39')]>0x0){_0x21f90c(_0x2a2568);}else{if(_0x204853==![]){_0x21f90c();}else{_0x21f90c(_0x2a2568);}}});}});}
\ No newline at end of file