@twin.org/engine-types 0.0.3-next.3 → 0.0.3-next.30
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 -22
- package/dist/es/components/attestation.js.map +1 -1
- package/dist/es/components/auditableItemGraph.js +26 -22
- package/dist/es/components/auditableItemGraph.js.map +1 -1
- package/dist/es/components/auditableItemStream.js +26 -22
- package/dist/es/components/auditableItemStream.js.map +1 -1
- 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 +31 -0
- package/dist/es/components/contextIdHandler.js.map +1 -0
- package/dist/es/components/dataProcessing.js +33 -32
- package/dist/es/components/dataProcessing.js.map +1 -1
- package/dist/es/components/dataspaceControlPlane.js +51 -0
- package/dist/es/components/dataspaceControlPlane.js.map +1 -0
- package/dist/es/components/dataspaceDataPlane.js +58 -0
- package/dist/es/components/dataspaceDataPlane.js.map +1 -0
- package/dist/es/components/documentManagement.js +12 -12
- 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 +14 -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/identity.js +28 -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/nft.js +33 -33
- package/dist/es/components/nft.js.map +1 -1
- package/dist/es/components/notarization.js +78 -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 -25
- 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 +14 -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 +29 -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/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 +49 -14
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineConfig.js.map +1 -1
- 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/contextIdHandlerComponentConfig.js +2 -0
- package/dist/es/models/config/contextIdHandlerComponentConfig.js.map +1 -0
- 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/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/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/types/{rightsManagementDarpComponentType.js → backgroundTaskComponentType.js} +3 -3
- package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
- package/dist/es/models/types/contextIdHandlerComponentType.js +17 -0
- package/dist/es/models/types/contextIdHandlerComponentType.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/{rightsManagementDapComponentType.js → notarizationComponentType.js} +4 -4
- 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/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/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/backgroundTask.d.ts +5 -10
- package/dist/types/components/blobStorage.d.ts +4 -12
- package/dist/types/components/contextIdHandler.d.ts +12 -0
- 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/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/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/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 +49 -14
- package/dist/types/models/IEngineConfig.d.ts +75 -15
- 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/contextIdHandlerComponentConfig.d.ts +11 -0
- 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/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/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/types/backgroundTaskComponentType.d.ts +13 -0
- package/dist/types/models/types/contextIdHandlerComponentType.d.ts +17 -0
- package/dist/types/models/types/dataspaceControlPlaneComponentType.d.ts +17 -0
- package/dist/types/models/types/dataspaceDataPlaneComponentType.d.ts +21 -0
- package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -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/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/utils/engineTypeHelper.d.ts +11 -0
- package/docs/changelog.md +501 -1
- 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/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 +31 -0
- 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/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/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/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 +68 -20
- package/docs/reference/interfaces/IEngineConfig.md +175 -67
- package/docs/reference/type-aliases/AttestationConnectorConfig.md +3 -3
- 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/ContextIdHandlerComponentConfig.md +5 -0
- package/docs/reference/type-aliases/ContextIdHandlerComponentType.md +5 -0
- 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/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/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 +3 -3
- 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/variables/AttestationComponentType.md +2 -2
- package/docs/reference/variables/AttestationConnectorType.md +1 -1
- package/docs/reference/variables/AuditableItemGraphComponentType.md +2 -2
- package/docs/reference/variables/AuditableItemStreamComponentType.md +2 -2
- package/docs/reference/variables/BackgroundTaskComponentType.md +13 -0
- package/docs/reference/variables/BlobStorageComponentType.md +2 -2
- package/docs/reference/variables/BlobStorageConnectorType.md +6 -6
- package/docs/reference/variables/ContextIdHandlerComponentType.md +19 -0
- 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/IdentityComponentType.md +2 -2
- package/docs/reference/variables/IdentityConnectorType.md +2 -2
- package/docs/reference/variables/IdentityProfileComponentType.md +2 -2
- package/docs/reference/variables/IdentityProfileConnectorType.md +1 -1
- package/docs/reference/variables/IdentityResolverComponentType.md +2 -2
- package/docs/reference/variables/IdentityResolverConnectorType.md +3 -3
- package/docs/reference/variables/ImmutableProofComponentType.md +2 -2
- package/docs/reference/variables/LoggingComponentType.md +2 -2
- package/docs/reference/variables/LoggingConnectorType.md +3 -3
- package/docs/reference/variables/MessagingAdminComponentType.md +1 -1
- package/docs/reference/variables/MessagingComponentType.md +1 -1
- package/docs/reference/variables/MessagingEmailConnectorType.md +2 -2
- package/docs/reference/variables/MessagingPushNotificationConnectorType.md +2 -2
- package/docs/reference/variables/MessagingSmsConnectorType.md +2 -2
- package/docs/reference/variables/NftComponentType.md +2 -2
- package/docs/reference/variables/NftConnectorType.md +2 -2
- package/docs/reference/variables/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 +1 -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/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 +22 -10
- 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":"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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;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: 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: createComponent,
|
|
161
|
+
instanceTypeName,
|
|
174
162
|
factory: ComponentFactory
|
|
175
163
|
};
|
|
176
164
|
}
|
|
@@ -1 +1 @@
|
|
|
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;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,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,EAMN,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,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C","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;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,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,EAA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B,sBAAoC,CAAC;IACtD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAChD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAE7C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,0BAA0B,EAAE,CAAC;YAE7B,gCAAgC,CAC/B,UAAU,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,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 {\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: createComponent as (createConfig: typeof instanceConfig) => IComponent,\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: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -19,35 +19,35 @@ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
|
19
19
|
* @param instanceConfig The instance config.
|
|
20
20
|
* @returns The instance created and the factory for it.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
23
|
-
let
|
|
24
|
-
let
|
|
22
|
+
export function initialiseNftConnector(engineCore, context, instanceConfig) {
|
|
23
|
+
let createComponent;
|
|
24
|
+
let instanceTypeName;
|
|
25
25
|
if (instanceConfig.type === NftConnectorType.EntityStorage) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
createComponent = (createConfig) => {
|
|
27
|
+
initSchema();
|
|
28
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.nftEntityStorageType, "Nft", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
29
|
+
ContextIdKeys.Node,
|
|
30
|
+
ContextIdKeys.Tenant
|
|
31
|
+
]));
|
|
32
|
+
return new EntityStorageNftConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
33
|
+
};
|
|
34
|
+
instanceTypeName = EntityStorageNftConnector.NAMESPACE;
|
|
33
35
|
}
|
|
34
36
|
else if (instanceConfig.type === NftConnectorType.Iota) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
instanceType = IotaNftConnector.NAMESPACE;
|
|
37
|
+
createComponent = (createConfig) => {
|
|
38
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
39
|
+
return new IotaNftConnector(EngineTypeHelper.mergeConfig({
|
|
40
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
41
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
42
|
+
loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
|
|
43
|
+
config: dltConfig?.options?.config
|
|
44
|
+
}, createConfig.options));
|
|
45
|
+
};
|
|
46
|
+
instanceTypeName = IotaNftConnector.NAMESPACE;
|
|
47
47
|
}
|
|
48
48
|
return {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
createComponent: createComponent,
|
|
50
|
+
instanceTypeName,
|
|
51
51
|
factory: NftConnectorFactory
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -58,20 +58,20 @@ export async function initialiseNftConnector(engineCore, context, instanceConfig
|
|
|
58
58
|
* @param instanceConfig The instance config.
|
|
59
59
|
* @returns The instance created and the factory for it.
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
62
|
-
let
|
|
63
|
-
let
|
|
61
|
+
export function initialiseNftComponent(engineCore, context, instanceConfig) {
|
|
62
|
+
let createComponent;
|
|
63
|
+
let instanceTypeName;
|
|
64
64
|
if (instanceConfig.type === NftComponentType.Service) {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
createComponent = (createConfig) => new NftService(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
66
|
+
instanceTypeName = "nft-service";
|
|
67
67
|
}
|
|
68
68
|
else if (instanceConfig.type === NftComponentType.RestClient) {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
createComponent = (createConfig) => new NftRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
70
|
+
instanceTypeName = "nft-rest-client";
|
|
71
71
|
}
|
|
72
72
|
return {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
createComponent: createComponent,
|
|
74
|
+
instanceTypeName,
|
|
75
75
|
factory: ComponentFactory
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nft.js","sourceRoot":"","sources":["../../../src/components/nft.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":"nft.js","sourceRoot":"","sources":["../../../src/components/nft.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,EACN,yBAAyB,EACzB,UAAU,EAEV,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAKtE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,UAAsC,EACtC,OAA0C,EAC1C,cAAkC;IAElC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC,aAAa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GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,UAAsC,EACtC,OAA0C,EAC1C,cAAkC;IAElC,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACtD,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,UAAU,CACb,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,gBAA8B,CAAC;IAChD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC,UAAU,EAAE,CAAC;QAChE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,aAAa,CAChB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,oBAAiC,CAAC;IACnD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\tEntityStorageNftConnector,\n\tinitSchema,\n\ttype Nft\n} from \"@twin.org/nft-connector-entity-storage\";\nimport { IotaNftConnector } from \"@twin.org/nft-connector-iota\";\nimport { NftConnectorFactory } from \"@twin.org/nft-models\";\nimport { NftRestClient } from \"@twin.org/nft-rest-client\";\nimport { NftService } from \"@twin.org/nft-service\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DltConfig } from \"../models/config/dltConfig.js\";\nimport type { NftComponentConfig } from \"../models/config/nftComponentConfig.js\";\nimport type { NftConnectorConfig } from \"../models/config/nftConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DltConfigType } from \"../models/types/dltConfigType.js\";\nimport { NftComponentType } from \"../models/types/nftComponentType.js\";\nimport { NftConnectorType } from \"../models/types/nftConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the NFT 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 initialiseNftConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: NftConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof NftConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === NftConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.nftEntityStorageType,\n\t\t\t\tnameof<Nft>(),\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\n\t\t\treturn new EntityStorageNftConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageNftConnector.NAMESPACE;\n\t} else if (instanceConfig.type === NftConnectorType.Iota) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tconst dltConfig = EngineTypeHelper.getConfigOfType<DltConfig>(\n\t\t\t\tengineCore.getConfig(),\n\t\t\t\t\"dltConfig\",\n\t\t\t\tDltConfigType.Iota\n\t\t\t);\n\t\t\treturn new IotaNftConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\twalletConnectorType: engineCore.getRegisteredInstanceType(\"walletConnector\"),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceTypeOptional(\"loggingComponent\"),\n\t\t\t\t\t\tconfig: dltConfig?.options?.config\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 = IotaNftConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: NftConnectorFactory\n\t};\n}\n\n/**\n * Initialise the NFT 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 initialiseNftComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: NftComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === NftComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew NftService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(NftService);\n\t} else if (instanceConfig.type === NftComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew NftRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(NftRestClient);\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"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
4
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
|
+
import { EntityStorageNotarizationConnector, initSchema } from "@twin.org/notarization-connector-entity-storage";
|
|
6
|
+
import { IotaNotarizationConnector } from "@twin.org/notarization-connector-iota";
|
|
7
|
+
import { NotarizationConnectorFactory } from "@twin.org/notarization-models";
|
|
8
|
+
import { NotarizationRestClient } from "@twin.org/notarization-rest-client";
|
|
9
|
+
import { NotarizationService } from "@twin.org/notarization-service";
|
|
10
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
11
|
+
import { DltConfigType } from "../models/types/dltConfigType.js";
|
|
12
|
+
import { NotarizationComponentType } from "../models/types/notarizationComponentType.js";
|
|
13
|
+
import { NotarizationConnectorType } from "../models/types/notarizationConnectorType.js";
|
|
14
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
15
|
+
/**
|
|
16
|
+
* Initialise the notarization connector.
|
|
17
|
+
* @param engineCore The engine core.
|
|
18
|
+
* @param context The context for the engine.
|
|
19
|
+
* @param instanceConfig The instance config.
|
|
20
|
+
* @returns The instance created and the factory for it.
|
|
21
|
+
*/
|
|
22
|
+
export function initialiseNotarizationConnector(engineCore, context, instanceConfig) {
|
|
23
|
+
let createComponent;
|
|
24
|
+
let instanceTypeName;
|
|
25
|
+
if (instanceConfig.type === NotarizationConnectorType.EntityStorage) {
|
|
26
|
+
createComponent = (createConfig) => {
|
|
27
|
+
initSchema();
|
|
28
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.notarizationEntityStorageType, "Notarization", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
29
|
+
ContextIdKeys.Node,
|
|
30
|
+
ContextIdKeys.Tenant
|
|
31
|
+
]));
|
|
32
|
+
return new EntityStorageNotarizationConnector(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
33
|
+
};
|
|
34
|
+
instanceTypeName = EntityStorageNotarizationConnector.NAMESPACE;
|
|
35
|
+
}
|
|
36
|
+
else if (instanceConfig.type === NotarizationConnectorType.Iota) {
|
|
37
|
+
createComponent = (createConfig) => {
|
|
38
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
39
|
+
return new IotaNotarizationConnector(EngineTypeHelper.mergeConfig({
|
|
40
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
41
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
42
|
+
loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
|
|
43
|
+
config: dltConfig?.options?.config
|
|
44
|
+
}, createConfig.options));
|
|
45
|
+
};
|
|
46
|
+
instanceTypeName = IotaNotarizationConnector.NAMESPACE;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
createComponent: createComponent,
|
|
50
|
+
instanceTypeName,
|
|
51
|
+
factory: NotarizationConnectorFactory
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Initialise the notarization component.
|
|
56
|
+
* @param engineCore The engine core.
|
|
57
|
+
* @param context The context for the engine.
|
|
58
|
+
* @param instanceConfig The instance config.
|
|
59
|
+
* @returns The instance created and the factory for it.
|
|
60
|
+
*/
|
|
61
|
+
export function initialiseNotarizationComponent(engineCore, context, instanceConfig) {
|
|
62
|
+
let createComponent;
|
|
63
|
+
let instanceTypeName;
|
|
64
|
+
if (instanceConfig.type === NotarizationComponentType.Service) {
|
|
65
|
+
createComponent = (createConfig) => new NotarizationService(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
66
|
+
instanceTypeName = "notarization-service";
|
|
67
|
+
}
|
|
68
|
+
else if (instanceConfig.type === NotarizationComponentType.RestClient) {
|
|
69
|
+
createComponent = (createConfig) => new NotarizationRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
70
|
+
instanceTypeName = "notarization-rest-client";
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
createComponent: createComponent,
|
|
74
|
+
instanceTypeName,
|
|
75
|
+
factory: ComponentFactory
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=notarization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notarization.js","sourceRoot":"","sources":["../../../src/components/notarization.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,EACN,kCAAkC,EAClC,UAAU,EAEV,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAKtE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,gBA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D,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,GAAG,yBAAyB,CAAC,SAAS,CAAC;IACxD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,4BAA4B;KACrC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC9C,UAAsC,EACtC,OAA0C,EAC1C,cAA2C;IAE3C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,yBAAyB,CAAC,OAAO,EAAE,CAAC;QAC/D,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,mBAAmB,CACtB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,yBAAuC,CAAC;IACzD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,yBAAyB,CAAC,UAAU,EAAE,CAAC;QACzE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,sBAAsB,CACzB,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,6BAA0C,CAAC;IAC5D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\tEntityStorageNotarizationConnector,\n\tinitSchema,\n\ttype Notarization\n} from \"@twin.org/notarization-connector-entity-storage\";\nimport { IotaNotarizationConnector } from \"@twin.org/notarization-connector-iota\";\nimport { NotarizationConnectorFactory } from \"@twin.org/notarization-models\";\nimport { NotarizationRestClient } from \"@twin.org/notarization-rest-client\";\nimport { NotarizationService } from \"@twin.org/notarization-service\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DltConfig } from \"../models/config/dltConfig.js\";\nimport type { NotarizationComponentConfig } from \"../models/config/notarizationComponentConfig.js\";\nimport type { NotarizationConnectorConfig } from \"../models/config/notarizationConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DltConfigType } from \"../models/types/dltConfigType.js\";\nimport { NotarizationComponentType } from \"../models/types/notarizationComponentType.js\";\nimport { NotarizationConnectorType } from \"../models/types/notarizationConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the notarization 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 initialiseNotarizationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: NotarizationConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof NotarizationConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === NotarizationConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.notarizationEntityStorageType,\n\t\t\t\tnameof<Notarization>(),\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\n\t\t\treturn new EntityStorageNotarizationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageNotarizationConnector.NAMESPACE;\n\t} else if (instanceConfig.type === NotarizationConnectorType.Iota) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tconst dltConfig = EngineTypeHelper.getConfigOfType<DltConfig>(\n\t\t\t\tengineCore.getConfig(),\n\t\t\t\t\"dltConfig\",\n\t\t\t\tDltConfigType.Iota\n\t\t\t);\n\t\t\treturn new IotaNotarizationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t\t\t\twalletConnectorType: engineCore.getRegisteredInstanceType(\"walletConnector\"),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceTypeOptional(\"loggingComponent\"),\n\t\t\t\t\t\tconfig: dltConfig?.options?.config\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 = IotaNotarizationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: NotarizationConnectorFactory\n\t};\n}\n\n/**\n * Initialise the notarization 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 initialiseNotarizationComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: NotarizationComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === NotarizationComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew NotarizationService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(NotarizationService);\n\t} else if (instanceConfig.type === NotarizationComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew NotarizationRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(NotarizationRestClient);\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"]}
|