feat: add Twitch OAuth response contracts
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
@@ -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 }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user