@twin.org/node-core 0.9.4-next.5 → 0.9.4

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 (44) hide show
  1. package/dist/es/builders/engineEnvBuilder.js +369 -470
  2. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  3. package/dist/es/builders/engineServerEnvBuilder.js +2 -5
  4. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
  5. package/dist/es/builders/helper/envHelpers.js +0 -39
  6. package/dist/es/builders/helper/envHelpers.js.map +1 -1
  7. package/dist/es/cli.js +1 -1
  8. package/dist/es/cli.js.map +1 -1
  9. package/dist/es/commands/bootstrapDev.js +3 -3
  10. package/dist/es/commands/bootstrapDev.js.map +1 -1
  11. package/dist/es/commands/help.js +1 -1
  12. package/dist/es/commands/help.js.map +1 -1
  13. package/dist/es/commands/identityCreate.js +2 -2
  14. package/dist/es/commands/identityCreate.js.map +1 -1
  15. package/dist/es/commands/identityVerificationMethodCreate.js +2 -2
  16. package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -1
  17. package/dist/es/commands/userCreate.js +1 -1
  18. package/dist/es/commands/userCreate.js.map +1 -1
  19. package/dist/es/commands/vaultKeyCreate.js +1 -1
  20. package/dist/es/commands/vaultKeyCreate.js.map +1 -1
  21. package/dist/es/commands/vaultKeyImport.js +1 -1
  22. package/dist/es/commands/vaultKeyImport.js.map +1 -1
  23. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  24. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
  25. package/dist/es/models/engineEnvironmentVariableKeys.js +3 -14
  26. package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -1
  27. package/dist/es/models/engineServerEnvironmentVariableKeys.js +0 -1
  28. package/dist/es/models/engineServerEnvironmentVariableKeys.js.map +1 -1
  29. package/dist/es/node.js +21 -40
  30. package/dist/es/node.js.map +1 -1
  31. package/dist/types/builders/engineEnvBuilder.d.ts +0 -7
  32. package/dist/types/builders/helper/envHelpers.d.ts +0 -30
  33. package/dist/types/models/IEngineEnvironmentVariables.d.ts +12 -48
  34. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +0 -4
  35. package/docs/changelog.md +24 -180
  36. package/docs/reference/index.md +0 -1
  37. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +21 -93
  38. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +0 -8
  39. package/locales/en.json +1 -3
  40. package/package.json +34 -34
  41. package/dist/es/models/deprecatedEnvironmentVariableKeys.js +0 -16
  42. package/dist/es/models/deprecatedEnvironmentVariableKeys.js.map +0 -1
  43. package/dist/types/models/deprecatedEnvironmentVariableKeys.d.ts +0 -7
  44. package/docs/reference/functions/isMailboxEnabled.md +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC1D,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,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,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AAC,GAAG,EAAE,cAAc,CAAC,EAC7E,cAAc,CACd,CAAC;oBAEF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;oBAC3D,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBACzE,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;oBACvD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;oBAC5C,IAAI,MAAM,EAAE,CAAC;wBACZ,YAAY,GAAG,UAAU,CAAC;oBAC3B,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC;oBACR,4CAA4C;gBAC7C,CAAC;gBACD,MAAM;YACP,CAAC;QACF,CAAC;QAED,0CAA0C;QAC1C,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,MAAM,GAAG,MAAM,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","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport type { IServerInfo } from \"@twin.org/api-models\";\nimport { CLIDisplay, CLIUtils } 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 { commaSeparatedListToArray } from \"./builders/helper/envHelpers.js\";\nimport { constructCliCommand, parseCommandLineArgs, registerCommands } from \"./cli.js\";\nimport { getEnvDefaults } from \"./defaults.js\";\nimport { BOOTSTRAP_DEV_ENVIRONMENT_VARIABLE_KEYS } from \"./models/bootstrapDevEnvironmentVariableKeys.js\";\nimport { DEPRECATED_ENVIRONMENT_VARIABLE_KEYS } from \"./models/deprecatedEnvironmentVariableKeys.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 } = {};\n\n/**\n * Run the 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.4-next.5\" // 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.notEmpty(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 * Report any environment variables which are still recognised but no longer used.\n * @param envVars The already-converted camelCase env variables.\n * @param prefix The prefix used for the environment variables (e.g. \"TWIN_\").\n */\nfunction warnDeprecatedEnvVarKeys(\n\tenvVars: { [id: string]: string | unknown },\n\tprefix: string\n): void {\n\tfor (const camelKey of Object.keys(envVars)) {\n\t\tconst replacements = DEPRECATED_ENVIRONMENT_VARIABLE_KEYS.get(camelKey);\n\t\tif (!Is.undefined(replacements)) {\n\t\t\tconst key = EnvHelper.jsonKeyToEnvVarKey(camelKey, prefix);\n\n\t\t\tif (Is.arrayValue(replacements)) {\n\t\t\t\tCLIDisplay.warning(\n\t\t\t\t\tI18n.formatMessage(\"warn.node.deprecatedEnvVar\", {\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\treplacements: replacements\n\t\t\t\t\t\t\t.map(replacement => EnvHelper.jsonKeyToEnvVarKey(replacement, prefix))\n\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tCLIDisplay.warning(I18n.formatMessage(\"warn.node.deprecatedEnvVarNoReplacement\", { key }));\n\t\t\t}\n\t\t}\n\t}\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\tcommaSeparatedListToArray<string>(envVars.envAllowList as string).map(k =>\n\t\t\tEnvHelper.envVarKeyToJsonKey(k.trim(), prefix)\n\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\t\t!DEPRECATED_ENVIRONMENT_VARIABLE_KEYS.has(camelKey)\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\twarnDeprecatedEnvVarKeys(envVars, options.envPrefix ?? \"\");\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 = await CLIUtils.findPackageRoot(moduleName, executionDirectory);\n\t\t\t\t\tif (Is.stringValue(packagePath)) {\n\t\t\t\t\t\tconst mainFile = await resolvePackageEntryPoint(packagePath, moduleName);\n\t\t\t\t\t\tconst modulePath = path.resolve(packagePath, mainFile);\n\t\t\t\t\t\tconst exists = await fileExists(modulePath);\n\t\t\t\t\t\tif (exists) {\n\t\t\t\t\t\t\tresolvedPath = modulePath;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\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"]}
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,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,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,cAAc,EAAE,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AC;oBAEF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;oBAC3D,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;oBACzE,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;oBACvD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;oBAC5C,IAAI,MAAM,EAAE,CAAC;wBACZ,YAAY,GAAG,UAAU,CAAC;oBAC3B,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC;oBACR,4CAA4C;gBAC7C,CAAC;gBACD,MAAM;YACP,CAAC;QACF,CAAC;QAED,0CAA0C;QAC1C,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,MAAM,GAAG,MAAM,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 { commaSeparatedListToArray } from \"./builders/helper/envHelpers.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 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.4\" // 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\tcommaSeparatedListToArray<string>(envVars.envAllowList as string).map(k =>\n\t\t\tEnvHelper.envVarKeyToJsonKey(k.trim(), prefix)\n\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"]}
@@ -72,10 +72,3 @@ export declare function isTelemetryEnabled(envVars: IEngineEnvironmentVariables)
72
72
  * @returns True if tracing is enabled.
73
73
  */
74
74
  export declare function isTracingEnabled(envVars: IEngineEnvironmentVariables): boolean;
75
- /**
76
- * Checks if the mailbox subsystem is enabled.
77
- * Returns true when any component that depends on the mailbox subsystem is enabled.
78
- * @param envVars The environment variables.
79
- * @returns True if mailbox is enabled.
80
- */
81
- export declare function isMailboxEnabled(envVars: IEngineEnvironmentVariables): boolean;
@@ -1,23 +1,3 @@
1
- /**
2
- * Returns an env var as a string when it holds a non-empty value, falling back to the supplied default.
3
- * @param envVars The environment variables object.
4
- * @param key The property name of the env var to read.
5
- * @param defaultValue The value to return when the env var is absent or empty. Omit to return undefined when absent.
6
- * @returns The string value, the default, or undefined when absent and no default given.
7
- */
8
- export declare function envString<T>(envVars: T, key: keyof T, defaultValue: string): string;
9
- export declare function envString<T>(envVars: T, key: keyof T): string | undefined;
10
- /**
11
- * Returns an env var constrained to one of the supplied choices, falling back to the supplied default.
12
- * @param envVars The environment variables object.
13
- * @param key The property name of the env var to read.
14
- * @param choices The permitted values for the env var.
15
- * @param defaultValue The value to return when the env var is absent or empty. Omit to return undefined when absent.
16
- * @returns The matching choice, the default, or undefined when absent and no default given.
17
- * @throws GeneralError if the value is set but is not one of the choices.
18
- */
19
- export declare function envChoice<T, U extends string>(envVars: T, key: keyof T, choices: readonly U[], defaultValue: U): U;
20
- export declare function envChoice<T, U extends string>(envVars: T, key: keyof T, choices: readonly U[]): U | undefined;
21
1
  /**
22
2
  * Coerces an env var to a boolean, falling back to the supplied default when not set.
23
3
  * @param envVars The environment variables object.
@@ -142,16 +122,6 @@ export declare function envSecToMs<T>(envVars: T, key: keyof T): number | undefi
142
122
  */
143
123
  export declare function envMinToMs<T>(envVars: T, key: keyof T, defaultValue: number): number;
144
124
  export declare function envMinToMs<T>(envVars: T, key: keyof T): number | undefined;
145
- /**
146
- * Converts a comma separated list to an array.
147
- * @param envVars The environment variables object.
148
- * @param key The property name of the env var.
149
- * @param expectedValues An optional array of expected values.
150
- * @param defaultValue The default value to return when the list is empty or undefined.
151
- * @throws GeneralError if the list contains a value not in the expected values.
152
- * @returns The array.
153
- */
154
- export declare function envListToArray<T, U>(envVars: T, key: keyof T, expectedValues?: U[], defaultValue?: U[] | undefined): U[];
155
125
  /**
156
126
  * Converts a comma separated list to an array.
157
127
  * @param value The comma separated list.
@@ -441,9 +441,9 @@ export interface IEngineEnvironmentVariables {
441
441
  */
442
442
  eventBusComponent?: string;
443
443
  /**
444
- * The email protocol connector types, comma-separated: pop3, imap, gmail, outlook.
444
+ * Are the messaging components enabled, defaults to false.
445
445
  */
446
- emailProtocolConnector?: string;
446
+ messagingEnabled?: string;
447
447
  /**
448
448
  * AWS SES region.
449
449
  */
@@ -469,29 +469,9 @@ export interface IEngineEnvironmentVariables {
469
469
  */
470
470
  awsMessagingPushNotificationApplications?: string;
471
471
  /**
472
- * The type of messaging email connector: entity-storage, aws, smtp.
472
+ * The type of messaging email connector: entity-storage, aws.
473
473
  */
474
474
  messagingEmailConnector?: string;
475
- /**
476
- * SMTP server hostname or IP address.
477
- */
478
- smtpHost?: string;
479
- /**
480
- * SMTP server port, defaults to 587.
481
- */
482
- smtpPort?: string;
483
- /**
484
- * Whether the SMTP connector uses TLS.
485
- */
486
- smtpSecure?: string;
487
- /**
488
- * SMTP authentication username.
489
- */
490
- smtpUsername?: string;
491
- /**
492
- * SMTP authentication password.
493
- */
494
- smtpPassword?: string;
495
475
  /**
496
476
  * The type of messaging sms connector: entity-storage, aws.
497
477
  */
@@ -564,7 +544,7 @@ export interface IEngineEnvironmentVariables {
564
544
  */
565
545
  tracingSilentComponents?: string;
566
546
  /**
567
- * The type of tracing connector, comma-separated for multiple: entity-storage, open-telemetry, console, silent.
547
+ * The type of tracing connector, comma-separated for multiple: entity-storage, open-telemetry, silent.
568
548
  */
569
549
  tracingConnector?: string;
570
550
  /**
@@ -744,6 +724,10 @@ export interface IEngineEnvironmentVariables {
744
724
  * The identity verification method id to use with attestation.
745
725
  */
746
726
  attestationVerificationMethodId?: string;
727
+ /**
728
+ * Is the data processing enabled, defaults to false.
729
+ */
730
+ dataProcessingEnabled?: string;
747
731
  /**
748
732
  * The type of the default data converters, can be a comma separated list: json, xml.
749
733
  */
@@ -963,30 +947,6 @@ export interface IEngineEnvironmentVariables {
963
947
  * The interval in seconds for running the application health lifecycle (init, application, teardown), defaults to 300.
964
948
  */
965
949
  healthApplicationInterval?: string;
966
- /**
967
- * The maximum number of workers to use for processing background tasks, defaults to twice the number of CPU cores.
968
- */
969
- backgroundTaskMaxSystemWorkerCount?: string;
970
- /**
971
- * The interval in milliseconds to leave between background tasks, defaults to 100.
972
- */
973
- backgroundTaskInterval?: string;
974
- /**
975
- * The interval in milliseconds to leave between background task retries, defaults to 5000.
976
- */
977
- backgroundTaskRetryInterval?: string;
978
- /**
979
- * The interval in milliseconds between sweeps removing retained background tasks, defaults to 120000.
980
- */
981
- backgroundTaskCleanupInterval?: string;
982
- /**
983
- * The time in milliseconds to wait for each handler's workers to shut down before terminating them, defaults to 5000.
984
- */
985
- backgroundTaskWorkerShutdownTimeout?: string;
986
- /**
987
- * The maximum dispatches of a background task attempt before it is failed as interrupted, defaults to 3, set to -1 for no limit.
988
- */
989
- backgroundTaskMaxDispatchCount?: string;
990
950
  /**
991
951
  * The type of the automation action to create, comma separate for more than one connector.
992
952
  * values: fetch
@@ -1012,6 +972,10 @@ export interface IEngineEnvironmentVariables {
1012
972
  * The mutex timeout in milliseconds for the document management component.
1013
973
  */
1014
974
  documentManagementMutexTimeout?: string;
975
+ /**
976
+ * The mutex timeout in milliseconds for the logging component.
977
+ */
978
+ loggingMutexTimeout?: string;
1015
979
  /**
1016
980
  * The mutex timeout in milliseconds for the memory and file entity storage connectors.
1017
981
  */
@@ -34,10 +34,6 @@ export interface IEngineServerEnvironmentVariables {
34
34
  * The public origin URL for the API e.g. https://api.example.com:1234
35
35
  */
36
36
  publicOrigin?: string;
37
- /**
38
- * The time in milliseconds Fastify waits for a plugin to load before failing, defaults to 30000.
39
- */
40
- fastifyPluginTimeout?: string;
41
37
  /**
42
38
  * The type of auth admin processor to use on the API: entity-storage.
43
39
  */
package/docs/changelog.md CHANGED
@@ -1,193 +1,37 @@
1
1
  # Changelog
2
2
 
3
- ## [0.9.4-next.5](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4-next.4...node-core-v0.9.4-next.5) (2026-09-11)
3
+ ## [0.9.4](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4...node-core-v0.9.4) (2026-09-14)
4
4
 
5
5
 
6
6
  ### Features
7
7
 
8
- * add background task max dispatch count ([f0965a0](https://github.com/iotaledger/twin-node/commit/f0965a004dc0e0a856fc0fe1e58330f84e09aa3b))
9
- * add outlook connector ([cf7ee0b](https://github.com/iotaledger/twin-node/commit/cf7ee0b73042cb33e693f3677386ca94567bb6e4))
10
- * remove mutex timeout from logger ([e5a5407](https://github.com/iotaledger/twin-node/commit/e5a540725fa97b523f88589f582501f41b982d5b))
11
-
12
- ## [0.9.4-next.4](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4-next.3...node-core-v0.9.4-next.4) (2026-09-10)
13
-
14
-
15
- ### Features
16
-
17
- * custom plugin timeout ([#395](https://github.com/iotaledger/twin-node/issues/395)) ([d4a33ba](https://github.com/iotaledger/twin-node/commit/d4a33ba10a54c6dfab0b845b386201ac326df88a))
18
-
19
- ## [0.9.4-next.3](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4-next.2...node-core-v0.9.4-next.3) (2026-09-09)
20
-
21
-
22
- ### Features
23
-
24
- * update components ([a2643b9](https://github.com/iotaledger/twin-node/commit/a2643b9ce7e338e4853237a6daba7fa58d9fc5c8))
25
-
26
- ## [0.9.4-next.2](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4-next.1...node-core-v0.9.4-next.2) (2026-09-08)
27
-
28
-
29
- ### Features
30
-
31
- * telemetry and deprecated variables ([198f43f](https://github.com/iotaledger/twin-node/commit/198f43fd2d94e2f6721924365b73c0af3020e31d))
32
-
33
- ## [0.9.4-next.1](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.4-next.0...node-core-v0.9.4-next.1) (2026-09-07)
34
-
35
-
36
- ### Features
37
-
38
- * add additional env vars ([#328](https://github.com/iotaledger/twin-node/issues/328)) ([6ca8718](https://github.com/iotaledger/twin-node/commit/6ca87184bc4d78829c957ea055d3c281aca6cf9f))
39
- * add automation ([cfc63b4](https://github.com/iotaledger/twin-node/commit/cfc63b465c139280f696877df21d54dc6a065a7e))
40
- * add CLI commands and remove automated bootstrap code ([#69](https://github.com/iotaledger/twin-node/issues/69)) ([6e40933](https://github.com/iotaledger/twin-node/commit/6e40933d8bb820b380e1074fc88feeedca0ef7d9))
41
- * add context id features ([#53](https://github.com/iotaledger/twin-node/issues/53)) ([827adf5](https://github.com/iotaledger/twin-node/commit/827adf52cb87fca53cec52b27e67f7a9dba2c088))
42
- * add data space connector ([5a57087](https://github.com/iotaledger/twin-node/commit/5a57087d938265d3a4a812ff7c83d130ea4e103c))
43
- * add data space connector ([f7a3644](https://github.com/iotaledger/twin-node/commit/f7a364477ec664e333e5ad018795acec6ee61edc))
44
- * add data space connector ([157e8b0](https://github.com/iotaledger/twin-node/commit/157e8b0a76e3a8a63c1991924f7f963eb83e27ae))
45
- * add dataspace endpoint tests for app-datasets, transfers, and data plane ([#213](https://github.com/iotaledger/twin-node/issues/213)) ([5641a78](https://github.com/iotaledger/twin-node/commit/5641a781bf17a1914912f3162116d7c5f5c0dca2))
46
- * add dsp sweep vars ([#340](https://github.com/iotaledger/twin-node/issues/340)) ([5487c13](https://github.com/iotaledger/twin-node/commit/5487c13197fcd386206ec37f9f342c55ec5b1176))
47
- * add extensions support ([476d5a8](https://github.com/iotaledger/twin-node/commit/476d5a864026a2f78e5b02bc9eb81359777a4a45))
48
- * add isDefault flag to logging connectors ([358e839](https://github.com/iotaledger/twin-node/commit/358e8394819dab9832d3a9ebfac74b897b7d5f40))
49
- * add logging otel ([2adf4e4](https://github.com/iotaledger/twin-node/commit/2adf4e44fd2ef4cce43f354da2187719c72cc3cd))
50
- * add module cache and improve resolution ([482be05](https://github.com/iotaledger/twin-node/commit/482be056c37a598033250ea8a7288a33cf3470b4))
51
- * add module override for better local import resolution ([ba00d17](https://github.com/iotaledger/twin-node/commit/ba00d17beea0a9a1851c89ad7c6a33256051c818))
52
- * add mutex settings ([#222](https://github.com/iotaledger/twin-node/issues/222)) ([492c55f](https://github.com/iotaledger/twin-node/commit/492c55f67d5f70c2a4a27dfdb2700a644ee87955))
53
- * add new endpoints ([cc6e30d](https://github.com/iotaledger/twin-node/commit/cc6e30d85f7ed8018697462a7100e5c2f4e8f407))
54
- * add notarization ([#121](https://github.com/iotaledger/twin-node/issues/121)) ([b2a11df](https://github.com/iotaledger/twin-node/commit/b2a11df92c7b5026f73f08a018c0586ebe008e92))
55
- * add obligation enforcers and multi instance support ([#89](https://github.com/iotaledger/twin-node/issues/89)) ([d81af99](https://github.com/iotaledger/twin-node/commit/d81af99b8c4db6e9a1370b7065bf6d9d222c71ed))
56
- * add rights management ([78fba62](https://github.com/iotaledger/twin-node/commit/78fba62f82afdbe615d55dd90eca8ee70ea62fc0))
57
- * add rights management components ([0fc6293](https://github.com/iotaledger/twin-node/commit/0fc629332db24494bd73003625c7bf3f939a2597))
58
- * add standalone federated catalogue example config and endpoint tests ([#235](https://github.com/iotaledger/twin-node/issues/235)) ([ffb51dd](https://github.com/iotaledger/twin-node/commit/ffb51ddda5188c2f21b8ce65343b39a28f4eee4b))
59
- * add support for dynamodb connection timeout ([63051b0](https://github.com/iotaledger/twin-node/commit/63051b0d22138079115dfac921e7f0c45eaad34e))
60
- * add synchronised storage config ([e315869](https://github.com/iotaledger/twin-node/commit/e315869adbffcd7fe5d3ce151dd35f662f6134a9))
61
- * add tenant override ([#337](https://github.com/iotaledger/twin-node/issues/337)) ([b4ea765](https://github.com/iotaledger/twin-node/commit/b4ea7656e2557c19053365dd5d4af14d0d945cd5))
62
- * add tracing ([#344](https://github.com/iotaledger/twin-node/issues/344)) ([4fa71cd](https://github.com/iotaledger/twin-node/commit/4fa71cd0eafd7d708df15c8f0a85323fecd05561))
63
- * add tracing console connector ([#373](https://github.com/iotaledger/twin-node/issues/373)) ([fb36cb8](https://github.com/iotaledger/twin-node/commit/fb36cb8bebc2e8c1b94fa332cead8283ca5d636a))
64
- * add tracing support ([a4986fc](https://github.com/iotaledger/twin-node/commit/a4986fc4af603ee461ec8d18ff502dddbc43edec))
65
- * add trust and rights management plugin support ([cdeb504](https://github.com/iotaledger/twin-node/commit/cdeb504ee5986a347466162b9afa781645b4a54c))
66
- * add trust ttl ([#73](https://github.com/iotaledger/twin-node/issues/73)) ([911cee7](https://github.com/iotaledger/twin-node/commit/911cee771bba490143bb1574ca8360f7cf8baa1a))
67
- * add validate-locales ([1a19dcb](https://github.com/iotaledger/twin-node/commit/1a19dcb005c2f0e3103e290db28c48a3464094cb))
68
- * add vault prefix configuration ([#75](https://github.com/iotaledger/twin-node/issues/75)) ([1d4afb1](https://github.com/iotaledger/twin-node/commit/1d4afb1b1a8aa60795898eeb9e7f5153c279527d))
69
- * add well-known endpoint ([38cbab2](https://github.com/iotaledger/twin-node/commit/38cbab20631666d3bae8b0b5ae346a3488148b1d))
70
- * adding npm and https protocols to load extensions ([#45](https://github.com/iotaledger/twin-node/issues/45)) ([33940b7](https://github.com/iotaledger/twin-node/commit/33940b7e771a0c5af32c18d442deb26a8631fd02))
71
- * additional cli commands ([#269](https://github.com/iotaledger/twin-node/issues/269)) ([c9e7c93](https://github.com/iotaledger/twin-node/commit/c9e7c939aedfceed9cbe501f2dc936e84289ed62))
72
- * additional env vars and validation ([#324](https://github.com/iotaledger/twin-node/issues/324)) ([6b01e8c](https://github.com/iotaledger/twin-node/commit/6b01e8c10f9aa7181f51f13534d8164db3e7322d))
73
- * additional options for enabling components ([e13d772](https://github.com/iotaledger/twin-node/commit/e13d7721a0dd7143d456fff246622cbe63dbd0f1))
74
- * additional route logging env vars ([7152c88](https://github.com/iotaledger/twin-node/commit/7152c887c3ba76778e2d9e68ba57198b8d81d802))
75
- * additional stop interlock ([b3a2757](https://github.com/iotaledger/twin-node/commit/b3a2757325af0e7b258a9f97f1b52e86087e6301))
76
- * align node module with dataspace rename and control plane integâ€Ļ ([#95](https://github.com/iotaledger/twin-node/issues/95)) ([8129868](https://github.com/iotaledger/twin-node/commit/812986886fb5d779dd380956c4e6cc47c2d73530))
77
- * auth fix ([a8e59e9](https://github.com/iotaledger/twin-node/commit/a8e59e947735180c9edee041f87af5e1e125e3c6))
78
- * authentication services ([#118](https://github.com/iotaledger/twin-node/issues/118)) ([311a7f8](https://github.com/iotaledger/twin-node/commit/311a7f882db1e50a83e94d2dae32fefc68debb47))
79
- * bootstrap legacy skip ([469d950](https://github.com/iotaledger/twin-node/commit/469d9505bd0497c271ba291641f63786200cb548))
80
- * bootstrap-legacy rename ([#310](https://github.com/iotaledger/twin-node/issues/310)) ([53af8a2](https://github.com/iotaledger/twin-node/commit/53af8a2e797e90bb601416215247cd8649dd6220))
81
- * bump [@twin](https://github.com/twin).org/* to latest next ([#172](https://github.com/iotaledger/twin-node/issues/172)) ([45862d5](https://github.com/iotaledger/twin-node/commit/45862d555e4958f1c12da357817b7b87642d7aba))
82
- * bump dependencies ([#216](https://github.com/iotaledger/twin-node/issues/216)) ([a005824](https://github.com/iotaledger/twin-node/commit/a005824fe3e4a734543f613d8a7cc1275fec4572))
83
- * cache the npm root to increase startup speed ([f10ea9e](https://github.com/iotaledger/twin-node/commit/f10ea9e22cc202f320df5fb21507b886c1f7345b))
84
- * cli tenant-token command ([#177](https://github.com/iotaledger/twin-node/issues/177)) ([b3f68a4](https://github.com/iotaledger/twin-node/commit/b3f68a4972d065e865372230c078b4657dfabc1a))
85
- * clone mode ([#360](https://github.com/iotaledger/twin-node/issues/360)) ([8bb56fb](https://github.com/iotaledger/twin-node/commit/8bb56fb6a4b138c2ff0d1267d1be4f8c24f492a6))
86
- * component update ([9a3fdab](https://github.com/iotaledger/twin-node/commit/9a3fdab250e0dc8b8aa52479d5c72517de8d6c0f))
87
- * component update ([8bf10da](https://github.com/iotaledger/twin-node/commit/8bf10da2e3e29f22afddd9cb55a26f343555e106))
88
- * configure web server body limits from the environment ([#356](https://github.com/iotaledger/twin-node/issues/356)) ([f196ad3](https://github.com/iotaledger/twin-node/commit/f196ad368559515184e37a99d6876570074ebcd5))
89
- * custom REST paths ([#99](https://github.com/iotaledger/twin-node/issues/99)) ([dcab1b2](https://github.com/iotaledger/twin-node/commit/dcab1b2b23c13b4c9f39c3c1c67284f56e732bd1))
90
- * dataspace plane path ([#272](https://github.com/iotaledger/twin-node/issues/272)) ([5998eeb](https://github.com/iotaledger/twin-node/commit/5998eeb6fa1392ae753eb6bafeccefa1fb690573))
91
- * don't override existing env vars with env files ([ebccac2](https://github.com/iotaledger/twin-node/commit/ebccac297c3156076f17c246a8abd994f8f20e61))
92
- * dspace well-known endpoint test ([615bf55](https://github.com/iotaledger/twin-node/commit/615bf55de9e05ed410ed18348735cf4d6f392fe7))
93
- * email ingestion ([#379](https://github.com/iotaledger/twin-node/issues/379)) ([12da79d](https://github.com/iotaledger/twin-node/commit/12da79dc9b167e288c555d4f1909a61c190eee4d))
94
- * endpoints-runner ([#153](https://github.com/iotaledger/twin-node/issues/153)) ([cca42d0](https://github.com/iotaledger/twin-node/commit/cca42d07d6655d401c909308e8b73606fef05248))
95
- * enhanced cli commands ([#288](https://github.com/iotaledger/twin-node/issues/288)) ([479fb34](https://github.com/iotaledger/twin-node/commit/479fb3448c493a134aee35b69ae39458e493a4ad))
96
- * env var simplification ([460b0f2](https://github.com/iotaledger/twin-node/commit/460b0f20a73cb482f7443af502f261d5f9d01759))
97
- * env var validation ([#243](https://github.com/iotaledger/twin-node/issues/243)) ([569945a](https://github.com/iotaledger/twin-node/commit/569945a751eb52d008a681777a3cba881af1b9a4))
98
- * env vars consistency ([1823b7a](https://github.com/iotaledger/twin-node/commit/1823b7aeae5dc7484861534b851080afda64d869))
99
- * env-prefix option and user-update cli command ([#83](https://github.com/iotaledger/twin-node/issues/83)) ([fc48efa](https://github.com/iotaledger/twin-node/commit/fc48efa7ad72173def048170c3afb5eeb9f1b292))
100
- * eslint migration to flat config ([080db74](https://github.com/iotaledger/twin-node/commit/080db746390230f78725d214bc957da2efee9eb1))
101
- * expose gasBudget and gasReservationDuration as configurable env vars ([#286](https://github.com/iotaledger/twin-node/issues/286)) ([d678b27](https://github.com/iotaledger/twin-node/commit/d678b27d629930a6ce85eeab9caf89d1187c3461))
102
- * federated catalogue trust mode ([#194](https://github.com/iotaledger/twin-node/issues/194)) ([c18e6fb](https://github.com/iotaledger/twin-node/commit/c18e6fbe0014eb5faf8084d16169d86f3d3b23a6))
103
- * file logging config ([#287](https://github.com/iotaledger/twin-node/issues/287)) ([a567b25](https://github.com/iotaledger/twin-node/commit/a567b253cbb8b9af872bb0e494c013212f4f55a2))
104
- * first metrics in the core and app for testing ([#139](https://github.com/iotaledger/twin-node/issues/139)) ([abe17bb](https://github.com/iotaledger/twin-node/commit/abe17bb9a6261dcb7fd46253221182fbb1dc2259))
105
- * health and url transformer ([#131](https://github.com/iotaledger/twin-node/issues/131)) ([3658903](https://github.com/iotaledger/twin-node/commit/36589036b9bea120880fc395b0d123a89032cf40))
106
- * identity profile information source ([dbb53d1](https://github.com/iotaledger/twin-node/commit/dbb53d145f517070d864f37650a6dbc1f3e9c3a8))
107
- * immutable proof config ([#307](https://github.com/iotaledger/twin-node/issues/307)) ([9257495](https://github.com/iotaledger/twin-node/commit/92574953329647756aa6ab4cca80b1707e14a33f))
108
- * immutable proof gate and additional config ([#157](https://github.com/iotaledger/twin-node/issues/157)) ([1d1fbb7](https://github.com/iotaledger/twin-node/commit/1d1fbb7c53525af848761dc25b42e9e676929972))
109
- * improve bootstrapping and shutdown behaviour ([#66](https://github.com/iotaledger/twin-node/issues/66)) ([65b3452](https://github.com/iotaledger/twin-node/commit/65b345240334bfff48b52e136cc486cd7ac7f290))
110
- * improve error handling for extensions and logging ([bd84fde](https://github.com/iotaledger/twin-node/commit/bd84fde67e5a9db6ac66730397992401ca52e88c))
111
- * improve node logging ([63d6ea6](https://github.com/iotaledger/twin-node/commit/63d6ea661c2c76985d98addb8d905ad6f0c7f164))
112
- * improve node logging ([c25b9c6](https://github.com/iotaledger/twin-node/commit/c25b9c6779bdb76f341df072c39b4c2fae4565a3))
113
- * improved cli commands ([#206](https://github.com/iotaledger/twin-node/issues/206)) ([cf00850](https://github.com/iotaledger/twin-node/commit/cf0085023a66e187aaaaf3889128c845c73a1faf))
114
- * migration options ([#293](https://github.com/iotaledger/twin-node/issues/293)) ([91acc88](https://github.com/iotaledger/twin-node/commit/91acc881f665be0177b2e895e2810dd4d6145105))
115
- * migration testing ([#199](https://github.com/iotaledger/twin-node/issues/199)) ([97a731c](https://github.com/iotaledger/twin-node/commit/97a731c520d66ab0588d80987a0f88d388ce51ae))
116
- * multi-tenant env wiring, trust auto-enable, tenant-token vault key, engine-driven callbackPath ([#128](https://github.com/iotaledger/twin-node/issues/128)) ([0de4d35](https://github.com/iotaledger/twin-node/commit/0de4d356fb2f825afae5469005d475700f510ee4))
117
- * new tenant auth mechanisms ([#168](https://github.com/iotaledger/twin-node/issues/168)) ([686f111](https://github.com/iotaledger/twin-node/commit/686f1118e79e6f26a8dc72a5e9172584057f4518))
118
- * organization identifiers ([#203](https://github.com/iotaledger/twin-node/issues/203)) ([1a6b176](https://github.com/iotaledger/twin-node/commit/1a6b1760d9f8e43a769407668426c70e1c8e1aa8))
119
- * pool env vars ([#331](https://github.com/iotaledger/twin-node/issues/331)) ([338ea61](https://github.com/iotaledger/twin-node/commit/338ea612b37aa4d15971c8a09def47bee9395d0c))
120
- * refactor testing ([fc28140](https://github.com/iotaledger/twin-node/commit/fc28140c6a398d31e092752ef53fa490da167794))
121
- * register task scheduler when immutable proof is enabled ([#320](https://github.com/iotaledger/twin-node/issues/320)) ([b1d9c81](https://github.com/iotaledger/twin-node/commit/b1d9c81e0ec267292c6eaba8a6228eff1c41a9f0))
122
- * remove dap and darp ([36c3ffb](https://github.com/iotaledger/twin-node/commit/36c3ffb31af65a0e3025859dab675efeee043155))
123
- * remove hosting component ([#219](https://github.com/iotaledger/twin-node/issues/219)) ([fb2fea4](https://github.com/iotaledger/twin-node/commit/fb2fea46f57aab9252ee1491499e84b8ad46533e))
124
- * remove set-tenant ([#186](https://github.com/iotaledger/twin-node/issues/186)) ([1fc1909](https://github.com/iotaledger/twin-node/commit/1fc1909e6335dea51dfec3bb91fba4badaa9790a))
125
- * remove unused properties ([d8344b5](https://github.com/iotaledger/twin-node/commit/d8344b5aee5dc1c8104d75fad5093097f6530168))
126
- * rest metrics ([#341](https://github.com/iotaledger/twin-node/issues/341)) ([ebec573](https://github.com/iotaledger/twin-node/commit/ebec5736bb66adfd97f7d73912bec1ce7392e5f8))
127
- * separate script directory from exec directory ([f6bb4db](https://github.com/iotaledger/twin-node/commit/f6bb4dbea1f1e200e0640fa154c6997ef99c99b4))
128
- * silent telemetry and tracing options ([#351](https://github.com/iotaledger/twin-node/issues/351)) ([3a5752f](https://github.com/iotaledger/twin-node/commit/3a5752fc0bf8a028b3ebfc34878524ac799fb81e))
129
- * support multiple entity and blob storage connectors ([a489f79](https://github.com/iotaledger/twin-node/commit/a489f7907544aef5708d5111e9f72985e1377bae))
130
- * support public origin and hosting service ([#77](https://github.com/iotaledger/twin-node/issues/77)) ([3b9039f](https://github.com/iotaledger/twin-node/commit/3b9039fcba7f7038c06f8fd6a5ccc9fdbbf535b3))
131
- * telemetry batching ([#347](https://github.com/iotaledger/twin-node/issues/347)) ([5d5b0a9](https://github.com/iotaledger/twin-node/commit/5d5b0a91396298fe774ae26193b0595875cd118a))
132
- * telemetry tracing multi ([#357](https://github.com/iotaledger/twin-node/issues/357)) ([b6412ac](https://github.com/iotaledger/twin-node/commit/b6412ac3141a94a0f9f7d1dd391451ac9247e862))
133
- * tenant-id in user create and update ([#148](https://github.com/iotaledger/twin-node/issues/148)) ([1143e30](https://github.com/iotaledger/twin-node/commit/1143e30fb0d2056d113367d0c5ea251f07695da1))
134
- * typescript 6 update ([ce2e3ca](https://github.com/iotaledger/twin-node/commit/ce2e3ca5219587709f7b9cf6c65909b48fba11b5))
135
- * update background tasks and add fedcat filters ([1fd297e](https://github.com/iotaledger/twin-node/commit/1fd297e29f60b5bb3909638b68e326c5b0e2d77d))
136
- * update components ([35cdfdc](https://github.com/iotaledger/twin-node/commit/35cdfdcba2b52599b4db3afd8c9e6dd17468b21e))
137
- * update context usage ([2215440](https://github.com/iotaledger/twin-node/commit/2215440801dea3955885b6579ad9b98b7a5d87ea))
138
- * update dependencies ([34a5d51](https://github.com/iotaledger/twin-node/commit/34a5d5100140f6e642e8aaa1b4da5304b8ce6f0a))
139
- * update dependencies ([64c8ea8](https://github.com/iotaledger/twin-node/commit/64c8ea8c8b5e918f7ad419c4e3b8d08faf5e3fdd))
140
- * update dependencies ([aab05b5](https://github.com/iotaledger/twin-node/commit/aab05b552152a208a504fb9a080603f1990d4f79))
141
- * update dependencies ([6cb3d3a](https://github.com/iotaledger/twin-node/commit/6cb3d3a63f7b976f80074ddecfba034b7e92f919))
142
- * update dependencies ([#178](https://github.com/iotaledger/twin-node/issues/178)) ([0d346ec](https://github.com/iotaledger/twin-node/commit/0d346ec57f43f418b73fe71fcd2b187d769a53e9))
143
- * update dependencies ([#316](https://github.com/iotaledger/twin-node/issues/316)) ([f3fe328](https://github.com/iotaledger/twin-node/commit/f3fe3281a80f34763c923eacca58364273a550b7))
144
- * update docs ([61e5a00](https://github.com/iotaledger/twin-node/commit/61e5a004089a0c11ec03e354b076604ecdeb4817))
145
- * update document management components ([ed2c065](https://github.com/iotaledger/twin-node/commit/ed2c065a5030a7233f3623818d7325d85654ef0d))
146
- * update engine ([a40b377](https://github.com/iotaledger/twin-node/commit/a40b37726c3b61c6bb40265ec0006d1071ffac7e))
147
- * update engine ([4b438e2](https://github.com/iotaledger/twin-node/commit/4b438e22c27d784ee6cc964b7cb4401e9699ab16))
148
- * update engine dependency ([db290df](https://github.com/iotaledger/twin-node/commit/db290df3b18374f7d86da575c6048657b98c355b))
149
- * update engine dependency ([3494c31](https://github.com/iotaledger/twin-node/commit/3494c3144fd5ce6d3a9f2936c7890ab36795aeaa))
150
- * update for livez endpoint ([9fc2e6a](https://github.com/iotaledger/twin-node/commit/9fc2e6ade38b3ec9591399a633d02b1e5fe07910))
151
- * update framework components ([4bee2b9](https://github.com/iotaledger/twin-node/commit/4bee2b9d3651df09b8550a9ed226be1b46031854))
152
- * update framework core ([8bd769a](https://github.com/iotaledger/twin-node/commit/8bd769a4451f5f1f6be3f115a5e94eeb05bce7f1))
153
- * update logging retention units in config ([0b9bb69](https://github.com/iotaledger/twin-node/commit/0b9bb696db0722f6b33e37e1ebd1f4d6ffbcf7cc))
154
- * update order of logging ([2161938](https://github.com/iotaledger/twin-node/commit/2161938c969b18e4678459a69090287e5ccdb404))
155
- * update order of logging ([b295f31](https://github.com/iotaledger/twin-node/commit/b295f315f7c5b611d229d9e5314d414da05828b9))
156
- * update rights management ([5c992c6](https://github.com/iotaledger/twin-node/commit/5c992c6b0d72f3eeaa39ee267e096d9a3f477f4e))
157
- * update rights management components ([176a0d6](https://github.com/iotaledger/twin-node/commit/176a0d611f88360fc845ae233b26ee0b43d7cb23))
158
- * update rights management dependencies ([97ad02e](https://github.com/iotaledger/twin-node/commit/97ad02e4b74cfe5e722f74da2fc2229bbf004c0a))
159
- * update tests ([f15bc1f](https://github.com/iotaledger/twin-node/commit/f15bc1fb9fc1a7a9b6611ad42591d9c02e078cfb))
160
- * update tests ([633797e](https://github.com/iotaledger/twin-node/commit/633797e3c4766ad7e47c472c153456c60e1a6ba2))
161
- * update to latest engine ([00d4974](https://github.com/iotaledger/twin-node/commit/00d4974f9cfb02bf48505cfb4af4a7aba1df4b3d))
162
- * update to latest engine config ([347386c](https://github.com/iotaledger/twin-node/commit/347386c0609e717dc20c456ad2264c83df793c59))
163
- * updated context id features ([ef7be07](https://github.com/iotaledger/twin-node/commit/ef7be07d44dccdeacf10f90cb4ffde0303faa6fa))
164
- * updating linting ([feacd17](https://github.com/iotaledger/twin-node/commit/feacd178bb025bcd29a0ae6e4b8e79f23a989169))
165
- * use core env helpers ([568fbc5](https://github.com/iotaledger/twin-node/commit/568fbc53906b022bc8465ffb941a160075d88e96))
166
- * use features instead of disableNodeIdentity ([2e6109b](https://github.com/iotaledger/twin-node/commit/2e6109bd1de825e0f5396fc120d99ad7b3929852))
8
+ * add auth admin component ([1661e57](https://github.com/iotaledger/twin-node/commit/1661e57a699d5cf9ebde333e3cbc3aaea89d7c9c))
9
+ * add extend engine and server methods ([ec09c7e](https://github.com/iotaledger/twin-node/commit/ec09c7eb882d9f5797f2fd372e96cad1a3716f59))
10
+ * add extend engine and server methods ([0136a6f](https://github.com/iotaledger/twin-node/commit/0136a6f3f4e1a82b1427ee9618b8a17c79bc7fda))
11
+ * additional run options ([c35e5bb](https://github.com/iotaledger/twin-node/commit/c35e5bbb8a80fe6a36628d41f64585b3723d9ad7))
12
+ * additional startup logging ([0740293](https://github.com/iotaledger/twin-node/commit/0740293b366032f2907046603abf587c9c324aff))
13
+ * improve default options and spec ([b538721](https://github.com/iotaledger/twin-node/commit/b538721902e7f65021d2715148ba59409ccce035))
14
+ * improve error reporting ([fcd39a1](https://github.com/iotaledger/twin-node/commit/fcd39a18da2a6ce33965a99ca5f2f36f4aba712f))
15
+ * initial commit ([522f1e5](https://github.com/iotaledger/twin-node/commit/522f1e515348f9b1dd1eeb3170b1249e2b0b5371))
16
+ * migrate env config from engine to node ([5da29b8](https://github.com/iotaledger/twin-node/commit/5da29b8d714495308320d237a68e84355bba2b47))
17
+ * node app use JavaScript ([14fe08c](https://github.com/iotaledger/twin-node/commit/14fe08cb760dd885a5dac9056a4d5dbc3d61df64))
18
+ * release to production ([6319a38](https://github.com/iotaledger/twin-node/commit/6319a38490a2c2809622f8acd170cb92bfa06942))
19
+ * release to production ([4f44403](https://github.com/iotaledger/twin-node/commit/4f444039832edce8fae562baa7c900ccdc2181da))
20
+ * release to production ([2d96e37](https://github.com/iotaledger/twin-node/commit/2d96e3737bd9663bc0d1171c2ff2c7f8b2ab01bb))
21
+ * release to production ([#253](https://github.com/iotaledger/twin-node/issues/253)) ([230efd0](https://github.com/iotaledger/twin-node/commit/230efd0f99af6114e707999b4c1a83a391cc1741))
22
+ * release to production ([#300](https://github.com/iotaledger/twin-node/issues/300)) ([4d2b09f](https://github.com/iotaledger/twin-node/commit/4d2b09f92c7815ad3fe48d54eca0972fefc782f7))
23
+ * release to production ([#364](https://github.com/iotaledger/twin-node/issues/364)) ([dbba3db](https://github.com/iotaledger/twin-node/commit/dbba3dbf3d9efb858b0ea28aaf88378964fcf08e))
24
+ * release to production ([#383](https://github.com/iotaledger/twin-node/issues/383)) ([5d29105](https://github.com/iotaledger/twin-node/commit/5d29105355f85011f9a338ba5069162a0b008849))
25
+ * release to production ([#406](https://github.com/iotaledger/twin-node/issues/406)) ([98ba03e](https://github.com/iotaledger/twin-node/commit/98ba03e70eabbdceca9c5cbfaa01ea5076e5b2a7))
26
+ * update dependencies ([9d25f16](https://github.com/iotaledger/twin-node/commit/9d25f16f1d554cd38f3bec28fdf7f8fff892ceaf))
167
27
 
168
28
 
169
29
  ### Bug Fixes
170
30
 
171
- * bootstrap legacy fails on second run ([c0a4e6d](https://github.com/iotaledger/twin-node/commit/c0a4e6d6f8d1bf385412a22fed2a0974e219abaa))
172
- * bootstrap vault key skip logic ([#112](https://github.com/iotaledger/twin-node/issues/112)) ([4084368](https://github.com/iotaledger/twin-node/commit/4084368f0762c3a1b8e214ac30f5545297c88ea6))
173
- * bump [@twin](https://github.com/twin).org deps to next.30 stack, fix node-core route snapshot ([#159](https://github.com/iotaledger/twin-node/issues/159)) ([73ad77f](https://github.com/iotaledger/twin-node/commit/73ad77f862050cb8dfcf42c484332bdacf026092))
174
- * example typo for vault-key-create ([eed5844](https://github.com/iotaledger/twin-node/commit/eed58448b8e6d057fa964822d337cb2898d5bb54))
175
- * immutable proof requirements ([2940579](https://github.com/iotaledger/twin-node/commit/29405798b24053c017adaaf08a2537ea6b1c8d0f))
176
- * improve calculation of execution directory ([106d65d](https://github.com/iotaledger/twin-node/commit/106d65d7ad5524e2e147b681d68f9476c024cfaa))
177
- * only register DID context keys when nodeIdentityEnabled is true ([#140](https://github.com/iotaledger/twin-node/issues/140)) ([21f1c10](https://github.com/iotaledger/twin-node/commit/21f1c107adbd715518414f7255ead970b809b4b3))
178
- * optional private key in identity create ([325ebd8](https://github.com/iotaledger/twin-node/commit/325ebd859d95b3078107e76f1806cded078a0ce1))
179
- * org identity verification methods ([18f158b](https://github.com/iotaledger/twin-node/commit/18f158b2f63930e20e94437c17ed43421771a458))
180
- * recover tenant id on bootstrap-legacy restart when TENANT_ID is unset ([#198](https://github.com/iotaledger/twin-node/issues/198)) ([d9451e1](https://github.com/iotaledger/twin-node/commit/d9451e188fe4fd20d5cfd0408b0dc226ddf25cd8))
181
- * register dataspace control plane rest client as multi-instance ([#191](https://github.com/iotaledger/twin-node/issues/191)) ([4548f5c](https://github.com/iotaledger/twin-node/commit/4548f5c6e7f1d65fd147e502e57d5686e60e5195))
182
- * set dataspace control-plane callbackPath in node env builder ([#237](https://github.com/iotaledger/twin-node/issues/237)) ([2eac214](https://github.com/iotaledger/twin-node/commit/2eac21438e9f4b4a0bf84f30ebc864bd424aac35))
183
- * stalled timeout now is provided in seconds ([#241](https://github.com/iotaledger/twin-node/issues/241)) ([ebd827d](https://github.com/iotaledger/twin-node/commit/ebd827d02a9a4f8ad4f4c84d064d02831ef015cb))
184
- * support load-env for tenant-token cli command ([34059c0](https://github.com/iotaledger/twin-node/commit/34059c052a685decdd689beb16d2b250e9a83643))
185
- * synchronised storage construction ([#102](https://github.com/iotaledger/twin-node/issues/102)) ([58b61e9](https://github.com/iotaledger/twin-node/commit/58b61e9a67f499a35bea17e5d2dc6a1efc2cb893))
186
- * test endpoints ([2b83ed0](https://github.com/iotaledger/twin-node/commit/2b83ed0d4f1da473a525a95202e01d9680c7d26c))
187
- * test with latest dependencies ([91123b7](https://github.com/iotaledger/twin-node/commit/91123b71d0e7b51700a5d5452b2a0c9fc5c5256e))
188
- * update dependencies ([#279](https://github.com/iotaledger/twin-node/issues/279)) ([2c0de07](https://github.com/iotaledger/twin-node/commit/2c0de07a15541e73612ba5bd62f4f566e4efca34))
189
- * use async getStore in tests ([2189df4](https://github.com/iotaledger/twin-node/commit/2189df49a57637ba8effdee50965473f0a814c6c))
190
- * wire includeErrorStack debug flag into auth and tenant processor configs ([#313](https://github.com/iotaledger/twin-node/issues/313)) ([3c69c51](https://github.com/iotaledger/twin-node/commit/3c69c51bfdd65305efe2fbe9da508e684a4245d1))
31
+ * adding a condition to verify if the password exists when bootstrapping ([6030a42](https://github.com/iotaledger/twin-node/commit/6030a42bdaf581678d96932fd0b809396bf7b8b0))
32
+ * adding a condition to verify if the password exists when bootstrapping ([c66f396](https://github.com/iotaledger/twin-node/commit/c66f396717394161a7647d1f08b3d87729d96e96))
33
+ * broken docs ([61479fd](https://github.com/iotaledger/twin-node/commit/61479fd618f766d22c5aafec5277e1a89e22b453))
34
+ * pr comments [#1](https://github.com/iotaledger/twin-node/issues/1) ([66e795b](https://github.com/iotaledger/twin-node/commit/66e795b16c372ab131ec1de30085aee90e4dbbd0))
191
35
 
192
36
  ## [0.9.3](https://github.com/iotaledger/twin-node/compare/node-core-v0.9.3...node-core-v0.9.3) (2026-09-04)
193
37
 
@@ -50,7 +50,6 @@
50
50
  - [isAutomationRequired](functions/isAutomationRequired.md)
51
51
  - [isTelemetryEnabled](functions/isTelemetryEnabled.md)
52
52
  - [isTracingEnabled](functions/isTracingEnabled.md)
53
- - [isMailboxEnabled](functions/isMailboxEnabled.md)
54
53
  - [buildEngineServerConfiguration](functions/buildEngineServerConfiguration.md)
55
54
  - [isAuthEntityStorageRequired](functions/isAuthEntityStorageRequired.md)
56
55
  - [extensionsConfiguration](functions/extensionsConfiguration.md)