Skip to content

Commit

Permalink
fix: fix allowed values for writing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-gardella-deepl committed Jan 23, 2025
1 parent ebbb61b commit 84aa5ab
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.16.1] - 2025-01-23
### Added
* Fix allowed values for writing styles.

## [1.16.0] - 2025-01-22
### Added
* Added checks for supported languages in the Write API.
Expand Down Expand Up @@ -38,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.14.0] - 2024-11-15
### Added
* `/translate` endpoint: added `model_type` request parameter and
* `/translate` endpoint: added `model_type` request parameter and
`model_type_used` response parameter.


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


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


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


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

## [1.0.0] - 2021-08-12
### Added
* Add support for Authorization header with `DeepL-Auth-Key ` prefix.
* Add support for Authorization header with `DeepL-Auth-Key ` prefix.
### Fixed
* Fix bug in error responses introduced in eslint refactoring.

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const documents = require('./documents');
const glossaries = require('./glossaries');
const languages = require('./languages');
const util = require('./util');
const writingStyles = require('./writing_styles');
const writingTones = require('./writing_tones');
const { writingStyles } = require('./writing_styles');
const { writingTones } = require('./writing_tones');

const envVarPort = 'DEEPL_MOCK_SERVER_PORT';
const envVarProxyPort = 'DEEPL_MOCK_PROXY_SERVER_PORT';
Expand Down
6 changes: 2 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deepl-mock",
"description": "DeepL API mock server",
"version": "1.16.0",
"version": "1.16.1",
"author": "DeepL SE <[email protected]>",
"license": "MIT",
"repository": "DeepLcom/deepl-mock",
Expand Down
4 changes: 2 additions & 2 deletions writing_styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.

const writingStyles = new Set([
const writingStyles = [
'academic',
'business',
'casual',
Expand All @@ -12,7 +12,7 @@ const writingStyles = new Set([
'prefer_casual',
'prefer_simple',
'simple',
]);
];

module.exports = {
writingStyles,
Expand Down
4 changes: 2 additions & 2 deletions writing_tones.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.

const writingTones = new Set([
const writingTones = [
'confident',
'default',
'diplomatic',
Expand All @@ -12,7 +12,7 @@ const writingTones = new Set([
'prefer_diplomatic',
'prefer_enthusiastic',
'prefer_friendly',
]);
];

module.exports = {
writingTones,
Expand Down

0 comments on commit 84aa5ab

Please sign in to comment.