Files
sign/packages/trpc/server/api-token-router/schema.ts

23 lines
725 B
TypeScript
Raw Normal View History

2023-11-24 13:59:33 +02:00
import { z } from 'zod';
export const ZGetApiTokenByIdQuerySchema = z.object({
id: z.number().min(1),
});
export type TGetApiTokenByIdQuerySchema = z.infer<typeof ZGetApiTokenByIdQuerySchema>;
2023-11-24 13:59:33 +02:00
export const ZCreateTokenMutationSchema = z.object({
2024-02-22 13:39:34 +11:00
teamId: z.number().optional(),
2023-11-24 13:59:33 +02:00
tokenName: z.string().min(3, { message: 'The token name should be 3 characters or longer' }),
2024-02-09 11:32:54 +02:00
expirationDate: z.string().nullable(),
2023-11-24 13:59:33 +02:00
});
export type TCreateTokenMutationSchema = z.infer<typeof ZCreateTokenMutationSchema>;
2023-11-24 13:59:33 +02:00
export const ZDeleteTokenByIdMutationSchema = z.object({
id: z.number().min(1),
2024-02-22 13:39:34 +11:00
teamId: z.number().optional(),
2023-11-24 13:59:33 +02:00
});
export type TDeleteTokenByIdMutationSchema = z.infer<typeof ZDeleteTokenByIdMutationSchema>;