@twin.org/node-core 0.0.3-next.6 â 0.0.3-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/builders/engineEnvBuilder.js +115 -66
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/node.js +1 -1
- package/dist/es/node.js.map +1 -1
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +31 -21
- package/docs/changelog.md +14 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +54 -28
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +77 -35
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +77 -35
- package/package.json +2 -1
package/dist/es/node.js.map
CHANGED
|
@@ -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,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAIrE,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;AAK1E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACN,qBAAqB,EACrB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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 { 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, 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 type { INodeEngineConfig } from \"./models/INodeEngineConfig.js\";\nimport type { INodeEngineState } from \"./models/INodeEngineState.js\";\nimport type { INodeEnvironmentVariables } from \"./models/INodeEnvironmentVariables.js\";\nimport type { INodeOptions } from \"./models/INodeOptions.js\";\nimport { ModuleProtocol } from \"./models/moduleProtocol.js\";\nimport { start } from \"./server.js\";\nimport {\n\tcreateModuleImportUrl,\n\tfileExists,\n\tgetExecutionDirectory,\n\tgetExtensionsCacheDir,\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 TWIN Node server.\n * @param nodeOptions Optional configuration options for running the server.\n * @returns A promise that resolves when the server is started containing a shutdown method.\n */\nexport async function run(nodeOptions?: INodeOptions): 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\ttry {\n\t\tnodeOptions ??= {};\n\n\t\tconst serverInfo: IServerInfo = {\n\t\t\tname: nodeOptions?.serverName ?? \"TWIN Node Server\",\n\t\t\tversion: nodeOptions?.serverVersion ?? \"0.0.3-next.6\" // 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\tnodeOptions.localesDirectory =\n\t\t\tnodeOptions?.localesDirectory ??\n\t\t\tpath.resolve(path.join(nodeOptions.executionDirectory, \"dist\", \"locales\"));\n\t\tCLIDisplay.value(\"Locales Directory\", nodeOptions.localesDirectory);\n\n\t\tawait initialiseLocales(nodeOptions.localesDirectory);\n\n\t\tif (Is.empty(nodeOptions?.openApiSpecFile)) {\n\t\t\tconst specFile = path.resolve(\n\t\t\t\tpath.join(nodeOptions.executionDirectory ?? \"\", \"docs\", \"open-api\", \"spec.json\")\n\t\t\t);\n\t\t\tCLIDisplay.value(\"Default OpenAPI Spec File\", specFile);\n\t\t\tif (await fileExists(specFile)) {\n\t\t\t\tnodeOptions ??= {};\n\t\t\t\tnodeOptions.openApiSpecFile = specFile;\n\t\t\t}\n\t\t} else {\n\t\t\tCLIDisplay.value(\"OpenAPI Spec File\", nodeOptions.openApiSpecFile);\n\t\t}\n\n\t\tif (Is.empty(nodeOptions?.favIconFile)) {\n\t\t\tconst favIconFile = path.resolve(\n\t\t\t\tpath.join(nodeOptions.executionDirectory ?? \"\", \"static\", \"favicon.png\")\n\t\t\t);\n\t\t\tCLIDisplay.value(\"Default Favicon File\", favIconFile);\n\t\t\tif (await fileExists(favIconFile)) {\n\t\t\t\tnodeOptions ??= {};\n\t\t\t\tnodeOptions.favIconFile = favIconFile;\n\t\t\t}\n\t\t} else {\n\t\t\tCLIDisplay.value(\"Favicon File\", nodeOptions.favIconFile);\n\t\t}\n\n\t\tnodeOptions.envPrefix ??= \"TWIN_\";\n\t\tCLIDisplay.value(\"Environment Variable Prefix\", nodeOptions.envPrefix);\n\n\t\toverrideModuleImport(nodeOptions.executionDirectory ?? \"\");\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\tconst {\n\t\t\tnodeEngineConfig,\n\t\t\tnodeEnvVars: envVars,\n\t\t\tavailableContextIdKeys\n\t\t} = await buildConfiguration(finalEnvVars, nodeOptions, serverInfo);\n\n\t\tCLIDisplay.break();\n\t\tconst startResult = await start(nodeOptions, nodeEngineConfig, envVars, availableContextIdKeys);\n\n\t\tif (!Is.empty(startResult)) {\n\t\t\tfor (const signal of [\"SIGHUP\", \"SIGINT\", \"SIGTERM\"]) {\n\t\t\t\tprocess.on(signal, async () => {\n\t\t\t\t\tCLIDisplay.value(\"Terminate Signal\", signal);\n\t\t\t\t\tawait startResult.shutdown();\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\t\tCLIDisplay.error(err);\n\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Build the configuration for the TWIN Node server.\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: INodeEnvironmentVariables & { [id: string]: string | unknown };\n\tnodeEngineConfig: INodeEngineConfig;\n\tavailableContextIdKeys: { key: string; componentFeatures: string[] }[];\n}> {\n\tconst availableContextIdKeys: { key: string; componentFeatures: 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\tObject.assign(processEnv, output.parsed);\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\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, availableContextIdKeys);\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?: INodeEnvironmentVariables\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 npmRoot = execSync(\"npm root\").toString().trim().replace(/\\\\/g, \"/\");\n\t\t\t\t\tconst packagePath = path.resolve(npmRoot, 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"]}
|
|
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,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAIrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO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AAY,GAAG,UAAU,CAAC;wBAC1B,MAAM;oBACP,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC;oBACR,kCAAkC;gBACnC,CAAC;gBAED,wFAAwF;gBACxF,IAAI,CAAC;oBACJ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAChC,qBAAqB,CAAC,kBAAkB,EAAE,cAAc,CAAC,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 { 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, 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 type { INodeEngineConfig } from \"./models/INodeEngineConfig.js\";\nimport type { INodeEngineState } from \"./models/INodeEngineState.js\";\nimport type { INodeEnvironmentVariables } from \"./models/INodeEnvironmentVariables.js\";\nimport type { INodeOptions } from \"./models/INodeOptions.js\";\nimport { ModuleProtocol } from \"./models/moduleProtocol.js\";\nimport { start } from \"./server.js\";\nimport {\n\tcreateModuleImportUrl,\n\tfileExists,\n\tgetExecutionDirectory,\n\tgetExtensionsCacheDir,\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 TWIN Node server.\n * @param nodeOptions Optional configuration options for running the server.\n * @returns A promise that resolves when the server is started containing a shutdown method.\n */\nexport async function run(nodeOptions?: INodeOptions): 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\ttry {\n\t\tnodeOptions ??= {};\n\n\t\tconst serverInfo: IServerInfo = {\n\t\t\tname: nodeOptions?.serverName ?? \"TWIN Node Server\",\n\t\t\tversion: nodeOptions?.serverVersion ?? \"0.0.3-next.8\" // 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\tnodeOptions.localesDirectory =\n\t\t\tnodeOptions?.localesDirectory ??\n\t\t\tpath.resolve(path.join(nodeOptions.executionDirectory, \"dist\", \"locales\"));\n\t\tCLIDisplay.value(\"Locales Directory\", nodeOptions.localesDirectory);\n\n\t\tawait initialiseLocales(nodeOptions.localesDirectory);\n\n\t\tif (Is.empty(nodeOptions?.openApiSpecFile)) {\n\t\t\tconst specFile = path.resolve(\n\t\t\t\tpath.join(nodeOptions.executionDirectory ?? \"\", \"docs\", \"open-api\", \"spec.json\")\n\t\t\t);\n\t\t\tCLIDisplay.value(\"Default OpenAPI Spec File\", specFile);\n\t\t\tif (await fileExists(specFile)) {\n\t\t\t\tnodeOptions ??= {};\n\t\t\t\tnodeOptions.openApiSpecFile = specFile;\n\t\t\t}\n\t\t} else {\n\t\t\tCLIDisplay.value(\"OpenAPI Spec File\", nodeOptions.openApiSpecFile);\n\t\t}\n\n\t\tif (Is.empty(nodeOptions?.favIconFile)) {\n\t\t\tconst favIconFile = path.resolve(\n\t\t\t\tpath.join(nodeOptions.executionDirectory ?? \"\", \"static\", \"favicon.png\")\n\t\t\t);\n\t\t\tCLIDisplay.value(\"Default Favicon File\", favIconFile);\n\t\t\tif (await fileExists(favIconFile)) {\n\t\t\t\tnodeOptions ??= {};\n\t\t\t\tnodeOptions.favIconFile = favIconFile;\n\t\t\t}\n\t\t} else {\n\t\t\tCLIDisplay.value(\"Favicon File\", nodeOptions.favIconFile);\n\t\t}\n\n\t\tnodeOptions.envPrefix ??= \"TWIN_\";\n\t\tCLIDisplay.value(\"Environment Variable Prefix\", nodeOptions.envPrefix);\n\n\t\toverrideModuleImport(nodeOptions.executionDirectory ?? \"\");\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\tconst {\n\t\t\tnodeEngineConfig,\n\t\t\tnodeEnvVars: envVars,\n\t\t\tavailableContextIdKeys\n\t\t} = await buildConfiguration(finalEnvVars, nodeOptions, serverInfo);\n\n\t\tCLIDisplay.break();\n\t\tconst startResult = await start(nodeOptions, nodeEngineConfig, envVars, availableContextIdKeys);\n\n\t\tif (!Is.empty(startResult)) {\n\t\t\tfor (const signal of [\"SIGHUP\", \"SIGINT\", \"SIGTERM\"]) {\n\t\t\t\tprocess.on(signal, async () => {\n\t\t\t\t\tCLIDisplay.value(\"Terminate Signal\", signal);\n\t\t\t\t\tawait startResult.shutdown();\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\t\tCLIDisplay.error(err);\n\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\tprocess.exit(1);\n\t}\n}\n\n/**\n * Build the configuration for the TWIN Node server.\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: INodeEnvironmentVariables & { [id: string]: string | unknown };\n\tnodeEngineConfig: INodeEngineConfig;\n\tavailableContextIdKeys: { key: string; componentFeatures: string[] }[];\n}> {\n\tconst availableContextIdKeys: { key: string; componentFeatures: 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\tObject.assign(processEnv, output.parsed);\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\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, availableContextIdKeys);\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?: INodeEnvironmentVariables\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 npmRoot = execSync(\"npm root\").toString().trim().replace(/\\\\/g, \"/\");\n\t\t\t\t\tconst packagePath = path.resolve(npmRoot, 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"]}
|
|
@@ -485,6 +485,23 @@ export interface IEngineEnvironmentVariables {
|
|
|
485
485
|
* Federated catalog filters, command separated list of filters to add.
|
|
486
486
|
*/
|
|
487
487
|
federatedCatalogueFilters?: string;
|
|
488
|
+
/**
|
|
489
|
+
* Is the trust management enabled, defaults to false.
|
|
490
|
+
*/
|
|
491
|
+
trustEnabled?: string;
|
|
492
|
+
/**
|
|
493
|
+
* The trust generators to add to the factory, comma separated list.
|
|
494
|
+
*/
|
|
495
|
+
trustGenerators?: string;
|
|
496
|
+
/**
|
|
497
|
+
* The trust verifiers to add to the factory, comma separated list.
|
|
498
|
+
*/
|
|
499
|
+
trustVerifiers?: string;
|
|
500
|
+
/**
|
|
501
|
+
* The verification method to use for trust identities.
|
|
502
|
+
* Defaults to node-authentication-assertion.
|
|
503
|
+
*/
|
|
504
|
+
trustVerificationMethodId?: string;
|
|
488
505
|
/**
|
|
489
506
|
* Is the rights management enabled, defaults to false.
|
|
490
507
|
*/
|
|
@@ -494,40 +511,33 @@ export interface IEngineEnvironmentVariables {
|
|
|
494
511
|
*/
|
|
495
512
|
rightsManagementBaseCallbackUrl?: string;
|
|
496
513
|
/**
|
|
497
|
-
* The rights management
|
|
498
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
514
|
+
* The rights management policy information sources to add to the factory.
|
|
499
515
|
*/
|
|
500
|
-
|
|
516
|
+
rightsManagementPolicyInformationSources?: string;
|
|
501
517
|
/**
|
|
502
|
-
* The rights management
|
|
503
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
518
|
+
* The rights management policy negotiators sources to add to the factory.
|
|
504
519
|
*/
|
|
505
|
-
|
|
520
|
+
rightsManagementPolicyNegotiators?: string;
|
|
506
521
|
/**
|
|
507
|
-
* The rights management
|
|
508
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
522
|
+
* The rights management policy requesters to add to the factory.
|
|
509
523
|
*/
|
|
510
|
-
|
|
524
|
+
rightsManagementPolicyRequesters?: string;
|
|
511
525
|
/**
|
|
512
|
-
* The rights management
|
|
513
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
526
|
+
* The rights management policy execution actions to add to the factory.
|
|
514
527
|
*/
|
|
515
|
-
|
|
528
|
+
rightsManagementPolicyExecutionActions?: string;
|
|
516
529
|
/**
|
|
517
|
-
* The rights management
|
|
518
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
530
|
+
* The rights management policy enforcement processors to add to the factory.
|
|
519
531
|
*/
|
|
520
|
-
|
|
532
|
+
rightsManagementPolicyEnforcementProcessors?: string;
|
|
521
533
|
/**
|
|
522
|
-
* The rights management
|
|
523
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
534
|
+
* The rights management policy arbiters to add to the factory.
|
|
524
535
|
*/
|
|
525
|
-
|
|
536
|
+
rightsManagementPolicyArbiters?: string;
|
|
526
537
|
/**
|
|
527
|
-
* The rights management
|
|
528
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
538
|
+
* The rights management data access handlers to add to the factory.
|
|
529
539
|
*/
|
|
530
|
-
|
|
540
|
+
rightsManagementDataAccessHandlers?: string;
|
|
531
541
|
/**
|
|
532
542
|
* Are background tasks enabled, defaults to false.
|
|
533
543
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/node-core - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.7...node-core-v0.0.3-next.8) (2026-01-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update for livez endpoint ([9fc2e6a](https://github.com/twinfoundation/node/commit/9fc2e6ade38b3ec9591399a633d02b1e5fe07910))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.6...node-core-v0.0.3-next.7) (2025-12-04)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add trust and rights management plugin support ([cdeb504](https://github.com/twinfoundation/node/commit/cdeb504ee5986a347466162b9afa781645b4a54c))
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.6](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.5...node-core-v0.0.3-next.6) (2025-11-28)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -983,6 +983,39 @@ Federated catalog filters, command separated list of filters to add.
|
|
|
983
983
|
|
|
984
984
|
***
|
|
985
985
|
|
|
986
|
+
### trustEnabled?
|
|
987
|
+
|
|
988
|
+
> `optional` **trustEnabled**: `string`
|
|
989
|
+
|
|
990
|
+
Is the trust management enabled, defaults to false.
|
|
991
|
+
|
|
992
|
+
***
|
|
993
|
+
|
|
994
|
+
### trustGenerators?
|
|
995
|
+
|
|
996
|
+
> `optional` **trustGenerators**: `string`
|
|
997
|
+
|
|
998
|
+
The trust generators to add to the factory, comma separated list.
|
|
999
|
+
|
|
1000
|
+
***
|
|
1001
|
+
|
|
1002
|
+
### trustVerifiers?
|
|
1003
|
+
|
|
1004
|
+
> `optional` **trustVerifiers**: `string`
|
|
1005
|
+
|
|
1006
|
+
The trust verifiers to add to the factory, comma separated list.
|
|
1007
|
+
|
|
1008
|
+
***
|
|
1009
|
+
|
|
1010
|
+
### trustVerificationMethodId?
|
|
1011
|
+
|
|
1012
|
+
> `optional` **trustVerificationMethodId**: `string`
|
|
1013
|
+
|
|
1014
|
+
The verification method to use for trust identities.
|
|
1015
|
+
Defaults to node-authentication-assertion.
|
|
1016
|
+
|
|
1017
|
+
***
|
|
1018
|
+
|
|
986
1019
|
### rightsManagementEnabled?
|
|
987
1020
|
|
|
988
1021
|
> `optional` **rightsManagementEnabled**: `string`
|
|
@@ -999,66 +1032,59 @@ What is the base callback url for rights management negotiations e.g. https://my
|
|
|
999
1032
|
|
|
1000
1033
|
***
|
|
1001
1034
|
|
|
1002
|
-
###
|
|
1035
|
+
### rightsManagementPolicyInformationSources?
|
|
1003
1036
|
|
|
1004
|
-
> `optional` **
|
|
1037
|
+
> `optional` **rightsManagementPolicyInformationSources**: `string`
|
|
1005
1038
|
|
|
1006
|
-
The rights management
|
|
1007
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1039
|
+
The rights management policy information sources to add to the factory.
|
|
1008
1040
|
|
|
1009
1041
|
***
|
|
1010
1042
|
|
|
1011
|
-
###
|
|
1043
|
+
### rightsManagementPolicyNegotiators?
|
|
1012
1044
|
|
|
1013
|
-
> `optional` **
|
|
1045
|
+
> `optional` **rightsManagementPolicyNegotiators**: `string`
|
|
1014
1046
|
|
|
1015
|
-
The rights management
|
|
1016
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1047
|
+
The rights management policy negotiators sources to add to the factory.
|
|
1017
1048
|
|
|
1018
1049
|
***
|
|
1019
1050
|
|
|
1020
|
-
###
|
|
1051
|
+
### rightsManagementPolicyRequesters?
|
|
1021
1052
|
|
|
1022
|
-
> `optional` **
|
|
1053
|
+
> `optional` **rightsManagementPolicyRequesters**: `string`
|
|
1023
1054
|
|
|
1024
|
-
The rights management
|
|
1025
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1055
|
+
The rights management policy requesters to add to the factory.
|
|
1026
1056
|
|
|
1027
1057
|
***
|
|
1028
1058
|
|
|
1029
|
-
###
|
|
1059
|
+
### rightsManagementPolicyExecutionActions?
|
|
1030
1060
|
|
|
1031
|
-
> `optional` **
|
|
1061
|
+
> `optional` **rightsManagementPolicyExecutionActions**: `string`
|
|
1032
1062
|
|
|
1033
|
-
The rights management
|
|
1034
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1063
|
+
The rights management policy execution actions to add to the factory.
|
|
1035
1064
|
|
|
1036
1065
|
***
|
|
1037
1066
|
|
|
1038
|
-
###
|
|
1067
|
+
### rightsManagementPolicyEnforcementProcessors?
|
|
1039
1068
|
|
|
1040
|
-
> `optional` **
|
|
1069
|
+
> `optional` **rightsManagementPolicyEnforcementProcessors**: `string`
|
|
1041
1070
|
|
|
1042
|
-
The rights management
|
|
1043
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1071
|
+
The rights management policy enforcement processors to add to the factory.
|
|
1044
1072
|
|
|
1045
1073
|
***
|
|
1046
1074
|
|
|
1047
|
-
###
|
|
1075
|
+
### rightsManagementPolicyArbiters?
|
|
1048
1076
|
|
|
1049
|
-
> `optional` **
|
|
1077
|
+
> `optional` **rightsManagementPolicyArbiters**: `string`
|
|
1050
1078
|
|
|
1051
|
-
The rights management
|
|
1052
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1079
|
+
The rights management policy arbiters to add to the factory.
|
|
1053
1080
|
|
|
1054
1081
|
***
|
|
1055
1082
|
|
|
1056
|
-
###
|
|
1083
|
+
### rightsManagementDataAccessHandlers?
|
|
1057
1084
|
|
|
1058
|
-
> `optional` **
|
|
1085
|
+
> `optional` **rightsManagementDataAccessHandlers**: `string`
|
|
1059
1086
|
|
|
1060
|
-
The rights management
|
|
1061
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1087
|
+
The rights management data access handlers to add to the factory.
|
|
1062
1088
|
|
|
1063
1089
|
***
|
|
1064
1090
|
|
|
@@ -1459,6 +1459,55 @@ Federated catalog filters, command separated list of filters to add.
|
|
|
1459
1459
|
|
|
1460
1460
|
***
|
|
1461
1461
|
|
|
1462
|
+
### trustEnabled?
|
|
1463
|
+
|
|
1464
|
+
> `optional` **trustEnabled**: `string`
|
|
1465
|
+
|
|
1466
|
+
Is the trust management enabled, defaults to false.
|
|
1467
|
+
|
|
1468
|
+
#### Inherited from
|
|
1469
|
+
|
|
1470
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`trustEnabled`](IEngineEnvironmentVariables.md#trustenabled)
|
|
1471
|
+
|
|
1472
|
+
***
|
|
1473
|
+
|
|
1474
|
+
### trustGenerators?
|
|
1475
|
+
|
|
1476
|
+
> `optional` **trustGenerators**: `string`
|
|
1477
|
+
|
|
1478
|
+
The trust generators to add to the factory, comma separated list.
|
|
1479
|
+
|
|
1480
|
+
#### Inherited from
|
|
1481
|
+
|
|
1482
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`trustGenerators`](IEngineEnvironmentVariables.md#trustgenerators)
|
|
1483
|
+
|
|
1484
|
+
***
|
|
1485
|
+
|
|
1486
|
+
### trustVerifiers?
|
|
1487
|
+
|
|
1488
|
+
> `optional` **trustVerifiers**: `string`
|
|
1489
|
+
|
|
1490
|
+
The trust verifiers to add to the factory, comma separated list.
|
|
1491
|
+
|
|
1492
|
+
#### Inherited from
|
|
1493
|
+
|
|
1494
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`trustVerifiers`](IEngineEnvironmentVariables.md#trustverifiers)
|
|
1495
|
+
|
|
1496
|
+
***
|
|
1497
|
+
|
|
1498
|
+
### trustVerificationMethodId?
|
|
1499
|
+
|
|
1500
|
+
> `optional` **trustVerificationMethodId**: `string`
|
|
1501
|
+
|
|
1502
|
+
The verification method to use for trust identities.
|
|
1503
|
+
Defaults to node-authentication-assertion.
|
|
1504
|
+
|
|
1505
|
+
#### Inherited from
|
|
1506
|
+
|
|
1507
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`trustVerificationMethodId`](IEngineEnvironmentVariables.md#trustverificationmethodid)
|
|
1508
|
+
|
|
1509
|
+
***
|
|
1510
|
+
|
|
1462
1511
|
### rightsManagementEnabled?
|
|
1463
1512
|
|
|
1464
1513
|
> `optional` **rightsManagementEnabled**: `string`
|
|
@@ -1483,94 +1532,87 @@ What is the base callback url for rights management negotiations e.g. https://my
|
|
|
1483
1532
|
|
|
1484
1533
|
***
|
|
1485
1534
|
|
|
1486
|
-
###
|
|
1535
|
+
### rightsManagementPolicyInformationSources?
|
|
1487
1536
|
|
|
1488
|
-
> `optional` **
|
|
1537
|
+
> `optional` **rightsManagementPolicyInformationSources**: `string`
|
|
1489
1538
|
|
|
1490
|
-
The rights management
|
|
1491
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1539
|
+
The rights management policy information sources to add to the factory.
|
|
1492
1540
|
|
|
1493
1541
|
#### Inherited from
|
|
1494
1542
|
|
|
1495
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1543
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyInformationSources`](IEngineEnvironmentVariables.md#rightsmanagementpolicyinformationsources)
|
|
1496
1544
|
|
|
1497
1545
|
***
|
|
1498
1546
|
|
|
1499
|
-
###
|
|
1547
|
+
### rightsManagementPolicyNegotiators?
|
|
1500
1548
|
|
|
1501
|
-
> `optional` **
|
|
1549
|
+
> `optional` **rightsManagementPolicyNegotiators**: `string`
|
|
1502
1550
|
|
|
1503
|
-
The rights management
|
|
1504
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1551
|
+
The rights management policy negotiators sources to add to the factory.
|
|
1505
1552
|
|
|
1506
1553
|
#### Inherited from
|
|
1507
1554
|
|
|
1508
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1555
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyNegotiators`](IEngineEnvironmentVariables.md#rightsmanagementpolicynegotiators)
|
|
1509
1556
|
|
|
1510
1557
|
***
|
|
1511
1558
|
|
|
1512
|
-
###
|
|
1559
|
+
### rightsManagementPolicyRequesters?
|
|
1513
1560
|
|
|
1514
|
-
> `optional` **
|
|
1561
|
+
> `optional` **rightsManagementPolicyRequesters**: `string`
|
|
1515
1562
|
|
|
1516
|
-
The rights management
|
|
1517
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1563
|
+
The rights management policy requesters to add to the factory.
|
|
1518
1564
|
|
|
1519
1565
|
#### Inherited from
|
|
1520
1566
|
|
|
1521
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1567
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyRequesters`](IEngineEnvironmentVariables.md#rightsmanagementpolicyrequesters)
|
|
1522
1568
|
|
|
1523
1569
|
***
|
|
1524
1570
|
|
|
1525
|
-
###
|
|
1571
|
+
### rightsManagementPolicyExecutionActions?
|
|
1526
1572
|
|
|
1527
|
-
> `optional` **
|
|
1573
|
+
> `optional` **rightsManagementPolicyExecutionActions**: `string`
|
|
1528
1574
|
|
|
1529
|
-
The rights management
|
|
1530
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1575
|
+
The rights management policy execution actions to add to the factory.
|
|
1531
1576
|
|
|
1532
1577
|
#### Inherited from
|
|
1533
1578
|
|
|
1534
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1579
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyExecutionActions`](IEngineEnvironmentVariables.md#rightsmanagementpolicyexecutionactions)
|
|
1535
1580
|
|
|
1536
1581
|
***
|
|
1537
1582
|
|
|
1538
|
-
###
|
|
1583
|
+
### rightsManagementPolicyEnforcementProcessors?
|
|
1539
1584
|
|
|
1540
|
-
> `optional` **
|
|
1585
|
+
> `optional` **rightsManagementPolicyEnforcementProcessors**: `string`
|
|
1541
1586
|
|
|
1542
|
-
The rights management
|
|
1543
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1587
|
+
The rights management policy enforcement processors to add to the factory.
|
|
1544
1588
|
|
|
1545
1589
|
#### Inherited from
|
|
1546
1590
|
|
|
1547
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1591
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyEnforcementProcessors`](IEngineEnvironmentVariables.md#rightsmanagementpolicyenforcementprocessors)
|
|
1548
1592
|
|
|
1549
1593
|
***
|
|
1550
1594
|
|
|
1551
|
-
###
|
|
1595
|
+
### rightsManagementPolicyArbiters?
|
|
1552
1596
|
|
|
1553
|
-
> `optional` **
|
|
1597
|
+
> `optional` **rightsManagementPolicyArbiters**: `string`
|
|
1554
1598
|
|
|
1555
|
-
The rights management
|
|
1556
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1599
|
+
The rights management policy arbiters to add to the factory.
|
|
1557
1600
|
|
|
1558
1601
|
#### Inherited from
|
|
1559
1602
|
|
|
1560
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1603
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementPolicyArbiters`](IEngineEnvironmentVariables.md#rightsmanagementpolicyarbiters)
|
|
1561
1604
|
|
|
1562
1605
|
***
|
|
1563
1606
|
|
|
1564
|
-
###
|
|
1607
|
+
### rightsManagementDataAccessHandlers?
|
|
1565
1608
|
|
|
1566
|
-
> `optional` **
|
|
1609
|
+
> `optional` **rightsManagementDataAccessHandlers**: `string`
|
|
1567
1610
|
|
|
1568
|
-
The rights management
|
|
1569
|
-
Use the @json: prefix to specify the path to the JSON configuration file.
|
|
1611
|
+
The rights management data access handlers to add to the factory.
|
|
1570
1612
|
|
|
1571
1613
|
#### Inherited from
|
|
1572
1614
|
|
|
1573
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`
|
|
1615
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`rightsManagementDataAccessHandlers`](IEngineEnvironmentVariables.md#rightsmanagementdataaccesshandlers)
|
|
1574
1616
|
|
|
1575
1617
|
***
|
|
1576
1618
|
|