@twin.org/node-core 0.0.3-next.3 → 0.0.3-next.31

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 (159) hide show
  1. package/README.md +3 -1
  2. package/dist/es/builders/engineEnvBuilder.js +194 -123
  3. package/dist/es/builders/engineEnvBuilder.js.map +1 -1
  4. package/dist/es/builders/engineServerEnvBuilder.js +63 -24
  5. package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
  6. package/dist/es/cli.js +247 -0
  7. package/dist/es/cli.js.map +1 -0
  8. package/dist/es/commands/bootstrapLegacy.js +186 -0
  9. package/dist/es/commands/bootstrapLegacy.js.map +1 -0
  10. package/dist/es/commands/help.js +85 -0
  11. package/dist/es/commands/help.js.map +1 -0
  12. package/dist/es/commands/identityCreate.js +316 -0
  13. package/dist/es/commands/identityCreate.js.map +1 -0
  14. package/dist/es/commands/identityImports.js +82 -0
  15. package/dist/es/commands/identityImports.js.map +1 -0
  16. package/dist/es/commands/identityVerifiableCredentialCreate.js +146 -0
  17. package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -0
  18. package/dist/es/commands/identityVerificationMethodCreate.js +228 -0
  19. package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -0
  20. package/dist/es/commands/identityVerificationMethodImport.js +126 -0
  21. package/dist/es/commands/identityVerificationMethodImport.js.map +1 -0
  22. package/dist/es/commands/nodeSetIdentity.js +64 -0
  23. package/dist/es/commands/nodeSetIdentity.js.map +1 -0
  24. package/dist/es/commands/nodeSetTenant.js +68 -0
  25. package/dist/es/commands/nodeSetTenant.js.map +1 -0
  26. package/dist/es/commands/tenantCreate.js +139 -0
  27. package/dist/es/commands/tenantCreate.js.map +1 -0
  28. package/dist/es/commands/tenantImport.js +97 -0
  29. package/dist/es/commands/tenantImport.js.map +1 -0
  30. package/dist/es/commands/tenantUpdate.js +94 -0
  31. package/dist/es/commands/tenantUpdate.js.map +1 -0
  32. package/dist/es/commands/userCreate.js +212 -0
  33. package/dist/es/commands/userCreate.js.map +1 -0
  34. package/dist/es/commands/userUpdate.js +132 -0
  35. package/dist/es/commands/userUpdate.js.map +1 -0
  36. package/dist/es/commands/vaultKeyCreate.js +191 -0
  37. package/dist/es/commands/vaultKeyCreate.js.map +1 -0
  38. package/dist/es/commands/vaultKeyImport.js +104 -0
  39. package/dist/es/commands/vaultKeyImport.js.map +1 -0
  40. package/dist/es/defaults.js +17 -1
  41. package/dist/es/defaults.js.map +1 -1
  42. package/dist/es/index.js +7 -3
  43. package/dist/es/index.js.map +1 -1
  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.map +1 -1
  53. package/dist/es/models/IEngineServerEnvironmentVariables.js.map +1 -1
  54. package/dist/es/models/INodeEngineState.js.map +1 -1
  55. package/dist/es/models/INodeEnvironmentVariables.js.map +1 -1
  56. package/dist/es/models/INodeOptions.js.map +1 -1
  57. package/dist/es/models/cliCommandParamType.js +4 -0
  58. package/dist/es/models/cliCommandParamType.js.map +1 -0
  59. package/dist/es/node.js +84 -39
  60. package/dist/es/node.js.map +1 -1
  61. package/dist/es/start.js +139 -0
  62. package/dist/es/start.js.map +1 -0
  63. package/dist/es/utils.js +12 -22
  64. package/dist/es/utils.js.map +1 -1
  65. package/dist/types/builders/engineEnvBuilder.d.ts +1 -1
  66. package/dist/types/builders/engineServerEnvBuilder.d.ts +4 -2
  67. package/dist/types/cli.d.ts +56 -0
  68. package/dist/types/commands/bootstrapLegacy.d.ts +66 -0
  69. package/dist/types/commands/help.d.ts +23 -0
  70. package/dist/types/commands/identityCreate.d.ts +39 -0
  71. package/dist/types/commands/identityImports.d.ts +24 -0
  72. package/dist/types/commands/identityVerifiableCredentialCreate.d.ts +43 -0
  73. package/dist/types/commands/identityVerificationMethodCreate.d.ts +47 -0
  74. package/dist/types/commands/identityVerificationMethodImport.d.ts +31 -0
  75. package/dist/types/commands/nodeSetIdentity.d.ts +22 -0
  76. package/dist/types/commands/nodeSetTenant.d.ts +22 -0
  77. package/dist/types/commands/tenantCreate.d.ts +38 -0
  78. package/dist/types/commands/tenantImport.d.ts +26 -0
  79. package/dist/types/commands/tenantUpdate.d.ts +26 -0
  80. package/dist/types/commands/userCreate.d.ts +49 -0
  81. package/dist/types/commands/userUpdate.d.ts +38 -0
  82. package/dist/types/commands/vaultKeyCreate.d.ts +43 -0
  83. package/dist/types/commands/vaultKeyImport.d.ts +28 -0
  84. package/dist/types/defaults.d.ts +9 -1
  85. package/dist/types/index.d.ts +7 -3
  86. package/dist/types/models/ICliArgs.d.ts +20 -0
  87. package/dist/types/models/ICliCommand.d.ts +17 -0
  88. package/dist/types/models/ICliCommandDefinition.d.ts +46 -0
  89. package/dist/types/models/ICliCommandDefinitionParam.d.ts +35 -0
  90. package/dist/types/models/IEngineEnvironmentVariables.d.ts +72 -56
  91. package/dist/types/models/IEngineServerEnvironmentVariables.d.ts +4 -0
  92. package/dist/types/models/INodeEngineState.d.ts +0 -8
  93. package/dist/types/models/INodeEnvironmentVariables.d.ts +0 -38
  94. package/dist/types/models/INodeOptions.d.ts +6 -2
  95. package/dist/types/models/cliCommandParamType.d.ts +4 -0
  96. package/dist/types/node.d.ts +5 -4
  97. package/dist/types/{server.d.ts → start.d.ts} +4 -2
  98. package/dist/types/utils.d.ts +6 -8
  99. package/docs/changelog.md +206 -1
  100. package/docs/examples.md +99 -1
  101. package/docs/reference/functions/buildConfiguration.md +1 -1
  102. package/docs/reference/functions/buildEngineServerConfiguration.md +1 -1
  103. package/docs/reference/functions/constructCliCommand.md +27 -0
  104. package/docs/reference/functions/executeCommand.md +29 -0
  105. package/docs/reference/functions/getEnvDefaults.md +19 -0
  106. package/docs/reference/functions/getScriptDirectory.md +19 -0
  107. package/docs/reference/functions/parseCommandLineArgs.md +19 -0
  108. package/docs/reference/functions/processEnvOptions.md +27 -0
  109. package/docs/reference/functions/registerCommands.md +9 -0
  110. package/docs/reference/functions/resolvePackageEntryPoint.md +2 -2
  111. package/docs/reference/functions/run.md +8 -2
  112. package/docs/reference/functions/start.md +9 -3
  113. package/docs/reference/functions/substituteEnvOptions.md +25 -0
  114. package/docs/reference/index.md +14 -12
  115. package/docs/reference/interfaces/ICacheMetadata.md +3 -3
  116. package/docs/reference/interfaces/ICliArgs.md +35 -0
  117. package/docs/reference/interfaces/ICliCommand.md +23 -0
  118. package/docs/reference/interfaces/ICliCommandDefinition.md +101 -0
  119. package/docs/reference/interfaces/ICliCommandDefinitionParam.md +65 -0
  120. package/docs/reference/interfaces/IEngineEnvironmentVariables.md +349 -313
  121. package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +434 -370
  122. package/docs/reference/interfaces/IModuleProtocol.md +3 -3
  123. package/docs/reference/interfaces/INodeEngineState.md +4 -20
  124. package/docs/reference/interfaces/INodeEnvironmentVariables.md +448 -464
  125. package/docs/reference/interfaces/INodeOptions.md +44 -36
  126. package/docs/reference/interfaces/IProtocolHandlerResult.md +2 -2
  127. package/docs/reference/type-aliases/CliCommandParamType.md +5 -0
  128. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineMethod.md +1 -1
  129. package/docs/reference/type-aliases/NodeExtensionInitialiseEngineServerMethod.md +1 -1
  130. package/docs/reference/type-aliases/NodeExtensionInitialiseMethod.md +1 -1
  131. package/docs/reference/type-aliases/NodeExtensionShutdownMethod.md +1 -1
  132. package/docs/reference/variables/ModuleProtocol.md +5 -5
  133. package/docs/reference/variables/TRUST_VERIFICATION_METHOD_ID.md +3 -0
  134. package/locales/en.json +589 -30
  135. package/package.json +6 -4
  136. package/dist/es/bootstrap.js +0 -360
  137. package/dist/es/bootstrap.js.map +0 -1
  138. package/dist/es/identity.js +0 -169
  139. package/dist/es/identity.js.map +0 -1
  140. package/dist/es/models/nodeFeatures.js +0 -21
  141. package/dist/es/models/nodeFeatures.js.map +0 -1
  142. package/dist/es/server.js +0 -81
  143. package/dist/es/server.js.map +0 -1
  144. package/dist/types/bootstrap.d.ts +0 -68
  145. package/dist/types/identity.d.ts +0 -14
  146. package/dist/types/models/nodeFeatures.d.ts +0 -21
  147. package/docs/detailed-guide.md +0 -129
  148. package/docs/reference/functions/bootstrap.md +0 -29
  149. package/docs/reference/functions/bootstrapAuth.md +0 -35
  150. package/docs/reference/functions/bootstrapBlobEncryption.md +0 -35
  151. package/docs/reference/functions/bootstrapImmutableProofMethod.md +0 -35
  152. package/docs/reference/functions/bootstrapNodeAdminUser.md +0 -35
  153. package/docs/reference/functions/bootstrapNodeId.md +0 -35
  154. package/docs/reference/functions/bootstrapSynchronisedStorage.md +0 -35
  155. package/docs/reference/functions/bootstrapTenantId.md +0 -35
  156. package/docs/reference/functions/getFeatures.md +0 -19
  157. package/docs/reference/type-aliases/NodeFeatures.md +0 -5
  158. package/docs/reference/variables/NodeFeatures.md +0 -25
  159. package/docs/reference/variables/VC_AUTHENTICATION_VERIFICATION_METHOD_ID.md +0 -3
@@ -0,0 +1,35 @@
1
+ import type { CliCommandParamType } from "./cliCommandParamType.js";
2
+ /**
3
+ * Command param to execute in the CLI.
4
+ */
5
+ export interface ICliCommandDefinitionParam {
6
+ /**
7
+ * The param key.
8
+ */
9
+ key: string;
10
+ /**
11
+ * The param type.
12
+ */
13
+ type: "string" | "number" | "boolean";
14
+ /**
15
+ * Possible options for the param.
16
+ */
17
+ options?: string[];
18
+ /**
19
+ * The extended type e.g. hex etc.
20
+ */
21
+ extendedType?: string;
22
+ /**
23
+ * Whether the param is required.
24
+ * @default true
25
+ */
26
+ required?: boolean;
27
+ /**
28
+ * The default value of the param.
29
+ */
30
+ defaultValue?: CliCommandParamType;
31
+ /**
32
+ * The param description.
33
+ */
34
+ description: string;
35
+ }
@@ -6,6 +6,10 @@ export interface IEngineEnvironmentVariables {
6
6
  * Start the engine in debug mode.
7
7
  */
8
8
  debug?: string;
9
+ /**
10
+ * Start the engine in silent mode.
11
+ */
12
+ silent?: string;
9
13
  /**
10
14
  * The root directory for storing items like state file.
11
15
  */
@@ -15,17 +19,13 @@ export interface IEngineEnvironmentVariables {
15
19
  */
16
20
  stateFilename?: string;
17
21
  /**
18
- * Is multi-tenant support enabled, defaults to false.
19
- */
20
- tenantEnabled?: string;
21
- /**
22
- * A tenant id to use as a default for the node.
22
+ * Does the node have a unique ID, defaults to true.
23
23
  */
24
- tenantId?: string;
24
+ nodeIdentityEnabled?: string;
25
25
  /**
26
- * A tenant api key to use as a default for the node.
26
+ * Is multi-tenant support enabled, defaults to false.
27
27
  */
28
- tenantApiKey?: string;
28
+ tenantEnabled?: string;
29
29
  /**
30
30
  * The type of the entity storage to create, comma separate for more than one connector.
31
31
  * values: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql
@@ -59,6 +59,10 @@ export interface IEngineEnvironmentVariables {
59
59
  * AWS Dynamo DB secret access key.
60
60
  */
61
61
  awsDynamodbSecretAccessKey?: string;
62
+ /**
63
+ * AWS Dynamo DB connection timeout.
64
+ */
65
+ awsDynamodbConnectionTimeoutMs?: string;
62
66
  /**
63
67
  * Azure Cosmos DB key.
64
68
  */
@@ -200,11 +204,6 @@ export interface IEngineEnvironmentVariables {
200
204
  * The id of the encryption key for the blob storage.
201
205
  */
202
206
  blobStorageEncryptionKeyId?: string;
203
- /**
204
- * A symmetric encryption key for the blob storage, should be ChaCha20Poly1305 in base64 format.
205
- * If encryption is enabled but a key is not provided one will be generated.
206
- */
207
- blobStorageSymmetricEncryptionKey?: string;
208
207
  /**
209
208
  * A prefix for all the blobs in blob-storage, can be empty.
210
209
  */
@@ -269,6 +268,10 @@ export interface IEngineEnvironmentVariables {
269
268
  * The type of the default vault connector: entity-storage, hashicorp.
270
269
  */
271
270
  vaultConnector?: string;
271
+ /**
272
+ * Prefix to prepend to entries in the vault.
273
+ */
274
+ vaultPrefix?: string;
272
275
  /**
273
276
  * Hashicorp Vault token.
274
277
  */
@@ -281,10 +284,6 @@ export interface IEngineEnvironmentVariables {
281
284
  * The type of logging task connector, can be a comma separated list: console, entity-storage.
282
285
  */
283
286
  loggingConnector?: string;
284
- /**
285
- * The type of background task connector: entity-storage.
286
- */
287
- backgroundTaskConnector?: string;
288
287
  /**
289
288
  * The type of event bus connector: local.
290
289
  */
@@ -318,7 +317,7 @@ export interface IEngineEnvironmentVariables {
318
317
  */
319
318
  awsSesEndpoint?: string;
320
319
  /**
321
- * The applications for the push notifications JSON stringified array of IAwsApplicationSettings.
320
+ * The applications for the push notifications reference a separate json with @json: prefix.
322
321
  */
323
322
  awsMessagingPushNotificationApplications?: string;
324
323
  /**
@@ -353,6 +352,10 @@ export interface IEngineEnvironmentVariables {
353
352
  * The type of identity connector: entity-storage, iota.
354
353
  */
355
354
  identityConnector?: string;
355
+ /**
356
+ * The index of the wallet address to use, defaults to 0.
357
+ */
358
+ identityWalletAddressIndex?: string;
356
359
  /**
357
360
  * The type of identity resolver connector: entity-storage, iota.
358
361
  */
@@ -482,83 +485,96 @@ export interface IEngineEnvironmentVariables {
482
485
  */
483
486
  federatedCatalogueEnabled?: string;
484
487
  /**
485
- * Federated catalog TTL for the cache.
488
+ * Federated catalog filters, command separated list of filters to add.
489
+ */
490
+ federatedCatalogueFilters?: string;
491
+ /**
492
+ * Is the trust management enabled, defaults to false.
493
+ */
494
+ trustEnabled?: string;
495
+ /**
496
+ * The trust generators to add to the factory, comma separated list.
486
497
  */
487
- federatedCatalogueCacheTtlMs?: number;
498
+ trustGenerators?: string;
488
499
  /**
489
- * Federated catalog clearing house approver list, stringified array of DIDs.
500
+ * The trust verifiers to add to the factory, comma separated list.
490
501
  */
491
- federatedCatalogueClearingHouseApproverList?: string;
502
+ trustVerifiers?: string;
503
+ /**
504
+ * The verification method to use for trust identities.
505
+ * Defaults to trust-assertion.
506
+ */
507
+ trustVerificationMethodId?: string;
508
+ /**
509
+ * The trust time to live for generating JWTs.
510
+ * Defaults to undefined for never expiring.
511
+ */
512
+ trustJwtTtlSeconds?: string;
492
513
  /**
493
514
  * Is the rights management enabled, defaults to false.
494
515
  */
495
516
  rightsManagementEnabled?: string;
496
517
  /**
497
- * What is the base callback url for rights management negotiations e.g. https://my-node/rights-management.
518
+ * What is the callback path for rights management negotiations, will be combined with hosting public url e.g. /callback.
498
519
  */
499
- rightsManagementBaseCallbackUrl?: string;
520
+ rightsManagementCallbackPath?: string;
500
521
  /**
501
- * The rights management configuration which includes the information sources modules to load.
502
- * Use the @json: prefix to specify the path to the JSON configuration file.
522
+ * The rights management policy information sources to add to the factory.
503
523
  */
504
- rightsManagementInformationSources?: string;
524
+ rightsManagementPolicyInformationSources?: string;
505
525
  /**
506
- * The rights management configuration which includes the negotiator modules to load.
507
- * Use the @json: prefix to specify the path to the JSON configuration file.
526
+ * The rights management policy negotiators sources to add to the factory.
508
527
  */
509
- rightsManagementNegotiators?: string;
528
+ rightsManagementPolicyNegotiators?: string;
510
529
  /**
511
- * The rights management configuration which includes the requester modules to load.
512
- * Use the @json: prefix to specify the path to the JSON configuration file.
530
+ * The rights management policy requesters to add to the factory.
513
531
  */
514
- rightsManagementRequesters?: string;
532
+ rightsManagementPolicyRequesters?: string;
515
533
  /**
516
- * The rights management configuration which includes the execution actions modules to load.
517
- * Use the @json: prefix to specify the path to the JSON configuration file.
534
+ * The rights management policy execution actions to add to the factory.
518
535
  */
519
- rightsManagementExecutionActions?: string;
536
+ rightsManagementPolicyExecutionActions?: string;
520
537
  /**
521
- * The rights management configuration which includes the enforcement processor modules to load.
522
- * Use the @json: prefix to specify the path to the JSON configuration file.
538
+ * The rights management policy enforcement processors to add to the factory.
523
539
  */
524
- rightsManagementEnforcementProcessors?: string;
540
+ rightsManagementPolicyEnforcementProcessors?: string;
525
541
  /**
526
- * The rights management configuration which includes the arbiter modules to load.
527
- * Use the @json: prefix to specify the path to the JSON configuration file.
542
+ * The rights management policy arbiters to add to the factory.
528
543
  */
529
- rightsManagementArbiters?: string;
544
+ rightsManagementPolicyArbiters?: string;
530
545
  /**
531
- * The rights management configuration which includes the offer modules to load.
532
- * Use the @json: prefix to specify the path to the JSON configuration file.
546
+ * The rights management policy obligation enforcers to add to the factory.
533
547
  */
534
- rightsManagementOffers?: string;
548
+ rightsManagementPolicyObligationEnforcers?: string;
549
+ /**
550
+ * Are background tasks enabled, defaults to false.
551
+ */
552
+ backgroundTasksEnabled?: string;
535
553
  /**
536
554
  * Is the task scheduler enabled, defaults to false.
537
555
  */
538
556
  taskSchedulerEnabled?: string;
539
557
  /**
540
- * Is the data space connector enabled, defaults to false.
558
+ * Is the dataspace enabled, defaults to false.
541
559
  */
542
- dataSpaceConnectorEnabled?: string;
560
+ dataspaceEnabled?: string;
543
561
  /**
544
562
  * The length of time to retain the activity logs for in minutes, set to -1 to keep forever.
545
563
  * @default 10
546
564
  */
547
- dataSpaceConnectorRetainActivityLogsFor?: string;
565
+ dataspaceRetainActivityLogsFor?: string;
548
566
  /**
549
567
  * The interval for cleaning up the activity logs.
550
568
  * @default 60
551
569
  */
552
- dataSpaceConnectorActivityLogsCleanUpInterval?: string;
553
- /**
554
- * Enable verifiable credential authentication for the API.
555
- */
556
- vcAuthenticationEnabled?: string;
570
+ dataspaceActivityLogsCleanUpInterval?: string;
557
571
  /**
558
- * Verifiable credential assertion for node to node communication.
559
- * Defaults to node-authentication-assertion.
572
+ * The data plane path for PULL transfers (path only, not full URL).
573
+ * Will be combined with public origin from hosting component.
574
+ * Required if PULL transfers should be supported.
575
+ * Example: "dataspace/entities"
560
576
  */
561
- vcAuthenticationVerificationMethodId?: string;
577
+ dataspaceDataPlanePath?: string;
562
578
  /**
563
579
  * A comma separated list of additional node extensions to load, the initialiseExtension method will be called for each extension.
564
580
  */
@@ -27,6 +27,10 @@ export interface IEngineServerEnvironmentVariables extends IEngineEnvironmentVar
27
27
  * The CORS headers to expose.
28
28
  */
29
29
  httpExposedHeaders?: string;
30
+ /**
31
+ * The public origin URL for the API e.g. https://api.example.com:1234
32
+ */
33
+ publicOrigin?: string;
30
34
  /**
31
35
  * The type of auth admin processor to use on the API: entity-storage.
32
36
  */
@@ -11,12 +11,4 @@ export interface INodeEngineState extends IEngineState {
11
11
  * The tenant id for the node.
12
12
  */
13
13
  nodeTenantId?: string;
14
- /**
15
- * The identity for the organization.
16
- */
17
- nodeOrganizationId?: string;
18
- /**
19
- * The identity for the admin user.
20
- */
21
- nodeAdminUserId?: string;
22
14
  }
@@ -3,44 +3,6 @@ import type { IEngineServerEnvironmentVariables } from "./IEngineServerEnvironme
3
3
  * The environment variables for the node.
4
4
  */
5
5
  export interface INodeEnvironmentVariables extends IEngineServerEnvironmentVariables {
6
- /**
7
- * The features that are enabled on the node.
8
- * @default []
9
- */
10
- features?: string;
11
- /**
12
- * The identity of the node which, if empty and node-identity feature is enabled it will be generated.
13
- */
14
- nodeIdentity?: string;
15
- /**
16
- * The mnemonic for the identity, if empty and node-identity feature is enabled it will be randomly generated.
17
- */
18
- nodeMnemonic?: string;
19
- /**
20
- * If the node-admin-user feature is enabled, this will be the organization of the user, if one is not provided it will be generated
21
- */
22
- organizationIdentity?: string;
23
- /**
24
- * The mnemonic for the organization, if empty and node-admin-user feature is enabled it will be randomly generated.
25
- */
26
- organizationMnemonic?: string;
27
- /**
28
- * If the node-admin-user feature is enabled, this will be the identity of the user, if one is not provided it will be generated
29
- */
30
- adminUserIdentity?: string;
31
- /**
32
- * The mnemonic for the admin user, if empty and node-admin-user feature is enabled it will be randomly generated.
33
- */
34
- adminUserMnemonic?: string;
35
- /**
36
- * If the node-admin-user feature is enabled, this will be the name of the user.
37
- * @default admin@node
38
- */
39
- adminUserName?: string;
40
- /**
41
- * If the node-admin-user feature is enabled, this will be the password of the user, if empty it will be randomly generated.
42
- */
43
- adminUserPassword?: string;
44
6
  /**
45
7
  * Maximum size in MB for HTTPS extensions downloads.
46
8
  * @default 10
@@ -7,8 +7,8 @@ import type { INodeEnvironmentVariables } from "./INodeEnvironmentVariables.js";
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
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type for the properties in commands.
3
+ */
4
+ export type CliCommandParamType = string | number | boolean;
@@ -7,17 +7,18 @@ import type { INodeEngineState } from "./models/INodeEngineState.js";
7
7
  import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
8
8
  import type { INodeOptions } from "./models/INodeOptions.js";
9
9
  /**
10
- * Run the TWIN Node server.
10
+ * Run the TWIN Node.
11
11
  * @param nodeOptions Optional configuration options for running the server.
12
+ * @param args Optional command line arguments.
12
13
  * @returns A promise that resolves when the server is started containing a shutdown method.
13
14
  */
14
- export declare function run(nodeOptions?: INodeOptions): Promise<{
15
+ export declare function run(nodeOptions?: INodeOptions, args?: string[]): Promise<{
15
16
  engine: Engine<IEngineServerConfig, INodeEngineState>;
16
17
  server: EngineServer;
17
18
  shutdown: () => Promise<void>;
18
19
  } | undefined>;
19
20
  /**
20
- * Build the configuration for the TWIN Node server.
21
+ * Build the configuration for the TWIN Node.
21
22
  * @param processEnv The environment variables from the process.
22
23
  * @param options The options for running the server.
23
24
  * @param serverInfo The server information.
@@ -33,7 +34,7 @@ export declare function buildConfiguration(processEnv: {
33
34
  nodeEngineConfig: INodeEngineConfig;
34
35
  availableContextIdKeys: {
35
36
  key: string;
36
- componentFeatures: string[];
37
+ requiredHandlerFeatures: string[];
37
38
  }[];
38
39
  }>;
39
40
  /**
@@ -1,6 +1,7 @@
1
1
  import { Engine } from "@twin.org/engine";
2
2
  import { EngineServer } from "@twin.org/engine-server";
3
3
  import type { IEngineServerConfig } from "@twin.org/engine-server-types";
4
+ import type { ICliCommand } from "./models/ICliCommand.js";
4
5
  import type { INodeEngineConfig } from "./models/INodeEngineConfig.js";
5
6
  import type { INodeEngineState } from "./models/INodeEngineState.js";
6
7
  import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
@@ -10,12 +11,13 @@ import type { INodeOptions } from "./models/INodeOptions.js";
10
11
  * @param nodeOptions Optional run options for the engine server.
11
12
  * @param nodeEngineConfig The configuration for the engine server.
12
13
  * @param envVars The environment variables.
14
+ * @param cliCommand The constructed CLI command (optional).
13
15
  * @param availableContextIdKeys The context ID keys available for operation.
14
16
  * @returns The engine server.
15
17
  */
16
- export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, availableContextIdKeys?: {
18
+ export declare function start(nodeOptions: INodeOptions | undefined, nodeEngineConfig: INodeEngineConfig, envVars: INodeEnvironmentVariables, cliCommand?: ICliCommand, availableContextIdKeys?: {
17
19
  key: string;
18
- componentFeatures: string[];
20
+ requiredHandlerFeatures: string[];
19
21
  }[]): Promise<{
20
22
  engine: Engine<IEngineServerConfig, INodeEngineState>;
21
23
  server: EngineServer;
@@ -1,8 +1,6 @@
1
1
  import type { IModuleProtocol } from "./models/IModuleProtocol.js";
2
- import type { INodeEnvironmentVariables } from "./models/INodeEnvironmentVariables.js";
3
2
  import type { IProtocolHandlerResult } from "./models/IProtocolHandlerResult.js";
4
3
  import { ModuleProtocol } from "./models/moduleProtocol.js";
5
- import { NodeFeatures } from "./models/nodeFeatures.js";
6
4
  /**
7
5
  * Initialise the locales for the application.
8
6
  * @param localesDirectory The directory containing the locales.
@@ -13,6 +11,12 @@ export declare function initialiseLocales(localesDirectory: string): Promise<voi
13
11
  * @returns The execution directory.
14
12
  */
15
13
  export declare function getExecutionDirectory(): string;
14
+ /**
15
+ * Get the directory where the script is located.
16
+ * @param args The command line arguments.
17
+ * @returns The execution directory.
18
+ */
19
+ export declare function getScriptDirectory(args?: string[]): string;
16
20
  /**
17
21
  * Does the specified file exist.
18
22
  * @param filename The filename to check for existence.
@@ -49,12 +53,6 @@ export declare function loadTextFile(filename: string): Promise<string>;
49
53
  * @returns The contents of the JSON file or null if it could not be loaded.
50
54
  */
51
55
  export declare function loadJsonFile<T>(filename: string): Promise<T>;
52
- /**
53
- * Get the features that are enabled on the node.
54
- * @param env The environment variables for the node.
55
- * @returns The features that are enabled on the node.
56
- */
57
- export declare function getFeatures(env: INodeEnvironmentVariables): NodeFeatures[];
58
56
  /**
59
57
  * Parse the protocol from a module name.
60
58
  * @param moduleName The module name to parse.
package/docs/changelog.md CHANGED
@@ -1,4 +1,209 @@
1
- # @twin.org/node-core - Changelog
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.31](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.30...node-core-v0.0.3-next.31) (2026-04-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * authentication services ([#118](https://github.com/twinfoundation/node/issues/118)) ([311a7f8](https://github.com/twinfoundation/node/commit/311a7f882db1e50a83e94d2dae32fefc68debb47))
9
+
10
+ ## [0.0.3-next.30](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.29...node-core-v0.0.3-next.30) (2026-04-06)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * bootstrap vault key skip logic ([#112](https://github.com/twinfoundation/node/issues/112)) ([4084368](https://github.com/twinfoundation/node/commit/4084368f0762c3a1b8e214ac30f5545297c88ea6))
16
+
17
+ ## [0.0.3-next.29](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.28...node-core-v0.0.3-next.29) (2026-03-20)
18
+
19
+
20
+ ### Features
21
+
22
+ * update dependencies ([aab05b5](https://github.com/twinfoundation/node/commit/aab05b552152a208a504fb9a080603f1990d4f79))
23
+
24
+ ## [0.0.3-next.28](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.27...node-core-v0.0.3-next.28) (2026-03-12)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * bootstrap legacy fails on second run ([c0a4e6d](https://github.com/twinfoundation/node/commit/c0a4e6d6f8d1bf385412a22fed2a0974e219abaa))
30
+
31
+ ## [0.0.3-next.27](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.26...node-core-v0.0.3-next.27) (2026-03-09)
32
+
33
+
34
+ ### Features
35
+
36
+ * bootstrap legacy skip ([469d950](https://github.com/twinfoundation/node/commit/469d9505bd0497c271ba291641f63786200cb548))
37
+
38
+ ## [0.0.3-next.26](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.25...node-core-v0.0.3-next.26) (2026-03-05)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * synchronised storage construction ([#102](https://github.com/twinfoundation/node/issues/102)) ([58b61e9](https://github.com/twinfoundation/node/commit/58b61e9a67f499a35bea17e5d2dc6a1efc2cb893))
44
+
45
+ ## [0.0.3-next.25](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.24...node-core-v0.0.3-next.25) (2026-03-04)
46
+
47
+
48
+ ### Features
49
+
50
+ * custom REST paths ([#99](https://github.com/twinfoundation/node/issues/99)) ([dcab1b2](https://github.com/twinfoundation/node/commit/dcab1b2b23c13b4c9f39c3c1c67284f56e732bd1))
51
+
52
+ ## [0.0.3-next.24](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.23...node-core-v0.0.3-next.24) (2026-03-02)
53
+
54
+
55
+ ### Features
56
+
57
+ * align node module with dataspace rename and control plane integ… ([#95](https://github.com/twinfoundation/node/issues/95)) ([8129868](https://github.com/twinfoundation/node/commit/812986886fb5d779dd380956c4e6cc47c2d73530))
58
+
59
+ ## [0.0.3-next.23](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.22...node-core-v0.0.3-next.23) (2026-02-26)
60
+
61
+
62
+ ### Features
63
+
64
+ * update engine ([a40b377](https://github.com/twinfoundation/node/commit/a40b37726c3b61c6bb40265ec0006d1071ffac7e))
65
+
66
+ ## [0.0.3-next.22](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.21...node-core-v0.0.3-next.22) (2026-02-23)
67
+
68
+
69
+ ### Features
70
+
71
+ * cache the npm root to increase startup speed ([f10ea9e](https://github.com/twinfoundation/node/commit/f10ea9e22cc202f320df5fb21507b886c1f7345b))
72
+ * update engine ([4b438e2](https://github.com/twinfoundation/node/commit/4b438e22c27d784ee6cc964b7cb4401e9699ab16))
73
+
74
+
75
+ ### Bug Fixes
76
+
77
+ * test with latest dependencies ([91123b7](https://github.com/twinfoundation/node/commit/91123b71d0e7b51700a5d5452b2a0c9fc5c5256e))
78
+
79
+ ## [0.0.3-next.21](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.20...node-core-v0.0.3-next.21) (2026-02-13)
80
+
81
+
82
+ ### Features
83
+
84
+ * add obligation enforcers and multi instance support ([#89](https://github.com/twinfoundation/node/issues/89)) ([d81af99](https://github.com/twinfoundation/node/commit/d81af99b8c4db6e9a1370b7065bf6d9d222c71ed))
85
+
86
+ ## [0.0.3-next.20](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.19...node-core-v0.0.3-next.20) (2026-02-06)
87
+
88
+
89
+ ### Features
90
+
91
+ * update dependencies ([6cb3d3a](https://github.com/twinfoundation/node/commit/6cb3d3a63f7b976f80074ddecfba034b7e92f919))
92
+
93
+ ## [0.0.3-next.19](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.18...node-core-v0.0.3-next.19) (2026-02-05)
94
+
95
+
96
+ ### Miscellaneous Chores
97
+
98
+ * **node-core:** Synchronize repo versions
99
+
100
+ ## [0.0.3-next.18](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.17...node-core-v0.0.3-next.18) (2026-02-04)
101
+
102
+
103
+ ### Features
104
+
105
+ * env-prefix option and user-update cli command ([#83](https://github.com/twinfoundation/node/issues/83)) ([fc48efa](https://github.com/twinfoundation/node/commit/fc48efa7ad72173def048170c3afb5eeb9f1b292))
106
+
107
+ ## [0.0.3-next.17](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.16...node-core-v0.0.3-next.17) (2026-02-02)
108
+
109
+
110
+ ### Features
111
+
112
+ * update rights management ([5c992c6](https://github.com/twinfoundation/node/commit/5c992c6b0d72f3eeaa39ee267e096d9a3f477f4e))
113
+
114
+ ## [0.0.3-next.16](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.15...node-core-v0.0.3-next.16) (2026-01-28)
115
+
116
+
117
+ ### Features
118
+
119
+ * remove dap and darp ([36c3ffb](https://github.com/twinfoundation/node/commit/36c3ffb31af65a0e3025859dab675efeee043155))
120
+
121
+ ## [0.0.3-next.15](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.14...node-core-v0.0.3-next.15) (2026-01-26)
122
+
123
+
124
+ ### Features
125
+
126
+ * support public origin and hosting service ([#77](https://github.com/twinfoundation/node/issues/77)) ([3b9039f](https://github.com/twinfoundation/node/commit/3b9039fcba7f7038c06f8fd6a5ccc9fdbbf535b3))
127
+ * update context usage ([2215440](https://github.com/twinfoundation/node/commit/2215440801dea3955885b6579ad9b98b7a5d87ea))
128
+
129
+ ## [0.0.3-next.14](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.13...node-core-v0.0.3-next.14) (2026-01-21)
130
+
131
+
132
+ ### Features
133
+
134
+ * add vault prefix configuration ([#75](https://github.com/twinfoundation/node/issues/75)) ([1d4afb1](https://github.com/twinfoundation/node/commit/1d4afb1b1a8aa60795898eeb9e7f5153c279527d))
135
+
136
+ ## [0.0.3-next.13](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.12...node-core-v0.0.3-next.13) (2026-01-19)
137
+
138
+
139
+ ### Features
140
+
141
+ * add trust ttl ([#73](https://github.com/twinfoundation/node/issues/73)) ([911cee7](https://github.com/twinfoundation/node/commit/911cee771bba490143bb1574ca8360f7cf8baa1a))
142
+ * update order of logging ([2161938](https://github.com/twinfoundation/node/commit/2161938c969b18e4678459a69090287e5ccdb404))
143
+ * update order of logging ([b295f31](https://github.com/twinfoundation/node/commit/b295f315f7c5b611d229d9e5314d414da05828b9))
144
+
145
+ ## [0.0.3-next.12](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.11...node-core-v0.0.3-next.12) (2026-01-19)
146
+
147
+
148
+ ### Features
149
+
150
+ * separate script directory from exec directory ([f6bb4db](https://github.com/twinfoundation/node/commit/f6bb4dbea1f1e200e0640fa154c6997ef99c99b4))
151
+
152
+ ## [0.0.3-next.11](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.10...node-core-v0.0.3-next.11) (2026-01-19)
153
+
154
+
155
+ ### Bug Fixes
156
+
157
+ * improve calculation of execution directory ([106d65d](https://github.com/twinfoundation/node/commit/106d65d7ad5524e2e147b681d68f9476c024cfaa))
158
+
159
+ ## [0.0.3-next.10](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.9...node-core-v0.0.3-next.10) (2026-01-19)
160
+
161
+
162
+ ### Features
163
+
164
+ * add CLI commands and remove automated bootstrap code ([#69](https://github.com/twinfoundation/node/issues/69)) ([6e40933](https://github.com/twinfoundation/node/commit/6e40933d8bb820b380e1074fc88feeedca0ef7d9))
165
+
166
+ ## [0.0.3-next.9](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.8...node-core-v0.0.3-next.9) (2026-01-07)
167
+
168
+
169
+ ### Features
170
+
171
+ * improve bootstrapping and shutdown behaviour ([#66](https://github.com/twinfoundation/node/issues/66)) ([65b3452](https://github.com/twinfoundation/node/commit/65b345240334bfff48b52e136cc486cd7ac7f290))
172
+
173
+ ## [0.0.3-next.8](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.7...node-core-v0.0.3-next.8) (2026-01-05)
174
+
175
+
176
+ ### Features
177
+
178
+ * update for livez endpoint ([9fc2e6a](https://github.com/twinfoundation/node/commit/9fc2e6ade38b3ec9591399a633d02b1e5fe07910))
179
+
180
+ ## [0.0.3-next.7](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.6...node-core-v0.0.3-next.7) (2025-12-04)
181
+
182
+
183
+ ### Features
184
+
185
+ * add trust and rights management plugin support ([cdeb504](https://github.com/twinfoundation/node/commit/cdeb504ee5986a347466162b9afa781645b4a54c))
186
+
187
+ ## [0.0.3-next.6](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.5...node-core-v0.0.3-next.6) (2025-11-28)
188
+
189
+
190
+ ### Features
191
+
192
+ * update background tasks and add fedcat filters ([1fd297e](https://github.com/twinfoundation/node/commit/1fd297e29f60b5bb3909638b68e326c5b0e2d77d))
193
+
194
+ ## [0.0.3-next.5](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.4...node-core-v0.0.3-next.5) (2025-11-26)
195
+
196
+
197
+ ### Features
198
+
199
+ * add support for dynamodb connection timeout ([63051b0](https://github.com/twinfoundation/node/commit/63051b0d22138079115dfac921e7f0c45eaad34e))
200
+
201
+ ## [0.0.3-next.4](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.3...node-core-v0.0.3-next.4) (2025-11-24)
202
+
203
+
204
+ ### Bug Fixes
205
+
206
+ * org identity verification methods ([18f158b](https://github.com/twinfoundation/node/commit/18f158b2f63930e20e94437c17ed43421771a458))
2
207
 
3
208
  ## [0.0.3-next.3](https://github.com/twinfoundation/node/compare/node-core-v0.0.3-next.2...node-core-v0.0.3-next.3) (2025-11-20)
4
209