@twin.org/node 0.0.3-next.27 → 0.0.3-next.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,40 +1,30 @@
1
1
  # TWIN Node
2
2
 
3
- A REST server implementation support the routes from various packages.
3
+ This app provides the executable server runtime for delivering service workloads through a deployable Node.js application. It assembles shared runtime components into a practical entry point so teams can run, configure, and operate service endpoints with predictable behaviour.
4
4
 
5
- The OpenAPI Spec can be found here [TWIN Node OpenAPI Spec](https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/twinfoundation/node/refs/heads/next/apps/node/docs/open-api/spec.json)
5
+ It supports local development and production aligned operation while keeping configuration and extension patterns explicit. The generated OpenAPI specification offers a clear integration contract and helps maintain consistency across consuming systems.
6
6
 
7
- ## Building and running the application
8
-
9
- To install the dependencies, perform a full build and start the server.
7
+ ## Installation
10
8
 
11
9
  ```shell
12
- npm install
13
- npm run dist
14
- npm start
10
+ npm install -D @twin.org/node
15
11
  ```
16
12
 
17
- ## Development mode
18
-
19
- Once you have performed a full build you can run the server in development mode, this will watch the TypeScript code, rebuild if there are any changes, and relaunch the server.
20
-
21
- ```shell
22
- npm run dev
23
- ```
13
+ ## Configuration
24
14
 
25
- ## Extensions
15
+ Configuration options are documented in [docs/configuration.md](docs/configuration.md)
26
16
 
27
- The TWIN Node supports dynamic extension loading from multiple sources (local files, npm packages, HTTPS URLs).
17
+ ## Deployment
28
18
 
29
- For complete extension documentation, including syntax, lifecycle hooks, and configuration options, see [Extension Loading](docs/configuration.md#extension-loading).
19
+ Examples of how to deploy the app can be found in [docs/deployment.md](docs/deployment.md)
30
20
 
31
- ## Configuration
21
+ ## Usage
32
22
 
33
- There are various options you can set through configuration, these can be found in [docs/configuration.md](docs/configuration.md)
23
+ Usage of the tool is shown in the examples [docs/usage.md](docs/usage.md)
34
24
 
35
- ## Deployment
25
+ ## Reference
36
26
 
37
- Examples of how to deploy the app can be found in [docs/deployment.md](docs/deployment.md)
27
+ Detailed reference documentation for the API can be found in [docs/open-api/spec.json](docs/open-api/spec.json)
38
28
 
39
29
  ## Changelog
40
30
 
@@ -125,9 +125,10 @@
125
125
  "atLeastOneNumber": "The value should contain at least one number",
126
126
  "atLeastOneSpecialChar": "The value should contain at least one symbol",
127
127
  "schema": {
128
- "failedValidation": "The JSON schema failed validation, {message}",
129
128
  "missingType": "Failed to validate as there is no handler for type \"{dataType}\""
130
129
  },
130
+ "schemaFailed": "Schema failed validation, \"{message}\", keyword: \"{keyword}\", schemaPath: \"{schemaPath}\"",
131
+ "missingType": "The object must include at least one @type value",
131
132
  "geo": {
132
133
  "coordinatesLatitudeNumber": "The latitude value must be a number",
133
134
  "coordinatesLatitudeRange": "The latitude value must be between -90 and 90",
@@ -560,7 +561,6 @@
560
561
  "activityStillProcessing": "Activity is still being processed",
561
562
  "noFailedTasksToRetry": "Activity has error status but no failed tasks to retry",
562
563
  "invalidActivityGeneratorIdentity": "Invalid activity. No identity specified either on 'generator' or 'actor'",
563
- "invalidActivity": "Invalid Activity. Expected fields not specified",
564
564
  "unknownActivityLogEntryId": "Unknown Activity Log Entry Id \"{activityLogEntryId}\"",
565
565
  "tooManyAppsRegistered": "There are several DS Apps registered for Dataset \"{datasetId}\"",
566
566
  "noAppRegistered": "There are no DS Apps registered for Dataset \"{datasetId}\"",
@@ -687,7 +687,6 @@
687
687
  },
688
688
  "federatedCatalogueService": {
689
689
  "datasetNotFound": "Dataset with ID \"{notFoundId}\" not found in the catalogue",
690
- "datasetNotConformant": "Dataset \"{dataSetId}\" does not conform to DS Protocol specification",
691
690
  "datasetIdInvalidUri": "Dataset @id \"{dataSetId}\" must be a valid URI (URN or URL) per DS Protocol",
692
691
  "datasetMissingPublisher": "Dataset \"{dataSetId}\" is missing required dcterms:publisher property (needed for participant identification)",
693
692
  "filterIndexCreationFailed": "Failed to create filter index for dataset \"{dataSetId}\" using filter \"{filterType}\"",
@@ -786,6 +785,13 @@
786
785
  "gasStationTransactionFailed": "The gas station transaction failed",
787
786
  "dryRunFailed": "The dry run execution failed"
788
787
  },
788
+ "iotaIdentityUtils": {
789
+ "getControllerCapInfoFailed": "Getting the controller capability info for the identity failed",
790
+ "identityNotFound": "The identity could not be found \"{notFoundId}\"",
791
+ "identityDeleted": "The identity \"{identityId}\" has been deleted and cannot be used for minting",
792
+ "controllerTokenNotFound": "No controller token found for the identity \"{notFoundId}\" with the provided controller address",
793
+ "unexpectedSignerCall": "The no-op signer was unexpectedly called during a read-only identity lookup"
794
+ },
789
795
  "iotaSmartContractUtils": {
790
796
  "migrationFailed": "Smart contract migration failed",
791
797
  "migrateSmartContractFailed": "Failed to migrate smart contract for object \"{objectId}\"",
package/docs/changelog.md CHANGED
@@ -1,4 +1,18 @@
1
- # @twin.org/node - Changelog
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.28](https://github.com/twinfoundation/node/compare/node-v0.0.3-next.27...node-v0.0.3-next.28) (2026-03-12)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **node:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/node-core bumped from 0.0.3-next.27 to 0.0.3-next.28
2
16
 
3
17
  ## [0.0.3-next.27](https://github.com/twinfoundation/node/compare/node-v0.0.3-next.26...node-v0.0.3-next.27) (2026-03-09)
4
18
 
@@ -1,4 +1,4 @@
1
- # @twin.org/node - Configuration
1
+ # Node Configuration
2
2
 
3
3
  ## Extension Loading
4
4
 
@@ -1,4 +1,4 @@
1
- # @twin.org/node - Deployment Docker
1
+ # Node Deployment Docker
2
2
 
3
3
  ## Docker Building
4
4
 
@@ -1,4 +1,4 @@
1
- # @twin.org/node - Deployment Amazon AWS EC2
1
+ # Node Deployment Amazon AWS EC2
2
2
 
3
3
  ## Amazon AWS EC2 Instance
4
4
 
@@ -1,4 +1,4 @@
1
- # @twin.org/node - Deployment
1
+ # Node Deployment
2
2
 
3
3
  - [Docker](./deployment-docker.md) - Guide to deploying with docker.
4
4
  - [Amazon AWS EC2](./deployment-ec2.md) - Guide to deploying with Amazon AWS EC2.
@@ -13690,8 +13690,8 @@
13690
13690
  "dcterms:title": "Energy Consumption Data",
13691
13691
  "dcterms:description": "Historical energy consumption data",
13692
13692
  "hasPolicy": {
13693
+ "@id": "urn:uuid:policy-456",
13693
13694
  "@type": "Offer",
13694
- "uid": "urn:uuid:policy-456",
13695
13695
  "assigner": "did:example:data-provider-789"
13696
13696
  },
13697
13697
  "distribution": {
@@ -14296,11 +14296,6 @@
14296
14296
  "tags": [
14297
14297
  "Transfer Process"
14298
14298
  ],
14299
- "security": [
14300
- {
14301
- "jwtBearerAuthScheme": []
14302
- }
14303
- ],
14304
14299
  "responses": {
14305
14300
  "200": {
14306
14301
  "description": "The rest request ended in success with no data.",
@@ -14333,24 +14328,6 @@
14333
14328
  }
14334
14329
  }
14335
14330
  },
14336
- "401": {
14337
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14338
- "content": {
14339
- "application/json": {
14340
- "schema": {
14341
- "$ref": "#/components/schemas/Error"
14342
- },
14343
- "examples": {
14344
- "exampleResponse": {
14345
- "value": {
14346
- "name": "UnauthorizedError",
14347
- "message": "errorMessage"
14348
- }
14349
- }
14350
- }
14351
- }
14352
- }
14353
- },
14354
14331
  "500": {
14355
14332
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14356
14333
  "content": {
@@ -14391,11 +14368,6 @@
14391
14368
  "style": "simple"
14392
14369
  }
14393
14370
  ],
14394
- "security": [
14395
- {
14396
- "jwtBearerAuthScheme": []
14397
- }
14398
- ],
14399
14371
  "responses": {
14400
14372
  "200": {
14401
14373
  "description": "The rest request ended in success with no data.",
@@ -14428,24 +14400,6 @@
14428
14400
  }
14429
14401
  }
14430
14402
  },
14431
- "401": {
14432
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14433
- "content": {
14434
- "application/json": {
14435
- "schema": {
14436
- "$ref": "#/components/schemas/Error"
14437
- },
14438
- "examples": {
14439
- "exampleResponse": {
14440
- "value": {
14441
- "name": "UnauthorizedError",
14442
- "message": "errorMessage"
14443
- }
14444
- }
14445
- }
14446
- }
14447
- }
14448
- },
14449
14403
  "500": {
14450
14404
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14451
14405
  "content": {
@@ -14486,11 +14440,6 @@
14486
14440
  "style": "simple"
14487
14441
  }
14488
14442
  ],
14489
- "security": [
14490
- {
14491
- "jwtBearerAuthScheme": []
14492
- }
14493
- ],
14494
14443
  "responses": {
14495
14444
  "200": {
14496
14445
  "description": "The rest request ended in success with no data.",
@@ -14523,24 +14472,6 @@
14523
14472
  }
14524
14473
  }
14525
14474
  },
14526
- "401": {
14527
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14528
- "content": {
14529
- "application/json": {
14530
- "schema": {
14531
- "$ref": "#/components/schemas/Error"
14532
- },
14533
- "examples": {
14534
- "exampleResponse": {
14535
- "value": {
14536
- "name": "UnauthorizedError",
14537
- "message": "errorMessage"
14538
- }
14539
- }
14540
- }
14541
- }
14542
- }
14543
- },
14544
14475
  "500": {
14545
14476
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14546
14477
  "content": {
@@ -14581,11 +14512,6 @@
14581
14512
  "style": "simple"
14582
14513
  }
14583
14514
  ],
14584
- "security": [
14585
- {
14586
- "jwtBearerAuthScheme": []
14587
- }
14588
- ],
14589
14515
  "responses": {
14590
14516
  "200": {
14591
14517
  "description": "The rest request ended in success with no data.",
@@ -14618,24 +14544,6 @@
14618
14544
  }
14619
14545
  }
14620
14546
  },
14621
- "401": {
14622
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14623
- "content": {
14624
- "application/json": {
14625
- "schema": {
14626
- "$ref": "#/components/schemas/Error"
14627
- },
14628
- "examples": {
14629
- "exampleResponse": {
14630
- "value": {
14631
- "name": "UnauthorizedError",
14632
- "message": "errorMessage"
14633
- }
14634
- }
14635
- }
14636
- }
14637
- }
14638
- },
14639
14547
  "500": {
14640
14548
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14641
14549
  "content": {
@@ -14676,11 +14584,6 @@
14676
14584
  "style": "simple"
14677
14585
  }
14678
14586
  ],
14679
- "security": [
14680
- {
14681
- "jwtBearerAuthScheme": []
14682
- }
14683
- ],
14684
14587
  "responses": {
14685
14588
  "200": {
14686
14589
  "description": "The rest request ended in success with no data.",
@@ -14713,24 +14616,6 @@
14713
14616
  }
14714
14617
  }
14715
14618
  },
14716
- "401": {
14717
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14718
- "content": {
14719
- "application/json": {
14720
- "schema": {
14721
- "$ref": "#/components/schemas/Error"
14722
- },
14723
- "examples": {
14724
- "exampleResponse": {
14725
- "value": {
14726
- "name": "UnauthorizedError",
14727
- "message": "errorMessage"
14728
- }
14729
- }
14730
- }
14731
- }
14732
- }
14733
- },
14734
14619
  "500": {
14735
14620
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14736
14621
  "content": {
@@ -14771,11 +14656,6 @@
14771
14656
  "style": "simple"
14772
14657
  }
14773
14658
  ],
14774
- "security": [
14775
- {
14776
- "jwtBearerAuthScheme": []
14777
- }
14778
- ],
14779
14659
  "responses": {
14780
14660
  "200": {
14781
14661
  "description": "The rest request ended in success with no data.",
@@ -14808,24 +14688,6 @@
14808
14688
  }
14809
14689
  }
14810
14690
  },
14811
- "401": {
14812
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
14813
- "content": {
14814
- "application/json": {
14815
- "schema": {
14816
- "$ref": "#/components/schemas/Error"
14817
- },
14818
- "examples": {
14819
- "exampleResponse": {
14820
- "value": {
14821
- "name": "UnauthorizedError",
14822
- "message": "errorMessage"
14823
- }
14824
- }
14825
- }
14826
- }
14827
- }
14828
- },
14829
14691
  "500": {
14830
14692
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
14831
14693
  "content": {
@@ -14865,7 +14727,7 @@
14865
14727
  "content": {
14866
14728
  "application/json": {
14867
14729
  "schema": {
14868
- "$ref": "#/components/schemas/PapCreateRequest"
14730
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdObjectWithOptionalAtId<DataspaceProtocolPolicy>"
14869
14731
  },
14870
14732
  "examples": {
14871
14733
  "papCreateRequestExample": {
@@ -15046,7 +14908,7 @@
15046
14908
  {
15047
14909
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15048
14910
  "@type": "Set",
15049
- "uid": "urn:rights-management:abc123def456",
14911
+ "@id": "urn:rights-management:abc123def456",
15050
14912
  "permission": [
15051
14913
  {
15052
14914
  "target": "http://example.com/asset/1",
@@ -15151,14 +15013,14 @@
15151
15013
  "content": {
15152
15014
  "application/json": {
15153
15015
  "schema": {
15154
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPolicy"
15016
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolPolicy"
15155
15017
  },
15156
15018
  "examples": {
15157
15019
  "papUpdateRequestExample": {
15158
15020
  "value": {
15159
15021
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15160
15022
  "@type": "Set",
15161
- "uid": "urn:rights-management:abc123def456",
15023
+ "@id": "urn:rights-management:abc123def456",
15162
15024
  "permission": [
15163
15025
  {
15164
15026
  "target": "http://example.com/asset/2",
@@ -15264,14 +15126,14 @@
15264
15126
  "content": {
15265
15127
  "application/json": {
15266
15128
  "schema": {
15267
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPolicy"
15129
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolPolicy"
15268
15130
  },
15269
15131
  "examples": {
15270
15132
  "papGetResponseExample": {
15271
15133
  "value": {
15272
15134
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15273
15135
  "@type": "Set",
15274
- "uid": "urn:rights-management:abc123def456",
15136
+ "@id": "urn:rights-management:abc123def456",
15275
15137
  "permission": [
15276
15138
  {
15277
15139
  "target": "http://example.com/asset/1",
@@ -15462,14 +15324,14 @@
15462
15324
  "content": {
15463
15325
  "application/json": {
15464
15326
  "schema": {
15465
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAgreement"
15327
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolAgreement"
15466
15328
  },
15467
15329
  "examples": {
15468
15330
  "papGetResponseExample": {
15469
15331
  "value": {
15470
15332
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15471
15333
  "@type": "Agreement",
15472
- "uid": "urn:rights-management:abc123def456",
15334
+ "@id": "urn:rights-management:abc123def456",
15473
15335
  "permission": [
15474
15336
  {
15475
15337
  "target": "http://example.com/asset/1",
@@ -15575,14 +15437,14 @@
15575
15437
  "content": {
15576
15438
  "application/json": {
15577
15439
  "schema": {
15578
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlOffer"
15440
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolOffer"
15579
15441
  },
15580
15442
  "examples": {
15581
15443
  "papGetResponseExample": {
15582
15444
  "value": {
15583
15445
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15584
15446
  "@type": "Offer",
15585
- "uid": "urn:rights-management:abc123def456",
15447
+ "@id": "urn:rights-management:abc123def456",
15586
15448
  "permission": [
15587
15449
  {
15588
15450
  "target": "http://example.com/asset/1",
@@ -15688,14 +15550,14 @@
15688
15550
  "content": {
15689
15551
  "application/json": {
15690
15552
  "schema": {
15691
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlSet"
15553
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolSet"
15692
15554
  },
15693
15555
  "examples": {
15694
15556
  "papGetResponseExample": {
15695
15557
  "value": {
15696
15558
  "@context": "http://www.w3.org/ns/odrl.jsonld",
15697
15559
  "@type": "Set",
15698
- "uid": "urn:rights-management:abc123def456",
15560
+ "@id": "urn:rights-management:abc123def456",
15699
15561
  "permission": [
15700
15562
  {
15701
15563
  "target": "http://example.com/asset/1",
@@ -15922,9 +15784,8 @@
15922
15784
  "@type": "ContractRequestMessage",
15923
15785
  "consumerPid": "urn:contract-negotiation:22aa11bb.......ffff",
15924
15786
  "offer": {
15925
- "@context": "http://www.w3.org/ns/odrl.jsonld",
15926
15787
  "@type": "Offer",
15927
- "uid": "urn:offer-1",
15788
+ "@id": "urn:offer-1",
15928
15789
  "assigner": "urn:provider:node:1"
15929
15790
  }
15930
15791
  }
@@ -16036,9 +15897,8 @@
16036
15897
  "@type": "ContractRequestMessage",
16037
15898
  "consumerPid": "urn:contract-negotiation:22aa11bb.......ffff",
16038
15899
  "offer": {
16039
- "@context": "http://www.w3.org/ns/odrl.jsonld",
16040
15900
  "@type": "Offer",
16041
- "uid": "urn:offer-1",
15901
+ "@id": "urn:offer-1",
16042
15902
  "assigner": "urn:provider:node:1"
16043
15903
  }
16044
15904
  }
@@ -16496,9 +16356,8 @@
16496
16356
  "providerPid": "urn:contract-negotiation:00aa11bb.......ffff",
16497
16357
  "consumerPid": "urn:contract-negotiation:22aa11bb.......ffff",
16498
16358
  "offer": {
16499
- "@context": "http://www.w3.org/ns/odrl.jsonld",
16500
16359
  "@type": "Offer",
16501
- "uid": "urn:offer-1",
16360
+ "@id": "urn:offer-1",
16502
16361
  "assigner": "urn:provider:node:1"
16503
16362
  }
16504
16363
  }
@@ -16610,9 +16469,8 @@
16610
16469
  "providerPid": "urn:contract-negotiation:00aa11bb.......ffff",
16611
16470
  "consumerPid": "urn:contract-negotiation:22aa11bb.......ffff",
16612
16471
  "offer": {
16613
- "@context": "http://www.w3.org/ns/odrl.jsonld",
16614
16472
  "@type": "Offer",
16615
- "uid": "urn:offer-1",
16473
+ "@id": "urn:offer-1",
16616
16474
  "assigner": "urn:provider:node:1"
16617
16475
  }
16618
16476
  }
@@ -16744,9 +16602,8 @@
16744
16602
  "providerPid": "urn:contract-negotiation:00aa11bb.......ffff",
16745
16603
  "consumerPid": "urn:contract-negotiation:22aa11bb.......ffff",
16746
16604
  "agreement": {
16747
- "@context": "http://www.w3.org/ns/odrl.jsonld",
16748
16605
  "@type": "Agreement",
16749
- "uid": "urn:offer-1",
16606
+ "@id": "urn:offer-1",
16750
16607
  "assigner": "urn:provider:node:1",
16751
16608
  "assignee": "urn:consumer:node:1"
16752
16609
  }
@@ -17410,7 +17267,6 @@
17410
17267
  "$ref": "#/components/schemas/ActivityStreamsContextType"
17411
17268
  },
17412
17269
  "type": {
17413
- "description": "Object or array data type",
17414
17270
  "anyOf": [
17415
17271
  {
17416
17272
  "$ref": "#/components/schemas/ActivityStreamsTypes"
@@ -17431,11 +17287,13 @@
17431
17287
  ]
17432
17288
  }
17433
17289
  }
17434
- ]
17290
+ ],
17291
+ "description": "Activity Type."
17435
17292
  },
17436
17293
  "id": {
17437
17294
  "type": "string",
17438
- "description": "Global identifier."
17295
+ "description": "Global identifier.",
17296
+ "format": "uri"
17439
17297
  },
17440
17298
  "name": {
17441
17299
  "anyOf": [
@@ -17553,23 +17411,28 @@
17553
17411
  },
17554
17412
  "published": {
17555
17413
  "type": "string",
17556
- "description": "Published date-time."
17414
+ "description": "Published date-time.",
17415
+ "format": "date-time"
17557
17416
  },
17558
17417
  "updated": {
17559
17418
  "type": "string",
17560
- "description": "The date and time at which the object was updated."
17419
+ "description": "Updated date-time.",
17420
+ "format": "date-time"
17561
17421
  },
17562
17422
  "startTime": {
17563
17423
  "type": "string",
17564
- "description": "Start time."
17424
+ "description": "Start time.",
17425
+ "format": "date-time"
17565
17426
  },
17566
17427
  "endTime": {
17567
17428
  "type": "string",
17568
- "description": "End time."
17429
+ "description": "End time.",
17430
+ "format": "date-time"
17569
17431
  },
17570
17432
  "duration": {
17571
17433
  "type": "string",
17572
- "description": "Duration."
17434
+ "description": "Duration.",
17435
+ "format": "duration"
17573
17436
  },
17574
17437
  "generator": {
17575
17438
  "description": "Object or array data type",
@@ -18058,8 +17921,11 @@
18058
17921
  },
18059
17922
  {
18060
17923
  "type": "array",
18061
- "minItems": 1,
17924
+ "minItems": 2,
18062
17925
  "prefixItems": [
17926
+ {
17927
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
17928
+ },
18063
17929
  {
18064
17930
  "type": "string",
18065
17931
  "const": "https://www.w3.org/ns/activitystreams"
@@ -18071,11 +17937,14 @@
18071
17937
  },
18072
17938
  {
18073
17939
  "type": "array",
18074
- "minItems": 1,
17940
+ "minItems": 2,
18075
17941
  "prefixItems": [
18076
17942
  {
18077
17943
  "type": "string",
18078
17944
  "const": "https://www.w3.org/ns/activitystreams"
17945
+ },
17946
+ {
17947
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
18079
17948
  }
18080
17949
  ],
18081
17950
  "items": {
@@ -18085,151 +17954,6 @@
18085
17954
  ],
18086
17955
  "description": "The Activity Streams JSON-LD context type."
18087
17956
  },
18088
- "ActivityStreamsLinkTypes": {
18089
- "anyOf": [
18090
- {
18091
- "type": "string",
18092
- "const": "Link",
18093
- "description": "Link"
18094
- },
18095
- {
18096
- "type": "string",
18097
- "const": "Mention",
18098
- "description": "Mention"
18099
- }
18100
- ],
18101
- "description": "The link types concerning Activity Streams."
18102
- },
18103
- "ActivityStreamsObjectTypes": {
18104
- "anyOf": [
18105
- {
18106
- "type": "string",
18107
- "const": "Object",
18108
- "description": "Object"
18109
- },
18110
- {
18111
- "type": "string",
18112
- "const": "Activity",
18113
- "description": "Activity"
18114
- },
18115
- {
18116
- "type": "string",
18117
- "const": "IntransitiveActivity",
18118
- "description": "IntransitiveActivity"
18119
- },
18120
- {
18121
- "type": "string",
18122
- "const": "Collection",
18123
- "description": "Collection"
18124
- },
18125
- {
18126
- "type": "string",
18127
- "const": "OrderedCollection",
18128
- "description": "OrderedCollection"
18129
- },
18130
- {
18131
- "type": "string",
18132
- "const": "CollectionPage",
18133
- "description": "CollectionPage"
18134
- },
18135
- {
18136
- "type": "string",
18137
- "const": "OrderedCollectionPage",
18138
- "description": "OrderedCollectionPage"
18139
- },
18140
- {
18141
- "type": "string",
18142
- "const": "Actor",
18143
- "description": "Actor"
18144
- },
18145
- {
18146
- "type": "string",
18147
- "const": "Application",
18148
- "description": "Application"
18149
- },
18150
- {
18151
- "type": "string",
18152
- "const": "Group",
18153
- "description": "Group"
18154
- },
18155
- {
18156
- "type": "string",
18157
- "const": "Organization",
18158
- "description": "Organization"
18159
- },
18160
- {
18161
- "type": "string",
18162
- "const": "Person",
18163
- "description": "Person"
18164
- },
18165
- {
18166
- "type": "string",
18167
- "const": "Service",
18168
- "description": "Service"
18169
- },
18170
- {
18171
- "type": "string",
18172
- "const": "Article",
18173
- "description": "Article"
18174
- },
18175
- {
18176
- "type": "string",
18177
- "const": "Audio",
18178
- "description": "Audio"
18179
- },
18180
- {
18181
- "type": "string",
18182
- "const": "Document",
18183
- "description": "Document"
18184
- },
18185
- {
18186
- "type": "string",
18187
- "const": "Event",
18188
- "description": "Event"
18189
- },
18190
- {
18191
- "type": "string",
18192
- "const": "Image",
18193
- "description": "Image"
18194
- },
18195
- {
18196
- "type": "string",
18197
- "const": "Note",
18198
- "description": "Note"
18199
- },
18200
- {
18201
- "type": "string",
18202
- "const": "Page",
18203
- "description": "Page"
18204
- },
18205
- {
18206
- "type": "string",
18207
- "const": "Place",
18208
- "description": "Place"
18209
- },
18210
- {
18211
- "type": "string",
18212
- "const": "Profile",
18213
- "description": "Profile"
18214
- },
18215
- {
18216
- "type": "string",
18217
- "const": "Relationship",
18218
- "description": "Relationship"
18219
- },
18220
- {
18221
- "type": "string",
18222
- "const": "Tombstone",
18223
- "description": "Tombstone"
18224
- },
18225
- {
18226
- "type": "string",
18227
- "const": "Video",
18228
- "description": "Video"
18229
- }
18230
- ],
18231
- "description": "The object types concerning Activity Streams."
18232
- },
18233
17957
  "ActivityStreamsTypes": {
18234
17958
  "anyOf": [
18235
17959
  {
@@ -19776,222 +19500,10 @@
19776
19500
  ],
19777
19501
  "description": "The body which contains the error."
19778
19502
  },
19779
- "PapCreateRequest": {
19780
- "type": "object",
19781
- "properties": {
19782
- "uid": {
19783
- "type": "string"
19784
- },
19785
- "@context": {
19786
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlContextType"
19787
- },
19788
- "@type": {
19789
- "$ref": "https://schema.twindev.org/w3c-odrl/PolicyType"
19790
- },
19791
- "profile": {
19792
- "anyOf": [
19793
- {
19794
- "type": "string"
19795
- },
19796
- {
19797
- "type": "array",
19798
- "items": {
19799
- "type": "string"
19800
- }
19801
- }
19802
- ],
19803
- "description": "The profile(s) this policy conforms to. IRIs identifying the ODRL Profile(s)."
19804
- },
19805
- "assigner": {
19806
- "anyOf": [
19807
- {
19808
- "type": "string"
19809
- },
19810
- {
19811
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlParty"
19812
- },
19813
- {
19814
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPartyCollection"
19815
- },
19816
- {
19817
- "type": "array",
19818
- "items": {
19819
- "anyOf": [
19820
- {
19821
- "type": "string"
19822
- },
19823
- {
19824
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlParty"
19825
- },
19826
- {
19827
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPartyCollection"
19828
- }
19829
- ]
19830
- }
19831
- }
19832
- ],
19833
- "description": "The assigner of the policy. Applies to all rules unless overridden at rule level."
19834
- },
19835
- "assignee": {
19836
- "anyOf": [
19837
- {
19838
- "type": "string"
19839
- },
19840
- {
19841
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlParty"
19842
- },
19843
- {
19844
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPartyCollection"
19845
- },
19846
- {
19847
- "type": "array",
19848
- "items": {
19849
- "anyOf": [
19850
- {
19851
- "type": "string"
19852
- },
19853
- {
19854
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlParty"
19855
- },
19856
- {
19857
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPartyCollection"
19858
- }
19859
- ]
19860
- }
19861
- }
19862
- ],
19863
- "description": "The assignee of the policy. Applies to all rules unless overridden at rule level."
19864
- },
19865
- "target": {
19866
- "anyOf": [
19867
- {
19868
- "type": "string"
19869
- },
19870
- {
19871
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAsset"
19872
- },
19873
- {
19874
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAssetCollection"
19875
- },
19876
- {
19877
- "type": "array",
19878
- "items": {
19879
- "anyOf": [
19880
- {
19881
- "type": "string"
19882
- },
19883
- {
19884
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAsset"
19885
- },
19886
- {
19887
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAssetCollection"
19888
- }
19889
- ]
19890
- }
19891
- }
19892
- ],
19893
- "description": "The target asset for the rule."
19894
- },
19895
- "action": {
19896
- "anyOf": [
19897
- {
19898
- "$ref": "https://schema.twindev.org/w3c-odrl/ActionType"
19899
- },
19900
- {
19901
- "type": "string"
19902
- },
19903
- {
19904
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAction"
19905
- },
19906
- {
19907
- "type": "array",
19908
- "items": {
19909
- "anyOf": [
19910
- {
19911
- "$ref": "https://schema.twindev.org/w3c-odrl/ActionType"
19912
- },
19913
- {
19914
- "type": "string"
19915
- },
19916
- {
19917
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAction"
19918
- }
19919
- ]
19920
- }
19921
- }
19922
- ],
19923
- "description": "The action associated with the rule."
19924
- },
19925
- "inheritFrom": {
19926
- "anyOf": [
19927
- {
19928
- "type": "string"
19929
- },
19930
- {
19931
- "type": "array",
19932
- "items": {
19933
- "type": "string"
19934
- }
19935
- }
19936
- ],
19937
- "description": "The parent policy(ies) this policy inherits from. IRIs identifying the parent Policy(ies)."
19938
- },
19939
- "conflict": {
19940
- "$ref": "https://schema.twindev.org/w3c-odrl/ConflictStrategyType"
19941
- },
19942
- "permission": {
19943
- "anyOf": [
19944
- {
19945
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPermission"
19946
- },
19947
- {
19948
- "type": "array",
19949
- "items": {
19950
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPermission"
19951
- }
19952
- }
19953
- ],
19954
- "description": "The permissions in the policy. At least one of permission, prohibition, or obligation must be present."
19955
- },
19956
- "prohibition": {
19957
- "anyOf": [
19958
- {
19959
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlProhibition"
19960
- },
19961
- {
19962
- "type": "array",
19963
- "items": {
19964
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlProhibition"
19965
- }
19966
- }
19967
- ],
19968
- "description": "The prohibitions in the policy. At least one of permission, prohibition, or obligation must be present."
19969
- },
19970
- "obligation": {
19971
- "anyOf": [
19972
- {
19973
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlDuty"
19974
- },
19975
- {
19976
- "type": "array",
19977
- "items": {
19978
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlDuty"
19979
- }
19980
- }
19981
- ],
19982
- "description": "The obligations in the policy. At least one of permission, prohibition, or obligation must be present."
19983
- }
19984
- },
19985
- "required": [
19986
- "@context",
19987
- "@type"
19988
- ],
19989
- "description": "The body of the request - the policy to create (uid will be auto-generated)."
19990
- },
19991
19503
  "PapQueryResponse": {
19992
19504
  "type": "array",
19993
19505
  "items": {
19994
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlPolicy"
19506
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolPolicy"
19995
19507
  },
19996
19508
  "description": "The body of the response."
19997
19509
  },
@@ -20048,10 +19560,10 @@
20048
19560
  "description": "Organization identity to be used when sending trust payloads."
20049
19561
  },
20050
19562
  "offer": {
20051
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlOffer"
19563
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolOffer"
20052
19564
  },
20053
19565
  "agreement": {
20054
- "$ref": "https://schema.twindev.org/w3c-odrl/OdrlAgreement"
19566
+ "$ref": "https://schema.twindev.org/dataspace-protocol/DataspaceProtocolAgreement"
20055
19567
  },
20056
19568
  "trustVerificationInfo": {
20057
19569
  "$ref": "#/components/schemas/TrustVerificationInfo"
@@ -1,34 +1,85 @@
1
- # Examples
1
+ # Node Usage
2
2
 
3
- ## CLI Usage
3
+ These commands cover local installation, on demand execution, and a complete bootstrap flow that can be reused in deployment scripts.
4
4
 
5
- To run the command from the package either:
5
+ ## Running
6
6
 
7
- Install `@twin.org/node@next` and use the following command:
7
+ To install and run the CLI locally use the following commands:
8
8
 
9
9
  ```shell
10
- twin-node --help
10
+ npm install @twin.org/node -g
11
+ twin-node
11
12
  ```
12
13
 
13
- or
14
+ or run directly using NPX:
14
15
 
15
16
  ```shell
16
- npx "@twin.org/node@next" --help
17
+ npx "@twin.org/node"
17
18
  ```
18
19
 
19
- ### Display help listing all commands
20
+ ## Help
20
21
 
21
- ```shell
22
- twin-node --help
22
+ ```text
23
+ 🌩️ TWIN Node v0.0.3-next.26
24
+
25
+ Command: help
26
+
27
+ All the commands available are listed below, for more information use the --help option with a specific command.
28
+ bootstrap-legacy: Bootstrap in legacy mode for backwards compatibility, **will be deprecated in future versions**
29
+ identity-create: Create an identity
30
+ identity-import: Import an identity
31
+ identity-verification-method-create: Create an identity verification method
32
+ identity-verification-method-import: Import an identity verification method
33
+ identity-verifiable-credential-create: Create a verifiable credential
34
+ node-set-identity: Set the node identity
35
+ node-set-tenant: Set the node tenant
36
+ tenant-create: Create a tenant with associated api key
37
+ tenant-import: Import a tenant with associated api key
38
+ tenant-update: Update a tenant with associated api key
39
+ user-create: Create a user
40
+ user-update: Update a user
41
+ vault-key-create: Create a vault key for an identity
42
+ vault-key-import: Import a vault key for an identity
23
43
  ```
24
44
 
25
- ### Display help for specific command
45
+ ## identity-create --help
26
46
 
27
- ```shell
28
- twin-node command --help
47
+ ```text
48
+ identity-create: Create an identity
49
+
50
+ env-prefix: (string, optional)
51
+ Prefix to use for standard .env files e.g. TWIN_.
52
+
53
+ mnemonic: (string, 24 words, optional)
54
+ The mnemonic phrase to use for the identity. If not provided, a random mnemonic will be generated.
55
+
56
+ identity: (string, did, optional)
57
+ The DID of the identity to create. If not provided, a new DID will be generated.
58
+
59
+ controller: (string, did, optional)
60
+ The controller DID for the identity. If not provided, the identity will be its own controller.
61
+
62
+ fund-wallet: (boolean, default: 'false', optional)
63
+ Whether to fund the wallet associated with the identity from a faucet.
64
+
65
+ load-env: (string, optional)
66
+ Comma separated list of paths to .env files to read input parameters from.
67
+
68
+ output-json: (string, optional)
69
+ Path to a .json file to store the command output.
70
+
71
+ output-env: (string, optional)
72
+ Path to a .env file to store the command output.
73
+
74
+ output-env-prefix: (string, optional)
75
+ Prefix to use for variables in the output .env file.
76
+
77
+ Example: identity-create --mnemonic="..." --fund-wallet=true
29
78
  ```
30
79
 
31
- ### Bootstrap legacy mode **will be deprecated in future versions**
80
+ ## Example
81
+
82
+ ### Bootstrap legacy mode will be deprecated in future versions
32
83
 
33
84
  ```shell
34
85
  twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
@@ -40,7 +91,7 @@ twin-node bootstrap-legacy --load-env=".env.bootstrap-legacy"
40
91
  twin-node identity-create --fund-wallet=true --output-json="node-identity.json" --output-env="node-identity.env" --output-env-prefix=node
41
92
  ```
42
93
 
43
- Alternatively import existing details:
94
+ ### Import existing identity details
44
95
 
45
96
  ```shell
46
97
  twin-node identity-import --load-env="my-identity.env" --identity=!MY_DID --mnemonic=!MY_MNEMONIC
@@ -58,13 +109,13 @@ twin-node node-set-identity --load-env="node-identity.env" --identity=!NODE_DID
58
109
  twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --output-json="node-auth-key.json" --output-env="node-auth-key.env"
59
110
  ```
60
111
 
61
- Alternatively import existing details:
112
+ ### Import existing authentication signing key details
62
113
 
63
114
  ```shell
64
115
  twin-node vault-key-import --load-env="node-identity.env,node-auth-key.json" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --key-type=!KEY_TYPE --private-key-hex=!PRIVATE_KEY_HEX
65
116
  ```
66
117
 
67
- ### Add a key associated with the node identity for use by the synchronised storage blob encryption
118
+ ### Add a key associated with the node identity for use by synchronised storage blob encryption
68
119
 
69
120
  ```shell
70
121
  twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID --key-id=!TWIN_SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_ID --key-type=ChaCha20Poly1305 --output-json="node-synchronised-storage-encryption-key.json" --output-env="node-synchronised-storage-encryption-key.env"
@@ -76,7 +127,7 @@ twin-node vault-key-create --load-env="node-identity.env" --identity=!NODE_DID -
76
127
  twin-node vault-key-import --load-env="node-identity.env,my-key.json" --identity=!NODE_DID --key-id=!TWIN_AUTH_SIGNING_KEY_ID --key-type=!KEY_TYPE --private-key-hex=!PRIVATE_KEY_HEX
77
128
  ```
78
129
 
79
- Alternatively import existing details:
130
+ ### Create a tenant to be used by the node
80
131
 
81
132
  ```shell
82
133
  twin-node tenant-create --label="node" --public-origin="https://api.example.com" --output-env-prefix=node --output-json="node-tenant.json" --output-env="node-tenant.env"
@@ -94,25 +145,25 @@ twin-node tenant-import --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_I
94
145
  twin-node tenant-update --load-env="node-tenant.json" --tenant-id=!NODE_TENANT_ID --label="New Label"
95
146
  ```
96
147
 
97
- ### Associated the tenant with the node
148
+ ### Associate the tenant with the node
98
149
 
99
150
  ```shell
100
151
  twin-node node-set-tenant --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID
101
152
  ```
102
153
 
103
- ### Create an organization identity
154
+ ### Create an organisation identity
104
155
 
105
156
  ```shell
106
- twin-node identity-create --load-env="node-identity.env" --fund-wallet=true --output-json="organization-identity.json" --output-env="organization-identity.env" --output-env-prefix=organization
157
+ twin-node identity-create --load-env="node-identity.env" --fund-wallet=true --output-json="organization-identity.json" --output-env="organization-identity.env" --output-env-prefix=organization
107
158
  ```
108
159
 
109
- ### Add a verification method to the organization identity for attestation
160
+ ### Add a verification method to the organisation identity for attestation
110
161
 
111
162
  ```shell
112
163
  twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_ATTESTATION_VERIFICATION_METHOD_ID --output-json="organization-attestation.json" --output-env="organization-attestation.env"
113
164
  ```
114
165
 
115
- Alternatively import existing details:
166
+ ### Import an attestation verification method for the organisation identity
116
167
 
117
168
  ```shell
118
169
  twin-node identity-verification-method-import --load-env="node-identity.env,organization-identity.env,organization-attestation.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!DID_VERIFICATION_METHOD_ID --private-key-hex=!DID_VERIFICATION_METHOD_PRIVATE_KEY_HEX
@@ -124,25 +175,25 @@ twin-node identity-verification-method-import --load-env="node-identity.env,orga
124
175
  twin-node identity-verifiable-credential-create --load-env="organization-identity.env,organization-attestation.env" --identity=!ORGANIZATION_DID --verification-method-id=!TWIN_ATTESTATION_VERIFICATION_METHOD_ID --subject-json="subject.json" --output-json="organization-attestation-credential.json" --output-env="organization-attestation-credential.env"
125
176
  ```
126
177
 
127
- ### Add a verification method to the organization identity for immutable proofs
178
+ ### Add a verification method to the organisation identity for immutable proofs
128
179
 
129
180
  ```shell
130
181
  twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_IMMUTABLE_PROOF_VERIFICATION_METHOD_ID --output-json="organization-immutable-proof.json" --output-env="organization-immutable-proof.env"
131
182
  ```
132
183
 
133
- ### Add a verification method to the organization identity for trust verification
184
+ ### Add a verification method to the organisation identity for trust verification
134
185
 
135
186
  ```shell
136
187
  twin-node identity-verification-method-create --load-env="node-identity.env,organization-identity.env" --identity=!ORGANIZATION_DID --controller=!NODE_DID --verification-method-id=!TWIN_TRUST_VERIFICATION_METHOD_ID --output-json="organization-trust.json" --output-env="organization-trust.env"
137
188
  ```
138
189
 
139
- ### Add a key associated with the organization to be used for blob encryption
190
+ ### Add a key associated with the organisation to be used for blob encryption
140
191
 
141
192
  ```shell
142
193
  twin-node vault-key-create --load-env="organization-identity.env" --identity=!ORGANIZATION_DID --key-id=!TWIN_BLOB_STORAGE_ENCRYPTION_KEY_ID --key-type=ChaCha20Poly1305 --output-json="organization-blob-encryption.json" --output-env="organization-blob-encryption.env"
143
194
  ```
144
195
 
145
- ### Create an identity associated with the organization
196
+ ### Create an identity associated with the organisation
146
197
 
147
198
  ```shell
148
199
  twin-node identity-create --load-env="organization-identity.env" --controller=!ORGANIZATION_DID --output-json="user-identity.json" --output-env="user-identity.env" --output-env-prefix=user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node",
3
- "version": "0.0.3-next.27",
3
+ "version": "0.0.3-next.28",
4
4
  "description": "TWIN Node serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/node-core": "0.0.3-next.27"
17
+ "@twin.org/node-core": "0.0.3-next.28"
18
18
  },
19
19
  "bugs": {
20
20
  "url": "git+https://github.com/twinfoundation/node/issues"