@twin.org/node-core 0.0.2-next.9 → 0.0.3-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/dist/es/builders/engineEnvBuilder.js +1132 -0
  3. package/dist/es/builders/engineEnvBuilder.js.map +1 -0
  4. package/dist/es/builders/engineServerEnvBuilder.js +206 -0
  5. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -0
  6. package/dist/es/builders/extensionsBuilder.js +109 -0
  7. package/dist/es/builders/extensionsBuilder.js.map +1 -0
  8. package/dist/es/cli.js +255 -0
  9. package/dist/es/cli.js.map +1 -0
  10. package/dist/es/commands/bootstrapLegacy.js +175 -0
  11. package/dist/es/commands/bootstrapLegacy.js.map +1 -0
  12. package/dist/es/commands/help.js +85 -0
  13. package/dist/es/commands/help.js.map +1 -0
  14. package/dist/es/commands/identityCreate.js +310 -0
  15. package/dist/es/commands/identityCreate.js.map +1 -0
  16. package/dist/es/commands/identityImports.js +76 -0
  17. package/dist/es/commands/identityImports.js.map +1 -0
  18. package/dist/es/commands/identityVerifiableCredentialCreate.js +140 -0
  19. package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
  20. package/dist/es/commands/identityVerificationMethodCreate.js +208 -0
  21. package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
  22. package/dist/es/commands/identityVerificationMethodImport.js +120 -0
  23. package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
  24. package/dist/es/commands/nodeSetIdentity.js +51 -0
  25. package/dist/es/commands/nodeSetIdentity.js.map +1 -0
  26. package/dist/es/commands/nodeSetTenant.js +49 -0
  27. package/dist/es/commands/nodeSetTenant.js.map +1 -0
  28. package/dist/es/commands/tenantCreate.js +120 -0
  29. package/dist/es/commands/tenantCreate.js.map +1 -0
  30. package/dist/es/commands/tenantImport.js +78 -0
  31. package/dist/es/commands/tenantImport.js.map +1 -0
  32. package/dist/es/commands/userCreate.js +197 -0
  33. package/dist/es/commands/userCreate.js.map +1 -0
  34. package/dist/es/commands/vaultKeyCreate.js +185 -0
  35. package/dist/es/commands/vaultKeyCreate.js.map +1 -0
  36. package/dist/es/commands/vaultKeyImport.js +98 -0
  37. package/dist/es/commands/vaultKeyImport.js.map +1 -0
  38. package/dist/es/defaults.js +28 -0
  39. package/dist/es/defaults.js.map +1 -0
  40. package/dist/es/index.js +27 -0
  41. package/dist/es/index.js.map +1 -0
  42. package/dist/es/models/ICacheMetadata.js +4 -0
  43. package/dist/es/models/ICacheMetadata.js.map +1 -0
  44. package/dist/es/models/ICliArgs.js +4 -0
  45. package/dist/es/models/ICliArgs.js.map +1 -0
  46. package/dist/es/models/ICliCommand.js +2 -0
  47. package/dist/es/models/ICliCommand.js.map +1 -0
  48. package/dist/es/models/ICliCommandDefinition.js +2 -0
  49. package/dist/es/models/ICliCommandDefinition.js.map +1 -0
  50. package/dist/es/models/ICliCommandDefinitionParam.js +2 -0
  51. package/dist/es/models/ICliCommandDefinitionParam.js.map +1 -0
  52. package/dist/es/models/IEngineEnvironmentVariables.js +4 -0
  53. package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -0
  54. package/dist/es/models/IEngineServerEnvironmentVariables.js +2 -0
  55. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -0
  56. package/dist/es/models/IModuleProtocol.js +2 -0
  57. package/dist/es/models/IModuleProtocol.js.map +1 -0
  58. package/dist/es/models/INodeEngineConfig.js +2 -0
  59. package/dist/es/models/INodeEngineConfig.js.map +1 -0
  60. package/dist/es/models/INodeEngineState.js +2 -0
  61. package/dist/es/models/INodeEngineState.js.map +1 -0
  62. package/dist/es/models/INodeEnvironmentVariables.js +2 -0
  63. package/dist/es/models/INodeEnvironmentVariables.js.map +1 -0
  64. package/dist/es/models/INodeOptions.js +2 -0
  65. package/dist/es/models/INodeOptions.js.map +1 -0
  66. package/dist/es/models/IProtocolHandlerResult.js +4 -0
  67. package/dist/es/models/IProtocolHandlerResult.js.map +1 -0
  68. package/dist/es/models/cliCommandParamType.js +4 -0
  69. package/dist/es/models/cliCommandParamType.js.map +1 -0
  70. package/dist/es/models/moduleProtocol.js +29 -0
  71. package/dist/es/models/moduleProtocol.js.map +1 -0
  72. package/dist/es/models/nodeExtensionMethods.js +2 -0
  73. package/dist/es/models/nodeExtensionMethods.js.map +1 -0
  74. package/dist/es/node.js +285 -0
  75. package/dist/es/node.js.map +1 -0
  76. package/dist/es/start.js +128 -0
  77. package/dist/es/start.js.map +1 -0
  78. package/dist/es/utils.js +397 -0
  79. package/dist/es/utils.js.map +1 -0
  80. package/dist/types/builders/engineEnvBuilder.d.ts +6 -2
  81. package/dist/types/builders/engineServerEnvBuilder.d.ts +7 -3
  82. package/dist/types/builders/extensionsBuilder.d.ts +32 -0
  83. package/dist/types/cli.d.ts +66 -0
  84. package/dist/types/commands/bootstrapLegacy.d.ts +66 -0
  85. package/dist/types/commands/help.d.ts +23 -0
  86. package/dist/types/commands/identityCreate.d.ts +39 -0
  87. package/dist/types/commands/identityImports.d.ts +24 -0
  88. package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
  89. package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
  90. package/dist/types/commands/identityVerificationMethodImport.d.ts +31 -0
  91. package/dist/types/commands/nodeSetIdentity.d.ts +22 -0
  92. package/dist/types/commands/nodeSetTenant.d.ts +22 -0
  93. package/dist/types/commands/tenantCreate.d.ts +35 -0
  94. package/dist/types/commands/tenantImport.d.ts +24 -0
  95. package/dist/types/commands/userCreate.d.ts +46 -0
  96. package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
  97. package/dist/types/commands/vaultKeyImport.d.ts +28 -0
  98. package/dist/types/defaults.d.ts +16 -0
  99. package/dist/types/index.d.ts +24 -11
  100. package/dist/types/models/ICacheMetadata.d.ts +17 -0
  101. package/dist/types/models/ICliArgs.d.ts +20 -0
  102. package/dist/types/models/ICliCommand.d.ts +17 -0
  103. package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
  104. package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
  105. package/dist/types/models/IEngineEnvironmentVariables.d.ts +154 -37
  106. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +12 -3
  107. package/dist/types/models/IModuleProtocol.d.ts +18 -0
  108. package/dist/types/models/INodeEngineConfig.d.ts +6 -0
  109. package/dist/types/models/INodeEngineState.d.ts +14 -0
  110. package/dist/types/models/INodeEnvironmentVariables.d.ts +17 -15
  111. package/dist/types/models/INodeOptions.d.ts +14 -3
  112. package/dist/types/models/IProtocolHandlerResult.d.ts +13 -0
  113. package/dist/types/models/cliCommandParamType.d.ts +4 -0
  114. package/dist/types/models/moduleProtocol.d.ts +29 -0
  115. package/dist/types/models/nodeExtensionMethods.d.ts +27 -0
  116. package/dist/types/node.d.ts +21 -7
  117. package/dist/types/start.d.ts +25 -0
  118. package/dist/types/utils.d.ts +83 -6
  119. package/docs/changelog.md +241 -0
  120. package/docs/detailed-guide.md +129 -0
  121. package/docs/reference/functions/buildConfiguration.md +2 -2
  122. package/docs/reference/functions/buildEngineConfiguration.md +8 -2
  123. package/docs/reference/functions/buildEngineServerConfiguration.md +9 -3
  124. package/docs/reference/functions/constructCliCommand.md +27 -0
  125. package/docs/reference/functions/createModuleImportUrl.md +21 -0
  126. package/docs/reference/functions/directoryExists.md +19 -0
  127. package/docs/reference/functions/executeCommand.md +29 -0
  128. package/docs/reference/functions/extensionsConfiguration.md +25 -0
  129. package/docs/reference/functions/extensionsInitialiseEngine.md +25 -0
  130. package/docs/reference/functions/extensionsInitialiseEngineServer.md +31 -0
  131. package/docs/reference/functions/getEnvDefaults.md +19 -0
  132. package/docs/reference/functions/getExtensionsCacheDir.md +31 -0
  133. package/docs/reference/functions/getFiles.md +19 -0
  134. package/docs/reference/functions/getSubFolders.md +19 -0
  135. package/docs/reference/functions/handleHttpsProtocol.md +49 -0
  136. package/docs/reference/functions/handleNpmProtocol.md +31 -0
  137. package/docs/reference/functions/hashUrl.md +19 -0
  138. package/docs/reference/functions/initCli.md +27 -0
  139. package/docs/reference/functions/isCacheExpired.md +31 -0
  140. package/docs/reference/functions/overrideModuleImport.md +8 -2
  141. package/docs/reference/functions/parseCommandLineArgs.md +19 -0
  142. package/docs/reference/functions/parseModuleProtocol.md +19 -0
  143. package/docs/reference/functions/processEnvOptions.md +27 -0
  144. package/docs/reference/functions/registerCommands.md +9 -0
  145. package/docs/reference/functions/resolvePackageEntryPoint.md +32 -0
  146. package/docs/reference/functions/run.md +9 -3
  147. package/docs/reference/functions/shutdownExtensions.md +25 -0
  148. package/docs/reference/functions/start.md +17 -5
  149. package/docs/reference/functions/substituteEnvOptions.md +25 -0
  150. package/docs/reference/index.md +47 -10
  151. package/docs/reference/interfaces/ICacheMetadata.md +27 -0
  152. package/docs/reference/interfaces/ICliArgs.md +35 -0
  153. package/docs/reference/interfaces/ICliCommand.md +23 -0
  154. package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
  155. package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
  156. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +303 -60
  157. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +1737 -5
  158. package/docs/reference/interfaces/IModuleProtocol.md +27 -0
  159. package/docs/reference/interfaces/INodeEngineConfig.md +7 -0
  160. package/docs/reference/interfaces/INodeEngineState.md +23 -0
  161. package/docs/reference/interfaces/INodeEnvironmentVariables.md +599 -198
  162. package/docs/reference/interfaces/INodeOptions.md +27 -3
  163. package/docs/reference/interfaces/IProtocolHandlerResult.md +19 -0
  164. package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
  165. package/docs/reference/type-aliases/ModuleProtocol.md +5 -0
  166. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +18 -0
  167. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +24 -0
  168. package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +23 -0
  169. package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +10 -0
  170. package/docs/reference/variables/ATTESTATION_VERIFICATION_METHOD_ID.md +3 -0
  171. package/docs/reference/variables/AUTH_SIGNING_KEY_ID.md +3 -0
  172. package/docs/reference/variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
  173. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_DID.md +3 -0
  174. package/docs/reference/variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md +3 -0
  175. package/docs/reference/variables/IMMUTABLE_PROOF_VERIFICATION_METHOD_ID.md +3 -0
  176. package/docs/reference/variables/ModuleProtocol.md +37 -0
  177. package/docs/reference/variables/SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID.md +3 -0
  178. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +3 -0
  179. package/locales/en.json +479 -28
  180. package/package.json +29 -9
  181. package/dist/cjs/index.cjs +0 -1910
  182. package/dist/esm/index.mjs +0 -1870
  183. package/dist/types/bootstrap.d.ts +0 -59
  184. package/dist/types/models/nodeFeatures.d.ts +0 -21
  185. package/dist/types/server.d.ts +0 -17
  186. package/docs/reference/functions/bootstrap.md +0 -29
  187. package/docs/reference/functions/bootstrapAuth.md +0 -35
  188. package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
  189. package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
  190. package/docs/reference/functions/bootstrapNodeIdentity.md +0 -35
  191. package/docs/reference/functions/bootstrapNodeUser.md +0 -35
  192. package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
  193. package/docs/reference/functions/getFeatures.md +0 -19
  194. package/docs/reference/type-aliases/NodeFeatures.md +0 -5
  195. package/docs/reference/variables/NodeFeatures.md +0 -25
@@ -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
  */
@@ -14,6 +18,14 @@ export interface IEngineEnvironmentVariables {
14
18
  * The name of the state file.
15
19
  */
16
20
  stateFilename?: string;
21
+ /**
22
+ * Does the node have a unique ID, defaults to true.
23
+ */
24
+ nodeIdentityEnabled?: string;
25
+ /**
26
+ * Is multi-tenant support enabled, defaults to false.
27
+ */
28
+ tenantEnabled?: string;
17
29
  /**
18
30
  * The type of the entity storage to create, comma separate for more than one connector.
19
31
  * values: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql
@@ -27,6 +39,10 @@ export interface IEngineEnvironmentVariables {
27
39
  * A prefix for all the table in entity-storage, can be empty.
28
40
  */
29
41
  entityStorageTablePrefix?: string;
42
+ /**
43
+ * AWS DynamoDB auth mode, either credentials or pod.
44
+ */
45
+ awsDynamodbAuthMode?: string;
30
46
  /**
31
47
  * AWS Dynamo DB access key id.
32
48
  */
@@ -43,6 +59,10 @@ export interface IEngineEnvironmentVariables {
43
59
  * AWS Dynamo DB secret access key.
44
60
  */
45
61
  awsDynamodbSecretAccessKey?: string;
62
+ /**
63
+ * AWS Dynamo DB connection timeout.
64
+ */
65
+ awsDynamodbConnectionTimeoutMs?: string;
46
66
  /**
47
67
  * Azure Cosmos DB key.
48
68
  */
@@ -184,35 +204,34 @@ export interface IEngineEnvironmentVariables {
184
204
  * The id of the encryption key for the blob storage.
185
205
  */
186
206
  blobStorageEncryptionKeyId?: string;
187
- /**
188
- * A symmetric encryption key for the blob storage, should be ChaCha20Poly1305 in base64 format.
189
- * If encryption is enabled but a key is not provided one will be generated.
190
- */
191
- blobStorageSymmetricEncryptionKey?: string;
192
207
  /**
193
208
  * A prefix for all the blobs in blob-storage, can be empty.
194
209
  */
195
210
  blobStoragePrefix?: string;
196
211
  /**
197
- * AWS S3 access key id.
212
+ * AWS S3 region.
198
213
  */
199
- awsS3AccessKeyId?: string;
214
+ awsS3Region?: string;
200
215
  /**
201
216
  * AWS S3 bucket name.
202
217
  */
203
218
  awsS3BucketName?: string;
204
219
  /**
205
- * AWS S3 endpoint.
220
+ * AWS S3 auth mode, either credentials or pod, defaults to credentials.
206
221
  */
207
- awsS3Endpoint?: string;
222
+ awsS3AuthMode?: string;
208
223
  /**
209
- * AWS S3 region.
224
+ * AWS S3 access key id.
210
225
  */
211
- awsS3Region?: string;
226
+ awsS3AccessKeyId?: string;
212
227
  /**
213
228
  * AWS S3 secret access key.
214
229
  */
215
230
  awsS3SecretAccessKey?: string;
231
+ /**
232
+ * AWS S3 endpoint.
233
+ */
234
+ awsS3Endpoint?: string;
216
235
  /**
217
236
  * Azure Storage account key.
218
237
  */
@@ -258,13 +277,9 @@ export interface IEngineEnvironmentVariables {
258
277
  */
259
278
  hashicorpVaultEndpoint?: string;
260
279
  /**
261
- * The type of background task connector, can be a comma separated list: console, entity-storage.
280
+ * The type of logging task connector, can be a comma separated list: console, entity-storage.
262
281
  */
263
282
  loggingConnector?: string;
264
- /**
265
- * The type of background task connector: entity-storage.
266
- */
267
- backgroundTaskConnector?: string;
268
283
  /**
269
284
  * The type of event bus connector: local.
270
285
  */
@@ -274,25 +289,45 @@ export interface IEngineEnvironmentVariables {
274
289
  */
275
290
  eventBusComponent?: string;
276
291
  /**
277
- * The type of messaging email connector: entity-storage, aws.
292
+ * Are the messaging components enabled, defaults to false.
278
293
  */
279
- messagingEmailConnector?: string;
294
+ messagingEnabled?: string;
280
295
  /**
281
- * The type of messaging sms connector: entity-storage, aws.
296
+ * AWS SES region.
282
297
  */
283
- messagingSmsConnector?: string;
298
+ awsSesRegion?: string;
284
299
  /**
285
- * The type of messaging push notification connector: entity-storage, aws.
300
+ * AWS SES auth mode, either credentials or pod, defaults to credentials.
286
301
  */
287
- messagingPushNotificationConnector?: string;
302
+ awsSesAuthMode?: string;
303
+ /**
304
+ * AWS SES secret access key.
305
+ */
306
+ awsSesSecretAccessKey?: string;
307
+ /**
308
+ * AWS SES access key id.
309
+ */
310
+ awsSesAccessKeyId?: string;
311
+ /**
312
+ * AWS SES endpoint.
313
+ */
314
+ awsSesEndpoint?: string;
288
315
  /**
289
316
  * The applications for the push notifications JSON stringified array of IAwsApplicationSettings.
290
317
  */
291
318
  awsMessagingPushNotificationApplications?: string;
292
319
  /**
293
- * The type of messaging component: service.
320
+ * The type of messaging email connector: entity-storage, aws.
321
+ */
322
+ messagingEmailConnector?: string;
323
+ /**
324
+ * The type of messaging sms connector: entity-storage, aws.
294
325
  */
295
- messagingComponent?: string;
326
+ messagingSmsConnector?: string;
327
+ /**
328
+ * The type of messaging push notification connector: entity-storage, aws.
329
+ */
330
+ messagingPushNotificationConnector?: string;
296
331
  /**
297
332
  * The type of telemetry connector: entity-storage.
298
333
  */
@@ -313,6 +348,10 @@ export interface IEngineEnvironmentVariables {
313
348
  * The type of identity connector: entity-storage, iota.
314
349
  */
315
350
  identityConnector?: string;
351
+ /**
352
+ * The index of the wallet address to use, defaults to 0.
353
+ */
354
+ identityWalletAddressIndex?: string;
316
355
  /**
317
356
  * The type of identity resolver connector: entity-storage, iota.
318
357
  */
@@ -369,6 +408,10 @@ export interface IEngineEnvironmentVariables {
369
408
  * The identity verification method id to use with attestation.
370
409
  */
371
410
  attestationVerificationMethodId?: string;
411
+ /**
412
+ * Is the data processing enabled, defaults to false.
413
+ */
414
+ dataProcessingEnabled?: string;
372
415
  /**
373
416
  * The type of the default data converters, can be a comma separated list: json, xml.
374
417
  */
@@ -377,6 +420,18 @@ export interface IEngineEnvironmentVariables {
377
420
  * The type of the default data extractor, can be a comma separated list: json-path.
378
421
  */
379
422
  dataExtractorConnectors?: string;
423
+ /**
424
+ * Is the auditable item graph enabled, defaults to false.
425
+ */
426
+ auditableItemGraphEnabled?: string;
427
+ /**
428
+ * Is the auditable item stream enabled, defaults to false.
429
+ */
430
+ auditableItemStreamEnabled?: string;
431
+ /**
432
+ * Is the document management enabled, defaults to false.
433
+ */
434
+ documentManagementEnabled?: string;
380
435
  /**
381
436
  * Is the synchronised storage enabled, defaults to false.
382
437
  */
@@ -387,14 +442,9 @@ export interface IEngineEnvironmentVariables {
387
442
  synchronisedStorageTrustedUrl?: string;
388
443
  /**
389
444
  * The key for the smart contract which contains the verifiable storage pointer store for synchronised storage.
390
- * This only required if using a custom verifiable storage item, otherwise it will default the the network name.
445
+ * This only required if using a custom verifiable storage item, otherwise it will default to the network name.
391
446
  */
392
447
  synchronisedStorageVerifiableStorageKeyId?: string;
393
- /**
394
- * The identity verification method id to use with synchronised storage for signing/verifying changesets.
395
- * Defaults to synchronised-storage-assertion.
396
- */
397
- synchronisedStorageVerificationMethodId?: string;
398
448
  /**
399
449
  * The key from the vault which is used to encrypt the synchronised storage blobs.
400
450
  * Only required for trusted nodes, as regular nodes will request from the trusted nodes.
@@ -431,17 +481,66 @@ export interface IEngineEnvironmentVariables {
431
481
  */
432
482
  federatedCatalogueEnabled?: string;
433
483
  /**
434
- * Federated catalog TTL for the cache.
484
+ * Federated catalog filters, command separated list of filters to add.
485
+ */
486
+ federatedCatalogueFilters?: string;
487
+ /**
488
+ * Is the trust management enabled, defaults to false.
489
+ */
490
+ trustEnabled?: string;
491
+ /**
492
+ * The trust generators to add to the factory, comma separated list.
435
493
  */
436
- federatedCatalogueCacheTtlMs?: number;
494
+ trustGenerators?: string;
437
495
  /**
438
- * Federated catalog clearing house approver list, stringified array of DIDs.
496
+ * The trust verifiers to add to the factory, comma separated list.
439
497
  */
440
- federatedCatalogueClearingHouseApproverList?: string;
498
+ trustVerifiers?: string;
499
+ /**
500
+ * The verification method to use for trust identities.
501
+ * Defaults to node-authentication-assertion.
502
+ */
503
+ trustVerificationMethodId?: string;
441
504
  /**
442
505
  * Is the rights management enabled, defaults to false.
443
506
  */
444
507
  rightsManagementEnabled?: string;
508
+ /**
509
+ * What is the base callback url for rights management negotiations e.g. https://my-node/rights-management.
510
+ */
511
+ rightsManagementBaseCallbackUrl?: string;
512
+ /**
513
+ * The rights management policy information sources to add to the factory.
514
+ */
515
+ rightsManagementPolicyInformationSources?: string;
516
+ /**
517
+ * The rights management policy negotiators sources to add to the factory.
518
+ */
519
+ rightsManagementPolicyNegotiators?: string;
520
+ /**
521
+ * The rights management policy requesters to add to the factory.
522
+ */
523
+ rightsManagementPolicyRequesters?: string;
524
+ /**
525
+ * The rights management policy execution actions to add to the factory.
526
+ */
527
+ rightsManagementPolicyExecutionActions?: string;
528
+ /**
529
+ * The rights management policy enforcement processors to add to the factory.
530
+ */
531
+ rightsManagementPolicyEnforcementProcessors?: string;
532
+ /**
533
+ * The rights management policy arbiters to add to the factory.
534
+ */
535
+ rightsManagementPolicyArbiters?: string;
536
+ /**
537
+ * The rights management data access handlers to add to the factory.
538
+ */
539
+ rightsManagementDataAccessHandlers?: string;
540
+ /**
541
+ * Are background tasks enabled, defaults to false.
542
+ */
543
+ backgroundTasksEnabled?: string;
445
544
  /**
446
545
  * Is the task scheduler enabled, defaults to false.
447
546
  */
@@ -451,8 +550,26 @@ export interface IEngineEnvironmentVariables {
451
550
  */
452
551
  dataSpaceConnectorEnabled?: string;
453
552
  /**
454
- * The application configuration for the data space connector.
455
- * Use the @json: prefix to specify the path to the JSON configuration file.
553
+ * The length of time to retain the activity logs for in minutes, set to -1 to keep forever.
554
+ * @default 10
555
+ */
556
+ dataSpaceConnectorRetainActivityLogsFor?: string;
557
+ /**
558
+ * The interval for cleaning up the activity logs.
559
+ * @default 60
560
+ */
561
+ dataSpaceConnectorActivityLogsCleanUpInterval?: string;
562
+ /**
563
+ * Enable verifiable credential authentication for the API.
564
+ */
565
+ vcAuthenticationEnabled?: string;
566
+ /**
567
+ * Verifiable credential assertion for node to node communication.
568
+ * Defaults to node-authentication-assertion.
569
+ */
570
+ vcAuthenticationVerificationMethodId?: string;
571
+ /**
572
+ * A comma separated list of additional node extensions to load, the initialiseExtension method will be called for each extension.
456
573
  */
457
- dataSpaceConnectorApps?: string;
574
+ extensions?: string;
458
575
  }
@@ -1,7 +1,8 @@
1
+ import type { IEngineEnvironmentVariables } from "./IEngineEnvironmentVariables.js";
1
2
  /**
2
3
  * The engine server environment variables.
3
4
  */
4
- export interface IEngineServerEnvironmentVariables {
5
+ export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVariables {
5
6
  /**
6
7
  * The port to serve the API from.
7
8
  */
@@ -43,7 +44,15 @@ export interface IEngineServerEnvironmentVariables {
43
44
  */
44
45
  mimeTypeProcessors?: string;
45
46
  /**
46
- * Disable Node Identity route processors.
47
+ * Include the body in the REST logging output, useful for debugging.
47
48
  */
48
- disableNodeIdentity?: string;
49
+ routeLoggingIncludeBody?: string;
50
+ /**
51
+ * Include the full base 64 output in the REST logging output, useful for debugging.
52
+ */
53
+ routeLoggingFullBase64?: string;
54
+ /**
55
+ * List of properties to obfuscate in the REST logging output, comma separated.
56
+ */
57
+ routeLoggingObfuscateProperties?: string;
49
58
  }
@@ -0,0 +1,18 @@
1
+ import type { ModuleProtocol } from "./moduleProtocol.js";
2
+ /**
3
+ * The parsed module protocol information.
4
+ */
5
+ export interface IModuleProtocol {
6
+ /**
7
+ * The protocol type.
8
+ */
9
+ protocol: ModuleProtocol;
10
+ /**
11
+ * The identifier after the protocol (or the original if no protocol).
12
+ */
13
+ identifier: string;
14
+ /**
15
+ * The original module string.
16
+ */
17
+ original: string;
18
+ }
@@ -0,0 +1,6 @@
1
+ import type { IEngineServerConfig } from "@twin.org/engine-server-types";
2
+ /**
3
+ * The config for the node.
4
+ */
5
+ export interface INodeEngineConfig extends IEngineServerConfig {
6
+ }
@@ -0,0 +1,14 @@
1
+ import type { IEngineState } from "@twin.org/engine-models";
2
+ /**
3
+ * The engine state for the node.
4
+ */
5
+ export interface INodeEngineState extends IEngineState {
6
+ /**
7
+ * The identity for the node.
8
+ */
9
+ nodeId?: string;
10
+ /**
11
+ * The tenant id for the node.
12
+ */
13
+ nodeTenantId?: string;
14
+ }
@@ -1,29 +1,31 @@
1
- import type { IEngineEnvironmentVariables } from "./IEngineEnvironmentVariables";
2
- import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironmentVariables";
1
+ import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironmentVariables.js";
3
2
  /**
4
3
  * The environment variables for the node.
5
4
  */
6
- export interface INodeEnvironmentVariables extends IEngineEnvironmentVariables, IEngineServerEnvironmentVariables {
5
+ export interface INodeEnvironmentVariables extends IEngineServerEnvironmentVariables {
7
6
  /**
8
- * The features that are enabled on the node.
9
- * @default [NodeFeatures.NodeIdentity]
7
+ * Maximum size in MB for HTTPS extensions downloads.
8
+ * @default 10
10
9
  */
11
- features?: string;
10
+ extensionsMaxSizeMb?: number;
12
11
  /**
13
- * The identity of the node which, if empty and node-identity feature is enabled it will be generated.
12
+ * Whether to clear the extensions cache on startup.
13
+ * @default false
14
14
  */
15
- identity?: string;
15
+ extensionsClearCache?: boolean;
16
16
  /**
17
- * The mnemonic for the identity, if empty and node-identity feature is enabled it will be randomly generated.
17
+ * Custom directory for extensions cache storage.
18
+ * @default ".tmp"
18
19
  */
19
- mnemonic?: string;
20
+ extensionsCacheDirectory?: string;
20
21
  /**
21
- * If the node-user feature is enabled, this will be the name of the user.
22
- * @default admin@node
22
+ * TTL in hours for HTTPS extensions cache.
23
+ * @default 24
23
24
  */
24
- username?: string;
25
+ extensionsCacheTtlHours?: number;
25
26
  /**
26
- * If the node-user feature is enabled, this will be the password of the user, if empty it will be randomly generated.
27
+ * Force refresh of all cached extensions.
28
+ * @default false
27
29
  */
28
- password?: string;
30
+ extensionsForceRefresh?: boolean;
29
31
  }
@@ -1,6 +1,7 @@
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 { INodeEnvironmentVariables } from "./INodeEnvironmentVariables";
3
+ import type { INodeEngineConfig } from "./INodeEngineConfig.js";
4
+ import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
4
5
  /**
5
6
  * The options when running the node.
6
7
  */
@@ -14,12 +15,18 @@ export interface INodeOptions {
14
15
  * The version of the server, defaults to the current version.
15
16
  */
16
17
  serverVersion?: string;
18
+ /**
19
+ * Additional environment variables to set.
20
+ */
21
+ envVars?: {
22
+ [key: string]: string;
23
+ };
17
24
  /**
18
25
  * Additional environment variable filenames to load, defaults to .env.
19
26
  */
20
27
  envFilenames?: string[];
21
28
  /**
22
- * The prefix for environment variables, defaults to "TWIN_NODE_".
29
+ * The prefix for environment variables, defaults to "TWIN_".
23
30
  */
24
31
  envPrefix?: string;
25
32
  /**
@@ -56,7 +63,7 @@ export interface INodeOptions {
56
63
  /**
57
64
  * Method to extend the engine configuration with any additional custom configuration.
58
65
  */
59
- extendConfig?: (config: IEngineConfig) => Promise<void>;
66
+ extendConfig?: (envVars: INodeEnvironmentVariables, config: INodeEngineConfig) => Promise<void>;
60
67
  /**
61
68
  * Method to extend the engine with any additional options.
62
69
  */
@@ -70,4 +77,8 @@ export interface INodeOptions {
70
77
  * If not provided, a default file-based state storage will be used.
71
78
  */
72
79
  stateStorage?: IEngineStateStorage;
80
+ /**
81
+ * Disables process.exit calls on fatal errors and throws instead.
82
+ */
83
+ disableProcessExitOnFailure?: boolean;
73
84
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The result from a protocol handler.
3
+ */
4
+ export interface IProtocolHandlerResult {
5
+ /**
6
+ * The resolved path to the module file.
7
+ */
8
+ resolvedPath: string;
9
+ /**
10
+ * Whether the module was cached.
11
+ */
12
+ cached: boolean;
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type for the properties in commands.
3
+ */
4
+ export type CliCommandParamType = string | number | boolean;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The protocol types for modules.
3
+ */
4
+ export declare const ModuleProtocol: {
5
+ /**
6
+ * Local module (starts with . or / or file://).
7
+ */
8
+ readonly Local: "local";
9
+ /**
10
+ * NPM package (starts with npm:).
11
+ */
12
+ readonly Npm: "npm";
13
+ /**
14
+ * HTTPS URL (starts with https://).
15
+ */
16
+ readonly Https: "https";
17
+ /**
18
+ * HTTP URL (starts with http://).
19
+ */
20
+ readonly Http: "http";
21
+ /**
22
+ * Default/standard module resolution.
23
+ */
24
+ readonly Default: "default";
25
+ };
26
+ /**
27
+ * The protocol type for a module.
28
+ */
29
+ export type ModuleProtocol = (typeof ModuleProtocol)[keyof typeof ModuleProtocol];
@@ -0,0 +1,27 @@
1
+ import type { IEngineCore, IEngineServer } from "@twin.org/engine-models";
2
+ import type { INodeEngineConfig } from "./INodeEngineConfig.js";
3
+ import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
4
+ /**
5
+ * The type for the initialise method of an extension module.
6
+ * @param envVars The environment variables for the node.
7
+ * @param nodeEngineConfig The node engine config.
8
+ */
9
+ export type NodeExtensionInitialiseMethod = (envVars: INodeEnvironmentVariables, nodeEngineConfig: INodeEngineConfig) => Promise<void>;
10
+ /**
11
+ * The type for the initialise engine method of an extension module.
12
+ * This is called when the engine has been constructed but not yet started.
13
+ * @param engineCore The engine core instance.
14
+ */
15
+ export type NodeExtensionInitialiseEngineMethod = (engineCore: IEngineCore) => Promise<void>;
16
+ /**
17
+ * The type for the initialise engine server method of an extension module.
18
+ * This is called when the engine server has been constructed but not yet started.
19
+ * @param engineCore The engine core instance.
20
+ * @param engineServer The engine server instance.
21
+ */
22
+ export type NodeExtensionInitialiseEngineServerMethod = (engineCore: IEngineCore, engineServer: IEngineServer) => Promise<void>;
23
+ /**
24
+ * The type for the shutdown method of an extension module.
25
+ * This is called when the engine is shutting down.
26
+ */
27
+ export type NodeExtensionShutdownMethod = () => Promise<void>;
@@ -1,13 +1,22 @@
1
1
  import type { IServerInfo } from "@twin.org/api-models";
2
+ import type { Engine } from "@twin.org/engine";
3
+ import type { EngineServer } from "@twin.org/engine-server";
2
4
  import type { IEngineServerConfig } from "@twin.org/engine-server-types";
3
- import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables";
4
- import type { INodeOptions } from "./models/INodeOptions";
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
+ import type { INodeOptions } from "./models/INodeOptions.js";
5
9
  /**
6
10
  * Run the TWIN Node server.
7
11
  * @param nodeOptions Optional configuration options for running the server.
8
- * @returns A promise that resolves when the server is started.
12
+ * @param args Optional command line arguments.
13
+ * @returns A promise that resolves when the server is started containing a shutdown method.
9
14
  */
10
- export declare function run(nodeOptions?: INodeOptions): Promise<void>;
15
+ export declare function run(nodeOptions?: INodeOptions, args?: string[]): Promise<{
16
+ engine: Engine<IEngineServerConfig, INodeEngineState>;
17
+ server: EngineServer;
18
+ shutdown: () => Promise<void>;
19
+ } | undefined>;
11
20
  /**
12
21
  * Build the configuration for the TWIN Node server.
13
22
  * @param processEnv The environment variables from the process.
@@ -22,10 +31,15 @@ export declare function buildConfiguration(processEnv: {
22
31
  nodeEnvVars: INodeEnvironmentVariables & {
23
32
  [id: string]: string | unknown;
24
33
  };
25
- engineServerConfig: IEngineServerConfig;
34
+ nodeEngineConfig: INodeEngineConfig;
35
+ availableContextIdKeys: {
36
+ key: string;
37
+ requiredHandlerFeatures: string[];
38
+ }[];
26
39
  }>;
27
40
  /**
28
- * Override module imports to use local files where possible.
41
+ * Override module imports to support protocol-based loading (npm:, https:) and local files.
29
42
  * @param executionDirectory The execution directory for resolving local module paths.
43
+ * @param envVars The environment variables containing extension configuration (optional, uses defaults if not provided).
30
44
  */
31
- export declare function overrideModuleImport(executionDirectory: string): void;
45
+ export declare function overrideModuleImport(executionDirectory: string, envVars?: INodeEnvironmentVariables): void;
@@ -0,0 +1,25 @@
1
+ import { Engine } from "@twin.org/engine";
2
+ import { EngineServer } from "@twin.org/engine-server";
3
+ import type { IEngineServerConfig } from "@twin.org/engine-server-types";
4
+ import type { ICliCommand } from "./models/ICliCommand.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
+ import type { INodeOptions } from "./models/INodeOptions.js";
9
+ /**
10
+ * Start the engine server.
11
+ * @param nodeOptions Optional run options for the engine server.
12
+ * @param nodeEngineConfig The configuration for the engine server.
13
+ * @param envVars The environment variables.
14
+ * @param cliCommand The constructed CLI command (optional).
15
+ * @param availableContextIdKeys The context ID keys available for operation.
16
+ * @returns The engine server.
17
+ */
18
+ export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, cliCommand?: ICliCommand, availableContextIdKeys?: {
19
+ key: string;
20
+ requiredHandlerFeatures: string[];
21
+ }[]): Promise<{
22
+ engine: Engine<IEngineServerConfig, INodeEngineState>;
23
+ server: EngineServer;
24
+ shutdown: () => Promise<void>;
25
+ } | undefined>;