@twin.org/api-models 0.0.1-next.32 → 0.0.1-next.33
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 +7 -0
- package/docs/reference/classes/HttpErrorHelper.md +4 -4
- package/docs/reference/classes/HttpParameterHelper.md +19 -11
- package/docs/reference/interfaces/IBaseRouteEntryPoint.md +3 -1
- package/docs/reference/interfaces/IBaseRouteProcessor.md +3 -1
- package/docs/reference/interfaces/IHttpRequest.md +3 -1
- package/docs/reference/interfaces/IHttpResponse.md +3 -1
- package/docs/reference/interfaces/IHttpServerRequest.md +3 -1
- package/docs/reference/interfaces/IInformationComponent.md +1 -1
- package/docs/reference/interfaces/IRestRoute.md +6 -2
- package/docs/reference/interfaces/IRestRouteRequestExample.md +3 -1
- package/docs/reference/interfaces/IRestRouteResponseExample.md +3 -1
- package/docs/reference/interfaces/ISocketRoute.md +6 -2
- package/docs/reference/interfaces/IWebServer.md +4 -2
- package/docs/reference/type-aliases/HealthStatus.md +1 -1
- package/docs/reference/type-aliases/IRestRouteEntryPoint.md +1 -1
- package/docs/reference/type-aliases/ISocketRouteEntryPoint.md +1 -1
- package/package.json +1 -1
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/api-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
9
|
+
|
|
3
10
|
## [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)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -4,19 +4,19 @@ 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
|
|
|
@@ -4,25 +4,27 @@ 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
|
|
|
@@ -42,13 +44,15 @@ The array of values.
|
|
|
42
44
|
|
|
43
45
|
### arrayToString()
|
|
44
46
|
|
|
45
|
-
> `static` **arrayToString**\<`T`\>(`values
|
|
47
|
+
> `static` **arrayToString**\<`T`\>(`values?`): `undefined` \| `string`
|
|
46
48
|
|
|
47
49
|
Convert array of values to query string.
|
|
48
50
|
|
|
49
51
|
#### Type Parameters
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
##### T
|
|
54
|
+
|
|
55
|
+
`T` = `string`
|
|
52
56
|
|
|
53
57
|
#### Parameters
|
|
54
58
|
|
|
@@ -68,13 +72,15 @@ The combined.
|
|
|
68
72
|
|
|
69
73
|
### objectFromString()
|
|
70
74
|
|
|
71
|
-
> `static` **objectFromString**\<`T`\>(`value
|
|
75
|
+
> `static` **objectFromString**\<`T`\>(`value?`): `undefined` \| `T`
|
|
72
76
|
|
|
73
77
|
Convert object string to object.
|
|
74
78
|
|
|
75
79
|
#### Type Parameters
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
##### T
|
|
82
|
+
|
|
83
|
+
`T` = `unknown`
|
|
78
84
|
|
|
79
85
|
#### Parameters
|
|
80
86
|
|
|
@@ -94,13 +100,15 @@ The object.
|
|
|
94
100
|
|
|
95
101
|
### objectToString()
|
|
96
102
|
|
|
97
|
-
> `static` **objectToString**\<`T`\>(`value
|
|
103
|
+
> `static` **objectToString**\<`T`\>(`value?`): `undefined` \| `string`
|
|
98
104
|
|
|
99
105
|
Convert object to query string.
|
|
100
106
|
|
|
101
107
|
#### Type Parameters
|
|
102
108
|
|
|
103
|
-
|
|
109
|
+
##### T
|
|
110
|
+
|
|
111
|
+
`T` = `unknown`
|
|
104
112
|
|
|
105
113
|
#### Parameters
|
|
106
114
|
|
|
@@ -8,9 +8,13 @@ Interface which defines a REST route.
|
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### T
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`T` *extends* [`IHttpRequest`](IHttpRequest.md) = `any`
|
|
14
|
+
|
|
15
|
+
### U
|
|
16
|
+
|
|
17
|
+
`U` *extends* [`IHttpResponse`](IHttpResponse.md) & [`IRestRouteResponseOptions`](IRestRouteResponseOptions.md) = `any`
|
|
14
18
|
|
|
15
19
|
## Properties
|
|
16
20
|
|
|
@@ -8,9 +8,13 @@ Interface which defines a socket route.
|
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### T
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`T` *extends* [`IHttpRequest`](IHttpRequest.md) = `any`
|
|
14
|
+
|
|
15
|
+
### U
|
|
16
|
+
|
|
17
|
+
`U` *extends* [`IHttpResponse`](IHttpResponse.md) = `any`
|
|
14
18
|
|
|
15
19
|
## Properties
|
|
16
20
|
|
|
@@ -4,7 +4,9 @@ Interface describing a web server.
|
|
|
4
4
|
|
|
5
5
|
## Type Parameters
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### T
|
|
8
|
+
|
|
9
|
+
`T`
|
|
8
10
|
|
|
9
11
|
## Methods
|
|
10
12
|
|
|
@@ -24,7 +26,7 @@ The web server instance.
|
|
|
24
26
|
|
|
25
27
|
### build()
|
|
26
28
|
|
|
27
|
-
> **build**(`restRouteProcessors
|
|
29
|
+
> **build**(`restRouteProcessors?`, `restRoutes?`, `socketRouteProcessors?`, `socketRoutes?`, `options?`): `Promise`\<`void`\>
|
|
28
30
|
|
|
29
31
|
Build the server.
|
|
30
32
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: HealthStatus
|
|
2
2
|
|
|
3
|
-
> **HealthStatus
|
|
3
|
+
> **HealthStatus** = *typeof* [`HealthStatus`](../variables/HealthStatus.md)\[keyof *typeof* [`HealthStatus`](../variables/HealthStatus.md)\]
|
|
4
4
|
|
|
5
5
|
The health status of the component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: IRestRouteEntryPoint
|
|
2
2
|
|
|
3
|
-
> **IRestRouteEntryPoint
|
|
3
|
+
> **IRestRouteEntryPoint** = [`IBaseRouteEntryPoint`](../interfaces/IBaseRouteEntryPoint.md)\<[`IRestRoute`](../interfaces/IRestRoute.md)\>
|
|
4
4
|
|
|
5
5
|
Route entry points are used for exposing the REST routes from a package.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: ISocketRouteEntryPoint
|
|
2
2
|
|
|
3
|
-
> **ISocketRouteEntryPoint
|
|
3
|
+
> **ISocketRouteEntryPoint** = [`IBaseRouteEntryPoint`](../interfaces/IBaseRouteEntryPoint.md)\<[`ISocketRoute`](../interfaces/ISocketRoute.md)\>
|
|
4
4
|
|
|
5
5
|
Route entry points are used for exposing the socket routes from a package.
|