@3sixty/api-service 0.0.0-stage → 0.20.0-next.0
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/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/healthApplicationTask.js +151 -0
- package/dist/es/healthApplicationTask.js.map +1 -0
- package/dist/es/healthRoutes.js +116 -0
- package/dist/es/healthRoutes.js.map +1 -0
- package/dist/es/healthService.js +308 -0
- package/dist/es/healthService.js.map +1 -0
- package/dist/es/index.js +15 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/informationRoutes.js +298 -0
- package/dist/es/informationRoutes.js.map +1 -0
- package/dist/es/informationService.js +123 -0
- package/dist/es/informationService.js.map +1 -0
- package/dist/es/models/IHealthServiceConfig.js +4 -0
- package/dist/es/models/IHealthServiceConfig.js.map +1 -0
- package/dist/es/models/IHealthServiceConstructorOptions.js +2 -0
- package/dist/es/models/IHealthServiceConstructorOptions.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/models/IPlatformServiceConfig.js +4 -0
- package/dist/es/models/IPlatformServiceConfig.js.map +1 -0
- package/dist/es/models/IPlatformServiceConstructorOptions.js +2 -0
- package/dist/es/models/IPlatformServiceConstructorOptions.js.map +1 -0
- package/dist/es/platformService.js +159 -0
- package/dist/es/platformService.js.map +1 -0
- package/dist/es/restEntryPoints.js +20 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/types/healthApplicationTask.d.ts +20 -0
- package/dist/types/healthRoutes.d.ts +20 -0
- package/dist/types/healthService.d.ts +42 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/informationRoutes.d.ts +60 -0
- package/dist/types/informationService.d.ts +60 -0
- package/dist/types/models/IHealthServiceConfig.d.ts +37 -0
- package/dist/types/models/IHealthServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IInformationServiceConfig.d.ts +18 -0
- package/dist/types/models/IInformationServiceConstructorOptions.d.ts +10 -0
- package/dist/types/models/IPlatformServiceConfig.d.ts +10 -0
- package/dist/types/models/IPlatformServiceConstructorOptions.d.ts +15 -0
- package/dist/types/platformService.d.ts +39 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +74 -0
- package/docs/open-api/spec.json +712 -0
- package/docs/reference/classes/HealthService.md +127 -0
- package/docs/reference/classes/InformationService.md +179 -0
- package/docs/reference/classes/PlatformService.md +123 -0
- package/docs/reference/functions/generateRestRoutesHealth.md +25 -0
- package/docs/reference/functions/generateRestRoutesInformation.md +25 -0
- package/docs/reference/functions/serverFavIcon.md +31 -0
- package/docs/reference/functions/serverHealth.md +31 -0
- package/docs/reference/functions/serverInfo.md +31 -0
- package/docs/reference/functions/serverLivez.md +31 -0
- package/docs/reference/functions/serverReadyz.md +31 -0
- package/docs/reference/functions/serverRoot.md +31 -0
- package/docs/reference/functions/serverSpec.md +31 -0
- package/docs/reference/index.md +34 -0
- package/docs/reference/interfaces/IHealthServiceConfig.md +79 -0
- package/docs/reference/interfaces/IHealthServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IInformationServiceConfig.md +27 -0
- package/docs/reference/interfaces/IInformationServiceConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPlatformServiceConfig.md +17 -0
- package/docs/reference/interfaces/IPlatformServiceConstructorOptions.md +25 -0
- package/docs/reference/variables/restEntryPoints.md +5 -0
- package/docs/reference/variables/tagsHealth.md +5 -0
- package/docs/reference/variables/tagsInformation.md +5 -0
- package/locales/en.json +11 -0
- package/package.json +57 -5
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @3sixty/api-service
|
|
2
|
+
|
|
3
|
+
## Classes
|
|
4
|
+
|
|
5
|
+
- [HealthService](classes/HealthService.md)
|
|
6
|
+
- [InformationService](classes/InformationService.md)
|
|
7
|
+
- [PlatformService](classes/PlatformService.md)
|
|
8
|
+
|
|
9
|
+
## Interfaces
|
|
10
|
+
|
|
11
|
+
- [IHealthServiceConfig](interfaces/IHealthServiceConfig.md)
|
|
12
|
+
- [IHealthServiceConstructorOptions](interfaces/IHealthServiceConstructorOptions.md)
|
|
13
|
+
- [IInformationServiceConfig](interfaces/IInformationServiceConfig.md)
|
|
14
|
+
- [IInformationServiceConstructorOptions](interfaces/IInformationServiceConstructorOptions.md)
|
|
15
|
+
- [IPlatformServiceConfig](interfaces/IPlatformServiceConfig.md)
|
|
16
|
+
- [IPlatformServiceConstructorOptions](interfaces/IPlatformServiceConstructorOptions.md)
|
|
17
|
+
|
|
18
|
+
## Variables
|
|
19
|
+
|
|
20
|
+
- [tagsHealth](variables/tagsHealth.md)
|
|
21
|
+
- [tagsInformation](variables/tagsInformation.md)
|
|
22
|
+
- [restEntryPoints](variables/restEntryPoints.md)
|
|
23
|
+
|
|
24
|
+
## Functions
|
|
25
|
+
|
|
26
|
+
- [generateRestRoutesHealth](functions/generateRestRoutesHealth.md)
|
|
27
|
+
- [serverHealth](functions/serverHealth.md)
|
|
28
|
+
- [generateRestRoutesInformation](functions/generateRestRoutesInformation.md)
|
|
29
|
+
- [serverRoot](functions/serverRoot.md)
|
|
30
|
+
- [serverInfo](functions/serverInfo.md)
|
|
31
|
+
- [serverLivez](functions/serverLivez.md)
|
|
32
|
+
- [serverReadyz](functions/serverReadyz.md)
|
|
33
|
+
- [serverFavIcon](functions/serverFavIcon.md)
|
|
34
|
+
- [serverSpec](functions/serverSpec.md)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Interface: IHealthServiceConfig
|
|
2
|
+
|
|
3
|
+
Configuration for the health service.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### healthCheckInterval? {#healthcheckinterval}
|
|
8
|
+
|
|
9
|
+
> `optional` **healthCheckInterval?**: `number`
|
|
10
|
+
|
|
11
|
+
The interval for checking the health of the components.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
60000
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### healthCheckApplicationInterval? {#healthcheckapplicationinterval}
|
|
22
|
+
|
|
23
|
+
> `optional` **healthCheckApplicationInterval?**: `number`
|
|
24
|
+
|
|
25
|
+
The interval for running the application health lifecycle (init, application, teardown).
|
|
26
|
+
|
|
27
|
+
#### Default
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
300000
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### initialInterval? {#initialinterval}
|
|
36
|
+
|
|
37
|
+
> `optional` **initialInterval?**: `number`
|
|
38
|
+
|
|
39
|
+
The initial interval for checking the health of the components and setting it in the health service.
|
|
40
|
+
This is used to check the health of the components immediately after the service is started.
|
|
41
|
+
|
|
42
|
+
#### Default
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
2000
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
***
|
|
49
|
+
|
|
50
|
+
### includeErrorStack? {#includeerrorstack}
|
|
51
|
+
|
|
52
|
+
> `optional` **includeErrorStack?**: `boolean`
|
|
53
|
+
|
|
54
|
+
Whether to include stack traces in health check error details.
|
|
55
|
+
|
|
56
|
+
#### Default
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
false
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
***
|
|
63
|
+
|
|
64
|
+
### overrideApplicationHealthTaskHandler? {#overrideapplicationhealthtaskhandler}
|
|
65
|
+
|
|
66
|
+
> `optional` **overrideApplicationHealthTaskHandler?**: `string`
|
|
67
|
+
|
|
68
|
+
The URL of the module to use for the application health background task.
|
|
69
|
+
If not provided, the default healthApplicationTask module will be used.
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### excludeCloneComponents? {#excludeclonecomponents}
|
|
74
|
+
|
|
75
|
+
> `optional` **excludeCloneComponents?**: `string`[]
|
|
76
|
+
|
|
77
|
+
The component types to exclude from the engine clone used by the application health
|
|
78
|
+
background task. Each entry is a regular expression matched against the engine config
|
|
79
|
+
type keys, for example "^rightsManagement" or "messaging.*Connector".
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IHealthServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the HealthService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### backgroundTaskComponentType? {#backgroundtaskcomponenttype}
|
|
8
|
+
|
|
9
|
+
> `optional` **backgroundTaskComponentType?**: `string`
|
|
10
|
+
|
|
11
|
+
The background task component type to use for running application health checks.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
background-task
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### config? {#config}
|
|
22
|
+
|
|
23
|
+
> `optional` **config?**: [`IHealthServiceConfig`](IHealthServiceConfig.md)
|
|
24
|
+
|
|
25
|
+
The configuration for the service.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IInformationServiceConfig
|
|
2
|
+
|
|
3
|
+
Configuration for the information service.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### serverInfo {#serverinfo}
|
|
8
|
+
|
|
9
|
+
> **serverInfo**: `IServerInfo`
|
|
10
|
+
|
|
11
|
+
The server information.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### openApiSpecPath? {#openapispecpath}
|
|
16
|
+
|
|
17
|
+
> `optional` **openApiSpecPath?**: `string`
|
|
18
|
+
|
|
19
|
+
The path to the OpenAPI Spec.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### favIconPath? {#faviconpath}
|
|
24
|
+
|
|
25
|
+
> `optional` **favIconPath?**: `string`
|
|
26
|
+
|
|
27
|
+
The path to the favicon.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Interface: IInformationServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the InformationService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### config {#config}
|
|
8
|
+
|
|
9
|
+
> **config**: [`IInformationServiceConfig`](IInformationServiceConfig.md)
|
|
10
|
+
|
|
11
|
+
The configuration for the service.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IPlatformServiceConfig
|
|
2
|
+
|
|
3
|
+
Configuration for the platform service
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### isMultiTenant? {#ismultitenant}
|
|
8
|
+
|
|
9
|
+
> `optional` **isMultiTenant?**: `boolean`
|
|
10
|
+
|
|
11
|
+
Indicates whether the service is running in a multi-tenant environment.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
false
|
|
17
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IPlatformServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the Platform Service constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### tenantEntityStorageType? {#tenantentitystoragetype}
|
|
8
|
+
|
|
9
|
+
> `optional` **tenantEntityStorageType?**: `string`
|
|
10
|
+
|
|
11
|
+
The entity storage for the tenants.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
tenant
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### config? {#config}
|
|
22
|
+
|
|
23
|
+
> `optional` **config?**: [`IPlatformServiceConfig`](IPlatformServiceConfig.md)
|
|
24
|
+
|
|
25
|
+
Configuration for the service.
|
package/locales/en.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"healthService": {
|
|
4
|
+
"componentHealthCheckFailed": "Health check failed for component \"{className}\"",
|
|
5
|
+
"applicationHealthCheckTaskFailed": "Application health check background task failed"
|
|
6
|
+
},
|
|
7
|
+
"applicationHealthTask": {
|
|
8
|
+
"engineNotStarted": "Application health engine is not started"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@3sixty/api-service",
|
|
3
|
+
"version": "0.20.0-next.0",
|
|
4
|
+
"description": "Information and hosting service implementations with generated REST route handlers.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/api.git",
|
|
8
|
+
"directory": "packages/api-service"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@3sixty/api-models": "0.20.0-next.0",
|
|
18
|
+
"@3sixty/background-task-models": "next",
|
|
19
|
+
"@3sixty/context": "next",
|
|
20
|
+
"@3sixty/core": "next",
|
|
21
|
+
"@3sixty/entity-storage-models": "next",
|
|
22
|
+
"@3sixty/logging-models": "next",
|
|
23
|
+
"@3sixty/modules": "next",
|
|
24
|
+
"@3sixty/nameof": "next",
|
|
25
|
+
"@3sixty/vault-models": "next",
|
|
26
|
+
"@3sixty/web": "next"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/es/index.js",
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/types/index.d.ts",
|
|
33
|
+
"import": "./dist/es/index.js",
|
|
34
|
+
"default": "./dist/es/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/es",
|
|
39
|
+
"dist/types",
|
|
40
|
+
"locales",
|
|
41
|
+
"docs"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"twin",
|
|
45
|
+
"trade",
|
|
46
|
+
"iota",
|
|
47
|
+
"framework",
|
|
48
|
+
"blockchain",
|
|
49
|
+
"api",
|
|
50
|
+
"service",
|
|
51
|
+
"microservice",
|
|
52
|
+
"business-logic"
|
|
53
|
+
],
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "git+https://github.com/3sixtyglobal/api/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://3sixty.global"
|
|
58
|
+
}
|