@switchbot/openapi-cli 3.3.1 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -304,10 +304,21 @@
304
304
  },
305
305
 
306
306
  "action": {
307
+ "oneOf": [
308
+ { "$ref": "#/$defs/commandAction" },
309
+ { "$ref": "#/$defs/notifyAction" }
310
+ ]
311
+ },
312
+
313
+ "commandAction": {
307
314
  "type": "object",
308
315
  "additionalProperties": false,
309
316
  "required": ["command"],
310
317
  "properties": {
318
+ "type": {
319
+ "enum": ["command"],
320
+ "description": "Optional discriminator. Omit for backwards compatibility."
321
+ },
311
322
  "command": {
312
323
  "type": "string",
313
324
  "description": "A CLI invocation fragment, e.g. `devices command <id> turnOn`. The engine prepends `switchbot` and appends `--audit-log`."
@@ -326,6 +337,38 @@
326
337
  "description": "If this action fails, should the rule keep executing its remaining `then[]` entries?"
327
338
  }
328
339
  }
340
+ },
341
+
342
+ "notifyAction": {
343
+ "type": "object",
344
+ "additionalProperties": false,
345
+ "required": ["type", "channel", "to"],
346
+ "properties": {
347
+ "type": { "const": "notify" },
348
+ "channel": {
349
+ "enum": ["webhook", "openclaw", "file"],
350
+ "description": "Delivery channel."
351
+ },
352
+ "to": {
353
+ "type": "string",
354
+ "minLength": 1,
355
+ "description": "URL for webhook/openclaw; absolute file path for file channel."
356
+ },
357
+ "template": {
358
+ "type": "string",
359
+ "description": "Template string with {{ rule.name }}, {{ event.* }}, {{ device.id }} substitutions."
360
+ },
361
+ "on_failure": {
362
+ "enum": ["log", "retry", "ignore"],
363
+ "default": "log",
364
+ "description": "What to do when delivery fails."
365
+ },
366
+ "on_error": {
367
+ "enum": ["continue", "stop"],
368
+ "default": "continue",
369
+ "description": "If this action fails, should the rule keep executing its remaining `then[]` entries?"
370
+ }
371
+ }
329
372
  }
330
373
  }
331
374
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@switchbot/openapi-cli",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "description": "SwitchBot smart home CLI — control devices, run scenes, stream real-time events, and integrate AI agents via MCP. Full API v1.1 coverage.",
5
5
  "keywords": [
6
6
  "switchbot",