Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / intServicenowConfiguration / intServicenowConfiguration.controller.js
index b81f415..c740b5c 100644 (file)
@@ -1 +1 @@
-const a299_0x5dfc=['findOne','findAll','Content-Range','name','../../mysqldb','attributes','sort','rawAttributes','getSubjects','model','index','limit','getDescriptions','include','where','order','length','map','sequelize','../../components/parsers/qs','ServicenowField','ServicenowConfiguration','fields','nolimit','merge','catch','options','stack','show','lodash','query','undefined','filter','includeAll','keys','update','send','../../config/logger','status','params','pick','VIRTUAL','count','json','destroy','then','like','create','filters','body','offset','key','getFields','intersection','set'];(function(_0x28a8e7,_0x5dfc69){const _0x5251a7=function(_0xc4f9a1){while(--_0xc4f9a1){_0x28a8e7['push'](_0x28a8e7['shift']());}};_0x5251a7(++_0x5dfc69);}(a299_0x5dfc,0x1d8));const a299_0x5251=function(_0x28a8e7,_0x5dfc69){_0x28a8e7=_0x28a8e7-0x0;let _0x5251a7=a299_0x5dfc[_0x28a8e7];return _0x5251a7;};const _0x12fae3=a299_0x5251;'use strict';const _=require(_0x12fae3('0x34')),qs=require(_0x12fae3('0x2a')),logger=require(_0x12fae3('0x5'))('api'),db=require(_0x12fae3('0x1b'))['db'],{Op}=require(_0x12fae3('0x29'));function respondWithResult(_0xc4f9a1,_0x465979){return _0x465979=_0x465979||0xc8,function(_0x5cabbb){const _0x3112ba=a299_0x5251;if(_0x5cabbb)return _0xc4f9a1['status'](_0x465979)[_0x3112ba('0xb')](_0x5cabbb);};}function respondWithFilteredResult(_0x547bac,_0x6ef78b){return function(_0x22dce0){const _0x20bf19=a299_0x5251;if(_0x22dce0){const _0x4d3a4f=_0x22dce0[_0x20bf19('0xa')],_0x464748=_0x6ef78b[_0x20bf19('0x12')];let _0x513a9e=_0x6ef78b[_0x20bf19('0x12')]+_0x6ef78b[_0x20bf19('0x22')],_0x6edb06;return _0x513a9e>=_0x4d3a4f?(_0x513a9e=_0x4d3a4f,_0x6edb06=0xc8):_0x6edb06=0xce,_0x547bac['status'](_0x6edb06),_0x547bac[_0x20bf19('0x16')](_0x20bf19('0x19'),_0x464748+'-'+_0x513a9e+'/'+_0x4d3a4f)['json'](_0x22dce0);}return null;};}function saveUpdates(_0x47defe){return function(_0x5f30a4){if(_0x5f30a4)return _0x5f30a4['update'](_0x47defe)['then'](function(_0x314d00){return _0x314d00;});return null;};}function removeEntity(_0xeb849a){return function(_0x32fb36){const _0x380ca6=a299_0x5251;if(_0x32fb36)return _0x32fb36[_0x380ca6('0xc')]()[_0x380ca6('0xd')](function(){const _0x10820a=_0x380ca6;_0xeb849a[_0x10820a('0x6')](0xcc)['end']();});};}function handleEntityNotFound(_0x842d5a){return function(_0x55342d){return!_0x55342d&&_0x842d5a['sendStatus'](0x194),_0x55342d;};}function handleError(_0x3f5e9c,_0x4ebfb5){return _0x4ebfb5=_0x4ebfb5||0x1f4,function(_0x86da75){const _0x4c6ae8=a299_0x5251;logger['error'](_0x86da75[_0x4c6ae8('0x32')]),_0x86da75[_0x4c6ae8('0x1a')]&&delete _0x86da75[_0x4c6ae8('0x1a')],_0x3f5e9c['status'](_0x4ebfb5)[_0x4c6ae8('0x4')](_0x86da75);};}exports[_0x12fae3('0x21')]=function(_0x4239d3,_0x326dc4){const _0x5ebc54=_0x12fae3;let _0x2e9016={};const _0x2564ca={},_0x59cc04={'count':0x0,'rows':[]},_0x474abc=_['map'](db['ServicenowConfiguration'][_0x5ebc54('0x1e')],function(_0x141b7f){const _0xf95213=_0x5ebc54;return{'name':_0x141b7f['fieldName'],'type':_0x141b7f['type'][_0xf95213('0x13')]};});_0x2564ca[_0x5ebc54('0x20')]=_['map'](_0x474abc,_0x5ebc54('0x1a')),_0x2564ca[_0x5ebc54('0x35')]=_['keys'](_0x4239d3['query']),_0x2564ca[_0x5ebc54('0x10')]=_['intersection'](_0x2564ca[_0x5ebc54('0x20')],_0x2564ca[_0x5ebc54('0x35')]),_0x2e9016['attributes']=_['intersection'](_0x2564ca['model'],qs[_0x5ebc54('0x2d')](_0x4239d3['query'][_0x5ebc54('0x2d')])),_0x2e9016[_0x5ebc54('0x1c')]=_0x2e9016[_0x5ebc54('0x1c')][_0x5ebc54('0x27')]?_0x2e9016[_0x5ebc54('0x1c')]:_0x2564ca[_0x5ebc54('0x20')];typeof _0x4239d3[_0x5ebc54('0x35')]['nolimit']===_0x5ebc54('0x36')&&(_0x2e9016[_0x5ebc54('0x22')]=qs[_0x5ebc54('0x22')](_0x4239d3[_0x5ebc54('0x35')][_0x5ebc54('0x22')]),_0x2e9016['offset']=qs[_0x5ebc54('0x12')](_0x4239d3['query'][_0x5ebc54('0x12')]));_0x2e9016[_0x5ebc54('0x26')]=qs[_0x5ebc54('0x1d')](_0x4239d3[_0x5ebc54('0x35')][_0x5ebc54('0x1d')]),_0x2e9016[_0x5ebc54('0x25')]=qs[_0x5ebc54('0x10')](_[_0x5ebc54('0x8')](_0x4239d3[_0x5ebc54('0x35')],_0x2564ca[_0x5ebc54('0x10')]),_0x474abc);_0x4239d3[_0x5ebc54('0x35')][_0x5ebc54('0x0')]&&(_0x2e9016[_0x5ebc54('0x25')]=_[_0x5ebc54('0x2f')](_0x2e9016[_0x5ebc54('0x25')],{[Op['or']]:_[_0x5ebc54('0x28')](_0x474abc,function(_0xb95a52){const _0x2259fe=_0x5ebc54;if(_0xb95a52['type']!==_0x2259fe('0x9')){const _0x5df2e7={};return _0x5df2e7[_0xb95a52[_0x2259fe('0x1a')]]={[Op[_0x2259fe('0xe')]]:'%'+_0x4239d3[_0x2259fe('0x35')][_0x2259fe('0x0')]+'%'},_0x5df2e7;}})}));_0x2e9016=_['merge']({},_0x2e9016,_0x4239d3[_0x5ebc54('0x31')]);const _0x262bf3={'where':_0x2e9016[_0x5ebc54('0x25')]};return db['ServicenowConfiguration'][_0x5ebc54('0xa')](_0x262bf3)[_0x5ebc54('0xd')](function(_0x339326){const _0x44bac4=_0x5ebc54;return _0x59cc04[_0x44bac4('0xa')]=_0x339326,_0x4239d3[_0x44bac4('0x35')][_0x44bac4('0x1')]&&(_0x2e9016['include']=[{'all':!![]}]),db[_0x44bac4('0x2c')][_0x44bac4('0x18')](_0x2e9016);})[_0x5ebc54('0xd')](function(_0x361e84){return _0x59cc04['rows']=_0x361e84,_0x59cc04;})[_0x5ebc54('0xd')](respondWithFilteredResult(_0x326dc4,_0x2e9016))['catch'](handleError(_0x326dc4,null));},exports[_0x12fae3('0x33')]=function(_0x472e23,_0xdc6c4e){const _0x35063a=_0x12fae3;let _0x366e9e={'raw':![],'where':{'id':_0x472e23['params']['id']}};const _0x3a3a82={};return _0x3a3a82['model']=_[_0x35063a('0x2')](db[_0x35063a('0x2c')][_0x35063a('0x1e')]),_0x3a3a82['query']=_[_0x35063a('0x2')](_0x472e23[_0x35063a('0x35')]),_0x3a3a82[_0x35063a('0x10')]=_['intersection'](_0x3a3a82['model'],_0x3a3a82[_0x35063a('0x35')]),_0x366e9e['attributes']=_[_0x35063a('0x15')](_0x3a3a82[_0x35063a('0x20')],qs[_0x35063a('0x2d')](_0x472e23[_0x35063a('0x35')][_0x35063a('0x2d')])),_0x366e9e[_0x35063a('0x1c')]=_0x366e9e[_0x35063a('0x1c')][_0x35063a('0x27')]?_0x366e9e[_0x35063a('0x1c')]:_0x3a3a82[_0x35063a('0x20')],_0x472e23['query'][_0x35063a('0x1')]&&(_0x366e9e[_0x35063a('0x24')]=[{'all':!![]}]),_0x366e9e=_['merge']({},_0x366e9e,_0x472e23[_0x35063a('0x31')]),db['ServicenowConfiguration'][_0x35063a('0x17')](_0x366e9e)[_0x35063a('0xd')](handleEntityNotFound(_0xdc6c4e,null))[_0x35063a('0xd')](respondWithResult(_0xdc6c4e,null))[_0x35063a('0x30')](handleError(_0xdc6c4e,null));},exports['create']=function(_0x5b381f,_0x271db1){const _0x5390b9=_0x12fae3;return db['ServicenowConfiguration'][_0x5390b9('0xf')](_0x5b381f[_0x5390b9('0x11')],{})['then'](respondWithResult(_0x271db1,0xc9))[_0x5390b9('0x30')](handleError(_0x271db1,null));},exports[_0x12fae3('0x3')]=function(_0x32e2cf,_0x439577){const _0x4969c3=_0x12fae3;return _0x32e2cf[_0x4969c3('0x11')]['id']&&delete _0x32e2cf[_0x4969c3('0x11')]['id'],db[_0x4969c3('0x2c')]['findOne']({'where':{'id':_0x32e2cf[_0x4969c3('0x7')]['id']}})[_0x4969c3('0xd')](handleEntityNotFound(_0x439577,null))[_0x4969c3('0xd')](saveUpdates(_0x32e2cf[_0x4969c3('0x11')],null))['then'](respondWithResult(_0x439577,null))['catch'](handleError(_0x439577,null));},exports[_0x12fae3('0xc')]=function(_0x2d1415,_0x295526){const _0x12c967=_0x12fae3;return db[_0x12c967('0x2c')][_0x12c967('0x17')]({'where':{'id':_0x2d1415[_0x12c967('0x7')]['id']}})[_0x12c967('0xd')](handleEntityNotFound(_0x295526,null))[_0x12c967('0xd')](removeEntity(_0x295526,null))[_0x12c967('0x30')](handleError(_0x295526,null));},exports[_0x12fae3('0x14')]=function(_0x459bba,_0x46e34e){const _0x37e7c2=_0x12fae3;let _0xdec2f6={};const _0x3ea28f={};let _0x22f1ca,_0x4736ab;return db[_0x37e7c2('0x2c')]['findOne']({'where':{'id':_0x459bba[_0x37e7c2('0x7')]['id']}})[_0x37e7c2('0xd')](handleEntityNotFound(_0x46e34e,null))[_0x37e7c2('0xd')](function(_0x3a4302){const _0x142adc=_0x37e7c2;if(_0x3a4302)return _0x22f1ca=_0x3a4302,_0x3ea28f[_0x142adc('0x20')]=_[_0x142adc('0x2')](db[_0x142adc('0x2b')][_0x142adc('0x1e')]),_0x3ea28f[_0x142adc('0x35')]=_[_0x142adc('0x2')](_0x459bba[_0x142adc('0x35')]),_0x3ea28f[_0x142adc('0x10')]=_[_0x142adc('0x15')](_0x3ea28f[_0x142adc('0x20')],_0x3ea28f[_0x142adc('0x35')]),_0xdec2f6[_0x142adc('0x1c')]=_[_0x142adc('0x15')](_0x3ea28f['model'],qs[_0x142adc('0x2d')](_0x459bba[_0x142adc('0x35')][_0x142adc('0x2d')])),_0xdec2f6['attributes']=_0xdec2f6[_0x142adc('0x1c')][_0x142adc('0x27')]?_0xdec2f6[_0x142adc('0x1c')]:_0x3ea28f['model'],_0xdec2f6[_0x142adc('0x26')]=qs[_0x142adc('0x1d')](_0x459bba[_0x142adc('0x35')][_0x142adc('0x1d')]),_0xdec2f6[_0x142adc('0x25')]=qs['filters'](_[_0x142adc('0x8')](_0x459bba[_0x142adc('0x35')],_0x3ea28f[_0x142adc('0x10')])),_0x459bba['query']['filter']&&(_0xdec2f6[_0x142adc('0x25')]=_[_0x142adc('0x2f')](_0xdec2f6['where'],{[Op['or']]:_[_0x142adc('0x28')](_0xdec2f6[_0x142adc('0x1c')],function(_0x391bfe){const _0x313a98=_0x142adc,_0x4ef7a1={};return _0x4ef7a1[_0x391bfe]={[Op[_0x313a98('0xe')]]:'%'+_0x459bba[_0x313a98('0x35')]['filter']+'%'},_0x4ef7a1;})})),_0xdec2f6=_[_0x142adc('0x2f')]({},_0xdec2f6,_0x459bba[_0x142adc('0x31')]),_0x22f1ca[_0x142adc('0x14')](_0xdec2f6);})['then'](function(_0x42b1fa){const _0x499a5f=_0x37e7c2;if(_0x42b1fa)return _0x4736ab=_0x42b1fa['length'],typeof _0x459bba['query'][_0x499a5f('0x2e')]===_0x499a5f('0x36')&&(_0xdec2f6[_0x499a5f('0x22')]=qs[_0x499a5f('0x22')](_0x459bba[_0x499a5f('0x35')][_0x499a5f('0x22')]),_0xdec2f6[_0x499a5f('0x12')]=qs[_0x499a5f('0x12')](_0x459bba['query'][_0x499a5f('0x12')])),_0x22f1ca[_0x499a5f('0x14')](_0xdec2f6);})['then'](function(_0x1e2f60){if(_0x1e2f60)return _0x1e2f60?{'count':_0x4736ab,'rows':_0x1e2f60}:null;})[_0x37e7c2('0xd')](respondWithResult(_0x46e34e,null))['catch'](handleError(_0x46e34e,null));},exports['getSubjects']=function(_0x30b803,_0x5a0c5b){const _0x197e55=_0x12fae3;let _0x2e7b41={};const _0x4ed8c8={};let _0x4f4803,_0x1f602e;return db[_0x197e55('0x2c')][_0x197e55('0x17')]({'where':{'id':_0x30b803['params']['id']}})[_0x197e55('0xd')](handleEntityNotFound(_0x5a0c5b,null))[_0x197e55('0xd')](function(_0x485819){const _0x5abc07=_0x197e55;if(_0x485819)return _0x4f4803=_0x485819,_0x4ed8c8[_0x5abc07('0x20')]=_[_0x5abc07('0x2')](db[_0x5abc07('0x2b')][_0x5abc07('0x1e')]),_0x4ed8c8['query']=_[_0x5abc07('0x2')](_0x30b803[_0x5abc07('0x35')]),_0x4ed8c8[_0x5abc07('0x10')]=_['intersection'](_0x4ed8c8[_0x5abc07('0x20')],_0x4ed8c8[_0x5abc07('0x35')]),_0x2e7b41[_0x5abc07('0x1c')]=_[_0x5abc07('0x15')](_0x4ed8c8[_0x5abc07('0x20')],qs['fields'](_0x30b803[_0x5abc07('0x35')]['fields'])),_0x2e7b41[_0x5abc07('0x1c')]=_0x2e7b41[_0x5abc07('0x1c')][_0x5abc07('0x27')]?_0x2e7b41[_0x5abc07('0x1c')]:_0x4ed8c8[_0x5abc07('0x20')],_0x2e7b41['order']=qs[_0x5abc07('0x1d')](_0x30b803[_0x5abc07('0x35')][_0x5abc07('0x1d')]),_0x2e7b41[_0x5abc07('0x25')]=qs[_0x5abc07('0x10')](_[_0x5abc07('0x8')](_0x30b803['query'],_0x4ed8c8[_0x5abc07('0x10')])),_0x30b803['query'][_0x5abc07('0x0')]&&(_0x2e7b41[_0x5abc07('0x25')]=_['merge'](_0x2e7b41[_0x5abc07('0x25')],{[Op['or']]:_[_0x5abc07('0x28')](_0x2e7b41['attributes'],function(_0xff72d5){const _0x50fc45=_0x5abc07,_0x4b32ab={};return _0x4b32ab[_0xff72d5]={[Op[_0x50fc45('0xe')]]:'%'+_0x30b803[_0x50fc45('0x35')][_0x50fc45('0x0')]+'%'},_0x4b32ab;})})),_0x2e7b41=_[_0x5abc07('0x2f')]({},_0x2e7b41,_0x30b803['options']),_0x4f4803[_0x5abc07('0x1f')](_0x2e7b41);})[_0x197e55('0xd')](function(_0x1a130b){const _0x2ae53c=_0x197e55;if(_0x1a130b)return _0x1f602e=_0x1a130b['length'],typeof _0x30b803[_0x2ae53c('0x35')]['nolimit']==='undefined'&&(_0x2e7b41[_0x2ae53c('0x22')]=qs[_0x2ae53c('0x22')](_0x30b803['query'][_0x2ae53c('0x22')]),_0x2e7b41['offset']=qs[_0x2ae53c('0x12')](_0x30b803[_0x2ae53c('0x35')]['offset'])),_0x4f4803['getSubjects'](_0x2e7b41);})[_0x197e55('0xd')](function(_0x3b81c6){if(_0x3b81c6)return _0x3b81c6?{'count':_0x1f602e,'rows':_0x3b81c6}:null;})[_0x197e55('0xd')](respondWithResult(_0x5a0c5b,null))[_0x197e55('0x30')](handleError(_0x5a0c5b,null));},exports[_0x12fae3('0x23')]=function(_0x206146,_0x14e0bc){const _0x4bc246=_0x12fae3;let _0xe8bdd7={};const _0x3afb88={};let _0x1d5814,_0x5345c7;return db[_0x4bc246('0x2c')][_0x4bc246('0x17')]({'where':{'id':_0x206146[_0x4bc246('0x7')]['id']}})[_0x4bc246('0xd')](handleEntityNotFound(_0x14e0bc,null))['then'](function(_0x17c556){const _0x1745be=_0x4bc246;if(_0x17c556)return _0x1d5814=_0x17c556,_0x3afb88[_0x1745be('0x20')]=_['keys'](db[_0x1745be('0x2b')][_0x1745be('0x1e')]),_0x3afb88['query']=_[_0x1745be('0x2')](_0x206146[_0x1745be('0x35')]),_0x3afb88[_0x1745be('0x10')]=_[_0x1745be('0x15')](_0x3afb88['model'],_0x3afb88['query']),_0xe8bdd7[_0x1745be('0x1c')]=_[_0x1745be('0x15')](_0x3afb88[_0x1745be('0x20')],qs[_0x1745be('0x2d')](_0x206146[_0x1745be('0x35')][_0x1745be('0x2d')])),_0xe8bdd7[_0x1745be('0x1c')]=_0xe8bdd7[_0x1745be('0x1c')][_0x1745be('0x27')]?_0xe8bdd7[_0x1745be('0x1c')]:_0x3afb88['model'],_0xe8bdd7[_0x1745be('0x26')]=qs[_0x1745be('0x1d')](_0x206146[_0x1745be('0x35')][_0x1745be('0x1d')]),_0xe8bdd7[_0x1745be('0x25')]=qs['filters'](_[_0x1745be('0x8')](_0x206146[_0x1745be('0x35')],_0x3afb88[_0x1745be('0x10')])),_0x206146[_0x1745be('0x35')][_0x1745be('0x0')]&&(_0xe8bdd7[_0x1745be('0x25')]=_['merge'](_0xe8bdd7[_0x1745be('0x25')],{[Op['or']]:_[_0x1745be('0x28')](_0xe8bdd7['attributes'],function(_0x39d872){const _0x2f5199=_0x1745be,_0x3325cb={};return _0x3325cb[_0x39d872]={[Op[_0x2f5199('0xe')]]:'%'+_0x206146['query'][_0x2f5199('0x0')]+'%'},_0x3325cb;})})),_0xe8bdd7=_[_0x1745be('0x2f')]({},_0xe8bdd7,_0x206146[_0x1745be('0x31')]),_0x1d5814['getDescriptions'](_0xe8bdd7);})[_0x4bc246('0xd')](function(_0x18c002){const _0x2892f1=_0x4bc246;if(_0x18c002)return _0x5345c7=_0x18c002['length'],typeof _0x206146[_0x2892f1('0x35')][_0x2892f1('0x2e')]===_0x2892f1('0x36')&&(_0xe8bdd7[_0x2892f1('0x22')]=qs[_0x2892f1('0x22')](_0x206146[_0x2892f1('0x35')][_0x2892f1('0x22')]),_0xe8bdd7[_0x2892f1('0x12')]=qs[_0x2892f1('0x12')](_0x206146[_0x2892f1('0x35')][_0x2892f1('0x12')])),_0x1d5814['getDescriptions'](_0xe8bdd7);})[_0x4bc246('0xd')](function(_0x3fb445){if(_0x3fb445)return _0x3fb445?{'count':_0x5345c7,'rows':_0x3fb445}:null;})[_0x4bc246('0xd')](respondWithResult(_0x14e0bc,null))[_0x4bc246('0x30')](handleError(_0x14e0bc,null));};
\ No newline at end of file
+const a299_0x43ea=['getFields','getDescriptions','rawAttributes','options','../../mysqldb','count','then','like','json','end','findAll','getSubjects','fieldName','sort','show','status','VIRTUAL','includeAll','filters','length','error','name','where','limit','model','offset','create','sendStatus','send','rows','pick','keys','findOne','ServicenowField','body','set','params','stack','catch','Content-Range','key','fields','update','nolimit','merge','sequelize','type','attributes','ServicenowConfiguration','api','intersection','query','undefined','filter','order','destroy','map'];(function(_0x23d4ee,_0x43ea4b){const _0x22fe88=function(_0x22fea0){while(--_0x22fea0){_0x23d4ee['push'](_0x23d4ee['shift']());}};_0x22fe88(++_0x43ea4b);}(a299_0x43ea,0xdf));const a299_0x22fe=function(_0x23d4ee,_0x43ea4b){_0x23d4ee=_0x23d4ee-0x0;let _0x22fe88=a299_0x43ea[_0x23d4ee];return _0x22fe88;};const _0x2461fc=a299_0x22fe;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x2461fc('0x36')),db=require(_0x2461fc('0x9'))['db'],{Op}=require(_0x2461fc('0x32'));function respondWithResult(_0x22fea0,_0x5a5d04){return _0x5a5d04=_0x5a5d04||0xc8,function(_0x8e97a9){const _0x3de713=a299_0x22fe;if(_0x8e97a9)return _0x22fea0['status'](_0x5a5d04)[_0x3de713('0xd')](_0x8e97a9);};}function respondWithFilteredResult(_0x429178,_0x173087){return function(_0x434e47){const _0x5db8f2=a299_0x22fe;if(_0x434e47){const _0x342ab9=_0x434e47[_0x5db8f2('0xa')],_0x1e0fb6=_0x173087[_0x5db8f2('0x1e')];let _0x1a902c=_0x173087[_0x5db8f2('0x1e')]+_0x173087[_0x5db8f2('0x1c')],_0x68231;return _0x1a902c>=_0x342ab9?(_0x1a902c=_0x342ab9,_0x68231=0xc8):_0x68231=0xce,_0x429178['status'](_0x68231),_0x429178[_0x5db8f2('0x28')](_0x5db8f2('0x2c'),_0x1e0fb6+'-'+_0x1a902c+'/'+_0x342ab9)[_0x5db8f2('0xd')](_0x434e47);}return null;};}function saveUpdates(_0x4ab640){return function(_0x5167a0){const _0x474cff=a299_0x22fe;if(_0x5167a0)return _0x5167a0[_0x474cff('0x2f')](_0x4ab640)[_0x474cff('0xb')](function(_0x4fd1c0){return _0x4fd1c0;});return null;};}function removeEntity(_0x1e6116){return function(_0x1fdc05){const _0x5ee068=a299_0x22fe;if(_0x1fdc05)return _0x1fdc05[_0x5ee068('0x3')]()['then'](function(){const _0x13deba=_0x5ee068;_0x1e6116['status'](0xcc)[_0x13deba('0xe')]();});};}function handleEntityNotFound(_0xfd3206){return function(_0x51de16){const _0x3fe636=a299_0x22fe;return!_0x51de16&&_0xfd3206[_0x3fe636('0x20')](0x194),_0x51de16;};}function handleError(_0xe4c93b,_0x52dc1b){return _0x52dc1b=_0x52dc1b||0x1f4,function(_0x2acfdf){const _0x38cff0=a299_0x22fe;logger[_0x38cff0('0x19')](_0x2acfdf[_0x38cff0('0x2a')]),_0x2acfdf[_0x38cff0('0x1a')]&&delete _0x2acfdf[_0x38cff0('0x1a')],_0xe4c93b[_0x38cff0('0x14')](_0x52dc1b)[_0x38cff0('0x21')](_0x2acfdf);};}exports['index']=function(_0x3b5e82,_0x2b8456){const _0x664610=_0x2461fc;let _0x1482a6={};const _0x515fe6={},_0x388639={'count':0x0,'rows':[]},_0x29ceca=_[_0x664610('0x4')](db[_0x664610('0x35')][_0x664610('0x7')],function(_0x37bdd5){const _0x4298a5=_0x664610;return{'name':_0x37bdd5[_0x4298a5('0x11')],'type':_0x37bdd5[_0x4298a5('0x33')][_0x4298a5('0x2d')]};});_0x515fe6[_0x664610('0x1d')]=_[_0x664610('0x4')](_0x29ceca,'name'),_0x515fe6[_0x664610('0x38')]=_['keys'](_0x3b5e82[_0x664610('0x38')]),_0x515fe6[_0x664610('0x17')]=_['intersection'](_0x515fe6[_0x664610('0x1d')],_0x515fe6[_0x664610('0x38')]),_0x1482a6['attributes']=_['intersection'](_0x515fe6['model'],qs[_0x664610('0x2e')](_0x3b5e82[_0x664610('0x38')]['fields'])),_0x1482a6[_0x664610('0x34')]=_0x1482a6[_0x664610('0x34')][_0x664610('0x18')]?_0x1482a6[_0x664610('0x34')]:_0x515fe6[_0x664610('0x1d')];typeof _0x3b5e82[_0x664610('0x38')][_0x664610('0x30')]===_0x664610('0x0')&&(_0x1482a6[_0x664610('0x1c')]=qs[_0x664610('0x1c')](_0x3b5e82[_0x664610('0x38')][_0x664610('0x1c')]),_0x1482a6[_0x664610('0x1e')]=qs[_0x664610('0x1e')](_0x3b5e82[_0x664610('0x38')][_0x664610('0x1e')]));_0x1482a6[_0x664610('0x2')]=qs[_0x664610('0x12')](_0x3b5e82[_0x664610('0x38')][_0x664610('0x12')]),_0x1482a6[_0x664610('0x1b')]=qs[_0x664610('0x17')](_['pick'](_0x3b5e82[_0x664610('0x38')],_0x515fe6[_0x664610('0x17')]),_0x29ceca);_0x3b5e82[_0x664610('0x38')][_0x664610('0x1')]&&(_0x1482a6[_0x664610('0x1b')]=_['merge'](_0x1482a6[_0x664610('0x1b')],{[Op['or']]:_['map'](_0x29ceca,function(_0x2f0e6a){const _0x2139d4=_0x664610;if(_0x2f0e6a[_0x2139d4('0x33')]!==_0x2139d4('0x15')){const _0x14e129={};return _0x14e129[_0x2f0e6a['name']]={[Op['like']]:'%'+_0x3b5e82['query'][_0x2139d4('0x1')]+'%'},_0x14e129;}})}));_0x1482a6=_['merge']({},_0x1482a6,_0x3b5e82[_0x664610('0x8')]);const _0x20ac1={'where':_0x1482a6[_0x664610('0x1b')]};return db[_0x664610('0x35')][_0x664610('0xa')](_0x20ac1)[_0x664610('0xb')](function(_0x26f47a){const _0x4d1cdc=_0x664610;return _0x388639[_0x4d1cdc('0xa')]=_0x26f47a,_0x3b5e82[_0x4d1cdc('0x38')][_0x4d1cdc('0x16')]&&(_0x1482a6['include']=[{'all':!![]}]),db[_0x4d1cdc('0x35')][_0x4d1cdc('0xf')](_0x1482a6);})[_0x664610('0xb')](function(_0x544eb1){const _0x19b1aa=_0x664610;return _0x388639[_0x19b1aa('0x22')]=_0x544eb1,_0x388639;})[_0x664610('0xb')](respondWithFilteredResult(_0x2b8456,_0x1482a6))['catch'](handleError(_0x2b8456,null));},exports[_0x2461fc('0x13')]=function(_0x150d0e,_0x3aeccb){const _0x400265=_0x2461fc;let _0x3410ae={'raw':![],'where':{'id':_0x150d0e['params']['id']}};const _0x57ca97={};return _0x57ca97[_0x400265('0x1d')]=_['keys'](db[_0x400265('0x35')]['rawAttributes']),_0x57ca97[_0x400265('0x38')]=_[_0x400265('0x24')](_0x150d0e[_0x400265('0x38')]),_0x57ca97[_0x400265('0x17')]=_[_0x400265('0x37')](_0x57ca97['model'],_0x57ca97[_0x400265('0x38')]),_0x3410ae[_0x400265('0x34')]=_['intersection'](_0x57ca97['model'],qs[_0x400265('0x2e')](_0x150d0e[_0x400265('0x38')][_0x400265('0x2e')])),_0x3410ae[_0x400265('0x34')]=_0x3410ae['attributes'][_0x400265('0x18')]?_0x3410ae['attributes']:_0x57ca97[_0x400265('0x1d')],_0x150d0e[_0x400265('0x38')][_0x400265('0x16')]&&(_0x3410ae['include']=[{'all':!![]}]),_0x3410ae=_[_0x400265('0x31')]({},_0x3410ae,_0x150d0e[_0x400265('0x8')]),db[_0x400265('0x35')]['findOne'](_0x3410ae)[_0x400265('0xb')](handleEntityNotFound(_0x3aeccb,null))[_0x400265('0xb')](respondWithResult(_0x3aeccb,null))[_0x400265('0x2b')](handleError(_0x3aeccb,null));},exports[_0x2461fc('0x1f')]=function(_0x51b5f3,_0x4dfebe){const _0x47131f=_0x2461fc;return db['ServicenowConfiguration'][_0x47131f('0x1f')](_0x51b5f3['body'],{})[_0x47131f('0xb')](respondWithResult(_0x4dfebe,0xc9))['catch'](handleError(_0x4dfebe,null));},exports[_0x2461fc('0x2f')]=function(_0x269824,_0xfafb20){const _0x23531c=_0x2461fc;return _0x269824[_0x23531c('0x27')]['id']&&delete _0x269824['body']['id'],db[_0x23531c('0x35')]['findOne']({'where':{'id':_0x269824[_0x23531c('0x29')]['id']}})['then'](handleEntityNotFound(_0xfafb20,null))['then'](saveUpdates(_0x269824[_0x23531c('0x27')],null))[_0x23531c('0xb')](respondWithResult(_0xfafb20,null))['catch'](handleError(_0xfafb20,null));},exports[_0x2461fc('0x3')]=function(_0x219fc1,_0x371d9c){const _0x28d173=_0x2461fc;return db[_0x28d173('0x35')][_0x28d173('0x25')]({'where':{'id':_0x219fc1[_0x28d173('0x29')]['id']}})[_0x28d173('0xb')](handleEntityNotFound(_0x371d9c,null))['then'](removeEntity(_0x371d9c,null))[_0x28d173('0x2b')](handleError(_0x371d9c,null));},exports[_0x2461fc('0x5')]=function(_0x5ec74f,_0x4c31a1){const _0x4eb2f3=_0x2461fc;let _0x540ffd={};const _0x23d52f={};let _0x115edc,_0x55a3b7;return db['ServicenowConfiguration'][_0x4eb2f3('0x25')]({'where':{'id':_0x5ec74f[_0x4eb2f3('0x29')]['id']}})['then'](handleEntityNotFound(_0x4c31a1,null))[_0x4eb2f3('0xb')](function(_0x3d8cae){const _0x39de17=_0x4eb2f3;if(_0x3d8cae)return _0x115edc=_0x3d8cae,_0x23d52f[_0x39de17('0x1d')]=_[_0x39de17('0x24')](db[_0x39de17('0x26')][_0x39de17('0x7')]),_0x23d52f[_0x39de17('0x38')]=_[_0x39de17('0x24')](_0x5ec74f[_0x39de17('0x38')]),_0x23d52f[_0x39de17('0x17')]=_[_0x39de17('0x37')](_0x23d52f[_0x39de17('0x1d')],_0x23d52f[_0x39de17('0x38')]),_0x540ffd[_0x39de17('0x34')]=_['intersection'](_0x23d52f[_0x39de17('0x1d')],qs[_0x39de17('0x2e')](_0x5ec74f['query']['fields'])),_0x540ffd[_0x39de17('0x34')]=_0x540ffd[_0x39de17('0x34')]['length']?_0x540ffd[_0x39de17('0x34')]:_0x23d52f[_0x39de17('0x1d')],_0x540ffd[_0x39de17('0x2')]=qs[_0x39de17('0x12')](_0x5ec74f[_0x39de17('0x38')][_0x39de17('0x12')]),_0x540ffd[_0x39de17('0x1b')]=qs[_0x39de17('0x17')](_[_0x39de17('0x23')](_0x5ec74f[_0x39de17('0x38')],_0x23d52f['filters'])),_0x5ec74f[_0x39de17('0x38')][_0x39de17('0x1')]&&(_0x540ffd[_0x39de17('0x1b')]=_['merge'](_0x540ffd[_0x39de17('0x1b')],{[Op['or']]:_[_0x39de17('0x4')](_0x540ffd[_0x39de17('0x34')],function(_0x5d5719){const _0x2f3e4b=_0x39de17,_0x50ec33={};return _0x50ec33[_0x5d5719]={[Op[_0x2f3e4b('0xc')]]:'%'+_0x5ec74f[_0x2f3e4b('0x38')]['filter']+'%'},_0x50ec33;})})),_0x540ffd=_[_0x39de17('0x31')]({},_0x540ffd,_0x5ec74f[_0x39de17('0x8')]),_0x115edc[_0x39de17('0x5')](_0x540ffd);})[_0x4eb2f3('0xb')](function(_0x406df5){const _0x50eb96=_0x4eb2f3;if(_0x406df5)return _0x55a3b7=_0x406df5['length'],typeof _0x5ec74f[_0x50eb96('0x38')][_0x50eb96('0x30')]===_0x50eb96('0x0')&&(_0x540ffd[_0x50eb96('0x1c')]=qs[_0x50eb96('0x1c')](_0x5ec74f[_0x50eb96('0x38')][_0x50eb96('0x1c')]),_0x540ffd[_0x50eb96('0x1e')]=qs['offset'](_0x5ec74f[_0x50eb96('0x38')][_0x50eb96('0x1e')])),_0x115edc[_0x50eb96('0x5')](_0x540ffd);})[_0x4eb2f3('0xb')](function(_0x4be8d7){if(_0x4be8d7)return _0x4be8d7?{'count':_0x55a3b7,'rows':_0x4be8d7}:null;})[_0x4eb2f3('0xb')](respondWithResult(_0x4c31a1,null))[_0x4eb2f3('0x2b')](handleError(_0x4c31a1,null));},exports[_0x2461fc('0x10')]=function(_0xc693a1,_0x5aaf14){const _0x418de6=_0x2461fc;let _0x423ae6={};const _0x368a30={};let _0x116885,_0x2f9009;return db['ServicenowConfiguration'][_0x418de6('0x25')]({'where':{'id':_0xc693a1[_0x418de6('0x29')]['id']}})['then'](handleEntityNotFound(_0x5aaf14,null))[_0x418de6('0xb')](function(_0x1ed14f){const _0x1f4c76=_0x418de6;if(_0x1ed14f)return _0x116885=_0x1ed14f,_0x368a30[_0x1f4c76('0x1d')]=_[_0x1f4c76('0x24')](db[_0x1f4c76('0x26')][_0x1f4c76('0x7')]),_0x368a30[_0x1f4c76('0x38')]=_[_0x1f4c76('0x24')](_0xc693a1[_0x1f4c76('0x38')]),_0x368a30[_0x1f4c76('0x17')]=_['intersection'](_0x368a30[_0x1f4c76('0x1d')],_0x368a30[_0x1f4c76('0x38')]),_0x423ae6[_0x1f4c76('0x34')]=_[_0x1f4c76('0x37')](_0x368a30[_0x1f4c76('0x1d')],qs[_0x1f4c76('0x2e')](_0xc693a1[_0x1f4c76('0x38')]['fields'])),_0x423ae6[_0x1f4c76('0x34')]=_0x423ae6[_0x1f4c76('0x34')]['length']?_0x423ae6[_0x1f4c76('0x34')]:_0x368a30[_0x1f4c76('0x1d')],_0x423ae6[_0x1f4c76('0x2')]=qs[_0x1f4c76('0x12')](_0xc693a1[_0x1f4c76('0x38')][_0x1f4c76('0x12')]),_0x423ae6[_0x1f4c76('0x1b')]=qs[_0x1f4c76('0x17')](_[_0x1f4c76('0x23')](_0xc693a1['query'],_0x368a30[_0x1f4c76('0x17')])),_0xc693a1[_0x1f4c76('0x38')]['filter']&&(_0x423ae6[_0x1f4c76('0x1b')]=_[_0x1f4c76('0x31')](_0x423ae6[_0x1f4c76('0x1b')],{[Op['or']]:_[_0x1f4c76('0x4')](_0x423ae6[_0x1f4c76('0x34')],function(_0x11a043){const _0x29e7e2=_0x1f4c76,_0x10823a={};return _0x10823a[_0x11a043]={[Op['like']]:'%'+_0xc693a1[_0x29e7e2('0x38')]['filter']+'%'},_0x10823a;})})),_0x423ae6=_['merge']({},_0x423ae6,_0xc693a1[_0x1f4c76('0x8')]),_0x116885[_0x1f4c76('0x10')](_0x423ae6);})[_0x418de6('0xb')](function(_0x55d168){const _0x210f1d=_0x418de6;if(_0x55d168)return _0x2f9009=_0x55d168['length'],typeof _0xc693a1['query'][_0x210f1d('0x30')]===_0x210f1d('0x0')&&(_0x423ae6[_0x210f1d('0x1c')]=qs[_0x210f1d('0x1c')](_0xc693a1[_0x210f1d('0x38')]['limit']),_0x423ae6[_0x210f1d('0x1e')]=qs[_0x210f1d('0x1e')](_0xc693a1['query'][_0x210f1d('0x1e')])),_0x116885[_0x210f1d('0x10')](_0x423ae6);})['then'](function(_0x1661f6){if(_0x1661f6)return _0x1661f6?{'count':_0x2f9009,'rows':_0x1661f6}:null;})['then'](respondWithResult(_0x5aaf14,null))[_0x418de6('0x2b')](handleError(_0x5aaf14,null));},exports[_0x2461fc('0x6')]=function(_0x1200af,_0x4d2a54){const _0x254ae8=_0x2461fc;let _0x3c7aab={};const _0x420942={};let _0x1e7db5,_0x138e8c;return db[_0x254ae8('0x35')]['findOne']({'where':{'id':_0x1200af[_0x254ae8('0x29')]['id']}})[_0x254ae8('0xb')](handleEntityNotFound(_0x4d2a54,null))[_0x254ae8('0xb')](function(_0x524736){const _0x18621e=_0x254ae8;if(_0x524736)return _0x1e7db5=_0x524736,_0x420942[_0x18621e('0x1d')]=_['keys'](db[_0x18621e('0x26')][_0x18621e('0x7')]),_0x420942[_0x18621e('0x38')]=_[_0x18621e('0x24')](_0x1200af[_0x18621e('0x38')]),_0x420942[_0x18621e('0x17')]=_['intersection'](_0x420942[_0x18621e('0x1d')],_0x420942['query']),_0x3c7aab[_0x18621e('0x34')]=_[_0x18621e('0x37')](_0x420942[_0x18621e('0x1d')],qs[_0x18621e('0x2e')](_0x1200af[_0x18621e('0x38')][_0x18621e('0x2e')])),_0x3c7aab[_0x18621e('0x34')]=_0x3c7aab[_0x18621e('0x34')][_0x18621e('0x18')]?_0x3c7aab[_0x18621e('0x34')]:_0x420942['model'],_0x3c7aab[_0x18621e('0x2')]=qs[_0x18621e('0x12')](_0x1200af['query'][_0x18621e('0x12')]),_0x3c7aab[_0x18621e('0x1b')]=qs[_0x18621e('0x17')](_['pick'](_0x1200af['query'],_0x420942[_0x18621e('0x17')])),_0x1200af[_0x18621e('0x38')][_0x18621e('0x1')]&&(_0x3c7aab[_0x18621e('0x1b')]=_[_0x18621e('0x31')](_0x3c7aab[_0x18621e('0x1b')],{[Op['or']]:_[_0x18621e('0x4')](_0x3c7aab[_0x18621e('0x34')],function(_0x442a11){const _0x1ba731=_0x18621e,_0x4ba945={};return _0x4ba945[_0x442a11]={[Op['like']]:'%'+_0x1200af['query'][_0x1ba731('0x1')]+'%'},_0x4ba945;})})),_0x3c7aab=_[_0x18621e('0x31')]({},_0x3c7aab,_0x1200af[_0x18621e('0x8')]),_0x1e7db5['getDescriptions'](_0x3c7aab);})[_0x254ae8('0xb')](function(_0x4ca7ed){const _0x2b9c72=_0x254ae8;if(_0x4ca7ed)return _0x138e8c=_0x4ca7ed[_0x2b9c72('0x18')],typeof _0x1200af[_0x2b9c72('0x38')][_0x2b9c72('0x30')]==='undefined'&&(_0x3c7aab['limit']=qs['limit'](_0x1200af[_0x2b9c72('0x38')][_0x2b9c72('0x1c')]),_0x3c7aab[_0x2b9c72('0x1e')]=qs['offset'](_0x1200af[_0x2b9c72('0x38')][_0x2b9c72('0x1e')])),_0x1e7db5['getDescriptions'](_0x3c7aab);})[_0x254ae8('0xb')](function(_0x3ad1c3){if(_0x3ad1c3)return _0x3ad1c3?{'count':_0x138e8c,'rows':_0x3ad1c3}:null;})[_0x254ae8('0xb')](respondWithResult(_0x4d2a54,null))[_0x254ae8('0x2b')](handleError(_0x4d2a54,null));};
\ No newline at end of file