Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / integrationReport / integrationReport.controller.js
index 19ddc3e..77e755c 100644 (file)
@@ -1 +1 @@
-const a363_0x579e=['show','IntegrationReport','findAll','stack','then','findOne','fields','merge','keys','sequelize','send','fieldName','../../components/parsers/qs','catch','set','attributes','where','pick','limit','key','create','index','VIRTUAL','filters','length','count','query','sort','Content-Range','describe','name','like','body','status','params','../../config/logger','offset','destroy','map','options','include','filter','model','type','update','includeAll','undefined','intersection','rawAttributes','json'];(function(_0x9382f2,_0x579e69){const _0x59253b=function(_0xf10ff5){while(--_0xf10ff5){_0x9382f2['push'](_0x9382f2['shift']());}};_0x59253b(++_0x579e69);}(a363_0x579e,0x17c));const a363_0x5925=function(_0x9382f2,_0x579e69){_0x9382f2=_0x9382f2-0x0;let _0x59253b=a363_0x579e[_0x9382f2];return _0x59253b;};const _0xe03ef2=a363_0x5925;'use strict';const _=require('lodash'),qs=require(_0xe03ef2('0x20')),logger=require(_0xe03ef2('0x5'))('api'),db=require('../../mysqldb')['db'],{Op}=require(_0xe03ef2('0x1d'));function respondWithResult(_0xf10ff5,_0x21e091){return _0x21e091=_0x21e091||0xc8,function(_0x2ad06a){const _0x229aa0=a363_0x5925;if(_0x2ad06a)return _0xf10ff5[_0x229aa0('0x3')](_0x21e091)[_0x229aa0('0x13')](_0x2ad06a);};}function respondWithFilteredResult(_0x118dc9,_0x375a26){return function(_0x5160d5){const _0xeea998=a363_0x5925;if(_0x5160d5){const _0x1bd4ed=_0x5160d5['count'],_0x51780b=_0x375a26[_0xeea998('0x6')];let _0x45cf4e=_0x375a26['offset']+_0x375a26['limit'],_0x533b0a;return _0x45cf4e>=_0x1bd4ed?(_0x45cf4e=_0x1bd4ed,_0x533b0a=0xc8):_0x533b0a=0xce,_0x118dc9['status'](_0x533b0a),_0x118dc9[_0xeea998('0x22')](_0xeea998('0x30'),_0x51780b+'-'+_0x45cf4e+'/'+_0x1bd4ed)['json'](_0x5160d5);}return null;};}function saveUpdates(_0x3dc840){return function(_0x2c9636){const _0x3668e4=a363_0x5925;if(_0x2c9636)return _0x2c9636[_0x3668e4('0xe')](_0x3dc840)[_0x3668e4('0x18')](function(_0x509bc4){return _0x509bc4;});return null;};}function removeEntity(_0x886fef){return function(_0x22e418){const _0x56e23a=a363_0x5925;if(_0x22e418)return _0x22e418['destroy']()[_0x56e23a('0x18')](function(){const _0x48cf07=_0x56e23a;_0x886fef[_0x48cf07('0x3')](0xcc)['end']();});};}function handleEntityNotFound(_0xca7933){return function(_0x4d3cdf){return!_0x4d3cdf&&_0xca7933['sendStatus'](0x194),_0x4d3cdf;};}function handleError(_0x11343f,_0x10738d){return _0x10738d=_0x10738d||0x1f4,function(_0x32919c){const _0x13f919=a363_0x5925;logger['error'](_0x32919c[_0x13f919('0x17')]),_0x32919c['name']&&delete _0x32919c['name'],_0x11343f[_0x13f919('0x3')](_0x10738d)[_0x13f919('0x1e')](_0x32919c);};}exports[_0xe03ef2('0x29')]=function(_0x4db595,_0x23835a){const _0x4b47c6=_0xe03ef2;let _0x348ec8={};const _0x363ee6={},_0x9f45={'count':0x0,'rows':[]},_0x4edbbf=_[_0x4b47c6('0x8')](db['IntegrationReport'][_0x4b47c6('0x12')],function(_0x316174){const _0x2769b5=_0x4b47c6;return{'name':_0x316174[_0x2769b5('0x1f')],'type':_0x316174['type'][_0x2769b5('0x27')]};});_0x363ee6[_0x4b47c6('0xc')]=_['map'](_0x4edbbf,_0x4b47c6('0x0')),_0x363ee6[_0x4b47c6('0x2e')]=_[_0x4b47c6('0x1c')](_0x4db595[_0x4b47c6('0x2e')]),_0x363ee6['filters']=_[_0x4b47c6('0x11')](_0x363ee6[_0x4b47c6('0xc')],_0x363ee6['query']),_0x348ec8[_0x4b47c6('0x23')]=_[_0x4b47c6('0x11')](_0x363ee6[_0x4b47c6('0xc')],qs[_0x4b47c6('0x1a')](_0x4db595[_0x4b47c6('0x2e')][_0x4b47c6('0x1a')])),_0x348ec8[_0x4b47c6('0x23')]=_0x348ec8[_0x4b47c6('0x23')][_0x4b47c6('0x2c')]?_0x348ec8[_0x4b47c6('0x23')]:_0x363ee6[_0x4b47c6('0xc')];typeof _0x4db595['query']['nolimit']===_0x4b47c6('0x10')&&(_0x348ec8[_0x4b47c6('0x26')]=qs[_0x4b47c6('0x26')](_0x4db595[_0x4b47c6('0x2e')][_0x4b47c6('0x26')]),_0x348ec8[_0x4b47c6('0x6')]=qs[_0x4b47c6('0x6')](_0x4db595[_0x4b47c6('0x2e')][_0x4b47c6('0x6')]));_0x348ec8['order']=qs[_0x4b47c6('0x2f')](_0x4db595[_0x4b47c6('0x2e')]['sort']),_0x348ec8[_0x4b47c6('0x24')]=qs[_0x4b47c6('0x2b')](_[_0x4b47c6('0x25')](_0x4db595[_0x4b47c6('0x2e')],_0x363ee6[_0x4b47c6('0x2b')]),_0x4edbbf);_0x4db595['query'][_0x4b47c6('0xb')]&&(_0x348ec8[_0x4b47c6('0x24')]=_[_0x4b47c6('0x1b')](_0x348ec8[_0x4b47c6('0x24')],{[Op['or']]:_[_0x4b47c6('0x8')](_0x4edbbf,function(_0x2a5619){const _0x98338b=_0x4b47c6;if(_0x2a5619[_0x98338b('0xd')]!==_0x98338b('0x2a')){const _0x5344a7={};return _0x5344a7[_0x2a5619[_0x98338b('0x0')]]={[Op[_0x98338b('0x1')]]:'%'+_0x4db595['query'][_0x98338b('0xb')]+'%'},_0x5344a7;}})}));_0x348ec8=_[_0x4b47c6('0x1b')]({},_0x348ec8,_0x4db595[_0x4b47c6('0x9')]);const _0x5428d0={'where':_0x348ec8['where']};return db[_0x4b47c6('0x15')][_0x4b47c6('0x2d')](_0x5428d0)[_0x4b47c6('0x18')](function(_0x2a2911){const _0x44a17f=_0x4b47c6;return _0x9f45[_0x44a17f('0x2d')]=_0x2a2911,_0x4db595[_0x44a17f('0x2e')][_0x44a17f('0xf')]&&(_0x348ec8[_0x44a17f('0xa')]=[{'all':!![]}]),db['IntegrationReport'][_0x44a17f('0x16')](_0x348ec8);})[_0x4b47c6('0x18')](function(_0x16dae9){return _0x9f45['rows']=_0x16dae9,_0x9f45;})['then'](respondWithFilteredResult(_0x23835a,_0x348ec8))['catch'](handleError(_0x23835a,null));},exports[_0xe03ef2('0x14')]=function(_0x55b2fc,_0x4091fe){const _0x11fa5f=_0xe03ef2;let _0x3a4e1e={'raw':![],'where':{'id':_0x55b2fc[_0x11fa5f('0x4')]['id']}};const _0x4199cd={};return _0x4199cd[_0x11fa5f('0xc')]=_[_0x11fa5f('0x1c')](db['IntegrationReport']['rawAttributes']),_0x4199cd[_0x11fa5f('0x2e')]=_[_0x11fa5f('0x1c')](_0x55b2fc[_0x11fa5f('0x2e')]),_0x4199cd[_0x11fa5f('0x2b')]=_['intersection'](_0x4199cd['model'],_0x4199cd[_0x11fa5f('0x2e')]),_0x3a4e1e['attributes']=_[_0x11fa5f('0x11')](_0x4199cd[_0x11fa5f('0xc')],qs['fields'](_0x55b2fc[_0x11fa5f('0x2e')][_0x11fa5f('0x1a')])),_0x3a4e1e[_0x11fa5f('0x23')]=_0x3a4e1e[_0x11fa5f('0x23')][_0x11fa5f('0x2c')]?_0x3a4e1e[_0x11fa5f('0x23')]:_0x4199cd[_0x11fa5f('0xc')],_0x55b2fc[_0x11fa5f('0x2e')][_0x11fa5f('0xf')]&&(_0x3a4e1e[_0x11fa5f('0xa')]=[{'all':!![]}]),_0x3a4e1e=_['merge']({},_0x3a4e1e,_0x55b2fc[_0x11fa5f('0x9')]),db[_0x11fa5f('0x15')]['findOne'](_0x3a4e1e)[_0x11fa5f('0x18')](handleEntityNotFound(_0x4091fe,null))[_0x11fa5f('0x18')](respondWithResult(_0x4091fe,null))[_0x11fa5f('0x21')](handleError(_0x4091fe,null));},exports['create']=function(_0x2e3fb7,_0x1fb293){const _0x1039d3=_0xe03ef2;return db[_0x1039d3('0x15')][_0x1039d3('0x28')](_0x2e3fb7[_0x1039d3('0x2')],{})['then'](respondWithResult(_0x1fb293,0xc9))[_0x1039d3('0x21')](handleError(_0x1fb293,null));},exports[_0xe03ef2('0xe')]=function(_0x571100,_0x14265b){const _0x2ece1e=_0xe03ef2;return _0x571100[_0x2ece1e('0x2')]['id']&&delete _0x571100[_0x2ece1e('0x2')]['id'],db[_0x2ece1e('0x15')][_0x2ece1e('0x19')]({'where':{'id':_0x571100[_0x2ece1e('0x4')]['id']}})[_0x2ece1e('0x18')](handleEntityNotFound(_0x14265b,null))[_0x2ece1e('0x18')](saveUpdates(_0x571100[_0x2ece1e('0x2')],null))['then'](respondWithResult(_0x14265b,null))[_0x2ece1e('0x21')](handleError(_0x14265b,null));},exports[_0xe03ef2('0x7')]=function(_0x7f021b,_0x59c210){const _0x3f11ab=_0xe03ef2;return db['IntegrationReport'][_0x3f11ab('0x19')]({'where':{'id':_0x7f021b[_0x3f11ab('0x4')]['id']}})[_0x3f11ab('0x18')](handleEntityNotFound(_0x59c210,null))[_0x3f11ab('0x18')](removeEntity(_0x59c210,null))[_0x3f11ab('0x21')](handleError(_0x59c210,null));},exports[_0xe03ef2('0x31')]=function(_0xef522c,_0x5db706){const _0x53788f=_0xe03ef2;return db[_0x53788f('0x15')][_0x53788f('0x31')]()[_0x53788f('0x18')](respondWithResult(_0x5db706,null))['catch'](handleError(_0x5db706,null));};
\ No newline at end of file
+const a363_0x363e=['length','fieldName','catch','includeAll','create','map','query','options','../../components/parsers/qs','like','intersection','attributes','undefined','error','body','fields','destroy','describe','type','order','json','nolimit','key','stack','count','include','findOne','findAll','update','limit','end','send','model','params','then','sort','name','filter','status','filters','show','lodash','rows','keys','pick','sequelize','IntegrationReport','api','rawAttributes','offset','where','set'];(function(_0x508b55,_0x363e9f){const _0x1d45fd=function(_0x251a57){while(--_0x251a57){_0x508b55['push'](_0x508b55['shift']());}};_0x1d45fd(++_0x363e9f);}(a363_0x363e,0x163));const a363_0x1d45=function(_0x508b55,_0x363e9f){_0x508b55=_0x508b55-0x0;let _0x1d45fd=a363_0x363e[_0x508b55];return _0x1d45fd;};const _0x17a4b6=a363_0x1d45;'use strict';const _=require(_0x17a4b6('0x32')),qs=require(_0x17a4b6('0x11')),logger=require('../../config/logger')(_0x17a4b6('0x4')),db=require('../../mysqldb')['db'],{Op}=require(_0x17a4b6('0x2'));function respondWithResult(_0x251a57,_0x615eef){return _0x615eef=_0x615eef||0xc8,function(_0x2c635a){const _0x5222da=a363_0x1d45;if(_0x2c635a)return _0x251a57[_0x5222da('0x2f')](_0x615eef)['json'](_0x2c635a);};}function respondWithFilteredResult(_0x28bf72,_0x2ece86){return function(_0x22feb6){const _0x48b5e4=a363_0x1d45;if(_0x22feb6){const _0x1d143c=_0x22feb6[_0x48b5e4('0x21')],_0x182ccc=_0x2ece86['offset'];let _0x13529b=_0x2ece86[_0x48b5e4('0x6')]+_0x2ece86[_0x48b5e4('0x26')],_0x38c442;return _0x13529b>=_0x1d143c?(_0x13529b=_0x1d143c,_0x38c442=0xc8):_0x38c442=0xce,_0x28bf72[_0x48b5e4('0x2f')](_0x38c442),_0x28bf72[_0x48b5e4('0x8')]('Content-Range',_0x182ccc+'-'+_0x13529b+'/'+_0x1d143c)[_0x48b5e4('0x1d')](_0x22feb6);}return null;};}function saveUpdates(_0x88223f){return function(_0xae81fb){const _0x4eee40=a363_0x1d45;if(_0xae81fb)return _0xae81fb[_0x4eee40('0x25')](_0x88223f)[_0x4eee40('0x2b')](function(_0x36a132){return _0x36a132;});return null;};}function removeEntity(_0x4adc82){return function(_0x3a4195){const _0x91b834=a363_0x1d45;if(_0x3a4195)return _0x3a4195[_0x91b834('0x19')]()[_0x91b834('0x2b')](function(){const _0x338486=_0x91b834;_0x4adc82[_0x338486('0x2f')](0xcc)[_0x338486('0x27')]();});};}function handleEntityNotFound(_0x1594b2){return function(_0x44d867){return!_0x44d867&&_0x1594b2['sendStatus'](0x194),_0x44d867;};}function handleError(_0x124cef,_0x4e9a8a){return _0x4e9a8a=_0x4e9a8a||0x1f4,function(_0x4a9dea){const _0x24a82b=a363_0x1d45;logger[_0x24a82b('0x16')](_0x4a9dea[_0x24a82b('0x20')]),_0x4a9dea[_0x24a82b('0x2d')]&&delete _0x4a9dea[_0x24a82b('0x2d')],_0x124cef[_0x24a82b('0x2f')](_0x4e9a8a)[_0x24a82b('0x28')](_0x4a9dea);};}exports['index']=function(_0x3ad46c,_0x54f29c){const _0x4c4d23=_0x17a4b6;let _0x48f038={};const _0x2d66a7={},_0x112054={'count':0x0,'rows':[]},_0x139ff3=_[_0x4c4d23('0xe')](db['IntegrationReport'][_0x4c4d23('0x5')],function(_0x3ce3d9){const _0x4c2b2b=_0x4c4d23;return{'name':_0x3ce3d9[_0x4c2b2b('0xa')],'type':_0x3ce3d9[_0x4c2b2b('0x1b')][_0x4c2b2b('0x1f')]};});_0x2d66a7['model']=_['map'](_0x139ff3,'name'),_0x2d66a7[_0x4c4d23('0xf')]=_[_0x4c4d23('0x0')](_0x3ad46c[_0x4c4d23('0xf')]),_0x2d66a7[_0x4c4d23('0x30')]=_[_0x4c4d23('0x13')](_0x2d66a7['model'],_0x2d66a7['query']),_0x48f038[_0x4c4d23('0x14')]=_['intersection'](_0x2d66a7[_0x4c4d23('0x29')],qs['fields'](_0x3ad46c[_0x4c4d23('0xf')][_0x4c4d23('0x18')])),_0x48f038[_0x4c4d23('0x14')]=_0x48f038[_0x4c4d23('0x14')][_0x4c4d23('0x9')]?_0x48f038[_0x4c4d23('0x14')]:_0x2d66a7['model'];typeof _0x3ad46c['query'][_0x4c4d23('0x1e')]===_0x4c4d23('0x15')&&(_0x48f038[_0x4c4d23('0x26')]=qs[_0x4c4d23('0x26')](_0x3ad46c[_0x4c4d23('0xf')][_0x4c4d23('0x26')]),_0x48f038[_0x4c4d23('0x6')]=qs[_0x4c4d23('0x6')](_0x3ad46c[_0x4c4d23('0xf')][_0x4c4d23('0x6')]));_0x48f038[_0x4c4d23('0x1c')]=qs[_0x4c4d23('0x2c')](_0x3ad46c[_0x4c4d23('0xf')]['sort']),_0x48f038['where']=qs[_0x4c4d23('0x30')](_[_0x4c4d23('0x1')](_0x3ad46c[_0x4c4d23('0xf')],_0x2d66a7['filters']),_0x139ff3);_0x3ad46c[_0x4c4d23('0xf')][_0x4c4d23('0x2e')]&&(_0x48f038[_0x4c4d23('0x7')]=_['merge'](_0x48f038[_0x4c4d23('0x7')],{[Op['or']]:_['map'](_0x139ff3,function(_0x52ab84){const _0xb6b134=_0x4c4d23;if(_0x52ab84[_0xb6b134('0x1b')]!=='VIRTUAL'){const _0x5cfe8a={};return _0x5cfe8a[_0x52ab84[_0xb6b134('0x2d')]]={[Op[_0xb6b134('0x12')]]:'%'+_0x3ad46c[_0xb6b134('0xf')]['filter']+'%'},_0x5cfe8a;}})}));_0x48f038=_['merge']({},_0x48f038,_0x3ad46c[_0x4c4d23('0x10')]);const _0x4b9fe3={'where':_0x48f038[_0x4c4d23('0x7')]};return db[_0x4c4d23('0x3')][_0x4c4d23('0x21')](_0x4b9fe3)[_0x4c4d23('0x2b')](function(_0x41d7b8){const _0x26eb81=_0x4c4d23;return _0x112054[_0x26eb81('0x21')]=_0x41d7b8,_0x3ad46c[_0x26eb81('0xf')]['includeAll']&&(_0x48f038['include']=[{'all':!![]}]),db[_0x26eb81('0x3')][_0x26eb81('0x24')](_0x48f038);})[_0x4c4d23('0x2b')](function(_0x56f327){const _0x1a82eb=_0x4c4d23;return _0x112054[_0x1a82eb('0x33')]=_0x56f327,_0x112054;})[_0x4c4d23('0x2b')](respondWithFilteredResult(_0x54f29c,_0x48f038))[_0x4c4d23('0xb')](handleError(_0x54f29c,null));},exports[_0x17a4b6('0x31')]=function(_0x5073a3,_0x4f659b){const _0xd74f21=_0x17a4b6;let _0x2210d6={'raw':![],'where':{'id':_0x5073a3['params']['id']}};const _0x69e894={};return _0x69e894[_0xd74f21('0x29')]=_[_0xd74f21('0x0')](db[_0xd74f21('0x3')][_0xd74f21('0x5')]),_0x69e894['query']=_[_0xd74f21('0x0')](_0x5073a3[_0xd74f21('0xf')]),_0x69e894['filters']=_[_0xd74f21('0x13')](_0x69e894[_0xd74f21('0x29')],_0x69e894['query']),_0x2210d6[_0xd74f21('0x14')]=_[_0xd74f21('0x13')](_0x69e894[_0xd74f21('0x29')],qs[_0xd74f21('0x18')](_0x5073a3[_0xd74f21('0xf')]['fields'])),_0x2210d6[_0xd74f21('0x14')]=_0x2210d6[_0xd74f21('0x14')][_0xd74f21('0x9')]?_0x2210d6['attributes']:_0x69e894['model'],_0x5073a3[_0xd74f21('0xf')][_0xd74f21('0xc')]&&(_0x2210d6[_0xd74f21('0x22')]=[{'all':!![]}]),_0x2210d6=_['merge']({},_0x2210d6,_0x5073a3[_0xd74f21('0x10')]),db[_0xd74f21('0x3')][_0xd74f21('0x23')](_0x2210d6)['then'](handleEntityNotFound(_0x4f659b,null))['then'](respondWithResult(_0x4f659b,null))['catch'](handleError(_0x4f659b,null));},exports[_0x17a4b6('0xd')]=function(_0x33690b,_0x4609d0){const _0x4597cd=_0x17a4b6;return db[_0x4597cd('0x3')][_0x4597cd('0xd')](_0x33690b[_0x4597cd('0x17')],{})[_0x4597cd('0x2b')](respondWithResult(_0x4609d0,0xc9))[_0x4597cd('0xb')](handleError(_0x4609d0,null));},exports[_0x17a4b6('0x25')]=function(_0x365f14,_0x16000c){const _0x17f04d=_0x17a4b6;return _0x365f14['body']['id']&&delete _0x365f14[_0x17f04d('0x17')]['id'],db['IntegrationReport'][_0x17f04d('0x23')]({'where':{'id':_0x365f14[_0x17f04d('0x2a')]['id']}})[_0x17f04d('0x2b')](handleEntityNotFound(_0x16000c,null))['then'](saveUpdates(_0x365f14[_0x17f04d('0x17')],null))[_0x17f04d('0x2b')](respondWithResult(_0x16000c,null))[_0x17f04d('0xb')](handleError(_0x16000c,null));},exports[_0x17a4b6('0x19')]=function(_0x5b11d7,_0x33beba){const _0x8e9b16=_0x17a4b6;return db[_0x8e9b16('0x3')][_0x8e9b16('0x23')]({'where':{'id':_0x5b11d7[_0x8e9b16('0x2a')]['id']}})[_0x8e9b16('0x2b')](handleEntityNotFound(_0x33beba,null))[_0x8e9b16('0x2b')](removeEntity(_0x33beba,null))[_0x8e9b16('0xb')](handleError(_0x33beba,null));},exports['describe']=function(_0x3162db,_0x3d1b87){const _0x13f571=_0x17a4b6;return db['IntegrationReport'][_0x13f571('0x1a')]()[_0x13f571('0x2b')](respondWithResult(_0x3d1b87,null))[_0x13f571('0xb')](handleError(_0x3d1b87,null));};
\ No newline at end of file