@twin.org/api-service 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/dist/cjs/index.cjs +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/informationService.d.ts +2 -5
- package/dist/types/models/IInformationServiceConstructorOptions.d.ts +10 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/InformationService.md +15 -9
- package/docs/reference/functions/generateRestRoutesInformation.md +6 -2
- package/docs/reference/functions/serverHealth.md +9 -3
- package/docs/reference/functions/serverInfo.md +9 -3
- package/docs/reference/functions/serverSpec.md +9 -3
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IInformationServiceConstructorOptions.md +11 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -248,7 +248,6 @@ class InformationService {
|
|
|
248
248
|
/**
|
|
249
249
|
* Create a new instance of InformationService.
|
|
250
250
|
* @param options The options to create the service.
|
|
251
|
-
* @param options.config The configuration for the service.
|
|
252
251
|
*/
|
|
253
252
|
constructor(options) {
|
|
254
253
|
core.Guards.object(this.CLASS_NAME, "options", options);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -246,7 +246,6 @@ class InformationService {
|
|
|
246
246
|
/**
|
|
247
247
|
* Create a new instance of InformationService.
|
|
248
248
|
* @param options The options to create the service.
|
|
249
|
-
* @param options.config The configuration for the service.
|
|
250
249
|
*/
|
|
251
250
|
constructor(options) {
|
|
252
251
|
Guards.object(this.CLASS_NAME, "options", options);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HealthStatus, IHealthInfo, IInformationComponent, IServerInfo } from "@twin.org/api-models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IInformationServiceConstructorOptions } from "./models/IInformationServiceConstructorOptions";
|
|
3
3
|
/**
|
|
4
4
|
* The information service for the server.
|
|
5
5
|
*/
|
|
@@ -15,11 +15,8 @@ export declare class InformationService implements IInformationComponent {
|
|
|
15
15
|
/**
|
|
16
16
|
* Create a new instance of InformationService.
|
|
17
17
|
* @param options The options to create the service.
|
|
18
|
-
* @param options.config The configuration for the service.
|
|
19
18
|
*/
|
|
20
|
-
constructor(options:
|
|
21
|
-
config: IInformationServiceConfig;
|
|
22
|
-
});
|
|
19
|
+
constructor(options: IInformationServiceConstructorOptions);
|
|
23
20
|
/**
|
|
24
21
|
* The service needs to be started when the application is initialized.
|
|
25
22
|
* @returns Nothing.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IInformationServiceConfig } from "./IInformationServiceConfig";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the InformationService constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IInformationServiceConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The configuration for the service.
|
|
8
|
+
*/
|
|
9
|
+
config: IInformationServiceConfig;
|
|
10
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -16,13 +16,11 @@ Create a new instance of InformationService.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### options
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
• **options.config**: [`IInformationServiceConfig`](../interfaces/IInformationServiceConfig.md)
|
|
21
|
+
[`IInformationServiceConstructorOptions`](../interfaces/IInformationServiceConstructorOptions.md)
|
|
24
22
|
|
|
25
|
-
The
|
|
23
|
+
The options to create the service.
|
|
26
24
|
|
|
27
25
|
#### Returns
|
|
28
26
|
|
|
@@ -130,15 +128,21 @@ Set the status of a component.
|
|
|
130
128
|
|
|
131
129
|
#### Parameters
|
|
132
130
|
|
|
133
|
-
|
|
131
|
+
##### name
|
|
132
|
+
|
|
133
|
+
`string`
|
|
134
134
|
|
|
135
135
|
The component name.
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
##### status
|
|
138
|
+
|
|
139
|
+
`HealthStatus`
|
|
138
140
|
|
|
139
141
|
The status of the component.
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
##### details?
|
|
144
|
+
|
|
145
|
+
`string`
|
|
142
146
|
|
|
143
147
|
The details for the status.
|
|
144
148
|
|
|
@@ -162,7 +166,9 @@ Remove the status of a component.
|
|
|
162
166
|
|
|
163
167
|
#### Parameters
|
|
164
168
|
|
|
165
|
-
|
|
169
|
+
##### name
|
|
170
|
+
|
|
171
|
+
`string`
|
|
166
172
|
|
|
167
173
|
The component name.
|
|
168
174
|
|
|
@@ -6,11 +6,15 @@ The REST routes for server information.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### baseRouteName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
10
12
|
|
|
11
13
|
Prefix to prepend to the paths.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes stored in the ComponentFactory.
|
|
16
20
|
|
|
@@ -6,15 +6,21 @@ Get the health for the server.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INoContentRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Get the information for the server.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INoContentRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Get the spec for the server.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INoContentRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
package/docs/reference/index.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-service",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.26",
|
|
4
4
|
"description": "Information contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "0.0.1-next.
|
|
17
|
+
"@twin.org/api-models": "0.0.1-next.26",
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/nameof": "next",
|
|
20
20
|
"@twin.org/web": "next"
|