@twin.org/engine-types 0.0.2-next.4 → 0.0.2-next.6
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 +159 -53
- package/dist/esm/index.mjs +166 -62
- package/dist/types/components/entityStorage.d.ts +2 -1
- package/dist/types/components/synchronisedStorage.d.ts +13 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/IEngineConfig.d.ts +9 -4
- package/dist/types/models/config/entityStorageConnectorConfig.d.ts +4 -0
- package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +13 -0
- package/dist/types/models/types/entityStorageConnectorType.d.ts +4 -0
- package/dist/types/models/types/synchronisedStorageComponentType.d.ts +17 -0
- package/docs/changelog.md +28 -0
- package/docs/reference/functions/initialiseEntityStorageConnector.md +4 -2
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +41 -0
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/IEngineConfig.md +12 -6
- package/docs/reference/type-aliases/EntityStorageConnectorConfig.md +1 -1
- package/docs/reference/type-aliases/SynchronisedStorageComponentConfig.md +5 -0
- package/docs/reference/type-aliases/SynchronisedStorageComponentType.md +5 -0
- package/docs/reference/variables/EntityStorageConnectorType.md +6 -0
- package/docs/reference/variables/SynchronisedStorageComponentType.md +19 -0
- package/package.json +6 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import { MongoDbEntityStorageConnector } from '@twin.org/entity-storage-connecto
|
|
|
15
15
|
import { MySqlEntityStorageConnector } from '@twin.org/entity-storage-connector-mysql';
|
|
16
16
|
import { PostgreSqlEntityStorageConnector } from '@twin.org/entity-storage-connector-postgresql';
|
|
17
17
|
import { ScyllaDBTableConnector } from '@twin.org/entity-storage-connector-scylladb';
|
|
18
|
+
import { SynchronisedEntityStorageConnector } from '@twin.org/entity-storage-connector-synchronised';
|
|
18
19
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
19
20
|
import { EntityStorageClient } from '@twin.org/entity-storage-rest-client';
|
|
20
21
|
import { EntityStorageService } from '@twin.org/entity-storage-service';
|
|
@@ -42,7 +43,7 @@ import { LocalEventBusConnector } from '@twin.org/event-bus-connector-local';
|
|
|
42
43
|
import { EventBusConnectorFactory } from '@twin.org/event-bus-models';
|
|
43
44
|
import { EventBusService } from '@twin.org/event-bus-service';
|
|
44
45
|
import { EventBusSocketClient } from '@twin.org/event-bus-socket-client';
|
|
45
|
-
import { EntityStorageFaucetConnector, EntityStorageWalletConnector, initSchema as initSchema$
|
|
46
|
+
import { EntityStorageFaucetConnector, EntityStorageWalletConnector, initSchema as initSchema$h } from '@twin.org/wallet-connector-entity-storage';
|
|
46
47
|
import { IotaFaucetConnector, IotaWalletConnector } from '@twin.org/wallet-connector-iota';
|
|
47
48
|
import { FaucetConnectorFactory, WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
48
49
|
import { FederatedCatalogueClient } from '@twin.org/federated-catalogue-rest-client';
|
|
@@ -72,15 +73,17 @@ import { NftService } from '@twin.org/nft-service';
|
|
|
72
73
|
import { RightsManagementClient } from '@twin.org/rights-management-rest-client';
|
|
73
74
|
import { RightsManagementService } from '@twin.org/rights-management-service';
|
|
74
75
|
import { initSchema as initSchema$c, PolicyAdministrationPointService } from '@twin.org/rights-management-pap-service';
|
|
76
|
+
import { SynchronisedStorageClient } from '@twin.org/synchronised-storage-rest-client';
|
|
77
|
+
import { initSchema as initSchema$d, SynchronisedStorageService } from '@twin.org/synchronised-storage-service';
|
|
75
78
|
import { TaskSchedulerService } from '@twin.org/background-task-scheduler';
|
|
76
|
-
import { initSchema as initSchema$
|
|
79
|
+
import { initSchema as initSchema$e, EntityStorageTelemetryConnector } from '@twin.org/telemetry-connector-entity-storage';
|
|
77
80
|
import { TelemetryConnectorFactory } from '@twin.org/telemetry-models';
|
|
78
81
|
import { TelemetryClient } from '@twin.org/telemetry-rest-client';
|
|
79
82
|
import { TelemetryService } from '@twin.org/telemetry-service';
|
|
80
|
-
import { initSchema as initSchema$
|
|
83
|
+
import { initSchema as initSchema$f, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
81
84
|
import { HashicorpVaultConnector } from '@twin.org/vault-connector-hashicorp';
|
|
82
85
|
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
83
|
-
import { initSchema as initSchema$
|
|
86
|
+
import { initSchema as initSchema$g, EntityStorageVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-entity-storage';
|
|
84
87
|
import { IotaVerifiableStorageConnector } from '@twin.org/verifiable-storage-connector-iota';
|
|
85
88
|
import { VerifiableStorageConnectorFactory } from '@twin.org/verifiable-storage-models';
|
|
86
89
|
import { VerifiableStorageClient } from '@twin.org/verifiable-storage-rest-client';
|
|
@@ -136,8 +139,8 @@ function initialiseAttestationConnector(engineCore, context, instanceConfig, ove
|
|
|
136
139
|
let instanceType;
|
|
137
140
|
if (type === AttestationConnectorType.Nft) {
|
|
138
141
|
connector = new NftAttestationConnector({
|
|
139
|
-
identityConnectorType:
|
|
140
|
-
nftConnectorType:
|
|
142
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
143
|
+
nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
|
|
141
144
|
...instanceConfig.options
|
|
142
145
|
});
|
|
143
146
|
instanceType = NftAttestationConnector.NAMESPACE;
|
|
@@ -256,7 +259,11 @@ const EntityStorageConnectorType = {
|
|
|
256
259
|
/**
|
|
257
260
|
* Postgre SQL.
|
|
258
261
|
*/
|
|
259
|
-
PostgreSql: "postgresql"
|
|
262
|
+
PostgreSql: "postgresql",
|
|
263
|
+
/**
|
|
264
|
+
* Synchronised.
|
|
265
|
+
*/
|
|
266
|
+
Synchronised: "synchronised"
|
|
260
267
|
};
|
|
261
268
|
|
|
262
269
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -267,6 +274,7 @@ const EntityStorageConnectorType = {
|
|
|
267
274
|
* @param context The context for the engine.
|
|
268
275
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
269
276
|
* @param schema The schema for the entity storage.
|
|
277
|
+
* @returns The name of the instance type that was created.
|
|
270
278
|
* @throws GeneralError if the connector type is unknown.
|
|
271
279
|
*/
|
|
272
280
|
function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
|
|
@@ -387,6 +395,23 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
387
395
|
}
|
|
388
396
|
});
|
|
389
397
|
}
|
|
398
|
+
else if (type === EntityStorageConnectorType.Synchronised) {
|
|
399
|
+
// Create the entity storage that is wrapped by the synchronised connector
|
|
400
|
+
// by removing the custom type it will default to the standard storage
|
|
401
|
+
// mechanism for entity storage
|
|
402
|
+
const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
|
|
403
|
+
// Use the wrapped instance name as the entity storage connector type
|
|
404
|
+
// for the synchronised connector
|
|
405
|
+
entityStorageConnector = new SynchronisedEntityStorageConnector({
|
|
406
|
+
entitySchema: schema,
|
|
407
|
+
...entityStorageConfig.options,
|
|
408
|
+
entityStorageConnectorType: wrappedInstanceName,
|
|
409
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
410
|
+
config: {
|
|
411
|
+
...entityStorageConfig.options.config
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
390
415
|
else {
|
|
391
416
|
throw new GeneralError("engineCore", "connectorUnknownType", {
|
|
392
417
|
type,
|
|
@@ -399,6 +424,7 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
|
|
|
399
424
|
});
|
|
400
425
|
EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
|
|
401
426
|
}
|
|
427
|
+
return instanceName;
|
|
402
428
|
}
|
|
403
429
|
/**
|
|
404
430
|
* Initialise the entity storage connector.
|
|
@@ -490,8 +516,8 @@ function initialiseAuditableItemGraphComponent(engineCore, context, instanceConf
|
|
|
490
516
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
|
|
491
517
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
|
|
492
518
|
component = new AuditableItemGraphService({
|
|
493
|
-
immutableProofComponentType:
|
|
494
|
-
eventBusComponentType:
|
|
519
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
520
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
495
521
|
...instanceConfig.options
|
|
496
522
|
});
|
|
497
523
|
instanceType = StringHelper.kebabCase("AuditableItemGraphService");
|
|
@@ -553,8 +579,8 @@ function initialiseAuditableItemStreamComponent(engineCore, context, instanceCon
|
|
|
553
579
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
|
|
554
580
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
|
|
555
581
|
component = new AuditableItemStreamService({
|
|
556
|
-
immutableProofComponentType:
|
|
557
|
-
eventBusComponentType:
|
|
582
|
+
immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
|
|
583
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
558
584
|
...instanceConfig.options
|
|
559
585
|
});
|
|
560
586
|
instanceType = StringHelper.kebabCase("AuditableItemStreamService");
|
|
@@ -613,7 +639,7 @@ function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig,
|
|
|
613
639
|
initSchema$2();
|
|
614
640
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
|
|
615
641
|
connector = new EntityStorageBackgroundTaskConnector({
|
|
616
|
-
|
|
642
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
617
643
|
...instanceConfig.options
|
|
618
644
|
});
|
|
619
645
|
instanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;
|
|
@@ -782,7 +808,7 @@ function initialiseBlobStorageComponent(engineCore, context, instanceConfig, ove
|
|
|
782
808
|
initSchema$3();
|
|
783
809
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
|
|
784
810
|
component = new BlobStorageService({
|
|
785
|
-
vaultConnectorType:
|
|
811
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
786
812
|
...instanceConfig.options
|
|
787
813
|
});
|
|
788
814
|
instanceType = StringHelper.kebabCase("BlobStorageService");
|
|
@@ -1007,10 +1033,10 @@ function initialiseDocumentManagementComponent(engineCore, context, instanceConf
|
|
|
1007
1033
|
let instanceType;
|
|
1008
1034
|
if (type === DocumentManagementComponentType.Service) {
|
|
1009
1035
|
component = new DocumentManagementService({
|
|
1010
|
-
auditableItemGraphComponentType:
|
|
1011
|
-
blobStorageComponentType:
|
|
1012
|
-
attestationComponentType:
|
|
1013
|
-
dataProcessingComponentType:
|
|
1036
|
+
auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
|
|
1037
|
+
blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
|
|
1038
|
+
attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
|
|
1039
|
+
dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
|
|
1014
1040
|
...instanceConfig.options
|
|
1015
1041
|
});
|
|
1016
1042
|
instanceType = StringHelper.kebabCase("DocumentManagementService");
|
|
@@ -1084,7 +1110,7 @@ function initialiseEventBusConnector(engineCore, context, instanceConfig, overri
|
|
|
1084
1110
|
let instanceType;
|
|
1085
1111
|
if (type === EventBusConnectorType.Local) {
|
|
1086
1112
|
connector = new LocalEventBusConnector({
|
|
1087
|
-
|
|
1113
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1088
1114
|
...instanceConfig.options
|
|
1089
1115
|
});
|
|
1090
1116
|
instanceType = LocalEventBusConnector.NAMESPACE;
|
|
@@ -1118,14 +1144,14 @@ function initialiseEventBusComponent(engineCore, context, instanceConfig, overri
|
|
|
1118
1144
|
let instanceType;
|
|
1119
1145
|
if (type === EventBusComponentType.Service) {
|
|
1120
1146
|
component = new EventBusService({
|
|
1121
|
-
eventBusConnectorType:
|
|
1147
|
+
eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
|
|
1122
1148
|
...instanceConfig.options
|
|
1123
1149
|
});
|
|
1124
1150
|
instanceType = StringHelper.kebabCase("EventBusService");
|
|
1125
1151
|
}
|
|
1126
1152
|
else if (type === EventBusComponentType.SocketClient) {
|
|
1127
1153
|
component = new EventBusSocketClient({
|
|
1128
|
-
loggingComponentType:
|
|
1154
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1129
1155
|
...instanceConfig.options
|
|
1130
1156
|
});
|
|
1131
1157
|
instanceType = StringHelper.kebabCase("EventBusSocketClient");
|
|
@@ -1178,7 +1204,8 @@ function initialiseFaucetConnector(engineCore, context, instanceConfig, override
|
|
|
1178
1204
|
let connector;
|
|
1179
1205
|
let instanceType;
|
|
1180
1206
|
if (type === FaucetConnectorType.Iota) {
|
|
1181
|
-
const
|
|
1207
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1208
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1182
1209
|
connector = new IotaFaucetConnector({
|
|
1183
1210
|
...instanceConfig.options,
|
|
1184
1211
|
config: {
|
|
@@ -1249,8 +1276,8 @@ function initialiseFederatedCatalogueComponent(engineCore, context, instanceConf
|
|
|
1249
1276
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
|
|
1250
1277
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
|
|
1251
1278
|
component = new FederatedCatalogueService({
|
|
1252
|
-
|
|
1253
|
-
identityResolverComponentType:
|
|
1279
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1280
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
1254
1281
|
...instanceConfig.options
|
|
1255
1282
|
});
|
|
1256
1283
|
instanceType = StringHelper.kebabCase("FederatedCatalogueService");
|
|
@@ -1327,9 +1354,10 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1327
1354
|
let connector;
|
|
1328
1355
|
let instanceType;
|
|
1329
1356
|
if (type === IdentityConnectorType.Iota) {
|
|
1330
|
-
const
|
|
1357
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1358
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1331
1359
|
connector = new IotaIdentityConnector({
|
|
1332
|
-
vaultConnectorType:
|
|
1360
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1333
1361
|
...instanceConfig.options,
|
|
1334
1362
|
config: {
|
|
1335
1363
|
...dltConfig?.options?.config,
|
|
@@ -1342,7 +1370,7 @@ function initialiseIdentityConnector(engineCore, context, instanceConfig, overri
|
|
|
1342
1370
|
initSchema$6({ includeProfile: false });
|
|
1343
1371
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1344
1372
|
connector = new EntityStorageIdentityConnector({
|
|
1345
|
-
vaultConnectorType:
|
|
1373
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1346
1374
|
...instanceConfig.options
|
|
1347
1375
|
});
|
|
1348
1376
|
instanceType = EntityStorageIdentityConnector.NAMESPACE;
|
|
@@ -1480,7 +1508,7 @@ function initialiseIdentityProfileComponent(engineCore, context, instanceConfig,
|
|
|
1480
1508
|
let instanceType;
|
|
1481
1509
|
if (type === IdentityProfileComponentType.Service) {
|
|
1482
1510
|
component = new IdentityProfileService({
|
|
1483
|
-
profileEntityConnectorType:
|
|
1511
|
+
profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
|
|
1484
1512
|
...instanceConfig.options
|
|
1485
1513
|
});
|
|
1486
1514
|
instanceType = StringHelper.kebabCase("IdentityProfileService");
|
|
@@ -1561,7 +1589,8 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1561
1589
|
let connector;
|
|
1562
1590
|
let instanceType;
|
|
1563
1591
|
if (type === IdentityResolverConnectorType.Iota) {
|
|
1564
|
-
const
|
|
1592
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
1593
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
1565
1594
|
connector = new IotaIdentityResolverConnector({
|
|
1566
1595
|
...instanceConfig.options,
|
|
1567
1596
|
config: {
|
|
@@ -1575,7 +1604,7 @@ function initialiseIdentityResolverConnector(engineCore, context, instanceConfig
|
|
|
1575
1604
|
initSchema$6({ includeProfile: false });
|
|
1576
1605
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
|
|
1577
1606
|
connector = new EntityStorageIdentityResolverConnector({
|
|
1578
|
-
vaultConnectorType:
|
|
1607
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
1579
1608
|
...instanceConfig.options
|
|
1580
1609
|
});
|
|
1581
1610
|
instanceType = EntityStorageIdentityResolverConnector.NAMESPACE;
|
|
@@ -1614,8 +1643,9 @@ function initialiseIdentityResolverComponent(engineCore, context, instanceConfig
|
|
|
1614
1643
|
let component;
|
|
1615
1644
|
let instanceType;
|
|
1616
1645
|
if (type === IdentityResolverComponentType.Service) {
|
|
1646
|
+
const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
|
|
1617
1647
|
component = new IdentityResolverService({
|
|
1618
|
-
fallbackResolverConnectorType:
|
|
1648
|
+
fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
|
|
1619
1649
|
? IdentityResolverConnectorType.Universal
|
|
1620
1650
|
: undefined,
|
|
1621
1651
|
...instanceConfig.options
|
|
@@ -1677,10 +1707,10 @@ function initialiseImmutableProofComponent(engineCore, context, instanceConfig,
|
|
|
1677
1707
|
initSchema$7();
|
|
1678
1708
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
|
|
1679
1709
|
component = new ImmutableProofService({
|
|
1680
|
-
verifiableStorageType:
|
|
1681
|
-
identityConnectorType:
|
|
1682
|
-
backgroundTaskConnectorType:
|
|
1683
|
-
eventBusComponentType:
|
|
1710
|
+
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
1711
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
1712
|
+
backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
|
|
1713
|
+
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
1684
1714
|
...instanceConfig.options
|
|
1685
1715
|
});
|
|
1686
1716
|
instanceType = StringHelper.kebabCase("ImmutableProofService");
|
|
@@ -1803,7 +1833,7 @@ function initialiseLoggingComponent(engineCore, context, instanceConfig, overrid
|
|
|
1803
1833
|
let instanceType;
|
|
1804
1834
|
if (type === LoggingComponentType.Service) {
|
|
1805
1835
|
component = new LoggingService({
|
|
1806
|
-
loggingConnectorType:
|
|
1836
|
+
loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
|
|
1807
1837
|
...instanceConfig.options
|
|
1808
1838
|
});
|
|
1809
1839
|
instanceType = StringHelper.kebabCase("LoggingService");
|
|
@@ -1910,14 +1940,14 @@ function initialiseMessagingEmailConnector(engineCore, context, instanceConfig,
|
|
|
1910
1940
|
initSchema$9({ email: true, sms: false, pushNotification: false });
|
|
1911
1941
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
|
|
1912
1942
|
connector = new EntityStorageMessagingEmailConnector({
|
|
1913
|
-
|
|
1943
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1914
1944
|
...instanceConfig.options
|
|
1915
1945
|
});
|
|
1916
1946
|
instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
|
|
1917
1947
|
}
|
|
1918
1948
|
else if (type === MessagingEmailConnectorType.Aws) {
|
|
1919
1949
|
connector = new AwsMessagingEmailConnector({
|
|
1920
|
-
|
|
1950
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1921
1951
|
...instanceConfig.options
|
|
1922
1952
|
});
|
|
1923
1953
|
instanceType = AwsMessagingEmailConnector.NAMESPACE;
|
|
@@ -1953,14 +1983,14 @@ function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, ov
|
|
|
1953
1983
|
initSchema$9({ email: false, sms: true, pushNotification: false });
|
|
1954
1984
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
|
|
1955
1985
|
connector = new EntityStorageMessagingSmsConnector({
|
|
1956
|
-
|
|
1986
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1957
1987
|
...instanceConfig.options
|
|
1958
1988
|
});
|
|
1959
1989
|
instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
|
|
1960
1990
|
}
|
|
1961
1991
|
else if (type === MessagingSmsConnectorType.Aws) {
|
|
1962
1992
|
connector = new AwsMessagingSmsConnector({
|
|
1963
|
-
|
|
1993
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
1964
1994
|
...instanceConfig.options
|
|
1965
1995
|
});
|
|
1966
1996
|
instanceType = AwsMessagingSmsConnector.NAMESPACE;
|
|
@@ -1997,14 +2027,14 @@ function initialiseMessagingPushNotificationConnector(engineCore, context, insta
|
|
|
1997
2027
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
|
|
1998
2028
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
|
|
1999
2029
|
connector = new EntityStorageMessagingPushNotificationConnector({
|
|
2000
|
-
|
|
2030
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2001
2031
|
...instanceConfig.options
|
|
2002
2032
|
});
|
|
2003
2033
|
instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
|
|
2004
2034
|
}
|
|
2005
2035
|
else if (type === MessagingPushNotificationConnectorType.Aws) {
|
|
2006
2036
|
connector = new AwsMessagingPushNotificationConnector({
|
|
2007
|
-
|
|
2037
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2008
2038
|
...instanceConfig.options
|
|
2009
2039
|
});
|
|
2010
2040
|
instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
|
|
@@ -2040,9 +2070,9 @@ function initialiseMessagingComponent(engineCore, context, instanceConfig, overr
|
|
|
2040
2070
|
initSchema$a();
|
|
2041
2071
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
|
|
2042
2072
|
component = new MessagingService({
|
|
2043
|
-
messagingEmailConnectorType:
|
|
2044
|
-
messagingSmsConnectorType:
|
|
2045
|
-
messagingPushNotificationConnectorType:
|
|
2073
|
+
messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
|
|
2074
|
+
messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
|
|
2075
|
+
messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
|
|
2046
2076
|
...instanceConfig.options
|
|
2047
2077
|
});
|
|
2048
2078
|
instanceType = StringHelper.kebabCase("MessagingService");
|
|
@@ -2119,8 +2149,8 @@ function initialiseNftConnector(engineCore, context, instanceConfig, overrideIns
|
|
|
2119
2149
|
}
|
|
2120
2150
|
else if (type === NftConnectorType.Iota) {
|
|
2121
2151
|
connector = new IotaNftConnector({
|
|
2122
|
-
vaultConnectorType:
|
|
2123
|
-
walletConnectorType:
|
|
2152
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2153
|
+
walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
|
|
2124
2154
|
...instanceConfig.options
|
|
2125
2155
|
});
|
|
2126
2156
|
instanceType = IotaNftConnector.NAMESPACE;
|
|
@@ -2215,7 +2245,7 @@ function initialiseRightsManagementComponent(engineCore, context, instanceConfig
|
|
|
2215
2245
|
let instanceType;
|
|
2216
2246
|
if (type === RightsManagementComponentType.Service) {
|
|
2217
2247
|
component = new RightsManagementService({
|
|
2218
|
-
papComponentType:
|
|
2248
|
+
papComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
2219
2249
|
...instanceConfig.options
|
|
2220
2250
|
});
|
|
2221
2251
|
instanceType = StringHelper.kebabCase("RightsManagementService");
|
|
@@ -2291,6 +2321,78 @@ function initialiseRightsManagementPapComponent(engineCore, context, instanceCon
|
|
|
2291
2321
|
return finalInstanceType;
|
|
2292
2322
|
}
|
|
2293
2323
|
|
|
2324
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2325
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2326
|
+
/**
|
|
2327
|
+
* Synchronised storage component types.
|
|
2328
|
+
*/
|
|
2329
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2330
|
+
const SynchronisedStorageComponentType = {
|
|
2331
|
+
/**
|
|
2332
|
+
* Service.
|
|
2333
|
+
*/
|
|
2334
|
+
Service: "service",
|
|
2335
|
+
/**
|
|
2336
|
+
* REST client.
|
|
2337
|
+
*/
|
|
2338
|
+
RestClient: "rest-client"
|
|
2339
|
+
};
|
|
2340
|
+
|
|
2341
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2342
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
2343
|
+
/**
|
|
2344
|
+
* Initialise the synchronised storage component.
|
|
2345
|
+
* @param engineCore The engine core.
|
|
2346
|
+
* @param context The context for the engine.
|
|
2347
|
+
* @param instanceConfig The instance config.
|
|
2348
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
2349
|
+
* @returns The name of the instance created.
|
|
2350
|
+
* @throws GeneralError if the component type is unknown.
|
|
2351
|
+
*/
|
|
2352
|
+
function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
|
|
2353
|
+
engineCore.logInfo(I18n.formatMessage("engineCore.configuring", {
|
|
2354
|
+
element: `Synchronised Storage Component: ${instanceConfig.type}`
|
|
2355
|
+
}));
|
|
2356
|
+
const type = instanceConfig.type;
|
|
2357
|
+
let component;
|
|
2358
|
+
let instanceType;
|
|
2359
|
+
if (type === SynchronisedStorageComponentType.Service) {
|
|
2360
|
+
initSchema$d();
|
|
2361
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
|
|
2362
|
+
component = new SynchronisedStorageService({
|
|
2363
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2364
|
+
eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
|
|
2365
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2366
|
+
verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
2367
|
+
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
2368
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
2369
|
+
trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
|
|
2370
|
+
blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
|
|
2371
|
+
"public"
|
|
2372
|
+
]),
|
|
2373
|
+
...instanceConfig.options
|
|
2374
|
+
});
|
|
2375
|
+
instanceType = StringHelper.kebabCase("SynchronisedStorageService");
|
|
2376
|
+
}
|
|
2377
|
+
else if (type === SynchronisedStorageComponentType.RestClient) {
|
|
2378
|
+
component = new SynchronisedStorageClient(instanceConfig.options);
|
|
2379
|
+
instanceType = StringHelper.kebabCase("SynchronisedStorageClient");
|
|
2380
|
+
}
|
|
2381
|
+
else {
|
|
2382
|
+
throw new GeneralError("engineCore", "componentUnknownType", {
|
|
2383
|
+
type,
|
|
2384
|
+
componentType: "SynchronisedStorageComponent"
|
|
2385
|
+
});
|
|
2386
|
+
}
|
|
2387
|
+
const finalInstanceType = overrideInstanceType ?? instanceType;
|
|
2388
|
+
context.componentInstances.push({
|
|
2389
|
+
instanceType: finalInstanceType,
|
|
2390
|
+
component
|
|
2391
|
+
});
|
|
2392
|
+
ComponentFactory.register(finalInstanceType, () => component);
|
|
2393
|
+
return finalInstanceType;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2294
2396
|
// Copyright 2024 IOTA Stiftung.
|
|
2295
2397
|
// SPDX-License-Identifier: Apache-2.0.
|
|
2296
2398
|
/**
|
|
@@ -2322,7 +2424,7 @@ function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, o
|
|
|
2322
2424
|
let instanceType;
|
|
2323
2425
|
if (type === TaskSchedulerComponentType.Service) {
|
|
2324
2426
|
component = new TaskSchedulerService({
|
|
2325
|
-
|
|
2427
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2326
2428
|
...instanceConfig.options
|
|
2327
2429
|
});
|
|
2328
2430
|
instanceType = StringHelper.kebabCase("TaskSchedulerService");
|
|
@@ -2391,11 +2493,11 @@ function initialiseTelemetryConnector(engineCore, context, instanceConfig, overr
|
|
|
2391
2493
|
let connector;
|
|
2392
2494
|
let instanceType;
|
|
2393
2495
|
if (type === TelemetryConnectorType.EntityStorage) {
|
|
2394
|
-
initSchema$
|
|
2496
|
+
initSchema$e();
|
|
2395
2497
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
|
|
2396
2498
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
|
|
2397
2499
|
connector = new EntityStorageTelemetryConnector({
|
|
2398
|
-
|
|
2500
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
2399
2501
|
...instanceConfig.options
|
|
2400
2502
|
});
|
|
2401
2503
|
instanceType = EntityStorageTelemetryConnector.NAMESPACE;
|
|
@@ -2429,7 +2531,7 @@ function initialiseTelemetryComponent(engineCore, context, instanceConfig, overr
|
|
|
2429
2531
|
let instanceType;
|
|
2430
2532
|
if (type === TelemetryComponentType.Service) {
|
|
2431
2533
|
component = new TelemetryService({
|
|
2432
|
-
telemetryConnectorType:
|
|
2534
|
+
telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
|
|
2433
2535
|
...instanceConfig.options
|
|
2434
2536
|
});
|
|
2435
2537
|
instanceType = StringHelper.kebabCase("TelemetryService");
|
|
@@ -2486,7 +2588,7 @@ function initialiseVaultConnector(engineCore, context, instanceConfig, overrideI
|
|
|
2486
2588
|
let connector;
|
|
2487
2589
|
let instanceType;
|
|
2488
2590
|
if (type === VaultConnectorType.EntityStorage) {
|
|
2489
|
-
initSchema$
|
|
2591
|
+
initSchema$f();
|
|
2490
2592
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
|
|
2491
2593
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
|
|
2492
2594
|
connector = new EntityStorageVaultConnector(instanceConfig.options);
|
|
@@ -2561,9 +2663,10 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2561
2663
|
let connector;
|
|
2562
2664
|
let instanceType;
|
|
2563
2665
|
if (type === VerifiableStorageConnectorType.Iota) {
|
|
2564
|
-
const
|
|
2666
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
2667
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2565
2668
|
connector = new IotaVerifiableStorageConnector({
|
|
2566
|
-
vaultConnectorType:
|
|
2669
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2567
2670
|
...instanceConfig.options,
|
|
2568
2671
|
config: {
|
|
2569
2672
|
...dltConfig?.options?.config,
|
|
@@ -2573,7 +2676,7 @@ function initialiseVerifiableStorageConnector(engineCore, context, instanceConfi
|
|
|
2573
2676
|
instanceType = IotaVerifiableStorageConnector.NAMESPACE;
|
|
2574
2677
|
}
|
|
2575
2678
|
else if (type === VerifiableStorageConnectorType.EntityStorage) {
|
|
2576
|
-
initSchema$
|
|
2679
|
+
initSchema$g();
|
|
2577
2680
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
|
|
2578
2681
|
connector = new EntityStorageVerifiableStorageConnector(instanceConfig.options);
|
|
2579
2682
|
instanceType = EntityStorageVerifiableStorageConnector.NAMESPACE;
|
|
@@ -2669,10 +2772,11 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2669
2772
|
let connector;
|
|
2670
2773
|
let instanceType;
|
|
2671
2774
|
if (type === WalletConnectorType.Iota) {
|
|
2672
|
-
const
|
|
2775
|
+
const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
|
|
2776
|
+
const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
|
|
2673
2777
|
connector = new IotaWalletConnector({
|
|
2674
|
-
vaultConnectorType:
|
|
2675
|
-
faucetConnectorType:
|
|
2778
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2779
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2676
2780
|
...instanceConfig.options,
|
|
2677
2781
|
config: {
|
|
2678
2782
|
...dltConfig?.options?.config,
|
|
@@ -2683,8 +2787,8 @@ function initialiseWalletConnector(engineCore, context, instanceConfig, override
|
|
|
2683
2787
|
}
|
|
2684
2788
|
else if (type === WalletConnectorType.EntityStorage) {
|
|
2685
2789
|
connector = new EntityStorageWalletConnector({
|
|
2686
|
-
vaultConnectorType:
|
|
2687
|
-
faucetConnectorType:
|
|
2790
|
+
vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
|
|
2791
|
+
faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
|
|
2688
2792
|
...instanceConfig.options
|
|
2689
2793
|
});
|
|
2690
2794
|
instanceType = EntityStorageWalletConnector.NAMESPACE;
|
|
@@ -2716,7 +2820,7 @@ function initialiseWalletStorage(engineCore, context, instanceConfig, overrideIn
|
|
|
2716
2820
|
const type = instanceConfig.type;
|
|
2717
2821
|
if (type === WalletConnectorType.Iota) ;
|
|
2718
2822
|
else if (type === WalletConnectorType.EntityStorage) {
|
|
2719
|
-
initSchema$
|
|
2823
|
+
initSchema$h();
|
|
2720
2824
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
|
|
2721
2825
|
}
|
|
2722
2826
|
else {
|
|
@@ -2741,4 +2845,4 @@ const DltConfigType = {
|
|
|
2741
2845
|
Iota: "iota"
|
|
2742
2846
|
};
|
|
2743
2847
|
|
|
2744
|
-
export { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, BackgroundTaskConnectorType, BlobStorageComponentType, BlobStorageConnectorType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DltConfigType, DocumentManagementComponentType, EntityStorageComponentType, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, NftComponentType, NftConnectorType, RightsManagementComponentType, RightsManagementPapComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, VaultConnectorType, VerifiableStorageComponentType, VerifiableStorageConnectorType, WalletConnectorType, initialiseAttestationComponent, initialiseAttestationConnector, initialiseAuditableItemGraphComponent, initialiseAuditableItemStreamComponent, initialiseBackgroundTaskConnector, initialiseBlobStorageComponent, initialiseBlobStorageConnector, initialiseDataConverterConnector, initialiseDataExtractorConnector, initialiseDataProcessingComponent, initialiseDocumentManagementComponent, initialiseEntityStorageComponent, initialiseEntityStorageConnector, initialiseEventBusComponent, initialiseEventBusConnector, initialiseFaucetConnector, initialiseFederatedCatalogueComponent, initialiseIdentityComponent, initialiseIdentityConnector, initialiseIdentityProfileComponent, initialiseIdentityProfileConnector, initialiseIdentityResolverComponent, initialiseIdentityResolverConnector, initialiseImmutableProofComponent, initialiseLoggingComponent, initialiseLoggingConnector, initialiseMessagingComponent, initialiseMessagingEmailConnector, initialiseMessagingPushNotificationConnector, initialiseMessagingSmsConnector, initialiseNftComponent, initialiseNftConnector, initialiseRightsManagementComponent, initialiseRightsManagementPapComponent, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector, initialiseWalletStorage };
|
|
2848
|
+
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, SynchronisedStorageComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, VaultConnectorType, VerifiableStorageComponentType, VerifiableStorageConnectorType, WalletConnectorType, initialiseAttestationComponent, initialiseAttestationConnector, initialiseAuditableItemGraphComponent, initialiseAuditableItemStreamComponent, initialiseBackgroundTaskConnector, initialiseBlobStorageComponent, initialiseBlobStorageConnector, initialiseDataConverterConnector, initialiseDataExtractorConnector, initialiseDataProcessingComponent, initialiseDocumentManagementComponent, initialiseEntityStorageComponent, initialiseEntityStorageConnector, initialiseEventBusComponent, initialiseEventBusConnector, initialiseFaucetConnector, initialiseFederatedCatalogueComponent, initialiseIdentityComponent, initialiseIdentityConnector, initialiseIdentityProfileComponent, initialiseIdentityProfileConnector, initialiseIdentityResolverComponent, initialiseIdentityResolverConnector, initialiseImmutableProofComponent, initialiseLoggingComponent, initialiseLoggingConnector, initialiseMessagingComponent, initialiseMessagingEmailConnector, initialiseMessagingPushNotificationConnector, initialiseMessagingSmsConnector, initialiseNftComponent, initialiseNftConnector, initialiseRightsManagementComponent, initialiseRightsManagementPapComponent, initialiseSynchronisedStorageComponent, initialiseTaskSchedulerComponent, initialiseTelemetryComponent, initialiseTelemetryConnector, initialiseVaultConnector, initialiseVerifiableStorageComponent, initialiseVerifiableStorageConnector, initialiseWalletConnector, initialiseWalletStorage };
|
|
@@ -7,9 +7,10 @@ import type { IEngineConfig } from "../models/IEngineConfig";
|
|
|
7
7
|
* @param context The context for the engine.
|
|
8
8
|
* @param typeCustom Override the type of connector to use instead of default configuration.
|
|
9
9
|
* @param schema The schema for the entity storage.
|
|
10
|
+
* @returns The name of the instance type that was created.
|
|
10
11
|
* @throws GeneralError if the connector type is unknown.
|
|
11
12
|
*/
|
|
12
|
-
export declare function initialiseEntityStorageConnector(engineCore: IEngineCore<IEngineConfig>, context: IEngineCoreContext<IEngineConfig>, typeCustom: string | undefined, schema: string):
|
|
13
|
+
export declare function initialiseEntityStorageConnector(engineCore: IEngineCore<IEngineConfig>, context: IEngineCoreContext<IEngineConfig>, typeCustom: string | undefined, schema: string): string;
|
|
13
14
|
/**
|
|
14
15
|
* Initialise the entity storage connector.
|
|
15
16
|
* @param engineCore The engine core.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
2
|
+
import type { SynchronisedStorageComponentConfig } from "../models/config/synchronisedStorageComponentConfig";
|
|
3
|
+
import type { IEngineConfig } from "../models/IEngineConfig";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the synchronised storage component.
|
|
6
|
+
* @param engineCore The engine core.
|
|
7
|
+
* @param context The context for the engine.
|
|
8
|
+
* @param instanceConfig The instance config.
|
|
9
|
+
* @param overrideInstanceType The instance type to override the default.
|
|
10
|
+
* @returns The name of the instance created.
|
|
11
|
+
* @throws GeneralError if the component type is unknown.
|
|
12
|
+
*/
|
|
13
|
+
export declare function initialiseSynchronisedStorageComponent(engineCore: IEngineCore<IEngineConfig>, context: IEngineCoreContext<IEngineConfig>, instanceConfig: SynchronisedStorageComponentConfig, overrideInstanceType?: string): string | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./components/messaging";
|
|
|
18
18
|
export * from "./components/nft";
|
|
19
19
|
export * from "./components/rightsManagement";
|
|
20
20
|
export * from "./components/rightsManagementPap";
|
|
21
|
+
export * from "./components/synchronisedStorage";
|
|
21
22
|
export * from "./components/taskScheduler";
|
|
22
23
|
export * from "./components/telemetry";
|
|
23
24
|
export * from "./components/vault";
|
|
@@ -58,6 +59,7 @@ export * from "./models/config/nftComponentConfig";
|
|
|
58
59
|
export * from "./models/config/nftConnectorConfig";
|
|
59
60
|
export * from "./models/config/rightsManagementComponentConfig";
|
|
60
61
|
export * from "./models/config/rightsManagementPapComponentConfig";
|
|
62
|
+
export * from "./models/config/synchronisedStorageComponentConfig";
|
|
61
63
|
export * from "./models/config/taskSchedulerComponentConfig";
|
|
62
64
|
export * from "./models/config/telemetryComponentConfig";
|
|
63
65
|
export * from "./models/config/telemetryConnectorConfig";
|
|
@@ -101,6 +103,7 @@ export * from "./models/types/nftComponentType";
|
|
|
101
103
|
export * from "./models/types/nftConnectorType";
|
|
102
104
|
export * from "./models/types/rightsManagementComponentType";
|
|
103
105
|
export * from "./models/types/rightsManagementPapComponentType";
|
|
106
|
+
export * from "./models/types/synchronisedStorageComponentType";
|
|
104
107
|
export * from "./models/types/taskSchedulerComponentType";
|
|
105
108
|
export * from "./models/types/telemetryComponentType";
|
|
106
109
|
export * from "./models/types/telemetryConnectorType";
|
|
@@ -34,6 +34,7 @@ import type { NftComponentConfig } from "./config/nftComponentConfig";
|
|
|
34
34
|
import type { NftConnectorConfig } from "./config/nftConnectorConfig";
|
|
35
35
|
import type { RightsManagementComponentConfig } from "./config/rightsManagementComponentConfig";
|
|
36
36
|
import type { RightsManagementPapComponentConfig } from "./config/rightsManagementPapComponentConfig";
|
|
37
|
+
import type { SynchronisedStorageComponentConfig } from "./config/synchronisedStorageComponentConfig";
|
|
37
38
|
import type { TaskSchedulerComponentConfig } from "./config/taskSchedulerComponentConfig";
|
|
38
39
|
import type { TelemetryComponentConfig } from "./config/telemetryComponentConfig";
|
|
39
40
|
import type { TelemetryConnectorConfig } from "./config/telemetryConnectorConfig";
|
|
@@ -206,10 +207,6 @@ export interface IEngineConfig extends IEngineCoreConfig {
|
|
|
206
207
|
* Document management options which can be overridden by individual components by specifying types other than default.
|
|
207
208
|
*/
|
|
208
209
|
documentManagementComponent?: IEngineCoreTypeConfig<DocumentManagementComponentConfig>[];
|
|
209
|
-
/**
|
|
210
|
-
* Federated catalogue options which can be overridden by individual components by specifying types other than default.
|
|
211
|
-
*/
|
|
212
|
-
federatedCatalogueComponent?: IEngineCoreTypeConfig<FederatedCatalogueComponentConfig>[];
|
|
213
210
|
/**
|
|
214
211
|
* Rights management options which can be overridden by individual components by specifying types other than default.
|
|
215
212
|
*/
|
|
@@ -218,5 +215,13 @@ export interface IEngineConfig extends IEngineCoreConfig {
|
|
|
218
215
|
* Rights management PAP options which can be overridden by individual components by specifying types other than default.
|
|
219
216
|
*/
|
|
220
217
|
rightsManagementPapComponent?: IEngineCoreTypeConfig<RightsManagementPapComponentConfig>[];
|
|
218
|
+
/**
|
|
219
|
+
* Synchronised storage options which can be overridden by individual components by specifying types other than default.
|
|
220
|
+
*/
|
|
221
|
+
synchronisedStorageComponent?: IEngineCoreTypeConfig<SynchronisedStorageComponentConfig>[];
|
|
222
|
+
/**
|
|
223
|
+
* Federated catalogue options which can be overridden by individual components by specifying types other than default.
|
|
224
|
+
*/
|
|
225
|
+
federatedCatalogueComponent?: IEngineCoreTypeConfig<FederatedCatalogueComponentConfig>[];
|
|
221
226
|
};
|
|
222
227
|
}
|