@showbridge/cli
Version:
Simple Protocol Router /s
1,499 lines (1,497 loc) • 90.7 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "Config",
"title": "Config File Schema",
"description": "config JSON layout",
"type": "object",
"properties": {
"protocols": {
"description": "protocol config section",
"type": "object",
"properties": {
"cloud": {
"$ref": "#/definitions/ProtocolCloud"
},
"http": {
"$ref": "#/definitions/ProtocolHTTP"
},
"midi": {
"$ref": "#/definitions/ProtocolMIDI"
},
"mqtt": {
"$ref": "#/definitions/ProtocolMQTT"
},
"tcp": {
"$ref": "#/definitions/ProtocolTCP"
},
"udp": {
"$ref": "#/definitions/ProtocolUDP"
}
}
},
"handlers": {
"description": "message type handler config section",
"type": "object",
"properties": {
"http": {
"title": "HTTP",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerHTTPRequest" },
{ "$ref": "#/definitions/TriggerSender" },
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"ws": {
"title": "WebSocket",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerSender" },
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"osc": {
"title": "OSC",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerSender" },
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerBytesEqual" },
{ "$ref": "#/definitions/TriggerOSCAddress" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"tcp": {
"title": "TCP",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerSender" },
{ "$ref": "#/definitions/TriggerBytesEqual" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"udp": {
"title": "UDP",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerSender" },
{ "$ref": "#/definitions/TriggerBytesEqual" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"midi": {
"title": "MIDI",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerBytesEqual" },
{ "$ref": "#/definitions/TriggerMIDI" },
{ "$ref": "#/definitions/TriggerMIDINoteOff" },
{ "$ref": "#/definitions/TriggerMIDINoteOn" },
{ "$ref": "#/definitions/TriggerMIDIControlChange" },
{ "$ref": "#/definitions/TriggerMIDIPitchBend" },
{ "$ref": "#/definitions/TriggerMIDIProgramChange" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
},
"mqtt": {
"title": "MQTT",
"type": "object",
"properties": {
"triggers": {
"description": "array of triggers",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/TriggerRegex" },
{ "$ref": "#/definitions/TriggerMQTTTopiic" },
{ "$ref": "#/definitions/TriggerAny" }
]
}
}
},
"required": ["triggers"],
"additionalProperties": false
}
}
}
},
"required": ["handlers", "protocols"],
"definitions": {
"ActionList": {
"description": "Actions to be performed if this trigger is fired",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/ActionLog" },
{ "$ref": "#/definitions/ActionStore" },
{ "$ref": "#/definitions/ActionMIDIOutput" },
{ "$ref": "#/definitions/ActionForward" },
{ "$ref": "#/definitions/ActionOSCOutput" },
{ "$ref": "#/definitions/ActionUDPOutput" },
{ "$ref": "#/definitions/ActionTCPOutput" },
{ "$ref": "#/definitions/ActionShell" },
{ "$ref": "#/definitions/ActionHTTPRequest" },
{ "$ref": "#/definitions/ActionMQTTOutput" },
{ "$ref": "#/definitions/ActionHTTPResponse" },
{ "$ref": "#/definitions/ActionCloudOutput" },
{ "$ref": "#/definitions/ActionDelay" },
{ "$ref": "#/definitions/ActionRandom" }
]
}
},
"ActionLog": {
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Log",
"description": "This action logs out the incoming message",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "log"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled"],
"additionalProperties": false
},
"ActionStore": {
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Store",
"description": "This action stores the configured value in a global vars object. Which will be made available when templating things.",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "store"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "Store action params",
"type": "object",
"properties": {
"_key": {
"title": "key",
"description": "key of the variable to store ran through templating",
"type": "string"
},
"key": {
"description": "key of the variable to store",
"type": "string"
},
"_value": {
"title": "value",
"description": "value of the variable to store ran through templating",
"type": "string"
},
"value": {
"description": "value of the variable to store",
"type": "string"
}
},
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "params", "enabled"],
"additionalProperties": false
},
"ActionCloudOutput": {
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Cloud Output",
"description": "This action will send the incoming message to the specified cloud room",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "cloud-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "Cloud Output action params",
"type": "object",
"properties": {
"rooms": {
"description": "array of rooms to send the message to",
"type": "array",
"items": {
"type": "string"
},
"examples": ["room1"]
},
"_rooms": {
"title": "rooms",
"description": "array of rooms to template and then send the message to",
"type": "array",
"items": {
"type": "string"
},
"examples": ["${msg.prop1}"]
}
}
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "params", "enabled"],
"additionalProperties": false
},
"ActionMIDIOutput": {
"title": "MIDI Output",
"description": "This action will output MIDI using raw MIDI data byte array",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "midi-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "MIDI output action params",
"type": "object",
"oneOf": [
{
"title": "MIDI Bytes",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"bytes": {
"description": "MIDI data to be sent as an array of 3 bytes",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"minItems": 2,
"maxItems": 3,
"examples": ["144"]
}
},
"required": ["bytes"],
"additionalProperties": false
},
{
"title": "MIDI Note Off Message",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "note_off"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"note": {
"description": "MIDI note value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["60"]
},
"velocity": {
"description": "MIDI velocity value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["127"]
}
},
"required": ["status", "channel", "note", "velocity"],
"additionalProperties": false
},
{
"title": "MIDI Note On Message",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "note_on"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"note": {
"description": "MIDI note value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["60"]
},
"velocity": {
"description": "MIDI velocity value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["127"]
}
},
"required": ["status", "channel", "note", "velocity"],
"additionalProperties": false
},
{
"title": "MIDI Polyphonic Aftertouch",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "polyphonic_aftertouch"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"note": {
"description": "MIDI note value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["60"]
},
"pressure": {
"description": "MIDI pressure value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["40"]
}
},
"required": ["status", "channel", "note", "pressure"],
"additionalProperties": false
},
{
"title": "MIDI Control Change",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "control_change"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"control": {
"description": "MIDI control value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["7"]
},
"value": {
"description": "MIDI value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["70"]
}
},
"required": ["status", "control", "value"],
"additionalProperties": false
},
{
"title": "MIDI Program Change",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "program_change"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"program": {
"description": "MIDI program value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["10"]
}
},
"required": ["status", "program"],
"additionalProperties": false
},
{
"title": "MIDI Channel Aftertouch",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "channel_aftertouch"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"pressure": {
"description": "MIDI pressure value",
"type": "number",
"minimum": 0,
"maximum": 127,
"examples": ["60"]
}
},
"required": ["status", "pressure"],
"additionalProperties": false
},
{
"title": "MIDI Pitch Bend",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "pitch_bend"
},
"channel": {
"description": "MIDI channel number",
"type": "number",
"minimum": 1,
"maximum": 16,
"examples": ["1"]
},
"value": {
"description": "MIDI value",
"type": "number",
"minimum": 0,
"maximum": 16383,
"examples": ["7000"]
}
},
"required": ["status", "value"],
"additionalProperties": false
},
{
"title": "MIDI Start",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "start"
}
},
"required": ["status"],
"additionalProperties": false
},
{
"title": "MIDI Continue",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "continue"
}
},
"required": ["status"],
"additionalProperties": false
},
{
"title": "MIDI Stop",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "stop"
}
},
"required": ["status"],
"additionalProperties": false
},
{
"title": "MIDI Reset",
"type": "object",
"properties": {
"port": {
"description": "the MIDI port to send on",
"type": "string"
},
"_port": {
"title": "port",
"description": "JS template of the MIDI port to send on",
"type": "string"
},
"status": {
"description": "MIDI status value",
"type": "string",
"const": "reset"
}
},
"required": ["status"],
"additionalProperties": false
}
],
"required": []
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionForward": {
"title": "Forward",
"description": "This action will forward the incoming message to the configured destination",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "forward"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "forward action params",
"type": "object",
"properties": {
"host": {
"description": "Hostname or address of the server to forward message to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to forward msg to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to forward msg to",
"type": "string"
},
"protocol": {
"description": "Protocol to use when forwarding msg",
"type": "string",
"enum": ["udp", "tcp"]
}
},
"required": ["protocol"],
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionOSCOutput": {
"title": "OSC Output",
"description": "This action will send an OSC message to the configure address:port with the configured address and args",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "osc-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "OSC output action params",
"type": "object",
"properties": {
"host": {
"description": "Hostname or address of the server to send OSC to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send OSC to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"protocol": {
"description": "Protocol to use when sending OSC",
"type": "string",
"enum": ["udp", "tcp"]
},
"_address": {
"title": "address",
"description": "JS template of the OSC address. Will have access to the msg object to subsitute in properties of the message that triggered this action",
"type": "string",
"examples": ["${msg.prop1}"]
},
"address": {
"description": "Hardcoded OSC address. _address has priority",
"type": "string",
"examples": ["/osc/address"]
},
"_args": {
"title": "args",
"description": "Array of args. Strings will be ran through the templating engine same as the _address param",
"type": "array",
"items": {
"type": "string"
},
"examples": ["${msg.prop1}"]
},
"args": {
"description": "Hardcoded array of OSC args",
"type": "array",
"items": {
"type": "string"
},
"examples": ["arg1"]
}
},
"required": ["protocol"],
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionUDPOutput": {
"title": "UDP Output",
"description": "This action will send a UDP packet to the configured address:port with the configured contents",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "udp-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "UDP output action params",
"type": "object",
"oneOf": [
{
"title": "UDP Bytes",
"properties": {
"host": {
"description": "Hostname or address of the server to send UDP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send UDP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"bytes": {
"description": "bytes to send",
"type": "array",
"items": {
"type": "number"
},
"examples": ["215"]
}
},
"required": ["bytes"],
"additionalProperties": false
},
{
"title": "UDP Hex",
"properties": {
"host": {
"description": "Hostname or address of the server to send UDP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send UDP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"hex": {
"description": "hex string to be sent as bytes (i.e 68 69, 6869, 0x68 0x69, 0x68,0x69)",
"type": "string",
"pattern": "^[0-9A-Fa-f\\sx,]+$",
"examples": ["0xdeadbeef"]
}
},
"required": ["hex"],
"additionalProperties": false
},
{
"title": "UDP String",
"properties": {
"host": {
"description": "Hostname or address of the server to send UDP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send UDP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"_string": {
"title": "string",
"description": "string to send ran through templating engine",
"type": "string",
"examples": ["${msg.prop1}"]
},
"string": {
"description": "string to send",
"type": "string",
"examples": ["message"]
}
}
}
]
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionTCPOutput": {
"title": "TCP Output",
"description": "This action will send a TCP packet to the configured address:port with the configured contents",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "tcp-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "TCP output action params",
"type": "object",
"oneOf": [
{
"title": "TCP Bytes",
"properties": {
"host": {
"description": "Hostname or address of the server to send TCP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send TCP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"slip": {
"description": "whether to SLIP encode the TCP bytes",
"type": "boolean",
"default": true
},
"bytes": {
"description": "bytes to send",
"type": "array",
"items": {
"type": "number"
},
"examples": ["24, 25, 26"]
}
},
"required": ["slip", "bytes"],
"additionalProperties": false
},
{
"title": "TCP Hex",
"properties": {
"host": {
"description": "Hostname or address of the server to send TCP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send TCP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"slip": {
"description": "whether to SLIP encode the TCP bytes",
"type": "boolean",
"default": true
},
"hex": {
"description": "hex string to be sent as bytes (i.e 68 69, 6869, 0x68 0x69, 0x68,0x69)",
"type": "string",
"pattern": "^[0-9A-Fa-f\\sx,]+$",
"examples": ["0x42"]
}
},
"required": ["slip", "hex"],
"additionalProperties": false
},
{
"title": "TCP String",
"properties": {
"host": {
"description": "Hostname or address of the server to send TCP packet to",
"type": "string",
"examples": ["127.0.0.1"]
},
"_host": {
"title": "host",
"description": "Template for the hostname or address of the server to forward message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"port": {
"description": "Port to send TCP packet to",
"type": "integer",
"minimum": 1,
"maximum": 65535,
"examples": ["8000"]
},
"_port": {
"title": "port",
"description": "Template for the port to send msg on",
"type": "string",
"examples": ["${msg.prop1}"]
},
"slip": {
"description": "whether to SLIP encode the TCP bytes",
"type": "boolean",
"default": true
},
"_string": {
"title": "string",
"description": "string to send ran through templating engine",
"type": "string",
"examples": ["${msg.prop1}"]
},
"string": {
"description": "string to send",
"type": "string",
"examples": ["message"]
}
},
"required": ["slip"]
}
]
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionShell": {
"title": "Shell Command",
"description": "This action will execute the configured shell command on the system that is running the router",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "shell"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "Shell action params",
"type": "object",
"properties": {
"_command": {
"title": "command",
"description": "JS literal template of the shell command to run",
"type": "string",
"examples": ["${msg.prop1}"]
},
"command": {
"description": "Shell command to run",
"type": "string",
"examples": ["touch hello.txt"]
}
}
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionHTTPRequest": {
"title": "HTTP Request",
"description": "This command will make the configured http call",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "http-request"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "HTTP action params",
"type": "object",
"properties": {
"method": {
"description": "The HTTP method to use i.e GET, POST, PUT",
"type": "string",
"enum": ["get", "post", "put", "delete", "patch", "GET", "POST", "PUT", "DELETE", "PATCH"]
},
"_url": {
"title": "url",
"description": "JS literal template of the url. Will have access to the properties of the incoming message that triggered this action",
"type": "string",
"examples": ["${msg.prop1}"]
},
"url": {
"description": "Url to call",
"type": "string",
"examples": ["https://example.com"]
},
"contentType": {
"description": "Content-Type header value mainly useful for POST/PUT/PATCH",
"type": "string",
"examples": ["application/json"]
},
"_body": {
"title": "body",
"description": "JS literal template of the body. Will have access to the properties of the incoming message that triggered this action",
"type": "string",
"examples": ["${msg.prop1}"]
},
"body": {
"description": "Body to include with the request",
"type": "string",
"examples": ["OK"]
}
},
"required": ["method"],
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionRandom": {
"title": "Random",
"description": "This action will execute a randomly selected action from the configured subactions",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "random"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "random action params",
"type": "object",
"properties": {
"actions": {
"description": "array of actions to randomly pick from",
"type": "array",
"$ref": "#/definitions/ActionList",
"examples": ["YOU PROBABLY SHOULDN'T BE EDITING THIS"]
}
},
"required": ["actions"],
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionDelay": {
"title": "Delay",
"description": "This action will execute the configured actions after the configured amount of time",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "delay"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"description": "delay action params",
"type": "object",
"properties": {
"duration": {
"description": "time in ms to wait",
"type": "number",
"examples": ["3000"]
},
"actions": {
"description": "array of actions to execute after delaying",
"type": "array",
"$ref": "#/definitions/ActionList",
"examples": ["YOU PROBABLY SHOULDN'T BE EDITING THIS"]
}
},
"required": ["duration", "actions"],
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "enabled", "params"],
"additionalProperties": false
},
"ActionMQTTOutput": {
"title": "MQTT Output",
"description": "This action publishes an MQTT message",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "mqtt-output"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"type": "object",
"properties": {
"_topic": {
"title": "topic",
"description": "the templated MQTT topic to publish the message to",
"type": "string",
"examples": ["${msg.prop1}"]
},
"topic": {
"description": "the static MQTT topic to publish the message to",
"type": "string",
"examples": ["topic/1"]
},
"_payload": {
"title": "payload",
"description": "the templated payload of the mqtt message",
"type": "string",
"examples": ["${msg.prop1}"]
},
"payload": {
"description": "the static payload of the mqtt message",
"type": "string",
"examples": ["payload"]
}
},
"additionalProperties": false
},
"enabled": {
"description": "Whether this action is enabled",
"type": "boolean",
"default": true
}
},
"required": ["type", "params", "enabled"],
"additionalProperties": false
},
"ActionHTTPResponse": {
"title": "HTTP Response",
"description": "This action responds to the incoming http request",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "http-response"
},
"comment": {
"type": "string"
},
"transforms": {
"$ref": "#/definitions/TransformList"
},
"params": {
"type": "object",
"oneOf": [
{
"title": "String Body",
"properties": {
"_body": {
"title": "body",
"description": "the templated body of the HTTP response",
"type": "string",
"examples": ["<h1>${msg.originalURL}</h1>"]
},
"body": {
"title": "body",
"description": "the body of the HTTP response",
"type": "string",
"examples": ["<h1>Hello World!</h1>"]
},
"contentType": {
"title": "content type",
"type": "string",
"default": "text/plain",