Skip to content

Commit cd2bc01

Browse files
hive-botclaude
andcommitted
docs: deprecate document minification and link the API usage limits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3449791 commit cd2bc01

5 files changed

Lines changed: 38 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9292
release of this package. They use the new `SourceLanguageCodeInput`,
9393
`TargetLanguageCodeInput` and `LanguageCodeInput` types, which keep editor
9494
autocompletion for the listed codes. Result types are unchanged.
95+
- README: the document minification section no longer states a 30 MB upload
96+
limit and links to the DeepL API usage limits instead.
9597

9698
### Deprecated
9799
- `TranslateTextOptions.__path` is deprecated. It is for internal use only
@@ -110,6 +112,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
110112
is deprecated; pass the label, prompt and source language as separate
111113
arguments instead. These object forms and `CreateStyleRuleRequestBody` will be
112114
removed in the next major version.
115+
- Document minification is deprecated: the `enableDocumentMinification` option
116+
of `DocumentTranslateOptions`, the `DocumentMinifier` class, and the
117+
`DocumentMinificationError` and `DocumentDeminificationError` errors. The
118+
DeepL API accepts larger documents; see the
119+
[usage limits](https://developers.deepl.com/docs/resources/usage-limits).
120+
Minification keeps working and will be removed in the next major version.
113121

114122
### Fixed
115123
- `downloadTranslationMemoryExport()` no longer hangs on Node 16 and 17 when the output file

‎README.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,23 @@ directly:
316316
the translated document. Only supported for `docx` and `pdf` output; for
317317
other output formats the API ignores this option.
318318
- `extraRequestParameters`: same as in [Text translation options](#text-translation-options).
319-
- `enableDocumentMinification`: A `bool` value. If set to `true`, the library will try to minify a document
320-
before translating it through the API, sending a smaller document if the file contains a lot of media. This is
321-
currently only supported for `pptx` and `docx` files. See also [Document minification](#document-minification).
319+
- `enableDocumentMinification`: **deprecated**, will be removed in the next
320+
major version. A `bool` value. If set to `true`, the library will try to
321+
minify a document before translating it through the API, sending a smaller
322+
document if the file contains a lot of media. This is currently only
323+
supported for `pptx` and `docx` files. See also
324+
[Document minification](#document-minification).
322325

323326
#### Document minification
327+
> **Deprecated:** document minification (the `enableDocumentMinification` option and the
328+
> `DocumentMinifier` class) is deprecated and will be removed in the next major version.
329+
> It still works until then. The DeepL API accepts larger documents; see the
330+
> [usage limits](https://developers.deepl.com/docs/resources/usage-limits).
331+
324332
In some contexts, one can end up with large document files (e.g. PowerPoint presentations
325-
or Word files with many contributors, especially in a larger organization). However, the
326-
DeepL API enforces a limit of 30 MB for most of these files (see Usage Limits in the docs).
333+
or Word files with many contributors, especially in a larger organization). The DeepL API
334+
limits the size of uploaded documents; see the
335+
[usage limits](https://developers.deepl.com/docs/resources/usage-limits) for the current values.
327336
In the case that most of this size comes from media included in the documents (e.g. images,
328337
videos, animations), document minification can help.
329338
In this case, the library will create a temporary directory to extract the document into,

‎src/documentMinifier.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ interface IDocumentMinifier {
8787
* }
8888
* }
8989
* }
90+
*
91+
* @deprecated Document minification is deprecated and will be removed in the next major version.
92+
* The DeepL API accepts larger documents; see the usage limits:
93+
* https://developers.deepl.com/docs/resources/usage-limits
9094
*/
9195
export class DocumentMinifier implements IDocumentMinifier {
9296
/** Which input document types are supported for minification. */

‎src/errors.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ export class DocumentNotReadyError extends DeepLError {}
4747
/**
4848
* Error thrown if an error occurs during the minification phase.
4949
* @see DocumentMinifier.minifyDocument
50+
* @deprecated Document minification is deprecated and will be removed in the next major version.
51+
* The DeepL API accepts larger documents; see the usage limits:
52+
* https://developers.deepl.com/docs/resources/usage-limits
5053
*/
5154
export class DocumentMinificationError extends DeepLError {}
5255

5356
/**
5457
* Error thrown if an error occurs during the deminification phase.
5558
* @see DocumentMinifier.deminifyDocument
59+
* @deprecated Document minification is deprecated and will be removed in the next major version.
60+
* The DeepL API accepts larger documents; see the usage limits:
61+
* https://developers.deepl.com/docs/resources/usage-limits
5662
*/
5763
export class DocumentDeminificationError extends DeepLError {}
5864

‎src/types.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,12 @@ export interface DocumentTranslateOptions extends BaseRequestOptions {
283283
/** Filename including extension, only required when translating documents as streams. */
284284
filename?: string;
285285

286-
/** Controls whether to use Document Minification for translation, if available. */
286+
/**
287+
* Controls whether to use Document Minification for translation, if available.
288+
* @deprecated Document minification is deprecated and will be removed in the next major
289+
* version. The DeepL API accepts larger documents; see the usage limits:
290+
* https://developers.deepl.com/docs/resources/usage-limits
291+
*/
287292
enableDocumentMinification?: boolean;
288293

289294
/**

0 commit comments

Comments
 (0)