@twin.org/node-core 0.9.2-next.9 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/builders/engineEnvBuilder.js +154 -83
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +50 -14
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/builders/extensionsBuilder.js +5 -4
- package/dist/es/builders/extensionsBuilder.js.map +1 -1
- package/dist/es/builders/helper/envHelpers.js +60 -74
- package/dist/es/builders/helper/envHelpers.js.map +1 -1
- package/dist/es/cli.js +2 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/bootstrapDev.js +5 -5
- package/dist/es/commands/bootstrapDev.js.map +1 -1
- package/dist/es/commands/userCreate.js +8 -3
- package/dist/es/commands/userCreate.js.map +1 -1
- package/dist/es/commands/userUpdate.js +5 -2
- package/dist/es/commands/userUpdate.js.map +1 -1
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
- package/dist/es/models/engineEnvironmentVariableKeys.js +11 -0
- package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/models/engineServerEnvironmentVariableKeys.js +4 -1
- package/dist/es/models/engineServerEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/node.js +3 -7
- package/dist/es/node.js.map +1 -1
- package/dist/es/start.js +3 -2
- package/dist/es/start.js.map +1 -1
- package/dist/types/builders/engineEnvBuilder.d.ts +9 -2
- package/dist/types/builders/helper/envHelpers.d.ts +81 -21
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +49 -2
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +12 -0
- package/docs/changelog.md +89 -0
- package/docs/reference/functions/{isTelemetryRequired.md → isTelemetryEnabled.md} +3 -3
- package/docs/reference/functions/isTracingEnabled.md +20 -0
- package/docs/reference/index.md +2 -1
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +108 -2
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +24 -0
- package/locales/en.json +1 -0
- package/package.json +34 -33
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { Is, Mutex } from "@twin.org/core";
|
|
5
|
+
import { EngineCloneMode } from "@twin.org/engine-models";
|
|
5
6
|
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
7
|
import { OpenTelemetryExporterTypes } from "@twin.org/logging-connector-opentelemetry";
|
|
7
8
|
import { OpenTelemetryReaderTypes } from "@twin.org/telemetry-connector-opentelemetry";
|
|
8
9
|
import { OpenTelemetryProcessorTypes } from "@twin.org/tracing-connector-opentelemetry";
|
|
9
10
|
import { CONTEXT_ID_HANDLER_FEATURE_DID, CONTEXT_ID_HANDLER_FEATURE_TENANT } from "../defaults.js";
|
|
10
11
|
import { isAuthEntityStorageRequired } from "./engineServerEnvBuilder.js";
|
|
11
|
-
import { commaSeparatedListToArray, envBoolean, envCount, envDateTime, envInteger, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
|
|
12
|
+
import { commaSeparatedListToArray, envArray, envBoolean, envCount, envDateTime, envInteger, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
|
|
12
13
|
/**
|
|
13
14
|
* Build the engine core configuration from environment variables.
|
|
14
15
|
* @param envVars The environment variables.
|
|
@@ -23,7 +24,11 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
23
24
|
const coreConfig = {
|
|
24
25
|
debug: envBoolean(envVars, "debug", false),
|
|
25
26
|
silent: envBoolean(envVars, "silent", false),
|
|
26
|
-
|
|
27
|
+
silentComponents: {
|
|
28
|
+
logging: commaSeparatedListToArray(envVars.loggingSilentComponents),
|
|
29
|
+
telemetry: commaSeparatedListToArray(envVars.telemetrySilentComponents),
|
|
30
|
+
tracing: commaSeparatedListToArray(envVars.tracingSilentComponents)
|
|
31
|
+
},
|
|
27
32
|
types: {}
|
|
28
33
|
};
|
|
29
34
|
const mutexTimeoutMs = envMs(envVars, "mutexTimeoutDefault");
|
|
@@ -521,39 +526,71 @@ async function configureEventBus(coreConfig, envVars) {
|
|
|
521
526
|
*/
|
|
522
527
|
async function configureTelemetry(coreConfig, envVars) {
|
|
523
528
|
coreConfig.types.telemetryConnector ??= [];
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
529
|
+
const telemetryConnectorTypes = commaSeparatedListToArray(envVars.telemetryConnector);
|
|
530
|
+
let additionalConnectorCount = 0;
|
|
531
|
+
for (const telemetryConnector of telemetryConnectorTypes) {
|
|
532
|
+
if (telemetryConnector === TelemetryConnectorType.Silent) {
|
|
533
|
+
coreConfig.types.telemetryConnector.push({
|
|
534
|
+
type: TelemetryConnectorType.Silent
|
|
535
|
+
});
|
|
536
|
+
additionalConnectorCount++;
|
|
537
|
+
}
|
|
538
|
+
else if (telemetryConnector === TelemetryConnectorType.EntityStorage) {
|
|
539
|
+
coreConfig.types.telemetryConnector.push({
|
|
540
|
+
type: TelemetryConnectorType.EntityStorage,
|
|
541
|
+
options: {
|
|
542
|
+
config: {
|
|
543
|
+
batchSize: envCount(envVars, "telemetryBatchSize"),
|
|
544
|
+
batchIntervalMs: envSecToMs(envVars, "telemetryBatchFlushInterval"),
|
|
545
|
+
maxCacheSize: envCount(envVars, "telemetryMaxCacheSize"),
|
|
546
|
+
mutexTimeoutMs: envMs(envVars, "telemetryMutexTimeout"),
|
|
547
|
+
metricDefinitionCacheCapacity: envCount(envVars, "telemetryMetricDefinitionCacheCapacity"),
|
|
548
|
+
metricDefinitionCacheTtiMs: envMs(envVars, "telemetryMetricDefinitionCacheTtiMs")
|
|
549
|
+
}
|
|
530
550
|
}
|
|
551
|
+
});
|
|
552
|
+
additionalConnectorCount++;
|
|
553
|
+
}
|
|
554
|
+
else if (telemetryConnector === TelemetryConnectorType.OpenTelemetry) {
|
|
555
|
+
let readers;
|
|
556
|
+
if (envVars.openTelemetryReader === OpenTelemetryReaderTypes.Prometheus) {
|
|
557
|
+
readers = {
|
|
558
|
+
prometheus: {
|
|
559
|
+
type: OpenTelemetryReaderTypes.Prometheus,
|
|
560
|
+
port: envCount(envVars, "openTelemetryPrometheusPort")
|
|
561
|
+
}
|
|
562
|
+
};
|
|
531
563
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
port: envCount(envVars, "openTelemetryPrometheusPort")
|
|
564
|
+
coreConfig.types.telemetryConnector.push({
|
|
565
|
+
type: TelemetryConnectorType.OpenTelemetry,
|
|
566
|
+
options: {
|
|
567
|
+
config: {
|
|
568
|
+
meterName: envVars.openTelemetryMeterName,
|
|
569
|
+
meterVersion: envVars.openTelemetryMeterVersion,
|
|
570
|
+
readers
|
|
571
|
+
}
|
|
541
572
|
}
|
|
542
|
-
};
|
|
573
|
+
});
|
|
574
|
+
additionalConnectorCount++;
|
|
543
575
|
}
|
|
576
|
+
}
|
|
577
|
+
// If more than one telemetry connector, then we need to add a multi connector
|
|
578
|
+
// and set it as the default one
|
|
579
|
+
if (additionalConnectorCount > 1) {
|
|
544
580
|
coreConfig.types.telemetryConnector.push({
|
|
545
|
-
type: TelemetryConnectorType.
|
|
581
|
+
type: TelemetryConnectorType.Multi,
|
|
546
582
|
options: {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
meterVersion: envVars.openTelemetryMeterVersion,
|
|
551
|
-
readers
|
|
552
|
-
}
|
|
553
|
-
}
|
|
583
|
+
telemetryConnectorTypes
|
|
584
|
+
},
|
|
585
|
+
isDefault: true
|
|
554
586
|
});
|
|
555
587
|
}
|
|
556
|
-
if (
|
|
588
|
+
else if (additionalConnectorCount > 0) {
|
|
589
|
+
// If only one connector, then we set it as the default one
|
|
590
|
+
coreConfig.types.telemetryConnector[coreConfig.types.telemetryConnector.length - 1].isDefault =
|
|
591
|
+
true;
|
|
592
|
+
}
|
|
593
|
+
if (additionalConnectorCount > 0) {
|
|
557
594
|
coreConfig.types.telemetryComponent ??= [];
|
|
558
595
|
coreConfig.types.telemetryComponent.push({ type: TelemetryComponentType.Service });
|
|
559
596
|
}
|
|
@@ -565,7 +602,7 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
565
602
|
* @returns A promise that resolves when the metrics collector configuration has been applied.
|
|
566
603
|
*/
|
|
567
604
|
async function configureMetricsCollector(coreConfig, envVars) {
|
|
568
|
-
if (
|
|
605
|
+
if (isTelemetryEnabled(envVars)) {
|
|
569
606
|
coreConfig.types.metricsCollectorComponent ??= [];
|
|
570
607
|
coreConfig.types.metricsCollectorComponent.push({
|
|
571
608
|
type: MetricsCollectorComponentType.Service,
|
|
@@ -574,7 +611,7 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
574
611
|
intervalMs: envSecToMs(envVars, "telemetryMetricsCollectorInterval")
|
|
575
612
|
}
|
|
576
613
|
},
|
|
577
|
-
|
|
614
|
+
cloneMode: EngineCloneMode.Never
|
|
578
615
|
});
|
|
579
616
|
coreConfig.types.metricsProducerComponent ??= [];
|
|
580
617
|
const metricsProducers = commaSeparatedListToArray(envVars.telemetryMetricsProducers ??
|
|
@@ -583,7 +620,7 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
583
620
|
coreConfig.types.metricsProducerComponent.push({
|
|
584
621
|
type: producerType,
|
|
585
622
|
options: { maxHistory: envCount(envVars, "telemetryMetricsProducerMaxHistory") },
|
|
586
|
-
|
|
623
|
+
cloneMode: EngineCloneMode.Never
|
|
587
624
|
});
|
|
588
625
|
}
|
|
589
626
|
}
|
|
@@ -596,38 +633,66 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
596
633
|
*/
|
|
597
634
|
async function configureTracing(coreConfig, envVars) {
|
|
598
635
|
coreConfig.types.tracingConnector ??= [];
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
636
|
+
const tracingConnectorTypes = commaSeparatedListToArray(envVars.tracingConnector);
|
|
637
|
+
let additionalConnectorCount = 0;
|
|
638
|
+
for (const tracingConnector of tracingConnectorTypes) {
|
|
639
|
+
if (tracingConnector === TracingConnectorType.Silent) {
|
|
640
|
+
coreConfig.types.tracingConnector.push({
|
|
641
|
+
type: TracingConnectorType.Silent
|
|
642
|
+
});
|
|
643
|
+
additionalConnectorCount++;
|
|
644
|
+
}
|
|
645
|
+
else if (tracingConnector === TracingConnectorType.EntityStorage) {
|
|
646
|
+
coreConfig.types.tracingConnector.push({
|
|
647
|
+
type: TracingConnectorType.EntityStorage,
|
|
648
|
+
options: {
|
|
649
|
+
config: {
|
|
650
|
+
mutexTimeoutMs: envMs(envVars, "tracingMutexTimeout")
|
|
651
|
+
}
|
|
605
652
|
}
|
|
653
|
+
});
|
|
654
|
+
additionalConnectorCount++;
|
|
655
|
+
}
|
|
656
|
+
else if (tracingConnector === TracingConnectorType.OpenTelemetry) {
|
|
657
|
+
const otelTracingConfig = {
|
|
658
|
+
tracerName: envVars.openTelemetryTracingTracerName,
|
|
659
|
+
tracerVersion: envVars.openTelemetryTracingTracerVersion
|
|
660
|
+
};
|
|
661
|
+
if (Is.stringValue(envVars.openTelemetryTracingEndpoint)) {
|
|
662
|
+
otelTracingConfig.exporters = {
|
|
663
|
+
otlp: {
|
|
664
|
+
endpoint: envVars.openTelemetryTracingEndpoint,
|
|
665
|
+
processor: envVars.openTelemetryTracingProcessor ??
|
|
666
|
+
OpenTelemetryProcessorTypes.Batch
|
|
667
|
+
}
|
|
668
|
+
};
|
|
606
669
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
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
|
|
670
|
+
coreConfig.types.tracingConnector.push({
|
|
671
|
+
type: TracingConnectorType.OpenTelemetry,
|
|
672
|
+
options: {
|
|
673
|
+
config: otelTracingConfig
|
|
620
674
|
}
|
|
621
|
-
};
|
|
675
|
+
});
|
|
676
|
+
additionalConnectorCount++;
|
|
622
677
|
}
|
|
678
|
+
}
|
|
679
|
+
// If more than one tracing connector, then we need to add a multi connector
|
|
680
|
+
// and set it as the default one
|
|
681
|
+
if (additionalConnectorCount > 1) {
|
|
623
682
|
coreConfig.types.tracingConnector.push({
|
|
624
|
-
type: TracingConnectorType.
|
|
683
|
+
type: TracingConnectorType.Multi,
|
|
625
684
|
options: {
|
|
626
|
-
|
|
627
|
-
}
|
|
685
|
+
tracingConnectorTypes
|
|
686
|
+
},
|
|
687
|
+
isDefault: true
|
|
628
688
|
});
|
|
629
689
|
}
|
|
630
|
-
if (
|
|
690
|
+
else if (additionalConnectorCount > 0) {
|
|
691
|
+
// If only one connector, then we set it as the default one
|
|
692
|
+
coreConfig.types.tracingConnector[coreConfig.types.tracingConnector.length - 1].isDefault =
|
|
693
|
+
true;
|
|
694
|
+
}
|
|
695
|
+
if (additionalConnectorCount > 0) {
|
|
631
696
|
coreConfig.types.tracingComponent ??= [];
|
|
632
697
|
coreConfig.types.tracingComponent.push({ type: TracingComponentType.Service });
|
|
633
698
|
}
|
|
@@ -674,7 +739,7 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
674
739
|
initialInterval: envSecToMs(envVars, "healthStartupInterval")
|
|
675
740
|
}
|
|
676
741
|
},
|
|
677
|
-
|
|
742
|
+
cloneMode: EngineCloneMode.Never
|
|
678
743
|
});
|
|
679
744
|
}
|
|
680
745
|
}
|
|
@@ -686,13 +751,12 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
686
751
|
*/
|
|
687
752
|
async function configureSchemaMigration(coreConfig, envVars) {
|
|
688
753
|
const isSchemaMigrationEnabled = envBoolean(envVars, "schemaMigrationEnabled", true);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
754
|
+
coreConfig.types.schemaVersionMigrationComponent ??= [];
|
|
755
|
+
coreConfig.types.schemaVersionMigrationComponent.push({
|
|
756
|
+
type: SchemaVersionMigrationComponentType.Service,
|
|
757
|
+
options: { config: { enabled: isSchemaMigrationEnabled } },
|
|
758
|
+
cloneMode: EngineCloneMode.Never
|
|
759
|
+
});
|
|
696
760
|
}
|
|
697
761
|
/**
|
|
698
762
|
* Configures the platform.
|
|
@@ -709,7 +773,8 @@ async function configurePlatform(coreConfig, envVars) {
|
|
|
709
773
|
config: {
|
|
710
774
|
isMultiTenant: isTenantEnabled
|
|
711
775
|
}
|
|
712
|
-
}
|
|
776
|
+
},
|
|
777
|
+
cloneMode: EngineCloneMode.Always
|
|
713
778
|
});
|
|
714
779
|
}
|
|
715
780
|
/**
|
|
@@ -737,12 +802,14 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
737
802
|
coreConfig.types.contextIdHandlerComponent ??= [];
|
|
738
803
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
739
804
|
type: ContextIdHandlerComponentType.Did,
|
|
740
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_DID]
|
|
805
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_DID],
|
|
806
|
+
cloneMode: EngineCloneMode.Always
|
|
741
807
|
});
|
|
742
808
|
if (envBoolean(envVars, "tenantEnabled", false)) {
|
|
743
809
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
744
810
|
type: ContextIdHandlerComponentType.Tenant,
|
|
745
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT]
|
|
811
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT],
|
|
812
|
+
cloneMode: EngineCloneMode.Always
|
|
746
813
|
});
|
|
747
814
|
}
|
|
748
815
|
}
|
|
@@ -802,16 +869,6 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
802
869
|
});
|
|
803
870
|
}
|
|
804
871
|
else if (envVars.messagingPushNotificationConnector === MessagingPushNotificationConnectorType.Aws) {
|
|
805
|
-
let messagingApps;
|
|
806
|
-
if (Is.stringValue(envVars.awsMessagingPushNotificationApplications)) {
|
|
807
|
-
try {
|
|
808
|
-
messagingApps = JSON.parse(envVars.awsMessagingPushNotificationApplications);
|
|
809
|
-
}
|
|
810
|
-
catch { }
|
|
811
|
-
}
|
|
812
|
-
else if (Is.array(envVars.awsMessagingPushNotificationApplications)) {
|
|
813
|
-
messagingApps = envVars.awsMessagingPushNotificationApplications;
|
|
814
|
-
}
|
|
815
872
|
coreConfig.types.messagingPushNotificationConnector.push({
|
|
816
873
|
type: MessagingPushNotificationConnectorType.Aws,
|
|
817
874
|
options: {
|
|
@@ -821,7 +878,7 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
821
878
|
accessKeyId: envVars.awsSesAccessKeyId,
|
|
822
879
|
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
823
880
|
endpoint: envVars.awsSesEndpoint,
|
|
824
|
-
applicationsSettings:
|
|
881
|
+
applicationsSettings: envArray(envVars, "awsMessagingPushNotificationApplications", [])
|
|
825
882
|
}
|
|
826
883
|
}
|
|
827
884
|
});
|
|
@@ -997,7 +1054,9 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
997
1054
|
walletAddressIndex: envCount(envVars, "identityWalletAddressIndex") ?? 0,
|
|
998
1055
|
didResolutionCacheTtlMs: envMs(envVars, "identityDidResolutionCacheTtl"),
|
|
999
1056
|
didResolutionCacheCapacity: envCount(envVars, "identityDidResolutionCacheCapacity"),
|
|
1000
|
-
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout")
|
|
1057
|
+
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout"),
|
|
1058
|
+
didResolutionRetries: envCount(envVars, "identityDidResolutionRetries"),
|
|
1059
|
+
didResolutionRetryDelayMs: envMs(envVars, "identityDidResolutionRetryDelay")
|
|
1001
1060
|
}
|
|
1002
1061
|
}
|
|
1003
1062
|
});
|
|
@@ -1431,7 +1490,9 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1431
1490
|
stalledNegotiationTimeoutMs: envSecToMs(envVars, "dataspaceStalledNegotiationTimeout"),
|
|
1432
1491
|
stalledTransferTimeoutMs: envSecToMs(envVars, "dataspaceStalledTransferTimeout"),
|
|
1433
1492
|
providerTransferIdleTimeoutMs: envSecToMs(envVars, "dataspaceProviderTransferIdleTimeout"),
|
|
1434
|
-
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval")
|
|
1493
|
+
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval"),
|
|
1494
|
+
agreementUnusedThresholdMs: envMs(envVars, "dataspaceAgreementUnusedThreshold"),
|
|
1495
|
+
agreementSweepIntervalMs: envMs(envVars, "dataspaceAgreementSweepInterval")
|
|
1435
1496
|
}
|
|
1436
1497
|
},
|
|
1437
1498
|
isDefault: true
|
|
@@ -1508,7 +1569,9 @@ export function isTrustRequired(envVars) {
|
|
|
1508
1569
|
* @returns True if dataspace or verifiable storage is enabled.
|
|
1509
1570
|
*/
|
|
1510
1571
|
export function isBackgroundTasksRequired(envVars) {
|
|
1511
|
-
return envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1572
|
+
return (envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1573
|
+
isImmutableProofRequired(envVars) ||
|
|
1574
|
+
envBoolean(envVars, "healthEnabled", false));
|
|
1512
1575
|
}
|
|
1513
1576
|
/**
|
|
1514
1577
|
* Checks if the immutable proof subsystem is required.
|
|
@@ -1568,13 +1631,21 @@ export function isAutomationRequired(envVars) {
|
|
|
1568
1631
|
return isRightsManagementRequired(envVars);
|
|
1569
1632
|
}
|
|
1570
1633
|
/**
|
|
1571
|
-
* Checks if the telemetry subsystem is
|
|
1634
|
+
* Checks if the telemetry subsystem is enabled.
|
|
1572
1635
|
* Returns true when any component that depends on the telemetry subsystem is enabled.
|
|
1573
1636
|
* @param envVars The environment variables.
|
|
1574
1637
|
* @returns True if telemetry is enabled.
|
|
1575
1638
|
*/
|
|
1576
|
-
export function
|
|
1577
|
-
return (envVars.telemetryConnector === TelemetryConnectorType.EntityStorage ||
|
|
1578
|
-
|
|
1639
|
+
export function isTelemetryEnabled(envVars) {
|
|
1640
|
+
return commaSeparatedListToArray(envVars.telemetryConnector).some(t => t === TelemetryConnectorType.EntityStorage || t === TelemetryConnectorType.OpenTelemetry);
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Checks if the tracing subsystem is enabled.
|
|
1644
|
+
* Returns true when any component that depends on the tracing subsystem is enabled.
|
|
1645
|
+
* @param envVars The environment variables.
|
|
1646
|
+
* @returns True if tracing is enabled.
|
|
1647
|
+
*/
|
|
1648
|
+
export function isTracingEnabled(envVars) {
|
|
1649
|
+
return commaSeparatedListToArray(envVars.tracingConnector).some(t => t === TracingConnectorType.EntityStorage || t === TracingConnectorType.OpenTelemetry);
|
|
1579
1650
|
}
|
|
1580
1651
|
//# sourceMappingURL=engineEnvBuilder.js.map
|