3c5e4bd02c944cf2bfc48ba8d4a64b97dd54926b
[motion.git] / server / api / report_mail_room / report_mail_room.controller.js
1 var _0x59af=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x55\x73\x65\x72","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x6F\x70\x65\x6E","\x63\x61\x74\x63\x68","\x4F\x50\x45\x4E","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x6E\x65\x77","\x4E\x45\x57","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x69\x6E\x64\x65\x78","\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"];_0x59af[0];var _=require(_0x59af[1]);var Util=require(_0x59af[2]);var ReportMailRoom=require(_0x59af[4])[_0x59af[3]];var MailRoom=require(_0x59af[4])[_0x59af[5]];var ReportMailRoomHistory=require(_0x59af[4])[_0x59af[7]][_0x59af[6]];var User=require(_0x59af[4])[_0x59af[8]];var MailQueue=require(_0x59af[4])[_0x59af[9]];function handleError(_0xf809x9,_0xf809xa){_0xf809xa=_0xf809xa||500;return function(_0xf809xb){_0xf809x9[_0x59af[11]](_0xf809xa)[_0x59af[10]](_0xf809xb)}}function responseWithResult(_0xf809x9,_0xf809xa){_0xf809xa=_0xf809xa||200;return function(_0xf809xd){if(_0xf809xd){_0xf809x9[_0x59af[11]](_0xf809xa)[_0x59af[12]](_0xf809xd)}}}function responseWithoutResult(_0xf809x9,_0xf809xa){_0xf809xa=_0xf809xa||204;return function(){_0xf809x9[_0x59af[13]](_0xf809xa)}}function handleEntityNotFound(_0xf809x9){return function(_0xf809xd){if(!_0xf809xd){_0xf809x9[_0x59af[11]](404)[_0x59af[14]]();return null};return _0xf809xd}}function saveUpdates(_0xf809x11){return function(_0xf809xd){return _0xf809xd[_0x59af[16]](_0xf809x11)[_0x59af[15]](function(_0xf809x12){return _0xf809x12})}}function removeEntity(_0xf809x9){return function(_0xf809xd){if(_0xf809xd){return _0xf809xd[_0x59af[17]]()[_0x59af[15]](function(){_0xf809x9[_0x59af[11]](204)[_0x59af[14]]()})}}}function getMailQueues(_0xf809x15){return function(){switch(_0xf809x15[_0x59af[26]]){case _0x59af[25]:return User[_0x59af[24]](_0xf809x15[_0x59af[18]],{attributes:[_0x59af[18]]})[_0x59af[15]](Util[_0x59af[23]]({},{attributes:[_0x59af[18]],include:[{raw:true,model:User,attributes:[_0x59af[18]]}]}))[_0x59af[15]](function(_0xf809x16){var _0xf809x17=[];_0xf809x16[_0x59af[22]][_0x59af[21]](function(_0xf809x18){_0xf809x17=_[_0x59af[20]](_0xf809x17,_[_0x59af[19]](_0xf809x18.Users,_0x59af[18]))});return {where:{$or:{queue:_[_0x59af[19]](_0xf809x16[_0x59af[22]],_0x59af[18]),memberid:_0xf809x17}}}});default:return {}}}}exports[_0x59af[27]]=function(_0xf809x19,_0xf809x9){return Promise[_0x59af[32]]([])[_0x59af[15]](getMailQueues(_0xf809x19[_0x59af[25]]))[_0x59af[15]](function(_0xf809x1b){return MailRoom[_0x59af[31]](_[_0x59af[30]]({where:{status:_0x59af[29]}},_0xf809x1b))})[_0x59af[15]](function(_0xf809x1a){return _0xf809x9[_0x59af[11]](200)[_0x59af[10]]({value:_0xf809x1a})})[_0x59af[28]](handleError(_0xf809x9))};exports[_0x59af[33]]=function(_0xf809x19,_0xf809x9){return Promise[_0x59af[32]]([])[_0x59af[15]](getMailQueues(_0xf809x19[_0x59af[25]]))[_0x59af[15]](function(_0xf809x1b){return MailRoom[_0x59af[31]](_[_0x59af[30]]({where:{status:_0x59af[34]}},_0xf809x1b))})[_0x59af[15]](function(_0xf809x1a){return _0xf809x9[_0x59af[11]](200)[_0x59af[10]]({value:_0xf809x1a})})[_0x59af[28]](handleError(_0xf809x9))};exports[_0x59af[35]]=function(_0xf809x19,_0xf809x9){return Promise[_0x59af[32]]([])[_0x59af[15]](getMailQueues(_0xf809x19[_0x59af[25]]))[_0x59af[15]](function(_0xf809x1b){return MailRoom[_0x59af[31]](_[_0x59af[30]]({where:{status:_0x59af[36]}},_0xf809x1b))})[_0x59af[15]](function(_0xf809x1a){return _0xf809x9[_0x59af[11]](200)[_0x59af[10]]({value:_0xf809x1a})})[_0x59af[28]](handleError(_0xf809x9))};exports[_0x59af[37]]=function(_0xf809x19,_0xf809x9){return Promise[_0x59af[32]]([])[_0x59af[15]](getMailQueues(_0xf809x19[_0x59af[25]]))[_0x59af[15]](function(_0xf809x1b){return MailRoom[_0x59af[31]](_[_0x59af[30]]({where:{status:_0x59af[38]}},_0xf809x1b))})[_0x59af[15]](function(_0xf809x1a){return _0xf809x9[_0x59af[11]](200)[_0x59af[10]]({value:_0xf809x1a})})[_0x59af[28]](handleError(_0xf809x9))};exports[_0x59af[39]]=function(_0xf809x19,_0xf809x9,_0xf809x1c){return ReportMailRoom[_0x59af[42]](Util[_0x59af[41]](_0xf809x19[_0x59af[40]]))[_0x59af[15]](function(_0xf809x1d){return _0xf809x9[_0x59af[11]](200)[_0x59af[10]](_0xf809x1d)})[_0x59af[28]](handleError(_0xf809x9))};exports[_0x59af[43]]=function(_0xf809x19,_0xf809x9){return ReportMailRoomHistory[_0x59af[43]]()[_0x59af[15]](responseWithResult(_0xf809x9))[_0x59af[28]](handleError(_0xf809x9))}