@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/cjs/index.cjs
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var attestationConnectorNft = require('@twin.org/attestation-connector-nft');
|
|
4
4
|
var attestationModels = require('@twin.org/attestation-models');
|
|
5
|
+
var attestationRestClient = require('@twin.org/attestation-rest-client');
|
|
5
6
|
var attestationService = require('@twin.org/attestation-service');
|
|
6
7
|
var core = require('@twin.org/core');
|
|
8
|
+
var auditableItemGraphRestClient = require('@twin.org/auditable-item-graph-rest-client');
|
|
7
9
|
var auditableItemGraphService = require('@twin.org/auditable-item-graph-service');
|
|
8
10
|
var path = require('node:path');
|
|
9
11
|
var entityStorageConnectorCosmosdb = require('@twin.org/entity-storage-connector-cosmosdb');
|
|
@@ -15,8 +17,11 @@ var entityStorageConnectorMongodb = require('@twin.org/entity-storage-connector-
|
|
|
15
17
|
var entityStorageConnectorMysql = require('@twin.org/entity-storage-connector-mysql');
|
|
16
18
|
var entityStorageConnectorPostgresql = require('@twin.org/entity-storage-connector-postgresql');
|
|
17
19
|
var entityStorageConnectorScylladb = require('@twin.org/entity-storage-connector-scylladb');
|
|
20
|
+
var entityStorageConnectorSynchronised = require('@twin.org/entity-storage-connector-synchronised');
|
|
18
21
|
var entityStorageModels = require('@twin.org/entity-storage-models');
|
|
22
|
+
var entityStorageRestClient = require('@twin.org/entity-storage-rest-client');
|
|
19
23
|
var entityStorageService = require('@twin.org/entity-storage-service');
|
|
24
|
+
var auditableItemStreamRestClient = require('@twin.org/auditable-item-stream-rest-client');
|
|
20
25
|
var auditableItemStreamService = require('@twin.org/auditable-item-stream-service');
|
|
21
26
|
var backgroundTaskConnectorEntityStorage = require('@twin.org/background-task-connector-entity-storage');
|
|
22
27
|
var backgroundTaskModels = require('@twin.org/background-task-models');
|
|
@@ -27,28 +32,39 @@ var blobStorageConnectorGcp = require('@twin.org/blob-storage-connector-gcp');
|
|
|
27
32
|
var blobStorageConnectorIpfs = require('@twin.org/blob-storage-connector-ipfs');
|
|
28
33
|
var blobStorageConnectorMemory = require('@twin.org/blob-storage-connector-memory');
|
|
29
34
|
var blobStorageModels = require('@twin.org/blob-storage-models');
|
|
35
|
+
var blobStorageRestClient = require('@twin.org/blob-storage-rest-client');
|
|
30
36
|
var blobStorageService = require('@twin.org/blob-storage-service');
|
|
31
37
|
var dataProcessingConverters = require('@twin.org/data-processing-converters');
|
|
32
38
|
var dataProcessingExtractors = require('@twin.org/data-processing-extractors');
|
|
33
39
|
var dataProcessingModels = require('@twin.org/data-processing-models');
|
|
40
|
+
var dataProcessingRestClient = require('@twin.org/data-processing-rest-client');
|
|
34
41
|
var dataProcessingService = require('@twin.org/data-processing-service');
|
|
42
|
+
var dataSpaceConnectorRestClient = require('@twin.org/data-space-connector-rest-client');
|
|
43
|
+
var dataSpaceConnectorService = require('@twin.org/data-space-connector-service');
|
|
44
|
+
var dataSpaceConnectorSocketClient = require('@twin.org/data-space-connector-socket-client');
|
|
45
|
+
var documentManagementRestClient = require('@twin.org/document-management-rest-client');
|
|
35
46
|
var documentManagementService = require('@twin.org/document-management-service');
|
|
36
47
|
var eventBusConnectorLocal = require('@twin.org/event-bus-connector-local');
|
|
37
48
|
var eventBusModels = require('@twin.org/event-bus-models');
|
|
38
49
|
var eventBusService = require('@twin.org/event-bus-service');
|
|
50
|
+
var eventBusSocketClient = require('@twin.org/event-bus-socket-client');
|
|
39
51
|
var walletConnectorEntityStorage = require('@twin.org/wallet-connector-entity-storage');
|
|
40
52
|
var walletConnectorIota = require('@twin.org/wallet-connector-iota');
|
|
41
53
|
var walletModels = require('@twin.org/wallet-models');
|
|
54
|
+
var federatedCatalogueRestClient = require('@twin.org/federated-catalogue-rest-client');
|
|
42
55
|
var federatedCatalogueService = require('@twin.org/federated-catalogue-service');
|
|
43
56
|
var identityConnectorEntityStorage = require('@twin.org/identity-connector-entity-storage');
|
|
44
57
|
var identityConnectorIota = require('@twin.org/identity-connector-iota');
|
|
45
58
|
var identityModels = require('@twin.org/identity-models');
|
|
59
|
+
var identityRestClient = require('@twin.org/identity-rest-client');
|
|
46
60
|
var identityService = require('@twin.org/identity-service');
|
|
47
61
|
var identityConnectorUniversal = require('@twin.org/identity-connector-universal');
|
|
62
|
+
var immutableProofRestClient = require('@twin.org/immutable-proof-rest-client');
|
|
48
63
|
var immutableProofService = require('@twin.org/immutable-proof-service');
|
|
49
64
|
var loggingConnectorConsole = require('@twin.org/logging-connector-console');
|
|
50
65
|
var loggingConnectorEntityStorage = require('@twin.org/logging-connector-entity-storage');
|
|
51
66
|
var loggingModels = require('@twin.org/logging-models');
|
|
67
|
+
var loggingRestClient = require('@twin.org/logging-rest-client');
|
|
52
68
|
var loggingService = require('@twin.org/logging-service');
|
|
53
69
|
var messagingConnectorAws = require('@twin.org/messaging-connector-aws');
|
|
54
70
|
var messagingConnectorEntityStorage = require('@twin.org/messaging-connector-entity-storage');
|
|
@@ -57,12 +73,22 @@ var messagingService = require('@twin.org/messaging-service');
|
|
|
57
73
|
var nftConnectorEntityStorage = require('@twin.org/nft-connector-entity-storage');
|
|
58
74
|
var nftConnectorIota = require('@twin.org/nft-connector-iota');
|
|
59
75
|
var nftModels = require('@twin.org/nft-models');
|
|
76
|
+
var nftRestClient = require('@twin.org/nft-rest-client');
|
|
60
77
|
var nftService = require('@twin.org/nft-service');
|
|
78
|
+
var rightsManagementRestClient = require('@twin.org/rights-management-rest-client');
|
|
61
79
|
var rightsManagementService = require('@twin.org/rights-management-service');
|
|
62
80
|
var rightsManagementPapService = require('@twin.org/rights-management-pap-service');
|
|
81
|
+
var rightsManagementPdpService = require('@twin.org/rights-management-pdp-service');
|
|
82
|
+
var rightsManagementPepService = require('@twin.org/rights-management-pep-service');
|
|
83
|
+
var rightsManagementPipService = require('@twin.org/rights-management-pip-service');
|
|
84
|
+
var rightsManagementPmpService = require('@twin.org/rights-management-pmp-service');
|
|
85
|
+
var rightsManagementPxpService = require('@twin.org/rights-management-pxp-service');
|
|
86
|
+
var synchronisedStorageRestClient = require('@twin.org/synchronised-storage-rest-client');
|
|
87
|
+
var synchronisedStorageService = require('@twin.org/synchronised-storage-service');
|
|
63
88
|
var backgroundTaskScheduler = require('@twin.org/background-task-scheduler');
|
|
64
89
|
var telemetryConnectorEntityStorage = require('@twin.org/telemetry-connector-entity-storage');
|
|
65
90
|
var telemetryModels = require('@twin.org/telemetry-models');
|
|
91
|
+
var telemetryRestClient = require('@twin.org/telemetry-rest-client');
|
|
66
92
|
var telemetryService = require('@twin.org/telemetry-service');
|
|
67
93
|
var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
|
|
68
94
|
var vaultConnectorHashicorp = require('@twin.org/vault-connector-hashicorp');
|
|
@@ -70,6 +96,7 @@ var vaultModels = require('@twin.org/vault-models');
|
|
|
70
96
|
var verifiableStorageConnectorEntityStorage = require('@twin.org/verifiable-storage-connector-entity-storage');
|
|
71
97
|
var verifiableStorageConnectorIota = require('@twin.org/verifiable-storage-connector-iota');
|
|
72
98
|
var verifiableStorageModels = require('@twin.org/verifiable-storage-models');
|
|
99
|
+
var verifiableStorageRestClient = require('@twin.org/verifiable-storage-rest-client');
|
|
73
100
|
var verifiableStorageService = require('@twin.org/verifiable-storage-service');
|
|
74
101
|
|
|
75
102
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -82,7 +109,11 @@ const AttestationComponentType = {
|
|
|
82
109
|
/**
|
|
83
110
|
* Service.
|
|
84
111
|
*/
|
|
85
|
-
Service: "service"
|
|
112
|
+
Service: "service",
|
|
113
|
+
/**
|
|
114
|
+
* REST client.
|
|
115
|
+
*/
|
|
116
|
+
RestClient: "rest-client"
|
|
86
117
|
};
|
|
87
118
|
|
|
88
119
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -118,8 +149,8 @@ function initialiseAttestationConnector(engineCore, context, instanceConfig, ove
|
|
|
118
149
|
let instanceType;
|
|
119
150
|
if (type === AttestationConnectorType.Nft) {
|
|
120
151
|
connector = new attestationConnectorNft.NftAttestationConnector({
|
|
121
|
-
identityConnectorType:
|
|
122
|
-
nftConnectorType:
|
|
152
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
153
|
+
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
123
154
|
...instanceConfig.options
|
|
124
155
|
});
|
|
125
156
|
instanceType = attestationConnectorNft.NftAttestationConnector.NAMESPACE;
|
|
@@ -158,7 +189,11 @@ function initialiseAttestationComponent(engineCore, context, instanceConfig, ove
|
|
|
158
189
|
component = new attestationService.AttestationService({
|
|
159
190
|
...instanceConfig.options
|
|
160
191
|
});
|
|
161
|
-
instanceType =
|
|
192
|
+
instanceType = core.StringHelper.kebabCase("AttestationService");
|
|
193
|
+
}
|
|
194
|
+
else if (type === AttestationComponentType.RestClient) {
|
|
195
|
+
component = new attestationRestClient.AttestationClient(instanceConfig.options);
|
|
196
|
+
instanceType = core.StringHelper.kebabCase("AttestationClient");
|
|
162
197
|
}
|
|
163
198
|
else {
|
|
164
199
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -185,7 +220,11 @@ const EntityStorageComponentType = {
|
|
|
185
220
|
/**
|
|
186
221
|
* Service.
|
|
187
222
|
*/
|
|
188
|
-
Service: "service"
|
|
223
|
+
Service: "service",
|
|
224
|
+
/**
|
|
225
|
+
* REST client.
|
|
226
|
+
*/
|
|
227
|
+
RestClient: "rest-client"
|
|
189
228
|
};
|
|
190
229
|
|
|
191
230
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -230,7 +269,11 @@ const EntityStorageConnectorType = {
|
|
|
230
269
|
/**
|
|
231
270
|
* Postgre SQL.
|
|
232
271
|
*/
|
|
233
|
-
PostgreSql: "postgresql"
|
|
272
|
+
PostgreSql: "postgresql",
|
|
273
|
+
/**
|
|
274
|
+
* Synchronised.
|
|
275
|
+
*/
|
|
276
|
+
Synchronised: "synchronised"
|
|
234
277
|
};
|
|
235
278
|
|
|
236
279
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -241,6 +284,7 @@ const EntityStorageConnectorType = {
|
|
|
241
284
|
* @param context The context for the engine.
|
|
242
285
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
243
286
|
* @param schema The schema for the entity storage.
|
|
287
|
+
* @returns The name of the instance type that was created.
|
|
244
288
|
* @throws GeneralError if the connector type is unknown.
|
|
245
289
|
*/
|
|
246
290
|
function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
|
|
@@ -361,6 +405,23 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
361
405
|
}
|
|
362
406
|
});
|
|
363
407
|
}
|
|
408
|
+
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
409
|
+
// Create the entity storage that is wrapped by the synchronised connector
|
|
410
|
+
// by removing the custom type it will default to the standard storage
|
|
411
|
+
// mechanism for entity storage
|
|
412
|
+
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
|
|
413
|
+
// Use the wrapped instance name as the entity storage connector type
|
|
414
|
+
// for the synchronised connector
|
|
415
|
+
entityStorageConnector = new entityStorageConnectorSynchronised.SynchronisedEntityStorageConnector({
|
|
416
|
+
entitySchema: schema,
|
|
417
|
+
...entityStorageConfig.options,
|
|
418
|
+
entityStorageConnectorType: wrappedInstanceName,
|
|
419
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
420
|
+
config: {
|
|
421
|
+
...entityStorageConfig.options.config
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
364
425
|
else {
|
|
365
426
|
throw new core.GeneralError("engineCore", "connectorUnknownType", {
|
|
366
427
|
type,
|
|
@@ -373,6 +434,7 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
373
434
|
});
|
|
374
435
|
entityStorageModels.EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
375
436
|
}
|
|
437
|
+
return instanceName;
|
|
376
438
|
}
|
|
377
439
|
/**
|
|
378
440
|
* Initialise the entity storage connector.
|
|
@@ -388,14 +450,14 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
388
450
|
element: `Entity Storage Component: ${instanceConfig.type}`
|
|
389
451
|
}));
|
|
390
452
|
const type = instanceConfig.type;
|
|
391
|
-
let
|
|
453
|
+
let component;
|
|
392
454
|
let instanceType;
|
|
393
455
|
if (type === EntityStorageComponentType.Service) {
|
|
394
456
|
const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
395
457
|
// See if there is a custom entity storage for this type, otherwise just use the default one.
|
|
396
458
|
const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
|
|
397
459
|
initialiseEntityStorageConnector(engineCore, context, hasCustom ? kebabName : undefined, instanceConfig.options.entityStorageType);
|
|
398
|
-
|
|
460
|
+
component = new entityStorageService.EntityStorageService({
|
|
399
461
|
entityStorageType: kebabName,
|
|
400
462
|
config: {
|
|
401
463
|
...instanceConfig.options.config
|
|
@@ -403,6 +465,14 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
403
465
|
});
|
|
404
466
|
instanceType = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
405
467
|
}
|
|
468
|
+
else if (type === EntityStorageComponentType.RestClient) {
|
|
469
|
+
const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
|
|
470
|
+
component = new entityStorageRestClient.EntityStorageClient({
|
|
471
|
+
pathPrefix: kebabName,
|
|
472
|
+
...instanceConfig.options
|
|
473
|
+
});
|
|
474
|
+
instanceType = `${core.StringHelper.kebabCase("EntityStorageClient")}-${kebabName}`;
|
|
475
|
+
}
|
|
406
476
|
else {
|
|
407
477
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
408
478
|
type,
|
|
@@ -412,9 +482,9 @@ function initialiseEntityStorageComponent(engineCore, context, instanceConfig, o
|
|
|
412
482
|
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
413
483
|
context.componentInstances.push({
|
|
414
484
|
instanceType: finalInstanceType,
|
|
415
|
-
component
|
|
485
|
+
component
|
|
416
486
|
});
|
|
417
|
-
core.ComponentFactory.register(finalInstanceType, () =>
|
|
487
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
418
488
|
return finalInstanceType;
|
|
419
489
|
}
|
|
420
490
|
|
|
@@ -428,7 +498,11 @@ const AuditableItemGraphComponentType = {
|
|
|
428
498
|
/**
|
|
429
499
|
* Service.
|
|
430
500
|
*/
|
|
431
|
-
Service: "service"
|
|
501
|
+
Service: "service",
|
|
502
|
+
/**
|
|
503
|
+
* REST client.
|
|
504
|
+
*/
|
|
505
|
+
RestClient: "rest-client"
|
|
432
506
|
};
|
|
433
507
|
|
|
434
508
|
/**
|
|
@@ -452,11 +526,15 @@ function initialiseAuditableItemGraphComponent(engineCore, context, instanceConf
|
|
|
452
526
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
|
|
453
527
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
|
|
454
528
|
component = new auditableItemGraphService.AuditableItemGraphService({
|
|
455
|
-
immutableProofComponentType:
|
|
456
|
-
eventBusComponentType:
|
|
529
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
530
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
457
531
|
...instanceConfig.options
|
|
458
532
|
});
|
|
459
|
-
instanceType =
|
|
533
|
+
instanceType = core.StringHelper.kebabCase("AuditableItemGraphService");
|
|
534
|
+
}
|
|
535
|
+
else if (type === AuditableItemGraphComponentType.RestClient) {
|
|
536
|
+
component = new auditableItemGraphRestClient.AuditableItemGraphClient(instanceConfig.options);
|
|
537
|
+
instanceType = core.StringHelper.kebabCase("AuditableItemGraphClient");
|
|
460
538
|
}
|
|
461
539
|
else {
|
|
462
540
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -483,7 +561,11 @@ const AuditableItemStreamComponentType = {
|
|
|
483
561
|
/**
|
|
484
562
|
* Service.
|
|
485
563
|
*/
|
|
486
|
-
Service: "service"
|
|
564
|
+
Service: "service",
|
|
565
|
+
/**
|
|
566
|
+
* REST client.
|
|
567
|
+
*/
|
|
568
|
+
RestClient: "rest-client"
|
|
487
569
|
};
|
|
488
570
|
|
|
489
571
|
/**
|
|
@@ -507,11 +589,15 @@ function initialiseAuditableItemStreamComponent(engineCore, context, instanceCon
|
|
|
507
589
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
|
|
508
590
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
|
|
509
591
|
component = new auditableItemStreamService.AuditableItemStreamService({
|
|
510
|
-
immutableProofComponentType:
|
|
511
|
-
eventBusComponentType:
|
|
592
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
593
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
512
594
|
...instanceConfig.options
|
|
513
595
|
});
|
|
514
|
-
instanceType =
|
|
596
|
+
instanceType = core.StringHelper.kebabCase("AuditableItemStreamService");
|
|
597
|
+
}
|
|
598
|
+
else if (type === AuditableItemStreamComponentType.RestClient) {
|
|
599
|
+
component = new auditableItemStreamRestClient.AuditableItemStreamClient(instanceConfig.options);
|
|
600
|
+
instanceType = core.StringHelper.kebabCase("AuditableItemStreamClient");
|
|
515
601
|
}
|
|
516
602
|
else {
|
|
517
603
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -563,7 +649,7 @@ function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig,
|
|
|
563
649
|
backgroundTaskConnectorEntityStorage.initSchema();
|
|
564
650
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
|
|
565
651
|
connector = new backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector({
|
|
566
|
-
|
|
652
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
567
653
|
...instanceConfig.options
|
|
568
654
|
});
|
|
569
655
|
instanceType = backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector.NAMESPACE;
|
|
@@ -590,7 +676,11 @@ const BlobStorageComponentType = {
|
|
|
590
676
|
/**
|
|
591
677
|
* Service.
|
|
592
678
|
*/
|
|
593
|
-
Service: "service"
|
|
679
|
+
Service: "service",
|
|
680
|
+
/**
|
|
681
|
+
* REST client.
|
|
682
|
+
*/
|
|
683
|
+
RestClient: "rest-client"
|
|
594
684
|
};
|
|
595
685
|
|
|
596
686
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -728,10 +818,14 @@ function initialiseBlobStorageComponent(engineCore, context, instanceConfig, ove
|
|
|
728
818
|
blobStorageService.initSchema();
|
|
729
819
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
|
|
730
820
|
component = new blobStorageService.BlobStorageService({
|
|
731
|
-
vaultConnectorType:
|
|
821
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
732
822
|
...instanceConfig.options
|
|
733
823
|
});
|
|
734
|
-
instanceType =
|
|
824
|
+
instanceType = core.StringHelper.kebabCase("BlobStorageService");
|
|
825
|
+
}
|
|
826
|
+
else if (type === BlobStorageComponentType.RestClient) {
|
|
827
|
+
component = new blobStorageRestClient.BlobStorageClient(instanceConfig.options);
|
|
828
|
+
instanceType = core.StringHelper.kebabCase("BlobStorageClient");
|
|
735
829
|
}
|
|
736
830
|
else {
|
|
737
831
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -788,7 +882,11 @@ const DataProcessingComponentType = {
|
|
|
788
882
|
/**
|
|
789
883
|
* Service.
|
|
790
884
|
*/
|
|
791
|
-
Service: "service"
|
|
885
|
+
Service: "service",
|
|
886
|
+
/**
|
|
887
|
+
* REST client.
|
|
888
|
+
*/
|
|
889
|
+
RestClient: "rest-client"
|
|
792
890
|
};
|
|
793
891
|
|
|
794
892
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -887,7 +985,11 @@ function initialiseDataProcessingComponent(engineCore, context, instanceConfig,
|
|
|
887
985
|
component = new dataProcessingService.DataProcessingService({
|
|
888
986
|
...instanceConfig.options
|
|
889
987
|
});
|
|
890
|
-
instanceType =
|
|
988
|
+
instanceType = core.StringHelper.kebabCase("DataProcessingService");
|
|
989
|
+
}
|
|
990
|
+
else if (type === DataProcessingComponentType.RestClient) {
|
|
991
|
+
component = new dataProcessingRestClient.DataProcessingClient(instanceConfig.options);
|
|
992
|
+
instanceType = core.StringHelper.kebabCase("DataProcessingClient");
|
|
891
993
|
}
|
|
892
994
|
else {
|
|
893
995
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -904,6 +1006,79 @@ function initialiseDataProcessingComponent(engineCore, context, instanceConfig,
|
|
|
904
1006
|
return finalInstanceType;
|
|
905
1007
|
}
|
|
906
1008
|
|
|
1009
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1010
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1011
|
+
/**
|
|
1012
|
+
* Data space connector component types.
|
|
1013
|
+
*/
|
|
1014
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1015
|
+
const DataSpaceConnectorComponentType = {
|
|
1016
|
+
/**
|
|
1017
|
+
* Service.
|
|
1018
|
+
*/
|
|
1019
|
+
Service: "service",
|
|
1020
|
+
/**
|
|
1021
|
+
* REST client.
|
|
1022
|
+
*/
|
|
1023
|
+
RestClient: "rest-client",
|
|
1024
|
+
/**
|
|
1025
|
+
* Socket client.
|
|
1026
|
+
*/
|
|
1027
|
+
SocketClient: "socket-client"
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
// Copyright 2024 IOTA Stiftung.
|
|
1031
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
1032
|
+
/**
|
|
1033
|
+
* Initialise the data space connector component.
|
|
1034
|
+
* @param engineCore The engine core.
|
|
1035
|
+
* @param context The context for the engine.
|
|
1036
|
+
* @param instanceConfig The instance config.
|
|
1037
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
1038
|
+
* @returns The name of the instance created.
|
|
1039
|
+
* @throws GeneralError if the component type is unknown.
|
|
1040
|
+
*/
|
|
1041
|
+
function initialiseDataSpaceConnectorComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
1042
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
1043
|
+
element: `Data Space Connector Component: ${instanceConfig.type}`
|
|
1044
|
+
}));
|
|
1045
|
+
const type = instanceConfig.type;
|
|
1046
|
+
let component;
|
|
1047
|
+
let instanceType;
|
|
1048
|
+
if (type === DataSpaceConnectorComponentType.Service) {
|
|
1049
|
+
dataSpaceConnectorService.initSchema();
|
|
1050
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityLogEntityStorageType, "ActivityLogDetails");
|
|
1051
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask");
|
|
1052
|
+
component = new dataSpaceConnectorService.DataSpaceConnectorService({
|
|
1053
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1054
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1055
|
+
...instanceConfig.options
|
|
1056
|
+
});
|
|
1057
|
+
instanceType = core.StringHelper.kebabCase("DataSpaceConnectorService");
|
|
1058
|
+
}
|
|
1059
|
+
else if (type === DataSpaceConnectorComponentType.RestClient) {
|
|
1060
|
+
component = new dataSpaceConnectorRestClient.DataSpaceConnectorClient(instanceConfig.options);
|
|
1061
|
+
instanceType = core.StringHelper.kebabCase("DataSpaceConnectorClient");
|
|
1062
|
+
}
|
|
1063
|
+
else if (type === DataSpaceConnectorComponentType.SocketClient) {
|
|
1064
|
+
component = new dataSpaceConnectorSocketClient.DataSpaceConnectorSocketClient({
|
|
1065
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1066
|
+
...instanceConfig.options
|
|
1067
|
+
});
|
|
1068
|
+
instanceType = core.StringHelper.kebabCase("DataSpaceConnectorSocketClient");
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
1072
|
+
type,
|
|
1073
|
+
componentType: "DataSpaceConnectorComponent"
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
1077
|
+
context.componentInstances.push({ instanceType: finalInstanceType, component });
|
|
1078
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
1079
|
+
return finalInstanceType;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
907
1082
|
// Copyright 2024 IOTA Stiftung.
|
|
908
1083
|
// SPDX-License-Identifier: Apache-2.0.
|
|
909
1084
|
/**
|
|
@@ -914,7 +1089,11 @@ const DocumentManagementComponentType = {
|
|
|
914
1089
|
/**
|
|
915
1090
|
* Service.
|
|
916
1091
|
*/
|
|
917
|
-
Service: "service"
|
|
1092
|
+
Service: "service",
|
|
1093
|
+
/**
|
|
1094
|
+
* REST client.
|
|
1095
|
+
*/
|
|
1096
|
+
RestClient: "rest-client"
|
|
918
1097
|
};
|
|
919
1098
|
|
|
920
1099
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -937,13 +1116,17 @@ function initialiseDocumentManagementComponent(engineCore, context, instanceConf
|
|
|
937
1116
|
let instanceType;
|
|
938
1117
|
if (type === DocumentManagementComponentType.Service) {
|
|
939
1118
|
component = new documentManagementService.DocumentManagementService({
|
|
940
|
-
auditableItemGraphComponentType:
|
|
941
|
-
blobStorageComponentType:
|
|
942
|
-
attestationComponentType:
|
|
943
|
-
dataProcessingComponentType:
|
|
1119
|
+
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
1120
|
+
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
1121
|
+
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
1122
|
+
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
944
1123
|
...instanceConfig.options
|
|
945
1124
|
});
|
|
946
|
-
instanceType =
|
|
1125
|
+
instanceType = core.StringHelper.kebabCase("DocumentManagementService");
|
|
1126
|
+
}
|
|
1127
|
+
else if (type === DocumentManagementComponentType.RestClient) {
|
|
1128
|
+
component = new documentManagementRestClient.DocumentManagementClient(instanceConfig.options);
|
|
1129
|
+
instanceType = core.StringHelper.kebabCase("DocumentManagementClient");
|
|
947
1130
|
}
|
|
948
1131
|
else {
|
|
949
1132
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -970,7 +1153,11 @@ const EventBusComponentType = {
|
|
|
970
1153
|
/**
|
|
971
1154
|
* Service.
|
|
972
1155
|
*/
|
|
973
|
-
Service: "service"
|
|
1156
|
+
Service: "service",
|
|
1157
|
+
/**
|
|
1158
|
+
* Socket client.
|
|
1159
|
+
*/
|
|
1160
|
+
SocketClient: "socket-client"
|
|
974
1161
|
};
|
|
975
1162
|
|
|
976
1163
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1006,7 +1193,7 @@ function initialiseEventBusConnector(engineCore, context, instanceConfig, overri
|
|
|
1006
1193
|
let instanceType;
|
|
1007
1194
|
if (type === EventBusConnectorType.Local) {
|
|
1008
1195
|
connector = new eventBusConnectorLocal.LocalEventBusConnector({
|
|
1009
|
-
|
|
1196
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1010
1197
|
...instanceConfig.options
|
|
1011
1198
|
});
|
|
1012
1199
|
instanceType = eventBusConnectorLocal.LocalEventBusConnector.NAMESPACE;
|
|
@@ -1040,10 +1227,17 @@ function initialiseEventBusComponent(engineCore, context, instanceConfig, overri
|
|
|
1040
1227
|
let instanceType;
|
|
1041
1228
|
if (type === EventBusComponentType.Service) {
|
|
1042
1229
|
component = new eventBusService.EventBusService({
|
|
1043
|
-
eventBusConnectorType:
|
|
1230
|
+
eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
|
|
1044
1231
|
...instanceConfig.options
|
|
1045
1232
|
});
|
|
1046
|
-
instanceType =
|
|
1233
|
+
instanceType = core.StringHelper.kebabCase("EventBusService");
|
|
1234
|
+
}
|
|
1235
|
+
else if (type === EventBusComponentType.SocketClient) {
|
|
1236
|
+
component = new eventBusSocketClient.EventBusSocketClient({
|
|
1237
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1238
|
+
...instanceConfig.options
|
|
1239
|
+
});
|
|
1240
|
+
instanceType = core.StringHelper.kebabCase("EventBusSocketClient");
|
|
1047
1241
|
}
|
|
1048
1242
|
else {
|
|
1049
1243
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1093,7 +1287,8 @@ function initialiseFaucetConnector(engineCore, context, instanceConfig, override
|
|
|
1093
1287
|
let connector;
|
|
1094
1288
|
let instanceType;
|
|
1095
1289
|
if (type === FaucetConnectorType.Iota) {
|
|
1096
|
-
const
|
|
1290
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1291
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1097
1292
|
connector = new walletConnectorIota.IotaFaucetConnector({
|
|
1098
1293
|
...instanceConfig.options,
|
|
1099
1294
|
config: {
|
|
@@ -1132,7 +1327,11 @@ const FederatedCatalogueComponentType = {
|
|
|
1132
1327
|
/**
|
|
1133
1328
|
* Service.
|
|
1134
1329
|
*/
|
|
1135
|
-
Service: "service"
|
|
1330
|
+
Service: "service",
|
|
1331
|
+
/**
|
|
1332
|
+
* REST client.
|
|
1333
|
+
*/
|
|
1334
|
+
RestClient: "rest-client"
|
|
1136
1335
|
};
|
|
1137
1336
|
|
|
1138
1337
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1160,11 +1359,15 @@ function initialiseFederatedCatalogueComponent(engineCore, context, instanceConf
|
|
|
1160
1359
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
|
|
1161
1360
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
|
|
1162
1361
|
component = new federatedCatalogueService.FederatedCatalogueService({
|
|
1163
|
-
|
|
1164
|
-
identityResolverComponentType:
|
|
1362
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1363
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
1165
1364
|
...instanceConfig.options
|
|
1166
1365
|
});
|
|
1167
|
-
instanceType =
|
|
1366
|
+
instanceType = core.StringHelper.kebabCase("FederatedCatalogueService");
|
|
1367
|
+
}
|
|
1368
|
+
else if (type === FederatedCatalogueComponentType.RestClient) {
|
|
1369
|
+
component = new federatedCatalogueRestClient.FederatedCatalogueClient(instanceConfig.options);
|
|
1370
|
+
instanceType = core.StringHelper.kebabCase("FederatedCatalogueClient");
|
|
1168
1371
|
}
|
|
1169
1372
|
else {
|
|
1170
1373
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1191,7 +1394,11 @@ const IdentityComponentType = {
|
|
|
1191
1394
|
/**
|
|
1192
1395
|
* Service.
|
|
1193
1396
|
*/
|
|
1194
|
-
Service: "service"
|
|
1397
|
+
Service: "service",
|
|
1398
|
+
/**
|
|
1399
|
+
* REST client.
|
|
1400
|
+
*/
|
|
1401
|
+
RestClient: "rest-client"
|
|
1195
1402
|
};
|
|
1196
1403
|
|
|
1197
1404
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1230,9 +1437,10 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1230
1437
|
let connector;
|
|
1231
1438
|
let instanceType;
|
|
1232
1439
|
if (type === IdentityConnectorType.Iota) {
|
|
1233
|
-
const
|
|
1440
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1441
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1234
1442
|
connector = new identityConnectorIota.IotaIdentityConnector({
|
|
1235
|
-
vaultConnectorType:
|
|
1443
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1236
1444
|
...instanceConfig.options,
|
|
1237
1445
|
config: {
|
|
1238
1446
|
...dltConfig?.options?.config,
|
|
@@ -1245,7 +1453,7 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1245
1453
|
identityConnectorEntityStorage.initSchema({ includeProfile: false });
|
|
1246
1454
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1247
1455
|
connector = new identityConnectorEntityStorage.EntityStorageIdentityConnector({
|
|
1248
|
-
vaultConnectorType:
|
|
1456
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1249
1457
|
...instanceConfig.options
|
|
1250
1458
|
});
|
|
1251
1459
|
instanceType = identityConnectorEntityStorage.EntityStorageIdentityConnector.NAMESPACE;
|
|
@@ -1279,7 +1487,11 @@ function initialiseIdentityComponent(engineCore, context, instanceConfig, overri
|
|
|
1279
1487
|
let instanceType;
|
|
1280
1488
|
if (type === IdentityComponentType.Service) {
|
|
1281
1489
|
component = new identityService.IdentityService(instanceConfig.options);
|
|
1282
|
-
instanceType =
|
|
1490
|
+
instanceType = core.StringHelper.kebabCase("IdentityService");
|
|
1491
|
+
}
|
|
1492
|
+
else if (type === IdentityComponentType.RestClient) {
|
|
1493
|
+
component = new identityRestClient.IdentityClient(instanceConfig.options);
|
|
1494
|
+
instanceType = core.StringHelper.kebabCase("IdentityClient");
|
|
1283
1495
|
}
|
|
1284
1496
|
else {
|
|
1285
1497
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1303,7 +1515,11 @@ const IdentityProfileComponentType = {
|
|
|
1303
1515
|
/**
|
|
1304
1516
|
* Service.
|
|
1305
1517
|
*/
|
|
1306
|
-
Service: "service"
|
|
1518
|
+
Service: "service",
|
|
1519
|
+
/**
|
|
1520
|
+
* REST client.
|
|
1521
|
+
*/
|
|
1522
|
+
RestClient: "rest-client"
|
|
1307
1523
|
};
|
|
1308
1524
|
|
|
1309
1525
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1375,10 +1591,14 @@ function initialiseIdentityProfileComponent(engineCore, context, instanceConfig,
|
|
|
1375
1591
|
let instanceType;
|
|
1376
1592
|
if (type === IdentityProfileComponentType.Service) {
|
|
1377
1593
|
component = new identityService.IdentityProfileService({
|
|
1378
|
-
profileEntityConnectorType:
|
|
1594
|
+
profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
|
|
1379
1595
|
...instanceConfig.options
|
|
1380
1596
|
});
|
|
1381
|
-
instanceType =
|
|
1597
|
+
instanceType = core.StringHelper.kebabCase("IdentityProfileService");
|
|
1598
|
+
}
|
|
1599
|
+
else if (type === IdentityProfileComponentType.RestClient) {
|
|
1600
|
+
component = new identityRestClient.IdentityProfileClient(instanceConfig.options);
|
|
1601
|
+
instanceType = core.StringHelper.kebabCase("IdentityProfileClient");
|
|
1382
1602
|
}
|
|
1383
1603
|
else {
|
|
1384
1604
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1405,7 +1625,11 @@ const IdentityResolverComponentType = {
|
|
|
1405
1625
|
/**
|
|
1406
1626
|
* Service.
|
|
1407
1627
|
*/
|
|
1408
|
-
Service: "service"
|
|
1628
|
+
Service: "service",
|
|
1629
|
+
/**
|
|
1630
|
+
* REST client.
|
|
1631
|
+
*/
|
|
1632
|
+
RestClient: "rest-client"
|
|
1409
1633
|
};
|
|
1410
1634
|
|
|
1411
1635
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1448,7 +1672,8 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1448
1672
|
let connector;
|
|
1449
1673
|
let instanceType;
|
|
1450
1674
|
if (type === IdentityResolverConnectorType.Iota) {
|
|
1451
|
-
const
|
|
1675
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1676
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1452
1677
|
connector = new identityConnectorIota.IotaIdentityResolverConnector({
|
|
1453
1678
|
...instanceConfig.options,
|
|
1454
1679
|
config: {
|
|
@@ -1462,7 +1687,7 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1462
1687
|
identityConnectorEntityStorage.initSchema({ includeProfile: false });
|
|
1463
1688
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1464
1689
|
connector = new identityConnectorEntityStorage.EntityStorageIdentityResolverConnector({
|
|
1465
|
-
vaultConnectorType:
|
|
1690
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1466
1691
|
...instanceConfig.options
|
|
1467
1692
|
});
|
|
1468
1693
|
instanceType = identityConnectorEntityStorage.EntityStorageIdentityResolverConnector.NAMESPACE;
|
|
@@ -1501,13 +1726,18 @@ function initialiseIdentityResolverComponent(engineCore, context, instanceConfig
|
|
|
1501
1726
|
let component;
|
|
1502
1727
|
let instanceType;
|
|
1503
1728
|
if (type === IdentityResolverComponentType.Service) {
|
|
1729
|
+
const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
|
|
1504
1730
|
component = new identityService.IdentityResolverService({
|
|
1505
|
-
fallbackResolverConnectorType:
|
|
1731
|
+
fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
|
|
1506
1732
|
? IdentityResolverConnectorType.Universal
|
|
1507
1733
|
: undefined,
|
|
1508
1734
|
...instanceConfig.options
|
|
1509
1735
|
});
|
|
1510
|
-
instanceType =
|
|
1736
|
+
instanceType = core.StringHelper.kebabCase("IdentityResolverService");
|
|
1737
|
+
}
|
|
1738
|
+
else if (type === IdentityResolverComponentType.RestClient) {
|
|
1739
|
+
component = new identityRestClient.IdentityResolverClient(instanceConfig.options);
|
|
1740
|
+
instanceType = core.StringHelper.kebabCase("IdentityResolverClient");
|
|
1511
1741
|
}
|
|
1512
1742
|
else {
|
|
1513
1743
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1531,7 +1761,11 @@ const ImmutableProofComponentType = {
|
|
|
1531
1761
|
/**
|
|
1532
1762
|
* Service.
|
|
1533
1763
|
*/
|
|
1534
|
-
Service: "service"
|
|
1764
|
+
Service: "service",
|
|
1765
|
+
/**
|
|
1766
|
+
* REST client.
|
|
1767
|
+
*/
|
|
1768
|
+
RestClient: "rest-client"
|
|
1535
1769
|
};
|
|
1536
1770
|
|
|
1537
1771
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1556,13 +1790,17 @@ function initialiseImmutableProofComponent(engineCore, context, instanceConfig,
|
|
|
1556
1790
|
immutableProofService.initSchema();
|
|
1557
1791
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
|
|
1558
1792
|
component = new immutableProofService.ImmutableProofService({
|
|
1559
|
-
verifiableStorageType:
|
|
1560
|
-
identityConnectorType:
|
|
1561
|
-
backgroundTaskConnectorType:
|
|
1562
|
-
eventBusComponentType:
|
|
1793
|
+
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
1794
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
1795
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1796
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
1563
1797
|
...instanceConfig.options
|
|
1564
1798
|
});
|
|
1565
|
-
instanceType =
|
|
1799
|
+
instanceType = core.StringHelper.kebabCase("ImmutableProofService");
|
|
1800
|
+
}
|
|
1801
|
+
else if (type === ImmutableProofComponentType.RestClient) {
|
|
1802
|
+
component = new immutableProofRestClient.ImmutableProofClient(instanceConfig.options);
|
|
1803
|
+
instanceType = core.StringHelper.kebabCase("ImmutableProofClient");
|
|
1566
1804
|
}
|
|
1567
1805
|
else {
|
|
1568
1806
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1589,7 +1827,11 @@ const LoggingComponentType = {
|
|
|
1589
1827
|
/**
|
|
1590
1828
|
* Service.
|
|
1591
1829
|
*/
|
|
1592
|
-
Service: "service"
|
|
1830
|
+
Service: "service",
|
|
1831
|
+
/**
|
|
1832
|
+
* REST client.
|
|
1833
|
+
*/
|
|
1834
|
+
RestClient: "rest-client"
|
|
1593
1835
|
};
|
|
1594
1836
|
|
|
1595
1837
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1674,10 +1916,14 @@ function initialiseLoggingComponent(engineCore, context, instanceConfig, overrid
|
|
|
1674
1916
|
let instanceType;
|
|
1675
1917
|
if (type === LoggingComponentType.Service) {
|
|
1676
1918
|
component = new loggingService.LoggingService({
|
|
1677
|
-
loggingConnectorType:
|
|
1919
|
+
loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
|
|
1678
1920
|
...instanceConfig.options
|
|
1679
1921
|
});
|
|
1680
|
-
instanceType =
|
|
1922
|
+
instanceType = core.StringHelper.kebabCase("LoggingService");
|
|
1923
|
+
}
|
|
1924
|
+
else if (type === LoggingComponentType.RestClient) {
|
|
1925
|
+
component = new loggingRestClient.LoggingClient(instanceConfig.options);
|
|
1926
|
+
instanceType = core.StringHelper.kebabCase("LoggingClient");
|
|
1681
1927
|
}
|
|
1682
1928
|
else {
|
|
1683
1929
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1777,14 +2023,14 @@ function initialiseMessagingEmailConnector(engineCore, context, instanceConfig,
|
|
|
1777
2023
|
messagingConnectorEntityStorage.initSchema({ email: true, sms: false, pushNotification: false });
|
|
1778
2024
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
|
|
1779
2025
|
connector = new messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector({
|
|
1780
|
-
|
|
2026
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1781
2027
|
...instanceConfig.options
|
|
1782
2028
|
});
|
|
1783
2029
|
instanceType = messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
1784
2030
|
}
|
|
1785
2031
|
else if (type === MessagingEmailConnectorType.Aws) {
|
|
1786
2032
|
connector = new messagingConnectorAws.AwsMessagingEmailConnector({
|
|
1787
|
-
|
|
2033
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1788
2034
|
...instanceConfig.options
|
|
1789
2035
|
});
|
|
1790
2036
|
instanceType = messagingConnectorAws.AwsMessagingEmailConnector.NAMESPACE;
|
|
@@ -1820,14 +2066,14 @@ function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, ov
|
|
|
1820
2066
|
messagingConnectorEntityStorage.initSchema({ email: false, sms: true, pushNotification: false });
|
|
1821
2067
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
|
|
1822
2068
|
connector = new messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector({
|
|
1823
|
-
|
|
2069
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1824
2070
|
...instanceConfig.options
|
|
1825
2071
|
});
|
|
1826
2072
|
instanceType = messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
1827
2073
|
}
|
|
1828
2074
|
else if (type === MessagingSmsConnectorType.Aws) {
|
|
1829
2075
|
connector = new messagingConnectorAws.AwsMessagingSmsConnector({
|
|
1830
|
-
|
|
2076
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1831
2077
|
...instanceConfig.options
|
|
1832
2078
|
});
|
|
1833
2079
|
instanceType = messagingConnectorAws.AwsMessagingSmsConnector.NAMESPACE;
|
|
@@ -1864,14 +2110,14 @@ function initialiseMessagingPushNotificationConnector(engineCore, context, insta
|
|
|
1864
2110
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
|
|
1865
2111
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
|
|
1866
2112
|
connector = new messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector({
|
|
1867
|
-
|
|
2113
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1868
2114
|
...instanceConfig.options
|
|
1869
2115
|
});
|
|
1870
2116
|
instanceType = messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
1871
2117
|
}
|
|
1872
2118
|
else if (type === MessagingPushNotificationConnectorType.Aws) {
|
|
1873
2119
|
connector = new messagingConnectorAws.AwsMessagingPushNotificationConnector({
|
|
1874
|
-
|
|
2120
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1875
2121
|
...instanceConfig.options
|
|
1876
2122
|
});
|
|
1877
2123
|
instanceType = messagingConnectorAws.AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
@@ -1907,12 +2153,12 @@ function initialiseMessagingComponent(engineCore, context, instanceConfig, overr
|
|
|
1907
2153
|
messagingService.initSchema();
|
|
1908
2154
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
1909
2155
|
component = new messagingService.MessagingService({
|
|
1910
|
-
messagingEmailConnectorType:
|
|
1911
|
-
messagingSmsConnectorType:
|
|
1912
|
-
messagingPushNotificationConnectorType:
|
|
2156
|
+
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
2157
|
+
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
2158
|
+
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
1913
2159
|
...instanceConfig.options
|
|
1914
2160
|
});
|
|
1915
|
-
instanceType =
|
|
2161
|
+
instanceType = core.StringHelper.kebabCase("MessagingService");
|
|
1916
2162
|
}
|
|
1917
2163
|
else {
|
|
1918
2164
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -1936,7 +2182,11 @@ const NftComponentType = {
|
|
|
1936
2182
|
/**
|
|
1937
2183
|
* Service.
|
|
1938
2184
|
*/
|
|
1939
|
-
Service: "service"
|
|
2185
|
+
Service: "service",
|
|
2186
|
+
/**
|
|
2187
|
+
* REST client.
|
|
2188
|
+
*/
|
|
2189
|
+
RestClient: "rest-client"
|
|
1940
2190
|
};
|
|
1941
2191
|
|
|
1942
2192
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1982,8 +2232,8 @@ function initialiseNftConnector(engineCore, context, instanceConfig, overrideIns
|
|
|
1982
2232
|
}
|
|
1983
2233
|
else if (type === NftConnectorType.Iota) {
|
|
1984
2234
|
connector = new nftConnectorIota.IotaNftConnector({
|
|
1985
|
-
vaultConnectorType:
|
|
1986
|
-
walletConnectorType:
|
|
2235
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2236
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
1987
2237
|
...instanceConfig.options
|
|
1988
2238
|
});
|
|
1989
2239
|
instanceType = nftConnectorIota.IotaNftConnector.NAMESPACE;
|
|
@@ -2020,7 +2270,11 @@ function initialiseNftComponent(engineCore, context, instanceConfig, overrideIns
|
|
|
2020
2270
|
let instanceType;
|
|
2021
2271
|
if (type === NftComponentType.Service) {
|
|
2022
2272
|
component = new nftService.NftService(instanceConfig.options);
|
|
2023
|
-
instanceType =
|
|
2273
|
+
instanceType = core.StringHelper.kebabCase("NftService");
|
|
2274
|
+
}
|
|
2275
|
+
else if (type === NftComponentType.RestClient) {
|
|
2276
|
+
component = new nftRestClient.NftClient(instanceConfig.options);
|
|
2277
|
+
instanceType = core.StringHelper.kebabCase("NftClient");
|
|
2024
2278
|
}
|
|
2025
2279
|
else {
|
|
2026
2280
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2047,7 +2301,11 @@ const RightsManagementComponentType = {
|
|
|
2047
2301
|
/**
|
|
2048
2302
|
* Service.
|
|
2049
2303
|
*/
|
|
2050
|
-
Service: "service"
|
|
2304
|
+
Service: "service",
|
|
2305
|
+
/**
|
|
2306
|
+
* REST client.
|
|
2307
|
+
*/
|
|
2308
|
+
RestClient: "rest-client"
|
|
2051
2309
|
};
|
|
2052
2310
|
|
|
2053
2311
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2070,10 +2328,15 @@ function initialiseRightsManagementComponent(engineCore, context, instanceConfig
|
|
|
2070
2328
|
let instanceType;
|
|
2071
2329
|
if (type === RightsManagementComponentType.Service) {
|
|
2072
2330
|
component = new rightsManagementService.RightsManagementService({
|
|
2073
|
-
|
|
2331
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2332
|
+
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
2074
2333
|
...instanceConfig.options
|
|
2075
2334
|
});
|
|
2076
|
-
instanceType =
|
|
2335
|
+
instanceType = core.StringHelper.kebabCase("RightsManagementService");
|
|
2336
|
+
}
|
|
2337
|
+
else if (type === RightsManagementComponentType.RestClient) {
|
|
2338
|
+
component = new rightsManagementRestClient.RightsManagementClient(instanceConfig.options);
|
|
2339
|
+
instanceType = core.StringHelper.kebabCase("RightsManagementClient");
|
|
2077
2340
|
}
|
|
2078
2341
|
else {
|
|
2079
2342
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2124,8 +2387,11 @@ function initialiseRightsManagementPapComponent(engineCore, context, instanceCon
|
|
|
2124
2387
|
if (type === RightsManagementPapComponentType.Service) {
|
|
2125
2388
|
rightsManagementPapService.initSchema();
|
|
2126
2389
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
|
|
2127
|
-
component = new rightsManagementPapService.PolicyAdministrationPointService(
|
|
2128
|
-
|
|
2390
|
+
component = new rightsManagementPapService.PolicyAdministrationPointService({
|
|
2391
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2392
|
+
...instanceConfig.options
|
|
2393
|
+
});
|
|
2394
|
+
instanceType = core.StringHelper.kebabCase("PolicyAdministrationPointService");
|
|
2129
2395
|
}
|
|
2130
2396
|
else {
|
|
2131
2397
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2142,6 +2408,348 @@ function initialiseRightsManagementPapComponent(engineCore, context, instanceCon
|
|
|
2142
2408
|
return finalInstanceType;
|
|
2143
2409
|
}
|
|
2144
2410
|
|
|
2411
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2412
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2413
|
+
/**
|
|
2414
|
+
* Rights management PDP component types.
|
|
2415
|
+
*/
|
|
2416
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2417
|
+
const RightsManagementPdpComponentType = {
|
|
2418
|
+
/**
|
|
2419
|
+
* Service.
|
|
2420
|
+
*/
|
|
2421
|
+
Service: "service"
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2424
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2425
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2426
|
+
/**
|
|
2427
|
+
* Initialise the rights management PDP component.
|
|
2428
|
+
* @param engineCore The engine core.
|
|
2429
|
+
* @param context The context for the engine.
|
|
2430
|
+
* @param instanceConfig The instance config.
|
|
2431
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2432
|
+
* @returns The name of the instance created.
|
|
2433
|
+
* @throws GeneralError if the component type is unknown.
|
|
2434
|
+
*/
|
|
2435
|
+
function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2436
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2437
|
+
element: `Rights Management PDP Component: ${instanceConfig.type}`
|
|
2438
|
+
}));
|
|
2439
|
+
const type = instanceConfig.type;
|
|
2440
|
+
let component;
|
|
2441
|
+
let instanceType;
|
|
2442
|
+
if (type === RightsManagementPdpComponentType.Service) {
|
|
2443
|
+
component = new rightsManagementPdpService.PolicyDecisionPointService({
|
|
2444
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2445
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
2446
|
+
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
2447
|
+
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
2448
|
+
...instanceConfig.options
|
|
2449
|
+
});
|
|
2450
|
+
instanceType = core.StringHelper.kebabCase("PolicyDecisionPointService");
|
|
2451
|
+
}
|
|
2452
|
+
else {
|
|
2453
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2454
|
+
type,
|
|
2455
|
+
componentType: "RightsManagementPdpComponent"
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2459
|
+
context.componentInstances.push({
|
|
2460
|
+
instanceType: finalInstanceType,
|
|
2461
|
+
component
|
|
2462
|
+
});
|
|
2463
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2464
|
+
return finalInstanceType;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2468
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2469
|
+
/**
|
|
2470
|
+
* Rights management PEP component types.
|
|
2471
|
+
*/
|
|
2472
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2473
|
+
const RightsManagementPepComponentType = {
|
|
2474
|
+
/**
|
|
2475
|
+
* Service.
|
|
2476
|
+
*/
|
|
2477
|
+
Service: "service"
|
|
2478
|
+
};
|
|
2479
|
+
|
|
2480
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2481
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2482
|
+
/**
|
|
2483
|
+
* Initialise the rights management PEP component.
|
|
2484
|
+
* @param engineCore The engine core.
|
|
2485
|
+
* @param context The context for the engine.
|
|
2486
|
+
* @param instanceConfig The instance config.
|
|
2487
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2488
|
+
* @returns The name of the instance created.
|
|
2489
|
+
* @throws GeneralError if the component type is unknown.
|
|
2490
|
+
*/
|
|
2491
|
+
function initialiseRightsManagementPepComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2492
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2493
|
+
element: `Rights Management PEP Component: ${instanceConfig.type}`
|
|
2494
|
+
}));
|
|
2495
|
+
const type = instanceConfig.type;
|
|
2496
|
+
let component;
|
|
2497
|
+
let instanceType;
|
|
2498
|
+
if (type === RightsManagementPepComponentType.Service) {
|
|
2499
|
+
component = new rightsManagementPepService.PolicyEnforcementPointService({
|
|
2500
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2501
|
+
policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
|
|
2502
|
+
...instanceConfig.options
|
|
2503
|
+
});
|
|
2504
|
+
instanceType = core.StringHelper.kebabCase("PolicyEnforcementPointService");
|
|
2505
|
+
}
|
|
2506
|
+
else {
|
|
2507
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2508
|
+
type,
|
|
2509
|
+
componentType: "RightsManagementPepComponent"
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2513
|
+
context.componentInstances.push({
|
|
2514
|
+
instanceType: finalInstanceType,
|
|
2515
|
+
component
|
|
2516
|
+
});
|
|
2517
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2518
|
+
return finalInstanceType;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2522
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2523
|
+
/**
|
|
2524
|
+
* Rights management PIP component types.
|
|
2525
|
+
*/
|
|
2526
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2527
|
+
const RightsManagementPipComponentType = {
|
|
2528
|
+
/**
|
|
2529
|
+
* Service.
|
|
2530
|
+
*/
|
|
2531
|
+
Service: "service"
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2535
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2536
|
+
/**
|
|
2537
|
+
* Initialise the rights management PIP component.
|
|
2538
|
+
* @param engineCore The engine core.
|
|
2539
|
+
* @param context The context for the engine.
|
|
2540
|
+
* @param instanceConfig The instance config.
|
|
2541
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2542
|
+
* @returns The name of the instance created.
|
|
2543
|
+
* @throws GeneralError if the component type is unknown.
|
|
2544
|
+
*/
|
|
2545
|
+
function initialiseRightsManagementPipComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2546
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2547
|
+
element: `Rights Management PIP Component: ${instanceConfig.type}`
|
|
2548
|
+
}));
|
|
2549
|
+
const type = instanceConfig.type;
|
|
2550
|
+
let component;
|
|
2551
|
+
let instanceType;
|
|
2552
|
+
if (type === RightsManagementPipComponentType.Service) {
|
|
2553
|
+
component = new rightsManagementPipService.PolicyInformationPointService({
|
|
2554
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2555
|
+
...instanceConfig.options
|
|
2556
|
+
});
|
|
2557
|
+
instanceType = core.StringHelper.kebabCase("PolicyInformationPointService");
|
|
2558
|
+
}
|
|
2559
|
+
else {
|
|
2560
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2561
|
+
type,
|
|
2562
|
+
componentType: "RightsManagementPipComponent"
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2566
|
+
context.componentInstances.push({
|
|
2567
|
+
instanceType: finalInstanceType,
|
|
2568
|
+
component
|
|
2569
|
+
});
|
|
2570
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2571
|
+
return finalInstanceType;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2575
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2576
|
+
/**
|
|
2577
|
+
* Rights management PMP component types.
|
|
2578
|
+
*/
|
|
2579
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2580
|
+
const RightsManagementPmpComponentType = {
|
|
2581
|
+
/**
|
|
2582
|
+
* Service.
|
|
2583
|
+
*/
|
|
2584
|
+
Service: "service"
|
|
2585
|
+
};
|
|
2586
|
+
|
|
2587
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2588
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2589
|
+
/**
|
|
2590
|
+
* Initialise the rights management PMP component.
|
|
2591
|
+
* @param engineCore The engine core.
|
|
2592
|
+
* @param context The context for the engine.
|
|
2593
|
+
* @param instanceConfig The instance config.
|
|
2594
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2595
|
+
* @returns The name of the instance created.
|
|
2596
|
+
* @throws GeneralError if the component type is unknown.
|
|
2597
|
+
*/
|
|
2598
|
+
function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2599
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2600
|
+
element: `Rights Management PMP Component: ${instanceConfig.type}`
|
|
2601
|
+
}));
|
|
2602
|
+
const type = instanceConfig.type;
|
|
2603
|
+
let component;
|
|
2604
|
+
let instanceType;
|
|
2605
|
+
if (type === RightsManagementPmpComponentType.Service) {
|
|
2606
|
+
component = new rightsManagementPmpService.PolicyManagementPointService({
|
|
2607
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2608
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2609
|
+
...instanceConfig.options
|
|
2610
|
+
});
|
|
2611
|
+
instanceType = core.StringHelper.kebabCase("PolicyManagementPointService");
|
|
2612
|
+
}
|
|
2613
|
+
else {
|
|
2614
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2615
|
+
type,
|
|
2616
|
+
componentType: "RightsManagementPmpComponent"
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2620
|
+
context.componentInstances.push({
|
|
2621
|
+
instanceType: finalInstanceType,
|
|
2622
|
+
component
|
|
2623
|
+
});
|
|
2624
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2625
|
+
return finalInstanceType;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2629
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2630
|
+
/**
|
|
2631
|
+
* Rights management PXP component types.
|
|
2632
|
+
*/
|
|
2633
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2634
|
+
const RightsManagementPxpComponentType = {
|
|
2635
|
+
/**
|
|
2636
|
+
* Service.
|
|
2637
|
+
*/
|
|
2638
|
+
Service: "service"
|
|
2639
|
+
};
|
|
2640
|
+
|
|
2641
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2642
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2643
|
+
/**
|
|
2644
|
+
* Initialise the rights management PXP component.
|
|
2645
|
+
* @param engineCore The engine core.
|
|
2646
|
+
* @param context The context for the engine.
|
|
2647
|
+
* @param instanceConfig The instance config.
|
|
2648
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2649
|
+
* @returns The name of the instance created.
|
|
2650
|
+
* @throws GeneralError if the component type is unknown.
|
|
2651
|
+
*/
|
|
2652
|
+
function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2653
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2654
|
+
element: `Rights Management PXP Component: ${instanceConfig.type}`
|
|
2655
|
+
}));
|
|
2656
|
+
const type = instanceConfig.type;
|
|
2657
|
+
let component;
|
|
2658
|
+
let instanceType;
|
|
2659
|
+
if (type === RightsManagementPxpComponentType.Service) {
|
|
2660
|
+
component = new rightsManagementPxpService.PolicyExecutionPointService({
|
|
2661
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2662
|
+
...instanceConfig.options
|
|
2663
|
+
});
|
|
2664
|
+
instanceType = core.StringHelper.kebabCase("PolicyExecutionPointService");
|
|
2665
|
+
}
|
|
2666
|
+
else {
|
|
2667
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2668
|
+
type,
|
|
2669
|
+
componentType: "RightsManagementPxpComponent"
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2673
|
+
context.componentInstances.push({
|
|
2674
|
+
instanceType: finalInstanceType,
|
|
2675
|
+
component
|
|
2676
|
+
});
|
|
2677
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2678
|
+
return finalInstanceType;
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2682
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2683
|
+
/**
|
|
2684
|
+
* Synchronised storage component types.
|
|
2685
|
+
*/
|
|
2686
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2687
|
+
const SynchronisedStorageComponentType = {
|
|
2688
|
+
/**
|
|
2689
|
+
* Service.
|
|
2690
|
+
*/
|
|
2691
|
+
Service: "service",
|
|
2692
|
+
/**
|
|
2693
|
+
* REST client.
|
|
2694
|
+
*/
|
|
2695
|
+
RestClient: "rest-client"
|
|
2696
|
+
};
|
|
2697
|
+
|
|
2698
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2699
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2700
|
+
/**
|
|
2701
|
+
* Initialise the synchronised storage component.
|
|
2702
|
+
* @param engineCore The engine core.
|
|
2703
|
+
* @param context The context for the engine.
|
|
2704
|
+
* @param instanceConfig The instance config.
|
|
2705
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2706
|
+
* @returns The name of the instance created.
|
|
2707
|
+
* @throws GeneralError if the component type is unknown.
|
|
2708
|
+
*/
|
|
2709
|
+
function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2710
|
+
engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
|
|
2711
|
+
element: `Synchronised Storage Component: ${instanceConfig.type}`
|
|
2712
|
+
}));
|
|
2713
|
+
const type = instanceConfig.type;
|
|
2714
|
+
let component;
|
|
2715
|
+
let instanceType;
|
|
2716
|
+
if (type === SynchronisedStorageComponentType.Service) {
|
|
2717
|
+
synchronisedStorageService.initSchema();
|
|
2718
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
|
|
2719
|
+
component = new synchronisedStorageService.SynchronisedStorageService({
|
|
2720
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2721
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
2722
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2723
|
+
verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
2724
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2725
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2726
|
+
trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
|
|
2727
|
+
blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
|
|
2728
|
+
"public"
|
|
2729
|
+
]),
|
|
2730
|
+
...instanceConfig.options
|
|
2731
|
+
});
|
|
2732
|
+
instanceType = core.StringHelper.kebabCase("SynchronisedStorageService");
|
|
2733
|
+
}
|
|
2734
|
+
else if (type === SynchronisedStorageComponentType.RestClient) {
|
|
2735
|
+
component = new synchronisedStorageRestClient.SynchronisedStorageClient(instanceConfig.options);
|
|
2736
|
+
instanceType = core.StringHelper.kebabCase("SynchronisedStorageClient");
|
|
2737
|
+
}
|
|
2738
|
+
else {
|
|
2739
|
+
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
2740
|
+
type,
|
|
2741
|
+
componentType: "SynchronisedStorageComponent"
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2745
|
+
context.componentInstances.push({
|
|
2746
|
+
instanceType: finalInstanceType,
|
|
2747
|
+
component
|
|
2748
|
+
});
|
|
2749
|
+
core.ComponentFactory.register(finalInstanceType, () => component);
|
|
2750
|
+
return finalInstanceType;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2145
2753
|
// Copyright 2024 IOTA Stiftung.
|
|
2146
2754
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2147
2755
|
/**
|
|
@@ -2152,7 +2760,7 @@ const TaskSchedulerComponentType = {
|
|
|
2152
2760
|
/**
|
|
2153
2761
|
* Task scheduler.
|
|
2154
2762
|
*/
|
|
2155
|
-
|
|
2763
|
+
Service: "service"
|
|
2156
2764
|
};
|
|
2157
2765
|
|
|
2158
2766
|
/**
|
|
@@ -2171,12 +2779,12 @@ function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, o
|
|
|
2171
2779
|
const type = instanceConfig.type;
|
|
2172
2780
|
let component;
|
|
2173
2781
|
let instanceType;
|
|
2174
|
-
if (type === TaskSchedulerComponentType.
|
|
2175
|
-
component = new backgroundTaskScheduler.
|
|
2176
|
-
|
|
2782
|
+
if (type === TaskSchedulerComponentType.Service) {
|
|
2783
|
+
component = new backgroundTaskScheduler.TaskSchedulerService({
|
|
2784
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2177
2785
|
...instanceConfig.options
|
|
2178
2786
|
});
|
|
2179
|
-
instanceType =
|
|
2787
|
+
instanceType = core.StringHelper.kebabCase("TaskSchedulerService");
|
|
2180
2788
|
}
|
|
2181
2789
|
else {
|
|
2182
2790
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2203,7 +2811,11 @@ const TelemetryComponentType = {
|
|
|
2203
2811
|
/**
|
|
2204
2812
|
* Service.
|
|
2205
2813
|
*/
|
|
2206
|
-
Service: "service"
|
|
2814
|
+
Service: "service",
|
|
2815
|
+
/**
|
|
2816
|
+
* REST client.
|
|
2817
|
+
*/
|
|
2818
|
+
RestClient: "rest-client"
|
|
2207
2819
|
};
|
|
2208
2820
|
|
|
2209
2821
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2242,7 +2854,7 @@ function initialiseTelemetryConnector(engineCore, context, instanceConfig, overr
|
|
|
2242
2854
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
|
|
2243
2855
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
|
|
2244
2856
|
connector = new telemetryConnectorEntityStorage.EntityStorageTelemetryConnector({
|
|
2245
|
-
|
|
2857
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2246
2858
|
...instanceConfig.options
|
|
2247
2859
|
});
|
|
2248
2860
|
instanceType = telemetryConnectorEntityStorage.EntityStorageTelemetryConnector.NAMESPACE;
|
|
@@ -2276,10 +2888,14 @@ function initialiseTelemetryComponent(engineCore, context, instanceConfig, overr
|
|
|
2276
2888
|
let instanceType;
|
|
2277
2889
|
if (type === TelemetryComponentType.Service) {
|
|
2278
2890
|
component = new telemetryService.TelemetryService({
|
|
2279
|
-
telemetryConnectorType:
|
|
2891
|
+
telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
|
|
2280
2892
|
...instanceConfig.options
|
|
2281
2893
|
});
|
|
2282
|
-
instanceType =
|
|
2894
|
+
instanceType = core.StringHelper.kebabCase("TelemetryService");
|
|
2895
|
+
}
|
|
2896
|
+
else if (type === TelemetryComponentType.RestClient) {
|
|
2897
|
+
component = new telemetryRestClient.TelemetryClient(instanceConfig.options);
|
|
2898
|
+
instanceType = core.StringHelper.kebabCase("TelemetryClient");
|
|
2283
2899
|
}
|
|
2284
2900
|
else {
|
|
2285
2901
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2361,7 +2977,11 @@ const VerifiableStorageComponentType = {
|
|
|
2361
2977
|
/**
|
|
2362
2978
|
* Service.
|
|
2363
2979
|
*/
|
|
2364
|
-
Service: "service"
|
|
2980
|
+
Service: "service",
|
|
2981
|
+
/**
|
|
2982
|
+
* REST client.
|
|
2983
|
+
*/
|
|
2984
|
+
RestClient: "rest-client"
|
|
2365
2985
|
};
|
|
2366
2986
|
|
|
2367
2987
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -2400,9 +3020,10 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2400
3020
|
let connector;
|
|
2401
3021
|
let instanceType;
|
|
2402
3022
|
if (type === VerifiableStorageConnectorType.Iota) {
|
|
2403
|
-
const
|
|
3023
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
3024
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2404
3025
|
connector = new verifiableStorageConnectorIota.IotaVerifiableStorageConnector({
|
|
2405
|
-
vaultConnectorType:
|
|
3026
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2406
3027
|
...instanceConfig.options,
|
|
2407
3028
|
config: {
|
|
2408
3029
|
...dltConfig?.options?.config,
|
|
@@ -2451,7 +3072,11 @@ function initialiseVerifiableStorageComponent(engineCore, context, instanceConfi
|
|
|
2451
3072
|
component = new verifiableStorageService.VerifiableStorageService({
|
|
2452
3073
|
...instanceConfig.options
|
|
2453
3074
|
});
|
|
2454
|
-
instanceType =
|
|
3075
|
+
instanceType = core.StringHelper.kebabCase("VerifiableStorageService");
|
|
3076
|
+
}
|
|
3077
|
+
else if (type === VerifiableStorageComponentType.RestClient) {
|
|
3078
|
+
component = new verifiableStorageRestClient.VerifiableStorageClient(instanceConfig.options);
|
|
3079
|
+
instanceType = core.StringHelper.kebabCase("VerifiableStorageClient");
|
|
2455
3080
|
}
|
|
2456
3081
|
else {
|
|
2457
3082
|
throw new core.GeneralError("engineCore", "componentUnknownType", {
|
|
@@ -2504,10 +3129,11 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2504
3129
|
let connector;
|
|
2505
3130
|
let instanceType;
|
|
2506
3131
|
if (type === WalletConnectorType.Iota) {
|
|
2507
|
-
const
|
|
3132
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
3133
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2508
3134
|
connector = new walletConnectorIota.IotaWalletConnector({
|
|
2509
|
-
vaultConnectorType:
|
|
2510
|
-
faucetConnectorType:
|
|
3135
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3136
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2511
3137
|
...instanceConfig.options,
|
|
2512
3138
|
config: {
|
|
2513
3139
|
...dltConfig?.options?.config,
|
|
@@ -2518,8 +3144,8 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2518
3144
|
}
|
|
2519
3145
|
else if (type === WalletConnectorType.EntityStorage) {
|
|
2520
3146
|
connector = new walletConnectorEntityStorage.EntityStorageWalletConnector({
|
|
2521
|
-
vaultConnectorType:
|
|
2522
|
-
faucetConnectorType:
|
|
3147
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
3148
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2523
3149
|
...instanceConfig.options
|
|
2524
3150
|
});
|
|
2525
3151
|
instanceType = walletConnectorEntityStorage.EntityStorageWalletConnector.NAMESPACE;
|
|
@@ -2586,6 +3212,7 @@ exports.BlobStorageConnectorType = BlobStorageConnectorType;
|
|
|
2586
3212
|
exports.DataConverterConnectorType = DataConverterConnectorType;
|
|
2587
3213
|
exports.DataExtractorConnectorType = DataExtractorConnectorType;
|
|
2588
3214
|
exports.DataProcessingComponentType = DataProcessingComponentType;
|
|
3215
|
+
exports.DataSpaceConnectorComponentType = DataSpaceConnectorComponentType;
|
|
2589
3216
|
exports.DltConfigType = DltConfigType;
|
|
2590
3217
|
exports.DocumentManagementComponentType = DocumentManagementComponentType;
|
|
2591
3218
|
exports.EntityStorageComponentType = EntityStorageComponentType;
|
|
@@ -2611,6 +3238,12 @@ exports.NftComponentType = NftComponentType;
|
|
|
2611
3238
|
exports.NftConnectorType = NftConnectorType;
|
|
2612
3239
|
exports.RightsManagementComponentType = RightsManagementComponentType;
|
|
2613
3240
|
exports.RightsManagementPapComponentType = RightsManagementPapComponentType;
|
|
3241
|
+
exports.RightsManagementPdpComponentType = RightsManagementPdpComponentType;
|
|
3242
|
+
exports.RightsManagementPepComponentType = RightsManagementPepComponentType;
|
|
3243
|
+
exports.RightsManagementPipComponentType = RightsManagementPipComponentType;
|
|
3244
|
+
exports.RightsManagementPmpComponentType = RightsManagementPmpComponentType;
|
|
3245
|
+
exports.RightsManagementPxpComponentType = RightsManagementPxpComponentType;
|
|
3246
|
+
exports.SynchronisedStorageComponentType = SynchronisedStorageComponentType;
|
|
2614
3247
|
exports.TaskSchedulerComponentType = TaskSchedulerComponentType;
|
|
2615
3248
|
exports.TelemetryComponentType = TelemetryComponentType;
|
|
2616
3249
|
exports.TelemetryConnectorType = TelemetryConnectorType;
|
|
@@ -2628,6 +3261,7 @@ exports.initialiseBlobStorageConnector = initialiseBlobStorageConnector;
|
|
|
2628
3261
|
exports.initialiseDataConverterConnector = initialiseDataConverterConnector;
|
|
2629
3262
|
exports.initialiseDataExtractorConnector = initialiseDataExtractorConnector;
|
|
2630
3263
|
exports.initialiseDataProcessingComponent = initialiseDataProcessingComponent;
|
|
3264
|
+
exports.initialiseDataSpaceConnectorComponent = initialiseDataSpaceConnectorComponent;
|
|
2631
3265
|
exports.initialiseDocumentManagementComponent = initialiseDocumentManagementComponent;
|
|
2632
3266
|
exports.initialiseEntityStorageComponent = initialiseEntityStorageComponent;
|
|
2633
3267
|
exports.initialiseEntityStorageConnector = initialiseEntityStorageConnector;
|
|
@@ -2652,6 +3286,12 @@ exports.initialiseNftComponent = initialiseNftComponent;
|
|
|
2652
3286
|
exports.initialiseNftConnector = initialiseNftConnector;
|
|
2653
3287
|
exports.initialiseRightsManagementComponent = initialiseRightsManagementComponent;
|
|
2654
3288
|
exports.initialiseRightsManagementPapComponent = initialiseRightsManagementPapComponent;
|
|
3289
|
+
exports.initialiseRightsManagementPdpComponent = initialiseRightsManagementPdpComponent;
|
|
3290
|
+
exports.initialiseRightsManagementPepComponent = initialiseRightsManagementPepComponent;
|
|
3291
|
+
exports.initialiseRightsManagementPipComponent = initialiseRightsManagementPipComponent;
|
|
3292
|
+
exports.initialiseRightsManagementPmpComponent = initialiseRightsManagementPmpComponent;
|
|
3293
|
+
exports.initialiseRightsManagementPxpComponent = initialiseRightsManagementPxpComponent;
|
|
3294
|
+
exports.initialiseSynchronisedStorageComponent = initialiseSynchronisedStorageComponent;
|
|
2655
3295
|
exports.initialiseTaskSchedulerComponent = initialiseTaskSchedulerComponent;
|
|
2656
3296
|
exports.initialiseTelemetryComponent = initialiseTelemetryComponent;
|
|
2657
3297
|
exports.initialiseTelemetryConnector = initialiseTelemetryConnector;
|