@twin.org/node-core 0.0.2-next.9 → 0.0.3-next.2
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/bootstrap.js +374 -0
- package/dist/es/bootstrap.js.map +1 -0
- package/dist/es/builders/engineEnvBuilder.js +1051 -0
- package/dist/es/builders/engineEnvBuilder.js.map +1 -0
- package/dist/es/builders/engineServerEnvBuilder.js +197 -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/defaults.js +9 -0
- package/dist/es/defaults.js.map +1 -0
- package/dist/es/identity.js +169 -0
- package/dist/es/identity.js.map +1 -0
- package/dist/es/index.js +23 -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/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/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/models/nodeFeatures.js +21 -0
- package/dist/es/models/nodeFeatures.js.map +1 -0
- package/dist/es/node.js +265 -0
- package/dist/es/node.js.map +1 -0
- package/dist/es/server.js +78 -0
- package/dist/es/server.js.map +1 -0
- package/dist/es/utils.js +418 -0
- package/dist/es/utils.js.map +1 -0
- package/dist/types/bootstrap.d.ts +27 -10
- package/dist/types/builders/engineEnvBuilder.d.ts +3 -2
- package/dist/types/builders/engineServerEnvBuilder.d.ts +4 -3
- package/dist/types/builders/extensionsBuilder.d.ts +32 -0
- package/dist/types/defaults.d.ts +6 -0
- package/dist/types/identity.d.ts +14 -0
- package/dist/types/index.d.ts +20 -11
- package/dist/types/models/ICacheMetadata.d.ts +17 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +132 -24
- 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 +22 -0
- package/dist/types/models/INodeEnvironmentVariables.d.ts +50 -10
- package/dist/types/models/INodeOptions.d.ts +14 -3
- package/dist/types/models/IProtocolHandlerResult.d.ts +13 -0
- package/dist/types/models/moduleProtocol.d.ts +29 -0
- package/dist/types/models/nodeExtensionMethods.d.ts +27 -0
- package/dist/types/models/nodeFeatures.d.ts +5 -5
- package/dist/types/node.d.ts +17 -7
- package/dist/types/server.d.ts +9 -6
- package/dist/types/utils.d.ts +87 -2
- package/docs/changelog.md +185 -0
- package/docs/detailed-guide.md +129 -0
- package/docs/reference/functions/bootstrap.md +1 -1
- package/docs/reference/functions/bootstrapAuth.md +1 -1
- package/docs/reference/functions/bootstrapBlobEncryption.md +1 -1
- package/docs/reference/functions/bootstrapContextIdHandlers.md +35 -0
- package/docs/reference/functions/bootstrapImmutableProofMethod.md +1 -1
- package/docs/reference/functions/{bootstrapNodeUser.md → bootstrapNodeAdminUser.md} +3 -3
- package/docs/reference/functions/{bootstrapNodeIdentity.md → bootstrapNodeId.md} +3 -3
- package/docs/reference/functions/bootstrapSynchronisedStorage.md +1 -1
- package/docs/reference/functions/bootstrapTenantId.md +35 -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/createModuleImportUrl.md +21 -0
- package/docs/reference/functions/directoryExists.md +19 -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/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/isCacheExpired.md +31 -0
- package/docs/reference/functions/overrideModuleImport.md +8 -2
- package/docs/reference/functions/parseModuleProtocol.md +19 -0
- package/docs/reference/functions/resolvePackageEntryPoint.md +32 -0
- package/docs/reference/functions/run.md +3 -3
- package/docs/reference/functions/shutdownExtensions.md +25 -0
- package/docs/reference/functions/start.md +11 -5
- package/docs/reference/index.md +36 -2
- package/docs/reference/interfaces/ICacheMetadata.md +27 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +255 -37
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +1696 -5
- package/docs/reference/interfaces/IModuleProtocol.md +27 -0
- package/docs/reference/interfaces/INodeEngineConfig.md +7 -0
- package/docs/reference/interfaces/INodeEngineState.md +39 -0
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +609 -165
- package/docs/reference/interfaces/INodeOptions.md +27 -3
- package/docs/reference/interfaces/IProtocolHandlerResult.md +19 -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/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +3 -0
- package/docs/reference/variables/ModuleProtocol.md +37 -0
- package/docs/reference/variables/NodeFeatures.md +7 -7
- 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 +27 -9
- package/package.json +27 -9
- package/dist/cjs/index.cjs +0 -1910
- package/dist/esm/index.mjs +0 -1870
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: createModuleImportUrl()
|
|
2
|
+
|
|
3
|
+
> **createModuleImportUrl**(`filePath`): `string`
|
|
4
|
+
|
|
5
|
+
Convert a file path to an import-compatible URL for cross-platform module loading.
|
|
6
|
+
On Windows, adds the 'file://' protocol prefix required for dynamic imports.
|
|
7
|
+
On other platforms, returns the path unchanged.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
### filePath
|
|
12
|
+
|
|
13
|
+
`string`
|
|
14
|
+
|
|
15
|
+
The absolute file path to convert.
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
A URL string compatible with dynamic import().
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: directoryExists()
|
|
2
|
+
|
|
3
|
+
> **directoryExists**(`directory`): `Promise`\<`boolean`\>
|
|
4
|
+
|
|
5
|
+
Does the specified directory exist.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### directory
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The directory to check for existence.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`boolean`\>
|
|
18
|
+
|
|
19
|
+
True if the directory exists.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: extensionsConfiguration()
|
|
2
|
+
|
|
3
|
+
> **extensionsConfiguration**(`envVars`, `nodeEngineConfig`): `Promise`\<[`INodeEngineConfig`](../interfaces/INodeEngineConfig.md)\>
|
|
4
|
+
|
|
5
|
+
Handles the configuration of the extensions.
|
|
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`\<[`INodeEngineConfig`](../interfaces/INodeEngineConfig.md)\>
|
|
24
|
+
|
|
25
|
+
The config for the core and the server.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: extensionsInitialiseEngine()
|
|
2
|
+
|
|
3
|
+
> **extensionsInitialiseEngine**(`envVars`, `engineCore`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Handles the initialisation of the extensions when the engine has been constructed.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envVars
|
|
10
|
+
|
|
11
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
12
|
+
|
|
13
|
+
The environment variables for the node.
|
|
14
|
+
|
|
15
|
+
### engineCore
|
|
16
|
+
|
|
17
|
+
`IEngineCore`
|
|
18
|
+
|
|
19
|
+
The engine core instance.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Promise`\<`void`\>
|
|
24
|
+
|
|
25
|
+
Nothing.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: extensionsInitialiseEngineServer()
|
|
2
|
+
|
|
3
|
+
> **extensionsInitialiseEngineServer**(`envVars`, `engineCore`, `engineServer`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Handles the initialisation of the extensions when the engine server has been constructed.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envVars
|
|
10
|
+
|
|
11
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
12
|
+
|
|
13
|
+
The environment variables for the node.
|
|
14
|
+
|
|
15
|
+
### engineCore
|
|
16
|
+
|
|
17
|
+
`IEngineCore`
|
|
18
|
+
|
|
19
|
+
The engine core instance.
|
|
20
|
+
|
|
21
|
+
### engineServer
|
|
22
|
+
|
|
23
|
+
`IEngineServer`
|
|
24
|
+
|
|
25
|
+
The engine server instance.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`void`\>
|
|
30
|
+
|
|
31
|
+
Nothing.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: getExtensionsCacheDir()
|
|
2
|
+
|
|
3
|
+
> **getExtensionsCacheDir**(`executionDirectory`, `protocol`, `cacheDirectory?`): `string`
|
|
4
|
+
|
|
5
|
+
Get the extensions cache directory.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### executionDirectory
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The execution directory.
|
|
14
|
+
|
|
15
|
+
### protocol
|
|
16
|
+
|
|
17
|
+
[`ModuleProtocol`](../type-aliases/ModuleProtocol.md)
|
|
18
|
+
|
|
19
|
+
The protocol type for subdirectory organization.
|
|
20
|
+
|
|
21
|
+
### cacheDirectory?
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
The cache directory base path.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The cache directory path.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: getFiles()
|
|
2
|
+
|
|
3
|
+
> **getFiles**(`directory`): `Promise`\<`string`[]\>
|
|
4
|
+
|
|
5
|
+
Get the files in the directory.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### directory
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The directory to get the files from.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`string`[]\>
|
|
18
|
+
|
|
19
|
+
The list of files in the directory.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: getSubFolders()
|
|
2
|
+
|
|
3
|
+
> **getSubFolders**(`directory`): `Promise`\<`string`[]\>
|
|
4
|
+
|
|
5
|
+
Get the sub folders for the folder.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### directory
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The directory to get the sub folders.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`Promise`\<`string`[]\>
|
|
18
|
+
|
|
19
|
+
The list of sub folders.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Function: handleHttpsProtocol()
|
|
2
|
+
|
|
3
|
+
> **handleHttpsProtocol**(`url`, `executionDirectory`, `maxSizeMb`, `cacheDirectory?`, `ttlHours?`, `forceRefresh?`): `Promise`\<[`IProtocolHandlerResult`](../interfaces/IProtocolHandlerResult.md)\>
|
|
4
|
+
|
|
5
|
+
Handle the https: protocol by downloading the module if needed.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### url
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The HTTPS URL to download from.
|
|
14
|
+
|
|
15
|
+
### executionDirectory
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The execution directory.
|
|
20
|
+
|
|
21
|
+
### maxSizeMb
|
|
22
|
+
|
|
23
|
+
`number`
|
|
24
|
+
|
|
25
|
+
The maximum size in MB for the download.
|
|
26
|
+
|
|
27
|
+
### cacheDirectory?
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The cache directory base path.
|
|
32
|
+
|
|
33
|
+
### ttlHours?
|
|
34
|
+
|
|
35
|
+
`number`
|
|
36
|
+
|
|
37
|
+
TTL in hours for cache expiration.
|
|
38
|
+
|
|
39
|
+
### forceRefresh?
|
|
40
|
+
|
|
41
|
+
`boolean`
|
|
42
|
+
|
|
43
|
+
Whether to force refresh the cache.
|
|
44
|
+
|
|
45
|
+
## Returns
|
|
46
|
+
|
|
47
|
+
`Promise`\<[`IProtocolHandlerResult`](../interfaces/IProtocolHandlerResult.md)\>
|
|
48
|
+
|
|
49
|
+
The resolved path to the downloaded module.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: handleNpmProtocol()
|
|
2
|
+
|
|
3
|
+
> **handleNpmProtocol**(`packageName`, `executionDirectory`, `cacheDirectory?`): `Promise`\<[`IProtocolHandlerResult`](../interfaces/IProtocolHandlerResult.md)\>
|
|
4
|
+
|
|
5
|
+
Handle the npm: protocol by installing the package if needed.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### packageName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The npm package name (without npm: prefix).
|
|
14
|
+
|
|
15
|
+
### executionDirectory
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The execution directory.
|
|
20
|
+
|
|
21
|
+
### cacheDirectory?
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
The cache directory base path.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<[`IProtocolHandlerResult`](../interfaces/IProtocolHandlerResult.md)\>
|
|
30
|
+
|
|
31
|
+
The resolved path to the installed module.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: hashUrl()
|
|
2
|
+
|
|
3
|
+
> **hashUrl**(`url`): `string`
|
|
4
|
+
|
|
5
|
+
Hash a URL to create a safe filename.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### url
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The URL to hash.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
A hashed filename safe for the filesystem.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: isCacheExpired()
|
|
2
|
+
|
|
3
|
+
> **isCacheExpired**(`metadataPath`, `ttlHours`, `forceRefresh`): `Promise`\<`boolean`\>
|
|
4
|
+
|
|
5
|
+
Check if a cached file has expired based on TTL and force refresh settings.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### metadataPath
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
Path to the cache metadata file.
|
|
14
|
+
|
|
15
|
+
### ttlHours
|
|
16
|
+
|
|
17
|
+
`number`
|
|
18
|
+
|
|
19
|
+
Time to live in hours.
|
|
20
|
+
|
|
21
|
+
### forceRefresh
|
|
22
|
+
|
|
23
|
+
`boolean`
|
|
24
|
+
|
|
25
|
+
Whether to force refresh regardless of TTL.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`boolean`\>
|
|
30
|
+
|
|
31
|
+
True if the cache is expired or should be refreshed.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Function: overrideModuleImport()
|
|
2
2
|
|
|
3
|
-
> **overrideModuleImport**(`executionDirectory`): `void`
|
|
3
|
+
> **overrideModuleImport**(`executionDirectory`, `envVars?`): `void`
|
|
4
4
|
|
|
5
|
-
Override module imports to
|
|
5
|
+
Override module imports to support protocol-based loading (npm:, https:) and local files.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
@@ -12,6 +12,12 @@ Override module imports to use local files where possible.
|
|
|
12
12
|
|
|
13
13
|
The execution directory for resolving local module paths.
|
|
14
14
|
|
|
15
|
+
### envVars?
|
|
16
|
+
|
|
17
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
18
|
+
|
|
19
|
+
The environment variables containing extension configuration (optional, uses defaults if not provided).
|
|
20
|
+
|
|
15
21
|
## Returns
|
|
16
22
|
|
|
17
23
|
`void`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: parseModuleProtocol()
|
|
2
|
+
|
|
3
|
+
> **parseModuleProtocol**(`moduleName`): [`IModuleProtocol`](../interfaces/IModuleProtocol.md)
|
|
4
|
+
|
|
5
|
+
Parse the protocol from a module name.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### moduleName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The module name to parse.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`IModuleProtocol`](../interfaces/IModuleProtocol.md)
|
|
18
|
+
|
|
19
|
+
The parsed protocol information.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Function: resolvePackageEntryPoint()
|
|
2
|
+
|
|
3
|
+
> **resolvePackageEntryPoint**(`packagePath`, `packageName`, `fallback`): `Promise`\<`string`\>
|
|
4
|
+
|
|
5
|
+
Resolve the main entry point from a package directory using Node.js resolution with fallback.
|
|
6
|
+
Uses require.resolve() when possible for standard Node.js behavior, with manual fallback.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
### packagePath
|
|
11
|
+
|
|
12
|
+
`string`
|
|
13
|
+
|
|
14
|
+
The absolute path to the package directory.
|
|
15
|
+
|
|
16
|
+
### packageName
|
|
17
|
+
|
|
18
|
+
`string`
|
|
19
|
+
|
|
20
|
+
The package name for require.resolve().
|
|
21
|
+
|
|
22
|
+
### fallback
|
|
23
|
+
|
|
24
|
+
`string` = `"index.js"`
|
|
25
|
+
|
|
26
|
+
The fallback file name if no entry point is found.
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`string`\>
|
|
31
|
+
|
|
32
|
+
The resolved entry point file name (relative to package directory).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: run()
|
|
2
2
|
|
|
3
|
-
> **run**(`nodeOptions?`): `Promise`\<`void`\>
|
|
3
|
+
> **run**(`nodeOptions?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
|
|
4
4
|
|
|
5
5
|
Run the TWIN Node server.
|
|
6
6
|
|
|
@@ -14,6 +14,6 @@ Optional configuration options for running the server.
|
|
|
14
14
|
|
|
15
15
|
## Returns
|
|
16
16
|
|
|
17
|
-
`Promise`\<`void`\>
|
|
17
|
+
`Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
|
|
18
18
|
|
|
19
|
-
A promise that resolves when the server is started.
|
|
19
|
+
A promise that resolves when the server is started containing a shutdown method.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: shutdownExtensions()
|
|
2
|
+
|
|
3
|
+
> **shutdownExtensions**(`envVars`, `engineCore`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Handles the shutdown of the extensions.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envVars
|
|
10
|
+
|
|
11
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
12
|
+
|
|
13
|
+
The environment variables for the node.
|
|
14
|
+
|
|
15
|
+
### engineCore
|
|
16
|
+
|
|
17
|
+
`IEngineCore`
|
|
18
|
+
|
|
19
|
+
The engine core instance.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Promise`\<`void`\>
|
|
24
|
+
|
|
25
|
+
Nothing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: start()
|
|
2
2
|
|
|
3
|
-
> **start**(`nodeOptions`, `
|
|
3
|
+
> **start**(`nodeOptions`, `nodeEngineConfig`, `envVars`, `contextIdKeys?`): `Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
|
|
4
4
|
|
|
5
5
|
Start the engine server.
|
|
6
6
|
|
|
@@ -10,11 +10,11 @@ Start the engine server.
|
|
|
10
10
|
|
|
11
11
|
Optional run options for the engine server.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
[`INodeOptions`](../interfaces/INodeOptions.md) | `undefined`
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### nodeEngineConfig
|
|
16
16
|
|
|
17
|
-
`
|
|
17
|
+
[`INodeEngineConfig`](../interfaces/INodeEngineConfig.md)
|
|
18
18
|
|
|
19
19
|
The configuration for the engine server.
|
|
20
20
|
|
|
@@ -24,8 +24,14 @@ The configuration for the engine server.
|
|
|
24
24
|
|
|
25
25
|
The environment variables.
|
|
26
26
|
|
|
27
|
+
### contextIdKeys?
|
|
28
|
+
|
|
29
|
+
`string`[]
|
|
30
|
+
|
|
31
|
+
The context ID keys.
|
|
32
|
+
|
|
27
33
|
## Returns
|
|
28
34
|
|
|
29
|
-
`Promise
|
|
35
|
+
`Promise`\<\{ `engine`: `Engine`\<`IEngineServerConfig`, [`INodeEngineState`](../interfaces/INodeEngineState.md)\>; `server`: `EngineServer`; `shutdown`: () => `Promise`\<`void`\>; \} \| `undefined`\>
|
|
30
36
|
|
|
31
37
|
The engine server.
|
package/docs/reference/index.md
CHANGED
|
@@ -2,30 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
## Interfaces
|
|
4
4
|
|
|
5
|
+
- [ICacheMetadata](interfaces/ICacheMetadata.md)
|
|
5
6
|
- [IEngineEnvironmentVariables](interfaces/IEngineEnvironmentVariables.md)
|
|
6
7
|
- [IEngineServerEnvironmentVariables](interfaces/IEngineServerEnvironmentVariables.md)
|
|
8
|
+
- [IModuleProtocol](interfaces/IModuleProtocol.md)
|
|
9
|
+
- [INodeEngineConfig](interfaces/INodeEngineConfig.md)
|
|
10
|
+
- [INodeEngineState](interfaces/INodeEngineState.md)
|
|
7
11
|
- [INodeEnvironmentVariables](interfaces/INodeEnvironmentVariables.md)
|
|
8
12
|
- [INodeOptions](interfaces/INodeOptions.md)
|
|
13
|
+
- [IProtocolHandlerResult](interfaces/IProtocolHandlerResult.md)
|
|
9
14
|
|
|
10
15
|
## Type Aliases
|
|
11
16
|
|
|
17
|
+
- [ModuleProtocol](type-aliases/ModuleProtocol.md)
|
|
18
|
+
- [NodeExtensionInitialiseMethod](type-aliases/NodeExtensionInitialiseMethod.md)
|
|
19
|
+
- [NodeExtensionInitialiseEngineMethod](type-aliases/NodeExtensionInitialiseEngineMethod.md)
|
|
20
|
+
- [NodeExtensionInitialiseEngineServerMethod](type-aliases/NodeExtensionInitialiseEngineServerMethod.md)
|
|
21
|
+
- [NodeExtensionShutdownMethod](type-aliases/NodeExtensionShutdownMethod.md)
|
|
12
22
|
- [NodeFeatures](type-aliases/NodeFeatures.md)
|
|
13
23
|
|
|
14
24
|
## Variables
|
|
15
25
|
|
|
26
|
+
- [ATTESTATION\_VERIFICATION\_METHOD\_ID](variables/ATTESTATION_VERIFICATION_METHOD_ID.md)
|
|
27
|
+
- [IMMUTABLE\_PROOF\_VERIFICATION\_METHOD\_ID](variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md)
|
|
28
|
+
- [BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID](variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md)
|
|
29
|
+
- [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)
|
|
31
|
+
- [AUTH\_SIGNING\_KEY\_ID](variables/AUTH_SIGNING_KEY_ID.md)
|
|
32
|
+
- [ModuleProtocol](variables/ModuleProtocol.md)
|
|
16
33
|
- [NodeFeatures](variables/NodeFeatures.md)
|
|
17
34
|
|
|
18
35
|
## Functions
|
|
19
36
|
|
|
20
37
|
- [bootstrap](functions/bootstrap.md)
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
38
|
+
- [bootstrapContextIdHandlers](functions/bootstrapContextIdHandlers.md)
|
|
39
|
+
- [bootstrapNodeId](functions/bootstrapNodeId.md)
|
|
40
|
+
- [bootstrapTenantId](functions/bootstrapTenantId.md)
|
|
41
|
+
- [bootstrapNodeAdminUser](functions/bootstrapNodeAdminUser.md)
|
|
23
42
|
- [bootstrapImmutableProofMethod](functions/bootstrapImmutableProofMethod.md)
|
|
24
43
|
- [bootstrapBlobEncryption](functions/bootstrapBlobEncryption.md)
|
|
25
44
|
- [bootstrapAuth](functions/bootstrapAuth.md)
|
|
26
45
|
- [bootstrapSynchronisedStorage](functions/bootstrapSynchronisedStorage.md)
|
|
27
46
|
- [buildEngineConfiguration](functions/buildEngineConfiguration.md)
|
|
28
47
|
- [buildEngineServerConfiguration](functions/buildEngineServerConfiguration.md)
|
|
48
|
+
- [extensionsConfiguration](functions/extensionsConfiguration.md)
|
|
49
|
+
- [extensionsInitialiseEngine](functions/extensionsInitialiseEngine.md)
|
|
50
|
+
- [extensionsInitialiseEngineServer](functions/extensionsInitialiseEngineServer.md)
|
|
51
|
+
- [shutdownExtensions](functions/shutdownExtensions.md)
|
|
29
52
|
- [run](functions/run.md)
|
|
30
53
|
- [buildConfiguration](functions/buildConfiguration.md)
|
|
31
54
|
- [overrideModuleImport](functions/overrideModuleImport.md)
|
|
@@ -33,6 +56,17 @@
|
|
|
33
56
|
- [initialiseLocales](functions/initialiseLocales.md)
|
|
34
57
|
- [getExecutionDirectory](functions/getExecutionDirectory.md)
|
|
35
58
|
- [fileExists](functions/fileExists.md)
|
|
59
|
+
- [directoryExists](functions/directoryExists.md)
|
|
60
|
+
- [getSubFolders](functions/getSubFolders.md)
|
|
61
|
+
- [getFiles](functions/getFiles.md)
|
|
36
62
|
- [loadTextFile](functions/loadTextFile.md)
|
|
37
63
|
- [loadJsonFile](functions/loadJsonFile.md)
|
|
38
64
|
- [getFeatures](functions/getFeatures.md)
|
|
65
|
+
- [parseModuleProtocol](functions/parseModuleProtocol.md)
|
|
66
|
+
- [hashUrl](functions/hashUrl.md)
|
|
67
|
+
- [getExtensionsCacheDir](functions/getExtensionsCacheDir.md)
|
|
68
|
+
- [handleNpmProtocol](functions/handleNpmProtocol.md)
|
|
69
|
+
- [isCacheExpired](functions/isCacheExpired.md)
|
|
70
|
+
- [handleHttpsProtocol](functions/handleHttpsProtocol.md)
|
|
71
|
+
- [resolvePackageEntryPoint](functions/resolvePackageEntryPoint.md)
|
|
72
|
+
- [createModuleImportUrl](functions/createModuleImportUrl.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: ICacheMetadata
|
|
2
|
+
|
|
3
|
+
Metadata for cached HTTPS extensions.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### downloadedAt
|
|
8
|
+
|
|
9
|
+
> **downloadedAt**: `number`
|
|
10
|
+
|
|
11
|
+
Timestamp when the file was downloaded.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### url
|
|
16
|
+
|
|
17
|
+
> **url**: `string`
|
|
18
|
+
|
|
19
|
+
Original URL of the cached file.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### size
|
|
24
|
+
|
|
25
|
+
> **size**: `number`
|
|
26
|
+
|
|
27
|
+
Size of the cached file in bytes.
|