@twin.org/engine-types 0.0.3-next.40 → 0.0.3-next.41
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.
|
@@ -39,7 +39,8 @@ export function initialiseDataspaceControlPlaneComponent(engineCore, context, in
|
|
|
39
39
|
identityComponentType: engineCore.getRegisteredInstanceTypeOptional("identityComponent"),
|
|
40
40
|
identityAuthenticationComponentType: engineCore.getRegisteredInstanceTypeOptional("identityAuthenticationComponent"),
|
|
41
41
|
taskSchedulerComponentType: engineCore.getRegisteredInstanceTypeOptional("taskSchedulerComponent"),
|
|
42
|
-
urlTransformerComponentType: engineCore.getRegisteredInstanceType("urlTransformerComponent")
|
|
42
|
+
urlTransformerComponentType: engineCore.getRegisteredInstanceType("urlTransformerComponent"),
|
|
43
|
+
dataPlaneComponentType: engineCore.getRegisteredInstanceTypeOptional("dataspaceDataPlaneComponent")
|
|
43
44
|
}, createConfig.options));
|
|
44
45
|
};
|
|
45
46
|
instanceTypeName = "dataspace-control-plane-service";
|
|
@@ -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;AAQnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAA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;gBAClE,mCAAmC,EAAE,UAAU,CAAC,iCAAiC,CAChF,iCAAiC,CACjC;gBACD,0BAA0B,EACzB,UAAU,CAAC,iCAAiC,CAAC,wBAAwB,CAAC;gBACvE,2BAA2B,EAC1B,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;
|
|
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,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,wCAAwC,CACvD,UAAsC,EACtC,OAA0C,EAC1C,cAAoD;IAEpD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,kCAAkC,CAAC,OAAO,EAAE,CAAC;QACxE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,+BAA+B,EAAE,CAAC;YAElC,uDAAuD;YACvD,mEAAmE;YACnE,iEAAiE;YACjE,gEAAgE;YAChE,mEAAmE;YACnE,QAAQ;YACR,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1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+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 { DataspaceAppDataset, 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\t// Tenant-supplied partial datasets are stored [Node]-only\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.dataspaceAppDatasetEntityStorageType,\n\t\t\t\tnameof<DataspaceAppDataset>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\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\turlTransformerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"urlTransformerComponent\"),\n\t\t\t\t\t\tdataPlaneComponentType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"dataspaceDataPlaneComponent\"\n\t\t\t\t\t\t)\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"]}
|
|
@@ -31,6 +31,10 @@ export function initialiseDataspaceDataPlaneComponent(engineCore, context, insta
|
|
|
31
31
|
// register here too in case the DP component initialises before
|
|
32
32
|
// the CP one in the engine startup order. Read-only on this side.
|
|
33
33
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataspaceAppDatasetEntityStorageType, "DataspaceAppDataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
34
|
+
// PushSubscription storage backs the push-mode transfer lifecycle on the data plane.
|
|
35
|
+
// Pull-only deployments still register the storage so the optional push path is usable
|
|
36
|
+
// without engine-config changes if/when a consumer requests it.
|
|
37
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.pushSubscriptionEntityStorageType, "PushSubscription", partitionContextIds);
|
|
34
38
|
return new DataspaceDataPlaneService(EngineTypeHelper.mergeConfig({
|
|
35
39
|
loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
|
|
36
40
|
backgroundTaskComponentType: engineCore.getRegisteredInstanceTypeOptional("backgroundTaskComponent"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataspaceDataPlane.js","sourceRoot":"","sources":["../../../src/components/dataspaceDataPlane.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,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,
|
|
1
|
+
{"version":3,"file":"dataspaceDataPlane.js","sourceRoot":"","sources":["../../../src/components/dataspaceDataPlane.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,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,EAEzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE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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 { DataspaceDataPlaneRestClient } from \"@twin.org/dataspace-data-plane-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataspaceDataPlaneService,\n\ttype PushSubscription,\n\tinitSchema as initSchemaDataspaceDataPlane\n} from \"@twin.org/dataspace-data-plane-service\";\nimport { DataspaceDataPlaneSocketClient } from \"@twin.org/dataspace-data-plane-socket-client\";\nimport type { DataspaceAppDataset, 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 { DataspaceDataPlaneComponentConfig } from \"../models/config/dataspaceDataPlaneComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataspaceDataPlaneComponentType } from \"../models/types/dataspaceDataPlaneComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the dataspace data 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 initialiseDataspaceDataPlaneComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataspaceDataPlaneComponentConfig\n): EngineTypeInitialiserReturn<DataspaceDataPlaneComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === DataspaceDataPlaneComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaDataspaceDataPlane();\n\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\t// Initialize entity storage for ActivityLogDetails and ActivityTask\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.activityLogEntityStorageType,\n\t\t\t\tnameof<ActivityLogDetails>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.activityTaskEntityStorageType,\n\t\t\t\tnameof<ActivityTask>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\t// TransferProcessEntity storage is shared with Control Plane.\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\t// DataspaceAppDataset storage is also shared with the Control Plane —\n\t\t\t// register here too in case the DP component initialises before\n\t\t\t// the CP one in the engine startup order. Read-only on this side.\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.dataspaceAppDatasetEntityStorageType,\n\t\t\t\tnameof<DataspaceAppDataset>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t\t);\n\n\t\t\t// PushSubscription storage backs the push-mode transfer lifecycle on the data plane.\n\t\t\t// Pull-only deployments still register the storage so the optional push path is usable\n\t\t\t// without engine-config changes if/when a consumer requests it.\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tinstanceConfig.options?.pushSubscriptionEntityStorageType,\n\t\t\t\tnameof<PushSubscription>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new DataspaceDataPlaneService(\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\tbackgroundTaskComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"backgroundTaskComponent\"),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"taskSchedulerComponent\"),\n\t\t\t\t\t\ttrustComponentType: engineCore.getRegisteredInstanceTypeOptional(\"trustComponent\"),\n\t\t\t\t\t\tpepComponentType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"rightsManagementPepComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttenantAdminType: engineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\"),\n\t\t\t\t\t\tpartitionContextIds\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(DataspaceDataPlaneService);\n\t} else if (instanceConfig.type === DataspaceDataPlaneComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DataspaceDataPlaneRestClient(createConfig.options);\n\t\tinstanceTypeName = nameofKebabCase(DataspaceDataPlaneRestClient);\n\t} else if (instanceConfig.type === DataspaceDataPlaneComponentType.SocketClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DataspaceDataPlaneSocketClient(\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},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(DataspaceDataPlaneSocketClient);\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.41](https://github.com/iotaledger/twin-engine/compare/engine-types-v0.0.3-next.40...engine-types-v0.0.3-next.41) (2026-05-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* wire DSP push-transfer mode in engine ([#121](https://github.com/iotaledger/twin-engine/issues/121)) ([3456cdb](https://github.com/iotaledger/twin-engine/commit/3456cdb34c3b721b6aba1fb49133a2d8048958aa))
|
|
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.40 to 0.0.3-next.41
|
|
16
|
+
* @twin.org/engine-models bumped from 0.0.3-next.40 to 0.0.3-next.41
|
|
17
|
+
|
|
3
18
|
## [0.0.3-next.40](https://github.com/iotaledger/twin-engine/compare/engine-types-v0.0.3-next.39...engine-types-v0.0.3-next.40) (2026-05-22)
|
|
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.
|
|
3
|
+
"version": "0.0.3-next.41",
|
|
4
4
|
"description": "Component and connector type definitions with configuration helpers for engine composition.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@twin.org/document-management-models": "next",
|
|
63
63
|
"@twin.org/document-management-rest-client": "next",
|
|
64
64
|
"@twin.org/document-management-service": "next",
|
|
65
|
-
"@twin.org/engine-core": "0.0.3-next.
|
|
66
|
-
"@twin.org/engine-models": "0.0.3-next.
|
|
65
|
+
"@twin.org/engine-core": "0.0.3-next.41",
|
|
66
|
+
"@twin.org/engine-models": "0.0.3-next.41",
|
|
67
67
|
"@twin.org/entity": "next",
|
|
68
68
|
"@twin.org/entity-storage-connector-cosmosdb": "next",
|
|
69
69
|
"@twin.org/entity-storage-connector-dynamodb": "next",
|