diff --git a/actions/hello.yaml b/actions/hello.yaml index 8355bff..5bb7b32 100644 --- a/actions/hello.yaml +++ b/actions/hello.yaml @@ -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" + 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 + message: + type: string + description: "The greeting message" + required: true # Tags for categorization tags: diff --git a/actions/http_example.yaml b/actions/http_example.yaml index 03d7d5f..b6c02c2 100644 --- a/actions/http_example.yaml +++ b/actions/http_example.yaml @@ -19,43 +19,42 @@ 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)" - default: "https://example.com" - method: - type: string - description: "HTTP method" - default: "GET" - enum: - - GET - - POST - - PUT - - DELETE + url: + type: string + description: "URL to request (defaults to https://example.com)" + default: "https://example.com" + method: + type: string + description: "HTTP method" + default: "GET" + enum: + - GET + - POST + - 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" - url: - type: string - description: "URL that was requested" - content_length: - type: integer - description: "Length of the response body in characters" - snippet: - type: string - description: "First 500 characters of the response body" - success: - type: boolean - description: "Whether the request succeeded (2xx status)" + 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" + snippet: + type: string + description: "First 500 characters of the response body" + success: + type: boolean + description: "Whether the request succeeded (2xx status)" + required: true # Tags for categorization tags: diff --git a/actions/read_counter.yaml b/actions/read_counter.yaml index d3a8fec..5a78f7f 100644 --- a/actions/read_counter.yaml +++ b/actions/read_counter.yaml @@ -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" - rule_ref: - type: string - description: "The rule reference the counter is scoped to" - default: "" - required: - - counter + 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: "" -# 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" - counter: - type: integer - description: "The counter value that was consumed" - rule_ref: - type: string - description: "The rule reference the counter is scoped to" - required: - - message - - counter + 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" # Tags for categorization tags: diff --git a/pack.yaml b/pack.yaml index 173a4af..6d201d7 100644 --- a/pack.yaml +++ b/pack.yaml @@ -11,14 +11,12 @@ 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" - default: "nodejs_example.counter" + counter_key_prefix: + type: string + description: "Prefix for counter keys in the keystore" + default: "nodejs_example.counter" # Default pack configuration config: diff --git a/rules/count_and_log.yaml b/rules/count_and_log.yaml index 92c3aa9..ffc3a11 100644 --- a/rules/count_and_log.yaml +++ b/rules/count_and_log.yaml @@ -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: {} diff --git a/sensors/counter_sensor.yaml b/sensors/counter_sensor.yaml index 420c0bc..2621ebe 100644 --- a/sensors/counter_sensor.yaml +++ b/sensors/counter_sensor.yaml @@ -20,20 +20,18 @@ 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)" - default: 1 - minimum: 1 - maximum: 3600 - key_prefix: - type: string - description: "Prefix for counter keys in the Attune keystore" - default: "nodejs_example.counter" + default_interval_seconds: + type: integer + description: "Default interval between counter emissions (in seconds)" + default: 1 + minimum: 1 + maximum: 3600 + key_prefix: + type: string + description: "Prefix for counter keys in the Attune keystore" + default: "nodejs_example.counter" # Poll interval (how often the sensor checks for events) poll_interval: 1 diff --git a/triggers/counter.yaml b/triggers/counter.yaml index 1b3b3be..961fd62 100644 --- a/triggers/counter.yaml +++ b/triggers/counter.yaml @@ -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: [] + interval_seconds: + type: integer + description: "Seconds between each counter emission" + default: 1 + minimum: 1 + maximum: 3600 -# 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)" - rule_ref: - type: string - description: "Reference of the rule that this counter is scoped to" - 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 + 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 + description: "Timestamp when the trigger fired" + required: true # Tags for categorization tags: