@twin.org/identity-connector-entity-storage 0.0.1-next.14 → 0.0.1-next.15
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/dist/cjs/index.cjs
CHANGED
|
@@ -421,7 +421,7 @@ class EntityStorageIdentityConnector {
|
|
|
421
421
|
finalTypes.push(credType);
|
|
422
422
|
}
|
|
423
423
|
const verifiableCredential = {
|
|
424
|
-
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.
|
|
424
|
+
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.ContextVCv2, credContext),
|
|
425
425
|
id,
|
|
426
426
|
type: finalTypes,
|
|
427
427
|
credentialSubject: credentialClone,
|
|
@@ -542,9 +542,7 @@ class EntityStorageIdentityConnector {
|
|
|
542
542
|
const revoked = await this.checkRevocation(issuerDidDocument, verifiableCredential.credentialStatus?.revocationBitmapIndex);
|
|
543
543
|
return {
|
|
544
544
|
revoked,
|
|
545
|
-
verifiableCredential: revoked
|
|
546
|
-
? undefined
|
|
547
|
-
: verifiableCredential
|
|
545
|
+
verifiableCredential: revoked ? undefined : verifiableCredential
|
|
548
546
|
};
|
|
549
547
|
}
|
|
550
548
|
catch (error) {
|
|
@@ -689,7 +687,7 @@ class EntityStorageIdentityConnector {
|
|
|
689
687
|
finalTypes.push(types);
|
|
690
688
|
}
|
|
691
689
|
const verifiablePresentation = {
|
|
692
|
-
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.
|
|
690
|
+
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.ContextVCv2, contexts),
|
|
693
691
|
id: presentationId,
|
|
694
692
|
type: finalTypes,
|
|
695
693
|
verifiableCredential: verifiableCredentials,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -419,7 +419,7 @@ class EntityStorageIdentityConnector {
|
|
|
419
419
|
finalTypes.push(credType);
|
|
420
420
|
}
|
|
421
421
|
const verifiableCredential = {
|
|
422
|
-
"@context": JsonLdProcessor.combineContexts(DidContexts.
|
|
422
|
+
"@context": JsonLdProcessor.combineContexts(DidContexts.ContextVCv2, credContext),
|
|
423
423
|
id,
|
|
424
424
|
type: finalTypes,
|
|
425
425
|
credentialSubject: credentialClone,
|
|
@@ -540,9 +540,7 @@ class EntityStorageIdentityConnector {
|
|
|
540
540
|
const revoked = await this.checkRevocation(issuerDidDocument, verifiableCredential.credentialStatus?.revocationBitmapIndex);
|
|
541
541
|
return {
|
|
542
542
|
revoked,
|
|
543
|
-
verifiableCredential: revoked
|
|
544
|
-
? undefined
|
|
545
|
-
: verifiableCredential
|
|
543
|
+
verifiableCredential: revoked ? undefined : verifiableCredential
|
|
546
544
|
};
|
|
547
545
|
}
|
|
548
546
|
catch (error) {
|
|
@@ -687,7 +685,7 @@ class EntityStorageIdentityConnector {
|
|
|
687
685
|
finalTypes.push(types);
|
|
688
686
|
}
|
|
689
687
|
const verifiablePresentation = {
|
|
690
|
-
"@context": JsonLdProcessor.combineContexts(DidContexts.
|
|
688
|
+
"@context": JsonLdProcessor.combineContexts(DidContexts.ContextVCv2, contexts),
|
|
691
689
|
id: presentationId,
|
|
692
690
|
type: finalTypes,
|
|
693
691
|
verifiableCredential: verifiableCredentials,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type IJsonLdContextDefinitionRoot, type
|
|
1
|
+
import { type IJsonLdContextDefinitionRoot, type IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import { type IIdentityConnector } from "@twin.org/identity-models";
|
|
3
|
-
import { DidVerificationMethodType, type
|
|
3
|
+
import { DidVerificationMethodType, type IDidDocument, type IDidDocumentVerificationMethod, type IDidProof, type IDidService, type IDidVerifiableCredential, type IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
4
4
|
/**
|
|
5
5
|
* Class for performing identity operations using entity storage.
|
|
6
6
|
*/
|
|
@@ -85,8 +85,8 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
|
|
|
85
85
|
* @returns The created verifiable credential and its token.
|
|
86
86
|
* @throws NotFoundError if the id can not be resolved.
|
|
87
87
|
*/
|
|
88
|
-
createVerifiableCredential
|
|
89
|
-
verifiableCredential: IDidVerifiableCredential
|
|
88
|
+
createVerifiableCredential(controller: string, verificationMethodId: string, id: string | undefined, credential: IJsonLdNodeObject, revocationIndex?: number): Promise<{
|
|
89
|
+
verifiableCredential: IDidVerifiableCredential;
|
|
90
90
|
jwt: string;
|
|
91
91
|
}>;
|
|
92
92
|
/**
|
|
@@ -94,9 +94,9 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
|
|
|
94
94
|
* @param credentialJwt The credential to verify.
|
|
95
95
|
* @returns The credential stored in the jwt and the revocation status.
|
|
96
96
|
*/
|
|
97
|
-
checkVerifiableCredential
|
|
97
|
+
checkVerifiableCredential(credentialJwt: string): Promise<{
|
|
98
98
|
revoked: boolean;
|
|
99
|
-
verifiableCredential?: IDidVerifiableCredential
|
|
99
|
+
verifiableCredential?: IDidVerifiableCredential;
|
|
100
100
|
}>;
|
|
101
101
|
/**
|
|
102
102
|
* Revoke verifiable credential(s).
|
|
@@ -126,8 +126,8 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
|
|
|
126
126
|
* @returns The created verifiable presentation and its token.
|
|
127
127
|
* @throws NotFoundError if the id can not be resolved.
|
|
128
128
|
*/
|
|
129
|
-
createVerifiablePresentation
|
|
130
|
-
verifiablePresentation: IDidVerifiablePresentation
|
|
129
|
+
createVerifiablePresentation(controller: string, presentationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[], expiresInMinutes?: number): Promise<{
|
|
130
|
+
verifiablePresentation: IDidVerifiablePresentation;
|
|
131
131
|
jwt: string;
|
|
132
132
|
}>;
|
|
133
133
|
/**
|
|
@@ -135,9 +135,9 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
|
|
|
135
135
|
* @param presentationJwt The presentation to verify.
|
|
136
136
|
* @returns The presentation stored in the jwt and the revocation status.
|
|
137
137
|
*/
|
|
138
|
-
checkVerifiablePresentation
|
|
138
|
+
checkVerifiablePresentation(presentationJwt: string): Promise<{
|
|
139
139
|
revoked: boolean;
|
|
140
|
-
verifiablePresentation?: IDidVerifiablePresentation
|
|
140
|
+
verifiablePresentation?: IDidVerifiablePresentation;
|
|
141
141
|
issuers?: IDidDocument[];
|
|
142
142
|
}>;
|
|
143
143
|
/**
|
package/docs/changelog.md
CHANGED
|
@@ -264,14 +264,10 @@ NotFoundError if the id can not be resolved.
|
|
|
264
264
|
|
|
265
265
|
### createVerifiableCredential()
|
|
266
266
|
|
|
267
|
-
> **createVerifiableCredential
|
|
267
|
+
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `credential`, `revocationIndex`?): `Promise`\<`object`\>
|
|
268
268
|
|
|
269
269
|
Create a verifiable credential for a verification method.
|
|
270
270
|
|
|
271
|
-
#### Type Parameters
|
|
272
|
-
|
|
273
|
-
• **T** *extends* `IJsonLdObject`
|
|
274
|
-
|
|
275
271
|
#### Parameters
|
|
276
272
|
|
|
277
273
|
• **controller**: `string`
|
|
@@ -286,7 +282,7 @@ The verification method id to use.
|
|
|
286
282
|
|
|
287
283
|
The id of the credential.
|
|
288
284
|
|
|
289
|
-
• **credential**: `
|
|
285
|
+
• **credential**: `IJsonLdNodeObject`
|
|
290
286
|
|
|
291
287
|
The credential to store in the verifiable credential.
|
|
292
288
|
|
|
@@ -302,7 +298,7 @@ The created verifiable credential and its token.
|
|
|
302
298
|
|
|
303
299
|
##### verifiableCredential
|
|
304
300
|
|
|
305
|
-
> **verifiableCredential**: `IDidVerifiableCredential
|
|
301
|
+
> **verifiableCredential**: `IDidVerifiableCredential`
|
|
306
302
|
|
|
307
303
|
##### jwt
|
|
308
304
|
|
|
@@ -320,14 +316,10 @@ NotFoundError if the id can not be resolved.
|
|
|
320
316
|
|
|
321
317
|
### checkVerifiableCredential()
|
|
322
318
|
|
|
323
|
-
> **checkVerifiableCredential
|
|
319
|
+
> **checkVerifiableCredential**(`credentialJwt`): `Promise`\<`object`\>
|
|
324
320
|
|
|
325
321
|
Check a verifiable credential is valid.
|
|
326
322
|
|
|
327
|
-
#### Type Parameters
|
|
328
|
-
|
|
329
|
-
• **T** *extends* `IJsonLdObject`
|
|
330
|
-
|
|
331
323
|
#### Parameters
|
|
332
324
|
|
|
333
325
|
• **credentialJwt**: `string`
|
|
@@ -346,7 +338,7 @@ The credential stored in the jwt and the revocation status.
|
|
|
346
338
|
|
|
347
339
|
##### verifiableCredential?
|
|
348
340
|
|
|
349
|
-
> `optional` **verifiableCredential**: `IDidVerifiableCredential
|
|
341
|
+
> `optional` **verifiableCredential**: `IDidVerifiableCredential`
|
|
350
342
|
|
|
351
343
|
#### Implementation of
|
|
352
344
|
|
|
@@ -420,14 +412,10 @@ Nothing.
|
|
|
420
412
|
|
|
421
413
|
### createVerifiablePresentation()
|
|
422
414
|
|
|
423
|
-
> **createVerifiablePresentation
|
|
415
|
+
> **createVerifiablePresentation**(`controller`, `presentationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes`?): `Promise`\<`object`\>
|
|
424
416
|
|
|
425
417
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
426
418
|
|
|
427
|
-
#### Type Parameters
|
|
428
|
-
|
|
429
|
-
• **T** *extends* `IJsonLdObject`
|
|
430
|
-
|
|
431
419
|
#### Parameters
|
|
432
420
|
|
|
433
421
|
• **controller**: `string`
|
|
@@ -450,7 +438,7 @@ The contexts for the data stored in the verifiable credential.
|
|
|
450
438
|
|
|
451
439
|
The types for the data stored in the verifiable credential.
|
|
452
440
|
|
|
453
|
-
• **verifiableCredentials**: (`string` \| `IDidVerifiableCredential
|
|
441
|
+
• **verifiableCredentials**: (`string` \| `IDidVerifiableCredential`)[]
|
|
454
442
|
|
|
455
443
|
The credentials to use for creating the presentation in jwt format.
|
|
456
444
|
|
|
@@ -466,7 +454,7 @@ The created verifiable presentation and its token.
|
|
|
466
454
|
|
|
467
455
|
##### verifiablePresentation
|
|
468
456
|
|
|
469
|
-
> **verifiablePresentation**: `IDidVerifiablePresentation
|
|
457
|
+
> **verifiablePresentation**: `IDidVerifiablePresentation`
|
|
470
458
|
|
|
471
459
|
##### jwt
|
|
472
460
|
|
|
@@ -484,14 +472,10 @@ NotFoundError if the id can not be resolved.
|
|
|
484
472
|
|
|
485
473
|
### checkVerifiablePresentation()
|
|
486
474
|
|
|
487
|
-
> **checkVerifiablePresentation
|
|
475
|
+
> **checkVerifiablePresentation**(`presentationJwt`): `Promise`\<`object`\>
|
|
488
476
|
|
|
489
477
|
Check a verifiable presentation is valid.
|
|
490
478
|
|
|
491
|
-
#### Type Parameters
|
|
492
|
-
|
|
493
|
-
• **T** *extends* `IJsonLdObject`
|
|
494
|
-
|
|
495
479
|
#### Parameters
|
|
496
480
|
|
|
497
481
|
• **presentationJwt**: `string`
|
|
@@ -510,7 +494,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
510
494
|
|
|
511
495
|
##### verifiablePresentation?
|
|
512
496
|
|
|
513
|
-
> `optional` **verifiablePresentation**: `IDidVerifiablePresentation
|
|
497
|
+
> `optional` **verifiablePresentation**: `IDidVerifiablePresentation`
|
|
514
498
|
|
|
515
499
|
##### issuers?
|
|
516
500
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-connector-entity-storage",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.15",
|
|
4
4
|
"description": "Identity connector implementation using entity storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/data-core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/identity-models": "0.0.1-next.
|
|
22
|
+
"@twin.org/identity-models": "0.0.1-next.15",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/standards-w3c-did": "next",
|
|
25
25
|
"@twin.org/vault-models": "next",
|