feat(contracts): todo, settings, collab and file routes declare their response schemas

shared gains the response schemas these routes answer with (rows in their
storage spelling, as the routes have always sent them) plus the common
success and empty answers, all exported for the client to type its calls
with. Every JSON handler in the four controllers carries its
@ResponseContract; the file download, which streams, is marked exempt. The
files e2e fixture table gains the note_id column the real one has.
This commit is contained in:
Maurice
2026-10-10 15:54:15 +02:00
parent 87071bf738
commit 8e01dbb92f
12 changed files with 378 additions and 7 deletions
+7
View File
@@ -20,3 +20,10 @@ export const nonEmptyString = z.string().trim().min(1);
/** ISO-8601 timestamp string (the shape TREK serialises dates as in JSON). */
export const isoDateTime = z.string().datetime({ offset: true });
/** The `{ success: true }` body a write answers with when it has nothing else to say. */
export const successResponseSchema = z.object({ success: z.literal(true) });
export type SuccessResponse = z.infer<typeof successResponseSchema>;
/** A 204 answer: the handler returns nothing, so no body goes out. */
export const emptyResponseSchema = z.undefined();