@twin.org/node-core 0.9.1-next.1 → 0.9.1-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/builders/engineEnvBuilder.js +52 -7
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/cli.js +41 -12
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/bootstrapLegacy.js +1 -1
- package/dist/es/commands/bootstrapLegacy.js.map +1 -1
- package/dist/es/commands/help.js +10 -1
- package/dist/es/commands/help.js.map +1 -1
- package/dist/es/commands/identityCreate.js +3 -3
- package/dist/es/commands/identityCreate.js.map +1 -1
- package/dist/es/commands/identityList.js +65 -0
- package/dist/es/commands/identityList.js.map +1 -0
- package/dist/es/commands/identityResolve.js +83 -0
- package/dist/es/commands/identityResolve.js.map +1 -0
- package/dist/es/commands/nodeIdentityGet.js +68 -0
- package/dist/es/commands/nodeIdentityGet.js.map +1 -0
- package/dist/es/commands/{nodeSetIdentity.js → nodeIdentitySet.js} +16 -15
- package/dist/es/commands/nodeIdentitySet.js.map +1 -0
- package/dist/es/commands/nodeOrgIdGet.js +55 -0
- package/dist/es/commands/nodeOrgIdGet.js.map +1 -0
- package/dist/es/commands/{setNodeOrgId.js → nodeOrgIdSet.js} +15 -13
- package/dist/es/commands/nodeOrgIdSet.js.map +1 -0
- package/dist/es/commands/orgUsersList.js +94 -0
- package/dist/es/commands/orgUsersList.js.map +1 -0
- package/dist/es/commands/tenantGet.js +68 -0
- package/dist/es/commands/tenantGet.js.map +1 -0
- package/dist/es/commands/tenantList.js +69 -0
- package/dist/es/commands/tenantList.js.map +1 -0
- package/dist/es/commands/tenantListByOrg.js +80 -0
- package/dist/es/commands/tenantListByOrg.js.map +1 -0
- package/dist/es/commands/{setTenantOrgId.js → tenantOrgIdSet.js} +16 -15
- package/dist/es/commands/tenantOrgIdSet.js.map +1 -0
- package/dist/es/commands/userGet.js +77 -0
- package/dist/es/commands/userGet.js.map +1 -0
- package/dist/es/models/ICliCommandDefinition.js.map +1 -1
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/engineEnvironmentVariableKeys.js +13 -0
- package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
- package/dist/es/node.js +4 -35
- package/dist/es/node.js.map +1 -1
- package/dist/types/commands/identityList.d.ts +17 -0
- package/dist/types/commands/identityResolve.d.ts +24 -0
- package/dist/types/commands/nodeIdentityGet.d.ts +20 -0
- package/dist/types/commands/{nodeSetIdentity.d.ts → nodeIdentitySet.d.ts} +2 -2
- package/dist/types/commands/nodeOrgIdGet.d.ts +19 -0
- package/dist/types/commands/{setNodeOrgId.d.ts → nodeOrgIdSet.d.ts} +2 -2
- package/dist/types/commands/orgUsersList.d.ts +27 -0
- package/dist/types/commands/tenantGet.d.ts +22 -0
- package/dist/types/commands/tenantList.d.ts +22 -0
- package/dist/types/commands/tenantListByOrg.d.ts +22 -0
- package/dist/types/commands/{setTenantOrgId.d.ts → tenantOrgIdSet.d.ts} +2 -2
- package/dist/types/commands/userGet.d.ts +24 -0
- package/dist/types/models/ICliCommandDefinition.d.ts +8 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +73 -5
- package/docs/changelog.md +72 -0
- package/docs/reference/interfaces/ICliCommandDefinition.md +16 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +145 -5
- package/locales/en.json +229 -14
- package/package.json +2 -3
- package/dist/es/commands/nodeSetIdentity.js.map +0 -1
- package/dist/es/commands/setNodeOrgId.js.map +0 -1
- package/dist/es/commands/setTenantOrgId.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { Coerce, Is, Mutex } from "@twin.org/core";
|
|
5
|
-
import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
|
|
5
|
+
import { AttestationComponentType, AttestationConnectorType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, AutomationComponentType, BackgroundTaskComponentType, BlobStorageComponentType, BlobStorageConnectorType, ContextIdHandlerComponentType, DataProcessingComponentType, DataspaceControlPlaneComponentType, DataspaceDataPlaneComponentType, DltConfigType, DocumentManagementComponentType, EngineTypeHelper, EntityStorageConnectorType, EventBusComponentType, EventBusConnectorType, FaucetConnectorType, FederatedCatalogueComponentType, HealthComponentType, IdentityComponentType, IdentityConnectorType, IdentityProfileComponentType, IdentityProfileConnectorType, IdentityResolverComponentType, IdentityResolverConnectorType, ImmutableProofComponentType, LoggingComponentType, LoggingConnectorType, MessagingAdminComponentType, MessagingComponentType, MessagingEmailConnectorType, MessagingPushNotificationConnectorType, MessagingSmsConnectorType, MetricsCollectorComponentType, MetricsProducerComponentType, NftComponentType, NftConnectorType, NotarizationComponentType, NotarizationConnectorType, PlatformComponentType, RightsManagementPapComponentType, RightsManagementPdpComponentType, RightsManagementPepComponentType, RightsManagementPipComponentType, RightsManagementPmpComponentType, RightsManagementPnapComponentType, RightsManagementPnpComponentType, RightsManagementPxpComponentType, SchemaVersionMigrationComponentType, TaskSchedulerComponentType, TelemetryComponentType, TelemetryConnectorType, TenantAdminComponentType, TrustComponentType, TrustVerifierComponentType, VaultConnectorType, WalletConnectorType } from "@twin.org/engine-types";
|
|
6
6
|
import { OpenTelemetryExporterTypes } from "@twin.org/logging-connector-opentelemetry";
|
|
7
7
|
import { OpenTelemetryReaderTypes } from "@twin.org/telemetry-connector-opentelemetry";
|
|
8
8
|
import { CONTEXT_ID_HANDLER_FEATURE_DID, CONTEXT_ID_HANDLER_FEATURE_TENANT } from "../defaults.js";
|
|
@@ -28,6 +28,7 @@ export async function buildEngineConfiguration(envVars) {
|
|
|
28
28
|
if (!Is.empty(mutexTimeoutMs)) {
|
|
29
29
|
Mutex.setDefaultTimeoutMs(mutexTimeoutMs);
|
|
30
30
|
}
|
|
31
|
+
await configureSchemaMigration(coreConfig, envVars);
|
|
31
32
|
await configurePlatform(coreConfig, envVars);
|
|
32
33
|
await configureTenant(coreConfig, envVars);
|
|
33
34
|
await configureContextIdHandlers(coreConfig, envVars);
|
|
@@ -343,6 +344,10 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
343
344
|
config: {
|
|
344
345
|
batchSize: Coerce.integer(envVars.loggingBatchSize),
|
|
345
346
|
batchIntervalMs: (Coerce.integer(envVars.loggingBatchFlushInterval) ?? 5) * 1000,
|
|
347
|
+
retainForMs: Coerce.integer(envVars.loggingRetainForMs),
|
|
348
|
+
maxEntries: Coerce.integer(envVars.loggingMaxEntries),
|
|
349
|
+
retentionIntervalMs: Coerce.integer(envVars.loggingRetentionIntervalMs),
|
|
350
|
+
retentionBatchSize: Coerce.integer(envVars.loggingRetentionBatchSize),
|
|
346
351
|
mutexTimeoutMs: Coerce.integer(envVars.loggingMutexTimeout)
|
|
347
352
|
}
|
|
348
353
|
}
|
|
@@ -372,6 +377,21 @@ async function configureLogging(coreConfig, envVars) {
|
|
|
372
377
|
});
|
|
373
378
|
additionalConnectorCount++;
|
|
374
379
|
}
|
|
380
|
+
else if (loggingConnector === LoggingConnectorType.File) {
|
|
381
|
+
coreConfig.types.loggingConnector.push({
|
|
382
|
+
type: LoggingConnectorType.File,
|
|
383
|
+
options: {
|
|
384
|
+
config: {
|
|
385
|
+
directory: envVars.loggingFileDirectory ?? envVars.storageFileRoot ?? "",
|
|
386
|
+
filename: envVars.loggingFileFilename,
|
|
387
|
+
maxFileSizeBytes: Coerce.integer(envVars.loggingFileMaxFileSizeBytes),
|
|
388
|
+
maxRetainedFiles: Coerce.integer(envVars.loggingFileMaxRetainedFiles),
|
|
389
|
+
mutexTimeoutMs: Coerce.integer(envVars.loggingMutexTimeout)
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
additionalConnectorCount++;
|
|
394
|
+
}
|
|
375
395
|
}
|
|
376
396
|
// If more than one logging connector, then we need to add a multi connector
|
|
377
397
|
// and set it as the default one
|
|
@@ -510,7 +530,8 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
510
530
|
coreConfig.types.metricsCollectorComponent ??= [];
|
|
511
531
|
coreConfig.types.metricsCollectorComponent.push({
|
|
512
532
|
type: MetricsCollectorComponentType.Service,
|
|
513
|
-
options: { config: { intervalMs: intervalSec * 1000 } }
|
|
533
|
+
options: { config: { intervalMs: intervalSec * 1000 } },
|
|
534
|
+
isCloneable: false
|
|
514
535
|
});
|
|
515
536
|
const maxHistory = Coerce.integer(envVars.telemetryMetricsProducerMaxHistory) ?? 1440;
|
|
516
537
|
coreConfig.types.metricsProducerComponent ??= [];
|
|
@@ -519,7 +540,8 @@ async function configureMetricsCollector(coreConfig, envVars) {
|
|
|
519
540
|
for (const producerType of metricsProducers) {
|
|
520
541
|
coreConfig.types.metricsProducerComponent.push({
|
|
521
542
|
type: producerType,
|
|
522
|
-
options: { maxHistory }
|
|
543
|
+
options: { maxHistory },
|
|
544
|
+
isCloneable: false
|
|
523
545
|
});
|
|
524
546
|
}
|
|
525
547
|
}
|
|
@@ -564,7 +586,24 @@ async function configureHealth(coreConfig, envVars) {
|
|
|
564
586
|
healthCheckInterval: (Coerce.integer(envVars.healthInterval) ?? 60) * 1000,
|
|
565
587
|
initialInterval: (Coerce.integer(envVars.healthStartupInterval) ?? 2) * 1000
|
|
566
588
|
}
|
|
567
|
-
}
|
|
589
|
+
},
|
|
590
|
+
isCloneable: false
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Configures the schema migration.
|
|
596
|
+
* @param coreConfig The core config.
|
|
597
|
+
* @param envVars The environment variables.
|
|
598
|
+
* @returns A promise that resolves when the schema migration configuration has been applied.
|
|
599
|
+
*/
|
|
600
|
+
async function configureSchemaMigration(coreConfig, envVars) {
|
|
601
|
+
const isSchemaMigrationEnabled = Coerce.boolean(envVars.schemaMigrationEnabled) ?? true;
|
|
602
|
+
if (isSchemaMigrationEnabled) {
|
|
603
|
+
coreConfig.types.schemaVersionMigrationComponent ??= [];
|
|
604
|
+
coreConfig.types.schemaVersionMigrationComponent.push({
|
|
605
|
+
type: SchemaVersionMigrationComponentType.Service,
|
|
606
|
+
isCloneable: false
|
|
568
607
|
});
|
|
569
608
|
}
|
|
570
609
|
}
|
|
@@ -858,7 +897,8 @@ async function configureIdentity(coreConfig, envVars) {
|
|
|
858
897
|
identityPkgId: Is.stringValue(envVars.iotaIdentityPackageId)
|
|
859
898
|
? envVars.iotaIdentityPackageId
|
|
860
899
|
: undefined,
|
|
861
|
-
walletAddressIndex: Coerce.integer(envVars.identityWalletAddressIndex) ?? 0
|
|
900
|
+
walletAddressIndex: Coerce.integer(envVars.identityWalletAddressIndex) ?? 0,
|
|
901
|
+
didResolutionCacheTtlMs: Coerce.integer(envVars.identityDidResolutionCacheTtlMs)
|
|
862
902
|
}
|
|
863
903
|
}
|
|
864
904
|
});
|
|
@@ -1235,7 +1275,8 @@ async function configureFederatedCatalogue(coreConfig, envVars) {
|
|
|
1235
1275
|
coreConfig.types.federatedCatalogueComponent.push({
|
|
1236
1276
|
type: FederatedCatalogueComponentType.RestClient,
|
|
1237
1277
|
options: {
|
|
1238
|
-
endpoint: envVars.federatedCatalogueRemoteEndpoint
|
|
1278
|
+
endpoint: envVars.federatedCatalogueRemoteEndpoint,
|
|
1279
|
+
pathPrefix: envVars.federatedCatalogueRestClientPathPrefix ?? "federated-catalogue"
|
|
1239
1280
|
}
|
|
1240
1281
|
});
|
|
1241
1282
|
}
|
|
@@ -1286,6 +1327,8 @@ async function configureDataspace(coreConfig, envVars) {
|
|
|
1286
1327
|
// Must match the control-plane REST mount, as it is combined with the public origin
|
|
1287
1328
|
// to build the consumer's advertised callback address;
|
|
1288
1329
|
callbackPath: envVars.dataspaceCallbackPath ?? "dataspace-control-plane",
|
|
1330
|
+
// Base mount path of the data plane only; the transfer handlers append the
|
|
1331
|
+
// sub-paths themselves (`/entities` for PULL, `/inbox` for PUSH).
|
|
1289
1332
|
dataPlanePath: envVars.dataspaceDataPlanePath,
|
|
1290
1333
|
autoStartTransfers: Coerce.boolean(envVars.dataspaceAutoStartTransfers),
|
|
1291
1334
|
stalledNegotiationTimeoutMs: !Is.empty(stalledNegotiationTimeout)
|
|
@@ -1343,7 +1386,9 @@ async function configureDlt(coreConfig, envVars) {
|
|
|
1343
1386
|
},
|
|
1344
1387
|
network: envVars.iotaNetwork ?? "",
|
|
1345
1388
|
coinType: Coerce.integer(envVars.iotaCoinType),
|
|
1346
|
-
gasStation: gasStationConfig
|
|
1389
|
+
gasStation: gasStationConfig,
|
|
1390
|
+
gasBudget: Coerce.integer(envVars.iotaGasBudget),
|
|
1391
|
+
gasReservationDuration: Coerce.integer(envVars.iotaGasReservationDuration)
|
|
1347
1392
|
}
|
|
1348
1393
|
}
|
|
1349
1394
|
});
|