@digitalbazaar/oid4-client 5.4.1 → 5.5.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.
package/lib/query/dcql.js CHANGED
@@ -112,7 +112,9 @@ export function _fromQueryByExampleQuery({
112
112
  id: crypto.randomUUID(),
113
113
  format: 'ldp_vc',
114
114
  meta: {
115
- type_values: ['https://www.w3.org/2018/credentials#VerifiableCredential']
115
+ type_values: [
116
+ ['https://www.w3.org/2018/credentials#VerifiableCredential']
117
+ ]
116
118
  }
117
119
  };
118
120
  if(credentialQuery?.reason) {
@@ -59,9 +59,25 @@ export function vprGroupsToPresentationDefinition({
59
59
  const all = Array.isArray(queryByExample.credentialQuery) ?
60
60
  queryByExample.credentialQuery : [queryByExample.credentialQuery];
61
61
  for(const credentialQuery of all) {
62
- input_descriptors.push(_fromQueryByExampleQuery({
62
+ const inputDescriptor = _fromQueryByExampleQuery({
63
63
  credentialQuery, prefixJwtVcPath
64
- }));
64
+ });
65
+ input_descriptors.push(inputDescriptor);
66
+ const {acceptedEnvelopes, acceptedCryptosuites} = credentialQuery;
67
+ const shouldAddFormat = acceptedEnvelopes || acceptedCryptosuites;
68
+ if(shouldAddFormat && !inputDescriptor.format) {
69
+ inputDescriptor.format = {};
70
+ }
71
+ if(acceptedEnvelopes?.includes('application/jwt')) {
72
+ inputDescriptor.format.jwt_vc_json = {
73
+ alg: ['EdDSA', 'Ed25519', 'ES256', 'ES384']
74
+ };
75
+ }
76
+ if(acceptedCryptosuites) {
77
+ inputDescriptor.format.ldp_vc = {
78
+ proof_type: acceptedCryptosuites.map(({cryptosuite}) => cryptosuite)
79
+ };
80
+ }
65
81
  }
66
82
  }
67
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalbazaar/oid4-client",
3
- "version": "5.4.1",
3
+ "version": "5.5.0",
4
4
  "description": "An OID4 (VC + VP) client",
5
5
  "homepage": "https://github.com/digitalbazaar/oid4-client",
6
6
  "author": {