refactor(pdf): deslop AcroForm import cleanup

This commit is contained in:
ephraimduncan
2026-05-27 00:39:43 +00:00
parent 874243700f
commit 88e836ddbc
13 changed files with 12 additions and 2967 deletions
@@ -118,8 +118,6 @@ export const createEnvelopeRouteCaller = async ({
});
}
// Preserve interactive AcroForm widgets so they can be imported as
// Documenso fields on demand via the editor's "Import from PDF" button.
const normalized = await normalizePdf(pdf, {
flattenForm: false,
});
@@ -10,14 +10,6 @@ import {
ZImportAcroFormFieldsResponseSchema,
} from './import-acroform-fields.types';
/**
* Internal-only — driven by the "Import from PDF" button in the envelope editor.
*
* Extracts AcroForm widgets from each envelope item's stored PDF, creates
* Documenso `Field` rows for the supported widgets, flattens the PDF in place
* (so widgets do not visually duplicate the imported fields), and emits a
* `FIELD_CREATED` audit entry per field on DOCUMENT envelopes.
*/
export const importAcroFormFieldsRoute = authenticatedProcedure
.input(ZImportAcroFormFieldsRequestSchema)
.output(ZImportAcroFormFieldsResponseSchema)
@@ -69,7 +61,7 @@ export const importAcroFormFieldsRoute = authenticatedProcedure
});
}
return await UNSAFE_importAcroFormFieldsFromEnvelope({
return UNSAFE_importAcroFormFieldsFromEnvelope({
envelope,
apiRequestMetadata: metadata,
});