@twin.org/engine-types 0.0.3-next.30 → 0.0.3-next.31

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.
@@ -20,10 +20,13 @@ export function initialiseDataspaceControlPlaneComponent(engineCore, context, in
20
20
  if (instanceConfig.type === DataspaceControlPlaneComponentType.Service) {
21
21
  createComponent = (createConfig) => {
22
22
  initSchemaDataspaceControlPlane();
23
- // Initialize entity storage for TransferProcessEntity
24
- // This storage is shared with Data Plane service
25
- // Partition by Node only - transfers are cross-tenant operations
26
- const partitionContextIds = ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]);
23
+ // Initialize entity storage for TransferProcessEntity.
24
+ // This storage is shared with Data Plane service. Both planes must
25
+ // register the same connector name with the same partition keys,
26
+ // otherwise initialiseEntityStorageConnector silently drops the
27
+ // second registration and the two layers disagree on where records
28
+ // live.
29
+ const partitionContextIds = ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node, ContextIdKeys.Tenant]);
27
30
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.transferProcessEntityStorageType, "TransferProcess", partitionContextIds);
28
31
  return new DataspaceControlPlaneService(EngineTypeHelper.mergeConfig({
29
32
  loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
@@ -1 +1 @@
1
- {"version":3,"file":"dataspaceControlPlane.js","sourceRoot":"","sources":["../../../src/components/dataspaceControlPlane.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EACN,4BAA4B,EAC5B,UAAU,IAAI,+BAA+B,EAC7C,MAAM,2CAA2C,CAAC;A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AAU,CAAC,iCAAiC,CAAC,wBAAwB,CAAC;aACvE,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,oCAAgD,CAAC;IAClE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,kCAAkC,CAAC,UAAU,EAAE,CAAC;QAClF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,+BAA+B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC3D,gBAAgB,wCAAmD,CAAC;IACrE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport { DataspaceControlPlaneRestClient } from \"@twin.org/dataspace-control-plane-rest-client\";\nimport {\n\tDataspaceControlPlaneService,\n\tinitSchema as initSchemaDataspaceControlPlane\n} from \"@twin.org/dataspace-control-plane-service\";\nimport type { TransferProcess } from \"@twin.org/dataspace-models\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataspaceControlPlaneComponentConfig } from \"../models/config/dataspaceControlPlaneComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataspaceControlPlaneComponentType } from \"../models/types/dataspaceControlPlaneComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the dataspace control plane component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseDataspaceControlPlaneComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataspaceControlPlaneComponentConfig\n): EngineTypeInitialiserReturn<DataspaceControlPlaneComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === DataspaceControlPlaneComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaDataspaceControlPlane();\n\n\t\t\t// Initialize entity storage for TransferProcessEntity\n\t\t\t// This storage is shared with Data Plane service\n\t\t\t// Partition by Node only - transfers are cross-tenant operations\n\t\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\t\tengineCore.getContextIdKeys(),\n\t\t\t\t[ContextIdKeys.Node]\n\t\t\t);\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.transferProcessEntityStorageType,\n\t\t\t\tnameof<TransferProcess>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new DataspaceControlPlaneService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceTypeOptional(\"loggingComponent\"),\n\t\t\t\t\t\ttrustComponentType: engineCore.getRegisteredInstanceTypeOptional(\"trustComponent\"),\n\t\t\t\t\t\tpolicyAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPapComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpolicyNegotiationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPnpComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tfederatedCatalogueComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"federatedCatalogueComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidentityComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"identityComponent\"),\n\t\t\t\t\t\tidentityAuthenticationComponentType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"identityAuthenticationComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"taskSchedulerComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(DataspaceControlPlaneService);\n\t} else if (instanceConfig.type === DataspaceControlPlaneComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DataspaceControlPlaneRestClient(createConfig.options);\n\t\tinstanceTypeName = nameofKebabCase(DataspaceControlPlaneRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"dataspaceControlPlane.js","sourceRoot":"","sources":["../../../src/components/dataspaceControlPlane.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EACN,4BAA4B,EAC5B,UAAU,IAAI,+BAA+B,EAC7C,MAAM,2CAA2C,CAAC;AAQnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,E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,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,oCAAgD,CAAC;IAClE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,kCAAkC,CAAC,UAAU,EAAE,CAAC;QAClF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,+BAA+B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC3D,gBAAgB,wCAAmD,CAAC;IACrE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport { DataspaceControlPlaneRestClient } from \"@twin.org/dataspace-control-plane-rest-client\";\nimport {\n\tDataspaceControlPlaneService,\n\tinitSchema as initSchemaDataspaceControlPlane\n} from \"@twin.org/dataspace-control-plane-service\";\nimport type { TransferProcess } from \"@twin.org/dataspace-models\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataspaceControlPlaneComponentConfig } from \"../models/config/dataspaceControlPlaneComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataspaceControlPlaneComponentType } from \"../models/types/dataspaceControlPlaneComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the dataspace control plane component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseDataspaceControlPlaneComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataspaceControlPlaneComponentConfig\n): EngineTypeInitialiserReturn<DataspaceControlPlaneComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === DataspaceControlPlaneComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaDataspaceControlPlane();\n\n\t\t\t// Initialize entity storage for TransferProcessEntity.\n\t\t\t// This storage is shared with Data Plane service. Both planes must\n\t\t\t// register the same connector name with the same partition keys,\n\t\t\t// otherwise initialiseEntityStorageConnector silently drops the\n\t\t\t// second registration and the two layers disagree on where records\n\t\t\t// live.\n\t\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\t\tengineCore.getContextIdKeys(),\n\t\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t\t);\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.transferProcessEntityStorageType,\n\t\t\t\tnameof<TransferProcess>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new DataspaceControlPlaneService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceTypeOptional(\"loggingComponent\"),\n\t\t\t\t\t\ttrustComponentType: engineCore.getRegisteredInstanceTypeOptional(\"trustComponent\"),\n\t\t\t\t\t\tpolicyAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPapComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpolicyNegotiationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPnpComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tfederatedCatalogueComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"federatedCatalogueComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidentityComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"identityComponent\"),\n\t\t\t\t\t\tidentityAuthenticationComponentType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"identityAuthenticationComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"taskSchedulerComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(DataspaceControlPlaneService);\n\t} else if (instanceConfig.type === DataspaceControlPlaneComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DataspaceControlPlaneRestClient(createConfig.options);\n\t\tinstanceTypeName = nameofKebabCase(DataspaceControlPlaneRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
package/docs/changelog.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.31](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.30...engine-types-v0.0.3-next.31) (2026-04-22)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * align Control Plane TransferProcess partition with Data Plane ([#102](https://github.com/twinfoundation/engine/issues/102)) ([b651361](https://github.com/twinfoundation/engine/commit/b651361ffd648bdeea10a049414b878272c9ae4d))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/engine-core bumped from 0.0.3-next.30 to 0.0.3-next.31
16
+ * @twin.org/engine-models bumped from 0.0.3-next.30 to 0.0.3-next.31
17
+
3
18
  ## [0.0.3-next.30](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.29...engine-types-v0.0.3-next.30) (2026-04-16)
4
19
 
5
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-types",
3
- "version": "0.0.3-next.30",
3
+ "version": "0.0.3-next.31",
4
4
  "description": "Component and connector type definitions with configuration helpers for engine composition.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,8 +56,8 @@
56
56
  "@twin.org/document-management-models": "next",
57
57
  "@twin.org/document-management-rest-client": "next",
58
58
  "@twin.org/document-management-service": "next",
59
- "@twin.org/engine-core": "0.0.3-next.30",
60
- "@twin.org/engine-models": "0.0.3-next.30",
59
+ "@twin.org/engine-core": "0.0.3-next.31",
60
+ "@twin.org/engine-models": "0.0.3-next.31",
61
61
  "@twin.org/entity": "next",
62
62
  "@twin.org/entity-storage-connector-cosmosdb": "next",
63
63
  "@twin.org/entity-storage-connector-dynamodb": "next",