@twin.org/engine-types 0.0.3-next.8 → 0.9.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/es/components/attestation.js +20 -24
- package/dist/es/components/attestation.js.map +1 -1
- package/dist/es/components/auditableItemGraph.js +27 -22
- package/dist/es/components/auditableItemGraph.js.map +1 -1
- package/dist/es/components/auditableItemStream.js +27 -22
- package/dist/es/components/auditableItemStream.js.map +1 -1
- package/dist/es/components/automation.js +43 -0
- package/dist/es/components/automation.js.map +1 -0
- package/dist/es/components/automationAction.js +27 -0
- package/dist/es/components/automationAction.js.map +1 -0
- package/dist/es/components/backgroundTask.js +16 -12
- package/dist/es/components/backgroundTask.js.map +1 -1
- package/dist/es/components/blobStorage.js +69 -80
- package/dist/es/components/blobStorage.js.map +1 -1
- package/dist/es/components/contextIdHandler.js +9 -9
- package/dist/es/components/contextIdHandler.js.map +1 -1
- package/dist/es/components/dataProcessing.js +33 -32
- package/dist/es/components/dataProcessing.js.map +1 -1
- package/dist/es/components/dataspaceControlPlane.js +60 -0
- package/dist/es/components/dataspaceControlPlane.js.map +1 -0
- package/dist/es/components/dataspaceDataPlane.js +66 -0
- package/dist/es/components/dataspaceDataPlane.js.map +1 -0
- package/dist/es/components/documentManagement.js +12 -11
- package/dist/es/components/documentManagement.js.map +1 -1
- package/dist/es/components/entityStorage.js +53 -65
- package/dist/es/components/entityStorage.js.map +1 -1
- package/dist/es/components/eventBus.js +23 -27
- package/dist/es/components/eventBus.js.map +1 -1
- package/dist/es/components/faucet.js +18 -18
- package/dist/es/components/faucet.js.map +1 -1
- package/dist/es/components/federatedCatalogue.js +18 -14
- package/dist/es/components/federatedCatalogue.js.map +1 -1
- package/dist/es/components/federatedCatalogueFilter.js +14 -11
- package/dist/es/components/federatedCatalogueFilter.js.map +1 -1
- package/dist/es/components/health.js +32 -0
- package/dist/es/components/health.js.map +1 -0
- package/dist/es/components/identity.js +30 -31
- package/dist/es/components/identity.js.map +1 -1
- package/dist/es/components/identityProfile.js +26 -24
- package/dist/es/components/identityProfile.js.map +1 -1
- package/dist/es/components/identityResolver.js +36 -40
- package/dist/es/components/identityResolver.js.map +1 -1
- package/dist/es/components/immutableProof.js +23 -20
- package/dist/es/components/immutableProof.js.map +1 -1
- package/dist/es/components/logging.js +32 -28
- package/dist/es/components/logging.js.map +1 -1
- package/dist/es/components/messaging.js +89 -89
- package/dist/es/components/messaging.js.map +1 -1
- package/dist/es/components/metricsCollector.js +29 -0
- package/dist/es/components/metricsCollector.js.map +1 -0
- package/dist/es/components/metricsProducer.js +33 -0
- package/dist/es/components/metricsProducer.js.map +1 -0
- package/dist/es/components/nft.js +32 -33
- package/dist/es/components/nft.js.map +1 -1
- package/dist/es/components/notarization.js +77 -0
- package/dist/es/components/notarization.js.map +1 -0
- package/dist/es/components/platform.js +34 -0
- package/dist/es/components/platform.js.map +1 -0
- package/dist/es/components/rightsManagementPap.js +19 -17
- package/dist/es/components/rightsManagementPap.js.map +1 -1
- package/dist/es/components/rightsManagementPdp.js +11 -12
- package/dist/es/components/rightsManagementPdp.js.map +1 -1
- package/dist/es/components/rightsManagementPep.js +12 -10
- package/dist/es/components/rightsManagementPep.js.map +1 -1
- package/dist/es/components/rightsManagementPip.js +10 -10
- package/dist/es/components/rightsManagementPip.js.map +1 -1
- package/dist/es/components/rightsManagementPmp.js +11 -11
- package/dist/es/components/rightsManagementPmp.js.map +1 -1
- package/dist/es/components/rightsManagementPnap.js +20 -18
- package/dist/es/components/rightsManagementPnap.js.map +1 -1
- package/dist/es/components/rightsManagementPnp.js +14 -15
- package/dist/es/components/rightsManagementPnp.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyArbiter.js +19 -12
- package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +18 -12
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyExecutionAction.js +10 -10
- package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyInformationSource.js +23 -17
- package/dist/es/components/rightsManagementPolicyInformationSource.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyNegotiator.js +12 -12
- package/dist/es/components/rightsManagementPolicyNegotiator.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyObligationEnforcer.js +27 -0
- package/dist/es/components/rightsManagementPolicyObligationEnforcer.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyRequester.js +12 -12
- package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -1
- package/dist/es/components/rightsManagementPxp.js +10 -10
- package/dist/es/components/rightsManagementPxp.js.map +1 -1
- package/dist/es/components/schemaVersionMigration.js +35 -0
- package/dist/es/components/schemaVersionMigration.js.map +1 -0
- package/dist/es/components/taskScheduler.js +19 -11
- package/dist/es/components/taskScheduler.js.map +1 -1
- package/dist/es/components/telemetry.js +52 -31
- package/dist/es/components/telemetry.js.map +1 -1
- package/dist/es/components/tenant.js +12 -11
- package/dist/es/components/tenant.js.map +1 -1
- package/dist/es/components/trust.js +10 -10
- package/dist/es/components/trust.js.map +1 -1
- package/dist/es/components/trustGenerator.js +11 -11
- package/dist/es/components/trustGenerator.js.map +1 -1
- package/dist/es/components/trustVerifier.js +15 -12
- package/dist/es/components/trustVerifier.js.map +1 -1
- package/dist/es/components/vault.js +15 -12
- package/dist/es/components/vault.js.map +1 -1
- package/dist/es/components/wallet.js +24 -25
- package/dist/es/components/wallet.js.map +1 -1
- package/dist/es/index.js +35 -23
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineConfig.js.map +1 -1
- package/dist/es/models/config/automationActionConfig.js +2 -0
- package/dist/es/models/config/automationActionConfig.js.map +1 -0
- package/dist/es/models/config/automationComponentConfig.js +2 -0
- package/dist/es/models/config/automationComponentConfig.js.map +1 -0
- package/dist/es/models/config/blobStorageConnectorConfig.js.map +1 -1
- package/dist/es/models/config/dataspaceControlPlaneComponentConfig.js +2 -0
- package/dist/es/models/config/dataspaceControlPlaneComponentConfig.js.map +1 -0
- package/dist/es/models/config/dataspaceDataPlaneComponentConfig.js +2 -0
- package/dist/es/models/config/dataspaceDataPlaneComponentConfig.js.map +1 -0
- package/dist/es/models/config/entityStorageConnectorConfig.js.map +1 -1
- package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js.map +1 -1
- package/dist/es/models/config/healthComponentConfig.js +2 -0
- package/dist/es/models/config/healthComponentConfig.js.map +1 -0
- package/dist/es/models/config/metricsCollectorComponentConfig.js +2 -0
- package/dist/es/models/config/metricsCollectorComponentConfig.js.map +1 -0
- package/dist/es/models/config/metricsProducerComponentConfig.js +2 -0
- package/dist/es/models/config/metricsProducerComponentConfig.js.map +1 -0
- package/dist/es/models/config/notarizationComponentConfig.js +2 -0
- package/dist/es/models/config/notarizationComponentConfig.js.map +1 -0
- package/dist/es/models/config/notarizationConnectorConfig.js +2 -0
- package/dist/es/models/config/notarizationConnectorConfig.js.map +1 -0
- package/dist/es/models/config/platformComponentConfig.js +2 -0
- package/dist/es/models/config/platformComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -1
- package/dist/es/models/config/schemaVersionMigrationComponentConfig.js +2 -0
- package/dist/es/models/config/schemaVersionMigrationComponentConfig.js.map +1 -0
- package/dist/es/models/config/telemetryConnectorConfig.js.map +1 -1
- package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -1
- package/dist/es/models/types/automationActionType.js +13 -0
- package/dist/es/models/types/automationActionType.js.map +1 -0
- package/dist/es/models/types/{verifiableStorageComponentType.js → automationComponentType.js} +4 -4
- package/dist/es/models/types/automationComponentType.js.map +1 -0
- package/dist/es/models/types/dataspaceControlPlaneComponentType.js +17 -0
- package/dist/es/models/types/dataspaceControlPlaneComponentType.js.map +1 -0
- package/dist/es/models/types/{dataSpaceConnectorComponentType.js → dataspaceDataPlaneComponentType.js} +4 -4
- package/dist/es/models/types/dataspaceDataPlaneComponentType.js.map +1 -0
- package/dist/es/models/types/entityStorageConnectorType.js +2 -6
- package/dist/es/models/types/entityStorageConnectorType.js.map +1 -1
- package/dist/es/models/types/federatedCatalogueFilterComponentType.js +2 -2
- package/dist/es/models/types/federatedCatalogueFilterComponentType.js.map +1 -1
- package/dist/es/models/types/{synchronisedStorageComponentType.js → healthComponentType.js} +4 -4
- package/dist/es/models/types/healthComponentType.js.map +1 -0
- package/dist/es/models/types/metricsCollectorComponentType.js +13 -0
- package/dist/es/models/types/metricsCollectorComponentType.js.map +1 -0
- package/dist/es/models/types/metricsProducerComponentType.js +17 -0
- package/dist/es/models/types/metricsProducerComponentType.js.map +1 -0
- package/dist/es/models/types/{rightsManagementDapComponentType.js → notarizationComponentType.js} +4 -4
- package/dist/es/models/types/notarizationComponentType.js.map +1 -0
- package/dist/es/models/types/{verifiableStorageConnectorType.js → notarizationConnectorType.js} +4 -4
- package/dist/es/models/types/notarizationConnectorType.js.map +1 -0
- package/dist/es/models/types/platformComponentType.js +13 -0
- package/dist/es/models/types/platformComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +6 -2
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -1
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +6 -2
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js.map +1 -1
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js +4 -0
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js.map +1 -1
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js +2 -2
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js.map +1 -1
- package/dist/es/models/types/rightsManagementPolicyObligationEnforcerComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyObligationEnforcerComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js +2 -2
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js.map +1 -1
- package/dist/es/models/types/schemaVersionMigrationComponentType.js +13 -0
- package/dist/es/models/types/schemaVersionMigrationComponentType.js.map +1 -0
- package/dist/es/models/types/telemetryConnectorType.js +5 -1
- package/dist/es/models/types/telemetryConnectorType.js.map +1 -1
- package/dist/es/models/types/trustVerifierComponentType.js +5 -1
- package/dist/es/models/types/trustVerifierComponentType.js.map +1 -1
- package/dist/es/utils/engineTypeHelper.js +19 -1
- package/dist/es/utils/engineTypeHelper.js.map +1 -1
- package/dist/types/components/attestation.d.ts +5 -13
- package/dist/types/components/auditableItemGraph.d.ts +3 -7
- package/dist/types/components/auditableItemStream.d.ts +3 -7
- package/dist/types/components/automation.d.ts +12 -0
- package/dist/types/components/automationAction.d.ts +12 -0
- package/dist/types/components/backgroundTask.d.ts +3 -7
- package/dist/types/components/blobStorage.d.ts +4 -12
- package/dist/types/components/contextIdHandler.d.ts +3 -7
- package/dist/types/components/dataProcessing.d.ts +5 -17
- package/dist/types/components/dataspaceControlPlane.d.ts +12 -0
- package/dist/types/components/dataspaceDataPlane.d.ts +12 -0
- package/dist/types/components/documentManagement.d.ts +3 -7
- package/dist/types/components/entityStorage.d.ts +5 -10
- package/dist/types/components/eventBus.d.ts +4 -12
- package/dist/types/components/faucet.d.ts +2 -7
- package/dist/types/components/federatedCatalogue.d.ts +3 -7
- package/dist/types/components/federatedCatalogueFilter.d.ts +2 -7
- package/dist/types/components/health.d.ts +12 -0
- package/dist/types/components/identity.d.ts +4 -12
- package/dist/types/components/identityProfile.d.ts +4 -12
- package/dist/types/components/identityResolver.d.ts +4 -12
- package/dist/types/components/immutableProof.d.ts +3 -7
- package/dist/types/components/logging.d.ts +4 -12
- package/dist/types/components/messaging.d.ts +7 -27
- package/dist/types/components/metricsCollector.d.ts +12 -0
- package/dist/types/components/metricsProducer.d.ts +12 -0
- package/dist/types/components/nft.d.ts +4 -12
- package/dist/types/components/notarization.d.ts +22 -0
- package/dist/types/components/platform.d.ts +12 -0
- package/dist/types/components/rightsManagementPap.d.ts +3 -7
- package/dist/types/components/rightsManagementPdp.d.ts +3 -7
- package/dist/types/components/rightsManagementPep.d.ts +3 -7
- package/dist/types/components/rightsManagementPip.d.ts +3 -7
- package/dist/types/components/rightsManagementPmp.d.ts +3 -7
- package/dist/types/components/rightsManagementPnap.d.ts +3 -7
- package/dist/types/components/rightsManagementPnp.d.ts +3 -7
- package/dist/types/components/rightsManagementPolicyArbiter.d.ts +2 -7
- package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +2 -7
- package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +2 -7
- package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +2 -7
- package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +2 -7
- package/dist/types/components/rightsManagementPolicyObligationEnforcer.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyRequester.d.ts +2 -7
- package/dist/types/components/rightsManagementPxp.d.ts +3 -7
- package/dist/types/components/schemaVersionMigration.d.ts +12 -0
- package/dist/types/components/taskScheduler.d.ts +3 -7
- package/dist/types/components/telemetry.d.ts +4 -12
- package/dist/types/components/tenant.d.ts +3 -7
- package/dist/types/components/trust.d.ts +3 -7
- package/dist/types/components/trustGenerator.d.ts +2 -7
- package/dist/types/components/trustVerifier.d.ts +2 -7
- package/dist/types/components/vault.d.ts +2 -7
- package/dist/types/components/wallet.d.ts +3 -8
- package/dist/types/index.d.ts +35 -23
- package/dist/types/models/IEngineConfig.d.ts +59 -39
- package/dist/types/models/config/automationActionConfig.d.ts +9 -0
- package/dist/types/models/config/automationComponentConfig.d.ts +13 -0
- package/dist/types/models/config/blobStorageConnectorConfig.d.ts +4 -1
- package/dist/types/models/config/dataspaceControlPlaneComponentConfig.d.ts +13 -0
- package/dist/types/models/config/dataspaceDataPlaneComponentConfig.d.ts +17 -0
- package/dist/types/models/config/entityStorageConnectorConfig.d.ts +5 -5
- package/dist/types/models/config/federatedCatalogueFilterComponentConfig.d.ts +3 -3
- package/dist/types/models/config/healthComponentConfig.d.ts +13 -0
- package/dist/types/models/config/metricsCollectorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/metricsProducerComponentConfig.d.ts +12 -0
- package/dist/types/models/config/notarizationComponentConfig.d.ts +13 -0
- package/dist/types/models/config/notarizationConnectorConfig.d.ts +13 -0
- package/dist/types/models/config/platformComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +1 -1
- package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +6 -3
- package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +6 -3
- package/dist/types/models/config/rightsManagementPolicyInformationSourceComponentConfig.d.ts +4 -1
- package/dist/types/models/config/rightsManagementPolicyNegotiatorComponentConfig.d.ts +3 -3
- package/dist/types/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyRequesterComponentConfig.d.ts +3 -3
- package/dist/types/models/config/schemaVersionMigrationComponentConfig.d.ts +9 -0
- package/dist/types/models/config/telemetryConnectorConfig.d.ts +4 -0
- package/dist/types/models/config/trustVerifierComponentConfig.d.ts +4 -1
- package/dist/types/models/types/automationActionType.d.ts +13 -0
- package/dist/types/models/types/automationComponentType.d.ts +17 -0
- package/dist/types/models/types/dataspaceControlPlaneComponentType.d.ts +17 -0
- package/dist/types/models/types/dataspaceDataPlaneComponentType.d.ts +21 -0
- package/dist/types/models/types/entityStorageConnectorType.d.ts +1 -5
- package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +2 -2
- package/dist/types/models/types/healthComponentType.d.ts +17 -0
- package/dist/types/models/types/metricsCollectorComponentType.d.ts +13 -0
- package/dist/types/models/types/metricsProducerComponentType.d.ts +17 -0
- package/dist/types/models/types/notarizationComponentType.d.ts +17 -0
- package/dist/types/models/types/notarizationConnectorType.d.ts +17 -0
- package/dist/types/models/types/platformComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +6 -2
- package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +6 -2
- package/dist/types/models/types/rightsManagementPolicyInformationSourceComponentType.d.ts +4 -0
- package/dist/types/models/types/rightsManagementPolicyNegotiatorComponentType.d.ts +2 -2
- package/dist/types/models/types/rightsManagementPolicyObligationEnforcerComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyRequesterComponentType.d.ts +2 -2
- package/dist/types/models/types/schemaVersionMigrationComponentType.d.ts +13 -0
- package/dist/types/models/types/telemetryConnectorType.d.ts +4 -0
- package/dist/types/models/types/trustVerifierComponentType.d.ts +4 -0
- package/dist/types/utils/engineTypeHelper.d.ts +11 -0
- package/docs/changelog.md +1128 -155
- package/docs/examples.md +74 -1
- package/docs/reference/classes/EngineTypeHelper.md +57 -4
- package/docs/reference/functions/initialiseAttestationComponent.md +2 -2
- package/docs/reference/functions/initialiseAttestationConnector.md +3 -3
- package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +2 -2
- package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +2 -2
- package/docs/reference/functions/initialiseAutomationAction.md +31 -0
- package/docs/reference/functions/initialiseAutomationComponent.md +31 -0
- package/docs/reference/functions/initialiseBackgroundTaskComponent.md +2 -2
- package/docs/reference/functions/initialiseBlobStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseBlobStorageConnector.md +2 -2
- package/docs/reference/functions/initialiseContextIdHandlerComponent.md +2 -2
- package/docs/reference/functions/initialiseDataConverterConnector.md +2 -2
- package/docs/reference/functions/initialiseDataExtractorConnector.md +2 -2
- package/docs/reference/functions/initialiseDataProcessingComponent.md +2 -2
- package/docs/reference/functions/initialiseDataspaceControlPlaneComponent.md +31 -0
- package/docs/reference/functions/initialiseDataspaceDataPlaneComponent.md +31 -0
- package/docs/reference/functions/initialiseDocumentManagementComponent.md +2 -2
- package/docs/reference/functions/initialiseEntityStorageComponent.md +3 -3
- package/docs/reference/functions/initialiseEntityStorageConnector.md +4 -6
- package/docs/reference/functions/initialiseEventBusComponent.md +2 -2
- package/docs/reference/functions/initialiseEventBusConnector.md +2 -2
- package/docs/reference/functions/initialiseFaucetConnector.md +2 -2
- package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +2 -2
- package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +2 -2
- package/docs/reference/functions/initialiseHealthComponent.md +31 -0
- package/docs/reference/functions/initialiseIdentityComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityConnector.md +2 -2
- package/docs/reference/functions/initialiseIdentityProfileComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityProfileConnector.md +2 -2
- package/docs/reference/functions/initialiseIdentityResolverComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityResolverConnector.md +2 -2
- package/docs/reference/functions/initialiseImmutableProofComponent.md +2 -2
- package/docs/reference/functions/initialiseLoggingComponent.md +2 -2
- package/docs/reference/functions/initialiseLoggingConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingAdminComponent.md +2 -2
- package/docs/reference/functions/initialiseMessagingComponent.md +2 -2
- package/docs/reference/functions/initialiseMessagingEmailConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingSmsConnector.md +2 -2
- package/docs/reference/functions/initialiseMetricsCollectorComponent.md +31 -0
- package/docs/reference/functions/initialiseMetricsProducerComponent.md +31 -0
- package/docs/reference/functions/initialiseNftComponent.md +2 -2
- package/docs/reference/functions/initialiseNftConnector.md +2 -2
- package/docs/reference/functions/initialiseNotarizationComponent.md +31 -0
- package/docs/reference/functions/initialiseNotarizationConnector.md +31 -0
- package/docs/reference/functions/initialisePlatformComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPapComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPepComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPipComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyArbiterComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyEnforcementProcessorComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyExecutionActionComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyInformationSourceComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyNegotiatorComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPolicyObligationEnforcerComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +2 -2
- package/docs/reference/functions/initialiseSchemaVersionMigrationComponent.md +31 -0
- package/docs/reference/functions/initialiseTaskSchedulerComponent.md +2 -2
- package/docs/reference/functions/initialiseTelemetryComponent.md +2 -2
- package/docs/reference/functions/initialiseTelemetryConnector.md +2 -2
- package/docs/reference/functions/initialiseTenantAdminComponent.md +2 -2
- package/docs/reference/functions/initialiseTrustComponent.md +2 -2
- package/docs/reference/functions/initialiseTrustGeneratorComponent.md +2 -2
- package/docs/reference/functions/initialiseTrustVerifierComponent.md +2 -2
- package/docs/reference/functions/initialiseVaultConnector.md +2 -2
- package/docs/reference/functions/initialiseWalletConnector.md +3 -3
- package/docs/reference/index.md +48 -32
- package/docs/reference/interfaces/IEngineConfig.md +178 -106
- package/docs/reference/type-aliases/AttestationConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/AutomationActionConfig.md +17 -0
- package/docs/reference/type-aliases/AutomationActionType.md +5 -0
- package/docs/reference/type-aliases/AutomationComponentConfig.md +5 -0
- package/docs/reference/type-aliases/AutomationComponentType.md +5 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +3 -3
- package/docs/reference/type-aliases/BlobStorageConnectorConfig.md +1 -1
- package/docs/reference/type-aliases/DataExtractorConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/DataspaceControlPlaneComponentConfig.md +5 -0
- package/docs/reference/type-aliases/DataspaceControlPlaneComponentType.md +5 -0
- package/docs/reference/type-aliases/DataspaceDataPlaneComponentConfig.md +5 -0
- package/docs/reference/type-aliases/DataspaceDataPlaneComponentType.md +5 -0
- package/docs/reference/type-aliases/DltConfig.md +4 -4
- package/docs/reference/type-aliases/EntityStorageConnectorConfig.md +1 -1
- package/docs/reference/type-aliases/EventBusConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +4 -4
- package/docs/reference/type-aliases/HealthComponentConfig.md +5 -0
- package/docs/reference/type-aliases/HealthComponentType.md +5 -0
- 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/MetricsCollectorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/MetricsCollectorComponentType.md +5 -0
- package/docs/reference/type-aliases/MetricsProducerComponentConfig.md +5 -0
- package/docs/reference/type-aliases/MetricsProducerComponentType.md +5 -0
- package/docs/reference/type-aliases/NotarizationComponentConfig.md +5 -0
- package/docs/reference/type-aliases/NotarizationComponentType.md +5 -0
- package/docs/reference/type-aliases/NotarizationConnectorConfig.md +5 -0
- package/docs/reference/type-aliases/NotarizationConnectorType.md +5 -0
- package/docs/reference/type-aliases/PlatformComponentConfig.md +17 -0
- package/docs/reference/type-aliases/PlatformComponentType.md +5 -0
- 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/RightsManagementPnpComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +3 -3
- package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +4 -4
- package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentConfig.md +4 -4
- package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +3 -3
- package/docs/reference/type-aliases/SchemaVersionMigrationComponentConfig.md +17 -0
- package/docs/reference/type-aliases/SchemaVersionMigrationComponentType.md +5 -0
- package/docs/reference/type-aliases/TaskSchedulerComponentConfig.md +3 -3
- package/docs/reference/type-aliases/TelemetryConnectorConfig.md +1 -13
- 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 +1 -13
- 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/AutomationActionType.md +13 -0
- package/docs/reference/variables/AutomationComponentType.md +19 -0
- 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 +19 -0
- package/docs/reference/variables/{DataSpaceConnectorComponentType.md → DataspaceDataPlaneComponentType.md} +6 -6
- 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 -16
- 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 +3 -3
- package/docs/reference/variables/{VerifiableStorageComponentType.md → HealthComponentType.md} +5 -5
- 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/MetricsCollectorComponentType.md +13 -0
- package/docs/reference/variables/MetricsProducerComponentType.md +19 -0
- package/docs/reference/variables/NftComponentType.md +2 -2
- package/docs/reference/variables/NftConnectorType.md +2 -2
- package/docs/reference/variables/NotarizationComponentType.md +19 -0
- package/docs/reference/variables/NotarizationConnectorType.md +19 -0
- package/docs/reference/variables/PlatformComponentType.md +13 -0
- 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 +9 -3
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +9 -3
- package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +8 -2
- package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +3 -3
- package/docs/reference/variables/RightsManagementPolicyObligationEnforcerComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +3 -3
- package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
- package/docs/reference/variables/SchemaVersionMigrationComponentType.md +13 -0
- package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
- package/docs/reference/variables/TelemetryComponentType.md +2 -2
- package/docs/reference/variables/TelemetryConnectorType.md +7 -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 +7 -1
- package/docs/reference/variables/VaultConnectorType.md +2 -2
- package/docs/reference/variables/WalletConnectorType.md +2 -2
- package/package.json +133 -128
- package/dist/es/components/authenticationGenerator.js +0 -30
- package/dist/es/components/authenticationGenerator.js.map +0 -1
- package/dist/es/components/dataSpaceConnector.js +0 -51
- package/dist/es/components/dataSpaceConnector.js.map +0 -1
- package/dist/es/components/rightsManagementDap.js +0 -36
- package/dist/es/components/rightsManagementDap.js.map +0 -1
- package/dist/es/components/rightsManagementDarp.js +0 -30
- package/dist/es/components/rightsManagementDarp.js.map +0 -1
- package/dist/es/components/rightsManagementDataAccessHandler.js +0 -27
- package/dist/es/components/rightsManagementDataAccessHandler.js.map +0 -1
- package/dist/es/components/synchronisedStorage.js +0 -47
- package/dist/es/components/synchronisedStorage.js.map +0 -1
- package/dist/es/components/verifiableStorage.js +0 -79
- package/dist/es/components/verifiableStorage.js.map +0 -1
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js +0 -2
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js.map +0 -1
- package/dist/es/models/config/dataSpaceConnectorComponentConfig.js +0 -2
- package/dist/es/models/config/dataSpaceConnectorComponentConfig.js.map +0 -1
- package/dist/es/models/config/rightsManagementDapComponentConfig.js +0 -2
- package/dist/es/models/config/rightsManagementDapComponentConfig.js.map +0 -1
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js +0 -2
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +0 -1
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js +0 -2
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js.map +0 -1
- package/dist/es/models/config/synchronisedStorageComponentConfig.js +0 -2
- package/dist/es/models/config/synchronisedStorageComponentConfig.js.map +0 -1
- package/dist/es/models/config/verifiableStorageComponentConfig.js +0 -2
- package/dist/es/models/config/verifiableStorageComponentConfig.js.map +0 -1
- package/dist/es/models/config/verifiableStorageConnectorConfig.js +0 -2
- package/dist/es/models/config/verifiableStorageConnectorConfig.js.map +0 -1
- package/dist/es/models/types/authenticationGeneratorComponentType.js +0 -13
- package/dist/es/models/types/authenticationGeneratorComponentType.js.map +0 -1
- package/dist/es/models/types/dataSpaceConnectorComponentType.js.map +0 -1
- package/dist/es/models/types/rightsManagementDapComponentType.js.map +0 -1
- package/dist/es/models/types/rightsManagementDarpComponentType.js +0 -13
- package/dist/es/models/types/rightsManagementDarpComponentType.js.map +0 -1
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js +0 -13
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js.map +0 -1
- package/dist/es/models/types/synchronisedStorageComponentType.js.map +0 -1
- package/dist/es/models/types/verifiableStorageComponentType.js.map +0 -1
- package/dist/es/models/types/verifiableStorageConnectorType.js.map +0 -1
- package/dist/types/components/authenticationGenerator.d.ts +0 -17
- package/dist/types/components/dataSpaceConnector.d.ts +0 -16
- package/dist/types/components/rightsManagementDap.d.ts +0 -16
- package/dist/types/components/rightsManagementDarp.d.ts +0 -16
- package/dist/types/components/rightsManagementDataAccessHandler.d.ts +0 -17
- package/dist/types/components/synchronisedStorage.d.ts +0 -16
- package/dist/types/components/verifiableStorage.d.ts +0 -30
- package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +0 -9
- package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +0 -17
- package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +0 -16
- package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +0 -9
- package/dist/types/models/config/rightsManagementDataAccessHandlerComponentConfig.d.ts +0 -9
- package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +0 -13
- package/dist/types/models/config/verifiableStorageComponentConfig.d.ts +0 -13
- package/dist/types/models/config/verifiableStorageConnectorConfig.d.ts +0 -13
- package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +0 -13
- package/dist/types/models/types/dataSpaceConnectorComponentType.d.ts +0 -21
- package/dist/types/models/types/rightsManagementDapComponentType.d.ts +0 -17
- package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +0 -13
- package/dist/types/models/types/rightsManagementDataAccessHandlerComponentType.d.ts +0 -13
- package/dist/types/models/types/synchronisedStorageComponentType.d.ts +0 -17
- package/dist/types/models/types/verifiableStorageComponentType.d.ts +0 -17
- package/dist/types/models/types/verifiableStorageConnectorType.d.ts +0 -17
- package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +0 -31
- package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +0 -31
- package/docs/reference/functions/initialiseRightsManagementDapComponent.md +0 -31
- package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +0 -31
- package/docs/reference/functions/initialiseRightsManagementDataAccessHandlerComponent.md +0 -31
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +0 -31
- package/docs/reference/functions/initialiseVerifiableStorageComponent.md +0 -31
- package/docs/reference/functions/initialiseVerifiableStorageConnector.md +0 -31
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +0 -17
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +0 -5
- package/docs/reference/type-aliases/DataSpaceConnectorComponentConfig.md +0 -5
- package/docs/reference/type-aliases/DataSpaceConnectorComponentType.md +0 -5
- package/docs/reference/type-aliases/IVerifiableStorageComponentType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDapComponentType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +0 -17
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentConfig.md +0 -17
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentType.md +0 -5
- package/docs/reference/type-aliases/SynchronisedStorageComponentConfig.md +0 -5
- package/docs/reference/type-aliases/SynchronisedStorageComponentType.md +0 -5
- package/docs/reference/type-aliases/VerifiableStorageComponentConfig.md +0 -5
- package/docs/reference/type-aliases/VerifiableStorageConnectorConfig.md +0 -5
- package/docs/reference/type-aliases/VerifiableStorageConnectorType.md +0 -5
- package/docs/reference/variables/AuthenticationGeneratorComponentType.md +0 -13
- package/docs/reference/variables/RightsManagementDapComponentType.md +0 -19
- package/docs/reference/variables/RightsManagementDarpComponentType.md +0 -13
- package/docs/reference/variables/RightsManagementDataAccessHandlerComponentType.md +0 -13
- package/docs/reference/variables/SynchronisedStorageComponentType.md +0 -19
- package/docs/reference/variables/VerifiableStorageConnectorType.md +0 -19
|
@@ -0,0 +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,EAEzB,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,MAA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,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,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;gBAChF,sBAAsB,EACrB,UAAU,CAAC,iCAAiC,CAAC,oBAAoB,CAAC;aACnE,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\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\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\tpartitionContextIds\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\tplatformComponentType: engineCore.getRegisteredInstanceType(\"platformComponent\"),\n\t\t\t\t\t\ttelemetryComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"telemetryComponent\")\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"]}
|
|
@@ -4,6 +4,7 @@ import { ComponentFactory } from "@twin.org/core";
|
|
|
4
4
|
import { DocumentManagementRestClient } from "@twin.org/document-management-rest-client";
|
|
5
5
|
import { DocumentManagementService } from "@twin.org/document-management-service";
|
|
6
6
|
import { DocumentManagementComponentType } from "../models/types/documentManagementComponentType.js";
|
|
7
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
7
8
|
/**
|
|
8
9
|
* Initialise the document management component.
|
|
9
10
|
* @param engineCore The engine core.
|
|
@@ -11,26 +12,26 @@ import { DocumentManagementComponentType } from "../models/types/documentManagem
|
|
|
11
12
|
* @param instanceConfig The instance config.
|
|
12
13
|
* @returns The instance created and the factory for it.
|
|
13
14
|
*/
|
|
14
|
-
export
|
|
15
|
-
let
|
|
16
|
-
let
|
|
15
|
+
export function initialiseDocumentManagementComponent(engineCore, context, instanceConfig) {
|
|
16
|
+
let createComponent;
|
|
17
|
+
let instanceTypeName;
|
|
17
18
|
if (instanceConfig.type === DocumentManagementComponentType.Service) {
|
|
18
|
-
|
|
19
|
+
createComponent = (createConfig) => new DocumentManagementService(EngineTypeHelper.mergeConfig({
|
|
19
20
|
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
20
21
|
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
21
22
|
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
22
23
|
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
24
|
+
telemetryComponentType: engineCore.getRegisteredInstanceTypeOptional("telemetryComponent")
|
|
25
|
+
}, createConfig.options));
|
|
26
|
+
instanceTypeName = "document-management-service";
|
|
26
27
|
}
|
|
27
28
|
else if (instanceConfig.type === DocumentManagementComponentType.RestClient) {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
createComponent = (createConfig) => new DocumentManagementRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
30
|
+
instanceTypeName = "document-management-rest-client";
|
|
30
31
|
}
|
|
31
32
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
createComponent: createComponent,
|
|
34
|
+
instanceTypeName,
|
|
34
35
|
factory: ComponentFactory
|
|
35
36
|
};
|
|
36
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentManagement.js","sourceRoot":"","sources":["../../../src/components/documentManagement.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"documentManagement.js","sourceRoot":"","sources":["../../../src/components/documentManagement.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AASlF,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,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,yBAAyB,CAC5B,gBAAgB,CAAC,WAAW,CAC3B;YACC,+BAA+B,EAAE,UAAU,CAAC,yBAAyB,CACpE,6BAA6B,CAC7B;YACD,wBAAwB,EAAE,UAAU,CAAC,yBAAyB,CAAC,sBAAsB,CAAC;YACtF,wBAAwB,EAAE,UAAU,CAAC,yBAAyB,CAAC,sBAAsB,CAAC;YACtF,2BAA2B,EAC1B,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAChE,sBAAsB,EACrB,UAAU,CAAC,iCAAiC,CAAC,oBAAoB,CAAC;SACnE,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,gCAA6C,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,CAC/B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,oCAAgD,CAAC;IAClE,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 { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport { DocumentManagementRestClient } from \"@twin.org/document-management-rest-client\";\nimport { DocumentManagementService } from \"@twin.org/document-management-service\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { DocumentManagementComponentConfig } from \"../models/config/documentManagementComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DocumentManagementComponentType } from \"../models/types/documentManagementComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the document management 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 initialiseDocumentManagementComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DocumentManagementComponentConfig\n): EngineTypeInitialiserReturn<DocumentManagementComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === DocumentManagementComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DocumentManagementService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tauditableItemGraphComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"auditableItemGraphComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tblobStorageComponentType: engineCore.getRegisteredInstanceType(\"blobStorageComponent\"),\n\t\t\t\t\t\tattestationComponentType: engineCore.getRegisteredInstanceType(\"attestationComponent\"),\n\t\t\t\t\t\tdataProcessingComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"dataProcessingComponent\"),\n\t\t\t\t\t\ttelemetryComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"telemetryComponent\")\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(DocumentManagementService);\n\t} else if (instanceConfig.type === DocumentManagementComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DocumentManagementRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(DocumentManagementRestClient);\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"]}
|
|
@@ -11,12 +11,12 @@ import { MongoDbEntityStorageConnector } from "@twin.org/entity-storage-connecto
|
|
|
11
11
|
import { MySqlEntityStorageConnector } from "@twin.org/entity-storage-connector-mysql";
|
|
12
12
|
import { PostgreSqlEntityStorageConnector } from "@twin.org/entity-storage-connector-postgresql";
|
|
13
13
|
import { ScyllaDBTableConnector } from "@twin.org/entity-storage-connector-scylladb";
|
|
14
|
-
import { SynchronisedEntityStorageConnector } from "@twin.org/entity-storage-connector-synchronised";
|
|
15
14
|
import { EntityStorageConnectorFactory } from "@twin.org/entity-storage-models";
|
|
16
15
|
import { EntityStorageRestClient } from "@twin.org/entity-storage-rest-client";
|
|
17
16
|
import { EntityStorageService } from "@twin.org/entity-storage-service";
|
|
18
17
|
import { EntityStorageComponentType } from "../models/types/entityStorageComponentType.js";
|
|
19
18
|
import { EntityStorageConnectorType } from "../models/types/entityStorageConnectorType.js";
|
|
19
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
20
20
|
/**
|
|
21
21
|
* Initialise the entity storage connector.
|
|
22
22
|
* @param engineCore The engine core.
|
|
@@ -24,35 +24,38 @@ import { EntityStorageConnectorType } from "../models/types/entityStorageConnect
|
|
|
24
24
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
25
25
|
* @param schema The schema for the entity storage.
|
|
26
26
|
* @param partitionContextIds The context IDs to use for partitioning the data.
|
|
27
|
-
* @returns The name of the instance type that was created.
|
|
28
27
|
* @throws GeneralError when the configuration is invalid.
|
|
29
28
|
*/
|
|
30
29
|
export function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema, partitionContextIds) {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
30
|
+
const kebabName = StringHelper.kebabCase(schema);
|
|
31
|
+
let instanceName = kebabName;
|
|
32
|
+
let entityStorageConfig;
|
|
33
|
+
if (Is.stringValue(typeCustom)) {
|
|
34
|
+
// A custom type has been specified, so look it up
|
|
35
|
+
entityStorageConfig = context.config.types.entityStorageConnector?.find(c => c.type === typeCustom || c.overrideInstanceType === typeCustom);
|
|
36
|
+
if (Is.empty(entityStorageConfig)) {
|
|
37
|
+
throw new GeneralError("engineTypes", "entityStorageCustomMissing", {
|
|
38
|
+
typeCustom,
|
|
39
|
+
storageName: instanceName
|
|
40
|
+
});
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
// Since we have a custom type we need to use that as the instance name for the
|
|
43
|
+
// connector so that it can be looked up by other components
|
|
44
|
+
instanceName = typeCustom;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// The default entity storage method is either the one with the isDefault flag set
|
|
48
|
+
// or pick the first one if no default is set.
|
|
49
|
+
entityStorageConfig =
|
|
50
|
+
context.config.types.entityStorageConnector?.find(c => c.isDefault ?? false) ??
|
|
51
|
+
context.config.types.entityStorageConnector?.[0];
|
|
52
|
+
if (Is.empty(entityStorageConfig)) {
|
|
53
|
+
throw new GeneralError("engineTypes", "entityStorageMissing", {
|
|
54
|
+
storageName: instanceName
|
|
55
|
+
});
|
|
55
56
|
}
|
|
57
|
+
}
|
|
58
|
+
if (!EntityStorageConnectorFactory.hasName(instanceName)) {
|
|
56
59
|
const type = entityStorageConfig.type;
|
|
57
60
|
let entityStorageConnector;
|
|
58
61
|
engineCore.logInfo(I18n.formatMessage("info.engineTypes.configuringEntityStorage", {
|
|
@@ -63,7 +66,12 @@ export function initialiseEntityStorageConnector(engineCore, context, typeCustom
|
|
|
63
66
|
if (type === EntityStorageConnectorType.Memory) {
|
|
64
67
|
entityStorageConnector = new MemoryEntityStorageConnector({
|
|
65
68
|
entitySchema: schema,
|
|
66
|
-
partitionContextIds
|
|
69
|
+
partitionContextIds,
|
|
70
|
+
...entityStorageConfig.options,
|
|
71
|
+
config: {
|
|
72
|
+
...entityStorageConfig.options.config,
|
|
73
|
+
storageKey: `${entityStorageConfig.options.storagePrefix ?? ""}${instanceName}`
|
|
74
|
+
}
|
|
67
75
|
});
|
|
68
76
|
}
|
|
69
77
|
else if (type === EntityStorageConnectorType.File) {
|
|
@@ -154,23 +162,6 @@ export function initialiseEntityStorageConnector(engineCore, context, typeCustom
|
|
|
154
162
|
}
|
|
155
163
|
});
|
|
156
164
|
}
|
|
157
|
-
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
158
|
-
// Create the entity storage that is wrapped by the synchronised connector
|
|
159
|
-
// by removing the custom type it will default to the standard storage
|
|
160
|
-
// mechanism for entity storage
|
|
161
|
-
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema, partitionContextIds);
|
|
162
|
-
// Use the wrapped instance name as the entity storage connector type
|
|
163
|
-
// for the synchronised connector
|
|
164
|
-
entityStorageConnector = new SynchronisedEntityStorageConnector({
|
|
165
|
-
entitySchema: schema,
|
|
166
|
-
...entityStorageConfig.options,
|
|
167
|
-
entityStorageConnectorType: wrappedInstanceName,
|
|
168
|
-
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
169
|
-
config: {
|
|
170
|
-
...entityStorageConfig.options.config
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
165
|
else {
|
|
175
166
|
throw new GeneralError("engineTypes", "connectorUnknownType", {
|
|
176
167
|
type,
|
|
@@ -184,42 +175,39 @@ export function initialiseEntityStorageConnector(engineCore, context, typeCustom
|
|
|
184
175
|
});
|
|
185
176
|
EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
186
177
|
}
|
|
187
|
-
return instanceName;
|
|
188
178
|
}
|
|
189
179
|
/**
|
|
190
|
-
* Initialise the entity storage
|
|
180
|
+
* Initialise the entity storage component.
|
|
191
181
|
* @param engineCore The engine core.
|
|
192
182
|
* @param context The context for the engine.
|
|
193
183
|
* @param instanceConfig The instance config.
|
|
194
184
|
* @returns The instance created and the factory for it.
|
|
195
185
|
*/
|
|
196
|
-
export
|
|
197
|
-
let
|
|
198
|
-
let
|
|
186
|
+
export function initialiseEntityStorageComponent(engineCore, context, instanceConfig) {
|
|
187
|
+
let createComponent;
|
|
188
|
+
let instanceTypeName;
|
|
199
189
|
if (instanceConfig.type === EntityStorageComponentType.Service) {
|
|
200
190
|
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
instanceType = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
191
|
+
createComponent = (createConfig) => {
|
|
192
|
+
// See if there is a custom entity storage for this type, otherwise just use the default one.
|
|
193
|
+
const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
|
|
194
|
+
initialiseEntityStorageConnector(engineCore, context, hasCustom ? kebabName : undefined, createConfig.options.entityStorageType, createConfig.options.partitionContextIds);
|
|
195
|
+
return new EntityStorageService(EngineTypeHelper.mergeConfig(createConfig.options, {
|
|
196
|
+
entityStorageType: kebabName
|
|
197
|
+
}));
|
|
198
|
+
};
|
|
199
|
+
instanceTypeName = kebabName;
|
|
211
200
|
}
|
|
212
201
|
else if (instanceConfig.type === EntityStorageComponentType.RestClient) {
|
|
213
202
|
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
214
|
-
|
|
215
|
-
pathPrefix: kebabName
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
instanceType = `${"entity-storage-rest-client"}-${kebabName}`;
|
|
203
|
+
createComponent = (createConfig) => new EntityStorageRestClient(EngineTypeHelper.mergeConfig(createConfig.options, {
|
|
204
|
+
pathPrefix: kebabName
|
|
205
|
+
}));
|
|
206
|
+
instanceTypeName = `${"entity-storage-rest-client"}-${kebabName}`;
|
|
219
207
|
}
|
|
220
208
|
return {
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
createComponent: createComponent,
|
|
210
|
+
instanceTypeName,
|
|
223
211
|
factory: ComponentFactory
|
|
224
212
|
};
|
|
225
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityStorage.js","sourceRoot":"","sources":["../../../src/components/entityStorage.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,YAAY,EAEZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AACrG,OAAO,EACN,6BAA6B,EAG7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,C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AAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACjC,cAAc,CAAC,OAAO,CAAC,iBAAiB,EACxC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAC1C,CAAC;QACF,SAAS,GAAG,IAAI,oBAAoB,CAAC;YACpC,iBAAiB,EAAE,SAAS;YAC5B,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM;aAChC;SACD,CAAC,CAAC;QACH,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjF,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,0BAA0B,CAAC,UAAU,EAAE,CAAC;QAC1E,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACnF,SAAS,GAAG,IAAI,uBAAuB,CAAC;YACvC,UAAU,EAAE,SAAS;YACrB,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,GAAG,GAAG,4BAAwC,IAAI,SAAS,EAAE,CAAC;IAC3E,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport {\n\tComponentFactory,\n\tGeneralError,\n\tI18n,\n\tIs,\n\tStringHelper,\n\ttype IComponent\n} from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { CosmosDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-cosmosdb\";\nimport { DynamoDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-dynamodb\";\nimport { FileEntityStorageConnector } from \"@twin.org/entity-storage-connector-file\";\nimport { FirestoreEntityStorageConnector } from \"@twin.org/entity-storage-connector-gcp-firestore\";\nimport { MemoryEntityStorageConnector } from \"@twin.org/entity-storage-connector-memory\";\nimport { MongoDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-mongodb\";\nimport { MySqlEntityStorageConnector } from \"@twin.org/entity-storage-connector-mysql\";\nimport { PostgreSqlEntityStorageConnector } from \"@twin.org/entity-storage-connector-postgresql\";\nimport { ScyllaDBTableConnector } from \"@twin.org/entity-storage-connector-scylladb\";\nimport { SynchronisedEntityStorageConnector } from \"@twin.org/entity-storage-connector-synchronised\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageComponent,\n\ttype IEntityStorageConnector\n} from \"@twin.org/entity-storage-models\";\nimport { EntityStorageRestClient } from \"@twin.org/entity-storage-rest-client\";\nimport { EntityStorageService } from \"@twin.org/entity-storage-service\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { EntityStorageComponentConfig } from \"../models/config/entityStorageComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { EntityStorageComponentType } from \"../models/types/entityStorageComponentType.js\";\nimport { EntityStorageConnectorType } from \"../models/types/entityStorageConnectorType.js\";\n\n/**\n * Initialise the entity storage connector.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param typeCustom Override the type of connector to use instead of default configuration.\n * @param schema The schema for the entity storage.\n * @param partitionContextIds The context IDs to use for partitioning the data.\n * @returns The name of the instance type that was created.\n * @throws GeneralError when the configuration is invalid.\n */\nexport function initialiseEntityStorageConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\ttypeCustom: string | undefined,\n\tschema: string,\n\tpartitionContextIds: string[]\n): string {\n\tconst instanceName = StringHelper.kebabCase(schema);\n\n\tif (!EntityStorageConnectorFactory.hasName(instanceName)) {\n\t\tlet entityStorageConfig;\n\n\t\tif (Is.stringValue(typeCustom)) {\n\t\t\t// A custom type has been specified, so look it up\n\t\t\tentityStorageConfig = context.config.types.entityStorageConnector?.find(\n\t\t\t\tc => c.type === typeCustom || c.overrideInstanceType === typeCustom\n\t\t\t);\n\t\t\tif (Is.empty(entityStorageConfig)) {\n\t\t\t\tthrow new GeneralError(\"engineTypes\", \"entityStorageCustomMissing\", {\n\t\t\t\t\ttypeCustom,\n\t\t\t\t\tstorageName: instanceName\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\t// The default entity storage method is either the one with the isDefault flag set\n\t\t\t// or pick the first one if no default is set.\n\t\t\tentityStorageConfig =\n\t\t\t\tcontext.config.types.entityStorageConnector?.find(c => c.isDefault ?? false) ??\n\t\t\t\tcontext.config.types.entityStorageConnector?.[0];\n\t\t\tif (Is.empty(entityStorageConfig)) {\n\t\t\t\tthrow new GeneralError(\"engineTypes\", \"entityStorageMissing\", {\n\t\t\t\t\tstorageName: instanceName\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst type = entityStorageConfig.type;\n\t\tlet entityStorageConnector: IEntityStorageConnector;\n\n\t\tengineCore.logInfo(\n\t\t\tI18n.formatMessage(\"info.engineTypes.configuringEntityStorage\", {\n\t\t\t\telement: \"Entity Storage\",\n\t\t\t\tstorageName: instanceName,\n\t\t\t\tstorageType: type\n\t\t\t})\n\t\t);\n\n\t\tif (type === EntityStorageConnectorType.Memory) {\n\t\t\tentityStorageConnector = new MemoryEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.File) {\n\t\t\tentityStorageConnector = new FileEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tdirectory: path.join(\n\t\t\t\t\t\tentityStorageConfig.options.config.directory,\n\t\t\t\t\t\t`${entityStorageConfig.options.folderPrefix ?? \"\"}${instanceName}`\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.AwsDynamoDb) {\n\t\t\tentityStorageConnector = new DynamoDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.AzureCosmosDb) {\n\t\t\tentityStorageConnector = new CosmosDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcontainerId: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.GcpFirestoreDb) {\n\t\t\tentityStorageConnector = new FirestoreEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcollectionName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.ScyllaDb) {\n\t\t\tentityStorageConnector = new ScyllaDBTableConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.MySqlDb) {\n\t\t\tentityStorageConnector = new MySqlEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.MongoDb) {\n\t\t\tentityStorageConnector = new MongoDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcollection: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.PostgreSql) {\n\t\t\tentityStorageConnector = new PostgreSqlEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.Synchronised) {\n\t\t\t// Create the entity storage that is wrapped by the synchronised connector\n\t\t\t// by removing the custom type it will default to the standard storage\n\t\t\t// mechanism for entity storage\n\t\t\tconst wrappedInstanceName = initialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tundefined,\n\t\t\t\tschema,\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\t// Use the wrapped instance name as the entity storage connector type\n\t\t\t// for the synchronised connector\n\t\t\tentityStorageConnector = new SynchronisedEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tentityStorageConnectorType: wrappedInstanceName,\n\t\t\t\teventBusComponentType: engineCore.getRegisteredInstanceType(\"eventBusComponent\"),\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthrow new GeneralError(\"engineTypes\", \"connectorUnknownType\", {\n\t\t\t\ttype,\n\t\t\t\tconnectorType: \"entityStorageConnector\"\n\t\t\t});\n\t\t}\n\n\t\tcontext.componentInstances.push({\n\t\t\tinstanceType: instanceName,\n\t\t\tcomponent: entityStorageConnector,\n\t\t\tinitialised: false\n\t\t});\n\t\tEntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);\n\t}\n\n\treturn instanceName;\n}\n\n/**\n * Initialise the entity storage connector.\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 async function initialiseEntityStorageComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: EntityStorageComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IEntityStorageComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === EntityStorageComponentType.Service) {\n\t\tconst kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);\n\n\t\t// See if there is a custom entity storage for this type, otherwise just use the default one.\n\t\tconst hasCustom = context.config.types.entityStorageConnector?.some(\n\t\t\tc => c.type === kebabName || c.overrideInstanceType === kebabName\n\t\t);\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\thasCustom ? kebabName : undefined,\n\t\t\tinstanceConfig.options.entityStorageType,\n\t\t\tinstanceConfig.options.partitionContextIds\n\t\t);\n\t\tcomponent = new EntityStorageService({\n\t\t\tentityStorageType: kebabName,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = StringHelper.kebabCase(instanceConfig.options.entityStorageType);\n\t} else if (instanceConfig.type === EntityStorageComponentType.RestClient) {\n\t\tconst kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);\n\t\tcomponent = new EntityStorageRestClient({\n\t\t\tpathPrefix: kebabName,\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = `${nameofKebabCase(EntityStorageRestClient)}-${kebabName}`;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"entityStorage.js","sourceRoot":"","sources":["../../../src/components/entityStorage.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,IAAI,EAEJ,EAAE,EACF,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACN,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE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CAAC,mBAAmB,CACxC,CAAC;YAEF,OAAO,IAAI,oBAAoB,CAC9B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,EAAE;gBACtF,iBAAiB,EAAE,SAAS;aAC5B,CAAC,CACF,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,SAAS,CAAC;IAC9B,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,0BAA0B,CAAC,UAAU,EAAE,CAAC;QAC1E,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACnF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,uBAAuB,CAC1B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,EAAE;YACtF,UAAU,EAAE,SAAS;SACrB,CAAC,CACF,CAAC;QACH,gBAAgB,GAAG,GAAG,4BAAwC,IAAI,SAAS,EAAE,CAAC;IAC/E,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 path from \"node:path\";\nimport {\n\tComponentFactory,\n\tGeneralError,\n\tI18n,\n\ttype IComponent,\n\tIs,\n\tStringHelper\n} from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { CosmosDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-cosmosdb\";\nimport { DynamoDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-dynamodb\";\nimport { FileEntityStorageConnector } from \"@twin.org/entity-storage-connector-file\";\nimport { FirestoreEntityStorageConnector } from \"@twin.org/entity-storage-connector-gcp-firestore\";\nimport { MemoryEntityStorageConnector } from \"@twin.org/entity-storage-connector-memory\";\nimport { MongoDbEntityStorageConnector } from \"@twin.org/entity-storage-connector-mongodb\";\nimport { MySqlEntityStorageConnector } from \"@twin.org/entity-storage-connector-mysql\";\nimport { PostgreSqlEntityStorageConnector } from \"@twin.org/entity-storage-connector-postgresql\";\nimport { ScyllaDBTableConnector } from \"@twin.org/entity-storage-connector-scylladb\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@twin.org/entity-storage-models\";\nimport { EntityStorageRestClient } from \"@twin.org/entity-storage-rest-client\";\nimport { EntityStorageService } from \"@twin.org/entity-storage-service\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { EntityStorageComponentConfig } from \"../models/config/entityStorageComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { EntityStorageComponentType } from \"../models/types/entityStorageComponentType.js\";\nimport { EntityStorageConnectorType } from \"../models/types/entityStorageConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the entity storage connector.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param typeCustom Override the type of connector to use instead of default configuration.\n * @param schema The schema for the entity storage.\n * @param partitionContextIds The context IDs to use for partitioning the data.\n * @throws GeneralError when the configuration is invalid.\n */\nexport function initialiseEntityStorageConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\ttypeCustom: string | undefined,\n\tschema: string,\n\tpartitionContextIds: string[]\n): void {\n\tconst kebabName = StringHelper.kebabCase(schema);\n\tlet instanceName = kebabName;\n\n\tlet entityStorageConfig;\n\n\tif (Is.stringValue(typeCustom)) {\n\t\t// A custom type has been specified, so look it up\n\t\tentityStorageConfig = context.config.types.entityStorageConnector?.find(\n\t\t\tc => c.type === typeCustom || c.overrideInstanceType === typeCustom\n\t\t);\n\t\tif (Is.empty(entityStorageConfig)) {\n\t\t\tthrow new GeneralError(\"engineTypes\", \"entityStorageCustomMissing\", {\n\t\t\t\ttypeCustom,\n\t\t\t\tstorageName: instanceName\n\t\t\t});\n\t\t}\n\n\t\t// Since we have a custom type we need to use that as the instance name for the\n\t\t// connector so that it can be looked up by other components\n\t\tinstanceName = typeCustom;\n\t} else {\n\t\t// The default entity storage method is either the one with the isDefault flag set\n\t\t// or pick the first one if no default is set.\n\t\tentityStorageConfig =\n\t\t\tcontext.config.types.entityStorageConnector?.find(c => c.isDefault ?? false) ??\n\t\t\tcontext.config.types.entityStorageConnector?.[0];\n\t\tif (Is.empty(entityStorageConfig)) {\n\t\t\tthrow new GeneralError(\"engineTypes\", \"entityStorageMissing\", {\n\t\t\t\tstorageName: instanceName\n\t\t\t});\n\t\t}\n\t}\n\n\tif (!EntityStorageConnectorFactory.hasName(instanceName)) {\n\t\tconst type = entityStorageConfig.type;\n\t\tlet entityStorageConnector: IEntityStorageConnector;\n\n\t\tengineCore.logInfo(\n\t\t\tI18n.formatMessage(\"info.engineTypes.configuringEntityStorage\", {\n\t\t\t\telement: \"Entity Storage\",\n\t\t\t\tstorageName: instanceName,\n\t\t\t\tstorageType: type\n\t\t\t})\n\t\t);\n\n\t\tif (type === EntityStorageConnectorType.Memory) {\n\t\t\tentityStorageConnector = new MemoryEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tstorageKey: `${entityStorageConfig.options.storagePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.File) {\n\t\t\tentityStorageConnector = new FileEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tdirectory: path.join(\n\t\t\t\t\t\tentityStorageConfig.options.config.directory,\n\t\t\t\t\t\t`${entityStorageConfig.options.folderPrefix ?? \"\"}${instanceName}`\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.AwsDynamoDb) {\n\t\t\tentityStorageConnector = new DynamoDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.AzureCosmosDb) {\n\t\t\tentityStorageConnector = new CosmosDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcontainerId: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.GcpFirestoreDb) {\n\t\t\tentityStorageConnector = new FirestoreEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcollectionName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.ScyllaDb) {\n\t\t\tentityStorageConnector = new ScyllaDBTableConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.MySqlDb) {\n\t\t\tentityStorageConnector = new MySqlEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.MongoDb) {\n\t\t\tentityStorageConnector = new MongoDbEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\tcollection: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (type === EntityStorageConnectorType.PostgreSql) {\n\t\t\tentityStorageConnector = new PostgreSqlEntityStorageConnector({\n\t\t\t\tentitySchema: schema,\n\t\t\t\tpartitionContextIds,\n\t\t\t\t...entityStorageConfig.options,\n\t\t\t\tconfig: {\n\t\t\t\t\t...entityStorageConfig.options.config,\n\t\t\t\t\ttableName: `${entityStorageConfig.options.tablePrefix ?? \"\"}${instanceName}`\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthrow new GeneralError(\"engineTypes\", \"connectorUnknownType\", {\n\t\t\t\ttype,\n\t\t\t\tconnectorType: \"entityStorageConnector\"\n\t\t\t});\n\t\t}\n\n\t\tcontext.componentInstances.push({\n\t\t\tinstanceType: instanceName,\n\t\t\tcomponent: entityStorageConnector,\n\t\t\tinitialised: false\n\t\t});\n\t\tEntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);\n\t}\n}\n\n/**\n * Initialise the entity storage 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 initialiseEntityStorageComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: EntityStorageComponentConfig\n): EngineTypeInitialiserReturn<EntityStorageComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === EntityStorageComponentType.Service) {\n\t\tconst kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\t// See if there is a custom entity storage for this type, otherwise just use the default one.\n\t\t\tconst hasCustom = context.config.types.entityStorageConnector?.some(\n\t\t\t\tc => c.type === kebabName || c.overrideInstanceType === kebabName\n\t\t\t);\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\thasCustom ? kebabName : undefined,\n\t\t\t\tcreateConfig.options.entityStorageType,\n\t\t\t\tcreateConfig.options.partitionContextIds\n\t\t\t);\n\n\t\t\treturn new EntityStorageService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options, {\n\t\t\t\t\tentityStorageType: kebabName\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = kebabName;\n\t} else if (instanceConfig.type === EntityStorageComponentType.RestClient) {\n\t\tconst kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew EntityStorageRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options, {\n\t\t\t\t\tpathPrefix: kebabName\n\t\t\t\t})\n\t\t\t);\n\t\tinstanceTypeName = `${nameofKebabCase(EntityStorageRestClient)}-${kebabName}`;\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"]}
|
|
@@ -7,6 +7,7 @@ import { EventBusService } from "@twin.org/event-bus-service";
|
|
|
7
7
|
import { EventBusSocketClient } from "@twin.org/event-bus-socket-client";
|
|
8
8
|
import { EventBusComponentType } from "../models/types/eventBusComponentType.js";
|
|
9
9
|
import { EventBusConnectorType } from "../models/types/eventBusConnectorType.js";
|
|
10
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
10
11
|
/**
|
|
11
12
|
* Initialise a event bus connector.
|
|
12
13
|
* @param engineCore The engine core.
|
|
@@ -14,20 +15,19 @@ import { EventBusConnectorType } from "../models/types/eventBusConnectorType.js"
|
|
|
14
15
|
* @param instanceConfig The instance config.
|
|
15
16
|
* @returns The instance created and the factory for it.
|
|
16
17
|
*/
|
|
17
|
-
export
|
|
18
|
-
let
|
|
19
|
-
let
|
|
18
|
+
export function initialiseEventBusConnector(engineCore, context, instanceConfig) {
|
|
19
|
+
let createComponent;
|
|
20
|
+
let instanceTypeName;
|
|
20
21
|
if (instanceConfig.type === EventBusConnectorType.Local) {
|
|
21
|
-
|
|
22
|
-
loggingComponentType: engineCore.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
instanceType = LocalEventBusConnector.NAMESPACE;
|
|
22
|
+
createComponent = (createConfig) => new LocalEventBusConnector(EngineTypeHelper.mergeConfig({
|
|
23
|
+
loggingComponentType: engineCore.getRegisteredLoggerType("LocalEventBusConnector")
|
|
24
|
+
}, createConfig.options));
|
|
25
|
+
instanceTypeName = LocalEventBusConnector.NAMESPACE;
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
createComponent,
|
|
29
|
+
instanceTypeName,
|
|
30
|
+
factory: EventBusConnectorFactory
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -37,27 +37,23 @@ export async function initialiseEventBusConnector(engineCore, context, instanceC
|
|
|
37
37
|
* @param instanceConfig The instance config.
|
|
38
38
|
* @returns The instance created and the factory for it.
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
41
|
-
let
|
|
42
|
-
let
|
|
40
|
+
export function initialiseEventBusComponent(engineCore, context, instanceConfig) {
|
|
41
|
+
let createComponent;
|
|
42
|
+
let instanceTypeName;
|
|
43
43
|
if (instanceConfig.type === EventBusComponentType.Service) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...instanceConfig.options
|
|
47
|
-
});
|
|
48
|
-
instanceType = "event-bus-service";
|
|
44
|
+
createComponent = (createConfig) => new EventBusService(EngineTypeHelper.mergeConfig({ eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector") }, createConfig.options));
|
|
45
|
+
instanceTypeName = "event-bus-service";
|
|
49
46
|
}
|
|
50
47
|
else if (instanceConfig.type === EventBusComponentType.SocketClient) {
|
|
51
|
-
|
|
52
|
-
loggingComponentType: engineCore.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
instanceType = "event-bus-socket-client";
|
|
48
|
+
createComponent = (createConfig) => new EventBusSocketClient(EngineTypeHelper.mergeConfig({
|
|
49
|
+
loggingComponentType: engineCore.getRegisteredLoggerType("EventBusSocketClient")
|
|
50
|
+
}, createConfig.options));
|
|
51
|
+
instanceTypeName = "event-bus-socket-client";
|
|
56
52
|
}
|
|
57
53
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
createComponent: createComponent,
|
|
55
|
+
instanceTypeName,
|
|
56
|
+
factory: ComponentFactory
|
|
61
57
|
};
|
|
62
58
|
}
|
|
63
59
|
//# sourceMappingURL=eventBus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../../src/components/eventBus.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"eventBus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C,OAAO,EAAE,CAAC;QAC3D,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,eAAe,CAClB,gBAAgB,CAAC,WAAW,CAC3B,EAAE,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,EAAE,EACpF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,sBAAmC,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,qBAAqB,CAAC,YAAY,EAAE,CAAC;QACvE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,oBAAoB,CACvB,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,uBAAuB,wBAA8B;SACtF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAwC,CAAC;IAC1D,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 { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { LocalEventBusConnector } from \"@twin.org/event-bus-connector-local\";\nimport { EventBusConnectorFactory } from \"@twin.org/event-bus-models\";\nimport { EventBusService } from \"@twin.org/event-bus-service\";\nimport { EventBusSocketClient } from \"@twin.org/event-bus-socket-client\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { EventBusComponentConfig } from \"../models/config/eventBusComponentConfig.js\";\nimport type { EventBusConnectorConfig } from \"../models/config/eventBusConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { EventBusComponentType } from \"../models/types/eventBusComponentType.js\";\nimport { EventBusConnectorType } from \"../models/types/eventBusConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a event bus connector.\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 initialiseEventBusConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: EventBusConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof EventBusConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === EventBusConnectorType.Local) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LocalEventBusConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredLoggerType(nameof(LocalEventBusConnector))\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 = LocalEventBusConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: EventBusConnectorFactory\n\t};\n}\n\n/**\n * Initialise the event bus 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 initialiseEventBusComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: EventBusComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === EventBusComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew EventBusService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ eventBusConnectorType: engineCore.getRegisteredInstanceType(\"eventBusConnector\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(EventBusService);\n\t} else if (instanceConfig.type === EventBusComponentType.SocketClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew EventBusSocketClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredLoggerType(nameof(EventBusSocketClient))\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(EventBusSocketClient);\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"]}
|
|
@@ -12,29 +12,29 @@ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
|
12
12
|
* @param instanceConfig The instance config.
|
|
13
13
|
* @returns The instance created and the factory for it.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
let
|
|
17
|
-
let
|
|
15
|
+
export function initialiseFaucetConnector(engineCore, context, instanceConfig) {
|
|
16
|
+
let createComponent;
|
|
17
|
+
let instanceTypeName;
|
|
18
18
|
if (instanceConfig.type === FaucetConnectorType.Iota) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
instanceType = IotaFaucetConnector.NAMESPACE;
|
|
19
|
+
createComponent = (createConfig) => {
|
|
20
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
21
|
+
return new IotaFaucetConnector(EngineTypeHelper.mergeConfig({
|
|
22
|
+
config: dltConfig?.options?.config
|
|
23
|
+
}, createConfig.options));
|
|
24
|
+
};
|
|
25
|
+
instanceTypeName = IotaFaucetConnector.NAMESPACE;
|
|
28
26
|
}
|
|
29
27
|
else if (instanceConfig.type === FaucetConnectorType.EntityStorage) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
createComponent = (createConfig) => {
|
|
29
|
+
initSchemaWallet();
|
|
30
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.walletAddressEntityStorageType, "WalletAddress", []);
|
|
31
|
+
return new EntityStorageFaucetConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
32
|
+
};
|
|
33
|
+
instanceTypeName = EntityStorageFaucetConnector.NAMESPACE;
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
createComponent: createComponent,
|
|
37
|
+
instanceTypeName,
|
|
38
38
|
factory: FaucetConnectorFactory
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../src/components/faucet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../src/components/faucet.ts"],"names":[],"mappings":"AASA,OAAO,EACN,4BAA4B,EAC5B,UAAU,IAAI,gBAAgB,EAE9B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEN,mBAAmB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAItE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACxC,UAAsC,EACtC,OAA0C,EAC1C,cAAqC;IAErC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACtD,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,MAAM,SAAS,GAAG,gBAAgB,CAAC,eAAe,CACjD,UAAU,CAAC,SAAS,EAAE,EACtB,WAAW,EACX,aAAa,CAAC,IAAI,CAClB,CAAC;YACF,OAAO,IAAI,mBAAmB,CAC7B,gBAAgB,CAAC,WAAW,CAC3B;gBACC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAoC;aAChE,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAAC;IAClD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,CAAC,aAAa,EAAE,CAAC;QACtE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,gBAAgB,EAAE,CAAC;YACnB,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,8BAA8B,mBAEpD,EAAE,CACF,CAAC;YACF,OAAO,IAAI,4BAA4B,CACtC,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,4BAA4B,CAAC,SAAS,CAAC;IAC3D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,sBAAsB;KAC/B,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tEntityStorageFaucetConnector,\n\tinitSchema as initSchemaWallet,\n\ttype WalletAddress\n} from \"@twin.org/wallet-connector-entity-storage\";\nimport {\n\ttype IIotaFaucetConnectorConfig,\n\tIotaFaucetConnector\n} from \"@twin.org/wallet-connector-iota\";\nimport { FaucetConnectorFactory } from \"@twin.org/wallet-models\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DltConfig } from \"../models/config/dltConfig.js\";\nimport type { FaucetConnectorConfig } from \"../models/config/faucetConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DltConfigType } from \"../models/types/dltConfigType.js\";\nimport { FaucetConnectorType } from \"../models/types/faucetConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a faucet connector.\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 initialiseFaucetConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FaucetConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof FaucetConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === FaucetConnectorType.Iota) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tconst dltConfig = EngineTypeHelper.getConfigOfType<DltConfig>(\n\t\t\t\tengineCore.getConfig(),\n\t\t\t\t\"dltConfig\",\n\t\t\t\tDltConfigType.Iota\n\t\t\t);\n\t\t\treturn new IotaFaucetConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tconfig: dltConfig?.options?.config as IIotaFaucetConnectorConfig\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 = IotaFaucetConnector.NAMESPACE;\n\t} else if (instanceConfig.type === FaucetConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaWallet();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.walletAddressEntityStorageType,\n\t\t\t\tnameof<WalletAddress>(),\n\t\t\t\t[]\n\t\t\t);\n\t\t\treturn new EntityStorageFaucetConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageFaucetConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: FaucetConnectorFactory\n\t};\n}\n"]}
|
|
@@ -6,6 +6,7 @@ import { FederatedCatalogueRestClient } from "@twin.org/federated-catalogue-rest
|
|
|
6
6
|
import { FederatedCatalogueService, initSchema as initSchemaFederatedCatalogue } from "@twin.org/federated-catalogue-service";
|
|
7
7
|
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
8
8
|
import { FederatedCatalogueComponentType } from "../models/types/federatedCatalogueComponentType.js";
|
|
9
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
9
10
|
/**
|
|
10
11
|
* Initialise the federated catalogue component.
|
|
11
12
|
* @param engineCore The engine core.
|
|
@@ -13,25 +14,28 @@ import { FederatedCatalogueComponentType } from "../models/types/federatedCatalo
|
|
|
13
14
|
* @param instanceConfig The instance config.
|
|
14
15
|
* @returns The instance created and the factory for it.
|
|
15
16
|
*/
|
|
16
|
-
export
|
|
17
|
-
let
|
|
18
|
-
let
|
|
17
|
+
export function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig) {
|
|
18
|
+
let createComponent;
|
|
19
|
+
let instanceTypeName;
|
|
19
20
|
if (instanceConfig.type === FederatedCatalogueComponentType.Service) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
createComponent = (createConfig) => {
|
|
22
|
+
initSchemaFederatedCatalogue();
|
|
23
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.datasetEntityStorageType, "Dataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
24
|
+
return new FederatedCatalogueService(EngineTypeHelper.mergeConfig({
|
|
25
|
+
loggingComponentType: engineCore.getRegisteredLoggerType("FederatedCatalogueService"),
|
|
26
|
+
trustComponentType: engineCore.getRegisteredInstanceType("trustComponent"),
|
|
27
|
+
telemetryComponentType: engineCore.getRegisteredInstanceTypeOptional("telemetryComponent")
|
|
28
|
+
}, createConfig.options));
|
|
29
|
+
};
|
|
30
|
+
instanceTypeName = "federated-catalogue-service";
|
|
27
31
|
}
|
|
28
32
|
else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
createComponent = (createConfig) => new FederatedCatalogueRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
34
|
+
instanceTypeName = "federated-catalogue-rest-client";
|
|
31
35
|
}
|
|
32
36
|
return {
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
createComponent: createComponent,
|
|
38
|
+
instanceTypeName,
|
|
35
39
|
factory: ComponentFactory
|
|
36
40
|
};
|
|
37
41
|
}
|