chore: template attachments

This commit is contained in:
Catalin Pit
2025-07-07 13:31:55 +03:00
parent 30b240cba2
commit e19da93ce2
19 changed files with 583 additions and 195 deletions

View File

@ -15,6 +15,19 @@ export const ZGetDocumentAttachmentsResponseSchema = z.array(
}),
);
export const ZGetTemplateAttachmentsSchema = z.object({
templateId: z.number(),
});
export const ZGetTemplateAttachmentsResponseSchema = z.array(
z.object({
id: z.string(),
label: z.string(),
url: z.string(),
type: z.nativeEnum(AttachmentType),
}),
);
export const ZSetDocumentAttachmentsSchema = z.object({
documentId: z.number(),
attachments: z.array(
@ -37,3 +50,26 @@ export const ZSetDocumentAttachmentsResponseSchema = z.array(
type: z.nativeEnum(AttachmentType),
}),
);
export const ZSetTemplateAttachmentsSchema = z.object({
templateId: z.number(),
attachments: z.array(
z.object({
id: z.string(),
label: z.string().min(1, 'Label is required'),
url: z.string().url('Invalid URL'),
type: z.nativeEnum(AttachmentType),
}),
),
});
export type TSetTemplateAttachmentsSchema = z.infer<typeof ZSetTemplateAttachmentsSchema>;
export const ZSetTemplateAttachmentsResponseSchema = z.array(
z.object({
id: z.string(),
label: z.string(),
url: z.string(),
type: z.nativeEnum(AttachmentType),
}),
);