@nestjs/cqrs 9.0.0 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,12 +17,12 @@ jobs:
17
17
  build:
18
18
  working_directory: ~/nest
19
19
  docker:
20
- - image: circleci/node:17
20
+ - image: cimg/node:19.6
21
21
  steps:
22
22
  - checkout
23
23
  - run:
24
24
  name: Update NPM version
25
- command: 'sudo npm install -g npm@latest'
25
+ command: sudo npm install -g npm@latest
26
26
  - restore_cache:
27
27
  key: dependency-cache-{{ checksum "package.json" }}
28
28
  - run:
@@ -41,4 +41,4 @@ workflows:
41
41
  build-and-test:
42
42
  jobs:
43
43
  - build
44
-
44
+
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no commitlint --edit $1
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no lint-staged
package/CONTRIBUTING.md CHANGED
@@ -27,7 +27,7 @@ Stack Overflow is a much better place to ask questions since:
27
27
 
28
28
  To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
29
29
 
30
- If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
30
+ If you would like to chat about the question in real-time, you can reach out via [our discord channel][discord].
31
31
 
32
32
  ## <a name="issue"></a> Found a Bug?
33
33
  If you find a bug in the source code, you can help us by
@@ -244,7 +244,7 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise
244
244
  [corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
245
245
  [dev-doc]: https://github.com/nestjs/nest/blob/master/docs/DEVELOPER.md
246
246
  [github]: https://github.com/nestjs/nest
247
- [gitter]: https://gitter.im/nestjs/nest
247
+ [discord]: https://discord.gg/nestjs
248
248
  [individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
249
249
  [js-style-guide]: https://google.github.io/styleguide/jsguide.html
250
250
  [jsfiddle]: http://jsfiddle.net
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2021 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-2022 Kamil Mysliwiec <https://kamilmysliwiec.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
2
+ <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
3
  </p>
4
4
 
5
5
  [travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
@@ -37,7 +37,7 @@ let CommandBus = class CommandBus extends observable_bus_1.ObservableBus {
37
37
  if (!handler) {
38
38
  throw new command_not_found_exception_1.CommandHandlerNotFoundException(commandId);
39
39
  }
40
- this.subject$.next(command);
40
+ this._publisher.publish(command);
41
41
  return handler.execute(command);
42
42
  }
43
43
  bind(handler, id) {
@@ -10,4 +10,4 @@ import { ICommand } from '../index';
10
10
  *
11
11
  * @see https://docs.nestjs.com/recipes/cqrs#commands
12
12
  */
13
- export declare const CommandHandler: (command: ICommand) => ClassDecorator;
13
+ export declare const CommandHandler: (command: ICommand | (new (...args: any[]) => ICommand)) => ClassDecorator;
@@ -16,7 +16,7 @@ const uuid_1 = require("uuid");
16
16
  */
17
17
  const CommandHandler = (command) => {
18
18
  return (target) => {
19
- if (!Reflect.hasMetadata(constants_1.COMMAND_METADATA, command)) {
19
+ if (!Reflect.hasOwnMetadata(constants_1.COMMAND_METADATA, command)) {
20
20
  Reflect.defineMetadata(constants_1.COMMAND_METADATA, { id: (0, uuid_1.v4)() }, command);
21
21
  }
22
22
  Reflect.defineMetadata(constants_1.COMMAND_HANDLER_METADATA, command, target);
@@ -16,7 +16,7 @@ const uuid_1 = require("uuid");
16
16
  */
17
17
  const QueryHandler = (query) => {
18
18
  return (target) => {
19
- if (!Reflect.hasMetadata(constants_1.QUERY_METADATA, query)) {
19
+ if (!Reflect.hasOwnMetadata(constants_1.QUERY_METADATA, query)) {
20
20
  Reflect.defineMetadata(constants_1.QUERY_METADATA, { id: (0, uuid_1.v4)() }, query);
21
21
  }
22
22
  Reflect.defineMetadata(constants_1.QUERY_HANDLER_METADATA, query, target);
package/dist/query-bus.js CHANGED
@@ -47,7 +47,7 @@ let QueryBus = class QueryBus extends observable_bus_1.ObservableBus {
47
47
  if (!handler) {
48
48
  throw new exceptions_1.QueryHandlerNotFoundException(queryId);
49
49
  }
50
- this.subject$.next(query);
50
+ this._publisher.publish(query);
51
51
  const result = yield handler.execute(query);
52
52
  return result;
53
53
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cqrs",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "A lightweight CQRS module for Nest framework (node.js)",
5
5
  "license": "MIT",
6
6
  "url": "https://github.com/nestjs/cqrs#readme",
@@ -14,32 +14,33 @@
14
14
  "prepublish:npm": "npm run build",
15
15
  "publish:npm": "npm publish --access public",
16
16
  "prerelease": "npm run build",
17
- "release": "release-it"
17
+ "release": "release-it",
18
+ "prepare": "husky install"
18
19
  },
19
20
  "dependencies": {
20
- "uuid": "8.3.2"
21
+ "uuid": "9.0.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@commitlint/cli": "17.0.3",
24
- "@commitlint/config-angular": "17.0.3",
25
- "@nestjs/common": "9.0.1",
26
- "@nestjs/core": "9.0.1",
27
- "@types/node": "16.11.43",
28
- "@types/jest": "28.1.4",
29
- "@typescript-eslint/eslint-plugin": "5.30.5",
30
- "@typescript-eslint/parser": "5.30.5",
31
- "eslint": "8.19.0",
32
- "eslint-config-prettier": "8.5.0",
33
- "eslint-plugin-import": "2.26.0",
34
- "husky": "8.0.1",
35
- "jest": "28.1.2",
36
- "lint-staged": "13.0.3",
37
- "prettier": "2.7.1",
24
+ "@commitlint/cli": "17.4.2",
25
+ "@commitlint/config-angular": "17.4.2",
26
+ "@nestjs/common": "9.3.7",
27
+ "@nestjs/core": "9.3.7",
28
+ "@types/node": "18.13.0",
29
+ "@types/jest": "29.4.0",
30
+ "@typescript-eslint/eslint-plugin": "5.51.0",
31
+ "@typescript-eslint/parser": "5.51.0",
32
+ "eslint": "8.33.0",
33
+ "eslint-config-prettier": "8.6.0",
34
+ "eslint-plugin-import": "2.27.5",
35
+ "husky": "8.0.3",
36
+ "jest": "29.4.2",
37
+ "lint-staged": "13.1.1",
38
+ "prettier": "2.8.4",
38
39
  "reflect-metadata": "0.1.13",
39
- "release-it": "15.1.1",
40
- "rxjs": "7.5.5",
41
- "ts-jest": "28.0.5",
42
- "typescript": "4.7.4"
40
+ "release-it": "15.6.0",
41
+ "rxjs": "7.8.0",
42
+ "ts-jest": "29.0.5",
43
+ "typescript": "4.9.5"
43
44
  },
44
45
  "peerDependencies": {
45
46
  "@nestjs/common": "^9.0.0",
@@ -48,15 +49,7 @@
48
49
  "rxjs": "^7.2.0"
49
50
  },
50
51
  "lint-staged": {
51
- "*.ts": [
52
- "prettier --write"
53
- ]
54
- },
55
- "husky": {
56
- "hooks": {
57
- "commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS",
58
- "pre-commit": "lint-staged"
59
- }
52
+ "**/*.{ts,json}": []
60
53
  },
61
54
  "repository": {
62
55
  "type": "git",