@nestjs/cqrs 10.2.5 → 10.2.6
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.
- package/.circleci/config.yml +1 -1
- package/dist/command-bus.d.ts +1 -0
- package/dist/command-bus.js +6 -1
- package/package.json +16 -16
package/.circleci/config.yml
CHANGED
package/dist/command-bus.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/command-bus.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "10.2.6",
|
|
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",
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"uuid": "9.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@commitlint/cli": "17.
|
|
25
|
-
"@commitlint/config-angular": "17.
|
|
26
|
-
"@nestjs/common": "10.
|
|
27
|
-
"@nestjs/core": "10.
|
|
28
|
-
"@types/node": "18.17.
|
|
29
|
-
"@types/jest": "29.5.
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
31
|
-
"@typescript-eslint/parser": "6.
|
|
32
|
-
"eslint": "8.
|
|
24
|
+
"@commitlint/cli": "17.7.1",
|
|
25
|
+
"@commitlint/config-angular": "17.7.0",
|
|
26
|
+
"@nestjs/common": "10.2.4",
|
|
27
|
+
"@nestjs/core": "10.2.4",
|
|
28
|
+
"@types/node": "18.17.12",
|
|
29
|
+
"@types/jest": "29.5.4",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "6.5.0",
|
|
31
|
+
"@typescript-eslint/parser": "6.5.0",
|
|
32
|
+
"eslint": "8.48.0",
|
|
33
33
|
"eslint-config-prettier": "9.0.0",
|
|
34
|
-
"eslint-plugin-import": "2.28.
|
|
34
|
+
"eslint-plugin-import": "2.28.1",
|
|
35
35
|
"husky": "8.0.3",
|
|
36
|
-
"jest": "29.6.
|
|
37
|
-
"lint-staged": "
|
|
38
|
-
"prettier": "3.0.
|
|
36
|
+
"jest": "29.6.4",
|
|
37
|
+
"lint-staged": "14.0.1",
|
|
38
|
+
"prettier": "3.0.3",
|
|
39
39
|
"reflect-metadata": "0.1.13",
|
|
40
|
-
"release-it": "16.1.
|
|
40
|
+
"release-it": "16.1.5",
|
|
41
41
|
"rxjs": "7.8.1",
|
|
42
42
|
"ts-jest": "29.1.1",
|
|
43
|
-
"typescript": "5.
|
|
43
|
+
"typescript": "5.2.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@nestjs/common": "^9.0.0 || ^10.0.0",
|