Built motion from commit 65070aa.|0.0.108
[motion.git] / server / api / interval / interval.controller.js
index 1b2d51e..effa34b 100644 (file)
@@ -1 +1 @@
-var _0xefc4=["\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","\x75\x74\x69\x6C","\x69\x6E\x64\x65\x78","\x6E\x61\x6D\x65","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\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","\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","\x69\x6E\x74\x65\x72\x76\x61\x6C\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x62\x6F\x64\x79","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x6C\x6F\x67","\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"];_0xefc4[0];var _=require(_0xefc4[1]);var Interval=require(_0xefc4[3])[_0xefc4[2]];var VoiceExtension=require(_0xefc4[3])[_0xefc4[4]];var sequelize=require(_0xefc4[3])[_0xefc4[5]];var util=require(_0xefc4[6]);exports[_0xefc4[7]]=function(_0xe48dx6,_0xe48dx7){var _0xe48dx8=[_0xefc4[8]];var _0xe48dx9=_0xe48dx6[_0xefc4[10]][_0xefc4[9]]?parseInt(_0xe48dx6[_0xefc4[10]][_0xefc4[9]],10):100;var _0xe48dxa=_0xe48dx6[_0xefc4[10]][_0xefc4[11]]?parseInt(_0xe48dx6[_0xefc4[10]][_0xefc4[11]],10):0;var _0xe48dxb={where:{IntervalId:null},limit:_0xe48dx9,offset:_0xe48dxa*_0xe48dx9};_[_0xefc4[25]](_0xe48dx6[_0xefc4[10]],function(_0xe48dxc,_0xe48dxd){switch(_0xe48dxd){case _0xefc4[9]:;case _0xefc4[11]:break;case _0xefc4[14]:_0xe48dxb[_0xefc4[12]]=util[_0xefc4[17]](_0xefc4[13],_0xe48dx6[_0xefc4[10]][_0xefc4[14]],_0xe48dx6[_0xefc4[10]][_0xefc4[15]]||_0xefc4[16])||null;break;case _0xefc4[15]:break;case _0xefc4[23]:_0xe48dxb[_0xefc4[19]][_0xefc4[18]]=[];_0xe48dx8[_0xefc4[22]](function(_0xe48dxe){var _0xe48dxf={};_0xe48dxf[_0xe48dxe]={$like:_0xefc4[20]+_0xe48dxc+_0xefc4[20]};_0xe48dxb[_0xefc4[19]][_0xefc4[18]][_0xefc4[21]](_0xe48dxf)});break;default:_0xe48dxb[_0xefc4[19]][_0xe48dxd]={$like:{}};_0xe48dxb[_0xefc4[19]][_0xe48dxd][_0xefc4[24]]=_0xefc4[20]+_0xe48dxc+_0xefc4[20]}});Interval[_0xefc4[30]](_0xe48dxb)[_0xefc4[29]](function(_0xe48dx11){return _0xe48dx7[_0xefc4[28]](200)[_0xefc4[27]](_0xe48dx11)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[31]]=function(_0xe48dx6,_0xe48dx7){return Interval[_0xefc4[32]]()[_0xefc4[29]](function(_0xe48dx11){return _0xe48dx7[_0xefc4[28]](200)[_0xefc4[27]](_0xe48dx11)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[33]]=function(_0xe48dx6,_0xe48dx7){return Interval[_0xefc4[37]](_0xe48dx6[_0xefc4[36]][_0xefc4[35]],{include:[{all:true}]})[_0xefc4[29]](function(_0xe48dx12){if(!_0xe48dx12){return _0xe48dx7[_0xefc4[34]](404)};return _0xe48dx7[_0xefc4[27]](_0xe48dx12)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[38]]=function(_0xe48dx6,_0xe48dx7){var _0xe48dx13={name:_0xe48dx6[_0xefc4[39]][_0xefc4[8]],IntervalId:_0xe48dx6[_0xefc4[39]][_0xefc4[40]]?_0xe48dx6[_0xefc4[39]][_0xefc4[40]]:null};if(_0xe48dx6[_0xefc4[39]][_0xefc4[35]]){_0xe48dx13[_0xefc4[35]]={$ne:_0xe48dx6[_0xefc4[39]][_0xefc4[35]]}};console[_0xefc4[41]](_0xe48dx6[_0xefc4[39]]);Interval[_0xefc4[32]]({where:_0xe48dx13})[_0xefc4[29]](function(_0xe48dx11){if(!_0xe48dx11){return _0xe48dx7[_0xefc4[34]](404)};return _0xe48dx7[_0xefc4[27]](_0xe48dx11)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[42]]=function(_0xe48dx6,_0xe48dx7){Interval[_0xefc4[32]]({where:{name:_0xe48dx6[_0xefc4[39]][_0xefc4[8]],IntervalId:_0xe48dx6[_0xefc4[39]][_0xefc4[40]]?_0xe48dx6[_0xefc4[39]][_0xefc4[40]]:null}})[_0xefc4[29]](function(_0xe48dx14){console[_0xefc4[41]](_0xe48dx14);console[_0xefc4[41]](_0xefc4[43]);if(!_0xe48dx14){return _0xe48dx7[_0xefc4[34]](404)};if(_0xe48dx14[_0xefc4[44]]>0){return _0xe48dx7[_0xefc4[28]](500)[_0xefc4[27]]({message:_0xe48dx6[_0xefc4[39]][_0xefc4[40]]?_0xefc4[45]:_0xefc4[46]})};Interval[_0xefc4[42]](_0xe48dx6[_0xefc4[39]])[_0xefc4[29]](function(_0xe48dx12){return _0xe48dx7[_0xefc4[28]](201)[_0xefc4[27]](_0xe48dx12)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[47]]=function(_0xe48dx6,_0xe48dx7){return sequelize[_0xefc4[53]](function(_0xe48dx15){if(_0xe48dx6[_0xefc4[39]][_0xefc4[35]]){delete _0xe48dx6[_0xefc4[39]][_0xefc4[35]]};return Interval[_0xefc4[47]](_0xe48dx6[_0xefc4[39]],{where:{id:_0xe48dx6[_0xefc4[36]][_0xefc4[35]]},individualHooks:true})})[_0xefc4[29]](function(){return _0xe48dx7[_0xefc4[34]](200)})[_0xefc4[26]](sequelize.UniqueConstraintError,function(_0xe48dx10){if(_0xe48dx10[_0xefc4[49]][_0xefc4[48]]){_0xe48dx10[_0xefc4[50]]=_0xefc4[51];_0xe48dx10[_0xefc4[52]]=_0xefc4[46]};return handleError(_0xe48dx7,_0xe48dx10)})[_0xefc4[26]](function(_0xe48dx10){console[_0xefc4[41]](_0xe48dx10);return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[54]]=function(_0xe48dx6,_0xe48dx7){return sequelize[_0xefc4[53]](function(_0xe48dx15){return VoiceExtension[_0xefc4[32]]({where:{IntervalId:_0xe48dx6[_0xefc4[36]][_0xefc4[35]]}})[_0xefc4[29]](function(_0xe48dx16){if(_0xe48dx16[_0xefc4[44]]>0){throw  new Error(_0xefc4[55])}else {return Interval[_0xefc4[54]]({where:{id:_0xe48dx6[_0xefc4[36]][_0xefc4[35]]},individualHooks:true})}})})[_0xefc4[29]](function(){return _0xe48dx7[_0xefc4[34]](204)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};exports[_0xefc4[56]]=function(_0xe48dx6,_0xe48dx7){return sequelize[_0xefc4[53]](function(_0xe48dx15){return VoiceExtension[_0xefc4[32]]({where:{IntervalId:_0xe48dx6[_0xefc4[10]][_0xefc4[35]]}})[_0xefc4[29]](function(_0xe48dx16){if(_0xe48dx16[_0xefc4[44]]>0){throw  new Error(_0xefc4[55])}else {return Interval[_0xefc4[54]]({where:{id:_0xe48dx6[_0xefc4[10]][_0xefc4[35]]},individualHooks:true})}})})[_0xefc4[29]](function(){return _0xe48dx7[_0xefc4[34]](204)})[_0xefc4[26]](function(_0xe48dx10){return handleError(_0xe48dx7,_0xe48dx10)})};function handleError(_0xe48dx7,_0xe48dx10){return _0xe48dx7[_0xefc4[28]](500)[_0xefc4[27]](_0xe48dx10)}
\ No newline at end of file
+var _0x6dd4=["\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"];_0x6dd4[0];var _=require(_0x6dd4[1]);var Interval=require(_0x6dd4[3])[_0x6dd4[2]];var VoiceExtension=require(_0x6dd4[3])[_0x6dd4[4]];var sequelize=require(_0x6dd4[3])[_0x6dd4[5]];var Util=require(_0x6dd4[6]);exports[_0x6dd4[7]]=function(_0xe7bax6,_0xe7bax7,_0xe7bax8){return Interval[_0x6dd4[17]](_0x6dd4[15],_0x6dd4[16])[_0x6dd4[14]](Util[_0x6dd4[13]](_0xe7bax6[_0x6dd4[12]]))[_0x6dd4[11]](function(_0xe7baxa){_0xe7bax7[_0x6dd4[10]](200)[_0x6dd4[9]](_0xe7baxa)})[_0x6dd4[8]](function(_0xe7bax9){return handleError(_0xe7bax7,_0xe7bax9)})};exports[_0x6dd4[18]]=function(_0xe7bax6,_0xe7bax7){return Interval[_0x6dd4[17]](_0x6dd4[16])[_0x6dd4[22]](_0xe7bax6[_0x6dd4[21]][_0x6dd4[20]])[_0x6dd4[11]](function(_0xe7baxb){if(!_0xe7baxb){return _0xe7bax7[_0x6dd4[19]](404)};return _0xe7bax7[_0x6dd4[9]](_0xe7baxb)})[_0x6dd4[8]](function(_0xe7bax9){return handleError(_0xe7bax7,_0xe7bax9)})};exports[_0x6dd4[23]]=function(_0xe7bax6,_0xe7bax7){return Interval[_0x6dd4[17]](_0x6dd4[16])[_0x6dd4[23]](_0xe7bax6[_0x6dd4[25]])[_0x6dd4[11]](function(_0xe7baxb){return _0xe7bax7[_0x6dd4[10]](201)[_0x6dd4[9]](_0xe7baxb)})[_0x6dd4[8]](function(_0xe7bax9){console[_0x6dd4[24]](_0xe7bax9);return handleError(_0xe7bax7,_0xe7bax9)})};exports[_0x6dd4[26]]=function(_0xe7bax6,_0xe7bax7){return sequelize[_0x6dd4[32]](function(_0xe7baxc){if(_0xe7bax6[_0x6dd4[25]][_0x6dd4[20]]){delete _0xe7bax6[_0x6dd4[25]][_0x6dd4[20]]};return Interval[_0x6dd4[26]](_0xe7bax6[_0x6dd4[25]],{where:{id:_0xe7bax6[_0x6dd4[21]][_0x6dd4[20]]},individualHooks:true,transaction:_0xe7baxc})[_0x6dd4[11]](function(){if(_0xe7bax6[_0x6dd4[25]][_0x6dd4[29]]){return Interval[_0x6dd4[31]]({where:{IntervalId:_0xe7bax6[_0x6dd4[21]][_0x6dd4[20]]},transaction:_0xe7baxc})}})[_0x6dd4[11]](function(){console[_0x6dd4[24]](_0x6dd4[28]);if(_0xe7bax6[_0x6dd4[25]][_0x6dd4[29]]&&_0xe7bax6[_0x6dd4[25]][_0x6dd4[29]][_0x6dd4[30]]){return _0xe7bax6[_0x6dd4[21]][_0x6dd4[20]]}})[_0x6dd4[11]](bulkCreateSubIntervals(_0xe7bax6[_0x6dd4[25]].SubIntervals,_0xe7baxc))[_0x6dd4[27]]()})[_0x6dd4[11]](function(){return _0xe7bax7[_0x6dd4[19]](200)})[_0x6dd4[8]](function(_0xe7bax9){console[_0x6dd4[24]](_0xe7bax9);return handleError(_0xe7bax7,_0xe7bax9)})};function bulkCreateSubIntervals(_0xe7baxe,_0xe7baxc){return function(_0xe7baxf){if(_0xe7baxf){console[_0x6dd4[24]](_0x6dd4[33]);var _0xe7bax10=[];_0xe7baxe[_0x6dd4[36]](function(_0xe7bax11){delete _0xe7bax11[_0x6dd4[20]];_0xe7bax11[_0x6dd4[34]]=_0xe7baxf;_0xe7bax10[_0x6dd4[35]](Interval[_0x6dd4[23]](_0xe7bax11,{transaction:_0xe7baxc}))});return _0xe7bax10}else {return []}}}exports[_0x6dd4[31]]=function(_0xe7bax6,_0xe7bax7){return sequelize[_0x6dd4[32]](function(_0xe7baxc){return Interval[_0x6dd4[31]]({where:{id:_0xe7bax6[_0x6dd4[21]][_0x6dd4[20]]},individualHooks:true,transaction:_0xe7baxc})})[_0x6dd4[11]](function(){return _0xe7bax7[_0x6dd4[19]](204)})[_0x6dd4[8]](sequelize.ForeignKeyConstraintError,function(_0xe7bax9){_0xe7bax9[_0x6dd4[37]]=_0x6dd4[38];_0xe7bax9[_0x6dd4[39]]=_0x6dd4[40];return handleError(_0xe7bax7,_0xe7bax9)})[_0x6dd4[8]](function(_0xe7bax9){return handleError(_0xe7bax7,_0xe7bax9)})};exports[_0x6dd4[41]]=function(_0xe7bax6,_0xe7bax7){return sequelize[_0x6dd4[32]](function(_0xe7baxc){return Interval[_0x6dd4[31]]({where:{id:_0xe7bax6[_0x6dd4[12]][_0x6dd4[42]]},individualHooks:true,transaction:_0xe7baxc})})[_0x6dd4[11]](function(){return _0xe7bax7[_0x6dd4[19]](204)})[_0x6dd4[8]](sequelize.ForeignKeyConstraintError,function(_0xe7bax9){_0xe7bax9[_0x6dd4[37]]=_0x6dd4[38];_0xe7bax9[_0x6dd4[39]]=_0x6dd4[40];return handleError(_0xe7bax7,_0xe7bax9)})[_0x6dd4[8]](function(_0xe7bax9){return handleError(_0xe7bax7,_0xe7bax9)})};function handleError(_0xe7bax7,_0xe7bax9){return _0xe7bax7[_0x6dd4[10]](500)[_0x6dd4[9]](_0xe7bax9)}
\ No newline at end of file