Built motion from commit 95c3d5ad5.|1.0.29
[motion.git] / server / config / scheduler / reports.js
index 2183c82..457916b 100644 (file)
@@ -1 +1 @@
-var _0x84d3=["\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74\x2D\x72\x61\x6E\x67\x65","\x2E\x2E\x2F\x75\x74\x69\x6C","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x70\x61\x74\x68","\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\x73\x2D\x65\x78\x74\x72\x61","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x52\x65\x70\x6F\x72\x74\x73\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x73\x20\x6C\x61\x75\x6E\x63\x68\x65\x72\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x65\x78\x74\x72\x61\x63\x74\x52\x65\x70\x6F\x72\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x45\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x63\x75\x72\x72\x65\x6E\x74\x44\x61\x79","\x63\x72\x6F\x6E\x54\x79\x70\x65","\x43\x68\x65\x63\x6B\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x20\x72\x61\x6E\x67\x65\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x2E\x2E\x2E","\x76\x61\x6C\x69\x64\x69\x74\x79\x53\x74\x61\x72\x74","\x76\x61\x6C\x69\x64\x69\x74\x79\x45\x6E\x64","\x54\x68\x65\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\x2C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x30\x30\x3A\x30\x30","\x32\x33\x3A\x35\x39","\x4F\x75\x74\x20\x6F\x66\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x2C\x20\x73\x6B\x69\x70\x70\x69\x6E\x67\x20\x72\x65\x63\x6F\x72\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x21","\x64\x61\x79\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x79\x65\x73\x74\x65\x72\x64\x61\x79","\x6C\x61\x73\x74\x37","\x6C\x61\x73\x74\x33\x30","\x6D\x6F\x6E\x74\x68","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x6F\x6E\x74\x68\x73","\x65\x6E\x64\x4F\x66","\x6C\x61\x73\x74\x4D\x6F\x6E\x74\x68","\x72\x65\x70\x6F\x72\x74\x52\x61\x6E\x67\x65","\x63\x6F\x6E\x74\x61\x69\x6E\x73","\x68","\x72\x61\x6E\x67\x65","\x74\x65\x78\x74","\x2F\x20","\x70\x61\x72\x65\x6E\x74","\x23","\x66\x69\x6E\x64","\x72\x65\x70\x6F\x72\x74\x54\x79\x70\x65","\x64\x65\x66\x61\x75\x6C\x74","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72\x3A\x20","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65\x64","\x64\x65\x62\x75\x67","\x6D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x73\x74\x61\x74\x75\x73","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x69\x64","\x6B\x69\x6C\x6C","\x61\x64\x6D\x69\x6E","\x72\x65\x70\x6F\x72\x74\x4F\x75\x74\x70\x75\x74","\x73\x65\x6E\x64","\x73\x70\x72\x65\x61\x64","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x6E\x61\x6D\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x6D\x61\x6E\x75\x61\x6C","\x73\x63\x68\x65\x64\x75\x6C\x65\x64","\x63\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x52\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x65\x70\x6F\x72\x74\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x66\x69\x6E\x61\x6C\x6C\x79","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x73\x65\x6E\x74\x21","\x73\x65\x74\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x52\x65\x70\x6F\x72\x74","\x61\x64\x64\x72\x65\x73\x73","\x65\x6D\x61\x69\x6C","\x41\x20\x6E\x65\x77\x20\x72\x65\x70\x6F\x72\x74\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x63\x68\x65\x63\x6B\x20\x74\x68\x65\x20\x61\x74\x74\x61\x63\x68\x65\x64\x20\x66\x69\x6C\x65\x2E","\x53\x45\x4E\x44\x49\x4E\x47","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2C\x20\x75\x6E\x61\x62\x6C\x65\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x69\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x4E\x6F\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x6F\x72\x20\x53\x4D\x54\x50\x20\x61\x64\x64\x72\x65\x73\x73\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\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","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x2E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x6F\x75\x74\x70\x75\x74","\x62\x61\x73\x65\x6E\x61\x6D\x65","\x63\x6F\x70\x79\x53\x79\x6E\x63","\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x20\x66\x6F\x72\x20\x6D\x61\x69\x6C\x20\x72\x65\x70\x6F\x72\x74\x20\x73\x75\x63\x63\x65\x73\x73\x66\x75\x6C\x6C\x79\x20\x67\x6F\x74\x74\x65\x6E\x21","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x21","\x67\x65\x74\x46\x69\x6C\x65\x53\x69\x7A\x65","\x5F","\x44\x44\x2D\x4D\x4D\x2D\x59\x59\x59\x59","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x65\x6E\x64\x44\x61\x74\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F","\x65\x78\x70\x6F\x72\x74\x73"];var cp=require(_0x84d3[0]);var moment=require(_0x84d3[1]);require(_0x84d3[2]);var Util=require(_0x84d3[3]);var logger=require(_0x84d3[5])(_0x84d3[4]);var CustomReport=require(_0x84d3[7])[_0x84d3[6]];var DefaultReport=require(_0x84d3[7])[_0x84d3[8]];var ExtractedReport=require(_0x84d3[7])[_0x84d3[9]];var MailAttachment=require(_0x84d3[7])[_0x84d3[10]];var MailServerOut=require(_0x84d3[7])[_0x84d3[11]];var MailAccount=require(_0x84d3[7])[_0x84d3[12]];var MailMessage=require(_0x84d3[7])[_0x84d3[13]];var path=require(_0x84d3[14]);var config=require(_0x84d3[15]);var fs=require(_0x84d3[16]);var _=require(_0x84d3[17]);var ReportTree=require(_0x84d3[7])[_0x84d3[18]];function Reports(){logger[_0x84d3[20]](_0x84d3[19])}Reports[_0x84d3[22]][_0x84d3[21]]= function(_0x8d53x12,_0x8d53x13){logger[_0x84d3[20]](_0x84d3[23]);extract(_0x8d53x12,_0x8d53x13)};function extract(_0x8d53x12,_0x8d53x13){switch(_0x8d53x12[_0x84d3[25]]){case _0x84d3[24]:extractTodayReport(_0x8d53x12,_0x8d53x13);break;default:extractRangeReport(_0x8d53x12,_0x8d53x13);break}}function extractTodayReport(_0x8d53x12,_0x8d53x13){logger[_0x84d3[20]](_0x84d3[26]);if(_0x8d53x13|| checkValidity(_0x8d53x12[_0x84d3[27]],_0x8d53x12[_0x84d3[28]])){logger[_0x84d3[20]](_0x84d3[29]);docExtract(_0x8d53x12,moment()[_0x84d3[31]](_0x84d3[30]),moment()[_0x84d3[31]](_0x84d3[30]),_0x8d53x13,_0x84d3[32],_0x84d3[33])}else {logger[_0x84d3[20]](_0x84d3[34])}}function extractRangeReport(_0x8d53x12,_0x8d53x13){switch(_0x8d53x12[_0x84d3[45]]){case _0x84d3[37]:docExtract(_0x8d53x12,moment()[_0x84d3[36]](1,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),moment()[_0x84d3[36]](1,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),_0x8d53x13);break;case _0x84d3[38]:docExtract(_0x8d53x12,moment()[_0x84d3[36]](7,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),moment()[_0x84d3[36]](1,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),_0x8d53x13);break;case _0x84d3[39]:docExtract(_0x8d53x12,moment()[_0x84d3[36]](30,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),moment()[_0x84d3[36]](1,_0x84d3[35])[_0x84d3[31]](_0x84d3[30]),_0x8d53x13);break;case _0x84d3[44]:docExtract(_0x8d53x12,moment()[_0x84d3[36]](1,_0x84d3[42])[_0x84d3[41]](_0x84d3[40])[_0x84d3[31]](_0x84d3[30]),moment()[_0x84d3[36]](1,_0x84d3[42])[_0x84d3[43]](_0x84d3[40])[_0x84d3[31]](_0x84d3[30]),_0x8d53x13);break}}function checkValidity(_0x8d53x18,_0x8d53x19){return moment()[_0x84d3[48]](moment(_0x8d53x18,_0x84d3[47]),moment(_0x8d53x19,_0x84d3[47]))[_0x84d3[46]](moment())}function getReportPath(_0x8d53x1b,_0x8d53x1c,path){path= _0x8d53x1b[_0x84d3[49]]+ _0x84d3[50]+ path;if(_0x8d53x1b[_0x84d3[51]]=== _0x84d3[52]){return path}else {return getReportPath(_[_0x84d3[53]](_0x8d53x1c,{id:_0x8d53x1b[_0x84d3[51]]}),_0x8d53x1c,path)}}function docExtract(_0x8d53x12,_0x8d53x1e,_0x8d53x1f,_0x8d53x13,_0x8d53x20,_0x8d53x21){var _0x8d53x22=_0x8d53x12[_0x84d3[54]]=== _0x84d3[55]?DefaultReport:CustomReport;var _0x8d53x23;_0x8d53x22[_0x84d3[94]](_0x84d3[93])[_0x84d3[91]](_0x8d53x12[_0x84d3[92]])[_0x84d3[89]](function(_0x8d53x28){if(!_0x8d53x28){logger[_0x84d3[58]](_0x84d3[90]);return};_0x8d53x23= _0x8d53x28;return ReportTree[_0x84d3[91]](_0x8d53x12[_0x84d3[54]]=== _0x84d3[55]?1:2)})[_0x84d3[89]](function(_0x8d53x1c){_0x8d53x1c= JSON[_0x84d3[79]](_0x8d53x1c[_0x84d3[78]]);var _0x8d53x1b=_[_0x84d3[53]](_0x8d53x1c,{id:_0x8d53x23[_0x84d3[51]]});var path=getReportPath(_0x8d53x1b,_0x8d53x1c,_0x8d53x23[_0x84d3[80]]);if(_0x8d53x12[_0x84d3[25]]=== _0x84d3[24]){_0x8d53x23[_0x84d3[82]][_0x84d3[81]]= _0x8d53x23[_0x84d3[82]][_0x84d3[81]][_0x84d3[85]](_0x84d3[83],_0x84d3[84])};return [_0x8d53x23,ExtractedReport[_0x84d3[88]]({name:_0x8d53x23[_0x84d3[80]],startDate:_0x8d53x1e,endDate:_0x8d53x1f,output:_0x8d53x12[_0x84d3[75]],type:_0x8d53x13?_0x84d3[86]:_0x84d3[87],UserId:_0x8d53x13?_0x8d53x13[_0x84d3[72]]:null})]})[_0x84d3[77]](function(_0x8d53x23,_0x8d53x25){var _0x8d53x26=cp[_0x84d3[61]](__dirname+ _0x84d3[60]);_0x8d53x26[_0x84d3[63]](_0x84d3[67],function(_0x8d53x27){logger[_0x84d3[66]](_0x84d3[68],_0x8d53x27);if(_0x8d53x12[_0x84d3[69]]&& _0x8d53x27[_0x84d3[70]]=== _0x84d3[71]){sendReportByMail(_0x8d53x12,_0x8d53x25[_0x84d3[72]],_0x8d53x13,_0x8d53x26)}else {_0x8d53x26[_0x84d3[73]]()}})[_0x84d3[63]](_0x84d3[64],function(){logger[_0x84d3[66]](_0x84d3[65])})[_0x84d3[63]](_0x84d3[58],function(_0x8d53x24){logger[_0x84d3[58]](_0x84d3[62],_0x8d53x24)});_0x8d53x26[_0x84d3[76]]({report:_0x8d53x23,query:{startDate:_0x8d53x1e,endDate:_0x8d53x1f,startTime:_0x8d53x20|| null,endTime:_0x8d53x21|| null},extractedId:_0x8d53x25[_0x84d3[72]],user:_0x8d53x13?_0x8d53x13:{role:_0x84d3[74]},type:_0x8d53x12[_0x84d3[75]]})})[_0x84d3[59]](function(_0x8d53x24){logger[_0x84d3[58]](_0x84d3[56],_0x8d53x24[_0x84d3[57]])})}function sendReportByMail(_0x8d53x12,_0x8d53x2a,_0x8d53x13,_0x8d53x26){var _0x8d53x2b;return ExtractedReport[_0x84d3[91]](_0x8d53x2a)[_0x84d3[89]](function(extract){if(!extract){throw  new Error(_0x84d3[104])};_0x8d53x2b= extract;if(_0x8d53x12[_0x84d3[11]]&& _0x8d53x12[_0x84d3[11]][_0x84d3[72]]){return MailAccount[_0x84d3[53]]({attributes:[_0x84d3[72],_0x84d3[100]],include:[{model:MailServerOut,attributes:[_0x84d3[72],_0x84d3[105]],where:{id:_0x8d53x12[_0x84d3[11]][_0x84d3[72]]}}]})}else {throw  new Error(_0x84d3[106])}})[_0x84d3[89]](function(_0x8d53x2d){var _0x8d53x2e=getAttachment(_0x8d53x2b);var _0x8d53x2f={subject:_0x84d3[99],from:[_0x8d53x2d[_0x84d3[100]]],to:[_0x8d53x12[_0x84d3[101]]],cc:[],html:_0x84d3[102],text:null,inReplyTo:null,status:_0x84d3[103],attachment:true,UserId:_0x8d53x13?_0x8d53x13[_0x84d3[72]]:null,MailAttachments:[_0x8d53x2e]};return MailMessage[_0x84d3[88]](_0x8d53x2f,{include:[{model:MailAttachment}]})})[_0x84d3[89]](function(_0x8d53x2c){return _0x8d53x2b[_0x84d3[98]](_0x8d53x2c)})[_0x84d3[89]](function(){logger[_0x84d3[20]](_0x84d3[97])})[_0x84d3[59]](function(_0x8d53x24){logger[_0x84d3[58]](_0x84d3[96],_0x8d53x24[_0x84d3[57]])})[_0x84d3[95]](function(){_0x8d53x26[_0x84d3[73]]()})}function getAttachment(extract){var _0x8d53x31=path[_0x84d3[112]](config[_0x84d3[107]],_0x84d3[108],_0x84d3[109],_0x84d3[110],extract[_0x84d3[111]]);var _0x8d53x32=path[_0x84d3[112]](config[_0x84d3[107]],_0x84d3[108],_0x84d3[109],_0x84d3[113]);var _0x8d53x33=path[_0x84d3[117]](extract[_0x84d3[111]],_0x84d3[114]+ extract[_0x84d3[116]][_0x84d3[115]]());try{fs[_0x84d3[118]](_0x8d53x31,path[_0x84d3[112]](_0x8d53x32,_0x8d53x33));logger[_0x84d3[66]](_0x84d3[119])}catch(err){logger[_0x84d3[58]](_0x84d3[120]);return null};return {size:Util[_0x84d3[121]](_0x8d53x31),path:path[_0x84d3[112]](_0x8d53x32,_0x8d53x33),name:extract[_0x84d3[80]]+ _0x84d3[122]+ moment(extract[_0x84d3[124]])[_0x84d3[31]](_0x84d3[123])+ _0x84d3[122]+ moment(extract[_0x84d3[125]])[_0x84d3[31]](_0x84d3[123])+ _0x84d3[114]+ extract[_0x84d3[116]][_0x84d3[115]](),type:_0x84d3[126]+ extract[_0x84d3[116]][_0x84d3[115]](),basename:_0x8d53x33}}module[_0x84d3[127]]= Reports
\ No newline at end of file
+var _0xc875=["\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74\x2D\x72\x61\x6E\x67\x65","\x2E\x2E\x2F\x75\x74\x69\x6C","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x70\x61\x74\x68","\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\x73\x2D\x65\x78\x74\x72\x61","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x52\x65\x70\x6F\x72\x74\x73\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x73\x20\x6C\x61\x75\x6E\x63\x68\x65\x72\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x65\x78\x74\x72\x61\x63\x74\x52\x65\x70\x6F\x72\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x45\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x63\x75\x72\x72\x65\x6E\x74\x44\x61\x79","\x63\x72\x6F\x6E\x54\x79\x70\x65","\x43\x68\x65\x63\x6B\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x20\x72\x61\x6E\x67\x65\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x2E\x2E\x2E","\x76\x61\x6C\x69\x64\x69\x74\x79\x53\x74\x61\x72\x74","\x76\x61\x6C\x69\x64\x69\x74\x79\x45\x6E\x64","\x54\x68\x65\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\x2C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x30\x30\x3A\x30\x30","\x32\x33\x3A\x35\x39","\x4F\x75\x74\x20\x6F\x66\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x2C\x20\x73\x6B\x69\x70\x70\x69\x6E\x67\x20\x72\x65\x63\x6F\x72\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x21","\x64\x61\x79\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x79\x65\x73\x74\x65\x72\x64\x61\x79","\x6C\x61\x73\x74\x37","\x6C\x61\x73\x74\x33\x30","\x6D\x6F\x6E\x74\x68","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x6F\x6E\x74\x68\x73","\x65\x6E\x64\x4F\x66","\x6C\x61\x73\x74\x4D\x6F\x6E\x74\x68","\x72\x65\x70\x6F\x72\x74\x52\x61\x6E\x67\x65","\x63\x6F\x6E\x74\x61\x69\x6E\x73","\x68","\x72\x61\x6E\x67\x65","\x74\x65\x78\x74","\x2F\x20","\x70\x61\x72\x65\x6E\x74","\x23","\x66\x69\x6E\x64","\x72\x65\x70\x6F\x72\x74\x54\x79\x70\x65","\x64\x65\x66\x61\x75\x6C\x74","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72\x3A\x20","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65\x64","\x64\x65\x62\x75\x67","\x6D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x73\x74\x61\x74\x75\x73","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x69\x64","\x6B\x69\x6C\x6C","\x61\x64\x6D\x69\x6E","\x72\x65\x70\x6F\x72\x74\x4F\x75\x74\x70\x75\x74","\x73\x65\x6E\x64","\x73\x70\x72\x65\x61\x64","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x6E\x61\x6D\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x6D\x61\x6E\x75\x61\x6C","\x73\x63\x68\x65\x64\x75\x6C\x65\x64","\x63\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x52\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x65\x70\x6F\x72\x74\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x66\x69\x6E\x61\x6C\x6C\x79","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x73\x65\x6E\x74\x21","\x73\x65\x74\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x52\x65\x70\x6F\x72\x74","\x61\x64\x64\x72\x65\x73\x73","\x65\x6D\x61\x69\x6C","\x41\x20\x6E\x65\x77\x20\x72\x65\x70\x6F\x72\x74\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x63\x68\x65\x63\x6B\x20\x74\x68\x65\x20\x61\x74\x74\x61\x63\x68\x65\x64\x20\x66\x69\x6C\x65\x2E","\x53\x45\x4E\x44\x49\x4E\x47","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2C\x20\x75\x6E\x61\x62\x6C\x65\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x69\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x4E\x6F\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x6F\x72\x20\x53\x4D\x54\x50\x20\x61\x64\x64\x72\x65\x73\x73\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\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","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x2E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x6F\x75\x74\x70\x75\x74","\x62\x61\x73\x65\x6E\x61\x6D\x65","\x63\x6F\x70\x79\x53\x79\x6E\x63","\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x20\x66\x6F\x72\x20\x6D\x61\x69\x6C\x20\x72\x65\x70\x6F\x72\x74\x20\x73\x75\x63\x63\x65\x73\x73\x66\x75\x6C\x6C\x79\x20\x67\x6F\x74\x74\x65\x6E\x21","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x21","\x67\x65\x74\x46\x69\x6C\x65\x53\x69\x7A\x65","\x5F","\x44\x44\x2D\x4D\x4D\x2D\x59\x59\x59\x59","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x65\x6E\x64\x44\x61\x74\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F","\x65\x78\x70\x6F\x72\x74\x73"];var cp=require(_0xc875[0]);var moment=require(_0xc875[1]);require(_0xc875[2]);var Util=require(_0xc875[3]);var logger=require(_0xc875[5])(_0xc875[4]);var CustomReport=require(_0xc875[7])[_0xc875[6]];var DefaultReport=require(_0xc875[7])[_0xc875[8]];var ExtractedReport=require(_0xc875[7])[_0xc875[9]];var MailAttachment=require(_0xc875[7])[_0xc875[10]];var MailServerOut=require(_0xc875[7])[_0xc875[11]];var MailAccount=require(_0xc875[7])[_0xc875[12]];var MailMessage=require(_0xc875[7])[_0xc875[13]];var path=require(_0xc875[14]);var config=require(_0xc875[15]);var fs=require(_0xc875[16]);var _=require(_0xc875[17]);var ReportTree=require(_0xc875[7])[_0xc875[18]];function Reports(){logger[_0xc875[20]](_0xc875[19])}Reports[_0xc875[22]][_0xc875[21]]= function(_0x8472x12,_0x8472x13){logger[_0xc875[20]](_0xc875[23]);extract(_0x8472x12,_0x8472x13)};function extract(_0x8472x12,_0x8472x13){switch(_0x8472x12[_0xc875[25]]){case _0xc875[24]:extractTodayReport(_0x8472x12,_0x8472x13);break;default:extractRangeReport(_0x8472x12,_0x8472x13);break}}function extractTodayReport(_0x8472x12,_0x8472x13){logger[_0xc875[20]](_0xc875[26]);if(_0x8472x13|| checkValidity(_0x8472x12[_0xc875[27]],_0x8472x12[_0xc875[28]])){logger[_0xc875[20]](_0xc875[29]);docExtract(_0x8472x12,moment()[_0xc875[31]](_0xc875[30]),moment()[_0xc875[31]](_0xc875[30]),_0x8472x13,_0xc875[32],_0xc875[33])}else {logger[_0xc875[20]](_0xc875[34])}}function extractRangeReport(_0x8472x12,_0x8472x13){switch(_0x8472x12[_0xc875[45]]){case _0xc875[37]:docExtract(_0x8472x12,moment()[_0xc875[36]](1,_0xc875[35])[_0xc875[31]](_0xc875[30]),moment()[_0xc875[36]](1,_0xc875[35])[_0xc875[31]](_0xc875[30]),_0x8472x13);break;case _0xc875[38]:docExtract(_0x8472x12,moment()[_0xc875[36]](7,_0xc875[35])[_0xc875[31]](_0xc875[30]),moment()[_0xc875[36]](1,_0xc875[35])[_0xc875[31]](_0xc875[30]),_0x8472x13);break;case _0xc875[39]:docExtract(_0x8472x12,moment()[_0xc875[36]](30,_0xc875[35])[_0xc875[31]](_0xc875[30]),moment()[_0xc875[36]](1,_0xc875[35])[_0xc875[31]](_0xc875[30]),_0x8472x13);break;case _0xc875[44]:docExtract(_0x8472x12,moment()[_0xc875[36]](1,_0xc875[42])[_0xc875[41]](_0xc875[40])[_0xc875[31]](_0xc875[30]),moment()[_0xc875[36]](1,_0xc875[42])[_0xc875[43]](_0xc875[40])[_0xc875[31]](_0xc875[30]),_0x8472x13);break}}function checkValidity(_0x8472x18,_0x8472x19){return moment()[_0xc875[48]](moment(_0x8472x18,_0xc875[47]),moment(_0x8472x19,_0xc875[47]))[_0xc875[46]](moment())}function getReportPath(_0x8472x1b,_0x8472x1c,path){path= _0x8472x1b[_0xc875[49]]+ _0xc875[50]+ path;if(_0x8472x1b[_0xc875[51]]=== _0xc875[52]){return path}else {return getReportPath(_[_0xc875[53]](_0x8472x1c,{id:_0x8472x1b[_0xc875[51]]}),_0x8472x1c,path)}}function docExtract(_0x8472x12,_0x8472x1e,_0x8472x1f,_0x8472x13,_0x8472x20,_0x8472x21){var _0x8472x22=_0x8472x12[_0xc875[54]]=== _0xc875[55]?DefaultReport:CustomReport;var _0x8472x23;_0x8472x22[_0xc875[94]](_0xc875[93])[_0xc875[91]](_0x8472x12[_0xc875[92]])[_0xc875[89]](function(_0x8472x28){if(!_0x8472x28){logger[_0xc875[58]](_0xc875[90]);return};_0x8472x23= _0x8472x28;return ReportTree[_0xc875[91]](_0x8472x12[_0xc875[54]]=== _0xc875[55]?1:2)})[_0xc875[89]](function(_0x8472x1c){_0x8472x1c= JSON[_0xc875[79]](_0x8472x1c[_0xc875[78]]);var _0x8472x1b=_[_0xc875[53]](_0x8472x1c,{id:_0x8472x23[_0xc875[51]]});var path=getReportPath(_0x8472x1b,_0x8472x1c,_0x8472x23[_0xc875[80]]);if(_0x8472x12[_0xc875[25]]=== _0xc875[24]){_0x8472x23[_0xc875[82]][_0xc875[81]]= _0x8472x23[_0xc875[82]][_0xc875[81]][_0xc875[85]](_0xc875[83],_0xc875[84])};return [_0x8472x23,ExtractedReport[_0xc875[88]]({name:_0x8472x23[_0xc875[80]],startDate:_0x8472x1e,endDate:_0x8472x1f,output:_0x8472x12[_0xc875[75]],type:_0x8472x13?_0xc875[86]:_0xc875[87],UserId:_0x8472x13?_0x8472x13[_0xc875[72]]:null})]})[_0xc875[77]](function(_0x8472x23,_0x8472x25){var _0x8472x26=cp[_0xc875[61]](__dirname+ _0xc875[60]);_0x8472x26[_0xc875[63]](_0xc875[67],function(_0x8472x27){logger[_0xc875[66]](_0xc875[68],_0x8472x27);if(_0x8472x12[_0xc875[69]]&& _0x8472x27[_0xc875[70]]=== _0xc875[71]){sendReportByMail(_0x8472x12,_0x8472x25[_0xc875[72]],_0x8472x13,_0x8472x26)}else {_0x8472x26[_0xc875[73]]()}})[_0xc875[63]](_0xc875[64],function(){logger[_0xc875[66]](_0xc875[65])})[_0xc875[63]](_0xc875[58],function(_0x8472x24){logger[_0xc875[58]](_0xc875[62],_0x8472x24)});_0x8472x26[_0xc875[76]]({report:_0x8472x23,query:{startDate:_0x8472x1e,endDate:_0x8472x1f,startTime:_0x8472x20|| null,endTime:_0x8472x21|| null},extractedId:_0x8472x25[_0xc875[72]],user:_0x8472x13?_0x8472x13:{role:_0xc875[74]},type:_0x8472x12[_0xc875[75]]})})[_0xc875[59]](function(_0x8472x24){logger[_0xc875[58]](_0xc875[56],_0x8472x24[_0xc875[57]])})}function sendReportByMail(_0x8472x12,_0x8472x2a,_0x8472x13,_0x8472x26){var _0x8472x2b;return ExtractedReport[_0xc875[91]](_0x8472x2a)[_0xc875[89]](function(extract){if(!extract){throw  new Error(_0xc875[104])};_0x8472x2b= extract;if(_0x8472x12[_0xc875[11]]&& _0x8472x12[_0xc875[11]][_0xc875[72]]){return MailAccount[_0xc875[53]]({attributes:[_0xc875[72],_0xc875[100]],include:[{model:MailServerOut,attributes:[_0xc875[72],_0xc875[105]],where:{id:_0x8472x12[_0xc875[11]][_0xc875[72]]}}]})}else {throw  new Error(_0xc875[106])}})[_0xc875[89]](function(_0x8472x2d){var _0x8472x2e=getAttachment(_0x8472x2b);var _0x8472x2f={subject:_0xc875[99],from:[_0x8472x2d[_0xc875[100]]],to:[_0x8472x12[_0xc875[101]]],cc:[],html:_0xc875[102],text:null,inReplyTo:null,status:_0xc875[103],attachment:true,UserId:_0x8472x13?_0x8472x13[_0xc875[72]]:null,MailAttachments:[_0x8472x2e]};return MailMessage[_0xc875[88]](_0x8472x2f,{include:[{model:MailAttachment}]})})[_0xc875[89]](function(_0x8472x2c){return _0x8472x2b[_0xc875[98]](_0x8472x2c)})[_0xc875[89]](function(){logger[_0xc875[20]](_0xc875[97])})[_0xc875[59]](function(_0x8472x24){logger[_0xc875[58]](_0xc875[96],_0x8472x24[_0xc875[57]])})[_0xc875[95]](function(){_0x8472x26[_0xc875[73]]()})}function getAttachment(extract){var _0x8472x31=path[_0xc875[112]](config[_0xc875[107]],_0xc875[108],_0xc875[109],_0xc875[110],extract[_0xc875[111]]);var _0x8472x32=path[_0xc875[112]](config[_0xc875[107]],_0xc875[108],_0xc875[109],_0xc875[113]);var _0x8472x33=path[_0xc875[117]](extract[_0xc875[111]],_0xc875[114]+ extract[_0xc875[116]][_0xc875[115]]());try{fs[_0xc875[118]](_0x8472x31,path[_0xc875[112]](_0x8472x32,_0x8472x33));logger[_0xc875[66]](_0xc875[119])}catch(err){logger[_0xc875[58]](_0xc875[120]);return null};return {size:Util[_0xc875[121]](_0x8472x31),path:path[_0xc875[112]](_0x8472x32,_0x8472x33),name:extract[_0xc875[80]]+ _0xc875[122]+ moment(extract[_0xc875[124]])[_0xc875[31]](_0xc875[123])+ _0xc875[122]+ moment(extract[_0xc875[125]])[_0xc875[31]](_0xc875[123])+ _0xc875[114]+ extract[_0xc875[116]][_0xc875[115]](),type:_0xc875[126]+ extract[_0xc875[116]][_0xc875[115]](),basename:_0x8472x33}}module[_0xc875[127]]= Reports
\ No newline at end of file