Built motion from commit 444aa05.|0.0.86
[motion.git] / server / api / report_queue / report_queue.controller.js
1 var _0x1d5c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x64\x65\x73\x63\x72\x69\x62\x65","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6F\x75\x6E\x74","\x77\x61\x69\x74\x69\x6E\x67\x43\x61\x6C\x6C\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x77\x61\x69\x74\x69\x6E\x67\x4C\x69\x73\x74","\x6C\x65\x6E\x67\x74\x68","\x72\x6F\x6C\x65","\x75\x73\x65\x72","\x6E\x61\x6D\x65","\x6D\x61\x70","\x73\x63\x6F\x70\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x63\x74\x69\x76\x65","\x61\x6E\x73\x77\x65\x72\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x76\x67\x61\x6E\x73\x77\x65\x72\x74\x69\x6D\x65","\x76\x61\x6C\x75\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x76\x67\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31","\x61\x6E\x73\x77\x65\x72\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65","\x61\x62\x61\x6E\x64\x6F\x6E\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65","\x74\x6F\x74\x61\x6C\x6F\x66\x66\x65\x72\x65\x64","\x53\x45\x4C\x45\x43\x54\x20\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73"];_0x1d5c[0];var _=require(_0x1d5c[1]);var sequelize=require(_0x1d5c[3])[_0x1d5c[2]];var Agent=require(_0x1d5c[3])[_0x1d5c[4]];var ReportQueue=require(_0x1d5c[3])[_0x1d5c[5]];var ReportQueueHistory=require(_0x1d5c[3])[_0x1d5c[7]][_0x1d5c[6]];var Util=require(_0x1d5c[8]);exports[_0x1d5c[9]]=function(_0x2ff6x7,_0x2ff6x8,_0x2ff6x9){return ReportQueue[_0x1d5c[16]](Util[_0x1d5c[15]](_0x2ff6x7[_0x1d5c[14]]))[_0x1d5c[13]](function(_0x2ff6xb){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]](_0x2ff6xb)})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[17]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueueHistory[_0x1d5c[17]]()[_0x1d5c[13]](function(_0x2ff6xc){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]](_0x2ff6xc)})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[18]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[19]]({where:{queuecallerleaveAt:null}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[20]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[21]]({where:{queuecallerleaveAt:null}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({rows:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[22]]=function(_0x2ff6x7,_0x2ff6x8){return Agent[_0x1d5c[31]](_0x2ff6x7[_0x1d5c[25]][_0x1d5c[30]])[_0x1d5c[13]](function(_0x2ff6x10){return _0x2ff6x10[_0x1d5c[29]]({attributes:[_0x1d5c[26]]})})[_0x1d5c[13]](function(_0x2ff6xf){return ReportQueue[_0x1d5c[28]](_0x1d5c[18],{method:[_0x2ff6x7[_0x1d5c[25]][_0x1d5c[24]],_[_0x1d5c[27]](_0x2ff6xf,_0x1d5c[26])]})[_0x1d5c[21]]()})[_0x1d5c[13]](function(_0x2ff6xe){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({count:_0x2ff6xe[_0x1d5c[23]],rows:_0x2ff6xe})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[32]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[19]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null}}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[33]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[19]]({where:{queuecallercomplete:true}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[34]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[19]]({where:{queuecallerabandon:true}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[35]]=function(_0x2ff6x7,_0x2ff6x8){return sequelize[_0x1d5c[14]](_0x1d5c[37],{type:sequelize[_0x1d5c[39]][_0x1d5c[38]]})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd[0][_0x1d5c[36]]})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[40]]=function(_0x2ff6x7,_0x2ff6x8){return sequelize[_0x1d5c[14]](_0x1d5c[41],{type:sequelize[_0x1d5c[39]][_0x1d5c[38]]})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd[0][_0x1d5c[36]]})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[42]]=function(_0x2ff6x7,_0x2ff6x8){return sequelize[_0x1d5c[14]](_0x1d5c[43],{type:sequelize[_0x1d5c[39]][_0x1d5c[38]]})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd[0][_0x1d5c[36]]})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[44]]=function(_0x2ff6x7,_0x2ff6x8){return sequelize[_0x1d5c[14]](_0x1d5c[45],{type:sequelize[_0x1d5c[39]][_0x1d5c[38]]})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd[0][_0x1d5c[36]]})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[46]]=function(_0x2ff6x7,_0x2ff6x8){return sequelize[_0x1d5c[14]](_0x1d5c[47],{type:sequelize[_0x1d5c[39]][_0x1d5c[38]]})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd[0][_0x1d5c[36]]})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[48]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[19]]({where:{queuecallerexit:true}})[_0x1d5c[13]](function(_0x2ff6xd){return _0x2ff6x8[_0x1d5c[12]](200)[_0x1d5c[11]]({value:_0x2ff6xd})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};exports[_0x1d5c[49]]=function(_0x2ff6x7,_0x2ff6x8){return ReportQueue[_0x1d5c[21]]({where:{queue:_0x2ff6x7[_0x1d5c[52]][_0x1d5c[51]]}})[_0x1d5c[13]](function(_0x2ff6x11){if(!_0x2ff6x11){return _0x2ff6x8[_0x1d5c[50]](404)};return _0x2ff6x8[_0x1d5c[11]]({count:_0x2ff6x11[_0x1d5c[23]],rows:_0x2ff6x11})})[_0x1d5c[10]](function(_0x2ff6xa){return handleError(_0x2ff6x8,_0x2ff6xa)})};function handleError(_0x2ff6x8,_0x2ff6xa){return _0x2ff6x8[_0x1d5c[12]](500)[_0x1d5c[11]](_0x2ff6xa)}