@twin.org/node-core 0.0.3-next.2 → 0.0.3-next.21
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 +168 -105
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +49 -25
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/cli.js +247 -0
- package/dist/es/cli.js.map +1 -0
- package/dist/es/commands/bootstrapLegacy.js +183 -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 +316 -0
- package/dist/es/commands/identityCreate.js.map +1 -0
- package/dist/es/commands/identityImports.js +82 -0
- package/dist/es/commands/identityImports.js.map +1 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js +146 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodCreate.js +214 -0
- package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
- package/dist/es/commands/identityVerificationMethodImport.js +126 -0
- package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
- package/dist/es/commands/nodeSetIdentity.js +64 -0
- package/dist/es/commands/nodeSetIdentity.js.map +1 -0
- package/dist/es/commands/nodeSetTenant.js +68 -0
- package/dist/es/commands/nodeSetTenant.js.map +1 -0
- package/dist/es/commands/tenantCreate.js +139 -0
- package/dist/es/commands/tenantCreate.js.map +1 -0
- package/dist/es/commands/tenantImport.js +97 -0
- package/dist/es/commands/tenantImport.js.map +1 -0
- package/dist/es/commands/tenantUpdate.js +94 -0
- package/dist/es/commands/tenantUpdate.js.map +1 -0
- package/dist/es/commands/userCreate.js +212 -0
- package/dist/es/commands/userCreate.js.map +1 -0
- package/dist/es/commands/userUpdate.js +132 -0
- package/dist/es/commands/userUpdate.js.map +1 -0
- package/dist/es/commands/vaultKeyCreate.js +191 -0
- package/dist/es/commands/vaultKeyCreate.js.map +1 -0
- package/dist/es/commands/vaultKeyImport.js +104 -0
- package/dist/es/commands/vaultKeyImport.js.map +1 -0
- package/dist/es/defaults.js +19 -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/IEngineServerEnvironmentVariables.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/INodeOptions.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 +78 -41
- package/dist/es/node.js.map +1 -1
- package/dist/es/start.js +139 -0
- package/dist/es/start.js.map +1 -0
- package/dist/es/utils.js +11 -21
- 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 +56 -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 +38 -0
- package/dist/types/commands/tenantImport.d.ts +26 -0
- package/dist/types/commands/tenantUpdate.d.ts +26 -0
- package/dist/types/commands/userCreate.d.ts +49 -0
- package/dist/types/commands/userUpdate.d.ts +38 -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 +62 -53
- package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +4 -0
- package/dist/types/models/INodeEngineState.d.ts +0 -8
- package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
- package/dist/types/models/INodeOptions.d.ts +6 -2
- package/dist/types/models/cliCommandParamType.d.ts +4 -0
- package/dist/types/node.d.ts +8 -4
- package/dist/types/{server.d.ts → start.d.ts} +7 -2
- package/dist/types/utils.d.ts +6 -8
- package/docs/changelog.md +136 -0
- package/docs/reference/functions/buildConfiguration.md +3 -3
- 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/getScriptDirectory.md +19 -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 +8 -2
- package/docs/reference/functions/start.md +10 -4
- package/docs/reference/functions/substituteEnvOptions.md +25 -0
- package/docs/reference/index.md +16 -13
- 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 +110 -85
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +166 -117
- package/docs/reference/interfaces/INodeEngineState.md +0 -16
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +170 -201
- package/docs/reference/interfaces/INodeOptions.md +10 -2
- 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/TRUST_VERIFICATION_METHOD_ID.md +3 -0
- package/locales/en.json +589 -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 -78
- 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
- package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the command definition parameters.
|
|
6
|
+
* @param commandDefinitions The registered command definitions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandDefinitionTenantCreate(commandDefinitions: {
|
|
9
|
+
[id: string]: ICliCommandDefinition;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Command for creating a tenant.
|
|
13
|
+
* @param engineCore The engine core.
|
|
14
|
+
* @param envVars The environment variables for the node.
|
|
15
|
+
* @param params The parameters for the command.
|
|
16
|
+
* @param params.apiKey The api key to add.
|
|
17
|
+
* @param params.tenantId The tenant ID to add the api key to.
|
|
18
|
+
* @param params.label The label for the api key.
|
|
19
|
+
* @param params.publicOrigin The public URL origin for the tenant.
|
|
20
|
+
* @param params.outputJson The output .json file to store the command output.
|
|
21
|
+
* @param params.outputEnv The output .env file to store the command output.
|
|
22
|
+
* @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
|
|
23
|
+
* @returns The created tenant details.
|
|
24
|
+
*/
|
|
25
|
+
export declare function tenantCreate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
26
|
+
apiKey?: string;
|
|
27
|
+
tenantId?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
publicOrigin?: string;
|
|
30
|
+
outputJson?: string;
|
|
31
|
+
outputEnv?: string;
|
|
32
|
+
outputEnvPrefix?: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
apiKey: string;
|
|
35
|
+
tenantId: string;
|
|
36
|
+
label: string;
|
|
37
|
+
publicOrigin: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the command definition parameters.
|
|
6
|
+
* @param commandDefinitions The registered command definitions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandDefinitionTenantImport(commandDefinitions: {
|
|
9
|
+
[id: string]: ICliCommandDefinition;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Command for importing a tenant.
|
|
13
|
+
* @param engineCore The engine core.
|
|
14
|
+
* @param envVars The environment variables for the node.
|
|
15
|
+
* @param params The parameters for the command.
|
|
16
|
+
* @param params.apiKey The api key to import.
|
|
17
|
+
* @param params.tenantId The tenant ID to import the api key to.
|
|
18
|
+
* @param params.label The label for the api key.
|
|
19
|
+
* @param params.publicOrigin The public URL origin for the tenant.
|
|
20
|
+
*/
|
|
21
|
+
export declare function tenantImport(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
tenantId?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
publicOrigin?: string;
|
|
26
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the command definition parameters.
|
|
6
|
+
* @param commandDefinitions The registered command definitions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandDefinitionTenantUpdate(commandDefinitions: {
|
|
9
|
+
[id: string]: ICliCommandDefinition;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Command for updating a tenant.
|
|
13
|
+
* @param engineCore The engine core.
|
|
14
|
+
* @param envVars The environment variables for the node.
|
|
15
|
+
* @param params The parameters for the command.
|
|
16
|
+
* @param params.apiKey The api key to update.
|
|
17
|
+
* @param params.tenantId The tenant ID to update the api key to.
|
|
18
|
+
* @param params.label The label for the api key.
|
|
19
|
+
* @param params.publicOrigin The public URL origin for the tenant.
|
|
20
|
+
*/
|
|
21
|
+
export declare function tenantUpdate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
tenantId?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
publicOrigin?: string;
|
|
26
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the command definition parameters.
|
|
6
|
+
* @param commandDefinitions The registered command definitions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandDefinitionUserCreate(commandDefinitions: {
|
|
9
|
+
[id: string]: ICliCommandDefinition;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Command for creating a user.
|
|
13
|
+
* @param engineCore The engine core.
|
|
14
|
+
* @param envVars The environment variables for the node.
|
|
15
|
+
* @param params The parameters for the command.
|
|
16
|
+
* @param params.userIdentity The DID for the user.
|
|
17
|
+
* @param params.organizationIdentity The organization DID for the user.
|
|
18
|
+
* @param params.email The email for the user.
|
|
19
|
+
* @param params.password The password for the user.
|
|
20
|
+
* @param params.scope The scope for the user.
|
|
21
|
+
* @param params.givenName The given name for the user.
|
|
22
|
+
* @param params.familyName The family name for the user.
|
|
23
|
+
* @param params.overwriteMode The mode to use when a user with the same identity already exists.
|
|
24
|
+
* @param params.outputJson The output .json file to store the command output.
|
|
25
|
+
* @param params.outputEnv The output .env file to store the command output.
|
|
26
|
+
* @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
|
|
27
|
+
* @returns The created user details or undefined if skipped.
|
|
28
|
+
*/
|
|
29
|
+
export declare function userCreate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
30
|
+
userIdentity?: string;
|
|
31
|
+
organizationIdentity?: string;
|
|
32
|
+
email?: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
scope?: string;
|
|
35
|
+
givenName?: string;
|
|
36
|
+
familyName?: string;
|
|
37
|
+
overwriteMode?: "skip" | "overwrite" | "error";
|
|
38
|
+
outputJson?: string;
|
|
39
|
+
outputEnv?: string;
|
|
40
|
+
outputEnvPrefix?: string;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
did: string;
|
|
43
|
+
organizationDid: string;
|
|
44
|
+
email: string;
|
|
45
|
+
password: string;
|
|
46
|
+
scope: string[];
|
|
47
|
+
givenName: string;
|
|
48
|
+
familyName: string;
|
|
49
|
+
} | undefined>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the command definition parameters.
|
|
6
|
+
* @param commandDefinitions The registered command definitions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandDefinitionUserUpdate(commandDefinitions: {
|
|
9
|
+
[id: string]: ICliCommandDefinition;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Command for creating a user.
|
|
13
|
+
* @param engineCore The engine core.
|
|
14
|
+
* @param envVars The environment variables for the node.
|
|
15
|
+
* @param params The parameters for the command.
|
|
16
|
+
* @param params.userIdentity The DID for the user.
|
|
17
|
+
* @param params.organizationIdentity The organization DID for the user.
|
|
18
|
+
* @param params.email The email for the user.
|
|
19
|
+
* @param params.scope The scope for the user.
|
|
20
|
+
* @param params.givenName The given name for the user.
|
|
21
|
+
* @param params.familyName The family name for the user.
|
|
22
|
+
* @returns The updated user details or undefined if skipped.
|
|
23
|
+
*/
|
|
24
|
+
export declare function userUpdate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
25
|
+
userIdentity?: string;
|
|
26
|
+
organizationIdentity?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
scope?: string;
|
|
29
|
+
givenName?: string;
|
|
30
|
+
familyName?: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
did: string;
|
|
33
|
+
organizationDid: string;
|
|
34
|
+
email: string;
|
|
35
|
+
scope: string[];
|
|
36
|
+
givenName: string;
|
|
37
|
+
familyName: string;
|
|
38
|
+
} | undefined>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEngineConfig } from "../models/INodeEngineConfig.js";
|
|
4
|
+
import type { INodeEngineState } from "../models/INodeEngineState.js";
|
|
5
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
6
|
+
/**
|
|
7
|
+
* Get the command definition parameters.
|
|
8
|
+
* @param commandDefinitions The registered command definitions.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCommandDefinitionVaultKeyCreate(commandDefinitions: {
|
|
11
|
+
[id: string]: ICliCommandDefinition;
|
|
12
|
+
}): void;
|
|
13
|
+
/**
|
|
14
|
+
* Command for creating a vault key.
|
|
15
|
+
* @param engineCore The engine core.
|
|
16
|
+
* @param envVars The environment variables for the node.
|
|
17
|
+
* @param params The parameters for the command.
|
|
18
|
+
* @param params.identity The DID to create the vault key for.
|
|
19
|
+
* @param params.keyId The ID of the key to create.
|
|
20
|
+
* @param params.keyType The type of key to create.
|
|
21
|
+
* @param params.overwriteMode The mode to use when a user with the same identity already exists.
|
|
22
|
+
* @param params.outputJson The output .json file to store the command output.
|
|
23
|
+
* @param params.outputEnv The output .env file to store the command output.
|
|
24
|
+
* @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
|
|
25
|
+
* @returns The created vault key details or undefined if skipped.
|
|
26
|
+
*/
|
|
27
|
+
export declare function vaultKeyCreate(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
|
|
28
|
+
identity?: string;
|
|
29
|
+
keyType?: string;
|
|
30
|
+
keyId?: string;
|
|
31
|
+
overwriteMode?: "skip" | "overwrite" | "error";
|
|
32
|
+
outputJson?: string;
|
|
33
|
+
outputEnv?: string;
|
|
34
|
+
outputEnvPrefix?: string;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
identity: string;
|
|
37
|
+
keyId: string;
|
|
38
|
+
keyType?: string;
|
|
39
|
+
privateKeyBase64?: string;
|
|
40
|
+
publicKeyBase64?: string;
|
|
41
|
+
privateKeyHex?: string;
|
|
42
|
+
publicKeyHex?: string;
|
|
43
|
+
} | undefined>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IEngineCore } from "@twin.org/engine-models";
|
|
2
|
+
import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
|
|
3
|
+
import type { INodeEngineConfig } from "../models/INodeEngineConfig.js";
|
|
4
|
+
import type { INodeEngineState } from "../models/INodeEngineState.js";
|
|
5
|
+
import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
|
|
6
|
+
/**
|
|
7
|
+
* Get the command definition parameters.
|
|
8
|
+
* @param commandDefinitions The registered command definitions.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCommandDefinitionVaultKeyImport(commandDefinitions: {
|
|
11
|
+
[id: string]: ICliCommandDefinition;
|
|
12
|
+
}): void;
|
|
13
|
+
/**
|
|
14
|
+
* Command for importing a vault key.
|
|
15
|
+
* @param engineCore The engine core.
|
|
16
|
+
* @param envVars The environment variables for the node.
|
|
17
|
+
* @param params The parameters for the command.
|
|
18
|
+
* @param params.identity The DID to create the vault key for.
|
|
19
|
+
* @param params.keyId The ID of the key to create.
|
|
20
|
+
* @param params.keyType The type of key to create.
|
|
21
|
+
* @param params.privateKeyHex The private key in hexadecimal format.
|
|
22
|
+
*/
|
|
23
|
+
export declare function vaultKeyImport(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
|
|
24
|
+
identity?: string;
|
|
25
|
+
keyType?: string;
|
|
26
|
+
keyId?: string;
|
|
27
|
+
privateKeyHex?: string;
|
|
28
|
+
}): Promise<void>;
|
package/dist/types/defaults.d.ts
CHANGED
|
@@ -2,5 +2,15 @@ export declare const ATTESTATION_VERIFICATION_METHOD_ID = "attestation-assertion
|
|
|
2
2
|
export declare const IMMUTABLE_PROOF_VERIFICATION_METHOD_ID = "immutable-proof-assertion";
|
|
3
3
|
export declare const BLOB_STORAGE_ENCRYPTION_KEY_ID = "blob-encryption";
|
|
4
4
|
export declare const SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID = "synchronised-storage-blob-encryption";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const TRUST_VERIFICATION_METHOD_ID = "trust-assertion";
|
|
6
6
|
export declare const AUTH_SIGNING_KEY_ID = "auth-signing";
|
|
7
|
+
export declare const CONTEXT_ID_HANDLER_FEATURE_DID = "did";
|
|
8
|
+
export declare const CONTEXT_ID_HANDLER_FEATURE_TENANT = "tenant";
|
|
9
|
+
/**
|
|
10
|
+
* Get the default environment variables for the node.
|
|
11
|
+
* @param envPrefix The environment variable prefix.
|
|
12
|
+
* @returns The default environment variables.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getEnvDefaults(envPrefix: string): {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export * from "./bootstrap.js";
|
|
2
1
|
export * from "./builders/engineEnvBuilder.js";
|
|
3
2
|
export * from "./builders/engineServerEnvBuilder.js";
|
|
4
3
|
export * from "./builders/extensionsBuilder.js";
|
|
4
|
+
export * from "./cli.js";
|
|
5
5
|
export * from "./defaults.js";
|
|
6
|
+
export * from "./models/cliCommandParamType.js";
|
|
6
7
|
export * from "./models/ICacheMetadata.js";
|
|
8
|
+
export * from "./models/ICliArgs.js";
|
|
9
|
+
export * from "./models/ICliCommand.js";
|
|
10
|
+
export * from "./models/ICliCommandDefinition.js";
|
|
11
|
+
export * from "./models/ICliCommandDefinitionParam.js";
|
|
7
12
|
export * from "./models/IEngineEnvironmentVariables.js";
|
|
8
13
|
export * from "./models/IEngineServerEnvironmentVariables.js";
|
|
9
14
|
export * from "./models/IModuleProtocol.js";
|
|
@@ -14,7 +19,6 @@ export * from "./models/INodeOptions.js";
|
|
|
14
19
|
export * from "./models/IProtocolHandlerResult.js";
|
|
15
20
|
export * from "./models/moduleProtocol.js";
|
|
16
21
|
export * from "./models/nodeExtensionMethods.js";
|
|
17
|
-
export * from "./models/nodeFeatures.js";
|
|
18
22
|
export * from "./node.js";
|
|
19
|
-
export * from "./
|
|
23
|
+
export * from "./start.js";
|
|
20
24
|
export * from "./utils.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command to execute in the CLI.
|
|
3
|
+
*/
|
|
4
|
+
export interface ICliArgs {
|
|
5
|
+
/**
|
|
6
|
+
* The path of the node executable.
|
|
7
|
+
*/
|
|
8
|
+
nodePath?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The path of the script to execute.
|
|
11
|
+
*/
|
|
12
|
+
scriptPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The command line options.
|
|
15
|
+
*/
|
|
16
|
+
options?: {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
@@ -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
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
tenantEnabled?: string;
|
|
21
|
-
/**
|
|
22
|
-
* A tenant id to use as a default for the node.
|
|
22
|
+
* Does the node have a unique ID, defaults to true.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
nodeIdentityEnabled?: string;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
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
|
*/
|
|
@@ -269,6 +268,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
269
268
|
* The type of the default vault connector: entity-storage, hashicorp.
|
|
270
269
|
*/
|
|
271
270
|
vaultConnector?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Prefix to prepend to entries in the vault.
|
|
273
|
+
*/
|
|
274
|
+
vaultPrefix?: string;
|
|
272
275
|
/**
|
|
273
276
|
* Hashicorp Vault token.
|
|
274
277
|
*/
|
|
@@ -281,10 +284,6 @@ export interface IEngineEnvironmentVariables {
|
|
|
281
284
|
* The type of logging task connector, can be a comma separated list: console, entity-storage.
|
|
282
285
|
*/
|
|
283
286
|
loggingConnector?: string;
|
|
284
|
-
/**
|
|
285
|
-
* The type of background task connector: entity-storage.
|
|
286
|
-
*/
|
|
287
|
-
backgroundTaskConnector?: string;
|
|
288
287
|
/**
|
|
289
288
|
* The type of event bus connector: local.
|
|
290
289
|
*/
|
|
@@ -353,6 +352,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
353
352
|
* The type of identity connector: entity-storage, iota.
|
|
354
353
|
*/
|
|
355
354
|
identityConnector?: string;
|
|
355
|
+
/**
|
|
356
|
+
* The index of the wallet address to use, defaults to 0.
|
|
357
|
+
*/
|
|
358
|
+
identityWalletAddressIndex?: string;
|
|
356
359
|
/**
|
|
357
360
|
* The type of identity resolver connector: entity-storage, iota.
|
|
358
361
|
*/
|
|
@@ -482,56 +485,71 @@ export interface IEngineEnvironmentVariables {
|
|
|
482
485
|
*/
|
|
483
486
|
federatedCatalogueEnabled?: string;
|
|
484
487
|
/**
|
|
485
|
-
* Federated catalog
|
|
488
|
+
* Federated catalog filters, command separated list of filters to add.
|
|
489
|
+
*/
|
|
490
|
+
federatedCatalogueFilters?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Is the trust management enabled, defaults to false.
|
|
493
|
+
*/
|
|
494
|
+
trustEnabled?: string;
|
|
495
|
+
/**
|
|
496
|
+
* The trust generators to add to the factory, comma separated list.
|
|
497
|
+
*/
|
|
498
|
+
trustGenerators?: string;
|
|
499
|
+
/**
|
|
500
|
+
* The trust verifiers to add to the factory, comma separated list.
|
|
486
501
|
*/
|
|
487
|
-
|
|
502
|
+
trustVerifiers?: string;
|
|
488
503
|
/**
|
|
489
|
-
*
|
|
504
|
+
* The verification method to use for trust identities.
|
|
505
|
+
* Defaults to trust-assertion.
|
|
490
506
|
*/
|
|
491
|
-
|
|
507
|
+
trustVerificationMethodId?: string;
|
|
508
|
+
/**
|
|
509
|
+
* The trust time to live for generating JWTs.
|
|
510
|
+
* Defaults to undefined for never expiring.
|
|
511
|
+
*/
|
|
512
|
+
trustJwtTtlSeconds?: string;
|
|
492
513
|
/**
|
|
493
514
|
* Is the rights management enabled, defaults to false.
|
|
494
515
|
*/
|
|
495
516
|
rightsManagementEnabled?: string;
|
|
496
517
|
/**
|
|
497
|
-
* What is the
|
|
518
|
+
* What is the callback path for rights management negotiations, will be combined with hosting public url e.g. /callback.
|
|
519
|
+
*/
|
|
520
|
+
rightsManagementCallbackPath?: string;
|
|
521
|
+
/**
|
|
522
|
+
* The rights management policy information sources to add to the factory.
|
|
498
523
|
*/
|
|
499
|
-
|
|
524
|
+
rightsManagementPolicyInformationSources?: string;
|
|
500
525
|
/**
|
|
501
|
-
* The rights management
|
|
502
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
526
|
+
* The rights management policy negotiators sources to add to the factory.
|
|
503
527
|
*/
|
|
504
|
-
|
|
528
|
+
rightsManagementPolicyNegotiators?: string;
|
|
505
529
|
/**
|
|
506
|
-
* The rights management
|
|
507
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
530
|
+
* The rights management policy requesters to add to the factory.
|
|
508
531
|
*/
|
|
509
|
-
|
|
532
|
+
rightsManagementPolicyRequesters?: string;
|
|
510
533
|
/**
|
|
511
|
-
* The rights management
|
|
512
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
534
|
+
* The rights management policy execution actions to add to the factory.
|
|
513
535
|
*/
|
|
514
|
-
|
|
536
|
+
rightsManagementPolicyExecutionActions?: string;
|
|
515
537
|
/**
|
|
516
|
-
* The rights management
|
|
517
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
538
|
+
* The rights management policy enforcement processors to add to the factory.
|
|
518
539
|
*/
|
|
519
|
-
|
|
540
|
+
rightsManagementPolicyEnforcementProcessors?: string;
|
|
520
541
|
/**
|
|
521
|
-
* The rights management
|
|
522
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
542
|
+
* The rights management policy arbiters to add to the factory.
|
|
523
543
|
*/
|
|
524
|
-
|
|
544
|
+
rightsManagementPolicyArbiters?: string;
|
|
525
545
|
/**
|
|
526
|
-
* The rights management
|
|
527
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
546
|
+
* The rights management policy obligation enforcers to add to the factory.
|
|
528
547
|
*/
|
|
529
|
-
|
|
548
|
+
rightsManagementPolicyObligationEnforcers?: string;
|
|
530
549
|
/**
|
|
531
|
-
*
|
|
532
|
-
* Use the @json: prefix to specify the path to the JSON configuration file.
|
|
550
|
+
* Are background tasks enabled, defaults to false.
|
|
533
551
|
*/
|
|
534
|
-
|
|
552
|
+
backgroundTasksEnabled?: string;
|
|
535
553
|
/**
|
|
536
554
|
* Is the task scheduler enabled, defaults to false.
|
|
537
555
|
*/
|
|
@@ -550,15 +568,6 @@ export interface IEngineEnvironmentVariables {
|
|
|
550
568
|
* @default 60
|
|
551
569
|
*/
|
|
552
570
|
dataSpaceConnectorActivityLogsCleanUpInterval?: string;
|
|
553
|
-
/**
|
|
554
|
-
* Enable verifiable credential authentication for the API.
|
|
555
|
-
*/
|
|
556
|
-
vcAuthenticationEnabled?: string;
|
|
557
|
-
/**
|
|
558
|
-
* Verifiable credential assertion for node to node communication.
|
|
559
|
-
* Defaults to node-authentication-assertion.
|
|
560
|
-
*/
|
|
561
|
-
vcAuthenticationVerificationMethodId?: string;
|
|
562
571
|
/**
|
|
563
572
|
* A comma separated list of additional node extensions to load, the initialiseExtension method will be called for each extension.
|
|
564
573
|
*/
|
|
@@ -27,6 +27,10 @@ export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVar
|
|
|
27
27
|
* The CORS headers to expose.
|
|
28
28
|
*/
|
|
29
29
|
httpExposedHeaders?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The public origin URL for the API e.g. https://api.example.com:1234
|
|
32
|
+
*/
|
|
33
|
+
publicOrigin?: string;
|
|
30
34
|
/**
|
|
31
35
|
* The type of auth admin processor to use on the API: entity-storage.
|
|
32
36
|
*/
|
|
@@ -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
|
}
|