diff --git a/control/schema.json b/control/schema.json new file mode 100644 index 0000000..46e53d9 --- /dev/null +++ b/control/schema.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://squeebot.lunasqu.ee/pkg/plugins-core/control.schema.json", + "title": "Control", + "description": "Plugin control configuration", + "type": "object", + "properties": { + "authorizedIPs": { + "type": "array", + "description": "List of authorized IPs", + "items": { + "type": "string" + } + }, + "tls": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable TLS" + }, + "key": { + "type": "string", + "description": "TLS server private key" + }, + "cert": { + "type": "string", + "description": "TLS server certificate" + }, + "rejectUnauthorized": { + "type": "boolean", + "description": "Reject unauthorized client certificates" + }, + "requestCert": { + "type": "boolean", + "description": "Request client certificates" + } + } + }, + "bind": { + "type": ["number", "string", "null"], + "description": "Bind to port or domain socket" + } + }, + "required": ["authorizedIPs", "tls"] +} diff --git a/permissions/schema.json b/permissions/schema.json new file mode 100644 index 0000000..7456f3b --- /dev/null +++ b/permissions/schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://squeebot.lunasqu.ee/pkg/plugins-core/permissions.schema.json", + "title": "permissions", + "description": "Plugin permissions configuration", + "type": "object", + "properties": { + "users": { + "type": "object", + "description": "User's global permissions", + "patternProperties": { + ".*": { + "anyOf": [ + { "type": "string" }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "rooms": { + "type": "object", + "description": "Room specific user permissions", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "required": ["users", "rooms"] +} diff --git a/simplecommands/schema.json b/simplecommands/schema.json new file mode 100644 index 0000000..470c080 --- /dev/null +++ b/simplecommands/schema.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://squeebot.lunasqu.ee/pkg/plugins-core/simplecommands.schema.json", + "title": "simplecommands", + "description": "Plugin simplecommands configuration", + "type": "object", + "properties": { + "prefix": { + "type": "object", + "description": "Per-room command prefix", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "rateLimits": { + "type": "array", + "description": "Per-room command rate limits", + "items": { + "type": "object", + "properties": { + "rooms": { + "type": "array", + "description": "The rooms this applies to", + "items": { + "type": "string" + } + }, + "cooldown": { + "type": "integer", + "description": "Rate limit cooldown time" + }, + "perSecond": { + "type": "integer", + "description": "Commands sent per second" + } + }, + "required": ["rooms", "cooldown", "perSecond"] + } + }, + "channelMatching": { + "type": "boolean", + "description": "Only handle commands from the channels of the source protocol" + } + }, + "required": ["prefix", "rateLimits", "channelMatching"] +}