mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 09:41:35 +10:00
fix: additional backwards compat
This commit is contained in:
@ -7,6 +7,14 @@ import {
|
||||
} from '@documenso/lib/types/document-auth';
|
||||
import { ZDocumentFormValuesSchema } from '@documenso/lib/types/document-form-values';
|
||||
import { ZDocumentMetaCreateSchema } from '@documenso/lib/types/document-meta';
|
||||
import {
|
||||
ZFieldHeightSchema,
|
||||
ZFieldPageNumberSchema,
|
||||
ZFieldPageXSchema,
|
||||
ZFieldPageYSchema,
|
||||
ZFieldWidthSchema,
|
||||
} from '@documenso/lib/types/field';
|
||||
import { ZFieldAndMetaSchema } from '@documenso/lib/types/field-meta';
|
||||
|
||||
import {
|
||||
ZDocumentExternalIdSchema,
|
||||
@ -48,18 +56,22 @@ export const ZCreateEnvelopeRequestSchema = z.object({
|
||||
recipients: z
|
||||
.array(
|
||||
ZCreateRecipientSchema.extend({
|
||||
// Todo: Envelopes ?
|
||||
// fields: ZFieldAndMetaSchema.and(
|
||||
// z.object({
|
||||
// pageNumber: ZFieldPageNumberSchema,
|
||||
// pageX: ZFieldPageXSchema,
|
||||
// pageY: ZFieldPageYSchema,
|
||||
// width: ZFieldWidthSchema,
|
||||
// height: ZFieldHeightSchema,
|
||||
// }),
|
||||
// )
|
||||
// .array()
|
||||
// .optional(),
|
||||
fields: ZFieldAndMetaSchema.and(
|
||||
z.object({
|
||||
documentDataId: z
|
||||
.string()
|
||||
.describe(
|
||||
'The ID of the document data to create the field on. If empty, the first document data will be used.',
|
||||
),
|
||||
page: ZFieldPageNumberSchema,
|
||||
positionX: ZFieldPageXSchema,
|
||||
positionY: ZFieldPageYSchema,
|
||||
width: ZFieldWidthSchema,
|
||||
height: ZFieldHeightSchema,
|
||||
}),
|
||||
)
|
||||
.array()
|
||||
.optional(),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
@ -20,7 +20,10 @@ export const ZSetEnvelopeRecipientsRequestSchema = z.object({
|
||||
});
|
||||
|
||||
export const ZSetEnvelopeRecipientsResponseSchema = z.object({
|
||||
recipients: ZRecipientLiteSchema.array(),
|
||||
recipients: ZRecipientLiteSchema.omit({
|
||||
documentId: true,
|
||||
templateId: true,
|
||||
}).array(),
|
||||
});
|
||||
|
||||
export type TSetEnvelopeRecipientsRequest = z.infer<typeof ZSetEnvelopeRecipientsRequestSchema>;
|
||||
|
||||
@ -57,7 +57,10 @@ export const ZSignEnvelopeFieldRequestSchema = z.object({
|
||||
});
|
||||
|
||||
export const ZSignEnvelopeFieldResponseSchema = z.object({
|
||||
signedField: ZFieldSchema.extend({
|
||||
signedField: ZFieldSchema.omit({
|
||||
templateId: true,
|
||||
documentId: true,
|
||||
}).extend({
|
||||
signature: SignatureSchema.nullish(),
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user