Skip to content

Commit 84aa5ab

Browse files
fix: fix allowed values for writing styles
1 parent ebbb61b commit 84aa5ab

6 files changed

+23
-21
lines changed

CHANGELOG.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.16.1] - 2025-01-23
8+
### Added
9+
* Fix allowed values for writing styles.
10+
711
## [1.16.0] - 2025-01-22
812
### Added
913
* Added checks for supported languages in the Write API.
@@ -38,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3842

3943
## [1.14.0] - 2024-11-15
4044
### Added
41-
* `/translate` endpoint: added `model_type` request parameter and
45+
* `/translate` endpoint: added `model_type` request parameter and
4246
`model_type_used` response parameter.
4347

4448

@@ -47,15 +51,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4751
* Add supported glossary languages: Danish (`'da'`), Norwegian (bokmål)
4852
(`'nb'`), and Swedish (`'sv'`).
4953
* Add billed characters to translate-text function: (`show_billed_characters`
50-
request parameter, and `billed_characters` response parameter).
54+
request parameter, and `billed_characters` response parameter).
5155

5256

5357
## [1.12.0] - 2024-04-08
5458
### Added
5559
* Verify keepalive is used by clients by rejecting session reuse on new sockets,
5660
except in case where no-response mode is active
5761
* Add `mock-server-session-allow-missing-user-agent` session header to override
58-
missing User-Agent check.
62+
missing User-Agent check.
5963
* Add supported glossary languages: Portuguese (`'PT'`), Russian (`'RU'`), and Chinese (`'ZH'`).
6064
* Add `output_format` parameter for document upload, to specify the desired file
6165
format of the output file
@@ -136,9 +140,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
136140
### Added
137141
* Add `error_message` field to document status if an error occurs during document translation fails,
138142
and check if detected source language matches target language. The deprecated `message` field is
139-
also added to match the live API.
143+
also added to match the live API.
140144
### Changed
141-
* Update name for the target language `zh` to "Chinese (simplified)".
145+
* Update name for the target language `zh` to "Chinese (simplified)".
142146

143147

144148
## [1.3.2] - 2022-03-01
@@ -159,19 +163,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
159163
### Added
160164
* Add contribution guidelines -- currently we are unable to accept Pull Requests.
161165
### Changed
162-
* npm start command now uses environment variables if defined for DEEPL_MOCK_SERVER_PORT and
166+
* npm start command now uses environment variables if defined for DEEPL_MOCK_SERVER_PORT and
163167
DEEPL_MOCK_PROXY_SERVER_PORT.
164-
* Update `package-lock.json`: upgrade `follow-redirects` to 1.14.7 to silence security warnings.
168+
* Update `package-lock.json`: upgrade `follow-redirects` to 1.14.7 to silence security warnings.
165169
Note: security vulnerability [CVE-2022-0155](https://nvd.nist.gov/vuln/detail/CVE-2022-0155)
166170
affects cross-domain proxying and has no impact here because the proxy server is restricted to
167-
target only the mock server itself.
171+
target only the mock server itself.
168172
### Fixed
169173
* Remove "localhost" from listen() calls.
170174

171175

172176
## [1.3.0] - 2021-11-15
173177
### Added
174-
* Add glossary support for document translation.
178+
* Add glossary support for document translation.
175179
* Add missing argument validation for: formality, split_sentences, preserve_formatting and
176180
outline_detection.
177181
* Add an optional proxy server that proxies requests to the mock server, listening on port 3001 by
@@ -205,7 +209,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
205209

206210
## [1.0.0] - 2021-08-12
207211
### Added
208-
* Add support for Authorization header with `DeepL-Auth-Key ` prefix.
212+
* Add support for Authorization header with `DeepL-Auth-Key ` prefix.
209213
### Fixed
210214
* Fix bug in error responses introduced in eslint refactoring.
211215

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const documents = require('./documents');
3030
const glossaries = require('./glossaries');
3131
const languages = require('./languages');
3232
const util = require('./util');
33-
const writingStyles = require('./writing_styles');
34-
const writingTones = require('./writing_tones');
33+
const { writingStyles } = require('./writing_styles');
34+
const { writingTones } = require('./writing_tones');
3535

3636
const envVarPort = 'DEEPL_MOCK_SERVER_PORT';
3737
const envVarProxyPort = 'DEEPL_MOCK_PROXY_SERVER_PORT';

package-lock.json

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "deepl-mock",
33
"description": "DeepL API mock server",
4-
"version": "1.16.0",
4+
"version": "1.16.1",
55
"author": "DeepL SE <[email protected]>",
66
"license": "MIT",
77
"repository": "DeepLcom/deepl-mock",

writing_styles.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by an MIT
33
// license that can be found in the LICENSE file.
44

5-
const writingStyles = new Set([
5+
const writingStyles = [
66
'academic',
77
'business',
88
'casual',
@@ -12,7 +12,7 @@ const writingStyles = new Set([
1212
'prefer_casual',
1313
'prefer_simple',
1414
'simple',
15-
]);
15+
];
1616

1717
module.exports = {
1818
writingStyles,

writing_tones.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by an MIT
33
// license that can be found in the LICENSE file.
44

5-
const writingTones = new Set([
5+
const writingTones = [
66
'confident',
77
'default',
88
'diplomatic',
@@ -12,7 +12,7 @@ const writingTones = new Set([
1212
'prefer_diplomatic',
1313
'prefer_enthusiastic',
1414
'prefer_friendly',
15-
]);
15+
];
1616

1717
module.exports = {
1818
writingTones,

0 commit comments

Comments
 (0)