Initial Commit

This commit is contained in:
2026-05-27 23:29:53 +01:00
commit fbc70f96e6
10000 changed files with 1102152 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import z from "zod";
/**
* Zod schema for SSE events accepted by `SseService.broadcast`. `data`
* may be any JSON-serialisable value (object, array, string, number,
* boolean, null) so application payloads flow through without forcing
* callers to pre-stringify. The handler is responsible for JSON
* serialisation on the wire.
*/
export const SseEventSchema = z.object({
id: z.string().min(1).optional(),
event: z.string().min(1).optional(),
data: z.unknown(),
retry: z.number().int().positive().optional(),
});
export type SseEventInputParsed = z.input<typeof SseEventSchema>;
export type SseEventResolved = z.output<typeof SseEventSchema>;