Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / openchannelTransferReport / openchannelTransferReport.controller.js
1 'use strict';const a607_0x5949=['@config/logger','order','@utils/filter-attributes','nolimit','1207233DwjZOV','offset','findOne','undefined','Content-Range','pick','includeAll','fieldName','name','intersection','rawAttributes','destroy','filters','length','api','update','12424ofYpqZ','params','body','OpenchannelTransferReport','key','type','fields','then','send','1CtehyP','21852DbUXto','sendStatus','11113NlekMH','show','@mysqldb','count','query','1174734DSaCzB','attributes','status','catch','29sZpBaE','model','where','18KwvFoN','497guBpQP','create','limit','findAll','lodash','1pgXeDm','@components/parsers/qs','include','keys','describe','154rzSCSF','json','1452230mFQRwb','filter','end','81911zjumte'];const a607_0x52a9=function(_0x46e072,_0x2c7ad7){_0x46e072=_0x46e072-0x1ea;let _0x5949a1=a607_0x5949[_0x46e072];return _0x5949a1;};const a607_0xd7f784=a607_0x52a9;(function(_0x476074,_0x1b8be7){const _0x102f44=a607_0x52a9;while(!![]){try{const _0x4c9073=parseInt(_0x102f44(0x1ee))+-parseInt(_0x102f44(0x226))*parseInt(_0x102f44(0x200))+parseInt(_0x102f44(0x1fb))*-parseInt(_0x102f44(0x20a))+parseInt(_0x102f44(0x205))*-parseInt(_0x102f44(0x1f5))+parseInt(_0x102f44(0x1f2))*-parseInt(_0x102f44(0x224))+parseInt(_0x102f44(0x202))*-parseInt(_0x102f44(0x223))+-parseInt(_0x102f44(0x1f6))*-parseInt(_0x102f44(0x21a));if(_0x4c9073===_0x1b8be7)break;else _0x476074['push'](_0x476074['shift']());}catch(_0x52ae26){_0x476074['push'](_0x476074['shift']());}}}(a607_0x5949,0xd485b));const _=require(a607_0xd7f784(0x1fa)),qs=require(a607_0xd7f784(0x1fc)),logger=require(a607_0xd7f784(0x206))(a607_0xd7f784(0x218)),{db}=require(a607_0xd7f784(0x1eb)),{filterAttributes}=require(a607_0xd7f784(0x208));function respondWithResult(_0x5ace73,_0x5302f2){return _0x5302f2=_0x5302f2||0xc8,function(_0x2a7c47){if(_0x2a7c47)return _0x5ace73['status'](_0x5302f2)['json'](_0x2a7c47);};}function respondWithFilteredResult(_0x588030,_0x2c6549){return function(_0x21d6ed){const _0x5b0ed9=a607_0x52a9;if(_0x21d6ed){const _0x397f12=_0x21d6ed[_0x5b0ed9(0x1ec)],_0x409cd7=_0x2c6549['offset'];let _0x3c593c=_0x2c6549[_0x5b0ed9(0x20b)]+_0x2c6549['limit'],_0x358703;return _0x3c593c>=_0x397f12?(_0x3c593c=_0x397f12,_0x358703=0xc8):_0x358703=0xce,_0x588030[_0x5b0ed9(0x1f0)](_0x358703),_0x588030['set'](_0x5b0ed9(0x20e),_0x409cd7+'-'+_0x3c593c+'/'+_0x397f12)[_0x5b0ed9(0x201)](_0x21d6ed);}return null;};}function saveUpdates(_0x3ff557){return function(_0x237b72){const _0x1ac8e2=a607_0x52a9;if(_0x237b72)return _0x237b72[_0x1ac8e2(0x219)](_0x3ff557)[_0x1ac8e2(0x221)](function(_0x7dd3d4){return _0x7dd3d4;});return null;};}function removeEntity(_0x52ea20){return function(_0x386f81){const _0x20e982=a607_0x52a9;if(_0x386f81)return _0x386f81['destroy']()[_0x20e982(0x221)](function(){const _0x34c11d=_0x20e982;_0x52ea20[_0x34c11d(0x1f0)](0xcc)[_0x34c11d(0x204)]();});};}function handleEntityNotFound(_0x3f5cd7){return function(_0x2d0f1d){const _0x1f3447=a607_0x52a9;return!_0x2d0f1d&&_0x3f5cd7[_0x1f3447(0x225)](0x194),_0x2d0f1d;};}function handleError(_0x475536,_0x1fe302){return _0x1fe302=_0x1fe302||0x1f4,function(_0x5ab393){const _0x264565=a607_0x52a9;logger['error'](_0x5ab393['stack']),_0x5ab393['name']&&delete _0x5ab393[_0x264565(0x212)],_0x475536[_0x264565(0x1f0)](_0x1fe302)[_0x264565(0x222)](_0x5ab393);};}exports['index']=function(_0x69dc04,_0xa0a47c){const _0x1f453a=a607_0xd7f784;let _0x30c359={};const _0x1f84e5={},_0x243c3f={'count':0x0,'rows':[]},_0x506af8=_['map'](db[_0x1f453a(0x21d)]['rawAttributes'],function(_0x4f8231){const _0x2a4d75=_0x1f453a;return{'name':_0x4f8231[_0x2a4d75(0x211)],'type':_0x4f8231[_0x2a4d75(0x21f)][_0x2a4d75(0x21e)]};});_0x1f84e5[_0x1f453a(0x1f3)]=_['map'](_0x506af8,_0x1f453a(0x212)),_0x1f84e5['query']=_['keys'](_0x69dc04[_0x1f453a(0x1ed)]),_0x1f84e5['filters']=_['intersection'](_0x1f84e5[_0x1f453a(0x1f3)],_0x1f84e5['query']),_0x30c359[_0x1f453a(0x1ef)]=_['intersection'](_0x1f84e5[_0x1f453a(0x1f3)],qs[_0x1f453a(0x220)](_0x69dc04['query']['fields'])),_0x30c359[_0x1f453a(0x1ef)]=_0x30c359[_0x1f453a(0x1ef)][_0x1f453a(0x217)]?_0x30c359[_0x1f453a(0x1ef)]:_0x1f84e5[_0x1f453a(0x1f3)];typeof _0x69dc04[_0x1f453a(0x1ed)][_0x1f453a(0x209)]===_0x1f453a(0x20d)&&(_0x30c359['limit']=qs['limit'](_0x69dc04['query'][_0x1f453a(0x1f8)]),_0x30c359[_0x1f453a(0x20b)]=qs['offset'](_0x69dc04[_0x1f453a(0x1ed)]['offset']));_0x30c359[_0x1f453a(0x207)]=qs['sort'](_0x69dc04['query']['sort']),_0x30c359[_0x1f453a(0x1f4)]=qs[_0x1f453a(0x216)](_[_0x1f453a(0x20f)](_0x69dc04[_0x1f453a(0x1ed)],_0x1f84e5['filters']),_0x506af8),_0x30c359=filterAttributes(_0x30c359,_0x69dc04[_0x1f453a(0x1ed)][_0x1f453a(0x203)],_0x506af8,_0x69dc04['options']);const _0x296de2={'where':_0x30c359['where']};return db[_0x1f453a(0x21d)][_0x1f453a(0x1ec)](_0x296de2)['then'](function(_0x4863bb){const _0x38ffc0=_0x1f453a;return _0x243c3f[_0x38ffc0(0x1ec)]=_0x4863bb,_0x69dc04['query'][_0x38ffc0(0x210)]&&(_0x30c359[_0x38ffc0(0x1fd)]=[{'all':!![]}]),db[_0x38ffc0(0x21d)][_0x38ffc0(0x1f9)](_0x30c359);})[_0x1f453a(0x221)](function(_0x41b0d5){return _0x243c3f['rows']=_0x41b0d5,_0x243c3f;})[_0x1f453a(0x221)](respondWithFilteredResult(_0xa0a47c,_0x30c359))[_0x1f453a(0x1f1)](handleError(_0xa0a47c,null));},exports[a607_0xd7f784(0x1ea)]=function(_0x582579,_0x3c9551){const _0x3bf6c7=a607_0xd7f784;let _0x561d7f={'raw':!![],'where':{'id':_0x582579[_0x3bf6c7(0x21b)]['id']}};const _0x2a9cd6={};return _0x2a9cd6['model']=_[_0x3bf6c7(0x1fe)](db[_0x3bf6c7(0x21d)][_0x3bf6c7(0x214)]),_0x2a9cd6[_0x3bf6c7(0x1ed)]=_[_0x3bf6c7(0x1fe)](_0x582579[_0x3bf6c7(0x1ed)]),_0x2a9cd6['filters']=_[_0x3bf6c7(0x213)](_0x2a9cd6[_0x3bf6c7(0x1f3)],_0x2a9cd6[_0x3bf6c7(0x1ed)]),_0x561d7f[_0x3bf6c7(0x1ef)]=_[_0x3bf6c7(0x213)](_0x2a9cd6[_0x3bf6c7(0x1f3)],qs[_0x3bf6c7(0x220)](_0x582579[_0x3bf6c7(0x1ed)][_0x3bf6c7(0x220)])),_0x561d7f[_0x3bf6c7(0x1ef)]=_0x561d7f[_0x3bf6c7(0x1ef)][_0x3bf6c7(0x217)]?_0x561d7f['attributes']:_0x2a9cd6[_0x3bf6c7(0x1f3)],_0x582579[_0x3bf6c7(0x1ed)][_0x3bf6c7(0x210)]&&(_0x561d7f['include']=[{'all':!![]}]),_0x561d7f=_['merge']({},_0x561d7f,_0x582579['options']),db['OpenchannelTransferReport']['findOne'](_0x561d7f)[_0x3bf6c7(0x221)](handleEntityNotFound(_0x3c9551,null))[_0x3bf6c7(0x221)](respondWithResult(_0x3c9551,null))[_0x3bf6c7(0x1f1)](handleError(_0x3c9551,null));},exports[a607_0xd7f784(0x1f7)]=function(_0x18c6bc,_0x397072){const _0x49a152=a607_0xd7f784;return db[_0x49a152(0x21d)][_0x49a152(0x1f7)](_0x18c6bc[_0x49a152(0x21c)],{})[_0x49a152(0x221)](respondWithResult(_0x397072,0xc9))[_0x49a152(0x1f1)](handleError(_0x397072,null));},exports[a607_0xd7f784(0x219)]=function(_0x49dc8a,_0x18b559){const _0x9a7bc7=a607_0xd7f784;return _0x49dc8a[_0x9a7bc7(0x21c)]['id']&&delete _0x49dc8a['body']['id'],db['OpenchannelTransferReport'][_0x9a7bc7(0x20c)]({'where':{'id':_0x49dc8a[_0x9a7bc7(0x21b)]['id']}})[_0x9a7bc7(0x221)](handleEntityNotFound(_0x18b559,null))[_0x9a7bc7(0x221)](saveUpdates(_0x49dc8a['body'],null))[_0x9a7bc7(0x221)](respondWithResult(_0x18b559,null))[_0x9a7bc7(0x1f1)](handleError(_0x18b559,null));},exports[a607_0xd7f784(0x215)]=function(_0x123bda,_0x127884){const _0x5d79ca=a607_0xd7f784;return db['OpenchannelTransferReport'][_0x5d79ca(0x20c)]({'where':{'id':_0x123bda['params']['id']}})[_0x5d79ca(0x221)](handleEntityNotFound(_0x127884,null))[_0x5d79ca(0x221)](removeEntity(_0x127884,null))['catch'](handleError(_0x127884,null));},exports[a607_0xd7f784(0x1ff)]=function(_0x3f4f46,_0x3fbe4b){const _0x29280f=a607_0xd7f784;return db[_0x29280f(0x21d)][_0x29280f(0x1ff)]()[_0x29280f(0x221)](respondWithResult(_0x3fbe4b,null))['catch'](handleError(_0x3fbe4b,null));};