Built motion from commit 0ad9c269e.|1.0.31
[motion.git] / server / api / report_fax_session / report_fax_session.controller.js
index ce93ec4..b0db3c0 100644 (file)
@@ -1 +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 {}}}}
\ No newline at end of file
+var _0xef20=["\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","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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\x74\x61\x63\x6B","\x65\x72\x72\x6F\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","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\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","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\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"];_0xef20[0];var _=require(_0xef20[1]);var Util=require(_0xef20[2]);var moment=require(_0xef20[3]);var logger=require(_0xef20[5])(_0xef20[4]);var ReportFaxSession=require(_0xef20[7])[_0xef20[6]];var ReportFaxSessionHistory=require(_0xef20[7])[_0xef20[9]][_0xef20[8]];var User=require(_0xef20[7])[_0xef20[10]];function handleError(_0x73ccx9,_0x73ccxa){_0x73ccxa= _0x73ccxa|| 500;return function(_0x73ccxb){logger[_0xef20[12]](_0x73ccxb[_0xef20[11]]);_0x73ccx9[_0xef20[14]](_0x73ccxa)[_0xef20[13]](_0x73ccxb)}}function responseWithResult(_0x73ccx9,_0x73ccxa){_0x73ccxa= _0x73ccxa|| 200;return function(_0x73ccxd){if(_0x73ccxd){_0x73ccx9[_0xef20[14]](_0x73ccxa)[_0xef20[15]](_0x73ccxd)}}}function responseWithoutResult(_0x73ccx9,_0x73ccxa){_0x73ccxa= _0x73ccxa|| 204;return function(){_0x73ccx9[_0xef20[16]](_0x73ccxa)}}function handleEntityNotFound(_0x73ccx9){return function(_0x73ccxd){if(!_0x73ccxd){_0x73ccx9[_0xef20[14]](404)[_0xef20[17]]();return null};return _0x73ccxd}}function saveUpdates(_0x73ccx11){return function(_0x73ccxd){return _0x73ccxd[_0xef20[19]](_0x73ccx11)[_0xef20[18]](function(_0x73ccx12){return _0x73ccx12})}}function removeEntity(_0x73ccx9){return function(_0x73ccxd){if(_0x73ccxd){return _0x73ccxd[_0xef20[20]]()[_0xef20[18]](function(){_0x73ccx9[_0xef20[14]](204)[_0xef20[17]]()})}}}exports[_0xef20[21]]= function(_0x73ccx14,_0x73ccx9){return ReportFaxSession[_0xef20[25]](Util[_0xef20[24]](_0x73ccx14[_0xef20[23]]))[_0xef20[18]](responseWithResult(_0x73ccx9))[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[26]]= function(_0x73ccx14,_0x73ccx9){return ReportFaxSession[_0xef20[29]](_0x73ccx14[_0xef20[28]][_0xef20[27]])[_0xef20[18]](handleEntityNotFound(_0x73ccx9))[_0xef20[18]](responseWithResult(_0x73ccx9))[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[30]]= function(_0x73ccx14,_0x73ccx9){return ReportFaxSession[_0xef20[30]](_0x73ccx14[_0xef20[31]])[_0xef20[18]](responseWithResult(_0x73ccx9,201))[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[32]]= function(_0x73ccx14,_0x73ccx9){if(_0x73ccx14[_0xef20[31]][_0xef20[27]]){delete _0x73ccx14[_0xef20[31]][_0xef20[27]]};return ReportFaxSession[_0xef20[29]](_0x73ccx14[_0xef20[28]][_0xef20[27]])[_0xef20[18]](handleEntityNotFound(_0x73ccx9))[_0xef20[18]](saveUpdates(_0x73ccx14[_0xef20[31]]))[_0xef20[18]](responseWithResult(_0x73ccx9))[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[20]]= function(_0x73ccx14,_0x73ccx9){return ReportFaxSession[_0xef20[29]](_0x73ccx14[_0xef20[28]][_0xef20[27]])[_0xef20[18]](handleEntityNotFound(_0x73ccx9))[_0xef20[18]](removeEntity(_0x73ccx9))[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[33]]= function(_0x73ccx14,_0x73ccx9){return ReportFaxSessionHistory[_0xef20[33]]()[_0xef20[18]](function(_0x73ccx15){return _0x73ccx9[_0xef20[14]](200)[_0xef20[13]](_0x73ccx15)})[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[34]]= function(_0x73ccx14,_0x73ccx9){return Promise[_0xef20[40]]([])[_0xef20[18]](getFaxQueues(_0x73ccx14[_0xef20[39]]))[_0xef20[18]](function(_0x73ccx17){return ReportFaxSession[_0xef20[38]](Util[_0xef20[24]](_0x73ccx14[_0xef20[23]],_[_0xef20[37]]({timeout:true,createdAt:{$gte:moment()[_0xef20[36]](_0xef20[35])}},_0x73ccx17)))})[_0xef20[18]](function(_0x73ccx16){return _0x73ccx9[_0xef20[14]](200)[_0xef20[13]]({value:_0x73ccx16})})[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[41]]= function(_0x73ccx14,_0x73ccx9){return Promise[_0xef20[40]]([])[_0xef20[18]](getFaxQueues(_0x73ccx14[_0xef20[39]]))[_0xef20[18]](function(_0x73ccx17){return ReportFaxSession[_0xef20[38]](Util[_0xef20[24]](_0x73ccx14[_0xef20[23]],_[_0xef20[37]]({leaveAt:null,createdAt:{$gte:moment()[_0xef20[36]](_0xef20[35])}},_0x73ccx17)))})[_0xef20[18]](function(_0x73ccx16){return _0x73ccx9[_0xef20[14]](200)[_0xef20[13]]({value:_0x73ccx16})})[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[42]]= function(_0x73ccx14,_0x73ccx9){return Promise[_0xef20[40]]([])[_0xef20[18]](getFaxQueues(_0x73ccx14[_0xef20[39]]))[_0xef20[18]](function(_0x73ccx17){return ReportFaxSession[_0xef20[25]](Util[_0xef20[24]](_0x73ccx14[_0xef20[23]],_[_0xef20[37]]({leaveAt:null},_0x73ccx17)))})[_0xef20[18]](function(_0x73ccx16){return _0x73ccx9[_0xef20[14]](200)[_0xef20[13]]({rows:_0x73ccx16})})[_0xef20[22]](handleError(_0x73ccx9))};exports[_0xef20[43]]= function(_0x73ccx14,_0x73ccx9){var _0x73ccx18={waiting:0,timeout:0};return ReportFaxSession[_0xef20[38]]({where:{leaveAt:null,createdAt:{$gte:moment()[_0xef20[36]](_0xef20[35])}}})[_0xef20[18]](function(_0x73ccx19){if(_0x73ccx19){_0x73ccx18[_0xef20[41]]= _0x73ccx19};return ReportFaxSession[_0xef20[38]]({where:{timeout:true,createdAt:{$gte:moment()[_0xef20[36]](_0xef20[35])}}})})[_0xef20[18]](function(_0x73ccx19){if(_0x73ccx19){_0x73ccx18[_0xef20[34]]= _0x73ccx19};return _0x73ccx9[_0xef20[14]](200)[_0xef20[13]](_0x73ccx18)})[_0xef20[22]](handleError(_0x73ccx9))};function getFaxQueues(_0x73ccx1b){return function(){switch(_0x73ccx1b[_0xef20[51]]){case _0xef20[39]:return User[_0xef20[29]](_0x73ccx1b[_0xef20[27]],{attributes:[_0xef20[27]]})[_0xef20[18]](Util[_0xef20[48]]({},{attributes:[_0xef20[27]],include:[{raw:true,model:User,attributes:[_0xef20[27]]}]}))[_0xef20[18]](function(_0x73ccx1c){var _0x73ccx1d=[];_0x73ccx1c[_0xef20[47]][_0xef20[46]](function(_0x73ccx1e){_0x73ccx1d= _[_0xef20[45]](_0x73ccx1d,_[_0xef20[44]](_0x73ccx1e.Users,_0xef20[27]))});return {$or:{queue:_[_0xef20[44]](_0x73ccx1c[_0xef20[47]],_0xef20[27]),memberid:_0x73ccx1d}}});case _0xef20[50]:return User[_0xef20[29]](_0x73ccx1b[_0xef20[27]],{attributes:[_0xef20[27]]})[_0xef20[18]](function(_0x73ccx1f){return _0x73ccx1f[_0xef20[49]]({attributes:[_0xef20[27]]})})[_0xef20[18]](function(_0x73ccx1c){return {$or:{queue:_[_0xef20[44]](_0x73ccx1c,_0xef20[27]),memberid:_0x73ccx1b[_0xef20[27]]}}});default:return {}}}}
\ No newline at end of file