@sphereon/ssi-sdk.oid4vci-holder 0.34.1-next.6 → 0.34.1-next.7

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
@@ -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),