@twin.org/node-core 0.0.1-next.10
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/LICENSE +201 -0
- package/README.md +21 -0
- package/dist/cjs/index.cjs +1718 -0
- package/dist/esm/index.mjs +1681 -0
- package/dist/types/bootstrap.d.ts +59 -0
- package/dist/types/builders/engineEnvBuilder.d.ts +8 -0
- package/dist/types/builders/engineServerEnvBuilder.d.ts +13 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +389 -0
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +45 -0
- package/dist/types/models/INodeEnvironmentVariables.d.ts +29 -0
- package/dist/types/models/INodeOptions.d.ts +69 -0
- package/dist/types/models/nodeFeatures.d.ts +17 -0
- package/dist/types/node.d.ts +26 -0
- package/dist/types/server.d.ts +17 -0
- package/dist/types/utils.d.ts +30 -0
- package/docs/changelog.md +76 -0
- package/docs/examples.md +1 -0
- package/docs/reference/functions/bootstrap.md +29 -0
- package/docs/reference/functions/bootstrapAttestationMethod.md +35 -0
- package/docs/reference/functions/bootstrapAuth.md +35 -0
- package/docs/reference/functions/bootstrapBlobEncryption.md +35 -0
- package/docs/reference/functions/bootstrapImmutableProofMethod.md +35 -0
- package/docs/reference/functions/bootstrapNodeIdentity.md +35 -0
- package/docs/reference/functions/bootstrapNodeUser.md +35 -0
- package/docs/reference/functions/buildConfiguration.md +30 -0
- package/docs/reference/functions/buildEngineConfiguration.md +19 -0
- package/docs/reference/functions/fileExists.md +19 -0
- package/docs/reference/functions/getExecutionDirectory.md +11 -0
- package/docs/reference/functions/getFeatures.md +19 -0
- package/docs/reference/functions/initialiseLocales.md +17 -0
- package/docs/reference/functions/loadJsonFile.md +25 -0
- package/docs/reference/functions/run.md +19 -0
- package/docs/reference/functions/start.md +31 -0
- package/docs/reference/index.md +35 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +775 -0
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +87 -0
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +1331 -0
- package/docs/reference/interfaces/INodeOptions.md +165 -0
- package/docs/reference/type-aliases/NodeFeatures.md +5 -0
- package/docs/reference/variables/NodeFeatures.md +19 -0
- package/locales/en.json +34 -0
- package/package.json +52 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables";
|
|
2
|
+
import { NodeFeatures } from "./models/nodeFeatures";
|
|
3
|
+
/**
|
|
4
|
+
* Initialise the locales for the application.
|
|
5
|
+
* @param localesDirectory The directory containing the locales.
|
|
6
|
+
*/
|
|
7
|
+
export declare function initialiseLocales(localesDirectory: string): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Get the directory where the application is being executed.
|
|
10
|
+
* @returns The execution directory.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getExecutionDirectory(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Does the specified file exist.
|
|
15
|
+
* @param filename The filename to check for existence.
|
|
16
|
+
* @returns True if the file exists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function fileExists(filename: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Load the JSON file.
|
|
21
|
+
* @param filename The filename of the JSON file to load.
|
|
22
|
+
* @returns The contents of the JSON file or null if it could not be loaded.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadJsonFile<T>(filename: string): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Get the features that are enabled on the node.
|
|
27
|
+
* @param env The environment variables for the node.
|
|
28
|
+
* @returns The features that are enabled on the node.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getFeatures(env: INodeEnvironmentVariables): NodeFeatures[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @twin.org/node-core - Changelog
|
|
2
|
+
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* migrate env config from engine to node ([5da29b8](https://github.com/twinfoundation/node/commit/5da29b8d714495308320d237a68e84355bba2b47))
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* additional startup logging ([0740293](https://github.com/twinfoundation/node/commit/0740293b366032f2907046603abf587c9c324aff))
|
|
16
|
+
|
|
17
|
+
## [0.0.1-next.8](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.7...node-core-v0.0.1-next.8) (2025-06-18)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* improve default options and spec ([b538721](https://github.com/twinfoundation/node/commit/b538721902e7f65021d2715148ba59409ccce035))
|
|
23
|
+
|
|
24
|
+
## [0.0.1-next.7](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.6...node-core-v0.0.1-next.7) (2025-06-17)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* adding a condition to verify if the password exists when bootstrapping ([6030a42](https://github.com/twinfoundation/node/commit/6030a42bdaf581678d96932fd0b809396bf7b8b0))
|
|
30
|
+
* adding a condition to verify if the password exists when bootstrapping ([c66f396](https://github.com/twinfoundation/node/commit/c66f396717394161a7647d1f08b3d87729d96e96))
|
|
31
|
+
* pr comments [#1](https://github.com/twinfoundation/node/issues/1) ([66e795b](https://github.com/twinfoundation/node/commit/66e795b16c372ab131ec1de30085aee90e4dbbd0))
|
|
32
|
+
|
|
33
|
+
## [0.0.1-next.6](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.5...node-core-v0.0.1-next.6) (2025-06-12)
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
- add extend engine and server methods ([ec09c7e](https://github.com/twinfoundation/node/commit/ec09c7eb882d9f5797f2fd372e96cad1a3716f59))
|
|
38
|
+
- add extend engine and server methods ([0136a6f](https://github.com/twinfoundation/node/commit/0136a6f3f4e1a82b1427ee9618b8a17c79bc7fda))
|
|
39
|
+
- additional run options ([c35e5bb](https://github.com/twinfoundation/node/commit/c35e5bbb8a80fe6a36628d41f64585b3723d9ad7))
|
|
40
|
+
- improve error reporting ([fcd39a1](https://github.com/twinfoundation/node/commit/fcd39a18da2a6ce33965a99ca5f2f36f4aba712f))
|
|
41
|
+
- initial commit ([522f1e5](https://github.com/twinfoundation/node/commit/522f1e515348f9b1dd1eeb3170b1249e2b0b5371))
|
|
42
|
+
- node app use JavaScript ([14fe08c](https://github.com/twinfoundation/node/commit/14fe08cb760dd885a5dac9056a4d5dbc3d61df64))
|
|
43
|
+
- update dependencies ([9d25f16](https://github.com/twinfoundation/node/commit/9d25f16f1d554cd38f3bec28fdf7f8fff892ceaf))
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
- broken docs ([61479fd](https://github.com/twinfoundation/node/commit/61479fd618f766d22c5aafec5277e1a89e22b453))
|
|
48
|
+
|
|
49
|
+
## [0.0.1-next.5](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.4...node-core-v0.0.1-next.5) (2025-06-12)
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
- add extend engine and server methods ([0136a6f](https://github.com/twinfoundation/node/commit/0136a6f3f4e1a82b1427ee9618b8a17c79bc7fda))
|
|
54
|
+
|
|
55
|
+
## [0.0.1-next.4](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.3...node-core-v0.0.1-next.4) (2025-05-27)
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
- improve error reporting ([fcd39a1](https://github.com/twinfoundation/node/commit/fcd39a18da2a6ce33965a99ca5f2f36f4aba712f))
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- broken docs ([61479fd](https://github.com/twinfoundation/node/commit/61479fd618f766d22c5aafec5277e1a89e22b453))
|
|
64
|
+
|
|
65
|
+
## [0.0.1-next.3](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.2...node-core-v0.0.1-next.3) (2025-05-27)
|
|
66
|
+
|
|
67
|
+
### Features
|
|
68
|
+
|
|
69
|
+
- additional run options ([c35e5bb](https://github.com/twinfoundation/node/commit/c35e5bbb8a80fe6a36628d41f64585b3723d9ad7))
|
|
70
|
+
- node app use JavaScript ([14fe08c](https://github.com/twinfoundation/node/commit/14fe08cb760dd885a5dac9056a4d5dbc3d61df64))
|
|
71
|
+
|
|
72
|
+
## [0.0.1-next.2](https://github.com/twinfoundation/node/compare/node-core-v0.0.1-next.1...node-core-v0.0.1-next.2) (2025-05-27)
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
- initial commit ([522f1e5](https://github.com/twinfoundation/node/commit/522f1e515348f9b1dd1eeb3170b1249e2b0b5371))
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @twin.org/node-core - Examples
|
|
@@ -0,0 +1,29 @@
|
|
|
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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Function: bootstrapAttestationMethod()
|
|
2
|
+
|
|
3
|
+
> **bootstrapAttestationMethod**(`engineCore`, `context`, `envVars`, `features`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Bootstrap the attestation 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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Function: bootstrapNodeIdentity()
|
|
2
|
+
|
|
3
|
+
> **bootstrapNodeIdentity**(`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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Function: bootstrapNodeUser()
|
|
2
|
+
|
|
3
|
+
> **bootstrapNodeUser**(`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`, `IEngineState`\>
|
|
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`\>
|
|
@@ -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,19 @@
|
|
|
1
|
+
# Function: fileExists()
|
|
2
|
+
|
|
3
|
+
> **fileExists**(`filename`): `Promise`\<`boolean`\>
|
|
4
|
+
|
|
5
|
+
Does the specified file exist.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### filename
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The filename to check for existence.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`boolean`\>
|
|
18
|
+
|
|
19
|
+
True if the file exists.
|
|
@@ -0,0 +1,19 @@
|
|
|
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.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Function: initialiseLocales()
|
|
2
|
+
|
|
3
|
+
> **initialiseLocales**(`localesDirectory`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Initialise the locales for the application.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### localesDirectory
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The directory containing the locales.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`void`\>
|
|
@@ -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.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: run()
|
|
2
|
+
|
|
3
|
+
> **run**(`nodeOptions?`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Run the TWIN Node server.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### nodeOptions?
|
|
10
|
+
|
|
11
|
+
[`INodeOptions`](../interfaces/INodeOptions.md)
|
|
12
|
+
|
|
13
|
+
Optional configuration options for running the server.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`void`\>
|
|
18
|
+
|
|
19
|
+
A promise that resolves when the server is started.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: start()
|
|
2
|
+
|
|
3
|
+
> **start**(`nodeOptions`, `engineServerConfig`, `envVars`): `Promise`\<`undefined` \| \{ `engine`: `Engine`\<`IEngineServerConfig`, `IEngineState`\>; `server`: `EngineServer`; \}\>
|
|
4
|
+
|
|
5
|
+
Start the engine server.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### nodeOptions
|
|
10
|
+
|
|
11
|
+
Optional run options for the engine server.
|
|
12
|
+
|
|
13
|
+
`undefined` | [`INodeOptions`](../interfaces/INodeOptions.md)
|
|
14
|
+
|
|
15
|
+
### engineServerConfig
|
|
16
|
+
|
|
17
|
+
`IEngineServerConfig`
|
|
18
|
+
|
|
19
|
+
The configuration for the engine server.
|
|
20
|
+
|
|
21
|
+
### envVars
|
|
22
|
+
|
|
23
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
24
|
+
|
|
25
|
+
The environment variables.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`undefined` \| \{ `engine`: `Engine`\<`IEngineServerConfig`, `IEngineState`\>; `server`: `EngineServer`; \}\>
|
|
30
|
+
|
|
31
|
+
The engine server.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @twin.org/node-core
|
|
2
|
+
|
|
3
|
+
## Interfaces
|
|
4
|
+
|
|
5
|
+
- [IEngineEnvironmentVariables](interfaces/IEngineEnvironmentVariables.md)
|
|
6
|
+
- [IEngineServerEnvironmentVariables](interfaces/IEngineServerEnvironmentVariables.md)
|
|
7
|
+
- [INodeEnvironmentVariables](interfaces/INodeEnvironmentVariables.md)
|
|
8
|
+
- [INodeOptions](interfaces/INodeOptions.md)
|
|
9
|
+
|
|
10
|
+
## Type Aliases
|
|
11
|
+
|
|
12
|
+
- [NodeFeatures](type-aliases/NodeFeatures.md)
|
|
13
|
+
|
|
14
|
+
## Variables
|
|
15
|
+
|
|
16
|
+
- [NodeFeatures](variables/NodeFeatures.md)
|
|
17
|
+
|
|
18
|
+
## Functions
|
|
19
|
+
|
|
20
|
+
- [bootstrap](functions/bootstrap.md)
|
|
21
|
+
- [bootstrapNodeIdentity](functions/bootstrapNodeIdentity.md)
|
|
22
|
+
- [bootstrapNodeUser](functions/bootstrapNodeUser.md)
|
|
23
|
+
- [bootstrapAttestationMethod](functions/bootstrapAttestationMethod.md)
|
|
24
|
+
- [bootstrapImmutableProofMethod](functions/bootstrapImmutableProofMethod.md)
|
|
25
|
+
- [bootstrapBlobEncryption](functions/bootstrapBlobEncryption.md)
|
|
26
|
+
- [bootstrapAuth](functions/bootstrapAuth.md)
|
|
27
|
+
- [buildEngineConfiguration](functions/buildEngineConfiguration.md)
|
|
28
|
+
- [run](functions/run.md)
|
|
29
|
+
- [buildConfiguration](functions/buildConfiguration.md)
|
|
30
|
+
- [start](functions/start.md)
|
|
31
|
+
- [initialiseLocales](functions/initialiseLocales.md)
|
|
32
|
+
- [getExecutionDirectory](functions/getExecutionDirectory.md)
|
|
33
|
+
- [fileExists](functions/fileExists.md)
|
|
34
|
+
- [loadJsonFile](functions/loadJsonFile.md)
|
|
35
|
+
- [getFeatures](functions/getFeatures.md)
|