mirror of
https://github.com/documenso/documenso.git
synced 2026-08-25 15:52:29 +10:00
feat: add API endpoints for downloading certificate and audit log PDFs (#3025)
Add V2 API routes to download an envelope's certificate and audit log separately, and align the internal cert/audit log downloads to use envelopeId. Enforces document visibility via getEnvelopeWhereInput and loads field signatures so certificates render correctly.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { authenticatedProcedure } from '../trpc';
|
||||
import {
|
||||
downloadEnvelopeAuditLogPdfMeta,
|
||||
ZDownloadEnvelopeAuditLogPdfRequestSchema,
|
||||
ZDownloadEnvelopeAuditLogPdfResponseSchema,
|
||||
} from './download-envelope-audit-log-pdf.types';
|
||||
|
||||
export const downloadEnvelopeAuditLogPdfRoute = authenticatedProcedure
|
||||
.meta(downloadEnvelopeAuditLogPdfMeta)
|
||||
.input(ZDownloadEnvelopeAuditLogPdfRequestSchema)
|
||||
.output(ZDownloadEnvelopeAuditLogPdfResponseSchema)
|
||||
.query(({ input, ctx }) => {
|
||||
const { envelopeId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
envelopeId,
|
||||
},
|
||||
});
|
||||
|
||||
// This endpoint is purely for V2 API, which is implemented in the Hono remix server.
|
||||
throw new Error('NOT_IMPLEMENTED');
|
||||
});
|
||||
Reference in New Issue
Block a user