From 42a585d880751e2dcf00e654678f96c2d40f5d6c Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 15 Dec 2025 11:47:40 +0000 Subject: [PATCH] feat: add user types with zod schemas --- surfsense_web/contracts/types/user.types.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 surfsense_web/contracts/types/user.types.ts diff --git a/surfsense_web/contracts/types/user.types.ts b/surfsense_web/contracts/types/user.types.ts new file mode 100644 index 000000000..f5df17694 --- /dev/null +++ b/surfsense_web/contracts/types/user.types.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; + +export const user = z.object({ + id: z.string().uuid(), + email: z.string().email(), + is_active: z.boolean(), + is_superuser: z.boolean(), + is_verified: z.boolean(), + pages_limit: z.number(), + pages_used: z.number(), +}); + +/** + * Get current user + */ +export const getMeResponse = user; + +export type User = z.infer; +export type GetMeResponse = z.infer;