Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release 0.14.0 #1841

Merged
merged 69 commits into from Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
c864686
build: update dependencies to latest
NoNameProvided Nov 13, 2022
0da8f89
test: update decorator name in failing test
NoNameProvided Nov 13, 2022
3012426
build: update CI/CD to use newer Node versions
NoNameProvided Nov 13, 2022
572f8e7
docs: rename IsHSLColor to IsHSL
hal-wang Aug 30, 2022
3a2bfec
fix: use optional chaining in ValidationArguments before accessing th…
NoNameProvided Nov 13, 2022
45d125e
docs: fix typo in README about @IsString decorator
NoNameProvided Nov 13, 2022
7cd7546
docs: remove documentation about schema based validation
braaar Oct 6, 2022
42b9ca2
docs: update JSDoc for @IsDecimal decorator
NoNameProvided Nov 13, 2022
87c0ef3
docs: fix typo in README about @IsEnum decorator
NoNameProvided Nov 13, 2022
ca92d57
docs: update JSDoc for @Min and @Max decorators
NoNameProvided Nov 13, 2022
e664861
build(deps-dev): bump @types/jest from 29.2.2 to 29.2.3 (#1779)
dependabot[bot] Nov 15, 2022
00af9a3
build(deps-dev): bump @typescript-eslint/parser from 5.42.1 to 5.43.0…
dependabot[bot] Nov 15, 2022
09483d8
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1781)
dependabot[bot] Nov 15, 2022
33ed7ad
build(deps-dev): bump typescript from 4.8.4 to 4.9.3 (#1783)
dependabot[bot] Nov 16, 2022
c913e3c
fix: assign `@NestedValidation` error to parent when property is not …
ytetsuro Nov 20, 2022
6fa5680
feat: add `@IsTimeZone` validator (#1796)
NoNameProvided Nov 20, 2022
3b07014
docs: add link to contribution guide in README (#1785)
braaar Nov 20, 2022
24aa0fe
feat: allow passing dynamic date to `MinDate` and `MaxDate` decorator…
CodyTseng Nov 20, 2022
86993af
docs: correct typos in README
NoNameProvided Nov 20, 2022
9c6e5ac
fix: update typo in error message for `@IsUrl` decorator
NoNameProvided Nov 20, 2022
c183cb3
docs: fix typo in JSDoc for `@IsHalfWidth` decorator
NoNameProvided Nov 20, 2022
23071f6
fix: pass options to validator in `@IsDateString` decorator (#1720)
hakimio Nov 20, 2022
607ef61
feat: enable `forbidUnknownValues` by default
NoNameProvided Nov 20, 2022
0e84a27
test: update group tests to pass validation with `forbidUnknownValue…
NoNameProvided Nov 20, 2022
54a2cdf
merge: enable `forbidUnknownValues` by default (#1798)
NoNameProvided Nov 20, 2022
abe6a4b
fix: handle symbols in constraintToString method (#1794)
adrienboulle Nov 20, 2022
3aee314
fix: correct typo in error message for `@ArrayMaxSize` decorator
NoNameProvided Nov 20, 2022
530299a
docs: update wording in README about inheritance
NoNameProvided Nov 20, 2022
9df0767
test: add missing return statement in tests of `@Length` decorator
NoNameProvided Nov 20, 2022
ed6e557
test: remove export from test util functions
NoNameProvided Nov 20, 2022
12f8d86
build: restore @types/validator to dependencies
NoNameProvided Nov 20, 2022
72d1eed
fix: add type for locale in `@IsAlpha` decorator
NoNameProvided Nov 20, 2022
5b0b962
fix: add type for locale in `@IsAlphanumeric` decorator
NoNameProvided Nov 20, 2022
cf8d2c0
docs: remove hardcoded postal code list from JSDoc
NoNameProvided Nov 20, 2022
f4d9630
build(deps-dev): bump eslint from 8.27.0 to 8.28.0 (#1801)
dependabot[bot] Nov 21, 2022
bbb44df
build(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0…
dependabot[bot] Nov 22, 2022
323eda8
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1805)
dependabot[bot] Nov 22, 2022
ebdca0b
build(deps-dev): bump prettier from 2.7.1 to 2.8.0 (#1806)
dependabot[bot] Nov 23, 2022
0928a59
build(deps-dev): bump lint-staged from 13.0.3 to 13.0.4 (#1808)
dependabot[bot] Nov 25, 2022
4e9598f
build(deps-dev): bump eslint-plugin-jest from 27.1.5 to 27.1.6 (#1809)
dependabot[bot] Nov 25, 2022
6f4b2aa
build(deps-dev): bump @rollup/plugin-commonjs from 23.0.2 to 23.0.3 (…
dependabot[bot] Nov 28, 2022
f293b5b
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1813)
dependabot[bot] Nov 29, 2022
b8a1c4f
build(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0…
dependabot[bot] Nov 29, 2022
2bb7d02
build(deps-dev): bump @types/node from 18.11.9 to 18.11.10 (#1819)
dependabot[bot] Dec 1, 2022
c3130af
feat: add IsStrongPassword decorator (#1025)
jhonatanhulse Dec 2, 2022
d6b664a
feat: add decorator name to validation metadata (#1687)
Clashsoft Dec 2, 2022
3976453
feat: add `@IsBase58` validator (#1765)
Kinggodhoon Dec 2, 2022
e252183
docs: update JSDoc for `forbidUnknownValues`
NoNameProvided Dec 2, 2022
f6f1bdf
docs: update error message for no metadata warning
NoNameProvided Dec 2, 2022
dbab07a
feat: add `showConstraintMessages` option to `ValidationError.toStrin…
ahoisl Dec 2, 2022
b564f8d
feat: add `@IsTaxID` decorator (#1822)
NoNameProvided Dec 3, 2022
7fe37ed
feat: add `@IsISO4217CurrencyCode` decorator (#1824)
NoNameProvided Dec 3, 2022
fc30d79
build: enable downlevel iteration for ESM5 target
NoNameProvided Dec 3, 2022
f0541a6
perf: store metadata in maps instead of arrays (#1825)
NoNameProvided Dec 3, 2022
1f4a89c
feat: return possible values in error message for `@IsEnum` decorator…
NoNameProvided Dec 3, 2022
4d3f227
build(deps-dev): bump lint-staged from 13.0.4 to 13.1.0 (#1828)
dependabot[bot] Dec 5, 2022
85469a5
build(deps-dev): bump eslint from 8.28.0 to 8.29.0 (#1830)
dependabot[bot] Dec 5, 2022
8c36744
build(deps-dev): bump @types/jest from 29.2.3 to 29.2.4 (#1829)
dependabot[bot] Dec 5, 2022
1251059
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1831)
dependabot[bot] Dec 6, 2022
3b37a31
build(deps-dev): bump @typescript-eslint/parser from 5.45.0 to 5.45.1…
dependabot[bot] Dec 6, 2022
0c986d4
build(deps-dev): bump @types/node from 18.11.10 to 18.11.11 (#1833)
dependabot[bot] Dec 6, 2022
42b4f7f
build(deps-dev): bump prettier from 2.8.0 to 2.8.1 (#1834)
dependabot[bot] Dec 8, 2022
ad1a41d
build(deps-dev): bump @rollup/plugin-commonjs from 23.0.3 to 23.0.4 (…
dependabot[bot] Dec 8, 2022
f993e9e
build(deps-dev): bump typescript from 4.9.3 to 4.9.4 (#1835)
dependabot[bot] Dec 8, 2022
d9b4072
build(deps-dev): bump @typescript-eslint/parser from 5.45.1 to 5.46.0…
dependabot[bot] Dec 8, 2022
53bc9f6
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1837)
dependabot[bot] Dec 8, 2022
9a775c5
build(deps-dev): bump @types/node from 18.11.11 to 18.11.12 (#1840)
dependabot[bot] Dec 9, 2022
ad76890
docs: add changelog for 0.14.0
NoNameProvided Dec 9, 2022
e3d0708
build: bump version to 0.14.0
NoNameProvided Dec 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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