@sphereon/ssi-sdk.oid4vci-holder 0.34.1-fix.223 → 0.34.1-fix.247

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.d.cts CHANGED
@@ -7,7 +7,7 @@ import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
7
7
  import { SupportedDidMethodEnum, CreateOrGetIdentifierOpts, IdentifierProviderOpts } from '@sphereon/ssi-sdk-ext.did-utils';
8
8
  import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
9
9
  import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
10
- import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store';
10
+ import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
11
11
  import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
12
12
  import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
13
13
  import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
7
7
  import { SupportedDidMethodEnum, CreateOrGetIdentifierOpts, IdentifierProviderOpts } from '@sphereon/ssi-sdk-ext.did-utils';
8
8
  import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
9
9
  import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
10
- import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store';
10
+ import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
11
11
  import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
12
12
  import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
13
13
  import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
package/dist/index.js CHANGED
@@ -56,14 +56,16 @@ var require_nl = __commonJS({
56
56
 
57
57
  // src/agent/OID4VCIHolder.ts
58
58
  import { CredentialOfferClient, MetadataClient, OpenID4VCIClient as OpenID4VCIClient2 } from "@sphereon/oid4vci-client";
59
- import { DefaultURISchemes, getTypesFromAuthorizationDetails, getTypesFromCredentialSupported as getTypesFromCredentialSupported2, getTypesFromObject as getTypesFromObject2 } from "@sphereon/oid4vci-common";
59
+ import { DefaultURISchemes, getTypesFromObject as getTypesFromObject2 } from "@sphereon/oid4vci-common";
60
60
  import { SupportedDidMethodEnum as SupportedDidMethodEnum2 } from "@sphereon/ssi-sdk-ext.did-utils";
61
61
  import { isManagedIdentifierDidOpts, isManagedIdentifierDidResult as isManagedIdentifierDidResult2, isManagedIdentifierJwkResult, isManagedIdentifierKidResult, isManagedIdentifierResult as isManagedIdentifierResult2, isManagedIdentifierX5cOpts, isManagedIdentifierX5cResult } from "@sphereon/ssi-sdk-ext.identifier-resolution";
62
62
  import { signatureAlgorithmFromKey } from "@sphereon/ssi-sdk-ext.key-utils";
63
63
  import { defaultHasher as defaultHasher2 } from "@sphereon/ssi-sdk.core";
64
- import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, ensureRawDocument, IdentityOrigin } from "@sphereon/ssi-sdk.data-store";
65
- import { CredentialMapper as CredentialMapper2, JoseSignatureAlgorithm as JoseSignatureAlgorithm2, Loggers, parseDid, CredentialRole } from "@sphereon/ssi-types";
64
+ import { ensureRawDocument } from "@sphereon/ssi-sdk.data-store-types";
65
+ import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, IdentityOrigin } from "@sphereon/ssi-sdk.data-store-types";
66
+ import { CredentialMapper as CredentialMapper2, CredentialRole, JoseSignatureAlgorithm as JoseSignatureAlgorithm2, Loggers, parseDid } from "@sphereon/ssi-types";
66
67
  import { asArray as asArray2, computeEntryHash } from "@veramo/utils";
68
+ import fetch from "cross-fetch";
67
69
  import { decodeJWT } from "did-jwt";
68
70
  import { v4 as uuidv42 } from "uuid";
69
71
 
@@ -1810,9 +1812,6 @@ var getCredentialConfigsSupportedBySingleTypeOrId = /* @__PURE__ */ __name(async
1810
1812
  }
1811
1813
  __name(createIdFromTypes, "createIdFromTypes");
1812
1814
  if (configurationId) {
1813
- if (!format) {
1814
- return Promise.reject(Error("format parameter missing from input"));
1815
- }
1816
1815
  const allSupported2 = client.getCredentialsSupported(format);
1817
1816
  return Object.fromEntries(Object.entries(allSupported2).filter(([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId));
1818
1817
  }
@@ -2069,7 +2068,6 @@ var startFirstPartApplicationMachine = /* @__PURE__ */ __name(async (args, conte
2069
2068
  }, "startFirstPartApplicationMachine");
2070
2069
 
2071
2070
  // src/agent/OID4VCIHolder.ts
2072
- import "cross-fetch/polyfill";
2073
2071
  var oid4vciHolderContextMethods = [
2074
2072
  "cmGetContacts",
2075
2073
  "cmGetContact",
@@ -2290,7 +2288,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
2290
2288
  formats = Array.from(new Set(authFormats));
2291
2289
  }
2292
2290
  let oid4vciClient;
2293
- let types = void 0;
2294
2291
  let offer;
2295
2292
  if (requestData.existingClientState) {
2296
2293
  oid4vciClient = await OpenID4VCIClient2.fromState({
@@ -2326,23 +2323,18 @@ var OID4VCIHolder = class _OID4VCIHolder {
2326
2323
  });
2327
2324
  }
2328
2325
  }
2326
+ let configurationIds = [];
2329
2327
  if (offer) {
2330
- const credentialsSupported2 = offer.original_credential_offer.credential_configuration_ids.flatMap((configId) => {
2331
- const config = oid4vciClient.endpointMetadata.credentialIssuerMetadata?.credential_configurations_supported[configId];
2332
- return config ? [
2333
- config
2334
- ] : [];
2335
- });
2336
- types = credentialsSupported2.map((credentialSupported) => getTypesFromCredentialSupported2(credentialSupported));
2328
+ configurationIds = offer.original_credential_offer.credential_configuration_ids;
2337
2329
  } else {
2338
- types = asArray2(authorizationRequestOpts.authorizationDetails).map((authReqOpts) => getTypesFromAuthorizationDetails(authReqOpts) ?? []).filter((inner) => inner.length > 0);
2330
+ configurationIds = asArray2(authorizationRequestOpts.authorizationDetails).filter((authDetails) => typeof authDetails !== "string").map((authReqOpts) => authReqOpts.credential_configuration_id).filter((id) => !!id);
2339
2331
  }
2340
- const serverMetadata = await oid4vciClient.retrieveServerMetadata();
2341
2332
  const credentialsSupported = await getCredentialConfigsSupportedMerged({
2342
2333
  client: oid4vciClient,
2343
2334
  vcFormatPreferences: formats,
2344
- types
2335
+ configurationIds
2345
2336
  });
2337
+ const serverMetadata = await oid4vciClient.retrieveServerMetadata();
2346
2338
  const credentialBranding = await getCredentialBranding({
2347
2339
  credentialsSupported,
2348
2340
  context