Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / openchannelApplication / openchannelApplication.controller.js
index d3f5506..bad3cd4 100644 (file)
@@ -1 +1 @@
-const a475_0x1a1e=['OpenchannelApplication','map','stack','undefined','keys','attributes','body','status','findAll','../../config/logger','length','destroy','include','pick','Content-Range','then','merge','sort','params','json','limit','fields','name','update','options','key','where','../../mysqldb','sequelize','catch','model','nolimit','includeAll','query','filters','findOne','lodash','count','../../components/parsers/qs','intersection','show','offset','filter','rows','rawAttributes','create','like'];(function(_0x517d87,_0x1a1e9c){const _0x1c28b7=function(_0x360507){while(--_0x360507){_0x517d87['push'](_0x517d87['shift']());}};_0x1c28b7(++_0x1a1e9c);}(a475_0x1a1e,0x113));const a475_0x1c28=function(_0x517d87,_0x1a1e9c){_0x517d87=_0x517d87-0x0;let _0x1c28b7=a475_0x1a1e[_0x517d87];return _0x1c28b7;};const _0x22e256=a475_0x1c28;'use strict';const _=require(_0x22e256('0x2b')),qs=require(_0x22e256('0x2d')),logger=require(_0x22e256('0x10'))('api'),db=require(_0x22e256('0x22'))['db'],{Op}=require(_0x22e256('0x23'));function respondWithResult(_0x360507,_0x1756f7){return _0x1756f7=_0x1756f7||0xc8,function(_0x1c30c5){const _0x32d618=a475_0x1c28;if(_0x1c30c5)return _0x360507['status'](_0x1756f7)[_0x32d618('0x1a')](_0x1c30c5);};}function respondWithFilteredResult(_0x152a1d,_0x50185c){return function(_0x26d7a3){const _0x31b5f4=a475_0x1c28;if(_0x26d7a3){const _0x23a8e8=_0x26d7a3[_0x31b5f4('0x2c')],_0x59c53a=_0x50185c[_0x31b5f4('0x1')];let _0x4c1146=_0x50185c[_0x31b5f4('0x1')]+_0x50185c[_0x31b5f4('0x1b')],_0x52b1d3;return _0x4c1146>=_0x23a8e8?(_0x4c1146=_0x23a8e8,_0x52b1d3=0xc8):_0x52b1d3=0xce,_0x152a1d[_0x31b5f4('0xe')](_0x52b1d3),_0x152a1d['set'](_0x31b5f4('0x15'),_0x59c53a+'-'+_0x4c1146+'/'+_0x23a8e8)['json'](_0x26d7a3);}return null;};}function saveUpdates(_0x14c537){return function(_0x2ff9fb){const _0x5ab875=a475_0x1c28;if(_0x2ff9fb)return _0x2ff9fb[_0x5ab875('0x1e')](_0x14c537)[_0x5ab875('0x16')](function(_0x382bd5){return _0x382bd5;});return null;};}function removeEntity(_0x237af4){return function(_0x36c4dc){const _0x1de307=a475_0x1c28;if(_0x36c4dc)return _0x36c4dc[_0x1de307('0x12')]()['then'](function(){const _0x18788e=_0x1de307;_0x237af4[_0x18788e('0xe')](0xcc)['end']();});};}function handleEntityNotFound(_0xea461c){return function(_0x3bb17b){return!_0x3bb17b&&_0xea461c['sendStatus'](0x194),_0x3bb17b;};}function handleError(_0x1b8665,_0x4d06e3){return _0x4d06e3=_0x4d06e3||0x1f4,function(_0x4df473){const _0x121c6c=a475_0x1c28;logger['error'](_0x4df473[_0x121c6c('0x9')]),_0x4df473[_0x121c6c('0x1d')]&&delete _0x4df473[_0x121c6c('0x1d')],_0x1b8665['status'](_0x4d06e3)['send'](_0x4df473);};}exports['index']=function(_0xcf2fa9,_0x53c9b4){const _0x576a92=_0x22e256;let _0x3c44d5={};const _0x474f0d={},_0x575a71={'count':0x0,'rows':[]},_0x165b95=_[_0x576a92('0x8')](db['OpenchannelApplication'][_0x576a92('0x4')],function(_0x701eb4){const _0xaf1a76=_0x576a92;return{'name':_0x701eb4['fieldName'],'type':_0x701eb4['type'][_0xaf1a76('0x20')]};});_0x474f0d[_0x576a92('0x25')]=_[_0x576a92('0x8')](_0x165b95,_0x576a92('0x1d')),_0x474f0d[_0x576a92('0x28')]=_[_0x576a92('0xb')](_0xcf2fa9[_0x576a92('0x28')]),_0x474f0d[_0x576a92('0x29')]=_[_0x576a92('0x2e')](_0x474f0d[_0x576a92('0x25')],_0x474f0d[_0x576a92('0x28')]),_0x3c44d5[_0x576a92('0xc')]=_[_0x576a92('0x2e')](_0x474f0d[_0x576a92('0x25')],qs[_0x576a92('0x1c')](_0xcf2fa9[_0x576a92('0x28')][_0x576a92('0x1c')])),_0x3c44d5['attributes']=_0x3c44d5['attributes'][_0x576a92('0x11')]?_0x3c44d5[_0x576a92('0xc')]:_0x474f0d[_0x576a92('0x25')];typeof _0xcf2fa9[_0x576a92('0x28')][_0x576a92('0x26')]===_0x576a92('0xa')&&(_0x3c44d5['limit']=qs[_0x576a92('0x1b')](_0xcf2fa9[_0x576a92('0x28')][_0x576a92('0x1b')]),_0x3c44d5[_0x576a92('0x1')]=qs['offset'](_0xcf2fa9[_0x576a92('0x28')]['offset']));_0x3c44d5['order']=qs['sort'](_0xcf2fa9[_0x576a92('0x28')][_0x576a92('0x18')]),_0x3c44d5[_0x576a92('0x21')]=qs[_0x576a92('0x29')](_[_0x576a92('0x14')](_0xcf2fa9[_0x576a92('0x28')],_0x474f0d['filters']),_0x165b95);_0xcf2fa9[_0x576a92('0x28')][_0x576a92('0x2')]&&(_0x3c44d5['where']=_[_0x576a92('0x17')](_0x3c44d5[_0x576a92('0x21')],{[Op['or']]:_['map'](_0x165b95,function(_0x1a30f8){const _0x4748cc=_0x576a92;if(_0x1a30f8['type']!=='VIRTUAL'){const _0x4c4682={};return _0x4c4682[_0x1a30f8[_0x4748cc('0x1d')]]={[Op[_0x4748cc('0x6')]]:'%'+_0xcf2fa9[_0x4748cc('0x28')][_0x4748cc('0x2')]+'%'},_0x4c4682;}})}));_0x3c44d5=_[_0x576a92('0x17')]({},_0x3c44d5,_0xcf2fa9[_0x576a92('0x1f')]);const _0x51281d={'where':_0x3c44d5[_0x576a92('0x21')]};return db[_0x576a92('0x7')][_0x576a92('0x2c')](_0x51281d)[_0x576a92('0x16')](function(_0x38ba17){const _0x268d53=_0x576a92;return _0x575a71[_0x268d53('0x2c')]=_0x38ba17,_0xcf2fa9[_0x268d53('0x28')][_0x268d53('0x27')]&&(_0x3c44d5[_0x268d53('0x13')]=[{'all':!![]}]),db[_0x268d53('0x7')][_0x268d53('0xf')](_0x3c44d5);})[_0x576a92('0x16')](function(_0x84b35f){const _0x4403a8=_0x576a92;return _0x575a71[_0x4403a8('0x3')]=_0x84b35f,_0x575a71;})[_0x576a92('0x16')](respondWithFilteredResult(_0x53c9b4,_0x3c44d5))[_0x576a92('0x24')](handleError(_0x53c9b4,null));},exports[_0x22e256('0x0')]=function(_0x2db636,_0x42f957){const _0x15b05e=_0x22e256;let _0x21d100={'raw':!![],'where':{'id':_0x2db636[_0x15b05e('0x19')]['id']}};const _0x1532b5={};return _0x1532b5['model']=_[_0x15b05e('0xb')](db[_0x15b05e('0x7')]['rawAttributes']),_0x1532b5[_0x15b05e('0x28')]=_[_0x15b05e('0xb')](_0x2db636[_0x15b05e('0x28')]),_0x1532b5[_0x15b05e('0x29')]=_['intersection'](_0x1532b5[_0x15b05e('0x25')],_0x1532b5[_0x15b05e('0x28')]),_0x21d100[_0x15b05e('0xc')]=_['intersection'](_0x1532b5[_0x15b05e('0x25')],qs[_0x15b05e('0x1c')](_0x2db636[_0x15b05e('0x28')][_0x15b05e('0x1c')])),_0x21d100['attributes']=_0x21d100['attributes'][_0x15b05e('0x11')]?_0x21d100[_0x15b05e('0xc')]:_0x1532b5['model'],_0x2db636[_0x15b05e('0x28')][_0x15b05e('0x27')]&&(_0x21d100[_0x15b05e('0x13')]=[{'all':!![]}]),_0x21d100=_['merge']({},_0x21d100,_0x2db636['options']),db[_0x15b05e('0x7')]['findOne'](_0x21d100)[_0x15b05e('0x16')](handleEntityNotFound(_0x42f957,null))[_0x15b05e('0x16')](respondWithResult(_0x42f957,null))['catch'](handleError(_0x42f957,null));},exports[_0x22e256('0x5')]=function(_0x4639c7,_0x5d1307){const _0x16d902=_0x22e256;return db[_0x16d902('0x7')]['create'](_0x4639c7[_0x16d902('0xd')],{})[_0x16d902('0x16')](respondWithResult(_0x5d1307,0xc9))[_0x16d902('0x24')](handleError(_0x5d1307,null));},exports[_0x22e256('0x1e')]=function(_0x56ad0c,_0x4abe81){const _0xddcf8d=_0x22e256;return _0x56ad0c[_0xddcf8d('0xd')]['id']&&delete _0x56ad0c[_0xddcf8d('0xd')]['id'],db['OpenchannelApplication']['findOne']({'where':{'id':_0x56ad0c['params']['id']}})[_0xddcf8d('0x16')](handleEntityNotFound(_0x4abe81,null))[_0xddcf8d('0x16')](saveUpdates(_0x56ad0c[_0xddcf8d('0xd')],null))[_0xddcf8d('0x16')](respondWithResult(_0x4abe81,null))[_0xddcf8d('0x24')](handleError(_0x4abe81,null));},exports[_0x22e256('0x12')]=function(_0x13edc3,_0xb58244){const _0x4b65d7=_0x22e256;return db[_0x4b65d7('0x7')][_0x4b65d7('0x2a')]({'where':{'id':_0x13edc3['params']['id']}})[_0x4b65d7('0x16')](handleEntityNotFound(_0xb58244,null))[_0x4b65d7('0x16')](removeEntity(_0xb58244,null))['catch'](handleError(_0xb58244,null));};
\ No newline at end of file
+const a475_0x2c4f=['catch','body','type','set','../../components/parsers/qs','../../mysqldb','filters','merge','undefined','length','params','map','filter','status','OpenchannelApplication','update','Content-Range','create','fieldName','query','limit','count','attributes','order','options','index','sort','show','stack','fields','then','intersection','rawAttributes','key','name','keys','includeAll','model','error','findOne','lodash','VIRTUAL','where','json','destroy','findAll','pick','offset','nolimit'];(function(_0x252d28,_0x2c4f66){const _0x52c52f=function(_0x5cf983){while(--_0x5cf983){_0x252d28['push'](_0x252d28['shift']());}};_0x52c52f(++_0x2c4f66);}(a475_0x2c4f,0x111));const a475_0x52c5=function(_0x252d28,_0x2c4f66){_0x252d28=_0x252d28-0x0;let _0x52c52f=a475_0x2c4f[_0x252d28];return _0x52c52f;};const _0x47ce50=a475_0x52c5;'use strict';const _=require(_0x47ce50('0xc')),qs=require(_0x47ce50('0x19')),logger=require('../../config/logger')('api'),db=require(_0x47ce50('0x1a'))['db'],{Op}=require('sequelize');function respondWithResult(_0x5cf983,_0x46354f){return _0x46354f=_0x46354f||0xc8,function(_0x2c8230){const _0x45057b=a475_0x52c5;if(_0x2c8230)return _0x5cf983[_0x45057b('0x22')](_0x46354f)[_0x45057b('0xf')](_0x2c8230);};}function respondWithFilteredResult(_0x5b01ad,_0x73bf3a){return function(_0x46537b){const _0x43a4f2=a475_0x52c5;if(_0x46537b){const _0x1ffa3e=_0x46537b[_0x43a4f2('0x2a')],_0x49f0cd=_0x73bf3a[_0x43a4f2('0x13')];let _0x37c5d9=_0x73bf3a[_0x43a4f2('0x13')]+_0x73bf3a[_0x43a4f2('0x29')],_0x47270c;return _0x37c5d9>=_0x1ffa3e?(_0x37c5d9=_0x1ffa3e,_0x47270c=0xc8):_0x47270c=0xce,_0x5b01ad[_0x43a4f2('0x22')](_0x47270c),_0x5b01ad[_0x43a4f2('0x18')](_0x43a4f2('0x25'),_0x49f0cd+'-'+_0x37c5d9+'/'+_0x1ffa3e)[_0x43a4f2('0xf')](_0x46537b);}return null;};}function saveUpdates(_0x555ab9){return function(_0x3ae8ce){const _0x2b4fdf=a475_0x52c5;if(_0x3ae8ce)return _0x3ae8ce['update'](_0x555ab9)[_0x2b4fdf('0x2')](function(_0x1fe8ea){return _0x1fe8ea;});return null;};}function removeEntity(_0x11b8c4){return function(_0x17bf40){const _0x4f1bca=a475_0x52c5;if(_0x17bf40)return _0x17bf40['destroy']()[_0x4f1bca('0x2')](function(){const _0x27399d=_0x4f1bca;_0x11b8c4[_0x27399d('0x22')](0xcc)['end']();});};}function handleEntityNotFound(_0x57e777){return function(_0x22153e){return!_0x22153e&&_0x57e777['sendStatus'](0x194),_0x22153e;};}function handleError(_0x34a950,_0x3dfe8c){return _0x3dfe8c=_0x3dfe8c||0x1f4,function(_0x59af4e){const _0x189201=a475_0x52c5;logger[_0x189201('0xa')](_0x59af4e[_0x189201('0x0')]),_0x59af4e['name']&&delete _0x59af4e[_0x189201('0x6')],_0x34a950[_0x189201('0x22')](_0x3dfe8c)['send'](_0x59af4e);};}exports[_0x47ce50('0x2e')]=function(_0x207afe,_0x3de739){const _0x4b65c6=_0x47ce50;let _0x476bfc={};const _0x379fa8={},_0x133ef0={'count':0x0,'rows':[]},_0x2cff32=_[_0x4b65c6('0x20')](db['OpenchannelApplication'][_0x4b65c6('0x4')],function(_0x56f0df){const _0x1b4f2b=_0x4b65c6;return{'name':_0x56f0df[_0x1b4f2b('0x27')],'type':_0x56f0df['type'][_0x1b4f2b('0x5')]};});_0x379fa8[_0x4b65c6('0x9')]=_[_0x4b65c6('0x20')](_0x2cff32,_0x4b65c6('0x6')),_0x379fa8[_0x4b65c6('0x28')]=_[_0x4b65c6('0x7')](_0x207afe[_0x4b65c6('0x28')]),_0x379fa8[_0x4b65c6('0x1b')]=_[_0x4b65c6('0x3')](_0x379fa8['model'],_0x379fa8[_0x4b65c6('0x28')]),_0x476bfc[_0x4b65c6('0x2b')]=_['intersection'](_0x379fa8[_0x4b65c6('0x9')],qs[_0x4b65c6('0x1')](_0x207afe[_0x4b65c6('0x28')]['fields'])),_0x476bfc[_0x4b65c6('0x2b')]=_0x476bfc[_0x4b65c6('0x2b')]['length']?_0x476bfc[_0x4b65c6('0x2b')]:_0x379fa8[_0x4b65c6('0x9')];typeof _0x207afe[_0x4b65c6('0x28')][_0x4b65c6('0x14')]===_0x4b65c6('0x1d')&&(_0x476bfc[_0x4b65c6('0x29')]=qs['limit'](_0x207afe[_0x4b65c6('0x28')][_0x4b65c6('0x29')]),_0x476bfc[_0x4b65c6('0x13')]=qs['offset'](_0x207afe[_0x4b65c6('0x28')][_0x4b65c6('0x13')]));_0x476bfc[_0x4b65c6('0x2c')]=qs[_0x4b65c6('0x2f')](_0x207afe['query'][_0x4b65c6('0x2f')]),_0x476bfc['where']=qs[_0x4b65c6('0x1b')](_[_0x4b65c6('0x12')](_0x207afe[_0x4b65c6('0x28')],_0x379fa8[_0x4b65c6('0x1b')]),_0x2cff32);_0x207afe['query']['filter']&&(_0x476bfc[_0x4b65c6('0xe')]=_[_0x4b65c6('0x1c')](_0x476bfc[_0x4b65c6('0xe')],{[Op['or']]:_[_0x4b65c6('0x20')](_0x2cff32,function(_0x2ebdca){const _0x5c973a=_0x4b65c6;if(_0x2ebdca[_0x5c973a('0x17')]!==_0x5c973a('0xd')){const _0x2fdb23={};return _0x2fdb23[_0x2ebdca[_0x5c973a('0x6')]]={[Op['like']]:'%'+_0x207afe[_0x5c973a('0x28')][_0x5c973a('0x21')]+'%'},_0x2fdb23;}})}));_0x476bfc=_['merge']({},_0x476bfc,_0x207afe[_0x4b65c6('0x2d')]);const _0x2dd5c1={'where':_0x476bfc[_0x4b65c6('0xe')]};return db[_0x4b65c6('0x23')]['count'](_0x2dd5c1)['then'](function(_0x270cbb){const _0x313e1b=_0x4b65c6;return _0x133ef0['count']=_0x270cbb,_0x207afe[_0x313e1b('0x28')][_0x313e1b('0x8')]&&(_0x476bfc['include']=[{'all':!![]}]),db[_0x313e1b('0x23')][_0x313e1b('0x11')](_0x476bfc);})['then'](function(_0x421c3b){return _0x133ef0['rows']=_0x421c3b,_0x133ef0;})[_0x4b65c6('0x2')](respondWithFilteredResult(_0x3de739,_0x476bfc))[_0x4b65c6('0x15')](handleError(_0x3de739,null));},exports[_0x47ce50('0x30')]=function(_0x5717d4,_0xfadd6e){const _0x68124d=_0x47ce50;let _0x5bb73b={'raw':!![],'where':{'id':_0x5717d4[_0x68124d('0x1f')]['id']}};const _0x1dbf1c={};return _0x1dbf1c['model']=_[_0x68124d('0x7')](db['OpenchannelApplication'][_0x68124d('0x4')]),_0x1dbf1c[_0x68124d('0x28')]=_['keys'](_0x5717d4[_0x68124d('0x28')]),_0x1dbf1c[_0x68124d('0x1b')]=_[_0x68124d('0x3')](_0x1dbf1c[_0x68124d('0x9')],_0x1dbf1c[_0x68124d('0x28')]),_0x5bb73b['attributes']=_['intersection'](_0x1dbf1c[_0x68124d('0x9')],qs[_0x68124d('0x1')](_0x5717d4[_0x68124d('0x28')]['fields'])),_0x5bb73b[_0x68124d('0x2b')]=_0x5bb73b['attributes'][_0x68124d('0x1e')]?_0x5bb73b[_0x68124d('0x2b')]:_0x1dbf1c[_0x68124d('0x9')],_0x5717d4[_0x68124d('0x28')][_0x68124d('0x8')]&&(_0x5bb73b['include']=[{'all':!![]}]),_0x5bb73b=_[_0x68124d('0x1c')]({},_0x5bb73b,_0x5717d4['options']),db['OpenchannelApplication'][_0x68124d('0xb')](_0x5bb73b)[_0x68124d('0x2')](handleEntityNotFound(_0xfadd6e,null))[_0x68124d('0x2')](respondWithResult(_0xfadd6e,null))[_0x68124d('0x15')](handleError(_0xfadd6e,null));},exports[_0x47ce50('0x26')]=function(_0x5f350b,_0x582fb5){const _0x113ef7=_0x47ce50;return db['OpenchannelApplication'][_0x113ef7('0x26')](_0x5f350b[_0x113ef7('0x16')],{})[_0x113ef7('0x2')](respondWithResult(_0x582fb5,0xc9))['catch'](handleError(_0x582fb5,null));},exports[_0x47ce50('0x24')]=function(_0x186d79,_0x343074){const _0x148a5c=_0x47ce50;return _0x186d79['body']['id']&&delete _0x186d79['body']['id'],db[_0x148a5c('0x23')][_0x148a5c('0xb')]({'where':{'id':_0x186d79[_0x148a5c('0x1f')]['id']}})['then'](handleEntityNotFound(_0x343074,null))[_0x148a5c('0x2')](saveUpdates(_0x186d79['body'],null))[_0x148a5c('0x2')](respondWithResult(_0x343074,null))[_0x148a5c('0x15')](handleError(_0x343074,null));},exports[_0x47ce50('0x10')]=function(_0x48499a,_0x42a720){const _0x3a46bf=_0x47ce50;return db[_0x3a46bf('0x23')][_0x3a46bf('0xb')]({'where':{'id':_0x48499a[_0x3a46bf('0x1f')]['id']}})[_0x3a46bf('0x2')](handleEntityNotFound(_0x42a720,null))['then'](removeEntity(_0x42a720,null))['catch'](handleError(_0x42a720,null));};
\ No newline at end of file