Add typed command argument contract
API checks / checks (push) Canceled after 0s
API dependency and security checks / audit (push) Canceled after 0s

This commit is contained in:
2026-10-25 06:12:38 +01:00
parent 4efa617e25
commit 0400b12566
3 changed files with 29 additions and 0 deletions
+3
View File
@@ -43,3 +43,6 @@ contain only local synthetic data.
Named-user command rules use `bot-command-user-rule.json`; fixtures contain
only synthetic Twitch IDs and literal response templates.
Typed command arguments use `bot-command-argument-definition.json` and remain
literal validated data.
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.invalid/contracts/v1/bot-command-argument-definition.json",
"title": "Trixie typed bot command argument",
"type": "object",
"additionalProperties": false,
"required": ["name", "kind", "required"],
"properties": {
"name": { "type": "string", "pattern": "^[A-Za-z0-9_]{1,64}$" },
"kind": { "enum": ["text", "number", "choice", "username", "duration"] },
"required": { "type": "boolean" },
"default": { "type": ["string", "null"], "maxLength": 200 },
"minimum": { "type": ["integer", "null"] },
"maximum": { "type": ["integer", "null"] },
"choices": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 200 } }
}
}
@@ -0,0 +1,9 @@
{
"name": "count",
"kind": "number",
"required": true,
"default": null,
"minimum": 1,
"maximum": 5,
"choices": []
}