Skip to content

Commit 5f0d424

Browse files
merge: release 0.14.0 (#1841)
2 parents 5f91937 + e3d0708 commit 5f0d424

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4769
-8772
lines changed

.eslintrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ rules:
3030
'@typescript-eslint/no-unsafe-assignment': off
3131
'@typescript-eslint/no-unsafe-call': off
3232
'@typescript-eslint/no-unsafe-member-access': off
33+
'@typescript-eslint/no-unsafe-argument': off
3334
'@typescript-eslint/explicit-module-boundary-types': off
3435
'@typescript-eslint/restrict-template-expressions': off

.github/workflows/continuous-deployment-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ jobs:
77
name: Publish to NPM
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v1
11-
- uses: actions/setup-node@v1
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
1212
with:
13+
node-version: 'lts/*'
1314
registry-url: https://registry.npmjs.org
1415
- run: npm ci --ignore-scripts
1516
- run: npm run prettier:check

.github/workflows/continuous-integration-workflow.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ jobs:
55
name: Linters
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v1
9-
- uses: actions/setup-node@v1
8+
- uses: actions/checkout@v3
9+
- uses: actions/setup-node@v3
10+
with:
11+
node-version: 'lts/*'
1012
- run: npm ci --ignore-scripts
1113
- run: npm run prettier:check
1214
- run: npm run lint:check
@@ -15,26 +17,28 @@ jobs:
1517
runs-on: ubuntu-latest
1618
strategy:
1719
matrix:
18-
node-version: ['10.x', '12.x', '14.x']
20+
node-version: ['lts/*', 'current']
1921
fail-fast: false
2022
steps:
21-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v3
2224
- name: Setting up Node.js (v${{ matrix.node-version }}.x)
23-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v3
2426
with:
2527
node-version: ${{ matrix.node-version }}
2628
- run: npm ci --ignore-scripts
2729
- run: npm run test:ci
2830
- run: npm install codecov -g
29-
if: ${{ matrix.node-version == '14.x' }}
31+
if: ${{ matrix.node-version == 'current' }}
3032
- run: codecov -f ./coverage/clover.xml -t ${{ secrets.CODECOV_TOKEN }} --commit=$GITHUB_SHA --branch=${GITHUB_REF##*/}
31-
if: ${{ matrix.node-version == '14.x' }}
33+
if: ${{ matrix.node-version == 'current' }}
3234
build:
3335
name: Build
3436
runs-on: ubuntu-latest
3537
steps:
36-
- uses: actions/checkout@v1
37-
- uses: actions/setup-node@v1
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-node@v3
40+
with:
41+
node-version: 'lts/*'
3842
- run: npm ci --ignore-scripts
3943
- run: npm run build:es2015
4044
- run: npm run build:esm5

CHANGELOG.md

+53
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,59 @@
22

33
_This changelog follows the [keep a changelog][keep-a-changelog]_ format to maintain a human readable changelog.
44

5+
### [0.14.0](https://github.com/typestack/class-validator/compare/v0.13.2...v0.14.0) (2022-12-09)
6+
7+
### Added
8+
9+
- add `@IsTimeZone` decorator to check if given string is valid IANA time zone
10+
- add `@IsISO4217CurrencyCode` decorator to check if the string is an ISO 4217 currency code
11+
- add `@IsStrongPassword` decorator to check if given password matches specific complexity criteria
12+
- add `@IsBase58` decorator to check if a string is base58 encoded
13+
- add `@IsTaxId` decorator to check if a given string is a valid tax ID in a given locale
14+
- add support for passing function as date generator in `@MinDate` and `@MaxDate` decorators
15+
- add option to print constraint error message instead of constraint type in validation error
16+
- improve decorator metadata lookup performance
17+
- return possible values in error message for `@IsEnum` decorator
18+
19+
### Fixed
20+
21+
- re-added `@types/validator` as dependency
22+
- fix error generation when using `@NestedValidation`
23+
- pass validation options correctly to validator in `@IsDateString` decorator
24+
- support passing `Symbol` as parameter in error message generation
25+
- specify supported locales for `@IsAlphanumeric` decorator
26+
- correctly assign decorator name in metadata instead of loosing it
27+
- fix various spelling errors in documentation
28+
- fix various spelling errors and inconsistencies in JSDoc for decorators
29+
30+
### Changed
31+
32+
- remove documentation about deprecated schema based validation and added warning
33+
- update warning message logged about missing decorator metadata
34+
- update `libphonenumber-js` to `^1.10.14` from `^1.9.43`
35+
- update various dev-dependencies
36+
37+
### BREAKING CHANGES
38+
39+
**`forbidUnknownValues` option is enabled by default**
40+
41+
From this release the `forbidUnknownValues` is enabled by default. This is the desired behavior for majority of
42+
use-cases, but this change may break validation for some. The two scenarios that results in failed validation:
43+
44+
- when attempting to validate a class instance without metadata for it
45+
- when using group validation and the specified validation group results in zero validation applied
46+
47+
The old behavior can be restored via specifying `forbidUnknownValues: false` option when calling the validate functions.
48+
49+
For more details see [PR #1798](https://github.com/typestack/class-validator/pull/1798) and [#1422 (comment)](https://github.com/typestack/class-validator/issues/1422#issuecomment-1317953863).
50+
51+
**`@NestedValidation` decorator correctly assigns validation errors**
52+
53+
Until now the errors from a nested validation in some cases were incorrectly assigned
54+
to the parent instead of the child being validated. Now the validation errors are correctly assigned.
55+
56+
For more details see [#679](https://github.com/typestack/class-validator/issues/679).
57+
558
### [0.13.2](https://github.com/typestack/class-validator/compare/v0.13.1...v0.13.2) (2021-11-20)
659

760
> **NOTE:** This version fixes a security vulnerability allowing denial of service attacks with a specially crafted request payload.

0 commit comments

Comments
 (0)