aa8dab8083608d8647e78c70412a86cd2650f50e
[motion.git] / server / api / report_fax_room / report_fax_room.controller.js
1 var _0x3eaf=["\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\x46\x61\x78\x52\x6F\x6F\x6D","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x46\x61\x78\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x55\x73\x65\x72","\x46\x61\x78\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\x46\x61\x78\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"];_0x3eaf[0];var _=require(_0x3eaf[1]);var Util=require(_0x3eaf[2]);var ReportFaxRoom=require(_0x3eaf[4])[_0x3eaf[3]];var FaxRoom=require(_0x3eaf[4])[_0x3eaf[5]];var ReportFaxRoomHistory=require(_0x3eaf[4])[_0x3eaf[7]][_0x3eaf[6]];var User=require(_0x3eaf[4])[_0x3eaf[8]];var FaxQueue=require(_0x3eaf[4])[_0x3eaf[9]];function handleError(_0x3440x9,_0x3440xa){_0x3440xa=_0x3440xa||500;return function(_0x3440xb){_0x3440x9[_0x3eaf[11]](_0x3440xa)[_0x3eaf[10]](_0x3440xb)}}function responseWithResult(_0x3440x9,_0x3440xa){_0x3440xa=_0x3440xa||200;return function(_0x3440xd){if(_0x3440xd){_0x3440x9[_0x3eaf[11]](_0x3440xa)[_0x3eaf[12]](_0x3440xd)}}}function responseWithoutResult(_0x3440x9,_0x3440xa){_0x3440xa=_0x3440xa||204;return function(){_0x3440x9[_0x3eaf[13]](_0x3440xa)}}function handleEntityNotFound(_0x3440x9){return function(_0x3440xd){if(!_0x3440xd){_0x3440x9[_0x3eaf[11]](404)[_0x3eaf[14]]();return null};return _0x3440xd}}function saveUpdates(_0x3440x11){return function(_0x3440xd){return _0x3440xd[_0x3eaf[16]](_0x3440x11)[_0x3eaf[15]](function(_0x3440x12){return _0x3440x12})}}function removeEntity(_0x3440x9){return function(_0x3440xd){if(_0x3440xd){return _0x3440xd[_0x3eaf[17]]()[_0x3eaf[15]](function(){_0x3440x9[_0x3eaf[11]](204)[_0x3eaf[14]]()})}}}function getFaxQueues(_0x3440x15){return function(){switch(_0x3440x15[_0x3eaf[26]]){case _0x3eaf[25]:return User[_0x3eaf[24]](_0x3440x15[_0x3eaf[18]],{attributes:[_0x3eaf[18]]})[_0x3eaf[15]](Util[_0x3eaf[23]]({},{attributes:[_0x3eaf[18]],include:[{raw:true,model:User,attributes:[_0x3eaf[18]]}]}))[_0x3eaf[15]](function(_0x3440x16){var _0x3440x17=[];_0x3440x16[_0x3eaf[22]][_0x3eaf[21]](function(_0x3440x18){_0x3440x17=_[_0x3eaf[20]](_0x3440x17,_[_0x3eaf[19]](_0x3440x18.Users,_0x3eaf[18]))});return {where:{$or:{queue:_[_0x3eaf[19]](_0x3440x16[_0x3eaf[22]],_0x3eaf[18]),memberid:_0x3440x17}}}});default:return {}}}}exports[_0x3eaf[27]]=function(_0x3440x19,_0x3440x9){return Promise[_0x3eaf[32]]([])[_0x3eaf[15]](getFaxQueues(_0x3440x19[_0x3eaf[25]]))[_0x3eaf[15]](function(_0x3440x1b){return FaxRoom[_0x3eaf[31]](_[_0x3eaf[30]]({where:{status:_0x3eaf[29]}},_0x3440x1b))})[_0x3eaf[15]](function(_0x3440x1a){return _0x3440x9[_0x3eaf[11]](200)[_0x3eaf[10]]({value:_0x3440x1a})})[_0x3eaf[28]](handleError(_0x3440x9))};exports[_0x3eaf[33]]=function(_0x3440x19,_0x3440x9){return Promise[_0x3eaf[32]]([])[_0x3eaf[15]](getFaxQueues(_0x3440x19[_0x3eaf[25]]))[_0x3eaf[15]](function(_0x3440x1b){return FaxRoom[_0x3eaf[31]](_[_0x3eaf[30]]({where:{status:_0x3eaf[34]}},_0x3440x1b))})[_0x3eaf[15]](function(_0x3440x1a){return _0x3440x9[_0x3eaf[11]](200)[_0x3eaf[10]]({value:_0x3440x1a})})[_0x3eaf[28]](handleError(_0x3440x9))};exports[_0x3eaf[35]]=function(_0x3440x19,_0x3440x9){return Promise[_0x3eaf[32]]([])[_0x3eaf[15]](getFaxQueues(_0x3440x19[_0x3eaf[25]]))[_0x3eaf[15]](function(_0x3440x1b){return FaxRoom[_0x3eaf[31]](_[_0x3eaf[30]]({where:{status:_0x3eaf[36]}},_0x3440x1b))})[_0x3eaf[15]](function(_0x3440x1a){return _0x3440x9[_0x3eaf[11]](200)[_0x3eaf[10]]({value:_0x3440x1a})})[_0x3eaf[28]](handleError(_0x3440x9))};exports[_0x3eaf[37]]=function(_0x3440x19,_0x3440x9){return Promise[_0x3eaf[32]]([])[_0x3eaf[15]](getFaxQueues(_0x3440x19[_0x3eaf[25]]))[_0x3eaf[15]](function(_0x3440x1b){return FaxRoom[_0x3eaf[31]](_[_0x3eaf[30]]({where:{status:_0x3eaf[38]}},_0x3440x1b))})[_0x3eaf[15]](function(_0x3440x1a){return _0x3440x9[_0x3eaf[11]](200)[_0x3eaf[10]]({value:_0x3440x1a})})[_0x3eaf[28]](handleError(_0x3440x9))};exports[_0x3eaf[39]]=function(_0x3440x19,_0x3440x9,_0x3440x1c){return ReportFaxRoom[_0x3eaf[42]](Util[_0x3eaf[41]](_0x3440x19[_0x3eaf[40]]))[_0x3eaf[15]](function(_0x3440x1d){return _0x3440x9[_0x3eaf[11]](200)[_0x3eaf[10]](_0x3440x1d)})[_0x3eaf[28]](handleError(_0x3440x9))};exports[_0x3eaf[43]]=function(_0x3440x19,_0x3440x9){return ReportFaxRoomHistory[_0x3eaf[43]]()[_0x3eaf[15]](responseWithResult(_0x3440x9))[_0x3eaf[28]](handleError(_0x3440x9))}