@sphereon/ssi-sdk.oid4vci-holder 0.36.1-feature.SSISDK.82.and.SSISDK.70.37 → 0.36.1-next.11

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
@@ -413,7 +413,6 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
413
413
  // TODO WAL-671 we need to store the data from OpenIdProvider here in the context and make sure we can restart the machine with it and init the OpenIdProvider
414
414
  accessTokenOpts: opts?.accessTokenOpts,
415
415
  requestData: opts?.requestData,
416
- walletType: opts?.walletType ?? "NATURAL_PERSON",
417
416
  trustAnchors: opts?.trustAnchors ?? [],
418
417
  issuanceOpt: opts?.issuanceOpt,
419
418
  didMethodPreferences: opts?.didMethodPreferences,
@@ -578,7 +577,7 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
578
577
  cond: OID4VCIMachineGuards.isFirstPartyApplication
579
578
  },
580
579
  {
581
- target: OID4VCIMachineStates.prepareAuthorizationRequest,
580
+ target: OID4VCIMachineStates.initiateAuthorizationRequest,
582
581
  cond: OID4VCIMachineGuards.requireAuthorizationGuard
583
582
  },
584
583
  {
@@ -683,6 +682,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
683
682
  target: OID4VCIMachineStates.prepareAuthorizationRequest,
684
683
  cond: OID4VCIMachineGuards.requireAuthorizationGuard
685
684
  },
685
+ {
686
+ target: OID4VCIMachineStates.initiateAuthorizationRequest,
687
+ cond: OID4VCIMachineGuards.requireAuthorizationGuard
688
+ },
686
689
  {
687
690
  target: OID4VCIMachineStates.verifyPin,
688
691
  cond: OID4VCIMachineGuards.requirePinGuard
@@ -762,6 +765,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
762
765
  target: OID4VCIMachineStates.verifyPin,
763
766
  cond: OID4VCIMachineGuards.requirePinGuard
764
767
  },
768
+ {
769
+ target: OID4VCIMachineStates.prepareAuthorizationRequest,
770
+ cond: OID4VCIMachineGuards.requireAuthorizationGuard
771
+ },
765
772
  {
766
773
  target: OID4VCIMachineStates.getCredentials
767
774
  }
@@ -2466,7 +2473,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2466
2473
  if (!clientId) {
2467
2474
  return Promise.reject(Error(`Missing client id in contact's connectionConfig`));
2468
2475
  }
2469
- const client = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromState({
2476
+ const client = await import_oid4vci_client3.OpenID4VCIClient.fromState({
2470
2477
  state: openID4VCIClientState
2471
2478
  });
2472
2479
  const authorizationCodeURL = await client.createAuthorizationRequestUrl({
@@ -2549,7 +2556,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2549
2556
  return party;
2550
2557
  }
2551
2558
  async oid4vciHolderGetCredentials(args, context) {
2552
- const { verificationCode, openID4VCIClientState, didMethodPreferences, issuanceOpt, accessTokenOpts, walletType } = args;
2559
+ const { verificationCode, openID4VCIClientState, didMethodPreferences = this.didMethodPreferences, issuanceOpt, accessTokenOpts } = args;
2553
2560
  logger.debug(`Getting credentials`, issuanceOpt, accessTokenOpts);
2554
2561
  if (!openID4VCIClientState) {
2555
2562
  return Promise.reject(Error("Missing openID4VCI client state in context"));
@@ -2568,7 +2575,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2568
2575
  credentialsSupported,
2569
2576
  serverMetadata,
2570
2577
  context,
2571
- didMethodPreferences: this.selectDidMethodPreferences(didMethodPreferences, walletType),
2578
+ didMethodPreferences: Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences,
2572
2579
  jwtCryptographicSuitePreferences: this.jwtCryptographicSuitePreferences,
2573
2580
  jsonldCryptographicSuitePreferences: this.jsonldCryptographicSuitePreferences,
2574
2581
  ...issuanceOpt && {
@@ -2585,16 +2592,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
2585
2592
  logger.log(`Credentials received`, allCredentials);
2586
2593
  return allCredentials;
2587
2594
  }
2588
- selectDidMethodPreferences(didMethodPreferences, walletType) {
2589
- const supportedDidMethodEnums = Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences;
2590
- if (walletType === "ORGANIZATIONAL") {
2591
- return [
2592
- import_ssi_sdk_ext5.SupportedDidMethodEnum.DID_WEB,
2593
- ...supportedDidMethodEnums
2594
- ];
2595
- }
2596
- return supportedDidMethodEnums;
2597
- }
2598
2595
  async oid4vciHolderGetCredential(args, context) {
2599
2596
  const { issuanceOpt, pin, client, accessTokenOpts } = args;
2600
2597
  logger.info(`Getting credential`, issuanceOpt);
@@ -2662,9 +2659,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
2662
2659
  format: issuanceOpt.format,
2663
2660
  // TODO: We need to update the machine and add notifications support for actual deferred credentials instead of just waiting/retrying
2664
2661
  deferredCredentialAwait: true,
2665
- ...issuanceOpt.id && typeof issuanceOpt.id === "string" ? {
2666
- credentialConfigurationId: issuanceOpt.id
2667
- } : void 0,
2668
2662
  ...!jwk && {
2669
2663
  kid
2670
2664
  },
@@ -3149,7 +3143,6 @@ var OID4VCIHolderLinkHandler = class extends import_ssi_sdk4.LinkHandlerAdapter
3149
3143
  stateNavigationListener;
3150
3144
  firstPartyStateNavigationListener;
3151
3145
  noStateMachinePersistence;
3152
- walletType;
3153
3146
  authorizationRequestOpts;
3154
3147
  clientOpts;
3155
3148
  trustAnchors;
@@ -3161,7 +3154,6 @@ var OID4VCIHolderLinkHandler = class extends import_ssi_sdk4.LinkHandlerAdapter
3161
3154
  this.authorizationRequestOpts = args.authorizationRequestOpts;
3162
3155
  this.clientOpts = args.clientOpts;
3163
3156
  this.context = args.context;
3164
- this.walletType = args.walletType ?? "NATURAL_PERSON";
3165
3157
  this.noStateMachinePersistence = args.noStateMachinePersistence === true;
3166
3158
  this.stateNavigationListener = args.stateNavigationListener;
3167
3159
  this.firstPartyStateNavigationListener = args.firstPartyStateNavigationListener;
@@ -3198,8 +3190,7 @@ var OID4VCIHolderLinkHandler = class extends import_ssi_sdk4.LinkHandlerAdapter
3198
3190
  clientOpts
3199
3191
  },
3200
3192
  stateNavigationListener: this.stateNavigationListener,
3201
- firstPartyStateNavigationListener: this.firstPartyStateNavigationListener,
3202
- walletType: this.walletType
3193
+ firstPartyStateNavigationListener: this.firstPartyStateNavigationListener
3203
3194
  });
3204
3195
  const interpreter = oid4vciMachine.interpreter;
3205
3196
  if (!opts?.machineState && this.context.agent.availableMethods().includes("machineStatesFindActive")) {