@twin.org/node 0.9.1-next.1 → 0.9.1-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.
package/docs/usage.md CHANGED
@@ -28,17 +28,26 @@ All the commands available are listed below, for more information use the --help
28
28
  bootstrap-legacy: Bootstrap in legacy mode for backwards compatibility, **will be deprecated in future versions**
29
29
  identity-create: Create an identity
30
30
  identity-import: Import an identity
31
+ identity-list: List all identities held in custody by the node
32
+ identity-resolve: Resolve an identity DID to its full document
31
33
  identity-verification-method-create: Create an identity verification method
32
34
  identity-verification-method-import: Import an identity verification method
33
35
  identity-verifiable-credential-create: Create a verifiable credential
34
- node-set-identity: Set the node identity
36
+ node-identity-get: Get the identity currently assigned to the node
37
+ node-identity-set: Set the node identity
38
+ org-users-list: List all users belonging to an organization DID
35
39
  remove-tenant-org-alias: Remove an alias from the tenant organization ID legacy list
36
- set-node-org-id: Set the node organization ID
37
- set-tenant-org-id: Set the organization ID for a tenant
40
+ node-org-id-get: Get the organization ID currently assigned to the node (single-tenant only)
41
+ node-org-id-set: Set the node organization ID (single-tenant only)
42
+ tenant-org-id-set: Set the organization ID for a tenant
38
43
  tenant-create: Create a tenant with associated api key
44
+ tenant-get: Get the full configuration record for a single tenant
39
45
  tenant-import: Import a tenant with associated api key
46
+ tenant-list: List all tenants
47
+ tenant-list-by-org: List all tenants associated with a given organization DID
40
48
  tenant-update: Update a tenant with associated api key
41
49
  user-create: Create a user
50
+ user-get: Get a user by email address
42
51
  user-update: Update a user
43
52
  vault-key-create: Create a vault key for an identity
44
53
  vault-key-import: Import a vault key for an identity
@@ -127,6 +136,174 @@ The tenant ID to set the created identity DID as the organization ID for (requir
127
136
  Example: identity-create --mnemonic="..." --fund-wallet=true
128
137
  ```
129
138
 
139
+ ## identity-list --help
140
+
141
+ ```text
142
+ identity-list: List all identities held in custody by the node
143
+
144
+ env-prefix: (string, optional)
145
+ Prefix to use for standard .env files e.g. TWIN_.
146
+
147
+ load-env: (string, optional)
148
+ Comma separated list of paths to .env files to read input parameters from.
149
+
150
+ Example: identity-list
151
+ ```
152
+
153
+ ## identity-resolve --help
154
+
155
+ ```text
156
+ identity-resolve: Resolve an identity DID to its full document
157
+
158
+ env-prefix: (string, optional)
159
+ Prefix to use for standard .env files e.g. TWIN_.
160
+
161
+ identity: (string, did, required)
162
+ The DID to resolve.
163
+
164
+ load-env: (string, optional)
165
+ Comma separated list of paths to .env files to read input parameters from.
166
+
167
+ output-json: (string, optional)
168
+ Path to a .json file to store the resolved DID document.
169
+
170
+ Example: identity-resolve --identity="did:iota:..."
171
+ ```
172
+
173
+ ## node-identity-get --help
174
+
175
+ ```text
176
+ node-identity-get: Get the identity currently assigned to the node
177
+
178
+ env-prefix: (string, optional)
179
+ Prefix to use for standard .env files e.g. TWIN_.
180
+
181
+ load-env: (string, optional)
182
+ Comma separated list of paths to .env files to read input parameters from.
183
+
184
+ Example: node-identity-get
185
+ ```
186
+
187
+ ## node-org-id-get --help
188
+
189
+ ```text
190
+ node-org-id-get: Get the organization ID currently assigned to the node
191
+ single-tenant only
192
+
193
+ env-prefix: (string, optional)
194
+ Prefix to use for standard .env files e.g. TWIN_.
195
+
196
+ load-env: (string, optional)
197
+ Comma separated list of paths to .env files to read input parameters from.
198
+
199
+ Example: node-org-id-get
200
+ ```
201
+
202
+ ## node-org-id-set --help
203
+
204
+ ```text
205
+ node-org-id-set: Set the node organization ID
206
+ single-tenant only
207
+
208
+ env-prefix: (string, optional)
209
+ Prefix to use for standard .env files e.g. TWIN_.
210
+
211
+ organization-id: (string, did, required)
212
+ The organization DID to set as the node organization ID.
213
+
214
+ load-env: (string, optional)
215
+ Comma separated list of paths to .env files to read input parameters from.
216
+
217
+ Deprecated aliases: set-node-org-id
218
+
219
+ Example: node-org-id-set --organization-id="did:iota:..."
220
+ ```
221
+
222
+ ## org-users-list --help
223
+
224
+ ```text
225
+ org-users-list: List all users belonging to an organization DID
226
+
227
+ env-prefix: (string, optional)
228
+ Prefix to use for standard .env files e.g. TWIN_.
229
+
230
+ org-did: (string, did, optional)
231
+ The organization DID to list users for. Defaults to the node organization ID in single-tenant mode.
232
+
233
+ load-env: (string, optional)
234
+ Comma separated list of paths to .env files to read input parameters from.
235
+
236
+ Example: org-users-list --org-did="did:iota:..."
237
+ ```
238
+
239
+ ## user-get --help
240
+
241
+ ```text
242
+ user-get: Get a user by email address
243
+
244
+ env-prefix: (string, optional)
245
+ Prefix to use for standard .env files e.g. TWIN_.
246
+
247
+ email: (string, email, required)
248
+ The email address of the user to retrieve.
249
+
250
+ tenant-id: (string, hex(32), optional)
251
+ The tenant ID to retrieve the user from (multi-tenant mode only).
252
+
253
+ load-env: (string, optional)
254
+ Comma separated list of paths to .env files to read input parameters from.
255
+
256
+ Example: user-get --email="bob@example.com"
257
+ ```
258
+
259
+ ## tenant-get --help
260
+
261
+ ```text
262
+ tenant-get: Get the full configuration record for a single tenant
263
+
264
+ env-prefix: (string, optional)
265
+ Prefix to use for standard .env files e.g. TWIN_.
266
+
267
+ tenant-id: (string, hex(32), required)
268
+ The tenant ID to retrieve.
269
+
270
+ load-env: (string, optional)
271
+ Comma separated list of paths to .env files to read input parameters from.
272
+
273
+ Example: tenant-get --tenant-id="0011..aabb"
274
+ ```
275
+
276
+ ## tenant-list --help
277
+
278
+ ```text
279
+ tenant-list: List all tenants
280
+
281
+ env-prefix: (string, optional)
282
+ Prefix to use for standard .env files e.g. TWIN_.
283
+
284
+ load-env: (string, optional)
285
+ Comma separated list of paths to .env files to read input parameters from.
286
+
287
+ Example: tenant-list
288
+ ```
289
+
290
+ ## tenant-list-by-org --help
291
+
292
+ ```text
293
+ tenant-list-by-org: List all tenants associated with a given organization DID
294
+
295
+ env-prefix: (string, optional)
296
+ Prefix to use for standard .env files e.g. TWIN_.
297
+
298
+ org-id: (string, did, required)
299
+ The organization DID to filter tenants by.
300
+
301
+ load-env: (string, optional)
302
+ Comma separated list of paths to .env files to read input parameters from.
303
+
304
+ Example: tenant-list-by-org --org-id="did:iota:..."
305
+ ```
306
+
130
307
  ## Example
131
308
 
132
309
  ### Bootstrap legacy (single command)
@@ -176,7 +353,7 @@ twin-node identity-verification-method-create --load-env="node-identity.env,orga
176
353
  ### Step 5 - Set the organisation identity on the node (single-tenant)
177
354
 
178
355
  ```shell
179
- twin-node set-node-org-id --load-env="organization-identity.env" --organization-id=!ORGANIZATION_DID
356
+ twin-node node-org-id-set --load-env="organization-identity.env" --organization-id=!ORGANIZATION_DID
180
357
  ```
181
358
 
182
359
  ### Step 6 - Create the node tenant and associate the organisation (multi-tenant only)
@@ -186,7 +363,7 @@ twin-node tenant-create --load-env="node-identity.env" --label="Node" --output-j
186
363
  ```
187
364
 
188
365
  ```shell
189
- twin-node set-tenant-org-id --load-env="node-tenant.env,organization-identity.env" --tenant-id=!NODE_TENANT_ID --organization-id=!ORGANIZATION_DID
366
+ twin-node tenant-org-id-set --load-env="node-tenant.env,organization-identity.env" --tenant-id=!NODE_TENANT_ID --organization-id=!ORGANIZATION_DID
190
367
  ```
191
368
 
192
369
  To import an existing tenant instead:
@@ -258,3 +435,86 @@ To update an existing user:
258
435
  ```shell
259
436
  twin-node user-update --load-env="organization-identity.env,admin-user-identity.env,node-tenant.env" --email="admin@node" --scope="tenant-admin,user-admin,foo"
260
437
  ```
438
+
439
+ ---
440
+
441
+ ## Inspection commands
442
+
443
+ The following commands are read-only and can be run at any time to inspect the state of the node.
444
+
445
+ ### Get the node identity
446
+
447
+ Resolves and displays the DID document currently assigned as the node identity:
448
+
449
+ ```shell
450
+ twin-node node-identity-get
451
+ ```
452
+
453
+ ### Get the node organization ID
454
+
455
+ Displays the organization DID currently assigned to the node (single-tenant only):
456
+
457
+ ```shell
458
+ twin-node node-org-id-get
459
+ ```
460
+
461
+ ### Resolve an identity
462
+
463
+ Resolve any DID to its full document. Pass `--output-json` to save the document to a file:
464
+
465
+ ```shell
466
+ twin-node identity-resolve --identity="did:iota:..."
467
+ twin-node identity-resolve --identity="did:iota:..." --output-json="did-document.json"
468
+ ```
469
+
470
+ ### List all identities
471
+
472
+ List every identity held in custody by the node, showing each DID and its controller:
473
+
474
+ ```shell
475
+ twin-node identity-list
476
+ ```
477
+
478
+ ### List all tenants (multi-tenant only)
479
+
480
+ ```shell
481
+ twin-node tenant-list
482
+ ```
483
+
484
+ ### Get a single tenant (multi-tenant only)
485
+
486
+ ```shell
487
+ twin-node tenant-get --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID
488
+ ```
489
+
490
+ ### List tenants for an organization (multi-tenant only)
491
+
492
+ ```shell
493
+ twin-node tenant-list-by-org --load-env="organization-identity.env" --org-id=!ORGANIZATION_DID
494
+ ```
495
+
496
+ ### List users for an organization
497
+
498
+ In single-tenant mode, `--org-did` can be omitted and the node organization ID is used automatically:
499
+
500
+ ```shell
501
+ twin-node org-users-list
502
+ ```
503
+
504
+ To list users for a specific organization:
505
+
506
+ ```shell
507
+ twin-node org-users-list --load-env="organization-identity.env" --org-did=!ORGANIZATION_DID
508
+ ```
509
+
510
+ ### Get a single user
511
+
512
+ ```shell
513
+ twin-node user-get --email="admin@node"
514
+ ```
515
+
516
+ In multi-tenant mode supply the tenant ID:
517
+
518
+ ```shell
519
+ twin-node user-get --load-env="node-tenant.env" --tenant-id=!NODE_TENANT_ID --email="admin@node"
520
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/node",
3
- "version": "0.9.1-next.1",
3
+ "version": "0.9.1-next.10",
4
4
  "description": "TWIN Node serving APIs using the specified configuration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,10 +11,10 @@
11
11
  "license": "Apache-2.0",
12
12
  "type": "module",
13
13
  "engines": {
14
- "node": ">=20.0.0"
14
+ "node": ">=24.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/node-core": "0.9.1-next.1"
17
+ "@twin.org/node-core": "0.9.1-next.10"
18
18
  },
19
19
  "bugs": {
20
20
  "url": "git+https://github.com/iotaledger/twin-node/issues"