@duraflows/nestjs 3.1.0 → 4.0.0
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.
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var WorkflowExceptionFilter_1;
|
|
8
8
|
import { Catch, HttpStatus, Logger } from "@nestjs/common";
|
|
9
|
-
import { WorkflowError, WorkflowInstanceNotFoundError, InvalidEventError } from "@duraflows/core";
|
|
9
|
+
import { WorkflowError, WorkflowInstanceNotFoundError, InvalidEventError, InvalidArgumentError } from "@duraflows/core";
|
|
10
10
|
/**
|
|
11
11
|
* Maps duraflows domain errors to HTTP statuses for the optional REST
|
|
12
12
|
* controllers. Without this filter, a missing instance or an event invalid
|
|
@@ -33,6 +33,14 @@ let WorkflowExceptionFilter = WorkflowExceptionFilter_1 = class WorkflowExceptio
|
|
|
33
33
|
});
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
+
if (exception instanceof InvalidArgumentError) {
|
|
37
|
+
response.status(HttpStatus.BAD_REQUEST).send({
|
|
38
|
+
statusCode: HttpStatus.BAD_REQUEST,
|
|
39
|
+
error: "Bad Request",
|
|
40
|
+
message: exception.message,
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
36
44
|
// The response body is sanitized, so log the real cause here — otherwise
|
|
37
45
|
// unmapped domain errors (e.g. optimistic-locking conflicts under
|
|
38
46
|
// concurrency) become undiagnosable silent 500s. `WorkflowError` wraps the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duraflows/nestjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "NestJS integration for duraflows: dependency injection, services, optional REST controllers, and @WorkflowCommand decorator for DI-backed command handlers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"duraflows",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"class-validator": "^0.15.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@duraflows/core": "^
|
|
57
|
+
"@duraflows/core": "^4.0.0",
|
|
58
58
|
"@nestjs/common": "^11.0.0",
|
|
59
59
|
"@nestjs/core": "^11.0.0",
|
|
60
60
|
"reflect-metadata": "^0.2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@nestjs/common": "^11.1.24",
|
|
65
65
|
"@nestjs/core": "^11.1.24",
|
|
66
66
|
"@nestjs/testing": "^11.1.24",
|
|
67
|
-
"@duraflows/core": "
|
|
67
|
+
"@duraflows/core": "4.0.0"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsc --build"
|