Skip to content

Commit

Permalink
merge: release 0.14.0 (#1841)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoNameProvided committed Dec 9, 2022
2 parents 5f91937 + e3d0708 commit 5f0d424
Show file tree
Hide file tree
Showing 83 changed files with 4,769 additions and 8,772 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Expand Up @@ -30,5 +30,6 @@ rules:
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-member-access': off
'@typescript-eslint/no-unsafe-argument': off
'@typescript-eslint/explicit-module-boundary-types': off
'@typescript-eslint/restrict-template-expressions': off
5 changes: 3 additions & 2 deletions .github/workflows/continuous-deployment-workflow.yml
Expand Up @@ -7,9 +7,10 @@ jobs:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org
- run: npm ci --ignore-scripts
- run: npm run prettier:check
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/continuous-integration-workflow.yml
Expand Up @@ -5,8 +5,10 @@ jobs:
name: Linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- run: npm run prettier:check
- run: npm run lint:check
Expand All @@ -15,26 +17,28 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['10.x', '12.x', '14.x']
node-version: ['lts/*', 'current']
fail-fast: false
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setting up Node.js (v${{ matrix.node-version }}.x)
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --ignore-scripts
- run: npm run test:ci
- run: npm install codecov -g
if: ${{ matrix.node-version == '14.x' }}
if: ${{ matrix.node-version == 'current' }}
- run: codecov -f ./coverage/clover.xml -t ${{ secrets.CODECOV_TOKEN }} --commit=$GITHUB_SHA --branch=${GITHUB_REF##*/}
if: ${{ matrix.node-version == '14.x' }}
if: ${{ matrix.node-version == 'current' }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci --ignore-scripts
- run: npm run build:es2015
- run: npm run build:esm5
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,59 @@

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

### [0.14.0](https://github.com/typestack/class-validator/compare/v0.13.2...v0.14.0) (2022-12-09)

### Added

- add `@IsTimeZone` decorator to check if given string is valid IANA time zone
- add `@IsISO4217CurrencyCode` decorator to check if the string is an ISO 4217 currency code
- add `@IsStrongPassword` decorator to check if given password matches specific complexity criteria
- add `@IsBase58` decorator to check if a string is base58 encoded
- add `@IsTaxId` decorator to check if a given string is a valid tax ID in a given locale
- add support for passing function as date generator in `@MinDate` and `@MaxDate` decorators
- add option to print constraint error message instead of constraint type in validation error
- improve decorator metadata lookup performance
- return possible values in error message for `@IsEnum` decorator

### Fixed

- re-added `@types/validator` as dependency
- fix error generation when using `@NestedValidation`
- pass validation options correctly to validator in `@IsDateString` decorator
- support passing `Symbol` as parameter in error message generation
- specify supported locales for `@IsAlphanumeric` decorator
- correctly assign decorator name in metadata instead of loosing it
- fix various spelling errors in documentation
- fix various spelling errors and inconsistencies in JSDoc for decorators

### Changed

- remove documentation about deprecated schema based validation and added warning
- update warning message logged about missing decorator metadata
- update `libphonenumber-js` to `^1.10.14` from `^1.9.43`
- update various dev-dependencies

### BREAKING CHANGES

**`forbidUnknownValues` option is enabled by default**

From this release the `forbidUnknownValues` is enabled by default. This is the desired behavior for majority of
use-cases, but this change may break validation for some. The two scenarios that results in failed validation:

- when attempting to validate a class instance without metadata for it
- when using group validation and the specified validation group results in zero validation applied

The old behavior can be restored via specifying `forbidUnknownValues: false` option when calling the validate functions.

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).

**`@NestedValidation` decorator correctly assigns validation errors**

Until now the errors from a nested validation in some cases were incorrectly assigned
to the parent instead of the child being validated. Now the validation errors are correctly assigned.

For more details see [#679](https://github.com/typestack/class-validator/issues/679).

### [0.13.2](https://github.com/typestack/class-validator/compare/v0.13.1...v0.13.2) (2021-11-20)

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

0 comments on commit 5f0d424

Please sign in to comment.