Built motion from commit e1ea3531f.|1.0.19
[motion.git] / server / config / scheduler / reports.js
index f30fedf..01906ba 100644 (file)
@@ -1 +1 @@
-var _0x6e8d=["\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","\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","\x6C\x6F\x67","\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","\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","\x65\x72\x72\x6F\x72","\x63\x68\x69\x6C\x64\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x63\x68\x69\x6C\x64\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x63\x68\x69\x6C\x64\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\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","\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","\x73\x75\x63\x63\x65\x73\x73\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(_0x6e8d[0]);var moment=require(_0x6e8d[1]);require(_0x6e8d[2]);var Util=require(_0x6e8d[3]);var CustomReport=require(_0x6e8d[5])[_0x6e8d[4]];var DefaultReport=require(_0x6e8d[5])[_0x6e8d[6]];var ExtractedReport=require(_0x6e8d[5])[_0x6e8d[7]];var MailAttachment=require(_0x6e8d[5])[_0x6e8d[8]];var MailServerOut=require(_0x6e8d[5])[_0x6e8d[9]];var MailAccount=require(_0x6e8d[5])[_0x6e8d[10]];var MailMessage=require(_0x6e8d[5])[_0x6e8d[11]];var path=require(_0x6e8d[12]);var config=require(_0x6e8d[13]);var fs=require(_0x6e8d[14]);var _=require(_0x6e8d[15]);var ReportTree=require(_0x6e8d[5])[_0x6e8d[16]];function Reports(){console[_0x6e8d[18]](_0x6e8d[17])}Reports[_0x6e8d[20]][_0x6e8d[19]]= function(_0xf69dx11,_0xf69dx12){console[_0x6e8d[18]](_0x6e8d[21]);extract(_0xf69dx11,_0xf69dx12)};function extract(_0xf69dx11,_0xf69dx12){switch(_0xf69dx11[_0x6e8d[23]]){case _0x6e8d[22]:extractTodayReport(_0xf69dx11,_0xf69dx12);break;default:extractRangeReport(_0xf69dx11,_0xf69dx12);break}}function extractTodayReport(_0xf69dx11,_0xf69dx12){console[_0x6e8d[18]](_0x6e8d[24]);if(_0xf69dx12|| checkValidity(_0xf69dx11[_0x6e8d[25]],_0xf69dx11[_0x6e8d[26]])){console[_0x6e8d[18]](_0x6e8d[27]);docExtract(_0xf69dx11,moment()[_0x6e8d[29]](_0x6e8d[28]),moment()[_0x6e8d[29]](_0x6e8d[28]),_0xf69dx12,_0x6e8d[30],_0x6e8d[31])}else {console[_0x6e8d[18]](_0x6e8d[32])}}function extractRangeReport(_0xf69dx11,_0xf69dx12){switch(_0xf69dx11[_0x6e8d[43]]){case _0x6e8d[35]:docExtract(_0xf69dx11,moment()[_0x6e8d[34]](1,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),moment()[_0x6e8d[34]](1,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),_0xf69dx12);break;case _0x6e8d[36]:docExtract(_0xf69dx11,moment()[_0x6e8d[34]](7,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),moment()[_0x6e8d[34]](1,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),_0xf69dx12);break;case _0x6e8d[37]:docExtract(_0xf69dx11,moment()[_0x6e8d[34]](30,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),moment()[_0x6e8d[34]](1,_0x6e8d[33])[_0x6e8d[29]](_0x6e8d[28]),_0xf69dx12);break;case _0x6e8d[42]:docExtract(_0xf69dx11,moment()[_0x6e8d[34]](1,_0x6e8d[40])[_0x6e8d[39]](_0x6e8d[38])[_0x6e8d[29]](_0x6e8d[28]),moment()[_0x6e8d[34]](1,_0x6e8d[40])[_0x6e8d[41]](_0x6e8d[38])[_0x6e8d[29]](_0x6e8d[28]),_0xf69dx12);break}}function checkValidity(_0xf69dx17,_0xf69dx18){return moment()[_0x6e8d[46]](moment(_0xf69dx17,_0x6e8d[45]),moment(_0xf69dx18,_0x6e8d[45]))[_0x6e8d[44]](moment())}function getReportPath(_0xf69dx1a,_0xf69dx1b,path){path= _0xf69dx1a[_0x6e8d[47]]+ _0x6e8d[48]+ path;if(_0xf69dx1a[_0x6e8d[49]]=== _0x6e8d[50]){return path}else {return getReportPath(_[_0x6e8d[51]](_0xf69dx1b,{id:_0xf69dx1a[_0x6e8d[49]]}),_0xf69dx1b,path)}}function docExtract(_0xf69dx11,_0xf69dx1d,_0xf69dx1e,_0xf69dx12,_0xf69dx1f,_0xf69dx20){var _0xf69dx21=_0xf69dx11[_0x6e8d[52]]=== _0x6e8d[53]?DefaultReport:CustomReport;var _0xf69dx22;_0xf69dx21[_0x6e8d[90]](_0x6e8d[89])[_0x6e8d[87]](_0xf69dx11[_0x6e8d[88]])[_0x6e8d[85]](function(_0xf69dx27){if(!_0xf69dx27){console[_0x6e8d[18]](_0x6e8d[86]);return};_0xf69dx22= _0xf69dx27;return ReportTree[_0x6e8d[87]](_0xf69dx11[_0x6e8d[52]]=== _0x6e8d[53]?1:2)})[_0x6e8d[85]](function(_0xf69dx1b){_0xf69dx1b= JSON[_0x6e8d[75]](_0xf69dx1b[_0x6e8d[74]]);var _0xf69dx1a=_[_0x6e8d[51]](_0xf69dx1b,{id:_0xf69dx22[_0x6e8d[49]]});var path=getReportPath(_0xf69dx1a,_0xf69dx1b,_0xf69dx22[_0x6e8d[76]]);if(_0xf69dx11[_0x6e8d[23]]=== _0x6e8d[22]){_0xf69dx22[_0x6e8d[78]][_0x6e8d[77]]= _0xf69dx22[_0x6e8d[78]][_0x6e8d[77]][_0x6e8d[81]](_0x6e8d[79],_0x6e8d[80])};return [_0xf69dx22,ExtractedReport[_0x6e8d[84]]({name:_0xf69dx22[_0x6e8d[76]],startDate:_0xf69dx1d,endDate:_0xf69dx1e,output:_0xf69dx11[_0x6e8d[71]],type:_0xf69dx12?_0x6e8d[82]:_0x6e8d[83],UserId:_0xf69dx12?_0xf69dx12[_0x6e8d[68]]:null})]})[_0x6e8d[73]](function(_0xf69dx22,_0xf69dx24){var _0xf69dx25=cp[_0x6e8d[57]](__dirname+ _0x6e8d[56]);_0xf69dx25[_0x6e8d[60]](_0x6e8d[63],function(_0xf69dx26){console[_0x6e8d[18]](_0x6e8d[64],_0xf69dx26);if(_0xf69dx11[_0x6e8d[65]]&& _0xf69dx26[_0x6e8d[66]]=== _0x6e8d[67]){sendReportByMail(_0xf69dx11,_0xf69dx24[_0x6e8d[68]],_0xf69dx12,_0xf69dx25)}else {_0xf69dx25[_0x6e8d[69]]()}})[_0x6e8d[60]](_0x6e8d[61],function(){console[_0x6e8d[18]](_0x6e8d[62])})[_0x6e8d[60]](_0x6e8d[58],function(_0xf69dx23){console[_0x6e8d[18]](_0x6e8d[59],_0xf69dx23)});_0xf69dx25[_0x6e8d[72]]({report:_0xf69dx22,query:{startDate:_0xf69dx1d,endDate:_0xf69dx1e,startTime:_0xf69dx1f|| null,endTime:_0xf69dx20|| null},extractedId:_0xf69dx24[_0x6e8d[68]],user:_0xf69dx12?_0xf69dx12:{role:_0x6e8d[70]},type:_0xf69dx11[_0x6e8d[71]]})})[_0x6e8d[55]](function(_0xf69dx23){console[_0x6e8d[18]](_0x6e8d[54],_0xf69dx23)})}function sendReportByMail(_0xf69dx11,_0xf69dx29,_0xf69dx12,_0xf69dx25){var _0xf69dx2a;return ExtractedReport[_0x6e8d[87]](_0xf69dx29)[_0x6e8d[85]](function(extract){if(!extract){throw  new Error(_0x6e8d[100])};_0xf69dx2a= extract;if(_0xf69dx11[_0x6e8d[9]]&& _0xf69dx11[_0x6e8d[9]][_0x6e8d[68]]){return MailAccount[_0x6e8d[51]]({attributes:[_0x6e8d[68],_0x6e8d[96]],include:[{model:MailServerOut,attributes:[_0x6e8d[68],_0x6e8d[101]],where:{id:_0xf69dx11[_0x6e8d[9]][_0x6e8d[68]]}}]})}else {throw  new Error(_0x6e8d[102])}})[_0x6e8d[85]](function(_0xf69dx2c){var _0xf69dx2d=getAttachment(_0xf69dx2a);var _0xf69dx2e={subject:_0x6e8d[95],from:[_0xf69dx2c[_0x6e8d[96]]],to:[_0xf69dx11[_0x6e8d[97]]],cc:[],html:_0x6e8d[98],text:null,inReplyTo:null,status:_0x6e8d[99],attachment:true,UserId:_0xf69dx12?_0xf69dx12[_0x6e8d[68]]:null,MailAttachments:[_0xf69dx2d]};return MailMessage[_0x6e8d[84]](_0xf69dx2e,{include:[{model:MailAttachment}]})})[_0x6e8d[85]](function(_0xf69dx2b){return _0xf69dx2a[_0x6e8d[94]](_0xf69dx2b)})[_0x6e8d[85]](function(){console[_0x6e8d[18]](_0x6e8d[93])})[_0x6e8d[55]](function(_0xf69dx23){console[_0x6e8d[18]](_0x6e8d[92],_0xf69dx23)})[_0x6e8d[91]](function(){_0xf69dx25[_0x6e8d[69]]()})}function getAttachment(extract){var _0xf69dx30=path[_0x6e8d[108]](config[_0x6e8d[103]],_0x6e8d[104],_0x6e8d[105],_0x6e8d[106],extract[_0x6e8d[107]]);var _0xf69dx31=path[_0x6e8d[108]](config[_0x6e8d[103]],_0x6e8d[104],_0x6e8d[105],_0x6e8d[109]);var _0xf69dx32=path[_0x6e8d[113]](extract[_0x6e8d[107]],_0x6e8d[110]+ extract[_0x6e8d[112]][_0x6e8d[111]]());try{fs[_0x6e8d[114]](_0xf69dx30,path[_0x6e8d[108]](_0xf69dx31,_0xf69dx32));console[_0x6e8d[18]](_0x6e8d[115])}catch(err){console[_0x6e8d[58]](_0x6e8d[116]);return null};return {size:Util[_0x6e8d[117]](_0xf69dx30),path:path[_0x6e8d[108]](_0xf69dx31,_0xf69dx32),name:extract[_0x6e8d[76]]+ _0x6e8d[118]+ moment(extract[_0x6e8d[120]])[_0x6e8d[29]](_0x6e8d[119])+ _0x6e8d[118]+ moment(extract[_0x6e8d[121]])[_0x6e8d[29]](_0x6e8d[119])+ _0x6e8d[110]+ extract[_0x6e8d[112]][_0x6e8d[111]](),type:_0x6e8d[122]+ extract[_0x6e8d[112]][_0x6e8d[111]](),basename:_0xf69dx32}}module[_0x6e8d[123]]= Reports
\ No newline at end of file
+var _0x84b4=["\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(_0x84b4[0]);var moment=require(_0x84b4[1]);require(_0x84b4[2]);var Util=require(_0x84b4[3]);var logger=require(_0x84b4[5])(_0x84b4[4]);var CustomReport=require(_0x84b4[7])[_0x84b4[6]];var DefaultReport=require(_0x84b4[7])[_0x84b4[8]];var ExtractedReport=require(_0x84b4[7])[_0x84b4[9]];var MailAttachment=require(_0x84b4[7])[_0x84b4[10]];var MailServerOut=require(_0x84b4[7])[_0x84b4[11]];var MailAccount=require(_0x84b4[7])[_0x84b4[12]];var MailMessage=require(_0x84b4[7])[_0x84b4[13]];var path=require(_0x84b4[14]);var config=require(_0x84b4[15]);var fs=require(_0x84b4[16]);var _=require(_0x84b4[17]);var ReportTree=require(_0x84b4[7])[_0x84b4[18]];function Reports(){logger[_0x84b4[20]](_0x84b4[19])}Reports[_0x84b4[22]][_0x84b4[21]]= function(_0x6a90x12,_0x6a90x13){logger[_0x84b4[20]](_0x84b4[23]);extract(_0x6a90x12,_0x6a90x13)};function extract(_0x6a90x12,_0x6a90x13){switch(_0x6a90x12[_0x84b4[25]]){case _0x84b4[24]:extractTodayReport(_0x6a90x12,_0x6a90x13);break;default:extractRangeReport(_0x6a90x12,_0x6a90x13);break}}function extractTodayReport(_0x6a90x12,_0x6a90x13){logger[_0x84b4[20]](_0x84b4[26]);if(_0x6a90x13|| checkValidity(_0x6a90x12[_0x84b4[27]],_0x6a90x12[_0x84b4[28]])){logger[_0x84b4[20]](_0x84b4[29]);docExtract(_0x6a90x12,moment()[_0x84b4[31]](_0x84b4[30]),moment()[_0x84b4[31]](_0x84b4[30]),_0x6a90x13,_0x84b4[32],_0x84b4[33])}else {logger[_0x84b4[20]](_0x84b4[34])}}function extractRangeReport(_0x6a90x12,_0x6a90x13){switch(_0x6a90x12[_0x84b4[45]]){case _0x84b4[37]:docExtract(_0x6a90x12,moment()[_0x84b4[36]](1,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),moment()[_0x84b4[36]](1,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),_0x6a90x13);break;case _0x84b4[38]:docExtract(_0x6a90x12,moment()[_0x84b4[36]](7,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),moment()[_0x84b4[36]](1,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),_0x6a90x13);break;case _0x84b4[39]:docExtract(_0x6a90x12,moment()[_0x84b4[36]](30,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),moment()[_0x84b4[36]](1,_0x84b4[35])[_0x84b4[31]](_0x84b4[30]),_0x6a90x13);break;case _0x84b4[44]:docExtract(_0x6a90x12,moment()[_0x84b4[36]](1,_0x84b4[42])[_0x84b4[41]](_0x84b4[40])[_0x84b4[31]](_0x84b4[30]),moment()[_0x84b4[36]](1,_0x84b4[42])[_0x84b4[43]](_0x84b4[40])[_0x84b4[31]](_0x84b4[30]),_0x6a90x13);break}}function checkValidity(_0x6a90x18,_0x6a90x19){return moment()[_0x84b4[48]](moment(_0x6a90x18,_0x84b4[47]),moment(_0x6a90x19,_0x84b4[47]))[_0x84b4[46]](moment())}function getReportPath(_0x6a90x1b,_0x6a90x1c,path){path= _0x6a90x1b[_0x84b4[49]]+ _0x84b4[50]+ path;if(_0x6a90x1b[_0x84b4[51]]=== _0x84b4[52]){return path}else {return getReportPath(_[_0x84b4[53]](_0x6a90x1c,{id:_0x6a90x1b[_0x84b4[51]]}),_0x6a90x1c,path)}}function docExtract(_0x6a90x12,_0x6a90x1e,_0x6a90x1f,_0x6a90x13,_0x6a90x20,_0x6a90x21){var _0x6a90x22=_0x6a90x12[_0x84b4[54]]=== _0x84b4[55]?DefaultReport:CustomReport;var _0x6a90x23;_0x6a90x22[_0x84b4[94]](_0x84b4[93])[_0x84b4[91]](_0x6a90x12[_0x84b4[92]])[_0x84b4[89]](function(_0x6a90x28){if(!_0x6a90x28){logger[_0x84b4[58]](_0x84b4[90]);return};_0x6a90x23= _0x6a90x28;return ReportTree[_0x84b4[91]](_0x6a90x12[_0x84b4[54]]=== _0x84b4[55]?1:2)})[_0x84b4[89]](function(_0x6a90x1c){_0x6a90x1c= JSON[_0x84b4[79]](_0x6a90x1c[_0x84b4[78]]);var _0x6a90x1b=_[_0x84b4[53]](_0x6a90x1c,{id:_0x6a90x23[_0x84b4[51]]});var path=getReportPath(_0x6a90x1b,_0x6a90x1c,_0x6a90x23[_0x84b4[80]]);if(_0x6a90x12[_0x84b4[25]]=== _0x84b4[24]){_0x6a90x23[_0x84b4[82]][_0x84b4[81]]= _0x6a90x23[_0x84b4[82]][_0x84b4[81]][_0x84b4[85]](_0x84b4[83],_0x84b4[84])};return [_0x6a90x23,ExtractedReport[_0x84b4[88]]({name:_0x6a90x23[_0x84b4[80]],startDate:_0x6a90x1e,endDate:_0x6a90x1f,output:_0x6a90x12[_0x84b4[75]],type:_0x6a90x13?_0x84b4[86]:_0x84b4[87],UserId:_0x6a90x13?_0x6a90x13[_0x84b4[72]]:null})]})[_0x84b4[77]](function(_0x6a90x23,_0x6a90x25){var _0x6a90x26=cp[_0x84b4[61]](__dirname+ _0x84b4[60]);_0x6a90x26[_0x84b4[63]](_0x84b4[67],function(_0x6a90x27){logger[_0x84b4[66]](_0x84b4[68],_0x6a90x27);if(_0x6a90x12[_0x84b4[69]]&& _0x6a90x27[_0x84b4[70]]=== _0x84b4[71]){sendReportByMail(_0x6a90x12,_0x6a90x25[_0x84b4[72]],_0x6a90x13,_0x6a90x26)}else {_0x6a90x26[_0x84b4[73]]()}})[_0x84b4[63]](_0x84b4[64],function(){logger[_0x84b4[66]](_0x84b4[65])})[_0x84b4[63]](_0x84b4[58],function(_0x6a90x24){logger[_0x84b4[58]](_0x84b4[62],_0x6a90x24)});_0x6a90x26[_0x84b4[76]]({report:_0x6a90x23,query:{startDate:_0x6a90x1e,endDate:_0x6a90x1f,startTime:_0x6a90x20|| null,endTime:_0x6a90x21|| null},extractedId:_0x6a90x25[_0x84b4[72]],user:_0x6a90x13?_0x6a90x13:{role:_0x84b4[74]},type:_0x6a90x12[_0x84b4[75]]})})[_0x84b4[59]](function(_0x6a90x24){logger[_0x84b4[58]](_0x84b4[56],_0x6a90x24[_0x84b4[57]])})}function sendReportByMail(_0x6a90x12,_0x6a90x2a,_0x6a90x13,_0x6a90x26){var _0x6a90x2b;return ExtractedReport[_0x84b4[91]](_0x6a90x2a)[_0x84b4[89]](function(extract){if(!extract){throw  new Error(_0x84b4[104])};_0x6a90x2b= extract;if(_0x6a90x12[_0x84b4[11]]&& _0x6a90x12[_0x84b4[11]][_0x84b4[72]]){return MailAccount[_0x84b4[53]]({attributes:[_0x84b4[72],_0x84b4[100]],include:[{model:MailServerOut,attributes:[_0x84b4[72],_0x84b4[105]],where:{id:_0x6a90x12[_0x84b4[11]][_0x84b4[72]]}}]})}else {throw  new Error(_0x84b4[106])}})[_0x84b4[89]](function(_0x6a90x2d){var _0x6a90x2e=getAttachment(_0x6a90x2b);var _0x6a90x2f={subject:_0x84b4[99],from:[_0x6a90x2d[_0x84b4[100]]],to:[_0x6a90x12[_0x84b4[101]]],cc:[],html:_0x84b4[102],text:null,inReplyTo:null,status:_0x84b4[103],attachment:true,UserId:_0x6a90x13?_0x6a90x13[_0x84b4[72]]:null,MailAttachments:[_0x6a90x2e]};return MailMessage[_0x84b4[88]](_0x6a90x2f,{include:[{model:MailAttachment}]})})[_0x84b4[89]](function(_0x6a90x2c){return _0x6a90x2b[_0x84b4[98]](_0x6a90x2c)})[_0x84b4[89]](function(){logger[_0x84b4[20]](_0x84b4[97])})[_0x84b4[59]](function(_0x6a90x24){logger[_0x84b4[58]](_0x84b4[96],_0x6a90x24[_0x84b4[57]])})[_0x84b4[95]](function(){_0x6a90x26[_0x84b4[73]]()})}function getAttachment(extract){var _0x6a90x31=path[_0x84b4[112]](config[_0x84b4[107]],_0x84b4[108],_0x84b4[109],_0x84b4[110],extract[_0x84b4[111]]);var _0x6a90x32=path[_0x84b4[112]](config[_0x84b4[107]],_0x84b4[108],_0x84b4[109],_0x84b4[113]);var _0x6a90x33=path[_0x84b4[117]](extract[_0x84b4[111]],_0x84b4[114]+ extract[_0x84b4[116]][_0x84b4[115]]());try{fs[_0x84b4[118]](_0x6a90x31,path[_0x84b4[112]](_0x6a90x32,_0x6a90x33));logger[_0x84b4[66]](_0x84b4[119])}catch(err){logger[_0x84b4[58]](_0x84b4[120]);return null};return {size:Util[_0x84b4[121]](_0x6a90x31),path:path[_0x84b4[112]](_0x6a90x32,_0x6a90x33),name:extract[_0x84b4[80]]+ _0x84b4[122]+ moment(extract[_0x84b4[124]])[_0x84b4[31]](_0x84b4[123])+ _0x84b4[122]+ moment(extract[_0x84b4[125]])[_0x84b4[31]](_0x84b4[123])+ _0x84b4[114]+ extract[_0x84b4[116]][_0x84b4[115]](),type:_0x84b4[126]+ extract[_0x84b4[116]][_0x84b4[115]](),basename:_0x6a90x33}}module[_0x84b4[127]]= Reports
\ No newline at end of file