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 08:46:05 -06:00
parent 9de5097061
commit 57532efabd
7 changed files with 110 additions and 133 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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