@twin.org/node-core 0.0.3-next.2 → 0.0.3-next.20

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 (151) hide show
  1. package/dist/es/builders/engineEnvBuilder.js +151 -104
  2. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  3. package/dist/es/builders/engineServerEnvBuilder.js +49 -25
  4. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
  5. package/dist/es/cli.js +247 -0
  6. package/dist/es/cli.js.map +1 -0
  7. package/dist/es/commands/bootstrapLegacy.js +183 -0
  8. package/dist/es/commands/bootstrapLegacy.js.map +1 -0
  9. package/dist/es/commands/help.js +85 -0
  10. package/dist/es/commands/help.js.map +1 -0
  11. package/dist/es/commands/identityCreate.js +316 -0
  12. package/dist/es/commands/identityCreate.js.map +1 -0
  13. package/dist/es/commands/identityImports.js +82 -0
  14. package/dist/es/commands/identityImports.js.map +1 -0
  15. package/dist/es/commands/identityVerifiableCredentialCreate.js +146 -0
  16. package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
  17. package/dist/es/commands/identityVerificationMethodCreate.js +214 -0
  18. package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
  19. package/dist/es/commands/identityVerificationMethodImport.js +126 -0
  20. package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
  21. package/dist/es/commands/nodeSetIdentity.js +64 -0
  22. package/dist/es/commands/nodeSetIdentity.js.map +1 -0
  23. package/dist/es/commands/nodeSetTenant.js +68 -0
  24. package/dist/es/commands/nodeSetTenant.js.map +1 -0
  25. package/dist/es/commands/tenantCreate.js +139 -0
  26. package/dist/es/commands/tenantCreate.js.map +1 -0
  27. package/dist/es/commands/tenantImport.js +97 -0
  28. package/dist/es/commands/tenantImport.js.map +1 -0
  29. package/dist/es/commands/tenantUpdate.js +94 -0
  30. package/dist/es/commands/tenantUpdate.js.map +1 -0
  31. package/dist/es/commands/userCreate.js +212 -0
  32. package/dist/es/commands/userCreate.js.map +1 -0
  33. package/dist/es/commands/userUpdate.js +132 -0
  34. package/dist/es/commands/userUpdate.js.map +1 -0
  35. package/dist/es/commands/vaultKeyCreate.js +191 -0
  36. package/dist/es/commands/vaultKeyCreate.js.map +1 -0
  37. package/dist/es/commands/vaultKeyImport.js +104 -0
  38. package/dist/es/commands/vaultKeyImport.js.map +1 -0
  39. package/dist/es/defaults.js +19 -1
  40. package/dist/es/defaults.js.map +1 -1
  41. package/dist/es/index.js +7 -3
  42. package/dist/es/index.js.map +1 -1
  43. package/dist/es/models/ICliArgs.js +4 -0
  44. package/dist/es/models/ICliArgs.js.map +1 -0
  45. package/dist/es/models/ICliCommand.js +2 -0
  46. package/dist/es/models/ICliCommand.js.map +1 -0
  47. package/dist/es/models/ICliCommandDefinition.js +2 -0
  48. package/dist/es/models/ICliCommandDefinition.js.map +1 -0
  49. package/dist/es/models/ICliCommandDefinitionParam.js +2 -0
  50. package/dist/es/models/ICliCommandDefinitionParam.js.map +1 -0
  51. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  52. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
  53. package/dist/es/models/INodeEngineState.js.map +1 -1
  54. package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
  55. package/dist/es/models/INodeOptions.js.map +1 -1
  56. package/dist/es/models/cliCommandParamType.js +4 -0
  57. package/dist/es/models/cliCommandParamType.js.map +1 -0
  58. package/dist/es/node.js +71 -39
  59. package/dist/es/node.js.map +1 -1
  60. package/dist/es/start.js +139 -0
  61. package/dist/es/start.js.map +1 -0
  62. package/dist/es/utils.js +11 -21
  63. package/dist/es/utils.js.map +1 -1
  64. package/dist/types/builders/engineEnvBuilder.d.ts +4 -1
  65. package/dist/types/builders/engineServerEnvBuilder.d.ts +5 -2
  66. package/dist/types/cli.d.ts +56 -0
  67. package/dist/types/commands/bootstrapLegacy.d.ts +66 -0
  68. package/dist/types/commands/help.d.ts +23 -0
  69. package/dist/types/commands/identityCreate.d.ts +39 -0
  70. package/dist/types/commands/identityImports.d.ts +24 -0
  71. package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
  72. package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
  73. package/dist/types/commands/identityVerificationMethodImport.d.ts +31 -0
  74. package/dist/types/commands/nodeSetIdentity.d.ts +22 -0
  75. package/dist/types/commands/nodeSetTenant.d.ts +22 -0
  76. package/dist/types/commands/tenantCreate.d.ts +38 -0
  77. package/dist/types/commands/tenantImport.d.ts +26 -0
  78. package/dist/types/commands/tenantUpdate.d.ts +26 -0
  79. package/dist/types/commands/userCreate.d.ts +49 -0
  80. package/dist/types/commands/userUpdate.d.ts +38 -0
  81. package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
  82. package/dist/types/commands/vaultKeyImport.d.ts +28 -0
  83. package/dist/types/defaults.d.ts +11 -1
  84. package/dist/types/index.d.ts +7 -3
  85. package/dist/types/models/ICliArgs.d.ts +20 -0
  86. package/dist/types/models/ICliCommand.d.ts +17 -0
  87. package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
  88. package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
  89. package/dist/types/models/IEngineEnvironmentVariables.d.ts +58 -53
  90. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +4 -0
  91. package/dist/types/models/INodeEngineState.d.ts +0 -8
  92. package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
  93. package/dist/types/models/INodeOptions.d.ts +6 -2
  94. package/dist/types/models/cliCommandParamType.d.ts +4 -0
  95. package/dist/types/node.d.ts +8 -4
  96. package/dist/types/{server.d.ts → start.d.ts} +7 -2
  97. package/dist/types/utils.d.ts +6 -8
  98. package/docs/changelog.md +129 -0
  99. package/docs/reference/functions/buildConfiguration.md +3 -3
  100. package/docs/reference/functions/buildEngineConfiguration.md +1 -1
  101. package/docs/reference/functions/buildEngineServerConfiguration.md +3 -3
  102. package/docs/reference/functions/constructCliCommand.md +27 -0
  103. package/docs/reference/functions/executeCommand.md +29 -0
  104. package/docs/reference/functions/getEnvDefaults.md +19 -0
  105. package/docs/reference/functions/getScriptDirectory.md +19 -0
  106. package/docs/reference/functions/parseCommandLineArgs.md +19 -0
  107. package/docs/reference/functions/processEnvOptions.md +27 -0
  108. package/docs/reference/functions/registerCommands.md +9 -0
  109. package/docs/reference/functions/run.md +8 -2
  110. package/docs/reference/functions/start.md +10 -4
  111. package/docs/reference/functions/substituteEnvOptions.md +25 -0
  112. package/docs/reference/index.md +16 -13
  113. package/docs/reference/interfaces/ICliArgs.md +35 -0
  114. package/docs/reference/interfaces/ICliCommand.md +23 -0
  115. package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
  116. package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
  117. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +102 -85
  118. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +154 -117
  119. package/docs/reference/interfaces/INodeEngineState.md +0 -16
  120. package/docs/reference/interfaces/INodeEnvironmentVariables.md +158 -201
  121. package/docs/reference/interfaces/INodeOptions.md +10 -2
  122. package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
  123. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_DID.md +3 -0
  124. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md +3 -0
  125. package/docs/reference/variables/TRUST_VERIFICATION_METHOD_ID.md +3 -0
  126. package/locales/en.json +589 -30
  127. package/package.json +3 -1
  128. package/dist/es/bootstrap.js +0 -374
  129. package/dist/es/bootstrap.js.map +0 -1
  130. package/dist/es/identity.js +0 -169
  131. package/dist/es/identity.js.map +0 -1
  132. package/dist/es/models/nodeFeatures.js +0 -21
  133. package/dist/es/models/nodeFeatures.js.map +0 -1
  134. package/dist/es/server.js +0 -78
  135. package/dist/es/server.js.map +0 -1
  136. package/dist/types/bootstrap.d.ts +0 -76
  137. package/dist/types/identity.d.ts +0 -14
  138. package/dist/types/models/nodeFeatures.d.ts +0 -21
  139. package/docs/reference/functions/bootstrap.md +0 -29
  140. package/docs/reference/functions/bootstrapAuth.md +0 -35
  141. package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
  142. package/docs/reference/functions/bootstrapContextIdHandlers.md +0 -35
  143. package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
  144. package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
  145. package/docs/reference/functions/bootstrapNodeId.md +0 -35
  146. package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
  147. package/docs/reference/functions/bootstrapTenantId.md +0 -35
  148. package/docs/reference/functions/getFeatures.md +0 -19
  149. package/docs/reference/type-aliases/NodeFeatures.md +0 -5
  150. package/docs/reference/variables/NodeFeatures.md +0 -25
  151. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
@@ -7,8 +7,8 @@ import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
7
7
  */
8
8
  export interface INodeOptions {
9
9
  /**
10
- * The name of the server, defaults to "TWIN Node Server".
11
- * @default "TWIN Node Server"
10
+ * The name of the server, defaults to "TWIN Node".
11
+ * @default "TWIN Node"
12
12
  */
13
13
  serverName?: string;
14
14
  /**
@@ -40,6 +40,10 @@ export interface INodeOptions {
40
40
  * This will be merged with any configuration loaded from the environment variables.
41
41
  */
42
42
  config?: IEngineConfig;
43
+ /**
44
+ * The directory to override the script location, defaults to location of index.js.
45
+ */
46
+ scriptDirectory?: string;
43
47
  /**
44
48
  * The directory to override the execution location, defaults to process directory.
45
49
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type for the properties in commands.
3
+ */
4
+ export type CliCommandParamType = string | number | boolean;
@@ -7,17 +7,18 @@ import type { INodeEngineState } from "./models/INodeEngineState.js";
7
7
  import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
8
8
  import type { INodeOptions } from "./models/INodeOptions.js";
9
9
  /**
10
- * Run the TWIN Node server.
10
+ * Run the TWIN Node.
11
11
  * @param nodeOptions Optional configuration options for running the server.
12
+ * @param args Optional command line arguments.
12
13
  * @returns A promise that resolves when the server is started containing a shutdown method.
13
14
  */
14
- export declare function run(nodeOptions?: INodeOptions): Promise<{
15
+ export declare function run(nodeOptions?: INodeOptions, args?: string[]): Promise<{
15
16
  engine: Engine<IEngineServerConfig, INodeEngineState>;
16
17
  server: EngineServer;
17
18
  shutdown: () => Promise<void>;
18
19
  } | undefined>;
19
20
  /**
20
- * Build the configuration for the TWIN Node server.
21
+ * Build the configuration for the TWIN Node.
21
22
  * @param processEnv The environment variables from the process.
22
23
  * @param options The options for running the server.
23
24
  * @param serverInfo The server information.
@@ -31,7 +32,10 @@ export declare function buildConfiguration(processEnv: {
31
32
  [id: string]: string | unknown;
32
33
  };
33
34
  nodeEngineConfig: INodeEngineConfig;
34
- contextIdKeys: string[];
35
+ availableContextIdKeys: {
36
+ key: string;
37
+ requiredHandlerFeatures: string[];
38
+ }[];
35
39
  }>;
36
40
  /**
37
41
  * Override module imports to support protocol-based loading (npm:, https:) and local files.
@@ -1,6 +1,7 @@
1
1
  import { Engine } from "@twin.org/engine";
2
2
  import { EngineServer } from "@twin.org/engine-server";
3
3
  import type { IEngineServerConfig } from "@twin.org/engine-server-types";
4
+ import type { ICliCommand } from "./models/ICliCommand.js";
4
5
  import type { INodeEngineConfig } from "./models/INodeEngineConfig.js";
5
6
  import type { INodeEngineState } from "./models/INodeEngineState.js";
6
7
  import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
@@ -10,10 +11,14 @@ import type { INodeOptions } from "./models/INodeOptions.js";
10
11
  * @param nodeOptions Optional run options for the engine server.
11
12
  * @param nodeEngineConfig The configuration for the engine server.
12
13
  * @param envVars The environment variables.
13
- * @param contextIdKeys The context ID keys.
14
+ * @param cliCommand The constructed CLI command (optional).
15
+ * @param availableContextIdKeys The context ID keys available for operation.
14
16
  * @returns The engine server.
15
17
  */
16
- export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, contextIdKeys?: string[]): Promise<{
18
+ export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, cliCommand?: ICliCommand, availableContextIdKeys?: {
19
+ key: string;
20
+ requiredHandlerFeatures: string[];
21
+ }[]): Promise<{
17
22
  engine: Engine<IEngineServerConfig, INodeEngineState>;
18
23
  server: EngineServer;
19
24
  shutdown: () => Promise<void>;
@@ -1,8 +1,6 @@
1
1
  import type { IModuleProtocol } from "./models/IModuleProtocol.js";
2
- import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
3
2
  import type { IProtocolHandlerResult } from "./models/IProtocolHandlerResult.js";
4
3
  import { ModuleProtocol } from "./models/moduleProtocol.js";
5
- import { NodeFeatures } from "./models/nodeFeatures.js";
6
4
  /**
7
5
  * Initialise the locales for the application.
8
6
  * @param localesDirectory The directory containing the locales.
@@ -13,6 +11,12 @@ export declare function initialiseLocales(localesDirectory: string): Promise<voi
13
11
  * @returns The execution directory.
14
12
  */
15
13
  export declare function getExecutionDirectory(): string;
14
+ /**
15
+ * Get the directory where the script is located.
16
+ * @param args The command line arguments.
17
+ * @returns The execution directory.
18
+ */
19
+ export declare function getScriptDirectory(args?: string[]): string;
16
20
  /**
17
21
  * Does the specified file exist.
18
22
  * @param filename The filename to check for existence.
@@ -49,12 +53,6 @@ export declare function loadTextFile(filename: string): Promise<string>;
49
53
  * @returns The contents of the JSON file or null if it could not be loaded.
50
54
  */
51
55
  export declare function loadJsonFile<T>(filename: string): Promise<T>;
52
- /**
53
- * Get the features that are enabled on the node.
54
- * @param env The environment variables for the node.
55
- * @returns The features that are enabled on the node.
56
- */
57
- export declare function getFeatures(env: INodeEnvironmentVariables): NodeFeatures[];
58
56
  /**
59
57
  * Parse the protocol from a module name.
60
58
  * @param moduleName The module name to parse.
package/docs/changelog.md CHANGED
@@ -1,5 +1,134 @@
1
1
  # @twin.org/node-core - Changelog
2
2
 
3
+ ## [0.0.3-next.20](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.19...node-core-v0.0.3-next.20) (2026-02-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * update dependencies ([6cb3d3a](https://github.com/twinfoundation/node/commit/6cb3d3a63f7b976f80074ddecfba034b7e92f919))
9
+
10
+ ## [0.0.3-next.19](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.18...node-core-v0.0.3-next.19) (2026-02-05)
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * **node-core:** Synchronize repo versions
16
+
17
+ ## [0.0.3-next.18](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.17...node-core-v0.0.3-next.18) (2026-02-04)
18
+
19
+
20
+ ### Features
21
+
22
+ * env-prefix option and user-update cli command ([#83](https://github.com/twinfoundation/node/issues/83)) ([fc48efa](https://github.com/twinfoundation/node/commit/fc48efa7ad72173def048170c3afb5eeb9f1b292))
23
+
24
+ ## [0.0.3-next.17](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.16...node-core-v0.0.3-next.17) (2026-02-02)
25
+
26
+
27
+ ### Features
28
+
29
+ * update rights management ([5c992c6](https://github.com/twinfoundation/node/commit/5c992c6b0d72f3eeaa39ee267e096d9a3f477f4e))
30
+
31
+ ## [0.0.3-next.16](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.15...node-core-v0.0.3-next.16) (2026-01-28)
32
+
33
+
34
+ ### Features
35
+
36
+ * remove dap and darp ([36c3ffb](https://github.com/twinfoundation/node/commit/36c3ffb31af65a0e3025859dab675efeee043155))
37
+
38
+ ## [0.0.3-next.15](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.14...node-core-v0.0.3-next.15) (2026-01-26)
39
+
40
+
41
+ ### Features
42
+
43
+ * support public origin and hosting service ([#77](https://github.com/twinfoundation/node/issues/77)) ([3b9039f](https://github.com/twinfoundation/node/commit/3b9039fcba7f7038c06f8fd6a5ccc9fdbbf535b3))
44
+ * update context usage ([2215440](https://github.com/twinfoundation/node/commit/2215440801dea3955885b6579ad9b98b7a5d87ea))
45
+
46
+ ## [0.0.3-next.14](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.13...node-core-v0.0.3-next.14) (2026-01-21)
47
+
48
+
49
+ ### Features
50
+
51
+ * add vault prefix configuration ([#75](https://github.com/twinfoundation/node/issues/75)) ([1d4afb1](https://github.com/twinfoundation/node/commit/1d4afb1b1a8aa60795898eeb9e7f5153c279527d))
52
+
53
+ ## [0.0.3-next.13](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.12...node-core-v0.0.3-next.13) (2026-01-19)
54
+
55
+
56
+ ### Features
57
+
58
+ * add trust ttl ([#73](https://github.com/twinfoundation/node/issues/73)) ([911cee7](https://github.com/twinfoundation/node/commit/911cee771bba490143bb1574ca8360f7cf8baa1a))
59
+ * update order of logging ([2161938](https://github.com/twinfoundation/node/commit/2161938c969b18e4678459a69090287e5ccdb404))
60
+ * update order of logging ([b295f31](https://github.com/twinfoundation/node/commit/b295f315f7c5b611d229d9e5314d414da05828b9))
61
+
62
+ ## [0.0.3-next.12](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.11...node-core-v0.0.3-next.12) (2026-01-19)
63
+
64
+
65
+ ### Features
66
+
67
+ * separate script directory from exec directory ([f6bb4db](https://github.com/twinfoundation/node/commit/f6bb4dbea1f1e200e0640fa154c6997ef99c99b4))
68
+
69
+ ## [0.0.3-next.11](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.10...node-core-v0.0.3-next.11) (2026-01-19)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * improve calculation of execution directory ([106d65d](https://github.com/twinfoundation/node/commit/106d65d7ad5524e2e147b681d68f9476c024cfaa))
75
+
76
+ ## [0.0.3-next.10](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.9...node-core-v0.0.3-next.10) (2026-01-19)
77
+
78
+
79
+ ### Features
80
+
81
+ * add CLI commands and remove automated bootstrap code ([#69](https://github.com/twinfoundation/node/issues/69)) ([6e40933](https://github.com/twinfoundation/node/commit/6e40933d8bb820b380e1074fc88feeedca0ef7d9))
82
+
83
+ ## [0.0.3-next.9](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.8...node-core-v0.0.3-next.9) (2026-01-07)
84
+
85
+
86
+ ### Features
87
+
88
+ * improve bootstrapping and shutdown behaviour ([#66](https://github.com/twinfoundation/node/issues/66)) ([65b3452](https://github.com/twinfoundation/node/commit/65b345240334bfff48b52e136cc486cd7ac7f290))
89
+
90
+ ## [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)
91
+
92
+
93
+ ### Features
94
+
95
+ * update for livez endpoint ([9fc2e6a](https://github.com/twinfoundation/node/commit/9fc2e6ade38b3ec9591399a633d02b1e5fe07910))
96
+
97
+ ## [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)
98
+
99
+
100
+ ### Features
101
+
102
+ * add trust and rights management plugin support ([cdeb504](https://github.com/twinfoundation/node/commit/cdeb504ee5986a347466162b9afa781645b4a54c))
103
+
104
+ ## [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)
105
+
106
+
107
+ ### Features
108
+
109
+ * update background tasks and add fedcat filters ([1fd297e](https://github.com/twinfoundation/node/commit/1fd297e29f60b5bb3909638b68e326c5b0e2d77d))
110
+
111
+ ## [0.0.3-next.5](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.4...node-core-v0.0.3-next.5) (2025-11-26)
112
+
113
+
114
+ ### Features
115
+
116
+ * add support for dynamodb connection timeout ([63051b0](https://github.com/twinfoundation/node/commit/63051b0d22138079115dfac921e7f0c45eaad34e))
117
+
118
+ ## [0.0.3-next.4](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.3...node-core-v0.0.3-next.4) (2025-11-24)
119
+
120
+
121
+ ### Bug Fixes
122
+
123
+ * org identity verification methods ([18f158b](https://github.com/twinfoundation/node/commit/18f158b2f63930e20e94437c17ed43421771a458))
124
+
125
+ ## [0.0.3-next.3](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.2...node-core-v0.0.3-next.3) (2025-11-20)
126
+
127
+
128
+ ### Features
129
+
130
+ * updated context id features ([ef7be07](https://github.com/twinfoundation/node/commit/ef7be07d44dccdeacf10f90cb4ffde0303faa6fa))
131
+
3
132
  ## [0.0.3-next.2](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.1...node-core-v0.0.3-next.2) (2025-11-14)
4
133
 
5
134
 
@@ -1,8 +1,8 @@
1
1
  # Function: buildConfiguration()
2
2
 
3
- > **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `contextIdKeys`: `string`[]; \}\>
3
+ > **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
4
4
 
5
- Build the configuration for the TWIN Node server.
5
+ Build the configuration for the TWIN Node.
6
6
 
7
7
  ## Parameters
8
8
 
@@ -24,7 +24,7 @@ The server information.
24
24
 
25
25
  ## Returns
26
26
 
27
- `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `contextIdKeys`: `string`[]; \}\>
27
+ `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
28
28
 
29
29
  A promise that resolves to the engine server configuration, environment prefix, environment variables,
30
30
  and options.
@@ -14,7 +14,7 @@ The environment variables.
14
14
 
15
15
  ### contextIdKeys
16
16
 
17
- `string`[]
17
+ `object`[]
18
18
 
19
19
  The context ID keys.
20
20
 
@@ -1,6 +1,6 @@
1
1
  # Function: buildEngineServerConfiguration()
2
2
 
3
- > **buildEngineServerConfiguration**(`envVars`, `contextIdKeys`, `coreEngineConfig`, `serverInfo`, `openApiSpecPath?`, `favIconPath?`): `Promise`\<`IEngineServerConfig`\>
3
+ > **buildEngineServerConfiguration**(`envVars`, `availableContextIdKeys`, `coreEngineConfig`, `serverInfo`, `openApiSpecPath?`, `favIconPath?`): `Promise`\<`IEngineServerConfig`\>
4
4
 
5
5
  Handles the configuration of the server.
6
6
 
@@ -12,9 +12,9 @@ Handles the configuration of the server.
12
12
 
13
13
  The environment variables for the engine server.
14
14
 
15
- ### contextIdKeys
15
+ ### availableContextIdKeys
16
16
 
17
- `string`[]
17
+ `object`[]
18
18
 
19
19
  The context ID keys.
20
20
 
@@ -0,0 +1,27 @@
1
+ # Function: constructCliCommand()
2
+
3
+ > **constructCliCommand**(`processEnv`, `cliArgs`): [`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
4
+
5
+ Construct the CLI command from the parsed arguments.
6
+
7
+ ## Parameters
8
+
9
+ ### processEnv
10
+
11
+ The environment variables from the process.
12
+
13
+ ### cliArgs
14
+
15
+ [`ICliArgs`](../interfaces/ICliArgs.md)
16
+
17
+ The parsed CLI arguments.
18
+
19
+ ## Returns
20
+
21
+ [`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
22
+
23
+ The constructed CLI command.
24
+
25
+ ## Throws
26
+
27
+ GeneralError if the command is missing.
@@ -0,0 +1,29 @@
1
+ # Function: executeCommand()
2
+
3
+ > **executeCommand**(`engineCore`, `envVars`, `cliCommand`): `Promise`\<`void`\>
4
+
5
+ Execute the CLI command.
6
+
7
+ ## Parameters
8
+
9
+ ### engineCore
10
+
11
+ `IEngineCore`
12
+
13
+ The engine core.
14
+
15
+ ### envVars
16
+
17
+ [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
18
+
19
+ The environment variables for the node.
20
+
21
+ ### cliCommand
22
+
23
+ [`ICliCommand`](../interfaces/ICliCommand.md)
24
+
25
+ The CLI command to execute.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`void`\>
@@ -0,0 +1,19 @@
1
+ # Function: getEnvDefaults()
2
+
3
+ > **getEnvDefaults**(`envPrefix`): `object`
4
+
5
+ Get the default environment variables for the node.
6
+
7
+ ## Parameters
8
+
9
+ ### envPrefix
10
+
11
+ `string`
12
+
13
+ The environment variable prefix.
14
+
15
+ ## Returns
16
+
17
+ `object`
18
+
19
+ The default environment variables.
@@ -0,0 +1,19 @@
1
+ # Function: getScriptDirectory()
2
+
3
+ > **getScriptDirectory**(`args?`): `string`
4
+
5
+ Get the directory where the script is located.
6
+
7
+ ## Parameters
8
+
9
+ ### args?
10
+
11
+ `string`[]
12
+
13
+ The command line arguments.
14
+
15
+ ## Returns
16
+
17
+ `string`
18
+
19
+ The execution directory.
@@ -0,0 +1,19 @@
1
+ # Function: parseCommandLineArgs()
2
+
3
+ > **parseCommandLineArgs**(`args?`): [`ICliArgs`](../interfaces/ICliArgs.md)
4
+
5
+ Parse command line arguments.
6
+
7
+ ## Parameters
8
+
9
+ ### args?
10
+
11
+ `string`[]
12
+
13
+ The command line arguments.
14
+
15
+ ## Returns
16
+
17
+ [`ICliArgs`](../interfaces/ICliArgs.md)
18
+
19
+ The parsed command line arguments.
@@ -0,0 +1,27 @@
1
+ # Function: processEnvOptions()
2
+
3
+ > **processEnvOptions**(`processEnv`, `options`): `void`
4
+
5
+ Load the env files and process the options.
6
+
7
+ ## Parameters
8
+
9
+ ### processEnv
10
+
11
+ The environment variables from the process.
12
+
13
+ ### options
14
+
15
+ `object`[]
16
+
17
+ The options.
18
+
19
+ ## Returns
20
+
21
+ `void`
22
+
23
+ The processed parameters.
24
+
25
+ ## Throws
26
+
27
+ GeneralError if an env file has errors.
@@ -0,0 +1,9 @@
1
+ # Function: registerCommands()
2
+
3
+ > **registerCommands**(): `void`
4
+
5
+ Register available CLI commands.
6
+
7
+ ## Returns
8
+
9
+ `void`
@@ -1,8 +1,8 @@
1
1
  # Function: run()
2
2
 
3
- > **run**(`nodeOptions?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
3
+ > **run**(`nodeOptions?`, `args?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
4
4
 
5
- Run the TWIN Node server.
5
+ Run the TWIN Node.
6
6
 
7
7
  ## Parameters
8
8
 
@@ -12,6 +12,12 @@ Run the TWIN Node server.
12
12
 
13
13
  Optional configuration options for running the server.
14
14
 
15
+ ### args?
16
+
17
+ `string`[]
18
+
19
+ Optional command line arguments.
20
+
15
21
  ## Returns
16
22
 
17
23
  `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
@@ -1,6 +1,6 @@
1
1
  # Function: start()
2
2
 
3
- > **start**(`nodeOptions`, `nodeEngineConfig`, `envVars`, `contextIdKeys?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
3
+ > **start**(`nodeOptions`, `nodeEngineConfig`, `envVars`, `cliCommand?`, `availableContextIdKeys?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
4
4
 
5
5
  Start the engine server.
6
6
 
@@ -24,11 +24,17 @@ The configuration for the engine server.
24
24
 
25
25
  The environment variables.
26
26
 
27
- ### contextIdKeys?
27
+ ### cliCommand?
28
28
 
29
- `string`[]
29
+ [`ICliCommand`](../interfaces/ICliCommand.md)
30
30
 
31
- The context ID keys.
31
+ The constructed CLI command (optional).
32
+
33
+ ### availableContextIdKeys?
34
+
35
+ `object`[]
36
+
37
+ The context ID keys available for operation.
32
38
 
33
39
  ## Returns
34
40
 
@@ -0,0 +1,25 @@
1
+ # Function: substituteEnvOptions()
2
+
3
+ > **substituteEnvOptions**(`processEnv`, `options`): `void`
4
+
5
+ Process options and replace any env variables with their values.
6
+
7
+ ## Parameters
8
+
9
+ ### processEnv
10
+
11
+ The environment variables from the process.
12
+
13
+ ### options
14
+
15
+ `object`[]
16
+
17
+ The options.
18
+
19
+ ## Returns
20
+
21
+ `void`
22
+
23
+ ## Throws
24
+
25
+ GeneralError if an env variable is missing.
@@ -3,6 +3,10 @@
3
3
  ## Interfaces
4
4
 
5
5
  - [ICacheMetadata](interfaces/ICacheMetadata.md)
6
+ - [ICliArgs](interfaces/ICliArgs.md)
7
+ - [ICliCommand](interfaces/ICliCommand.md)
8
+ - [ICliCommandDefinition](interfaces/ICliCommandDefinition.md)
9
+ - [ICliCommandDefinitionParam](interfaces/ICliCommandDefinitionParam.md)
6
10
  - [IEngineEnvironmentVariables](interfaces/IEngineEnvironmentVariables.md)
7
11
  - [IEngineServerEnvironmentVariables](interfaces/IEngineServerEnvironmentVariables.md)
8
12
  - [IModuleProtocol](interfaces/IModuleProtocol.md)
@@ -14,12 +18,12 @@
14
18
 
15
19
  ## Type Aliases
16
20
 
21
+ - [CliCommandParamType](type-aliases/CliCommandParamType.md)
17
22
  - [ModuleProtocol](type-aliases/ModuleProtocol.md)
18
23
  - [NodeExtensionInitialiseMethod](type-aliases/NodeExtensionInitialiseMethod.md)
19
24
  - [NodeExtensionInitialiseEngineMethod](type-aliases/NodeExtensionInitialiseEngineMethod.md)
20
25
  - [NodeExtensionInitialiseEngineServerMethod](type-aliases/NodeExtensionInitialiseEngineServerMethod.md)
21
26
  - [NodeExtensionShutdownMethod](type-aliases/NodeExtensionShutdownMethod.md)
22
- - [NodeFeatures](type-aliases/NodeFeatures.md)
23
27
 
24
28
  ## Variables
25
29
 
@@ -27,41 +31,40 @@
27
31
  - [IMMUTABLE\_PROOF\_VERIFICATION\_METHOD\_ID](variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md)
28
32
  - [BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID](variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md)
29
33
  - [SYNCHRONISED\_STORAGE\_BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID](variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md)
30
- - [VC\_AUTHENTICATION\_VERIFICATION\_METHOD\_ID](variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md)
34
+ - [TRUST\_VERIFICATION\_METHOD\_ID](variables/TRUST_VERIFICATION_METHOD_ID.md)
31
35
  - [AUTH\_SIGNING\_KEY\_ID](variables/AUTH_SIGNING_KEY_ID.md)
36
+ - [CONTEXT\_ID\_HANDLER\_FEATURE\_DID](variables/CONTEXT_ID_HANDLER_FEATURE_DID.md)
37
+ - [CONTEXT\_ID\_HANDLER\_FEATURE\_TENANT](variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md)
32
38
  - [ModuleProtocol](variables/ModuleProtocol.md)
33
- - [NodeFeatures](variables/NodeFeatures.md)
34
39
 
35
40
  ## Functions
36
41
 
37
- - [bootstrap](functions/bootstrap.md)
38
- - [bootstrapContextIdHandlers](functions/bootstrapContextIdHandlers.md)
39
- - [bootstrapNodeId](functions/bootstrapNodeId.md)
40
- - [bootstrapTenantId](functions/bootstrapTenantId.md)
41
- - [bootstrapNodeAdminUser](functions/bootstrapNodeAdminUser.md)
42
- - [bootstrapImmutableProofMethod](functions/bootstrapImmutableProofMethod.md)
43
- - [bootstrapBlobEncryption](functions/bootstrapBlobEncryption.md)
44
- - [bootstrapAuth](functions/bootstrapAuth.md)
45
- - [bootstrapSynchronisedStorage](functions/bootstrapSynchronisedStorage.md)
46
42
  - [buildEngineConfiguration](functions/buildEngineConfiguration.md)
47
43
  - [buildEngineServerConfiguration](functions/buildEngineServerConfiguration.md)
48
44
  - [extensionsConfiguration](functions/extensionsConfiguration.md)
49
45
  - [extensionsInitialiseEngine](functions/extensionsInitialiseEngine.md)
50
46
  - [extensionsInitialiseEngineServer](functions/extensionsInitialiseEngineServer.md)
51
47
  - [shutdownExtensions](functions/shutdownExtensions.md)
48
+ - [parseCommandLineArgs](functions/parseCommandLineArgs.md)
49
+ - [constructCliCommand](functions/constructCliCommand.md)
50
+ - [executeCommand](functions/executeCommand.md)
51
+ - [processEnvOptions](functions/processEnvOptions.md)
52
+ - [substituteEnvOptions](functions/substituteEnvOptions.md)
53
+ - [registerCommands](functions/registerCommands.md)
54
+ - [getEnvDefaults](functions/getEnvDefaults.md)
52
55
  - [run](functions/run.md)
53
56
  - [buildConfiguration](functions/buildConfiguration.md)
54
57
  - [overrideModuleImport](functions/overrideModuleImport.md)
55
58
  - [start](functions/start.md)
56
59
  - [initialiseLocales](functions/initialiseLocales.md)
57
60
  - [getExecutionDirectory](functions/getExecutionDirectory.md)
61
+ - [getScriptDirectory](functions/getScriptDirectory.md)
58
62
  - [fileExists](functions/fileExists.md)
59
63
  - [directoryExists](functions/directoryExists.md)
60
64
  - [getSubFolders](functions/getSubFolders.md)
61
65
  - [getFiles](functions/getFiles.md)
62
66
  - [loadTextFile](functions/loadTextFile.md)
63
67
  - [loadJsonFile](functions/loadJsonFile.md)
64
- - [getFeatures](functions/getFeatures.md)
65
68
  - [parseModuleProtocol](functions/parseModuleProtocol.md)
66
69
  - [hashUrl](functions/hashUrl.md)
67
70
  - [getExtensionsCacheDir](functions/getExtensionsCacheDir.md)
@@ -0,0 +1,35 @@
1
+ # Interface: ICliArgs
2
+
3
+ Command to execute in the CLI.
4
+
5
+ ## Properties
6
+
7
+ ### nodePath?
8
+
9
+ > `optional` **nodePath**: `string`
10
+
11
+ The path of the node executable.
12
+
13
+ ***
14
+
15
+ ### scriptPath?
16
+
17
+ > `optional` **scriptPath**: `string`
18
+
19
+ The path of the script to execute.
20
+
21
+ ***
22
+
23
+ ### options?
24
+
25
+ > `optional` **options**: `object`[]
26
+
27
+ The command line options.
28
+
29
+ #### key
30
+
31
+ > **key**: `string`
32
+
33
+ #### value
34
+
35
+ > **value**: `string`