@twin.org/engine-types 0.0.2-next.9 → 0.0.3-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +33 -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/dataProcessing.js +89 -0
- package/dist/es/components/dataProcessing.js.map +1 -0
- package/dist/es/components/dataSpaceConnector.js +52 -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 +225 -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 +42 -0
- package/dist/es/components/federatedCatalogue.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 +44 -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 +38 -0
- package/dist/es/components/rightsManagementDap.js.map +1 -0
- package/dist/es/components/rightsManagementDarp.js +29 -0
- package/dist/es/components/rightsManagementDarp.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 +46 -0
- package/dist/es/components/rightsManagementPdp.js.map +1 -0
- package/dist/es/components/rightsManagementPep.js +44 -0
- package/dist/es/components/rightsManagementPep.js.map +1 -0
- package/dist/es/components/rightsManagementPip.js +43 -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 +61 -0
- package/dist/es/components/rightsManagementPnp.js.map +1 -0
- package/dist/es/components/rightsManagementPxp.js +43 -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/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 +152 -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/backgroundTaskConnectorConfig.js +2 -0
- package/dist/es/models/config/backgroundTaskConnectorConfig.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/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/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/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/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/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/backgroundTaskConnectorType.js +13 -0
- package/dist/es/models/types/backgroundTaskConnectorType.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/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/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/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/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/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 -6
- package/dist/types/components/blobStorage.d.ts +17 -11
- 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/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/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/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/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 +149 -128
- package/dist/types/models/IEngineConfig.d.ts +85 -50
- 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/backgroundTaskConnectorConfig.d.ts +1 -1
- 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/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/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 +12 -0
- package/dist/types/models/config/rightsManagementPapComponentConfig.d.ts +7 -3
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +6 -3
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +6 -3
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +6 -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 +17 -0
- package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +6 -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/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/dataSpaceConnectorComponentType.d.ts +21 -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/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/tenantAdminComponentType.d.ts +13 -0
- package/dist/types/utils/engineTypeHelper.d.ts +19 -0
- package/docs/changelog.md +298 -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/initialiseBackgroundTaskConnector.md +3 -13
- package/docs/reference/functions/initialiseBlobStorageComponent.md +3 -13
- package/docs/reference/functions/initialiseBlobStorageConnector.md +3 -13
- 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/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/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/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/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 +36 -5
- package/docs/reference/interfaces/IEngineConfig.md +45 -3
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.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/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 +23 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPapComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +7 -1
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +7 -1
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +7 -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/RightsManagementPxpComponentConfig.md +7 -1
- package/docs/reference/type-aliases/TenantAdminComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TenantAdminComponentType.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/BackgroundTaskConnectorType.md +1 -1
- package/docs/reference/variables/BlobStorageComponentType.md +1 -1
- package/docs/reference/variables/BlobStorageConnectorType.md +1 -1
- 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/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/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/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/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 +30 -9
- 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/rightsManagementComponentConfig.d.ts +0 -13
- package/dist/types/models/types/rightsManagementComponentType.d.ts +0 -17
- package/docs/reference/functions/initialiseRightsManagementComponent.md +0 -41
- package/docs/reference/functions/initialiseWalletStorage.md +0 -41
- package/docs/reference/type-aliases/RightsManagementComponentConfig.md +0 -5
- package/docs/reference/type-aliases/RightsManagementComponentType.md +0 -5
package/dist/esm/index.mjs
DELETED
|
@@ -1,3127 +0,0 @@
|
|
|
1
|
-
import { NftAttestationConnector } from '@twin.org/attestation-connector-nft';
|
|
2
|
-
import { AttestationConnectorFactory } from '@twin.org/attestation-models';
|
|
3
|
-
import { AttestationClient } from '@twin.org/attestation-rest-client';
|
|
4
|
-
import { AttestationService } from '@twin.org/attestation-service';
|
|
5
|
-
import { I18n, GeneralError, StringHelper, ComponentFactory, Is } from '@twin.org/core';
|
|
6
|
-
import { AuditableItemGraphClient } from '@twin.org/auditable-item-graph-rest-client';
|
|
7
|
-
import { initSchema, AuditableItemGraphService } from '@twin.org/auditable-item-graph-service';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
import { CosmosDbEntityStorageConnector } from '@twin.org/entity-storage-connector-cosmosdb';
|
|
10
|
-
import { DynamoDbEntityStorageConnector } from '@twin.org/entity-storage-connector-dynamodb';
|
|
11
|
-
import { FileEntityStorageConnector } from '@twin.org/entity-storage-connector-file';
|
|
12
|
-
import { FirestoreEntityStorageConnector } from '@twin.org/entity-storage-connector-gcp-firestore';
|
|
13
|
-
import { MemoryEntityStorageConnector } from '@twin.org/entity-storage-connector-memory';
|
|
14
|
-
import { MongoDbEntityStorageConnector } from '@twin.org/entity-storage-connector-mongodb';
|
|
15
|
-
import { MySqlEntityStorageConnector } from '@twin.org/entity-storage-connector-mysql';
|
|
16
|
-
import { PostgreSqlEntityStorageConnector } from '@twin.org/entity-storage-connector-postgresql';
|
|
17
|
-
import { ScyllaDBTableConnector } from '@twin.org/entity-storage-connector-scylladb';
|
|
18
|
-
import { SynchronisedEntityStorageConnector } from '@twin.org/entity-storage-connector-synchronised';
|
|
19
|
-
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
20
|
-
import { EntityStorageClient } from '@twin.org/entity-storage-rest-client';
|
|
21
|
-
import { EntityStorageService } from '@twin.org/entity-storage-service';
|
|
22
|
-
import { AuditableItemStreamClient } from '@twin.org/auditable-item-stream-rest-client';
|
|
23
|
-
import { initSchema as initSchema$1, AuditableItemStreamService } from '@twin.org/auditable-item-stream-service';
|
|
24
|
-
import { initSchema as initSchema$2, EntityStorageBackgroundTaskConnector } from '@twin.org/background-task-connector-entity-storage';
|
|
25
|
-
import { BackgroundTaskConnectorFactory } from '@twin.org/background-task-models';
|
|
26
|
-
import { S3BlobStorageConnector } from '@twin.org/blob-storage-connector-aws-s3';
|
|
27
|
-
import { AzureBlobStorageConnector } from '@twin.org/blob-storage-connector-azure';
|
|
28
|
-
import { FileBlobStorageConnector } from '@twin.org/blob-storage-connector-file';
|
|
29
|
-
import { GcpBlobStorageConnector } from '@twin.org/blob-storage-connector-gcp';
|
|
30
|
-
import { IpfsBlobStorageConnector } from '@twin.org/blob-storage-connector-ipfs';
|
|
31
|
-
import { MemoryBlobStorageConnector } from '@twin.org/blob-storage-connector-memory';
|
|
32
|
-
import { BlobStorageConnectorFactory } from '@twin.org/blob-storage-models';
|
|
33
|
-
import { BlobStorageClient } from '@twin.org/blob-storage-rest-client';
|
|
34
|
-
import { initSchema as initSchema$3, BlobStorageService } from '@twin.org/blob-storage-service';
|
|
35
|
-
import { JsonConverterConnector, XmlConverterConnector } from '@twin.org/data-processing-converters';
|
|
36
|
-
import { JsonPathExtractorConnector } from '@twin.org/data-processing-extractors';
|
|
37
|
-
import { DataConverterConnectorFactory, DataExtractorConnectorFactory } from '@twin.org/data-processing-models';
|
|
38
|
-
import { DataProcessingClient } from '@twin.org/data-processing-rest-client';
|
|
39
|
-
import { initSchema as initSchema$4, DataProcessingService } from '@twin.org/data-processing-service';
|
|
40
|
-
import { DocumentManagementClient } from '@twin.org/document-management-rest-client';
|
|
41
|
-
import { DocumentManagementService } from '@twin.org/document-management-service';
|
|
42
|
-
import { LocalEventBusConnector } from '@twin.org/event-bus-connector-local';
|
|
43
|
-
import { EventBusConnectorFactory } from '@twin.org/event-bus-models';
|
|
44
|
-
import { EventBusService } from '@twin.org/event-bus-service';
|
|
45
|
-
import { EventBusSocketClient } from '@twin.org/event-bus-socket-client';
|
|
46
|
-
import { EntityStorageFaucetConnector, EntityStorageWalletConnector, initSchema as initSchema$h } from '@twin.org/wallet-connector-entity-storage';
|
|
47
|
-
import { IotaFaucetConnector, IotaWalletConnector } from '@twin.org/wallet-connector-iota';
|
|
48
|
-
import { FaucetConnectorFactory, WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
49
|
-
import { FederatedCatalogueClient } from '@twin.org/federated-catalogue-rest-client';
|
|
50
|
-
import { initSchema as initSchema$5, FederatedCatalogueService } from '@twin.org/federated-catalogue-service';
|
|
51
|
-
import { initSchema as initSchema$6, EntityStorageIdentityConnector, EntityStorageIdentityProfileConnector, EntityStorageIdentityResolverConnector } from '@twin.org/identity-connector-entity-storage';
|
|
52
|
-
import { IotaIdentityConnector, IotaIdentityResolverConnector } from '@twin.org/identity-connector-iota';
|
|
53
|
-
import { IdentityConnectorFactory, IdentityProfileConnectorFactory, IdentityResolverConnectorFactory } from '@twin.org/identity-models';
|
|
54
|
-
import { IdentityClient, IdentityProfileClient, IdentityResolverClient } from '@twin.org/identity-rest-client';
|
|
55
|
-
import { IdentityService, IdentityProfileService, IdentityResolverService } from '@twin.org/identity-service';
|
|
56
|
-
import { UniversalResolverConnector } from '@twin.org/identity-connector-universal';
|
|
57
|
-
import { ImmutableProofClient } from '@twin.org/immutable-proof-rest-client';
|
|
58
|
-
import { initSchema as initSchema$7, ImmutableProofService } from '@twin.org/immutable-proof-service';
|
|
59
|
-
import { ConsoleLoggingConnector } from '@twin.org/logging-connector-console';
|
|
60
|
-
import { initSchema as initSchema$8, EntityStorageLoggingConnector } from '@twin.org/logging-connector-entity-storage';
|
|
61
|
-
import { MultiLoggingConnector, LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
62
|
-
import { LoggingClient } from '@twin.org/logging-rest-client';
|
|
63
|
-
import { LoggingService } from '@twin.org/logging-service';
|
|
64
|
-
import { AwsMessagingEmailConnector, AwsMessagingSmsConnector, AwsMessagingPushNotificationConnector } from '@twin.org/messaging-connector-aws';
|
|
65
|
-
import { initSchema as initSchema$9, EntityStorageMessagingEmailConnector, EntityStorageMessagingSmsConnector, EntityStorageMessagingPushNotificationConnector } from '@twin.org/messaging-connector-entity-storage';
|
|
66
|
-
import { MessagingEmailConnectorFactory, MessagingSmsConnectorFactory, MessagingPushNotificationsConnectorFactory } from '@twin.org/messaging-models';
|
|
67
|
-
import { initSchema as initSchema$a, MessagingService } from '@twin.org/messaging-service';
|
|
68
|
-
import { initSchema as initSchema$b, EntityStorageNftConnector } from '@twin.org/nft-connector-entity-storage';
|
|
69
|
-
import { IotaNftConnector } from '@twin.org/nft-connector-iota';
|
|
70
|
-
import { NftConnectorFactory } from '@twin.org/nft-models';
|
|
71
|
-
import { NftClient } from '@twin.org/nft-rest-client';
|
|
72
|
-
import { NftService } from '@twin.org/nft-service';
|
|
73
|
-
import { RightsManagementClient } from '@twin.org/rights-management-rest-client';
|
|
74
|
-
import { RightsManagementService } from '@twin.org/rights-management-service';
|
|
75
|
-
import { initSchema as initSchema$c, PolicyAdministrationPointService } from '@twin.org/rights-management-pap-service';
|
|
76
|
-
import { PolicyDecisionPointService } from '@twin.org/rights-management-pdp-service';
|
|
77
|
-
import { PolicyEnforcementPointService } from '@twin.org/rights-management-pep-service';
|
|
78
|
-
import { PolicyInformationPointService } from '@twin.org/rights-management-pip-service';
|
|
79
|
-
import { PolicyManagementPointService } from '@twin.org/rights-management-pmp-service';
|
|
80
|
-
import { PolicyExecutionPointService } from '@twin.org/rights-management-pxp-service';
|
|
81
|
-
import { SynchronisedStorageClient } from '@twin.org/synchronised-storage-rest-client';
|
|
82
|
-
import { initSchema as initSchema$d, SynchronisedStorageService } from '@twin.org/synchronised-storage-service';
|
|
83
|
-
import { TaskSchedulerService } from '@twin.org/background-task-scheduler';
|
|
84
|
-
import { initSchema as initSchema$e, EntityStorageTelemetryConnector } from '@twin.org/telemetry-connector-entity-storage';
|
|
85
|
-
import { TelemetryConnectorFactory } from '@twin.org/telemetry-models';
|
|
86
|
-
import { TelemetryClient } from '@twin.org/telemetry-rest-client';
|
|
87
|
-
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
88
|
-
import { initSchema as initSchema$f, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
89
|
-
import { HashicorpVaultConnector } from '@twin.org/vault-connector-hashicorp';
|
|
90
|
-
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
91
|
-
import { initSchema as initSchema$g, EntityStorageVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-entity-storage';
|
|
92
|
-
import { IotaVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-iota';
|
|
93
|
-
import { VerifiableStorageConnectorFactory } from '@twin.org/verifiable-storage-models';
|
|
94
|
-
import { VerifiableStorageClient } from '@twin.org/verifiable-storage-rest-client';
|
|
95
|
-
import { VerifiableStorageService } from '@twin.org/verifiable-storage-service';
|
|
96
|
-
|
|
97
|
-
// Copyright 2024 IOTA Stiftung.
|
|
98
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
99
|
-
/**
|
|
100
|
-
* Attestation component types.
|
|
101
|
-
*/
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
103
|
-
const AttestationComponentType = {
|
|
104
|
-
/**
|
|
105
|
-
* Service.
|
|
106
|
-
*/
|
|
107
|
-
Service: "service",
|
|
108
|
-
/**
|
|
109
|
-
* REST client.
|
|
110
|
-
*/
|
|
111
|
-
RestClient: "rest-client"
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
// Copyright 2024 IOTA Stiftung.
|
|
115
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
116
|
-
/**
|
|
117
|
-
* Attestation connector types.
|
|
118
|
-
*/
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
120
|
-
const AttestationConnectorType = {
|
|
121
|
-
/**
|
|
122
|
-
* NFT.
|
|
123
|
-
*/
|
|
124
|
-
Nft: "nft"
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
// Copyright 2024 IOTA Stiftung.
|
|
128
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
129
|
-
/**
|
|
130
|
-
* Initialise the attestation connector.
|
|
131
|
-
* @param engineCore The engine core.
|
|
132
|
-
* @param context The context for the engine.
|
|
133
|
-
* @param instanceConfig The instance config.
|
|
134
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
135
|
-
* @returns The name of the instance created.
|
|
136
|
-
* @throws GeneralError if the connector type is unknown.
|
|
137
|
-
*/
|
|
138
|
-
function initialiseAttestationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
139
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
140
|
-
element: `Attestation Connector: ${instanceConfig.type}`
|
|
141
|
-
}));
|
|
142
|
-
const type = instanceConfig.type;
|
|
143
|
-
let connector;
|
|
144
|
-
let instanceType;
|
|
145
|
-
if (type === AttestationConnectorType.Nft) {
|
|
146
|
-
connector = new NftAttestationConnector({
|
|
147
|
-
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
148
|
-
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
149
|
-
...instanceConfig.options
|
|
150
|
-
});
|
|
151
|
-
instanceType = NftAttestationConnector.NAMESPACE;
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
155
|
-
type,
|
|
156
|
-
connectorType: "attestationConnector"
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
160
|
-
context.componentInstances.push({
|
|
161
|
-
instanceType: finalInstanceType,
|
|
162
|
-
component: connector
|
|
163
|
-
});
|
|
164
|
-
AttestationConnectorFactory.register(finalInstanceType, () => connector);
|
|
165
|
-
return finalInstanceType;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Initialise the attestation component.
|
|
169
|
-
* @param engineCore The engine core.
|
|
170
|
-
* @param context The context for the engine.
|
|
171
|
-
* @param instanceConfig The instance config.
|
|
172
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
173
|
-
* @returns The name of the instance created.
|
|
174
|
-
* @throws GeneralError if the component type is unknown.
|
|
175
|
-
*/
|
|
176
|
-
function initialiseAttestationComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
177
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
178
|
-
element: `Attestation Component: ${instanceConfig.type}`
|
|
179
|
-
}));
|
|
180
|
-
const type = instanceConfig.type;
|
|
181
|
-
let component;
|
|
182
|
-
let instanceType;
|
|
183
|
-
if (type === AttestationComponentType.Service) {
|
|
184
|
-
component = new AttestationService({
|
|
185
|
-
...instanceConfig.options
|
|
186
|
-
});
|
|
187
|
-
instanceType = StringHelper.kebabCase("AttestationService");
|
|
188
|
-
}
|
|
189
|
-
else if (type === AttestationComponentType.RestClient) {
|
|
190
|
-
component = new AttestationClient(instanceConfig.options);
|
|
191
|
-
instanceType = StringHelper.kebabCase("AttestationClient");
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
195
|
-
type,
|
|
196
|
-
componentType: "attestationComponent"
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
200
|
-
context.componentInstances.push({
|
|
201
|
-
instanceType: finalInstanceType,
|
|
202
|
-
component
|
|
203
|
-
});
|
|
204
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
205
|
-
return finalInstanceType;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Copyright 2024 IOTA Stiftung.
|
|
209
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
210
|
-
/**
|
|
211
|
-
* Entity storage component types.
|
|
212
|
-
*/
|
|
213
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
214
|
-
const EntityStorageComponentType = {
|
|
215
|
-
/**
|
|
216
|
-
* Service.
|
|
217
|
-
*/
|
|
218
|
-
Service: "service",
|
|
219
|
-
/**
|
|
220
|
-
* REST client.
|
|
221
|
-
*/
|
|
222
|
-
RestClient: "rest-client"
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
// Copyright 2024 IOTA Stiftung.
|
|
226
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
227
|
-
/**
|
|
228
|
-
* Entity storage connector types.
|
|
229
|
-
*/
|
|
230
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
231
|
-
const EntityStorageConnectorType = {
|
|
232
|
-
/**
|
|
233
|
-
* Use storage.
|
|
234
|
-
*/
|
|
235
|
-
File: "file",
|
|
236
|
-
/**
|
|
237
|
-
* Memory.
|
|
238
|
-
*/
|
|
239
|
-
Memory: "memory",
|
|
240
|
-
/**
|
|
241
|
-
* ScyllaDb.
|
|
242
|
-
*/
|
|
243
|
-
ScyllaDb: "scylladb",
|
|
244
|
-
/**
|
|
245
|
-
* AWS DynamoDB.
|
|
246
|
-
*/
|
|
247
|
-
AwsDynamoDb: "aws-dynamodb",
|
|
248
|
-
/**
|
|
249
|
-
* Azure CosmosDB.
|
|
250
|
-
*/
|
|
251
|
-
AzureCosmosDb: "azure-cosmosdb",
|
|
252
|
-
/**
|
|
253
|
-
* GCP Firestore.
|
|
254
|
-
*/
|
|
255
|
-
GcpFirestoreDb: "gcp-firestoredb",
|
|
256
|
-
/**
|
|
257
|
-
* MySqlDb.
|
|
258
|
-
*/
|
|
259
|
-
MySqlDb: "mysql",
|
|
260
|
-
/**
|
|
261
|
-
* MongoDb.
|
|
262
|
-
*/
|
|
263
|
-
MongoDb: "mongodb",
|
|
264
|
-
/**
|
|
265
|
-
* Postgre SQL.
|
|
266
|
-
*/
|
|
267
|
-
PostgreSql: "postgresql",
|
|
268
|
-
/**
|
|
269
|
-
* Synchronised.
|
|
270
|
-
*/
|
|
271
|
-
Synchronised: "synchronised"
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
// Copyright 2024 IOTA Stiftung.
|
|
275
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
276
|
-
/**
|
|
277
|
-
* Initialise the entity storage connector.
|
|
278
|
-
* @param engineCore The engine core.
|
|
279
|
-
* @param context The context for the engine.
|
|
280
|
-
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
281
|
-
* @param schema The schema for the entity storage.
|
|
282
|
-
* @returns The name of the instance type that was created.
|
|
283
|
-
* @throws GeneralError if the connector type is unknown.
|
|
284
|
-
*/
|
|
285
|
-
function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
|
|
286
|
-
const instanceName = StringHelper.kebabCase(schema);
|
|
287
|
-
if (!EntityStorageConnectorFactory.hasName(instanceName)) {
|
|
288
|
-
let entityStorageConfig;
|
|
289
|
-
if (Is.stringValue(typeCustom)) {
|
|
290
|
-
// A custom type has been specified, so look it up
|
|
291
|
-
entityStorageConfig = context.config.types.entityStorageConnector?.find(c => c.type === typeCustom || c.overrideInstanceType === typeCustom);
|
|
292
|
-
if (Is.empty(entityStorageConfig)) {
|
|
293
|
-
throw new GeneralError("engineCore", "entityStorageCustomMissing", {
|
|
294
|
-
typeCustom,
|
|
295
|
-
storageName: instanceName
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
// The default entity storage method is either the one with the isDefault flag set
|
|
301
|
-
// or pick the first one if no default is set.
|
|
302
|
-
entityStorageConfig =
|
|
303
|
-
context.config.types.entityStorageConnector?.find(c => c.isDefault ?? false) ??
|
|
304
|
-
context.config.types.entityStorageConnector?.[0];
|
|
305
|
-
if (Is.empty(entityStorageConfig)) {
|
|
306
|
-
throw new GeneralError("engineCore", "entityStorageMissing", {
|
|
307
|
-
storageName: instanceName
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
const type = entityStorageConfig.type;
|
|
312
|
-
let entityStorageConnector;
|
|
313
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuringEntityStorage", {
|
|
314
|
-
element: "Entity Storage",
|
|
315
|
-
storageName: instanceName,
|
|
316
|
-
storageType: type
|
|
317
|
-
}));
|
|
318
|
-
if (type === EntityStorageConnectorType.Memory) {
|
|
319
|
-
entityStorageConnector = new MemoryEntityStorageConnector({
|
|
320
|
-
entitySchema: schema
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
else if (type === EntityStorageConnectorType.File) {
|
|
324
|
-
entityStorageConnector = new FileEntityStorageConnector({
|
|
325
|
-
entitySchema: schema,
|
|
326
|
-
...entityStorageConfig.options,
|
|
327
|
-
config: {
|
|
328
|
-
...entityStorageConfig.options.config,
|
|
329
|
-
directory: path.join(entityStorageConfig.options.config.directory, `${entityStorageConfig.options.folderPrefix ?? ""}${instanceName}`)
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
else if (type === EntityStorageConnectorType.AwsDynamoDb) {
|
|
334
|
-
entityStorageConnector = new DynamoDbEntityStorageConnector({
|
|
335
|
-
entitySchema: schema,
|
|
336
|
-
...entityStorageConfig.options,
|
|
337
|
-
config: {
|
|
338
|
-
...entityStorageConfig.options.config,
|
|
339
|
-
tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
else if (type === EntityStorageConnectorType.AzureCosmosDb) {
|
|
344
|
-
entityStorageConnector = new CosmosDbEntityStorageConnector({
|
|
345
|
-
entitySchema: schema,
|
|
346
|
-
...entityStorageConfig.options,
|
|
347
|
-
config: {
|
|
348
|
-
...entityStorageConfig.options.config,
|
|
349
|
-
containerId: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
else if (type === EntityStorageConnectorType.GcpFirestoreDb) {
|
|
354
|
-
entityStorageConnector = new FirestoreEntityStorageConnector({
|
|
355
|
-
entitySchema: schema,
|
|
356
|
-
...entityStorageConfig.options,
|
|
357
|
-
config: {
|
|
358
|
-
...entityStorageConfig.options.config,
|
|
359
|
-
collectionName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
else if (type === EntityStorageConnectorType.ScyllaDb) {
|
|
364
|
-
entityStorageConnector = new ScyllaDBTableConnector({
|
|
365
|
-
entitySchema: schema,
|
|
366
|
-
...entityStorageConfig.options,
|
|
367
|
-
config: {
|
|
368
|
-
...entityStorageConfig.options.config,
|
|
369
|
-
tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
else if (type === EntityStorageConnectorType.MySqlDb) {
|
|
374
|
-
entityStorageConnector = new MySqlEntityStorageConnector({
|
|
375
|
-
entitySchema: schema,
|
|
376
|
-
...entityStorageConfig.options,
|
|
377
|
-
config: {
|
|
378
|
-
...entityStorageConfig.options.config,
|
|
379
|
-
tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
else if (type === EntityStorageConnectorType.MongoDb) {
|
|
384
|
-
entityStorageConnector = new MongoDbEntityStorageConnector({
|
|
385
|
-
entitySchema: schema,
|
|
386
|
-
...entityStorageConfig.options,
|
|
387
|
-
config: {
|
|
388
|
-
...entityStorageConfig.options.config,
|
|
389
|
-
collection: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
else if (type === EntityStorageConnectorType.PostgreSql) {
|
|
394
|
-
entityStorageConnector = new PostgreSqlEntityStorageConnector({
|
|
395
|
-
entitySchema: schema,
|
|
396
|
-
...entityStorageConfig.options,
|
|
397
|
-
config: {
|
|
398
|
-
...entityStorageConfig.options.config,
|
|
399
|
-
tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
404
|
-
// Create the entity storage that is wrapped by the synchronised connector
|
|
405
|
-
// by removing the custom type it will default to the standard storage
|
|
406
|
-
// mechanism for entity storage
|
|
407
|
-
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
|
|
408
|
-
// Use the wrapped instance name as the entity storage connector type
|
|
409
|
-
// for the synchronised connector
|
|
410
|
-
entityStorageConnector = new SynchronisedEntityStorageConnector({
|
|
411
|
-
entitySchema: schema,
|
|
412
|
-
...entityStorageConfig.options,
|
|
413
|
-
entityStorageConnectorType: wrappedInstanceName,
|
|
414
|
-
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
415
|
-
config: {
|
|
416
|
-
...entityStorageConfig.options.config
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
422
|
-
type,
|
|
423
|
-
connectorType: "entityStorageConnector"
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
context.componentInstances.push({
|
|
427
|
-
instanceType: instanceName,
|
|
428
|
-
component: entityStorageConnector
|
|
429
|
-
});
|
|
430
|
-
EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
431
|
-
}
|
|
432
|
-
return instanceName;
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Initialise the entity storage connector.
|
|
436
|
-
* @param engineCore The engine core.
|
|
437
|
-
* @param context The context for the engine.
|
|
438
|
-
* @param instanceConfig The instance config.
|
|
439
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
440
|
-
* @returns The name of the instance created.
|
|
441
|
-
* @throws GeneralError if the connector type is unknown.
|
|
442
|
-
*/
|
|
443
|
-
function initialiseEntityStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
444
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
445
|
-
element: `Entity Storage Component: ${instanceConfig.type}`
|
|
446
|
-
}));
|
|
447
|
-
const type = instanceConfig.type;
|
|
448
|
-
let component;
|
|
449
|
-
let instanceType;
|
|
450
|
-
if (type === EntityStorageComponentType.Service) {
|
|
451
|
-
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
452
|
-
// See if there is a custom entity storage for this type, otherwise just use the default one.
|
|
453
|
-
const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
|
|
454
|
-
initialiseEntityStorageConnector(engineCore, context, hasCustom ? kebabName : undefined, instanceConfig.options.entityStorageType);
|
|
455
|
-
component = new EntityStorageService({
|
|
456
|
-
entityStorageType: kebabName,
|
|
457
|
-
config: {
|
|
458
|
-
...instanceConfig.options.config
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
instanceType = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
462
|
-
}
|
|
463
|
-
else if (type === EntityStorageComponentType.RestClient) {
|
|
464
|
-
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
465
|
-
component = new EntityStorageClient({
|
|
466
|
-
pathPrefix: kebabName,
|
|
467
|
-
...instanceConfig.options
|
|
468
|
-
});
|
|
469
|
-
instanceType = `${StringHelper.kebabCase("EntityStorageClient")}-${kebabName}`;
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
473
|
-
type,
|
|
474
|
-
serviceType: "entityStorageComponent"
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
478
|
-
context.componentInstances.push({
|
|
479
|
-
instanceType: finalInstanceType,
|
|
480
|
-
component
|
|
481
|
-
});
|
|
482
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
483
|
-
return finalInstanceType;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// Copyright 2024 IOTA Stiftung.
|
|
487
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
488
|
-
/**
|
|
489
|
-
* Auditable item graph component types.
|
|
490
|
-
*/
|
|
491
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
492
|
-
const AuditableItemGraphComponentType = {
|
|
493
|
-
/**
|
|
494
|
-
* Service.
|
|
495
|
-
*/
|
|
496
|
-
Service: "service",
|
|
497
|
-
/**
|
|
498
|
-
* REST client.
|
|
499
|
-
*/
|
|
500
|
-
RestClient: "rest-client"
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Initialise the auditable item graph component.
|
|
505
|
-
* @param engineCore The engine core.
|
|
506
|
-
* @param context The context for the engine.
|
|
507
|
-
* @param instanceConfig The instance config.
|
|
508
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
509
|
-
* @returns The name of the instance created.
|
|
510
|
-
* @throws GeneralError if the component type is unknown.
|
|
511
|
-
*/
|
|
512
|
-
function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
513
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
514
|
-
element: `Auditable Item Graph Component: ${instanceConfig.type}`
|
|
515
|
-
}));
|
|
516
|
-
const type = instanceConfig.type;
|
|
517
|
-
let component;
|
|
518
|
-
let instanceType;
|
|
519
|
-
if (type === AuditableItemGraphComponentType.Service) {
|
|
520
|
-
initSchema();
|
|
521
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
|
|
522
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
|
|
523
|
-
component = new AuditableItemGraphService({
|
|
524
|
-
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
525
|
-
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
526
|
-
...instanceConfig.options
|
|
527
|
-
});
|
|
528
|
-
instanceType = StringHelper.kebabCase("AuditableItemGraphService");
|
|
529
|
-
}
|
|
530
|
-
else if (type === AuditableItemGraphComponentType.RestClient) {
|
|
531
|
-
component = new AuditableItemGraphClient(instanceConfig.options);
|
|
532
|
-
instanceType = StringHelper.kebabCase("AuditableItemGraphClient");
|
|
533
|
-
}
|
|
534
|
-
else {
|
|
535
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
536
|
-
type,
|
|
537
|
-
componentType: "auditableItemGraphComponent"
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
541
|
-
context.componentInstances.push({
|
|
542
|
-
instanceType: finalInstanceType,
|
|
543
|
-
component
|
|
544
|
-
});
|
|
545
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
546
|
-
return finalInstanceType;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// Copyright 2024 IOTA Stiftung.
|
|
550
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
551
|
-
/**
|
|
552
|
-
* Auditable item stream component types.
|
|
553
|
-
*/
|
|
554
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
555
|
-
const AuditableItemStreamComponentType = {
|
|
556
|
-
/**
|
|
557
|
-
* Service.
|
|
558
|
-
*/
|
|
559
|
-
Service: "service",
|
|
560
|
-
/**
|
|
561
|
-
* REST client.
|
|
562
|
-
*/
|
|
563
|
-
RestClient: "rest-client"
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Initialise the auditable item stream component.
|
|
568
|
-
* @param engineCore The engine core.
|
|
569
|
-
* @param context The context for the engine.
|
|
570
|
-
* @param instanceConfig The instance config.
|
|
571
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
572
|
-
* @returns The name of the instance created.
|
|
573
|
-
* @throws GeneralError if the component type is unknown.
|
|
574
|
-
*/
|
|
575
|
-
function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
576
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
577
|
-
element: `Auditable Item Stream Component: ${instanceConfig.type}`
|
|
578
|
-
}));
|
|
579
|
-
const type = instanceConfig.type;
|
|
580
|
-
let component;
|
|
581
|
-
let instanceType;
|
|
582
|
-
if (type === AuditableItemStreamComponentType.Service) {
|
|
583
|
-
initSchema$1();
|
|
584
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
|
|
585
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
|
|
586
|
-
component = new AuditableItemStreamService({
|
|
587
|
-
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
588
|
-
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
589
|
-
...instanceConfig.options
|
|
590
|
-
});
|
|
591
|
-
instanceType = StringHelper.kebabCase("AuditableItemStreamService");
|
|
592
|
-
}
|
|
593
|
-
else if (type === AuditableItemStreamComponentType.RestClient) {
|
|
594
|
-
component = new AuditableItemStreamClient(instanceConfig.options);
|
|
595
|
-
instanceType = StringHelper.kebabCase("AuditableItemStreamClient");
|
|
596
|
-
}
|
|
597
|
-
else {
|
|
598
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
599
|
-
type,
|
|
600
|
-
componentType: "auditableItemStreamComponent"
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
604
|
-
context.componentInstances.push({
|
|
605
|
-
instanceType: finalInstanceType,
|
|
606
|
-
component
|
|
607
|
-
});
|
|
608
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
609
|
-
return finalInstanceType;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
// Copyright 2024 IOTA Stiftung.
|
|
613
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
614
|
-
/**
|
|
615
|
-
* Background task connector types.
|
|
616
|
-
*/
|
|
617
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
618
|
-
const BackgroundTaskConnectorType = {
|
|
619
|
-
/**
|
|
620
|
-
* Entity storage.
|
|
621
|
-
*/
|
|
622
|
-
EntityStorage: "entity-storage"
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
// Copyright 2024 IOTA Stiftung.
|
|
626
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
627
|
-
/**
|
|
628
|
-
* Initialise a background task connector.
|
|
629
|
-
* @param engineCore The engine core.
|
|
630
|
-
* @param context The context for the engine.
|
|
631
|
-
* @param instanceConfig The instance config.
|
|
632
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
633
|
-
* @returns The name of the instance created.
|
|
634
|
-
* @throws GeneralError if the connector type is unknown.
|
|
635
|
-
*/
|
|
636
|
-
function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
637
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
638
|
-
element: `Background Task Connector: ${instanceConfig.type}`
|
|
639
|
-
}));
|
|
640
|
-
const type = instanceConfig.type;
|
|
641
|
-
let connector;
|
|
642
|
-
let instanceType;
|
|
643
|
-
if (type === BackgroundTaskConnectorType.EntityStorage) {
|
|
644
|
-
initSchema$2();
|
|
645
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
|
|
646
|
-
connector = new EntityStorageBackgroundTaskConnector({
|
|
647
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
648
|
-
...instanceConfig.options
|
|
649
|
-
});
|
|
650
|
-
instanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
654
|
-
type,
|
|
655
|
-
connectorType: "backgroundTaskConnector"
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
659
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
660
|
-
BackgroundTaskConnectorFactory.register(finalInstanceType, () => connector);
|
|
661
|
-
return finalInstanceType;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// Copyright 2024 IOTA Stiftung.
|
|
665
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
666
|
-
/**
|
|
667
|
-
* Blob storage component types.
|
|
668
|
-
*/
|
|
669
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
670
|
-
const BlobStorageComponentType = {
|
|
671
|
-
/**
|
|
672
|
-
* Service.
|
|
673
|
-
*/
|
|
674
|
-
Service: "service",
|
|
675
|
-
/**
|
|
676
|
-
* REST client.
|
|
677
|
-
*/
|
|
678
|
-
RestClient: "rest-client"
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
// Copyright 2024 IOTA Stiftung.
|
|
682
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
683
|
-
/**
|
|
684
|
-
* Blob storage connector types.
|
|
685
|
-
*/
|
|
686
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
687
|
-
const BlobStorageConnectorType = {
|
|
688
|
-
/**
|
|
689
|
-
* File storage.
|
|
690
|
-
*/
|
|
691
|
-
File: "file",
|
|
692
|
-
/**
|
|
693
|
-
* Memory.
|
|
694
|
-
*/
|
|
695
|
-
Memory: "memory",
|
|
696
|
-
/**
|
|
697
|
-
* IPFS.
|
|
698
|
-
*/
|
|
699
|
-
Ipfs: "ipfs",
|
|
700
|
-
/**
|
|
701
|
-
* AWS S3.
|
|
702
|
-
*/
|
|
703
|
-
AwsS3: "aws-s3",
|
|
704
|
-
/**
|
|
705
|
-
* Azure Storage.
|
|
706
|
-
*/
|
|
707
|
-
AzureStorage: "azure-storage",
|
|
708
|
-
/**
|
|
709
|
-
* GCP Storage.
|
|
710
|
-
*/
|
|
711
|
-
GcpStorage: "gcp-storage"
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
// Copyright 2024 IOTA Stiftung.
|
|
715
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
716
|
-
/**
|
|
717
|
-
* Initialise the blob storage connector.
|
|
718
|
-
* @param engineCore The engine core.
|
|
719
|
-
* @param context The context for the engine.
|
|
720
|
-
* @param instanceConfig The instance config.
|
|
721
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
722
|
-
* @returns The name of the instance created.
|
|
723
|
-
* @throws GeneralError if the connector type is unknown.
|
|
724
|
-
*/
|
|
725
|
-
function initialiseBlobStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
726
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
727
|
-
element: `Blob Storage Connector: ${instanceConfig.type}`
|
|
728
|
-
}));
|
|
729
|
-
const type = instanceConfig.type;
|
|
730
|
-
let connector;
|
|
731
|
-
let instanceType;
|
|
732
|
-
if (type === BlobStorageConnectorType.Ipfs) {
|
|
733
|
-
connector = new IpfsBlobStorageConnector(instanceConfig.options);
|
|
734
|
-
instanceType = IpfsBlobStorageConnector.NAMESPACE;
|
|
735
|
-
}
|
|
736
|
-
else if (type === BlobStorageConnectorType.File) {
|
|
737
|
-
connector = new FileBlobStorageConnector({
|
|
738
|
-
...instanceConfig.options,
|
|
739
|
-
config: {
|
|
740
|
-
...instanceConfig.options.config,
|
|
741
|
-
directory: Is.stringValue(instanceConfig.options.storagePrefix)
|
|
742
|
-
? path.join(instanceConfig.options.config.directory, instanceConfig.options.storagePrefix)
|
|
743
|
-
: instanceConfig.options.config.directory
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
instanceType = FileBlobStorageConnector.NAMESPACE;
|
|
747
|
-
}
|
|
748
|
-
else if (type === BlobStorageConnectorType.Memory) {
|
|
749
|
-
connector = new MemoryBlobStorageConnector();
|
|
750
|
-
instanceType = MemoryBlobStorageConnector.NAMESPACE;
|
|
751
|
-
}
|
|
752
|
-
else if (type === BlobStorageConnectorType.AwsS3) {
|
|
753
|
-
connector = new S3BlobStorageConnector({
|
|
754
|
-
...instanceConfig.options,
|
|
755
|
-
config: {
|
|
756
|
-
...instanceConfig.options.config,
|
|
757
|
-
bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
|
|
758
|
-
}
|
|
759
|
-
});
|
|
760
|
-
instanceType = S3BlobStorageConnector.NAMESPACE;
|
|
761
|
-
}
|
|
762
|
-
else if (type === BlobStorageConnectorType.GcpStorage) {
|
|
763
|
-
connector = new GcpBlobStorageConnector({
|
|
764
|
-
...instanceConfig.options,
|
|
765
|
-
config: {
|
|
766
|
-
...instanceConfig.options.config,
|
|
767
|
-
bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
|
|
768
|
-
}
|
|
769
|
-
});
|
|
770
|
-
instanceType = GcpBlobStorageConnector.NAMESPACE;
|
|
771
|
-
}
|
|
772
|
-
else if (type === BlobStorageConnectorType.AzureStorage) {
|
|
773
|
-
connector = new AzureBlobStorageConnector({
|
|
774
|
-
...instanceConfig.options,
|
|
775
|
-
config: {
|
|
776
|
-
...instanceConfig.options.config,
|
|
777
|
-
containerName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.containerName}`
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
instanceType = AzureBlobStorageConnector.NAMESPACE;
|
|
781
|
-
}
|
|
782
|
-
else {
|
|
783
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
784
|
-
type,
|
|
785
|
-
connectorType: "blobStorageConnector"
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
789
|
-
context.componentInstances.push({
|
|
790
|
-
instanceType: finalInstanceType,
|
|
791
|
-
component: connector
|
|
792
|
-
});
|
|
793
|
-
BlobStorageConnectorFactory.register(finalInstanceType, () => connector);
|
|
794
|
-
return finalInstanceType;
|
|
795
|
-
}
|
|
796
|
-
/**
|
|
797
|
-
* Initialise the blob storage component.
|
|
798
|
-
* @param engineCore The engine core.
|
|
799
|
-
* @param context The context for the engine.
|
|
800
|
-
* @param instanceConfig The instance config.
|
|
801
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
802
|
-
* @returns The name of the instance created.
|
|
803
|
-
* @throws GeneralError if the component type is unknown.
|
|
804
|
-
*/
|
|
805
|
-
function initialiseBlobStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
806
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
807
|
-
element: `Blob Storage Component: ${instanceConfig.type}`
|
|
808
|
-
}));
|
|
809
|
-
const type = instanceConfig.type;
|
|
810
|
-
let component;
|
|
811
|
-
let instanceType;
|
|
812
|
-
if (type === BlobStorageComponentType.Service) {
|
|
813
|
-
initSchema$3();
|
|
814
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
|
|
815
|
-
component = new BlobStorageService({
|
|
816
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
817
|
-
...instanceConfig.options
|
|
818
|
-
});
|
|
819
|
-
instanceType = StringHelper.kebabCase("BlobStorageService");
|
|
820
|
-
}
|
|
821
|
-
else if (type === BlobStorageComponentType.RestClient) {
|
|
822
|
-
component = new BlobStorageClient(instanceConfig.options);
|
|
823
|
-
instanceType = StringHelper.kebabCase("BlobStorageClient");
|
|
824
|
-
}
|
|
825
|
-
else {
|
|
826
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
827
|
-
type,
|
|
828
|
-
componentType: "blobStorageComponent"
|
|
829
|
-
});
|
|
830
|
-
}
|
|
831
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
832
|
-
context.componentInstances.push({
|
|
833
|
-
instanceType: finalInstanceType,
|
|
834
|
-
component
|
|
835
|
-
});
|
|
836
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
837
|
-
return finalInstanceType;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
// Copyright 2024 IOTA Stiftung.
|
|
841
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
842
|
-
/**
|
|
843
|
-
* Data converter connector types.
|
|
844
|
-
*/
|
|
845
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
846
|
-
const DataConverterConnectorType = {
|
|
847
|
-
/**
|
|
848
|
-
* JSON.
|
|
849
|
-
*/
|
|
850
|
-
Json: "json",
|
|
851
|
-
/**
|
|
852
|
-
* Xml.
|
|
853
|
-
*/
|
|
854
|
-
Xml: "xml"
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
// Copyright 2024 IOTA Stiftung.
|
|
858
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
859
|
-
/**
|
|
860
|
-
* Data extractor connector types.
|
|
861
|
-
*/
|
|
862
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
863
|
-
const DataExtractorConnectorType = {
|
|
864
|
-
/**
|
|
865
|
-
* JSON Path.
|
|
866
|
-
*/
|
|
867
|
-
JsonPath: "json-path"
|
|
868
|
-
};
|
|
869
|
-
|
|
870
|
-
// Copyright 2024 IOTA Stiftung.
|
|
871
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
872
|
-
/**
|
|
873
|
-
* Data processing component types.
|
|
874
|
-
*/
|
|
875
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
876
|
-
const DataProcessingComponentType = {
|
|
877
|
-
/**
|
|
878
|
-
* Service.
|
|
879
|
-
*/
|
|
880
|
-
Service: "service",
|
|
881
|
-
/**
|
|
882
|
-
* REST client.
|
|
883
|
-
*/
|
|
884
|
-
RestClient: "rest-client"
|
|
885
|
-
};
|
|
886
|
-
|
|
887
|
-
// Copyright 2024 IOTA Stiftung.
|
|
888
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
889
|
-
/**
|
|
890
|
-
* Initialise the data converter connector.
|
|
891
|
-
* @param engineCore The engine core.
|
|
892
|
-
* @param context The context for the engine.
|
|
893
|
-
* @param instanceConfig The instance config.
|
|
894
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
895
|
-
* @returns The name of the instance created.
|
|
896
|
-
* @throws GeneralError if the connector type is unknown.
|
|
897
|
-
*/
|
|
898
|
-
function initialiseDataConverterConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
899
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
900
|
-
element: `Data Converter Connector: ${instanceConfig.type}`
|
|
901
|
-
}));
|
|
902
|
-
const type = instanceConfig.type;
|
|
903
|
-
let connector;
|
|
904
|
-
let instanceType;
|
|
905
|
-
if (type === DataConverterConnectorType.Json) {
|
|
906
|
-
connector = new JsonConverterConnector();
|
|
907
|
-
instanceType = JsonConverterConnector.NAMESPACE;
|
|
908
|
-
}
|
|
909
|
-
else if (type === DataConverterConnectorType.Xml) {
|
|
910
|
-
connector = new XmlConverterConnector();
|
|
911
|
-
instanceType = XmlConverterConnector.NAMESPACE;
|
|
912
|
-
}
|
|
913
|
-
else {
|
|
914
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
915
|
-
type,
|
|
916
|
-
connectorType: "dataConverterConnector"
|
|
917
|
-
});
|
|
918
|
-
}
|
|
919
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
920
|
-
context.componentInstances.push({
|
|
921
|
-
instanceType: finalInstanceType,
|
|
922
|
-
component: connector
|
|
923
|
-
});
|
|
924
|
-
DataConverterConnectorFactory.register(finalInstanceType, () => connector);
|
|
925
|
-
return finalInstanceType;
|
|
926
|
-
}
|
|
927
|
-
/**
|
|
928
|
-
* Initialise the data extractor connector.
|
|
929
|
-
* @param engineCore The engine core.
|
|
930
|
-
* @param context The context for the engine.
|
|
931
|
-
* @param instanceConfig The instance config.
|
|
932
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
933
|
-
* @returns The name of the instance created.
|
|
934
|
-
* @throws GeneralError if the connector type is unknown.
|
|
935
|
-
*/
|
|
936
|
-
function initialiseDataExtractorConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
937
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
938
|
-
element: `Data Extractor Connector: ${instanceConfig.type}`
|
|
939
|
-
}));
|
|
940
|
-
const type = instanceConfig.type;
|
|
941
|
-
let connector;
|
|
942
|
-
let instanceType;
|
|
943
|
-
if (type === DataExtractorConnectorType.JsonPath) {
|
|
944
|
-
connector = new JsonPathExtractorConnector();
|
|
945
|
-
instanceType = JsonPathExtractorConnector.NAMESPACE;
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
949
|
-
type,
|
|
950
|
-
connectorType: "dataExtractorConnector"
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
954
|
-
context.componentInstances.push({
|
|
955
|
-
instanceType: finalInstanceType,
|
|
956
|
-
component: connector
|
|
957
|
-
});
|
|
958
|
-
DataExtractorConnectorFactory.register(finalInstanceType, () => connector);
|
|
959
|
-
return finalInstanceType;
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* Initialise the data processing component.
|
|
963
|
-
* @param engineCore The engine core.
|
|
964
|
-
* @param context The context for the engine.
|
|
965
|
-
* @param instanceConfig The instance config.
|
|
966
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
967
|
-
* @returns The name of the instance created.
|
|
968
|
-
* @throws GeneralError if the component type is unknown.
|
|
969
|
-
*/
|
|
970
|
-
function initialiseDataProcessingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
971
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
972
|
-
element: `Data Processing Component: ${instanceConfig.type}`
|
|
973
|
-
}));
|
|
974
|
-
const type = instanceConfig.type;
|
|
975
|
-
let component;
|
|
976
|
-
let instanceType;
|
|
977
|
-
if (type === DataProcessingComponentType.Service) {
|
|
978
|
-
initSchema$4();
|
|
979
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.extractionRuleGroupStorageConnectorType, "ExtractionRuleGroup");
|
|
980
|
-
component = new DataProcessingService({
|
|
981
|
-
...instanceConfig.options
|
|
982
|
-
});
|
|
983
|
-
instanceType = StringHelper.kebabCase("DataProcessingService");
|
|
984
|
-
}
|
|
985
|
-
else if (type === DataProcessingComponentType.RestClient) {
|
|
986
|
-
component = new DataProcessingClient(instanceConfig.options);
|
|
987
|
-
instanceType = StringHelper.kebabCase("DataProcessingClient");
|
|
988
|
-
}
|
|
989
|
-
else {
|
|
990
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
991
|
-
type,
|
|
992
|
-
componentType: "dataProcessingComponent"
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
996
|
-
context.componentInstances.push({
|
|
997
|
-
instanceType: finalInstanceType,
|
|
998
|
-
component
|
|
999
|
-
});
|
|
1000
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1001
|
-
return finalInstanceType;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1005
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1006
|
-
/**
|
|
1007
|
-
* Document management component types.
|
|
1008
|
-
*/
|
|
1009
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1010
|
-
const DocumentManagementComponentType = {
|
|
1011
|
-
/**
|
|
1012
|
-
* Service.
|
|
1013
|
-
*/
|
|
1014
|
-
Service: "service",
|
|
1015
|
-
/**
|
|
1016
|
-
* REST client.
|
|
1017
|
-
*/
|
|
1018
|
-
RestClient: "rest-client"
|
|
1019
|
-
};
|
|
1020
|
-
|
|
1021
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1022
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1023
|
-
/**
|
|
1024
|
-
* Initialise the document management component.
|
|
1025
|
-
* @param engineCore The engine core.
|
|
1026
|
-
* @param context The context for the engine.
|
|
1027
|
-
* @param instanceConfig The instance config.
|
|
1028
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1029
|
-
* @returns The name of the instance created.
|
|
1030
|
-
* @throws GeneralError if the component type is unknown.
|
|
1031
|
-
*/
|
|
1032
|
-
function initialiseDocumentManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1033
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1034
|
-
element: `Document Management Component: ${instanceConfig.type}`
|
|
1035
|
-
}));
|
|
1036
|
-
const type = instanceConfig.type;
|
|
1037
|
-
let component;
|
|
1038
|
-
let instanceType;
|
|
1039
|
-
if (type === DocumentManagementComponentType.Service) {
|
|
1040
|
-
component = new DocumentManagementService({
|
|
1041
|
-
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
1042
|
-
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
1043
|
-
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
1044
|
-
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
1045
|
-
...instanceConfig.options
|
|
1046
|
-
});
|
|
1047
|
-
instanceType = StringHelper.kebabCase("DocumentManagementService");
|
|
1048
|
-
}
|
|
1049
|
-
else if (type === DocumentManagementComponentType.RestClient) {
|
|
1050
|
-
component = new DocumentManagementClient(instanceConfig.options);
|
|
1051
|
-
instanceType = StringHelper.kebabCase("DocumentManagementClient");
|
|
1052
|
-
}
|
|
1053
|
-
else {
|
|
1054
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1055
|
-
type,
|
|
1056
|
-
componentType: "documentManagementComponent"
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1060
|
-
context.componentInstances.push({
|
|
1061
|
-
instanceType: finalInstanceType,
|
|
1062
|
-
component
|
|
1063
|
-
});
|
|
1064
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1065
|
-
return finalInstanceType;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1069
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1070
|
-
/**
|
|
1071
|
-
* Event bus component types.
|
|
1072
|
-
*/
|
|
1073
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1074
|
-
const EventBusComponentType = {
|
|
1075
|
-
/**
|
|
1076
|
-
* Service.
|
|
1077
|
-
*/
|
|
1078
|
-
Service: "service",
|
|
1079
|
-
/**
|
|
1080
|
-
* Socket client.
|
|
1081
|
-
*/
|
|
1082
|
-
SocketClient: "socket-client"
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1086
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1087
|
-
/**
|
|
1088
|
-
* Event bus connector types.
|
|
1089
|
-
*/
|
|
1090
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1091
|
-
const EventBusConnectorType = {
|
|
1092
|
-
/**
|
|
1093
|
-
* Local.
|
|
1094
|
-
*/
|
|
1095
|
-
Local: "local"
|
|
1096
|
-
};
|
|
1097
|
-
|
|
1098
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1099
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1100
|
-
/**
|
|
1101
|
-
* Initialise a event bus connector.
|
|
1102
|
-
* @param engineCore The engine core.
|
|
1103
|
-
* @param context The context for the engine.
|
|
1104
|
-
* @param instanceConfig The instance config.
|
|
1105
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1106
|
-
* @returns The name of the instance created.
|
|
1107
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1108
|
-
*/
|
|
1109
|
-
function initialiseEventBusConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1110
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1111
|
-
element: `Event Bus Connector: ${instanceConfig.type}`
|
|
1112
|
-
}));
|
|
1113
|
-
const type = instanceConfig.type;
|
|
1114
|
-
let connector;
|
|
1115
|
-
let instanceType;
|
|
1116
|
-
if (type === EventBusConnectorType.Local) {
|
|
1117
|
-
connector = new LocalEventBusConnector({
|
|
1118
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1119
|
-
...instanceConfig.options
|
|
1120
|
-
});
|
|
1121
|
-
instanceType = LocalEventBusConnector.NAMESPACE;
|
|
1122
|
-
}
|
|
1123
|
-
else {
|
|
1124
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1125
|
-
type,
|
|
1126
|
-
connectorType: "eventBusConnector"
|
|
1127
|
-
});
|
|
1128
|
-
}
|
|
1129
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1130
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1131
|
-
EventBusConnectorFactory.register(finalInstanceType, () => connector);
|
|
1132
|
-
return finalInstanceType;
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Initialise the event bus component.
|
|
1136
|
-
* @param engineCore The engine core.
|
|
1137
|
-
* @param context The context for the engine.
|
|
1138
|
-
* @param instanceConfig The instance config.
|
|
1139
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1140
|
-
* @returns The name of the instance created.
|
|
1141
|
-
* @throws GeneralError if the component type is unknown.
|
|
1142
|
-
*/
|
|
1143
|
-
function initialiseEventBusComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1144
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1145
|
-
element: `Event Bus Component: ${instanceConfig.type}`
|
|
1146
|
-
}));
|
|
1147
|
-
const type = instanceConfig.type;
|
|
1148
|
-
let component;
|
|
1149
|
-
let instanceType;
|
|
1150
|
-
if (type === EventBusComponentType.Service) {
|
|
1151
|
-
component = new EventBusService({
|
|
1152
|
-
eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
|
|
1153
|
-
...instanceConfig.options
|
|
1154
|
-
});
|
|
1155
|
-
instanceType = StringHelper.kebabCase("EventBusService");
|
|
1156
|
-
}
|
|
1157
|
-
else if (type === EventBusComponentType.SocketClient) {
|
|
1158
|
-
component = new EventBusSocketClient({
|
|
1159
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1160
|
-
...instanceConfig.options
|
|
1161
|
-
});
|
|
1162
|
-
instanceType = StringHelper.kebabCase("EventBusSocketClient");
|
|
1163
|
-
}
|
|
1164
|
-
else {
|
|
1165
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1166
|
-
type,
|
|
1167
|
-
componentType: "EventBusComponent"
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1171
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1172
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1173
|
-
return finalInstanceType;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1177
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1178
|
-
/**
|
|
1179
|
-
* Faucet connector types.
|
|
1180
|
-
*/
|
|
1181
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1182
|
-
const FaucetConnectorType = {
|
|
1183
|
-
/**
|
|
1184
|
-
* Entity storage.
|
|
1185
|
-
*/
|
|
1186
|
-
EntityStorage: "entity-storage",
|
|
1187
|
-
/**
|
|
1188
|
-
* IOTA.
|
|
1189
|
-
*/
|
|
1190
|
-
Iota: "iota"
|
|
1191
|
-
};
|
|
1192
|
-
|
|
1193
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1194
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1195
|
-
/**
|
|
1196
|
-
* Initialise a faucet connector.
|
|
1197
|
-
* @param engineCore The engine core.
|
|
1198
|
-
* @param context The context for the engine.
|
|
1199
|
-
* @param instanceConfig The instance config.
|
|
1200
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1201
|
-
* @returns The name of the instance created.
|
|
1202
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1203
|
-
*/
|
|
1204
|
-
function initialiseFaucetConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1205
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1206
|
-
element: `Faucet Connector: ${instanceConfig.type}`
|
|
1207
|
-
}));
|
|
1208
|
-
const type = instanceConfig.type;
|
|
1209
|
-
let connector;
|
|
1210
|
-
let instanceType;
|
|
1211
|
-
if (type === FaucetConnectorType.Iota) {
|
|
1212
|
-
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1213
|
-
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1214
|
-
connector = new IotaFaucetConnector({
|
|
1215
|
-
...instanceConfig.options,
|
|
1216
|
-
config: {
|
|
1217
|
-
...dltConfig?.options?.config,
|
|
1218
|
-
...instanceConfig.options.config
|
|
1219
|
-
}
|
|
1220
|
-
});
|
|
1221
|
-
instanceType = IotaFaucetConnector.NAMESPACE;
|
|
1222
|
-
}
|
|
1223
|
-
else if (type === FaucetConnectorType.EntityStorage) {
|
|
1224
|
-
connector = new EntityStorageFaucetConnector(instanceConfig.options);
|
|
1225
|
-
instanceType = EntityStorageFaucetConnector.NAMESPACE;
|
|
1226
|
-
}
|
|
1227
|
-
else {
|
|
1228
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1229
|
-
type,
|
|
1230
|
-
connectorType: "faucetConnector"
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1234
|
-
context.componentInstances.push({
|
|
1235
|
-
instanceType: finalInstanceType,
|
|
1236
|
-
component: connector
|
|
1237
|
-
});
|
|
1238
|
-
FaucetConnectorFactory.register(finalInstanceType, () => connector);
|
|
1239
|
-
return finalInstanceType;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1243
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1244
|
-
/**
|
|
1245
|
-
* Federated catalogue component types.
|
|
1246
|
-
*/
|
|
1247
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1248
|
-
const FederatedCatalogueComponentType = {
|
|
1249
|
-
/**
|
|
1250
|
-
* Service.
|
|
1251
|
-
*/
|
|
1252
|
-
Service: "service",
|
|
1253
|
-
/**
|
|
1254
|
-
* REST client.
|
|
1255
|
-
*/
|
|
1256
|
-
RestClient: "rest-client"
|
|
1257
|
-
};
|
|
1258
|
-
|
|
1259
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1260
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1261
|
-
/**
|
|
1262
|
-
* Initialise the federated catalogue component.
|
|
1263
|
-
* @param engineCore The engine core.
|
|
1264
|
-
* @param context The context for the engine.
|
|
1265
|
-
* @param instanceConfig The instance config.
|
|
1266
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1267
|
-
* @returns The name of the instance created.
|
|
1268
|
-
* @throws GeneralError if the component type is unknown.
|
|
1269
|
-
*/
|
|
1270
|
-
function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1271
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1272
|
-
element: `Federated Catalogue Component: ${instanceConfig.type}`
|
|
1273
|
-
}));
|
|
1274
|
-
const type = instanceConfig.type;
|
|
1275
|
-
let component;
|
|
1276
|
-
let instanceType;
|
|
1277
|
-
if (type === FederatedCatalogueComponentType.Service) {
|
|
1278
|
-
initSchema$5();
|
|
1279
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry");
|
|
1280
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry");
|
|
1281
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
|
|
1282
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
|
|
1283
|
-
component = new FederatedCatalogueService({
|
|
1284
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1285
|
-
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
1286
|
-
...instanceConfig.options
|
|
1287
|
-
});
|
|
1288
|
-
instanceType = StringHelper.kebabCase("FederatedCatalogueService");
|
|
1289
|
-
}
|
|
1290
|
-
else if (type === FederatedCatalogueComponentType.RestClient) {
|
|
1291
|
-
component = new FederatedCatalogueClient(instanceConfig.options);
|
|
1292
|
-
instanceType = StringHelper.kebabCase("FederatedCatalogueClient");
|
|
1293
|
-
}
|
|
1294
|
-
else {
|
|
1295
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1296
|
-
type,
|
|
1297
|
-
componentType: "FederatedCatalogueComponent"
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1301
|
-
context.componentInstances.push({
|
|
1302
|
-
instanceType: finalInstanceType,
|
|
1303
|
-
component
|
|
1304
|
-
});
|
|
1305
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1306
|
-
return finalInstanceType;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1310
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1311
|
-
/**
|
|
1312
|
-
* Identity component types.
|
|
1313
|
-
*/
|
|
1314
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1315
|
-
const IdentityComponentType = {
|
|
1316
|
-
/**
|
|
1317
|
-
* Service.
|
|
1318
|
-
*/
|
|
1319
|
-
Service: "service",
|
|
1320
|
-
/**
|
|
1321
|
-
* REST client.
|
|
1322
|
-
*/
|
|
1323
|
-
RestClient: "rest-client"
|
|
1324
|
-
};
|
|
1325
|
-
|
|
1326
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1327
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1328
|
-
/**
|
|
1329
|
-
* Identity connector types.
|
|
1330
|
-
*/
|
|
1331
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1332
|
-
const IdentityConnectorType = {
|
|
1333
|
-
/**
|
|
1334
|
-
* Entity storage.
|
|
1335
|
-
*/
|
|
1336
|
-
EntityStorage: "entity-storage",
|
|
1337
|
-
/**
|
|
1338
|
-
* IOTA.
|
|
1339
|
-
*/
|
|
1340
|
-
Iota: "iota"
|
|
1341
|
-
};
|
|
1342
|
-
|
|
1343
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1344
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1345
|
-
/**
|
|
1346
|
-
* Initialise the identity connector.
|
|
1347
|
-
* @param engineCore The engine core.
|
|
1348
|
-
* @param context The context for the engine.
|
|
1349
|
-
* @param instanceConfig The instance config.
|
|
1350
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1351
|
-
* @returns The name of the instance created.
|
|
1352
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1353
|
-
*/
|
|
1354
|
-
function initialiseIdentityConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1355
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1356
|
-
element: `Identity Connector: ${instanceConfig.type}`
|
|
1357
|
-
}));
|
|
1358
|
-
const type = instanceConfig.type;
|
|
1359
|
-
let connector;
|
|
1360
|
-
let instanceType;
|
|
1361
|
-
if (type === IdentityConnectorType.Iota) {
|
|
1362
|
-
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1363
|
-
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1364
|
-
connector = new IotaIdentityConnector({
|
|
1365
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1366
|
-
...instanceConfig.options,
|
|
1367
|
-
config: {
|
|
1368
|
-
...dltConfig?.options?.config,
|
|
1369
|
-
...instanceConfig.options.config
|
|
1370
|
-
}
|
|
1371
|
-
});
|
|
1372
|
-
instanceType = IotaIdentityConnector.NAMESPACE;
|
|
1373
|
-
}
|
|
1374
|
-
else if (type === IdentityConnectorType.EntityStorage) {
|
|
1375
|
-
initSchema$6({ includeProfile: false });
|
|
1376
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1377
|
-
connector = new EntityStorageIdentityConnector({
|
|
1378
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1379
|
-
...instanceConfig.options
|
|
1380
|
-
});
|
|
1381
|
-
instanceType = EntityStorageIdentityConnector.NAMESPACE;
|
|
1382
|
-
}
|
|
1383
|
-
else {
|
|
1384
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1385
|
-
type,
|
|
1386
|
-
connectorType: "identityConnector"
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1390
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1391
|
-
IdentityConnectorFactory.register(finalInstanceType, () => connector);
|
|
1392
|
-
return finalInstanceType;
|
|
1393
|
-
}
|
|
1394
|
-
/**
|
|
1395
|
-
* Initialise the identity component.
|
|
1396
|
-
* @param engineCore The engine core.
|
|
1397
|
-
* @param context The context for the engine.
|
|
1398
|
-
* @param instanceConfig The instance config.
|
|
1399
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1400
|
-
* @returns The name of the instance created.
|
|
1401
|
-
* @throws GeneralError if the component type is unknown.
|
|
1402
|
-
*/
|
|
1403
|
-
function initialiseIdentityComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1404
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1405
|
-
element: `Identity Component: ${instanceConfig.type}`
|
|
1406
|
-
}));
|
|
1407
|
-
const type = instanceConfig.type;
|
|
1408
|
-
let component;
|
|
1409
|
-
let instanceType;
|
|
1410
|
-
if (type === IdentityComponentType.Service) {
|
|
1411
|
-
component = new IdentityService(instanceConfig.options);
|
|
1412
|
-
instanceType = StringHelper.kebabCase("IdentityService");
|
|
1413
|
-
}
|
|
1414
|
-
else if (type === IdentityComponentType.RestClient) {
|
|
1415
|
-
component = new IdentityClient(instanceConfig.options);
|
|
1416
|
-
instanceType = StringHelper.kebabCase("IdentityClient");
|
|
1417
|
-
}
|
|
1418
|
-
else {
|
|
1419
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1420
|
-
type,
|
|
1421
|
-
componentType: "identityComponent"
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1425
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1426
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1427
|
-
return finalInstanceType;
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1431
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1432
|
-
/**
|
|
1433
|
-
* Identity profile component types.
|
|
1434
|
-
*/
|
|
1435
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1436
|
-
const IdentityProfileComponentType = {
|
|
1437
|
-
/**
|
|
1438
|
-
* Service.
|
|
1439
|
-
*/
|
|
1440
|
-
Service: "service",
|
|
1441
|
-
/**
|
|
1442
|
-
* REST client.
|
|
1443
|
-
*/
|
|
1444
|
-
RestClient: "rest-client"
|
|
1445
|
-
};
|
|
1446
|
-
|
|
1447
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1448
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1449
|
-
/**
|
|
1450
|
-
* Identity profile connector types.
|
|
1451
|
-
*/
|
|
1452
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1453
|
-
const IdentityProfileConnectorType = {
|
|
1454
|
-
/**
|
|
1455
|
-
* Entity storage.
|
|
1456
|
-
*/
|
|
1457
|
-
EntityStorage: "entity-storage"
|
|
1458
|
-
};
|
|
1459
|
-
|
|
1460
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1461
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1462
|
-
/**
|
|
1463
|
-
* Initialise the identity profile connector.
|
|
1464
|
-
* @param engineCore The engine core.
|
|
1465
|
-
* @param context The context for the engine.
|
|
1466
|
-
* @param instanceConfig The instance config.
|
|
1467
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1468
|
-
* @returns The name of the instance created.
|
|
1469
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1470
|
-
*/
|
|
1471
|
-
function initialiseIdentityProfileConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1472
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1473
|
-
element: `Identity Profile Connector: ${instanceConfig.type}`
|
|
1474
|
-
}));
|
|
1475
|
-
const type = instanceConfig.type;
|
|
1476
|
-
let connector;
|
|
1477
|
-
let instanceType;
|
|
1478
|
-
if (type === IdentityProfileConnectorType.EntityStorage) {
|
|
1479
|
-
initSchema$6({ includeDocument: false });
|
|
1480
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.profileEntityStorageType, "IdentityProfile");
|
|
1481
|
-
connector = new EntityStorageIdentityProfileConnector(instanceConfig.options);
|
|
1482
|
-
instanceType = EntityStorageIdentityProfileConnector.NAMESPACE;
|
|
1483
|
-
}
|
|
1484
|
-
else {
|
|
1485
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1486
|
-
type,
|
|
1487
|
-
serviceType: "identityProfile"
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1491
|
-
context.componentInstances.push({
|
|
1492
|
-
instanceType: finalInstanceType,
|
|
1493
|
-
component: connector
|
|
1494
|
-
});
|
|
1495
|
-
IdentityProfileConnectorFactory.register(finalInstanceType, () => connector);
|
|
1496
|
-
return finalInstanceType;
|
|
1497
|
-
}
|
|
1498
|
-
/**
|
|
1499
|
-
* Initialise the identity profile component.
|
|
1500
|
-
* @param engineCore The engine core.
|
|
1501
|
-
* @param context The context for the engine.
|
|
1502
|
-
* @param instanceConfig The instance config.
|
|
1503
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1504
|
-
* @returns The name of the instance created.
|
|
1505
|
-
* @throws GeneralError if the component type is unknown.
|
|
1506
|
-
*/
|
|
1507
|
-
function initialiseIdentityProfileComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1508
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1509
|
-
element: `Identity Profile Component: ${instanceConfig.type}`
|
|
1510
|
-
}));
|
|
1511
|
-
const type = instanceConfig.type;
|
|
1512
|
-
let component;
|
|
1513
|
-
let instanceType;
|
|
1514
|
-
if (type === IdentityProfileComponentType.Service) {
|
|
1515
|
-
component = new IdentityProfileService({
|
|
1516
|
-
profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
|
|
1517
|
-
...instanceConfig.options
|
|
1518
|
-
});
|
|
1519
|
-
instanceType = StringHelper.kebabCase("IdentityProfileService");
|
|
1520
|
-
}
|
|
1521
|
-
else if (type === IdentityProfileComponentType.RestClient) {
|
|
1522
|
-
component = new IdentityProfileClient(instanceConfig.options);
|
|
1523
|
-
instanceType = StringHelper.kebabCase("IdentityProfileClient");
|
|
1524
|
-
}
|
|
1525
|
-
else {
|
|
1526
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1527
|
-
type,
|
|
1528
|
-
componentType: "identityProfileComponent"
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1532
|
-
context.componentInstances.push({
|
|
1533
|
-
instanceType: finalInstanceType,
|
|
1534
|
-
component
|
|
1535
|
-
});
|
|
1536
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1537
|
-
return finalInstanceType;
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1541
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1542
|
-
/**
|
|
1543
|
-
* Identity resolver component types.
|
|
1544
|
-
*/
|
|
1545
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1546
|
-
const IdentityResolverComponentType = {
|
|
1547
|
-
/**
|
|
1548
|
-
* Service.
|
|
1549
|
-
*/
|
|
1550
|
-
Service: "service",
|
|
1551
|
-
/**
|
|
1552
|
-
* REST client.
|
|
1553
|
-
*/
|
|
1554
|
-
RestClient: "rest-client"
|
|
1555
|
-
};
|
|
1556
|
-
|
|
1557
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1558
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1559
|
-
/**
|
|
1560
|
-
* Identity resolver connector types.
|
|
1561
|
-
*/
|
|
1562
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1563
|
-
const IdentityResolverConnectorType = {
|
|
1564
|
-
/**
|
|
1565
|
-
* Entity storage.
|
|
1566
|
-
*/
|
|
1567
|
-
EntityStorage: "entity-storage",
|
|
1568
|
-
/**
|
|
1569
|
-
* IOTA.
|
|
1570
|
-
*/
|
|
1571
|
-
Iota: "iota",
|
|
1572
|
-
/**
|
|
1573
|
-
* Universal.
|
|
1574
|
-
*/
|
|
1575
|
-
Universal: "universal"
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1579
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1580
|
-
/**
|
|
1581
|
-
* Initialise the identity resolver connector.
|
|
1582
|
-
* @param engineCore The engine core.
|
|
1583
|
-
* @param context The context for the engine.
|
|
1584
|
-
* @param instanceConfig The instance config.
|
|
1585
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1586
|
-
* @returns The name of the instance created.
|
|
1587
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1588
|
-
*/
|
|
1589
|
-
function initialiseIdentityResolverConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1590
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1591
|
-
element: `Identity Resolver Connector: ${instanceConfig.type}`
|
|
1592
|
-
}));
|
|
1593
|
-
const type = instanceConfig.type;
|
|
1594
|
-
let connector;
|
|
1595
|
-
let instanceType;
|
|
1596
|
-
if (type === IdentityResolverConnectorType.Iota) {
|
|
1597
|
-
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1598
|
-
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1599
|
-
connector = new IotaIdentityResolverConnector({
|
|
1600
|
-
...instanceConfig.options,
|
|
1601
|
-
config: {
|
|
1602
|
-
...dltConfig?.options?.config,
|
|
1603
|
-
...instanceConfig.options.config
|
|
1604
|
-
}
|
|
1605
|
-
});
|
|
1606
|
-
instanceType = IotaIdentityResolverConnector.NAMESPACE;
|
|
1607
|
-
}
|
|
1608
|
-
else if (type === IdentityResolverConnectorType.EntityStorage) {
|
|
1609
|
-
initSchema$6({ includeProfile: false });
|
|
1610
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1611
|
-
connector = new EntityStorageIdentityResolverConnector({
|
|
1612
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1613
|
-
...instanceConfig.options
|
|
1614
|
-
});
|
|
1615
|
-
instanceType = EntityStorageIdentityResolverConnector.NAMESPACE;
|
|
1616
|
-
}
|
|
1617
|
-
else if (type === IdentityResolverConnectorType.Universal) {
|
|
1618
|
-
connector = new UniversalResolverConnector({
|
|
1619
|
-
...instanceConfig.options
|
|
1620
|
-
});
|
|
1621
|
-
instanceType = UniversalResolverConnector.NAMESPACE;
|
|
1622
|
-
}
|
|
1623
|
-
else {
|
|
1624
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1625
|
-
type,
|
|
1626
|
-
connectorType: "identityResolverConnector"
|
|
1627
|
-
});
|
|
1628
|
-
}
|
|
1629
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1630
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1631
|
-
IdentityResolverConnectorFactory.register(finalInstanceType, () => connector);
|
|
1632
|
-
return finalInstanceType;
|
|
1633
|
-
}
|
|
1634
|
-
/**
|
|
1635
|
-
* Initialise the identity resolver component.
|
|
1636
|
-
* @param engineCore The engine core.
|
|
1637
|
-
* @param context The context for the engine.
|
|
1638
|
-
* @param instanceConfig The instance config.
|
|
1639
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1640
|
-
* @returns The name of the instance created.
|
|
1641
|
-
* @throws GeneralError if the component type is unknown.
|
|
1642
|
-
*/
|
|
1643
|
-
function initialiseIdentityResolverComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1644
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1645
|
-
element: `Identity Resolver Component: ${instanceConfig.type}`
|
|
1646
|
-
}));
|
|
1647
|
-
const type = instanceConfig.type;
|
|
1648
|
-
let component;
|
|
1649
|
-
let instanceType;
|
|
1650
|
-
if (type === IdentityResolverComponentType.Service) {
|
|
1651
|
-
const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
|
|
1652
|
-
component = new IdentityResolverService({
|
|
1653
|
-
fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
|
|
1654
|
-
? IdentityResolverConnectorType.Universal
|
|
1655
|
-
: undefined,
|
|
1656
|
-
...instanceConfig.options
|
|
1657
|
-
});
|
|
1658
|
-
instanceType = StringHelper.kebabCase("IdentityResolverService");
|
|
1659
|
-
}
|
|
1660
|
-
else if (type === IdentityResolverComponentType.RestClient) {
|
|
1661
|
-
component = new IdentityResolverClient(instanceConfig.options);
|
|
1662
|
-
instanceType = StringHelper.kebabCase("IdentityResolverClient");
|
|
1663
|
-
}
|
|
1664
|
-
else {
|
|
1665
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1666
|
-
type,
|
|
1667
|
-
componentType: "identityResolverComponent"
|
|
1668
|
-
});
|
|
1669
|
-
}
|
|
1670
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1671
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1672
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1673
|
-
return finalInstanceType;
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1677
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1678
|
-
/**
|
|
1679
|
-
* Immutable proof component types.
|
|
1680
|
-
*/
|
|
1681
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1682
|
-
const ImmutableProofComponentType = {
|
|
1683
|
-
/**
|
|
1684
|
-
* Service.
|
|
1685
|
-
*/
|
|
1686
|
-
Service: "service",
|
|
1687
|
-
/**
|
|
1688
|
-
* REST client.
|
|
1689
|
-
*/
|
|
1690
|
-
RestClient: "rest-client"
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1694
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1695
|
-
/**
|
|
1696
|
-
* Initialise the immutable proof component.
|
|
1697
|
-
* @param engineCore The engine core.
|
|
1698
|
-
* @param context The context for the engine.
|
|
1699
|
-
* @param instanceConfig The instance config.
|
|
1700
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1701
|
-
* @returns The name of the instance created.
|
|
1702
|
-
* @throws GeneralError if the component type is unknown.
|
|
1703
|
-
*/
|
|
1704
|
-
function initialiseImmutableProofComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1705
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1706
|
-
element: `Immutable Proof Component: ${instanceConfig.type}`
|
|
1707
|
-
}));
|
|
1708
|
-
const type = instanceConfig.type;
|
|
1709
|
-
let component;
|
|
1710
|
-
let instanceType;
|
|
1711
|
-
if (type === ImmutableProofComponentType.Service) {
|
|
1712
|
-
initSchema$7();
|
|
1713
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
|
|
1714
|
-
component = new ImmutableProofService({
|
|
1715
|
-
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
1716
|
-
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
1717
|
-
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1718
|
-
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
1719
|
-
...instanceConfig.options
|
|
1720
|
-
});
|
|
1721
|
-
instanceType = StringHelper.kebabCase("ImmutableProofService");
|
|
1722
|
-
}
|
|
1723
|
-
else if (type === ImmutableProofComponentType.RestClient) {
|
|
1724
|
-
component = new ImmutableProofClient(instanceConfig.options);
|
|
1725
|
-
instanceType = StringHelper.kebabCase("ImmutableProofClient");
|
|
1726
|
-
}
|
|
1727
|
-
else {
|
|
1728
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1729
|
-
type,
|
|
1730
|
-
componentType: "immutableProofComponent"
|
|
1731
|
-
});
|
|
1732
|
-
}
|
|
1733
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1734
|
-
context.componentInstances.push({
|
|
1735
|
-
instanceType: finalInstanceType,
|
|
1736
|
-
component
|
|
1737
|
-
});
|
|
1738
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1739
|
-
return finalInstanceType;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1743
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1744
|
-
/**
|
|
1745
|
-
* Logging component types.
|
|
1746
|
-
*/
|
|
1747
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1748
|
-
const LoggingComponentType = {
|
|
1749
|
-
/**
|
|
1750
|
-
* Service.
|
|
1751
|
-
*/
|
|
1752
|
-
Service: "service",
|
|
1753
|
-
/**
|
|
1754
|
-
* REST client.
|
|
1755
|
-
*/
|
|
1756
|
-
RestClient: "rest-client"
|
|
1757
|
-
};
|
|
1758
|
-
|
|
1759
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1760
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1761
|
-
/**
|
|
1762
|
-
* Logging connector types.
|
|
1763
|
-
*/
|
|
1764
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1765
|
-
const LoggingConnectorType = {
|
|
1766
|
-
/**
|
|
1767
|
-
* Entity storage.
|
|
1768
|
-
*/
|
|
1769
|
-
EntityStorage: "entity-storage",
|
|
1770
|
-
/**
|
|
1771
|
-
* Console.
|
|
1772
|
-
*/
|
|
1773
|
-
Console: "console",
|
|
1774
|
-
/**
|
|
1775
|
-
* Multi combines other loggers.
|
|
1776
|
-
*/
|
|
1777
|
-
Multi: "multi"
|
|
1778
|
-
};
|
|
1779
|
-
|
|
1780
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1781
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1782
|
-
/**
|
|
1783
|
-
* Initialise the logging connector.
|
|
1784
|
-
* @param engineCore The engine core.
|
|
1785
|
-
* @param context The engine core context.
|
|
1786
|
-
* @param instanceConfig The instance config.
|
|
1787
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1788
|
-
* @returns The name of the instance created.
|
|
1789
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1790
|
-
*/
|
|
1791
|
-
function initialiseLoggingConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1792
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1793
|
-
element: `Logging Connector: ${instanceConfig.type}`
|
|
1794
|
-
}));
|
|
1795
|
-
const type = instanceConfig.type;
|
|
1796
|
-
let connector;
|
|
1797
|
-
let instanceType;
|
|
1798
|
-
if (type === LoggingConnectorType.Console) {
|
|
1799
|
-
connector = new ConsoleLoggingConnector(instanceConfig.options);
|
|
1800
|
-
instanceType = ConsoleLoggingConnector.NAMESPACE;
|
|
1801
|
-
}
|
|
1802
|
-
else if (type === LoggingConnectorType.EntityStorage) {
|
|
1803
|
-
initSchema$8();
|
|
1804
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry");
|
|
1805
|
-
connector = new EntityStorageLoggingConnector(instanceConfig.options);
|
|
1806
|
-
instanceType = EntityStorageLoggingConnector.NAMESPACE;
|
|
1807
|
-
}
|
|
1808
|
-
else if (type === LoggingConnectorType.Multi) {
|
|
1809
|
-
connector = new MultiLoggingConnector(instanceConfig.options);
|
|
1810
|
-
instanceType = MultiLoggingConnector.NAMESPACE;
|
|
1811
|
-
}
|
|
1812
|
-
else {
|
|
1813
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1814
|
-
type,
|
|
1815
|
-
connectorType: "loggingConnector"
|
|
1816
|
-
});
|
|
1817
|
-
}
|
|
1818
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1819
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1820
|
-
LoggingConnectorFactory.register(finalInstanceType, () => connector);
|
|
1821
|
-
return finalInstanceType;
|
|
1822
|
-
}
|
|
1823
|
-
/**
|
|
1824
|
-
* Initialise the logging component.
|
|
1825
|
-
* @param engineCore The engine core.
|
|
1826
|
-
* @param context The context for the engine.
|
|
1827
|
-
* @param instanceConfig The instance config.
|
|
1828
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1829
|
-
* @returns The name of the instance created.
|
|
1830
|
-
* @throws GeneralError if the component type is unknown.
|
|
1831
|
-
*/
|
|
1832
|
-
function initialiseLoggingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1833
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1834
|
-
element: `Logging Component: ${instanceConfig.type}`
|
|
1835
|
-
}));
|
|
1836
|
-
const type = instanceConfig.type;
|
|
1837
|
-
let component;
|
|
1838
|
-
let instanceType;
|
|
1839
|
-
if (type === LoggingComponentType.Service) {
|
|
1840
|
-
component = new LoggingService({
|
|
1841
|
-
loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
|
|
1842
|
-
...instanceConfig.options
|
|
1843
|
-
});
|
|
1844
|
-
instanceType = StringHelper.kebabCase("LoggingService");
|
|
1845
|
-
}
|
|
1846
|
-
else if (type === LoggingComponentType.RestClient) {
|
|
1847
|
-
component = new LoggingClient(instanceConfig.options);
|
|
1848
|
-
instanceType = StringHelper.kebabCase("LoggingClient");
|
|
1849
|
-
}
|
|
1850
|
-
else {
|
|
1851
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1852
|
-
type,
|
|
1853
|
-
componentType: "loggingComponent"
|
|
1854
|
-
});
|
|
1855
|
-
}
|
|
1856
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1857
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1858
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1859
|
-
return finalInstanceType;
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1863
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1864
|
-
/**
|
|
1865
|
-
* Messaging component types.
|
|
1866
|
-
*/
|
|
1867
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1868
|
-
const MessagingComponentType = {
|
|
1869
|
-
/**
|
|
1870
|
-
* Service.
|
|
1871
|
-
*/
|
|
1872
|
-
Service: "service"
|
|
1873
|
-
};
|
|
1874
|
-
|
|
1875
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1876
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1877
|
-
/**
|
|
1878
|
-
* Messaging email connector types.
|
|
1879
|
-
*/
|
|
1880
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1881
|
-
const MessagingEmailConnectorType = {
|
|
1882
|
-
/**
|
|
1883
|
-
* Entity storage.
|
|
1884
|
-
*/
|
|
1885
|
-
EntityStorage: "entity-storage",
|
|
1886
|
-
/**
|
|
1887
|
-
* AWS.
|
|
1888
|
-
*/
|
|
1889
|
-
Aws: "aws"
|
|
1890
|
-
};
|
|
1891
|
-
|
|
1892
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1893
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1894
|
-
/**
|
|
1895
|
-
* Messaging push notification connector types.
|
|
1896
|
-
*/
|
|
1897
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1898
|
-
const MessagingPushNotificationConnectorType = {
|
|
1899
|
-
/**
|
|
1900
|
-
* Entity storage.
|
|
1901
|
-
*/
|
|
1902
|
-
EntityStorage: "entity-storage",
|
|
1903
|
-
/**
|
|
1904
|
-
* AWS.
|
|
1905
|
-
*/
|
|
1906
|
-
Aws: "aws"
|
|
1907
|
-
};
|
|
1908
|
-
|
|
1909
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1910
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1911
|
-
/**
|
|
1912
|
-
* Messaging sms connector types.
|
|
1913
|
-
*/
|
|
1914
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1915
|
-
const MessagingSmsConnectorType = {
|
|
1916
|
-
/**
|
|
1917
|
-
* Entity storage.
|
|
1918
|
-
*/
|
|
1919
|
-
EntityStorage: "entity-storage",
|
|
1920
|
-
/**
|
|
1921
|
-
* AWS.
|
|
1922
|
-
*/
|
|
1923
|
-
Aws: "aws"
|
|
1924
|
-
};
|
|
1925
|
-
|
|
1926
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1927
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1928
|
-
/**
|
|
1929
|
-
* Initialise a messaging email connector.
|
|
1930
|
-
* @param engineCore The engine core.
|
|
1931
|
-
* @param context The context for the engine.
|
|
1932
|
-
* @param instanceConfig The instance config.
|
|
1933
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1934
|
-
* @returns The name of the instance created.
|
|
1935
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1936
|
-
*/
|
|
1937
|
-
function initialiseMessagingEmailConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1938
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1939
|
-
element: `Messaging Email Connector: ${instanceConfig.type}`
|
|
1940
|
-
}));
|
|
1941
|
-
const type = instanceConfig.type;
|
|
1942
|
-
let connector;
|
|
1943
|
-
let instanceType;
|
|
1944
|
-
if (type === MessagingEmailConnectorType.EntityStorage) {
|
|
1945
|
-
initSchema$9({ email: true, sms: false, pushNotification: false });
|
|
1946
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
|
|
1947
|
-
connector = new EntityStorageMessagingEmailConnector({
|
|
1948
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1949
|
-
...instanceConfig.options
|
|
1950
|
-
});
|
|
1951
|
-
instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
1952
|
-
}
|
|
1953
|
-
else if (type === MessagingEmailConnectorType.Aws) {
|
|
1954
|
-
connector = new AwsMessagingEmailConnector({
|
|
1955
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1956
|
-
...instanceConfig.options
|
|
1957
|
-
});
|
|
1958
|
-
instanceType = AwsMessagingEmailConnector.NAMESPACE;
|
|
1959
|
-
}
|
|
1960
|
-
else {
|
|
1961
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
1962
|
-
type,
|
|
1963
|
-
connectorType: "messagingEmailConnector"
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1967
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1968
|
-
MessagingEmailConnectorFactory.register(finalInstanceType, () => connector);
|
|
1969
|
-
return finalInstanceType;
|
|
1970
|
-
}
|
|
1971
|
-
/**
|
|
1972
|
-
* Initialise a messaging sms connector.
|
|
1973
|
-
* @param engineCore The engine core.
|
|
1974
|
-
* @param context The context for the engine.
|
|
1975
|
-
* @param instanceConfig The instance config.
|
|
1976
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
1977
|
-
* @returns The name of the instance created.
|
|
1978
|
-
* @throws GeneralError if the connector type is unknown.
|
|
1979
|
-
*/
|
|
1980
|
-
function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1981
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1982
|
-
element: `Messaging SMS Connector: ${instanceConfig.type}`
|
|
1983
|
-
}));
|
|
1984
|
-
const type = instanceConfig.type;
|
|
1985
|
-
let connector;
|
|
1986
|
-
let instanceType;
|
|
1987
|
-
if (type === MessagingSmsConnectorType.EntityStorage) {
|
|
1988
|
-
initSchema$9({ email: false, sms: true, pushNotification: false });
|
|
1989
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
|
|
1990
|
-
connector = new EntityStorageMessagingSmsConnector({
|
|
1991
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1992
|
-
...instanceConfig.options
|
|
1993
|
-
});
|
|
1994
|
-
instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
1995
|
-
}
|
|
1996
|
-
else if (type === MessagingSmsConnectorType.Aws) {
|
|
1997
|
-
connector = new AwsMessagingSmsConnector({
|
|
1998
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1999
|
-
...instanceConfig.options
|
|
2000
|
-
});
|
|
2001
|
-
instanceType = AwsMessagingSmsConnector.NAMESPACE;
|
|
2002
|
-
}
|
|
2003
|
-
else {
|
|
2004
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2005
|
-
type,
|
|
2006
|
-
connectorType: "messagingSmsConnector"
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2010
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2011
|
-
MessagingSmsConnectorFactory.register(finalInstanceType, () => connector);
|
|
2012
|
-
return finalInstanceType;
|
|
2013
|
-
}
|
|
2014
|
-
/**
|
|
2015
|
-
* Initialise a messaging push notification connector.
|
|
2016
|
-
* @param engineCore The engine core.
|
|
2017
|
-
* @param context The context for the engine.
|
|
2018
|
-
* @param instanceConfig The instance config.
|
|
2019
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2020
|
-
* @returns The name of the instance created.
|
|
2021
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2022
|
-
*/
|
|
2023
|
-
function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2024
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2025
|
-
element: `Messaging Push Notification Connector: ${instanceConfig.type}`
|
|
2026
|
-
}));
|
|
2027
|
-
const type = instanceConfig.type;
|
|
2028
|
-
let connector;
|
|
2029
|
-
let instanceType;
|
|
2030
|
-
if (type === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
2031
|
-
initSchema$9({ email: false, sms: false, pushNotification: true });
|
|
2032
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
|
|
2033
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
|
|
2034
|
-
connector = new EntityStorageMessagingPushNotificationConnector({
|
|
2035
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2036
|
-
...instanceConfig.options
|
|
2037
|
-
});
|
|
2038
|
-
instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
2039
|
-
}
|
|
2040
|
-
else if (type === MessagingPushNotificationConnectorType.Aws) {
|
|
2041
|
-
connector = new AwsMessagingPushNotificationConnector({
|
|
2042
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2043
|
-
...instanceConfig.options
|
|
2044
|
-
});
|
|
2045
|
-
instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
2046
|
-
}
|
|
2047
|
-
else {
|
|
2048
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2049
|
-
type,
|
|
2050
|
-
connectorType: "messagingPushNotificationConnector"
|
|
2051
|
-
});
|
|
2052
|
-
}
|
|
2053
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2054
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2055
|
-
MessagingPushNotificationsConnectorFactory.register(finalInstanceType, () => connector);
|
|
2056
|
-
return finalInstanceType;
|
|
2057
|
-
}
|
|
2058
|
-
/**
|
|
2059
|
-
* Initialise the messaging component.
|
|
2060
|
-
* @param engineCore The engine core.
|
|
2061
|
-
* @param context The context for the engine.
|
|
2062
|
-
* @param instanceConfig The instance config.
|
|
2063
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2064
|
-
* @returns The name of the instance created.
|
|
2065
|
-
* @throws GeneralError if the component type is unknown.
|
|
2066
|
-
*/
|
|
2067
|
-
function initialiseMessagingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2068
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2069
|
-
element: `Messaging Component: ${instanceConfig.type}`
|
|
2070
|
-
}));
|
|
2071
|
-
const type = instanceConfig.type;
|
|
2072
|
-
let component;
|
|
2073
|
-
let instanceType;
|
|
2074
|
-
if (type === MessagingComponentType.Service) {
|
|
2075
|
-
initSchema$a();
|
|
2076
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
2077
|
-
component = new MessagingService({
|
|
2078
|
-
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
2079
|
-
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
2080
|
-
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
2081
|
-
...instanceConfig.options
|
|
2082
|
-
});
|
|
2083
|
-
instanceType = StringHelper.kebabCase("MessagingService");
|
|
2084
|
-
}
|
|
2085
|
-
else {
|
|
2086
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2087
|
-
type,
|
|
2088
|
-
componentType: "messagingComponent"
|
|
2089
|
-
});
|
|
2090
|
-
}
|
|
2091
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2092
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
2093
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2094
|
-
return finalInstanceType;
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2098
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2099
|
-
/**
|
|
2100
|
-
* NFT component types.
|
|
2101
|
-
*/
|
|
2102
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2103
|
-
const NftComponentType = {
|
|
2104
|
-
/**
|
|
2105
|
-
* Service.
|
|
2106
|
-
*/
|
|
2107
|
-
Service: "service",
|
|
2108
|
-
/**
|
|
2109
|
-
* REST client.
|
|
2110
|
-
*/
|
|
2111
|
-
RestClient: "rest-client"
|
|
2112
|
-
};
|
|
2113
|
-
|
|
2114
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2115
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2116
|
-
/**
|
|
2117
|
-
* NFT connector types.
|
|
2118
|
-
*/
|
|
2119
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2120
|
-
const NftConnectorType = {
|
|
2121
|
-
/**
|
|
2122
|
-
* Entity storage.
|
|
2123
|
-
*/
|
|
2124
|
-
EntityStorage: "entity-storage",
|
|
2125
|
-
/**
|
|
2126
|
-
* IOTA.
|
|
2127
|
-
*/
|
|
2128
|
-
Iota: "iota"
|
|
2129
|
-
};
|
|
2130
|
-
|
|
2131
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2132
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2133
|
-
/**
|
|
2134
|
-
* Initialise the NFT connector.
|
|
2135
|
-
* @param engineCore The engine core.
|
|
2136
|
-
* @param context The context for the engine.
|
|
2137
|
-
* @param instanceConfig The instance config.
|
|
2138
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2139
|
-
* @returns The name of the instance created.
|
|
2140
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2141
|
-
*/
|
|
2142
|
-
function initialiseNftConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2143
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2144
|
-
element: `NFT Connector: ${instanceConfig.type}`
|
|
2145
|
-
}));
|
|
2146
|
-
const type = instanceConfig.type;
|
|
2147
|
-
let connector;
|
|
2148
|
-
let instanceType;
|
|
2149
|
-
if (type === NftConnectorType.EntityStorage) {
|
|
2150
|
-
initSchema$b();
|
|
2151
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.nftEntityStorageType, "Nft");
|
|
2152
|
-
connector = new EntityStorageNftConnector(instanceConfig.options);
|
|
2153
|
-
instanceType = EntityStorageNftConnector.NAMESPACE;
|
|
2154
|
-
}
|
|
2155
|
-
else if (type === NftConnectorType.Iota) {
|
|
2156
|
-
connector = new IotaNftConnector({
|
|
2157
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2158
|
-
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
2159
|
-
...instanceConfig.options
|
|
2160
|
-
});
|
|
2161
|
-
instanceType = IotaNftConnector.NAMESPACE;
|
|
2162
|
-
}
|
|
2163
|
-
else {
|
|
2164
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2165
|
-
type,
|
|
2166
|
-
connectorType: "nftConnector"
|
|
2167
|
-
});
|
|
2168
|
-
}
|
|
2169
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2170
|
-
context.componentInstances.push({
|
|
2171
|
-
instanceType: finalInstanceType,
|
|
2172
|
-
component: connector
|
|
2173
|
-
});
|
|
2174
|
-
NftConnectorFactory.register(finalInstanceType, () => connector);
|
|
2175
|
-
return finalInstanceType;
|
|
2176
|
-
}
|
|
2177
|
-
/**
|
|
2178
|
-
* Initialise the NFT component.
|
|
2179
|
-
* @param engineCore The engine core.
|
|
2180
|
-
* @param context The context for the engine.
|
|
2181
|
-
* @param instanceConfig The instance config.
|
|
2182
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2183
|
-
* @returns The name of the instance created.
|
|
2184
|
-
* @throws GeneralError if the component type is unknown.
|
|
2185
|
-
*/
|
|
2186
|
-
function initialiseNftComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2187
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2188
|
-
element: `Nft Storage Component: ${instanceConfig.type}`
|
|
2189
|
-
}));
|
|
2190
|
-
const type = instanceConfig.type;
|
|
2191
|
-
let component;
|
|
2192
|
-
let instanceType;
|
|
2193
|
-
if (type === NftComponentType.Service) {
|
|
2194
|
-
component = new NftService(instanceConfig.options);
|
|
2195
|
-
instanceType = StringHelper.kebabCase("NftService");
|
|
2196
|
-
}
|
|
2197
|
-
else if (type === NftComponentType.RestClient) {
|
|
2198
|
-
component = new NftClient(instanceConfig.options);
|
|
2199
|
-
instanceType = StringHelper.kebabCase("NftClient");
|
|
2200
|
-
}
|
|
2201
|
-
else {
|
|
2202
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2203
|
-
type,
|
|
2204
|
-
componentType: "nftComponent"
|
|
2205
|
-
});
|
|
2206
|
-
}
|
|
2207
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2208
|
-
context.componentInstances.push({
|
|
2209
|
-
instanceType: finalInstanceType,
|
|
2210
|
-
component
|
|
2211
|
-
});
|
|
2212
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2213
|
-
return finalInstanceType;
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2217
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2218
|
-
/**
|
|
2219
|
-
* Rights management component types.
|
|
2220
|
-
*/
|
|
2221
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2222
|
-
const RightsManagementComponentType = {
|
|
2223
|
-
/**
|
|
2224
|
-
* Service.
|
|
2225
|
-
*/
|
|
2226
|
-
Service: "service",
|
|
2227
|
-
/**
|
|
2228
|
-
* REST client.
|
|
2229
|
-
*/
|
|
2230
|
-
RestClient: "rest-client"
|
|
2231
|
-
};
|
|
2232
|
-
|
|
2233
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2234
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2235
|
-
/**
|
|
2236
|
-
* Initialise the rights management component.
|
|
2237
|
-
* @param engineCore The engine core.
|
|
2238
|
-
* @param context The context for the engine.
|
|
2239
|
-
* @param instanceConfig The instance config.
|
|
2240
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2241
|
-
* @returns The name of the instance created.
|
|
2242
|
-
* @throws GeneralError if the component type is unknown.
|
|
2243
|
-
*/
|
|
2244
|
-
function initialiseRightsManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2245
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2246
|
-
element: `Rights Management Component: ${instanceConfig.type}`
|
|
2247
|
-
}));
|
|
2248
|
-
const type = instanceConfig.type;
|
|
2249
|
-
let component;
|
|
2250
|
-
let instanceType;
|
|
2251
|
-
if (type === RightsManagementComponentType.Service) {
|
|
2252
|
-
component = new RightsManagementService({
|
|
2253
|
-
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2254
|
-
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
2255
|
-
...instanceConfig.options
|
|
2256
|
-
});
|
|
2257
|
-
instanceType = StringHelper.kebabCase("RightsManagementService");
|
|
2258
|
-
}
|
|
2259
|
-
else if (type === RightsManagementComponentType.RestClient) {
|
|
2260
|
-
component = new RightsManagementClient(instanceConfig.options);
|
|
2261
|
-
instanceType = StringHelper.kebabCase("RightsManagementClient");
|
|
2262
|
-
}
|
|
2263
|
-
else {
|
|
2264
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2265
|
-
type,
|
|
2266
|
-
componentType: "RightsManagementComponent"
|
|
2267
|
-
});
|
|
2268
|
-
}
|
|
2269
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2270
|
-
context.componentInstances.push({
|
|
2271
|
-
instanceType: finalInstanceType,
|
|
2272
|
-
component
|
|
2273
|
-
});
|
|
2274
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2275
|
-
return finalInstanceType;
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2279
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2280
|
-
/**
|
|
2281
|
-
* Rights management PAP component types.
|
|
2282
|
-
*/
|
|
2283
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2284
|
-
const RightsManagementPapComponentType = {
|
|
2285
|
-
/**
|
|
2286
|
-
* Service.
|
|
2287
|
-
*/
|
|
2288
|
-
Service: "service"
|
|
2289
|
-
};
|
|
2290
|
-
|
|
2291
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2292
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2293
|
-
/**
|
|
2294
|
-
* Initialise the rights management PAP component.
|
|
2295
|
-
* @param engineCore The engine core.
|
|
2296
|
-
* @param context The context for the engine.
|
|
2297
|
-
* @param instanceConfig The instance config.
|
|
2298
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2299
|
-
* @returns The name of the instance created.
|
|
2300
|
-
* @throws GeneralError if the component type is unknown.
|
|
2301
|
-
*/
|
|
2302
|
-
function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2303
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2304
|
-
element: `Rights Management PAP Component: ${instanceConfig.type}`
|
|
2305
|
-
}));
|
|
2306
|
-
const type = instanceConfig.type;
|
|
2307
|
-
let component;
|
|
2308
|
-
let instanceType;
|
|
2309
|
-
if (type === RightsManagementPapComponentType.Service) {
|
|
2310
|
-
initSchema$c();
|
|
2311
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
|
|
2312
|
-
component = new PolicyAdministrationPointService({
|
|
2313
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2314
|
-
...instanceConfig.options
|
|
2315
|
-
});
|
|
2316
|
-
instanceType = StringHelper.kebabCase("PolicyAdministrationPointService");
|
|
2317
|
-
}
|
|
2318
|
-
else {
|
|
2319
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2320
|
-
type,
|
|
2321
|
-
componentType: "RightsManagementPapComponent"
|
|
2322
|
-
});
|
|
2323
|
-
}
|
|
2324
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2325
|
-
context.componentInstances.push({
|
|
2326
|
-
instanceType: finalInstanceType,
|
|
2327
|
-
component
|
|
2328
|
-
});
|
|
2329
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2330
|
-
return finalInstanceType;
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2334
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2335
|
-
/**
|
|
2336
|
-
* Rights management PDP component types.
|
|
2337
|
-
*/
|
|
2338
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2339
|
-
const RightsManagementPdpComponentType = {
|
|
2340
|
-
/**
|
|
2341
|
-
* Service.
|
|
2342
|
-
*/
|
|
2343
|
-
Service: "service"
|
|
2344
|
-
};
|
|
2345
|
-
|
|
2346
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2347
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2348
|
-
/**
|
|
2349
|
-
* Initialise the rights management PDP component.
|
|
2350
|
-
* @param engineCore The engine core.
|
|
2351
|
-
* @param context The context for the engine.
|
|
2352
|
-
* @param instanceConfig The instance config.
|
|
2353
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2354
|
-
* @returns The name of the instance created.
|
|
2355
|
-
* @throws GeneralError if the component type is unknown.
|
|
2356
|
-
*/
|
|
2357
|
-
function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2358
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2359
|
-
element: `Rights Management PDP Component: ${instanceConfig.type}`
|
|
2360
|
-
}));
|
|
2361
|
-
const type = instanceConfig.type;
|
|
2362
|
-
let component;
|
|
2363
|
-
let instanceType;
|
|
2364
|
-
if (type === RightsManagementPdpComponentType.Service) {
|
|
2365
|
-
component = new PolicyDecisionPointService({
|
|
2366
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2367
|
-
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2368
|
-
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2369
|
-
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2370
|
-
...instanceConfig.options
|
|
2371
|
-
});
|
|
2372
|
-
instanceType = StringHelper.kebabCase("PolicyDecisionPointService");
|
|
2373
|
-
}
|
|
2374
|
-
else {
|
|
2375
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2376
|
-
type,
|
|
2377
|
-
componentType: "RightsManagementPdpComponent"
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2381
|
-
context.componentInstances.push({
|
|
2382
|
-
instanceType: finalInstanceType,
|
|
2383
|
-
component
|
|
2384
|
-
});
|
|
2385
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2386
|
-
return finalInstanceType;
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2390
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2391
|
-
/**
|
|
2392
|
-
* Rights management PEP component types.
|
|
2393
|
-
*/
|
|
2394
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2395
|
-
const RightsManagementPepComponentType = {
|
|
2396
|
-
/**
|
|
2397
|
-
* Service.
|
|
2398
|
-
*/
|
|
2399
|
-
Service: "service"
|
|
2400
|
-
};
|
|
2401
|
-
|
|
2402
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2403
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2404
|
-
/**
|
|
2405
|
-
* Initialise the rights management PEP component.
|
|
2406
|
-
* @param engineCore The engine core.
|
|
2407
|
-
* @param context The context for the engine.
|
|
2408
|
-
* @param instanceConfig The instance config.
|
|
2409
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2410
|
-
* @returns The name of the instance created.
|
|
2411
|
-
* @throws GeneralError if the component type is unknown.
|
|
2412
|
-
*/
|
|
2413
|
-
function initialiseRightsManagementPepComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2414
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2415
|
-
element: `Rights Management PEP Component: ${instanceConfig.type}`
|
|
2416
|
-
}));
|
|
2417
|
-
const type = instanceConfig.type;
|
|
2418
|
-
let component;
|
|
2419
|
-
let instanceType;
|
|
2420
|
-
if (type === RightsManagementPepComponentType.Service) {
|
|
2421
|
-
component = new PolicyEnforcementPointService({
|
|
2422
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2423
|
-
policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
|
|
2424
|
-
...instanceConfig.options
|
|
2425
|
-
});
|
|
2426
|
-
instanceType = StringHelper.kebabCase("PolicyEnforcementPointService");
|
|
2427
|
-
}
|
|
2428
|
-
else {
|
|
2429
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2430
|
-
type,
|
|
2431
|
-
componentType: "RightsManagementPepComponent"
|
|
2432
|
-
});
|
|
2433
|
-
}
|
|
2434
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2435
|
-
context.componentInstances.push({
|
|
2436
|
-
instanceType: finalInstanceType,
|
|
2437
|
-
component
|
|
2438
|
-
});
|
|
2439
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2440
|
-
return finalInstanceType;
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2444
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2445
|
-
/**
|
|
2446
|
-
* Rights management PIP component types.
|
|
2447
|
-
*/
|
|
2448
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2449
|
-
const RightsManagementPipComponentType = {
|
|
2450
|
-
/**
|
|
2451
|
-
* Service.
|
|
2452
|
-
*/
|
|
2453
|
-
Service: "service"
|
|
2454
|
-
};
|
|
2455
|
-
|
|
2456
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2457
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2458
|
-
/**
|
|
2459
|
-
* Initialise the rights management PIP component.
|
|
2460
|
-
* @param engineCore The engine core.
|
|
2461
|
-
* @param context The context for the engine.
|
|
2462
|
-
* @param instanceConfig The instance config.
|
|
2463
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2464
|
-
* @returns The name of the instance created.
|
|
2465
|
-
* @throws GeneralError if the component type is unknown.
|
|
2466
|
-
*/
|
|
2467
|
-
function initialiseRightsManagementPipComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2468
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2469
|
-
element: `Rights Management PIP Component: ${instanceConfig.type}`
|
|
2470
|
-
}));
|
|
2471
|
-
const type = instanceConfig.type;
|
|
2472
|
-
let component;
|
|
2473
|
-
let instanceType;
|
|
2474
|
-
if (type === RightsManagementPipComponentType.Service) {
|
|
2475
|
-
component = new PolicyInformationPointService({
|
|
2476
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2477
|
-
...instanceConfig.options
|
|
2478
|
-
});
|
|
2479
|
-
instanceType = StringHelper.kebabCase("PolicyInformationPointService");
|
|
2480
|
-
}
|
|
2481
|
-
else {
|
|
2482
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2483
|
-
type,
|
|
2484
|
-
componentType: "RightsManagementPipComponent"
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2488
|
-
context.componentInstances.push({
|
|
2489
|
-
instanceType: finalInstanceType,
|
|
2490
|
-
component
|
|
2491
|
-
});
|
|
2492
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2493
|
-
return finalInstanceType;
|
|
2494
|
-
}
|
|
2495
|
-
|
|
2496
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2497
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2498
|
-
/**
|
|
2499
|
-
* Rights management PMP component types.
|
|
2500
|
-
*/
|
|
2501
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2502
|
-
const RightsManagementPmpComponentType = {
|
|
2503
|
-
/**
|
|
2504
|
-
* Service.
|
|
2505
|
-
*/
|
|
2506
|
-
Service: "service"
|
|
2507
|
-
};
|
|
2508
|
-
|
|
2509
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2510
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2511
|
-
/**
|
|
2512
|
-
* Initialise the rights management PMP component.
|
|
2513
|
-
* @param engineCore The engine core.
|
|
2514
|
-
* @param context The context for the engine.
|
|
2515
|
-
* @param instanceConfig The instance config.
|
|
2516
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2517
|
-
* @returns The name of the instance created.
|
|
2518
|
-
* @throws GeneralError if the component type is unknown.
|
|
2519
|
-
*/
|
|
2520
|
-
function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2521
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2522
|
-
element: `Rights Management PMP Component: ${instanceConfig.type}`
|
|
2523
|
-
}));
|
|
2524
|
-
const type = instanceConfig.type;
|
|
2525
|
-
let component;
|
|
2526
|
-
let instanceType;
|
|
2527
|
-
if (type === RightsManagementPmpComponentType.Service) {
|
|
2528
|
-
component = new PolicyManagementPointService({
|
|
2529
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2530
|
-
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2531
|
-
...instanceConfig.options
|
|
2532
|
-
});
|
|
2533
|
-
instanceType = StringHelper.kebabCase("PolicyManagementPointService");
|
|
2534
|
-
}
|
|
2535
|
-
else {
|
|
2536
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2537
|
-
type,
|
|
2538
|
-
componentType: "RightsManagementPmpComponent"
|
|
2539
|
-
});
|
|
2540
|
-
}
|
|
2541
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2542
|
-
context.componentInstances.push({
|
|
2543
|
-
instanceType: finalInstanceType,
|
|
2544
|
-
component
|
|
2545
|
-
});
|
|
2546
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2547
|
-
return finalInstanceType;
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2551
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2552
|
-
/**
|
|
2553
|
-
* Rights management PXP component types.
|
|
2554
|
-
*/
|
|
2555
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2556
|
-
const RightsManagementPxpComponentType = {
|
|
2557
|
-
/**
|
|
2558
|
-
* Service.
|
|
2559
|
-
*/
|
|
2560
|
-
Service: "service"
|
|
2561
|
-
};
|
|
2562
|
-
|
|
2563
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2564
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2565
|
-
/**
|
|
2566
|
-
* Initialise the rights management PXP component.
|
|
2567
|
-
* @param engineCore The engine core.
|
|
2568
|
-
* @param context The context for the engine.
|
|
2569
|
-
* @param instanceConfig The instance config.
|
|
2570
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2571
|
-
* @returns The name of the instance created.
|
|
2572
|
-
* @throws GeneralError if the component type is unknown.
|
|
2573
|
-
*/
|
|
2574
|
-
function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2575
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2576
|
-
element: `Rights Management PXP Component: ${instanceConfig.type}`
|
|
2577
|
-
}));
|
|
2578
|
-
const type = instanceConfig.type;
|
|
2579
|
-
let component;
|
|
2580
|
-
let instanceType;
|
|
2581
|
-
if (type === RightsManagementPxpComponentType.Service) {
|
|
2582
|
-
component = new PolicyExecutionPointService({
|
|
2583
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2584
|
-
...instanceConfig.options
|
|
2585
|
-
});
|
|
2586
|
-
instanceType = StringHelper.kebabCase("PolicyExecutionPointService");
|
|
2587
|
-
}
|
|
2588
|
-
else {
|
|
2589
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2590
|
-
type,
|
|
2591
|
-
componentType: "RightsManagementPxpComponent"
|
|
2592
|
-
});
|
|
2593
|
-
}
|
|
2594
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2595
|
-
context.componentInstances.push({
|
|
2596
|
-
instanceType: finalInstanceType,
|
|
2597
|
-
component
|
|
2598
|
-
});
|
|
2599
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2600
|
-
return finalInstanceType;
|
|
2601
|
-
}
|
|
2602
|
-
|
|
2603
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2604
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2605
|
-
/**
|
|
2606
|
-
* Synchronised storage component types.
|
|
2607
|
-
*/
|
|
2608
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2609
|
-
const SynchronisedStorageComponentType = {
|
|
2610
|
-
/**
|
|
2611
|
-
* Service.
|
|
2612
|
-
*/
|
|
2613
|
-
Service: "service",
|
|
2614
|
-
/**
|
|
2615
|
-
* REST client.
|
|
2616
|
-
*/
|
|
2617
|
-
RestClient: "rest-client"
|
|
2618
|
-
};
|
|
2619
|
-
|
|
2620
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2621
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2622
|
-
/**
|
|
2623
|
-
* Initialise the synchronised storage component.
|
|
2624
|
-
* @param engineCore The engine core.
|
|
2625
|
-
* @param context The context for the engine.
|
|
2626
|
-
* @param instanceConfig The instance config.
|
|
2627
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2628
|
-
* @returns The name of the instance created.
|
|
2629
|
-
* @throws GeneralError if the component type is unknown.
|
|
2630
|
-
*/
|
|
2631
|
-
function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2632
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2633
|
-
element: `Synchronised Storage Component: ${instanceConfig.type}`
|
|
2634
|
-
}));
|
|
2635
|
-
const type = instanceConfig.type;
|
|
2636
|
-
let component;
|
|
2637
|
-
let instanceType;
|
|
2638
|
-
if (type === SynchronisedStorageComponentType.Service) {
|
|
2639
|
-
initSchema$d();
|
|
2640
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
|
|
2641
|
-
component = new SynchronisedStorageService({
|
|
2642
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2643
|
-
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
2644
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2645
|
-
verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
2646
|
-
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2647
|
-
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2648
|
-
trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
|
|
2649
|
-
blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
|
|
2650
|
-
"public"
|
|
2651
|
-
]),
|
|
2652
|
-
...instanceConfig.options
|
|
2653
|
-
});
|
|
2654
|
-
instanceType = StringHelper.kebabCase("SynchronisedStorageService");
|
|
2655
|
-
}
|
|
2656
|
-
else if (type === SynchronisedStorageComponentType.RestClient) {
|
|
2657
|
-
component = new SynchronisedStorageClient(instanceConfig.options);
|
|
2658
|
-
instanceType = StringHelper.kebabCase("SynchronisedStorageClient");
|
|
2659
|
-
}
|
|
2660
|
-
else {
|
|
2661
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2662
|
-
type,
|
|
2663
|
-
componentType: "SynchronisedStorageComponent"
|
|
2664
|
-
});
|
|
2665
|
-
}
|
|
2666
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2667
|
-
context.componentInstances.push({
|
|
2668
|
-
instanceType: finalInstanceType,
|
|
2669
|
-
component
|
|
2670
|
-
});
|
|
2671
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2672
|
-
return finalInstanceType;
|
|
2673
|
-
}
|
|
2674
|
-
|
|
2675
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2676
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2677
|
-
/**
|
|
2678
|
-
* Task scheduler component types.
|
|
2679
|
-
*/
|
|
2680
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2681
|
-
const TaskSchedulerComponentType = {
|
|
2682
|
-
/**
|
|
2683
|
-
* Task scheduler.
|
|
2684
|
-
*/
|
|
2685
|
-
Service: "service"
|
|
2686
|
-
};
|
|
2687
|
-
|
|
2688
|
-
/**
|
|
2689
|
-
* Initialise a task scheduler.
|
|
2690
|
-
* @param engineCore The engine core.
|
|
2691
|
-
* @param context The context for the engine.
|
|
2692
|
-
* @param instanceConfig The instance config.
|
|
2693
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2694
|
-
* @returns The name of the instance created.
|
|
2695
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2696
|
-
*/
|
|
2697
|
-
function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2698
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2699
|
-
element: `Task Scheduler: ${instanceConfig.type}`
|
|
2700
|
-
}));
|
|
2701
|
-
const type = instanceConfig.type;
|
|
2702
|
-
let component;
|
|
2703
|
-
let instanceType;
|
|
2704
|
-
if (type === TaskSchedulerComponentType.Service) {
|
|
2705
|
-
component = new TaskSchedulerService({
|
|
2706
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2707
|
-
...instanceConfig.options
|
|
2708
|
-
});
|
|
2709
|
-
instanceType = StringHelper.kebabCase("TaskSchedulerService");
|
|
2710
|
-
}
|
|
2711
|
-
else {
|
|
2712
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2713
|
-
type,
|
|
2714
|
-
componentType: "taskSchedulerComponent"
|
|
2715
|
-
});
|
|
2716
|
-
}
|
|
2717
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2718
|
-
context.componentInstances.push({
|
|
2719
|
-
instanceType: finalInstanceType,
|
|
2720
|
-
component
|
|
2721
|
-
});
|
|
2722
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2723
|
-
return finalInstanceType;
|
|
2724
|
-
}
|
|
2725
|
-
|
|
2726
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2727
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2728
|
-
/**
|
|
2729
|
-
* Telemetry component types.
|
|
2730
|
-
*/
|
|
2731
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2732
|
-
const TelemetryComponentType = {
|
|
2733
|
-
/**
|
|
2734
|
-
* Service.
|
|
2735
|
-
*/
|
|
2736
|
-
Service: "service",
|
|
2737
|
-
/**
|
|
2738
|
-
* REST client.
|
|
2739
|
-
*/
|
|
2740
|
-
RestClient: "rest-client"
|
|
2741
|
-
};
|
|
2742
|
-
|
|
2743
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2744
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2745
|
-
/**
|
|
2746
|
-
* Telemetry connector types.
|
|
2747
|
-
*/
|
|
2748
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2749
|
-
const TelemetryConnectorType = {
|
|
2750
|
-
/**
|
|
2751
|
-
* Entity storage.
|
|
2752
|
-
*/
|
|
2753
|
-
EntityStorage: "entity-storage"
|
|
2754
|
-
};
|
|
2755
|
-
|
|
2756
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2757
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2758
|
-
/**
|
|
2759
|
-
* Initialise a telemetry connector.
|
|
2760
|
-
* @param engineCore The engine core.
|
|
2761
|
-
* @param context The context for the engine.
|
|
2762
|
-
* @param instanceConfig The instance config.
|
|
2763
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2764
|
-
* @returns The name of the instance created.
|
|
2765
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2766
|
-
*/
|
|
2767
|
-
function initialiseTelemetryConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2768
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2769
|
-
element: `Telemetry Connector: ${instanceConfig.type}`
|
|
2770
|
-
}));
|
|
2771
|
-
const type = instanceConfig.type;
|
|
2772
|
-
let connector;
|
|
2773
|
-
let instanceType;
|
|
2774
|
-
if (type === TelemetryConnectorType.EntityStorage) {
|
|
2775
|
-
initSchema$e();
|
|
2776
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
|
|
2777
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
|
|
2778
|
-
connector = new EntityStorageTelemetryConnector({
|
|
2779
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2780
|
-
...instanceConfig.options
|
|
2781
|
-
});
|
|
2782
|
-
instanceType = EntityStorageTelemetryConnector.NAMESPACE;
|
|
2783
|
-
}
|
|
2784
|
-
else {
|
|
2785
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2786
|
-
type,
|
|
2787
|
-
connectorType: "telemetryConnector"
|
|
2788
|
-
});
|
|
2789
|
-
}
|
|
2790
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2791
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2792
|
-
TelemetryConnectorFactory.register(finalInstanceType, () => connector);
|
|
2793
|
-
return finalInstanceType;
|
|
2794
|
-
}
|
|
2795
|
-
/**
|
|
2796
|
-
* Initialise the telemetry component.
|
|
2797
|
-
* @param engineCore The engine core.
|
|
2798
|
-
* @param context The context for the engine.
|
|
2799
|
-
* @param instanceConfig The instance config.
|
|
2800
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2801
|
-
* @returns The name of the instance created.
|
|
2802
|
-
* @throws GeneralError if the component type is unknown.
|
|
2803
|
-
*/
|
|
2804
|
-
function initialiseTelemetryComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2805
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2806
|
-
element: `Telemetry Component: ${instanceConfig.type}`
|
|
2807
|
-
}));
|
|
2808
|
-
const type = instanceConfig.type;
|
|
2809
|
-
let component;
|
|
2810
|
-
let instanceType;
|
|
2811
|
-
if (type === TelemetryComponentType.Service) {
|
|
2812
|
-
component = new TelemetryService({
|
|
2813
|
-
telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
|
|
2814
|
-
...instanceConfig.options
|
|
2815
|
-
});
|
|
2816
|
-
instanceType = StringHelper.kebabCase("TelemetryService");
|
|
2817
|
-
}
|
|
2818
|
-
else if (type === TelemetryComponentType.RestClient) {
|
|
2819
|
-
component = new TelemetryClient(instanceConfig.options);
|
|
2820
|
-
instanceType = StringHelper.kebabCase("TelemetryClient");
|
|
2821
|
-
}
|
|
2822
|
-
else {
|
|
2823
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2824
|
-
type,
|
|
2825
|
-
componentType: "telemetryComponent"
|
|
2826
|
-
});
|
|
2827
|
-
}
|
|
2828
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2829
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
2830
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2831
|
-
return finalInstanceType;
|
|
2832
|
-
}
|
|
2833
|
-
|
|
2834
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2835
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2836
|
-
/**
|
|
2837
|
-
* Vault connector types.
|
|
2838
|
-
*/
|
|
2839
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2840
|
-
const VaultConnectorType = {
|
|
2841
|
-
/**
|
|
2842
|
-
* Entity storage.
|
|
2843
|
-
*/
|
|
2844
|
-
EntityStorage: "entity-storage",
|
|
2845
|
-
/**
|
|
2846
|
-
* Hashicorp.
|
|
2847
|
-
*/
|
|
2848
|
-
Hashicorp: "hashicorp"
|
|
2849
|
-
};
|
|
2850
|
-
|
|
2851
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2852
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2853
|
-
/**
|
|
2854
|
-
* Initialise the vault connector.
|
|
2855
|
-
* @param engineCore The engine core.
|
|
2856
|
-
* @param context The context for the engine.
|
|
2857
|
-
* @param instanceConfig The instance config.
|
|
2858
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2859
|
-
* @returns The name of the instance created.
|
|
2860
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2861
|
-
*/
|
|
2862
|
-
function initialiseVaultConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2863
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2864
|
-
element: `Vault Connector: ${instanceConfig.type}`
|
|
2865
|
-
}));
|
|
2866
|
-
const type = instanceConfig.type;
|
|
2867
|
-
let connector;
|
|
2868
|
-
let instanceType;
|
|
2869
|
-
if (type === VaultConnectorType.EntityStorage) {
|
|
2870
|
-
initSchema$f();
|
|
2871
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
|
|
2872
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
|
|
2873
|
-
connector = new EntityStorageVaultConnector(instanceConfig.options);
|
|
2874
|
-
instanceType = EntityStorageVaultConnector.NAMESPACE;
|
|
2875
|
-
}
|
|
2876
|
-
else if (type === VaultConnectorType.Hashicorp) {
|
|
2877
|
-
connector = new HashicorpVaultConnector(instanceConfig.options);
|
|
2878
|
-
instanceType = HashicorpVaultConnector.NAMESPACE;
|
|
2879
|
-
}
|
|
2880
|
-
else {
|
|
2881
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2882
|
-
type,
|
|
2883
|
-
connectorType: "vaultConnector"
|
|
2884
|
-
});
|
|
2885
|
-
}
|
|
2886
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2887
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2888
|
-
VaultConnectorFactory.register(finalInstanceType, () => connector);
|
|
2889
|
-
return finalInstanceType;
|
|
2890
|
-
}
|
|
2891
|
-
|
|
2892
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2893
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2894
|
-
/**
|
|
2895
|
-
* Verifiable storage component types.
|
|
2896
|
-
*/
|
|
2897
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2898
|
-
const VerifiableStorageComponentType = {
|
|
2899
|
-
/**
|
|
2900
|
-
* Service.
|
|
2901
|
-
*/
|
|
2902
|
-
Service: "service",
|
|
2903
|
-
/**
|
|
2904
|
-
* REST client.
|
|
2905
|
-
*/
|
|
2906
|
-
RestClient: "rest-client"
|
|
2907
|
-
};
|
|
2908
|
-
|
|
2909
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2910
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2911
|
-
/**
|
|
2912
|
-
* Verifiable storage connector types.
|
|
2913
|
-
*/
|
|
2914
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2915
|
-
const VerifiableStorageConnectorType = {
|
|
2916
|
-
/**
|
|
2917
|
-
* Entity storage.
|
|
2918
|
-
*/
|
|
2919
|
-
EntityStorage: "entity-storage",
|
|
2920
|
-
/**
|
|
2921
|
-
* IOTA.
|
|
2922
|
-
*/
|
|
2923
|
-
Iota: "iota"
|
|
2924
|
-
};
|
|
2925
|
-
|
|
2926
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2927
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2928
|
-
/**
|
|
2929
|
-
* Initialise the verifiable storage connector.
|
|
2930
|
-
* @param engineCore The engine core.
|
|
2931
|
-
* @param context The context for the engine.
|
|
2932
|
-
* @param instanceConfig The instance config.
|
|
2933
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2934
|
-
* @returns The name of the instance created.
|
|
2935
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2936
|
-
*/
|
|
2937
|
-
function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2938
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2939
|
-
element: `Verifiable Storage Connector: ${instanceConfig.type}`
|
|
2940
|
-
}));
|
|
2941
|
-
const type = instanceConfig.type;
|
|
2942
|
-
let connector;
|
|
2943
|
-
let instanceType;
|
|
2944
|
-
if (type === VerifiableStorageConnectorType.Iota) {
|
|
2945
|
-
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
2946
|
-
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2947
|
-
connector = new IotaVerifiableStorageConnector({
|
|
2948
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2949
|
-
...instanceConfig.options,
|
|
2950
|
-
config: {
|
|
2951
|
-
...dltConfig?.options?.config,
|
|
2952
|
-
...instanceConfig.options.config
|
|
2953
|
-
}
|
|
2954
|
-
});
|
|
2955
|
-
instanceType = IotaVerifiableStorageConnector.NAMESPACE;
|
|
2956
|
-
}
|
|
2957
|
-
else if (type === VerifiableStorageConnectorType.EntityStorage) {
|
|
2958
|
-
initSchema$g();
|
|
2959
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
|
|
2960
|
-
connector = new EntityStorageVerifiableStorageConnector(instanceConfig.options);
|
|
2961
|
-
instanceType = EntityStorageVerifiableStorageConnector.NAMESPACE;
|
|
2962
|
-
}
|
|
2963
|
-
else {
|
|
2964
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2965
|
-
type,
|
|
2966
|
-
connectorType: "verifiableStorageConnector"
|
|
2967
|
-
});
|
|
2968
|
-
}
|
|
2969
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2970
|
-
context.componentInstances.push({
|
|
2971
|
-
instanceType: finalInstanceType,
|
|
2972
|
-
component: connector
|
|
2973
|
-
});
|
|
2974
|
-
VerifiableStorageConnectorFactory.register(finalInstanceType, () => connector);
|
|
2975
|
-
return finalInstanceType;
|
|
2976
|
-
}
|
|
2977
|
-
/**
|
|
2978
|
-
* Initialise the verifiable storage component.
|
|
2979
|
-
* @param engineCore The engine core.
|
|
2980
|
-
* @param context The context for the engine.
|
|
2981
|
-
* @param instanceConfig The instance config.
|
|
2982
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2983
|
-
* @returns The name of the instance created.
|
|
2984
|
-
* @throws GeneralError if the component type is unknown.
|
|
2985
|
-
*/
|
|
2986
|
-
function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2987
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2988
|
-
element: `Verifiable Storage Component: ${instanceConfig.type}`
|
|
2989
|
-
}));
|
|
2990
|
-
const type = instanceConfig.type;
|
|
2991
|
-
let component;
|
|
2992
|
-
let instanceType;
|
|
2993
|
-
if (type === VerifiableStorageComponentType.Service) {
|
|
2994
|
-
component = new VerifiableStorageService({
|
|
2995
|
-
...instanceConfig.options
|
|
2996
|
-
});
|
|
2997
|
-
instanceType = StringHelper.kebabCase("VerifiableStorageService");
|
|
2998
|
-
}
|
|
2999
|
-
else if (type === VerifiableStorageComponentType.RestClient) {
|
|
3000
|
-
component = new VerifiableStorageClient(instanceConfig.options);
|
|
3001
|
-
instanceType = StringHelper.kebabCase("VerifiableStorageClient");
|
|
3002
|
-
}
|
|
3003
|
-
else {
|
|
3004
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
3005
|
-
type,
|
|
3006
|
-
componentType: "verifiableStorageComponent"
|
|
3007
|
-
});
|
|
3008
|
-
}
|
|
3009
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
3010
|
-
context.componentInstances.push({
|
|
3011
|
-
instanceType: finalInstanceType,
|
|
3012
|
-
component
|
|
3013
|
-
});
|
|
3014
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
3015
|
-
return finalInstanceType;
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
|
-
// Copyright 2024 IOTA Stiftung.
|
|
3019
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3020
|
-
/**
|
|
3021
|
-
* Wallet connector types.
|
|
3022
|
-
*/
|
|
3023
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3024
|
-
const WalletConnectorType = {
|
|
3025
|
-
/**
|
|
3026
|
-
* Entity storage.
|
|
3027
|
-
*/
|
|
3028
|
-
EntityStorage: "entity-storage",
|
|
3029
|
-
/**
|
|
3030
|
-
* IOTA.
|
|
3031
|
-
*/
|
|
3032
|
-
Iota: "iota"
|
|
3033
|
-
};
|
|
3034
|
-
|
|
3035
|
-
// Copyright 2024 IOTA Stiftung.
|
|
3036
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3037
|
-
/**
|
|
3038
|
-
* Initialise a wallet connector.
|
|
3039
|
-
* @param engineCore The engine core.
|
|
3040
|
-
* @param context The context for the node.
|
|
3041
|
-
* @param instanceConfig The instance config.
|
|
3042
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
3043
|
-
* @returns The name of the instance created.
|
|
3044
|
-
* @throws GeneralError if the connector type is unknown.
|
|
3045
|
-
*/
|
|
3046
|
-
function initialiseWalletConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
3047
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
3048
|
-
element: `Wallet Connector: ${instanceConfig.type}`
|
|
3049
|
-
}));
|
|
3050
|
-
const type = instanceConfig.type;
|
|
3051
|
-
let connector;
|
|
3052
|
-
let instanceType;
|
|
3053
|
-
if (type === WalletConnectorType.Iota) {
|
|
3054
|
-
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
3055
|
-
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
3056
|
-
connector = new IotaWalletConnector({
|
|
3057
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3058
|
-
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
3059
|
-
...instanceConfig.options,
|
|
3060
|
-
config: {
|
|
3061
|
-
...dltConfig?.options?.config,
|
|
3062
|
-
...instanceConfig.options.config
|
|
3063
|
-
}
|
|
3064
|
-
});
|
|
3065
|
-
instanceType = IotaWalletConnector.NAMESPACE;
|
|
3066
|
-
}
|
|
3067
|
-
else if (type === WalletConnectorType.EntityStorage) {
|
|
3068
|
-
connector = new EntityStorageWalletConnector({
|
|
3069
|
-
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3070
|
-
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
3071
|
-
...instanceConfig.options
|
|
3072
|
-
});
|
|
3073
|
-
instanceType = EntityStorageWalletConnector.NAMESPACE;
|
|
3074
|
-
}
|
|
3075
|
-
else {
|
|
3076
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
3077
|
-
type,
|
|
3078
|
-
connectorType: "walletConnector"
|
|
3079
|
-
});
|
|
3080
|
-
}
|
|
3081
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
3082
|
-
context.componentInstances.push({
|
|
3083
|
-
instanceType: finalInstanceType,
|
|
3084
|
-
component: connector
|
|
3085
|
-
});
|
|
3086
|
-
WalletConnectorFactory.register(finalInstanceType, () => connector);
|
|
3087
|
-
return finalInstanceType;
|
|
3088
|
-
}
|
|
3089
|
-
/**
|
|
3090
|
-
* Initialise the wallet storage.
|
|
3091
|
-
* @param engineCore The engine core.
|
|
3092
|
-
* @param context The context for the engine.
|
|
3093
|
-
* @param instanceConfig The instance config.
|
|
3094
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
3095
|
-
* @returns Nothing.
|
|
3096
|
-
* @throws GeneralError if the connector type is unknown.
|
|
3097
|
-
*/
|
|
3098
|
-
function initialiseWalletStorage(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
3099
|
-
const type = instanceConfig.type;
|
|
3100
|
-
if (type === WalletConnectorType.Iota) ;
|
|
3101
|
-
else if (type === WalletConnectorType.EntityStorage) {
|
|
3102
|
-
initSchema$h();
|
|
3103
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
3104
|
-
}
|
|
3105
|
-
else {
|
|
3106
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
3107
|
-
type,
|
|
3108
|
-
connectorType: "walletConnector"
|
|
3109
|
-
});
|
|
3110
|
-
}
|
|
3111
|
-
return undefined;
|
|
3112
|
-
}
|
|
3113
|
-
|
|
3114
|
-
// Copyright 2024 IOTA Stiftung.
|
|
3115
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3116
|
-
/**
|
|
3117
|
-
* DLT config types.
|
|
3118
|
-
*/
|
|
3119
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3120
|
-
const DltConfigType = {
|
|
3121
|
-
/**
|
|
3122
|
-
* IOTA.
|
|
3123
|
-
*/
|
|
3124
|
-
Iota: "iota"
|
|
3125
|
-
};
|
|
3126
|
-
|
|
3127
|
-
export { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, BackgroundTaskConnectorType, BlobStorageComponentType, BlobStorageConnectorType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DltConfigType, DocumentManagementComponentType, EntityStorageComponentType, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, NftComponentType, NftConnectorType, RightsManagementComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPxpComponentType, SynchronisedStorageComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, VaultConnectorType, VerifiableStorageComponentType, VerifiableStorageConnectorType, WalletConnectorType, initialiseAttestationComponent, initialiseAttestationConnector, initialiseAuditableItemGraphComponent, initialiseAuditableItemStreamComponent, initialiseBackgroundTaskConnector, initialiseBlobStorageComponent, initialiseBlobStorageConnector, initialiseDataConverterConnector, initialiseDataExtractorConnector, initialiseDataProcessingComponent, initialiseDocumentManagementComponent, initialiseEntityStorageComponent, initialiseEntityStorageConnector, initialiseEventBusComponent, initialiseEventBusConnector, initialiseFaucetConnector, initialiseFederatedCatalogueComponent, initialiseIdentityComponent, initialiseIdentityConnector, initialiseIdentityProfileComponent, initialiseIdentityProfileConnector, initialiseIdentityResolverComponent, initialiseIdentityResolverConnector, initialiseImmutableProofComponent, initialiseLoggingComponent, initialiseLoggingConnector, initialiseMessagingComponent, initialiseMessagingEmailConnector, initialiseMessagingPushNotificationConnector, initialiseMessagingSmsConnector, initialiseNftComponent, initialiseNftConnector, initialiseRightsManagementComponent, initialiseRightsManagementPapComponent, initialiseRightsManagementPdpComponent, initialiseRightsManagementPepComponent, initialiseRightsManagementPipComponent, initialiseRightsManagementPmpComponent, initialiseRightsManagementPxpComponent, initialiseSynchronisedStorageComponent, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector, initialiseWalletStorage };
|