@twin.org/node-core 0.0.3-next.1 → 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/dist/es/builders/engineEnvBuilder.js +155 -74
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +24 -15
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/builders/extensionsBuilder.js +26 -17
- package/dist/es/builders/extensionsBuilder.js.map +1 -1
- 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 +20 -1
- package/dist/es/defaults.js.map +1 -1
- package/dist/es/index.js +7 -3
- package/dist/es/index.js.map +1 -1
- 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.map +1 -1
- package/dist/es/models/INodeEngineState.js.map +1 -1
- package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
- package/dist/es/models/cliCommandParamType.js +4 -0
- package/dist/es/models/cliCommandParamType.js.map +1 -0
- package/dist/es/node.js +55 -35
- package/dist/es/node.js.map +1 -1
- package/dist/es/start.js +128 -0
- package/dist/es/start.js.map +1 -0
- package/dist/es/utils.js +1 -22
- package/dist/es/utils.js.map +1 -1
- package/dist/types/builders/engineEnvBuilder.d.ts +4 -1
- package/dist/types/builders/engineServerEnvBuilder.d.ts +5 -2
- 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 +11 -1
- package/dist/types/index.d.ts +7 -3
- 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 +51 -42
- package/dist/types/models/INodeEngineState.d.ts +0 -8
- package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
- package/dist/types/models/cliCommandParamType.d.ts +4 -0
- package/dist/types/node.d.ts +6 -2
- package/dist/types/{server.d.ts → start.d.ts} +7 -2
- package/dist/types/utils.d.ts +0 -8
- package/docs/changelog.md +63 -0
- package/docs/reference/functions/buildConfiguration.md +2 -2
- package/docs/reference/functions/buildEngineConfiguration.md +1 -1
- package/docs/reference/functions/buildEngineServerConfiguration.md +3 -3
- package/docs/reference/functions/constructCliCommand.md +27 -0
- package/docs/reference/functions/executeCommand.md +29 -0
- package/docs/reference/functions/getEnvDefaults.md +19 -0
- package/docs/reference/functions/initCli.md +27 -0
- package/docs/reference/functions/parseCommandLineArgs.md +19 -0
- package/docs/reference/functions/processEnvOptions.md +27 -0
- package/docs/reference/functions/registerCommands.md +9 -0
- package/docs/reference/functions/run.md +7 -1
- package/docs/reference/functions/start.md +10 -4
- package/docs/reference/functions/substituteEnvOptions.md +25 -0
- package/docs/reference/index.md +15 -12
- 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 +90 -65
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +129 -88
- package/docs/reference/interfaces/INodeEngineState.md +0 -16
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +129 -172
- package/docs/reference/type-aliases/CliCommandParamType.md +5 -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/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +1 -1
- package/locales/en.json +463 -30
- package/package.json +3 -1
- package/dist/es/bootstrap.js +0 -374
- package/dist/es/bootstrap.js.map +0 -1
- package/dist/es/identity.js +0 -169
- package/dist/es/identity.js.map +0 -1
- package/dist/es/models/nodeFeatures.js +0 -21
- package/dist/es/models/nodeFeatures.js.map +0 -1
- package/dist/es/server.js +0 -74
- package/dist/es/server.js.map +0 -1
- package/dist/types/bootstrap.d.ts +0 -76
- package/dist/types/identity.d.ts +0 -14
- package/dist/types/models/nodeFeatures.d.ts +0 -21
- 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/bootstrapContextIdHandlers.md +0 -35
- package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
- package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
- package/docs/reference/functions/bootstrapNodeId.md +0 -35
- package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
- package/docs/reference/functions/bootstrapTenantId.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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CliCommandParamType } from "./cliCommandParamType.js";
|
|
2
|
+
import type { ICliCommandDefinition } from "./ICliCommandDefinition.js";
|
|
3
|
+
/**
|
|
4
|
+
* Command to execute in the CLI.
|
|
5
|
+
*/
|
|
6
|
+
export interface ICliCommand {
|
|
7
|
+
/**
|
|
8
|
+
* The command to execute.
|
|
9
|
+
*/
|
|
10
|
+
definition: ICliCommandDefinition;
|
|
11
|
+
/**
|
|
12
|
+
* The params to execute the command with.
|
|
13
|
+
*/
|
|
14
|
+
params: {
|
|
15
|
+
[id: string]: CliCommandParamType;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { CliCommandParamType } from "./cliCommandParamType.js";
|
|
3
|
+
import type { ICliCommandDefinitionParam } from "./ICliCommandDefinitionParam.js";
|
|
4
|
+
import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
|
|
5
|
+
/**
|
|
6
|
+
* Command to execute in the CLI.
|
|
7
|
+
*/
|
|
8
|
+
export interface ICliCommandDefinition {
|
|
9
|
+
/**
|
|
10
|
+
* The command name.
|
|
11
|
+
*/
|
|
12
|
+
command: string;
|
|
13
|
+
/**
|
|
14
|
+
* The command description.
|
|
15
|
+
*/
|
|
16
|
+
description: string;
|
|
17
|
+
/**
|
|
18
|
+
* The example.
|
|
19
|
+
*/
|
|
20
|
+
example: string;
|
|
21
|
+
/**
|
|
22
|
+
* The params available for the command.
|
|
23
|
+
*/
|
|
24
|
+
params: ICliCommandDefinitionParam[];
|
|
25
|
+
/**
|
|
26
|
+
* The method to execute for the command.
|
|
27
|
+
*/
|
|
28
|
+
action: (engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
29
|
+
[id: string]: CliCommandParamType;
|
|
30
|
+
}) => Promise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether the engine needs to be started before executing the command.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
requiresEngineStarted?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates whether the engine needs the node identity to be set if configured to use.
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
requiresNodeIdentity?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether the engine needs the tenant id to be set if configured to use.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
requiresTenantId?: boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CliCommandParamType } from "./cliCommandParamType.js";
|
|
2
|
+
/**
|
|
3
|
+
* Command param to execute in the CLI.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICliCommandDefinitionParam {
|
|
6
|
+
/**
|
|
7
|
+
* The param key.
|
|
8
|
+
*/
|
|
9
|
+
key: string;
|
|
10
|
+
/**
|
|
11
|
+
* The param type.
|
|
12
|
+
*/
|
|
13
|
+
type: "string" | "number" | "boolean";
|
|
14
|
+
/**
|
|
15
|
+
* Possible options for the param.
|
|
16
|
+
*/
|
|
17
|
+
options?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* The extended type e.g. hex etc.
|
|
20
|
+
*/
|
|
21
|
+
extendedType?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the param is required.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The default value of the param.
|
|
29
|
+
*/
|
|
30
|
+
defaultValue?: CliCommandParamType;
|
|
31
|
+
/**
|
|
32
|
+
* The param description.
|
|
33
|
+
*/
|
|
34
|
+
description: string;
|
|
35
|
+
}
|
|
@@ -6,6 +6,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
6
6
|
* Start the engine in debug mode.
|
|
7
7
|
*/
|
|
8
8
|
debug?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Start the engine in silent mode.
|
|
11
|
+
*/
|
|
12
|
+
silent?: string;
|
|
9
13
|
/**
|
|
10
14
|
* The root directory for storing items like state file.
|
|
11
15
|
*/
|
|
@@ -15,17 +19,13 @@ export interface IEngineEnvironmentVariables {
|
|
|
15
19
|
*/
|
|
16
20
|
stateFilename?: string;
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* Does the node have a unique ID, defaults to true.
|
|
19
23
|
*/
|
|
20
|
-
|
|
24
|
+
nodeIdentityEnabled?: string;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
tenantId?: string;
|
|
25
|
-
/**
|
|
26
|
-
* A tenant api key to use as a default for the node.
|
|
26
|
+
* Is multi-tenant support enabled, defaults to false.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
tenantEnabled?: string;
|
|
29
29
|
/**
|
|
30
30
|
* The type of the entity storage to create, comma separate for more than one connector.
|
|
31
31
|
* values: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql
|
|
@@ -59,6 +59,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
59
59
|
* AWS Dynamo DB secret access key.
|
|
60
60
|
*/
|
|
61
61
|
awsDynamodbSecretAccessKey?: string;
|
|
62
|
+
/**
|
|
63
|
+
* AWS Dynamo DB connection timeout.
|
|
64
|
+
*/
|
|
65
|
+
awsDynamodbConnectionTimeoutMs?: string;
|
|
62
66
|
/**
|
|
63
67
|
* Azure Cosmos DB key.
|
|
64
68
|
*/
|
|
@@ -200,11 +204,6 @@ export interface IEngineEnvironmentVariables {
|
|
|
200
204
|
* The id of the encryption key for the blob storage.
|
|
201
205
|
*/
|
|
202
206
|
blobStorageEncryptionKeyId?: string;
|
|
203
|
-
/**
|
|
204
|
-
* A symmetric encryption key for the blob storage, should be ChaCha20Poly1305 in base64 format.
|
|
205
|
-
* If encryption is enabled but a key is not provided one will be generated.
|
|
206
|
-
*/
|
|
207
|
-
blobStorageSymmetricEncryptionKey?: string;
|
|
208
207
|
/**
|
|
209
208
|
* A prefix for all the blobs in blob-storage, can be empty.
|
|
210
209
|
*/
|
|
@@ -281,10 +280,6 @@ export interface IEngineEnvironmentVariables {
|
|
|
281
280
|
* The type of logging task connector, can be a comma separated list: console, entity-storage.
|
|
282
281
|
*/
|
|
283
282
|
loggingConnector?: string;
|
|
284
|
-
/**
|
|
285
|
-
* The type of background task connector: entity-storage.
|
|
286
|
-
*/
|
|
287
|
-
backgroundTaskConnector?: string;
|
|
288
283
|
/**
|
|
289
284
|
* The type of event bus connector: local.
|
|
290
285
|
*/
|
|
@@ -353,6 +348,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
353
348
|
* The type of identity connector: entity-storage, iota.
|
|
354
349
|
*/
|
|
355
350
|
identityConnector?: string;
|
|
351
|
+
/**
|
|
352
|
+
* The index of the wallet address to use, defaults to 0.
|
|
353
|
+
*/
|
|
354
|
+
identityWalletAddressIndex?: string;
|
|
356
355
|
/**
|
|
357
356
|
* The type of identity resolver connector: entity-storage, iota.
|
|
358
357
|
*/
|
|
@@ -482,13 +481,26 @@ export interface IEngineEnvironmentVariables {
|
|
|
482
481
|
*/
|
|
483
482
|
federatedCatalogueEnabled?: string;
|
|
484
483
|
/**
|
|
485
|
-
* Federated catalog
|
|
484
|
+
* Federated catalog filters, command separated list of filters to add.
|
|
485
|
+
*/
|
|
486
|
+
federatedCatalogueFilters?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Is the trust management enabled, defaults to false.
|
|
489
|
+
*/
|
|
490
|
+
trustEnabled?: string;
|
|
491
|
+
/**
|
|
492
|
+
* The trust generators to add to the factory, comma separated list.
|
|
493
|
+
*/
|
|
494
|
+
trustGenerators?: string;
|
|
495
|
+
/**
|
|
496
|
+
* The trust verifiers to add to the factory, comma separated list.
|
|
486
497
|
*/
|
|
487
|
-
|
|
498
|
+
trustVerifiers?: string;
|
|
488
499
|
/**
|
|
489
|
-
*
|
|
500
|
+
* The verification method to use for trust identities.
|
|
501
|
+
* Defaults to node-authentication-assertion.
|
|
490
502
|
*/
|
|
491
|
-
|
|
503
|
+
trustVerificationMethodId?: string;
|
|
492
504
|
/**
|
|
493
505
|
* Is the rights management enabled, defaults to false.
|
|
494
506
|
*/
|
|
@@ -498,40 +510,37 @@ export interface IEngineEnvironmentVariables {
|
|
|
498
510
|
*/
|
|
499
511
|
rightsManagementBaseCallbackUrl?: string;
|
|
500
512
|
/**
|
|
501
|
-
* The rights management
|
|
502
|
-
|
|
513
|
+
* The rights management policy information sources to add to the factory.
|
|
514
|
+
*/
|
|
515
|
+
rightsManagementPolicyInformationSources?: string;
|
|
516
|
+
/**
|
|
517
|
+
* The rights management policy negotiators sources to add to the factory.
|
|
503
518
|
*/
|
|
504
|
-
|
|
519
|
+
rightsManagementPolicyNegotiators?: string;
|
|
505
520
|
/**
|
|
506
|
-
* The rights management
|
|
507
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
521
|
+
* The rights management policy requesters to add to the factory.
|
|
508
522
|
*/
|
|
509
|
-
|
|
523
|
+
rightsManagementPolicyRequesters?: string;
|
|
510
524
|
/**
|
|
511
|
-
* The rights management
|
|
512
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
525
|
+
* The rights management policy execution actions to add to the factory.
|
|
513
526
|
*/
|
|
514
|
-
|
|
527
|
+
rightsManagementPolicyExecutionActions?: string;
|
|
515
528
|
/**
|
|
516
|
-
* The rights management
|
|
517
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
529
|
+
* The rights management policy enforcement processors to add to the factory.
|
|
518
530
|
*/
|
|
519
|
-
|
|
531
|
+
rightsManagementPolicyEnforcementProcessors?: string;
|
|
520
532
|
/**
|
|
521
|
-
* The rights management
|
|
522
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
533
|
+
* The rights management policy arbiters to add to the factory.
|
|
523
534
|
*/
|
|
524
|
-
|
|
535
|
+
rightsManagementPolicyArbiters?: string;
|
|
525
536
|
/**
|
|
526
|
-
* The rights management
|
|
527
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
537
|
+
* The rights management data access handlers to add to the factory.
|
|
528
538
|
*/
|
|
529
|
-
|
|
539
|
+
rightsManagementDataAccessHandlers?: string;
|
|
530
540
|
/**
|
|
531
|
-
*
|
|
532
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
541
|
+
* Are background tasks enabled, defaults to false.
|
|
533
542
|
*/
|
|
534
|
-
|
|
543
|
+
backgroundTasksEnabled?: string;
|
|
535
544
|
/**
|
|
536
545
|
* Is the task scheduler enabled, defaults to false.
|
|
537
546
|
*/
|
|
@@ -11,12 +11,4 @@ export interface INodeEngineState extends IEngineState {
|
|
|
11
11
|
* The tenant id for the node.
|
|
12
12
|
*/
|
|
13
13
|
nodeTenantId?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The identity for the organization.
|
|
16
|
-
*/
|
|
17
|
-
nodeOrganizationId?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The identity for the admin user.
|
|
20
|
-
*/
|
|
21
|
-
nodeAdminUserId?: string;
|
|
22
14
|
}
|
|
@@ -3,44 +3,6 @@ import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironme
|
|
|
3
3
|
* The environment variables for the node.
|
|
4
4
|
*/
|
|
5
5
|
export interface INodeEnvironmentVariables extends IEngineServerEnvironmentVariables {
|
|
6
|
-
/**
|
|
7
|
-
* The features that are enabled on the node.
|
|
8
|
-
* @default []
|
|
9
|
-
*/
|
|
10
|
-
features?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The identity of the node which, if empty and node-identity feature is enabled it will be generated.
|
|
13
|
-
*/
|
|
14
|
-
nodeIdentity?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The mnemonic for the identity, if empty and node-identity feature is enabled it will be randomly generated.
|
|
17
|
-
*/
|
|
18
|
-
nodeMnemonic?: string;
|
|
19
|
-
/**
|
|
20
|
-
* If the node-admin-user feature is enabled, this will be the organization of the user, if one is not provided it will be generated
|
|
21
|
-
*/
|
|
22
|
-
organizationIdentity?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The mnemonic for the organization, if empty and node-admin-user feature is enabled it will be randomly generated.
|
|
25
|
-
*/
|
|
26
|
-
organizationMnemonic?: string;
|
|
27
|
-
/**
|
|
28
|
-
* If the node-admin-user feature is enabled, this will be the identity of the user, if one is not provided it will be generated
|
|
29
|
-
*/
|
|
30
|
-
adminUserIdentity?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The mnemonic for the admin user, if empty and node-admin-user feature is enabled it will be randomly generated.
|
|
33
|
-
*/
|
|
34
|
-
adminUserMnemonic?: string;
|
|
35
|
-
/**
|
|
36
|
-
* If the node-admin-user feature is enabled, this will be the name of the user.
|
|
37
|
-
* @default admin@node
|
|
38
|
-
*/
|
|
39
|
-
adminUserName?: string;
|
|
40
|
-
/**
|
|
41
|
-
* If the node-admin-user feature is enabled, this will be the password of the user, if empty it will be randomly generated.
|
|
42
|
-
*/
|
|
43
|
-
adminUserPassword?: string;
|
|
44
6
|
/**
|
|
45
7
|
* Maximum size in MB for HTTPS extensions downloads.
|
|
46
8
|
* @default 10
|
package/dist/types/node.d.ts
CHANGED
|
@@ -9,9 +9,10 @@ import type { INodeOptions } from "./models/INodeOptions.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Run the TWIN Node server.
|
|
11
11
|
* @param nodeOptions Optional configuration options for running the server.
|
|
12
|
+
* @param args Optional command line arguments.
|
|
12
13
|
* @returns A promise that resolves when the server is started containing a shutdown method.
|
|
13
14
|
*/
|
|
14
|
-
export declare function run(nodeOptions?: INodeOptions): Promise<{
|
|
15
|
+
export declare function run(nodeOptions?: INodeOptions, args?: string[]): Promise<{
|
|
15
16
|
engine: Engine<IEngineServerConfig, INodeEngineState>;
|
|
16
17
|
server: EngineServer;
|
|
17
18
|
shutdown: () => Promise<void>;
|
|
@@ -31,7 +32,10 @@ export declare function buildConfiguration(processEnv: {
|
|
|
31
32
|
[id: string]: string | unknown;
|
|
32
33
|
};
|
|
33
34
|
nodeEngineConfig: INodeEngineConfig;
|
|
34
|
-
|
|
35
|
+
availableContextIdKeys: {
|
|
36
|
+
key: string;
|
|
37
|
+
requiredHandlerFeatures: string[];
|
|
38
|
+
}[];
|
|
35
39
|
}>;
|
|
36
40
|
/**
|
|
37
41
|
* Override module imports to support protocol-based loading (npm:, https:) and local files.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Engine } from "@twin.org/engine";
|
|
2
2
|
import { EngineServer } from "@twin.org/engine-server";
|
|
3
3
|
import type { IEngineServerConfig } from "@twin.org/engine-server-types";
|
|
4
|
+
import type { ICliCommand } from "./models/ICliCommand.js";
|
|
4
5
|
import type { INodeEngineConfig } from "./models/INodeEngineConfig.js";
|
|
5
6
|
import type { INodeEngineState } from "./models/INodeEngineState.js";
|
|
6
7
|
import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
|
|
@@ -10,10 +11,14 @@ import type { INodeOptions } from "./models/INodeOptions.js";
|
|
|
10
11
|
* @param nodeOptions Optional run options for the engine server.
|
|
11
12
|
* @param nodeEngineConfig The configuration for the engine server.
|
|
12
13
|
* @param envVars The environment variables.
|
|
13
|
-
* @param
|
|
14
|
+
* @param cliCommand The constructed CLI command (optional).
|
|
15
|
+
* @param availableContextIdKeys The context ID keys available for operation.
|
|
14
16
|
* @returns The engine server.
|
|
15
17
|
*/
|
|
16
|
-
export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables,
|
|
18
|
+
export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, cliCommand?: ICliCommand, availableContextIdKeys?: {
|
|
19
|
+
key: string;
|
|
20
|
+
requiredHandlerFeatures: string[];
|
|
21
|
+
}[]): Promise<{
|
|
17
22
|
engine: Engine<IEngineServerConfig, INodeEngineState>;
|
|
18
23
|
server: EngineServer;
|
|
19
24
|
shutdown: () => Promise<void>;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { IModuleProtocol } from "./models/IModuleProtocol.js";
|
|
2
|
-
import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
|
|
3
2
|
import type { IProtocolHandlerResult } from "./models/IProtocolHandlerResult.js";
|
|
4
3
|
import { ModuleProtocol } from "./models/moduleProtocol.js";
|
|
5
|
-
import { NodeFeatures } from "./models/nodeFeatures.js";
|
|
6
4
|
/**
|
|
7
5
|
* Initialise the locales for the application.
|
|
8
6
|
* @param localesDirectory The directory containing the locales.
|
|
@@ -49,12 +47,6 @@ export declare function loadTextFile(filename: string): Promise<string>;
|
|
|
49
47
|
* @returns The contents of the JSON file or null if it could not be loaded.
|
|
50
48
|
*/
|
|
51
49
|
export declare function loadJsonFile<T>(filename: string): Promise<T>;
|
|
52
|
-
/**
|
|
53
|
-
* Get the features that are enabled on the node.
|
|
54
|
-
* @param env The environment variables for the node.
|
|
55
|
-
* @returns The features that are enabled on the node.
|
|
56
|
-
*/
|
|
57
|
-
export declare function getFeatures(env: INodeEnvironmentVariables): NodeFeatures[];
|
|
58
50
|
/**
|
|
59
51
|
* Parse the protocol from a module name.
|
|
60
52
|
* @param moduleName The module name to parse.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @twin.org/node-core - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.9...node-core-v0.0.3-next.10) (2026-01-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add CLI commands and remove automated bootstrap code ([#69](https://github.com/twinfoundation/node/issues/69)) ([6e40933](https://github.com/twinfoundation/node/commit/6e40933d8bb820b380e1074fc88feeedca0ef7d9))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.8...node-core-v0.0.3-next.9) (2026-01-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* improve bootstrapping and shutdown behaviour ([#66](https://github.com/twinfoundation/node/issues/66)) ([65b3452](https://github.com/twinfoundation/node/commit/65b345240334bfff48b52e136cc486cd7ac7f290))
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.7...node-core-v0.0.3-next.8) (2026-01-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update for livez endpoint ([9fc2e6a](https://github.com/twinfoundation/node/commit/9fc2e6ade38b3ec9591399a633d02b1e5fe07910))
|
|
23
|
+
|
|
24
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.6...node-core-v0.0.3-next.7) (2025-12-04)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* add trust and rights management plugin support ([cdeb504](https://github.com/twinfoundation/node/commit/cdeb504ee5986a347466162b9afa781645b4a54c))
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.5...node-core-v0.0.3-next.6) (2025-11-28)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* update background tasks and add fedcat filters ([1fd297e](https://github.com/twinfoundation/node/commit/1fd297e29f60b5bb3909638b68e326c5b0e2d77d))
|
|
37
|
+
|
|
38
|
+
## [0.0.3-next.5](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.4...node-core-v0.0.3-next.5) (2025-11-26)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add support for dynamodb connection timeout ([63051b0](https://github.com/twinfoundation/node/commit/63051b0d22138079115dfac921e7f0c45eaad34e))
|
|
44
|
+
|
|
45
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.3...node-core-v0.0.3-next.4) (2025-11-24)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* org identity verification methods ([18f158b](https://github.com/twinfoundation/node/commit/18f158b2f63930e20e94437c17ed43421771a458))
|
|
51
|
+
|
|
52
|
+
## [0.0.3-next.3](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.2...node-core-v0.0.3-next.3) (2025-11-20)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* updated context id features ([ef7be07](https://github.com/twinfoundation/node/commit/ef7be07d44dccdeacf10f90cb4ffde0303faa6fa))
|
|
58
|
+
|
|
59
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.1...node-core-v0.0.3-next.2) (2025-11-14)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* additional stop interlock ([b3a2757](https://github.com/twinfoundation/node/commit/b3a2757325af0e7b258a9f97f1b52e86087e6301))
|
|
65
|
+
|
|
3
66
|
## [0.0.3-next.1](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.0...node-core-v0.0.3-next.1) (2025-11-13)
|
|
4
67
|
|
|
5
68
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: buildConfiguration()
|
|
2
2
|
|
|
3
|
-
> **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `
|
|
3
|
+
> **buildConfiguration**(`processEnv`, `options`, `serverInfo`): `Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
|
|
4
4
|
|
|
5
5
|
Build the configuration for the TWIN Node server.
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ The server information.
|
|
|
24
24
|
|
|
25
25
|
## Returns
|
|
26
26
|
|
|
27
|
-
`Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `
|
|
27
|
+
`Promise`\<\{ `nodeEnvVars`: [`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md) & `object`; `nodeEngineConfig`: [`INodeEngineConfig`](../interfaces/INodeEngineConfig.md); `availableContextIdKeys`: `object`[]; \}\>
|
|
28
28
|
|
|
29
29
|
A promise that resolves to the engine server configuration, environment prefix, environment variables,
|
|
30
30
|
and options.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: buildEngineServerConfiguration()
|
|
2
2
|
|
|
3
|
-
> **buildEngineServerConfiguration**(`envVars`, `
|
|
3
|
+
> **buildEngineServerConfiguration**(`envVars`, `availableContextIdKeys`, `coreEngineConfig`, `serverInfo`, `openApiSpecPath?`, `favIconPath?`): `Promise`\<`IEngineServerConfig`\>
|
|
4
4
|
|
|
5
5
|
Handles the configuration of the server.
|
|
6
6
|
|
|
@@ -12,9 +12,9 @@ Handles the configuration of the server.
|
|
|
12
12
|
|
|
13
13
|
The environment variables for the engine server.
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### availableContextIdKeys
|
|
16
16
|
|
|
17
|
-
`
|
|
17
|
+
`object`[]
|
|
18
18
|
|
|
19
19
|
The context ID keys.
|
|
20
20
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Function: constructCliCommand()
|
|
2
|
+
|
|
3
|
+
> **constructCliCommand**(`processEnv`, `cliArgs`): [`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
|
|
4
|
+
|
|
5
|
+
Construct the CLI command from the parsed arguments.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### processEnv
|
|
10
|
+
|
|
11
|
+
The environment variables from the process.
|
|
12
|
+
|
|
13
|
+
### cliArgs
|
|
14
|
+
|
|
15
|
+
[`ICliArgs`](../interfaces/ICliArgs.md)
|
|
16
|
+
|
|
17
|
+
The parsed CLI arguments.
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
[`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
|
|
22
|
+
|
|
23
|
+
The constructed CLI command.
|
|
24
|
+
|
|
25
|
+
## Throws
|
|
26
|
+
|
|
27
|
+
GeneralError if the command is missing.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Function: executeCommand()
|
|
2
|
+
|
|
3
|
+
> **executeCommand**(`engineCore`, `envVars`, `cliCommand`): `Promise`\<`void`\>
|
|
4
|
+
|
|
5
|
+
Execute the CLI command.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### engineCore
|
|
10
|
+
|
|
11
|
+
`IEngineCore`
|
|
12
|
+
|
|
13
|
+
The engine core.
|
|
14
|
+
|
|
15
|
+
### envVars
|
|
16
|
+
|
|
17
|
+
[`INodeEnvironmentVariables`](../interfaces/INodeEnvironmentVariables.md)
|
|
18
|
+
|
|
19
|
+
The environment variables for the node.
|
|
20
|
+
|
|
21
|
+
### cliCommand
|
|
22
|
+
|
|
23
|
+
[`ICliCommand`](../interfaces/ICliCommand.md)
|
|
24
|
+
|
|
25
|
+
The CLI command to execute.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: getEnvDefaults()
|
|
2
|
+
|
|
3
|
+
> **getEnvDefaults**(`envPrefix`): `object`
|
|
4
|
+
|
|
5
|
+
Get the default environment variables for the node.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### envPrefix
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
The environment variable prefix.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`object`
|
|
18
|
+
|
|
19
|
+
The default environment variables.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Function: initCli()
|
|
2
|
+
|
|
3
|
+
> **initCli**(`processEnv`, `args?`): [`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
|
|
4
|
+
|
|
5
|
+
Initialise the CLI.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### processEnv
|
|
10
|
+
|
|
11
|
+
The environment variables from the process.
|
|
12
|
+
|
|
13
|
+
### args?
|
|
14
|
+
|
|
15
|
+
`string`[]
|
|
16
|
+
|
|
17
|
+
The command line arguments.
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
[`ICliCommand`](../interfaces/ICliCommand.md) \| `undefined`
|
|
22
|
+
|
|
23
|
+
The constructed CLI command if there is one.
|
|
24
|
+
|
|
25
|
+
## Throws
|
|
26
|
+
|
|
27
|
+
GeneralError if the command is missing or invalid.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: parseCommandLineArgs()
|
|
2
|
+
|
|
3
|
+
> **parseCommandLineArgs**(`args?`): [`ICliArgs`](../interfaces/ICliArgs.md)
|
|
4
|
+
|
|
5
|
+
Parse command line arguments.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### args?
|
|
10
|
+
|
|
11
|
+
`string`[]
|
|
12
|
+
|
|
13
|
+
The command line arguments.
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`ICliArgs`](../interfaces/ICliArgs.md)
|
|
18
|
+
|
|
19
|
+
The parsed command line arguments.
|