f4b6bb70dec26f39afaedd664ffb7c53287f64a0
[motion.git] / server / api / report_jscripty_session / report_jscripty_session.controller.js
1 var _0x19b6=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x4A\x73\x63\x72\x69\x70\x74\x79\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\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","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x6C\x6F\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x66\x69\x6E\x64\x42\x79\x49\x64"];_0x19b6[0];var _=require(_0x19b6[1]);var ReportJscriptySession=require(_0x19b6[3])[_0x19b6[2]];function handleError(_0x9844x4,_0x9844x5){_0x9844x5=_0x9844x5||500;return function(_0x9844x6){_0x9844x4[_0x19b6[5]](_0x9844x5)[_0x19b6[4]](_0x9844x6)}}function responseWithResult(_0x9844x4,_0x9844x5){_0x9844x5=_0x9844x5||200;return function(_0x9844x8){if(_0x9844x8){_0x9844x4[_0x19b6[5]](_0x9844x5)[_0x19b6[6]](_0x9844x8)}}}function handleEntityNotFound(_0x9844x4){return function(_0x9844x8){if(!_0x9844x8){_0x9844x4[_0x19b6[5]](404)[_0x19b6[7]]();return null};return _0x9844x8}}function saveUpdates(_0x9844xb){return function(_0x9844x8){return _0x9844x8[_0x19b6[9]](_0x9844xb)[_0x19b6[8]](function(_0x9844xc){return _0x9844xc})}}function removeEntity(_0x9844x4){return function(_0x9844x8){if(_0x9844x8){return _0x9844x8[_0x19b6[10]]()[_0x19b6[8]](function(){_0x9844x4[_0x19b6[5]](204)[_0x19b6[7]]()})}}}exports[_0x19b6[11]]=function(_0x9844xe,_0x9844x4){ReportJscriptySession[_0x19b6[13]]()[_0x19b6[8]](responseWithResult(_0x9844x4))[_0x19b6[12]](handleError(_0x9844x4))};exports[_0x19b6[14]]=function(_0x9844xe,_0x9844x4){ReportJscriptySession[_0x19b6[13]]({where:{projectId:_0x9844xe[_0x19b6[18]][_0x19b6[17]]}})[_0x19b6[8]](function(_0x9844xf){if(!_0x9844xf){return _0x9844x4[_0x19b6[16]](404)};return _0x9844x4[_0x19b6[5]](200)[_0x19b6[4]](_0x9844xf)})[_0x19b6[8]](handleEntityNotFound(_0x9844x4))[_0x19b6[8]](responseWithResult(_0x9844x4))[_0x19b6[12]](function(_0x9844x6){console[_0x19b6[15]](_0x9844x6);return handleError(_0x9844x4,_0x9844x6)})};exports[_0x19b6[19]]=function(_0x9844xe,_0x9844x4){ReportJscriptySession[_0x19b6[19]](_0x9844xe[_0x19b6[20]])[_0x19b6[8]](function(_0x9844x10){return _0x9844x4[_0x19b6[5]](201)[_0x19b6[4]](_0x9844x10)})[_0x19b6[12]](function(_0x9844x6){return handleError(_0x9844x4,_0x9844x6)})};exports[_0x19b6[21]]=function(_0x9844xe,_0x9844x4){ReportJscriptySession[_0x19b6[21]](_0x9844xe[_0x19b6[20]],{where:{session_id:_0x9844xe[_0x19b6[18]][_0x19b6[17]]}})[_0x19b6[8]](function(_0x9844x10){return _0x9844x4[_0x19b6[5]](200)[_0x19b6[4]](_0x9844x10)})[_0x19b6[12]](function(_0x9844x6){return handleError(_0x9844x4,_0x9844x6)})};exports[_0x19b6[10]]=function(_0x9844xe,_0x9844x4){ReportJscriptySession[_0x19b6[22]](_0x9844xe[_0x19b6[18]][_0x19b6[17]])[_0x19b6[8]](handleEntityNotFound(_0x9844x4))[_0x19b6[8]](removeEntity(_0x9844x4))[_0x19b6[12]](handleError(_0x9844x4))}