Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / cmHopperHistory / cmHopperHistory.controller.js
index f877e52..6787f12 100644 (file)
@@ -1 +1 @@
-const a152_0x29e5=['rawAttributes','error','create','stack','name','query','../../config/logger','status','keys','count','merge','sendStatus','sequelize','then','catch','Content-Range','type','set','fields','filters','update','api','sort','like','includeAll','model','undefined','params','order','key','offset','where','limit','VIRTUAL','filter','lodash','uniqueid','index','CmHopperHistory','fieldName','include','map','rows','attributes','length','send','intersection','body','findAll','options','findOne','show','json'];(function(_0x48eb33,_0x29e579){const _0x4b2581=function(_0x566e7c){while(--_0x566e7c){_0x48eb33['push'](_0x48eb33['shift']());}};_0x4b2581(++_0x29e579);}(a152_0x29e5,0xbf));const a152_0x4b25=function(_0x48eb33,_0x29e579){_0x48eb33=_0x48eb33-0x0;let _0x4b2581=a152_0x29e5[_0x48eb33];return _0x4b2581;};const _0x238b53=a152_0x4b25;'use strict';const _=require(_0x238b53('0x3')),qs=require('../../components/parsers/qs'),logger=require(_0x238b53('0x1b'))(_0x238b53('0x2a')),db=require('../../mysqldb')['db'],{Op}=require(_0x238b53('0x21'));function respondWithResult(_0x566e7c,_0x5223c7){return _0x5223c7=_0x5223c7||0xc8,function(_0x5513e8){const _0x20c322=a152_0x4b25;if(_0x5513e8)return _0x566e7c[_0x20c322('0x1c')](_0x5223c7)[_0x20c322('0x14')](_0x5513e8);};}function respondWithFilteredResult(_0x10b7f7,_0xacdde9){return function(_0x3d433b){const _0x4cd8eb=a152_0x4b25;if(_0x3d433b){const _0x591e46=_0x3d433b[_0x4cd8eb('0x1e')],_0x51e1d0=_0xacdde9['offset'];let _0x1f6a18=_0xacdde9['offset']+_0xacdde9['limit'],_0x369147;return _0x1f6a18>=_0x591e46?(_0x1f6a18=_0x591e46,_0x369147=0xc8):_0x369147=0xce,_0x10b7f7[_0x4cd8eb('0x1c')](_0x369147),_0x10b7f7[_0x4cd8eb('0x26')](_0x4cd8eb('0x24'),_0x51e1d0+'-'+_0x1f6a18+'/'+_0x591e46)[_0x4cd8eb('0x14')](_0x3d433b);}return null;};}function saveUpdates(_0x2df8f4){return function(_0x47634a){const _0x438d88=a152_0x4b25;if(_0x47634a)return _0x47634a[_0x438d88('0x29')](_0x2df8f4)[_0x438d88('0x22')](function(_0x97aeab){return _0x97aeab;});return null;};}function handleEntityNotFound(_0x559c9e){return function(_0x1f9ee4){const _0x3980a6=a152_0x4b25;return!_0x1f9ee4&&_0x559c9e[_0x3980a6('0x20')](0x194),_0x1f9ee4;};}function handleError(_0x2e336f,_0x5c6e92){return _0x5c6e92=_0x5c6e92||0x1f4,function(_0x4e4868){const _0x35f380=a152_0x4b25;logger[_0x35f380('0x16')](_0x4e4868[_0x35f380('0x18')]),_0x4e4868[_0x35f380('0x19')]&&delete _0x4e4868[_0x35f380('0x19')],_0x2e336f[_0x35f380('0x1c')](_0x5c6e92)[_0x35f380('0xd')](_0x4e4868);};}exports[_0x238b53('0x5')]=function(_0x5d6c59,_0x34fbf6){const _0x562486=_0x238b53;let _0x8520d4={};const _0x1988d1={},_0x3756ef={'count':0x0,'rows':[]},_0x263e46=_[_0x562486('0x9')](db['CmHopperHistory']['rawAttributes'],function(_0x9ee28c){const _0x51b899=_0x562486;return{'name':_0x9ee28c[_0x51b899('0x7')],'type':_0x9ee28c['type'][_0x51b899('0x32')]};});_0x1988d1[_0x562486('0x2e')]=_[_0x562486('0x9')](_0x263e46,_0x562486('0x19')),_0x1988d1[_0x562486('0x1a')]=_[_0x562486('0x1d')](_0x5d6c59[_0x562486('0x1a')]),_0x1988d1[_0x562486('0x28')]=_[_0x562486('0xe')](_0x1988d1[_0x562486('0x2e')],_0x1988d1[_0x562486('0x1a')]),_0x8520d4[_0x562486('0xb')]=_['intersection'](_0x1988d1[_0x562486('0x2e')],qs['fields'](_0x5d6c59[_0x562486('0x1a')][_0x562486('0x27')])),_0x8520d4['attributes']=_0x8520d4[_0x562486('0xb')][_0x562486('0xc')]?_0x8520d4['attributes']:_0x1988d1[_0x562486('0x2e')];typeof _0x5d6c59[_0x562486('0x1a')]['nolimit']===_0x562486('0x2f')&&(_0x8520d4[_0x562486('0x0')]=qs[_0x562486('0x0')](_0x5d6c59['query'][_0x562486('0x0')]),_0x8520d4[_0x562486('0x33')]=qs[_0x562486('0x33')](_0x5d6c59[_0x562486('0x1a')][_0x562486('0x33')]));_0x8520d4[_0x562486('0x31')]=qs[_0x562486('0x2b')](_0x5d6c59[_0x562486('0x1a')]['sort']),_0x8520d4['where']=qs['filters'](_['pick'](_0x5d6c59['query'],_0x1988d1[_0x562486('0x28')]),_0x263e46);_0x5d6c59[_0x562486('0x1a')][_0x562486('0x2')]&&(_0x8520d4['where']=_[_0x562486('0x1f')](_0x8520d4[_0x562486('0x34')],{[Op['or']]:_[_0x562486('0x9')](_0x263e46,function(_0x2c91b1){const _0x631ca6=_0x562486;if(_0x2c91b1[_0x631ca6('0x25')]!==_0x631ca6('0x1')){const _0x58fcf9={};return _0x58fcf9[_0x2c91b1['name']]={[Op[_0x631ca6('0x2c')]]:'%'+_0x5d6c59[_0x631ca6('0x1a')][_0x631ca6('0x2')]+'%'},_0x58fcf9;}})}));_0x8520d4=_['merge']({},_0x8520d4,_0x5d6c59[_0x562486('0x11')]);const _0x336228={'where':_0x8520d4['where']};return db[_0x562486('0x6')][_0x562486('0x1e')](_0x336228)[_0x562486('0x22')](function(_0x273b9a){const _0x59df6b=_0x562486;return _0x3756ef[_0x59df6b('0x1e')]=_0x273b9a,_0x5d6c59[_0x59df6b('0x1a')]['includeAll']&&(_0x8520d4[_0x59df6b('0x8')]=[{'all':!![]}]),db[_0x59df6b('0x6')][_0x59df6b('0x10')](_0x8520d4);})[_0x562486('0x22')](function(_0x5920b5){const _0x12a363=_0x562486;return _0x3756ef[_0x12a363('0xa')]=_0x5920b5,_0x3756ef;})['then'](respondWithFilteredResult(_0x34fbf6,_0x8520d4))[_0x562486('0x23')](handleError(_0x34fbf6,null));},exports[_0x238b53('0x13')]=function(_0x4bfdc0,_0x52069e){const _0x260a1b=_0x238b53;let _0x2f0efa={'raw':!![],'where':{'id':_0x4bfdc0[_0x260a1b('0x30')]['id']}};const _0xd921e1={};return _0xd921e1[_0x260a1b('0x2e')]=_[_0x260a1b('0x1d')](db[_0x260a1b('0x6')][_0x260a1b('0x15')]),_0xd921e1[_0x260a1b('0x1a')]=_[_0x260a1b('0x1d')](_0x4bfdc0[_0x260a1b('0x1a')]),_0xd921e1[_0x260a1b('0x28')]=_[_0x260a1b('0xe')](_0xd921e1[_0x260a1b('0x2e')],_0xd921e1['query']),_0x2f0efa['attributes']=_[_0x260a1b('0xe')](_0xd921e1['model'],qs[_0x260a1b('0x27')](_0x4bfdc0['query'][_0x260a1b('0x27')])),_0x2f0efa[_0x260a1b('0xb')]=_0x2f0efa[_0x260a1b('0xb')][_0x260a1b('0xc')]?_0x2f0efa[_0x260a1b('0xb')]:_0xd921e1[_0x260a1b('0x2e')],_0x4bfdc0[_0x260a1b('0x1a')][_0x260a1b('0x2d')]&&(_0x2f0efa[_0x260a1b('0x8')]=[{'all':!![]}]),_0x2f0efa=_[_0x260a1b('0x1f')]({},_0x2f0efa,_0x4bfdc0[_0x260a1b('0x11')]),db[_0x260a1b('0x6')]['findOne'](_0x2f0efa)['then'](handleEntityNotFound(_0x52069e,null))['then'](respondWithResult(_0x52069e,null))['catch'](handleError(_0x52069e,null));},exports['create']=function(_0x4e9373,_0x3220cb){const _0xa9632b=_0x238b53;return db['CmHopperHistory'][_0xa9632b('0x17')](_0x4e9373[_0xa9632b('0xf')],{})[_0xa9632b('0x22')](respondWithResult(_0x3220cb,0xc9))['catch'](handleError(_0x3220cb,null));},exports['describe']=function(_0x463585,_0x70128b){const _0x15a9af=_0x238b53;return db[_0x15a9af('0x6')]['describe']()[_0x15a9af('0x22')](respondWithResult(_0x70128b,null))[_0x15a9af('0x23')](handleError(_0x70128b,null));},exports[_0x238b53('0x29')]=function(_0xcf2cdc,_0x5b0069){const _0x4adabf=_0x238b53;return _0xcf2cdc[_0x4adabf('0xf')]['uniqueid']&&delete _0xcf2cdc[_0x4adabf('0xf')][_0x4adabf('0x4')],db['CmHopperHistory'][_0x4adabf('0x12')]({'where':{'uniqueid':_0xcf2cdc[_0x4adabf('0x30')]['id']}})[_0x4adabf('0x22')](handleEntityNotFound(_0x5b0069,null))[_0x4adabf('0x22')](saveUpdates(_0xcf2cdc[_0x4adabf('0xf')],null))[_0x4adabf('0x22')](respondWithResult(_0x5b0069,null))[_0x4adabf('0x23')](handleError(_0x5b0069,null));};
\ No newline at end of file
+const a152_0x5d8a=['create','include','stack','fieldName','sort','where','includeAll','fields','type','Content-Range','show','model','like','filters','../../mysqldb','nolimit','set','catch','json','name','intersection','map','index','VIRTUAL','sendStatus','merge','limit','params','CmHopperHistory','describe','sequelize','count','body','update','query','offset','filter','../../config/logger','../../components/parsers/qs','attributes','findAll','length','findOne','undefined','options','api','rawAttributes','uniqueid','lodash','then','status','keys','rows','key'];(function(_0x1f1ded,_0x5d8a61){const _0x8a7004=function(_0x1de8f7){while(--_0x1de8f7){_0x1f1ded['push'](_0x1f1ded['shift']());}};_0x8a7004(++_0x5d8a61);}(a152_0x5d8a,0xa9));const a152_0x8a70=function(_0x1f1ded,_0x5d8a61){_0x1f1ded=_0x1f1ded-0x0;let _0x8a7004=a152_0x5d8a[_0x1f1ded];return _0x8a7004;};const _0x26dc88=a152_0x8a70;'use strict';const _=require(_0x26dc88('0x29')),qs=require(_0x26dc88('0x1f')),logger=require(_0x26dc88('0x1e'))(_0x26dc88('0x26')),db=require(_0x26dc88('0x7'))['db'],{Op}=require(_0x26dc88('0x17'));function respondWithResult(_0x1de8f7,_0x2cea49){return _0x2cea49=_0x2cea49||0xc8,function(_0x334b92){const _0x210c57=a152_0x8a70;if(_0x334b92)return _0x1de8f7[_0x210c57('0x2b')](_0x2cea49)[_0x210c57('0xb')](_0x334b92);};}function respondWithFilteredResult(_0x1499a8,_0x189fdd){return function(_0x1ce343){const _0x71bb72=a152_0x8a70;if(_0x1ce343){const _0x1eb99e=_0x1ce343[_0x71bb72('0x18')],_0x7476ed=_0x189fdd[_0x71bb72('0x1c')];let _0x1c92ca=_0x189fdd[_0x71bb72('0x1c')]+_0x189fdd[_0x71bb72('0x13')],_0x386951;return _0x1c92ca>=_0x1eb99e?(_0x1c92ca=_0x1eb99e,_0x386951=0xc8):_0x386951=0xce,_0x1499a8[_0x71bb72('0x2b')](_0x386951),_0x1499a8[_0x71bb72('0x9')](_0x71bb72('0x2'),_0x7476ed+'-'+_0x1c92ca+'/'+_0x1eb99e)[_0x71bb72('0xb')](_0x1ce343);}return null;};}function saveUpdates(_0x8644a8){return function(_0x5258d9){const _0x561725=a152_0x8a70;if(_0x5258d9)return _0x5258d9[_0x561725('0x1a')](_0x8644a8)['then'](function(_0x3ef8d2){return _0x3ef8d2;});return null;};}function handleEntityNotFound(_0x487e67){return function(_0x5f51a4){const _0x1cd34d=a152_0x8a70;return!_0x5f51a4&&_0x487e67[_0x1cd34d('0x11')](0x194),_0x5f51a4;};}function handleError(_0x5d44f3,_0x1b060d){return _0x1b060d=_0x1b060d||0x1f4,function(_0x1e0b03){const _0x4c7fd8=a152_0x8a70;logger['error'](_0x1e0b03[_0x4c7fd8('0x31')]),_0x1e0b03[_0x4c7fd8('0xc')]&&delete _0x1e0b03[_0x4c7fd8('0xc')],_0x5d44f3[_0x4c7fd8('0x2b')](_0x1b060d)['send'](_0x1e0b03);};}exports[_0x26dc88('0xf')]=function(_0x231a00,_0x10d2ad){const _0x47fc3e=_0x26dc88;let _0x266b0c={};const _0x450f71={},_0x33af7f={'count':0x0,'rows':[]},_0x4e3039=_[_0x47fc3e('0xe')](db['CmHopperHistory'][_0x47fc3e('0x27')],function(_0x317ea8){const _0x1c6590=_0x47fc3e;return{'name':_0x317ea8[_0x1c6590('0x32')],'type':_0x317ea8[_0x1c6590('0x1')][_0x1c6590('0x2e')]};});_0x450f71[_0x47fc3e('0x4')]=_[_0x47fc3e('0xe')](_0x4e3039,_0x47fc3e('0xc')),_0x450f71[_0x47fc3e('0x1b')]=_[_0x47fc3e('0x2c')](_0x231a00[_0x47fc3e('0x1b')]),_0x450f71[_0x47fc3e('0x6')]=_[_0x47fc3e('0xd')](_0x450f71[_0x47fc3e('0x4')],_0x450f71['query']),_0x266b0c[_0x47fc3e('0x20')]=_[_0x47fc3e('0xd')](_0x450f71[_0x47fc3e('0x4')],qs[_0x47fc3e('0x0')](_0x231a00[_0x47fc3e('0x1b')][_0x47fc3e('0x0')])),_0x266b0c[_0x47fc3e('0x20')]=_0x266b0c[_0x47fc3e('0x20')][_0x47fc3e('0x22')]?_0x266b0c[_0x47fc3e('0x20')]:_0x450f71[_0x47fc3e('0x4')];typeof _0x231a00[_0x47fc3e('0x1b')][_0x47fc3e('0x8')]===_0x47fc3e('0x24')&&(_0x266b0c[_0x47fc3e('0x13')]=qs['limit'](_0x231a00[_0x47fc3e('0x1b')][_0x47fc3e('0x13')]),_0x266b0c[_0x47fc3e('0x1c')]=qs[_0x47fc3e('0x1c')](_0x231a00[_0x47fc3e('0x1b')][_0x47fc3e('0x1c')]));_0x266b0c['order']=qs['sort'](_0x231a00[_0x47fc3e('0x1b')][_0x47fc3e('0x33')]),_0x266b0c[_0x47fc3e('0x34')]=qs['filters'](_['pick'](_0x231a00[_0x47fc3e('0x1b')],_0x450f71['filters']),_0x4e3039);_0x231a00[_0x47fc3e('0x1b')]['filter']&&(_0x266b0c[_0x47fc3e('0x34')]=_[_0x47fc3e('0x12')](_0x266b0c[_0x47fc3e('0x34')],{[Op['or']]:_[_0x47fc3e('0xe')](_0x4e3039,function(_0x1be156){const _0x340143=_0x47fc3e;if(_0x1be156[_0x340143('0x1')]!==_0x340143('0x10')){const _0x2f0670={};return _0x2f0670[_0x1be156[_0x340143('0xc')]]={[Op[_0x340143('0x5')]]:'%'+_0x231a00[_0x340143('0x1b')][_0x340143('0x1d')]+'%'},_0x2f0670;}})}));_0x266b0c=_[_0x47fc3e('0x12')]({},_0x266b0c,_0x231a00[_0x47fc3e('0x25')]);const _0x2f44a1={'where':_0x266b0c[_0x47fc3e('0x34')]};return db[_0x47fc3e('0x15')]['count'](_0x2f44a1)[_0x47fc3e('0x2a')](function(_0x249d56){const _0x3e2c1f=_0x47fc3e;return _0x33af7f[_0x3e2c1f('0x18')]=_0x249d56,_0x231a00[_0x3e2c1f('0x1b')]['includeAll']&&(_0x266b0c['include']=[{'all':!![]}]),db[_0x3e2c1f('0x15')][_0x3e2c1f('0x21')](_0x266b0c);})['then'](function(_0x3fd59a){const _0x5e0ead=_0x47fc3e;return _0x33af7f[_0x5e0ead('0x2d')]=_0x3fd59a,_0x33af7f;})[_0x47fc3e('0x2a')](respondWithFilteredResult(_0x10d2ad,_0x266b0c))[_0x47fc3e('0xa')](handleError(_0x10d2ad,null));},exports[_0x26dc88('0x3')]=function(_0x5e43ff,_0x2079fc){const _0x17ead3=_0x26dc88;let _0x5654e7={'raw':!![],'where':{'id':_0x5e43ff[_0x17ead3('0x14')]['id']}};const _0x2674dc={};return _0x2674dc['model']=_[_0x17ead3('0x2c')](db[_0x17ead3('0x15')][_0x17ead3('0x27')]),_0x2674dc[_0x17ead3('0x1b')]=_[_0x17ead3('0x2c')](_0x5e43ff[_0x17ead3('0x1b')]),_0x2674dc['filters']=_['intersection'](_0x2674dc[_0x17ead3('0x4')],_0x2674dc[_0x17ead3('0x1b')]),_0x5654e7['attributes']=_['intersection'](_0x2674dc[_0x17ead3('0x4')],qs[_0x17ead3('0x0')](_0x5e43ff[_0x17ead3('0x1b')][_0x17ead3('0x0')])),_0x5654e7[_0x17ead3('0x20')]=_0x5654e7[_0x17ead3('0x20')][_0x17ead3('0x22')]?_0x5654e7[_0x17ead3('0x20')]:_0x2674dc[_0x17ead3('0x4')],_0x5e43ff[_0x17ead3('0x1b')][_0x17ead3('0x35')]&&(_0x5654e7[_0x17ead3('0x30')]=[{'all':!![]}]),_0x5654e7=_['merge']({},_0x5654e7,_0x5e43ff['options']),db[_0x17ead3('0x15')][_0x17ead3('0x23')](_0x5654e7)[_0x17ead3('0x2a')](handleEntityNotFound(_0x2079fc,null))[_0x17ead3('0x2a')](respondWithResult(_0x2079fc,null))[_0x17ead3('0xa')](handleError(_0x2079fc,null));},exports[_0x26dc88('0x2f')]=function(_0x8c2c7b,_0x58b315){const _0x28ae76=_0x26dc88;return db[_0x28ae76('0x15')][_0x28ae76('0x2f')](_0x8c2c7b[_0x28ae76('0x19')],{})[_0x28ae76('0x2a')](respondWithResult(_0x58b315,0xc9))[_0x28ae76('0xa')](handleError(_0x58b315,null));},exports[_0x26dc88('0x16')]=function(_0x36f725,_0x426786){const _0x8d4199=_0x26dc88;return db[_0x8d4199('0x15')]['describe']()[_0x8d4199('0x2a')](respondWithResult(_0x426786,null))[_0x8d4199('0xa')](handleError(_0x426786,null));},exports[_0x26dc88('0x1a')]=function(_0x3e23d6,_0x17d24b){const _0x162d8d=_0x26dc88;return _0x3e23d6[_0x162d8d('0x19')][_0x162d8d('0x28')]&&delete _0x3e23d6[_0x162d8d('0x19')][_0x162d8d('0x28')],db[_0x162d8d('0x15')][_0x162d8d('0x23')]({'where':{'uniqueid':_0x3e23d6['params']['id']}})[_0x162d8d('0x2a')](handleEntityNotFound(_0x17d24b,null))['then'](saveUpdates(_0x3e23d6[_0x162d8d('0x19')],null))['then'](respondWithResult(_0x17d24b,null))['catch'](handleError(_0x17d24b,null));};
\ No newline at end of file