Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index f53db2f..8da1d00 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 _0x526c=['password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','push','test','statusCode','Wrong\x20credentials','True','true','False','false','inactive','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','update','destroy','stack','name','send','index','ServicenowAccount','key','model','map','query','keys','attributes','intersection','fields','length','order','where','filters','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','create','body','findOne','ServicenowConfiguration','sort','options','getConfigurations','hasOwnProperty','nolimit','Subjects','getSubjects','Descriptions','channel','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','parent','watch_list','upon_reject','child_incidents','approval_history','sys_updated_by','user_input','sys_domain','state','calendar_stc','cmdb_ci','delivery_plan','work_notes_list','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','category','username'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x526c,0x191));var _0xc526=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0x526c[_0x1b2422];return _0x376573;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc526('0x0'));var zipdir=require(_0xc526('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc526('0x2'));var moment=require(_0xc526('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc526('0x4'));var util=require('util');var path=require(_0xc526('0x5'));var sox=require(_0xc526('0x6'));var csv=require(_0xc526('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc526('0x8'));var squel=require(_0xc526('0x9'));var crypto=require(_0xc526('0xa'));var jsforce=require(_0xc526('0xb'));var deskjs=require(_0xc526('0xc'));var toCsv=require(_0xc526('0x7'));var querystring=require(_0xc526('0xd'));var Papa=require(_0xc526('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc526('0xf'));var as=require(_0xc526('0x10'));var hardwareService=require(_0xc526('0x11'));var logger=require(_0xc526('0x12'))(_0xc526('0x13'));var utils=require('../../config/utils');var config=require(_0xc526('0x14'));var licenseUtil=require(_0xc526('0x15'));var db=require(_0xc526('0x16'))['db'];var integrations=require(_0xc526('0x17'));var jayson=require(_0xc526('0x18'));var client=jayson[_0xc526('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58dd10,_0x7935c1,_0x2b9031,_0x4765bb){return new BPromise(function(_0x2ca8b4,_0x3d9f72){var _0x142974=_0x4765bb||client;return _0x142974['request'](_0x58dd10,_0x2b9031)[_0xc526('0x1a')](function(_0x3f347c){logger[_0xc526('0x1b')](_0xc526('0x1c'),_0x7935c1,_0xc526('0x1d'));logger[_0xc526('0x1e')](_0xc526('0x1f'),_0x7935c1,_0xc526('0x1d'),JSON[_0xc526('0x20')](_0x3f347c));if(_0x3f347c[_0xc526('0x21')]){if(_0x3f347c[_0xc526('0x21')]['code']===0x1f4){logger[_0xc526('0x21')](_0xc526('0x1c'),_0x7935c1,_0x3f347c[_0xc526('0x21')][_0xc526('0x22')]);return _0x3d9f72(_0x3f347c[_0xc526('0x21')][_0xc526('0x22')]);}logger[_0xc526('0x21')](_0xc526('0x1c'),_0x7935c1,_0x3f347c[_0xc526('0x21')]['message']);return _0x2ca8b4(_0x3f347c[_0xc526('0x21')][_0xc526('0x22')]);}else{logger[_0xc526('0x1b')](_0xc526('0x1c'),_0x7935c1,'request\x20sent');_0x2ca8b4(_0x3f347c[_0xc526('0x23')][_0xc526('0x22')]);}})[_0xc526('0x24')](function(_0x33bbea){logger[_0xc526('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x7935c1,_0x33bbea);_0x3d9f72(_0x33bbea);});});}function respondWithStatusCode(_0x30a2dd,_0x5a7dc3){_0x5a7dc3=_0x5a7dc3||0xcc;return function(_0x213d19){if(_0x213d19){return _0x30a2dd[_0xc526('0x25')](_0x5a7dc3);}return _0x30a2dd[_0xc526('0x26')](_0x5a7dc3)[_0xc526('0x27')]();};}function respondWithResult(_0x4eb235,_0x4b722c){_0x4b722c=_0x4b722c||0xc8;return function(_0x55e9fb){if(_0x55e9fb){return _0x4eb235[_0xc526('0x26')](_0x4b722c)[_0xc526('0x28')](_0x55e9fb);}};}function respondWithFilteredResult(_0x2fa1ed,_0x475880){return function(_0x3302c5){if(_0x3302c5){var _0x5284e3=_0x3302c5[_0xc526('0x29')],_0x3e002c=_0x475880['offset'],_0x3753e9=_0x475880[_0xc526('0x2a')]+_0x475880[_0xc526('0x2b')],_0x475861;if(_0x3753e9>=_0x5284e3){_0x3753e9=_0x5284e3;_0x475861=0xc8;}else{_0x475861=0xce;}_0x2fa1ed[_0xc526('0x26')](_0x475861);return _0x2fa1ed[_0xc526('0x2c')]('Content-Range',_0x3e002c+'-'+_0x3753e9+'/'+_0x5284e3)[_0xc526('0x28')](_0x3302c5);}return null;};}function patchUpdates(_0x51e6aa){return function(_0x2c64d8){try{jsonpatch[_0xc526('0x2d')](_0x2c64d8,_0x51e6aa,!![]);}catch(_0x767795){return BPromise['reject'](_0x767795);}return _0x2c64d8['save']();};}function saveUpdates(_0x371bc5,_0x4bc950){return function(_0x2eab70){if(_0x2eab70){return _0x2eab70[_0xc526('0x2e')](_0x371bc5)['then'](function(_0x3b12ff){return _0x3b12ff;});}return null;};}function removeEntity(_0x1dbc1a,_0x4a6682){return function(_0x214837){if(_0x214837){return _0x214837[_0xc526('0x2f')]()['then'](function(){_0x1dbc1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d235,_0x8c1846){return function(_0x10c0e3){if(!_0x10c0e3){_0x26d235[_0xc526('0x25')](0x194);}return _0x10c0e3;};}function handleError(_0x4041b4,_0x16bb8e){_0x16bb8e=_0x16bb8e||0x1f4;return function(_0x1bafed){logger['error'](_0x1bafed[_0xc526('0x30')]);if(_0x1bafed['name']){delete _0x1bafed[_0xc526('0x31')];}_0x4041b4[_0xc526('0x26')](_0x16bb8e)[_0xc526('0x32')](_0x1bafed);};}exports[_0xc526('0x33')]=function(_0x30baba,_0x1cf45f){var _0x392e4e={},_0x4c39f1={},_0x134910={'count':0x0,'rows':[]};var _0x4da7de=_['map'](db[_0xc526('0x34')]['rawAttributes'],function(_0xde5e85){return{'name':_0xde5e85['fieldName'],'type':_0xde5e85['type'][_0xc526('0x35')]};});_0x4c39f1[_0xc526('0x36')]=_[_0xc526('0x37')](_0x4da7de,_0xc526('0x31'));_0x4c39f1[_0xc526('0x38')]=_[_0xc526('0x39')](_0x30baba[_0xc526('0x38')]);_0x4c39f1['filters']=_['intersection'](_0x4c39f1['model'],_0x4c39f1['query']);_0x392e4e[_0xc526('0x3a')]=_[_0xc526('0x3b')](_0x4c39f1[_0xc526('0x36')],qs[_0xc526('0x3c')](_0x30baba[_0xc526('0x38')][_0xc526('0x3c')]));_0x392e4e[_0xc526('0x3a')]=_0x392e4e[_0xc526('0x3a')][_0xc526('0x3d')]?_0x392e4e['attributes']:_0x4c39f1[_0xc526('0x36')];if(!_0x30baba['query']['hasOwnProperty']('nolimit')){_0x392e4e[_0xc526('0x2b')]=qs['limit'](_0x30baba[_0xc526('0x38')]['limit']);_0x392e4e[_0xc526('0x2a')]=qs[_0xc526('0x2a')](_0x30baba[_0xc526('0x38')]['offset']);}_0x392e4e[_0xc526('0x3e')]=qs['sort'](_0x30baba['query']['sort']);_0x392e4e[_0xc526('0x3f')]=qs[_0xc526('0x40')](_[_0xc526('0x41')](_0x30baba['query'],_0x4c39f1['filters']),_0x4da7de);if(_0x30baba[_0xc526('0x38')][_0xc526('0x42')]){_0x392e4e[_0xc526('0x3f')]=_['merge'](_0x392e4e['where'],{'$or':_['map'](_0x4da7de,function(_0x2f4522){if(_0x2f4522[_0xc526('0x43')]!==_0xc526('0x44')){var _0x6eb135={};_0x6eb135[_0x2f4522[_0xc526('0x31')]]={'$like':'%'+_0x30baba[_0xc526('0x38')]['filter']+'%'};return _0x6eb135;}})});}_0x392e4e=_['merge']({},_0x392e4e,_0x30baba['options']);var _0x51c155={'where':_0x392e4e[_0xc526('0x3f')]};return db[_0xc526('0x34')][_0xc526('0x29')](_0x51c155)['then'](function(_0x4dc9f1){_0x134910[_0xc526('0x29')]=_0x4dc9f1;if(_0x30baba[_0xc526('0x38')][_0xc526('0x45')]){_0x392e4e[_0xc526('0x46')]=[{'all':!![]}];}return db[_0xc526('0x34')][_0xc526('0x47')](_0x392e4e);})[_0xc526('0x1a')](function(_0x5c85f2){_0x134910[_0xc526('0x48')]=_0x5c85f2;return _0x134910;})[_0xc526('0x1a')](respondWithFilteredResult(_0x1cf45f,_0x392e4e))['catch'](handleError(_0x1cf45f,null));};exports[_0xc526('0x49')]=function(_0x41ba25,_0x541f33){var _0x12ad01={'raw':![],'where':{'id':_0x41ba25[_0xc526('0x4a')]['id']}},_0x535dab={};_0x535dab[_0xc526('0x36')]=_[_0xc526('0x39')](db[_0xc526('0x34')][_0xc526('0x4b')]);_0x535dab[_0xc526('0x38')]=_[_0xc526('0x39')](_0x41ba25[_0xc526('0x38')]);_0x535dab[_0xc526('0x40')]=_['intersection'](_0x535dab[_0xc526('0x36')],_0x535dab[_0xc526('0x38')]);_0x12ad01[_0xc526('0x3a')]=_['intersection'](_0x535dab[_0xc526('0x36')],qs[_0xc526('0x3c')](_0x41ba25[_0xc526('0x38')][_0xc526('0x3c')]));_0x12ad01[_0xc526('0x3a')]=_0x12ad01['attributes'][_0xc526('0x3d')]?_0x12ad01[_0xc526('0x3a')]:_0x535dab[_0xc526('0x36')];if(_0x41ba25[_0xc526('0x38')][_0xc526('0x45')]){_0x12ad01['include']=[{'all':!![]}];}_0x12ad01=_[_0xc526('0x4c')]({},_0x12ad01,_0x41ba25['options']);return db[_0xc526('0x34')][_0xc526('0x4d')](_0x12ad01)['then'](handleEntityNotFound(_0x541f33,null))[_0xc526('0x1a')](respondWithResult(_0x541f33,null))['catch'](handleError(_0x541f33,null));};exports[_0xc526('0x4e')]=function(_0x2ccbdb,_0x5d888c){return db[_0xc526('0x34')][_0xc526('0x4e')](_0x2ccbdb['body'],{})[_0xc526('0x1a')](respondWithResult(_0x5d888c,0xc9))[_0xc526('0x24')](handleError(_0x5d888c,null));};exports[_0xc526('0x2e')]=function(_0x552611,_0x16b2de){if(_0x552611[_0xc526('0x4f')]['id']){delete _0x552611[_0xc526('0x4f')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x552611[_0xc526('0x4a')]['id']}})[_0xc526('0x1a')](handleEntityNotFound(_0x16b2de,null))[_0xc526('0x1a')](saveUpdates(_0x552611['body'],null))[_0xc526('0x1a')](respondWithResult(_0x16b2de,null))['catch'](handleError(_0x16b2de,null));};exports[_0xc526('0x2f')]=function(_0xe75ef2,_0x402ef0){return db[_0xc526('0x34')][_0xc526('0x4d')]({'where':{'id':_0xe75ef2[_0xc526('0x4a')]['id']}})[_0xc526('0x1a')](handleEntityNotFound(_0x402ef0,null))[_0xc526('0x1a')](removeEntity(_0x402ef0,null))[_0xc526('0x24')](handleError(_0x402ef0,null));};exports['getConfigurations']=function(_0x32e0f8,_0x3a2f26,_0x3b983f){var _0x311ac8={};var _0x25d697={};var _0x2aded3;var _0xa24a24;return db['ServicenowAccount'][_0xc526('0x50')]({'where':{'id':_0x32e0f8['params']['id']}})[_0xc526('0x1a')](handleEntityNotFound(_0x3a2f26,null))[_0xc526('0x1a')](function(_0x4056f5){if(_0x4056f5){_0x2aded3=_0x4056f5;_0x25d697[_0xc526('0x36')]=_[_0xc526('0x39')](db[_0xc526('0x51')][_0xc526('0x4b')]);_0x25d697[_0xc526('0x38')]=_[_0xc526('0x39')](_0x32e0f8[_0xc526('0x38')]);_0x25d697[_0xc526('0x40')]=_[_0xc526('0x3b')](_0x25d697[_0xc526('0x36')],_0x25d697['query']);_0x311ac8['attributes']=_[_0xc526('0x3b')](_0x25d697[_0xc526('0x36')],qs['fields'](_0x32e0f8[_0xc526('0x38')][_0xc526('0x3c')]));_0x311ac8[_0xc526('0x3a')]=_0x311ac8[_0xc526('0x3a')]['length']?_0x311ac8[_0xc526('0x3a')]:_0x25d697[_0xc526('0x36')];_0x311ac8[_0xc526('0x3e')]=qs[_0xc526('0x52')](_0x32e0f8[_0xc526('0x38')][_0xc526('0x52')]);_0x311ac8[_0xc526('0x3f')]=qs[_0xc526('0x40')](_[_0xc526('0x41')](_0x32e0f8[_0xc526('0x38')],_0x25d697[_0xc526('0x40')]));if(_0x32e0f8[_0xc526('0x38')][_0xc526('0x42')]){_0x311ac8[_0xc526('0x3f')]=_[_0xc526('0x4c')](_0x311ac8[_0xc526('0x3f')],{'$or':_['map'](_0x311ac8[_0xc526('0x3a')],function(_0x500782){var _0x544146={};_0x544146[_0x500782]={'$like':'%'+_0x32e0f8['query'][_0xc526('0x42')]+'%'};return _0x544146;})});}_0x311ac8=_[_0xc526('0x4c')]({},_0x311ac8,_0x32e0f8[_0xc526('0x53')]);return _0x2aded3[_0xc526('0x54')](_0x311ac8);}})['then'](function(_0x593d7d){if(_0x593d7d){_0xa24a24=_0x593d7d[_0xc526('0x3d')];if(!_0x32e0f8[_0xc526('0x38')][_0xc526('0x55')](_0xc526('0x56'))){_0x311ac8[_0xc526('0x2b')]=qs[_0xc526('0x2b')](_0x32e0f8[_0xc526('0x38')][_0xc526('0x2b')]);_0x311ac8['offset']=qs['offset'](_0x32e0f8[_0xc526('0x38')][_0xc526('0x2a')]);}return _0x2aded3[_0xc526('0x54')](_0x311ac8);}})[_0xc526('0x1a')](function(_0x11a082){if(_0x11a082){return _0x11a082?{'count':_0xa24a24,'rows':_0x11a082}:null;}})[_0xc526('0x1a')](respondWithResult(_0x3a2f26,null))[_0xc526('0x24')](handleError(_0x3a2f26,null));};exports['addConfiguration']=function(_0x2a3a7f,_0x3e9c90,_0x50a53c){if(_0x2a3a7f['body']['id']){delete _0x2a3a7f[_0xc526('0x4f')]['id'];}return db[_0xc526('0x34')][_0xc526('0x50')]({'where':{'id':_0x2a3a7f[_0xc526('0x4a')]['id']}})[_0xc526('0x1a')](handleEntityNotFound(_0x3e9c90,null))[_0xc526('0x1a')](function(_0xd8f288){if(_0xd8f288){_0x2a3a7f[_0xc526('0x4f')]['AccountId']=_0xd8f288['id'];_0x2a3a7f[_0xc526('0x4f')][_0xc526('0x57')]=integrations[_0xc526('0x58')](_0x2a3a7f[_0xc526('0x4f')]['channel'],_0x2a3a7f['body'][_0xc526('0x43')]);_0x2a3a7f[_0xc526('0x4f')][_0xc526('0x59')]=integrations['getDescriptions'](_0x2a3a7f['body'][_0xc526('0x5a')],_0x2a3a7f[_0xc526('0x4f')]['type']);return db['ServicenowConfiguration']['create'](_0x2a3a7f[_0xc526('0x4f')],{'include':[{'model':db[_0xc526('0x5b')],'as':'Subjects'},{'model':db[_0xc526('0x5b')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3e9c90,null))[_0xc526('0x24')](handleError(_0x3e9c90,null));};exports['getFields']=function(_0xc21a96,_0x2dc77e,_0x403222){var _0xd7ea08=[_0xc526('0x5c'),_0xc526('0x5d'),_0xc526('0x5e'),_0xc526('0x5f'),_0xc526('0x60'),_0xc526('0x61'),'incident_state',_0xc526('0x62'),'category'];var _0x20d0fd=[_0xc526('0x63'),_0xc526('0x5c'),'caused_by',_0xc526('0x64'),_0xc526('0x65'),'sys_updated_on',_0xc526('0x66'),_0xc526('0x5d'),_0xc526('0x67'),'number','resolved_by',_0xc526('0x68'),'opened_by',_0xc526('0x69'),'sys_created_on',_0xc526('0x6a'),_0xc526('0x6b'),'sys_created_by','knowledge','order',_0xc526('0x6c'),'closed_at',_0xc526('0x6d'),_0xc526('0x6e'),'impact','active',_0xc526('0x6f'),'business_service',_0xc526('0x70'),_0xc526('0x71'),_0xc526('0x72'),_0xc526('0x73'),'expected_start',_0xc526('0x74'),'business_duration',_0xc526('0x75'),'work_end',_0xc526('0x76'),_0xc526('0x77'),_0xc526('0x78'),_0xc526('0x79'),_0xc526('0x5f'),_0xc526('0x7a'),_0xc526('0x7b'),_0xc526('0x60'),'correlation_display',_0xc526('0x7c'),_0xc526('0x7d'),'assignment_group',_0xc526('0x7e'),_0xc526('0x7f'),_0xc526('0x80'),_0xc526('0x81'),'notify',_0xc526('0x82'),_0xc526('0x83'),'closed_by',_0xc526('0x84'),_0xc526('0x85'),_0xc526('0x86'),'contact_type',_0xc526('0x87'),_0xc526('0x88'),_0xc526('0x89'),_0xc526('0x8a'),_0xc526('0x8b'),_0xc526('0x8c'),_0xc526('0x8d'),_0xc526('0x8e'),_0xc526('0x62'),'comments',_0xc526('0x8f'),_0xc526('0x90'),_0xc526('0x91'),_0xc526('0x92'),_0xc526('0x93'),_0xc526('0x94'),_0xc526('0x95'),_0xc526('0x96'),'upon_approval','correlation_id',_0xc526('0x97'),_0xc526('0x98')];var _0x1d6c19='';var _0x2b943b='';var _0x5760b8=[];var _0x2c1b13='';var _0x57f0fa='';var _0x189548=[];var _0x50591a='';var _0x5b2c07='';var _0x29b073={};var _0x736a6b='';return db[_0xc526('0x34')]['findOne']({'where':{'id':_0xc21a96[_0xc526('0x4a')]['id']},'attributes':['id',_0xc526('0x99'),_0xc526('0x9a'),_0xc526('0x9b'),_0xc526('0x9c'),_0xc526('0x9d')]})[_0xc526('0x1a')](handleEntityNotFound(_0x2dc77e,null))[_0xc526('0x1a')](function(_0x5c8dbc){if(_0x5c8dbc){_0x736a6b=_0x5c8dbc[_0xc526('0x9c')];var _0x2fb9d9=_0x736a6b[_0xc526('0x9e')](-0x1);if(_0x2fb9d9==='/'){_0x736a6b=_0x736a6b[_0xc526('0x9f')](0x0,_0x736a6b[_0xc526('0xa0')](_0x2fb9d9));}_0x5b2c07=util[_0xc526('0xa1')]('%s/api/now/doc/table/schema/',_0x736a6b);_0x50591a=util[_0xc526('0xa1')](_0xc526('0xa2'),_0x736a6b);_0x29b073={'user':_0x5c8dbc[_0xc526('0x99')],'pass':_0x5c8dbc[_0xc526('0x9a')]};var _0x2868c1={'method':_0xc526('0xa3'),'uri':_0x5b2c07+_0xc526('0xa4'),'auth':_0x29b073,'json':!![]};return rp(_0x2868c1);}})[_0xc526('0x1a')](function(_0xba79d9){if(_0xba79d9['result'][_0xc526('0x3d')]>0x0){_0x1d6c19=_0xba79d9['result'];}console[_0xc526('0xa5')](_0xc526('0xa6'),_0x1d6c19);_0x189548=[];_0x2b943b=Object[_0xc526('0xa7')]([],_0x1d6c19);_[_0xc526('0xa8')](_0x2b943b,function(_0x5d0162){return!_0xd7ea08[_0xc526('0xa9')](_0x5d0162[_0xc526('0x31')]);});_0x2b943b['forEach'](function(_0x3c416c){var _0x2e2639=createFieldObject(_0x50591a,_0x29b073,_0x3c416c[_0xc526('0xaa')],_0x3c416c[_0xc526('0x31')],_0x3c416c[_0xc526('0xab')],![]);_0x189548['push'](_0x2e2639);});return Promise[_0xc526('0xac')](_0x189548);})[_0xc526('0x1a')](function(_0x38dc69){_0x5760b8=_0x38dc69;_0x2c1b13=Object[_0xc526('0xa7')]([],_0x1d6c19);console[_0xc526('0xa5')](_0xc526('0xad'),_0x1d6c19);_['remove'](_0x2c1b13,function(_0xc529f){return _0x20d0fd['includes'](_0xc529f[_0xc526('0x31')]);});console[_0xc526('0xa5')](_0xc526('0xae'),_0x2c1b13);_0x189548=[];_0x2c1b13[_0xc526('0xaf')](function(_0x3a9f89){var _0xec23e0=createFieldObject(_0x50591a,_0x29b073,_0x3a9f89[_0xc526('0xaa')],_0x3a9f89[_0xc526('0x31')],_0x3a9f89[_0xc526('0xab')],!![]);_0x189548[_0xc526('0xb0')](_0xec23e0);});return Promise['all'](_0x189548);})[_0xc526('0x1a')](function(_0x261bdc){_0x57f0fa=_0x261bdc;var _0x5c32c1=_0x5760b8['concat'](_0x57f0fa);return{'count':_0x5c32c1['length'],'rows':_0x5c32c1};})['then'](respondWithResult(_0x2dc77e,null))['catch'](function(_0x248da8){console[_0xc526('0xa5')]('ServiceNow\x20error:\x20'+_0x248da8);var _0x100e61=_0xc21a96[_0xc526('0x38')][_0xc526('0xb1')]?0x1f4:_0x248da8[_0xc526('0xb2')]||0x1f4;logger[_0xc526('0x21')](_0x248da8[_0xc526('0x30')]);delete _0x248da8[_0xc526('0x31')];if(_0x100e61===0x191){_0x100e61=0x190;}_0x2dc77e[_0xc526('0x26')](_0x100e61)[_0xc526('0x32')](_0xc21a96['query'][_0xc526('0xb1')]?{'message':_0xc526('0xb3'),'statusCode':_0x248da8[_0xc526('0xb2')]}:_0x248da8);});};function createFieldObject(_0x5d6e79,_0x4ad9de,_0x4c08a0,_0x4f3e41,_0x41a416,_0x41154c){return new Promise(function(_0x311a37,_0x341be0){var _0xc782ff={'id':_0x4f3e41,'name':_0x41a416,'custom':_0x41154c};if(_0x4c08a0==='boolean'){_0xc782ff['options']=[{'name':_0xc526('0xb4'),'value':_0xc526('0xb5')},{'name':_0xc526('0xb6'),'value':_0xc526('0xb7')}];_0x311a37(_0xc782ff);}else{var _0xb538d3={'method':'GET','uri':_0x5d6e79+'sys_choice?sysparm_query=name=incident^element='+_0x4f3e41,'auth':_0x4ad9de,'json':!![]};return rp(_0xb538d3)[_0xc526('0x1a')](function(_0x5c2ba0){var _0x319132=[];if(_0x5c2ba0[_0xc526('0x23')][_0xc526('0x3d')]>0x0){_0x5c2ba0[_0xc526('0x23')][_0xc526('0xaf')](function(_0x45417b){if(_0x45417b[_0xc526('0xb8')]===_0xc526('0xb7')){var _0x39d522={'name':_0x45417b[_0xc526('0xab')],'value':_0x45417b['value']};_0x319132[_0xc526('0xb0')](_0x39d522);}});}_0xc782ff['options']=_0x319132;if(_0xc782ff['options'][_0xc526('0x3d')]>0x0){_0x311a37(_0xc782ff);}else{if(_0x41154c==![]){_0x311a37();}else{_0x311a37(_0xc782ff);}}});}});}
\ No newline at end of file