Built motion from commit 82a371561bcdbc7605c801e5e414f4032ba9e7ad. Version 3.0.0...
[motion-next.git] / server / api / migration / migration.controller.js
index 8ec30db..3f9a18c 100644 (file)
@@ -1 +1 @@
-const a453_0x4ca4=['lodash','count','rows','filter','fieldName','stack','offset','limit','map','rawAttributes','fields','filters','undefined','where','status','sequelize','nolimit','key','model','pick','then','name','intersection','json','query','set','Migration','../../components/parsers/qs','include','api','length','error','Content-Range','VIRTUAL','index','like','attributes','options','catch','includeAll','merge','type','findAll','keys','../../mysqldb'];(function(_0xcb8790,_0x4ca44d){const _0x7b5c4b=function(_0x6f41a0){while(--_0x6f41a0){_0xcb8790['push'](_0xcb8790['shift']());}};_0x7b5c4b(++_0x4ca44d);}(a453_0x4ca4,0xda));const a453_0x7b5c=function(_0xcb8790,_0x4ca44d){_0xcb8790=_0xcb8790-0x0;let _0x7b5c4b=a453_0x4ca4[_0xcb8790];return _0x7b5c4b;};const _0x217f59=a453_0x7b5c;'use strict';const _=require(_0x217f59('0x7')),qs=require(_0x217f59('0x22')),logger=require('../../config/logger')(_0x217f59('0x24')),db=require(_0x217f59('0x6'))['db'],{Op}=require(_0x217f59('0x16'));function respondWithFilteredResult(_0x6f41a0,_0x2706a7){return function(_0xdd943e){const _0x4aa82c=a453_0x7b5c;if(_0xdd943e){const _0xe823ce=_0xdd943e['count'],_0x123908=_0x2706a7[_0x4aa82c('0xd')];let _0x35e6d5=_0x2706a7['offset']+_0x2706a7[_0x4aa82c('0xe')],_0x4aeffe;return _0x35e6d5>=_0xe823ce?(_0x35e6d5=_0xe823ce,_0x4aeffe=0xc8):_0x4aeffe=0xce,_0x6f41a0[_0x4aa82c('0x15')](_0x4aeffe),_0x6f41a0[_0x4aa82c('0x20')](_0x4aa82c('0x27'),_0x123908+'-'+_0x35e6d5+'/'+_0xe823ce)[_0x4aa82c('0x1e')](_0xdd943e);}return null;};}function handleError(_0x1a1c6a,_0x10bc13){return _0x10bc13=_0x10bc13||0x1f4,function(_0x634749){const _0x49264f=a453_0x7b5c;logger[_0x49264f('0x26')](_0x634749[_0x49264f('0xc')]),_0x634749[_0x49264f('0x1c')]&&delete _0x634749[_0x49264f('0x1c')],_0x1a1c6a[_0x49264f('0x15')](_0x10bc13)['send'](_0x634749);};}exports[_0x217f59('0x29')]=function(_0x3e8d6b,_0x37f1ca){const _0x553474=_0x217f59;let _0x4ada32={};const _0x2f61d9={},_0x5dd5a9={'count':0x0,'rows':[]},_0x1ab6aa=_[_0x553474('0xf')](db[_0x553474('0x21')][_0x553474('0x10')],function(_0x496987){const _0x278b0f=_0x553474;return{'name':_0x496987[_0x278b0f('0xb')],'type':_0x496987['type'][_0x278b0f('0x18')]};});_0x2f61d9[_0x553474('0x19')]=_['map'](_0x1ab6aa,_0x553474('0x1c')),_0x2f61d9[_0x553474('0x1f')]=_[_0x553474('0x5')](_0x3e8d6b[_0x553474('0x1f')]),_0x2f61d9[_0x553474('0x12')]=_[_0x553474('0x1d')](_0x2f61d9[_0x553474('0x19')],_0x2f61d9['query']),_0x4ada32[_0x553474('0x2b')]=_[_0x553474('0x1d')](_0x2f61d9[_0x553474('0x19')],qs[_0x553474('0x11')](_0x3e8d6b[_0x553474('0x1f')][_0x553474('0x11')])),_0x4ada32[_0x553474('0x2b')]=_0x4ada32[_0x553474('0x2b')][_0x553474('0x25')]?_0x4ada32[_0x553474('0x2b')]:_0x2f61d9[_0x553474('0x19')];typeof _0x3e8d6b['query'][_0x553474('0x17')]===_0x553474('0x13')&&(_0x4ada32[_0x553474('0xe')]=qs[_0x553474('0xe')](_0x3e8d6b[_0x553474('0x1f')][_0x553474('0xe')]),_0x4ada32['offset']=qs[_0x553474('0xd')](_0x3e8d6b[_0x553474('0x1f')][_0x553474('0xd')]));_0x4ada32['order']=qs['sort'](_0x3e8d6b['query']['sort']),_0x4ada32[_0x553474('0x14')]=qs[_0x553474('0x12')](_[_0x553474('0x1a')](_0x3e8d6b[_0x553474('0x1f')],_0x2f61d9[_0x553474('0x12')]),_0x1ab6aa);_0x3e8d6b['query'][_0x553474('0xa')]&&(_0x4ada32[_0x553474('0x14')]=_[_0x553474('0x2')](_0x4ada32['where'],{[Op['or']]:_[_0x553474('0xf')](_0x1ab6aa,function(_0x48e16d){const _0xbb5d68=_0x553474;if(_0x48e16d[_0xbb5d68('0x3')]!==_0xbb5d68('0x28')){const _0x45679e={};return _0x45679e[_0x48e16d['name']]={[Op[_0xbb5d68('0x2a')]]:'%'+_0x3e8d6b[_0xbb5d68('0x1f')][_0xbb5d68('0xa')]+'%'},_0x45679e;}})}));_0x4ada32=_[_0x553474('0x2')]({},_0x4ada32,_0x3e8d6b[_0x553474('0x2c')]);const _0x2c5949={'where':_0x4ada32['where']};return db[_0x553474('0x21')][_0x553474('0x8')](_0x2c5949)['then'](function(_0x3e1eb3){const _0x39127d=_0x553474;return _0x5dd5a9[_0x39127d('0x8')]=_0x3e1eb3,_0x3e8d6b[_0x39127d('0x1f')][_0x39127d('0x1')]&&(_0x4ada32[_0x39127d('0x23')]=[{'all':!![]}]),db[_0x39127d('0x21')][_0x39127d('0x4')](_0x4ada32);})[_0x553474('0x1b')](function(_0x2b14b8){const _0xcf5343=_0x553474;return _0x5dd5a9[_0xcf5343('0x9')]=_0x2b14b8,_0x5dd5a9;})[_0x553474('0x1b')](respondWithFilteredResult(_0x37f1ca,_0x4ada32))[_0x553474('0x0')](handleError(_0x37f1ca,null));};
\ No newline at end of file
+const a453_0x1818=['undefined','count','keys','stack','error','key','name','attributes','model','map','include','order','pick','index','../../components/parsers/qs','then','offset','rows','filter','status','type','sort','includeAll','query','intersection','../../config/logger','filters','limit','Migration','send','nolimit','merge','VIRTUAL','lodash','findAll','Content-Range','options','catch','length','rawAttributes','fields','where'];(function(_0x176466,_0x18184b){const _0x5067ef=function(_0x3baf74){while(--_0x3baf74){_0x176466['push'](_0x176466['shift']());}};_0x5067ef(++_0x18184b);}(a453_0x1818,0x103));const a453_0x5067=function(_0x176466,_0x18184b){_0x176466=_0x176466-0x0;let _0x5067ef=a453_0x1818[_0x176466];return _0x5067ef;};const _0x3ffbd9=a453_0x5067;'use strict';const _=require(_0x3ffbd9('0x1a')),qs=require(_0x3ffbd9('0x7')),logger=require(_0x3ffbd9('0x12'))('api'),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithFilteredResult(_0x3baf74,_0x4048ef){return function(_0x165476){const _0x23a04b=a453_0x5067;if(_0x165476){const _0x3093aa=_0x165476[_0x23a04b('0x24')],_0x330cd1=_0x4048ef[_0x23a04b('0x9')];let _0x588fb5=_0x4048ef[_0x23a04b('0x9')]+_0x4048ef['limit'],_0x274644;return _0x588fb5>=_0x3093aa?(_0x588fb5=_0x3093aa,_0x274644=0xc8):_0x274644=0xce,_0x3baf74[_0x23a04b('0xc')](_0x274644),_0x3baf74['set'](_0x23a04b('0x1c'),_0x330cd1+'-'+_0x588fb5+'/'+_0x3093aa)['json'](_0x165476);}return null;};}function handleError(_0x1ecf59,_0x3f944d){return _0x3f944d=_0x3f944d||0x1f4,function(_0x490106){const _0x2030c5=a453_0x5067;logger[_0x2030c5('0x27')](_0x490106[_0x2030c5('0x26')]),_0x490106['name']&&delete _0x490106[_0x2030c5('0x29')],_0x1ecf59[_0x2030c5('0xc')](_0x3f944d)[_0x2030c5('0x16')](_0x490106);};}exports[_0x3ffbd9('0x6')]=function(_0x47c39f,_0x3e7025){const _0x23c577=_0x3ffbd9;let _0x275869={};const _0x4e3737={},_0x51454f={'count':0x0,'rows':[]},_0x817a78=_[_0x23c577('0x2')](db[_0x23c577('0x15')][_0x23c577('0x20')],function(_0x38d7b8){const _0x3f3f71=_0x23c577;return{'name':_0x38d7b8['fieldName'],'type':_0x38d7b8['type'][_0x3f3f71('0x28')]};});_0x4e3737[_0x23c577('0x1')]=_[_0x23c577('0x2')](_0x817a78,_0x23c577('0x29')),_0x4e3737[_0x23c577('0x10')]=_[_0x23c577('0x25')](_0x47c39f[_0x23c577('0x10')]),_0x4e3737['filters']=_[_0x23c577('0x11')](_0x4e3737[_0x23c577('0x1')],_0x4e3737[_0x23c577('0x10')]),_0x275869[_0x23c577('0x0')]=_[_0x23c577('0x11')](_0x4e3737['model'],qs[_0x23c577('0x21')](_0x47c39f[_0x23c577('0x10')][_0x23c577('0x21')])),_0x275869['attributes']=_0x275869[_0x23c577('0x0')][_0x23c577('0x1f')]?_0x275869[_0x23c577('0x0')]:_0x4e3737[_0x23c577('0x1')];typeof _0x47c39f[_0x23c577('0x10')][_0x23c577('0x17')]===_0x23c577('0x23')&&(_0x275869[_0x23c577('0x14')]=qs['limit'](_0x47c39f[_0x23c577('0x10')]['limit']),_0x275869[_0x23c577('0x9')]=qs['offset'](_0x47c39f[_0x23c577('0x10')][_0x23c577('0x9')]));_0x275869[_0x23c577('0x4')]=qs[_0x23c577('0xe')](_0x47c39f[_0x23c577('0x10')][_0x23c577('0xe')]),_0x275869[_0x23c577('0x22')]=qs[_0x23c577('0x13')](_[_0x23c577('0x5')](_0x47c39f[_0x23c577('0x10')],_0x4e3737[_0x23c577('0x13')]),_0x817a78);_0x47c39f[_0x23c577('0x10')][_0x23c577('0xb')]&&(_0x275869[_0x23c577('0x22')]=_[_0x23c577('0x18')](_0x275869[_0x23c577('0x22')],{[Op['or']]:_['map'](_0x817a78,function(_0x4ff9c6){const _0x32f23c=_0x23c577;if(_0x4ff9c6[_0x32f23c('0xd')]!==_0x32f23c('0x19')){const _0x5540b8={};return _0x5540b8[_0x4ff9c6[_0x32f23c('0x29')]]={[Op['like']]:'%'+_0x47c39f['query'][_0x32f23c('0xb')]+'%'},_0x5540b8;}})}));_0x275869=_[_0x23c577('0x18')]({},_0x275869,_0x47c39f[_0x23c577('0x1d')]);const _0x348e0a={'where':_0x275869[_0x23c577('0x22')]};return db[_0x23c577('0x15')]['count'](_0x348e0a)['then'](function(_0xcd5ea3){const _0x3ed7c6=_0x23c577;return _0x51454f[_0x3ed7c6('0x24')]=_0xcd5ea3,_0x47c39f['query'][_0x3ed7c6('0xf')]&&(_0x275869[_0x3ed7c6('0x3')]=[{'all':!![]}]),db[_0x3ed7c6('0x15')][_0x3ed7c6('0x1b')](_0x275869);})[_0x23c577('0x8')](function(_0x58bc01){const _0x4ce50f=_0x23c577;return _0x51454f[_0x4ce50f('0xa')]=_0x58bc01,_0x51454f;})[_0x23c577('0x8')](respondWithFilteredResult(_0x3e7025,_0x275869))[_0x23c577('0x1e')](handleError(_0x3e7025,null));};
\ No newline at end of file