@twin.org/engine-types 0.0.2-next.9 → 0.0.3-next.10
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/dist/es/components/attestation.js +60 -0
- package/dist/es/components/attestation.js.map +1 -0
- package/dist/es/components/auditableItemGraph.js +44 -0
- package/dist/es/components/auditableItemGraph.js.map +1 -0
- package/dist/es/components/auditableItemStream.js +44 -0
- package/dist/es/components/auditableItemStream.js.map +1 -0
- package/dist/es/components/authenticationGenerator.js +30 -0
- package/dist/es/components/authenticationGenerator.js.map +1 -0
- package/dist/es/components/backgroundTask.js +31 -0
- package/dist/es/components/backgroundTask.js.map +1 -0
- package/dist/es/components/blobStorage.js +143 -0
- package/dist/es/components/blobStorage.js.map +1 -0
- package/dist/es/components/contextIdHandler.js +31 -0
- package/dist/es/components/contextIdHandler.js.map +1 -0
- package/dist/es/components/dataProcessing.js +89 -0
- package/dist/es/components/dataProcessing.js.map +1 -0
- package/dist/es/components/dataSpaceConnector.js +51 -0
- package/dist/es/components/dataSpaceConnector.js.map +1 -0
- package/dist/es/components/documentManagement.js +37 -0
- package/dist/es/components/documentManagement.js.map +1 -0
- package/dist/es/components/entityStorage.js +226 -0
- package/dist/es/components/entityStorage.js.map +1 -0
- package/dist/es/components/eventBus.js +63 -0
- package/dist/es/components/eventBus.js.map +1 -0
- package/dist/es/components/faucet.js +41 -0
- package/dist/es/components/faucet.js.map +1 -0
- package/dist/es/components/federatedCatalogue.js +38 -0
- package/dist/es/components/federatedCatalogue.js.map +1 -0
- package/dist/es/components/federatedCatalogueFilter.js +31 -0
- package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
- package/dist/es/components/identity.js +75 -0
- package/dist/es/components/identity.js.map +1 -0
- package/dist/es/components/identityProfile.js +64 -0
- package/dist/es/components/identityProfile.js.map +1 -0
- package/dist/es/components/identityResolver.js +87 -0
- package/dist/es/components/identityResolver.js.map +1 -0
- package/dist/es/components/immutableProof.js +45 -0
- package/dist/es/components/immutableProof.js.map +1 -0
- package/dist/es/components/logging.js +73 -0
- package/dist/es/components/logging.js.map +1 -0
- package/dist/es/components/messaging.js +177 -0
- package/dist/es/components/messaging.js.map +1 -0
- package/dist/es/components/nft.js +78 -0
- package/dist/es/components/nft.js.map +1 -0
- package/dist/es/components/rightsManagementDap.js +36 -0
- package/dist/es/components/rightsManagementDap.js.map +1 -0
- package/dist/es/components/rightsManagementDarp.js +30 -0
- package/dist/es/components/rightsManagementDarp.js.map +1 -0
- package/dist/es/components/rightsManagementDataAccessHandler.js +27 -0
- package/dist/es/components/rightsManagementDataAccessHandler.js.map +1 -0
- package/dist/es/components/rightsManagementPap.js +41 -0
- package/dist/es/components/rightsManagementPap.js.map +1 -0
- package/dist/es/components/rightsManagementPdp.js +32 -0
- package/dist/es/components/rightsManagementPdp.js.map +1 -0
- package/dist/es/components/rightsManagementPep.js +30 -0
- package/dist/es/components/rightsManagementPep.js.map +1 -0
- package/dist/es/components/rightsManagementPip.js +29 -0
- package/dist/es/components/rightsManagementPip.js.map +1 -0
- package/dist/es/components/rightsManagementPmp.js +30 -0
- package/dist/es/components/rightsManagementPmp.js.map +1 -0
- package/dist/es/components/rightsManagementPnap.js +42 -0
- package/dist/es/components/rightsManagementPnap.js.map +1 -0
- package/dist/es/components/rightsManagementPnp.js +41 -0
- package/dist/es/components/rightsManagementPnp.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyArbiter.js +27 -0
- package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +27 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js +27 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js +35 -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/rightsManagementPolicyRequester.js +27 -0
- package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
- package/dist/es/components/rightsManagementPxp.js +29 -0
- package/dist/es/components/rightsManagementPxp.js.map +1 -0
- package/dist/es/components/synchronisedStorage.js +47 -0
- package/dist/es/components/synchronisedStorage.js.map +1 -0
- package/dist/es/components/taskScheduler.js +27 -0
- package/dist/es/components/taskScheduler.js.map +1 -0
- package/dist/es/components/telemetry.js +71 -0
- package/dist/es/components/telemetry.js.map +1 -0
- package/dist/es/components/tenant.js +32 -0
- package/dist/es/components/tenant.js.map +1 -0
- package/dist/es/components/trust.js +29 -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 +33 -0
- package/dist/es/components/vault.js.map +1 -0
- package/dist/es/components/verifiableStorage.js +79 -0
- package/dist/es/components/verifiableStorage.js.map +1 -0
- package/dist/es/components/wallet.js +47 -0
- package/dist/es/components/wallet.js.map +1 -0
- package/dist/es/index.js +188 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IEngineConfig.js +2 -0
- package/dist/es/models/IEngineConfig.js.map +1 -0
- package/dist/es/models/config/attestationComponentConfig.js +2 -0
- package/dist/es/models/config/attestationComponentConfig.js.map +1 -0
- package/dist/es/models/config/attestationConnectorConfig.js +2 -0
- package/dist/es/models/config/attestationConnectorConfig.js.map +1 -0
- package/dist/es/models/config/auditableItemGraphComponentConfig.js +2 -0
- package/dist/es/models/config/auditableItemGraphComponentConfig.js.map +1 -0
- package/dist/es/models/config/auditableItemStreamComponentConfig.js +2 -0
- package/dist/es/models/config/auditableItemStreamComponentConfig.js.map +1 -0
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js +2 -0
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js.map +1 -0
- package/dist/es/models/config/backgroundTaskComponentConfig.js +2 -0
- package/dist/es/models/config/backgroundTaskComponentConfig.js.map +1 -0
- package/dist/es/models/config/blobStorageComponentConfig.js +2 -0
- package/dist/es/models/config/blobStorageComponentConfig.js.map +1 -0
- package/dist/es/models/config/blobStorageConnectorConfig.js +2 -0
- package/dist/es/models/config/blobStorageConnectorConfig.js.map +1 -0
- package/dist/es/models/config/contextIdHandlerComponentConfig.js +2 -0
- package/dist/es/models/config/contextIdHandlerComponentConfig.js.map +1 -0
- package/dist/es/models/config/dataConverterConnectorConfig.js +2 -0
- package/dist/es/models/config/dataConverterConnectorConfig.js.map +1 -0
- package/dist/es/models/config/dataExtractorConnectorConfig.js +2 -0
- package/dist/es/models/config/dataExtractorConnectorConfig.js.map +1 -0
- package/dist/es/models/config/dataProcessingComponentConfig.js +2 -0
- package/dist/es/models/config/dataProcessingComponentConfig.js.map +1 -0
- package/dist/es/models/config/dataSpaceConnectorComponentConfig.js +2 -0
- package/dist/es/models/config/dataSpaceConnectorComponentConfig.js.map +1 -0
- package/dist/es/models/config/dltConfig.js +2 -0
- package/dist/es/models/config/dltConfig.js.map +1 -0
- package/dist/es/models/config/documentManagementComponentConfig.js +2 -0
- package/dist/es/models/config/documentManagementComponentConfig.js.map +1 -0
- package/dist/es/models/config/entityStorageComponentConfig.js +2 -0
- package/dist/es/models/config/entityStorageComponentConfig.js.map +1 -0
- package/dist/es/models/config/entityStorageConnectorConfig.js +2 -0
- package/dist/es/models/config/entityStorageConnectorConfig.js.map +1 -0
- package/dist/es/models/config/eventBusComponentConfig.js +2 -0
- package/dist/es/models/config/eventBusComponentConfig.js.map +1 -0
- package/dist/es/models/config/eventBusConnectorConfig.js +2 -0
- package/dist/es/models/config/eventBusConnectorConfig.js.map +1 -0
- package/dist/es/models/config/faucetConnectorConfig.js +2 -0
- package/dist/es/models/config/faucetConnectorConfig.js.map +1 -0
- package/dist/es/models/config/federatedCatalogueComponentConfig.js +2 -0
- package/dist/es/models/config/federatedCatalogueComponentConfig.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/identityComponentConfig.js +2 -0
- package/dist/es/models/config/identityComponentConfig.js.map +1 -0
- package/dist/es/models/config/identityConnectorConfig.js +2 -0
- package/dist/es/models/config/identityConnectorConfig.js.map +1 -0
- package/dist/es/models/config/identityProfileComponentConfig.js +2 -0
- package/dist/es/models/config/identityProfileComponentConfig.js.map +1 -0
- package/dist/es/models/config/identityProfileConnectorConfig.js +2 -0
- package/dist/es/models/config/identityProfileConnectorConfig.js.map +1 -0
- package/dist/es/models/config/identityResolverComponentConfig.js +2 -0
- package/dist/es/models/config/identityResolverComponentConfig.js.map +1 -0
- package/dist/es/models/config/identityResolverConnectorConfig.js +2 -0
- package/dist/es/models/config/identityResolverConnectorConfig.js.map +1 -0
- package/dist/es/models/config/immutableProofComponentConfig.js +2 -0
- package/dist/es/models/config/immutableProofComponentConfig.js.map +1 -0
- package/dist/es/models/config/loggingComponentConfig.js +2 -0
- package/dist/es/models/config/loggingComponentConfig.js.map +1 -0
- package/dist/es/models/config/loggingConnectorConfig.js +2 -0
- package/dist/es/models/config/loggingConnectorConfig.js.map +1 -0
- package/dist/es/models/config/messagingAdminComponentConfig.js +2 -0
- package/dist/es/models/config/messagingAdminComponentConfig.js.map +1 -0
- package/dist/es/models/config/messagingComponentConfig.js +2 -0
- package/dist/es/models/config/messagingComponentConfig.js.map +1 -0
- package/dist/es/models/config/messagingEmailConnectorConfig.js +2 -0
- package/dist/es/models/config/messagingEmailConnectorConfig.js.map +1 -0
- package/dist/es/models/config/messagingPushNotificationConnectorConfig.js +2 -0
- package/dist/es/models/config/messagingPushNotificationConnectorConfig.js.map +1 -0
- package/dist/es/models/config/messagingSmsConnectorConfig.js +2 -0
- package/dist/es/models/config/messagingSmsConnectorConfig.js.map +1 -0
- package/dist/es/models/config/nftComponentConfig.js +2 -0
- package/dist/es/models/config/nftComponentConfig.js.map +1 -0
- package/dist/es/models/config/nftConnectorConfig.js +2 -0
- package/dist/es/models/config/nftConnectorConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementDapComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementDapComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPapComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPapComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPdpComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPdpComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPepComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPipComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPmpComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPmpComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPnapComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPnapComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPnpComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -0
- 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/rightsManagementPolicyRequesterComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPxpComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -0
- package/dist/es/models/config/synchronisedStorageComponentConfig.js +2 -0
- package/dist/es/models/config/synchronisedStorageComponentConfig.js.map +1 -0
- package/dist/es/models/config/taskSchedulerComponentConfig.js +2 -0
- package/dist/es/models/config/taskSchedulerComponentConfig.js.map +1 -0
- package/dist/es/models/config/telemetryComponentConfig.js +2 -0
- package/dist/es/models/config/telemetryComponentConfig.js.map +1 -0
- package/dist/es/models/config/telemetryConnectorConfig.js +2 -0
- package/dist/es/models/config/telemetryConnectorConfig.js.map +1 -0
- package/dist/es/models/config/tenantAdminComponentConfig.js +2 -0
- package/dist/es/models/config/tenantAdminComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustComponentConfig.js +2 -0
- package/dist/es/models/config/trustComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js +2 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js +2 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -0
- package/dist/es/models/config/vaultConnectorConfig.js +2 -0
- package/dist/es/models/config/vaultConnectorConfig.js.map +1 -0
- package/dist/es/models/config/verifiableStorageComponentConfig.js +2 -0
- package/dist/es/models/config/verifiableStorageComponentConfig.js.map +1 -0
- package/dist/es/models/config/verifiableStorageConnectorConfig.js +2 -0
- package/dist/es/models/config/verifiableStorageConnectorConfig.js.map +1 -0
- package/dist/es/models/config/walletConnectorConfig.js +2 -0
- package/dist/es/models/config/walletConnectorConfig.js.map +1 -0
- package/dist/es/models/types/attestationComponentType.js +17 -0
- package/dist/es/models/types/attestationComponentType.js.map +1 -0
- package/dist/es/models/types/attestationConnectorType.js +13 -0
- package/dist/es/models/types/attestationConnectorType.js.map +1 -0
- package/dist/es/models/types/auditableItemGraphComponentType.js +17 -0
- package/dist/es/models/types/auditableItemGraphComponentType.js.map +1 -0
- package/dist/es/models/types/auditableItemStreamComponentType.js +17 -0
- package/dist/es/models/types/auditableItemStreamComponentType.js.map +1 -0
- package/dist/es/models/types/authenticationGeneratorComponentType.js +13 -0
- package/dist/es/models/types/authenticationGeneratorComponentType.js.map +1 -0
- package/dist/es/models/types/backgroundTaskComponentType.js +13 -0
- package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
- package/dist/es/models/types/blobStorageComponentType.js +17 -0
- package/dist/es/models/types/blobStorageComponentType.js.map +1 -0
- package/dist/es/models/types/blobStorageConnectorType.js +33 -0
- package/dist/es/models/types/blobStorageConnectorType.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/dataConverterConnectorType.js +17 -0
- package/dist/es/models/types/dataConverterConnectorType.js.map +1 -0
- package/dist/es/models/types/dataExtractorConnectorType.js +13 -0
- package/dist/es/models/types/dataExtractorConnectorType.js.map +1 -0
- package/dist/es/models/types/dataProcessingComponentType.js +17 -0
- package/dist/es/models/types/dataProcessingComponentType.js.map +1 -0
- package/dist/es/models/types/dataSpaceConnectorComponentType.js +21 -0
- package/dist/es/models/types/dataSpaceConnectorComponentType.js.map +1 -0
- package/dist/es/models/types/dltConfigType.js +13 -0
- package/dist/es/models/types/dltConfigType.js.map +1 -0
- package/dist/es/models/types/documentManagementComponentType.js +17 -0
- package/dist/es/models/types/documentManagementComponentType.js.map +1 -0
- package/dist/es/models/types/entityStorageComponentType.js +17 -0
- package/dist/es/models/types/entityStorageComponentType.js.map +1 -0
- package/dist/es/models/types/entityStorageConnectorType.js +49 -0
- package/dist/es/models/types/entityStorageConnectorType.js.map +1 -0
- package/dist/es/models/types/eventBusComponentType.js +17 -0
- package/dist/es/models/types/eventBusComponentType.js.map +1 -0
- package/dist/es/models/types/eventBusConnectorType.js +13 -0
- package/dist/es/models/types/eventBusConnectorType.js.map +1 -0
- package/dist/es/models/types/faucetConnectorType.js +17 -0
- package/dist/es/models/types/faucetConnectorType.js.map +1 -0
- package/dist/es/models/types/federatedCatalogueComponentType.js +17 -0
- package/dist/es/models/types/federatedCatalogueComponentType.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/identityComponentType.js +17 -0
- package/dist/es/models/types/identityComponentType.js.map +1 -0
- package/dist/es/models/types/identityConnectorType.js +17 -0
- package/dist/es/models/types/identityConnectorType.js.map +1 -0
- package/dist/es/models/types/identityProfileComponentType.js +17 -0
- package/dist/es/models/types/identityProfileComponentType.js.map +1 -0
- package/dist/es/models/types/identityProfileConnectorType.js +13 -0
- package/dist/es/models/types/identityProfileConnectorType.js.map +1 -0
- package/dist/es/models/types/identityResolverComponentType.js +17 -0
- package/dist/es/models/types/identityResolverComponentType.js.map +1 -0
- package/dist/es/models/types/identityResolverConnectorType.js +21 -0
- package/dist/es/models/types/identityResolverConnectorType.js.map +1 -0
- package/dist/es/models/types/immutableProofComponentType.js +17 -0
- package/dist/es/models/types/immutableProofComponentType.js.map +1 -0
- package/dist/es/models/types/loggingComponentType.js +17 -0
- package/dist/es/models/types/loggingComponentType.js.map +1 -0
- package/dist/es/models/types/loggingConnectorType.js +21 -0
- package/dist/es/models/types/loggingConnectorType.js.map +1 -0
- package/dist/es/models/types/messagingAdminComponentType.js +13 -0
- package/dist/es/models/types/messagingAdminComponentType.js.map +1 -0
- package/dist/es/models/types/messagingComponentType.js +13 -0
- package/dist/es/models/types/messagingComponentType.js.map +1 -0
- package/dist/es/models/types/messagingEmailConnectorType.js +17 -0
- package/dist/es/models/types/messagingEmailConnectorType.js.map +1 -0
- package/dist/es/models/types/messagingPushNotificationConnectorType.js +17 -0
- package/dist/es/models/types/messagingPushNotificationConnectorType.js.map +1 -0
- package/dist/es/models/types/messagingSmsConnectorType.js +17 -0
- package/dist/es/models/types/messagingSmsConnectorType.js.map +1 -0
- package/dist/es/models/types/nftComponentType.js +17 -0
- package/dist/es/models/types/nftComponentType.js.map +1 -0
- package/dist/es/models/types/nftConnectorType.js +17 -0
- package/dist/es/models/types/nftConnectorType.js.map +1 -0
- package/dist/es/models/types/rightsManagementDapComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementDapComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementDarpComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementDarpComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPapComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPapComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPdpComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPdpComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPepComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPepComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPipComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPipComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPmpComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPmpComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPnapComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPnapComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPnpComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPnpComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +13 -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/rightsManagementPolicyRequesterComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPxpComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPxpComponentType.js.map +1 -0
- package/dist/es/models/types/synchronisedStorageComponentType.js +17 -0
- package/dist/es/models/types/synchronisedStorageComponentType.js.map +1 -0
- package/dist/es/models/types/taskSchedulerComponentType.js +13 -0
- package/dist/es/models/types/taskSchedulerComponentType.js.map +1 -0
- package/dist/es/models/types/telemetryComponentType.js +17 -0
- package/dist/es/models/types/telemetryComponentType.js.map +1 -0
- package/dist/es/models/types/telemetryConnectorType.js +13 -0
- package/dist/es/models/types/telemetryConnectorType.js.map +1 -0
- package/dist/es/models/types/tenantAdminComponentType.js +13 -0
- package/dist/es/models/types/tenantAdminComponentType.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/models/types/vaultConnectorType.js +17 -0
- package/dist/es/models/types/vaultConnectorType.js.map +1 -0
- package/dist/es/models/types/verifiableStorageComponentType.js +17 -0
- package/dist/es/models/types/verifiableStorageComponentType.js.map +1 -0
- package/dist/es/models/types/verifiableStorageConnectorType.js +17 -0
- package/dist/es/models/types/verifiableStorageConnectorType.js.map +1 -0
- package/dist/es/models/types/walletConnectorType.js +17 -0
- package/dist/es/models/types/walletConnectorType.js.map +1 -0
- package/dist/es/utils/engineTypeHelper.js +32 -0
- package/dist/es/utils/engineTypeHelper.js.map +1 -0
- package/dist/types/components/attestation.d.ts +17 -11
- package/dist/types/components/auditableItemGraph.d.ts +9 -6
- package/dist/types/components/auditableItemStream.d.ts +9 -6
- package/dist/types/components/authenticationGenerator.d.ts +17 -0
- package/dist/types/components/backgroundTask.d.ts +10 -7
- package/dist/types/components/blobStorage.d.ts +17 -11
- package/dist/types/components/contextIdHandler.d.ts +16 -0
- package/dist/types/components/dataProcessing.d.ts +24 -16
- package/dist/types/components/dataSpaceConnector.d.ts +16 -0
- package/dist/types/components/documentManagement.d.ts +9 -6
- package/dist/types/components/entityStorage.d.ts +12 -8
- package/dist/types/components/eventBus.d.ts +17 -11
- package/dist/types/components/faucet.d.ts +10 -6
- package/dist/types/components/federatedCatalogue.d.ts +9 -6
- package/dist/types/components/federatedCatalogueFilter.d.ts +17 -0
- package/dist/types/components/identity.d.ts +17 -11
- package/dist/types/components/identityProfile.d.ts +17 -11
- package/dist/types/components/identityResolver.d.ts +17 -11
- package/dist/types/components/immutableProof.d.ts +9 -6
- package/dist/types/components/logging.d.ts +17 -11
- package/dist/types/components/messaging.d.ts +44 -21
- package/dist/types/components/nft.d.ts +17 -11
- package/dist/types/components/rightsManagementDap.d.ts +16 -0
- package/dist/types/components/rightsManagementDarp.d.ts +16 -0
- package/dist/types/components/rightsManagementDataAccessHandler.d.ts +17 -0
- package/dist/types/components/rightsManagementPap.d.ts +9 -6
- package/dist/types/components/rightsManagementPdp.d.ts +9 -6
- package/dist/types/components/rightsManagementPep.d.ts +9 -6
- package/dist/types/components/rightsManagementPip.d.ts +9 -6
- package/dist/types/components/rightsManagementPmp.d.ts +9 -6
- package/dist/types/components/rightsManagementPnap.d.ts +16 -0
- package/dist/types/components/rightsManagementPnp.d.ts +16 -0
- package/dist/types/components/rightsManagementPolicyArbiter.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyRequester.d.ts +17 -0
- package/dist/types/components/rightsManagementPxp.d.ts +9 -6
- package/dist/types/components/synchronisedStorage.d.ts +9 -6
- package/dist/types/components/taskScheduler.d.ts +9 -6
- package/dist/types/components/telemetry.d.ts +17 -11
- package/dist/types/components/tenant.d.ts +16 -0
- package/dist/types/components/trust.d.ts +16 -0
- package/dist/types/components/trustGenerator.d.ts +17 -0
- package/dist/types/components/trustVerifier.d.ts +17 -0
- package/dist/types/components/vault.d.ts +10 -6
- package/dist/types/components/verifiableStorage.d.ts +17 -11
- package/dist/types/components/wallet.d.ts +10 -16
- package/dist/types/index.d.ts +185 -128
- package/dist/types/models/IEngineConfig.d.ts +147 -52
- package/dist/types/models/config/attestationComponentConfig.d.ts +1 -1
- package/dist/types/models/config/attestationConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/auditableItemGraphComponentConfig.d.ts +1 -1
- package/dist/types/models/config/auditableItemStreamComponentConfig.d.ts +1 -1
- package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/backgroundTaskComponentConfig.d.ts +9 -0
- package/dist/types/models/config/blobStorageComponentConfig.d.ts +1 -1
- package/dist/types/models/config/blobStorageConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/contextIdHandlerComponentConfig.d.ts +11 -0
- package/dist/types/models/config/dataConverterConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/dataExtractorConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/dataProcessingComponentConfig.d.ts +1 -1
- package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +17 -0
- package/dist/types/models/config/dltConfig.d.ts +1 -1
- package/dist/types/models/config/documentManagementComponentConfig.d.ts +1 -1
- package/dist/types/models/config/entityStorageComponentConfig.d.ts +4 -2
- package/dist/types/models/config/entityStorageConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/eventBusComponentConfig.d.ts +1 -1
- package/dist/types/models/config/eventBusConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/faucetConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/federatedCatalogueComponentConfig.d.ts +1 -1
- package/dist/types/models/config/federatedCatalogueFilterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/identityComponentConfig.d.ts +1 -1
- package/dist/types/models/config/identityConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/identityProfileComponentConfig.d.ts +1 -1
- package/dist/types/models/config/identityProfileConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/identityResolverComponentConfig.d.ts +1 -1
- package/dist/types/models/config/identityResolverConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/immutableProofComponentConfig.d.ts +1 -1
- package/dist/types/models/config/loggingComponentConfig.d.ts +1 -1
- package/dist/types/models/config/loggingConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/messagingAdminComponentConfig.d.ts +9 -0
- package/dist/types/models/config/messagingComponentConfig.d.ts +1 -1
- package/dist/types/models/config/messagingEmailConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/messagingPushNotificationConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/messagingSmsConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/nftComponentConfig.d.ts +1 -1
- package/dist/types/models/config/nftConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +16 -0
- package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementDataAccessHandlerComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPapComponentConfig.d.ts +7 -3
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +3 -3
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +3 -3
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +3 -3
- package/dist/types/models/config/rightsManagementPmpComponentConfig.d.ts +3 -3
- package/dist/types/models/config/rightsManagementPnapComponentConfig.d.ts +13 -0
- package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +13 -0
- package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +9 -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/rightsManagementPolicyRequesterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +3 -3
- package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +1 -1
- package/dist/types/models/config/taskSchedulerComponentConfig.d.ts +1 -1
- package/dist/types/models/config/telemetryComponentConfig.d.ts +1 -1
- package/dist/types/models/config/telemetryConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/tenantAdminComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustGeneratorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustVerifierComponentConfig.d.ts +9 -0
- package/dist/types/models/config/vaultConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/verifiableStorageComponentConfig.d.ts +1 -1
- package/dist/types/models/config/verifiableStorageConnectorConfig.d.ts +1 -1
- package/dist/types/models/config/walletConnectorConfig.d.ts +1 -1
- package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +13 -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/dataSpaceConnectorComponentType.d.ts +21 -0
- package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -0
- package/dist/types/models/types/messagingAdminComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementDapComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementDataAccessHandlerComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPapComponentType.d.ts +4 -0
- package/dist/types/models/types/rightsManagementPepComponentType.d.ts +4 -0
- package/dist/types/models/types/rightsManagementPnapComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPnpComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +13 -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/rightsManagementPolicyRequesterComponentType.d.ts +13 -0
- package/dist/types/models/types/tenantAdminComponentType.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 +19 -0
- package/docs/changelog.md +438 -0
- package/docs/reference/classes/EngineTypeHelper.md +61 -0
- package/docs/reference/functions/initialiseAttestationComponent.md +3 -13
- package/docs/reference/functions/initialiseAttestationConnector.md +3 -13
- package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +3 -13
- package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +3 -13
- package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +31 -0
- package/docs/reference/functions/initialiseBackgroundTaskComponent.md +31 -0
- package/docs/reference/functions/initialiseBlobStorageComponent.md +3 -13
- package/docs/reference/functions/initialiseBlobStorageConnector.md +3 -13
- package/docs/reference/functions/initialiseContextIdHandlerComponent.md +31 -0
- package/docs/reference/functions/initialiseDataConverterConnector.md +3 -13
- package/docs/reference/functions/initialiseDataExtractorConnector.md +3 -13
- package/docs/reference/functions/initialiseDataProcessingComponent.md +3 -13
- package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +31 -0
- package/docs/reference/functions/initialiseDocumentManagementComponent.md +3 -13
- package/docs/reference/functions/initialiseEntityStorageComponent.md +3 -13
- package/docs/reference/functions/initialiseEntityStorageConnector.md +8 -2
- package/docs/reference/functions/initialiseEventBusComponent.md +3 -13
- package/docs/reference/functions/initialiseEventBusConnector.md +3 -13
- package/docs/reference/functions/initialiseFaucetConnector.md +3 -13
- package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +3 -13
- package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +31 -0
- package/docs/reference/functions/initialiseIdentityComponent.md +3 -13
- package/docs/reference/functions/initialiseIdentityConnector.md +3 -13
- package/docs/reference/functions/initialiseIdentityProfileComponent.md +3 -13
- package/docs/reference/functions/initialiseIdentityProfileConnector.md +3 -13
- package/docs/reference/functions/initialiseIdentityResolverComponent.md +3 -13
- package/docs/reference/functions/initialiseIdentityResolverConnector.md +3 -13
- package/docs/reference/functions/initialiseImmutableProofComponent.md +3 -13
- package/docs/reference/functions/initialiseLoggingComponent.md +3 -13
- package/docs/reference/functions/initialiseLoggingConnector.md +3 -13
- package/docs/reference/functions/initialiseMessagingAdminComponent.md +31 -0
- package/docs/reference/functions/initialiseMessagingComponent.md +3 -13
- package/docs/reference/functions/initialiseMessagingEmailConnector.md +3 -13
- package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +3 -13
- package/docs/reference/functions/initialiseMessagingSmsConnector.md +3 -13
- package/docs/reference/functions/initialiseNftComponent.md +3 -13
- package/docs/reference/functions/initialiseNftConnector.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementDapComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementDataAccessHandlerComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPapComponent.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementPepComponent.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementPipComponent.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +3 -13
- package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +31 -0
- 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/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +3 -13
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +3 -13
- package/docs/reference/functions/initialiseTaskSchedulerComponent.md +3 -13
- package/docs/reference/functions/initialiseTelemetryComponent.md +3 -13
- package/docs/reference/functions/initialiseTelemetryConnector.md +3 -13
- package/docs/reference/functions/initialiseTenantAdminComponent.md +31 -0
- 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 +3 -13
- package/docs/reference/functions/initialiseVerifiableStorageComponent.md +3 -13
- package/docs/reference/functions/initialiseVerifiableStorageConnector.md +3 -13
- package/docs/reference/functions/initialiseWalletConnector.md +3 -13
- package/docs/reference/index.md +88 -9
- package/docs/reference/interfaces/IEngineConfig.md +120 -6
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +5 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +17 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
- package/docs/reference/type-aliases/ContextIdHandlerComponentConfig.md +5 -0
- package/docs/reference/type-aliases/ContextIdHandlerComponentType.md +5 -0
- package/docs/reference/type-aliases/DataSpaceConnectorComponentConfig.md +5 -0
- package/docs/reference/type-aliases/DataSpaceConnectorComponentType.md +5 -0
- package/docs/reference/type-aliases/EntityStorageComponentConfig.md +1 -1
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentType.md +5 -0
- package/docs/reference/type-aliases/MessagingAdminComponentConfig.md +17 -0
- package/docs/reference/type-aliases/MessagingAdminComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDapComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPapComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPmpComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPnapComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPnapComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPnpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +17 -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/RightsManagementPolicyRequesterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +1 -1
- package/docs/reference/type-aliases/TenantAdminComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TenantAdminComponentType.md +5 -0
- 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 +1 -1
- package/docs/reference/variables/AttestationConnectorType.md +1 -1
- package/docs/reference/variables/AuditableItemGraphComponentType.md +1 -1
- package/docs/reference/variables/AuditableItemStreamComponentType.md +1 -1
- package/docs/reference/variables/AuthenticationGeneratorComponentType.md +13 -0
- package/docs/reference/variables/BackgroundTaskComponentType.md +13 -0
- package/docs/reference/variables/BlobStorageComponentType.md +1 -1
- package/docs/reference/variables/BlobStorageConnectorType.md +1 -1
- package/docs/reference/variables/ContextIdHandlerComponentType.md +19 -0
- package/docs/reference/variables/DataConverterConnectorType.md +1 -1
- package/docs/reference/variables/DataExtractorConnectorType.md +1 -1
- package/docs/reference/variables/DataProcessingComponentType.md +1 -1
- package/docs/reference/variables/DataSpaceConnectorComponentType.md +25 -0
- package/docs/reference/variables/DltConfigType.md +1 -1
- package/docs/reference/variables/DocumentManagementComponentType.md +1 -1
- package/docs/reference/variables/EntityStorageComponentType.md +1 -1
- package/docs/reference/variables/EntityStorageConnectorType.md +1 -1
- package/docs/reference/variables/EventBusComponentType.md +1 -1
- package/docs/reference/variables/EventBusConnectorType.md +1 -1
- package/docs/reference/variables/FaucetConnectorType.md +1 -1
- package/docs/reference/variables/FederatedCatalogueComponentType.md +1 -1
- package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
- package/docs/reference/variables/IdentityComponentType.md +1 -1
- package/docs/reference/variables/IdentityConnectorType.md +1 -1
- package/docs/reference/variables/IdentityProfileComponentType.md +1 -1
- package/docs/reference/variables/IdentityProfileConnectorType.md +1 -1
- package/docs/reference/variables/IdentityResolverComponentType.md +1 -1
- package/docs/reference/variables/IdentityResolverConnectorType.md +1 -1
- package/docs/reference/variables/ImmutableProofComponentType.md +1 -1
- package/docs/reference/variables/LoggingComponentType.md +1 -1
- package/docs/reference/variables/LoggingConnectorType.md +1 -1
- package/docs/reference/variables/MessagingAdminComponentType.md +13 -0
- package/docs/reference/variables/MessagingComponentType.md +1 -1
- package/docs/reference/variables/MessagingEmailConnectorType.md +1 -1
- package/docs/reference/variables/MessagingPushNotificationConnectorType.md +1 -1
- package/docs/reference/variables/MessagingSmsConnectorType.md +1 -1
- package/docs/reference/variables/NftComponentType.md +1 -1
- package/docs/reference/variables/NftConnectorType.md +1 -1
- package/docs/reference/variables/{RightsManagementComponentType.md → RightsManagementDapComponentType.md} +4 -4
- package/docs/reference/variables/RightsManagementDarpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementDataAccessHandlerComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPapComponentType.md +7 -1
- package/docs/reference/variables/RightsManagementPdpComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPepComponentType.md +7 -1
- package/docs/reference/variables/RightsManagementPipComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPmpComponentType.md +1 -1
- package/docs/reference/variables/RightsManagementPnapComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPnpComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +13 -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/RightsManagementPolicyRequesterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
- package/docs/reference/variables/SynchronisedStorageComponentType.md +1 -1
- package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
- package/docs/reference/variables/TelemetryComponentType.md +1 -1
- package/docs/reference/variables/TelemetryConnectorType.md +1 -1
- package/docs/reference/variables/TenantAdminComponentType.md +13 -0
- 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 +1 -1
- package/docs/reference/variables/VerifiableStorageComponentType.md +1 -1
- package/docs/reference/variables/VerifiableStorageConnectorType.md +1 -1
- package/docs/reference/variables/WalletConnectorType.md +1 -1
- package/locales/en.json +14 -1
- package/package.json +37 -10
- package/dist/cjs/index.cjs +0 -3224
- package/dist/esm/index.mjs +0 -3127
- package/dist/types/components/rightsManagement.d.ts +0 -13
- package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +0 -9
- package/dist/types/models/config/rightsManagementComponentConfig.d.ts +0 -13
- package/dist/types/models/types/backgroundTaskConnectorType.d.ts +0 -13
- package/dist/types/models/types/rightsManagementComponentType.d.ts +0 -17
- package/docs/reference/functions/initialiseBackgroundTaskConnector.md +0 -41
- package/docs/reference/functions/initialiseRightsManagementComponent.md +0 -41
- package/docs/reference/functions/initialiseWalletStorage.md +0 -41
- package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
- package/docs/reference/type-aliases/BackgroundTaskConnectorType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementComponentConfig.md +0 -5
- package/docs/reference/type-aliases/RightsManagementComponentType.md +0 -5
- package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { NftAttestationConnector } from "@twin.org/attestation-connector-nft";
|
|
4
|
+
import { AttestationConnectorFactory } from "@twin.org/attestation-models";
|
|
5
|
+
import { AttestationRestClient } from "@twin.org/attestation-rest-client";
|
|
6
|
+
import { AttestationService } from "@twin.org/attestation-service";
|
|
7
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
8
|
+
import { AttestationComponentType } from "../models/types/attestationComponentType.js";
|
|
9
|
+
import { AttestationConnectorType } from "../models/types/attestationConnectorType.js";
|
|
10
|
+
/**
|
|
11
|
+
* Initialise the attestation connector.
|
|
12
|
+
* @param engineCore The engine core.
|
|
13
|
+
* @param context The context for the engine.
|
|
14
|
+
* @param instanceConfig The instance config.
|
|
15
|
+
* @returns The instance created and the factory for it.
|
|
16
|
+
*/
|
|
17
|
+
export async function initialiseAttestationConnector(engineCore, context, instanceConfig) {
|
|
18
|
+
let component;
|
|
19
|
+
let instanceType;
|
|
20
|
+
if (instanceConfig.type === AttestationConnectorType.Nft) {
|
|
21
|
+
component = new NftAttestationConnector({
|
|
22
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
23
|
+
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
24
|
+
...instanceConfig.options
|
|
25
|
+
});
|
|
26
|
+
instanceType = NftAttestationConnector.NAMESPACE;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
component,
|
|
30
|
+
instanceType,
|
|
31
|
+
factory: AttestationConnectorFactory
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Initialise the attestation component.
|
|
36
|
+
* @param engineCore The engine core.
|
|
37
|
+
* @param context The context for the engine.
|
|
38
|
+
* @param instanceConfig The instance config.
|
|
39
|
+
* @returns The instance created and the factory for it.
|
|
40
|
+
*/
|
|
41
|
+
export async function initialiseAttestationComponent(engineCore, context, instanceConfig) {
|
|
42
|
+
let component;
|
|
43
|
+
let instanceType;
|
|
44
|
+
if (instanceConfig.type === AttestationComponentType.Service) {
|
|
45
|
+
component = new AttestationService({
|
|
46
|
+
...instanceConfig.options
|
|
47
|
+
});
|
|
48
|
+
instanceType = "attestation-service";
|
|
49
|
+
}
|
|
50
|
+
else if (instanceConfig.type === AttestationComponentType.RestClient) {
|
|
51
|
+
component = new AttestationRestClient(instanceConfig.options);
|
|
52
|
+
instanceType = "attestation-rest-client";
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
component,
|
|
56
|
+
instanceType,
|
|
57
|
+
factory: ComponentFactory
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=attestation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation.js","sourceRoot":"","sources":["../../../src/components/attestation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EACN,2BAA2B,EAG3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAMnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,UAAsC,EACtC,OAA0C,EAC1C,cAA0C;IAM1C,IAAI,SAA4C,CAAC;IACjD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,GAAG,EAAE,CAAC;QAC1D,SAAS,GAAG,IAAI,uBAAuB,CAAC;YACvC,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,gBAAgB,EAAE,UAAU,CAAC,yBAAyB,CAAC,cAAc,CAAC;YACtE,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,GAAG,uBAAuB,CAAC,SAAS,CAAC;IAClD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,2BAA2B;KACpC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,UAAsC,EACtC,OAA0C,EAC1C,cAA0C;IAE1C,IAAI,SAA4C,CAAC;IACjD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,EAAE,CAAC;QAC9D,SAAS,GAAG,IAAI,kBAAkB,CAAC;YAClC,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,wBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACxE,SAAS,GAAG,IAAI,qBAAqB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAY,4BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { NftAttestationConnector } from \"@twin.org/attestation-connector-nft\";\nimport {\n\tAttestationConnectorFactory,\n\ttype IAttestationComponent,\n\ttype IAttestationConnector\n} from \"@twin.org/attestation-models\";\nimport { AttestationRestClient } from \"@twin.org/attestation-rest-client\";\nimport { AttestationService } from \"@twin.org/attestation-service\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { AttestationComponentConfig } from \"../models/config/attestationComponentConfig.js\";\nimport type { AttestationConnectorConfig } from \"../models/config/attestationConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { AttestationComponentType } from \"../models/types/attestationComponentType.js\";\nimport { AttestationConnectorType } from \"../models/types/attestationConnectorType.js\";\n\n/**\n * Initialise the attestation 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 initialiseAttestationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: AttestationConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof AttestationConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IAttestationConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AttestationConnectorType.Nft) {\n\t\tcomponent = new NftAttestationConnector({\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tnftConnectorType: engineCore.getRegisteredInstanceType(\"nftConnector\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = NftAttestationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: AttestationConnectorFactory\n\t};\n}\n\n/**\n * Initialise the attestation 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 initialiseAttestationComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: AttestationComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IAttestationComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AttestationComponentType.Service) {\n\t\tcomponent = new AttestationService({\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(AttestationService);\n\t} else if (instanceConfig.type === AttestationComponentType.RestClient) {\n\t\tcomponent = new AttestationRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(AttestationRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AuditableItemGraphRestClient } from "@twin.org/auditable-item-graph-rest-client";
|
|
2
|
+
import { AuditableItemGraphService, initSchema as initSchemaAuditableItemGraph } from "@twin.org/auditable-item-graph-service";
|
|
3
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
4
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
6
|
+
import { AuditableItemGraphComponentType } from "../models/types/auditableItemGraphComponentType.js";
|
|
7
|
+
/**
|
|
8
|
+
* Initialise the auditable item graph component.
|
|
9
|
+
* @param engineCore The engine core.
|
|
10
|
+
* @param context The context for the engine.
|
|
11
|
+
* @param instanceConfig The instance config.
|
|
12
|
+
* @returns The instance created and the factory for it.
|
|
13
|
+
*/
|
|
14
|
+
export async function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig) {
|
|
15
|
+
let component;
|
|
16
|
+
let instanceType;
|
|
17
|
+
if (instanceConfig.type === AuditableItemGraphComponentType.Service) {
|
|
18
|
+
initSchemaAuditableItemGraph();
|
|
19
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
20
|
+
ContextIdKeys.Node,
|
|
21
|
+
ContextIdKeys.Tenant
|
|
22
|
+
]));
|
|
23
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
24
|
+
ContextIdKeys.Node,
|
|
25
|
+
ContextIdKeys.Tenant
|
|
26
|
+
]));
|
|
27
|
+
component = new AuditableItemGraphService({
|
|
28
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
29
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
30
|
+
...instanceConfig.options
|
|
31
|
+
});
|
|
32
|
+
instanceType = "auditable-item-graph-service";
|
|
33
|
+
}
|
|
34
|
+
else if (instanceConfig.type === AuditableItemGraphComponentType.RestClient) {
|
|
35
|
+
component = new AuditableItemGraphRestClient(instanceConfig.options);
|
|
36
|
+
instanceType = "auditable-item-graph-rest-client";
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
component,
|
|
40
|
+
instanceType,
|
|
41
|
+
factory: ComponentFactory
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=auditableItemGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditableItemGraph.js","sourceRoot":"","sources":["../../../src/components/auditableItemGraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAEN,yBAAyB,EAEzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAEjD,IAAI,SAAmD,CAAC;IACxD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,uBAAuB,8BAE/C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,0BAA0B,iCAElD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,iCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,qCAAgD,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphComponent } from \"@twin.org/auditable-item-graph-models\";\nimport { AuditableItemGraphRestClient } from \"@twin.org/auditable-item-graph-rest-client\";\nimport {\n\ttype AuditableItemGraphChangeset,\n\tAuditableItemGraphService,\n\ttype AuditableItemGraphVertex,\n\tinitSchema as initSchemaAuditableItemGraph\n} from \"@twin.org/auditable-item-graph-service\";\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 { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { AuditableItemGraphComponentConfig } from \"../models/config/auditableItemGraphComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { AuditableItemGraphComponentType } from \"../models/types/auditableItemGraphComponentType.js\";\n\n/**\n * Initialise the auditable item graph 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 initialiseAuditableItemGraphComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: AuditableItemGraphComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IAuditableItemGraphComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AuditableItemGraphComponentType.Service) {\n\t\tinitSchemaAuditableItemGraph();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.vertexEntityStorageType,\n\t\t\tnameof<AuditableItemGraphVertex>(),\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?.changesetEntityStorageType,\n\t\t\tnameof<AuditableItemGraphChangeset>(),\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 AuditableItemGraphService({\n\t\t\timmutableProofComponentType: engineCore.getRegisteredInstanceType(\"immutableProofComponent\"),\n\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuditableItemGraphService);\n\t} else if (instanceConfig.type === AuditableItemGraphComponentType.RestClient) {\n\t\tcomponent = new AuditableItemGraphRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(AuditableItemGraphRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AuditableItemStreamRestClient } from "@twin.org/auditable-item-stream-rest-client";
|
|
2
|
+
import { AuditableItemStreamService, initSchema as initSchemaAuditableItemStream } from "@twin.org/auditable-item-stream-service";
|
|
3
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
4
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
6
|
+
import { AuditableItemStreamComponentType } from "../models/types/auditableItemStreamComponentType.js";
|
|
7
|
+
/**
|
|
8
|
+
* Initialise the auditable item stream component.
|
|
9
|
+
* @param engineCore The engine core.
|
|
10
|
+
* @param context The context for the engine.
|
|
11
|
+
* @param instanceConfig The instance config.
|
|
12
|
+
* @returns The instance created and the factory for it.
|
|
13
|
+
*/
|
|
14
|
+
export async function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig) {
|
|
15
|
+
let component;
|
|
16
|
+
let instanceType;
|
|
17
|
+
if (instanceConfig.type === AuditableItemStreamComponentType.Service) {
|
|
18
|
+
initSchemaAuditableItemStream();
|
|
19
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
20
|
+
ContextIdKeys.Node,
|
|
21
|
+
ContextIdKeys.Tenant
|
|
22
|
+
]));
|
|
23
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
24
|
+
ContextIdKeys.Node,
|
|
25
|
+
ContextIdKeys.Tenant
|
|
26
|
+
]));
|
|
27
|
+
component = new AuditableItemStreamService({
|
|
28
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
29
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
30
|
+
...instanceConfig.options
|
|
31
|
+
});
|
|
32
|
+
instanceType = "auditable-item-stream-service";
|
|
33
|
+
}
|
|
34
|
+
else if (instanceConfig.type === AuditableItemStreamComponentType.RestClient) {
|
|
35
|
+
component = new AuditableItemStreamRestClient(instanceConfig.options);
|
|
36
|
+
instanceType = "auditable-item-stream-rest-client";
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
component,
|
|
40
|
+
instanceType,
|
|
41
|
+
factory: ComponentFactory
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=auditableItemStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditableItemStream.js","sourceRoot":"","sources":["../../../src/components/auditableItemStream.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAGN,0BAA0B,EAC1B,UAAU,IAAI,6BAA6B,EAC3C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAElD,IAAI,SAAoD,CAAC;IACzD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,6BAA6B,EAAE,CAAC;QAEhC,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,uBAAuB,yBAE/C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,8BAEpD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,0BAA0B,CAAC;YAC1C,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,kCAA8C,CAAC;IAC5D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,UAAU,EAAE,CAAC;QAChF,SAAS,GAAG,IAAI,6BAA6B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACtE,YAAY,sCAAiD,CAAC;IAC/D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemStreamComponent } from \"@twin.org/auditable-item-stream-models\";\nimport { AuditableItemStreamRestClient } from \"@twin.org/auditable-item-stream-rest-client\";\nimport {\n\ttype AuditableItemStream,\n\ttype AuditableItemStreamEntry,\n\tAuditableItemStreamService,\n\tinitSchema as initSchemaAuditableItemStream\n} from \"@twin.org/auditable-item-stream-service\";\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 { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { AuditableItemStreamComponentConfig } from \"../models/config/auditableItemStreamComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { AuditableItemStreamComponentType } from \"../models/types/auditableItemStreamComponentType.js\";\n\n/**\n * Initialise the auditable item stream 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 initialiseAuditableItemStreamComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: AuditableItemStreamComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IAuditableItemStreamComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AuditableItemStreamComponentType.Service) {\n\t\tinitSchemaAuditableItemStream();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.streamEntityStorageType,\n\t\t\tnameof<AuditableItemStream>(),\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?.streamEntryEntityStorageType,\n\t\t\tnameof<AuditableItemStreamEntry>(),\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 AuditableItemStreamService({\n\t\t\timmutableProofComponentType: engineCore.getRegisteredInstanceType(\"immutableProofComponent\"),\n\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuditableItemStreamService);\n\t} else if (instanceConfig.type === AuditableItemStreamComponentType.RestClient) {\n\t\tcomponent = new AuditableItemStreamRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(AuditableItemStreamRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { AuthenticationGeneratorFactory } from "@twin.org/api-models";
|
|
4
|
+
import { VerifiableCredentialAuthenticationGenerator } from "@twin.org/identity-authentication";
|
|
5
|
+
import { AuthenticationGeneratorComponentType } from "../models/types/authenticationGeneratorComponentType.js";
|
|
6
|
+
/**
|
|
7
|
+
* Initialise the authentication generator component.
|
|
8
|
+
* @param engineCore The engine core.
|
|
9
|
+
* @param context The context for the engine.
|
|
10
|
+
* @param instanceConfig The instance config.
|
|
11
|
+
* @returns The instance created and the factory for it.
|
|
12
|
+
*/
|
|
13
|
+
export async function initialiseAuthenticationGeneratorComponent(engineCore, context, instanceConfig) {
|
|
14
|
+
let component;
|
|
15
|
+
let instanceType;
|
|
16
|
+
if (instanceConfig.type === AuthenticationGeneratorComponentType.VerifiableCredential) {
|
|
17
|
+
component = new VerifiableCredentialAuthenticationGenerator({
|
|
18
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
19
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
20
|
+
...instanceConfig.options
|
|
21
|
+
});
|
|
22
|
+
instanceType = "verifiable-credential-authentication-generator";
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
component,
|
|
26
|
+
instanceType,
|
|
27
|
+
factory: AuthenticationGeneratorFactory
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=authenticationGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationGenerator.js","sourceRoot":"","sources":["../../../src/components/authenticationGenerator.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,8BAA8B,EAE9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,2CAA2C,EAAE,MAAM,mCAAmC,CAAC;AAIhG,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAE/G;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0CAA0C,CAC/D,UAAsC,EACtC,OAA0C,EAC1C,cAAsD;IAMtD,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;QACvF,SAAS,GAAG,IAAI,2CAA2C,CAAC;YAC3D,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,mDAA+D,CAAC;IAC7E,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,8BAA8B;KACvC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAuthenticationGeneratorFactory,\n\ttype IAuthenticationGenerator\n} from \"@twin.org/api-models\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { VerifiableCredentialAuthenticationGenerator } from \"@twin.org/identity-authentication\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { AuthenticationGeneratorComponentConfig } from \"../models/config/authenticationGeneratorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { AuthenticationGeneratorComponentType } from \"../models/types/authenticationGeneratorComponentType.js\";\n\n/**\n * Initialise the authentication generator 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 initialiseAuthenticationGeneratorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: AuthenticationGeneratorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof AuthenticationGeneratorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IAuthenticationGenerator | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === AuthenticationGeneratorComponentType.VerifiableCredential) {\n\t\tcomponent = new VerifiableCredentialAuthenticationGenerator({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(VerifiableCredentialAuthenticationGenerator);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: AuthenticationGeneratorFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BackgroundTaskService, initSchema } from "@twin.org/background-task-service";
|
|
2
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
4
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
5
|
+
import { BackgroundTaskComponentType } from "../models/types/backgroundTaskComponentType.js";
|
|
6
|
+
/**
|
|
7
|
+
* Initialise a background task component.
|
|
8
|
+
* @param engineCore The engine core.
|
|
9
|
+
* @param context The context for the engine.
|
|
10
|
+
* @param instanceConfig The instance config.
|
|
11
|
+
* @returns The instance created and the factory for it.
|
|
12
|
+
*/
|
|
13
|
+
export async function initialiseBackgroundTaskComponent(engineCore, context, instanceConfig) {
|
|
14
|
+
let component;
|
|
15
|
+
let instanceType;
|
|
16
|
+
if (instanceConfig.type === BackgroundTaskComponentType.Service) {
|
|
17
|
+
initSchema();
|
|
18
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
19
|
+
component = new BackgroundTaskService({
|
|
20
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
21
|
+
...instanceConfig.options
|
|
22
|
+
});
|
|
23
|
+
instanceType = "background-task-service";
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
component,
|
|
27
|
+
instanceType,
|
|
28
|
+
factory: ComponentFactory
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=backgroundTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundTask.js","sourceRoot":"","sources":["../../../src/components/backgroundTask.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,qBAAqB,EACrB,UAAU,EAEV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,UAAU,EAAE,CAAC;QACb,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBackgroundTaskComponent } from \"@twin.org/background-task-models\";\nimport {\n\tBackgroundTaskService,\n\tinitSchema,\n\ttype BackgroundTask\n} from \"@twin.org/background-task-service\";\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 { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { BackgroundTaskComponentConfig } from \"../models/config/backgroundTaskComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { BackgroundTaskComponentType } from \"../models/types/backgroundTaskComponentType.js\";\n\n/**\n * Initialise a background task 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 initialiseBackgroundTaskComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BackgroundTaskComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBackgroundTaskComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BackgroundTaskComponentType.Service) {\n\t\tinitSchema();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.backgroundTaskEntityStorageType,\n\t\t\tnameof<BackgroundTask>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tcomponent = new BackgroundTaskService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(BackgroundTaskService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { S3BlobStorageConnector } from "@twin.org/blob-storage-connector-aws-s3";
|
|
5
|
+
import { AzureBlobStorageConnector } from "@twin.org/blob-storage-connector-azure";
|
|
6
|
+
import { FileBlobStorageConnector } from "@twin.org/blob-storage-connector-file";
|
|
7
|
+
import { GcpBlobStorageConnector } from "@twin.org/blob-storage-connector-gcp";
|
|
8
|
+
import { IpfsBlobStorageConnector } from "@twin.org/blob-storage-connector-ipfs";
|
|
9
|
+
import { MemoryBlobStorageConnector } from "@twin.org/blob-storage-connector-memory";
|
|
10
|
+
import { BlobStorageConnectorFactory } from "@twin.org/blob-storage-models";
|
|
11
|
+
import { BlobStorageRestClient } from "@twin.org/blob-storage-rest-client";
|
|
12
|
+
import { BlobStorageService, initSchema as initSchemaBlobStorage } from "@twin.org/blob-storage-service";
|
|
13
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
14
|
+
import { Is, ComponentFactory } from "@twin.org/core";
|
|
15
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
16
|
+
import { BlobStorageComponentType } from "../models/types/blobStorageComponentType.js";
|
|
17
|
+
import { BlobStorageConnectorType } from "../models/types/blobStorageConnectorType.js";
|
|
18
|
+
/**
|
|
19
|
+
* Initialise the blob storage connector.
|
|
20
|
+
* @param engineCore The engine core.
|
|
21
|
+
* @param context The context for the engine.
|
|
22
|
+
* @param instanceConfig The instance config.
|
|
23
|
+
* @returns The instance created and the factory for it.
|
|
24
|
+
*/
|
|
25
|
+
export async function initialiseBlobStorageConnector(engineCore, context, instanceConfig) {
|
|
26
|
+
let component;
|
|
27
|
+
let instanceType;
|
|
28
|
+
if (instanceConfig.type === BlobStorageConnectorType.Ipfs) {
|
|
29
|
+
component = new IpfsBlobStorageConnector({
|
|
30
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
31
|
+
ContextIdKeys.Node,
|
|
32
|
+
ContextIdKeys.Tenant
|
|
33
|
+
]),
|
|
34
|
+
...instanceConfig.options
|
|
35
|
+
});
|
|
36
|
+
instanceType = IpfsBlobStorageConnector.NAMESPACE;
|
|
37
|
+
}
|
|
38
|
+
else if (instanceConfig.type === BlobStorageConnectorType.File) {
|
|
39
|
+
component = new FileBlobStorageConnector({
|
|
40
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
41
|
+
ContextIdKeys.Node,
|
|
42
|
+
ContextIdKeys.Tenant
|
|
43
|
+
]),
|
|
44
|
+
...instanceConfig.options,
|
|
45
|
+
config: {
|
|
46
|
+
...instanceConfig.options.config,
|
|
47
|
+
directory: Is.stringValue(instanceConfig.options.storagePrefix)
|
|
48
|
+
? path.join(instanceConfig.options.config.directory, instanceConfig.options.storagePrefix)
|
|
49
|
+
: instanceConfig.options.config.directory
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
instanceType = FileBlobStorageConnector.NAMESPACE;
|
|
53
|
+
}
|
|
54
|
+
else if (instanceConfig.type === BlobStorageConnectorType.Memory) {
|
|
55
|
+
component = new MemoryBlobStorageConnector({
|
|
56
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
57
|
+
ContextIdKeys.Node,
|
|
58
|
+
ContextIdKeys.Tenant
|
|
59
|
+
])
|
|
60
|
+
});
|
|
61
|
+
instanceType = MemoryBlobStorageConnector.NAMESPACE;
|
|
62
|
+
}
|
|
63
|
+
else if (instanceConfig.type === BlobStorageConnectorType.AwsS3) {
|
|
64
|
+
component = new S3BlobStorageConnector({
|
|
65
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
66
|
+
ContextIdKeys.Node,
|
|
67
|
+
ContextIdKeys.Tenant
|
|
68
|
+
]),
|
|
69
|
+
...instanceConfig.options,
|
|
70
|
+
config: {
|
|
71
|
+
...instanceConfig.options.config,
|
|
72
|
+
bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
instanceType = S3BlobStorageConnector.NAMESPACE;
|
|
76
|
+
}
|
|
77
|
+
else if (instanceConfig.type === BlobStorageConnectorType.GcpStorage) {
|
|
78
|
+
component = new GcpBlobStorageConnector({
|
|
79
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
80
|
+
ContextIdKeys.Node,
|
|
81
|
+
ContextIdKeys.Tenant
|
|
82
|
+
]),
|
|
83
|
+
...instanceConfig.options,
|
|
84
|
+
config: {
|
|
85
|
+
...instanceConfig.options.config,
|
|
86
|
+
bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
instanceType = GcpBlobStorageConnector.NAMESPACE;
|
|
90
|
+
}
|
|
91
|
+
else if (instanceConfig.type === BlobStorageConnectorType.AzureStorage) {
|
|
92
|
+
component = new AzureBlobStorageConnector({
|
|
93
|
+
partitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
94
|
+
ContextIdKeys.Node,
|
|
95
|
+
ContextIdKeys.Tenant
|
|
96
|
+
]),
|
|
97
|
+
...instanceConfig.options,
|
|
98
|
+
config: {
|
|
99
|
+
...instanceConfig.options.config,
|
|
100
|
+
containerName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.containerName}`
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
instanceType = AzureBlobStorageConnector.NAMESPACE;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
component,
|
|
107
|
+
instanceType,
|
|
108
|
+
factory: BlobStorageConnectorFactory
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Initialise the blob storage component.
|
|
113
|
+
* @param engineCore The engine core.
|
|
114
|
+
* @param context The context for the engine.
|
|
115
|
+
* @param instanceConfig The instance config.
|
|
116
|
+
* @returns The instance created and the factory for it.
|
|
117
|
+
*/
|
|
118
|
+
export async function initialiseBlobStorageComponent(engineCore, context, instanceConfig) {
|
|
119
|
+
let component;
|
|
120
|
+
let instanceType;
|
|
121
|
+
if (instanceConfig.type === BlobStorageComponentType.Service) {
|
|
122
|
+
initSchemaBlobStorage();
|
|
123
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
124
|
+
ContextIdKeys.Node,
|
|
125
|
+
ContextIdKeys.Tenant
|
|
126
|
+
]));
|
|
127
|
+
component = new BlobStorageService({
|
|
128
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
129
|
+
...instanceConfig.options
|
|
130
|
+
});
|
|
131
|
+
instanceType = "blob-storage-service";
|
|
132
|
+
}
|
|
133
|
+
else if (instanceConfig.type === BlobStorageComponentType.RestClient) {
|
|
134
|
+
component = new BlobStorageRestClient(instanceConfig.options);
|
|
135
|
+
instanceType = "blob-storage-rest-client";
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
component,
|
|
139
|
+
instanceType,
|
|
140
|
+
factory: ComponentFactory
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=blobStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobStorage.js","sourceRoot":"","sources":["../../../src/components/blobStorage.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EACN,2BAA2B,EAG3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,kBAAkB,EAClB,UAAU,IAAI,qBAAqB,EAEnC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,EAAE,EAAmB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAItE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,UAAsC,EACtC,OAA0C,EAC1C,cAA0C;IAM1C,IAAI,SAA4C,CAAC;IACjD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,EAAE,CAAC;QAC3D,SAAS,GAAG,IAAI,wBAAwB,CAAC;YACxC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;YACF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,GAAG,wBAAwB,CAAC,SAAS,CAAC;IACnD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,EAAE,CAAC;QAClE,SAAS,GAAG,IAAI,wBAAwB,CAAC;YACxC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;YACF,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM;gBAChC,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC;oBAC9D,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC;oBAC1F,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS;aAC1C;SACD,CAAC,CAAC;QACH,YAAY,GAAG,wBAAwB,CAAC,SAAS,CAAC;IACnD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,MAAM,EAAE,CAAC;QACpE,SAAS,GAAG,IAAI,0BAA0B,CAAC;YAC1C,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;SACF,CAAC,CAAC;QACH,YAAY,GAAG,0BAA0B,CAAC,SAAS,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACnE,SAAS,GAAG,IAAI,sBAAsB,CAAC;YACtC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;YACF,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM;gBAChC,UAAU,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;aACtG;SACD,CAAC,CAAC;QACH,YAAY,GAAG,sBAAsB,CAAC,SAAS,CAAC;IACjD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACxE,SAAS,GAAG,IAAI,uBAAuB,CAAC;YACvC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;YACF,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM;gBAChC,UAAU,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;aACtG;SACD,CAAC,CAAC;QACH,YAAY,GAAG,uBAAuB,CAAC,SAAS,CAAC;IAClD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,YAAY,EAAE,CAAC;QAC1E,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACzF,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC;YACF,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM;gBAChC,aAAa,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;aAC5G;SACD,CAAC,CAAC;QACH,YAAY,GAAG,yBAAyB,CAAC,SAAS,CAAC;IACpD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,2BAA2B;KACpC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,UAAsC,EACtC,OAA0C,EAC1C,cAA0C;IAM1C,IAAI,SAA4C,CAAC;IACjD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,EAAE,CAAC;QAC9D,qBAAqB,EAAE,CAAC;QACxB,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,sBAAsB,sBAE9C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,kBAAkB,CAAC;YAClC,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,yBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACxE,SAAS,GAAG,IAAI,qBAAqB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAY,6BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { S3BlobStorageConnector } from \"@twin.org/blob-storage-connector-aws-s3\";\nimport { AzureBlobStorageConnector } from \"@twin.org/blob-storage-connector-azure\";\nimport { FileBlobStorageConnector } from \"@twin.org/blob-storage-connector-file\";\nimport { GcpBlobStorageConnector } from \"@twin.org/blob-storage-connector-gcp\";\nimport { IpfsBlobStorageConnector } from \"@twin.org/blob-storage-connector-ipfs\";\nimport { MemoryBlobStorageConnector } from \"@twin.org/blob-storage-connector-memory\";\nimport {\n\tBlobStorageConnectorFactory,\n\ttype IBlobStorageComponent,\n\ttype IBlobStorageConnector\n} from \"@twin.org/blob-storage-models\";\nimport { BlobStorageRestClient } from \"@twin.org/blob-storage-rest-client\";\nimport {\n\tBlobStorageService,\n\tinitSchema as initSchemaBlobStorage,\n\ttype BlobStorageEntry\n} from \"@twin.org/blob-storage-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { Is, type IComponent, ComponentFactory } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { BlobStorageComponentConfig } from \"../models/config/blobStorageComponentConfig.js\";\nimport type { BlobStorageConnectorConfig } from \"../models/config/blobStorageConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { BlobStorageComponentType } from \"../models/types/blobStorageComponentType.js\";\nimport { BlobStorageConnectorType } from \"../models/types/blobStorageConnectorType.js\";\n\n/**\n * Initialise the blob storage connector.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseBlobStorageConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BlobStorageConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof BlobStorageConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBlobStorageConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BlobStorageConnectorType.Ipfs) {\n\t\tcomponent = new IpfsBlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t]),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = IpfsBlobStorageConnector.NAMESPACE;\n\t} else if (instanceConfig.type === BlobStorageConnectorType.File) {\n\t\tcomponent = new FileBlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t]),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options.config,\n\t\t\t\tdirectory: Is.stringValue(instanceConfig.options.storagePrefix)\n\t\t\t\t\t? path.join(instanceConfig.options.config.directory, instanceConfig.options.storagePrefix)\n\t\t\t\t\t: instanceConfig.options.config.directory\n\t\t\t}\n\t\t});\n\t\tinstanceType = FileBlobStorageConnector.NAMESPACE;\n\t} else if (instanceConfig.type === BlobStorageConnectorType.Memory) {\n\t\tcomponent = new MemoryBlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t});\n\t\tinstanceType = MemoryBlobStorageConnector.NAMESPACE;\n\t} else if (instanceConfig.type === BlobStorageConnectorType.AwsS3) {\n\t\tcomponent = new S3BlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t]),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options.config,\n\t\t\t\tbucketName: `${instanceConfig.options.storagePrefix ?? \"\"}${instanceConfig.options.config.bucketName}`\n\t\t\t}\n\t\t});\n\t\tinstanceType = S3BlobStorageConnector.NAMESPACE;\n\t} else if (instanceConfig.type === BlobStorageConnectorType.GcpStorage) {\n\t\tcomponent = new GcpBlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t]),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options.config,\n\t\t\t\tbucketName: `${instanceConfig.options.storagePrefix ?? \"\"}${instanceConfig.options.config.bucketName}`\n\t\t\t}\n\t\t});\n\t\tinstanceType = GcpBlobStorageConnector.NAMESPACE;\n\t} else if (instanceConfig.type === BlobStorageConnectorType.AzureStorage) {\n\t\tcomponent = new AzureBlobStorageConnector({\n\t\t\tpartitionContextIds: ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t]),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options.config,\n\t\t\t\tcontainerName: `${instanceConfig.options.storagePrefix ?? \"\"}${instanceConfig.options.config.containerName}`\n\t\t\t}\n\t\t});\n\t\tinstanceType = AzureBlobStorageConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: BlobStorageConnectorFactory\n\t};\n}\n\n/**\n * Initialise the blob storage component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseBlobStorageComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BlobStorageComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBlobStorageComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BlobStorageComponentType.Service) {\n\t\tinitSchemaBlobStorage();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.entryEntityStorageType,\n\t\t\tnameof<BlobStorageEntry>(),\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 BlobStorageService({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(BlobStorageService);\n\t} else if (instanceConfig.type === BlobStorageComponentType.RestClient) {\n\t\tcomponent = new BlobStorageRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(BlobStorageRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { TenantIdContextIdHandler } from "@twin.org/api-tenant-processor";
|
|
4
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
|
+
import { DidContextIdHandler } from "@twin.org/identity-models";
|
|
6
|
+
import { ContextIdHandlerComponentType } from "../models/types/contextIdHandlerComponentType.js";
|
|
7
|
+
/**
|
|
8
|
+
* Initialise the context id handler component.
|
|
9
|
+
* @param engineCore The engine core.
|
|
10
|
+
* @param context The context for the engine.
|
|
11
|
+
* @param instanceConfig The instance config.
|
|
12
|
+
* @returns The instance created and the factory for it.
|
|
13
|
+
*/
|
|
14
|
+
export async function initialiseContextIdHandlerComponent(engineCore, context, instanceConfig) {
|
|
15
|
+
let component;
|
|
16
|
+
let instanceType;
|
|
17
|
+
if (instanceConfig.type === ContextIdHandlerComponentType.Did) {
|
|
18
|
+
component = new DidContextIdHandler();
|
|
19
|
+
instanceType = "did-context-id-handler";
|
|
20
|
+
}
|
|
21
|
+
else if (instanceConfig.type === ContextIdHandlerComponentType.Tenant) {
|
|
22
|
+
component = new TenantIdContextIdHandler();
|
|
23
|
+
instanceType = "tenant-id-context-id-handler";
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
component,
|
|
27
|
+
instanceType,
|
|
28
|
+
factory: ComponentFactory
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=contextIdHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextIdHandler.js","sourceRoot":"","sources":["../../../src/components/contextIdHandler.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEjG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mCAAmC,CACxD,UAAsC,EACtC,OAA0C,EAC1C,cAA+C;IAM/C,IAAI,SAAwC,CAAC;IAC7C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,6BAA6B,CAAC,GAAG,EAAE,CAAC;QAC/D,SAAS,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACtC,YAAY,2BAAuC,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,6BAA6B,CAAC,MAAM,EAAE,CAAC;QACzE,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;QAC3C,YAAY,iCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { TenantIdContextIdHandler } from \"@twin.org/api-tenant-processor\";\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { DidContextIdHandler } from \"@twin.org/identity-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { ContextIdHandlerComponentConfig } from \"../models/config/contextIdHandlerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ContextIdHandlerComponentType } from \"../models/types/contextIdHandlerComponentType.js\";\n\n/**\n * Initialise the context id handler 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 initialiseContextIdHandlerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ContextIdHandlerComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IContextIdHandler | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === ContextIdHandlerComponentType.Did) {\n\t\tcomponent = new DidContextIdHandler();\n\t\tinstanceType = nameofKebabCase(DidContextIdHandler);\n\t} else if (instanceConfig.type === ContextIdHandlerComponentType.Tenant) {\n\t\tcomponent = new TenantIdContextIdHandler();\n\t\tinstanceType = nameofKebabCase(TenantIdContextIdHandler);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Copyright 2024 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 { JsonConverterConnector, XmlConverterConnector } from "@twin.org/data-processing-converters";
|
|
6
|
+
import { JsonPathExtractorConnector } from "@twin.org/data-processing-extractors";
|
|
7
|
+
import { DataConverterConnectorFactory, DataExtractorConnectorFactory } from "@twin.org/data-processing-models";
|
|
8
|
+
import { DataProcessingRestClient } from "@twin.org/data-processing-rest-client";
|
|
9
|
+
import { DataProcessingService, initSchema as initSchemaDataProcessing } from "@twin.org/data-processing-service";
|
|
10
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
11
|
+
import { DataConverterConnectorType } from "../models/types/dataConverterConnectorType.js";
|
|
12
|
+
import { DataExtractorConnectorType } from "../models/types/dataExtractorConnectorType.js";
|
|
13
|
+
import { DataProcessingComponentType } from "../models/types/dataProcessingComponentType.js";
|
|
14
|
+
/**
|
|
15
|
+
* Initialise the data converter connector.
|
|
16
|
+
* @param engineCore The engine core.
|
|
17
|
+
* @param context The context for the engine.
|
|
18
|
+
* @param instanceConfig The instance config.
|
|
19
|
+
* @returns The instance created and the factory for it.
|
|
20
|
+
*/
|
|
21
|
+
export async function initialiseDataConverterConnector(engineCore, context, instanceConfig) {
|
|
22
|
+
let component;
|
|
23
|
+
let instanceType;
|
|
24
|
+
if (instanceConfig.type === DataConverterConnectorType.Json) {
|
|
25
|
+
component = new JsonConverterConnector();
|
|
26
|
+
instanceType = JsonConverterConnector.NAMESPACE;
|
|
27
|
+
}
|
|
28
|
+
else if (instanceConfig.type === DataConverterConnectorType.Xml) {
|
|
29
|
+
component = new XmlConverterConnector();
|
|
30
|
+
instanceType = XmlConverterConnector.NAMESPACE;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
component,
|
|
34
|
+
instanceType,
|
|
35
|
+
factory: DataConverterConnectorFactory
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Initialise the data extractor connector.
|
|
40
|
+
* @param engineCore The engine core.
|
|
41
|
+
* @param context The context for the engine.
|
|
42
|
+
* @param instanceConfig The instance config.
|
|
43
|
+
* @returns The instance created and the factory for it.
|
|
44
|
+
*/
|
|
45
|
+
export async function initialiseDataExtractorConnector(engineCore, context, instanceConfig) {
|
|
46
|
+
let component;
|
|
47
|
+
let instanceType;
|
|
48
|
+
if (instanceConfig.type === DataExtractorConnectorType.JsonPath) {
|
|
49
|
+
component = new JsonPathExtractorConnector();
|
|
50
|
+
instanceType = JsonPathExtractorConnector.NAMESPACE;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
component,
|
|
54
|
+
instanceType,
|
|
55
|
+
factory: DataExtractorConnectorFactory
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Initialise the data processing component.
|
|
60
|
+
* @param engineCore The engine core.
|
|
61
|
+
* @param context The context for the engine.
|
|
62
|
+
* @param instanceConfig The instance config.
|
|
63
|
+
* @returns The instance created and the factory for it.
|
|
64
|
+
*/
|
|
65
|
+
export async function initialiseDataProcessingComponent(engineCore, context, instanceConfig) {
|
|
66
|
+
let component;
|
|
67
|
+
let instanceType;
|
|
68
|
+
if (instanceConfig.type === DataProcessingComponentType.Service) {
|
|
69
|
+
initSchemaDataProcessing();
|
|
70
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.extractionRuleGroupStorageConnectorType, "ExtractionRuleGroup", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
|
|
71
|
+
ContextIdKeys.Node,
|
|
72
|
+
ContextIdKeys.Tenant
|
|
73
|
+
]));
|
|
74
|
+
component = new DataProcessingService({
|
|
75
|
+
...instanceConfig.options
|
|
76
|
+
});
|
|
77
|
+
instanceType = "data-processing-service";
|
|
78
|
+
}
|
|
79
|
+
else if (instanceConfig.type === DataProcessingComponentType.RestClient) {
|
|
80
|
+
component = new DataProcessingRestClient(instanceConfig.options);
|
|
81
|
+
instanceType = "data-processing-rest-client";
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
component,
|
|
85
|
+
instanceType,
|
|
86
|
+
factory: ComponentFactory
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=dataProcessing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataProcessing.js","sourceRoot":"","sources":["../../../src/components/dataProcessing.ts"],"names":[],"mappings":"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","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 {\n\tJsonConverterConnector,\n\tXmlConverterConnector\n} from \"@twin.org/data-processing-converters\";\nimport { JsonPathExtractorConnector } from \"@twin.org/data-processing-extractors\";\nimport {\n\tDataConverterConnectorFactory,\n\tDataExtractorConnectorFactory,\n\ttype IDataConverterConnector,\n\ttype IDataExtractorConnector,\n\ttype IDataProcessingComponent\n} from \"@twin.org/data-processing-models\";\nimport { DataProcessingRestClient } from \"@twin.org/data-processing-rest-client\";\nimport {\n\tDataProcessingService,\n\tinitSchema as initSchemaDataProcessing,\n\ttype ExtractionRuleGroup\n} from \"@twin.org/data-processing-service\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataConverterConnectorConfig } from \"../models/config/dataConverterConnectorConfig.js\";\nimport type { DataExtractorConnectorConfig } from \"../models/config/dataExtractorConnectorConfig.js\";\nimport type { DataProcessingComponentConfig } from \"../models/config/dataProcessingComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataConverterConnectorType } from \"../models/types/dataConverterConnectorType.js\";\nimport { DataExtractorConnectorType } from \"../models/types/dataExtractorConnectorType.js\";\nimport { DataProcessingComponentType } from \"../models/types/dataProcessingComponentType.js\";\n\n/**\n * Initialise the data converter 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 initialiseDataConverterConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataConverterConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof DataConverterConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataConverterConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataConverterConnectorType.Json) {\n\t\tcomponent = new JsonConverterConnector();\n\t\tinstanceType = JsonConverterConnector.NAMESPACE;\n\t} else if (instanceConfig.type === DataConverterConnectorType.Xml) {\n\t\tcomponent = new XmlConverterConnector();\n\t\tinstanceType = XmlConverterConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: DataConverterConnectorFactory\n\t};\n}\n\n/**\n * Initialise the data extractor 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 initialiseDataExtractorConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataExtractorConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof DataExtractorConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataExtractorConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataExtractorConnectorType.JsonPath) {\n\t\tcomponent = new JsonPathExtractorConnector();\n\t\tinstanceType = JsonPathExtractorConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: DataExtractorConnectorFactory\n\t};\n}\n\n/**\n * Initialise the data processing 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 initialiseDataProcessingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataProcessingComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataProcessingComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataProcessingComponentType.Service) {\n\t\tinitSchemaDataProcessing();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.extractionRuleGroupStorageConnectorType,\n\t\t\tnameof<ExtractionRuleGroup>(),\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 DataProcessingService({\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataProcessingService);\n\t} else if (instanceConfig.type === DataProcessingComponentType.RestClient) {\n\t\tcomponent = new DataProcessingRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(DataProcessingRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|