@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.62.225 → 0.34.1-feature.SSISDK.62.239

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.cjs CHANGED
@@ -1892,9 +1892,6 @@ var getCredentialConfigsSupportedBySingleTypeOrId = /* @__PURE__ */ __name(async
1892
1892
  }
1893
1893
  __name(createIdFromTypes, "createIdFromTypes");
1894
1894
  if (configurationId) {
1895
- if (!format) {
1896
- return Promise.reject(Error("format parameter missing from input"));
1897
- }
1898
1895
  const allSupported2 = client.getCredentialsSupported(format);
1899
1896
  return Object.fromEntries(Object.entries(allSupported2).filter(([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId));
1900
1897
  }
@@ -2371,7 +2368,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
2371
2368
  formats = Array.from(new Set(authFormats));
2372
2369
  }
2373
2370
  let oid4vciClient;
2374
- let types = void 0;
2375
2371
  let offer;
2376
2372
  if (requestData.existingClientState) {
2377
2373
  oid4vciClient = await import_oid4vci_client3.OpenID4VCIClient.fromState({
@@ -2407,23 +2403,18 @@ var OID4VCIHolder = class _OID4VCIHolder {
2407
2403
  });
2408
2404
  }
2409
2405
  }
2406
+ let configurationIds = [];
2410
2407
  if (offer) {
2411
- const credentialsSupported2 = offer.original_credential_offer.credential_configuration_ids.flatMap((configId) => {
2412
- const config = oid4vciClient.endpointMetadata.credentialIssuerMetadata?.credential_configurations_supported[configId];
2413
- return config ? [
2414
- config
2415
- ] : [];
2416
- });
2417
- types = credentialsSupported2.map((credentialSupported) => (0, import_oid4vci_common4.getTypesFromCredentialSupported)(credentialSupported));
2408
+ configurationIds = offer.original_credential_offer.credential_configuration_ids;
2418
2409
  } else {
2419
- types = (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails).map((authReqOpts) => (0, import_oid4vci_common4.getTypesFromAuthorizationDetails)(authReqOpts) ?? []).filter((inner) => inner.length > 0);
2410
+ configurationIds = (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails).filter((authDetails) => typeof authDetails !== "string").map((authReqOpts) => authReqOpts.credential_configuration_id).filter((id) => !!id);
2420
2411
  }
2421
- const serverMetadata = await oid4vciClient.retrieveServerMetadata();
2422
2412
  const credentialsSupported = await getCredentialConfigsSupportedMerged({
2423
2413
  client: oid4vciClient,
2424
2414
  vcFormatPreferences: formats,
2425
- types
2415
+ configurationIds
2426
2416
  });
2417
+ const serverMetadata = await oid4vciClient.retrieveServerMetadata();
2427
2418
  const credentialBranding = await getCredentialBranding({
2428
2419
  credentialsSupported,
2429
2420
  context