@twin.org/api-models 0.0.1-next.8 → 0.0.1
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/dist/cjs/index.cjs +42 -70
- package/dist/esm/index.mjs +42 -73
- package/dist/types/factories/mimeTypeProcessorFactory.d.ts +6 -0
- package/dist/types/factories/restRouteProcessorFactory.d.ts +6 -0
- package/dist/types/factories/socketRouteProcessorFactory.d.ts +6 -0
- package/dist/types/helpers/httpParameterHelper.d.ts +8 -27
- package/dist/types/index.d.ts +9 -1
- package/dist/types/models/config/IBaseSocketClientConfig.d.ts +4 -0
- package/dist/types/models/routes/IBaseRouteEntryPoint.d.ts +22 -0
- package/dist/types/models/routes/IRestRouteEntryPoint.d.ts +2 -19
- package/dist/types/models/routes/ISocketRoute.d.ts +6 -8
- package/dist/types/models/routes/ISocketRouteEntryPoint.d.ts +6 -0
- package/dist/types/models/server/IBaseRouteProcessor.d.ts +34 -0
- package/dist/types/models/server/IMimeTypeProcessor.d.ts +17 -0
- package/dist/types/models/server/IRestRouteProcessor.d.ts +22 -0
- package/dist/types/models/server/{IHttpRestRouteProcessor.d.ts → ISocketRouteProcessor.d.ts} +12 -15
- package/dist/types/models/server/IWebServer.d.ts +7 -3
- package/docs/changelog.md +43 -1
- package/docs/reference/classes/HttpErrorHelper.md +19 -9
- package/docs/reference/classes/HttpParameterHelper.md +39 -63
- package/docs/reference/index.md +10 -2
- package/docs/reference/interfaces/IBaseRouteEntryPoint.md +55 -0
- package/docs/reference/interfaces/IBaseRouteProcessor.md +106 -0
- package/docs/reference/interfaces/IBaseSocketClientConfig.md +8 -0
- package/docs/reference/interfaces/IHealthInfo.md +18 -0
- package/docs/reference/interfaces/IHttpRequest.md +3 -1
- package/docs/reference/interfaces/IHttpRequestContext.md +2 -2
- package/docs/reference/interfaces/IHttpRequestPathParams.md +1 -1
- package/docs/reference/interfaces/IHttpRequestQuery.md +1 -1
- package/docs/reference/interfaces/IHttpResponse.md +3 -1
- package/docs/reference/interfaces/IHttpServerRequest.md +3 -1
- package/docs/reference/interfaces/IInformationComponent.md +13 -5
- package/docs/reference/interfaces/IMimeTypeProcessor.md +43 -0
- package/docs/reference/interfaces/IRestRoute.md +30 -4
- package/docs/reference/interfaces/{IHttpRestRouteProcessor.md → IRestRouteProcessor.md} +55 -23
- package/docs/reference/interfaces/IRestRouteRequestExample.md +3 -1
- package/docs/reference/interfaces/IRestRouteResponseExample.md +3 -1
- package/docs/reference/interfaces/ISocketRoute.md +22 -10
- package/docs/reference/interfaces/ISocketRouteProcessor.md +217 -0
- package/docs/reference/interfaces/IWebServer.md +26 -6
- package/docs/reference/type-aliases/HealthStatus.md +1 -1
- package/docs/reference/type-aliases/IRestRouteEntryPoint.md +5 -0
- package/docs/reference/type-aliases/ISocketRouteEntryPoint.md +5 -0
- package/docs/reference/variables/MimeTypeProcessorFactory.md +5 -0
- package/docs/reference/variables/RestRouteProcessorFactory.md +5 -0
- package/docs/reference/variables/SocketRouteProcessorFactory.md +5 -0
- package/package.json +6 -7
- package/docs/reference/interfaces/IRestRouteEntryPoint.md +0 -45
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IRestRouteProcessor } from "./IRestRouteProcessor";
|
|
2
|
+
import type { ISocketRouteProcessor } from "./ISocketRouteProcessor";
|
|
2
3
|
import type { IWebServerOptions } from "./IWebServerOptions";
|
|
3
4
|
import type { IRestRoute } from "../routes/IRestRoute";
|
|
5
|
+
import type { ISocketRoute } from "../routes/ISocketRoute";
|
|
4
6
|
/**
|
|
5
7
|
* Interface describing a web server.
|
|
6
8
|
*/
|
|
@@ -12,12 +14,14 @@ export interface IWebServer<T> {
|
|
|
12
14
|
getInstance(): T;
|
|
13
15
|
/**
|
|
14
16
|
* Build the server.
|
|
15
|
-
* @param restRouteProcessors The
|
|
17
|
+
* @param restRouteProcessors The processors for incoming requests over REST.
|
|
16
18
|
* @param restRoutes The REST routes.
|
|
19
|
+
* @param socketRouteProcessors The processors for incoming requests over Sockets.
|
|
20
|
+
* @param socketRoutes The socket routes.
|
|
17
21
|
* @param options Options for building the server.
|
|
18
22
|
* @returns Nothing.
|
|
19
23
|
*/
|
|
20
|
-
build(restRouteProcessors
|
|
24
|
+
build(restRouteProcessors?: IRestRouteProcessor[], restRoutes?: IRestRoute[], socketRouteProcessors?: ISocketRouteProcessor[], socketRoutes?: ISocketRoute[], options?: IWebServerOptions): Promise<void>;
|
|
21
25
|
/**
|
|
22
26
|
* Start the server.
|
|
23
27
|
* @returns Nothing.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @twin.org/api-models - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.0.1 (2025-07-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* release to production ([70ee2d5](https://github.com/twinfoundation/api/commit/70ee2d56a1dc9537d7c9c154d4cb78a235678a3a))
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.36](https://github.com/twinfoundation/api/compare/api-models-v0.0.1-next.35...api-models-v0.0.1-next.36) (2025-06-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
|
|
16
|
+
|
|
17
|
+
## [0.0.1-next.35](https://github.com/twinfoundation/api/compare/api-models-v0.0.1-next.34...api-models-v0.0.1-next.35) (2025-06-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
23
|
+
|
|
24
|
+
## [0.0.1-next.34](https://github.com/twinfoundation/api/compare/api-models-v0.0.1-next.33...api-models-v0.0.1-next.34) (2025-05-27)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
|
|
30
|
+
|
|
31
|
+
## [0.0.1-next.33](https://github.com/twinfoundation/api/compare/api-models-v0.0.1-next.32...api-models-v0.0.1-next.33) (2025-04-17)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
37
|
+
|
|
38
|
+
## [0.0.1-next.32](https://github.com/twinfoundation/api/compare/api-models-v0.0.1-next.31...api-models-v0.0.1-next.32) (2025-03-28)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Miscellaneous Chores
|
|
42
|
+
|
|
43
|
+
* **api-models:** Synchronize repo versions
|
|
44
|
+
|
|
45
|
+
## v0.0.1-next.31
|
|
4
46
|
|
|
5
47
|
- Initial Release
|
|
@@ -4,29 +4,33 @@ Class to help with processing http errors.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new HttpErrorHelper**():
|
|
9
|
+
> **new HttpErrorHelper**(): `HttpErrorHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`HttpErrorHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### processError()
|
|
18
18
|
|
|
19
|
-
> `static` **processError**(`err`, `includeStack
|
|
19
|
+
> `static` **processError**(`err`, `includeStack?`): `object`
|
|
20
20
|
|
|
21
21
|
Process the errors from the routes.
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### err
|
|
26
|
+
|
|
27
|
+
`unknown`
|
|
26
28
|
|
|
27
29
|
The error to process.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### includeStack?
|
|
32
|
+
|
|
33
|
+
`boolean`
|
|
30
34
|
|
|
31
35
|
Should the stack be included in the error.
|
|
32
36
|
|
|
@@ -54,15 +58,21 @@ Build an error response.
|
|
|
54
58
|
|
|
55
59
|
#### Parameters
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
##### response
|
|
62
|
+
|
|
63
|
+
[`IHttpResponse`](../interfaces/IHttpResponse.md)
|
|
58
64
|
|
|
59
65
|
The response to build the error into.
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
##### error
|
|
68
|
+
|
|
69
|
+
`IError`
|
|
62
70
|
|
|
63
71
|
The error to build the response for.
|
|
64
72
|
|
|
65
|
-
|
|
73
|
+
##### statusCode
|
|
74
|
+
|
|
75
|
+
`HttpStatusCode`
|
|
66
76
|
|
|
67
77
|
The status code to use for the error.
|
|
68
78
|
|
|
@@ -4,29 +4,33 @@ Class to help with handling http parameters.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new HttpParameterHelper**():
|
|
9
|
+
> **new HttpParameterHelper**(): `HttpParameterHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`HttpParameterHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### arrayFromString()
|
|
18
18
|
|
|
19
|
-
> `static` **arrayFromString**\<`T`\>(`values
|
|
19
|
+
> `static` **arrayFromString**\<`T`\>(`values?`): `undefined` \| `T`[]
|
|
20
20
|
|
|
21
21
|
Convert list query to array.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T` = `string`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### values?
|
|
32
|
+
|
|
33
|
+
`string`
|
|
30
34
|
|
|
31
35
|
The values query string.
|
|
32
36
|
|
|
@@ -40,17 +44,21 @@ The array of values.
|
|
|
40
44
|
|
|
41
45
|
### arrayToString()
|
|
42
46
|
|
|
43
|
-
> `static` **arrayToString**\<`T`\>(`values
|
|
47
|
+
> `static` **arrayToString**\<`T`\>(`values?`): `undefined` \| `string`
|
|
44
48
|
|
|
45
49
|
Convert array of values to query string.
|
|
46
50
|
|
|
47
51
|
#### Type Parameters
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
##### T
|
|
54
|
+
|
|
55
|
+
`T` = `string`
|
|
50
56
|
|
|
51
57
|
#### Parameters
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
##### values?
|
|
60
|
+
|
|
61
|
+
`T`[]
|
|
54
62
|
|
|
55
63
|
The values to combine string.
|
|
56
64
|
|
|
@@ -62,88 +70,56 @@ The combined.
|
|
|
62
70
|
|
|
63
71
|
***
|
|
64
72
|
|
|
65
|
-
###
|
|
73
|
+
### objectFromString()
|
|
66
74
|
|
|
67
|
-
> `static` **
|
|
75
|
+
> `static` **objectFromString**\<`T`\>(`value?`): `undefined` \| `T`
|
|
68
76
|
|
|
69
|
-
Convert
|
|
77
|
+
Convert object string to object.
|
|
70
78
|
|
|
71
|
-
#### Parameters
|
|
72
|
-
|
|
73
|
-
• **conditions?**: `string`
|
|
74
|
-
|
|
75
|
-
The conditions query string.
|
|
76
|
-
|
|
77
|
-
#### Returns
|
|
78
|
-
|
|
79
|
-
`undefined` \| `IComparator`[]
|
|
80
|
-
|
|
81
|
-
The list of comparators.
|
|
82
|
-
|
|
83
|
-
***
|
|
84
|
-
|
|
85
|
-
### conditionsToString()
|
|
79
|
+
#### Type Parameters
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
##### T
|
|
88
82
|
|
|
89
|
-
|
|
83
|
+
`T` = `unknown`
|
|
90
84
|
|
|
91
85
|
#### Parameters
|
|
92
86
|
|
|
93
|
-
|
|
87
|
+
##### value?
|
|
94
88
|
|
|
95
|
-
|
|
89
|
+
`string`
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
`undefined` \| `string`
|
|
100
|
-
|
|
101
|
-
The string version of the comparators.
|
|
102
|
-
|
|
103
|
-
***
|
|
104
|
-
|
|
105
|
-
### sortPropertiesFromString()
|
|
106
|
-
|
|
107
|
-
> `static` **sortPropertiesFromString**\<`T`\>(`sortProperties`?): `undefined` \| `object`[]
|
|
108
|
-
|
|
109
|
-
Convert the sort string to a list of sort properties.
|
|
110
|
-
|
|
111
|
-
#### Type Parameters
|
|
112
|
-
|
|
113
|
-
• **T** = `unknown`
|
|
114
|
-
|
|
115
|
-
#### Parameters
|
|
116
|
-
|
|
117
|
-
• **sortProperties?**: `string`
|
|
118
|
-
|
|
119
|
-
The sort properties query string.
|
|
91
|
+
The value query string.
|
|
120
92
|
|
|
121
93
|
#### Returns
|
|
122
94
|
|
|
123
|
-
`undefined` \| `
|
|
95
|
+
`undefined` \| `T`
|
|
124
96
|
|
|
125
|
-
The
|
|
97
|
+
The object.
|
|
126
98
|
|
|
127
99
|
***
|
|
128
100
|
|
|
129
|
-
###
|
|
101
|
+
### objectToString()
|
|
130
102
|
|
|
131
|
-
> `static` **
|
|
103
|
+
> `static` **objectToString**\<`T`\>(`value?`): `undefined` \| `string`
|
|
132
104
|
|
|
133
|
-
Convert
|
|
105
|
+
Convert object to query string.
|
|
134
106
|
|
|
135
107
|
#### Type Parameters
|
|
136
108
|
|
|
137
|
-
|
|
109
|
+
##### T
|
|
110
|
+
|
|
111
|
+
`T` = `unknown`
|
|
138
112
|
|
|
139
113
|
#### Parameters
|
|
140
114
|
|
|
141
|
-
|
|
115
|
+
##### value?
|
|
116
|
+
|
|
117
|
+
`T`
|
|
142
118
|
|
|
143
|
-
The
|
|
119
|
+
The value to convert to a string.
|
|
144
120
|
|
|
145
121
|
#### Returns
|
|
146
122
|
|
|
147
123
|
`undefined` \| `string`
|
|
148
124
|
|
|
149
|
-
The
|
|
125
|
+
The converted object.
|
package/docs/reference/index.md
CHANGED
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
- [INoContentResponse](interfaces/INoContentResponse.md)
|
|
33
33
|
- [IOkResponse](interfaces/IOkResponse.md)
|
|
34
34
|
- [IBaseRoute](interfaces/IBaseRoute.md)
|
|
35
|
+
- [IBaseRouteEntryPoint](interfaces/IBaseRouteEntryPoint.md)
|
|
35
36
|
- [IRestRoute](interfaces/IRestRoute.md)
|
|
36
|
-
- [IRestRouteEntryPoint](interfaces/IRestRouteEntryPoint.md)
|
|
37
37
|
- [IRestRouteExample](interfaces/IRestRouteExample.md)
|
|
38
38
|
- [IRestRouteRequestExample](interfaces/IRestRouteRequestExample.md)
|
|
39
39
|
- [IRestRouteResponseAttachmentOptions](interfaces/IRestRouteResponseAttachmentOptions.md)
|
|
@@ -41,7 +41,10 @@
|
|
|
41
41
|
- [IRestRouteResponseOptions](interfaces/IRestRouteResponseOptions.md)
|
|
42
42
|
- [ISocketRoute](interfaces/ISocketRoute.md)
|
|
43
43
|
- [ITag](interfaces/ITag.md)
|
|
44
|
-
- [
|
|
44
|
+
- [IBaseRouteProcessor](interfaces/IBaseRouteProcessor.md)
|
|
45
|
+
- [IMimeTypeProcessor](interfaces/IMimeTypeProcessor.md)
|
|
46
|
+
- [IRestRouteProcessor](interfaces/IRestRouteProcessor.md)
|
|
47
|
+
- [ISocketRouteProcessor](interfaces/ISocketRouteProcessor.md)
|
|
45
48
|
- [IWebServer](interfaces/IWebServer.md)
|
|
46
49
|
- [IWebServerOptions](interfaces/IWebServerOptions.md)
|
|
47
50
|
- [IHealthInfo](interfaces/IHealthInfo.md)
|
|
@@ -50,8 +53,13 @@
|
|
|
50
53
|
|
|
51
54
|
## Type Aliases
|
|
52
55
|
|
|
56
|
+
- [IRestRouteEntryPoint](type-aliases/IRestRouteEntryPoint.md)
|
|
57
|
+
- [ISocketRouteEntryPoint](type-aliases/ISocketRouteEntryPoint.md)
|
|
53
58
|
- [HealthStatus](type-aliases/HealthStatus.md)
|
|
54
59
|
|
|
55
60
|
## Variables
|
|
56
61
|
|
|
62
|
+
- [MimeTypeProcessorFactory](variables/MimeTypeProcessorFactory.md)
|
|
63
|
+
- [RestRouteProcessorFactory](variables/RestRouteProcessorFactory.md)
|
|
64
|
+
- [SocketRouteProcessorFactory](variables/SocketRouteProcessorFactory.md)
|
|
57
65
|
- [HealthStatus](variables/HealthStatus.md)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Interface: IBaseRouteEntryPoint\<T\>
|
|
2
|
+
|
|
3
|
+
Route entry points are used for exposing the routes from a package.
|
|
4
|
+
|
|
5
|
+
## Type Parameters
|
|
6
|
+
|
|
7
|
+
### T
|
|
8
|
+
|
|
9
|
+
`T`
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### name
|
|
14
|
+
|
|
15
|
+
> **name**: `string`
|
|
16
|
+
|
|
17
|
+
The name of the routes.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### defaultBaseRoute
|
|
22
|
+
|
|
23
|
+
> **defaultBaseRoute**: `string`
|
|
24
|
+
|
|
25
|
+
The default base route name for the routes.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### tags
|
|
30
|
+
|
|
31
|
+
> **tags**: [`ITag`](ITag.md)[]
|
|
32
|
+
|
|
33
|
+
The tags for the routes.
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### generateRoutes()
|
|
38
|
+
|
|
39
|
+
> **generateRoutes**: (`baseRouteName`, `componentName`) => `T`[]
|
|
40
|
+
|
|
41
|
+
The method to generate the routes.
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
##### baseRouteName
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
##### componentName
|
|
50
|
+
|
|
51
|
+
`string`
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`T`[]
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Interface: IBaseRouteProcessor\<T\>
|
|
2
|
+
|
|
3
|
+
The definition for a base processor for handling REST routes.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Extended by
|
|
10
|
+
|
|
11
|
+
- [`IRestRouteProcessor`](IRestRouteProcessor.md)
|
|
12
|
+
- [`ISocketRouteProcessor`](ISocketRouteProcessor.md)
|
|
13
|
+
|
|
14
|
+
## Type Parameters
|
|
15
|
+
|
|
16
|
+
### T
|
|
17
|
+
|
|
18
|
+
`T` = [`IBaseRoute`](IBaseRoute.md)
|
|
19
|
+
|
|
20
|
+
## Methods
|
|
21
|
+
|
|
22
|
+
### pre()?
|
|
23
|
+
|
|
24
|
+
> `optional` **pre**(`request`, `response`, `route`, `requestIdentity`, `processorState`): `Promise`\<`void`\>
|
|
25
|
+
|
|
26
|
+
Pre process the REST request for the specified route.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
##### request
|
|
31
|
+
|
|
32
|
+
[`IHttpServerRequest`](IHttpServerRequest.md)
|
|
33
|
+
|
|
34
|
+
The request to handle.
|
|
35
|
+
|
|
36
|
+
##### response
|
|
37
|
+
|
|
38
|
+
[`IHttpResponse`](IHttpResponse.md)
|
|
39
|
+
|
|
40
|
+
The response data to send if any.
|
|
41
|
+
|
|
42
|
+
##### route
|
|
43
|
+
|
|
44
|
+
The route being requested, if a matching one was found.
|
|
45
|
+
|
|
46
|
+
`undefined` | `T`
|
|
47
|
+
|
|
48
|
+
##### requestIdentity
|
|
49
|
+
|
|
50
|
+
[`IHttpRequestIdentity`](IHttpRequestIdentity.md)
|
|
51
|
+
|
|
52
|
+
The identity context for the request.
|
|
53
|
+
|
|
54
|
+
##### processorState
|
|
55
|
+
|
|
56
|
+
The state handed through the processors.
|
|
57
|
+
|
|
58
|
+
#### Returns
|
|
59
|
+
|
|
60
|
+
`Promise`\<`void`\>
|
|
61
|
+
|
|
62
|
+
Promise that resolves when the request is processed.
|
|
63
|
+
|
|
64
|
+
***
|
|
65
|
+
|
|
66
|
+
### post()?
|
|
67
|
+
|
|
68
|
+
> `optional` **post**(`request`, `response`, `route`, `requestIdentity`, `processorState`): `Promise`\<`void`\>
|
|
69
|
+
|
|
70
|
+
Post process the REST request for the specified route.
|
|
71
|
+
|
|
72
|
+
#### Parameters
|
|
73
|
+
|
|
74
|
+
##### request
|
|
75
|
+
|
|
76
|
+
[`IHttpServerRequest`](IHttpServerRequest.md)
|
|
77
|
+
|
|
78
|
+
The request to handle.
|
|
79
|
+
|
|
80
|
+
##### response
|
|
81
|
+
|
|
82
|
+
[`IHttpResponse`](IHttpResponse.md)
|
|
83
|
+
|
|
84
|
+
The response data to send if any.
|
|
85
|
+
|
|
86
|
+
##### route
|
|
87
|
+
|
|
88
|
+
The route being requested, if a matching one was found.
|
|
89
|
+
|
|
90
|
+
`undefined` | `T`
|
|
91
|
+
|
|
92
|
+
##### requestIdentity
|
|
93
|
+
|
|
94
|
+
[`IHttpRequestIdentity`](IHttpRequestIdentity.md)
|
|
95
|
+
|
|
96
|
+
The identity context for the request.
|
|
97
|
+
|
|
98
|
+
##### processorState
|
|
99
|
+
|
|
100
|
+
The state handed through the processors.
|
|
101
|
+
|
|
102
|
+
#### Returns
|
|
103
|
+
|
|
104
|
+
`Promise`\<`void`\>
|
|
105
|
+
|
|
106
|
+
Promise that resolves when the request is processed.
|
|
@@ -17,3 +17,21 @@ The status.
|
|
|
17
17
|
> `optional` **components**: `object`[]
|
|
18
18
|
|
|
19
19
|
The status of the components.
|
|
20
|
+
|
|
21
|
+
#### name
|
|
22
|
+
|
|
23
|
+
> **name**: `string`
|
|
24
|
+
|
|
25
|
+
The name of the component.
|
|
26
|
+
|
|
27
|
+
#### status
|
|
28
|
+
|
|
29
|
+
> **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
|
|
30
|
+
|
|
31
|
+
The status of the component.
|
|
32
|
+
|
|
33
|
+
#### details?
|
|
34
|
+
|
|
35
|
+
> `optional` **details**: `string`
|
|
36
|
+
|
|
37
|
+
The details for the status.
|
|
@@ -10,7 +10,7 @@ Context data from the HTTP request.
|
|
|
10
10
|
|
|
11
11
|
### serverRequest
|
|
12
12
|
|
|
13
|
-
> **serverRequest**: [`IHttpServerRequest`](IHttpServerRequest.md)
|
|
13
|
+
> **serverRequest**: [`IHttpServerRequest`](IHttpServerRequest.md)
|
|
14
14
|
|
|
15
15
|
The raw HTTP request.
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ The state handed through the processors.
|
|
|
24
24
|
|
|
25
25
|
#### Index Signature
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
\[`id`: `string`\]: `unknown`
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
@@ -52,21 +52,27 @@ The service health.
|
|
|
52
52
|
|
|
53
53
|
### setComponentHealth()
|
|
54
54
|
|
|
55
|
-
> **setComponentHealth**(`name`, `status`, `details
|
|
55
|
+
> **setComponentHealth**(`name`, `status`, `details?`): `Promise`\<`void`\>
|
|
56
56
|
|
|
57
57
|
Set the status of a component.
|
|
58
58
|
|
|
59
59
|
#### Parameters
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
##### name
|
|
62
|
+
|
|
63
|
+
`string`
|
|
62
64
|
|
|
63
65
|
The component name.
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
##### status
|
|
68
|
+
|
|
69
|
+
[`HealthStatus`](../type-aliases/HealthStatus.md)
|
|
66
70
|
|
|
67
71
|
The status of the component.
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
##### details?
|
|
74
|
+
|
|
75
|
+
`string`
|
|
70
76
|
|
|
71
77
|
The details for the status.
|
|
72
78
|
|
|
@@ -86,7 +92,9 @@ Remove the status of a component.
|
|
|
86
92
|
|
|
87
93
|
#### Parameters
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
##### name
|
|
96
|
+
|
|
97
|
+
`string`
|
|
90
98
|
|
|
91
99
|
The component name.
|
|
92
100
|
|