@twin.org/node-core 0.9.2-next.9 → 0.9.3-next.1
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 +162 -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 +249 -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 +2 -1
|
@@ -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,72 @@ 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.Console) {
|
|
657
|
+
coreConfig.types.tracingConnector.push({
|
|
658
|
+
type: TracingConnectorType.Console
|
|
659
|
+
});
|
|
660
|
+
additionalConnectorCount++;
|
|
661
|
+
}
|
|
662
|
+
else if (tracingConnector === TracingConnectorType.OpenTelemetry) {
|
|
663
|
+
const otelTracingConfig = {
|
|
664
|
+
tracerName: envVars.openTelemetryTracingTracerName,
|
|
665
|
+
tracerVersion: envVars.openTelemetryTracingTracerVersion
|
|
666
|
+
};
|
|
667
|
+
if (Is.stringValue(envVars.openTelemetryTracingEndpoint)) {
|
|
668
|
+
otelTracingConfig.exporters = {
|
|
669
|
+
otlp: {
|
|
670
|
+
endpoint: envVars.openTelemetryTracingEndpoint,
|
|
671
|
+
processor: envVars.openTelemetryTracingProcessor ??
|
|
672
|
+
OpenTelemetryProcessorTypes.Batch
|
|
673
|
+
}
|
|
674
|
+
};
|
|
606
675
|
}
|
|
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
|
|
676
|
+
coreConfig.types.tracingConnector.push({
|
|
677
|
+
type: TracingConnectorType.OpenTelemetry,
|
|
678
|
+
options: {
|
|
679
|
+
config: otelTracingConfig
|
|
620
680
|
}
|
|
621
|
-
};
|
|
681
|
+
});
|
|
682
|
+
additionalConnectorCount++;
|
|
622
683
|
}
|
|
684
|
+
}
|
|
685
|
+
// If more than one tracing connector, then we need to add a multi connector
|
|
686
|
+
// and set it as the default one
|
|
687
|
+
if (additionalConnectorCount > 1) {
|
|
623
688
|
coreConfig.types.tracingConnector.push({
|
|
624
|
-
type: TracingConnectorType.
|
|
689
|
+
type: TracingConnectorType.Multi,
|
|
625
690
|
options: {
|
|
626
|
-
|
|
627
|
-
}
|
|
691
|
+
tracingConnectorTypes
|
|
692
|
+
},
|
|
693
|
+
isDefault: true
|
|
628
694
|
});
|
|
629
695
|
}
|
|
630
|
-
if (
|
|
696
|
+
else if (additionalConnectorCount > 0) {
|
|
697
|
+
// If only one connector, then we set it as the default one
|
|
698
|
+
coreConfig.types.tracingConnector[coreConfig.types.tracingConnector.length - 1].isDefault =
|
|
699
|
+
true;
|
|
700
|
+
}
|
|
701
|
+
if (additionalConnectorCount > 0) {
|
|
631
702
|
coreConfig.types.tracingComponent ??= [];
|
|
632
703
|
coreConfig.types.tracingComponent.push({ type: TracingComponentType.Service });
|
|
633
704
|
}
|
|
@@ -674,7 +745,7 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
674
745
|
initialInterval: envSecToMs(envVars, "healthStartupInterval")
|
|
675
746
|
}
|
|
676
747
|
},
|
|
677
|
-
|
|
748
|
+
cloneMode: EngineCloneMode.Never
|
|
678
749
|
});
|
|
679
750
|
}
|
|
680
751
|
}
|
|
@@ -686,13 +757,12 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
686
757
|
*/
|
|
687
758
|
async function configureSchemaMigration(coreConfig, envVars) {
|
|
688
759
|
const isSchemaMigrationEnabled = envBoolean(envVars, "schemaMigrationEnabled", true);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
760
|
+
coreConfig.types.schemaVersionMigrationComponent ??= [];
|
|
761
|
+
coreConfig.types.schemaVersionMigrationComponent.push({
|
|
762
|
+
type: SchemaVersionMigrationComponentType.Service,
|
|
763
|
+
options: { config: { enabled: isSchemaMigrationEnabled } },
|
|
764
|
+
cloneMode: EngineCloneMode.Never
|
|
765
|
+
});
|
|
696
766
|
}
|
|
697
767
|
/**
|
|
698
768
|
* Configures the platform.
|
|
@@ -709,7 +779,8 @@ async function configurePlatform(coreConfig, envVars) {
|
|
|
709
779
|
config: {
|
|
710
780
|
isMultiTenant: isTenantEnabled
|
|
711
781
|
}
|
|
712
|
-
}
|
|
782
|
+
},
|
|
783
|
+
cloneMode: EngineCloneMode.Always
|
|
713
784
|
});
|
|
714
785
|
}
|
|
715
786
|
/**
|
|
@@ -737,12 +808,14 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
737
808
|
coreConfig.types.contextIdHandlerComponent ??= [];
|
|
738
809
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
739
810
|
type: ContextIdHandlerComponentType.Did,
|
|
740
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_DID]
|
|
811
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_DID],
|
|
812
|
+
cloneMode: EngineCloneMode.Always
|
|
741
813
|
});
|
|
742
814
|
if (envBoolean(envVars, "tenantEnabled", false)) {
|
|
743
815
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
744
816
|
type: ContextIdHandlerComponentType.Tenant,
|
|
745
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT]
|
|
817
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT],
|
|
818
|
+
cloneMode: EngineCloneMode.Always
|
|
746
819
|
});
|
|
747
820
|
}
|
|
748
821
|
}
|
|
@@ -802,16 +875,6 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
802
875
|
});
|
|
803
876
|
}
|
|
804
877
|
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
878
|
coreConfig.types.messagingPushNotificationConnector.push({
|
|
816
879
|
type: MessagingPushNotificationConnectorType.Aws,
|
|
817
880
|
options: {
|
|
@@ -821,7 +884,7 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
821
884
|
accessKeyId: envVars.awsSesAccessKeyId,
|
|
822
885
|
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
823
886
|
endpoint: envVars.awsSesEndpoint,
|
|
824
|
-
applicationsSettings:
|
|
887
|
+
applicationsSettings: envArray(envVars, "awsMessagingPushNotificationApplications", [])
|
|
825
888
|
}
|
|
826
889
|
}
|
|
827
890
|
});
|
|
@@ -997,7 +1060,9 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
997
1060
|
walletAddressIndex: envCount(envVars, "identityWalletAddressIndex") ?? 0,
|
|
998
1061
|
didResolutionCacheTtlMs: envMs(envVars, "identityDidResolutionCacheTtl"),
|
|
999
1062
|
didResolutionCacheCapacity: envCount(envVars, "identityDidResolutionCacheCapacity"),
|
|
1000
|
-
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout")
|
|
1063
|
+
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout"),
|
|
1064
|
+
didResolutionRetries: envCount(envVars, "identityDidResolutionRetries"),
|
|
1065
|
+
didResolutionRetryDelayMs: envMs(envVars, "identityDidResolutionRetryDelay")
|
|
1001
1066
|
}
|
|
1002
1067
|
}
|
|
1003
1068
|
});
|
|
@@ -1431,7 +1496,9 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1431
1496
|
stalledNegotiationTimeoutMs: envSecToMs(envVars, "dataspaceStalledNegotiationTimeout"),
|
|
1432
1497
|
stalledTransferTimeoutMs: envSecToMs(envVars, "dataspaceStalledTransferTimeout"),
|
|
1433
1498
|
providerTransferIdleTimeoutMs: envSecToMs(envVars, "dataspaceProviderTransferIdleTimeout"),
|
|
1434
|
-
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval")
|
|
1499
|
+
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval"),
|
|
1500
|
+
agreementUnusedThresholdMs: envMs(envVars, "dataspaceAgreementUnusedThreshold"),
|
|
1501
|
+
agreementSweepIntervalMs: envMs(envVars, "dataspaceAgreementSweepInterval")
|
|
1435
1502
|
}
|
|
1436
1503
|
},
|
|
1437
1504
|
isDefault: true
|
|
@@ -1508,7 +1575,9 @@ export function isTrustRequired(envVars) {
|
|
|
1508
1575
|
* @returns True if dataspace or verifiable storage is enabled.
|
|
1509
1576
|
*/
|
|
1510
1577
|
export function isBackgroundTasksRequired(envVars) {
|
|
1511
|
-
return envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1578
|
+
return (envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1579
|
+
isImmutableProofRequired(envVars) ||
|
|
1580
|
+
envBoolean(envVars, "healthEnabled", false));
|
|
1512
1581
|
}
|
|
1513
1582
|
/**
|
|
1514
1583
|
* Checks if the immutable proof subsystem is required.
|
|
@@ -1568,13 +1637,23 @@ export function isAutomationRequired(envVars) {
|
|
|
1568
1637
|
return isRightsManagementRequired(envVars);
|
|
1569
1638
|
}
|
|
1570
1639
|
/**
|
|
1571
|
-
* Checks if the telemetry subsystem is
|
|
1640
|
+
* Checks if the telemetry subsystem is enabled.
|
|
1572
1641
|
* Returns true when any component that depends on the telemetry subsystem is enabled.
|
|
1573
1642
|
* @param envVars The environment variables.
|
|
1574
1643
|
* @returns True if telemetry is enabled.
|
|
1575
1644
|
*/
|
|
1576
|
-
export function
|
|
1577
|
-
return (envVars.telemetryConnector === TelemetryConnectorType.EntityStorage ||
|
|
1578
|
-
|
|
1645
|
+
export function isTelemetryEnabled(envVars) {
|
|
1646
|
+
return commaSeparatedListToArray(envVars.telemetryConnector).some(t => t === TelemetryConnectorType.EntityStorage || t === TelemetryConnectorType.OpenTelemetry);
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Checks if the tracing subsystem is enabled.
|
|
1650
|
+
* Returns true when any component that depends on the tracing subsystem is enabled.
|
|
1651
|
+
* @param envVars The environment variables.
|
|
1652
|
+
* @returns True if tracing is enabled.
|
|
1653
|
+
*/
|
|
1654
|
+
export function isTracingEnabled(envVars) {
|
|
1655
|
+
return commaSeparatedListToArray(envVars.tracingConnector).some(t => t === TracingConnectorType.EntityStorage ||
|
|
1656
|
+
t === TracingConnectorType.OpenTelemetry ||
|
|
1657
|
+
t === TracingConnectorType.Console);
|
|
1579
1658
|
}
|
|
1580
1659
|
//# sourceMappingURL=engineEnvBuilder.js.map
|