Built motion from commit 95c3d5ad5.|1.0.29
[motion.git] / server / api / action / action.controller.js
index bac93f1..1ba3a71 100644 (file)
@@ -1 +1 @@
-var _0x4602=["\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","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\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","\x6C\x6F\x67","\x6D\x65\x73\x73\x61\x67\x65","\x49\x6E\x74\x65\x72\x66\x61\x63\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x4E\x6F\x20\x71\x75\x65\x75\x65\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x4E\x4F\x5F\x55\x53\x45\x52\x5F\x51\x55\x45\x55\x45\x53","\x70\x61\x72\x61\x6D\x73","\x6D\x65\x72\x67\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E"];_0x4602[0];var _=require(_0x4602[1]);var Action=require(_0x4602[3])[_0x4602[2]];var sequelize=require(_0x4602[3])[_0x4602[4]];function handleError(_0xe851x5,_0xe851x6){return _0xe851x5[_0x4602[6]](500)[_0x4602[5]](_0xe851x6)}function responseWithResult(_0xe851x5,_0xe851x8){_0xe851x8= _0xe851x8|| 200;return function(_0xe851x9){if(_0xe851x9){_0xe851x5[_0x4602[6]](_0xe851x8)[_0x4602[7]](_0xe851x9)}}}function handleEntityNotFound(_0xe851x5){return function(_0xe851x9){if(!_0xe851x9){_0xe851x5[_0x4602[6]](404)[_0x4602[8]]();return null};return _0xe851x9}}function saveUpdates(_0xe851xc){return function(_0xe851x9){return _0xe851x9[_0x4602[10]](_0xe851xc)[_0x4602[9]](function(_0xe851xd){return _0xe851xd})}}function removeEntity(_0xe851x5){return function(_0xe851x9){if(_0xe851x9){return _0xe851x9[_0x4602[11]]()[_0x4602[9]](function(){_0xe851x5[_0x4602[6]](204)[_0x4602[8]]()})}}}exports[_0x4602[12]]= function(_0xe851xf,_0xe851x5){return Action[_0x4602[14]]()[_0x4602[9]](responseWithResult(_0xe851x5))[_0x4602[13]](handleError(_0xe851x5))};exports[_0x4602[15]]= function(_0xe851xf,_0xe851x5,_0xe851x10){_0xe851xf[_0x4602[17]][_0x4602[16]]= _0xe851xf[_0x4602[19]][_0x4602[18]];return sequelize[_0x4602[28]](function(_0xe851x12){return Action[_0x4602[15]](_[_0x4602[27]](_0xe851xf[_0x4602[17]],_0xe851xf[_0x4602[26]]),{transaction:_0xe851x12,body:_0xe851xf[_0x4602[17]]})})[_0x4602[9]](function(_0xe851x11){return _0xe851x5[_0x4602[6]](201)[_0x4602[5]](_0xe851x11)})[_0x4602[13]](function(_0xe851x6){console[_0x4602[20]](_0xe851x6);if(_0xe851x6[_0x4602[21]]=== _0x4602[22]){_0xe851x6[_0x4602[21]]= _0x4602[23];_0xe851x6[_0x4602[24]]= _0x4602[25]};return handleError(_0xe851x5,_0xe851x6)})}
\ No newline at end of file
+var _0x2f76=["\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"];_0x2f76[0];var _=require(_0x2f76[1]);var Action=require(_0x2f76[3])[_0x2f76[2]];var User=require(_0x2f76[3])[_0x2f76[4]];var sequelize=require(_0x2f76[3])[_0x2f76[5]];var BPromise=require(_0x2f76[6]);var util=require(_0x2f76[7]);var logger=require(_0x2f76[9])(_0x2f76[8]);function handleError(_0x2a07x9,_0x2a07xa){logger[_0x2f76[11]](_0x2a07xa[_0x2f76[10]]);return _0x2a07x9[_0x2f76[13]](500)[_0x2f76[12]](_0x2a07xa)}function responseWithResult(_0x2a07x9,_0x2a07xc){_0x2a07xc= _0x2a07xc|| 200;return function(_0x2a07xd){if(_0x2a07xd){_0x2a07x9[_0x2f76[13]](_0x2a07xc)[_0x2f76[14]](_0x2a07xd)}}}function handleEntityNotFound(_0x2a07x9){return function(_0x2a07xd){if(!_0x2a07xd){_0x2a07x9[_0x2f76[13]](404)[_0x2f76[15]]();return null};return _0x2a07xd}}function saveUpdates(_0x2a07x10){return function(_0x2a07xd){return _0x2a07xd[_0x2f76[17]](_0x2a07x10)[_0x2f76[16]](function(_0x2a07x11){return _0x2a07x11})}}function removeEntity(_0x2a07x9){return function(_0x2a07xd){if(_0x2a07xd){return _0x2a07xd[_0x2f76[18]]()[_0x2f76[16]](function(){_0x2a07x9[_0x2f76[13]](204)[_0x2f76[15]]()})}}}exports[_0x2f76[19]]= function(_0x2a07x13,_0x2a07x9){return Action[_0x2f76[21]]()[_0x2f76[16]](responseWithResult(_0x2a07x9))[_0x2f76[20]](function(_0x2a07xa){handleError(_0x2a07x9,_0x2a07xa)})};exports[_0x2f76[22]]= function(_0x2a07x13,_0x2a07x9,_0x2a07x14){_0x2a07x13[_0x2f76[24]][_0x2f76[23]]= _0x2a07x13[_0x2f76[26]][_0x2f76[25]];_[_0x2f76[28]](_0x2a07x13[_0x2f76[24]],_0x2a07x13[_0x2f76[27]]);return BPromise[_0x2f76[36]]()[_0x2f76[16]](function(){if(!_0x2a07x13[_0x2f76[24]][_0x2f76[29]]|| _[_0x2f76[32]]([_0x2f76[30],_0x2f76[31]],_0x2a07x13[_0x2f76[24]][_0x2f76[29]])){switch(_0x2a07x13[_0x2f76[24]][_0x2f76[35]]){case _0x2f76[33]:;case _0x2f76[34]:return sendAction(_0x2a07x13,_0x2a07x9);default:return null}};return null})[_0x2f76[16]](function(){return Action[_0x2f76[22]](_0x2a07x13[_0x2f76[24]],{body:_0x2a07x13[_0x2f76[24]]})})[_0x2f76[16]](function(_0x2a07x15){return _0x2a07x9[_0x2f76[13]](201)[_0x2f76[12]](_0x2a07x15)})[_0x2f76[20]](function(_0x2a07xa){return handleError(_0x2a07x9,_0x2a07xa)})};function sendAction(_0x2a07x13,_0x2a07x9){return BPromise[_0x2f76[36]]()[_0x2f76[16]](function(){return User[_0x2f76[50]](_0x2a07x13[_0x2f76[24]][_0x2f76[49]])})[_0x2f76[16]](function(_0x2a07x17){if(!_0x2a07x17){_0x2a07x9[_0x2f76[13]](404)[_0x2f76[15]]();return null};_0x2a07x13[_0x2f76[24]][_0x2f76[37]]= _0x2a07x17[_0x2f76[35]];var _0x2a07x15;switch(_0x2a07x13[_0x2f76[24]][_0x2f76[35]]){case _0x2f76[33]:_0x2a07x15= {message:_0x2f76[38],agent:_0x2a07x13[_0x2f76[24]][_0x2f76[37]],queueStatus:_0x2a07x17[_0x2f76[39]],action:{action:_0x2f76[38],interface:util[_0x2f76[42]](_0x2f76[40],_0x2f76[41],_0x2a07x13[_0x2f76[24]][_0x2f76[37]]),paused:true,reason:_0x2a07x13[_0x2f76[24]][_0x2f76[43]]|| _0x2a07x13[_0x2f76[24]][_0x2f76[44]]|| _0x2f76[45]}};break;case _0x2f76[34]:_0x2a07x15= {message:_0x2f76[38],agent:_0x2a07x13[_0x2f76[24]][_0x2f76[37]],queueStatus:_0x2a07x17[_0x2f76[39]],action:{action:_0x2f76[38],interface:util[_0x2f76[42]](_0x2f76[40],_0x2f76[41],_0x2a07x13[_0x2f76[24]][_0x2f76[37]]),paused:false}};break;default:};if(_0x2a07x15){return _0x2a07x13[_0x2f76[48]][_0x2f76[47]][_0x2f76[46]][_0x2f76[12]](_0x2a07x15)};return null})}
\ No newline at end of file