Built motion from commit 8dae768.|0.0.121
[motion.git] / server / api / interval / interval.controller.js
index bf9eb8c..4ad4637 100644 (file)
@@ -1 +1 @@
-var _0x7215=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x67\x65\x74\x41\x6C\x6C","\x66\x69\x6E\x64\x41\x6C\x6C","\x69\x6E\x74\x65\x72\x76\x61\x6C\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x6E\x61\x6D\x65","\x62\x6F\x64\x79","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x69\x64","\x6C\x6F\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x73\x68\x6F\x77","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x46\x69\x6E\x64\x69\x6E\x67\x20\x61\x70\x70\x20\x72\x6F\x77\x2E\x2E\x2E\x2E\x2E","\x6C\x65\x6E\x67\x74\x68","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x53\x55\x42\x49\x4E\x54\x45\x52\x56\x41\x4C","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x49\x4E\x54\x45\x52\x56\x41\x4C","\x75\x70\x64\x61\x74\x65","\x50\x52\x49\x4D\x41\x52\x59","\x66\x69\x65\x6C\x64\x73","\x6D\x65\x73\x73\x61\x67\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C\x2F\x73\x75\x62\x69\x6E\x74\x65\x72\x76\x61\x6C\x20\x61\x6C\x72\x65\x61\x64\x79\x20\x65\x78\x69\x73\x74","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x64\x65\x73\x74\x72\x6F\x79","\x4D\x45\x53\x53\x41\x47\x45\x5F\x49\x4E\x54\x45\x52\x56\x41\x4C\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"];_0x7215[0];var _=require(_0x7215[1]);var Interval=require(_0x7215[3])[_0x7215[2]];var VoiceExtension=require(_0x7215[3])[_0x7215[4]];var sequelize=require(_0x7215[3])[_0x7215[5]];var Util=require(_0x7215[6]);exports[_0x7215[7]]=function(_0x56e6x6,_0x56e6x7,_0x56e6x8){return Interval[_0x7215[14]](Util[_0x7215[13]](_0x56e6x6[_0x7215[12]]))[_0x7215[11]](function(_0x56e6xa){_0x56e6x7[_0x7215[10]](200)[_0x7215[9]](_0x56e6xa)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[15]]=function(_0x56e6x6,_0x56e6x7){return Interval[_0x7215[16]]()[_0x7215[11]](function(_0x56e6xb){return _0x56e6x7[_0x7215[10]](200)[_0x7215[9]](_0x56e6xb)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[17]]=function(_0x56e6x6,_0x56e6x7){var _0x56e6xc={name:_0x56e6x6[_0x7215[19]][_0x7215[18]],IntervalId:_0x56e6x6[_0x7215[19]][_0x7215[20]]?_0x56e6x6[_0x7215[19]][_0x7215[20]]:null};if(_0x56e6x6[_0x7215[19]][_0x7215[21]]){_0x56e6xc[_0x7215[21]]={$ne:_0x56e6x6[_0x7215[19]][_0x7215[21]]}};console[_0x7215[22]](_0x56e6x6[_0x7215[19]]);Interval[_0x7215[16]]({where:_0x56e6xc})[_0x7215[11]](function(_0x56e6xb){if(!_0x56e6xb){return _0x56e6x7[_0x7215[23]](404)};return _0x56e6x7[_0x7215[9]](_0x56e6xb)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[24]]=function(_0x56e6x6,_0x56e6x7){return Interval[_0x7215[26]](_0x56e6x6[_0x7215[25]][_0x7215[21]],{include:[{all:true}]})[_0x7215[11]](function(_0x56e6xd){if(!_0x56e6xd){return _0x56e6x7[_0x7215[23]](404)};return _0x56e6x7[_0x7215[9]](_0x56e6xd)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[27]]=function(_0x56e6x6,_0x56e6x7){Interval[_0x7215[16]]({where:{name:_0x56e6x6[_0x7215[19]][_0x7215[18]],IntervalId:_0x56e6x6[_0x7215[19]][_0x7215[20]]?_0x56e6x6[_0x7215[19]][_0x7215[20]]:null}})[_0x7215[11]](function(_0x56e6xe){console[_0x7215[22]](_0x56e6xe);console[_0x7215[22]](_0x7215[28]);if(!_0x56e6xe){return _0x56e6x7[_0x7215[23]](404)};if(_0x56e6xe[_0x7215[29]]>0){return _0x56e6x7[_0x7215[10]](500)[_0x7215[9]]({message:_0x56e6x6[_0x7215[19]][_0x7215[20]]?_0x7215[30]:_0x7215[31]})};Interval[_0x7215[27]](_0x56e6x6[_0x7215[19]])[_0x7215[11]](function(_0x56e6xd){return _0x56e6x7[_0x7215[10]](201)[_0x7215[9]](_0x56e6xd)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[32]]=function(_0x56e6x6,_0x56e6x7){return sequelize[_0x7215[38]](function(_0x56e6xf){if(_0x56e6x6[_0x7215[19]][_0x7215[21]]){delete _0x56e6x6[_0x7215[19]][_0x7215[21]]};return Interval[_0x7215[32]](_0x56e6x6[_0x7215[19]],{where:{id:_0x56e6x6[_0x7215[25]][_0x7215[21]]},individualHooks:true})})[_0x7215[11]](function(){return _0x56e6x7[_0x7215[23]](200)})[_0x7215[8]](sequelize.UniqueConstraintError,function(_0x56e6x9){if(_0x56e6x9[_0x7215[34]][_0x7215[33]]){_0x56e6x9[_0x7215[35]]=_0x7215[36];_0x56e6x9[_0x7215[37]]=_0x7215[31]};return handleError(_0x56e6x7,_0x56e6x9)})[_0x7215[8]](function(_0x56e6x9){console[_0x7215[22]](_0x56e6x9);return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[39]]=function(_0x56e6x6,_0x56e6x7){return sequelize[_0x7215[38]](function(_0x56e6xf){return VoiceExtension[_0x7215[16]]({where:{IntervalId:_0x56e6x6[_0x7215[25]][_0x7215[21]]}})[_0x7215[11]](function(_0x56e6x10){if(_0x56e6x10[_0x7215[29]]>0){throw  new Error(_0x7215[40])}else {return Interval[_0x7215[39]]({where:{id:_0x56e6x6[_0x7215[25]][_0x7215[21]]},individualHooks:true})}})})[_0x7215[11]](function(){return _0x56e6x7[_0x7215[23]](204)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};exports[_0x7215[41]]=function(_0x56e6x6,_0x56e6x7){return sequelize[_0x7215[38]](function(_0x56e6xf){return VoiceExtension[_0x7215[16]]({where:{IntervalId:_0x56e6x6[_0x7215[12]][_0x7215[42]]}})[_0x7215[11]](function(_0x56e6x10){if(_0x56e6x10[_0x7215[29]]>0){throw  new Error(_0x7215[40])}else {return Interval[_0x7215[39]]({where:{id:_0x56e6x6[_0x7215[12]][_0x7215[21]]},individualHooks:true})}})})[_0x7215[11]](function(){return _0x56e6x7[_0x7215[23]](204)})[_0x7215[8]](function(_0x56e6x9){return handleError(_0x56e6x7,_0x56e6x9)})};function handleError(_0x56e6x7,_0x56e6x9){return _0x56e6x7[_0x7215[10]](500)[_0x7215[9]](_0x56e6x9)}
\ No newline at end of file
+var _0xb3ad=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x73\x75\x62\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x73\x63\x6F\x70\x65","\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\x72\x65\x61\x74\x65","\x6C\x6F\x67","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x61\x6C\x6C","\x61\x72\x65\x20\x74\x68\x65\x72\x65\x20\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x53\x75\x62\x49\x6E\x74\x65\x72\x76\x61\x6C\x73","\x6C\x65\x6E\x67\x74\x68","\x64\x65\x73\x74\x72\x6F\x79","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x79\x65\x73\x20\x74\x68\x65\x72\x65\x20\x61\x72\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x6D\x65\x73\x73\x61\x67\x65","\x54\x68\x65\x20\x49\x6E\x74\x65\x72\x76\x61\x6C\x20\x69\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x6F\x6E\x65\x20\x6F\x72\x20\x6D\x6F\x72\x65\x20\x72\x6F\x75\x74\x65\x73\x2C\x20\x64\x65\x6C\x65\x74\x65\x20\x74\x68\x65\x6D\x20\x66\x69\x72\x73\x74","\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\x49\x4E\x54\x45\x52\x56\x41\x4C\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"];_0xb3ad[0];var _=require(_0xb3ad[1]);var Interval=require(_0xb3ad[3])[_0xb3ad[2]];var VoiceExtension=require(_0xb3ad[3])[_0xb3ad[4]];var sequelize=require(_0xb3ad[3])[_0xb3ad[5]];var Util=require(_0xb3ad[6]);exports[_0xb3ad[7]]= function(_0xb0d6x6,_0xb0d6x7,_0xb0d6x8){return Interval[_0xb3ad[17]](_0xb3ad[15],_0xb3ad[16])[_0xb3ad[14]](Util[_0xb3ad[13]](_0xb0d6x6[_0xb3ad[12]]))[_0xb3ad[11]](function(_0xb0d6xa){_0xb0d6x7[_0xb3ad[10]](200)[_0xb3ad[9]](_0xb0d6xa)})[_0xb3ad[8]](function(_0xb0d6x9){return handleError(_0xb0d6x7,_0xb0d6x9)})};exports[_0xb3ad[18]]= function(_0xb0d6x6,_0xb0d6x7){return Interval[_0xb3ad[17]](_0xb3ad[16])[_0xb3ad[22]](_0xb0d6x6[_0xb3ad[21]][_0xb3ad[20]])[_0xb3ad[11]](function(_0xb0d6xb){if(!_0xb0d6xb){return _0xb0d6x7[_0xb3ad[19]](404)};return _0xb0d6x7[_0xb3ad[9]](_0xb0d6xb)})[_0xb3ad[8]](function(_0xb0d6x9){return handleError(_0xb0d6x7,_0xb0d6x9)})};exports[_0xb3ad[23]]= function(_0xb0d6x6,_0xb0d6x7){return Interval[_0xb3ad[17]](_0xb3ad[16])[_0xb3ad[23]](_0xb0d6x6[_0xb3ad[25]])[_0xb3ad[11]](function(_0xb0d6xb){return _0xb0d6x7[_0xb3ad[10]](201)[_0xb3ad[9]](_0xb0d6xb)})[_0xb3ad[8]](function(_0xb0d6x9){console[_0xb3ad[24]](_0xb0d6x9);return handleError(_0xb0d6x7,_0xb0d6x9)})};exports[_0xb3ad[26]]= function(_0xb0d6x6,_0xb0d6x7){return sequelize[_0xb3ad[32]](function(_0xb0d6xc){if(_0xb0d6x6[_0xb3ad[25]][_0xb3ad[20]]){delete _0xb0d6x6[_0xb3ad[25]][_0xb3ad[20]]};return Interval[_0xb3ad[26]](_0xb0d6x6[_0xb3ad[25]],{where:{id:_0xb0d6x6[_0xb3ad[21]][_0xb3ad[20]]},individualHooks:true,transaction:_0xb0d6xc})[_0xb3ad[11]](function(){if(_0xb0d6x6[_0xb3ad[25]][_0xb3ad[29]]){return Interval[_0xb3ad[31]]({where:{IntervalId:_0xb0d6x6[_0xb3ad[21]][_0xb3ad[20]]},transaction:_0xb0d6xc})}})[_0xb3ad[11]](function(){console[_0xb3ad[24]](_0xb3ad[28]);if(_0xb0d6x6[_0xb3ad[25]][_0xb3ad[29]]&& _0xb0d6x6[_0xb3ad[25]][_0xb3ad[29]][_0xb3ad[30]]){return _0xb0d6x6[_0xb3ad[21]][_0xb3ad[20]]}})[_0xb3ad[11]](bulkCreateSubIntervals(_0xb0d6x6[_0xb3ad[25]].SubIntervals,_0xb0d6xc))[_0xb3ad[27]]()})[_0xb3ad[11]](function(){return _0xb0d6x7[_0xb3ad[19]](200)})[_0xb3ad[8]](function(_0xb0d6x9){console[_0xb3ad[24]](_0xb0d6x9);return handleError(_0xb0d6x7,_0xb0d6x9)})};function bulkCreateSubIntervals(_0xb0d6xe,_0xb0d6xc){return function(_0xb0d6xf){if(_0xb0d6xf){console[_0xb3ad[24]](_0xb3ad[33]);var _0xb0d6x10=[];_0xb0d6xe[_0xb3ad[36]](function(_0xb0d6x11){delete _0xb0d6x11[_0xb3ad[20]];_0xb0d6x11[_0xb3ad[34]]= _0xb0d6xf;_0xb0d6x10[_0xb3ad[35]](Interval[_0xb3ad[23]](_0xb0d6x11,{transaction:_0xb0d6xc}))});return _0xb0d6x10}else {return []}}}exports[_0xb3ad[31]]= function(_0xb0d6x6,_0xb0d6x7){return sequelize[_0xb3ad[32]](function(_0xb0d6xc){return Interval[_0xb3ad[31]]({where:{id:_0xb0d6x6[_0xb3ad[21]][_0xb3ad[20]]},individualHooks:true,transaction:_0xb0d6xc})})[_0xb3ad[11]](function(){return _0xb0d6x7[_0xb3ad[19]](204)})[_0xb3ad[8]](sequelize.ForeignKeyConstraintError,function(_0xb0d6x9){_0xb0d6x9[_0xb3ad[37]]= _0xb3ad[38];_0xb0d6x9[_0xb3ad[39]]= _0xb3ad[40];return handleError(_0xb0d6x7,_0xb0d6x9)})[_0xb3ad[8]](function(_0xb0d6x9){return handleError(_0xb0d6x7,_0xb0d6x9)})};exports[_0xb3ad[41]]= function(_0xb0d6x6,_0xb0d6x7){return sequelize[_0xb3ad[32]](function(_0xb0d6xc){return Interval[_0xb3ad[31]]({where:{id:_0xb0d6x6[_0xb3ad[12]][_0xb3ad[42]]},individualHooks:true,transaction:_0xb0d6xc})})[_0xb3ad[11]](function(){return _0xb0d6x7[_0xb3ad[19]](204)})[_0xb3ad[8]](sequelize.ForeignKeyConstraintError,function(_0xb0d6x9){_0xb0d6x9[_0xb3ad[37]]= _0xb3ad[38];_0xb0d6x9[_0xb3ad[39]]= _0xb3ad[40];return handleError(_0xb0d6x7,_0xb0d6x9)})[_0xb3ad[8]](function(_0xb0d6x9){return handleError(_0xb0d6x7,_0xb0d6x9)})};function handleError(_0xb0d6x7,_0xb0d6x9){return _0xb0d6x7[_0xb3ad[10]](500)[_0xb3ad[9]](_0xb0d6x9)}
\ No newline at end of file