@nestjs/cqrs 10.2.5 → 10.2.7

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,7 +17,7 @@ jobs:
17
17
  build:
18
18
  working_directory: ~/nest
19
19
  docker:
20
- - image: cimg/node:20.3
20
+ - image: cimg/node:21.6
21
21
  steps:
22
22
  - checkout
23
23
  - run:
@@ -30,6 +30,7 @@ export declare class CommandBus<CommandBase extends ICommand = ICommand> extends
30
30
  register(handlers?: CommandHandlerType[]): void;
31
31
  protected registerHandler(handler: CommandHandlerType): void;
32
32
  private getCommandId;
33
+ private getCommandName;
33
34
  private reflectCommandId;
34
35
  private useDefaultPublisher;
35
36
  }
@@ -49,7 +49,8 @@ let CommandBus = class CommandBus extends observable_bus_1.ObservableBus {
49
49
  const commandId = this.getCommandId(command);
50
50
  const handler = this.handlers.get(commandId);
51
51
  if (!handler) {
52
- throw new command_not_found_exception_1.CommandHandlerNotFoundException(commandId);
52
+ const commandName = this.getCommandName(command);
53
+ throw new command_not_found_exception_1.CommandHandlerNotFoundException(commandName);
53
54
  }
54
55
  this._publisher.publish(command);
55
56
  return handler.execute(command);
@@ -79,6 +80,10 @@ let CommandBus = class CommandBus extends observable_bus_1.ObservableBus {
79
80
  }
80
81
  return commandMetadata.id;
81
82
  }
83
+ getCommandName(command) {
84
+ const { constructor } = Object.getPrototypeOf(command);
85
+ return constructor.name;
86
+ }
82
87
  reflectCommandId(handler) {
83
88
  const command = Reflect.getMetadata(constants_1.COMMAND_HANDLER_METADATA, handler);
84
89
  const commandMetadata = Reflect.getMetadata(constants_1.COMMAND_METADATA, command);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cqrs",
3
- "version": "10.2.5",
3
+ "version": "10.2.7",
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",
@@ -18,34 +18,34 @@
18
18
  "prepare": "husky install"
19
19
  },
20
20
  "dependencies": {
21
- "uuid": "9.0.0"
21
+ "uuid": "9.0.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@commitlint/cli": "17.6.7",
25
- "@commitlint/config-angular": "17.6.7",
26
- "@nestjs/common": "10.1.3",
27
- "@nestjs/core": "10.1.3",
28
- "@types/node": "18.17.4",
29
- "@types/jest": "29.5.3",
30
- "@typescript-eslint/eslint-plugin": "6.3.0",
31
- "@typescript-eslint/parser": "6.3.0",
32
- "eslint": "8.46.0",
33
- "eslint-config-prettier": "9.0.0",
34
- "eslint-plugin-import": "2.28.0",
35
- "husky": "8.0.3",
36
- "jest": "29.6.2",
37
- "lint-staged": "13.2.3",
38
- "prettier": "3.0.1",
39
- "reflect-metadata": "0.1.13",
40
- "release-it": "16.1.3",
24
+ "@commitlint/cli": "18.6.0",
25
+ "@commitlint/config-angular": "18.6.0",
26
+ "@nestjs/common": "10.3.2",
27
+ "@nestjs/core": "10.3.2",
28
+ "@types/node": "20.11.16",
29
+ "@types/jest": "29.5.12",
30
+ "@typescript-eslint/eslint-plugin": "6.21.0",
31
+ "@typescript-eslint/parser": "6.21.0",
32
+ "eslint": "8.56.0",
33
+ "eslint-config-prettier": "9.1.0",
34
+ "eslint-plugin-import": "2.29.1",
35
+ "husky": "9.0.10",
36
+ "jest": "29.7.0",
37
+ "lint-staged": "15.2.2",
38
+ "prettier": "3.2.5",
39
+ "reflect-metadata": "0.2.1",
40
+ "release-it": "17.0.3",
41
41
  "rxjs": "7.8.1",
42
- "ts-jest": "29.1.1",
43
- "typescript": "5.1.6"
42
+ "ts-jest": "29.1.2",
43
+ "typescript": "5.3.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@nestjs/common": "^9.0.0 || ^10.0.0",
47
47
  "@nestjs/core": "^9.0.0 || ^10.0.0",
48
- "reflect-metadata": "0.1.13",
48
+ "reflect-metadata": "^0.1.13 || ^0.2.0",
49
49
  "rxjs": "^7.2.0"
50
50
  },
51
51
  "lint-staged": {