@rest-vir/implement-service 1.5.2 → 1.7.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.
|
@@ -23,6 +23,7 @@ export type EndpointImplementationErrorOutput = {
|
|
|
23
23
|
responseData?: undefined;
|
|
24
24
|
headers?: OutgoingHttpHeaders | undefined;
|
|
25
25
|
dataType?: undefined;
|
|
26
|
+
responseHandled?: never;
|
|
26
27
|
};
|
|
27
28
|
/**
|
|
28
29
|
* The object that all endpoint implementations should return.
|
|
@@ -31,7 +32,25 @@ export type EndpointImplementationErrorOutput = {
|
|
|
31
32
|
* @category Package : @rest-vir/implement-service
|
|
32
33
|
* @package [`@rest-vir/implement-service`](https://www.npmjs.com/package/@rest-vir/implement-service)
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Returned by an endpoint implementation that has taken full control of the response (e.g. SSE
|
|
37
|
+
* streaming via `response.hijack()`). When the framework receives this, it skips response
|
|
38
|
+
* validation, the post-hook, and the final `response.send()`.
|
|
39
|
+
*
|
|
40
|
+
* @category Internal
|
|
41
|
+
* @category Package : @rest-vir/implement-service
|
|
42
|
+
* @package [`@rest-vir/implement-service`](https://www.npmjs.com/package/@rest-vir/implement-service)
|
|
43
|
+
*/
|
|
44
|
+
export type EndpointImplementationHandledOutput = {
|
|
45
|
+
/** The response has been fully handled by the endpoint implementation. */
|
|
46
|
+
responseHandled: true;
|
|
47
|
+
statusCode?: never;
|
|
48
|
+
responseData?: never;
|
|
49
|
+
responseErrorMessage?: never;
|
|
50
|
+
dataType?: never;
|
|
51
|
+
headers?: never;
|
|
52
|
+
};
|
|
53
|
+
export type EndpointImplementationOutput<ResponseDataType = unknown> = EndpointImplementationErrorOutput | EndpointImplementationHandledOutput | ({
|
|
35
54
|
statusCode: HttpStatusByCategory<SuccessHttpStatusCategories>;
|
|
36
55
|
responseErrorMessage?: never;
|
|
37
56
|
/**
|
|
@@ -40,6 +59,7 @@ export type EndpointImplementationOutput<ResponseDataType = unknown> = EndpointI
|
|
|
40
59
|
*/
|
|
41
60
|
dataType?: string | undefined;
|
|
42
61
|
headers?: OutgoingHttpHeaders | undefined;
|
|
62
|
+
responseHandled?: never;
|
|
43
63
|
} & (ResponseDataType extends undefined ? {
|
|
44
64
|
responseData?: ResponseDataType;
|
|
45
65
|
} : {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rest-vir/implement-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Implement a service defined by @rest-vir/define-service.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rest",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@augment-vir/assert": "^31.68.2",
|
|
43
43
|
"@augment-vir/common": "^31.68.2",
|
|
44
|
-
"@rest-vir/define-service": "^1.
|
|
44
|
+
"@rest-vir/define-service": "^1.7.0",
|
|
45
45
|
"@types/ws": "^8.18.1",
|
|
46
|
-
"fastify": "^5.8.
|
|
46
|
+
"fastify": "^5.8.4",
|
|
47
47
|
"path-to-regexp": "^8.3.0",
|
|
48
48
|
"type-fest": "^5.5.0"
|
|
49
49
|
},
|