@twin.org/engine-types 0.0.3-next.26 → 0.0.3-next.28
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/README.md +1 -1
- package/dist/es/components/dataspaceDataPlane.js +1 -0
- package/dist/es/components/dataspaceDataPlane.js.map +1 -1
- package/dist/es/components/rightsManagementPnap.js +1 -0
- package/dist/es/components/rightsManagementPnap.js.map +1 -1
- package/docs/changelog.md +31 -1
- package/docs/examples.md +74 -1
- package/docs/reference/classes/EngineTypeHelper.md +3 -3
- package/docs/reference/functions/initialiseEntityStorageConnector.md +2 -2
- package/docs/reference/interfaces/IEngineConfig.md +70 -70
- package/docs/reference/type-aliases/AttestationConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +3 -3
- package/docs/reference/type-aliases/DataExtractorConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/DltConfig.md +4 -4
- package/docs/reference/type-aliases/EventBusConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +2 -2
- package/docs/reference/type-aliases/IdentityProfileConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/MessagingAdminComponentConfig.md +3 -3
- package/docs/reference/type-aliases/MessagingComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPmpComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +3 -3
- package/docs/reference/type-aliases/TaskSchedulerComponentConfig.md +3 -3
- package/docs/reference/type-aliases/TelemetryConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/TenantAdminComponentConfig.md +3 -3
- package/docs/reference/type-aliases/TrustComponentConfig.md +3 -3
- package/docs/reference/type-aliases/TrustGeneratorComponentConfig.md +2 -2
- package/docs/reference/type-aliases/TrustVerifierComponentConfig.md +3 -3
- package/docs/reference/variables/AttestationComponentType.md +2 -2
- package/docs/reference/variables/AttestationConnectorType.md +1 -1
- package/docs/reference/variables/AuditableItemGraphComponentType.md +2 -2
- package/docs/reference/variables/AuditableItemStreamComponentType.md +2 -2
- package/docs/reference/variables/BackgroundTaskComponentType.md +1 -1
- package/docs/reference/variables/BlobStorageComponentType.md +2 -2
- package/docs/reference/variables/BlobStorageConnectorType.md +6 -6
- package/docs/reference/variables/ContextIdHandlerComponentType.md +2 -2
- package/docs/reference/variables/DataConverterConnectorType.md +2 -2
- package/docs/reference/variables/DataExtractorConnectorType.md +1 -1
- package/docs/reference/variables/DataProcessingComponentType.md +2 -2
- package/docs/reference/variables/DataspaceControlPlaneComponentType.md +2 -2
- package/docs/reference/variables/DataspaceDataPlaneComponentType.md +3 -3
- package/docs/reference/variables/DltConfigType.md +1 -1
- package/docs/reference/variables/DocumentManagementComponentType.md +2 -2
- package/docs/reference/variables/EntityStorageComponentType.md +2 -2
- package/docs/reference/variables/EntityStorageConnectorType.md +10 -10
- package/docs/reference/variables/EventBusComponentType.md +2 -2
- package/docs/reference/variables/EventBusConnectorType.md +1 -1
- package/docs/reference/variables/FaucetConnectorType.md +2 -2
- package/docs/reference/variables/FederatedCatalogueComponentType.md +2 -2
- package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +1 -1
- package/docs/reference/variables/IdentityComponentType.md +2 -2
- package/docs/reference/variables/IdentityConnectorType.md +2 -2
- package/docs/reference/variables/IdentityProfileComponentType.md +2 -2
- package/docs/reference/variables/IdentityProfileConnectorType.md +1 -1
- package/docs/reference/variables/IdentityResolverComponentType.md +2 -2
- package/docs/reference/variables/IdentityResolverConnectorType.md +3 -3
- package/docs/reference/variables/ImmutableProofComponentType.md +2 -2
- package/docs/reference/variables/LoggingComponentType.md +2 -2
- package/docs/reference/variables/LoggingConnectorType.md +3 -3
- package/docs/reference/variables/MessagingAdminComponentType.md +1 -1
- package/docs/reference/variables/MessagingComponentType.md +1 -1
- package/docs/reference/variables/MessagingEmailConnectorType.md +2 -2
- package/docs/reference/variables/MessagingPushNotificationConnectorType.md +2 -2
- package/docs/reference/variables/MessagingSmsConnectorType.md +2 -2
- package/docs/reference/variables/NftComponentType.md +2 -2
- package/docs/reference/variables/NftConnectorType.md +2 -2
- package/docs/reference/variables/RightsManagementPapComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPdpComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPepComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPipComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPmpComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPnapComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPnpComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +2 -2
- package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPolicyObligationEnforcerComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
- package/docs/reference/variables/SynchronisedStorageComponentType.md +2 -2
- package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
- package/docs/reference/variables/TelemetryComponentType.md +2 -2
- package/docs/reference/variables/TelemetryConnectorType.md +1 -1
- package/docs/reference/variables/TenantAdminComponentType.md +1 -1
- package/docs/reference/variables/TrustComponentType.md +1 -1
- package/docs/reference/variables/TrustGeneratorComponentType.md +1 -1
- package/docs/reference/variables/TrustVerifierComponentType.md +1 -1
- package/docs/reference/variables/VaultConnectorType.md +2 -2
- package/docs/reference/variables/VerifiableStorageComponentType.md +2 -2
- package/docs/reference/variables/VerifiableStorageConnectorType.md +2 -2
- package/docs/reference/variables/WalletConnectorType.md +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN Engine Types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Engine Types contains component and connector type definitions used to compose runtime capabilities. It also includes helpers for retrieving and merging configuration so engine setup remains consistent as integrations grow.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -33,6 +33,7 @@ export function initialiseDataspaceDataPlaneComponent(engineCore, context, insta
|
|
|
33
33
|
taskSchedulerComponentType: engineCore.getRegisteredInstanceTypeOptional("taskSchedulerComponent"),
|
|
34
34
|
trustComponentType: engineCore.getRegisteredInstanceTypeOptional("trustComponent"),
|
|
35
35
|
pepComponentType: engineCore.getRegisteredInstanceTypeOptional("rightsManagementPepComponent"),
|
|
36
|
+
tenantAdminType: engineCore.getRegisteredInstanceTypeOptional("tenantAdminComponent"),
|
|
36
37
|
partitionContextIds
|
|
37
38
|
}, createConfig.options));
|
|
38
39
|
};
|
|
@@ -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,OAA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AyB,CAAC;gBACxE,0BAA0B,EACzB,UAAU,CAAC,iCAAiC,CAAC,wBAAwB,CAAC;gBACvE,kBAAkB,EAAE,UAAU,CAAC,iCAAiC,CAAC,gBAAgB,CAAC;gBAClF,gBAAgB,EAAE,UAAU,CAAC,iCAAiC,CAC7D,8BAA8B,CAC9B;gBACD,mBAAmB;aACnB,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,iCAA6C,CAAC;IAC/D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,4BAA4B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACxD,gBAAgB,qCAAgD,CAAC;IAClE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,8BAA8B,CACjC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,iCAAiC,CAAC,kBAAkB,CAAC;SACtF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,uCAAkD,CAAC;IACpE,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 { DataspaceDataPlaneRestClient } from \"@twin.org/dataspace-data-plane-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataspaceDataPlaneService,\n\tinitSchema as initSchemaDataspaceDataPlane\n} from \"@twin.org/dataspace-data-plane-service\";\nimport { DataspaceDataPlaneSocketClient } from \"@twin.org/dataspace-data-plane-socket-client\";\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 { 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\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\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"]}
|
|
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,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAQ9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,qCAAqC,CACpD,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAEjD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc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,CAAC;QAC/E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,4BAA4B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACxD,gBAAgB,qCAAgD,CAAC;IAClE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,8BAA8B,CACjC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,iCAAiC,CAAC,kBAAkB,CAAC;SACtF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,uCAAkD,CAAC;IACpE,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 { DataspaceDataPlaneRestClient } from \"@twin.org/dataspace-data-plane-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataspaceDataPlaneService,\n\tinitSchema as initSchemaDataspaceDataPlane\n} from \"@twin.org/dataspace-data-plane-service\";\nimport { DataspaceDataPlaneSocketClient } from \"@twin.org/dataspace-data-plane-socket-client\";\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 { 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\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"]}
|
|
@@ -26,6 +26,7 @@ export function initialiseRightsManagementPnapComponent(engineCore, context, ins
|
|
|
26
26
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
27
27
|
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
28
28
|
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
29
|
+
tenantAdminType: engineCore.getRegisteredInstanceTypeOptional("tenantAdminComponent"),
|
|
29
30
|
partitionContextIds
|
|
30
31
|
}, createConfig.options));
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPnap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,EAEN,kCAAkC,EAClC,UAAU,IAAI,8BAA8B,EAC5C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,uCAAuC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAAmD;IAEnD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,OAAO,EAAE,CAAC;QACvE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,8BAA8B,EAAE,CAAC;YAEjC,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;YAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,kCAAkC,uBAExD,mBAAmB,CACnB,CAAC;YAEF,OAAO,IAAI,kCAAkC,CAC5C,gBAAgB,CAAC,WAAW,CAC3B;gBACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;gBAC9E,0BAA0B,EACzB,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;gBAC/D,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;gBACD,mBAAmB;aACnB,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,2CAAsD,CAAC;IACxE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,UAAU,EAAE,CAAC;QACjF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qCAAqC,CACxC,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,+CAAyD,CAAC;IAC3E,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\ttype PolicyNegotiation,\n\tPolicyNegotiationAdminPointService,\n\tinitSchema as initSchemaRightsManagementPnap\n} from \"@twin.org/rights-management-pnp-service\";\nimport { PolicyNegotiationAdminPointRestClient } from \"@twin.org/rights-management-rest-client\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { RightsManagementPnapComponentConfig } from \"../models/config/rightsManagementPnapComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPnapComponentType } from \"../models/types/rightsManagementPnapComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management PNAP 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 initialiseRightsManagementPnapComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPnapComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPnapComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaRightsManagementPnap();\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\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.policyNegotiationEntityStorageType,\n\t\t\t\tnameof<PolicyNegotiation>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new PolicyNegotiationAdminPointService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\t\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPipComponent\"\n\t\t\t\t\t\t),\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(PolicyNegotiationAdminPointService);\n\t} else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyNegotiationAdminPointRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationAdminPointRestClient);\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":"rightsManagementPnap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,EAEN,kCAAkC,EAClC,UAAU,IAAI,8BAA8B,EAC5C,MAAM,yCAAyC,CAAC;AACjD,OA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AC;QACjF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qCAAqC,CACxC,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,+CAAyD,CAAC;IAC3E,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\ttype PolicyNegotiation,\n\tPolicyNegotiationAdminPointService,\n\tinitSchema as initSchemaRightsManagementPnap\n} from \"@twin.org/rights-management-pnp-service\";\nimport { PolicyNegotiationAdminPointRestClient } from \"@twin.org/rights-management-rest-client\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { RightsManagementPnapComponentConfig } from \"../models/config/rightsManagementPnapComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPnapComponentType } from \"../models/types/rightsManagementPnapComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management PNAP 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 initialiseRightsManagementPnapComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPnapComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPnapComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaRightsManagementPnap();\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\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.policyNegotiationEntityStorageType,\n\t\t\t\tnameof<PolicyNegotiation>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new PolicyNegotiationAdminPointService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\t\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPipComponent\"\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(PolicyNegotiationAdminPointService);\n\t} else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyNegotiationAdminPointRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationAdminPointRestClient);\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,4 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.28](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.27...engine-types-v0.0.3-next.28) (2026-04-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use tenant admin service instead of custom tenant tracking ([72553d2](https://github.com/twinfoundation/engine/commit/72553d2c3e3b46fec77d3049bd0271bfec69ffc6))
|
|
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.27 to 0.0.3-next.28
|
|
16
|
+
* @twin.org/engine-models bumped from 0.0.3-next.27 to 0.0.3-next.28
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.27](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.26...engine-types-v0.0.3-next.27) (2026-03-20)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* update dependencies ([e6ebe42](https://github.com/twinfoundation/engine/commit/e6ebe42b9d61066227ad8b45dae14c8f8615b760))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/engine-core bumped from 0.0.3-next.26 to 0.0.3-next.27
|
|
31
|
+
* @twin.org/engine-models bumped from 0.0.3-next.26 to 0.0.3-next.27
|
|
2
32
|
|
|
3
33
|
## [0.0.3-next.26](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.25...engine-types-v0.0.3-next.26) (2026-03-05)
|
|
4
34
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Engine Types Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to compose type-safe engine configuration and retrieve merged options for specific component instances.
|
|
4
|
+
|
|
5
|
+
## EngineTypeHelper
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import {
|
|
9
|
+
EngineTypeHelper,
|
|
10
|
+
EntityStorageComponentType,
|
|
11
|
+
LoggingConnectorType,
|
|
12
|
+
type IEngineConfig
|
|
13
|
+
} from '@twin.org/engine-types';
|
|
14
|
+
|
|
15
|
+
const engineConfig: IEngineConfig = {
|
|
16
|
+
debug: false,
|
|
17
|
+
silent: true,
|
|
18
|
+
types: {
|
|
19
|
+
loggingConnector: [{ type: LoggingConnectorType.Console, isDefault: true }],
|
|
20
|
+
entityStorageComponent: [
|
|
21
|
+
{
|
|
22
|
+
type: EntityStorageComponentType.Service,
|
|
23
|
+
options: {
|
|
24
|
+
entityStorageType: 'product'
|
|
25
|
+
},
|
|
26
|
+
isDefault: true
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const loggingConfig = EngineTypeHelper.getConfigOfType(
|
|
33
|
+
engineConfig,
|
|
34
|
+
'loggingConnector',
|
|
35
|
+
LoggingConnectorType.Console
|
|
36
|
+
);
|
|
37
|
+
const mergedEntityOptions = EngineTypeHelper.mergeConfig(
|
|
38
|
+
{ entityStorageType: 'product', partitionContextIds: ['node'] },
|
|
39
|
+
{ partitionContextIds: ['node', 'tenant'] }
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
console.log(loggingConfig?.type); // "console"
|
|
43
|
+
console.log(mergedEntityOptions.partitionContextIds); // ["node", "tenant"]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Building Config with Shared Type Constants
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import {
|
|
50
|
+
EntityStorageComponentType,
|
|
51
|
+
EntityStorageConnectorType,
|
|
52
|
+
LoggingComponentType,
|
|
53
|
+
LoggingConnectorType,
|
|
54
|
+
TelemetryComponentType,
|
|
55
|
+
TelemetryConnectorType,
|
|
56
|
+
type IEngineConfig
|
|
57
|
+
} from '@twin.org/engine-types';
|
|
58
|
+
|
|
59
|
+
const config: IEngineConfig = {
|
|
60
|
+
debug: true,
|
|
61
|
+
silent: false,
|
|
62
|
+
types: {
|
|
63
|
+
loggingConnector: [{ type: LoggingConnectorType.Console }],
|
|
64
|
+
loggingComponent: [{ type: LoggingComponentType.Service }],
|
|
65
|
+
entityStorageConnector: [{ type: EntityStorageConnectorType.Memory }],
|
|
66
|
+
entityStorageComponent: [{ type: EntityStorageComponentType.Service }],
|
|
67
|
+
telemetryConnector: [{ type: TelemetryConnectorType.EntityStorage }],
|
|
68
|
+
telemetryComponent: [{ type: TelemetryComponentType.Service }]
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
console.log(config.types.entityStorageConnector?.[0].type); // "memory"
|
|
73
|
+
console.log(config.types.telemetryComponent?.[0].type); // "service"
|
|
74
|
+
```
|
|
@@ -14,7 +14,7 @@ Helper methods for engine config types.
|
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
17
|
-
### CLASS\_NAME
|
|
17
|
+
### CLASS\_NAME {#class_name}
|
|
18
18
|
|
|
19
19
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Runtime name for the class.
|
|
|
22
22
|
|
|
23
23
|
## Methods
|
|
24
24
|
|
|
25
|
-
### getConfigOfType()
|
|
25
|
+
### getConfigOfType() {#getconfigoftype}
|
|
26
26
|
|
|
27
27
|
> `static` **getConfigOfType**\<`T`\>(`engineConfig`, `component`, `type`): `IEngineCoreTypeConfig`\<`T`\> \| `undefined`
|
|
28
28
|
|
|
@@ -62,7 +62,7 @@ The config for the specified component and type or undefined if it does not exis
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### mergeConfig()
|
|
65
|
+
### mergeConfig() {#mergeconfig}
|
|
66
66
|
|
|
67
67
|
> `static` **mergeConfig**\<`T`\>(`config1?`, `config2?`, `config3?`, `config4?`, `config5?`): `T`
|
|
68
68
|
|
|
@@ -20,9 +20,9 @@ The context for the engine.
|
|
|
20
20
|
|
|
21
21
|
### typeCustom
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`string` \| `undefined`
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Override the type of connector to use instead of default configuration.
|
|
26
26
|
|
|
27
27
|
### schema
|
|
28
28
|
|