@twin.org/node-core 0.0.1-next.9 → 0.0.1
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/cjs/index.cjs +1140 -53
- package/dist/esm/index.mjs +1141 -57
- package/dist/types/bootstrap.d.ts +9 -10
- package/dist/types/builders/engineEnvBuilder.d.ts +8 -0
- package/dist/types/builders/engineServerEnvBuilder.d.ts +13 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +389 -0
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +49 -0
- package/dist/types/models/{INodeVariables.d.ts → INodeEnvironmentVariables.d.ts} +3 -3
- package/dist/types/models/{IRunOptions.d.ts → INodeOptions.d.ts} +17 -1
- package/dist/types/node.d.ts +22 -3
- package/dist/types/server.d.ts +7 -14
- package/dist/types/utils.d.ts +8 -2
- package/docs/changelog.md +42 -0
- package/docs/reference/functions/bootstrap.md +2 -2
- package/docs/reference/functions/bootstrapAttestationMethod.md +2 -2
- package/docs/reference/functions/bootstrapAuth.md +2 -2
- package/docs/reference/functions/bootstrapBlobEncryption.md +2 -2
- package/docs/reference/functions/bootstrapImmutableProofMethod.md +2 -2
- package/docs/reference/functions/bootstrapNodeIdentity.md +2 -2
- package/docs/reference/functions/bootstrapNodeUser.md +2 -2
- package/docs/reference/functions/buildConfiguration.md +30 -0
- package/docs/reference/functions/buildEngineConfiguration.md +19 -0
- package/docs/reference/functions/getFeatures.md +1 -1
- package/docs/reference/functions/loadJsonFile.md +25 -0
- package/docs/reference/functions/run.md +3 -3
- package/docs/reference/functions/start.md +9 -39
- package/docs/reference/index.md +7 -3
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +775 -0
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +95 -0
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +1343 -0
- package/docs/reference/interfaces/{IRunOptions.md → INodeOptions.md} +38 -1
- package/locales/en.json +0 -1
- package/package.json +15 -15
- package/dist/types/models/INodeState.d.ts +0 -10
- package/docs/reference/interfaces/INodeState.md +0 -15
- package/docs/reference/interfaces/INodeVariables.md +0 -59
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @twin.org/node-core - Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.1 (2025-07-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add auth admin component ([1661e57](https://github.com/twinfoundation/node/commit/1661e57a699d5cf9ebde333e3cbc3aaea89d7c9c))
|
|
9
|
+
* add extend engine and server methods ([ec09c7e](https://github.com/twinfoundation/node/commit/ec09c7eb882d9f5797f2fd372e96cad1a3716f59))
|
|
10
|
+
* add extend engine and server methods ([0136a6f](https://github.com/twinfoundation/node/commit/0136a6f3f4e1a82b1427ee9618b8a17c79bc7fda))
|
|
11
|
+
* additional run options ([c35e5bb](https://github.com/twinfoundation/node/commit/c35e5bbb8a80fe6a36628d41f64585b3723d9ad7))
|
|
12
|
+
* additional startup logging ([0740293](https://github.com/twinfoundation/node/commit/0740293b366032f2907046603abf587c9c324aff))
|
|
13
|
+
* improve default options and spec ([b538721](https://github.com/twinfoundation/node/commit/b538721902e7f65021d2715148ba59409ccce035))
|
|
14
|
+
* improve error reporting ([fcd39a1](https://github.com/twinfoundation/node/commit/fcd39a18da2a6ce33965a99ca5f2f36f4aba712f))
|
|
15
|
+
* initial commit ([522f1e5](https://github.com/twinfoundation/node/commit/522f1e515348f9b1dd1eeb3170b1249e2b0b5371))
|
|
16
|
+
* migrate env config from engine to node ([5da29b8](https://github.com/twinfoundation/node/commit/5da29b8d714495308320d237a68e84355bba2b47))
|
|
17
|
+
* node app use JavaScript ([14fe08c](https://github.com/twinfoundation/node/commit/14fe08cb760dd885a5dac9056a4d5dbc3d61df64))
|
|
18
|
+
* release to production ([6319a38](https://github.com/twinfoundation/node/commit/6319a38490a2c2809622f8acd170cb92bfa06942))
|
|
19
|
+
* release to production ([4f44403](https://github.com/twinfoundation/node/commit/4f444039832edce8fae562baa7c900ccdc2181da))
|
|
20
|
+
* release to production ([2d96e37](https://github.com/twinfoundation/node/commit/2d96e3737bd9663bc0d1171c2ff2c7f8b2ab01bb))
|
|
21
|
+
* update dependencies ([9d25f16](https://github.com/twinfoundation/node/commit/9d25f16f1d554cd38f3bec28fdf7f8fff892ceaf))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* adding a condition to verify if the password exists when bootstrapping ([6030a42](https://github.com/twinfoundation/node/commit/6030a42bdaf581678d96932fd0b809396bf7b8b0))
|
|
27
|
+
* adding a condition to verify if the password exists when bootstrapping ([c66f396](https://github.com/twinfoundation/node/commit/c66f396717394161a7647d1f08b3d87729d96e96))
|
|
28
|
+
* broken docs ([61479fd](https://github.com/twinfoundation/node/commit/61479fd618f766d22c5aafec5277e1a89e22b453))
|
|
29
|
+
* pr comments [#1](https://github.com/twinfoundation/node/issues/1) ([66e795b](https://github.com/twinfoundation/node/commit/66e795b16c372ab131ec1de30085aee90e4dbbd0))
|
|
30
|
+
|
|
31
|
+
## [0.0.1-next.11](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.10...node-core-v0.0.1-next.11) (2025-07-11)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add auth admin component ([1661e57](https://github.com/twinfoundation/node/commit/1661e57a699d5cf9ebde333e3cbc3aaea89d7c9c))
|
|
37
|
+
|
|
38
|
+
## [0.0.1-next.10](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.9...node-core-v0.0.1-next.10) (2025-07-11)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* migrate env config from engine to node ([5da29b8](https://github.com/twinfoundation/node/commit/5da29b8d714495308320d237a68e84355bba2b47))
|
|
44
|
+
|
|
3
45
|
## [0.0.1-next.9](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.8...node-core-v0.0.1-next.9) (2025-06-20)
|
|
4
46
|
|
|
5
47
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ The engine core for the node.
|
|
|
14
14
|
|
|
15
15
|
### context
|
|
16
16
|
|
|
17
|
-
`IEngineCoreContext`\<`IEngineServerConfig`,
|
|
17
|
+
`IEngineCoreContext`\<`IEngineServerConfig`, `IEngineState`\>
|
|
18
18
|
|
|
19
19
|
The context for the node.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables for the node.
|
|
26
26
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Function: buildConfiguration()
|
|
2
|
+
|
|
3
|
+
> **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `engineServerConfig`: `IEngineServerConfig`; \}\>
|
|
4
|
+
|
|
5
|
+
Build the configuration for the TWIN Node server.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### processEnv
|
|
10
|
+
|
|
11
|
+
The environment variables from the process.
|
|
12
|
+
|
|
13
|
+
### options
|
|
14
|
+
|
|
15
|
+
[`INodeOptions`](../interfaces/INodeOptions.md)
|
|
16
|
+
|
|
17
|
+
The options for running the server.
|
|
18
|
+
|
|
19
|
+
### serverInfo
|
|
20
|
+
|
|
21
|
+
`IServerInfo`
|
|
22
|
+
|
|
23
|
+
The server information.
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
`Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `engineServerConfig`: `IEngineServerConfig`; \}\>
|
|
28
|
+
|
|
29
|
+
A promise that resolves to the engine server configuration, environment prefix, environment variables,
|
|
30
|
+
and options.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: buildEngineConfiguration()
|
|
2
|
+
|
|
3
|
+
> **buildEngineConfiguration**(`envVars`): `IEngineConfig`
|
|
4
|
+
|
|
5
|
+
Build the engine core configuration from environment variables.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envVars
|
|
10
|
+
|
|
11
|
+
[`IEngineEnvironmentVariables`](../interfaces/IEngineEnvironmentVariables.md)
|
|
12
|
+
|
|
13
|
+
The environment variables.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`IEngineConfig`
|
|
18
|
+
|
|
19
|
+
The config for the core.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: loadJsonFile()
|
|
2
|
+
|
|
3
|
+
> **loadJsonFile**\<`T`\>(`filename`): `Promise`\<`T`\>
|
|
4
|
+
|
|
5
|
+
Load the JSON file.
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### T
|
|
10
|
+
|
|
11
|
+
`T`
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
### filename
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The filename of the JSON file to load.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Promise`\<`T`\>
|
|
24
|
+
|
|
25
|
+
The contents of the JSON file or null if it could not be loaded.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Function: run()
|
|
2
2
|
|
|
3
|
-
> **run**(`
|
|
3
|
+
> **run**(`nodeOptions?`): `Promise`\<`void`\>
|
|
4
4
|
|
|
5
5
|
Run the TWIN Node server.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### nodeOptions?
|
|
10
10
|
|
|
11
|
-
[`
|
|
11
|
+
[`INodeOptions`](../interfaces/INodeOptions.md)
|
|
12
12
|
|
|
13
13
|
Optional configuration options for running the server.
|
|
14
14
|
|
|
@@ -1,61 +1,31 @@
|
|
|
1
1
|
# Function: start()
|
|
2
2
|
|
|
3
|
-
> **start**(`
|
|
3
|
+
> **start**(`nodeOptions`, `engineServerConfig`, `envVars`): `Promise`\<`undefined` \| \{ `engine`: `Engine`\<`IEngineServerConfig`, `IEngineState`\>; `server`: `EngineServer`; \}\>
|
|
4
4
|
|
|
5
5
|
Start the engine server.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### nodeOptions
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Optional run options for the engine server.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`undefined` | [`INodeOptions`](../interfaces/INodeOptions.md)
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### engineServerConfig
|
|
16
16
|
|
|
17
|
-
`
|
|
17
|
+
`IEngineServerConfig`
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The configuration for the engine server.
|
|
20
20
|
|
|
21
21
|
### envVars
|
|
22
22
|
|
|
23
|
-
[`
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
24
|
|
|
25
25
|
The environment variables.
|
|
26
26
|
|
|
27
|
-
### openApiSpecFile?
|
|
28
|
-
|
|
29
|
-
`string`
|
|
30
|
-
|
|
31
|
-
Path to the OpenAPI spec file.
|
|
32
|
-
|
|
33
|
-
### stateStorage?
|
|
34
|
-
|
|
35
|
-
`IEngineStateStorage`\<`IEngineState`\>
|
|
36
|
-
|
|
37
|
-
The state storage.
|
|
38
|
-
|
|
39
|
-
### extendConfig?
|
|
40
|
-
|
|
41
|
-
(`config`) => `Promise`\<`void`\>
|
|
42
|
-
|
|
43
|
-
Extends the engine configuration with any additional custom configuration.
|
|
44
|
-
|
|
45
|
-
### extendEngine?
|
|
46
|
-
|
|
47
|
-
(`engine`) => `Promise`\<`void`\>
|
|
48
|
-
|
|
49
|
-
Extends the engine with any additional options.
|
|
50
|
-
|
|
51
|
-
### extendEngineServer?
|
|
52
|
-
|
|
53
|
-
(`engineServer`) => `Promise`\<`void`\>
|
|
54
|
-
|
|
55
|
-
Extends the engine server with any additional options.
|
|
56
|
-
|
|
57
27
|
## Returns
|
|
58
28
|
|
|
59
|
-
`Promise`\<`undefined` \| \{ `engine`: `Engine`\<`IEngineServerConfig`,
|
|
29
|
+
`Promise`\<`undefined` \| \{ `engine`: `Engine`\<`IEngineServerConfig`, `IEngineState`\>; `server`: `EngineServer`; \}\>
|
|
60
30
|
|
|
61
31
|
The engine server.
|
package/docs/reference/index.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Interfaces
|
|
4
4
|
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
5
|
+
- [IEngineEnvironmentVariables](interfaces/IEngineEnvironmentVariables.md)
|
|
6
|
+
- [IEngineServerEnvironmentVariables](interfaces/IEngineServerEnvironmentVariables.md)
|
|
7
|
+
- [INodeEnvironmentVariables](interfaces/INodeEnvironmentVariables.md)
|
|
8
|
+
- [INodeOptions](interfaces/INodeOptions.md)
|
|
8
9
|
|
|
9
10
|
## Type Aliases
|
|
10
11
|
|
|
@@ -23,9 +24,12 @@
|
|
|
23
24
|
- [bootstrapImmutableProofMethod](functions/bootstrapImmutableProofMethod.md)
|
|
24
25
|
- [bootstrapBlobEncryption](functions/bootstrapBlobEncryption.md)
|
|
25
26
|
- [bootstrapAuth](functions/bootstrapAuth.md)
|
|
27
|
+
- [buildEngineConfiguration](functions/buildEngineConfiguration.md)
|
|
26
28
|
- [run](functions/run.md)
|
|
29
|
+
- [buildConfiguration](functions/buildConfiguration.md)
|
|
27
30
|
- [start](functions/start.md)
|
|
28
31
|
- [initialiseLocales](functions/initialiseLocales.md)
|
|
29
32
|
- [getExecutionDirectory](functions/getExecutionDirectory.md)
|
|
30
33
|
- [fileExists](functions/fileExists.md)
|
|
34
|
+
- [loadJsonFile](functions/loadJsonFile.md)
|
|
31
35
|
- [getFeatures](functions/getFeatures.md)
|