Convert all schemas to flat format with inline required/secret

All schemas (parameters, output, output_schema, conf_schema) now use the
StackStorm-style flat format expected by Attune:
  { param_name: { type, description, required, secret, ... } }

Instead of the standard JSON Schema format:
  { type: object, properties: { ... }, required: [...] }

Also fix rule template syntax: trigger.payload.* -> event.payload.*
This commit is contained in:
2026-02-23 09:05:54 -06:00
parent d6dfcf65d6
commit 62c42b3996
7 changed files with 107 additions and 130 deletions

View File

@@ -19,24 +19,19 @@ parameter_format: json
# Output format: json (structured data parsing enabled)
output_format: json
# Action parameters schema (standard JSON Schema format)
# Action parameters schema (flat format with inline required/secret)
parameters:
type: object
properties:
name:
type: string
description: "Optional name to include in greeting"
default: "Node.js"
# Output schema
# Output schema (flat format)
output_schema:
type: object
properties:
message:
type: string
description: "The greeting message"
required:
- message
required: true
# Tags for categorization
tags:

View File

@@ -19,10 +19,8 @@ parameter_format: json
# Output format: json (structured data)
output_format: json
# Action parameters schema
# Action parameters schema (flat format with inline required/secret)
parameters:
type: object
properties:
url:
type: string
description: "URL to request (defaults to https://example.com)"
@@ -37,16 +35,16 @@ parameters:
- PUT
- DELETE
# Output schema
# Output schema (flat format with inline required/secret)
output_schema:
type: object
properties:
status_code:
type: integer
description: "HTTP response status code"
required: true
url:
type: string
description: "URL that was requested"
required: true
content_length:
type: integer
description: "Length of the response body in characters"
@@ -56,6 +54,7 @@ output_schema:
success:
type: boolean
description: "Whether the request succeeded (2xx status)"
required: true
# Tags for categorization
tags:

View File

@@ -19,36 +19,30 @@ parameter_format: json
# Output format: json (structured data)
output_format: json
# Action parameters schema
# Action parameters schema (StackStorm-style: inline required per parameter)
parameters:
type: object
properties:
counter:
type: integer
description: "The counter value to consume"
required: true
rule_ref:
type: string
description: "The rule reference the counter is scoped to"
default: ""
required:
- counter
# Output schema
# Output schema (StackStorm-style: inline required per parameter)
output_schema:
type: object
properties:
message:
type: string
description: "Formatted message containing the counter value"
required: true
counter:
type: integer
description: "The counter value that was consumed"
required: true
rule_ref:
type: string
description: "The rule reference the counter is scoped to"
required:
- message
- counter
# Tags for categorization
tags:

View File

@@ -11,10 +11,8 @@ email: "support@attune.io"
system: false
enabled: true
# Pack configuration schema
# Pack configuration schema (flat format with inline required/secret)
conf_schema:
type: object
properties:
counter_key_prefix:
type: string
description: "Prefix for counter keys in the keystore"

View File

@@ -2,7 +2,7 @@
# Connects the counter sensor trigger to the read_counter action
#
# When the counter sensor fires, this rule passes the counter value
# and rule reference from the trigger payload into the read_counter action.
# and rule reference from the event payload into the read_counter action.
ref: nodejs_example.count_and_log
pack_ref: nodejs_example
@@ -13,10 +13,10 @@ description: "Fires on each counter tick and logs the current counter value"
trigger_ref: nodejs_example.counter
action_ref: nodejs_example.read_counter
# Map trigger payload fields into action parameters
# Map event payload fields into action parameters
action_params:
counter: "{{ trigger.payload.counter }}"
rule_ref: "{{ trigger.payload.rule_ref }}"
counter: "{{ event.payload.counter }}"
rule_ref: "{{ event.payload.rule_ref }}"
# No conditions — fire on every counter event
conditions: {}

View File

@@ -20,10 +20,8 @@ entry_point: counter_sensor.js
trigger_types:
- nodejs_example.counter
# Sensor configuration schema
# Sensor configuration schema (flat format with inline required/secret)
parameters:
type: object
properties:
default_interval_seconds:
type: integer
description: "Default interval between counter emissions (in seconds)"

View File

@@ -9,39 +9,32 @@ enabled: true
# Trigger type
type: custom
# Parameter schema - configuration for the trigger instance
# Parameter schema - configuration for the trigger instance (flat format with inline required/secret)
parameters:
type: object
properties:
interval_seconds:
type: integer
description: "Seconds between each counter emission"
default: 1
minimum: 1
maximum: 3600
required: []
# Payload schema - data emitted when trigger fires
# Payload schema - data emitted when trigger fires (flat format with inline required/secret)
output:
type: object
properties:
counter:
type: integer
description: "Current counter value (monotonically increasing per rule)"
required: true
rule_ref:
type: string
description: "Reference of the rule that this counter is scoped to"
required: true
sensor_ref:
type: string
description: "Reference to the sensor that generated this event"
fired_at:
type: string
format: date-time
description: "Timestamp when the trigger fired"
required:
- counter
- rule_ref
- fired_at
required: true
# Tags for categorization
tags: