Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / cmHopperBlack / cmHopperBlack.controller.js
index 0bfac1d..7f8990e 100644 (file)
@@ -1 +1 @@
-const a142_0x5bbf=['VIRTUAL','options','model','filters','merge','attributes','show','pick','name','offset','send','filter','map','key','then','params','intersection','where','limit','set','rawAttributes','length','sendStatus','fieldName','nolimit','findOne','body','keys','include','../../mysqldb','status','type','query','index','describe','../../components/parsers/qs','stack','rows','error','count','catch','update','order','sort','like','fields','destroy','CmHopperBlack','Content-Range','includeAll','json'];(function(_0x9ad271,_0x5bbf9e){const _0x2232de=function(_0x5e7ca9){while(--_0x5e7ca9){_0x9ad271['push'](_0x9ad271['shift']());}};_0x2232de(++_0x5bbf9e);}(a142_0x5bbf,0xcf));const a142_0x2232=function(_0x9ad271,_0x5bbf9e){_0x9ad271=_0x9ad271-0x0;let _0x2232de=a142_0x5bbf[_0x9ad271];return _0x2232de;};const _0x56cae5=a142_0x2232;'use strict';const _=require('lodash'),qs=require(_0x56cae5('0x20')),logger=require('../../config/logger')('api'),db=require(_0x56cae5('0x1a'))['db'],{Op}=require('sequelize');function respondWithResult(_0x5e7ca9,_0x2f36cb){return _0x2f36cb=_0x2f36cb||0xc8,function(_0x3aa2ca){const _0x4a4ec5=a142_0x2232;if(_0x3aa2ca)return _0x5e7ca9[_0x4a4ec5('0x1b')](_0x2f36cb)['json'](_0x3aa2ca);};}function respondWithFilteredResult(_0x36fba6,_0x4f0daf){return function(_0x1d6c14){const _0x10f752=a142_0x2232;if(_0x1d6c14){const _0xd7a765=_0x1d6c14['count'],_0x2e42be=_0x4f0daf['offset'];let _0x17db89=_0x4f0daf[_0x10f752('0x6')]+_0x4f0daf[_0x10f752('0xf')],_0x38eef8;return _0x17db89>=_0xd7a765?(_0x17db89=_0xd7a765,_0x38eef8=0xc8):_0x38eef8=0xce,_0x36fba6[_0x10f752('0x1b')](_0x38eef8),_0x36fba6[_0x10f752('0x10')](_0x10f752('0x2d'),_0x2e42be+'-'+_0x17db89+'/'+_0xd7a765)[_0x10f752('0x2f')](_0x1d6c14);}return null;};}function saveUpdates(_0x21b013){return function(_0x728e2b){if(_0x728e2b)return _0x728e2b['update'](_0x21b013)['then'](function(_0x1bf2e2){return _0x1bf2e2;});return null;};}function removeEntity(_0x276ab9){return function(_0x1235aa){const _0x405d58=a142_0x2232;if(_0x1235aa)return _0x1235aa[_0x405d58('0x2b')]()['then'](function(){const _0x98b62e=_0x405d58;_0x276ab9[_0x98b62e('0x1b')](0xcc)['end']();});};}function handleEntityNotFound(_0x391e8c){return function(_0x4150c4){const _0x3d232e=a142_0x2232;return!_0x4150c4&&_0x391e8c[_0x3d232e('0x13')](0x194),_0x4150c4;};}function handleError(_0x381295,_0x4dadd0){return _0x4dadd0=_0x4dadd0||0x1f4,function(_0x3a2f79){const _0x1406c4=a142_0x2232;logger[_0x1406c4('0x23')](_0x3a2f79[_0x1406c4('0x21')]),_0x3a2f79[_0x1406c4('0x5')]&&delete _0x3a2f79[_0x1406c4('0x5')],_0x381295[_0x1406c4('0x1b')](_0x4dadd0)[_0x1406c4('0x7')](_0x3a2f79);};}exports[_0x56cae5('0x1e')]=function(_0x603b0a,_0x51a816){const _0xf4443f=_0x56cae5;let _0x3ca87f={};const _0x2d8e53={},_0x1fe237={'count':0x0,'rows':[]},_0x4c240e=_[_0xf4443f('0x9')](db['CmHopperBlack'][_0xf4443f('0x11')],function(_0x127600){const _0x5ab337=_0xf4443f;return{'name':_0x127600[_0x5ab337('0x14')],'type':_0x127600['type'][_0x5ab337('0xa')]};});_0x2d8e53[_0xf4443f('0x32')]=_[_0xf4443f('0x9')](_0x4c240e,'name'),_0x2d8e53['query']=_[_0xf4443f('0x18')](_0x603b0a[_0xf4443f('0x1d')]),_0x2d8e53[_0xf4443f('0x0')]=_['intersection'](_0x2d8e53[_0xf4443f('0x32')],_0x2d8e53[_0xf4443f('0x1d')]),_0x3ca87f[_0xf4443f('0x2')]=_[_0xf4443f('0xd')](_0x2d8e53[_0xf4443f('0x32')],qs[_0xf4443f('0x2a')](_0x603b0a[_0xf4443f('0x1d')][_0xf4443f('0x2a')])),_0x3ca87f[_0xf4443f('0x2')]=_0x3ca87f['attributes']['length']?_0x3ca87f[_0xf4443f('0x2')]:_0x2d8e53[_0xf4443f('0x32')];typeof _0x603b0a[_0xf4443f('0x1d')][_0xf4443f('0x15')]==='undefined'&&(_0x3ca87f[_0xf4443f('0xf')]=qs[_0xf4443f('0xf')](_0x603b0a[_0xf4443f('0x1d')][_0xf4443f('0xf')]),_0x3ca87f[_0xf4443f('0x6')]=qs['offset'](_0x603b0a[_0xf4443f('0x1d')][_0xf4443f('0x6')]));_0x3ca87f[_0xf4443f('0x27')]=qs['sort'](_0x603b0a[_0xf4443f('0x1d')][_0xf4443f('0x28')]),_0x3ca87f[_0xf4443f('0xe')]=qs['filters'](_[_0xf4443f('0x4')](_0x603b0a['query'],_0x2d8e53['filters']),_0x4c240e);_0x603b0a['query']['filter']&&(_0x3ca87f[_0xf4443f('0xe')]=_['merge'](_0x3ca87f[_0xf4443f('0xe')],{[Op['or']]:_[_0xf4443f('0x9')](_0x4c240e,function(_0x297b7c){const _0x14dd5f=_0xf4443f;if(_0x297b7c[_0x14dd5f('0x1c')]!==_0x14dd5f('0x30')){const _0x2af536={};return _0x2af536[_0x297b7c[_0x14dd5f('0x5')]]={[Op[_0x14dd5f('0x29')]]:'%'+_0x603b0a[_0x14dd5f('0x1d')][_0x14dd5f('0x8')]+'%'},_0x2af536;}})}));_0x3ca87f=_[_0xf4443f('0x1')]({},_0x3ca87f,_0x603b0a[_0xf4443f('0x31')]);const _0x37d7ca={'where':_0x3ca87f[_0xf4443f('0xe')]};return db[_0xf4443f('0x2c')]['count'](_0x37d7ca)[_0xf4443f('0xb')](function(_0x4ac5aa){const _0x21ee56=_0xf4443f;return _0x1fe237[_0x21ee56('0x24')]=_0x4ac5aa,_0x603b0a['query'][_0x21ee56('0x2e')]&&(_0x3ca87f[_0x21ee56('0x19')]=[{'all':!![]}]),db[_0x21ee56('0x2c')]['findAll'](_0x3ca87f);})['then'](function(_0x20f9f2){const _0x254e92=_0xf4443f;return _0x1fe237[_0x254e92('0x22')]=_0x20f9f2,_0x1fe237;})[_0xf4443f('0xb')](respondWithFilteredResult(_0x51a816,_0x3ca87f))[_0xf4443f('0x25')](handleError(_0x51a816,null));},exports[_0x56cae5('0x3')]=function(_0x449cf3,_0x594883){const _0x1a8d0a=_0x56cae5;let _0x5405c0={'raw':!![],'where':{'id':_0x449cf3[_0x1a8d0a('0xc')]['id']}};const _0x5d8555={};return _0x5d8555['model']=_['keys'](db[_0x1a8d0a('0x2c')][_0x1a8d0a('0x11')]),_0x5d8555[_0x1a8d0a('0x1d')]=_[_0x1a8d0a('0x18')](_0x449cf3[_0x1a8d0a('0x1d')]),_0x5d8555['filters']=_[_0x1a8d0a('0xd')](_0x5d8555[_0x1a8d0a('0x32')],_0x5d8555['query']),_0x5405c0[_0x1a8d0a('0x2')]=_[_0x1a8d0a('0xd')](_0x5d8555[_0x1a8d0a('0x32')],qs[_0x1a8d0a('0x2a')](_0x449cf3['query'][_0x1a8d0a('0x2a')])),_0x5405c0[_0x1a8d0a('0x2')]=_0x5405c0[_0x1a8d0a('0x2')][_0x1a8d0a('0x12')]?_0x5405c0[_0x1a8d0a('0x2')]:_0x5d8555[_0x1a8d0a('0x32')],_0x449cf3[_0x1a8d0a('0x1d')][_0x1a8d0a('0x2e')]&&(_0x5405c0[_0x1a8d0a('0x19')]=[{'all':!![]}]),_0x5405c0=_[_0x1a8d0a('0x1')]({},_0x5405c0,_0x449cf3[_0x1a8d0a('0x31')]),db[_0x1a8d0a('0x2c')]['findOne'](_0x5405c0)[_0x1a8d0a('0xb')](handleEntityNotFound(_0x594883,null))[_0x1a8d0a('0xb')](respondWithResult(_0x594883,null))['catch'](handleError(_0x594883,null));},exports[_0x56cae5('0x26')]=function(_0x310c9f,_0x28944f){const _0x12b460=_0x56cae5;return _0x310c9f[_0x12b460('0x17')]['id']&&delete _0x310c9f[_0x12b460('0x17')]['id'],db[_0x12b460('0x2c')][_0x12b460('0x16')]({'where':{'id':_0x310c9f[_0x12b460('0xc')]['id']}})[_0x12b460('0xb')](handleEntityNotFound(_0x28944f,null))[_0x12b460('0xb')](saveUpdates(_0x310c9f['body'],null))[_0x12b460('0xb')](respondWithResult(_0x28944f,null))[_0x12b460('0x25')](handleError(_0x28944f,null));},exports[_0x56cae5('0x2b')]=function(_0x458695,_0x2b1b3c){const _0x170870=_0x56cae5;return db[_0x170870('0x2c')]['findOne']({'where':{'id':_0x458695[_0x170870('0xc')]['id']}})['then'](handleEntityNotFound(_0x2b1b3c,null))['then'](removeEntity(_0x2b1b3c,null))['catch'](handleError(_0x2b1b3c,null));},exports[_0x56cae5('0x1f')]=function(_0x3883ca,_0x34d41d){const _0x5f44ae=_0x56cae5;return db[_0x5f44ae('0x2c')][_0x5f44ae('0x1f')]()['then'](respondWithResult(_0x34d41d,null))['catch'](handleError(_0x34d41d,null));};
\ No newline at end of file
+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