4d8f5f6e23e457674b869df86167e526eea4e273
[motion-next.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.controller.js
1 const a338_0x2590=['catch','type','model','nolimit','Tag','findAll','where','attributes','sort','show','../../config/logger','map','limit','include','ids','undefined','params','includeAll','error','options','api','json','sequelize','ZendeskField','key','name','create','getDescriptions','set','offset','fields','../../mysqldb','findOne','status','query','rows','ZendeskConfiguration','intersection','destroy','stack','update','rawAttributes','getSubjects','getFields','merge','body','count','sendStatus','keys','order','filters','like','then','setTags','filter','getTags','length','../../components/parsers/qs','Content-Range','pick','fieldName'];(function(_0x5d87ff,_0x25908b){const _0x33cb30=function(_0x2594da){while(--_0x2594da){_0x5d87ff['push'](_0x5d87ff['shift']());}};_0x33cb30(++_0x25908b);}(a338_0x2590,0x164));const a338_0x33cb=function(_0x5d87ff,_0x25908b){_0x5d87ff=_0x5d87ff-0x0;let _0x33cb30=a338_0x2590[_0x5d87ff];return _0x33cb30;};const _0xe2b07d=a338_0x33cb;'use strict';const _=require('lodash'),qs=require(_0xe2b07d('0x6')),logger=require(_0xe2b07d('0x14'))(_0xe2b07d('0x1e')),db=require(_0xe2b07d('0x29'))['db'],{Op}=require(_0xe2b07d('0x20'));function respondWithResult(_0x2594da,_0x34e5f0){return _0x34e5f0=_0x34e5f0||0xc8,function(_0x4dccc9){const _0x219cf9=a338_0x33cb;if(_0x4dccc9)return _0x2594da[_0x219cf9('0x2b')](_0x34e5f0)[_0x219cf9('0x1f')](_0x4dccc9);};}function respondWithFilteredResult(_0x410932,_0x2af2ef){return function(_0x1a45ef){const _0x3f8a96=a338_0x33cb;if(_0x1a45ef){const _0x398654=_0x1a45ef[_0x3f8a96('0x38')],_0x49d19e=_0x2af2ef[_0x3f8a96('0x27')];let _0x11f587=_0x2af2ef[_0x3f8a96('0x27')]+_0x2af2ef[_0x3f8a96('0x16')],_0x5567cf;return _0x11f587>=_0x398654?(_0x11f587=_0x398654,_0x5567cf=0xc8):_0x5567cf=0xce,_0x410932['status'](_0x5567cf),_0x410932[_0x3f8a96('0x26')](_0x3f8a96('0x7'),_0x49d19e+'-'+_0x11f587+'/'+_0x398654)[_0x3f8a96('0x1f')](_0x1a45ef);}return null;};}function saveUpdates(_0x58209f){return function(_0x2ce23b){const _0x27fb4c=a338_0x33cb;if(_0x2ce23b)return _0x2ce23b['update'](_0x58209f)[_0x27fb4c('0x1')](function(_0x10c7a7){return _0x10c7a7;});return null;};}function removeEntity(_0xe172e6){return function(_0xc9d546){const _0x5f28e8=a338_0x33cb;if(_0xc9d546)return _0xc9d546[_0x5f28e8('0x30')]()[_0x5f28e8('0x1')](function(){_0xe172e6['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x3a464f){return function(_0x99ece5){const _0x32b0b7=a338_0x33cb;return!_0x99ece5&&_0x3a464f[_0x32b0b7('0x39')](0x194),_0x99ece5;};}function handleError(_0x185583,_0x99eb){return _0x99eb=_0x99eb||0x1f4,function(_0x192990){const _0x1aa51f=a338_0x33cb;logger[_0x1aa51f('0x1c')](_0x192990[_0x1aa51f('0x31')]),_0x192990[_0x1aa51f('0x23')]&&delete _0x192990[_0x1aa51f('0x23')],_0x185583[_0x1aa51f('0x2b')](_0x99eb)['send'](_0x192990);};}exports['index']=function(_0x18db1c,_0x2eed93){const _0x3e6a77=_0xe2b07d;let _0x7d8bdf={};const _0x56fef3={},_0x38ad01={'count':0x0,'rows':[]},_0x426e01=_[_0x3e6a77('0x15')](db['ZendeskConfiguration'][_0x3e6a77('0x33')],function(_0x2f9a08){const _0x481c01=_0x3e6a77;return{'name':_0x2f9a08[_0x481c01('0x9')],'type':_0x2f9a08[_0x481c01('0xb')][_0x481c01('0x22')]};});_0x56fef3['model']=_['map'](_0x426e01,_0x3e6a77('0x23')),_0x56fef3[_0x3e6a77('0x2c')]=_[_0x3e6a77('0x3a')](_0x18db1c['query']),_0x56fef3[_0x3e6a77('0x3c')]=_[_0x3e6a77('0x2f')](_0x56fef3['model'],_0x56fef3['query']),_0x7d8bdf['attributes']=_[_0x3e6a77('0x2f')](_0x56fef3[_0x3e6a77('0xc')],qs['fields'](_0x18db1c[_0x3e6a77('0x2c')][_0x3e6a77('0x28')])),_0x7d8bdf[_0x3e6a77('0x11')]=_0x7d8bdf['attributes'][_0x3e6a77('0x5')]?_0x7d8bdf[_0x3e6a77('0x11')]:_0x56fef3[_0x3e6a77('0xc')];typeof _0x18db1c['query']['nolimit']===_0x3e6a77('0x19')&&(_0x7d8bdf[_0x3e6a77('0x16')]=qs[_0x3e6a77('0x16')](_0x18db1c[_0x3e6a77('0x2c')][_0x3e6a77('0x16')]),_0x7d8bdf['offset']=qs[_0x3e6a77('0x27')](_0x18db1c[_0x3e6a77('0x2c')][_0x3e6a77('0x27')]));_0x7d8bdf['order']=qs[_0x3e6a77('0x12')](_0x18db1c[_0x3e6a77('0x2c')][_0x3e6a77('0x12')]),_0x7d8bdf[_0x3e6a77('0x10')]=qs[_0x3e6a77('0x3c')](_[_0x3e6a77('0x8')](_0x18db1c[_0x3e6a77('0x2c')],_0x56fef3[_0x3e6a77('0x3c')]),_0x426e01);_0x18db1c[_0x3e6a77('0x2c')][_0x3e6a77('0x3')]&&(_0x7d8bdf[_0x3e6a77('0x10')]=_['merge'](_0x7d8bdf[_0x3e6a77('0x10')],{[Op['or']]:_[_0x3e6a77('0x15')](_0x426e01,function(_0x948da){const _0x2d536d=_0x3e6a77;if(_0x948da['type']!=='VIRTUAL'){const _0x5e6656={};return _0x5e6656[_0x948da[_0x2d536d('0x23')]]={[Op[_0x2d536d('0x0')]]:'%'+_0x18db1c[_0x2d536d('0x2c')][_0x2d536d('0x3')]+'%'},_0x5e6656;}})}));_0x7d8bdf=_[_0x3e6a77('0x36')]({},_0x7d8bdf,_0x18db1c[_0x3e6a77('0x1d')]);const _0x1e2233={'where':_0x7d8bdf[_0x3e6a77('0x10')]};return db[_0x3e6a77('0x2e')][_0x3e6a77('0x38')](_0x1e2233)[_0x3e6a77('0x1')](function(_0x4902a2){const _0x232d46=_0x3e6a77;return _0x38ad01[_0x232d46('0x38')]=_0x4902a2,_0x18db1c[_0x232d46('0x2c')][_0x232d46('0x1b')]&&(_0x7d8bdf[_0x232d46('0x17')]=[{'all':!![]}]),db[_0x232d46('0x2e')][_0x232d46('0xf')](_0x7d8bdf);})[_0x3e6a77('0x1')](function(_0x4fe71a){const _0x160aad=_0x3e6a77;return _0x38ad01[_0x160aad('0x2d')]=_0x4fe71a,_0x38ad01;})[_0x3e6a77('0x1')](respondWithFilteredResult(_0x2eed93,_0x7d8bdf))[_0x3e6a77('0xa')](handleError(_0x2eed93,null));},exports[_0xe2b07d('0x13')]=function(_0x32ad98,_0x224bff){const _0x579dcd=_0xe2b07d;let _0x92b2f1={'raw':![],'where':{'id':_0x32ad98[_0x579dcd('0x1a')]['id']}};const _0x52d20c={};return _0x52d20c[_0x579dcd('0xc')]=_['keys'](db['ZendeskConfiguration'][_0x579dcd('0x33')]),_0x52d20c[_0x579dcd('0x2c')]=_[_0x579dcd('0x3a')](_0x32ad98[_0x579dcd('0x2c')]),_0x52d20c[_0x579dcd('0x3c')]=_['intersection'](_0x52d20c[_0x579dcd('0xc')],_0x52d20c[_0x579dcd('0x2c')]),_0x92b2f1['attributes']=_[_0x579dcd('0x2f')](_0x52d20c[_0x579dcd('0xc')],qs[_0x579dcd('0x28')](_0x32ad98[_0x579dcd('0x2c')][_0x579dcd('0x28')])),_0x92b2f1['attributes']=_0x92b2f1[_0x579dcd('0x11')]['length']?_0x92b2f1[_0x579dcd('0x11')]:_0x52d20c['model'],_0x32ad98[_0x579dcd('0x2c')][_0x579dcd('0x1b')]&&(_0x92b2f1['include']=[{'all':!![]}]),_0x92b2f1=_[_0x579dcd('0x36')]({},_0x92b2f1,_0x32ad98[_0x579dcd('0x1d')]),db['ZendeskConfiguration'][_0x579dcd('0x2a')](_0x92b2f1)[_0x579dcd('0x1')](handleEntityNotFound(_0x224bff,null))[_0x579dcd('0x1')](respondWithResult(_0x224bff,null))[_0x579dcd('0xa')](handleError(_0x224bff,null));},exports[_0xe2b07d('0x24')]=function(_0x502602,_0xc48706){const _0x36e20e=_0xe2b07d;return db[_0x36e20e('0x2e')][_0x36e20e('0x24')](_0x502602[_0x36e20e('0x37')],{})[_0x36e20e('0x1')](respondWithResult(_0xc48706,0xc9))[_0x36e20e('0xa')](handleError(_0xc48706,null));},exports[_0xe2b07d('0x32')]=function(_0x52d085,_0x2ad969){const _0x2f6f86=_0xe2b07d;return _0x52d085[_0x2f6f86('0x37')]['id']&&delete _0x52d085['body']['id'],db[_0x2f6f86('0x2e')][_0x2f6f86('0x2a')]({'where':{'id':_0x52d085[_0x2f6f86('0x1a')]['id']}})[_0x2f6f86('0x1')](handleEntityNotFound(_0x2ad969,null))[_0x2f6f86('0x1')](saveUpdates(_0x52d085[_0x2f6f86('0x37')],null))[_0x2f6f86('0x1')](respondWithResult(_0x2ad969,null))[_0x2f6f86('0xa')](handleError(_0x2ad969,null));},exports[_0xe2b07d('0x30')]=function(_0x4579c4,_0x25f7f1){const _0x80dbf8=_0xe2b07d;return db['ZendeskConfiguration'][_0x80dbf8('0x2a')]({'where':{'id':_0x4579c4[_0x80dbf8('0x1a')]['id']}})[_0x80dbf8('0x1')](handleEntityNotFound(_0x25f7f1,null))[_0x80dbf8('0x1')](removeEntity(_0x25f7f1,null))[_0x80dbf8('0xa')](handleError(_0x25f7f1,null));},exports[_0xe2b07d('0x35')]=function(_0x11ebcd,_0xd1aa9e){const _0x5aac43=_0xe2b07d;let _0x3ddfba={};const _0x32f56c={};let _0x135b59,_0xbca15e;return db[_0x5aac43('0x2e')]['findOne']({'where':{'id':_0x11ebcd[_0x5aac43('0x1a')]['id']}})[_0x5aac43('0x1')](handleEntityNotFound(_0xd1aa9e,null))[_0x5aac43('0x1')](function(_0xee01b8){const _0x539e11=_0x5aac43;if(_0xee01b8)return _0x135b59=_0xee01b8,_0x32f56c[_0x539e11('0xc')]=_[_0x539e11('0x3a')](db[_0x539e11('0x21')][_0x539e11('0x33')]),_0x32f56c['query']=_['keys'](_0x11ebcd[_0x539e11('0x2c')]),_0x32f56c[_0x539e11('0x3c')]=_[_0x539e11('0x2f')](_0x32f56c[_0x539e11('0xc')],_0x32f56c['query']),_0x3ddfba[_0x539e11('0x11')]=_[_0x539e11('0x2f')](_0x32f56c[_0x539e11('0xc')],qs[_0x539e11('0x28')](_0x11ebcd[_0x539e11('0x2c')]['fields'])),_0x3ddfba[_0x539e11('0x11')]=_0x3ddfba['attributes'][_0x539e11('0x5')]?_0x3ddfba[_0x539e11('0x11')]:_0x32f56c[_0x539e11('0xc')],_0x3ddfba[_0x539e11('0x3b')]=qs[_0x539e11('0x12')](_0x11ebcd[_0x539e11('0x2c')][_0x539e11('0x12')]),_0x3ddfba[_0x539e11('0x10')]=qs[_0x539e11('0x3c')](_[_0x539e11('0x8')](_0x11ebcd[_0x539e11('0x2c')],_0x32f56c[_0x539e11('0x3c')])),_0x11ebcd[_0x539e11('0x2c')][_0x539e11('0x3')]&&(_0x3ddfba['where']=_[_0x539e11('0x36')](_0x3ddfba['where'],{[Op['or']]:_[_0x539e11('0x15')](_0x3ddfba[_0x539e11('0x11')],function(_0x41b2b5){const _0x3ea540=_0x539e11,_0x4b29e4={};return _0x4b29e4[_0x41b2b5]={[Op[_0x3ea540('0x0')]]:'%'+_0x11ebcd[_0x3ea540('0x2c')][_0x3ea540('0x3')]+'%'},_0x4b29e4;})})),_0x3ddfba=_['merge']({},_0x3ddfba,_0x11ebcd[_0x539e11('0x1d')]),_0x135b59[_0x539e11('0x35')](_0x3ddfba);})['then'](function(_0x39aa23){const _0x21c5e5=_0x5aac43;if(_0x39aa23)return _0xbca15e=_0x39aa23[_0x21c5e5('0x5')],typeof _0x11ebcd[_0x21c5e5('0x2c')][_0x21c5e5('0xd')]===_0x21c5e5('0x19')&&(_0x3ddfba[_0x21c5e5('0x16')]=qs[_0x21c5e5('0x16')](_0x11ebcd[_0x21c5e5('0x2c')][_0x21c5e5('0x16')]),_0x3ddfba[_0x21c5e5('0x27')]=qs[_0x21c5e5('0x27')](_0x11ebcd[_0x21c5e5('0x2c')][_0x21c5e5('0x27')])),_0x135b59[_0x21c5e5('0x35')](_0x3ddfba);})[_0x5aac43('0x1')](function(_0x4b6d20){if(_0x4b6d20)return _0x4b6d20?{'count':_0xbca15e,'rows':_0x4b6d20}:null;})[_0x5aac43('0x1')](respondWithResult(_0xd1aa9e,null))[_0x5aac43('0xa')](handleError(_0xd1aa9e,null));},exports[_0xe2b07d('0x34')]=function(_0x43ec8d,_0x462d8b){const _0x191e38=_0xe2b07d;let _0x579f40={};const _0x59eff9={};let _0x3f18de,_0x3457cc;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x43ec8d[_0x191e38('0x1a')]['id']}})[_0x191e38('0x1')](handleEntityNotFound(_0x462d8b,null))['then'](function(_0x564add){const _0xfed837=_0x191e38;if(_0x564add)return _0x3f18de=_0x564add,_0x59eff9[_0xfed837('0xc')]=_[_0xfed837('0x3a')](db[_0xfed837('0x21')][_0xfed837('0x33')]),_0x59eff9['query']=_[_0xfed837('0x3a')](_0x43ec8d['query']),_0x59eff9[_0xfed837('0x3c')]=_['intersection'](_0x59eff9[_0xfed837('0xc')],_0x59eff9[_0xfed837('0x2c')]),_0x579f40[_0xfed837('0x11')]=_['intersection'](_0x59eff9[_0xfed837('0xc')],qs['fields'](_0x43ec8d[_0xfed837('0x2c')]['fields'])),_0x579f40[_0xfed837('0x11')]=_0x579f40[_0xfed837('0x11')][_0xfed837('0x5')]?_0x579f40[_0xfed837('0x11')]:_0x59eff9[_0xfed837('0xc')],_0x579f40[_0xfed837('0x3b')]=qs[_0xfed837('0x12')](_0x43ec8d['query'][_0xfed837('0x12')]),_0x579f40[_0xfed837('0x10')]=qs[_0xfed837('0x3c')](_[_0xfed837('0x8')](_0x43ec8d[_0xfed837('0x2c')],_0x59eff9['filters'])),_0x43ec8d[_0xfed837('0x2c')][_0xfed837('0x3')]&&(_0x579f40['where']=_[_0xfed837('0x36')](_0x579f40[_0xfed837('0x10')],{[Op['or']]:_[_0xfed837('0x15')](_0x579f40[_0xfed837('0x11')],function(_0x14af16){const _0x34d244=_0xfed837,_0x1e8059={};return _0x1e8059[_0x14af16]={[Op[_0x34d244('0x0')]]:'%'+_0x43ec8d[_0x34d244('0x2c')][_0x34d244('0x3')]+'%'},_0x1e8059;})})),_0x579f40=_[_0xfed837('0x36')]({},_0x579f40,_0x43ec8d[_0xfed837('0x1d')]),_0x3f18de[_0xfed837('0x34')](_0x579f40);})[_0x191e38('0x1')](function(_0x4b81a4){const _0x4d4a35=_0x191e38;if(_0x4b81a4)return _0x3457cc=_0x4b81a4[_0x4d4a35('0x5')],typeof _0x43ec8d[_0x4d4a35('0x2c')]['nolimit']===_0x4d4a35('0x19')&&(_0x579f40['limit']=qs[_0x4d4a35('0x16')](_0x43ec8d['query'][_0x4d4a35('0x16')]),_0x579f40[_0x4d4a35('0x27')]=qs['offset'](_0x43ec8d[_0x4d4a35('0x2c')]['offset'])),_0x3f18de[_0x4d4a35('0x34')](_0x579f40);})[_0x191e38('0x1')](function(_0x1cc399){if(_0x1cc399)return _0x1cc399?{'count':_0x3457cc,'rows':_0x1cc399}:null;})[_0x191e38('0x1')](respondWithResult(_0x462d8b,null))[_0x191e38('0xa')](handleError(_0x462d8b,null));},exports['getDescriptions']=function(_0x234967,_0xa19497){const _0x2d8225=_0xe2b07d;let _0x5933eb={};const _0x37377e={};let _0x1e14d0,_0x29e1fb;return db[_0x2d8225('0x2e')][_0x2d8225('0x2a')]({'where':{'id':_0x234967[_0x2d8225('0x1a')]['id']}})['then'](handleEntityNotFound(_0xa19497,null))[_0x2d8225('0x1')](function(_0x50326d){const _0x3fc3b8=_0x2d8225;if(_0x50326d)return _0x1e14d0=_0x50326d,_0x37377e[_0x3fc3b8('0xc')]=_[_0x3fc3b8('0x3a')](db['ZendeskField'][_0x3fc3b8('0x33')]),_0x37377e[_0x3fc3b8('0x2c')]=_['keys'](_0x234967[_0x3fc3b8('0x2c')]),_0x37377e[_0x3fc3b8('0x3c')]=_[_0x3fc3b8('0x2f')](_0x37377e[_0x3fc3b8('0xc')],_0x37377e[_0x3fc3b8('0x2c')]),_0x5933eb[_0x3fc3b8('0x11')]=_['intersection'](_0x37377e[_0x3fc3b8('0xc')],qs['fields'](_0x234967[_0x3fc3b8('0x2c')][_0x3fc3b8('0x28')])),_0x5933eb['attributes']=_0x5933eb[_0x3fc3b8('0x11')][_0x3fc3b8('0x5')]?_0x5933eb[_0x3fc3b8('0x11')]:_0x37377e['model'],_0x5933eb['order']=qs[_0x3fc3b8('0x12')](_0x234967[_0x3fc3b8('0x2c')][_0x3fc3b8('0x12')]),_0x5933eb[_0x3fc3b8('0x10')]=qs[_0x3fc3b8('0x3c')](_[_0x3fc3b8('0x8')](_0x234967[_0x3fc3b8('0x2c')],_0x37377e[_0x3fc3b8('0x3c')])),_0x234967[_0x3fc3b8('0x2c')]['filter']&&(_0x5933eb[_0x3fc3b8('0x10')]=_[_0x3fc3b8('0x36')](_0x5933eb[_0x3fc3b8('0x10')],{[Op['or']]:_[_0x3fc3b8('0x15')](_0x5933eb['attributes'],function(_0x595964){const _0x233ce8=_0x3fc3b8,_0x2aeecf={};return _0x2aeecf[_0x595964]={[Op[_0x233ce8('0x0')]]:'%'+_0x234967[_0x233ce8('0x2c')]['filter']+'%'},_0x2aeecf;})})),_0x5933eb=_[_0x3fc3b8('0x36')]({},_0x5933eb,_0x234967['options']),_0x1e14d0['getDescriptions'](_0x5933eb);})['then'](function(_0x214856){const _0x501116=_0x2d8225;if(_0x214856)return _0x29e1fb=_0x214856['length'],typeof _0x234967[_0x501116('0x2c')][_0x501116('0xd')]===_0x501116('0x19')&&(_0x5933eb['limit']=qs[_0x501116('0x16')](_0x234967['query'][_0x501116('0x16')]),_0x5933eb['offset']=qs[_0x501116('0x27')](_0x234967[_0x501116('0x2c')][_0x501116('0x27')])),_0x1e14d0[_0x501116('0x25')](_0x5933eb);})[_0x2d8225('0x1')](function(_0x5a700c){if(_0x5a700c)return _0x5a700c?{'count':_0x29e1fb,'rows':_0x5a700c}:null;})[_0x2d8225('0x1')](respondWithResult(_0xa19497,null))[_0x2d8225('0xa')](handleError(_0xa19497,null));},exports[_0xe2b07d('0x4')]=function(_0x350a13,_0x26db3d){const _0x116ba2=_0xe2b07d;let _0x386e15={};const _0x31373d={};let _0x434577,_0x1cc73f;return db[_0x116ba2('0x2e')][_0x116ba2('0x2a')]({'where':{'id':_0x350a13[_0x116ba2('0x1a')]['id']}})['then'](handleEntityNotFound(_0x26db3d,null))[_0x116ba2('0x1')](function(_0x380556){const _0x4ebdd9=_0x116ba2;if(_0x380556)return _0x434577=_0x380556,_0x31373d[_0x4ebdd9('0xc')]=_[_0x4ebdd9('0x3a')](db[_0x4ebdd9('0xe')][_0x4ebdd9('0x33')]),_0x31373d['query']=_[_0x4ebdd9('0x3a')](_0x350a13[_0x4ebdd9('0x2c')]),_0x31373d[_0x4ebdd9('0x3c')]=_[_0x4ebdd9('0x2f')](_0x31373d[_0x4ebdd9('0xc')],_0x31373d[_0x4ebdd9('0x2c')]),_0x386e15[_0x4ebdd9('0x11')]=_[_0x4ebdd9('0x2f')](_0x31373d[_0x4ebdd9('0xc')],qs[_0x4ebdd9('0x28')](_0x350a13[_0x4ebdd9('0x2c')]['fields'])),_0x386e15['attributes']=_0x386e15['attributes'][_0x4ebdd9('0x5')]?_0x386e15[_0x4ebdd9('0x11')]:_0x31373d[_0x4ebdd9('0xc')],_0x386e15[_0x4ebdd9('0x3b')]=qs[_0x4ebdd9('0x12')](_0x350a13[_0x4ebdd9('0x2c')]['sort']),_0x386e15[_0x4ebdd9('0x10')]=qs['filters'](_[_0x4ebdd9('0x8')](_0x350a13[_0x4ebdd9('0x2c')],_0x31373d[_0x4ebdd9('0x3c')])),_0x350a13[_0x4ebdd9('0x2c')]['filter']&&(_0x386e15[_0x4ebdd9('0x10')]=_[_0x4ebdd9('0x36')](_0x386e15[_0x4ebdd9('0x10')],{[Op['or']]:_['map'](_0x386e15['attributes'],function(_0xcb1be){const _0x1ec08d=_0x4ebdd9,_0x2e2e8d={};return _0x2e2e8d[_0xcb1be]={[Op[_0x1ec08d('0x0')]]:'%'+_0x350a13['query'][_0x1ec08d('0x3')]+'%'},_0x2e2e8d;})})),_0x386e15=_['merge']({},_0x386e15,_0x350a13[_0x4ebdd9('0x1d')]),_0x434577[_0x4ebdd9('0x4')](_0x386e15);})[_0x116ba2('0x1')](function(_0x15c9b0){const _0x3f4d64=_0x116ba2;if(_0x15c9b0)return _0x1cc73f=_0x15c9b0[_0x3f4d64('0x5')],typeof _0x350a13[_0x3f4d64('0x2c')][_0x3f4d64('0xd')]===_0x3f4d64('0x19')&&(_0x386e15['limit']=qs['limit'](_0x350a13[_0x3f4d64('0x2c')]['limit']),_0x386e15['offset']=qs[_0x3f4d64('0x27')](_0x350a13[_0x3f4d64('0x2c')][_0x3f4d64('0x27')])),_0x434577['getTags'](_0x386e15);})['then'](function(_0x4f282a){if(_0x4f282a)return _0x4f282a?{'count':_0x1cc73f,'rows':_0x4f282a}:null;})[_0x116ba2('0x1')](respondWithResult(_0x26db3d,null))[_0x116ba2('0xa')](handleError(_0x26db3d,null));},exports[_0xe2b07d('0x2')]=function(_0x5d0575,_0x22a576){const _0x249b35=_0xe2b07d;return _0x5d0575[_0x249b35('0x37')]['id']&&delete _0x5d0575[_0x249b35('0x37')]['id'],db[_0x249b35('0x2e')][_0x249b35('0x2a')]({'where':{'id':_0x5d0575['params']['id']}})[_0x249b35('0x1')](handleEntityNotFound(_0x22a576,null))['then'](function(_0xc6e2f5){const _0x11117d=_0x249b35;if(_0xc6e2f5)return _0xc6e2f5[_0x11117d('0x2')](_0x5d0575[_0x11117d('0x37')][_0x11117d('0x18')]||[]);return null;})[_0x249b35('0x1')](respondWithResult(_0x22a576,null))[_0x249b35('0xa')](handleError(_0x22a576,null));};