Built motion from commit 5ae821c.|0.0.127
[motion.git] / server / api / metric / metric.controller.js
index f120d26..0f8d2dc 100644 (file)
@@ -1 +1 @@
-var _0xf9a4=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x4D\x65\x74\x72\x69\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x75\x74\x69\x6C","\x69\x6E\x64\x65\x78","\x6E\x61\x6D\x65","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x53\x6F\x6D\x65\x74\x68\x69\x6E\x67\x20\x62\x6C\x65\x77\x20\x75\x70\x21","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x63\x61\x74\x63\x68","\x63\x6F\x75\x6E\x74","\x63\x65\x69\x6C","\x6F\x66\x66\x73\x65\x74","\x25\x73\x3A\x2F\x2F\x25\x73\x25\x73\x3F\x70\x61\x67\x65\x3D\x25\x64","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x6F\x73\x74","\x68\x65\x61\x64\x65\x72\x73","\x62\x61\x73\x65\x55\x72\x6C","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6D\x65\x74\x72\x69\x63\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x62\x6F\x64\x79","\x6C\x6F\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x4D\x65\x74\x72\x69\x63\x73\x42\x79\x54\x61\x62\x6C\x65","\x74\x61\x62\x6C\x65","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x6D\x65\x74\x72\x69\x63","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x6C\x65\x6E\x67\x74\x68","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x4D\x45\x54\x52\x49\x43","\x66\x69\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x4D\x45\x53\x53\x41\x47\x45\x5F\x4D\x45\x54\x52\x49\x43\x5F\x43\x4F\x4E\x46\x49\x47\x55\x52\x41\x54\x49\x4F\x4E\x5F\x41\x53\x53\x4F\x43\x49\x41\x54\x45\x44","\x67\x65\x74\x5A\x65\x6E\x64\x65\x73\x6B\x54\x65\x78\x74\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79"];_0xf9a4[0];var _=require(_0xf9a4[1]);var Metric=require(_0xf9a4[3])[_0xf9a4[2]];var ReportField=require(_0xf9a4[3])[_0xf9a4[4]];var util=require(_0xf9a4[5]);exports[_0xf9a4[6]]=function(_0x23efx5,_0x23efx6){var _0x23efx7=[_0xf9a4[7],_0xf9a4[8]];var _0x23efx8=_0x23efx5[_0xf9a4[10]][_0xf9a4[9]]?parseInt(_0x23efx5[_0xf9a4[10]][_0xf9a4[9]],10):100;var _0x23efx9=_0x23efx5[_0xf9a4[10]][_0xf9a4[11]]?parseInt(_0x23efx5[_0xf9a4[10]][_0xf9a4[11]],10):0;var _0x23efxa={where:{},limit:_0x23efx8,offset:_0x23efx9*_0x23efx8};_[_0xf9a4[25]](_0x23efx5[_0xf9a4[10]],function(_0x23efxb,_0x23efxc){switch(_0x23efxc){case _0xf9a4[9]:;case _0xf9a4[11]:break;case _0xf9a4[14]:_0x23efxa[_0xf9a4[12]]=util[_0xf9a4[17]](_0xf9a4[13],_0x23efx5[_0xf9a4[10]][_0xf9a4[14]],_0x23efx5[_0xf9a4[10]][_0xf9a4[15]]||_0xf9a4[16])||null;break;case _0xf9a4[15]:break;case _0xf9a4[23]:_0x23efxa[_0xf9a4[19]][_0xf9a4[18]]=[];_0x23efx7[_0xf9a4[22]](function(_0x23efxd){var _0x23efxe={};_0x23efxe[_0x23efxd]={$like:_0xf9a4[20]+_0x23efxb+_0xf9a4[20]};_0x23efxa[_0xf9a4[19]][_0xf9a4[18]][_0xf9a4[21]](_0x23efxe)});break;default:_0x23efxa[_0xf9a4[19]][_0x23efxc]={$like:{}};_0x23efxa[_0xf9a4[19]][_0x23efxc][_0xf9a4[24]]=_0xf9a4[20]+_0x23efxb+_0xf9a4[20]}});Metric[_0xf9a4[40]](_0x23efxa)[_0xf9a4[39]](function(_0x23efx10){var _0x23efx11=Math[_0xf9a4[31]](_0x23efx10[_0xf9a4[30]]/_0x23efx8);var _0x23efx12=_0x23efx11>(_0x23efxa[_0xf9a4[32]]+1)?util[_0xf9a4[17]](_0xf9a4[33],_0x23efx5[_0xf9a4[34]],_0x23efx5[_0xf9a4[36]][_0xf9a4[35]],_0x23efx5[_0xf9a4[37]],_0x23efx9+1):null;var _0x23efx13=_0x23efx9>0?util[_0xf9a4[17]](_0xf9a4[33],_0x23efx5[_0xf9a4[34]],_0x23efx5[_0xf9a4[36]][_0xf9a4[35]],_0x23efx5[_0xf9a4[37]],_0x23efx9-1):null;_0x23efx6[_0xf9a4[28]](200)[_0xf9a4[27]]({count:_0x23efx10[_0xf9a4[30]],rows:_0x23efx10[_0xf9a4[38]],next_page:_0x23efx12,previous_page:_0x23efx13,total_pages:_0x23efx11})})[_0xf9a4[29]](function(_0x23efxf){_0x23efx6[_0xf9a4[28]](500)[_0xf9a4[27]]({error:_0xf9a4[26]})})};exports[_0xf9a4[41]]=function(_0x23efx5,_0x23efx6){console[_0xf9a4[43]](_0x23efx5[_0xf9a4[42]]);Metric[_0xf9a4[45]]({where:{name:_0x23efx5[_0xf9a4[42]][_0xf9a4[7]]}})[_0xf9a4[39]](function(_0x23efx14){if(!_0x23efx14){return _0x23efx6[_0xf9a4[44]](404)};return _0x23efx6[_0xf9a4[27]](_0x23efx14)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[46]]=function(_0x23efx5,_0x23efx6){console[_0xf9a4[43]](_0x23efx5[_0xf9a4[10]]);Metric[_0xf9a4[45]]({where:{table:_0x23efx5[_0xf9a4[10]][_0xf9a4[47]]}})[_0xf9a4[39]](function(_0x23efx14){console[_0xf9a4[43]](_0x23efx14);if(!_0x23efx14){return _0x23efx6[_0xf9a4[44]](404)};return _0x23efx6[_0xf9a4[28]](200)[_0xf9a4[27]](_0x23efx14)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[48]]=function(_0x23efx5,_0x23efx6){Metric[_0xf9a4[51]](_0x23efx5[_0xf9a4[50]][_0xf9a4[49]])[_0xf9a4[39]](function(_0x23efx15){if(!_0x23efx15){return _0x23efx6[_0xf9a4[44]](404)};return _0x23efx6[_0xf9a4[27]](_0x23efx15)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[52]]=function(_0x23efx5,_0x23efx6){Metric[_0xf9a4[52]](_0x23efx5[_0xf9a4[42]])[_0xf9a4[39]](function(_0x23efx15){return _0x23efx6[_0xf9a4[28]](201)[_0xf9a4[27]](_0x23efx15)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[53]]=function(_0x23efx5,_0x23efx6){Metric[_0xf9a4[45]]({where:{name:_0x23efx5[_0xf9a4[42]][_0xf9a4[7]],id:{$ne:_0x23efx5[_0xf9a4[42]][_0xf9a4[49]]}}})[_0xf9a4[39]](function(_0x23efx14){if(!_0x23efx14){return _0x23efx6[_0xf9a4[44]](404)};if(_0x23efx14[_0xf9a4[57]]>0){return _0x23efx6[_0xf9a4[28]](500)[_0xf9a4[27]]({message:_0xf9a4[58]})};if(_0x23efx5[_0xf9a4[42]][_0xf9a4[49]]){delete _0x23efx5[_0xf9a4[42]][_0xf9a4[49]]};return Metric[_0xf9a4[59]]({where:{id:_0x23efx5[_0xf9a4[50]][_0xf9a4[49]]}})})[_0xf9a4[39]](function(_0x23efx15){if(!_0x23efx15){return _0x23efx6[_0xf9a4[44]](404)};var _0x23efx16=_[_0xf9a4[55]](_0x23efx15,_0x23efx5[_0xf9a4[42]]);return _0x23efx16[_0xf9a4[56]]()})[_0xf9a4[39]](function(_0x23efx15){return ReportField[_0xf9a4[53]]({field:_0x23efx15[_0xf9a4[54]]},{where:{MetricId:_0x23efx15[_0xf9a4[49]]}})})[_0xf9a4[39]](function(){return _0x23efx6[_0xf9a4[44]](200)})[_0xf9a4[29]](function(_0x23efxf){console[_0xf9a4[43]](_0x23efxf);return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[60]]=function(_0x23efx5,_0x23efx6){Metric[_0xf9a4[51]](_0x23efx5[_0xf9a4[50]][_0xf9a4[49]])[_0xf9a4[39]](function(_0x23efx15){if(!_0x23efx15){return _0x23efx6[_0xf9a4[44]](404)};_0x23efx15[_0xf9a4[62]]()[_0xf9a4[39]](function(_0x23efx17){if(_0x23efx17[_0xf9a4[57]]>0){return _0x23efx6[_0xf9a4[28]](500)[_0xf9a4[27]]({message:_0xf9a4[61]})};_0x23efx15[_0xf9a4[60]]()[_0xf9a4[39]](function(){return _0x23efx6[_0xf9a4[44]](204)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};exports[_0xf9a4[63]]=function(_0x23efx5,_0x23efx6){Metric[_0xf9a4[60]]({where:{id:_0x23efx5[_0xf9a4[10]][_0xf9a4[49]]},individualHooks:true})[_0xf9a4[39]](function(){return _0x23efx6[_0xf9a4[44]](204)})[_0xf9a4[29]](function(_0x23efxf){return handleError(_0x23efx6,_0x23efxf)})};function handleError(_0x23efx6,_0x23efxf){return _0x23efx6[_0xf9a4[28]](500)[_0xf9a4[27]](_0x23efxf)}
\ No newline at end of file
+var _0xab96=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x4D\x65\x74\x72\x69\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x4D\x65\x74\x72\x69\x63\x73\x42\x79\x54\x61\x62\x6C\x65","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x61\x62\x6C\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x4D\x45\x54\x52\x49\x43","\x6D\x65\x73\x73\x61\x67\x65","\x41\x20\x4D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x74\x68\x61\x74\x20\x6E\x61\x6D\x65\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x65\x78\x69\x73\x74\x73","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6C\x6F\x67","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xab96[0];var _=require(_0xab96[1]);var Metric=require(_0xab96[3])[_0xab96[2]];var util=require(_0xab96[4]);var Util=require(_0xab96[5]);var sequelize=require(_0xab96[3])[_0xab96[6]];exports[_0xab96[7]]= function(_0xcd4ex6,_0xcd4ex7,_0xcd4ex8){return Metric[_0xab96[14]](Util[_0xab96[13]](_0xcd4ex6[_0xab96[12]]))[_0xab96[11]](function(_0xcd4exa){return _0xcd4ex7[_0xab96[10]](200)[_0xab96[9]](_0xcd4exa)})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[15]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[19]]({where:{table:_0xcd4ex6[_0xab96[12]][_0xab96[18]]}})[_0xab96[11]](function(_0xcd4exb){if(!_0xcd4exb){return _0xcd4ex7[_0xab96[16]](404)};return _0xcd4ex7[_0xab96[10]](200)[_0xab96[9]]({count:_0xcd4exb[_0xab96[17]],rows:_0xcd4exb})})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[20]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[23]](_0xcd4ex6[_0xab96[22]][_0xab96[21]])[_0xab96[11]](function(_0xcd4exc){if(!_0xcd4exc){return _0xcd4ex7[_0xab96[16]](404)};return _0xcd4ex7[_0xab96[9]](_0xcd4exc)})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[24]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[24]](_0xcd4ex6[_0xab96[29]])[_0xab96[11]](function(_0xcd4exc){return _0xcd4ex7[_0xab96[10]](201)[_0xab96[9]](_0xcd4exc)})[_0xab96[8]](sequelize.UniqueConstraintError,function(_0xcd4ex9){_0xcd4ex9[_0xab96[25]]= _0xab96[26];_0xcd4ex9[_0xab96[27]]= _0xab96[28];return _0xcd4ex7[_0xab96[10]](500)[_0xab96[9]](_0xcd4ex9)})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[30]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[23]](_0xcd4ex6[_0xab96[22]][_0xab96[21]])[_0xab96[11]](function(_0xcd4exc){if(!_0xcd4exc){return _0xcd4ex7[_0xab96[16]](404)};var _0xcd4exd=_[_0xab96[32]](_0xcd4exc,_0xcd4ex6[_0xab96[29]]);return _0xcd4exd[_0xab96[33]]()})[_0xab96[11]](function(){return _0xcd4ex7[_0xab96[16]](200)})[_0xab96[8]](sequelize.UniqueConstraintError,function(_0xcd4ex9){_0xcd4ex9[_0xab96[25]]= _0xab96[26];_0xcd4ex9[_0xab96[27]]= _0xab96[28];return _0xcd4ex7[_0xab96[10]](500)[_0xab96[9]](_0xcd4ex9)})[_0xab96[8]](function(_0xcd4ex9){console[_0xab96[31]](_0xcd4ex9);return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[34]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[23]](_0xcd4ex6[_0xab96[22]][_0xab96[21]])[_0xab96[11]](function(_0xcd4exc){if(!_0xcd4exc){return _0xcd4ex7[_0xab96[16]](404)};return _0xcd4exc[_0xab96[34]]()})[_0xab96[11]](function(){return _0xcd4ex7[_0xab96[16]](204)})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};exports[_0xab96[35]]= function(_0xcd4ex6,_0xcd4ex7){return Metric[_0xab96[34]]({where:{id:_0xcd4ex6[_0xab96[12]][_0xab96[36]]},individualHooks:true})[_0xab96[11]](function(){return _0xcd4ex7[_0xab96[16]](204)})[_0xab96[8]](function(_0xcd4ex9){return handleError(_0xcd4ex7,_0xcd4ex9)})};function handleError(_0xcd4ex7,_0xcd4ex9){return _0xcd4ex7[_0xab96[10]](500)[_0xab96[9]](_0xcd4ex9)}
\ No newline at end of file