@twin.org/engine-types 0.0.2-next.18 → 0.0.2-next.19

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.
Files changed (95) hide show
  1. package/dist/cjs/index.cjs +566 -1267
  2. package/dist/esm/index.mjs +599 -1299
  3. package/dist/types/components/attestation.d.ts +14 -8
  4. package/dist/types/components/auditableItemGraph.d.ts +7 -4
  5. package/dist/types/components/auditableItemStream.d.ts +7 -4
  6. package/dist/types/components/authenticationGenerator.d.ts +8 -4
  7. package/dist/types/components/backgroundTask.d.ts +8 -4
  8. package/dist/types/components/blobStorage.d.ts +14 -8
  9. package/dist/types/components/dataProcessing.d.ts +20 -12
  10. package/dist/types/components/dataSpaceConnector.d.ts +7 -4
  11. package/dist/types/components/documentManagement.d.ts +7 -4
  12. package/dist/types/components/entityStorage.d.ts +8 -5
  13. package/dist/types/components/eventBus.d.ts +14 -8
  14. package/dist/types/components/faucet.d.ts +8 -4
  15. package/dist/types/components/federatedCatalogue.d.ts +7 -4
  16. package/dist/types/components/identity.d.ts +14 -8
  17. package/dist/types/components/identityProfile.d.ts +14 -8
  18. package/dist/types/components/identityResolver.d.ts +14 -8
  19. package/dist/types/components/immutableProof.d.ts +7 -4
  20. package/dist/types/components/logging.d.ts +14 -8
  21. package/dist/types/components/messaging.d.ts +32 -20
  22. package/dist/types/components/nft.d.ts +14 -8
  23. package/dist/types/components/rightsManagementDap.d.ts +7 -4
  24. package/dist/types/components/rightsManagementDarp.d.ts +7 -4
  25. package/dist/types/components/rightsManagementPap.d.ts +7 -4
  26. package/dist/types/components/rightsManagementPdp.d.ts +7 -4
  27. package/dist/types/components/rightsManagementPep.d.ts +7 -4
  28. package/dist/types/components/rightsManagementPip.d.ts +7 -4
  29. package/dist/types/components/rightsManagementPmp.d.ts +7 -4
  30. package/dist/types/components/rightsManagementPnap.d.ts +7 -4
  31. package/dist/types/components/rightsManagementPnp.d.ts +7 -4
  32. package/dist/types/components/rightsManagementPxp.d.ts +7 -4
  33. package/dist/types/components/synchronisedStorage.d.ts +7 -4
  34. package/dist/types/components/taskScheduler.d.ts +7 -4
  35. package/dist/types/components/telemetry.d.ts +14 -8
  36. package/dist/types/components/vault.d.ts +8 -4
  37. package/dist/types/components/verifiableStorage.d.ts +14 -8
  38. package/dist/types/components/wallet.d.ts +8 -14
  39. package/docs/changelog.md +15 -0
  40. package/docs/reference/functions/initialiseAttestationComponent.md +3 -13
  41. package/docs/reference/functions/initialiseAttestationConnector.md +3 -13
  42. package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +3 -13
  43. package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +3 -13
  44. package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +3 -13
  45. package/docs/reference/functions/initialiseBackgroundTaskConnector.md +3 -13
  46. package/docs/reference/functions/initialiseBlobStorageComponent.md +3 -13
  47. package/docs/reference/functions/initialiseBlobStorageConnector.md +3 -13
  48. package/docs/reference/functions/initialiseDataConverterConnector.md +3 -13
  49. package/docs/reference/functions/initialiseDataExtractorConnector.md +3 -13
  50. package/docs/reference/functions/initialiseDataProcessingComponent.md +3 -13
  51. package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +3 -13
  52. package/docs/reference/functions/initialiseDocumentManagementComponent.md +3 -13
  53. package/docs/reference/functions/initialiseEntityStorageComponent.md +3 -13
  54. package/docs/reference/functions/initialiseEntityStorageConnector.md +1 -1
  55. package/docs/reference/functions/initialiseEventBusComponent.md +3 -13
  56. package/docs/reference/functions/initialiseEventBusConnector.md +3 -13
  57. package/docs/reference/functions/initialiseFaucetConnector.md +3 -13
  58. package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +3 -13
  59. package/docs/reference/functions/initialiseIdentityComponent.md +3 -13
  60. package/docs/reference/functions/initialiseIdentityConnector.md +3 -13
  61. package/docs/reference/functions/initialiseIdentityProfileComponent.md +3 -13
  62. package/docs/reference/functions/initialiseIdentityProfileConnector.md +3 -13
  63. package/docs/reference/functions/initialiseIdentityResolverComponent.md +3 -13
  64. package/docs/reference/functions/initialiseIdentityResolverConnector.md +3 -13
  65. package/docs/reference/functions/initialiseImmutableProofComponent.md +3 -13
  66. package/docs/reference/functions/initialiseLoggingComponent.md +3 -13
  67. package/docs/reference/functions/initialiseLoggingConnector.md +3 -13
  68. package/docs/reference/functions/initialiseMessagingAdminComponent.md +3 -13
  69. package/docs/reference/functions/initialiseMessagingComponent.md +3 -13
  70. package/docs/reference/functions/initialiseMessagingEmailConnector.md +3 -13
  71. package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +3 -13
  72. package/docs/reference/functions/initialiseMessagingSmsConnector.md +3 -13
  73. package/docs/reference/functions/initialiseNftComponent.md +3 -13
  74. package/docs/reference/functions/initialiseNftConnector.md +3 -13
  75. package/docs/reference/functions/initialiseRightsManagementDapComponent.md +3 -13
  76. package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +3 -13
  77. package/docs/reference/functions/initialiseRightsManagementPapComponent.md +3 -13
  78. package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +3 -13
  79. package/docs/reference/functions/initialiseRightsManagementPepComponent.md +3 -13
  80. package/docs/reference/functions/initialiseRightsManagementPipComponent.md +3 -13
  81. package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +3 -13
  82. package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +3 -13
  83. package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +3 -13
  84. package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +3 -13
  85. package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +3 -13
  86. package/docs/reference/functions/initialiseTaskSchedulerComponent.md +3 -13
  87. package/docs/reference/functions/initialiseTelemetryComponent.md +3 -13
  88. package/docs/reference/functions/initialiseTelemetryConnector.md +3 -13
  89. package/docs/reference/functions/initialiseVaultConnector.md +3 -13
  90. package/docs/reference/functions/initialiseVerifiableStorageComponent.md +3 -13
  91. package/docs/reference/functions/initialiseVerifiableStorageConnector.md +3 -13
  92. package/docs/reference/functions/initialiseWalletConnector.md +3 -13
  93. package/docs/reference/index.md +0 -1
  94. package/package.json +11 -3
  95. package/docs/reference/functions/initialiseWalletStorage.md +0 -41
@@ -140,78 +140,50 @@ const AttestationConnectorType = {
140
140
  * @param engineCore The engine core.
141
141
  * @param context The context for the engine.
142
142
  * @param instanceConfig The instance config.
143
- * @param overrideInstanceType The instance type to override the default.
144
- * @returns The name of the instance created.
145
- * @throws GeneralError if the connector type is unknown.
146
- */
147
- async function initialiseAttestationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
148
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
149
- element: `Attestation Connector: ${instanceConfig.type}`
150
- }));
151
- const type = instanceConfig.type;
152
- let connector;
143
+ * @returns The instance created and the factory for it.
144
+ */
145
+ async function initialiseAttestationConnector(engineCore, context, instanceConfig) {
146
+ let component;
153
147
  let instanceType;
154
- if (type === AttestationConnectorType.Nft) {
155
- connector = new attestationConnectorNft.NftAttestationConnector({
148
+ if (instanceConfig.type === AttestationConnectorType.Nft) {
149
+ component = new attestationConnectorNft.NftAttestationConnector({
156
150
  identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
157
151
  nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
158
152
  ...instanceConfig.options
159
153
  });
160
154
  instanceType = attestationConnectorNft.NftAttestationConnector.NAMESPACE;
161
155
  }
162
- else {
163
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
164
- type,
165
- connectorType: "attestationConnector"
166
- });
167
- }
168
- const finalInstanceType = overrideInstanceType ?? instanceType;
169
- context.componentInstances.push({
170
- instanceType: finalInstanceType,
171
- component: connector
172
- });
173
- attestationModels.AttestationConnectorFactory.register(finalInstanceType, () => connector);
174
- return finalInstanceType;
156
+ return {
157
+ component,
158
+ instanceType,
159
+ factory: attestationModels.AttestationConnectorFactory
160
+ };
175
161
  }
176
162
  /**
177
163
  * Initialise the attestation component.
178
164
  * @param engineCore The engine core.
179
165
  * @param context The context for the engine.
180
166
  * @param instanceConfig The instance config.
181
- * @param overrideInstanceType The instance type to override the default.
182
- * @returns The name of the instance created.
183
- * @throws GeneralError if the component type is unknown.
184
- */
185
- async function initialiseAttestationComponent(engineCore, context, instanceConfig, overrideInstanceType) {
186
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
187
- element: `Attestation Component: ${instanceConfig.type}`
188
- }));
189
- const type = instanceConfig.type;
167
+ * @returns The instance created and the factory for it.
168
+ */
169
+ async function initialiseAttestationComponent(engineCore, context, instanceConfig) {
190
170
  let component;
191
171
  let instanceType;
192
- if (type === AttestationComponentType.Service) {
172
+ if (instanceConfig.type === AttestationComponentType.Service) {
193
173
  component = new attestationService.AttestationService({
194
174
  ...instanceConfig.options
195
175
  });
196
176
  instanceType = "attestation-service";
197
177
  }
198
- else if (type === AttestationComponentType.RestClient) {
178
+ else if (instanceConfig.type === AttestationComponentType.RestClient) {
199
179
  component = new attestationRestClient.AttestationClient(instanceConfig.options);
200
180
  instanceType = "attestation-client";
201
181
  }
202
- else {
203
- throw new core.GeneralError("engineCore", "componentUnknownType", {
204
- type,
205
- componentType: "attestationComponent"
206
- });
207
- }
208
- const finalInstanceType = overrideInstanceType ?? instanceType;
209
- context.componentInstances.push({
210
- instanceType: finalInstanceType,
211
- component
212
- });
213
- core.ComponentFactory.register(finalInstanceType, () => component);
214
- return finalInstanceType;
182
+ return {
183
+ component,
184
+ instanceType,
185
+ factory: core.ComponentFactory
186
+ };
215
187
  }
216
188
 
217
189
  // Copyright 2024 IOTA Stiftung.
@@ -289,7 +261,7 @@ const EntityStorageConnectorType = {
289
261
  * @param typeCustom Override the type of connector to use instead of default configuration.
290
262
  * @param schema The schema for the entity storage.
291
263
  * @returns The name of the instance type that was created.
292
- * @throws GeneralError if the connector type is unknown.
264
+ * @throws GeneralError when the configuration is invalid.
293
265
  */
294
266
  function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
295
267
  const instanceName = core.StringHelper.kebabCase(schema);
@@ -445,18 +417,12 @@ function initialiseEntityStorageConnector(engineCore, context, typeCustom, schem
445
417
  * @param engineCore The engine core.
446
418
  * @param context The context for the engine.
447
419
  * @param instanceConfig The instance config.
448
- * @param overrideInstanceType The instance type to override the default.
449
- * @returns The name of the instance created.
450
- * @throws GeneralError if the connector type is unknown.
451
- */
452
- async function initialiseEntityStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
453
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
454
- element: `Entity Storage Component: ${instanceConfig.type}`
455
- }));
456
- const type = instanceConfig.type;
420
+ * @returns The instance created and the factory for it.
421
+ */
422
+ async function initialiseEntityStorageComponent(engineCore, context, instanceConfig) {
457
423
  let component;
458
424
  let instanceType;
459
- if (type === EntityStorageComponentType.Service) {
425
+ if (instanceConfig.type === EntityStorageComponentType.Service) {
460
426
  const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
461
427
  // See if there is a custom entity storage for this type, otherwise just use the default one.
462
428
  const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
@@ -469,7 +435,7 @@ async function initialiseEntityStorageComponent(engineCore, context, instanceCon
469
435
  });
470
436
  instanceType = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
471
437
  }
472
- else if (type === EntityStorageComponentType.RestClient) {
438
+ else if (instanceConfig.type === EntityStorageComponentType.RestClient) {
473
439
  const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
474
440
  component = new entityStorageRestClient.EntityStorageClient({
475
441
  pathPrefix: kebabName,
@@ -477,19 +443,11 @@ async function initialiseEntityStorageComponent(engineCore, context, instanceCon
477
443
  });
478
444
  instanceType = `${"entity-storage-client"}-${kebabName}`;
479
445
  }
480
- else {
481
- throw new core.GeneralError("engineCore", "componentUnknownType", {
482
- type,
483
- serviceType: "entityStorageComponent"
484
- });
485
- }
486
- const finalInstanceType = overrideInstanceType ?? instanceType;
487
- context.componentInstances.push({
488
- instanceType: finalInstanceType,
489
- component
490
- });
491
- core.ComponentFactory.register(finalInstanceType, () => component);
492
- return finalInstanceType;
446
+ return {
447
+ component,
448
+ instanceType,
449
+ factory: core.ComponentFactory
450
+ };
493
451
  }
494
452
 
495
453
  // Copyright 2024 IOTA Stiftung.
@@ -514,18 +472,12 @@ const AuditableItemGraphComponentType = {
514
472
  * @param engineCore The engine core.
515
473
  * @param context The context for the engine.
516
474
  * @param instanceConfig The instance config.
517
- * @param overrideInstanceType The instance type to override the default.
518
- * @returns The name of the instance created.
519
- * @throws GeneralError if the component type is unknown.
520
- */
521
- async function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig, overrideInstanceType) {
522
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
523
- element: `Auditable Item Graph Component: ${instanceConfig.type}`
524
- }));
525
- const type = instanceConfig.type;
475
+ * @returns The instance created and the factory for it.
476
+ */
477
+ async function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig) {
526
478
  let component;
527
479
  let instanceType;
528
- if (type === AuditableItemGraphComponentType.Service) {
480
+ if (instanceConfig.type === AuditableItemGraphComponentType.Service) {
529
481
  auditableItemGraphService.initSchema();
530
482
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
531
483
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
@@ -536,23 +488,15 @@ async function initialiseAuditableItemGraphComponent(engineCore, context, instan
536
488
  });
537
489
  instanceType = "auditable-item-graph-service";
538
490
  }
539
- else if (type === AuditableItemGraphComponentType.RestClient) {
491
+ else if (instanceConfig.type === AuditableItemGraphComponentType.RestClient) {
540
492
  component = new auditableItemGraphRestClient.AuditableItemGraphClient(instanceConfig.options);
541
493
  instanceType = "auditable-item-graph-client";
542
494
  }
543
- else {
544
- throw new core.GeneralError("engineCore", "componentUnknownType", {
545
- type,
546
- componentType: "auditableItemGraphComponent"
547
- });
548
- }
549
- const finalInstanceType = overrideInstanceType ?? instanceType;
550
- context.componentInstances.push({
551
- instanceType: finalInstanceType,
552
- component
553
- });
554
- core.ComponentFactory.register(finalInstanceType, () => component);
555
- return finalInstanceType;
495
+ return {
496
+ component,
497
+ instanceType,
498
+ factory: core.ComponentFactory
499
+ };
556
500
  }
557
501
 
558
502
  // Copyright 2024 IOTA Stiftung.
@@ -577,18 +521,12 @@ const AuditableItemStreamComponentType = {
577
521
  * @param engineCore The engine core.
578
522
  * @param context The context for the engine.
579
523
  * @param instanceConfig The instance config.
580
- * @param overrideInstanceType The instance type to override the default.
581
- * @returns The name of the instance created.
582
- * @throws GeneralError if the component type is unknown.
583
- */
584
- async function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig, overrideInstanceType) {
585
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
586
- element: `Auditable Item Stream Component: ${instanceConfig.type}`
587
- }));
588
- const type = instanceConfig.type;
524
+ * @returns The instance created and the factory for it.
525
+ */
526
+ async function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig) {
589
527
  let component;
590
528
  let instanceType;
591
- if (type === AuditableItemStreamComponentType.Service) {
529
+ if (instanceConfig.type === AuditableItemStreamComponentType.Service) {
592
530
  auditableItemStreamService.initSchema();
593
531
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
594
532
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
@@ -599,23 +537,15 @@ async function initialiseAuditableItemStreamComponent(engineCore, context, insta
599
537
  });
600
538
  instanceType = "auditable-item-stream-service";
601
539
  }
602
- else if (type === AuditableItemStreamComponentType.RestClient) {
540
+ else if (instanceConfig.type === AuditableItemStreamComponentType.RestClient) {
603
541
  component = new auditableItemStreamRestClient.AuditableItemStreamClient(instanceConfig.options);
604
542
  instanceType = "auditable-item-stream-client";
605
543
  }
606
- else {
607
- throw new core.GeneralError("engineCore", "componentUnknownType", {
608
- type,
609
- componentType: "auditableItemStreamComponent"
610
- });
611
- }
612
- const finalInstanceType = overrideInstanceType ?? instanceType;
613
- context.componentInstances.push({
614
- instanceType: finalInstanceType,
615
- component
616
- });
617
- core.ComponentFactory.register(finalInstanceType, () => component);
618
- return finalInstanceType;
544
+ return {
545
+ component,
546
+ instanceType,
547
+ factory: core.ComponentFactory
548
+ };
619
549
  }
620
550
 
621
551
  // Copyright 2024 IOTA Stiftung.
@@ -638,18 +568,12 @@ const AuthenticationGeneratorComponentType = {
638
568
  * @param engineCore The engine core.
639
569
  * @param context The context for the engine.
640
570
  * @param instanceConfig The instance config.
641
- * @param overrideInstanceType The instance type to override the default.
642
- * @returns The name of the instance created.
643
- * @throws GeneralError if the component type is unknown.
644
- */
645
- async function initialiseAuthenticationGeneratorComponent(engineCore, context, instanceConfig, overrideInstanceType) {
646
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
647
- element: `Authentication Generator Component: ${instanceConfig.type}`
648
- }));
649
- const type = instanceConfig.type;
571
+ * @returns The instance created and the factory for it.
572
+ */
573
+ async function initialiseAuthenticationGeneratorComponent(engineCore, context, instanceConfig) {
650
574
  let component;
651
575
  let instanceType;
652
- if (type === AuthenticationGeneratorComponentType.VerifiableCredential) {
576
+ if (instanceConfig.type === AuthenticationGeneratorComponentType.VerifiableCredential) {
653
577
  component = new identityAuthentication.VerifiableCredentialAuthenticationGenerator({
654
578
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
655
579
  identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
@@ -657,19 +581,11 @@ async function initialiseAuthenticationGeneratorComponent(engineCore, context, i
657
581
  });
658
582
  instanceType = "verifiable-credential-authentication-generator";
659
583
  }
660
- else {
661
- throw new core.GeneralError("engineCore", "componentUnknownType", {
662
- type,
663
- componentType: "AuthenticationGeneratorComponent"
664
- });
665
- }
666
- const finalInstanceType = overrideInstanceType ?? instanceType;
667
- context.componentInstances.push({
668
- instanceType: finalInstanceType,
669
- component
670
- });
671
- apiModels.AuthenticationGeneratorFactory.register(finalInstanceType, () => component);
672
- return finalInstanceType;
584
+ return {
585
+ component,
586
+ instanceType,
587
+ factory: apiModels.AuthenticationGeneratorFactory
588
+ };
673
589
  }
674
590
 
675
591
  // Copyright 2024 IOTA Stiftung.
@@ -692,36 +608,25 @@ const BackgroundTaskConnectorType = {
692
608
  * @param engineCore The engine core.
693
609
  * @param context The context for the engine.
694
610
  * @param instanceConfig The instance config.
695
- * @param overrideInstanceType The instance type to override the default.
696
- * @returns The name of the instance created.
697
- * @throws GeneralError if the connector type is unknown.
698
- */
699
- async function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig, overrideInstanceType) {
700
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
701
- element: `Background Task Connector: ${instanceConfig.type}`
702
- }));
703
- const type = instanceConfig.type;
704
- let connector;
611
+ * @returns The instance created and the factory for it.
612
+ */
613
+ async function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig) {
614
+ let component;
705
615
  let instanceType;
706
- if (type === BackgroundTaskConnectorType.EntityStorage) {
616
+ if (instanceConfig.type === BackgroundTaskConnectorType.EntityStorage) {
707
617
  backgroundTaskConnectorEntityStorage.initSchema();
708
618
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
709
- connector = new backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector({
619
+ component = new backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector({
710
620
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
711
621
  ...instanceConfig.options
712
622
  });
713
623
  instanceType = backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector.NAMESPACE;
714
624
  }
715
- else {
716
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
717
- type,
718
- connectorType: "backgroundTaskConnector"
719
- });
720
- }
721
- const finalInstanceType = overrideInstanceType ?? instanceType;
722
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
723
- backgroundTaskModels.BackgroundTaskConnectorFactory.register(finalInstanceType, () => connector);
724
- return finalInstanceType;
625
+ return {
626
+ component,
627
+ instanceType,
628
+ factory: backgroundTaskModels.BackgroundTaskConnectorFactory
629
+ };
725
630
  }
726
631
 
727
632
  // Copyright 2024 IOTA Stiftung.
@@ -781,23 +686,17 @@ const BlobStorageConnectorType = {
781
686
  * @param engineCore The engine core.
782
687
  * @param context The context for the engine.
783
688
  * @param instanceConfig The instance config.
784
- * @param overrideInstanceType The instance type to override the default.
785
- * @returns The name of the instance created.
786
- * @throws GeneralError if the connector type is unknown.
787
- */
788
- async function initialiseBlobStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
789
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
790
- element: `Blob Storage Connector: ${instanceConfig.type}`
791
- }));
792
- const type = instanceConfig.type;
793
- let connector;
689
+ * @returns The instance created and the factory for it.
690
+ */
691
+ async function initialiseBlobStorageConnector(engineCore, context, instanceConfig) {
692
+ let component;
794
693
  let instanceType;
795
- if (type === BlobStorageConnectorType.Ipfs) {
796
- connector = new blobStorageConnectorIpfs.IpfsBlobStorageConnector(instanceConfig.options);
694
+ if (instanceConfig.type === BlobStorageConnectorType.Ipfs) {
695
+ component = new blobStorageConnectorIpfs.IpfsBlobStorageConnector(instanceConfig.options);
797
696
  instanceType = blobStorageConnectorIpfs.IpfsBlobStorageConnector.NAMESPACE;
798
697
  }
799
- else if (type === BlobStorageConnectorType.File) {
800
- connector = new blobStorageConnectorFile.FileBlobStorageConnector({
698
+ else if (instanceConfig.type === BlobStorageConnectorType.File) {
699
+ component = new blobStorageConnectorFile.FileBlobStorageConnector({
801
700
  ...instanceConfig.options,
802
701
  config: {
803
702
  ...instanceConfig.options.config,
@@ -808,12 +707,12 @@ async function initialiseBlobStorageConnector(engineCore, context, instanceConfi
808
707
  });
809
708
  instanceType = blobStorageConnectorFile.FileBlobStorageConnector.NAMESPACE;
810
709
  }
811
- else if (type === BlobStorageConnectorType.Memory) {
812
- connector = new blobStorageConnectorMemory.MemoryBlobStorageConnector();
710
+ else if (instanceConfig.type === BlobStorageConnectorType.Memory) {
711
+ component = new blobStorageConnectorMemory.MemoryBlobStorageConnector();
813
712
  instanceType = blobStorageConnectorMemory.MemoryBlobStorageConnector.NAMESPACE;
814
713
  }
815
- else if (type === BlobStorageConnectorType.AwsS3) {
816
- connector = new blobStorageConnectorAwsS3.S3BlobStorageConnector({
714
+ else if (instanceConfig.type === BlobStorageConnectorType.AwsS3) {
715
+ component = new blobStorageConnectorAwsS3.S3BlobStorageConnector({
817
716
  ...instanceConfig.options,
818
717
  config: {
819
718
  ...instanceConfig.options.config,
@@ -822,8 +721,8 @@ async function initialiseBlobStorageConnector(engineCore, context, instanceConfi
822
721
  });
823
722
  instanceType = blobStorageConnectorAwsS3.S3BlobStorageConnector.NAMESPACE;
824
723
  }
825
- else if (type === BlobStorageConnectorType.GcpStorage) {
826
- connector = new blobStorageConnectorGcp.GcpBlobStorageConnector({
724
+ else if (instanceConfig.type === BlobStorageConnectorType.GcpStorage) {
725
+ component = new blobStorageConnectorGcp.GcpBlobStorageConnector({
827
726
  ...instanceConfig.options,
828
727
  config: {
829
728
  ...instanceConfig.options.config,
@@ -832,8 +731,8 @@ async function initialiseBlobStorageConnector(engineCore, context, instanceConfi
832
731
  });
833
732
  instanceType = blobStorageConnectorGcp.GcpBlobStorageConnector.NAMESPACE;
834
733
  }
835
- else if (type === BlobStorageConnectorType.AzureStorage) {
836
- connector = new blobStorageConnectorAzure.AzureBlobStorageConnector({
734
+ else if (instanceConfig.type === BlobStorageConnectorType.AzureStorage) {
735
+ component = new blobStorageConnectorAzure.AzureBlobStorageConnector({
837
736
  ...instanceConfig.options,
838
737
  config: {
839
738
  ...instanceConfig.options.config,
@@ -842,37 +741,23 @@ async function initialiseBlobStorageConnector(engineCore, context, instanceConfi
842
741
  });
843
742
  instanceType = blobStorageConnectorAzure.AzureBlobStorageConnector.NAMESPACE;
844
743
  }
845
- else {
846
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
847
- type,
848
- connectorType: "blobStorageConnector"
849
- });
850
- }
851
- const finalInstanceType = overrideInstanceType ?? instanceType;
852
- context.componentInstances.push({
853
- instanceType: finalInstanceType,
854
- component: connector
855
- });
856
- blobStorageModels.BlobStorageConnectorFactory.register(finalInstanceType, () => connector);
857
- return finalInstanceType;
744
+ return {
745
+ component,
746
+ instanceType,
747
+ factory: blobStorageModels.BlobStorageConnectorFactory
748
+ };
858
749
  }
859
750
  /**
860
751
  * Initialise the blob storage component.
861
752
  * @param engineCore The engine core.
862
753
  * @param context The context for the engine.
863
754
  * @param instanceConfig The instance config.
864
- * @param overrideInstanceType The instance type to override the default.
865
- * @returns The name of the instance created.
866
- * @throws GeneralError if the component type is unknown.
867
- */
868
- async function initialiseBlobStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
869
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
870
- element: `Blob Storage Component: ${instanceConfig.type}`
871
- }));
872
- const type = instanceConfig.type;
755
+ * @returns The instance created and the factory for it.
756
+ */
757
+ async function initialiseBlobStorageComponent(engineCore, context, instanceConfig) {
873
758
  let component;
874
759
  let instanceType;
875
- if (type === BlobStorageComponentType.Service) {
760
+ if (instanceConfig.type === BlobStorageComponentType.Service) {
876
761
  blobStorageService.initSchema();
877
762
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
878
763
  component = new blobStorageService.BlobStorageService({
@@ -881,23 +766,15 @@ async function initialiseBlobStorageComponent(engineCore, context, instanceConfi
881
766
  });
882
767
  instanceType = "blob-storage-service";
883
768
  }
884
- else if (type === BlobStorageComponentType.RestClient) {
769
+ else if (instanceConfig.type === BlobStorageComponentType.RestClient) {
885
770
  component = new blobStorageRestClient.BlobStorageClient(instanceConfig.options);
886
771
  instanceType = "blob-storage-client";
887
772
  }
888
- else {
889
- throw new core.GeneralError("engineCore", "componentUnknownType", {
890
- type,
891
- componentType: "blobStorageComponent"
892
- });
893
- }
894
- const finalInstanceType = overrideInstanceType ?? instanceType;
895
- context.componentInstances.push({
896
- instanceType: finalInstanceType,
897
- component
898
- });
899
- core.ComponentFactory.register(finalInstanceType, () => component);
900
- return finalInstanceType;
773
+ return {
774
+ component,
775
+ instanceType,
776
+ factory: core.ComponentFactory
777
+ };
901
778
  }
902
779
 
903
780
  // Copyright 2024 IOTA Stiftung.
@@ -954,90 +831,56 @@ const DataProcessingComponentType = {
954
831
  * @param engineCore The engine core.
955
832
  * @param context The context for the engine.
956
833
  * @param instanceConfig The instance config.
957
- * @param overrideInstanceType The instance type to override the default.
958
- * @returns The name of the instance created.
959
- * @throws GeneralError if the connector type is unknown.
960
- */
961
- async function initialiseDataConverterConnector(engineCore, context, instanceConfig, overrideInstanceType) {
962
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
963
- element: `Data Converter Connector: ${instanceConfig.type}`
964
- }));
965
- const type = instanceConfig.type;
966
- let connector;
834
+ * @returns The instance created and the factory for it.
835
+ */
836
+ async function initialiseDataConverterConnector(engineCore, context, instanceConfig) {
837
+ let component;
967
838
  let instanceType;
968
- if (type === DataConverterConnectorType.Json) {
969
- connector = new dataProcessingConverters.JsonConverterConnector();
839
+ if (instanceConfig.type === DataConverterConnectorType.Json) {
840
+ component = new dataProcessingConverters.JsonConverterConnector();
970
841
  instanceType = dataProcessingConverters.JsonConverterConnector.NAMESPACE;
971
842
  }
972
- else if (type === DataConverterConnectorType.Xml) {
973
- connector = new dataProcessingConverters.XmlConverterConnector();
843
+ else if (instanceConfig.type === DataConverterConnectorType.Xml) {
844
+ component = new dataProcessingConverters.XmlConverterConnector();
974
845
  instanceType = dataProcessingConverters.XmlConverterConnector.NAMESPACE;
975
846
  }
976
- else {
977
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
978
- type,
979
- connectorType: "dataConverterConnector"
980
- });
981
- }
982
- const finalInstanceType = overrideInstanceType ?? instanceType;
983
- context.componentInstances.push({
984
- instanceType: finalInstanceType,
985
- component: connector
986
- });
987
- dataProcessingModels.DataConverterConnectorFactory.register(finalInstanceType, () => connector);
988
- return finalInstanceType;
847
+ return {
848
+ component,
849
+ instanceType,
850
+ factory: dataProcessingModels.DataConverterConnectorFactory
851
+ };
989
852
  }
990
853
  /**
991
854
  * Initialise the data extractor connector.
992
855
  * @param engineCore The engine core.
993
856
  * @param context The context for the engine.
994
857
  * @param instanceConfig The instance config.
995
- * @param overrideInstanceType The instance type to override the default.
996
- * @returns The name of the instance created.
997
- * @throws GeneralError if the connector type is unknown.
998
- */
999
- async function initialiseDataExtractorConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1000
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1001
- element: `Data Extractor Connector: ${instanceConfig.type}`
1002
- }));
1003
- const type = instanceConfig.type;
1004
- let connector;
858
+ * @returns The instance created and the factory for it.
859
+ */
860
+ async function initialiseDataExtractorConnector(engineCore, context, instanceConfig) {
861
+ let component;
1005
862
  let instanceType;
1006
- if (type === DataExtractorConnectorType.JsonPath) {
1007
- connector = new dataProcessingExtractors.JsonPathExtractorConnector();
863
+ if (instanceConfig.type === DataExtractorConnectorType.JsonPath) {
864
+ component = new dataProcessingExtractors.JsonPathExtractorConnector();
1008
865
  instanceType = dataProcessingExtractors.JsonPathExtractorConnector.NAMESPACE;
1009
866
  }
1010
- else {
1011
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1012
- type,
1013
- connectorType: "dataExtractorConnector"
1014
- });
1015
- }
1016
- const finalInstanceType = overrideInstanceType ?? instanceType;
1017
- context.componentInstances.push({
1018
- instanceType: finalInstanceType,
1019
- component: connector
1020
- });
1021
- dataProcessingModels.DataExtractorConnectorFactory.register(finalInstanceType, () => connector);
1022
- return finalInstanceType;
867
+ return {
868
+ component,
869
+ instanceType,
870
+ factory: dataProcessingModels.DataExtractorConnectorFactory
871
+ };
1023
872
  }
1024
873
  /**
1025
874
  * Initialise the data processing component.
1026
875
  * @param engineCore The engine core.
1027
876
  * @param context The context for the engine.
1028
877
  * @param instanceConfig The instance config.
1029
- * @param overrideInstanceType The instance type to override the default.
1030
- * @returns The name of the instance created.
1031
- * @throws GeneralError if the component type is unknown.
1032
- */
1033
- async function initialiseDataProcessingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1034
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1035
- element: `Data Processing Component: ${instanceConfig.type}`
1036
- }));
1037
- const type = instanceConfig.type;
878
+ * @returns The instance created and the factory for it.
879
+ */
880
+ async function initialiseDataProcessingComponent(engineCore, context, instanceConfig) {
1038
881
  let component;
1039
882
  let instanceType;
1040
- if (type === DataProcessingComponentType.Service) {
883
+ if (instanceConfig.type === DataProcessingComponentType.Service) {
1041
884
  dataProcessingService.initSchema();
1042
885
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.extractionRuleGroupStorageConnectorType, "ExtractionRuleGroup");
1043
886
  component = new dataProcessingService.DataProcessingService({
@@ -1045,23 +888,15 @@ async function initialiseDataProcessingComponent(engineCore, context, instanceCo
1045
888
  });
1046
889
  instanceType = "data-processing-service";
1047
890
  }
1048
- else if (type === DataProcessingComponentType.RestClient) {
891
+ else if (instanceConfig.type === DataProcessingComponentType.RestClient) {
1049
892
  component = new dataProcessingRestClient.DataProcessingClient(instanceConfig.options);
1050
893
  instanceType = "data-processing-client";
1051
894
  }
1052
- else {
1053
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1054
- type,
1055
- componentType: "dataProcessingComponent"
1056
- });
1057
- }
1058
- const finalInstanceType = overrideInstanceType ?? instanceType;
1059
- context.componentInstances.push({
1060
- instanceType: finalInstanceType,
1061
- component
1062
- });
1063
- core.ComponentFactory.register(finalInstanceType, () => component);
1064
- return finalInstanceType;
895
+ return {
896
+ component,
897
+ instanceType,
898
+ factory: core.ComponentFactory
899
+ };
1065
900
  }
1066
901
 
1067
902
  // Copyright 2024 IOTA Stiftung.
@@ -1092,18 +927,12 @@ const DataSpaceConnectorComponentType = {
1092
927
  * @param engineCore The engine core.
1093
928
  * @param context The context for the engine.
1094
929
  * @param instanceConfig The instance config.
1095
- * @param overrideInstanceType The instance type to override the default.
1096
- * @returns The name of the instance created.
1097
- * @throws GeneralError if the component type is unknown.
1098
- */
1099
- async function initialiseDataSpaceConnectorComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1100
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1101
- element: `Data Space Connector Component: ${instanceConfig.type}`
1102
- }));
1103
- const type = instanceConfig.type;
930
+ * @returns The instance created and the factory for it.
931
+ */
932
+ async function initialiseDataSpaceConnectorComponent(engineCore, context, instanceConfig) {
1104
933
  let component;
1105
934
  let instanceType;
1106
- if (type === DataSpaceConnectorComponentType.Service) {
935
+ if (instanceConfig.type === DataSpaceConnectorComponentType.Service) {
1107
936
  dataSpaceConnectorService.initSchema();
1108
937
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityLogEntityStorageType, "ActivityLogDetails");
1109
938
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask");
@@ -1115,27 +944,22 @@ async function initialiseDataSpaceConnectorComponent(engineCore, context, instan
1115
944
  });
1116
945
  instanceType = "data-space-connector-service";
1117
946
  }
1118
- else if (type === DataSpaceConnectorComponentType.RestClient) {
947
+ else if (instanceConfig.type === DataSpaceConnectorComponentType.RestClient) {
1119
948
  component = new dataSpaceConnectorRestClient.DataSpaceConnectorClient(instanceConfig.options);
1120
949
  instanceType = "data-space-connector-client";
1121
950
  }
1122
- else if (type === DataSpaceConnectorComponentType.SocketClient) {
951
+ else if (instanceConfig.type === DataSpaceConnectorComponentType.SocketClient) {
1123
952
  component = new dataSpaceConnectorSocketClient.DataSpaceConnectorSocketClient({
1124
953
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1125
954
  ...instanceConfig.options
1126
955
  });
1127
956
  instanceType = "data-space-connector-socket-client";
1128
957
  }
1129
- else {
1130
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1131
- type,
1132
- componentType: "DataSpaceConnectorComponent"
1133
- });
1134
- }
1135
- const finalInstanceType = overrideInstanceType ?? instanceType;
1136
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1137
- core.ComponentFactory.register(finalInstanceType, () => component);
1138
- return finalInstanceType;
958
+ return {
959
+ component,
960
+ instanceType,
961
+ factory: core.ComponentFactory
962
+ };
1139
963
  }
1140
964
 
1141
965
  // Copyright 2024 IOTA Stiftung.
@@ -1162,18 +986,12 @@ const DocumentManagementComponentType = {
1162
986
  * @param engineCore The engine core.
1163
987
  * @param context The context for the engine.
1164
988
  * @param instanceConfig The instance config.
1165
- * @param overrideInstanceType The instance type to override the default.
1166
- * @returns The name of the instance created.
1167
- * @throws GeneralError if the component type is unknown.
1168
- */
1169
- async function initialiseDocumentManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1170
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1171
- element: `Document Management Component: ${instanceConfig.type}`
1172
- }));
1173
- const type = instanceConfig.type;
989
+ * @returns The instance created and the factory for it.
990
+ */
991
+ async function initialiseDocumentManagementComponent(engineCore, context, instanceConfig) {
1174
992
  let component;
1175
993
  let instanceType;
1176
- if (type === DocumentManagementComponentType.Service) {
994
+ if (instanceConfig.type === DocumentManagementComponentType.Service) {
1177
995
  component = new documentManagementService.DocumentManagementService({
1178
996
  auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
1179
997
  blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
@@ -1183,23 +1001,15 @@ async function initialiseDocumentManagementComponent(engineCore, context, instan
1183
1001
  });
1184
1002
  instanceType = "document-management-service";
1185
1003
  }
1186
- else if (type === DocumentManagementComponentType.RestClient) {
1004
+ else if (instanceConfig.type === DocumentManagementComponentType.RestClient) {
1187
1005
  component = new documentManagementRestClient.DocumentManagementClient(instanceConfig.options);
1188
1006
  instanceType = "document-management-client";
1189
1007
  }
1190
- else {
1191
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1192
- type,
1193
- componentType: "documentManagementComponent"
1194
- });
1195
- }
1196
- const finalInstanceType = overrideInstanceType ?? instanceType;
1197
- context.componentInstances.push({
1198
- instanceType: finalInstanceType,
1199
- component
1200
- });
1201
- core.ComponentFactory.register(finalInstanceType, () => component);
1202
- return finalInstanceType;
1008
+ return {
1009
+ component,
1010
+ instanceType,
1011
+ factory: core.ComponentFactory
1012
+ };
1203
1013
  }
1204
1014
 
1205
1015
  // Copyright 2024 IOTA Stiftung.
@@ -1239,75 +1049,53 @@ const EventBusConnectorType = {
1239
1049
  * @param engineCore The engine core.
1240
1050
  * @param context The context for the engine.
1241
1051
  * @param instanceConfig The instance config.
1242
- * @param overrideInstanceType The instance type to override the default.
1243
- * @returns The name of the instance created.
1244
- * @throws GeneralError if the connector type is unknown.
1245
- */
1246
- async function initialiseEventBusConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1247
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1248
- element: `Event Bus Connector: ${instanceConfig.type}`
1249
- }));
1250
- const type = instanceConfig.type;
1052
+ * @returns The instance created and the factory for it.
1053
+ */
1054
+ async function initialiseEventBusConnector(engineCore, context, instanceConfig) {
1251
1055
  let connector;
1252
1056
  let instanceType;
1253
- if (type === EventBusConnectorType.Local) {
1057
+ if (instanceConfig.type === EventBusConnectorType.Local) {
1254
1058
  connector = new eventBusConnectorLocal.LocalEventBusConnector({
1255
1059
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1256
1060
  ...instanceConfig.options
1257
1061
  });
1258
1062
  instanceType = eventBusConnectorLocal.LocalEventBusConnector.NAMESPACE;
1259
1063
  }
1260
- else {
1261
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1262
- type,
1263
- connectorType: "eventBusConnector"
1264
- });
1265
- }
1266
- const finalInstanceType = overrideInstanceType ?? instanceType;
1267
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1268
- eventBusModels.EventBusConnectorFactory.register(finalInstanceType, () => connector);
1269
- return finalInstanceType;
1064
+ return {
1065
+ instanceType,
1066
+ factory: eventBusModels.EventBusConnectorFactory,
1067
+ component: connector
1068
+ };
1270
1069
  }
1271
1070
  /**
1272
1071
  * Initialise the event bus component.
1273
1072
  * @param engineCore The engine core.
1274
1073
  * @param context The context for the engine.
1275
1074
  * @param instanceConfig The instance config.
1276
- * @param overrideInstanceType The instance type to override the default.
1277
- * @returns The name of the instance created.
1278
- * @throws GeneralError if the component type is unknown.
1279
- */
1280
- async function initialiseEventBusComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1281
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1282
- element: `Event Bus Component: ${instanceConfig.type}`
1283
- }));
1284
- const type = instanceConfig.type;
1075
+ * @returns The instance created and the factory for it.
1076
+ */
1077
+ async function initialiseEventBusComponent(engineCore, context, instanceConfig) {
1285
1078
  let component;
1286
1079
  let instanceType;
1287
- if (type === EventBusComponentType.Service) {
1080
+ if (instanceConfig.type === EventBusComponentType.Service) {
1288
1081
  component = new eventBusService.EventBusService({
1289
1082
  eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
1290
1083
  ...instanceConfig.options
1291
1084
  });
1292
1085
  instanceType = "event-bus-service";
1293
1086
  }
1294
- else if (type === EventBusComponentType.SocketClient) {
1087
+ else if (instanceConfig.type === EventBusComponentType.SocketClient) {
1295
1088
  component = new eventBusSocketClient.EventBusSocketClient({
1296
1089
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1297
1090
  ...instanceConfig.options
1298
1091
  });
1299
1092
  instanceType = "event-bus-socket-client";
1300
1093
  }
1301
- else {
1302
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1303
- type,
1304
- componentType: "EventBusComponent"
1305
- });
1306
- }
1307
- const finalInstanceType = overrideInstanceType ?? instanceType;
1308
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1309
- core.ComponentFactory.register(finalInstanceType, () => component);
1310
- return finalInstanceType;
1094
+ return {
1095
+ instanceType,
1096
+ factory: core.ComponentFactory,
1097
+ component
1098
+ };
1311
1099
  }
1312
1100
 
1313
1101
  // Copyright 2024 IOTA Stiftung.
@@ -1371,27 +1159,19 @@ class EngineTypeHelper {
1371
1159
  }
1372
1160
  }
1373
1161
 
1374
- // Copyright 2024 IOTA Stiftung.
1375
- // SPDX-License-Identifier: Apache-2.0.
1376
1162
  /**
1377
1163
  * Initialise a faucet connector.
1378
1164
  * @param engineCore The engine core.
1379
1165
  * @param context The context for the engine.
1380
1166
  * @param instanceConfig The instance config.
1381
- * @param overrideInstanceType The instance type to override the default.
1382
- * @returns The name of the instance created.
1383
- * @throws GeneralError if the connector type is unknown.
1384
- */
1385
- async function initialiseFaucetConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1386
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1387
- element: `Faucet Connector: ${instanceConfig.type}`
1388
- }));
1389
- const type = instanceConfig.type;
1390
- let connector;
1167
+ * @returns The instance created and the factory for it.
1168
+ */
1169
+ async function initialiseFaucetConnector(engineCore, context, instanceConfig) {
1170
+ let component;
1391
1171
  let instanceType;
1392
- if (type === FaucetConnectorType.Iota) {
1172
+ if (instanceConfig.type === FaucetConnectorType.Iota) {
1393
1173
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
1394
- connector = new walletConnectorIota.IotaFaucetConnector({
1174
+ component = new walletConnectorIota.IotaFaucetConnector({
1395
1175
  ...instanceConfig.options,
1396
1176
  config: {
1397
1177
  ...dltConfig?.options?.config,
@@ -1400,23 +1180,17 @@ async function initialiseFaucetConnector(engineCore, context, instanceConfig, ov
1400
1180
  });
1401
1181
  instanceType = walletConnectorIota.IotaFaucetConnector.NAMESPACE;
1402
1182
  }
1403
- else if (type === FaucetConnectorType.EntityStorage) {
1404
- connector = new walletConnectorEntityStorage.EntityStorageFaucetConnector(instanceConfig.options);
1183
+ else if (instanceConfig.type === FaucetConnectorType.EntityStorage) {
1184
+ walletConnectorEntityStorage.initSchema();
1185
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
1186
+ component = new walletConnectorEntityStorage.EntityStorageFaucetConnector(instanceConfig.options);
1405
1187
  instanceType = walletConnectorEntityStorage.EntityStorageFaucetConnector.NAMESPACE;
1406
1188
  }
1407
- else {
1408
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1409
- type,
1410
- connectorType: "faucetConnector"
1411
- });
1412
- }
1413
- const finalInstanceType = overrideInstanceType ?? instanceType;
1414
- context.componentInstances.push({
1415
- instanceType: finalInstanceType,
1416
- component: connector
1417
- });
1418
- walletModels.FaucetConnectorFactory.register(finalInstanceType, () => connector);
1419
- return finalInstanceType;
1189
+ return {
1190
+ component,
1191
+ instanceType,
1192
+ factory: walletModels.FaucetConnectorFactory
1193
+ };
1420
1194
  }
1421
1195
 
1422
1196
  // Copyright 2024 IOTA Stiftung.
@@ -1443,18 +1217,12 @@ const FederatedCatalogueComponentType = {
1443
1217
  * @param engineCore The engine core.
1444
1218
  * @param context The context for the engine.
1445
1219
  * @param instanceConfig The instance config.
1446
- * @param overrideInstanceType The instance type to override the default.
1447
- * @returns The name of the instance created.
1448
- * @throws GeneralError if the component type is unknown.
1449
- */
1450
- async function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1451
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1452
- element: `Federated Catalogue Component: ${instanceConfig.type}`
1453
- }));
1454
- const type = instanceConfig.type;
1220
+ * @returns The instance created and the factory for it.
1221
+ */
1222
+ async function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig) {
1455
1223
  let component;
1456
1224
  let instanceType;
1457
- if (type === FederatedCatalogueComponentType.Service) {
1225
+ if (instanceConfig.type === FederatedCatalogueComponentType.Service) {
1458
1226
  federatedCatalogueService.initSchema();
1459
1227
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry");
1460
1228
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry");
@@ -1467,23 +1235,15 @@ async function initialiseFederatedCatalogueComponent(engineCore, context, instan
1467
1235
  });
1468
1236
  instanceType = "federated-catalogue-service";
1469
1237
  }
1470
- else if (type === FederatedCatalogueComponentType.RestClient) {
1238
+ else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {
1471
1239
  component = new federatedCatalogueRestClient.FederatedCatalogueClient(instanceConfig.options);
1472
1240
  instanceType = "federated-catalogue-client";
1473
1241
  }
1474
- else {
1475
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1476
- type,
1477
- componentType: "FederatedCatalogueComponent"
1478
- });
1479
- }
1480
- const finalInstanceType = overrideInstanceType ?? instanceType;
1481
- context.componentInstances.push({
1482
- instanceType: finalInstanceType,
1483
- component
1484
- });
1485
- core.ComponentFactory.register(finalInstanceType, () => component);
1486
- return finalInstanceType;
1242
+ return {
1243
+ component,
1244
+ instanceType,
1245
+ factory: core.ComponentFactory
1246
+ };
1487
1247
  }
1488
1248
 
1489
1249
  // Copyright 2024 IOTA Stiftung.
@@ -1527,20 +1287,14 @@ const IdentityConnectorType = {
1527
1287
  * @param engineCore The engine core.
1528
1288
  * @param context The context for the engine.
1529
1289
  * @param instanceConfig The instance config.
1530
- * @param overrideInstanceType The instance type to override the default.
1531
- * @returns The name of the instance created.
1532
- * @throws GeneralError if the connector type is unknown.
1533
- */
1534
- async function initialiseIdentityConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1535
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1536
- element: `Identity Connector: ${instanceConfig.type}`
1537
- }));
1538
- const type = instanceConfig.type;
1539
- let connector;
1290
+ * @returns The instance created and the factory for it.
1291
+ */
1292
+ async function initialiseIdentityConnector(engineCore, context, instanceConfig) {
1293
+ let component;
1540
1294
  let instanceType;
1541
- if (type === IdentityConnectorType.Iota) {
1295
+ if (instanceConfig.type === IdentityConnectorType.Iota) {
1542
1296
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
1543
- connector = new identityConnectorIota.IotaIdentityConnector({
1297
+ component = new identityConnectorIota.IotaIdentityConnector({
1544
1298
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1545
1299
  ...instanceConfig.options,
1546
1300
  config: {
@@ -1550,60 +1304,44 @@ async function initialiseIdentityConnector(engineCore, context, instanceConfig,
1550
1304
  });
1551
1305
  instanceType = identityConnectorIota.IotaIdentityConnector.NAMESPACE;
1552
1306
  }
1553
- else if (type === IdentityConnectorType.EntityStorage) {
1307
+ else if (instanceConfig.type === IdentityConnectorType.EntityStorage) {
1554
1308
  identityConnectorEntityStorage.initSchema({ includeProfile: false });
1555
1309
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
1556
- connector = new identityConnectorEntityStorage.EntityStorageIdentityConnector({
1310
+ component = new identityConnectorEntityStorage.EntityStorageIdentityConnector({
1557
1311
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1558
1312
  ...instanceConfig.options
1559
1313
  });
1560
1314
  instanceType = identityConnectorEntityStorage.EntityStorageIdentityConnector.NAMESPACE;
1561
1315
  }
1562
- else {
1563
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1564
- type,
1565
- connectorType: "identityConnector"
1566
- });
1567
- }
1568
- const finalInstanceType = overrideInstanceType ?? instanceType;
1569
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1570
- identityModels.IdentityConnectorFactory.register(finalInstanceType, () => connector);
1571
- return finalInstanceType;
1316
+ return {
1317
+ component,
1318
+ instanceType,
1319
+ factory: identityModels.IdentityConnectorFactory
1320
+ };
1572
1321
  }
1573
1322
  /**
1574
1323
  * Initialise the identity component.
1575
1324
  * @param engineCore The engine core.
1576
1325
  * @param context The context for the engine.
1577
1326
  * @param instanceConfig The instance config.
1578
- * @param overrideInstanceType The instance type to override the default.
1579
- * @returns The name of the instance created.
1580
- * @throws GeneralError if the component type is unknown.
1581
- */
1582
- async function initialiseIdentityComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1583
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1584
- element: `Identity Component: ${instanceConfig.type}`
1585
- }));
1586
- const type = instanceConfig.type;
1327
+ * @returns The instance created and the factory for it.
1328
+ */
1329
+ async function initialiseIdentityComponent(engineCore, context, instanceConfig) {
1587
1330
  let component;
1588
1331
  let instanceType;
1589
- if (type === IdentityComponentType.Service) {
1332
+ if (instanceConfig.type === IdentityComponentType.Service) {
1590
1333
  component = new identityService.IdentityService(instanceConfig.options);
1591
1334
  instanceType = "identity-service";
1592
1335
  }
1593
- else if (type === IdentityComponentType.RestClient) {
1336
+ else if (instanceConfig.type === IdentityComponentType.RestClient) {
1594
1337
  component = new identityRestClient.IdentityClient(instanceConfig.options);
1595
1338
  instanceType = "identity-client";
1596
1339
  }
1597
- else {
1598
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1599
- type,
1600
- componentType: "identityComponent"
1601
- });
1602
- }
1603
- const finalInstanceType = overrideInstanceType ?? instanceType;
1604
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1605
- core.ComponentFactory.register(finalInstanceType, () => component);
1606
- return finalInstanceType;
1340
+ return {
1341
+ component,
1342
+ instanceType,
1343
+ factory: core.ComponentFactory
1344
+ };
1607
1345
  }
1608
1346
 
1609
1347
  // Copyright 2024 IOTA Stiftung.
@@ -1643,77 +1381,49 @@ const IdentityProfileConnectorType = {
1643
1381
  * @param engineCore The engine core.
1644
1382
  * @param context The context for the engine.
1645
1383
  * @param instanceConfig The instance config.
1646
- * @param overrideInstanceType The instance type to override the default.
1647
- * @returns The name of the instance created.
1648
- * @throws GeneralError if the connector type is unknown.
1649
- */
1650
- async function initialiseIdentityProfileConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1651
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1652
- element: `Identity Profile Connector: ${instanceConfig.type}`
1653
- }));
1654
- const type = instanceConfig.type;
1384
+ * @returns The instance created and the factory for it.
1385
+ */
1386
+ async function initialiseIdentityProfileConnector(engineCore, context, instanceConfig) {
1655
1387
  let connector;
1656
1388
  let instanceType;
1657
- if (type === IdentityProfileConnectorType.EntityStorage) {
1389
+ if (instanceConfig.type === IdentityProfileConnectorType.EntityStorage) {
1658
1390
  identityConnectorEntityStorage.initSchema({ includeDocument: false });
1659
1391
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.profileEntityStorageType, "IdentityProfile");
1660
1392
  connector = new identityConnectorEntityStorage.EntityStorageIdentityProfileConnector(instanceConfig.options);
1661
1393
  instanceType = identityConnectorEntityStorage.EntityStorageIdentityProfileConnector.NAMESPACE;
1662
1394
  }
1663
- else {
1664
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1665
- type,
1666
- serviceType: "identityProfile"
1667
- });
1668
- }
1669
- const finalInstanceType = overrideInstanceType ?? instanceType;
1670
- context.componentInstances.push({
1671
- instanceType: finalInstanceType,
1672
- component: connector
1673
- });
1674
- identityModels.IdentityProfileConnectorFactory.register(finalInstanceType, () => connector);
1675
- return finalInstanceType;
1395
+ return {
1396
+ component: connector,
1397
+ instanceType,
1398
+ factory: identityModels.IdentityProfileConnectorFactory
1399
+ };
1676
1400
  }
1677
1401
  /**
1678
1402
  * Initialise the identity profile component.
1679
1403
  * @param engineCore The engine core.
1680
1404
  * @param context The context for the engine.
1681
1405
  * @param instanceConfig The instance config.
1682
- * @param overrideInstanceType The instance type to override the default.
1683
- * @returns The name of the instance created.
1684
- * @throws GeneralError if the component type is unknown.
1685
- */
1686
- async function initialiseIdentityProfileComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1687
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1688
- element: `Identity Profile Component: ${instanceConfig.type}`
1689
- }));
1690
- const type = instanceConfig.type;
1406
+ * @returns The instance created and the factory for it.
1407
+ */
1408
+ async function initialiseIdentityProfileComponent(engineCore, context, instanceConfig) {
1691
1409
  let component;
1692
1410
  let instanceType;
1693
- if (type === IdentityProfileComponentType.Service) {
1411
+ if (instanceConfig.type === IdentityProfileComponentType.Service) {
1694
1412
  component = new identityService.IdentityProfileService({
1695
1413
  profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
1696
1414
  ...instanceConfig.options
1697
1415
  });
1698
1416
  instanceType = "identity-profile-service";
1699
1417
  }
1700
- else if (type === IdentityProfileComponentType.RestClient) {
1418
+ else if (instanceConfig.type === IdentityProfileComponentType.RestClient) {
1701
1419
  component = new identityRestClient.IdentityProfileClient(instanceConfig.options);
1702
1420
  instanceType = "identity-profile-client";
1703
1421
  }
1704
- else {
1705
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1706
- type,
1707
- componentType: "identityProfileComponent"
1708
- });
1709
- }
1710
- const finalInstanceType = overrideInstanceType ?? instanceType;
1711
- context.componentInstances.push({
1712
- instanceType: finalInstanceType,
1713
- component
1714
- });
1715
- core.ComponentFactory.register(finalInstanceType, () => component);
1716
- return finalInstanceType;
1422
+ return {
1423
+ component,
1424
+ instanceType,
1425
+ factory: core.ComponentFactory
1426
+ };
1717
1427
  }
1718
1428
 
1719
1429
  // Copyright 2024 IOTA Stiftung.
@@ -1761,20 +1471,14 @@ const IdentityResolverConnectorType = {
1761
1471
  * @param engineCore The engine core.
1762
1472
  * @param context The context for the engine.
1763
1473
  * @param instanceConfig The instance config.
1764
- * @param overrideInstanceType The instance type to override the default.
1765
- * @returns The name of the instance created.
1766
- * @throws GeneralError if the connector type is unknown.
1767
- */
1768
- async function initialiseIdentityResolverConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1769
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1770
- element: `Identity Resolver Connector: ${instanceConfig.type}`
1771
- }));
1772
- const type = instanceConfig.type;
1773
- let connector;
1474
+ * @returns The instance created and the factory for it.
1475
+ */
1476
+ async function initialiseIdentityResolverConnector(engineCore, context, instanceConfig) {
1477
+ let component;
1774
1478
  let instanceType;
1775
- if (type === IdentityResolverConnectorType.Iota) {
1479
+ if (instanceConfig.type === IdentityResolverConnectorType.Iota) {
1776
1480
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
1777
- connector = new identityConnectorIota.IotaIdentityResolverConnector({
1481
+ component = new identityConnectorIota.IotaIdentityResolverConnector({
1778
1482
  ...instanceConfig.options,
1779
1483
  config: {
1780
1484
  ...dltConfig?.options?.config,
@@ -1783,49 +1487,38 @@ async function initialiseIdentityResolverConnector(engineCore, context, instance
1783
1487
  });
1784
1488
  instanceType = identityConnectorIota.IotaIdentityResolverConnector.NAMESPACE;
1785
1489
  }
1786
- else if (type === IdentityResolverConnectorType.EntityStorage) {
1490
+ else if (instanceConfig.type === IdentityResolverConnectorType.EntityStorage) {
1787
1491
  identityConnectorEntityStorage.initSchema({ includeProfile: false });
1788
1492
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
1789
- connector = new identityConnectorEntityStorage.EntityStorageIdentityResolverConnector({
1493
+ component = new identityConnectorEntityStorage.EntityStorageIdentityResolverConnector({
1790
1494
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1791
1495
  ...instanceConfig.options
1792
1496
  });
1793
1497
  instanceType = identityConnectorEntityStorage.EntityStorageIdentityResolverConnector.NAMESPACE;
1794
1498
  }
1795
- else if (type === IdentityResolverConnectorType.Universal) {
1796
- connector = new identityConnectorUniversal.UniversalResolverConnector({
1499
+ else if (instanceConfig.type === IdentityResolverConnectorType.Universal) {
1500
+ component = new identityConnectorUniversal.UniversalResolverConnector({
1797
1501
  ...instanceConfig.options
1798
1502
  });
1799
1503
  instanceType = identityConnectorUniversal.UniversalResolverConnector.NAMESPACE;
1800
1504
  }
1801
- else {
1802
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1803
- type,
1804
- connectorType: "identityResolverConnector"
1805
- });
1806
- }
1807
- const finalInstanceType = overrideInstanceType ?? instanceType;
1808
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1809
- identityModels.IdentityResolverConnectorFactory.register(finalInstanceType, () => connector);
1810
- return finalInstanceType;
1505
+ return {
1506
+ component,
1507
+ instanceType,
1508
+ factory: identityModels.IdentityResolverConnectorFactory
1509
+ };
1811
1510
  }
1812
1511
  /**
1813
1512
  * Initialise the identity resolver component.
1814
1513
  * @param engineCore The engine core.
1815
1514
  * @param context The context for the engine.
1816
1515
  * @param instanceConfig The instance config.
1817
- * @param overrideInstanceType The instance type to override the default.
1818
- * @returns The name of the instance created.
1819
- * @throws GeneralError if the component type is unknown.
1820
- */
1821
- async function initialiseIdentityResolverComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1822
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1823
- element: `Identity Resolver Component: ${instanceConfig.type}`
1824
- }));
1825
- const type = instanceConfig.type;
1516
+ * @returns The instance created and the factory for it.
1517
+ */
1518
+ async function initialiseIdentityResolverComponent(engineCore, context, instanceConfig) {
1826
1519
  let component;
1827
1520
  let instanceType;
1828
- if (type === IdentityResolverComponentType.Service) {
1521
+ if (instanceConfig.type === IdentityResolverComponentType.Service) {
1829
1522
  const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
1830
1523
  component = new identityService.IdentityResolverService({
1831
1524
  fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
@@ -1835,20 +1528,15 @@ async function initialiseIdentityResolverComponent(engineCore, context, instance
1835
1528
  });
1836
1529
  instanceType = "identity-resolver-service";
1837
1530
  }
1838
- else if (type === IdentityResolverComponentType.RestClient) {
1531
+ else if (instanceConfig.type === IdentityResolverComponentType.RestClient) {
1839
1532
  component = new identityRestClient.IdentityResolverClient(instanceConfig.options);
1840
1533
  instanceType = "identity-resolver-client";
1841
1534
  }
1842
- else {
1843
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1844
- type,
1845
- componentType: "identityResolverComponent"
1846
- });
1847
- }
1848
- const finalInstanceType = overrideInstanceType ?? instanceType;
1849
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1850
- core.ComponentFactory.register(finalInstanceType, () => component);
1851
- return finalInstanceType;
1535
+ return {
1536
+ component,
1537
+ instanceType,
1538
+ factory: core.ComponentFactory
1539
+ };
1852
1540
  }
1853
1541
 
1854
1542
  // Copyright 2024 IOTA Stiftung.
@@ -1875,18 +1563,12 @@ const ImmutableProofComponentType = {
1875
1563
  * @param engineCore The engine core.
1876
1564
  * @param context The context for the engine.
1877
1565
  * @param instanceConfig The instance config.
1878
- * @param overrideInstanceType The instance type to override the default.
1879
- * @returns The name of the instance created.
1880
- * @throws GeneralError if the component type is unknown.
1881
- */
1882
- async function initialiseImmutableProofComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1883
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1884
- element: `Immutable Proof Component: ${instanceConfig.type}`
1885
- }));
1886
- const type = instanceConfig.type;
1566
+ * @returns The instance created and the factory for it.
1567
+ */
1568
+ async function initialiseImmutableProofComponent(engineCore, context, instanceConfig) {
1887
1569
  let component;
1888
1570
  let instanceType;
1889
- if (type === ImmutableProofComponentType.Service) {
1571
+ if (instanceConfig.type === ImmutableProofComponentType.Service) {
1890
1572
  immutableProofService.initSchema();
1891
1573
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
1892
1574
  component = new immutableProofService.ImmutableProofService({
@@ -1898,23 +1580,15 @@ async function initialiseImmutableProofComponent(engineCore, context, instanceCo
1898
1580
  });
1899
1581
  instanceType = "immutable-proof-service";
1900
1582
  }
1901
- else if (type === ImmutableProofComponentType.RestClient) {
1583
+ else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {
1902
1584
  component = new immutableProofRestClient.ImmutableProofClient(instanceConfig.options);
1903
1585
  instanceType = "immutable-proof-client";
1904
1586
  }
1905
- else {
1906
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1907
- type,
1908
- componentType: "immutableProofComponent"
1909
- });
1910
- }
1911
- const finalInstanceType = overrideInstanceType ?? instanceType;
1912
- context.componentInstances.push({
1913
- instanceType: finalInstanceType,
1914
- component
1915
- });
1916
- core.ComponentFactory.register(finalInstanceType, () => component);
1917
- return finalInstanceType;
1587
+ return {
1588
+ component,
1589
+ instanceType,
1590
+ factory: core.ComponentFactory
1591
+ };
1918
1592
  }
1919
1593
 
1920
1594
  // Copyright 2024 IOTA Stiftung.
@@ -1962,79 +1636,57 @@ const LoggingConnectorType = {
1962
1636
  * @param engineCore The engine core.
1963
1637
  * @param context The engine core context.
1964
1638
  * @param instanceConfig The instance config.
1965
- * @param overrideInstanceType The instance type to override the default.
1966
- * @returns The name of the instance created.
1967
- * @throws GeneralError if the connector type is unknown.
1968
- */
1969
- async function initialiseLoggingConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1970
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1971
- element: `Logging Connector: ${instanceConfig.type}`
1972
- }));
1973
- const type = instanceConfig.type;
1974
- let connector;
1639
+ * @returns The instance created and the factory for it.
1640
+ */
1641
+ async function initialiseLoggingConnector(engineCore, context, instanceConfig) {
1642
+ let component;
1975
1643
  let instanceType;
1976
- if (type === LoggingConnectorType.Console) {
1977
- connector = new loggingConnectorConsole.ConsoleLoggingConnector(instanceConfig.options);
1644
+ if (instanceConfig.type === LoggingConnectorType.Console) {
1645
+ component = new loggingConnectorConsole.ConsoleLoggingConnector(instanceConfig.options);
1978
1646
  instanceType = loggingConnectorConsole.ConsoleLoggingConnector.NAMESPACE;
1979
1647
  }
1980
- else if (type === LoggingConnectorType.EntityStorage) {
1648
+ else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {
1981
1649
  loggingConnectorEntityStorage.initSchema();
1982
1650
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry");
1983
- connector = new loggingConnectorEntityStorage.EntityStorageLoggingConnector(instanceConfig.options);
1651
+ component = new loggingConnectorEntityStorage.EntityStorageLoggingConnector(instanceConfig.options);
1984
1652
  instanceType = loggingConnectorEntityStorage.EntityStorageLoggingConnector.NAMESPACE;
1985
1653
  }
1986
- else if (type === LoggingConnectorType.Multi) {
1987
- connector = new loggingModels.MultiLoggingConnector(instanceConfig.options);
1654
+ else if (instanceConfig.type === LoggingConnectorType.Multi) {
1655
+ component = new loggingModels.MultiLoggingConnector(instanceConfig.options);
1988
1656
  instanceType = loggingModels.MultiLoggingConnector.NAMESPACE;
1989
1657
  }
1990
- else {
1991
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1992
- type,
1993
- connectorType: "loggingConnector"
1994
- });
1995
- }
1996
- const finalInstanceType = overrideInstanceType ?? instanceType;
1997
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1998
- loggingModels.LoggingConnectorFactory.register(finalInstanceType, () => connector);
1999
- return finalInstanceType;
1658
+ return {
1659
+ component,
1660
+ instanceType,
1661
+ factory: loggingModels.LoggingConnectorFactory
1662
+ };
2000
1663
  }
2001
1664
  /**
2002
1665
  * Initialise the logging component.
2003
1666
  * @param engineCore The engine core.
2004
1667
  * @param context The context for the engine.
2005
1668
  * @param instanceConfig The instance config.
2006
- * @param overrideInstanceType The instance type to override the default.
2007
- * @returns The name of the instance created.
2008
- * @throws GeneralError if the component type is unknown.
2009
- */
2010
- async function initialiseLoggingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2011
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2012
- element: `Logging Component: ${instanceConfig.type}`
2013
- }));
2014
- const type = instanceConfig.type;
1669
+ * @returns The instance created and the factory for it.
1670
+ */
1671
+ async function initialiseLoggingComponent(engineCore, context, instanceConfig) {
2015
1672
  let component;
2016
1673
  let instanceType;
2017
- if (type === LoggingComponentType.Service) {
1674
+ if (instanceConfig.type === LoggingComponentType.Service) {
2018
1675
  component = new loggingService.LoggingService({
2019
1676
  loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
2020
1677
  ...instanceConfig.options
2021
1678
  });
2022
1679
  instanceType = "logging-service";
2023
1680
  }
2024
- else if (type === LoggingComponentType.RestClient) {
1681
+ else if (instanceConfig.type === LoggingComponentType.RestClient) {
2025
1682
  component = new loggingRestClient.LoggingClient(instanceConfig.options);
2026
1683
  instanceType = "logging-client";
2027
1684
  }
2028
- else {
2029
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2030
- type,
2031
- componentType: "loggingComponent"
2032
- });
2033
- }
2034
- const finalInstanceType = overrideInstanceType ?? instanceType;
2035
- context.componentInstances.push({ instanceType: finalInstanceType, component });
2036
- core.ComponentFactory.register(finalInstanceType, () => component);
2037
- return finalInstanceType;
1685
+ return {
1686
+ component,
1687
+ instanceType,
1688
+ factory: core.ComponentFactory
1689
+ };
2038
1690
  }
2039
1691
 
2040
1692
  // Copyright 2024 IOTA Stiftung.
@@ -2121,61 +1773,44 @@ const MessagingSmsConnectorType = {
2121
1773
  * @param engineCore The engine core.
2122
1774
  * @param context The context for the engine.
2123
1775
  * @param instanceConfig The instance config.
2124
- * @param overrideInstanceType The instance type to override the default.
2125
- * @returns The name of the instance created.
2126
- * @throws GeneralError if the connector type is unknown.
2127
- */
2128
- async function initialiseMessagingEmailConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2129
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2130
- element: `Messaging Email Connector: ${instanceConfig.type}`
2131
- }));
2132
- const type = instanceConfig.type;
2133
- let connector;
1776
+ * @returns The instance created and the factory for it.
1777
+ */
1778
+ async function initialiseMessagingEmailConnector(engineCore, context, instanceConfig) {
1779
+ let component;
2134
1780
  let instanceType;
2135
- if (type === MessagingEmailConnectorType.EntityStorage) {
1781
+ if (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {
2136
1782
  messagingConnectorEntityStorage.initSchema({ email: true, sms: false, pushNotification: false });
2137
1783
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
2138
- connector = new messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector({
1784
+ component = new messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector({
2139
1785
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2140
1786
  ...instanceConfig.options
2141
1787
  });
2142
1788
  instanceType = messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector.NAMESPACE;
2143
1789
  }
2144
- else if (type === MessagingEmailConnectorType.Aws) {
2145
- connector = new messagingConnectorAws.AwsMessagingEmailConnector({
1790
+ else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {
1791
+ component = new messagingConnectorAws.AwsMessagingEmailConnector({
2146
1792
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2147
1793
  ...instanceConfig.options
2148
1794
  });
2149
1795
  instanceType = messagingConnectorAws.AwsMessagingEmailConnector.NAMESPACE;
2150
1796
  }
2151
- else {
2152
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2153
- type,
2154
- connectorType: "messagingEmailConnector"
2155
- });
2156
- }
2157
- const finalInstanceType = overrideInstanceType ?? instanceType;
2158
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2159
- messagingModels.MessagingEmailConnectorFactory.register(finalInstanceType, () => connector);
2160
- return finalInstanceType;
1797
+ return {
1798
+ component,
1799
+ instanceType,
1800
+ factory: messagingModels.MessagingEmailConnectorFactory
1801
+ };
2161
1802
  }
2162
1803
  /**
2163
1804
  * Initialise a messaging sms connector.
2164
1805
  * @param engineCore The engine core.
2165
1806
  * @param context The context for the engine.
2166
1807
  * @param instanceConfig The instance config.
2167
- * @param overrideInstanceType The instance type to override the default.
2168
- * @returns The name of the instance created.
2169
- * @throws GeneralError if the connector type is unknown.
2170
- */
2171
- async function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2172
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2173
- element: `Messaging SMS Connector: ${instanceConfig.type}`
2174
- }));
2175
- const type = instanceConfig.type;
1808
+ * @returns The instance created and the factory for it.
1809
+ */
1810
+ async function initialiseMessagingSmsConnector(engineCore, context, instanceConfig) {
2176
1811
  let connector;
2177
1812
  let instanceType;
2178
- if (type === MessagingSmsConnectorType.EntityStorage) {
1813
+ if (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {
2179
1814
  messagingConnectorEntityStorage.initSchema({ email: false, sms: true, pushNotification: false });
2180
1815
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
2181
1816
  connector = new messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector({
@@ -2184,85 +1819,63 @@ async function initialiseMessagingSmsConnector(engineCore, context, instanceConf
2184
1819
  });
2185
1820
  instanceType = messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector.NAMESPACE;
2186
1821
  }
2187
- else if (type === MessagingSmsConnectorType.Aws) {
1822
+ else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {
2188
1823
  connector = new messagingConnectorAws.AwsMessagingSmsConnector({
2189
1824
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2190
1825
  ...instanceConfig.options
2191
1826
  });
2192
1827
  instanceType = messagingConnectorAws.AwsMessagingSmsConnector.NAMESPACE;
2193
1828
  }
2194
- else {
2195
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2196
- type,
2197
- connectorType: "messagingSmsConnector"
2198
- });
2199
- }
2200
- const finalInstanceType = overrideInstanceType ?? instanceType;
2201
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2202
- messagingModels.MessagingSmsConnectorFactory.register(finalInstanceType, () => connector);
2203
- return finalInstanceType;
1829
+ return {
1830
+ instanceType,
1831
+ factory: messagingModels.MessagingSmsConnectorFactory,
1832
+ component: connector
1833
+ };
2204
1834
  }
2205
1835
  /**
2206
1836
  * Initialise a messaging push notification connector.
2207
1837
  * @param engineCore The engine core.
2208
1838
  * @param context The context for the engine.
2209
1839
  * @param instanceConfig The instance config.
2210
- * @param overrideInstanceType The instance type to override the default.
2211
- * @returns The name of the instance created.
2212
- * @throws GeneralError if the connector type is unknown.
2213
- */
2214
- async function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2215
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2216
- element: `Messaging Push Notification Connector: ${instanceConfig.type}`
2217
- }));
2218
- const type = instanceConfig.type;
2219
- let connector;
1840
+ * @returns The instance created and the factory for it.
1841
+ */
1842
+ async function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig) {
1843
+ let component;
2220
1844
  let instanceType;
2221
- if (type === MessagingPushNotificationConnectorType.EntityStorage) {
1845
+ if (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {
2222
1846
  messagingConnectorEntityStorage.initSchema({ email: false, sms: false, pushNotification: true });
2223
1847
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
2224
1848
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
2225
- connector = new messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector({
1849
+ component = new messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector({
2226
1850
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2227
1851
  ...instanceConfig.options
2228
1852
  });
2229
1853
  instanceType = messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector.NAMESPACE;
2230
1854
  }
2231
- else if (type === MessagingPushNotificationConnectorType.Aws) {
2232
- connector = new messagingConnectorAws.AwsMessagingPushNotificationConnector({
1855
+ else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {
1856
+ component = new messagingConnectorAws.AwsMessagingPushNotificationConnector({
2233
1857
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2234
1858
  ...instanceConfig.options
2235
1859
  });
2236
1860
  instanceType = messagingConnectorAws.AwsMessagingPushNotificationConnector.NAMESPACE;
2237
1861
  }
2238
- else {
2239
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2240
- type,
2241
- connectorType: "messagingPushNotificationConnector"
2242
- });
2243
- }
2244
- const finalInstanceType = overrideInstanceType ?? instanceType;
2245
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2246
- messagingModels.MessagingPushNotificationsConnectorFactory.register(finalInstanceType, () => connector);
2247
- return finalInstanceType;
1862
+ return {
1863
+ component,
1864
+ instanceType,
1865
+ factory: messagingModels.MessagingPushNotificationsConnectorFactory
1866
+ };
2248
1867
  }
2249
1868
  /**
2250
1869
  * Initialise the messaging component.
2251
1870
  * @param engineCore The engine core.
2252
1871
  * @param context The context for the engine.
2253
1872
  * @param instanceConfig The instance config.
2254
- * @param overrideInstanceType The instance type to override the default.
2255
- * @returns The name of the instance created.
2256
- * @throws GeneralError if the component type is unknown.
2257
- */
2258
- async function initialiseMessagingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2259
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2260
- element: `Messaging Component: ${instanceConfig.type}`
2261
- }));
2262
- const type = instanceConfig.type;
1873
+ * @returns The instance created and the factory for it.
1874
+ */
1875
+ async function initialiseMessagingComponent(engineCore, context, instanceConfig) {
2263
1876
  let component;
2264
1877
  let instanceType;
2265
- if (type === MessagingComponentType.Service) {
1878
+ if (instanceConfig.type === MessagingComponentType.Service) {
2266
1879
  component = new messagingService.MessagingService({
2267
1880
  messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
2268
1881
  messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
@@ -2272,34 +1885,23 @@ async function initialiseMessagingComponent(engineCore, context, instanceConfig,
2272
1885
  });
2273
1886
  instanceType = "messaging-service";
2274
1887
  }
2275
- else {
2276
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2277
- type,
2278
- componentType: "messagingComponent"
2279
- });
2280
- }
2281
- const finalInstanceType = overrideInstanceType ?? instanceType;
2282
- context.componentInstances.push({ instanceType: finalInstanceType, component });
2283
- core.ComponentFactory.register(finalInstanceType, () => component);
2284
- return finalInstanceType;
1888
+ return {
1889
+ component,
1890
+ instanceType,
1891
+ factory: core.ComponentFactory
1892
+ };
2285
1893
  }
2286
1894
  /**
2287
1895
  * Initialise the messaging admin component.
2288
1896
  * @param engineCore The engine core.
2289
1897
  * @param context The context for the engine.
2290
1898
  * @param instanceConfig The instance config.
2291
- * @param overrideInstanceType The instance type to override the default.
2292
- * @returns The name of the instance created.
2293
- * @throws GeneralError if the component type is unknown.
2294
- */
2295
- async function initialiseMessagingAdminComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2296
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2297
- element: `Messaging Admin Component: ${instanceConfig.type}`
2298
- }));
2299
- const type = instanceConfig.type;
1899
+ * @returns The instance created and the factory for it.
1900
+ */
1901
+ async function initialiseMessagingAdminComponent(engineCore, context, instanceConfig) {
2300
1902
  let component;
2301
1903
  let instanceType;
2302
- if (type === MessagingAdminComponentType.Service) {
1904
+ if (instanceConfig.type === MessagingAdminComponentType.Service) {
2303
1905
  messagingService.initSchema();
2304
1906
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
2305
1907
  component = new messagingService.MessagingAdminService({
@@ -2307,16 +1909,11 @@ async function initialiseMessagingAdminComponent(engineCore, context, instanceCo
2307
1909
  });
2308
1910
  instanceType = "messaging-admin-service";
2309
1911
  }
2310
- else {
2311
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2312
- type,
2313
- componentType: "messagingAdminComponent"
2314
- });
2315
- }
2316
- const finalInstanceType = overrideInstanceType ?? instanceType;
2317
- context.componentInstances.push({ instanceType: finalInstanceType, component });
2318
- core.ComponentFactory.register(finalInstanceType, () => component);
2319
- return finalInstanceType;
1912
+ return {
1913
+ component,
1914
+ instanceType,
1915
+ factory: core.ComponentFactory
1916
+ };
2320
1917
  }
2321
1918
 
2322
1919
  // Copyright 2024 IOTA Stiftung.
@@ -2360,26 +1957,20 @@ const NftConnectorType = {
2360
1957
  * @param engineCore The engine core.
2361
1958
  * @param context The context for the engine.
2362
1959
  * @param instanceConfig The instance config.
2363
- * @param overrideInstanceType The instance type to override the default.
2364
- * @returns The name of the instance created.
2365
- * @throws GeneralError if the connector type is unknown.
2366
- */
2367
- async function initialiseNftConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2368
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2369
- element: `NFT Connector: ${instanceConfig.type}`
2370
- }));
2371
- const type = instanceConfig.type;
2372
- let connector;
1960
+ * @returns The instance created and the factory for it.
1961
+ */
1962
+ async function initialiseNftConnector(engineCore, context, instanceConfig) {
1963
+ let component;
2373
1964
  let instanceType;
2374
- if (type === NftConnectorType.EntityStorage) {
1965
+ if (instanceConfig.type === NftConnectorType.EntityStorage) {
2375
1966
  nftConnectorEntityStorage.initSchema();
2376
1967
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.nftEntityStorageType, "Nft");
2377
- connector = new nftConnectorEntityStorage.EntityStorageNftConnector(instanceConfig.options);
1968
+ component = new nftConnectorEntityStorage.EntityStorageNftConnector(instanceConfig.options);
2378
1969
  instanceType = nftConnectorEntityStorage.EntityStorageNftConnector.NAMESPACE;
2379
1970
  }
2380
- else if (type === NftConnectorType.Iota) {
1971
+ else if (instanceConfig.type === NftConnectorType.Iota) {
2381
1972
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
2382
- connector = new nftConnectorIota.IotaNftConnector({
1973
+ component = new nftConnectorIota.IotaNftConnector({
2383
1974
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
2384
1975
  walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
2385
1976
  loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
@@ -2391,57 +1982,35 @@ async function initialiseNftConnector(engineCore, context, instanceConfig, overr
2391
1982
  });
2392
1983
  instanceType = nftConnectorIota.IotaNftConnector.NAMESPACE;
2393
1984
  }
2394
- else {
2395
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2396
- type,
2397
- connectorType: "nftConnector"
2398
- });
2399
- }
2400
- const finalInstanceType = overrideInstanceType ?? instanceType;
2401
- context.componentInstances.push({
2402
- instanceType: finalInstanceType,
2403
- component: connector
2404
- });
2405
- nftModels.NftConnectorFactory.register(finalInstanceType, () => connector);
2406
- return finalInstanceType;
1985
+ return {
1986
+ component,
1987
+ instanceType,
1988
+ factory: nftModels.NftConnectorFactory
1989
+ };
2407
1990
  }
2408
1991
  /**
2409
1992
  * Initialise the NFT component.
2410
1993
  * @param engineCore The engine core.
2411
1994
  * @param context The context for the engine.
2412
1995
  * @param instanceConfig The instance config.
2413
- * @param overrideInstanceType The instance type to override the default.
2414
- * @returns The name of the instance created.
2415
- * @throws GeneralError if the component type is unknown.
2416
- */
2417
- async function initialiseNftComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2418
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2419
- element: `Nft Storage Component: ${instanceConfig.type}`
2420
- }));
2421
- const type = instanceConfig.type;
1996
+ * @returns The instance created and the factory for it.
1997
+ */
1998
+ async function initialiseNftComponent(engineCore, context, instanceConfig) {
2422
1999
  let component;
2423
2000
  let instanceType;
2424
- if (type === NftComponentType.Service) {
2001
+ if (instanceConfig.type === NftComponentType.Service) {
2425
2002
  component = new nftService.NftService(instanceConfig.options);
2426
2003
  instanceType = "nft-service";
2427
2004
  }
2428
- else if (type === NftComponentType.RestClient) {
2005
+ else if (instanceConfig.type === NftComponentType.RestClient) {
2429
2006
  component = new nftRestClient.NftClient(instanceConfig.options);
2430
2007
  instanceType = "nft-client";
2431
2008
  }
2432
- else {
2433
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2434
- type,
2435
- componentType: "nftComponent"
2436
- });
2437
- }
2438
- const finalInstanceType = overrideInstanceType ?? instanceType;
2439
- context.componentInstances.push({
2440
- instanceType: finalInstanceType,
2441
- component
2442
- });
2443
- core.ComponentFactory.register(finalInstanceType, () => component);
2444
- return finalInstanceType;
2009
+ return {
2010
+ component,
2011
+ instanceType,
2012
+ factory: core.ComponentFactory
2013
+ };
2445
2014
  }
2446
2015
 
2447
2016
  // Copyright 2024 IOTA Stiftung.
@@ -2468,18 +2037,12 @@ const RightsManagementDapComponentType = {
2468
2037
  * @param engineCore The engine core.
2469
2038
  * @param context The context for the engine.
2470
2039
  * @param instanceConfig The instance config.
2471
- * @param overrideInstanceType The instance type to override the default.
2472
- * @returns The name of the instance created.
2473
- * @throws GeneralError if the component type is unknown.
2474
- */
2475
- async function initialiseRightsManagementDapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2476
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2477
- element: `Rights Management DAP Component: ${instanceConfig.type}`
2478
- }));
2479
- const type = instanceConfig.type;
2040
+ * @returns The instance created and the factory for it.
2041
+ */
2042
+ async function initialiseRightsManagementDapComponent(engineCore, context, instanceConfig) {
2480
2043
  let component;
2481
2044
  let instanceType;
2482
- if (type === RightsManagementDapComponentType.Service) {
2045
+ if (instanceConfig.type === RightsManagementDapComponentType.Service) {
2483
2046
  component = new rightsManagementDapService.DataAccessPointService({
2484
2047
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2485
2048
  policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
@@ -2490,7 +2053,7 @@ async function initialiseRightsManagementDapComponent(engineCore, context, insta
2490
2053
  });
2491
2054
  instanceType = "data-access-point-service";
2492
2055
  }
2493
- else if (type === RightsManagementDapComponentType.RestClient) {
2056
+ else if (instanceConfig.type === RightsManagementDapComponentType.RestClient) {
2494
2057
  component = new rightsManagementRestClient.DataAccessPointClient({
2495
2058
  ...instanceConfig.options,
2496
2059
  authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
@@ -2500,19 +2063,11 @@ async function initialiseRightsManagementDapComponent(engineCore, context, insta
2500
2063
  });
2501
2064
  instanceType = "data-access-point-client";
2502
2065
  }
2503
- else {
2504
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2505
- type,
2506
- componentType: "RightsManagementDapComponent"
2507
- });
2508
- }
2509
- const finalInstanceType = overrideInstanceType ?? instanceType;
2510
- context.componentInstances.push({
2511
- instanceType: finalInstanceType,
2512
- component
2513
- });
2514
- core.ComponentFactory.register(finalInstanceType, () => component);
2515
- return finalInstanceType;
2066
+ return {
2067
+ component,
2068
+ instanceType,
2069
+ factory: core.ComponentFactory
2070
+ };
2516
2071
  }
2517
2072
 
2518
2073
  // Copyright 2024 IOTA Stiftung.
@@ -2535,37 +2090,23 @@ const RightsManagementDarpComponentType = {
2535
2090
  * @param engineCore The engine core.
2536
2091
  * @param context The context for the engine.
2537
2092
  * @param instanceConfig The instance config.
2538
- * @param overrideInstanceType The instance type to override the default.
2539
- * @returns The name of the instance created.
2540
- * @throws GeneralError if the component type is unknown.
2541
- */
2542
- async function initialiseRightsManagementDarpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2543
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2544
- element: `Rights Management DARP Component: ${instanceConfig.type}`
2545
- }));
2546
- const type = instanceConfig.type;
2093
+ * @returns The instance created and the factory for it.
2094
+ */
2095
+ async function initialiseRightsManagementDarpComponent(engineCore, context, instanceConfig) {
2547
2096
  let component;
2548
2097
  let instanceType;
2549
- if (type === RightsManagementDarpComponentType.Service) {
2098
+ if (instanceConfig.type === RightsManagementDarpComponentType.Service) {
2550
2099
  component = new rightsManagementDapService.DataAccessRequestPointService({
2551
2100
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2552
2101
  ...instanceConfig.options
2553
2102
  });
2554
2103
  instanceType = "data-access-request-point-service";
2555
2104
  }
2556
- else {
2557
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2558
- type,
2559
- componentType: "RightsManagementDarpComponent"
2560
- });
2561
- }
2562
- const finalInstanceType = overrideInstanceType ?? instanceType;
2563
- context.componentInstances.push({
2564
- instanceType: finalInstanceType,
2565
- component
2566
- });
2567
- core.ComponentFactory.register(finalInstanceType, () => component);
2568
- return finalInstanceType;
2105
+ return {
2106
+ component,
2107
+ instanceType,
2108
+ factory: core.ComponentFactory
2109
+ };
2569
2110
  }
2570
2111
 
2571
2112
  // Copyright 2024 IOTA Stiftung.
@@ -2592,18 +2133,12 @@ const RightsManagementPapComponentType = {
2592
2133
  * @param engineCore The engine core.
2593
2134
  * @param context The context for the engine.
2594
2135
  * @param instanceConfig The instance config.
2595
- * @param overrideInstanceType The instance type to override the default.
2596
- * @returns The name of the instance created.
2597
- * @throws GeneralError if the component type is unknown.
2598
- */
2599
- async function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2600
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2601
- element: `Rights Management PAP Component: ${instanceConfig.type}`
2602
- }));
2603
- const type = instanceConfig.type;
2136
+ * @returns The instance created and the factory for it.
2137
+ */
2138
+ async function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig) {
2604
2139
  let component;
2605
2140
  let instanceType;
2606
- if (type === RightsManagementPapComponentType.Service) {
2141
+ if (instanceConfig.type === RightsManagementPapComponentType.Service) {
2607
2142
  rightsManagementPapService.initSchema();
2608
2143
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
2609
2144
  component = new rightsManagementPapService.PolicyAdministrationPointService({
@@ -2612,23 +2147,15 @@ async function initialiseRightsManagementPapComponent(engineCore, context, insta
2612
2147
  });
2613
2148
  instanceType = "policy-administration-point-service";
2614
2149
  }
2615
- else if (type === RightsManagementPapComponentType.RestClient) {
2150
+ else if (instanceConfig.type === RightsManagementPapComponentType.RestClient) {
2616
2151
  component = new rightsManagementRestClient.PolicyAdministrationPointClient(instanceConfig.options);
2617
2152
  instanceType = "policy-administration-point-client";
2618
2153
  }
2619
- else {
2620
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2621
- type,
2622
- componentType: "RightsManagementPapComponent"
2623
- });
2624
- }
2625
- const finalInstanceType = overrideInstanceType ?? instanceType;
2626
- context.componentInstances.push({
2627
- instanceType: finalInstanceType,
2628
- component
2629
- });
2630
- core.ComponentFactory.register(finalInstanceType, () => component);
2631
- return finalInstanceType;
2154
+ return {
2155
+ component,
2156
+ instanceType,
2157
+ factory: core.ComponentFactory
2158
+ };
2632
2159
  }
2633
2160
 
2634
2161
  // Copyright 2024 IOTA Stiftung.
@@ -2651,18 +2178,12 @@ const RightsManagementPdpComponentType = {
2651
2178
  * @param engineCore The engine core.
2652
2179
  * @param context The context for the engine.
2653
2180
  * @param instanceConfig The instance config.
2654
- * @param overrideInstanceType The instance type to override the default.
2655
- * @returns The name of the instance created.
2656
- * @throws GeneralError if the component type is unknown.
2657
- */
2658
- async function initialiseRightsManagementPdpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
2659
- engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2660
- element: `Rights Management PDP Component: ${instanceConfig.type}`
2661
- }));
2662
- const type = instanceConfig.type;
2181
+ * @returns The instance created and the factory for it.
2182
+ */
2183
+ async function initialiseRightsManagementPdpComponent(engineCore$1, context, instanceConfig) {
2663
2184
  let component;
2664
2185
  let instanceType;
2665
- if (type === RightsManagementPdpComponentType.Service) {
2186
+ if (instanceConfig.type === RightsManagementPdpComponentType.Service) {
2666
2187
  const arbiterModules = [];
2667
2188
  if (core.Is.arrayValue(instanceConfig.options?.arbiterModulesConfig)) {
2668
2189
  for (const moduleConfig of instanceConfig.options.arbiterModulesConfig) {
@@ -2685,19 +2206,11 @@ async function initialiseRightsManagementPdpComponent(engineCore$1, context, ins
2685
2206
  });
2686
2207
  instanceType = "policy-decision-point-service";
2687
2208
  }
2688
- else {
2689
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2690
- type,
2691
- componentType: "RightsManagementPdpComponent"
2692
- });
2693
- }
2694
- const finalInstanceType = overrideInstanceType ?? instanceType;
2695
- context.componentInstances.push({
2696
- instanceType: finalInstanceType,
2697
- component
2698
- });
2699
- core.ComponentFactory.register(finalInstanceType, () => component);
2700
- return finalInstanceType;
2209
+ return {
2210
+ component,
2211
+ instanceType,
2212
+ factory: core.ComponentFactory
2213
+ };
2701
2214
  }
2702
2215
 
2703
2216
  // Copyright 2024 IOTA Stiftung.
@@ -2724,18 +2237,12 @@ const RightsManagementPepComponentType = {
2724
2237
  * @param engineCore The engine core.
2725
2238
  * @param context The context for the engine.
2726
2239
  * @param instanceConfig The instance config.
2727
- * @param overrideInstanceType The instance type to override the default.
2728
- * @returns The name of the instance created.
2729
- * @throws GeneralError if the component type is unknown.
2730
- */
2731
- async function initialiseRightsManagementPepComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
2732
- engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2733
- element: `Rights Management PEP Component: ${instanceConfig.type}`
2734
- }));
2735
- const type = instanceConfig.type;
2240
+ * @returns The instance created and the factory for it.
2241
+ */
2242
+ async function initialiseRightsManagementPepComponent(engineCore$1, context, instanceConfig) {
2736
2243
  let component;
2737
2244
  let instanceType;
2738
- if (type === RightsManagementPepComponentType.Service) {
2245
+ if (instanceConfig.type === RightsManagementPepComponentType.Service) {
2739
2246
  const processorModules = [];
2740
2247
  if (core.Is.arrayValue(instanceConfig.options?.processorModulesConfig)) {
2741
2248
  for (const moduleConfig of instanceConfig.options.processorModulesConfig) {
@@ -2756,19 +2263,11 @@ async function initialiseRightsManagementPepComponent(engineCore$1, context, ins
2756
2263
  });
2757
2264
  instanceType = "policy-enforcement-point-service";
2758
2265
  }
2759
- else {
2760
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2761
- type,
2762
- componentType: "RightsManagementPepComponent"
2763
- });
2764
- }
2765
- const finalInstanceType = overrideInstanceType ?? instanceType;
2766
- context.componentInstances.push({
2767
- instanceType: finalInstanceType,
2768
- component
2769
- });
2770
- core.ComponentFactory.register(finalInstanceType, () => component);
2771
- return finalInstanceType;
2266
+ return {
2267
+ component,
2268
+ instanceType,
2269
+ factory: core.ComponentFactory
2270
+ };
2772
2271
  }
2773
2272
 
2774
2273
  // Copyright 2024 IOTA Stiftung.
@@ -2791,18 +2290,12 @@ const RightsManagementPipComponentType = {
2791
2290
  * @param engineCore The engine core.
2792
2291
  * @param context The context for the engine.
2793
2292
  * @param instanceConfig The instance config.
2794
- * @param overrideInstanceType The instance type to override the default.
2795
- * @returns The name of the instance created.
2796
- * @throws GeneralError if the component type is unknown.
2797
- */
2798
- async function initialiseRightsManagementPipComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
2799
- engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2800
- element: `Rights Management PIP Component: ${instanceConfig.type}`
2801
- }));
2802
- const type = instanceConfig.type;
2293
+ * @returns The instance created and the factory for it.
2294
+ */
2295
+ async function initialiseRightsManagementPipComponent(engineCore$1, context, instanceConfig) {
2803
2296
  let component;
2804
2297
  let instanceType;
2805
- if (type === RightsManagementPipComponentType.Service) {
2298
+ if (instanceConfig.type === RightsManagementPipComponentType.Service) {
2806
2299
  const informationSourceModules = [];
2807
2300
  if (core.Is.arrayValue(instanceConfig.options?.informationModulesConfig)) {
2808
2301
  for (const moduleConfig of instanceConfig.options.informationModulesConfig) {
@@ -2822,19 +2315,11 @@ async function initialiseRightsManagementPipComponent(engineCore$1, context, ins
2822
2315
  });
2823
2316
  instanceType = "policy-information-point-service";
2824
2317
  }
2825
- else {
2826
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2827
- type,
2828
- componentType: "RightsManagementPipComponent"
2829
- });
2830
- }
2831
- const finalInstanceType = overrideInstanceType ?? instanceType;
2832
- context.componentInstances.push({
2833
- instanceType: finalInstanceType,
2834
- component
2835
- });
2836
- core.ComponentFactory.register(finalInstanceType, () => component);
2837
- return finalInstanceType;
2318
+ return {
2319
+ component,
2320
+ instanceType,
2321
+ factory: core.ComponentFactory
2322
+ };
2838
2323
  }
2839
2324
 
2840
2325
  // Copyright 2024 IOTA Stiftung.
@@ -2857,18 +2342,12 @@ const RightsManagementPmpComponentType = {
2857
2342
  * @param engineCore The engine core.
2858
2343
  * @param context The context for the engine.
2859
2344
  * @param instanceConfig The instance config.
2860
- * @param overrideInstanceType The instance type to override the default.
2861
- * @returns The name of the instance created.
2862
- * @throws GeneralError if the component type is unknown.
2863
- */
2864
- async function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2865
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2866
- element: `Rights Management PMP Component: ${instanceConfig.type}`
2867
- }));
2868
- const type = instanceConfig.type;
2345
+ * @returns The instance created and the factory for it.
2346
+ */
2347
+ async function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig) {
2869
2348
  let component;
2870
2349
  let instanceType;
2871
- if (type === RightsManagementPmpComponentType.Service) {
2350
+ if (instanceConfig.type === RightsManagementPmpComponentType.Service) {
2872
2351
  component = new rightsManagementPmpService.PolicyManagementPointService({
2873
2352
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2874
2353
  policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
@@ -2876,19 +2355,11 @@ async function initialiseRightsManagementPmpComponent(engineCore, context, insta
2876
2355
  });
2877
2356
  instanceType = "policy-management-point-service";
2878
2357
  }
2879
- else {
2880
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2881
- type,
2882
- componentType: "RightsManagementPmpComponent"
2883
- });
2884
- }
2885
- const finalInstanceType = overrideInstanceType ?? instanceType;
2886
- context.componentInstances.push({
2887
- instanceType: finalInstanceType,
2888
- component
2889
- });
2890
- core.ComponentFactory.register(finalInstanceType, () => component);
2891
- return finalInstanceType;
2358
+ return {
2359
+ component,
2360
+ instanceType,
2361
+ factory: core.ComponentFactory
2362
+ };
2892
2363
  }
2893
2364
 
2894
2365
  // Copyright 2024 IOTA Stiftung.
@@ -2915,18 +2386,12 @@ const RightsManagementPnapComponentType = {
2915
2386
  * @param engineCore The engine core.
2916
2387
  * @param context The context for the engine.
2917
2388
  * @param instanceConfig The instance config.
2918
- * @param overrideInstanceType The instance type to override the default.
2919
- * @returns The name of the instance created.
2920
- * @throws GeneralError if the component type is unknown.
2921
- */
2922
- async function initialiseRightsManagementPnapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2923
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2924
- element: `Rights Management PNAP Component: ${instanceConfig.type}`
2925
- }));
2926
- const type = instanceConfig.type;
2389
+ * @returns The instance created and the factory for it.
2390
+ */
2391
+ async function initialiseRightsManagementPnapComponent(engineCore, context, instanceConfig) {
2927
2392
  let component;
2928
2393
  let instanceType;
2929
- if (type === RightsManagementPnapComponentType.Service) {
2394
+ if (instanceConfig.type === RightsManagementPnapComponentType.Service) {
2930
2395
  rightsManagementPnpService.initSchema();
2931
2396
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.policyNegotiationEntityStorageType, "PolicyNegotiation");
2932
2397
  component = new rightsManagementPnpService.PolicyNegotiationAdminPointService({
@@ -2937,23 +2402,15 @@ async function initialiseRightsManagementPnapComponent(engineCore, context, inst
2937
2402
  });
2938
2403
  instanceType = "policy-negotiation-admin-point-service";
2939
2404
  }
2940
- else if (type === RightsManagementPnapComponentType.RestClient) {
2405
+ else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {
2941
2406
  component = new rightsManagementRestClient.PolicyNegotiationAdminPointClient(instanceConfig.options);
2942
2407
  instanceType = "policy-negotiation-admin-point-client";
2943
2408
  }
2944
- else {
2945
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2946
- type,
2947
- componentType: "RightsManagementPnapComponent"
2948
- });
2949
- }
2950
- const finalInstanceType = overrideInstanceType ?? instanceType;
2951
- context.componentInstances.push({
2952
- instanceType: finalInstanceType,
2953
- component
2954
- });
2955
- core.ComponentFactory.register(finalInstanceType, () => component);
2956
- return finalInstanceType;
2409
+ return {
2410
+ component,
2411
+ instanceType,
2412
+ factory: core.ComponentFactory
2413
+ };
2957
2414
  }
2958
2415
 
2959
2416
  // Copyright 2024 IOTA Stiftung.
@@ -2980,18 +2437,12 @@ const RightsManagementPnpComponentType = {
2980
2437
  * @param engineCore The engine core.
2981
2438
  * @param context The context for the engine.
2982
2439
  * @param instanceConfig The instance config.
2983
- * @param overrideInstanceType The instance type to override the default.
2984
- * @returns The name of the instance created.
2985
- * @throws GeneralError if the component type is unknown.
2986
- */
2987
- async function initialiseRightsManagementPnpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
2988
- engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2989
- element: `Rights Management PNP Component: ${instanceConfig.type}`
2990
- }));
2991
- const type = instanceConfig.type;
2440
+ * @returns The instance created and the factory for it.
2441
+ */
2442
+ async function initialiseRightsManagementPnpComponent(engineCore$1, context, instanceConfig) {
2992
2443
  let component;
2993
2444
  let instanceType;
2994
- if (type === RightsManagementPnpComponentType.Service) {
2445
+ if (instanceConfig.type === RightsManagementPnpComponentType.Service) {
2995
2446
  const negotiatorModules = [];
2996
2447
  if (core.Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {
2997
2448
  for (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {
@@ -3024,7 +2475,7 @@ async function initialiseRightsManagementPnpComponent(engineCore$1, context, ins
3024
2475
  });
3025
2476
  instanceType = "policy-negotiation-point-service";
3026
2477
  }
3027
- else if (type === RightsManagementPnpComponentType.RestClient) {
2478
+ else if (instanceConfig.type === RightsManagementPnpComponentType.RestClient) {
3028
2479
  component = new rightsManagementRestClient.PolicyNegotiationPointClient({
3029
2480
  ...instanceConfig.options,
3030
2481
  authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
@@ -3034,19 +2485,11 @@ async function initialiseRightsManagementPnpComponent(engineCore$1, context, ins
3034
2485
  });
3035
2486
  instanceType = "policy-negotiation-point-client";
3036
2487
  }
3037
- else {
3038
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3039
- type,
3040
- componentType: "RightsManagementPnpComponent"
3041
- });
3042
- }
3043
- const finalInstanceType = overrideInstanceType ?? instanceType;
3044
- context.componentInstances.push({
3045
- instanceType: finalInstanceType,
3046
- component
3047
- });
3048
- core.ComponentFactory.register(finalInstanceType, () => component);
3049
- return finalInstanceType;
2488
+ return {
2489
+ component,
2490
+ instanceType,
2491
+ factory: core.ComponentFactory
2492
+ };
3050
2493
  }
3051
2494
 
3052
2495
  // Copyright 2024 IOTA Stiftung.
@@ -3069,18 +2512,12 @@ const RightsManagementPxpComponentType = {
3069
2512
  * @param engineCore The engine core.
3070
2513
  * @param context The context for the engine.
3071
2514
  * @param instanceConfig The instance config.
3072
- * @param overrideInstanceType The instance type to override the default.
3073
- * @returns The name of the instance created.
3074
- * @throws GeneralError if the component type is unknown.
3075
- */
3076
- async function initialiseRightsManagementPxpComponent(engineCore$1, context, instanceConfig, overrideInstanceType) {
3077
- engineCore$1.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3078
- element: `Rights Management PXP Component: ${instanceConfig.type}`
3079
- }));
3080
- const type = instanceConfig.type;
2515
+ * @returns The instance created and the factory for it.
2516
+ */
2517
+ async function initialiseRightsManagementPxpComponent(engineCore$1, context, instanceConfig) {
3081
2518
  let component;
3082
2519
  let instanceType;
3083
- if (type === RightsManagementPxpComponentType.Service) {
2520
+ if (instanceConfig.type === RightsManagementPxpComponentType.Service) {
3084
2521
  const modules = [];
3085
2522
  if (core.Is.arrayValue(instanceConfig.options?.actionModulesConfig)) {
3086
2523
  for (const moduleConfig of instanceConfig.options.actionModulesConfig) {
@@ -3100,19 +2537,11 @@ async function initialiseRightsManagementPxpComponent(engineCore$1, context, ins
3100
2537
  });
3101
2538
  instanceType = "policy-execution-point-service";
3102
2539
  }
3103
- else {
3104
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3105
- type,
3106
- componentType: "RightsManagementPxpComponent"
3107
- });
3108
- }
3109
- const finalInstanceType = overrideInstanceType ?? instanceType;
3110
- context.componentInstances.push({
3111
- instanceType: finalInstanceType,
3112
- component
3113
- });
3114
- core.ComponentFactory.register(finalInstanceType, () => component);
3115
- return finalInstanceType;
2540
+ return {
2541
+ component,
2542
+ instanceType,
2543
+ factory: core.ComponentFactory
2544
+ };
3116
2545
  }
3117
2546
 
3118
2547
  // Copyright 2024 IOTA Stiftung.
@@ -3139,18 +2568,12 @@ const SynchronisedStorageComponentType = {
3139
2568
  * @param engineCore The engine core.
3140
2569
  * @param context The context for the engine.
3141
2570
  * @param instanceConfig The instance config.
3142
- * @param overrideInstanceType The instance type to override the default.
3143
- * @returns The name of the instance created.
3144
- * @throws GeneralError if the component type is unknown.
3145
- */
3146
- async function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
3147
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3148
- element: `Synchronised Storage Component: ${instanceConfig.type}`
3149
- }));
3150
- const type = instanceConfig.type;
2571
+ * @returns The instance created and the factory for it.
2572
+ */
2573
+ async function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig) {
3151
2574
  let component;
3152
2575
  let instanceType;
3153
- if (type === SynchronisedStorageComponentType.Service) {
2576
+ if (instanceConfig.type === SynchronisedStorageComponentType.Service) {
3154
2577
  synchronisedStorageService.initSchema();
3155
2578
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
3156
2579
  component = new synchronisedStorageService.SynchronisedStorageService({
@@ -3168,7 +2591,7 @@ async function initialiseSynchronisedStorageComponent(engineCore, context, insta
3168
2591
  });
3169
2592
  instanceType = "synchronised-storage-service";
3170
2593
  }
3171
- else if (type === SynchronisedStorageComponentType.RestClient) {
2594
+ else if (instanceConfig.type === SynchronisedStorageComponentType.RestClient) {
3172
2595
  component = new synchronisedStorageRestClient.SynchronisedStorageClient({
3173
2596
  ...instanceConfig.options,
3174
2597
  authenticationGeneratorType: instanceConfig.options?.authenticationGeneratorType ??
@@ -3178,19 +2601,11 @@ async function initialiseSynchronisedStorageComponent(engineCore, context, insta
3178
2601
  });
3179
2602
  instanceType = "synchronised-storage-client";
3180
2603
  }
3181
- else {
3182
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3183
- type,
3184
- componentType: "SynchronisedStorageComponent"
3185
- });
3186
- }
3187
- const finalInstanceType = overrideInstanceType ?? instanceType;
3188
- context.componentInstances.push({
3189
- instanceType: finalInstanceType,
3190
- component
3191
- });
3192
- core.ComponentFactory.register(finalInstanceType, () => component);
3193
- return finalInstanceType;
2604
+ return {
2605
+ component,
2606
+ instanceType,
2607
+ factory: core.ComponentFactory
2608
+ };
3194
2609
  }
3195
2610
 
3196
2611
  // Copyright 2024 IOTA Stiftung.
@@ -3211,37 +2626,23 @@ const TaskSchedulerComponentType = {
3211
2626
  * @param engineCore The engine core.
3212
2627
  * @param context The context for the engine.
3213
2628
  * @param instanceConfig The instance config.
3214
- * @param overrideInstanceType The instance type to override the default.
3215
- * @returns The name of the instance created.
3216
- * @throws GeneralError if the connector type is unknown.
3217
- */
3218
- async function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, overrideInstanceType) {
3219
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3220
- element: `Task Scheduler: ${instanceConfig.type}`
3221
- }));
3222
- const type = instanceConfig.type;
2629
+ * @returns The instance created and the factory for it.
2630
+ */
2631
+ async function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig) {
3223
2632
  let component;
3224
2633
  let instanceType;
3225
- if (type === TaskSchedulerComponentType.Service) {
2634
+ if (instanceConfig.type === TaskSchedulerComponentType.Service) {
3226
2635
  component = new backgroundTaskScheduler.TaskSchedulerService({
3227
2636
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
3228
2637
  ...instanceConfig.options
3229
2638
  });
3230
2639
  instanceType = "task-scheduler-service";
3231
2640
  }
3232
- else {
3233
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3234
- type,
3235
- componentType: "taskSchedulerComponent"
3236
- });
3237
- }
3238
- const finalInstanceType = overrideInstanceType ?? instanceType;
3239
- context.componentInstances.push({
3240
- instanceType: finalInstanceType,
3241
- component
3242
- });
3243
- core.ComponentFactory.register(finalInstanceType, () => component);
3244
- return finalInstanceType;
2641
+ return {
2642
+ component,
2643
+ instanceType,
2644
+ factory: core.ComponentFactory
2645
+ };
3245
2646
  }
3246
2647
 
3247
2648
  // Copyright 2024 IOTA Stiftung.
@@ -3281,75 +2682,53 @@ const TelemetryConnectorType = {
3281
2682
  * @param engineCore The engine core.
3282
2683
  * @param context The context for the engine.
3283
2684
  * @param instanceConfig The instance config.
3284
- * @param overrideInstanceType The instance type to override the default.
3285
- * @returns The name of the instance created.
3286
- * @throws GeneralError if the connector type is unknown.
3287
- */
3288
- async function initialiseTelemetryConnector(engineCore, context, instanceConfig, overrideInstanceType) {
3289
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3290
- element: `Telemetry Connector: ${instanceConfig.type}`
3291
- }));
3292
- const type = instanceConfig.type;
3293
- let connector;
2685
+ * @returns The instance created and the factory for it.
2686
+ */
2687
+ async function initialiseTelemetryConnector(engineCore, context, instanceConfig) {
2688
+ let component;
3294
2689
  let instanceType;
3295
- if (type === TelemetryConnectorType.EntityStorage) {
2690
+ if (instanceConfig.type === TelemetryConnectorType.EntityStorage) {
3296
2691
  telemetryConnectorEntityStorage.initSchema();
3297
2692
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
3298
2693
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
3299
- connector = new telemetryConnectorEntityStorage.EntityStorageTelemetryConnector({
2694
+ component = new telemetryConnectorEntityStorage.EntityStorageTelemetryConnector({
3300
2695
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
3301
2696
  ...instanceConfig.options
3302
2697
  });
3303
2698
  instanceType = telemetryConnectorEntityStorage.EntityStorageTelemetryConnector.NAMESPACE;
3304
2699
  }
3305
- else {
3306
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3307
- type,
3308
- connectorType: "telemetryConnector"
3309
- });
3310
- }
3311
- const finalInstanceType = overrideInstanceType ?? instanceType;
3312
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
3313
- telemetryModels.TelemetryConnectorFactory.register(finalInstanceType, () => connector);
3314
- return finalInstanceType;
2700
+ return {
2701
+ instanceType,
2702
+ factory: telemetryModels.TelemetryConnectorFactory,
2703
+ component
2704
+ };
3315
2705
  }
3316
2706
  /**
3317
2707
  * Initialise the telemetry component.
3318
2708
  * @param engineCore The engine core.
3319
2709
  * @param context The context for the engine.
3320
2710
  * @param instanceConfig The instance config.
3321
- * @param overrideInstanceType The instance type to override the default.
3322
- * @returns The name of the instance created.
3323
- * @throws GeneralError if the component type is unknown.
3324
- */
3325
- async function initialiseTelemetryComponent(engineCore, context, instanceConfig, overrideInstanceType) {
3326
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3327
- element: `Telemetry Component: ${instanceConfig.type}`
3328
- }));
3329
- const type = instanceConfig.type;
2711
+ * @returns The instance created and the factory for it.
2712
+ */
2713
+ async function initialiseTelemetryComponent(engineCore, context, instanceConfig) {
3330
2714
  let component;
3331
2715
  let instanceType;
3332
- if (type === TelemetryComponentType.Service) {
2716
+ if (instanceConfig.type === TelemetryComponentType.Service) {
3333
2717
  component = new telemetryService.TelemetryService({
3334
2718
  telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
3335
2719
  ...instanceConfig.options
3336
2720
  });
3337
2721
  instanceType = "telemetry-service";
3338
2722
  }
3339
- else if (type === TelemetryComponentType.RestClient) {
2723
+ else if (instanceConfig.type === TelemetryComponentType.RestClient) {
3340
2724
  component = new telemetryRestClient.TelemetryClient(instanceConfig.options);
3341
2725
  instanceType = "telemetry-client";
3342
2726
  }
3343
- else {
3344
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3345
- type,
3346
- componentType: "telemetryComponent"
3347
- });
3348
- }
3349
- const finalInstanceType = overrideInstanceType ?? instanceType;
3350
- context.componentInstances.push({ instanceType: finalInstanceType, component });
3351
- core.ComponentFactory.register(finalInstanceType, () => component);
3352
- return finalInstanceType;
2727
+ return {
2728
+ component,
2729
+ instanceType,
2730
+ factory: core.ComponentFactory
2731
+ };
3353
2732
  }
3354
2733
 
3355
2734
  // Copyright 2024 IOTA Stiftung.
@@ -3369,45 +2748,32 @@ const VaultConnectorType = {
3369
2748
  Hashicorp: "hashicorp"
3370
2749
  };
3371
2750
 
3372
- // Copyright 2024 IOTA Stiftung.
3373
- // SPDX-License-Identifier: Apache-2.0.
3374
2751
  /**
3375
2752
  * Initialise the vault connector.
3376
2753
  * @param engineCore The engine core.
3377
2754
  * @param context The context for the engine.
3378
2755
  * @param instanceConfig The instance config.
3379
- * @param overrideInstanceType The instance type to override the default.
3380
- * @returns The name of the instance created.
3381
- * @throws GeneralError if the connector type is unknown.
3382
- */
3383
- async function initialiseVaultConnector(engineCore, context, instanceConfig, overrideInstanceType) {
3384
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3385
- element: `Vault Connector: ${instanceConfig.type}`
3386
- }));
3387
- const type = instanceConfig.type;
3388
- let connector;
2756
+ * @returns The instance created and the factory for it.
2757
+ */
2758
+ async function initialiseVaultConnector(engineCore, context, instanceConfig) {
2759
+ let component;
3389
2760
  let instanceType;
3390
- if (type === VaultConnectorType.EntityStorage) {
2761
+ if (instanceConfig.type === VaultConnectorType.EntityStorage) {
3391
2762
  vaultConnectorEntityStorage.initSchema();
3392
2763
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
3393
2764
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
3394
- connector = new vaultConnectorEntityStorage.EntityStorageVaultConnector(instanceConfig.options);
2765
+ component = new vaultConnectorEntityStorage.EntityStorageVaultConnector(instanceConfig.options);
3395
2766
  instanceType = vaultConnectorEntityStorage.EntityStorageVaultConnector.NAMESPACE;
3396
2767
  }
3397
- else if (type === VaultConnectorType.Hashicorp) {
3398
- connector = new vaultConnectorHashicorp.HashicorpVaultConnector(instanceConfig.options);
2768
+ else if (instanceConfig.type === VaultConnectorType.Hashicorp) {
2769
+ component = new vaultConnectorHashicorp.HashicorpVaultConnector(instanceConfig.options);
3399
2770
  instanceType = vaultConnectorHashicorp.HashicorpVaultConnector.NAMESPACE;
3400
2771
  }
3401
- else {
3402
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3403
- type,
3404
- connectorType: "vaultConnector"
3405
- });
3406
- }
3407
- const finalInstanceType = overrideInstanceType ?? instanceType;
3408
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
3409
- vaultModels.VaultConnectorFactory.register(finalInstanceType, () => connector);
3410
- return finalInstanceType;
2772
+ return {
2773
+ component,
2774
+ instanceType,
2775
+ factory: vaultModels.VaultConnectorFactory
2776
+ };
3411
2777
  }
3412
2778
 
3413
2779
  // Copyright 2024 IOTA Stiftung.
@@ -3451,20 +2817,14 @@ const VerifiableStorageConnectorType = {
3451
2817
  * @param engineCore The engine core.
3452
2818
  * @param context The context for the engine.
3453
2819
  * @param instanceConfig The instance config.
3454
- * @param overrideInstanceType The instance type to override the default.
3455
- * @returns The name of the instance created.
3456
- * @throws GeneralError if the connector type is unknown.
3457
- */
3458
- async function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
3459
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3460
- element: `Verifiable Storage Connector: ${instanceConfig.type}`
3461
- }));
3462
- const type = instanceConfig.type;
3463
- let connector;
2820
+ * @returns The instance created and the factory for it.
2821
+ */
2822
+ async function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig) {
2823
+ let component;
3464
2824
  let instanceType;
3465
- if (type === VerifiableStorageConnectorType.Iota) {
2825
+ if (instanceConfig.type === VerifiableStorageConnectorType.Iota) {
3466
2826
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
3467
- connector = new verifiableStorageConnectorIota.IotaVerifiableStorageConnector({
2827
+ component = new verifiableStorageConnectorIota.IotaVerifiableStorageConnector({
3468
2828
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
3469
2829
  loggingComponentType: engineCore.getRegisteredInstanceTypeOptional("loggingComponent"),
3470
2830
  ...instanceConfig.options,
@@ -3475,65 +2835,43 @@ async function initialiseVerifiableStorageConnector(engineCore, context, instanc
3475
2835
  });
3476
2836
  instanceType = verifiableStorageConnectorIota.IotaVerifiableStorageConnector.NAMESPACE;
3477
2837
  }
3478
- else if (type === VerifiableStorageConnectorType.EntityStorage) {
2838
+ else if (instanceConfig.type === VerifiableStorageConnectorType.EntityStorage) {
3479
2839
  verifiableStorageConnectorEntityStorage.initSchema();
3480
2840
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
3481
- connector = new verifiableStorageConnectorEntityStorage.EntityStorageVerifiableStorageConnector(instanceConfig.options);
2841
+ component = new verifiableStorageConnectorEntityStorage.EntityStorageVerifiableStorageConnector(instanceConfig.options);
3482
2842
  instanceType = verifiableStorageConnectorEntityStorage.EntityStorageVerifiableStorageConnector.NAMESPACE;
3483
2843
  }
3484
- else {
3485
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3486
- type,
3487
- connectorType: "verifiableStorageConnector"
3488
- });
3489
- }
3490
- const finalInstanceType = overrideInstanceType ?? instanceType;
3491
- context.componentInstances.push({
3492
- instanceType: finalInstanceType,
3493
- component: connector
3494
- });
3495
- verifiableStorageModels.VerifiableStorageConnectorFactory.register(finalInstanceType, () => connector);
3496
- return finalInstanceType;
2844
+ return {
2845
+ component,
2846
+ instanceType,
2847
+ factory: verifiableStorageModels.VerifiableStorageConnectorFactory
2848
+ };
3497
2849
  }
3498
2850
  /**
3499
2851
  * Initialise the verifiable storage component.
3500
2852
  * @param engineCore The engine core.
3501
2853
  * @param context The context for the engine.
3502
2854
  * @param instanceConfig The instance config.
3503
- * @param overrideInstanceType The instance type to override the default.
3504
- * @returns The name of the instance created.
3505
- * @throws GeneralError if the component type is unknown.
3506
- */
3507
- async function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
3508
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3509
- element: `Verifiable Storage Component: ${instanceConfig.type}`
3510
- }));
3511
- const type = instanceConfig.type;
2855
+ * @returns The instance created and the factory for it.
2856
+ */
2857
+ async function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig) {
3512
2858
  let component;
3513
2859
  let instanceType;
3514
- if (type === VerifiableStorageComponentType.Service) {
2860
+ if (instanceConfig.type === VerifiableStorageComponentType.Service) {
3515
2861
  component = new verifiableStorageService.VerifiableStorageService({
3516
2862
  ...instanceConfig.options
3517
2863
  });
3518
2864
  instanceType = "verifiable-storage-service";
3519
2865
  }
3520
- else if (type === VerifiableStorageComponentType.RestClient) {
2866
+ else if (instanceConfig.type === VerifiableStorageComponentType.RestClient) {
3521
2867
  component = new verifiableStorageRestClient.VerifiableStorageClient(instanceConfig.options);
3522
2868
  instanceType = "verifiable-storage-client";
3523
2869
  }
3524
- else {
3525
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3526
- type,
3527
- componentType: "verifiableStorageComponent"
3528
- });
3529
- }
3530
- const finalInstanceType = overrideInstanceType ?? instanceType;
3531
- context.componentInstances.push({
3532
- instanceType: finalInstanceType,
3533
- component
3534
- });
3535
- core.ComponentFactory.register(finalInstanceType, () => component);
3536
- return finalInstanceType;
2870
+ return {
2871
+ component,
2872
+ instanceType,
2873
+ factory: core.ComponentFactory
2874
+ };
3537
2875
  }
3538
2876
 
3539
2877
  // Copyright 2024 IOTA Stiftung.
@@ -3553,27 +2891,19 @@ const WalletConnectorType = {
3553
2891
  Iota: "iota"
3554
2892
  };
3555
2893
 
3556
- // Copyright 2024 IOTA Stiftung.
3557
- // SPDX-License-Identifier: Apache-2.0.
3558
2894
  /**
3559
2895
  * Initialise a wallet connector.
3560
2896
  * @param engineCore The engine core.
3561
2897
  * @param context The context for the node.
3562
2898
  * @param instanceConfig The instance config.
3563
- * @param overrideInstanceType The instance type to override the default.
3564
- * @returns The name of the instance created.
3565
- * @throws GeneralError if the connector type is unknown.
3566
- */
3567
- async function initialiseWalletConnector(engineCore, context, instanceConfig, overrideInstanceType) {
3568
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3569
- element: `Wallet Connector: ${instanceConfig.type}`
3570
- }));
3571
- const type = instanceConfig.type;
3572
- let connector;
2899
+ * @returns The instance created and the factory for it.
2900
+ */
2901
+ async function initialiseWalletConnector(engineCore, context, instanceConfig) {
2902
+ let component;
3573
2903
  let instanceType;
3574
- if (type === WalletConnectorType.Iota) {
2904
+ if (instanceConfig.type === WalletConnectorType.Iota) {
3575
2905
  const dltConfig = EngineTypeHelper.getConfigOfType(engineCore.getConfig(), "dltConfig", DltConfigType.Iota);
3576
- connector = new walletConnectorIota.IotaWalletConnector({
2906
+ component = new walletConnectorIota.IotaWalletConnector({
3577
2907
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
3578
2908
  faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
3579
2909
  ...instanceConfig.options,
@@ -3584,51 +2914,21 @@ async function initialiseWalletConnector(engineCore, context, instanceConfig, ov
3584
2914
  });
3585
2915
  instanceType = walletConnectorIota.IotaWalletConnector.NAMESPACE;
3586
2916
  }
3587
- else if (type === WalletConnectorType.EntityStorage) {
3588
- connector = new walletConnectorEntityStorage.EntityStorageWalletConnector({
2917
+ else if (instanceConfig.type === WalletConnectorType.EntityStorage) {
2918
+ walletConnectorEntityStorage.initSchema();
2919
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
2920
+ component = new walletConnectorEntityStorage.EntityStorageWalletConnector({
3589
2921
  vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
3590
2922
  faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
3591
2923
  ...instanceConfig.options
3592
2924
  });
3593
2925
  instanceType = walletConnectorEntityStorage.EntityStorageWalletConnector.NAMESPACE;
3594
2926
  }
3595
- else {
3596
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3597
- type,
3598
- connectorType: "walletConnector"
3599
- });
3600
- }
3601
- const finalInstanceType = overrideInstanceType ?? instanceType;
3602
- context.componentInstances.push({
3603
- instanceType: finalInstanceType,
3604
- component: connector
3605
- });
3606
- walletModels.WalletConnectorFactory.register(finalInstanceType, () => connector);
3607
- return finalInstanceType;
3608
- }
3609
- /**
3610
- * Initialise the wallet storage.
3611
- * @param engineCore The engine core.
3612
- * @param context The context for the engine.
3613
- * @param instanceConfig The instance config.
3614
- * @param overrideInstanceType The instance type to override the default.
3615
- * @returns Nothing.
3616
- * @throws GeneralError if the connector type is unknown.
3617
- */
3618
- async function initialiseWalletStorage(engineCore, context, instanceConfig, overrideInstanceType) {
3619
- const type = instanceConfig.type;
3620
- if (type === WalletConnectorType.Iota) ;
3621
- else if (type === WalletConnectorType.EntityStorage) {
3622
- walletConnectorEntityStorage.initSchema();
3623
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
3624
- }
3625
- else {
3626
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3627
- type,
3628
- connectorType: "walletConnector"
3629
- });
3630
- }
3631
- return undefined;
2927
+ return {
2928
+ component,
2929
+ instanceType,
2930
+ factory: walletModels.WalletConnectorFactory
2931
+ };
3632
2932
  }
3633
2933
 
3634
2934
  exports.AttestationComponentType = AttestationComponentType;
@@ -3739,4 +3039,3 @@ exports.initialiseVaultConnector = initialiseVaultConnector;
3739
3039
  exports.initialiseVerifiableStorageComponent = initialiseVerifiableStorageComponent;
3740
3040
  exports.initialiseVerifiableStorageConnector = initialiseVerifiableStorageConnector;
3741
3041
  exports.initialiseWalletConnector = initialiseWalletConnector;
3742
- exports.initialiseWalletStorage = initialiseWalletStorage;