Built motion from commit c2984ba.|0.0.114
[motion.git] / server / api / voice_queue / voice_queue.controller.js
index 74cb07a..a68f0fe 100644 (file)
@@ -1 +1 @@
-var _0xc294=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x55\x73\x65\x72\x48\x61\x73\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6E\x61\x6D\x65","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74","\x69\x64","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x71\x75\x65\x75\x65\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x62\x6F\x64\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x72\x65\x61\x74\x65","\x50\x52\x49\x4D\x41\x52\x59","\x66\x69\x65\x6C\x64\x73","\x6D\x65\x73\x73\x61\x67\x65","\x4E\x61\x6D\x65\x20\x6D\x75\x73\x74\x20\x62\x65\x20\x75\x6E\x69\x71\x75\x65","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x53\x49\x50\x2F\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x6C\x65\x6E\x67\x74\x68","\x51\x75\x65\x75\x65\x20\x52\x6F\x75\x74\x65\x20\x41\x73\x73\x6F\x63\x69\x61\x74\x65","\x69\x64\x73"];_0xc294[0];var _=require(_0xc294[1]);var util=require(_0xc294[2]);var Util=require(_0xc294[3]);var sequelize=require(_0xc294[5])[_0xc294[4]];var User=require(_0xc294[5])[_0xc294[6]];var VoiceQueue=require(_0xc294[5])[_0xc294[7]];var UserHasVoiceQueue=require(_0xc294[5])[_0xc294[8]];var VoiceExtension=require(_0xc294[5])[_0xc294[9]];exports[_0xc294[10]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[17]](Util[_0xc294[16]](_0x8c0dx9[_0xc294[15]]))[_0xc294[14]](function(_0x8c0dxc){_0x8c0dxa[_0xc294[13]](200)[_0xc294[12]](_0x8c0dxc)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[18]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[22]](_0x8c0dx9[_0xc294[21]][_0xc294[20]])[_0xc294[14]](function(_0x8c0dxd){if(!_0x8c0dxd){return _0x8c0dxa[_0xc294[19]](404)};return _0x8c0dxa[_0xc294[12]](_0x8c0dxd)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[23]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[22]](_0x8c0dx9[_0xc294[21]][_0xc294[20]])[_0xc294[14]](function(_0x8c0dxf){if(!_0x8c0dxf){return _0x8c0dxa[_0xc294[19]](404)};return _0x8c0dxf[_0xc294[28]]({where:{role:_0xc294[24]},attributes:[_0xc294[25],_0xc294[20],_0xc294[26],_0xc294[27]]})})[_0xc294[14]](function(_0x8c0dxe){return _0x8c0dxa[_0xc294[13]](200)[_0xc294[12]](_0x8c0dxe)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[29]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[31]]({where:{name:_0x8c0dx9[_0xc294[30]][_0xc294[20]]}})[_0xc294[14]](function(_0x8c0dxd){if(!_0x8c0dxd){return _0x8c0dxa[_0xc294[19]](404)};return _0x8c0dxa[_0xc294[12]](_0x8c0dxd)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[32]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[32]](_0x8c0dx9[_0xc294[30]])[_0xc294[14]](function(_0x8c0dxd){return _0x8c0dxa[_0xc294[13]](201)[_0xc294[12]](_0x8c0dxd)})[_0xc294[11]](sequelize.UniqueConstraintError,function(_0x8c0dxb){if(_0x8c0dxb[_0xc294[34]][_0xc294[33]]){_0x8c0dxb[_0xc294[35]]=_0xc294[36]};return handleError(_0x8c0dxa,_0x8c0dxb)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[37]]=function(_0x8c0dx9,_0x8c0dxa){if(_0x8c0dx9[_0xc294[30]][_0xc294[20]]){delete _0x8c0dx9[_0xc294[30]][_0xc294[20]]};return VoiceQueue[_0xc294[22]](_0x8c0dx9[_0xc294[21]][_0xc294[20]])[_0xc294[14]](function(_0x8c0dxd){if(!_0x8c0dxd){return _0x8c0dxa[_0xc294[19]](404)};var _0x8c0dx10=_[_0xc294[38]](_0x8c0dxd,_0x8c0dx9[_0xc294[30]]);return _0x8c0dx10[_0xc294[39]]()})[_0xc294[14]](function(){return _0x8c0dxa[_0xc294[13]](200)[_0xc294[12]](voiceQueue)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[40]]=function(_0x8c0dx9,_0x8c0dxa,_0x8c0dx11){return User[_0xc294[31]]({where:{id:{$in:_0x8c0dx9[_0xc294[30]][_0xc294[45]]}}})[_0xc294[14]](function(_0x8c0dx12){var _0x8c0dx13=_[_0xc294[43]](_0x8c0dx12,function(_0x8c0dx14){return {queue:_0x8c0dx9[_0xc294[21]][_0xc294[20]],location:util[_0xc294[42]](_0xc294[41],_0x8c0dx14[_0xc294[20]]),membername:_0x8c0dx14[_0xc294[20]],VoiceQueueName:_0x8c0dx9[_0xc294[21]][_0xc294[20]],UserId:_0x8c0dx14[_0xc294[25]]}});return UserHasVoiceQueue[_0xc294[44]](_0x8c0dx13,{individualHooks:true})})[_0xc294[14]](function(){return _0x8c0dxa[_0xc294[19]](200)})[_0xc294[11]](function(_0x8c0dxb){return _0x8c0dx11(_0x8c0dxb)})};exports[_0xc294[46]]=function(_0x8c0dx9,_0x8c0dxa,_0x8c0dx11){return VoiceQueue[_0xc294[22]](_0x8c0dx9[_0xc294[21]][_0xc294[20]])[_0xc294[14]](function(_0x8c0dxf){if(!_0x8c0dxf){return _0x8c0dxa[_0xc294[19]](404)};return _0x8c0dxf[_0xc294[47]](_0x8c0dx9[_0xc294[15]][_0xc294[45]])})[_0xc294[14]](function(){return _0x8c0dxa[_0xc294[19]](202)})[_0xc294[11]](function(_0x8c0dxb){return _0x8c0dx11(_0x8c0dxb)})};exports[_0xc294[48]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[22]](_0x8c0dx9[_0xc294[21]][_0xc294[20]])[_0xc294[14]](function(_0x8c0dxd){if(!_0x8c0dxd){return _0x8c0dxa[_0xc294[19]](404)};return _0x8c0dxd[_0xc294[48]]()})[_0xc294[14]](function(){return _0x8c0dxa[_0xc294[19]](204)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};exports[_0xc294[49]]=function(_0x8c0dx9,_0x8c0dxa){return VoiceQueue[_0xc294[31]]({where:{name:_0x8c0dx9[_0xc294[15]][_0xc294[52]]}})[_0xc294[14]](function(_0x8c0dx16){if(!_0x8c0dx16){return _0x8c0dxa[_0xc294[19]](404)};var _0x8c0dx17=_[_0xc294[43]](_0x8c0dx16,_0xc294[20]);return VoiceExtension[_0xc294[31]]({where:{queue:_0x8c0dx17}})})[_0xc294[14]](function(_0x8c0dx15){if(_0x8c0dx15[_0xc294[50]]>0){return _0x8c0dxa[_0xc294[13]](500)[_0xc294[12]]({message:_0xc294[51]})};return VoiceQueue[_0xc294[48]]({where:{name:_0x8c0dx9[_0xc294[15]][_0xc294[52]]},individualHooks:true})})[_0xc294[14]](function(){return _0x8c0dxa[_0xc294[19]](204)})[_0xc294[11]](function(_0x8c0dxb){return handleError(_0x8c0dxa,_0x8c0dxb)})};function handleError(_0x8c0dxa,_0x8c0dxb){return _0x8c0dxa[_0xc294[13]](500)[_0xc294[12]](_0x8c0dxb)}
\ No newline at end of file
+var _0xd78c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x55\x73\x65\x72\x48\x61\x73\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6E\x61\x6D\x65","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x70\x75\x73\x68","\x50\x52\x49\x4D\x41\x52\x59","\x70\x61\x74\x68","\x66\x6F\x72\x45\x61\x63\x68","\x65\x72\x72\x6F\x72\x73","\x20\x6D\x75\x73\x74\x20\x62\x65\x20\x75\x6E\x69\x71\x75\x65","\x6D\x65\x73\x73\x61\x67\x65","\x6A\x6F\x69\x6E","\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\x45\x58\x49\x53\x54\x5F\x51\x55\x45\x55\x45","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6C\x6F\x67","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x53\x49\x50\x2F\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x70\x65\x6E\x61\x6C\x74\x79","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xd78c[0];var _=require(_0xd78c[1]);var util=require(_0xd78c[2]);var Util=require(_0xd78c[3]);var sequelize=require(_0xd78c[5])[_0xd78c[4]];var User=require(_0xd78c[5])[_0xd78c[6]];var VoiceQueue=require(_0xd78c[5])[_0xd78c[7]];var UserHasVoiceQueue=require(_0xd78c[5])[_0xd78c[8]];var VoiceExtension=require(_0xd78c[5])[_0xd78c[9]];exports[_0xd78c[10]]= function(_0x932ax9,_0x932axa){switch(_0x932ax9[_0xd78c[18]][_0xd78c[22]]){case _0xd78c[18]:return User[_0xd78c[19]](_0x932ax9[_0xd78c[18]][_0xd78c[17]],{attributes:[_0xd78c[17]]})[_0xd78c[14]](Util[_0xd78c[16]](_0x932ax9[_0xd78c[15]]))[_0xd78c[14]](function(_0x932axc){_0x932axa[_0xd78c[13]](200)[_0xd78c[12]](_0x932axc)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)});default:return VoiceQueue[_0xd78c[21]](Util[_0xd78c[20]](_0x932ax9[_0xd78c[15]]))[_0xd78c[14]](function(_0x932axc){_0x932axa[_0xd78c[13]](200)[_0xd78c[12]](_0x932axc)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})}};exports[_0xd78c[23]]= function(_0x932ax9,_0x932axa){return VoiceQueue[_0xd78c[19]](_0x932ax9[_0xd78c[26]][_0xd78c[25]])[_0xd78c[14]](function(_0x932axd){if(!_0x932axd){return _0x932axa[_0xd78c[24]](404)};return _0x932axa[_0xd78c[12]](_0x932axd)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})};exports[_0xd78c[27]]= function(_0x932ax9,_0x932axa){return VoiceQueue[_0xd78c[19]](_0x932ax9[_0xd78c[26]][_0xd78c[25]])[_0xd78c[14]](function(_0x932axf){if(!_0x932axf){return _0x932axa[_0xd78c[24]](404)};return _0x932axf[_0xd78c[32]]({where:{role:_0xd78c[29]},attributes:[_0xd78c[17],_0xd78c[25],_0xd78c[30],_0xd78c[31]]})})[_0xd78c[14]](function(_0x932axe){return _0x932axa[_0xd78c[13]](200)[_0xd78c[12]]({rows:_0x932axe,count:_0x932axe[_0xd78c[28]]})})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})};exports[_0xd78c[33]]= function(_0x932ax9,_0x932axa){return VoiceQueue[_0xd78c[33]](_0x932ax9[_0xd78c[44]])[_0xd78c[14]](function(_0x932axd){return _0x932axa[_0xd78c[13]](201)[_0xd78c[12]](_0x932axd)})[_0xd78c[11]](sequelize.UniqueConstraintError,function(_0x932axb){var _0x932ax10=[];_0x932axb[_0xd78c[38]][_0xd78c[37]](function(_0x932ax11){switch(_0x932ax11[_0xd78c[36]]){case _0xd78c[35]:_0x932ax10[_0xd78c[34]](_0xd78c[25]);break;default:_0x932ax10[_0xd78c[34]](_0x932ax11[_0xd78c[36]])}});_0x932ax10[_0xd78c[34]](_0xd78c[39]);_0x932axb[_0xd78c[40]]= _0x932ax10[_0xd78c[41]]();_0x932axb[_0xd78c[42]]= _0xd78c[43];return _0x932axa[_0xd78c[13]](500)[_0xd78c[12]](_0x932axb)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})};exports[_0xd78c[45]]= function(_0x932ax9,_0x932axa){if(_0x932ax9[_0xd78c[44]][_0xd78c[25]]){delete _0x932ax9[_0xd78c[44]][_0xd78c[25]]};return VoiceQueue[_0xd78c[19]](_0x932ax9[_0xd78c[26]][_0xd78c[25]])[_0xd78c[14]](function(_0x932axd){if(!_0x932axd){return _0x932axa[_0xd78c[24]](404)};var _0x932ax12=_[_0xd78c[47]](_0x932axd,_0x932ax9[_0xd78c[44]]);return _0x932ax12[_0xd78c[48]]()})[_0xd78c[14]](function(_0x932axd){return _0x932axa[_0xd78c[13]](200)[_0xd78c[12]](_0x932axd)})[_0xd78c[11]](function(_0x932axb){console[_0xd78c[46]](_0x932axb);return handleError(_0x932axa,_0x932axb)})};exports[_0xd78c[49]]= function(_0x932ax9,_0x932axa,_0x932ax13){return User[_0xd78c[56]]({where:{id:{$in:_0x932ax9[_0xd78c[44]][_0xd78c[55]]}}})[_0xd78c[14]](function(_0x932ax14){var _0x932ax15=_[_0xd78c[53]](_0x932ax14,function(_0x932ax16){return {queue:_0x932ax9[_0xd78c[26]][_0xd78c[25]],location:util[_0xd78c[51]](_0xd78c[50],_0x932ax16[_0xd78c[25]]),membername:_0x932ax16[_0xd78c[25]],UserId:_0x932ax16[_0xd78c[17]],penalty:_0x932ax9[_0xd78c[44]][_0xd78c[52]]}});return UserHasVoiceQueue[_0xd78c[54]](_0x932ax15,{individualHooks:true})})[_0xd78c[14]](function(){return _0x932axa[_0xd78c[24]](200)})[_0xd78c[11]](function(_0x932axb){console[_0xd78c[46]](_0x932axb);return _0x932ax13(_0x932axb)})};exports[_0xd78c[57]]= function(_0x932ax9,_0x932axa,_0x932ax13){return UserHasVoiceQueue[_0xd78c[58]]({where:{UserId:_0x932ax9[_0xd78c[15]][_0xd78c[55]],queue:_0x932ax9[_0xd78c[26]][_0xd78c[25]]},individualHooks:true})[_0xd78c[14]](function(){return _0x932axa[_0xd78c[24]](202)})[_0xd78c[11]](function(_0x932axb){return _0x932ax13(_0x932axb)})};exports[_0xd78c[58]]= function(_0x932ax9,_0x932axa){return VoiceQueue[_0xd78c[58]]({where:{name:_0x932ax9[_0xd78c[26]][_0xd78c[25]]},individualHooks:true})[_0xd78c[14]](function(){return _0x932axa[_0xd78c[24]](204)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})};exports[_0xd78c[59]]= function(_0x932ax9,_0x932axa){return VoiceQueue[_0xd78c[58]]({where:{name:_0x932ax9[_0xd78c[15]][_0xd78c[60]]},individualHooks:true})[_0xd78c[14]](function(){return _0x932axa[_0xd78c[24]](204)})[_0xd78c[11]](function(_0x932axb){return handleError(_0x932axa,_0x932axb)})};function handleError(_0x932axa,_0x932axb){return _0x932axa[_0xd78c[13]](500)[_0xd78c[12]](_0x932axb)}
\ No newline at end of file