@twin.org/identity-connector-entity-storage 0.0.1-next.11 → 0.0.1-next.13
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 +7 -8
- package/dist/esm/index.mjs +7 -8
- package/docs/changelog.md +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -412,20 +412,19 @@ class EntityStorageIdentityConnector {
|
|
|
412
412
|
throw new core.GeneralError(this.CLASS_NAME, "publicKeyJwkMissing");
|
|
413
413
|
}
|
|
414
414
|
const revocationService = issuerDidDocument.service?.find(s => s.id.endsWith("#revocation"));
|
|
415
|
+
const credentialClone = core.ObjectHelper.clone(credential);
|
|
415
416
|
const finalTypes = [standardsW3cDid.DidTypes.VerifiableCredential];
|
|
416
|
-
const credContext = core.ObjectHelper.extractProperty(
|
|
417
|
-
|
|
418
|
-
]);
|
|
419
|
-
const credId = core.ObjectHelper.extractProperty(credential, ["@id", "id"], false);
|
|
420
|
-
const credType = core.ObjectHelper.extractProperty(credential, ["@type", "type"]);
|
|
417
|
+
const credContext = core.ObjectHelper.extractProperty(credentialClone, ["@context"]);
|
|
418
|
+
const credId = core.ObjectHelper.extractProperty(credentialClone, ["@id", "id"], false);
|
|
419
|
+
const credType = core.ObjectHelper.extractProperty(credentialClone, ["@type", "type"]);
|
|
421
420
|
if (core.Is.stringValue(credType)) {
|
|
422
421
|
finalTypes.push(credType);
|
|
423
422
|
}
|
|
424
423
|
const verifiableCredential = {
|
|
425
|
-
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.
|
|
424
|
+
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.ContextVCv1, credContext) ?? null,
|
|
426
425
|
id,
|
|
427
426
|
type: finalTypes,
|
|
428
|
-
credentialSubject:
|
|
427
|
+
credentialSubject: credentialClone,
|
|
429
428
|
issuer: issuerDidDocument.id,
|
|
430
429
|
issuanceDate: new Date().toISOString(),
|
|
431
430
|
credentialStatus: revocationService && !core.Is.undefined(revocationIndex)
|
|
@@ -690,7 +689,7 @@ class EntityStorageIdentityConnector {
|
|
|
690
689
|
finalTypes.push(types);
|
|
691
690
|
}
|
|
692
691
|
const verifiablePresentation = {
|
|
693
|
-
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.
|
|
692
|
+
"@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.ContextVCv1, contexts) ?? null,
|
|
694
693
|
id: presentationId,
|
|
695
694
|
type: finalTypes,
|
|
696
695
|
verifiableCredential: verifiableCredentials,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -410,20 +410,19 @@ class EntityStorageIdentityConnector {
|
|
|
410
410
|
throw new GeneralError(this.CLASS_NAME, "publicKeyJwkMissing");
|
|
411
411
|
}
|
|
412
412
|
const revocationService = issuerDidDocument.service?.find(s => s.id.endsWith("#revocation"));
|
|
413
|
+
const credentialClone = ObjectHelper.clone(credential);
|
|
413
414
|
const finalTypes = [DidTypes.VerifiableCredential];
|
|
414
|
-
const credContext = ObjectHelper.extractProperty(
|
|
415
|
-
|
|
416
|
-
]);
|
|
417
|
-
const credId = ObjectHelper.extractProperty(credential, ["@id", "id"], false);
|
|
418
|
-
const credType = ObjectHelper.extractProperty(credential, ["@type", "type"]);
|
|
415
|
+
const credContext = ObjectHelper.extractProperty(credentialClone, ["@context"]);
|
|
416
|
+
const credId = ObjectHelper.extractProperty(credentialClone, ["@id", "id"], false);
|
|
417
|
+
const credType = ObjectHelper.extractProperty(credentialClone, ["@type", "type"]);
|
|
419
418
|
if (Is.stringValue(credType)) {
|
|
420
419
|
finalTypes.push(credType);
|
|
421
420
|
}
|
|
422
421
|
const verifiableCredential = {
|
|
423
|
-
"@context": JsonLdProcessor.combineContexts(DidContexts.
|
|
422
|
+
"@context": JsonLdProcessor.combineContexts(DidContexts.ContextVCv1, credContext) ?? null,
|
|
424
423
|
id,
|
|
425
424
|
type: finalTypes,
|
|
426
|
-
credentialSubject:
|
|
425
|
+
credentialSubject: credentialClone,
|
|
427
426
|
issuer: issuerDidDocument.id,
|
|
428
427
|
issuanceDate: new Date().toISOString(),
|
|
429
428
|
credentialStatus: revocationService && !Is.undefined(revocationIndex)
|
|
@@ -688,7 +687,7 @@ class EntityStorageIdentityConnector {
|
|
|
688
687
|
finalTypes.push(types);
|
|
689
688
|
}
|
|
690
689
|
const verifiablePresentation = {
|
|
691
|
-
"@context": JsonLdProcessor.combineContexts(DidContexts.
|
|
690
|
+
"@context": JsonLdProcessor.combineContexts(DidContexts.ContextVCv1, contexts) ?? null,
|
|
692
691
|
id: presentationId,
|
|
693
692
|
type: finalTypes,
|
|
694
693
|
verifiableCredential: verifiableCredentials,
|
package/docs/changelog.md
CHANGED
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.13",
|
|
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.13",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/standards-w3c-did": "next",
|
|
25
25
|
"@twin.org/vault-models": "next",
|