Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / integrationReport / integrationReport.controller.js
index e75f5f0..d0744e6 100644 (file)
@@ -1 +1 @@
-const a437_0x31c0=['create','body','params','../../components/parsers/qs','filters','sort','then','../../mysqldb','model','length','sendStatus','order','pick','Content-Range','intersection','options','status','name','fields','attributes','stack','offset','index','sequelize','../../config/logger','destroy','filter','count','IntegrationReport','query','catch','keys','map','limit','where','json','VIRTUAL','rawAttributes','type','show','end','update','lodash','api','like','includeAll','undefined','merge','describe','include'];(function(_0x3fffed,_0x153abb){const _0x31c08f=function(_0x37a0ca){while(--_0x37a0ca){_0x3fffed['push'](_0x3fffed['shift']());}};_0x31c08f(++_0x153abb);}(a437_0x31c0,0x135));const a437_0x37a0=function(_0x3fffed,_0x153abb){_0x3fffed=_0x3fffed-0x1ae;let _0x31c08f=a437_0x31c0[_0x3fffed];return _0x31c08f;};const a437_0x1cb918=a437_0x37a0;'use strict';const _=require(a437_0x1cb918(0x1cf)),qs=require(a437_0x1cb918(0x1da)),logger=require(a437_0x1cb918(0x1bd))(a437_0x1cb918(0x1d0)),{db}=require(a437_0x1cb918(0x1de)),{Op}=require(a437_0x1cb918(0x1bc));function respondWithResult(_0x13d8c0,_0x598b38){return _0x598b38=_0x598b38||0xc8,function(_0x102369){if(_0x102369)return _0x13d8c0['status'](_0x598b38)['json'](_0x102369);};}function respondWithFilteredResult(_0x2d4f0a,_0x264d8d){return function(_0x1ad01a){const _0x4c390c=a437_0x37a0;if(_0x1ad01a){const _0x1e2149=_0x1ad01a[_0x4c390c(0x1c0)],_0x3270d3=_0x264d8d[_0x4c390c(0x1ba)];let _0x219538=_0x264d8d[_0x4c390c(0x1ba)]+_0x264d8d[_0x4c390c(0x1c6)],_0x3af5c4;return _0x219538>=_0x1e2149?(_0x219538=_0x1e2149,_0x3af5c4=0xc8):_0x3af5c4=0xce,_0x2d4f0a[_0x4c390c(0x1b5)](_0x3af5c4),_0x2d4f0a['set'](_0x4c390c(0x1b2),_0x3270d3+'-'+_0x219538+'/'+_0x1e2149)[_0x4c390c(0x1c8)](_0x1ad01a);}return null;};}function saveUpdates(_0x4744f6){return function(_0x29fa18){const _0x5cd86f=a437_0x37a0;if(_0x29fa18)return _0x29fa18[_0x5cd86f(0x1ce)](_0x4744f6)['then'](function(_0x5ce8cf){return _0x5ce8cf;});return null;};}function removeEntity(_0x475ff7){return function(_0x184451){const _0x52ffd4=a437_0x37a0;if(_0x184451)return _0x184451['destroy']()[_0x52ffd4(0x1dd)](function(){const _0x4d5769=_0x52ffd4;_0x475ff7[_0x4d5769(0x1b5)](0xcc)[_0x4d5769(0x1cd)]();});};}function handleEntityNotFound(_0x41a16e){return function(_0x5bea54){const _0x597d3c=a437_0x37a0;return!_0x5bea54&&_0x41a16e[_0x597d3c(0x1af)](0x194),_0x5bea54;};}function handleError(_0x369f00,_0x4658e7){return _0x4658e7=_0x4658e7||0x1f4,function(_0x2ca83a){const _0x3c7020=a437_0x37a0;logger['error'](_0x2ca83a[_0x3c7020(0x1b9)]),_0x2ca83a[_0x3c7020(0x1b6)]&&delete _0x2ca83a[_0x3c7020(0x1b6)],_0x369f00[_0x3c7020(0x1b5)](_0x4658e7)['send'](_0x2ca83a);};}exports[a437_0x1cb918(0x1bb)]=function(_0x5862ea,_0xf42c09){const _0x1356d3=a437_0x1cb918;let _0x1e99bd={};const _0x405407={},_0x8482bd={'count':0x0,'rows':[]},_0x4a6337=_['map'](db[_0x1356d3(0x1c1)][_0x1356d3(0x1ca)],function(_0x565a34){return{'name':_0x565a34['fieldName'],'type':_0x565a34['type']['key']};});_0x405407['model']=_['map'](_0x4a6337,_0x1356d3(0x1b6)),_0x405407[_0x1356d3(0x1c2)]=_[_0x1356d3(0x1c4)](_0x5862ea[_0x1356d3(0x1c2)]),_0x405407[_0x1356d3(0x1db)]=_['intersection'](_0x405407[_0x1356d3(0x1df)],_0x405407[_0x1356d3(0x1c2)]),_0x1e99bd[_0x1356d3(0x1b8)]=_[_0x1356d3(0x1b3)](_0x405407['model'],qs['fields'](_0x5862ea['query'][_0x1356d3(0x1b7)])),_0x1e99bd[_0x1356d3(0x1b8)]=_0x1e99bd['attributes'][_0x1356d3(0x1ae)]?_0x1e99bd[_0x1356d3(0x1b8)]:_0x405407['model'];typeof _0x5862ea['query']['nolimit']===_0x1356d3(0x1d3)&&(_0x1e99bd[_0x1356d3(0x1c6)]=qs[_0x1356d3(0x1c6)](_0x5862ea[_0x1356d3(0x1c2)]['limit']),_0x1e99bd[_0x1356d3(0x1ba)]=qs['offset'](_0x5862ea[_0x1356d3(0x1c2)][_0x1356d3(0x1ba)]));_0x1e99bd[_0x1356d3(0x1b0)]=qs['sort'](_0x5862ea['query'][_0x1356d3(0x1dc)]),_0x1e99bd[_0x1356d3(0x1c7)]=qs[_0x1356d3(0x1db)](_[_0x1356d3(0x1b1)](_0x5862ea['query'],_0x405407['filters']),_0x4a6337);_0x5862ea[_0x1356d3(0x1c2)][_0x1356d3(0x1bf)]&&(_0x1e99bd[_0x1356d3(0x1c7)]=_['merge'](_0x1e99bd[_0x1356d3(0x1c7)],{[Op['or']]:_[_0x1356d3(0x1c5)](_0x4a6337,function(_0x2e73c1){const _0x4a81c9=_0x1356d3;if(_0x2e73c1[_0x4a81c9(0x1cb)]!==_0x4a81c9(0x1c9)){const _0x56c422={};return _0x56c422[_0x2e73c1[_0x4a81c9(0x1b6)]]={[Op[_0x4a81c9(0x1d1)]]:'%'+_0x5862ea[_0x4a81c9(0x1c2)]['filter']+'%'},_0x56c422;}})}));_0x1e99bd=_[_0x1356d3(0x1d4)]({},_0x1e99bd,_0x5862ea[_0x1356d3(0x1b4)]);const _0x422da6={'where':_0x1e99bd[_0x1356d3(0x1c7)]};return db[_0x1356d3(0x1c1)][_0x1356d3(0x1c0)](_0x422da6)[_0x1356d3(0x1dd)](function(_0x319506){const _0x4f67d2=_0x1356d3;return _0x8482bd[_0x4f67d2(0x1c0)]=_0x319506,_0x5862ea[_0x4f67d2(0x1c2)][_0x4f67d2(0x1d2)]&&(_0x1e99bd['include']=[{'all':!![]}]),db[_0x4f67d2(0x1c1)]['findAll'](_0x1e99bd);})[_0x1356d3(0x1dd)](function(_0x362a2c){return _0x8482bd['rows']=_0x362a2c,_0x8482bd;})[_0x1356d3(0x1dd)](respondWithFilteredResult(_0xf42c09,_0x1e99bd))[_0x1356d3(0x1c3)](handleError(_0xf42c09,null));},exports[a437_0x1cb918(0x1cc)]=function(_0x529708,_0x2feb5f){const _0x4083f3=a437_0x1cb918;let _0xd0ff28={'raw':![],'where':{'id':_0x529708[_0x4083f3(0x1d9)]['id']}};const _0x1f0270={};return _0x1f0270[_0x4083f3(0x1df)]=_['keys'](db[_0x4083f3(0x1c1)][_0x4083f3(0x1ca)]),_0x1f0270['query']=_[_0x4083f3(0x1c4)](_0x529708['query']),_0x1f0270[_0x4083f3(0x1db)]=_['intersection'](_0x1f0270[_0x4083f3(0x1df)],_0x1f0270[_0x4083f3(0x1c2)]),_0xd0ff28[_0x4083f3(0x1b8)]=_[_0x4083f3(0x1b3)](_0x1f0270[_0x4083f3(0x1df)],qs[_0x4083f3(0x1b7)](_0x529708[_0x4083f3(0x1c2)]['fields'])),_0xd0ff28[_0x4083f3(0x1b8)]=_0xd0ff28[_0x4083f3(0x1b8)][_0x4083f3(0x1ae)]?_0xd0ff28['attributes']:_0x1f0270[_0x4083f3(0x1df)],_0x529708[_0x4083f3(0x1c2)][_0x4083f3(0x1d2)]&&(_0xd0ff28[_0x4083f3(0x1d6)]=[{'all':!![]}]),_0xd0ff28=_[_0x4083f3(0x1d4)]({},_0xd0ff28,_0x529708[_0x4083f3(0x1b4)]),db[_0x4083f3(0x1c1)]['findOne'](_0xd0ff28)[_0x4083f3(0x1dd)](handleEntityNotFound(_0x2feb5f,null))['then'](respondWithResult(_0x2feb5f,null))[_0x4083f3(0x1c3)](handleError(_0x2feb5f,null));},exports[a437_0x1cb918(0x1d7)]=function(_0x44d773,_0x246635){const _0x214b76=a437_0x1cb918;return db[_0x214b76(0x1c1)][_0x214b76(0x1d7)](_0x44d773['body'],{})[_0x214b76(0x1dd)](respondWithResult(_0x246635,0xc9))[_0x214b76(0x1c3)](handleError(_0x246635,null));},exports['update']=function(_0x20bf96,_0x1be2cb){const _0x543637=a437_0x1cb918;return _0x20bf96[_0x543637(0x1d8)]['id']&&delete _0x20bf96[_0x543637(0x1d8)]['id'],db[_0x543637(0x1c1)]['findOne']({'where':{'id':_0x20bf96['params']['id']}})['then'](handleEntityNotFound(_0x1be2cb,null))[_0x543637(0x1dd)](saveUpdates(_0x20bf96[_0x543637(0x1d8)],null))[_0x543637(0x1dd)](respondWithResult(_0x1be2cb,null))[_0x543637(0x1c3)](handleError(_0x1be2cb,null));},exports[a437_0x1cb918(0x1be)]=function(_0x37aec6,_0x5b4274){const _0x3b0172=a437_0x1cb918;return db[_0x3b0172(0x1c1)]['findOne']({'where':{'id':_0x37aec6[_0x3b0172(0x1d9)]['id']}})[_0x3b0172(0x1dd)](handleEntityNotFound(_0x5b4274,null))[_0x3b0172(0x1dd)](removeEntity(_0x5b4274,null))[_0x3b0172(0x1c3)](handleError(_0x5b4274,null));},exports[a437_0x1cb918(0x1d5)]=function(_0x381e35,_0x460c12){const _0x18d8f1=a437_0x1cb918;return db[_0x18d8f1(0x1c1)][_0x18d8f1(0x1d5)]()[_0x18d8f1(0x1dd)](respondWithResult(_0x460c12,null))['catch'](handleError(_0x460c12,null));};
\ No newline at end of file
+'use strict';const a437_0x52e2=['name','end','pick','keys','create','count','sendStatus','update','intersection','73HAiUMa','fields','show','rows','findAll','attributes','model','1rPOCOA','then','offset','IntegrationReport','type','sort','@components/parsers/qs','undefined','217QROLcY','filters','where','@mysqldb','limit','findOne','fieldName','40309lUPeDg','filter','order','@utils/filter-attributes','status','nolimit','607860XdOHZD','1YHmSnV','length','json','set','options','destroy','102218IxfzAG','1483800GEuzQq','api','query','7EyFNKF','index','include','635342MkSZZb','catch','stack','body','includeAll','params','error','842789szoBId'];const a437_0x211b=function(_0x175f84,_0x455db0){_0x175f84=_0x175f84-0x16b;let _0x52e287=a437_0x52e2[_0x175f84];return _0x52e287;};const a437_0x5b77df=a437_0x211b;(function(_0x17876e,_0x8479b7){const _0x23c823=a437_0x211b;while(!![]){try{const _0x121b56=-parseInt(_0x23c823(0x195))+parseInt(_0x23c823(0x187))+-parseInt(_0x23c823(0x19c))*parseInt(_0x23c823(0x172))+-parseInt(_0x23c823(0x16b))*-parseInt(_0x23c823(0x17a))+parseInt(_0x23c823(0x192))*-parseInt(_0x23c823(0x181))+-parseInt(_0x23c823(0x18e))*-parseInt(_0x23c823(0x188))+parseInt(_0x23c823(0x18f));if(_0x121b56===_0x8479b7)break;else _0x17876e['push'](_0x17876e['shift']());}catch(_0x3320cd){_0x17876e['push'](_0x17876e['shift']());}}}(a437_0x52e2,0x6db91));const _=require('lodash'),qs=require(a437_0x5b77df(0x178)),logger=require('@config/logger')(a437_0x5b77df(0x190)),{db}=require(a437_0x5b77df(0x17d)),{filterAttributes}=require(a437_0x5b77df(0x184));function respondWithResult(_0x1891b5,_0x2eb55d){return _0x2eb55d=_0x2eb55d||0xc8,function(_0x369a8e){const _0x3e99e5=a437_0x211b;if(_0x369a8e)return _0x1891b5['status'](_0x2eb55d)[_0x3e99e5(0x18a)](_0x369a8e);};}function respondWithFilteredResult(_0x1f0c55,_0x32154c){return function(_0xb24341){const _0x32b697=a437_0x211b;if(_0xb24341){const _0x597372=_0xb24341[_0x32b697(0x1a2)],_0x148ed1=_0x32154c['offset'];let _0x39d869=_0x32154c[_0x32b697(0x174)]+_0x32154c[_0x32b697(0x17e)],_0x40a556;return _0x39d869>=_0x597372?(_0x39d869=_0x597372,_0x40a556=0xc8):_0x40a556=0xce,_0x1f0c55[_0x32b697(0x185)](_0x40a556),_0x1f0c55[_0x32b697(0x18b)]('Content-Range',_0x148ed1+'-'+_0x39d869+'/'+_0x597372)[_0x32b697(0x18a)](_0xb24341);}return null;};}function saveUpdates(_0x44eb28){return function(_0xf03a5b){if(_0xf03a5b)return _0xf03a5b['update'](_0x44eb28)['then'](function(_0x40e790){return _0x40e790;});return null;};}function removeEntity(_0x699387){return function(_0x235105){const _0x76b7fb=a437_0x211b;if(_0x235105)return _0x235105[_0x76b7fb(0x18d)]()[_0x76b7fb(0x173)](function(){const _0x1bee69=_0x76b7fb;_0x699387[_0x1bee69(0x185)](0xcc)[_0x1bee69(0x19e)]();});};}function handleEntityNotFound(_0x4d077f){return function(_0x8a3e3b){const _0x2ad6ac=a437_0x211b;return!_0x8a3e3b&&_0x4d077f[_0x2ad6ac(0x1a3)](0x194),_0x8a3e3b;};}function handleError(_0x3354c5,_0x5218ff){return _0x5218ff=_0x5218ff||0x1f4,function(_0x38df3b){const _0x307476=a437_0x211b;logger[_0x307476(0x19b)](_0x38df3b[_0x307476(0x197)]),_0x38df3b['name']&&delete _0x38df3b[_0x307476(0x19d)],_0x3354c5[_0x307476(0x185)](_0x5218ff)['send'](_0x38df3b);};}exports[a437_0x5b77df(0x193)]=function(_0x411742,_0x3c4cc1){const _0x4cbb51=a437_0x5b77df;let _0x915e9a={};const _0xb8cb9e={},_0x1b46a5={'count':0x0,'rows':[]},_0x44ccbf=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x1b0792){const _0x17577d=a437_0x211b;return{'name':_0x1b0792[_0x17577d(0x180)],'type':_0x1b0792[_0x17577d(0x176)]['key']};});_0xb8cb9e[_0x4cbb51(0x171)]=_['map'](_0x44ccbf,'name'),_0xb8cb9e[_0x4cbb51(0x191)]=_['keys'](_0x411742[_0x4cbb51(0x191)]),_0xb8cb9e[_0x4cbb51(0x17b)]=_[_0x4cbb51(0x1a5)](_0xb8cb9e[_0x4cbb51(0x171)],_0xb8cb9e[_0x4cbb51(0x191)]),_0x915e9a['attributes']=_[_0x4cbb51(0x1a5)](_0xb8cb9e['model'],qs['fields'](_0x411742['query'][_0x4cbb51(0x16c)])),_0x915e9a[_0x4cbb51(0x170)]=_0x915e9a[_0x4cbb51(0x170)][_0x4cbb51(0x189)]?_0x915e9a['attributes']:_0xb8cb9e[_0x4cbb51(0x171)];typeof _0x411742[_0x4cbb51(0x191)][_0x4cbb51(0x186)]===_0x4cbb51(0x179)&&(_0x915e9a[_0x4cbb51(0x17e)]=qs[_0x4cbb51(0x17e)](_0x411742[_0x4cbb51(0x191)][_0x4cbb51(0x17e)]),_0x915e9a[_0x4cbb51(0x174)]=qs[_0x4cbb51(0x174)](_0x411742[_0x4cbb51(0x191)][_0x4cbb51(0x174)]));_0x915e9a[_0x4cbb51(0x183)]=qs[_0x4cbb51(0x177)](_0x411742[_0x4cbb51(0x191)][_0x4cbb51(0x177)]),_0x915e9a['where']=qs[_0x4cbb51(0x17b)](_[_0x4cbb51(0x19f)](_0x411742['query'],_0xb8cb9e[_0x4cbb51(0x17b)]),_0x44ccbf),_0x915e9a=filterAttributes(_0x915e9a,_0x411742[_0x4cbb51(0x191)][_0x4cbb51(0x182)],_0x44ccbf,_0x411742[_0x4cbb51(0x18c)]);const _0x4241db={'where':_0x915e9a[_0x4cbb51(0x17c)]};return db[_0x4cbb51(0x175)][_0x4cbb51(0x1a2)](_0x4241db)[_0x4cbb51(0x173)](function(_0x39c520){const _0x1636ed=_0x4cbb51;return _0x1b46a5[_0x1636ed(0x1a2)]=_0x39c520,_0x411742[_0x1636ed(0x191)][_0x1636ed(0x199)]&&(_0x915e9a[_0x1636ed(0x194)]=[{'all':!![]}]),db['IntegrationReport'][_0x1636ed(0x16f)](_0x915e9a);})[_0x4cbb51(0x173)](function(_0x14243b){const _0x3f4a79=_0x4cbb51;return _0x1b46a5[_0x3f4a79(0x16e)]=_0x14243b,_0x1b46a5;})[_0x4cbb51(0x173)](respondWithFilteredResult(_0x3c4cc1,_0x915e9a))[_0x4cbb51(0x196)](handleError(_0x3c4cc1,null));},exports[a437_0x5b77df(0x16d)]=function(_0xf05019,_0x530fc4){const _0x567db2=a437_0x5b77df;let _0x47faf8={'raw':![],'where':{'id':_0xf05019[_0x567db2(0x19a)]['id']}};const _0x4f3c4b={};return _0x4f3c4b[_0x567db2(0x171)]=_[_0x567db2(0x1a0)](db['IntegrationReport']['rawAttributes']),_0x4f3c4b[_0x567db2(0x191)]=_[_0x567db2(0x1a0)](_0xf05019[_0x567db2(0x191)]),_0x4f3c4b[_0x567db2(0x17b)]=_[_0x567db2(0x1a5)](_0x4f3c4b[_0x567db2(0x171)],_0x4f3c4b['query']),_0x47faf8[_0x567db2(0x170)]=_[_0x567db2(0x1a5)](_0x4f3c4b['model'],qs['fields'](_0xf05019[_0x567db2(0x191)][_0x567db2(0x16c)])),_0x47faf8[_0x567db2(0x170)]=_0x47faf8[_0x567db2(0x170)][_0x567db2(0x189)]?_0x47faf8[_0x567db2(0x170)]:_0x4f3c4b[_0x567db2(0x171)],_0xf05019[_0x567db2(0x191)][_0x567db2(0x199)]&&(_0x47faf8[_0x567db2(0x194)]=[{'all':!![]}]),_0x47faf8=_['merge']({},_0x47faf8,_0xf05019[_0x567db2(0x18c)]),db[_0x567db2(0x175)][_0x567db2(0x17f)](_0x47faf8)[_0x567db2(0x173)](handleEntityNotFound(_0x530fc4,null))[_0x567db2(0x173)](respondWithResult(_0x530fc4,null))[_0x567db2(0x196)](handleError(_0x530fc4,null));},exports[a437_0x5b77df(0x1a1)]=function(_0x4bf8d8,_0x2c5f39){const _0x53ab72=a437_0x5b77df;return db[_0x53ab72(0x175)][_0x53ab72(0x1a1)](_0x4bf8d8[_0x53ab72(0x198)],{})[_0x53ab72(0x173)](respondWithResult(_0x2c5f39,0xc9))[_0x53ab72(0x196)](handleError(_0x2c5f39,null));},exports[a437_0x5b77df(0x1a4)]=function(_0x48dda8,_0x522c07){const _0x3c8f0a=a437_0x5b77df;return _0x48dda8[_0x3c8f0a(0x198)]['id']&&delete _0x48dda8[_0x3c8f0a(0x198)]['id'],db[_0x3c8f0a(0x175)]['findOne']({'where':{'id':_0x48dda8[_0x3c8f0a(0x19a)]['id']}})[_0x3c8f0a(0x173)](handleEntityNotFound(_0x522c07,null))['then'](saveUpdates(_0x48dda8[_0x3c8f0a(0x198)],null))[_0x3c8f0a(0x173)](respondWithResult(_0x522c07,null))[_0x3c8f0a(0x196)](handleError(_0x522c07,null));},exports[a437_0x5b77df(0x18d)]=function(_0x3d770e,_0x57b69a){const _0x58110a=a437_0x5b77df;return db[_0x58110a(0x175)][_0x58110a(0x17f)]({'where':{'id':_0x3d770e[_0x58110a(0x19a)]['id']}})['then'](handleEntityNotFound(_0x57b69a,null))[_0x58110a(0x173)](removeEntity(_0x57b69a,null))[_0x58110a(0x196)](handleError(_0x57b69a,null));},exports['describe']=function(_0x245b0b,_0x4d3de7){const _0x1e195d=a437_0x5b77df;return db[_0x1e195d(0x175)]['describe']()[_0x1e195d(0x173)](respondWithResult(_0x4d3de7,null))[_0x1e195d(0x196)](handleError(_0x4d3de7,null));};
\ No newline at end of file