Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / cmHopperBlack / cmHopperBlack.controller.js
index 7f8990e..4d8e938 100644 (file)
@@ -1 +1 @@
-const a170_0x48b2=['options','merge','includeAll','offset','describe','map','../../components/parsers/qs','index','error','body','show','VIRTUAL','then','limit','status','lodash','type','findAll','undefined','destroy','rawAttributes','sort','length','fields','like','pick','../../config/logger','nolimit','model','where','filter','catch','send','json','fieldName','intersection','count','sequelize','params','end','filters','query','attributes','api','keys','order','update','CmHopperBlack','name','findOne'];(function(_0x2fe78d,_0x3d6604){const _0x48b216=function(_0x7f4d3e){while(--_0x7f4d3e){_0x2fe78d['push'](_0x2fe78d['shift']());}};_0x48b216(++_0x3d6604);}(a170_0x48b2,0x10a));const a170_0x7f4d=function(_0x2fe78d,_0x3d6604){_0x2fe78d=_0x2fe78d-0xd3;let _0x48b216=a170_0x48b2[_0x2fe78d];return _0x48b216;};const a170_0xd9bd87=a170_0x7f4d;'use strict';const _=require(a170_0xd9bd87(0x104)),qs=require(a170_0xd9bd87(0xfb)),logger=require(a170_0xd9bd87(0xdd))(a170_0xd9bd87(0xee)),{db}=require('../../mysqldb'),{Op}=require(a170_0xd9bd87(0xe8));function respondWithResult(_0x5960a9,_0x3495f6){return _0x3495f6=_0x3495f6||0xc8,function(_0x19b911){const _0x9b8cf4=a170_0x7f4d;if(_0x19b911)return _0x5960a9[_0x9b8cf4(0x103)](_0x3495f6)['json'](_0x19b911);};}function respondWithFilteredResult(_0x26ab75,_0x3a11e0){return function(_0x3e061e){const _0x26efdd=a170_0x7f4d;if(_0x3e061e){const _0x2e171c=_0x3e061e[_0x26efdd(0xe7)],_0xeefec6=_0x3a11e0[_0x26efdd(0xf8)];let _0x16791=_0x3a11e0[_0x26efdd(0xf8)]+_0x3a11e0[_0x26efdd(0x102)],_0x214ed7;return _0x16791>=_0x2e171c?(_0x16791=_0x2e171c,_0x214ed7=0xc8):_0x214ed7=0xce,_0x26ab75['status'](_0x214ed7),_0x26ab75['set']('Content-Range',_0xeefec6+'-'+_0x16791+'/'+_0x2e171c)[_0x26efdd(0xe4)](_0x3e061e);}return null;};}function saveUpdates(_0x2c07d4){return function(_0xb9a9fe){const _0x2f1f56=a170_0x7f4d;if(_0xb9a9fe)return _0xb9a9fe[_0x2f1f56(0xf1)](_0x2c07d4)[_0x2f1f56(0x101)](function(_0x42c8d4){return _0x42c8d4;});return null;};}function removeEntity(_0x58ec73){return function(_0x218f88){const _0x575a8c=a170_0x7f4d;if(_0x218f88)return _0x218f88[_0x575a8c(0xd6)]()[_0x575a8c(0x101)](function(){const _0x2ae7d6=_0x575a8c;_0x58ec73[_0x2ae7d6(0x103)](0xcc)[_0x2ae7d6(0xea)]();});};}function handleEntityNotFound(_0x4dc7e0){return function(_0x47051b){return!_0x47051b&&_0x4dc7e0['sendStatus'](0x194),_0x47051b;};}function handleError(_0x3bace7,_0x20b62e){return _0x20b62e=_0x20b62e||0x1f4,function(_0x5d34b0){const _0x3a3c5c=a170_0x7f4d;logger[_0x3a3c5c(0xfd)](_0x5d34b0['stack']),_0x5d34b0[_0x3a3c5c(0xf3)]&&delete _0x5d34b0[_0x3a3c5c(0xf3)],_0x3bace7['status'](_0x20b62e)[_0x3a3c5c(0xe3)](_0x5d34b0);};}exports[a170_0xd9bd87(0xfc)]=function(_0x8f3d09,_0x1755fd){const _0x5eef73=a170_0xd9bd87;let _0xae2185={};const _0x573b74={},_0x1c1265={'count':0x0,'rows':[]},_0x39fb7b=_[_0x5eef73(0xfa)](db[_0x5eef73(0xf2)][_0x5eef73(0xd7)],function(_0x3e68c1){const _0x36634f=_0x5eef73;return{'name':_0x3e68c1[_0x36634f(0xe5)],'type':_0x3e68c1[_0x36634f(0xd3)]['key']};});_0x573b74[_0x5eef73(0xdf)]=_[_0x5eef73(0xfa)](_0x39fb7b,_0x5eef73(0xf3)),_0x573b74[_0x5eef73(0xec)]=_[_0x5eef73(0xef)](_0x8f3d09[_0x5eef73(0xec)]),_0x573b74[_0x5eef73(0xeb)]=_[_0x5eef73(0xe6)](_0x573b74[_0x5eef73(0xdf)],_0x573b74[_0x5eef73(0xec)]),_0xae2185['attributes']=_[_0x5eef73(0xe6)](_0x573b74[_0x5eef73(0xdf)],qs[_0x5eef73(0xda)](_0x8f3d09[_0x5eef73(0xec)]['fields'])),_0xae2185[_0x5eef73(0xed)]=_0xae2185['attributes'][_0x5eef73(0xd9)]?_0xae2185[_0x5eef73(0xed)]:_0x573b74[_0x5eef73(0xdf)];typeof _0x8f3d09[_0x5eef73(0xec)][_0x5eef73(0xde)]===_0x5eef73(0xd5)&&(_0xae2185[_0x5eef73(0x102)]=qs['limit'](_0x8f3d09[_0x5eef73(0xec)][_0x5eef73(0x102)]),_0xae2185[_0x5eef73(0xf8)]=qs[_0x5eef73(0xf8)](_0x8f3d09[_0x5eef73(0xec)][_0x5eef73(0xf8)]));_0xae2185[_0x5eef73(0xf0)]=qs[_0x5eef73(0xd8)](_0x8f3d09['query'][_0x5eef73(0xd8)]),_0xae2185[_0x5eef73(0xe0)]=qs[_0x5eef73(0xeb)](_[_0x5eef73(0xdc)](_0x8f3d09[_0x5eef73(0xec)],_0x573b74[_0x5eef73(0xeb)]),_0x39fb7b);_0x8f3d09['query'][_0x5eef73(0xe1)]&&(_0xae2185['where']=_[_0x5eef73(0xf6)](_0xae2185[_0x5eef73(0xe0)],{[Op['or']]:_[_0x5eef73(0xfa)](_0x39fb7b,function(_0x1704b9){const _0x538f3d=_0x5eef73;if(_0x1704b9[_0x538f3d(0xd3)]!==_0x538f3d(0x100)){const _0x1c0741={};return _0x1c0741[_0x1704b9[_0x538f3d(0xf3)]]={[Op[_0x538f3d(0xdb)]]:'%'+_0x8f3d09[_0x538f3d(0xec)][_0x538f3d(0xe1)]+'%'},_0x1c0741;}})}));_0xae2185=_[_0x5eef73(0xf6)]({},_0xae2185,_0x8f3d09[_0x5eef73(0xf5)]);const _0x5be180={'where':_0xae2185[_0x5eef73(0xe0)]};return db['CmHopperBlack'][_0x5eef73(0xe7)](_0x5be180)[_0x5eef73(0x101)](function(_0x30c9e1){const _0x32ae1d=_0x5eef73;return _0x1c1265[_0x32ae1d(0xe7)]=_0x30c9e1,_0x8f3d09[_0x32ae1d(0xec)][_0x32ae1d(0xf7)]&&(_0xae2185['include']=[{'all':!![]}]),db[_0x32ae1d(0xf2)][_0x32ae1d(0xd4)](_0xae2185);})[_0x5eef73(0x101)](function(_0x5747ca){return _0x1c1265['rows']=_0x5747ca,_0x1c1265;})[_0x5eef73(0x101)](respondWithFilteredResult(_0x1755fd,_0xae2185))[_0x5eef73(0xe2)](handleError(_0x1755fd,null));},exports[a170_0xd9bd87(0xff)]=function(_0x35e5ab,_0x46e4d3){const _0xec0b3=a170_0xd9bd87;let _0x55ce14={'raw':!![],'where':{'id':_0x35e5ab[_0xec0b3(0xe9)]['id']}};const _0x491544={};return _0x491544['model']=_[_0xec0b3(0xef)](db[_0xec0b3(0xf2)]['rawAttributes']),_0x491544[_0xec0b3(0xec)]=_[_0xec0b3(0xef)](_0x35e5ab['query']),_0x491544[_0xec0b3(0xeb)]=_[_0xec0b3(0xe6)](_0x491544[_0xec0b3(0xdf)],_0x491544[_0xec0b3(0xec)]),_0x55ce14[_0xec0b3(0xed)]=_[_0xec0b3(0xe6)](_0x491544[_0xec0b3(0xdf)],qs['fields'](_0x35e5ab[_0xec0b3(0xec)]['fields'])),_0x55ce14[_0xec0b3(0xed)]=_0x55ce14['attributes']['length']?_0x55ce14[_0xec0b3(0xed)]:_0x491544['model'],_0x35e5ab[_0xec0b3(0xec)][_0xec0b3(0xf7)]&&(_0x55ce14['include']=[{'all':!![]}]),_0x55ce14=_[_0xec0b3(0xf6)]({},_0x55ce14,_0x35e5ab[_0xec0b3(0xf5)]),db[_0xec0b3(0xf2)][_0xec0b3(0xf4)](_0x55ce14)[_0xec0b3(0x101)](handleEntityNotFound(_0x46e4d3,null))[_0xec0b3(0x101)](respondWithResult(_0x46e4d3,null))[_0xec0b3(0xe2)](handleError(_0x46e4d3,null));},exports[a170_0xd9bd87(0xf1)]=function(_0x403d52,_0x23d816){const _0x5d32b7=a170_0xd9bd87;return _0x403d52['body']['id']&&delete _0x403d52[_0x5d32b7(0xfe)]['id'],db['CmHopperBlack'][_0x5d32b7(0xf4)]({'where':{'id':_0x403d52[_0x5d32b7(0xe9)]['id']}})['then'](handleEntityNotFound(_0x23d816,null))[_0x5d32b7(0x101)](saveUpdates(_0x403d52['body'],null))[_0x5d32b7(0x101)](respondWithResult(_0x23d816,null))[_0x5d32b7(0xe2)](handleError(_0x23d816,null));},exports[a170_0xd9bd87(0xd6)]=function(_0x5daa96,_0x2d56fc){const _0x326819=a170_0xd9bd87;return db['CmHopperBlack'][_0x326819(0xf4)]({'where':{'id':_0x5daa96[_0x326819(0xe9)]['id']}})[_0x326819(0x101)](handleEntityNotFound(_0x2d56fc,null))['then'](removeEntity(_0x2d56fc,null))[_0x326819(0xe2)](handleError(_0x2d56fc,null));},exports[a170_0xd9bd87(0xf9)]=function(_0x27de8b,_0x39a5bb){const _0x58fb2d=a170_0xd9bd87;return db[_0x58fb2d(0xf2)][_0x58fb2d(0xf9)]()[_0x58fb2d(0x101)](respondWithResult(_0x39a5bb,null))[_0x58fb2d(0xe2)](handleError(_0x39a5bb,null));};
\ No newline at end of file
+const a170_0x4095=['attributes','count','CmHopperBlack','lodash','catch','pick','describe','undefined','body','index','map','rawAttributes','query','filters','fields','model','merge','sendStatus','like','includeAll','show','key','include','stack','type','where','filter','sequelize','destroy','length','json','../../config/logger','limit','options','../../mysqldb','intersection','../../components/parsers/qs','then','offset','Content-Range','error','update','set','status','keys','name','send','findAll','nolimit','findOne','fieldName','order'];(function(_0x330022,_0x1d9eec){const _0x4095d3=function(_0x29dc81){while(--_0x29dc81){_0x330022['push'](_0x330022['shift']());}};_0x4095d3(++_0x1d9eec);}(a170_0x4095,0xb2));const a170_0x29dc=function(_0x330022,_0x1d9eec){_0x330022=_0x330022-0x19f;let _0x4095d3=a170_0x4095[_0x330022];return _0x4095d3;};const a170_0x3b0c6f=a170_0x29dc;'use strict';const _=require(a170_0x3b0c6f(0x1c0)),qs=require(a170_0x3b0c6f(0x1ad)),logger=require(a170_0x3b0c6f(0x1a8))('api'),{db}=require(a170_0x3b0c6f(0x1ab)),{Op}=require(a170_0x3b0c6f(0x1a4));function respondWithResult(_0x8c65a5,_0x383d4a){return _0x383d4a=_0x383d4a||0xc8,function(_0x3605f1){const _0x313636=a170_0x29dc;if(_0x3605f1)return _0x8c65a5[_0x313636(0x1b4)](_0x383d4a)[_0x313636(0x1a7)](_0x3605f1);};}function respondWithFilteredResult(_0x27b241,_0x30f343){return function(_0x131fce){const _0xd0aabf=a170_0x29dc;if(_0x131fce){const _0x329456=_0x131fce[_0xd0aabf(0x1be)],_0x470971=_0x30f343[_0xd0aabf(0x1af)];let _0x278372=_0x30f343['offset']+_0x30f343[_0xd0aabf(0x1a9)],_0xfb74c8;return _0x278372>=_0x329456?(_0x278372=_0x329456,_0xfb74c8=0xc8):_0xfb74c8=0xce,_0x27b241[_0xd0aabf(0x1b4)](_0xfb74c8),_0x27b241[_0xd0aabf(0x1b3)](_0xd0aabf(0x1b0),_0x470971+'-'+_0x278372+'/'+_0x329456)[_0xd0aabf(0x1a7)](_0x131fce);}return null;};}function saveUpdates(_0x2a4f48){return function(_0x5700e2){const _0x43f898=a170_0x29dc;if(_0x5700e2)return _0x5700e2['update'](_0x2a4f48)[_0x43f898(0x1ae)](function(_0x385d34){return _0x385d34;});return null;};}function removeEntity(_0x31eb89){return function(_0x3a0cec){const _0x4f82f0=a170_0x29dc;if(_0x3a0cec)return _0x3a0cec[_0x4f82f0(0x1a5)]()[_0x4f82f0(0x1ae)](function(){const _0x5b15c5=_0x4f82f0;_0x31eb89[_0x5b15c5(0x1b4)](0xcc)['end']();});};}function handleEntityNotFound(_0x18d0ae){return function(_0x51de42){const _0x21fbed=a170_0x29dc;return!_0x51de42&&_0x18d0ae[_0x21fbed(0x1ce)](0x194),_0x51de42;};}function handleError(_0x160d48,_0x4866e7){return _0x4866e7=_0x4866e7||0x1f4,function(_0x2e3af5){const _0x9894d7=a170_0x29dc;logger[_0x9894d7(0x1b1)](_0x2e3af5[_0x9894d7(0x1a0)]),_0x2e3af5[_0x9894d7(0x1b6)]&&delete _0x2e3af5[_0x9894d7(0x1b6)],_0x160d48['status'](_0x4866e7)[_0x9894d7(0x1b7)](_0x2e3af5);};}exports[a170_0x3b0c6f(0x1c6)]=function(_0x324323,_0x3d8e62){const _0x477e38=a170_0x3b0c6f;let _0x1ecd49={};const _0x3db236={},_0x990191={'count':0x0,'rows':[]},_0x2e3d8f=_['map'](db['CmHopperBlack'][_0x477e38(0x1c8)],function(_0x3416be){const _0x351ef6=_0x477e38;return{'name':_0x3416be[_0x351ef6(0x1bb)],'type':_0x3416be['type'][_0x351ef6(0x1d2)]};});_0x3db236['model']=_[_0x477e38(0x1c7)](_0x2e3d8f,_0x477e38(0x1b6)),_0x3db236[_0x477e38(0x1c9)]=_[_0x477e38(0x1b5)](_0x324323[_0x477e38(0x1c9)]),_0x3db236[_0x477e38(0x1ca)]=_['intersection'](_0x3db236[_0x477e38(0x1cc)],_0x3db236[_0x477e38(0x1c9)]),_0x1ecd49['attributes']=_['intersection'](_0x3db236[_0x477e38(0x1cc)],qs['fields'](_0x324323[_0x477e38(0x1c9)][_0x477e38(0x1cb)])),_0x1ecd49[_0x477e38(0x1bd)]=_0x1ecd49[_0x477e38(0x1bd)][_0x477e38(0x1a6)]?_0x1ecd49[_0x477e38(0x1bd)]:_0x3db236[_0x477e38(0x1cc)];typeof _0x324323['query'][_0x477e38(0x1b9)]===_0x477e38(0x1c4)&&(_0x1ecd49[_0x477e38(0x1a9)]=qs[_0x477e38(0x1a9)](_0x324323[_0x477e38(0x1c9)][_0x477e38(0x1a9)]),_0x1ecd49['offset']=qs[_0x477e38(0x1af)](_0x324323['query'][_0x477e38(0x1af)]));_0x1ecd49[_0x477e38(0x1bc)]=qs['sort'](_0x324323[_0x477e38(0x1c9)]['sort']),_0x1ecd49[_0x477e38(0x1a2)]=qs['filters'](_[_0x477e38(0x1c2)](_0x324323[_0x477e38(0x1c9)],_0x3db236['filters']),_0x2e3d8f);_0x324323[_0x477e38(0x1c9)]['filter']&&(_0x1ecd49[_0x477e38(0x1a2)]=_[_0x477e38(0x1cd)](_0x1ecd49[_0x477e38(0x1a2)],{[Op['or']]:_['map'](_0x2e3d8f,function(_0x370dac){const _0x43183e=_0x477e38;if(_0x370dac[_0x43183e(0x1a1)]!=='VIRTUAL'){const _0x423be5={};return _0x423be5[_0x370dac[_0x43183e(0x1b6)]]={[Op[_0x43183e(0x1cf)]]:'%'+_0x324323[_0x43183e(0x1c9)][_0x43183e(0x1a3)]+'%'},_0x423be5;}})}));_0x1ecd49=_[_0x477e38(0x1cd)]({},_0x1ecd49,_0x324323[_0x477e38(0x1aa)]);const _0xf7693f={'where':_0x1ecd49[_0x477e38(0x1a2)]};return db[_0x477e38(0x1bf)][_0x477e38(0x1be)](_0xf7693f)['then'](function(_0x4e302d){const _0x3f3a44=_0x477e38;return _0x990191['count']=_0x4e302d,_0x324323[_0x3f3a44(0x1c9)][_0x3f3a44(0x1d0)]&&(_0x1ecd49[_0x3f3a44(0x19f)]=[{'all':!![]}]),db[_0x3f3a44(0x1bf)][_0x3f3a44(0x1b8)](_0x1ecd49);})[_0x477e38(0x1ae)](function(_0x37d233){return _0x990191['rows']=_0x37d233,_0x990191;})[_0x477e38(0x1ae)](respondWithFilteredResult(_0x3d8e62,_0x1ecd49))[_0x477e38(0x1c1)](handleError(_0x3d8e62,null));},exports[a170_0x3b0c6f(0x1d1)]=function(_0x1e0981,_0x19a39b){const _0x4bc040=a170_0x3b0c6f;let _0x41a361={'raw':!![],'where':{'id':_0x1e0981['params']['id']}};const _0x37a0ba={};return _0x37a0ba[_0x4bc040(0x1cc)]=_[_0x4bc040(0x1b5)](db[_0x4bc040(0x1bf)][_0x4bc040(0x1c8)]),_0x37a0ba[_0x4bc040(0x1c9)]=_['keys'](_0x1e0981['query']),_0x37a0ba[_0x4bc040(0x1ca)]=_[_0x4bc040(0x1ac)](_0x37a0ba[_0x4bc040(0x1cc)],_0x37a0ba['query']),_0x41a361['attributes']=_['intersection'](_0x37a0ba['model'],qs['fields'](_0x1e0981['query']['fields'])),_0x41a361['attributes']=_0x41a361[_0x4bc040(0x1bd)][_0x4bc040(0x1a6)]?_0x41a361['attributes']:_0x37a0ba['model'],_0x1e0981[_0x4bc040(0x1c9)][_0x4bc040(0x1d0)]&&(_0x41a361[_0x4bc040(0x19f)]=[{'all':!![]}]),_0x41a361=_['merge']({},_0x41a361,_0x1e0981[_0x4bc040(0x1aa)]),db[_0x4bc040(0x1bf)][_0x4bc040(0x1ba)](_0x41a361)[_0x4bc040(0x1ae)](handleEntityNotFound(_0x19a39b,null))[_0x4bc040(0x1ae)](respondWithResult(_0x19a39b,null))[_0x4bc040(0x1c1)](handleError(_0x19a39b,null));},exports[a170_0x3b0c6f(0x1b2)]=function(_0x20bc01,_0x133ad6){const _0x47eeba=a170_0x3b0c6f;return _0x20bc01[_0x47eeba(0x1c5)]['id']&&delete _0x20bc01['body']['id'],db['CmHopperBlack']['findOne']({'where':{'id':_0x20bc01['params']['id']}})[_0x47eeba(0x1ae)](handleEntityNotFound(_0x133ad6,null))[_0x47eeba(0x1ae)](saveUpdates(_0x20bc01[_0x47eeba(0x1c5)],null))[_0x47eeba(0x1ae)](respondWithResult(_0x133ad6,null))[_0x47eeba(0x1c1)](handleError(_0x133ad6,null));},exports[a170_0x3b0c6f(0x1a5)]=function(_0x118806,_0x249697){const _0x563013=a170_0x3b0c6f;return db[_0x563013(0x1bf)][_0x563013(0x1ba)]({'where':{'id':_0x118806['params']['id']}})[_0x563013(0x1ae)](handleEntityNotFound(_0x249697,null))['then'](removeEntity(_0x249697,null))[_0x563013(0x1c1)](handleError(_0x249697,null));},exports[a170_0x3b0c6f(0x1c3)]=function(_0x569116,_0x388080){const _0x29762d=a170_0x3b0c6f;return db[_0x29762d(0x1bf)][_0x29762d(0x1c3)]()[_0x29762d(0x1ae)](respondWithResult(_0x388080,null))[_0x29762d(0x1c1)](handleError(_0x388080,null));};
\ No newline at end of file