mirror of
https://github.com/documenso/documenso.git
synced 2026-08-15 02:53:32 +10:00
docs(trpc): add openapi descriptions to envelope cancel, delete and update routes
- these routes rendered without descriptions in the generated API reference - add route-level descriptions and field-level .describe() calls matching sibling schemas
This commit is contained in:
@@ -8,13 +8,14 @@ export const cancelEnvelopeMeta: TrpcRouteMeta = {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/envelope/cancel',
|
path: '/envelope/cancel',
|
||||||
summary: 'Cancel envelope',
|
summary: 'Cancel envelope',
|
||||||
|
description: 'Cancel a pending envelope',
|
||||||
tags: ['Envelope'],
|
tags: ['Envelope'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ZCancelEnvelopeRequestSchema = z.object({
|
export const ZCancelEnvelopeRequestSchema = z.object({
|
||||||
envelopeId: z.string(),
|
envelopeId: z.string().describe('The ID of the envelope to cancel.'),
|
||||||
reason: z.string().optional(),
|
reason: z.string().describe('The reason for cancelling the envelope.').optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ZCancelEnvelopeResponseSchema = ZSuccessResponseSchema;
|
export const ZCancelEnvelopeResponseSchema = ZSuccessResponseSchema;
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ export const deleteEnvelopeMeta: TrpcRouteMeta = {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/envelope/delete',
|
path: '/envelope/delete',
|
||||||
summary: 'Delete envelope',
|
summary: 'Delete envelope',
|
||||||
|
description: 'Delete an envelope',
|
||||||
tags: ['Envelope'],
|
tags: ['Envelope'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ZDeleteEnvelopeRequestSchema = z.object({
|
export const ZDeleteEnvelopeRequestSchema = z.object({
|
||||||
envelopeId: z.string(),
|
envelopeId: z.string().describe('The ID of the envelope to delete.'),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ZDeleteEnvelopeResponseSchema = ZSuccessResponseSchema;
|
export const ZDeleteEnvelopeResponseSchema = ZSuccessResponseSchema;
|
||||||
|
|||||||
@@ -12,24 +12,32 @@ export const updateEnvelopeMeta: TrpcRouteMeta = {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/envelope/update',
|
path: '/envelope/update',
|
||||||
summary: 'Update envelope',
|
summary: 'Update envelope',
|
||||||
|
description: 'Update envelope properties and settings',
|
||||||
tags: ['Envelope'],
|
tags: ['Envelope'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ZUpdateEnvelopeRequestSchema = z.object({
|
export const ZUpdateEnvelopeRequestSchema = z.object({
|
||||||
envelopeId: z.string(),
|
envelopeId: z.string().describe('The ID of the envelope to update.'),
|
||||||
data: z
|
data: z
|
||||||
.object({
|
.object({
|
||||||
title: ZDocumentTitleSchema.optional(),
|
title: ZDocumentTitleSchema.optional(),
|
||||||
externalId: ZDocumentExternalIdSchema.nullish(),
|
externalId: ZDocumentExternalIdSchema.nullish(),
|
||||||
visibility: ZDocumentVisibilitySchema.optional(),
|
visibility: ZDocumentVisibilitySchema.optional(),
|
||||||
globalAccessAuth: z.array(ZDocumentAccessAuthTypesSchema).optional(),
|
globalAccessAuth: z
|
||||||
globalActionAuth: z.array(ZDocumentActionAuthTypesSchema).optional(),
|
.array(ZDocumentAccessAuthTypesSchema)
|
||||||
folderId: z.string().nullish(),
|
.describe('The authentication methods required to access the envelope.')
|
||||||
templateType: z.nativeEnum(TemplateType).optional(),
|
|
||||||
})
|
|
||||||
.optional(),
|
.optional(),
|
||||||
meta: ZDocumentMetaUpdateSchema.optional(),
|
globalActionAuth: z
|
||||||
|
.array(ZDocumentActionAuthTypesSchema)
|
||||||
|
.describe('The authentication methods required to sign the envelope.')
|
||||||
|
.optional(),
|
||||||
|
folderId: z.string().describe('The ID of the folder containing the envelope.').nullish(),
|
||||||
|
templateType: z.nativeEnum(TemplateType).describe('The template type.').optional(),
|
||||||
|
})
|
||||||
|
.describe('The envelope properties to update.')
|
||||||
|
.optional(),
|
||||||
|
meta: ZDocumentMetaUpdateSchema.describe('The email and signing settings to update.').optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ZUpdateEnvelopeResponseSchema = ZEnvelopeLiteSchema;
|
export const ZUpdateEnvelopeResponseSchema = ZEnvelopeLiteSchema;
|
||||||
|
|||||||
Reference in New Issue
Block a user