Built motion from commit a5685af.|0.0.128
[motion.git] / server / api / report_fax_session / report_fax_session.controller.js
1 var _0xc133=["\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\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x55\x73\x65\x72","\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\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x74\x69\x6D\x65\x6F\x75\x74","\x6C\x6F\x67","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x75\x73\x65\x72","\x61\x6C\x6C","\x77\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\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","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65"];_0xc133[0];var _=require(_0xc133[1]);var Util=require(_0xc133[2]);var ReportFaxSession=require(_0xc133[4])[_0xc133[3]];var ReportFaxSessionHistory=require(_0xc133[4])[_0xc133[6]][_0xc133[5]];var User=require(_0xc133[4])[_0xc133[7]];function handleError(_0xcd75x7,_0xcd75x8){_0xcd75x8= _0xcd75x8|| 500;return function(_0xcd75x9){_0xcd75x7[_0xc133[9]](_0xcd75x8)[_0xc133[8]](_0xcd75x9)}}function responseWithResult(_0xcd75x7,_0xcd75x8){_0xcd75x8= _0xcd75x8|| 200;return function(_0xcd75xb){if(_0xcd75xb){_0xcd75x7[_0xc133[9]](_0xcd75x8)[_0xc133[10]](_0xcd75xb)}}}function responseWithoutResult(_0xcd75x7,_0xcd75x8){_0xcd75x8= _0xcd75x8|| 204;return function(){_0xcd75x7[_0xc133[11]](_0xcd75x8)}}function handleEntityNotFound(_0xcd75x7){return function(_0xcd75xb){if(!_0xcd75xb){_0xcd75x7[_0xc133[9]](404)[_0xc133[12]]();return null};return _0xcd75xb}}function saveUpdates(_0xcd75xf){return function(_0xcd75xb){return _0xcd75xb[_0xc133[14]](_0xcd75xf)[_0xc133[13]](function(_0xcd75x10){return _0xcd75x10})}}function removeEntity(_0xcd75x7){return function(_0xcd75xb){if(_0xcd75xb){return _0xcd75xb[_0xc133[15]]()[_0xc133[13]](function(){_0xcd75x7[_0xc133[9]](204)[_0xc133[12]]()})}}}exports[_0xc133[16]]= function(_0xcd75x12,_0xcd75x7){return ReportFaxSession[_0xc133[20]](Util[_0xc133[19]](_0xcd75x12[_0xc133[18]]))[_0xc133[13]](responseWithResult(_0xcd75x7))[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[21]]= function(_0xcd75x12,_0xcd75x7){return ReportFaxSession[_0xc133[24]](_0xcd75x12[_0xc133[23]][_0xc133[22]])[_0xc133[13]](handleEntityNotFound(_0xcd75x7))[_0xc133[13]](responseWithResult(_0xcd75x7))[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[25]]= function(_0xcd75x12,_0xcd75x7){return ReportFaxSession[_0xc133[25]](_0xcd75x12[_0xc133[26]])[_0xc133[13]](responseWithResult(_0xcd75x7,201))[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[27]]= function(_0xcd75x12,_0xcd75x7){if(_0xcd75x12[_0xc133[26]][_0xc133[22]]){delete _0xcd75x12[_0xc133[26]][_0xc133[22]]};return ReportFaxSession[_0xc133[24]](_0xcd75x12[_0xc133[23]][_0xc133[22]])[_0xc133[13]](handleEntityNotFound(_0xcd75x7))[_0xc133[13]](saveUpdates(_0xcd75x12[_0xc133[26]]))[_0xc133[13]](responseWithResult(_0xcd75x7))[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[15]]= function(_0xcd75x12,_0xcd75x7){return ReportFaxSession[_0xc133[24]](_0xcd75x12[_0xc133[23]][_0xc133[22]])[_0xc133[13]](handleEntityNotFound(_0xcd75x7))[_0xc133[13]](removeEntity(_0xcd75x7))[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[28]]= function(_0xcd75x12,_0xcd75x7){return ReportFaxSessionHistory[_0xc133[28]]()[_0xc133[13]](function(_0xcd75x13){return _0xcd75x7[_0xc133[9]](200)[_0xc133[8]](_0xcd75x13)})[_0xc133[17]](handleError(_0xcd75x7))};exports[_0xc133[29]]= function(_0xcd75x12,_0xcd75x7){return Promise[_0xc133[34]]([])[_0xc133[13]](getFaxQueues(_0xcd75x12[_0xc133[33]]))[_0xc133[13]](function(_0xcd75x15){return ReportFaxSession[_0xc133[32]](Util[_0xc133[19]](_0xcd75x12[_0xc133[18]],_[_0xc133[31]]({timeout:true},_0xcd75x15)))})[_0xc133[13]](function(_0xcd75x14){return _0xcd75x7[_0xc133[9]](200)[_0xc133[8]]({value:_0xcd75x14})})[_0xc133[17]](function(_0xcd75x9){console[_0xc133[30]](_0xcd75x9);return handleError(_0xcd75x7,_0xcd75x9)})};exports[_0xc133[35]]= function(_0xcd75x12,_0xcd75x7){return Promise[_0xc133[34]]([])[_0xc133[13]](getFaxQueues(_0xcd75x12[_0xc133[33]]))[_0xc133[13]](function(_0xcd75x15){return ReportFaxSession[_0xc133[32]](Util[_0xc133[19]](_0xcd75x12[_0xc133[18]],_[_0xc133[31]]({leaveAt:null},_0xcd75x15)))})[_0xc133[13]](function(_0xcd75x14){return _0xcd75x7[_0xc133[9]](200)[_0xc133[8]]({value:_0xcd75x14})})[_0xc133[17]](function(_0xcd75x9){console[_0xc133[30]](_0xcd75x9);return handleError(_0xcd75x7,_0xcd75x9)})};exports[_0xc133[36]]= function(_0xcd75x12,_0xcd75x7){return Promise[_0xc133[34]]([])[_0xc133[13]](getFaxQueues(_0xcd75x12[_0xc133[33]]))[_0xc133[13]](function(_0xcd75x15){return ReportFaxSession[_0xc133[20]](Util[_0xc133[19]](_0xcd75x12[_0xc133[18]],_[_0xc133[31]]({leaveAt:null},_0xcd75x15)))})[_0xc133[13]](function(_0xcd75x14){return _0xcd75x7[_0xc133[9]](200)[_0xc133[8]]({rows:_0xcd75x14})})[_0xc133[17]](handleError(_0xcd75x7))};function getFaxQueues(_0xcd75x17){return function(){switch(_0xcd75x17[_0xc133[44]]){case _0xc133[33]:return User[_0xc133[24]](_0xcd75x17[_0xc133[22]],{attributes:[_0xc133[22]]})[_0xc133[13]](Util[_0xc133[41]]({},{attributes:[_0xc133[22]],include:[{raw:true,model:User,attributes:[_0xc133[22]]}]}))[_0xc133[13]](function(_0xcd75x18){var _0xcd75x19=[];_0xcd75x18[_0xc133[40]][_0xc133[39]](function(_0xcd75x1a){_0xcd75x19= _[_0xc133[38]](_0xcd75x19,_[_0xc133[37]](_0xcd75x1a.Users,_0xc133[22]))});return {$or:{queue:_[_0xc133[37]](_0xcd75x18[_0xc133[40]],_0xc133[22]),memberid:_0xcd75x19}}});case _0xc133[43]:return User[_0xc133[24]](_0xcd75x17[_0xc133[22]],{attributes:[_0xc133[22]]})[_0xc133[13]](function(_0xcd75x1b){return _0xcd75x1b[_0xc133[42]]({attributes:[_0xc133[22]]})})[_0xc133[13]](function(_0xcd75x18){return {$or:{queue:_[_0xc133[37]](_0xcd75x18,_0xc133[22]),memberid:_0xcd75x17[_0xc133[22]]}}});default:return {}}}}