@twin.org/api-service 0.0.2-next.9 → 0.0.3-next.10
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/es/index.js +8 -0
- package/dist/es/index.js.map +1 -0
- package/dist/{esm/index.mjs → es/informationRoutes.js} +80 -187
- package/dist/es/informationRoutes.js.map +1 -0
- package/dist/es/informationService.js +196 -0
- package/dist/es/informationService.js.map +1 -0
- package/dist/es/models/IInformationServiceConfig.js +2 -0
- package/dist/es/models/IInformationServiceConfig.js.map +1 -0
- package/dist/es/models/IInformationServiceConstructorOptions.js +2 -0
- package/dist/es/models/IInformationServiceConstructorOptions.js.map +1 -0
- package/dist/es/restEntryPoints.js +10 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/types/index.d.ts +5 -5
- package/dist/types/informationRoutes.d.ts +9 -1
- package/dist/types/informationService.d.ts +16 -4
- package/dist/types/models/IInformationServiceConstructorOptions.d.ts +1 -1
- package/docs/changelog.md +221 -0
- package/docs/reference/classes/InformationService.md +51 -7
- package/docs/reference/functions/serverLivez.md +31 -0
- package/docs/reference/index.md +1 -0
- package/package.json +23 -9
- package/dist/cjs/index.cjs +0 -447
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IInformationServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IInformationServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IInformationServiceConfig } from \"./IInformationServiceConfig.js\";\n\n/**\n * Options for the InformationService constructor.\n */\nexport interface IInformationServiceConstructorOptions {\n\t/**\n\t * The configuration for the service.\n\t */\n\tconfig: IInformationServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { generateRestRoutesInformation, tagsInformation } from "./informationRoutes.js";
|
|
2
|
+
export const restEntryPoints = [
|
|
3
|
+
{
|
|
4
|
+
name: "information",
|
|
5
|
+
defaultBaseRoute: "",
|
|
6
|
+
tags: tagsInformation,
|
|
7
|
+
generateRoutes: generateRestRoutesInformation
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
//# sourceMappingURL=restEntryPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,aAAa;QACnB,gBAAgB,EAAE,EAAE;QACpB,IAAI,EAAE,eAAe;QACrB,cAAc,EAAE,6BAA6B;KAC7C;CACD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport { generateRestRoutesInformation, tagsInformation } from \"./informationRoutes.js\";\n\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"information\",\n\t\tdefaultBaseRoute: \"\",\n\t\ttags: tagsInformation,\n\t\tgenerateRoutes: generateRestRoutesInformation\n\t}\n];\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./informationRoutes";
|
|
2
|
-
export * from "./informationService";
|
|
3
|
-
export * from "./models/IInformationServiceConfig";
|
|
4
|
-
export * from "./models/IInformationServiceConstructorOptions";
|
|
5
|
-
export * from "./restEntryPoints";
|
|
1
|
+
export * from "./informationRoutes.js";
|
|
2
|
+
export * from "./informationService.js";
|
|
3
|
+
export * from "./models/IInformationServiceConfig.js";
|
|
4
|
+
export * from "./models/IInformationServiceConstructorOptions.js";
|
|
5
|
+
export * from "./restEntryPoints.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IHttpRequestContext, INoContentRequest, IRestRoute, IServerFavIconResponse, IServerHealthResponse, IServerInfoResponse, IServerRootResponse, IServerSpecResponse, ITag } from "@twin.org/api-models";
|
|
1
|
+
import type { IHttpRequestContext, INoContentRequest, IRestRoute, IServerFavIconResponse, IServerHealthResponse, IServerInfoResponse, IServerLivezResponse, IServerRootResponse, IServerSpecResponse, ITag } from "@twin.org/api-models";
|
|
2
2
|
/**
|
|
3
3
|
* The tag to associate with the routes.
|
|
4
4
|
*/
|
|
@@ -26,6 +26,14 @@ export declare function serverRoot(httpRequestContext: IHttpRequestContext, comp
|
|
|
26
26
|
* @returns The response object with additional http response properties.
|
|
27
27
|
*/
|
|
28
28
|
export declare function serverInfo(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerInfoResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the livez for the server.
|
|
31
|
+
* @param httpRequestContext The request context for the API.
|
|
32
|
+
* @param componentName The name of the component to use in the routes.
|
|
33
|
+
* @param request The request.
|
|
34
|
+
* @returns The response object with additional http response properties.
|
|
35
|
+
*/
|
|
36
|
+
export declare function serverLivez(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerLivezResponse>;
|
|
29
37
|
/**
|
|
30
38
|
* Get the health for the server.
|
|
31
39
|
* @param httpRequestContext The request context for the API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HealthStatus, IHealthInfo, IInformationComponent, IServerInfo } from "@twin.org/api-models";
|
|
2
|
-
import type { IInformationServiceConstructorOptions } from "./models/IInformationServiceConstructorOptions";
|
|
2
|
+
import type { IInformationServiceConstructorOptions } from "./models/IInformationServiceConstructorOptions.js";
|
|
3
3
|
/**
|
|
4
4
|
* The information service for the server.
|
|
5
5
|
*/
|
|
@@ -7,12 +7,17 @@ export declare class InformationService implements IInformationComponent {
|
|
|
7
7
|
/**
|
|
8
8
|
* Runtime name for the class.
|
|
9
9
|
*/
|
|
10
|
-
readonly CLASS_NAME: string;
|
|
10
|
+
static readonly CLASS_NAME: string;
|
|
11
11
|
/**
|
|
12
12
|
* Create a new instance of InformationService.
|
|
13
13
|
* @param options The options to create the service.
|
|
14
14
|
*/
|
|
15
15
|
constructor(options: IInformationServiceConstructorOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the class name of the component.
|
|
18
|
+
* @returns The class name of the component.
|
|
19
|
+
*/
|
|
20
|
+
className(): string;
|
|
16
21
|
/**
|
|
17
22
|
* The service needs to be started when the application is initialized.
|
|
18
23
|
* @returns Nothing.
|
|
@@ -38,6 +43,11 @@ export declare class InformationService implements IInformationComponent {
|
|
|
38
43
|
* @returns The OpenAPI spec.
|
|
39
44
|
*/
|
|
40
45
|
spec(): Promise<unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* Is the server live.
|
|
48
|
+
* @returns True if the server is live.
|
|
49
|
+
*/
|
|
50
|
+
livez(): Promise<boolean>;
|
|
41
51
|
/**
|
|
42
52
|
* Get the server health.
|
|
43
53
|
* @returns The service health.
|
|
@@ -48,13 +58,15 @@ export declare class InformationService implements IInformationComponent {
|
|
|
48
58
|
* @param name The component name.
|
|
49
59
|
* @param status The status of the component.
|
|
50
60
|
* @param details The details for the status.
|
|
61
|
+
* @param tenantId The tenant id, optional if the health status is not tenant specific.
|
|
51
62
|
* @returns Nothing.
|
|
52
63
|
*/
|
|
53
|
-
setComponentHealth(name: string, status: HealthStatus, details?: string): Promise<void>;
|
|
64
|
+
setComponentHealth(name: string, status: HealthStatus, details?: string, tenantId?: string): Promise<void>;
|
|
54
65
|
/**
|
|
55
66
|
* Remove the status of a component.
|
|
56
67
|
* @param name The component name.
|
|
68
|
+
* @param tenantId The tenant id, optional if the health status is not tenant specific.
|
|
57
69
|
* @returns Nothing.
|
|
58
70
|
*/
|
|
59
|
-
removeComponentHealth(name: string): Promise<void>;
|
|
71
|
+
removeComponentHealth(name: string, tenantId?: string): Promise<void>;
|
|
60
72
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,226 @@
|
|
|
1
1
|
# @twin.org/api-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.9...api-service-v0.0.3-next.10) (2026-01-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **api-service:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.8...api-service-v0.0.3-next.9) (2026-01-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
23
|
+
* add livez endpoint ([#57](https://github.com/twinfoundation/api/issues/57)) ([ef007db](https://github.com/twinfoundation/api/commit/ef007db8201736dd3053211f849ffd03baaa485e))
|
|
24
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
25
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
26
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
27
|
+
* remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
|
|
28
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
29
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
30
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
31
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @twin.org/api-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
39
|
+
|
|
40
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.7...api-service-v0.0.3-next.8) (2025-12-17)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Miscellaneous Chores
|
|
44
|
+
|
|
45
|
+
* **api-service:** Synchronize repo versions
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Dependencies
|
|
49
|
+
|
|
50
|
+
* The following workspace dependencies were updated
|
|
51
|
+
* dependencies
|
|
52
|
+
* @twin.org/api-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
53
|
+
|
|
54
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.6...api-service-v0.0.3-next.7) (2025-11-26)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Miscellaneous Chores
|
|
58
|
+
|
|
59
|
+
* **api-service:** Synchronize repo versions
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Dependencies
|
|
63
|
+
|
|
64
|
+
* The following workspace dependencies were updated
|
|
65
|
+
* dependencies
|
|
66
|
+
* @twin.org/api-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
67
|
+
|
|
68
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.5...api-service-v0.0.3-next.6) (2025-11-20)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Miscellaneous Chores
|
|
72
|
+
|
|
73
|
+
* **api-service:** Synchronize repo versions
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Dependencies
|
|
77
|
+
|
|
78
|
+
* The following workspace dependencies were updated
|
|
79
|
+
* dependencies
|
|
80
|
+
* @twin.org/api-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
81
|
+
|
|
82
|
+
## [0.0.3-next.5](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.4...api-service-v0.0.3-next.5) (2025-11-14)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Miscellaneous Chores
|
|
86
|
+
|
|
87
|
+
* **api-service:** Synchronize repo versions
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Dependencies
|
|
91
|
+
|
|
92
|
+
* The following workspace dependencies were updated
|
|
93
|
+
* dependencies
|
|
94
|
+
* @twin.org/api-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
95
|
+
|
|
96
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.3...api-service-v0.0.3-next.4) (2025-11-14)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Features
|
|
100
|
+
|
|
101
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
102
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
103
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
104
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
105
|
+
* remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
|
|
106
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
107
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
108
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
109
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Dependencies
|
|
113
|
+
|
|
114
|
+
* The following workspace dependencies were updated
|
|
115
|
+
* dependencies
|
|
116
|
+
* @twin.org/api-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
117
|
+
|
|
118
|
+
## [0.0.3-next.3](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.2...api-service-v0.0.3-next.3) (2025-11-14)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Miscellaneous Chores
|
|
122
|
+
|
|
123
|
+
* **api-service:** Synchronize repo versions
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
* The following workspace dependencies were updated
|
|
129
|
+
* dependencies
|
|
130
|
+
* @twin.org/api-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
131
|
+
|
|
132
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.1...api-service-v0.0.3-next.2) (2025-11-12)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Miscellaneous Chores
|
|
136
|
+
|
|
137
|
+
* **api-service:** Synchronize repo versions
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* The following workspace dependencies were updated
|
|
143
|
+
* dependencies
|
|
144
|
+
* @twin.org/api-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
145
|
+
|
|
146
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/api/compare/api-service-v0.0.3-next.0...api-service-v0.0.3-next.1) (2025-11-10)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
152
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
153
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
154
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
155
|
+
* remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
|
|
156
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
157
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
158
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
159
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### Dependencies
|
|
163
|
+
|
|
164
|
+
* The following workspace dependencies were updated
|
|
165
|
+
* dependencies
|
|
166
|
+
* @twin.org/api-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
167
|
+
|
|
168
|
+
## [0.0.2-next.13](https://github.com/twinfoundation/api/compare/api-service-v0.0.2-next.12...api-service-v0.0.2-next.13) (2025-10-09)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
### Miscellaneous Chores
|
|
172
|
+
|
|
173
|
+
* **api-service:** Synchronize repo versions
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### Dependencies
|
|
177
|
+
|
|
178
|
+
* The following workspace dependencies were updated
|
|
179
|
+
* dependencies
|
|
180
|
+
* @twin.org/api-models bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
181
|
+
|
|
182
|
+
## [0.0.2-next.12](https://github.com/twinfoundation/api/compare/api-service-v0.0.2-next.11...api-service-v0.0.2-next.12) (2025-10-09)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
### Features
|
|
186
|
+
|
|
187
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
### Dependencies
|
|
191
|
+
|
|
192
|
+
* The following workspace dependencies were updated
|
|
193
|
+
* dependencies
|
|
194
|
+
* @twin.org/api-models bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
195
|
+
|
|
196
|
+
## [0.0.2-next.11](https://github.com/twinfoundation/api/compare/api-service-v0.0.2-next.10...api-service-v0.0.2-next.11) (2025-09-29)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Features
|
|
200
|
+
|
|
201
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### Dependencies
|
|
205
|
+
|
|
206
|
+
* The following workspace dependencies were updated
|
|
207
|
+
* dependencies
|
|
208
|
+
* @twin.org/api-models bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
209
|
+
|
|
210
|
+
## [0.0.2-next.10](https://github.com/twinfoundation/api/compare/api-service-v0.0.2-next.9...api-service-v0.0.2-next.10) (2025-09-23)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Miscellaneous Chores
|
|
214
|
+
|
|
215
|
+
* **api-service:** Synchronize repo versions
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
### Dependencies
|
|
219
|
+
|
|
220
|
+
* The following workspace dependencies were updated
|
|
221
|
+
* dependencies
|
|
222
|
+
* @twin.org/api-models bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
223
|
+
|
|
3
224
|
## [0.0.2-next.9](https://github.com/twinfoundation/api/compare/api-service-v0.0.2-next.8...api-service-v0.0.2-next.9) (2025-08-29)
|
|
4
225
|
|
|
5
226
|
|
|
@@ -30,15 +30,29 @@ The options to create the service.
|
|
|
30
30
|
|
|
31
31
|
### CLASS\_NAME
|
|
32
32
|
|
|
33
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
33
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
34
|
|
|
35
35
|
Runtime name for the class.
|
|
36
36
|
|
|
37
|
+
## Methods
|
|
38
|
+
|
|
39
|
+
### className()
|
|
40
|
+
|
|
41
|
+
> **className**(): `string`
|
|
42
|
+
|
|
43
|
+
Returns the class name of the component.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
The class name of the component.
|
|
50
|
+
|
|
37
51
|
#### Implementation of
|
|
38
52
|
|
|
39
|
-
`IInformationComponent.
|
|
53
|
+
`IInformationComponent.className`
|
|
40
54
|
|
|
41
|
-
|
|
55
|
+
***
|
|
42
56
|
|
|
43
57
|
### start()
|
|
44
58
|
|
|
@@ -96,13 +110,13 @@ The service information.
|
|
|
96
110
|
|
|
97
111
|
### favicon()
|
|
98
112
|
|
|
99
|
-
> **favicon**(): `Promise`\<`
|
|
113
|
+
> **favicon**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `undefined`\>
|
|
100
114
|
|
|
101
115
|
Get the favicon.
|
|
102
116
|
|
|
103
117
|
#### Returns
|
|
104
118
|
|
|
105
|
-
`Promise`\<`
|
|
119
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `undefined`\>
|
|
106
120
|
|
|
107
121
|
The favicon.
|
|
108
122
|
|
|
@@ -130,6 +144,24 @@ The OpenAPI spec.
|
|
|
130
144
|
|
|
131
145
|
***
|
|
132
146
|
|
|
147
|
+
### livez()
|
|
148
|
+
|
|
149
|
+
> **livez**(): `Promise`\<`boolean`\>
|
|
150
|
+
|
|
151
|
+
Is the server live.
|
|
152
|
+
|
|
153
|
+
#### Returns
|
|
154
|
+
|
|
155
|
+
`Promise`\<`boolean`\>
|
|
156
|
+
|
|
157
|
+
True if the server is live.
|
|
158
|
+
|
|
159
|
+
#### Implementation of
|
|
160
|
+
|
|
161
|
+
`IInformationComponent.livez`
|
|
162
|
+
|
|
163
|
+
***
|
|
164
|
+
|
|
133
165
|
### health()
|
|
134
166
|
|
|
135
167
|
> **health**(): `Promise`\<`IHealthInfo`\>
|
|
@@ -150,7 +182,7 @@ The service health.
|
|
|
150
182
|
|
|
151
183
|
### setComponentHealth()
|
|
152
184
|
|
|
153
|
-
> **setComponentHealth**(`name`, `status`, `details?`): `Promise`\<`void`\>
|
|
185
|
+
> **setComponentHealth**(`name`, `status`, `details?`, `tenantId?`): `Promise`\<`void`\>
|
|
154
186
|
|
|
155
187
|
Set the status of a component.
|
|
156
188
|
|
|
@@ -174,6 +206,12 @@ The status of the component.
|
|
|
174
206
|
|
|
175
207
|
The details for the status.
|
|
176
208
|
|
|
209
|
+
##### tenantId?
|
|
210
|
+
|
|
211
|
+
`string`
|
|
212
|
+
|
|
213
|
+
The tenant id, optional if the health status is not tenant specific.
|
|
214
|
+
|
|
177
215
|
#### Returns
|
|
178
216
|
|
|
179
217
|
`Promise`\<`void`\>
|
|
@@ -188,7 +226,7 @@ Nothing.
|
|
|
188
226
|
|
|
189
227
|
### removeComponentHealth()
|
|
190
228
|
|
|
191
|
-
> **removeComponentHealth**(`name`): `Promise`\<`void`\>
|
|
229
|
+
> **removeComponentHealth**(`name`, `tenantId?`): `Promise`\<`void`\>
|
|
192
230
|
|
|
193
231
|
Remove the status of a component.
|
|
194
232
|
|
|
@@ -200,6 +238,12 @@ Remove the status of a component.
|
|
|
200
238
|
|
|
201
239
|
The component name.
|
|
202
240
|
|
|
241
|
+
##### tenantId?
|
|
242
|
+
|
|
243
|
+
`string`
|
|
244
|
+
|
|
245
|
+
The tenant id, optional if the health status is not tenant specific.
|
|
246
|
+
|
|
203
247
|
#### Returns
|
|
204
248
|
|
|
205
249
|
`Promise`\<`void`\>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: serverLivez()
|
|
2
|
+
|
|
3
|
+
> **serverLivez**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IServerLivezResponse`\>
|
|
4
|
+
|
|
5
|
+
Get the livez for the server.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INoContentRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`IServerLivezResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
package/docs/reference/index.md
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- [generateRestRoutesInformation](functions/generateRestRoutesInformation.md)
|
|
20
20
|
- [serverRoot](functions/serverRoot.md)
|
|
21
21
|
- [serverInfo](functions/serverInfo.md)
|
|
22
|
+
- [serverLivez](functions/serverLivez.md)
|
|
22
23
|
- [serverHealth](functions/serverHealth.md)
|
|
23
24
|
- [serverFavIcon](functions/serverFavIcon.md)
|
|
24
25
|
- [serverSpec](functions/serverSpec.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-next.10",
|
|
4
4
|
"description": "Information contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,26 +14,40 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "0.0.
|
|
17
|
+
"@twin.org/api-models": "0.0.3-next.10",
|
|
18
|
+
"@twin.org/context": "next",
|
|
18
19
|
"@twin.org/core": "next",
|
|
19
20
|
"@twin.org/nameof": "next",
|
|
20
21
|
"@twin.org/web": "next"
|
|
21
22
|
},
|
|
22
|
-
"main": "./dist/
|
|
23
|
-
"module": "./dist/esm/index.mjs",
|
|
23
|
+
"main": "./dist/es/index.js",
|
|
24
24
|
"types": "./dist/types/index.d.ts",
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
27
|
"types": "./dist/types/index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"default": "./dist/es/index.js"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
-
"dist/
|
|
34
|
-
"dist/esm",
|
|
33
|
+
"dist/es",
|
|
35
34
|
"dist/types",
|
|
36
35
|
"locales",
|
|
37
36
|
"docs"
|
|
38
|
-
]
|
|
37
|
+
],
|
|
38
|
+
"keywords": [
|
|
39
|
+
"twin",
|
|
40
|
+
"trade",
|
|
41
|
+
"iota",
|
|
42
|
+
"framework",
|
|
43
|
+
"blockchain",
|
|
44
|
+
"api",
|
|
45
|
+
"service",
|
|
46
|
+
"microservice",
|
|
47
|
+
"business-logic"
|
|
48
|
+
],
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "git+https://github.com/twinfoundation/api/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://twindev.org"
|
|
39
53
|
}
|