implement sse

This commit is contained in:
Darius
2026-02-05 22:40:50 +01:00
parent 6e1c5e4e67
commit 582c82d66f
6 changed files with 262 additions and 169 deletions

View File

@@ -1,21 +1,14 @@
import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
import type { FastifyInstance } from "fastify";
import { z } from "zod";
import type { TidalService } from "../tidal/service.js";
import { HomeAssistantService } from "../homeassistant/service.js";
import { HomepageService } from "./service.js";
import { API_HA_DeskPosition, TidalGetCurrent } from "@dpu/shared";
import { type HomepageService } from "./service.js";
import { type API_HA_DeskPosition, type TidalGetCurrent } from "@dpu/shared";
export async function homepageRoutes(
fastify: FastifyInstance,
{
hpService,
verifyAPIKey,
}: {
hpService: HomepageService
verifyAPIKey: (
request: FastifyRequest,
reply: FastifyReply,
) => Promise<void>;
hpService: HomepageService;
},
) {
fastify.get(