Built motion from commit 0eb9c9185.|1.0.19
[motion.git] / server / api / extracted_report / extracted_report.controller.js
1 var _0xceda=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x6D\x6F\x6D\x65\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x66\x69\x6C\x65\x2D\x62\x61\x73\x65\x36\x34","\x66\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x69\x64","\x75\x73\x65\x72","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x64\x6F\x77\x6E\x6C\x6F\x61\x64","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x72\x65\x70\x6F\x72\x74\x73","\x73\x61\x76\x65\x6E\x61\x6D\x65","\x6A\x6F\x69\x6E","\x65\x6E\x63\x6F\x64\x65","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x74\x72\x6F\x79","\x52\x5F\x4F\x4B","\x57\x5F\x4F\x4B","\x46\x69\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x6F\x72\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x20\x6E\x6F\x74\x20\x70\x65\x72\x6D\x69\x74\x74\x65\x64","\x65\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x20\x64\x65\x6C\x65\x74\x69\x6E\x67\x20\x66\x69\x6C\x65\x20\x3A","\x66\x69\x6C\x65\x20\x64\x65\x6C\x65\x74\x65\x64","\x64\x65\x62\x75\x67","\x75\x6E\x6C\x69\x6E\x6B","\x61\x63\x63\x65\x73\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x70\x75\x73\x68","\x69\x64\x73","\x73\x74\x61\x63\x6B"];_0xceda[0];var _=require(_0xceda[1]);var ExtractedReport=require(_0xceda[3])[_0xceda[2]];var util=require(_0xceda[4]);var path=require(_0xceda[5]);var moment=require(_0xceda[6]);var config=require(_0xceda[7]);var base64=require(_0xceda[8]);var fs=require(_0xceda[9]);var Util=require(_0xceda[10]);var logger=require(_0xceda[12])(_0xceda[11]);exports[_0xceda[13]]= function(_0x92bfxb,_0x92bfxc,_0x92bfxd){switch(_0x92bfxb[_0xceda[20]][_0xceda[23]]){case _0xceda[20]:return ExtractedReport[_0xceda[22]](Util[_0xceda[21]](_0x92bfxb[_0xceda[18]],{UserId:_0x92bfxb[_0xceda[20]][_0xceda[19]]}))[_0xceda[17]](function(_0x92bfxf){_0x92bfxc[_0xceda[16]](200)[_0xceda[15]](_0x92bfxf)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)});default:return ExtractedReport[_0xceda[22]](Util[_0xceda[21]](_0x92bfxb[_0xceda[18]]))[_0xceda[17]](function(_0x92bfxf){_0x92bfxc[_0xceda[16]](200)[_0xceda[15]](_0x92bfxf)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})}};exports[_0xceda[24]]= function(_0x92bfxb,_0x92bfxc){return ExtractedReport[_0xceda[27]](_0x92bfxb[_0xceda[26]][_0xceda[19]])[_0xceda[17]](function(_0x92bfx10){if(!_0x92bfx10){return _0x92bfxc[_0xceda[25]](404)};return _0x92bfxc[_0xceda[15]](_0x92bfx10)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};exports[_0xceda[28]]= function(_0x92bfxb,_0x92bfxc){return ExtractedReport[_0xceda[27]](_0x92bfxb[_0xceda[26]][_0xceda[19]])[_0xceda[17]](function(_0x92bfx11){if(!_0x92bfx11){return _0x92bfxc[_0xceda[16]](404)[_0xceda[15]](_0x92bfx11)};var _0x92bfx12=path[_0xceda[34]](config[_0xceda[29]],_0xceda[30],_0xceda[31],_0xceda[32],_0x92bfx11[_0xceda[33]]);base64[_0xceda[35]](_0x92bfx12,function(_0x92bfxe,_0x92bfx13){if(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)}else {return _0x92bfxc[_0xceda[16]](200)[_0xceda[15]]({downloadString:_0x92bfx13})}})})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};exports[_0xceda[36]]= function(_0x92bfxb,_0x92bfxc){return ExtractedReport[_0xceda[36]](_0x92bfxb[_0xceda[37]])[_0xceda[17]](function(_0x92bfx10){return _0x92bfxc[_0xceda[16]](201)[_0xceda[15]](_0x92bfx10)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};exports[_0xceda[38]]= function(_0x92bfxb,_0x92bfxc){return ExtractedReport[_0xceda[42]]({where:{name:_0x92bfxb[_0xceda[37]][_0xceda[41]],id:{$ne:_0x92bfxb[_0xceda[37]][_0xceda[19]]}}})[_0xceda[17]](function(_0x92bfx15){if(!_0x92bfx15){return _0x92bfxc[_0xceda[25]](404)};if(_0x92bfxb[_0xceda[37]][_0xceda[19]]){delete _0x92bfxb[_0xceda[37]][_0xceda[19]]};return ExtractedReport[_0xceda[27]](_0x92bfxb[_0xceda[26]][_0xceda[19]])})[_0xceda[17]](function(_0x92bfx10){if(!_0x92bfx10){return _0x92bfxc[_0xceda[25]](404)};var _0x92bfx14=_[_0xceda[39]](_0x92bfx10,_0x92bfxb[_0xceda[37]]);return _0x92bfx14[_0xceda[40]]()})[_0xceda[17]](function(_0x92bfx10){return _0x92bfxc[_0xceda[16]](200)[_0xceda[15]](_0x92bfx10)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};exports[_0xceda[43]]= function(_0x92bfxb,_0x92bfxc){var _0x92bfx16;return ExtractedReport[_0xceda[27]](_0x92bfxb[_0xceda[26]][_0xceda[19]])[_0xceda[17]](function(_0x92bfx10){_0x92bfx16= _0x92bfx10;if(!_0x92bfx10){return _0x92bfxc[_0xceda[25]](404)};return _0x92bfx10[_0xceda[43]]()})[_0xceda[17]](function(){if(_0x92bfx16[_0xceda[33]]){var _0x92bfx12=path[_0xceda[34]](config[_0xceda[29]],_0xceda[30],_0xceda[31],_0xceda[32],_0x92bfx16[_0xceda[33]]);fs[_0xceda[52]](_0x92bfx12,fs[_0xceda[44]]| fs[_0xceda[45]],function(_0x92bfxe){if(_0x92bfxe){logger[_0xceda[47]](_0xceda[46])}else {fs[_0xceda[51]](_0x92bfx12,function(_0x92bfxe){if(_0x92bfxe){logger[_0xceda[47]](_0xceda[48],_0x92bfxe)}else {logger[_0xceda[50]](_0xceda[49])}})}})};return _0x92bfxc[_0xceda[25]](204)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};exports[_0xceda[53]]= function(_0x92bfxb,_0x92bfxc){var _0x92bfx17;return ExtractedReport[_0xceda[42]]({where:{id:_0x92bfxb[_0xceda[18]][_0xceda[57]]}})[_0xceda[17]](function(_0x92bfx18){_0x92bfx17= _0x92bfx18;var _0x92bfx19=[];_0x92bfx18[_0xceda[54]](function(_0x92bfx10){_0x92bfx19[_0xceda[56]](_0x92bfx10[_0xceda[43]]())});return _0x92bfx19})[_0xceda[55]]()[_0xceda[17]](function(){_0x92bfx17[_0xceda[54]](function(_0x92bfx10){if(_0x92bfx10[_0xceda[33]]){var _0x92bfx12=path[_0xceda[34]](config[_0xceda[29]],_0xceda[30],_0xceda[31],_0xceda[32],_0x92bfx10[_0xceda[33]]);fs[_0xceda[52]](_0x92bfx12,fs[_0xceda[44]]| fs[_0xceda[45]],function(_0x92bfxe){if(_0x92bfxe){logger[_0xceda[47]](_0xceda[46])}else {fs[_0xceda[51]](_0x92bfx12,function(_0x92bfxe){if(_0x92bfxe){logger[_0xceda[47]](_0xceda[48],_0x92bfxe)}else {logger[_0xceda[50]](_0xceda[49])}})}})}});return _0x92bfxc[_0xceda[25]](204)})[_0xceda[14]](function(_0x92bfxe){return handleError(_0x92bfxc,_0x92bfxe)})};function handleError(_0x92bfxc,_0x92bfxe){logger[_0xceda[47]](_0x92bfxe[_0xceda[58]]);return _0x92bfxc[_0xceda[16]](500)[_0xceda[15]](_0x92bfxe)}