From 90335ce1bd75d8498f32cc8a65ac6905bb2d2174 Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 03:52:40 +0100 Subject: [PATCH] feat: add initial v1 contracts --- README.md | 2 ++ contracts/v1/health.json | 11 +++++++++++ contracts/v1/server-info.json | 13 +++++++++++++ fixtures/v1/server-info.ready.json | 5 +++++ 4 files changed, 31 insertions(+) create mode 100644 contracts/v1/health.json create mode 100644 contracts/v1/server-info.json create mode 100644 fixtures/v1/server-info.ready.json diff --git a/README.md b/README.md index 66e0902..67e5d86 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ Shared versioned HTTP and authenticated WebSocket contracts for `trixie-server` This repository contains schemas, shared enums, error codes, compatibility fixtures, contract tests, and API documentation only. +The first contract slice is under `contracts/v1/` and `fixtures/v1/`. It covers server readiness and health so the client and server can be developed and tested together before Twitch integration. + diff --git a/contracts/v1/health.json b/contracts/v1/health.json new file mode 100644 index 0000000..82d4c90 --- /dev/null +++ b/contracts/v1/health.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.invalid/contracts/v1/health.json", + "title": "Trixie Health", + "type": "object", + "additionalProperties": false, + "required": ["status"], + "properties": { + "status": { "type": "string", "enum": ["ok"] } + } +} diff --git a/contracts/v1/server-info.json b/contracts/v1/server-info.json new file mode 100644 index 0000000..041654b --- /dev/null +++ b/contracts/v1/server-info.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.invalid/contracts/v1/server-info.json", + "title": "Trixie Server Info", + "type": "object", + "additionalProperties": false, + "required": ["api_version", "server_version", "status"], + "properties": { + "api_version": { "type": "string", "const": "v1" }, + "server_version": { "type": "string", "minLength": 1 }, + "status": { "type": "string", "enum": ["ready"] } + } +} diff --git a/fixtures/v1/server-info.ready.json b/fixtures/v1/server-info.ready.json new file mode 100644 index 0000000..ff0a099 --- /dev/null +++ b/fixtures/v1/server-info.ready.json @@ -0,0 +1,5 @@ +{ + "api_version": "v1", + "server_version": "0.1.0-dev", + "status": "ready" +}