@twin.org/node-core 0.9.2-next.1 → 0.9.2-next.11

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 (61) hide show
  1. package/dist/es/builders/engineEnvBuilder.js +198 -111
  2. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  3. package/dist/es/builders/engineServerEnvBuilder.js +23 -26
  4. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
  5. package/dist/es/builders/extensionsBuilder.js +5 -4
  6. package/dist/es/builders/extensionsBuilder.js.map +1 -1
  7. package/dist/es/builders/helper/envHelpers.js +174 -0
  8. package/dist/es/builders/helper/envHelpers.js.map +1 -0
  9. package/dist/es/cli.js +4 -3
  10. package/dist/es/cli.js.map +1 -1
  11. package/dist/es/commands/{bootstrapLegacy.js → bootstrapDev.js} +30 -29
  12. package/dist/es/commands/bootstrapDev.js.map +1 -0
  13. package/dist/es/commands/identityCreate.js +4 -26
  14. package/dist/es/commands/identityCreate.js.map +1 -1
  15. package/dist/es/commands/identityImports.js +2 -1
  16. package/dist/es/commands/identityImports.js.map +1 -1
  17. package/dist/es/commands/userCreate.js +8 -3
  18. package/dist/es/commands/userCreate.js.map +1 -1
  19. package/dist/es/commands/userUpdate.js +5 -2
  20. package/dist/es/commands/userUpdate.js.map +1 -1
  21. package/dist/es/index.js +1 -1
  22. package/dist/es/index.js.map +1 -1
  23. package/dist/es/models/{IBootstrapLegacyEnvironmentVariables.js → IBootstrapDevEnvironmentVariables.js} +1 -1
  24. package/dist/es/models/IBootstrapDevEnvironmentVariables.js.map +1 -0
  25. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  26. package/dist/es/models/IEnvironmentVariables.js.map +1 -1
  27. package/dist/es/models/{bootstrapLegacyEnvironmentVariableKeys.js → bootstrapDevEnvironmentVariableKeys.js} +6 -6
  28. package/dist/es/models/bootstrapDevEnvironmentVariableKeys.js.map +1 -0
  29. package/dist/es/models/engineEnvironmentVariableKeys.js +50 -4
  30. package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
  31. package/dist/es/models/engineServerEnvironmentVariableKeys.js +3 -3
  32. package/dist/es/models/engineServerEnvironmentVariableKeys.js.map +1 -1
  33. package/dist/es/models/nodeEnvironmentVariableKeys.js +1 -1
  34. package/dist/es/models/nodeEnvironmentVariableKeys.js.map +1 -1
  35. package/dist/es/node.js +6 -10
  36. package/dist/es/node.js.map +1 -1
  37. package/dist/es/start.js +3 -2
  38. package/dist/es/start.js.map +1 -1
  39. package/dist/types/builders/helper/envHelpers.d.ts +82 -0
  40. package/dist/types/commands/{bootstrapLegacy.d.ts → bootstrapDev.d.ts} +3 -3
  41. package/dist/types/index.d.ts +1 -1
  42. package/dist/types/models/{IBootstrapLegacyEnvironmentVariables.d.ts → IBootstrapDevEnvironmentVariables.d.ts} +2 -2
  43. package/dist/types/models/IEngineEnvironmentVariables.d.ts +202 -13
  44. package/dist/types/models/IEnvironmentVariables.d.ts +2 -2
  45. package/dist/types/models/bootstrapDevEnvironmentVariableKeys.d.ts +4 -0
  46. package/dist/types/node.d.ts +1 -1
  47. package/docs/changelog.md +72 -0
  48. package/docs/reference/functions/buildConfiguration.md +2 -2
  49. package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
  50. package/docs/reference/functions/run.md +1 -1
  51. package/docs/reference/functions/start.md +1 -1
  52. package/docs/reference/index.md +1 -1
  53. package/docs/reference/interfaces/{IBootstrapLegacyEnvironmentVariables.md → IBootstrapDevEnvironmentVariables.md} +2 -2
  54. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +429 -20
  55. package/docs/reference/type-aliases/IEnvironmentVariables.md +1 -1
  56. package/locales/en.json +6 -5
  57. package/package.json +11 -4
  58. package/dist/es/commands/bootstrapLegacy.js.map +0 -1
  59. package/dist/es/models/IBootstrapLegacyEnvironmentVariables.js.map +0 -1
  60. package/dist/es/models/bootstrapLegacyEnvironmentVariableKeys.js.map +0 -1
  61. package/dist/types/models/bootstrapLegacyEnvironmentVariableKeys.d.ts +0 -4
@@ -1,12 +1,14 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
3
  import path from "node:path";
4
- import { Coerce, Is, Mutex } from "@twin.org/core";
5
- import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
4
+ import { Is, Mutex } from "@twin.org/core";
5
+ import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TracingComponentType, TracingConnectorType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
6
6
  import { OpenTelemetryExporterTypes } from "@twin.org/logging-connector-opentelemetry";
7
7
  import { OpenTelemetryReaderTypes } from "@twin.org/telemetry-connector-opentelemetry";
8
+ import { OpenTelemetryProcessorTypes } from "@twin.org/tracing-connector-opentelemetry";
8
9
  import { CONTEXT_ID_HANDLER_FEATURE_DID, CONTEXT_ID_HANDLER_FEATURE_TENANT } from "../defaults.js";
9
10
  import { isAuthEntityStorageRequired } from "./engineServerEnvBuilder.js";
11
+ import { commaSeparatedListToArray, envBoolean, envCount, envDateTime, envInteger, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
10
12
  /**
11
13
  * Build the engine core configuration from environment variables.
12
14
  * @param envVars The environment variables.
@@ -19,12 +21,12 @@ export async function buildEngineConfiguration(envVars) {
19
21
  envVars.stateFilename = path.join(envVars.storageFileRoot, envVars.stateFilename);
20
22
  }
21
23
  const coreConfig = {
22
- debug: Coerce.boolean(envVars.debug) ?? false,
23
- silent: Coerce.boolean(envVars.silent) ?? false,
24
+ debug: envBoolean(envVars, "debug", false),
25
+ silent: envBoolean(envVars, "silent", false),
24
26
  silentLoggers: commaSeparatedListToArray(envVars.loggingSilentComponents),
25
27
  types: {}
26
28
  };
27
- const mutexTimeoutMs = Coerce.integer(envVars.mutexTimeoutMsDefault);
29
+ const mutexTimeoutMs = envMs(envVars, "mutexTimeoutDefault");
28
30
  if (!Is.empty(mutexTimeoutMs)) {
29
31
  Mutex.setDefaultTimeoutMs(mutexTimeoutMs);
30
32
  }
@@ -42,6 +44,7 @@ export async function buildEngineConfiguration(envVars) {
42
44
  await configureEventBus(coreConfig, envVars);
43
45
  await configureTelemetry(coreConfig, envVars);
44
46
  await configureMetricsCollector(coreConfig, envVars);
47
+ await configureTracing(coreConfig, envVars);
45
48
  await configureMessaging(coreConfig, envVars);
46
49
  await configureAutomation(coreConfig, envVars);
47
50
  await configureHealth(coreConfig, envVars);
@@ -79,7 +82,7 @@ async function configureEntityStorage(coreConfig, envVars) {
79
82
  type: EntityStorageConnectorType.Memory,
80
83
  options: {
81
84
  config: {
82
- mutexTimeoutMs: Coerce.integer(envVars.entityStorageMemoryMutexTimeout)
85
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
83
86
  }
84
87
  }
85
88
  });
@@ -90,7 +93,7 @@ async function configureEntityStorage(coreConfig, envVars) {
90
93
  options: {
91
94
  config: {
92
95
  directory: envVars.storageFileRoot ?? "",
93
- mutexTimeoutMs: Coerce.integer(envVars.entityStorageFileMutexTimeout)
96
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
94
97
  },
95
98
  folderPrefix: envVars.entityStorageTablePrefix
96
99
  }
@@ -106,7 +109,8 @@ async function configureEntityStorage(coreConfig, envVars) {
106
109
  accessKeyId: envVars.awsDynamodbAccessKeyId,
107
110
  secretAccessKey: envVars.awsDynamodbSecretAccessKey,
108
111
  endpoint: envVars.awsDynamodbEndpoint,
109
- connectionTimeoutMs: Coerce.integer(envVars.awsDynamodbConnectionTimeout)
112
+ connectionTimeoutMs: envMs(envVars, "awsDynamodbConnectionTimeout"),
113
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
110
114
  },
111
115
  tablePrefix: envVars.entityStorageTablePrefix
112
116
  }
@@ -120,7 +124,8 @@ async function configureEntityStorage(coreConfig, envVars) {
120
124
  endpoint: envVars.azureCosmosdbEndpoint ?? "",
121
125
  key: envVars.azureCosmosdbKey ?? "",
122
126
  databaseId: envVars.azureCosmosdbDatabaseId ?? "",
123
- containerId: envVars.azureCosmosdbContainerId ?? ""
127
+ containerId: envVars.azureCosmosdbContainerId ?? "",
128
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
124
129
  },
125
130
  tablePrefix: envVars.entityStorageTablePrefix
126
131
  }
@@ -135,7 +140,8 @@ async function configureEntityStorage(coreConfig, envVars) {
135
140
  credentials: envVars.gcpFirestoreCredentials ?? "",
136
141
  databaseId: envVars.gcpFirestoreDatabaseId ?? "",
137
142
  collectionName: envVars.gcpFirestoreCollectionName ?? "",
138
- endpoint: envVars.gcpFirestoreEndpoint ?? ""
143
+ endpoint: envVars.gcpFirestoreEndpoint ?? "",
144
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
139
145
  },
140
146
  tablePrefix: envVars.entityStorageTablePrefix
141
147
  }
@@ -149,7 +155,12 @@ async function configureEntityStorage(coreConfig, envVars) {
149
155
  hosts: commaSeparatedListToArray(envVars.scylladbHosts),
150
156
  localDataCenter: envVars.scylladbLocalDataCenter ?? "",
151
157
  keyspace: envVars.scylladbKeyspace ?? "",
152
- port: Coerce.integer(envVars.scylladbPort)
158
+ port: envInteger(envVars, "scylladbPort"),
159
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
160
+ pool: {
161
+ coreConnectionsPerHost: envCount(envVars, "scylladbPoolCoreConnectionsPerHost"),
162
+ maxRequestsPerConnection: envCount(envVars, "scylladbPoolMaxRequestsPerConnection")
163
+ }
153
164
  },
154
165
  tablePrefix: envVars.entityStorageTablePrefix
155
166
  }
@@ -161,10 +172,19 @@ async function configureEntityStorage(coreConfig, envVars) {
161
172
  options: {
162
173
  config: {
163
174
  host: envVars.mySqlHost ?? "",
164
- port: Coerce.integer(envVars.mySqlPort),
175
+ port: envInteger(envVars, "mySqlPort"),
165
176
  user: envVars.mySqlUser ?? "",
166
177
  password: envVars.mySqlPassword ?? "",
167
- database: envVars.mySqlDatabase ?? ""
178
+ database: envVars.mySqlDatabase ?? "",
179
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
180
+ pool: {
181
+ connectionLimit: envCount(envVars, "mySqlPoolConnectionLimit"),
182
+ maxIdle: envCount(envVars, "mySqlPoolMaxIdle"),
183
+ idleTimeout: envMs(envVars, "mySqlPoolIdleTimeout"),
184
+ enableKeepAlive: envBoolean(envVars, "mySqlPoolEnableKeepAlive"),
185
+ waitForConnections: envBoolean(envVars, "mySqlPoolWaitForConnections"),
186
+ queueLimit: envCount(envVars, "mySqlPoolQueueLimit")
187
+ }
168
188
  },
169
189
  tablePrefix: envVars.entityStorageTablePrefix
170
190
  }
@@ -176,10 +196,17 @@ async function configureEntityStorage(coreConfig, envVars) {
176
196
  options: {
177
197
  config: {
178
198
  host: envVars.mongoDbHost ?? "",
179
- port: Coerce.integer(envVars.mongoDbPort),
199
+ port: envInteger(envVars, "mongoDbPort"),
180
200
  user: envVars.mongoDbUser ?? "",
181
201
  password: envVars.mongoDbPassword ?? "",
182
- database: envVars.mongoDbDatabase ?? ""
202
+ database: envVars.mongoDbDatabase ?? "",
203
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
204
+ pool: {
205
+ maxPoolSize: envCount(envVars, "mongoDbPoolMaxPoolSize"),
206
+ minPoolSize: envCount(envVars, "mongoDbPoolMinPoolSize"),
207
+ maxIdleTimeMs: envMs(envVars, "mongoDbPoolMaxIdleTime"),
208
+ waitQueueTimeoutMs: envMs(envVars, "mongoDbPoolWaitQueueTimeout")
209
+ }
183
210
  },
184
211
  tablePrefix: envVars.entityStorageTablePrefix
185
212
  }
@@ -191,10 +218,17 @@ async function configureEntityStorage(coreConfig, envVars) {
191
218
  options: {
192
219
  config: {
193
220
  host: envVars.postgreSqlHost ?? "",
194
- port: Coerce.integer(envVars.postgreSqlPort),
221
+ port: envInteger(envVars, "postgreSqlPort"),
195
222
  user: envVars.postgreSqlUser ?? "",
196
223
  password: envVars.postgreSqlPassword ?? "",
197
- database: envVars.postgreSqlDatabase ?? ""
224
+ database: envVars.postgreSqlDatabase ?? "",
225
+ mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
226
+ pool: {
227
+ max: envCount(envVars, "postgreSqlPoolMax"),
228
+ idleTimeout: envSeconds(envVars, "postgreSqlPoolIdleTimeout"),
229
+ connectTimeout: envSeconds(envVars, "postgreSqlPoolConnectTimeout"),
230
+ maxLifetime: envSeconds(envVars, "postgreSqlPoolMaxLifetime")
231
+ }
198
232
  },
199
233
  tablePrefix: envVars.entityStorageTablePrefix
200
234
  }
@@ -342,19 +376,19 @@ async function configureLogging(coreConfig, envVars) {
342
376
  type: LoggingConnectorType.EntityStorage,
343
377
  options: {
344
378
  config: {
345
- batchSize: Coerce.integer(envVars.loggingBatchSize),
346
- batchIntervalMs: (Coerce.integer(envVars.loggingBatchFlushInterval) ?? 5) * 1000,
347
- retainForMs: (Coerce.integer(envVars.loggingRetainFor) ?? 2880) * 60_000,
348
- maxEntries: Coerce.integer(envVars.loggingMaxEntries),
349
- retentionIntervalMs: (Coerce.integer(envVars.loggingRetentionInterval) ?? 5) * 60_000,
350
- retentionBatchSize: Coerce.integer(envVars.loggingRetentionBatchSize),
351
- mutexTimeoutMs: Coerce.integer(envVars.loggingMutexTimeout)
379
+ batchSize: envCount(envVars, "loggingBatchSize"),
380
+ batchIntervalMs: envSecToMs(envVars, "loggingBatchFlushInterval"),
381
+ retainForMs: envMinToMs(envVars, "loggingRetainFor"),
382
+ maxEntries: envCount(envVars, "loggingMaxEntries"),
383
+ retentionIntervalMs: envMinToMs(envVars, "loggingRetentionInterval"),
384
+ retentionBatchSize: envCount(envVars, "loggingRetentionBatchSize"),
385
+ mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
352
386
  }
353
387
  }
354
388
  });
355
389
  additionalConnectorCount++;
356
390
  }
357
- else if (loggingConnector === LoggingConnectorType.Otel) {
391
+ else if (loggingConnector === LoggingConnectorType.OpenTelemetry) {
358
392
  const otelLoggingConfig = {
359
393
  loggerName: envVars.openTelemetryLoggingLoggerName,
360
394
  loggerVersion: envVars.openTelemetryLoggingLoggerVersion
@@ -370,7 +404,7 @@ async function configureLogging(coreConfig, envVars) {
370
404
  };
371
405
  }
372
406
  coreConfig.types.loggingConnector.push({
373
- type: LoggingConnectorType.Otel,
407
+ type: LoggingConnectorType.OpenTelemetry,
374
408
  options: {
375
409
  config: otelLoggingConfig
376
410
  }
@@ -384,9 +418,9 @@ async function configureLogging(coreConfig, envVars) {
384
418
  config: {
385
419
  directory: envVars.loggingFileDirectory ?? envVars.storageFileRoot ?? "",
386
420
  filename: envVars.loggingFileFilename,
387
- maxFileSizeBytes: Coerce.integer(envVars.loggingFileMaxFileSizeBytes),
388
- maxRetainedFiles: Coerce.integer(envVars.loggingFileMaxRetainedFiles),
389
- mutexTimeoutMs: Coerce.integer(envVars.loggingMutexTimeout)
421
+ maxFileSizeBytes: envCount(envVars, "loggingFileMaxFileSizeBytes"),
422
+ maxRetainedFiles: envCount(envVars, "loggingFileMaxRetainedFiles"),
423
+ mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
390
424
  }
391
425
  }
392
426
  });
@@ -489,16 +523,21 @@ async function configureTelemetry(coreConfig, envVars) {
489
523
  coreConfig.types.telemetryConnector ??= [];
490
524
  if (envVars.telemetryConnector === TelemetryConnectorType.EntityStorage) {
491
525
  coreConfig.types.telemetryConnector.push({
492
- type: TelemetryConnectorType.EntityStorage
526
+ type: TelemetryConnectorType.EntityStorage,
527
+ options: {
528
+ config: {
529
+ mutexTimeoutMs: envMs(envVars, "telemetryMutexTimeout")
530
+ }
531
+ }
493
532
  });
494
533
  }
495
534
  else if (envVars.telemetryConnector === TelemetryConnectorType.OpenTelemetry) {
496
535
  let readers;
497
- if (envVars.openTelemetryReader === "prometheus") {
536
+ if (envVars.openTelemetryReader === OpenTelemetryReaderTypes.Prometheus) {
498
537
  readers = {
499
538
  prometheus: {
500
539
  type: OpenTelemetryReaderTypes.Prometheus,
501
- port: Coerce.integer(envVars.openTelemetryPrometheusPort)
540
+ port: envCount(envVars, "openTelemetryPrometheusPort")
502
541
  }
503
542
  };
504
543
  }
@@ -506,6 +545,7 @@ async function configureTelemetry(coreConfig, envVars) {
506
545
  type: TelemetryConnectorType.OpenTelemetry,
507
546
  options: {
508
547
  config: {
548
+ mutexTimeoutMs: envMs(envVars, "telemetryMutexTimeout"),
509
549
  meterName: envVars.openTelemetryMeterName,
510
550
  meterVersion: envVars.openTelemetryMeterVersion,
511
551
  readers
@@ -526,26 +566,72 @@ async function configureTelemetry(coreConfig, envVars) {
526
566
  */
527
567
  async function configureMetricsCollector(coreConfig, envVars) {
528
568
  if (isTelemetryRequired(envVars)) {
529
- const intervalSec = Coerce.integer(envVars.telemetryMetricsCollectorInterval) ?? 60;
530
569
  coreConfig.types.metricsCollectorComponent ??= [];
531
570
  coreConfig.types.metricsCollectorComponent.push({
532
571
  type: MetricsCollectorComponentType.Service,
533
- options: { config: { intervalMs: intervalSec * 1000 } },
572
+ options: {
573
+ config: {
574
+ intervalMs: envSecToMs(envVars, "telemetryMetricsCollectorInterval")
575
+ }
576
+ },
534
577
  isCloneable: false
535
578
  });
536
- const maxHistory = Coerce.integer(envVars.telemetryMetricsProducerMaxHistory) ?? 1440;
537
579
  coreConfig.types.metricsProducerComponent ??= [];
538
580
  const metricsProducers = commaSeparatedListToArray(envVars.telemetryMetricsProducers ??
539
581
  [MetricsProducerComponentType.System, MetricsProducerComponentType.Process].join(","));
540
582
  for (const producerType of metricsProducers) {
541
583
  coreConfig.types.metricsProducerComponent.push({
542
584
  type: producerType,
543
- options: { maxHistory },
585
+ options: { maxHistory: envCount(envVars, "telemetryMetricsProducerMaxHistory") },
544
586
  isCloneable: false
545
587
  });
546
588
  }
547
589
  }
548
590
  }
591
+ /**
592
+ * Configures the tracing.
593
+ * @param coreConfig The core config.
594
+ * @param envVars The environment variables.
595
+ * @returns A promise that resolves when the tracing configuration has been applied.
596
+ */
597
+ async function configureTracing(coreConfig, envVars) {
598
+ coreConfig.types.tracingConnector ??= [];
599
+ if (envVars.tracingConnector === TracingConnectorType.EntityStorage) {
600
+ coreConfig.types.tracingConnector.push({
601
+ type: TracingConnectorType.EntityStorage,
602
+ options: {
603
+ config: {
604
+ mutexTimeoutMs: envMs(envVars, "tracingMutexTimeout")
605
+ }
606
+ }
607
+ });
608
+ }
609
+ else if (envVars.tracingConnector === TracingConnectorType.OpenTelemetry) {
610
+ const otelTracingConfig = {
611
+ tracerName: envVars.openTelemetryTracingTracerName,
612
+ tracerVersion: envVars.openTelemetryTracingTracerVersion
613
+ };
614
+ if (Is.stringValue(envVars.openTelemetryTracingEndpoint)) {
615
+ otelTracingConfig.exporters = {
616
+ otlp: {
617
+ endpoint: envVars.openTelemetryTracingEndpoint,
618
+ processor: envVars.openTelemetryTracingProcessor ??
619
+ OpenTelemetryProcessorTypes.Batch
620
+ }
621
+ };
622
+ }
623
+ coreConfig.types.tracingConnector.push({
624
+ type: TracingConnectorType.OpenTelemetry,
625
+ options: {
626
+ config: otelTracingConfig
627
+ }
628
+ });
629
+ }
630
+ if (coreConfig.types.tracingConnector.length > 0) {
631
+ coreConfig.types.tracingComponent ??= [];
632
+ coreConfig.types.tracingComponent.push({ type: TracingComponentType.Service });
633
+ }
634
+ }
549
635
  /**
550
636
  * Configures the automation.
551
637
  * @param coreConfig The core config.
@@ -578,13 +664,14 @@ async function configureAutomation(coreConfig, envVars) {
578
664
  */
579
665
  async function configureHealth(coreConfig, envVars) {
580
666
  coreConfig.types.healthComponent ??= [];
581
- if (Coerce.boolean(envVars.healthEnabled) ?? false) {
667
+ if (envBoolean(envVars, "healthEnabled", false)) {
582
668
  coreConfig.types.healthComponent.push({
583
669
  type: HealthComponentType.Service,
584
670
  options: {
585
671
  config: {
586
- healthCheckInterval: (Coerce.integer(envVars.healthInterval) ?? 60) * 1000,
587
- initialInterval: (Coerce.integer(envVars.healthStartupInterval) ?? 2) * 1000
672
+ healthCheckInterval: envSecToMs(envVars, "healthInterval"),
673
+ healthCheckApplicationInterval: envSecToMs(envVars, "healthApplicationInterval"),
674
+ initialInterval: envSecToMs(envVars, "healthStartupInterval")
588
675
  }
589
676
  },
590
677
  isCloneable: false
@@ -598,14 +685,13 @@ async function configureHealth(coreConfig, envVars) {
598
685
  * @returns A promise that resolves when the schema migration configuration has been applied.
599
686
  */
600
687
  async function configureSchemaMigration(coreConfig, envVars) {
601
- const isSchemaMigrationEnabled = Coerce.boolean(envVars.schemaMigrationEnabled) ?? true;
602
- if (isSchemaMigrationEnabled) {
603
- coreConfig.types.schemaVersionMigrationComponent ??= [];
604
- coreConfig.types.schemaVersionMigrationComponent.push({
605
- type: SchemaVersionMigrationComponentType.Service,
606
- isCloneable: false
607
- });
608
- }
688
+ const isSchemaMigrationEnabled = envBoolean(envVars, "schemaMigrationEnabled", true);
689
+ coreConfig.types.schemaVersionMigrationComponent ??= [];
690
+ coreConfig.types.schemaVersionMigrationComponent.push({
691
+ type: SchemaVersionMigrationComponentType.Service,
692
+ options: { config: { enabled: isSchemaMigrationEnabled } },
693
+ isCloneable: false
694
+ });
609
695
  }
610
696
  /**
611
697
  * Configures the platform.
@@ -614,7 +700,7 @@ async function configureSchemaMigration(coreConfig, envVars) {
614
700
  * @returns A promise that resolves when the platform configuration has been applied.
615
701
  */
616
702
  async function configurePlatform(coreConfig, envVars) {
617
- const isTenantEnabled = Coerce.boolean(envVars.tenantEnabled) ?? false;
703
+ const isTenantEnabled = envBoolean(envVars, "tenantEnabled", false);
618
704
  coreConfig.types.platformComponent ??= [];
619
705
  coreConfig.types.platformComponent.push({
620
706
  type: PlatformComponentType.Service,
@@ -632,7 +718,7 @@ async function configurePlatform(coreConfig, envVars) {
632
718
  * @returns A promise that resolves when the tenant configuration has been applied.
633
719
  */
634
720
  async function configureTenant(coreConfig, envVars) {
635
- const isTenantEnabled = Coerce.boolean(envVars.tenantEnabled) ?? false;
721
+ const isTenantEnabled = envBoolean(envVars, "tenantEnabled", false);
636
722
  if (isTenantEnabled) {
637
723
  coreConfig.types.tenantAdminComponent ??= [];
638
724
  coreConfig.types.tenantAdminComponent.push({
@@ -652,7 +738,7 @@ async function configureContextIdHandlers(coreConfig, envVars) {
652
738
  type: ContextIdHandlerComponentType.Did,
653
739
  features: [CONTEXT_ID_HANDLER_FEATURE_DID]
654
740
  });
655
- if (Coerce.boolean(envVars.tenantEnabled) ?? false) {
741
+ if (envBoolean(envVars, "tenantEnabled", false)) {
656
742
  coreConfig.types.contextIdHandlerComponent.push({
657
743
  type: ContextIdHandlerComponentType.Tenant,
658
744
  features: [CONTEXT_ID_HANDLER_FEATURE_TENANT]
@@ -666,7 +752,7 @@ async function configureContextIdHandlers(coreConfig, envVars) {
666
752
  * @returns A promise that resolves when the messaging configuration has been applied.
667
753
  */
668
754
  async function configureMessaging(coreConfig, envVars) {
669
- if (Coerce.boolean(envVars.messagingEnabled) ?? false) {
755
+ if (envBoolean(envVars, "messagingEnabled", false)) {
670
756
  coreConfig.types.messagingEmailConnector ??= [];
671
757
  coreConfig.types.messagingSmsConnector ??= [];
672
758
  coreConfig.types.messagingPushNotificationConnector ??= [];
@@ -760,13 +846,14 @@ async function configureFaucet(coreConfig, envVars) {
760
846
  type: FaucetConnectorType.EntityStorage
761
847
  });
762
848
  }
763
- else if (envVars.faucetConnector === FaucetConnectorType.Iota) {
849
+ else if (envVars.faucetConnector === FaucetConnectorType.Iota &&
850
+ Is.stringValue(envVars.iotaFaucetEndpoint)) {
764
851
  const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
765
852
  coreConfig.types.faucetConnector.push({
766
853
  type: FaucetConnectorType.Iota,
767
854
  options: {
768
855
  config: {
769
- endpoint: envVars.iotaFaucetEndpoint ?? "",
856
+ endpoint: envVars.iotaFaucetEndpoint,
770
857
  clientOptions: dltConfig?.options?.config?.clientOptions ?? { url: "" },
771
858
  network: dltConfig?.options?.config?.network ?? ""
772
859
  }
@@ -868,7 +955,16 @@ async function configureImmutableProof(coreConfig, envVars) {
868
955
  type: ImmutableProofComponentType.Service,
869
956
  options: {
870
957
  config: {
871
- verificationMethodId: envVars.immutableProofVerificationMethodId
958
+ verificationMethodId: envVars.immutableProofVerificationMethodId,
959
+ taskRetryCount: envCount(envVars, "immutableProofTaskRetryCount"),
960
+ taskRetryInterval: envSecToMs(envVars, "immutableProofTaskRetryInterval"),
961
+ taskFailureRetainFor: envMinToMs(envVars, "immutableProofTaskFailureRetainFor"),
962
+ sweepIntervalMinutes: envMinutes(envVars, "immutableProofSweepInterval"),
963
+ sweepStaleThresholdMs: envMinToMs(envVars, "immutableProofSweepStaleThreshold"),
964
+ sweepMaxAttempts: envCount(envVars, "immutableProofSweepMaxAttempts"),
965
+ sweepBatchLimit: envCount(envVars, "immutableProofSweepBatchLimit"),
966
+ sweepBackoffMs: envMinToMs(envVars, "immutableProofSweepBackoff"),
967
+ sweepAssumeRetryableBefore: envDateTime(envVars, "immutableProofSweepAssumeRetryableBefore")
872
968
  }
873
969
  }
874
970
  });
@@ -897,8 +993,12 @@ async function configureIdentity(coreConfig, envVars) {
897
993
  identityPkgId: Is.stringValue(envVars.iotaIdentityPackageId)
898
994
  ? envVars.iotaIdentityPackageId
899
995
  : undefined,
900
- walletAddressIndex: Coerce.integer(envVars.identityWalletAddressIndex) ?? 0,
901
- didResolutionCacheTtlMs: Coerce.integer(envVars.identityDidResolutionCacheTtlMs)
996
+ walletAddressIndex: envCount(envVars, "identityWalletAddressIndex") ?? 0,
997
+ didResolutionCacheTtlMs: envMs(envVars, "identityDidResolutionCacheTtl"),
998
+ didResolutionCacheCapacity: envCount(envVars, "identityDidResolutionCacheCapacity"),
999
+ didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout"),
1000
+ didResolutionRetries: envCount(envVars, "identityDidResolutionRetries"),
1001
+ didResolutionRetryDelayMs: envMs(envVars, "identityDidResolutionRetryDelay")
902
1002
  }
903
1003
  }
904
1004
  });
@@ -1002,13 +1102,13 @@ async function configureAttestation(coreConfig, envVars) {
1002
1102
  * @returns A promise that resolves when the auditable item graph configuration has been applied.
1003
1103
  */
1004
1104
  async function configureAuditableItemGraph(coreConfig, envVars) {
1005
- if (Coerce.boolean(envVars.auditableItemGraphEnabled) ?? false) {
1105
+ if (envBoolean(envVars, "auditableItemGraphEnabled", false)) {
1006
1106
  coreConfig.types.auditableItemGraphComponent ??= [];
1007
1107
  coreConfig.types.auditableItemGraphComponent.push({
1008
1108
  type: AuditableItemGraphComponentType.Service,
1009
1109
  options: {
1010
1110
  config: {
1011
- mutexTimeoutMs: Coerce.integer(envVars.auditableItemGraphMutexTimeout)
1111
+ mutexTimeoutMs: envMs(envVars, "auditableItemGraphMutexTimeout")
1012
1112
  }
1013
1113
  }
1014
1114
  });
@@ -1021,13 +1121,13 @@ async function configureAuditableItemGraph(coreConfig, envVars) {
1021
1121
  * @returns A promise that resolves when the auditable item stream configuration has been applied.
1022
1122
  */
1023
1123
  async function configureAuditableItemStream(coreConfig, envVars) {
1024
- if (Coerce.boolean(envVars.auditableItemStreamEnabled) ?? false) {
1124
+ if (envBoolean(envVars, "auditableItemStreamEnabled", false)) {
1025
1125
  coreConfig.types.auditableItemStreamComponent ??= [];
1026
1126
  coreConfig.types.auditableItemStreamComponent.push({
1027
1127
  type: AuditableItemStreamComponentType.Service,
1028
1128
  options: {
1029
1129
  config: {
1030
- mutexTimeoutMs: Coerce.integer(envVars.auditableItemStreamMutexTimeout)
1130
+ mutexTimeoutMs: envMs(envVars, "auditableItemStreamMutexTimeout")
1031
1131
  }
1032
1132
  }
1033
1133
  });
@@ -1040,7 +1140,7 @@ async function configureAuditableItemStream(coreConfig, envVars) {
1040
1140
  * @returns A promise that resolves when the data processing configuration has been applied.
1041
1141
  */
1042
1142
  async function configureDataProcessing(coreConfig, envVars) {
1043
- if (Coerce.boolean(envVars.dataProcessingEnabled) ?? false) {
1143
+ if (envBoolean(envVars, "dataProcessingEnabled", false)) {
1044
1144
  coreConfig.types.dataProcessingComponent ??= [];
1045
1145
  coreConfig.types.dataProcessingComponent.push({ type: DataProcessingComponentType.Service });
1046
1146
  coreConfig.types.dataConverterConnector ??= [];
@@ -1066,13 +1166,13 @@ async function configureDataProcessing(coreConfig, envVars) {
1066
1166
  * @returns A promise that resolves when the document management configuration has been applied.
1067
1167
  */
1068
1168
  async function configureDocumentManagement(coreConfig, envVars) {
1069
- if (Coerce.boolean(envVars.documentManagementEnabled) ?? false) {
1169
+ if (envBoolean(envVars, "documentManagementEnabled", false)) {
1070
1170
  coreConfig.types.documentManagementComponent ??= [];
1071
1171
  coreConfig.types.documentManagementComponent.push({
1072
1172
  type: DocumentManagementComponentType.Service,
1073
1173
  options: {
1074
1174
  config: {
1075
- mutexTimeoutMs: Coerce.integer(envVars.documentManagementMutexTimeout)
1175
+ mutexTimeoutMs: envMs(envVars, "documentManagementMutexTimeout")
1076
1176
  }
1077
1177
  }
1078
1178
  });
@@ -1098,7 +1198,7 @@ async function configureTrust(coreConfig, envVars) {
1098
1198
  options: {
1099
1199
  config: {
1100
1200
  verificationMethodId: envVars.trustVerificationMethodId ?? "",
1101
- tokenTtlInSeconds: Coerce.integer(envVars.trustJwtTtl)
1201
+ tokenTtlInSeconds: envCount(envVars, "trustJwtTtl")
1102
1202
  }
1103
1203
  }
1104
1204
  });
@@ -1183,7 +1283,7 @@ async function configureRightsManagement(coreConfig, envVars) {
1183
1283
  config: {
1184
1284
  callbackPath: rightsManagementPath,
1185
1285
  includeErrorDetails: coreConfig.debug ?? false,
1186
- mutexTimeoutMs: Coerce.integer(envVars.rightsManagementMutexTimeout)
1286
+ mutexTimeoutMs: envMs(envVars, "rightsManagementMutexTimeout")
1187
1287
  }
1188
1288
  },
1189
1289
  isDefault: true
@@ -1193,7 +1293,7 @@ async function configureRightsManagement(coreConfig, envVars) {
1193
1293
  type: RightsManagementPnapComponentType.Service,
1194
1294
  options: {
1195
1295
  config: {
1196
- mutexTimeoutMs: Coerce.integer(envVars.rightsManagementMutexTimeout)
1296
+ mutexTimeoutMs: envMs(envVars, "rightsManagementMutexTimeout")
1197
1297
  }
1198
1298
  }
1199
1299
  });
@@ -1276,7 +1376,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
1276
1376
  type: FederatedCatalogueComponentType.RestClient,
1277
1377
  options: {
1278
1378
  endpoint: envVars.federatedCatalogueRemoteEndpoint,
1279
- pathPrefix: envVars.federatedCatalogueRestClientPathPrefix ?? "federated-catalogue"
1379
+ pathPrefix: envVars.federatedCatalogueRestClientPathPrefix ?? "catalog"
1280
1380
  }
1281
1381
  });
1282
1382
  }
@@ -1285,7 +1385,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
1285
1385
  type: FederatedCatalogueComponentType.Service,
1286
1386
  options: {
1287
1387
  config: {
1288
- mutexTimeoutMs: Coerce.integer(envVars.federatedCatalogueMutexTimeout)
1388
+ mutexTimeoutMs: envMs(envVars, "federatedCatalogueMutexTimeout")
1289
1389
  }
1290
1390
  }
1291
1391
  });
@@ -1307,7 +1407,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
1307
1407
  * @returns A promise that resolves when the dataspace configuration has been applied.
1308
1408
  */
1309
1409
  async function configureDataspace(coreConfig, envVars) {
1310
- if (Coerce.boolean(envVars.dataspaceEnabled) ?? false) {
1410
+ if (envBoolean(envVars, "dataspaceEnabled", false)) {
1311
1411
  coreConfig.types.dataspaceControlPlaneComponent ??= [];
1312
1412
  // We add a multi instance REST client for remote/consumer-initiated transfers.
1313
1413
  coreConfig.types.dataspaceControlPlaneComponent.push({
@@ -1318,8 +1418,6 @@ async function configureDataspace(coreConfig, envVars) {
1318
1418
  isMultiInstance: true,
1319
1419
  features: ["remote"]
1320
1420
  });
1321
- const stalledNegotiationTimeout = Coerce.integer(envVars.dataspaceStalledNegotiationTimeout);
1322
- const stalledTransferTimeout = Coerce.integer(envVars.dataspaceStalledTransferTimeout);
1323
1421
  coreConfig.types.dataspaceControlPlaneComponent.push({
1324
1422
  type: DataspaceControlPlaneComponentType.Service,
1325
1423
  options: {
@@ -1330,30 +1428,29 @@ async function configureDataspace(coreConfig, envVars) {
1330
1428
  // Base mount path of the data plane only; the transfer handlers append the
1331
1429
  // sub-paths themselves (`/entities` for PULL, `/inbox` for PUSH).
1332
1430
  dataPlanePath: envVars.dataspaceDataPlanePath,
1333
- autoStartTransfers: Coerce.boolean(envVars.dataspaceAutoStartTransfers),
1334
- stalledNegotiationTimeoutMs: !Is.empty(stalledNegotiationTimeout)
1335
- ? stalledNegotiationTimeout * 1000
1336
- : undefined,
1337
- stalledTransferTimeoutMs: !Is.empty(stalledTransferTimeout)
1338
- ? stalledTransferTimeout * 1000
1339
- : undefined
1431
+ autoStartTransfers: envBoolean(envVars, "dataspaceAutoStartTransfers", false),
1432
+ stalledNegotiationTimeoutMs: envSecToMs(envVars, "dataspaceStalledNegotiationTimeout"),
1433
+ stalledTransferTimeoutMs: envSecToMs(envVars, "dataspaceStalledTransferTimeout"),
1434
+ providerTransferIdleTimeoutMs: envSecToMs(envVars, "dataspaceProviderTransferIdleTimeout"),
1435
+ providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval")
1340
1436
  }
1341
1437
  },
1342
1438
  isDefault: true
1343
1439
  });
1344
- const retainActivityLogsFor = Coerce.integer(envVars.dataspaceRetainActivityLogsFor);
1345
- const activityLogsCleanUpInterval = Coerce.integer(envVars.dataspaceActivityLogsCleanupInterval);
1346
1440
  coreConfig.types.dataspaceDataPlaneComponent ??= [];
1347
1441
  coreConfig.types.dataspaceDataPlaneComponent.push({
1348
1442
  type: DataspaceDataPlaneComponentType.Service,
1349
1443
  options: {
1350
1444
  config: {
1351
- retainActivityLogsForMs: !Is.empty(retainActivityLogsFor)
1352
- ? retainActivityLogsFor * 1000
1353
- : undefined,
1354
- activityLogsCleanUpIntervalMs: !Is.empty(activityLogsCleanUpInterval)
1355
- ? activityLogsCleanUpInterval * 1000
1356
- : undefined
1445
+ retainActivityLogsForMs: envSecToMs(envVars, "dataspaceRetainActivityLogsFor"),
1446
+ activityLogsCleanUpIntervalMs: envSecToMs(envVars, "dataspaceActivityLogsCleanupInterval"),
1447
+ retryCount: envCount(envVars, "dataspaceRetryCount"),
1448
+ pushRetryCount: envCount(envVars, "dataspacePushRetryCount"),
1449
+ pushRetryBaseDelayMs: envMs(envVars, "dataspacePushRetryBaseDelay"),
1450
+ pushTimeoutMs: envMs(envVars, "dataspacePushTimeout"),
1451
+ pushSubscriptionCleanupIntervalMs: envMs(envVars, "dataspacePushSubscriptionCleanupInterval"),
1452
+ agreementCacheTtlMs: envMs(envVars, "dataspaceAgreementCacheTtl"),
1453
+ agreementCacheMutexTimeoutMs: envMs(envVars, "dataspaceAgreementCacheMutexTimeout")
1357
1454
  }
1358
1455
  }
1359
1456
  });
@@ -1385,26 +1482,15 @@ async function configureDlt(coreConfig, envVars) {
1385
1482
  url: envVars.iotaNodeEndpoint ?? ""
1386
1483
  },
1387
1484
  network: envVars.iotaNetwork ?? "",
1388
- coinType: Coerce.integer(envVars.iotaCoinType),
1485
+ coinType: envCount(envVars, "iotaCoinType"),
1389
1486
  gasStation: gasStationConfig,
1390
- gasBudget: Coerce.integer(envVars.iotaGasBudget),
1391
- gasReservationDuration: Coerce.integer(envVars.iotaGasReservationDuration)
1487
+ gasBudget: envCount(envVars, "iotaGasBudget"),
1488
+ gasReservationDuration: envSeconds(envVars, "iotaGasReservationDuration")
1392
1489
  }
1393
1490
  }
1394
1491
  });
1395
1492
  }
1396
1493
  }
1397
- /**
1398
- * Converts a comma separated list to an array.
1399
- * @param value The comma separated list.
1400
- * @returns The array.
1401
- */
1402
- function commaSeparatedListToArray(value) {
1403
- return (value ?? "")
1404
- .split(",")
1405
- .map(item => item.trim())
1406
- .filter(item => item.length > 0);
1407
- }
1408
1494
  /**
1409
1495
  * Checks if the trust subsystem is required.
1410
1496
  * Returns true when any component that depends on the trust subsystem is enabled.
@@ -1413,7 +1499,7 @@ function commaSeparatedListToArray(value) {
1413
1499
  */
1414
1500
  export function isTrustRequired(envVars) {
1415
1501
  return (isRightsManagementRequired(envVars) ||
1416
- (Coerce.boolean(envVars.dataspaceEnabled) ?? false) ||
1502
+ envBoolean(envVars, "dataspaceEnabled", false) ||
1417
1503
  isFederatedCatalogueRequired(envVars));
1418
1504
  }
1419
1505
  /**
@@ -1423,7 +1509,7 @@ export function isTrustRequired(envVars) {
1423
1509
  * @returns True if dataspace or verifiable storage is enabled.
1424
1510
  */
1425
1511
  export function isBackgroundTasksRequired(envVars) {
1426
- return (Coerce.boolean(envVars.dataspaceEnabled) ?? false) || isImmutableProofRequired(envVars);
1512
+ return envBoolean(envVars, "dataspaceEnabled", false) || isImmutableProofRequired(envVars);
1427
1513
  }
1428
1514
  /**
1429
1515
  * Checks if the immutable proof subsystem is required.
@@ -1432,9 +1518,9 @@ export function isBackgroundTasksRequired(envVars) {
1432
1518
  * @returns True if verifiable storage is enabled.
1433
1519
  */
1434
1520
  export function isImmutableProofRequired(envVars) {
1435
- return ((Coerce.boolean(envVars.auditableItemGraphEnabled) ?? false) ||
1436
- (Coerce.boolean(envVars.auditableItemStreamEnabled) ?? false) ||
1437
- (Coerce.boolean(envVars.documentManagementEnabled) ?? false));
1521
+ return (envBoolean(envVars, "auditableItemGraphEnabled", false) ||
1522
+ envBoolean(envVars, "auditableItemStreamEnabled", false) ||
1523
+ envBoolean(envVars, "documentManagementEnabled", false));
1438
1524
  }
1439
1525
  /**
1440
1526
  * Checks if the federated catalogue subsystem is required.
@@ -1443,10 +1529,10 @@ export function isImmutableProofRequired(envVars) {
1443
1529
  * @returns True if the federated catalogue is required.
1444
1530
  */
1445
1531
  export function isFederatedCatalogueRequired(envVars) {
1446
- return ((Coerce.boolean(envVars.federatedCatalogueEnabled) ?? false) ||
1532
+ return (envBoolean(envVars, "federatedCatalogueEnabled", false) ||
1447
1533
  Is.stringValue(envVars.federatedCatalogueRemoteEndpoint) ||
1448
1534
  Is.stringValue(envVars.federatedCatalogueFilters) ||
1449
- (Coerce.boolean(envVars.dataspaceEnabled) ?? false));
1535
+ envBoolean(envVars, "dataspaceEnabled", false));
1450
1536
  }
1451
1537
  /**
1452
1538
  * Checks if the rights management subsystem is required.
@@ -1458,7 +1544,7 @@ export function isFederatedCatalogueRequired(envVars) {
1458
1544
  * @returns True if rights management is enabled.
1459
1545
  */
1460
1546
  export function isRightsManagementRequired(envVars) {
1461
- return Coerce.boolean(envVars.dataspaceEnabled) ?? false;
1547
+ return envBoolean(envVars, "dataspaceEnabled", false);
1462
1548
  }
1463
1549
  /**
1464
1550
  * Checks if the task scheduler subsystem is required.
@@ -1467,10 +1553,11 @@ export function isRightsManagementRequired(envVars) {
1467
1553
  * @returns True if task scheduler is enabled.
1468
1554
  */
1469
1555
  export function isTaskSchedulerRequired(envVars) {
1470
- return ((Coerce.boolean(envVars.taskSchedulerEnabled) ?? false) ||
1471
- (Coerce.boolean(envVars.dataspaceEnabled) ?? false) ||
1556
+ return (envBoolean(envVars, "taskSchedulerEnabled", false) ||
1557
+ envBoolean(envVars, "dataspaceEnabled", false) ||
1472
1558
  isRightsManagementRequired(envVars) ||
1473
- isAuthEntityStorageRequired(envVars));
1559
+ isAuthEntityStorageRequired(envVars) ||
1560
+ isImmutableProofRequired(envVars));
1474
1561
  }
1475
1562
  /**
1476
1563
  * Checks if the automation subsystem is required.