feat(documents): папки шаблонов, маппинги и поле document_template; fix(batch): атомарное создание задач, idempotency и массовое удаление в реестре

This commit is contained in:
2026-07-08 13:33:14 +03:00
parent fc8e85832c
commit 6826d82850
34 changed files with 3770 additions and 467 deletions

View File

@@ -18,7 +18,11 @@ export class DOCXConverterService {
lang: options.lang || 'ru-RU',
};
const result = await HTMLtoDOCX(html, null, opts);
const convertFn = typeof HTMLtoDOCX === 'function' ? HTMLtoDOCX : (HTMLtoDOCX as any).default;
if (typeof convertFn !== 'function') {
throw new Error('HTMLtoDOCX converter is not available');
}
const result = await convertFn(html, null, opts);
if (result instanceof ArrayBuffer) {
return Buffer.from(result);
}