Built motion from commit 5fc88b3.|0.0.60
[motion.git] / server / api / voice_queue / voice_queue.controller.js
1 var _0xafc2=["\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","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xafc2[0];var _=require(_0xafc2[1]);var util=require(_0xafc2[2]);var Util=require(_0xafc2[3]);var sequelize=require(_0xafc2[5])[_0xafc2[4]];var User=require(_0xafc2[5])[_0xafc2[6]];var VoiceQueue=require(_0xafc2[5])[_0xafc2[7]];var UserHasVoiceQueue=require(_0xafc2[5])[_0xafc2[8]];var VoiceExtension=require(_0xafc2[5])[_0xafc2[9]];exports[_0xafc2[10]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[17]](Util[_0xafc2[16]](_0x4cb0x9[_0xafc2[15]]))[_0xafc2[14]](function(_0x4cb0xc){_0x4cb0xa[_0xafc2[13]](200)[_0xafc2[12]](_0x4cb0xc)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[18]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[22]](_0x4cb0x9[_0xafc2[21]][_0xafc2[20]])[_0xafc2[14]](function(_0x4cb0xd){if(!_0x4cb0xd){return _0x4cb0xa[_0xafc2[19]](404)};return _0x4cb0xa[_0xafc2[12]](_0x4cb0xd)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[23]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[22]](_0x4cb0x9[_0xafc2[21]][_0xafc2[20]])[_0xafc2[14]](function(_0x4cb0xf){if(!_0x4cb0xf){return _0x4cb0xa[_0xafc2[19]](404)};return _0x4cb0xf[_0xafc2[28]]({where:{role:_0xafc2[24]},attributes:[_0xafc2[25],_0xafc2[20],_0xafc2[26],_0xafc2[27]]})})[_0xafc2[14]](function(_0x4cb0xe){return _0x4cb0xa[_0xafc2[13]](200)[_0xafc2[12]](_0x4cb0xe)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[29]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[31]]({where:{name:_0x4cb0x9[_0xafc2[30]][_0xafc2[20]]}})[_0xafc2[14]](function(_0x4cb0xd){if(!_0x4cb0xd){return _0x4cb0xa[_0xafc2[19]](404)};return _0x4cb0xa[_0xafc2[12]](_0x4cb0xd)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[32]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[32]](_0x4cb0x9[_0xafc2[30]])[_0xafc2[14]](function(_0x4cb0xd){return _0x4cb0xa[_0xafc2[13]](201)[_0xafc2[12]](_0x4cb0xd)})[_0xafc2[11]](sequelize.UniqueConstraintError,function(_0x4cb0xb){if(_0x4cb0xb[_0xafc2[34]][_0xafc2[33]]){_0x4cb0xb[_0xafc2[35]]=_0xafc2[36]};return handleError(_0x4cb0xa,_0x4cb0xb)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[37]]=function(_0x4cb0x9,_0x4cb0xa){if(_0x4cb0x9[_0xafc2[30]][_0xafc2[20]]){delete _0x4cb0x9[_0xafc2[30]][_0xafc2[20]]};return VoiceQueue[_0xafc2[22]](_0x4cb0x9[_0xafc2[21]][_0xafc2[20]])[_0xafc2[14]](function(_0x4cb0xd){if(!_0x4cb0xd){return _0x4cb0xa[_0xafc2[19]](404)};var _0x4cb0x10=_[_0xafc2[39]](_0x4cb0xd,_0x4cb0x9[_0xafc2[30]]);return _0x4cb0x10[_0xafc2[40]]()})[_0xafc2[14]](function(_0x4cb0xd){return _0x4cb0xa[_0xafc2[13]](200)[_0xafc2[12]](_0x4cb0xd)})[_0xafc2[11]](function(_0x4cb0xb){console[_0xafc2[38]](_0x4cb0xb);return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[41]]=function(_0x4cb0x9,_0x4cb0xa,_0x4cb0x11){return User[_0xafc2[31]]({where:{id:{$in:_0x4cb0x9[_0xafc2[30]][_0xafc2[47]]}}})[_0xafc2[14]](function(_0x4cb0x12){var _0x4cb0x13=_[_0xafc2[45]](_0x4cb0x12,function(_0x4cb0x14){return {queue:_0x4cb0x9[_0xafc2[21]][_0xafc2[20]],location:util[_0xafc2[43]](_0xafc2[42],_0x4cb0x14[_0xafc2[20]]),membername:_0x4cb0x14[_0xafc2[20]],UserId:_0x4cb0x14[_0xafc2[25]],penalty:_0x4cb0x9[_0xafc2[30]][_0xafc2[44]]}});return UserHasVoiceQueue[_0xafc2[46]](_0x4cb0x13,{individualHooks:true})})[_0xafc2[14]](function(){return _0x4cb0xa[_0xafc2[19]](200)})[_0xafc2[11]](function(_0x4cb0xb){return _0x4cb0x11(_0x4cb0xb)})};exports[_0xafc2[48]]=function(_0x4cb0x9,_0x4cb0xa,_0x4cb0x11){return UserHasVoiceQueue[_0xafc2[49]]({where:{UserId:_0x4cb0x9[_0xafc2[15]][_0xafc2[47]],queue:_0x4cb0x9[_0xafc2[21]][_0xafc2[20]]},individualHooks:true})[_0xafc2[14]](function(){return _0x4cb0xa[_0xafc2[19]](202)})[_0xafc2[11]](function(_0x4cb0xb){return _0x4cb0x11(_0x4cb0xb)})};exports[_0xafc2[49]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[49]]({where:{name:_0x4cb0x9[_0xafc2[21]][_0xafc2[20]]},individualHooks:true})[_0xafc2[14]](function(){return _0x4cb0xa[_0xafc2[19]](204)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};exports[_0xafc2[50]]=function(_0x4cb0x9,_0x4cb0xa){return VoiceQueue[_0xafc2[49]]({where:{name:_0x4cb0x9[_0xafc2[15]][_0xafc2[51]]},individualHooks:true})[_0xafc2[14]](function(){return _0x4cb0xa[_0xafc2[19]](204)})[_0xafc2[11]](function(_0x4cb0xb){return handleError(_0x4cb0xa,_0x4cb0xb)})};function handleError(_0x4cb0xa,_0x4cb0xb){return _0x4cb0xa[_0xafc2[13]](500)[_0xafc2[12]](_0x4cb0xb)}