1import { z } from "zod";
2
3export const ListCommentsQuery = z.object({
4 targetType: z.enum(["block", "record", "page"]).optional(),
5 pageId: z.string().min(1).optional(),
6 blockId: z.string().min(1).optional(),
7 recordId: z.string().min(1).optional(),
8 cursor: z.string().optional(),
9 limit: z.string().optional()
10});
11export type ListCommentsInput = z.infer<typeof ListCommentsQuery>;
12
13export const CreateCommentDto = z.object({
14 targetType: z.enum(["block", "record", "page"]),
15 targetId: z.string().min(1),
16
17 parentId: z.string().min(1).optional(),
18 body: z.string().min(1).max(20_000)
19});
20export type CreateCommentInput = z.infer<typeof CreateCommentDto>;
21
22export const UpdateCommentDto = z.object({
23 body: z.string().min(1).max(20_000)
24});
25export type UpdateCommentInput = z.infer<typeof UpdateCommentDto>;
26
27export const ReactionDto = z.object({
28 emoji: z.string().min(1).max(8)
29});
30export type ReactionInput = z.infer<typeof ReactionDto>;
31