@twin.org/api-models 0.0.1-next.25 → 0.0.1-next.26

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/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/api-models - Changelog
2
2
 
3
- ## v0.0.1-next.25
3
+ ## v0.0.1-next.26
4
4
 
5
5
  - Initial Release
@@ -22,11 +22,15 @@ Process the errors from the routes.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **err**: `unknown`
25
+ ##### err
26
+
27
+ `unknown`
26
28
 
27
29
  The error to process.
28
30
 
29
- **includeStack?**: `boolean`
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
- **response**: [`IHttpResponse`](../interfaces/IHttpResponse.md)\<`any`\>
61
+ ##### response
62
+
63
+ [`IHttpResponse`](../interfaces/IHttpResponse.md)
58
64
 
59
65
  The response to build the error into.
60
66
 
61
- **error**: `IError`
67
+ ##### error
68
+
69
+ `IError`
62
70
 
63
71
  The error to build the response for.
64
72
 
65
- **statusCode**: `HttpStatusCode`
73
+ ##### statusCode
74
+
75
+ `HttpStatusCode`
66
76
 
67
77
  The status code to use for the error.
68
78
 
@@ -26,7 +26,9 @@ Convert list query to array.
26
26
 
27
27
  #### Parameters
28
28
 
29
- **values?**: `string`
29
+ ##### values?
30
+
31
+ `string`
30
32
 
31
33
  The values query string.
32
34
 
@@ -50,7 +52,9 @@ Convert array of values to query string.
50
52
 
51
53
  #### Parameters
52
54
 
53
- **values?**: `T`[]
55
+ ##### values?
56
+
57
+ `T`[]
54
58
 
55
59
  The values to combine string.
56
60
 
@@ -74,7 +78,9 @@ Convert object string to object.
74
78
 
75
79
  #### Parameters
76
80
 
77
- **value?**: `string`
81
+ ##### value?
82
+
83
+ `string`
78
84
 
79
85
  The value query string.
80
86
 
@@ -98,7 +104,9 @@ Convert object to query string.
98
104
 
99
105
  #### Parameters
100
106
 
101
- **value?**: `T`
107
+ ##### value?
108
+
109
+ `T`
102
110
 
103
111
  The value to convert to a string.
104
112
 
@@ -40,9 +40,13 @@ The method to generate the routes.
40
40
 
41
41
  #### Parameters
42
42
 
43
- **baseRouteName**: `string`
43
+ ##### baseRouteName
44
44
 
45
- • **componentName**: `string`
45
+ `string`
46
+
47
+ ##### componentName
48
+
49
+ `string`
46
50
 
47
51
  #### Returns
48
52
 
@@ -25,23 +25,31 @@ Pre process the REST request for the specified route.
25
25
 
26
26
  #### Parameters
27
27
 
28
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
28
+ ##### request
29
+
30
+ [`IHttpServerRequest`](IHttpServerRequest.md)
29
31
 
30
32
  The request to handle.
31
33
 
32
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
34
+ ##### response
35
+
36
+ [`IHttpResponse`](IHttpResponse.md)
33
37
 
34
38
  The response data to send if any.
35
39
 
36
- **route**: `undefined` \| `T`
40
+ ##### route
37
41
 
38
42
  The route being requested, if a matching one was found.
39
43
 
40
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
44
+ `undefined` | `T`
45
+
46
+ ##### requestIdentity
47
+
48
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
41
49
 
42
50
  The identity context for the request.
43
51
 
44
- **processorState**
52
+ ##### processorState
45
53
 
46
54
  The state handed through the processors.
47
55
 
@@ -61,23 +69,31 @@ Post process the REST request for the specified route.
61
69
 
62
70
  #### Parameters
63
71
 
64
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
72
+ ##### request
73
+
74
+ [`IHttpServerRequest`](IHttpServerRequest.md)
65
75
 
66
76
  The request to handle.
67
77
 
68
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
78
+ ##### response
79
+
80
+ [`IHttpResponse`](IHttpResponse.md)
69
81
 
70
82
  The response data to send if any.
71
83
 
72
- **route**: `undefined` \| `T`
84
+ ##### route
73
85
 
74
86
  The route being requested, if a matching one was found.
75
87
 
76
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
88
+ `undefined` | `T`
89
+
90
+ ##### requestIdentity
91
+
92
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
77
93
 
78
94
  The identity context for the request.
79
95
 
80
- **processorState**
96
+ ##### processorState
81
97
 
82
98
  The state handed through the processors.
83
99
 
@@ -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)\<`any`\>
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
- \[`id`: `string`\]: `unknown`
27
+ \[`id`: `string`\]: `unknown`
28
28
 
29
29
  ***
30
30
 
@@ -4,4 +4,4 @@ Model for the standard parameters for an http request.
4
4
 
5
5
  ## Indexable
6
6
 
7
- \[`id`: `string`\]: `string` \| `number` \| `boolean`
7
+ \[`id`: `string`\]: `string` \| `number` \| `boolean`
@@ -4,4 +4,4 @@ Model used for Http request query parameters.
4
4
 
5
5
  ## Indexable
6
6
 
7
- \[`id`: `string`\]: `string` \| `number` \| `boolean`
7
+ \[`id`: `string`\]: `string` \| `number` \| `boolean`
@@ -58,15 +58,21 @@ Set the status of a component.
58
58
 
59
59
  #### Parameters
60
60
 
61
- **name**: `string`
61
+ ##### name
62
+
63
+ `string`
62
64
 
63
65
  The component name.
64
66
 
65
- **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
67
+ ##### status
68
+
69
+ [`HealthStatus`](../type-aliases/HealthStatus.md)
66
70
 
67
71
  The status of the component.
68
72
 
69
- **details?**: `string`
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
- **name**: `string`
95
+ ##### name
96
+
97
+ `string`
90
98
 
91
99
  The component name.
92
100
 
@@ -30,7 +30,9 @@ Handle content.
30
30
 
31
31
  #### Parameters
32
32
 
33
- **body**: `Uint8Array`
33
+ ##### body
34
+
35
+ `Uint8Array`
34
36
 
35
37
  The body to process.
36
38
 
@@ -82,11 +82,15 @@ The handler module.
82
82
 
83
83
  #### Parameters
84
84
 
85
- **httpRequestContext**: [`IHttpRequestContext`](IHttpRequestContext.md)
85
+ ##### httpRequestContext
86
+
87
+ [`IHttpRequestContext`](IHttpRequestContext.md)
86
88
 
87
89
  The http request context.
88
90
 
89
- **request**: `T`
91
+ ##### request
92
+
93
+ `T`
90
94
 
91
95
  The request object, combined query param, path params and body.
92
96
 
@@ -128,6 +132,24 @@ Example objects for the request.
128
132
 
129
133
  The type of the response object.
130
134
 
135
+ #### type
136
+
137
+ > **type**: `string`
138
+
139
+ The object type of the response.
140
+
141
+ #### mimeType?
142
+
143
+ > `optional` **mimeType**: `string`
144
+
145
+ The mime type of the response, defaults to "application/json" if there is a body.
146
+
147
+ #### examples?
148
+
149
+ > `optional` **examples**: [`IRestRouteResponseExample`](IRestRouteResponseExample.md)\<`U`\>[]
150
+
151
+ Example objects of the response.
152
+
131
153
  ***
132
154
 
133
155
  ### excludeFromSpec?
@@ -16,23 +16,31 @@ Pre process the REST request for the specified route.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
19
+ ##### request
20
+
21
+ [`IHttpServerRequest`](IHttpServerRequest.md)
20
22
 
21
23
  The request to handle.
22
24
 
23
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
25
+ ##### response
26
+
27
+ [`IHttpResponse`](IHttpResponse.md)
24
28
 
25
29
  The response data to send if any.
26
30
 
27
- **route**: `undefined` \| [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>
31
+ ##### route
28
32
 
29
33
  The route being requested, if a matching one was found.
30
34
 
31
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
35
+ `undefined` | [`IRestRoute`](IRestRoute.md)
36
+
37
+ ##### requestIdentity
38
+
39
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
32
40
 
33
41
  The identity context for the request.
34
42
 
35
- **processorState**
43
+ ##### processorState
36
44
 
37
45
  The state handed through the processors.
38
46
 
@@ -56,23 +64,31 @@ Post process the REST request for the specified route.
56
64
 
57
65
  #### Parameters
58
66
 
59
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
67
+ ##### request
68
+
69
+ [`IHttpServerRequest`](IHttpServerRequest.md)
60
70
 
61
71
  The request to handle.
62
72
 
63
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
73
+ ##### response
74
+
75
+ [`IHttpResponse`](IHttpResponse.md)
64
76
 
65
77
  The response data to send if any.
66
78
 
67
- **route**: `undefined` \| [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>
79
+ ##### route
68
80
 
69
81
  The route being requested, if a matching one was found.
70
82
 
71
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
83
+ `undefined` | [`IRestRoute`](IRestRoute.md)
84
+
85
+ ##### requestIdentity
86
+
87
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
72
88
 
73
89
  The identity context for the request.
74
90
 
75
- **processorState**
91
+ ##### processorState
76
92
 
77
93
  The state handed through the processors.
78
94
 
@@ -96,23 +112,31 @@ Process the REST request for the specified route.
96
112
 
97
113
  #### Parameters
98
114
 
99
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
115
+ ##### request
116
+
117
+ [`IHttpServerRequest`](IHttpServerRequest.md)
100
118
 
101
119
  The request to handle.
102
120
 
103
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
121
+ ##### response
122
+
123
+ [`IHttpResponse`](IHttpResponse.md)
104
124
 
105
125
  The response data to send if any.
106
126
 
107
- **route**: `undefined` \| [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>
127
+ ##### route
108
128
 
109
129
  The route being requested, if a matching one was found.
110
130
 
111
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
131
+ `undefined` | [`IRestRoute`](IRestRoute.md)
132
+
133
+ ##### requestIdentity
134
+
135
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
112
136
 
113
137
  The identity context for the request.
114
138
 
115
- **processorState**
139
+ ##### processorState
116
140
 
117
141
  The state handed through the processors.
118
142
 
@@ -58,15 +58,21 @@ The handler module.
58
58
 
59
59
  #### Parameters
60
60
 
61
- **httpRequestContext**: [`IHttpRequestContext`](IHttpRequestContext.md)
61
+ ##### httpRequestContext
62
+
63
+ [`IHttpRequestContext`](IHttpRequestContext.md)
62
64
 
63
65
  The request context.
64
66
 
65
- **request**: `T`
67
+ ##### request
68
+
69
+ `T`
66
70
 
67
71
  The request object.
68
72
 
69
- **emit**
73
+ ##### emit
74
+
75
+ (`event`, `response`) => `Promise`\<`void`\>
70
76
 
71
77
  The function to emit an event.
72
78
 
@@ -16,23 +16,31 @@ Pre process the REST request for the specified route.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
19
+ ##### request
20
+
21
+ [`IHttpServerRequest`](IHttpServerRequest.md)
20
22
 
21
23
  The request to handle.
22
24
 
23
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
25
+ ##### response
26
+
27
+ [`IHttpResponse`](IHttpResponse.md)
24
28
 
25
29
  The response data to send if any.
26
30
 
27
- **route**: `undefined` \| [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>
31
+ ##### route
28
32
 
29
33
  The route being requested, if a matching one was found.
30
34
 
31
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
35
+ `undefined` | [`ISocketRoute`](ISocketRoute.md)
36
+
37
+ ##### requestIdentity
38
+
39
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
32
40
 
33
41
  The identity context for the request.
34
42
 
35
- **processorState**
43
+ ##### processorState
36
44
 
37
45
  The state handed through the processors.
38
46
 
@@ -56,23 +64,31 @@ Post process the REST request for the specified route.
56
64
 
57
65
  #### Parameters
58
66
 
59
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
67
+ ##### request
68
+
69
+ [`IHttpServerRequest`](IHttpServerRequest.md)
60
70
 
61
71
  The request to handle.
62
72
 
63
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
73
+ ##### response
74
+
75
+ [`IHttpResponse`](IHttpResponse.md)
64
76
 
65
77
  The response data to send if any.
66
78
 
67
- **route**: `undefined` \| [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>
79
+ ##### route
68
80
 
69
81
  The route being requested, if a matching one was found.
70
82
 
71
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
83
+ `undefined` | [`ISocketRoute`](ISocketRoute.md)
84
+
85
+ ##### requestIdentity
86
+
87
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
72
88
 
73
89
  The identity context for the request.
74
90
 
75
- **processorState**
91
+ ##### processorState
76
92
 
77
93
  The state handed through the processors.
78
94
 
@@ -96,15 +112,19 @@ Process the connected event.
96
112
 
97
113
  #### Parameters
98
114
 
99
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
115
+ ##### request
116
+
117
+ [`IHttpServerRequest`](IHttpServerRequest.md)
100
118
 
101
119
  The request to handle.
102
120
 
103
- **route**: `undefined` \| [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>
121
+ ##### route
104
122
 
105
123
  The route being requested, if a matching one was found.
106
124
 
107
- **processorState**
125
+ `undefined` | [`ISocketRoute`](ISocketRoute.md)
126
+
127
+ ##### processorState
108
128
 
109
129
  The state handed through the processors.
110
130
 
@@ -124,15 +144,19 @@ Process the disconnected event.
124
144
 
125
145
  #### Parameters
126
146
 
127
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
147
+ ##### request
148
+
149
+ [`IHttpServerRequest`](IHttpServerRequest.md)
128
150
 
129
151
  The request to handle.
130
152
 
131
- **route**: `undefined` \| [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>
153
+ ##### route
132
154
 
133
155
  The route being requested, if a matching one was found.
134
156
 
135
- **processorState**
157
+ `undefined` | [`ISocketRoute`](ISocketRoute.md)
158
+
159
+ ##### processorState
136
160
 
137
161
  The state handed through the processors.
138
162
 
@@ -152,27 +176,37 @@ Process the REST request for the specified route.
152
176
 
153
177
  #### Parameters
154
178
 
155
- **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\>
179
+ ##### request
180
+
181
+ [`IHttpServerRequest`](IHttpServerRequest.md)
156
182
 
157
183
  The request to handle.
158
184
 
159
- **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\>
185
+ ##### response
186
+
187
+ [`IHttpResponse`](IHttpResponse.md)
160
188
 
161
189
  The response data to send if any.
162
190
 
163
- **route**: `undefined` \| [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>
191
+ ##### route
164
192
 
165
193
  The route being requested, if a matching one was found.
166
194
 
167
- **requestIdentity**: [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
195
+ `undefined` | [`ISocketRoute`](ISocketRoute.md)
196
+
197
+ ##### requestIdentity
198
+
199
+ [`IHttpRequestIdentity`](IHttpRequestIdentity.md)
168
200
 
169
201
  The identity context for the request.
170
202
 
171
- **processorState**
203
+ ##### processorState
172
204
 
173
205
  The state handed through the processors.
174
206
 
175
- **responseEmitter**
207
+ ##### responseEmitter
208
+
209
+ (`topic`, `response`) => `Promise`\<`void`\>
176
210
 
177
211
  The function to emit a response.
178
212
 
@@ -30,23 +30,33 @@ Build the server.
30
30
 
31
31
  #### Parameters
32
32
 
33
- **restRouteProcessors?**: [`IRestRouteProcessor`](IRestRouteProcessor.md)[]
33
+ ##### restRouteProcessors?
34
+
35
+ [`IRestRouteProcessor`](IRestRouteProcessor.md)[]
34
36
 
35
37
  The processors for incoming requests over REST.
36
38
 
37
- **restRoutes?**: [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>[]
39
+ ##### restRoutes?
40
+
41
+ [`IRestRoute`](IRestRoute.md)[]
38
42
 
39
43
  The REST routes.
40
44
 
41
- **socketRouteProcessors?**: [`ISocketRouteProcessor`](ISocketRouteProcessor.md)[]
45
+ ##### socketRouteProcessors?
46
+
47
+ [`ISocketRouteProcessor`](ISocketRouteProcessor.md)[]
42
48
 
43
49
  The processors for incoming requests over Sockets.
44
50
 
45
- **socketRoutes?**: [`ISocketRoute`](ISocketRoute.md)\<`any`, `any`\>[]
51
+ ##### socketRoutes?
52
+
53
+ [`ISocketRoute`](ISocketRoute.md)[]
46
54
 
47
55
  The socket routes.
48
56
 
49
- **options?**: [`IWebServerOptions`](IWebServerOptions.md)
57
+ ##### options?
58
+
59
+ [`IWebServerOptions`](IWebServerOptions.md)
50
60
 
51
61
  Options for building the server.
52
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-models",
3
- "version": "0.0.1-next.25",
3
+ "version": "0.0.1-next.26",
4
4
  "description": "Contains models and classes for use with APIs",
5
5
  "repository": {
6
6
  "type": "git",