@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.
Files changed (71) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/healthApplicationTask.js +151 -0
  4. package/dist/es/healthApplicationTask.js.map +1 -0
  5. package/dist/es/healthRoutes.js +116 -0
  6. package/dist/es/healthRoutes.js.map +1 -0
  7. package/dist/es/healthService.js +308 -0
  8. package/dist/es/healthService.js.map +1 -0
  9. package/dist/es/index.js +15 -0
  10. package/dist/es/index.js.map +1 -0
  11. package/dist/es/informationRoutes.js +298 -0
  12. package/dist/es/informationRoutes.js.map +1 -0
  13. package/dist/es/informationService.js +123 -0
  14. package/dist/es/informationService.js.map +1 -0
  15. package/dist/es/models/IHealthServiceConfig.js +4 -0
  16. package/dist/es/models/IHealthServiceConfig.js.map +1 -0
  17. package/dist/es/models/IHealthServiceConstructorOptions.js +2 -0
  18. package/dist/es/models/IHealthServiceConstructorOptions.js.map +1 -0
  19. package/dist/es/models/IInformationServiceConfig.js +2 -0
  20. package/dist/es/models/IInformationServiceConfig.js.map +1 -0
  21. package/dist/es/models/IInformationServiceConstructorOptions.js +2 -0
  22. package/dist/es/models/IInformationServiceConstructorOptions.js.map +1 -0
  23. package/dist/es/models/IPlatformServiceConfig.js +4 -0
  24. package/dist/es/models/IPlatformServiceConfig.js.map +1 -0
  25. package/dist/es/models/IPlatformServiceConstructorOptions.js +2 -0
  26. package/dist/es/models/IPlatformServiceConstructorOptions.js.map +1 -0
  27. package/dist/es/platformService.js +159 -0
  28. package/dist/es/platformService.js.map +1 -0
  29. package/dist/es/restEntryPoints.js +20 -0
  30. package/dist/es/restEntryPoints.js.map +1 -0
  31. package/dist/types/healthApplicationTask.d.ts +20 -0
  32. package/dist/types/healthRoutes.d.ts +20 -0
  33. package/dist/types/healthService.d.ts +42 -0
  34. package/dist/types/index.d.ts +12 -0
  35. package/dist/types/informationRoutes.d.ts +60 -0
  36. package/dist/types/informationService.d.ts +60 -0
  37. package/dist/types/models/IHealthServiceConfig.d.ts +37 -0
  38. package/dist/types/models/IHealthServiceConstructorOptions.d.ts +15 -0
  39. package/dist/types/models/IInformationServiceConfig.d.ts +18 -0
  40. package/dist/types/models/IInformationServiceConstructorOptions.d.ts +10 -0
  41. package/dist/types/models/IPlatformServiceConfig.d.ts +10 -0
  42. package/dist/types/models/IPlatformServiceConstructorOptions.d.ts +15 -0
  43. package/dist/types/platformService.d.ts +39 -0
  44. package/dist/types/restEntryPoints.d.ts +5 -0
  45. package/docs/changelog.md +0 -0
  46. package/docs/examples.md +74 -0
  47. package/docs/open-api/spec.json +712 -0
  48. package/docs/reference/classes/HealthService.md +127 -0
  49. package/docs/reference/classes/InformationService.md +179 -0
  50. package/docs/reference/classes/PlatformService.md +123 -0
  51. package/docs/reference/functions/generateRestRoutesHealth.md +25 -0
  52. package/docs/reference/functions/generateRestRoutesInformation.md +25 -0
  53. package/docs/reference/functions/serverFavIcon.md +31 -0
  54. package/docs/reference/functions/serverHealth.md +31 -0
  55. package/docs/reference/functions/serverInfo.md +31 -0
  56. package/docs/reference/functions/serverLivez.md +31 -0
  57. package/docs/reference/functions/serverReadyz.md +31 -0
  58. package/docs/reference/functions/serverRoot.md +31 -0
  59. package/docs/reference/functions/serverSpec.md +31 -0
  60. package/docs/reference/index.md +34 -0
  61. package/docs/reference/interfaces/IHealthServiceConfig.md +79 -0
  62. package/docs/reference/interfaces/IHealthServiceConstructorOptions.md +25 -0
  63. package/docs/reference/interfaces/IInformationServiceConfig.md +27 -0
  64. package/docs/reference/interfaces/IInformationServiceConstructorOptions.md +11 -0
  65. package/docs/reference/interfaces/IPlatformServiceConfig.md +17 -0
  66. package/docs/reference/interfaces/IPlatformServiceConstructorOptions.md +25 -0
  67. package/docs/reference/variables/restEntryPoints.md +5 -0
  68. package/docs/reference/variables/tagsHealth.md +5 -0
  69. package/docs/reference/variables/tagsInformation.md +5 -0
  70. package/locales/en.json +11 -0
  71. 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.
@@ -0,0 +1,5 @@
1
+ # Variable: restEntryPoints
2
+
3
+ > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
4
+
5
+ REST entry points for the information and health services.
@@ -0,0 +1,5 @@
1
+ # Variable: tagsHealth
2
+
3
+ > `const` **tagsHealth**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -0,0 +1,5 @@
1
+ # Variable: tagsInformation
2
+
3
+ > `const` **tagsInformation**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
@@ -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
- "name": "@3sixty/api-service",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
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
+ }