Skip to content

Commit ae897a8

Browse files
committed
[CUB-5407] Support onSuccess and onError in workflow sendCommand action
1 parent 73025ac commit ae897a8

File tree

7 files changed

+155
-0
lines changed

7 files changed

+155
-0
lines changed

dist/index.d.ts

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/workflow-step-template-schema.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/workflow-template-schema.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
type: object
3+
title: Command Handler
4+
description: |
5+
A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).
6+
required: [do]
7+
properties:
8+
do:
9+
$ref: '#/definitions/workflow-template/actions'

src/schemata/definitions/workflow-template/action-objects/send-command.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ additionalProperties:
2424
description: |
2525
The command to execute. Available commands are device
2626
specific.
27+
onSuccess:
28+
description: The handler for response status codes 2xx
29+
$ref: '#/definitions/step/command-handler'
30+
onError:
31+
description: The handler for response status codes 5xx
32+
$ref: '#/definitions/step/command-handler'

src/workflow-step-template-schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,16 @@
16191619
"type": "string",
16201620
"description": "The command to execute. Available commands are device\nspecific.\n",
16211621
"markdownDescription": "The command to execute. Available commands are device\nspecific.\n\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
1622+
},
1623+
"onSuccess": {
1624+
"description": "The handler for response status codes 2xx",
1625+
"$ref": "#/definitions/step/command-handler",
1626+
"markdownDescription": "The handler for response status codes 2xx\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
1627+
},
1628+
"onError": {
1629+
"description": "The handler for response status codes 5xx",
1630+
"$ref": "#/definitions/step/command-handler",
1631+
"markdownDescription": "The handler for response status codes 5xx\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
16221632
}
16231633
}
16241634
},
@@ -3240,6 +3250,20 @@
32403250
"markdownDescription": "Rules can be leveraged to dynamically change both the behavior and appearance of a table.\n\nWhen a rule condition is fulfilled, the `editable` and `selectable` behavior of cells, rows, columns, or tabs can be set. Likewise, the background color or text color can be changed to visualize a certain state or change of behavior to the user. For example:\n\n  - When a cell number value is negative, change the background color to red.\n  - When a cell number value is positive, change the background color to green, make it selectable, but no longer editable.\n  - When all cells in a column have no value, the column cells are not selectable or editable across all other tabs of the table.\n\n\nSee more: [Rules Schema](https://schema.laboperator.com/schemas/definitions/step/table-attributes/rules) "
32413251
}
32423252
},
3253+
"command-handler": {
3254+
"type": "object",
3255+
"title": "Command Handler",
3256+
"description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n",
3257+
"required": [
3258+
"do"
3259+
],
3260+
"properties": {
3261+
"do": {
3262+
"$ref": "#/definitions/workflow-template/actions"
3263+
}
3264+
},
3265+
"markdownDescription": "A Command handler always consists of an [action](https://schema.laboperator.com/schemas/definitions/workflow-template/actions/).\n\n\nSee more: [Command Handler Schema](https://schema.laboperator.com/schemas/definitions/step/command-handler) "
3266+
},
32433267
"webhook-handler": {
32443268
"type": "object",
32453269
"title": "Webhook Handler",

src/workflow-template-schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,20 @@
14401440
],
14411441
"markdownDescription": "Define accessors for selector options. You can map the selector options to fields defined in a field.\n\n\nSee more: [Selector Accessors Schema](https://schema.laboperator.com/schemas/definitions/step/selector-accessors) "
14421442
},
1443+
"command-handler": {
1444+
"type": "object",
1445+
"title": "Command Handler",
1446+
"description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n",
1447+
"required": [
1448+
"do"
1449+
],
1450+
"properties": {
1451+
"do": {
1452+
"$ref": "#/definitions/workflow-template/actions"
1453+
}
1454+
},
1455+
"markdownDescription": "A Command handler always consists of an [action](https://schema.laboperator.com/schemas/definitions/workflow-template/actions/).\n\n\nSee more: [Command Handler Schema](https://schema.laboperator.com/schemas/definitions/step/command-handler) "
1456+
},
14431457
"webhook-handler": {
14441458
"type": "object",
14451459
"title": "Webhook Handler",
@@ -2750,6 +2764,16 @@
27502764
"type": "string",
27512765
"description": "The command to execute. Available commands are device\nspecific.\n",
27522766
"markdownDescription": "The command to execute. Available commands are device\nspecific.\n\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
2767+
},
2768+
"onSuccess": {
2769+
"description": "The handler for response status codes 2xx",
2770+
"$ref": "#/definitions/step/command-handler",
2771+
"markdownDescription": "The handler for response status codes 2xx\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
2772+
},
2773+
"onError": {
2774+
"description": "The handler for response status codes 5xx",
2775+
"$ref": "#/definitions/step/command-handler",
2776+
"markdownDescription": "The handler for response status codes 5xx\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) "
27532777
}
27542778
}
27552779
},

0 commit comments

Comments
 (0)