@twin.org/identity-models 0.0.3-next.3 → 0.0.3-next.30
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 +3 -3
- package/dist/es/contextIdHandlers/didContextIdHandler.js +7 -0
- package/dist/es/contextIdHandlers/didContextIdHandler.js.map +1 -1
- package/dist/es/index.js +6 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IIdentityComponent.js.map +1 -1
- package/dist/es/models/IIdentityConnector.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsCreateRequest.js +4 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsCreateRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js +4 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialCreateRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js +2 -0
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationCreateRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js +2 -0
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js.map +1 -0
- package/dist/es/models/identityMetricIds.js +49 -0
- package/dist/es/models/identityMetricIds.js.map +1 -0
- package/dist/es/models/identityMetrics.js +61 -0
- package/dist/es/models/identityMetrics.js.map +1 -0
- package/dist/types/contextIdHandlers/didContextIdHandler.d.ts +5 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/models/IIdentityComponent.d.ts +47 -6
- package/dist/types/models/IIdentityConnector.d.ts +47 -6
- package/dist/types/models/api/identity/IIdentityAlsoKnownAsCreateRequest.d.ts +23 -0
- package/dist/types/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +12 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +1 -1
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +1 -1
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +14 -2
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.d.ts +10 -0
- package/dist/types/models/identityMetricIds.d.ts +49 -0
- package/dist/types/models/identityMetrics.d.ts +5 -0
- package/docs/changelog.md +304 -76
- package/docs/examples.md +157 -1
- package/docs/reference/classes/Did.md +4 -4
- package/docs/reference/classes/DidContextIdHandler.md +21 -3
- package/docs/reference/classes/DocumentHelper.md +5 -5
- package/docs/reference/classes/VerificationHelper.md +3 -3
- package/docs/reference/index.md +10 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsCreateRequest.md +31 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsRemoveRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityComponent.md +150 -36
- package/docs/reference/interfaces/IIdentityConnector.md +150 -36
- package/docs/reference/interfaces/IIdentityCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityProfileComponent.md +6 -6
- package/docs/reference/interfaces/IIdentityProfileConnector.md +5 -5
- package/docs/reference/interfaces/IIdentityProfileCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityProfileGetPublicRequest.md +4 -4
- package/docs/reference/interfaces/IIdentityProfileGetPublicResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityProfileGetRequest.md +4 -4
- package/docs/reference/interfaces/IIdentityProfileGetResponse.md +3 -3
- package/docs/reference/interfaces/IIdentityProfileListRequest.md +6 -6
- package/docs/reference/interfaces/IIdentityProfileListResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityProfileUpdateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityProofCreateRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityProofCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityRemoveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityResolveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityResolveResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityResolverComponent.md +1 -1
- package/docs/reference/interfaces/IIdentityResolverConnector.md +1 -1
- package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +25 -5
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyDocumentRequest.md +11 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +28 -8
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyDocumentRequest.md +11 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +3 -3
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +1 -1
- package/docs/reference/type-aliases/IdentityMetricIds.md +5 -0
- package/docs/reference/variables/IdentityMetricIds.md +67 -0
- package/docs/reference/variables/IdentityMetrics.md +5 -0
- package/package.json +5 -4
|
@@ -8,7 +8,7 @@ Interface describing a contract which provides identity operations.
|
|
|
8
8
|
|
|
9
9
|
## Methods
|
|
10
10
|
|
|
11
|
-
### identityCreate()
|
|
11
|
+
### identityCreate() {#identitycreate}
|
|
12
12
|
|
|
13
13
|
> **identityCreate**(`namespace?`, `controller?`): `Promise`\<`IDidDocument`\>
|
|
14
14
|
|
|
@@ -36,7 +36,7 @@ The created identity document.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### identityRemove()
|
|
39
|
+
### identityRemove() {#identityremove}
|
|
40
40
|
|
|
41
41
|
> **identityRemove**(`identity`, `controller?`): `Promise`\<`void`\>
|
|
42
42
|
|
|
@@ -64,7 +64,7 @@ Nothing.
|
|
|
64
64
|
|
|
65
65
|
***
|
|
66
66
|
|
|
67
|
-
### verificationMethodCreate()
|
|
67
|
+
### verificationMethodCreate() {#verificationmethodcreate}
|
|
68
68
|
|
|
69
69
|
> **verificationMethodCreate**(`identity`, `verificationMethodType`, `verificationMethodId?`, `controller?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
70
70
|
|
|
@@ -112,7 +112,7 @@ NotSupportedError if the platform does not support multiple keys.
|
|
|
112
112
|
|
|
113
113
|
***
|
|
114
114
|
|
|
115
|
-
### verificationMethodRemove()
|
|
115
|
+
### verificationMethodRemove() {#verificationmethodremove}
|
|
116
116
|
|
|
117
117
|
> **verificationMethodRemove**(`verificationMethodId`, `controller?`): `Promise`\<`void`\>
|
|
118
118
|
|
|
@@ -148,7 +148,7 @@ NotSupportedError if the platform does not support multiple revocable keys.
|
|
|
148
148
|
|
|
149
149
|
***
|
|
150
150
|
|
|
151
|
-
### serviceCreate()
|
|
151
|
+
### serviceCreate() {#servicecreate}
|
|
152
152
|
|
|
153
153
|
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`, `controller?`): `Promise`\<`IDidService`\>
|
|
154
154
|
|
|
@@ -170,15 +170,15 @@ The id of the service.
|
|
|
170
170
|
|
|
171
171
|
##### serviceType
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
`string` \| `string`[]
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
The type of the service.
|
|
176
176
|
|
|
177
177
|
##### serviceEndpoint
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
`string` \| `string`[]
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
The endpoint for the service.
|
|
182
182
|
|
|
183
183
|
##### controller?
|
|
184
184
|
|
|
@@ -198,7 +198,7 @@ NotFoundError if the id can not be resolved.
|
|
|
198
198
|
|
|
199
199
|
***
|
|
200
200
|
|
|
201
|
-
### serviceRemove()
|
|
201
|
+
### serviceRemove() {#serviceremove}
|
|
202
202
|
|
|
203
203
|
> **serviceRemove**(`serviceId`, `controller?`): `Promise`\<`void`\>
|
|
204
204
|
|
|
@@ -230,7 +230,93 @@ NotFoundError if the id can not be resolved.
|
|
|
230
230
|
|
|
231
231
|
***
|
|
232
232
|
|
|
233
|
-
###
|
|
233
|
+
### alsoKnownAsAdd() {#alsoknownasadd}
|
|
234
|
+
|
|
235
|
+
> **alsoKnownAsAdd**(`documentId`, `alias`, `controller?`): `Promise`\<`void`\>
|
|
236
|
+
|
|
237
|
+
Add an alias to the alsoKnownAs property on the document.
|
|
238
|
+
If the alias is already present the operation is a no-op.
|
|
239
|
+
|
|
240
|
+
#### Parameters
|
|
241
|
+
|
|
242
|
+
##### documentId
|
|
243
|
+
|
|
244
|
+
`string`
|
|
245
|
+
|
|
246
|
+
The id of the document to update.
|
|
247
|
+
|
|
248
|
+
##### alias
|
|
249
|
+
|
|
250
|
+
`string`
|
|
251
|
+
|
|
252
|
+
The alias to add. Must be a Url or Urn (typically another DID).
|
|
253
|
+
|
|
254
|
+
##### controller?
|
|
255
|
+
|
|
256
|
+
`string`
|
|
257
|
+
|
|
258
|
+
The controller of the identity who can make changes.
|
|
259
|
+
|
|
260
|
+
#### Returns
|
|
261
|
+
|
|
262
|
+
`Promise`\<`void`\>
|
|
263
|
+
|
|
264
|
+
Nothing.
|
|
265
|
+
|
|
266
|
+
#### Throws
|
|
267
|
+
|
|
268
|
+
GeneralError if the alias is not a Url or Urn.
|
|
269
|
+
|
|
270
|
+
#### Throws
|
|
271
|
+
|
|
272
|
+
NotFoundError if the id can not be resolved.
|
|
273
|
+
|
|
274
|
+
***
|
|
275
|
+
|
|
276
|
+
### alsoKnownAsRemove() {#alsoknownasremove}
|
|
277
|
+
|
|
278
|
+
> **alsoKnownAsRemove**(`documentId`, `alias`, `controller?`): `Promise`\<`void`\>
|
|
279
|
+
|
|
280
|
+
Remove an alias from the alsoKnownAs property on the document.
|
|
281
|
+
If the alias is not present the operation is a no-op.
|
|
282
|
+
|
|
283
|
+
#### Parameters
|
|
284
|
+
|
|
285
|
+
##### documentId
|
|
286
|
+
|
|
287
|
+
`string`
|
|
288
|
+
|
|
289
|
+
The id of the document to update.
|
|
290
|
+
|
|
291
|
+
##### alias
|
|
292
|
+
|
|
293
|
+
`string`
|
|
294
|
+
|
|
295
|
+
The alias to remove. Must be a Url or Urn.
|
|
296
|
+
|
|
297
|
+
##### controller?
|
|
298
|
+
|
|
299
|
+
`string`
|
|
300
|
+
|
|
301
|
+
The controller of the identity who can make changes.
|
|
302
|
+
|
|
303
|
+
#### Returns
|
|
304
|
+
|
|
305
|
+
`Promise`\<`void`\>
|
|
306
|
+
|
|
307
|
+
Nothing.
|
|
308
|
+
|
|
309
|
+
#### Throws
|
|
310
|
+
|
|
311
|
+
GeneralError if the alias is not a Url or Urn.
|
|
312
|
+
|
|
313
|
+
#### Throws
|
|
314
|
+
|
|
315
|
+
NotFoundError if the id can not be resolved.
|
|
316
|
+
|
|
317
|
+
***
|
|
318
|
+
|
|
319
|
+
### verifiableCredentialCreate() {#verifiablecredentialcreate}
|
|
234
320
|
|
|
235
321
|
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `options?`, `controller?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
236
322
|
|
|
@@ -246,9 +332,9 @@ The verification method id to use.
|
|
|
246
332
|
|
|
247
333
|
##### id
|
|
248
334
|
|
|
249
|
-
|
|
335
|
+
`string` \| `undefined`
|
|
250
336
|
|
|
251
|
-
|
|
337
|
+
The id of the credential.
|
|
252
338
|
|
|
253
339
|
##### subject
|
|
254
340
|
|
|
@@ -272,6 +358,18 @@ The bitmap revocation index of the credential, if undefined will not have revoca
|
|
|
272
358
|
|
|
273
359
|
The date the verifiable credential is valid until.
|
|
274
360
|
|
|
361
|
+
###### jwtHeaderFields?
|
|
362
|
+
|
|
363
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
364
|
+
|
|
365
|
+
Additional fields to include in the JWT header when creating the verifiable credential in jwt format.
|
|
366
|
+
|
|
367
|
+
###### jwtPayloadFields?
|
|
368
|
+
|
|
369
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
370
|
+
|
|
371
|
+
Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.
|
|
372
|
+
|
|
275
373
|
##### controller?
|
|
276
374
|
|
|
277
375
|
`string`
|
|
@@ -290,17 +388,17 @@ NotFoundError if the id can not be resolved.
|
|
|
290
388
|
|
|
291
389
|
***
|
|
292
390
|
|
|
293
|
-
### verifiableCredentialVerify()
|
|
391
|
+
### verifiableCredentialVerify() {#verifiablecredentialverify}
|
|
294
392
|
|
|
295
|
-
> **verifiableCredentialVerify**(`
|
|
393
|
+
> **verifiableCredentialVerify**(`credential`): `Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
296
394
|
|
|
297
395
|
Verify a verifiable credential is valid.
|
|
298
396
|
|
|
299
397
|
#### Parameters
|
|
300
398
|
|
|
301
|
-
#####
|
|
399
|
+
##### credential
|
|
302
400
|
|
|
303
|
-
`string`
|
|
401
|
+
`string` \| `IDidVerifiableCredential`
|
|
304
402
|
|
|
305
403
|
The credential to verify.
|
|
306
404
|
|
|
@@ -312,7 +410,7 @@ The credential stored in the jwt and the revocation status.
|
|
|
312
410
|
|
|
313
411
|
***
|
|
314
412
|
|
|
315
|
-
### verifiableCredentialRevoke()
|
|
413
|
+
### verifiableCredentialRevoke() {#verifiablecredentialrevoke}
|
|
316
414
|
|
|
317
415
|
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
318
416
|
|
|
@@ -346,7 +444,7 @@ Nothing.
|
|
|
346
444
|
|
|
347
445
|
***
|
|
348
446
|
|
|
349
|
-
### verifiableCredentialUnrevoke()
|
|
447
|
+
### verifiableCredentialUnrevoke() {#verifiablecredentialunrevoke}
|
|
350
448
|
|
|
351
449
|
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
352
450
|
|
|
@@ -380,9 +478,9 @@ Nothing.
|
|
|
380
478
|
|
|
381
479
|
***
|
|
382
480
|
|
|
383
|
-
### verifiablePresentationCreate()
|
|
481
|
+
### verifiablePresentationCreate() {#verifiablepresentationcreate}
|
|
384
482
|
|
|
385
|
-
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `
|
|
483
|
+
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `options?`, `controller?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
386
484
|
|
|
387
485
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
388
486
|
|
|
@@ -396,21 +494,21 @@ The method to associate with the presentation.
|
|
|
396
494
|
|
|
397
495
|
##### presentationId
|
|
398
496
|
|
|
399
|
-
|
|
497
|
+
`string` \| `undefined`
|
|
400
498
|
|
|
401
|
-
|
|
499
|
+
The id of the presentation.
|
|
402
500
|
|
|
403
501
|
##### contexts
|
|
404
502
|
|
|
405
|
-
|
|
503
|
+
`IJsonLdContextDefinitionRoot` \| `undefined`
|
|
406
504
|
|
|
407
|
-
|
|
505
|
+
The contexts for the data stored in the verifiable credential.
|
|
408
506
|
|
|
409
507
|
##### types
|
|
410
508
|
|
|
411
|
-
|
|
509
|
+
`string` \| `string`[] \| `undefined`
|
|
412
510
|
|
|
413
|
-
|
|
511
|
+
The types for the data stored in the verifiable credential.
|
|
414
512
|
|
|
415
513
|
##### verifiableCredentials
|
|
416
514
|
|
|
@@ -418,11 +516,27 @@ The types for the data stored in the verifiable credential.
|
|
|
418
516
|
|
|
419
517
|
The credentials to use for creating the presentation in jwt format.
|
|
420
518
|
|
|
421
|
-
#####
|
|
519
|
+
##### options?
|
|
422
520
|
|
|
423
|
-
|
|
521
|
+
Additional options for creating the verifiable presentation.
|
|
522
|
+
|
|
523
|
+
###### expirationDate?
|
|
524
|
+
|
|
525
|
+
`Date`
|
|
526
|
+
|
|
527
|
+
The date the verifiable presentation is valid until.
|
|
424
528
|
|
|
425
|
-
|
|
529
|
+
###### jwtHeaderFields?
|
|
530
|
+
|
|
531
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
532
|
+
|
|
533
|
+
Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.
|
|
534
|
+
|
|
535
|
+
###### jwtPayloadFields?
|
|
536
|
+
|
|
537
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
538
|
+
|
|
539
|
+
Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.
|
|
426
540
|
|
|
427
541
|
##### controller?
|
|
428
542
|
|
|
@@ -442,17 +556,17 @@ NotFoundError if the id can not be resolved.
|
|
|
442
556
|
|
|
443
557
|
***
|
|
444
558
|
|
|
445
|
-
### verifiablePresentationVerify()
|
|
559
|
+
### verifiablePresentationVerify() {#verifiablepresentationverify}
|
|
446
560
|
|
|
447
|
-
> **verifiablePresentationVerify**(`
|
|
561
|
+
> **verifiablePresentationVerify**(`presentation`): `Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
448
562
|
|
|
449
563
|
Verify a verifiable presentation is valid.
|
|
450
564
|
|
|
451
565
|
#### Parameters
|
|
452
566
|
|
|
453
|
-
#####
|
|
567
|
+
##### presentation
|
|
454
568
|
|
|
455
|
-
`string`
|
|
569
|
+
`string` \| `IDidVerifiablePresentation`
|
|
456
570
|
|
|
457
571
|
The presentation to verify.
|
|
458
572
|
|
|
@@ -464,7 +578,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
464
578
|
|
|
465
579
|
***
|
|
466
580
|
|
|
467
|
-
### proofCreate()
|
|
581
|
+
### proofCreate() {#proofcreate}
|
|
468
582
|
|
|
469
583
|
> **proofCreate**(`verificationMethodId`, `proofType`, `unsecureDocument`, `controller?`): `Promise`\<`IProof`\>
|
|
470
584
|
|
|
@@ -504,7 +618,7 @@ The proof.
|
|
|
504
618
|
|
|
505
619
|
***
|
|
506
620
|
|
|
507
|
-
### proofVerify()
|
|
621
|
+
### proofVerify() {#proofverify}
|
|
508
622
|
|
|
509
623
|
> **proofVerify**(`document`, `proof`): `Promise`\<`boolean`\>
|
|
510
624
|
|
|
@@ -8,7 +8,7 @@ Interface describing an identity connector.
|
|
|
8
8
|
|
|
9
9
|
## Methods
|
|
10
10
|
|
|
11
|
-
### createDocument()
|
|
11
|
+
### createDocument() {#createdocument}
|
|
12
12
|
|
|
13
13
|
> **createDocument**(`controller`): `Promise`\<`IDidDocument`\>
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ The created document.
|
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
33
|
-
### removeDocument()
|
|
33
|
+
### removeDocument() {#removedocument}
|
|
34
34
|
|
|
35
35
|
> **removeDocument**(`controller`, `documentId`): `Promise`\<`void`\>
|
|
36
36
|
|
|
@@ -58,7 +58,7 @@ Nothing.
|
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
61
|
-
### addVerificationMethod()
|
|
61
|
+
### addVerificationMethod() {#addverificationmethod}
|
|
62
62
|
|
|
63
63
|
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
64
64
|
|
|
@@ -106,7 +106,7 @@ NotSupportedError if the platform does not support multiple keys.
|
|
|
106
106
|
|
|
107
107
|
***
|
|
108
108
|
|
|
109
|
-
### removeVerificationMethod()
|
|
109
|
+
### removeVerificationMethod() {#removeverificationmethod}
|
|
110
110
|
|
|
111
111
|
> **removeVerificationMethod**(`controller`, `verificationMethodId`): `Promise`\<`void`\>
|
|
112
112
|
|
|
@@ -142,7 +142,7 @@ NotSupportedError if the platform does not support multiple revocable keys.
|
|
|
142
142
|
|
|
143
143
|
***
|
|
144
144
|
|
|
145
|
-
### addService()
|
|
145
|
+
### addService() {#addservice}
|
|
146
146
|
|
|
147
147
|
> **addService**(`controller`, `documentId`, `serviceId`, `serviceType`, `serviceEndpoint`): `Promise`\<`IDidService`\>
|
|
148
148
|
|
|
@@ -170,15 +170,15 @@ The id of the service.
|
|
|
170
170
|
|
|
171
171
|
##### serviceType
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
`string` \| `string`[]
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
The type of the service.
|
|
176
176
|
|
|
177
177
|
##### serviceEndpoint
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
`string` \| `string`[]
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
The endpoint for the service.
|
|
182
182
|
|
|
183
183
|
#### Returns
|
|
184
184
|
|
|
@@ -192,7 +192,7 @@ NotFoundError if the id can not be resolved.
|
|
|
192
192
|
|
|
193
193
|
***
|
|
194
194
|
|
|
195
|
-
### removeService()
|
|
195
|
+
### removeService() {#removeservice}
|
|
196
196
|
|
|
197
197
|
> **removeService**(`controller`, `serviceId`): `Promise`\<`void`\>
|
|
198
198
|
|
|
@@ -224,7 +224,93 @@ NotFoundError if the id can not be resolved.
|
|
|
224
224
|
|
|
225
225
|
***
|
|
226
226
|
|
|
227
|
-
###
|
|
227
|
+
### addAlsoKnownAs() {#addalsoknownas}
|
|
228
|
+
|
|
229
|
+
> **addAlsoKnownAs**(`controller`, `documentId`, `alias`): `Promise`\<`void`\>
|
|
230
|
+
|
|
231
|
+
Add an alias to the alsoKnownAs property on the document.
|
|
232
|
+
If the alias is already present the operation is a no-op.
|
|
233
|
+
|
|
234
|
+
#### Parameters
|
|
235
|
+
|
|
236
|
+
##### controller
|
|
237
|
+
|
|
238
|
+
`string`
|
|
239
|
+
|
|
240
|
+
The controller of the identity who can make changes.
|
|
241
|
+
|
|
242
|
+
##### documentId
|
|
243
|
+
|
|
244
|
+
`string`
|
|
245
|
+
|
|
246
|
+
The id of the document to update.
|
|
247
|
+
|
|
248
|
+
##### alias
|
|
249
|
+
|
|
250
|
+
`string`
|
|
251
|
+
|
|
252
|
+
The alias to add. Must be a Url or Urn (typically another DID).
|
|
253
|
+
|
|
254
|
+
#### Returns
|
|
255
|
+
|
|
256
|
+
`Promise`\<`void`\>
|
|
257
|
+
|
|
258
|
+
Nothing.
|
|
259
|
+
|
|
260
|
+
#### Throws
|
|
261
|
+
|
|
262
|
+
GeneralError if the alias is not a Url or Urn.
|
|
263
|
+
|
|
264
|
+
#### Throws
|
|
265
|
+
|
|
266
|
+
NotFoundError if the id can not be resolved.
|
|
267
|
+
|
|
268
|
+
***
|
|
269
|
+
|
|
270
|
+
### removeAlsoKnownAs() {#removealsoknownas}
|
|
271
|
+
|
|
272
|
+
> **removeAlsoKnownAs**(`controller`, `documentId`, `alias`): `Promise`\<`void`\>
|
|
273
|
+
|
|
274
|
+
Remove an alias from the alsoKnownAs property on the document.
|
|
275
|
+
If the alias is not present the operation is a no-op.
|
|
276
|
+
|
|
277
|
+
#### Parameters
|
|
278
|
+
|
|
279
|
+
##### controller
|
|
280
|
+
|
|
281
|
+
`string`
|
|
282
|
+
|
|
283
|
+
The controller of the identity who can make changes.
|
|
284
|
+
|
|
285
|
+
##### documentId
|
|
286
|
+
|
|
287
|
+
`string`
|
|
288
|
+
|
|
289
|
+
The id of the document to update.
|
|
290
|
+
|
|
291
|
+
##### alias
|
|
292
|
+
|
|
293
|
+
`string`
|
|
294
|
+
|
|
295
|
+
The alias to remove. Must be a Url or Urn.
|
|
296
|
+
|
|
297
|
+
#### Returns
|
|
298
|
+
|
|
299
|
+
`Promise`\<`void`\>
|
|
300
|
+
|
|
301
|
+
Nothing.
|
|
302
|
+
|
|
303
|
+
#### Throws
|
|
304
|
+
|
|
305
|
+
GeneralError if the alias is not a Url or Urn.
|
|
306
|
+
|
|
307
|
+
#### Throws
|
|
308
|
+
|
|
309
|
+
NotFoundError if the id can not be resolved.
|
|
310
|
+
|
|
311
|
+
***
|
|
312
|
+
|
|
313
|
+
### createVerifiableCredential() {#createverifiablecredential}
|
|
228
314
|
|
|
229
315
|
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `options?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
230
316
|
|
|
@@ -246,9 +332,9 @@ The verification method id to use.
|
|
|
246
332
|
|
|
247
333
|
##### id
|
|
248
334
|
|
|
249
|
-
|
|
335
|
+
`string` \| `undefined`
|
|
250
336
|
|
|
251
|
-
|
|
337
|
+
The id of the credential.
|
|
252
338
|
|
|
253
339
|
##### subject
|
|
254
340
|
|
|
@@ -272,6 +358,18 @@ The bitmap revocation index of the credential, if undefined will not have revoca
|
|
|
272
358
|
|
|
273
359
|
The date the verifiable credential is valid until.
|
|
274
360
|
|
|
361
|
+
###### jwtHeaderFields?
|
|
362
|
+
|
|
363
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
364
|
+
|
|
365
|
+
Additional fields to include in the JWT header when creating the verifiable credential in jwt format.
|
|
366
|
+
|
|
367
|
+
###### jwtPayloadFields?
|
|
368
|
+
|
|
369
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
370
|
+
|
|
371
|
+
Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.
|
|
372
|
+
|
|
275
373
|
#### Returns
|
|
276
374
|
|
|
277
375
|
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
@@ -284,17 +382,17 @@ NotFoundError if the id can not be resolved.
|
|
|
284
382
|
|
|
285
383
|
***
|
|
286
384
|
|
|
287
|
-
### checkVerifiableCredential()
|
|
385
|
+
### checkVerifiableCredential() {#checkverifiablecredential}
|
|
288
386
|
|
|
289
|
-
> **checkVerifiableCredential**(`
|
|
387
|
+
> **checkVerifiableCredential**(`credential`): `Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
290
388
|
|
|
291
389
|
Check a verifiable credential is valid.
|
|
292
390
|
|
|
293
391
|
#### Parameters
|
|
294
392
|
|
|
295
|
-
#####
|
|
393
|
+
##### credential
|
|
296
394
|
|
|
297
|
-
`string`
|
|
395
|
+
`string` \| `IDidVerifiableCredential`
|
|
298
396
|
|
|
299
397
|
The credential to verify.
|
|
300
398
|
|
|
@@ -306,7 +404,7 @@ The credential stored in the jwt and the revocation status.
|
|
|
306
404
|
|
|
307
405
|
***
|
|
308
406
|
|
|
309
|
-
### revokeVerifiableCredentials()
|
|
407
|
+
### revokeVerifiableCredentials() {#revokeverifiablecredentials}
|
|
310
408
|
|
|
311
409
|
> **revokeVerifiableCredentials**(`controller`, `issuerDocumentId`, `credentialIndices`): `Promise`\<`void`\>
|
|
312
410
|
|
|
@@ -340,7 +438,7 @@ Nothing.
|
|
|
340
438
|
|
|
341
439
|
***
|
|
342
440
|
|
|
343
|
-
### unrevokeVerifiableCredentials()
|
|
441
|
+
### unrevokeVerifiableCredentials() {#unrevokeverifiablecredentials}
|
|
344
442
|
|
|
345
443
|
> **unrevokeVerifiableCredentials**(`controller`, `issuerDocumentId`, `credentialIndices`): `Promise`\<`void`\>
|
|
346
444
|
|
|
@@ -374,9 +472,9 @@ Nothing.
|
|
|
374
472
|
|
|
375
473
|
***
|
|
376
474
|
|
|
377
|
-
### createVerifiablePresentation()
|
|
475
|
+
### createVerifiablePresentation() {#createverifiablepresentation}
|
|
378
476
|
|
|
379
|
-
> **createVerifiablePresentation**(`controller`, `verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `
|
|
477
|
+
> **createVerifiablePresentation**(`controller`, `verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `options?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
380
478
|
|
|
381
479
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
382
480
|
|
|
@@ -396,21 +494,21 @@ The method to associate with the presentation.
|
|
|
396
494
|
|
|
397
495
|
##### presentationId
|
|
398
496
|
|
|
399
|
-
|
|
497
|
+
`string` \| `undefined`
|
|
400
498
|
|
|
401
|
-
|
|
499
|
+
The id of the presentation.
|
|
402
500
|
|
|
403
501
|
##### contexts
|
|
404
502
|
|
|
405
|
-
|
|
503
|
+
`IJsonLdContextDefinitionRoot` \| `undefined`
|
|
406
504
|
|
|
407
|
-
|
|
505
|
+
The contexts for the data stored in the verifiable credential.
|
|
408
506
|
|
|
409
507
|
##### types
|
|
410
508
|
|
|
411
|
-
|
|
509
|
+
`string` \| `string`[] \| `undefined`
|
|
412
510
|
|
|
413
|
-
|
|
511
|
+
The types for the data stored in the verifiable credential.
|
|
414
512
|
|
|
415
513
|
##### verifiableCredentials
|
|
416
514
|
|
|
@@ -418,11 +516,27 @@ The types for the data stored in the verifiable credential.
|
|
|
418
516
|
|
|
419
517
|
The credentials to use for creating the presentation in jwt format.
|
|
420
518
|
|
|
421
|
-
#####
|
|
519
|
+
##### options?
|
|
422
520
|
|
|
423
|
-
|
|
521
|
+
Additional options for creating the verifiable presentation.
|
|
522
|
+
|
|
523
|
+
###### expirationDate?
|
|
524
|
+
|
|
525
|
+
`Date`
|
|
526
|
+
|
|
527
|
+
The date the verifiable presentation is valid until.
|
|
424
528
|
|
|
425
|
-
|
|
529
|
+
###### jwtHeaderFields?
|
|
530
|
+
|
|
531
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
532
|
+
|
|
533
|
+
Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.
|
|
534
|
+
|
|
535
|
+
###### jwtPayloadFields?
|
|
536
|
+
|
|
537
|
+
\{\[`id`: `string`\]: `string`; \}
|
|
538
|
+
|
|
539
|
+
Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.
|
|
426
540
|
|
|
427
541
|
#### Returns
|
|
428
542
|
|
|
@@ -436,17 +550,17 @@ NotFoundError if the id can not be resolved.
|
|
|
436
550
|
|
|
437
551
|
***
|
|
438
552
|
|
|
439
|
-
### checkVerifiablePresentation()
|
|
553
|
+
### checkVerifiablePresentation() {#checkverifiablepresentation}
|
|
440
554
|
|
|
441
|
-
> **checkVerifiablePresentation**(`
|
|
555
|
+
> **checkVerifiablePresentation**(`presentation`): `Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
442
556
|
|
|
443
557
|
Check a verifiable presentation is valid.
|
|
444
558
|
|
|
445
559
|
#### Parameters
|
|
446
560
|
|
|
447
|
-
#####
|
|
561
|
+
##### presentation
|
|
448
562
|
|
|
449
|
-
`string`
|
|
563
|
+
`string` \| `IDidVerifiablePresentation`
|
|
450
564
|
|
|
451
565
|
The presentation to verify.
|
|
452
566
|
|
|
@@ -458,7 +572,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
458
572
|
|
|
459
573
|
***
|
|
460
574
|
|
|
461
|
-
### createProof()
|
|
575
|
+
### createProof() {#createproof}
|
|
462
576
|
|
|
463
577
|
> **createProof**(`controller`, `verificationMethodId`, `proofType`, `unsecureDocument`): `Promise`\<`IProof`\>
|
|
464
578
|
|
|
@@ -498,7 +612,7 @@ The proof.
|
|
|
498
612
|
|
|
499
613
|
***
|
|
500
614
|
|
|
501
|
-
### verifyProof()
|
|
615
|
+
### verifyProof() {#verifyproof}
|
|
502
616
|
|
|
503
617
|
> **verifyProof**(`document`, `proof`): `Promise`\<`boolean`\>
|
|
504
618
|
|
|
@@ -4,14 +4,14 @@ Request to create an identity.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### body?
|
|
7
|
+
### body? {#body}
|
|
8
8
|
|
|
9
|
-
> `optional` **body
|
|
9
|
+
> `optional` **body?**: `object`
|
|
10
10
|
|
|
11
11
|
The data for the request.
|
|
12
12
|
|
|
13
13
|
#### namespace?
|
|
14
14
|
|
|
15
|
-
> `optional` **namespace
|
|
15
|
+
> `optional` **namespace?**: `string`
|
|
16
16
|
|
|
17
17
|
The optional namespace to create the identity in.
|