37 lines
900 B
TypeScript
37 lines
900 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const UserListSchema = z.object({
|
|
limit: z.number().nullish(),
|
|
from: z.number().nullish(),
|
|
|
|
name: z.string().nullish(),
|
|
playertype: z.enum(['java', 'bedrock', 'noauth']).nullish(),
|
|
|
|
search: z.string().nullish(),
|
|
slim: z.boolean().nullish()
|
|
});
|
|
|
|
export const UserEditSchema = z.object({
|
|
id: z.number(),
|
|
firstname: z.string().nullish(),
|
|
lastname: z.string().nullish(),
|
|
birthday: z.coerce.date().nullish(),
|
|
telephone: z.string().nullish(),
|
|
username: z.string().nullish(),
|
|
playertype: z.enum(['java', 'bedrock', 'noauth']).nullish(),
|
|
uuid: z.string().nullish()
|
|
});
|
|
|
|
export const UserAddSchema = z.object({
|
|
firstname: z.string(),
|
|
lastname: z.string(),
|
|
birthday: z.coerce.date(),
|
|
telephone: z.string().nullish(),
|
|
username: z.string(),
|
|
playertype: z.enum(['java', 'bedrock', 'noauth'])
|
|
});
|
|
|
|
export const UserDeleteSchema = z.object({
|
|
id: z.number()
|
|
});
|