@twin.org/engine-types 0.0.1 → 0.0.2-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +738 -98
- package/dist/esm/index.mjs +755 -129
- package/dist/types/components/dataSpaceConnector.d.ts +13 -0
- package/dist/types/components/entityStorage.d.ts +2 -1
- package/dist/types/components/identity.d.ts +1 -1
- package/dist/types/components/identityProfile.d.ts +1 -1
- package/dist/types/components/rightsManagementPdp.d.ts +13 -0
- package/dist/types/components/rightsManagementPep.d.ts +13 -0
- package/dist/types/components/rightsManagementPip.d.ts +13 -0
- package/dist/types/components/rightsManagementPmp.d.ts +13 -0
- package/dist/types/components/rightsManagementPxp.d.ts +13 -0
- package/dist/types/components/synchronisedStorage.d.ts +13 -0
- package/dist/types/components/telemetry.d.ts +1 -1
- package/dist/types/components/vault.d.ts +1 -1
- package/dist/types/components/verifiableStorage.d.ts +1 -1
- package/dist/types/index.d.ts +21 -0
- package/dist/types/models/IEngineConfig.d.ts +39 -4
- package/dist/types/models/config/attestationComponentConfig.d.ts +4 -0
- package/dist/types/models/config/auditableItemGraphComponentConfig.d.ts +4 -0
- package/dist/types/models/config/auditableItemStreamComponentConfig.d.ts +4 -0
- package/dist/types/models/config/blobStorageComponentConfig.d.ts +4 -0
- package/dist/types/models/config/dataProcessingComponentConfig.d.ts +4 -0
- package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +17 -0
- package/dist/types/models/config/documentManagementComponentConfig.d.ts +5 -1
- package/dist/types/models/config/entityStorageComponentConfig.d.ts +9 -0
- package/dist/types/models/config/entityStorageConnectorConfig.d.ts +4 -0
- package/dist/types/models/config/eventBusComponentConfig.d.ts +4 -0
- package/dist/types/models/config/federatedCatalogueComponentConfig.d.ts +4 -0
- package/dist/types/models/config/identityComponentConfig.d.ts +4 -0
- package/dist/types/models/config/identityProfileComponentConfig.d.ts +4 -0
- package/dist/types/models/config/identityResolverComponentConfig.d.ts +6 -2
- package/dist/types/models/config/immutableProofComponentConfig.d.ts +4 -0
- package/dist/types/models/config/loggingComponentConfig.d.ts +4 -0
- package/dist/types/models/config/nftComponentConfig.d.ts +4 -0
- package/dist/types/models/config/rightsManagementComponentConfig.d.ts +4 -0
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPmpComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +9 -0
- package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +13 -0
- package/dist/types/models/config/taskSchedulerComponentConfig.d.ts +1 -1
- package/dist/types/models/config/telemetryComponentConfig.d.ts +4 -0
- package/dist/types/models/config/verifiableStorageComponentConfig.d.ts +4 -0
- package/dist/types/models/types/attestationComponentType.d.ts +4 -0
- package/dist/types/models/types/auditableItemGraphComponentType.d.ts +4 -0
- package/dist/types/models/types/auditableItemStreamComponentType.d.ts +4 -0
- package/dist/types/models/types/blobStorageComponentType.d.ts +4 -0
- package/dist/types/models/types/dataProcessingComponentType.d.ts +4 -0
- package/dist/types/models/types/dataSpaceConnectorComponentType.d.ts +21 -0
- package/dist/types/models/types/documentManagementComponentType.d.ts +4 -0
- package/dist/types/models/types/entityStorageComponentType.d.ts +4 -0
- package/dist/types/models/types/entityStorageConnectorType.d.ts +4 -0
- package/dist/types/models/types/eventBusComponentType.d.ts +4 -0
- package/dist/types/models/types/federatedCatalogueComponentType.d.ts +4 -0
- package/dist/types/models/types/identityComponentType.d.ts +4 -0
- package/dist/types/models/types/identityProfileComponentType.d.ts +4 -0
- package/dist/types/models/types/identityResolverComponentType.d.ts +4 -0
- package/dist/types/models/types/immutableProofComponentType.d.ts +4 -0
- package/dist/types/models/types/loggingComponentType.d.ts +4 -0
- package/dist/types/models/types/nftComponentType.d.ts +4 -0
- package/dist/types/models/types/rightsManagementComponentType.d.ts +4 -0
- package/dist/types/models/types/rightsManagementPdpComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPepComponentType.d.ts +13 -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/rightsManagementPxpComponentType.d.ts +13 -0
- package/dist/types/models/types/synchronisedStorageComponentType.d.ts +17 -0
- package/dist/types/models/types/taskSchedulerComponentType.d.ts +1 -1
- package/dist/types/models/types/telemetryComponentType.d.ts +4 -0
- package/dist/types/models/types/verifiableStorageComponentType.d.ts +4 -0
- package/docs/changelog.md +150 -0
- package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +41 -0
- package/docs/reference/functions/initialiseEntityStorageConnector.md +4 -2
- package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +41 -0
- package/docs/reference/functions/initialiseRightsManagementPepComponent.md +41 -0
- package/docs/reference/functions/initialiseRightsManagementPipComponent.md +41 -0
- package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +41 -0
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +41 -0
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +41 -0
- package/docs/reference/index.md +28 -0
- package/docs/reference/interfaces/IEngineConfig.md +48 -6
- package/docs/reference/type-aliases/AttestationComponentConfig.md +1 -13
- package/docs/reference/type-aliases/AuditableItemGraphComponentConfig.md +1 -13
- package/docs/reference/type-aliases/AuditableItemStreamComponentConfig.md +1 -13
- package/docs/reference/type-aliases/BlobStorageComponentConfig.md +1 -13
- package/docs/reference/type-aliases/DataProcessingComponentConfig.md +1 -13
- package/docs/reference/type-aliases/DataSpaceConnectorComponentConfig.md +5 -0
- package/docs/reference/type-aliases/DataSpaceConnectorComponentType.md +5 -0
- package/docs/reference/type-aliases/DocumentManagementComponentConfig.md +2 -14
- package/docs/reference/type-aliases/EntityStorageComponentConfig.md +1 -13
- package/docs/reference/type-aliases/EntityStorageConnectorConfig.md +1 -1
- package/docs/reference/type-aliases/EventBusComponentConfig.md +1 -13
- package/docs/reference/type-aliases/FederatedCatalogueComponentConfig.md +1 -13
- package/docs/reference/type-aliases/IdentityComponentConfig.md +1 -13
- package/docs/reference/type-aliases/IdentityProfileComponentConfig.md +1 -13
- package/docs/reference/type-aliases/IdentityResolverComponentConfig.md +1 -13
- package/docs/reference/type-aliases/ImmutableProofComponentConfig.md +1 -13
- package/docs/reference/type-aliases/LoggingComponentConfig.md +1 -13
- package/docs/reference/type-aliases/NftComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementComponentConfig.md +1 -13
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPdpComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPepComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +17 -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/RightsManagementPxpComponentConfig.md +17 -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/type-aliases/TaskSchedulerComponentConfig.md +1 -1
- package/docs/reference/type-aliases/TelemetryComponentConfig.md +1 -13
- package/docs/reference/type-aliases/VerifiableStorageComponentConfig.md +1 -13
- package/docs/reference/variables/AttestationComponentType.md +6 -0
- package/docs/reference/variables/AuditableItemGraphComponentType.md +6 -0
- package/docs/reference/variables/AuditableItemStreamComponentType.md +6 -0
- package/docs/reference/variables/BlobStorageComponentType.md +6 -0
- package/docs/reference/variables/DataProcessingComponentType.md +6 -0
- package/docs/reference/variables/DataSpaceConnectorComponentType.md +25 -0
- package/docs/reference/variables/DocumentManagementComponentType.md +6 -0
- package/docs/reference/variables/EntityStorageComponentType.md +6 -0
- package/docs/reference/variables/EntityStorageConnectorType.md +6 -0
- package/docs/reference/variables/EventBusComponentType.md +6 -0
- package/docs/reference/variables/FederatedCatalogueComponentType.md +6 -0
- package/docs/reference/variables/IdentityComponentType.md +6 -0
- package/docs/reference/variables/IdentityProfileComponentType.md +6 -0
- package/docs/reference/variables/IdentityResolverComponentType.md +6 -0
- package/docs/reference/variables/ImmutableProofComponentType.md +6 -0
- package/docs/reference/variables/LoggingComponentType.md +6 -0
- package/docs/reference/variables/NftComponentType.md +6 -0
- package/docs/reference/variables/RightsManagementComponentType.md +6 -0
- package/docs/reference/variables/RightsManagementPdpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPepComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPipComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPmpComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPxpComponentType.md +13 -0
- package/docs/reference/variables/SynchronisedStorageComponentType.md +19 -0
- package/docs/reference/variables/TaskSchedulerComponentType.md +2 -2
- package/docs/reference/variables/TelemetryComponentType.md +6 -0
- package/docs/reference/variables/VerifiableStorageComponentType.md +6 -0
- package/package.json +31 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { NftAttestationConnector } from '@twin.org/attestation-connector-nft';
|
|
2
2
|
import { AttestationConnectorFactory } from '@twin.org/attestation-models';
|
|
3
|
+
import { AttestationClient } from '@twin.org/attestation-rest-client';
|
|
3
4
|
import { AttestationService } from '@twin.org/attestation-service';
|
|
4
|
-
import { I18n, GeneralError,
|
|
5
|
+
import { I18n, GeneralError, StringHelper, ComponentFactory, Is } from '@twin.org/core';
|
|
6
|
+
import { AuditableItemGraphClient } from '@twin.org/auditable-item-graph-rest-client';
|
|
5
7
|
import { initSchema, AuditableItemGraphService } from '@twin.org/auditable-item-graph-service';
|
|
6
8
|
import path from 'node:path';
|
|
7
9
|
import { CosmosDbEntityStorageConnector } from '@twin.org/entity-storage-connector-cosmosdb';
|
|
@@ -13,8 +15,11 @@ import { MongoDbEntityStorageConnector } from '@twin.org/entity-storage-connecto
|
|
|
13
15
|
import { MySqlEntityStorageConnector } from '@twin.org/entity-storage-connector-mysql';
|
|
14
16
|
import { PostgreSqlEntityStorageConnector } from '@twin.org/entity-storage-connector-postgresql';
|
|
15
17
|
import { ScyllaDBTableConnector } from '@twin.org/entity-storage-connector-scylladb';
|
|
18
|
+
import { SynchronisedEntityStorageConnector } from '@twin.org/entity-storage-connector-synchronised';
|
|
16
19
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
20
|
+
import { EntityStorageClient } from '@twin.org/entity-storage-rest-client';
|
|
17
21
|
import { EntityStorageService } from '@twin.org/entity-storage-service';
|
|
22
|
+
import { AuditableItemStreamClient } from '@twin.org/auditable-item-stream-rest-client';
|
|
18
23
|
import { initSchema as initSchema$1, AuditableItemStreamService } from '@twin.org/auditable-item-stream-service';
|
|
19
24
|
import { initSchema as initSchema$2, EntityStorageBackgroundTaskConnector } from '@twin.org/background-task-connector-entity-storage';
|
|
20
25
|
import { BackgroundTaskConnectorFactory } from '@twin.org/background-task-models';
|
|
@@ -25,49 +30,71 @@ import { GcpBlobStorageConnector } from '@twin.org/blob-storage-connector-gcp';
|
|
|
25
30
|
import { IpfsBlobStorageConnector } from '@twin.org/blob-storage-connector-ipfs';
|
|
26
31
|
import { MemoryBlobStorageConnector } from '@twin.org/blob-storage-connector-memory';
|
|
27
32
|
import { BlobStorageConnectorFactory } from '@twin.org/blob-storage-models';
|
|
33
|
+
import { BlobStorageClient } from '@twin.org/blob-storage-rest-client';
|
|
28
34
|
import { initSchema as initSchema$3, BlobStorageService } from '@twin.org/blob-storage-service';
|
|
29
35
|
import { JsonConverterConnector, XmlConverterConnector } from '@twin.org/data-processing-converters';
|
|
30
36
|
import { JsonPathExtractorConnector } from '@twin.org/data-processing-extractors';
|
|
31
37
|
import { DataConverterConnectorFactory, DataExtractorConnectorFactory } from '@twin.org/data-processing-models';
|
|
38
|
+
import { DataProcessingClient } from '@twin.org/data-processing-rest-client';
|
|
32
39
|
import { initSchema as initSchema$4, DataProcessingService } from '@twin.org/data-processing-service';
|
|
40
|
+
import { DataSpaceConnectorClient } from '@twin.org/data-space-connector-rest-client';
|
|
41
|
+
import { initSchema as initSchema$5, DataSpaceConnectorService } from '@twin.org/data-space-connector-service';
|
|
42
|
+
import { DataSpaceConnectorSocketClient } from '@twin.org/data-space-connector-socket-client';
|
|
43
|
+
import { DocumentManagementClient } from '@twin.org/document-management-rest-client';
|
|
33
44
|
import { DocumentManagementService } from '@twin.org/document-management-service';
|
|
34
45
|
import { LocalEventBusConnector } from '@twin.org/event-bus-connector-local';
|
|
35
46
|
import { EventBusConnectorFactory } from '@twin.org/event-bus-models';
|
|
36
47
|
import { EventBusService } from '@twin.org/event-bus-service';
|
|
37
|
-
import {
|
|
48
|
+
import { EventBusSocketClient } from '@twin.org/event-bus-socket-client';
|
|
49
|
+
import { EntityStorageFaucetConnector, EntityStorageWalletConnector, initSchema as initSchema$i } from '@twin.org/wallet-connector-entity-storage';
|
|
38
50
|
import { IotaFaucetConnector, IotaWalletConnector } from '@twin.org/wallet-connector-iota';
|
|
39
51
|
import { FaucetConnectorFactory, WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
40
|
-
import {
|
|
41
|
-
import { initSchema as initSchema$6,
|
|
52
|
+
import { FederatedCatalogueClient } from '@twin.org/federated-catalogue-rest-client';
|
|
53
|
+
import { initSchema as initSchema$6, FederatedCatalogueService } from '@twin.org/federated-catalogue-service';
|
|
54
|
+
import { initSchema as initSchema$7, EntityStorageIdentityConnector, EntityStorageIdentityProfileConnector, EntityStorageIdentityResolverConnector } from '@twin.org/identity-connector-entity-storage';
|
|
42
55
|
import { IotaIdentityConnector, IotaIdentityResolverConnector } from '@twin.org/identity-connector-iota';
|
|
43
56
|
import { IdentityConnectorFactory, IdentityProfileConnectorFactory, IdentityResolverConnectorFactory } from '@twin.org/identity-models';
|
|
57
|
+
import { IdentityClient, IdentityProfileClient, IdentityResolverClient } from '@twin.org/identity-rest-client';
|
|
44
58
|
import { IdentityService, IdentityProfileService, IdentityResolverService } from '@twin.org/identity-service';
|
|
45
59
|
import { UniversalResolverConnector } from '@twin.org/identity-connector-universal';
|
|
46
|
-
import {
|
|
60
|
+
import { ImmutableProofClient } from '@twin.org/immutable-proof-rest-client';
|
|
61
|
+
import { initSchema as initSchema$8, ImmutableProofService } from '@twin.org/immutable-proof-service';
|
|
47
62
|
import { ConsoleLoggingConnector } from '@twin.org/logging-connector-console';
|
|
48
|
-
import { initSchema as initSchema$
|
|
63
|
+
import { initSchema as initSchema$9, EntityStorageLoggingConnector } from '@twin.org/logging-connector-entity-storage';
|
|
49
64
|
import { MultiLoggingConnector, LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
65
|
+
import { LoggingClient } from '@twin.org/logging-rest-client';
|
|
50
66
|
import { LoggingService } from '@twin.org/logging-service';
|
|
51
67
|
import { AwsMessagingEmailConnector, AwsMessagingSmsConnector, AwsMessagingPushNotificationConnector } from '@twin.org/messaging-connector-aws';
|
|
52
|
-
import { initSchema as initSchema$
|
|
68
|
+
import { initSchema as initSchema$a, EntityStorageMessagingEmailConnector, EntityStorageMessagingSmsConnector, EntityStorageMessagingPushNotificationConnector } from '@twin.org/messaging-connector-entity-storage';
|
|
53
69
|
import { MessagingEmailConnectorFactory, MessagingSmsConnectorFactory, MessagingPushNotificationsConnectorFactory } from '@twin.org/messaging-models';
|
|
54
|
-
import { initSchema as initSchema$
|
|
55
|
-
import { initSchema as initSchema$
|
|
70
|
+
import { initSchema as initSchema$b, MessagingService } from '@twin.org/messaging-service';
|
|
71
|
+
import { initSchema as initSchema$c, EntityStorageNftConnector } from '@twin.org/nft-connector-entity-storage';
|
|
56
72
|
import { IotaNftConnector } from '@twin.org/nft-connector-iota';
|
|
57
73
|
import { NftConnectorFactory } from '@twin.org/nft-models';
|
|
74
|
+
import { NftClient } from '@twin.org/nft-rest-client';
|
|
58
75
|
import { NftService } from '@twin.org/nft-service';
|
|
76
|
+
import { RightsManagementClient } from '@twin.org/rights-management-rest-client';
|
|
59
77
|
import { RightsManagementService } from '@twin.org/rights-management-service';
|
|
60
|
-
import { initSchema as initSchema$
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
78
|
+
import { initSchema as initSchema$d, PolicyAdministrationPointService } from '@twin.org/rights-management-pap-service';
|
|
79
|
+
import { PolicyDecisionPointService } from '@twin.org/rights-management-pdp-service';
|
|
80
|
+
import { PolicyEnforcementPointService } from '@twin.org/rights-management-pep-service';
|
|
81
|
+
import { PolicyInformationPointService } from '@twin.org/rights-management-pip-service';
|
|
82
|
+
import { PolicyManagementPointService } from '@twin.org/rights-management-pmp-service';
|
|
83
|
+
import { PolicyExecutionPointService } from '@twin.org/rights-management-pxp-service';
|
|
84
|
+
import { SynchronisedStorageClient } from '@twin.org/synchronised-storage-rest-client';
|
|
85
|
+
import { initSchema as initSchema$e, SynchronisedStorageService } from '@twin.org/synchronised-storage-service';
|
|
86
|
+
import { TaskSchedulerService } from '@twin.org/background-task-scheduler';
|
|
87
|
+
import { initSchema as initSchema$f, EntityStorageTelemetryConnector } from '@twin.org/telemetry-connector-entity-storage';
|
|
63
88
|
import { TelemetryConnectorFactory } from '@twin.org/telemetry-models';
|
|
89
|
+
import { TelemetryClient } from '@twin.org/telemetry-rest-client';
|
|
64
90
|
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
65
|
-
import { initSchema as initSchema$
|
|
91
|
+
import { initSchema as initSchema$g, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
66
92
|
import { HashicorpVaultConnector } from '@twin.org/vault-connector-hashicorp';
|
|
67
93
|
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
68
|
-
import { initSchema as initSchema$
|
|
94
|
+
import { initSchema as initSchema$h, EntityStorageVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-entity-storage';
|
|
69
95
|
import { IotaVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-iota';
|
|
70
96
|
import { VerifiableStorageConnectorFactory } from '@twin.org/verifiable-storage-models';
|
|
97
|
+
import { VerifiableStorageClient } from '@twin.org/verifiable-storage-rest-client';
|
|
71
98
|
import { VerifiableStorageService } from '@twin.org/verifiable-storage-service';
|
|
72
99
|
|
|
73
100
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -80,7 +107,11 @@ const AttestationComponentType = {
|
|
|
80
107
|
/**
|
|
81
108
|
* Service.
|
|
82
109
|
*/
|
|
83
|
-
Service: "service"
|
|
110
|
+
Service: "service",
|
|
111
|
+
/**
|
|
112
|
+
* REST client.
|
|
113
|
+
*/
|
|
114
|
+
RestClient: "rest-client"
|
|
84
115
|
};
|
|
85
116
|
|
|
86
117
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -116,8 +147,8 @@ function initialiseAttestationConnector(engineCore, context, instanceConfig, ove
|
|
|
116
147
|
let instanceType;
|
|
117
148
|
if (type === AttestationConnectorType.Nft) {
|
|
118
149
|
connector = new NftAttestationConnector({
|
|
119
|
-
identityConnectorType:
|
|
120
|
-
nftConnectorType:
|
|
150
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
151
|
+
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
121
152
|
...instanceConfig.options
|
|
122
153
|
});
|
|
123
154
|
instanceType = NftAttestationConnector.NAMESPACE;
|
|
@@ -156,7 +187,11 @@ function initialiseAttestationComponent(engineCore, context, instanceConfig, ove
|
|
|
156
187
|
component = new AttestationService({
|
|
157
188
|
...instanceConfig.options
|
|
158
189
|
});
|
|
159
|
-
instanceType = AttestationService
|
|
190
|
+
instanceType = StringHelper.kebabCase("AttestationService");
|
|
191
|
+
}
|
|
192
|
+
else if (type === AttestationComponentType.RestClient) {
|
|
193
|
+
component = new AttestationClient(instanceConfig.options);
|
|
194
|
+
instanceType = StringHelper.kebabCase("AttestationClient");
|
|
160
195
|
}
|
|
161
196
|
else {
|
|
162
197
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -183,7 +218,11 @@ const EntityStorageComponentType = {
|
|
|
183
218
|
/**
|
|
184
219
|
* Service.
|
|
185
220
|
*/
|
|
186
|
-
Service: "service"
|
|
221
|
+
Service: "service",
|
|
222
|
+
/**
|
|
223
|
+
* REST client.
|
|
224
|
+
*/
|
|
225
|
+
RestClient: "rest-client"
|
|
187
226
|
};
|
|
188
227
|
|
|
189
228
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -228,7 +267,11 @@ const EntityStorageConnectorType = {
|
|
|
228
267
|
/**
|
|
229
268
|
* Postgre SQL.
|
|
230
269
|
*/
|
|
231
|
-
PostgreSql: "postgresql"
|
|
270
|
+
PostgreSql: "postgresql",
|
|
271
|
+
/**
|
|
272
|
+
* Synchronised.
|
|
273
|
+
*/
|
|
274
|
+
Synchronised: "synchronised"
|
|
232
275
|
};
|
|
233
276
|
|
|
234
277
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -239,6 +282,7 @@ const EntityStorageConnectorType = {
|
|
|
239
282
|
* @param context The context for the engine.
|
|
240
283
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
241
284
|
* @param schema The schema for the entity storage.
|
|
285
|
+
* @returns The name of the instance type that was created.
|
|
242
286
|
* @throws GeneralError if the connector type is unknown.
|
|
243
287
|
*/
|
|
244
288
|
function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
|
|
@@ -359,6 +403,23 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
359
403
|
}
|
|
360
404
|
});
|
|
361
405
|
}
|
|
406
|
+
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
407
|
+
// Create the entity storage that is wrapped by the synchronised connector
|
|
408
|
+
// by removing the custom type it will default to the standard storage
|
|
409
|
+
// mechanism for entity storage
|
|
410
|
+
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
|
|
411
|
+
// Use the wrapped instance name as the entity storage connector type
|
|
412
|
+
// for the synchronised connector
|
|
413
|
+
entityStorageConnector = new SynchronisedEntityStorageConnector({
|
|
414
|
+
entitySchema: schema,
|
|
415
|
+
...entityStorageConfig.options,
|
|
416
|
+
entityStorageConnectorType: wrappedInstanceName,
|
|
417
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
418
|
+
config: {
|
|
419
|
+
...entityStorageConfig.options.config
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
362
423
|
else {
|
|
363
424
|
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
364
425
|
type,
|
|
@@ -371,6 +432,7 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
371
432
|
});
|
|
372
433
|
EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
373
434
|
}
|
|
435
|
+
return instanceName;
|
|
374
436
|
}
|
|
375
437
|
/**
|
|
376
438
|
* Initialise the entity storage connector.
|
|
@@ -386,14 +448,14 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
386
448
|
element: `Entity Storage Component: ${instanceConfig.type}`
|
|
387
449
|
}));
|
|
388
450
|
const type = instanceConfig.type;
|
|
389
|
-
let
|
|
451
|
+
let component;
|
|
390
452
|
let instanceType;
|
|
391
453
|
if (type === EntityStorageComponentType.Service) {
|
|
392
454
|
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
393
455
|
// See if there is a custom entity storage for this type, otherwise just use the default one.
|
|
394
456
|
const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
|
|
395
457
|
initialiseEntityStorageConnector(engineCore, context, hasCustom ? kebabName : undefined, instanceConfig.options.entityStorageType);
|
|
396
|
-
|
|
458
|
+
component = new EntityStorageService({
|
|
397
459
|
entityStorageType: kebabName,
|
|
398
460
|
config: {
|
|
399
461
|
...instanceConfig.options.config
|
|
@@ -401,6 +463,14 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
401
463
|
});
|
|
402
464
|
instanceType = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
403
465
|
}
|
|
466
|
+
else if (type === EntityStorageComponentType.RestClient) {
|
|
467
|
+
const kebabName = StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
468
|
+
component = new EntityStorageClient({
|
|
469
|
+
pathPrefix: kebabName,
|
|
470
|
+
...instanceConfig.options
|
|
471
|
+
});
|
|
472
|
+
instanceType = `${StringHelper.kebabCase("EntityStorageClient")}-${kebabName}`;
|
|
473
|
+
}
|
|
404
474
|
else {
|
|
405
475
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
406
476
|
type,
|
|
@@ -410,9 +480,9 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
410
480
|
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
411
481
|
context.componentInstances.push({
|
|
412
482
|
instanceType: finalInstanceType,
|
|
413
|
-
component
|
|
483
|
+
component
|
|
414
484
|
});
|
|
415
|
-
ComponentFactory.register(finalInstanceType, () =>
|
|
485
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
416
486
|
return finalInstanceType;
|
|
417
487
|
}
|
|
418
488
|
|
|
@@ -426,7 +496,11 @@ const AuditableItemGraphComponentType = {
|
|
|
426
496
|
/**
|
|
427
497
|
* Service.
|
|
428
498
|
*/
|
|
429
|
-
Service: "service"
|
|
499
|
+
Service: "service",
|
|
500
|
+
/**
|
|
501
|
+
* REST client.
|
|
502
|
+
*/
|
|
503
|
+
RestClient: "rest-client"
|
|
430
504
|
};
|
|
431
505
|
|
|
432
506
|
/**
|
|
@@ -450,11 +524,15 @@ function initialiseAuditableItemGraphComponent(engineCore, context, instanceConf
|
|
|
450
524
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
|
|
451
525
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
|
|
452
526
|
component = new AuditableItemGraphService({
|
|
453
|
-
immutableProofComponentType:
|
|
454
|
-
eventBusComponentType:
|
|
527
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
528
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
455
529
|
...instanceConfig.options
|
|
456
530
|
});
|
|
457
|
-
instanceType = AuditableItemGraphService
|
|
531
|
+
instanceType = StringHelper.kebabCase("AuditableItemGraphService");
|
|
532
|
+
}
|
|
533
|
+
else if (type === AuditableItemGraphComponentType.RestClient) {
|
|
534
|
+
component = new AuditableItemGraphClient(instanceConfig.options);
|
|
535
|
+
instanceType = StringHelper.kebabCase("AuditableItemGraphClient");
|
|
458
536
|
}
|
|
459
537
|
else {
|
|
460
538
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -481,7 +559,11 @@ const AuditableItemStreamComponentType = {
|
|
|
481
559
|
/**
|
|
482
560
|
* Service.
|
|
483
561
|
*/
|
|
484
|
-
Service: "service"
|
|
562
|
+
Service: "service",
|
|
563
|
+
/**
|
|
564
|
+
* REST client.
|
|
565
|
+
*/
|
|
566
|
+
RestClient: "rest-client"
|
|
485
567
|
};
|
|
486
568
|
|
|
487
569
|
/**
|
|
@@ -505,11 +587,15 @@ function initialiseAuditableItemStreamComponent(engineCore, context, instanceCon
|
|
|
505
587
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
|
|
506
588
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
|
|
507
589
|
component = new AuditableItemStreamService({
|
|
508
|
-
immutableProofComponentType:
|
|
509
|
-
eventBusComponentType:
|
|
590
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
591
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
510
592
|
...instanceConfig.options
|
|
511
593
|
});
|
|
512
|
-
instanceType = AuditableItemStreamService
|
|
594
|
+
instanceType = StringHelper.kebabCase("AuditableItemStreamService");
|
|
595
|
+
}
|
|
596
|
+
else if (type === AuditableItemStreamComponentType.RestClient) {
|
|
597
|
+
component = new AuditableItemStreamClient(instanceConfig.options);
|
|
598
|
+
instanceType = StringHelper.kebabCase("AuditableItemStreamClient");
|
|
513
599
|
}
|
|
514
600
|
else {
|
|
515
601
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -561,7 +647,7 @@ function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig,
|
|
|
561
647
|
initSchema$2();
|
|
562
648
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
|
|
563
649
|
connector = new EntityStorageBackgroundTaskConnector({
|
|
564
|
-
|
|
650
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
565
651
|
...instanceConfig.options
|
|
566
652
|
});
|
|
567
653
|
instanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;
|
|
@@ -588,7 +674,11 @@ const BlobStorageComponentType = {
|
|
|
588
674
|
/**
|
|
589
675
|
* Service.
|
|
590
676
|
*/
|
|
591
|
-
Service: "service"
|
|
677
|
+
Service: "service",
|
|
678
|
+
/**
|
|
679
|
+
* REST client.
|
|
680
|
+
*/
|
|
681
|
+
RestClient: "rest-client"
|
|
592
682
|
};
|
|
593
683
|
|
|
594
684
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -726,10 +816,14 @@ function initialiseBlobStorageComponent(engineCore, context, instanceConfig, ove
|
|
|
726
816
|
initSchema$3();
|
|
727
817
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
|
|
728
818
|
component = new BlobStorageService({
|
|
729
|
-
vaultConnectorType:
|
|
819
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
730
820
|
...instanceConfig.options
|
|
731
821
|
});
|
|
732
|
-
instanceType = BlobStorageService
|
|
822
|
+
instanceType = StringHelper.kebabCase("BlobStorageService");
|
|
823
|
+
}
|
|
824
|
+
else if (type === BlobStorageComponentType.RestClient) {
|
|
825
|
+
component = new BlobStorageClient(instanceConfig.options);
|
|
826
|
+
instanceType = StringHelper.kebabCase("BlobStorageClient");
|
|
733
827
|
}
|
|
734
828
|
else {
|
|
735
829
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -786,7 +880,11 @@ const DataProcessingComponentType = {
|
|
|
786
880
|
/**
|
|
787
881
|
* Service.
|
|
788
882
|
*/
|
|
789
|
-
Service: "service"
|
|
883
|
+
Service: "service",
|
|
884
|
+
/**
|
|
885
|
+
* REST client.
|
|
886
|
+
*/
|
|
887
|
+
RestClient: "rest-client"
|
|
790
888
|
};
|
|
791
889
|
|
|
792
890
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -885,7 +983,11 @@ function initialiseDataProcessingComponent(engineCore, context, instanceConfig,
|
|
|
885
983
|
component = new DataProcessingService({
|
|
886
984
|
...instanceConfig.options
|
|
887
985
|
});
|
|
888
|
-
instanceType = DataProcessingService
|
|
986
|
+
instanceType = StringHelper.kebabCase("DataProcessingService");
|
|
987
|
+
}
|
|
988
|
+
else if (type === DataProcessingComponentType.RestClient) {
|
|
989
|
+
component = new DataProcessingClient(instanceConfig.options);
|
|
990
|
+
instanceType = StringHelper.kebabCase("DataProcessingClient");
|
|
889
991
|
}
|
|
890
992
|
else {
|
|
891
993
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -902,6 +1004,79 @@ function initialiseDataProcessingComponent(engineCore, context, instanceConfig,
|
|
|
902
1004
|
return finalInstanceType;
|
|
903
1005
|
}
|
|
904
1006
|
|
|
1007
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1008
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1009
|
+
/**
|
|
1010
|
+
* Data space connector component types.
|
|
1011
|
+
*/
|
|
1012
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1013
|
+
const DataSpaceConnectorComponentType = {
|
|
1014
|
+
/**
|
|
1015
|
+
* Service.
|
|
1016
|
+
*/
|
|
1017
|
+
Service: "service",
|
|
1018
|
+
/**
|
|
1019
|
+
* REST client.
|
|
1020
|
+
*/
|
|
1021
|
+
RestClient: "rest-client",
|
|
1022
|
+
/**
|
|
1023
|
+
* Socket client.
|
|
1024
|
+
*/
|
|
1025
|
+
SocketClient: "socket-client"
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1029
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1030
|
+
/**
|
|
1031
|
+
* Initialise the data space connector component.
|
|
1032
|
+
* @param engineCore The engine core.
|
|
1033
|
+
* @param context The context for the engine.
|
|
1034
|
+
* @param instanceConfig The instance config.
|
|
1035
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
1036
|
+
* @returns The name of the instance created.
|
|
1037
|
+
* @throws GeneralError if the component type is unknown.
|
|
1038
|
+
*/
|
|
1039
|
+
function initialiseDataSpaceConnectorComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1040
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
1041
|
+
element: `Data Space Connector Component: ${instanceConfig.type}`
|
|
1042
|
+
}));
|
|
1043
|
+
const type = instanceConfig.type;
|
|
1044
|
+
let component;
|
|
1045
|
+
let instanceType;
|
|
1046
|
+
if (type === DataSpaceConnectorComponentType.Service) {
|
|
1047
|
+
initSchema$5();
|
|
1048
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityLogEntityStorageType, "ActivityLogDetails");
|
|
1049
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask");
|
|
1050
|
+
component = new DataSpaceConnectorService({
|
|
1051
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1052
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1053
|
+
...instanceConfig.options
|
|
1054
|
+
});
|
|
1055
|
+
instanceType = StringHelper.kebabCase("DataSpaceConnectorService");
|
|
1056
|
+
}
|
|
1057
|
+
else if (type === DataSpaceConnectorComponentType.RestClient) {
|
|
1058
|
+
component = new DataSpaceConnectorClient(instanceConfig.options);
|
|
1059
|
+
instanceType = StringHelper.kebabCase("DataSpaceConnectorClient");
|
|
1060
|
+
}
|
|
1061
|
+
else if (type === DataSpaceConnectorComponentType.SocketClient) {
|
|
1062
|
+
component = new DataSpaceConnectorSocketClient({
|
|
1063
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1064
|
+
...instanceConfig.options
|
|
1065
|
+
});
|
|
1066
|
+
instanceType = StringHelper.kebabCase("DataSpaceConnectorSocketClient");
|
|
1067
|
+
}
|
|
1068
|
+
else {
|
|
1069
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
1070
|
+
type,
|
|
1071
|
+
componentType: "DataSpaceConnectorComponent"
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1075
|
+
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1076
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
1077
|
+
return finalInstanceType;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
905
1080
|
// Copyright 2024 IOTA Stiftung.
|
|
906
1081
|
// SPDX-License-Identifier: Apache-2.0.
|
|
907
1082
|
/**
|
|
@@ -912,7 +1087,11 @@ const DocumentManagementComponentType = {
|
|
|
912
1087
|
/**
|
|
913
1088
|
* Service.
|
|
914
1089
|
*/
|
|
915
|
-
Service: "service"
|
|
1090
|
+
Service: "service",
|
|
1091
|
+
/**
|
|
1092
|
+
* REST client.
|
|
1093
|
+
*/
|
|
1094
|
+
RestClient: "rest-client"
|
|
916
1095
|
};
|
|
917
1096
|
|
|
918
1097
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -935,13 +1114,17 @@ function initialiseDocumentManagementComponent(engineCore, context, instanceConf
|
|
|
935
1114
|
let instanceType;
|
|
936
1115
|
if (type === DocumentManagementComponentType.Service) {
|
|
937
1116
|
component = new DocumentManagementService({
|
|
938
|
-
auditableItemGraphComponentType:
|
|
939
|
-
blobStorageComponentType:
|
|
940
|
-
attestationComponentType:
|
|
941
|
-
dataProcessingComponentType:
|
|
1117
|
+
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
1118
|
+
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
1119
|
+
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
1120
|
+
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
942
1121
|
...instanceConfig.options
|
|
943
1122
|
});
|
|
944
|
-
instanceType = DocumentManagementService
|
|
1123
|
+
instanceType = StringHelper.kebabCase("DocumentManagementService");
|
|
1124
|
+
}
|
|
1125
|
+
else if (type === DocumentManagementComponentType.RestClient) {
|
|
1126
|
+
component = new DocumentManagementClient(instanceConfig.options);
|
|
1127
|
+
instanceType = StringHelper.kebabCase("DocumentManagementClient");
|
|
945
1128
|
}
|
|
946
1129
|
else {
|
|
947
1130
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -968,7 +1151,11 @@ const EventBusComponentType = {
|
|
|
968
1151
|
/**
|
|
969
1152
|
* Service.
|
|
970
1153
|
*/
|
|
971
|
-
Service: "service"
|
|
1154
|
+
Service: "service",
|
|
1155
|
+
/**
|
|
1156
|
+
* Socket client.
|
|
1157
|
+
*/
|
|
1158
|
+
SocketClient: "socket-client"
|
|
972
1159
|
};
|
|
973
1160
|
|
|
974
1161
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1004,7 +1191,7 @@ function initialiseEventBusConnector(engineCore, context, instanceConfig, overri
|
|
|
1004
1191
|
let instanceType;
|
|
1005
1192
|
if (type === EventBusConnectorType.Local) {
|
|
1006
1193
|
connector = new LocalEventBusConnector({
|
|
1007
|
-
|
|
1194
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1008
1195
|
...instanceConfig.options
|
|
1009
1196
|
});
|
|
1010
1197
|
instanceType = LocalEventBusConnector.NAMESPACE;
|
|
@@ -1038,10 +1225,17 @@ function initialiseEventBusComponent(engineCore, context, instanceConfig, overri
|
|
|
1038
1225
|
let instanceType;
|
|
1039
1226
|
if (type === EventBusComponentType.Service) {
|
|
1040
1227
|
component = new EventBusService({
|
|
1041
|
-
eventBusConnectorType:
|
|
1228
|
+
eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
|
|
1229
|
+
...instanceConfig.options
|
|
1230
|
+
});
|
|
1231
|
+
instanceType = StringHelper.kebabCase("EventBusService");
|
|
1232
|
+
}
|
|
1233
|
+
else if (type === EventBusComponentType.SocketClient) {
|
|
1234
|
+
component = new EventBusSocketClient({
|
|
1235
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1042
1236
|
...instanceConfig.options
|
|
1043
1237
|
});
|
|
1044
|
-
instanceType =
|
|
1238
|
+
instanceType = StringHelper.kebabCase("EventBusSocketClient");
|
|
1045
1239
|
}
|
|
1046
1240
|
else {
|
|
1047
1241
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1091,7 +1285,8 @@ function initialiseFaucetConnector(engineCore, context, instanceConfig, override
|
|
|
1091
1285
|
let connector;
|
|
1092
1286
|
let instanceType;
|
|
1093
1287
|
if (type === FaucetConnectorType.Iota) {
|
|
1094
|
-
const
|
|
1288
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1289
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1095
1290
|
connector = new IotaFaucetConnector({
|
|
1096
1291
|
...instanceConfig.options,
|
|
1097
1292
|
config: {
|
|
@@ -1130,7 +1325,11 @@ const FederatedCatalogueComponentType = {
|
|
|
1130
1325
|
/**
|
|
1131
1326
|
* Service.
|
|
1132
1327
|
*/
|
|
1133
|
-
Service: "service"
|
|
1328
|
+
Service: "service",
|
|
1329
|
+
/**
|
|
1330
|
+
* REST client.
|
|
1331
|
+
*/
|
|
1332
|
+
RestClient: "rest-client"
|
|
1134
1333
|
};
|
|
1135
1334
|
|
|
1136
1335
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1152,17 +1351,21 @@ function initialiseFederatedCatalogueComponent(engineCore, context, instanceConf
|
|
|
1152
1351
|
let component;
|
|
1153
1352
|
let instanceType;
|
|
1154
1353
|
if (type === FederatedCatalogueComponentType.Service) {
|
|
1155
|
-
initSchema$
|
|
1354
|
+
initSchema$6();
|
|
1156
1355
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry");
|
|
1157
1356
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry");
|
|
1158
1357
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
|
|
1159
1358
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
|
|
1160
1359
|
component = new FederatedCatalogueService({
|
|
1161
|
-
|
|
1162
|
-
identityResolverComponentType:
|
|
1360
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1361
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
1163
1362
|
...instanceConfig.options
|
|
1164
1363
|
});
|
|
1165
|
-
instanceType = FederatedCatalogueService
|
|
1364
|
+
instanceType = StringHelper.kebabCase("FederatedCatalogueService");
|
|
1365
|
+
}
|
|
1366
|
+
else if (type === FederatedCatalogueComponentType.RestClient) {
|
|
1367
|
+
component = new FederatedCatalogueClient(instanceConfig.options);
|
|
1368
|
+
instanceType = StringHelper.kebabCase("FederatedCatalogueClient");
|
|
1166
1369
|
}
|
|
1167
1370
|
else {
|
|
1168
1371
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1189,7 +1392,11 @@ const IdentityComponentType = {
|
|
|
1189
1392
|
/**
|
|
1190
1393
|
* Service.
|
|
1191
1394
|
*/
|
|
1192
|
-
Service: "service"
|
|
1395
|
+
Service: "service",
|
|
1396
|
+
/**
|
|
1397
|
+
* REST client.
|
|
1398
|
+
*/
|
|
1399
|
+
RestClient: "rest-client"
|
|
1193
1400
|
};
|
|
1194
1401
|
|
|
1195
1402
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1228,9 +1435,10 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1228
1435
|
let connector;
|
|
1229
1436
|
let instanceType;
|
|
1230
1437
|
if (type === IdentityConnectorType.Iota) {
|
|
1231
|
-
const
|
|
1438
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1439
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1232
1440
|
connector = new IotaIdentityConnector({
|
|
1233
|
-
vaultConnectorType:
|
|
1441
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1234
1442
|
...instanceConfig.options,
|
|
1235
1443
|
config: {
|
|
1236
1444
|
...dltConfig?.options?.config,
|
|
@@ -1240,10 +1448,10 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1240
1448
|
instanceType = IotaIdentityConnector.NAMESPACE;
|
|
1241
1449
|
}
|
|
1242
1450
|
else if (type === IdentityConnectorType.EntityStorage) {
|
|
1243
|
-
initSchema$
|
|
1451
|
+
initSchema$7({ includeProfile: false });
|
|
1244
1452
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1245
1453
|
connector = new EntityStorageIdentityConnector({
|
|
1246
|
-
vaultConnectorType:
|
|
1454
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1247
1455
|
...instanceConfig.options
|
|
1248
1456
|
});
|
|
1249
1457
|
instanceType = EntityStorageIdentityConnector.NAMESPACE;
|
|
@@ -1277,7 +1485,11 @@ function initialiseIdentityComponent(engineCore, context, instanceConfig, overri
|
|
|
1277
1485
|
let instanceType;
|
|
1278
1486
|
if (type === IdentityComponentType.Service) {
|
|
1279
1487
|
component = new IdentityService(instanceConfig.options);
|
|
1280
|
-
instanceType = IdentityService
|
|
1488
|
+
instanceType = StringHelper.kebabCase("IdentityService");
|
|
1489
|
+
}
|
|
1490
|
+
else if (type === IdentityComponentType.RestClient) {
|
|
1491
|
+
component = new IdentityClient(instanceConfig.options);
|
|
1492
|
+
instanceType = StringHelper.kebabCase("IdentityClient");
|
|
1281
1493
|
}
|
|
1282
1494
|
else {
|
|
1283
1495
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1301,7 +1513,11 @@ const IdentityProfileComponentType = {
|
|
|
1301
1513
|
/**
|
|
1302
1514
|
* Service.
|
|
1303
1515
|
*/
|
|
1304
|
-
Service: "service"
|
|
1516
|
+
Service: "service",
|
|
1517
|
+
/**
|
|
1518
|
+
* REST client.
|
|
1519
|
+
*/
|
|
1520
|
+
RestClient: "rest-client"
|
|
1305
1521
|
};
|
|
1306
1522
|
|
|
1307
1523
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1336,7 +1552,7 @@ function initialiseIdentityProfileConnector(engineCore, context, instanceConfig,
|
|
|
1336
1552
|
let connector;
|
|
1337
1553
|
let instanceType;
|
|
1338
1554
|
if (type === IdentityProfileConnectorType.EntityStorage) {
|
|
1339
|
-
initSchema$
|
|
1555
|
+
initSchema$7({ includeDocument: false });
|
|
1340
1556
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.profileEntityStorageType, "IdentityProfile");
|
|
1341
1557
|
connector = new EntityStorageIdentityProfileConnector(instanceConfig.options);
|
|
1342
1558
|
instanceType = EntityStorageIdentityProfileConnector.NAMESPACE;
|
|
@@ -1373,10 +1589,14 @@ function initialiseIdentityProfileComponent(engineCore, context, instanceConfig,
|
|
|
1373
1589
|
let instanceType;
|
|
1374
1590
|
if (type === IdentityProfileComponentType.Service) {
|
|
1375
1591
|
component = new IdentityProfileService({
|
|
1376
|
-
profileEntityConnectorType:
|
|
1592
|
+
profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
|
|
1377
1593
|
...instanceConfig.options
|
|
1378
1594
|
});
|
|
1379
|
-
instanceType = IdentityProfileService
|
|
1595
|
+
instanceType = StringHelper.kebabCase("IdentityProfileService");
|
|
1596
|
+
}
|
|
1597
|
+
else if (type === IdentityProfileComponentType.RestClient) {
|
|
1598
|
+
component = new IdentityProfileClient(instanceConfig.options);
|
|
1599
|
+
instanceType = StringHelper.kebabCase("IdentityProfileClient");
|
|
1380
1600
|
}
|
|
1381
1601
|
else {
|
|
1382
1602
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1403,7 +1623,11 @@ const IdentityResolverComponentType = {
|
|
|
1403
1623
|
/**
|
|
1404
1624
|
* Service.
|
|
1405
1625
|
*/
|
|
1406
|
-
Service: "service"
|
|
1626
|
+
Service: "service",
|
|
1627
|
+
/**
|
|
1628
|
+
* REST client.
|
|
1629
|
+
*/
|
|
1630
|
+
RestClient: "rest-client"
|
|
1407
1631
|
};
|
|
1408
1632
|
|
|
1409
1633
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1446,7 +1670,8 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1446
1670
|
let connector;
|
|
1447
1671
|
let instanceType;
|
|
1448
1672
|
if (type === IdentityResolverConnectorType.Iota) {
|
|
1449
|
-
const
|
|
1673
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1674
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1450
1675
|
connector = new IotaIdentityResolverConnector({
|
|
1451
1676
|
...instanceConfig.options,
|
|
1452
1677
|
config: {
|
|
@@ -1457,10 +1682,10 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1457
1682
|
instanceType = IotaIdentityResolverConnector.NAMESPACE;
|
|
1458
1683
|
}
|
|
1459
1684
|
else if (type === IdentityResolverConnectorType.EntityStorage) {
|
|
1460
|
-
initSchema$
|
|
1685
|
+
initSchema$7({ includeProfile: false });
|
|
1461
1686
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1462
1687
|
connector = new EntityStorageIdentityResolverConnector({
|
|
1463
|
-
vaultConnectorType:
|
|
1688
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1464
1689
|
...instanceConfig.options
|
|
1465
1690
|
});
|
|
1466
1691
|
instanceType = EntityStorageIdentityResolverConnector.NAMESPACE;
|
|
@@ -1499,13 +1724,18 @@ function initialiseIdentityResolverComponent(engineCore, context, instanceConfig
|
|
|
1499
1724
|
let component;
|
|
1500
1725
|
let instanceType;
|
|
1501
1726
|
if (type === IdentityResolverComponentType.Service) {
|
|
1727
|
+
const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
|
|
1502
1728
|
component = new IdentityResolverService({
|
|
1503
|
-
fallbackResolverConnectorType:
|
|
1729
|
+
fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
|
|
1504
1730
|
? IdentityResolverConnectorType.Universal
|
|
1505
1731
|
: undefined,
|
|
1506
1732
|
...instanceConfig.options
|
|
1507
1733
|
});
|
|
1508
|
-
instanceType = IdentityResolverService
|
|
1734
|
+
instanceType = StringHelper.kebabCase("IdentityResolverService");
|
|
1735
|
+
}
|
|
1736
|
+
else if (type === IdentityResolverComponentType.RestClient) {
|
|
1737
|
+
component = new IdentityResolverClient(instanceConfig.options);
|
|
1738
|
+
instanceType = StringHelper.kebabCase("IdentityResolverClient");
|
|
1509
1739
|
}
|
|
1510
1740
|
else {
|
|
1511
1741
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1529,7 +1759,11 @@ const ImmutableProofComponentType = {
|
|
|
1529
1759
|
/**
|
|
1530
1760
|
* Service.
|
|
1531
1761
|
*/
|
|
1532
|
-
Service: "service"
|
|
1762
|
+
Service: "service",
|
|
1763
|
+
/**
|
|
1764
|
+
* REST client.
|
|
1765
|
+
*/
|
|
1766
|
+
RestClient: "rest-client"
|
|
1533
1767
|
};
|
|
1534
1768
|
|
|
1535
1769
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1551,16 +1785,20 @@ function initialiseImmutableProofComponent(engineCore, context, instanceConfig,
|
|
|
1551
1785
|
let component;
|
|
1552
1786
|
let instanceType;
|
|
1553
1787
|
if (type === ImmutableProofComponentType.Service) {
|
|
1554
|
-
initSchema$
|
|
1788
|
+
initSchema$8();
|
|
1555
1789
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
|
|
1556
1790
|
component = new ImmutableProofService({
|
|
1557
|
-
verifiableStorageType:
|
|
1558
|
-
identityConnectorType:
|
|
1559
|
-
backgroundTaskConnectorType:
|
|
1560
|
-
eventBusComponentType:
|
|
1791
|
+
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
1792
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
1793
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1794
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
1561
1795
|
...instanceConfig.options
|
|
1562
1796
|
});
|
|
1563
|
-
instanceType = ImmutableProofService
|
|
1797
|
+
instanceType = StringHelper.kebabCase("ImmutableProofService");
|
|
1798
|
+
}
|
|
1799
|
+
else if (type === ImmutableProofComponentType.RestClient) {
|
|
1800
|
+
component = new ImmutableProofClient(instanceConfig.options);
|
|
1801
|
+
instanceType = StringHelper.kebabCase("ImmutableProofClient");
|
|
1564
1802
|
}
|
|
1565
1803
|
else {
|
|
1566
1804
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1587,7 +1825,11 @@ const LoggingComponentType = {
|
|
|
1587
1825
|
/**
|
|
1588
1826
|
* Service.
|
|
1589
1827
|
*/
|
|
1590
|
-
Service: "service"
|
|
1828
|
+
Service: "service",
|
|
1829
|
+
/**
|
|
1830
|
+
* REST client.
|
|
1831
|
+
*/
|
|
1832
|
+
RestClient: "rest-client"
|
|
1591
1833
|
};
|
|
1592
1834
|
|
|
1593
1835
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1634,7 +1876,7 @@ function initialiseLoggingConnector(engineCore, context, instanceConfig, overrid
|
|
|
1634
1876
|
instanceType = ConsoleLoggingConnector.NAMESPACE;
|
|
1635
1877
|
}
|
|
1636
1878
|
else if (type === LoggingConnectorType.EntityStorage) {
|
|
1637
|
-
initSchema$
|
|
1879
|
+
initSchema$9();
|
|
1638
1880
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry");
|
|
1639
1881
|
connector = new EntityStorageLoggingConnector(instanceConfig.options);
|
|
1640
1882
|
instanceType = EntityStorageLoggingConnector.NAMESPACE;
|
|
@@ -1672,10 +1914,14 @@ function initialiseLoggingComponent(engineCore, context, instanceConfig, overrid
|
|
|
1672
1914
|
let instanceType;
|
|
1673
1915
|
if (type === LoggingComponentType.Service) {
|
|
1674
1916
|
component = new LoggingService({
|
|
1675
|
-
loggingConnectorType:
|
|
1917
|
+
loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
|
|
1676
1918
|
...instanceConfig.options
|
|
1677
1919
|
});
|
|
1678
|
-
instanceType = LoggingService
|
|
1920
|
+
instanceType = StringHelper.kebabCase("LoggingService");
|
|
1921
|
+
}
|
|
1922
|
+
else if (type === LoggingComponentType.RestClient) {
|
|
1923
|
+
component = new LoggingClient(instanceConfig.options);
|
|
1924
|
+
instanceType = StringHelper.kebabCase("LoggingClient");
|
|
1679
1925
|
}
|
|
1680
1926
|
else {
|
|
1681
1927
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1772,17 +2018,17 @@ function initialiseMessagingEmailConnector(engineCore, context, instanceConfig,
|
|
|
1772
2018
|
let connector;
|
|
1773
2019
|
let instanceType;
|
|
1774
2020
|
if (type === MessagingEmailConnectorType.EntityStorage) {
|
|
1775
|
-
initSchema$
|
|
2021
|
+
initSchema$a({ email: true, sms: false, pushNotification: false });
|
|
1776
2022
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
|
|
1777
2023
|
connector = new EntityStorageMessagingEmailConnector({
|
|
1778
|
-
|
|
2024
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1779
2025
|
...instanceConfig.options
|
|
1780
2026
|
});
|
|
1781
2027
|
instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
1782
2028
|
}
|
|
1783
2029
|
else if (type === MessagingEmailConnectorType.Aws) {
|
|
1784
2030
|
connector = new AwsMessagingEmailConnector({
|
|
1785
|
-
|
|
2031
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1786
2032
|
...instanceConfig.options
|
|
1787
2033
|
});
|
|
1788
2034
|
instanceType = AwsMessagingEmailConnector.NAMESPACE;
|
|
@@ -1815,17 +2061,17 @@ function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, ov
|
|
|
1815
2061
|
let connector;
|
|
1816
2062
|
let instanceType;
|
|
1817
2063
|
if (type === MessagingSmsConnectorType.EntityStorage) {
|
|
1818
|
-
initSchema$
|
|
2064
|
+
initSchema$a({ email: false, sms: true, pushNotification: false });
|
|
1819
2065
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
|
|
1820
2066
|
connector = new EntityStorageMessagingSmsConnector({
|
|
1821
|
-
|
|
2067
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1822
2068
|
...instanceConfig.options
|
|
1823
2069
|
});
|
|
1824
2070
|
instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
1825
2071
|
}
|
|
1826
2072
|
else if (type === MessagingSmsConnectorType.Aws) {
|
|
1827
2073
|
connector = new AwsMessagingSmsConnector({
|
|
1828
|
-
|
|
2074
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1829
2075
|
...instanceConfig.options
|
|
1830
2076
|
});
|
|
1831
2077
|
instanceType = AwsMessagingSmsConnector.NAMESPACE;
|
|
@@ -1858,18 +2104,18 @@ function initialiseMessagingPushNotificationConnector(engineCore, context, insta
|
|
|
1858
2104
|
let connector;
|
|
1859
2105
|
let instanceType;
|
|
1860
2106
|
if (type === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
1861
|
-
initSchema$
|
|
2107
|
+
initSchema$a({ email: false, sms: false, pushNotification: true });
|
|
1862
2108
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
|
|
1863
2109
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
|
|
1864
2110
|
connector = new EntityStorageMessagingPushNotificationConnector({
|
|
1865
|
-
|
|
2111
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1866
2112
|
...instanceConfig.options
|
|
1867
2113
|
});
|
|
1868
2114
|
instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
1869
2115
|
}
|
|
1870
2116
|
else if (type === MessagingPushNotificationConnectorType.Aws) {
|
|
1871
2117
|
connector = new AwsMessagingPushNotificationConnector({
|
|
1872
|
-
|
|
2118
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1873
2119
|
...instanceConfig.options
|
|
1874
2120
|
});
|
|
1875
2121
|
instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
@@ -1902,15 +2148,15 @@ function initialiseMessagingComponent(engineCore, context, instanceConfig, overr
|
|
|
1902
2148
|
let component;
|
|
1903
2149
|
let instanceType;
|
|
1904
2150
|
if (type === MessagingComponentType.Service) {
|
|
1905
|
-
initSchema$
|
|
2151
|
+
initSchema$b();
|
|
1906
2152
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
1907
2153
|
component = new MessagingService({
|
|
1908
|
-
messagingEmailConnectorType:
|
|
1909
|
-
messagingSmsConnectorType:
|
|
1910
|
-
messagingPushNotificationConnectorType:
|
|
2154
|
+
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
2155
|
+
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
2156
|
+
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
1911
2157
|
...instanceConfig.options
|
|
1912
2158
|
});
|
|
1913
|
-
instanceType = MessagingService
|
|
2159
|
+
instanceType = StringHelper.kebabCase("MessagingService");
|
|
1914
2160
|
}
|
|
1915
2161
|
else {
|
|
1916
2162
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1934,7 +2180,11 @@ const NftComponentType = {
|
|
|
1934
2180
|
/**
|
|
1935
2181
|
* Service.
|
|
1936
2182
|
*/
|
|
1937
|
-
Service: "service"
|
|
2183
|
+
Service: "service",
|
|
2184
|
+
/**
|
|
2185
|
+
* REST client.
|
|
2186
|
+
*/
|
|
2187
|
+
RestClient: "rest-client"
|
|
1938
2188
|
};
|
|
1939
2189
|
|
|
1940
2190
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1973,15 +2223,15 @@ function initialiseNftConnector(engineCore, context, instanceConfig, overrideIns
|
|
|
1973
2223
|
let connector;
|
|
1974
2224
|
let instanceType;
|
|
1975
2225
|
if (type === NftConnectorType.EntityStorage) {
|
|
1976
|
-
initSchema$
|
|
2226
|
+
initSchema$c();
|
|
1977
2227
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.nftEntityStorageType, "Nft");
|
|
1978
2228
|
connector = new EntityStorageNftConnector(instanceConfig.options);
|
|
1979
2229
|
instanceType = EntityStorageNftConnector.NAMESPACE;
|
|
1980
2230
|
}
|
|
1981
2231
|
else if (type === NftConnectorType.Iota) {
|
|
1982
2232
|
connector = new IotaNftConnector({
|
|
1983
|
-
vaultConnectorType:
|
|
1984
|
-
walletConnectorType:
|
|
2233
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2234
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
1985
2235
|
...instanceConfig.options
|
|
1986
2236
|
});
|
|
1987
2237
|
instanceType = IotaNftConnector.NAMESPACE;
|
|
@@ -2018,7 +2268,11 @@ function initialiseNftComponent(engineCore, context, instanceConfig, overrideIns
|
|
|
2018
2268
|
let instanceType;
|
|
2019
2269
|
if (type === NftComponentType.Service) {
|
|
2020
2270
|
component = new NftService(instanceConfig.options);
|
|
2021
|
-
instanceType = NftService
|
|
2271
|
+
instanceType = StringHelper.kebabCase("NftService");
|
|
2272
|
+
}
|
|
2273
|
+
else if (type === NftComponentType.RestClient) {
|
|
2274
|
+
component = new NftClient(instanceConfig.options);
|
|
2275
|
+
instanceType = StringHelper.kebabCase("NftClient");
|
|
2022
2276
|
}
|
|
2023
2277
|
else {
|
|
2024
2278
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2045,7 +2299,11 @@ const RightsManagementComponentType = {
|
|
|
2045
2299
|
/**
|
|
2046
2300
|
* Service.
|
|
2047
2301
|
*/
|
|
2048
|
-
Service: "service"
|
|
2302
|
+
Service: "service",
|
|
2303
|
+
/**
|
|
2304
|
+
* REST client.
|
|
2305
|
+
*/
|
|
2306
|
+
RestClient: "rest-client"
|
|
2049
2307
|
};
|
|
2050
2308
|
|
|
2051
2309
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2068,10 +2326,15 @@ function initialiseRightsManagementComponent(engineCore, context, instanceConfig
|
|
|
2068
2326
|
let instanceType;
|
|
2069
2327
|
if (type === RightsManagementComponentType.Service) {
|
|
2070
2328
|
component = new RightsManagementService({
|
|
2071
|
-
|
|
2329
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2330
|
+
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
2072
2331
|
...instanceConfig.options
|
|
2073
2332
|
});
|
|
2074
|
-
instanceType = RightsManagementService
|
|
2333
|
+
instanceType = StringHelper.kebabCase("RightsManagementService");
|
|
2334
|
+
}
|
|
2335
|
+
else if (type === RightsManagementComponentType.RestClient) {
|
|
2336
|
+
component = new RightsManagementClient(instanceConfig.options);
|
|
2337
|
+
instanceType = StringHelper.kebabCase("RightsManagementClient");
|
|
2075
2338
|
}
|
|
2076
2339
|
else {
|
|
2077
2340
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2120,10 +2383,13 @@ function initialiseRightsManagementPapComponent(engineCore, context, instanceCon
|
|
|
2120
2383
|
let component;
|
|
2121
2384
|
let instanceType;
|
|
2122
2385
|
if (type === RightsManagementPapComponentType.Service) {
|
|
2123
|
-
initSchema$
|
|
2386
|
+
initSchema$d();
|
|
2124
2387
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
|
|
2125
|
-
component = new PolicyAdministrationPointService(
|
|
2126
|
-
|
|
2388
|
+
component = new PolicyAdministrationPointService({
|
|
2389
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2390
|
+
...instanceConfig.options
|
|
2391
|
+
});
|
|
2392
|
+
instanceType = StringHelper.kebabCase("PolicyAdministrationPointService");
|
|
2127
2393
|
}
|
|
2128
2394
|
else {
|
|
2129
2395
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2140,6 +2406,348 @@ function initialiseRightsManagementPapComponent(engineCore, context, instanceCon
|
|
|
2140
2406
|
return finalInstanceType;
|
|
2141
2407
|
}
|
|
2142
2408
|
|
|
2409
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2410
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2411
|
+
/**
|
|
2412
|
+
* Rights management PDP component types.
|
|
2413
|
+
*/
|
|
2414
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2415
|
+
const RightsManagementPdpComponentType = {
|
|
2416
|
+
/**
|
|
2417
|
+
* Service.
|
|
2418
|
+
*/
|
|
2419
|
+
Service: "service"
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2423
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2424
|
+
/**
|
|
2425
|
+
* Initialise the rights management PDP component.
|
|
2426
|
+
* @param engineCore The engine core.
|
|
2427
|
+
* @param context The context for the engine.
|
|
2428
|
+
* @param instanceConfig The instance config.
|
|
2429
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2430
|
+
* @returns The name of the instance created.
|
|
2431
|
+
* @throws GeneralError if the component type is unknown.
|
|
2432
|
+
*/
|
|
2433
|
+
function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2434
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2435
|
+
element: `Rights Management PDP Component: ${instanceConfig.type}`
|
|
2436
|
+
}));
|
|
2437
|
+
const type = instanceConfig.type;
|
|
2438
|
+
let component;
|
|
2439
|
+
let instanceType;
|
|
2440
|
+
if (type === RightsManagementPdpComponentType.Service) {
|
|
2441
|
+
component = new PolicyDecisionPointService({
|
|
2442
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2443
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2444
|
+
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2445
|
+
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2446
|
+
...instanceConfig.options
|
|
2447
|
+
});
|
|
2448
|
+
instanceType = StringHelper.kebabCase("PolicyDecisionPointService");
|
|
2449
|
+
}
|
|
2450
|
+
else {
|
|
2451
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2452
|
+
type,
|
|
2453
|
+
componentType: "RightsManagementPdpComponent"
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2457
|
+
context.componentInstances.push({
|
|
2458
|
+
instanceType: finalInstanceType,
|
|
2459
|
+
component
|
|
2460
|
+
});
|
|
2461
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2462
|
+
return finalInstanceType;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2466
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2467
|
+
/**
|
|
2468
|
+
* Rights management PEP component types.
|
|
2469
|
+
*/
|
|
2470
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2471
|
+
const RightsManagementPepComponentType = {
|
|
2472
|
+
/**
|
|
2473
|
+
* Service.
|
|
2474
|
+
*/
|
|
2475
|
+
Service: "service"
|
|
2476
|
+
};
|
|
2477
|
+
|
|
2478
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2479
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2480
|
+
/**
|
|
2481
|
+
* Initialise the rights management PEP component.
|
|
2482
|
+
* @param engineCore The engine core.
|
|
2483
|
+
* @param context The context for the engine.
|
|
2484
|
+
* @param instanceConfig The instance config.
|
|
2485
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2486
|
+
* @returns The name of the instance created.
|
|
2487
|
+
* @throws GeneralError if the component type is unknown.
|
|
2488
|
+
*/
|
|
2489
|
+
function initialiseRightsManagementPepComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2490
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2491
|
+
element: `Rights Management PEP Component: ${instanceConfig.type}`
|
|
2492
|
+
}));
|
|
2493
|
+
const type = instanceConfig.type;
|
|
2494
|
+
let component;
|
|
2495
|
+
let instanceType;
|
|
2496
|
+
if (type === RightsManagementPepComponentType.Service) {
|
|
2497
|
+
component = new PolicyEnforcementPointService({
|
|
2498
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2499
|
+
policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
|
|
2500
|
+
...instanceConfig.options
|
|
2501
|
+
});
|
|
2502
|
+
instanceType = StringHelper.kebabCase("PolicyEnforcementPointService");
|
|
2503
|
+
}
|
|
2504
|
+
else {
|
|
2505
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2506
|
+
type,
|
|
2507
|
+
componentType: "RightsManagementPepComponent"
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2511
|
+
context.componentInstances.push({
|
|
2512
|
+
instanceType: finalInstanceType,
|
|
2513
|
+
component
|
|
2514
|
+
});
|
|
2515
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2516
|
+
return finalInstanceType;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2520
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2521
|
+
/**
|
|
2522
|
+
* Rights management PIP component types.
|
|
2523
|
+
*/
|
|
2524
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2525
|
+
const RightsManagementPipComponentType = {
|
|
2526
|
+
/**
|
|
2527
|
+
* Service.
|
|
2528
|
+
*/
|
|
2529
|
+
Service: "service"
|
|
2530
|
+
};
|
|
2531
|
+
|
|
2532
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2533
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2534
|
+
/**
|
|
2535
|
+
* Initialise the rights management PIP component.
|
|
2536
|
+
* @param engineCore The engine core.
|
|
2537
|
+
* @param context The context for the engine.
|
|
2538
|
+
* @param instanceConfig The instance config.
|
|
2539
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2540
|
+
* @returns The name of the instance created.
|
|
2541
|
+
* @throws GeneralError if the component type is unknown.
|
|
2542
|
+
*/
|
|
2543
|
+
function initialiseRightsManagementPipComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2544
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2545
|
+
element: `Rights Management PIP Component: ${instanceConfig.type}`
|
|
2546
|
+
}));
|
|
2547
|
+
const type = instanceConfig.type;
|
|
2548
|
+
let component;
|
|
2549
|
+
let instanceType;
|
|
2550
|
+
if (type === RightsManagementPipComponentType.Service) {
|
|
2551
|
+
component = new PolicyInformationPointService({
|
|
2552
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2553
|
+
...instanceConfig.options
|
|
2554
|
+
});
|
|
2555
|
+
instanceType = StringHelper.kebabCase("PolicyInformationPointService");
|
|
2556
|
+
}
|
|
2557
|
+
else {
|
|
2558
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2559
|
+
type,
|
|
2560
|
+
componentType: "RightsManagementPipComponent"
|
|
2561
|
+
});
|
|
2562
|
+
}
|
|
2563
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2564
|
+
context.componentInstances.push({
|
|
2565
|
+
instanceType: finalInstanceType,
|
|
2566
|
+
component
|
|
2567
|
+
});
|
|
2568
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2569
|
+
return finalInstanceType;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2573
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2574
|
+
/**
|
|
2575
|
+
* Rights management PMP component types.
|
|
2576
|
+
*/
|
|
2577
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2578
|
+
const RightsManagementPmpComponentType = {
|
|
2579
|
+
/**
|
|
2580
|
+
* Service.
|
|
2581
|
+
*/
|
|
2582
|
+
Service: "service"
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2585
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2586
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2587
|
+
/**
|
|
2588
|
+
* Initialise the rights management PMP component.
|
|
2589
|
+
* @param engineCore The engine core.
|
|
2590
|
+
* @param context The context for the engine.
|
|
2591
|
+
* @param instanceConfig The instance config.
|
|
2592
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2593
|
+
* @returns The name of the instance created.
|
|
2594
|
+
* @throws GeneralError if the component type is unknown.
|
|
2595
|
+
*/
|
|
2596
|
+
function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2597
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2598
|
+
element: `Rights Management PMP Component: ${instanceConfig.type}`
|
|
2599
|
+
}));
|
|
2600
|
+
const type = instanceConfig.type;
|
|
2601
|
+
let component;
|
|
2602
|
+
let instanceType;
|
|
2603
|
+
if (type === RightsManagementPmpComponentType.Service) {
|
|
2604
|
+
component = new PolicyManagementPointService({
|
|
2605
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2606
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2607
|
+
...instanceConfig.options
|
|
2608
|
+
});
|
|
2609
|
+
instanceType = StringHelper.kebabCase("PolicyManagementPointService");
|
|
2610
|
+
}
|
|
2611
|
+
else {
|
|
2612
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2613
|
+
type,
|
|
2614
|
+
componentType: "RightsManagementPmpComponent"
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2617
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2618
|
+
context.componentInstances.push({
|
|
2619
|
+
instanceType: finalInstanceType,
|
|
2620
|
+
component
|
|
2621
|
+
});
|
|
2622
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2623
|
+
return finalInstanceType;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2627
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2628
|
+
/**
|
|
2629
|
+
* Rights management PXP component types.
|
|
2630
|
+
*/
|
|
2631
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2632
|
+
const RightsManagementPxpComponentType = {
|
|
2633
|
+
/**
|
|
2634
|
+
* Service.
|
|
2635
|
+
*/
|
|
2636
|
+
Service: "service"
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2640
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2641
|
+
/**
|
|
2642
|
+
* Initialise the rights management PXP component.
|
|
2643
|
+
* @param engineCore The engine core.
|
|
2644
|
+
* @param context The context for the engine.
|
|
2645
|
+
* @param instanceConfig The instance config.
|
|
2646
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2647
|
+
* @returns The name of the instance created.
|
|
2648
|
+
* @throws GeneralError if the component type is unknown.
|
|
2649
|
+
*/
|
|
2650
|
+
function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2651
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2652
|
+
element: `Rights Management PXP Component: ${instanceConfig.type}`
|
|
2653
|
+
}));
|
|
2654
|
+
const type = instanceConfig.type;
|
|
2655
|
+
let component;
|
|
2656
|
+
let instanceType;
|
|
2657
|
+
if (type === RightsManagementPxpComponentType.Service) {
|
|
2658
|
+
component = new PolicyExecutionPointService({
|
|
2659
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2660
|
+
...instanceConfig.options
|
|
2661
|
+
});
|
|
2662
|
+
instanceType = StringHelper.kebabCase("PolicyExecutionPointService");
|
|
2663
|
+
}
|
|
2664
|
+
else {
|
|
2665
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2666
|
+
type,
|
|
2667
|
+
componentType: "RightsManagementPxpComponent"
|
|
2668
|
+
});
|
|
2669
|
+
}
|
|
2670
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2671
|
+
context.componentInstances.push({
|
|
2672
|
+
instanceType: finalInstanceType,
|
|
2673
|
+
component
|
|
2674
|
+
});
|
|
2675
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2676
|
+
return finalInstanceType;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2680
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2681
|
+
/**
|
|
2682
|
+
* Synchronised storage component types.
|
|
2683
|
+
*/
|
|
2684
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2685
|
+
const SynchronisedStorageComponentType = {
|
|
2686
|
+
/**
|
|
2687
|
+
* Service.
|
|
2688
|
+
*/
|
|
2689
|
+
Service: "service",
|
|
2690
|
+
/**
|
|
2691
|
+
* REST client.
|
|
2692
|
+
*/
|
|
2693
|
+
RestClient: "rest-client"
|
|
2694
|
+
};
|
|
2695
|
+
|
|
2696
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2697
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2698
|
+
/**
|
|
2699
|
+
* Initialise the synchronised storage component.
|
|
2700
|
+
* @param engineCore The engine core.
|
|
2701
|
+
* @param context The context for the engine.
|
|
2702
|
+
* @param instanceConfig The instance config.
|
|
2703
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2704
|
+
* @returns The name of the instance created.
|
|
2705
|
+
* @throws GeneralError if the component type is unknown.
|
|
2706
|
+
*/
|
|
2707
|
+
function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2708
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2709
|
+
element: `Synchronised Storage Component: ${instanceConfig.type}`
|
|
2710
|
+
}));
|
|
2711
|
+
const type = instanceConfig.type;
|
|
2712
|
+
let component;
|
|
2713
|
+
let instanceType;
|
|
2714
|
+
if (type === SynchronisedStorageComponentType.Service) {
|
|
2715
|
+
initSchema$e();
|
|
2716
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
|
|
2717
|
+
component = new SynchronisedStorageService({
|
|
2718
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2719
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
2720
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2721
|
+
verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
2722
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2723
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2724
|
+
trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
|
|
2725
|
+
blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
|
|
2726
|
+
"public"
|
|
2727
|
+
]),
|
|
2728
|
+
...instanceConfig.options
|
|
2729
|
+
});
|
|
2730
|
+
instanceType = StringHelper.kebabCase("SynchronisedStorageService");
|
|
2731
|
+
}
|
|
2732
|
+
else if (type === SynchronisedStorageComponentType.RestClient) {
|
|
2733
|
+
component = new SynchronisedStorageClient(instanceConfig.options);
|
|
2734
|
+
instanceType = StringHelper.kebabCase("SynchronisedStorageClient");
|
|
2735
|
+
}
|
|
2736
|
+
else {
|
|
2737
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2738
|
+
type,
|
|
2739
|
+
componentType: "SynchronisedStorageComponent"
|
|
2740
|
+
});
|
|
2741
|
+
}
|
|
2742
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2743
|
+
context.componentInstances.push({
|
|
2744
|
+
instanceType: finalInstanceType,
|
|
2745
|
+
component
|
|
2746
|
+
});
|
|
2747
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2748
|
+
return finalInstanceType;
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2143
2751
|
// Copyright 2024 IOTA Stiftung.
|
|
2144
2752
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2145
2753
|
/**
|
|
@@ -2150,7 +2758,7 @@ const TaskSchedulerComponentType = {
|
|
|
2150
2758
|
/**
|
|
2151
2759
|
* Task scheduler.
|
|
2152
2760
|
*/
|
|
2153
|
-
|
|
2761
|
+
Service: "service"
|
|
2154
2762
|
};
|
|
2155
2763
|
|
|
2156
2764
|
/**
|
|
@@ -2169,12 +2777,12 @@ function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, o
|
|
|
2169
2777
|
const type = instanceConfig.type;
|
|
2170
2778
|
let component;
|
|
2171
2779
|
let instanceType;
|
|
2172
|
-
if (type === TaskSchedulerComponentType.
|
|
2173
|
-
component = new
|
|
2174
|
-
|
|
2780
|
+
if (type === TaskSchedulerComponentType.Service) {
|
|
2781
|
+
component = new TaskSchedulerService({
|
|
2782
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2175
2783
|
...instanceConfig.options
|
|
2176
2784
|
});
|
|
2177
|
-
instanceType =
|
|
2785
|
+
instanceType = StringHelper.kebabCase("TaskSchedulerService");
|
|
2178
2786
|
}
|
|
2179
2787
|
else {
|
|
2180
2788
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2201,7 +2809,11 @@ const TelemetryComponentType = {
|
|
|
2201
2809
|
/**
|
|
2202
2810
|
* Service.
|
|
2203
2811
|
*/
|
|
2204
|
-
Service: "service"
|
|
2812
|
+
Service: "service",
|
|
2813
|
+
/**
|
|
2814
|
+
* REST client.
|
|
2815
|
+
*/
|
|
2816
|
+
RestClient: "rest-client"
|
|
2205
2817
|
};
|
|
2206
2818
|
|
|
2207
2819
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2236,11 +2848,11 @@ function initialiseTelemetryConnector(engineCore, context, instanceConfig, overr
|
|
|
2236
2848
|
let connector;
|
|
2237
2849
|
let instanceType;
|
|
2238
2850
|
if (type === TelemetryConnectorType.EntityStorage) {
|
|
2239
|
-
initSchema$
|
|
2851
|
+
initSchema$f();
|
|
2240
2852
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
|
|
2241
2853
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
|
|
2242
2854
|
connector = new EntityStorageTelemetryConnector({
|
|
2243
|
-
|
|
2855
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2244
2856
|
...instanceConfig.options
|
|
2245
2857
|
});
|
|
2246
2858
|
instanceType = EntityStorageTelemetryConnector.NAMESPACE;
|
|
@@ -2274,10 +2886,14 @@ function initialiseTelemetryComponent(engineCore, context, instanceConfig, overr
|
|
|
2274
2886
|
let instanceType;
|
|
2275
2887
|
if (type === TelemetryComponentType.Service) {
|
|
2276
2888
|
component = new TelemetryService({
|
|
2277
|
-
telemetryConnectorType:
|
|
2889
|
+
telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
|
|
2278
2890
|
...instanceConfig.options
|
|
2279
2891
|
});
|
|
2280
|
-
instanceType = TelemetryService
|
|
2892
|
+
instanceType = StringHelper.kebabCase("TelemetryService");
|
|
2893
|
+
}
|
|
2894
|
+
else if (type === TelemetryComponentType.RestClient) {
|
|
2895
|
+
component = new TelemetryClient(instanceConfig.options);
|
|
2896
|
+
instanceType = StringHelper.kebabCase("TelemetryClient");
|
|
2281
2897
|
}
|
|
2282
2898
|
else {
|
|
2283
2899
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2327,7 +2943,7 @@ function initialiseVaultConnector(engineCore, context, instanceConfig, overrideI
|
|
|
2327
2943
|
let connector;
|
|
2328
2944
|
let instanceType;
|
|
2329
2945
|
if (type === VaultConnectorType.EntityStorage) {
|
|
2330
|
-
initSchema$
|
|
2946
|
+
initSchema$g();
|
|
2331
2947
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
|
|
2332
2948
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
|
|
2333
2949
|
connector = new EntityStorageVaultConnector(instanceConfig.options);
|
|
@@ -2359,7 +2975,11 @@ const VerifiableStorageComponentType = {
|
|
|
2359
2975
|
/**
|
|
2360
2976
|
* Service.
|
|
2361
2977
|
*/
|
|
2362
|
-
Service: "service"
|
|
2978
|
+
Service: "service",
|
|
2979
|
+
/**
|
|
2980
|
+
* REST client.
|
|
2981
|
+
*/
|
|
2982
|
+
RestClient: "rest-client"
|
|
2363
2983
|
};
|
|
2364
2984
|
|
|
2365
2985
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2398,9 +3018,10 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2398
3018
|
let connector;
|
|
2399
3019
|
let instanceType;
|
|
2400
3020
|
if (type === VerifiableStorageConnectorType.Iota) {
|
|
2401
|
-
const
|
|
3021
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
3022
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2402
3023
|
connector = new IotaVerifiableStorageConnector({
|
|
2403
|
-
vaultConnectorType:
|
|
3024
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2404
3025
|
...instanceConfig.options,
|
|
2405
3026
|
config: {
|
|
2406
3027
|
...dltConfig?.options?.config,
|
|
@@ -2410,7 +3031,7 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2410
3031
|
instanceType = IotaVerifiableStorageConnector.NAMESPACE;
|
|
2411
3032
|
}
|
|
2412
3033
|
else if (type === VerifiableStorageConnectorType.EntityStorage) {
|
|
2413
|
-
initSchema$
|
|
3034
|
+
initSchema$h();
|
|
2414
3035
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
|
|
2415
3036
|
connector = new EntityStorageVerifiableStorageConnector(instanceConfig.options);
|
|
2416
3037
|
instanceType = EntityStorageVerifiableStorageConnector.NAMESPACE;
|
|
@@ -2449,7 +3070,11 @@ function initialiseVerifiableStorageComponent(engineCore, context, instanceConfi
|
|
|
2449
3070
|
component = new VerifiableStorageService({
|
|
2450
3071
|
...instanceConfig.options
|
|
2451
3072
|
});
|
|
2452
|
-
instanceType = VerifiableStorageService
|
|
3073
|
+
instanceType = StringHelper.kebabCase("VerifiableStorageService");
|
|
3074
|
+
}
|
|
3075
|
+
else if (type === VerifiableStorageComponentType.RestClient) {
|
|
3076
|
+
component = new VerifiableStorageClient(instanceConfig.options);
|
|
3077
|
+
instanceType = StringHelper.kebabCase("VerifiableStorageClient");
|
|
2453
3078
|
}
|
|
2454
3079
|
else {
|
|
2455
3080
|
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2502,10 +3127,11 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2502
3127
|
let connector;
|
|
2503
3128
|
let instanceType;
|
|
2504
3129
|
if (type === WalletConnectorType.Iota) {
|
|
2505
|
-
const
|
|
3130
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
3131
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2506
3132
|
connector = new IotaWalletConnector({
|
|
2507
|
-
vaultConnectorType:
|
|
2508
|
-
faucetConnectorType:
|
|
3133
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3134
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2509
3135
|
...instanceConfig.options,
|
|
2510
3136
|
config: {
|
|
2511
3137
|
...dltConfig?.options?.config,
|
|
@@ -2516,8 +3142,8 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2516
3142
|
}
|
|
2517
3143
|
else if (type === WalletConnectorType.EntityStorage) {
|
|
2518
3144
|
connector = new EntityStorageWalletConnector({
|
|
2519
|
-
vaultConnectorType:
|
|
2520
|
-
faucetConnectorType:
|
|
3145
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3146
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2521
3147
|
...instanceConfig.options
|
|
2522
3148
|
});
|
|
2523
3149
|
instanceType = EntityStorageWalletConnector.NAMESPACE;
|
|
@@ -2549,7 +3175,7 @@ function initialiseWalletStorage(engineCore, context, instanceConfig, overrideIn
|
|
|
2549
3175
|
const type = instanceConfig.type;
|
|
2550
3176
|
if (type === WalletConnectorType.Iota) ;
|
|
2551
3177
|
else if (type === WalletConnectorType.EntityStorage) {
|
|
2552
|
-
initSchema$
|
|
3178
|
+
initSchema$i();
|
|
2553
3179
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
2554
3180
|
}
|
|
2555
3181
|
else {
|
|
@@ -2574,4 +3200,4 @@ const DltConfigType = {
|
|
|
2574
3200
|
Iota: "iota"
|
|
2575
3201
|
};
|
|
2576
3202
|
|
|
2577
|
-
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 };
|
|
3203
|
+
export { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, BackgroundTaskConnectorType, BlobStorageComponentType, BlobStorageConnectorType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DataSpaceConnectorComponentType, DltConfigType, DocumentManagementComponentType, EntityStorageComponentType, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, NftComponentType, NftConnectorType, RightsManagementComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPxpComponentType, SynchronisedStorageComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, VaultConnectorType, VerifiableStorageComponentType, VerifiableStorageConnectorType, WalletConnectorType, initialiseAttestationComponent, initialiseAttestationConnector, initialiseAuditableItemGraphComponent, initialiseAuditableItemStreamComponent, initialiseBackgroundTaskConnector, initialiseBlobStorageComponent, initialiseBlobStorageConnector, initialiseDataConverterConnector, initialiseDataExtractorConnector, initialiseDataProcessingComponent, initialiseDataSpaceConnectorComponent, initialiseDocumentManagementComponent, initialiseEntityStorageComponent, initialiseEntityStorageConnector, initialiseEventBusComponent, initialiseEventBusConnector, initialiseFaucetConnector, initialiseFederatedCatalogueComponent, initialiseIdentityComponent, initialiseIdentityConnector, initialiseIdentityProfileComponent, initialiseIdentityProfileConnector, initialiseIdentityResolverComponent, initialiseIdentityResolverConnector, initialiseImmutableProofComponent, initialiseLoggingComponent, initialiseLoggingConnector, initialiseMessagingComponent, initialiseMessagingEmailConnector, initialiseMessagingPushNotificationConnector, initialiseMessagingSmsConnector, initialiseNftComponent, initialiseNftConnector, initialiseRightsManagementComponent, initialiseRightsManagementPapComponent, initialiseRightsManagementPdpComponent, initialiseRightsManagementPepComponent, initialiseRightsManagementPipComponent, initialiseRightsManagementPmpComponent, initialiseRightsManagementPxpComponent, initialiseSynchronisedStorageComponent, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector, initialiseWalletStorage };
|