actually include the plugin configuration schemas

This commit is contained in:
Evert Prants 2021-10-02 14:00:16 +03:00
parent 1c18fc665b
commit 3c5183192e
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 138 additions and 0 deletions

46
control/schema.json Normal file
View File

@ -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"]
}

44
permissions/schema.json Normal file
View File

@ -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"]
}

View File

@ -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"]
}