From c65504ee9fd328a4115f5bb1e4dc2445e90e06c1 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Mon, 8 Jun 2026 17:57:11 +0000 Subject: [PATCH] feat(ui): Define initial API contract --- src/core/Api.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/core/Api.ts diff --git a/src/core/Api.ts b/src/core/Api.ts new file mode 100644 index 00000000..b7353789 --- /dev/null +++ b/src/core/Api.ts @@ -0,0 +1,37 @@ +import { ErrorLike, JsonPlayObject, PlayState } from "./Atomic.js" + +export type PlayApiCommon = { + uid: string + componentId: number + state: PlayState + play: JsonPlayObject + compacted: boolean + playedAt: string + seentAt: string + updatedAt: string + parentUid?: string + // TODO add parent source type/name? +} + +export type PlayInputApi = { + id: number + data: object + play: JsonPlayObject + createdAt: string +} + +export type QueueStateApi = { + id: number + queueName: string + queueState: string + retries: number + error?: ErrorLike + createdAt: string + updatedAt: string +} + +export type PlayApiCommonDetailed = PlayApiCommon & { + error: ErrorLike + input: PlayInputApi + queueStates: QueueStateApi[] +} \ No newline at end of file -- 2.51.2