Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / cmHopperHistory / cmHopperHistory.controller.js
index af677ba..ab57255 100644 (file)
@@ -1 +1 @@
-const a182_0x2ffc=['undefined','fieldName','describe','map','attributes','keys','order','status','update','where','query','filters','include','rows','findOne','error','nolimit','model','sequelize','set','catch','api','filter','type','intersection','then','offset','uniqueid','key','includeAll','send','like','options','count','create','stack','name','limit','index','rawAttributes','sort','params','VIRTUAL','Content-Range','sendStatus','CmHopperHistory','body','json','merge','length'];(function(_0x4e3432,_0x26b32f){const _0x2ffc93=function(_0x193239){while(--_0x193239){_0x4e3432['push'](_0x4e3432['shift']());}};_0x2ffc93(++_0x26b32f);}(a182_0x2ffc,0x119));const a182_0x1932=function(_0x4e3432,_0x26b32f){_0x4e3432=_0x4e3432-0x116;let _0x2ffc93=a182_0x2ffc[_0x4e3432];return _0x2ffc93;};const a182_0xa4bf7a=a182_0x1932;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(a182_0xa4bf7a(0x13e)),{db}=require('../../mysqldb'),{Op}=require(a182_0xa4bf7a(0x13b));function respondWithResult(_0x4da4f6,_0x27b556){return _0x27b556=_0x27b556||0xc8,function(_0x5e1ed4){const _0x24dd64=a182_0x1932;if(_0x5e1ed4)return _0x4da4f6[_0x24dd64(0x130)](_0x27b556)[_0x24dd64(0x126)](_0x5e1ed4);};}function respondWithFilteredResult(_0x32a262,_0x153583){return function(_0x18f18c){const _0x1e0968=a182_0x1932;if(_0x18f18c){const _0xd28e97=_0x18f18c[_0x1e0968(0x118)],_0x8fc678=_0x153583['offset'];let _0x41370f=_0x153583[_0x1e0968(0x143)]+_0x153583[_0x1e0968(0x11c)],_0x371d90;return _0x41370f>=_0xd28e97?(_0x41370f=_0xd28e97,_0x371d90=0xc8):_0x371d90=0xce,_0x32a262[_0x1e0968(0x130)](_0x371d90),_0x32a262[_0x1e0968(0x13c)](_0x1e0968(0x122),_0x8fc678+'-'+_0x41370f+'/'+_0xd28e97)[_0x1e0968(0x126)](_0x18f18c);}return null;};}function saveUpdates(_0xbd134a){return function(_0x27887e){const _0x1261c0=a182_0x1932;if(_0x27887e)return _0x27887e[_0x1261c0(0x131)](_0xbd134a)[_0x1261c0(0x142)](function(_0x4ac3e8){return _0x4ac3e8;});return null;};}function handleEntityNotFound(_0x3089ec){return function(_0x5925e8){const _0x43c733=a182_0x1932;return!_0x5925e8&&_0x3089ec[_0x43c733(0x123)](0x194),_0x5925e8;};}function handleError(_0xfa819,_0x5968b6){return _0x5968b6=_0x5968b6||0x1f4,function(_0x466e5a){const _0x847346=a182_0x1932;logger[_0x847346(0x138)](_0x466e5a[_0x847346(0x11a)]),_0x466e5a[_0x847346(0x11b)]&&delete _0x466e5a[_0x847346(0x11b)],_0xfa819[_0x847346(0x130)](_0x5968b6)[_0x847346(0x147)](_0x466e5a);};}exports[a182_0xa4bf7a(0x11d)]=function(_0x3f9def,_0x147986){const _0x4fb035=a182_0xa4bf7a;let _0x302344={};const _0xba7d72={},_0x1cc556={'count':0x0,'rows':[]},_0x17add0=_[_0x4fb035(0x12c)](db[_0x4fb035(0x124)][_0x4fb035(0x11e)],function(_0x52eb91){const _0x2fce71=_0x4fb035;return{'name':_0x52eb91[_0x2fce71(0x12a)],'type':_0x52eb91[_0x2fce71(0x140)][_0x2fce71(0x145)]};});_0xba7d72[_0x4fb035(0x13a)]=_[_0x4fb035(0x12c)](_0x17add0,'name'),_0xba7d72['query']=_['keys'](_0x3f9def['query']),_0xba7d72[_0x4fb035(0x134)]=_['intersection'](_0xba7d72[_0x4fb035(0x13a)],_0xba7d72['query']),_0x302344['attributes']=_[_0x4fb035(0x141)](_0xba7d72[_0x4fb035(0x13a)],qs['fields'](_0x3f9def[_0x4fb035(0x133)]['fields'])),_0x302344[_0x4fb035(0x12d)]=_0x302344[_0x4fb035(0x12d)][_0x4fb035(0x128)]?_0x302344[_0x4fb035(0x12d)]:_0xba7d72[_0x4fb035(0x13a)];typeof _0x3f9def[_0x4fb035(0x133)][_0x4fb035(0x139)]===_0x4fb035(0x129)&&(_0x302344[_0x4fb035(0x11c)]=qs['limit'](_0x3f9def[_0x4fb035(0x133)][_0x4fb035(0x11c)]),_0x302344['offset']=qs['offset'](_0x3f9def[_0x4fb035(0x133)]['offset']));_0x302344[_0x4fb035(0x12f)]=qs[_0x4fb035(0x11f)](_0x3f9def['query'][_0x4fb035(0x11f)]),_0x302344[_0x4fb035(0x132)]=qs[_0x4fb035(0x134)](_['pick'](_0x3f9def['query'],_0xba7d72[_0x4fb035(0x134)]),_0x17add0);_0x3f9def[_0x4fb035(0x133)][_0x4fb035(0x13f)]&&(_0x302344[_0x4fb035(0x132)]=_['merge'](_0x302344[_0x4fb035(0x132)],{[Op['or']]:_[_0x4fb035(0x12c)](_0x17add0,function(_0x59afaa){const _0x42d696=_0x4fb035;if(_0x59afaa[_0x42d696(0x140)]!==_0x42d696(0x121)){const _0x43b832={};return _0x43b832[_0x59afaa[_0x42d696(0x11b)]]={[Op[_0x42d696(0x116)]]:'%'+_0x3f9def[_0x42d696(0x133)][_0x42d696(0x13f)]+'%'},_0x43b832;}})}));_0x302344=_[_0x4fb035(0x127)]({},_0x302344,_0x3f9def[_0x4fb035(0x117)]);const _0x4d0a92={'where':_0x302344[_0x4fb035(0x132)]};return db[_0x4fb035(0x124)]['count'](_0x4d0a92)[_0x4fb035(0x142)](function(_0x4209d6){const _0x5d1a7e=_0x4fb035;return _0x1cc556[_0x5d1a7e(0x118)]=_0x4209d6,_0x3f9def[_0x5d1a7e(0x133)]['includeAll']&&(_0x302344['include']=[{'all':!![]}]),db[_0x5d1a7e(0x124)]['findAll'](_0x302344);})[_0x4fb035(0x142)](function(_0x1a91e3){const _0x31f374=_0x4fb035;return _0x1cc556[_0x31f374(0x136)]=_0x1a91e3,_0x1cc556;})[_0x4fb035(0x142)](respondWithFilteredResult(_0x147986,_0x302344))[_0x4fb035(0x13d)](handleError(_0x147986,null));},exports['show']=function(_0x2eee86,_0x1177e6){const _0x2748d5=a182_0xa4bf7a;let _0x5bdb3a={'raw':!![],'where':{'id':_0x2eee86[_0x2748d5(0x120)]['id']}};const _0xb3bfb6={};return _0xb3bfb6[_0x2748d5(0x13a)]=_['keys'](db[_0x2748d5(0x124)]['rawAttributes']),_0xb3bfb6[_0x2748d5(0x133)]=_[_0x2748d5(0x12e)](_0x2eee86[_0x2748d5(0x133)]),_0xb3bfb6[_0x2748d5(0x134)]=_[_0x2748d5(0x141)](_0xb3bfb6[_0x2748d5(0x13a)],_0xb3bfb6['query']),_0x5bdb3a[_0x2748d5(0x12d)]=_[_0x2748d5(0x141)](_0xb3bfb6[_0x2748d5(0x13a)],qs['fields'](_0x2eee86[_0x2748d5(0x133)]['fields'])),_0x5bdb3a['attributes']=_0x5bdb3a[_0x2748d5(0x12d)][_0x2748d5(0x128)]?_0x5bdb3a[_0x2748d5(0x12d)]:_0xb3bfb6['model'],_0x2eee86[_0x2748d5(0x133)][_0x2748d5(0x146)]&&(_0x5bdb3a[_0x2748d5(0x135)]=[{'all':!![]}]),_0x5bdb3a=_[_0x2748d5(0x127)]({},_0x5bdb3a,_0x2eee86['options']),db[_0x2748d5(0x124)][_0x2748d5(0x137)](_0x5bdb3a)[_0x2748d5(0x142)](handleEntityNotFound(_0x1177e6,null))[_0x2748d5(0x142)](respondWithResult(_0x1177e6,null))[_0x2748d5(0x13d)](handleError(_0x1177e6,null));},exports[a182_0xa4bf7a(0x119)]=function(_0x1fc5ee,_0x5dd890){const _0x5b54f3=a182_0xa4bf7a;return db[_0x5b54f3(0x124)][_0x5b54f3(0x119)](_0x1fc5ee[_0x5b54f3(0x125)],{})[_0x5b54f3(0x142)](respondWithResult(_0x5dd890,0xc9))['catch'](handleError(_0x5dd890,null));},exports['describe']=function(_0xde01fb,_0x1e43d3){const _0x16421f=a182_0xa4bf7a;return db['CmHopperHistory'][_0x16421f(0x12b)]()[_0x16421f(0x142)](respondWithResult(_0x1e43d3,null))[_0x16421f(0x13d)](handleError(_0x1e43d3,null));},exports[a182_0xa4bf7a(0x131)]=function(_0x1ac3c4,_0x5a7262){const _0x2b5514=a182_0xa4bf7a;return _0x1ac3c4[_0x2b5514(0x125)][_0x2b5514(0x144)]&&delete _0x1ac3c4[_0x2b5514(0x125)]['uniqueid'],db[_0x2b5514(0x124)][_0x2b5514(0x137)]({'where':{'uniqueid':_0x1ac3c4[_0x2b5514(0x120)]['id']}})[_0x2b5514(0x142)](handleEntityNotFound(_0x5a7262,null))[_0x2b5514(0x142)](saveUpdates(_0x1ac3c4[_0x2b5514(0x125)],null))[_0x2b5514(0x142)](respondWithResult(_0x5a7262,null))[_0x2b5514(0x13d)](handleError(_0x5a7262,null));};
\ No newline at end of file
+const a182_0x5ca2=['attributes','sort','merge','json','then','fields','offset','findOne','rows','map','error','like','body','status','count','../../components/parsers/qs','filters','options','../../config/logger','lodash','Content-Range','show','rawAttributes','sequelize','CmHopperHistory','nolimit','set','include','length','describe','includeAll','order','send','model','index','key','api','name','update','keys','uniqueid','stack','intersection','limit','VIRTUAL','findAll','query','fieldName','sendStatus','type','where','catch','filter'];(function(_0x189d89,_0x9e99be){const _0x5ca2f1=function(_0x3f6cfa){while(--_0x3f6cfa){_0x189d89['push'](_0x189d89['shift']());}};_0x5ca2f1(++_0x9e99be);}(a182_0x5ca2,0x1ea));const a182_0x3f6c=function(_0x189d89,_0x9e99be){_0x189d89=_0x189d89-0x11a;let _0x5ca2f1=a182_0x5ca2[_0x189d89];return _0x5ca2f1;};const a182_0x1cb8b5=a182_0x3f6c;'use strict';const _=require(a182_0x1cb8b5(0x120)),qs=require(a182_0x1cb8b5(0x11c)),logger=require(a182_0x1cb8b5(0x11f))(a182_0x1cb8b5(0x131)),{db}=require('../../mysqldb'),{Op}=require(a182_0x1cb8b5(0x124));function respondWithResult(_0xc0bb52,_0x141d8d){return _0x141d8d=_0x141d8d||0xc8,function(_0x3bd40f){const _0x35f0bb=a182_0x3f6c;if(_0x3bd40f)return _0xc0bb52['status'](_0x141d8d)[_0x35f0bb(0x145)](_0x3bd40f);};}function respondWithFilteredResult(_0x5982e7,_0x3fa47d){return function(_0x329cb4){const _0x4aca98=a182_0x3f6c;if(_0x329cb4){const _0x4d3d2b=_0x329cb4[_0x4aca98(0x11b)],_0x39f037=_0x3fa47d[_0x4aca98(0x148)];let _0x2d8e7b=_0x3fa47d[_0x4aca98(0x148)]+_0x3fa47d['limit'],_0x5839c6;return _0x2d8e7b>=_0x4d3d2b?(_0x2d8e7b=_0x4d3d2b,_0x5839c6=0xc8):_0x5839c6=0xce,_0x5982e7[_0x4aca98(0x11a)](_0x5839c6),_0x5982e7[_0x4aca98(0x127)](_0x4aca98(0x121),_0x39f037+'-'+_0x2d8e7b+'/'+_0x4d3d2b)[_0x4aca98(0x145)](_0x329cb4);}return null;};}function saveUpdates(_0x4ca1f2){return function(_0x1b0a52){const _0x2544a2=a182_0x3f6c;if(_0x1b0a52)return _0x1b0a52[_0x2544a2(0x133)](_0x4ca1f2)[_0x2544a2(0x146)](function(_0x41b92d){return _0x41b92d;});return null;};}function handleEntityNotFound(_0xc9c0cd){return function(_0x254901){const _0x208933=a182_0x3f6c;return!_0x254901&&_0xc9c0cd[_0x208933(0x13d)](0x194),_0x254901;};}function handleError(_0x9c8185,_0x492022){return _0x492022=_0x492022||0x1f4,function(_0x59f943){const _0x1ea4d9=a182_0x3f6c;logger[_0x1ea4d9(0x14c)](_0x59f943[_0x1ea4d9(0x136)]),_0x59f943[_0x1ea4d9(0x132)]&&delete _0x59f943[_0x1ea4d9(0x132)],_0x9c8185['status'](_0x492022)[_0x1ea4d9(0x12d)](_0x59f943);};}exports[a182_0x1cb8b5(0x12f)]=function(_0x4affd5,_0x188b8e){const _0x1fac90=a182_0x1cb8b5;let _0x91e885={};const _0x3e981e={},_0x37cb0e={'count':0x0,'rows':[]},_0x2d9640=_[_0x1fac90(0x14b)](db['CmHopperHistory'][_0x1fac90(0x123)],function(_0x4cd410){const _0x242536=_0x1fac90;return{'name':_0x4cd410[_0x242536(0x13c)],'type':_0x4cd410[_0x242536(0x13e)][_0x242536(0x130)]};});_0x3e981e[_0x1fac90(0x12e)]=_[_0x1fac90(0x14b)](_0x2d9640,_0x1fac90(0x132)),_0x3e981e['query']=_['keys'](_0x4affd5[_0x1fac90(0x13b)]),_0x3e981e['filters']=_[_0x1fac90(0x137)](_0x3e981e[_0x1fac90(0x12e)],_0x3e981e[_0x1fac90(0x13b)]),_0x91e885[_0x1fac90(0x142)]=_['intersection'](_0x3e981e[_0x1fac90(0x12e)],qs['fields'](_0x4affd5[_0x1fac90(0x13b)]['fields'])),_0x91e885[_0x1fac90(0x142)]=_0x91e885[_0x1fac90(0x142)]['length']?_0x91e885[_0x1fac90(0x142)]:_0x3e981e[_0x1fac90(0x12e)];typeof _0x4affd5[_0x1fac90(0x13b)][_0x1fac90(0x126)]==='undefined'&&(_0x91e885[_0x1fac90(0x138)]=qs['limit'](_0x4affd5[_0x1fac90(0x13b)]['limit']),_0x91e885[_0x1fac90(0x148)]=qs[_0x1fac90(0x148)](_0x4affd5[_0x1fac90(0x13b)][_0x1fac90(0x148)]));_0x91e885[_0x1fac90(0x12c)]=qs[_0x1fac90(0x143)](_0x4affd5[_0x1fac90(0x13b)][_0x1fac90(0x143)]),_0x91e885[_0x1fac90(0x13f)]=qs[_0x1fac90(0x11d)](_['pick'](_0x4affd5[_0x1fac90(0x13b)],_0x3e981e[_0x1fac90(0x11d)]),_0x2d9640);_0x4affd5[_0x1fac90(0x13b)]['filter']&&(_0x91e885[_0x1fac90(0x13f)]=_[_0x1fac90(0x144)](_0x91e885['where'],{[Op['or']]:_[_0x1fac90(0x14b)](_0x2d9640,function(_0x50ced0){const _0x3cb06b=_0x1fac90;if(_0x50ced0[_0x3cb06b(0x13e)]!==_0x3cb06b(0x139)){const _0x3ee84c={};return _0x3ee84c[_0x50ced0['name']]={[Op[_0x3cb06b(0x14d)]]:'%'+_0x4affd5[_0x3cb06b(0x13b)][_0x3cb06b(0x141)]+'%'},_0x3ee84c;}})}));_0x91e885=_['merge']({},_0x91e885,_0x4affd5[_0x1fac90(0x11e)]);const _0x5d55ef={'where':_0x91e885['where']};return db[_0x1fac90(0x125)][_0x1fac90(0x11b)](_0x5d55ef)[_0x1fac90(0x146)](function(_0x5adec7){const _0x188ead=_0x1fac90;return _0x37cb0e['count']=_0x5adec7,_0x4affd5[_0x188ead(0x13b)][_0x188ead(0x12b)]&&(_0x91e885[_0x188ead(0x128)]=[{'all':!![]}]),db[_0x188ead(0x125)][_0x188ead(0x13a)](_0x91e885);})[_0x1fac90(0x146)](function(_0x1ae44c){const _0x50ac2d=_0x1fac90;return _0x37cb0e[_0x50ac2d(0x14a)]=_0x1ae44c,_0x37cb0e;})[_0x1fac90(0x146)](respondWithFilteredResult(_0x188b8e,_0x91e885))[_0x1fac90(0x140)](handleError(_0x188b8e,null));},exports[a182_0x1cb8b5(0x122)]=function(_0x15d7e0,_0x5eb28f){const _0x1c1ca6=a182_0x1cb8b5;let _0xfd6ab2={'raw':!![],'where':{'id':_0x15d7e0['params']['id']}};const _0x21eaff={};return _0x21eaff[_0x1c1ca6(0x12e)]=_['keys'](db[_0x1c1ca6(0x125)][_0x1c1ca6(0x123)]),_0x21eaff[_0x1c1ca6(0x13b)]=_[_0x1c1ca6(0x134)](_0x15d7e0[_0x1c1ca6(0x13b)]),_0x21eaff[_0x1c1ca6(0x11d)]=_[_0x1c1ca6(0x137)](_0x21eaff['model'],_0x21eaff['query']),_0xfd6ab2[_0x1c1ca6(0x142)]=_[_0x1c1ca6(0x137)](_0x21eaff['model'],qs[_0x1c1ca6(0x147)](_0x15d7e0['query'][_0x1c1ca6(0x147)])),_0xfd6ab2[_0x1c1ca6(0x142)]=_0xfd6ab2['attributes'][_0x1c1ca6(0x129)]?_0xfd6ab2[_0x1c1ca6(0x142)]:_0x21eaff[_0x1c1ca6(0x12e)],_0x15d7e0[_0x1c1ca6(0x13b)][_0x1c1ca6(0x12b)]&&(_0xfd6ab2['include']=[{'all':!![]}]),_0xfd6ab2=_[_0x1c1ca6(0x144)]({},_0xfd6ab2,_0x15d7e0['options']),db[_0x1c1ca6(0x125)][_0x1c1ca6(0x149)](_0xfd6ab2)[_0x1c1ca6(0x146)](handleEntityNotFound(_0x5eb28f,null))[_0x1c1ca6(0x146)](respondWithResult(_0x5eb28f,null))[_0x1c1ca6(0x140)](handleError(_0x5eb28f,null));},exports['create']=function(_0x34e5e0,_0x32f298){const _0x27c3d1=a182_0x1cb8b5;return db['CmHopperHistory']['create'](_0x34e5e0[_0x27c3d1(0x14e)],{})[_0x27c3d1(0x146)](respondWithResult(_0x32f298,0xc9))[_0x27c3d1(0x140)](handleError(_0x32f298,null));},exports[a182_0x1cb8b5(0x12a)]=function(_0x21831c,_0x48b313){const _0x41791c=a182_0x1cb8b5;return db[_0x41791c(0x125)][_0x41791c(0x12a)]()['then'](respondWithResult(_0x48b313,null))[_0x41791c(0x140)](handleError(_0x48b313,null));},exports[a182_0x1cb8b5(0x133)]=function(_0x195f18,_0x52c9bf){const _0x90eb1b=a182_0x1cb8b5;return _0x195f18[_0x90eb1b(0x14e)][_0x90eb1b(0x135)]&&delete _0x195f18[_0x90eb1b(0x14e)][_0x90eb1b(0x135)],db[_0x90eb1b(0x125)][_0x90eb1b(0x149)]({'where':{'uniqueid':_0x195f18['params']['id']}})[_0x90eb1b(0x146)](handleEntityNotFound(_0x52c9bf,null))[_0x90eb1b(0x146)](saveUpdates(_0x195f18[_0x90eb1b(0x14e)],null))[_0x90eb1b(0x146)](respondWithResult(_0x52c9bf,null))[_0x90eb1b(0x140)](handleError(_0x52c9bf,null));};
\ No newline at end of file