ce93ec49d5f543e5a4d864e979639c9c1b79644e
[motion.git] / server / api / report_fax_session / report_fax_session.controller.js
1 var _0xbbf7=["\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"];_0xbbf7[0];var _=require(_0xbbf7[1]);var Util=require(_0xbbf7[2]);var ReportFaxSession=require(_0xbbf7[4])[_0xbbf7[3]];var ReportFaxSessionHistory=require(_0xbbf7[4])[_0xbbf7[6]][_0xbbf7[5]];var User=require(_0xbbf7[4])[_0xbbf7[7]];function handleError(_0xb77dx7,_0xb77dx8){_0xb77dx8= _0xb77dx8|| 500;return function(_0xb77dx9){_0xb77dx7[_0xbbf7[9]](_0xb77dx8)[_0xbbf7[8]](_0xb77dx9)}}function responseWithResult(_0xb77dx7,_0xb77dx8){_0xb77dx8= _0xb77dx8|| 200;return function(_0xb77dxb){if(_0xb77dxb){_0xb77dx7[_0xbbf7[9]](_0xb77dx8)[_0xbbf7[10]](_0xb77dxb)}}}function responseWithoutResult(_0xb77dx7,_0xb77dx8){_0xb77dx8= _0xb77dx8|| 204;return function(){_0xb77dx7[_0xbbf7[11]](_0xb77dx8)}}function handleEntityNotFound(_0xb77dx7){return function(_0xb77dxb){if(!_0xb77dxb){_0xb77dx7[_0xbbf7[9]](404)[_0xbbf7[12]]();return null};return _0xb77dxb}}function saveUpdates(_0xb77dxf){return function(_0xb77dxb){return _0xb77dxb[_0xbbf7[14]](_0xb77dxf)[_0xbbf7[13]](function(_0xb77dx10){return _0xb77dx10})}}function removeEntity(_0xb77dx7){return function(_0xb77dxb){if(_0xb77dxb){return _0xb77dxb[_0xbbf7[15]]()[_0xbbf7[13]](function(){_0xb77dx7[_0xbbf7[9]](204)[_0xbbf7[12]]()})}}}exports[_0xbbf7[16]]= function(_0xb77dx12,_0xb77dx7){return ReportFaxSession[_0xbbf7[20]](Util[_0xbbf7[19]](_0xb77dx12[_0xbbf7[18]]))[_0xbbf7[13]](responseWithResult(_0xb77dx7))[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[21]]= function(_0xb77dx12,_0xb77dx7){return ReportFaxSession[_0xbbf7[24]](_0xb77dx12[_0xbbf7[23]][_0xbbf7[22]])[_0xbbf7[13]](handleEntityNotFound(_0xb77dx7))[_0xbbf7[13]](responseWithResult(_0xb77dx7))[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[25]]= function(_0xb77dx12,_0xb77dx7){return ReportFaxSession[_0xbbf7[25]](_0xb77dx12[_0xbbf7[26]])[_0xbbf7[13]](responseWithResult(_0xb77dx7,201))[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[27]]= function(_0xb77dx12,_0xb77dx7){if(_0xb77dx12[_0xbbf7[26]][_0xbbf7[22]]){delete _0xb77dx12[_0xbbf7[26]][_0xbbf7[22]]};return ReportFaxSession[_0xbbf7[24]](_0xb77dx12[_0xbbf7[23]][_0xbbf7[22]])[_0xbbf7[13]](handleEntityNotFound(_0xb77dx7))[_0xbbf7[13]](saveUpdates(_0xb77dx12[_0xbbf7[26]]))[_0xbbf7[13]](responseWithResult(_0xb77dx7))[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[15]]= function(_0xb77dx12,_0xb77dx7){return ReportFaxSession[_0xbbf7[24]](_0xb77dx12[_0xbbf7[23]][_0xbbf7[22]])[_0xbbf7[13]](handleEntityNotFound(_0xb77dx7))[_0xbbf7[13]](removeEntity(_0xb77dx7))[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[28]]= function(_0xb77dx12,_0xb77dx7){return ReportFaxSessionHistory[_0xbbf7[28]]()[_0xbbf7[13]](function(_0xb77dx13){return _0xb77dx7[_0xbbf7[9]](200)[_0xbbf7[8]](_0xb77dx13)})[_0xbbf7[17]](handleError(_0xb77dx7))};exports[_0xbbf7[29]]= function(_0xb77dx12,_0xb77dx7){return Promise[_0xbbf7[34]]([])[_0xbbf7[13]](getFaxQueues(_0xb77dx12[_0xbbf7[33]]))[_0xbbf7[13]](function(_0xb77dx15){return ReportFaxSession[_0xbbf7[32]](Util[_0xbbf7[19]](_0xb77dx12[_0xbbf7[18]],_[_0xbbf7[31]]({timeout:true},_0xb77dx15)))})[_0xbbf7[13]](function(_0xb77dx14){return _0xb77dx7[_0xbbf7[9]](200)[_0xbbf7[8]]({value:_0xb77dx14})})[_0xbbf7[17]](function(_0xb77dx9){console[_0xbbf7[30]](_0xb77dx9);return handleError(_0xb77dx7,_0xb77dx9)})};exports[_0xbbf7[35]]= function(_0xb77dx12,_0xb77dx7){return Promise[_0xbbf7[34]]([])[_0xbbf7[13]](getFaxQueues(_0xb77dx12[_0xbbf7[33]]))[_0xbbf7[13]](function(_0xb77dx15){return ReportFaxSession[_0xbbf7[32]](Util[_0xbbf7[19]](_0xb77dx12[_0xbbf7[18]],_[_0xbbf7[31]]({leaveAt:null},_0xb77dx15)))})[_0xbbf7[13]](function(_0xb77dx14){return _0xb77dx7[_0xbbf7[9]](200)[_0xbbf7[8]]({value:_0xb77dx14})})[_0xbbf7[17]](function(_0xb77dx9){console[_0xbbf7[30]](_0xb77dx9);return handleError(_0xb77dx7,_0xb77dx9)})};exports[_0xbbf7[36]]= function(_0xb77dx12,_0xb77dx7){return Promise[_0xbbf7[34]]([])[_0xbbf7[13]](getFaxQueues(_0xb77dx12[_0xbbf7[33]]))[_0xbbf7[13]](function(_0xb77dx15){return ReportFaxSession[_0xbbf7[20]](Util[_0xbbf7[19]](_0xb77dx12[_0xbbf7[18]],_[_0xbbf7[31]]({leaveAt:null},_0xb77dx15)))})[_0xbbf7[13]](function(_0xb77dx14){return _0xb77dx7[_0xbbf7[9]](200)[_0xbbf7[8]]({rows:_0xb77dx14})})[_0xbbf7[17]](handleError(_0xb77dx7))};function getFaxQueues(_0xb77dx17){return function(){switch(_0xb77dx17[_0xbbf7[44]]){case _0xbbf7[33]:return User[_0xbbf7[24]](_0xb77dx17[_0xbbf7[22]],{attributes:[_0xbbf7[22]]})[_0xbbf7[13]](Util[_0xbbf7[41]]({},{attributes:[_0xbbf7[22]],include:[{raw:true,model:User,attributes:[_0xbbf7[22]]}]}))[_0xbbf7[13]](function(_0xb77dx18){var _0xb77dx19=[];_0xb77dx18[_0xbbf7[40]][_0xbbf7[39]](function(_0xb77dx1a){_0xb77dx19= _[_0xbbf7[38]](_0xb77dx19,_[_0xbbf7[37]](_0xb77dx1a.Users,_0xbbf7[22]))});return {$or:{queue:_[_0xbbf7[37]](_0xb77dx18[_0xbbf7[40]],_0xbbf7[22]),memberid:_0xb77dx19}}});case _0xbbf7[43]:return User[_0xbbf7[24]](_0xb77dx17[_0xbbf7[22]],{attributes:[_0xbbf7[22]]})[_0xbbf7[13]](function(_0xb77dx1b){return _0xb77dx1b[_0xbbf7[42]]({attributes:[_0xbbf7[22]]})})[_0xbbf7[13]](function(_0xb77dx18){return {$or:{queue:_[_0xbbf7[37]](_0xb77dx18,_0xbbf7[22]),memberid:_0xb77dx17[_0xbbf7[22]]}}});default:return {}}}}