@digitalbazaar/vc 7.1.2 → 7.3.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.
Files changed (2) hide show
  1. package/lib/index.js +9 -3
  2. package/package.json +6 -6
package/lib/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @author David I. Lehn
6
6
  *
7
7
  * @license BSD 3-Clause License
8
- * Copyright (c) 2017-2023 Digital Bazaar, Inc.
8
+ * Copyright (c) 2017-2025 Digital Bazaar, Inc.
9
9
  * All rights reserved.
10
10
  *
11
11
  * Redistribution and use in source and binary forms, with or without
@@ -229,6 +229,8 @@ export async function derive({
229
229
  * that clocks may be skewed when checking capability expiration date-times
230
230
  * against `date` and when comparing invocation proof creation time against
231
231
  * delegation proof creation time.
232
+ * @param {boolean} [options.includeCredentials=false] - Set to `true` to
233
+ * include the credentials in the credential results.
232
234
  *
233
235
  * @returns {Promise<VerifyPresentationResult>} The verification result.
234
236
  */
@@ -488,7 +490,7 @@ export async function signPresentation(options = {}) {
488
490
  * @returns {Promise<VerifyPresentationResult>} The verification result.
489
491
  */
490
492
  async function _verifyPresentation(options = {}) {
491
- const {presentation, unsignedPresentation} = options;
493
+ const {presentation, unsignedPresentation, includeCredentials} = options;
492
494
 
493
495
  _checkPresentation(presentation);
494
496
 
@@ -508,7 +510,11 @@ async function _verifyPresentation(options = {}) {
508
510
  }));
509
511
 
510
512
  for(const [i, credentialResult] of credentialResults.entries()) {
511
- credentialResult.credentialId = credentials[i].id;
513
+ const credential = credentials[i];
514
+ credentialResult.credentialId = credential.id;
515
+ if(includeCredentials) {
516
+ credentialResult.credential = credential;
517
+ }
512
518
  }
513
519
 
514
520
  const allCredentialsVerified = credentialResults.every(r => r.verified);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalbazaar/vc",
3
- "version": "7.1.2",
3
+ "version": "7.3.0",
4
4
  "description": "Verifiable Credentials JavaScript library.",
5
5
  "homepage": "https://github.com/digitalbazaar/vc",
6
6
  "author": {
@@ -29,9 +29,8 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@digitalbazaar/credentials-context": "^3.2.0",
32
- "ed25519-signature-2018-context": "^1.1.0",
33
- "jsonld": "^8.3.3",
34
- "jsonld-signatures": "^11.5.0"
32
+ "jsonld": "^9.0.0",
33
+ "jsonld-signatures": "^11.6.0"
35
34
  },
36
35
  "devDependencies": {
37
36
  "@digitalbazaar/bbs-2023-cryptosuite": "^2.0.1",
@@ -43,9 +42,9 @@
43
42
  "@digitalbazaar/did-method-key": "^5.2.0",
44
43
  "@digitalbazaar/did-method-web": "^1.0.1",
45
44
  "@digitalbazaar/ecdsa-multikey": "^1.8.0",
46
- "@digitalbazaar/ecdsa-rdfc-2019-cryptosuite": "^1.2.0",
45
+ "@digitalbazaar/ecdsa-rdfc-2019-cryptosuite": "^1.3.0",
47
46
  "@digitalbazaar/ecdsa-sd-2023-cryptosuite": "^3.4.1",
48
- "@digitalbazaar/ed25519-signature-2018": "^4.1.0",
47
+ "@digitalbazaar/ed25519-signature-2018": "^4.2.0",
49
48
  "@digitalbazaar/ed25519-verification-key-2018": "^4.0.0",
50
49
  "@digitalbazaar/multikey-context": "^2.0.1",
51
50
  "@digitalbazaar/odrl-context": "^1.0.0",
@@ -55,6 +54,7 @@
55
54
  "cross-env": "^7.0.3",
56
55
  "did-context": "^3.1.1",
57
56
  "did-veres-one": "^16.1.1",
57
+ "ed25519-signature-2018-context": "^1.1.0",
58
58
  "eslint": "^8.57.1",
59
59
  "eslint-config-digitalbazaar": "^5.2.0",
60
60
  "eslint-plugin-jsdoc": "^50.6.8",