Built motion from commit 616d3211.|2.6.4
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index f53db2f..2822eec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6f1=['status','Content-Range','apply','reject','save','destroy','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','show','include','merge','create','update','body','find','params','getConfigurations','findOne','ServicenowConfiguration','order','pick','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','short_description','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','reassignment_count','activity_due','severity','comments','sla_due','approval','due_date','sys_mod_count','escalation','upon_approval','correlation_id','username','email','serverUrl','slice','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','all','TCL:\x20_object','includes','push','concat','ServiceNow\x20error:\x20','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','json','count','offset','limit'];(function(_0x57f7c3,_0x4338cb){var _0x1b5c72=function(_0x28cede){while(--_0x28cede){_0x57f7c3['push'](_0x57f7c3['shift']());}};_0x1b5c72(++_0x4338cb);}(_0xb6f1,0x96));var _0x1b6f=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0xb6f1[_0x21c6b8];return _0x39d474;};'use strict';var pdf=require(_0x1b6f('0x0'));var emlformat=require(_0x1b6f('0x1'));var rimraf=require(_0x1b6f('0x2'));var zipdir=require(_0x1b6f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6f('0x4'));var moment=require(_0x1b6f('0x5'));var BPromise=require(_0x1b6f('0x6'));var Mustache=require(_0x1b6f('0x7'));var util=require(_0x1b6f('0x8'));var path=require(_0x1b6f('0x9'));var sox=require(_0x1b6f('0xa'));var csv=require(_0x1b6f('0xb'));var ejs=require(_0x1b6f('0xc'));var fs=require('fs');var _=require(_0x1b6f('0xd'));var squel=require(_0x1b6f('0xe'));var crypto=require(_0x1b6f('0xf'));var jsforce=require(_0x1b6f('0x10'));var deskjs=require(_0x1b6f('0x11'));var toCsv=require(_0x1b6f('0xb'));var querystring=require(_0x1b6f('0x12'));var Papa=require(_0x1b6f('0x13'));var Redis=require(_0x1b6f('0x14'));var authService=require(_0x1b6f('0x15'));var qs=require(_0x1b6f('0x16'));var as=require(_0x1b6f('0x17'));var hardwareService=require(_0x1b6f('0x18'));var logger=require(_0x1b6f('0x19'))(_0x1b6f('0x1a'));var utils=require(_0x1b6f('0x1b'));var config=require(_0x1b6f('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1b6f('0x1d'));var jayson=require(_0x1b6f('0x1e'));var client=jayson[_0x1b6f('0x1f')][_0x1b6f('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2d351e,_0x2fee21,_0x3ff8e0){if(_0x3ff8e0){var _0x12b1f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12b1f2[_0x1b6f('0x21')](_0x2fee21)){return _0x2d351e;}else{throw new db[(_0x1b6f('0x22'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x2d351e;}}function respondWithRpcPromise(_0x531ea0,_0x21f959,_0x2c5f28,_0x34e4ad){return new BPromise(function(_0x2f204b,_0x298df6){var _0x383734=_0x34e4ad||client;return _0x383734[_0x1b6f('0x23')](_0x531ea0,_0x2c5f28)[_0x1b6f('0x24')](function(_0x1e87e5){logger[_0x1b6f('0x25')](_0x1b6f('0x26'),_0x21f959,'request\x20sent');logger[_0x1b6f('0x27')](_0x1b6f('0x28'),_0x21f959,_0x1b6f('0x29'),JSON['stringify'](_0x1e87e5));if(_0x1e87e5[_0x1b6f('0x2a')]){if(_0x1e87e5[_0x1b6f('0x2a')][_0x1b6f('0x2b')]===0x1f4){logger['error'](_0x1b6f('0x26'),_0x21f959,_0x1e87e5['error']['message']);return _0x298df6(_0x1e87e5[_0x1b6f('0x2a')][_0x1b6f('0x2c')]);}logger[_0x1b6f('0x2a')](_0x1b6f('0x26'),_0x21f959,_0x1e87e5[_0x1b6f('0x2a')]['message']);return _0x2f204b(_0x1e87e5[_0x1b6f('0x2a')][_0x1b6f('0x2c')]);}else{logger[_0x1b6f('0x25')](_0x1b6f('0x26'),_0x21f959,'request\x20sent');_0x2f204b(_0x1e87e5[_0x1b6f('0x2d')][_0x1b6f('0x2c')]);}})[_0x1b6f('0x2e')](function(_0x2486b4){logger[_0x1b6f('0x2a')](_0x1b6f('0x26'),_0x21f959,_0x2486b4);_0x298df6(_0x2486b4);});});}function respondWithStatusCode(_0x598c2f,_0x2d62aa){_0x2d62aa=_0x2d62aa||0xcc;return function(_0xd1b950){if(_0xd1b950){return _0x598c2f[_0x1b6f('0x2f')](_0x2d62aa);}return _0x598c2f['status'](_0x2d62aa)[_0x1b6f('0x30')]();};}function respondWithResult(_0x136ff8,_0x3ac3e5){_0x3ac3e5=_0x3ac3e5||0xc8;return function(_0x19c045){if(_0x19c045){return _0x136ff8['status'](_0x3ac3e5)[_0x1b6f('0x31')](_0x19c045);}};}function respondWithFilteredResult(_0x3b2c97,_0x1cf34f){return function(_0x2c23cd){if(_0x2c23cd){var _0x2f7a5c=_0x2c23cd[_0x1b6f('0x32')],_0x12f6b4=_0x1cf34f[_0x1b6f('0x33')],_0x36ed33=_0x1cf34f[_0x1b6f('0x33')]+_0x1cf34f[_0x1b6f('0x34')],_0x19e36f;if(_0x36ed33>=_0x2f7a5c){_0x36ed33=_0x2f7a5c;_0x19e36f=0xc8;}else{_0x19e36f=0xce;}_0x3b2c97[_0x1b6f('0x35')](_0x19e36f);return _0x3b2c97['set'](_0x1b6f('0x36'),_0x12f6b4+'-'+_0x36ed33+'/'+_0x2f7a5c)['json'](_0x2c23cd);}return null;};}function patchUpdates(_0x395eb5){return function(_0x18681c){try{jsonpatch[_0x1b6f('0x37')](_0x18681c,_0x395eb5,!![]);}catch(_0x4ee0d0){return BPromise[_0x1b6f('0x38')](_0x4ee0d0);}return _0x18681c[_0x1b6f('0x39')]();};}function saveUpdates(_0x1da533,_0x28fd13){return function(_0x1122d7){if(_0x1122d7){return _0x1122d7['update'](_0x1da533)[_0x1b6f('0x24')](function(_0x1bf1d1){return _0x1bf1d1;});}return null;};}function removeEntity(_0x499466,_0x5d008c){return function(_0x357b38){if(_0x357b38){return _0x357b38[_0x1b6f('0x3a')]()[_0x1b6f('0x24')](function(){_0x499466[_0x1b6f('0x35')](0xcc)[_0x1b6f('0x30')]();});}};}function handleEntityNotFound(_0x477230,_0x3a505a){return function(_0x5825b5){if(!_0x5825b5){_0x477230[_0x1b6f('0x2f')](0x194);}return _0x5825b5;};}function handleError(_0x4a2e54,_0x2ed3a6){_0x2ed3a6=_0x2ed3a6||0x1f4;return function(_0x17b07f){logger['error'](_0x17b07f['stack']);if(_0x17b07f[_0x1b6f('0x3b')]){delete _0x17b07f[_0x1b6f('0x3b')];}_0x4a2e54[_0x1b6f('0x35')](_0x2ed3a6)[_0x1b6f('0x3c')](_0x17b07f);};}exports[_0x1b6f('0x3d')]=function(_0xdec04,_0xacd06b){var _0x392821={},_0x50c2c0={},_0x309218={'count':0x0,'rows':[]};var _0x3f77f0=_[_0x1b6f('0x3e')](db[_0x1b6f('0x3f')][_0x1b6f('0x40')],function(_0x40bbce){return{'name':_0x40bbce[_0x1b6f('0x41')],'type':_0x40bbce[_0x1b6f('0x42')]['key']};});_0x50c2c0[_0x1b6f('0x43')]=_[_0x1b6f('0x3e')](_0x3f77f0,'name');_0x50c2c0[_0x1b6f('0x44')]=_[_0x1b6f('0x45')](_0xdec04[_0x1b6f('0x44')]);_0x50c2c0[_0x1b6f('0x46')]=_['intersection'](_0x50c2c0[_0x1b6f('0x43')],_0x50c2c0[_0x1b6f('0x44')]);_0x392821['attributes']=_[_0x1b6f('0x47')](_0x50c2c0[_0x1b6f('0x43')],qs['fields'](_0xdec04[_0x1b6f('0x44')][_0x1b6f('0x48')]));_0x392821[_0x1b6f('0x49')]=_0x392821[_0x1b6f('0x49')][_0x1b6f('0x4a')]?_0x392821[_0x1b6f('0x49')]:_0x50c2c0[_0x1b6f('0x43')];if(!_0xdec04[_0x1b6f('0x44')]['hasOwnProperty'](_0x1b6f('0x4b'))){_0x392821[_0x1b6f('0x34')]=qs[_0x1b6f('0x34')](_0xdec04[_0x1b6f('0x44')][_0x1b6f('0x34')]);_0x392821[_0x1b6f('0x33')]=qs[_0x1b6f('0x33')](_0xdec04[_0x1b6f('0x44')][_0x1b6f('0x33')]);}_0x392821['order']=qs[_0x1b6f('0x4c')](_0xdec04[_0x1b6f('0x44')][_0x1b6f('0x4c')]);_0x392821[_0x1b6f('0x4d')]=qs[_0x1b6f('0x46')](_['pick'](_0xdec04['query'],_0x50c2c0[_0x1b6f('0x46')]));if(_0xdec04['query'][_0x1b6f('0x4e')]){_0x392821[_0x1b6f('0x4d')]=_['merge'](_0x392821[_0x1b6f('0x4d')],{'$or':_[_0x1b6f('0x3e')](_0x3f77f0,function(_0x174873){if(_0x174873[_0x1b6f('0x42')]!==_0x1b6f('0x4f')){var _0x178019={};_0x178019[_0x174873['name']]={'$like':'%'+_0xdec04['query'][_0x1b6f('0x4e')]+'%'};return _0x178019;}})});}_0x392821=_['merge']({},_0x392821,_0xdec04[_0x1b6f('0x50')]);var _0xe9e05e={'where':_0x392821[_0x1b6f('0x4d')]};return db[_0x1b6f('0x3f')][_0x1b6f('0x32')](_0xe9e05e)[_0x1b6f('0x24')](function(_0xddbcfe){_0x309218['count']=_0xddbcfe;if(_0xdec04[_0x1b6f('0x44')][_0x1b6f('0x51')]){_0x392821['include']=[{'all':!![]}];}return db[_0x1b6f('0x3f')][_0x1b6f('0x52')](_0x392821);})[_0x1b6f('0x24')](function(_0x8eaf){_0x309218[_0x1b6f('0x53')]=_0x8eaf;return _0x309218;})[_0x1b6f('0x24')](respondWithFilteredResult(_0xacd06b,_0x392821))[_0x1b6f('0x2e')](handleError(_0xacd06b,null));};exports[_0x1b6f('0x54')]=function(_0x5a5ba8,_0x235bb7){var _0x554389={'raw':![],'where':{'id':_0x5a5ba8['params']['id']}},_0x5b73ff={};_0x5b73ff[_0x1b6f('0x43')]=_[_0x1b6f('0x45')](db[_0x1b6f('0x3f')][_0x1b6f('0x40')]);_0x5b73ff[_0x1b6f('0x44')]=_[_0x1b6f('0x45')](_0x5a5ba8['query']);_0x5b73ff['filters']=_[_0x1b6f('0x47')](_0x5b73ff[_0x1b6f('0x43')],_0x5b73ff['query']);_0x554389[_0x1b6f('0x49')]=_[_0x1b6f('0x47')](_0x5b73ff[_0x1b6f('0x43')],qs[_0x1b6f('0x48')](_0x5a5ba8[_0x1b6f('0x44')][_0x1b6f('0x48')]));_0x554389[_0x1b6f('0x49')]=_0x554389[_0x1b6f('0x49')][_0x1b6f('0x4a')]?_0x554389[_0x1b6f('0x49')]:_0x5b73ff['model'];if(_0x5a5ba8['query'][_0x1b6f('0x51')]){_0x554389[_0x1b6f('0x55')]=[{'all':!![]}];}_0x554389=_[_0x1b6f('0x56')]({},_0x554389,_0x5a5ba8[_0x1b6f('0x50')]);return db['ServicenowAccount']['find'](_0x554389)[_0x1b6f('0x24')](handleEntityNotFound(_0x235bb7,null))[_0x1b6f('0x24')](respondWithResult(_0x235bb7,null))[_0x1b6f('0x2e')](handleError(_0x235bb7,null));};exports[_0x1b6f('0x57')]=function(_0x5b4e36,_0x5df58e){return db[_0x1b6f('0x3f')][_0x1b6f('0x57')](_0x5b4e36['body'],{})[_0x1b6f('0x24')](respondWithResult(_0x5df58e,0xc9))[_0x1b6f('0x2e')](handleError(_0x5df58e,null));};exports[_0x1b6f('0x58')]=function(_0x174c1e,_0x116a38){if(_0x174c1e[_0x1b6f('0x59')]['id']){delete _0x174c1e['body']['id'];}return db['ServicenowAccount'][_0x1b6f('0x5a')]({'where':{'id':_0x174c1e[_0x1b6f('0x5b')]['id']}})[_0x1b6f('0x24')](handleEntityNotFound(_0x116a38,null))['then'](saveUpdates(_0x174c1e[_0x1b6f('0x59')],null))[_0x1b6f('0x24')](respondWithResult(_0x116a38,null))[_0x1b6f('0x2e')](handleError(_0x116a38,null));};exports[_0x1b6f('0x3a')]=function(_0xc2ca82,_0xdaf79a){return db[_0x1b6f('0x3f')][_0x1b6f('0x5a')]({'where':{'id':_0xc2ca82[_0x1b6f('0x5b')]['id']}})[_0x1b6f('0x24')](handleEntityNotFound(_0xdaf79a,null))[_0x1b6f('0x24')](removeEntity(_0xdaf79a,null))[_0x1b6f('0x2e')](handleError(_0xdaf79a,null));};exports[_0x1b6f('0x5c')]=function(_0x1861b8,_0x52262f,_0x3520c2){var _0x4dd7b4={};var _0x3a195d={};var _0x180e67;var _0x18909e;return db[_0x1b6f('0x3f')][_0x1b6f('0x5d')]({'where':{'id':_0x1861b8[_0x1b6f('0x5b')]['id']}})[_0x1b6f('0x24')](handleEntityNotFound(_0x52262f,null))[_0x1b6f('0x24')](function(_0x4d8526){if(_0x4d8526){_0x180e67=_0x4d8526;_0x3a195d[_0x1b6f('0x43')]=_[_0x1b6f('0x45')](db[_0x1b6f('0x5e')][_0x1b6f('0x40')]);_0x3a195d[_0x1b6f('0x44')]=_[_0x1b6f('0x45')](_0x1861b8[_0x1b6f('0x44')]);_0x3a195d[_0x1b6f('0x46')]=_[_0x1b6f('0x47')](_0x3a195d['model'],_0x3a195d[_0x1b6f('0x44')]);_0x4dd7b4[_0x1b6f('0x49')]=_['intersection'](_0x3a195d['model'],qs[_0x1b6f('0x48')](_0x1861b8[_0x1b6f('0x44')]['fields']));_0x4dd7b4[_0x1b6f('0x49')]=_0x4dd7b4[_0x1b6f('0x49')][_0x1b6f('0x4a')]?_0x4dd7b4[_0x1b6f('0x49')]:_0x3a195d[_0x1b6f('0x43')];_0x4dd7b4[_0x1b6f('0x5f')]=qs[_0x1b6f('0x4c')](_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x4c')]);_0x4dd7b4[_0x1b6f('0x4d')]=qs[_0x1b6f('0x46')](_[_0x1b6f('0x60')](_0x1861b8['query'],_0x3a195d[_0x1b6f('0x46')]));if(_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x4e')]){_0x4dd7b4['where']=_[_0x1b6f('0x56')](_0x4dd7b4[_0x1b6f('0x4d')],{'$or':_[_0x1b6f('0x3e')](_0x4dd7b4[_0x1b6f('0x49')],function(_0x8ff4b5){var _0x2811f6={};_0x2811f6[_0x8ff4b5]={'$like':'%'+_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x4e')]+'%'};return _0x2811f6;})});}_0x4dd7b4=_[_0x1b6f('0x56')]({},_0x4dd7b4,_0x1861b8[_0x1b6f('0x50')]);return _0x180e67['getConfigurations'](_0x4dd7b4);}})[_0x1b6f('0x24')](function(_0x458e43){if(_0x458e43){_0x18909e=_0x458e43[_0x1b6f('0x4a')];if(!_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x61')](_0x1b6f('0x4b'))){_0x4dd7b4[_0x1b6f('0x34')]=qs['limit'](_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x34')]);_0x4dd7b4['offset']=qs['offset'](_0x1861b8[_0x1b6f('0x44')][_0x1b6f('0x33')]);}return _0x180e67[_0x1b6f('0x5c')](_0x4dd7b4);}})[_0x1b6f('0x24')](function(_0x5ed521){if(_0x5ed521){return _0x5ed521?{'count':_0x18909e,'rows':_0x5ed521}:null;}})['then'](respondWithResult(_0x52262f,null))[_0x1b6f('0x2e')](handleError(_0x52262f,null));};exports[_0x1b6f('0x62')]=function(_0x1b2db0,_0x4e8dba,_0x2cf83e){if(_0x1b2db0[_0x1b6f('0x59')]['id']){delete _0x1b2db0[_0x1b6f('0x59')]['id'];}return db['ServicenowAccount'][_0x1b6f('0x5d')]({'where':{'id':_0x1b2db0[_0x1b6f('0x5b')]['id']}})[_0x1b6f('0x24')](handleEntityNotFound(_0x4e8dba,null))['then'](function(_0x4614f7){if(_0x4614f7){_0x1b2db0['body']['AccountId']=_0x4614f7['id'];_0x1b2db0[_0x1b6f('0x59')][_0x1b6f('0x63')]=integrations['getSubjects'](_0x1b2db0[_0x1b6f('0x59')][_0x1b6f('0x64')],_0x1b2db0[_0x1b6f('0x59')]['type']);_0x1b2db0[_0x1b6f('0x59')][_0x1b6f('0x65')]=integrations[_0x1b6f('0x66')](_0x1b2db0['body'][_0x1b6f('0x64')],_0x1b2db0['body'][_0x1b6f('0x42')]);return db[_0x1b6f('0x5e')][_0x1b6f('0x57')](_0x1b2db0[_0x1b6f('0x59')],{'include':[{'model':db['ServicenowField'],'as':_0x1b6f('0x63')},{'model':db[_0x1b6f('0x67')],'as':_0x1b6f('0x65')}]});}return null;})['then'](respondWithResult(_0x4e8dba,null))[_0x1b6f('0x2e')](handleError(_0x4e8dba,null));};exports[_0x1b6f('0x68')]=function(_0x52cebf,_0x455b5e,_0x2db022){var _0x3410d7=['made_sla','hold_reason',_0x1b6f('0x69'),_0x1b6f('0x6a'),_0x1b6f('0x6b'),_0x1b6f('0x6c'),_0x1b6f('0x6d'),'severity',_0x1b6f('0x6e')];var _0x2715d8=[_0x1b6f('0x6f'),_0x1b6f('0x70'),_0x1b6f('0x71'),_0x1b6f('0x72'),_0x1b6f('0x73'),_0x1b6f('0x74'),_0x1b6f('0x75'),'hold_reason',_0x1b6f('0x76'),'number',_0x1b6f('0x77'),_0x1b6f('0x78'),_0x1b6f('0x79'),_0x1b6f('0x7a'),_0x1b6f('0x7b'),'sys_domain',_0x1b6f('0x7c'),_0x1b6f('0x7d'),_0x1b6f('0x69'),_0x1b6f('0x5f'),_0x1b6f('0x7e'),_0x1b6f('0x7f'),'cmdb_ci',_0x1b6f('0x80'),_0x1b6f('0x81'),_0x1b6f('0x82'),'work_notes_list','business_service',_0x1b6f('0x83'),_0x1b6f('0x84'),_0x1b6f('0x85'),_0x1b6f('0x86'),_0x1b6f('0x87'),_0x1b6f('0x88'),_0x1b6f('0x89'),_0x1b6f('0x8a'),_0x1b6f('0x8b'),'reopened_time',_0x1b6f('0x8c'),_0x1b6f('0x8d'),'approval_set',_0x1b6f('0x6a'),_0x1b6f('0x8e'),_0x1b6f('0x8f'),_0x1b6f('0x6b'),'correlation_display',_0x1b6f('0x90'),'work_start',_0x1b6f('0x91'),_0x1b6f('0x92'),_0x1b6f('0x93'),_0x1b6f('0x94'),_0x1b6f('0x95'),_0x1b6f('0x6c'),_0x1b6f('0x96'),_0x1b6f('0x97'),_0x1b6f('0x98'),_0x1b6f('0x99'),_0x1b6f('0x9a'),_0x1b6f('0x9b'),_0x1b6f('0x9c'),_0x1b6f('0x9d'),_0x1b6f('0x6d'),_0x1b6f('0x9e'),'problem_id','company',_0x1b6f('0x9f'),_0x1b6f('0xa0'),'assigned_to',_0x1b6f('0xa1'),_0x1b6f('0xa2'),_0x1b6f('0xa3'),_0x1b6f('0xa4'),'comments_and_work_notes',_0x1b6f('0xa5'),_0x1b6f('0xa6'),'reopen_count','sys_tags',_0x1b6f('0xa7'),_0x1b6f('0xa8'),_0x1b6f('0xa9'),'location',_0x1b6f('0x6e')];var _0x1afb3b='';var _0x5350cc='';var _0x34188a=[];var _0x10b0f2='';var _0x615ff='';var _0x117318=[];var _0x49bf33='';var _0xc1e1b4='';var _0x4559fd={};var _0xe01134='';return db[_0x1b6f('0x3f')][_0x1b6f('0x5d')]({'where':{'id':_0x52cebf[_0x1b6f('0x5b')]['id']},'attributes':['id',_0x1b6f('0xaa'),'password',_0x1b6f('0xab'),'remoteUri',_0x1b6f('0xac')]})[_0x1b6f('0x24')](handleEntityNotFound(_0x455b5e,null))[_0x1b6f('0x24')](function(_0x406087){if(_0x406087){_0xe01134=_0x406087['remoteUri'];var _0x7129df=_0xe01134[_0x1b6f('0xad')](-0x1);if(_0x7129df==='/'){_0xe01134=_0xe01134['substring'](0x0,_0xe01134['lastIndexOf'](_0x7129df));}_0xc1e1b4=util[_0x1b6f('0xae')](_0x1b6f('0xaf'),_0xe01134);_0x49bf33=util[_0x1b6f('0xae')]('%s/api/now/table/',_0xe01134);_0x4559fd={'user':_0x406087['username'],'pass':_0x406087[_0x1b6f('0xb0')]};var _0x59827d={'method':_0x1b6f('0xb1'),'uri':_0xc1e1b4+_0x1b6f('0xb2'),'auth':_0x4559fd,'json':!![]};return rp(_0x59827d);}})[_0x1b6f('0x24')](function(_0x5bf338){if(_0x5bf338['result'][_0x1b6f('0x4a')]>0x0){_0x1afb3b=_0x5bf338[_0x1b6f('0x2d')];}console[_0x1b6f('0xb3')](_0x1b6f('0xb4'),_0x1afb3b);_0x117318=[];_0x5350cc=Object[_0x1b6f('0xb5')]([],_0x1afb3b);_[_0x1b6f('0xb6')](_0x5350cc,function(_0xd79f18){return!_0x3410d7['includes'](_0xd79f18['name']);});_0x5350cc[_0x1b6f('0xb7')](function(_0x23ac40){var _0x16abd4=createFieldObject(_0x49bf33,_0x4559fd,_0x23ac40[_0x1b6f('0xb8')],_0x23ac40[_0x1b6f('0x3b')],_0x23ac40[_0x1b6f('0xb9')],![]);_0x117318['push'](_0x16abd4);});return Promise[_0x1b6f('0xba')](_0x117318);})['then'](function(_0x5a8ef9){_0x34188a=_0x5a8ef9;_0x10b0f2=Object[_0x1b6f('0xb5')]([],_0x1afb3b);console[_0x1b6f('0xb3')](_0x1b6f('0xbb'),_0x1afb3b);_['remove'](_0x10b0f2,function(_0x1684a4){return _0x2715d8[_0x1b6f('0xbc')](_0x1684a4[_0x1b6f('0x3b')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x10b0f2);_0x117318=[];_0x10b0f2[_0x1b6f('0xb7')](function(_0xa74b9f){var _0x48a53d=createFieldObject(_0x49bf33,_0x4559fd,_0xa74b9f['internalType'],_0xa74b9f[_0x1b6f('0x3b')],_0xa74b9f[_0x1b6f('0xb9')],!![]);_0x117318[_0x1b6f('0xbd')](_0x48a53d);});return Promise[_0x1b6f('0xba')](_0x117318);})['then'](function(_0x22f239){_0x615ff=_0x22f239;var _0x5be24f=_0x34188a[_0x1b6f('0xbe')](_0x615ff);return{'count':_0x5be24f['length'],'rows':_0x5be24f};})['then'](respondWithResult(_0x455b5e,null))[_0x1b6f('0x2e')](function(_0x3e0bda){console[_0x1b6f('0xb3')](_0x1b6f('0xbf')+_0x3e0bda);var _0x3c1cca=_0x52cebf[_0x1b6f('0x44')][_0x1b6f('0x21')]?0x1f4:_0x3e0bda[_0x1b6f('0xc0')]||0x1f4;logger['error'](_0x3e0bda[_0x1b6f('0xc1')]);delete _0x3e0bda[_0x1b6f('0x3b')];if(_0x3c1cca===0x191){_0x3c1cca=0x190;}_0x455b5e[_0x1b6f('0x35')](_0x3c1cca)[_0x1b6f('0x3c')](_0x52cebf['query'][_0x1b6f('0x21')]?{'message':_0x1b6f('0xc2'),'statusCode':_0x3e0bda[_0x1b6f('0xc0')]}:_0x3e0bda);});};function createFieldObject(_0x4d1318,_0x3c7a99,_0x339385,_0xa9e4c,_0x575250,_0x115645){return new Promise(function(_0x14f195,_0x474eba){var _0x35fc6d={'id':_0xa9e4c,'name':_0x575250,'custom':_0x115645};if(_0x339385===_0x1b6f('0xc3')){_0x35fc6d[_0x1b6f('0x50')]=[{'name':_0x1b6f('0xc4'),'value':_0x1b6f('0xc5')},{'name':_0x1b6f('0xc6'),'value':'false'}];_0x14f195(_0x35fc6d);}else{var _0x272d2d={'method':_0x1b6f('0xb1'),'uri':_0x4d1318+_0x1b6f('0xc7')+_0xa9e4c,'auth':_0x3c7a99,'json':!![]};return rp(_0x272d2d)[_0x1b6f('0x24')](function(_0x58c3d9){var _0xb6f56b=[];if(_0x58c3d9[_0x1b6f('0x2d')]['length']>0x0){_0x58c3d9[_0x1b6f('0x2d')][_0x1b6f('0xb7')](function(_0x5ce96d){if(_0x5ce96d[_0x1b6f('0xc8')]===_0x1b6f('0xc9')){var _0xf88143={'name':_0x5ce96d['label'],'value':_0x5ce96d[_0x1b6f('0xca')]};_0xb6f56b[_0x1b6f('0xbd')](_0xf88143);}});}_0x35fc6d['options']=_0xb6f56b;if(_0x35fc6d[_0x1b6f('0x50')][_0x1b6f('0x4a')]>0x0){_0x14f195(_0x35fc6d);}else{if(_0x115645==![]){_0x14f195();}else{_0x14f195(_0x35fc6d);}}});}});}
\ No newline at end of file
+var _0x4a7b=['expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','delivery_task','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','assign','includes','internalType','label','push','TCL:\x20_object','remove','forEach','all','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','False','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','made_sla','hold_reason','knowledge','subcategory','close_code','severity','category','parent','caused_by','approval_history','number','sys_created_on','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x4a7b,0xef));var _0xb4a7=function(_0x817394,_0x4ee3ce){_0x817394=_0x817394-0x0;var _0x613eb=_0x4a7b[_0x817394];return _0x613eb;};'use strict';var emlformat=require(_0xb4a7('0x0'));var rimraf=require(_0xb4a7('0x1'));var zipdir=require(_0xb4a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4a7('0x3'));var moment=require(_0xb4a7('0x4'));var BPromise=require(_0xb4a7('0x5'));var Mustache=require(_0xb4a7('0x6'));var util=require('util');var path=require(_0xb4a7('0x7'));var sox=require('sox');var csv=require(_0xb4a7('0x8'));var ejs=require(_0xb4a7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4a7('0xa'));var squel=require(_0xb4a7('0xb'));var crypto=require(_0xb4a7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb4a7('0x8'));var querystring=require(_0xb4a7('0xd'));var Papa=require(_0xb4a7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4a7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4a7('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xb4a7('0x11'));var config=require(_0xb4a7('0x12'));var licenseUtil=require(_0xb4a7('0x13'));var db=require(_0xb4a7('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c9edf,_0x764819){_0x764819=_0x764819||0xcc;return function(_0x3f1d2f){if(_0x3f1d2f){return _0x1c9edf[_0xb4a7('0x15')](_0x764819);}return _0x1c9edf[_0xb4a7('0x16')](_0x764819)[_0xb4a7('0x17')]();};}function respondWithResult(_0x5f566e,_0xe9d6b3){_0xe9d6b3=_0xe9d6b3||0xc8;return function(_0x28b16b){if(_0x28b16b){return _0x5f566e[_0xb4a7('0x16')](_0xe9d6b3)[_0xb4a7('0x18')](_0x28b16b);}};}function respondWithFilteredResult(_0x4a8682,_0x46652b){return function(_0x4e3ee3){if(_0x4e3ee3){var _0x8da150=typeof _0x46652b[_0xb4a7('0x19')]===_0xb4a7('0x1a')&&typeof _0x46652b[_0xb4a7('0x1b')]==='undefined';var _0x4a3f26=_0x4e3ee3[_0xb4a7('0x1c')];var _0x43cf73=_0x8da150?0x0:_0x46652b[_0xb4a7('0x19')];var _0x5e42ed=_0x8da150?_0x4e3ee3[_0xb4a7('0x1c')]:_0x46652b['offset']+_0x46652b[_0xb4a7('0x1b')];var _0x4cc8c2;if(_0x5e42ed>=_0x4a3f26){_0x5e42ed=_0x4a3f26;_0x4cc8c2=0xc8;}else{_0x4cc8c2=0xce;}_0x4a8682[_0xb4a7('0x16')](_0x4cc8c2);return _0x4a8682['set'](_0xb4a7('0x1d'),_0x43cf73+'-'+_0x5e42ed+'/'+_0x4a3f26)['json'](_0x4e3ee3);}return null;};}function patchUpdates(_0x89ad2f){return function(_0x4631da){try{jsonpatch[_0xb4a7('0x1e')](_0x4631da,_0x89ad2f,!![]);}catch(_0x2c3fd0){return BPromise['reject'](_0x2c3fd0);}return _0x4631da[_0xb4a7('0x1f')]();};}function saveUpdates(_0x740f19,_0x44cd73){return function(_0xa4430c){if(_0xa4430c){return _0xa4430c[_0xb4a7('0x20')](_0x740f19)['then'](function(_0x34071e){return _0x34071e;});}return null;};}function removeEntity(_0x4a95f5,_0x500fc6){return function(_0x41d461){if(_0x41d461){return _0x41d461[_0xb4a7('0x21')]()[_0xb4a7('0x22')](function(){_0x4a95f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c26b,_0x23780c){return function(_0x54874a){if(!_0x54874a){_0x31c26b[_0xb4a7('0x15')](0x194);}return _0x54874a;};}function handleError(_0x20da1b,_0x58791e){_0x58791e=_0x58791e||0x1f4;return function(_0x43a85b){logger['error'](_0x43a85b[_0xb4a7('0x23')]);if(_0x43a85b[_0xb4a7('0x24')]){delete _0x43a85b[_0xb4a7('0x24')];}_0x20da1b[_0xb4a7('0x16')](_0x58791e)[_0xb4a7('0x25')](_0x43a85b);};}exports[_0xb4a7('0x26')]=function(_0x322bc7,_0x384e01){var _0x558739={},_0x154e8f={},_0x3da1d2={'count':0x0,'rows':[]};var _0x162cf2=_[_0xb4a7('0x27')](db[_0xb4a7('0x28')][_0xb4a7('0x29')],function(_0x55ce4a){return{'name':_0x55ce4a[_0xb4a7('0x2a')],'type':_0x55ce4a[_0xb4a7('0x2b')][_0xb4a7('0x2c')]};});_0x154e8f['model']=_[_0xb4a7('0x27')](_0x162cf2,'name');_0x154e8f['query']=_[_0xb4a7('0x2d')](_0x322bc7['query']);_0x154e8f['filters']=_[_0xb4a7('0x2e')](_0x154e8f[_0xb4a7('0x2f')],_0x154e8f[_0xb4a7('0x30')]);_0x558739[_0xb4a7('0x31')]=_[_0xb4a7('0x2e')](_0x154e8f[_0xb4a7('0x2f')],qs[_0xb4a7('0x32')](_0x322bc7['query'][_0xb4a7('0x32')]));_0x558739[_0xb4a7('0x31')]=_0x558739[_0xb4a7('0x31')][_0xb4a7('0x33')]?_0x558739[_0xb4a7('0x31')]:_0x154e8f[_0xb4a7('0x2f')];if(!_0x322bc7['query'][_0xb4a7('0x34')](_0xb4a7('0x35'))){_0x558739[_0xb4a7('0x1b')]=qs[_0xb4a7('0x1b')](_0x322bc7[_0xb4a7('0x30')]['limit']);_0x558739[_0xb4a7('0x19')]=qs['offset'](_0x322bc7[_0xb4a7('0x30')][_0xb4a7('0x19')]);}_0x558739[_0xb4a7('0x36')]=qs[_0xb4a7('0x37')](_0x322bc7[_0xb4a7('0x30')][_0xb4a7('0x37')]);_0x558739[_0xb4a7('0x38')]=qs[_0xb4a7('0x39')](_[_0xb4a7('0x3a')](_0x322bc7[_0xb4a7('0x30')],_0x154e8f[_0xb4a7('0x39')]),_0x162cf2);if(_0x322bc7[_0xb4a7('0x30')][_0xb4a7('0x3b')]){_0x558739['where']=_[_0xb4a7('0x3c')](_0x558739[_0xb4a7('0x38')],{'$or':_[_0xb4a7('0x27')](_0x162cf2,function(_0x3e3ff){if(_0x3e3ff[_0xb4a7('0x2b')]!==_0xb4a7('0x3d')){var _0x3725bc={};_0x3725bc[_0x3e3ff[_0xb4a7('0x24')]]={'$like':'%'+_0x322bc7[_0xb4a7('0x30')][_0xb4a7('0x3b')]+'%'};return _0x3725bc;}})});}_0x558739=_[_0xb4a7('0x3c')]({},_0x558739,_0x322bc7[_0xb4a7('0x3e')]);var _0x130997={'where':_0x558739['where']};return db[_0xb4a7('0x28')][_0xb4a7('0x1c')](_0x130997)[_0xb4a7('0x22')](function(_0x54c040){_0x3da1d2[_0xb4a7('0x1c')]=_0x54c040;if(_0x322bc7['query'][_0xb4a7('0x3f')]){_0x558739['include']=[{'all':!![]}];}return db[_0xb4a7('0x28')][_0xb4a7('0x40')](_0x558739);})['then'](function(_0x1e7e26){_0x3da1d2['rows']=_0x1e7e26;return _0x3da1d2;})[_0xb4a7('0x22')](respondWithFilteredResult(_0x384e01,_0x558739))[_0xb4a7('0x41')](handleError(_0x384e01,null));};exports[_0xb4a7('0x42')]=function(_0x3f5b6e,_0x316259){var _0x5da2d3={'raw':![],'where':{'id':_0x3f5b6e[_0xb4a7('0x43')]['id']}},_0x2aecbc={};_0x2aecbc[_0xb4a7('0x2f')]=_[_0xb4a7('0x2d')](db[_0xb4a7('0x28')][_0xb4a7('0x29')]);_0x2aecbc[_0xb4a7('0x30')]=_['keys'](_0x3f5b6e['query']);_0x2aecbc[_0xb4a7('0x39')]=_[_0xb4a7('0x2e')](_0x2aecbc[_0xb4a7('0x2f')],_0x2aecbc['query']);_0x5da2d3['attributes']=_[_0xb4a7('0x2e')](_0x2aecbc[_0xb4a7('0x2f')],qs[_0xb4a7('0x32')](_0x3f5b6e[_0xb4a7('0x30')][_0xb4a7('0x32')]));_0x5da2d3[_0xb4a7('0x31')]=_0x5da2d3[_0xb4a7('0x31')]['length']?_0x5da2d3['attributes']:_0x2aecbc[_0xb4a7('0x2f')];if(_0x3f5b6e[_0xb4a7('0x30')][_0xb4a7('0x3f')]){_0x5da2d3[_0xb4a7('0x44')]=[{'all':!![]}];}_0x5da2d3=_[_0xb4a7('0x3c')]({},_0x5da2d3,_0x3f5b6e[_0xb4a7('0x3e')]);return db[_0xb4a7('0x28')][_0xb4a7('0x45')](_0x5da2d3)[_0xb4a7('0x22')](handleEntityNotFound(_0x316259,null))[_0xb4a7('0x22')](respondWithResult(_0x316259,null))['catch'](handleError(_0x316259,null));};exports[_0xb4a7('0x46')]=function(_0x28049d,_0x21b9f8){return db[_0xb4a7('0x28')][_0xb4a7('0x46')](_0x28049d[_0xb4a7('0x47')],{})[_0xb4a7('0x22')](respondWithResult(_0x21b9f8,0xc9))[_0xb4a7('0x41')](handleError(_0x21b9f8,null));};exports[_0xb4a7('0x20')]=function(_0x33730f,_0x315241){if(_0x33730f['body']['id']){delete _0x33730f['body']['id'];}return db[_0xb4a7('0x28')][_0xb4a7('0x45')]({'where':{'id':_0x33730f[_0xb4a7('0x43')]['id']}})[_0xb4a7('0x22')](handleEntityNotFound(_0x315241,null))[_0xb4a7('0x22')](saveUpdates(_0x33730f['body'],null))[_0xb4a7('0x22')](respondWithResult(_0x315241,null))[_0xb4a7('0x41')](handleError(_0x315241,null));};exports['destroy']=function(_0x4f8198,_0x1be1d7){return db[_0xb4a7('0x28')][_0xb4a7('0x45')]({'where':{'id':_0x4f8198[_0xb4a7('0x43')]['id']}})[_0xb4a7('0x22')](handleEntityNotFound(_0x1be1d7,null))[_0xb4a7('0x22')](removeEntity(_0x1be1d7,null))[_0xb4a7('0x41')](handleError(_0x1be1d7,null));};exports[_0xb4a7('0x48')]=function(_0x13f450,_0x58a5ab,_0x40969a){var _0x2a2f16={};var _0x417ff2={};var _0x27a866;var _0x1378e9;return db[_0xb4a7('0x28')][_0xb4a7('0x49')]({'where':{'id':_0x13f450['params']['id']}})[_0xb4a7('0x22')](handleEntityNotFound(_0x58a5ab,null))['then'](function(_0x106228){if(_0x106228){_0x27a866=_0x106228;_0x417ff2['model']=_[_0xb4a7('0x2d')](db[_0xb4a7('0x4a')][_0xb4a7('0x29')]);_0x417ff2[_0xb4a7('0x30')]=_[_0xb4a7('0x2d')](_0x13f450[_0xb4a7('0x30')]);_0x417ff2['filters']=_[_0xb4a7('0x2e')](_0x417ff2[_0xb4a7('0x2f')],_0x417ff2[_0xb4a7('0x30')]);_0x2a2f16['attributes']=_[_0xb4a7('0x2e')](_0x417ff2[_0xb4a7('0x2f')],qs[_0xb4a7('0x32')](_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x32')]));_0x2a2f16[_0xb4a7('0x31')]=_0x2a2f16[_0xb4a7('0x31')][_0xb4a7('0x33')]?_0x2a2f16[_0xb4a7('0x31')]:_0x417ff2['model'];_0x2a2f16[_0xb4a7('0x36')]=qs[_0xb4a7('0x37')](_0x13f450[_0xb4a7('0x30')]['sort']);_0x2a2f16[_0xb4a7('0x38')]=qs[_0xb4a7('0x39')](_[_0xb4a7('0x3a')](_0x13f450[_0xb4a7('0x30')],_0x417ff2[_0xb4a7('0x39')]));if(_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x3b')]){_0x2a2f16[_0xb4a7('0x38')]=_['merge'](_0x2a2f16[_0xb4a7('0x38')],{'$or':_['map'](_0x2a2f16['attributes'],function(_0x53c29b){var _0x4e88cc={};_0x4e88cc[_0x53c29b]={'$like':'%'+_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x3b')]+'%'};return _0x4e88cc;})});}_0x2a2f16=_[_0xb4a7('0x3c')]({},_0x2a2f16,_0x13f450[_0xb4a7('0x3e')]);return _0x27a866[_0xb4a7('0x48')](_0x2a2f16);}})['then'](function(_0x11a877){if(_0x11a877){_0x1378e9=_0x11a877['length'];if(!_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x34')]('nolimit')){_0x2a2f16[_0xb4a7('0x1b')]=qs[_0xb4a7('0x1b')](_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x1b')]);_0x2a2f16[_0xb4a7('0x19')]=qs['offset'](_0x13f450[_0xb4a7('0x30')][_0xb4a7('0x19')]);}return _0x27a866[_0xb4a7('0x48')](_0x2a2f16);}})[_0xb4a7('0x22')](function(_0x1d2062){if(_0x1d2062){return _0x1d2062?{'count':_0x1378e9,'rows':_0x1d2062}:null;}})[_0xb4a7('0x22')](respondWithResult(_0x58a5ab,null))['catch'](handleError(_0x58a5ab,null));};exports[_0xb4a7('0x4b')]=function(_0x8dcb9f,_0x1d314f,_0x5e32e9){if(_0x8dcb9f[_0xb4a7('0x47')]['id']){delete _0x8dcb9f['body']['id'];}return db['ServicenowAccount'][_0xb4a7('0x49')]({'where':{'id':_0x8dcb9f[_0xb4a7('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d314f,null))[_0xb4a7('0x22')](function(_0x3baca5){if(_0x3baca5){_0x8dcb9f['body'][_0xb4a7('0x4c')]=_0x3baca5['id'];_0x8dcb9f['body']['Subjects']=integrations[_0xb4a7('0x4d')](_0x8dcb9f[_0xb4a7('0x47')]['channel'],_0x8dcb9f['body'][_0xb4a7('0x2b')]);_0x8dcb9f[_0xb4a7('0x47')][_0xb4a7('0x4e')]=integrations[_0xb4a7('0x4f')](_0x8dcb9f[_0xb4a7('0x47')][_0xb4a7('0x50')],_0x8dcb9f['body']['type']);return db[_0xb4a7('0x4a')]['create'](_0x8dcb9f[_0xb4a7('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0xb4a7('0x51')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1d314f,null))['catch'](handleError(_0x1d314f,null));};exports['getFields']=function(_0x370e36,_0x4e13b4,_0x2114f3){var _0x3199ab=[_0xb4a7('0x52'),_0xb4a7('0x53'),_0xb4a7('0x54'),_0xb4a7('0x55'),_0xb4a7('0x56'),'notify','incident_state',_0xb4a7('0x57'),_0xb4a7('0x58')];var _0xcdca31=[_0xb4a7('0x59'),'made_sla',_0xb4a7('0x5a'),'watch_list','upon_reject','sys_updated_on','child_incidents',_0xb4a7('0x53'),_0xb4a7('0x5b'),_0xb4a7('0x5c'),'resolved_by','sys_updated_by','opened_by','user_input',_0xb4a7('0x5d'),'sys_domain','state',_0xb4a7('0x5e'),'knowledge',_0xb4a7('0x36'),_0xb4a7('0x5f'),_0xb4a7('0x60'),_0xb4a7('0x61'),_0xb4a7('0x62'),_0xb4a7('0x63'),_0xb4a7('0x64'),_0xb4a7('0x65'),_0xb4a7('0x66'),_0xb4a7('0x67'),_0xb4a7('0x68'),_0xb4a7('0x69'),_0xb4a7('0x6a'),_0xb4a7('0x6b'),_0xb4a7('0x6c'),_0xb4a7('0x6d'),'group_list',_0xb4a7('0x6e'),_0xb4a7('0x6f'),_0xb4a7('0x70'),_0xb4a7('0x71'),'approval_set',_0xb4a7('0x55'),_0xb4a7('0x72'),'short_description',_0xb4a7('0x56'),'correlation_display',_0xb4a7('0x73'),'work_start','assignment_group',_0xb4a7('0x74'),_0xb4a7('0x75'),_0xb4a7('0x76'),_0xb4a7('0x77'),'notify',_0xb4a7('0x78'),_0xb4a7('0x79'),'closed_by',_0xb4a7('0x7a'),_0xb4a7('0x7b'),_0xb4a7('0x7c'),_0xb4a7('0x7d'),_0xb4a7('0x7e'),_0xb4a7('0x7f'),'urgency',_0xb4a7('0x80'),_0xb4a7('0x81'),_0xb4a7('0x82'),_0xb4a7('0x83'),_0xb4a7('0x84'),_0xb4a7('0x57'),'comments',_0xb4a7('0x85'),'approval',_0xb4a7('0x86'),'due_date',_0xb4a7('0x87'),'reopen_count',_0xb4a7('0x88'),_0xb4a7('0x89'),_0xb4a7('0x8a'),_0xb4a7('0x8b'),_0xb4a7('0x8c'),_0xb4a7('0x58')];var _0x548b9a='';var _0x17e1fd='';var _0x788f9d=[];var _0xe0053d='';var _0x45e8e6='';var _0x325d49=[];var _0xd34718='';var _0x39b857='';var _0x46d243={};var _0x3e043f='';return db[_0xb4a7('0x28')][_0xb4a7('0x49')]({'where':{'id':_0x370e36[_0xb4a7('0x43')]['id']},'attributes':['id','username','password',_0xb4a7('0x8d'),_0xb4a7('0x8e'),'serverUrl']})[_0xb4a7('0x22')](handleEntityNotFound(_0x4e13b4,null))['then'](function(_0x5c901b){if(_0x5c901b){_0x3e043f=_0x5c901b[_0xb4a7('0x8e')];var _0x2148e0=_0x3e043f[_0xb4a7('0x8f')](-0x1);if(_0x2148e0==='/'){_0x3e043f=_0x3e043f[_0xb4a7('0x90')](0x0,_0x3e043f[_0xb4a7('0x91')](_0x2148e0));}_0x39b857=util[_0xb4a7('0x92')](_0xb4a7('0x93'),_0x3e043f);_0xd34718=util['format'](_0xb4a7('0x94'),_0x3e043f);_0x46d243={'user':_0x5c901b['username'],'pass':_0x5c901b['password']};var _0x56e867={'method':_0xb4a7('0x95'),'uri':_0x39b857+'incident?sysparm_display_value=all','auth':_0x46d243,'json':!![]};return rp(_0x56e867);}})[_0xb4a7('0x22')](function(_0xd6a3f7){if(_0xd6a3f7[_0xb4a7('0x96')][_0xb4a7('0x33')]>0x0){_0x548b9a=_0xd6a3f7[_0xb4a7('0x96')];}console[_0xb4a7('0x97')]('incident\x20table\x20objects',_0x548b9a);_0x325d49=[];_0x17e1fd=Object[_0xb4a7('0x98')]([],_0x548b9a);_['remove'](_0x17e1fd,function(_0xc0133f){return!_0x3199ab[_0xb4a7('0x99')](_0xc0133f[_0xb4a7('0x24')]);});_0x17e1fd['forEach'](function(_0x26a616){var _0x558804=createFieldObject(_0xd34718,_0x46d243,_0x26a616[_0xb4a7('0x9a')],_0x26a616['name'],_0x26a616[_0xb4a7('0x9b')],![]);_0x325d49[_0xb4a7('0x9c')](_0x558804);});return Promise['all'](_0x325d49);})[_0xb4a7('0x22')](function(_0x5daec7){_0x788f9d=_0x5daec7;_0xe0053d=Object[_0xb4a7('0x98')]([],_0x548b9a);console['log'](_0xb4a7('0x9d'),_0x548b9a);_[_0xb4a7('0x9e')](_0xe0053d,function(_0x5b3cb3){return _0xcdca31[_0xb4a7('0x99')](_0x5b3cb3['name']);});console[_0xb4a7('0x97')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xe0053d);_0x325d49=[];_0xe0053d[_0xb4a7('0x9f')](function(_0x35b9aa){var _0x5b8fe2=createFieldObject(_0xd34718,_0x46d243,_0x35b9aa[_0xb4a7('0x9a')],_0x35b9aa['name'],_0x35b9aa[_0xb4a7('0x9b')],!![]);_0x325d49[_0xb4a7('0x9c')](_0x5b8fe2);});return Promise[_0xb4a7('0xa0')](_0x325d49);})[_0xb4a7('0x22')](function(_0x5b3d38){_0x45e8e6=_0x5b3d38;var _0x38e963=_0x788f9d[_0xb4a7('0xa1')](_0x45e8e6);return{'count':_0x38e963[_0xb4a7('0x33')],'rows':_0x38e963};})[_0xb4a7('0x22')](respondWithResult(_0x4e13b4,null))['catch'](function(_0x1d2661){console[_0xb4a7('0x97')](_0xb4a7('0xa2')+_0x1d2661);var _0x490e75=_0x370e36['query'][_0xb4a7('0xa3')]?0x1f4:_0x1d2661[_0xb4a7('0xa4')]||0x1f4;logger[_0xb4a7('0xa5')](_0x1d2661[_0xb4a7('0x23')]);delete _0x1d2661[_0xb4a7('0x24')];if(_0x490e75===0x191){_0x490e75=0x190;}_0x4e13b4['status'](_0x490e75)[_0xb4a7('0x25')](_0x370e36[_0xb4a7('0x30')]['test']?{'message':_0xb4a7('0xa6'),'statusCode':_0x1d2661[_0xb4a7('0xa4')]}:_0x1d2661);});};function createFieldObject(_0x10ff5a,_0x11f88e,_0x2d7924,_0x14fd1c,_0x29919e,_0x173028){return new Promise(function(_0x4b755a,_0x5e6f9c){var _0x25e61a={'id':_0x14fd1c,'name':_0x29919e,'custom':_0x173028};if(_0x2d7924===_0xb4a7('0xa7')){_0x25e61a[_0xb4a7('0x3e')]=[{'name':_0xb4a7('0xa8'),'value':'true'},{'name':_0xb4a7('0xa9'),'value':_0xb4a7('0xaa')}];_0x4b755a(_0x25e61a);}else{var _0x533b4f={'method':_0xb4a7('0x95'),'uri':_0x10ff5a+'sys_choice?sysparm_query=name=incident^element='+_0x14fd1c,'auth':_0x11f88e,'json':!![]};return rp(_0x533b4f)[_0xb4a7('0x22')](function(_0x233806){var _0x4adb30=[];if(_0x233806[_0xb4a7('0x96')][_0xb4a7('0x33')]>0x0){_0x233806['result'][_0xb4a7('0x9f')](function(_0x6c36c5){if(_0x6c36c5[_0xb4a7('0xab')]==='false'){var _0x2d6d85={'name':_0x6c36c5[_0xb4a7('0x9b')],'value':_0x6c36c5[_0xb4a7('0xac')]};_0x4adb30[_0xb4a7('0x9c')](_0x2d6d85);}});}_0x25e61a[_0xb4a7('0x3e')]=_0x4adb30;if(_0x25e61a[_0xb4a7('0x3e')][_0xb4a7('0x33')]>0x0){_0x4b755a(_0x25e61a);}else{if(_0x173028==![]){_0x4b755a();}else{_0x4b755a(_0x25e61a);}}});}});}
\ No newline at end of file