mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
This change actually makes the authoring flow work for the most part by tying in emailing and more. We have also done a number of quality of life updates to simplify the codebase overall making it easier to continue work on the refresh.
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
import { FieldType } from '@documenso/prisma/client';
|
|
|
|
export const ZSetRecipientsForDocumentMutationSchema = z.object({
|
|
documentId: z.number(),
|
|
recipients: z.array(
|
|
z.object({
|
|
id: z.number().nullish(),
|
|
email: z.string().min(1).email(),
|
|
name: z.string(),
|
|
}),
|
|
),
|
|
});
|
|
|
|
export type TSetRecipientsForDocumentMutationSchema = z.infer<
|
|
typeof ZSetRecipientsForDocumentMutationSchema
|
|
>;
|
|
|
|
export const ZSetFieldsForDocumentMutationSchema = z.object({
|
|
documentId: z.number(),
|
|
fields: z.array(
|
|
z.object({
|
|
id: z.number().nullish(),
|
|
type: z.nativeEnum(FieldType),
|
|
signerEmail: z.string().min(1),
|
|
pageNumber: z.number().min(1),
|
|
pageX: z.number().min(0),
|
|
pageY: z.number().min(0),
|
|
pageWidth: z.number().min(0),
|
|
pageHeight: z.number().min(0),
|
|
}),
|
|
),
|
|
});
|
|
|
|
export type TSetFieldsForDocumentMutationSchema = z.infer<
|
|
typeof ZSetFieldsForDocumentMutationSchema
|
|
>;
|
|
|
|
export const ZSendDocumentMutationSchema = z.object({
|
|
documentId: z.number(),
|
|
});
|
|
|
|
export type TSendDocumentMutationSchema = z.infer<typeof ZSendDocumentMutationSchema>;
|