Built motion from commit 4d2cf597c.|1.0.26
[motion.git] / server / api / trigger / trigger.controller.js
index a73b6bb..7aefcae 100644 (file)
@@ -1 +1 @@
-var _0xb09c=["\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","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x54\x72\x69\x67\x67\x65\x72","\x54\x6F\x6F\x6C\x73\x43\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x54\x6F\x6F\x6C\x73\x41\x63\x74\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","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x6C\x6C","\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","\x62\x6F\x64\x79","\x41\x6C\x6C","\x41\x6E\x79","\x41\x63\x74\x69\x6F\x6E\x73","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x54\x72\x69\x67\x67\x65\x72\x49\x64","\x66\x6F\x72\x45\x61\x63\x68","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x54\x72\x69\x67\x67\x65\x72\x41\x6C\x6C\x49\x64","\x54\x72\x69\x67\x67\x65\x72\x41\x6E\x79\x49\x64","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xb09c[0];var _=require(_0xb09c[1]);var util=require(_0xb09c[2]);var Util=require(_0xb09c[3]);var sequelize=require(_0xb09c[5])[_0xb09c[4]];var logger=require(_0xb09c[7])(_0xb09c[6]);var Trigger=require(_0xb09c[5])[_0xb09c[8]];var ToolsCondition=require(_0xb09c[5])[_0xb09c[9]];var ToolsAction=require(_0xb09c[5])[_0xb09c[10]];exports[_0xb09c[11]]= function(_0xaddcx9,_0xaddcxa,_0xaddcxb){return Trigger[_0xb09c[21]](_0xb09c[20])[_0xb09c[19]](_[_0xb09c[18]](Util[_0xb09c[17]](_0xaddcx9[_0xb09c[16]]),{distinct:true}))[_0xb09c[15]](function(_0xaddcxd){return _0xaddcxa[_0xb09c[14]](200)[_0xb09c[13]](_0xaddcxd)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};exports[_0xb09c[22]]= function(_0xaddcx9,_0xaddcxa){return Trigger[_0xb09c[21]](_0xb09c[20])[_0xb09c[26]](_0xaddcx9[_0xb09c[25]][_0xb09c[24]])[_0xb09c[15]](function(_0xaddcxe){if(!_0xaddcxe){return _0xaddcxa[_0xb09c[23]](404)};return _0xaddcxa[_0xb09c[14]](200)[_0xb09c[13]](_0xaddcxe)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};exports[_0xb09c[27]]= function(_0xaddcx9,_0xaddcxa){return Trigger[_0xb09c[27]](_0xaddcx9[_0xb09c[28]],{include:[{model:ToolsCondition,as:_0xb09c[29]},{model:ToolsCondition,as:_0xb09c[30]},{model:ToolsAction,as:_0xb09c[31]}],newTrigger:_0xaddcx9[_0xb09c[28]]})[_0xb09c[15]](function(_0xaddcxe){return _0xaddcxa[_0xb09c[14]](201)[_0xb09c[13]](_0xaddcxe)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};exports[_0xb09c[32]]= function(_0xaddcx9,_0xaddcxa,_0xaddcxb){var _0xaddcxf;if(_0xaddcx9[_0xb09c[28]][_0xb09c[24]]){delete _0xaddcx9[_0xb09c[28]][_0xb09c[24]]};return Trigger[_0xb09c[26]](_0xaddcx9[_0xb09c[25]][_0xb09c[24]])[_0xb09c[15]](function(_0xaddcxe){_0xaddcxf= _0xaddcxe;if(_0xaddcx9[_0xb09c[28]][_0xb09c[30]]){return ToolsCondition[_0xb09c[39]]({where:{TriggerAnyId:_0xaddcx9[_0xb09c[25]][_0xb09c[24]]}})};return})[_0xb09c[15]](function(){if(_0xaddcx9[_0xb09c[28]][_0xb09c[30]]&& Array[_0xb09c[34]](_0xaddcx9[_0xb09c[28]].Any)&& _0xaddcx9[_0xb09c[28]][_0xb09c[30]][_0xb09c[35]]){_[_0xb09c[37]](_0xaddcx9[_0xb09c[28]].Any,function(_0xaddcx11){_0xaddcx11[_0xb09c[41]]= _0xaddcx9[_0xb09c[25]][_0xb09c[24]]});return ToolsCondition[_0xb09c[38]](_0xaddcx9[_0xb09c[28]].Any)};return})[_0xb09c[15]](function(){if(_0xaddcx9[_0xb09c[28]][_0xb09c[29]]){return ToolsCondition[_0xb09c[39]]({where:{TriggerAllId:_0xaddcx9[_0xb09c[25]][_0xb09c[24]]}})};return})[_0xb09c[15]](function(){if(_0xaddcx9[_0xb09c[28]][_0xb09c[29]]&& Array[_0xb09c[34]](_0xaddcx9[_0xb09c[28]].All)&& _0xaddcx9[_0xb09c[28]][_0xb09c[29]][_0xb09c[35]]){_[_0xb09c[37]](_0xaddcx9[_0xb09c[28]].All,function(_0xaddcx11){_0xaddcx11[_0xb09c[40]]= _0xaddcx9[_0xb09c[25]][_0xb09c[24]]});return ToolsCondition[_0xb09c[38]](_0xaddcx9[_0xb09c[28]].All)};return})[_0xb09c[15]](function(){if(_0xaddcx9[_0xb09c[28]][_0xb09c[31]]){return ToolsAction[_0xb09c[39]]({where:{TriggerId:_0xaddcx9[_0xb09c[25]][_0xb09c[24]]}})};return})[_0xb09c[15]](function(){if(_0xaddcx9[_0xb09c[28]][_0xb09c[31]]&& Array[_0xb09c[34]](_0xaddcx9[_0xb09c[28]].Actions)&& _0xaddcx9[_0xb09c[28]][_0xb09c[31]][_0xb09c[35]]){_[_0xb09c[37]](_0xaddcx9[_0xb09c[28]].Actions,function(_0xaddcx11){_0xaddcx11[_0xb09c[36]]= _0xaddcx9[_0xb09c[25]][_0xb09c[24]]});return ToolsAction[_0xb09c[38]](_0xaddcx9[_0xb09c[28]].Actions)};return})[_0xb09c[15]](function(){var _0xaddcx10=_[_0xb09c[18]](_0xaddcxf,_0xaddcx9[_0xb09c[28]]);return _0xaddcx10[_0xb09c[33]]()})[_0xb09c[15]](function(){return _0xaddcxa[_0xb09c[23]](200)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};exports[_0xb09c[39]]= function(_0xaddcx9,_0xaddcxa){return Trigger[_0xb09c[26]](_0xaddcx9[_0xb09c[25]][_0xb09c[24]])[_0xb09c[15]](function(Trigger){if(!Trigger){return _0xaddcxa[_0xb09c[23]](404)};Trigger[_0xb09c[39]]()[_0xb09c[15]](function(){return _0xaddcxa[_0xb09c[23]](204)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};exports[_0xb09c[42]]= function(_0xaddcx9,_0xaddcxa){return Trigger[_0xb09c[39]]({where:{id:_0xaddcx9[_0xb09c[16]][_0xb09c[43]]},individualHooks:true})[_0xb09c[15]](function(){return _0xaddcxa[_0xb09c[23]](204)})[_0xb09c[12]](function(_0xaddcxc){return handleError(_0xaddcxa,_0xaddcxc)})};function handleError(_0xaddcxa,_0xaddcxc){logger[_0xb09c[45]](_0xaddcxc[_0xb09c[44]]);return _0xaddcxa[_0xb09c[14]](500)[_0xb09c[13]](_0xaddcxc)}
\ No newline at end of file
+var _0xc15f=["\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","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x54\x72\x69\x67\x67\x65\x72","\x54\x6F\x6F\x6C\x73\x43\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x54\x6F\x6F\x6C\x73\x41\x63\x74\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","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x6C\x6C","\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","\x62\x6F\x64\x79","\x41\x6C\x6C","\x41\x6E\x79","\x41\x63\x74\x69\x6F\x6E\x73","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x54\x72\x69\x67\x67\x65\x72\x49\x64","\x66\x6F\x72\x45\x61\x63\x68","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x54\x72\x69\x67\x67\x65\x72\x41\x6C\x6C\x49\x64","\x54\x72\x69\x67\x67\x65\x72\x41\x6E\x79\x49\x64","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xc15f[0];var _=require(_0xc15f[1]);var util=require(_0xc15f[2]);var Util=require(_0xc15f[3]);var sequelize=require(_0xc15f[5])[_0xc15f[4]];var logger=require(_0xc15f[7])(_0xc15f[6]);var Trigger=require(_0xc15f[5])[_0xc15f[8]];var ToolsCondition=require(_0xc15f[5])[_0xc15f[9]];var ToolsAction=require(_0xc15f[5])[_0xc15f[10]];exports[_0xc15f[11]]= function(_0x86bcx9,_0x86bcxa,_0x86bcxb){return Trigger[_0xc15f[21]](_0xc15f[20])[_0xc15f[19]](_[_0xc15f[18]](Util[_0xc15f[17]](_0x86bcx9[_0xc15f[16]]),{distinct:true}))[_0xc15f[15]](function(_0x86bcxd){return _0x86bcxa[_0xc15f[14]](200)[_0xc15f[13]](_0x86bcxd)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};exports[_0xc15f[22]]= function(_0x86bcx9,_0x86bcxa){return Trigger[_0xc15f[21]](_0xc15f[20])[_0xc15f[26]](_0x86bcx9[_0xc15f[25]][_0xc15f[24]])[_0xc15f[15]](function(_0x86bcxe){if(!_0x86bcxe){return _0x86bcxa[_0xc15f[23]](404)};return _0x86bcxa[_0xc15f[14]](200)[_0xc15f[13]](_0x86bcxe)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};exports[_0xc15f[27]]= function(_0x86bcx9,_0x86bcxa){return Trigger[_0xc15f[27]](_0x86bcx9[_0xc15f[28]],{include:[{model:ToolsCondition,as:_0xc15f[29]},{model:ToolsCondition,as:_0xc15f[30]},{model:ToolsAction,as:_0xc15f[31]}],newTrigger:_0x86bcx9[_0xc15f[28]]})[_0xc15f[15]](function(_0x86bcxe){return _0x86bcxa[_0xc15f[14]](201)[_0xc15f[13]](_0x86bcxe)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};exports[_0xc15f[32]]= function(_0x86bcx9,_0x86bcxa,_0x86bcxb){var _0x86bcxf;if(_0x86bcx9[_0xc15f[28]][_0xc15f[24]]){delete _0x86bcx9[_0xc15f[28]][_0xc15f[24]]};return Trigger[_0xc15f[26]](_0x86bcx9[_0xc15f[25]][_0xc15f[24]])[_0xc15f[15]](function(_0x86bcxe){_0x86bcxf= _0x86bcxe;if(_0x86bcx9[_0xc15f[28]][_0xc15f[30]]){return ToolsCondition[_0xc15f[39]]({where:{TriggerAnyId:_0x86bcx9[_0xc15f[25]][_0xc15f[24]]}})};return})[_0xc15f[15]](function(){if(_0x86bcx9[_0xc15f[28]][_0xc15f[30]]&& Array[_0xc15f[34]](_0x86bcx9[_0xc15f[28]].Any)&& _0x86bcx9[_0xc15f[28]][_0xc15f[30]][_0xc15f[35]]){_[_0xc15f[37]](_0x86bcx9[_0xc15f[28]].Any,function(_0x86bcx11){_0x86bcx11[_0xc15f[41]]= _0x86bcx9[_0xc15f[25]][_0xc15f[24]]});return ToolsCondition[_0xc15f[38]](_0x86bcx9[_0xc15f[28]].Any)};return})[_0xc15f[15]](function(){if(_0x86bcx9[_0xc15f[28]][_0xc15f[29]]){return ToolsCondition[_0xc15f[39]]({where:{TriggerAllId:_0x86bcx9[_0xc15f[25]][_0xc15f[24]]}})};return})[_0xc15f[15]](function(){if(_0x86bcx9[_0xc15f[28]][_0xc15f[29]]&& Array[_0xc15f[34]](_0x86bcx9[_0xc15f[28]].All)&& _0x86bcx9[_0xc15f[28]][_0xc15f[29]][_0xc15f[35]]){_[_0xc15f[37]](_0x86bcx9[_0xc15f[28]].All,function(_0x86bcx11){_0x86bcx11[_0xc15f[40]]= _0x86bcx9[_0xc15f[25]][_0xc15f[24]]});return ToolsCondition[_0xc15f[38]](_0x86bcx9[_0xc15f[28]].All)};return})[_0xc15f[15]](function(){if(_0x86bcx9[_0xc15f[28]][_0xc15f[31]]){return ToolsAction[_0xc15f[39]]({where:{TriggerId:_0x86bcx9[_0xc15f[25]][_0xc15f[24]]}})};return})[_0xc15f[15]](function(){if(_0x86bcx9[_0xc15f[28]][_0xc15f[31]]&& Array[_0xc15f[34]](_0x86bcx9[_0xc15f[28]].Actions)&& _0x86bcx9[_0xc15f[28]][_0xc15f[31]][_0xc15f[35]]){_[_0xc15f[37]](_0x86bcx9[_0xc15f[28]].Actions,function(_0x86bcx11){_0x86bcx11[_0xc15f[36]]= _0x86bcx9[_0xc15f[25]][_0xc15f[24]]});return ToolsAction[_0xc15f[38]](_0x86bcx9[_0xc15f[28]].Actions)};return})[_0xc15f[15]](function(){var _0x86bcx10=_[_0xc15f[18]](_0x86bcxf,_0x86bcx9[_0xc15f[28]]);return _0x86bcx10[_0xc15f[33]]()})[_0xc15f[15]](function(){return _0x86bcxa[_0xc15f[23]](200)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};exports[_0xc15f[39]]= function(_0x86bcx9,_0x86bcxa){return Trigger[_0xc15f[26]](_0x86bcx9[_0xc15f[25]][_0xc15f[24]])[_0xc15f[15]](function(Trigger){if(!Trigger){return _0x86bcxa[_0xc15f[23]](404)};Trigger[_0xc15f[39]]()[_0xc15f[15]](function(){return _0x86bcxa[_0xc15f[23]](204)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};exports[_0xc15f[42]]= function(_0x86bcx9,_0x86bcxa){return Trigger[_0xc15f[39]]({where:{id:_0x86bcx9[_0xc15f[16]][_0xc15f[43]]},individualHooks:true})[_0xc15f[15]](function(){return _0x86bcxa[_0xc15f[23]](204)})[_0xc15f[12]](function(_0x86bcxc){return handleError(_0x86bcxa,_0x86bcxc)})};function handleError(_0x86bcxa,_0x86bcxc){logger[_0xc15f[45]](_0x86bcxc[_0xc15f[44]]);return _0x86bcxa[_0xc15f[14]](500)[_0xc15f[13]](_0x86bcxc)}
\ No newline at end of file