@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.17.bitstring.sl.8 → 0.34.1-feature.SSISDK.26.48

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/index.js CHANGED
@@ -1538,7 +1538,7 @@ var getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
1538
1538
  const credentialBranding = {};
1539
1539
  await Promise.all(Object.entries(credentialsSupported).map(async ([configId, credentialsConfigSupported]) => {
1540
1540
  let sdJwtTypeMetadata;
1541
- if (credentialsConfigSupported.format === "vc+sd-jwt") {
1541
+ if (credentialsConfigSupported.format === "dc+sd-jwt") {
1542
1542
  const vct = credentialsConfigSupported.vct;
1543
1543
  if (vct.startsWith("http")) {
1544
1544
  try {
@@ -1994,7 +1994,7 @@ var getIssuanceCryptoSuite = /* @__PURE__ */ __name(async (opts) => {
1994
1994
  case "jwt":
1995
1995
  case "jwt_vc_json":
1996
1996
  case "jwt_vc":
1997
- case "vc+sd-jwt":
1997
+ case "dc+sd-jwt":
1998
1998
  case "mso_mdoc": {
1999
1999
  const supportedPreferences = jwtCryptographicSuitePreferences.filter((suite) => signing_algs_supported.includes(suite));
2000
2000
  if (supportedPreferences.length > 0) {
@@ -2132,7 +2132,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2132
2132
  oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this)
2133
2133
  };
2134
2134
  vcFormatPreferences = [
2135
- "vc+sd-jwt",
2135
+ "dc+sd-jwt",
2136
2136
  "mso_mdoc",
2137
2137
  "jwt_vc_json",
2138
2138
  "jwt_vc",
@@ -2658,9 +2658,19 @@ var OID4VCIHolder = class _OID4VCIHolder {
2658
2658
  }
2659
2659
  let counter = 0;
2660
2660
  for (const credentialId of selectedCredentials) {
2661
- const localeBranding = credentialBranding?.[credentialId];
2661
+ const configId = credentialId;
2662
+ const types = credentialsToAccept.find((ac) => ac.correlationId === configId || ac.credentialToAccept.id === configId || ac.types.includes(configId))?.types?.filter((type) => type != "VerifiableCredential") ?? [];
2663
+ const localeBranding = credentialBranding?.[configId] ?? [];
2664
+ if (localeBranding.length === 0) {
2665
+ for (const type of types) {
2666
+ const branding = credentialBranding?.[type] ?? [];
2667
+ if (branding.length > 0) {
2668
+ localeBranding.push(...branding);
2669
+ }
2670
+ }
2671
+ }
2662
2672
  if (localeBranding && localeBranding.length > 0) {
2663
- const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || credentialsToAccept[counter]);
2673
+ const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || JSON.stringify(credAccept.types.filter((cred) => cred !== "VerifiableCredential")) === JSON.stringify(types) || credentialsToAccept[counter]);
2664
2674
  counter++;
2665
2675
  await context.agent.ibAddCredentialBranding({
2666
2676
  vcHash: computeEntryHash(credential.rawVerifiableCredential),