Compare commits

..

455 Commits

Author SHA1 Message Date
Kamil Myśliwiec
4fac9c9bf2 chore(): remove http folder 2022-05-18 09:24:36 +02:00
Tony133
dd58e42501 chore(): remove http module deprecated 2022-05-17 17:53:30 +02:00
Kamil Mysliwiec
2362ade438 Merge pull request #9311 from woobottle/woo_bottle/change-reflectMetatData-params-order
Refactoring(core): Change ReflectMetadata Params Order
2022-05-17 17:04:26 +02:00
Kamil Myśliwiec
f11181071e chore(): resolve conflicts 2022-05-17 14:11:27 +02:00
Kamil Mysliwiec
11ac94e23e Merge pull request #8798 from nestjs/feat/migrate-to-ioredis
feat(microservices): migrate redis transporter to internally use ioredis package
2022-05-17 14:10:38 +02:00
Kamil Mysliwiec
cd62e31bcf Merge pull request #9522 from nestjs/dependabot/npm_and_yarn/mocha-10.0.0
chore(deps-dev): bump mocha from 9.2.2 to 10.0.0
2022-05-17 14:09:04 +02:00
Kamil Myśliwiec
34143d9e79 test(microservices): update outdated listeners controller test 2022-05-17 14:02:12 +02:00
Kamil Myśliwiec
79cccd0574 Merge branch 'tolgap-express-raw-body' 2022-05-17 13:45:59 +02:00
Kamil Myśliwiec
71e3143d90 style(): minor foramtting tweaks 2022-05-17 13:45:29 +02:00
Kamil Myśliwiec
2eaee87f09 Merge branch 'express-raw-body' of https://github.com/tolgap/nest into tolgap-express-raw-body 2022-05-17 13:44:04 +02:00
Kamil Myśliwiec
7ca14a2ed4 Merge branch 'esahin90-sahin/optional-consumer-kafka-client' 2022-05-17 13:42:33 +02:00
Kamil Myśliwiec
b7d92b2b2a style(): run prettier 2022-05-17 13:42:03 +02:00
Kamil Myśliwiec
d38a7d894f Merge branch 'sahin/optional-consumer-kafka-client' of https://github.com/esahin90/nest into esahin90-sahin/optional-consumer-kafka-client 2022-05-17 13:41:17 +02:00
Kamil Myśliwiec
cf42ed5b8d ci(): remove test_node_10 job 2022-05-17 13:39:29 +02:00
Kamil Myśliwiec
72c046dec7 fix(microservices): update ioredis options 2022-05-17 13:39:18 +02:00
Kamil Myśliwiec
1e8966b603 test(microservices): update server & client redis unit tests 2022-05-17 13:33:21 +02:00
Kamil Myśliwiec
40e2755c82 feat(microservices): migrate redis transporter to internally use ioredis package 2022-05-17 13:33:21 +02:00
dependabot[bot]
64e58b750c chore(deps-dev): bump mocha from 9.2.2 to 10.0.0
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.2 to 10.0.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.2...v10.0.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-17 11:25:46 +00:00
Kamil Mysliwiec
a21c75c4f7 Update packages/microservices/client/client-kafka.ts 2022-05-17 13:25:45 +02:00
Kamil Myśliwiec
61bcb7fe39 Merge branch 'alexfriesen-master' into 9.0.0 2022-05-17 13:24:07 +02:00
Kamil Myśliwiec
ddd95b810f chore(): resolve conflicts 2022-05-17 13:23:51 +02:00
Kamil Mysliwiec
707a3e069f Merge pull request #9587 from nestjs/fix/revert-interceptors-grpc
fix(microservices): revert grpc client interceptors (grpc-specific)
2022-05-17 13:22:01 +02:00
Kamil Mysliwiec
66da12aecf Merge pull request #9586 from nestjs/fix/propagate-kafka-errors
feat(microservices): add kafka retriable exception, auto-unwrap payloads
2022-05-17 13:21:35 +02:00
Kamil Myśliwiec
1f5a5b4f2e chore(): set minimum node version to v12 2022-05-17 13:21:25 +02:00
Kamil Myśliwiec
be1a8c33bd Merge branch 'Dzixxx-support-multiple-patterns' into 9.0.0 2022-05-17 13:17:02 +02:00
Kamil Myśliwiec
e3e3ef5cc5 chore(): resolve conflicts 2022-05-17 13:16:46 +02:00
Kamil Mysliwiec
fc95619e4d Merge pull request #9534 from nestjs/feat/module-utils
feat(core): add configurable module builder, module utils
2022-05-17 13:14:31 +02:00
Kamil Mysliwiec
19b55e9a37 Merge pull request #9491 from micalevisk/fix-use-isObservable
Use rxjs when checking if the value is an observable
2022-05-17 13:14:04 +02:00
Kamil Mysliwiec
ca967b809e Merge pull request #9383 from micalevisk/fix-issue-9357
feat(common)!: disallow usage of `inject` on class and value providers at type level
2022-05-17 13:13:56 +02:00
Kamil Mysliwiec
206579242a Merge pull request #9023 from ZanMinKian/fix/factory-provider-type
fix: fix factory provider definition
2022-05-17 13:13:22 +02:00
Kamil Mysliwiec
ddd24f970d Merge pull request #8058 from diesal11/master
Improve ParseUUIDPipe error message
2022-05-17 13:09:41 +02:00
Kamil Mysliwiec
28afaa27dc Merge pull request #8459 from titivuk/fix/ParseUUIDPipe
fix(common): ParseUUIDPipe - throw exceptions with exceptionFactory only
2022-05-17 13:09:16 +02:00
Kamil Mysliwiec
bad85d9172 Merge pull request #9585 from micalevisk/fix-issue-9581
fix: when version is an array with neutral version
2022-05-17 13:07:59 +02:00
Kamil Myśliwiec
dde23b1a2b fix(microservices): revert interceptors (grpc option) 2022-05-17 13:05:26 +02:00
Kamil Myśliwiec
4ca738dddf chore(): resolve conflicts 2022-05-17 12:55:34 +02:00
Kamil Myśliwiec
5464d72738 chore(microservices): make method name somewhat more self descriptive 2022-05-17 12:48:29 +02:00
Kamil Myśliwiec
cfe1191d22 fix(microservices): combine streams instead of subscribing twice 2022-05-17 12:47:42 +02:00
Kamil Mysliwiec
20870b1d41 Merge pull request #9583 from nestjs/dependabot/npm_and_yarn/commitlint/cli-17.0.0
chore(deps-dev): bump @commitlint/cli from 16.3.0 to 17.0.0
2022-05-17 11:44:45 +02:00
Kamil Myśliwiec
90af9590f5 feat(microservices): dont swallow kafka event handler exceptions 2022-05-17 11:33:42 +02:00
Kamil Myśliwiec
6547f922fb feat(microservices): add kafka request deserializer, unwrap request 2022-05-17 10:49:51 +02:00
Kamil Myśliwiec
a439055646 feat(microservices): add kafka retriable exception, rethrow if needed 2022-05-17 10:41:08 +02:00
dependabot[bot]
842b7cb776 chore(deps-dev): bump @commitlint/cli from 16.3.0 to 17.0.0
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 16.3.0 to 17.0.0.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.0.0/@commitlint/cli)

---
updated-dependencies:
- dependency-name: "@commitlint/cli"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-17 08:24:17 +00:00
Kamil Mysliwiec
7cea25f6b7 Merge pull request #9584 from nestjs/dependabot/npm_and_yarn/types/node-17.0.34
chore(deps-dev): bump @types/node from 17.0.33 to 17.0.34
2022-05-17 10:21:33 +02:00
Kamil Mysliwiec
5c904a622f Merge pull request #9582 from nestjs/dependabot/npm_and_yarn/commitlint/config-angular-17.0.0
chore(deps-dev): bump @commitlint/config-angular from 16.3.0 to 17.0.0
2022-05-17 10:21:20 +02:00
Micael Levi (@micalevisk)
15737e0622 test: add tests to cover version array with neutral 2022-05-16 22:07:53 -04:00
Micael Levi (@micalevisk)
46ec9770b9 test(core): improve typings on RouterExplorer suite 2022-05-16 21:49:05 -04:00
Micael Levi (@micalevisk)
5467777e9b fix(platform-fastify): when version is an array with neutral 2022-05-16 21:27:06 -04:00
Micael Levi (@micalevisk)
07e17a4ca9 fix(core,platform-express): when version is an array with neutral
on header and media type versioning, on the express adapter
2022-05-16 21:26:37 -04:00
dependabot[bot]
21bffef69b chore(deps-dev): bump @types/node from 17.0.33 to 17.0.34
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.33 to 17.0.34.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-17 00:09:30 +00:00
dependabot[bot]
353854e88d chore(deps-dev): bump @commitlint/config-angular from 16.3.0 to 17.0.0
Bumps [@commitlint/config-angular](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-angular) from 16.3.0 to 17.0.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/v17.0.0/@commitlint/config-angular)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-17 00:03:23 +00:00
Kamil Mysliwiec
73f45db25e Merge pull request #9578 from nestjs/dependabot/npm_and_yarn/commitlint/cli-16.3.0
chore(deps-dev): bump @commitlint/cli from 16.2.4 to 16.3.0
2022-05-16 08:59:51 +02:00
dependabot[bot]
2c1bde5ddc chore(deps-dev): bump @commitlint/cli from 16.2.4 to 16.3.0
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 16.2.4 to 16.3.0.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v16.3.0/@commitlint/cli)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 06:34:03 +00:00
Kamil Mysliwiec
c10d17c71c Merge pull request #9579 from nestjs/dependabot/npm_and_yarn/concurrently-7.2.0
chore(deps-dev): bump concurrently from 7.1.0 to 7.2.0
2022-05-16 08:29:39 +02:00
Kamil Mysliwiec
956d7f828b Merge pull request #9575 from nestjs/dependabot/npm_and_yarn/apollo-server-core-3.7.0
chore(deps-dev): bump apollo-server-core from 3.6.7 to 3.7.0
2022-05-16 08:29:32 +02:00
Kamil Mysliwiec
d30d990ca9 Merge pull request #9580 from nestjs/dependabot/npm_and_yarn/commitlint/config-angular-16.3.0
chore(deps-dev): bump @commitlint/config-angular from 16.2.4 to 16.3.0
2022-05-16 08:29:07 +02:00
dependabot[bot]
68cf225b28 chore(deps-dev): bump @commitlint/config-angular from 16.2.4 to 16.3.0
Bumps [@commitlint/config-angular](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-angular) from 16.2.4 to 16.3.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/v16.3.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>
2022-05-16 00:17:55 +00:00
dependabot[bot]
df2e404c93 chore(deps-dev): bump concurrently from 7.1.0 to 7.2.0
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.1.0 to 7.2.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.1.0...v7.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 00:16:00 +00:00
Tolga Paksoy
26fd5a7d41 refactor(platform-fastify): allow any truthy value
Co-authored-by: Kamil Mysliwiec <mail@kamilmysliwiec.com>
2022-05-13 17:48:21 +02:00
dependabot[bot]
63ed53f1cb chore(deps-dev): bump apollo-server-core from 3.6.7 to 3.7.0
Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.6.7 to 3.7.0.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.7.0/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 13:30:46 +00:00
Kamil Mysliwiec
1e56057251 Merge pull request #9574 from nestjs/dependabot/npm_and_yarn/point-of-view-5.3.0
chore(deps-dev): bump point-of-view from 5.2.0 to 5.3.0
2022-05-13 15:26:14 +02:00
Kamil Mysliwiec
ce2a4590b4 Merge pull request #9573 from nestjs/dependabot/npm_and_yarn/amqplib-0.9.0
chore(deps-dev): bump amqplib from 0.8.0 to 0.9.0
2022-05-13 15:26:08 +02:00
Kamil Myśliwiec
23760fe43c chore(deps): update ws package to v8 2022-05-13 15:24:43 +02:00
dependabot[bot]
98f4ac8fae chore(deps-dev): bump point-of-view from 5.2.0 to 5.3.0
Bumps [point-of-view](https://github.com/fastify/point-of-view) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/fastify/point-of-view/releases)
- [Commits](https://github.com/fastify/point-of-view/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: point-of-view
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 13:00:37 +00:00
dependabot[bot]
b5a1e7b427 chore(deps-dev): bump amqplib from 0.8.0 to 0.9.0
Bumps [amqplib](https://github.com/squaremo/amqp.node) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/squaremo/amqp.node/releases)
- [Changelog](https://github.com/amqp-node/amqplib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/squaremo/amqp.node/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:59:42 +00:00
Kamil Mysliwiec
521f5867e9 Merge pull request #9550 from nestjs/dependabot/npm_and_yarn/husky-8.0.1
chore(deps-dev): bump husky from 7.0.4 to 8.0.1
2022-05-13 14:56:28 +02:00
Kamil Mysliwiec
4064b96196 Merge pull request #9572 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.9
chore(deps-dev): bump graphql-tools from 8.2.8 to 8.2.9
2022-05-13 14:55:46 +02:00
Kamil Mysliwiec
cc2a242986 Merge pull request #9571 from nestjs/dependabot/npm_and_yarn/sinon-14.0.0
chore(deps-dev): bump sinon from 13.0.2 to 14.0.0
2022-05-13 14:55:34 +02:00
Kamil Mysliwiec
1c2d77cba1 Merge pull request #9570 from nestjs/dependabot/npm_and_yarn/core-js-3.22.5
chore(deps-dev): bump core-js from 3.22.4 to 3.22.5
2022-05-13 14:55:28 +02:00
Kamil Mysliwiec
7f185052f9 Merge pull request #9568 from nestjs/dependabot/npm_and_yarn/eventsource-2.0.2
chore(deps-dev): bump eventsource from 2.0.0 to 2.0.2
2022-05-13 14:55:23 +02:00
Kamil Mysliwiec
81392cb480 Merge pull request #9564 from nestjs/dependabot/npm_and_yarn/nestjs/apollo-10.0.11
chore(deps-dev): bump @nestjs/apollo from 10.0.8 to 10.0.11
2022-05-13 14:55:19 +02:00
Kamil Mysliwiec
c8358b01f3 Merge pull request #9539 from nestjs/dependabot/npm_and_yarn/fastify-formbody-5.3.0
chore(deps): bump fastify-formbody from 5.2.0 to 5.3.0
2022-05-13 14:55:12 +02:00
Kamil Myśliwiec
6f5986d19e chore(): update readme 2022-05-13 14:45:02 +02:00
Kamil Myśliwiec
dea497a66f chore(@nestjs) publish v8.4.5 release 2022-05-13 14:28:13 +02:00
Kamil Myśliwiec
f0a8ac32bc Merge branch 'saurabh-prakash-fix-allow-individual-test-run' 2022-05-13 14:19:11 +02:00
Kamil Myśliwiec
1c0bec8f95 chore(): minor tweak, move mocha hook to hooks folder 2022-05-13 14:19:01 +02:00
dependabot[bot]
dee8396f2d chore(deps-dev): bump graphql-tools from 8.2.8 to 8.2.9
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 8.2.8 to 8.2.9.
- [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@8.2.9/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>
2022-05-13 12:15:29 +00:00
Kamil Myśliwiec
532b5e8c65 Merge branch 'fix-allow-individual-test-run' of https://github.com/saurabh-prakash/nest into saurabh-prakash-fix-allow-individual-test-run 2022-05-13 14:14:50 +02:00
dependabot[bot]
97bfb4af94 chore(deps-dev): bump husky from 7.0.4 to 8.0.1
Bumps [husky](https://github.com/typicode/husky) from 7.0.4 to 8.0.1.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v7.0.4...v8.0.1)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:13:21 +00:00
dependabot[bot]
3be31dde46 chore(deps-dev): bump sinon from 13.0.2 to 14.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 13.0.2 to 14.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v13.0.2...v14.0.0)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:12:46 +00:00
dependabot[bot]
ff2de15bf1 chore(deps-dev): bump @nestjs/apollo from 10.0.8 to 10.0.11
Bumps [@nestjs/apollo](https://github.com/nestjs/graphql) from 10.0.8 to 10.0.11.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.8...v10.0.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:12:17 +00:00
dependabot[bot]
654ba2b6f0 chore(deps): bump fastify-formbody from 5.2.0 to 5.3.0
Bumps [fastify-formbody](https://github.com/fastify/fastify-formbody) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/fastify/fastify-formbody/releases)
- [Commits](https://github.com/fastify/fastify-formbody/commits)

---
updated-dependencies:
- dependency-name: fastify-formbody
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:12:07 +00:00
dependabot[bot]
b7370b2236 chore(deps-dev): bump core-js from 3.22.4 to 3.22.5
Bumps [core-js](https://github.com/zloirock/core-js) from 3.22.4 to 3.22.5.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.22.4...v3.22.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:11:56 +00:00
Kamil Mysliwiec
3c04cbb992 Merge pull request #9566 from nestjs/dependabot/npm_and_yarn/kafkajs-2.0.0
chore(deps-dev): bump kafkajs from 1.16.0 to 2.0.0
2022-05-13 14:10:37 +02:00
Kamil Mysliwiec
24e67a5fa2 Merge pull request #9456 from MyAeroCode/lutz-fix/scoped-injection-with-symbol
fix(core): scoped injection with symbol field name
2022-05-13 14:10:13 +02:00
Kamil Mysliwiec
d14a944a9c Merge pull request #9496 from micalevisk/refactor-builtin-pipes
feat(common): improve extensibility on few built-in pipes
2022-05-13 14:10:08 +02:00
Kamil Mysliwiec
002c11af4f Merge pull request #9506 from ntibi/enhance_circular_dep_error_msg_context
feat(core): enhance circular dependency error message
2022-05-13 14:09:59 +02:00
dependabot[bot]
ace4fe5556 chore(deps-dev): bump eventsource from 2.0.0 to 2.0.2
Bumps [eventsource](https://github.com/EventSource/eventsource) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v2.0.0...v2.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 12:09:15 +00:00
Kamil Mysliwiec
c453522252 Merge pull request #9567 from nestjs/dependabot/npm_and_yarn/middie-6.1.0
chore(deps): bump middie from 6.0.0 to 6.1.0
2022-05-13 14:07:14 +02:00
Kamil Mysliwiec
9dbc23b1ca Merge pull request #9565 from nestjs/dependabot/npm_and_yarn/types/node-17.0.33
chore(deps-dev): bump @types/node from 17.0.23 to 17.0.33
2022-05-13 14:07:04 +02:00
Kamil Mysliwiec
b614b49f4c Merge pull request #9562 from nestjs/dependabot/npm_and_yarn/fast-json-stringify-3.2.0
chore(deps): bump fast-json-stringify from 3.0.3 to 3.2.0
2022-05-13 14:06:48 +02:00
dependabot[bot]
87a24633dd chore(deps): bump middie from 6.0.0 to 6.1.0
Bumps [middie](https://github.com/fastify/middleman) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/fastify/middleman/releases)
- [Commits](https://github.com/fastify/middleman/compare/v6.0.0...v6.1.0)

---
updated-dependencies:
- dependency-name: middie
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 10:50:21 +00:00
dependabot[bot]
7f2ce42a0f chore(deps-dev): bump kafkajs from 1.16.0 to 2.0.0
Bumps [kafkajs](https://github.com/tulios/kafkajs) from 1.16.0 to 2.0.0.
- [Release notes](https://github.com/tulios/kafkajs/releases)
- [Changelog](https://github.com/tulios/kafkajs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tulios/kafkajs/compare/v1.16.0...v2.0.0)

---
updated-dependencies:
- dependency-name: kafkajs
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 10:49:22 +00:00
dependabot[bot]
d97e117269 chore(deps-dev): bump @types/node from 17.0.23 to 17.0.33
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.23 to 17.0.33.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 10:48:23 +00:00
dependabot[bot]
e2715836f8 chore(deps): bump fast-json-stringify from 3.0.3 to 3.2.0
Bumps [fast-json-stringify](https://github.com/fastify/fast-json-stringify) from 3.0.3 to 3.2.0.
- [Release notes](https://github.com/fastify/fast-json-stringify/releases)
- [Commits](https://github.com/fastify/fast-json-stringify/commits/v3.2.0)

---
updated-dependencies:
- dependency-name: fast-json-stringify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 10:46:33 +00:00
Kamil Mysliwiec
de28fa349b Merge pull request #8865 from Tony133/sample-05/add-test-e2e
sample(05-sql-typeorm): added test e2e
2022-05-13 12:45:54 +02:00
Kamil Mysliwiec
0fed555560 Merge pull request #9559 from nestjs/dependabot/npm_and_yarn/commitlint/cli-16.2.4
chore(deps-dev): bump @commitlint/cli from 16.2.3 to 16.2.4
2022-05-13 12:40:58 +02:00
Kamil Mysliwiec
5376136979 Merge pull request #9560 from nestjs/dependabot/npm_and_yarn/supertest-6.2.3
chore(deps-dev): bump supertest from 6.2.2 to 6.2.3
2022-05-13 12:40:54 +02:00
Kamil Mysliwiec
e5565fc4c2 Merge pull request #9561 from nestjs/dependabot/npm_and_yarn/grpc/proto-loader-0.6.12
chore(deps-dev): bump @grpc/proto-loader from 0.6.9 to 0.6.12
2022-05-13 12:40:49 +02:00
Kamil Mysliwiec
1d8374e007 Merge pull request #9563 from nestjs/dependabot/npm_and_yarn/apollo-server-express-3.7.0
chore(deps-dev): bump apollo-server-express from 3.6.7 to 3.7.0
2022-05-13 12:40:30 +02:00
dependabot[bot]
0a077c94b4 chore(deps-dev): bump apollo-server-express from 3.6.7 to 3.7.0
Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 3.6.7 to 3.7.0.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-express@3.7.0/packages/apollo-server-express)

---
updated-dependencies:
- dependency-name: apollo-server-express
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 07:17:29 +00:00
dependabot[bot]
cf37e61bc1 chore(deps-dev): bump @grpc/proto-loader from 0.6.9 to 0.6.12
Bumps [@grpc/proto-loader](https://github.com/grpc/grpc-node) from 0.6.9 to 0.6.12.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/proto-loader@0.6.9...@grpc/proto-loader@0.6.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 07:15:47 +00:00
dependabot[bot]
03ab77cb74 chore(deps-dev): bump supertest from 6.2.2 to 6.2.3
Bumps [supertest](https://github.com/visionmedia/supertest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/visionmedia/supertest/releases)
- [Commits](https://github.com/visionmedia/supertest/compare/v6.2.2...v6.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 07:14:53 +00:00
dependabot[bot]
dafa1cf754 chore(deps-dev): bump @commitlint/cli from 16.2.3 to 16.2.4
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 16.2.3 to 16.2.4.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v16.2.4/@commitlint/cli)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 07:14:03 +00:00
Kamil Mysliwiec
0a1c7e9768 Merge pull request #9536 from nestjs/dependabot/npm_and_yarn/socket.io-4.5.0
chore(deps): bump socket.io from 4.4.1 to 4.5.0
2022-05-13 09:11:22 +02:00
Kamil Mysliwiec
44cd4573f9 Merge pull request #9551 from nestjs/dependabot/npm_and_yarn/mongoose-6.3.3
chore(deps-dev): bump mongoose from 6.3.2 to 6.3.3
2022-05-13 09:11:17 +02:00
Kamil Mysliwiec
ea4f9d0edc Merge pull request #9549 from nestjs/dependabot/npm_and_yarn/express-4.18.1
chore(deps): bump express from 4.17.3 to 4.18.1
2022-05-13 09:11:12 +02:00
Kamil Mysliwiec
8f237751b3 Merge pull request #9548 from nestjs/dependabot/npm_and_yarn/axios-0.27.2
chore(deps): bump axios from 0.26.1 to 0.27.2
2022-05-13 09:11:08 +02:00
Kamil Mysliwiec
6ded88c0c9 Merge pull request #9538 from nestjs/dependabot/npm_and_yarn/engine.io-client-6.2.2
chore(deps-dev): bump engine.io-client from 6.1.1 to 6.2.2
2022-05-13 09:10:59 +02:00
dependabot[bot]
c77bef9e56 chore(deps-dev): bump mongoose from 6.3.2 to 6.3.3
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.3.2 to 6.3.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/6.3.2...6.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-10 00:07:32 +00:00
dependabot[bot]
8584af1ac5 chore(deps): bump express from 4.17.3 to 4.18.1
Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.18.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.3...4.18.1)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-10 00:04:46 +00:00
dependabot[bot]
ae2cde105d chore(deps): bump axios from 0.26.1 to 0.27.2
Bumps [axios](https://github.com/axios/axios) from 0.26.1 to 0.27.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.26.1...v0.27.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-10 00:03:14 +00:00
dependabot[bot]
2db088fa14 chore(deps): bump socket.io from 4.4.1 to 4.5.0
Bumps [socket.io](https://github.com/socketio/socket.io) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/4.4.1...4.5.0)

---
updated-dependencies:
- dependency-name: socket.io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 10:09:14 +00:00
Kamil Mysliwiec
2f9f2edf89 Merge pull request #9533 from nestjs/dependabot/npm_and_yarn/fastify-static-4.7.0
chore(deps-dev): bump fastify-static from 4.6.1 to 4.7.0
2022-05-09 12:05:38 +02:00
Kamil Mysliwiec
74e3f5fff3 Merge pull request #9535 from nestjs/dependabot/npm_and_yarn/amqp-connection-manager-4.1.3
chore(deps-dev): bump amqp-connection-manager from 4.1.2 to 4.1.3
2022-05-09 12:04:56 +02:00
Kamil Mysliwiec
37f7b1cc3a Merge pull request #9537 from nestjs/dependabot/npm_and_yarn/typescript-4.6.4
chore(deps-dev): bump typescript from 4.6.3 to 4.6.4
2022-05-09 12:04:42 +02:00
Kamil Mysliwiec
0b137ff1c5 Merge pull request #9540 from nestjs/dependabot/npm_and_yarn/fastify-cors-6.1.0
chore(deps): bump fastify-cors from 6.0.3 to 6.1.0
2022-05-09 12:04:29 +02:00
Alexander Friesen
e7087adcb7 chore: update package-lock 2022-05-07 13:15:26 +02:00
Alex
a3cfb1717a Merge branch 'master' into master 2022-05-07 13:10:53 +02:00
dependabot[bot]
e0255e7a1e chore(deps): bump fastify-cors from 6.0.3 to 6.1.0
Bumps [fastify-cors](https://github.com/fastify/fastify-cors) from 6.0.3 to 6.1.0.
- [Release notes](https://github.com/fastify/fastify-cors/releases)
- [Commits](https://github.com/fastify/fastify-cors/commits)

---
updated-dependencies:
- dependency-name: fastify-cors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 17:00:43 +00:00
dependabot[bot]
341f0518f9 chore(deps-dev): bump fastify-static from 4.6.1 to 4.7.0
Bumps [fastify-static](https://github.com/fastify/fastify-static) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/fastify/fastify-static/releases)
- [Commits](https://github.com/fastify/fastify-static/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 17:00:34 +00:00
dependabot[bot]
2d8f838aea chore(deps-dev): bump engine.io-client from 6.1.1 to 6.2.2
Bumps [engine.io-client](https://github.com/socketio/engine.io-client) from 6.1.1 to 6.2.2.
- [Release notes](https://github.com/socketio/engine.io-client/releases)
- [Changelog](https://github.com/socketio/engine.io-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io-client/compare/6.1.1...6.2.2)

---
updated-dependencies:
- dependency-name: engine.io-client
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 16:58:57 +00:00
dependabot[bot]
7d84e835f4 chore(deps-dev): bump typescript from 4.6.3 to 4.6.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.3 to 4.6.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.3...v4.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 16:58:09 +00:00
Kamil Mysliwiec
d1d1a16eb4 Merge pull request #9532 from nestjs/dependabot/npm_and_yarn/lint-staged-12.4.1
chore(deps-dev): bump lint-staged from 12.3.7 to 12.4.1
2022-05-06 18:57:11 +02:00
Kamil Myśliwiec
4d6216695d chore(): cleanup, remove initialize function calls 2022-05-06 18:57:03 +02:00
dependabot[bot]
8d7d63daa4 chore(deps-dev): bump amqp-connection-manager from 4.1.2 to 4.1.3
Bumps [amqp-connection-manager](https://github.com/jwalton/node-amqp-connection-manager) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/jwalton/node-amqp-connection-manager/releases)
- [Changelog](https://github.com/jwalton/node-amqp-connection-manager/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwalton/node-amqp-connection-manager/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: amqp-connection-manager
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 16:56:20 +00:00
dependabot[bot]
37f580c0a2 chore(deps-dev): bump lint-staged from 12.3.7 to 12.4.1
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.3.7 to 12.4.1.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v12.3.7...v12.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 16:56:19 +00:00
Kamil Mysliwiec
9cd425cac7 Merge pull request #9524 from nestjs/dependabot/npm_and_yarn/fastify-multipart-5.4.0
chore(deps-dev): bump fastify-multipart from 5.3.1 to 5.4.0
2022-05-06 18:55:53 +02:00
Kamil Mysliwiec
3ceeb114af Merge pull request #9530 from nestjs/dependabot/npm_and_yarn/commitlint/config-angular-16.2.4
chore(deps-dev): bump @commitlint/config-angular from 16.2.3 to 16.2.4
2022-05-06 18:55:46 +02:00
Kamil Mysliwiec
340dcaaef4 Merge pull request #9531 from nestjs/dependabot/npm_and_yarn/nodemon-2.0.16
chore(deps-dev): bump nodemon from 2.0.15 to 2.0.16
2022-05-06 18:53:53 +02:00
Kamil Mysliwiec
92bc4556f7 Merge pull request #9529 from nestjs/dependabot/npm_and_yarn/tslib-2.4.0
chore(deps): bump tslib from 2.3.1 to 2.4.0
2022-05-06 18:53:47 +02:00
Kamil Mysliwiec
5eedf8a9b1 Update Readme.md 2022-05-05 11:36:30 +02:00
dependabot[bot]
13f71afa60 chore(deps-dev): bump nodemon from 2.0.15 to 2.0.16
Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.15 to 2.0.16.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.15...v2.0.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 09:26:47 +00:00
dependabot[bot]
e17dc7b4a8 chore(deps-dev): bump @commitlint/config-angular from 16.2.3 to 16.2.4
Bumps [@commitlint/config-angular](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-angular) from 16.2.3 to 16.2.4.
- [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/v16.2.4/@commitlint/config-angular)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 09:25:23 +00:00
dependabot[bot]
bb38f328e3 chore(deps): bump tslib from 2.3.1 to 2.4.0
Bumps [tslib](https://github.com/Microsoft/tslib) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/Microsoft/tslib/releases)
- [Commits](https://github.com/Microsoft/tslib/compare/2.3.1...2.4.0)

---
updated-dependencies:
- dependency-name: tslib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 09:24:30 +00:00
dependabot[bot]
d9eeda4d79 chore(deps-dev): bump fastify-multipart from 5.3.1 to 5.4.0
Bumps [fastify-multipart](https://github.com/fastify/fastify-multipart) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/fastify/fastify-multipart/releases)
- [Commits](https://github.com/fastify/fastify-multipart/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 09:23:46 +00:00
Kamil Mysliwiec
9ba4903419 Merge pull request #9523 from nestjs/dependabot/npm_and_yarn/types/mocha-9.1.1
chore(deps-dev): bump @types/mocha from 9.1.0 to 9.1.1
2022-05-05 11:21:38 +02:00
Kamil Mysliwiec
7192d4de53 Merge pull request #9525 from nestjs/dependabot/npm_and_yarn/socket.io-client-4.5.0
chore(deps-dev): bump socket.io-client from 4.4.1 to 4.5.0
2022-05-05 11:21:30 +02:00
Kamil Mysliwiec
9cd4fefd3a Merge pull request #9526 from nestjs/dependabot/npm_and_yarn/fastify-3.29.0
chore(deps): bump fastify from 3.28.0 to 3.29.0
2022-05-05 11:21:26 +02:00
Kamil Mysliwiec
84c4589497 Merge pull request #9527 from nestjs/dependabot/npm_and_yarn/light-my-request-4.10.1
chore(deps): bump light-my-request from 4.9.0 to 4.10.1
2022-05-05 11:21:21 +02:00
Kamil Mysliwiec
f3a31c8ffd Merge pull request #9528 from nestjs/dependabot/npm_and_yarn/core-js-3.22.4
chore(deps-dev): bump core-js from 3.21.1 to 3.22.4
2022-05-05 11:21:06 +02:00
dependabot[bot]
1aa7b946c6 chore(deps-dev): bump core-js from 3.21.1 to 3.22.4
Bumps [core-js](https://github.com/zloirock/core-js) from 3.21.1 to 3.22.4.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.21.1...v3.22.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 00:12:03 +00:00
dependabot[bot]
38b0f8b69e chore(deps): bump light-my-request from 4.9.0 to 4.10.1
Bumps [light-my-request](https://github.com/fastify/light-my-request) from 4.9.0 to 4.10.1.
- [Release notes](https://github.com/fastify/light-my-request/releases)
- [Commits](https://github.com/fastify/light-my-request/compare/v4.9.0...v4.10.1)

---
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>
2022-05-05 00:10:08 +00:00
dependabot[bot]
df6e227da4 chore(deps): bump fastify from 3.28.0 to 3.29.0
Bumps [fastify](https://github.com/fastify/fastify) from 3.28.0 to 3.29.0.
- [Release notes](https://github.com/fastify/fastify/releases)
- [Commits](https://github.com/fastify/fastify/compare/v3.28.0...v3.29.0)

---
updated-dependencies:
- dependency-name: fastify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 00:09:00 +00:00
dependabot[bot]
0b82026efc chore(deps-dev): bump socket.io-client from 4.4.1 to 4.5.0
Bumps [socket.io-client](https://github.com/socketio/socket.io-client) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/socketio/socket.io-client/releases)
- [Changelog](https://github.com/socketio/socket.io-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-client/compare/4.4.1...4.5.0)

---
updated-dependencies:
- dependency-name: socket.io-client
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-05 00:07:34 +00:00
dependabot[bot]
85c06f3a1e chore(deps-dev): bump @types/mocha from 9.1.0 to 9.1.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 9.1.0 to 9.1.1.
- [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>
2022-05-05 00:05:14 +00:00
Alexander Friesen
0d0a6c7657 chore: define optional deps 2022-05-04 20:23:16 +02:00
Kamil Mysliwiec
581ba5aec6 Merge pull request #9512 from nestjs/dependabot/npm_and_yarn/mongoose-6.3.2
chore(deps-dev): bump mongoose from 6.2.10 to 6.3.2
2022-05-04 14:21:19 +02:00
Kamil Mysliwiec
6c7c1d63dc Merge pull request #9513 from nestjs/dependabot/npm_and_yarn/clang-format-1.8.0
chore(deps-dev): bump clang-format from 1.6.0 to 1.8.0
2022-05-04 14:21:09 +02:00
Kamil Mysliwiec
19b210337f Merge pull request #9460 from nestjs/dependabot/npm_and_yarn/types/chai-4.3.1
chore(deps-dev): bump @types/chai from 4.3.0 to 4.3.1
2022-05-04 14:20:56 +02:00
dependabot[bot]
6731aaf59b chore(deps-dev): bump clang-format from 1.6.0 to 1.8.0
Bumps [clang-format](https://github.com/angular/clang-format) from 1.6.0 to 1.8.0.
- [Release notes](https://github.com/angular/clang-format/releases)
- [Commits](https://github.com/angular/clang-format/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 11:03:14 +00:00
Kamil Mysliwiec
208390e98f Merge pull request #9461 from nestjs/dependabot/npm_and_yarn/amqp-connection-manager-4.1.2
chore(deps-dev): bump amqp-connection-manager from 4.1.1 to 4.1.2
2022-05-04 13:01:02 +02:00
Kamil Mysliwiec
0e75c7db31 Merge pull request #9466 from nestjs/dependabot/npm_and_yarn/sinon-13.0.2
chore(deps-dev): bump sinon from 13.0.1 to 13.0.2
2022-05-04 13:00:58 +02:00
Kamil Mysliwiec
fc19ec532d Merge pull request #9478 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.8
chore(deps-dev): bump graphql-tools from 8.2.5 to 8.2.8
2022-05-04 13:00:48 +02:00
Kamil Mysliwiec
fae3431e81 Merge pull request #9482 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.6.7
chore(deps-dev): bump @grpc/grpc-js from 1.6.2 to 1.6.7
2022-05-04 13:00:44 +02:00
Kamil Mysliwiec
a5eb9b3d82 Merge pull request #9493 from nestjs/renovate/npm-lodash-vulnerability
chore(deps): update dependency lodash to 4.17.21 [security]
2022-05-04 13:00:32 +02:00
Kamil Mysliwiec
73ddac2005 Merge pull request #9494 from nestjs/renovate/npm-mem-vulnerability
chore(deps): update dependency mem to 4.0.0 [security]
2022-05-04 13:00:27 +02:00
Kamil Mysliwiec
02d9f4941e Merge pull request #9499 from nestjs/dependabot/github_actions/github/codeql-action-2
chore(deps): bump github/codeql-action from 1 to 2
2022-05-04 12:59:45 +02:00
Kamil Mysliwiec
d21c30f7bc Merge pull request #9505 from nestjs/renovate/npm-cross-fetch-vulnerability
chore(deps): update dependency cross-fetch to 3.1.5 [security]
2022-05-04 12:59:30 +02:00
Renovate Bot
82b019dae0 chore(deps): update dependency mem to 4.0.0 [security] 2022-05-04 02:57:27 +00:00
Renovate Bot
2574a79a8b chore(deps): update dependency lodash to 4.17.21 [security] 2022-05-04 02:55:41 +00:00
Alexander Friesen
87969fba5f chore: update interfaces 2022-05-03 20:00:45 +02:00
Renovate Bot
55371752ba chore(deps): update dependency cross-fetch to 3.1.5 [security] 2022-05-03 15:49:36 +00:00
dependabot[bot]
560379c166 chore(deps-dev): bump mongoose from 6.2.10 to 6.3.2
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.10 to 6.3.2.
- [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/6.2.10...6.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-03 00:11:03 +00:00
Alexander Friesen
c53f7f2cde chore: update package-lock 2022-05-01 13:07:32 +02:00
Alexander Friesen
b11959c979 chore: update fastify 2022-04-30 00:47:08 +02:00
ntibi
9a8adbee88 feat(core): enhance circular dependency error message 2022-04-29 18:08:25 +02:00
dependabot[bot]
7685993942 chore(deps): bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 00:52:00 +00:00
Micael Levi (@micalevisk)
4ce5877b2e feat(common): improve extensibility on built-in pipes 2022-04-24 18:09:52 -04:00
Micael Levi (@micalevisk)
bc0a1dedf8 fix(core,websockets): use rxjs when checking if is an observable 2022-04-24 15:42:14 -04:00
Micael Levi (@micalevisk)
d51c7289a8 test(websockets): add odd input on pickResult method 2022-04-24 15:42:14 -04:00
Micael Levi (@micalevisk)
41850c0920 test(core): add odd input on transformToResult method 2022-04-24 15:42:14 -04:00
Tolga Paksoy
4fb646ec29 test(platform): ensure json parsed body works as well 2022-04-22 15:11:02 +02:00
Tolga Paksoy
43089c5b28 fix(platform): use RawBodyRequest interface instead of monkeypatch
To access the raw body of a request use:

* `RawBodyRequest<Request>` on express
* `RawBodyRequest<FastifyRequest>` on fastify
2022-04-22 15:10:03 +02:00
Tolga Paksoy
d067144331 fix(platform-express): add stricter types for raw body options 2022-04-22 13:02:58 +02:00
Kamil Mysliwiec
1f6fca5f55 Merge pull request #9485 from OSA413/patch-1
fix: prevent handle leak in default e2e test
2022-04-22 08:59:58 +02:00
Kamil Mysliwiec
8036e2a59b Update sample/30-event-emitter/test/app.e2e-spec.ts 2022-04-22 08:59:52 +02:00
Oleg "OSA413" Sokolov
b1844b6be4 Update sample/30-event-emitter/test/app.e2e-spec.ts
Co-authored-by: Micael Levi L. Cavalcante <mllc@icomp.ufam.edu.br>
2022-04-22 03:50:31 +05:00
Oleg "OSA413" Sokolov
f14d2f2714 Updated according to the suggestions 2022-04-21 22:35:52 +05:00
Oleg "OSA413" Sokolov
de044a3daf fix: prevent handle leak in default e2e test 2022-04-21 22:24:44 +05:00
dependabot[bot]
3d9bd7fcfa chore(deps-dev): bump @grpc/grpc-js from 1.6.2 to 1.6.7
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.6.2 to 1.6.7.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.6.2...@grpc/grpc-js@1.6.7)

---
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>
2022-04-21 00:17:09 +00:00
dependabot[bot]
fd40c9bea4 chore(deps-dev): bump graphql-tools from 8.2.5 to 8.2.8
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 8.2.5 to 8.2.8.
- [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@8.2.8/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>
2022-04-20 00:14:26 +00:00
Saurabh Prakash
e0a4ed39fe fix(): individual test run 2022-04-19 02:29:20 +05:30
Emre Sahin
844bbbb6fc feat(microservices): Introduce producerOnlyMode to ClientKafka
This feature flag enables users to skip the consumer group creation and
rebalancing and allows to only act as a producer on Kafka.

Resolves: #7259
2022-04-15 15:22:47 +02:00
dependabot[bot]
ef6c770bec chore(deps-dev): bump sinon from 13.0.1 to 13.0.2
Bumps [sinon](https://github.com/sinonjs/sinon) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v13.0.1...v13.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 00:04:42 +00:00
dependabot[bot]
1a1f39fa4f chore(deps-dev): bump amqp-connection-manager from 4.1.1 to 4.1.2
Bumps [amqp-connection-manager](https://github.com/jwalton/node-amqp-connection-manager) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/jwalton/node-amqp-connection-manager/releases)
- [Changelog](https://github.com/jwalton/node-amqp-connection-manager/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwalton/node-amqp-connection-manager/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: amqp-connection-manager
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-14 00:07:31 +00:00
dependabot[bot]
e80a14f447 chore(deps-dev): bump @types/chai from 4.3.0 to 4.3.1
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-14 00:04:56 +00:00
Kamil Mysliwiec
d9d628d112 Merge pull request #9453 from nestjs/dependabot/npm_and_yarn/sample/27-scheduling/moment-2.29.2
chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/27-scheduling
2022-04-11 08:22:47 +02:00
Kamil Mysliwiec
525f4f066c Merge pull request #9454 from nestjs/dependabot/npm_and_yarn/sample/26-queues/moment-2.29.2
chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/26-queues
2022-04-11 08:22:38 +02:00
dependabot[bot]
1089eedec4 chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/27-scheduling
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 06:22:36 +00:00
dependabot[bot]
a2d65f3d01 chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/26-queues
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 06:22:33 +00:00
Kamil Mysliwiec
e55cad38d9 Merge pull request #9447 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.5
chore(deps-dev): bump graphql-tools from 8.2.4 to 8.2.5
2022-04-11 08:22:32 +02:00
Kamil Mysliwiec
41bf2dc9bf Merge pull request #9448 from nestjs/dependabot/npm_and_yarn/cache-manager-3.6.1
chore(deps-dev): bump cache-manager from 3.6.0 to 3.6.1
2022-04-11 08:22:27 +02:00
Kamil Mysliwiec
c5c41495a2 Merge pull request #9451 from nestjs/dependabot/npm_and_yarn/sample/07-sequelize/moment-2.29.2
chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/07-sequelize
2022-04-11 08:22:21 +02:00
Kamil Mysliwiec
eed06091d3 Merge pull request #9452 from nestjs/dependabot/npm_and_yarn/moment-2.29.2
chore(deps): bump moment from 2.24.0 to 2.29.2
2022-04-11 08:21:28 +02:00
Lutz
3601f1a171 test(core): nest application context 2022-04-10 10:39:47 +09:00
Lutz
a7ba3e0dc2 test(core): add dependency metadata test 2022-04-10 10:00:08 +09:00
Lutz
4c649edc2d fix(core): scoped injection with symbol key issue 2022-04-09 23:22:04 +09:00
Lutz
acac12790c feat(core): support symbol key 2022-04-09 23:19:35 +09:00
dependabot[bot]
4177feabdc chore(deps): bump moment from 2.24.0 to 2.29.2
Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-09 13:29:06 +00:00
dependabot[bot]
381fc42301 chore(deps): bump moment from 2.29.1 to 2.29.2 in /sample/07-sequelize
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-09 13:28:16 +00:00
Lutz
fe9c8d071c Merge branch 'nestjs:master' into master 2022-04-09 14:07:06 +09:00
dependabot[bot]
2d342a1b49 chore(deps-dev): bump cache-manager from 3.6.0 to 3.6.1
Bumps [cache-manager](https://github.com/BryanDonovan/node-cache-manager) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/BryanDonovan/node-cache-manager/releases)
- [Changelog](https://github.com/BryanDonovan/node-cache-manager/blob/master/History.md)
- [Commits](https://github.com/BryanDonovan/node-cache-manager/compare/3.6.0...3.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-08 00:09:39 +00:00
dependabot[bot]
c7a72bfd33 chore(deps-dev): bump graphql-tools from 8.2.4 to 8.2.5
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 8.2.4 to 8.2.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@8.2.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>
2022-04-08 00:04:01 +00:00
Kamil Myśliwiec
65d7f1e8ea chore(): rename prepublish to prepublish only 2022-04-07 14:00:08 +02:00
Kamil Myśliwiec
a615d70044 chore(): update package.json and readme files 2022-04-07 13:46:18 +02:00
Kamil Myśliwiec
785db640aa chore(@nestjs) publish v8.4.4 release 2022-04-07 13:39:57 +02:00
Kamil Mysliwiec
625d3672d4 Merge pull request #9444 from micalevisk/feat-relax-pipes-access
feat(common): change `private` modifer on built-in pipes to `protected`
2022-04-07 13:33:11 +02:00
Kamil Mysliwiec
ffdefbf856 Merge pull request #9441 from nestjs/dependabot/npm_and_yarn/eslint-plugin-import-2.26.0
chore(deps-dev): bump eslint-plugin-import from 2.25.4 to 2.26.0
2022-04-07 13:32:39 +02:00
Kamil Mysliwiec
be6848dac9 Merge pull request #9435 from jonahsnider/feat/streamable-file-auto-length
feat(common): set default StreamableFile length automatically when possible
2022-04-07 13:32:29 +02:00
Kamil Mysliwiec
45872ae2ea Merge pull request #9425 from nestjs/fix/multiple-rmq-client-urls
fix(microservices): multiple rmq client urls issue #9364
2022-04-07 13:32:17 +02:00
dependabot[bot]
21e3293052 chore(deps-dev): bump eslint-plugin-import from 2.25.4 to 2.26.0
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.25.4 to 2.26.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.25.4...v2.26.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 11:27:08 +00:00
Kamil Mysliwiec
53d88e5952 Update Readme.md 2022-04-06 13:22:52 +02:00
Kamil Mysliwiec
efa45f6a45 Merge pull request #9442 from nestjs/dependabot/npm_and_yarn/fastify-3.28.0
chore(deps): bump fastify from 3.27.4 to 3.28.0
2022-04-06 13:21:29 +02:00
Micael Levi (@micalevisk)
d884e569f0 feat(common): change private modifer on built-in pipes to protected 2022-04-05 22:44:24 -04:00
dependabot[bot]
b389f5aa4e chore(deps): bump fastify from 3.27.4 to 3.28.0
Bumps [fastify](https://github.com/fastify/fastify) from 3.27.4 to 3.28.0.
- [Release notes](https://github.com/fastify/fastify/releases)
- [Commits](https://github.com/fastify/fastify/compare/v3.27.4...v3.28.0)

---
updated-dependencies:
- dependency-name: fastify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 00:04:34 +00:00
Kamil Mysliwiec
8864699539 Merge pull request #9439 from nestjs/renovate/npm-path-parse-vulnerability
chore(deps): update dependency path-parse to 1.0.7 [security]
2022-04-05 09:17:39 +02:00
Kamil Mysliwiec
97613abf26 Merge pull request #9438 from nestjs/dependabot/npm_and_yarn/mongoose-6.2.10
chore(deps-dev): bump mongoose from 6.2.9 to 6.2.10
2022-04-05 09:17:32 +02:00
Kamil Mysliwiec
30b6e8c494 Merge pull request #9437 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.6.2
chore(deps-dev): bump @grpc/grpc-js from 1.6.1 to 1.6.2
2022-04-05 09:17:25 +02:00
Kamil Mysliwiec
9497c8a8ef Merge pull request #9343 from nestjs/dependabot/npm_and_yarn/commitlint/cli-16.2.3
chore(deps-dev): bump @commitlint/cli from 16.2.1 to 16.2.3
2022-04-05 09:17:13 +02:00
Renovate Bot
8d96b09349 chore(deps): update dependency path-parse to 1.0.7 [security] 2022-04-05 04:49:55 +00:00
dependabot[bot]
a3b2dde463 chore(deps-dev): bump mongoose from 6.2.9 to 6.2.10
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.9 to 6.2.10.
- [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/6.2.9...6.2.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-05 00:08:50 +00:00
dependabot[bot]
2308640395 chore(deps-dev): bump @grpc/grpc-js from 1.6.1 to 1.6.2
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.6.1...@grpc/grpc-js@1.6.2)

---
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>
2022-04-05 00:06:54 +00:00
Jonah Snider
215878ec59 feat(common): set default StreamableFile length automatically when possible 2022-04-04 12:36:11 -07:00
dependabot[bot]
fc5bd1dfe8 chore(deps-dev): bump @commitlint/cli from 16.2.1 to 16.2.3
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 16.2.1 to 16.2.3.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v16.2.3/@commitlint/cli)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 07:03:32 +00:00
Kamil Mysliwiec
12c899f8b3 Merge pull request #9418 from nestjs/dependabot/npm_and_yarn/apollo-server-core-3.6.7
chore(deps-dev): bump apollo-server-core from 3.6.6 to 3.6.7
2022-04-04 09:01:00 +02:00
Kamil Mysliwiec
1622e9a6e9 Merge pull request #9423 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.4
chore(deps-dev): bump graphql-tools from 8.2.3 to 8.2.4
2022-04-04 09:00:56 +02:00
Kamil Mysliwiec
5910bd60f9 Merge pull request #9431 from nestjs/dependabot/npm_and_yarn/body-parser-1.20.0
chore(deps): bump body-parser from 1.19.2 to 1.20.0
2022-04-04 09:00:51 +02:00
Kamil Mysliwiec
b267c63012 Merge pull request #9432 from nestjs/dependabot/npm_and_yarn/concurrently-7.1.0
chore(deps-dev): bump concurrently from 7.0.0 to 7.1.0
2022-04-04 09:00:46 +02:00
Kamil Mysliwiec
926e06a211 Merge pull request #9433 from nestjs/dependabot/npm_and_yarn/prettier-2.6.2
chore(deps-dev): bump prettier from 2.6.1 to 2.6.2
2022-04-04 09:00:41 +02:00
Kamil Mysliwiec
faa32ab9a6 Merge pull request #9434 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.6.1
chore(deps-dev): bump @grpc/grpc-js from 1.5.10 to 1.6.1
2022-04-04 09:00:29 +02:00
dependabot[bot]
a2c9570f5e chore(deps-dev): bump @grpc/grpc-js from 1.5.10 to 1.6.1
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.5.10 to 1.6.1.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.5.10...@grpc/grpc-js@1.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 00:16:21 +00:00
dependabot[bot]
088111874e chore(deps-dev): bump prettier from 2.6.1 to 2.6.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.1 to 2.6.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/2.6.1...2.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 00:13:31 +00:00
dependabot[bot]
890d2beb47 chore(deps-dev): bump concurrently from 7.0.0 to 7.1.0
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.0.0...v7.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 00:11:17 +00:00
dependabot[bot]
5745b24608 chore(deps): bump body-parser from 1.19.2 to 1.20.0
Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.19.2 to 1.20.0.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.19.2...1.20.0)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 00:09:20 +00:00
Tolga Paksoy
43fa5bc4c5 fix(common): add raw body app option as a non-breaking change 2022-04-01 17:14:00 +02:00
Kamil Myśliwiec
e971856555 fix(microservices): add default urls value 2022-04-01 16:53:53 +02:00
Kamil Myśliwiec
af0e4001ff fix(microservices): multiple rmq client urls issue #9364 2022-04-01 16:51:46 +02:00
dependabot[bot]
123dd469ee chore(deps-dev): bump apollo-server-core from 3.6.6 to 3.6.7
Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.6.6 to 3.6.7.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.6.7/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 08:30:15 +00:00
dependabot[bot]
e5e8252bcd chore(deps-dev): bump graphql-tools from 8.2.3 to 8.2.4
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 8.2.3 to 8.2.4.
- [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@8.2.4/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>
2022-04-01 08:28:01 +00:00
Kamil Mysliwiec
4f91d6f4d4 Merge pull request #9409 from nestjs/dependabot/npm_and_yarn/point-of-view-5.2.0
chore(deps-dev): bump point-of-view from 5.1.0 to 5.2.0
2022-04-01 10:26:39 +02:00
Kamil Mysliwiec
9431b6cfe9 Merge pull request #9410 from nestjs/dependabot/npm_and_yarn/mongoose-6.2.9
chore(deps-dev): bump mongoose from 6.2.8 to 6.2.9
2022-04-01 10:26:34 +02:00
Kamil Mysliwiec
3a8b0ffe90 Merge pull request #9411 from nestjs/dependabot/npm_and_yarn/typescript-4.6.3
chore(deps-dev): bump typescript from 4.6.2 to 4.6.3
2022-04-01 10:23:51 +02:00
Kamil Mysliwiec
02d80be75e Merge pull request #9419 from nestjs/dependabot/npm_and_yarn/cli-color-2.0.2
chore(deps): bump cli-color from 2.0.1 to 2.0.2
2022-04-01 10:23:41 +02:00
Kamil Mysliwiec
aab08839cc Merge pull request #9408 from nestjs/dependabot/npm_and_yarn/types/node-17.0.23
chore(deps-dev): bump @types/node from 17.0.21 to 17.0.23
2022-04-01 10:23:28 +02:00
dependabot[bot]
75188b79a3 chore(deps-dev): bump mongoose from 6.2.8 to 6.2.9
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.8 to 6.2.9.
- [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/6.2.8...6.2.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 18:46:28 +00:00
dependabot[bot]
d3cccbe4d5 chore(deps-dev): bump point-of-view from 5.1.0 to 5.2.0
Bumps [point-of-view](https://github.com/fastify/point-of-view) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/fastify/point-of-view/releases)
- [Commits](https://github.com/fastify/point-of-view/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: point-of-view
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 18:46:24 +00:00
dependabot[bot]
31b5affe40 chore(deps-dev): bump typescript from 4.6.2 to 4.6.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.2 to 4.6.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.2...v4.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 18:46:09 +00:00
dependabot[bot]
604a10b3b6 chore(deps): bump cli-color from 2.0.1 to 2.0.2
Bumps [cli-color](https://github.com/medikoo/cli-color) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/medikoo/cli-color/releases)
- [Changelog](https://github.com/medikoo/cli-color/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/cli-color/compare/v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: cli-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 18:44:51 +00:00
dependabot[bot]
f23486f943 chore(deps-dev): bump @types/node from 17.0.21 to 17.0.23
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.21 to 17.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 18:44:17 +00:00
Kamil Mysliwiec
b1badde2ea Merge pull request #9404 from nestjs/dependabot/npm_and_yarn/sample/31-graphql-federation-code-first/gateway/ansi-regex-5.0.1
chore(deps): bump ansi-regex from 5.0.0 to 5.0.1 in /sample/31-graphql-federation-code-first/gateway
2022-03-31 20:41:07 +02:00
Kamil Mysliwiec
048da5b823 Merge pull request #9398 from nestjs/dependabot/npm_and_yarn/sample/25-dynamic-modules/ansi-regex-5.0.1
chore(deps): bump ansi-regex from 5.0.0 to 5.0.1 in /sample/25-dynamic-modules
2022-03-31 20:41:00 +02:00
Kamil Mysliwiec
a718cd9e3d Merge pull request #9407 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.5.10
chore(deps-dev): bump @grpc/grpc-js from 1.5.9 to 1.5.10
2022-03-31 20:40:53 +02:00
Kamil Mysliwiec
72f6312822 Merge pull request #9412 from nestjs/renovate/npm-ansi-regex-vulnerability
chore(deps): update dependency ansi-regex [security]
2022-03-31 20:40:30 +02:00
Kamil Mysliwiec
03bc1a4875 Merge pull request #9415 from nestjs/dependabot/npm_and_yarn/apollo-server-express-3.6.7
chore(deps-dev): bump apollo-server-express from 3.6.6 to 3.6.7
2022-03-31 20:40:21 +02:00
Renovate Bot
dd00c82fdf chore(deps): update dependency ansi-regex [security] 2022-03-31 17:14:17 +00:00
dependabot[bot]
3368e75377 chore(deps-dev): bump apollo-server-express from 3.6.6 to 3.6.7
Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 3.6.6 to 3.6.7.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-express@3.6.7/packages/apollo-server-express)

---
updated-dependencies:
- dependency-name: apollo-server-express
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 00:05:14 +00:00
dependabot[bot]
65fb78a77d chore(deps-dev): bump @grpc/grpc-js from 1.5.9 to 1.5.10
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.5.9 to 1.5.10.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.5.9...@grpc/grpc-js@1.5.10)

---
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>
2022-03-29 08:10:45 +00:00
Kamil Mysliwiec
31001bbb87 Merge pull request #9360 from nestjs/dependabot/npm_and_yarn/graphql-15.8.0
chore(deps-dev): bump graphql from 15.7.2 to 15.8.0
2022-03-29 10:08:02 +02:00
Kamil Mysliwiec
9c04af69fb Merge pull request #9378 from nestjs/dependabot/npm_and_yarn/lint-staged-12.3.7
chore(deps-dev): bump lint-staged from 12.3.5 to 12.3.7
2022-03-29 10:07:57 +02:00
Kamil Mysliwiec
07dd969245 Merge pull request #9379 from nestjs/dependabot/npm_and_yarn/apollo-server-core-3.6.6
chore(deps-dev): bump apollo-server-core from 3.6.4 to 3.6.6
2022-03-29 10:07:47 +02:00
Kamil Mysliwiec
75fdb69599 Merge pull request #9380 from nestjs/dependabot/npm_and_yarn/prettier-2.6.1
chore(deps-dev): bump prettier from 2.6.0 to 2.6.1
2022-03-29 10:07:43 +02:00
dependabot[bot]
da41efe3c1 chore(deps-dev): bump lint-staged from 12.3.5 to 12.3.7
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.3.5 to 12.3.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v12.3.5...v12.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-29 08:07:40 +00:00
dependabot[bot]
1d1c558b23 chore(deps): bump ansi-regex
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-29 08:06:02 +00:00
dependabot[bot]
53cf87de7d chore(deps): bump ansi-regex in /sample/25-dynamic-modules
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-29 08:05:56 +00:00
Kamil Mysliwiec
2694e87aa3 Merge pull request #9381 from nestjs/dependabot/npm_and_yarn/light-my-request-4.9.0
chore(deps): bump light-my-request from 4.8.0 to 4.9.0
2022-03-29 10:05:10 +02:00
Kamil Mysliwiec
93fd9a6752 Merge pull request #9382 from nestjs/dependabot/npm_and_yarn/types/supertest-2.0.12
chore(deps-dev): bump @types/supertest from 2.0.11 to 2.0.12
2022-03-29 10:04:57 +02:00
Kamil Mysliwiec
f1af65e92e Merge pull request #9386 from micalevisk/docs-fix-links
docs(common): update hyperlinks on `@see` tag comments
2022-03-28 09:36:00 +02:00
Kamil Mysliwiec
e485ddf960 Merge pull request #9384 from cichy380/patch-1
Update photo.service.ts
2022-03-28 09:35:42 +02:00
Kamil Mysliwiec
37607cdfae Merge pull request #9389 from wiasliaw/fix/typo
fix(platform-fastify): fix typo
2022-03-28 09:21:15 +02:00
wiasliaw
aabe1accee fix(platform-fastify): fix typo
chore(.): update copyright
2022-03-28 13:41:00 +08:00
Micael Levi (@micalevisk)
5ad8f2ba57 docs(common): update hyperlinks on @see tag comments 2022-03-25 16:54:27 -04:00
Micael Levi (@micalevisk)
eb33fe5919 feat(common): disallow option inject on class/value providers types 2022-03-25 16:18:36 -04:00
dependabot[bot]
33cba79f55 chore(deps-dev): bump apollo-server-core from 3.6.4 to 3.6.6
Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.6.4 to 3.6.6.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.6.6/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 15:16:05 +00:00
Kamil Myśliwiec
43a0514edd chore(@nestjs) publish v8.4.3 release 2022-03-25 16:12:43 +01:00
Kamil Myśliwiec
60f09913af fix(microservices): fix tcp client reconnection issue #9363 2022-03-25 16:11:28 +01:00
Marcin
8b0632e6c7 Update photo.service.ts
Change to MongoRepository class - dedicated to manage mongodb documents
2022-03-25 15:48:47 +01:00
Kamil Myśliwiec
c4887a7f44 chore(common): final improvements, drop initialize method 2022-03-25 14:07:22 +01:00
dependabot[bot]
d4420611f7 chore(deps-dev): bump @types/supertest from 2.0.11 to 2.0.12
Bumps [@types/supertest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/supertest) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/supertest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 10:21:54 +00:00
dependabot[bot]
993faeb299 chore(deps): bump light-my-request from 4.8.0 to 4.9.0
Bumps [light-my-request](https://github.com/fastify/light-my-request) from 4.8.0 to 4.9.0.
- [Release notes](https://github.com/fastify/light-my-request/releases)
- [Commits](https://github.com/fastify/light-my-request/compare/v4.8.0...v4.9.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>
2022-03-25 10:20:36 +00:00
dependabot[bot]
f4be93b3e6 chore(deps-dev): bump prettier from 2.6.0 to 2.6.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.0 to 2.6.1.
- [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/2.6.0...2.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 10:18:56 +00:00
dependabot[bot]
33ac6add9f chore(deps-dev): bump graphql from 15.7.2 to 15.8.0
Bumps [graphql](https://github.com/graphql/graphql-js) from 15.7.2 to 15.8.0.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v15.7.2...v15.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 10:15:32 +00:00
Kamil Mysliwiec
e1f67b9eac Merge pull request #9361 from nestjs/dependabot/npm_and_yarn/mqtt-4.3.7
chore(deps-dev): bump mqtt from 4.3.6 to 4.3.7
2022-03-25 11:12:07 +01:00
Kamil Mysliwiec
04b8567ce6 Merge pull request #9369 from nestjs/dependabot/npm_and_yarn/nestjs/apollo-10.0.8
chore(deps-dev): bump @nestjs/apollo from 10.0.7 to 10.0.8
2022-03-25 11:11:55 +01:00
Kamil Mysliwiec
868771f018 Merge pull request #9370 from nestjs/dependabot/npm_and_yarn/fastify-static-4.6.1
chore(deps-dev): bump fastify-static from 4.5.0 to 4.6.1
2022-03-25 11:11:44 +01:00
Kamil Mysliwiec
5e21db79a3 Merge pull request #9371 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.3
chore(deps-dev): bump graphql-tools from 8.2.1 to 8.2.3
2022-03-25 11:11:34 +01:00
Kamil Mysliwiec
2b42b410c6 Merge pull request #9375 from nestjs/dependabot/npm_and_yarn/apollo-server-express-3.6.6
chore(deps-dev): bump apollo-server-express from 3.6.5 to 3.6.6
2022-03-25 11:11:23 +01:00
Kamil Mysliwiec
0e1ee44276 Merge pull request #9374 from turrisxyz/naveen/feat/extended-security-codeql
Enhanced codeql security scanning
2022-03-25 11:11:01 +01:00
Kamil Mysliwiec
cb17bbbbe4 Merge pull request #9373 from turrisxyz/naveen/feat/dependabot-githubactions
Included dependabot for GitHub actions
2022-03-25 11:10:29 +01:00
dependabot[bot]
34a4883aad chore(deps-dev): bump apollo-server-express from 3.6.5 to 3.6.6
Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 3.6.5 to 3.6.6.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-express@3.6.6/packages/apollo-server-express)

---
updated-dependencies:
- dependency-name: apollo-server-express
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 00:03:50 +00:00
naveensrinivasan
40cfd37fb3 Enhanced codeql security scanning
- Enhanced the codeql enhanced security scanning.
https://github.blog/2022-02-17-code-scanning-finds-vulnerabilities-using-machine-learning/

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-03-24 19:14:29 +00:00
naveensrinivasan
ae52d9651a Included dependabot for GitHub actions
At the moment there isn't a dependabot config for githubactions. With
this it includes for GitHub actions.

The GitHub actions aren't getting updates. The codeql github action has release of
2.8.3 and the one that is running right now is at 1.x.x. The codeql
  plays a critical role in identifying vulnerabilities.
2022-03-24 19:01:12 +00:00
Kamil Myśliwiec
18be1e1158 Merge branch 'master' into feat/module-utils 2022-03-24 10:51:38 +01:00
dependabot[bot]
a1bebff55b chore(deps-dev): bump @nestjs/apollo from 10.0.7 to 10.0.8
Bumps [@nestjs/apollo](https://github.com/nestjs/graphql) from 10.0.7 to 10.0.8.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.7...v10.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-24 08:18:38 +00:00
dependabot[bot]
0de707a997 chore(deps-dev): bump graphql-tools from 8.2.1 to 8.2.3
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 8.2.1 to 8.2.3.
- [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@8.2.3/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>
2022-03-24 08:15:33 +00:00
Kamil Mysliwiec
061a19eac6 Merge pull request #9358 from nestjs/dependabot/npm_and_yarn/prettier-2.6.0
chore(deps-dev): bump prettier from 2.5.1 to 2.6.0
2022-03-24 09:14:33 +01:00
dependabot[bot]
0ad71f844f chore(deps-dev): bump fastify-static from 4.5.0 to 4.6.1
Bumps [fastify-static](https://github.com/fastify/fastify-static) from 4.5.0 to 4.6.1.
- [Release notes](https://github.com/fastify/fastify-static/releases)
- [Commits](https://github.com/fastify/fastify-static/compare/v4.5.0...v4.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-24 08:14:32 +00:00
Kamil Mysliwiec
120ad4ccdb Merge pull request #9359 from nestjs/dependabot/npm_and_yarn/apollo-server-express-3.6.5
chore(deps-dev): bump apollo-server-express from 3.6.4 to 3.6.5
2022-03-24 09:14:17 +01:00
Kamil Mysliwiec
0253e92d89 Merge pull request #9365 from nestjs/dependabot/npm_and_yarn/nestjs/graphql-10.0.8
chore(deps-dev): bump @nestjs/graphql from 10.0.6 to 10.0.8
2022-03-24 09:12:59 +01:00
dependabot[bot]
8c8db9f497 chore(deps-dev): bump mqtt from 4.3.6 to 4.3.7
Bumps [mqtt](https://github.com/mqttjs/MQTT.js) from 4.3.6 to 4.3.7.
- [Release notes](https://github.com/mqttjs/MQTT.js/releases)
- [Changelog](https://github.com/mqttjs/MQTT.js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mqttjs/MQTT.js/compare/v4.3.6...v4.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-24 08:08:25 +00:00
Kamil Mysliwiec
d581153c06 Merge pull request #9368 from nestjs/dependabot/npm_and_yarn/mongoose-6.2.8
chore(deps-dev): bump mongoose from 6.2.6 to 6.2.8
2022-03-24 09:05:18 +01:00
dependabot[bot]
d74a8d637f chore(deps-dev): bump mongoose from 6.2.6 to 6.2.8
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.6 to 6.2.8.
- [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/6.2.6...6.2.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-24 00:15:46 +00:00
dependabot[bot]
ad7972b203 chore(deps-dev): bump @nestjs/graphql from 10.0.6 to 10.0.8
Bumps [@nestjs/graphql](https://github.com/nestjs/graphql) from 10.0.6 to 10.0.8.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.6...v10.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-23 00:13:28 +00:00
dependabot[bot]
e9462d2712 chore(deps-dev): bump apollo-server-express from 3.6.4 to 3.6.5
Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 3.6.4 to 3.6.5.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-express@3.6.5/packages/apollo-server-express)

---
updated-dependencies:
- dependency-name: apollo-server-express
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 00:04:28 +00:00
dependabot[bot]
276b28cdcb chore(deps-dev): bump prettier from 2.5.1 to 2.6.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.5.1 to 2.6.0.
- [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/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 00:03:25 +00:00
Kamil Myśliwiec
17d48f3cb4 Merge branch 'master' into feat/module-utils 2022-03-21 15:49:30 +01:00
Kamil Myśliwiec
f502bed31f chore(@nestjs) publish v8.4.2 release 2022-03-21 15:48:00 +01:00
Kamil Mysliwiec
bf583bc870 Merge pull request #9339 from nestjs/dependabot/npm_and_yarn/nestjs/apollo-10.0.7
chore(deps-dev): bump @nestjs/apollo from 10.0.6 to 10.0.7
2022-03-21 10:16:21 +01:00
Kamil Mysliwiec
6c842b5ee6 Merge pull request #9344 from nestjs/dependabot/npm_and_yarn/commitlint/config-angular-16.2.3
chore(deps-dev): bump @commitlint/config-angular from 16.2.1 to 16.2.3
2022-03-21 10:16:11 +01:00
dependabot[bot]
b56be10e06 chore(deps-dev): bump @nestjs/apollo from 10.0.6 to 10.0.7
Bumps [@nestjs/apollo](https://github.com/nestjs/graphql) from 10.0.6 to 10.0.7.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.6...v10.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 08:52:52 +00:00
dependabot[bot]
c23a9f7ef7 chore(deps-dev): bump @commitlint/config-angular from 16.2.1 to 16.2.3
Bumps [@commitlint/config-angular](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-angular) from 16.2.1 to 16.2.3.
- [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/v16.2.3/@commitlint/config-angular)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 08:51:20 +00:00
Kamil Mysliwiec
852770f4ed Merge pull request #9333 from nestjs/renovate/webpack-cli-4.x
chore(deps): update dependency webpack-cli to v4.9.2
2022-03-21 09:46:27 +01:00
Kamil Mysliwiec
85a18b97e7 Merge pull request #9334 from nestjs/renovate/jest-monorepo
chore(deps): update jest monorepo
2022-03-21 09:46:22 +01:00
Kamil Mysliwiec
b83940ea50 Merge pull request #9335 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency @graphql-tools/utils to v8.6.3
2022-03-21 09:46:18 +01:00
Kamil Mysliwiec
faf1863cd3 Merge pull request #9336 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo
2022-03-21 09:46:10 +01:00
Kamil Mysliwiec
a4ef8b85d8 Merge pull request #9340 from nestjs/dependabot/npm_and_yarn/nestjs/mongoose-9.0.3
chore(deps-dev): bump @nestjs/mongoose from 9.0.2 to 9.0.3
2022-03-21 09:45:58 +01:00
Kamil Mysliwiec
5c1d8dbad9 Merge pull request #9345 from nestjs/dependabot/npm_and_yarn/graphql-tools-8.2.1
chore(deps-dev): bump graphql-tools from 7.0.5 to 8.2.1
2022-03-21 09:45:48 +01:00
Kamil Mysliwiec
e671a38b15 Merge pull request #9346 from nestjs/dependabot/npm_and_yarn/grpc/grpc-js-1.5.9
chore(deps-dev): bump @grpc/grpc-js from 1.5.7 to 1.5.9
2022-03-21 09:45:40 +01:00
Kamil Mysliwiec
a83923425f Merge pull request #9347 from xavierchow/feat-custom-transpoter-id
feat(microservices): allow to set custom transport to decorators
2022-03-21 09:44:40 +01:00
Kamil Mysliwiec
f0988950f6 Merge pull request #9350 from nestjs/renovate/npm-swagger-ui-dist-vulnerability
chore(deps): update dependency swagger-ui-dist to 4.1.3 [security]
2022-03-21 09:44:30 +01:00
Kamil Mysliwiec
97d657408a Merge pull request #9355 from nestjs/revert-9278-feat/better-cli-color-detection
Revert "feat(common): do not use colors in CLI if not supported"
2022-03-21 09:44:22 +01:00
Kamil Mysliwiec
460c2ebfe2 Revert "feat(common): do not use colors in CLI if not supported" 2022-03-21 09:35:48 +01:00
Renovate Bot
42c0353518 fix(deps): update dependency @graphql-tools/utils to v8.6.3 2022-03-21 07:13:08 +00:00
Renovate Bot
54ec050404 chore(deps): update jest monorepo 2022-03-21 07:12:01 +00:00
Renovate Bot
3776733960 chore(deps): update dependency webpack-cli to v4.9.2 2022-03-21 06:54:41 +00:00
Renovate Bot
abdde0aad5 chore(deps): update babel monorepo 2022-03-21 06:53:38 +00:00
Renovate Bot
6183d04ba9 chore(deps): update dependency swagger-ui-dist to 4.1.3 [security] 2022-03-21 06:41:29 +00:00
Tolga Paksoy
8ea63376ee test(platform-fastify): add tests for raw body option in fastify adapter 2022-03-17 12:00:41 +01:00
Tolga Paksoy
c8bd058757 feat(platform-fastify): add raw body to request if configured in options 2022-03-17 12:00:41 +01:00
Tolga Paksoy
f28a964200 test(platform-express): add tests for raw body option in express adapter 2022-03-17 12:00:38 +01:00
Xavier Zhou
4539568030 feat(microservices): allow to set custom transport to decorators 2022-03-17 09:22:23 +08:00
dependabot[bot]
7e349178f9 chore(deps-dev): bump @grpc/grpc-js from 1.5.7 to 1.5.9
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.5.7 to 1.5.9.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.5.7...@grpc/grpc-js@1.5.9)

---
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>
2022-03-17 00:16:23 +00:00
dependabot[bot]
b2fd422149 chore(deps-dev): bump graphql-tools from 7.0.5 to 8.2.1
Bumps [graphql-tools](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/graphql-tools) from 7.0.5 to 8.2.1.
- [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@8.2.1/packages/graphql-tools)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-17 00:08:08 +00:00
Tolga Paksoy
b0e568e929 feat(platform-express): add raw body to request if configured in options 2022-03-16 20:47:30 +01:00
Tolga Paksoy
a6e28f5953 feat(core): allow middleware to be setup using app options 2022-03-16 20:41:45 +01:00
Tolga Paksoy
c05fcfb2ca feat(common): add raw body option to application options 2022-03-16 20:40:09 +01:00
dependabot[bot]
7d1124a42f chore(deps-dev): bump @nestjs/mongoose from 9.0.2 to 9.0.3
Bumps [@nestjs/mongoose](https://github.com/nestjs/mongoose) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/nestjs/mongoose/releases)
- [Changelog](https://github.com/nestjs/mongoose/blob/master/.release-it.json)
- [Commits](https://github.com/nestjs/mongoose/compare/9.0.2...9.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 00:08:10 +00:00
Kamil Myśliwiec
0dc4f919f1 chore(@nestjs) publish v8.4.1 release 2022-03-14 15:21:12 +01:00
Kamil Mysliwiec
0990d4b270 Merge pull request #9331 from nestjs/renovate/ts-loader-9.x
chore(deps): update dependency ts-loader to v9.2.8
2022-03-14 14:56:44 +01:00
Kamil Mysliwiec
8c705aa8da Merge pull request #9332 from nestjs/fix/middleware-with-exclude-routes
fix(core): apply global middleware to routes excluded from prefix
2022-03-14 14:56:34 +01:00
Kamil Mysliwiec
2f4e9d9293 Merge pull request #9326 from nestjs/dependabot/npm_and_yarn/mongoose-6.2.6
chore(deps-dev): bump mongoose from 6.2.5 to 6.2.6
2022-03-14 14:44:09 +01:00
Kamil Myśliwiec
1ae72e1fdb fix(core): apply global middleware to routes excluded from prefix 2022-03-14 14:43:03 +01:00
Renovate Bot
c7bdeada00 chore(deps): update dependency ts-loader to v9.2.8 2022-03-14 13:30:58 +00:00
dependabot[bot]
6fc31586bc chore(deps-dev): bump mongoose from 6.2.5 to 6.2.6
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.5 to 6.2.6.
- [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/6.2.5...6.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 13:01:08 +00:00
Kamil Mysliwiec
ab9a1a54f6 Merge pull request #9278 from jonahsnider/feat/better-cli-color-detection
feat(common): do not use colors in CLI if not supported
2022-03-14 13:58:38 +01:00
Kamil Mysliwiec
f3530eee5e Merge pull request #9290 from radekmikeska/kafka-server-event-pattern-fix
fix(microservices): fix event pattern behavior
2022-03-14 13:58:20 +01:00
Kamil Mysliwiec
26b3d1d8d8 Merge pull request #9303 from nestjs/fix/tcp-client-parallel-connections
fix(microservices): tcp client parallel connections issue
2022-03-14 13:57:25 +01:00
Kamil Mysliwiec
2d989b116f Merge pull request #9316 from stanimirovv/feat/custom-logger-formatters
feat: allow custom log msg formatters
2022-03-14 13:57:10 +01:00
Kamil Mysliwiec
61fe8de7e7 Merge pull request #9322 from nestjs/fix/nested-transient-providers
fix(core): use context module for nested transient providers
2022-03-14 13:56:44 +01:00
Kamil Mysliwiec
8fa574453a Merge pull request #9327 from nestjs/dependabot/npm_and_yarn/types/ws-8.5.3
chore(deps-dev): bump @types/ws from 8.5.2 to 8.5.3
2022-03-14 13:56:18 +01:00
Kamil Mysliwiec
4d9b4cc118 Merge pull request #9320 from nestjs/dependabot/npm_and_yarn/apollo-server-core-3.6.4
chore(deps-dev): bump apollo-server-core from 3.6.3 to 3.6.4
2022-03-14 13:56:10 +01:00
Kamil Mysliwiec
b71bf6b9df Merge pull request #9323 from nestjs/renovate/node-16.x
chore(deps): update dependency @types/node to v16.11.26
2022-03-14 13:56:06 +01:00
Kamil Mysliwiec
0efe425187 Merge pull request #9324 from nestjs/renovate/mocha-9.x
chore(deps): update dependency mocha to v9.2.2
2022-03-14 13:56:01 +01:00
Kamil Mysliwiec
5ef23f1058 Merge pull request #9325 from nestjs/renovate/mysql-8.x
chore(deps): update dependency mysql to v8.0.28
2022-03-14 13:55:56 +01:00
Kamil Mysliwiec
7d265c34e2 Merge pull request #9328 from nestjs/dependabot/npm_and_yarn/mocha-9.2.2
chore(deps-dev): bump mocha from 9.2.1 to 9.2.2
2022-03-14 13:55:40 +01:00
Renovate Bot
efc5b63ed0 chore(deps): update dependency mysql to v8.0.28 2022-03-14 11:56:44 +00:00
Renovate Bot
9997006637 chore(deps): update dependency mocha to v9.2.2 2022-03-14 11:56:34 +00:00
Renovate Bot
fc96eea2d7 chore(deps): update dependency @types/node to v16.11.26 2022-03-14 11:54:27 +00:00
dependabot[bot]
c09f6debd1 chore(deps-dev): bump mocha from 9.2.1 to 9.2.2
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.1...v9.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 00:14:35 +00:00
dependabot[bot]
a23f858011 chore(deps-dev): bump @types/ws from 8.5.2 to 8.5.3
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 8.5.2 to 8.5.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 00:13:00 +00:00
Zlatin Stanimirov
50bb472ea3 feat: extract protected method for pid 2022-03-11 20:09:47 +02:00
Zlatin Stanimirov
674a09c175 refactor: extract colorize 2022-03-11 19:20:16 +02:00
dependabot[bot]
34c09f5a61 chore(deps-dev): bump apollo-server-core from 3.6.3 to 3.6.4
Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.6.3 to 3.6.4.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.6.4/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-11 14:21:45 +00:00
Kamil Mysliwiec
76b1837886 Merge pull request #9321 from nestjs/dependabot/npm_and_yarn/apollo-server-express-3.6.4
chore(deps-dev): bump apollo-server-express from 3.6.3 to 3.6.4
2022-03-11 15:18:54 +01:00
Kamil Myśliwiec
3b2407bba7 fix(core): use context module for nested transient providers 2022-03-11 15:17:42 +01:00
dependabot[bot]
a06ae58426 chore(deps-dev): bump apollo-server-express from 3.6.3 to 3.6.4
Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 3.6.3 to 3.6.4.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-express@3.6.4/packages/apollo-server-express)

---
updated-dependencies:
- dependency-name: apollo-server-express
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-11 00:07:52 +00:00
David Schütte
37d83eeb21 test(microservices): add tests for kafka-rpc-proxy 2022-03-10 12:36:48 +01:00
David Schütte
0b93404bef refactor(microservices): simplify function call 2022-03-10 12:34:52 +01:00
Zlatin Stanimirov
89d97652ca feat: allow custom log formatters 2022-03-10 12:57:58 +02:00
Kamil Mysliwiec
bf0768ed4b Merge pull request #9317 from nestjs/dependabot/npm_and_yarn/axios-0.26.1
chore(deps): bump axios from 0.26.0 to 0.26.1
2022-03-10 08:34:25 +01:00
Kamil Mysliwiec
6071755cc1 Merge pull request #9318 from nestjs/dependabot/npm_and_yarn/mongoose-6.2.5
chore(deps-dev): bump mongoose from 6.2.4 to 6.2.5
2022-03-10 08:34:21 +01:00
Kamil Mysliwiec
f89de3f85a Merge pull request #9319 from nestjs/dependabot/npm_and_yarn/fastify-3.27.4
chore(deps): bump fastify from 3.27.3 to 3.27.4
2022-03-10 08:34:13 +01:00
dependabot[bot]
a05369ff98 chore(deps): bump fastify from 3.27.3 to 3.27.4
Bumps [fastify](https://github.com/fastify/fastify) from 3.27.3 to 3.27.4.
- [Release notes](https://github.com/fastify/fastify/releases)
- [Commits](https://github.com/fastify/fastify/compare/v3.27.3...v3.27.4)

---
updated-dependencies:
- dependency-name: fastify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-10 00:11:25 +00:00
dependabot[bot]
4aa257a30e chore(deps-dev): bump mongoose from 6.2.4 to 6.2.5
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.4 to 6.2.5.
- [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/6.2.4...6.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-10 00:07:03 +00:00
dependabot[bot]
335a4dd48a chore(deps): bump axios from 0.26.0 to 0.26.1
Bumps [axios](https://github.com/axios/axios) from 0.26.0 to 0.26.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.26.0...v0.26.1)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-10 00:05:26 +00:00
woobottle
f5051727ea fix(core): Change ReflectMetadata Params Order
i saw reflectMetadata public method in scanner.ts use params backwards
same levele methods in scanner.ts like insertInjectable,
insertExportedProvider, insertController use pararms forward
i think this params order should be fixed
and only params reversed order in reflectMetadata can get hard to read
2022-03-09 17:59:47 +09:00
Kamil Mysliwiec
4a6edc5e75 Merge pull request #9307 from nestjs/dependabot/npm_and_yarn/rxjs-7.5.5
chore(deps): bump rxjs from 7.5.4 to 7.5.5
2022-03-09 09:10:34 +01:00
dependabot[bot]
625bea70b2 chore(deps): bump rxjs from 7.5.4 to 7.5.5
Bumps [rxjs](https://github.com/reactivex/rxjs) from 7.5.4 to 7.5.5.
- [Release notes](https://github.com/reactivex/rxjs/releases)
- [Changelog](https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactivex/rxjs/compare/7.5.4...7.5.5)

---
updated-dependencies:
- dependency-name: rxjs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-09 00:06:03 +00:00
Michał Dzik
5e52a7e85e chore: align message pattern to event pattern 2022-03-08 21:16:37 +01:00
Kamil Mysliwiec
6920399925 Merge pull request #9304 from nestjs/renovate/nestjs-schematics-8.x
chore(deps): update dependency @nestjs/schematics to v8.0.8
2022-03-08 09:56:17 +01:00
Kamil Mysliwiec
2d8db167df Merge pull request #9305 from nestjs/dependabot/npm_and_yarn/fastify-3.27.3
chore(deps): bump fastify from 3.27.2 to 3.27.3
2022-03-08 09:53:33 +01:00
Renovate Bot
dbdc5963b2 chore(deps): update dependency @nestjs/schematics to v8.0.8 2022-03-08 06:37:41 +00:00
dependabot[bot]
1de8aac473 chore(deps): bump fastify from 3.27.2 to 3.27.3
Bumps [fastify](https://github.com/fastify/fastify) from 3.27.2 to 3.27.3.
- [Release notes](https://github.com/fastify/fastify/releases)
- [Commits](https://github.com/fastify/fastify/compare/v3.27.2...v3.27.3)

---
updated-dependencies:
- dependency-name: fastify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-08 00:07:12 +00:00
Michał Dzik
0fe67d5f90 chore: alignments after review 2022-03-07 21:18:56 +01:00
titivuk
ef70418627 fix(common): ParseUUIDPipe - use optional chaining 2022-03-07 18:01:42 +01:00
David Schütte
b91803c671 feat(microservices): add consumer getter to kafka context
Provide access to native consumer of kafkajs using @Ctx() decorator.
2022-03-07 14:41:31 +01:00
Kamil Myśliwiec
e337f29954 fix(microservices): tcp client parallel connections issue 2022-03-07 13:52:58 +01:00
Kamil Mysliwiec
4e41a72773 Merge pull request #9300 from nestjs/dependabot/npm_and_yarn/ts-node-10.7.0
chore(deps-dev): bump ts-node from 10.6.0 to 10.7.0
2022-03-07 10:12:17 +01:00
dependabot[bot]
a5552c34e6 chore(deps-dev): bump ts-node from 10.6.0 to 10.7.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.6.0 to 10.7.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.6.0...v10.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 08:49:51 +00:00
Kamil Mysliwiec
46ccebeda3 Merge pull request #9292 from nestjs/dependabot/npm_and_yarn/ts-morph-14.0.0
chore(deps-dev): bump ts-morph from 13.0.3 to 14.0.0
2022-03-07 09:47:20 +01:00
Kamil Mysliwiec
5feda61e17 Merge pull request #9301 from nestjs/dependabot/npm_and_yarn/typeorm-0.2.45
chore(deps-dev): bump typeorm from 0.2.44 to 0.2.45
2022-03-07 09:47:08 +01:00
Kamil Mysliwiec
a129ee137b Merge pull request #9302 from nestjs/dependabot/npm_and_yarn/lint-staged-12.3.5
chore(deps-dev): bump lint-staged from 12.3.4 to 12.3.5
2022-03-07 09:47:04 +01:00
Kamil Mysliwiec
4d9fb0d29a Merge pull request #9296 from ZanMinKian/chore-zmj-update_gitignore
chore: add .devcontainer to gitignore
2022-03-07 09:17:53 +01:00
dependabot[bot]
0be9c63bf0 chore(deps-dev): bump lint-staged from 12.3.4 to 12.3.5
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.3.4 to 12.3.5.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v12.3.4...v12.3.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 00:14:20 +00:00
dependabot[bot]
d661fda872 chore(deps-dev): bump typeorm from 0.2.44 to 0.2.45
Bumps [typeorm](https://github.com/typeorm/typeorm) from 0.2.44 to 0.2.45.
- [Release notes](https://github.com/typeorm/typeorm/releases)
- [Changelog](https://github.com/typeorm/typeorm/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typeorm/typeorm/compare/0.2.44...0.2.45)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 00:10:59 +00:00
曾明健
c151efebcb chore: add .devcontainer to gitignore 2022-03-06 06:24:33 +08:00
Tony
795eaec304 Merge branch 'master' into sample-05/add-test-e2e 2022-03-04 18:18:31 +01:00
Michał Dzik
48dca4ee22 chore: align event pattern 2022-03-04 14:19:02 +01:00
David Schütte
c229a75c43 fix(microservices): fix import path 2022-03-04 09:42:35 +01:00
Radek Mikeska
4d689ee356 refactor(microservices): use optional chaining
code review
2022-03-04 07:30:26 +01:00
David Schütte
77b7bd6905 feat(microservices): dont catch errors thrown by kafka event handling
Error thrown by event handling method are no longer being caught by RcpExecptionFilter.
Instead errors are passed to kafkajs's eachMessage.
This results in proper interaction with kafka.

This commit closes Kafka commitOffsets #9283.
2022-03-04 01:21:41 +01:00
David Schütte
5b24f81cd8 feat(microservices): add commit offset to kafka context
Provide access to kafkajs commitOffset by using @Ctx() decorator when handeling an event.

This commit closes Kafka commitOffsets #9283.
2022-03-04 01:17:13 +01:00
dependabot[bot]
5038132633 chore(deps-dev): bump ts-morph from 13.0.3 to 14.0.0
Bumps [ts-morph](https://github.com/dsherret/ts-morph) from 13.0.3 to 14.0.0.
- [Release notes](https://github.com/dsherret/ts-morph/releases)
- [Commits](https://github.com/dsherret/ts-morph/compare/13.0.3...14.0.0)

---
updated-dependencies:
- dependency-name: ts-morph
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-04 00:06:18 +00:00
Radek Mikeska
94b39db8f5 fix(microservices): fix event pattern behavior
When listening to messages from Kafka using EventPattern the message should not be replied to even if it contains correlation id and reply topic.

BREAKING CHANGE: existing methods where EventPattern is used instead of MessagePattern do not send message to a reply topic anymore which might cause bugs.
2022-03-03 16:08:14 +01:00
Kamil Myśliwiec
db3654a891 sample(23-code-first): add missing directive declaration 2022-03-03 13:33:59 +01:00
Kamil Mysliwiec
46db4c4d4b Merge pull request #9273 from nestjs/dependabot/npm_and_yarn/typescript-4.6.2
chore(deps-dev): bump typescript from 4.3.5 to 4.6.2
2022-03-03 10:37:50 +01:00
Kamil Mysliwiec
788e11ff5e Merge pull request #9285 from nestjs/dependabot/npm_and_yarn/nestjs/apollo-10.0.6
chore(deps-dev): bump @nestjs/apollo from 10.0.5 to 10.0.6
2022-03-03 10:05:55 +01:00
Kamil Myśliwiec
8f7b7a8014 chore(): resolve conflicts, update tsconfig 2022-03-03 10:05:11 +01:00
Kamil Mysliwiec
f864d75b72 Merge pull request #9287 from nestjs/dependabot/npm_and_yarn/eventsource-2.0.0
chore(deps-dev): bump eventsource from 1.1.0 to 2.0.0
2022-03-03 09:59:54 +01:00
dependabot[bot]
88565b417f chore(deps-dev): bump @nestjs/apollo from 10.0.5 to 10.0.6
Bumps [@nestjs/apollo](https://github.com/nestjs/graphql) from 10.0.5 to 10.0.6.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.5...v10.0.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-03 08:25:52 +00:00
dependabot[bot]
2d7d28189e chore(deps-dev): bump eventsource from 1.1.0 to 2.0.0
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 2.0.0.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v2.0.0)

---
updated-dependencies:
- dependency-name: eventsource
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-03 08:25:22 +00:00
Kamil Mysliwiec
e5080b85ee Merge pull request #9284 from nestjs/dependabot/npm_and_yarn/eslint-config-prettier-8.5.0
chore(deps-dev): bump eslint-config-prettier from 8.4.0 to 8.5.0
2022-03-03 09:22:17 +01:00
Kamil Mysliwiec
cce221d726 Merge pull request #9286 from nestjs/dependabot/npm_and_yarn/nestjs/graphql-10.0.6
chore(deps-dev): bump @nestjs/graphql from 10.0.5 to 10.0.6
2022-03-03 09:22:08 +01:00
Kamil Mysliwiec
2f73f70414 Merge pull request #9257 from capitantrueno/master
fix(gateways): add the socket.io types dependency
2022-03-03 09:22:01 +01:00
dependabot[bot]
31d63d6859 chore(deps-dev): bump @nestjs/graphql from 10.0.5 to 10.0.6
Bumps [@nestjs/graphql](https://github.com/nestjs/graphql) from 10.0.5 to 10.0.6.
- [Release notes](https://github.com/nestjs/graphql/releases)
- [Commits](https://github.com/nestjs/graphql/compare/v10.0.5...v10.0.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-03 00:09:53 +00:00
dependabot[bot]
285bd4b595 chore(deps-dev): bump eslint-config-prettier from 8.4.0 to 8.5.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.4.0 to 8.5.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.4.0...v8.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-03 00:03:42 +00:00
dependabot[bot]
5f2e784a44 chore(deps-dev): bump typescript from 4.3.5 to 4.6.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.6.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 10:19:55 +00:00
Kamil Mysliwiec
797e04ae26 Merge pull request #9280 from nestjs/dependabot/npm_and_yarn/ts-node-10.6.0
chore(deps-dev): bump ts-node from 10.5.0 to 10.6.0
2022-03-02 11:17:11 +01:00
Kamil Mysliwiec
7f9aa9cec0 Merge pull request #9279 from nestjs/dependabot/npm_and_yarn/types/ws-8.5.2
chore(deps-dev): bump @types/ws from 8.5.1 to 8.5.2
2022-03-02 11:16:42 +01:00
Jonah Snider
07c9ce75ea style(common): format 2022-03-01 20:10:06 -08:00
dependabot[bot]
acc96ddb3f chore(deps-dev): bump ts-node from 10.5.0 to 10.6.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.5.0 to 10.6.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.5.0...v10.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 00:09:01 +00:00
dependabot[bot]
080ad6fe40 chore(deps-dev): bump @types/ws from 8.5.1 to 8.5.2
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 8.5.1 to 8.5.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 00:07:40 +00:00
Jonah Snider
4e7dd9a19e style(common): format 2022-03-01 12:00:53 -08:00
Jonah Snider
3147279ceb fix(common): fix condition 2022-03-01 11:57:42 -08:00
Jonah Snider
ec9537b3f3 feat(common): do not use color in CLI if not supported 2022-03-01 11:54:14 -08:00
Kamil Myśliwiec
94c2aca452 chore(): update package.json and readmes 2022-03-01 14:48:16 +01:00
Kamil Myśliwiec
fb725658f1 chore(@nestjs) publish v8.4.0 release 2022-03-01 14:45:30 +01:00
Kamil Myśliwiec
4f33806c95 Merge branch 'master' of https://github.com/nestjs/nest 2022-03-01 14:33:32 +01:00
Kamil Myśliwiec
aeadc14dca fix(core): address compilation errors 2022-03-01 14:33:24 +01:00
Kamil Mysliwiec
0a90cbe45c Merge pull request #9059 from jeanbmar/raw-tcp
feat(microservices): add tcp raw data processing capabilities
2022-03-01 14:30:01 +01:00
Kamil Myśliwiec
61c5c0614f Merge branch 'tensoar-mqtt-shared-subscription-support' 2022-03-01 14:03:22 +01:00
Kamil Myśliwiec
43a4770b74 chore(): remove merge conflicts 2022-03-01 13:56:03 +01:00
Kamil Myśliwiec
8ce0cf1bc9 chore(): resolve conflicts, minor changes 2022-03-01 13:55:07 +01:00
Kamil Mysliwiec
16531d47d9 Merge pull request #9277 from nestjs/fix/remove-options-from-packets
fix(microservices): remove options object from packets (rmq and mqtt)
2022-03-01 13:52:11 +01:00
Kamil Myśliwiec
7155a18089 Merge branch 'adworacz-versionFunction' 2022-03-01 13:51:49 +01:00
Kamil Myśliwiec
2d3a3b4051 fix(microservices): remove options object from packets (rmq and mqtt) 2022-03-01 13:36:22 +01:00
Mario Rodrigo
852fc91865 fix(gateways): add the socket.io dependency 2022-02-24 12:25:43 +00:00
Mario Rodrigo
668ecd1cf8 fix(gateways): add the socket.io types dependency 2022-02-24 09:52:56 +00:00
Michał Dzik
91178c8a8a chore: apply more tests 2022-02-20 14:55:51 +01:00
Michał Dzik
4ae2ef54d4 feat(microservices): add support for multiple message pattern decorator 2022-02-19 22:16:49 +01:00
Kamil Myśliwiec
bac34473d0 feat(core): add configurable module builder, module utils 2022-02-10 11:02:38 +01:00
Jean-Baptiste
e8abf50812 feat(microservices): allow use of custom tcp sockets 2022-01-30 14:16:31 +01:00
Jean-Baptiste
5d146afa0b refactor(microservices): move tcp socket logic to an abstract class 2022-01-30 12:48:51 +01:00
zmj
ce96a0ed13 fix: fix factory provider definition 2022-01-25 12:02:46 +08:00
tensoar
111d84e25e fix(microservices): update mosquitto config
set allow_anonymous true
2022-01-03 10:21:02 +08:00
tensoar
033e1ffe2d test(microservices): Open websocket in mosquitto 2022-01-02 20:34:35 +08:00
tensoar
14a9ed0ea2 test(microservices): change mqtt docker image
Change the mqtt docker image from toke/mosquitto to eclipse-mosquitto
2022-01-02 19:56:09 +08:00
Tony133
c7d8935632 sample(05-sql-typeorm): update package.json 2022-01-02 12:37:39 +01:00
Tony133
75d4a9b6ee sample(05-sql-typeorm): added test e2e 2022-01-02 12:05:28 +01:00
titivuk
9c0cdd2950 fix(common): ParseUUIDPipe - use isString() util function 2021-12-29 17:35:27 +01:00
titivuk
7cc81067fe fix(common): ParseUUIDPipe - make uuid regexp dictionary protected static property 2021-12-29 17:32:04 +01:00
titivuk
d32e8dd582 fix(common): ParseUUIDPipe - throw exceptions with exceptionFactory only 2021-12-29 17:32:04 +01:00
wt
472b545880 test(microservices): add e2e test for #8109
add e2e test for #8109

associate #8109
2021-09-29 13:42:09 +08:00
tensoar
1741f2106a fix(microservices): mqtt shared subscription support
fix the matching error between shared mqtt topic and handler

Closes #8063
2021-09-22 20:38:57 +08:00
Dylan Lundy
3827736d96 Improve ParseUUIDPipe error message 2021-09-10 00:04:37 +09:30
Lutz
a364ced0ac Merge pull request #1 from MyAeroCode/lutz-feat/route-injection
feat(core): support route injection
2021-03-05 17:55:03 +09:00
267 changed files with 20997 additions and 16936 deletions

View File

@@ -65,11 +65,6 @@ jobs:
- store_artifacts:
path: coverage
test_node_10:
<<: *unit-tests-template
docker:
- image: circleci/node:10
test_node_14:
<<: *unit-tests-template
docker:
@@ -174,9 +169,6 @@ workflows:
- test_node_12:
requires:
- build
- test_node_10:
requires:
- build
- lint:
requires:
- build

View File

@@ -5,3 +5,8 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@@ -29,7 +29,9 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
queries: +security-extended
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
@@ -37,7 +39,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -51,4 +53,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@ node_modules/
/.idea
/.awcache
/.vscode
/.devcontainer
*.code-workspace
# bundle

View File

@@ -1,7 +0,0 @@
module.exports = {
mochaHooks: {
beforeAll: function() {
require('reflect-metadata');
}
}
};

View File

@@ -64,17 +64,20 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
<td>
<a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
</tr></table>
#### Gold Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="150" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
<td>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td></</tr></table>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
<td>
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
<a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
#### Silver Sponsors

7
hooks/mocha-init-hook.ts Normal file
View File

@@ -0,0 +1,7 @@
export const mochaHooks = (): Mocha.RootHookObject => {
return {
async beforeAll(this: Mocha.Context) {
await import('reflect-metadata');
}
};
};

View File

@@ -17,13 +17,15 @@ services:
restart: always
mqtt:
container_name: test-mqtt
image: toke/mosquitto
image: eclipse-mosquitto
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
ports:
- "1883:1883"
- "9001:9001"
restart: always
mysql:
image: mysql:8.0.27
image: mysql:8.0.28
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test

View File

@@ -34,7 +34,7 @@ describe('Disconnected client', () => {
.send({
transport: Transport.REDIS,
options: {
url: 'redis://localhost:3333',
port: '3333',
},
})
.expect(408);

View File

@@ -124,6 +124,44 @@ describe('MQTT transport', () => {
.expect(201, '15');
});
it(`/POST (shared wildcard EVENT #)`, done => {
request(server)
.post('/shared-wildcard-event')
.send([1, 2, 3, 4, 5])
.end(() => {
setTimeout(() => {
expect(MqttController.IS_SHARED_WILDCARD_EVENT_RECEIVED).to.be.true;
done();
}, 1000);
});
});
it(`/POST (shared wildcard MESSAGE #)`, () => {
return request(server)
.post('/shared-wildcard-message')
.send([1, 2, 3, 4, 5])
.expect(201, '15');
});
it(`/POST (shared wildcard EVENT +)`, done => {
request(server)
.post('/shared-wildcard-event2')
.send([1, 2, 3, 4, 5])
.end(() => {
setTimeout(() => {
expect(MqttController.IS_SHARED_WILDCARD2_EVENT_RECEIVED).to.be.true;
done();
}, 1000);
});
});
it(`/POST (shared wildcard MESSAGE +)`, () => {
return request(server)
.post('/shared-wildcard-message2')
.send([1, 2, 3, 4, 5])
.expect(201, '15');
});
afterEach(async () => {
await app.close();
});

View File

@@ -77,6 +77,13 @@ describe('RabbitMQ transport', () => {
.expect(200, '15');
});
it(`/POST (multiple-urls)`, () => {
return request(server)
.post('/multiple-urls')
.send([1, 2, 3, 4, 5])
.expect(200, '15');
}).timeout(10000);
it(`/POST (event notification)`, done => {
request(server)
.post('/notify')

View File

@@ -3,7 +3,7 @@ import {
Controller,
InternalServerErrorException,
Post,
RequestTimeoutException,
RequestTimeoutException
} from '@nestjs/common';
import { ClientProxyFactory } from '@nestjs/microservices';
import { Observable, throwError } from 'rxjs';
@@ -24,7 +24,8 @@ export class DisconnectedClientController {
return throwError(() =>
code === 'ECONNREFUSED' ||
code === 'CONN_ERR' ||
code === 'CONNECTION_REFUSED'
code === 'CONNECTION_REFUSED' ||
error.message === 'Connection is closed.'
? new RequestTimeoutException('ECONNREFUSED')
: new InternalServerErrorException(),
);

View File

@@ -18,6 +18,8 @@ export class MqttController {
static IS_NOTIFIED = false;
static IS_WILDCARD_EVENT_RECEIVED = false;
static IS_WILDCARD2_EVENT_RECEIVED = false;
static IS_SHARED_WILDCARD_EVENT_RECEIVED = false;
static IS_SHARED_WILDCARD2_EVENT_RECEIVED = false;
@Client({ transport: Transport.MQTT })
client: ClientProxy;
@@ -109,6 +111,32 @@ export class MqttController {
};
}
@Post('shared-wildcard-event')
async sendSharedWildcardEvent(): Promise<any> {
return this.client.emit<number>('shared-wildcard-event/test', true);
}
@Post('shared-wildcard-message')
async sendSharedWildcardMessage(
@Body() data: number[],
): Promise<Observable<number>> {
await this.client.connect();
return this.client.send<number>('shared-wildcard-message/test', data);
}
@Post('shared-wildcard-event2')
async sendSharedWildcardEvent2(): Promise<any> {
return this.client.emit<number>('shared-wildcard-event2/test/test', true);
}
@Post('shared-wildcard-message2')
async sendSharedWildcardMessage2(
@Body() data: number[],
): Promise<Observable<number>> {
await this.client.connect();
return this.client.send<number>('shared-wildcard-message2/test/test', data);
}
@MessagePattern('wildcard-message/#')
wildcardMessageHandler(data: number[]): number {
if ((data as any).response) {
@@ -156,4 +184,27 @@ export class MqttController {
streaming(data: number[]): Observable<number> {
return from(data);
}
@MessagePattern('$share/test-group/shared-wildcard-message/#')
sharedWildcardMessageHandler(data: number[]): number {
if ((data as any).response) {
return;
}
return (data || []).reduce((a, b) => a + b);
}
@EventPattern('$share/test-group/shared-wildcard-event/#')
sharedWildcardEventHandler(data: boolean) {
MqttController.IS_SHARED_WILDCARD_EVENT_RECEIVED = data;
}
@MessagePattern('$share/test-group/shared-wildcard-message2/+/test')
sharedWildcardMessageHandler2(data: number[]): number {
return (data || []).reduce((a, b) => a + b);
}
@EventPattern('$share/test-group/shared-wildcard-event2/+/test')
sharedWildcardEventHandler2(data: boolean) {
MqttController.IS_SHARED_WILDCARD2_EVENT_RECEIVED = data;
}
}

View File

@@ -61,6 +61,21 @@ export class RMQController {
.reduce(async (a, b) => (await a) && b);
}
@Post('multiple-urls')
@HttpCode(200)
multipleUrls(@Body() data: number[]) {
const clientWithMultipleUrls = ClientProxyFactory.create({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5671`, `amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
return clientWithMultipleUrls.send<number>({ cmd: 'multiple-urls' }, data);
}
@Post('record-builder-duplex')
@HttpCode(200)
useRecordBuilderDuplex(@Body() data: Record<string, any>) {
@@ -109,6 +124,11 @@ export class RMQController {
return from(data);
}
@MessagePattern({ cmd: 'multiple-urls' })
handleMultipleUrls(data: number[]): number {
return (data || []).reduce((a, b) => a + b);
}
@Post('notify')
async sendNotification(): Promise<any> {
return this.client.emit<number>('notification', true);

View File

@@ -0,0 +1,17 @@
import { ConfigurableModuleBuilder } from '@nestjs/common';
import { IntegrationModuleOptions } from './interfaces/integration-module-options.interface';
export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } =
new ConfigurableModuleBuilder<IntegrationModuleOptions>()
.setClassMethodName('forRoot')
.setFactoryMethodName('construct')
.setExtras(
{
isGlobal: true,
},
(definition, extras) => ({
...definition,
global: extras.isGlobal,
}),
)
.build();

View File

@@ -0,0 +1,16 @@
import { Inject, Module } from '@nestjs/common';
import {
ConfigurableModuleClass,
MODULE_OPTIONS_TOKEN,
} from './integration.module-definition';
import { IntegrationModuleOptions } from './interfaces/integration-module-options.interface';
@Module({})
export class IntegrationModule extends ConfigurableModuleClass {
constructor(
@Inject(MODULE_OPTIONS_TOKEN)
public readonly options: IntegrationModuleOptions,
) {
super();
}
}

View File

@@ -0,0 +1,4 @@
export interface IntegrationModuleOptions {
url: string;
secure?: boolean;
}

View File

@@ -0,0 +1,47 @@
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import { IntegrationModule } from '../src/integration.module';
describe('Module utils (ConfigurableModuleBuilder)', () => {
it('should auto-generate "forRoot" method', async () => {
const moduleRef = await Test.createTestingModule({
imports: [
IntegrationModule.forRoot({
isGlobal: true,
url: 'test_url',
secure: false,
}),
],
}).compile();
const integrationModule = moduleRef.get(IntegrationModule);
expect(integrationModule.options).to.deep.equal({
url: 'test_url',
secure: false,
});
});
it('should auto-generate "forRootAsync" method', async () => {
const moduleRef = await Test.createTestingModule({
imports: [
IntegrationModule.forRootAsync({
isGlobal: true,
useFactory: () => {
return {
url: 'test_url',
secure: false,
};
},
}),
],
}).compile();
const integrationModule = moduleRef.get(IntegrationModule);
expect(integrationModule.options).to.deep.equal({
url: 'test_url',
secure: false,
});
});
});

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
"allowJs": true,
"outDir": "./dist"
},
"include": [
"src/**/*",
"e2e/**/*"
],
"exclude": [
"node_modules",
]
}

906
integration/mosquitto.conf Normal file
View File

@@ -0,0 +1,906 @@
# Config file for mosquitto
#
# See mosquitto.conf(5) for more information.
#
# Default values are shown, uncomment to change.
#
# Use the # character to indicate a comment, but only if it is the
# very first character on the line.
# =================================================================
# General configuration
# =================================================================
# Use per listener security settings.
#
# It is recommended this option be set before any other options.
#
# If this option is set to true, then all authentication and access control
# options are controlled on a per listener basis. The following options are
# affected:
#
# acl_file
# allow_anonymous
# allow_zero_length_clientid
# auto_id_prefix
# password_file
# plugin
# plugin_opt_*
# psk_file
#
# Note that if set to true, then a durable client (i.e. with clean session set
# to false) that has disconnected will use the ACL settings defined for the
# listener that it was most recently connected to.
#
# The default behaviour is for this to be set to false, which maintains the
# setting behaviour from previous versions of mosquitto.
#per_listener_settings false
# This option controls whether a client is allowed to connect with a zero
# length client id or not. This option only affects clients using MQTT v3.1.1
# and later. If set to false, clients connecting with a zero length client id
# are disconnected. If set to true, clients will be allocated a client id by
# the broker. This means it is only useful for clients with clean session set
# to true.
#allow_zero_length_clientid true
# If allow_zero_length_clientid is true, this option allows you to set a prefix
# to automatically generated client ids to aid visibility in logs.
# Defaults to 'auto-'
#auto_id_prefix auto-
# This option affects the scenario when a client subscribes to a topic that has
# retained messages. It is possible that the client that published the retained
# message to the topic had access at the time they published, but that access
# has been subsequently removed. If check_retain_source is set to true, the
# default, the source of a retained message will be checked for access rights
# before it is republished. When set to false, no check will be made and the
# retained message will always be published. This affects all listeners.
#check_retain_source true
# QoS 1 and 2 messages will be allowed inflight per client until this limit
# is exceeded. Defaults to 0. (No maximum)
# See also max_inflight_messages
#max_inflight_bytes 0
# The maximum number of QoS 1 and 2 messages currently inflight per
# client.
# This includes messages that are partway through handshakes and
# those that are being retried. Defaults to 20. Set to 0 for no
# maximum. Setting to 1 will guarantee in-order delivery of QoS 1
# and 2 messages.
#max_inflight_messages 20
# For MQTT v5 clients, it is possible to have the server send a "server
# keepalive" value that will override the keepalive value set by the client.
# This is intended to be used as a mechanism to say that the server will
# disconnect the client earlier than it anticipated, and that the client should
# use the new keepalive value. The max_keepalive option allows you to specify
# that clients may only connect with keepalive less than or equal to this
# value, otherwise they will be sent a server keepalive telling them to use
# max_keepalive. This only applies to MQTT v5 clients. The default, and maximum
# value allowable, is 65535.
#
# Set to 0 to allow clients to set keepalive = 0, which means no keepalive
# checks are made and the client will never be disconnected by the broker if no
# messages are received. You should be very sure this is the behaviour that you
# want.
#
# For MQTT v3.1.1 and v3.1 clients, there is no mechanism to tell the client
# what keepalive value they should use. If an MQTT v3.1.1 or v3.1 client
# specifies a keepalive time greater than max_keepalive they will be sent a
# CONNACK message with the "identifier rejected" reason code, and disconnected.
#
#max_keepalive 65535
# For MQTT v5 clients, it is possible to have the server send a "maximum packet
# size" value that will instruct the client it will not accept MQTT packets
# with size greater than max_packet_size bytes. This applies to the full MQTT
# packet, not just the payload. Setting this option to a positive value will
# set the maximum packet size to that number of bytes. If a client sends a
# packet which is larger than this value, it will be disconnected. This applies
# to all clients regardless of the protocol version they are using, but v3.1.1
# and earlier clients will of course not have received the maximum packet size
# information. Defaults to no limit. Setting below 20 bytes is forbidden
# because it is likely to interfere with ordinary client operation, even with
# very small payloads.
#max_packet_size 0
# QoS 1 and 2 messages above those currently in-flight will be queued per
# client until this limit is exceeded. Defaults to 0. (No maximum)
# See also max_queued_messages.
# If both max_queued_messages and max_queued_bytes are specified, packets will
# be queued until the first limit is reached.
#max_queued_bytes 0
# Set the maximum QoS supported. Clients publishing at a QoS higher than
# specified here will be disconnected.
#max_qos 2
# The maximum number of QoS 1 and 2 messages to hold in a queue per client
# above those that are currently in-flight. Defaults to 1000. Set
# to 0 for no maximum (not recommended).
# See also queue_qos0_messages.
# See also max_queued_bytes.
#max_queued_messages 1000
#
# This option sets the maximum number of heap memory bytes that the broker will
# allocate, and hence sets a hard limit on memory use by the broker. Memory
# requests that exceed this value will be denied. The effect will vary
# depending on what has been denied. If an incoming message is being processed,
# then the message will be dropped and the publishing client will be
# disconnected. If an outgoing message is being sent, then the individual
# message will be dropped and the receiving client will be disconnected.
# Defaults to no limit.
#memory_limit 0
# This option sets the maximum publish payload size that the broker will allow.
# Received messages that exceed this size will not be accepted by the broker.
# The default value is 0, which means that all valid MQTT messages are
# accepted. MQTT imposes a maximum payload size of 268435455 bytes.
#message_size_limit 0
# This option allows persistent clients (those with clean session set to false)
# to be removed if they do not reconnect within a certain time frame.
#
# This is a non-standard option in MQTT V3.1 but allowed in MQTT v3.1.1.
#
# Badly designed clients may set clean session to false whilst using a randomly
# generated client id. This leads to persistent clients that will never
# reconnect. This option allows these clients to be removed.
#
# The expiration period should be an integer followed by one of h d w m y for
# hour, day, week, month and year respectively. For example
#
# persistent_client_expiration 2m
# persistent_client_expiration 14d
# persistent_client_expiration 1y
#
# The default if not set is to never expire persistent clients.
#persistent_client_expiration
# Write process id to a file. Default is a blank string which means
# a pid file shouldn't be written.
# This should be set to /var/run/mosquitto/mosquitto.pid if mosquitto is
# being run automatically on boot with an init script and
# start-stop-daemon or similar.
#pid_file
# Set to true to queue messages with QoS 0 when a persistent client is
# disconnected. These messages are included in the limit imposed by
# max_queued_messages and max_queued_bytes
# Defaults to false.
# This is a non-standard option for the MQTT v3.1 spec but is allowed in
# v3.1.1.
#queue_qos0_messages false
# Set to false to disable retained message support. If a client publishes a
# message with the retain bit set, it will be disconnected if this is set to
# false.
#retain_available true
# Disable Nagle's algorithm on client sockets. This has the effect of reducing
# latency of individual messages at the potential cost of increasing the number
# of packets being sent.
#set_tcp_nodelay false
# Time in seconds between updates of the $SYS tree.
# Set to 0 to disable the publishing of the $SYS tree.
#sys_interval 10
# The MQTT specification requires that the QoS of a message delivered to a
# subscriber is never upgraded to match the QoS of the subscription. Enabling
# this option changes this behaviour. If upgrade_outgoing_qos is set true,
# messages sent to a subscriber will always match the QoS of its subscription.
# This is a non-standard option explicitly disallowed by the spec.
#upgrade_outgoing_qos false
# When run as root, drop privileges to this user and its primary
# group.
# Set to root to stay as root, but this is not recommended.
# If set to "mosquitto", or left unset, and the "mosquitto" user does not exist
# then it will drop privileges to the "nobody" user instead.
# If run as a non-root user, this setting has no effect.
# Note that on Windows this has no effect and so mosquitto should be started by
# the user you wish it to run as.
#user mosquitto
# =================================================================
# Listeners
# =================================================================
# Listen on a port/ip address combination. By using this variable
# multiple times, mosquitto can listen on more than one port. If
# this variable is used and neither bind_address nor port given,
# then the default listener will not be started.
# The port number to listen on must be given. Optionally, an ip
# address or host name may be supplied as a second argument. In
# this case, mosquitto will attempt to bind the listener to that
# address and so restrict access to the associated network and
# interface. By default, mosquitto will listen on all interfaces.
# Note that for a websockets listener it is not possible to bind to a host
# name.
#
# On systems that support Unix Domain Sockets, it is also possible
# to create a # Unix socket rather than opening a TCP socket. In
# this case, the port number should be set to 0 and a unix socket
# path must be provided, e.g.
# listener 0 /tmp/mosquitto.sock
#
# listener port-number [ip address/host name/unix socket path]
#listener
# By default, a listener will attempt to listen on all supported IP protocol
# versions. If you do not have an IPv4 or IPv6 interface you may wish to
# disable support for either of those protocol versions. In particular, note
# that due to the limitations of the websockets library, it will only ever
# attempt to open IPv6 sockets if IPv6 support is compiled in, and so will fail
# if IPv6 is not available.
#
# Set to `ipv4` to force the listener to only use IPv4, or set to `ipv6` to
# force the listener to only use IPv6. If you want support for both IPv4 and
# IPv6, then do not use the socket_domain option.
#
#socket_domain
# Bind the listener to a specific interface. This is similar to
# the [ip address/host name] part of the listener definition, but is useful
# when an interface has multiple addresses or the address may change. If used
# with the [ip address/host name] part of the listener definition, then the
# bind_interface option will take priority.
# Not available on Windows.
#
# Example: bind_interface eth0
#bind_interface
# When a listener is using the websockets protocol, it is possible to serve
# http data as well. Set http_dir to a directory which contains the files you
# wish to serve. If this option is not specified, then no normal http
# connections will be possible.
#http_dir
# The maximum number of client connections to allow. This is
# a per listener setting.
# Default is -1, which means unlimited connections.
# Note that other process limits mean that unlimited connections
# are not really possible. Typically the default maximum number of
# connections possible is around 1024.
#max_connections -1
# The listener can be restricted to operating within a topic hierarchy using
# the mount_point option. This is achieved be prefixing the mount_point string
# to all topics for any clients connected to this listener. This prefixing only
# happens internally to the broker; the client will not see the prefix.
#mount_point
# Choose the protocol to use when listening.
# This can be either mqtt or websockets.
# Certificate based TLS may be used with websockets, except that only the
# cafile, certfile, keyfile, ciphers, and ciphers_tls13 options are supported.
#protocol mqtt
listener 1883
protocol mqtt
listener 9001
protocol websockets
# Set use_username_as_clientid to true to replace the clientid that a client
# connected with with its username. This allows authentication to be tied to
# the clientid, which means that it is possible to prevent one client
# disconnecting another by using the same clientid.
# If a client connects with no username it will be disconnected as not
# authorised when this option is set to true.
# Do not use in conjunction with clientid_prefixes.
# See also use_identity_as_username.
#use_username_as_clientid
# Change the websockets headers size. This is a global option, it is not
# possible to set per listener. This option sets the size of the buffer used in
# the libwebsockets library when reading HTTP headers. If you are passing large
# header data such as cookies then you may need to increase this value. If left
# unset, or set to 0, then the default of 1024 bytes will be used.
#websockets_headers_size
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable certificate based SSL/TLS support
# for this listener. Note that the recommended port for MQTT over TLS is 8883,
# but this must be set manually.
#
# See also the mosquitto-tls man page and the "Pre-shared-key based SSL/TLS
# support" section. Only one of certificate or PSK encryption support can be
# enabled for any listener.
# Both of certfile and keyfile must be defined to enable certificate based
# TLS encryption.
# Path to the PEM encoded server certificate.
#certfile
# Path to the PEM encoded keyfile.
#keyfile
# If you wish to control which encryption ciphers are used, use the ciphers
# option. The list of available ciphers can be optained using the "openssl
# ciphers" command and should be provided in the same format as the output of
# that command. This applies to TLS 1.2 and earlier versions only. Use
# ciphers_tls1.3 for TLS v1.3.
#ciphers
# Choose which TLS v1.3 ciphersuites are used for this listener.
# Defaults to "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
#ciphers_tls1.3
# If you have require_certificate set to true, you can create a certificate
# revocation list file to revoke access to particular client certificates. If
# you have done this, use crlfile to point to the PEM encoded revocation file.
#crlfile
# To allow the use of ephemeral DH key exchange, which provides forward
# security, the listener must load DH parameters. This can be specified with
# the dhparamfile option. The dhparamfile can be generated with the command
# e.g. "openssl dhparam -out dhparam.pem 2048"
#dhparamfile
# By default an TLS enabled listener will operate in a similar fashion to a
# https enabled web server, in that the server has a certificate signed by a CA
# and the client will verify that it is a trusted certificate. The overall aim
# is encryption of the network traffic. By setting require_certificate to true,
# the client must provide a valid certificate in order for the network
# connection to proceed. This allows access to the broker to be controlled
# outside of the mechanisms provided by MQTT.
#require_certificate false
# cafile and capath define methods of accessing the PEM encoded
# Certificate Authority certificates that will be considered trusted when
# checking incoming client certificates.
# cafile defines the path to a file containing the CA certificates.
# capath defines a directory that will be searched for files
# containing the CA certificates. For capath to work correctly, the
# certificate files must have ".crt" as the file ending and you must run
# "openssl rehash <path to capath>" each time you add/remove a certificate.
#cafile
#capath
# If require_certificate is true, you may set use_identity_as_username to true
# to use the CN value from the client certificate as a username. If this is
# true, the password_file option will not be used for this listener.
#use_identity_as_username false
# -----------------------------------------------------------------
# Pre-shared-key based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable PSK based SSL/TLS support for
# this listener. Note that the recommended port for MQTT over TLS is 8883, but
# this must be set manually.
#
# See also the mosquitto-tls man page and the "Certificate based SSL/TLS
# support" section. Only one of certificate or PSK encryption support can be
# enabled for any listener.
# The psk_hint option enables pre-shared-key support for this listener and also
# acts as an identifier for this listener. The hint is sent to clients and may
# be used locally to aid authentication. The hint is a free form string that
# doesn't have much meaning in itself, so feel free to be creative.
# If this option is provided, see psk_file to define the pre-shared keys to be
# used or create a security plugin to handle them.
#psk_hint
# When using PSK, the encryption ciphers used will be chosen from the list of
# available PSK ciphers. If you want to control which ciphers are available,
# use the "ciphers" option. The list of available ciphers can be optained
# using the "openssl ciphers" command and should be provided in the same format
# as the output of that command.
#ciphers
# Set use_identity_as_username to have the psk identity sent by the client used
# as its username. Authentication will be carried out using the PSK rather than
# the MQTT username/password and so password_file will not be used for this
# listener.
#use_identity_as_username false
# =================================================================
# Persistence
# =================================================================
# If persistence is enabled, save the in-memory database to disk
# every autosave_interval seconds. If set to 0, the persistence
# database will only be written when mosquitto exits. See also
# autosave_on_changes.
# Note that writing of the persistence database can be forced by
# sending mosquitto a SIGUSR1 signal.
#autosave_interval 1800
# If true, mosquitto will count the number of subscription changes, retained
# messages received and queued messages and if the total exceeds
# autosave_interval then the in-memory database will be saved to disk.
# If false, mosquitto will save the in-memory database to disk by treating
# autosave_interval as a time in seconds.
#autosave_on_changes false
# Save persistent message data to disk (true/false).
# This saves information about all messages, including
# subscriptions, currently in-flight messages and retained
# messages.
# retained_persistence is a synonym for this option.
#persistence false
# The filename to use for the persistent database, not including
# the path.
#persistence_file mosquitto.db
# Location for persistent database.
# Default is an empty string (current directory).
# Set to e.g. /var/lib/mosquitto if running as a proper service on Linux or
# similar.
#persistence_location
# =================================================================
# Logging
# =================================================================
# Places to log to. Use multiple log_dest lines for multiple
# logging destinations.
# Possible destinations are: stdout stderr syslog topic file dlt
#
# stdout and stderr log to the console on the named output.
#
# syslog uses the userspace syslog facility which usually ends up
# in /var/log/messages or similar.
#
# topic logs to the broker topic '$SYS/broker/log/<severity>',
# where severity is one of D, E, W, N, I, M which are debug, error,
# warning, notice, information and message. Message type severity is used by
# the subscribe/unsubscribe log_types and publishes log messages to
# $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe.
#
# The file destination requires an additional parameter which is the file to be
# logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be
# closed and reopened when the broker receives a HUP signal. Only a single file
# destination may be configured.
#
# The dlt destination is for the automotive `Diagnostic Log and Trace` tool.
# This requires that Mosquitto has been compiled with DLT support.
#
# Note that if the broker is running as a Windows service it will default to
# "log_dest none" and neither stdout nor stderr logging is available.
# Use "log_dest none" if you wish to disable logging.
#log_dest stderr
# Types of messages to log. Use multiple log_type lines for logging
# multiple types of messages.
# Possible types are: debug, error, warning, notice, information,
# none, subscribe, unsubscribe, websockets, all.
# Note that debug type messages are for decoding the incoming/outgoing
# network packets. They are not logged in "topics".
#log_type error
#log_type warning
#log_type notice
#log_type information
# If set to true, client connection and disconnection messages will be included
# in the log.
#connection_messages true
# If using syslog logging (not on Windows), messages will be logged to the
# "daemon" facility by default. Use the log_facility option to choose which of
# local0 to local7 to log to instead. The option value should be an integer
# value, e.g. "log_facility 5" to use local5.
#log_facility
# If set to true, add a timestamp value to each log message.
#log_timestamp true
# Set the format of the log timestamp. If left unset, this is the number of
# seconds since the Unix epoch.
# This is a free text string which will be passed to the strftime function. To
# get an ISO 8601 datetime, for example:
# log_timestamp_format %Y-%m-%dT%H:%M:%S
#log_timestamp_format
# Change the websockets logging level. This is a global option, it is not
# possible to set per listener. This is an integer that is interpreted by
# libwebsockets as a bit mask for its lws_log_levels enum. See the
# libwebsockets documentation for more details. "log_type websockets" must also
# be enabled.
#websockets_log_level 0
# =================================================================
# Security
# =================================================================
# If set, only clients that have a matching prefix on their
# clientid will be allowed to connect to the broker. By default,
# all clients may connect.
# For example, setting "secure-" here would mean a client "secure-
# client" could connect but another with clientid "mqtt" couldn't.
#clientid_prefixes
# Boolean value that determines whether clients that connect
# without providing a username are allowed to connect. If set to
# false then a password file should be created (see the
# password_file option) to control authenticated client access.
#
# Defaults to false, unless there are no listeners defined in the configuration
# file, in which case it is set to true, but connections are only allowed from
# the local machine.
allow_anonymous true
# -----------------------------------------------------------------
# Default authentication and topic access control
# -----------------------------------------------------------------
# Control access to the broker using a password file. This file can be
# generated using the mosquitto_passwd utility. If TLS support is not compiled
# into mosquitto (it is recommended that TLS support should be included) then
# plain text passwords are used, in which case the file should be a text file
# with lines in the format:
# username:password
# The password (and colon) may be omitted if desired, although this
# offers very little in the way of security.
#
# See the TLS client require_certificate and use_identity_as_username options
# for alternative authentication options. If a plugin is used as well as
# password_file, the plugin check will be made first.
#password_file
# Access may also be controlled using a pre-shared-key file. This requires
# TLS-PSK support and a listener configured to use it. The file should be text
# lines in the format:
# identity:key
# The key should be in hexadecimal format without a leading "0x".
# If an plugin is used as well, the plugin check will be made first.
#psk_file
# Control access to topics on the broker using an access control list
# file. If this parameter is defined then only the topics listed will
# have access.
# If the first character of a line of the ACL file is a # it is treated as a
# comment.
# Topic access is added with lines of the format:
#
# topic [read|write|readwrite|deny] <topic>
#
# The access type is controlled using "read", "write", "readwrite" or "deny".
# This parameter is optional (unless <topic> contains a space character) - if
# not given then the access is read/write. <topic> can contain the + or #
# wildcards as in subscriptions.
#
# The "deny" option can used to explicity deny access to a topic that would
# otherwise be granted by a broader read/write/readwrite statement. Any "deny"
# topics are handled before topics that grant read/write access.
#
# The first set of topics are applied to anonymous clients, assuming
# allow_anonymous is true. User specific topic ACLs are added after a
# user line as follows:
#
# user <username>
#
# The username referred to here is the same as in password_file. It is
# not the clientid.
#
#
# If is also possible to define ACLs based on pattern substitution within the
# topic. The patterns available for substition are:
#
# %c to match the client id of the client
# %u to match the username of the client
#
# The substitution pattern must be the only text for that level of hierarchy.
#
# The form is the same as for the topic keyword, but using pattern as the
# keyword.
# Pattern ACLs apply to all users even if the "user" keyword has previously
# been given.
#
# If using bridges with usernames and ACLs, connection messages can be allowed
# with the following pattern:
# pattern write $SYS/broker/connection/%c/state
#
# pattern [read|write|readwrite] <topic>
#
# Example:
#
# pattern write sensor/%u/data
#
# If an plugin is used as well as acl_file, the plugin check will be
# made first.
#acl_file
# -----------------------------------------------------------------
# External authentication and topic access plugin options
# -----------------------------------------------------------------
# External authentication and access control can be supported with the
# plugin option. This is a path to a loadable plugin. See also the
# plugin_opt_* options described below.
#
# The plugin option can be specified multiple times to load multiple
# plugins. The plugins will be processed in the order that they are specified
# here. If the plugin option is specified alongside either of
# password_file or acl_file then the plugin checks will be made first.
#
# If the per_listener_settings option is false, the plugin will be apply to all
# listeners. If per_listener_settings is true, then the plugin will apply to
# the current listener being defined only.
#
# This option is also available as `auth_plugin`, but this use is deprecated
# and will be removed in the future.
#
#plugin
# If the plugin option above is used, define options to pass to the
# plugin here as described by the plugin instructions. All options named
# using the format plugin_opt_* will be passed to the plugin, for example:
#
# This option is also available as `auth_opt_*`, but this use is deprecated
# and will be removed in the future.
#
# plugin_opt_db_host
# plugin_opt_db_port
# plugin_opt_db_username
# plugin_opt_db_password
# =================================================================
# Bridges
# =================================================================
# A bridge is a way of connecting multiple MQTT brokers together.
# Create a new bridge using the "connection" option as described below. Set
# options for the bridges using the remaining parameters. You must specify the
# address and at least one topic to subscribe to.
#
# Each connection must have a unique name.
#
# The address line may have multiple host address and ports specified. See
# below in the round_robin description for more details on bridge behaviour if
# multiple addresses are used. Note that if you use an IPv6 address, then you
# are required to specify a port.
#
# The direction that the topic will be shared can be chosen by
# specifying out, in or both, where the default value is out.
# The QoS level of the bridged communication can be specified with the next
# topic option. The default QoS level is 0, to change the QoS the topic
# direction must also be given.
#
# The local and remote prefix options allow a topic to be remapped when it is
# bridged to/from the remote broker. This provides the ability to place a topic
# tree in an appropriate location.
#
# For more details see the mosquitto.conf man page.
#
# Multiple topics can be specified per connection, but be careful
# not to create any loops.
#
# If you are using bridges with cleansession set to false (the default), then
# you may get unexpected behaviour from incoming topics if you change what
# topics you are subscribing to. This is because the remote broker keeps the
# subscription for the old topic. If you have this problem, connect your bridge
# with cleansession set to true, then reconnect with cleansession set to false
# as normal.
#connection <name>
#address <host>[:<port>] [<host>[:<port>]]
#topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]
# If you need to have the bridge connect over a particular network interface,
# use bridge_bind_address to tell the bridge which local IP address the socket
# should bind to, e.g. `bridge_bind_address 192.168.1.10`
#bridge_bind_address
# If a bridge has topics that have "out" direction, the default behaviour is to
# send an unsubscribe request to the remote broker on that topic. This means
# that changing a topic direction from "in" to "out" will not keep receiving
# incoming messages. Sending these unsubscribe requests is not always
# desirable, setting bridge_attempt_unsubscribe to false will disable sending
# the unsubscribe request.
#bridge_attempt_unsubscribe true
# Set the version of the MQTT protocol to use with for this bridge. Can be one
# of mqttv50, mqttv311 or mqttv31. Defaults to mqttv311.
#bridge_protocol_version mqttv311
# Set the clean session variable for this bridge.
# When set to true, when the bridge disconnects for any reason, all
# messages and subscriptions will be cleaned up on the remote
# broker. Note that with cleansession set to true, there may be a
# significant amount of retained messages sent when the bridge
# reconnects after losing its connection.
# When set to false, the subscriptions and messages are kept on the
# remote broker, and delivered when the bridge reconnects.
#cleansession false
# Set the amount of time a bridge using the lazy start type must be idle before
# it will be stopped. Defaults to 60 seconds.
#idle_timeout 60
# Set the keepalive interval for this bridge connection, in
# seconds.
#keepalive_interval 60
# Set the clientid to use on the local broker. If not defined, this defaults to
# 'local.<clientid>'. If you are bridging a broker to itself, it is important
# that local_clientid and clientid do not match.
#local_clientid
# If set to true, publish notification messages to the local and remote brokers
# giving information about the state of the bridge connection. Retained
# messages are published to the topic $SYS/broker/connection/<clientid>/state
# unless the notification_topic option is used.
# If the message is 1 then the connection is active, or 0 if the connection has
# failed.
# This uses the last will and testament feature.
#notifications true
# Choose the topic on which notification messages for this bridge are
# published. If not set, messages are published on the topic
# $SYS/broker/connection/<clientid>/state
#notification_topic
# Set the client id to use on the remote end of this bridge connection. If not
# defined, this defaults to 'name.hostname' where name is the connection name
# and hostname is the hostname of this computer.
# This replaces the old "clientid" option to avoid confusion. "clientid"
# remains valid for the time being.
#remote_clientid
# Set the password to use when connecting to a broker that requires
# authentication. This option is only used if remote_username is also set.
# This replaces the old "password" option to avoid confusion. "password"
# remains valid for the time being.
#remote_password
# Set the username to use when connecting to a broker that requires
# authentication.
# This replaces the old "username" option to avoid confusion. "username"
# remains valid for the time being.
#remote_username
# Set the amount of time a bridge using the automatic start type will wait
# until attempting to reconnect.
# This option can be configured to use a constant delay time in seconds, or to
# use a backoff mechanism based on "Decorrelated Jitter", which adds a degree
# of randomness to when the restart occurs.
#
# Set a constant timeout of 20 seconds:
# restart_timeout 20
#
# Set backoff with a base (start value) of 10 seconds and a cap (upper limit) of
# 60 seconds:
# restart_timeout 10 30
#
# Defaults to jitter with a base of 5 and cap of 30
#restart_timeout 5 30
# If the bridge has more than one address given in the address/addresses
# configuration, the round_robin option defines the behaviour of the bridge on
# a failure of the bridge connection. If round_robin is false, the default
# value, then the first address is treated as the main bridge connection. If
# the connection fails, the other secondary addresses will be attempted in
# turn. Whilst connected to a secondary bridge, the bridge will periodically
# attempt to reconnect to the main bridge until successful.
# If round_robin is true, then all addresses are treated as equals. If a
# connection fails, the next address will be tried and if successful will
# remain connected until it fails
#round_robin false
# Set the start type of the bridge. This controls how the bridge starts and
# can be one of three types: automatic, lazy and once. Note that RSMB provides
# a fourth start type "manual" which isn't currently supported by mosquitto.
#
# "automatic" is the default start type and means that the bridge connection
# will be started automatically when the broker starts and also restarted
# after a short delay (30 seconds) if the connection fails.
#
# Bridges using the "lazy" start type will be started automatically when the
# number of queued messages exceeds the number set with the "threshold"
# parameter. It will be stopped automatically after the time set by the
# "idle_timeout" parameter. Use this start type if you wish the connection to
# only be active when it is needed.
#
# A bridge using the "once" start type will be started automatically when the
# broker starts but will not be restarted if the connection fails.
#start_type automatic
# Set the number of messages that need to be queued for a bridge with lazy
# start type to be restarted. Defaults to 10 messages.
# Must be less than max_queued_messages.
#threshold 10
# If try_private is set to true, the bridge will attempt to indicate to the
# remote broker that it is a bridge not an ordinary client. If successful, this
# means that loop detection will be more effective and that retained messages
# will be propagated correctly. Not all brokers support this feature so it may
# be necessary to set try_private to false if your bridge does not connect
# properly.
#try_private true
# Some MQTT brokers do not allow retained messages. MQTT v5 gives a mechanism
# for brokers to tell clients that they do not support retained messages, but
# this is not possible for MQTT v3.1.1 or v3.1. If you need to bridge to a
# v3.1.1 or v3.1 broker that does not support retained messages, set the
# bridge_outgoing_retain option to false. This will remove the retain bit on
# all outgoing messages to that bridge, regardless of any other setting.
#bridge_outgoing_retain true
# If you wish to restrict the size of messages sent to a remote bridge, use the
# bridge_max_packet_size option. This sets the maximum number of bytes for
# the total message, including headers and payload.
# Note that MQTT v5 brokers may provide their own maximum-packet-size property.
# In this case, the smaller of the two limits will be used.
# Set to 0 for "unlimited".
#bridge_max_packet_size 0
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
# Either bridge_cafile or bridge_capath must be defined to enable TLS support
# for this bridge.
# bridge_cafile defines the path to a file containing the
# Certificate Authority certificates that have signed the remote broker
# certificate.
# bridge_capath defines a directory that will be searched for files containing
# the CA certificates. For bridge_capath to work correctly, the certificate
# files must have ".crt" as the file ending and you must run "openssl rehash
# <path to capath>" each time you add/remove a certificate.
#bridge_cafile
#bridge_capath
# If the remote broker has more than one protocol available on its port, e.g.
# MQTT and WebSockets, then use bridge_alpn to configure which protocol is
# requested. Note that WebSockets support for bridges is not yet available.
#bridge_alpn
# When using certificate based encryption, bridge_insecure disables
# verification of the server hostname in the server certificate. This can be
# useful when testing initial server configurations, but makes it possible for
# a malicious third party to impersonate your server through DNS spoofing, for
# example. Use this option in testing only. If you need to resort to using this
# option in a production environment, your setup is at fault and there is no
# point using encryption.
#bridge_insecure false
# Path to the PEM encoded client certificate, if required by the remote broker.
#bridge_certfile
# Path to the PEM encoded client private key, if required by the remote broker.
#bridge_keyfile
# -----------------------------------------------------------------
# PSK based SSL/TLS support
# -----------------------------------------------------------------
# Pre-shared-key encryption provides an alternative to certificate based
# encryption. A bridge can be configured to use PSK with the bridge_identity
# and bridge_psk options. These are the client PSK identity, and pre-shared-key
# in hexadecimal format with no "0x". Only one of certificate and PSK based
# encryption can be used on one
# bridge at once.
#bridge_identity
#bridge_psk
# =================================================================
# External config files
# =================================================================
# External configuration files may be included by using the
# include_dir option. This defines a directory that will be searched
# for config files. All files that end in '.conf' will be loaded as
# a configuration file. It is best to have this as the last option
# in the main file. This option will only be processed from the main
# configuration file. The directory specified must not contain the
# main configuration file.
# Files within include_dir will be loaded sorted in case-sensitive
# alphabetical order, with capital letters ordered first. If this option is
# given multiple times, all of the files from the first instance will be
# processed before the next instance. See the man page for examples.
#include_dir

View File

@@ -108,15 +108,15 @@ describe('Global prefix', () => {
server = app.getHttpServer();
await app.init();
await request(server).get('/hello/foo').expect(200);
await request(server)
.get('/hello/foo')
.expect(200, 'Hello: Data attached in middleware');
await request(server)
.get('/middleware/foo')
.expect(200, MIDDLEWARE_PARAM_VALUE);
await request(server)
.get('/api/v1/middleware/foo')
.expect(404);
await request(server).get('/api/v1/middleware/foo').expect(404);
});
afterEach(async () => {

View File

@@ -1,10 +1,10 @@
import { Controller, Get, Post } from '@nestjs/common';
import { Controller, Get, Post, Req } from '@nestjs/common';
@Controller()
export class AppController {
@Get('hello/:name')
getHello(): string {
return 'hello';
getHello(@Req() req): string {
return 'Hello: ' + req.extras?.data;
}
@Get('health')

View File

@@ -17,6 +17,11 @@ export class AppModule {
.apply((req, res, next) => res.end(MIDDLEWARE_PARAM_VALUE))
.forRoutes({ path: MIDDLEWARE_VALUE + '/*', method: RequestMethod.GET })
.apply((req, res, next) => res.status(201).end(MIDDLEWARE_PARAM_VALUE))
.forRoutes({ path: MIDDLEWARE_VALUE + '/*', method: RequestMethod.POST });
.forRoutes({ path: MIDDLEWARE_VALUE + '/*', method: RequestMethod.POST })
.apply((req, res, next) => {
req.extras = { data: 'Data attached in middleware' };
next();
})
.forRoutes({ path: '*', method: RequestMethod.GET });
}
}

View File

@@ -0,0 +1,49 @@
import { NestExpressApplication } from '@nestjs/platform-express';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { ExpressModule } from '../src/express.module';
describe('Raw body (Express Application)', () => {
let app: NestExpressApplication;
const body = '{ "amount":0.0 }';
beforeEach(async () => {
const moduleFixture = await Test.createTestingModule({
imports: [ExpressModule],
}).compile();
app = moduleFixture.createNestApplication<NestExpressApplication>(
undefined,
{ rawBody: true },
);
});
it('should return exact post body', async () => {
await app.init();
const response = await request(app.getHttpServer())
.post('/')
.set('Content-Type', 'application/json')
.send(body)
.expect(201);
expect(response.body).to.eql({
parsed: {
amount: 0,
},
raw: '{ "amount":0.0 }',
});
});
it('should work if post body is empty', async () => {
await app.init();
await request(app.getHttpServer())
.post('/')
.set('Content-Type', 'application/json')
.expect(201);
});
afterEach(async () => {
await app.close();
});
});

View File

@@ -0,0 +1,49 @@
import { NestFastifyApplication } from '@nestjs/platform-fastify';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { FastifyModule } from '../src/fastify.module';
describe('Raw body (Fastify Application)', () => {
let app: NestFastifyApplication;
const body = '{ "amount":0.0 }';
beforeEach(async () => {
const moduleFixture = await Test.createTestingModule({
imports: [FastifyModule],
}).compile();
app = moduleFixture.createNestApplication<NestFastifyApplication>(null, {
rawBody: true,
});
});
it('should return exact post body', async () => {
await app.init();
const response = await request(app.getHttpServer())
.post('/')
.set('Content-Type', 'application/json')
.set('Accept', 'application/json')
.send(body)
.expect(201);
expect(response.body).to.eql({
parsed: {
amount: 0,
},
raw: '{ "amount":0.0 }',
});
});
it('should work if post body is empty', async () => {
await app.init();
await request(app.getHttpServer())
.post('/')
.set('Content-Type', 'application/json')
.expect(201);
});
afterEach(async () => {
await app.close();
});
});

View File

@@ -0,0 +1,13 @@
import { Controller, Post, RawBodyRequest, Req } from '@nestjs/common';
import { Request } from 'express';
@Controller()
export class ExpressController {
@Post()
getRawBody(@Req() req: RawBodyRequest<Request>) {
return {
parsed: req.body,
raw: req.rawBody.toString(),
};
}
}

View File

@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { ExpressController } from './express.controller';
@Module({
controllers: [ExpressController],
})
export class ExpressModule {}

View File

@@ -0,0 +1,13 @@
import { Controller, Post, RawBodyRequest, Req } from '@nestjs/common';
import type { FastifyRequest } from 'fastify';
@Controller()
export class FastifyController {
@Post()
getRawBody(@Req() req: RawBodyRequest<FastifyRequest>) {
return {
parsed: req.body,
raw: req.rawBody.toString(),
};
}
}

View File

@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { FastifyController } from './fastify.controller';
@Module({
controllers: [FastifyController],
})
export class FastifyModule {}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
"allowJs": true,
"outDir": "./dist"
},
"include": [
"src/**/*",
"e2e/**/*"
],
"exclude": [
"node_modules"
]
}

View File

@@ -14,7 +14,7 @@ async function createNestApp(...gateways): Promise<INestApplication> {
const testingModule = await Test.createTestingModule({
providers: gateways,
}).compile();
const app = await testingModule.createNestApplication();
const app = testingModule.createNestApplication();
app.useWebSocketAdapter(new WsAdapter(app) as any);
return app;
}
@@ -40,6 +40,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
await new Promise<void>(resolve =>
ws.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws.close();
resolve();
}),
);
@@ -63,6 +64,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
await new Promise<void>(resolve =>
ws.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws.close();
resolve();
}),
);
@@ -89,6 +91,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
await new Promise<void>(resolve =>
ws.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws.close();
resolve();
}),
);
@@ -113,6 +116,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
ws.on('open', () => {
ws.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws.close();
resolve();
});
ws.send(
@@ -129,6 +133,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
await new Promise<void>(resolve => {
ws2.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws2.close();
resolve();
});
ws2.send(
@@ -158,6 +163,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
ws.on('open', () => {
ws.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws.close();
resolve();
});
ws.send(
@@ -174,6 +180,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
await new Promise<void>(resolve => {
ws2.on('message', data => {
expect(JSON.parse(data).data.test).to.be.eql('test');
ws2.close();
resolve();
});
ws2.send(
@@ -187,5 +194,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
});
});
afterEach(() => app.close());
afterEach(async function () {
await app.close();
});
});

View File

@@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "8.3.1"
"version": "8.4.5"
}

7202
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/core",
"version": "8.3.1",
"version": "8.4.4",
"description": "Modern, fast, powerful node.js web framework",
"homepage": "https://nestjs.com",
"repository": {
@@ -25,8 +25,8 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"format": "prettier \"**/*.ts\" --ignore-path ./.prettierignore --write && git status",
"postinstall": "opencollective",
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"test:integration": "mocha \"integration/*/{,!(node_modules)/**/}/*.spec.ts\" --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"test": "nyc mocha packages/**/*.spec.ts --reporter spec",
"test:integration": "mocha \"integration/*/{,!(node_modules)/**/}/*.spec.ts\" --reporter spec",
"test:docker:up": "docker-compose -f integration/docker-compose.yml up -d",
"test:docker:down": "docker-compose -f integration/docker-compose.yml down",
"lint": "concurrently 'npm run lint:packages' 'npm run lint:integration' 'npm run lint:spec'",
@@ -34,8 +34,9 @@
"lint:integration": "eslint 'integration/*/{,!(node_modules)/**/}/*.ts' -c '.eslintrc.spec.js'",
"lint:packages": "eslint 'packages/**/**.ts' --ignore-pattern 'packages/**/*.spec.ts'",
"lint:spec": "eslint 'packages/**/**.spec.ts' -c '.eslintrc.spec.js'",
"prerelease": "gulp copy-misc && gulp build --dist node_modules/@nestjs && npm run changelog | pbcopy",
"prerelease": "gulp copy-misc && gulp build --dist node_modules/@nestjs",
"publish": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --access public --exact -m \"chore(@nestjs) 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\"",
@@ -49,83 +50,83 @@
},
"dependencies": {
"@nuxtjs/opencollective": "0.3.2",
"axios": "0.26.0",
"axios": "0.27.2",
"class-transformer": "0.5.1",
"class-validator": "0.13.2",
"cli-color": "2.0.1",
"cli-color": "2.0.2",
"cors": "2.8.5",
"express": "4.17.3",
"fast-json-stringify": "3.0.3",
"express": "4.18.1",
"fast-json-stringify": "3.2.0",
"fast-safe-stringify": "2.1.1",
"graphql-subscriptions": "2.0.0",
"iterare": "1.2.1",
"object-hash": "3.0.0",
"path-to-regexp": "3.2.0",
"reflect-metadata": "0.1.13",
"rxjs": "7.5.4",
"socket.io": "4.4.1",
"tslib": "2.3.1",
"rxjs": "7.5.5",
"socket.io": "4.5.0",
"tslib": "2.4.0",
"uuid": "8.3.2"
},
"devDependencies": {
"@codechecks/client": "0.1.12",
"@commitlint/cli": "16.2.1",
"@commitlint/config-angular": "16.2.1",
"@grpc/grpc-js": "1.5.7",
"@grpc/proto-loader": "0.6.9",
"@nestjs/apollo": "10.0.5",
"@nestjs/graphql": "10.0.5",
"@nestjs/mongoose": "9.0.2",
"@commitlint/cli": "17.0.0",
"@commitlint/config-angular": "17.0.0",
"@fastify/cors": "7.0.0",
"@fastify/formbody": "6.0.0",
"@fastify/multipart": "6.0.0",
"@fastify/static": "5.0.0",
"@grpc/grpc-js": "1.6.7",
"@grpc/proto-loader": "0.6.12",
"@nestjs/apollo": "10.0.11",
"@nestjs/graphql": "10.0.8",
"@nestjs/mongoose": "9.0.3",
"@nestjs/typeorm": "8.0.3",
"@types/amqplib": "0.8.2",
"@types/bytes": "3.1.1",
"@types/cache-manager": "3.4.3",
"@types/chai": "4.3.0",
"@types/chai": "4.3.1",
"@types/chai-as-promised": "7.1.5",
"@types/cors": "2.8.12",
"@types/express": "4.17.13",
"@types/gulp": "4.0.9",
"@types/http-errors": "1.8.2",
"@types/mocha": "9.1.0",
"@types/node": "17.0.21",
"@types/redis": "4.0.11",
"@types/mocha": "9.1.1",
"@types/node": "17.0.34",
"@types/reflect-metadata": "0.1.0",
"@types/sinon": "10.0.11",
"@types/socket.io": "3.0.2",
"@types/ws": "8.5.1",
"@types/supertest": "2.0.12",
"@types/ws": "8.5.3",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"amqp-connection-manager": "4.1.1",
"amqplib": "0.8.0",
"apollo-server-core": "3.6.3",
"apollo-server-express": "3.6.3",
"amqp-connection-manager": "4.1.3",
"amqplib": "0.9.0",
"apollo-server-core": "3.7.0",
"apollo-server-express": "3.7.0",
"artillery": "1.7.9",
"body-parser": "1.19.2",
"body-parser": "1.20.0",
"bytes": "3.1.2",
"cache-manager": "3.6.0",
"cache-manager": "3.6.1",
"cache-manager-redis-store": "2.0.0",
"chai": "4.3.6",
"chai-as-promised": "7.1.1",
"clang-format": "1.6.0",
"clang-format": "1.8.0",
"commitlint-circle": "1.0.0",
"concurrently": "7.0.0",
"concurrently": "7.2.0",
"conventional-changelog": "3.1.25",
"core-js": "3.21.1",
"core-js": "3.22.5",
"coveralls": "3.1.1",
"delete-empty": "3.0.0",
"engine.io-client": "6.1.1",
"engine.io-client": "6.2.2",
"eslint": "7.32.0",
"eslint-config-prettier": "8.4.0",
"eslint-plugin-import": "2.25.4",
"eventsource": "1.1.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eventsource": "2.0.2",
"fancy-log": "2.0.0",
"fastify": "3.27.2",
"fastify-cors": "6.0.3",
"fastify-formbody": "5.2.0",
"fastify-multipart": "5.3.1",
"fastify-static": "4.5.0",
"graphql": "15.7.2",
"graphql-tools": "7.0.5",
"fastify": "3.29.0",
"graphql": "15.8.0",
"graphql-tools": "8.2.9",
"gulp": "4.0.2",
"gulp-clang-format": "1.0.27",
"gulp-clean": "0.4.0",
@@ -133,43 +134,43 @@
"gulp-typescript": "5.0.1",
"gulp-watch": "5.0.1",
"http-errors": "2.0.0",
"husky": "7.0.4",
"husky": "8.0.1",
"imports-loader": "3.1.1",
"ioredis": "5.0.4",
"json-loader": "0.5.7",
"kafkajs": "1.16.0",
"lerna": "2.11.0",
"kafkajs": "2.0.0",
"lerna": "3.0.0",
"lerna-changelog": "2.2.0",
"light-my-request": "4.8.0",
"lint-staged": "12.3.4",
"light-my-request": "4.10.1",
"lint-staged": "12.4.1",
"markdown-table": "2.0.0",
"merge-graphql-schemas": "1.7.8",
"middie": "6.0.0",
"mocha": "9.2.1",
"mongoose": "6.2.4",
"mqtt": "4.3.6",
"middie": "6.1.0",
"mocha": "10.0.0",
"mongoose": "6.3.3",
"mqtt": "4.3.7",
"multer": "1.4.4",
"mysql2": "2.3.3",
"nats": "2.6.1",
"nodemon": "2.0.15",
"nodemon": "2.0.16",
"nyc": "15.1.0",
"point-of-view": "5.1.0",
"prettier": "2.5.1",
"redis": "3.1.2",
"point-of-view": "5.3.0",
"prettier": "2.6.2",
"rxjs-compat": "6.6.7",
"sinon": "13.0.1",
"sinon": "14.0.0",
"sinon-chai": "3.7.0",
"socket.io-client": "4.4.1",
"socket.io-client": "4.5.0",
"subscriptions-transport-ws": "0.11.0",
"supertest": "6.2.2",
"ts-morph": "13.0.3",
"ts-node": "10.5.0",
"typeorm": "0.2.44",
"typescript": "4.3.5",
"supertest": "6.2.3",
"ts-morph": "14.0.0",
"ts-node": "10.7.0",
"typeorm": "0.2.45",
"typescript": "4.6.4",
"wrk": "1.2.1",
"ws": "7.5.6"
"ws": "8.6.0"
},
"engines": {
"node": ">= 10.13.0"
"node": ">= 12.9.0"
},
"collective": {
"type": "opencollective",
@@ -223,5 +224,13 @@
],
"sourceMap": true,
"instrument": true
},
"mocha": {
"require": [
"ts-node/register",
"node_modules/reflect-metadata/Reflect.js",
"hooks/mocha-init-hook.ts"
],
"exit": true
}
}

View File

@@ -54,7 +54,7 @@ With official support, you can get expert help straight from Nest core team. We
## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
#### Principal Sponsors
<table style="text-align:center;"><tr>
@@ -64,17 +64,20 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
<td>
<a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
</tr></table>
#### Gold Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="150" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
<td>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td></</tr></table>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
<td>
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
<a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
#### Silver Sponsors

View File

@@ -1,4 +1,3 @@
export const CACHE_MANAGER = 'CACHE_MANAGER';
export const CACHE_MODULE_OPTIONS = 'CACHE_MODULE_OPTIONS';
export const CACHE_KEY_METADATA = 'cache_module:cache_key';
export const CACHE_TTL_METADATA = 'cache_module:cache_ttl';

View File

@@ -0,0 +1,12 @@
import { ConfigurableModuleBuilder } from '../module-utils';
import {
CacheModuleOptions,
CacheOptionsFactory,
} from './interfaces/cache-module.interface';
export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } =
new ConfigurableModuleBuilder<CacheModuleOptions>({
moduleName: 'Cache',
})
.setFactoryMethodName('createCacheOptions' as keyof CacheOptionsFactory)
.build();

View File

@@ -1,11 +1,11 @@
import { Module } from '../decorators';
import { DynamicModule, Provider } from '../interfaces';
import { CACHE_MANAGER, CACHE_MODULE_OPTIONS } from './cache.constants';
import { DynamicModule } from '../interfaces';
import { CACHE_MANAGER } from './cache.constants';
import { ConfigurableModuleClass } from './cache.module-definition';
import { createCacheManager } from './cache.providers';
import {
CacheModuleAsyncOptions,
CacheModuleOptions,
CacheOptionsFactory,
} from './interfaces/cache-module.interface';
/**
@@ -19,7 +19,7 @@ import {
providers: [createCacheManager()],
exports: [CACHE_MANAGER],
})
export class CacheModule {
export class CacheModule extends ConfigurableModuleClass {
/**
* Configure the cache manager statically.
*
@@ -31,9 +31,8 @@ export class CacheModule {
options: CacheModuleOptions<StoreConfig> = {} as any,
): DynamicModule {
return {
module: CacheModule,
global: options.isGlobal,
providers: [{ provide: CACHE_MODULE_OPTIONS, useValue: options }],
...super.register(options),
};
}
@@ -48,47 +47,11 @@ export class CacheModule {
static registerAsync<
StoreConfig extends Record<any, any> = Record<string, any>,
>(options: CacheModuleAsyncOptions<StoreConfig>): DynamicModule {
const moduleDefinition = super.registerAsync(options);
return {
module: CacheModule,
global: options.isGlobal,
imports: options.imports,
providers: [
...this.createAsyncProviders<StoreConfig>(options),
...(options.extraProviders || []),
],
};
}
private static createAsyncProviders<StoreConfig extends Record<any, any>>(
options: CacheModuleAsyncOptions<StoreConfig>,
): Provider[] {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)];
}
return [
this.createAsyncOptionsProvider(options),
{
provide: options.useClass,
useClass: options.useClass,
},
];
}
private static createAsyncOptionsProvider<
StoreConfig extends Record<any, any>,
>(options: CacheModuleAsyncOptions<StoreConfig>): Provider {
if (options.useFactory) {
return {
provide: CACHE_MODULE_OPTIONS,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
return {
provide: CACHE_MODULE_OPTIONS,
useFactory: async (optionsFactory: CacheOptionsFactory<StoreConfig>) =>
optionsFactory.createCacheOptions(),
inject: [options.useExisting || options.useClass],
...moduleDefinition,
providers: moduleDefinition.providers.concat(options.extraProviders),
};
}
}

View File

@@ -1,6 +1,7 @@
import { Provider } from '../interfaces';
import { loadPackage } from '../utils/load-package.util';
import { CACHE_MANAGER, CACHE_MODULE_OPTIONS } from './cache.constants';
import { CACHE_MANAGER } from './cache.constants';
import { MODULE_OPTIONS_TOKEN } from './cache.module-definition';
import { defaultCacheOptions } from './default-options';
import { CacheManagerOptions } from './interfaces/cache-manager.interface';
@@ -31,6 +32,6 @@ export function createCacheManager(): Provider {
...(options || {}),
});
},
inject: [CACHE_MODULE_OPTIONS],
inject: [MODULE_OPTIONS_TOKEN],
};
}

View File

@@ -1,4 +1,5 @@
import { ModuleMetadata, Provider, Type } from '../../interfaces';
import { Provider, Type } from '../../interfaces';
import { ConfigurableModuleAsyncOptions } from '../../module-utils';
import { CacheManagerOptions } from './cache-manager.interface';
export type CacheModuleOptions<
@@ -39,7 +40,10 @@ export interface CacheOptionsFactory<
*/
export interface CacheModuleAsyncOptions<
StoreConfig extends Record<any, any> = Record<string, any>,
> extends Pick<ModuleMetadata, 'imports'> {
> extends ConfigurableModuleAsyncOptions<
CacheModuleOptions<StoreConfig>,
keyof CacheOptionsFactory
> {
/**
* Injection token resolving to an existing provider. The provider must implement
* the `CacheOptionsFactory` interface.
@@ -63,6 +67,9 @@ export interface CacheModuleAsyncOptions<
* Dependencies that a Factory may inject.
*/
inject?: any[];
/**
* Extra providers to be registered within a scope of this module.
*/
extraProviders?: Provider[];
/**
* If "true', register `CacheModule` as a global module.

View File

@@ -7,7 +7,7 @@ import { RENDER_METADATA } from '../../constants';
*
* @param template name of the render engine template file
*
* @see [Model-View-Controller](https://docs.nestjs.com/techniques.mvc)
* @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Bad Gateway* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Bad Request* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Conflict* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Forbidden* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Gateway Timeout* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Gone* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Http Version Not Supported* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { isObject, isString } from '../utils/shared.utils';
* Defines the base Nest HTTP exception, which is handled by the default
* Exceptions Handler.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -7,7 +7,7 @@ import { HttpException } from './http.exception';
* Any attempt to brew coffee with a teapot should result in the error code
* "418 I'm a teapot". The resulting entity body MAY be short and stout.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Internal Server Error* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Method Not Allowed* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Misdirected* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Not Acceptable* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Not Found* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Not Implemented* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Payload Too Large* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Precondition Failed* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Request Timeout* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Service Unavailable* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Unauthorized* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Unprocessable Entity* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -4,7 +4,7 @@ import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Unsupported Media Type* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/

View File

@@ -16,6 +16,7 @@ export class StreamableFile {
this.stream = new Readable();
this.stream.push(bufferOrReadStream);
this.stream.push(null);
this.options.length ??= bufferOrReadStream.length;
} else if (bufferOrReadStream.pipe && isFunction(bufferOrReadStream.pipe)) {
this.stream = bufferOrReadStream;
}

View File

@@ -1,3 +0,0 @@
export const AXIOS_INSTANCE_TOKEN = 'AXIOS_INSTANCE_TOKEN';
export const HTTP_MODULE_ID = 'HTTP_MODULE_ID';
export const HTTP_MODULE_OPTIONS = 'HTTP_MODULE_OPTIONS';

View File

@@ -1,99 +0,0 @@
import Axios from 'axios';
import { Module } from '../decorators/modules/module.decorator';
import { DynamicModule, Provider } from '../interfaces';
import { randomStringGenerator } from '../utils/random-string-generator.util';
import {
AXIOS_INSTANCE_TOKEN,
HTTP_MODULE_ID,
HTTP_MODULE_OPTIONS,
} from './http.constants';
import { HttpService } from './http.service';
import {
HttpModuleAsyncOptions,
HttpModuleOptions,
HttpModuleOptionsFactory,
} from './interfaces';
/**
* @deprecated "HttpModule" (from the "@nestjs/common" package) is deprecated and will be removed in the next major release. Please, use the "@nestjs/axios" package instead.
*/
@Module({
providers: [
HttpService,
{
provide: AXIOS_INSTANCE_TOKEN,
useValue: Axios,
},
],
exports: [HttpService],
})
export class HttpModule {
static register(config: HttpModuleOptions): DynamicModule {
return {
module: HttpModule,
providers: [
{
provide: AXIOS_INSTANCE_TOKEN,
useValue: Axios.create(config),
},
{
provide: HTTP_MODULE_ID,
useValue: randomStringGenerator(),
},
],
};
}
static registerAsync(options: HttpModuleAsyncOptions): DynamicModule {
return {
module: HttpModule,
imports: options.imports,
providers: [
...this.createAsyncProviders(options),
{
provide: AXIOS_INSTANCE_TOKEN,
useFactory: (config: HttpModuleOptions) => Axios.create(config),
inject: [HTTP_MODULE_OPTIONS],
},
{
provide: HTTP_MODULE_ID,
useValue: randomStringGenerator(),
},
...(options.extraProviders || []),
],
};
}
private static createAsyncProviders(
options: HttpModuleAsyncOptions,
): Provider[] {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)];
}
return [
this.createAsyncOptionsProvider(options),
{
provide: options.useClass,
useClass: options.useClass,
},
];
}
private static createAsyncOptionsProvider(
options: HttpModuleAsyncOptions,
): Provider {
if (options.useFactory) {
return {
provide: HTTP_MODULE_OPTIONS,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
return {
provide: HTTP_MODULE_OPTIONS,
useFactory: async (optionsFactory: HttpModuleOptionsFactory) =>
optionsFactory.createHttpOptions(),
inject: [options.useExisting || options.useClass],
};
}
}

View File

@@ -1,113 +0,0 @@
import Axios, {
AxiosInstance,
AxiosPromise,
AxiosRequestConfig,
AxiosResponse,
CancelTokenSource,
} from 'axios';
import { Observable } from 'rxjs';
import { Inject } from '../decorators';
import { Logger } from '../services';
import { AXIOS_INSTANCE_TOKEN } from './http.constants';
/**
* @deprecated "HttpModule" (from the "@nestjs/common" package) is deprecated and will be removed in the next major release. Please, use the "@nestjs/axios" package instead.
*/
export class HttpService {
private readonly logger = new Logger(HttpService.name);
constructor(
@Inject(AXIOS_INSTANCE_TOKEN)
private readonly instance: AxiosInstance = Axios,
) {
this.logger.warn(
'DEPRECATED! "HttpModule" (from the "@nestjs/common" package) is deprecated and will be removed in the next major release. Please, use the "@nestjs/axios" package instead.',
);
}
request<T = any>(config: AxiosRequestConfig): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.request, config);
}
get<T = any>(
url: string,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.get, url, config);
}
delete<T = any>(
url: string,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.delete, url, config);
}
head<T = any>(
url: string,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.head, url, config);
}
post<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.post, url, data, config);
}
put<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.put, url, data, config);
}
patch<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.patch, url, data, config);
}
get axiosRef(): AxiosInstance {
return this.instance;
}
private makeObservable<T>(
axios: (...args: any[]) => AxiosPromise<T>,
...args: any[]
) {
return new Observable<AxiosResponse<T>>(subscriber => {
const config: AxiosRequestConfig = { ...(args[args.length - 1] || {}) };
let cancelSource: CancelTokenSource;
if (!config.cancelToken) {
cancelSource = Axios.CancelToken.source();
config.cancelToken = cancelSource.token;
}
axios(...args)
.then(res => {
subscriber.next(res);
subscriber.complete();
})
.catch(err => {
subscriber.error(err);
});
return () => {
if (config.responseType === 'stream') {
return;
}
if (cancelSource) {
cancelSource.cancel();
}
};
});
}
}

View File

@@ -1,3 +0,0 @@
export * from './http.module';
export * from './http.service';
export * from './interfaces';

View File

@@ -1,19 +0,0 @@
import { AxiosRequestConfig } from 'axios';
import { ModuleMetadata, Provider, Type } from '../../interfaces';
export type HttpModuleOptions = AxiosRequestConfig;
export interface HttpModuleOptionsFactory {
createHttpOptions(): Promise<HttpModuleOptions> | HttpModuleOptions;
}
export interface HttpModuleAsyncOptions
extends Pick<ModuleMetadata, 'imports'> {
useExisting?: Type<HttpModuleOptionsFactory>;
useClass?: Type<HttpModuleOptionsFactory>;
useFactory?: (
...args: any[]
) => Promise<HttpModuleOptions> | HttpModuleOptions;
inject?: any[];
extraProviders?: Provider[];
}

View File

@@ -1 +0,0 @@
export * from './http-module.interface';

View File

@@ -1,6 +1,6 @@
/*
* Nest @common
* Copyright(c) 2017 - 2021 Kamil Mysliwiec
* Copyright(c) 2017 - 2022 Kamil Mysliwiec
* https://nestjs.com
* MIT Licensed
*/
@@ -11,7 +11,6 @@ export * from './decorators';
export * from './enums';
export * from './exceptions';
export * from './file-stream';
export * from './http';
export {
Abstract,
ArgumentMetadata,
@@ -49,6 +48,7 @@ export {
Paramtype,
PipeTransform,
Provider,
RawBodyRequest,
RpcExceptionFilter,
Scope,
ScopeOptions,
@@ -61,6 +61,7 @@ export {
WsExceptionFilter,
WsMessageHandler,
} from './interfaces';
export * from './module-utils';
export * from './pipes';
export * from './serializer';
export * from './services';

View File

@@ -67,7 +67,7 @@ export interface HttpServer<TRequest = any, TResponse = any> {
getRequestMethod?(request: TRequest): string;
getRequestUrl?(request: TRequest): string;
getInstance(): any;
registerParserMiddleware(): any;
registerParserMiddleware(...args: any[]): any;
enableCors(options: CorsOptions | CorsOptionsDelegate<TRequest>): any;
getHttpServer(): any;
initHttpServer(options: NestApplicationOptions): void;

View File

@@ -1,2 +1,3 @@
export * from './http-server.interface';
export * from './message-event.interface';
export * from './raw-body-request.interface';

View File

@@ -0,0 +1 @@
export type RawBodyRequest<T> = T & { rawBody?: Buffer };

View File

@@ -28,7 +28,7 @@ export type Provider<T = any> =
* };
* ```
*
* @see [Use class](https://docs.nestjs.com/fundamentals/custom-providers#use-class)
* @see [Class providers](https://docs.nestjs.com/fundamentals/custom-providers#class-providers-useclass)
* @see [Injection scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
*
* @publicApi
@@ -46,6 +46,12 @@ export interface ClassProvider<T = any> {
* Optional enum defining lifetime of the provider that is injected.
*/
scope?: Scope;
/**
* This option is only available on factory providers!
*
* @see [Use factory](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
*/
inject?: never;
}
/**
@@ -59,7 +65,7 @@ export interface ClassProvider<T = any> {
* };
* ```
*
* @see [Use value](https://docs.nestjs.com/fundamentals/custom-providers#use-value)
* @see [Value providers](https://docs.nestjs.com/fundamentals/custom-providers#value-providers-usevalue)
*
* @publicApi
*/
@@ -72,6 +78,12 @@ export interface ValueProvider<T = any> {
* Instance of a provider to be injected.
*/
useValue: T;
/**
* This option is only available on factory providers!
*
* @see [Use factory](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
*/
inject?: never;
}
/**
@@ -89,7 +101,7 @@ export interface ValueProvider<T = any> {
* };
* ```
*
* @see [Use factory](https://docs.nestjs.com/fundamentals/custom-providers#use-factory)
* @see [Factory providers](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
* @see [Injection scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
*
* @publicApi
@@ -102,7 +114,7 @@ export interface FactoryProvider<T = any> {
/**
* Factory function that returns an instance of the provider to be injected.
*/
useFactory: (...args: any[]) => T;
useFactory: (...args: any[]) => T | Promise<T>;
/**
* Optional list of providers to be injected into the context of the Factory function.
*/
@@ -124,7 +136,7 @@ export interface FactoryProvider<T = any> {
* };
* ```
*
* @see [Use existing](https://docs.nestjs.com/fundamentals/custom-providers#use-existing)
* @see [Alias providers](https://docs.nestjs.com/fundamentals/custom-providers#alias-providers-useexisting)
*
* @publicApi
*/

View File

@@ -21,4 +21,8 @@ export interface NestApplicationOptions extends NestApplicationContextOptions {
* Set of configurable HTTPS options
*/
httpsOptions?: HttpsOptions;
/**
* Whether to register the raw request body on the request. Use `req.rawBody`.
*/
rawBody?: boolean;
}

View File

@@ -0,0 +1,330 @@
import { DynamicModule, Provider } from '../interfaces';
import { Logger } from '../services/logger.service';
import { randomStringGenerator } from '../utils/random-string-generator.util';
import {
ASYNC_METHOD_SUFFIX,
CONFIGURABLE_MODULE_ID,
DEFAULT_FACTORY_CLASS_METHOD_KEY,
DEFAULT_METHOD_KEY,
} from './constants';
import {
ConfigurableModuleAsyncOptions,
ConfigurableModuleCls,
ConfigurableModuleOptionsFactory,
} from './interfaces';
import { ConfigurableModuleHost } from './interfaces/configurable-module-host.interface';
import { generateOptionsInjectionToken } from './utils/generate-options-injection-token.util';
/**
* @publicApi
*/
export interface ConfigurableModuleBuilderOptions {
/**
* Specified what injection token should be used for the module options provider.
* By default, an auto-generated UUID will be used.
*/
optionsInjectionToken?: string | symbol;
/**
* By default, an UUID will be used as a module options provider token.
* Explicitly specifying the "moduleName" will instruct the "ConfigurableModuleBuilder"
* to use a more descriptive provider token.
*
* For example, if `moduleName: "Cache"` then auto-generated provider token will be "CACHE_MODULE_OPTIONS".
*/
moduleName?: string;
/**
* Indicates whether module should always be "transient", meaning,
* every time you call the static method to construct a dynamic module,
* regardless of what arguments you pass in, a new "unique" module will be created.
*
* @default false
*/
alwaysTransient?: boolean;
}
/**
* Factory that lets you create configurable modules and
* provides a way to reduce the majority of dynamic module boilerplate.
*
* @publicApi
*/
export class ConfigurableModuleBuilder<
ModuleOptions,
StaticMethodKey extends string = typeof DEFAULT_METHOD_KEY,
FactoryClassMethodKey extends string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
ExtraModuleDefinitionOptions = {},
> {
protected staticMethodKey: StaticMethodKey;
protected factoryClassMethodKey: FactoryClassMethodKey;
protected extras: ExtraModuleDefinitionOptions;
protected transformModuleDefinition: (
definition: DynamicModule,
extraOptions: ExtraModuleDefinitionOptions,
) => DynamicModule;
protected readonly logger = new Logger(ConfigurableModuleBuilder.name);
constructor(
protected readonly options: ConfigurableModuleBuilderOptions = {},
parentBuilder?: ConfigurableModuleBuilder<ModuleOptions>,
) {
if (parentBuilder) {
this.staticMethodKey = parentBuilder.staticMethodKey as StaticMethodKey;
this.factoryClassMethodKey =
parentBuilder.factoryClassMethodKey as FactoryClassMethodKey;
this.transformModuleDefinition = parentBuilder.transformModuleDefinition;
this.extras = parentBuilder.extras as ExtraModuleDefinitionOptions;
}
}
/**
* Registers the "extras" object (a set of extra options that can be used to modify the dynamic module definition).
* Values you specify within the "extras" object will be used as default values (that can be overriden by module consumers).
*
* This method also applies the so-called "module definition transform function" that takes the auto-generated
* dynamic module object ("DynamicModule") and the actual consumer "extras" object as input parameters.
* The "extras" object consists of values explicitly specified by module consumers and default values.
*
* @example
* ```typescript
* .setExtras<{ isGlobal?: boolean }>({ isGlobal: false }, (definition, extras) =>
* ({ ...definition, global: extras.isGlobal })
* )
* ```
*/
setExtras<ExtraModuleDefinitionOptions>(
extras: ExtraModuleDefinitionOptions,
transformDefinition: (
definition: DynamicModule,
extras: ExtraModuleDefinitionOptions,
) => DynamicModule,
) {
const builder = new ConfigurableModuleBuilder<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey,
ExtraModuleDefinitionOptions
>(this.options, this as any);
builder.extras = extras;
builder.transformModuleDefinition = transformDefinition;
return builder;
}
/**
* Dynamic modules must expose public static methods that let you pass in
* configuration parameters (control the module's behavior from the outside).
* Some frequently used names that you may have seen in other modules are:
* "forRoot", "forFeature", "register", "configure".
*
* This method "setClassMethodName" lets you specify the name of the
* method that will be auto-generated.
*
* @param key name of the method
*/
setClassMethodName<StaticMethodKey extends string>(key: StaticMethodKey) {
const builder = new ConfigurableModuleBuilder<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey,
ExtraModuleDefinitionOptions
>(this.options, this as any);
builder.staticMethodKey = key;
return builder;
}
/**
* Asynchronously configured modules (that rely on other modules, i.e. "ConfigModule")
* let you pass the configuration factory class that will be registered and instantiated as a provider.
* This provider then will be used to retrieve the module's configuration. To provide the configuration,
* the corresponding factory method must be implemented.
*
* This method ("setFactoryMethodName") lets you control what method name will have to be
* implemented by the config factory (default is "create").
*
* @param key name of the method
*/
setFactoryMethodName<FactoryClassMethodKey extends string>(
key: FactoryClassMethodKey,
) {
const builder = new ConfigurableModuleBuilder<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey,
ExtraModuleDefinitionOptions
>(this.options, this as any);
builder.factoryClassMethodKey = key;
return builder;
}
/**
* Returns an object consisting of multiple properties that lets you
* easily construct dynamic configurable modules. See "ConfigurableModuleHost" interface for more details.
*/
build(): ConfigurableModuleHost<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey,
ExtraModuleDefinitionOptions
> {
this.staticMethodKey ??= DEFAULT_METHOD_KEY as StaticMethodKey;
this.factoryClassMethodKey ??=
DEFAULT_FACTORY_CLASS_METHOD_KEY as FactoryClassMethodKey;
this.options.optionsInjectionToken ??= this.options.moduleName
? this.constructInjectionTokenString()
: generateOptionsInjectionToken();
this.transformModuleDefinition ??= definition => definition;
return {
ConfigurableModuleClass:
this.createConfigurableModuleCls<ModuleOptions>(),
MODULE_OPTIONS_TOKEN: this.options.optionsInjectionToken,
ASYNC_OPTIONS_TYPE: this.createTypeProxy('ASYNC_OPTIONS_TYPE'),
OPTIONS_TYPE: this.createTypeProxy('OPTIONS_TYPE'),
};
}
private constructInjectionTokenString(): string {
const moduleNameInSnakeCase = this.options.moduleName
.trim()
.split(/(?=[A-Z])/)
.join('_')
.toUpperCase();
return `${moduleNameInSnakeCase}_MODULE_OPTIONS`;
}
private createConfigurableModuleCls<ModuleOptions>(): ConfigurableModuleCls<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey
> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
const asyncMethodKey = this.staticMethodKey + ASYNC_METHOD_SUFFIX;
class InternalModuleClass {
static [self.staticMethodKey](
options: ModuleOptions & ExtraModuleDefinitionOptions,
): DynamicModule {
const providers = [
{
provide: self.options.optionsInjectionToken,
useValue: this.omitExtras(options, self.extras),
},
];
if (self.options.alwaysTransient) {
providers.push({
provide: CONFIGURABLE_MODULE_ID,
useValue: randomStringGenerator(),
});
}
return self.transformModuleDefinition(
{
module: this,
providers,
},
options,
);
}
static [asyncMethodKey](
options: ConfigurableModuleAsyncOptions<ModuleOptions> &
ExtraModuleDefinitionOptions,
): DynamicModule {
const providers = this.createAsyncProviders(options);
if (self.options.alwaysTransient) {
providers.push({
provide: CONFIGURABLE_MODULE_ID,
useValue: randomStringGenerator(),
});
}
return self.transformModuleDefinition(
{
module: this,
imports: options.imports || [],
providers,
},
options,
);
}
private static omitExtras(
input: ModuleOptions & ExtraModuleDefinitionOptions,
extras: ExtraModuleDefinitionOptions | undefined,
): ModuleOptions {
if (!extras) {
return input;
}
const moduleOptions = {};
const extrasKeys = Object.keys(extras);
Object.keys(input)
.filter(key => !extrasKeys.includes(key))
.forEach(key => {
moduleOptions[key] = input[key];
});
return moduleOptions as ModuleOptions;
}
private static createAsyncProviders(
options: ConfigurableModuleAsyncOptions<ModuleOptions>,
): Provider[] {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)];
}
return [
this.createAsyncOptionsProvider(options),
{
provide: options.useClass,
useClass: options.useClass,
},
];
}
private static createAsyncOptionsProvider(
options: ConfigurableModuleAsyncOptions<ModuleOptions>,
): Provider {
if (options.useFactory) {
return {
provide: self.options.optionsInjectionToken,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
return {
provide: self.options.optionsInjectionToken,
useFactory: async (
optionsFactory: ConfigurableModuleOptionsFactory<
ModuleOptions,
FactoryClassMethodKey
>,
) =>
await optionsFactory[
self.factoryClassMethodKey as keyof typeof optionsFactory
](),
inject: [options.useExisting || options.useClass],
};
}
}
return InternalModuleClass as unknown as ConfigurableModuleCls<
ModuleOptions,
StaticMethodKey,
FactoryClassMethodKey
>;
}
private createTypeProxy(
typeName: 'OPTIONS_TYPE' | 'ASYNC_OPTIONS_TYPE' | 'OptionsFactoryInterface',
) {
const proxy = new Proxy(
{},
{
get: () => {
throw new Error(
`"${typeName}" is not supposed to be used as a value.`,
);
},
},
);
return proxy as any;
}
}

View File

@@ -0,0 +1,5 @@
export const DEFAULT_METHOD_KEY = 'register';
export const DEFAULT_FACTORY_CLASS_METHOD_KEY = 'create';
export const ASYNC_METHOD_SUFFIX = 'Async';
export const CONFIGURABLE_MODULE_ID = 'CONFIGURABLE_MODULE_ID';

View File

@@ -0,0 +1,2 @@
export * from './configurable-module.builder';
export * from './interfaces';

View File

@@ -0,0 +1,51 @@
import { FactoryProvider, ModuleMetadata, Type } from '../../interfaces';
import { DEFAULT_FACTORY_CLASS_METHOD_KEY } from '../constants';
/**
* Interface that must be implemented by the module options factory class.
* Method key varies depending on the "FactoryClassMethodKey" type argument.
*
* @publicApi
*/
export type ConfigurableModuleOptionsFactory<
ModuleOptions,
FactoryClassMethodKey extends string,
> = Record<
`${FactoryClassMethodKey}`,
() => Promise<ModuleOptions> | ModuleOptions
>;
/**
* Interface that represents the module async options object
* Factory method name varies depending on the "FactoryClassMethodKey" type argument.
*
* @publicApi
*/
export interface ConfigurableModuleAsyncOptions<
ModuleOptions,
FactoryClassMethodKey extends string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
> extends Pick<ModuleMetadata, 'imports'> {
/**
* Injection token resolving to an existing provider. The provider must implement
* the corresponding interface.
*/
useExisting?: Type<
ConfigurableModuleOptionsFactory<ModuleOptions, FactoryClassMethodKey>
>;
/**
* Injection token resolving to a class that will be instantiated as a provider.
* The class must implement the corresponding interface.
*/
useClass?: Type<
ConfigurableModuleOptionsFactory<ModuleOptions, FactoryClassMethodKey>
>;
/**
* Function returning options (or a Promise resolving to options) to configure the
* cache module.
*/
useFactory?: (...args: unknown[]) => Promise<ModuleOptions> | ModuleOptions;
/**
* Dependencies that a Factory may inject.
*/
inject?: FactoryProvider['inject'];
}

View File

@@ -0,0 +1,35 @@
import { DynamicModule } from '../../interfaces';
import {
DEFAULT_FACTORY_CLASS_METHOD_KEY,
DEFAULT_METHOD_KEY,
} from '../constants';
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface';
/**
* Class that represents a blueprint/prototype for a configurable Nest module.
* This class provides static methods for constructing dynamic modules. Their names
* can be controlled through the "MethodKey" type argument.
*
* @publicApi
*/
export type ConfigurableModuleCls<
ModuleOptions,
MethodKey extends string = typeof DEFAULT_METHOD_KEY,
FactoryClassMethodKey extends string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
ExtraModuleDefinitionOptions = {},
> = {
new (): any;
} & Record<
`${MethodKey}`,
(options: ModuleOptions & ExtraModuleDefinitionOptions) => DynamicModule
> &
Record<
`${MethodKey}Async`,
(
options: ConfigurableModuleAsyncOptions<
ModuleOptions,
FactoryClassMethodKey
> &
ExtraModuleDefinitionOptions,
) => DynamicModule
>;

View File

@@ -0,0 +1,77 @@
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface';
import { ConfigurableModuleCls } from './configurable-module-cls.interface';
/**
* Configurable module host. See properties for more details
*
* @publicApi
*/
export interface ConfigurableModuleHost<
ModuleOptions = Record<string, unknown>,
MethodKey extends string = string,
FactoryClassMethodKey extends string = string,
ExtraModuleDefinitionOptions = {},
> {
/**
* Class that represents a blueprint/prototype for a configurable Nest module.
* This class provides static methods for constructing dynamic modules. Their names
* can be controlled through the "MethodKey" type argument.
*
* Your module class should inherit from this class to make the static methods available.
*
* @example
* ```typescript
* @Module({})
* class IntegrationModule extends ConfigurableModuleCls {
* // ...
* }
* ```
*/
ConfigurableModuleClass: ConfigurableModuleCls<
ModuleOptions,
MethodKey,
FactoryClassMethodKey,
ExtraModuleDefinitionOptions
>;
/**
* Module options provider token. Can be used to inject the "options object" to
* providers registered within the host module.
*/
MODULE_OPTIONS_TOKEN: string | symbol;
/**
* Can be used to auto-infer the compound "async module options" type.
* Note: this property is not supposed to be used as a value.
*
* @example
* ```typescript
* @Module({})
* class IntegrationModule extends ConfigurableModuleCls {
* static module = initializer(IntegrationModule);
*
* static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
* return super.registerAsync(options);
* }
* ```
*/
ASYNC_OPTIONS_TYPE: ConfigurableModuleAsyncOptions<
ModuleOptions,
FactoryClassMethodKey
> &
ExtraModuleDefinitionOptions;
/**
* Can be used to auto-infer the compound "module options" type (options interface + extra module definition options).
* Note: this property is not supposed to be used as a value.
*
* @example
* ```typescript
* @Module({})
* class IntegrationModule extends ConfigurableModuleCls {
* static module = initializer(IntegrationModule);
*
* static register(options: typeof OPTIONS_TYPE): DynamicModule {
* return super.register(options);
* }
* ```
*/
OPTIONS_TYPE: ModuleOptions & ExtraModuleDefinitionOptions;
}

View File

@@ -0,0 +1,3 @@
export * from './configurable-module-async-options.interface';
export * from './configurable-module-cls.interface';
export * from './configurable-module-host.interface';

View File

@@ -0,0 +1,6 @@
import { randomStringGenerator } from '../../utils/random-string-generator.util';
export function generateOptionsInjectionToken() {
const hash = randomStringGenerator();
return `CONFIGURABLE_MODULE_OPTIONS[${hash}]`;
}

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/common",
"version": "8.3.1",
"version": "8.4.5",
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
"author": "Kamil Mysliwiec",
"homepage": "https://nestjs.com",
@@ -17,9 +17,9 @@
},
"license": "MIT",
"dependencies": {
"axios": "0.26.0",
"axios": "0.27.2",
"iterare": "1.2.1",
"tslib": "2.3.1",
"tslib": "2.4.0",
"uuid": "8.3.2"
},
"peerDependencies": {

View File

@@ -16,7 +16,7 @@ import { isNil, isNumber } from '../utils/shared.utils';
export class DefaultValuePipe<T = any, R = any>
implements PipeTransform<T, T | R>
{
constructor(private readonly defaultValue: R) {}
constructor(protected readonly defaultValue: R) {}
transform(value?: T, _metadata?: ArgumentMetadata): T | R {
if (

View File

@@ -36,7 +36,7 @@ export class ParseArrayPipe implements PipeTransform {
protected readonly validationPipe: ValidationPipe;
protected exceptionFactory: (error: string) => any;
constructor(@Optional() private readonly options: ParseArrayOptions = {}) {
constructor(@Optional() protected readonly options: ParseArrayOptions = {}) {
this.validationPipe = new ValidationPipe({
transform: true,
validateCustomDecorators: true,

View File

@@ -48,14 +48,32 @@ export class ParseBoolPipe
value: string | boolean,
metadata: ArgumentMetadata,
): Promise<boolean> {
if (value === true || value === 'true') {
if (this.isTrue(value)) {
return true;
}
if (value === false || value === 'false') {
if (this.isFalse(value)) {
return false;
}
throw this.exceptionFactory(
'Validation failed (boolean string is expected)',
);
}
/**
* @param value currently processed route argument
* @returns `true` if `value` is said 'true', ie., if it is equal to the boolean
* `true` or the string `"true"`
*/
protected isTrue(value: string | boolean): boolean {
return value === true || value === 'true';
}
/**
* @param value currently processed route argument
* @returns `true` if `value` is said 'false', ie., if it is equal to the boolean
* `false` or the string `"false"`
*/
protected isFalse(value: string | boolean): boolean {
return value === false || value === 'false';
}
}

View File

@@ -39,15 +39,23 @@ export class ParseFloatPipe implements PipeTransform<string> {
* @param metadata contains metadata about the currently processed route argument
*/
async transform(value: string, metadata: ArgumentMetadata): Promise<number> {
const isNumeric =
['string', 'number'].includes(typeof value) &&
!isNaN(parseFloat(value)) &&
isFinite(value as any);
if (!isNumeric) {
if (!this.isNumeric(value)) {
throw this.exceptionFactory(
'Validation failed (numeric string is expected)',
);
}
return parseFloat(value);
}
/**
* @param value currently processed route argument
* @returns `true` if `value` is a valid float number
*/
protected isNumeric(value: string): boolean {
return (
['string', 'number'].includes(typeof value) &&
!isNaN(parseFloat(value)) &&
isFinite(value as any)
);
}
}

View File

@@ -44,15 +44,23 @@ export class ParseIntPipe implements PipeTransform<string> {
* @param metadata contains metadata about the currently processed route argument
*/
async transform(value: string, metadata: ArgumentMetadata): Promise<number> {
const isNumeric =
['string', 'number'].includes(typeof value) &&
/^-?\d+$/.test(value) &&
isFinite(value as any);
if (!isNumeric) {
if (!this.isNumeric(value)) {
throw this.exceptionFactory(
'Validation failed (numeric string is expected)',
);
}
return parseInt(value, 10);
}
/**
* @param value currently processed route argument
* @returns `true` if `value` is a valid integer number
*/
protected isNumeric(value: string): boolean {
return (
['string', 'number'].includes(typeof value) &&
/^-?\d+$/.test(value) &&
isFinite(value as any)
);
}
}

View File

@@ -9,7 +9,7 @@ import {
ErrorHttpStatusCode,
HttpErrorByCode,
} from '../utils/http-error-by-code.util';
import { isUUID } from '../utils/is-uuid';
import { isString } from '../utils/shared.utils';
export interface ParseUUIDPipeOptions {
version?: '3' | '4' | '5';
@@ -19,6 +19,12 @@ export interface ParseUUIDPipeOptions {
@Injectable()
export class ParseUUIDPipe implements PipeTransform<string> {
protected static uuidRegExps = {
3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
};
private readonly version: '3' | '4' | '5';
protected exceptionFactory: (errors: string) => any;
@@ -35,14 +41,23 @@ export class ParseUUIDPipe implements PipeTransform<string> {
exceptionFactory ||
(error => new HttpErrorByCode[errorHttpStatusCode](error));
}
async transform(value: string, metadata: ArgumentMetadata): Promise<string> {
if (!isUUID(value, this.version)) {
if (!this.isUUID(value, this.version)) {
throw this.exceptionFactory(
`Validation failed (uuid ${
this.version ? 'v' + this.version : ''
`Validation failed (uuid${
this.version ? ` v ${this.version}` : ''
} is expected)`,
);
}
return value;
}
protected isUUID(str: unknown, version = 'all') {
if (!isString(str)) {
throw this.exceptionFactory('The value passed as UUID is not a string');
}
const pattern = ParseUUIDPipe.uuidRegExps[version];
return pattern?.test(str);
}
}

View File

@@ -183,27 +183,58 @@ export class ConsoleLogger implements LoggerService {
logLevel: LogLevel = 'log',
writeStreamType?: 'stdout' | 'stderr',
) {
const color = this.getColorByLogLevel(logLevel);
messages.forEach(message => {
const output = isPlainObject(message)
? `${color('Object:')}\n${JSON.stringify(
message,
(key, value) =>
typeof value === 'bigint' ? value.toString() : value,
2,
)}\n`
: color(message as string);
const pidMessage = color(`[Nest] ${process.pid} - `);
const pidMessage = this.formatPid(process.pid);
const contextMessage = context ? yellow(`[${context}] `) : '';
const timestampDiff = this.updateAndGetTimestampDiff();
const formattedLogLevel = color(logLevel.toUpperCase().padStart(7, ' '));
const computedMessage = `${pidMessage}${this.getTimestamp()} ${formattedLogLevel} ${contextMessage}${output}${timestampDiff}\n`;
const formattedLogLevel = logLevel.toUpperCase().padStart(7, ' ');
const formatedMessage = this.formatMessage(
logLevel,
message,
pidMessage,
formattedLogLevel,
contextMessage,
timestampDiff,
);
process[writeStreamType ?? 'stdout'].write(computedMessage);
process[writeStreamType ?? 'stdout'].write(formatedMessage);
});
}
protected formatPid(pid: number) {
return `[Nest] ${pid} - `;
}
protected formatMessage(
logLevel: LogLevel,
message: unknown,
pidMessage: string,
formattedLogLevel: string,
contextMessage: string,
timestampDiff: string,
) {
const output = this.stringifyMessage(message, logLevel);
pidMessage = this.colorize(pidMessage, logLevel);
formattedLogLevel = this.colorize(formattedLogLevel, logLevel);
return `${pidMessage}${this.getTimestamp()} ${formattedLogLevel} ${contextMessage}${output}${timestampDiff}\n`;
}
protected stringifyMessage(message: unknown, logLevel: LogLevel) {
return isPlainObject(message)
? `${this.colorize('Object:', logLevel)}\n${JSON.stringify(
message,
(key, value) =>
typeof value === 'bigint' ? value.toString() : value,
2,
)}\n`
: this.colorize(message as string, logLevel);
}
protected colorize(message: string, logLevel: LogLevel) {
const color = this.getColorByLogLevel(logLevel);
return color(message);
}
protected printStackTrace(stack: string) {
if (!stack) {
return;

View File

@@ -1,16 +0,0 @@
import { AxiosRequestConfig } from 'axios';
import { expect } from 'chai';
import { lastValueFrom } from 'rxjs';
import { HttpService } from '../../http/http.service';
describe('HttpService', () => {
it('should not mutate user-given axios options object', done => {
const http = new HttpService({ get: () => Promise.resolve() } as any);
const options: AxiosRequestConfig = {};
lastValueFrom(http.get('/', options)).then(() => {
expect(options.cancelToken).to.be.undefined;
done();
});
});
});

View File

@@ -0,0 +1,112 @@
import { expect } from 'chai';
import { Provider } from '../../interfaces';
import { ConfigurableModuleBuilder } from '../../module-utils';
describe('ConfigurableModuleBuilder', () => {
describe('setExtras', () => {
it('should apply module definition transformer function and return typed builder', () => {
const { ConfigurableModuleClass } = new ConfigurableModuleBuilder()
.setExtras(
{ isGlobal: false },
(definition, extras: { isGlobal: boolean }) => ({
...definition,
global: extras.isGlobal,
}),
)
.build();
expect(
ConfigurableModuleClass.register({
// No type error
isGlobal: true,
}),
).to.deep.include({
global: true,
});
});
});
describe('setClassMethodName', () => {
it('should set static class method name and return typed builder', () => {
const { ConfigurableModuleClass } = new ConfigurableModuleBuilder()
.setClassMethodName('forRoot')
.build();
expect(ConfigurableModuleClass.forRoot).to.not.be.undefined;
expect(ConfigurableModuleClass.forRootAsync).to.not.be.undefined;
expect((ConfigurableModuleClass as any).register).to.be.undefined;
});
});
describe('setFactoryMethodName', () => {
it('should set configuration factory class method name and return typed builder', () => {
const { ConfigurableModuleClass } = new ConfigurableModuleBuilder()
.setFactoryMethodName('createOptions')
.build();
expect(
ConfigurableModuleClass.registerAsync({
useClass: class {
// No type error
createOptions() {}
},
}),
).to.not.be.undefined;
});
});
describe('build', () => {
it('should return a fully typed "ConfigurableModuleClass"', () => {
type ExtraConfig = { isGlobal?: boolean; extraProviders: Provider[] };
const {
ConfigurableModuleClass,
OPTIONS_TYPE,
ASYNC_OPTIONS_TYPE,
MODULE_OPTIONS_TOKEN,
} = new ConfigurableModuleBuilder({
moduleName: 'RandomTest',
alwaysTransient: true,
})
.setFactoryMethodName('createOptions')
.setClassMethodName('forFeature')
.setExtras<ExtraConfig>(
{ isGlobal: false, extraProviders: [] },
(definition, extras) => ({
...definition,
global: extras.isGlobal,
providers: definition.providers?.concat(extras.extraProviders),
}),
)
.build();
const definition = ConfigurableModuleClass.forFeatureAsync({
useFactory: () => {},
isGlobal: true,
extraProviders: ['test' as any],
});
expect(definition.global).to.equal(true);
expect(definition.providers).to.have.length(3);
expect(definition.providers).to.deep.contain('test');
expect(MODULE_OPTIONS_TOKEN).to.equal('RANDOM_TEST_MODULE_OPTIONS');
expect((definition.providers[0] as any).provide).to.equal(
'RANDOM_TEST_MODULE_OPTIONS',
);
try {
expect(ASYNC_OPTIONS_TYPE.imports).to.equal(undefined);
} catch (err) {
expect(err).to.be.instanceOf(Error);
expect(err.message).to.equal(
'"ASYNC_OPTIONS_TYPE" is not supposed to be used as a value.',
);
}
try {
expect(OPTIONS_TYPE.isGlobal).to.equal(undefined);
} catch (err) {
expect(err).to.be.instanceOf(Error);
expect(err.message).to.equal(
'"OPTIONS_TYPE" is not supposed to be used as a value.',
);
}
});
});
});

View File

@@ -1,4 +1,3 @@
import * as sinon from 'sinon';
import { expect } from 'chai';
import { ArgumentMetadata } from '../../interfaces';
import { ParseIntPipe } from '../../pipes/parse-int.pipe';

View File

@@ -1,9 +1,18 @@
import { expect } from 'chai';
import { HttpStatus } from '../../enums';
import { HttpException } from '../../exceptions';
import { ArgumentMetadata } from '../../interfaces';
import { ParseUUIDPipe } from '../../pipes/parse-uuid.pipe';
class TestException extends HttpException {
constructor() {
super('This is a TestException', HttpStatus.I_AM_A_TEAPOT);
}
}
describe('ParseUUIDPipe', () => {
let target: ParseUUIDPipe;
const exceptionFactory = (error: any) => new TestException();
describe('transform', () => {
const v3 = 'e8b5a51d-11c8-3310-a6ab-367563f20686';
@@ -12,53 +21,80 @@ describe('ParseUUIDPipe', () => {
describe('when validation passes', () => {
it('should return string if value is uuid v3, v4 or v5', async () => {
target = new ParseUUIDPipe();
target = new ParseUUIDPipe({ exceptionFactory });
expect(await target.transform(v3, {} as ArgumentMetadata)).to.equal(v3);
expect(await target.transform(v4, {} as ArgumentMetadata)).to.equal(v4);
expect(await target.transform(v5, {} as ArgumentMetadata)).to.equal(v5);
});
it('should return string if value is uuid v3', async () => {
target = new ParseUUIDPipe({ version: '3' });
target = new ParseUUIDPipe({ version: '3', exceptionFactory });
expect(await target.transform(v3, {} as ArgumentMetadata)).to.equal(v3);
});
it('should return string if value is uuid v4', async () => {
target = new ParseUUIDPipe({ version: '4' });
target = new ParseUUIDPipe({ version: '4', exceptionFactory });
expect(await target.transform(v4, {} as ArgumentMetadata)).to.equal(v4);
});
it('should return string if value is uuid v5', async () => {
target = new ParseUUIDPipe({ version: '5' });
target = new ParseUUIDPipe({ version: '5', exceptionFactory });
expect(await target.transform(v5, {} as ArgumentMetadata)).to.equal(v5);
});
});
describe('when validation fails', () => {
it('should throw an error', async () => {
target = new ParseUUIDPipe();
expect(target.transform('123a', {} as ArgumentMetadata)).to.be.rejected;
target = new ParseUUIDPipe({ exceptionFactory });
await expect(
target.transform('123a', {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
});
it('should throw an error - not a string', async () => {
target = new ParseUUIDPipe({ exceptionFactory });
await expect(
target.transform(undefined, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
});
it('should throw an error - v3', async () => {
target = new ParseUUIDPipe({ version: '3' });
expect(target.transform('123a', {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v4, {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v5, {} as ArgumentMetadata)).to.be.rejected;
target = new ParseUUIDPipe({ version: '3', exceptionFactory });
await expect(
target.transform('123a', {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v4, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v5, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
});
it('should throw an error - v4', async () => {
target = new ParseUUIDPipe({ version: '4' });
expect(target.transform('123a', {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v3, {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v5, {} as ArgumentMetadata)).to.be.rejected;
target = new ParseUUIDPipe({ version: '4', exceptionFactory });
await expect(
target.transform('123a', {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v3, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v5, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
});
it('should throw an error - v5 ', async () => {
target = new ParseUUIDPipe({ version: '5' });
expect(target.transform('123a', {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v3, {} as ArgumentMetadata)).to.be.rejected;
expect(target.transform(v4, {} as ArgumentMetadata)).to.be.rejected;
target = new ParseUUIDPipe({ version: '5', exceptionFactory });
await expect(
target.transform('123a', {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v3, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
await expect(
target.transform(v4, {} as ArgumentMetadata),
).to.be.rejectedWith(TestException);
});
});
});

View File

@@ -1,7 +1,7 @@
import { expect } from 'chai';
import 'reflect-metadata';
import * as sinon from 'sinon';
import { ConsoleLogger, Logger, LoggerService } from '../../services';
import { ConsoleLogger, Logger, LoggerService, LogLevel } from '../../services';
describe('Logger', () => {
describe('[static methods]', () => {
@@ -520,4 +520,61 @@ describe('Logger', () => {
});
});
});
describe('ConsoleLogger', () => {
let processStdoutWriteSpy: sinon.SinonSpy;
beforeEach(() => {
processStdoutWriteSpy = sinon.spy(process.stdout, 'write');
});
afterEach(() => {
processStdoutWriteSpy.restore();
});
it('should support custom formatter', () => {
class CustomConsoleLogger extends ConsoleLogger {
protected formatMessage(
logLevel: LogLevel,
message: unknown,
pidMessage: string,
formattedLogLevel: string,
contextMessage: string,
timestampDiff: string,
) {
return `Prefix: ${message}`;
}
}
const consoleLogger = new CustomConsoleLogger();
consoleLogger.debug('test');
expect(processStdoutWriteSpy.firstCall.firstArg).to.equal(`Prefix: test`);
});
it('should support custom formatter and colorizer', () => {
class CustomConsoleLogger extends ConsoleLogger {
protected formatMessage(
logLevel: LogLevel,
message: unknown,
pidMessage: string,
formattedLogLevel: string,
contextMessage: string,
timestampDiff: string,
) {
const strMessage = this.stringifyMessage(message, logLevel);
return `Prefix: ${strMessage}`;
}
protected colorize(message: string, logLevel: LogLevel): string {
return `~~~${message}~~~`;
}
}
const consoleLogger = new CustomConsoleLogger();
consoleLogger.debug('test');
expect(processStdoutWriteSpy.firstCall.firstArg).to.equal(
`Prefix: ~~~test~~~`,
);
});
});
});

View File

@@ -1,17 +0,0 @@
import { BadRequestException } from '../exceptions';
import { isString } from './shared.utils';
const uuid = {
3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
};
export function isUUID(str: any, version = 'all') {
if (!isString(str)) {
throw new BadRequestException('The value passed as UUID is not a string');
}
const pattern = uuid[version];
return pattern && pattern.test(str);
}

View File

@@ -54,7 +54,7 @@ With official support, you can get expert help straight from Nest core team. We
## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
#### Principal Sponsors
<table style="text-align:center;"><tr>
@@ -64,17 +64,20 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
<td>
<a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
</tr></table>
#### Gold Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="150" valign="middle" /></a></td>
<td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
<td>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td></</tr></table>
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
<td>
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
<a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
#### Silver Sponsors

View File

@@ -110,7 +110,7 @@ export abstract class AbstractHttpAdapter<
abstract setErrorHandler(handler: Function, prefix?: string);
abstract setNotFoundHandler(handler: Function, prefix?: string);
abstract setHeader(response, name: string, value: string);
abstract registerParserMiddleware(prefix?: string);
abstract registerParserMiddleware(prefix?: string, rawBody?: boolean);
abstract enableCors(
options: CorsOptions | CorsOptionsDelegate<TRequest>,
prefix?: string,

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