@twin.org/node-core 0.9.2-next.8 → 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 +182 -87
- 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 -82
- 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 +27 -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 +83 -22
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +113 -2
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +12 -0
- package/docs/changelog.md +96 -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 +236 -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");
|
|
@@ -156,7 +161,11 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
156
161
|
localDataCenter: envVars.scylladbLocalDataCenter ?? "",
|
|
157
162
|
keyspace: envVars.scylladbKeyspace ?? "",
|
|
158
163
|
port: envInteger(envVars, "scylladbPort"),
|
|
159
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
164
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
165
|
+
pool: {
|
|
166
|
+
coreConnectionsPerHost: envCount(envVars, "scylladbPoolCoreConnectionsPerHost"),
|
|
167
|
+
maxRequestsPerConnection: envCount(envVars, "scylladbPoolMaxRequestsPerConnection")
|
|
168
|
+
}
|
|
160
169
|
},
|
|
161
170
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
162
171
|
}
|
|
@@ -172,7 +181,15 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
172
181
|
user: envVars.mySqlUser ?? "",
|
|
173
182
|
password: envVars.mySqlPassword ?? "",
|
|
174
183
|
database: envVars.mySqlDatabase ?? "",
|
|
175
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
184
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
185
|
+
pool: {
|
|
186
|
+
connectionLimit: envCount(envVars, "mySqlPoolConnectionLimit"),
|
|
187
|
+
maxIdle: envCount(envVars, "mySqlPoolMaxIdle"),
|
|
188
|
+
idleTimeout: envMs(envVars, "mySqlPoolIdleTimeout"),
|
|
189
|
+
enableKeepAlive: envBoolean(envVars, "mySqlPoolEnableKeepAlive"),
|
|
190
|
+
waitForConnections: envBoolean(envVars, "mySqlPoolWaitForConnections"),
|
|
191
|
+
queueLimit: envCount(envVars, "mySqlPoolQueueLimit")
|
|
192
|
+
}
|
|
176
193
|
},
|
|
177
194
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
178
195
|
}
|
|
@@ -188,7 +205,13 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
188
205
|
user: envVars.mongoDbUser ?? "",
|
|
189
206
|
password: envVars.mongoDbPassword ?? "",
|
|
190
207
|
database: envVars.mongoDbDatabase ?? "",
|
|
191
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
208
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
209
|
+
pool: {
|
|
210
|
+
maxPoolSize: envCount(envVars, "mongoDbPoolMaxPoolSize"),
|
|
211
|
+
minPoolSize: envCount(envVars, "mongoDbPoolMinPoolSize"),
|
|
212
|
+
maxIdleTimeMs: envMs(envVars, "mongoDbPoolMaxIdleTime"),
|
|
213
|
+
waitQueueTimeoutMs: envMs(envVars, "mongoDbPoolWaitQueueTimeout")
|
|
214
|
+
}
|
|
192
215
|
},
|
|
193
216
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
194
217
|
}
|
|
@@ -204,7 +227,13 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
204
227
|
user: envVars.postgreSqlUser ?? "",
|
|
205
228
|
password: envVars.postgreSqlPassword ?? "",
|
|
206
229
|
database: envVars.postgreSqlDatabase ?? "",
|
|
207
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
230
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
231
|
+
pool: {
|
|
232
|
+
max: envCount(envVars, "postgreSqlPoolMax"),
|
|
233
|
+
idleTimeout: envSeconds(envVars, "postgreSqlPoolIdleTimeout"),
|
|
234
|
+
connectTimeout: envSeconds(envVars, "postgreSqlPoolConnectTimeout"),
|
|
235
|
+
maxLifetime: envSeconds(envVars, "postgreSqlPoolMaxLifetime")
|
|
236
|
+
}
|
|
208
237
|
},
|
|
209
238
|
tablePrefix: envVars.entityStorageTablePrefix
|
|
210
239
|
}
|
|
@@ -497,39 +526,71 @@ async function configureEventBus(coreConfig, envVars) {
|
|
|
497
526
|
*/
|
|
498
527
|
async function configureTelemetry(coreConfig, envVars) {
|
|
499
528
|
coreConfig.types.telemetryConnector ??= [];
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
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
|
+
}
|
|
506
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
|
+
};
|
|
507
563
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
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
|
+
}
|
|
517
572
|
}
|
|
518
|
-
};
|
|
573
|
+
});
|
|
574
|
+
additionalConnectorCount++;
|
|
519
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) {
|
|
520
580
|
coreConfig.types.telemetryConnector.push({
|
|
521
|
-
type: TelemetryConnectorType.
|
|
581
|
+
type: TelemetryConnectorType.Multi,
|
|
522
582
|
options: {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
meterVersion: envVars.openTelemetryMeterVersion,
|
|
527
|
-
readers
|
|
528
|
-
}
|
|
529
|
-
}
|
|
583
|
+
telemetryConnectorTypes
|
|
584
|
+
},
|
|
585
|
+
isDefault: true
|
|
530
586
|
});
|
|
531
587
|
}
|
|
532
|
-
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) {
|
|
533
594
|
coreConfig.types.telemetryComponent ??= [];
|
|
534
595
|
coreConfig.types.telemetryComponent.push({ type: TelemetryComponentType.Service });
|
|
535
596
|
}
|
|
@@ -541,7 +602,7 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
541
602
|
* @returns A promise that resolves when the metrics collector configuration has been applied.
|
|
542
603
|
*/
|
|
543
604
|
async function configureMetricsCollector(coreConfig, envVars) {
|
|
544
|
-
if (
|
|
605
|
+
if (isTelemetryEnabled(envVars)) {
|
|
545
606
|
coreConfig.types.metricsCollectorComponent ??= [];
|
|
546
607
|
coreConfig.types.metricsCollectorComponent.push({
|
|
547
608
|
type: MetricsCollectorComponentType.Service,
|
|
@@ -550,7 +611,7 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
550
611
|
intervalMs: envSecToMs(envVars, "telemetryMetricsCollectorInterval")
|
|
551
612
|
}
|
|
552
613
|
},
|
|
553
|
-
|
|
614
|
+
cloneMode: EngineCloneMode.Never
|
|
554
615
|
});
|
|
555
616
|
coreConfig.types.metricsProducerComponent ??= [];
|
|
556
617
|
const metricsProducers = commaSeparatedListToArray(envVars.telemetryMetricsProducers ??
|
|
@@ -559,7 +620,7 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
559
620
|
coreConfig.types.metricsProducerComponent.push({
|
|
560
621
|
type: producerType,
|
|
561
622
|
options: { maxHistory: envCount(envVars, "telemetryMetricsProducerMaxHistory") },
|
|
562
|
-
|
|
623
|
+
cloneMode: EngineCloneMode.Never
|
|
563
624
|
});
|
|
564
625
|
}
|
|
565
626
|
}
|
|
@@ -572,38 +633,66 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
572
633
|
*/
|
|
573
634
|
async function configureTracing(coreConfig, envVars) {
|
|
574
635
|
coreConfig.types.tracingConnector ??= [];
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
+
}
|
|
581
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
|
+
};
|
|
582
669
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
tracerName: envVars.openTelemetryTracingTracerName,
|
|
588
|
-
tracerVersion: envVars.openTelemetryTracingTracerVersion
|
|
589
|
-
};
|
|
590
|
-
if (Is.stringValue(envVars.openTelemetryTracingEndpoint)) {
|
|
591
|
-
otelTracingConfig.exporters = {
|
|
592
|
-
otlp: {
|
|
593
|
-
endpoint: envVars.openTelemetryTracingEndpoint,
|
|
594
|
-
processor: envVars.openTelemetryTracingProcessor ??
|
|
595
|
-
OpenTelemetryProcessorTypes.Batch
|
|
670
|
+
coreConfig.types.tracingConnector.push({
|
|
671
|
+
type: TracingConnectorType.OpenTelemetry,
|
|
672
|
+
options: {
|
|
673
|
+
config: otelTracingConfig
|
|
596
674
|
}
|
|
597
|
-
};
|
|
675
|
+
});
|
|
676
|
+
additionalConnectorCount++;
|
|
598
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) {
|
|
599
682
|
coreConfig.types.tracingConnector.push({
|
|
600
|
-
type: TracingConnectorType.
|
|
683
|
+
type: TracingConnectorType.Multi,
|
|
601
684
|
options: {
|
|
602
|
-
|
|
603
|
-
}
|
|
685
|
+
tracingConnectorTypes
|
|
686
|
+
},
|
|
687
|
+
isDefault: true
|
|
604
688
|
});
|
|
605
689
|
}
|
|
606
|
-
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) {
|
|
607
696
|
coreConfig.types.tracingComponent ??= [];
|
|
608
697
|
coreConfig.types.tracingComponent.push({ type: TracingComponentType.Service });
|
|
609
698
|
}
|
|
@@ -650,7 +739,7 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
650
739
|
initialInterval: envSecToMs(envVars, "healthStartupInterval")
|
|
651
740
|
}
|
|
652
741
|
},
|
|
653
|
-
|
|
742
|
+
cloneMode: EngineCloneMode.Never
|
|
654
743
|
});
|
|
655
744
|
}
|
|
656
745
|
}
|
|
@@ -662,13 +751,12 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
662
751
|
*/
|
|
663
752
|
async function configureSchemaMigration(coreConfig, envVars) {
|
|
664
753
|
const isSchemaMigrationEnabled = envBoolean(envVars, "schemaMigrationEnabled", true);
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
754
|
+
coreConfig.types.schemaVersionMigrationComponent ??= [];
|
|
755
|
+
coreConfig.types.schemaVersionMigrationComponent.push({
|
|
756
|
+
type: SchemaVersionMigrationComponentType.Service,
|
|
757
|
+
options: { config: { enabled: isSchemaMigrationEnabled } },
|
|
758
|
+
cloneMode: EngineCloneMode.Never
|
|
759
|
+
});
|
|
672
760
|
}
|
|
673
761
|
/**
|
|
674
762
|
* Configures the platform.
|
|
@@ -685,7 +773,8 @@ async function configurePlatform(coreConfig, envVars) {
|
|
|
685
773
|
config: {
|
|
686
774
|
isMultiTenant: isTenantEnabled
|
|
687
775
|
}
|
|
688
|
-
}
|
|
776
|
+
},
|
|
777
|
+
cloneMode: EngineCloneMode.Always
|
|
689
778
|
});
|
|
690
779
|
}
|
|
691
780
|
/**
|
|
@@ -713,12 +802,14 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
713
802
|
coreConfig.types.contextIdHandlerComponent ??= [];
|
|
714
803
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
715
804
|
type: ContextIdHandlerComponentType.Did,
|
|
716
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_DID]
|
|
805
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_DID],
|
|
806
|
+
cloneMode: EngineCloneMode.Always
|
|
717
807
|
});
|
|
718
808
|
if (envBoolean(envVars, "tenantEnabled", false)) {
|
|
719
809
|
coreConfig.types.contextIdHandlerComponent.push({
|
|
720
810
|
type: ContextIdHandlerComponentType.Tenant,
|
|
721
|
-
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT]
|
|
811
|
+
features: [CONTEXT_ID_HANDLER_FEATURE_TENANT],
|
|
812
|
+
cloneMode: EngineCloneMode.Always
|
|
722
813
|
});
|
|
723
814
|
}
|
|
724
815
|
}
|
|
@@ -778,16 +869,6 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
778
869
|
});
|
|
779
870
|
}
|
|
780
871
|
else if (envVars.messagingPushNotificationConnector === MessagingPushNotificationConnectorType.Aws) {
|
|
781
|
-
let messagingApps;
|
|
782
|
-
if (Is.stringValue(envVars.awsMessagingPushNotificationApplications)) {
|
|
783
|
-
try {
|
|
784
|
-
messagingApps = JSON.parse(envVars.awsMessagingPushNotificationApplications);
|
|
785
|
-
}
|
|
786
|
-
catch { }
|
|
787
|
-
}
|
|
788
|
-
else if (Is.array(envVars.awsMessagingPushNotificationApplications)) {
|
|
789
|
-
messagingApps = envVars.awsMessagingPushNotificationApplications;
|
|
790
|
-
}
|
|
791
872
|
coreConfig.types.messagingPushNotificationConnector.push({
|
|
792
873
|
type: MessagingPushNotificationConnectorType.Aws,
|
|
793
874
|
options: {
|
|
@@ -797,7 +878,7 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
797
878
|
accessKeyId: envVars.awsSesAccessKeyId,
|
|
798
879
|
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
799
880
|
endpoint: envVars.awsSesEndpoint,
|
|
800
|
-
applicationsSettings:
|
|
881
|
+
applicationsSettings: envArray(envVars, "awsMessagingPushNotificationApplications", [])
|
|
801
882
|
}
|
|
802
883
|
}
|
|
803
884
|
});
|
|
@@ -973,7 +1054,9 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
973
1054
|
walletAddressIndex: envCount(envVars, "identityWalletAddressIndex") ?? 0,
|
|
974
1055
|
didResolutionCacheTtlMs: envMs(envVars, "identityDidResolutionCacheTtl"),
|
|
975
1056
|
didResolutionCacheCapacity: envCount(envVars, "identityDidResolutionCacheCapacity"),
|
|
976
|
-
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout")
|
|
1057
|
+
didResolutionCacheMutexTimeoutMs: envMs(envVars, "identityDidResolutionCacheMutexTimeout"),
|
|
1058
|
+
didResolutionRetries: envCount(envVars, "identityDidResolutionRetries"),
|
|
1059
|
+
didResolutionRetryDelayMs: envMs(envVars, "identityDidResolutionRetryDelay")
|
|
977
1060
|
}
|
|
978
1061
|
}
|
|
979
1062
|
});
|
|
@@ -1407,7 +1490,9 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1407
1490
|
stalledNegotiationTimeoutMs: envSecToMs(envVars, "dataspaceStalledNegotiationTimeout"),
|
|
1408
1491
|
stalledTransferTimeoutMs: envSecToMs(envVars, "dataspaceStalledTransferTimeout"),
|
|
1409
1492
|
providerTransferIdleTimeoutMs: envSecToMs(envVars, "dataspaceProviderTransferIdleTimeout"),
|
|
1410
|
-
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval")
|
|
1493
|
+
providerTransferPolicySweepIntervalMs: envSecToMs(envVars, "dataspaceProviderTransferPolicySweepInterval"),
|
|
1494
|
+
agreementUnusedThresholdMs: envMs(envVars, "dataspaceAgreementUnusedThreshold"),
|
|
1495
|
+
agreementSweepIntervalMs: envMs(envVars, "dataspaceAgreementSweepInterval")
|
|
1411
1496
|
}
|
|
1412
1497
|
},
|
|
1413
1498
|
isDefault: true
|
|
@@ -1484,7 +1569,9 @@ export function isTrustRequired(envVars) {
|
|
|
1484
1569
|
* @returns True if dataspace or verifiable storage is enabled.
|
|
1485
1570
|
*/
|
|
1486
1571
|
export function isBackgroundTasksRequired(envVars) {
|
|
1487
|
-
return envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1572
|
+
return (envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1573
|
+
isImmutableProofRequired(envVars) ||
|
|
1574
|
+
envBoolean(envVars, "healthEnabled", false));
|
|
1488
1575
|
}
|
|
1489
1576
|
/**
|
|
1490
1577
|
* Checks if the immutable proof subsystem is required.
|
|
@@ -1544,13 +1631,21 @@ export function isAutomationRequired(envVars) {
|
|
|
1544
1631
|
return isRightsManagementRequired(envVars);
|
|
1545
1632
|
}
|
|
1546
1633
|
/**
|
|
1547
|
-
* Checks if the telemetry subsystem is
|
|
1634
|
+
* Checks if the telemetry subsystem is enabled.
|
|
1548
1635
|
* Returns true when any component that depends on the telemetry subsystem is enabled.
|
|
1549
1636
|
* @param envVars The environment variables.
|
|
1550
1637
|
* @returns True if telemetry is enabled.
|
|
1551
1638
|
*/
|
|
1552
|
-
export function
|
|
1553
|
-
return (envVars.telemetryConnector === TelemetryConnectorType.EntityStorage ||
|
|
1554
|
-
|
|
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);
|
|
1555
1650
|
}
|
|
1556
1651
|
//# sourceMappingURL=engineEnvBuilder.js.map
|