@twin.org/api-service 0.0.3-next.42 → 0.0.3-next.44

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 (31) hide show
  1. package/dist/es/index.js +3 -3
  2. package/dist/es/index.js.map +1 -1
  3. package/dist/es/models/IPlatformServiceConfig.js +4 -0
  4. package/dist/es/models/IPlatformServiceConfig.js.map +1 -0
  5. package/dist/es/models/IPlatformServiceConstructorOptions.js +2 -0
  6. package/dist/es/models/IPlatformServiceConstructorOptions.js.map +1 -0
  7. package/dist/es/platformService.js +76 -0
  8. package/dist/es/platformService.js.map +1 -0
  9. package/dist/types/index.d.ts +3 -3
  10. package/dist/types/models/IPlatformServiceConfig.d.ts +10 -0
  11. package/dist/types/models/IPlatformServiceConstructorOptions.d.ts +15 -0
  12. package/dist/types/platformService.d.ts +32 -0
  13. package/docs/changelog.md +28 -0
  14. package/docs/reference/classes/PlatformService.md +97 -0
  15. package/docs/reference/index.md +3 -3
  16. package/docs/reference/interfaces/IPlatformServiceConfig.md +17 -0
  17. package/docs/reference/interfaces/IPlatformServiceConstructorOptions.md +25 -0
  18. package/locales/en.json +0 -6
  19. package/package.json +3 -2
  20. package/dist/es/models/IUrlTransformerServiceConfig.js +0 -4
  21. package/dist/es/models/IUrlTransformerServiceConfig.js.map +0 -1
  22. package/dist/es/models/IUrlTransformerServiceConstructorOptions.js +0 -2
  23. package/dist/es/models/IUrlTransformerServiceConstructorOptions.js.map +0 -1
  24. package/dist/es/urlTransformerService.js +0 -256
  25. package/dist/es/urlTransformerService.js.map +0 -1
  26. package/dist/types/models/IUrlTransformerServiceConfig.d.ts +0 -19
  27. package/dist/types/models/IUrlTransformerServiceConstructorOptions.d.ts +0 -15
  28. package/dist/types/urlTransformerService.d.ts +0 -94
  29. package/docs/reference/classes/UrlTransformerService.md +0 -379
  30. package/docs/reference/interfaces/IUrlTransformerServiceConfig.md +0 -32
  31. package/docs/reference/interfaces/IUrlTransformerServiceConstructorOptions.md +0 -25
package/dist/es/index.js CHANGED
@@ -5,14 +5,14 @@ export * from "./healthService.js";
5
5
  export * from "./hostingService.js";
6
6
  export * from "./informationRoutes.js";
7
7
  export * from "./informationService.js";
8
- export * from "./urlTransformerService.js";
9
8
  export * from "./models/IHealthServiceConfig.js";
10
9
  export * from "./models/IHealthServiceConstructorOptions.js";
11
10
  export * from "./models/IHostingServiceConfig.js";
12
11
  export * from "./models/IHostingServiceConstructorOptions.js";
13
12
  export * from "./models/IInformationServiceConfig.js";
14
13
  export * from "./models/IInformationServiceConstructorOptions.js";
15
- export * from "./models/IUrlTransformerServiceConfig.js";
16
- export * from "./models/IUrlTransformerServiceConstructorOptions.js";
14
+ export * from "./models/IPlatformServiceConfig.js";
15
+ export * from "./models/IPlatformServiceConstructorOptions.js";
16
+ export * from "./platformService.js";
17
17
  export * from "./restEntryPoints.js";
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;AACrE,cAAc,sBAAsB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./healthRoutes.js\";\nexport * from \"./healthService.js\";\nexport * from \"./hostingService.js\";\nexport * from \"./informationRoutes.js\";\nexport * from \"./informationService.js\";\nexport * from \"./urlTransformerService.js\";\nexport * from \"./models/IHealthServiceConfig.js\";\nexport * from \"./models/IHealthServiceConstructorOptions.js\";\nexport * from \"./models/IHostingServiceConfig.js\";\nexport * from \"./models/IHostingServiceConstructorOptions.js\";\nexport * from \"./models/IInformationServiceConfig.js\";\nexport * from \"./models/IInformationServiceConstructorOptions.js\";\nexport * from \"./models/IUrlTransformerServiceConfig.js\";\nexport * from \"./models/IUrlTransformerServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./healthRoutes.js\";\nexport * from \"./healthService.js\";\nexport * from \"./hostingService.js\";\nexport * from \"./informationRoutes.js\";\nexport * from \"./informationService.js\";\nexport * from \"./models/IHealthServiceConfig.js\";\nexport * from \"./models/IHealthServiceConstructorOptions.js\";\nexport * from \"./models/IHostingServiceConfig.js\";\nexport * from \"./models/IHostingServiceConstructorOptions.js\";\nexport * from \"./models/IInformationServiceConfig.js\";\nexport * from \"./models/IInformationServiceConstructorOptions.js\";\nexport * from \"./models/IPlatformServiceConfig.js\";\nexport * from \"./models/IPlatformServiceConstructorOptions.js\";\nexport * from \"./platformService.js\";\nexport * from \"./restEntryPoints.js\";\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IPlatformServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPlatformServiceConfig.js","sourceRoot":"","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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IPlatformServiceConstructorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPlatformServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IPlatformServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\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 * Configuration for the service.\n\t */\n\tconfig?: IPlatformServiceConfig;\n}\n"]}
@@ -0,0 +1,76 @@
1
+ import { ContextIdKeys, ContextIdStore } from "@twin.org/context";
2
+ import { Is } from "@twin.org/core";
3
+ import { EntityStorageConnectorFactory } from "@twin.org/entity-storage-models";
4
+ /**
5
+ * Service for performing platform operations.
6
+ */
7
+ export class PlatformService {
8
+ /**
9
+ * Runtime name for the class.
10
+ */
11
+ static CLASS_NAME = "PlatformService";
12
+ /**
13
+ * The type of entity storage connector to use for tenant lookups, if multi-tenant.
14
+ * @internal
15
+ */
16
+ _entityStorageConnectorType;
17
+ /**
18
+ * Entity storage connector used by the service.
19
+ * @internal
20
+ */
21
+ _entityStorageConnector;
22
+ /**
23
+ * Indicates whether the service is running in a multi-tenant environment.
24
+ * @internal
25
+ */
26
+ _isMultiTenant;
27
+ /**
28
+ * Create a new instance of PlatformService.
29
+ * @param options The options for the connector.
30
+ */
31
+ constructor(options) {
32
+ this._entityStorageConnectorType = options?.tenantEntityStorageType ?? "tenant";
33
+ this._isMultiTenant = options?.config?.isMultiTenant ?? false;
34
+ }
35
+ /**
36
+ * Returns the class name of the component.
37
+ * @returns The class name of the component.
38
+ */
39
+ className() {
40
+ return PlatformService.CLASS_NAME;
41
+ }
42
+ /**
43
+ * Indicates whether the component is running in a multi-tenant environment.
44
+ * @returns True if the component is running in a multi-tenant environment, false otherwise.
45
+ */
46
+ isMultiTenant() {
47
+ return this._isMultiTenant;
48
+ }
49
+ /**
50
+ * Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.
51
+ * @param method The method to run for each tenant.
52
+ * @returns Nothing.
53
+ */
54
+ async execute(method) {
55
+ if (this._isMultiTenant) {
56
+ if (Is.empty(this._entityStorageConnector)) {
57
+ this._entityStorageConnector = EntityStorageConnectorFactory.get(this._entityStorageConnectorType);
58
+ }
59
+ let cursor;
60
+ const baseContextIds = (await ContextIdStore.getContextIds()) ?? {};
61
+ do {
62
+ const result = await this._entityStorageConnector.query(undefined, undefined, ["id"], cursor);
63
+ for (const tenant of result.entities) {
64
+ await ContextIdStore.run({ ...baseContextIds, [ContextIdKeys.Tenant]: tenant.id }, async () => {
65
+ await method();
66
+ });
67
+ }
68
+ cursor = result.cursor;
69
+ } while (Is.stringValue(cursor));
70
+ }
71
+ else {
72
+ await method();
73
+ }
74
+ }
75
+ }
76
+ //# sourceMappingURL=platformService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformService.js","sourceRoot":"","sources":["../../src/platformService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACN,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AAIzC;;GAEG;AACH,MAAM,OAAO,eAAe;IAC3B;;OAEG;IACI,MAAM,CAAU,UAAU,qBAAqC;IAEtE;;;OAGG;IACc,2BAA2B,CAAS;IAErD;;;OAGG;IACK,uBAAuB,CAAoC;IAEnE;;;OAGG;IACc,cAAc,CAAU;IAEzC;;;OAGG;IACH,YAAY,OAA4C;QACvD,IAAI,CAAC,2BAA2B,GAAG,OAAO,EAAE,uBAAuB,IAAI,QAAQ,CAAC;QAChF,IAAI,CAAC,cAAc,GAAG,OAAO,EAAE,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,eAAe,CAAC,UAAU,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,aAAa;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,MAA2B;QAC/C,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,uBAAuB,GAAG,6BAA6B,CAAC,GAAG,CAC/D,IAAI,CAAC,2BAA2B,CAChC,CAAC;YACH,CAAC;YAED,IAAI,MAA0B,CAAC;YAE/B,MAAM,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC;YAEpE,GAAG,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,KAAK,CACtD,SAAS,EACT,SAAS,EACT,CAAC,IAAI,CAAC,EACN,MAAM,CACN,CAAC;gBAEF,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;oBACtC,MAAM,cAAc,CAAC,GAAG,CACvB,EAAE,GAAG,cAAc,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,EACxD,KAAK,IAAI,EAAE;wBACV,MAAM,MAAM,EAAE,CAAC;oBAChB,CAAC,CACD,CAAC;gBACH,CAAC;gBAED,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YACxB,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;QAClC,CAAC;aAAM,CAAC;YACP,MAAM,MAAM,EAAE,CAAC;QAChB,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IPlatformComponent, ITenant } from \"@twin.org/api-models\";\nimport { ContextIdKeys, ContextIdStore } from \"@twin.org/context\";\nimport { Is } from \"@twin.org/core\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@twin.org/entity-storage-models\";\nimport { nameof } from \"@twin.org/nameof\";\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 = nameof<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 _entityStorageConnectorType: string;\n\n\t/**\n\t * Entity storage connector used by the service.\n\t * @internal\n\t */\n\tprivate _entityStorageConnector?: 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 * Create a new instance of PlatformService.\n\t * @param options The options for the connector.\n\t */\n\tconstructor(options?: IPlatformServiceConstructorOptions) {\n\t\tthis._entityStorageConnectorType = options?.tenantEntityStorageType ?? \"tenant\";\n\t\tthis._isMultiTenant = options?.config?.isMultiTenant ?? false;\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.\n\t * @returns Nothing.\n\t */\n\tpublic async execute(method: () => Promise<void>): Promise<void> {\n\t\tif (this._isMultiTenant) {\n\t\t\tif (Is.empty(this._entityStorageConnector)) {\n\t\t\t\tthis._entityStorageConnector = EntityStorageConnectorFactory.get(\n\t\t\t\t\tthis._entityStorageConnectorType\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet cursor: string | undefined;\n\n\t\t\tconst baseContextIds = (await ContextIdStore.getContextIds()) ?? {};\n\n\t\t\tdo {\n\t\t\t\tconst result = await this._entityStorageConnector.query(\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\t[\"id\"],\n\t\t\t\t\tcursor\n\t\t\t\t);\n\n\t\t\t\tfor (const tenant of result.entities) {\n\t\t\t\t\tawait ContextIdStore.run(\n\t\t\t\t\t\t{ ...baseContextIds, [ContextIdKeys.Tenant]: tenant.id },\n\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\tawait method();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcursor = result.cursor;\n\t\t\t} while (Is.stringValue(cursor));\n\t\t} else {\n\t\t\tawait method();\n\t\t}\n\t}\n}\n"]}
@@ -3,13 +3,13 @@ export * from "./healthService.js";
3
3
  export * from "./hostingService.js";
4
4
  export * from "./informationRoutes.js";
5
5
  export * from "./informationService.js";
6
- export * from "./urlTransformerService.js";
7
6
  export * from "./models/IHealthServiceConfig.js";
8
7
  export * from "./models/IHealthServiceConstructorOptions.js";
9
8
  export * from "./models/IHostingServiceConfig.js";
10
9
  export * from "./models/IHostingServiceConstructorOptions.js";
11
10
  export * from "./models/IInformationServiceConfig.js";
12
11
  export * from "./models/IInformationServiceConstructorOptions.js";
13
- export * from "./models/IUrlTransformerServiceConfig.js";
14
- export * from "./models/IUrlTransformerServiceConstructorOptions.js";
12
+ export * from "./models/IPlatformServiceConfig.js";
13
+ export * from "./models/IPlatformServiceConstructorOptions.js";
14
+ export * from "./platformService.js";
15
15
  export * from "./restEntryPoints.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Configuration for the platform service
3
+ */
4
+ export interface IPlatformServiceConfig {
5
+ /**
6
+ * Indicates whether the service is running in a multi-tenant environment.
7
+ * @default false
8
+ */
9
+ isMultiTenant?: boolean;
10
+ }
@@ -0,0 +1,15 @@
1
+ import type { IPlatformServiceConfig } from "./IPlatformServiceConfig.js";
2
+ /**
3
+ * Options for the Platform Service constructor.
4
+ */
5
+ export interface IPlatformServiceConstructorOptions {
6
+ /**
7
+ * The entity storage for the tenants.
8
+ * @default tenant
9
+ */
10
+ tenantEntityStorageType?: string;
11
+ /**
12
+ * Configuration for the service.
13
+ */
14
+ config?: IPlatformServiceConfig;
15
+ }
@@ -0,0 +1,32 @@
1
+ import type { IPlatformComponent } from "@twin.org/api-models";
2
+ import type { IPlatformServiceConstructorOptions } from "./models/IPlatformServiceConstructorOptions.js";
3
+ /**
4
+ * Service for performing platform operations.
5
+ */
6
+ export declare class PlatformService implements IPlatformComponent {
7
+ /**
8
+ * Runtime name for the class.
9
+ */
10
+ static readonly CLASS_NAME: string;
11
+ /**
12
+ * Create a new instance of PlatformService.
13
+ * @param options The options for the connector.
14
+ */
15
+ constructor(options?: IPlatformServiceConstructorOptions);
16
+ /**
17
+ * Returns the class name of the component.
18
+ * @returns The class name of the component.
19
+ */
20
+ className(): string;
21
+ /**
22
+ * Indicates whether the component is running in a multi-tenant environment.
23
+ * @returns True if the component is running in a multi-tenant environment, false otherwise.
24
+ */
25
+ isMultiTenant(): boolean;
26
+ /**
27
+ * Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.
28
+ * @param method The method to run for each tenant.
29
+ * @returns Nothing.
30
+ */
31
+ execute(method: () => Promise<void>): Promise<void>;
32
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.44](https://github.com/iotaledger/twin-api/compare/api-service-v0.0.3-next.43...api-service-v0.0.3-next.44) (2026-06-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * organization identifiers ([#158](https://github.com/iotaledger/twin-api/issues/158)) ([ce13244](https://github.com/iotaledger/twin-api/commit/ce13244aaacbf82d9e5f87d905e283b36ad63bbf))
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.43 to 0.0.3-next.44
16
+
17
+ ## [0.0.3-next.43](https://github.com/iotaledger/twin-api/compare/api-service-v0.0.3-next.42...api-service-v0.0.3-next.43) (2026-06-10)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **api-service:** Synchronize repo versions
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/api-models bumped from 0.0.3-next.42 to 0.0.3-next.43
30
+
3
31
  ## [0.0.3-next.42](https://github.com/iotaledger/twin-api/compare/api-service-v0.0.3-next.41...api-service-v0.0.3-next.42) (2026-06-08)
4
32
 
5
33
 
@@ -0,0 +1,97 @@
1
+ # Class: PlatformService
2
+
3
+ Service for performing platform operations.
4
+
5
+ ## Implements
6
+
7
+ - `IPlatformComponent`
8
+
9
+ ## Constructors
10
+
11
+ ### Constructor
12
+
13
+ > **new PlatformService**(`options?`): `PlatformService`
14
+
15
+ Create a new instance of PlatformService.
16
+
17
+ #### Parameters
18
+
19
+ ##### options?
20
+
21
+ [`IPlatformServiceConstructorOptions`](../interfaces/IPlatformServiceConstructorOptions.md)
22
+
23
+ The options for the connector.
24
+
25
+ #### Returns
26
+
27
+ `PlatformService`
28
+
29
+ ## Properties
30
+
31
+ ### CLASS\_NAME {#class_name}
32
+
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
+
35
+ Runtime name for the class.
36
+
37
+ ## Methods
38
+
39
+ ### className() {#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
+
51
+ #### Implementation of
52
+
53
+ `IPlatformComponent.className`
54
+
55
+ ***
56
+
57
+ ### isMultiTenant() {#ismultitenant}
58
+
59
+ > **isMultiTenant**(): `boolean`
60
+
61
+ Indicates whether the component is running in a multi-tenant environment.
62
+
63
+ #### Returns
64
+
65
+ `boolean`
66
+
67
+ True if the component is running in a multi-tenant environment, false otherwise.
68
+
69
+ #### Implementation of
70
+
71
+ `IPlatformComponent.isMultiTenant`
72
+
73
+ ***
74
+
75
+ ### execute() {#execute}
76
+
77
+ > **execute**(`method`): `Promise`\<`void`\>
78
+
79
+ Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.
80
+
81
+ #### Parameters
82
+
83
+ ##### method
84
+
85
+ () => `Promise`\<`void`\>
86
+
87
+ The method to run for each tenant.
88
+
89
+ #### Returns
90
+
91
+ `Promise`\<`void`\>
92
+
93
+ Nothing.
94
+
95
+ #### Implementation of
96
+
97
+ `IPlatformComponent.execute`
@@ -5,7 +5,7 @@
5
5
  - [HealthService](classes/HealthService.md)
6
6
  - [HostingService](classes/HostingService.md)
7
7
  - [InformationService](classes/InformationService.md)
8
- - [UrlTransformerService](classes/UrlTransformerService.md)
8
+ - [PlatformService](classes/PlatformService.md)
9
9
 
10
10
  ## Interfaces
11
11
 
@@ -15,8 +15,8 @@
15
15
  - [IHostingServiceConstructorOptions](interfaces/IHostingServiceConstructorOptions.md)
16
16
  - [IInformationServiceConfig](interfaces/IInformationServiceConfig.md)
17
17
  - [IInformationServiceConstructorOptions](interfaces/IInformationServiceConstructorOptions.md)
18
- - [IUrlTransformerServiceConfig](interfaces/IUrlTransformerServiceConfig.md)
19
- - [IUrlTransformerServiceConstructorOptions](interfaces/IUrlTransformerServiceConstructorOptions.md)
18
+ - [IPlatformServiceConfig](interfaces/IPlatformServiceConfig.md)
19
+ - [IPlatformServiceConstructorOptions](interfaces/IPlatformServiceConstructorOptions.md)
20
20
 
21
21
  ## Variables
22
22
 
@@ -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 CHANGED
@@ -1,11 +1,5 @@
1
1
  {
2
2
  "error": {
3
- "urlTransformerService": {
4
- "encryptionUnavailable": "Encryption is unavailable because no nodeId is configured",
5
- "decryptionUnavailable": "Decryption is unavailable because no nodeId is configured",
6
- "encryptionFailed": "An error occurred during encryption",
7
- "decryptionFailed": "An error occurred during decryption"
8
- },
9
3
  "healthService": {
10
4
  "componentHealthCheckFailed": "Health check failed for component \"{className}\""
11
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-service",
3
- "version": "0.0.3-next.42",
3
+ "version": "0.0.3-next.44",
4
4
  "description": "Information and hosting service implementations with generated REST route handlers.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,10 +14,11 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-models": "0.0.3-next.42",
17
+ "@twin.org/api-models": "0.0.3-next.44",
18
18
  "@twin.org/context": "next",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/engine-models": "next",
21
+ "@twin.org/entity-storage-models": "next",
21
22
  "@twin.org/logging-models": "next",
22
23
  "@twin.org/nameof": "next",
23
24
  "@twin.org/vault-models": "next",
@@ -1,4 +0,0 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
- export {};
4
- //# sourceMappingURL=IUrlTransformerServiceConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IUrlTransformerServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IUrlTransformerServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the URL transformer service.\n */\nexport interface IUrlTransformerServiceConfig {\n\t/**\n\t * The name of the key to retrieve from the vault for encryption/decryption of parameters.\n\t * @default param-encryption\n\t */\n\tparamEncryptionKeyName?: string;\n\n\t/**\n\t * A dictionary mapping logical token identifiers to their URL query parameter names.\n\t * For example: tenant => tenant-token maps the logical id \"tenant\" to the\n\t * query param \"tenant-token\". When an id is not present the id itself is used as\n\t * the param name.\n\t */\n\tqueryParamNames?: { [id: string]: string };\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=IUrlTransformerServiceConstructorOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IUrlTransformerServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IUrlTransformerServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IUrlTransformerServiceConfig } from \"./IUrlTransformerServiceConfig.js\";\n\n/**\n * Options for the UrlTransformerService constructor.\n */\nexport interface IUrlTransformerServiceConstructorOptions {\n\t/**\n\t * The vault connector type.\n\t * @default vault\n\t */\n\tvaultConnectorType?: string;\n\n\t/**\n\t * The configuration for the service.\n\t */\n\tconfig?: IUrlTransformerServiceConfig;\n}\n"]}