@twin.org/node-core 0.0.3-next.8 → 0.9.0-next.1

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 (230) hide show
  1. package/README.md +3 -1
  2. package/dist/es/builders/engineEnvBuilder.js +470 -174
  3. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  4. package/dist/es/builders/engineServerEnvBuilder.js +87 -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 +312 -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 +231 -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 +13 -4
  49. package/dist/es/index.js.map +1 -1
  50. package/dist/es/models/IBootstrapLegacyEnvironmentVariables.js +4 -0
  51. package/dist/es/models/IBootstrapLegacyEnvironmentVariables.js.map +1 -0
  52. package/dist/es/models/ICliArgs.js +4 -0
  53. package/dist/es/models/ICliArgs.js.map +1 -0
  54. package/dist/es/models/ICliCommand.js +2 -0
  55. package/dist/es/models/ICliCommand.js.map +1 -0
  56. package/dist/es/models/ICliCommandDefinition.js +2 -0
  57. package/dist/es/models/ICliCommandDefinition.js.map +1 -0
  58. package/dist/es/models/ICliCommandDefinitionParam.js +2 -0
  59. package/dist/es/models/ICliCommandDefinitionParam.js.map +1 -0
  60. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
  61. package/dist/es/models/IEngineServerEnvironmentVariables.js +2 -0
  62. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
  63. package/dist/es/models/IEnvironmentVariables.js +2 -0
  64. package/dist/es/models/IEnvironmentVariables.js.map +1 -0
  65. package/dist/es/models/INodeEngineState.js.map +1 -1
  66. package/dist/es/models/INodeEnvironmentVariables.js +2 -0
  67. package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
  68. package/dist/es/models/INodeOptions.js.map +1 -1
  69. package/dist/es/models/bootstrapLegacyEnvironmentVariableKeys.js +24 -0
  70. package/dist/es/models/bootstrapLegacyEnvironmentVariableKeys.js.map +1 -0
  71. package/dist/es/models/cliCommandParamType.js +4 -0
  72. package/dist/es/models/cliCommandParamType.js.map +1 -0
  73. package/dist/es/models/engineEnvironmentVariableKeys.js +202 -0
  74. package/dist/es/models/engineEnvironmentVariableKeys.js.map +1 -0
  75. package/dist/es/models/engineServerEnvironmentVariableKeys.js +35 -0
  76. package/dist/es/models/engineServerEnvironmentVariableKeys.js.map +1 -0
  77. package/dist/es/models/nodeEnvironmentVariableKeys.js +18 -0
  78. package/dist/es/models/nodeEnvironmentVariableKeys.js.map +1 -0
  79. package/dist/es/models/nodeExtensionInitialiseEngineMethod.js +2 -0
  80. package/dist/es/models/nodeExtensionInitialiseEngineMethod.js.map +1 -0
  81. package/dist/es/models/nodeExtensionInitialiseEngineServerMethod.js +2 -0
  82. package/dist/es/models/nodeExtensionInitialiseEngineServerMethod.js.map +1 -0
  83. package/dist/es/models/nodeExtensionInitialiseMethod.js +2 -0
  84. package/dist/es/models/nodeExtensionInitialiseMethod.js.map +1 -0
  85. package/dist/es/models/nodeExtensionShutdownMethod.js +4 -0
  86. package/dist/es/models/nodeExtensionShutdownMethod.js.map +1 -0
  87. package/dist/es/node.js +180 -41
  88. package/dist/es/node.js.map +1 -1
  89. package/dist/es/start.js +189 -0
  90. package/dist/es/start.js.map +1 -0
  91. package/dist/es/utils.js +24 -27
  92. package/dist/es/utils.js.map +1 -1
  93. package/dist/types/builders/engineEnvBuilder.d.ts +60 -5
  94. package/dist/types/builders/engineServerEnvBuilder.d.ts +12 -3
  95. package/dist/types/builders/extensionsBuilder.d.ts +8 -8
  96. package/dist/types/cli.d.ts +56 -0
  97. package/dist/types/commands/bootstrapLegacy.d.ts +20 -0
  98. package/dist/types/commands/help.d.ts +24 -0
  99. package/dist/types/commands/identityCreate.d.ts +45 -0
  100. package/dist/types/commands/identityImports.d.ts +25 -0
  101. package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
  102. package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
  103. package/dist/types/commands/identityVerificationMethodImport.d.ts +32 -0
  104. package/dist/types/commands/nodeSetIdentity.d.ts +23 -0
  105. package/dist/types/commands/removeTenantOrgAlias.d.ts +24 -0
  106. package/dist/types/commands/setNodeOrgId.d.ts +24 -0
  107. package/dist/types/commands/setTenantOrgId.d.ts +38 -0
  108. package/dist/types/commands/tenantCreate.d.ts +41 -0
  109. package/dist/types/commands/tenantImport.d.ts +29 -0
  110. package/dist/types/commands/tenantUpdate.d.ts +29 -0
  111. package/dist/types/commands/userCreate.d.ts +51 -0
  112. package/dist/types/commands/userUpdate.d.ts +40 -0
  113. package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
  114. package/dist/types/commands/vaultKeyImport.d.ts +29 -0
  115. package/dist/types/defaults.d.ts +30 -2
  116. package/dist/types/index.d.ts +13 -4
  117. package/dist/types/models/IBootstrapLegacyEnvironmentVariables.d.ts +56 -0
  118. package/dist/types/models/ICliArgs.d.ts +20 -0
  119. package/dist/types/models/ICliCommand.d.ts +17 -0
  120. package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
  121. package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
  122. package/dist/types/models/IEngineEnvironmentVariables.d.ts +199 -96
  123. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +9 -2
  124. package/dist/types/models/IEnvironmentVariables.d.ts +8 -0
  125. package/dist/types/models/INodeEngineState.d.ts +2 -9
  126. package/dist/types/models/INodeEnvironmentVariables.d.ts +1 -40
  127. package/dist/types/models/INodeOptions.d.ts +9 -5
  128. package/dist/types/models/bootstrapLegacyEnvironmentVariableKeys.d.ts +4 -0
  129. package/dist/types/models/cliCommandParamType.d.ts +4 -0
  130. package/dist/types/models/engineEnvironmentVariableKeys.d.ts +4 -0
  131. package/dist/types/models/engineServerEnvironmentVariableKeys.d.ts +7 -0
  132. package/dist/types/models/nodeEnvironmentVariableKeys.d.ts +5 -0
  133. package/dist/types/models/nodeExtensionInitialiseEngineMethod.d.ts +8 -0
  134. package/dist/types/models/nodeExtensionInitialiseEngineServerMethod.d.ts +9 -0
  135. package/dist/types/models/nodeExtensionInitialiseMethod.d.ts +9 -0
  136. package/dist/types/models/nodeExtensionShutdownMethod.d.ts +6 -0
  137. package/dist/types/node.d.ts +8 -7
  138. package/dist/types/{server.d.ts → start.d.ts} +6 -3
  139. package/dist/types/utils.d.ts +9 -10
  140. package/docs/changelog.md +859 -184
  141. package/docs/examples.md +99 -1
  142. package/docs/reference/functions/buildConfiguration.md +3 -3
  143. package/docs/reference/functions/buildEngineConfiguration.md +1 -7
  144. package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
  145. package/docs/reference/functions/constructCliCommand.md +27 -0
  146. package/docs/reference/functions/executeCommand.md +29 -0
  147. package/docs/reference/functions/extensionsConfiguration.md +1 -1
  148. package/docs/reference/functions/extensionsInitialiseEngine.md +2 -2
  149. package/docs/reference/functions/extensionsInitialiseEngineServer.md +2 -2
  150. package/docs/reference/functions/getEnvDefaults.md +19 -0
  151. package/docs/reference/functions/getScriptDirectory.md +19 -0
  152. package/docs/reference/functions/initialiseLocales.md +2 -0
  153. package/docs/reference/functions/isAuthEntityStorageRequired.md +20 -0
  154. package/docs/reference/functions/isAutomationRequired.md +20 -0
  155. package/docs/reference/functions/isBackgroundTasksRequired.md +20 -0
  156. package/docs/reference/functions/isFederatedCatalogueRequired.md +20 -0
  157. package/docs/reference/functions/isImmutableProofRequired.md +20 -0
  158. package/docs/reference/functions/isRightsManagementRequired.md +23 -0
  159. package/docs/reference/functions/isTaskSchedulerRequired.md +20 -0
  160. package/docs/reference/functions/isTelemetryRequired.md +20 -0
  161. package/docs/reference/functions/isTrustRequired.md +20 -0
  162. package/docs/reference/functions/loadJsonFile.md +1 -1
  163. package/docs/reference/functions/loadTextFile.md +1 -1
  164. package/docs/reference/functions/overrideModuleImport.md +1 -1
  165. package/docs/reference/functions/parseCommandLineArgs.md +19 -0
  166. package/docs/reference/functions/processEnvOptions.md +27 -0
  167. package/docs/reference/functions/registerCommands.md +9 -0
  168. package/docs/reference/functions/resolvePackageEntryPoint.md +2 -2
  169. package/docs/reference/functions/run.md +8 -2
  170. package/docs/reference/functions/shutdownExtensions.md +2 -2
  171. package/docs/reference/functions/start.md +10 -4
  172. package/docs/reference/functions/substituteEnvOptions.md +25 -0
  173. package/docs/reference/index.md +26 -14
  174. package/docs/reference/interfaces/IBootstrapLegacyEnvironmentVariables.md +117 -0
  175. package/docs/reference/interfaces/ICacheMetadata.md +3 -3
  176. package/docs/reference/interfaces/ICliArgs.md +35 -0
  177. package/docs/reference/interfaces/ICliCommand.md +23 -0
  178. package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
  179. package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
  180. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +553 -365
  181. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +41 -1746
  182. package/docs/reference/interfaces/IModuleProtocol.md +3 -3
  183. package/docs/reference/interfaces/INodeEngineState.md +6 -21
  184. package/docs/reference/interfaces/INodeEnvironmentVariables.md +10 -1967
  185. package/docs/reference/interfaces/INodeOptions.md +46 -38
  186. package/docs/reference/interfaces/IProtocolHandlerResult.md +2 -2
  187. package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
  188. package/docs/reference/type-aliases/IEnvironmentVariables.md +5 -0
  189. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +3 -1
  190. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +3 -1
  191. package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +4 -2
  192. package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +3 -1
  193. package/docs/reference/variables/ATTESTATION_VERIFICATION_METHOD_ID.md +2 -0
  194. package/docs/reference/variables/AUTH_SIGNING_KEY_ID.md +2 -0
  195. package/docs/reference/variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md +2 -0
  196. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_DID.md +2 -0
  197. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md +2 -0
  198. package/docs/reference/variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +2 -0
  199. package/docs/reference/variables/ModuleProtocol.md +5 -5
  200. package/docs/reference/variables/TRUST_VERIFICATION_METHOD_ID.md +5 -0
  201. package/locales/en.json +680 -30
  202. package/package.json +30 -27
  203. package/dist/es/bootstrap.js +0 -366
  204. package/dist/es/bootstrap.js.map +0 -1
  205. package/dist/es/identity.js +0 -182
  206. package/dist/es/identity.js.map +0 -1
  207. package/dist/es/models/nodeExtensionMethods.js +0 -2
  208. package/dist/es/models/nodeExtensionMethods.js.map +0 -1
  209. package/dist/es/models/nodeFeatures.js +0 -21
  210. package/dist/es/models/nodeFeatures.js.map +0 -1
  211. package/dist/es/server.js +0 -81
  212. package/dist/es/server.js.map +0 -1
  213. package/dist/types/bootstrap.d.ts +0 -68
  214. package/dist/types/identity.d.ts +0 -14
  215. package/dist/types/models/nodeExtensionMethods.d.ts +0 -27
  216. package/dist/types/models/nodeFeatures.d.ts +0 -21
  217. package/docs/detailed-guide.md +0 -129
  218. package/docs/reference/functions/bootstrap.md +0 -29
  219. package/docs/reference/functions/bootstrapAuth.md +0 -35
  220. package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
  221. package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
  222. package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
  223. package/docs/reference/functions/bootstrapNodeId.md +0 -35
  224. package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
  225. package/docs/reference/functions/bootstrapTenantId.md +0 -35
  226. package/docs/reference/functions/getFeatures.md +0 -19
  227. package/docs/reference/type-aliases/NodeFeatures.md +0 -5
  228. package/docs/reference/variables/NodeFeatures.md +0 -25
  229. package/docs/reference/variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md +0 -3
  230. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
@@ -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 { IEnvironmentVariables } from "./IEnvironmentVariables.js";
5
+ /**
6
+ * Static definition of a CLI command including its name, parameters, and execution action.
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
+ * An example invocation string shown in help output.
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: IEnvironmentVariables, 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 organization identity to be set.
43
+ * @default true
44
+ */
45
+ requiresOrgIdentity?: boolean;
46
+ }
@@ -0,0 +1,35 @@
1
+ import type { CliCommandParamType } from "./cliCommandParamType.js";
2
+ /**
3
+ * Definition of a single parameter accepted by a CLI command.
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,26 @@ 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;
13
+ /**
14
+ * Controls how unrecognised TWIN_* environment variables are handled at startup.
15
+ * "error" (default): throws a startup error, allowing CI and production deployments
16
+ * to hard-fail on misconfigured or misspelled variable names.
17
+ * "warn": logs a warning and continues.
18
+ * "ignore": skips validation entirely.
19
+ * Any other value is rejected at startup.
20
+ * @default "error"
21
+ */
22
+ strictEnv?: string;
23
+ /**
24
+ * Comma-separated list of raw environment variable names to exempt from the unknown-key check.
25
+ * Use this to allowlist variables introduced by custom extensions that are not part of the
26
+ * core interface, e.g. TWIN_MY_EXTENSION_SECRET.
27
+ */
28
+ envAllowList?: string;
9
29
  /**
10
30
  * The root directory for storing items like state file.
11
31
  */
@@ -18,14 +38,6 @@ export interface IEngineEnvironmentVariables {
18
38
  * Is multi-tenant support enabled, defaults to false.
19
39
  */
20
40
  tenantEnabled?: string;
21
- /**
22
- * A tenant id to use as a default for the node.
23
- */
24
- tenantId?: string;
25
- /**
26
- * A tenant api key to use as a default for the node.
27
- */
28
- tenantApiKey?: string;
29
41
  /**
30
42
  * The type of the entity storage to create, comma separate for more than one connector.
31
43
  * values: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql
@@ -60,9 +72,9 @@ export interface IEngineEnvironmentVariables {
60
72
  */
61
73
  awsDynamodbSecretAccessKey?: string;
62
74
  /**
63
- * AWS Dynamo DB connection timeout.
75
+ * AWS Dynamo DB connection timeout in milliseconds.
64
76
  */
65
- awsDynamodbConnectionTimeoutMs?: string;
77
+ awsDynamodbConnectionTimeout?: string;
66
78
  /**
67
79
  * Azure Cosmos DB key.
68
80
  */
@@ -94,7 +106,7 @@ export interface IEngineEnvironmentVariables {
94
106
  /**
95
107
  * GCP Firestore endpoint.
96
108
  */
97
- gcpFirestoreApiEndpoint?: string;
109
+ gcpFirestoreEndpoint?: string;
98
110
  /**
99
111
  * GCP Firestore project id.
100
112
  */
@@ -192,10 +204,6 @@ export interface IEngineEnvironmentVariables {
192
204
  * The default blob storage connector to use, defaults to the first one in the list.
193
205
  */
194
206
  blobStorageConnectorDefault?: string;
195
- /**
196
- * Blog storage connector which has public access.
197
- */
198
- blobStorageConnectorPublic?: string;
199
207
  /**
200
208
  * Enable encryption for the blob storage.
201
209
  */
@@ -204,11 +212,6 @@ export interface IEngineEnvironmentVariables {
204
212
  * The id of the encryption key for the blob storage.
205
213
  */
206
214
  blobStorageEncryptionKeyId?: string;
207
- /**
208
- * A symmetric encryption key for the blob storage, should be ChaCha20Poly1305 in base64 format.
209
- * If encryption is enabled but a key is not provided one will be generated.
210
- */
211
- blobStorageSymmetricEncryptionKey?: string;
212
215
  /**
213
216
  * A prefix for all the blobs in blob-storage, can be empty.
214
217
  */
@@ -273,6 +276,10 @@ export interface IEngineEnvironmentVariables {
273
276
  * The type of the default vault connector: entity-storage, hashicorp.
274
277
  */
275
278
  vaultConnector?: string;
279
+ /**
280
+ * Prefix to prepend to entries in the vault.
281
+ */
282
+ vaultPrefix?: string;
276
283
  /**
277
284
  * Hashicorp Vault token.
278
285
  */
@@ -285,6 +292,18 @@ export interface IEngineEnvironmentVariables {
285
292
  * The type of logging task connector, can be a comma separated list: console, entity-storage.
286
293
  */
287
294
  loggingConnector?: string;
295
+ /**
296
+ * The batch size for the logging task, set to 1 for no batching.
297
+ */
298
+ loggingBatchSize?: string;
299
+ /**
300
+ * The batch flush interval in seconds for the logging task, how often to flush the logs when using batching, defaults to 5 seconds.
301
+ */
302
+ loggingBatchFlushInterval?: string;
303
+ /**
304
+ * A list of components to exclude from logging, can be a comma separated list of component Class names e.g. "ComponentA,ComponentB".
305
+ */
306
+ loggingSilentComponents?: string;
288
307
  /**
289
308
  * The type of event bus connector: local.
290
309
  */
@@ -318,7 +337,7 @@ export interface IEngineEnvironmentVariables {
318
337
  */
319
338
  awsSesEndpoint?: string;
320
339
  /**
321
- * The applications for the push notifications JSON stringified array of IAwsApplicationSettings.
340
+ * The applications for the push notifications reference a separate json with @json: prefix.
322
341
  */
323
342
  awsMessagingPushNotificationApplications?: string;
324
343
  /**
@@ -337,6 +356,34 @@ export interface IEngineEnvironmentVariables {
337
356
  * The type of telemetry connector: entity-storage.
338
357
  */
339
358
  telemetryConnector?: string;
359
+ /**
360
+ * The name of the Open Telemetry meter to use, only required if using open-telemetry as telemetry connector, defaults to twin-node.
361
+ */
362
+ openTelemetryMeterName?: string;
363
+ /**
364
+ * The version of the Open Telemetry metrics specification to use, only required if using open-telemetry as telemetry connector, defaults to 1.0.0.
365
+ */
366
+ openTelemetryMeterVersion?: string;
367
+ /**
368
+ * The type of Open Telemetry metric reader to use, only required if using open-telemetry as telemetry connector, values: prometheus.
369
+ */
370
+ openTelemetryReader?: string;
371
+ /**
372
+ * The port to use for the Open Telemetry Prometheus metrics server, only required if using open-telemetry as telemetry connector and prometheus as reader, defaults to 9464.
373
+ */
374
+ openTelemetryPrometheusPort?: string;
375
+ /**
376
+ * Polling interval in seconds for the telemetry metrics collector. Defaults to 60.
377
+ */
378
+ telemetryMetricsCollectorInterval?: string;
379
+ /**
380
+ * The type of telemetry metrics producers, can be a comma separated list: system, process.
381
+ */
382
+ telemetryMetricsProducers?: string;
383
+ /**
384
+ * Maximum number of values retained per telemetry metric (count-based history cap). Defaults to 1440.
385
+ */
386
+ telemetryMetricsProducerMaxHistory?: string;
340
387
  /**
341
388
  * The type of faucet connector: entity-storage, iota.
342
389
  */
@@ -349,18 +396,26 @@ export interface IEngineEnvironmentVariables {
349
396
  * The type of NFT connector: entity-storage, iota.
350
397
  */
351
398
  nftConnector?: string;
399
+ /**
400
+ * The NFT deployed package id, for custom deployments.
401
+ */
402
+ nftPackageId?: string;
403
+ /**
404
+ * The type of notarization connector: entity-storage, iota.
405
+ */
406
+ notarizationConnector?: string;
352
407
  /**
353
408
  * The type of identity connector: entity-storage, iota.
354
409
  */
355
410
  identityConnector?: string;
356
411
  /**
357
- * The type of identity resolver connector: entity-storage, iota.
412
+ * The index of the wallet address to use, defaults to 0.
358
413
  */
359
- identityResolverConnector?: string;
414
+ identityWalletAddressIndex?: string;
360
415
  /**
361
- * The type of verifiable storage connector: entity-storage, iota.
416
+ * The type of identity resolver connector: entity-storage, iota.
362
417
  */
363
- verifiableStorageConnector?: string;
418
+ identityResolverConnector?: string;
364
419
  /**
365
420
  * IOTA Faucet Endpoint.
366
421
  */
@@ -389,6 +444,10 @@ export interface IEngineEnvironmentVariables {
389
444
  * IOTA Gas Station Authentication Token.
390
445
  */
391
446
  iotaGasStationAuthToken?: string;
447
+ /**
448
+ * The IOTA Identity deployed package id, for custom deployments.
449
+ */
450
+ iotaIdentityPackageId?: string;
392
451
  /**
393
452
  * Universal Resolver Endpoint.
394
453
  */
@@ -421,6 +480,10 @@ export interface IEngineEnvironmentVariables {
421
480
  * The type of the default data extractor, can be a comma separated list: json-path.
422
481
  */
423
482
  dataExtractorConnectors?: string;
483
+ /**
484
+ * Enable the task scheduler regardless of which other components are active, defaults to false.
485
+ */
486
+ taskSchedulerEnabled?: string;
424
487
  /**
425
488
  * Is the auditable item graph enabled, defaults to false.
426
489
  */
@@ -434,51 +497,7 @@ export interface IEngineEnvironmentVariables {
434
497
  */
435
498
  documentManagementEnabled?: string;
436
499
  /**
437
- * Is the synchronised storage enabled, defaults to false.
438
- */
439
- synchronisedStorageEnabled?: string;
440
- /**
441
- * Url which points to the api for a trusted synchronised storage node, not required if this is a trusted node.
442
- */
443
- synchronisedStorageTrustedUrl?: string;
444
- /**
445
- * The key for the smart contract which contains the verifiable storage pointer store for synchronised storage.
446
- * This only required if using a custom verifiable storage item, otherwise it will default to the network name.
447
- */
448
- synchronisedStorageVerifiableStorageKeyId?: string;
449
- /**
450
- * The key from the vault which is used to encrypt the synchronised storage blobs.
451
- * Only required for trusted nodes, as regular nodes will request from the trusted nodes.
452
- * Defaults to synchronised-storage-blob-encryption
453
- */
454
- synchronisedStorageBlobStorageEncryptionKeyId?: string;
455
- /**
456
- * The key used for blob encryption, should be ChaCha20Poly1305 encoded as base64.
457
- * Only required for trusted nodes, as regular nodes will not write encrypted data.
458
- */
459
- synchronisedStorageBlobStorageKey?: string;
460
- /**
461
- * How often to check for entity updates in minutes.
462
- * @default 5
463
- */
464
- synchronisedStorageEntityUpdateIntervalMinutes?: string;
465
- /**
466
- * Interval to perform consolidation of changesets, only used if this is a trusted node.
467
- * @default 60
468
- */
469
- synchronisedStorageConsolidationIntervalMinutes?: string;
470
- /**
471
- * The number of entities to process in a single consolidation batch, only used if this is a trusted node.
472
- * @default 1000
473
- */
474
- synchronisedStorageConsolidationBatchSize?: string;
475
- /**
476
- * The maximum number of consolidations to keep in storage, only used if this is a trusted node.
477
- * @default 5
478
- */
479
- synchronisedStorageMaxConsolidations?: string;
480
- /**
481
- * Is the federated catalogue enabled, defaults to false.
500
+ * Enable the federated catalogue, defaults to false, automatically enabled if remote endpoint, filters or dataspace is enabled.
482
501
  */
483
502
  federatedCatalogueEnabled?: string;
484
503
  /**
@@ -486,9 +505,9 @@ export interface IEngineEnvironmentVariables {
486
505
  */
487
506
  federatedCatalogueFilters?: string;
488
507
  /**
489
- * Is the trust management enabled, defaults to false.
508
+ * Federated catalog remote endpoint, if set will use a REST client instead of local service.
490
509
  */
491
- trustEnabled?: string;
510
+ federatedCatalogueRemoteEndpoint?: string;
492
511
  /**
493
512
  * The trust generators to add to the factory, comma separated list.
494
513
  */
@@ -499,17 +518,33 @@ export interface IEngineEnvironmentVariables {
499
518
  trustVerifiers?: string;
500
519
  /**
501
520
  * The verification method to use for trust identities.
502
- * Defaults to node-authentication-assertion.
521
+ * Defaults to trust-assertion.
503
522
  */
504
523
  trustVerificationMethodId?: string;
505
524
  /**
506
- * Is the rights management enabled, defaults to false.
525
+ * The trust time to live for generating JWTs in seconds.
526
+ * Defaults to undefined for never expiring.
527
+ */
528
+ trustJwtTtl?: string;
529
+ /**
530
+ * The allow lists for the trust identity verifier, comma separated list of identities.
507
531
  */
508
- rightsManagementEnabled?: string;
532
+ trustIdentitiesAllow?: string;
509
533
  /**
510
- * What is the base callback url for rights management negotiations e.g. https://my-node/rights-management.
534
+ * The deny lists for the trust identity verifier, comma separated list of identities.
511
535
  */
512
- rightsManagementBaseCallbackUrl?: string;
536
+ trustIdentitiesDeny?: string;
537
+ /**
538
+ * Path under which the rights management service is mounted (single source
539
+ * of truth). The same value drives:
540
+ * - the server route mount (via engine config)
541
+ * - the PNP service's callback URL builder (`buildCallbackUrl`)
542
+ * - the PNP rest-client's pathPrefix (consumer side)
543
+ * Defaults to `rights-management`. Set when deploying behind a reverse proxy
544
+ * with path rewriting, K8s ingress with path-based routing, or any custom
545
+ * mount point.
546
+ */
547
+ rightsManagementCallbackPath?: string;
513
548
  /**
514
549
  * The rights management policy information sources to add to the factory.
515
550
  */
@@ -535,40 +570,108 @@ export interface IEngineEnvironmentVariables {
535
570
  */
536
571
  rightsManagementPolicyArbiters?: string;
537
572
  /**
538
- * The rights management data access handlers to add to the factory.
573
+ * The rights management policy obligation enforcers to add to the factory.
539
574
  */
540
- rightsManagementDataAccessHandlers?: string;
575
+ rightsManagementPolicyObligationEnforcers?: string;
541
576
  /**
542
- * Are background tasks enabled, defaults to false.
577
+ * Is the dataspace enabled, defaults to false.
543
578
  */
544
- backgroundTasksEnabled?: string;
579
+ dataspaceEnabled?: string;
545
580
  /**
546
- * Is the task scheduler enabled, defaults to false.
581
+ * The length of time to retain the activity logs for in seconds, set to -1 to keep forever.
582
+ * @default 600
547
583
  */
548
- taskSchedulerEnabled?: string;
584
+ dataspaceRetainActivityLogsFor?: string;
585
+ /**
586
+ * The interval in seconds for cleaning up the activity logs.
587
+ * @default 3600
588
+ */
589
+ dataspaceActivityLogsCleanupInterval?: string;
590
+ /**
591
+ * The data plane path for PULL transfers (path only, not full URL).
592
+ * Will be combined with public origin.
593
+ * Required if PULL transfers should be supported.
594
+ * Example: "dataspace/entities"
595
+ */
596
+ dataspaceDataPlanePath?: string;
597
+ /**
598
+ * Whether the provider immediately starts a transfer once it has been requested.
599
+ * When false the transfer stays in REQUESTED until the provider explicitly calls transferStarted.
600
+ * @default false
601
+ */
602
+ dataspaceAutoStartTransfers?: string;
603
+ /**
604
+ * How long in seconds a negotiation may sit without progress before it is treated as timed out.
605
+ * @default 30
606
+ */
607
+ dataspaceStalledNegotiationTimeout?: string;
608
+ /**
609
+ * How long in seconds a consumer-initiated transfer may sit in REQUESTED without the provider
610
+ * progressing it before it is treated as timed out.
611
+ * @default 30
612
+ */
613
+ dataspaceStalledTransferTimeout?: string;
614
+ /**
615
+ * Path under which the dataspace control plane is mounted (path only, not full URL).
616
+ * This must match the control-plane REST mount, as it is combined with the public
617
+ * origin to build the consumer's advertised callback address.
618
+ * @default "dataspace-control-plane"
619
+ */
620
+ dataspaceCallbackPath?: string;
621
+ /**
622
+ * Are the health components enabled, defaults to false.
623
+ */
624
+ healthEnabled?: string;
625
+ /**
626
+ * The interval in seconds for performing health checks, defaults to 60.
627
+ */
628
+ healthInterval?: string;
629
+ /**
630
+ * The interval in seconds for performing health checks at startup, defaults to 2.
631
+ * This allows components that take a long time to initialize to be healthy before the first health check is performed.
632
+ */
633
+ healthStartupInterval?: string;
634
+ /**
635
+ * The type of the automation action to create, comma separate for more than one connector.
636
+ * values: fetch
637
+ */
638
+ automationActionTypes?: string;
639
+ /**
640
+ * The default mutex timeout in milliseconds, used when no component-specific timeout is set, defaults to 5000 if omitted.
641
+ */
642
+ mutexTimeoutMsDefault?: string;
643
+ /**
644
+ * The mutex timeout in milliseconds for the auditable item graph component.
645
+ */
646
+ auditableItemGraphMutexTimeout?: string;
647
+ /**
648
+ * The mutex timeout in milliseconds for the auditable item stream component.
649
+ */
650
+ auditableItemStreamMutexTimeout?: string;
651
+ /**
652
+ * The mutex timeout in milliseconds for the federated catalogue component.
653
+ */
654
+ federatedCatalogueMutexTimeout?: string;
549
655
  /**
550
- * Is the data space connector enabled, defaults to false.
656
+ * The mutex timeout in milliseconds for the document management component.
551
657
  */
552
- dataSpaceConnectorEnabled?: string;
658
+ documentManagementMutexTimeout?: string;
553
659
  /**
554
- * The length of time to retain the activity logs for in minutes, set to -1 to keep forever.
555
- * @default 10
660
+ * The mutex timeout in milliseconds for the logging component.
556
661
  */
557
- dataSpaceConnectorRetainActivityLogsFor?: string;
662
+ loggingMutexTimeout?: string;
558
663
  /**
559
- * The interval for cleaning up the activity logs.
560
- * @default 60
664
+ * The mutex timeout in milliseconds for the memory entity storage connector.
561
665
  */
562
- dataSpaceConnectorActivityLogsCleanUpInterval?: string;
666
+ entityStorageMemoryMutexTimeout?: string;
563
667
  /**
564
- * Enable verifiable credential authentication for the API.
668
+ * The mutex timeout in milliseconds for the file entity storage connector.
565
669
  */
566
- vcAuthenticationEnabled?: string;
670
+ entityStorageFileMutexTimeout?: string;
567
671
  /**
568
- * Verifiable credential assertion for node to node communication.
569
- * Defaults to node-authentication-assertion.
672
+ * The mutex timeout in milliseconds for the rights management component.
570
673
  */
571
- vcAuthenticationVerificationMethodId?: string;
674
+ rightsManagementMutexTimeout?: string;
572
675
  /**
573
676
  * A comma separated list of additional node extensions to load, the initialiseExtension method will be called for each extension.
574
677
  */
@@ -1,8 +1,7 @@
1
- import type { IEngineEnvironmentVariables } from "./IEngineEnvironmentVariables.js";
2
1
  /**
3
2
  * The engine server environment variables.
4
3
  */
5
- export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVariables {
4
+ export interface IEngineServerEnvironmentVariables {
6
5
  /**
7
6
  * The port to serve the API from.
8
7
  */
@@ -27,6 +26,10 @@ export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVar
27
26
  * The CORS headers to expose.
28
27
  */
29
28
  httpExposedHeaders?: string;
29
+ /**
30
+ * The public origin URL for the API e.g. https://api.example.com:1234
31
+ */
32
+ publicOrigin?: string;
30
33
  /**
31
34
  * The type of auth admin processor to use on the API: entity-storage.
32
35
  */
@@ -39,6 +42,10 @@ export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVar
39
42
  * The id of the key in the vault to use for signing in auth operations.
40
43
  */
41
44
  authSigningKeyId?: string;
45
+ /**
46
+ * The HTTP header name used to pass the API key on requests, defaults to x-api-key.
47
+ */
48
+ authApiKeyHeader?: string;
42
49
  /**
43
50
  * Additional MIME type processors to include, comma separated.
44
51
  */
@@ -0,0 +1,8 @@
1
+ import type { IBootstrapLegacyEnvironmentVariables } from "./IBootstrapLegacyEnvironmentVariables.js";
2
+ import type { IEngineEnvironmentVariables } from "./IEngineEnvironmentVariables.js";
3
+ import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironmentVariables.js";
4
+ import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
5
+ /**
6
+ * The environment variables.
7
+ */
8
+ export type IEnvironmentVariables = IBootstrapLegacyEnvironmentVariables & INodeEnvironmentVariables & IEngineEnvironmentVariables & IEngineServerEnvironmentVariables;
@@ -8,15 +8,8 @@ export interface INodeEngineState extends IEngineState {
8
8
  */
9
9
  nodeId?: string;
10
10
  /**
11
- * The tenant id for the node.
12
- */
13
- nodeTenantId?: string;
14
- /**
15
- * The identity for the organization.
11
+ * This is the default organization used in the context ids when a user is not authenticated.
12
+ * It is not used in multi-tenant mode, which gets the organization from the tenant table.
16
13
  */
17
14
  nodeOrganizationId?: string;
18
- /**
19
- * The identity for the admin user.
20
- */
21
- nodeAdminUserId?: string;
22
15
  }
@@ -1,46 +1,7 @@
1
- import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironmentVariables.js";
2
1
  /**
3
2
  * The environment variables for the node.
4
3
  */
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;
4
+ export interface INodeEnvironmentVariables {
44
5
  /**
45
6
  * Maximum size in MB for HTTPS extensions downloads.
46
7
  * @default 10
@@ -1,14 +1,14 @@
1
1
  import type { IEngineCore, IEngineServer, IEngineStateStorage } from "@twin.org/engine-models";
2
2
  import type { IEngineConfig } from "@twin.org/engine-types";
3
+ import type { IEnvironmentVariables } from "./IEnvironmentVariables.js";
3
4
  import type { INodeEngineConfig } from "./INodeEngineConfig.js";
4
- import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
5
5
  /**
6
6
  * The options when running the node.
7
7
  */
8
8
  export interface INodeOptions {
9
9
  /**
10
- * The name of the server, defaults to "TWIN Node Server".
11
- * @default "TWIN Node Server"
10
+ * The name of the server, defaults to "TWIN Node".
11
+ * @default "TWIN Node"
12
12
  */
13
13
  serverName?: string;
14
14
  /**
@@ -40,6 +40,10 @@ export interface INodeOptions {
40
40
  * This will be merged with any configuration loaded from the environment variables.
41
41
  */
42
42
  config?: IEngineConfig;
43
+ /**
44
+ * The directory to override the script location, defaults to location of index.js.
45
+ */
46
+ scriptDirectory?: string;
43
47
  /**
44
48
  * The directory to override the execution location, defaults to process directory.
45
49
  */
@@ -59,11 +63,11 @@ export interface INodeOptions {
59
63
  /**
60
64
  * Method to extend the engine environment variables with any additional custom configuration.
61
65
  */
62
- extendEnvVars?: (envVars: INodeEnvironmentVariables) => Promise<void>;
66
+ extendEnvVars?: (envVars: IEnvironmentVariables) => Promise<void>;
63
67
  /**
64
68
  * Method to extend the engine configuration with any additional custom configuration.
65
69
  */
66
- extendConfig?: (envVars: INodeEnvironmentVariables, config: INodeEngineConfig) => Promise<void>;
70
+ extendConfig?: (envVars: IEnvironmentVariables, config: INodeEngineConfig) => Promise<void>;
67
71
  /**
68
72
  * Method to extend the engine with any additional options.
69
73
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The set of camelCase property names that are valid IBootstrapLegacyEnvironmentVariables keys.
3
+ */
4
+ export declare const BOOTSTRAP_LEGACY_ENVIRONMENT_VARIABLE_KEYS: ReadonlySet<string>;