@twin.org/identity-connector-entity-storage 0.0.1-next.11 → 0.0.1-next.12

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.
@@ -412,12 +412,11 @@ 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(credential, [
417
- "@context"
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
  }
@@ -425,7 +424,7 @@ class EntityStorageIdentityConnector {
425
424
  "@context": dataJsonLd.JsonLdProcessor.combineContexts(standardsW3cDid.DidContexts.ContextV1, credContext) ?? null,
426
425
  id,
427
426
  type: finalTypes,
428
- credentialSubject: credential,
427
+ credentialSubject: credentialClone,
429
428
  issuer: issuerDidDocument.id,
430
429
  issuanceDate: new Date().toISOString(),
431
430
  credentialStatus: revocationService && !core.Is.undefined(revocationIndex)
@@ -410,12 +410,11 @@ 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(credential, [
415
- "@context"
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
  }
@@ -423,7 +422,7 @@ class EntityStorageIdentityConnector {
423
422
  "@context": JsonLdProcessor.combineContexts(DidContexts.ContextV1, credContext) ?? null,
424
423
  id,
425
424
  type: finalTypes,
426
- credentialSubject: credential,
425
+ credentialSubject: credentialClone,
427
426
  issuer: issuerDidDocument.id,
428
427
  issuanceDate: new Date().toISOString(),
429
428
  credentialStatus: revocationService && !Is.undefined(revocationIndex)
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/identity-connector-entity-storage- Changelog
2
2
 
3
- ## v0.0.1-next.11
3
+ ## v0.0.1-next.12
4
4
 
5
5
  - Initial Release
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.11",
3
+ "version": "0.0.1-next.12",
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.11",
22
+ "@twin.org/identity-models": "0.0.1-next.12",
23
23
  "@twin.org/nameof": "next",
24
24
  "@twin.org/standards-w3c-did": "next",
25
25
  "@twin.org/vault-models": "next",