mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat: add user types with zod schemas
This commit is contained in:
parent
8aedead33e
commit
42a585d880
1 changed files with 19 additions and 0 deletions
19
surfsense_web/contracts/types/user.types.ts
Normal file
19
surfsense_web/contracts/types/user.types.ts
Normal file
|
|
@ -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<typeof user>;
|
||||||
|
export type GetMeResponse = z.infer<typeof getMeResponse>;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue