From 73905e12742506515e84a98bf6558eec7d8cebda Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 1 Jun 2026 17:55:30 -0500 Subject: [PATCH] add description information to params for processors --- internal/processor/db-query.go | 4 +- internal/processor/filter-expr.go | 5 ++- internal/processor/filter-rate.go | 4 +- internal/processor/filter-regex.go | 5 ++- internal/processor/float-parse.go | 9 ++-- internal/processor/float-random.go | 19 ++++---- internal/processor/free-d-create.go | 45 +++++++++++-------- internal/processor/http-request-do.go | 12 ++--- internal/processor/http-response-create.go | 10 +++-- internal/processor/int-parse.go | 18 ++++---- internal/processor/int-random.go | 10 +++-- internal/processor/int-scale.go | 20 +++++---- internal/processor/kv-get.go | 10 +++-- internal/processor/kv-set.go | 10 +++-- .../processor/midi-control_change-create.go | 15 ++++--- internal/processor/midi-note_off-create.go | 15 ++++--- internal/processor/midi-note_on-create.go | 15 ++++--- .../processor/midi-program_change-create.go | 10 +++-- internal/processor/module-output.go | 2 +- internal/processor/osc-message-create.go | 15 ++++--- internal/processor/pubsub-publish.go | 4 +- internal/processor/router-input.go | 2 +- internal/processor/script-expr.go | 5 ++- internal/processor/script-js.go | 5 ++- internal/processor/script-wasm.go | 19 ++++---- .../processor/sip-response-audio-create.go | 18 +++++--- .../processor/sip-response-dtmf-create.go | 18 +++++--- internal/processor/string-create.go | 5 ++- internal/processor/string-split.go | 5 ++- internal/processor/struct-field-get.go | 5 ++- internal/processor/struct-method-get.go | 5 ++- internal/processor/time-sleep.go | 2 +- 32 files changed, 204 insertions(+), 142 deletions(-) diff --git a/internal/processor/db-query.go b/internal/processor/db-query.go index 9c0360a..1e38d74 100644 --- a/internal/processor/db-query.go +++ b/internal/processor/db-query.go @@ -22,13 +22,13 @@ func init() { Properties: map[string]*jsonschema.Schema{ "module": { Title: "Module ID", - Type: "string", Description: "ID of the database module to query", + Type: "string", }, "query": { Title: "Query", - Type: "string", Description: "SQL query to execute", + Type: "string", }, }, Required: []string{"module", "query"}, diff --git a/internal/processor/filter-expr.go b/internal/processor/filter-expr.go index 5240db3..61bf70a 100644 --- a/internal/processor/filter-expr.go +++ b/internal/processor/filter-expr.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "expression": { - Title: "Expression", - Type: "string", + Title: "Expression", + Description: "Expr expression to evaluate, must return a boolean", + Type: "string", }, }, Required: []string{"expression"}, diff --git a/internal/processor/filter-rate.go b/internal/processor/filter-rate.go index 9e0c6b9..701f3bd 100644 --- a/internal/processor/filter-rate.go +++ b/internal/processor/filter-rate.go @@ -18,9 +18,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "rate": { - Type: "integer", Title: "Rate", - Description: "The number of events to allow per second.", + Description: "number of events to allow per second", + Type: "integer", }, }, Required: []string{"rate"}, diff --git a/internal/processor/filter-regex.go b/internal/processor/filter-regex.go index 461d263..c658813 100644 --- a/internal/processor/filter-regex.go +++ b/internal/processor/filter-regex.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "pattern": { - Title: "Pattern", - Type: "string", + Title: "Pattern", + Description: "regex pattern to match against", + Type: "string", }, }, Required: []string{"pattern"}, diff --git a/internal/processor/float-parse.go b/internal/processor/float-parse.go index d185d93..2362a6f 100644 --- a/internal/processor/float-parse.go +++ b/internal/processor/float-parse.go @@ -20,10 +20,11 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "bitSize": { - Title: "Bit Size", - Type: "integer", - Enum: []any{32, 64}, - Default: json.RawMessage("64"), + Title: "Bit Size", + Description: "bit size of the resulting float", + Type: "integer", + Enum: []any{32, 64}, + Default: json.RawMessage("64"), }, }, AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}}, diff --git a/internal/processor/float-random.go b/internal/processor/float-random.go index 1b41e99..2525bf0 100644 --- a/internal/processor/float-random.go +++ b/internal/processor/float-random.go @@ -20,18 +20,21 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "bitSize": { - Title: "Bit Size", - Type: "integer", - Enum: []any{32, 64}, - Default: json.RawMessage("32"), + Title: "Bit Size", + Description: "bit size of the resulting float", + Type: "integer", + Enum: []any{32, 64}, + Default: json.RawMessage("32"), }, "min": { - Title: "Minimum", - Type: "number", + Title: "Minimum", + Description: "inclusive minimum value of the random float", + Type: "number", }, "max": { - Title: "Maximum", - Type: "number", + Title: "Maximum", + Description: "exclusive maximum value of the random float", + Type: "number", }, }, Required: []string{"min", "max"}, diff --git a/internal/processor/free-d-create.go b/internal/processor/free-d-create.go index 6b455e1..dcb5922 100644 --- a/internal/processor/free-d-create.go +++ b/internal/processor/free-d-create.go @@ -21,40 +21,49 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "id": { - Title: "Camera ID", - Type: "string", + Title: "Camera ID", + Description: "ID of the camera this FreeD position corresponds to", + Type: "string", }, "pan": { - Title: "Pan", - Type: "string", + Title: "Pan", + Description: "pan angle of the camera", + Type: "string", }, "tilt": { - Title: "Tilt", - Type: "string", + Title: "Tilt", + Description: "tilt angle of the camera", + Type: "string", }, "roll": { - Title: "Roll", - Type: "string", + Title: "Roll", + Description: "roll angle of the camera", + Type: "string", }, "posX": { - Title: "Position X", - Type: "string", + Title: "Position X", + Description: "X coordinate of the camera's position", + Type: "string", }, "posY": { - Title: "Position Y", - Type: "string", + Title: "Position Y", + Description: "Y coordinate of the camera's position", + Type: "string", }, "posZ": { - Title: "Position Z", - Type: "string", + Title: "Position Z", + Description: "Z coordinate of the camera's position", + Type: "string", }, "zoom": { - Title: "Zoom", - Type: "string", + Title: "Zoom", + Description: "zoom level of the camera", + Type: "string", }, "focus": { - Title: "Focus", - Type: "string", + Title: "Focus", + Description: "focus level of the camera", + Type: "string", }, }, Required: []string{ diff --git a/internal/processor/http-request-do.go b/internal/processor/http-request-do.go index 99dcc31..06f027d 100644 --- a/internal/processor/http-request-do.go +++ b/internal/processor/http-request-do.go @@ -22,13 +22,15 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "method": { - Title: "HTTP Method", - Type: "string", - Enum: []any{"GET", "POST", "PUT", "PATCH", "DELETE"}, + Title: "HTTP Method", + Description: "method to use for the HTTP request", + Type: "string", + Enum: []any{"GET", "POST", "PUT", "PATCH", "DELETE"}, }, "url": { - Title: "URL", - Type: "string", + Title: "URL", + Description: "URL to send the HTTP request to", + Type: "string", }, }, Required: []string{"method", "url"}, diff --git a/internal/processor/http-response-create.go b/internal/processor/http-response-create.go index db4e517..566de6c 100644 --- a/internal/processor/http-response-create.go +++ b/internal/processor/http-response-create.go @@ -19,12 +19,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "status": { - Title: "Status Code", - Type: "integer", + Title: "Status Code", + Description: "status code to set on the response", + Type: "integer", }, "bodyTemplate": { - Title: "Body Template", - Type: "string", + Title: "Body Template", + Description: "template for the response body", + Type: "string", }, }, Required: []string{"status", "bodyTemplate"}, diff --git a/internal/processor/int-parse.go b/internal/processor/int-parse.go index f81a5a6..0f6b532 100644 --- a/internal/processor/int-parse.go +++ b/internal/processor/int-parse.go @@ -20,16 +20,18 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "base": { - Title: "Base", - Type: "integer", - Enum: []any{0, 2, 8, 10, 16}, - Default: json.RawMessage("10"), + Title: "Base", + Description: "numerical base to use for parsing the integer", + Type: "integer", + Enum: []any{0, 2, 8, 10, 16}, + Default: json.RawMessage("10"), }, "bitSize": { - Title: "Bit Size", - Type: "integer", - Enum: []any{0, 8, 16, 32, 64}, - Default: json.RawMessage("64"), + Title: "Bit Size", + Description: "bit size of the resulting integer", + Type: "integer", + Enum: []any{0, 8, 16, 32, 64}, + Default: json.RawMessage("64"), }, }, AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}}, diff --git a/internal/processor/int-random.go b/internal/processor/int-random.go index 3f96712..833d1f9 100644 --- a/internal/processor/int-random.go +++ b/internal/processor/int-random.go @@ -19,12 +19,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "min": { - Title: "Minimum", - Type: "integer", + Title: "Minimum", + Description: "inclusive minimum value of the random integer", + Type: "integer", }, "max": { - Title: "Maximum", - Type: "integer", + Title: "Maximum", + Description: "inclusive maximum value of the random integer", + Type: "integer", }, }, Required: []string{"min", "max"}, diff --git a/internal/processor/int-scale.go b/internal/processor/int-scale.go index 996f5fb..5ada80a 100644 --- a/internal/processor/int-scale.go +++ b/internal/processor/int-scale.go @@ -18,20 +18,24 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "inMin": { - Title: "Input Minimum", - Type: "integer", + Title: "Input Minimum", + Description: "minimum value of the input integer", + Type: "integer", }, "inMax": { - Title: "Input Maximum", - Type: "integer", + Title: "Input Maximum", + Description: "maximum value of the input integer", + Type: "integer", }, "outMin": { - Title: "Output Minimum", - Type: "integer", + Title: "Output Minimum", + Description: "minimum value of the output integer", + Type: "integer", }, "outMax": { - Title: "Output Maximum", - Type: "integer", + Title: "Output Maximum", + Description: "maximum value of the output integer", + Type: "integer", }, }, Required: []string{"inMin", "inMax", "outMin", "outMax"}, diff --git a/internal/processor/kv-get.go b/internal/processor/kv-get.go index 2102e67..4d4174a 100644 --- a/internal/processor/kv-get.go +++ b/internal/processor/kv-get.go @@ -19,12 +19,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "module": { - Title: "Module ID", - Type: "string", + Title: "Module ID", + Description: "ID of the key-value module to get the value from", + Type: "string", }, "key": { - Title: "Key", - Type: "string", + Title: "Key", + Description: "key to retrieve from the key-value module", + Type: "string", }, }, Required: []string{"module", "key"}, diff --git a/internal/processor/kv-set.go b/internal/processor/kv-set.go index d67b2c5..e7cbc77 100644 --- a/internal/processor/kv-set.go +++ b/internal/processor/kv-set.go @@ -19,12 +19,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "module": { - Title: "Module ID", - Type: "string", + Title: "Module ID", + Description: "ID of the key-value module to set the value in", + Type: "string", }, "key": { - Title: "Key", - Type: "string", + Title: "Key", + Description: "key to set in the key-value module", + Type: "string", }, }, Required: []string{"module", "key"}, diff --git a/internal/processor/midi-control_change-create.go b/internal/processor/midi-control_change-create.go index ab47808..3eae756 100644 --- a/internal/processor/midi-control_change-create.go +++ b/internal/processor/midi-control_change-create.go @@ -23,16 +23,19 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "channel": { - Title: "Channel", - Type: "string", + Title: "Channel", + Description: "channel number for the control change message", + Type: "string", }, "control": { - Title: "Control", - Type: "string", + Title: "Control", + Description: "control number for the control change message", + Type: "string", }, "value": { - Title: "Value", - Type: "string", + Title: "Value", + Description: "value for the control change message", + Type: "string", }, }, Required: []string{"channel", "control", "value"}, diff --git a/internal/processor/midi-note_off-create.go b/internal/processor/midi-note_off-create.go index ae85d0a..12d55af 100644 --- a/internal/processor/midi-note_off-create.go +++ b/internal/processor/midi-note_off-create.go @@ -23,16 +23,19 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "channel": { - Title: "Channel", - Type: "string", + Title: "Channel", + Description: "channel number for the note off message", + Type: "string", }, "note": { - Title: "Note", - Type: "string", + Title: "Note", + Description: "note number for the note off message", + Type: "string", }, "velocity": { - Title: "Velocity", - Type: "string", + Title: "Velocity", + Description: "velocity for the note off message", + Type: "string", }, }, Required: []string{"channel", "note", "velocity"}, diff --git a/internal/processor/midi-note_on-create.go b/internal/processor/midi-note_on-create.go index c19cd0f..69aa15d 100644 --- a/internal/processor/midi-note_on-create.go +++ b/internal/processor/midi-note_on-create.go @@ -23,16 +23,19 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "channel": { - Title: "Channel", - Type: "string", + Title: "Channel", + Description: "channel number for the note on message", + Type: "string", }, "note": { - Title: "Note", - Type: "string", + Title: "Note", + Description: "note number for the note on message", + Type: "string", }, "velocity": { - Title: "Velocity", - Type: "string", + Title: "Velocity", + Description: "velocity for the note on message", + Type: "string", }, }, Required: []string{"channel", "note", "velocity"}, diff --git a/internal/processor/midi-program_change-create.go b/internal/processor/midi-program_change-create.go index c49a851..fed1c44 100644 --- a/internal/processor/midi-program_change-create.go +++ b/internal/processor/midi-program_change-create.go @@ -23,12 +23,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "channel": { - Title: "Channel", - Type: "string", + Title: "Channel", + Description: "channel number for the program change message", + Type: "string", }, "program": { - Title: "Program", - Type: "string", + Title: "Program", + Description: "program number for the program change message", + Type: "string", }, }, Required: []string{"type", "channel", "program"}, diff --git a/internal/processor/module-output.go b/internal/processor/module-output.go index a4491ac..7ce7ecc 100644 --- a/internal/processor/module-output.go +++ b/internal/processor/module-output.go @@ -20,8 +20,8 @@ func init() { Properties: map[string]*jsonschema.Schema{ "module": { Title: "Module ID", - Type: "string", Description: "ID of module to send output to", + Type: "string", }, }, Required: []string{"module"}, diff --git a/internal/processor/osc-message-create.go b/internal/processor/osc-message-create.go index 3820220..33fb613 100644 --- a/internal/processor/osc-message-create.go +++ b/internal/processor/osc-message-create.go @@ -23,19 +23,22 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "address": { - Title: "Address", - Type: "string", + Title: "Address", + Description: "OSC address for the message", + Type: "string", }, "args": { - Title: "Arguments", - Type: "array", + Title: "Arguments", + Description: "Arguments for the OSC message", + Type: "array", Items: &jsonschema.Schema{ Type: "string", }, }, "types": { - Title: "Argument Types", - Type: "string", + Title: "Argument Types", + Description: "string of OSC types corresponding to the arguments", + Type: "string", }, }, Required: []string{"address"}, diff --git a/internal/processor/pubsub-publish.go b/internal/processor/pubsub-publish.go index 34965e9..2686aa2 100644 --- a/internal/processor/pubsub-publish.go +++ b/internal/processor/pubsub-publish.go @@ -22,13 +22,13 @@ func init() { Properties: map[string]*jsonschema.Schema{ "module": { Title: "Module ID", - Type: "string", Description: "ID of the module to publish to", + Type: "string", }, "topic": { Title: "Topic", + Description: "topic to publish to", Type: "string", - Description: "Topic to publish to", }, }, Required: []string{"module", "topic"}, diff --git a/internal/processor/router-input.go b/internal/processor/router-input.go index ea402cf..ea1ac69 100644 --- a/internal/processor/router-input.go +++ b/internal/processor/router-input.go @@ -20,8 +20,8 @@ func init() { Properties: map[string]*jsonschema.Schema{ "source": { Title: "Source", - Type: "string", Description: "source to report as to the router", + Type: "string", }, }, Required: []string{"source"}, diff --git a/internal/processor/script-expr.go b/internal/processor/script-expr.go index c3b15dc..710cd7a 100644 --- a/internal/processor/script-expr.go +++ b/internal/processor/script-expr.go @@ -25,8 +25,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "expression": { - Title: "Expression", - Type: "string", + Title: "Expression", + Description: "Expr expression to evaluate", + Type: "string", }, }, Required: []string{"expression"}, diff --git a/internal/processor/script-js.go b/internal/processor/script-js.go index 4cdb5bb..3dc80d0 100644 --- a/internal/processor/script-js.go +++ b/internal/processor/script-js.go @@ -18,8 +18,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "program": { - Title: "Program", - Type: "string", + Title: "Program", + Description: "JavaScript program to run", + Type: "string", }, }, Required: []string{"program"}, diff --git a/internal/processor/script-wasm.go b/internal/processor/script-wasm.go index 04929ba..24ab948 100644 --- a/internal/processor/script-wasm.go +++ b/internal/processor/script-wasm.go @@ -20,18 +20,21 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "path": { - Title: "Path", - Type: "string", + Title: "Path", + Description: "path to the WASM plugin to load", + Type: "string", }, "function": { - Title: "Function", - Type: "string", - Default: json.RawMessage(`"process"`), + Title: "Function", + Description: "exported function to call on the WASM plugin", + Type: "string", + Default: json.RawMessage(`"process"`), }, "enableWasi": { - Title: "Enable WASI", - Type: "boolean", - Default: json.RawMessage("false"), + Title: "Enable WASI", + Description: "whether to enable WASI when running the WASM plugin", + Type: "boolean", + Default: json.RawMessage("false"), }, }, Required: []string{"path"}, diff --git a/internal/processor/sip-response-audio-create.go b/internal/processor/sip-response-audio-create.go index 26b4f9b..04f0672 100644 --- a/internal/processor/sip-response-audio-create.go +++ b/internal/processor/sip-response-audio-create.go @@ -19,15 +19,19 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "preWait": { - Title: "Pre Wait (ms)", - Type: "integer", - }, - "postWait": { - Title: "Post Wait (ms)", - Type: "integer", + Title: "Pre Wait (ms)", + Description: "number of milliseconds to wait before playing the audio", + Type: "integer", }, "audioFile": { - Type: "string", + Title: "Audio File", + Description: "path to the audio file to play", + Type: "string", + }, + "postWait": { + Title: "Post Wait (ms)", + Description: "number of milliseconds to wait after playing the audio", + Type: "integer", }, }, Required: []string{"preWait", "postWait", "audioFile"}, diff --git a/internal/processor/sip-response-dtmf-create.go b/internal/processor/sip-response-dtmf-create.go index 2bb0fdc..17eeba2 100644 --- a/internal/processor/sip-response-dtmf-create.go +++ b/internal/processor/sip-response-dtmf-create.go @@ -21,15 +21,19 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "preWait": { - Title: "Pre Wait (ms)", - Type: "integer", - }, - "postWait": { - Title: "Post Wait (ms)", - Type: "integer", + Title: "Pre Wait (ms)", + Description: "number of milliseconds to wait before sending the DTMF tones", + Type: "integer", }, "digits": { - Type: "string", + Title: "Digits", + Description: "DTMF digits to send", + Type: "string", + }, + "postWait": { + Title: "Post Wait (ms)", + Description: "number of milliseconds to wait after sending the DTMF tones", + Type: "integer", }, }, Required: []string{"preWait", "postWait", "digits"}, diff --git a/internal/processor/string-create.go b/internal/processor/string-create.go index db54134..0b2740b 100644 --- a/internal/processor/string-create.go +++ b/internal/processor/string-create.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "template": { - Title: "Template", - Type: "string", + Title: "Template", + Description: "template to evaluate", + Type: "string", }, }, Required: []string{"template"}, diff --git a/internal/processor/string-split.go b/internal/processor/string-split.go index 8d683fc..5459f0b 100644 --- a/internal/processor/string-split.go +++ b/internal/processor/string-split.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "separator": { - Title: "Separator", - Type: "string", + Title: "Separator", + Description: "separator to split the string on", + Type: "string", }, }, Required: []string{"separator"}, diff --git a/internal/processor/struct-field-get.go b/internal/processor/struct-field-get.go index fc7b807..83bf418 100644 --- a/internal/processor/struct-field-get.go +++ b/internal/processor/struct-field-get.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "name": { - Title: "Field Name", - Type: "string", + Title: "Field Name", + Description: "name of the struct field to extract", + Type: "string", }, }, Required: []string{"name"}, diff --git a/internal/processor/struct-method-get.go b/internal/processor/struct-method-get.go index 2e530cd..3386bbe 100644 --- a/internal/processor/struct-method-get.go +++ b/internal/processor/struct-method-get.go @@ -19,8 +19,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "name": { - Title: "Method Name", - Type: "string", + Title: "Method Name", + Description: "name of the struct method to extract and call (with no arguments)", + Type: "string", }, }, Required: []string{"name"}, diff --git a/internal/processor/time-sleep.go b/internal/processor/time-sleep.go index fcccd07..0165270 100644 --- a/internal/processor/time-sleep.go +++ b/internal/processor/time-sleep.go @@ -19,8 +19,8 @@ func init() { Properties: map[string]*jsonschema.Schema{ "duration": { Title: "Duration", + Description: "time to sleep in milliseconds", Type: "integer", - Description: "Duration to sleep in milliseconds", }, }, Required: []string{"duration"},