import { z } from "zod"; export const HealthResponse = z.object({ ok: z.literal(true) }); export type HealthResponse = z.infer; export const PasswordBody = z.object({ password: z.string().min(8).max(200) }); export const MeResponse = z.object({ needsSetup: z.boolean(), authenticated: z.boolean() }); export type MeResponse = z.infer; export const SettingsResponse = z.object({ llmBaseUrl: z.string(), llmModel: z.string(), llmKeyMasked: z.string().nullable(), }); export type SettingsResponse = z.infer; export const SettingsUpdate = z.object({ llmBaseUrl: z.string().url().optional(), llmModel: z.string().min(1).optional(), llmKey: z.string().min(1).optional(), }); export type SettingsUpdate = z.infer; export const ExtractedMarker = z.object({ panel: z.string().nullable().default(null), name: z.string().min(1), value: z.string().min(1), unit: z.string().nullable().default(null), referenceRange: z.string().nullable().default(null), flagged: z.boolean().default(false), }); export type ExtractedMarker = z.infer; export const ExtractedDraft = z.object({ collectedDate: z.string().nullable().default(null), labName: z.string().nullable().default(null), markers: z.array(ExtractedMarker).default([]), }); export type ExtractedDraft = z.infer; export const ConfirmDraftBody = z.object({ collectedDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/), labName: z.string().nullable().default(null), markers: z.array(ExtractedMarker).min(1), }); export type ConfirmDraftBody = z.infer;