Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / api / trigger / trigger.controller.js
1 const a638_0x3dd5=['order','status','catch','like','Trigger','update','includeAll','send','../../components/parsers/qs','TriggerId','merge','index','addAnyCondition','params','intersection','body','fieldName','offset','filters','getActions','findOne','then','TriggerAllId','undefined','get','destroy','user','attributes','sequelize','getAnyConditions','Unable\x20to\x20retrieve\x20the\x20current\x20user','rawAttributes','keys','map','sort','where','UserProfileSection','limit','addAllCondition','findAll','count','end','Content-Range','filter','UserProfileResource','show','model','Action','fields','key','userProfileId','Triggers','options','query','name','getAllConditions','pick','Condition','nolimit','type','include','length','role','json','error','create'];(function(_0x24925e,_0x3dd5f3){const _0x323012=function(_0x406c59){while(--_0x406c59){_0x24925e['push'](_0x24925e['shift']());}};_0x323012(++_0x3dd5f3);}(a638_0x3dd5,0x1ba));const a638_0x3230=function(_0x24925e,_0x3dd5f3){_0x24925e=_0x24925e-0x0;let _0x323012=a638_0x3dd5[_0x24925e];return _0x323012;};const _0x271fc7=a638_0x3230;'use strict';const _=require('lodash'),qs=require(_0x271fc7('0x1c')),logger=require('../../config/logger')('api'),db=require('../../mysqldb')['db'],{Op}=require(_0x271fc7('0x30'));function respondWithResult(_0x406c59,_0x30b380){return _0x30b380=_0x30b380||0xc8,function(_0x11b5c6){const _0x3d181a=a638_0x3230;if(_0x11b5c6)return _0x406c59['status'](_0x30b380)[_0x3d181a('0x11')](_0x11b5c6);};}function respondWithFilteredResult(_0x41cf5c,_0xe3de9e){return function(_0x1573ba){const _0x4949de=a638_0x3230;if(_0x1573ba){const _0x2f1b73=_0x1573ba[_0x4949de('0x3c')],_0x248842=_0xe3de9e['offset'];let _0x227610=_0xe3de9e[_0x4949de('0x25')]+_0xe3de9e[_0x4949de('0x39')],_0x506383;return _0x227610>=_0x2f1b73?(_0x227610=_0x2f1b73,_0x506383=0xc8):_0x506383=0xce,_0x41cf5c[_0x4949de('0x15')](_0x506383),_0x41cf5c['set'](_0x4949de('0x3e'),_0x248842+'-'+_0x227610+'/'+_0x2f1b73)[_0x4949de('0x11')](_0x1573ba);}return null;};}function saveUpdates(_0x131957){return function(_0xaf8f56){const _0xe656b0=a638_0x3230;if(_0xaf8f56)return _0xaf8f56[_0xe656b0('0x19')](_0x131957)[_0xe656b0('0x29')](function(_0x2dcc14){return _0x2dcc14;});return null;};}function removeEntity(_0xbb28a2){return function(_0x502b5c){const _0x1c74b5=a638_0x3230;if(_0x502b5c)return _0x502b5c['destroy']()[_0x1c74b5('0x29')](function(){const _0x5b4034=_0x1c74b5,_0x4898c6=_0x502b5c[_0x5b4034('0x2c')]({'plain':!![]}),_0x480d21='Triggers';return db[_0x5b4034('0x40')][_0x5b4034('0x2d')]({'where':{'type':_0x480d21,'resourceId':_0x4898c6['id']}})[_0x5b4034('0x29')](function(){return _0x502b5c;});})['then'](function(){const _0x442af7=_0x1c74b5;_0xbb28a2[_0x442af7('0x15')](0xcc)[_0x442af7('0x3d')]();});};}function handleEntityNotFound(_0x5c3e75){return function(_0x519fb7){return!_0x519fb7&&_0x5c3e75['sendStatus'](0x194),_0x519fb7;};}function handleError(_0x5e74d9,_0x1a2f81){return _0x1a2f81=_0x1a2f81||0x1f4,function(_0x317bde){const _0x34a0ee=a638_0x3230;logger[_0x34a0ee('0x12')](_0x317bde['stack']),_0x317bde['name']&&delete _0x317bde[_0x34a0ee('0x8')],_0x5e74d9['status'](_0x1a2f81)[_0x34a0ee('0x1b')](_0x317bde);};}exports[_0x271fc7('0x1f')]=function(_0x280b53,_0x6584e8){const _0x171860=_0x271fc7;let _0x2605f9={};const _0x58f48a={},_0x5824b2={'count':0x0,'rows':[]},_0x348e8a=_[_0x171860('0x35')](db[_0x171860('0x18')][_0x171860('0x33')],function(_0x1ee0ba){const _0x4efe09=_0x171860;return{'name':_0x1ee0ba[_0x4efe09('0x24')],'type':_0x1ee0ba[_0x4efe09('0xd')][_0x4efe09('0x3')]};});_0x58f48a[_0x171860('0x0')]=_[_0x171860('0x35')](_0x348e8a,_0x171860('0x8')),_0x58f48a['query']=_[_0x171860('0x34')](_0x280b53[_0x171860('0x7')]),_0x58f48a['filters']=_['intersection'](_0x58f48a[_0x171860('0x0')],_0x58f48a['query']),_0x2605f9[_0x171860('0x2f')]=_['intersection'](_0x58f48a['model'],qs[_0x171860('0x2')](_0x280b53[_0x171860('0x7')][_0x171860('0x2')])),_0x2605f9[_0x171860('0x2f')]=_0x2605f9[_0x171860('0x2f')]['length']?_0x2605f9['attributes']:_0x58f48a[_0x171860('0x0')];typeof _0x280b53[_0x171860('0x7')][_0x171860('0xc')]===_0x171860('0x2b')&&(_0x2605f9[_0x171860('0x39')]=qs[_0x171860('0x39')](_0x280b53[_0x171860('0x7')][_0x171860('0x39')]),_0x2605f9[_0x171860('0x25')]=qs['offset'](_0x280b53[_0x171860('0x7')]['offset']));_0x2605f9[_0x171860('0x14')]=qs['sort'](_0x280b53[_0x171860('0x7')][_0x171860('0x36')]),_0x2605f9[_0x171860('0x37')]=qs[_0x171860('0x26')](_[_0x171860('0xa')](_0x280b53[_0x171860('0x7')],_0x58f48a[_0x171860('0x26')]),_0x348e8a);_0x280b53['query'][_0x171860('0x3f')]&&(_0x2605f9['where']=_[_0x171860('0x1e')](_0x2605f9['where'],{[Op['or']]:_[_0x171860('0x35')](_0x348e8a,function(_0x5b0575){const _0x116d9f=_0x171860;if(_0x5b0575[_0x116d9f('0xd')]!=='VIRTUAL'){const _0x414fa9={};return _0x414fa9[_0x5b0575[_0x116d9f('0x8')]]={[Op[_0x116d9f('0x17')]]:'%'+_0x280b53[_0x116d9f('0x7')][_0x116d9f('0x3f')]+'%'},_0x414fa9;}})}));_0x2605f9=_[_0x171860('0x1e')]({},_0x2605f9,_0x280b53[_0x171860('0x6')]);const _0x3d5ff5={'where':_0x2605f9[_0x171860('0x37')]};return db['Trigger']['count'](_0x3d5ff5)[_0x171860('0x29')](function(_0x2e0260){const _0x3d35a7=_0x171860;return _0x5824b2['count']=_0x2e0260,_0x280b53[_0x3d35a7('0x7')][_0x3d35a7('0x1a')]&&(_0x2605f9[_0x3d35a7('0xe')]=[{'all':!![]}]),db['Trigger'][_0x3d35a7('0x3b')](_0x2605f9);})[_0x171860('0x29')](function(_0x5143b7){return _0x5824b2['rows']=_0x5143b7,_0x5824b2;})[_0x171860('0x29')](respondWithFilteredResult(_0x6584e8,_0x2605f9))[_0x171860('0x16')](handleError(_0x6584e8,null));},exports[_0x271fc7('0x41')]=function(_0x22790d,_0x5c3bcd){const _0x21caa0=_0x271fc7;let _0x2f5fd5={'raw':![],'where':{'id':_0x22790d[_0x21caa0('0x21')]['id']}};const _0x2e6b2d={};return _0x2e6b2d[_0x21caa0('0x0')]=_[_0x21caa0('0x34')](db[_0x21caa0('0x18')][_0x21caa0('0x33')]),_0x2e6b2d[_0x21caa0('0x7')]=_['keys'](_0x22790d[_0x21caa0('0x7')]),_0x2e6b2d[_0x21caa0('0x26')]=_[_0x21caa0('0x22')](_0x2e6b2d['model'],_0x2e6b2d[_0x21caa0('0x7')]),_0x2f5fd5[_0x21caa0('0x2f')]=_[_0x21caa0('0x22')](_0x2e6b2d['model'],qs['fields'](_0x22790d['query'][_0x21caa0('0x2')])),_0x2f5fd5[_0x21caa0('0x2f')]=_0x2f5fd5['attributes']['length']?_0x2f5fd5[_0x21caa0('0x2f')]:_0x2e6b2d[_0x21caa0('0x0')],_0x22790d[_0x21caa0('0x7')]['includeAll']&&(_0x2f5fd5[_0x21caa0('0xe')]=[{'all':!![]}]),_0x2f5fd5=_[_0x21caa0('0x1e')]({},_0x2f5fd5,_0x22790d[_0x21caa0('0x6')]),db['Trigger'][_0x21caa0('0x28')](_0x2f5fd5)['then'](handleEntityNotFound(_0x5c3bcd,null))[_0x21caa0('0x29')](respondWithResult(_0x5c3bcd,null))[_0x21caa0('0x16')](handleError(_0x5c3bcd,null));},exports['create']=function(_0x1de65e,_0x44bcaf){const _0x4ac4c0=_0x271fc7;return db['Trigger'][_0x4ac4c0('0x13')](_0x1de65e[_0x4ac4c0('0x23')],{})[_0x4ac4c0('0x29')](function(_0xddb076){const _0x210698=_0x4ac4c0,_0x488f33=_0x1de65e['user'][_0x210698('0x2c')]({'plain':!![]});if(!_0x488f33)throw new Error(_0x210698('0x32'));if(_0x488f33[_0x210698('0x10')]===_0x210698('0x2e')){const _0x5530a1=_0xddb076[_0x210698('0x2c')]({'plain':!![]}),_0x1bca47=_0x210698('0x5');return db[_0x210698('0x38')][_0x210698('0x28')]({'where':{'name':_0x1bca47,'userProfileId':_0x488f33[_0x210698('0x4')]},'raw':!![]})[_0x210698('0x29')](function(_0x2f7fb1){const _0x3488d5=_0x210698;return _0x2f7fb1&&_0x2f7fb1['autoAssociation']===0x0?db['UserProfileResource'][_0x3488d5('0x13')]({'name':_0x5530a1[_0x3488d5('0x8')],'resourceId':_0x5530a1['id'],'type':_0x2f7fb1[_0x3488d5('0x8')],'sectionId':_0x2f7fb1['id']},{})[_0x3488d5('0x29')](function(){return _0xddb076;}):_0xddb076;})[_0x210698('0x16')](function(_0x1a021e){const _0x1f23e6=_0x210698;logger[_0x1f23e6('0x12')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a021e);throw _0x1a021e;});}return _0xddb076;})['then'](respondWithResult(_0x44bcaf,0xc9))[_0x4ac4c0('0x16')](handleError(_0x44bcaf,null));},exports[_0x271fc7('0x19')]=function(_0x209789,_0x1be1b1){const _0x41a459=_0x271fc7;return _0x209789['body']['id']&&delete _0x209789[_0x41a459('0x23')]['id'],db[_0x41a459('0x18')][_0x41a459('0x28')]({'where':{'id':_0x209789[_0x41a459('0x21')]['id']}})['then'](handleEntityNotFound(_0x1be1b1,null))[_0x41a459('0x29')](saveUpdates(_0x209789['body'],null))[_0x41a459('0x29')](respondWithResult(_0x1be1b1,null))[_0x41a459('0x16')](handleError(_0x1be1b1,null));},exports[_0x271fc7('0x2d')]=function(_0x32453f,_0xa0f3b6){const _0x221022=_0x271fc7;return db[_0x221022('0x18')]['findOne']({'where':{'id':_0x32453f['params']['id']}})[_0x221022('0x29')](handleEntityNotFound(_0xa0f3b6,null))[_0x221022('0x29')](removeEntity(_0xa0f3b6,null))[_0x221022('0x16')](handleError(_0xa0f3b6,null));},exports[_0x271fc7('0x3a')]=function(_0x48f5c2,_0x27ad59){const _0x57139f=_0x271fc7;return _0x48f5c2['body']['id']&&delete _0x48f5c2[_0x57139f('0x23')]['id'],db[_0x57139f('0x18')]['findOne']({'where':{'id':_0x48f5c2[_0x57139f('0x21')]['id']}})['then'](handleEntityNotFound(_0x27ad59,null))[_0x57139f('0x29')](function(_0xa77317){const _0x376442=_0x57139f;if(_0xa77317)return _0x48f5c2['body'][_0x376442('0x2a')]=_0xa77317['id'],db[_0x376442('0xb')][_0x376442('0x13')](_0x48f5c2[_0x376442('0x23')]);})[_0x57139f('0x29')](respondWithResult(_0x27ad59,null))[_0x57139f('0x16')](handleError(_0x27ad59,null));},exports[_0x271fc7('0x20')]=function(_0x29ebd4,_0x1bf6c3){const _0x2b68ed=_0x271fc7;return _0x29ebd4[_0x2b68ed('0x23')]['id']&&delete _0x29ebd4[_0x2b68ed('0x23')]['id'],db[_0x2b68ed('0x18')][_0x2b68ed('0x28')]({'where':{'id':_0x29ebd4['params']['id']}})['then'](handleEntityNotFound(_0x1bf6c3,null))[_0x2b68ed('0x29')](function(_0x21c20f){const _0x117e14=_0x2b68ed;if(_0x21c20f)return _0x29ebd4['body']['TriggerAnyId']=_0x21c20f['id'],db[_0x117e14('0xb')][_0x117e14('0x13')](_0x29ebd4['body']);})['then'](respondWithResult(_0x1bf6c3,null))['catch'](handleError(_0x1bf6c3,null));},exports['getAllConditions']=function(_0x48b2eb,_0x52bb2b){const _0x244158=_0x271fc7;let _0x224543={};const _0x982ef2={};let _0x2cd681,_0x452f5e;return db[_0x244158('0x18')]['findOne']({'where':{'id':_0x48b2eb[_0x244158('0x21')]['id']}})[_0x244158('0x29')](handleEntityNotFound(_0x52bb2b,null))[_0x244158('0x29')](function(_0xae63f1){const _0x636a4b=_0x244158;if(_0xae63f1)return _0x2cd681=_0xae63f1,_0x982ef2[_0x636a4b('0x0')]=_[_0x636a4b('0x34')](db[_0x636a4b('0xb')][_0x636a4b('0x33')]),_0x982ef2[_0x636a4b('0x7')]=_['keys'](_0x48b2eb[_0x636a4b('0x7')]),_0x982ef2[_0x636a4b('0x26')]=_['intersection'](_0x982ef2['model'],_0x982ef2[_0x636a4b('0x7')]),_0x224543[_0x636a4b('0x2f')]=_[_0x636a4b('0x22')](_0x982ef2[_0x636a4b('0x0')],qs[_0x636a4b('0x2')](_0x48b2eb['query'][_0x636a4b('0x2')])),_0x224543[_0x636a4b('0x2f')]=_0x224543[_0x636a4b('0x2f')][_0x636a4b('0xf')]?_0x224543['attributes']:_0x982ef2[_0x636a4b('0x0')],_0x224543[_0x636a4b('0x14')]=qs[_0x636a4b('0x36')](_0x48b2eb[_0x636a4b('0x7')][_0x636a4b('0x36')]),_0x224543['where']=qs['filters'](_[_0x636a4b('0xa')](_0x48b2eb[_0x636a4b('0x7')],_0x982ef2[_0x636a4b('0x26')])),_0x48b2eb[_0x636a4b('0x7')][_0x636a4b('0x3f')]&&(_0x224543['where']=_[_0x636a4b('0x1e')](_0x224543['where'],{[Op['or']]:_[_0x636a4b('0x35')](_0x224543[_0x636a4b('0x2f')],function(_0xe5d0ee){const _0x492622=_0x636a4b,_0x3e50fd={};return _0x3e50fd[_0xe5d0ee]={[Op['like']]:'%'+_0x48b2eb[_0x492622('0x7')][_0x492622('0x3f')]+'%'},_0x3e50fd;})})),_0x224543=_['merge']({},_0x224543,_0x48b2eb[_0x636a4b('0x6')]),_0x2cd681[_0x636a4b('0x9')](_0x224543);})[_0x244158('0x29')](function(_0x3e1f14){const _0x21768d=_0x244158;if(_0x3e1f14)return _0x452f5e=_0x3e1f14['length'],typeof _0x48b2eb[_0x21768d('0x7')][_0x21768d('0xc')]==='undefined'&&(_0x224543[_0x21768d('0x39')]=qs[_0x21768d('0x39')](_0x48b2eb[_0x21768d('0x7')][_0x21768d('0x39')]),_0x224543['offset']=qs[_0x21768d('0x25')](_0x48b2eb[_0x21768d('0x7')][_0x21768d('0x25')])),_0x2cd681[_0x21768d('0x9')](_0x224543);})[_0x244158('0x29')](function(_0x4b8377){if(_0x4b8377)return _0x4b8377?{'count':_0x452f5e,'rows':_0x4b8377}:null;})[_0x244158('0x29')](respondWithResult(_0x52bb2b,null))[_0x244158('0x16')](handleError(_0x52bb2b,null));},exports[_0x271fc7('0x31')]=function(_0x57af3a,_0x347053){const _0x375075=_0x271fc7;let _0x2571c6={};const _0x30dc37={};let _0x127429,_0x5d5381;return db[_0x375075('0x18')]['findOne']({'where':{'id':_0x57af3a[_0x375075('0x21')]['id']}})['then'](handleEntityNotFound(_0x347053,null))[_0x375075('0x29')](function(_0x4eab56){const _0xbb8a49=_0x375075;if(_0x4eab56)return _0x127429=_0x4eab56,_0x30dc37[_0xbb8a49('0x0')]=_[_0xbb8a49('0x34')](db['Condition'][_0xbb8a49('0x33')]),_0x30dc37['query']=_[_0xbb8a49('0x34')](_0x57af3a['query']),_0x30dc37[_0xbb8a49('0x26')]=_[_0xbb8a49('0x22')](_0x30dc37[_0xbb8a49('0x0')],_0x30dc37[_0xbb8a49('0x7')]),_0x2571c6[_0xbb8a49('0x2f')]=_[_0xbb8a49('0x22')](_0x30dc37[_0xbb8a49('0x0')],qs[_0xbb8a49('0x2')](_0x57af3a['query']['fields'])),_0x2571c6[_0xbb8a49('0x2f')]=_0x2571c6[_0xbb8a49('0x2f')]['length']?_0x2571c6['attributes']:_0x30dc37[_0xbb8a49('0x0')],_0x2571c6['order']=qs[_0xbb8a49('0x36')](_0x57af3a['query'][_0xbb8a49('0x36')]),_0x2571c6['where']=qs[_0xbb8a49('0x26')](_[_0xbb8a49('0xa')](_0x57af3a[_0xbb8a49('0x7')],_0x30dc37[_0xbb8a49('0x26')])),_0x57af3a[_0xbb8a49('0x7')][_0xbb8a49('0x3f')]&&(_0x2571c6[_0xbb8a49('0x37')]=_['merge'](_0x2571c6['where'],{[Op['or']]:_[_0xbb8a49('0x35')](_0x2571c6[_0xbb8a49('0x2f')],function(_0x2a4fa8){const _0x1ed5c0=_0xbb8a49,_0x2ae97c={};return _0x2ae97c[_0x2a4fa8]={[Op['like']]:'%'+_0x57af3a[_0x1ed5c0('0x7')][_0x1ed5c0('0x3f')]+'%'},_0x2ae97c;})})),_0x2571c6=_[_0xbb8a49('0x1e')]({},_0x2571c6,_0x57af3a[_0xbb8a49('0x6')]),_0x127429[_0xbb8a49('0x31')](_0x2571c6);})[_0x375075('0x29')](function(_0x56fc4f){const _0x515bf3=_0x375075;if(_0x56fc4f)return _0x5d5381=_0x56fc4f['length'],typeof _0x57af3a['query'][_0x515bf3('0xc')]==='undefined'&&(_0x2571c6[_0x515bf3('0x39')]=qs[_0x515bf3('0x39')](_0x57af3a[_0x515bf3('0x7')][_0x515bf3('0x39')]),_0x2571c6[_0x515bf3('0x25')]=qs[_0x515bf3('0x25')](_0x57af3a['query'][_0x515bf3('0x25')])),_0x127429[_0x515bf3('0x31')](_0x2571c6);})[_0x375075('0x29')](function(_0x6659fb){if(_0x6659fb)return _0x6659fb?{'count':_0x5d5381,'rows':_0x6659fb}:null;})[_0x375075('0x29')](respondWithResult(_0x347053,null))[_0x375075('0x16')](handleError(_0x347053,null));},exports['addAction']=function(_0x321082,_0x700bb0){const _0x358fd9=_0x271fc7;return _0x321082[_0x358fd9('0x23')]['id']&&delete _0x321082[_0x358fd9('0x23')]['id'],db[_0x358fd9('0x18')][_0x358fd9('0x28')]({'where':{'id':_0x321082[_0x358fd9('0x21')]['id']}})['then'](handleEntityNotFound(_0x700bb0,null))[_0x358fd9('0x29')](function(_0x4f726f){const _0x14b134=_0x358fd9;if(_0x4f726f)return _0x321082['body'][_0x14b134('0x1d')]=_0x4f726f['id'],db['Action']['create'](_0x321082[_0x14b134('0x23')]);})[_0x358fd9('0x29')](respondWithResult(_0x700bb0,null))[_0x358fd9('0x16')](handleError(_0x700bb0,null));},exports[_0x271fc7('0x27')]=function(_0x44816e,_0x461232){const _0x17dd44=_0x271fc7;let _0x1f6198={};const _0x30b828={};let _0x10f3da,_0x38579f;return db['Trigger'][_0x17dd44('0x28')]({'where':{'id':_0x44816e[_0x17dd44('0x21')]['id']}})[_0x17dd44('0x29')](handleEntityNotFound(_0x461232,null))[_0x17dd44('0x29')](function(_0x2e9b44){const _0x4259fc=_0x17dd44;if(_0x2e9b44)return _0x10f3da=_0x2e9b44,_0x30b828['model']=_[_0x4259fc('0x34')](db[_0x4259fc('0x1')][_0x4259fc('0x33')]),_0x30b828['query']=_[_0x4259fc('0x34')](_0x44816e[_0x4259fc('0x7')]),_0x30b828[_0x4259fc('0x26')]=_[_0x4259fc('0x22')](_0x30b828[_0x4259fc('0x0')],_0x30b828[_0x4259fc('0x7')]),_0x1f6198[_0x4259fc('0x2f')]=_[_0x4259fc('0x22')](_0x30b828[_0x4259fc('0x0')],qs[_0x4259fc('0x2')](_0x44816e[_0x4259fc('0x7')]['fields'])),_0x1f6198[_0x4259fc('0x2f')]=_0x1f6198[_0x4259fc('0x2f')][_0x4259fc('0xf')]?_0x1f6198[_0x4259fc('0x2f')]:_0x30b828[_0x4259fc('0x0')],_0x1f6198['order']=qs[_0x4259fc('0x36')](_0x44816e[_0x4259fc('0x7')][_0x4259fc('0x36')]),_0x1f6198[_0x4259fc('0x37')]=qs[_0x4259fc('0x26')](_[_0x4259fc('0xa')](_0x44816e['query'],_0x30b828['filters'])),_0x44816e[_0x4259fc('0x7')][_0x4259fc('0x3f')]&&(_0x1f6198['where']=_[_0x4259fc('0x1e')](_0x1f6198[_0x4259fc('0x37')],{[Op['or']]:_[_0x4259fc('0x35')](_0x1f6198[_0x4259fc('0x2f')],function(_0x54e128){const _0x1b1600=_0x4259fc,_0x5c607a={};return _0x5c607a[_0x54e128]={[Op[_0x1b1600('0x17')]]:'%'+_0x44816e[_0x1b1600('0x7')][_0x1b1600('0x3f')]+'%'},_0x5c607a;})})),_0x1f6198=_[_0x4259fc('0x1e')]({},_0x1f6198,_0x44816e[_0x4259fc('0x6')]),_0x10f3da[_0x4259fc('0x27')](_0x1f6198);})[_0x17dd44('0x29')](function(_0xa3a8c7){const _0x17eae8=_0x17dd44;if(_0xa3a8c7)return _0x38579f=_0xa3a8c7[_0x17eae8('0xf')],typeof _0x44816e[_0x17eae8('0x7')][_0x17eae8('0xc')]==='undefined'&&(_0x1f6198['limit']=qs[_0x17eae8('0x39')](_0x44816e['query'][_0x17eae8('0x39')]),_0x1f6198[_0x17eae8('0x25')]=qs['offset'](_0x44816e['query']['offset'])),_0x10f3da[_0x17eae8('0x27')](_0x1f6198);})['then'](function(_0x9ddb48){if(_0x9ddb48)return _0x9ddb48?{'count':_0x38579f,'rows':_0x9ddb48}:null;})[_0x17dd44('0x29')](respondWithResult(_0x461232,null))['catch'](handleError(_0x461232,null));};