@twin.org/node-core 0.0.2-next.9 → 0.0.3-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/README.md +1 -1
- package/dist/es/builders/engineEnvBuilder.js +1132 -0
- package/dist/es/builders/engineEnvBuilder.js.map +1 -0
- package/dist/es/builders/engineServerEnvBuilder.js +206 -0
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -0
- package/dist/es/builders/extensionsBuilder.js +109 -0
- package/dist/es/builders/extensionsBuilder.js.map +1 -0
- package/dist/es/cli.js +255 -0
- package/dist/es/cli.js.map +1 -0
- package/dist/es/commands/bootstrapLegacy.js +175 -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 +310 -0
- package/dist/es/commands/identityCreate.js.map +1 -0
- package/dist/es/commands/identityImports.js +76 -0
- package/dist/es/commands/identityImports.js.map +1 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js +140 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodCreate.js +208 -0
- package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodImport.js +120 -0
- package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
- package/dist/es/commands/nodeSetIdentity.js +51 -0
- package/dist/es/commands/nodeSetIdentity.js.map +1 -0
- package/dist/es/commands/nodeSetTenant.js +49 -0
- package/dist/es/commands/nodeSetTenant.js.map +1 -0
- package/dist/es/commands/tenantCreate.js +120 -0
- package/dist/es/commands/tenantCreate.js.map +1 -0
- package/dist/es/commands/tenantImport.js +78 -0
- package/dist/es/commands/tenantImport.js.map +1 -0
- package/dist/es/commands/userCreate.js +197 -0
- package/dist/es/commands/userCreate.js.map +1 -0
- package/dist/es/commands/vaultKeyCreate.js +185 -0
- package/dist/es/commands/vaultKeyCreate.js.map +1 -0
- package/dist/es/commands/vaultKeyImport.js +98 -0
- package/dist/es/commands/vaultKeyImport.js.map +1 -0
- package/dist/es/defaults.js +28 -0
- package/dist/es/defaults.js.map +1 -0
- package/dist/es/index.js +27 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/ICacheMetadata.js +4 -0
- package/dist/es/models/ICacheMetadata.js.map +1 -0
- 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 +4 -0
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -0
- package/dist/es/models/IEngineServerEnvironmentVariables.js +2 -0
- package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -0
- package/dist/es/models/IModuleProtocol.js +2 -0
- package/dist/es/models/IModuleProtocol.js.map +1 -0
- package/dist/es/models/INodeEngineConfig.js +2 -0
- package/dist/es/models/INodeEngineConfig.js.map +1 -0
- package/dist/es/models/INodeEngineState.js +2 -0
- package/dist/es/models/INodeEngineState.js.map +1 -0
- package/dist/es/models/INodeEnvironmentVariables.js +2 -0
- package/dist/es/models/INodeEnvironmentVariables.js.map +1 -0
- package/dist/es/models/INodeOptions.js +2 -0
- package/dist/es/models/INodeOptions.js.map +1 -0
- package/dist/es/models/IProtocolHandlerResult.js +4 -0
- package/dist/es/models/IProtocolHandlerResult.js.map +1 -0
- package/dist/es/models/cliCommandParamType.js +4 -0
- package/dist/es/models/cliCommandParamType.js.map +1 -0
- package/dist/es/models/moduleProtocol.js +29 -0
- package/dist/es/models/moduleProtocol.js.map +1 -0
- package/dist/es/models/nodeExtensionMethods.js +2 -0
- package/dist/es/models/nodeExtensionMethods.js.map +1 -0
- package/dist/es/node.js +285 -0
- package/dist/es/node.js.map +1 -0
- package/dist/es/start.js +128 -0
- package/dist/es/start.js.map +1 -0
- package/dist/es/utils.js +397 -0
- package/dist/es/utils.js.map +1 -0
- package/dist/types/builders/engineEnvBuilder.d.ts +6 -2
- package/dist/types/builders/engineServerEnvBuilder.d.ts +7 -3
- package/dist/types/builders/extensionsBuilder.d.ts +32 -0
- package/dist/types/cli.d.ts +66 -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 +35 -0
- package/dist/types/commands/tenantImport.d.ts +24 -0
- package/dist/types/commands/userCreate.d.ts +46 -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 +16 -0
- package/dist/types/index.d.ts +24 -11
- package/dist/types/models/ICacheMetadata.d.ts +17 -0
- 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 +154 -37
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +12 -3
- package/dist/types/models/IModuleProtocol.d.ts +18 -0
- package/dist/types/models/INodeEngineConfig.d.ts +6 -0
- package/dist/types/models/INodeEngineState.d.ts +14 -0
- package/dist/types/models/INodeEnvironmentVariables.d.ts +17 -15
- package/dist/types/models/INodeOptions.d.ts +14 -3
- package/dist/types/models/IProtocolHandlerResult.d.ts +13 -0
- package/dist/types/models/cliCommandParamType.d.ts +4 -0
- package/dist/types/models/moduleProtocol.d.ts +29 -0
- package/dist/types/models/nodeExtensionMethods.d.ts +27 -0
- package/dist/types/node.d.ts +21 -7
- package/dist/types/start.d.ts +25 -0
- package/dist/types/utils.d.ts +83 -6
- package/docs/changelog.md +241 -0
- package/docs/detailed-guide.md +129 -0
- package/docs/reference/functions/buildConfiguration.md +2 -2
- package/docs/reference/functions/buildEngineConfiguration.md +8 -2
- package/docs/reference/functions/buildEngineServerConfiguration.md +9 -3
- package/docs/reference/functions/constructCliCommand.md +27 -0
- package/docs/reference/functions/createModuleImportUrl.md +21 -0
- package/docs/reference/functions/directoryExists.md +19 -0
- package/docs/reference/functions/executeCommand.md +29 -0
- package/docs/reference/functions/extensionsConfiguration.md +25 -0
- package/docs/reference/functions/extensionsInitialiseEngine.md +25 -0
- package/docs/reference/functions/extensionsInitialiseEngineServer.md +31 -0
- package/docs/reference/functions/getEnvDefaults.md +19 -0
- package/docs/reference/functions/getExtensionsCacheDir.md +31 -0
- package/docs/reference/functions/getFiles.md +19 -0
- package/docs/reference/functions/getSubFolders.md +19 -0
- package/docs/reference/functions/handleHttpsProtocol.md +49 -0
- package/docs/reference/functions/handleNpmProtocol.md +31 -0
- package/docs/reference/functions/hashUrl.md +19 -0
- package/docs/reference/functions/initCli.md +27 -0
- package/docs/reference/functions/isCacheExpired.md +31 -0
- package/docs/reference/functions/overrideModuleImport.md +8 -2
- package/docs/reference/functions/parseCommandLineArgs.md +19 -0
- package/docs/reference/functions/parseModuleProtocol.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 +32 -0
- package/docs/reference/functions/run.md +9 -3
- package/docs/reference/functions/shutdownExtensions.md +25 -0
- package/docs/reference/functions/start.md +17 -5
- package/docs/reference/functions/substituteEnvOptions.md +25 -0
- package/docs/reference/index.md +47 -10
- package/docs/reference/interfaces/ICacheMetadata.md +27 -0
- 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 +303 -60
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +1737 -5
- package/docs/reference/interfaces/IModuleProtocol.md +27 -0
- package/docs/reference/interfaces/INodeEngineConfig.md +7 -0
- package/docs/reference/interfaces/INodeEngineState.md +23 -0
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +599 -198
- package/docs/reference/interfaces/INodeOptions.md +27 -3
- package/docs/reference/interfaces/IProtocolHandlerResult.md +19 -0
- package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
- package/docs/reference/type-aliases/ModuleProtocol.md +5 -0
- package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +18 -0
- package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +24 -0
- package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +23 -0
- package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +10 -0
- package/docs/reference/variables/ATTESTATION_VERIFICATION_METHOD_ID.md +3 -0
- package/docs/reference/variables/AUTH_SIGNING_KEY_ID.md +3 -0
- package/docs/reference/variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
- package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_DID.md +3 -0
- package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md +3 -0
- package/docs/reference/variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +3 -0
- package/docs/reference/variables/ModuleProtocol.md +37 -0
- package/docs/reference/variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
- package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +3 -0
- package/locales/en.json +479 -28
- package/package.json +29 -9
- package/dist/cjs/index.cjs +0 -1910
- package/dist/esm/index.mjs +0 -1870
- package/dist/types/bootstrap.d.ts +0 -59
- package/dist/types/models/nodeFeatures.d.ts +0 -21
- package/dist/types/server.d.ts +0 -17
- 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/bootstrapNodeIdentity.md +0 -35
- package/docs/reference/functions/bootstrapNodeUser.md +0 -35
- package/docs/reference/functions/bootstrapSynchronisedStorage.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
|
@@ -26,6 +26,18 @@ The version of the server, defaults to the current version.
|
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
29
|
+
### envVars?
|
|
30
|
+
|
|
31
|
+
> `optional` **envVars**: `object`
|
|
32
|
+
|
|
33
|
+
Additional environment variables to set.
|
|
34
|
+
|
|
35
|
+
#### Index Signature
|
|
36
|
+
|
|
37
|
+
\[`key`: `string`\]: `string`
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
29
41
|
### envFilenames?
|
|
30
42
|
|
|
31
43
|
> `optional` **envFilenames**: `string`[]
|
|
@@ -38,7 +50,7 @@ Additional environment variable filenames to load, defaults to .env.
|
|
|
38
50
|
|
|
39
51
|
> `optional` **envPrefix**: `string`
|
|
40
52
|
|
|
41
|
-
The prefix for environment variables, defaults to "
|
|
53
|
+
The prefix for environment variables, defaults to "TWIN_".
|
|
42
54
|
|
|
43
55
|
***
|
|
44
56
|
|
|
@@ -113,15 +125,19 @@ Method to extend the engine environment variables with any additional custom con
|
|
|
113
125
|
|
|
114
126
|
### extendConfig()?
|
|
115
127
|
|
|
116
|
-
> `optional` **extendConfig**: (`config`) => `Promise`\<`void`\>
|
|
128
|
+
> `optional` **extendConfig**: (`envVars`, `config`) => `Promise`\<`void`\>
|
|
117
129
|
|
|
118
130
|
Method to extend the engine configuration with any additional custom configuration.
|
|
119
131
|
|
|
120
132
|
#### Parameters
|
|
121
133
|
|
|
134
|
+
##### envVars
|
|
135
|
+
|
|
136
|
+
[`INodeEnvironmentVariables`](INodeEnvironmentVariables.md)
|
|
137
|
+
|
|
122
138
|
##### config
|
|
123
139
|
|
|
124
|
-
`
|
|
140
|
+
[`INodeEngineConfig`](INodeEngineConfig.md)
|
|
125
141
|
|
|
126
142
|
#### Returns
|
|
127
143
|
|
|
@@ -171,3 +187,11 @@ Method to extend the engine server with any additional options.
|
|
|
171
187
|
|
|
172
188
|
The state storage to use for the engine.
|
|
173
189
|
If not provided, a default file-based state storage will be used.
|
|
190
|
+
|
|
191
|
+
***
|
|
192
|
+
|
|
193
|
+
### disableProcessExitOnFailure?
|
|
194
|
+
|
|
195
|
+
> `optional` **disableProcessExitOnFailure**: `boolean`
|
|
196
|
+
|
|
197
|
+
Disables process.exit calls on fatal errors and throws instead.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IProtocolHandlerResult
|
|
2
|
+
|
|
3
|
+
The result from a protocol handler.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### resolvedPath
|
|
8
|
+
|
|
9
|
+
> **resolvedPath**: `string`
|
|
10
|
+
|
|
11
|
+
The resolved path to the module file.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### cached
|
|
16
|
+
|
|
17
|
+
> **cached**: `boolean`
|
|
18
|
+
|
|
19
|
+
Whether the module was cached.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Type Alias: NodeExtensionInitialiseEngineMethod()
|
|
2
|
+
|
|
3
|
+
> **NodeExtensionInitialiseEngineMethod** = (`engineCore`) => `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
The type for the initialise engine method of an extension module.
|
|
6
|
+
This is called when the engine has been constructed but not yet started.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
### engineCore
|
|
11
|
+
|
|
12
|
+
`IEngineCore`
|
|
13
|
+
|
|
14
|
+
The engine core instance.
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Type Alias: NodeExtensionInitialiseEngineServerMethod()
|
|
2
|
+
|
|
3
|
+
> **NodeExtensionInitialiseEngineServerMethod** = (`engineCore`, `engineServer`) => `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
The type for the initialise engine server method of an extension module.
|
|
6
|
+
This is called when the engine server has been constructed but not yet started.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
### engineCore
|
|
11
|
+
|
|
12
|
+
`IEngineCore`
|
|
13
|
+
|
|
14
|
+
The engine core instance.
|
|
15
|
+
|
|
16
|
+
### engineServer
|
|
17
|
+
|
|
18
|
+
`IEngineServer`
|
|
19
|
+
|
|
20
|
+
The engine server instance.
|
|
21
|
+
|
|
22
|
+
## Returns
|
|
23
|
+
|
|
24
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Type Alias: NodeExtensionInitialiseMethod()
|
|
2
|
+
|
|
3
|
+
> **NodeExtensionInitialiseMethod** = (`envVars`, `nodeEngineConfig`) => `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
The type for the initialise method of an extension module.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envVars
|
|
10
|
+
|
|
11
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
12
|
+
|
|
13
|
+
The environment variables for the node.
|
|
14
|
+
|
|
15
|
+
### nodeEngineConfig
|
|
16
|
+
|
|
17
|
+
[`INodeEngineConfig`](../interfaces/INodeEngineConfig.md)
|
|
18
|
+
|
|
19
|
+
The node engine config.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Type Alias: NodeExtensionShutdownMethod()
|
|
2
|
+
|
|
3
|
+
> **NodeExtensionShutdownMethod** = () => `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
The type for the shutdown method of an extension module.
|
|
6
|
+
This is called when the engine is shutting down.
|
|
7
|
+
|
|
8
|
+
## Returns
|
|
9
|
+
|
|
10
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Variable: ModuleProtocol
|
|
2
|
+
|
|
3
|
+
> `const` **ModuleProtocol**: `object`
|
|
4
|
+
|
|
5
|
+
The protocol types for modules.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### Local
|
|
10
|
+
|
|
11
|
+
> `readonly` **Local**: `"local"` = `"local"`
|
|
12
|
+
|
|
13
|
+
Local module (starts with . or / or file://).
|
|
14
|
+
|
|
15
|
+
### Npm
|
|
16
|
+
|
|
17
|
+
> `readonly` **Npm**: `"npm"` = `"npm"`
|
|
18
|
+
|
|
19
|
+
NPM package (starts with npm:).
|
|
20
|
+
|
|
21
|
+
### Https
|
|
22
|
+
|
|
23
|
+
> `readonly` **Https**: `"https"` = `"https"`
|
|
24
|
+
|
|
25
|
+
HTTPS URL (starts with https://).
|
|
26
|
+
|
|
27
|
+
### Http
|
|
28
|
+
|
|
29
|
+
> `readonly` **Http**: `"http"` = `"http"`
|
|
30
|
+
|
|
31
|
+
HTTP URL (starts with http://).
|
|
32
|
+
|
|
33
|
+
### Default
|
|
34
|
+
|
|
35
|
+
> `readonly` **Default**: `"default"` = `"default"`
|
|
36
|
+
|
|
37
|
+
Default/standard module resolution.
|