@twin.org/node-core 0.0.3-next.6 → 0.0.3-next.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +3 -1
  2. package/dist/es/builders/engineEnvBuilder.js +538 -213
  3. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  4. package/dist/es/builders/engineServerEnvBuilder.js +86 -39
  5. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
  6. package/dist/es/builders/extensionsBuilder.js +3 -3
  7. package/dist/es/builders/extensionsBuilder.js.map +1 -1
  8. package/dist/es/cli.js +254 -0
  9. package/dist/es/cli.js.map +1 -0
  10. package/dist/es/commands/bootstrapLegacy.js +311 -0
  11. package/dist/es/commands/bootstrapLegacy.js.map +1 -0
  12. package/dist/es/commands/help.js +86 -0
  13. package/dist/es/commands/help.js.map +1 -0
  14. package/dist/es/commands/identityCreate.js +377 -0
  15. package/dist/es/commands/identityCreate.js.map +1 -0
  16. package/dist/es/commands/identityImports.js +83 -0
  17. package/dist/es/commands/identityImports.js.map +1 -0
  18. package/dist/es/commands/identityVerifiableCredentialCreate.js +146 -0
  19. package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
  20. package/dist/es/commands/identityVerificationMethodCreate.js +230 -0
  21. package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
  22. package/dist/es/commands/identityVerificationMethodImport.js +127 -0
  23. package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
  24. package/dist/es/commands/nodeSetIdentity.js +69 -0
  25. package/dist/es/commands/nodeSetIdentity.js.map +1 -0
  26. package/dist/es/commands/removeTenantOrgAlias.js +83 -0
  27. package/dist/es/commands/removeTenantOrgAlias.js.map +1 -0
  28. package/dist/es/commands/setNodeOrgId.js +62 -0
  29. package/dist/es/commands/setNodeOrgId.js.map +1 -0
  30. package/dist/es/commands/setTenantOrgId.js +99 -0
  31. package/dist/es/commands/setTenantOrgId.js.map +1 -0
  32. package/dist/es/commands/tenantCreate.js +165 -0
  33. package/dist/es/commands/tenantCreate.js.map +1 -0
  34. package/dist/es/commands/tenantImport.js +108 -0
  35. package/dist/es/commands/tenantImport.js.map +1 -0
  36. package/dist/es/commands/tenantUpdate.js +108 -0
  37. package/dist/es/commands/tenantUpdate.js.map +1 -0
  38. package/dist/es/commands/userCreate.js +239 -0
  39. package/dist/es/commands/userCreate.js.map +1 -0
  40. package/dist/es/commands/userUpdate.js +154 -0
  41. package/dist/es/commands/userUpdate.js.map +1 -0
  42. package/dist/es/commands/vaultKeyCreate.js +191 -0
  43. package/dist/es/commands/vaultKeyCreate.js.map +1 -0
  44. package/dist/es/commands/vaultKeyImport.js +105 -0
  45. package/dist/es/commands/vaultKeyImport.js.map +1 -0
  46. package/dist/es/defaults.js +37 -2
  47. package/dist/es/defaults.js.map +1 -1
  48. package/dist/es/index.js +11 -4
  49. package/dist/es/index.js.map +1 -1
  50. package/dist/es/models/ICliArgs.js +4 -0
  51. package/dist/es/models/ICliArgs.js.map +1 -0
  52. package/dist/es/models/ICliCommand.js +2 -0
  53. package/dist/es/models/ICliCommand.js.map +1 -0
  54. package/dist/es/models/ICliCommandDefinition.js +2 -0
  55. package/dist/es/models/ICliCommandDefinition.js.map +1 -0
  56. package/dist/es/models/ICliCommandDefinitionParam.js +2 -0
  57. package/dist/es/models/ICliCommandDefinitionParam.js.map +1 -0
  58. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  59. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
  60. package/dist/es/models/INodeEngineState.js.map +1 -1
  61. package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
  62. package/dist/es/models/INodeOptions.js.map +1 -1
  63. package/dist/es/models/cliCommandParamType.js +4 -0
  64. package/dist/es/models/cliCommandParamType.js.map +1 -0
  65. package/dist/es/models/nodeExtensionInitialiseEngineMethod.js +2 -0
  66. package/dist/es/models/nodeExtensionInitialiseEngineMethod.js.map +1 -0
  67. package/dist/es/models/nodeExtensionInitialiseEngineServerMethod.js +2 -0
  68. package/dist/es/models/nodeExtensionInitialiseEngineServerMethod.js.map +1 -0
  69. package/dist/es/models/nodeExtensionInitialiseMethod.js +2 -0
  70. package/dist/es/models/nodeExtensionInitialiseMethod.js.map +1 -0
  71. package/dist/es/models/nodeExtensionShutdownMethod.js +4 -0
  72. package/dist/es/models/nodeExtensionShutdownMethod.js.map +1 -0
  73. package/dist/es/node.js +87 -40
  74. package/dist/es/node.js.map +1 -1
  75. package/dist/es/start.js +189 -0
  76. package/dist/es/start.js.map +1 -0
  77. package/dist/es/utils.js +24 -27
  78. package/dist/es/utils.js.map +1 -1
  79. package/dist/types/builders/engineEnvBuilder.d.ts +60 -5
  80. package/dist/types/builders/engineServerEnvBuilder.d.ts +11 -2
  81. package/dist/types/builders/extensionsBuilder.d.ts +3 -3
  82. package/dist/types/cli.d.ts +56 -0
  83. package/dist/types/commands/bootstrapLegacy.d.ts +67 -0
  84. package/dist/types/commands/help.d.ts +24 -0
  85. package/dist/types/commands/identityCreate.d.ts +45 -0
  86. package/dist/types/commands/identityImports.d.ts +25 -0
  87. package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
  88. package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
  89. package/dist/types/commands/identityVerificationMethodImport.d.ts +32 -0
  90. package/dist/types/commands/nodeSetIdentity.d.ts +23 -0
  91. package/dist/types/commands/removeTenantOrgAlias.d.ts +24 -0
  92. package/dist/types/commands/setNodeOrgId.d.ts +24 -0
  93. package/dist/types/commands/setTenantOrgId.d.ts +38 -0
  94. package/dist/types/commands/tenantCreate.d.ts +41 -0
  95. package/dist/types/commands/tenantImport.d.ts +29 -0
  96. package/dist/types/commands/tenantUpdate.d.ts +29 -0
  97. package/dist/types/commands/userCreate.d.ts +51 -0
  98. package/dist/types/commands/userUpdate.d.ts +40 -0
  99. package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
  100. package/dist/types/commands/vaultKeyImport.d.ts +29 -0
  101. package/dist/types/defaults.d.ts +30 -2
  102. package/dist/types/index.d.ts +11 -4
  103. package/dist/types/models/ICliArgs.d.ts +20 -0
  104. package/dist/types/models/ICliCommand.d.ts +17 -0
  105. package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
  106. package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
  107. package/dist/types/models/IEngineEnvironmentVariables.d.ts +168 -95
  108. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +8 -0
  109. package/dist/types/models/INodeEngineState.d.ts +2 -9
  110. package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
  111. package/dist/types/models/INodeOptions.d.ts +6 -2
  112. package/dist/types/models/cliCommandParamType.d.ts +4 -0
  113. package/dist/types/models/nodeExtensionInitialiseEngineMethod.d.ts +8 -0
  114. package/dist/types/models/nodeExtensionInitialiseEngineServerMethod.d.ts +9 -0
  115. package/dist/types/models/nodeExtensionInitialiseMethod.d.ts +9 -0
  116. package/dist/types/models/nodeExtensionShutdownMethod.d.ts +6 -0
  117. package/dist/types/node.d.ts +5 -4
  118. package/dist/types/{server.d.ts → start.d.ts} +4 -2
  119. package/dist/types/utils.d.ts +9 -10
  120. package/docs/changelog.md +675 -180
  121. package/docs/examples.md +99 -1
  122. package/docs/reference/functions/buildConfiguration.md +1 -1
  123. package/docs/reference/functions/buildEngineConfiguration.md +1 -7
  124. package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
  125. package/docs/reference/functions/constructCliCommand.md +27 -0
  126. package/docs/reference/functions/executeCommand.md +29 -0
  127. package/docs/reference/functions/extensionsInitialiseEngine.md +1 -1
  128. package/docs/reference/functions/extensionsInitialiseEngineServer.md +1 -1
  129. package/docs/reference/functions/getEnvDefaults.md +19 -0
  130. package/docs/reference/functions/getScriptDirectory.md +19 -0
  131. package/docs/reference/functions/initialiseLocales.md +2 -0
  132. package/docs/reference/functions/isAuthEntityStorageRequired.md +20 -0
  133. package/docs/reference/functions/isAutomationRequired.md +20 -0
  134. package/docs/reference/functions/isBackgroundTasksRequired.md +20 -0
  135. package/docs/reference/functions/isFederatedCatalogueRequired.md +20 -0
  136. package/docs/reference/functions/isImmutableProofRequired.md +20 -0
  137. package/docs/reference/functions/isRightsManagementRequired.md +23 -0
  138. package/docs/reference/functions/isTaskSchedulerRequired.md +20 -0
  139. package/docs/reference/functions/isTelemetryRequired.md +20 -0
  140. package/docs/reference/functions/isTrustRequired.md +20 -0
  141. package/docs/reference/functions/loadJsonFile.md +1 -1
  142. package/docs/reference/functions/loadTextFile.md +1 -1
  143. package/docs/reference/functions/parseCommandLineArgs.md +19 -0
  144. package/docs/reference/functions/processEnvOptions.md +27 -0
  145. package/docs/reference/functions/registerCommands.md +9 -0
  146. package/docs/reference/functions/resolvePackageEntryPoint.md +2 -2
  147. package/docs/reference/functions/run.md +8 -2
  148. package/docs/reference/functions/shutdownExtensions.md +1 -1
  149. package/docs/reference/functions/start.md +9 -3
  150. package/docs/reference/functions/substituteEnvOptions.md +25 -0
  151. package/docs/reference/index.md +24 -14
  152. package/docs/reference/interfaces/ICacheMetadata.md +3 -3
  153. package/docs/reference/interfaces/ICliArgs.md +35 -0
  154. package/docs/reference/interfaces/ICliCommand.md +23 -0
  155. package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
  156. package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
  157. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +488 -359
  158. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +652 -431
  159. package/docs/reference/interfaces/IModuleProtocol.md +3 -3
  160. package/docs/reference/interfaces/INodeEngineState.md +6 -21
  161. package/docs/reference/interfaces/INodeEnvironmentVariables.md +661 -516
  162. package/docs/reference/interfaces/INodeOptions.md +44 -36
  163. package/docs/reference/interfaces/IProtocolHandlerResult.md +2 -2
  164. package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
  165. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +3 -1
  166. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +3 -1
  167. package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +3 -1
  168. package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +3 -1
  169. package/docs/reference/variables/ATTESTATION_VERIFICATION_METHOD_ID.md +2 -0
  170. package/docs/reference/variables/AUTH_SIGNING_KEY_ID.md +2 -0
  171. package/docs/reference/variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md +2 -0
  172. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_DID.md +2 -0
  173. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md +2 -0
  174. package/docs/reference/variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +2 -0
  175. package/docs/reference/variables/ModuleProtocol.md +5 -5
  176. package/docs/reference/variables/TRUST_VERIFICATION_METHOD_ID.md +5 -0
  177. package/locales/en.json +674 -30
  178. package/package.json +10 -6
  179. package/dist/es/bootstrap.js +0 -366
  180. package/dist/es/bootstrap.js.map +0 -1
  181. package/dist/es/identity.js +0 -182
  182. package/dist/es/identity.js.map +0 -1
  183. package/dist/es/models/nodeExtensionMethods.js +0 -2
  184. package/dist/es/models/nodeExtensionMethods.js.map +0 -1
  185. package/dist/es/models/nodeFeatures.js +0 -21
  186. package/dist/es/models/nodeFeatures.js.map +0 -1
  187. package/dist/es/server.js +0 -81
  188. package/dist/es/server.js.map +0 -1
  189. package/dist/types/bootstrap.d.ts +0 -68
  190. package/dist/types/identity.d.ts +0 -14
  191. package/dist/types/models/nodeExtensionMethods.d.ts +0 -27
  192. package/dist/types/models/nodeFeatures.d.ts +0 -21
  193. package/docs/detailed-guide.md +0 -129
  194. package/docs/reference/functions/bootstrap.md +0 -29
  195. package/docs/reference/functions/bootstrapAuth.md +0 -35
  196. package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
  197. package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
  198. package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
  199. package/docs/reference/functions/bootstrapNodeId.md +0 -35
  200. package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
  201. package/docs/reference/functions/bootstrapTenantId.md +0 -35
  202. package/docs/reference/functions/getFeatures.md +0 -19
  203. package/docs/reference/type-aliases/NodeFeatures.md +0 -5
  204. package/docs/reference/variables/NodeFeatures.md +0 -25
  205. package/docs/reference/variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md +0 -3
  206. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
@@ -0,0 +1,67 @@
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 getCommandDefinitionBootstrapLegacy(commandDefinitions: {
11
+ [id: string]: ICliCommandDefinition;
12
+ }): void;
13
+ /**
14
+ * Command for legacy bootstrap.
15
+ * @param engineCore The engine core.
16
+ * @param envVars The environment variables for the node.
17
+ * @param params The parameters for the command.
18
+ * @returns A promise that resolves when the bootstrap sequence has completed.
19
+ */
20
+ export declare function bootstrapLegacy(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables & {
21
+ /**
22
+ * The features that are enabled on the node.
23
+ * @default []
24
+ */
25
+ features?: string;
26
+ /**
27
+ * The identity of the node which, if empty and node-identity feature is enabled it will be generated.
28
+ */
29
+ nodeIdentity?: string;
30
+ /**
31
+ * The mnemonic for the node identity, if empty it will be randomly generated.
32
+ */
33
+ nodeMnemonic?: string;
34
+ /**
35
+ * A tenant id to use as a default for the node.
36
+ */
37
+ tenantId?: string;
38
+ /**
39
+ * A tenant api key to use as a default for the node.
40
+ */
41
+ tenantApiKey?: string;
42
+ /**
43
+ * The organisation identity. If not provided it will be generated.
44
+ */
45
+ organizationIdentity?: string;
46
+ /**
47
+ * The mnemonic for the organisation identity, if empty it will be randomly generated.
48
+ */
49
+ organizationMnemonic?: string;
50
+ /**
51
+ * If the admin-user feature is enabled, this will be the identity of the user. If not provided it will be generated.
52
+ */
53
+ adminUserIdentity?: string;
54
+ /**
55
+ * The mnemonic for the admin user, if empty it will be randomly generated.
56
+ */
57
+ adminUserMnemonic?: string;
58
+ /**
59
+ * If the admin-user feature is enabled, this will be the name of the user.
60
+ * @default admin@node
61
+ */
62
+ adminUserName?: string;
63
+ /**
64
+ * If the admin-user feature is enabled, this will be the password of the user. If empty it will be randomly generated.
65
+ */
66
+ adminUserPassword?: string;
67
+ }, params: {}): Promise<void>;
@@ -0,0 +1,24 @@
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 getCommandDefinitionHelp(commandDefinitions: {
9
+ [id: string]: ICliCommandDefinition;
10
+ }): void;
11
+ /**
12
+ * Command for displaying help information.
13
+ * @param engineCore The engine core.
14
+ * @param envVars The environment variables for the node.
15
+ * @param params The command parameters.
16
+ * @param params.command The command to display help for.
17
+ * @param commandDefinitions The registered command definitions.
18
+ * @returns A promise that resolves when help output has been displayed.
19
+ */
20
+ export declare function help(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
21
+ command?: string;
22
+ }, commandDefinitions: {
23
+ [id: string]: ICliCommandDefinition;
24
+ }): Promise<void>;
@@ -0,0 +1,45 @@
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 getCommandDefinitionIdentityCreate(commandDefinitions: {
11
+ [id: string]: ICliCommandDefinition;
12
+ }): void;
13
+ /**
14
+ * Command for creating an identity.
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.mnemonic The mnemonic to use for the identity.
19
+ * @param params.identity The DID of the identity to create.
20
+ * @param params.controller The controller DID for the identity.
21
+ * @param params.fundWallet Whether to fund the wallet associated with the identity from a faucet.
22
+ * @param params.nodeId If true, set the created DID as the node identity.
23
+ * @param params.nodeOrganizationId If true, set the created DID as the node organization ID.
24
+ * @param params.tenantOrganizationId The tenant ID to set the created DID as the organization ID for.
25
+ * @param params.outputJson The output .json file to store the command output.
26
+ * @param params.outputEnv The output .env file to store the command output.
27
+ * @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
28
+ * @returns The identity details.
29
+ */
30
+ export declare function identityCreate(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
31
+ mnemonic?: string;
32
+ identity?: string;
33
+ controller?: string;
34
+ fundWallet?: boolean;
35
+ nodeId?: boolean;
36
+ nodeOrganizationId?: boolean;
37
+ tenantOrganizationId?: string;
38
+ outputJson?: string;
39
+ outputEnv?: string;
40
+ outputEnvPrefix?: string;
41
+ }): Promise<{
42
+ mnemonic: string;
43
+ did: string;
44
+ walletAddress?: string;
45
+ }>;
@@ -0,0 +1,25 @@
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 getCommandDefinitionIdentityImport(commandDefinitions: {
11
+ [id: string]: ICliCommandDefinition;
12
+ }): void;
13
+ /**
14
+ * Command for importing an identity.
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 of the identity to import.
19
+ * @param params.mnemonic The mnemonic to use for the identity.
20
+ * @returns A promise that resolves when the identity mnemonic has been stored in the vault.
21
+ */
22
+ export declare function identityImport(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
23
+ identity?: string;
24
+ mnemonic?: string;
25
+ }): Promise<void>;
@@ -0,0 +1,43 @@
1
+ import type { IEngineCore } from "@twin.org/engine-models";
2
+ import type { IDidVerifiableCredential } from "@twin.org/standards-w3c-did";
3
+ import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
4
+ import type { INodeEngineConfig } from "../models/INodeEngineConfig.js";
5
+ import type { INodeEngineState } from "../models/INodeEngineState.js";
6
+ import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
7
+ /**
8
+ * Get the command definition parameters.
9
+ * @param commandDefinitions The registered command definitions.
10
+ */
11
+ export declare function getCommandDefinitionIdentityVerifiableCredentialCreate(commandDefinitions: {
12
+ [id: string]: ICliCommandDefinition;
13
+ }): void;
14
+ /**
15
+ * Command for creating an identity verifiable credential.
16
+ * @param engineCore The engine core.
17
+ * @param envVars The environment variables for the node.
18
+ * @param params The parameters for the command.
19
+ * @param params.verificationMethodId The ID of the verification method to create the credential with.
20
+ * @param params.identity The DID of the identity to create the credential for.
21
+ * @param params.controller The controller DID for the identity.
22
+ * @param params.subjectJson The subject JSON file for the verifiable credential.
23
+ * @param params.credentialId The ID of the verifiable credential.
24
+ * @param params.expirationDate The expiration date of the verifiable credential.
25
+ * @param params.outputJson The output .json file to store the command output.
26
+ * @param params.outputEnv The output .env file to store the command output.
27
+ * @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
28
+ * @returns The created verifiable credential and JWT.
29
+ */
30
+ export declare function identityVerifiableCredentialCreate(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
31
+ verificationMethodId?: string;
32
+ identity?: string;
33
+ controller?: string;
34
+ subjectJson?: string;
35
+ credentialId?: string;
36
+ expirationDate?: string;
37
+ outputJson?: string;
38
+ outputEnv?: string;
39
+ outputEnvPrefix?: string;
40
+ }): Promise<{
41
+ verifiableCredential: IDidVerifiableCredential;
42
+ jwt: string;
43
+ }>;
@@ -0,0 +1,47 @@
1
+ import type { IEngineCore } from "@twin.org/engine-models";
2
+ import { DidVerificationMethodType } from "@twin.org/standards-w3c-did";
3
+ import { type IJwk } from "@twin.org/web";
4
+ import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
5
+ import type { INodeEngineConfig } from "../models/INodeEngineConfig.js";
6
+ import type { INodeEngineState } from "../models/INodeEngineState.js";
7
+ import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
8
+ /**
9
+ * Get the command definition parameters.
10
+ * @param commandDefinitions The registered command definitions.
11
+ */
12
+ export declare function getCommandDefinitionIdentityVerificationMethodCreate(commandDefinitions: {
13
+ [id: string]: ICliCommandDefinition;
14
+ }): void;
15
+ /**
16
+ * Command for creating an identity verification method.
17
+ * @param engineCore The engine core.
18
+ * @param envVars The environment variables for the node.
19
+ * @param params The parameters for the command.
20
+ * @param params.identity The DID of the identity to create.
21
+ * @param params.verificationMethodType The type of verification method to create.
22
+ * @param params.verificationMethodId The ID of the verification method to create.
23
+ * @param params.controller The controller DID for the identity.
24
+ * @param params.overwriteMode The mode to use when a verification method with the same ID already exists.
25
+ * @param params.outputJson The output .json file to store the command output.
26
+ * @param params.outputEnv The output .env file to store the command output.
27
+ * @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
28
+ * @returns The created verification method details or undefined if skipped.
29
+ */
30
+ export declare function identityVerificationMethodCreate(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
31
+ identity?: string;
32
+ verificationMethodType?: DidVerificationMethodType;
33
+ verificationMethodId?: string;
34
+ controller?: string;
35
+ overwriteMode?: "skip" | "overwrite" | "error";
36
+ outputJson?: string;
37
+ outputEnv?: string;
38
+ outputEnvPrefix?: string;
39
+ }): Promise<{
40
+ verificationMethodId: string;
41
+ verificationMethodType: string;
42
+ privateKeyJwk: IJwk;
43
+ privateKeyHex: string;
44
+ publicKeyHex: string;
45
+ privateKeyBase64: string;
46
+ publicKeyBase64: string;
47
+ } | undefined>;
@@ -0,0 +1,32 @@
1
+ import type { IEngineCore } from "@twin.org/engine-models";
2
+ import { DidVerificationMethodType } from "@twin.org/standards-w3c-did";
3
+ import type { ICliCommandDefinition } from "../models/ICliCommandDefinition.js";
4
+ import type { INodeEngineConfig } from "../models/INodeEngineConfig.js";
5
+ import type { INodeEngineState } from "../models/INodeEngineState.js";
6
+ import type { INodeEnvironmentVariables } from "../models/INodeEnvironmentVariables.js";
7
+ /**
8
+ * Get the command definition parameters.
9
+ * @param commandDefinitions The registered command definitions.
10
+ */
11
+ export declare function getCommandDefinitionIdentityVerificationMethodImport(commandDefinitions: {
12
+ [id: string]: ICliCommandDefinition;
13
+ }): void;
14
+ /**
15
+ * Command for importing an existing key as a verification method on an identity document.
16
+ * @param engineCore The engine core.
17
+ * @param envVars The environment variables for the node.
18
+ * @param params The parameters for the command.
19
+ * @param params.identity The DID of the identity to create.
20
+ * @param params.verificationMethodType The type of verification method to create.
21
+ * @param params.verificationMethodId The ID of the verification method to create.
22
+ * @param params.controller The controller DID for the identity.
23
+ * @param params.privateKeyHex The private key in hex format.
24
+ * @returns A promise that resolves when the verification method has been imported.
25
+ */
26
+ export declare function identityVerificationMethodImport(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
27
+ identity?: string;
28
+ verificationMethodType?: DidVerificationMethodType;
29
+ verificationMethodId?: string;
30
+ controller?: string;
31
+ privateKeyHex?: string;
32
+ }): Promise<void>;
@@ -0,0 +1,23 @@
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 getCommandDefinitionNodeSetIdentity(commandDefinitions: {
11
+ [id: string]: ICliCommandDefinition;
12
+ }): void;
13
+ /**
14
+ * Command for setting a node identity.
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 set for the node.
19
+ * @returns A promise that resolves when the node identity has been persisted.
20
+ */
21
+ export declare function nodeSetIdentity(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
22
+ identity?: string;
23
+ }): Promise<void>;
@@ -0,0 +1,24 @@
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 getCommandDefinitionRemoveTenantOrgAlias(commandDefinitions: {
9
+ [id: string]: ICliCommandDefinition;
10
+ }): void;
11
+ /**
12
+ * Command for removing an alias from the tenant organization ID legacy list.
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.tenantId The tenant ID to update.
17
+ * @param params.alias The alias to remove from the legacy list.
18
+ * @returns A promise that resolves when the alias has been removed.
19
+ * @throws GeneralError if the tenant admin component is not registered, or the alias is not found.
20
+ */
21
+ export declare function removeTenantOrgAlias(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
22
+ tenantId?: string;
23
+ alias?: string;
24
+ }): Promise<void>;
@@ -0,0 +1,24 @@
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 getCommandDefinitionSetNodeOrgId(commandDefinitions: {
11
+ [id: string]: ICliCommandDefinition;
12
+ }): void;
13
+ /**
14
+ * Command for setting the node organization ID.
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.organizationId The organization ID to set.
19
+ * @returns A promise that resolves when the node organization ID has been persisted.
20
+ * @throws GeneralError if called while multi-tenant mode is enabled.
21
+ */
22
+ export declare function setNodeOrgId(engineCore: IEngineCore<INodeEngineConfig, INodeEngineState>, envVars: INodeEnvironmentVariables, params: {
23
+ organizationId?: string;
24
+ }): Promise<void>;
@@ -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 getCommandDefinitionSetTenantOrgId(commandDefinitions: {
9
+ [id: string]: ICliCommandDefinition;
10
+ }): void;
11
+ /**
12
+ * Command for setting the organization ID on 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.tenantId The tenant ID to update.
17
+ * @param params.organizationId The organization ID to set.
18
+ * @returns A promise that resolves when the tenant organization ID has been stored.
19
+ */
20
+ export declare function setTenantOrgId(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
21
+ tenantId?: string;
22
+ organizationId?: string;
23
+ }): Promise<void>;
24
+ /**
25
+ * Apply a new organization ID to a tenant.
26
+ * @param engineCore The engine core used to look up the tenantAdminComponent.
27
+ * @param tenantId The ID of the tenant to update.
28
+ * @param newOrganizationId The new organization DID to set.
29
+ * @param options Optional display and behaviour overrides.
30
+ * @param options.sectionLabel When set, emits a CLI section header before and done marker after.
31
+ * @param options.required When false, returns silently when the component is not registered (default true).
32
+ * @returns A promise that resolves when the tenant record has been updated.
33
+ * @throws GeneralError if the component is required but not registered.
34
+ */
35
+ export declare function applyOrganizationIdToTenant(engineCore: IEngineCore, tenantId: string, newOrganizationId: string, options?: {
36
+ sectionLabel?: string;
37
+ required?: boolean;
38
+ }): Promise<void>;
@@ -0,0 +1,41 @@
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.organizationId The organization DID to associate with the tenant.
19
+ * @param params.label The label for the api key.
20
+ * @param params.publicOrigin The public URL origin for the tenant.
21
+ * @param params.outputJson The output .json file to store the command output.
22
+ * @param params.outputEnv The output .env file to store the command output.
23
+ * @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
24
+ * @returns The created tenant details.
25
+ */
26
+ export declare function tenantCreate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
27
+ apiKey?: string;
28
+ tenantId?: string;
29
+ organizationId?: string;
30
+ label?: string;
31
+ publicOrigin?: string;
32
+ outputJson?: string;
33
+ outputEnv?: string;
34
+ outputEnvPrefix?: string;
35
+ }): Promise<{
36
+ apiKey: string;
37
+ tenantId: string;
38
+ organizationId?: string;
39
+ label: string;
40
+ publicOrigin: string;
41
+ }>;
@@ -0,0 +1,29 @@
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 with a known tenant ID and API key.
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.
18
+ * @param params.organizationId The organization DID to associate with the tenant.
19
+ * @param params.label The label for the tenant.
20
+ * @param params.publicOrigin The public URL origin for the tenant.
21
+ * @returns A promise that resolves when the tenant record has been created.
22
+ */
23
+ export declare function tenantImport(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
24
+ apiKey?: string;
25
+ tenantId?: string;
26
+ organizationId?: string;
27
+ label?: string;
28
+ publicOrigin?: string;
29
+ }): Promise<void>;
@@ -0,0 +1,29 @@
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.
18
+ * @param params.organizationId The organization DID to associate with the tenant.
19
+ * @param params.label The label for the tenant.
20
+ * @param params.publicOrigin The public URL origin for the tenant.
21
+ * @returns A promise that resolves when the tenant record has been updated.
22
+ */
23
+ export declare function tenantUpdate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
24
+ apiKey?: string;
25
+ tenantId?: string;
26
+ organizationId?: string;
27
+ label?: string;
28
+ publicOrigin?: string;
29
+ }): Promise<void>;
@@ -0,0 +1,51 @@
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.tenantId The tenant ID for the user.
19
+ * @param params.email The email for the user.
20
+ * @param params.password The password for the user.
21
+ * @param params.scope The scope for the user.
22
+ * @param params.givenName The given name for the user.
23
+ * @param params.familyName The family name for the user.
24
+ * @param params.overwriteMode The mode to use when a user with the same identity already exists.
25
+ * @param params.outputJson The output .json file to store the command output.
26
+ * @param params.outputEnv The output .env file to store the command output.
27
+ * @param params.outputEnvPrefix The prefix to use for variables in the output .env file.
28
+ * @returns The created user details or undefined if skipped.
29
+ */
30
+ export declare function userCreate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
31
+ userIdentity?: string;
32
+ organizationIdentity?: string;
33
+ tenantId?: string;
34
+ email?: string;
35
+ password?: string;
36
+ scope?: string;
37
+ givenName?: string;
38
+ familyName?: string;
39
+ overwriteMode?: "skip" | "overwrite" | "error";
40
+ outputJson?: string;
41
+ outputEnv?: string;
42
+ outputEnvPrefix?: string;
43
+ }): Promise<{
44
+ did: string;
45
+ organizationDid: string;
46
+ email: string;
47
+ password: string;
48
+ scope: string[];
49
+ givenName: string;
50
+ familyName: string;
51
+ } | undefined>;
@@ -0,0 +1,40 @@
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 updating 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.tenantId The tenant ID for the user.
19
+ * @param params.email The email 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
+ * @returns The updated user details or undefined if skipped.
24
+ */
25
+ export declare function userUpdate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
26
+ userIdentity?: string;
27
+ organizationIdentity?: string;
28
+ tenantId?: string;
29
+ email?: string;
30
+ scope?: string;
31
+ givenName?: string;
32
+ familyName?: string;
33
+ }): Promise<{
34
+ did: string;
35
+ organizationDid: string;
36
+ email: string;
37
+ scope: string[];
38
+ givenName: string;
39
+ familyName: string;
40
+ } | 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>;