@3sixty/api-service 0.0.0-stage → 0.20.0-next.1
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 +125 -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 +211 -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 +19 -0
- package/dist/types/platformService.d.ts +57 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/docs/changelog.md +17 -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 +209 -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 +33 -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 +14 -0
- package/package.json +57 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"informationRoutes.js","sources":["../../src/informationRoutes.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,MA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AC;IAE1C,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO;YACN,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,cAAc;aACzC;YACD,IAAI,EAAE,OAAO;SACb,CAAC;IACH,CAAC;IACD,OAAO;QACN,UAAU,EAAE,cAAc,CAAC,QAAQ;KACnC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,kBAAuC,EACvC,aAAqB,EACrB,OAA0B;IAE1B,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAwB,aAAa,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;IAEpC,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO;YACN,IAAI,EAAE,IAAI;SACV,CAAC;IACH,CAAC;IACD,OAAO;QACN,UAAU,EAAE,cAAc,CAAC,QAAQ;KACnC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tIHttpRequestContext,\n\tIInformationComponent,\n\tINoContentRequest,\n\tIRestRoute,\n\tIServerFavIconResponse,\n\tIServerInfoResponse,\n\tIServerLivezResponse,\n\tIServerReadyzResponse,\n\tIServerRootResponse,\n\tIServerSpecResponse,\n\tITag\n} from \"@3sixty/api-models\";\nimport { ComponentFactory, Is } from \"@3sixty/core\";\n\nimport { HeaderTypes, HttpStatusCode, MimeTypes } from \"@3sixty/web\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsInformation: ITag[] = [\n\t{\n\t\tname: \"Info\",\n\t\tdescription: \"Information endpoints for the REST server.\"\n\t}\n];\n\n/**\n * The REST routes for server information.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesInformation(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst rootRoute: IRestRoute = {\n\t\toperationId: \"serverRoot\",\n\t\tsummary: \"Get the root text page\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverRoot(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerRootResponse\",\n\t\t\t\tmimeType: MimeTypes.PlainText,\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"serverRootResponse\",\n\t\t\t\t\t\tdescription: \"The response for the root request.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbody: \"API Server - 1.0.0\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst informationRoute: IRestRoute<INoContentRequest, IServerInfoResponse> = {\n\t\toperationId: \"serverInformation\",\n\t\tsummary: \"Get the information for the server\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/info`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverInfo(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerInfoResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"informationResponse\",\n\t\t\t\t\t\tdescription: \"The response for the information request.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tname: \"API Server\",\n\t\t\t\t\t\t\t\tversion: \"1.0.0\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst favIconRoute: IRestRoute<INoContentRequest, IServerFavIconResponse> = {\n\t\toperationId: \"serverFavIcon\",\n\t\tsummary: \"Get the favicon for the server\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/favicon.ico`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverFavIcon(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerFavIconResponse\",\n\t\t\t\tmimeType: \"image/x-icon\"\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst livezRoute: IRestRoute<INoContentRequest, IServerLivezResponse> = {\n\t\toperationId: \"serverLivez\",\n\t\tsummary: \"Get the livez status for the server\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/livez`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverLivez(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerLivezResponse\",\n\t\t\t\tmimeType: MimeTypes.PlainText,\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"livezResponseOK\",\n\t\t\t\t\t\tdescription: \"The response for the liveness request.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbody: \"alive\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"livezResponseFailure\",\n\t\t\t\t\t\tdescription: \"The response for the liveness request with errors.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbody: \"dead\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst readyzRoute: IRestRoute<INoContentRequest, IServerReadyzResponse> = {\n\t\toperationId: \"serverReadyz\",\n\t\tsummary: \"Get the readyz status for the server\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/readyz`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverReadyz(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerReadyzResponse\",\n\t\t\t\tmimeType: MimeTypes.PlainText,\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"readyzResponseOK\",\n\t\t\t\t\t\tdescription: \"The response for the readiness request.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbody: \"ready\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"readyzResponseFailure\",\n\t\t\t\t\t\tdescription: \"The response for the readiness request with errors.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbody: \"not ready\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst specRoute: IRestRoute<INoContentRequest, IServerSpecResponse> = {\n\t\toperationId: \"serverSpec\",\n\t\tsummary: \"Get the OpenAPI specification for the endpoints\",\n\t\ttag: tagsInformation[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/spec`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tserverSpec(httpRequestContext, componentName, request),\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IServerSpecResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"specResponse\",\n\t\t\t\t\t\tdescription: \"The response for the spec request.\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\topenapi: \"3.1.0\",\n\t\t\t\t\t\t\t\tinfo: {},\n\t\t\t\t\t\t\t\tpaths: {}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\treturn [rootRoute, favIconRoute, informationRoute, livezRoute, readyzRoute, specRoute];\n}\n\n/**\n * Get the root for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverRoot(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerRootResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\treturn {\n\t\theaders: {\n\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t},\n\t\tbody: await component.root()\n\t};\n}\n\n/**\n * Get the information for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverInfo(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerInfoResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\treturn {\n\t\tbody: await component.info()\n\t};\n}\n\n/**\n * Get the livez for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverLivez(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerLivezResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\treturn {\n\t\theaders: {\n\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t},\n\t\tbody: (await component.livez()).status\n\t};\n}\n\n/**\n * Get the readyz for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverReadyz(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerReadyzResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\treturn {\n\t\theaders: {\n\t\t\t[HeaderTypes.ContentType]: MimeTypes.PlainText\n\t\t},\n\t\tbody: (await component.readyz()).status\n\t};\n}\n\n/**\n * Get the favicon for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverFavIcon(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerFavIconResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\tconst favIcon = await component.favicon();\n\n\tif (Is.uint8Array(favIcon)) {\n\t\treturn {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.ContentType]: \"image/x-icon\"\n\t\t\t},\n\t\t\tbody: favIcon\n\t\t};\n\t}\n\treturn {\n\t\tstatusCode: HttpStatusCode.notFound\n\t};\n}\n\n/**\n * Get the spec for the server.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function serverSpec(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: INoContentRequest\n): Promise<IServerSpecResponse> {\n\tconst component = ComponentFactory.get<IInformationComponent>(componentName);\n\tconst spec = await component.spec();\n\n\tif (Is.objectValue(spec)) {\n\t\treturn {\n\t\t\tbody: spec\n\t\t};\n\t}\n\treturn {\n\t\tstatusCode: HttpStatusCode.notFound\n\t};\n}\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { Factory, Guards, Is } from "@3sixty/core";
|
|
5
|
+
/**
|
|
6
|
+
* The information service for the server.
|
|
7
|
+
*/
|
|
8
|
+
export class InformationService {
|
|
9
|
+
/**
|
|
10
|
+
* Runtime name for the class.
|
|
11
|
+
*/
|
|
12
|
+
static CLASS_NAME = "InformationService";
|
|
13
|
+
/**
|
|
14
|
+
* The server information.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
_serverInfo;
|
|
18
|
+
/**
|
|
19
|
+
* The path to the favicon Spec.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
_faviconPath;
|
|
23
|
+
/**
|
|
24
|
+
* The favicon.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
_favicon;
|
|
28
|
+
/**
|
|
29
|
+
* The path to the OpenAPI Spec.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
_openApiSpecPath;
|
|
33
|
+
/**
|
|
34
|
+
* The OpenAPI spec.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
_openApiSpec;
|
|
38
|
+
/**
|
|
39
|
+
* Create a new instance of InformationService.
|
|
40
|
+
* @param options The options to create the service.
|
|
41
|
+
*/
|
|
42
|
+
constructor(options) {
|
|
43
|
+
Guards.object(InformationService.CLASS_NAME, "options", options);
|
|
44
|
+
Guards.object(InformationService.CLASS_NAME, "options.config", options.config);
|
|
45
|
+
Guards.object(InformationService.CLASS_NAME, "options.config.serverInfo", options.config.serverInfo);
|
|
46
|
+
this._serverInfo = options.config.serverInfo;
|
|
47
|
+
this._faviconPath = options.config.favIconPath;
|
|
48
|
+
this._openApiSpecPath = options.config.openApiSpecPath;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns the class name of the component.
|
|
52
|
+
* @returns The class name of the component.
|
|
53
|
+
*/
|
|
54
|
+
className() {
|
|
55
|
+
return InformationService.CLASS_NAME;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The service needs to be started when the application is initialized.
|
|
59
|
+
* @returns A promise that resolves when the OpenAPI spec and favicon have been loaded from disk.
|
|
60
|
+
*/
|
|
61
|
+
async start() {
|
|
62
|
+
const openApiPath = this._openApiSpecPath;
|
|
63
|
+
if (Is.stringValue(openApiPath)) {
|
|
64
|
+
const contentBuffer = await readFile(openApiPath, "utf8");
|
|
65
|
+
this._openApiSpec = JSON.parse(contentBuffer);
|
|
66
|
+
}
|
|
67
|
+
const favIconPath = this._faviconPath;
|
|
68
|
+
if (Is.stringValue(favIconPath)) {
|
|
69
|
+
this._favicon = await readFile(favIconPath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the root information.
|
|
74
|
+
* @returns The root information.
|
|
75
|
+
*/
|
|
76
|
+
async root() {
|
|
77
|
+
return `${this._serverInfo.name} - ${this._serverInfo.version}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the server information.
|
|
81
|
+
* @returns The service information.
|
|
82
|
+
*/
|
|
83
|
+
async info() {
|
|
84
|
+
return this._serverInfo;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get the favicon.
|
|
88
|
+
* @returns The favicon.
|
|
89
|
+
*/
|
|
90
|
+
async favicon() {
|
|
91
|
+
return this._favicon;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the OpenAPI spec.
|
|
95
|
+
* @returns The OpenAPI spec.
|
|
96
|
+
*/
|
|
97
|
+
async spec() {
|
|
98
|
+
return this._openApiSpec;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Is the server live.
|
|
102
|
+
* @returns The liveness status of the server.
|
|
103
|
+
*/
|
|
104
|
+
async livez() {
|
|
105
|
+
return { status: "alive" };
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Is the server ready.
|
|
109
|
+
* @returns The readyz status of the server.
|
|
110
|
+
*/
|
|
111
|
+
async readyz() {
|
|
112
|
+
const engineCoreFactory = Factory.getFactory("engine-core");
|
|
113
|
+
if (engineCoreFactory) {
|
|
114
|
+
// Use a replica of the IEngineCore interface to avoid a circular dependency on the engine-core package.
|
|
115
|
+
const engine = engineCoreFactory.getIfExists("engine");
|
|
116
|
+
if (engine?.isStarted()) {
|
|
117
|
+
return { status: "ready" };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { status: "not ready" };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=informationService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"informationService.js","sources":["../../src/informationService.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAInD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC9B;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,oBAAoB,CAAC;IAEjE;;;OAGG;IACc,WAAW,CAAc;IAE1C;;;OAGG;IACc,YAAY,CAAU;IAEvC;;;OAGG;IACK,QAAQ,CAAc;IAE9B;;;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B,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,KAAK;QAGjB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM;QAGlB,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;QAE5D,IAAI,iBAAiB,EAAE,CAAC;YACvB,wGAAwG;YACxG,MAAM,MAAM,GAAG,iBAAiB,CAAC,WAAW,CAA+B,QAAQ,CAAC,CAAC;YAErF,IAAI,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;YAC5B,CAAC;QACF,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAChC,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { readFile } from \"node:fs/promises\";\nimport type { IInformationComponent, IServerInfo } from \"@3sixty/api-models\";\nimport { Factory, Guards, Is } from \"@3sixty/core\";\n\nimport type { IInformationServiceConstructorOptions } from \"./models/IInformationServiceConstructorOptions.js\";\n\n/**\n * The information service for the server.\n */\nexport class InformationService implements IInformationComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"InformationService\";\n\n\t/**\n\t * The server information.\n\t * @internal\n\t */\n\tprivate readonly _serverInfo: IServerInfo;\n\n\t/**\n\t * The path to the favicon Spec.\n\t * @internal\n\t */\n\tprivate readonly _faviconPath?: string;\n\n\t/**\n\t * The favicon.\n\t * @internal\n\t */\n\tprivate _favicon?: Uint8Array;\n\n\t/**\n\t * The path to the OpenAPI Spec.\n\t * @internal\n\t */\n\tprivate readonly _openApiSpecPath?: string;\n\n\t/**\n\t * The OpenAPI spec.\n\t * @internal\n\t */\n\tprivate _openApiSpec?: string;\n\n\t/**\n\t * Create a new instance of InformationService.\n\t * @param options The options to create the service.\n\t */\n\tconstructor(options: IInformationServiceConstructorOptions) {\n\t\tGuards.object(InformationService.CLASS_NAME, \"options\", options);\n\t\tGuards.object(InformationService.CLASS_NAME, \"options.config\", options.config);\n\t\tGuards.object(\n\t\t\tInformationService.CLASS_NAME,\n\t\t\t\"options.config.serverInfo\",\n\t\t\toptions.config.serverInfo\n\t\t);\n\n\t\tthis._serverInfo = options.config.serverInfo;\n\t\tthis._faviconPath = options.config.favIconPath;\n\t\tthis._openApiSpecPath = options.config.openApiSpecPath;\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn InformationService.CLASS_NAME;\n\t}\n\n\t/**\n\t * The service needs to be started when the application is initialized.\n\t * @returns A promise that resolves when the OpenAPI spec and favicon have been loaded from disk.\n\t */\n\tpublic async start(): Promise<void> {\n\t\tconst openApiPath = this._openApiSpecPath;\n\t\tif (Is.stringValue(openApiPath)) {\n\t\t\tconst contentBuffer = await readFile(openApiPath, \"utf8\");\n\t\t\tthis._openApiSpec = JSON.parse(contentBuffer);\n\t\t}\n\n\t\tconst favIconPath = this._faviconPath;\n\t\tif (Is.stringValue(favIconPath)) {\n\t\t\tthis._favicon = await readFile(favIconPath);\n\t\t}\n\t}\n\n\t/**\n\t * Get the root information.\n\t * @returns The root information.\n\t */\n\tpublic async root(): Promise<string> {\n\t\treturn `${this._serverInfo.name} - ${this._serverInfo.version}`;\n\t}\n\n\t/**\n\t * Get the server information.\n\t * @returns The service information.\n\t */\n\tpublic async info(): Promise<IServerInfo> {\n\t\treturn this._serverInfo;\n\t}\n\n\t/**\n\t * Get the favicon.\n\t * @returns The favicon.\n\t */\n\tpublic async favicon(): Promise<Uint8Array | undefined> {\n\t\treturn this._favicon;\n\t}\n\n\t/**\n\t * Get the OpenAPI spec.\n\t * @returns The OpenAPI spec.\n\t */\n\tpublic async spec(): Promise<unknown> {\n\t\treturn this._openApiSpec;\n\t}\n\n\t/**\n\t * Is the server live.\n\t * @returns The liveness status of the server.\n\t */\n\tpublic async livez(): Promise<{\n\t\tstatus: \"alive\" | \"dead\";\n\t}> {\n\t\treturn { status: \"alive\" };\n\t}\n\n\t/**\n\t * Is the server ready.\n\t * @returns The readyz status of the server.\n\t */\n\tpublic async readyz(): Promise<{\n\t\tstatus: \"ready\" | \"not ready\";\n\t}> {\n\t\tconst engineCoreFactory = Factory.getFactory(\"engine-core\");\n\n\t\tif (engineCoreFactory) {\n\t\t\t// Use a replica of the IEngineCore interface to avoid a circular dependency on the engine-core package.\n\t\t\tconst engine = engineCoreFactory.getIfExists<{ isStarted: () => boolean }>(\"engine\");\n\n\t\t\tif (engine?.isStarted()) {\n\t\t\t\treturn { status: \"ready\" };\n\t\t\t}\n\t\t}\n\n\t\treturn { status: \"not ready\" };\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHealthServiceConfig.js","sources":["../../../src/models/IHealthServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the health service.\n */\nexport interface IHealthServiceConfig {\n\t/**\n\t * The interval for checking the health of the components.\n\t * @default 60000\n\t */\n\thealthCheckInterval?: number;\n\n\t/**\n\t * The interval for running the application health lifecycle (init, application, teardown).\n\t * @default 300000\n\t */\n\thealthCheckApplicationInterval?: number;\n\n\t/**\n\t * The initial interval for checking the health of the components and setting it in the health service.\n\t * This is used to check the health of the components immediately after the service is started.\n\t * @default 2000\n\t */\n\tinitialInterval?: number;\n\n\t/**\n\t * Whether to include stack traces in health check error details.\n\t * @default false\n\t */\n\tincludeErrorStack?: boolean;\n\n\t/**\n\t * The URL of the module to use for the application health background task.\n\t * If not provided, the default healthApplicationTask module will be used.\n\t */\n\toverrideApplicationHealthTaskHandler?: string;\n\n\t/**\n\t * The component types to exclude from the engine clone used by the application health\n\t * background task. Each entry is a regular expression matched against the engine config\n\t * type keys, for example \"^rightsManagement\" or \"messaging.*Connector\".\n\t */\n\texcludeCloneComponents?: string[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHealthServiceConstructorOptions.js","sources":["../../../src/models/IHealthServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHealthServiceConfig } from \"./IHealthServiceConfig.js\";\n\n/**\n * Options for the HealthService constructor.\n */\nexport interface IHealthServiceConstructorOptions {\n\t/**\n\t * The background task component type to use for running application health checks.\n\t * @default background-task\n\t */\n\tbackgroundTaskComponentType?: string;\n\n\t/**\n\t * The configuration for the service.\n\t */\n\tconfig?: IHealthServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IInformationServiceConfig.js","sources":["../../../src/models/IInformationServiceConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IServerInfo } from \"@3sixty/api-models\";\n\n/**\n * Configuration for the information service.\n */\nexport interface IInformationServiceConfig {\n\t/**\n\t * The server information.\n\t */\n\tserverInfo: IServerInfo;\n\n\t/**\n\t * The path to the OpenAPI Spec.\n\t */\n\topenApiSpecPath?: string;\n\n\t/**\n\t * The path to the favicon.\n\t */\n\tfavIconPath?: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IInformationServiceConstructorOptions.js","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 @@
|
|
|
1
|
+
{"version":3,"file":"IPlatformServiceConfig.js","sources":["../../../src/models/IPlatformServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the platform service\n */\nexport interface IPlatformServiceConfig {\n\t/**\n\t * Indicates whether the service is running in a multi-tenant environment.\n\t * @default false\n\t */\n\tisMultiTenant?: boolean;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPlatformServiceConstructorOptions.js","sources":["../../../src/models/IPlatformServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IPlatformServiceConfig } from \"./IPlatformServiceConfig.js\";\n\n/**\n * Options for the Platform Service constructor.\n */\nexport interface IPlatformServiceConstructorOptions {\n\t/**\n\t * The entity storage for the tenants.\n\t * @default tenant\n\t */\n\ttenantEntityStorageType?: string;\n\n\t/**\n\t * The logging component type to use for error logging.\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Configuration for the service.\n\t */\n\tconfig?: IPlatformServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// Copyright 2026 3Sixty Trade Ltd.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
4
|
+
import { HttpContextIdKeys, HttpUrlHelper } from "@3sixty/api-models";
|
|
5
|
+
import { ContextIdKeys, ContextIdStore } from "@3sixty/context";
|
|
6
|
+
import { BaseError, ComponentFactory, Guards, Is } from "@3sixty/core";
|
|
7
|
+
import { EntityStorageConnectorFactory } from "@3sixty/entity-storage-models";
|
|
8
|
+
/**
|
|
9
|
+
* Service for performing platform operations.
|
|
10
|
+
*/
|
|
11
|
+
export class PlatformService {
|
|
12
|
+
/**
|
|
13
|
+
* Runtime name for the class.
|
|
14
|
+
*/
|
|
15
|
+
static CLASS_NAME = "PlatformService";
|
|
16
|
+
/**
|
|
17
|
+
* The type of entity storage connector to use for tenant lookups, if multi-tenant.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
_tenantEntityStorageConnectorType;
|
|
21
|
+
/**
|
|
22
|
+
* Entity storage connector used by the service.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
_tenantEntityStorageConnector;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether the service is running in a multi-tenant environment.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
_isMultiTenant;
|
|
31
|
+
/**
|
|
32
|
+
* The logging component type for error logging.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
_loggingComponentType;
|
|
36
|
+
/**
|
|
37
|
+
* Registered tenant event callbacks.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
_tenantEventCallbacks;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new instance of PlatformService.
|
|
43
|
+
* @param options The options for the connector.
|
|
44
|
+
*/
|
|
45
|
+
constructor(options) {
|
|
46
|
+
this._tenantEntityStorageConnectorType = options?.tenantEntityStorageType ?? "tenant";
|
|
47
|
+
this._isMultiTenant = options?.config?.isMultiTenant ?? false;
|
|
48
|
+
this._loggingComponentType = options?.loggingComponentType;
|
|
49
|
+
this._tenantEventCallbacks = new Map();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns the class name of the component.
|
|
53
|
+
* @returns The class name of the component.
|
|
54
|
+
*/
|
|
55
|
+
className() {
|
|
56
|
+
return PlatformService.CLASS_NAME;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Indicates whether the component is running in a multi-tenant environment.
|
|
60
|
+
* @returns True if the component is running in a multi-tenant environment, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
isMultiTenant() {
|
|
63
|
+
return this._isMultiTenant;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.
|
|
67
|
+
* @param method The method to run for each tenant, returning false will stop any further iterations.
|
|
68
|
+
* @returns A promise that resolves when the method has been executed for all applicable tenants.
|
|
69
|
+
*/
|
|
70
|
+
async execute(method) {
|
|
71
|
+
if (this._isMultiTenant) {
|
|
72
|
+
const tenantEntityStorageConnector = this.ensureEntityStorageConnector();
|
|
73
|
+
if (!Is.empty(tenantEntityStorageConnector)) {
|
|
74
|
+
let cursor;
|
|
75
|
+
let stopped = false;
|
|
76
|
+
const baseContextIds = (await ContextIdStore.getContextIds()) ?? {};
|
|
77
|
+
do {
|
|
78
|
+
const result = await tenantEntityStorageConnector.query(undefined, undefined, ["id"], cursor);
|
|
79
|
+
for (const tenant of result.entities) {
|
|
80
|
+
await ContextIdStore.run({ ...baseContextIds, [ContextIdKeys.Tenant]: tenant.id }, async () => {
|
|
81
|
+
stopped = (await method()) === false;
|
|
82
|
+
});
|
|
83
|
+
if (stopped) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
cursor = result.cursor;
|
|
88
|
+
} while (!stopped && Is.stringValue(cursor));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
await method();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get the local origin context IDs for the given URL.
|
|
97
|
+
* @param url The URL to check.
|
|
98
|
+
* @returns A promise that resolves to the context IDs if the URL is a local origin, undefined otherwise.
|
|
99
|
+
*/
|
|
100
|
+
async getLocalOriginContext(url) {
|
|
101
|
+
Guards.stringValue(PlatformService.CLASS_NAME, "url", url);
|
|
102
|
+
const origin = HttpUrlHelper.extractOrigin(url);
|
|
103
|
+
if (!Is.stringValue(origin)) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
const contextIds = await ContextIdStore.getContextIds();
|
|
107
|
+
if (this._isMultiTenant) {
|
|
108
|
+
const tenantEntityStorageConnector = this.ensureEntityStorageConnector();
|
|
109
|
+
if (!Is.empty(tenantEntityStorageConnector)) {
|
|
110
|
+
// When the URL carries an ?organization=<org-did>
|
|
111
|
+
// query param, that param - not the origin - identifies the target tenant. A single
|
|
112
|
+
// node hosts many tenants behind one shared origin, so an origin match alone cannot
|
|
113
|
+
// distinguish them and would incorrectly return the caller's own context. Resolve the
|
|
114
|
+
// tenant by its organization id (mirrors TenantProcessor inbound routing); when the
|
|
115
|
+
// organization is not a local tenant, treat the URL as remote (undefined).
|
|
116
|
+
const organizationId = HttpUrlHelper.getQueryStringParam(url, ContextIdKeys.Organization);
|
|
117
|
+
if (Is.stringValue(organizationId)) {
|
|
118
|
+
const orgTenant = await tenantEntityStorageConnector.get(organizationId, "organizationId");
|
|
119
|
+
if (!Is.empty(orgTenant)) {
|
|
120
|
+
return {
|
|
121
|
+
...contextIds,
|
|
122
|
+
[ContextIdKeys.Tenant]: orgTenant.id,
|
|
123
|
+
[ContextIdKeys.Organization]: orgTenant.organizationId,
|
|
124
|
+
[HttpContextIdKeys.PublicOrigin]: Is.stringValue(orgTenant.publicOrigin)
|
|
125
|
+
? orgTenant.publicOrigin
|
|
126
|
+
: contextIds?.[HttpContextIdKeys.PublicOrigin]
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];
|
|
134
|
+
if (publicOrigin === origin) {
|
|
135
|
+
return contextIds;
|
|
136
|
+
}
|
|
137
|
+
if (this._isMultiTenant) {
|
|
138
|
+
const tenantEntityStorageConnector = this.ensureEntityStorageConnector();
|
|
139
|
+
if (!Is.empty(tenantEntityStorageConnector)) {
|
|
140
|
+
const tenant = await tenantEntityStorageConnector.get(origin, "publicOrigin");
|
|
141
|
+
if (!Is.empty(tenant)) {
|
|
142
|
+
return {
|
|
143
|
+
...contextIds,
|
|
144
|
+
[ContextIdKeys.Tenant]: tenant.id,
|
|
145
|
+
[ContextIdKeys.Organization]: tenant.organizationId,
|
|
146
|
+
[HttpContextIdKeys.PublicOrigin]: Is.stringValue(tenant.publicOrigin)
|
|
147
|
+
? tenant.publicOrigin
|
|
148
|
+
: contextIds?.[HttpContextIdKeys.PublicOrigin]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
const localOrigin = contextIds?.[HttpContextIdKeys.LocalOrigin];
|
|
155
|
+
if (localOrigin === origin) {
|
|
156
|
+
return contextIds;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Registers a callback to be invoked when a tenant event occurs.
|
|
162
|
+
* @param callbackId A unique identifier for the callback.
|
|
163
|
+
* @param callback The callback to invoke when a tenant event occurs.
|
|
164
|
+
*/
|
|
165
|
+
registerTenantEventCallback(callbackId, callback) {
|
|
166
|
+
this._tenantEventCallbacks.set(callbackId, callback);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Unregisters a previously registered tenant event callback.
|
|
170
|
+
* @param callbackId The identifier of the callback to unregister.
|
|
171
|
+
*/
|
|
172
|
+
unregisterTenantEventCallback(callbackId) {
|
|
173
|
+
this._tenantEventCallbacks.delete(callbackId);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Fires all registered tenant event callbacks.
|
|
177
|
+
* @param tenantId The ID of the tenant for which the event occurred.
|
|
178
|
+
* @param eventType The type of event that occurred.
|
|
179
|
+
* @returns A promise that resolves when all callbacks have been invoked.
|
|
180
|
+
*/
|
|
181
|
+
async fireTenantEvent(tenantId, eventType) {
|
|
182
|
+
for (const callback of this._tenantEventCallbacks.values()) {
|
|
183
|
+
try {
|
|
184
|
+
// Run with an empty context so callbacks do not inherit the caller's tenant
|
|
185
|
+
await ContextIdStore.run({}, async () => callback(tenantId, eventType));
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
const logging = ComponentFactory.getIfExists(this._loggingComponentType);
|
|
189
|
+
await logging?.log({
|
|
190
|
+
level: "error",
|
|
191
|
+
source: PlatformService.CLASS_NAME,
|
|
192
|
+
message: "tenantEventCallbackFailed",
|
|
193
|
+
data: { tenantId, eventType },
|
|
194
|
+
error: BaseError.fromError(error)
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Ensure that the entity storage connector is initialized and return it.
|
|
201
|
+
* @returns The entity storage connector.
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
ensureEntityStorageConnector() {
|
|
205
|
+
if (Is.empty(this._tenantEntityStorageConnector)) {
|
|
206
|
+
this._tenantEntityStorageConnector = EntityStorageConnectorFactory.getIfExists(this._tenantEntityStorageConnectorType);
|
|
207
|
+
}
|
|
208
|
+
return this._tenantEntityStorageConnector;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=platformService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformService.js","sources":["../../src/platformService.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,mC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MAAM,EAAE,EAAE,CAAC;YAC5D,IAAI,CAAC;gBACJ,4EAA4E;gBAC5E,MAAM,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;YACzE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,CAAoB,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBAC5F,MAAM,OAAO,EAAE,GAAG,CAAC;oBAClB,KAAK,EAAE,OAAO;oBACd,MAAM,EAAE,eAAe,CAAC,UAAU;oBAClC,OAAO,EAAE,2BAA2B;oBACpC,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;oBAC7B,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;iBACjC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;OAIG;IACK,4BAA4B;QACnC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,6BAA6B,GAAG,6BAA6B,CAAC,WAAW,CAC7E,IAAI,CAAC,iCAAiC,CACtC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,6BAA6B,CAAC;IAC3C,CAAC;CACD","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tHttpContextIdKeys,\n\tHttpUrlHelper,\n\ttype IPlatformComponent,\n\ttype ITenant,\n\ttype TenantEventCallback,\n\ttype TenantEventType\n} from \"@3sixty/api-models\";\nimport { ContextIdKeys, ContextIdStore, type IContextIds } from \"@3sixty/context\";\nimport { BaseError, ComponentFactory, Guards, Is } from \"@3sixty/core\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@3sixty/entity-storage-models\";\nimport type { ILoggingComponent } from \"@3sixty/logging-models\";\n\nimport type { IPlatformServiceConstructorOptions } from \"./models/IPlatformServiceConstructorOptions.js\";\n\n/**\n * Service for performing platform operations.\n */\nexport class PlatformService implements IPlatformComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"PlatformService\";\n\n\t/**\n\t * The type of entity storage connector to use for tenant lookups, if multi-tenant.\n\t * @internal\n\t */\n\tprivate readonly _tenantEntityStorageConnectorType: string;\n\n\t/**\n\t * Entity storage connector used by the service.\n\t * @internal\n\t */\n\tprivate _tenantEntityStorageConnector?: IEntityStorageConnector<ITenant>;\n\n\t/**\n\t * Indicates whether the service is running in a multi-tenant environment.\n\t * @internal\n\t */\n\tprivate readonly _isMultiTenant: boolean;\n\n\t/**\n\t * The logging component type for error logging.\n\t * @internal\n\t */\n\tprivate readonly _loggingComponentType?: string;\n\n\t/**\n\t * Registered tenant event callbacks.\n\t * @internal\n\t */\n\tprivate readonly _tenantEventCallbacks: Map<string, TenantEventCallback>;\n\n\t/**\n\t * Create a new instance of PlatformService.\n\t * @param options The options for the connector.\n\t */\n\tconstructor(options?: IPlatformServiceConstructorOptions) {\n\t\tthis._tenantEntityStorageConnectorType = options?.tenantEntityStorageType ?? \"tenant\";\n\t\tthis._isMultiTenant = options?.config?.isMultiTenant ?? false;\n\t\tthis._loggingComponentType = options?.loggingComponentType;\n\t\tthis._tenantEventCallbacks = new Map();\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn PlatformService.CLASS_NAME;\n\t}\n\n\t/**\n\t * Indicates whether the component is running in a multi-tenant environment.\n\t * @returns True if the component is running in a multi-tenant environment, false otherwise.\n\t */\n\tpublic isMultiTenant(): boolean {\n\t\treturn this._isMultiTenant;\n\t}\n\n\t/**\n\t * Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.\n\t * @param method The method to run for each tenant, returning false will stop any further iterations.\n\t * @returns A promise that resolves when the method has been executed for all applicable tenants.\n\t */\n\tpublic async execute(method: () => Promise<undefined | boolean> | Promise<void>): Promise<void> {\n\t\tif (this._isMultiTenant) {\n\t\t\tconst tenantEntityStorageConnector = this.ensureEntityStorageConnector();\n\n\t\t\tif (!Is.empty(tenantEntityStorageConnector)) {\n\t\t\t\tlet cursor: string | undefined;\n\t\t\t\tlet stopped = false;\n\n\t\t\t\tconst baseContextIds = (await ContextIdStore.getContextIds()) ?? {};\n\n\t\t\t\tdo {\n\t\t\t\t\tconst result = await tenantEntityStorageConnector.query(\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t[\"id\"],\n\t\t\t\t\t\tcursor\n\t\t\t\t\t);\n\n\t\t\t\t\tfor (const tenant of result.entities) {\n\t\t\t\t\t\tawait ContextIdStore.run(\n\t\t\t\t\t\t\t{ ...baseContextIds, [ContextIdKeys.Tenant]: tenant.id },\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tstopped = (await method()) === false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (stopped) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcursor = result.cursor;\n\t\t\t\t} while (!stopped && Is.stringValue(cursor));\n\t\t\t}\n\t\t} else {\n\t\t\tawait method();\n\t\t}\n\t}\n\n\t/**\n\t * Get the local origin context IDs for the given URL.\n\t * @param url The URL to check.\n\t * @returns A promise that resolves to the context IDs if the URL is a local origin, undefined otherwise.\n\t */\n\tpublic async getLocalOriginContext(url: string): Promise<IContextIds | undefined> {\n\t\tGuards.stringValue(PlatformService.CLASS_NAME, \"url\", url);\n\n\t\tconst origin = HttpUrlHelper.extractOrigin(url);\n\t\tif (!Is.stringValue(origin)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contextIds = await ContextIdStore.getContextIds();\n\n\t\tif (this._isMultiTenant) {\n\t\t\tconst tenantEntityStorageConnector = this.ensureEntityStorageConnector();\n\t\t\tif (!Is.empty(tenantEntityStorageConnector)) {\n\t\t\t\t// When the URL carries an ?organization=<org-did>\n\t\t\t\t// query param, that param - not the origin - identifies the target tenant. A single\n\t\t\t\t// node hosts many tenants behind one shared origin, so an origin match alone cannot\n\t\t\t\t// distinguish them and would incorrectly return the caller's own context. Resolve the\n\t\t\t\t// tenant by its organization id (mirrors TenantProcessor inbound routing); when the\n\t\t\t\t// organization is not a local tenant, treat the URL as remote (undefined).\n\t\t\t\tconst organizationId = HttpUrlHelper.getQueryStringParam(url, ContextIdKeys.Organization);\n\t\t\t\tif (Is.stringValue(organizationId)) {\n\t\t\t\t\tconst orgTenant = await tenantEntityStorageConnector.get(\n\t\t\t\t\t\torganizationId,\n\t\t\t\t\t\t\"organizationId\"\n\t\t\t\t\t);\n\t\t\t\t\tif (!Is.empty(orgTenant)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...contextIds,\n\t\t\t\t\t\t\t[ContextIdKeys.Tenant]: orgTenant.id,\n\t\t\t\t\t\t\t[ContextIdKeys.Organization]: orgTenant.organizationId,\n\t\t\t\t\t\t\t[HttpContextIdKeys.PublicOrigin]: Is.stringValue(orgTenant.publicOrigin)\n\t\t\t\t\t\t\t\t? orgTenant.publicOrigin\n\t\t\t\t\t\t\t\t: contextIds?.[HttpContextIdKeys.PublicOrigin]\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];\n\t\tif (publicOrigin === origin) {\n\t\t\treturn contextIds;\n\t\t}\n\n\t\tif (this._isMultiTenant) {\n\t\t\tconst tenantEntityStorageConnector = this.ensureEntityStorageConnector();\n\t\t\tif (!Is.empty(tenantEntityStorageConnector)) {\n\t\t\t\tconst tenant = await tenantEntityStorageConnector.get(origin, \"publicOrigin\");\n\t\t\t\tif (!Is.empty(tenant)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...contextIds,\n\t\t\t\t\t\t[ContextIdKeys.Tenant]: tenant.id,\n\t\t\t\t\t\t[ContextIdKeys.Organization]: tenant.organizationId,\n\t\t\t\t\t\t[HttpContextIdKeys.PublicOrigin]: Is.stringValue(tenant.publicOrigin)\n\t\t\t\t\t\t\t? tenant.publicOrigin\n\t\t\t\t\t\t\t: contextIds?.[HttpContextIdKeys.PublicOrigin]\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst localOrigin = contextIds?.[HttpContextIdKeys.LocalOrigin];\n\t\t\tif (localOrigin === origin) {\n\t\t\t\treturn contextIds;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Registers a callback to be invoked when a tenant event occurs.\n\t * @param callbackId A unique identifier for the callback.\n\t * @param callback The callback to invoke when a tenant event occurs.\n\t */\n\tpublic registerTenantEventCallback(callbackId: string, callback: TenantEventCallback): void {\n\t\tthis._tenantEventCallbacks.set(callbackId, callback);\n\t}\n\n\t/**\n\t * Unregisters a previously registered tenant event callback.\n\t * @param callbackId The identifier of the callback to unregister.\n\t */\n\tpublic unregisterTenantEventCallback(callbackId: string): void {\n\t\tthis._tenantEventCallbacks.delete(callbackId);\n\t}\n\n\t/**\n\t * Fires all registered tenant event callbacks.\n\t * @param tenantId The ID of the tenant for which the event occurred.\n\t * @param eventType The type of event that occurred.\n\t * @returns A promise that resolves when all callbacks have been invoked.\n\t */\n\tpublic async fireTenantEvent(tenantId: string, eventType: TenantEventType): Promise<void> {\n\t\tfor (const callback of this._tenantEventCallbacks.values()) {\n\t\t\ttry {\n\t\t\t\t// Run with an empty context so callbacks do not inherit the caller's tenant\n\t\t\t\tawait ContextIdStore.run({}, async () => callback(tenantId, eventType));\n\t\t\t} catch (error) {\n\t\t\t\tconst logging = ComponentFactory.getIfExists<ILoggingComponent>(this._loggingComponentType);\n\t\t\t\tawait logging?.log({\n\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\tsource: PlatformService.CLASS_NAME,\n\t\t\t\t\tmessage: \"tenantEventCallbackFailed\",\n\t\t\t\t\tdata: { tenantId, eventType },\n\t\t\t\t\terror: BaseError.fromError(error)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Ensure that the entity storage connector is initialized and return it.\n\t * @returns The entity storage connector.\n\t * @internal\n\t */\n\tprivate ensureEntityStorageConnector(): IEntityStorageConnector<ITenant> | undefined {\n\t\tif (Is.empty(this._tenantEntityStorageConnector)) {\n\t\t\tthis._tenantEntityStorageConnector = EntityStorageConnectorFactory.getIfExists(\n\t\t\t\tthis._tenantEntityStorageConnectorType\n\t\t\t);\n\t\t}\n\n\t\treturn this._tenantEntityStorageConnector;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { generateRestRoutesHealth, tagsHealth } from "./healthRoutes.js";
|
|
2
|
+
import { generateRestRoutesInformation, tagsInformation } from "./informationRoutes.js";
|
|
3
|
+
/**
|
|
4
|
+
* REST entry points for the information and health services.
|
|
5
|
+
*/
|
|
6
|
+
export const restEntryPoints = [
|
|
7
|
+
{
|
|
8
|
+
name: "information",
|
|
9
|
+
defaultBaseRoute: "",
|
|
10
|
+
tags: tagsInformation,
|
|
11
|
+
generateRoutes: generateRestRoutesInformation
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "health",
|
|
15
|
+
defaultBaseRoute: "",
|
|
16
|
+
tags: tagsHealth,
|
|
17
|
+
generateRoutes: generateRestRoutesHealth
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=restEntryPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restEntryPoints.js","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAExF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,aAAa;QACnB,gBAAgB,EAAE,EAAE;QACpB,IAAI,EAAE,eAAe;QACrB,cAAc,EAAE,6BAA6B;KAC7C;IACD;QACC,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,EAAE;QACpB,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,wBAAwB;KACxC;CACD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@3sixty/api-models\";\nimport { generateRestRoutesHealth, tagsHealth } from \"./healthRoutes.js\";\nimport { generateRestRoutesInformation, tagsInformation } from \"./informationRoutes.js\";\n\n/**\n * REST entry points for the information and health services.\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\t{\n\t\tname: \"health\",\n\t\tdefaultBaseRoute: \"\",\n\t\ttags: tagsHealth,\n\t\tgenerateRoutes: generateRestRoutesHealth\n\t}\n];\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IHealth } from "@3sixty/api-models";
|
|
2
|
+
/**
|
|
3
|
+
* Start the engine clone used for application health checks.
|
|
4
|
+
* @param engineCloneData The engine clone data supplied automatically by the background task framework.
|
|
5
|
+
* @param excludeComponents Verified regular expression patterns for component types to exclude
|
|
6
|
+
* from the clone, validated by the health service before registration.
|
|
7
|
+
*/
|
|
8
|
+
export declare function healthApplicationTaskStart(engineCloneData: unknown, excludeComponents?: string[]): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Stop the engine clone used for application health checks.
|
|
11
|
+
*/
|
|
12
|
+
export declare function healthApplicationTaskEnd(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Execute the application health lifecycle (init, application, teardown) across all registered
|
|
15
|
+
* components. Called by the background task framework in a worker thread; the engine clone data
|
|
16
|
+
* is used to initialise a local clone of the engine so component factories are available.
|
|
17
|
+
* @param engineCloneData The engine clone data supplied automatically by the background task framework.
|
|
18
|
+
* @returns The health entries collected across all three passes.
|
|
19
|
+
*/
|
|
20
|
+
export declare function healthApplicationTask(engineCloneData: unknown): Promise<IHealth[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type IHttpRequestContext, type INoContentRequest, type IRestRoute, type IServerHealthResponse, type ITag } from "@3sixty/api-models";
|
|
2
|
+
/**
|
|
3
|
+
* The tag to associate with the routes.
|
|
4
|
+
*/
|
|
5
|
+
export declare const tagsHealth: ITag[];
|
|
6
|
+
/**
|
|
7
|
+
* The REST routes for server health.
|
|
8
|
+
* @param baseRouteName Prefix to prepend to the paths.
|
|
9
|
+
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
10
|
+
* @returns The generated routes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateRestRoutesHealth(baseRouteName: string, componentName: string): IRestRoute[];
|
|
13
|
+
/**
|
|
14
|
+
* Get the health for the server.
|
|
15
|
+
* @param httpRequestContext The request context for the API.
|
|
16
|
+
* @param componentName The name of the component to use in the routes.
|
|
17
|
+
* @param request The request.
|
|
18
|
+
* @returns The response object with additional http response properties.
|
|
19
|
+
*/
|
|
20
|
+
export declare function serverHealth(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerHealthResponse>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type IHealth, type IHealthComponent, HealthStatus } from "@3sixty/api-models";
|
|
2
|
+
import type { IHealthServiceConstructorOptions } from "./models/IHealthServiceConstructorOptions.js";
|
|
3
|
+
/**
|
|
4
|
+
* The health service for the server.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HealthService implements IHealthComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Runtime name for the class.
|
|
9
|
+
*/
|
|
10
|
+
static readonly CLASS_NAME: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new instance of HealthService.
|
|
13
|
+
* @param options The constructor options.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options?: IHealthServiceConstructorOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the class name of the component.
|
|
18
|
+
* @returns The class name of the component.
|
|
19
|
+
*/
|
|
20
|
+
className(): string;
|
|
21
|
+
/**
|
|
22
|
+
* The component needs to be started when the node is initialized.
|
|
23
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
24
|
+
* @returns A promise that resolves when the initial health check timers have been scheduled.
|
|
25
|
+
* @throws GeneralError if an exclude clone component is not a valid regular expression.
|
|
26
|
+
*/
|
|
27
|
+
start(nodeLoggingComponentType?: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* The component needs to be stopped when the node is closed.
|
|
30
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
31
|
+
* @returns A promise that resolves when the health check timers have been cancelled.
|
|
32
|
+
*/
|
|
33
|
+
stop(nodeLoggingComponentType?: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the server health.
|
|
36
|
+
* @returns The service health.
|
|
37
|
+
*/
|
|
38
|
+
healthStatus(): Promise<{
|
|
39
|
+
status: HealthStatus;
|
|
40
|
+
components: IHealth[];
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./healthRoutes.js";
|
|
2
|
+
export * from "./healthService.js";
|
|
3
|
+
export * from "./informationRoutes.js";
|
|
4
|
+
export * from "./informationService.js";
|
|
5
|
+
export * from "./models/IHealthServiceConfig.js";
|
|
6
|
+
export * from "./models/IHealthServiceConstructorOptions.js";
|
|
7
|
+
export * from "./models/IInformationServiceConfig.js";
|
|
8
|
+
export * from "./models/IInformationServiceConstructorOptions.js";
|
|
9
|
+
export * from "./models/IPlatformServiceConfig.js";
|
|
10
|
+
export * from "./models/IPlatformServiceConstructorOptions.js";
|
|
11
|
+
export * from "./platformService.js";
|
|
12
|
+
export * from "./restEntryPoints.js";
|