Built motion from commit b8fca89.|0.0.57
[motion.git] / server / api / voice_queue / voice_queue.controller.js
1 var _0x1c6a=["\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","\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","\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"];_0x1c6a[0];var _=require(_0x1c6a[1]);var util=require(_0x1c6a[2]);var Util=require(_0x1c6a[3]);var sequelize=require(_0x1c6a[5])[_0x1c6a[4]];var User=require(_0x1c6a[5])[_0x1c6a[6]];var VoiceQueue=require(_0x1c6a[5])[_0x1c6a[7]];var UserHasVoiceQueue=require(_0x1c6a[5])[_0x1c6a[8]];var VoiceExtension=require(_0x1c6a[5])[_0x1c6a[9]];exports[_0x1c6a[10]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[17]](Util[_0x1c6a[16]](_0x773bx9[_0x1c6a[15]]))[_0x1c6a[14]](function(_0x773bxc){_0x773bxa[_0x1c6a[13]](200)[_0x1c6a[12]](_0x773bxc)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[18]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[22]](_0x773bx9[_0x1c6a[21]][_0x1c6a[20]])[_0x1c6a[14]](function(_0x773bxd){if(!_0x773bxd){return _0x773bxa[_0x1c6a[19]](404)};return _0x773bxa[_0x1c6a[12]](_0x773bxd)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[23]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[22]](_0x773bx9[_0x1c6a[21]][_0x1c6a[20]])[_0x1c6a[14]](function(_0x773bxf){if(!_0x773bxf){return _0x773bxa[_0x1c6a[19]](404)};return _0x773bxf[_0x1c6a[28]]({where:{role:_0x1c6a[24]},attributes:[_0x1c6a[25],_0x1c6a[20],_0x1c6a[26],_0x1c6a[27]]})})[_0x1c6a[14]](function(_0x773bxe){return _0x773bxa[_0x1c6a[13]](200)[_0x1c6a[12]](_0x773bxe)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[29]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[31]]({where:{name:_0x773bx9[_0x1c6a[30]][_0x1c6a[20]]}})[_0x1c6a[14]](function(_0x773bxd){if(!_0x773bxd){return _0x773bxa[_0x1c6a[19]](404)};return _0x773bxa[_0x1c6a[12]](_0x773bxd)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[32]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[32]](_0x773bx9[_0x1c6a[30]])[_0x1c6a[14]](function(_0x773bxd){return _0x773bxa[_0x1c6a[13]](201)[_0x1c6a[12]](_0x773bxd)})[_0x1c6a[11]](sequelize.UniqueConstraintError,function(_0x773bxb){if(_0x773bxb[_0x1c6a[34]][_0x1c6a[33]]){_0x773bxb[_0x1c6a[35]]=_0x1c6a[36]};return handleError(_0x773bxa,_0x773bxb)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[37]]=function(_0x773bx9,_0x773bxa){if(_0x773bx9[_0x1c6a[30]][_0x1c6a[20]]){delete _0x773bx9[_0x1c6a[30]][_0x1c6a[20]]};return VoiceQueue[_0x1c6a[22]](_0x773bx9[_0x1c6a[21]][_0x1c6a[20]])[_0x1c6a[14]](function(_0x773bxd){if(!_0x773bxd){return _0x773bxa[_0x1c6a[19]](404)};var _0x773bx10=_[_0x1c6a[39]](_0x773bxd,_0x773bx9[_0x1c6a[30]]);return _0x773bx10[_0x1c6a[40]]()})[_0x1c6a[14]](function(_0x773bxd){return _0x773bxa[_0x1c6a[13]](200)[_0x1c6a[12]](_0x773bxd)})[_0x1c6a[11]](function(_0x773bxb){console[_0x1c6a[38]](_0x773bxb);return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[41]]=function(_0x773bx9,_0x773bxa,_0x773bx11){return User[_0x1c6a[31]]({where:{id:{$in:_0x773bx9[_0x1c6a[30]][_0x1c6a[47]]}}})[_0x1c6a[14]](function(_0x773bx12){var _0x773bx13=_[_0x1c6a[45]](_0x773bx12,function(_0x773bx14){return {queue:_0x773bx9[_0x1c6a[21]][_0x1c6a[20]],location:util[_0x1c6a[43]](_0x1c6a[42],_0x773bx14[_0x1c6a[20]]),membername:_0x773bx14[_0x1c6a[20]],VoiceQueueName:_0x773bx9[_0x1c6a[21]][_0x1c6a[20]],UserId:_0x773bx14[_0x1c6a[25]],penalty:_0x773bx9[_0x1c6a[30]][_0x1c6a[44]]}});return UserHasVoiceQueue[_0x1c6a[46]](_0x773bx13,{individualHooks:true})})[_0x1c6a[14]](function(){return _0x773bxa[_0x1c6a[19]](200)})[_0x1c6a[11]](function(_0x773bxb){return _0x773bx11(_0x773bxb)})};exports[_0x1c6a[48]]=function(_0x773bx9,_0x773bxa,_0x773bx11){return VoiceQueue[_0x1c6a[22]](_0x773bx9[_0x1c6a[21]][_0x1c6a[20]])[_0x1c6a[14]](function(_0x773bxf){if(!_0x773bxf){return _0x773bxa[_0x1c6a[19]](404)};return _0x773bxf[_0x1c6a[49]](_0x773bx9[_0x1c6a[15]][_0x1c6a[47]])})[_0x1c6a[14]](function(){return _0x773bxa[_0x1c6a[19]](202)})[_0x1c6a[11]](function(_0x773bxb){return _0x773bx11(_0x773bxb)})};exports[_0x1c6a[50]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[22]](_0x773bx9[_0x1c6a[21]][_0x1c6a[20]])[_0x1c6a[14]](function(_0x773bxd){if(!_0x773bxd){return _0x773bxa[_0x1c6a[19]](404)};return _0x773bxd[_0x1c6a[50]]()})[_0x1c6a[14]](function(){return _0x773bxa[_0x1c6a[19]](204)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};exports[_0x1c6a[51]]=function(_0x773bx9,_0x773bxa){return VoiceQueue[_0x1c6a[31]]({where:{name:_0x773bx9[_0x1c6a[15]][_0x1c6a[54]]}})[_0x1c6a[14]](function(_0x773bx16){if(!_0x773bx16){return _0x773bxa[_0x1c6a[19]](404)};var _0x773bx17=_[_0x1c6a[45]](_0x773bx16,_0x1c6a[20]);return VoiceExtension[_0x1c6a[31]]({where:{queue:_0x773bx17}})})[_0x1c6a[14]](function(_0x773bx15){if(_0x773bx15[_0x1c6a[52]]>0){return _0x773bxa[_0x1c6a[13]](500)[_0x1c6a[12]]({message:_0x1c6a[53]})};return VoiceQueue[_0x1c6a[50]]({where:{name:_0x773bx9[_0x1c6a[15]][_0x1c6a[54]]},individualHooks:true})})[_0x1c6a[14]](function(){return _0x773bxa[_0x1c6a[19]](204)})[_0x1c6a[11]](function(_0x773bxb){return handleError(_0x773bxa,_0x773bxb)})};function handleError(_0x773bxa,_0x773bxb){return _0x773bxa[_0x1c6a[13]](500)[_0x1c6a[12]](_0x773bxb)}