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 (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 name:
properties: type: string
name: description: "Optional name to include in greeting"
type: string default: "Node.js"
description: "Optional name to include in greeting"
default: "Node.js"
# Output schema # Output schema (flat format)
output_schema: output_schema:
type: object message:
properties: type: string
message: description: "The greeting message"
type: string required: true
description: "The greeting message"
required:
- message
# Tags for categorization # Tags for categorization
tags: tags:

View File

@@ -19,43 +19,42 @@ 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 (flat format with inline required/secret)
parameters: parameters:
type: object url:
properties: type: string
url: description: "URL to request (defaults to https://example.com)"
type: string default: "https://example.com"
description: "URL to request (defaults to https://example.com)" method:
default: "https://example.com" type: string
method: description: "HTTP method"
type: string default: "GET"
description: "HTTP method" enum:
default: "GET" - GET
enum: - POST
- GET - PUT
- POST - DELETE
- PUT
- DELETE
# Output schema # Output schema (flat format with inline required/secret)
output_schema: output_schema:
type: object status_code:
properties: type: integer
status_code: description: "HTTP response status code"
type: integer required: true
description: "HTTP response status code" 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 characters" description: "Length of the response body in characters"
snippet: snippet:
type: string type: string
description: "First 500 characters of the response body" description: "First 500 characters of the response body"
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 counter:
properties: type: integer
counter: description: "The counter value to consume"
type: integer required: true
description: "The counter value to consume" 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 message:
properties: type: string
message: description: "Formatted message containing the counter value"
type: string required: true
description: "Formatted message containing the counter value" 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,14 +11,12 @@ 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 counter_key_prefix:
properties: type: string
counter_key_prefix: description: "Prefix for counter keys in the keystore"
type: string default: "nodejs_example.counter"
description: "Prefix for counter keys in the keystore"
default: "nodejs_example.counter"
# Default pack configuration # Default pack configuration
config: config:

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: nodejs_example.count_and_log ref: nodejs_example.count_and_log
pack_ref: nodejs_example 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 trigger_ref: nodejs_example.counter
action_ref: nodejs_example.read_counter action_ref: nodejs_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,20 +20,18 @@ entry_point: counter_sensor.js
trigger_types: trigger_types:
- nodejs_example.counter - nodejs_example.counter
# Sensor configuration schema # Sensor configuration schema (flat format with inline required/secret)
parameters: parameters:
type: object default_interval_seconds:
properties: type: integer
default_interval_seconds: description: "Default interval between counter emissions (in seconds)"
type: integer default: 1
description: "Default interval between counter emissions (in seconds)" minimum: 1
default: 1 maximum: 3600
minimum: 1 key_prefix:
maximum: 3600 type: string
key_prefix: description: "Prefix for counter keys in the Attune keystore"
type: string default: "nodejs_example.counter"
description: "Prefix for counter keys in the Attune keystore"
default: "nodejs_example.counter"
# Poll interval (how often the sensor checks for events) # Poll interval (how often the sensor checks for events)
poll_interval: 1 poll_interval: 1

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 interval_seconds:
properties: type: integer
interval_seconds: description: "Seconds between each counter emission"
type: integer default: 1
description: "Seconds between each counter emission" minimum: 1
default: 1 maximum: 3600
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: output:
type: object counter:
properties: type: integer
counter: description: "Current counter value (monotonically increasing per rule)"
type: integer required: true
description: "Current counter value (monotonically increasing per rule)" 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: true
required:
- counter
- rule_ref
- fired_at
# Tags for categorization # Tags for categorization
tags: tags: