@twin.org/node-core 0.0.1-next.9 → 0.0.2-next.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.
Files changed (38) hide show
  1. package/dist/cjs/index.cjs +1141 -53
  2. package/dist/esm/index.mjs +1141 -57
  3. package/dist/types/bootstrap.d.ts +9 -10
  4. package/dist/types/builders/engineEnvBuilder.d.ts +8 -0
  5. package/dist/types/builders/engineServerEnvBuilder.d.ts +13 -0
  6. package/dist/types/index.d.ts +6 -3
  7. package/dist/types/models/IEngineEnvironmentVariables.d.ts +389 -0
  8. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +49 -0
  9. package/dist/types/models/{INodeVariables.d.ts → INodeEnvironmentVariables.d.ts} +3 -3
  10. package/dist/types/models/{IRunOptions.d.ts → INodeOptions.d.ts} +17 -1
  11. package/dist/types/node.d.ts +22 -3
  12. package/dist/types/server.d.ts +7 -14
  13. package/dist/types/utils.d.ts +8 -2
  14. package/docs/changelog.md +68 -0
  15. package/docs/reference/functions/bootstrap.md +2 -2
  16. package/docs/reference/functions/bootstrapAttestationMethod.md +2 -2
  17. package/docs/reference/functions/bootstrapAuth.md +2 -2
  18. package/docs/reference/functions/bootstrapBlobEncryption.md +2 -2
  19. package/docs/reference/functions/bootstrapImmutableProofMethod.md +2 -2
  20. package/docs/reference/functions/bootstrapNodeIdentity.md +2 -2
  21. package/docs/reference/functions/bootstrapNodeUser.md +2 -2
  22. package/docs/reference/functions/buildConfiguration.md +30 -0
  23. package/docs/reference/functions/buildEngineConfiguration.md +19 -0
  24. package/docs/reference/functions/buildEngineServerConfiguration.md +37 -0
  25. package/docs/reference/functions/getFeatures.md +1 -1
  26. package/docs/reference/functions/loadJsonFile.md +25 -0
  27. package/docs/reference/functions/run.md +3 -3
  28. package/docs/reference/functions/start.md +9 -39
  29. package/docs/reference/index.md +8 -3
  30. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +775 -0
  31. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +95 -0
  32. package/docs/reference/interfaces/INodeEnvironmentVariables.md +1343 -0
  33. package/docs/reference/interfaces/{IRunOptions.md → INodeOptions.md} +38 -1
  34. package/locales/en.json +0 -1
  35. package/package.json +1 -1
  36. package/dist/types/models/INodeState.d.ts +0 -10
  37. package/docs/reference/interfaces/INodeState.md +0 -15
  38. package/docs/reference/interfaces/INodeVariables.md +0 -59
@@ -1,4 +1,4 @@
1
- # Interface: IRunOptions
1
+ # Interface: INodeOptions
2
2
 
3
3
  The options when running the node.
4
4
 
@@ -42,6 +42,25 @@ The prefix for environment variables, defaults to "TWIN_NODE_".
42
42
 
43
43
  ***
44
44
 
45
+ ### configFilenames?
46
+
47
+ > `optional` **configFilenames**: `string`[]
48
+
49
+ A list of JSON files to load as configuration files.
50
+ The files will be loaded in the order they are provided, and the last one will
51
+ override any previous values.
52
+
53
+ ***
54
+
55
+ ### config?
56
+
57
+ > `optional` **config**: `IEngineConfig`
58
+
59
+ Provides the ability to have some initial custom configuration for the engine.
60
+ This will be merged with any configuration loaded from the environment variables.
61
+
62
+ ***
63
+
45
64
  ### executionDirectory?
46
65
 
47
66
  > `optional` **executionDirectory**: `string`
@@ -66,6 +85,24 @@ The path to the OpenAPI spec file, defaults to docs/open-api/spec.json.
66
85
 
67
86
  ***
68
87
 
88
+ ### extendEnvVars()?
89
+
90
+ > `optional` **extendEnvVars**: (`envVars`) => `Promise`\<`void`\>
91
+
92
+ Method to extend the engine environment variables with any additional custom configuration.
93
+
94
+ #### Parameters
95
+
96
+ ##### envVars
97
+
98
+ [`INodeEnvironmentVariables`](INodeEnvironmentVariables.md)
99
+
100
+ #### Returns
101
+
102
+ `Promise`\<`void`\>
103
+
104
+ ***
105
+
69
106
  ### extendConfig()?
70
107
 
71
108
  > `optional` **extendConfig**: (`config`) => `Promise`\<`void`\>
package/locales/en.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "error": {
3
3
  "node": {
4
- "noEnvVars": "There are no environment variables starting \"{prefix}\" the server will not start without them, please set them in the shell or create a .env file",
5
4
  "storageFileRootNotSet": "{storageFileRoot} is not set, the server will not start without it, please set it in the shell or create a .env file"
6
5
  }
7
6
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node-core",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "TWIN Node Core for serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,10 +0,0 @@
1
- import type { IEngineState } from "@twin.org/engine-models";
2
- /**
3
- * The state for the node.
4
- */
5
- export interface INodeState extends IEngineState {
6
- /**
7
- * List of addresses for the node.
8
- */
9
- addresses?: string[];
10
- }
@@ -1,15 +0,0 @@
1
- # Interface: INodeState
2
-
3
- The state for the node.
4
-
5
- ## Extends
6
-
7
- - `IEngineState`
8
-
9
- ## Properties
10
-
11
- ### addresses?
12
-
13
- > `optional` **addresses**: `string`[]
14
-
15
- List of addresses for the node.
@@ -1,59 +0,0 @@
1
- # Interface: INodeVariables
2
-
3
- The environment variables for the node.
4
-
5
- ## Extends
6
-
7
- - `IEngineEnvironmentVariables`.`IEngineServerEnvironmentVariables`
8
-
9
- ## Properties
10
-
11
- ### features?
12
-
13
- > `optional` **features**: `string`
14
-
15
- The features that are enabled on the node.
16
-
17
- #### Default
18
-
19
- ```ts
20
- [NodeFeatures.NodeIdentity]
21
- ```
22
-
23
- ***
24
-
25
- ### identity?
26
-
27
- > `optional` **identity**: `string`
28
-
29
- The identity of the node which, if empty and node-identity feature is enabled it will be generated.
30
-
31
- ***
32
-
33
- ### mnemonic?
34
-
35
- > `optional` **mnemonic**: `string`
36
-
37
- The mnemonic for the identity, if empty and node-identity feature is enabled it will be randomly generated.
38
-
39
- ***
40
-
41
- ### username?
42
-
43
- > `optional` **username**: `string`
44
-
45
- If the node-user feature is enabled, this will be the name of the user.
46
-
47
- #### Default
48
-
49
- ```ts
50
- admin@node
51
- ```
52
-
53
- ***
54
-
55
- ### password?
56
-
57
- > `optional` **password**: `string`
58
-
59
- If the node-user feature is enabled, this will be the password of the user, if empty it will be randomly generated.