@twin.org/identity-rest-client 0.0.3-next.9 → 0.9.0
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 +2 -2
- package/dist/es/identityProfileRestClient.js +4 -4
- package/dist/es/identityProfileRestClient.js.map +1 -1
- package/dist/es/identityResolverRestClient.js +1 -1
- package/dist/es/identityResolverRestClient.js.map +1 -1
- package/dist/es/identityRestClient.js +80 -25
- package/dist/es/identityRestClient.js.map +1 -1
- package/dist/types/identityProfileRestClient.d.ts +4 -4
- package/dist/types/identityResolverRestClient.d.ts +1 -1
- package/dist/types/identityRestClient.d.ts +52 -13
- package/docs/changelog.md +572 -86
- package/docs/examples.md +175 -1
- package/docs/reference/classes/IdentityProfileRestClient.md +12 -12
- package/docs/reference/classes/IdentityResolverRestClient.md +4 -4
- package/docs/reference/classes/IdentityRestClient.md +155 -45
- package/package.json +13 -13
|
@@ -36,7 +36,7 @@ The configuration for the client.
|
|
|
36
36
|
|
|
37
37
|
## Properties
|
|
38
38
|
|
|
39
|
-
### CLASS\_NAME
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Runtime name for the class.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,7 +62,7 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### identityCreate()
|
|
65
|
+
### identityCreate() {#identitycreate}
|
|
66
66
|
|
|
67
67
|
> **identityCreate**(`namespace?`): `Promise`\<`IDidDocument`\>
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ The created identity document.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### identityRemove()
|
|
91
|
+
### identityRemove() {#identityremove}
|
|
92
92
|
|
|
93
93
|
> **identityRemove**(`identity`): `Promise`\<`void`\>
|
|
94
94
|
|
|
@@ -106,7 +106,7 @@ The id of the document to remove.
|
|
|
106
106
|
|
|
107
107
|
`Promise`\<`void`\>
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
A promise that resolves when the identity has been removed.
|
|
110
110
|
|
|
111
111
|
#### Implementation of
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ Nothing.
|
|
|
114
114
|
|
|
115
115
|
***
|
|
116
116
|
|
|
117
|
-
### verificationMethodCreate()
|
|
117
|
+
### verificationMethodCreate() {#verificationmethodcreate}
|
|
118
118
|
|
|
119
119
|
> **verificationMethodCreate**(`identity`, `verificationMethodType`, `verificationMethodId?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
120
120
|
|
|
@@ -160,7 +160,7 @@ NotSupportedError if the platform does not support multiple keys.
|
|
|
160
160
|
|
|
161
161
|
***
|
|
162
162
|
|
|
163
|
-
### verificationMethodRemove()
|
|
163
|
+
### verificationMethodRemove() {#verificationmethodremove}
|
|
164
164
|
|
|
165
165
|
> **verificationMethodRemove**(`verificationMethodId`): `Promise`\<`void`\>
|
|
166
166
|
|
|
@@ -178,7 +178,7 @@ The id of the verification method.
|
|
|
178
178
|
|
|
179
179
|
`Promise`\<`void`\>
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
A promise that resolves when the verification method has been removed.
|
|
182
182
|
|
|
183
183
|
#### Throws
|
|
184
184
|
|
|
@@ -194,7 +194,7 @@ NotSupportedError if the platform does not support multiple revocable keys.
|
|
|
194
194
|
|
|
195
195
|
***
|
|
196
196
|
|
|
197
|
-
### serviceCreate()
|
|
197
|
+
### serviceCreate() {#servicecreate}
|
|
198
198
|
|
|
199
199
|
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`): `Promise`\<`IDidService`\>
|
|
200
200
|
|
|
@@ -216,15 +216,15 @@ The id of the service.
|
|
|
216
216
|
|
|
217
217
|
##### serviceType
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
`string` \| `string`[]
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
The type of the service.
|
|
222
222
|
|
|
223
223
|
##### serviceEndpoint
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
`string` \| `string`[]
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
The endpoint for the service.
|
|
228
228
|
|
|
229
229
|
#### Returns
|
|
230
230
|
|
|
@@ -242,7 +242,7 @@ NotFoundError if the id can not be resolved.
|
|
|
242
242
|
|
|
243
243
|
***
|
|
244
244
|
|
|
245
|
-
### serviceRemove()
|
|
245
|
+
### serviceRemove() {#serviceremove}
|
|
246
246
|
|
|
247
247
|
> **serviceRemove**(`serviceId`): `Promise`\<`void`\>
|
|
248
248
|
|
|
@@ -260,7 +260,7 @@ The id of the service.
|
|
|
260
260
|
|
|
261
261
|
`Promise`\<`void`\>
|
|
262
262
|
|
|
263
|
-
|
|
263
|
+
A promise that resolves when the service has been removed.
|
|
264
264
|
|
|
265
265
|
#### Throws
|
|
266
266
|
|
|
@@ -272,7 +272,89 @@ NotFoundError if the id can not be resolved.
|
|
|
272
272
|
|
|
273
273
|
***
|
|
274
274
|
|
|
275
|
-
###
|
|
275
|
+
### alsoKnownAsAdd() {#alsoknownasadd}
|
|
276
|
+
|
|
277
|
+
> **alsoKnownAsAdd**(`documentId`, `alias`): `Promise`\<`void`\>
|
|
278
|
+
|
|
279
|
+
Add an alias to the alsoKnownAs property on the document.
|
|
280
|
+
If the alias is already present the operation is a no-op.
|
|
281
|
+
|
|
282
|
+
#### Parameters
|
|
283
|
+
|
|
284
|
+
##### documentId
|
|
285
|
+
|
|
286
|
+
`string`
|
|
287
|
+
|
|
288
|
+
The id of the document to update.
|
|
289
|
+
|
|
290
|
+
##### alias
|
|
291
|
+
|
|
292
|
+
`string`
|
|
293
|
+
|
|
294
|
+
The alias to add. Must be a Url or Urn (typically another DID).
|
|
295
|
+
|
|
296
|
+
#### Returns
|
|
297
|
+
|
|
298
|
+
`Promise`\<`void`\>
|
|
299
|
+
|
|
300
|
+
A promise that resolves when the alias has been added.
|
|
301
|
+
|
|
302
|
+
#### Throws
|
|
303
|
+
|
|
304
|
+
GeneralError if the alias is not a Url or Urn.
|
|
305
|
+
|
|
306
|
+
#### Throws
|
|
307
|
+
|
|
308
|
+
NotFoundError if the id can not be resolved.
|
|
309
|
+
|
|
310
|
+
#### Implementation of
|
|
311
|
+
|
|
312
|
+
`IIdentityComponent.alsoKnownAsAdd`
|
|
313
|
+
|
|
314
|
+
***
|
|
315
|
+
|
|
316
|
+
### alsoKnownAsRemove() {#alsoknownasremove}
|
|
317
|
+
|
|
318
|
+
> **alsoKnownAsRemove**(`documentId`, `alias`): `Promise`\<`void`\>
|
|
319
|
+
|
|
320
|
+
Remove an alias from the alsoKnownAs property on the document.
|
|
321
|
+
If the alias is not present the operation is a no-op.
|
|
322
|
+
|
|
323
|
+
#### Parameters
|
|
324
|
+
|
|
325
|
+
##### documentId
|
|
326
|
+
|
|
327
|
+
`string`
|
|
328
|
+
|
|
329
|
+
The id of the document to update.
|
|
330
|
+
|
|
331
|
+
##### alias
|
|
332
|
+
|
|
333
|
+
`string`
|
|
334
|
+
|
|
335
|
+
The alias to remove. Must be a Url or Urn.
|
|
336
|
+
|
|
337
|
+
#### Returns
|
|
338
|
+
|
|
339
|
+
`Promise`\<`void`\>
|
|
340
|
+
|
|
341
|
+
A promise that resolves when the alias has been removed.
|
|
342
|
+
|
|
343
|
+
#### Throws
|
|
344
|
+
|
|
345
|
+
GeneralError if the alias is not a Url or Urn.
|
|
346
|
+
|
|
347
|
+
#### Throws
|
|
348
|
+
|
|
349
|
+
NotFoundError if the id can not be resolved.
|
|
350
|
+
|
|
351
|
+
#### Implementation of
|
|
352
|
+
|
|
353
|
+
`IIdentityComponent.alsoKnownAsRemove`
|
|
354
|
+
|
|
355
|
+
***
|
|
356
|
+
|
|
357
|
+
### verifiableCredentialCreate() {#verifiablecredentialcreate}
|
|
276
358
|
|
|
277
359
|
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `options?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
278
360
|
|
|
@@ -288,9 +370,9 @@ The verification method id to use.
|
|
|
288
370
|
|
|
289
371
|
##### id
|
|
290
372
|
|
|
291
|
-
|
|
373
|
+
`string` \| `undefined`
|
|
292
374
|
|
|
293
|
-
|
|
375
|
+
The id of the credential.
|
|
294
376
|
|
|
295
377
|
##### subject
|
|
296
378
|
|
|
@@ -314,6 +396,18 @@ The bitmap revocation index of the credential, if undefined will not have revoca
|
|
|
314
396
|
|
|
315
397
|
The date the verifiable credential is valid until.
|
|
316
398
|
|
|
399
|
+
###### jwtHeaderFields?
|
|
400
|
+
|
|
401
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
402
|
+
|
|
403
|
+
Additional fields to include in the JWT header when creating the verifiable credential in jwt format.
|
|
404
|
+
|
|
405
|
+
###### jwtPayloadFields?
|
|
406
|
+
|
|
407
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
408
|
+
|
|
409
|
+
Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.
|
|
410
|
+
|
|
317
411
|
#### Returns
|
|
318
412
|
|
|
319
413
|
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
@@ -330,17 +424,17 @@ NotFoundError if the id can not be resolved.
|
|
|
330
424
|
|
|
331
425
|
***
|
|
332
426
|
|
|
333
|
-
### verifiableCredentialVerify()
|
|
427
|
+
### verifiableCredentialVerify() {#verifiablecredentialverify}
|
|
334
428
|
|
|
335
|
-
> **verifiableCredentialVerify**(`
|
|
429
|
+
> **verifiableCredentialVerify**(`credential`): `Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
336
430
|
|
|
337
431
|
Verify a verifiable credential is valid.
|
|
338
432
|
|
|
339
433
|
#### Parameters
|
|
340
434
|
|
|
341
|
-
#####
|
|
435
|
+
##### credential
|
|
342
436
|
|
|
343
|
-
`string`
|
|
437
|
+
`string` \| `IDidVerifiableCredential`
|
|
344
438
|
|
|
345
439
|
The credential to verify.
|
|
346
440
|
|
|
@@ -356,7 +450,7 @@ The credential stored in the jwt and the revocation status.
|
|
|
356
450
|
|
|
357
451
|
***
|
|
358
452
|
|
|
359
|
-
### verifiableCredentialRevoke()
|
|
453
|
+
### verifiableCredentialRevoke() {#verifiablecredentialrevoke}
|
|
360
454
|
|
|
361
455
|
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`): `Promise`\<`void`\>
|
|
362
456
|
|
|
@@ -374,13 +468,13 @@ The id of the document to update the revocation list for.
|
|
|
374
468
|
|
|
375
469
|
`number`
|
|
376
470
|
|
|
377
|
-
The revocation bitmap index revoke.
|
|
471
|
+
The revocation bitmap index to revoke.
|
|
378
472
|
|
|
379
473
|
#### Returns
|
|
380
474
|
|
|
381
475
|
`Promise`\<`void`\>
|
|
382
476
|
|
|
383
|
-
|
|
477
|
+
A promise that resolves when the credential has been revoked.
|
|
384
478
|
|
|
385
479
|
#### Implementation of
|
|
386
480
|
|
|
@@ -388,7 +482,7 @@ Nothing.
|
|
|
388
482
|
|
|
389
483
|
***
|
|
390
484
|
|
|
391
|
-
### verifiableCredentialUnrevoke()
|
|
485
|
+
### verifiableCredentialUnrevoke() {#verifiablecredentialunrevoke}
|
|
392
486
|
|
|
393
487
|
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`): `Promise`\<`void`\>
|
|
394
488
|
|
|
@@ -406,13 +500,13 @@ The id of the document to update the revocation list for.
|
|
|
406
500
|
|
|
407
501
|
`number`
|
|
408
502
|
|
|
409
|
-
The revocation bitmap index to
|
|
503
|
+
The revocation bitmap index to unrevoke.
|
|
410
504
|
|
|
411
505
|
#### Returns
|
|
412
506
|
|
|
413
507
|
`Promise`\<`void`\>
|
|
414
508
|
|
|
415
|
-
|
|
509
|
+
A promise that resolves when the credential has been unrevoked.
|
|
416
510
|
|
|
417
511
|
#### Implementation of
|
|
418
512
|
|
|
@@ -420,9 +514,9 @@ Nothing.
|
|
|
420
514
|
|
|
421
515
|
***
|
|
422
516
|
|
|
423
|
-
### verifiablePresentationCreate()
|
|
517
|
+
### verifiablePresentationCreate() {#verifiablepresentationcreate}
|
|
424
518
|
|
|
425
|
-
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `
|
|
519
|
+
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `options?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
426
520
|
|
|
427
521
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
428
522
|
|
|
@@ -436,21 +530,21 @@ The method to associate with the presentation.
|
|
|
436
530
|
|
|
437
531
|
##### presentationId
|
|
438
532
|
|
|
439
|
-
|
|
533
|
+
`string` \| `undefined`
|
|
440
534
|
|
|
441
|
-
|
|
535
|
+
The id of the presentation.
|
|
442
536
|
|
|
443
537
|
##### contexts
|
|
444
538
|
|
|
445
|
-
|
|
539
|
+
`IJsonLdContextDefinitionRoot` \| `undefined`
|
|
446
540
|
|
|
447
|
-
|
|
541
|
+
The contexts for the data stored in the verifiable credential.
|
|
448
542
|
|
|
449
543
|
##### types
|
|
450
544
|
|
|
451
|
-
|
|
545
|
+
`string` \| `string`[] \| `undefined`
|
|
452
546
|
|
|
453
|
-
|
|
547
|
+
The types for the data stored in the verifiable credential.
|
|
454
548
|
|
|
455
549
|
##### verifiableCredentials
|
|
456
550
|
|
|
@@ -458,11 +552,27 @@ The types for the data stored in the verifiable credential.
|
|
|
458
552
|
|
|
459
553
|
The credentials to use for creating the presentation in jwt format.
|
|
460
554
|
|
|
461
|
-
#####
|
|
555
|
+
##### options?
|
|
462
556
|
|
|
463
|
-
|
|
557
|
+
Additional options for creating the verifiable presentation.
|
|
464
558
|
|
|
465
|
-
|
|
559
|
+
###### expirationDate?
|
|
560
|
+
|
|
561
|
+
`Date`
|
|
562
|
+
|
|
563
|
+
The date the verifiable presentation is valid until.
|
|
564
|
+
|
|
565
|
+
###### jwtHeaderFields?
|
|
566
|
+
|
|
567
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
568
|
+
|
|
569
|
+
Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.
|
|
570
|
+
|
|
571
|
+
###### jwtPayloadFields?
|
|
572
|
+
|
|
573
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
574
|
+
|
|
575
|
+
Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.
|
|
466
576
|
|
|
467
577
|
#### Returns
|
|
468
578
|
|
|
@@ -480,17 +590,17 @@ NotFoundError if the id can not be resolved.
|
|
|
480
590
|
|
|
481
591
|
***
|
|
482
592
|
|
|
483
|
-
### verifiablePresentationVerify()
|
|
593
|
+
### verifiablePresentationVerify() {#verifiablepresentationverify}
|
|
484
594
|
|
|
485
|
-
> **verifiablePresentationVerify**(`
|
|
595
|
+
> **verifiablePresentationVerify**(`presentation`): `Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
486
596
|
|
|
487
597
|
Verify a verifiable presentation is valid.
|
|
488
598
|
|
|
489
599
|
#### Parameters
|
|
490
600
|
|
|
491
|
-
#####
|
|
601
|
+
##### presentation
|
|
492
602
|
|
|
493
|
-
`string`
|
|
603
|
+
`string` \| `IDidVerifiablePresentation`
|
|
494
604
|
|
|
495
605
|
The presentation to verify.
|
|
496
606
|
|
|
@@ -506,7 +616,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
506
616
|
|
|
507
617
|
***
|
|
508
618
|
|
|
509
|
-
### proofCreate()
|
|
619
|
+
### proofCreate() {#proofcreate}
|
|
510
620
|
|
|
511
621
|
> **proofCreate**(`verificationMethodId`, `proofType`, `unsecureDocument`): `Promise`\<`IProof`\>
|
|
512
622
|
|
|
@@ -544,7 +654,7 @@ The proof.
|
|
|
544
654
|
|
|
545
655
|
***
|
|
546
656
|
|
|
547
|
-
### proofVerify()
|
|
657
|
+
### proofVerify() {#proofverify}
|
|
548
658
|
|
|
549
659
|
> **proofVerify**(`document`, `proof`): `Promise`\<`boolean`\>
|
|
550
660
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-rest-client",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Client library for consuming identity REST endpoints through shared request and response contracts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-identity.git",
|
|
8
8
|
"directory": "packages/identity-rest-client"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-core": "
|
|
18
|
-
"@twin.org/api-models": "
|
|
19
|
-
"@twin.org/core": "
|
|
20
|
-
"@twin.org/data-core": "
|
|
21
|
-
"@twin.org/data-json-ld": "
|
|
22
|
-
"@twin.org/entity": "
|
|
23
|
-
"@twin.org/identity-models": "0.0
|
|
24
|
-
"@twin.org/nameof": "
|
|
25
|
-
"@twin.org/standards-w3c-did": "
|
|
17
|
+
"@twin.org/api-core": "^0.9.0",
|
|
18
|
+
"@twin.org/api-models": "^0.9.0",
|
|
19
|
+
"@twin.org/core": "^0.9.0",
|
|
20
|
+
"@twin.org/data-core": "^0.9.0",
|
|
21
|
+
"@twin.org/data-json-ld": "^0.9.0",
|
|
22
|
+
"@twin.org/entity": "^0.9.0",
|
|
23
|
+
"@twin.org/identity-models": "^0.9.0",
|
|
24
|
+
"@twin.org/nameof": "^0.9.0",
|
|
25
|
+
"@twin.org/standards-w3c-did": "^0.9.0"
|
|
26
26
|
},
|
|
27
27
|
"main": "./dist/es/index.js",
|
|
28
28
|
"types": "./dist/types/index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"authentication"
|
|
53
53
|
],
|
|
54
54
|
"bugs": {
|
|
55
|
-
"url": "git+https://github.com/
|
|
55
|
+
"url": "git+https://github.com/iotaledger/twin-identity/issues"
|
|
56
56
|
},
|
|
57
57
|
"homepage": "https://twindev.org"
|
|
58
58
|
}
|