mirror of
https://github.com/documenso/documenso.git
synced 2026-08-24 15:22:26 +10:00
docs(trpc): add openapi descriptions to envelope cancel, delete and update routes (#3134)
## Description The envelope cancel, delete, and update routes rendered without descriptions in the generated OpenAPI reference. ## Changes Made - Added route-level OpenAPI `description` to `cancel-envelope.types.ts`, `delete-envelope.types.ts`, and `update-envelope.types.ts`. - Added field-level `.describe()` calls on request schemas, matching the style of sibling envelope-router schemas (e.g. `get-envelopes-by-ids.types.ts`, `distribute-envelope.types.ts`). ## Testing Performed `npx tsc --noEmit -p packages/trpc` passes with no errors. Metadata-only change — no runtime behavior affected.
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(),
|
||||||
|
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(),
|
.optional(),
|
||||||
meta: ZDocumentMetaUpdateSchema.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