diff --git a/dist/index.d.ts b/dist/index.d.ts index 4d2f23f6..ca1491ac 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1643,6 +1643,16 @@ export declare const schemas: { description: string; markdownDescription: string; }; + onSuccess: { + description: string; + $ref: string; + markdownDescription: string; + }; + onError: { + description: string; + $ref: string; + markdownDescription: string; + }; }; }; markdownDescription: string; @@ -3002,6 +3012,25 @@ export declare const schemas: { markdownDescription: string; }; }; + "command-handler": { + type: string; + title: string; + description: string; + required: string[]; + additionalProperties: boolean; + properties: { + and: { + $ref: string; + }; + do: { + $ref: string; + }; + else: { + $ref: string; + }; + }; + markdownDescription: string; + }; "webhook-handler": { type: string; title: string; @@ -4969,6 +4998,25 @@ export declare const schemas: { }[]; markdownDescription: string; }; + "command-handler": { + type: string; + title: string; + description: string; + required: string[]; + additionalProperties: boolean; + properties: { + and: { + $ref: string; + }; + do: { + $ref: string; + }; + else: { + $ref: string; + }; + }; + markdownDescription: string; + }; "webhook-handler": { type: string; title: string; @@ -5884,6 +5932,16 @@ export declare const schemas: { description: string; markdownDescription: string; }; + onSuccess: { + description: string; + $ref: string; + markdownDescription: string; + }; + onError: { + description: string; + $ref: string; + markdownDescription: string; + }; }; }; markdownDescription: string; diff --git a/dist/workflow-step-template-schema.json b/dist/workflow-step-template-schema.json index 7921540d..c90c276b 100644 --- a/dist/workflow-step-template-schema.json +++ b/dist/workflow-step-template-schema.json @@ -1619,6 +1619,16 @@ "type": "string", "description": "The command to execute. Available commands are device\nspecific.\n", "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) " + }, + "onSuccess": { + "description": "The handler for success response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for success response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " + }, + "onError": { + "description": "The handler for error response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for error response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " } } }, @@ -3240,6 +3250,27 @@ "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) " } }, + "command-handler": { + "type": "object", + "title": "Command Handler", + "description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n", + "required": [ + "do" + ], + "additionalProperties": false, + "properties": { + "and": { + "$ref": "#/definitions/script" + }, + "do": { + "$ref": "#/definitions/workflow-template/actions" + }, + "else": { + "$ref": "#/definitions/workflow-template/actions" + } + }, + "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) " + }, "webhook-handler": { "type": "object", "title": "Webhook Handler", diff --git a/dist/workflow-template-schema.json b/dist/workflow-template-schema.json index f30eb450..94605144 100644 --- a/dist/workflow-template-schema.json +++ b/dist/workflow-template-schema.json @@ -1440,6 +1440,27 @@ ], "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) " }, + "command-handler": { + "type": "object", + "title": "Command Handler", + "description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n", + "required": [ + "do" + ], + "additionalProperties": false, + "properties": { + "and": { + "$ref": "#/definitions/script" + }, + "do": { + "$ref": "#/definitions/workflow-template/actions" + }, + "else": { + "$ref": "#/definitions/workflow-template/actions" + } + }, + "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) " + }, "webhook-handler": { "type": "object", "title": "Webhook Handler", @@ -2750,6 +2771,16 @@ "type": "string", "description": "The command to execute. Available commands are device\nspecific.\n", "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) " + }, + "onSuccess": { + "description": "The handler for success response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for success response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " + }, + "onError": { + "description": "The handler for error response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for error response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " } } }, diff --git a/src/schemata/definitions/step/command-handler.yml b/src/schemata/definitions/step/command-handler.yml new file mode 100644 index 00000000..5a6a95bc --- /dev/null +++ b/src/schemata/definitions/step/command-handler.yml @@ -0,0 +1,14 @@ +--- +type: object +title: Command Handler +description: | + A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/). +required: [do] +additionalProperties: false +properties: + and: + $ref: '#/definitions/script' + do: + $ref: '#/definitions/workflow-template/actions' + else: + $ref: '#/definitions/workflow-template/actions' diff --git a/src/schemata/definitions/workflow-template/action-objects/send-command.yml b/src/schemata/definitions/workflow-template/action-objects/send-command.yml index 6c16d93f..032a7886 100644 --- a/src/schemata/definitions/workflow-template/action-objects/send-command.yml +++ b/src/schemata/definitions/workflow-template/action-objects/send-command.yml @@ -24,3 +24,9 @@ additionalProperties: description: | The command to execute. Available commands are device specific. + onSuccess: + description: The handler for success response + $ref: '#/definitions/step/command-handler' + onError: + description: The handler for error response + $ref: '#/definitions/step/command-handler' diff --git a/src/workflow-step-template-schema.json b/src/workflow-step-template-schema.json index 35d78a29..8ed1b1d0 100644 --- a/src/workflow-step-template-schema.json +++ b/src/workflow-step-template-schema.json @@ -1619,6 +1619,16 @@ "type": "string", "description": "The command to execute. Available commands are device\nspecific.\n", "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) " + }, + "onSuccess": { + "description": "The handler for success response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for success response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " + }, + "onError": { + "description": "The handler for error response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for error response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " } } }, @@ -3240,6 +3250,27 @@ "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) " } }, + "command-handler": { + "type": "object", + "title": "Command Handler", + "description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n", + "required": [ + "do" + ], + "additionalProperties": false, + "properties": { + "and": { + "$ref": "#/definitions/script" + }, + "do": { + "$ref": "#/definitions/workflow-template/actions" + }, + "else": { + "$ref": "#/definitions/workflow-template/actions" + } + }, + "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) " + }, "webhook-handler": { "type": "object", "title": "Webhook Handler", diff --git a/src/workflow-template-schema.json b/src/workflow-template-schema.json index 9da5364b..47144d8f 100644 --- a/src/workflow-template-schema.json +++ b/src/workflow-template-schema.json @@ -1440,6 +1440,27 @@ ], "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) " }, + "command-handler": { + "type": "object", + "title": "Command Handler", + "description": "A Command handler always consists of an [action](/schemas/definitions/workflow-template/actions/).\n", + "required": [ + "do" + ], + "additionalProperties": false, + "properties": { + "and": { + "$ref": "#/definitions/script" + }, + "do": { + "$ref": "#/definitions/workflow-template/actions" + }, + "else": { + "$ref": "#/definitions/workflow-template/actions" + } + }, + "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) " + }, "webhook-handler": { "type": "object", "title": "Webhook Handler", @@ -2750,6 +2771,16 @@ "type": "string", "description": "The command to execute. Available commands are device\nspecific.\n", "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) " + }, + "onSuccess": { + "description": "The handler for success response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for success response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " + }, + "onError": { + "description": "The handler for error response", + "$ref": "#/definitions/step/command-handler", + "markdownDescription": "The handler for error response\n\nSee more: [Send Command Schema](https://schema.laboperator.com/schemas/definitions/workflow-template/action-objects/send-command) " } } },