Built motion from commit (unavailable).|2.4.21
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.controller.js
index f53db2f..cf82a38 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 _0x80ab=['company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','username','password','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency'];(function(_0x42da8f,_0x10fe8d){var _0x7b02cc=function(_0x13b98b){while(--_0x13b98b){_0x42da8f['push'](_0x42da8f['shift']());}};_0x7b02cc(++_0x10fe8d);}(_0x80ab,0x1b7));var _0xb80a=function(_0x1f56a9,_0x543850){_0x1f56a9=_0x1f56a9-0x0;var _0x455909=_0x80ab[_0x1f56a9];return _0x455909;};'use strict';var pdf=require(_0xb80a('0x0'));var emlformat=require(_0xb80a('0x1'));var rimraf=require(_0xb80a('0x2'));var zipdir=require(_0xb80a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb80a('0x4'));var moment=require(_0xb80a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb80a('0x6'));var path=require(_0xb80a('0x7'));var sox=require(_0xb80a('0x8'));var csv=require(_0xb80a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb80a('0xa'));var squel=require(_0xb80a('0xb'));var crypto=require(_0xb80a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb80a('0xd'));var toCsv=require(_0xb80a('0x9'));var querystring=require(_0xb80a('0xe'));var Papa=require(_0xb80a('0xf'));var Redis=require(_0xb80a('0x10'));var authService=require(_0xb80a('0x11'));var qs=require(_0xb80a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb80a('0x13'));var logger=require('../../config/logger')(_0xb80a('0x14'));var utils=require(_0xb80a('0x15'));var config=require(_0xb80a('0x16'));var db=require(_0xb80a('0x17'))['db'];var integrations=require(_0xb80a('0x18'));var jayson=require(_0xb80a('0x19'));var client=jayson['client'][_0xb80a('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x14e842,_0x4a3f2c,_0x59695e){if(_0x59695e){var _0x4f5fe2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f5fe2[_0xb80a('0x1b')](_0x4a3f2c)){return _0x14e842;}else{throw new db['Sequelize']['ValidationError'](_0xb80a('0x1c'));}}else{return _0x14e842;}}function respondWithRpcPromise(_0x28b6dc,_0x8cc616,_0x4e46ac,_0x2fcb0f){return new BPromise(function(_0xee2331,_0x3fdeb8){var _0x143a43=_0x2fcb0f||client;return _0x143a43[_0xb80a('0x1d')](_0x28b6dc,_0x4e46ac)[_0xb80a('0x1e')](function(_0x4baa2d){logger[_0xb80a('0x1f')](_0xb80a('0x20'),_0x8cc616,_0xb80a('0x21'));logger['debug'](_0xb80a('0x22'),_0x8cc616,_0xb80a('0x21'),JSON[_0xb80a('0x23')](_0x4baa2d));if(_0x4baa2d[_0xb80a('0x24')]){if(_0x4baa2d['error']['code']===0x1f4){logger[_0xb80a('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x8cc616,_0x4baa2d[_0xb80a('0x24')][_0xb80a('0x25')]);return _0x3fdeb8(_0x4baa2d[_0xb80a('0x24')]['message']);}logger[_0xb80a('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x8cc616,_0x4baa2d[_0xb80a('0x24')]['message']);return _0xee2331(_0x4baa2d[_0xb80a('0x24')]['message']);}else{logger[_0xb80a('0x1f')](_0xb80a('0x20'),_0x8cc616,'request\x20sent');_0xee2331(_0x4baa2d[_0xb80a('0x26')]['message']);}})[_0xb80a('0x27')](function(_0x3593){logger[_0xb80a('0x24')](_0xb80a('0x20'),_0x8cc616,_0x3593);_0x3fdeb8(_0x3593);});});}function respondWithStatusCode(_0x5b0fae,_0x39117e){_0x39117e=_0x39117e||0xcc;return function(_0x4fcd46){if(_0x4fcd46){return _0x5b0fae[_0xb80a('0x28')](_0x39117e);}return _0x5b0fae[_0xb80a('0x29')](_0x39117e)[_0xb80a('0x2a')]();};}function respondWithResult(_0x56bbfe,_0x5780ec){_0x5780ec=_0x5780ec||0xc8;return function(_0x15916a){if(_0x15916a){return _0x56bbfe[_0xb80a('0x29')](_0x5780ec)[_0xb80a('0x2b')](_0x15916a);}};}function respondWithFilteredResult(_0x1939ea,_0x492668){return function(_0x11b500){if(_0x11b500){var _0x386b38=_0x11b500[_0xb80a('0x2c')],_0x54f344=_0x492668[_0xb80a('0x2d')],_0x9ccc98=_0x492668[_0xb80a('0x2d')]+_0x492668[_0xb80a('0x2e')],_0x25ee70;if(_0x9ccc98>=_0x386b38){_0x9ccc98=_0x386b38;_0x25ee70=0xc8;}else{_0x25ee70=0xce;}_0x1939ea['status'](_0x25ee70);return _0x1939ea[_0xb80a('0x2f')]('Content-Range',_0x54f344+'-'+_0x9ccc98+'/'+_0x386b38)['json'](_0x11b500);}return null;};}function patchUpdates(_0x3238e3){return function(_0x4de9ed){try{jsonpatch['apply'](_0x4de9ed,_0x3238e3,!![]);}catch(_0x132146){return BPromise[_0xb80a('0x30')](_0x132146);}return _0x4de9ed[_0xb80a('0x31')]();};}function saveUpdates(_0xc65b4d,_0x355337){return function(_0x215d02){if(_0x215d02){return _0x215d02[_0xb80a('0x32')](_0xc65b4d)[_0xb80a('0x1e')](function(_0x4580f8){return _0x4580f8;});}return null;};}function removeEntity(_0x4b2b27,_0x44ea77){return function(_0x27d0c6){if(_0x27d0c6){return _0x27d0c6[_0xb80a('0x33')]()[_0xb80a('0x1e')](function(){_0x4b2b27[_0xb80a('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x269d22,_0x5156eb){return function(_0x4564c1){if(!_0x4564c1){_0x269d22[_0xb80a('0x28')](0x194);}return _0x4564c1;};}function handleError(_0x434d0a,_0x4c0bfb){_0x4c0bfb=_0x4c0bfb||0x1f4;return function(_0x4871a6){logger['error'](_0x4871a6[_0xb80a('0x34')]);if(_0x4871a6[_0xb80a('0x35')]){delete _0x4871a6['name'];}_0x434d0a[_0xb80a('0x29')](_0x4c0bfb)[_0xb80a('0x36')](_0x4871a6);};}exports[_0xb80a('0x37')]=function(_0x49318d,_0x53c098){var _0x5ab04d={},_0x219478={},_0x100be6={'count':0x0,'rows':[]};var _0x22c92e=_[_0xb80a('0x38')](db[_0xb80a('0x39')][_0xb80a('0x3a')],function(_0x4e826b){return{'name':_0x4e826b['fieldName'],'type':_0x4e826b['type'][_0xb80a('0x3b')]};});_0x219478[_0xb80a('0x3c')]=_[_0xb80a('0x38')](_0x22c92e,_0xb80a('0x35'));_0x219478['query']=_['keys'](_0x49318d[_0xb80a('0x3d')]);_0x219478['filters']=_['intersection'](_0x219478[_0xb80a('0x3c')],_0x219478[_0xb80a('0x3d')]);_0x5ab04d['attributes']=_[_0xb80a('0x3e')](_0x219478[_0xb80a('0x3c')],qs[_0xb80a('0x3f')](_0x49318d[_0xb80a('0x3d')][_0xb80a('0x3f')]));_0x5ab04d[_0xb80a('0x40')]=_0x5ab04d[_0xb80a('0x40')][_0xb80a('0x41')]?_0x5ab04d[_0xb80a('0x40')]:_0x219478[_0xb80a('0x3c')];if(!_0x49318d['query'][_0xb80a('0x42')](_0xb80a('0x43'))){_0x5ab04d[_0xb80a('0x2e')]=qs[_0xb80a('0x2e')](_0x49318d[_0xb80a('0x3d')]['limit']);_0x5ab04d[_0xb80a('0x2d')]=qs[_0xb80a('0x2d')](_0x49318d[_0xb80a('0x3d')][_0xb80a('0x2d')]);}_0x5ab04d[_0xb80a('0x44')]=qs[_0xb80a('0x45')](_0x49318d[_0xb80a('0x3d')]['sort']);_0x5ab04d[_0xb80a('0x46')]=qs['filters'](_['pick'](_0x49318d[_0xb80a('0x3d')],_0x219478[_0xb80a('0x47')]));if(_0x49318d[_0xb80a('0x3d')]['filter']){_0x5ab04d[_0xb80a('0x46')]=_[_0xb80a('0x48')](_0x5ab04d[_0xb80a('0x46')],{'$or':_[_0xb80a('0x38')](_0x22c92e,function(_0x2e5c7a){if(_0x2e5c7a[_0xb80a('0x49')]!==_0xb80a('0x4a')){var _0x22b287={};_0x22b287[_0x2e5c7a[_0xb80a('0x35')]]={'$like':'%'+_0x49318d[_0xb80a('0x3d')][_0xb80a('0x4b')]+'%'};return _0x22b287;}})});}_0x5ab04d=_[_0xb80a('0x48')]({},_0x5ab04d,_0x49318d[_0xb80a('0x4c')]);var _0x4eeacf={'where':_0x5ab04d[_0xb80a('0x46')]};return db[_0xb80a('0x39')][_0xb80a('0x2c')](_0x4eeacf)[_0xb80a('0x1e')](function(_0x4ff467){_0x100be6[_0xb80a('0x2c')]=_0x4ff467;if(_0x49318d[_0xb80a('0x3d')]['includeAll']){_0x5ab04d[_0xb80a('0x4d')]=[{'all':!![]}];}return db[_0xb80a('0x39')][_0xb80a('0x4e')](_0x5ab04d);})[_0xb80a('0x1e')](function(_0x15f608){_0x100be6[_0xb80a('0x4f')]=_0x15f608;return _0x100be6;})['then'](respondWithFilteredResult(_0x53c098,_0x5ab04d))[_0xb80a('0x27')](handleError(_0x53c098,null));};exports[_0xb80a('0x50')]=function(_0x34d648,_0x5c1968){var _0x4dbe4b={'raw':![],'where':{'id':_0x34d648[_0xb80a('0x51')]['id']}},_0x360ee2={};_0x360ee2[_0xb80a('0x3c')]=_[_0xb80a('0x52')](db[_0xb80a('0x39')]['rawAttributes']);_0x360ee2[_0xb80a('0x3d')]=_['keys'](_0x34d648['query']);_0x360ee2[_0xb80a('0x47')]=_[_0xb80a('0x3e')](_0x360ee2['model'],_0x360ee2[_0xb80a('0x3d')]);_0x4dbe4b[_0xb80a('0x40')]=_[_0xb80a('0x3e')](_0x360ee2[_0xb80a('0x3c')],qs[_0xb80a('0x3f')](_0x34d648['query'][_0xb80a('0x3f')]));_0x4dbe4b[_0xb80a('0x40')]=_0x4dbe4b[_0xb80a('0x40')][_0xb80a('0x41')]?_0x4dbe4b[_0xb80a('0x40')]:_0x360ee2[_0xb80a('0x3c')];if(_0x34d648[_0xb80a('0x3d')]['includeAll']){_0x4dbe4b[_0xb80a('0x4d')]=[{'all':!![]}];}_0x4dbe4b=_['merge']({},_0x4dbe4b,_0x34d648[_0xb80a('0x4c')]);return db['ServicenowAccount'][_0xb80a('0x53')](_0x4dbe4b)[_0xb80a('0x1e')](handleEntityNotFound(_0x5c1968,null))[_0xb80a('0x1e')](respondWithResult(_0x5c1968,null))['catch'](handleError(_0x5c1968,null));};exports[_0xb80a('0x54')]=function(_0x44e90c,_0x26a0e6){return db[_0xb80a('0x39')]['create'](_0x44e90c[_0xb80a('0x55')],{})[_0xb80a('0x1e')](respondWithResult(_0x26a0e6,0xc9))[_0xb80a('0x27')](handleError(_0x26a0e6,null));};exports[_0xb80a('0x32')]=function(_0x1656a1,_0x3dc523){if(_0x1656a1['body']['id']){delete _0x1656a1[_0xb80a('0x55')]['id'];}return db[_0xb80a('0x39')][_0xb80a('0x53')]({'where':{'id':_0x1656a1[_0xb80a('0x51')]['id']}})[_0xb80a('0x1e')](handleEntityNotFound(_0x3dc523,null))['then'](saveUpdates(_0x1656a1[_0xb80a('0x55')],null))[_0xb80a('0x1e')](respondWithResult(_0x3dc523,null))['catch'](handleError(_0x3dc523,null));};exports[_0xb80a('0x33')]=function(_0x4c0e1c,_0x49b42b){return db[_0xb80a('0x39')][_0xb80a('0x53')]({'where':{'id':_0x4c0e1c[_0xb80a('0x51')]['id']}})[_0xb80a('0x1e')](handleEntityNotFound(_0x49b42b,null))['then'](removeEntity(_0x49b42b,null))[_0xb80a('0x27')](handleError(_0x49b42b,null));};exports[_0xb80a('0x56')]=function(_0x3deaf9,_0x3f37a8,_0x5bc33e){var _0x264838={};var _0x92d15f={};var _0x45966b;var _0x2319ba;return db[_0xb80a('0x39')][_0xb80a('0x57')]({'where':{'id':_0x3deaf9['params']['id']}})[_0xb80a('0x1e')](handleEntityNotFound(_0x3f37a8,null))['then'](function(_0x5062f3){if(_0x5062f3){_0x45966b=_0x5062f3;_0x92d15f[_0xb80a('0x3c')]=_[_0xb80a('0x52')](db[_0xb80a('0x58')][_0xb80a('0x3a')]);_0x92d15f['query']=_['keys'](_0x3deaf9[_0xb80a('0x3d')]);_0x92d15f[_0xb80a('0x47')]=_['intersection'](_0x92d15f[_0xb80a('0x3c')],_0x92d15f[_0xb80a('0x3d')]);_0x264838[_0xb80a('0x40')]=_['intersection'](_0x92d15f['model'],qs[_0xb80a('0x3f')](_0x3deaf9[_0xb80a('0x3d')][_0xb80a('0x3f')]));_0x264838[_0xb80a('0x40')]=_0x264838['attributes'][_0xb80a('0x41')]?_0x264838[_0xb80a('0x40')]:_0x92d15f[_0xb80a('0x3c')];_0x264838['order']=qs[_0xb80a('0x45')](_0x3deaf9[_0xb80a('0x3d')][_0xb80a('0x45')]);_0x264838[_0xb80a('0x46')]=qs['filters'](_[_0xb80a('0x59')](_0x3deaf9[_0xb80a('0x3d')],_0x92d15f['filters']));if(_0x3deaf9[_0xb80a('0x3d')][_0xb80a('0x4b')]){_0x264838[_0xb80a('0x46')]=_['merge'](_0x264838[_0xb80a('0x46')],{'$or':_[_0xb80a('0x38')](_0x264838[_0xb80a('0x40')],function(_0x209880){var _0x4a442a={};_0x4a442a[_0x209880]={'$like':'%'+_0x3deaf9[_0xb80a('0x3d')]['filter']+'%'};return _0x4a442a;})});}_0x264838=_['merge']({},_0x264838,_0x3deaf9['options']);return _0x45966b[_0xb80a('0x56')](_0x264838);}})[_0xb80a('0x1e')](function(_0x2ccff0){if(_0x2ccff0){_0x2319ba=_0x2ccff0['length'];if(!_0x3deaf9[_0xb80a('0x3d')]['hasOwnProperty'](_0xb80a('0x43'))){_0x264838[_0xb80a('0x2e')]=qs[_0xb80a('0x2e')](_0x3deaf9[_0xb80a('0x3d')][_0xb80a('0x2e')]);_0x264838[_0xb80a('0x2d')]=qs[_0xb80a('0x2d')](_0x3deaf9['query'][_0xb80a('0x2d')]);}return _0x45966b[_0xb80a('0x56')](_0x264838);}})['then'](function(_0x255f82){if(_0x255f82){return _0x255f82?{'count':_0x2319ba,'rows':_0x255f82}:null;}})[_0xb80a('0x1e')](respondWithResult(_0x3f37a8,null))[_0xb80a('0x27')](handleError(_0x3f37a8,null));};exports['addConfiguration']=function(_0x5eee11,_0x409e39,_0x2a3322){if(_0x5eee11['body']['id']){delete _0x5eee11[_0xb80a('0x55')]['id'];}return db[_0xb80a('0x39')][_0xb80a('0x57')]({'where':{'id':_0x5eee11[_0xb80a('0x51')]['id']}})['then'](handleEntityNotFound(_0x409e39,null))[_0xb80a('0x1e')](function(_0x27196f){if(_0x27196f){_0x5eee11['body'][_0xb80a('0x5a')]=_0x27196f['id'];_0x5eee11['body'][_0xb80a('0x5b')]=integrations[_0xb80a('0x5c')](_0x5eee11[_0xb80a('0x55')]['channel'],_0x5eee11[_0xb80a('0x55')][_0xb80a('0x49')]);_0x5eee11[_0xb80a('0x55')][_0xb80a('0x5d')]=integrations['getDescriptions'](_0x5eee11['body'][_0xb80a('0x5e')],_0x5eee11[_0xb80a('0x55')][_0xb80a('0x49')]);return db['ServicenowConfiguration'][_0xb80a('0x54')](_0x5eee11[_0xb80a('0x55')],{'include':[{'model':db[_0xb80a('0x5f')],'as':_0xb80a('0x5b')},{'model':db[_0xb80a('0x5f')],'as':'Descriptions'}]});}return null;})[_0xb80a('0x1e')](respondWithResult(_0x409e39,null))[_0xb80a('0x27')](handleError(_0x409e39,null));};exports[_0xb80a('0x60')]=function(_0x2abb87,_0x3ae849,_0x3fcac6){var _0x32eab2=[_0xb80a('0x61'),_0xb80a('0x62'),_0xb80a('0x63'),'subcategory',_0xb80a('0x64'),'notify',_0xb80a('0x65'),_0xb80a('0x66'),_0xb80a('0x67')];var _0x14d3ef=[_0xb80a('0x68'),_0xb80a('0x61'),_0xb80a('0x69'),_0xb80a('0x6a'),_0xb80a('0x6b'),_0xb80a('0x6c'),_0xb80a('0x6d'),_0xb80a('0x62'),_0xb80a('0x6e'),'number','resolved_by',_0xb80a('0x6f'),_0xb80a('0x70'),'user_input',_0xb80a('0x71'),_0xb80a('0x72'),_0xb80a('0x73'),_0xb80a('0x74'),'knowledge',_0xb80a('0x44'),_0xb80a('0x75'),_0xb80a('0x76'),_0xb80a('0x77'),_0xb80a('0x78'),_0xb80a('0x79'),_0xb80a('0x7a'),'work_notes_list',_0xb80a('0x7b'),_0xb80a('0x7c'),_0xb80a('0x7d'),_0xb80a('0x7e'),_0xb80a('0x7f'),'expected_start',_0xb80a('0x80'),'business_duration',_0xb80a('0x81'),_0xb80a('0x82'),_0xb80a('0x83'),_0xb80a('0x84'),_0xb80a('0x85'),_0xb80a('0x86'),'subcategory',_0xb80a('0x87'),_0xb80a('0x88'),'close_code',_0xb80a('0x89'),_0xb80a('0x8a'),_0xb80a('0x8b'),_0xb80a('0x8c'),_0xb80a('0x8d'),_0xb80a('0x8e'),_0xb80a('0x8f'),_0xb80a('0x90'),'notify','sys_class_name',_0xb80a('0x91'),_0xb80a('0x92'),_0xb80a('0x93'),_0xb80a('0x94'),_0xb80a('0x95'),_0xb80a('0x96'),'reopened_by',_0xb80a('0x65'),_0xb80a('0x97'),'problem_id',_0xb80a('0x98'),_0xb80a('0x99'),_0xb80a('0x9a'),_0xb80a('0x9b'),_0xb80a('0x66'),_0xb80a('0x9c'),_0xb80a('0x9d'),_0xb80a('0x9e'),_0xb80a('0x9f'),_0xb80a('0xa0'),_0xb80a('0xa1'),_0xb80a('0xa2'),_0xb80a('0xa3'),'escalation',_0xb80a('0xa4'),'correlation_id','location',_0xb80a('0x67')];var _0x55d049='';var _0x3da40b='';var _0x3ad999=[];var _0x352299='';var _0x216a7b='';var _0x42f6d2=[];var _0x3a7cc0='';var _0x17d650='';var _0x260682={};var _0x204535='';return db[_0xb80a('0x39')]['findOne']({'where':{'id':_0x2abb87[_0xb80a('0x51')]['id']},'attributes':['id',_0xb80a('0xa5'),_0xb80a('0xa6'),_0xb80a('0xa7'),_0xb80a('0xa8'),'serverUrl']})[_0xb80a('0x1e')](handleEntityNotFound(_0x3ae849,null))['then'](function(_0x596a67){if(_0x596a67){_0x204535=_0x596a67[_0xb80a('0xa8')];var _0x28175f=_0x204535['slice'](-0x1);if(_0x28175f==='/'){_0x204535=_0x204535[_0xb80a('0xa9')](0x0,_0x204535[_0xb80a('0xaa')](_0x28175f));}_0x17d650=util[_0xb80a('0xab')](_0xb80a('0xac'),_0x204535);_0x3a7cc0=util['format'](_0xb80a('0xad'),_0x204535);_0x260682={'user':_0x596a67['username'],'pass':_0x596a67['password']};var _0x134dbe={'method':_0xb80a('0xae'),'uri':_0x17d650+'incident?sysparm_display_value=all','auth':_0x260682,'json':!![]};return rp(_0x134dbe);}})['then'](function(_0x5103c3){if(_0x5103c3[_0xb80a('0x26')][_0xb80a('0x41')]>0x0){_0x55d049=_0x5103c3[_0xb80a('0x26')];}console[_0xb80a('0xaf')](_0xb80a('0xb0'),_0x55d049);_0x42f6d2=[];_0x3da40b=Object[_0xb80a('0xb1')]([],_0x55d049);_[_0xb80a('0xb2')](_0x3da40b,function(_0x1190b6){return!_0x32eab2['includes'](_0x1190b6[_0xb80a('0x35')]);});_0x3da40b[_0xb80a('0xb3')](function(_0xebce1e){var _0xc4b435=createFieldObject(_0x3a7cc0,_0x260682,_0xebce1e[_0xb80a('0xb4')],_0xebce1e[_0xb80a('0x35')],_0xebce1e[_0xb80a('0xb5')],![]);_0x42f6d2[_0xb80a('0xb6')](_0xc4b435);});return Promise[_0xb80a('0xb7')](_0x42f6d2);})[_0xb80a('0x1e')](function(_0x3616d7){_0x3ad999=_0x3616d7;_0x352299=Object['assign']([],_0x55d049);console[_0xb80a('0xaf')]('TCL:\x20_object',_0x55d049);_[_0xb80a('0xb2')](_0x352299,function(_0x5eaad0){return _0x14d3ef[_0xb80a('0xb8')](_0x5eaad0[_0xb80a('0x35')]);});console[_0xb80a('0xaf')](_0xb80a('0xb9'),_0x352299);_0x42f6d2=[];_0x352299[_0xb80a('0xb3')](function(_0x229c61){var _0x10f21f=createFieldObject(_0x3a7cc0,_0x260682,_0x229c61['internalType'],_0x229c61[_0xb80a('0x35')],_0x229c61[_0xb80a('0xb5')],!![]);_0x42f6d2[_0xb80a('0xb6')](_0x10f21f);});return Promise[_0xb80a('0xb7')](_0x42f6d2);})['then'](function(_0x227b30){_0x216a7b=_0x227b30;var _0x3e69c6=_0x3ad999[_0xb80a('0xba')](_0x216a7b);return{'count':_0x3e69c6[_0xb80a('0x41')],'rows':_0x3e69c6};})[_0xb80a('0x1e')](respondWithResult(_0x3ae849,null))[_0xb80a('0x27')](function(_0x1a35b9){console['log'](_0xb80a('0xbb')+_0x1a35b9);var _0x5ee933=_0x2abb87[_0xb80a('0x3d')][_0xb80a('0x1b')]?0x1f4:_0x1a35b9[_0xb80a('0xbc')]||0x1f4;logger['error'](_0x1a35b9[_0xb80a('0x34')]);delete _0x1a35b9[_0xb80a('0x35')];if(_0x5ee933===0x191){_0x5ee933=0x190;}_0x3ae849[_0xb80a('0x29')](_0x5ee933)['send'](_0x2abb87['query'][_0xb80a('0x1b')]?{'message':_0xb80a('0xbd'),'statusCode':_0x1a35b9['statusCode']}:_0x1a35b9);});};function createFieldObject(_0x388612,_0x7064b9,_0x1ef005,_0x5cc073,_0x559c1b,_0x3e7c58){return new Promise(function(_0x77d9ca,_0x1b54ea){var _0x3422df={'id':_0x5cc073,'name':_0x559c1b,'custom':_0x3e7c58};if(_0x1ef005===_0xb80a('0xbe')){_0x3422df[_0xb80a('0x4c')]=[{'name':_0xb80a('0xbf'),'value':'true'},{'name':_0xb80a('0xc0'),'value':_0xb80a('0xc1')}];_0x77d9ca(_0x3422df);}else{var _0xe34026={'method':_0xb80a('0xae'),'uri':_0x388612+_0xb80a('0xc2')+_0x5cc073,'auth':_0x7064b9,'json':!![]};return rp(_0xe34026)[_0xb80a('0x1e')](function(_0x3801fb){var _0xb1cb34=[];if(_0x3801fb[_0xb80a('0x26')]['length']>0x0){_0x3801fb['result'][_0xb80a('0xb3')](function(_0x5d7dd4){if(_0x5d7dd4[_0xb80a('0xc3')]===_0xb80a('0xc1')){var _0x2a6359={'name':_0x5d7dd4['label'],'value':_0x5d7dd4[_0xb80a('0xc4')]};_0xb1cb34[_0xb80a('0xb6')](_0x2a6359);}});}_0x3422df[_0xb80a('0x4c')]=_0xb1cb34;if(_0x3422df[_0xb80a('0x4c')]['length']>0x0){_0x77d9ca(_0x3422df);}else{if(_0x3e7c58==![]){_0x77d9ca();}else{_0x77d9ca(_0x3422df);}}});}});}
\ No newline at end of file