feat: errorOnCharts/errorOnSmartArt — отказ конвертации при находке диаграмм/SmartArt

This commit is contained in:
Pjandro
2026-10-15 22:03:14 +00:00
parent 98fc900a53
commit 307afc0678
12 changed files with 303 additions and 37 deletions
+7 -3
View File
@@ -25,13 +25,15 @@ export interface ConvertResult {
export interface ConvertOptions {
renderCharts: boolean
renderSmartArt: boolean
errorOnCharts: boolean
errorOnSmartArt: boolean
}
/**
* Единственная сетевая точка приложения: POST /api/v1/convert (multipart,
* поля `file`, `renderCharts`, `renderSmartArt`) → PDF-blob + имя файла из
* Content-Disposition. Таймаут на фронте не ставим: конвертация долгая —
* это ожидаемо.
* поля `file`, `renderCharts`, `renderSmartArt`, `errorOnCharts`,
* `errorOnSmartArt`) → PDF-blob + имя файла из Content-Disposition.
* Таймаут на фронте не ставим: конвертация долгая — это ожидаемо.
*/
export async function convertDocx(
file: File,
@@ -42,6 +44,8 @@ export async function convertDocx(
fd.append('file', file, file.name)
fd.append('renderCharts', String(options.renderCharts))
fd.append('renderSmartArt', String(options.renderSmartArt))
fd.append('errorOnCharts', String(options.errorOnCharts))
fd.append('errorOnSmartArt', String(options.errorOnSmartArt))
const key = getApiKey()
const resp = await fetch(`${import.meta.env.BASE_URL}api/v1/convert`, {
method: 'POST',