feat: document file conversion

This commit is contained in:
Ephraim Atta-Duncan
2025-12-15 11:58:42 +00:00
parent 43486d8448
commit 7a499270be
26 changed files with 252 additions and 63 deletions
@@ -127,6 +127,19 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
const errorMessage = match(error.code)
.with('INVALID_DOCUMENT_FILE', () => t`You cannot upload encrypted PDFs`)
.with(
'UNSUPPORTED_FILE_TYPE',
() => t`This file type is not supported. Please upload a PDF, DOCX, JPEG, or PNG file.`,
)
.with(
'CONVERSION_SERVICE_UNAVAILABLE',
() => t`File conversion is temporarily unavailable. Please upload a PDF file instead.`,
)
.with(
'CONVERSION_FAILED',
() =>
t`Failed to convert the file to PDF. Please try again or upload a PDF file instead.`,
)
.with(
AppErrorCode.LIMIT_EXCEEDED,
() => t`You have reached your document limit for this month. Please upgrade your plan.`,
+1 -1
View File
@@ -46,7 +46,7 @@ export const filesRoute = new Hono<HonoEnv>()
return c.json({ error: 'File too large' }, 400);
}
const result = await putNormalizedPdfFileServerSide(file);
const result = await putNormalizedPdfFileServerSide({ file });
return c.json(result);
} catch (error) {