@twin.org/engine-types 0.0.3-next.4 → 0.0.3-next.40
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 +41 -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 +18 -18
- 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 +57 -0
- package/dist/es/components/dataspaceControlPlane.js.map +1 -0
- package/dist/es/components/dataspaceDataPlane.js +62 -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 +48 -47
- package/dist/es/components/entityStorage.js.map +1 -1
- package/dist/es/components/eventBus.js +19 -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 +17 -18
- package/dist/es/components/federatedCatalogue.js.map +1 -1
- package/dist/es/components/federatedCatalogueFilter.js +34 -0
- package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
- 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 +28 -28
- package/dist/es/components/logging.js.map +1 -1
- package/dist/es/components/messaging.js +77 -89
- package/dist/es/components/messaging.js.map +1 -1
- package/dist/es/components/metricsCollector.js +27 -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/rightsManagementPap.js +17 -17
- package/dist/es/components/rightsManagementPap.js.map +1 -1
- package/dist/es/components/rightsManagementPdp.js +11 -26
- package/dist/es/components/rightsManagementPdp.js.map +1 -1
- package/dist/es/components/rightsManagementPep.js +12 -24
- package/dist/es/components/rightsManagementPep.js.map +1 -1
- package/dist/es/components/rightsManagementPip.js +9 -25
- package/dist/es/components/rightsManagementPip.js.map +1 -1
- package/dist/es/components/rightsManagementPmp.js +10 -10
- package/dist/es/components/rightsManagementPmp.js.map +1 -1
- package/dist/es/components/rightsManagementPnap.js +21 -18
- package/dist/es/components/rightsManagementPnap.js.map +1 -1
- package/dist/es/components/rightsManagementPnp.js +15 -36
- package/dist/es/components/rightsManagementPnp.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyArbiter.js +32 -0
- package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +33 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js +25 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js +34 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyNegotiator.js +27 -0
- package/dist/es/components/rightsManagementPolicyNegotiator.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyObligationEnforcer.js +27 -0
- package/dist/es/components/rightsManagementPolicyObligationEnforcer.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyRequester.js +25 -0
- package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
- package/dist/es/components/rightsManagementPxp.js +9 -25
- package/dist/es/components/rightsManagementPxp.js.map +1 -1
- package/dist/es/components/synchronisedStorage.js +25 -23
- package/dist/es/components/synchronisedStorage.js.map +1 -1
- package/dist/es/components/taskScheduler.js +17 -11
- package/dist/es/components/taskScheduler.js.map +1 -1
- package/dist/es/components/telemetry.js +46 -32
- 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 +27 -0
- package/dist/es/components/trust.js.map +1 -0
- package/dist/es/components/trustGenerator.js +28 -0
- package/dist/es/components/trustGenerator.js.map +1 -0
- package/dist/es/components/trustVerifier.js +28 -0
- package/dist/es/components/trustVerifier.js.map +1 -0
- package/dist/es/components/urlTransformer.js +29 -0
- package/dist/es/components/urlTransformer.js.map +1 -0
- package/dist/es/components/vault.js +15 -12
- package/dist/es/components/vault.js.map +1 -1
- package/dist/es/components/verifiableStorage.js +32 -34
- package/dist/es/components/verifiableStorage.js.map +1 -1
- package/dist/es/components/wallet.js +23 -24
- package/dist/es/components/wallet.js.map +1 -1
- package/dist/es/index.js +64 -14
- 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/backgroundTaskComponentConfig.js +2 -0
- package/dist/es/models/config/backgroundTaskComponentConfig.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/federatedCatalogueFilterComponentConfig.js +2 -0
- package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js.map +1 -0
- 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/rightsManagementPdpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js.map +1 -0
- 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 +2 -0
- package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -1
- package/dist/es/models/config/telemetryConnectorConfig.js.map +1 -1
- package/dist/es/models/config/trustComponentConfig.js +2 -0
- package/dist/es/models/config/trustComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js +2 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js +2 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -0
- package/dist/es/models/config/urlTransformerComponentConfig.js +2 -0
- package/dist/es/models/config/urlTransformerComponentConfig.js.map +1 -0
- package/dist/es/models/types/automationActionType.js +13 -0
- package/dist/es/models/types/automationActionType.js.map +1 -0
- package/dist/es/models/types/{rightsManagementDapComponentType.js → automationComponentType.js} +4 -4
- package/dist/es/models/types/automationComponentType.js.map +1 -0
- package/dist/es/models/types/{rightsManagementDarpComponentType.js → backgroundTaskComponentType.js} +3 -3
- package/dist/es/models/types/backgroundTaskComponentType.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/federatedCatalogueFilterComponentType.js +13 -0
- package/dist/es/models/types/federatedCatalogueFilterComponentType.js.map +1 -0
- package/dist/es/models/types/healthComponentType.js +17 -0
- 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/notarizationComponentType.js +17 -0
- package/dist/es/models/types/notarizationComponentType.js.map +1 -0
- package/dist/es/models/types/notarizationConnectorType.js +17 -0
- package/dist/es/models/types/notarizationConnectorType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js.map +1 -0
- 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 +13 -0
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.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/trustComponentType.js +13 -0
- package/dist/es/models/types/trustComponentType.js.map +1 -0
- package/dist/es/models/types/trustGeneratorComponentType.js +13 -0
- package/dist/es/models/types/trustGeneratorComponentType.js.map +1 -0
- package/dist/es/models/types/trustVerifierComponentType.js +13 -0
- package/dist/es/models/types/trustVerifierComponentType.js.map +1 -0
- package/dist/es/models/types/urlTransformerComponentType.js +13 -0
- package/dist/es/models/types/urlTransformerComponentType.js.map +1 -0
- 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 +5 -10
- 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 +4 -9
- 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 +12 -0
- 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/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 +12 -0
- package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyObligationEnforcer.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyRequester.d.ts +12 -0
- package/dist/types/components/rightsManagementPxp.d.ts +3 -7
- package/dist/types/components/synchronisedStorage.d.ts +3 -7
- 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 +12 -0
- package/dist/types/components/trustGenerator.d.ts +12 -0
- package/dist/types/components/trustVerifier.d.ts +12 -0
- package/dist/types/components/urlTransformer.d.ts +12 -0
- package/dist/types/components/vault.d.ts +2 -7
- package/dist/types/components/verifiableStorage.d.ts +4 -12
- package/dist/types/components/wallet.d.ts +2 -7
- package/dist/types/index.d.ts +64 -14
- package/dist/types/models/IEngineConfig.d.ts +100 -15
- 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/backgroundTaskComponentConfig.d.ts +9 -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/federatedCatalogueFilterComponentConfig.d.ts +9 -0
- 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/rightsManagementPdpComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +1 -5
- package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPolicyExecutionActionComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyInformationSourceComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPolicyNegotiatorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyRequesterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +1 -4
- package/dist/types/models/config/telemetryConnectorConfig.d.ts +4 -0
- package/dist/types/models/config/trustComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustGeneratorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustVerifierComponentConfig.d.ts +9 -0
- package/dist/types/models/config/urlTransformerComponentConfig.d.ts +9 -0
- 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/backgroundTaskComponentType.d.ts +13 -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/federatedCatalogueFilterComponentType.d.ts +13 -0
- 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/rightsManagementPolicyArbiterComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyExecutionActionComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyInformationSourceComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyNegotiatorComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyObligationEnforcerComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyRequesterComponentType.d.ts +13 -0
- package/dist/types/models/types/telemetryConnectorType.d.ts +4 -0
- package/dist/types/models/types/trustComponentType.d.ts +13 -0
- package/dist/types/models/types/trustGeneratorComponentType.d.ts +13 -0
- package/dist/types/models/types/trustVerifierComponentType.d.ts +13 -0
- package/dist/types/models/types/urlTransformerComponentType.d.ts +13 -0
- package/dist/types/utils/engineTypeHelper.d.ts +11 -0
- package/docs/changelog.md +783 -148
- 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 +31 -0
- 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 +2 -2
- 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 +31 -0
- 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/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 +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyEnforcementProcessorComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyExecutionActionComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyInformationSourceComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyNegotiatorComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyObligationEnforcerComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +2 -2
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +2 -2
- 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 +31 -0
- package/docs/reference/functions/initialiseTrustGeneratorComponent.md +31 -0
- package/docs/reference/functions/initialiseTrustVerifierComponent.md +31 -0
- package/docs/reference/functions/initialiseUrlTransformerComponent.md +31 -0
- package/docs/reference/functions/initialiseVaultConnector.md +2 -2
- package/docs/reference/functions/initialiseVerifiableStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseVerifiableStorageConnector.md +2 -2
- package/docs/reference/functions/initialiseWalletConnector.md +2 -2
- package/docs/reference/index.md +88 -20
- package/docs/reference/interfaces/IEngineConfig.md +206 -68
- 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 +17 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
- 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/EventBusConnectorConfig.md +3 -3
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentType.md +5 -0
- 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/RightsManagementPdpComponentConfig.md +3 -9
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +3 -9
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +3 -9
- 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 +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentType.md +5 -0
- 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 +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +3 -9
- 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 +17 -0
- package/docs/reference/type-aliases/TrustComponentType.md +5 -0
- package/docs/reference/type-aliases/TrustGeneratorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TrustGeneratorComponentType.md +5 -0
- package/docs/reference/type-aliases/TrustVerifierComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TrustVerifierComponentType.md +5 -0
- package/docs/reference/type-aliases/UrlTransformerComponentConfig.md +17 -0
- package/docs/reference/type-aliases/UrlTransformerComponentType.md +5 -0
- 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 +13 -0
- 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 -10
- package/docs/reference/variables/EventBusComponentType.md +2 -2
- package/docs/reference/variables/EventBusConnectorType.md +1 -1
- package/docs/reference/variables/FaucetConnectorType.md +2 -2
- package/docs/reference/variables/FederatedCatalogueComponentType.md +2 -2
- package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
- package/docs/reference/variables/HealthComponentType.md +19 -0
- 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/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 +19 -0
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyObligationEnforcerComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
- package/docs/reference/variables/SynchronisedStorageComponentType.md +2 -2
- package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
- package/docs/reference/variables/TelemetryComponentType.md +2 -2
- package/docs/reference/variables/TelemetryConnectorType.md +7 -1
- package/docs/reference/variables/TenantAdminComponentType.md +1 -1
- package/docs/reference/variables/TrustComponentType.md +13 -0
- package/docs/reference/variables/TrustGeneratorComponentType.md +13 -0
- package/docs/reference/variables/TrustVerifierComponentType.md +13 -0
- package/docs/reference/variables/UrlTransformerComponentType.md +13 -0
- package/docs/reference/variables/VaultConnectorType.md +2 -2
- package/docs/reference/variables/VerifiableStorageComponentType.md +2 -2
- package/docs/reference/variables/VerifiableStorageConnectorType.md +2 -2
- package/docs/reference/variables/WalletConnectorType.md +2 -2
- package/package.json +32 -12
- package/dist/es/components/authenticationGenerator.js +0 -30
- package/dist/es/components/authenticationGenerator.js.map +0 -1
- package/dist/es/components/dataSpaceConnector.js +0 -52
- package/dist/es/components/dataSpaceConnector.js.map +0 -1
- package/dist/es/components/rightsManagementDap.js +0 -38
- package/dist/es/components/rightsManagementDap.js.map +0 -1
- package/dist/es/components/rightsManagementDarp.js +0 -29
- package/dist/es/components/rightsManagementDarp.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/backgroundTaskConnectorConfig.js +0 -2
- package/dist/es/models/config/backgroundTaskConnectorConfig.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/types/authenticationGeneratorComponentType.js +0 -13
- package/dist/es/models/types/authenticationGeneratorComponentType.js.map +0 -1
- package/dist/es/models/types/backgroundTaskConnectorType.js +0 -13
- package/dist/es/models/types/backgroundTaskConnectorType.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.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/models/config/authenticationGeneratorComponentConfig.d.ts +0 -9
- package/dist/types/models/config/backgroundTaskConnectorConfig.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 -12
- package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +0 -13
- package/dist/types/models/types/backgroundTaskConnectorType.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/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +0 -31
- package/docs/reference/functions/initialiseBackgroundTaskConnector.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/type-aliases/AuthenticationGeneratorComponentConfig.md +0 -17
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +0 -5
- package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
- package/docs/reference/type-aliases/BackgroundTaskConnectorType.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/RightsManagementDapComponentConfig.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDapComponentType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +0 -23
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +0 -5
- package/docs/reference/variables/AuthenticationGeneratorComponentType.md +0 -13
- package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
- package/docs/reference/variables/RightsManagementDapComponentType.md +0 -19
- package/docs/reference/variables/RightsManagementDarpComponentType.md +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AACh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E,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;aACxF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,wBAAwB,CAC3B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,gCAA4C,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { ImmutableProofRestClient } from \"@twin.org/immutable-proof-rest-client\";\nimport {\n\ttype ImmutableProof,\n\tImmutableProofService,\n\tinitSchema as initSchemaImmutableProof\n} from \"@twin.org/immutable-proof-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { ImmutableProofComponentConfig } from \"../models/config/immutableProofComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ImmutableProofComponentType } from \"../models/types/immutableProofComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the immutable proof 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 initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaImmutableProof();\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.immutableProofEntityStorageType,\n\t\t\t\tnameof<ImmutableProof>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new ImmutableProofService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"verifiableStorageConnector\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\tbackgroundTaskComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\t\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\")\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(ImmutableProofService);\n\t} else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ImmutableProofRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(ImmutableProofRestClient);\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"]}
|
|
@@ -10,6 +10,7 @@ import { LoggingService } from "@twin.org/logging-service";
|
|
|
10
10
|
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
11
11
|
import { LoggingComponentType } from "../models/types/loggingComponentType.js";
|
|
12
12
|
import { LoggingConnectorType } from "../models/types/loggingConnectorType.js";
|
|
13
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
13
14
|
/**
|
|
14
15
|
* Initialise the logging connector.
|
|
15
16
|
* @param engineCore The engine core.
|
|
@@ -17,29 +18,31 @@ import { LoggingConnectorType } from "../models/types/loggingConnectorType.js";
|
|
|
17
18
|
* @param instanceConfig The instance config.
|
|
18
19
|
* @returns The instance created and the factory for it.
|
|
19
20
|
*/
|
|
20
|
-
export
|
|
21
|
-
let
|
|
22
|
-
let
|
|
21
|
+
export function initialiseLoggingConnector(engineCore, context, instanceConfig) {
|
|
22
|
+
let createComponent;
|
|
23
|
+
let instanceTypeName;
|
|
23
24
|
if (instanceConfig.type === LoggingConnectorType.Console) {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
createComponent = (createConfig) => new ConsoleLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
26
|
+
instanceTypeName = ConsoleLoggingConnector.NAMESPACE;
|
|
26
27
|
}
|
|
27
28
|
else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
createComponent = (createConfig) => {
|
|
30
|
+
initSchemaLogging();
|
|
31
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.logEntryStorageConnectorType, "LogEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
32
|
+
ContextIdKeys.Node,
|
|
33
|
+
ContextIdKeys.Tenant
|
|
34
|
+
]));
|
|
35
|
+
return new EntityStorageLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
36
|
+
};
|
|
37
|
+
instanceTypeName = EntityStorageLoggingConnector.NAMESPACE;
|
|
35
38
|
}
|
|
36
39
|
else if (instanceConfig.type === LoggingConnectorType.Multi) {
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
createComponent = (createConfig) => new MultiLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
41
|
+
instanceTypeName = MultiLoggingConnector.NAMESPACE;
|
|
39
42
|
}
|
|
40
43
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
createComponent: createComponent,
|
|
45
|
+
instanceTypeName,
|
|
43
46
|
factory: LoggingConnectorFactory
|
|
44
47
|
};
|
|
45
48
|
}
|
|
@@ -50,23 +53,20 @@ export async function initialiseLoggingConnector(engineCore, context, instanceCo
|
|
|
50
53
|
* @param instanceConfig The instance config.
|
|
51
54
|
* @returns The instance created and the factory for it.
|
|
52
55
|
*/
|
|
53
|
-
export
|
|
54
|
-
let
|
|
55
|
-
let
|
|
56
|
+
export function initialiseLoggingComponent(engineCore, context, instanceConfig) {
|
|
57
|
+
let createComponent;
|
|
58
|
+
let instanceTypeName;
|
|
56
59
|
if (instanceConfig.type === LoggingComponentType.Service) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
...instanceConfig.options
|
|
60
|
-
});
|
|
61
|
-
instanceType = "logging-service";
|
|
60
|
+
createComponent = (createConfig) => new LoggingService(EngineTypeHelper.mergeConfig({ loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector") }, createConfig.options));
|
|
61
|
+
instanceTypeName = "logging-service";
|
|
62
62
|
}
|
|
63
63
|
else if (instanceConfig.type === LoggingComponentType.RestClient) {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
createComponent = (createConfig) => new LoggingRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
65
|
+
instanceTypeName = "logging-rest-client";
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
createComponent: createComponent,
|
|
69
|
+
instanceTypeName,
|
|
70
70
|
factory: ComponentFactory
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/components/logging.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;
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/components/logging.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;AAMnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,UAAU,IAAI,iBAAiB,EAE/B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/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H,gBAAgB,GAAG,qBAAqB,CAAC,SAAS,CAAC;IACpD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,uBAAuB;KAChC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACzC,UAAsC,EACtC,OAA0C,EAC1C,cAAsC;IAEtC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;QAC1D,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,cAAc,CACjB,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,oBAAkC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,UAAU,EAAE,CAAC;QACpE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,iBAAiB,CACpB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,wBAAqC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { ConsoleLoggingConnector } from \"@twin.org/logging-connector-console\";\nimport {\n\tEntityStorageLoggingConnector,\n\tinitSchema as initSchemaLogging,\n\ttype LogEntry\n} from \"@twin.org/logging-connector-entity-storage\";\nimport { LoggingConnectorFactory, MultiLoggingConnector } from \"@twin.org/logging-models\";\nimport { LoggingRestClient } from \"@twin.org/logging-rest-client\";\nimport { LoggingService } from \"@twin.org/logging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { LoggingComponentConfig } from \"../models/config/loggingComponentConfig.js\";\nimport type { LoggingConnectorConfig } from \"../models/config/loggingConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { LoggingComponentType } from \"../models/types/loggingComponentType.js\";\nimport { LoggingConnectorType } from \"../models/types/loggingConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the logging connector.\n * @param engineCore The engine core.\n * @param context The engine core context.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseLoggingConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof LoggingConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === LoggingConnectorType.Console) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ConsoleLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = ConsoleLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaLogging();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.logEntryStorageConnectorType,\n\t\t\t\tnameof<LogEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.Multi) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MultiLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = MultiLoggingConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: LoggingConnectorFactory\n\t};\n}\n\n/**\n * Initialise the logging 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 initialiseLoggingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === LoggingComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingConnectorType: engineCore.getRegisteredInstanceType(\"loggingConnector\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingService);\n\t} else if (instanceConfig.type === LoggingComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingRestClient);\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,6 +12,7 @@ import { MessagingComponentType } from "../models/types/messagingComponentType.j
|
|
|
12
12
|
import { MessagingEmailConnectorType } from "../models/types/messagingEmailConnectorType.js";
|
|
13
13
|
import { MessagingPushNotificationConnectorType } from "../models/types/messagingPushNotificationConnectorType.js";
|
|
14
14
|
import { MessagingSmsConnectorType } from "../models/types/messagingSmsConnectorType.js";
|
|
15
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
15
16
|
/**
|
|
16
17
|
* Initialise a messaging email connector.
|
|
17
18
|
* @param engineCore The engine core.
|
|
@@ -19,31 +20,27 @@ import { MessagingSmsConnectorType } from "../models/types/messagingSmsConnector
|
|
|
19
20
|
* @param instanceConfig The instance config.
|
|
20
21
|
* @returns The instance created and the factory for it.
|
|
21
22
|
*/
|
|
22
|
-
export
|
|
23
|
-
let
|
|
24
|
-
let
|
|
23
|
+
export function initialiseMessagingEmailConnector(engineCore, context, instanceConfig) {
|
|
24
|
+
let createComponent;
|
|
25
|
+
let instanceTypeName;
|
|
25
26
|
if (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
27
|
+
createComponent = (createConfig) => {
|
|
28
|
+
initSchema({ email: true, sms: false, pushNotification: false });
|
|
29
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
30
|
+
ContextIdKeys.Node,
|
|
31
|
+
ContextIdKeys.Tenant
|
|
32
|
+
]));
|
|
33
|
+
return new EntityStorageMessagingEmailConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
34
|
+
};
|
|
35
|
+
instanceTypeName = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
36
36
|
}
|
|
37
37
|
else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...instanceConfig.options
|
|
41
|
-
});
|
|
42
|
-
instanceType = AwsMessagingEmailConnector.NAMESPACE;
|
|
38
|
+
createComponent = (createConfig) => new AwsMessagingEmailConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
39
|
+
instanceTypeName = AwsMessagingEmailConnector.NAMESPACE;
|
|
43
40
|
}
|
|
44
41
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
createComponent: createComponent,
|
|
43
|
+
instanceTypeName,
|
|
47
44
|
factory: MessagingEmailConnectorFactory
|
|
48
45
|
};
|
|
49
46
|
}
|
|
@@ -54,32 +51,28 @@ export async function initialiseMessagingEmailConnector(engineCore, context, ins
|
|
|
54
51
|
* @param instanceConfig The instance config.
|
|
55
52
|
* @returns The instance created and the factory for it.
|
|
56
53
|
*/
|
|
57
|
-
export
|
|
58
|
-
let
|
|
59
|
-
let
|
|
54
|
+
export function initialiseMessagingSmsConnector(engineCore, context, instanceConfig) {
|
|
55
|
+
let createComponent;
|
|
56
|
+
let instanceTypeName;
|
|
60
57
|
if (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
58
|
+
createComponent = (createConfig) => {
|
|
59
|
+
initSchema({ email: false, sms: true, pushNotification: false });
|
|
60
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
61
|
+
ContextIdKeys.Node,
|
|
62
|
+
ContextIdKeys.Tenant
|
|
63
|
+
]));
|
|
64
|
+
return new EntityStorageMessagingSmsConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
65
|
+
};
|
|
66
|
+
instanceTypeName = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
71
67
|
}
|
|
72
68
|
else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
...instanceConfig.options
|
|
76
|
-
});
|
|
77
|
-
instanceType = AwsMessagingSmsConnector.NAMESPACE;
|
|
69
|
+
createComponent = (createConfig) => new AwsMessagingSmsConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
70
|
+
instanceTypeName = AwsMessagingSmsConnector.NAMESPACE;
|
|
78
71
|
}
|
|
79
72
|
return {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
createComponent: createComponent,
|
|
74
|
+
instanceTypeName,
|
|
75
|
+
factory: MessagingSmsConnectorFactory
|
|
83
76
|
};
|
|
84
77
|
}
|
|
85
78
|
/**
|
|
@@ -89,35 +82,31 @@ export async function initialiseMessagingSmsConnector(engineCore, context, insta
|
|
|
89
82
|
* @param instanceConfig The instance config.
|
|
90
83
|
* @returns The instance created and the factory for it.
|
|
91
84
|
*/
|
|
92
|
-
export
|
|
93
|
-
let
|
|
94
|
-
let
|
|
85
|
+
export function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig) {
|
|
86
|
+
let createComponent;
|
|
87
|
+
let instanceTypeName;
|
|
95
88
|
if (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
89
|
+
createComponent = (createConfig) => {
|
|
90
|
+
initSchema({ email: false, sms: false, pushNotification: true });
|
|
91
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
92
|
+
ContextIdKeys.Node,
|
|
93
|
+
ContextIdKeys.Tenant
|
|
94
|
+
]));
|
|
95
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
96
|
+
ContextIdKeys.Node,
|
|
97
|
+
ContextIdKeys.Tenant
|
|
98
|
+
]));
|
|
99
|
+
return new EntityStorageMessagingPushNotificationConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
100
|
+
};
|
|
101
|
+
instanceTypeName = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
110
102
|
}
|
|
111
103
|
else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
...instanceConfig.options
|
|
115
|
-
});
|
|
116
|
-
instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
104
|
+
createComponent = (createConfig) => new AwsMessagingPushNotificationConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
105
|
+
instanceTypeName = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
117
106
|
}
|
|
118
107
|
return {
|
|
119
|
-
|
|
120
|
-
|
|
108
|
+
createComponent: createComponent,
|
|
109
|
+
instanceTypeName,
|
|
121
110
|
factory: MessagingPushNotificationsConnectorFactory
|
|
122
111
|
};
|
|
123
112
|
}
|
|
@@ -128,22 +117,21 @@ export async function initialiseMessagingPushNotificationConnector(engineCore, c
|
|
|
128
117
|
* @param instanceConfig The instance config.
|
|
129
118
|
* @returns The instance created and the factory for it.
|
|
130
119
|
*/
|
|
131
|
-
export
|
|
132
|
-
let
|
|
133
|
-
let
|
|
120
|
+
export function initialiseMessagingComponent(engineCore, context, instanceConfig) {
|
|
121
|
+
let createComponent;
|
|
122
|
+
let instanceTypeName;
|
|
134
123
|
if (instanceConfig.type === MessagingComponentType.Service) {
|
|
135
|
-
|
|
124
|
+
createComponent = (createConfig) => new MessagingService(EngineTypeHelper.mergeConfig({
|
|
136
125
|
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
137
126
|
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
138
127
|
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
139
|
-
messagingAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("messagingAdminComponent")
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
instanceType = "messaging-service";
|
|
128
|
+
messagingAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("messagingAdminComponent")
|
|
129
|
+
}, createConfig.options));
|
|
130
|
+
instanceTypeName = "messaging-service";
|
|
143
131
|
}
|
|
144
132
|
return {
|
|
145
|
-
|
|
146
|
-
|
|
133
|
+
createComponent,
|
|
134
|
+
instanceTypeName,
|
|
147
135
|
factory: ComponentFactory
|
|
148
136
|
};
|
|
149
137
|
}
|
|
@@ -154,23 +142,23 @@ export async function initialiseMessagingComponent(engineCore, context, instance
|
|
|
154
142
|
* @param instanceConfig The instance config.
|
|
155
143
|
* @returns The instance created and the factory for it.
|
|
156
144
|
*/
|
|
157
|
-
export
|
|
158
|
-
let
|
|
159
|
-
let
|
|
145
|
+
export function initialiseMessagingAdminComponent(engineCore, context, instanceConfig) {
|
|
146
|
+
let createComponent;
|
|
147
|
+
let instanceTypeName;
|
|
160
148
|
if (instanceConfig.type === MessagingAdminComponentType.Service) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
149
|
+
createComponent = (createConfig) => {
|
|
150
|
+
initSchemaMessagingService();
|
|
151
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.templateEntryStorageConnectorType, "TemplateEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
152
|
+
ContextIdKeys.Node,
|
|
153
|
+
ContextIdKeys.Tenant
|
|
154
|
+
]));
|
|
155
|
+
return new MessagingAdminService(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
156
|
+
};
|
|
157
|
+
instanceTypeName = "messaging-admin-service";
|
|
170
158
|
}
|
|
171
159
|
return {
|
|
172
|
-
|
|
173
|
-
|
|
160
|
+
createComponent,
|
|
161
|
+
instanceTypeName,
|
|
174
162
|
factory: ComponentFactory
|
|
175
163
|
};
|
|
176
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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G,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,sBAAoC,CAAC;IAClD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,0BAA0B,EAAE,CAAC;QAE7B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,iCAAiC,mBAEzD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,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 { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport {\n\tAwsMessagingEmailConnector,\n\tAwsMessagingPushNotificationConnector,\n\tAwsMessagingSmsConnector\n} from \"@twin.org/messaging-connector-aws\";\nimport {\n\ttype EmailEntry,\n\tEntityStorageMessagingEmailConnector,\n\tEntityStorageMessagingPushNotificationConnector,\n\tEntityStorageMessagingSmsConnector,\n\tinitSchema,\n\ttype PushNotificationDeviceEntry,\n\ttype PushNotificationMessageEntry,\n\ttype SmsEntry\n} from \"@twin.org/messaging-connector-entity-storage\";\nimport {\n\ttype IMessagingAdminComponent,\n\ttype IMessagingComponent,\n\ttype IMessagingEmailConnector,\n\ttype IMessagingPushNotificationsConnector,\n\ttype IMessagingSmsConnector,\n\tMessagingEmailConnectorFactory,\n\tMessagingPushNotificationsConnectorFactory,\n\tMessagingSmsConnectorFactory\n} from \"@twin.org/messaging-models\";\nimport {\n\tinitSchema as initSchemaMessagingService,\n\tMessagingAdminService,\n\tMessagingService,\n\ttype TemplateEntry\n} from \"@twin.org/messaging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { MessagingAdminComponentConfig } from \"../models/config/messagingAdminComponentConfig.js\";\nimport type { MessagingComponentConfig } from \"../models/config/messagingComponentConfig.js\";\nimport type { MessagingEmailConnectorConfig } from \"../models/config/messagingEmailConnectorConfig.js\";\nimport type { MessagingPushNotificationConnectorConfig } from \"../models/config/messagingPushNotificationConnectorConfig.js\";\nimport type { MessagingSmsConnectorConfig } from \"../models/config/messagingSmsConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MessagingAdminComponentType } from \"../models/types/messagingAdminComponentType.js\";\nimport { MessagingComponentType } from \"../models/types/messagingComponentType.js\";\nimport { MessagingEmailConnectorType } from \"../models/types/messagingEmailConnectorType.js\";\nimport { MessagingPushNotificationConnectorType } from \"../models/types/messagingPushNotificationConnectorType.js\";\nimport { MessagingSmsConnectorType } from \"../models/types/messagingSmsConnectorType.js\";\n\n/**\n * Initialise a messaging email 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 initialiseMessagingEmailConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingEmailConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingEmailConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingEmailConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {\n\t\tinitSchema({ email: true, sms: false, pushNotification: false });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingEmailEntryStorageConnectorType,\n\t\t\tnameof<EmailEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\t\tcomponent = new EntityStorageMessagingEmailConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingEmailConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {\n\t\tcomponent = new AwsMessagingEmailConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingEmailConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: MessagingEmailConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging sms 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 initialiseMessagingSmsConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingSmsConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingSmsConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet connector: IMessagingSmsConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {\n\t\tinitSchema({ email: false, sms: true, pushNotification: false });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingSmsEntryStorageConnectorType,\n\t\t\tnameof<SmsEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\t\tconnector = new EntityStorageMessagingSmsConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingSmsConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {\n\t\tconnector = new AwsMessagingSmsConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingSmsConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tinstanceType,\n\t\tfactory: MessagingSmsConnectorFactory,\n\t\tcomponent: connector\n\t};\n}\n\n/**\n * Initialise a messaging push notification 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 initialiseMessagingPushNotificationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingPushNotificationConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingPushNotificationsConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingPushNotificationsConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {\n\t\tinitSchema({ email: false, sms: false, pushNotification: true });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingDeviceEntryStorageConnectorType,\n\t\t\tnameof<PushNotificationDeviceEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingMessageEntryStorageConnectorType,\n\t\t\tnameof<PushNotificationMessageEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\t\tcomponent = new EntityStorageMessagingPushNotificationConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {\n\t\tcomponent = new AwsMessagingPushNotificationConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingPushNotificationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: MessagingPushNotificationsConnectorFactory\n\t};\n}\n\n/**\n * Initialise the messaging 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 async function initialiseMessagingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingComponentType.Service) {\n\t\tcomponent = new MessagingService({\n\t\t\tmessagingEmailConnectorType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingEmailConnector\"),\n\t\t\tmessagingSmsConnectorType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingSmsConnector\"),\n\t\t\tmessagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\"messagingNotificationConnector\"\n\t\t\t),\n\t\t\tmessagingAdminComponentType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingAdminComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(MessagingService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n\n/**\n * Initialise the messaging admin 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 async function initialiseMessagingAdminComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingAdminComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingAdminComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingAdminComponentType.Service) {\n\t\tinitSchemaMessagingService();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.templateEntryStorageConnectorType,\n\t\t\tnameof<TemplateEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new MessagingAdminService({\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(MessagingAdminService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/components/messaging.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EACN,0BAA0B,EAC1B,qCAAqC,EACrC,wBAAwB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEN,oCAAoC,EACpC,+CAA+C,EAC/C,kCAAkC,EAClC,UAAU,EAIV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,8BAA8B,EAC9B,0CAA0C,EAC1C,4BAA4B,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,UAAU,IAAI,0BAA0B,EACxC,qBAAqB,EACrB,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,sCAAsC,EAAE,MAAM,2DAA2D,CAAC;AACnH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAChD,UAA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U,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,iCAAiC,mBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YACF,OAAO,IAAI,qBAAqB,CAC/B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport {\n\tAwsMessagingEmailConnector,\n\tAwsMessagingPushNotificationConnector,\n\tAwsMessagingSmsConnector\n} from \"@twin.org/messaging-connector-aws\";\nimport {\n\ttype EmailEntry,\n\tEntityStorageMessagingEmailConnector,\n\tEntityStorageMessagingPushNotificationConnector,\n\tEntityStorageMessagingSmsConnector,\n\tinitSchema,\n\ttype PushNotificationDeviceEntry,\n\ttype PushNotificationMessageEntry,\n\ttype SmsEntry\n} from \"@twin.org/messaging-connector-entity-storage\";\nimport {\n\tMessagingEmailConnectorFactory,\n\tMessagingPushNotificationsConnectorFactory,\n\tMessagingSmsConnectorFactory\n} from \"@twin.org/messaging-models\";\nimport {\n\tinitSchema as initSchemaMessagingService,\n\tMessagingAdminService,\n\tMessagingService,\n\ttype TemplateEntry\n} from \"@twin.org/messaging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { MessagingAdminComponentConfig } from \"../models/config/messagingAdminComponentConfig.js\";\nimport type { MessagingComponentConfig } from \"../models/config/messagingComponentConfig.js\";\nimport type { MessagingEmailConnectorConfig } from \"../models/config/messagingEmailConnectorConfig.js\";\nimport type { MessagingPushNotificationConnectorConfig } from \"../models/config/messagingPushNotificationConnectorConfig.js\";\nimport type { MessagingSmsConnectorConfig } from \"../models/config/messagingSmsConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MessagingAdminComponentType } from \"../models/types/messagingAdminComponentType.js\";\nimport { MessagingComponentType } from \"../models/types/messagingComponentType.js\";\nimport { MessagingEmailConnectorType } from \"../models/types/messagingEmailConnectorType.js\";\nimport { MessagingPushNotificationConnectorType } from \"../models/types/messagingPushNotificationConnectorType.js\";\nimport { MessagingSmsConnectorType } from \"../models/types/messagingSmsConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a messaging email 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 initialiseMessagingEmailConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingEmailConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MessagingEmailConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: true, sms: false, pushNotification: false });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingEmailEntryStorageConnectorType,\n\t\t\t\tnameof<EmailEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingEmailConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingEmailConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingEmailConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingEmailConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingEmailConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging sms 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 initialiseMessagingSmsConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingSmsConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MessagingSmsConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: false, sms: true, pushNotification: false });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingSmsEntryStorageConnectorType,\n\t\t\t\tnameof<SmsEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingSmsConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingSmsConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingSmsConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingSmsConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingSmsConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging push notification 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 initialiseMessagingPushNotificationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingPushNotificationConnectorConfig\n): EngineTypeInitialiserReturn<\n\ttypeof instanceConfig,\n\ttypeof MessagingPushNotificationsConnectorFactory\n> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: false, sms: false, pushNotification: true });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingDeviceEntryStorageConnectorType,\n\t\t\t\tnameof<PushNotificationDeviceEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingMessageEntryStorageConnectorType,\n\t\t\t\tnameof<PushNotificationMessageEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingPushNotificationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingPushNotificationConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingPushNotificationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingPushNotificationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingPushNotificationsConnectorFactory\n\t};\n}\n\n/**\n * Initialise the messaging 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 initialiseMessagingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MessagingService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tmessagingEmailConnectorType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingEmailConnector\"),\n\t\t\t\t\t\tmessagingSmsConnectorType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingSmsConnector\"),\n\t\t\t\t\t\tmessagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"messagingNotificationConnector\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmessagingAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingAdminComponent\")\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(MessagingService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n\n/**\n * Initialise the messaging admin 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 initialiseMessagingAdminComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingAdminComponentConfig\n): EngineTypeInitialiserReturn<MessagingAdminComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingAdminComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaMessagingService();\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.templateEntryStorageConnectorType,\n\t\t\t\tnameof<TemplateEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new MessagingAdminService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(MessagingAdminService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
4
|
+
import { MetricsCollectorService } from "@twin.org/telemetry-service";
|
|
5
|
+
import { MetricsCollectorComponentType } from "../models/types/metricsCollectorComponentType.js";
|
|
6
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
7
|
+
/**
|
|
8
|
+
* Initialise the metrics collector orchestrator component.
|
|
9
|
+
* @param engineCore The engine core.
|
|
10
|
+
* @param context The context for the engine.
|
|
11
|
+
* @param instanceConfig The instance config.
|
|
12
|
+
* @returns The instance created and the factory for it.
|
|
13
|
+
*/
|
|
14
|
+
export function initialiseMetricsCollectorComponent(engineCore, context, instanceConfig) {
|
|
15
|
+
let createComponent;
|
|
16
|
+
let instanceTypeName;
|
|
17
|
+
if (instanceConfig.type === MetricsCollectorComponentType.Service) {
|
|
18
|
+
createComponent = (createConfig) => new MetricsCollectorService(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
19
|
+
instanceTypeName = "metrics-collector-service";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
createComponent,
|
|
23
|
+
instanceTypeName,
|
|
24
|
+
factory: ComponentFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=metricsCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metricsCollector.js","sourceRoot":"","sources":["../../../src/components/metricsCollector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,mCAAmC,CAClD,UAAsC,EACtC,OAA0C,EAC1C,cAA+C;IAE/C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,6BAA6B,CAAC,OAAO,EAAE,CAAC;QACnE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,uBAAuB,CAC1B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,8BAA2C,CAAC;IAC7D,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { MetricsCollectorService } from \"@twin.org/telemetry-service\";\nimport type { MetricsCollectorComponentConfig } from \"../models/config/metricsCollectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MetricsCollectorComponentType } from \"../models/types/metricsCollectorComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the metrics collector orchestrator 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 initialiseMetricsCollectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MetricsCollectorComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MetricsCollectorComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MetricsCollectorService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(MetricsCollectorService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MetricsProducerFactory } from "@twin.org/telemetry-models";
|
|
2
|
+
import { ProcessMetricsProducer, SystemMetricsProducer } from "@twin.org/telemetry-producers";
|
|
3
|
+
import { MetricsProducerComponentType } from "../models/types/metricsProducerComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise a metrics producer.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseMetricsProducerComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === MetricsProducerComponentType.System) {
|
|
16
|
+
createComponent = (createConfig) => new SystemMetricsProducer(EngineTypeHelper.mergeConfig({
|
|
17
|
+
telemetryComponentType: engineCore.getRegisteredInstanceType("telemetryComponent")
|
|
18
|
+
}, createConfig.options));
|
|
19
|
+
instanceTypeName = "system-metrics-producer";
|
|
20
|
+
}
|
|
21
|
+
else if (instanceConfig.type === MetricsProducerComponentType.Process) {
|
|
22
|
+
createComponent = (createConfig) => new ProcessMetricsProducer(EngineTypeHelper.mergeConfig({
|
|
23
|
+
telemetryComponentType: engineCore.getRegisteredInstanceType("telemetryComponent")
|
|
24
|
+
}, createConfig.options));
|
|
25
|
+
instanceTypeName = "process-metrics-producer";
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
createComponent: createComponent,
|
|
29
|
+
instanceTypeName,
|
|
30
|
+
factory: MetricsProducerFactory
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=metricsProducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metricsProducer.js","sourceRoot":"","sources":["../../../src/components/metricsProducer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CACjD,UAAsC,EACtC,OAA0C,EAC1C,cAA8C;IAE9C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,4BAA4B,CAAC,MAAM,EAAE,CAAC;QACjE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,sBAAsB,EAAE,UAAU,CAAC,yBAAyB,CAAC,oBAAoB,CAAC;SAClF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,4BAA4B,CAAC,OAAO,EAAE,CAAC;QACzE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,sBAAsB,CACzB,gBAAgB,CAAC,WAAW,CAC3B;YACC,sBAAsB,EAAE,UAAU,CAAC,yBAAyB,CAAC,oBAAoB,CAAC;SAClF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,6BAA0C,CAAC;IAC5D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,sBAAsB;KAC/B,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 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 { nameofKebabCase } from \"@twin.org/nameof\";\nimport { MetricsProducerFactory } from \"@twin.org/telemetry-models\";\nimport { ProcessMetricsProducer, SystemMetricsProducer } from \"@twin.org/telemetry-producers\";\nimport type { MetricsProducerComponentConfig } from \"../models/config/metricsProducerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MetricsProducerComponentType } from \"../models/types/metricsProducerComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a metrics producer.\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 initialiseMetricsProducerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MetricsProducerComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MetricsProducerFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MetricsProducerComponentType.System) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SystemMetricsProducer(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredInstanceType(\"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(SystemMetricsProducer);\n\t} else if (instanceConfig.type === MetricsProducerComponentType.Process) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ProcessMetricsProducer(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredInstanceType(\"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(ProcessMetricsProducer);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MetricsProducerFactory\n\t};\n}\n"]}
|