@twin.org/node-core 0.0.3-next.3 → 0.0.3-next.30
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/README.md +3 -1
- package/dist/es/builders/engineEnvBuilder.js +194 -123
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +51 -23
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/cli.js +247 -0
- package/dist/es/cli.js.map +1 -0
- package/dist/es/commands/bootstrapLegacy.js +186 -0
- package/dist/es/commands/bootstrapLegacy.js.map +1 -0
- package/dist/es/commands/help.js +85 -0
- package/dist/es/commands/help.js.map +1 -0
- package/dist/es/commands/identityCreate.js +316 -0
- package/dist/es/commands/identityCreate.js.map +1 -0
- package/dist/es/commands/identityImports.js +82 -0
- package/dist/es/commands/identityImports.js.map +1 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js +146 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodCreate.js +228 -0
- package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodImport.js +126 -0
- package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
- package/dist/es/commands/nodeSetIdentity.js +64 -0
- package/dist/es/commands/nodeSetIdentity.js.map +1 -0
- package/dist/es/commands/nodeSetTenant.js +68 -0
- package/dist/es/commands/nodeSetTenant.js.map +1 -0
- package/dist/es/commands/tenantCreate.js +139 -0
- package/dist/es/commands/tenantCreate.js.map +1 -0
- package/dist/es/commands/tenantImport.js +97 -0
- package/dist/es/commands/tenantImport.js.map +1 -0
- package/dist/es/commands/tenantUpdate.js +94 -0
- package/dist/es/commands/tenantUpdate.js.map +1 -0
- package/dist/es/commands/userCreate.js +212 -0
- package/dist/es/commands/userCreate.js.map +1 -0
- package/dist/es/commands/userUpdate.js +132 -0
- package/dist/es/commands/userUpdate.js.map +1 -0
- package/dist/es/commands/vaultKeyCreate.js +191 -0
- package/dist/es/commands/vaultKeyCreate.js.map +1 -0
- package/dist/es/commands/vaultKeyImport.js +104 -0
- package/dist/es/commands/vaultKeyImport.js.map +1 -0
- package/dist/es/defaults.js +17 -1
- package/dist/es/defaults.js.map +1 -1
- package/dist/es/index.js +7 -3
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/ICliArgs.js +4 -0
- package/dist/es/models/ICliArgs.js.map +1 -0
- package/dist/es/models/ICliCommand.js +2 -0
- package/dist/es/models/ICliCommand.js.map +1 -0
- package/dist/es/models/ICliCommandDefinition.js +2 -0
- package/dist/es/models/ICliCommandDefinition.js.map +1 -0
- package/dist/es/models/ICliCommandDefinitionParam.js +2 -0
- package/dist/es/models/ICliCommandDefinitionParam.js.map +1 -0
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
- package/dist/es/models/INodeEngineState.js.map +1 -1
- package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
- package/dist/es/models/INodeOptions.js.map +1 -1
- package/dist/es/models/cliCommandParamType.js +4 -0
- package/dist/es/models/cliCommandParamType.js.map +1 -0
- package/dist/es/node.js +84 -39
- package/dist/es/node.js.map +1 -1
- package/dist/es/start.js +139 -0
- package/dist/es/start.js.map +1 -0
- package/dist/es/utils.js +12 -22
- package/dist/es/utils.js.map +1 -1
- package/dist/types/builders/engineEnvBuilder.d.ts +1 -1
- package/dist/types/builders/engineServerEnvBuilder.d.ts +4 -2
- package/dist/types/cli.d.ts +56 -0
- package/dist/types/commands/bootstrapLegacy.d.ts +66 -0
- package/dist/types/commands/help.d.ts +23 -0
- package/dist/types/commands/identityCreate.d.ts +39 -0
- package/dist/types/commands/identityImports.d.ts +24 -0
- package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
- package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
- package/dist/types/commands/identityVerificationMethodImport.d.ts +31 -0
- package/dist/types/commands/nodeSetIdentity.d.ts +22 -0
- package/dist/types/commands/nodeSetTenant.d.ts +22 -0
- package/dist/types/commands/tenantCreate.d.ts +38 -0
- package/dist/types/commands/tenantImport.d.ts +26 -0
- package/dist/types/commands/tenantUpdate.d.ts +26 -0
- package/dist/types/commands/userCreate.d.ts +49 -0
- package/dist/types/commands/userUpdate.d.ts +38 -0
- package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
- package/dist/types/commands/vaultKeyImport.d.ts +28 -0
- package/dist/types/defaults.d.ts +9 -1
- package/dist/types/index.d.ts +7 -3
- package/dist/types/models/ICliArgs.d.ts +20 -0
- package/dist/types/models/ICliCommand.d.ts +17 -0
- package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
- package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +72 -56
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +4 -0
- package/dist/types/models/INodeEngineState.d.ts +0 -8
- package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
- package/dist/types/models/INodeOptions.d.ts +6 -2
- package/dist/types/models/cliCommandParamType.d.ts +4 -0
- package/dist/types/node.d.ts +5 -4
- package/dist/types/{server.d.ts → start.d.ts} +4 -2
- package/dist/types/utils.d.ts +6 -8
- package/docs/changelog.md +199 -1
- package/docs/examples.md +99 -1
- package/docs/reference/functions/buildConfiguration.md +1 -1
- package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
- package/docs/reference/functions/constructCliCommand.md +27 -0
- package/docs/reference/functions/executeCommand.md +29 -0
- package/docs/reference/functions/getEnvDefaults.md +19 -0
- package/docs/reference/functions/getScriptDirectory.md +19 -0
- package/docs/reference/functions/parseCommandLineArgs.md +19 -0
- package/docs/reference/functions/processEnvOptions.md +27 -0
- package/docs/reference/functions/registerCommands.md +9 -0
- package/docs/reference/functions/resolvePackageEntryPoint.md +2 -2
- package/docs/reference/functions/run.md +8 -2
- package/docs/reference/functions/start.md +9 -3
- package/docs/reference/functions/substituteEnvOptions.md +25 -0
- package/docs/reference/index.md +14 -12
- package/docs/reference/interfaces/ICacheMetadata.md +3 -3
- package/docs/reference/interfaces/ICliArgs.md +35 -0
- package/docs/reference/interfaces/ICliCommand.md +23 -0
- package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
- package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +349 -313
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +434 -370
- package/docs/reference/interfaces/IModuleProtocol.md +3 -3
- package/docs/reference/interfaces/INodeEngineState.md +4 -20
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +448 -464
- package/docs/reference/interfaces/INodeOptions.md +44 -36
- package/docs/reference/interfaces/IProtocolHandlerResult.md +2 -2
- package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
- package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +1 -1
- package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +1 -1
- package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +1 -1
- package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +1 -1
- package/docs/reference/variables/ModuleProtocol.md +5 -5
- package/docs/reference/variables/TRUST_VERIFICATION_METHOD_ID.md +3 -0
- package/locales/en.json +589 -30
- package/package.json +6 -4
- package/dist/es/bootstrap.js +0 -360
- package/dist/es/bootstrap.js.map +0 -1
- package/dist/es/identity.js +0 -169
- package/dist/es/identity.js.map +0 -1
- package/dist/es/models/nodeFeatures.js +0 -21
- package/dist/es/models/nodeFeatures.js.map +0 -1
- package/dist/es/server.js +0 -81
- package/dist/es/server.js.map +0 -1
- package/dist/types/bootstrap.d.ts +0 -68
- package/dist/types/identity.d.ts +0 -14
- package/dist/types/models/nodeFeatures.d.ts +0 -21
- package/docs/detailed-guide.md +0 -129
- package/docs/reference/functions/bootstrap.md +0 -29
- package/docs/reference/functions/bootstrapAuth.md +0 -35
- package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
- package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
- package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
- package/docs/reference/functions/bootstrapNodeId.md +0 -35
- package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
- package/docs/reference/functions/bootstrapTenantId.md +0 -35
- package/docs/reference/functions/getFeatures.md +0 -19
- package/docs/reference/type-aliases/NodeFeatures.md +0 -5
- package/docs/reference/variables/NodeFeatures.md +0 -25
- package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
/**
|
|
4
|
-
* The features that can be enabled on the node.
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
-
export const NodeFeatures = {
|
|
8
|
-
/**
|
|
9
|
-
* NodeId - generates an identity for the node if not provided in config.
|
|
10
|
-
*/
|
|
11
|
-
NodeId: "node-identity",
|
|
12
|
-
/**
|
|
13
|
-
* NodeAdminUser - generates an admin user for the node if not provided in config.
|
|
14
|
-
*/
|
|
15
|
-
NodeAdminUser: "node-admin-user",
|
|
16
|
-
/**
|
|
17
|
-
* NodeWallet - generates wallets for any identities that need them.
|
|
18
|
-
*/
|
|
19
|
-
NodeWallet: "node-wallet"
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=nodeFeatures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFeatures.js","sourceRoot":"","sources":["../../../src/models/nodeFeatures.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B;;OAEG;IACH,MAAM,EAAE,eAAe;IAEvB;;OAEG;IACH,aAAa,EAAE,iBAAiB;IAEhC;;OAEG;IACH,UAAU,EAAE,aAAa;CAChB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The features that can be enabled on the node.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const NodeFeatures = {\n\t/**\n\t * NodeId - generates an identity for the node if not provided in config.\n\t */\n\tNodeId: \"node-identity\",\n\n\t/**\n\t * NodeAdminUser - generates an admin user for the node if not provided in config.\n\t */\n\tNodeAdminUser: \"node-admin-user\",\n\n\t/**\n\t * NodeWallet - generates wallets for any identities that need them.\n\t */\n\tNodeWallet: \"node-wallet\"\n} as const;\n\n/**\n * The features that can be enabled on the node.\n */\nexport type NodeFeatures = (typeof NodeFeatures)[keyof typeof NodeFeatures];\n"]}
|
package/dist/es/server.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 IOTA Stiftung.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { GeneralError, I18n, Is } from "@twin.org/core";
|
|
4
|
-
import { Engine } from "@twin.org/engine";
|
|
5
|
-
import { FileStateStorage } from "@twin.org/engine-core";
|
|
6
|
-
import { EngineCoreFactory } from "@twin.org/engine-models";
|
|
7
|
-
import { EngineServer } from "@twin.org/engine-server";
|
|
8
|
-
import { BlobStorageConnectorType, EntityStorageConnectorType } from "@twin.org/engine-types";
|
|
9
|
-
import { bootstrap } from "./bootstrap.js";
|
|
10
|
-
import { extensionsInitialiseEngine, extensionsInitialiseEngineServer, shutdownExtensions } from "./builders/extensionsBuilder.js";
|
|
11
|
-
let isStarted = false;
|
|
12
|
-
/**
|
|
13
|
-
* Start the engine server.
|
|
14
|
-
* @param nodeOptions Optional run options for the engine server.
|
|
15
|
-
* @param nodeEngineConfig The configuration for the engine server.
|
|
16
|
-
* @param envVars The environment variables.
|
|
17
|
-
* @param availableContextIdKeys The context ID keys available for operation.
|
|
18
|
-
* @returns The engine server.
|
|
19
|
-
*/
|
|
20
|
-
export async function start(nodeOptions, nodeEngineConfig, envVars, availableContextIdKeys) {
|
|
21
|
-
const entityStorageConnectorType = envVars.entityStorageConnectorType?.split(",") ?? [];
|
|
22
|
-
const blobStorageConnectorType = envVars.blobStorageConnectorType?.split(",") ?? [];
|
|
23
|
-
// If the blob storage or entity storage is configured with file connectors
|
|
24
|
-
// then we need to make sure the storageFileRoot is set
|
|
25
|
-
if ((entityStorageConnectorType.includes(EntityStorageConnectorType.File) ||
|
|
26
|
-
blobStorageConnectorType.includes(BlobStorageConnectorType.File) ||
|
|
27
|
-
Is.empty(nodeOptions?.stateStorage)) &&
|
|
28
|
-
!Is.stringValue(envVars.storageFileRoot)) {
|
|
29
|
-
throw new GeneralError("node", "storageFileRootNotSet", {
|
|
30
|
-
storageFileRoot: `${nodeOptions?.envPrefix ?? ""}STORAGE_FILE_ROOT`
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// Create the engine instance using file state storage unless one is configured in options
|
|
34
|
-
const engine = new Engine({
|
|
35
|
-
config: nodeEngineConfig,
|
|
36
|
-
stateStorage: nodeOptions?.stateStorage ?? new FileStateStorage(envVars.stateFilename ?? ""),
|
|
37
|
-
customBootstrap: async (core, engineContext) => bootstrap(core, engineContext, envVars)
|
|
38
|
-
});
|
|
39
|
-
if (Is.arrayValue(availableContextIdKeys)) {
|
|
40
|
-
const added = [];
|
|
41
|
-
for (const availableContextIdKey of availableContextIdKeys) {
|
|
42
|
-
if (!added.includes(availableContextIdKey.key)) {
|
|
43
|
-
engine.addContextIdKey(availableContextIdKey.key, availableContextIdKey.componentFeatures);
|
|
44
|
-
added.push(availableContextIdKey.key);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
// Construct the server with the engine.
|
|
49
|
-
const server = new EngineServer({ engineCore: engine });
|
|
50
|
-
// Extend the engine.
|
|
51
|
-
if (Is.function(nodeOptions?.extendEngine)) {
|
|
52
|
-
await engine.logInfo(I18n.formatMessage("node.extendingEngine"));
|
|
53
|
-
await nodeOptions.extendEngine(engine);
|
|
54
|
-
}
|
|
55
|
-
await extensionsInitialiseEngine(envVars, engine);
|
|
56
|
-
// Extend the engine server.
|
|
57
|
-
if (Is.function(nodeOptions?.extendEngineServer)) {
|
|
58
|
-
await engine.logInfo(I18n.formatMessage("node.extendingEngineServer"));
|
|
59
|
-
await nodeOptions?.extendEngineServer(server);
|
|
60
|
-
}
|
|
61
|
-
await extensionsInitialiseEngineServer(envVars, engine, server);
|
|
62
|
-
// Need to register the engine with the factory so that background tasks
|
|
63
|
-
// can clone it to spawn new instances.
|
|
64
|
-
EngineCoreFactory.register("engine", () => engine);
|
|
65
|
-
// Start the server, which also starts the engine.
|
|
66
|
-
isStarted = await server.start();
|
|
67
|
-
if (isStarted) {
|
|
68
|
-
return {
|
|
69
|
-
engine,
|
|
70
|
-
server,
|
|
71
|
-
shutdown: async () => {
|
|
72
|
-
if (isStarted) {
|
|
73
|
-
isStarted = false;
|
|
74
|
-
await shutdownExtensions(envVars, engine);
|
|
75
|
-
await server.stop();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=server.js.map
|
package/dist/es/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, I18n, Is } from \"@twin.org/core\";\nimport { Engine } from \"@twin.org/engine\";\nimport { FileStateStorage } from \"@twin.org/engine-core\";\nimport { EngineCoreFactory } from \"@twin.org/engine-models\";\nimport { EngineServer } from \"@twin.org/engine-server\";\nimport type { IEngineServerConfig } from \"@twin.org/engine-server-types\";\nimport { BlobStorageConnectorType, EntityStorageConnectorType } from \"@twin.org/engine-types\";\nimport { bootstrap } from \"./bootstrap.js\";\nimport {\n\textensionsInitialiseEngine,\n\textensionsInitialiseEngineServer,\n\tshutdownExtensions\n} 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\";\n\nlet isStarted = false;\n\n/**\n * Start the engine server.\n * @param nodeOptions Optional run options for the engine server.\n * @param nodeEngineConfig The configuration for the engine server.\n * @param envVars The environment variables.\n * @param availableContextIdKeys The context ID keys available for operation.\n * @returns The engine server.\n */\nexport async function start(\n\tnodeOptions: INodeOptions | undefined,\n\tnodeEngineConfig: INodeEngineConfig,\n\tenvVars: INodeEnvironmentVariables,\n\tavailableContextIdKeys?: { key: string; componentFeatures: 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\tconst entityStorageConnectorType = envVars.entityStorageConnectorType?.split(\",\") ?? [];\n\tconst blobStorageConnectorType = envVars.blobStorageConnectorType?.split(\",\") ?? [];\n\n\t// If the blob storage or entity storage is configured with file connectors\n\t// then we need to make sure the storageFileRoot is set\n\tif (\n\t\t(entityStorageConnectorType.includes(EntityStorageConnectorType.File) ||\n\t\t\tblobStorageConnectorType.includes(BlobStorageConnectorType.File) ||\n\t\t\tIs.empty(nodeOptions?.stateStorage)) &&\n\t\t!Is.stringValue(envVars.storageFileRoot)\n\t) {\n\t\tthrow new GeneralError(\"node\", \"storageFileRootNotSet\", {\n\t\t\tstorageFileRoot: `${nodeOptions?.envPrefix ?? \"\"}STORAGE_FILE_ROOT`\n\t\t});\n\t}\n\n\t// Create the engine instance using file state storage unless one is configured in options\n\tconst engine = new Engine<IEngineServerConfig, INodeEngineState>({\n\t\tconfig: nodeEngineConfig,\n\t\tstateStorage: nodeOptions?.stateStorage ?? new FileStateStorage(envVars.stateFilename ?? \"\"),\n\t\tcustomBootstrap: async (core, engineContext) => bootstrap(core, engineContext, envVars)\n\t});\n\n\tif (Is.arrayValue(availableContextIdKeys)) {\n\t\tconst added: string[] = [];\n\t\tfor (const availableContextIdKey of availableContextIdKeys) {\n\t\t\tif (!added.includes(availableContextIdKey.key)) {\n\t\t\t\tengine.addContextIdKey(availableContextIdKey.key, availableContextIdKey.componentFeatures);\n\t\t\t\tadded.push(availableContextIdKey.key);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Construct the server with the engine.\n\tconst server = new EngineServer({ engineCore: engine });\n\n\t// Extend the engine.\n\tif (Is.function(nodeOptions?.extendEngine)) {\n\t\tawait engine.logInfo(I18n.formatMessage(\"node.extendingEngine\"));\n\t\tawait nodeOptions.extendEngine(engine);\n\t}\n\n\tawait extensionsInitialiseEngine(envVars, engine);\n\n\t// Extend the engine server.\n\tif (Is.function(nodeOptions?.extendEngineServer)) {\n\t\tawait engine.logInfo(I18n.formatMessage(\"node.extendingEngineServer\"));\n\t\tawait nodeOptions?.extendEngineServer(server);\n\t}\n\n\tawait extensionsInitialiseEngineServer(envVars, engine, server);\n\n\t// Need to register the engine with the factory so that background tasks\n\t// can clone it to spawn new instances.\n\tEngineCoreFactory.register(\"engine\", () => engine);\n\n\t// Start the server, which also starts the engine.\n\tisStarted = await server.start();\n\n\tif (isStarted) {\n\t\treturn {\n\t\t\tengine,\n\t\t\tserver,\n\t\t\tshutdown: async () => {\n\t\t\t\tif (isStarted) {\n\t\t\t\t\tisStarted = false;\n\t\t\t\t\tawait shutdownExtensions(envVars, engine);\n\t\t\t\t\tawait server.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
2
|
-
import { type IEngineServerConfig } from "@twin.org/engine-server-types";
|
|
3
|
-
import type { INodeEngineState } from "./models/INodeEngineState.js";
|
|
4
|
-
import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
|
|
5
|
-
import { NodeFeatures } from "./models/nodeFeatures.js";
|
|
6
|
-
/**
|
|
7
|
-
* Bootstrap the application.
|
|
8
|
-
* @param engineCore The engine core for the node.
|
|
9
|
-
* @param context The context for the node.
|
|
10
|
-
* @param envVars The environment variables for the node.
|
|
11
|
-
*/
|
|
12
|
-
export declare function bootstrap(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Bootstrap the node creating any necessary resources.
|
|
15
|
-
* @param engineCore The engine core for the node.
|
|
16
|
-
* @param context The context for the node.
|
|
17
|
-
* @param envVars The environment variables for the node.
|
|
18
|
-
* @param features The features that are enabled on the node. The features that are enabled on the node.
|
|
19
|
-
*/
|
|
20
|
-
export declare function bootstrapNodeId(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Bootstrap the node creating any necessary resources.
|
|
23
|
-
* @param engineCore The engine core for the node.
|
|
24
|
-
* @param context The context for the node.
|
|
25
|
-
* @param envVars The environment variables for the node.
|
|
26
|
-
* @param features The features that are enabled on the node. The features that are enabled on the node.
|
|
27
|
-
*/
|
|
28
|
-
export declare function bootstrapTenantId(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Bootstrap the user.
|
|
31
|
-
* @param engineCore The engine core for the node.
|
|
32
|
-
* @param context The context for the node.
|
|
33
|
-
* @param envVars The environment variables for the node.
|
|
34
|
-
* @param features The features that are enabled on the node.
|
|
35
|
-
*/
|
|
36
|
-
export declare function bootstrapNodeAdminUser(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Bootstrap the immutable proof verification methods.
|
|
39
|
-
* @param engineCore The engine core for the node.
|
|
40
|
-
* @param context The context for the node.
|
|
41
|
-
* @param envVars The environment variables for the node.
|
|
42
|
-
* @param features The features that are enabled on the node.
|
|
43
|
-
*/
|
|
44
|
-
export declare function bootstrapImmutableProofMethod(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Bootstrap the keys for blob encryption.
|
|
47
|
-
* @param engineCore The engine core for the node.
|
|
48
|
-
* @param context The context for the node.
|
|
49
|
-
* @param envVars The environment variables for the node.
|
|
50
|
-
* @param features The features that are enabled on the node.
|
|
51
|
-
*/
|
|
52
|
-
export declare function bootstrapBlobEncryption(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Bootstrap the JWT signing key.
|
|
55
|
-
* @param engineCore The engine core for the node.
|
|
56
|
-
* @param context The context for the node.
|
|
57
|
-
* @param envVars The environment variables for the node.
|
|
58
|
-
* @param features The features that are enabled on the node.
|
|
59
|
-
*/
|
|
60
|
-
export declare function bootstrapAuth(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Bootstrap the synchronised storage blob encryption and verification methods.
|
|
63
|
-
* @param engineCore The engine core for the node.
|
|
64
|
-
* @param context The context for the node.
|
|
65
|
-
* @param envVars The environment variables for the node.
|
|
66
|
-
* @param features The features that are enabled on the node.
|
|
67
|
-
*/
|
|
68
|
-
export declare function bootstrapSynchronisedStorage(engineCore: IEngineCore, context: IEngineCoreContext<IEngineServerConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, features: NodeFeatures[]): Promise<void>;
|
package/dist/types/identity.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
-
import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
|
|
3
|
-
/**
|
|
4
|
-
* Generate an identity and fund it.
|
|
5
|
-
* @param engineCore The engine core for the node.
|
|
6
|
-
* @param envVars The environment variables for the node.
|
|
7
|
-
* @param configIdentity A identity from config to use.
|
|
8
|
-
* @param configMnemonic A mnemonic from config to use.
|
|
9
|
-
* @param controller The controller for the identity.
|
|
10
|
-
* @param identityType The type of identity.
|
|
11
|
-
* @param addWallet Whether to add a wallet for the identity.
|
|
12
|
-
* @returns The identity that was generated.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createIdentity(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, configIdentity: string | undefined, configMnemonic: string | undefined, controller: string | undefined, identityType: "node" | "organization" | "user", addWallet: boolean): Promise<string>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The features that can be enabled on the node.
|
|
3
|
-
*/
|
|
4
|
-
export declare const NodeFeatures: {
|
|
5
|
-
/**
|
|
6
|
-
* NodeId - generates an identity for the node if not provided in config.
|
|
7
|
-
*/
|
|
8
|
-
readonly NodeId: "node-identity";
|
|
9
|
-
/**
|
|
10
|
-
* NodeAdminUser - generates an admin user for the node if not provided in config.
|
|
11
|
-
*/
|
|
12
|
-
readonly NodeAdminUser: "node-admin-user";
|
|
13
|
-
/**
|
|
14
|
-
* NodeWallet - generates wallets for any identities that need them.
|
|
15
|
-
*/
|
|
16
|
-
readonly NodeWallet: "node-wallet";
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* The features that can be enabled on the node.
|
|
20
|
-
*/
|
|
21
|
-
export type NodeFeatures = (typeof NodeFeatures)[keyof typeof NodeFeatures];
|
package/docs/detailed-guide.md
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# TWIN Node - Detailed Documentation
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
TWIN Node provides the foundational components for running TWIN nodes, including dynamic extension loading, protocol-based module resolution, and lifecycle management.
|
|
6
|
-
|
|
7
|
-
## Protocol-Based Extension Loading
|
|
8
|
-
|
|
9
|
-
The TWIN Node supports dynamic extension loading from multiple sources:
|
|
10
|
-
|
|
11
|
-
### Local Files
|
|
12
|
-
|
|
13
|
-
Load extensions from your filesystem:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
TWIN_EXTENSIONS="./my-extension.mjs"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### NPM Packages
|
|
20
|
-
|
|
21
|
-
Automatically install and load npm packages:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
TWIN_EXTENSIONS="npm:@twin.org/package"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### HTTPS URLs
|
|
28
|
-
|
|
29
|
-
Download and cache remote extensions:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
TWIN_EXTENSIONS="https://example.com/extension.mjs"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Extension Lifecycle Hooks
|
|
36
|
-
|
|
37
|
-
Extensions can implement lifecycle hooks to customize node behavior at different stages:
|
|
38
|
-
|
|
39
|
-
- **`extensionInitialise`** - Called before engine initialization
|
|
40
|
-
- **`extensionInitialiseEngine`** - Called during engine initialization
|
|
41
|
-
- **`extensionInitialiseEngineServer`** - Called during server initialization
|
|
42
|
-
- **`extensionShutdown`** - Called during graceful shutdown
|
|
43
|
-
|
|
44
|
-
### Example Extension
|
|
45
|
-
|
|
46
|
-
```javascript
|
|
47
|
-
// my-extension.mjs
|
|
48
|
-
export function extensionInitialise() {
|
|
49
|
-
console.log('Extension initializing...');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function extensionInitialiseEngine(engine) {
|
|
53
|
-
console.log('Configuring engine...');
|
|
54
|
-
// Add custom components, routes, etc.
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function extensionInitialiseEngineServer(server) {
|
|
58
|
-
console.log('Configuring server...');
|
|
59
|
-
// Add middleware, routes, etc.
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function extensionShutdown() {
|
|
63
|
-
console.log('Extension shutting down...');
|
|
64
|
-
// Cleanup resources
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Configuration Options
|
|
69
|
-
|
|
70
|
-
### Cache Management
|
|
71
|
-
|
|
72
|
-
- `TWIN_EXTENSIONS_CACHE_TTL_HOURS` - TTL for HTTPS extensions cache (default: 24)
|
|
73
|
-
- `TWIN_EXTENSIONS_FORCE_REFRESH` - Force refresh all cached extensions (default: false)
|
|
74
|
-
- `TWIN_EXTENSIONS_CACHE_DIRECTORY` - Custom cache directory (default: ".tmp")
|
|
75
|
-
|
|
76
|
-
### Security
|
|
77
|
-
|
|
78
|
-
- `TWIN_EXTENSIONS_MAX_SIZE_MB` - Maximum size for HTTPS downloads (default: 10)
|
|
79
|
-
- `TWIN_EXTENSIONS_CLEAR_CACHE` - Clear cache on startup (default: false)
|
|
80
|
-
|
|
81
|
-
## API Reference
|
|
82
|
-
|
|
83
|
-
### Core Functions
|
|
84
|
-
|
|
85
|
-
#### `overrideModuleImport(executionDirectory, envVars)`
|
|
86
|
-
|
|
87
|
-
Sets up protocol-based module resolution for extensions.
|
|
88
|
-
|
|
89
|
-
#### `buildConfiguration(options)`
|
|
90
|
-
|
|
91
|
-
Builds node configuration from environment variables and options.
|
|
92
|
-
|
|
93
|
-
#### `start(options)`
|
|
94
|
-
|
|
95
|
-
Starts the TWIN node with the specified configuration.
|
|
96
|
-
|
|
97
|
-
### Utility Functions
|
|
98
|
-
|
|
99
|
-
#### `parseModuleProtocol(moduleName)`
|
|
100
|
-
|
|
101
|
-
Parses module name to determine protocol type (npm, https, local, etc.).
|
|
102
|
-
|
|
103
|
-
#### `handleNpmProtocol(packageName, executionDirectory, cacheDirectory)`
|
|
104
|
-
|
|
105
|
-
Handles installation and resolution of npm packages.
|
|
106
|
-
|
|
107
|
-
#### `handleHttpsProtocol(url, executionDirectory, maxSizeMb, cacheDirectory, ttlHours, forceRefresh)`
|
|
108
|
-
|
|
109
|
-
Handles download and caching of HTTPS extensions.
|
|
110
|
-
|
|
111
|
-
## Security Considerations
|
|
112
|
-
|
|
113
|
-
- **HTTPS Only**: Remote extensions must use HTTPS protocol
|
|
114
|
-
- **Size Limits**: Downloads are limited by `TWIN_EXTENSIONS_MAX_SIZE_MB`
|
|
115
|
-
- **Cache TTL**: Extensions are automatically refreshed based on TTL
|
|
116
|
-
- **Security Warnings**: Warnings are displayed when loading remote extensions
|
|
117
|
-
|
|
118
|
-
## Troubleshooting
|
|
119
|
-
|
|
120
|
-
### Common Issues
|
|
121
|
-
|
|
122
|
-
1. **Extension not found**: Check that the path/URL is correct and accessible
|
|
123
|
-
2. **Cache issues**: Use `TWIN_EXTENSIONS_FORCE_REFRESH=true` to force refresh
|
|
124
|
-
3. **Size limit exceeded**: Increase `TWIN_EXTENSIONS_MAX_SIZE_MB` if needed
|
|
125
|
-
4. **Network issues**: Ensure HTTPS URLs are accessible and not blocked by firewall
|
|
126
|
-
|
|
127
|
-
### Debug Mode
|
|
128
|
-
|
|
129
|
-
Set `NODE_ENV=development` for additional debug output during extension loading.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Function: bootstrap()
|
|
2
|
-
|
|
3
|
-
> **bootstrap**(`engineCore`, `context`, `envVars`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the application.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
## Returns
|
|
28
|
-
|
|
29
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapAuth()
|
|
2
|
-
|
|
3
|
-
> **bootstrapAuth**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the JWT signing key.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapBlobEncryption()
|
|
2
|
-
|
|
3
|
-
> **bootstrapBlobEncryption**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the keys for blob encryption.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapImmutableProofMethod()
|
|
2
|
-
|
|
3
|
-
> **bootstrapImmutableProofMethod**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the immutable proof verification methods.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapNodeAdminUser()
|
|
2
|
-
|
|
3
|
-
> **bootstrapNodeAdminUser**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the user.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapNodeId()
|
|
2
|
-
|
|
3
|
-
> **bootstrapNodeId**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the node creating any necessary resources.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node. The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapSynchronisedStorage()
|
|
2
|
-
|
|
3
|
-
> **bootstrapSynchronisedStorage**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the synchronised storage blob encryption and verification methods.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Function: bootstrapTenantId()
|
|
2
|
-
|
|
3
|
-
> **bootstrapTenantId**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
-
|
|
5
|
-
Bootstrap the node creating any necessary resources.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### engineCore
|
|
10
|
-
|
|
11
|
-
`IEngineCore`
|
|
12
|
-
|
|
13
|
-
The engine core for the node.
|
|
14
|
-
|
|
15
|
-
### context
|
|
16
|
-
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>
|
|
18
|
-
|
|
19
|
-
The context for the node.
|
|
20
|
-
|
|
21
|
-
### envVars
|
|
22
|
-
|
|
23
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
-
|
|
25
|
-
The environment variables for the node.
|
|
26
|
-
|
|
27
|
-
### features
|
|
28
|
-
|
|
29
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
30
|
-
|
|
31
|
-
The features that are enabled on the node. The features that are enabled on the node.
|
|
32
|
-
|
|
33
|
-
## Returns
|
|
34
|
-
|
|
35
|
-
`Promise`\<`void`\>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Function: getFeatures()
|
|
2
|
-
|
|
3
|
-
> **getFeatures**(`env`): [`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
4
|
-
|
|
5
|
-
Get the features that are enabled on the node.
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
### env
|
|
10
|
-
|
|
11
|
-
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
12
|
-
|
|
13
|
-
The environment variables for the node.
|
|
14
|
-
|
|
15
|
-
## Returns
|
|
16
|
-
|
|
17
|
-
[`NodeFeatures`](../type-aliases/NodeFeatures.md)[]
|
|
18
|
-
|
|
19
|
-
The features that are enabled on the node.
|