Built motion from commit 62eaa14.|1.0.10
[motion.git] / server / api / report_fax_session / report_fax_session.controller.js
index d328258..9a66f61 100644 (file)
@@ -1 +1 @@
-var _0x32f3=["\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","\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","\x77\x61\x69\x74\x69\x6E\x67\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6D\x65\x72\x67\x65","\x75\x73\x65\x72","\x61\x6C\x6C","\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"];_0x32f3[0];var _=require(_0x32f3[1]);var Util=require(_0x32f3[2]);var ReportFaxSession=require(_0x32f3[4])[_0x32f3[3]];var ReportFaxSessionHistory=require(_0x32f3[4])[_0x32f3[5]];var User=require(_0x32f3[4])[_0x32f3[6]];function handleError(_0x78fdx7,_0x78fdx8){_0x78fdx8=_0x78fdx8||500;return function(_0x78fdx9){_0x78fdx7[_0x32f3[8]](_0x78fdx8)[_0x32f3[7]](_0x78fdx9)}}function responseWithResult(_0x78fdx7,_0x78fdx8){_0x78fdx8=_0x78fdx8||200;return function(_0x78fdxb){if(_0x78fdxb){_0x78fdx7[_0x32f3[8]](_0x78fdx8)[_0x32f3[9]](_0x78fdxb)}}}function responseWithoutResult(_0x78fdx7,_0x78fdx8){_0x78fdx8=_0x78fdx8||204;return function(){_0x78fdx7[_0x32f3[10]](_0x78fdx8)}}function handleEntityNotFound(_0x78fdx7){return function(_0x78fdxb){if(!_0x78fdxb){_0x78fdx7[_0x32f3[8]](404)[_0x32f3[11]]();return null};return _0x78fdxb}}function saveUpdates(_0x78fdxf){return function(_0x78fdxb){return _0x78fdxb[_0x32f3[13]](_0x78fdxf)[_0x32f3[12]](function(_0x78fdx10){return _0x78fdx10})}}function removeEntity(_0x78fdx7){return function(_0x78fdxb){if(_0x78fdxb){return _0x78fdxb[_0x32f3[14]]()[_0x32f3[12]](function(){_0x78fdx7[_0x32f3[8]](204)[_0x32f3[11]]()})}}}exports[_0x32f3[15]]=function(_0x78fdx12,_0x78fdx7){return ReportFaxSession[_0x32f3[19]](Util[_0x32f3[18]](_0x78fdx12[_0x32f3[17]]))[_0x32f3[12]](responseWithResult(_0x78fdx7))[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[20]]=function(_0x78fdx12,_0x78fdx7){return ReportFaxSession[_0x32f3[23]](_0x78fdx12[_0x32f3[22]][_0x32f3[21]])[_0x32f3[12]](handleEntityNotFound(_0x78fdx7))[_0x32f3[12]](responseWithResult(_0x78fdx7))[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[24]]=function(_0x78fdx12,_0x78fdx7){return ReportFaxSession[_0x32f3[24]](_0x78fdx12[_0x32f3[25]])[_0x32f3[12]](responseWithResult(_0x78fdx7,201))[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[26]]=function(_0x78fdx12,_0x78fdx7){if(_0x78fdx12[_0x32f3[25]][_0x32f3[21]]){delete _0x78fdx12[_0x32f3[25]][_0x32f3[21]]};return ReportFaxSession[_0x32f3[23]](_0x78fdx12[_0x32f3[22]][_0x32f3[21]])[_0x32f3[12]](handleEntityNotFound(_0x78fdx7))[_0x32f3[12]](saveUpdates(_0x78fdx12[_0x32f3[25]]))[_0x32f3[12]](responseWithResult(_0x78fdx7))[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[14]]=function(_0x78fdx12,_0x78fdx7){return ReportFaxSession[_0x32f3[23]](_0x78fdx12[_0x32f3[22]][_0x32f3[21]])[_0x32f3[12]](handleEntityNotFound(_0x78fdx7))[_0x32f3[12]](removeEntity(_0x78fdx7))[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[27]]=function(_0x78fdx12,_0x78fdx7){return ReportFaxSessionHistory[_0x32f3[27]]()[_0x32f3[12]](function(_0x78fdx13){return _0x78fdx7[_0x32f3[8]](200)[_0x32f3[7]](_0x78fdx13)})[_0x32f3[16]](handleError(_0x78fdx7))};exports[_0x32f3[28]]=function(_0x78fdx12,_0x78fdx7){return Promise[_0x32f3[31]]([])[_0x32f3[12]](getFaxQueues(_0x78fdx12[_0x32f3[30]]))[_0x32f3[12]](function(_0x78fdx15){return ReportFaxSession[_0x32f3[19]](Util[_0x32f3[18]](_0x78fdx12[_0x32f3[17]],_[_0x32f3[29]]({leaveAt:null},_0x78fdx15)))})[_0x32f3[12]](function(_0x78fdx14){return _0x78fdx7[_0x32f3[8]](200)[_0x32f3[7]]({rows:_0x78fdx14})})[_0x32f3[16]](handleError(_0x78fdx7))};function getFaxQueues(_0x78fdx17){return function(){switch(_0x78fdx17[_0x32f3[39]]){case _0x32f3[30]:return User[_0x32f3[23]](_0x78fdx17[_0x32f3[21]],{attributes:[_0x32f3[21]]})[_0x32f3[12]](Util[_0x32f3[36]]({},{attributes:[_0x32f3[21]],include:[{raw:true,model:User,attributes:[_0x32f3[21]]}]}))[_0x32f3[12]](function(_0x78fdx18){var _0x78fdx19=[];_0x78fdx18[_0x32f3[35]][_0x32f3[34]](function(_0x78fdx1a){_0x78fdx19=_[_0x32f3[33]](_0x78fdx19,_[_0x32f3[32]](_0x78fdx1a.Users,_0x32f3[21]))});return {$or:{queue:_[_0x32f3[32]](_0x78fdx18[_0x32f3[35]],_0x32f3[21]),memberid:_0x78fdx19}}});case _0x32f3[38]:return User[_0x32f3[23]](_0x78fdx17[_0x32f3[21]],{attributes:[_0x32f3[21]]})[_0x32f3[12]](function(_0x78fdx1b){return _0x78fdx1b[_0x32f3[37]]({attributes:[_0x32f3[21]]})})[_0x32f3[12]](function(_0x78fdx18){return {$or:{queue:_[_0x32f3[32]](_0x78fdx18,_0x32f3[21]),memberid:_0x78fdx17[_0x32f3[21]]}}});default:return {}}}}
\ No newline at end of file
+var _0x56c2=["\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","\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","\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","\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"];_0x56c2[0];var _=require(_0x56c2[1]);var Util=require(_0x56c2[2]);var moment=require(_0x56c2[3]);var ReportFaxSession=require(_0x56c2[5])[_0x56c2[4]];var ReportFaxSessionHistory=require(_0x56c2[5])[_0x56c2[7]][_0x56c2[6]];var User=require(_0x56c2[5])[_0x56c2[8]];function handleError(_0x64e5x8,_0x64e5x9){_0x64e5x9= _0x64e5x9|| 500;return function(_0x64e5xa){_0x64e5x8[_0x56c2[10]](_0x64e5x9)[_0x56c2[9]](_0x64e5xa)}}function responseWithResult(_0x64e5x8,_0x64e5x9){_0x64e5x9= _0x64e5x9|| 200;return function(_0x64e5xc){if(_0x64e5xc){_0x64e5x8[_0x56c2[10]](_0x64e5x9)[_0x56c2[11]](_0x64e5xc)}}}function responseWithoutResult(_0x64e5x8,_0x64e5x9){_0x64e5x9= _0x64e5x9|| 204;return function(){_0x64e5x8[_0x56c2[12]](_0x64e5x9)}}function handleEntityNotFound(_0x64e5x8){return function(_0x64e5xc){if(!_0x64e5xc){_0x64e5x8[_0x56c2[10]](404)[_0x56c2[13]]();return null};return _0x64e5xc}}function saveUpdates(_0x64e5x10){return function(_0x64e5xc){return _0x64e5xc[_0x56c2[15]](_0x64e5x10)[_0x56c2[14]](function(_0x64e5x11){return _0x64e5x11})}}function removeEntity(_0x64e5x8){return function(_0x64e5xc){if(_0x64e5xc){return _0x64e5xc[_0x56c2[16]]()[_0x56c2[14]](function(){_0x64e5x8[_0x56c2[10]](204)[_0x56c2[13]]()})}}}exports[_0x56c2[17]]= function(_0x64e5x13,_0x64e5x8){return ReportFaxSession[_0x56c2[21]](Util[_0x56c2[20]](_0x64e5x13[_0x56c2[19]]))[_0x56c2[14]](responseWithResult(_0x64e5x8))[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[22]]= function(_0x64e5x13,_0x64e5x8){return ReportFaxSession[_0x56c2[25]](_0x64e5x13[_0x56c2[24]][_0x56c2[23]])[_0x56c2[14]](handleEntityNotFound(_0x64e5x8))[_0x56c2[14]](responseWithResult(_0x64e5x8))[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[26]]= function(_0x64e5x13,_0x64e5x8){return ReportFaxSession[_0x56c2[26]](_0x64e5x13[_0x56c2[27]])[_0x56c2[14]](responseWithResult(_0x64e5x8,201))[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[28]]= function(_0x64e5x13,_0x64e5x8){if(_0x64e5x13[_0x56c2[27]][_0x56c2[23]]){delete _0x64e5x13[_0x56c2[27]][_0x56c2[23]]};return ReportFaxSession[_0x56c2[25]](_0x64e5x13[_0x56c2[24]][_0x56c2[23]])[_0x56c2[14]](handleEntityNotFound(_0x64e5x8))[_0x56c2[14]](saveUpdates(_0x64e5x13[_0x56c2[27]]))[_0x56c2[14]](responseWithResult(_0x64e5x8))[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[16]]= function(_0x64e5x13,_0x64e5x8){return ReportFaxSession[_0x56c2[25]](_0x64e5x13[_0x56c2[24]][_0x56c2[23]])[_0x56c2[14]](handleEntityNotFound(_0x64e5x8))[_0x56c2[14]](removeEntity(_0x64e5x8))[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[29]]= function(_0x64e5x13,_0x64e5x8){return ReportFaxSessionHistory[_0x56c2[29]]()[_0x56c2[14]](function(_0x64e5x14){return _0x64e5x8[_0x56c2[10]](200)[_0x56c2[9]](_0x64e5x14)})[_0x56c2[18]](handleError(_0x64e5x8))};exports[_0x56c2[30]]= function(_0x64e5x13,_0x64e5x8){return Promise[_0x56c2[37]]([])[_0x56c2[14]](getFaxQueues(_0x64e5x13[_0x56c2[36]]))[_0x56c2[14]](function(_0x64e5x16){return ReportFaxSession[_0x56c2[35]](Util[_0x56c2[20]](_0x64e5x13[_0x56c2[19]],_[_0x56c2[34]]({timeout:true,createdAt:{$gte:moment()[_0x56c2[33]](_0x56c2[32])}},_0x64e5x16)))})[_0x56c2[14]](function(_0x64e5x15){return _0x64e5x8[_0x56c2[10]](200)[_0x56c2[9]]({value:_0x64e5x15})})[_0x56c2[18]](function(_0x64e5xa){console[_0x56c2[31]](_0x64e5xa);return handleError(_0x64e5x8,_0x64e5xa)})};exports[_0x56c2[38]]= function(_0x64e5x13,_0x64e5x8){return Promise[_0x56c2[37]]([])[_0x56c2[14]](getFaxQueues(_0x64e5x13[_0x56c2[36]]))[_0x56c2[14]](function(_0x64e5x16){return ReportFaxSession[_0x56c2[35]](Util[_0x56c2[20]](_0x64e5x13[_0x56c2[19]],_[_0x56c2[34]]({leaveAt:null,createdAt:{$gte:moment()[_0x56c2[33]](_0x56c2[32])}},_0x64e5x16)))})[_0x56c2[14]](function(_0x64e5x15){return _0x64e5x8[_0x56c2[10]](200)[_0x56c2[9]]({value:_0x64e5x15})})[_0x56c2[18]](function(_0x64e5xa){console[_0x56c2[31]](_0x64e5xa);return handleError(_0x64e5x8,_0x64e5xa)})};exports[_0x56c2[39]]= function(_0x64e5x13,_0x64e5x8){return Promise[_0x56c2[37]]([])[_0x56c2[14]](getFaxQueues(_0x64e5x13[_0x56c2[36]]))[_0x56c2[14]](function(_0x64e5x16){return ReportFaxSession[_0x56c2[21]](Util[_0x56c2[20]](_0x64e5x13[_0x56c2[19]],_[_0x56c2[34]]({leaveAt:null},_0x64e5x16)))})[_0x56c2[14]](function(_0x64e5x15){return _0x64e5x8[_0x56c2[10]](200)[_0x56c2[9]]({rows:_0x64e5x15})})[_0x56c2[18]](handleError(_0x64e5x8))};function getFaxQueues(_0x64e5x18){return function(){switch(_0x64e5x18[_0x56c2[47]]){case _0x56c2[36]:return User[_0x56c2[25]](_0x64e5x18[_0x56c2[23]],{attributes:[_0x56c2[23]]})[_0x56c2[14]](Util[_0x56c2[44]]({},{attributes:[_0x56c2[23]],include:[{raw:true,model:User,attributes:[_0x56c2[23]]}]}))[_0x56c2[14]](function(_0x64e5x19){var _0x64e5x1a=[];_0x64e5x19[_0x56c2[43]][_0x56c2[42]](function(_0x64e5x1b){_0x64e5x1a= _[_0x56c2[41]](_0x64e5x1a,_[_0x56c2[40]](_0x64e5x1b.Users,_0x56c2[23]))});return {$or:{queue:_[_0x56c2[40]](_0x64e5x19[_0x56c2[43]],_0x56c2[23]),memberid:_0x64e5x1a}}});case _0x56c2[46]:return User[_0x56c2[25]](_0x64e5x18[_0x56c2[23]],{attributes:[_0x56c2[23]]})[_0x56c2[14]](function(_0x64e5x1c){return _0x64e5x1c[_0x56c2[45]]({attributes:[_0x56c2[23]]})})[_0x56c2[14]](function(_0x64e5x19){return {$or:{queue:_[_0x56c2[40]](_0x64e5x19,_0x56c2[23]),memberid:_0x64e5x18[_0x56c2[23]]}}});default:return {}}}}
\ No newline at end of file