@twin.org/engine-types 0.0.2-next.2 → 0.0.2-next.20
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/cjs/index.cjs +1310 -1098
- package/dist/esm/index.mjs +1312 -1124
- package/dist/types/components/attestation.d.ts +14 -8
- package/dist/types/components/auditableItemGraph.d.ts +7 -4
- package/dist/types/components/auditableItemStream.d.ts +7 -4
- package/dist/types/components/authenticationGenerator.d.ts +17 -0
- package/dist/types/components/backgroundTask.d.ts +8 -4
- package/dist/types/components/blobStorage.d.ts +14 -8
- package/dist/types/components/dataProcessing.d.ts +20 -12
- package/dist/types/components/dataSpaceConnector.d.ts +16 -0
- package/dist/types/components/documentManagement.d.ts +7 -4
- package/dist/types/components/entityStorage.d.ts +10 -6
- package/dist/types/components/eventBus.d.ts +14 -8
- package/dist/types/components/faucet.d.ts +8 -4
- package/dist/types/components/federatedCatalogue.d.ts +7 -4
- package/dist/types/components/identity.d.ts +14 -8
- package/dist/types/components/identityProfile.d.ts +14 -8
- package/dist/types/components/identityResolver.d.ts +14 -8
- package/dist/types/components/immutableProof.d.ts +7 -4
- package/dist/types/components/logging.d.ts +14 -8
- package/dist/types/components/messaging.d.ts +39 -16
- package/dist/types/components/nft.d.ts +14 -8
- 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 +7 -4
- package/dist/types/components/rightsManagementPdp.d.ts +16 -0
- package/dist/types/components/rightsManagementPep.d.ts +16 -0
- package/dist/types/components/rightsManagementPip.d.ts +16 -0
- package/dist/types/components/rightsManagementPmp.d.ts +16 -0
- 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 +16 -0
- package/dist/types/components/synchronisedStorage.d.ts +16 -0
- package/dist/types/components/taskScheduler.d.ts +7 -4
- package/dist/types/components/telemetry.d.ts +14 -8
- package/dist/types/components/vault.d.ts +8 -4
- package/dist/types/components/verifiableStorage.d.ts +14 -8
- package/dist/types/components/wallet.d.ts +8 -14
- package/dist/types/index.d.ts +39 -3
- package/dist/types/models/IEngineConfig.d.ts +67 -7
- package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +17 -0
- package/dist/types/models/config/entityStorageConnectorConfig.d.ts +4 -0
- package/dist/types/models/config/messagingAdminComponentConfig.d.ts +9 -0
- 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 +6 -2
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPmpComponentConfig.d.ts +9 -0
- 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 +12 -0
- package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +13 -0
- 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/entityStorageConnectorType.d.ts +4 -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/rightsManagementPdpComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPepComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPipComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPmpComponentType.d.ts +13 -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/rightsManagementPxpComponentType.d.ts +13 -0
- package/dist/types/models/types/synchronisedStorageComponentType.d.ts +17 -0
- package/dist/types/utils/engineTypeHelper.d.ts +19 -0
- package/docs/changelog.md +261 -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 +5 -3
- 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 +31 -0
- package/docs/reference/functions/initialiseRightsManagementPepComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPipComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +31 -0
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +31 -0
- 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/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 +56 -5
- package/docs/reference/interfaces/IEngineConfig.md +81 -9
- 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/EntityStorageConnectorConfig.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 +23 -0
- package/docs/reference/type-aliases/RightsManagementPdpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +23 -0
- package/docs/reference/type-aliases/RightsManagementPepComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +23 -0
- package/docs/reference/type-aliases/RightsManagementPipComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPmpComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPmpComponentType.md +5 -0
- 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 +23 -0
- package/docs/reference/type-aliases/RightsManagementPxpComponentType.md +5 -0
- package/docs/reference/type-aliases/SynchronisedStorageComponentConfig.md +5 -0
- package/docs/reference/type-aliases/SynchronisedStorageComponentType.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 +7 -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/RightsManagementDapComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementDarpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPapComponentType.md +7 -1
- package/docs/reference/variables/RightsManagementPdpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPepComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPipComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPmpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPnapComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPnpComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPxpComponentType.md +13 -0
- package/docs/reference/variables/{RightsManagementComponentType.md → SynchronisedStorageComponentType.md} +4 -4
- 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/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/package.json +28 -2
- 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
CHANGED
|
@@ -2,7 +2,7 @@ import { NftAttestationConnector } from '@twin.org/attestation-connector-nft';
|
|
|
2
2
|
import { AttestationConnectorFactory } from '@twin.org/attestation-models';
|
|
3
3
|
import { AttestationClient } from '@twin.org/attestation-rest-client';
|
|
4
4
|
import { AttestationService } from '@twin.org/attestation-service';
|
|
5
|
-
import {
|
|
5
|
+
import { ComponentFactory, StringHelper, Is, GeneralError, I18n } from '@twin.org/core';
|
|
6
6
|
import { AuditableItemGraphClient } from '@twin.org/auditable-item-graph-rest-client';
|
|
7
7
|
import { initSchema, AuditableItemGraphService } from '@twin.org/auditable-item-graph-service';
|
|
8
8
|
import path from 'node:path';
|
|
@@ -15,11 +15,14 @@ import { MongoDbEntityStorageConnector } from '@twin.org/entity-storage-connecto
|
|
|
15
15
|
import { MySqlEntityStorageConnector } from '@twin.org/entity-storage-connector-mysql';
|
|
16
16
|
import { PostgreSqlEntityStorageConnector } from '@twin.org/entity-storage-connector-postgresql';
|
|
17
17
|
import { ScyllaDBTableConnector } from '@twin.org/entity-storage-connector-scylladb';
|
|
18
|
+
import { SynchronisedEntityStorageConnector } from '@twin.org/entity-storage-connector-synchronised';
|
|
18
19
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
19
20
|
import { EntityStorageClient } from '@twin.org/entity-storage-rest-client';
|
|
20
21
|
import { EntityStorageService } from '@twin.org/entity-storage-service';
|
|
21
22
|
import { AuditableItemStreamClient } from '@twin.org/auditable-item-stream-rest-client';
|
|
22
23
|
import { initSchema as initSchema$1, AuditableItemStreamService } from '@twin.org/auditable-item-stream-service';
|
|
24
|
+
import { AuthenticationGeneratorFactory } from '@twin.org/api-models';
|
|
25
|
+
import { VerifiableCredentialAuthenticationGenerator } from '@twin.org/identity-authentication';
|
|
23
26
|
import { initSchema as initSchema$2, EntityStorageBackgroundTaskConnector } from '@twin.org/background-task-connector-entity-storage';
|
|
24
27
|
import { BackgroundTaskConnectorFactory } from '@twin.org/background-task-models';
|
|
25
28
|
import { S3BlobStorageConnector } from '@twin.org/blob-storage-connector-aws-s3';
|
|
@@ -36,51 +39,63 @@ import { JsonPathExtractorConnector } from '@twin.org/data-processing-extractors
|
|
|
36
39
|
import { DataConverterConnectorFactory, DataExtractorConnectorFactory } from '@twin.org/data-processing-models';
|
|
37
40
|
import { DataProcessingClient } from '@twin.org/data-processing-rest-client';
|
|
38
41
|
import { initSchema as initSchema$4, DataProcessingService } from '@twin.org/data-processing-service';
|
|
42
|
+
import { DataSpaceConnectorClient } from '@twin.org/data-space-connector-rest-client';
|
|
43
|
+
import { initSchema as initSchema$5, DataSpaceConnectorService } from '@twin.org/data-space-connector-service';
|
|
44
|
+
import { DataSpaceConnectorSocketClient } from '@twin.org/data-space-connector-socket-client';
|
|
39
45
|
import { DocumentManagementClient } from '@twin.org/document-management-rest-client';
|
|
40
46
|
import { DocumentManagementService } from '@twin.org/document-management-service';
|
|
41
47
|
import { LocalEventBusConnector } from '@twin.org/event-bus-connector-local';
|
|
42
48
|
import { EventBusConnectorFactory } from '@twin.org/event-bus-models';
|
|
43
49
|
import { EventBusService } from '@twin.org/event-bus-service';
|
|
44
50
|
import { EventBusSocketClient } from '@twin.org/event-bus-socket-client';
|
|
45
|
-
import {
|
|
51
|
+
import { initSchema as initSchema$6, EntityStorageFaucetConnector, EntityStorageWalletConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
46
52
|
import { IotaFaucetConnector, IotaWalletConnector } from '@twin.org/wallet-connector-iota';
|
|
47
53
|
import { FaucetConnectorFactory, WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
48
54
|
import { FederatedCatalogueClient } from '@twin.org/federated-catalogue-rest-client';
|
|
49
|
-
import { initSchema as initSchema$
|
|
50
|
-
import { initSchema as initSchema$
|
|
55
|
+
import { initSchema as initSchema$7, FederatedCatalogueService } from '@twin.org/federated-catalogue-service';
|
|
56
|
+
import { initSchema as initSchema$8, EntityStorageIdentityConnector, EntityStorageIdentityProfileConnector, EntityStorageIdentityResolverConnector } from '@twin.org/identity-connector-entity-storage';
|
|
51
57
|
import { IotaIdentityConnector, IotaIdentityResolverConnector } from '@twin.org/identity-connector-iota';
|
|
52
58
|
import { IdentityConnectorFactory, IdentityProfileConnectorFactory, IdentityResolverConnectorFactory } from '@twin.org/identity-models';
|
|
53
59
|
import { IdentityClient, IdentityProfileClient, IdentityResolverClient } from '@twin.org/identity-rest-client';
|
|
54
60
|
import { IdentityService, IdentityProfileService, IdentityResolverService } from '@twin.org/identity-service';
|
|
55
61
|
import { UniversalResolverConnector } from '@twin.org/identity-connector-universal';
|
|
56
62
|
import { ImmutableProofClient } from '@twin.org/immutable-proof-rest-client';
|
|
57
|
-
import { initSchema as initSchema$
|
|
63
|
+
import { initSchema as initSchema$9, ImmutableProofService } from '@twin.org/immutable-proof-service';
|
|
58
64
|
import { ConsoleLoggingConnector } from '@twin.org/logging-connector-console';
|
|
59
|
-
import { initSchema as initSchema$
|
|
65
|
+
import { initSchema as initSchema$a, EntityStorageLoggingConnector } from '@twin.org/logging-connector-entity-storage';
|
|
60
66
|
import { MultiLoggingConnector, LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
61
67
|
import { LoggingClient } from '@twin.org/logging-rest-client';
|
|
62
68
|
import { LoggingService } from '@twin.org/logging-service';
|
|
63
69
|
import { AwsMessagingEmailConnector, AwsMessagingSmsConnector, AwsMessagingPushNotificationConnector } from '@twin.org/messaging-connector-aws';
|
|
64
|
-
import { initSchema as initSchema$
|
|
70
|
+
import { initSchema as initSchema$b, EntityStorageMessagingEmailConnector, EntityStorageMessagingSmsConnector, EntityStorageMessagingPushNotificationConnector } from '@twin.org/messaging-connector-entity-storage';
|
|
65
71
|
import { MessagingEmailConnectorFactory, MessagingSmsConnectorFactory, MessagingPushNotificationsConnectorFactory } from '@twin.org/messaging-models';
|
|
66
|
-
import { initSchema as initSchema$
|
|
67
|
-
import { initSchema as initSchema$
|
|
72
|
+
import { MessagingService, initSchema as initSchema$c, MessagingAdminService } from '@twin.org/messaging-service';
|
|
73
|
+
import { initSchema as initSchema$d, EntityStorageNftConnector } from '@twin.org/nft-connector-entity-storage';
|
|
68
74
|
import { IotaNftConnector } from '@twin.org/nft-connector-iota';
|
|
69
75
|
import { NftConnectorFactory } from '@twin.org/nft-models';
|
|
70
76
|
import { NftClient } from '@twin.org/nft-rest-client';
|
|
71
77
|
import { NftService } from '@twin.org/nft-service';
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import { initSchema as initSchema$
|
|
78
|
+
import { DataAccessPointService, DataAccessRequestPointService } from '@twin.org/rights-management-dap-service';
|
|
79
|
+
import { DataAccessPointClient, PolicyAdministrationPointClient, PolicyNegotiationAdminPointClient, PolicyNegotiationPointClient } from '@twin.org/rights-management-rest-client';
|
|
80
|
+
import { initSchema as initSchema$e, PolicyAdministrationPointService } from '@twin.org/rights-management-pap-service';
|
|
81
|
+
import { EngineModuleHelper } from '@twin.org/engine-core';
|
|
82
|
+
import { PolicyDecisionPointService } from '@twin.org/rights-management-pdp-service';
|
|
83
|
+
import { PolicyEnforcementPointService } from '@twin.org/rights-management-pep-service';
|
|
84
|
+
import { PolicyInformationPointService } from '@twin.org/rights-management-pip-service';
|
|
85
|
+
import { PolicyManagementPointService } from '@twin.org/rights-management-pmp-service';
|
|
86
|
+
import { initSchema as initSchema$f, PolicyNegotiationAdminPointService, PolicyNegotiationPointService } from '@twin.org/rights-management-pnp-service';
|
|
87
|
+
import { PolicyExecutionPointService } from '@twin.org/rights-management-pxp-service';
|
|
88
|
+
import { SynchronisedStorageClient } from '@twin.org/synchronised-storage-rest-client';
|
|
89
|
+
import { initSchema as initSchema$g, SynchronisedStorageService } from '@twin.org/synchronised-storage-service';
|
|
75
90
|
import { TaskSchedulerService } from '@twin.org/background-task-scheduler';
|
|
76
|
-
import { initSchema as initSchema$
|
|
91
|
+
import { initSchema as initSchema$h, EntityStorageTelemetryConnector } from '@twin.org/telemetry-connector-entity-storage';
|
|
77
92
|
import { TelemetryConnectorFactory } from '@twin.org/telemetry-models';
|
|
78
93
|
import { TelemetryClient } from '@twin.org/telemetry-rest-client';
|
|
79
94
|
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
80
|
-
import { initSchema as initSchema$
|
|
95
|
+
import { initSchema as initSchema$i, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
81
96
|
import { HashicorpVaultConnector } from '@twin.org/vault-connector-hashicorp';
|
|
82
97
|
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
83
|
-
import { initSchema as initSchema$
|
|
98
|
+
import { initSchema as initSchema$j, EntityStorageVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-entity-storage';
|
|
84
99
|
import { IotaVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-iota';
|
|
85
100
|
import { VerifiableStorageConnectorFactory } from '@twin.org/verifiable-storage-models';
|
|
86
101
|
import { VerifiableStorageClient } from '@twin.org/verifiable-storage-rest-client';
|
|
@@ -123,78 +138,50 @@ const AttestationConnectorType = {
|
|
|
123
138
|
* @param engineCore The engine core.
|
|
124
139
|
* @param context The context for the engine.
|
|
125
140
|
* @param instanceConfig The instance config.
|
|
126
|
-
* @
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
function initialiseAttestationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
131
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
132
|
-
element: `Attestation Connector: ${instanceConfig.type}`
|
|
133
|
-
}));
|
|
134
|
-
const type = instanceConfig.type;
|
|
135
|
-
let connector;
|
|
141
|
+
* @returns The instance created and the factory for it.
|
|
142
|
+
*/
|
|
143
|
+
async function initialiseAttestationConnector(engineCore, context, instanceConfig) {
|
|
144
|
+
let component;
|
|
136
145
|
let instanceType;
|
|
137
|
-
if (type === AttestationConnectorType.Nft) {
|
|
138
|
-
|
|
139
|
-
identityConnectorType:
|
|
140
|
-
nftConnectorType:
|
|
146
|
+
if (instanceConfig.type === AttestationConnectorType.Nft) {
|
|
147
|
+
component = new NftAttestationConnector({
|
|
148
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
149
|
+
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
141
150
|
...instanceConfig.options
|
|
142
151
|
});
|
|
143
152
|
instanceType = NftAttestationConnector.NAMESPACE;
|
|
144
153
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
152
|
-
context.componentInstances.push({
|
|
153
|
-
instanceType: finalInstanceType,
|
|
154
|
-
component: connector
|
|
155
|
-
});
|
|
156
|
-
AttestationConnectorFactory.register(finalInstanceType, () => connector);
|
|
157
|
-
return finalInstanceType;
|
|
154
|
+
return {
|
|
155
|
+
component,
|
|
156
|
+
instanceType,
|
|
157
|
+
factory: AttestationConnectorFactory
|
|
158
|
+
};
|
|
158
159
|
}
|
|
159
160
|
/**
|
|
160
161
|
* Initialise the attestation component.
|
|
161
162
|
* @param engineCore The engine core.
|
|
162
163
|
* @param context The context for the engine.
|
|
163
164
|
* @param instanceConfig The instance config.
|
|
164
|
-
* @
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
*/
|
|
168
|
-
function initialiseAttestationComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
169
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
170
|
-
element: `Attestation Component: ${instanceConfig.type}`
|
|
171
|
-
}));
|
|
172
|
-
const type = instanceConfig.type;
|
|
165
|
+
* @returns The instance created and the factory for it.
|
|
166
|
+
*/
|
|
167
|
+
async function initialiseAttestationComponent(engineCore, context, instanceConfig) {
|
|
173
168
|
let component;
|
|
174
169
|
let instanceType;
|
|
175
|
-
if (type === AttestationComponentType.Service) {
|
|
170
|
+
if (instanceConfig.type === AttestationComponentType.Service) {
|
|
176
171
|
component = new AttestationService({
|
|
177
172
|
...instanceConfig.options
|
|
178
173
|
});
|
|
179
|
-
instanceType =
|
|
174
|
+
instanceType = "attestation-service";
|
|
180
175
|
}
|
|
181
|
-
else if (type === AttestationComponentType.RestClient) {
|
|
176
|
+
else if (instanceConfig.type === AttestationComponentType.RestClient) {
|
|
182
177
|
component = new AttestationClient(instanceConfig.options);
|
|
183
|
-
instanceType =
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
187
|
-
type,
|
|
188
|
-
componentType: "attestationComponent"
|
|
189
|
-
});
|
|
178
|
+
instanceType = "attestation-client";
|
|
190
179
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
instanceType
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
197
|
-
return finalInstanceType;
|
|
180
|
+
return {
|
|
181
|
+
component,
|
|
182
|
+
instanceType,
|
|
183
|
+
factory: ComponentFactory
|
|
184
|
+
};
|
|
198
185
|
}
|
|
199
186
|
|
|
200
187
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -256,7 +243,11 @@ const EntityStorageConnectorType = {
|
|
|
256
243
|
/**
|
|
257
244
|
* Postgre SQL.
|
|
258
245
|
*/
|
|
259
|
-
PostgreSql: "postgresql"
|
|
246
|
+
PostgreSql: "postgresql",
|
|
247
|
+
/**
|
|
248
|
+
* Synchronised.
|
|
249
|
+
*/
|
|
250
|
+
Synchronised: "synchronised"
|
|
260
251
|
};
|
|
261
252
|
|
|
262
253
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -267,7 +258,8 @@ const EntityStorageConnectorType = {
|
|
|
267
258
|
* @param context The context for the engine.
|
|
268
259
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
269
260
|
* @param schema The schema for the entity storage.
|
|
270
|
-
* @
|
|
261
|
+
* @returns The name of the instance type that was created.
|
|
262
|
+
* @throws GeneralError when the configuration is invalid.
|
|
271
263
|
*/
|
|
272
264
|
function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
|
|
273
265
|
const instanceName = StringHelper.kebabCase(schema);
|
|
@@ -387,6 +379,23 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
387
379
|
}
|
|
388
380
|
});
|
|
389
381
|
}
|
|
382
|
+
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
383
|
+
// Create the entity storage that is wrapped by the synchronised connector
|
|
384
|
+
// by removing the custom type it will default to the standard storage
|
|
385
|
+
// mechanism for entity storage
|
|
386
|
+
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
|
|
387
|
+
// Use the wrapped instance name as the entity storage connector type
|
|
388
|
+
// for the synchronised connector
|
|
389
|
+
entityStorageConnector = new SynchronisedEntityStorageConnector({
|
|
390
|
+
entitySchema: schema,
|
|
391
|
+
...entityStorageConfig.options,
|
|
392
|
+
entityStorageConnectorType: wrappedInstanceName,
|
|
393
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
394
|
+
config: {
|
|
395
|
+
...entityStorageConfig.options.config
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
390
399
|
else {
|
|
391
400
|
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
392
401
|
type,
|
|
@@ -399,24 +408,19 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
399
408
|
});
|
|
400
409
|
EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
401
410
|
}
|
|
411
|
+
return instanceName;
|
|
402
412
|
}
|
|
403
413
|
/**
|
|
404
414
|
* Initialise the entity storage connector.
|
|
405
415
|
* @param engineCore The engine core.
|
|
406
416
|
* @param context The context for the engine.
|
|
407
417
|
* @param instanceConfig The instance config.
|
|
408
|
-
* @
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
*/
|
|
412
|
-
function initialiseEntityStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
413
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
414
|
-
element: `Entity Storage Component: ${instanceConfig.type}`
|
|
415
|
-
}));
|
|
416
|
-
const type = instanceConfig.type;
|
|
418
|
+
* @returns The instance created and the factory for it.
|
|
419
|
+
*/
|
|
420
|
+
async function initialiseEntityStorageComponent(engineCore, context, instanceConfig) {
|
|
417
421
|
let component;
|
|
418
422
|
let instanceType;
|
|
419
|
-
if (type === EntityStorageComponentType.Service) {
|
|
423
|
+
if (instanceConfig.type === EntityStorageComponentType.Service) {
|
|
420
424
|
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
421
425
|
// See if there is a custom entity storage for this type, otherwise just use the default one.
|
|
422
426
|
const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
|
|
@@ -429,27 +433,19 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
429
433
|
});
|
|
430
434
|
instanceType = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
431
435
|
}
|
|
432
|
-
else if (type === EntityStorageComponentType.RestClient) {
|
|
436
|
+
else if (instanceConfig.type === EntityStorageComponentType.RestClient) {
|
|
433
437
|
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
434
438
|
component = new EntityStorageClient({
|
|
435
439
|
pathPrefix: kebabName,
|
|
436
440
|
...instanceConfig.options
|
|
437
441
|
});
|
|
438
|
-
instanceType = `${
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
442
|
-
type,
|
|
443
|
-
serviceType: "entityStorageComponent"
|
|
444
|
-
});
|
|
442
|
+
instanceType = `${"entity-storage-client"}-${kebabName}`;
|
|
445
443
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
instanceType
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
452
|
-
return finalInstanceType;
|
|
444
|
+
return {
|
|
445
|
+
component,
|
|
446
|
+
instanceType,
|
|
447
|
+
factory: ComponentFactory
|
|
448
|
+
};
|
|
453
449
|
}
|
|
454
450
|
|
|
455
451
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -474,45 +470,31 @@ const AuditableItemGraphComponentType = {
|
|
|
474
470
|
* @param engineCore The engine core.
|
|
475
471
|
* @param context The context for the engine.
|
|
476
472
|
* @param instanceConfig The instance config.
|
|
477
|
-
* @
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*/
|
|
481
|
-
function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
482
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
483
|
-
element: `Auditable Item Graph Component: ${instanceConfig.type}`
|
|
484
|
-
}));
|
|
485
|
-
const type = instanceConfig.type;
|
|
473
|
+
* @returns The instance created and the factory for it.
|
|
474
|
+
*/
|
|
475
|
+
async function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig) {
|
|
486
476
|
let component;
|
|
487
477
|
let instanceType;
|
|
488
|
-
if (type === AuditableItemGraphComponentType.Service) {
|
|
478
|
+
if (instanceConfig.type === AuditableItemGraphComponentType.Service) {
|
|
489
479
|
initSchema();
|
|
490
480
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
|
|
491
481
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
|
|
492
482
|
component = new AuditableItemGraphService({
|
|
493
|
-
immutableProofComponentType:
|
|
494
|
-
eventBusComponentType:
|
|
483
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
484
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
495
485
|
...instanceConfig.options
|
|
496
486
|
});
|
|
497
|
-
instanceType =
|
|
487
|
+
instanceType = "auditable-item-graph-service";
|
|
498
488
|
}
|
|
499
|
-
else if (type === AuditableItemGraphComponentType.RestClient) {
|
|
489
|
+
else if (instanceConfig.type === AuditableItemGraphComponentType.RestClient) {
|
|
500
490
|
component = new AuditableItemGraphClient(instanceConfig.options);
|
|
501
|
-
instanceType =
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
505
|
-
type,
|
|
506
|
-
componentType: "auditableItemGraphComponent"
|
|
507
|
-
});
|
|
491
|
+
instanceType = "auditable-item-graph-client";
|
|
508
492
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
instanceType
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
515
|
-
return finalInstanceType;
|
|
493
|
+
return {
|
|
494
|
+
component,
|
|
495
|
+
instanceType,
|
|
496
|
+
factory: ComponentFactory
|
|
497
|
+
};
|
|
516
498
|
}
|
|
517
499
|
|
|
518
500
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -537,45 +519,71 @@ const AuditableItemStreamComponentType = {
|
|
|
537
519
|
* @param engineCore The engine core.
|
|
538
520
|
* @param context The context for the engine.
|
|
539
521
|
* @param instanceConfig The instance config.
|
|
540
|
-
* @
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
*/
|
|
544
|
-
function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
545
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
546
|
-
element: `Auditable Item Stream Component: ${instanceConfig.type}`
|
|
547
|
-
}));
|
|
548
|
-
const type = instanceConfig.type;
|
|
522
|
+
* @returns The instance created and the factory for it.
|
|
523
|
+
*/
|
|
524
|
+
async function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig) {
|
|
549
525
|
let component;
|
|
550
526
|
let instanceType;
|
|
551
|
-
if (type === AuditableItemStreamComponentType.Service) {
|
|
527
|
+
if (instanceConfig.type === AuditableItemStreamComponentType.Service) {
|
|
552
528
|
initSchema$1();
|
|
553
529
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
|
|
554
530
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
|
|
555
531
|
component = new AuditableItemStreamService({
|
|
556
|
-
immutableProofComponentType:
|
|
557
|
-
eventBusComponentType:
|
|
532
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
533
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
558
534
|
...instanceConfig.options
|
|
559
535
|
});
|
|
560
|
-
instanceType =
|
|
536
|
+
instanceType = "auditable-item-stream-service";
|
|
561
537
|
}
|
|
562
|
-
else if (type === AuditableItemStreamComponentType.RestClient) {
|
|
538
|
+
else if (instanceConfig.type === AuditableItemStreamComponentType.RestClient) {
|
|
563
539
|
component = new AuditableItemStreamClient(instanceConfig.options);
|
|
564
|
-
instanceType =
|
|
540
|
+
instanceType = "auditable-item-stream-client";
|
|
565
541
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
542
|
+
return {
|
|
543
|
+
component,
|
|
544
|
+
instanceType,
|
|
545
|
+
factory: ComponentFactory
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Copyright 2024 IOTA Stiftung.
|
|
550
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
551
|
+
/**
|
|
552
|
+
* Authentication generator component types.
|
|
553
|
+
*/
|
|
554
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
555
|
+
const AuthenticationGeneratorComponentType = {
|
|
556
|
+
/**
|
|
557
|
+
* Verifiable Credential.
|
|
558
|
+
*/
|
|
559
|
+
VerifiableCredential: "verifiable-credential"
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
// Copyright 2024 IOTA Stiftung.
|
|
563
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
564
|
+
/**
|
|
565
|
+
* Initialise the authentication generator component.
|
|
566
|
+
* @param engineCore The engine core.
|
|
567
|
+
* @param context The context for the engine.
|
|
568
|
+
* @param instanceConfig The instance config.
|
|
569
|
+
* @returns The instance created and the factory for it.
|
|
570
|
+
*/
|
|
571
|
+
async function initialiseAuthenticationGeneratorComponent(engineCore, context, instanceConfig) {
|
|
572
|
+
let component;
|
|
573
|
+
let instanceType;
|
|
574
|
+
if (instanceConfig.type === AuthenticationGeneratorComponentType.VerifiableCredential) {
|
|
575
|
+
component = new VerifiableCredentialAuthenticationGenerator({
|
|
576
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
577
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
578
|
+
...instanceConfig.options
|
|
570
579
|
});
|
|
580
|
+
instanceType = "verifiable-credential-authentication-generator";
|
|
571
581
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
instanceType
|
|
575
|
-
|
|
576
|
-
}
|
|
577
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
578
|
-
return finalInstanceType;
|
|
582
|
+
return {
|
|
583
|
+
component,
|
|
584
|
+
instanceType,
|
|
585
|
+
factory: AuthenticationGeneratorFactory
|
|
586
|
+
};
|
|
579
587
|
}
|
|
580
588
|
|
|
581
589
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -598,36 +606,25 @@ const BackgroundTaskConnectorType = {
|
|
|
598
606
|
* @param engineCore The engine core.
|
|
599
607
|
* @param context The context for the engine.
|
|
600
608
|
* @param instanceConfig The instance config.
|
|
601
|
-
* @
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
606
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
607
|
-
element: `Background Task Connector: ${instanceConfig.type}`
|
|
608
|
-
}));
|
|
609
|
-
const type = instanceConfig.type;
|
|
610
|
-
let connector;
|
|
609
|
+
* @returns The instance created and the factory for it.
|
|
610
|
+
*/
|
|
611
|
+
async function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig) {
|
|
612
|
+
let component;
|
|
611
613
|
let instanceType;
|
|
612
|
-
if (type === BackgroundTaskConnectorType.EntityStorage) {
|
|
614
|
+
if (instanceConfig.type === BackgroundTaskConnectorType.EntityStorage) {
|
|
613
615
|
initSchema$2();
|
|
614
616
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
|
|
615
|
-
|
|
616
|
-
|
|
617
|
+
component = new EntityStorageBackgroundTaskConnector({
|
|
618
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
617
619
|
...instanceConfig.options
|
|
618
620
|
});
|
|
619
621
|
instanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;
|
|
620
622
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
628
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
629
|
-
BackgroundTaskConnectorFactory.register(finalInstanceType, () => connector);
|
|
630
|
-
return finalInstanceType;
|
|
623
|
+
return {
|
|
624
|
+
component,
|
|
625
|
+
instanceType,
|
|
626
|
+
factory: BackgroundTaskConnectorFactory
|
|
627
|
+
};
|
|
631
628
|
}
|
|
632
629
|
|
|
633
630
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -687,23 +684,17 @@ const BlobStorageConnectorType = {
|
|
|
687
684
|
* @param engineCore The engine core.
|
|
688
685
|
* @param context The context for the engine.
|
|
689
686
|
* @param instanceConfig The instance config.
|
|
690
|
-
* @
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
function initialiseBlobStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
695
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
696
|
-
element: `Blob Storage Connector: ${instanceConfig.type}`
|
|
697
|
-
}));
|
|
698
|
-
const type = instanceConfig.type;
|
|
699
|
-
let connector;
|
|
687
|
+
* @returns The instance created and the factory for it.
|
|
688
|
+
*/
|
|
689
|
+
async function initialiseBlobStorageConnector(engineCore, context, instanceConfig) {
|
|
690
|
+
let component;
|
|
700
691
|
let instanceType;
|
|
701
|
-
if (type === BlobStorageConnectorType.Ipfs) {
|
|
702
|
-
|
|
692
|
+
if (instanceConfig.type === BlobStorageConnectorType.Ipfs) {
|
|
693
|
+
component = new IpfsBlobStorageConnector(instanceConfig.options);
|
|
703
694
|
instanceType = IpfsBlobStorageConnector.NAMESPACE;
|
|
704
695
|
}
|
|
705
|
-
else if (type === BlobStorageConnectorType.File) {
|
|
706
|
-
|
|
696
|
+
else if (instanceConfig.type === BlobStorageConnectorType.File) {
|
|
697
|
+
component = new FileBlobStorageConnector({
|
|
707
698
|
...instanceConfig.options,
|
|
708
699
|
config: {
|
|
709
700
|
...instanceConfig.options.config,
|
|
@@ -714,12 +705,12 @@ function initialiseBlobStorageConnector(engineCore, context, instanceConfig, ove
|
|
|
714
705
|
});
|
|
715
706
|
instanceType = FileBlobStorageConnector.NAMESPACE;
|
|
716
707
|
}
|
|
717
|
-
else if (type === BlobStorageConnectorType.Memory) {
|
|
718
|
-
|
|
708
|
+
else if (instanceConfig.type === BlobStorageConnectorType.Memory) {
|
|
709
|
+
component = new MemoryBlobStorageConnector();
|
|
719
710
|
instanceType = MemoryBlobStorageConnector.NAMESPACE;
|
|
720
711
|
}
|
|
721
|
-
else if (type === BlobStorageConnectorType.AwsS3) {
|
|
722
|
-
|
|
712
|
+
else if (instanceConfig.type === BlobStorageConnectorType.AwsS3) {
|
|
713
|
+
component = new S3BlobStorageConnector({
|
|
723
714
|
...instanceConfig.options,
|
|
724
715
|
config: {
|
|
725
716
|
...instanceConfig.options.config,
|
|
@@ -728,8 +719,8 @@ function initialiseBlobStorageConnector(engineCore, context, instanceConfig, ove
|
|
|
728
719
|
});
|
|
729
720
|
instanceType = S3BlobStorageConnector.NAMESPACE;
|
|
730
721
|
}
|
|
731
|
-
else if (type === BlobStorageConnectorType.GcpStorage) {
|
|
732
|
-
|
|
722
|
+
else if (instanceConfig.type === BlobStorageConnectorType.GcpStorage) {
|
|
723
|
+
component = new GcpBlobStorageConnector({
|
|
733
724
|
...instanceConfig.options,
|
|
734
725
|
config: {
|
|
735
726
|
...instanceConfig.options.config,
|
|
@@ -738,8 +729,8 @@ function initialiseBlobStorageConnector(engineCore, context, instanceConfig, ove
|
|
|
738
729
|
});
|
|
739
730
|
instanceType = GcpBlobStorageConnector.NAMESPACE;
|
|
740
731
|
}
|
|
741
|
-
else if (type === BlobStorageConnectorType.AzureStorage) {
|
|
742
|
-
|
|
732
|
+
else if (instanceConfig.type === BlobStorageConnectorType.AzureStorage) {
|
|
733
|
+
component = new AzureBlobStorageConnector({
|
|
743
734
|
...instanceConfig.options,
|
|
744
735
|
config: {
|
|
745
736
|
...instanceConfig.options.config,
|
|
@@ -748,62 +739,40 @@ function initialiseBlobStorageConnector(engineCore, context, instanceConfig, ove
|
|
|
748
739
|
});
|
|
749
740
|
instanceType = AzureBlobStorageConnector.NAMESPACE;
|
|
750
741
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
758
|
-
context.componentInstances.push({
|
|
759
|
-
instanceType: finalInstanceType,
|
|
760
|
-
component: connector
|
|
761
|
-
});
|
|
762
|
-
BlobStorageConnectorFactory.register(finalInstanceType, () => connector);
|
|
763
|
-
return finalInstanceType;
|
|
742
|
+
return {
|
|
743
|
+
component,
|
|
744
|
+
instanceType,
|
|
745
|
+
factory: BlobStorageConnectorFactory
|
|
746
|
+
};
|
|
764
747
|
}
|
|
765
748
|
/**
|
|
766
749
|
* Initialise the blob storage component.
|
|
767
750
|
* @param engineCore The engine core.
|
|
768
751
|
* @param context The context for the engine.
|
|
769
752
|
* @param instanceConfig The instance config.
|
|
770
|
-
* @
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
*/
|
|
774
|
-
function initialiseBlobStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
775
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
776
|
-
element: `Blob Storage Component: ${instanceConfig.type}`
|
|
777
|
-
}));
|
|
778
|
-
const type = instanceConfig.type;
|
|
753
|
+
* @returns The instance created and the factory for it.
|
|
754
|
+
*/
|
|
755
|
+
async function initialiseBlobStorageComponent(engineCore, context, instanceConfig) {
|
|
779
756
|
let component;
|
|
780
757
|
let instanceType;
|
|
781
|
-
if (type === BlobStorageComponentType.Service) {
|
|
758
|
+
if (instanceConfig.type === BlobStorageComponentType.Service) {
|
|
782
759
|
initSchema$3();
|
|
783
760
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
|
|
784
761
|
component = new BlobStorageService({
|
|
785
|
-
vaultConnectorType:
|
|
762
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
786
763
|
...instanceConfig.options
|
|
787
764
|
});
|
|
788
|
-
instanceType =
|
|
765
|
+
instanceType = "blob-storage-service";
|
|
789
766
|
}
|
|
790
|
-
else if (type === BlobStorageComponentType.RestClient) {
|
|
767
|
+
else if (instanceConfig.type === BlobStorageComponentType.RestClient) {
|
|
791
768
|
component = new BlobStorageClient(instanceConfig.options);
|
|
792
|
-
instanceType =
|
|
793
|
-
}
|
|
794
|
-
else {
|
|
795
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
796
|
-
type,
|
|
797
|
-
componentType: "blobStorageComponent"
|
|
798
|
-
});
|
|
769
|
+
instanceType = "blob-storage-client";
|
|
799
770
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
instanceType
|
|
803
|
-
|
|
804
|
-
}
|
|
805
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
806
|
-
return finalInstanceType;
|
|
771
|
+
return {
|
|
772
|
+
component,
|
|
773
|
+
instanceType,
|
|
774
|
+
factory: ComponentFactory
|
|
775
|
+
};
|
|
807
776
|
}
|
|
808
777
|
|
|
809
778
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -860,114 +829,135 @@ const DataProcessingComponentType = {
|
|
|
860
829
|
* @param engineCore The engine core.
|
|
861
830
|
* @param context The context for the engine.
|
|
862
831
|
* @param instanceConfig The instance config.
|
|
863
|
-
* @
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
function initialiseDataConverterConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
868
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
869
|
-
element: `Data Converter Connector: ${instanceConfig.type}`
|
|
870
|
-
}));
|
|
871
|
-
const type = instanceConfig.type;
|
|
872
|
-
let connector;
|
|
832
|
+
* @returns The instance created and the factory for it.
|
|
833
|
+
*/
|
|
834
|
+
async function initialiseDataConverterConnector(engineCore, context, instanceConfig) {
|
|
835
|
+
let component;
|
|
873
836
|
let instanceType;
|
|
874
|
-
if (type === DataConverterConnectorType.Json) {
|
|
875
|
-
|
|
837
|
+
if (instanceConfig.type === DataConverterConnectorType.Json) {
|
|
838
|
+
component = new JsonConverterConnector();
|
|
876
839
|
instanceType = JsonConverterConnector.NAMESPACE;
|
|
877
840
|
}
|
|
878
|
-
else if (type === DataConverterConnectorType.Xml) {
|
|
879
|
-
|
|
841
|
+
else if (instanceConfig.type === DataConverterConnectorType.Xml) {
|
|
842
|
+
component = new XmlConverterConnector();
|
|
880
843
|
instanceType = XmlConverterConnector.NAMESPACE;
|
|
881
844
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
889
|
-
context.componentInstances.push({
|
|
890
|
-
instanceType: finalInstanceType,
|
|
891
|
-
component: connector
|
|
892
|
-
});
|
|
893
|
-
DataConverterConnectorFactory.register(finalInstanceType, () => connector);
|
|
894
|
-
return finalInstanceType;
|
|
845
|
+
return {
|
|
846
|
+
component,
|
|
847
|
+
instanceType,
|
|
848
|
+
factory: DataConverterConnectorFactory
|
|
849
|
+
};
|
|
895
850
|
}
|
|
896
851
|
/**
|
|
897
852
|
* Initialise the data extractor connector.
|
|
898
853
|
* @param engineCore The engine core.
|
|
899
854
|
* @param context The context for the engine.
|
|
900
855
|
* @param instanceConfig The instance config.
|
|
901
|
-
* @
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
function initialiseDataExtractorConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
906
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
907
|
-
element: `Data Extractor Connector: ${instanceConfig.type}`
|
|
908
|
-
}));
|
|
909
|
-
const type = instanceConfig.type;
|
|
910
|
-
let connector;
|
|
856
|
+
* @returns The instance created and the factory for it.
|
|
857
|
+
*/
|
|
858
|
+
async function initialiseDataExtractorConnector(engineCore, context, instanceConfig) {
|
|
859
|
+
let component;
|
|
911
860
|
let instanceType;
|
|
912
|
-
if (type === DataExtractorConnectorType.JsonPath) {
|
|
913
|
-
|
|
861
|
+
if (instanceConfig.type === DataExtractorConnectorType.JsonPath) {
|
|
862
|
+
component = new JsonPathExtractorConnector();
|
|
914
863
|
instanceType = JsonPathExtractorConnector.NAMESPACE;
|
|
915
864
|
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
923
|
-
context.componentInstances.push({
|
|
924
|
-
instanceType: finalInstanceType,
|
|
925
|
-
component: connector
|
|
926
|
-
});
|
|
927
|
-
DataExtractorConnectorFactory.register(finalInstanceType, () => connector);
|
|
928
|
-
return finalInstanceType;
|
|
865
|
+
return {
|
|
866
|
+
component,
|
|
867
|
+
instanceType,
|
|
868
|
+
factory: DataExtractorConnectorFactory
|
|
869
|
+
};
|
|
929
870
|
}
|
|
930
871
|
/**
|
|
931
872
|
* Initialise the data processing component.
|
|
932
873
|
* @param engineCore The engine core.
|
|
933
874
|
* @param context The context for the engine.
|
|
934
875
|
* @param instanceConfig The instance config.
|
|
935
|
-
* @
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
*/
|
|
939
|
-
function initialiseDataProcessingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
940
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
941
|
-
element: `Data Processing Component: ${instanceConfig.type}`
|
|
942
|
-
}));
|
|
943
|
-
const type = instanceConfig.type;
|
|
876
|
+
* @returns The instance created and the factory for it.
|
|
877
|
+
*/
|
|
878
|
+
async function initialiseDataProcessingComponent(engineCore, context, instanceConfig) {
|
|
944
879
|
let component;
|
|
945
880
|
let instanceType;
|
|
946
|
-
if (type === DataProcessingComponentType.Service) {
|
|
881
|
+
if (instanceConfig.type === DataProcessingComponentType.Service) {
|
|
947
882
|
initSchema$4();
|
|
948
883
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.extractionRuleGroupStorageConnectorType, "ExtractionRuleGroup");
|
|
949
884
|
component = new DataProcessingService({
|
|
950
885
|
...instanceConfig.options
|
|
951
886
|
});
|
|
952
|
-
instanceType =
|
|
887
|
+
instanceType = "data-processing-service";
|
|
953
888
|
}
|
|
954
|
-
else if (type === DataProcessingComponentType.RestClient) {
|
|
889
|
+
else if (instanceConfig.type === DataProcessingComponentType.RestClient) {
|
|
955
890
|
component = new DataProcessingClient(instanceConfig.options);
|
|
956
|
-
instanceType =
|
|
891
|
+
instanceType = "data-processing-client";
|
|
892
|
+
}
|
|
893
|
+
return {
|
|
894
|
+
component,
|
|
895
|
+
instanceType,
|
|
896
|
+
factory: ComponentFactory
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// Copyright 2024 IOTA Stiftung.
|
|
901
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
902
|
+
/**
|
|
903
|
+
* Data space connector component types.
|
|
904
|
+
*/
|
|
905
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
906
|
+
const DataSpaceConnectorComponentType = {
|
|
907
|
+
/**
|
|
908
|
+
* Service.
|
|
909
|
+
*/
|
|
910
|
+
Service: "service",
|
|
911
|
+
/**
|
|
912
|
+
* REST client.
|
|
913
|
+
*/
|
|
914
|
+
RestClient: "rest-client",
|
|
915
|
+
/**
|
|
916
|
+
* Socket client.
|
|
917
|
+
*/
|
|
918
|
+
SocketClient: "socket-client"
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
// Copyright 2024 IOTA Stiftung.
|
|
922
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
923
|
+
/**
|
|
924
|
+
* Initialise the data space connector component.
|
|
925
|
+
* @param engineCore The engine core.
|
|
926
|
+
* @param context The context for the engine.
|
|
927
|
+
* @param instanceConfig The instance config.
|
|
928
|
+
* @returns The instance created and the factory for it.
|
|
929
|
+
*/
|
|
930
|
+
async function initialiseDataSpaceConnectorComponent(engineCore, context, instanceConfig) {
|
|
931
|
+
let component;
|
|
932
|
+
let instanceType;
|
|
933
|
+
if (instanceConfig.type === DataSpaceConnectorComponentType.Service) {
|
|
934
|
+
initSchema$5();
|
|
935
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityLogEntityStorageType, "ActivityLogDetails");
|
|
936
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask");
|
|
937
|
+
component = new DataSpaceConnectorService({
|
|
938
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
939
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
940
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
941
|
+
...instanceConfig.options
|
|
942
|
+
});
|
|
943
|
+
instanceType = "data-space-connector-service";
|
|
957
944
|
}
|
|
958
|
-
else {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
945
|
+
else if (instanceConfig.type === DataSpaceConnectorComponentType.RestClient) {
|
|
946
|
+
component = new DataSpaceConnectorClient(instanceConfig.options);
|
|
947
|
+
instanceType = "data-space-connector-client";
|
|
948
|
+
}
|
|
949
|
+
else if (instanceConfig.type === DataSpaceConnectorComponentType.SocketClient) {
|
|
950
|
+
component = new DataSpaceConnectorSocketClient({
|
|
951
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
952
|
+
...instanceConfig.options
|
|
962
953
|
});
|
|
954
|
+
instanceType = "data-space-connector-socket-client";
|
|
963
955
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
instanceType
|
|
967
|
-
|
|
968
|
-
}
|
|
969
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
970
|
-
return finalInstanceType;
|
|
956
|
+
return {
|
|
957
|
+
component,
|
|
958
|
+
instanceType,
|
|
959
|
+
factory: ComponentFactory
|
|
960
|
+
};
|
|
971
961
|
}
|
|
972
962
|
|
|
973
963
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -994,44 +984,30 @@ const DocumentManagementComponentType = {
|
|
|
994
984
|
* @param engineCore The engine core.
|
|
995
985
|
* @param context The context for the engine.
|
|
996
986
|
* @param instanceConfig The instance config.
|
|
997
|
-
* @
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
*/
|
|
1001
|
-
function initialiseDocumentManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1002
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1003
|
-
element: `Document Management Component: ${instanceConfig.type}`
|
|
1004
|
-
}));
|
|
1005
|
-
const type = instanceConfig.type;
|
|
987
|
+
* @returns The instance created and the factory for it.
|
|
988
|
+
*/
|
|
989
|
+
async function initialiseDocumentManagementComponent(engineCore, context, instanceConfig) {
|
|
1006
990
|
let component;
|
|
1007
991
|
let instanceType;
|
|
1008
|
-
if (type === DocumentManagementComponentType.Service) {
|
|
992
|
+
if (instanceConfig.type === DocumentManagementComponentType.Service) {
|
|
1009
993
|
component = new DocumentManagementService({
|
|
1010
|
-
auditableItemGraphComponentType:
|
|
1011
|
-
blobStorageComponentType:
|
|
1012
|
-
attestationComponentType:
|
|
1013
|
-
dataProcessingComponentType:
|
|
994
|
+
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
995
|
+
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
996
|
+
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
997
|
+
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
1014
998
|
...instanceConfig.options
|
|
1015
999
|
});
|
|
1016
|
-
instanceType =
|
|
1000
|
+
instanceType = "document-management-service";
|
|
1017
1001
|
}
|
|
1018
|
-
else if (type === DocumentManagementComponentType.RestClient) {
|
|
1002
|
+
else if (instanceConfig.type === DocumentManagementComponentType.RestClient) {
|
|
1019
1003
|
component = new DocumentManagementClient(instanceConfig.options);
|
|
1020
|
-
instanceType =
|
|
1021
|
-
}
|
|
1022
|
-
else {
|
|
1023
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1024
|
-
type,
|
|
1025
|
-
componentType: "documentManagementComponent"
|
|
1026
|
-
});
|
|
1004
|
+
instanceType = "document-management-client";
|
|
1027
1005
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
instanceType
|
|
1031
|
-
|
|
1032
|
-
}
|
|
1033
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1034
|
-
return finalInstanceType;
|
|
1006
|
+
return {
|
|
1007
|
+
component,
|
|
1008
|
+
instanceType,
|
|
1009
|
+
factory: ComponentFactory
|
|
1010
|
+
};
|
|
1035
1011
|
}
|
|
1036
1012
|
|
|
1037
1013
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1071,77 +1047,68 @@ const EventBusConnectorType = {
|
|
|
1071
1047
|
* @param engineCore The engine core.
|
|
1072
1048
|
* @param context The context for the engine.
|
|
1073
1049
|
* @param instanceConfig The instance config.
|
|
1074
|
-
* @
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
*/
|
|
1078
|
-
function initialiseEventBusConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1079
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1080
|
-
element: `Event Bus Connector: ${instanceConfig.type}`
|
|
1081
|
-
}));
|
|
1082
|
-
const type = instanceConfig.type;
|
|
1050
|
+
* @returns The instance created and the factory for it.
|
|
1051
|
+
*/
|
|
1052
|
+
async function initialiseEventBusConnector(engineCore, context, instanceConfig) {
|
|
1083
1053
|
let connector;
|
|
1084
1054
|
let instanceType;
|
|
1085
|
-
if (type === EventBusConnectorType.Local) {
|
|
1055
|
+
if (instanceConfig.type === EventBusConnectorType.Local) {
|
|
1086
1056
|
connector = new LocalEventBusConnector({
|
|
1087
|
-
|
|
1057
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1088
1058
|
...instanceConfig.options
|
|
1089
1059
|
});
|
|
1090
1060
|
instanceType = LocalEventBusConnector.NAMESPACE;
|
|
1091
1061
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
}
|
|
1098
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1099
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1100
|
-
EventBusConnectorFactory.register(finalInstanceType, () => connector);
|
|
1101
|
-
return finalInstanceType;
|
|
1062
|
+
return {
|
|
1063
|
+
instanceType,
|
|
1064
|
+
factory: EventBusConnectorFactory,
|
|
1065
|
+
component: connector
|
|
1066
|
+
};
|
|
1102
1067
|
}
|
|
1103
1068
|
/**
|
|
1104
1069
|
* Initialise the event bus component.
|
|
1105
1070
|
* @param engineCore The engine core.
|
|
1106
1071
|
* @param context The context for the engine.
|
|
1107
1072
|
* @param instanceConfig The instance config.
|
|
1108
|
-
* @
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
*/
|
|
1112
|
-
function initialiseEventBusComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1113
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1114
|
-
element: `Event Bus Component: ${instanceConfig.type}`
|
|
1115
|
-
}));
|
|
1116
|
-
const type = instanceConfig.type;
|
|
1073
|
+
* @returns The instance created and the factory for it.
|
|
1074
|
+
*/
|
|
1075
|
+
async function initialiseEventBusComponent(engineCore, context, instanceConfig) {
|
|
1117
1076
|
let component;
|
|
1118
1077
|
let instanceType;
|
|
1119
|
-
if (type === EventBusComponentType.Service) {
|
|
1078
|
+
if (instanceConfig.type === EventBusComponentType.Service) {
|
|
1120
1079
|
component = new EventBusService({
|
|
1121
|
-
eventBusConnectorType:
|
|
1080
|
+
eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
|
|
1122
1081
|
...instanceConfig.options
|
|
1123
1082
|
});
|
|
1124
|
-
instanceType =
|
|
1083
|
+
instanceType = "event-bus-service";
|
|
1125
1084
|
}
|
|
1126
|
-
else if (type === EventBusComponentType.SocketClient) {
|
|
1085
|
+
else if (instanceConfig.type === EventBusComponentType.SocketClient) {
|
|
1127
1086
|
component = new EventBusSocketClient({
|
|
1128
|
-
loggingComponentType:
|
|
1087
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1129
1088
|
...instanceConfig.options
|
|
1130
1089
|
});
|
|
1131
|
-
instanceType =
|
|
1132
|
-
}
|
|
1133
|
-
else {
|
|
1134
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1135
|
-
type,
|
|
1136
|
-
componentType: "EventBusComponent"
|
|
1137
|
-
});
|
|
1090
|
+
instanceType = "event-bus-socket-client";
|
|
1138
1091
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1092
|
+
return {
|
|
1093
|
+
instanceType,
|
|
1094
|
+
factory: ComponentFactory,
|
|
1095
|
+
component
|
|
1096
|
+
};
|
|
1143
1097
|
}
|
|
1144
1098
|
|
|
1099
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1100
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1101
|
+
/**
|
|
1102
|
+
* DLT config types.
|
|
1103
|
+
*/
|
|
1104
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1105
|
+
const DltConfigType = {
|
|
1106
|
+
/**
|
|
1107
|
+
* IOTA.
|
|
1108
|
+
*/
|
|
1109
|
+
Iota: "iota"
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1145
1112
|
// Copyright 2024 IOTA Stiftung.
|
|
1146
1113
|
// SPDX-License-Identifier: Apache-2.0.
|
|
1147
1114
|
/**
|
|
@@ -1161,25 +1128,48 @@ const FaucetConnectorType = {
|
|
|
1161
1128
|
|
|
1162
1129
|
// Copyright 2024 IOTA Stiftung.
|
|
1163
1130
|
// SPDX-License-Identifier: Apache-2.0.
|
|
1131
|
+
/**
|
|
1132
|
+
* Helper methods for engine config types.
|
|
1133
|
+
*/
|
|
1134
|
+
class EngineTypeHelper {
|
|
1135
|
+
/**
|
|
1136
|
+
* Runtime name for the class.
|
|
1137
|
+
*/
|
|
1138
|
+
static CLASS_NAME = "EngineTypeHelper";
|
|
1139
|
+
/**
|
|
1140
|
+
* Get the config for the specified component and type.
|
|
1141
|
+
* @param engineConfig The engine configuration.
|
|
1142
|
+
* @param component The component name.
|
|
1143
|
+
* @param type The type name.
|
|
1144
|
+
* @returns The config for the specified component and type or undefined if it does not exist.
|
|
1145
|
+
*/
|
|
1146
|
+
static getConfigOfType(engineConfig, component, type) {
|
|
1147
|
+
if (Is.empty(engineConfig.types[component])) {
|
|
1148
|
+
return undefined;
|
|
1149
|
+
}
|
|
1150
|
+
// First look for any of the specific type marked as default
|
|
1151
|
+
let foundConfig = engineConfig.types[component]?.find(config => config.type === type && config.isDefault);
|
|
1152
|
+
// If we found a default config then return that otherwise return the first matching type
|
|
1153
|
+
if (Is.empty(foundConfig)) {
|
|
1154
|
+
foundConfig = engineConfig.types[component]?.find(config => config.type === type);
|
|
1155
|
+
}
|
|
1156
|
+
return foundConfig;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1164
1160
|
/**
|
|
1165
1161
|
* Initialise a faucet connector.
|
|
1166
1162
|
* @param engineCore The engine core.
|
|
1167
1163
|
* @param context The context for the engine.
|
|
1168
1164
|
* @param instanceConfig The instance config.
|
|
1169
|
-
* @
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
function initialiseFaucetConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1174
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1175
|
-
element: `Faucet Connector: ${instanceConfig.type}`
|
|
1176
|
-
}));
|
|
1177
|
-
const type = instanceConfig.type;
|
|
1178
|
-
let connector;
|
|
1165
|
+
* @returns The instance created and the factory for it.
|
|
1166
|
+
*/
|
|
1167
|
+
async function initialiseFaucetConnector(engineCore, context, instanceConfig) {
|
|
1168
|
+
let component;
|
|
1179
1169
|
let instanceType;
|
|
1180
|
-
if (type === FaucetConnectorType.Iota) {
|
|
1181
|
-
const dltConfig =
|
|
1182
|
-
|
|
1170
|
+
if (instanceConfig.type === FaucetConnectorType.Iota) {
|
|
1171
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
1172
|
+
component = new IotaFaucetConnector({
|
|
1183
1173
|
...instanceConfig.options,
|
|
1184
1174
|
config: {
|
|
1185
1175
|
...dltConfig?.options?.config,
|
|
@@ -1188,23 +1178,17 @@ function initialiseFaucetConnector(engineCore, context, instanceConfig, override
|
|
|
1188
1178
|
});
|
|
1189
1179
|
instanceType = IotaFaucetConnector.NAMESPACE;
|
|
1190
1180
|
}
|
|
1191
|
-
else if (type === FaucetConnectorType.EntityStorage) {
|
|
1192
|
-
|
|
1181
|
+
else if (instanceConfig.type === FaucetConnectorType.EntityStorage) {
|
|
1182
|
+
initSchema$6();
|
|
1183
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
1184
|
+
component = new EntityStorageFaucetConnector(instanceConfig.options);
|
|
1193
1185
|
instanceType = EntityStorageFaucetConnector.NAMESPACE;
|
|
1194
1186
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
}
|
|
1201
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1202
|
-
context.componentInstances.push({
|
|
1203
|
-
instanceType: finalInstanceType,
|
|
1204
|
-
component: connector
|
|
1205
|
-
});
|
|
1206
|
-
FaucetConnectorFactory.register(finalInstanceType, () => connector);
|
|
1207
|
-
return finalInstanceType;
|
|
1187
|
+
return {
|
|
1188
|
+
component,
|
|
1189
|
+
instanceType,
|
|
1190
|
+
factory: FaucetConnectorFactory
|
|
1191
|
+
};
|
|
1208
1192
|
}
|
|
1209
1193
|
|
|
1210
1194
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1231,47 +1215,33 @@ const FederatedCatalogueComponentType = {
|
|
|
1231
1215
|
* @param engineCore The engine core.
|
|
1232
1216
|
* @param context The context for the engine.
|
|
1233
1217
|
* @param instanceConfig The instance config.
|
|
1234
|
-
* @
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
*/
|
|
1238
|
-
function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1239
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1240
|
-
element: `Federated Catalogue Component: ${instanceConfig.type}`
|
|
1241
|
-
}));
|
|
1242
|
-
const type = instanceConfig.type;
|
|
1218
|
+
* @returns The instance created and the factory for it.
|
|
1219
|
+
*/
|
|
1220
|
+
async function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig) {
|
|
1243
1221
|
let component;
|
|
1244
1222
|
let instanceType;
|
|
1245
|
-
if (type === FederatedCatalogueComponentType.Service) {
|
|
1246
|
-
initSchema$
|
|
1223
|
+
if (instanceConfig.type === FederatedCatalogueComponentType.Service) {
|
|
1224
|
+
initSchema$7();
|
|
1247
1225
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry");
|
|
1248
1226
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry");
|
|
1249
1227
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
|
|
1250
1228
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
|
|
1251
1229
|
component = new FederatedCatalogueService({
|
|
1252
|
-
|
|
1253
|
-
identityResolverComponentType:
|
|
1230
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1231
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
1254
1232
|
...instanceConfig.options
|
|
1255
1233
|
});
|
|
1256
|
-
instanceType =
|
|
1234
|
+
instanceType = "federated-catalogue-service";
|
|
1257
1235
|
}
|
|
1258
|
-
else if (type === FederatedCatalogueComponentType.RestClient) {
|
|
1236
|
+
else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {
|
|
1259
1237
|
component = new FederatedCatalogueClient(instanceConfig.options);
|
|
1260
|
-
instanceType =
|
|
1261
|
-
}
|
|
1262
|
-
else {
|
|
1263
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1264
|
-
type,
|
|
1265
|
-
componentType: "FederatedCatalogueComponent"
|
|
1266
|
-
});
|
|
1238
|
+
instanceType = "federated-catalogue-client";
|
|
1267
1239
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
instanceType
|
|
1271
|
-
|
|
1272
|
-
}
|
|
1273
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1274
|
-
return finalInstanceType;
|
|
1240
|
+
return {
|
|
1241
|
+
component,
|
|
1242
|
+
instanceType,
|
|
1243
|
+
factory: ComponentFactory
|
|
1244
|
+
};
|
|
1275
1245
|
}
|
|
1276
1246
|
|
|
1277
1247
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1315,21 +1285,15 @@ const IdentityConnectorType = {
|
|
|
1315
1285
|
* @param engineCore The engine core.
|
|
1316
1286
|
* @param context The context for the engine.
|
|
1317
1287
|
* @param instanceConfig The instance config.
|
|
1318
|
-
* @
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
function initialiseIdentityConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1323
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1324
|
-
element: `Identity Connector: ${instanceConfig.type}`
|
|
1325
|
-
}));
|
|
1326
|
-
const type = instanceConfig.type;
|
|
1327
|
-
let connector;
|
|
1288
|
+
* @returns The instance created and the factory for it.
|
|
1289
|
+
*/
|
|
1290
|
+
async function initialiseIdentityConnector(engineCore, context, instanceConfig) {
|
|
1291
|
+
let component;
|
|
1328
1292
|
let instanceType;
|
|
1329
|
-
if (type === IdentityConnectorType.Iota) {
|
|
1330
|
-
const dltConfig =
|
|
1331
|
-
|
|
1332
|
-
vaultConnectorType:
|
|
1293
|
+
if (instanceConfig.type === IdentityConnectorType.Iota) {
|
|
1294
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
1295
|
+
component = new IotaIdentityConnector({
|
|
1296
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1333
1297
|
...instanceConfig.options,
|
|
1334
1298
|
config: {
|
|
1335
1299
|
...dltConfig?.options?.config,
|
|
@@ -1338,60 +1302,44 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1338
1302
|
});
|
|
1339
1303
|
instanceType = IotaIdentityConnector.NAMESPACE;
|
|
1340
1304
|
}
|
|
1341
|
-
else if (type === IdentityConnectorType.EntityStorage) {
|
|
1342
|
-
initSchema$
|
|
1305
|
+
else if (instanceConfig.type === IdentityConnectorType.EntityStorage) {
|
|
1306
|
+
initSchema$8({ includeProfile: false });
|
|
1343
1307
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1344
|
-
|
|
1345
|
-
vaultConnectorType:
|
|
1308
|
+
component = new EntityStorageIdentityConnector({
|
|
1309
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1346
1310
|
...instanceConfig.options
|
|
1347
1311
|
});
|
|
1348
1312
|
instanceType = EntityStorageIdentityConnector.NAMESPACE;
|
|
1349
1313
|
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
}
|
|
1356
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1357
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1358
|
-
IdentityConnectorFactory.register(finalInstanceType, () => connector);
|
|
1359
|
-
return finalInstanceType;
|
|
1314
|
+
return {
|
|
1315
|
+
component,
|
|
1316
|
+
instanceType,
|
|
1317
|
+
factory: IdentityConnectorFactory
|
|
1318
|
+
};
|
|
1360
1319
|
}
|
|
1361
1320
|
/**
|
|
1362
1321
|
* Initialise the identity component.
|
|
1363
1322
|
* @param engineCore The engine core.
|
|
1364
1323
|
* @param context The context for the engine.
|
|
1365
1324
|
* @param instanceConfig The instance config.
|
|
1366
|
-
* @
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
*/
|
|
1370
|
-
function initialiseIdentityComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1371
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1372
|
-
element: `Identity Component: ${instanceConfig.type}`
|
|
1373
|
-
}));
|
|
1374
|
-
const type = instanceConfig.type;
|
|
1325
|
+
* @returns The instance created and the factory for it.
|
|
1326
|
+
*/
|
|
1327
|
+
async function initialiseIdentityComponent(engineCore, context, instanceConfig) {
|
|
1375
1328
|
let component;
|
|
1376
1329
|
let instanceType;
|
|
1377
|
-
if (type === IdentityComponentType.Service) {
|
|
1330
|
+
if (instanceConfig.type === IdentityComponentType.Service) {
|
|
1378
1331
|
component = new IdentityService(instanceConfig.options);
|
|
1379
|
-
instanceType =
|
|
1332
|
+
instanceType = "identity-service";
|
|
1380
1333
|
}
|
|
1381
|
-
else if (type === IdentityComponentType.RestClient) {
|
|
1334
|
+
else if (instanceConfig.type === IdentityComponentType.RestClient) {
|
|
1382
1335
|
component = new IdentityClient(instanceConfig.options);
|
|
1383
|
-
instanceType =
|
|
1336
|
+
instanceType = "identity-client";
|
|
1384
1337
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
}
|
|
1391
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1392
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1393
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1394
|
-
return finalInstanceType;
|
|
1338
|
+
return {
|
|
1339
|
+
component,
|
|
1340
|
+
instanceType,
|
|
1341
|
+
factory: ComponentFactory
|
|
1342
|
+
};
|
|
1395
1343
|
}
|
|
1396
1344
|
|
|
1397
1345
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1431,77 +1379,49 @@ const IdentityProfileConnectorType = {
|
|
|
1431
1379
|
* @param engineCore The engine core.
|
|
1432
1380
|
* @param context The context for the engine.
|
|
1433
1381
|
* @param instanceConfig The instance config.
|
|
1434
|
-
* @
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
*/
|
|
1438
|
-
function initialiseIdentityProfileConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1439
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1440
|
-
element: `Identity Profile Connector: ${instanceConfig.type}`
|
|
1441
|
-
}));
|
|
1442
|
-
const type = instanceConfig.type;
|
|
1382
|
+
* @returns The instance created and the factory for it.
|
|
1383
|
+
*/
|
|
1384
|
+
async function initialiseIdentityProfileConnector(engineCore, context, instanceConfig) {
|
|
1443
1385
|
let connector;
|
|
1444
1386
|
let instanceType;
|
|
1445
|
-
if (type === IdentityProfileConnectorType.EntityStorage) {
|
|
1446
|
-
initSchema$
|
|
1387
|
+
if (instanceConfig.type === IdentityProfileConnectorType.EntityStorage) {
|
|
1388
|
+
initSchema$8({ includeDocument: false });
|
|
1447
1389
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.profileEntityStorageType, "IdentityProfile");
|
|
1448
1390
|
connector = new EntityStorageIdentityProfileConnector(instanceConfig.options);
|
|
1449
1391
|
instanceType = EntityStorageIdentityProfileConnector.NAMESPACE;
|
|
1450
1392
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
}
|
|
1457
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1458
|
-
context.componentInstances.push({
|
|
1459
|
-
instanceType: finalInstanceType,
|
|
1460
|
-
component: connector
|
|
1461
|
-
});
|
|
1462
|
-
IdentityProfileConnectorFactory.register(finalInstanceType, () => connector);
|
|
1463
|
-
return finalInstanceType;
|
|
1393
|
+
return {
|
|
1394
|
+
component: connector,
|
|
1395
|
+
instanceType,
|
|
1396
|
+
factory: IdentityProfileConnectorFactory
|
|
1397
|
+
};
|
|
1464
1398
|
}
|
|
1465
1399
|
/**
|
|
1466
1400
|
* Initialise the identity profile component.
|
|
1467
1401
|
* @param engineCore The engine core.
|
|
1468
1402
|
* @param context The context for the engine.
|
|
1469
1403
|
* @param instanceConfig The instance config.
|
|
1470
|
-
* @
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
*/
|
|
1474
|
-
function initialiseIdentityProfileComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1475
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1476
|
-
element: `Identity Profile Component: ${instanceConfig.type}`
|
|
1477
|
-
}));
|
|
1478
|
-
const type = instanceConfig.type;
|
|
1404
|
+
* @returns The instance created and the factory for it.
|
|
1405
|
+
*/
|
|
1406
|
+
async function initialiseIdentityProfileComponent(engineCore, context, instanceConfig) {
|
|
1479
1407
|
let component;
|
|
1480
1408
|
let instanceType;
|
|
1481
|
-
if (type === IdentityProfileComponentType.Service) {
|
|
1409
|
+
if (instanceConfig.type === IdentityProfileComponentType.Service) {
|
|
1482
1410
|
component = new IdentityProfileService({
|
|
1483
|
-
profileEntityConnectorType:
|
|
1411
|
+
profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
|
|
1484
1412
|
...instanceConfig.options
|
|
1485
1413
|
});
|
|
1486
|
-
instanceType =
|
|
1414
|
+
instanceType = "identity-profile-service";
|
|
1487
1415
|
}
|
|
1488
|
-
else if (type === IdentityProfileComponentType.RestClient) {
|
|
1416
|
+
else if (instanceConfig.type === IdentityProfileComponentType.RestClient) {
|
|
1489
1417
|
component = new IdentityProfileClient(instanceConfig.options);
|
|
1490
|
-
instanceType =
|
|
1491
|
-
}
|
|
1492
|
-
else {
|
|
1493
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1494
|
-
type,
|
|
1495
|
-
componentType: "identityProfileComponent"
|
|
1496
|
-
});
|
|
1418
|
+
instanceType = "identity-profile-client";
|
|
1497
1419
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
instanceType
|
|
1501
|
-
|
|
1502
|
-
}
|
|
1503
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1504
|
-
return finalInstanceType;
|
|
1420
|
+
return {
|
|
1421
|
+
component,
|
|
1422
|
+
instanceType,
|
|
1423
|
+
factory: ComponentFactory
|
|
1424
|
+
};
|
|
1505
1425
|
}
|
|
1506
1426
|
|
|
1507
1427
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1549,20 +1469,14 @@ const IdentityResolverConnectorType = {
|
|
|
1549
1469
|
* @param engineCore The engine core.
|
|
1550
1470
|
* @param context The context for the engine.
|
|
1551
1471
|
* @param instanceConfig The instance config.
|
|
1552
|
-
* @
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
function initialiseIdentityResolverConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1557
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1558
|
-
element: `Identity Resolver Connector: ${instanceConfig.type}`
|
|
1559
|
-
}));
|
|
1560
|
-
const type = instanceConfig.type;
|
|
1561
|
-
let connector;
|
|
1472
|
+
* @returns The instance created and the factory for it.
|
|
1473
|
+
*/
|
|
1474
|
+
async function initialiseIdentityResolverConnector(engineCore, context, instanceConfig) {
|
|
1475
|
+
let component;
|
|
1562
1476
|
let instanceType;
|
|
1563
|
-
if (type === IdentityResolverConnectorType.Iota) {
|
|
1564
|
-
const dltConfig =
|
|
1565
|
-
|
|
1477
|
+
if (instanceConfig.type === IdentityResolverConnectorType.Iota) {
|
|
1478
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
1479
|
+
component = new IotaIdentityResolverConnector({
|
|
1566
1480
|
...instanceConfig.options,
|
|
1567
1481
|
config: {
|
|
1568
1482
|
...dltConfig?.options?.config,
|
|
@@ -1571,71 +1485,56 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1571
1485
|
});
|
|
1572
1486
|
instanceType = IotaIdentityResolverConnector.NAMESPACE;
|
|
1573
1487
|
}
|
|
1574
|
-
else if (type === IdentityResolverConnectorType.EntityStorage) {
|
|
1575
|
-
initSchema$
|
|
1488
|
+
else if (instanceConfig.type === IdentityResolverConnectorType.EntityStorage) {
|
|
1489
|
+
initSchema$8({ includeProfile: false });
|
|
1576
1490
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1577
|
-
|
|
1578
|
-
vaultConnectorType:
|
|
1491
|
+
component = new EntityStorageIdentityResolverConnector({
|
|
1492
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1579
1493
|
...instanceConfig.options
|
|
1580
1494
|
});
|
|
1581
1495
|
instanceType = EntityStorageIdentityResolverConnector.NAMESPACE;
|
|
1582
1496
|
}
|
|
1583
|
-
else if (type === IdentityResolverConnectorType.Universal) {
|
|
1584
|
-
|
|
1497
|
+
else if (instanceConfig.type === IdentityResolverConnectorType.Universal) {
|
|
1498
|
+
component = new UniversalResolverConnector({
|
|
1585
1499
|
...instanceConfig.options
|
|
1586
1500
|
});
|
|
1587
1501
|
instanceType = UniversalResolverConnector.NAMESPACE;
|
|
1588
1502
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}
|
|
1595
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1596
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1597
|
-
IdentityResolverConnectorFactory.register(finalInstanceType, () => connector);
|
|
1598
|
-
return finalInstanceType;
|
|
1503
|
+
return {
|
|
1504
|
+
component,
|
|
1505
|
+
instanceType,
|
|
1506
|
+
factory: IdentityResolverConnectorFactory
|
|
1507
|
+
};
|
|
1599
1508
|
}
|
|
1600
1509
|
/**
|
|
1601
1510
|
* Initialise the identity resolver component.
|
|
1602
1511
|
* @param engineCore The engine core.
|
|
1603
1512
|
* @param context The context for the engine.
|
|
1604
1513
|
* @param instanceConfig The instance config.
|
|
1605
|
-
* @
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
*/
|
|
1609
|
-
function initialiseIdentityResolverComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1610
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1611
|
-
element: `Identity Resolver Component: ${instanceConfig.type}`
|
|
1612
|
-
}));
|
|
1613
|
-
const type = instanceConfig.type;
|
|
1514
|
+
* @returns The instance created and the factory for it.
|
|
1515
|
+
*/
|
|
1516
|
+
async function initialiseIdentityResolverComponent(engineCore, context, instanceConfig) {
|
|
1614
1517
|
let component;
|
|
1615
1518
|
let instanceType;
|
|
1616
|
-
if (type === IdentityResolverComponentType.Service) {
|
|
1519
|
+
if (instanceConfig.type === IdentityResolverComponentType.Service) {
|
|
1520
|
+
const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
|
|
1617
1521
|
component = new IdentityResolverService({
|
|
1618
|
-
fallbackResolverConnectorType:
|
|
1522
|
+
fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
|
|
1619
1523
|
? IdentityResolverConnectorType.Universal
|
|
1620
1524
|
: undefined,
|
|
1621
1525
|
...instanceConfig.options
|
|
1622
1526
|
});
|
|
1623
|
-
instanceType =
|
|
1527
|
+
instanceType = "identity-resolver-service";
|
|
1624
1528
|
}
|
|
1625
|
-
else if (type === IdentityResolverComponentType.RestClient) {
|
|
1529
|
+
else if (instanceConfig.type === IdentityResolverComponentType.RestClient) {
|
|
1626
1530
|
component = new IdentityResolverClient(instanceConfig.options);
|
|
1627
|
-
instanceType =
|
|
1531
|
+
instanceType = "identity-resolver-client";
|
|
1628
1532
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
}
|
|
1635
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1636
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1637
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1638
|
-
return finalInstanceType;
|
|
1533
|
+
return {
|
|
1534
|
+
component,
|
|
1535
|
+
instanceType,
|
|
1536
|
+
factory: ComponentFactory
|
|
1537
|
+
};
|
|
1639
1538
|
}
|
|
1640
1539
|
|
|
1641
1540
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1662,46 +1561,32 @@ const ImmutableProofComponentType = {
|
|
|
1662
1561
|
* @param engineCore The engine core.
|
|
1663
1562
|
* @param context The context for the engine.
|
|
1664
1563
|
* @param instanceConfig The instance config.
|
|
1665
|
-
* @
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
*/
|
|
1669
|
-
function initialiseImmutableProofComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1670
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1671
|
-
element: `Immutable Proof Component: ${instanceConfig.type}`
|
|
1672
|
-
}));
|
|
1673
|
-
const type = instanceConfig.type;
|
|
1564
|
+
* @returns The instance created and the factory for it.
|
|
1565
|
+
*/
|
|
1566
|
+
async function initialiseImmutableProofComponent(engineCore, context, instanceConfig) {
|
|
1674
1567
|
let component;
|
|
1675
1568
|
let instanceType;
|
|
1676
|
-
if (type === ImmutableProofComponentType.Service) {
|
|
1677
|
-
initSchema$
|
|
1569
|
+
if (instanceConfig.type === ImmutableProofComponentType.Service) {
|
|
1570
|
+
initSchema$9();
|
|
1678
1571
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
|
|
1679
1572
|
component = new ImmutableProofService({
|
|
1680
|
-
verifiableStorageType:
|
|
1681
|
-
identityConnectorType:
|
|
1682
|
-
backgroundTaskConnectorType:
|
|
1683
|
-
eventBusComponentType:
|
|
1573
|
+
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
1574
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
1575
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1576
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
1684
1577
|
...instanceConfig.options
|
|
1685
1578
|
});
|
|
1686
|
-
instanceType =
|
|
1579
|
+
instanceType = "immutable-proof-service";
|
|
1687
1580
|
}
|
|
1688
|
-
else if (type === ImmutableProofComponentType.RestClient) {
|
|
1581
|
+
else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {
|
|
1689
1582
|
component = new ImmutableProofClient(instanceConfig.options);
|
|
1690
|
-
instanceType =
|
|
1583
|
+
instanceType = "immutable-proof-client";
|
|
1691
1584
|
}
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}
|
|
1698
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1699
|
-
context.componentInstances.push({
|
|
1700
|
-
instanceType: finalInstanceType,
|
|
1701
|
-
component
|
|
1702
|
-
});
|
|
1703
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
1704
|
-
return finalInstanceType;
|
|
1585
|
+
return {
|
|
1586
|
+
component,
|
|
1587
|
+
instanceType,
|
|
1588
|
+
factory: ComponentFactory
|
|
1589
|
+
};
|
|
1705
1590
|
}
|
|
1706
1591
|
|
|
1707
1592
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1749,81 +1634,72 @@ const LoggingConnectorType = {
|
|
|
1749
1634
|
* @param engineCore The engine core.
|
|
1750
1635
|
* @param context The engine core context.
|
|
1751
1636
|
* @param instanceConfig The instance config.
|
|
1752
|
-
* @
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
function initialiseLoggingConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1757
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1758
|
-
element: `Logging Connector: ${instanceConfig.type}`
|
|
1759
|
-
}));
|
|
1760
|
-
const type = instanceConfig.type;
|
|
1761
|
-
let connector;
|
|
1637
|
+
* @returns The instance created and the factory for it.
|
|
1638
|
+
*/
|
|
1639
|
+
async function initialiseLoggingConnector(engineCore, context, instanceConfig) {
|
|
1640
|
+
let component;
|
|
1762
1641
|
let instanceType;
|
|
1763
|
-
if (type === LoggingConnectorType.Console) {
|
|
1764
|
-
|
|
1642
|
+
if (instanceConfig.type === LoggingConnectorType.Console) {
|
|
1643
|
+
component = new ConsoleLoggingConnector(instanceConfig.options);
|
|
1765
1644
|
instanceType = ConsoleLoggingConnector.NAMESPACE;
|
|
1766
1645
|
}
|
|
1767
|
-
else if (type === LoggingConnectorType.EntityStorage) {
|
|
1768
|
-
initSchema$
|
|
1646
|
+
else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {
|
|
1647
|
+
initSchema$a();
|
|
1769
1648
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry");
|
|
1770
|
-
|
|
1649
|
+
component = new EntityStorageLoggingConnector(instanceConfig.options);
|
|
1771
1650
|
instanceType = EntityStorageLoggingConnector.NAMESPACE;
|
|
1772
1651
|
}
|
|
1773
|
-
else if (type === LoggingConnectorType.Multi) {
|
|
1774
|
-
|
|
1652
|
+
else if (instanceConfig.type === LoggingConnectorType.Multi) {
|
|
1653
|
+
component = new MultiLoggingConnector(instanceConfig.options);
|
|
1775
1654
|
instanceType = MultiLoggingConnector.NAMESPACE;
|
|
1776
1655
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
}
|
|
1783
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1784
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1785
|
-
LoggingConnectorFactory.register(finalInstanceType, () => connector);
|
|
1786
|
-
return finalInstanceType;
|
|
1656
|
+
return {
|
|
1657
|
+
component,
|
|
1658
|
+
instanceType,
|
|
1659
|
+
factory: LoggingConnectorFactory
|
|
1660
|
+
};
|
|
1787
1661
|
}
|
|
1788
1662
|
/**
|
|
1789
1663
|
* Initialise the logging component.
|
|
1790
1664
|
* @param engineCore The engine core.
|
|
1791
1665
|
* @param context The context for the engine.
|
|
1792
1666
|
* @param instanceConfig The instance config.
|
|
1793
|
-
* @
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
*/
|
|
1797
|
-
function initialiseLoggingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1798
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1799
|
-
element: `Logging Component: ${instanceConfig.type}`
|
|
1800
|
-
}));
|
|
1801
|
-
const type = instanceConfig.type;
|
|
1667
|
+
* @returns The instance created and the factory for it.
|
|
1668
|
+
*/
|
|
1669
|
+
async function initialiseLoggingComponent(engineCore, context, instanceConfig) {
|
|
1802
1670
|
let component;
|
|
1803
1671
|
let instanceType;
|
|
1804
|
-
if (type === LoggingComponentType.Service) {
|
|
1672
|
+
if (instanceConfig.type === LoggingComponentType.Service) {
|
|
1805
1673
|
component = new LoggingService({
|
|
1806
|
-
loggingConnectorType:
|
|
1674
|
+
loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
|
|
1807
1675
|
...instanceConfig.options
|
|
1808
1676
|
});
|
|
1809
|
-
instanceType =
|
|
1677
|
+
instanceType = "logging-service";
|
|
1810
1678
|
}
|
|
1811
|
-
else if (type === LoggingComponentType.RestClient) {
|
|
1679
|
+
else if (instanceConfig.type === LoggingComponentType.RestClient) {
|
|
1812
1680
|
component = new LoggingClient(instanceConfig.options);
|
|
1813
|
-
instanceType =
|
|
1814
|
-
}
|
|
1815
|
-
else {
|
|
1816
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1817
|
-
type,
|
|
1818
|
-
componentType: "loggingComponent"
|
|
1819
|
-
});
|
|
1681
|
+
instanceType = "logging-client";
|
|
1820
1682
|
}
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1683
|
+
return {
|
|
1684
|
+
component,
|
|
1685
|
+
instanceType,
|
|
1686
|
+
factory: ComponentFactory
|
|
1687
|
+
};
|
|
1825
1688
|
}
|
|
1826
1689
|
|
|
1690
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1691
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1692
|
+
/**
|
|
1693
|
+
* Messaging admin component types.
|
|
1694
|
+
*/
|
|
1695
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1696
|
+
const MessagingAdminComponentType = {
|
|
1697
|
+
/**
|
|
1698
|
+
* Service.
|
|
1699
|
+
*/
|
|
1700
|
+
Service: "service"
|
|
1701
|
+
};
|
|
1702
|
+
|
|
1827
1703
|
// Copyright 2024 IOTA Stiftung.
|
|
1828
1704
|
// SPDX-License-Identifier: Apache-2.0.
|
|
1829
1705
|
/**
|
|
@@ -1895,168 +1771,147 @@ const MessagingSmsConnectorType = {
|
|
|
1895
1771
|
* @param engineCore The engine core.
|
|
1896
1772
|
* @param context The context for the engine.
|
|
1897
1773
|
* @param instanceConfig The instance config.
|
|
1898
|
-
* @
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
function initialiseMessagingEmailConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1903
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1904
|
-
element: `Messaging Email Connector: ${instanceConfig.type}`
|
|
1905
|
-
}));
|
|
1906
|
-
const type = instanceConfig.type;
|
|
1907
|
-
let connector;
|
|
1774
|
+
* @returns The instance created and the factory for it.
|
|
1775
|
+
*/
|
|
1776
|
+
async function initialiseMessagingEmailConnector(engineCore, context, instanceConfig) {
|
|
1777
|
+
let component;
|
|
1908
1778
|
let instanceType;
|
|
1909
|
-
if (type === MessagingEmailConnectorType.EntityStorage) {
|
|
1910
|
-
initSchema$
|
|
1779
|
+
if (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {
|
|
1780
|
+
initSchema$b({ email: true, sms: false, pushNotification: false });
|
|
1911
1781
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
|
|
1912
|
-
|
|
1913
|
-
|
|
1782
|
+
component = new EntityStorageMessagingEmailConnector({
|
|
1783
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1914
1784
|
...instanceConfig.options
|
|
1915
1785
|
});
|
|
1916
1786
|
instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
1917
1787
|
}
|
|
1918
|
-
else if (type === MessagingEmailConnectorType.Aws) {
|
|
1919
|
-
|
|
1920
|
-
|
|
1788
|
+
else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {
|
|
1789
|
+
component = new AwsMessagingEmailConnector({
|
|
1790
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1921
1791
|
...instanceConfig.options
|
|
1922
1792
|
});
|
|
1923
1793
|
instanceType = AwsMessagingEmailConnector.NAMESPACE;
|
|
1924
1794
|
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
}
|
|
1931
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1932
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1933
|
-
MessagingEmailConnectorFactory.register(finalInstanceType, () => connector);
|
|
1934
|
-
return finalInstanceType;
|
|
1795
|
+
return {
|
|
1796
|
+
component,
|
|
1797
|
+
instanceType,
|
|
1798
|
+
factory: MessagingEmailConnectorFactory
|
|
1799
|
+
};
|
|
1935
1800
|
}
|
|
1936
1801
|
/**
|
|
1937
1802
|
* Initialise a messaging sms connector.
|
|
1938
1803
|
* @param engineCore The engine core.
|
|
1939
1804
|
* @param context The context for the engine.
|
|
1940
1805
|
* @param instanceConfig The instance config.
|
|
1941
|
-
* @
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
*/
|
|
1945
|
-
function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1946
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1947
|
-
element: `Messaging SMS Connector: ${instanceConfig.type}`
|
|
1948
|
-
}));
|
|
1949
|
-
const type = instanceConfig.type;
|
|
1806
|
+
* @returns The instance created and the factory for it.
|
|
1807
|
+
*/
|
|
1808
|
+
async function initialiseMessagingSmsConnector(engineCore, context, instanceConfig) {
|
|
1950
1809
|
let connector;
|
|
1951
1810
|
let instanceType;
|
|
1952
|
-
if (type === MessagingSmsConnectorType.EntityStorage) {
|
|
1953
|
-
initSchema$
|
|
1811
|
+
if (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {
|
|
1812
|
+
initSchema$b({ email: false, sms: true, pushNotification: false });
|
|
1954
1813
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
|
|
1955
1814
|
connector = new EntityStorageMessagingSmsConnector({
|
|
1956
|
-
|
|
1815
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1957
1816
|
...instanceConfig.options
|
|
1958
1817
|
});
|
|
1959
1818
|
instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
1960
1819
|
}
|
|
1961
|
-
else if (type === MessagingSmsConnectorType.Aws) {
|
|
1820
|
+
else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {
|
|
1962
1821
|
connector = new AwsMessagingSmsConnector({
|
|
1963
|
-
|
|
1822
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1964
1823
|
...instanceConfig.options
|
|
1965
1824
|
});
|
|
1966
1825
|
instanceType = AwsMessagingSmsConnector.NAMESPACE;
|
|
1967
1826
|
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
}
|
|
1974
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1975
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
1976
|
-
MessagingSmsConnectorFactory.register(finalInstanceType, () => connector);
|
|
1977
|
-
return finalInstanceType;
|
|
1827
|
+
return {
|
|
1828
|
+
instanceType,
|
|
1829
|
+
factory: MessagingSmsConnectorFactory,
|
|
1830
|
+
component: connector
|
|
1831
|
+
};
|
|
1978
1832
|
}
|
|
1979
1833
|
/**
|
|
1980
1834
|
* Initialise a messaging push notification connector.
|
|
1981
1835
|
* @param engineCore The engine core.
|
|
1982
1836
|
* @param context The context for the engine.
|
|
1983
1837
|
* @param instanceConfig The instance config.
|
|
1984
|
-
* @
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1989
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1990
|
-
element: `Messaging Push Notification Connector: ${instanceConfig.type}`
|
|
1991
|
-
}));
|
|
1992
|
-
const type = instanceConfig.type;
|
|
1993
|
-
let connector;
|
|
1838
|
+
* @returns The instance created and the factory for it.
|
|
1839
|
+
*/
|
|
1840
|
+
async function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig) {
|
|
1841
|
+
let component;
|
|
1994
1842
|
let instanceType;
|
|
1995
|
-
if (type === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
1996
|
-
initSchema$
|
|
1843
|
+
if (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
1844
|
+
initSchema$b({ email: false, sms: false, pushNotification: true });
|
|
1997
1845
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
|
|
1998
1846
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
|
|
1999
|
-
|
|
2000
|
-
|
|
1847
|
+
component = new EntityStorageMessagingPushNotificationConnector({
|
|
1848
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2001
1849
|
...instanceConfig.options
|
|
2002
1850
|
});
|
|
2003
1851
|
instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
2004
1852
|
}
|
|
2005
|
-
else if (type === MessagingPushNotificationConnectorType.Aws) {
|
|
2006
|
-
|
|
2007
|
-
|
|
1853
|
+
else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {
|
|
1854
|
+
component = new AwsMessagingPushNotificationConnector({
|
|
1855
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2008
1856
|
...instanceConfig.options
|
|
2009
1857
|
});
|
|
2010
1858
|
instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
2011
1859
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
}
|
|
2018
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2019
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2020
|
-
MessagingPushNotificationsConnectorFactory.register(finalInstanceType, () => connector);
|
|
2021
|
-
return finalInstanceType;
|
|
1860
|
+
return {
|
|
1861
|
+
component,
|
|
1862
|
+
instanceType,
|
|
1863
|
+
factory: MessagingPushNotificationsConnectorFactory
|
|
1864
|
+
};
|
|
2022
1865
|
}
|
|
2023
1866
|
/**
|
|
2024
1867
|
* Initialise the messaging component.
|
|
2025
1868
|
* @param engineCore The engine core.
|
|
2026
1869
|
* @param context The context for the engine.
|
|
2027
1870
|
* @param instanceConfig The instance config.
|
|
2028
|
-
* @
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
*/
|
|
2032
|
-
function initialiseMessagingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2033
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2034
|
-
element: `Messaging Component: ${instanceConfig.type}`
|
|
2035
|
-
}));
|
|
2036
|
-
const type = instanceConfig.type;
|
|
1871
|
+
* @returns The instance created and the factory for it.
|
|
1872
|
+
*/
|
|
1873
|
+
async function initialiseMessagingComponent(engineCore, context, instanceConfig) {
|
|
2037
1874
|
let component;
|
|
2038
1875
|
let instanceType;
|
|
2039
|
-
if (type === MessagingComponentType.Service) {
|
|
2040
|
-
initSchema$a();
|
|
2041
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
1876
|
+
if (instanceConfig.type === MessagingComponentType.Service) {
|
|
2042
1877
|
component = new MessagingService({
|
|
2043
|
-
messagingEmailConnectorType:
|
|
2044
|
-
messagingSmsConnectorType:
|
|
2045
|
-
messagingPushNotificationConnectorType:
|
|
1878
|
+
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
1879
|
+
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
1880
|
+
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
1881
|
+
messagingAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("messagingAdminComponent"),
|
|
2046
1882
|
...instanceConfig.options
|
|
2047
1883
|
});
|
|
2048
|
-
instanceType =
|
|
1884
|
+
instanceType = "messaging-service";
|
|
2049
1885
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
1886
|
+
return {
|
|
1887
|
+
component,
|
|
1888
|
+
instanceType,
|
|
1889
|
+
factory: ComponentFactory
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Initialise the messaging admin component.
|
|
1894
|
+
* @param engineCore The engine core.
|
|
1895
|
+
* @param context The context for the engine.
|
|
1896
|
+
* @param instanceConfig The instance config.
|
|
1897
|
+
* @returns The instance created and the factory for it.
|
|
1898
|
+
*/
|
|
1899
|
+
async function initialiseMessagingAdminComponent(engineCore, context, instanceConfig) {
|
|
1900
|
+
let component;
|
|
1901
|
+
let instanceType;
|
|
1902
|
+
if (instanceConfig.type === MessagingAdminComponentType.Service) {
|
|
1903
|
+
initSchema$c();
|
|
1904
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
1905
|
+
component = new MessagingAdminService({
|
|
1906
|
+
...instanceConfig.options
|
|
2054
1907
|
});
|
|
1908
|
+
instanceType = "messaging-admin-service";
|
|
2055
1909
|
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
1910
|
+
return {
|
|
1911
|
+
component,
|
|
1912
|
+
instanceType,
|
|
1913
|
+
factory: ComponentFactory
|
|
1914
|
+
};
|
|
2060
1915
|
}
|
|
2061
1916
|
|
|
2062
1917
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2100,91 +1955,69 @@ const NftConnectorType = {
|
|
|
2100
1955
|
* @param engineCore The engine core.
|
|
2101
1956
|
* @param context The context for the engine.
|
|
2102
1957
|
* @param instanceConfig The instance config.
|
|
2103
|
-
* @
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
function initialiseNftConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2108
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2109
|
-
element: `NFT Connector: ${instanceConfig.type}`
|
|
2110
|
-
}));
|
|
2111
|
-
const type = instanceConfig.type;
|
|
2112
|
-
let connector;
|
|
1958
|
+
* @returns The instance created and the factory for it.
|
|
1959
|
+
*/
|
|
1960
|
+
async function initialiseNftConnector(engineCore, context, instanceConfig) {
|
|
1961
|
+
let component;
|
|
2113
1962
|
let instanceType;
|
|
2114
|
-
if (type === NftConnectorType.EntityStorage) {
|
|
2115
|
-
initSchema$
|
|
1963
|
+
if (instanceConfig.type === NftConnectorType.EntityStorage) {
|
|
1964
|
+
initSchema$d();
|
|
2116
1965
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.nftEntityStorageType, "Nft");
|
|
2117
|
-
|
|
1966
|
+
component = new EntityStorageNftConnector(instanceConfig.options);
|
|
2118
1967
|
instanceType = EntityStorageNftConnector.NAMESPACE;
|
|
2119
1968
|
}
|
|
2120
|
-
else if (type === NftConnectorType.Iota) {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
1969
|
+
else if (instanceConfig.type === NftConnectorType.Iota) {
|
|
1970
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
1971
|
+
component = new IotaNftConnector({
|
|
1972
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1973
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
1974
|
+
loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
|
|
1975
|
+
...instanceConfig.options,
|
|
1976
|
+
config: {
|
|
1977
|
+
...dltConfig?.options?.config,
|
|
1978
|
+
...instanceConfig.options.config
|
|
1979
|
+
}
|
|
2125
1980
|
});
|
|
2126
1981
|
instanceType = IotaNftConnector.NAMESPACE;
|
|
2127
1982
|
}
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
}
|
|
2134
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2135
|
-
context.componentInstances.push({
|
|
2136
|
-
instanceType: finalInstanceType,
|
|
2137
|
-
component: connector
|
|
2138
|
-
});
|
|
2139
|
-
NftConnectorFactory.register(finalInstanceType, () => connector);
|
|
2140
|
-
return finalInstanceType;
|
|
1983
|
+
return {
|
|
1984
|
+
component,
|
|
1985
|
+
instanceType,
|
|
1986
|
+
factory: NftConnectorFactory
|
|
1987
|
+
};
|
|
2141
1988
|
}
|
|
2142
1989
|
/**
|
|
2143
1990
|
* Initialise the NFT component.
|
|
2144
1991
|
* @param engineCore The engine core.
|
|
2145
1992
|
* @param context The context for the engine.
|
|
2146
1993
|
* @param instanceConfig The instance config.
|
|
2147
|
-
* @
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
*/
|
|
2151
|
-
function initialiseNftComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2152
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2153
|
-
element: `Nft Storage Component: ${instanceConfig.type}`
|
|
2154
|
-
}));
|
|
2155
|
-
const type = instanceConfig.type;
|
|
1994
|
+
* @returns The instance created and the factory for it.
|
|
1995
|
+
*/
|
|
1996
|
+
async function initialiseNftComponent(engineCore, context, instanceConfig) {
|
|
2156
1997
|
let component;
|
|
2157
1998
|
let instanceType;
|
|
2158
|
-
if (type === NftComponentType.Service) {
|
|
1999
|
+
if (instanceConfig.type === NftComponentType.Service) {
|
|
2159
2000
|
component = new NftService(instanceConfig.options);
|
|
2160
|
-
instanceType =
|
|
2001
|
+
instanceType = "nft-service";
|
|
2161
2002
|
}
|
|
2162
|
-
else if (type === NftComponentType.RestClient) {
|
|
2003
|
+
else if (instanceConfig.type === NftComponentType.RestClient) {
|
|
2163
2004
|
component = new NftClient(instanceConfig.options);
|
|
2164
|
-
instanceType =
|
|
2165
|
-
}
|
|
2166
|
-
else {
|
|
2167
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2168
|
-
type,
|
|
2169
|
-
componentType: "nftComponent"
|
|
2170
|
-
});
|
|
2005
|
+
instanceType = "nft-client";
|
|
2171
2006
|
}
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
instanceType
|
|
2175
|
-
|
|
2176
|
-
}
|
|
2177
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2178
|
-
return finalInstanceType;
|
|
2007
|
+
return {
|
|
2008
|
+
component,
|
|
2009
|
+
instanceType,
|
|
2010
|
+
factory: ComponentFactory
|
|
2011
|
+
};
|
|
2179
2012
|
}
|
|
2180
2013
|
|
|
2181
2014
|
// Copyright 2024 IOTA Stiftung.
|
|
2182
2015
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2183
2016
|
/**
|
|
2184
|
-
* Rights management component types.
|
|
2017
|
+
* Rights management DAP component types.
|
|
2185
2018
|
*/
|
|
2186
2019
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2187
|
-
const
|
|
2020
|
+
const RightsManagementDapComponentType = {
|
|
2188
2021
|
/**
|
|
2189
2022
|
* Service.
|
|
2190
2023
|
*/
|
|
@@ -2198,45 +2031,80 @@ const RightsManagementComponentType = {
|
|
|
2198
2031
|
// Copyright 2024 IOTA Stiftung.
|
|
2199
2032
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2200
2033
|
/**
|
|
2201
|
-
* Initialise the rights management component.
|
|
2034
|
+
* Initialise the rights management DAP component.
|
|
2202
2035
|
* @param engineCore The engine core.
|
|
2203
2036
|
* @param context The context for the engine.
|
|
2204
2037
|
* @param instanceConfig The instance config.
|
|
2205
|
-
* @
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
*/
|
|
2209
|
-
function initialiseRightsManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2210
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2211
|
-
element: `Rights Management Component: ${instanceConfig.type}`
|
|
2212
|
-
}));
|
|
2213
|
-
const type = instanceConfig.type;
|
|
2038
|
+
* @returns The instance created and the factory for it.
|
|
2039
|
+
*/
|
|
2040
|
+
async function initialiseRightsManagementDapComponent(engineCore, context, instanceConfig) {
|
|
2214
2041
|
let component;
|
|
2215
2042
|
let instanceType;
|
|
2216
|
-
if (type ===
|
|
2217
|
-
component = new
|
|
2218
|
-
|
|
2219
|
-
|
|
2043
|
+
if (instanceConfig.type === RightsManagementDapComponentType.Service) {
|
|
2044
|
+
component = new DataAccessPointService({
|
|
2045
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2046
|
+
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
2047
|
+
...instanceConfig.options,
|
|
2048
|
+
config: {
|
|
2049
|
+
...instanceConfig.options?.config
|
|
2050
|
+
}
|
|
2220
2051
|
});
|
|
2221
|
-
instanceType =
|
|
2222
|
-
}
|
|
2223
|
-
else if (type === RightsManagementComponentType.RestClient) {
|
|
2224
|
-
component = new RightsManagementClient(instanceConfig.options);
|
|
2225
|
-
instanceType = StringHelper.kebabCase("RightsManagementClient");
|
|
2052
|
+
instanceType = "data-access-point-service";
|
|
2226
2053
|
}
|
|
2227
|
-
else {
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2054
|
+
else if (instanceConfig.type === RightsManagementDapComponentType.RestClient) {
|
|
2055
|
+
component = new DataAccessPointClient({
|
|
2056
|
+
...instanceConfig.options,
|
|
2057
|
+
authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
|
|
2058
|
+
engineCore.getRegisteredInstanceType("authenticationGeneratorComponent", [
|
|
2059
|
+
"verifiable-credential"
|
|
2060
|
+
])
|
|
2061
|
+
});
|
|
2062
|
+
instanceType = "data-access-point-client";
|
|
2063
|
+
}
|
|
2064
|
+
return {
|
|
2065
|
+
component,
|
|
2066
|
+
instanceType,
|
|
2067
|
+
factory: ComponentFactory
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2072
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2073
|
+
/**
|
|
2074
|
+
* Rights management DARP component types.
|
|
2075
|
+
*/
|
|
2076
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2077
|
+
const RightsManagementDarpComponentType = {
|
|
2078
|
+
/**
|
|
2079
|
+
* Service.
|
|
2080
|
+
*/
|
|
2081
|
+
Service: "service"
|
|
2082
|
+
};
|
|
2083
|
+
|
|
2084
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2085
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2086
|
+
/**
|
|
2087
|
+
* Initialise the rights management DARP component.
|
|
2088
|
+
* @param engineCore The engine core.
|
|
2089
|
+
* @param context The context for the engine.
|
|
2090
|
+
* @param instanceConfig The instance config.
|
|
2091
|
+
* @returns The instance created and the factory for it.
|
|
2092
|
+
*/
|
|
2093
|
+
async function initialiseRightsManagementDarpComponent(engineCore, context, instanceConfig) {
|
|
2094
|
+
let component;
|
|
2095
|
+
let instanceType;
|
|
2096
|
+
if (instanceConfig.type === RightsManagementDarpComponentType.Service) {
|
|
2097
|
+
component = new DataAccessRequestPointService({
|
|
2098
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2099
|
+
...instanceConfig.options
|
|
2231
2100
|
});
|
|
2101
|
+
instanceType = "data-access-request-point-service";
|
|
2232
2102
|
}
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
instanceType
|
|
2236
|
-
|
|
2237
|
-
}
|
|
2238
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2239
|
-
return finalInstanceType;
|
|
2103
|
+
return {
|
|
2104
|
+
component,
|
|
2105
|
+
instanceType,
|
|
2106
|
+
factory: ComponentFactory
|
|
2107
|
+
};
|
|
2240
2108
|
}
|
|
2241
2109
|
|
|
2242
2110
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2249,7 +2117,11 @@ const RightsManagementPapComponentType = {
|
|
|
2249
2117
|
/**
|
|
2250
2118
|
* Service.
|
|
2251
2119
|
*/
|
|
2252
|
-
Service: "service"
|
|
2120
|
+
Service: "service",
|
|
2121
|
+
/**
|
|
2122
|
+
* REST client.
|
|
2123
|
+
*/
|
|
2124
|
+
RestClient: "rest-client"
|
|
2253
2125
|
};
|
|
2254
2126
|
|
|
2255
2127
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2259,36 +2131,479 @@ const RightsManagementPapComponentType = {
|
|
|
2259
2131
|
* @param engineCore The engine core.
|
|
2260
2132
|
* @param context The context for the engine.
|
|
2261
2133
|
* @param instanceConfig The instance config.
|
|
2262
|
-
* @
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
*/
|
|
2266
|
-
function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2267
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2268
|
-
element: `Rights Management PAP Component: ${instanceConfig.type}`
|
|
2269
|
-
}));
|
|
2270
|
-
const type = instanceConfig.type;
|
|
2134
|
+
* @returns The instance created and the factory for it.
|
|
2135
|
+
*/
|
|
2136
|
+
async function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig) {
|
|
2271
2137
|
let component;
|
|
2272
2138
|
let instanceType;
|
|
2273
|
-
if (type === RightsManagementPapComponentType.Service) {
|
|
2274
|
-
initSchema$
|
|
2139
|
+
if (instanceConfig.type === RightsManagementPapComponentType.Service) {
|
|
2140
|
+
initSchema$e();
|
|
2275
2141
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
|
|
2276
|
-
component = new PolicyAdministrationPointService(
|
|
2277
|
-
|
|
2142
|
+
component = new PolicyAdministrationPointService({
|
|
2143
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2144
|
+
...instanceConfig.options
|
|
2145
|
+
});
|
|
2146
|
+
instanceType = "policy-administration-point-service";
|
|
2147
|
+
}
|
|
2148
|
+
else if (instanceConfig.type === RightsManagementPapComponentType.RestClient) {
|
|
2149
|
+
component = new PolicyAdministrationPointClient(instanceConfig.options);
|
|
2150
|
+
instanceType = "policy-administration-point-client";
|
|
2278
2151
|
}
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2152
|
+
return {
|
|
2153
|
+
component,
|
|
2154
|
+
instanceType,
|
|
2155
|
+
factory: ComponentFactory
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2160
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2161
|
+
/**
|
|
2162
|
+
* Rights management PDP component types.
|
|
2163
|
+
*/
|
|
2164
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2165
|
+
const RightsManagementPdpComponentType = {
|
|
2166
|
+
/**
|
|
2167
|
+
* Service.
|
|
2168
|
+
*/
|
|
2169
|
+
Service: "service"
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2173
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2174
|
+
/**
|
|
2175
|
+
* Initialise the rights management PDP component.
|
|
2176
|
+
* @param engineCore The engine core.
|
|
2177
|
+
* @param context The context for the engine.
|
|
2178
|
+
* @param instanceConfig The instance config.
|
|
2179
|
+
* @returns The instance created and the factory for it.
|
|
2180
|
+
*/
|
|
2181
|
+
async function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig) {
|
|
2182
|
+
let component;
|
|
2183
|
+
let instanceType;
|
|
2184
|
+
if (instanceConfig.type === RightsManagementPdpComponentType.Service) {
|
|
2185
|
+
const arbiterModules = [];
|
|
2186
|
+
if (Is.arrayValue(instanceConfig.options?.arbiterModulesConfig)) {
|
|
2187
|
+
for (const moduleConfig of instanceConfig.options.arbiterModulesConfig) {
|
|
2188
|
+
arbiterModules.push({
|
|
2189
|
+
arbiterId: moduleConfig.id,
|
|
2190
|
+
arbiter: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2191
|
+
});
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
component = new PolicyDecisionPointService({
|
|
2195
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2196
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2197
|
+
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2198
|
+
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2199
|
+
...instanceConfig.options,
|
|
2200
|
+
config: {
|
|
2201
|
+
...instanceConfig.options?.config,
|
|
2202
|
+
arbiters: instanceConfig.options?.config?.arbiters ?? arbiterModules
|
|
2203
|
+
}
|
|
2283
2204
|
});
|
|
2205
|
+
instanceType = "policy-decision-point-service";
|
|
2284
2206
|
}
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
instanceType
|
|
2288
|
-
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2207
|
+
return {
|
|
2208
|
+
component,
|
|
2209
|
+
instanceType,
|
|
2210
|
+
factory: ComponentFactory
|
|
2211
|
+
};
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2215
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2216
|
+
/**
|
|
2217
|
+
* Rights management PEP component types.
|
|
2218
|
+
*/
|
|
2219
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2220
|
+
const RightsManagementPepComponentType = {
|
|
2221
|
+
/**
|
|
2222
|
+
* Service.
|
|
2223
|
+
*/
|
|
2224
|
+
Service: "service",
|
|
2225
|
+
/**
|
|
2226
|
+
* REST client.
|
|
2227
|
+
*/
|
|
2228
|
+
RestClient: "rest-client"
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2232
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2233
|
+
/**
|
|
2234
|
+
* Initialise the rights management PEP component.
|
|
2235
|
+
* @param engineCore The engine core.
|
|
2236
|
+
* @param context The context for the engine.
|
|
2237
|
+
* @param instanceConfig The instance config.
|
|
2238
|
+
* @returns The instance created and the factory for it.
|
|
2239
|
+
*/
|
|
2240
|
+
async function initialiseRightsManagementPepComponent(engineCore, context, instanceConfig) {
|
|
2241
|
+
let component;
|
|
2242
|
+
let instanceType;
|
|
2243
|
+
if (instanceConfig.type === RightsManagementPepComponentType.Service) {
|
|
2244
|
+
const processorModules = [];
|
|
2245
|
+
if (Is.arrayValue(instanceConfig.options?.processorModulesConfig)) {
|
|
2246
|
+
for (const moduleConfig of instanceConfig.options.processorModulesConfig) {
|
|
2247
|
+
processorModules.push({
|
|
2248
|
+
processorId: moduleConfig.id,
|
|
2249
|
+
processor: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
component = new PolicyEnforcementPointService({
|
|
2254
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2255
|
+
policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
|
|
2256
|
+
...instanceConfig.options,
|
|
2257
|
+
config: {
|
|
2258
|
+
...instanceConfig.options?.config,
|
|
2259
|
+
processors: instanceConfig.options?.config?.processors ?? processorModules
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
instanceType = "policy-enforcement-point-service";
|
|
2263
|
+
}
|
|
2264
|
+
return {
|
|
2265
|
+
component,
|
|
2266
|
+
instanceType,
|
|
2267
|
+
factory: ComponentFactory
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2272
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2273
|
+
/**
|
|
2274
|
+
* Rights management PIP component types.
|
|
2275
|
+
*/
|
|
2276
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2277
|
+
const RightsManagementPipComponentType = {
|
|
2278
|
+
/**
|
|
2279
|
+
* Service.
|
|
2280
|
+
*/
|
|
2281
|
+
Service: "service"
|
|
2282
|
+
};
|
|
2283
|
+
|
|
2284
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2285
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2286
|
+
/**
|
|
2287
|
+
* Initialise the rights management PIP component.
|
|
2288
|
+
* @param engineCore The engine core.
|
|
2289
|
+
* @param context The context for the engine.
|
|
2290
|
+
* @param instanceConfig The instance config.
|
|
2291
|
+
* @returns The instance created and the factory for it.
|
|
2292
|
+
*/
|
|
2293
|
+
async function initialiseRightsManagementPipComponent(engineCore, context, instanceConfig) {
|
|
2294
|
+
let component;
|
|
2295
|
+
let instanceType;
|
|
2296
|
+
if (instanceConfig.type === RightsManagementPipComponentType.Service) {
|
|
2297
|
+
const informationSourceModules = [];
|
|
2298
|
+
if (Is.arrayValue(instanceConfig.options?.informationModulesConfig)) {
|
|
2299
|
+
for (const moduleConfig of instanceConfig.options.informationModulesConfig) {
|
|
2300
|
+
informationSourceModules.push({
|
|
2301
|
+
sourceId: moduleConfig.id,
|
|
2302
|
+
source: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2303
|
+
});
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
component = new PolicyInformationPointService({
|
|
2307
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2308
|
+
...instanceConfig.options,
|
|
2309
|
+
config: {
|
|
2310
|
+
...instanceConfig.options?.config,
|
|
2311
|
+
sources: instanceConfig.options?.config?.sources ?? informationSourceModules
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
|
+
instanceType = "policy-information-point-service";
|
|
2315
|
+
}
|
|
2316
|
+
return {
|
|
2317
|
+
component,
|
|
2318
|
+
instanceType,
|
|
2319
|
+
factory: ComponentFactory
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2324
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2325
|
+
/**
|
|
2326
|
+
* Rights management PMP component types.
|
|
2327
|
+
*/
|
|
2328
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2329
|
+
const RightsManagementPmpComponentType = {
|
|
2330
|
+
/**
|
|
2331
|
+
* Service.
|
|
2332
|
+
*/
|
|
2333
|
+
Service: "service"
|
|
2334
|
+
};
|
|
2335
|
+
|
|
2336
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2337
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2338
|
+
/**
|
|
2339
|
+
* Initialise the rights management PMP component.
|
|
2340
|
+
* @param engineCore The engine core.
|
|
2341
|
+
* @param context The context for the engine.
|
|
2342
|
+
* @param instanceConfig The instance config.
|
|
2343
|
+
* @returns The instance created and the factory for it.
|
|
2344
|
+
*/
|
|
2345
|
+
async function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig) {
|
|
2346
|
+
let component;
|
|
2347
|
+
let instanceType;
|
|
2348
|
+
if (instanceConfig.type === RightsManagementPmpComponentType.Service) {
|
|
2349
|
+
component = new PolicyManagementPointService({
|
|
2350
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2351
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2352
|
+
...instanceConfig.options
|
|
2353
|
+
});
|
|
2354
|
+
instanceType = "policy-management-point-service";
|
|
2355
|
+
}
|
|
2356
|
+
return {
|
|
2357
|
+
component,
|
|
2358
|
+
instanceType,
|
|
2359
|
+
factory: ComponentFactory
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2364
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2365
|
+
/**
|
|
2366
|
+
* Rights management PNAP component types.
|
|
2367
|
+
*/
|
|
2368
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2369
|
+
const RightsManagementPnapComponentType = {
|
|
2370
|
+
/**
|
|
2371
|
+
* Service.
|
|
2372
|
+
*/
|
|
2373
|
+
Service: "service",
|
|
2374
|
+
/**
|
|
2375
|
+
* REST client.
|
|
2376
|
+
*/
|
|
2377
|
+
RestClient: "rest-client"
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2380
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2381
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2382
|
+
/**
|
|
2383
|
+
* Initialise the rights management PNAP component.
|
|
2384
|
+
* @param engineCore The engine core.
|
|
2385
|
+
* @param context The context for the engine.
|
|
2386
|
+
* @param instanceConfig The instance config.
|
|
2387
|
+
* @returns The instance created and the factory for it.
|
|
2388
|
+
*/
|
|
2389
|
+
async function initialiseRightsManagementPnapComponent(engineCore, context, instanceConfig) {
|
|
2390
|
+
let component;
|
|
2391
|
+
let instanceType;
|
|
2392
|
+
if (instanceConfig.type === RightsManagementPnapComponentType.Service) {
|
|
2393
|
+
initSchema$f();
|
|
2394
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.policyNegotiationEntityStorageType, "PolicyNegotiation");
|
|
2395
|
+
component = new PolicyNegotiationAdminPointService({
|
|
2396
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2397
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2398
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2399
|
+
...instanceConfig.options
|
|
2400
|
+
});
|
|
2401
|
+
instanceType = "policy-negotiation-admin-point-service";
|
|
2402
|
+
}
|
|
2403
|
+
else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {
|
|
2404
|
+
component = new PolicyNegotiationAdminPointClient(instanceConfig.options);
|
|
2405
|
+
instanceType = "policy-negotiation-admin-point-client";
|
|
2406
|
+
}
|
|
2407
|
+
return {
|
|
2408
|
+
component,
|
|
2409
|
+
instanceType,
|
|
2410
|
+
factory: ComponentFactory
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2415
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2416
|
+
/**
|
|
2417
|
+
* Rights management PNP component types.
|
|
2418
|
+
*/
|
|
2419
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2420
|
+
const RightsManagementPnpComponentType = {
|
|
2421
|
+
/**
|
|
2422
|
+
* Service.
|
|
2423
|
+
*/
|
|
2424
|
+
Service: "service",
|
|
2425
|
+
/**
|
|
2426
|
+
* REST client.
|
|
2427
|
+
*/
|
|
2428
|
+
RestClient: "rest-client"
|
|
2429
|
+
};
|
|
2430
|
+
|
|
2431
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2432
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2433
|
+
/**
|
|
2434
|
+
* Initialise the rights management PNP component.
|
|
2435
|
+
* @param engineCore The engine core.
|
|
2436
|
+
* @param context The context for the engine.
|
|
2437
|
+
* @param instanceConfig The instance config.
|
|
2438
|
+
* @returns The instance created and the factory for it.
|
|
2439
|
+
*/
|
|
2440
|
+
async function initialiseRightsManagementPnpComponent(engineCore, context, instanceConfig) {
|
|
2441
|
+
let component;
|
|
2442
|
+
let instanceType;
|
|
2443
|
+
if (instanceConfig.type === RightsManagementPnpComponentType.Service) {
|
|
2444
|
+
const negotiatorModules = [];
|
|
2445
|
+
if (Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {
|
|
2446
|
+
for (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {
|
|
2447
|
+
negotiatorModules.push({
|
|
2448
|
+
negotiatorId: moduleConfig.id,
|
|
2449
|
+
negotiator: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
const requesterModules = [];
|
|
2454
|
+
if (Is.arrayValue(instanceConfig.options?.requesterModulesConfig)) {
|
|
2455
|
+
for (const moduleConfig of instanceConfig.options.requesterModulesConfig) {
|
|
2456
|
+
requesterModules.push({
|
|
2457
|
+
requesterId: moduleConfig.id,
|
|
2458
|
+
requester: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
component = new PolicyNegotiationPointService({
|
|
2463
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2464
|
+
policyNegotiationAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPnapComponent"),
|
|
2465
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2466
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2467
|
+
...instanceConfig.options,
|
|
2468
|
+
config: {
|
|
2469
|
+
...instanceConfig.options?.config,
|
|
2470
|
+
negotiators: instanceConfig.options?.config?.negotiators ?? negotiatorModules,
|
|
2471
|
+
requesters: instanceConfig.options?.config?.requesters ?? requesterModules
|
|
2472
|
+
}
|
|
2473
|
+
});
|
|
2474
|
+
instanceType = "policy-negotiation-point-service";
|
|
2475
|
+
}
|
|
2476
|
+
else if (instanceConfig.type === RightsManagementPnpComponentType.RestClient) {
|
|
2477
|
+
component = new PolicyNegotiationPointClient({
|
|
2478
|
+
...instanceConfig.options,
|
|
2479
|
+
authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
|
|
2480
|
+
engineCore.getRegisteredInstanceType("authenticationGeneratorComponent", [
|
|
2481
|
+
"verifiable-credential"
|
|
2482
|
+
])
|
|
2483
|
+
});
|
|
2484
|
+
instanceType = "policy-negotiation-point-client";
|
|
2485
|
+
}
|
|
2486
|
+
return {
|
|
2487
|
+
component,
|
|
2488
|
+
instanceType,
|
|
2489
|
+
factory: ComponentFactory
|
|
2490
|
+
};
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2494
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2495
|
+
/**
|
|
2496
|
+
* Rights management PXP component types.
|
|
2497
|
+
*/
|
|
2498
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2499
|
+
const RightsManagementPxpComponentType = {
|
|
2500
|
+
/**
|
|
2501
|
+
* Service.
|
|
2502
|
+
*/
|
|
2503
|
+
Service: "service"
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2507
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2508
|
+
/**
|
|
2509
|
+
* Initialise the rights management PXP component.
|
|
2510
|
+
* @param engineCore The engine core.
|
|
2511
|
+
* @param context The context for the engine.
|
|
2512
|
+
* @param instanceConfig The instance config.
|
|
2513
|
+
* @returns The instance created and the factory for it.
|
|
2514
|
+
*/
|
|
2515
|
+
async function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig) {
|
|
2516
|
+
let component;
|
|
2517
|
+
let instanceType;
|
|
2518
|
+
if (instanceConfig.type === RightsManagementPxpComponentType.Service) {
|
|
2519
|
+
const modules = [];
|
|
2520
|
+
if (Is.arrayValue(instanceConfig.options?.actionModulesConfig)) {
|
|
2521
|
+
for (const moduleConfig of instanceConfig.options.actionModulesConfig) {
|
|
2522
|
+
modules.push({
|
|
2523
|
+
actionId: moduleConfig.id,
|
|
2524
|
+
action: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
component = new PolicyExecutionPointService({
|
|
2529
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2530
|
+
...instanceConfig.options,
|
|
2531
|
+
config: {
|
|
2532
|
+
...instanceConfig.options?.config,
|
|
2533
|
+
actions: instanceConfig.options?.config?.actions ?? modules
|
|
2534
|
+
}
|
|
2535
|
+
});
|
|
2536
|
+
instanceType = "policy-execution-point-service";
|
|
2537
|
+
}
|
|
2538
|
+
return {
|
|
2539
|
+
component,
|
|
2540
|
+
instanceType,
|
|
2541
|
+
factory: ComponentFactory
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2546
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2547
|
+
/**
|
|
2548
|
+
* Synchronised storage component types.
|
|
2549
|
+
*/
|
|
2550
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2551
|
+
const SynchronisedStorageComponentType = {
|
|
2552
|
+
/**
|
|
2553
|
+
* Service.
|
|
2554
|
+
*/
|
|
2555
|
+
Service: "service",
|
|
2556
|
+
/**
|
|
2557
|
+
* REST client.
|
|
2558
|
+
*/
|
|
2559
|
+
RestClient: "rest-client"
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2562
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2563
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2564
|
+
/**
|
|
2565
|
+
* Initialise the synchronised storage component.
|
|
2566
|
+
* @param engineCore The engine core.
|
|
2567
|
+
* @param context The context for the engine.
|
|
2568
|
+
* @param instanceConfig The instance config.
|
|
2569
|
+
* @returns The instance created and the factory for it.
|
|
2570
|
+
*/
|
|
2571
|
+
async function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig) {
|
|
2572
|
+
let component;
|
|
2573
|
+
let instanceType;
|
|
2574
|
+
if (instanceConfig.type === SynchronisedStorageComponentType.Service) {
|
|
2575
|
+
initSchema$g();
|
|
2576
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
|
|
2577
|
+
component = new SynchronisedStorageService({
|
|
2578
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2579
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
2580
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2581
|
+
verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
2582
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2583
|
+
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceTypeOptional("rightsManagementPepComponent"),
|
|
2584
|
+
trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
|
|
2585
|
+
blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
|
|
2586
|
+
"public"
|
|
2587
|
+
]),
|
|
2588
|
+
...instanceConfig.options
|
|
2589
|
+
});
|
|
2590
|
+
instanceType = "synchronised-storage-service";
|
|
2591
|
+
}
|
|
2592
|
+
else if (instanceConfig.type === SynchronisedStorageComponentType.RestClient) {
|
|
2593
|
+
component = new SynchronisedStorageClient({
|
|
2594
|
+
...instanceConfig.options,
|
|
2595
|
+
authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
|
|
2596
|
+
engineCore.getRegisteredInstanceType("authenticationGeneratorComponent", [
|
|
2597
|
+
"verifiable-credential"
|
|
2598
|
+
])
|
|
2599
|
+
});
|
|
2600
|
+
instanceType = "synchronised-storage-client";
|
|
2601
|
+
}
|
|
2602
|
+
return {
|
|
2603
|
+
component,
|
|
2604
|
+
instanceType,
|
|
2605
|
+
factory: ComponentFactory
|
|
2606
|
+
};
|
|
2292
2607
|
}
|
|
2293
2608
|
|
|
2294
2609
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2309,37 +2624,23 @@ const TaskSchedulerComponentType = {
|
|
|
2309
2624
|
* @param engineCore The engine core.
|
|
2310
2625
|
* @param context The context for the engine.
|
|
2311
2626
|
* @param instanceConfig The instance config.
|
|
2312
|
-
* @
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
*/
|
|
2316
|
-
function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2317
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2318
|
-
element: `Task Scheduler: ${instanceConfig.type}`
|
|
2319
|
-
}));
|
|
2320
|
-
const type = instanceConfig.type;
|
|
2627
|
+
* @returns The instance created and the factory for it.
|
|
2628
|
+
*/
|
|
2629
|
+
async function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig) {
|
|
2321
2630
|
let component;
|
|
2322
2631
|
let instanceType;
|
|
2323
|
-
if (type === TaskSchedulerComponentType.Service) {
|
|
2632
|
+
if (instanceConfig.type === TaskSchedulerComponentType.Service) {
|
|
2324
2633
|
component = new TaskSchedulerService({
|
|
2325
|
-
|
|
2634
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2326
2635
|
...instanceConfig.options
|
|
2327
2636
|
});
|
|
2328
|
-
instanceType =
|
|
2329
|
-
}
|
|
2330
|
-
else {
|
|
2331
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2332
|
-
type,
|
|
2333
|
-
componentType: "taskSchedulerComponent"
|
|
2334
|
-
});
|
|
2637
|
+
instanceType = "task-scheduler-service";
|
|
2335
2638
|
}
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
instanceType
|
|
2339
|
-
|
|
2340
|
-
}
|
|
2341
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2342
|
-
return finalInstanceType;
|
|
2639
|
+
return {
|
|
2640
|
+
component,
|
|
2641
|
+
instanceType,
|
|
2642
|
+
factory: ComponentFactory
|
|
2643
|
+
};
|
|
2343
2644
|
}
|
|
2344
2645
|
|
|
2345
2646
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2379,75 +2680,53 @@ const TelemetryConnectorType = {
|
|
|
2379
2680
|
* @param engineCore The engine core.
|
|
2380
2681
|
* @param context The context for the engine.
|
|
2381
2682
|
* @param instanceConfig The instance config.
|
|
2382
|
-
* @
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
function initialiseTelemetryConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2387
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2388
|
-
element: `Telemetry Connector: ${instanceConfig.type}`
|
|
2389
|
-
}));
|
|
2390
|
-
const type = instanceConfig.type;
|
|
2391
|
-
let connector;
|
|
2683
|
+
* @returns The instance created and the factory for it.
|
|
2684
|
+
*/
|
|
2685
|
+
async function initialiseTelemetryConnector(engineCore, context, instanceConfig) {
|
|
2686
|
+
let component;
|
|
2392
2687
|
let instanceType;
|
|
2393
|
-
if (type === TelemetryConnectorType.EntityStorage) {
|
|
2394
|
-
initSchema$
|
|
2688
|
+
if (instanceConfig.type === TelemetryConnectorType.EntityStorage) {
|
|
2689
|
+
initSchema$h();
|
|
2395
2690
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
|
|
2396
2691
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
|
|
2397
|
-
|
|
2398
|
-
|
|
2692
|
+
component = new EntityStorageTelemetryConnector({
|
|
2693
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2399
2694
|
...instanceConfig.options
|
|
2400
2695
|
});
|
|
2401
2696
|
instanceType = EntityStorageTelemetryConnector.NAMESPACE;
|
|
2402
2697
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
}
|
|
2409
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2410
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2411
|
-
TelemetryConnectorFactory.register(finalInstanceType, () => connector);
|
|
2412
|
-
return finalInstanceType;
|
|
2698
|
+
return {
|
|
2699
|
+
instanceType,
|
|
2700
|
+
factory: TelemetryConnectorFactory,
|
|
2701
|
+
component
|
|
2702
|
+
};
|
|
2413
2703
|
}
|
|
2414
2704
|
/**
|
|
2415
2705
|
* Initialise the telemetry component.
|
|
2416
2706
|
* @param engineCore The engine core.
|
|
2417
2707
|
* @param context The context for the engine.
|
|
2418
2708
|
* @param instanceConfig The instance config.
|
|
2419
|
-
* @
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
*/
|
|
2423
|
-
function initialiseTelemetryComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2424
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2425
|
-
element: `Telemetry Component: ${instanceConfig.type}`
|
|
2426
|
-
}));
|
|
2427
|
-
const type = instanceConfig.type;
|
|
2709
|
+
* @returns The instance created and the factory for it.
|
|
2710
|
+
*/
|
|
2711
|
+
async function initialiseTelemetryComponent(engineCore, context, instanceConfig) {
|
|
2428
2712
|
let component;
|
|
2429
2713
|
let instanceType;
|
|
2430
|
-
if (type === TelemetryComponentType.Service) {
|
|
2714
|
+
if (instanceConfig.type === TelemetryComponentType.Service) {
|
|
2431
2715
|
component = new TelemetryService({
|
|
2432
|
-
telemetryConnectorType:
|
|
2716
|
+
telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
|
|
2433
2717
|
...instanceConfig.options
|
|
2434
2718
|
});
|
|
2435
|
-
instanceType =
|
|
2719
|
+
instanceType = "telemetry-service";
|
|
2436
2720
|
}
|
|
2437
|
-
else if (type === TelemetryComponentType.RestClient) {
|
|
2721
|
+
else if (instanceConfig.type === TelemetryComponentType.RestClient) {
|
|
2438
2722
|
component = new TelemetryClient(instanceConfig.options);
|
|
2439
|
-
instanceType =
|
|
2440
|
-
}
|
|
2441
|
-
else {
|
|
2442
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2443
|
-
type,
|
|
2444
|
-
componentType: "telemetryComponent"
|
|
2445
|
-
});
|
|
2723
|
+
instanceType = "telemetry-client";
|
|
2446
2724
|
}
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2725
|
+
return {
|
|
2726
|
+
component,
|
|
2727
|
+
instanceType,
|
|
2728
|
+
factory: ComponentFactory
|
|
2729
|
+
};
|
|
2451
2730
|
}
|
|
2452
2731
|
|
|
2453
2732
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2467,45 +2746,32 @@ const VaultConnectorType = {
|
|
|
2467
2746
|
Hashicorp: "hashicorp"
|
|
2468
2747
|
};
|
|
2469
2748
|
|
|
2470
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2471
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2472
2749
|
/**
|
|
2473
2750
|
* Initialise the vault connector.
|
|
2474
2751
|
* @param engineCore The engine core.
|
|
2475
2752
|
* @param context The context for the engine.
|
|
2476
2753
|
* @param instanceConfig The instance config.
|
|
2477
|
-
* @
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
function initialiseVaultConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2482
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2483
|
-
element: `Vault Connector: ${instanceConfig.type}`
|
|
2484
|
-
}));
|
|
2485
|
-
const type = instanceConfig.type;
|
|
2486
|
-
let connector;
|
|
2754
|
+
* @returns The instance created and the factory for it.
|
|
2755
|
+
*/
|
|
2756
|
+
async function initialiseVaultConnector(engineCore, context, instanceConfig) {
|
|
2757
|
+
let component;
|
|
2487
2758
|
let instanceType;
|
|
2488
|
-
if (type === VaultConnectorType.EntityStorage) {
|
|
2489
|
-
initSchema$
|
|
2759
|
+
if (instanceConfig.type === VaultConnectorType.EntityStorage) {
|
|
2760
|
+
initSchema$i();
|
|
2490
2761
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
|
|
2491
2762
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
|
|
2492
|
-
|
|
2763
|
+
component = new EntityStorageVaultConnector(instanceConfig.options);
|
|
2493
2764
|
instanceType = EntityStorageVaultConnector.NAMESPACE;
|
|
2494
2765
|
}
|
|
2495
|
-
else if (type === VaultConnectorType.Hashicorp) {
|
|
2496
|
-
|
|
2766
|
+
else if (instanceConfig.type === VaultConnectorType.Hashicorp) {
|
|
2767
|
+
component = new HashicorpVaultConnector(instanceConfig.options);
|
|
2497
2768
|
instanceType = HashicorpVaultConnector.NAMESPACE;
|
|
2498
2769
|
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
}
|
|
2505
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2506
|
-
context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
|
|
2507
|
-
VaultConnectorFactory.register(finalInstanceType, () => connector);
|
|
2508
|
-
return finalInstanceType;
|
|
2770
|
+
return {
|
|
2771
|
+
component,
|
|
2772
|
+
instanceType,
|
|
2773
|
+
factory: VaultConnectorFactory
|
|
2774
|
+
};
|
|
2509
2775
|
}
|
|
2510
2776
|
|
|
2511
2777
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2549,21 +2815,16 @@ const VerifiableStorageConnectorType = {
|
|
|
2549
2815
|
* @param engineCore The engine core.
|
|
2550
2816
|
* @param context The context for the engine.
|
|
2551
2817
|
* @param instanceConfig The instance config.
|
|
2552
|
-
* @
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2557
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2558
|
-
element: `Verifiable Storage Connector: ${instanceConfig.type}`
|
|
2559
|
-
}));
|
|
2560
|
-
const type = instanceConfig.type;
|
|
2561
|
-
let connector;
|
|
2818
|
+
* @returns The instance created and the factory for it.
|
|
2819
|
+
*/
|
|
2820
|
+
async function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig) {
|
|
2821
|
+
let component;
|
|
2562
2822
|
let instanceType;
|
|
2563
|
-
if (type === VerifiableStorageConnectorType.Iota) {
|
|
2564
|
-
const dltConfig =
|
|
2565
|
-
|
|
2566
|
-
vaultConnectorType:
|
|
2823
|
+
if (instanceConfig.type === VerifiableStorageConnectorType.Iota) {
|
|
2824
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
2825
|
+
component = new IotaVerifiableStorageConnector({
|
|
2826
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2827
|
+
loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
|
|
2567
2828
|
...instanceConfig.options,
|
|
2568
2829
|
config: {
|
|
2569
2830
|
...dltConfig?.options?.config,
|
|
@@ -2572,65 +2833,43 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2572
2833
|
});
|
|
2573
2834
|
instanceType = IotaVerifiableStorageConnector.NAMESPACE;
|
|
2574
2835
|
}
|
|
2575
|
-
else if (type === VerifiableStorageConnectorType.EntityStorage) {
|
|
2576
|
-
initSchema$
|
|
2836
|
+
else if (instanceConfig.type === VerifiableStorageConnectorType.EntityStorage) {
|
|
2837
|
+
initSchema$j();
|
|
2577
2838
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
|
|
2578
|
-
|
|
2839
|
+
component = new EntityStorageVerifiableStorageConnector(instanceConfig.options);
|
|
2579
2840
|
instanceType = EntityStorageVerifiableStorageConnector.NAMESPACE;
|
|
2580
2841
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
}
|
|
2587
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2588
|
-
context.componentInstances.push({
|
|
2589
|
-
instanceType: finalInstanceType,
|
|
2590
|
-
component: connector
|
|
2591
|
-
});
|
|
2592
|
-
VerifiableStorageConnectorFactory.register(finalInstanceType, () => connector);
|
|
2593
|
-
return finalInstanceType;
|
|
2842
|
+
return {
|
|
2843
|
+
component,
|
|
2844
|
+
instanceType,
|
|
2845
|
+
factory: VerifiableStorageConnectorFactory
|
|
2846
|
+
};
|
|
2594
2847
|
}
|
|
2595
2848
|
/**
|
|
2596
2849
|
* Initialise the verifiable storage component.
|
|
2597
2850
|
* @param engineCore The engine core.
|
|
2598
2851
|
* @param context The context for the engine.
|
|
2599
2852
|
* @param instanceConfig The instance config.
|
|
2600
|
-
* @
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
*/
|
|
2604
|
-
function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2605
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2606
|
-
element: `Verifiable Storage Component: ${instanceConfig.type}`
|
|
2607
|
-
}));
|
|
2608
|
-
const type = instanceConfig.type;
|
|
2853
|
+
* @returns The instance created and the factory for it.
|
|
2854
|
+
*/
|
|
2855
|
+
async function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig) {
|
|
2609
2856
|
let component;
|
|
2610
2857
|
let instanceType;
|
|
2611
|
-
if (type === VerifiableStorageComponentType.Service) {
|
|
2858
|
+
if (instanceConfig.type === VerifiableStorageComponentType.Service) {
|
|
2612
2859
|
component = new VerifiableStorageService({
|
|
2613
2860
|
...instanceConfig.options
|
|
2614
2861
|
});
|
|
2615
|
-
instanceType =
|
|
2862
|
+
instanceType = "verifiable-storage-service";
|
|
2616
2863
|
}
|
|
2617
|
-
else if (type === VerifiableStorageComponentType.RestClient) {
|
|
2864
|
+
else if (instanceConfig.type === VerifiableStorageComponentType.RestClient) {
|
|
2618
2865
|
component = new VerifiableStorageClient(instanceConfig.options);
|
|
2619
|
-
instanceType =
|
|
2620
|
-
}
|
|
2621
|
-
else {
|
|
2622
|
-
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2623
|
-
type,
|
|
2624
|
-
componentType: "verifiableStorageComponent"
|
|
2625
|
-
});
|
|
2866
|
+
instanceType = "verifiable-storage-client";
|
|
2626
2867
|
}
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
instanceType
|
|
2630
|
-
|
|
2631
|
-
}
|
|
2632
|
-
ComponentFactory.register(finalInstanceType, () => component);
|
|
2633
|
-
return finalInstanceType;
|
|
2868
|
+
return {
|
|
2869
|
+
component,
|
|
2870
|
+
instanceType,
|
|
2871
|
+
factory: ComponentFactory
|
|
2872
|
+
};
|
|
2634
2873
|
}
|
|
2635
2874
|
|
|
2636
2875
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2650,29 +2889,21 @@ const WalletConnectorType = {
|
|
|
2650
2889
|
Iota: "iota"
|
|
2651
2890
|
};
|
|
2652
2891
|
|
|
2653
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2654
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2655
2892
|
/**
|
|
2656
2893
|
* Initialise a wallet connector.
|
|
2657
2894
|
* @param engineCore The engine core.
|
|
2658
2895
|
* @param context The context for the node.
|
|
2659
2896
|
* @param instanceConfig The instance config.
|
|
2660
|
-
* @
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
function initialiseWalletConnector(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2665
|
-
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2666
|
-
element: `Wallet Connector: ${instanceConfig.type}`
|
|
2667
|
-
}));
|
|
2668
|
-
const type = instanceConfig.type;
|
|
2669
|
-
let connector;
|
|
2897
|
+
* @returns The instance created and the factory for it.
|
|
2898
|
+
*/
|
|
2899
|
+
async function initialiseWalletConnector(engineCore, context, instanceConfig) {
|
|
2900
|
+
let component;
|
|
2670
2901
|
let instanceType;
|
|
2671
|
-
if (type === WalletConnectorType.Iota) {
|
|
2672
|
-
const dltConfig =
|
|
2673
|
-
|
|
2674
|
-
vaultConnectorType:
|
|
2675
|
-
faucetConnectorType:
|
|
2902
|
+
if (instanceConfig.type === WalletConnectorType.Iota) {
|
|
2903
|
+
const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
|
|
2904
|
+
component = new IotaWalletConnector({
|
|
2905
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2906
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2676
2907
|
...instanceConfig.options,
|
|
2677
2908
|
config: {
|
|
2678
2909
|
...dltConfig?.options?.config,
|
|
@@ -2681,64 +2912,21 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2681
2912
|
});
|
|
2682
2913
|
instanceType = IotaWalletConnector.NAMESPACE;
|
|
2683
2914
|
}
|
|
2684
|
-
else if (type === WalletConnectorType.EntityStorage) {
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2915
|
+
else if (instanceConfig.type === WalletConnectorType.EntityStorage) {
|
|
2916
|
+
initSchema$6();
|
|
2917
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
2918
|
+
component = new EntityStorageWalletConnector({
|
|
2919
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2920
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2688
2921
|
...instanceConfig.options
|
|
2689
2922
|
});
|
|
2690
2923
|
instanceType = EntityStorageWalletConnector.NAMESPACE;
|
|
2691
2924
|
}
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
}
|
|
2698
|
-
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2699
|
-
context.componentInstances.push({
|
|
2700
|
-
instanceType: finalInstanceType,
|
|
2701
|
-
component: connector
|
|
2702
|
-
});
|
|
2703
|
-
WalletConnectorFactory.register(finalInstanceType, () => connector);
|
|
2704
|
-
return finalInstanceType;
|
|
2705
|
-
}
|
|
2706
|
-
/**
|
|
2707
|
-
* Initialise the wallet storage.
|
|
2708
|
-
* @param engineCore The engine core.
|
|
2709
|
-
* @param context The context for the engine.
|
|
2710
|
-
* @param instanceConfig The instance config.
|
|
2711
|
-
* @param overrideInstanceType The instance type to override the default.
|
|
2712
|
-
* @returns Nothing.
|
|
2713
|
-
* @throws GeneralError if the connector type is unknown.
|
|
2714
|
-
*/
|
|
2715
|
-
function initialiseWalletStorage(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2716
|
-
const type = instanceConfig.type;
|
|
2717
|
-
if (type === WalletConnectorType.Iota) ;
|
|
2718
|
-
else if (type === WalletConnectorType.EntityStorage) {
|
|
2719
|
-
initSchema$g();
|
|
2720
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
2721
|
-
}
|
|
2722
|
-
else {
|
|
2723
|
-
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
2724
|
-
type,
|
|
2725
|
-
connectorType: "walletConnector"
|
|
2726
|
-
});
|
|
2727
|
-
}
|
|
2728
|
-
return undefined;
|
|
2925
|
+
return {
|
|
2926
|
+
component,
|
|
2927
|
+
instanceType,
|
|
2928
|
+
factory: WalletConnectorFactory
|
|
2929
|
+
};
|
|
2729
2930
|
}
|
|
2730
2931
|
|
|
2731
|
-
|
|
2732
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
2733
|
-
/**
|
|
2734
|
-
* DLT config types.
|
|
2735
|
-
*/
|
|
2736
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2737
|
-
const DltConfigType = {
|
|
2738
|
-
/**
|
|
2739
|
-
* IOTA.
|
|
2740
|
-
*/
|
|
2741
|
-
Iota: "iota"
|
|
2742
|
-
};
|
|
2743
|
-
|
|
2744
|
-
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, 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, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector, initialiseWalletStorage };
|
|
2932
|
+
export { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AuthenticationGeneratorComponentType, BackgroundTaskConnectorType, BlobStorageComponentType, BlobStorageConnectorType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DataSpaceConnectorComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageComponentType, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, NftComponentType, NftConnectorType, RightsManagementDapComponentType, RightsManagementDarpComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SynchronisedStorageComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, VaultConnectorType, VerifiableStorageComponentType, VerifiableStorageConnectorType, WalletConnectorType, initialiseAttestationComponent, initialiseAttestationConnector, initialiseAuditableItemGraphComponent, initialiseAuditableItemStreamComponent, initialiseAuthenticationGeneratorComponent, initialiseBackgroundTaskConnector, initialiseBlobStorageComponent, initialiseBlobStorageConnector, initialiseDataConverterConnector, initialiseDataExtractorConnector, initialiseDataProcessingComponent, initialiseDataSpaceConnectorComponent, initialiseDocumentManagementComponent, initialiseEntityStorageComponent, initialiseEntityStorageConnector, initialiseEventBusComponent, initialiseEventBusConnector, initialiseFaucetConnector, initialiseFederatedCatalogueComponent, initialiseIdentityComponent, initialiseIdentityConnector, initialiseIdentityProfileComponent, initialiseIdentityProfileConnector, initialiseIdentityResolverComponent, initialiseIdentityResolverConnector, initialiseImmutableProofComponent, initialiseLoggingComponent, initialiseLoggingConnector, initialiseMessagingAdminComponent, initialiseMessagingComponent, initialiseMessagingEmailConnector, initialiseMessagingPushNotificationConnector, initialiseMessagingSmsConnector, initialiseNftComponent, initialiseNftConnector, initialiseRightsManagementDapComponent, initialiseRightsManagementDarpComponent, initialiseRightsManagementPapComponent, initialiseRightsManagementPdpComponent, initialiseRightsManagementPepComponent, initialiseRightsManagementPipComponent, initialiseRightsManagementPmpComponent, initialiseRightsManagementPnapComponent, initialiseRightsManagementPnpComponent, initialiseRightsManagementPxpComponent, initialiseSynchronisedStorageComponent, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector };
|