feat: add Twitch OAuth response contracts

This commit is contained in:
2026-10-25 04:36:50 +01:00
parent d5a4027708
commit 2760f0234f
5 changed files with 49 additions and 0 deletions
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.reaperofveriod.nl/contracts/v1/twitch-oauth-link-response.json",
"title": "Twitch OAuth authorization link response",
"type": "object",
"additionalProperties": false,
"required": ["identity", "scopes", "authorization_url", "expires_in_seconds"],
"properties": {
"identity": { "enum": ["streamer", "bot", "moderator"] },
"scopes": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"minItems": 1,
"uniqueItems": true
},
"authorization_url": {
"type": "string",
"format": "uri",
"pattern": "^https://id\\.twitch\\.tv/oauth2/authorize\\?"
},
"expires_in_seconds": { "type": "integer", "const": 600 }
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.reaperofveriod.nl/contracts/v1/twitch-oauth-result.json",
"title": "Twitch OAuth completion response",
"type": "object",
"additionalProperties": false,
"required": ["identity", "twitch_user_id", "display_name"],
"properties": {
"identity": { "enum": ["streamer", "bot", "moderator"] },
"twitch_user_id": { "type": "string", "minLength": 1 },
"display_name": { "type": "string", "minLength": 1 }
}
}