@twin.org/node-core 0.9.2-next.1 → 0.9.2-next.3

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.
Files changed (38) hide show
  1. package/dist/es/builders/engineEnvBuilder.js +11 -2
  2. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  3. package/dist/es/cli.js +2 -2
  4. package/dist/es/cli.js.map +1 -1
  5. package/dist/es/commands/{bootstrapLegacy.js → bootstrapDev.js} +25 -24
  6. package/dist/es/commands/bootstrapDev.js.map +1 -0
  7. package/dist/es/index.js +1 -1
  8. package/dist/es/index.js.map +1 -1
  9. package/dist/es/models/{IBootstrapLegacyEnvironmentVariables.js → IBootstrapDevEnvironmentVariables.js} +1 -1
  10. package/dist/es/models/IBootstrapDevEnvironmentVariables.js.map +1 -0
  11. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  12. package/dist/es/models/IEnvironmentVariables.js.map +1 -1
  13. package/dist/es/models/{bootstrapLegacyEnvironmentVariableKeys.js → bootstrapDevEnvironmentVariableKeys.js} +6 -6
  14. package/dist/es/models/bootstrapDevEnvironmentVariableKeys.js.map +1 -0
  15. package/dist/es/models/engineEnvironmentVariableKeys.js +4 -0
  16. package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
  17. package/dist/es/node.js +3 -3
  18. package/dist/es/node.js.map +1 -1
  19. package/dist/types/commands/{bootstrapLegacy.d.ts → bootstrapDev.d.ts} +3 -3
  20. package/dist/types/index.d.ts +1 -1
  21. package/dist/types/models/{IBootstrapLegacyEnvironmentVariables.d.ts → IBootstrapDevEnvironmentVariables.d.ts} +2 -2
  22. package/dist/types/models/IEngineEnvironmentVariables.d.ts +20 -0
  23. package/dist/types/models/IEnvironmentVariables.d.ts +2 -2
  24. package/dist/types/models/bootstrapDevEnvironmentVariableKeys.d.ts +4 -0
  25. package/docs/changelog.md +14 -0
  26. package/docs/reference/functions/buildConfiguration.md +2 -2
  27. package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
  28. package/docs/reference/functions/start.md +1 -1
  29. package/docs/reference/index.md +1 -1
  30. package/docs/reference/interfaces/{IBootstrapLegacyEnvironmentVariables.md → IBootstrapDevEnvironmentVariables.md} +2 -2
  31. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +51 -0
  32. package/docs/reference/type-aliases/IEnvironmentVariables.md +1 -1
  33. package/locales/en.json +5 -5
  34. package/package.json +1 -1
  35. package/dist/es/commands/bootstrapLegacy.js.map +0 -1
  36. package/dist/es/models/IBootstrapLegacyEnvironmentVariables.js.map +0 -1
  37. package/dist/es/models/bootstrapLegacyEnvironmentVariableKeys.js.map +0 -1
  38. package/dist/types/models/bootstrapLegacyEnvironmentVariableKeys.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"engineEnvironmentVariableKeys.js","sourceRoot":"","sources":["../../../src/models/engineEnvironmentVariableKeys.ts"],"names":[],"mappings":"AAIA,qEAAqE;AACrE,0EAA0E;AAC1E,4DAA4D;AAC5D,+FAA+F;AAC/F,MAAM,qCAAqC,GAEvC;IACH,SAAS;IACT,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,iBAAiB;IACjB,0BAA0B,EAAE,IAAI;IAChC,6BAA6B,EAAE,IAAI;IACnC,wBAAwB,EAAE,IAAI;IAC9B,+BAA+B,EAAE,IAAI;IACrC,6BAA6B,EAAE,IAAI;IACnC,eAAe;IACf,mBAAmB,EAAE,IAAI;IACzB,sBAAsB,EAAE,IAAI;IAC5B,0BAA0B,EAAE,IAAI;IAChC,iBAAiB,EAAE,IAAI;IACvB,mBAAmB,EAAE,IAAI;IACzB,4BAA4B,EAAE,IAAI;IAClC,kBAAkB;IAClB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AE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,yBAAyB,EAAE,IAAI;IAC/B,WAAW,EAAE,IAAI;IACjB,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;IACzB,oBAAoB;IACpB,4BAA4B,EAAE,IAAI;IAClC,wCAAwC,EAAE,IAAI;IAC9C,iCAAiC,EAAE,IAAI;IACvC,gCAAgC,EAAE,IAAI;IACtC,sCAAsC,EAAE,IAAI;IAC5C,2CAA2C,EAAE,IAAI;IACjD,8BAA8B,EAAE,IAAI;IACpC,yCAAyC,EAAE,IAAI;IAC/C,4BAA4B,EAAE,IAAI;IAClC,YAAY;IACZ,gBAAgB,EAAE,IAAI;IACtB,8BAA8B,EAAE,IAAI;IACpC,oCAAoC,EAAE,IAAI;IAC1C,sBAAsB,EAAE,IAAI;IAC5B,2BAA2B,EAAE,IAAI;IACjC,kCAAkC,EAAE,IAAI;IACxC,+BAA+B,EAAE,IAAI;IACrC,qBAAqB,EAAE,IAAI;IAC3B,SAAS;IACT,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,qBAAqB,EAAE,IAAI;IAC3B,qBAAqB;IACrB,qBAAqB,EAAE,IAAI;IAC3B,qBAAqB,EAAE,IAAI;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB,IAAI,GAAG,CAC3E,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAClD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEngineEnvironmentVariables } from \"./IEngineEnvironmentVariables.js\";\n\n// Mapped type exhaustiveness check: TypeScript requires every key of\n// Required<IEngineEnvironmentVariables> to appear here with value `true`.\n// Removing a key → compile error (\"Property X is missing\").\n// Adding an invented key → compile error (\"Object literal may only specify known properties\").\nconst engineEnvironmentVariableKeysInternal: {\n\t[K in keyof Required<IEngineEnvironmentVariables>]: true;\n} = {\n\t// global\n\tdebug: true,\n\tsilent: true,\n\tstrictEnv: true,\n\tenvAllowList: true,\n\tstorageFileRoot: true,\n\tstateFilename: true,\n\ttenantEnabled: true,\n\tschemaMigrationEnabled: true,\n\textensions: true,\n\t// entity storage\n\tentityStorageConnectorType: true,\n\tentityStorageConnectorDefault: true,\n\tentityStorageTablePrefix: true,\n\tentityStorageMemoryMutexTimeout: true,\n\tentityStorageFileMutexTimeout: true,\n\t// AWS DynamoDB\n\tawsDynamodbAuthMode: true,\n\tawsDynamodbAccessKeyId: true,\n\tawsDynamodbSecretAccessKey: true,\n\tawsDynamodbRegion: true,\n\tawsDynamodbEndpoint: true,\n\tawsDynamodbConnectionTimeout: true,\n\t// Azure Cosmos DB\n\tazureCosmosdbKey: true,\n\tazureCosmosdbContainerId: true,\n\tazureCosmosdbDatabaseId: true,\n\tazureCosmosdbEndpoint: true,\n\t// GCP Firestore\n\tgcpFirestoreCollectionName: true,\n\tgcpFirestoreCredentials: true,\n\tgcpFirestoreDatabaseId: true,\n\tgcpFirestoreEndpoint: true,\n\tgcpFirestoreProjectId: true,\n\t// ScyllaDB\n\tscylladbHosts: true,\n\tscylladbKeyspace: true,\n\tscylladbLocalDataCenter: true,\n\tscylladbPort: true,\n\t// MySQL\n\tmySqlHost: true,\n\tmySqlPort: true,\n\tmySqlUser: true,\n\tmySqlPassword: true,\n\tmySqlDatabase: true,\n\t// MongoDB\n\tmongoDbHost: true,\n\tmongoDbPort: true,\n\tmongoDbUser: true,\n\tmongoDbPassword: true,\n\tmongoDbDatabase: true,\n\t// PostgreSQL\n\tpostgreSqlHost: true,\n\tpostgreSqlPort: true,\n\tpostgreSqlUser: true,\n\tpostgreSqlPassword: true,\n\tpostgreSqlDatabase: true,\n\t// IPFS\n\tipfsBearerToken: true,\n\tipfsApiUrl: true,\n\t// blob storage\n\tblobStorageConnectorType: true,\n\tblobStorageConnectorDefault: true,\n\tblobStorageEnableEncryption: true,\n\tblobStorageEncryptionKeyId: true,\n\tblobStoragePrefix: true,\n\t// AWS S3\n\tawsS3Region: true,\n\tawsS3BucketName: true,\n\tawsS3AuthMode: true,\n\tawsS3AccessKeyId: true,\n\tawsS3SecretAccessKey: true,\n\tawsS3Endpoint: true,\n\t// Azure Storage\n\tazureStorageAccountKey: true,\n\tazureStorageAccountName: true,\n\tazureStorageContainerName: true,\n\tazureStorageEndpoint: true,\n\t// GCP Storage\n\tgcpStorageBucketName: true,\n\tgcpStorageCredentials: true,\n\tgcpStorageEndpoint: true,\n\tgcpStorageProjectId: true,\n\t// vault\n\tvaultConnector: true,\n\tvaultPrefix: true,\n\thashicorpVaultToken: true,\n\thashicorpVaultEndpoint: true,\n\t// logging\n\tloggingConnector: true,\n\tloggingBatchSize: true,\n\tloggingBatchFlushInterval: true,\n\tloggingRetainFor: true,\n\tloggingMaxEntries: true,\n\tloggingRetentionInterval: true,\n\tloggingRetentionBatchSize: true,\n\tloggingSilentComponents: true,\n\tloggingFileDirectory: true,\n\tloggingFileFilename: true,\n\tloggingFileMaxFileSizeBytes: true,\n\tloggingFileMaxRetainedFiles: true,\n\tloggingMutexTimeout: true,\n\t// open telemetry logging\n\topenTelemetryLoggingLoggerName: true,\n\topenTelemetryLoggingLoggerVersion: true,\n\topenTelemetryLoggingPrometheusEndpoint: true,\n\topenTelemetryLoggingProcessor: true,\n\t// event bus\n\teventBusConnector: true,\n\teventBusComponent: true,\n\t// messaging\n\tmessagingEnabled: true,\n\tmessagingEmailConnector: true,\n\tmessagingSmsConnector: true,\n\tmessagingPushNotificationConnector: true,\n\t// AWS SES\n\tawsSesRegion: true,\n\tawsSesAuthMode: true,\n\tawsSesSecretAccessKey: true,\n\tawsSesAccessKeyId: true,\n\tawsSesEndpoint: true,\n\tawsMessagingPushNotificationApplications: true,\n\t// telemetry\n\ttelemetryConnector: true,\n\topenTelemetryMeterName: true,\n\topenTelemetryMeterVersion: true,\n\topenTelemetryReader: true,\n\topenTelemetryPrometheusPort: true,\n\ttelemetryMetricsCollectorInterval: true,\n\ttelemetryMetricsProducers: true,\n\ttelemetryMetricsProducerMaxHistory: true,\n\t// DLT / identity\n\tfaucetConnector: true,\n\twalletConnector: true,\n\tnftConnector: true,\n\tnftPackageId: true,\n\tnotarizationConnector: true,\n\tidentityConnector: true,\n\tidentityWalletAddressIndex: true,\n\tidentityDidResolutionCacheTtlMs: true,\n\tidentityResolverConnector: true,\n\tidentityProfileConnector: true,\n\tuniversalResolverEndpoint: true,\n\t// IOTA\n\tiotaFaucetEndpoint: true,\n\tiotaNodeEndpoint: true,\n\tiotaNetwork: true,\n\tiotaCoinType: true,\n\tiotaGasBudget: true,\n\tiotaGasReservationDuration: true,\n\tiotaExplorerEndpoint: true,\n\tiotaGasStationEndpoint: true,\n\tiotaGasStationAuthToken: true,\n\tiotaIdentityPackageId: true,\n\t// attestation / proofs\n\timmutableProofVerificationMethodId: true,\n\tattestationConnector: true,\n\tattestationVerificationMethodId: true,\n\t// data processing\n\tdataProcessingEnabled: true,\n\tdataConverterConnectors: true,\n\tdataExtractorConnectors: true,\n\ttaskSchedulerEnabled: true,\n\t// auditable items / documents\n\tauditableItemGraphEnabled: true,\n\tauditableItemGraphMutexTimeout: true,\n\tauditableItemStreamEnabled: true,\n\tauditableItemStreamMutexTimeout: true,\n\tdocumentManagementEnabled: true,\n\tdocumentManagementMutexTimeout: true,\n\t// federated catalogue\n\tfederatedCatalogueEnabled: true,\n\tfederatedCatalogueFilters: true,\n\tfederatedCatalogueRemoteEndpoint: true,\n\tfederatedCatalogueRestClientPathPrefix: true,\n\tfederatedCatalogueMutexTimeout: true,\n\t// trust\n\ttrustGenerators: true,\n\ttrustVerifiers: true,\n\ttrustVerificationMethodId: true,\n\ttrustJwtTtl: true,\n\ttrustIdentitiesAllow: true,\n\ttrustIdentitiesDeny: true,\n\t// rights management\n\trightsManagementCallbackPath: true,\n\trightsManagementPolicyInformationSources: true,\n\trightsManagementPolicyNegotiators: true,\n\trightsManagementPolicyRequesters: true,\n\trightsManagementPolicyExecutionActions: true,\n\trightsManagementPolicyEnforcementProcessors: true,\n\trightsManagementPolicyArbiters: true,\n\trightsManagementPolicyObligationEnforcers: true,\n\trightsManagementMutexTimeout: true,\n\t// dataspace\n\tdataspaceEnabled: true,\n\tdataspaceRetainActivityLogsFor: true,\n\tdataspaceActivityLogsCleanupInterval: true,\n\tdataspaceDataPlanePath: true,\n\tdataspaceAutoStartTransfers: true,\n\tdataspaceStalledNegotiationTimeout: true,\n\tdataspaceStalledTransferTimeout: true,\n\tdataspaceCallbackPath: true,\n\t// health\n\thealthEnabled: true,\n\thealthInterval: true,\n\thealthStartupInterval: true,\n\t// automation / mutex\n\tautomationActionTypes: true,\n\tmutexTimeoutMsDefault: true\n};\n\n/**\n * The set of camelCase property names that are valid IEngineEnvironmentVariables keys.\n */\nexport const ENGINE_ENVIRONMENT_VARIABLE_KEYS: ReadonlySet<string> = new Set(\n\tObject.keys(engineEnvironmentVariableKeysInternal)\n);\n"]}
1
+ {"version":3,"file":"engineEnvironmentVariableKeys.js","sourceRoot":"","sources":["../../../src/models/engineEnvironmentVariableKeys.ts"],"names":[],"mappings":"AAIA,qEAAqE;AACrE,0EAA0E;AAC1E,4DAA4D;AAC5D,+FAA+F;AAC/F,MAAM,qCAAqC,GAEvC;IACH,SAAS;IACT,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,iBAAiB;IACjB,0BAA0B,EAAE,IAAI;IAChC,6BAA6B,EAAE,IAAI;IACnC,wBAAwB,EAAE,IAAI;IAC9B,+BAA+B,EAAE,IAAI;IACrC,6BAA6B,EAAE,IAAI;IACnC,eAAe;IACf,mBAAmB,EAAE,IAAI;IACzB,sBAAsB,EAAE,IAAI;IAC5B,0BAA0B,EAAE,IAAI;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;IAC/B,8BAA8B,EAAE,IAAI;IACpC,sBAAsB;IACtB,yBAAyB,EAAE,IAAI;IAC/B,yBAAyB,EAAE,IAAI;IAC/B,gCAAgC,EAAE,IAAI;IACtC,sCAAsC,EAAE,IAAI;IAC5C,8BAA8B,EAAE,IAAI;IACpC,QAAQ;IACR,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,yBAAyB,EAAE,IAAI;IAC/B,WAAW,EAAE,IAAI;IACjB,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;IACzB,oBAAoB;IACpB,4BAA4B,EAAE,IAAI;IAClC,wCAAwC,EAAE,IAAI;IAC9C,iCAAiC,EAAE,IAAI;IACvC,gCAAgC,EAAE,IAAI;IACtC,sCAAsC,EAAE,IAAI;IAC5C,2CAA2C,EAAE,IAAI;IACjD,8BAA8B,EAAE,IAAI;IACpC,yCAAyC,EAAE,IAAI;IAC/C,4BAA4B,EAAE,IAAI;IAClC,YAAY;IACZ,gBAAgB,EAAE,IAAI;IACtB,8BAA8B,EAAE,IAAI;IACpC,oCAAoC,EAAE,IAAI;IAC1C,sBAAsB,EAAE,IAAI;IAC5B,2BAA2B,EAAE,IAAI;IACjC,kCAAkC,EAAE,IAAI;IACxC,+BAA+B,EAAE,IAAI;IACrC,qBAAqB,EAAE,IAAI;IAC3B,SAAS;IACT,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,qBAAqB,EAAE,IAAI;IAC3B,qBAAqB;IACrB,qBAAqB,EAAE,IAAI;IAC3B,qBAAqB,EAAE,IAAI;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB,IAAI,GAAG,CAC3E,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAClD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEngineEnvironmentVariables } from \"./IEngineEnvironmentVariables.js\";\n\n// Mapped type exhaustiveness check: TypeScript requires every key of\n// Required<IEngineEnvironmentVariables> to appear here with value `true`.\n// Removing a key → compile error (\"Property X is missing\").\n// Adding an invented key → compile error (\"Object literal may only specify known properties\").\nconst engineEnvironmentVariableKeysInternal: {\n\t[K in keyof Required<IEngineEnvironmentVariables>]: true;\n} = {\n\t// global\n\tdebug: true,\n\tsilent: true,\n\tstrictEnv: true,\n\tenvAllowList: true,\n\tstorageFileRoot: true,\n\tstateFilename: true,\n\ttenantEnabled: true,\n\tschemaMigrationEnabled: true,\n\textensions: true,\n\t// entity storage\n\tentityStorageConnectorType: true,\n\tentityStorageConnectorDefault: true,\n\tentityStorageTablePrefix: true,\n\tentityStorageMemoryMutexTimeout: true,\n\tentityStorageFileMutexTimeout: true,\n\t// AWS DynamoDB\n\tawsDynamodbAuthMode: true,\n\tawsDynamodbAccessKeyId: true,\n\tawsDynamodbSecretAccessKey: true,\n\tawsDynamodbRegion: true,\n\tawsDynamodbEndpoint: true,\n\tawsDynamodbConnectionTimeout: true,\n\t// Azure Cosmos DB\n\tazureCosmosdbKey: true,\n\tazureCosmosdbContainerId: true,\n\tazureCosmosdbDatabaseId: true,\n\tazureCosmosdbEndpoint: true,\n\t// GCP Firestore\n\tgcpFirestoreCollectionName: true,\n\tgcpFirestoreCredentials: true,\n\tgcpFirestoreDatabaseId: true,\n\tgcpFirestoreEndpoint: true,\n\tgcpFirestoreProjectId: true,\n\t// ScyllaDB\n\tscylladbHosts: true,\n\tscylladbKeyspace: true,\n\tscylladbLocalDataCenter: true,\n\tscylladbPort: true,\n\t// MySQL\n\tmySqlHost: true,\n\tmySqlPort: true,\n\tmySqlUser: true,\n\tmySqlPassword: true,\n\tmySqlDatabase: true,\n\t// MongoDB\n\tmongoDbHost: true,\n\tmongoDbPort: true,\n\tmongoDbUser: true,\n\tmongoDbPassword: true,\n\tmongoDbDatabase: true,\n\t// PostgreSQL\n\tpostgreSqlHost: true,\n\tpostgreSqlPort: true,\n\tpostgreSqlUser: true,\n\tpostgreSqlPassword: true,\n\tpostgreSqlDatabase: true,\n\t// IPFS\n\tipfsBearerToken: true,\n\tipfsApiUrl: true,\n\t// blob storage\n\tblobStorageConnectorType: true,\n\tblobStorageConnectorDefault: true,\n\tblobStorageEnableEncryption: true,\n\tblobStorageEncryptionKeyId: true,\n\tblobStoragePrefix: true,\n\t// AWS S3\n\tawsS3Region: true,\n\tawsS3BucketName: true,\n\tawsS3AuthMode: true,\n\tawsS3AccessKeyId: true,\n\tawsS3SecretAccessKey: true,\n\tawsS3Endpoint: true,\n\t// Azure Storage\n\tazureStorageAccountKey: true,\n\tazureStorageAccountName: true,\n\tazureStorageContainerName: true,\n\tazureStorageEndpoint: true,\n\t// GCP Storage\n\tgcpStorageBucketName: true,\n\tgcpStorageCredentials: true,\n\tgcpStorageEndpoint: true,\n\tgcpStorageProjectId: true,\n\t// vault\n\tvaultConnector: true,\n\tvaultPrefix: true,\n\thashicorpVaultToken: true,\n\thashicorpVaultEndpoint: true,\n\t// logging\n\tloggingConnector: true,\n\tloggingBatchSize: true,\n\tloggingBatchFlushInterval: true,\n\tloggingRetainFor: true,\n\tloggingMaxEntries: true,\n\tloggingRetentionInterval: true,\n\tloggingRetentionBatchSize: true,\n\tloggingSilentComponents: true,\n\tloggingFileDirectory: true,\n\tloggingFileFilename: true,\n\tloggingFileMaxFileSizeBytes: true,\n\tloggingFileMaxRetainedFiles: true,\n\tloggingMutexTimeout: true,\n\t// open telemetry logging\n\topenTelemetryLoggingLoggerName: true,\n\topenTelemetryLoggingLoggerVersion: true,\n\topenTelemetryLoggingPrometheusEndpoint: true,\n\topenTelemetryLoggingProcessor: true,\n\t// event bus\n\teventBusConnector: true,\n\teventBusComponent: true,\n\t// messaging\n\tmessagingEnabled: true,\n\tmessagingEmailConnector: true,\n\tmessagingSmsConnector: true,\n\tmessagingPushNotificationConnector: true,\n\t// AWS SES\n\tawsSesRegion: true,\n\tawsSesAuthMode: true,\n\tawsSesSecretAccessKey: true,\n\tawsSesAccessKeyId: true,\n\tawsSesEndpoint: true,\n\tawsMessagingPushNotificationApplications: true,\n\t// telemetry\n\ttelemetryConnector: true,\n\topenTelemetryMeterName: true,\n\topenTelemetryMeterVersion: true,\n\topenTelemetryReader: true,\n\topenTelemetryPrometheusPort: true,\n\ttelemetryMetricsCollectorInterval: true,\n\ttelemetryMetricsProducers: true,\n\ttelemetryMetricsProducerMaxHistory: true,\n\ttelemetryMutexTimeout: true,\n\t// DLT / identity\n\tfaucetConnector: true,\n\twalletConnector: true,\n\tnftConnector: true,\n\tnftPackageId: true,\n\tnotarizationConnector: true,\n\tidentityConnector: true,\n\tidentityWalletAddressIndex: true,\n\tidentityDidResolutionCacheTtlMs: true,\n\tidentityResolverConnector: true,\n\tidentityProfileConnector: true,\n\tuniversalResolverEndpoint: true,\n\t// IOTA\n\tiotaFaucetEndpoint: true,\n\tiotaNodeEndpoint: true,\n\tiotaNetwork: true,\n\tiotaCoinType: true,\n\tiotaGasBudget: true,\n\tiotaGasReservationDuration: true,\n\tiotaExplorerEndpoint: true,\n\tiotaGasStationEndpoint: true,\n\tiotaGasStationAuthToken: true,\n\tiotaIdentityPackageId: true,\n\t// attestation / proofs\n\timmutableProofVerificationMethodId: true,\n\timmutableProofTaskRetryCount: true,\n\timmutableProofTaskRetryInterval: true,\n\timmutableProofTaskFailureRetainFor: true,\n\tattestationConnector: true,\n\tattestationVerificationMethodId: true,\n\t// data processing\n\tdataProcessingEnabled: true,\n\tdataConverterConnectors: true,\n\tdataExtractorConnectors: true,\n\ttaskSchedulerEnabled: true,\n\t// auditable items / documents\n\tauditableItemGraphEnabled: true,\n\tauditableItemGraphMutexTimeout: true,\n\tauditableItemStreamEnabled: true,\n\tauditableItemStreamMutexTimeout: true,\n\tdocumentManagementEnabled: true,\n\tdocumentManagementMutexTimeout: true,\n\t// federated catalogue\n\tfederatedCatalogueEnabled: true,\n\tfederatedCatalogueFilters: true,\n\tfederatedCatalogueRemoteEndpoint: true,\n\tfederatedCatalogueRestClientPathPrefix: true,\n\tfederatedCatalogueMutexTimeout: true,\n\t// trust\n\ttrustGenerators: true,\n\ttrustVerifiers: true,\n\ttrustVerificationMethodId: true,\n\ttrustJwtTtl: true,\n\ttrustIdentitiesAllow: true,\n\ttrustIdentitiesDeny: true,\n\t// rights management\n\trightsManagementCallbackPath: true,\n\trightsManagementPolicyInformationSources: true,\n\trightsManagementPolicyNegotiators: true,\n\trightsManagementPolicyRequesters: true,\n\trightsManagementPolicyExecutionActions: true,\n\trightsManagementPolicyEnforcementProcessors: true,\n\trightsManagementPolicyArbiters: true,\n\trightsManagementPolicyObligationEnforcers: true,\n\trightsManagementMutexTimeout: true,\n\t// dataspace\n\tdataspaceEnabled: true,\n\tdataspaceRetainActivityLogsFor: true,\n\tdataspaceActivityLogsCleanupInterval: true,\n\tdataspaceDataPlanePath: true,\n\tdataspaceAutoStartTransfers: true,\n\tdataspaceStalledNegotiationTimeout: true,\n\tdataspaceStalledTransferTimeout: true,\n\tdataspaceCallbackPath: true,\n\t// health\n\thealthEnabled: true,\n\thealthInterval: true,\n\thealthStartupInterval: true,\n\t// automation / mutex\n\tautomationActionTypes: true,\n\tmutexTimeoutMsDefault: true\n};\n\n/**\n * The set of camelCase property names that are valid IEngineEnvironmentVariables keys.\n */\nexport const ENGINE_ENVIRONMENT_VARIABLE_KEYS: ReadonlySet<string> = new Set(\n\tObject.keys(engineEnvironmentVariableKeysInternal)\n);\n"]}
package/dist/es/node.js CHANGED
@@ -11,7 +11,7 @@ import { buildEngineServerConfiguration } from "./builders/engineServerEnvBuilde
11
11
  import { extensionsConfiguration } from "./builders/extensionsBuilder.js";
12
12
  import { constructCliCommand, parseCommandLineArgs, registerCommands } from "./cli.js";
13
13
  import { getEnvDefaults } from "./defaults.js";
14
- import { BOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS } from "./models/bootstrapLegacyEnvironmentVariableKeys.js";
14
+ import { BOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS } from "./models/bootstrapDevEnvironmentVariableKeys.js";
15
15
  import { ENGINE_ENVIRONMENT_VARIABLE_KEYS } from "./models/engineEnvironmentVariableKeys.js";
16
16
  import { ENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS } from "./models/engineServerEnvironmentVariableKeys.js";
17
17
  import { ModuleProtocol } from "./models/moduleProtocol.js";
@@ -33,7 +33,7 @@ export async function run(nodeOptions, args) {
33
33
  nodeOptions ??= {};
34
34
  const serverInfo = {
35
35
  name: nodeOptions?.serverName ?? "TWIN Node",
36
- version: nodeOptions?.serverVersion ?? "0.9.2-next.1" // x-release-please-version
36
+ version: nodeOptions?.serverVersion ?? "0.9.2-next.3" // x-release-please-version
37
37
  };
38
38
  CLIDisplay.header(serverInfo.name, serverInfo.version, "🌩️ ");
39
39
  if (!Is.stringValue(nodeOptions?.executionDirectory)) {
@@ -225,7 +225,7 @@ export async function buildConfiguration(processEnv, options, serverInfo) {
225
225
  ENGINE_ENVIRONMENT_VARIABLE_KEYS,
226
226
  ENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS,
227
227
  NODE_ENVIRONMENT_VARIABLE_KEYS,
228
- BOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS
228
+ BOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS
229
229
  ]);
230
230
  // Expand any environment variables that use the @file: syntax
231
231
  const keys = Object.keys(envVars);
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAInF,OAAO,EAAE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M,MAAM,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;YACjE,WAAW,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;YACjC,OAAO;gBACN,MAAM;gBACN,UAAU,EAAE,KAAK;aACjB,CAAC;QACH,CAAC;QAED,OAAO;YACN,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc;IACtB,YAAY,KAAK,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5E,OAAO,YAAY,CAAC;AACrB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { execSync } from \"node:child_process\";\nimport path from \"node:path\";\nimport type { IServerInfo } from \"@twin.org/api-models\";\nimport { CLIDisplay } from \"@twin.org/cli-core\";\nimport { Coerce, EnvHelper, GeneralError, Guards, I18n, Is } from \"@twin.org/core\";\nimport type { Engine } from \"@twin.org/engine\";\nimport type { EngineServer } from \"@twin.org/engine-server\";\nimport type { IEngineServerConfig } from \"@twin.org/engine-server-types\";\nimport { ModuleHelper } from \"@twin.org/modules\";\nimport * as dotenv from \"dotenv\";\nimport { buildEngineConfiguration } from \"./builders/engineEnvBuilder.js\";\nimport { buildEngineServerConfiguration } from \"./builders/engineServerEnvBuilder.js\";\nimport { extensionsConfiguration } from \"./builders/extensionsBuilder.js\";\nimport { constructCliCommand, parseCommandLineArgs, registerCommands } from \"./cli.js\";\nimport { getEnvDefaults } from \"./defaults.js\";\nimport { BOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS } from \"./models/bootstrapLegacyEnvironmentVariableKeys.js\";\nimport { ENGINE_ENVIRONMENT_VARIABLE_KEYS } from \"./models/engineEnvironmentVariableKeys.js\";\nimport { ENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS } from \"./models/engineServerEnvironmentVariableKeys.js\";\nimport type { IEnvironmentVariables } from \"./models/IEnvironmentVariables.js\";\nimport type { INodeEngineConfig } from \"./models/INodeEngineConfig.js\";\nimport type { INodeEngineState } from \"./models/INodeEngineState.js\";\nimport type { INodeOptions } from \"./models/INodeOptions.js\";\nimport { ModuleProtocol } from \"./models/moduleProtocol.js\";\nimport { NODE_ENVIRONMENT_VARIABLE_KEYS } from \"./models/nodeEnvironmentVariableKeys.js\";\nimport { start } from \"./start.js\";\nimport {\n\tcreateModuleImportUrl,\n\tfileExists,\n\tgetExecutionDirectory,\n\tgetExtensionsCacheDir,\n\tgetScriptDirectory,\n\thandleHttpsProtocol,\n\thandleNpmProtocol,\n\tinitialiseLocales,\n\tloadJsonFile,\n\tloadTextFile,\n\tparseModuleProtocol,\n\tresolvePackageEntryPoint\n} from \"./utils.js\";\n\nconst moduleCache: { [id: string]: unknown } = {};\nlet npmRootCache: string | undefined;\n\n/**\n * Run the TWIN Node.\n * @param nodeOptions Optional configuration options for running the server.\n * @param args Optional command line arguments.\n * @returns A promise that resolves when the server is started containing a shutdown method.\n */\nexport async function run(\n\tnodeOptions?: INodeOptions,\n\targs?: string[]\n): Promise<\n\t| {\n\t\t\tengine: Engine<IEngineServerConfig, INodeEngineState>;\n\t\t\tserver: EngineServer;\n\t\t\tshutdown: () => Promise<void>;\n\t }\n\t| undefined\n> {\n\tlet showErrorDetails = true;\n\tlet debugEnabled = true;\n\ttry {\n\t\tnodeOptions ??= {};\n\n\t\tconst serverInfo: IServerInfo = {\n\t\t\tname: nodeOptions?.serverName ?? \"TWIN Node\",\n\t\t\tversion: nodeOptions?.serverVersion ?? \"0.9.2-next.1\" // x-release-please-version\n\t\t};\n\n\t\tCLIDisplay.header(serverInfo.name, serverInfo.version, \"🌩️ \");\n\n\t\tif (!Is.stringValue(nodeOptions?.executionDirectory)) {\n\t\t\tnodeOptions.executionDirectory = getExecutionDirectory();\n\t\t}\n\t\tCLIDisplay.value(\"Execution Directory\", nodeOptions.executionDirectory);\n\n\t\tif (!Is.stringValue(nodeOptions?.scriptDirectory)) {\n\t\t\tnodeOptions.scriptDirectory = getScriptDirectory(args);\n\t\t}\n\t\tCLIDisplay.value(\"Script Directory\", nodeOptions.scriptDirectory);\n\n\t\tnodeOptions.localesDirectory =\n\t\t\tnodeOptions?.localesDirectory ??\n\t\t\tpath.resolve(path.join(nodeOptions.scriptDirectory, \"dist\", \"locales\"));\n\n\t\tCLIDisplay.value(\"Locales Directory\", nodeOptions.localesDirectory);\n\t\tawait initialiseLocales(nodeOptions.localesDirectory);\n\n\t\tnodeOptions.envPrefix ??= \"TWIN_\";\n\n\t\toverrideModuleImport(nodeOptions.executionDirectory ?? \"\");\n\n\t\tconst commandLineArgs = parseCommandLineArgs(args);\n\n\t\tconst hasEnvPrefix = commandLineArgs.options?.find(option => option.key === \"env-prefix\");\n\t\tif (hasEnvPrefix) {\n\t\t\tnodeOptions.envPrefix = Coerce.string(hasEnvPrefix.value) ?? nodeOptions.envPrefix;\n\t\t}\n\n\t\tCLIDisplay.value(\"Environment Variable Prefix\", nodeOptions.envPrefix);\n\n\t\t// This is the only location in the code base that should access process.env directly\n\t\t// So we can safely disable the linting rule here.\n\t\tlet finalEnvVars =\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tprocess.env as {\n\t\t\t\t[id: string]: string;\n\t\t\t};\n\n\t\tif (Is.objectValue(nodeOptions?.envVars)) {\n\t\t\tfinalEnvVars = {\n\t\t\t\t...finalEnvVars,\n\t\t\t\t...nodeOptions.envVars\n\t\t\t};\n\t\t}\n\n\t\tfinalEnvVars = {\n\t\t\t...getEnvDefaults(nodeOptions.envPrefix),\n\t\t\t...finalEnvVars\n\t\t};\n\n\t\tlet cliCommand;\n\t\tif (Is.arrayValue(commandLineArgs.options)) {\n\t\t\tregisterCommands();\n\t\t\tcliCommand = constructCliCommand(finalEnvVars, commandLineArgs);\n\t\t}\n\n\t\tif (Is.object(cliCommand)) {\n\t\t\tfinalEnvVars[`${nodeOptions.envPrefix}SILENT`] ??= \"true\";\n\t\t} else {\n\t\t\tif (Is.empty(nodeOptions?.openApiSpecFile)) {\n\t\t\t\tconst specFile = path.resolve(\n\t\t\t\t\tpath.join(nodeOptions.scriptDirectory ?? \"\", \"docs\", \"open-api\", \"spec.json\")\n\t\t\t\t);\n\t\t\t\tif (await fileExists(specFile)) {\n\t\t\t\t\tnodeOptions ??= {};\n\t\t\t\t\tnodeOptions.openApiSpecFile = specFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Is.stringValue(nodeOptions.openApiSpecFile)) {\n\t\t\t\tCLIDisplay.value(\"OpenAPI Spec File\", nodeOptions.openApiSpecFile);\n\t\t\t}\n\n\t\t\tif (Is.empty(nodeOptions?.favIconFile)) {\n\t\t\t\tconst favIconFile = path.resolve(\n\t\t\t\t\tpath.join(nodeOptions.scriptDirectory ?? \"\", \"static\", \"favicon.png\")\n\t\t\t\t);\n\t\t\t\tif (await fileExists(favIconFile)) {\n\t\t\t\t\tnodeOptions ??= {};\n\t\t\t\t\tnodeOptions.favIconFile = favIconFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Is.stringValue(nodeOptions.favIconFile)) {\n\t\t\t\tCLIDisplay.value(\"Favicon File\", nodeOptions.favIconFile);\n\t\t\t}\n\t\t}\n\n\t\tconst { nodeEngineConfig, nodeEnvVars, availableContextIdKeys } = await buildConfiguration(\n\t\t\tfinalEnvVars,\n\t\t\tnodeOptions,\n\t\t\tserverInfo\n\t\t);\n\n\t\tdebugEnabled = Coerce.boolean(nodeEnvVars.debug) ?? debugEnabled;\n\n\t\tCLIDisplay.break();\n\n\t\tconst startResult = await start(\n\t\t\tnodeOptions,\n\t\t\tnodeEngineConfig,\n\t\t\tnodeEnvVars,\n\t\t\tcliCommand,\n\t\t\tavailableContextIdKeys\n\t\t);\n\n\t\tif (!Is.empty(startResult)) {\n\t\t\tshowErrorDetails = false;\n\n\t\t\tlet isShuttingDown = false;\n\t\t\tfor (const signal of [\"SIGHUP\", \"SIGINT\", \"SIGTERM\"]) {\n\t\t\t\tprocess.on(signal, async () => {\n\t\t\t\t\tif (!isShuttingDown) {\n\t\t\t\t\t\tisShuttingDown = true;\n\t\t\t\t\t\tCLIDisplay.value(\"Terminate Signal\", signal);\n\t\t\t\t\t\tawait startResult.shutdown();\n\t\t\t\t\t\tprocess.exit(0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn startResult;\n\t} catch (err) {\n\t\tif (nodeOptions?.disableProcessExitOnFailure ?? false) {\n\t\t\tthrow err;\n\t\t}\n\n\t\tif (showErrorDetails) {\n\t\t\tCLIDisplay.error(err, true, { includeAdditional: true, includeStack: debugEnabled });\n\t\t}\n\n\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Test whether a camelCase key matches an entry in a pattern set.\n * Entries ending with \"*\" are treated as prefix patterns; all others require an exact match.\n * @param camelKey The camelCase key to test.\n * @param patternSet The set of exact keys and/or wildcard patterns (e.g. \"restPath*\").\n * @returns True if the key matches any entry.\n */\nfunction matchesPatternSet(\n\tcamelKey: string,\n\tpatternSet: ReadonlySet<string> | Set<string>\n): boolean {\n\tif (patternSet.has(camelKey)) {\n\t\treturn true;\n\t}\n\tfor (const pattern of patternSet) {\n\t\tif (pattern.endsWith(\"*\") && camelKey.startsWith(pattern.slice(0, -1))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Validate that every key in envVars maps to a recognised property.\n * All unknown keys are collected, then reported together as a single error or warning.\n * Raw env var names listed in the allow list (e.g. TWIN_MY_EXTENSION_SECRET, TWIN_REST_PATH_*) are always accepted.\n * Wildcard patterns ending with * are supported in both allow sets and the allow list.\n * @param envVars The already-converted camelCase env variables.\n * @param prefix The prefix used for the environment variables (e.g. \"TWIN_\").\n * @param allowSets An array of sets of allowed keys and/or wildcard patterns.\n * @throws GeneralError If any unknown env var properties are found and strict mode is \"error\", or if the strict mode value is invalid.\n */\nfunction validateEnvVarKeys(\n\tenvVars: { [id: string]: string | unknown },\n\tprefix: string,\n\tallowSets: ReadonlySet<string>[]\n): void {\n\tconst mode = Is.stringValue(envVars.strictEnv) ? envVars.strictEnv : \"error\";\n\tGuards.arrayOneOf(\"node\", `${prefix}STRICT_ENV`, mode, [\"error\", \"warn\", \"ignore\"]);\n\n\tif (mode === \"ignore\") {\n\t\treturn;\n\t}\n\n\tconst customSet = new Set(\n\t\tIs.stringValue(envVars.envAllowList)\n\t\t\t? envVars.envAllowList\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map(k => EnvHelper.envVarKeyToJsonKey(k.trim(), prefix))\n\t\t\t\t\t.filter(Boolean)\n\t\t\t: []\n\t);\n\n\tconst unknown = Object.keys(envVars)\n\t\t.filter(\n\t\t\tcamelKey =>\n\t\t\t\t!allowSets.some(set => matchesPatternSet(camelKey, set)) &&\n\t\t\t\t!matchesPatternSet(camelKey, customSet)\n\t\t)\n\t\t.map(camelKey => EnvHelper.jsonKeyToEnvVarKey(camelKey, prefix));\n\n\tif (unknown.length > 0) {\n\t\tif (mode === \"error\") {\n\t\t\tthrow new GeneralError(\"node\", \"unknownEnvVars\", { keys: unknown.join(\", \"), prefix });\n\t\t}\n\t\tCLIDisplay.warning(\n\t\t\tI18n.formatMessage(\"warn.node.unknownEnvVars\", { keys: unknown.join(\", \"), prefix })\n\t\t);\n\t}\n}\n\n/**\n * Build the configuration for the TWIN Node.\n * @param processEnv The environment variables from the process.\n * @param options The options for running the server.\n * @param serverInfo The server information.\n * @returns A promise that resolves to the engine server configuration, environment prefix, environment variables,\n * and options.\n */\nexport async function buildConfiguration(\n\tprocessEnv: {\n\t\t[id: string]: string;\n\t},\n\toptions: INodeOptions,\n\tserverInfo: IServerInfo\n): Promise<{\n\tnodeEnvVars: IEnvironmentVariables & { [id: string]: string | unknown };\n\tnodeEngineConfig: INodeEngineConfig;\n\tavailableContextIdKeys: { key: string; requiredHandlerFeatures: string[] }[];\n}> {\n\tconst availableContextIdKeys: { key: string; requiredHandlerFeatures: string[] }[] = [];\n\n\tlet defaultEnvOnly = false;\n\tif (Is.empty(options?.envFilenames)) {\n\t\tconst envFile = path.resolve(path.join(options.executionDirectory ?? \"\", \".env\"));\n\t\tCLIDisplay.value(\"Default Environment File\", envFile);\n\t\toptions ??= {};\n\t\toptions.envFilenames = [envFile];\n\t\tdefaultEnvOnly = true;\n\t}\n\n\tif (Is.arrayValue(options?.envFilenames)) {\n\t\tconst output = dotenv.config({\n\t\t\tpath: options?.envFilenames,\n\t\t\tquiet: true\n\t\t});\n\n\t\t// We don't want to throw an error if the default environment file is not found.\n\t\t// Only if we have custom environment files.\n\t\tif (!defaultEnvOnly && output.error) {\n\t\t\tthrow output.error;\n\t\t}\n\n\t\tif (Is.objectValue(output.parsed)) {\n\t\t\tfor (const [key, value] of Object.entries(output.parsed)) {\n\t\t\t\t// Only set environment variables that are not already set in\n\t\t\t\t// the process environment or provided via options.envVars\n\t\t\t\tprocessEnv[key] ??= value;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst envVars = EnvHelper.envToJson<{ [id: string]: string | unknown }>(\n\t\tprocessEnv,\n\t\toptions.envPrefix ?? \"\"\n\t);\n\n\tvalidateEnvVarKeys(envVars, options.envPrefix ?? \"\", [\n\t\tENGINE_ENVIRONMENT_VARIABLE_KEYS,\n\t\tENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS,\n\t\tNODE_ENVIRONMENT_VARIABLE_KEYS,\n\t\tBOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS\n\t]);\n\n\t// Expand any environment variables that use the @file: syntax\n\tconst keys = Object.keys(envVars);\n\tfor (const key of keys) {\n\t\tif (\n\t\t\tIs.stringValue(envVars[key]) &&\n\t\t\t(envVars[key].startsWith(\"@text:\") || envVars[key].startsWith(\"@json:\"))\n\t\t) {\n\t\t\tconst filePath = envVars[key].slice(6).trim();\n\t\t\tconst embeddedFile = path.resolve(path.join(options.executionDirectory ?? \"\", filePath));\n\n\t\t\tif (envVars[key].startsWith(\"@text:\")) {\n\t\t\t\tCLIDisplay.value(`Expanding Environment Variable: ${key} from text file`, embeddedFile);\n\t\t\t\tenvVars[key] = await loadTextFile(embeddedFile);\n\t\t\t} else if (envVars[key].startsWith(\"@json:\")) {\n\t\t\t\tCLIDisplay.value(`Expanding Environment Variable: ${key} from JSON file`, embeddedFile);\n\t\t\t\tenvVars[key] = await loadJsonFile(embeddedFile);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Extend the environment variables with any additional custom configuration.\n\tif (Is.function(options?.extendEnvVars)) {\n\t\tCLIDisplay.task(\"Extending Environment Variables\");\n\t\tawait options.extendEnvVars(envVars);\n\t}\n\n\t// Build the engine configuration from the environment variables.\n\tconst coreConfig = await buildEngineConfiguration(envVars);\n\tconst engineServerConfig = await buildEngineServerConfiguration(\n\t\tenvVars,\n\t\tavailableContextIdKeys,\n\t\tcoreConfig,\n\t\tserverInfo,\n\t\toptions?.openApiSpecFile,\n\t\toptions?.favIconFile\n\t);\n\n\t// Merge any custom configuration provided in the options.\n\tif (Is.arrayValue(options?.configFilenames)) {\n\t\tfor (const configFile of options.configFilenames) {\n\t\t\tCLIDisplay.value(\"Loading Configuration File\", configFile);\n\t\t\tconst configFilePath = path.resolve(path.join(options.executionDirectory ?? \"\", configFile));\n\t\t\tconst config = await loadJsonFile(configFilePath);\n\t\t\tObject.assign(engineServerConfig, config);\n\t\t}\n\t}\n\n\tif (Is.objectValue(options?.config)) {\n\t\tCLIDisplay.task(\"Merging Custom Configuration\");\n\t\tObject.assign(engineServerConfig, options.config);\n\t}\n\n\t// Merge any custom configuration provided in the options.\n\tif (Is.function(options?.extendConfig)) {\n\t\tCLIDisplay.task(\"Extending Configuration\");\n\t\tawait options.extendConfig(envVars, engineServerConfig);\n\t}\n\n\tconst nodeEngineConfig = await extensionsConfiguration(envVars, engineServerConfig);\n\n\treturn { nodeEngineConfig, nodeEnvVars: envVars, availableContextIdKeys };\n}\n\n/**\n * Override module imports to support protocol-based loading (npm:, https:) and local files.\n * @param executionDirectory The execution directory for resolving local module paths.\n * @param envVars The environment variables containing extension configuration (optional, uses defaults if not provided).\n */\nexport function overrideModuleImport(\n\texecutionDirectory: string,\n\tenvVars?: IEnvironmentVariables\n): void {\n\tconst maxSizeMb = Coerce.number(envVars?.extensionsMaxSizeMb) ?? 10;\n\tconst cacheDirectory = envVars?.extensionsCacheDirectory;\n\n\tModuleHelper.overrideImport(async moduleName => {\n\t\tif (moduleCache[moduleName]) {\n\t\t\treturn {\n\t\t\t\tmodule: moduleCache[moduleName],\n\t\t\t\tuseDefault: false\n\t\t\t};\n\t\t}\n\n\t\tconst parsed = parseModuleProtocol(moduleName);\n\t\tlet resolvedPath: string | undefined;\n\n\t\tswitch (parsed.protocol) {\n\t\t\tcase ModuleProtocol.Npm: {\n\t\t\t\tconst result = await handleNpmProtocol(\n\t\t\t\t\tparsed.identifier,\n\t\t\t\t\texecutionDirectory,\n\t\t\t\t\tcacheDirectory\n\t\t\t\t);\n\t\t\t\tresolvedPath = result.resolvedPath;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Https: {\n\t\t\t\tconst result = await handleHttpsProtocol(\n\t\t\t\t\tparsed.identifier,\n\t\t\t\t\texecutionDirectory,\n\t\t\t\t\tmaxSizeMb,\n\t\t\t\t\tcacheDirectory,\n\t\t\t\t\tenvVars?.extensionsCacheTtlHours,\n\t\t\t\t\tenvVars?.extensionsForceRefresh\n\t\t\t\t);\n\t\t\t\tresolvedPath = result.resolvedPath;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Http: {\n\t\t\t\tthrow new GeneralError(\"node\", \"insecureProtocol\", { protocol: ModuleProtocol.Http });\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Local: {\n\t\t\t\tlet localFilename = path.resolve(moduleName);\n\n\t\t\t\tlet exists = await fileExists(localFilename);\n\t\t\t\tif (!exists) {\n\t\t\t\t\tlocalFilename = path.resolve(executionDirectory, moduleName);\n\t\t\t\t\texists = await fileExists(localFilename);\n\t\t\t\t}\n\n\t\t\t\tif (exists) {\n\t\t\t\t\tresolvedPath = localFilename;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Default: {\n\t\t\t\ttry {\n\t\t\t\t\tconst packagePath = path.resolve(getNpmRootPath(), moduleName);\n\t\t\t\t\tconst mainFile = await resolvePackageEntryPoint(packagePath, moduleName);\n\t\t\t\t\tconst modulePath = path.resolve(packagePath, mainFile);\n\t\t\t\t\tconst exists = await fileExists(modulePath);\n\t\t\t\t\tif (exists) {\n\t\t\t\t\t\tresolvedPath = modulePath;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Continue to fallback resolution\n\t\t\t\t}\n\n\t\t\t\t// Fallback: resolve from npm protocol cache directory (installed via handleNpmProtocol)\n\t\t\t\ttry {\n\t\t\t\t\tconst cacheNpmRoot = path.resolve(\n\t\t\t\t\t\tgetExtensionsCacheDir(executionDirectory, ModuleProtocol.Npm, cacheDirectory),\n\t\t\t\t\t\t\"node_modules\"\n\t\t\t\t\t);\n\n\t\t\t\t\tconst packagePath = path.resolve(cacheNpmRoot, moduleName);\n\t\t\t\t\tconst mainFile = await resolvePackageEntryPoint(packagePath, moduleName);\n\t\t\t\t\tconst modulePath = path.resolve(packagePath, mainFile);\n\t\t\t\t\tconst exists = await fileExists(modulePath);\n\t\t\t\t\tif (exists) {\n\t\t\t\t\t\tresolvedPath = modulePath;\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// No cached resolution either; fall through\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Common module loading and caching logic\n\t\tif (resolvedPath) {\n\t\t\tconst module = await import(createModuleImportUrl(resolvedPath));\n\t\t\tmoduleCache[moduleName] = module;\n\t\t\treturn {\n\t\t\t\tmodule,\n\t\t\t\tuseDefault: false\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tmodule: undefined,\n\t\t\tuseDefault: true\n\t\t};\n\t});\n}\n\n/**\n * Get the root path for npm modules by executing \"npm root\" command and cache it.\n * @returns The root path for npm modules.\n */\nfunction getNpmRootPath(): string {\n\tnpmRootCache ??= execSync(\"npm root\").toString().trim().replace(/\\\\/g, \"/\");\n\treturn npmRootCache;\n}\n"]}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAInF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,uCAAuC,EAAE,MAAM,iDAAiD,CAAC;AAC1G,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,uCAAuC,EAAE,MAAM,iDAAiD,CAAC;AAK1G,OAAO,EAAE,c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:child_process\";\nimport path from \"node:path\";\nimport type { IServerInfo } from \"@twin.org/api-models\";\nimport { CLIDisplay } from \"@twin.org/cli-core\";\nimport { Coerce, EnvHelper, GeneralError, Guards, I18n, Is } from \"@twin.org/core\";\nimport type { Engine } from \"@twin.org/engine\";\nimport type { EngineServer } from \"@twin.org/engine-server\";\nimport type { IEngineServerConfig } from \"@twin.org/engine-server-types\";\nimport { ModuleHelper } from \"@twin.org/modules\";\nimport * as dotenv from \"dotenv\";\nimport { buildEngineConfiguration } from \"./builders/engineEnvBuilder.js\";\nimport { buildEngineServerConfiguration } from \"./builders/engineServerEnvBuilder.js\";\nimport { extensionsConfiguration } from \"./builders/extensionsBuilder.js\";\nimport { constructCliCommand, parseCommandLineArgs, registerCommands } from \"./cli.js\";\nimport { getEnvDefaults } from \"./defaults.js\";\nimport { BOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS } from \"./models/bootstrapDevEnvironmentVariableKeys.js\";\nimport { ENGINE_ENVIRONMENT_VARIABLE_KEYS } from \"./models/engineEnvironmentVariableKeys.js\";\nimport { ENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS } from \"./models/engineServerEnvironmentVariableKeys.js\";\nimport type { IEnvironmentVariables } from \"./models/IEnvironmentVariables.js\";\nimport type { INodeEngineConfig } from \"./models/INodeEngineConfig.js\";\nimport type { INodeEngineState } from \"./models/INodeEngineState.js\";\nimport type { INodeOptions } from \"./models/INodeOptions.js\";\nimport { ModuleProtocol } from \"./models/moduleProtocol.js\";\nimport { NODE_ENVIRONMENT_VARIABLE_KEYS } from \"./models/nodeEnvironmentVariableKeys.js\";\nimport { start } from \"./start.js\";\nimport {\n\tcreateModuleImportUrl,\n\tfileExists,\n\tgetExecutionDirectory,\n\tgetExtensionsCacheDir,\n\tgetScriptDirectory,\n\thandleHttpsProtocol,\n\thandleNpmProtocol,\n\tinitialiseLocales,\n\tloadJsonFile,\n\tloadTextFile,\n\tparseModuleProtocol,\n\tresolvePackageEntryPoint\n} from \"./utils.js\";\n\nconst moduleCache: { [id: string]: unknown } = {};\nlet npmRootCache: string | undefined;\n\n/**\n * Run the TWIN Node.\n * @param nodeOptions Optional configuration options for running the server.\n * @param args Optional command line arguments.\n * @returns A promise that resolves when the server is started containing a shutdown method.\n */\nexport async function run(\n\tnodeOptions?: INodeOptions,\n\targs?: string[]\n): Promise<\n\t| {\n\t\t\tengine: Engine<IEngineServerConfig, INodeEngineState>;\n\t\t\tserver: EngineServer;\n\t\t\tshutdown: () => Promise<void>;\n\t }\n\t| undefined\n> {\n\tlet showErrorDetails = true;\n\tlet debugEnabled = true;\n\ttry {\n\t\tnodeOptions ??= {};\n\n\t\tconst serverInfo: IServerInfo = {\n\t\t\tname: nodeOptions?.serverName ?? \"TWIN Node\",\n\t\t\tversion: nodeOptions?.serverVersion ?? \"0.9.2-next.3\" // x-release-please-version\n\t\t};\n\n\t\tCLIDisplay.header(serverInfo.name, serverInfo.version, \"🌩️ \");\n\n\t\tif (!Is.stringValue(nodeOptions?.executionDirectory)) {\n\t\t\tnodeOptions.executionDirectory = getExecutionDirectory();\n\t\t}\n\t\tCLIDisplay.value(\"Execution Directory\", nodeOptions.executionDirectory);\n\n\t\tif (!Is.stringValue(nodeOptions?.scriptDirectory)) {\n\t\t\tnodeOptions.scriptDirectory = getScriptDirectory(args);\n\t\t}\n\t\tCLIDisplay.value(\"Script Directory\", nodeOptions.scriptDirectory);\n\n\t\tnodeOptions.localesDirectory =\n\t\t\tnodeOptions?.localesDirectory ??\n\t\t\tpath.resolve(path.join(nodeOptions.scriptDirectory, \"dist\", \"locales\"));\n\n\t\tCLIDisplay.value(\"Locales Directory\", nodeOptions.localesDirectory);\n\t\tawait initialiseLocales(nodeOptions.localesDirectory);\n\n\t\tnodeOptions.envPrefix ??= \"TWIN_\";\n\n\t\toverrideModuleImport(nodeOptions.executionDirectory ?? \"\");\n\n\t\tconst commandLineArgs = parseCommandLineArgs(args);\n\n\t\tconst hasEnvPrefix = commandLineArgs.options?.find(option => option.key === \"env-prefix\");\n\t\tif (hasEnvPrefix) {\n\t\t\tnodeOptions.envPrefix = Coerce.string(hasEnvPrefix.value) ?? nodeOptions.envPrefix;\n\t\t}\n\n\t\tCLIDisplay.value(\"Environment Variable Prefix\", nodeOptions.envPrefix);\n\n\t\t// This is the only location in the code base that should access process.env directly\n\t\t// So we can safely disable the linting rule here.\n\t\tlet finalEnvVars =\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tprocess.env as {\n\t\t\t\t[id: string]: string;\n\t\t\t};\n\n\t\tif (Is.objectValue(nodeOptions?.envVars)) {\n\t\t\tfinalEnvVars = {\n\t\t\t\t...finalEnvVars,\n\t\t\t\t...nodeOptions.envVars\n\t\t\t};\n\t\t}\n\n\t\tfinalEnvVars = {\n\t\t\t...getEnvDefaults(nodeOptions.envPrefix),\n\t\t\t...finalEnvVars\n\t\t};\n\n\t\tlet cliCommand;\n\t\tif (Is.arrayValue(commandLineArgs.options)) {\n\t\t\tregisterCommands();\n\t\t\tcliCommand = constructCliCommand(finalEnvVars, commandLineArgs);\n\t\t}\n\n\t\tif (Is.object(cliCommand)) {\n\t\t\tfinalEnvVars[`${nodeOptions.envPrefix}SILENT`] ??= \"true\";\n\t\t} else {\n\t\t\tif (Is.empty(nodeOptions?.openApiSpecFile)) {\n\t\t\t\tconst specFile = path.resolve(\n\t\t\t\t\tpath.join(nodeOptions.scriptDirectory ?? \"\", \"docs\", \"open-api\", \"spec.json\")\n\t\t\t\t);\n\t\t\t\tif (await fileExists(specFile)) {\n\t\t\t\t\tnodeOptions ??= {};\n\t\t\t\t\tnodeOptions.openApiSpecFile = specFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Is.stringValue(nodeOptions.openApiSpecFile)) {\n\t\t\t\tCLIDisplay.value(\"OpenAPI Spec File\", nodeOptions.openApiSpecFile);\n\t\t\t}\n\n\t\t\tif (Is.empty(nodeOptions?.favIconFile)) {\n\t\t\t\tconst favIconFile = path.resolve(\n\t\t\t\t\tpath.join(nodeOptions.scriptDirectory ?? \"\", \"static\", \"favicon.png\")\n\t\t\t\t);\n\t\t\t\tif (await fileExists(favIconFile)) {\n\t\t\t\t\tnodeOptions ??= {};\n\t\t\t\t\tnodeOptions.favIconFile = favIconFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Is.stringValue(nodeOptions.favIconFile)) {\n\t\t\t\tCLIDisplay.value(\"Favicon File\", nodeOptions.favIconFile);\n\t\t\t}\n\t\t}\n\n\t\tconst { nodeEngineConfig, nodeEnvVars, availableContextIdKeys } = await buildConfiguration(\n\t\t\tfinalEnvVars,\n\t\t\tnodeOptions,\n\t\t\tserverInfo\n\t\t);\n\n\t\tdebugEnabled = Coerce.boolean(nodeEnvVars.debug) ?? debugEnabled;\n\n\t\tCLIDisplay.break();\n\n\t\tconst startResult = await start(\n\t\t\tnodeOptions,\n\t\t\tnodeEngineConfig,\n\t\t\tnodeEnvVars,\n\t\t\tcliCommand,\n\t\t\tavailableContextIdKeys\n\t\t);\n\n\t\tif (!Is.empty(startResult)) {\n\t\t\tshowErrorDetails = false;\n\n\t\t\tlet isShuttingDown = false;\n\t\t\tfor (const signal of [\"SIGHUP\", \"SIGINT\", \"SIGTERM\"]) {\n\t\t\t\tprocess.on(signal, async () => {\n\t\t\t\t\tif (!isShuttingDown) {\n\t\t\t\t\t\tisShuttingDown = true;\n\t\t\t\t\t\tCLIDisplay.value(\"Terminate Signal\", signal);\n\t\t\t\t\t\tawait startResult.shutdown();\n\t\t\t\t\t\tprocess.exit(0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn startResult;\n\t} catch (err) {\n\t\tif (nodeOptions?.disableProcessExitOnFailure ?? false) {\n\t\t\tthrow err;\n\t\t}\n\n\t\tif (showErrorDetails) {\n\t\t\tCLIDisplay.error(err, true, { includeAdditional: true, includeStack: debugEnabled });\n\t\t}\n\n\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Test whether a camelCase key matches an entry in a pattern set.\n * Entries ending with \"*\" are treated as prefix patterns; all others require an exact match.\n * @param camelKey The camelCase key to test.\n * @param patternSet The set of exact keys and/or wildcard patterns (e.g. \"restPath*\").\n * @returns True if the key matches any entry.\n */\nfunction matchesPatternSet(\n\tcamelKey: string,\n\tpatternSet: ReadonlySet<string> | Set<string>\n): boolean {\n\tif (patternSet.has(camelKey)) {\n\t\treturn true;\n\t}\n\tfor (const pattern of patternSet) {\n\t\tif (pattern.endsWith(\"*\") && camelKey.startsWith(pattern.slice(0, -1))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Validate that every key in envVars maps to a recognised property.\n * All unknown keys are collected, then reported together as a single error or warning.\n * Raw env var names listed in the allow list (e.g. TWIN_MY_EXTENSION_SECRET, TWIN_REST_PATH_*) are always accepted.\n * Wildcard patterns ending with * are supported in both allow sets and the allow list.\n * @param envVars The already-converted camelCase env variables.\n * @param prefix The prefix used for the environment variables (e.g. \"TWIN_\").\n * @param allowSets An array of sets of allowed keys and/or wildcard patterns.\n * @throws GeneralError If any unknown env var properties are found and strict mode is \"error\", or if the strict mode value is invalid.\n */\nfunction validateEnvVarKeys(\n\tenvVars: { [id: string]: string | unknown },\n\tprefix: string,\n\tallowSets: ReadonlySet<string>[]\n): void {\n\tconst mode = Is.stringValue(envVars.strictEnv) ? envVars.strictEnv : \"error\";\n\tGuards.arrayOneOf(\"node\", `${prefix}STRICT_ENV`, mode, [\"error\", \"warn\", \"ignore\"]);\n\n\tif (mode === \"ignore\") {\n\t\treturn;\n\t}\n\n\tconst customSet = new Set(\n\t\tIs.stringValue(envVars.envAllowList)\n\t\t\t? envVars.envAllowList\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map(k => EnvHelper.envVarKeyToJsonKey(k.trim(), prefix))\n\t\t\t\t\t.filter(Boolean)\n\t\t\t: []\n\t);\n\n\tconst unknown = Object.keys(envVars)\n\t\t.filter(\n\t\t\tcamelKey =>\n\t\t\t\t!allowSets.some(set => matchesPatternSet(camelKey, set)) &&\n\t\t\t\t!matchesPatternSet(camelKey, customSet)\n\t\t)\n\t\t.map(camelKey => EnvHelper.jsonKeyToEnvVarKey(camelKey, prefix));\n\n\tif (unknown.length > 0) {\n\t\tif (mode === \"error\") {\n\t\t\tthrow new GeneralError(\"node\", \"unknownEnvVars\", { keys: unknown.join(\", \"), prefix });\n\t\t}\n\t\tCLIDisplay.warning(\n\t\t\tI18n.formatMessage(\"warn.node.unknownEnvVars\", { keys: unknown.join(\", \"), prefix })\n\t\t);\n\t}\n}\n\n/**\n * Build the configuration for the TWIN Node.\n * @param processEnv The environment variables from the process.\n * @param options The options for running the server.\n * @param serverInfo The server information.\n * @returns A promise that resolves to the engine server configuration, environment prefix, environment variables,\n * and options.\n */\nexport async function buildConfiguration(\n\tprocessEnv: {\n\t\t[id: string]: string;\n\t},\n\toptions: INodeOptions,\n\tserverInfo: IServerInfo\n): Promise<{\n\tnodeEnvVars: IEnvironmentVariables & { [id: string]: string | unknown };\n\tnodeEngineConfig: INodeEngineConfig;\n\tavailableContextIdKeys: { key: string; requiredHandlerFeatures: string[] }[];\n}> {\n\tconst availableContextIdKeys: { key: string; requiredHandlerFeatures: string[] }[] = [];\n\n\tlet defaultEnvOnly = false;\n\tif (Is.empty(options?.envFilenames)) {\n\t\tconst envFile = path.resolve(path.join(options.executionDirectory ?? \"\", \".env\"));\n\t\tCLIDisplay.value(\"Default Environment File\", envFile);\n\t\toptions ??= {};\n\t\toptions.envFilenames = [envFile];\n\t\tdefaultEnvOnly = true;\n\t}\n\n\tif (Is.arrayValue(options?.envFilenames)) {\n\t\tconst output = dotenv.config({\n\t\t\tpath: options?.envFilenames,\n\t\t\tquiet: true\n\t\t});\n\n\t\t// We don't want to throw an error if the default environment file is not found.\n\t\t// Only if we have custom environment files.\n\t\tif (!defaultEnvOnly && output.error) {\n\t\t\tthrow output.error;\n\t\t}\n\n\t\tif (Is.objectValue(output.parsed)) {\n\t\t\tfor (const [key, value] of Object.entries(output.parsed)) {\n\t\t\t\t// Only set environment variables that are not already set in\n\t\t\t\t// the process environment or provided via options.envVars\n\t\t\t\tprocessEnv[key] ??= value;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst envVars = EnvHelper.envToJson<{ [id: string]: string | unknown }>(\n\t\tprocessEnv,\n\t\toptions.envPrefix ?? \"\"\n\t);\n\n\tvalidateEnvVarKeys(envVars, options.envPrefix ?? \"\", [\n\t\tENGINE_ENVIRONMENT_VARIABLE_KEYS,\n\t\tENGINE_SERVER_ENVIRONMENT_VARIABLE_KEYS,\n\t\tNODE_ENVIRONMENT_VARIABLE_KEYS,\n\t\tBOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS\n\t]);\n\n\t// Expand any environment variables that use the @file: syntax\n\tconst keys = Object.keys(envVars);\n\tfor (const key of keys) {\n\t\tif (\n\t\t\tIs.stringValue(envVars[key]) &&\n\t\t\t(envVars[key].startsWith(\"@text:\") || envVars[key].startsWith(\"@json:\"))\n\t\t) {\n\t\t\tconst filePath = envVars[key].slice(6).trim();\n\t\t\tconst embeddedFile = path.resolve(path.join(options.executionDirectory ?? \"\", filePath));\n\n\t\t\tif (envVars[key].startsWith(\"@text:\")) {\n\t\t\t\tCLIDisplay.value(`Expanding Environment Variable: ${key} from text file`, embeddedFile);\n\t\t\t\tenvVars[key] = await loadTextFile(embeddedFile);\n\t\t\t} else if (envVars[key].startsWith(\"@json:\")) {\n\t\t\t\tCLIDisplay.value(`Expanding Environment Variable: ${key} from JSON file`, embeddedFile);\n\t\t\t\tenvVars[key] = await loadJsonFile(embeddedFile);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Extend the environment variables with any additional custom configuration.\n\tif (Is.function(options?.extendEnvVars)) {\n\t\tCLIDisplay.task(\"Extending Environment Variables\");\n\t\tawait options.extendEnvVars(envVars);\n\t}\n\n\t// Build the engine configuration from the environment variables.\n\tconst coreConfig = await buildEngineConfiguration(envVars);\n\tconst engineServerConfig = await buildEngineServerConfiguration(\n\t\tenvVars,\n\t\tavailableContextIdKeys,\n\t\tcoreConfig,\n\t\tserverInfo,\n\t\toptions?.openApiSpecFile,\n\t\toptions?.favIconFile\n\t);\n\n\t// Merge any custom configuration provided in the options.\n\tif (Is.arrayValue(options?.configFilenames)) {\n\t\tfor (const configFile of options.configFilenames) {\n\t\t\tCLIDisplay.value(\"Loading Configuration File\", configFile);\n\t\t\tconst configFilePath = path.resolve(path.join(options.executionDirectory ?? \"\", configFile));\n\t\t\tconst config = await loadJsonFile(configFilePath);\n\t\t\tObject.assign(engineServerConfig, config);\n\t\t}\n\t}\n\n\tif (Is.objectValue(options?.config)) {\n\t\tCLIDisplay.task(\"Merging Custom Configuration\");\n\t\tObject.assign(engineServerConfig, options.config);\n\t}\n\n\t// Merge any custom configuration provided in the options.\n\tif (Is.function(options?.extendConfig)) {\n\t\tCLIDisplay.task(\"Extending Configuration\");\n\t\tawait options.extendConfig(envVars, engineServerConfig);\n\t}\n\n\tconst nodeEngineConfig = await extensionsConfiguration(envVars, engineServerConfig);\n\n\treturn { nodeEngineConfig, nodeEnvVars: envVars, availableContextIdKeys };\n}\n\n/**\n * Override module imports to support protocol-based loading (npm:, https:) and local files.\n * @param executionDirectory The execution directory for resolving local module paths.\n * @param envVars The environment variables containing extension configuration (optional, uses defaults if not provided).\n */\nexport function overrideModuleImport(\n\texecutionDirectory: string,\n\tenvVars?: IEnvironmentVariables\n): void {\n\tconst maxSizeMb = Coerce.number(envVars?.extensionsMaxSizeMb) ?? 10;\n\tconst cacheDirectory = envVars?.extensionsCacheDirectory;\n\n\tModuleHelper.overrideImport(async moduleName => {\n\t\tif (moduleCache[moduleName]) {\n\t\t\treturn {\n\t\t\t\tmodule: moduleCache[moduleName],\n\t\t\t\tuseDefault: false\n\t\t\t};\n\t\t}\n\n\t\tconst parsed = parseModuleProtocol(moduleName);\n\t\tlet resolvedPath: string | undefined;\n\n\t\tswitch (parsed.protocol) {\n\t\t\tcase ModuleProtocol.Npm: {\n\t\t\t\tconst result = await handleNpmProtocol(\n\t\t\t\t\tparsed.identifier,\n\t\t\t\t\texecutionDirectory,\n\t\t\t\t\tcacheDirectory\n\t\t\t\t);\n\t\t\t\tresolvedPath = result.resolvedPath;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Https: {\n\t\t\t\tconst result = await handleHttpsProtocol(\n\t\t\t\t\tparsed.identifier,\n\t\t\t\t\texecutionDirectory,\n\t\t\t\t\tmaxSizeMb,\n\t\t\t\t\tcacheDirectory,\n\t\t\t\t\tenvVars?.extensionsCacheTtlHours,\n\t\t\t\t\tenvVars?.extensionsForceRefresh\n\t\t\t\t);\n\t\t\t\tresolvedPath = result.resolvedPath;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Http: {\n\t\t\t\tthrow new GeneralError(\"node\", \"insecureProtocol\", { protocol: ModuleProtocol.Http });\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Local: {\n\t\t\t\tlet localFilename = path.resolve(moduleName);\n\n\t\t\t\tlet exists = await fileExists(localFilename);\n\t\t\t\tif (!exists) {\n\t\t\t\t\tlocalFilename = path.resolve(executionDirectory, moduleName);\n\t\t\t\t\texists = await fileExists(localFilename);\n\t\t\t\t}\n\n\t\t\t\tif (exists) {\n\t\t\t\t\tresolvedPath = localFilename;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase ModuleProtocol.Default: {\n\t\t\t\ttry {\n\t\t\t\t\tconst packagePath = path.resolve(getNpmRootPath(), moduleName);\n\t\t\t\t\tconst mainFile = await resolvePackageEntryPoint(packagePath, moduleName);\n\t\t\t\t\tconst modulePath = path.resolve(packagePath, mainFile);\n\t\t\t\t\tconst exists = await fileExists(modulePath);\n\t\t\t\t\tif (exists) {\n\t\t\t\t\t\tresolvedPath = modulePath;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Continue to fallback resolution\n\t\t\t\t}\n\n\t\t\t\t// Fallback: resolve from npm protocol cache directory (installed via handleNpmProtocol)\n\t\t\t\ttry {\n\t\t\t\t\tconst cacheNpmRoot = path.resolve(\n\t\t\t\t\t\tgetExtensionsCacheDir(executionDirectory, ModuleProtocol.Npm, cacheDirectory),\n\t\t\t\t\t\t\"node_modules\"\n\t\t\t\t\t);\n\n\t\t\t\t\tconst packagePath = path.resolve(cacheNpmRoot, moduleName);\n\t\t\t\t\tconst mainFile = await resolvePackageEntryPoint(packagePath, moduleName);\n\t\t\t\t\tconst modulePath = path.resolve(packagePath, mainFile);\n\t\t\t\t\tconst exists = await fileExists(modulePath);\n\t\t\t\t\tif (exists) {\n\t\t\t\t\t\tresolvedPath = modulePath;\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// No cached resolution either; fall through\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Common module loading and caching logic\n\t\tif (resolvedPath) {\n\t\t\tconst module = await import(createModuleImportUrl(resolvedPath));\n\t\t\tmoduleCache[moduleName] = module;\n\t\t\treturn {\n\t\t\t\tmodule,\n\t\t\t\tuseDefault: false\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tmodule: undefined,\n\t\t\tuseDefault: true\n\t\t};\n\t});\n}\n\n/**\n * Get the root path for npm modules by executing \"npm root\" command and cache it.\n * @returns The root path for npm modules.\n */\nfunction getNpmRootPath(): string {\n\tnpmRootCache ??= execSync(\"npm root\").toString().trim().replace(/\\\\/g, \"/\");\n\treturn npmRootCache;\n}\n"]}
@@ -7,14 +7,14 @@ import type { INodeEngineState } from "../models/INodeEngineState.js";
7
7
  * Get the command definition parameters.
8
8
  * @param commandDefinitions The registered command definitions.
9
9
  */
10
- export declare function getCommandDefinitionBootstrapLegacy(commandDefinitions: {
10
+ export declare function getCommandDefinitionBootstrapDev(commandDefinitions: {
11
11
  [id: string]: ICliCommandDefinition;
12
12
  }): void;
13
13
  /**
14
- * Command for legacy bootstrap.
14
+ * Command for development bootstrap.
15
15
  * @param engineCore The engine core.
16
16
  * @param envVars The environment variables for the node.
17
17
  * @param params The parameters for the command.
18
18
  * @returns A promise that resolves when the bootstrap sequence has completed.
19
19
  */
20
- export declare function bootstrapLegacy(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: IEnvironmentVariables, params: {}): Promise<void>;
20
+ export declare function bootstrapDev(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: IEnvironmentVariables, params: {}): Promise<void>;
@@ -4,7 +4,7 @@ export * from "./builders/extensionsBuilder.js";
4
4
  export * from "./cli.js";
5
5
  export * from "./defaults.js";
6
6
  export * from "./models/cliCommandParamType.js";
7
- export * from "./models/IBootstrapLegacyEnvironmentVariables.js";
7
+ export * from "./models/IBootstrapDevEnvironmentVariables.js";
8
8
  export * from "./models/ICacheMetadata.js";
9
9
  export * from "./models/ICliArgs.js";
10
10
  export * from "./models/ICliCommand.js";
@@ -1,7 +1,7 @@
1
1
  /**
2
- * The environment variables for the bootstrap legacy.
2
+ * The environment variables for the bootstrap development command.
3
3
  */
4
- export interface IBootstrapLegacyEnvironmentVariables {
4
+ export interface IBootstrapDevEnvironmentVariables {
5
5
  /**
6
6
  * The features that are enabled on the node.
7
7
  * @default []
@@ -444,6 +444,10 @@ export interface IEngineEnvironmentVariables {
444
444
  * Maximum number of values retained per telemetry metric (count-based history cap). Defaults to 1440.
445
445
  */
446
446
  telemetryMetricsProducerMaxHistory?: string;
447
+ /**
448
+ * The mutex timeout in milliseconds for the telemetry connector.
449
+ */
450
+ telemetryMutexTimeout?: string;
447
451
  /**
448
452
  * The type of faucet connector: entity-storage, iota.
449
453
  */
@@ -532,6 +536,22 @@ export interface IEngineEnvironmentVariables {
532
536
  * The identity verification method id to use with immutable proofs.
533
537
  */
534
538
  immutableProofVerificationMethodId?: string;
539
+ /**
540
+ * The number of times to retry a proof task when it fails, 0 to disable retries.
541
+ * @default 5
542
+ */
543
+ immutableProofTaskRetryCount?: number;
544
+ /**
545
+ * The interval in seconds to wait between proof task retries.
546
+ * @default 5
547
+ */
548
+ immutableProofTaskRetryInterval?: number;
549
+ /**
550
+ * The time in minutes to retain the record of a failed proof task.
551
+ * Set to -1 to retain failures forever.
552
+ * @default 10080
553
+ */
554
+ immutableProofTaskFailureRetainFor?: number;
535
555
  /**
536
556
  * The type of attestation connector: entity-storage, iota.
537
557
  */
@@ -1,8 +1,8 @@
1
- import type { IBootstrapLegacyEnvironmentVariables } from "./IBootstrapLegacyEnvironmentVariables.js";
1
+ import type { IBootstrapDevEnvironmentVariables } from "./IBootstrapDevEnvironmentVariables.js";
2
2
  import type { IEngineEnvironmentVariables } from "./IEngineEnvironmentVariables.js";
3
3
  import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironmentVariables.js";
4
4
  import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
5
5
  /**
6
6
  * The environment variables.
7
7
  */
8
- export type IEnvironmentVariables = IBootstrapLegacyEnvironmentVariables & INodeEnvironmentVariables & IEngineEnvironmentVariables & IEngineServerEnvironmentVariables;
8
+ export type IEnvironmentVariables = IBootstrapDevEnvironmentVariables & INodeEnvironmentVariables & IEngineEnvironmentVariables & IEngineServerEnvironmentVariables;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The set of camelCase property names that are valid IBootstrapDevEnvironmentVariables keys.
3
+ */
4
+ export declare const BOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS: ReadonlySet<string>;
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.2-next.3](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.2-next.2...node-core-v0.9.2-next.3) (2026-07-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * bootstrap-legacy rename ([#310](https://github.com/iotaledger/twin-node/issues/310)) ([53af8a2](https://github.com/iotaledger/twin-node/commit/53af8a2e797e90bb601416215247cd8649dd6220))
9
+
10
+ ## [0.9.2-next.2](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.2-next.1...node-core-v0.9.2-next.2) (2026-07-29)
11
+
12
+
13
+ ### Features
14
+
15
+ * immutable proof config ([#307](https://github.com/iotaledger/twin-node/issues/307)) ([9257495](https://github.com/iotaledger/twin-node/commit/92574953329647756aa6ab4cca80b1707e14a33f))
16
+
3
17
  ## [0.9.2-next.1](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.2-next.0...node-core-v0.9.2-next.1) (2026-07-28)
4
18
 
5
19
 
@@ -1,6 +1,6 @@
1
1
  # Function: buildConfiguration()
2
2
 
3
- > **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`IBootstrapLegacyEnvironmentVariables`](../interfaces/IBootstrapLegacyEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
3
+ > **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`IBootstrapDevEnvironmentVariables`](../interfaces/IBootstrapDevEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
4
4
 
5
5
  Build the configuration for the TWIN Node.
6
6
 
@@ -24,7 +24,7 @@ The server information.
24
24
 
25
25
  ## Returns
26
26
 
27
- `Promise`\<\{ `nodeEnvVars`: [`IBootstrapLegacyEnvironmentVariables`](../interfaces/IBootstrapLegacyEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
27
+ `Promise`\<\{ `nodeEnvVars`: [`IBootstrapDevEnvironmentVariables`](../interfaces/IBootstrapDevEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
28
28
 
29
29
  A promise that resolves to the engine server configuration, environment prefix, environment variables,
30
30
  and options.
@@ -8,7 +8,7 @@ Handles the configuration of the server.
8
8
 
9
9
  ### envVars
10
10
 
11
- [`IBootstrapLegacyEnvironmentVariables`](../interfaces/IBootstrapLegacyEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`
11
+ [`IBootstrapDevEnvironmentVariables`](../interfaces/IBootstrapDevEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md) & `object`
12
12
 
13
13
  The environment variables for the engine server.
14
14
 
@@ -20,7 +20,7 @@ The configuration for the engine server.
20
20
 
21
21
  ### envVars
22
22
 
23
- [`IBootstrapLegacyEnvironmentVariables`](../interfaces/IBootstrapLegacyEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
23
+ [`IBootstrapDevEnvironmentVariables`](../interfaces/IBootstrapDevEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
24
24
 
25
25
  The environment variables.
26
26
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Interfaces
4
4
 
5
- - [IBootstrapLegacyEnvironmentVariables](interfaces/IBootstrapLegacyEnvironmentVariables.md)
5
+ - [IBootstrapDevEnvironmentVariables](interfaces/IBootstrapDevEnvironmentVariables.md)
6
6
  - [ICacheMetadata](interfaces/ICacheMetadata.md)
7
7
  - [ICliArgs](interfaces/ICliArgs.md)
8
8
  - [ICliCommand](interfaces/ICliCommand.md)
@@ -1,6 +1,6 @@
1
- # Interface: IBootstrapLegacyEnvironmentVariables
1
+ # Interface: IBootstrapDevEnvironmentVariables
2
2
 
3
- The environment variables for the bootstrap legacy.
3
+ The environment variables for the bootstrap development command.
4
4
 
5
5
  ## Properties
6
6
 
@@ -895,6 +895,14 @@ Maximum number of values retained per telemetry metric (count-based history cap)
895
895
 
896
896
  ***
897
897
 
898
+ ### telemetryMutexTimeout? {#telemetrymutextimeout}
899
+
900
+ > `optional` **telemetryMutexTimeout?**: `string`
901
+
902
+ The mutex timeout in milliseconds for the telemetry connector.
903
+
904
+ ***
905
+
898
906
  ### faucetConnector? {#faucetconnector}
899
907
 
900
908
  > `optional` **faucetConnector?**: `string`
@@ -1071,6 +1079,49 @@ The identity verification method id to use with immutable proofs.
1071
1079
 
1072
1080
  ***
1073
1081
 
1082
+ ### immutableProofTaskRetryCount? {#immutableprooftaskretrycount}
1083
+
1084
+ > `optional` **immutableProofTaskRetryCount?**: `number`
1085
+
1086
+ The number of times to retry a proof task when it fails, 0 to disable retries.
1087
+
1088
+ #### Default
1089
+
1090
+ ```ts
1091
+ 5
1092
+ ```
1093
+
1094
+ ***
1095
+
1096
+ ### immutableProofTaskRetryInterval? {#immutableprooftaskretryinterval}
1097
+
1098
+ > `optional` **immutableProofTaskRetryInterval?**: `number`
1099
+
1100
+ The interval in seconds to wait between proof task retries.
1101
+
1102
+ #### Default
1103
+
1104
+ ```ts
1105
+ 5
1106
+ ```
1107
+
1108
+ ***
1109
+
1110
+ ### immutableProofTaskFailureRetainFor? {#immutableprooftaskfailureretainfor}
1111
+
1112
+ > `optional` **immutableProofTaskFailureRetainFor?**: `number`
1113
+
1114
+ The time in minutes to retain the record of a failed proof task.
1115
+ Set to -1 to retain failures forever.
1116
+
1117
+ #### Default
1118
+
1119
+ ```ts
1120
+ 10080
1121
+ ```
1122
+
1123
+ ***
1124
+
1074
1125
  ### attestationConnector? {#attestationconnector}
1075
1126
 
1076
1127
  > `optional` **attestationConnector?**: `string`
@@ -1,5 +1,5 @@
1
1
  # Type Alias: IEnvironmentVariables
2
2
 
3
- > **IEnvironmentVariables** = [`IBootstrapLegacyEnvironmentVariables`](../interfaces/IBootstrapLegacyEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
3
+ > **IEnvironmentVariables** = [`IBootstrapDevEnvironmentVariables`](../interfaces/IBootstrapDevEnvironmentVariables.md) & [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & [`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md) & [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
4
4
 
5
5
  The environment variables.
package/locales/en.json CHANGED
@@ -16,8 +16,8 @@
16
16
  "cliEnvVarMissing": "Environment variable \"{envVar}\" does not exist",
17
17
  "unknownEnvVars": "Unknown environment variable properties [{keys}]. Check for typos in variable names, for custom variables use the {prefix}ENV_ALLOW_LIST."
18
18
  },
19
- "bootstrapLegacy": {
20
- "noFeaturesEnabled": "No features are enabled in legacy bootstrap mode, at least one feature must be enabled.",
19
+ "bootstrapDev": {
20
+ "noFeaturesEnabled": "No features are enabled, at least one feature must be enabled.",
21
21
  "organizationNotSet": "The organisation identity has not been set. Run \"node-org-id-set\"."
22
22
  },
23
23
  "identityCreate": {
@@ -129,9 +129,9 @@
129
129
  "singleTenantOnly": "single-tenant only"
130
130
  }
131
131
  },
132
- "bootstrap-legacy": {
133
- "description": "Bootstrap in legacy mode for backwards compatibility, **will be deprecated in future versions**",
134
- "example": "bootstrap-legacy --load-env=\"./.env.bootstrap-legacy\"",
132
+ "bootstrap-dev": {
133
+ "description": "Bootstrap the development environment",
134
+ "example": "bootstrap-dev --load-env=\"./.env.bootstrap-dev\"",
135
135
  "params": {
136
136
  "env-prefix": {
137
137
  "description": "Prefix to use for standard .env files e.g. TWIN_."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node-core",
3
- "version": "0.9.2-next.1",
3
+ "version": "0.9.2-next.3",
4
4
  "description": "TWIN Node Core for serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrapLegacy.js","sourceRoot":"","sources":["../../../src/commands/bootstrapLegacy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAA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ACpC,UAAU,CAAC,iCAAiC,CAAC,sBAAsB,CAAC,CAAC;IAEtE,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,+BAA+B,CAAC,EAAE,CAAC;QACtD,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,GAAG,CAC9C,+BAA+B,CAC/B,CAAC;IAEF,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO;YACN,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,EAAE;SAC1C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAdminComponent } from \"@twin.org/api-auth-entity-storage-models\";\nimport type { ITenantAdminComponent } from \"@twin.org/api-models\";\nimport { CLIDisplay } from \"@twin.org/cli-core\";\nimport { ContextIdKeys, ContextIdStore } from \"@twin.org/context\";\nimport { Coerce, ComponentFactory, GeneralError, I18n, Is } from \"@twin.org/core\";\nimport type { IEngineCore } from \"@twin.org/engine-models\";\nimport { identityCreate } from \"./identityCreate.js\";\nimport { identityVerificationMethodCreate } from \"./identityVerificationMethodCreate.js\";\nimport { tenantCreate } from \"./tenantCreate.js\";\nimport { userCreate } from \"./userCreate.js\";\nimport { vaultKeyCreate } from \"./vaultKeyCreate.js\";\nimport type { ICliCommandDefinition } from \"../models/ICliCommandDefinition.js\";\nimport type { IEnvironmentVariables } from \"../models/IEnvironmentVariables.js\";\nimport type { INodeEngineConfig } from \"../models/INodeEngineConfig.js\";\nimport type { INodeEngineState } from \"../models/INodeEngineState.js\";\n\nconst COMMAND_NAME = \"bootstrap-legacy\";\n\n/**\n * Get the command definition parameters.\n * @param commandDefinitions The registered command definitions.\n */\nexport function getCommandDefinitionBootstrapLegacy(commandDefinitions: {\n\t[id: string]: ICliCommandDefinition;\n}): void {\n\tcommandDefinitions[COMMAND_NAME] = {\n\t\tcommand: COMMAND_NAME,\n\t\tdescription: I18n.formatMessage(\"node.cli.commands.bootstrap-legacy.description\"),\n\t\texample: I18n.formatMessage(\"node.cli.commands.bootstrap-legacy.example\"),\n\t\trequiresNodeIdentity: false,\n\t\trequiresOrgIdentity: false,\n\t\tparams: [\n\t\t\t{\n\t\t\t\tkey: \"env-prefix\",\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: I18n.formatMessage(\n\t\t\t\t\t\"node.cli.commands.bootstrap-legacy.params.env-prefix.description\"\n\t\t\t\t),\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"load-env\",\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: I18n.formatMessage(\n\t\t\t\t\t\"node.cli.commands.bootstrap-legacy.params.load-env.description\"\n\t\t\t\t),\n\t\t\t\trequired: false\n\t\t\t}\n\t\t],\n\t\taction: async (engineCore, envVars, params) => bootstrapLegacy(engineCore, envVars, params)\n\t};\n}\n\n/**\n * Command for legacy bootstrap.\n * @param engineCore The engine core.\n * @param envVars The environment variables for the node.\n * @param params The parameters for the command.\n * @returns A promise that resolves when the bootstrap sequence has completed.\n */\nexport async function bootstrapLegacy(\n\tengineCore: IEngineCore<INodeEngineConfig, INodeEngineState>,\n\tenvVars: IEnvironmentVariables,\n\tparams: {}\n): Promise<void> {\n\tconst features = (envVars.features ?? \"admin-user,wallet\")\n\t\t.split(\",\")\n\t\t.map(f => f.trim())\n\t\t.filter(f => f.length > 0);\n\n\tconst state = engineCore.getState();\n\tconst requireWallet = features.includes(\"wallet\");\n\tconst tenantEnabled = Coerce.boolean(envVars.tenantEnabled) ?? false;\n\tlet nodeId = state.nodeId ?? envVars.nodeIdentity;\n\tlet organizationId = tenantEnabled ? undefined : state.nodeOrganizationId;\n\tlet tenant: { id: string; organizationId: string } | undefined;\n\n\tif (features.length === 0) {\n\t\tthrow new GeneralError(\"bootstrapLegacy\", \"noFeaturesEnabled\");\n\t}\n\n\tCLIDisplay.break();\n\tCLIDisplay.section(\n\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.nodeIdentityCreate\")\n\t);\n\n\tconst nodeIdentity = await identityCreate(engineCore, envVars, {\n\t\tidentity: nodeId,\n\t\tmnemonic: envVars.nodeMnemonic,\n\t\tfundWallet: requireWallet,\n\t\tnodeId: true\n\t});\n\n\tnodeId = nodeIdentity.did;\n\n\tCLIDisplay.break();\n\tCLIDisplay.section(\n\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.nodeAuthKeyCreate\")\n\t);\n\tawait vaultKeyCreate(engineCore, envVars, {\n\t\tidentity: nodeId,\n\t\tkeyType: \"Ed25519\",\n\t\tkeyId: envVars.authSigningKeyId,\n\t\toverwriteMode: \"skip\"\n\t});\n\n\t// Always create the organisation identity first so it can be associated with\n\t// the tenant (multi-tenant) or the node (single-tenant) immediately after.\n\t// The trust verification method is always added to the organisation identities.\n\tawait ContextIdStore.run({ [ContextIdKeys.Node]: nodeId }, async () => {\n\t\tCLIDisplay.break();\n\t\tCLIDisplay.section(\n\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.organisationCreate\")\n\t\t);\n\n\t\tif (tenantEnabled) {\n\t\t\tconst existingTenant = Is.stringValue(envVars.tenantId)\n\t\t\t\t? await resolveTenantById(engineCore, envVars.tenantId)\n\t\t\t\t: await resolveDefaultTenant(engineCore);\n\t\t\torganizationId = existingTenant?.organizationId;\n\t\t}\n\n\t\tconst organisation = await identityCreate(engineCore, envVars, {\n\t\t\tidentity: organizationId ?? envVars.organizationIdentity,\n\t\t\tmnemonic: envVars.organizationMnemonic,\n\t\t\tfundWallet: requireWallet\n\t\t});\n\t\torganizationId = organisation.did;\n\n\t\tCLIDisplay.break();\n\t\tCLIDisplay.section(\n\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.trustVerificationMethodCreate\")\n\t\t);\n\t\tawait identityVerificationMethodCreate(engineCore, envVars, {\n\t\t\tidentity: organisation.did,\n\t\t\tverificationMethodType: \"assertionMethod\",\n\t\t\tverificationMethodId: envVars.trustVerificationMethodId,\n\t\t\toverwriteMode: \"skip\"\n\t\t});\n\n\t\tif (Coerce.boolean(envVars.blobStorageEnableEncryption) ?? false) {\n\t\t\tCLIDisplay.break();\n\t\t\tCLIDisplay.section(\n\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.blobStorageKeyCreate\")\n\t\t\t);\n\t\t\tawait vaultKeyCreate(engineCore, envVars, {\n\t\t\t\tidentity: organizationId,\n\t\t\t\tkeyType: \"ChaCha20Poly1305\",\n\t\t\t\tkeyId: envVars.blobStorageEncryptionKeyId,\n\t\t\t\toverwriteMode: \"skip\"\n\t\t\t});\n\t\t}\n\n\t\tconst defaultAttestationConnectorType =\n\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"attestationConnector\");\n\t\tif (!Is.empty(defaultAttestationConnectorType)) {\n\t\t\tCLIDisplay.break();\n\t\t\tCLIDisplay.section(\n\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.attestationMethodCreate\")\n\t\t\t);\n\t\t\tawait identityVerificationMethodCreate(engineCore, envVars, {\n\t\t\t\tidentity: organizationId,\n\t\t\t\tverificationMethodType: \"assertionMethod\",\n\t\t\t\tverificationMethodId: envVars.attestationVerificationMethodId,\n\t\t\t\toverwriteMode: \"skip\"\n\t\t\t});\n\t\t}\n\n\t\tconst defaultImmutableProofComponentType =\n\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"immutableProofComponent\");\n\n\t\tif (!Is.empty(defaultImmutableProofComponentType)) {\n\t\t\tCLIDisplay.break();\n\t\t\tCLIDisplay.section(\n\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.immutableProofMethodCreate\")\n\t\t\t);\n\t\t\tawait identityVerificationMethodCreate(engineCore, envVars, {\n\t\t\t\tidentity: organizationId,\n\t\t\t\tverificationMethodType: \"assertionMethod\",\n\t\t\t\tverificationMethodId: envVars.immutableProofVerificationMethodId,\n\t\t\t\toverwriteMode: \"skip\"\n\t\t\t});\n\t\t}\n\n\t\t// In single-tenant mode, record the org DID in state so the node can resolve its\n\t\t// organisation without a tenant lookup.\n\t\tif (!tenantEnabled && !Is.stringValue(state.nodeOrganizationId)) {\n\t\t\tCLIDisplay.break();\n\t\t\tCLIDisplay.section(\n\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.nodeOrganizationIdSet\")\n\t\t\t);\n\t\t\tstate.nodeOrganizationId = organisation.did;\n\t\t\tengineCore.setStateDirty();\n\t\t\tCLIDisplay.done();\n\t\t}\n\t});\n\n\tif (tenantEnabled) {\n\t\tawait ContextIdStore.run({ [ContextIdKeys.Node]: nodeId }, async () => {\n\t\t\t// Resolve an existing tenant so a re-run does not create a duplicate.\n\t\t\t// When a specific tenant ID is configured, look it up directly;\n\t\t\t// otherwise search for the first tenant labelled \"Tenant\".\n\t\t\tif (Is.stringValue(envVars.tenantId)) {\n\t\t\t\ttenant = await resolveTenantById(engineCore, envVars.tenantId);\n\t\t\t} else {\n\t\t\t\ttenant = await resolveDefaultTenant(engineCore);\n\t\t\t}\n\n\t\t\t// Still empty so create a new tenant for the node and associate it with the organisation.\n\t\t\tif (Is.empty(tenant)) {\n\t\t\t\tCLIDisplay.break();\n\t\t\t\tCLIDisplay.section(\n\t\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.nodeTenantCreate\")\n\t\t\t\t);\n\t\t\t\tconst tenantDetails = await tenantCreate(engineCore, envVars, {\n\t\t\t\t\ttenantId: envVars.tenantId,\n\t\t\t\t\tapiKey: envVars.tenantApiKey,\n\t\t\t\t\tlabel: \"Tenant\",\n\t\t\t\t\torganizationId\n\t\t\t\t});\n\n\t\t\t\ttenant = {\n\t\t\t\t\tid: tenantDetails.tenantId,\n\t\t\t\t\torganizationId: organizationId ?? tenantDetails.organizationId ?? \"\"\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\n\tif (features.includes(\"admin-user\")) {\n\t\tawait ContextIdStore.run(\n\t\t\t{ [ContextIdKeys.Node]: nodeId, [ContextIdKeys.Tenant]: tenant?.id },\n\t\t\tasync () => {\n\t\t\t\tconst orgDid = await resolveOrganizationDid(engineCore, tenantEnabled, tenant?.id);\n\t\t\t\tconst effectiveAdminEmail =\n\t\t\t\t\tenvVars.adminUserName ?? `admin@${tenantEnabled ? \"tenant\" : \"node\"}`;\n\t\t\t\tconst adminUser = await resolveDefaultAdminUser(engineCore, effectiveAdminEmail);\n\t\t\t\tlet userDid = adminUser?.userIdentity;\n\n\t\t\t\tif (Is.empty(adminUser)) {\n\t\t\t\t\tCLIDisplay.break();\n\t\t\t\t\tCLIDisplay.section(\n\t\t\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.adminIdentityCreate\")\n\t\t\t\t\t);\n\t\t\t\t\tconst result = await identityCreate(engineCore, envVars, {\n\t\t\t\t\t\tidentity: envVars.adminUserIdentity,\n\t\t\t\t\t\tmnemonic: envVars.adminUserMnemonic,\n\t\t\t\t\t\tcontroller: orgDid\n\t\t\t\t\t});\n\n\t\t\t\t\tuserDid = result.did;\n\t\t\t\t}\n\n\t\t\t\tCLIDisplay.break();\n\t\t\t\tCLIDisplay.section(\n\t\t\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.adminUserCreate\")\n\t\t\t\t);\n\t\t\t\tawait userCreate(engineCore, envVars, {\n\t\t\t\t\tuserIdentity: userDid,\n\t\t\t\t\torganizationIdentity: orgDid,\n\t\t\t\t\ttenantId: tenant?.id,\n\t\t\t\t\temail: envVars.adminUserName ?? `admin@${tenantEnabled ? \"tenant\" : \"node\"}`,\n\t\t\t\t\tpassword: envVars.adminUserPassword,\n\t\t\t\t\tscope:\n\t\t\t\t\t\tenvVars.adminUserScope ??\n\t\t\t\t\t\t(tenantEnabled ? [\"tenant-admin\", \"user-admin\"] : [\"user-admin\"]).join(\",\"),\n\t\t\t\t\tgivenName: tenantEnabled ? \"Tenant\" : \"Node\",\n\t\t\t\t\tfamilyName: \"Admin\",\n\t\t\t\t\toverwriteMode: \"skip\"\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n}\n\n/**\n * Resolve the organisation DID from node state (single-tenant) or the tenant entry (multi-tenant).\n * @param engineCore The engine core.\n * @param tenantEnabled Whether multi-tenancy is enabled.\n * @param tenantId The active tenant ID (multi-tenant only).\n * @returns The organisation DID.\n * @throws GeneralError if the organisation has not been associated yet.\n * @internal\n */\nasync function resolveOrganizationDid(\n\tengineCore: IEngineCore<INodeEngineConfig, INodeEngineState>,\n\ttenantEnabled: boolean,\n\ttenantId: string | undefined\n): Promise<string> {\n\tif (tenantEnabled) {\n\t\tif (Is.stringValue(tenantId)) {\n\t\t\tconst tenantAdminComponentType =\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\");\n\t\t\tif (Is.stringValue(tenantAdminComponentType)) {\n\t\t\t\tconst tenantAdminComponent =\n\t\t\t\t\tComponentFactory.get<ITenantAdminComponent>(tenantAdminComponentType);\n\t\t\t\tconst tenant = await tenantAdminComponent.get(tenantId);\n\t\t\t\tif (Is.stringValue(tenant.organizationId)) {\n\t\t\t\t\treturn tenant.organizationId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst state = engineCore.getState();\n\t\tif (Is.stringValue(state.nodeOrganizationId)) {\n\t\t\treturn state.nodeOrganizationId;\n\t\t}\n\t}\n\n\tthrow new GeneralError(\"bootstrapLegacy\", \"organizationNotSet\");\n}\n\n/**\n * Resolve the default tenant id for re-bootstrap when multi-tenancy is enabled.\n * @param engineCore The engine core.\n * @returns The tenant id if one exists in storage.\n * @internal\n */\nasync function resolveDefaultTenant(\n\tengineCore: IEngineCore<INodeEngineConfig, INodeEngineState>\n): Promise<{ id: string; organizationId: string } | undefined> {\n\tconst tenantAdminServiceComponentType =\n\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\");\n\n\tif (!Is.stringValue(tenantAdminServiceComponentType)) {\n\t\treturn undefined;\n\t}\n\n\tconst tenantAdminService = ComponentFactory.get<ITenantAdminComponent>(\n\t\ttenantAdminServiceComponentType\n\t);\n\n\tlet cursor: string | undefined;\n\tlet firstTenant: { id: string; organizationId: string } | undefined;\n\n\tdo {\n\t\tconst result = await tenantAdminService.query(\n\t\t\tundefined,\n\t\t\t[\"id\", \"organizationId\", \"label\"],\n\t\t\tcursor\n\t\t);\n\t\tconst nodeTenant = result.tenants.find(tenant => tenant.label === \"Tenant\");\n\t\tif (nodeTenant) {\n\t\t\treturn {\n\t\t\t\tid: nodeTenant.id,\n\t\t\t\torganizationId: nodeTenant.organizationId ?? \"\"\n\t\t\t};\n\t\t}\n\n\t\tif (Is.empty(firstTenant) && Is.arrayValue(result.tenants)) {\n\t\t\tfirstTenant = {\n\t\t\t\tid: result.tenants[0].id,\n\t\t\t\torganizationId: result.tenants[0].organizationId ?? \"\"\n\t\t\t};\n\t\t}\n\n\t\tcursor = result.cursor;\n\t} while (Is.stringValue(cursor));\n\n\tif (!Is.empty(firstTenant)) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"node.cli.commands.bootstrap-legacy.labels.tenantFallback\"),\n\t\t\tfirstTenant.id\n\t\t);\n\t}\n\n\treturn firstTenant;\n}\n\n/**\n * Resolve the admin user by email for idempotent re-bootstrap.\n * @param engineCore The engine core.\n * @param email The email address of the admin user to look up.\n * @returns The admin user if one exists in storage.\n * @internal\n */\nasync function resolveDefaultAdminUser(\n\tengineCore: IEngineCore<INodeEngineConfig, INodeEngineState>,\n\temail: string\n): Promise<{ email: string; userIdentity: string; organizationIdentity: string } | undefined> {\n\tconst defaultAuthenticationAdminComponentType = engineCore.getRegisteredInstanceType(\n\t\t\"authenticationAdminComponent\"\n\t);\n\tconst authenticationAdminComponent = ComponentFactory.get<IAuthenticationAdminComponent>(\n\t\tdefaultAuthenticationAdminComponentType\n\t);\n\n\ttry {\n\t\treturn await authenticationAdminComponent.get(email);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Resolve a tenant by its specific ID for idempotent re-bootstrap.\n * @param engineCore The engine core.\n * @param tenantId The tenant ID to look up.\n * @returns The tenant if found, otherwise undefined.\n * @internal\n */\nasync function resolveTenantById(\n\tengineCore: IEngineCore<INodeEngineConfig, INodeEngineState>,\n\ttenantId: string\n): Promise<{ id: string; organizationId: string } | undefined> {\n\tconst tenantAdminServiceComponentType =\n\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\");\n\n\tif (!Is.stringValue(tenantAdminServiceComponentType)) {\n\t\treturn undefined;\n\t}\n\n\tconst tenantAdminService = ComponentFactory.get<ITenantAdminComponent>(\n\t\ttenantAdminServiceComponentType\n\t);\n\n\ttry {\n\t\tconst found = await tenantAdminService.get(tenantId);\n\t\treturn {\n\t\t\tid: found.id,\n\t\t\torganizationId: found.organizationId ?? \"\"\n\t\t};\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IBootstrapLegacyEnvironmentVariables.js","sourceRoot":"","sources":["../../../src/models/IBootstrapLegacyEnvironmentVariables.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The environment variables for the bootstrap legacy.\n */\nexport interface IBootstrapLegacyEnvironmentVariables {\n\t/**\n\t * The features that are enabled on the node.\n\t * @default []\n\t */\n\tfeatures?: string;\n\n\t/**\n\t * The identity of the node which, if empty and node-identity feature is enabled it will be generated.\n\t */\n\tnodeIdentity?: string;\n\n\t/**\n\t * The mnemonic for the node identity, if empty it will be randomly generated.\n\t */\n\tnodeMnemonic?: string;\n\n\t/**\n\t * A tenant id to use as a default for the node.\n\t */\n\ttenantId?: string;\n\n\t/**\n\t * A tenant api key to use as a default for the node.\n\t */\n\ttenantApiKey?: string;\n\n\t/**\n\t * The organisation identity. If not provided it will be generated.\n\t */\n\torganizationIdentity?: string;\n\n\t/**\n\t * The mnemonic for the organisation identity, if empty it will be randomly generated.\n\t */\n\torganizationMnemonic?: string;\n\n\t/**\n\t * If the admin-user feature is enabled, this will be the identity of the user. If not provided it will be generated.\n\t */\n\tadminUserIdentity?: string;\n\n\t/**\n\t * The mnemonic for the admin user, if empty it will be randomly generated.\n\t */\n\tadminUserMnemonic?: string;\n\n\t/**\n\t * If the admin-user feature is enabled, this will be the name of the user.\n\t * @default admin@node\n\t */\n\tadminUserName?: string;\n\n\t/**\n\t * If the admin-user feature is enabled, this will be the password of the user. If empty it will be randomly generated.\n\t */\n\tadminUserPassword?: string;\n\n\t/**\n\t * If the admin-user feature is enabled, this is a comma-separated list of scopes for the user.\n\t * @default tenant-admin,user-admin (when tenant enabled) or user-admin (when tenant disabled)\n\t */\n\tadminUserScope?: string;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrapLegacyEnvironmentVariableKeys.js","sourceRoot":"","sources":["../../../src/models/bootstrapLegacyEnvironmentVariableKeys.ts"],"names":[],"mappings":"AAIA,qEAAqE;AACrE,mFAAmF;AACnF,4DAA4D;AAC5D,+FAA+F;AAC/F,MAAM,8CAA8C,GAEhD;IACH,uCAAuC;IACvC,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,oBAAoB,EAAE,IAAI;IAC1B,oBAAoB,EAAE,IAAI;IAC1B,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,IAAI;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAwB,IAAI,GAAG,CACrF,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAC3D,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBootstrapLegacyEnvironmentVariables } from \"./IBootstrapLegacyEnvironmentVariables.js\";\n\n// Mapped type exhaustiveness check: TypeScript requires every key of\n// Required<IBootstrapLegacyEnvironmentVariables> to appear here with value `true`.\n// Removing a key → compile error (\"Property X is missing\").\n// Adding an invented key → compile error (\"Object literal may only specify known properties\").\nconst bootstrapLegacyEnvironmentVariableKeysInternal: {\n\t[K in keyof Required<IBootstrapLegacyEnvironmentVariables>]: true;\n} = {\n\t// IBootstrapLegacyEnvironmentVariables\n\tfeatures: true,\n\tnodeIdentity: true,\n\tnodeMnemonic: true,\n\ttenantId: true,\n\ttenantApiKey: true,\n\torganizationIdentity: true,\n\torganizationMnemonic: true,\n\tadminUserIdentity: true,\n\tadminUserMnemonic: true,\n\tadminUserName: true,\n\tadminUserPassword: true,\n\tadminUserScope: true\n};\n\n/**\n * The set of camelCase property names that are valid IBootstrapLegacyEnvironmentVariables keys.\n */\nexport const BOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS: ReadonlySet<string> = new Set(\n\tObject.keys(bootstrapLegacyEnvironmentVariableKeysInternal)\n);\n"]}