Compare commits

...

374 Commits

Author SHA1 Message Date
Kamil Myśliwiec
fd11464a6e chore(release): publish v10.4.21 release 2026-01-08 10:41:01 +01:00
Kamil Myśliwiec
cd2bd3e1b4 chore: upgrade lerna to the latest version 2026-01-08 10:40:26 +01:00
Kamil Myśliwiec
d96149c87b chore: upgrade lerna to the latest version 2026-01-08 10:39:07 +01:00
Kamil Myśliwiec
2e55ee1883 chore: upgrade lerna to the latest version 2026-01-08 10:37:58 +01:00
Kamil Myśliwiec
e7f9ade559 chore(@nestjs) publish v10.4.21 release 2026-01-08 10:36:23 +01:00
Kamil Myśliwiec
a74f89ac10 chore: revert lerna version 2026-01-08 10:36:01 +01:00
Kamil Myśliwiec
5a59810c9c chore(@nestjs) publish v10.4.21 release 2026-01-08 10:35:08 +01:00
Kamil Myśliwiec
3d4fa469c9 chore: add force publish flag 2026-01-08 10:34:45 +01:00
Kamil Myśliwiec
79cd7bc949 chore: add publish legacy 2026-01-08 10:22:59 +01:00
Kamil Mysliwiec
5ab165a60d Merge pull request #16157 from Xilis/fix/express-version-flexibility
fix(express): Update express to 4.22.1 to address CVE-2025-15284
2026-01-08 10:20:19 +01:00
Sašo Vučič
eb0f29d3b7 fix(express): update express to 4.22.1 to address CVE-2025-15284
Refs: CVE-2025-15284
2026-01-05 10:45:45 +01:00
Kamil Myśliwiec
f8021ab3e9 chore(@nestjs) publish v10.4.20 release 2025-07-23 09:43:14 +02:00
Kamil Myśliwiec
0402529e56 chore: bump multer 2025-07-23 09:40:16 +02:00
Kamil Myśliwiec
5ce44905c0 chore(@nestjs) publish v10.4.19 release 2025-06-09 08:55:38 +02:00
Kamil Myśliwiec
e3a69525ce chore: update lerna.json 2025-06-09 08:55:16 +02:00
Kamil Myśliwiec
82f9fed477 chore(@nestjs) publish v10.4.19 release 2025-06-09 08:54:00 +02:00
Kamil Myśliwiec
9e9c3c1c6e chore: update lerna.json 2025-06-09 08:52:21 +02:00
Kamil Myśliwiec
421a5802ff chore(@nestjs) publish v10.4.19 release 2025-06-09 08:50:29 +02:00
Kamil Myśliwiec
2e9f312e9d chore(common): bump multer to 2.0.1 2025-06-09 08:40:15 +02:00
Kamil Myśliwiec
9da1249256 chore(@nestjs) publish v10.4.18 release 2025-05-26 14:20:26 +02:00
Kamil Myśliwiec
ae40d669e5 chore: bump multer to v2 2025-05-26 14:18:08 +02:00
Kamil Myśliwiec
dc2a3c0d31 chore(@nestjs) publish v10.4.17 release 2025-04-15 18:10:25 +02:00
Kamil Myśliwiec
c4fb432637 chore(common): temporarily move file-type to regular deps 2025-04-15 18:09:55 +02:00
Kamil Myśliwiec
6c8aec63b4 chore(@nestjs) publish v10.4.16 release 2025-04-14 10:36:17 +02:00
Kamil Myśliwiec
bce9a49214 Merge branch 'Chathula-fix-nest-common-mime-validator' into 10.4.15 2025-04-14 10:35:17 +02:00
Kamil Myśliwiec
2b9e132f6a chore: update outdated tests, make file-type optional 2025-04-14 10:34:43 +02:00
Chathula
cb0d6506b3 chore: remove duplicate packages 2025-04-11 15:42:50 +02:00
Kamil Myśliwiec
6196ab2150 Merge branch 'Chathula-fix-nestjs-common-mime-validator' 2025-04-11 15:15:54 +02:00
Kamil Myśliwiec
0ac7959927 chore: minor tweaks 2025-04-11 15:15:27 +02:00
Chathula
983216b10e chore: update package lock 2025-04-11 15:07:40 +02:00
Kamil Mysliwiec
312a54ae2e Update packages/common/pipes/file/file-type.validator.ts 2025-04-11 15:02:01 +02:00
Chathula
a28fc033f4 refactor(common): move back file type validator options type 2025-04-11 15:02:01 +02:00
Chathula
07b4b3829e refactor(common): move file-type package to peer dependencies 2025-04-11 15:02:01 +02:00
Chathula
0b7af8ab07 refactor(common): refactor code to use simple eval 2025-04-11 15:02:00 +02:00
Chathula
6953b7a79e fix(common): used eval import 2025-04-11 15:01:57 +02:00
Chathula
1f20f52731 refactor(common): removed async keyword 2025-04-11 15:01:34 +02:00
Chathula
08840c57df fix: remove unused e2e test 2025-04-11 15:01:33 +02:00
Chathula
cddbcd1897 fix(common): update file mime package and add param skip magic numbers 2025-04-11 15:01:30 +02:00
Chathula
890fde4ef0 refactor: revert import change 2025-04-11 15:00:26 +02:00
Chathula
5ae8168617 fix: changed file-type import to promise 2025-04-11 15:00:26 +02:00
Chathula
38a77e2336 chore: update import paths 2025-04-11 15:00:25 +02:00
Chathula
d90cc8dcf2 chore: handles undefined 2025-04-11 15:00:25 +02:00
Chathula
2260e00bab chore: update validations 2025-04-11 15:00:25 +02:00
Chathula
cda46a219a chore: refactor validation code 2025-04-11 15:00:25 +02:00
Chathula
23308c7d4a fix: rename magic file type validator to file type validator 2025-04-11 15:00:20 +02:00
Chathula
f37603a708 chore: update file type import 2025-04-11 14:59:41 +02:00
Chathula
d57f934a3c chore: update exports in pipe 2025-04-11 14:59:41 +02:00
Chathula
059592944b fix: switch to magic file validator by default 2025-04-11 14:59:37 +02:00
Chathula
5feec1f861 fix: fixed sample typo 2025-04-11 14:59:21 +02:00
Chathula
ca1bd82bf9 chore: export magic file type validator 2025-04-11 14:59:16 +02:00
Chathula
7f37b492c9 revert sample file upload changes 2025-04-11 14:58:53 +02:00
Chathula
c6240a0840 chore: use load-esm to use file type package 2025-04-11 14:58:45 +02:00
Chathula
a203e07f48 chore: add file type package to package.json 2025-04-11 14:58:11 +02:00
Chathula
315fe55648 fix(common): introduce magic file type validator to nestjs common 2025-04-11 14:58:08 +02:00
Kamil Mysliwiec
14c6cd0e02 Update packages/common/pipes/file/file-type.validator.ts 2025-04-11 14:55:40 +02:00
Chathula
d51f9b6c9d refactor(common): move back file type validator options type 2025-04-11 14:55:36 +02:00
Chathula
18750bd800 refactor(common): move file-type package to peer dependencies 2025-04-11 14:55:17 +02:00
Chathula
f6f4baf53d refactor(common): refactor code to use simple eval 2025-04-11 14:55:17 +02:00
Chathula
010607f172 fix(common): used eval import 2025-04-11 14:55:03 +02:00
Chathula
69fd0e9ddf refactor(common): removed async keyword 2025-04-11 14:54:23 +02:00
Chathula
579d68a6ec refactor: revert import change 2025-04-11 14:50:22 +02:00
Chathula
dd19ac8f06 fix: changed file-type import to promise 2025-04-11 14:50:22 +02:00
Chathula
c571796093 chore: update import paths 2025-04-11 14:50:22 +02:00
Chathula
100d3c0dc8 chore: handles undefined 2025-04-11 14:50:21 +02:00
Chathula
db2fe5b5aa chore: update validations 2025-04-11 14:50:21 +02:00
Chathula
30e4acae29 chore: refactor validation code 2025-04-11 14:50:21 +02:00
Chathula
4a2c6e020e fix: rename magic file type validator to file type validator 2025-04-11 14:50:18 +02:00
Chathula
b03302cf26 chore: update file type import 2025-04-11 14:45:09 +02:00
Chathula
fdebabd003 chore: update exports in pipe 2025-04-11 14:45:09 +02:00
Chathula
e1229b124d fix: switch to magic file validator by default 2025-04-11 14:45:06 +02:00
Chathula
4d21f1e491 fix: fixed sample typo 2025-04-11 14:44:45 +02:00
Chathula
0ff055834c chore: export magic file type validator 2025-04-11 14:44:45 +02:00
Chathula
d7a6952f19 revert sample file upload changes 2025-04-11 14:44:45 +02:00
Chathula
ac04c340f3 chore: use load-esm to use file type package 2025-04-11 14:44:39 +02:00
Chathula
598ee4f265 chore: add file type package to package.json 2025-04-11 14:40:54 +02:00
Chathula
3dc367bbb1 fix(common): introduce magic file type validator to nestjs common 2025-04-11 14:40:07 +02:00
Kamil Myśliwiec
d0fb875e23 chore(@nestjs) publish v10.4.15 release 2024-12-09 12:15:54 +01:00
Kamil Myśliwiec
b3412d9ca9 Merge branch 'master' of https://github.com/nestjs/nest 2024-12-09 12:14:37 +01:00
Kamil Myśliwiec
1d457fe79f chore(@nestjs) publish v10.4.14 release 2024-12-09 12:14:21 +01:00
Kamil Mysliwiec
6d90dfadca Merge pull request #14294 from nestjs/renovate/prettier-3.x
chore(deps): update dependency prettier to v3.4.2
2024-12-09 12:10:34 +01:00
renovate[bot]
b8ed8eb4fd chore(deps): update dependency prettier to v3.4.2 2024-12-09 10:18:07 +00:00
Kamil Mysliwiec
e52f80af3c Merge pull request #14292 from nestjs/renovate/eslint-plugin-prettier-5.x
chore(deps): update dependency eslint-plugin-prettier to v5.2.1
2024-12-09 11:14:51 +01:00
renovate[bot]
c7e5e08c97 chore(deps): update dependency eslint-plugin-prettier to v5.2.1 2024-12-09 09:24:15 +00:00
Kamil Mysliwiec
ef67824272 Merge pull request #14160 from nestjs/renovate/fastify-middie-8.x
chore(deps): update dependency @fastify/middie to v8.3.3
2024-12-09 10:19:55 +01:00
Kamil Mysliwiec
3044aae2fe Merge pull request #14291 from nestjs/renovate/eslint-plugin-import-2.x
chore(deps): update dependency eslint-plugin-import to v2.31.0
2024-12-09 10:19:48 +01:00
renovate[bot]
e22768083e chore(deps): update dependency eslint-plugin-import to v2.31.0 2024-12-09 09:18:15 +00:00
renovate[bot]
27aaa560e1 chore(deps): update dependency @fastify/middie to v8.3.3 2024-12-09 09:17:53 +00:00
Kamil Mysliwiec
d3f525135b Merge pull request #14286 from nestjs/renovate/eslint-monorepo
chore(deps): update dependency eslint to v8.57.1
2024-12-09 10:12:41 +01:00
Kamil Mysliwiec
fd7d10f69f Merge pull request #14285 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update dependency @typescript-eslint/parser to v8.17.0
2024-12-09 10:12:34 +01:00
Kamil Mysliwiec
c9a600c3f5 Merge pull request #14290 from nestjs/dependabot/npm_and_yarn/prettier-3.4.2
chore(deps-dev): bump prettier from 3.3.3 to 3.4.2
2024-12-09 10:12:24 +01:00
dependabot[bot]
a9a7a9095c chore(deps-dev): bump prettier from 3.3.3 to 3.4.2
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.3 to 3.4.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 00:26:34 +00:00
renovate[bot]
2c276ac8ec chore(deps): update dependency eslint to v8.57.1 2024-12-06 14:59:12 +00:00
renovate[bot]
0d0b5f7098 chore(deps): update dependency @typescript-eslint/parser to v8.17.0 2024-12-06 14:58:59 +00:00
Kamil Mysliwiec
0e5bf68e7a Merge pull request #14283 from nestjs/renovate/mongoose-8.x
fix(deps): update dependency mongoose to v8.8.4
2024-12-06 12:30:43 +01:00
Kamil Mysliwiec
6029a251ba Merge pull request #14284 from nestjs/renovate/babel-monorepo
chore(deps): update dependency @babel/cli to v7.26.4
2024-12-06 12:30:33 +01:00
renovate[bot]
cf9bf7cdc2 chore(deps): update dependency @babel/cli to v7.26.4 2024-12-06 11:06:47 +00:00
renovate[bot]
03e0af6440 fix(deps): update dependency mongoose to v8.8.4 2024-12-06 11:06:42 +00:00
Kamil Mysliwiec
9e5e4f6db3 Merge pull request #14280 from nestjs/renovate/commitlint-monorepo
chore(deps): update dependency @commitlint/cli to v19.6.0
2024-12-06 12:02:51 +01:00
Kamil Mysliwiec
39cc540826 Merge pull request #14282 from nestjs/renovate/express-4.x
fix(deps): update dependency express to v4.21.2
2024-12-06 12:02:43 +01:00
renovate[bot]
4971ef3a5a chore(deps): update dependency @commitlint/cli to v19.6.0 2024-12-06 07:19:17 +00:00
renovate[bot]
f4b242a6aa fix(deps): update dependency express to v4.21.2 2024-12-06 07:18:47 +00:00
Kamil Mysliwiec
31a5a552ca Merge pull request #14279 from nestjs/renovate/confluentinc-cp-zookeeper-7.x
chore(deps): update confluentinc/cp-zookeeper docker tag to v7.8.0
2024-12-06 08:12:54 +01:00
renovate[bot]
b642364f6b chore(deps): update confluentinc/cp-zookeeper docker tag to v7.8.0 2024-12-05 12:43:26 +00:00
Kamil Mysliwiec
fb72d01118 Merge pull request #14275 from nestjs/renovate/amqplib-0.x
chore(deps): update dependency @types/amqplib to v0.10.6
2024-12-05 13:39:23 +01:00
Kamil Mysliwiec
8c1a6878cd Merge pull request #14277 from nestjs/renovate/nest-graphql-monorepo
fix(deps): update nest-graphql monorepo to v12.2.2
2024-12-05 13:39:16 +01:00
renovate[bot]
42c4316777 fix(deps): update nest-graphql monorepo to v12.2.2 2024-12-05 07:42:01 +00:00
renovate[bot]
a03363f9ca chore(deps): update dependency @types/amqplib to v0.10.6 2024-12-05 07:41:40 +00:00
Kamil Mysliwiec
563c088f2a Merge pull request #14271 from nestjs/renovate/dotenv-16.x
fix(deps): update dependency dotenv to v16.4.7
2024-12-05 08:31:18 +01:00
Kamil Mysliwiec
31c6fadbc3 Merge pull request #14272 from nestjs/renovate/confluentinc-cp-kafka-7.x
chore(deps): update confluentinc/cp-kafka docker tag to v7.8.0
2024-12-05 08:31:12 +01:00
Kamil Mysliwiec
e24a6833af Merge pull request #14273 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.12.4
chore(deps-dev): bump @grpc/grpc-js from 1.12.2 to 1.12.4
2024-12-05 08:31:06 +01:00
dependabot[bot]
84ab3145a9 chore(deps-dev): bump @grpc/grpc-js from 1.12.2 to 1.12.4
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.12.2 to 1.12.4.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.12.2...@grpc/grpc-js@1.12.4)

---
updated-dependencies:
- dependency-name: "@grpc/grpc-js"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 00:28:49 +00:00
renovate[bot]
f0824383ba chore(deps): update confluentinc/cp-kafka docker tag to v7.8.0 2024-12-04 09:50:03 +00:00
Kamil Mysliwiec
762406a78d Merge pull request #14266 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo
2024-12-04 10:45:02 +01:00
renovate[bot]
e0e9002bb7 chore(deps): update babel monorepo 2024-12-04 09:42:49 +00:00
renovate[bot]
15c04cd0e5 fix(deps): update dependency dotenv to v16.4.7 2024-12-04 09:42:42 +00:00
Kamil Mysliwiec
f5f226c513 Merge pull request #14265 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v10.4.13
2024-12-04 10:37:01 +01:00
Kamil Mysliwiec
26f1341429 Merge pull request #14269 from nestjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-8.17.0
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 8.15.0 to 8.17.0
2024-12-04 10:36:54 +01:00
dependabot[bot]
07886bf320 chore(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.15.0 to 8.17.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.17.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-04 00:26:06 +00:00
renovate[bot]
0e54f52d27 fix(deps): update nest monorepo to v10.4.13 2024-12-03 14:37:32 +00:00
Kamil Mysliwiec
50796582df Merge pull request #14264 from nestjs/renovate/reflect-metadata-0.x
fix(deps): update dependency reflect-metadata to v0.2.2
2024-12-03 15:29:00 +01:00
renovate[bot]
e3c95e4f60 fix(deps): update dependency reflect-metadata to v0.2.2 2024-12-03 13:07:08 +00:00
Kamil Mysliwiec
6ea7dcebb6 Merge pull request #14262 from nestjs/renovate/nestjs-typeorm-10.x
fix(deps): update dependency @nestjs/typeorm to v10.0.2
2024-12-03 14:00:59 +01:00
Kamil Mysliwiec
34c5ba6191 Merge pull request #14263 from nestjs/renovate/dotenv-16.x
fix(deps): update dependency dotenv to v16.4.6
2024-12-03 14:00:53 +01:00
renovate[bot]
edb8b1b0e8 fix(deps): update dependency dotenv to v16.4.6 2024-12-03 11:32:16 +00:00
renovate[bot]
ce764067a4 fix(deps): update dependency @nestjs/typeorm to v10.0.2 2024-12-03 11:32:08 +00:00
Kamil Mysliwiec
ef66275ae9 Merge pull request #14260 from nestjs/renovate/bytes-3.x
chore(deps): update dependency @types/bytes to v3.1.5
2024-12-03 12:26:50 +01:00
Kamil Mysliwiec
21143d757b Merge pull request #14261 from nestjs/renovate/nestjs-serve-static-4.x
fix(deps): update dependency @nestjs/serve-static to v4.0.2
2024-12-03 12:26:43 +01:00
renovate[bot]
06349b61cd chore(deps): update dependency @types/bytes to v3.1.5 2024-12-03 10:41:23 +00:00
Kamil Myśliwiec
1eba0121a0 chore(@nestjs) publish v10.4.13 release 2024-12-03 11:37:34 +01:00
Kamil Myśliwiec
c5bbd1e40f Merge branch 'master' of https://github.com/nestjs/nest 2024-12-03 11:03:20 +01:00
Kamil Mysliwiec
265f6d03c8 Merge pull request #14256 from sapenlei/chore/add-type-declaration-RawBody
chore(common): Add type declaration for RawBody decorator with pipes
2024-12-03 11:02:48 +01:00
Kamil Myśliwiec
3f127e6a2f Merge branch 'master' of https://github.com/nestjs/nest 2024-12-03 10:55:32 +01:00
Kamil Myśliwiec
b1b262f4c3 fix(microservices): unsubscribe instead of completing replay buffer 2024-12-03 10:54:56 +01:00
sapenlei
59bf615d29 refactor(common): Add type declaration for RawBody decorator with pipes 2024-12-03 17:53:30 +08:00
renovate[bot]
c53eee2065 fix(deps): update dependency @nestjs/serve-static to v4.0.2 2024-12-03 09:49:57 +00:00
Kamil Mysliwiec
25feb4540a Merge pull request #14257 from nestjs/renovate/fastify-static-7.x
fix(deps): update dependency @fastify/static to v7.0.4
2024-12-03 09:50:31 +01:00
Kamil Mysliwiec
9edc20d84c Merge pull request #14258 from nestjs/renovate/nestjs-sequelize-10.x
fix(deps): update dependency @nestjs/sequelize to v10.0.1
2024-12-03 09:50:24 +01:00
renovate[bot]
f6240160ae fix(deps): update dependency @nestjs/sequelize to v10.0.1 2024-12-03 08:46:54 +00:00
renovate[bot]
5a558b271f fix(deps): update dependency @fastify/static to v7.0.4 2024-12-03 08:46:47 +00:00
Kamil Mysliwiec
2c72d447c1 Merge pull request #14249 from nestjs/dependabot/npm_and_yarn/sample/32-graphql-federation-schema-first/users-application/apollo/gateway-2.8.5
chore(deps): bump @apollo/gateway from 2.4.8 to 2.8.5 in /sample/32-graphql-federation-schema-first/users-application
2024-12-03 09:37:02 +01:00
dependabot[bot]
a7dd69328a chore(deps): bump @apollo/gateway
Bumps [@apollo/gateway](https://github.com/apollographql/federation/tree/HEAD/gateway-js) from 2.4.8 to 2.8.5.
- [Release notes](https://github.com/apollographql/federation/releases)
- [Changelog](https://github.com/apollographql/federation/blob/main/gateway-js/CHANGELOG.md)
- [Commits](https://github.com/apollographql/federation/commits/@apollo/gateway@2.8.5/gateway-js)

---
updated-dependencies:
- dependency-name: "@apollo/gateway"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-03 08:36:40 +00:00
Kamil Mysliwiec
57c5e6f118 Merge pull request #14250 from nestjs/renovate/jest-monorepo
chore(deps): update jest monorepo
2024-12-03 09:36:05 +01:00
Kamil Mysliwiec
bc50321c7a Merge pull request #14245 from nestjs/renovate/mqtt-5.x
chore(deps): update dependency mqtt to v5.10.3
2024-12-03 09:35:52 +01:00
Kamil Mysliwiec
9b0cd523aa Merge pull request #14247 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v10.4.12
2024-12-03 09:35:46 +01:00
Kamil Mysliwiec
24e0106b46 Merge pull request #14251 from nestjs/dependabot/npm_and_yarn/graphql-tools-9.0.5
chore(deps-dev): bump graphql-tools from 9.0.3 to 9.0.5
2024-12-03 09:35:32 +01:00
sapenlei
439231ed61 chore(common): Add type declaration for RawBody decorator with pipes
Closes #14254
2024-12-03 11:18:29 +08:00
dependabot[bot]
425121d809 chore(deps-dev): bump graphql-tools from 9.0.3 to 9.0.5
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 9.0.3 to 9.0.5.
- [Release notes](https://github.com/ardatan/graphql-tools/releases)
- [Changelog](https://github.com/ardatan/graphql-tools/blob/master/packages/graphql-tools/CHANGELOG.md)
- [Commits](https://github.com/ardatan/graphql-tools/commits/graphql-tools@9.0.5/packages/graphql-tools)

---
updated-dependencies:
- dependency-name: graphql-tools
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 00:24:21 +00:00
renovate[bot]
d0fe4833ad fix(deps): update nest monorepo to v10.4.12 2024-12-01 19:17:01 +00:00
renovate[bot]
c95ed06498 chore(deps): update jest monorepo 2024-12-01 19:16:50 +00:00
renovate[bot]
d7b460c8b8 chore(deps): update dependency mqtt to v5.10.3 2024-12-01 19:16:43 +00:00
Kamil Mysliwiec
28b785991b Merge pull request #14248 from micalevisk/refactor-drop-lock-files-from-samples
chore: remove package lock files from sample projects
2024-12-01 20:12:49 +01:00
Micael Levi L. Cavalcante
72b32356dc chore: remove package lock files from sample projects 2024-12-01 13:18:25 -04:00
Kamil Mysliwiec
b1a2582abc Merge pull request #14246 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2024-11-29 12:49:54 +01:00
renovate[bot]
c8c9ce7e89 chore(deps): update nest monorepo 2024-11-29 11:41:54 +00:00
Kamil Myśliwiec
cf8d27c2f3 chore(@nestjs) publish v10.4.12 release 2024-11-29 12:31:17 +01:00
Kamil Mysliwiec
526f3d4b0a Merge pull request #14241 from LhonRafaat/fix/validationpipe-nested-query-params
fix(common): enforce string type in validationpipe
2024-11-29 12:27:26 +01:00
Kamil Mysliwiec
3eea086936 Merge pull request #14243 from nestjs/renovate/node-20.x
chore(deps): update dependency @types/node to v20.17.9
2024-11-29 12:23:57 +01:00
lhonRafaat
74c4376bbc fix(common): enforce strin value if not undefined 2024-11-29 10:49:05 +03:00
renovate[bot]
6474afae9d chore(deps): update dependency @types/node to v20.17.9 2024-11-29 07:41:11 +00:00
Kamil Mysliwiec
f53d138b04 Merge pull request #14240 from nestjs/renovate/multer-1.x
chore(deps): update dependency @types/multer to v1.4.12
2024-11-29 08:35:36 +01:00
lhonRafaat
6563c18417 fix(common): return undefined if string type value is undefined 2024-11-28 21:22:22 +03:00
lhonRafaat
a071a73e6d fix(common): enforce string type in validationpipe
strictly parse the value to string to avoid nested objects being passed if the type is explicitly set to string

closes #14234
2024-11-28 17:46:02 +03:00
renovate[bot]
fb9a534531 chore(deps): update dependency @types/multer to v1.4.12 2024-11-28 13:09:52 +00:00
Kamil Mysliwiec
d220da6b6f Merge pull request #14239 from nestjs/renovate/chai-4.x
chore(deps): update dependency @types/chai to v4.3.20
2024-11-28 11:42:21 +01:00
renovate[bot]
c0a87b868f chore(deps): update dependency @types/chai to v4.3.20 2024-11-28 10:37:21 +00:00
Kamil Mysliwiec
988d49e0d0 Merge pull request #14237 from nestjs/renovate/confluentinc-cp-zookeeper-7.x
chore(deps): update confluentinc/cp-zookeeper docker tag to v7.7.2
2024-11-28 11:29:14 +01:00
renovate[bot]
fc8c3e2167 chore(deps): update confluentinc/cp-zookeeper docker tag to v7.7.2 2024-11-28 10:07:26 +00:00
Kamil Mysliwiec
19f9e4ed1b Merge pull request #14236 from nestjs/renovate/confluentinc-cp-kafka-7.x
chore(deps): update confluentinc/cp-kafka docker tag to v7.7.2
2024-11-28 11:03:14 +01:00
renovate[bot]
50e97b2abe chore(deps): update confluentinc/cp-kafka docker tag to v7.7.2 2024-11-28 09:39:44 +00:00
Kamil Mysliwiec
18389c7261 Merge pull request #12253 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages
2024-11-28 10:36:55 +01:00
Kamil Mysliwiec
4808efa0cd Merge pull request #14235 from nestjs/dependabot/npm_and_yarn/commitlint/config-angular-19.6.0
chore(deps-dev): bump @commitlint/config-angular from 19.5.0 to 19.6.0
2024-11-28 08:09:41 +01:00
dependabot[bot]
d51448cae6 chore(deps-dev): bump @commitlint/config-angular from 19.5.0 to 19.6.0
Bumps [@commitlint/config-angular](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-angular) from 19.5.0 to 19.6.0.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-angular/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v19.6.0/@commitlint/config-angular)

---
updated-dependencies:
- dependency-name: "@commitlint/config-angular"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-28 00:46:51 +00:00
renovate[bot]
da369005f2 fix(deps): update apollo graphql packages 2024-11-27 11:45:15 +00:00
Kamil Mysliwiec
b31f9e4825 Merge pull request #14226 from nestjs/renovate/tslib-2.x
fix(deps): update dependency tslib to v2.8.1
2024-11-27 12:40:35 +01:00
Kamil Mysliwiec
34eb4c1be9 Merge pull request #14233 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2024-11-27 12:40:04 +01:00
renovate[bot]
ccfd0f19b6 chore(deps): update nest monorepo 2024-11-27 11:36:17 +00:00
renovate[bot]
7db85ad33c fix(deps): update dependency tslib to v2.8.1 2024-11-27 11:23:50 +00:00
Kamil Mysliwiec
f69bb660e0 Merge pull request #14232 from nestjs/renovate/npm-path-to-regexp-vulnerability
fix(deps): update dependency path-to-regexp to v3.3.0 [security]
2024-11-27 12:19:05 +01:00
renovate[bot]
ffaa6de5c4 fix(deps): update dependency path-to-regexp to v3.3.0 [security] 2024-11-27 11:16:04 +00:00
Kamil Mysliwiec
315a430197 Merge pull request #14229 from nestjs/renovate/mongo-8.x
chore(deps): update mongo docker tag to v8
2024-11-27 12:03:41 +01:00
Kamil Mysliwiec
eca955d3d0 Merge pull request #14228 from nestjs/renovate/node-22.x
chore(deps): update dependency @types/node to v22.10.0
2024-11-27 12:03:17 +01:00
Kamil Mysliwiec
0e92425c0e Merge pull request #14227 from nestjs/renovate/nest-graphql-monorepo
fix(deps): update nest-graphql monorepo to v12.2.1
2024-11-27 12:03:09 +01:00
Kamil Mysliwiec
a23e7df2a4 Merge pull request #14225 from nestjs/renovate/socket.io-packages
fix(deps): update dependency socket.io to v4.8.1
2024-11-27 12:02:52 +01:00
Kamil Mysliwiec
5b0824385f Merge pull request #14224 from nestjs/renovate/sequelize-6.x
fix(deps): update dependency sequelize to v6.37.5
2024-11-27 12:02:44 +01:00
Kamil Mysliwiec
95d5dc1af3 Merge pull request #14230 from nestjs/renovate/mysql-9.x
chore(deps): update mysql docker tag to v9
2024-11-27 12:02:35 +01:00
Kamil Mysliwiec
f1226548f7 Merge pull request #14231 from nestjs/renovate/nestjs-swagger-8.x
fix(deps): update dependency @nestjs/swagger to v8
2024-11-27 12:02:16 +01:00
Kamil Myśliwiec
bedf1fa2a6 chore(@nestjs) publish v10.4.11 release 2024-11-27 12:01:46 +01:00
Kamil Myśliwiec
96e3e79acc fix(grpc): schedule messages forwarding after the current event loop 2024-11-27 11:50:50 +01:00
renovate[bot]
c5e1c2e74a fix(deps): update dependency @nestjs/swagger to v8 2024-11-27 10:24:12 +00:00
renovate[bot]
a9b198c08f chore(deps): update mysql docker tag to v9 2024-11-27 10:23:53 +00:00
renovate[bot]
043d4a095b chore(deps): update mongo docker tag to v8 2024-11-27 10:23:42 +00:00
renovate[bot]
09f1d002f3 chore(deps): update dependency @types/node to v22.10.0 2024-11-27 10:22:41 +00:00
renovate[bot]
91dffa5da4 fix(deps): update nest-graphql monorepo to v12.2.1 2024-11-27 10:18:53 +00:00
renovate[bot]
13a22ef3d6 fix(deps): update dependency socket.io to v4.8.1 2024-11-27 10:17:05 +00:00
renovate[bot]
d7d784f926 fix(deps): update dependency sequelize to v6.37.5 2024-11-27 10:16:45 +00:00
Kamil Myśliwiec
e411d80d4d chore: remove a leftover 2024-11-27 11:06:07 +01:00
Kamil Mysliwiec
9fb542968b Merge pull request #14223 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2024-11-27 10:57:53 +01:00
renovate[bot]
e6fe92ce79 chore(deps): update nest monorepo 2024-11-27 09:57:12 +00:00
Kamil Mysliwiec
2df0c754da Merge pull request #14222 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2024-11-27 10:48:24 +01:00
renovate[bot]
a119a1a9c1 chore(deps): update nest monorepo 2024-11-27 09:30:26 +00:00
Kamil Myśliwiec
5ebe4b93b3 chore(@nestjs) publish v10.4.10 release 2024-11-27 10:18:59 +01:00
Kamil Mysliwiec
4a9a3d86c2 Merge pull request #14221 from nestjs/renovate/mysql-8.x
chore(deps): update mysql docker tag to v8.4.3
2024-11-27 10:00:48 +01:00
Kamil Mysliwiec
1cf339c5be Merge pull request #14220 from nestjs/renovate/webpack-5.x
chore(deps): update dependency webpack to v5.96.1
2024-11-27 10:00:36 +01:00
Kamil Mysliwiec
2c2d766502 Merge pull request #14219 from nestjs/renovate/nodemon-3.x
chore(deps): update dependency nodemon to v3.1.7
2024-11-27 10:00:28 +01:00
Kamil Myśliwiec
dbeaa0b316 sample: fix mongoose model mock 2024-11-27 09:59:11 +01:00
Kamil Mysliwiec
5396c8c6f0 Merge pull request #14218 from nestjs/renovate/confluentinc-cp-zookeeper-7.x
chore(deps): update confluentinc/cp-zookeeper docker tag to v7.7.1
2024-11-27 09:57:33 +01:00
renovate[bot]
13092aeac0 chore(deps): update dependency webpack to v5.96.1 2024-11-27 08:57:32 +00:00
Kamil Mysliwiec
6aa6d47c25 Merge pull request #14217 from nestjs/renovate/confluentinc-cp-kafka-7.x
chore(deps): update confluentinc/cp-kafka docker tag to v7.7.1
2024-11-27 09:57:25 +01:00
renovate[bot]
38bea6e544 chore(deps): update dependency nodemon to v3.1.7 2024-11-27 08:57:12 +00:00
Kamil Mysliwiec
42a443ee9a Merge pull request #14216 from nestjs/renovate/rimraf-5.x
fix(deps): update dependency rimraf to v5.0.10
2024-11-27 09:56:34 +01:00
Kamil Mysliwiec
f39cffe8ea Merge pull request #14215 from nestjs/renovate/dotenv-16.x
fix(deps): update dependency dotenv to v16.4.5
2024-11-27 09:56:24 +01:00
Kamil Mysliwiec
f97c8bc586 Merge pull request #14214 from nestjs/renovate/grpc-reflection-1.x
fix(deps): update dependency @grpc/reflection to v1.0.4
2024-11-27 09:56:03 +01:00
renovate[bot]
ca78cbe447 chore(deps): update mysql docker tag to v8.4.3 2024-11-27 08:48:24 +00:00
renovate[bot]
9e21f093d8 chore(deps): update confluentinc/cp-zookeeper docker tag to v7.7.1 2024-11-27 08:47:12 +00:00
renovate[bot]
619db30f16 chore(deps): update confluentinc/cp-kafka docker tag to v7.7.1 2024-11-27 08:46:59 +00:00
renovate[bot]
9174dd647e fix(deps): update dependency rimraf to v5.0.10 2024-11-27 08:46:41 +00:00
Kamil Myśliwiec
f95758d88d sample: replace findByIdAndRemove with findByIdAndDelete 2024-11-27 09:43:57 +01:00
renovate[bot]
7854ceb1db fix(deps): update dependency dotenv to v16.4.5 2024-11-27 08:41:58 +00:00
renovate[bot]
d8343a22cc fix(deps): update dependency @grpc/reflection to v1.0.4 2024-11-27 08:41:19 +00:00
Kamil Mysliwiec
38ab78272f Merge pull request #12940 from nestjs/renovate/mongoose-8.x
fix(deps): update dependency mongoose to v8.8.3
2024-11-27 09:27:18 +01:00
renovate[bot]
45f3322832 fix(deps): update dependency mongoose to v8.8.3 2024-11-27 07:57:35 +00:00
Kamil Mysliwiec
9bbc4dbab3 Merge pull request #14207 from nestjs/renovate/dotenv-8.x
chore(deps): update dependency @types/dotenv to v8.2.3
2024-11-27 08:50:19 +01:00
Kamil Mysliwiec
b46508793e Merge pull request #14208 from nestjs/renovate/node-20.x
chore(deps): update dependency @types/node to v20.17.8
2024-11-27 08:50:10 +01:00
Kamil Mysliwiec
feb75da3ce Merge pull request #14209 from nestjs/renovate/amqplib-0.x
chore(deps): update dependency amqplib to v0.10.5
2024-11-27 08:50:02 +01:00
renovate[bot]
46db58c196 chore(deps): update dependency amqplib to v0.10.5 2024-11-27 07:47:07 +00:00
renovate[bot]
638d4666fb chore(deps): update dependency @types/node to v20.17.8 2024-11-27 07:46:32 +00:00
Kamil Mysliwiec
91190b4175 Merge pull request #14212 from nestjs/renovate/npm-webpack-vulnerability
chore(deps): update dependency webpack to v5.94.0 [security]
2024-11-27 08:43:07 +01:00
renovate[bot]
d1a76abe21 chore(deps): update dependency @types/dotenv to v8.2.3 2024-11-27 07:42:51 +00:00
renovate[bot]
055709dd3a chore(deps): update dependency webpack to v5.94.0 [security] 2024-11-27 07:40:26 +00:00
Kamil Mysliwiec
f80b00793c Merge pull request #14210 from nestjs/renovate/husky-9.x
chore(deps): update dependency husky to v9.1.7
2024-11-27 08:39:07 +01:00
Kamil Mysliwiec
b876e6b60d Merge pull request #14211 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2024-11-27 08:30:17 +01:00
renovate[bot]
a7392981cf chore(deps): update nest monorepo 2024-11-27 07:27:07 +00:00
renovate[bot]
afb889dd21 chore(deps): update dependency husky to v9.1.7 2024-11-27 07:22:52 +00:00
Kamil Mysliwiec
8da7ebcbfd Merge pull request #14206 from nestjs/dependabot/npm_and_yarn/mongoose-8.8.3
chore(deps-dev): bump mongoose from 8.8.1 to 8.8.3
2024-11-27 08:15:28 +01:00
dependabot[bot]
c90553bb05 chore(deps-dev): bump mongoose from 8.8.1 to 8.8.3
Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.8.1 to 8.8.3.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/8.8.1...8.8.3)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-27 00:39:08 +00:00
Kamil Mysliwiec
8102325bd2 Merge pull request #14204 from sapenlei/fix/non-shared-server-close
fix(websockets): ensure non-shared servers call close method
2024-11-26 08:19:50 +01:00
sapen
bba5fde16e fix(websockets): ensure non-shared servers call close method 2024-11-26 11:11:58 +08:00
Kamil Myśliwiec
416830c392 chore(@nestjs) publish v10.4.9 release 2024-11-25 15:34:51 +01:00
Kamil Mysliwiec
9286733482 Merge pull request #13923 from DylanVeldra/fix-tenant-context-payload
fix(core): merge req context with tenant payload in the request instance
2024-11-25 15:01:51 +01:00
Kamil Mysliwiec
81597f7ed9 Merge branch 'master' into fix-tenant-context-payload 2024-11-25 14:38:47 +01:00
Kamil Myśliwiec
84b8744f90 refactor: methods order, types in e2e test 2024-11-25 14:34:28 +01:00
Kamil Mysliwiec
95c8547b68 Merge pull request #14185 from sapenlei/fix/prevent-socketio-server-close
fix(websockets): Prevent HTTP server early close in Socket.IO shutdown
2024-11-25 14:31:18 +01:00
Kamil Myśliwiec
ae0517b364 Merge branch 'master' of https://github.com/nestjs/nest 2024-11-25 14:28:56 +01:00
Kamil Myśliwiec
8ffae006c8 sample: revert microservices sample local updates 2024-11-25 14:28:44 +01:00
Kamil Mysliwiec
f7248e2d8d Merge pull request #14181 from nestjs/fix/validation-pipe-swc-enum-bug
fix(common): fallback to empty string for enums when validating (swc builder)
2024-11-25 14:12:13 +01:00
Kamil Myśliwiec
25ad5b4b80 refactor(core): tiny improvements 2024-11-25 14:11:38 +01:00
Kamil Mysliwiec
3324703b88 Merge pull request #13804 from patrickacioli/fix-lazy-transient-provider
fix(core): dependencies not resolving for transient lazy providers
2024-11-25 14:10:06 +01:00
sapen
3b5cb562a1 test(websockets): Add integration test for Socket.IO HTTP server shutdown 2024-11-22 20:14:02 +08:00
Kamil Mysliwiec
67e30e2f1f Merge pull request #14192 from nestjs/renovate/npm-webpack-vulnerability
chore(deps): update dependency webpack to v5.94.0 [security]
2024-11-22 11:31:18 +01:00
sapen
f650c22af8 fix(websockets): Revert type 2024-11-22 15:45:08 +08:00
renovate[bot]
2b90f44621 chore(deps): update dependency webpack to v5.94.0 [security] 2024-11-22 07:27:42 +00:00
Kamil Mysliwiec
3cf1130eaa Merge pull request #14191 from nestjs/dependabot/npm_and_yarn/light-my-request-6.3.0
chore(deps): bump light-my-request from 6.1.0 to 6.3.0
2024-11-22 08:24:47 +01:00
dependabot[bot]
646c663366 chore(deps): bump light-my-request from 6.1.0 to 6.3.0
Bumps [light-my-request](https://github.com/fastify/light-my-request) from 6.1.0 to 6.3.0.
- [Release notes](https://github.com/fastify/light-my-request/releases)
- [Commits](https://github.com/fastify/light-my-request/compare/v6.1.0...v6.3.0)

---
updated-dependencies:
- dependency-name: light-my-request
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-22 00:26:01 +00:00
Kamil Mysliwiec
f39fdacf8a Merge pull request #14188 from nestjs/dependabot/npm_and_yarn/sample/30-event-emitter/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/30-event-emitter
2024-11-21 14:37:45 +01:00
dependabot[bot]
7fe2f43d28 chore(deps): bump cross-spawn in /sample/30-event-emitter
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 13:19:30 +00:00
Kamil Mysliwiec
180a3e6bd3 Merge pull request #14187 from nestjs/dependabot/npm_and_yarn/sample/34-using-esm-packages/multi-c29acd3782
chore(deps): bump cookie and @nestjs/platform-express in /sample/34-using-esm-packages
2024-11-21 14:18:28 +01:00
Kamil Mysliwiec
afbba2d318 Merge pull request #14189 from nestjs/dependabot/npm_and_yarn/sample/19-auth-jwt/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/19-auth-jwt
2024-11-21 14:18:19 +01:00
dependabot[bot]
e3e9636dcc chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/19-auth-jwt
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 13:14:40 +00:00
Kamil Mysliwiec
a4ddd867e6 Merge pull request #14186 from nestjs/dependabot/npm_and_yarn/sample/31-graphql-federation-code-first/posts-application/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/31-graphql-federation-code-first/posts-application
2024-11-21 14:13:14 +01:00
dependabot[bot]
f99353f45e chore(deps): bump cookie and @nestjs/platform-express
Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express). These dependencies need to be updated together.


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1)

Updates `@nestjs/platform-express` from 10.4.4 to 10.4.8
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.8/packages/platform-express)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: "@nestjs/platform-express"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 11:49:11 +00:00
dependabot[bot]
f3c0fcde5b chore(deps): bump cross-spawn
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 11:49:11 +00:00
Kamil Mysliwiec
29cc21c7b7 Merge pull request #14183 from nestjs/dependabot/npm_and_yarn/sample/32-graphql-federation-schema-first/posts-application/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/32-graphql-federation-schema-first/posts-application
2024-11-21 12:47:07 +01:00
sapen
40dbb27519 fix(websockets): Prevent HTTP server early close in Socket.IO shutdown 2024-11-21 19:20:26 +08:00
dependabot[bot]
2111a40e47 chore(deps): bump cross-spawn
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 09:32:47 +00:00
Kamil Mysliwiec
440e9cf6a3 Merge pull request #14176 from nestjs/dependabot/npm_and_yarn/sample/32-graphql-federation-schema-first/users-application/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/32-graphql-federation-schema-first/users-application
2024-11-21 10:31:30 +01:00
Kamil Mysliwiec
f76a69341e Update packages/common/pipes/validation.pipe.ts 2024-11-21 09:48:21 +01:00
Kamil Myśliwiec
a3acefffda fix(common): fallback to empty string for enums when validating (swc) 2024-11-21 09:38:42 +01:00
Kamil Mysliwiec
73dea121d7 Merge pull request #14179 from nestjs/dependabot/npm_and_yarn/types/mocha-10.0.10
chore(deps-dev): bump @types/mocha from 10.0.9 to 10.0.10
2024-11-21 08:20:48 +01:00
Kamil Mysliwiec
a1732f5b3d Merge pull request #14175 from micalevisk/fix-issue-14154
fix(common,core): align the logic of optional provider
2024-11-21 08:20:34 +01:00
dependabot[bot]
76e73c26d5 chore(deps-dev): bump @types/mocha from 10.0.9 to 10.0.10
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 10.0.9 to 10.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 00:23:58 +00:00
dependabot[bot]
62e3bd5a16 chore(deps): bump cross-spawn
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 14:45:08 +00:00
Kamil Mysliwiec
45f4612ed5 Merge pull request #14174 from nestjs/dependabot/npm_and_yarn/sample/22-graphql-prisma/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/22-graphql-prisma
2024-11-20 15:43:53 +01:00
Micael Levi L. Cavalcante
aabde1aadb fix(common,core): align the logic of optional provider 2024-11-20 09:43:11 -04:00
Micael Levi L. Cavalcante
de6f7ca20e test(common): improve test suite for getInjectionProviders 2024-11-20 09:40:33 -04:00
dependabot[bot]
33be15afd5 chore(deps): bump cross-spawn in /sample/22-graphql-prisma
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 13:30:43 +00:00
Kamil Mysliwiec
48a74b338b Merge pull request #14173 from nestjs/dependabot/npm_and_yarn/sample/28-sse/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/28-sse
2024-11-20 14:27:26 +01:00
Kamil Myśliwiec
5064d9b4a4 Merge branch 'pacyL2K19-test/sample-12-graphql-schema-first' 2024-11-20 12:56:23 +01:00
Kamil Myśliwiec
d98524ab9c chore: minor formatting changes 2024-11-20 12:56:10 +01:00
Kamil Myśliwiec
ddf99c39d0 Merge branch 'martinvysnovsky-test-sample-mongoose' 2024-11-20 12:53:04 +01:00
Kamil Myśliwiec
691e7d448e chore: minor formatting changes 2024-11-20 12:52:50 +01:00
Kamil Myśliwiec
518879b3d6 Merge branch 'test-sample-mongoose' of https://github.com/martinvysnovsky/nest into martinvysnovsky-test-sample-mongoose 2024-11-20 12:50:39 +01:00
Kamil Myśliwiec
b770d7d9b2 Merge branch 'master' of https://github.com/nestjs/nest 2024-11-20 12:49:16 +01:00
Kamil Myśliwiec
8b978e3028 Merge branch 'Yansb-test/sample-01-cats-app' 2024-11-20 12:49:03 +01:00
Kamil Myśliwiec
0f25e83229 style: minor formatting changes 2024-11-20 12:48:53 +01:00
Kamil Myśliwiec
f3ec5f22fa Merge branch 'test/sample-01-cats-app' of https://github.com/Yansb/nest into Yansb-test/sample-01-cats-app 2024-11-20 12:48:06 +01:00
dependabot[bot]
467697599f chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/28-sse
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 11:47:13 +00:00
Kamil Mysliwiec
1dafb5fdce Merge pull request #14165 from nestjs/dependabot/npm_and_yarn/typescript-eslint/parser-8.15.0
chore(deps-dev): bump @typescript-eslint/parser from 8.14.0 to 8.15.0
2024-11-20 12:46:02 +01:00
Kamil Mysliwiec
71e8acec39 Merge pull request #14163 from nestjs/fix/grpc-client-streaming-bug
fix(microservices): grpc client streaming bugs
2024-11-20 11:11:51 +01:00
Kamil Mysliwiec
6094701679 Merge pull request #12954 from gunb0s/feature/nestjs-kafka-emit-batch
feat: emit batch
2024-11-20 11:11:43 +01:00
Kamil Mysliwiec
99b5a5bbfe Merge pull request #14171 from nestjs/dependabot/npm_and_yarn/sample/11-swagger/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/11-swagger
2024-11-20 10:39:37 +01:00
Kamil Mysliwiec
1531e6a767 Merge pull request #14172 from nestjs/dependabot/npm_and_yarn/sample/35-use-esm-package-after-node22/multi-c29acd3782
chore(deps): bump cookie and @nestjs/platform-express in /sample/35-use-esm-package-after-node22
2024-11-20 10:36:36 +01:00
dependabot[bot]
3fa80a9dab chore(deps): bump cookie and @nestjs/platform-express
Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express). These dependencies need to be updated together.


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1)

Updates `@nestjs/platform-express` from 10.4.4 to 10.4.8
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.8/packages/platform-express)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: "@nestjs/platform-express"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 09:27:05 +00:00
Kamil Mysliwiec
439516d7dc Merge pull request #14051 from micalevisk/add-esm-only-sample
chore: add sample on how to use esm on cjs
2024-11-20 10:26:00 +01:00
dependabot[bot]
22c4e9cae3 chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/11-swagger
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 09:22:40 +00:00
Kamil Mysliwiec
2dda578d9a Merge pull request #14170 from nestjs/dependabot/npm_and_yarn/sample/24-serve-static/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/24-serve-static
2024-11-20 10:21:33 +01:00
Kamil Myśliwiec
b65c41c5a8 fix: use proxy, drain buffer before execution 2024-11-20 10:21:10 +01:00
dependabot[bot]
f0c3cef7d4 chore(deps): bump cross-spawn in /sample/24-serve-static
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 08:24:47 +00:00
Kamil Mysliwiec
e2e70c1bc3 Merge pull request #14169 from nestjs/dependabot/npm_and_yarn/sample/15-mvc/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/15-mvc
2024-11-20 09:23:39 +01:00
dependabot[bot]
70c18e9e7b chore(deps-dev): bump @typescript-eslint/parser from 8.14.0 to 8.15.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.14.0 to 8.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.15.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 07:42:35 +00:00
dependabot[bot]
102718ad1b chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/15-mvc
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 07:42:00 +00:00
Kamil Mysliwiec
02d26a6fd7 Merge pull request #14164 from nestjs/dependabot/npm_and_yarn/sample/01-cats-app/cross-spawn-7.0.6
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/01-cats-app
2024-11-20 08:40:13 +01:00
Kamil Mysliwiec
8279fb5319 Merge pull request #14167 from nestjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-8.15.0
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 8.14.0 to 8.15.0
2024-11-20 08:40:05 +01:00
dependabot[bot]
d4e5743c9b chore(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.14.0 to 8.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.15.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-19 00:49:10 +00:00
dependabot[bot]
b1e33ece5d chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /sample/01-cats-app
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 22:46:40 +00:00
Micael Levi L. Cavalcante
e15d73190d chore: add sample on how to use esm with nodejs experimental flag 2024-11-18 11:30:39 -04:00
Kamil Myśliwiec
4564503936 fix: use valid reference for the cancel event constant 2024-11-18 15:27:45 +01:00
Kamil Myśliwiec
30a6b52c50 fix(microservices): grpc client streaming bugs #14094 #13818 2024-11-18 15:23:44 +01:00
Kamil Mysliwiec
bc19f81729 Merge pull request #14161 from nestjs/dependabot/npm_and_yarn/sample/25-dynamic-modules/cross-spawn-7.0.5
chore(deps): bump cross-spawn from 7.0.3 to 7.0.5 in /sample/25-dynamic-modules
2024-11-18 09:50:43 +01:00
dependabot[bot]
989075e6c1 chore(deps): bump cross-spawn in /sample/25-dynamic-modules
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.5.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.5)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 08:17:48 +00:00
Kamil Mysliwiec
c60428a6fd Merge pull request #14159 from nestjs/dependabot/npm_and_yarn/sample/33-graphql-mercurius/cross-spawn-7.0.5
chore(deps): bump cross-spawn from 7.0.3 to 7.0.5 in /sample/33-graphql-mercurius
2024-11-18 09:16:06 +01:00
Kamil Mysliwiec
92e2db8d99 Merge pull request #13632 from nestjs/renovate/npm-mysql2-vulnerability
fix(deps): update dependency mysql2 to v3.9.8 [security]
2024-11-18 08:16:45 +01:00
dependabot[bot]
5911ed245e chore(deps): bump cross-spawn in /sample/33-graphql-mercurius
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.5.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.5)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 07:15:19 +00:00
Kamil Mysliwiec
1b4decf75e Merge pull request #14151 from nestjs/dependabot/npm_and_yarn/sample/27-scheduling/cross-spawn-7.0.5
chore(deps): bump cross-spawn from 7.0.3 to 7.0.5 in /sample/27-scheduling
2024-11-18 08:13:39 +01:00
Kamil Mysliwiec
36756dd194 Merge pull request #14153 from micalevisk/patch-1
chore: shallow cloning `wrk` repository on benchmark setup
2024-11-18 08:13:18 +01:00
Kamil Mysliwiec
27193cc99f Merge pull request #14155 from webdiscus/cli-color-to-ansis
build(sample): replace cli-color with smaller and faster ansis
2024-11-18 08:13:08 +01:00
Micael Levi L. Cavalcante
194732f4aa chore: shallow cloning wrk repository on benchmarking setup 2024-11-17 12:41:46 -04:00
biodiscus
3559e0c1f2 build(sample): replace cli-color with smaller and faster ansis 2024-11-17 17:01:47 +01:00
dependabot[bot]
2e4ebe4870 chore(deps): bump cross-spawn in /sample/27-scheduling
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.5.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.5)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-16 21:17:27 +00:00
Kamil Mysliwiec
7d62aad5fc Merge pull request #14146 from nestjs/dependabot/npm_and_yarn/sample/28-sse/multi-c29acd3782
chore(deps): bump cookie and @nestjs/platform-express in /sample/28-sse
2024-11-16 22:16:21 +01:00
Kamil Mysliwiec
ef8f64cf42 Merge pull request #14149 from nestjs/dependabot/npm_and_yarn/sample/32-graphql-federation-schema-first/gateway/cross-spawn-7.0.5
chore(deps): bump cross-spawn from 7.0.3 to 7.0.5 in /sample/32-graphql-federation-schema-first/gateway
2024-11-16 22:16:13 +01:00
Kamil Mysliwiec
afa667509f Merge pull request #12995 from nestjs/renovate/supertest-6.x
chore(deps): update dependency supertest to v6.3.4
2024-11-16 22:15:59 +01:00
renovate[bot]
dc09280634 chore(deps): update dependency supertest to v6.3.4 2024-11-16 20:31:33 +00:00
dependabot[bot]
8115930ec8 chore(deps): bump cookie and @nestjs/platform-express in /sample/28-sse
Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express). These dependencies need to be updated together.


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1)

Updates `@nestjs/platform-express` from 10.4.4 to 10.4.8
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.8/packages/platform-express)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: "@nestjs/platform-express"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-16 20:27:58 +00:00
Kamil Mysliwiec
8fc1c9786a Merge pull request #12815 from nestjs/renovate/node-20.x
chore(deps): update dependency @types/node to v20.17.6
2024-11-16 21:26:57 +01:00
renovate[bot]
2b9f2fd493 chore(deps): update dependency @types/node to v20.17.6 2024-11-16 20:20:53 +00:00
renovate[bot]
2867dff697 fix(deps): update dependency mysql2 to v3.9.8 [security] 2024-11-16 20:18:43 +00:00
dependabot[bot]
ee7eb9d48d chore(deps): bump cross-spawn
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.5.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.5)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-16 20:13:01 +00:00
Kamil Mysliwiec
f38a07719a Merge pull request #14147 from nestjs/chore/upgrade-deps
chore: upgrade deps
2024-11-16 21:11:51 +01:00
Kamil Myśliwiec
af8cd7e4c9 sample: update grpc example 2024-11-16 20:49:36 +01:00
Kamil Myśliwiec
c800b06a22 ci: update node version for eslint workflow 2024-11-16 20:38:48 +01:00
Kamil Myśliwiec
f00192f4f1 chore: regenerate package-lock 2024-11-16 20:32:25 +01:00
Kamil Myśliwiec
b8ddf4fa59 chore: revert markdown-table 2024-11-16 20:29:41 +01:00
Kamil Myśliwiec
a9954025dd style(lint): update eslint rules 2024-11-16 20:26:21 +01:00
Kamil Myśliwiec
0d9b7c85db sample: updateg grpc options type 2024-11-16 20:25:42 +01:00
Kamil Myśliwiec
d9a592d899 chore: update package json 2024-11-16 20:01:52 +01:00
Kamil Myśliwiec
ef24801fcc chore: upgrade deps 2024-11-16 20:00:50 +01:00
Kamil Mysliwiec
bde210677f Merge pull request #14144 from nestjs/dependabot/npm_and_yarn/sample/33-graphql-mercurius/multi-ba981ebd23
chore(deps): bump cookie, light-my-request and @nestjs/platform-fastify in /sample/33-graphql-mercurius
2024-11-15 15:29:41 +01:00
Kamil Myśliwiec
d35006a0d3 chore: update readmes 2024-11-15 14:55:07 +01:00
dependabot[bot]
29a80ba8ab chore(deps): bump cookie, light-my-request and @nestjs/platform-fastify
Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.2 and updates ancestor dependencies [cookie](https://github.com/jshttp/cookie), [light-my-request](https://github.com/fastify/light-my-request) and [@nestjs/platform-fastify](https://github.com/nestjs/nest/tree/HEAD/packages/platform-fastify). These dependencies need to be updated together.


Updates `cookie` from 0.5.0 to 0.7.2
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.5.0...v0.7.2)

Updates `light-my-request` from 5.11.0 to 5.14.0
- [Release notes](https://github.com/fastify/light-my-request/releases)
- [Commits](https://github.com/fastify/light-my-request/compare/v5.11.0...v5.14.0)

Updates `@nestjs/platform-fastify` from 10.3.2 to 10.4.8
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.8/packages/platform-fastify)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: light-my-request
  dependency-type: indirect
- dependency-name: "@nestjs/platform-fastify"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-15 13:53:10 +00:00
Kamil Myśliwiec
3c5180d2d5 chore(@nestjs) publish v10.4.8 release 2024-11-15 14:51:54 +01:00
Kamil Mysliwiec
a7b73e3107 Merge pull request #14143 from nestjs/feat/expose-listening-stream
feat(core): expose listening stream from http adapter host
2024-11-15 14:40:16 +01:00
Kamil Mysliwiec
491ed77f22 Merge pull request #14059 from v-sum/fix-disregarded-rmq-client-options
fix(microservices): include discarded rmq client options
2024-11-15 14:32:46 +01:00
Kamil Myśliwiec
e64ab182ba refactor(core): replace internal init with an inline promise 2024-11-15 14:32:09 +01:00
Kamil Mysliwiec
dade6d5889 Merge pull request #14139 from mksony/chore/ensure-application-init-before-accepting-sigterm
chore(core): defer application shutdown until init finishes
2024-11-15 14:31:03 +01:00
Kamil Mysliwiec
49dc36d9e5 Merge pull request #14132 from nestjs/fix/mqtt-microservices-qos2
fix(microservices): no messages emitted with mqtt when qos set
2024-11-15 14:30:42 +01:00
Kamil Mysliwiec
831d29553d Merge pull request #14133 from nestjs/fix/flaky-durable-provider
fix(core): flaky durable provider, remove instance on error
2024-11-15 14:30:28 +01:00
Kamil Myśliwiec
1a076fc4cb feat(core): expose listening stream from http adapter host 2024-11-15 11:23:16 +01:00
Max Karacsony
5c6986f0c7 chore(core): defer application shutdown until init finishes 2024-11-14 13:50:07 +01:00
Kamil Myśliwiec
229d97f018 fix(core): flaky durable provider, remove instance on error #13953 2024-11-12 13:23:51 +01:00
Kamil Myśliwiec
1fe4dc2cad fix(microservices): no messages emitted with mqtt when qos set #14079 2024-11-12 12:35:25 +01:00
Vasile Sumanschi
9cd43532ae fix(microservices): include discarded rmq client options
all other properties, beside 'connectionOptions', from the socketOptions object ( of type AmqpConnectionManagerSocketOptions )
were being discarded on the creation of the AmqpConnectionManager client
https://github.com/nestjs/nest/blob/master/packages/microservices/external/rmq-url.interface.ts#L47
https://github.com/jwalton/node-amqp-connection-manager/blob/v4.1.14/src/AmqpConnectionManager.ts#L46

https://github.com/nestjs/nest/issues/5788#issuecomment-2373361313
2024-10-09 01:17:27 +03:00
Micael Levi L. Cavalcante
aff30bf63d chore: support skip npm script execution depending on require nodejs 2024-10-02 18:03:17 -04:00
Micael Levi L. Cavalcante
0dafaaa0b9 chore: add sample on how to use esm on cjs 2024-10-01 09:35:05 -04:00
DylanVeldra
6dba4debb9 fix(core): merge req context with tenant payload in the request instance 2024-08-18 17:11:49 +02:00
Martin Vyšňovský
3e061e9b14 feat(06-mongoose): add update method 2024-08-14 13:07:18 +02:00
Martin Vyšňovský
d0b2835293 test(06-mongoose): add missing tests for service 2024-08-14 13:03:15 +02:00
Martin Vyšňovský
2da82286d2 test(06-mongoose): refactor tests for service 2024-08-14 13:01:09 +02:00
Martin Vyšňovský
3c6a295037 test(06-mongoose): add missing tests for controller 2024-08-14 12:51:28 +02:00
Martin Vyšňovský
3117b241c1 test(06-mongoose): refactor tests for controller 2024-08-14 12:51:28 +02:00
Martin Vyšňovský
f0527d08fc chore(deps): update @nestjs/mongoose in 06-mongoose sample 2024-08-14 12:24:23 +02:00
Patrick Acioli
daf0f88366 fix(core): dependencies not resolving for transient lazy providers 2024-07-19 03:01:48 -03:00
Patrick Acioli
91beaf7bc2 fix(core): dependencies not resolving for transient lazy providers 2024-07-19 02:46:52 -03:00
cain
0f00a347a6 test: test for emit-batch 2024-03-12 14:58:19 +09:00
cain
14cffb328a fix: modify access modifier 2023-12-21 15:57:49 +09:00
cain
cb8e04dd62 feat: add block wrapping return 2023-12-21 10:26:48 +09:00
cain
069676fd84 feat: emit batch 2023-12-20 16:59:46 +09:00
pacyL2K19
86826a651a test(sample-12): add e2e tests 2023-11-25 19:10:02 +02:00
pacyL2K19
bb520c073e test(sample-12): add unit tests to increase test coverage 2023-11-25 19:10:02 +02:00
pacyL2K19
992b18e12a test(sample-12): add unit test to the cat-owner resolver field 2023-11-25 19:10:02 +02:00
pacyL2K19
d073083757 test(sample-12): add unit tests to the cats.resolver 2023-11-25 19:10:02 +02:00
pacyL2K19
1a80a9c6cd test(sample-12): setup testing environment - write unit tests for cats.service.ts file 2023-11-25 19:09:59 +02:00
yansb
c032e83e4d test(sample-01): improved tests 2022-12-01 08:23:18 -03:00
yansb
5c9bcc85ef test(sample-01): added controller create cat unit test 2022-11-30 21:50:16 -03:00
yansb
7ec3eb235d test(sample-01): added service unit tests 2022-11-30 21:14:15 -03:00
196 changed files with 26166 additions and 616260 deletions

View File

@@ -121,7 +121,7 @@ jobs:
lint:
working_directory: ~/nest
docker:
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
- image: cimg/node:<< pipeline.parameters.current-node-version >>
steps:
- checkout
- *restore-cache

View File

@@ -6,8 +6,8 @@ cd "$(dirname "$0")"
cd /tmp/
sudo apt-get install build-essential libssl-dev git -y
git clone https://github.com/wg/wrk.git wrk
git clone --depth=1 https://github.com/wg/wrk.git wrk
cd wrk
sudo make
# move the executable to somewhere in your PATH, ex:
sudo cp wrk /usr/local/bin
sudo cp wrk /usr/local/bin

View File

@@ -17,13 +17,13 @@ module.exports = {
sourceType: 'module',
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-array-constructor': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
},
},
{
@@ -34,13 +34,13 @@ module.exports = {
sourceType: 'module',
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
},
}
]

4
.gitignore vendored
View File

@@ -1,4 +1,5 @@
packages/*/package-lock.json
sample/*/package-lock.json
# dependencies
node_modules/
@@ -10,7 +11,7 @@ node_modules/
/.devcontainer
/.classpath
/.project
/.settings
/.settings
*.code-workspace
# Vim
@@ -50,3 +51,4 @@ build/config\.gypi
.npmrc
pnpm-lock.yaml
/.history

View File

@@ -25,7 +25,7 @@ services:
- "9001:9001"
restart: always
mysql:
image: mysql:8.3.0
image: mysql:9.1.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
@@ -50,7 +50,7 @@ services:
zookeeper:
container_name: test-zookeeper
hostname: zookeeper
image: confluentinc/cp-zookeeper:7.5.3
image: confluentinc/cp-zookeeper:7.8.0
ports:
- "2181:2181"
environment:
@@ -59,7 +59,7 @@ services:
kafka:
container_name: test-kafka
hostname: kafka
image: confluentinc/cp-kafka:7.5.3
image: confluentinc/cp-kafka:7.8.0
depends_on:
- zookeeper
ports:

View File

@@ -1,8 +1,8 @@
import { Controller } from '@nestjs/common';
import { MessagePattern, Payload } from '@nestjs/microservices';
import { ExternalSvcService } from './external-svc.service';
import { CreateExternalSvcDto } from './dto/create-external-svc.dto';
import { UpdateExternalSvcDto } from './dto/update-external-svc.dto';
import { ExternalSvcService } from './external-svc.service';
@Controller()
export class ExternalSvcController {

View File

@@ -0,0 +1,32 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { TransientLazyModule } from '../src/transient.module';
import { LazyController } from '../src/lazy.controller';
import * as chai from 'chai';
import { expect } from 'chai';
import * as request from 'supertest';
describe('Lazy Transient providers', () => {
let app: INestApplication;
beforeEach(async () => {
const module = await Test.createTestingModule({
controllers: [LazyController],
}).compile();
app = module.createNestApplication();
await app.init();
});
it('should not recreate dependencies for default scope', async () => {
const resultOne = await request(app.getHttpServer()).get('/lazy/transient');
const resultTwo = await request(app.getHttpServer()).get('/lazy/transient');
expect(resultOne.text).to.be.equal('Hi! Counter is 1');
expect(resultOne.statusCode).to.be.equal(200);
expect(resultTwo.text).to.be.equal('Hi! Counter is 2');
expect(resultTwo.statusCode).to.be.equal(200);
});
});

View File

@@ -3,7 +3,13 @@ import { GlobalService } from './global.module';
@Injectable()
export class EagerService {
private counter = 0;
constructor(public globalService: GlobalService) {}
sayHello() {
this.counter++;
return 'Hi! Counter is ' + this.counter;
}
}
@Module({

View File

@@ -0,0 +1,18 @@
import { Controller, Get } from '@nestjs/common';
import { LazyModuleLoader } from '@nestjs/core';
@Controller('lazy')
export class LazyController {
constructor(private lazyLoadModule: LazyModuleLoader) {}
@Get('transient')
async exec() {
const { TransientLazyModule } = await import('./transient.module');
const moduleRef = await this.lazyLoadModule.load(() => TransientLazyModule);
const { TransientService } = await import('./transient.service');
const _service = await moduleRef.resolve(TransientService);
return _service.eager();
}
}

View File

@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { GlobalService } from './global.module';
import { EagerService } from './eager.module';
import { TransientService } from './transient.service';
@Module({
imports: [],
providers: [TransientService, GlobalService, EagerService],
exports: [TransientService],
})
export class TransientLazyModule {}

View File

@@ -0,0 +1,11 @@
import { Injectable, Scope } from '@nestjs/common';
import { EagerService } from './eager.module';
@Injectable({ scope: Scope.TRANSIENT })
export class TransientService {
constructor(private eagerService: EagerService) {}
eager() {
return this.eagerService.sayHello();
}
}

View File

@@ -24,8 +24,9 @@ export class DisconnectedClientController {
return throwError(() =>
code === 'ECONNREFUSED' ||
code === 'CONN_ERR' ||
code === 'ENOTFOUND' ||
code === 'CONNECTION_REFUSED' ||
error.message === 'Connection is closed.'
error.message.includes('Connection is closed.')
? new RequestTimeoutException('ECONNREFUSED')
: new InternalServerErrorException(),
);

View File

@@ -27,10 +27,14 @@ describe('Durable providers', () => {
tenantId: number,
end: (err?: any) => void,
endpoint = '/durable',
opts: {
forceError: boolean;
} = { forceError: false },
) =>
request(server)
.get(endpoint)
.set({ ['x-tenant-id']: tenantId })
.set({ ['x-tenant-id']: String(tenantId) })
.set({ ['x-force-error']: opts.forceError ? 'true' : 'false' })
.end((err, res) => {
if (err) return end(err);
end(res);
@@ -84,6 +88,42 @@ describe('Durable providers', () => {
);
expect(result.body).deep.equal({ tenantId: '3' });
});
it(`should return the same tenantId both from durable request scoped service and non-durable request scoped service`, async () => {
let result: request.Response;
result = await new Promise<request.Response>(resolve =>
performHttpCall(1, resolve, '/durable/request-context'),
);
expect(result.body).deep.equal({
durableService: '1',
nonDurableService: '1',
});
result = await new Promise<request.Response>(resolve =>
performHttpCall(2, resolve, '/durable/request-context'),
);
expect(result.body).deep.equal({
durableService: '2',
nonDurableService: '2',
});
});
it(`should not cache durable providers that throw errors`, async () => {
let result: request.Response;
result = await new Promise<request.Response>(resolve =>
performHttpCall(10, resolve, '/durable/echo', { forceError: true }),
);
expect(result.statusCode).equal(412);
// The second request should be successful
result = await new Promise<request.Response>(resolve =>
performHttpCall(10, resolve, '/durable/echo'),
);
expect(result.body).deep.equal({ tenantId: '10' });
});
});
after(async () => {

View File

@@ -1,11 +1,18 @@
import { ContextId, ContextIdStrategy, HostComponentInfo } from '@nestjs/core';
import { Request } from 'express';
export type TenantContext = {
tenantId: string;
forceError?: boolean;
};
const tenants = new Map<string, ContextId>();
export class DurableContextIdStrategy implements ContextIdStrategy {
attach(contextId: ContextId, request: Request) {
const tenantId = request.headers['x-tenant-id'] as string;
const forceError = request.headers['x-force-error'] === 'true';
let tenantSubTreeId: ContextId;
if (tenants.has(tenantId)) {
@@ -14,10 +21,15 @@ export class DurableContextIdStrategy implements ContextIdStrategy {
tenantSubTreeId = { id: +tenantId } as ContextId;
tenants.set(tenantId, tenantSubTreeId);
}
const payload: TenantContext = { tenantId };
if (forceError) {
payload.forceError = true;
}
return {
resolve: (info: HostComponentInfo) =>
info.isTreeDurable ? tenantSubTreeId : contextId,
payload: { tenantId },
payload,
};
}
}

View File

@@ -1,9 +1,13 @@
import { Controller, Get } from '@nestjs/common';
import { DurableService } from './durable.service';
import { NonDurableService } from './non-durable.service';
@Controller('durable')
export class DurableController {
constructor(private readonly durableService: DurableService) {}
constructor(
private readonly durableService: DurableService,
private readonly nonDurableService: NonDurableService,
) {}
@Get()
greeting(): string {
@@ -12,6 +16,16 @@ export class DurableController {
@Get('echo')
echo() {
return this.durableService.requestPayload;
return {
tenantId: this.durableService.getTenantId(),
};
}
@Get('request-context')
getRequestContext() {
return {
durableService: this.durableService.getTenantId(),
nonDurableService: this.nonDurableService.getTenantId(),
};
}
}

View File

@@ -3,11 +3,13 @@ import { APP_GUARD } from '@nestjs/core';
import { DurableController } from './durable.controller';
import { DurableGuard } from './durable.guard';
import { DurableService } from './durable.service';
import { NonDurableService } from './non-durable.service';
@Module({
controllers: [DurableController],
providers: [
DurableService,
NonDurableService,
{
provide: APP_GUARD,
useClass: DurableGuard,

View File

@@ -1,14 +1,30 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
import {
Inject,
Injectable,
PreconditionFailedException,
Scope,
} from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { TenantContext } from './durable-context-id.strategy';
@Injectable({ scope: Scope.REQUEST, durable: true })
export class DurableService {
public instanceCounter = 0;
constructor(@Inject(REQUEST) public readonly requestPayload: unknown) {}
constructor(
@Inject(REQUEST) private readonly requestPayload: TenantContext,
) {
if (requestPayload.forceError) {
throw new PreconditionFailedException('Forced error');
}
}
greeting() {
++this.instanceCounter;
return `Hello world! Counter: ${this.instanceCounter}`;
}
getTenantId() {
return this.requestPayload.tenantId;
}
}

View File

@@ -0,0 +1,14 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { TenantContext } from './durable-context-id.strategy';
@Injectable()
export class NonDurableService {
constructor(
@Inject(REQUEST) private readonly requestPayload: TenantContext,
) {}
getTenantId() {
return this.requestPayload.tenantId;
}
}

View File

@@ -1,7 +1,9 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as EventSource from 'eventsource';
import { io } from 'socket.io-client';
import { AppController as LongConnectionController } from '../../nest-application/sse/src/app.controller';
import { ApplicationGateway } from '../src/app.gateway';
import { NamespaceGateway } from '../src/namespace.gateway';
import { ServerGateway } from '../src/server.gateway';
@@ -15,7 +17,7 @@ async function createNestApp(...gateways): Promise<INestApplication> {
}
describe('WebSocketGateway', () => {
let ws, app;
let ws: ReturnType<typeof io>, app: INestApplication;
it(`should handle message (2nd port)`, async () => {
app = await createNestApp(ApplicationGateway);
@@ -98,5 +100,78 @@ describe('WebSocketGateway', () => {
);
});
describe('shared server for WS and Long-Running connections', () => {
afterEach(() => {});
it('should block application shutdown', function (done) {
let eventSource;
(async () => {
this.timeout(30000);
setTimeout(() => {
const instance = testingModule.get(ServerGateway);
expect(instance.onApplicationShutdown.called).to.be.false;
eventSource.close();
done();
}, 25000);
const testingModule = await Test.createTestingModule({
providers: [ServerGateway],
controllers: [LongConnectionController],
}).compile();
app = testingModule.createNestApplication();
await app.listen(3000);
ws = io(`http://localhost:3000`);
eventSource = new EventSource(`http://localhost:3000/sse`);
await new Promise<void>((resolve, reject) => {
ws.on('connect', resolve);
ws.on('error', reject);
});
await new Promise((resolve, reject) => {
eventSource.onmessage = resolve;
eventSource.onerror = reject;
});
app.close();
})();
});
it('should shutdown application immediately when forceCloseConnections is true', async () => {
const testingModule = await Test.createTestingModule({
providers: [ServerGateway],
controllers: [LongConnectionController],
}).compile();
app = testingModule.createNestApplication({
forceCloseConnections: true,
});
await app.listen(3000);
ws = io(`http://localhost:3000`);
const eventSource = new EventSource(`http://localhost:3000/sse`);
await new Promise<void>((resolve, reject) => {
ws.on('connect', resolve);
ws.on('error', reject);
});
await new Promise((resolve, reject) => {
eventSource.onmessage = resolve;
eventSource.onerror = reject;
});
await app.close();
const instance = testingModule.get(ServerGateway);
expect(instance.onApplicationShutdown.called).to.be.true;
eventSource.close();
});
});
afterEach(() => app.close());
});

View File

@@ -1,9 +1,10 @@
import { UseInterceptors } from '@nestjs/common';
import { OnApplicationShutdown, UseInterceptors } from '@nestjs/common';
import { SubscribeMessage, WebSocketGateway } from '@nestjs/websockets';
import * as Sinon from 'sinon';
import { RequestInterceptor } from './request.interceptor';
@WebSocketGateway()
export class ServerGateway {
export class ServerGateway implements OnApplicationShutdown {
@SubscribeMessage('push')
onPush(client, data) {
return {
@@ -20,4 +21,6 @@ export class ServerGateway {
data: { ...data, path: client.pattern },
};
}
onApplicationShutdown = Sinon.spy();
}

View File

@@ -1,7 +1,5 @@
{
"lerna": "2.4.0",
"packages": [
"packages/*"
],
"version": "10.4.7"
"packages": ["packages/*"],
"version": "10.4.21",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}

39849
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -41,12 +41,13 @@
"lint:packages": "eslint 'packages/**/**.ts' --ignore-pattern 'packages/**/*.spec.ts'",
"lint:spec": "eslint 'packages/**/**.spec.ts'",
"prerelease": "gulp copy-misc",
"publish": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --access public --exact -m \"chore(@nestjs) publish %s release\"",
"publish": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --exact -m \"chore(release): publish %s release\"",
"prepublishOnly": "npm run changelog | pbcopy",
"publish:beta": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=beta --access public -m \"chore(@nestjs) publish %s release\"",
"publish:next": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=next --access public --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:rc": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=rc --access public -m \"chore(@nestjs) publish %s release\"",
"publish:test": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --access public --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:legacy": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=legacy --force-publish -m \"chore(release): publish %s release\"",
"publish:beta": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(release): publish %s release\"",
"publish:next": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(release): publish %s release\"",
"publish:rc": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(release): publish %s release\"",
"publish:test": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --npm-tag=test --skip-git -m \"chore(release): publish %s release\"",
"prepare": "husky"
},
"lint-staged": {
@@ -59,59 +60,59 @@
},
"dependencies": {
"@nuxtjs/opencollective": "0.3.2",
"ansis": "3.3.2",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"cli-color": "2.0.4",
"cors": "2.8.5",
"express": "4.21.1",
"express": "4.22.1",
"fast-json-stringify": "6.0.0",
"fast-safe-stringify": "2.1.1",
"graphql-subscriptions": "2.0.0",
"file-type": "20.4.1",
"iterare": "1.2.1",
"object-hash": "3.0.0",
"path-to-regexp": "3.2.0",
"path-to-regexp": "3.3.0",
"reflect-metadata": "0.2.2",
"rxjs": "7.8.1",
"socket.io": "4.8.0",
"tslib": "2.7.0",
"socket.io": "4.8.1",
"tslib": "2.8.1",
"uid": "2.0.2",
"uuid": "10.0.0"
"uuid": "11.1.0"
},
"devDependencies": {
"@apollo/server": "4.11.0",
"@apollo/server": "4.11.2",
"@codechecks/client": "0.1.12",
"@commitlint/cli": "19.5.0",
"@commitlint/config-angular": "19.5.0",
"@commitlint/cli": "19.6.0",
"@commitlint/config-angular": "19.6.0",
"@fastify/cors": "9.0.1",
"@fastify/formbody": "7.4.0",
"@fastify/middie": "8.3.1",
"@fastify/middie": "8.3.3",
"@fastify/multipart": "8.3.0",
"@fastify/static": "7.0.4",
"@fastify/view": "9.1.0",
"@grpc/grpc-js": "1.11.1",
"@grpc/grpc-js": "1.12.4",
"@grpc/proto-loader": "0.7.13",
"@nestjs/apollo": "12.2.0",
"@nestjs/graphql": "12.2.0",
"@nestjs/mongoose": "10.0.10",
"@nestjs/apollo": "12.2.2",
"@nestjs/graphql": "12.2.2",
"@nestjs/mongoose": "10.1.0",
"@nestjs/typeorm": "10.0.2",
"@types/amqplib": "0.10.5",
"@types/bytes": "3.1.4",
"@types/chai": "4.3.16",
"@types/amqplib": "0.10.6",
"@types/bytes": "3.1.5",
"@types/chai": "4.3.20",
"@types/chai-as-promised": "7.1.8",
"@types/cors": "2.8.17",
"@types/express": "4.17.21",
"@types/gulp": "4.0.17",
"@types/http-errors": "2.0.4",
"@types/mocha": "10.0.8",
"@types/node": "22.5.5",
"@types/mocha": "10.0.10",
"@types/node": "22.10.0",
"@types/sinon": "17.0.3",
"@types/supertest": "2.0.16",
"@types/ws": "8.5.12",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@types/supertest": "6.0.2",
"@types/ws": "8.5.13",
"@typescript-eslint/eslint-plugin": "8.17.0",
"@typescript-eslint/parser": "8.17.0",
"amqp-connection-manager": "4.1.14",
"amqplib": "0.10.4",
"artillery": "2.0.20",
"amqplib": "0.10.5",
"artillery": "2.0.21",
"body-parser": "1.20.3",
"bytes": "3.1.2",
"cache-manager": "5.7.6",
@@ -119,57 +120,58 @@
"chai": "4.5.0",
"chai-as-promised": "7.1.2",
"clang-format": "1.8.0",
"concurrently": "9.0.1",
"concurrently": "9.1.0",
"conventional-changelog": "6.0.0",
"core-js": "3.38.1",
"core-js": "3.39.0",
"coveralls": "3.1.1",
"delete-empty": "3.0.0",
"engine.io-client": "6.6.1",
"engine.io-client": "6.6.2",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"eventsource": "2.0.2",
"fancy-log": "2.0.0",
"fastify": "4.28.1",
"graphql": "16.9.0",
"graphql-tools": "9.0.1",
"gulp": "4.0.2",
"graphql-subscriptions": "2.0.0",
"graphql-tools": "9.0.5",
"gulp": "5.0.0",
"gulp-clang-format": "1.0.27",
"gulp-clean": "0.4.0",
"gulp-sourcemaps": "3.0.0",
"gulp-typescript": "5.0.1",
"gulp-watch": "5.0.1",
"http-errors": "2.0.0",
"husky": "9.1.5",
"husky": "9.1.7",
"imports-loader": "5.0.0",
"ioredis": "5.4.1",
"json-loader": "0.5.7",
"kafkajs": "2.2.4",
"lerna": "2.11.0",
"lerna": "9.0.3",
"lerna-changelog": "2.2.0",
"light-my-request": "6.1.0",
"light-my-request": "6.3.0",
"lint-staged": "15.2.10",
"markdown-table": "2.0.0",
"mocha": "10.7.3",
"mongoose": "8.6.2",
"mqtt": "5.6.0",
"mocha": "10.8.2",
"mongoose": "8.8.4",
"mqtt": "5.10.3",
"multer": "1.4.4",
"mysql2": "3.11.3",
"mysql2": "3.11.4",
"nats": "2.28.2",
"nodemon": "3.1.5",
"nyc": "14.1.1",
"prettier": "3.3.3",
"nodemon": "3.1.7",
"nyc": "17.1.0",
"prettier": "3.4.2",
"redis": "4.7.0",
"rxjs-compat": "6.6.7",
"sinon": "19.0.2",
"sinon-chai": "3.7.0",
"socket.io-client": "4.8.0",
"sinon-chai": "4.0.0",
"socket.io-client": "4.8.1",
"subscriptions-transport-ws": "0.11.0",
"supertest": "7.0.0",
"ts-morph": "23.0.0",
"ts-morph": "24.0.0",
"ts-node": "10.9.2",
"typeorm": "0.3.20",
"typescript": "5.6.2",
"typescript": "5.6.3",
"wrk": "1.2.1",
"ws": "8.18.0"
},

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -524,6 +524,32 @@ export function Body(
*/
export function RawBody(): ParameterDecorator;
/**
* Route handler parameter decorator. Extracts the `rawBody` Buffer
* property from the `req` object and populates the decorated parameter with that value.
* Also applies pipes to the bound rawBody parameter.
*
* For example:
* ```typescript
* async create(@RawBody(new ValidationPipe()) rawBody: Buffer)
* ```
*
* @param pipes one or more pipes - either instances or classes - to apply to
* the bound body parameter.
*
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
* @see [Raw body](https://docs.nestjs.com/faq/raw-body)
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
*
* @publicApi
*/
export function RawBody(
...pipes: (
| Type<PipeTransform<Buffer | undefined>>
| PipeTransform<Buffer | undefined>
)[]
): ParameterDecorator;
/**
* Route handler parameter decorator. Extracts the `rawBody` Buffer
* property from the `req` object and populates the decorated parameter with that value.

View File

@@ -1,3 +1,4 @@
import { isUndefined } from '../../utils/shared.utils';
import {
InjectionToken,
Provider,
@@ -6,15 +7,17 @@ import {
} from '../../interfaces';
/**
* check if x is OptionalFactoryDependency, based on prototype presence
* (to avoid classes with a static 'token' field)
* @param x
* @returns x is OptionalFactoryDependency
* @param value
* @returns `true` if value is `OptionalFactoryDependency`
*/
function isOptionalFactoryDependency(
x: InjectionToken | OptionalFactoryDependency,
): x is OptionalFactoryDependency {
return !!((x as any)?.token && !(x as any)?.prototype);
value: InjectionToken | OptionalFactoryDependency,
): value is OptionalFactoryDependency {
return (
!isUndefined((value as OptionalFactoryDependency).token) &&
!isUndefined((value as OptionalFactoryDependency).optional) &&
!(value as any).prototype
);
}
const mapInjectToTokens = (t: InjectionToken | OptionalFactoryDependency) =>

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/common",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
"author": "Kamil Mysliwiec",
"homepage": "https://nestjs.com",
@@ -18,8 +18,9 @@
},
"license": "MIT",
"dependencies": {
"file-type": "20.4.1",
"iterare": "1.2.1",
"tslib": "2.7.0",
"tslib": "2.8.1",
"uid": "2.0.2"
},
"peerDependencies": {

View File

@@ -3,14 +3,19 @@ import { IFile } from './interfaces';
export type FileTypeValidatorOptions = {
fileType: string | RegExp;
/**
* If `true`, the validator will skip the magic numbers validation.
* This can be useful when you can't identify some files as there are no common magic numbers available for some file types.
* @default false
*/
skipMagicNumbersValidation?: boolean;
};
/**
* Defines the built-in FileType File Validator. It validates incoming files mime-type
* matching a string or a regular expression. Note that this validator uses a naive strategy
* to check the mime-type and could be fooled if the client provided a file with renamed extension.
* (for instance, renaming a 'malicious.bat' to 'malicious.jpeg'). To handle such security issues
* with more reliability, consider checking against the file's [magic-numbers](https://en.wikipedia.org/wiki/Magic_number_%28programming%29)
* Defines the built-in FileTypeValidator. It validates incoming files by examining
* their magic numbers using the file-type package, providing more reliable file type validation
* than just checking the mimetype string.
*
* @see [File Validators](https://docs.nestjs.com/techniques/file-upload#validators)
*
@@ -20,19 +25,42 @@ export class FileTypeValidator extends FileValidator<
FileTypeValidatorOptions,
IFile
> {
buildErrorMessage(): string {
buildErrorMessage(file?: IFile): string {
if (file?.mimetype) {
return `Validation failed (current file type is ${file.mimetype}, expected type is ${this.validationOptions.fileType})`;
}
return `Validation failed (expected type is ${this.validationOptions.fileType})`;
}
isValid(file?: IFile): boolean {
async isValid(file?: IFile): Promise<boolean> {
if (!this.validationOptions) {
return true;
}
return (
!!file &&
'mimetype' in file &&
!!file.mimetype.match(this.validationOptions.fileType)
);
const isFileValid = !!file && 'mimetype' in file;
if (this.validationOptions.skipMagicNumbersValidation) {
return (
isFileValid && !!file.mimetype.match(this.validationOptions.fileType)
);
}
if (!isFileValid || !file.buffer) {
return false;
}
try {
const { fileTypeFromBuffer } = (await eval(
'import ("file-type")',
)) as typeof import('file-type');
const fileType = await fileTypeFromBuffer(file.buffer);
return (
!!fileType && !!fileType.mime.match(this.validationOptions.fileType)
);
} catch {
return false;
}
}
}

View File

@@ -1,4 +1,5 @@
export interface IFile {
mimetype: string;
size: number;
buffer?: Buffer;
}

View File

@@ -116,11 +116,12 @@ export class ValidationPipe implements PipeTransform<any> {
: value;
}
const originalValue = value;
value = this.toEmptyIfNil(value);
value = this.toEmptyIfNil(value, metatype);
const isNil = value !== originalValue;
const isPrimitive = this.isPrimitive(value);
this.stripProtoKeys(value);
let entity = classTransformer.plainToClass(
metatype,
value,
@@ -205,11 +206,30 @@ export class ValidationPipe implements PipeTransform<any> {
if (metatype === Number) {
return +value;
}
if (metatype === String && !isUndefined(value)) {
return String(value);
}
return value;
}
protected toEmptyIfNil<T = any, R = any>(value: T): R | {} {
return isNil(value) ? {} : value;
protected toEmptyIfNil<T = any, R = any>(
value: T,
metatype: Type<unknown> | object,
): R | {} {
if (!isNil(value)) {
return value;
}
if (
typeof metatype === 'function' ||
(metatype && 'prototype' in metatype && metatype.prototype?.constructor)
) {
return {};
}
// Builder like SWC require empty string to be returned instead of an empty object
// when the value is nil and the metatype is not a class instance, but a plain object (enum, for example).
// Otherwise, the error will be thrown.
// @see https://github.com/nestjs/nest/issues/12680
return '';
}
protected stripProtoKeys(value: any) {

View File

@@ -5,19 +5,30 @@ import { getInjectionProviders } from '../../../module-utils/utils/get-injection
describe('getInjectionProviders', () => {
it('should take only required providers', () => {
class C {
static token = 'a';
static token = 'anything';
}
const p: Provider[] = [
class G {
static token = 'anything';
static optional = true;
}
class H {
static token = 'anything';
static optional = false;
}
const providers: Provider[] = [
{
//0
provide: 'a',
useValue: 'a',
},
{
//1
provide: 'b',
useValue: 'b',
},
C,
C, //2
{
//3
provide: 'd',
useFactory: (c, b) => [c, b],
inject: [
@@ -27,23 +38,36 @@ describe('getInjectionProviders', () => {
optional: true,
},
'x',
G,
H,
],
},
{
//4
provide: 'e',
useFactory: (d, b) => [d, b],
inject: ['d', 'b'],
},
{
//5
provide: 'f',
useValue: 'f',
},
G, //6
H, //7
];
// should not include 'a' and 'f'
const expected = p.slice(1, -1);
const result = getInjectionProviders(p, ['e']);
expect(result).to.have.length(expected.length);
const expected = [
providers[1],
providers[2],
providers[3],
providers[4],
providers[6],
providers[7],
];
const result = getInjectionProviders(providers, ['e']);
expect(result).to.have.members(expected);
expect(result).not.to.have.members([p[0], p[5]]);
});
});

View File

@@ -1,89 +1,195 @@
import { expect } from 'chai';
import { IFile } from '../../../../common/pipes/file/interfaces';
import { FileTypeValidator } from '../../../pipes';
describe('FileTypeValidator', () => {
describe('isValid', () => {
it('should return true when the file mimetype is the same as the specified', () => {
it('should return true when the file buffer matches the specified type', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
});
const jpegBuffer = Buffer.from([
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46,
]);
const requestFile = {
mimetype: 'image/jpeg',
} as any;
buffer: jpegBuffer,
} as IFile;
expect(fileTypeValidator.isValid(requestFile)).to.equal(true);
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should return true when the file mimetype ends with the specified option type', () => {
it('should return true when the file buffer matches the specified file extension', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'jpeg',
});
const jpegBuffer = Buffer.from([
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46,
]);
const requestFile = {
mimetype: 'image/jpeg',
} as any;
expect(fileTypeValidator.isValid(requestFile)).to.equal(true);
buffer: jpegBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should return true when the file mimetype matches the specified regexp', () => {
it('should return true when the file buffer matches the specified regexp', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /word/,
fileType: /^image\//,
});
const jpegBuffer = Buffer.from([
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46,
]);
const requestFile = {
mimetype: 'application/msword',
} as any;
mimetype: 'image/jpeg',
buffer: jpegBuffer,
} as IFile;
expect(fileTypeValidator.isValid(requestFile)).to.equal(true);
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should return false when the file mimetype is different from the specified', () => {
it('should return false when the file buffer does not match the specified type', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
});
const pngBuffer = Buffer.from([
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
]);
const requestFile = {
mimetype: 'image/jpeg', // Spoofed mimetype
buffer: pngBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
it('should return false when the file buffer does not match the specified file extension', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'jpeg',
});
const pngBuffer = Buffer.from([
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
]);
const requestFile = {
mimetype: 'image/png',
} as any;
buffer: pngBuffer,
} as IFile;
expect(fileTypeValidator.isValid(requestFile)).to.equal(false);
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
it('should return false when the file mimetype does not match the provided regexp', () => {
it('should return false when no buffer is provided', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /mp4/,
fileType: 'image/jpeg',
});
const requestFile = {
mimetype: 'image/png',
} as any;
mimetype: 'image/jpeg',
} as IFile;
expect(fileTypeValidator.isValid(requestFile)).to.equal(false);
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
it('should return false when the file mimetype was not provided', () => {
it('should return false when no file is provided', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
});
const requestFile = {} as any;
expect(fileTypeValidator.isValid(requestFile)).to.equal(false);
expect(await fileTypeValidator.isValid()).to.equal(false);
});
it('should return false when no file provided', () => {
it('should return false when no buffer is provided', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
});
expect(fileTypeValidator.isValid()).to.equal(false);
const requestFile = {
mimetype: 'image/jpeg',
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
it('should return true when the file buffer matches the specified regexp', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /^image\//,
});
const jpegBuffer = Buffer.from([
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46,
]);
const requestFile = {
mimetype: 'image/jpeg',
buffer: jpegBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should return true when no validation options are provided', async () => {
const fileTypeValidator = new FileTypeValidator({} as any);
const jpegBuffer = Buffer.from([
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46,
]);
const requestFile = {
mimetype: 'image/jpeg',
buffer: jpegBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should skip magic numbers validation when the skipMagicNumbersValidation is true', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
skipMagicNumbersValidation: true,
});
const requestFile = {
mimetype: 'image/jpeg',
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(true);
});
it('should return false when the file buffer does not match any known type', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'unknown/type',
});
const unknownBuffer = Buffer.from([
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
]);
const requestFile = {
mimetype: 'unknown/type',
buffer: unknownBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
it('should return false when the buffer is empty', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'image/jpeg',
});
const emptyBuffer = Buffer.from([]);
const requestFile = {
mimetype: 'image/jpeg',
buffer: emptyBuffer,
} as IFile;
expect(await fileTypeValidator.isValid(requestFile)).to.equal(false);
});
});
describe('buildErrorMessage', () => {
it('should return a string with the format "Validation failed (expected type is #fileType)"', () => {
it('should return a string with the format "Validation failed (expected type is #fileType)"', async () => {
const fileType = 'image/jpeg';
const fileTypeValidator = new FileTypeValidator({
fileType,
@@ -93,5 +199,85 @@ describe('FileTypeValidator', () => {
`Validation failed (expected type is ${fileType})`,
);
});
it('should include the file type in the error message when a file is provided', async () => {
const currentFileType = 'image/png';
const fileType = 'image/jpeg';
const fileTypeValidator = new FileTypeValidator({
fileType,
});
const file = { mimetype: currentFileType } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
`Validation failed (current file type is ${currentFileType}, expected type is ${fileType})`,
);
});
it('should handle regexp file type in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /^image\//,
});
const file = { mimetype: 'application/pdf' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
`Validation failed (current file type is application/pdf, expected type is /^image\\//)`,
);
});
it('should handle file extension in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'jpeg',
});
const file = { mimetype: 'image/png' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
'Validation failed (current file type is image/png, expected type is jpeg)',
);
});
it('should handle regexp file type in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /^image\//,
});
const file = { mimetype: 'application/pdf' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
`Validation failed (current file type is application/pdf, expected type is /^image\\//)`,
);
});
it('should handle file extension in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'jpeg',
});
const file = { mimetype: 'image/png' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
'Validation failed (current file type is image/png, expected type is jpeg)',
);
});
it('should handle regexp file type in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: /^image\//,
});
const file = { mimetype: 'application/pdf' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
`Validation failed (current file type is application/pdf, expected type is /^image\\//)`,
);
});
it('should handle file extension in error message', async () => {
const fileTypeValidator = new FileTypeValidator({
fileType: 'jpeg',
});
const file = { mimetype: 'image/png' } as IFile;
expect(fileTypeValidator.buildErrorMessage(file)).to.equal(
'Validation failed (current file type is image/png, expected type is jpeg)',
);
});
});
});

View File

@@ -1,9 +1,9 @@
import { expect } from 'chai';
import {
FileTypeValidator,
FileValidator,
MaxFileSizeValidator,
ParseFilePipeBuilder,
FileTypeValidator,
} from '../../../pipes';
describe('ParseFilePipeBuilder', () => {

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,3 +1,4 @@
import { Observable, Subject } from 'rxjs';
import { AbstractHttpAdapter } from '../adapters/http-adapter';
/**
@@ -16,6 +17,8 @@ export class HttpAdapterHost<
T extends AbstractHttpAdapter = AbstractHttpAdapter,
> {
private _httpAdapter?: T;
private _listen$ = new Subject<void>();
private isListening = false;
/**
* Accessor for the underlying `HttpAdapter`
@@ -35,4 +38,31 @@ export class HttpAdapterHost<
get httpAdapter(): T {
return this._httpAdapter;
}
/**
* Observable that allows to subscribe to the `listen` event.
* This event is emitted when the HTTP application is listening for incoming requests.
*/
get listen$(): Observable<void> {
return this._listen$.asObservable();
}
/**
* Sets the listening state of the application.
*/
set listening(listening: boolean) {
this.isListening = listening;
if (listening) {
this._listen$.next();
this._listen$.complete();
}
}
/**
* Returns a boolean indicating whether the application is listening for incoming requests.
*/
get listening(): boolean {
return this.isListening;
}
}

View File

@@ -170,6 +170,11 @@ export class Injector {
inquirer,
);
} catch (err) {
wrapper.removeInstanceByContextId(
this.getContextId(contextId, wrapper),
inquirerId,
);
settlementSignal.error(err);
throw err;
}
@@ -338,11 +343,20 @@ export class Injector {
wrapper: InstanceWrapper<T>,
): [InjectorDependency[], number[]] {
const optionalDependenciesIds = [];
const isOptionalFactoryDep = (
item: InjectionToken | OptionalFactoryDependency,
): item is OptionalFactoryDependency =>
!isUndefined((item as OptionalFactoryDependency).token) &&
!isUndefined((item as OptionalFactoryDependency).optional);
/**
* Same as the internal utility function `isOptionalFactoryDependency` from `@nestjs/common`.
* We are duplicating it here because that one is not supposed to be exported.
*/
function isOptionalFactoryDependency(
value: InjectionToken | OptionalFactoryDependency,
): value is OptionalFactoryDependency {
return (
!isUndefined((value as OptionalFactoryDependency).token) &&
!isUndefined((value as OptionalFactoryDependency).optional) &&
!(value as any).prototype
);
}
const mapFactoryProviderInjectArray = (
item: InjectionToken | OptionalFactoryDependency,
@@ -351,7 +365,7 @@ export class Injector {
if (typeof item !== 'object') {
return item;
}
if (isOptionalFactoryDep(item)) {
if (isOptionalFactoryDependency(item)) {
if (item.optional) {
optionalDependenciesIds.push(index);
}

View File

@@ -168,6 +168,21 @@ export class InstanceWrapper<T = any> {
collection.set(contextId, value);
}
public removeInstanceByContextId(contextId: ContextId, inquirerId?: string) {
if (this.scope === Scope.TRANSIENT && inquirerId) {
return this.removeInstanceByInquirerId(contextId, inquirerId);
}
this.values.delete(contextId);
}
public removeInstanceByInquirerId(contextId: ContextId, inquirerId: string) {
const collection = this.transientMap.get(inquirerId);
if (!collection) {
return;
}
collection.delete(contextId);
}
public addCtorMetadata(index: number, wrapper: InstanceWrapper) {
if (!this[INSTANCE_METADATA_SYMBOL].dependencies) {
this[INSTANCE_METADATA_SYMBOL].dependencies = [];

View File

@@ -12,6 +12,7 @@ import {
InjectionToken,
NestModule,
Provider,
Scope,
Type,
ValueProvider,
} from '@nestjs/common/interfaces';
@@ -253,6 +254,11 @@ export class Module {
return this.addCustomProvider(provider, this._providers, enhancerSubtype);
}
const isAlreadyDeclared = this._providers.has(provider);
if (this.isTransientProvider(provider) && isAlreadyDeclared) {
return provider;
}
this._providers.set(
provider,
new InstanceWrapper({
@@ -656,4 +662,8 @@ export class Module {
const key = this.name?.toString() ?? this.token?.toString();
return key ? UuidFactory.get(`${prefix}_${key}`) : randomStringGenerator();
}
private isTransientProvider(provider: Type<any>): boolean {
return getClassScope(provider) === Scope.TRANSIENT;
}
}

View File

@@ -346,7 +346,9 @@ export class MiddlewareModule<
configurable: false,
});
const requestProviderValue = isTreeDurable ? contextId.payload : request;
const requestProviderValue = isTreeDurable
? contextId.payload
: Object.assign(request, contextId.payload);
this.container.registerRequestProvider(requestProviderValue, contextId);
}
return contextId;

View File

@@ -54,6 +54,7 @@ export class NestApplicationContext<
private shutdownCleanupRef?: (...args: unknown[]) => unknown;
private _instanceLinksHost: InstanceLinksHost;
private _moduleRefsForHooksByDistance?: Array<Module>;
private initializationPromise?: Promise<void>;
protected get instanceLinksHost() {
if (!this._instanceLinksHost) {
@@ -234,8 +235,16 @@ export class NestApplicationContext<
if (this.isInitialized) {
return this;
}
await this.callInitHook();
await this.callBootstrapHook();
this.initializationPromise = new Promise(async (resolve, reject) => {
try {
await this.callInitHook();
await this.callBootstrapHook();
resolve();
} catch (err) {
reject(err);
}
});
await this.initializationPromise;
this.isInitialized = true;
return this;
@@ -246,6 +255,7 @@ export class NestApplicationContext<
* @returns {Promise<void>}
*/
public async close(signal?: string): Promise<void> {
await this.initializationPromise;
await this.callDestroyHook();
await this.callBeforeShutdownHook(signal);
await this.dispose();
@@ -333,6 +343,7 @@ export class NestApplicationContext<
return;
}
receivedSignal = true;
await this.initializationPromise;
await this.callDestroyHook();
await this.callBeforeShutdownHook(signal);
await this.dispose();

View File

@@ -294,8 +294,12 @@ export class NestApplication
public async listen(port: number | string, hostname: string): Promise<any>;
public async listen(port: number | string, ...args: any[]): Promise<any> {
this.assertNotInPreviewMode('listen');
!this.isInitialized && (await this.init());
if (!this.isInitialized) {
await this.init();
}
const httpAdapterHost = this.container.getHttpAdapterHostRef();
return new Promise((resolve, reject) => {
const errorHandler = (e: any) => {
this.logger.error(e?.toString?.());
@@ -323,6 +327,8 @@ export class NestApplication
if (address) {
this.httpServer.removeListener('error', errorHandler);
this.isListening = true;
httpAdapterHost.listening = true;
resolve(this.httpServer);
}
if (isCallbackInOriginalArgs) {

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/core",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -32,11 +32,11 @@
"fast-safe-stringify": "2.1.1",
"iterare": "1.2.1",
"path-to-regexp": "3.3.0",
"tslib": "2.7.0",
"tslib": "2.8.1",
"uid": "2.0.2"
},
"devDependencies": {
"@nestjs/common": "10.4.7"
"@nestjs/common": "^10.4.21"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",

View File

@@ -418,7 +418,9 @@ export class RouterExplorer {
configurable: false,
});
const requestProviderValue = isTreeDurable ? contextId.payload : request;
const requestProviderValue = isTreeDurable
? contextId.payload
: Object.assign(request, contextId.payload);
this.container.registerRequestProvider(requestProviderValue, contextId);
}
return contextId;

View File

@@ -2,11 +2,27 @@ import { expect } from 'chai';
import { HttpAdapterHost } from '../../helpers/http-adapter-host';
describe('HttpAdapterHost', () => {
const applicationRefHost = new HttpAdapterHost();
let applicationRefHost: HttpAdapterHost;
beforeEach(() => {
applicationRefHost = new HttpAdapterHost();
});
it('should wrap application reference', () => {
const ref = {};
applicationRefHost.httpAdapter = ref as any;
expect(applicationRefHost.httpAdapter).to.be.eql(ref);
});
it('should emit listen event when listening is set to true', done => {
applicationRefHost.listen$.subscribe(() => {
expect(applicationRefHost.listening).to.be.true;
done();
});
applicationRefHost.listening = true;
});
it('listening should return false if the application isnt listening yet', () => {
expect(applicationRefHost.listening).to.be.false;
});
});

View File

@@ -1,6 +1,7 @@
import { Scope } from '@nestjs/common';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { createContextId } from '../../helpers';
import { STATIC_CONTEXT } from '../../injector/constants';
import { InstanceWrapper } from '../../injector/instance-wrapper';
@@ -737,6 +738,53 @@ describe('InstanceWrapper', () => {
});
});
describe('removeInstanceByContextId', () => {
describe('without inquirer', () => {
it('should remove instance for given context', () => {
const wrapper = new InstanceWrapper({
scope: Scope.TRANSIENT,
});
const contextId = createContextId();
wrapper.setInstanceByContextId(contextId, { instance: {} });
const existingContext = wrapper.getInstanceByContextId(contextId);
expect(existingContext.instance).to.be.not.undefined;
wrapper.removeInstanceByContextId(contextId);
const removedContext = wrapper.getInstanceByContextId(contextId);
expect(removedContext.instance).to.be.undefined;
});
});
describe('when transient and inquirer has been passed', () => {
it('should remove instance for given context', () => {
const wrapper = new InstanceWrapper({
scope: Scope.TRANSIENT,
});
wrapper.setInstanceByContextId(
STATIC_CONTEXT,
{ instance: {} },
'inquirerId',
);
const existingContext = wrapper.getInstanceByContextId(
STATIC_CONTEXT,
'inquirerId',
);
expect(existingContext.instance).to.be.not.undefined;
wrapper.removeInstanceByContextId(STATIC_CONTEXT, 'inquirerId');
const removedContext = wrapper.getInstanceByContextId(
STATIC_CONTEXT,
'inquirerId',
);
expect(removedContext.instance).to.be.undefined;
});
});
});
describe('isInRequestScope', () => {
describe('when tree and context are not static and is not transient', () => {
it('should return true', () => {

View File

@@ -1,4 +1,4 @@
import { InjectionToken, Scope } from '@nestjs/common';
import { InjectionToken, Provider, Scope } from '@nestjs/common';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { ContextIdFactory } from '../helpers/context-id-factory';
@@ -7,6 +7,7 @@ import { Injector } from '../injector/injector';
import { InstanceLoader } from '../injector/instance-loader';
import { GraphInspector } from '../inspector/graph-inspector';
import { NestApplicationContext } from '../nest-application-context';
import { setTimeout } from 'timers/promises';
describe('NestApplicationContext', () => {
class A {}
@@ -14,6 +15,7 @@ describe('NestApplicationContext', () => {
async function testHelper(
injectionKey: InjectionToken,
scope: Scope,
additionalProviders: Array<Provider> = [],
): Promise<NestApplicationContext> {
const nestContainer = new NestContainer();
const injector = new Injector();
@@ -33,6 +35,10 @@ describe('NestApplicationContext', () => {
moduleRef.token,
);
for (const provider of additionalProviders) {
nestContainer.addProvider(provider, moduleRef.token);
}
nestContainer.addInjectable(
{
provide: injectionKey,
@@ -96,6 +102,58 @@ describe('NestApplicationContext', () => {
expect(processUp).to.be.false;
expect(promisesResolved).to.be.true;
});
it('should defer shutdown until all init hooks are resolved', async () => {
const clock = sinon.useFakeTimers({
toFake: ['setTimeout'],
});
const signal = 'SIGTERM';
const onModuleInitStub = sinon.stub();
const onApplicationShutdownStub = sinon.stub();
class B {
async onModuleInit() {
await setTimeout(5000);
onModuleInitStub();
}
async onApplicationShutdown() {
await setTimeout(1000);
onApplicationShutdownStub();
}
}
const applicationContext = await testHelper(A, Scope.DEFAULT, [
{ provide: B, useClass: B, scope: Scope.DEFAULT },
]);
applicationContext.enableShutdownHooks([signal]);
const ignoreProcessSignal = () => {
// noop to prevent process from exiting
};
process.on(signal, ignoreProcessSignal);
const deferredShutdown = async () => {
setTimeout(1);
process.kill(process.pid, signal);
};
Promise.all([applicationContext.init(), deferredShutdown()]);
await clock.nextAsync();
expect(onModuleInitStub.called).to.be.false;
expect(onApplicationShutdownStub.called).to.be.false;
await clock.nextAsync();
expect(onModuleInitStub.called).to.be.true;
expect(onApplicationShutdownStub.called).to.be.false;
await clock.nextAsync();
expect(onModuleInitStub.called).to.be.true;
expect(onApplicationShutdownStub.called).to.be.true;
clock.restore();
});
});
describe('get', () => {

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,6 +1,6 @@
import { Logger } from '@nestjs/common/services/logger.service';
import { loadPackage } from '@nestjs/common/utils/load-package.util';
import { isUndefined } from '@nestjs/common/utils/shared.utils';
import { isNil, isUndefined } from '@nestjs/common/utils/shared.utils';
import {
KAFKA_DEFAULT_BROKER,
KAFKA_DEFAULT_CLIENT,
@@ -37,6 +37,15 @@ import {
KafkaRequestSerializer,
} from '../serializers/kafka-request.serializer';
import { ClientProxy } from './client-proxy';
import {
connectable,
defer,
Observable,
Subject,
throwError as _throw,
} from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { InvalidMessageException } from '../errors/invalid-message.exception';
let kafkaPackage: any = {};
@@ -223,6 +232,58 @@ export class ClientKafka extends ClientProxy {
return this.consumerAssignments;
}
public emitBatch<TResult = any, TInput = any>(
pattern: any,
data: { messages: TInput[] },
): Observable<TResult> {
if (isNil(pattern) || isNil(data)) {
return _throw(() => new InvalidMessageException());
}
const source = defer(async () => this.connect()).pipe(
mergeMap(() => this.dispatchBatchEvent({ pattern, data })),
);
const connectableSource = connectable(source, {
connector: () => new Subject(),
resetOnDisconnect: false,
});
connectableSource.connect();
return connectableSource;
}
public commitOffsets(
topicPartitions: TopicPartitionOffsetAndMetadata[],
): Promise<void> {
if (this.consumer) {
return this.consumer.commitOffsets(topicPartitions);
} else {
throw new Error('No consumer initialized');
}
}
protected async dispatchBatchEvent<TInput = any>(
packets: ReadPacket<{ messages: TInput[] }>,
): Promise<any> {
if (packets.data.messages.length === 0) {
return;
}
const pattern = this.normalizePattern(packets.pattern);
const outgoingEvents = await Promise.all(
packets.data.messages.map(message => {
return this.serializer.serialize(message as any, { pattern });
}),
);
const message = Object.assign(
{
topic: pattern,
messages: outgoingEvents,
},
this.options.send || {},
);
return this.producer.send(message);
}
protected async dispatchEvent(packet: OutgoingEvent): Promise<any> {
const pattern = this.normalizePattern(packet.pattern);
const outgoingEvent = await this.serializer.serialize(packet.data, {
@@ -320,14 +381,4 @@ export class ClientKafka extends ClientProxy {
this.deserializer =
(options && options.deserializer) || new KafkaResponseDeserializer();
}
public commitOffsets(
topicPartitions: TopicPartitionOffsetAndMetadata[],
): Promise<void> {
if (this.consumer) {
return this.consumer.commitOffsets(topicPartitions);
} else {
throw new Error('No consumer initialized');
}
}
}

View File

@@ -210,15 +210,22 @@ export class ClientMqtt extends ClientProxy {
return undefined;
}
return {
...requestOptions,
properties: {
...requestOptions?.properties,
// Cant just spread objects as MQTT won't deliver
// any message with empty object as "userProperties" field
// @url https://github.com/nestjs/nest/issues/14079
let options: MqttRecordOptions = {};
if (requestOptions) {
options = { ...requestOptions };
}
if (this.options?.userProperties) {
options.properties = {
...options.properties,
userProperties: {
...this.options?.userProperties,
...requestOptions?.properties?.userProperties,
...options.properties?.userProperties,
},
},
};
};
}
return options;
}
}

View File

@@ -135,9 +135,7 @@ export class ClientRMQ extends ClientProxy {
public createClient(): AmqpConnectionManager {
const socketOptions = this.getOptionsProp(this.options, 'socketOptions');
return rmqPackage.connect(this.urls, {
connectionOptions: socketOptions?.connectionOptions,
});
return rmqPackage.connect(this.urls, socketOptions);
}
public mergeDisconnectEvent<T = any>(

View File

@@ -1,23 +1,23 @@
import {
isObject,
isNumber,
isNil,
isNumber,
isObject,
isSymbol,
} from '@nestjs/common/utils/shared.utils';
/* eslint-disable @typescript-eslint/no-use-before-define */
import {
PATTERN_EXTRAS_METADATA,
PATTERN_HANDLER_METADATA,
PATTERN_METADATA,
TRANSPORT_METADATA,
PATTERN_EXTRAS_METADATA,
} from '../constants';
import { PatternHandler } from '../enums/pattern-handler.enum';
import { PatternMetadata } from '../interfaces/pattern-metadata.interface';
import { Transport } from '../enums';
import { PatternHandler } from '../enums/pattern-handler.enum';
import {
InvalidGrpcDecoratorException,
RpcDecoratorMetadata,
} from '../errors/invalid-grpc-message-decorator.exception';
import { PatternMetadata } from '../interfaces/pattern-metadata.interface';
export enum GrpcMethodStreamingType {
NO_STREAMING = 'no_stream',
@@ -141,7 +141,35 @@ export function GrpcStreamMethod(
method,
GrpcMethodStreamingType.RX_STREAMING,
);
return MessagePattern(metadata, Transport.GRPC)(target, key, descriptor);
MessagePattern(metadata, Transport.GRPC)(target, key, descriptor);
const originalMethod = descriptor.value;
// Override original method to call the "drainBuffer" method on the first parameter
// This is required to avoid premature message emission
descriptor.value = async function (
this: any,
observable: any,
...args: any[]
) {
const result = await Promise.resolve(
originalMethod.apply(this, [observable, ...args]),
);
// Drain buffer if "drainBuffer" method is available
if (observable && observable.drainBuffer) {
observable.drainBuffer();
}
return result;
};
// Copy all metadata from the original method to the new one
const metadataKeys = Reflect.getMetadataKeys(originalMethod);
metadataKeys.forEach(metadataKey => {
const metadataValue = Reflect.getMetadata(metadataKey, originalMethod);
Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);
});
};
}

View File

@@ -308,7 +308,9 @@ export class ListenersController {
configurable: false,
});
const requestProviderValue = isTreeDurable ? contextId.payload : request;
const requestProviderValue = isTreeDurable
? contextId.payload
: Object.assign(request, contextId.payload);
this.container.registerRequestProvider(requestProviderValue, contextId);
}
return contextId;

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/microservices",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -19,11 +19,11 @@
},
"dependencies": {
"iterare": "1.2.1",
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"devDependencies": {
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7"
"@nestjs/common": "^10.4.21",
"@nestjs/core": "^10.4.21"
},
"peerDependencies": {
"@grpc/grpc-js": "*",

View File

@@ -6,6 +6,7 @@ import {
import {
EMPTY,
Observable,
ReplaySubject,
Subject,
Subscription,
defaultIfEmpty,
@@ -165,7 +166,7 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
if (!methodHandler) {
continue;
}
service[methodName] = await this.createServiceMethod(
service[methodName] = this.createServiceMethod(
methodHandler,
grpcService.prototype[methodName],
streamingType,
@@ -174,7 +175,7 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
return service;
}
getMessageHandler(
public getMessageHandler(
serviceName: string,
methodName: string,
streaming: GrpcMethodStreamingType,
@@ -278,7 +279,7 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
source: Observable<T>,
call: GrpcCall<T>,
): Promise<void> {
// this promise should **not** reject, as we're handling errors in the observable for the Call
// This promise should **not** reject, as we're handling errors in the observable for the Call
// the promise is only needed to signal when writing/draining has been completed
return new Promise((resolve, _doNotUse) => {
const valuesWaitingToBeDrained: T[] = [];
@@ -380,8 +381,11 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
call: GrpcCall,
callback: (err: unknown, value: unknown) => void,
) => {
const req = new Subject<any>();
call.on('data', (m: any) => req.next(m));
// Needs to be a Proxy in order to buffer messages that come before handler is executed
// This could happen if handler has any async guards or interceptors registered that would delay
// the execution.
const { subject, next, error, complete } = this.bufferUntilDrained();
call.on('data', (m: any) => next(m));
call.on('error', (e: any) => {
// Check if error means that stream ended on other end
const isCancelledError = String(e).toLowerCase().indexOf('cancelled');
@@ -391,11 +395,15 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
return;
}
// If another error then just pass it along
req.error(e);
error(e);
});
call.on('end', () => req.complete());
call.on('end', () => complete());
const handler = methodHandler(req.asObservable(), call.metadata, call);
const handler = methodHandler(
subject.asObservable(),
call.metadata,
call,
);
const res = this.transformToObservable(await handler);
if (isResponseStream) {
await this.writeObservableToGrpc(res, call);
@@ -426,11 +434,15 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
call: GrpcCall,
callback: (err: unknown, value: unknown) => void,
) => {
let handlerStream: Observable<any>;
if (isResponseStream) {
methodHandler(call);
handlerStream = this.transformToObservable(await methodHandler(call));
} else {
methodHandler(call, callback);
handlerStream = this.transformToObservable(
await methodHandler(call, callback),
);
}
await lastValueFrom(handlerStream);
};
}
@@ -469,7 +481,7 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
this.messageHandlers.set(route, callback);
}
public async createClient(): Promise<any> {
public async createClient() {
const channelOptions: ChannelOptions =
this.options && this.options.channelOptions
? this.options.channelOptions
@@ -612,4 +624,71 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
);
}
}
private bufferUntilDrained<T>() {
type DrainableSubject<T> = Subject<T> & { drainBuffer: () => void };
const subject = new Subject<T>();
let replayBuffer = new ReplaySubject<T>();
let hasDrained = false;
function drainBuffer(this: DrainableSubject<T>) {
if (hasDrained) {
return;
}
hasDrained = true;
// Replay buffered values to the new subscriber
setImmediate(() => {
const subcription = replayBuffer.subscribe(subject);
subcription.unsubscribe();
replayBuffer = null;
});
}
return {
subject: new Proxy<DrainableSubject<T>>(subject as DrainableSubject<T>, {
get(target, prop, receiver) {
if (prop === 'asObservable') {
return () => {
const stream = subject.asObservable();
// "drainBuffer" will be called before the evaluation of the handler
// but after any enhancers have been applied (e.g., `interceptors`)
Object.defineProperty(stream, drainBuffer.name, {
value: drainBuffer,
});
return stream;
};
}
if (hasDrained) {
return Reflect.get(target, prop, receiver);
}
return Reflect.get(replayBuffer, prop, receiver);
},
}),
next: (value: T) => {
if (!hasDrained) {
replayBuffer.next(value);
}
subject.next(value);
},
error: (err: any) => {
if (!hasDrained) {
replayBuffer.error(err);
}
subject.error(err);
},
complete: () => {
if (!hasDrained) {
replayBuffer.complete();
// Replay buffer is no longer needed
// Return early to allow subject to complete later, after the replay buffer
// has been drained
return;
}
subject.complete();
},
};
}
}

View File

@@ -9,6 +9,8 @@ import {
EachMessagePayload,
KafkaMessage,
} from '../../external/kafka.interface';
import { Observable } from 'rxjs';
import { Producer } from 'kafkajs';
describe('ClientKafka', () => {
const topic = 'test.topic';
@@ -549,6 +551,77 @@ describe('ClientKafka', () => {
});
});
describe('emitBatch', () => {
it(`should return an observable stream`, () => {
const stream$ = client.emitBatch(
{},
{
messages: [],
},
);
expect(stream$ instanceof Observable).to.be.true;
});
it(`should call "connect" immediately`, () => {
const connectSpy = sinon.spy(client, 'connect');
client.emitBatch(
{},
{
messages: [],
},
);
expect(connectSpy.calledOnce).to.be.true;
});
describe('when "connect" throws', () => {
it('should return Observable with error', () => {
sinon.stub(client, 'connect').callsFake(() => {
throw new Error();
});
const stream$ = client.emitBatch(
{},
{
messages: [],
},
);
stream$.subscribe({
next: () => {},
error: err => {
expect(err).to.be.instanceof(Error);
},
});
});
});
describe('when is connected', () => {
beforeEach(() => {
sinon
.stub(client, 'connect')
.callsFake(() => Promise.resolve({} as Producer));
});
it(`should call dispatchBatchEvent`, () => {
const pattern = { test: 3 };
const data = { messages: [] };
const dispatchBatchEventSpy = sinon
.stub()
.callsFake(() => Promise.resolve(true));
const stream$ = client.emitBatch(pattern, data);
client['dispatchBatchEvent'] = dispatchBatchEventSpy;
stream$.subscribe(() => {
expect(dispatchBatchEventSpy.calledOnce).to.be.true;
});
});
});
it('should return Observable with error', () => {
const err$ = client.emitBatch(null, null);
expect(err$).to.be.instanceOf(Observable);
});
});
describe('dispatchEvent', () => {
const eventMessage = {
id: undefined,

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/platform-express",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -20,13 +20,13 @@
"dependencies": {
"body-parser": "1.20.3",
"cors": "2.8.5",
"express": "4.21.1",
"multer": "1.4.4-lts.1",
"tslib": "2.7.0"
"express": "4.22.1",
"multer": "2.0.2",
"tslib": "2.8.1"
},
"devDependencies": {
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7"
"@nestjs/common": "^10.4.21",
"@nestjs/core": "^10.4.21"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/platform-fastify",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -22,9 +22,9 @@
"@fastify/formbody": "7.4.0",
"@fastify/middie": "8.3.3",
"fastify": "4.28.1",
"light-my-request": "6.1.0",
"light-my-request": "6.3.0",
"path-to-regexp": "3.3.0",
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"peerDependencies": {
"@fastify/static": "^6.0.0 || ^7.0.0",

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -82,4 +82,12 @@ export class IoAdapter extends AbstractWsAdapter {
}
return { data: payload };
}
public close(server: Server) {
if (this.forceCloseConnections && server.httpServer === this.httpServer) {
return;
}
return super.close(server);
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/platform-socket.io",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@platform-socket.io)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -18,8 +18,8 @@
"access": "public"
},
"dependencies": {
"socket.io": "4.8.0",
"tslib": "2.7.0"
"socket.io": "4.8.1",
"tslib": "2.8.1"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/platform-ws",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@platform-ws)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -18,7 +18,7 @@
"access": "public"
},
"dependencies": {
"tslib": "2.7.0",
"tslib": "2.8.1",
"ws": "8.18.0"
},
"peerDependencies": {

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/testing",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@testing)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -18,7 +18,7 @@
"access": "public"
},
"dependencies": {
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",

View File

@@ -94,7 +94,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/logos/mercedes-logo.png" width="100" valign="middle" /></a></td>
<td><a href="https://www.dinii.jp/" target="_blank"><img src="https://nestjs.com/img/logos/dinii-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://bloodycase.com/?promocode=NEST" target="_blank"><img src="https://nestjs.com/img/logos/bloodycase-logo.png" width="65" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-logo.svg" width="150" valign="middle" /></a></td>
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/logos/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/logos/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/arcjet-logo.svg" width="170" valign="middle" /></a></td>
</tr>

View File

@@ -17,6 +17,15 @@ export abstract class AbstractWsAdapter<
> implements WebSocketAdapter<TServer, TClient, TOptions>
{
protected readonly httpServer: any;
private _forceCloseConnections: boolean;
public set forceCloseConnections(value: boolean) {
this._forceCloseConnections = value;
}
public get forceCloseConnections(): boolean {
return this._forceCloseConnections;
}
constructor(appOrHttpServer?: INestApplicationContext | any) {
if (appOrHttpServer && appOrHttpServer instanceof NestApplication) {

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/websockets",
"version": "10.4.7",
"version": "10.4.21",
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -15,11 +15,11 @@
"dependencies": {
"iterare": "1.2.1",
"object-hash": "3.0.0",
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"devDependencies": {
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7"
"@nestjs/common": "^10.4.21",
"@nestjs/core": "^10.4.21"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",

View File

@@ -1,3 +1,4 @@
import { NestApplicationOptions } from '@nestjs/common';
import { InjectionToken } from '@nestjs/common/interfaces';
import { Injectable } from '@nestjs/common/interfaces/injectable.interface';
import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface';
@@ -113,8 +114,12 @@ export class SocketModule<
}
private initializeAdapter() {
const forceCloseConnections = (this.appOptions as NestApplicationOptions)
.forceCloseConnections;
const adapter = this.applicationConfig.getIoAdapter();
if (adapter) {
(adapter as AbstractWsAdapter).forceCloseConnections =
forceCloseConnections;
this.isAdapterInitialized = true;
return;
}
@@ -124,6 +129,7 @@ export class SocketModule<
() => require('@nestjs/platform-socket.io'),
);
const ioAdapter = new IoAdapter(this.httpServer);
ioAdapter.forceCloseConnections = forceCloseConnections;
this.applicationConfig.setIoAdapter(ioAdapter);
this.isAdapterInitialized = true;

File diff suppressed because it is too large Load Diff

View File

@@ -19,35 +19,35 @@
"test:e2e": "jest --config ./e2e/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/jest": "29.5.14",
"@types/node": "22.10.0",
"@types/supertest": "6.0.2",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"typescript": "5.3.3"
},
"jest": {

View File

@@ -19,16 +19,36 @@ describe('CatsController', () => {
describe('findAll', () => {
it('should return an array of cats', async () => {
const result: Cat[] = [
const cats: Cat[] = [
{
age: 2,
breed: 'Bombay',
name: 'Pixel',
},
];
jest.spyOn(catsService, 'findAll').mockImplementation(() => result);
// @ts-ignore
catsService.cats = cats;
expect(await catsController.findAll()).toBe(result);
expect(await catsController.findAll()).toBe(cats);
});
});
describe('create', () => {
it('should add a new cat', async () => {
const cat: Cat = {
age: 2,
breed: 'Bombay',
name: 'Pixel',
};
const expectedCatArray = [cat];
// @ts-ignore
expect(catsService.cats).toStrictEqual([]);
await catsController.create(cat);
// @ts-ignore
expect(catsService.cats).toStrictEqual(expectedCatArray);
});
});
});

View File

@@ -0,0 +1,48 @@
import { Test } from '@nestjs/testing';
import { CatsService } from './cats.service';
import { Cat } from './interfaces/cat.interface';
describe('CatsService', () => {
let catsService: CatsService;
beforeEach(async () => {
const moduleRef = await Test.createTestingModule({
providers: [CatsService],
}).compile();
catsService = moduleRef.get<CatsService>(CatsService);
});
describe('findAll', () => {
it('should return an array of cats', async () => {
const result = [
{
name: 'Frajola',
age: 2,
breed: 'Stray',
},
];
//@ts-ignore
catsService.cats = result;
await expect(catsService.findAll()).resolves.toBe(result);
});
});
describe('create', () => {
it('should add a new cat', async () => {
const cat: Cat = {
name: 'Frajola',
age: 2,
breed: 'Stray',
};
const expectedCatArray = [cat];
//@ts-ignore
expect(catsService.cats).toStrictEqual([]);
await catsService.create(cat);
//@ts-ignore
expect(catsService.cats).toStrictEqual(expectedCatArray);
});
});
});

View File

@@ -9,7 +9,7 @@ export class CatsService {
this.cats.push(cat);
}
findAll(): Cat[] {
return this.cats;
findAll(): Promise<Cat[]> {
return Promise.resolve(this.cats);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,37 +19,37 @@
"test:e2e": "jest --config ./e2e/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/platform-socket.io": "10.3.2",
"@nestjs/websockets": "10.3.2",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"@nestjs/platform-socket.io": "10.4.13",
"@nestjs/websockets": "10.4.13",
"@socket.io/redis-adapter": "8.2.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1",
"socket.io": "4.7.4"
"socket.io": "4.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.4.5",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/jest": "29.5.14",
"@types/node": "22.10.0",
"@types/supertest": "6.0.2",
"@types/ws": "8.5.5",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"prettier": "3.4.2",
"redis": "4.6.13",
"supertest": "6.3.3",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",

File diff suppressed because it is too large Load Diff

View File

@@ -19,36 +19,36 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/microservices": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/microservices": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@types/amqplib": "0.10.4",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/amqplib": "0.10.6",
"@types/express": "4.17.21",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/node": "22.10.0",
"@types/supertest": "6.0.2",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"typescript": "5.3.3"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -20,32 +20,32 @@
},
"dependencies": {
"@grpc/grpc-js": "1.10.9",
"@grpc/reflection": "1.0.3",
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/microservices": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@grpc/reflection": "1.0.4",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/microservices": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/node": "22.10.0",
"@types/supertest": "6.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",

View File

@@ -1,8 +1,8 @@
import { ReflectionService } from '@grpc/reflection';
import { ClientOptions, Transport } from '@nestjs/microservices';
import { GrpcOptions, Transport } from '@nestjs/microservices';
import { join } from 'path';
export const grpcClientOptions: ClientOptions = {
export const grpcClientOptions: GrpcOptions = {
transport: Transport.GRPC,
options: {
package: 'hero', // ['hero', 'hero2']

View File

@@ -2,7 +2,7 @@ version: "3"
services:
mysql:
image: mysql:8
image: mysql:9
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
@@ -10,7 +10,7 @@ services:
ports:
- "3306:3306"
db-test:
image: mysql:8
image: mysql:9
restart: always
environment:
MYSQL_ROOT_PASSWORD: root

File diff suppressed because it is too large Load Diff

View File

@@ -19,32 +19,32 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/typeorm": "10.0.1",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"@nestjs/typeorm": "10.0.2",
"mysql2": "3.9.8",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.5",
"rimraf": "5.0.10",
"rxjs": "7.8.1",
"typeorm": "0.3.20"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/jest": "29.5.14",
"@types/node": "20.17.9",
"@types/supertest": "6.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",

File diff suppressed because it is too large Load Diff

View File

@@ -19,31 +19,31 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/mongoose": "10.0.2",
"@nestjs/platform-express": "10.3.8",
"mongoose": "8.0.1",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/mongoose": "10.0.3",
"@nestjs/platform-express": "10.4.13",
"mongoose": "8.8.4",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/jest": "29.5.14",
"@types/node": "22.10.0",
"@types/supertest": "6.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",

View File

@@ -1,23 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { Types } from 'mongoose';
import { CatsController } from './cats.controller';
import { CreateCatDto } from './dto/create-cat.dto';
import { CatsService } from './cats.service';
import { CreateCatDto } from './dto/create-cat.dto';
describe('Cats Controller', () => {
const catsServiceMock = {
create: jest.fn(),
findAll: jest.fn(),
findOne: jest.fn(),
update: jest.fn(),
delete: jest.fn(),
};
describe('CatsController', () => {
let controller: CatsController;
let service: CatsService;
const createCatDto: CreateCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
const mockCat = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
_id: 'a id',
};
let service: jest.Mocked<CatsService>;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
@@ -25,65 +22,124 @@ describe('Cats Controller', () => {
providers: [
{
provide: CatsService,
useValue: {
findAll: jest.fn().mockResolvedValue([
{
name: 'Cat #1',
breed: 'Bread #1',
age: 4,
},
{
name: 'Cat #2',
breed: 'Breed #2',
age: 3,
},
{
name: 'Cat #3',
breed: 'Breed #3',
age: 2,
},
]),
create: jest.fn().mockResolvedValue(createCatDto),
},
useValue: catsServiceMock,
},
],
}).compile();
controller = module.get<CatsController>(CatsController);
service = module.get<CatsService>(CatsService);
controller = module.get(CatsController);
service = module.get(CatsService);
});
describe('create()', () => {
describe('create', () => {
it('should create a new cat', async () => {
const createSpy = jest
.spyOn(service, 'create')
.mockResolvedValueOnce(mockCat);
const mockedCat = {
_id: new Types.ObjectId(),
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
service.create.mockResolvedValueOnce(mockedCat);
await controller.create(createCatDto);
expect(createSpy).toHaveBeenCalledWith(createCatDto);
const createCatDto: CreateCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
const result = await controller.create(createCatDto);
expect(result).toEqual(mockedCat);
expect(service.create).toHaveBeenCalledWith(createCatDto);
});
});
describe('findAll()', () => {
describe('findAll', () => {
it('should return an array of cats', async () => {
expect(controller.findAll()).resolves.toEqual([
const mockedCats = [
{
_id: new Types.ObjectId(),
name: 'Cat #1',
breed: 'Bread #1',
age: 4,
},
{
_id: new Types.ObjectId(),
name: 'Cat #2',
breed: 'Breed #2',
age: 3,
},
{
_id: new Types.ObjectId(),
name: 'Cat #3',
breed: 'Breed #3',
age: 2,
},
]);
];
service.findAll.mockResolvedValueOnce(mockedCats);
const result = await controller.findAll();
expect(result).toEqual(mockedCats);
expect(service.findAll).toHaveBeenCalled();
});
});
describe('findOne', () => {
it('should return a single cat', async () => {
const mockedCat = {
_id: new Types.ObjectId(),
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
service.findOne.mockResolvedValueOnce(mockedCat);
const id = new Types.ObjectId().toString();
const result = await controller.findOne(id);
expect(result).toEqual(mockedCat);
expect(service.findOne).toHaveBeenCalledWith(id);
});
});
describe('update', () => {
it('should update a single cat', async () => {
const mockedCat = {
_id: new Types.ObjectId(),
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
service.update.mockResolvedValueOnce(mockedCat);
const id = new Types.ObjectId().toString();
const updateCatDto: CreateCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
const result = await controller.update(id, updateCatDto);
expect(result).toEqual(mockedCat);
expect(service.update).toHaveBeenCalledWith(id, updateCatDto);
});
});
describe('delete', () => {
it('should delete a single cat', async () => {
const mockedCat = {
_id: new Types.ObjectId(),
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
service.delete.mockResolvedValueOnce(mockedCat);
const id = new Types.ObjectId().toString();
const result = await controller.delete(id);
expect(result).toEqual(mockedCat);
expect(service.delete).toHaveBeenCalledWith(id);
});
});
});

View File

@@ -1,6 +1,7 @@
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
import { CatsService } from './cats.service';
import { CreateCatDto } from './dto/create-cat.dto';
import { UpdateCatDto } from './dto/update-cat.dto';
import { Cat } from './schemas/cat.schema';
@Controller('cats')
@@ -9,7 +10,7 @@ export class CatsController {
@Post()
async create(@Body() createCatDto: CreateCatDto) {
await this.catsService.create(createCatDto);
return this.catsService.create(createCatDto);
}
@Get()
@@ -22,6 +23,11 @@ export class CatsController {
return this.catsService.findOne(id);
}
@Post(':id')
async update(@Param('id') id: string, @Body() updateCatDto: UpdateCatDto) {
return this.catsService.update(id, updateCatDto);
}
@Delete(':id')
async delete(@Param('id') id: string) {
return this.catsService.delete(id);

View File

@@ -1,31 +1,21 @@
import { getModelToken } from '@nestjs/mongoose';
import { Test, TestingModule } from '@nestjs/testing';
import { Model } from 'mongoose';
import { Model, Types } from 'mongoose';
import { CatsService } from './cats.service';
import { CreateCatDto } from './dto/create-cat.dto';
import { Cat } from './schemas/cat.schema';
const mockCat = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
const catModelMock = {
create: jest.fn(),
find: jest.fn(),
findOne: jest.fn(),
findByIdAndUpdate: jest.fn(),
findByIdAndDelete: jest.fn(),
};
describe('CatsService', () => {
let service: CatsService;
let model: Model<Cat>;
const catsArray = [
{
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
},
{
name: 'Cat #2',
breed: 'Breed #2',
age: 2,
},
];
let model: jest.Mocked<Model<Cat>>;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
@@ -33,46 +23,128 @@ describe('CatsService', () => {
CatsService,
{
provide: getModelToken('Cat'),
useValue: {
new: jest.fn().mockResolvedValue(mockCat),
constructor: jest.fn().mockResolvedValue(mockCat),
find: jest.fn(),
create: jest.fn(),
exec: jest.fn(),
},
useValue: catModelMock,
},
],
}).compile();
service = module.get<CatsService>(CatsService);
model = module.get<Model<Cat>>(getModelToken('Cat'));
service = module.get(CatsService);
model = module.get(getModelToken('Cat'));
});
it('should be defined', () => {
expect(service).toBeDefined();
});
it('should return all cats', async () => {
jest.spyOn(model, 'find').mockReturnValue({
exec: jest.fn().mockResolvedValueOnce(catsArray),
} as any);
const cats = await service.findAll();
expect(cats).toEqual(catsArray);
});
it('should insert a new cat', async () => {
jest.spyOn(model, 'create').mockImplementationOnce(() =>
Promise.resolve({
describe('create', () => {
it('should insert a new cat', async () => {
const mockedCat: CreateCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
} as any),
);
const newCat = await service.create({
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
model.create.mockResolvedValueOnce(mockedCat as any);
const createCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
const result = await service.create(createCatDto);
expect(result).toEqual(mockedCat);
expect(model.create).toHaveBeenCalledWith(createCatDto);
});
});
describe('findAll', () => {
it('should return all cats', async () => {
const mockedCats = [
{
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
},
{
name: 'Cat #2',
breed: 'Breed #2',
age: 2,
},
];
model.find.mockReturnValueOnce({
exec: jest.fn().mockResolvedValueOnce(mockedCats),
} as any);
const result = await service.findAll();
expect(result).toEqual(mockedCats);
expect(model.find).toHaveBeenCalled();
});
});
describe('findOne', () => {
it('should return one cat', async () => {
const mockedCat = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
model.findOne.mockReturnValueOnce({
exec: jest.fn().mockResolvedValueOnce(mockedCat),
} as any);
const id = new Types.ObjectId().toString();
const result = await service.findOne(id);
expect(result).toEqual(mockedCat);
expect(model.findOne).toHaveBeenCalledWith({ _id: id });
});
});
describe('update', () => {
it('should update a cat', async () => {
const mockedCat = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
model.findByIdAndUpdate.mockReturnValueOnce({
exec: jest.fn().mockResolvedValueOnce(mockedCat),
} as any);
const id = new Types.ObjectId().toString();
const updateCatDto = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
const result = await service.update(id, updateCatDto);
expect(result).toEqual(mockedCat);
expect(model.findByIdAndUpdate).toHaveBeenCalledWith(
{ _id: id },
updateCatDto,
{ new: true },
);
});
});
describe('delete', () => {
it('should delete a cat', async () => {
const mockedCat = {
name: 'Cat #1',
breed: 'Breed #1',
age: 4,
};
model.findByIdAndDelete.mockReturnValueOnce({
exec: jest.fn().mockResolvedValueOnce(mockedCat),
} as any);
const id = new Types.ObjectId().toString();
const result = await service.delete(id);
expect(result).toEqual(mockedCat);
expect(model.findByIdAndDelete).toHaveBeenCalledWith({ _id: id });
});
expect(newCat).toEqual(mockCat);
});
});

View File

@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { CreateCatDto } from './dto/create-cat.dto';
import { UpdateCatDto } from './dto/update-cat.dto';
import { Cat } from './schemas/cat.schema';
@Injectable()
@@ -21,9 +22,15 @@ export class CatsService {
return this.catModel.findOne({ _id: id }).exec();
}
async delete(id: string) {
async update(id: string, updateCatDto: UpdateCatDto): Promise<Cat> {
return this.catModel
.findByIdAndUpdate({ _id: id }, updateCatDto, { new: true })
.exec();
}
async delete(id: string): Promise<Cat> {
const deletedCat = await this.catModel
.findByIdAndRemove({ _id: id })
.findByIdAndDelete({ _id: id })
.exec();
return deletedCat;
}

View File

@@ -0,0 +1,5 @@
export class UpdateCatDto {
readonly name?: string;
readonly age?: number;
readonly breed?: string;
}

View File

@@ -2,7 +2,7 @@ version: "3"
services:
mysql:
image: mysql:8
image: mysql:9
restart: always
environment:
MYSQL_ROOT_PASSWORD: root

File diff suppressed because it is too large Load Diff

View File

@@ -19,34 +19,34 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/sequelize": "10.0.0",
"mysql2": "3.9.7",
"reflect-metadata": "0.2.1",
"rimraf": "5.0.5",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"@nestjs/sequelize": "10.0.1",
"mysql2": "3.9.8",
"reflect-metadata": "0.2.2",
"rimraf": "5.0.10",
"rxjs": "7.8.1",
"sequelize": "6.36.0",
"sequelize": "6.37.5",
"sequelize-typescript": "2.1.6",
"typescript": "5.3.3"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@nestjs/testing": "10.3.2",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.13",
"@types/express": "4.17.21",
"@types/jest": "29.5.12",
"@types/node": "20.8.7",
"@types/supertest": "2.0.16",
"@types/jest": "29.5.14",
"@types/node": "20.17.9",
"@types/supertest": "6.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"supertest": "6.3.3",
"prettier": "3.4.2",
"supertest": "6.3.4",
"ts-jest": "29.1.2",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",

File diff suppressed because it is too large Load Diff

View File

@@ -12,26 +12,26 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"reflect-metadata": "0.2.1",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"reflect-metadata": "0.2.2",
"rxjs": "7.8.1",
"typescript": "5.3.3"
},
"devDependencies": {
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
"@types/node": "20.8.7",
"@nestjs/cli": "10.4.8",
"@nestjs/schematics": "10.2.3",
"@types/node": "22.10.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.42.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import": "2.31.0",
"start-server-webpack-plugin": "2.2.5",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"webpack": "5.90.3",
"webpack": "5.96.1",
"webpack-cli": "5.1.4",
"webpack-node-externals": "3.0.0"
}

File diff suppressed because it is too large Load Diff

View File

@@ -13,28 +13,28 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.3.2",
"@nestjs/core": "10.3.2",
"@nestjs/platform-express": "10.3.8",
"@nestjs/microservices": "10.3.2",
"@nestjs/websockets": "10.3.2",
"reflect-metadata": "0.2.1",
"@nestjs/common": "10.4.13",
"@nestjs/core": "10.4.13",
"@nestjs/platform-express": "10.4.13",
"@nestjs/microservices": "10.4.13",
"@nestjs/websockets": "10.4.13",
"reflect-metadata": "0.2.2",
"rxjs": "7.8.1"
},
"devDependencies": {
"@babel/cli": "7.23.9",
"@babel/core": "7.23.9",
"@babel/node": "7.23.9",
"@babel/plugin-proposal-decorators": "7.23.9",
"@babel/plugin-transform-runtime": "7.23.9",
"@babel/preset-env": "7.23.9",
"@babel/register": "7.23.7",
"@babel/runtime": "7.23.9",
"@nestjs/testing": "10.3.2",
"@babel/cli": "7.26.4",
"@babel/core": "7.26.0",
"@babel/node": "7.26.0",
"@babel/plugin-proposal-decorators": "7.25.9",
"@babel/plugin-transform-runtime": "7.25.9",
"@babel/preset-env": "7.26.0",
"@babel/register": "7.25.9",
"@babel/runtime": "7.26.0",
"@nestjs/testing": "10.4.13",
"jest": "29.7.0",
"nodemon": "3.0.3",
"prettier": "3.2.5",
"supertest": "6.3.3"
"nodemon": "3.1.7",
"prettier": "3.4.2",
"supertest": "6.3.4"
},
"jest": {
"moduleFileExtensions": [

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More