Built motion from commit ec3309576.|1.0.33
[motion.git] / server / api / action / action.controller.js
index 083a2de..1ae6925 100644 (file)
@@ -1 +1 @@
-var _0x79a3=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x41\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x62\x6C\x75\x65\x62\x69\x72\x64","\x75\x74\x69\x6C","\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","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\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","\x63\x72\x65\x61\x74\x65","\x55\x73\x65\x72\x49\x64","\x62\x6F\x64\x79","\x69\x64","\x75\x73\x65\x72","\x70\x61\x72\x61\x6D\x73","\x6D\x65\x72\x67\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x61\x6C\x6C","\x76\x6F\x69\x63\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x70\x61\x75\x73\x65","\x75\x6E\x70\x61\x75\x73\x65","\x6E\x61\x6D\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x64\x61\x74\x61\x32","\x51\x75\x65\x75\x65\x50\x61\x75\x73\x65","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x25\x73\x2F\x25\x73","\x53\x49\x50","\x66\x6F\x72\x6D\x61\x74","\x74\x79\x70\x65","\x64\x61\x74\x61\x34","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64\x42\x79\x49\x64"];_0x79a3[0];var _=require(_0x79a3[1]);var Action=require(_0x79a3[3])[_0x79a3[2]];var User=require(_0x79a3[3])[_0x79a3[4]];var sequelize=require(_0x79a3[3])[_0x79a3[5]];var BPromise=require(_0x79a3[6]);var util=require(_0x79a3[7]);var logger=require(_0x79a3[9])(_0x79a3[8]);function handleError(_0x994fx9,_0x994fxa){logger[_0x79a3[11]](_0x994fxa[_0x79a3[10]]);return _0x994fx9[_0x79a3[13]](500)[_0x79a3[12]](_0x994fxa)}function responseWithResult(_0x994fx9,_0x994fxc){_0x994fxc= _0x994fxc|| 200;return function(_0x994fxd){if(_0x994fxd){_0x994fx9[_0x79a3[13]](_0x994fxc)[_0x79a3[14]](_0x994fxd)}}}function handleEntityNotFound(_0x994fx9){return function(_0x994fxd){if(!_0x994fxd){_0x994fx9[_0x79a3[13]](404)[_0x79a3[15]]();return null};return _0x994fxd}}function saveUpdates(_0x994fx10){return function(_0x994fxd){return _0x994fxd[_0x79a3[17]](_0x994fx10)[_0x79a3[16]](function(_0x994fx11){return _0x994fx11})}}function removeEntity(_0x994fx9){return function(_0x994fxd){if(_0x994fxd){return _0x994fxd[_0x79a3[18]]()[_0x79a3[16]](function(){_0x994fx9[_0x79a3[13]](204)[_0x79a3[15]]()})}}}exports[_0x79a3[19]]= function(_0x994fx13,_0x994fx9){return Action[_0x79a3[21]]()[_0x79a3[16]](responseWithResult(_0x994fx9))[_0x79a3[20]](function(_0x994fxa){handleError(_0x994fx9,_0x994fxa)})};exports[_0x79a3[22]]= function(_0x994fx13,_0x994fx9,_0x994fx14){_0x994fx13[_0x79a3[24]][_0x79a3[23]]= _0x994fx13[_0x79a3[26]][_0x79a3[25]];_[_0x79a3[28]](_0x994fx13[_0x79a3[24]],_0x994fx13[_0x79a3[27]]);return BPromise[_0x79a3[36]]()[_0x79a3[16]](function(){if(!_0x994fx13[_0x79a3[24]][_0x79a3[29]]|| _[_0x79a3[32]]([_0x79a3[30],_0x79a3[31]],_0x994fx13[_0x79a3[24]][_0x79a3[29]])){switch(_0x994fx13[_0x79a3[24]][_0x79a3[35]]){case _0x79a3[33]:;case _0x79a3[34]:return sendAction(_0x994fx13,_0x994fx9);default:return null}};return null})[_0x79a3[16]](function(){return Action[_0x79a3[22]](_0x994fx13[_0x79a3[24]],{body:_0x994fx13[_0x79a3[24]]})})[_0x79a3[16]](function(_0x994fx15){return _0x994fx9[_0x79a3[13]](201)[_0x79a3[12]](_0x994fx15)})[_0x79a3[20]](function(_0x994fxa){return handleError(_0x994fx9,_0x994fxa)})};function sendAction(_0x994fx13,_0x994fx9){return BPromise[_0x79a3[36]]()[_0x79a3[16]](function(){return User[_0x79a3[50]](_0x994fx13[_0x79a3[24]][_0x79a3[49]])})[_0x79a3[16]](function(_0x994fx17){if(!_0x994fx17){_0x994fx9[_0x79a3[13]](404)[_0x79a3[15]]();return null};_0x994fx13[_0x79a3[24]][_0x79a3[37]]= _0x994fx17[_0x79a3[35]];var _0x994fx15;switch(_0x994fx13[_0x79a3[24]][_0x79a3[35]]){case _0x79a3[33]:_0x994fx15= {message:_0x79a3[38],agent:_0x994fx13[_0x79a3[24]][_0x79a3[37]],queueStatus:_0x994fx17[_0x79a3[39]],action:{action:_0x79a3[38],interface:util[_0x79a3[42]](_0x79a3[40],_0x79a3[41],_0x994fx13[_0x79a3[24]][_0x79a3[37]]),paused:true,reason:_0x994fx13[_0x79a3[24]][_0x79a3[43]]|| _0x994fx13[_0x79a3[24]][_0x79a3[44]]|| _0x79a3[45]}};break;case _0x79a3[34]:_0x994fx15= {message:_0x79a3[38],agent:_0x994fx13[_0x79a3[24]][_0x79a3[37]],queueStatus:_0x994fx17[_0x79a3[39]],action:{action:_0x79a3[38],interface:util[_0x79a3[42]](_0x79a3[40],_0x79a3[41],_0x994fx13[_0x79a3[24]][_0x79a3[37]]),paused:false}};break;default:};if(_0x994fx15){return _0x994fx13[_0x79a3[48]][_0x79a3[47]][_0x79a3[46]][_0x79a3[12]](_0x994fx15)};return null})}
\ No newline at end of file
+var _0x2bed=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x41\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x62\x6C\x75\x65\x62\x69\x72\x64","\x75\x74\x69\x6C","\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","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\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","\x63\x72\x65\x61\x74\x65","\x55\x73\x65\x72\x49\x64","\x62\x6F\x64\x79","\x69\x64","\x75\x73\x65\x72","\x70\x61\x72\x61\x6D\x73","\x6D\x65\x72\x67\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x61\x6C\x6C","\x76\x6F\x69\x63\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x70\x61\x75\x73\x65","\x75\x6E\x70\x61\x75\x73\x65","\x6E\x61\x6D\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x64\x61\x74\x61\x32","\x51\x75\x65\x75\x65\x50\x61\x75\x73\x65","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x25\x73\x2F\x25\x73","\x53\x49\x50","\x66\x6F\x72\x6D\x61\x74","\x74\x79\x70\x65","\x64\x61\x74\x61\x34","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64\x42\x79\x49\x64"];_0x2bed[0];var _=require(_0x2bed[1]);var Action=require(_0x2bed[3])[_0x2bed[2]];var User=require(_0x2bed[3])[_0x2bed[4]];var sequelize=require(_0x2bed[3])[_0x2bed[5]];var BPromise=require(_0x2bed[6]);var util=require(_0x2bed[7]);var logger=require(_0x2bed[9])(_0x2bed[8]);function handleError(_0xb1b0x9,_0xb1b0xa){logger[_0x2bed[11]](_0xb1b0xa[_0x2bed[10]]);return _0xb1b0x9[_0x2bed[13]](500)[_0x2bed[12]](_0xb1b0xa)}function responseWithResult(_0xb1b0x9,_0xb1b0xc){_0xb1b0xc= _0xb1b0xc|| 200;return function(_0xb1b0xd){if(_0xb1b0xd){_0xb1b0x9[_0x2bed[13]](_0xb1b0xc)[_0x2bed[14]](_0xb1b0xd)}}}function handleEntityNotFound(_0xb1b0x9){return function(_0xb1b0xd){if(!_0xb1b0xd){_0xb1b0x9[_0x2bed[13]](404)[_0x2bed[15]]();return null};return _0xb1b0xd}}function saveUpdates(_0xb1b0x10){return function(_0xb1b0xd){return _0xb1b0xd[_0x2bed[17]](_0xb1b0x10)[_0x2bed[16]](function(_0xb1b0x11){return _0xb1b0x11})}}function removeEntity(_0xb1b0x9){return function(_0xb1b0xd){if(_0xb1b0xd){return _0xb1b0xd[_0x2bed[18]]()[_0x2bed[16]](function(){_0xb1b0x9[_0x2bed[13]](204)[_0x2bed[15]]()})}}}exports[_0x2bed[19]]= function(_0xb1b0x13,_0xb1b0x9){return Action[_0x2bed[21]]()[_0x2bed[16]](responseWithResult(_0xb1b0x9))[_0x2bed[20]](function(_0xb1b0xa){handleError(_0xb1b0x9,_0xb1b0xa)})};exports[_0x2bed[22]]= function(_0xb1b0x13,_0xb1b0x9,_0xb1b0x14){_0xb1b0x13[_0x2bed[24]][_0x2bed[23]]= _0xb1b0x13[_0x2bed[26]][_0x2bed[25]];_[_0x2bed[28]](_0xb1b0x13[_0x2bed[24]],_0xb1b0x13[_0x2bed[27]]);return BPromise[_0x2bed[36]]()[_0x2bed[16]](function(){if(!_0xb1b0x13[_0x2bed[24]][_0x2bed[29]]|| _[_0x2bed[32]]([_0x2bed[30],_0x2bed[31]],_0xb1b0x13[_0x2bed[24]][_0x2bed[29]])){switch(_0xb1b0x13[_0x2bed[24]][_0x2bed[35]]){case _0x2bed[33]:;case _0x2bed[34]:return sendAction(_0xb1b0x13,_0xb1b0x9);default:return null}};return null})[_0x2bed[16]](function(){return Action[_0x2bed[22]](_0xb1b0x13[_0x2bed[24]],{body:_0xb1b0x13[_0x2bed[24]]})})[_0x2bed[16]](function(_0xb1b0x15){return _0xb1b0x9[_0x2bed[13]](201)[_0x2bed[12]](_0xb1b0x15)})[_0x2bed[20]](function(_0xb1b0xa){return handleError(_0xb1b0x9,_0xb1b0xa)})};function sendAction(_0xb1b0x13,_0xb1b0x9){return BPromise[_0x2bed[36]]()[_0x2bed[16]](function(){return User[_0x2bed[50]](_0xb1b0x13[_0x2bed[24]][_0x2bed[49]])})[_0x2bed[16]](function(_0xb1b0x17){if(!_0xb1b0x17){_0xb1b0x9[_0x2bed[13]](404)[_0x2bed[15]]();return null};_0xb1b0x13[_0x2bed[24]][_0x2bed[37]]= _0xb1b0x17[_0x2bed[35]];var _0xb1b0x15;switch(_0xb1b0x13[_0x2bed[24]][_0x2bed[35]]){case _0x2bed[33]:_0xb1b0x15= {message:_0x2bed[38],agent:_0xb1b0x13[_0x2bed[24]][_0x2bed[37]],queueStatus:_0xb1b0x17[_0x2bed[39]],action:{action:_0x2bed[38],interface:util[_0x2bed[42]](_0x2bed[40],_0x2bed[41],_0xb1b0x13[_0x2bed[24]][_0x2bed[37]]),paused:true,reason:_0xb1b0x13[_0x2bed[24]][_0x2bed[43]]|| _0xb1b0x13[_0x2bed[24]][_0x2bed[44]]|| _0x2bed[45]}};break;case _0x2bed[34]:_0xb1b0x15= {message:_0x2bed[38],agent:_0xb1b0x13[_0x2bed[24]][_0x2bed[37]],queueStatus:_0xb1b0x17[_0x2bed[39]],action:{action:_0x2bed[38],interface:util[_0x2bed[42]](_0x2bed[40],_0x2bed[41],_0xb1b0x13[_0x2bed[24]][_0x2bed[37]]),paused:false}};break;default:};if(_0xb1b0x15){return _0xb1b0x13[_0x2bed[48]][_0x2bed[47]][_0x2bed[46]][_0x2bed[12]](_0xb1b0x15)};return null})}
\ No newline at end of file