f4d19f91314ba50159fac42e21f6fe95248cbac9
[motion.git] / server / api / voice_context / voice_context.controller.js
1 var _0x999f=["\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","\x56\x6F\x69\x63\x65\x43\x6F\x6E\x74\x65\x78\x74","\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","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x6F\x6E\x74\x65\x78\x74\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x6E\x61\x6D\x65","\x62\x6F\x64\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x72\x65\x61\x74\x65","\x6C\x65\x6E\x67\x74\x68","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x52\x4F\x55\x54\x45","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x65\x72\x72","\x6C\x6F\x67","\x4D\x45\x53\x53\x41\x47\x45\x5F\x43\x4F\x4E\x54\x45\x58\x54\x5F\x52\x4F\x55\x54\x45\x5F\x41\x53\x53\x4F\x43\x49\x41\x54\x45\x44","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6D\x61\x70"];_0x999f[0];var _=require(_0x999f[1]);var util=require(_0x999f[2]);var Util=require(_0x999f[3]);var sequelize=require(_0x999f[5])[_0x999f[4]];var VoiceContext=require(_0x999f[5])[_0x999f[6]];var VoiceExtension=require(_0x999f[5])[_0x999f[7]];exports[_0x999f[8]]=function(_0x34a9x7,_0x34a9x8,_0x34a9x9){return VoiceContext[_0x999f[15]](Util[_0x999f[14]](_0x34a9x7[_0x999f[13]]))[_0x999f[12]](function(_0x34a9xb){_0x34a9x8[_0x999f[11]](200)[_0x999f[10]](_0x34a9xb)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[16]]=function(_0x34a9x7,_0x34a9x8){return VoiceContext[_0x999f[20]](_0x34a9x7[_0x999f[19]][_0x999f[18]])[_0x999f[12]](function(_0x34a9xc){if(!_0x34a9xc){return _0x34a9x8[_0x999f[17]](404)};return _0x34a9x8[_0x999f[10]](_0x34a9xc)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[21]]=function(_0x34a9x7,_0x34a9x8){return VoiceContext[_0x999f[24]]({where:{name:_0x34a9x7[_0x999f[23]][_0x999f[22]]}})[_0x999f[12]](function(_0x34a9xd){if(!_0x34a9xd){return _0x34a9x8[_0x999f[17]](404)};return _0x34a9x8[_0x999f[10]](_0x34a9xd)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[25]]=function(_0x34a9x7,_0x34a9x8){return VoiceContext[_0x999f[24]]({where:{name:_0x34a9x7[_0x999f[23]][_0x999f[22]]}})[_0x999f[12]](function(_0x34a9xe){if(!_0x34a9xe){return _0x34a9x8[_0x999f[17]](404)};if(_0x34a9xe[_0x999f[26]]>0){return _0x34a9x8[_0x999f[11]](500)[_0x999f[10]]({message:_0x999f[27]})};return VoiceContext[_0x999f[25]](_0x34a9x7[_0x999f[23]],{include:[{model:VoiceExtension}]})})[_0x999f[12]](function(_0x34a9xc){return _0x34a9x8[_0x999f[11]](201)[_0x999f[10]](_0x34a9xc)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[28]]=function(_0x34a9x7,_0x34a9x8){return VoiceContext[_0x999f[24]]({where:{name:_0x34a9x7[_0x999f[23]][_0x999f[22]],id:{$ne:_0x34a9x7[_0x999f[23]][_0x999f[18]]}}})[_0x999f[12]](function(_0x34a9xe){if(!_0x34a9xe){return _0x34a9x8[_0x999f[17]](404)};if(_0x34a9xe[_0x999f[26]]>0){return _0x34a9x8[_0x999f[11]](500)[_0x999f[10]]({message:_0x999f[27]})};if(_0x34a9x7[_0x999f[23]][_0x999f[18]]){delete _0x34a9x7[_0x999f[23]][_0x999f[18]]};return VoiceContext[_0x999f[20]](_0x34a9x7[_0x999f[19]][_0x999f[18]])})[_0x999f[12]](function(_0x34a9xc){if(!_0x34a9xc){return _0x34a9x8[_0x999f[17]](404)};var _0x34a9xf=_[_0x999f[29]](_0x34a9xc,_0x34a9x7[_0x999f[23]]);return _0x34a9xf[_0x999f[30]]()})[_0x999f[12]](function(_0x34a9xc){return _0x34a9x8[_0x999f[11]](200)[_0x999f[10]](_0x34a9xc)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[31]]=function(_0x34a9x7,_0x34a9x8){var _0x34a9x10;return VoiceContext[_0x999f[20]](_0x34a9x7[_0x999f[19]][_0x999f[18]])[_0x999f[12]](function(_0x34a9xc){_0x34a9x10=_0x34a9xc;if(!_0x34a9x10){return _0x34a9x8[_0x999f[17]](404)};return VoiceExtension[_0x999f[24]]({where:{context:_0x34a9x10[_0x999f[22]],VoiceContextId:null}})})[_0x999f[12]](function(_0x34a9x11){console[_0x999f[33]](_0x34a9x11);if(_0x34a9x11[_0x999f[26]]>0){return _0x34a9x8[_0x999f[11]](500)[_0x999f[10]]({message:_0x999f[34]})};return _0x34a9x10[_0x999f[31]]()})[_0x999f[12]](function(){return _0x34a9x8[_0x999f[17]](204)})[_0x999f[9]](function(_0x34a9xa){console[_0x999f[33]](_0x999f[32],_0x34a9xa);return handleError(_0x34a9x8,_0x34a9xa)})};exports[_0x999f[35]]=function(_0x34a9x7,_0x34a9x8){var _0x34a9x12;return VoiceContext[_0x999f[24]]({where:{id:_0x34a9x7[_0x999f[13]][_0x999f[36]]}})[_0x999f[12]](function(_0x34a9xd){_0x34a9x12=_0x34a9xd;if(!_0x34a9x12){return _0x34a9x8[_0x999f[17]](404)};var _0x34a9x13=_[_0x999f[38]](_[_0x999f[38]](_0x34a9x12,_0x999f[37]),_0x999f[22]);return VoiceExtension[_0x999f[24]]({where:{context:_0x34a9x13}})})[_0x999f[12]](function(_0x34a9x11){if(_0x34a9x11[_0x999f[26]]>_0x34a9x12[_0x999f[26]]){return _0x34a9x8[_0x999f[11]](500)[_0x999f[10]]({message:_0x999f[34]})};return VoiceContext[_0x999f[31]]({where:{id:_0x34a9x7[_0x999f[13]][_0x999f[36]]},individualHooks:true})})[_0x999f[12]](function(){return _0x34a9x8[_0x999f[17]](204)})[_0x999f[9]](function(_0x34a9xa){return handleError(_0x34a9x8,_0x34a9xa)})};function handleError(_0x34a9x8,_0x34a9xa){return _0x34a9x8[_0x999f[11]](500)[_0x999f[10]](_0x34a9xa)}