@twin.org/node-core 0.9.3 → 0.9.4-next.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 +453 -364
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/helper/envHelpers.js +39 -0
- package/dist/es/builders/helper/envHelpers.js.map +1 -1
- package/dist/es/cli.js +1 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/bootstrapDev.js +3 -3
- package/dist/es/commands/bootstrapDev.js.map +1 -1
- package/dist/es/commands/help.js +1 -1
- package/dist/es/commands/help.js.map +1 -1
- package/dist/es/commands/identityCreate.js +2 -2
- package/dist/es/commands/identityCreate.js.map +1 -1
- package/dist/es/commands/identityVerificationMethodCreate.js +2 -2
- package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -1
- package/dist/es/commands/userCreate.js +1 -1
- package/dist/es/commands/userCreate.js.map +1 -1
- package/dist/es/commands/vaultKeyCreate.js +1 -1
- package/dist/es/commands/vaultKeyCreate.js.map +1 -1
- package/dist/es/commands/vaultKeyImport.js +1 -1
- package/dist/es/commands/vaultKeyImport.js.map +1 -1
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/deprecatedEnvironmentVariableKeys.js +16 -0
- package/dist/es/models/deprecatedEnvironmentVariableKeys.js.map +1 -0
- package/dist/es/models/engineEnvironmentVariableKeys.js +7 -2
- package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/node.js +41 -21
- package/dist/es/node.js.map +1 -1
- package/dist/types/builders/engineEnvBuilder.d.ts +7 -0
- package/dist/types/builders/helper/envHelpers.d.ts +30 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +24 -8
- package/dist/types/models/deprecatedEnvironmentVariableKeys.d.ts +7 -0
- package/docs/changelog.md +166 -0
- package/docs/reference/functions/isMailboxEnabled.md +20 -0
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +45 -13
- package/locales/en.json +3 -1
- package/package.json +34 -34
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { Is, Mutex } from "@twin.org/core";
|
|
5
5
|
import { EngineCloneMode } from "@twin.org/engine-models";
|
|
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
|
+
import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationActionType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EmailProtocolConnectorType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, FederatedCatalogueFilterComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MailboxComponentType, MailStorageComponentType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPolicyArbiterComponentType, RightsManagementPolicyEnforcementProcessorComponentType, RightsManagementPolicyExecutionActionComponentType, RightsManagementPolicyInformationSourceComponentType, RightsManagementPolicyNegotiatorComponentType, RightsManagementPolicyObligationEnforcerComponentType, RightsManagementPolicyRequesterComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TracingComponentType, TracingConnectorType, TrustComponentType, TrustGeneratorComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
|
|
7
7
|
import { OpenTelemetryExporterTypes } from "@twin.org/logging-connector-opentelemetry";
|
|
8
8
|
import { OpenTelemetryReaderTypes } from "@twin.org/telemetry-connector-opentelemetry";
|
|
9
9
|
import { OpenTelemetryProcessorTypes } from "@twin.org/tracing-connector-opentelemetry";
|
|
10
10
|
import { CONTEXT_ID_HANDLER_FEATURE_DID, CONTEXT_ID_HANDLER_FEATURE_TENANT } from "../defaults.js";
|
|
11
11
|
import { isAuthEntityStorageRequired } from "./engineServerEnvBuilder.js";
|
|
12
|
-
import { commaSeparatedListToArray, envArray, envBoolean, envCount, envDateTime, envInteger, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
|
|
12
|
+
import { commaSeparatedListToArray, envArray, envBoolean, envChoice, envCount, envDateTime, envInteger, envListToArray, envMinToMs, envMinutes, envMs, envSecToMs, envSeconds } from "./helper/envHelpers.js";
|
|
13
13
|
/**
|
|
14
14
|
* Build the engine core configuration from environment variables.
|
|
15
15
|
* @param envVars The environment variables.
|
|
@@ -32,7 +32,7 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
32
32
|
types: {}
|
|
33
33
|
};
|
|
34
34
|
const mutexTimeoutMs = envMs(envVars, "mutexTimeoutDefault");
|
|
35
|
-
if (
|
|
35
|
+
if (Is.notEmpty(mutexTimeoutMs)) {
|
|
36
36
|
Mutex.setDefaultTimeoutMs(mutexTimeoutMs);
|
|
37
37
|
}
|
|
38
38
|
await configureSchemaMigration(coreConfig, envVars);
|
|
@@ -51,6 +51,7 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
51
51
|
await configureMetricsCollector(coreConfig, envVars);
|
|
52
52
|
await configureTracing(coreConfig, envVars);
|
|
53
53
|
await configureMessaging(coreConfig, envVars);
|
|
54
|
+
await configureMailbox(coreConfig, envVars);
|
|
54
55
|
await configureAutomation(coreConfig, envVars);
|
|
55
56
|
await configureHealth(coreConfig, envVars);
|
|
56
57
|
await configureFaucet(coreConfig, envVars);
|
|
@@ -81,163 +82,165 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
81
82
|
async function configureEntityStorage(coreConfig, envVars) {
|
|
82
83
|
coreConfig.types ??= {};
|
|
83
84
|
coreConfig.types.entityStorageConnector ??= [];
|
|
84
|
-
const entityStorageConnectorTypes =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.File)) {
|
|
96
|
-
coreConfig.types.entityStorageConnector.push({
|
|
97
|
-
type: EntityStorageConnectorType.File,
|
|
98
|
-
options: {
|
|
99
|
-
config: {
|
|
100
|
-
directory: envVars.storageFileRoot ?? "",
|
|
101
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
102
|
-
},
|
|
103
|
-
folderPrefix: envVars.entityStorageTablePrefix
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.AwsDynamoDb)) {
|
|
108
|
-
coreConfig.types.entityStorageConnector.push({
|
|
109
|
-
type: EntityStorageConnectorType.AwsDynamoDb,
|
|
110
|
-
options: {
|
|
111
|
-
config: {
|
|
112
|
-
region: envVars.awsDynamodbRegion ?? "",
|
|
113
|
-
authMode: envVars.awsDynamodbAuthMode,
|
|
114
|
-
accessKeyId: envVars.awsDynamodbAccessKeyId,
|
|
115
|
-
secretAccessKey: envVars.awsDynamodbSecretAccessKey,
|
|
116
|
-
endpoint: envVars.awsDynamodbEndpoint,
|
|
117
|
-
connectionTimeoutMs: envMs(envVars, "awsDynamodbConnectionTimeout"),
|
|
118
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
119
|
-
},
|
|
120
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.AzureCosmosDb)) {
|
|
125
|
-
coreConfig.types.entityStorageConnector.push({
|
|
126
|
-
type: EntityStorageConnectorType.AzureCosmosDb,
|
|
127
|
-
options: {
|
|
128
|
-
config: {
|
|
129
|
-
endpoint: envVars.azureCosmosdbEndpoint ?? "",
|
|
130
|
-
key: envVars.azureCosmosdbKey ?? "",
|
|
131
|
-
databaseId: envVars.azureCosmosdbDatabaseId ?? "",
|
|
132
|
-
containerId: envVars.azureCosmosdbContainerId ?? "",
|
|
133
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
134
|
-
},
|
|
135
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.GcpFirestoreDb)) {
|
|
140
|
-
coreConfig.types.entityStorageConnector.push({
|
|
141
|
-
type: EntityStorageConnectorType.GcpFirestoreDb,
|
|
142
|
-
options: {
|
|
143
|
-
config: {
|
|
144
|
-
projectId: envVars.gcpFirestoreProjectId ?? "",
|
|
145
|
-
credentials: envVars.gcpFirestoreCredentials ?? "",
|
|
146
|
-
databaseId: envVars.gcpFirestoreDatabaseId ?? "",
|
|
147
|
-
collectionName: envVars.gcpFirestoreCollectionName ?? "",
|
|
148
|
-
endpoint: envVars.gcpFirestoreEndpoint ?? "",
|
|
149
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
150
|
-
},
|
|
151
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.ScyllaDb)) {
|
|
156
|
-
coreConfig.types.entityStorageConnector.push({
|
|
157
|
-
type: EntityStorageConnectorType.ScyllaDb,
|
|
158
|
-
options: {
|
|
159
|
-
config: {
|
|
160
|
-
hosts: commaSeparatedListToArray(envVars.scylladbHosts),
|
|
161
|
-
localDataCenter: envVars.scylladbLocalDataCenter ?? "",
|
|
162
|
-
keyspace: envVars.scylladbKeyspace ?? "",
|
|
163
|
-
port: envInteger(envVars, "scylladbPort"),
|
|
164
|
-
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
165
|
-
pool: {
|
|
166
|
-
coreConnectionsPerHost: envCount(envVars, "scylladbPoolCoreConnectionsPerHost"),
|
|
167
|
-
maxRequestsPerConnection: envCount(envVars, "scylladbPoolMaxRequestsPerConnection")
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.MySqlDb)) {
|
|
175
|
-
coreConfig.types.entityStorageConnector.push({
|
|
176
|
-
type: EntityStorageConnectorType.MySqlDb,
|
|
177
|
-
options: {
|
|
178
|
-
config: {
|
|
179
|
-
host: envVars.mySqlHost ?? "",
|
|
180
|
-
port: envInteger(envVars, "mySqlPort"),
|
|
181
|
-
user: envVars.mySqlUser ?? "",
|
|
182
|
-
password: envVars.mySqlPassword ?? "",
|
|
183
|
-
database: envVars.mySqlDatabase ?? "",
|
|
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
|
-
}
|
|
193
|
-
},
|
|
194
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.MongoDb)) {
|
|
199
|
-
coreConfig.types.entityStorageConnector.push({
|
|
200
|
-
type: EntityStorageConnectorType.MongoDb,
|
|
201
|
-
options: {
|
|
202
|
-
config: {
|
|
203
|
-
host: envVars.mongoDbHost ?? "",
|
|
204
|
-
port: envInteger(envVars, "mongoDbPort"),
|
|
205
|
-
user: envVars.mongoDbUser ?? "",
|
|
206
|
-
password: envVars.mongoDbPassword ?? "",
|
|
207
|
-
database: envVars.mongoDbDatabase ?? "",
|
|
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
|
-
}
|
|
215
|
-
},
|
|
216
|
-
tablePrefix: envVars.entityStorageTablePrefix
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
if (entityStorageConnectorTypes.includes(EntityStorageConnectorType.PostgreSql)) {
|
|
221
|
-
coreConfig.types.entityStorageConnector.push({
|
|
222
|
-
type: EntityStorageConnectorType.PostgreSql,
|
|
223
|
-
options: {
|
|
224
|
-
config: {
|
|
225
|
-
host: envVars.postgreSqlHost ?? "",
|
|
226
|
-
port: envInteger(envVars, "postgreSqlPort"),
|
|
227
|
-
user: envVars.postgreSqlUser ?? "",
|
|
228
|
-
password: envVars.postgreSqlPassword ?? "",
|
|
229
|
-
database: envVars.postgreSqlDatabase ?? "",
|
|
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")
|
|
85
|
+
const entityStorageConnectorTypes = envListToArray(envVars, "entityStorageConnectorType", Object.values(EntityStorageConnectorType));
|
|
86
|
+
for (const entityStorageConnectorType of entityStorageConnectorTypes) {
|
|
87
|
+
if (entityStorageConnectorType === EntityStorageConnectorType.Memory) {
|
|
88
|
+
coreConfig.types.entityStorageConnector.push({
|
|
89
|
+
type: EntityStorageConnectorType.Memory,
|
|
90
|
+
options: {
|
|
91
|
+
config: {
|
|
92
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
236
93
|
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.File) {
|
|
98
|
+
coreConfig.types.entityStorageConnector.push({
|
|
99
|
+
type: EntityStorageConnectorType.File,
|
|
100
|
+
options: {
|
|
101
|
+
config: {
|
|
102
|
+
directory: envVars.storageFileRoot ?? "",
|
|
103
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
104
|
+
},
|
|
105
|
+
folderPrefix: envVars.entityStorageTablePrefix
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.AwsDynamoDb) {
|
|
110
|
+
coreConfig.types.entityStorageConnector.push({
|
|
111
|
+
type: EntityStorageConnectorType.AwsDynamoDb,
|
|
112
|
+
options: {
|
|
113
|
+
config: {
|
|
114
|
+
region: envVars.awsDynamodbRegion ?? "",
|
|
115
|
+
authMode: envVars.awsDynamodbAuthMode,
|
|
116
|
+
accessKeyId: envVars.awsDynamodbAccessKeyId,
|
|
117
|
+
secretAccessKey: envVars.awsDynamodbSecretAccessKey,
|
|
118
|
+
endpoint: envVars.awsDynamodbEndpoint,
|
|
119
|
+
connectionTimeoutMs: envMs(envVars, "awsDynamodbConnectionTimeout"),
|
|
120
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
121
|
+
},
|
|
122
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.AzureCosmosDb) {
|
|
127
|
+
coreConfig.types.entityStorageConnector.push({
|
|
128
|
+
type: EntityStorageConnectorType.AzureCosmosDb,
|
|
129
|
+
options: {
|
|
130
|
+
config: {
|
|
131
|
+
endpoint: envVars.azureCosmosdbEndpoint ?? "",
|
|
132
|
+
key: envVars.azureCosmosdbKey ?? "",
|
|
133
|
+
databaseId: envVars.azureCosmosdbDatabaseId ?? "",
|
|
134
|
+
containerId: envVars.azureCosmosdbContainerId ?? "",
|
|
135
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
136
|
+
},
|
|
137
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.GcpFirestoreDb) {
|
|
142
|
+
coreConfig.types.entityStorageConnector.push({
|
|
143
|
+
type: EntityStorageConnectorType.GcpFirestoreDb,
|
|
144
|
+
options: {
|
|
145
|
+
config: {
|
|
146
|
+
projectId: envVars.gcpFirestoreProjectId ?? "",
|
|
147
|
+
credentials: envVars.gcpFirestoreCredentials ?? "",
|
|
148
|
+
databaseId: envVars.gcpFirestoreDatabaseId ?? "",
|
|
149
|
+
collectionName: envVars.gcpFirestoreCollectionName ?? "",
|
|
150
|
+
endpoint: envVars.gcpFirestoreEndpoint ?? "",
|
|
151
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout")
|
|
152
|
+
},
|
|
153
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.ScyllaDb) {
|
|
158
|
+
coreConfig.types.entityStorageConnector.push({
|
|
159
|
+
type: EntityStorageConnectorType.ScyllaDb,
|
|
160
|
+
options: {
|
|
161
|
+
config: {
|
|
162
|
+
hosts: commaSeparatedListToArray(envVars.scylladbHosts),
|
|
163
|
+
localDataCenter: envVars.scylladbLocalDataCenter ?? "",
|
|
164
|
+
keyspace: envVars.scylladbKeyspace ?? "",
|
|
165
|
+
port: envInteger(envVars, "scylladbPort"),
|
|
166
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
167
|
+
pool: {
|
|
168
|
+
coreConnectionsPerHost: envCount(envVars, "scylladbPoolCoreConnectionsPerHost"),
|
|
169
|
+
maxRequestsPerConnection: envCount(envVars, "scylladbPoolMaxRequestsPerConnection")
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.MySqlDb) {
|
|
177
|
+
coreConfig.types.entityStorageConnector.push({
|
|
178
|
+
type: EntityStorageConnectorType.MySqlDb,
|
|
179
|
+
options: {
|
|
180
|
+
config: {
|
|
181
|
+
host: envVars.mySqlHost ?? "",
|
|
182
|
+
port: envInteger(envVars, "mySqlPort"),
|
|
183
|
+
user: envVars.mySqlUser ?? "",
|
|
184
|
+
password: envVars.mySqlPassword ?? "",
|
|
185
|
+
database: envVars.mySqlDatabase ?? "",
|
|
186
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
187
|
+
pool: {
|
|
188
|
+
connectionLimit: envCount(envVars, "mySqlPoolConnectionLimit"),
|
|
189
|
+
maxIdle: envCount(envVars, "mySqlPoolMaxIdle"),
|
|
190
|
+
idleTimeout: envMs(envVars, "mySqlPoolIdleTimeout"),
|
|
191
|
+
enableKeepAlive: envBoolean(envVars, "mySqlPoolEnableKeepAlive"),
|
|
192
|
+
waitForConnections: envBoolean(envVars, "mySqlPoolWaitForConnections"),
|
|
193
|
+
queueLimit: envCount(envVars, "mySqlPoolQueueLimit")
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.MongoDb) {
|
|
201
|
+
coreConfig.types.entityStorageConnector.push({
|
|
202
|
+
type: EntityStorageConnectorType.MongoDb,
|
|
203
|
+
options: {
|
|
204
|
+
config: {
|
|
205
|
+
host: envVars.mongoDbHost ?? "",
|
|
206
|
+
port: envInteger(envVars, "mongoDbPort"),
|
|
207
|
+
user: envVars.mongoDbUser ?? "",
|
|
208
|
+
password: envVars.mongoDbPassword ?? "",
|
|
209
|
+
database: envVars.mongoDbDatabase ?? "",
|
|
210
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
211
|
+
pool: {
|
|
212
|
+
maxPoolSize: envCount(envVars, "mongoDbPoolMaxPoolSize"),
|
|
213
|
+
minPoolSize: envCount(envVars, "mongoDbPoolMinPoolSize"),
|
|
214
|
+
maxIdleTimeMs: envMs(envVars, "mongoDbPoolMaxIdleTime"),
|
|
215
|
+
waitQueueTimeoutMs: envMs(envVars, "mongoDbPoolWaitQueueTimeout")
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
else if (entityStorageConnectorType === EntityStorageConnectorType.PostgreSql) {
|
|
223
|
+
coreConfig.types.entityStorageConnector.push({
|
|
224
|
+
type: EntityStorageConnectorType.PostgreSql,
|
|
225
|
+
options: {
|
|
226
|
+
config: {
|
|
227
|
+
host: envVars.postgreSqlHost ?? "",
|
|
228
|
+
port: envInteger(envVars, "postgreSqlPort"),
|
|
229
|
+
user: envVars.postgreSqlUser ?? "",
|
|
230
|
+
password: envVars.postgreSqlPassword ?? "",
|
|
231
|
+
database: envVars.postgreSqlDatabase ?? "",
|
|
232
|
+
mutexTimeoutMs: envMs(envVars, "entityStorageMutexTimeout"),
|
|
233
|
+
pool: {
|
|
234
|
+
max: envCount(envVars, "postgreSqlPoolMax"),
|
|
235
|
+
idleTimeout: envSeconds(envVars, "postgreSqlPoolIdleTimeout"),
|
|
236
|
+
connectTimeout: envSeconds(envVars, "postgreSqlPoolConnectTimeout"),
|
|
237
|
+
maxLifetime: envSeconds(envVars, "postgreSqlPoolMaxLifetime")
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
tablePrefix: envVars.entityStorageTablePrefix
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
241
244
|
}
|
|
242
245
|
const defaultEntityStorageConnectorType = envVars.entityStorageConnectorDefault ?? entityStorageConnectorTypes[0];
|
|
243
246
|
if (Is.arrayValue(entityStorageConnectorTypes)) {
|
|
@@ -257,85 +260,88 @@ async function configureEntityStorage(coreConfig, envVars) {
|
|
|
257
260
|
*/
|
|
258
261
|
async function configureBlobStorage(coreConfig, envVars) {
|
|
259
262
|
coreConfig.types.blobStorageConnector ??= [];
|
|
260
|
-
const blobStorageConnectorTypes =
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
if (blobStorageConnectorTypes.includes(BlobStorageConnectorType.Ipfs)) {
|
|
280
|
-
coreConfig.types.blobStorageConnector.push({
|
|
281
|
-
type: BlobStorageConnectorType.Ipfs,
|
|
282
|
-
options: {
|
|
283
|
-
config: {
|
|
284
|
-
apiUrl: envVars.ipfsApiUrl ?? "",
|
|
285
|
-
bearerToken: envVars.ipfsBearerToken
|
|
263
|
+
const blobStorageConnectorTypes = envListToArray(envVars, "blobStorageConnectorType", Object.values(BlobStorageConnectorType));
|
|
264
|
+
for (const blobStorageConnectorType of blobStorageConnectorTypes) {
|
|
265
|
+
if (blobStorageConnectorType === BlobStorageConnectorType.Memory) {
|
|
266
|
+
coreConfig.types.blobStorageConnector.push({
|
|
267
|
+
type: BlobStorageConnectorType.Memory
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
else if (blobStorageConnectorType === BlobStorageConnectorType.File) {
|
|
271
|
+
coreConfig.types.blobStorageConnector.push({
|
|
272
|
+
type: BlobStorageConnectorType.File,
|
|
273
|
+
options: {
|
|
274
|
+
config: {
|
|
275
|
+
directory: Is.stringValue(envVars.storageFileRoot)
|
|
276
|
+
? path.join(envVars.storageFileRoot, "blob-storage")
|
|
277
|
+
: ""
|
|
278
|
+
},
|
|
279
|
+
storagePrefix: envVars.blobStoragePrefix
|
|
286
280
|
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
else if (blobStorageConnectorType === BlobStorageConnectorType.Ipfs) {
|
|
284
|
+
coreConfig.types.blobStorageConnector.push({
|
|
285
|
+
type: BlobStorageConnectorType.Ipfs,
|
|
286
|
+
options: {
|
|
287
|
+
config: {
|
|
288
|
+
apiUrl: envVars.ipfsApiUrl ?? "",
|
|
289
|
+
bearerToken: envVars.ipfsBearerToken
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
else if (blobStorageConnectorType === BlobStorageConnectorType.AwsS3) {
|
|
295
|
+
coreConfig.types.blobStorageConnector.push({
|
|
296
|
+
type: BlobStorageConnectorType.AwsS3,
|
|
297
|
+
options: {
|
|
298
|
+
config: {
|
|
299
|
+
region: envVars.awsS3Region ?? "",
|
|
300
|
+
bucketName: envVars.awsS3BucketName ?? "",
|
|
301
|
+
authMode: envVars.awsS3AuthMode,
|
|
302
|
+
accessKeyId: envVars.awsS3AccessKeyId,
|
|
303
|
+
secretAccessKey: envVars.awsS3SecretAccessKey,
|
|
304
|
+
endpoint: envVars.awsS3Endpoint
|
|
305
|
+
},
|
|
306
|
+
storagePrefix: envVars.blobStoragePrefix
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else if (blobStorageConnectorType === BlobStorageConnectorType.AzureStorage) {
|
|
311
|
+
coreConfig.types.blobStorageConnector.push({
|
|
312
|
+
type: BlobStorageConnectorType.AzureStorage,
|
|
313
|
+
options: {
|
|
314
|
+
config: {
|
|
315
|
+
accountName: envVars.azureStorageAccountName ?? "",
|
|
316
|
+
accountKey: envVars.azureStorageAccountKey ?? "",
|
|
317
|
+
containerName: envVars.azureStorageContainerName ?? "",
|
|
318
|
+
endpoint: envVars.azureStorageEndpoint ?? ""
|
|
319
|
+
},
|
|
320
|
+
storagePrefix: envVars.blobStoragePrefix
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
else if (blobStorageConnectorType === BlobStorageConnectorType.GcpStorage) {
|
|
325
|
+
coreConfig.types.blobStorageConnector.push({
|
|
326
|
+
type: BlobStorageConnectorType.GcpStorage,
|
|
327
|
+
options: {
|
|
328
|
+
config: {
|
|
329
|
+
projectId: envVars.gcpStorageProjectId ?? "",
|
|
330
|
+
credentials: envVars.gcpStorageCredentials ?? "",
|
|
331
|
+
bucketName: envVars.gcpStorageBucketName ?? "",
|
|
332
|
+
apiEndpoint: envVars.gcpFirestoreEndpoint
|
|
333
|
+
},
|
|
334
|
+
storagePrefix: envVars.blobStoragePrefix
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
333
338
|
}
|
|
334
339
|
if (Is.arrayValue(blobStorageConnectorTypes)) {
|
|
335
340
|
const defaultStorageConnectorType = envVars.blobStorageConnectorDefault ?? blobStorageConnectorTypes[0];
|
|
336
341
|
for (const config of coreConfig.types.blobStorageConnector) {
|
|
337
342
|
if (config.type === defaultStorageConnectorType) {
|
|
338
343
|
config.isDefault = true;
|
|
344
|
+
break;
|
|
339
345
|
}
|
|
340
346
|
}
|
|
341
347
|
}
|
|
@@ -361,7 +367,7 @@ async function configureBlobStorage(coreConfig, envVars) {
|
|
|
361
367
|
*/
|
|
362
368
|
async function configureLogging(coreConfig, envVars) {
|
|
363
369
|
coreConfig.types.loggingConnector ??= [];
|
|
364
|
-
const loggingConnectorTypes =
|
|
370
|
+
const loggingConnectorTypes = envListToArray(envVars, "loggingConnector", Object.values(LoggingConnectorType));
|
|
365
371
|
let additionalConnectorCount = 0;
|
|
366
372
|
for (const loggingConnector of loggingConnectorTypes) {
|
|
367
373
|
if (loggingConnector === LoggingConnectorType.Console) {
|
|
@@ -463,7 +469,8 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
463
469
|
*/
|
|
464
470
|
async function configureVault(coreConfig, envVars) {
|
|
465
471
|
coreConfig.types.vaultConnector ??= [];
|
|
466
|
-
|
|
472
|
+
const vaultConnectorType = envChoice(envVars, "vaultConnector", Object.values(VaultConnectorType));
|
|
473
|
+
if (vaultConnectorType === VaultConnectorType.EntityStorage) {
|
|
467
474
|
coreConfig.types.vaultConnector.push({
|
|
468
475
|
type: VaultConnectorType.EntityStorage,
|
|
469
476
|
options: {
|
|
@@ -473,7 +480,7 @@ async function configureVault(coreConfig, envVars) {
|
|
|
473
480
|
}
|
|
474
481
|
});
|
|
475
482
|
}
|
|
476
|
-
else if (
|
|
483
|
+
else if (vaultConnectorType === VaultConnectorType.Hashicorp) {
|
|
477
484
|
coreConfig.types.vaultConnector.push({
|
|
478
485
|
type: VaultConnectorType.Hashicorp,
|
|
479
486
|
options: {
|
|
@@ -508,7 +515,8 @@ async function configureBackgroundTask(coreConfig, envVars) {
|
|
|
508
515
|
*/
|
|
509
516
|
async function configureEventBus(coreConfig, envVars) {
|
|
510
517
|
coreConfig.types.eventBusConnector ??= [];
|
|
511
|
-
|
|
518
|
+
const eventBusConnectorType = envChoice(envVars, "eventBusConnector", Object.values(EventBusConnectorType));
|
|
519
|
+
if (eventBusConnectorType === EventBusConnectorType.Local) {
|
|
512
520
|
coreConfig.types.eventBusConnector.push({
|
|
513
521
|
type: EventBusConnectorType.Local
|
|
514
522
|
});
|
|
@@ -526,16 +534,16 @@ async function configureEventBus(coreConfig, envVars) {
|
|
|
526
534
|
*/
|
|
527
535
|
async function configureTelemetry(coreConfig, envVars) {
|
|
528
536
|
coreConfig.types.telemetryConnector ??= [];
|
|
529
|
-
const telemetryConnectorTypes =
|
|
537
|
+
const telemetryConnectorTypes = envListToArray(envVars, "telemetryConnector", Object.values(TelemetryConnectorType));
|
|
530
538
|
let additionalConnectorCount = 0;
|
|
531
|
-
for (const
|
|
532
|
-
if (
|
|
539
|
+
for (const telemetryConnectorType of telemetryConnectorTypes) {
|
|
540
|
+
if (telemetryConnectorType === TelemetryConnectorType.Silent) {
|
|
533
541
|
coreConfig.types.telemetryConnector.push({
|
|
534
542
|
type: TelemetryConnectorType.Silent
|
|
535
543
|
});
|
|
536
544
|
additionalConnectorCount++;
|
|
537
545
|
}
|
|
538
|
-
else if (
|
|
546
|
+
else if (telemetryConnectorType === TelemetryConnectorType.EntityStorage) {
|
|
539
547
|
coreConfig.types.telemetryConnector.push({
|
|
540
548
|
type: TelemetryConnectorType.EntityStorage,
|
|
541
549
|
options: {
|
|
@@ -551,7 +559,7 @@ async function configureTelemetry(coreConfig, envVars) {
|
|
|
551
559
|
});
|
|
552
560
|
additionalConnectorCount++;
|
|
553
561
|
}
|
|
554
|
-
else if (
|
|
562
|
+
else if (telemetryConnectorType === TelemetryConnectorType.OpenTelemetry) {
|
|
555
563
|
let readers;
|
|
556
564
|
if (envVars.openTelemetryReader === OpenTelemetryReaderTypes.Prometheus) {
|
|
557
565
|
readers = {
|
|
@@ -614,8 +622,10 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
614
622
|
cloneMode: EngineCloneMode.Never
|
|
615
623
|
});
|
|
616
624
|
coreConfig.types.metricsProducerComponent ??= [];
|
|
617
|
-
const metricsProducers =
|
|
618
|
-
|
|
625
|
+
const metricsProducers = envListToArray(envVars, "telemetryMetricsProducers", Object.values(MetricsProducerComponentType), [
|
|
626
|
+
MetricsProducerComponentType.System,
|
|
627
|
+
MetricsProducerComponentType.Process
|
|
628
|
+
]);
|
|
619
629
|
for (const producerType of metricsProducers) {
|
|
620
630
|
coreConfig.types.metricsProducerComponent.push({
|
|
621
631
|
type: producerType,
|
|
@@ -633,16 +643,16 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
633
643
|
*/
|
|
634
644
|
async function configureTracing(coreConfig, envVars) {
|
|
635
645
|
coreConfig.types.tracingConnector ??= [];
|
|
636
|
-
const tracingConnectorTypes =
|
|
646
|
+
const tracingConnectorTypes = envListToArray(envVars, "tracingConnector", Object.values(TracingConnectorType));
|
|
637
647
|
let additionalConnectorCount = 0;
|
|
638
|
-
for (const
|
|
639
|
-
if (
|
|
648
|
+
for (const tracingConnectorType of tracingConnectorTypes) {
|
|
649
|
+
if (tracingConnectorType === TracingConnectorType.Silent) {
|
|
640
650
|
coreConfig.types.tracingConnector.push({
|
|
641
651
|
type: TracingConnectorType.Silent
|
|
642
652
|
});
|
|
643
653
|
additionalConnectorCount++;
|
|
644
654
|
}
|
|
645
|
-
else if (
|
|
655
|
+
else if (tracingConnectorType === TracingConnectorType.EntityStorage) {
|
|
646
656
|
coreConfig.types.tracingConnector.push({
|
|
647
657
|
type: TracingConnectorType.EntityStorage,
|
|
648
658
|
options: {
|
|
@@ -653,7 +663,13 @@ async function configureTracing(coreConfig, envVars) {
|
|
|
653
663
|
});
|
|
654
664
|
additionalConnectorCount++;
|
|
655
665
|
}
|
|
656
|
-
else if (
|
|
666
|
+
else if (tracingConnectorType === TracingConnectorType.Console) {
|
|
667
|
+
coreConfig.types.tracingConnector.push({
|
|
668
|
+
type: TracingConnectorType.Console
|
|
669
|
+
});
|
|
670
|
+
additionalConnectorCount++;
|
|
671
|
+
}
|
|
672
|
+
else if (tracingConnectorType === TracingConnectorType.OpenTelemetry) {
|
|
657
673
|
const otelTracingConfig = {
|
|
658
674
|
tracerName: envVars.openTelemetryTracingTracerName,
|
|
659
675
|
tracerVersion: envVars.openTelemetryTracingTracerVersion
|
|
@@ -709,15 +725,13 @@ async function configureAutomation(coreConfig, envVars) {
|
|
|
709
725
|
coreConfig.types.automationComponent.push({
|
|
710
726
|
type: AutomationComponentType.Service
|
|
711
727
|
});
|
|
712
|
-
const automationActionTypes =
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
});
|
|
720
|
-
}
|
|
728
|
+
const automationActionTypes = envListToArray(envVars, "automationActionTypes", Object.values(AutomationActionType));
|
|
729
|
+
coreConfig.types.automationAction ??= [];
|
|
730
|
+
for (const actionType of automationActionTypes) {
|
|
731
|
+
coreConfig.types.automationAction.push({
|
|
732
|
+
type: actionType,
|
|
733
|
+
isMultiInstance: true
|
|
734
|
+
});
|
|
721
735
|
}
|
|
722
736
|
}
|
|
723
737
|
}
|
|
@@ -820,69 +834,89 @@ async function configureContextIdHandlers(coreConfig, envVars) {
|
|
|
820
834
|
* @returns A promise that resolves when the messaging configuration has been applied.
|
|
821
835
|
*/
|
|
822
836
|
async function configureMessaging(coreConfig, envVars) {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
837
|
+
coreConfig.types.messagingEmailConnector ??= [];
|
|
838
|
+
coreConfig.types.messagingSmsConnector ??= [];
|
|
839
|
+
coreConfig.types.messagingPushNotificationConnector ??= [];
|
|
840
|
+
const messagingEmailConnectorType = envChoice(envVars, "messagingEmailConnector", Object.values(MessagingEmailConnectorType));
|
|
841
|
+
if (messagingEmailConnectorType === MessagingEmailConnectorType.EntityStorage) {
|
|
842
|
+
coreConfig.types.messagingEmailConnector.push({
|
|
843
|
+
type: MessagingEmailConnectorType.EntityStorage
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
else if (messagingEmailConnectorType === MessagingEmailConnectorType.Aws) {
|
|
847
|
+
coreConfig.types.messagingEmailConnector.push({
|
|
848
|
+
type: MessagingEmailConnectorType.Aws,
|
|
849
|
+
options: {
|
|
850
|
+
config: {
|
|
851
|
+
region: envVars.awsSesRegion ?? "",
|
|
852
|
+
authMode: envVars.awsSesAuthMode,
|
|
853
|
+
accessKeyId: envVars.awsSesAccessKeyId,
|
|
854
|
+
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
855
|
+
endpoint: envVars.awsSesEndpoint
|
|
843
856
|
}
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
authMode: envVars.awsSesAuthMode,
|
|
858
|
-
accessKeyId: envVars.awsSesAccessKeyId,
|
|
859
|
-
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
860
|
-
endpoint: envVars.awsSesEndpoint
|
|
861
|
-
}
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
else if (messagingEmailConnectorType === MessagingEmailConnectorType.Smtp) {
|
|
861
|
+
coreConfig.types.messagingEmailConnector.push({
|
|
862
|
+
type: MessagingEmailConnectorType.Smtp,
|
|
863
|
+
options: {
|
|
864
|
+
config: {
|
|
865
|
+
host: envVars.smtpHost ?? "",
|
|
866
|
+
port: envInteger(envVars, "smtpPort"),
|
|
867
|
+
secure: envBoolean(envVars, "smtpSecure"),
|
|
868
|
+
username: envVars.smtpUsername,
|
|
869
|
+
password: envVars.smtpPassword
|
|
862
870
|
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
const messagingSmsConnectorType = envChoice(envVars, "messagingSmsConnector", Object.values(MessagingSmsConnectorType));
|
|
875
|
+
if (messagingSmsConnectorType === MessagingSmsConnectorType.EntityStorage) {
|
|
876
|
+
coreConfig.types.messagingSmsConnector.push({
|
|
877
|
+
type: MessagingSmsConnectorType.EntityStorage
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
else if (messagingSmsConnectorType === MessagingSmsConnectorType.Aws) {
|
|
881
|
+
coreConfig.types.messagingSmsConnector.push({
|
|
882
|
+
type: MessagingSmsConnectorType.Aws,
|
|
883
|
+
options: {
|
|
884
|
+
config: {
|
|
885
|
+
region: envVars.awsSesRegion ?? "",
|
|
886
|
+
authMode: envVars.awsSesAuthMode,
|
|
887
|
+
accessKeyId: envVars.awsSesAccessKeyId,
|
|
888
|
+
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
889
|
+
endpoint: envVars.awsSesEndpoint
|
|
883
890
|
}
|
|
884
|
-
}
|
|
885
|
-
}
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
const messagingPushConnectorType = envChoice(envVars, "messagingPushNotificationConnector", Object.values(MessagingPushNotificationConnectorType));
|
|
895
|
+
if (messagingPushConnectorType === MessagingPushNotificationConnectorType.EntityStorage) {
|
|
896
|
+
coreConfig.types.messagingPushNotificationConnector.push({
|
|
897
|
+
type: MessagingPushNotificationConnectorType.EntityStorage
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
else if (messagingPushConnectorType === MessagingPushNotificationConnectorType.Aws) {
|
|
901
|
+
coreConfig.types.messagingPushNotificationConnector.push({
|
|
902
|
+
type: MessagingPushNotificationConnectorType.Aws,
|
|
903
|
+
options: {
|
|
904
|
+
config: {
|
|
905
|
+
region: envVars.awsSesRegion ?? "",
|
|
906
|
+
authMode: envVars.awsSesAuthMode,
|
|
907
|
+
accessKeyId: envVars.awsSesAccessKeyId,
|
|
908
|
+
secretAccessKey: envVars.awsSesSecretAccessKey,
|
|
909
|
+
endpoint: envVars.awsSesEndpoint,
|
|
910
|
+
applicationsSettings: envArray(envVars, "awsMessagingPushNotificationApplications", [])
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
// If any messaging connectors are configured, then we should configure the messaging admin and
|
|
916
|
+
// service components as well since they are required for the messaging connectors to work.
|
|
917
|
+
if (coreConfig.types.messagingEmailConnector.length > 0 ||
|
|
918
|
+
coreConfig.types.messagingSmsConnector.length > 0 ||
|
|
919
|
+
coreConfig.types.messagingPushNotificationConnector.length > 0) {
|
|
886
920
|
coreConfig.types.messagingAdminComponent ??= [];
|
|
887
921
|
coreConfig.types.messagingAdminComponent.push({
|
|
888
922
|
type: MessagingAdminComponentType.Service
|
|
@@ -891,6 +925,40 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
891
925
|
coreConfig.types.messagingComponent.push({ type: MessagingComponentType.Service });
|
|
892
926
|
}
|
|
893
927
|
}
|
|
928
|
+
/**
|
|
929
|
+
* Configures mailbox components, mail storage components, and email protocol connectors.
|
|
930
|
+
* @param coreConfig The core config.
|
|
931
|
+
* @param envVars The environment variables.
|
|
932
|
+
* @returns A promise that resolves when the mailbox configuration has been applied.
|
|
933
|
+
*/
|
|
934
|
+
async function configureMailbox(coreConfig, envVars) {
|
|
935
|
+
coreConfig.types.emailProtocolConnector ??= [];
|
|
936
|
+
const emailProtocolConnectorTypes = envListToArray(envVars, "emailProtocolConnector", Object.values(EmailProtocolConnectorType));
|
|
937
|
+
for (const emailProtocolConnectorType of emailProtocolConnectorTypes) {
|
|
938
|
+
coreConfig.types.emailProtocolConnector.push({
|
|
939
|
+
type: emailProtocolConnectorType,
|
|
940
|
+
options: {
|
|
941
|
+
config: {}
|
|
942
|
+
},
|
|
943
|
+
cloneMode: EngineCloneMode.Never,
|
|
944
|
+
isMultiInstance: true
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
// If email protocol connectors are configured, then we should configure the mailbox and mail store
|
|
948
|
+
// components as well, since they are required for the email protocol connectors to work.
|
|
949
|
+
if (coreConfig.types.emailProtocolConnector.length > 0) {
|
|
950
|
+
coreConfig.types.mailStorageComponent ??= [];
|
|
951
|
+
coreConfig.types.mailStorageComponent.push({
|
|
952
|
+
type: MailStorageComponentType.Service,
|
|
953
|
+
cloneMode: EngineCloneMode.Never
|
|
954
|
+
});
|
|
955
|
+
coreConfig.types.mailboxComponent ??= [];
|
|
956
|
+
coreConfig.types.mailboxComponent.push({
|
|
957
|
+
type: MailboxComponentType.Service,
|
|
958
|
+
cloneMode: EngineCloneMode.Never
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
894
962
|
/**
|
|
895
963
|
* Configures the faucet.
|
|
896
964
|
* @param coreConfig The core config.
|
|
@@ -899,12 +967,13 @@ async function configureMessaging(coreConfig, envVars) {
|
|
|
899
967
|
*/
|
|
900
968
|
async function configureFaucet(coreConfig, envVars) {
|
|
901
969
|
coreConfig.types.faucetConnector ??= [];
|
|
902
|
-
|
|
970
|
+
const faucetConnectorType = envChoice(envVars, "faucetConnector", Object.values(FaucetConnectorType));
|
|
971
|
+
if (faucetConnectorType === FaucetConnectorType.EntityStorage) {
|
|
903
972
|
coreConfig.types.faucetConnector.push({
|
|
904
973
|
type: FaucetConnectorType.EntityStorage
|
|
905
974
|
});
|
|
906
975
|
}
|
|
907
|
-
else if (
|
|
976
|
+
else if (faucetConnectorType === FaucetConnectorType.Iota &&
|
|
908
977
|
Is.stringValue(envVars.iotaFaucetEndpoint)) {
|
|
909
978
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
910
979
|
coreConfig.types.faucetConnector.push({
|
|
@@ -927,12 +996,13 @@ async function configureFaucet(coreConfig, envVars) {
|
|
|
927
996
|
*/
|
|
928
997
|
async function configureWallet(coreConfig, envVars) {
|
|
929
998
|
coreConfig.types.walletConnector ??= [];
|
|
930
|
-
|
|
999
|
+
const walletConnectorType = envChoice(envVars, "walletConnector", Object.values(WalletConnectorType));
|
|
1000
|
+
if (walletConnectorType === WalletConnectorType.EntityStorage) {
|
|
931
1001
|
coreConfig.types.walletConnector.push({
|
|
932
1002
|
type: WalletConnectorType.EntityStorage
|
|
933
1003
|
});
|
|
934
1004
|
}
|
|
935
|
-
else if (
|
|
1005
|
+
else if (walletConnectorType === WalletConnectorType.Iota) {
|
|
936
1006
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
937
1007
|
coreConfig.types.walletConnector.push({
|
|
938
1008
|
type: WalletConnectorType.Iota,
|
|
@@ -950,12 +1020,13 @@ async function configureWallet(coreConfig, envVars) {
|
|
|
950
1020
|
*/
|
|
951
1021
|
async function configureNft(coreConfig, envVars) {
|
|
952
1022
|
coreConfig.types.nftConnector ??= [];
|
|
953
|
-
|
|
1023
|
+
const nftConnectorType = envChoice(envVars, "nftConnector", Object.values(NftConnectorType));
|
|
1024
|
+
if (nftConnectorType === NftConnectorType.EntityStorage) {
|
|
954
1025
|
coreConfig.types.nftConnector.push({
|
|
955
1026
|
type: NftConnectorType.EntityStorage
|
|
956
1027
|
});
|
|
957
1028
|
}
|
|
958
|
-
else if (
|
|
1029
|
+
else if (nftConnectorType === NftConnectorType.Iota) {
|
|
959
1030
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
960
1031
|
const config = {
|
|
961
1032
|
...dltConfig?.options?.config,
|
|
@@ -981,12 +1052,13 @@ async function configureNft(coreConfig, envVars) {
|
|
|
981
1052
|
*/
|
|
982
1053
|
async function configureNotarization(coreConfig, envVars) {
|
|
983
1054
|
coreConfig.types.notarizationConnector ??= [];
|
|
984
|
-
|
|
1055
|
+
const notarizationConnectorType = envChoice(envVars, "notarizationConnector", Object.values(NotarizationConnectorType));
|
|
1056
|
+
if (notarizationConnectorType === NotarizationConnectorType.EntityStorage) {
|
|
985
1057
|
coreConfig.types.notarizationConnector.push({
|
|
986
1058
|
type: NotarizationConnectorType.EntityStorage
|
|
987
1059
|
});
|
|
988
1060
|
}
|
|
989
|
-
else if (
|
|
1061
|
+
else if (notarizationConnectorType === NotarizationConnectorType.Iota) {
|
|
990
1062
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
991
1063
|
coreConfig.types.notarizationConnector.push({
|
|
992
1064
|
type: NotarizationConnectorType.Iota,
|
|
@@ -1036,12 +1108,13 @@ async function configureImmutableProof(coreConfig, envVars) {
|
|
|
1036
1108
|
*/
|
|
1037
1109
|
async function configureIdentity(coreConfig, envVars) {
|
|
1038
1110
|
coreConfig.types.identityConnector ??= [];
|
|
1039
|
-
|
|
1111
|
+
const identityConnectorType = envChoice(envVars, "identityConnector", Object.values(IdentityConnectorType));
|
|
1112
|
+
if (identityConnectorType === IdentityConnectorType.EntityStorage) {
|
|
1040
1113
|
coreConfig.types.identityConnector.push({
|
|
1041
1114
|
type: IdentityConnectorType.EntityStorage
|
|
1042
1115
|
});
|
|
1043
1116
|
}
|
|
1044
|
-
else if (
|
|
1117
|
+
else if (identityConnectorType === IdentityConnectorType.Iota) {
|
|
1045
1118
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
1046
1119
|
coreConfig.types.identityConnector.push({
|
|
1047
1120
|
type: IdentityConnectorType.Iota,
|
|
@@ -1074,12 +1147,13 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
1074
1147
|
*/
|
|
1075
1148
|
async function configureIdentityResolver(coreConfig, envVars) {
|
|
1076
1149
|
coreConfig.types.identityResolverConnector ??= [];
|
|
1077
|
-
|
|
1150
|
+
const identityResolverConnectorType = envChoice(envVars, "identityResolverConnector", Object.values(IdentityResolverConnectorType));
|
|
1151
|
+
if (identityResolverConnectorType === IdentityResolverConnectorType.EntityStorage) {
|
|
1078
1152
|
coreConfig.types.identityResolverConnector.push({
|
|
1079
1153
|
type: IdentityResolverConnectorType.EntityStorage
|
|
1080
1154
|
});
|
|
1081
1155
|
}
|
|
1082
|
-
else if (
|
|
1156
|
+
else if (identityResolverConnectorType === IdentityResolverConnectorType.Iota) {
|
|
1083
1157
|
const dltConfig = EngineTypeHelper.getConfigOfType(coreConfig, "dltConfig", DltConfigType.Iota);
|
|
1084
1158
|
coreConfig.types.identityResolverConnector.push({
|
|
1085
1159
|
type: IdentityResolverConnectorType.Iota,
|
|
@@ -1093,7 +1167,7 @@ async function configureIdentityResolver(coreConfig, envVars) {
|
|
|
1093
1167
|
}
|
|
1094
1168
|
});
|
|
1095
1169
|
}
|
|
1096
|
-
else if (
|
|
1170
|
+
else if (identityResolverConnectorType === IdentityResolverConnectorType.Universal) {
|
|
1097
1171
|
coreConfig.types.identityResolverConnector.push({
|
|
1098
1172
|
type: IdentityResolverConnectorType.Universal,
|
|
1099
1173
|
options: {
|
|
@@ -1118,7 +1192,8 @@ async function configureIdentityResolver(coreConfig, envVars) {
|
|
|
1118
1192
|
*/
|
|
1119
1193
|
async function configureIdentityProfile(coreConfig, envVars) {
|
|
1120
1194
|
coreConfig.types.identityProfileConnector ??= [];
|
|
1121
|
-
|
|
1195
|
+
const identityProfileConnectorType = envChoice(envVars, "identityProfileConnector", Object.values(IdentityProfileConnectorType));
|
|
1196
|
+
if (identityProfileConnectorType === IdentityProfileConnectorType.EntityStorage) {
|
|
1122
1197
|
coreConfig.types.identityProfileConnector.push({
|
|
1123
1198
|
type: IdentityProfileConnectorType.EntityStorage
|
|
1124
1199
|
});
|
|
@@ -1136,7 +1211,8 @@ async function configureIdentityProfile(coreConfig, envVars) {
|
|
|
1136
1211
|
*/
|
|
1137
1212
|
async function configureAttestation(coreConfig, envVars) {
|
|
1138
1213
|
coreConfig.types.attestationConnector ??= [];
|
|
1139
|
-
|
|
1214
|
+
const attestationConnectorType = envChoice(envVars, "attestationConnector", Object.values(AttestationConnectorType));
|
|
1215
|
+
if (attestationConnectorType === AttestationConnectorType.Nft) {
|
|
1140
1216
|
coreConfig.types.attestationConnector.push({
|
|
1141
1217
|
type: AttestationConnectorType.Nft
|
|
1142
1218
|
});
|
|
@@ -1198,23 +1274,24 @@ async function configureAuditableItemStream(coreConfig, envVars) {
|
|
|
1198
1274
|
* @returns A promise that resolves when the data processing configuration has been applied.
|
|
1199
1275
|
*/
|
|
1200
1276
|
async function configureDataProcessing(coreConfig, envVars) {
|
|
1201
|
-
|
|
1277
|
+
coreConfig.types.dataConverterConnector ??= [];
|
|
1278
|
+
const converterConnectors = envListToArray(envVars, "dataConverterConnectors", Object.values(DataConverterConnectorType));
|
|
1279
|
+
for (const converterConnector of converterConnectors) {
|
|
1280
|
+
coreConfig.types.dataConverterConnector.push({
|
|
1281
|
+
type: converterConnector
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
coreConfig.types.dataExtractorConnector ??= [];
|
|
1285
|
+
const extractorConnectors = envListToArray(envVars, "dataExtractorConnectors", Object.values(DataExtractorConnectorType));
|
|
1286
|
+
for (const extractorConnector of extractorConnectors) {
|
|
1287
|
+
coreConfig.types.dataExtractorConnector.push({
|
|
1288
|
+
type: extractorConnector
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
if (coreConfig.types.dataConverterConnector.length > 0 ||
|
|
1292
|
+
coreConfig.types.dataExtractorConnector.length > 0) {
|
|
1202
1293
|
coreConfig.types.dataProcessingComponent ??= [];
|
|
1203
1294
|
coreConfig.types.dataProcessingComponent.push({ type: DataProcessingComponentType.Service });
|
|
1204
|
-
coreConfig.types.dataConverterConnector ??= [];
|
|
1205
|
-
const converterConnectors = commaSeparatedListToArray(envVars.dataConverterConnectors);
|
|
1206
|
-
for (const converterConnector of converterConnectors) {
|
|
1207
|
-
coreConfig.types.dataConverterConnector.push({
|
|
1208
|
-
type: converterConnector
|
|
1209
|
-
});
|
|
1210
|
-
}
|
|
1211
|
-
coreConfig.types.dataExtractorConnector ??= [];
|
|
1212
|
-
const extractorConnectors = commaSeparatedListToArray(envVars.dataExtractorConnectors);
|
|
1213
|
-
for (const extractorConnector of extractorConnectors) {
|
|
1214
|
-
coreConfig.types.dataExtractorConnector.push({
|
|
1215
|
-
type: extractorConnector
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
1295
|
}
|
|
1219
1296
|
}
|
|
1220
1297
|
/**
|
|
@@ -1249,7 +1326,7 @@ async function configureTrust(coreConfig, envVars) {
|
|
|
1249
1326
|
type: TrustComponentType.Service
|
|
1250
1327
|
});
|
|
1251
1328
|
coreConfig.types.trustGeneratorComponent ??= [];
|
|
1252
|
-
const trustGeneratorTypes =
|
|
1329
|
+
const trustGeneratorTypes = envListToArray(envVars, "trustGenerators", Object.values(TrustGeneratorComponentType));
|
|
1253
1330
|
for (const trustGeneratorType of trustGeneratorTypes) {
|
|
1254
1331
|
coreConfig.types.trustGeneratorComponent.push({
|
|
1255
1332
|
type: trustGeneratorType,
|
|
@@ -1262,12 +1339,11 @@ async function configureTrust(coreConfig, envVars) {
|
|
|
1262
1339
|
});
|
|
1263
1340
|
}
|
|
1264
1341
|
coreConfig.types.trustVerifierComponent ??= [];
|
|
1265
|
-
const trustVerifierTypes =
|
|
1342
|
+
const trustVerifierTypes = envListToArray(envVars, "trustVerifiers", Object.values(TrustVerifierComponentType));
|
|
1266
1343
|
for (const trustVerifierType of trustVerifierTypes) {
|
|
1267
|
-
|
|
1268
|
-
if (type === TrustVerifierComponentType.IdentityAllowDeny) {
|
|
1344
|
+
if (trustVerifierType === TrustVerifierComponentType.IdentityAllowDeny) {
|
|
1269
1345
|
coreConfig.types.trustVerifierComponent.push({
|
|
1270
|
-
type,
|
|
1346
|
+
type: TrustVerifierComponentType.IdentityAllowDeny,
|
|
1271
1347
|
options: {
|
|
1272
1348
|
config: {
|
|
1273
1349
|
allowIdentities: commaSeparatedListToArray(envVars.trustIdentitiesAllow),
|
|
@@ -1276,9 +1352,9 @@ async function configureTrust(coreConfig, envVars) {
|
|
|
1276
1352
|
}
|
|
1277
1353
|
});
|
|
1278
1354
|
}
|
|
1279
|
-
else {
|
|
1355
|
+
else if (trustVerifierType === TrustVerifierComponentType.JwtVerifiableCredential) {
|
|
1280
1356
|
coreConfig.types.trustVerifierComponent.push({
|
|
1281
|
-
type
|
|
1357
|
+
type: TrustVerifierComponentType.JwtVerifiableCredential
|
|
1282
1358
|
});
|
|
1283
1359
|
}
|
|
1284
1360
|
}
|
|
@@ -1356,49 +1432,49 @@ async function configureRightsManagement(coreConfig, envVars) {
|
|
|
1356
1432
|
}
|
|
1357
1433
|
});
|
|
1358
1434
|
coreConfig.types.rightsManagementPolicyArbiterComponent ??= [];
|
|
1359
|
-
const policyArbiterTypes =
|
|
1435
|
+
const policyArbiterTypes = envListToArray(envVars, "rightsManagementPolicyArbiters", Object.values(RightsManagementPolicyArbiterComponentType));
|
|
1360
1436
|
for (const policyArbiterType of policyArbiterTypes) {
|
|
1361
1437
|
coreConfig.types.rightsManagementPolicyArbiterComponent.push({
|
|
1362
1438
|
type: policyArbiterType
|
|
1363
1439
|
});
|
|
1364
1440
|
}
|
|
1365
1441
|
coreConfig.types.rightsManagementPolicyObligationEnforcerComponent ??= [];
|
|
1366
|
-
const policyObligationEnforcerTypes =
|
|
1442
|
+
const policyObligationEnforcerTypes = envListToArray(envVars, "rightsManagementPolicyObligationEnforcers", Object.values(RightsManagementPolicyObligationEnforcerComponentType));
|
|
1367
1443
|
for (const policyObligationEnforcerType of policyObligationEnforcerTypes) {
|
|
1368
1444
|
coreConfig.types.rightsManagementPolicyObligationEnforcerComponent.push({
|
|
1369
1445
|
type: policyObligationEnforcerType
|
|
1370
1446
|
});
|
|
1371
1447
|
}
|
|
1372
1448
|
coreConfig.types.rightsManagementPolicyEnforcementProcessorComponent ??= [];
|
|
1373
|
-
const policyEnforcementProcessTypes =
|
|
1449
|
+
const policyEnforcementProcessTypes = envListToArray(envVars, "rightsManagementPolicyEnforcementProcessors", Object.values(RightsManagementPolicyEnforcementProcessorComponentType));
|
|
1374
1450
|
for (const policyEnforcementProcessorType of policyEnforcementProcessTypes) {
|
|
1375
1451
|
coreConfig.types.rightsManagementPolicyEnforcementProcessorComponent.push({
|
|
1376
1452
|
type: policyEnforcementProcessorType
|
|
1377
1453
|
});
|
|
1378
1454
|
}
|
|
1379
1455
|
coreConfig.types.rightsManagementPolicyExecutionActionComponent ??= [];
|
|
1380
|
-
const policyExecutionActionTypes =
|
|
1456
|
+
const policyExecutionActionTypes = envListToArray(envVars, "rightsManagementPolicyExecutionActions", Object.values(RightsManagementPolicyExecutionActionComponentType));
|
|
1381
1457
|
for (const policyExecutionActionType of policyExecutionActionTypes) {
|
|
1382
1458
|
coreConfig.types.rightsManagementPolicyExecutionActionComponent.push({
|
|
1383
1459
|
type: policyExecutionActionType
|
|
1384
1460
|
});
|
|
1385
1461
|
}
|
|
1386
1462
|
coreConfig.types.rightsManagementPolicyInformationSourceComponent ??= [];
|
|
1387
|
-
const policyInformationSourceTypes =
|
|
1463
|
+
const policyInformationSourceTypes = envListToArray(envVars, "rightsManagementPolicyInformationSources", Object.values(RightsManagementPolicyInformationSourceComponentType));
|
|
1388
1464
|
for (const policyInformationSourceType of policyInformationSourceTypes) {
|
|
1389
1465
|
coreConfig.types.rightsManagementPolicyInformationSourceComponent.push({
|
|
1390
1466
|
type: policyInformationSourceType
|
|
1391
1467
|
});
|
|
1392
1468
|
}
|
|
1393
1469
|
coreConfig.types.rightsManagementPolicyRequesterComponent ??= [];
|
|
1394
|
-
const policyRequesterTypes =
|
|
1470
|
+
const policyRequesterTypes = envListToArray(envVars, "rightsManagementPolicyRequesters", Object.values(RightsManagementPolicyRequesterComponentType));
|
|
1395
1471
|
for (const policyRequesterType of policyRequesterTypes) {
|
|
1396
1472
|
coreConfig.types.rightsManagementPolicyRequesterComponent.push({
|
|
1397
1473
|
type: policyRequesterType
|
|
1398
1474
|
});
|
|
1399
1475
|
}
|
|
1400
1476
|
coreConfig.types.rightsManagementPolicyNegotiatorComponent ??= [];
|
|
1401
|
-
const policyNegotiatorTypes =
|
|
1477
|
+
const policyNegotiatorTypes = envListToArray(envVars, "rightsManagementPolicyNegotiators", Object.values(RightsManagementPolicyNegotiatorComponentType));
|
|
1402
1478
|
for (const policyNegotiatorType of policyNegotiatorTypes) {
|
|
1403
1479
|
coreConfig.types.rightsManagementPolicyNegotiatorComponent.push({
|
|
1404
1480
|
type: policyNegotiatorType
|
|
@@ -1448,7 +1524,7 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
|
|
|
1448
1524
|
}
|
|
1449
1525
|
});
|
|
1450
1526
|
coreConfig.types.federatedCatalogueFilterComponent ??= [];
|
|
1451
|
-
const filters =
|
|
1527
|
+
const filters = envListToArray(envVars, "federatedCatalogueFilters", Object.values(FederatedCatalogueFilterComponentType));
|
|
1452
1528
|
for (const filter of filters) {
|
|
1453
1529
|
coreConfig.types.federatedCatalogueFilterComponent.push({
|
|
1454
1530
|
type: filter,
|
|
@@ -1571,7 +1647,8 @@ export function isTrustRequired(envVars) {
|
|
|
1571
1647
|
export function isBackgroundTasksRequired(envVars) {
|
|
1572
1648
|
return (envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1573
1649
|
isImmutableProofRequired(envVars) ||
|
|
1574
|
-
envBoolean(envVars, "healthEnabled", false)
|
|
1650
|
+
envBoolean(envVars, "healthEnabled", false) ||
|
|
1651
|
+
commaSeparatedListToArray(envVars.telemetryConnector).includes(TelemetryConnectorType.EntityStorage));
|
|
1575
1652
|
}
|
|
1576
1653
|
/**
|
|
1577
1654
|
* Checks if the immutable proof subsystem is required.
|
|
@@ -1619,7 +1696,8 @@ export function isTaskSchedulerRequired(envVars) {
|
|
|
1619
1696
|
envBoolean(envVars, "dataspaceEnabled", false) ||
|
|
1620
1697
|
isRightsManagementRequired(envVars) ||
|
|
1621
1698
|
isAuthEntityStorageRequired(envVars) ||
|
|
1622
|
-
isImmutableProofRequired(envVars)
|
|
1699
|
+
isImmutableProofRequired(envVars) ||
|
|
1700
|
+
isMailboxEnabled(envVars));
|
|
1623
1701
|
}
|
|
1624
1702
|
/**
|
|
1625
1703
|
* Checks if the automation subsystem is required.
|
|
@@ -1646,6 +1724,17 @@ export function isTelemetryEnabled(envVars) {
|
|
|
1646
1724
|
* @returns True if tracing is enabled.
|
|
1647
1725
|
*/
|
|
1648
1726
|
export function isTracingEnabled(envVars) {
|
|
1649
|
-
return commaSeparatedListToArray(envVars.tracingConnector).some(t => t === TracingConnectorType.EntityStorage ||
|
|
1727
|
+
return commaSeparatedListToArray(envVars.tracingConnector).some(t => t === TracingConnectorType.EntityStorage ||
|
|
1728
|
+
t === TracingConnectorType.OpenTelemetry ||
|
|
1729
|
+
t === TracingConnectorType.Console);
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* Checks if the mailbox subsystem is enabled.
|
|
1733
|
+
* Returns true when any component that depends on the mailbox subsystem is enabled.
|
|
1734
|
+
* @param envVars The environment variables.
|
|
1735
|
+
* @returns True if mailbox is enabled.
|
|
1736
|
+
*/
|
|
1737
|
+
export function isMailboxEnabled(envVars) {
|
|
1738
|
+
return commaSeparatedListToArray(envVars.emailProtocolConnector).some(t => t === EmailProtocolConnectorType.Imap || t === EmailProtocolConnectorType.Pop3);
|
|
1650
1739
|
}
|
|
1651
1740
|
//# sourceMappingURL=engineEnvBuilder.js.map
|