@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.73.dcql.array.fix.267 → 0.34.1-feature.SSISDK.78.279

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
@@ -129,6 +129,7 @@ interface IOID4VCIHolder extends IPluginMethodMap {
129
129
  oid4vciHolderGetMachineInterpreter(args: GetMachineArgs, context: RequiredContext): Promise<OID4VCIMachine>;
130
130
  oid4vciHolderStart(args: PrepareStartArgs, context: RequiredContext): Promise<StartResult>;
131
131
  oid4vciHolderCreateCredentialsToSelectFrom(args: CreateCredentialsToSelectFromArgs, context: RequiredContext): Promise<Array<CredentialToSelectFromResult>>;
132
+ oid4vciHolderPrepareAuthorizationRequest(args: PrepareAuthorizationRequestArgs, context: RequiredContext): Promise<PrepareAuthorizationResult>;
132
133
  oid4vciHolderGetContact(args: GetContactArgs, context: RequiredContext): Promise<Party | undefined>;
133
134
  oid4vciHolderGetCredentials(args: GetCredentialsArgs, context: RequiredContext): Promise<Array<MappedCredentialToAccept>>;
134
135
  oid4vciHolderGetCredential(args: GetCredentialArgs, context: RequiredContext): Promise<MappedCredentialToAccept>;
@@ -177,6 +178,7 @@ type GetMachineArgs = {
177
178
  firstPartyStateNavigationListener?: FirstPartyMachineStateNavigationListener;
178
179
  };
179
180
  type PrepareStartArgs = Pick<OID4VCIMachineContext, 'requestData' | 'authorizationRequestOpts' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
181
+ type PrepareAuthorizationRequestArgs = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'>;
180
182
  type CreateCredentialsToSelectFromArgs = Pick<OID4VCIMachineContext, 'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'>;
181
183
  type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>;
182
184
  type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
@@ -266,6 +268,7 @@ declare enum OID4VCIMachineStates {
266
268
  selectCredentials = "selectCredentials",
267
269
  transitionFromSelectingCredentials = "transitionFromSelectingCredentials",
268
270
  verifyPin = "verifyPin",
271
+ prepareAuthorizationRequest = "prepareAuthorizationRequest",
269
272
  initiateAuthorizationRequest = "initiateAuthorizationRequest",
270
273
  waitForAuthorizationResponse = "waitForAuthorizationResponse",
271
274
  getCredentials = "getCredentials",
@@ -373,6 +376,7 @@ declare enum OID4VCIMachineServices {
373
376
  getFederationTrust = "getFederationTrust",
374
377
  addContactIdentity = "addContactIdentity",
375
378
  createCredentialsToSelectFrom = "createCredentialsToSelectFrom",
379
+ prepareAuthorizationRequest = "prepareAuthorizationRequest",
376
380
  getIssuerBranding = "getIssuerBranding",
377
381
  storeIssuerBranding = "storeIssuerBranding",
378
382
  getCredentials = "getCredentials",
@@ -448,12 +452,14 @@ type OID4VCIMachine = {
448
452
  interpreter: OID4VCIMachineInterpreter;
449
453
  };
450
454
  type StartResult = {
451
- authorizationCodeURL?: string;
452
455
  credentialBranding?: Record<string, Array<IBasicCredentialLocaleBranding>>;
453
456
  credentialsSupported: Record<string, CredentialConfigurationSupported>;
454
457
  serverMetadata: EndpointMetadataResult;
455
458
  oid4vciClientState: OpenID4VCIClientState;
456
459
  };
460
+ type PrepareAuthorizationResult = {
461
+ authorizationCodeURL?: string;
462
+ };
457
463
  type SelectAppLocaleBrandingArgs = {
458
464
  locale?: string;
459
465
  localeBranding?: Array<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding>;
@@ -699,6 +705,7 @@ declare class OID4VCIHolder implements IAgentPlugin {
699
705
  * @private
700
706
  */
701
707
  private oid4vciHolderStart;
708
+ private oid4vciHolderPrepareAuthorizationRequest;
702
709
  private oid4vciHolderCreateCredentialsToSelectFrom;
703
710
  private oid4vciHolderGetContact;
704
711
  private oid4vciHolderGetCredentials;
@@ -786,4 +793,4 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
786
793
  }): Promise<void>;
787
794
  }
788
795
 
789
- export { type AccessTokenOpts, type AddContactIdentityArgs, type AssertValidCredentialsArgs, type Attribute, type AuthorizationResponseEvent, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateContactEvent, type CreateCredentialsToSelectFromArgs, type CreateFirstPartyMachineOpts, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOID4VCIMachineOpts, type CredentialToAccept, type CredentialToSelectFromResult, type CredentialVerificationError, type DeclineEvent, type DefaultIssuanceOpts, type DidAgents, type DynamicRegistrationClientMetadataDisplay, type ErrorDetails, type FirstPartyDeclineEvent, type FirstPartyMachineContext, type FirstPartyMachineEventTypes, FirstPartyMachineEvents, type FirstPartyMachineInterpreter, type FirstPartyMachineNavigationArgs, type FirstPartyMachineServiceDefinitions, FirstPartyMachineServices, type FirstPartyMachineState, type FirstPartyMachineStateNavigationListener, FirstPartyMachineStateTypes, type FirstPartyMachineStates, type FirstPartyMachineStatesConfig, type FirstPartyNextEvent, type FirstPartyPreviousEvent, type FirstPartySelectCredentialsEvent, type FirstPartyStateMachine, type GetAuthenticationKeyArgs, type GetBasicIssuerLocaleBrandingArgs, type GetContactArgs, type GetCredentialArgs, type GetCredentialBrandingArgs, type GetCredentialConfigsSupportedArgs, type GetCredentialConfigsSupportedBySingleTypeOrIdArgs, type GetCredentialsArgs, type GetDefaultIssuanceOptsArgs, type GetFederationTrustArgs, type GetIdentifierArgs, type GetIssuanceCryptoSuiteArgs, type GetIssuanceDidMethodArgs, type GetIssuanceOptsArgs, type GetIssuerBrandingArgs, type GetIssuerMetadataArgs, type GetMachineArgs, type GetOrCreatePrimaryIdentifierArgs, type GetPreferredCredentialFormatsArgs, type GetSiopRequestArgs, type IOID4VCIHolder, IdentifierAliasEnum, type InstanceFirstPartyMachineOpts, type InvokeAuthorizationRequestEvent, type IssuanceOpts, type IssuerLocaleBrandingFromArgs, type IssuerType, type MapCredentialToAcceptArgs, type MappedCredentialToAccept, type NextEvent, OID4VCICallbackStateListener, type OID4VCIContext, OID4VCIHolder, OID4VCIHolderEvent, OID4VCIHolderLinkHandler, type OID4VCIHolderOptions, type OID4VCIMachine, OID4VCIMachineAddContactStates, type OID4VCIMachineContext, type OID4VCIMachineEventTypes, OID4VCIMachineEvents, OID4VCIMachineGuards, type OID4VCIMachineInstanceOpts, type OID4VCIMachineInterpreter, type OID4VCIMachineNavigationArgs, type OID4VCIMachineServiceDefinitions, OID4VCIMachineServices, type OID4VCIMachineState, type OID4VCIMachineStateNavigationListener, OID4VCIMachineStates, OID4VCIMachineVerifyPinStates, type OID4VCIProviderProps, type OID4VCIStateMachine, type Oid4vciCombineDisplayLocalesFromArgs, type Oid4vciCredentialDisplayLocalesFromArgs, type Oid4vciCredentialLocaleBrandingFromArgs, type Oid4vciGetCredentialBrandingFromArgs, type Oid4vciIssuerCredentialSubjectLocalesFromArgs, type OnContactIdentityCreatedArgs, type OnCredentialStoredArgs, type OnIdentifierCreatedArgs, type PrepareStartArgs, type PreviousEvent, type RequestData, RequestType, type RequiredContext, type SdJwtCombineDisplayLocalesFromArgs, type SdJwtCredentialClaimLocalesFromArgs, type SdJwtCredentialDisplayLocalesFromArgs, type SdJwtCredentialLocaleBrandingFromArgs, type SdJwtGetCredentialBrandingFromArgs, type SelectAppLocaleBrandingArgs, type SelectCredentialsEvent, type SendAuthorizationChallengeRequestArgs, type SendAuthorizationResponseArgs, type SendNotificationArgs, type SetAuthorizationCodeURLEvent, type SiopV2AuthorizationRequestData, type StartFirstPartApplicationMachine, type StartResult, type StoreCredentialBrandingArgs, type StoreCredentialsArgs, type StoreIssuerBrandingArgs, SupportedLanguage, type VerificationCodeEvent, type VerificationResult, type VerificationSubResult, type VerifyCredentialArgs, type VerifyCredentialToAcceptArgs, type VerifyEBSICredentialIssuerArgs, type VerifyEBSICredentialIssuerResult, type VerifyMdocArgs, type VerifySDJWTCredentialArgs, createConfig, extractCredentialFromResponse, getBasicIssuerLocaleBranding, getCredentialBranding, getCredentialConfigsBasedOnFormatPref, getCredentialConfigsSupported, getCredentialConfigsSupportedBySingleTypeOrId, getCredentialConfigsSupportedMerged, getIdentifierOpts, getIssuanceCryptoSuite, getIssuanceMethod, getIssuanceOpts, getSiopRequest, issuerLocaleBrandingFrom, mapCredentialToAccept, oid4vciCombineDisplayLocalesFrom, oid4vciCredentialDisplayLocalesFrom, oid4vciCredentialLocaleBrandingFrom, oid4vciGetCredentialBrandingFrom, oid4vciHolderContextMethods, oid4vciIssuerCredentialSubjectLocalesFrom, sdJwtCombineDisplayLocalesFrom, sdJwtCredentialClaimLocalesFrom, sdJwtCredentialDisplayLocalesFrom, sdJwtCredentialLocaleBrandingFrom, sdJwtGetCredentialBrandingFrom, selectCredentialLocaleBranding, sendAuthorizationChallengeRequest, sendAuthorizationResponse, signCallback, startFirstPartApplicationMachine, verifyCredentialToAccept };
796
+ export { type AccessTokenOpts, type AddContactIdentityArgs, type AssertValidCredentialsArgs, type Attribute, type AuthorizationResponseEvent, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateContactEvent, type CreateCredentialsToSelectFromArgs, type CreateFirstPartyMachineOpts, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOID4VCIMachineOpts, type CredentialToAccept, type CredentialToSelectFromResult, type CredentialVerificationError, type DeclineEvent, type DefaultIssuanceOpts, type DidAgents, type DynamicRegistrationClientMetadataDisplay, type ErrorDetails, type FirstPartyDeclineEvent, type FirstPartyMachineContext, type FirstPartyMachineEventTypes, FirstPartyMachineEvents, type FirstPartyMachineInterpreter, type FirstPartyMachineNavigationArgs, type FirstPartyMachineServiceDefinitions, FirstPartyMachineServices, type FirstPartyMachineState, type FirstPartyMachineStateNavigationListener, FirstPartyMachineStateTypes, type FirstPartyMachineStates, type FirstPartyMachineStatesConfig, type FirstPartyNextEvent, type FirstPartyPreviousEvent, type FirstPartySelectCredentialsEvent, type FirstPartyStateMachine, type GetAuthenticationKeyArgs, type GetBasicIssuerLocaleBrandingArgs, type GetContactArgs, type GetCredentialArgs, type GetCredentialBrandingArgs, type GetCredentialConfigsSupportedArgs, type GetCredentialConfigsSupportedBySingleTypeOrIdArgs, type GetCredentialsArgs, type GetDefaultIssuanceOptsArgs, type GetFederationTrustArgs, type GetIdentifierArgs, type GetIssuanceCryptoSuiteArgs, type GetIssuanceDidMethodArgs, type GetIssuanceOptsArgs, type GetIssuerBrandingArgs, type GetIssuerMetadataArgs, type GetMachineArgs, type GetOrCreatePrimaryIdentifierArgs, type GetPreferredCredentialFormatsArgs, type GetSiopRequestArgs, type IOID4VCIHolder, IdentifierAliasEnum, type InstanceFirstPartyMachineOpts, type InvokeAuthorizationRequestEvent, type IssuanceOpts, type IssuerLocaleBrandingFromArgs, type IssuerType, type MapCredentialToAcceptArgs, type MappedCredentialToAccept, type NextEvent, OID4VCICallbackStateListener, type OID4VCIContext, OID4VCIHolder, OID4VCIHolderEvent, OID4VCIHolderLinkHandler, type OID4VCIHolderOptions, type OID4VCIMachine, OID4VCIMachineAddContactStates, type OID4VCIMachineContext, type OID4VCIMachineEventTypes, OID4VCIMachineEvents, OID4VCIMachineGuards, type OID4VCIMachineInstanceOpts, type OID4VCIMachineInterpreter, type OID4VCIMachineNavigationArgs, type OID4VCIMachineServiceDefinitions, OID4VCIMachineServices, type OID4VCIMachineState, type OID4VCIMachineStateNavigationListener, OID4VCIMachineStates, OID4VCIMachineVerifyPinStates, type OID4VCIProviderProps, type OID4VCIStateMachine, type Oid4vciCombineDisplayLocalesFromArgs, type Oid4vciCredentialDisplayLocalesFromArgs, type Oid4vciCredentialLocaleBrandingFromArgs, type Oid4vciGetCredentialBrandingFromArgs, type Oid4vciIssuerCredentialSubjectLocalesFromArgs, type OnContactIdentityCreatedArgs, type OnCredentialStoredArgs, type OnIdentifierCreatedArgs, type PrepareAuthorizationRequestArgs, type PrepareAuthorizationResult, type PrepareStartArgs, type PreviousEvent, type RequestData, RequestType, type RequiredContext, type SdJwtCombineDisplayLocalesFromArgs, type SdJwtCredentialClaimLocalesFromArgs, type SdJwtCredentialDisplayLocalesFromArgs, type SdJwtCredentialLocaleBrandingFromArgs, type SdJwtGetCredentialBrandingFromArgs, type SelectAppLocaleBrandingArgs, type SelectCredentialsEvent, type SendAuthorizationChallengeRequestArgs, type SendAuthorizationResponseArgs, type SendNotificationArgs, type SetAuthorizationCodeURLEvent, type SiopV2AuthorizationRequestData, type StartFirstPartApplicationMachine, type StartResult, type StoreCredentialBrandingArgs, type StoreCredentialsArgs, type StoreIssuerBrandingArgs, SupportedLanguage, type VerificationCodeEvent, type VerificationResult, type VerificationSubResult, type VerifyCredentialArgs, type VerifyCredentialToAcceptArgs, type VerifyEBSICredentialIssuerArgs, type VerifyEBSICredentialIssuerResult, type VerifyMdocArgs, type VerifySDJWTCredentialArgs, createConfig, extractCredentialFromResponse, getBasicIssuerLocaleBranding, getCredentialBranding, getCredentialConfigsBasedOnFormatPref, getCredentialConfigsSupported, getCredentialConfigsSupportedBySingleTypeOrId, getCredentialConfigsSupportedMerged, getIdentifierOpts, getIssuanceCryptoSuite, getIssuanceMethod, getIssuanceOpts, getSiopRequest, issuerLocaleBrandingFrom, mapCredentialToAccept, oid4vciCombineDisplayLocalesFrom, oid4vciCredentialDisplayLocalesFrom, oid4vciCredentialLocaleBrandingFrom, oid4vciGetCredentialBrandingFrom, oid4vciHolderContextMethods, oid4vciIssuerCredentialSubjectLocalesFrom, sdJwtCombineDisplayLocalesFrom, sdJwtCredentialClaimLocalesFrom, sdJwtCredentialDisplayLocalesFrom, sdJwtCredentialLocaleBrandingFrom, sdJwtGetCredentialBrandingFrom, selectCredentialLocaleBranding, sendAuthorizationChallengeRequest, sendAuthorizationResponse, signCallback, startFirstPartApplicationMachine, verifyCredentialToAccept };
package/dist/index.d.ts CHANGED
@@ -129,6 +129,7 @@ interface IOID4VCIHolder extends IPluginMethodMap {
129
129
  oid4vciHolderGetMachineInterpreter(args: GetMachineArgs, context: RequiredContext): Promise<OID4VCIMachine>;
130
130
  oid4vciHolderStart(args: PrepareStartArgs, context: RequiredContext): Promise<StartResult>;
131
131
  oid4vciHolderCreateCredentialsToSelectFrom(args: CreateCredentialsToSelectFromArgs, context: RequiredContext): Promise<Array<CredentialToSelectFromResult>>;
132
+ oid4vciHolderPrepareAuthorizationRequest(args: PrepareAuthorizationRequestArgs, context: RequiredContext): Promise<PrepareAuthorizationResult>;
132
133
  oid4vciHolderGetContact(args: GetContactArgs, context: RequiredContext): Promise<Party | undefined>;
133
134
  oid4vciHolderGetCredentials(args: GetCredentialsArgs, context: RequiredContext): Promise<Array<MappedCredentialToAccept>>;
134
135
  oid4vciHolderGetCredential(args: GetCredentialArgs, context: RequiredContext): Promise<MappedCredentialToAccept>;
@@ -177,6 +178,7 @@ type GetMachineArgs = {
177
178
  firstPartyStateNavigationListener?: FirstPartyMachineStateNavigationListener;
178
179
  };
179
180
  type PrepareStartArgs = Pick<OID4VCIMachineContext, 'requestData' | 'authorizationRequestOpts' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
181
+ type PrepareAuthorizationRequestArgs = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'>;
180
182
  type CreateCredentialsToSelectFromArgs = Pick<OID4VCIMachineContext, 'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'>;
181
183
  type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>;
182
184
  type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
@@ -266,6 +268,7 @@ declare enum OID4VCIMachineStates {
266
268
  selectCredentials = "selectCredentials",
267
269
  transitionFromSelectingCredentials = "transitionFromSelectingCredentials",
268
270
  verifyPin = "verifyPin",
271
+ prepareAuthorizationRequest = "prepareAuthorizationRequest",
269
272
  initiateAuthorizationRequest = "initiateAuthorizationRequest",
270
273
  waitForAuthorizationResponse = "waitForAuthorizationResponse",
271
274
  getCredentials = "getCredentials",
@@ -373,6 +376,7 @@ declare enum OID4VCIMachineServices {
373
376
  getFederationTrust = "getFederationTrust",
374
377
  addContactIdentity = "addContactIdentity",
375
378
  createCredentialsToSelectFrom = "createCredentialsToSelectFrom",
379
+ prepareAuthorizationRequest = "prepareAuthorizationRequest",
376
380
  getIssuerBranding = "getIssuerBranding",
377
381
  storeIssuerBranding = "storeIssuerBranding",
378
382
  getCredentials = "getCredentials",
@@ -448,12 +452,14 @@ type OID4VCIMachine = {
448
452
  interpreter: OID4VCIMachineInterpreter;
449
453
  };
450
454
  type StartResult = {
451
- authorizationCodeURL?: string;
452
455
  credentialBranding?: Record<string, Array<IBasicCredentialLocaleBranding>>;
453
456
  credentialsSupported: Record<string, CredentialConfigurationSupported>;
454
457
  serverMetadata: EndpointMetadataResult;
455
458
  oid4vciClientState: OpenID4VCIClientState;
456
459
  };
460
+ type PrepareAuthorizationResult = {
461
+ authorizationCodeURL?: string;
462
+ };
457
463
  type SelectAppLocaleBrandingArgs = {
458
464
  locale?: string;
459
465
  localeBranding?: Array<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding>;
@@ -699,6 +705,7 @@ declare class OID4VCIHolder implements IAgentPlugin {
699
705
  * @private
700
706
  */
701
707
  private oid4vciHolderStart;
708
+ private oid4vciHolderPrepareAuthorizationRequest;
702
709
  private oid4vciHolderCreateCredentialsToSelectFrom;
703
710
  private oid4vciHolderGetContact;
704
711
  private oid4vciHolderGetCredentials;
@@ -786,4 +793,4 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
786
793
  }): Promise<void>;
787
794
  }
788
795
 
789
- export { type AccessTokenOpts, type AddContactIdentityArgs, type AssertValidCredentialsArgs, type Attribute, type AuthorizationResponseEvent, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateContactEvent, type CreateCredentialsToSelectFromArgs, type CreateFirstPartyMachineOpts, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOID4VCIMachineOpts, type CredentialToAccept, type CredentialToSelectFromResult, type CredentialVerificationError, type DeclineEvent, type DefaultIssuanceOpts, type DidAgents, type DynamicRegistrationClientMetadataDisplay, type ErrorDetails, type FirstPartyDeclineEvent, type FirstPartyMachineContext, type FirstPartyMachineEventTypes, FirstPartyMachineEvents, type FirstPartyMachineInterpreter, type FirstPartyMachineNavigationArgs, type FirstPartyMachineServiceDefinitions, FirstPartyMachineServices, type FirstPartyMachineState, type FirstPartyMachineStateNavigationListener, FirstPartyMachineStateTypes, type FirstPartyMachineStates, type FirstPartyMachineStatesConfig, type FirstPartyNextEvent, type FirstPartyPreviousEvent, type FirstPartySelectCredentialsEvent, type FirstPartyStateMachine, type GetAuthenticationKeyArgs, type GetBasicIssuerLocaleBrandingArgs, type GetContactArgs, type GetCredentialArgs, type GetCredentialBrandingArgs, type GetCredentialConfigsSupportedArgs, type GetCredentialConfigsSupportedBySingleTypeOrIdArgs, type GetCredentialsArgs, type GetDefaultIssuanceOptsArgs, type GetFederationTrustArgs, type GetIdentifierArgs, type GetIssuanceCryptoSuiteArgs, type GetIssuanceDidMethodArgs, type GetIssuanceOptsArgs, type GetIssuerBrandingArgs, type GetIssuerMetadataArgs, type GetMachineArgs, type GetOrCreatePrimaryIdentifierArgs, type GetPreferredCredentialFormatsArgs, type GetSiopRequestArgs, type IOID4VCIHolder, IdentifierAliasEnum, type InstanceFirstPartyMachineOpts, type InvokeAuthorizationRequestEvent, type IssuanceOpts, type IssuerLocaleBrandingFromArgs, type IssuerType, type MapCredentialToAcceptArgs, type MappedCredentialToAccept, type NextEvent, OID4VCICallbackStateListener, type OID4VCIContext, OID4VCIHolder, OID4VCIHolderEvent, OID4VCIHolderLinkHandler, type OID4VCIHolderOptions, type OID4VCIMachine, OID4VCIMachineAddContactStates, type OID4VCIMachineContext, type OID4VCIMachineEventTypes, OID4VCIMachineEvents, OID4VCIMachineGuards, type OID4VCIMachineInstanceOpts, type OID4VCIMachineInterpreter, type OID4VCIMachineNavigationArgs, type OID4VCIMachineServiceDefinitions, OID4VCIMachineServices, type OID4VCIMachineState, type OID4VCIMachineStateNavigationListener, OID4VCIMachineStates, OID4VCIMachineVerifyPinStates, type OID4VCIProviderProps, type OID4VCIStateMachine, type Oid4vciCombineDisplayLocalesFromArgs, type Oid4vciCredentialDisplayLocalesFromArgs, type Oid4vciCredentialLocaleBrandingFromArgs, type Oid4vciGetCredentialBrandingFromArgs, type Oid4vciIssuerCredentialSubjectLocalesFromArgs, type OnContactIdentityCreatedArgs, type OnCredentialStoredArgs, type OnIdentifierCreatedArgs, type PrepareStartArgs, type PreviousEvent, type RequestData, RequestType, type RequiredContext, type SdJwtCombineDisplayLocalesFromArgs, type SdJwtCredentialClaimLocalesFromArgs, type SdJwtCredentialDisplayLocalesFromArgs, type SdJwtCredentialLocaleBrandingFromArgs, type SdJwtGetCredentialBrandingFromArgs, type SelectAppLocaleBrandingArgs, type SelectCredentialsEvent, type SendAuthorizationChallengeRequestArgs, type SendAuthorizationResponseArgs, type SendNotificationArgs, type SetAuthorizationCodeURLEvent, type SiopV2AuthorizationRequestData, type StartFirstPartApplicationMachine, type StartResult, type StoreCredentialBrandingArgs, type StoreCredentialsArgs, type StoreIssuerBrandingArgs, SupportedLanguage, type VerificationCodeEvent, type VerificationResult, type VerificationSubResult, type VerifyCredentialArgs, type VerifyCredentialToAcceptArgs, type VerifyEBSICredentialIssuerArgs, type VerifyEBSICredentialIssuerResult, type VerifyMdocArgs, type VerifySDJWTCredentialArgs, createConfig, extractCredentialFromResponse, getBasicIssuerLocaleBranding, getCredentialBranding, getCredentialConfigsBasedOnFormatPref, getCredentialConfigsSupported, getCredentialConfigsSupportedBySingleTypeOrId, getCredentialConfigsSupportedMerged, getIdentifierOpts, getIssuanceCryptoSuite, getIssuanceMethod, getIssuanceOpts, getSiopRequest, issuerLocaleBrandingFrom, mapCredentialToAccept, oid4vciCombineDisplayLocalesFrom, oid4vciCredentialDisplayLocalesFrom, oid4vciCredentialLocaleBrandingFrom, oid4vciGetCredentialBrandingFrom, oid4vciHolderContextMethods, oid4vciIssuerCredentialSubjectLocalesFrom, sdJwtCombineDisplayLocalesFrom, sdJwtCredentialClaimLocalesFrom, sdJwtCredentialDisplayLocalesFrom, sdJwtCredentialLocaleBrandingFrom, sdJwtGetCredentialBrandingFrom, selectCredentialLocaleBranding, sendAuthorizationChallengeRequest, sendAuthorizationResponse, signCallback, startFirstPartApplicationMachine, verifyCredentialToAccept };
796
+ export { type AccessTokenOpts, type AddContactIdentityArgs, type AssertValidCredentialsArgs, type Attribute, type AuthorizationResponseEvent, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateContactEvent, type CreateCredentialsToSelectFromArgs, type CreateFirstPartyMachineOpts, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOID4VCIMachineOpts, type CredentialToAccept, type CredentialToSelectFromResult, type CredentialVerificationError, type DeclineEvent, type DefaultIssuanceOpts, type DidAgents, type DynamicRegistrationClientMetadataDisplay, type ErrorDetails, type FirstPartyDeclineEvent, type FirstPartyMachineContext, type FirstPartyMachineEventTypes, FirstPartyMachineEvents, type FirstPartyMachineInterpreter, type FirstPartyMachineNavigationArgs, type FirstPartyMachineServiceDefinitions, FirstPartyMachineServices, type FirstPartyMachineState, type FirstPartyMachineStateNavigationListener, FirstPartyMachineStateTypes, type FirstPartyMachineStates, type FirstPartyMachineStatesConfig, type FirstPartyNextEvent, type FirstPartyPreviousEvent, type FirstPartySelectCredentialsEvent, type FirstPartyStateMachine, type GetAuthenticationKeyArgs, type GetBasicIssuerLocaleBrandingArgs, type GetContactArgs, type GetCredentialArgs, type GetCredentialBrandingArgs, type GetCredentialConfigsSupportedArgs, type GetCredentialConfigsSupportedBySingleTypeOrIdArgs, type GetCredentialsArgs, type GetDefaultIssuanceOptsArgs, type GetFederationTrustArgs, type GetIdentifierArgs, type GetIssuanceCryptoSuiteArgs, type GetIssuanceDidMethodArgs, type GetIssuanceOptsArgs, type GetIssuerBrandingArgs, type GetIssuerMetadataArgs, type GetMachineArgs, type GetOrCreatePrimaryIdentifierArgs, type GetPreferredCredentialFormatsArgs, type GetSiopRequestArgs, type IOID4VCIHolder, IdentifierAliasEnum, type InstanceFirstPartyMachineOpts, type InvokeAuthorizationRequestEvent, type IssuanceOpts, type IssuerLocaleBrandingFromArgs, type IssuerType, type MapCredentialToAcceptArgs, type MappedCredentialToAccept, type NextEvent, OID4VCICallbackStateListener, type OID4VCIContext, OID4VCIHolder, OID4VCIHolderEvent, OID4VCIHolderLinkHandler, type OID4VCIHolderOptions, type OID4VCIMachine, OID4VCIMachineAddContactStates, type OID4VCIMachineContext, type OID4VCIMachineEventTypes, OID4VCIMachineEvents, OID4VCIMachineGuards, type OID4VCIMachineInstanceOpts, type OID4VCIMachineInterpreter, type OID4VCIMachineNavigationArgs, type OID4VCIMachineServiceDefinitions, OID4VCIMachineServices, type OID4VCIMachineState, type OID4VCIMachineStateNavigationListener, OID4VCIMachineStates, OID4VCIMachineVerifyPinStates, type OID4VCIProviderProps, type OID4VCIStateMachine, type Oid4vciCombineDisplayLocalesFromArgs, type Oid4vciCredentialDisplayLocalesFromArgs, type Oid4vciCredentialLocaleBrandingFromArgs, type Oid4vciGetCredentialBrandingFromArgs, type Oid4vciIssuerCredentialSubjectLocalesFromArgs, type OnContactIdentityCreatedArgs, type OnCredentialStoredArgs, type OnIdentifierCreatedArgs, type PrepareAuthorizationRequestArgs, type PrepareAuthorizationResult, type PrepareStartArgs, type PreviousEvent, type RequestData, RequestType, type RequiredContext, type SdJwtCombineDisplayLocalesFromArgs, type SdJwtCredentialClaimLocalesFromArgs, type SdJwtCredentialDisplayLocalesFromArgs, type SdJwtCredentialLocaleBrandingFromArgs, type SdJwtGetCredentialBrandingFromArgs, type SelectAppLocaleBrandingArgs, type SelectCredentialsEvent, type SendAuthorizationChallengeRequestArgs, type SendAuthorizationResponseArgs, type SendNotificationArgs, type SetAuthorizationCodeURLEvent, type SiopV2AuthorizationRequestData, type StartFirstPartApplicationMachine, type StartResult, type StoreCredentialBrandingArgs, type StoreCredentialsArgs, type StoreIssuerBrandingArgs, SupportedLanguage, type VerificationCodeEvent, type VerificationResult, type VerificationSubResult, type VerifyCredentialArgs, type VerifyCredentialToAcceptArgs, type VerifyEBSICredentialIssuerArgs, type VerifyEBSICredentialIssuerResult, type VerifyMdocArgs, type VerifySDJWTCredentialArgs, createConfig, extractCredentialFromResponse, getBasicIssuerLocaleBranding, getCredentialBranding, getCredentialConfigsBasedOnFormatPref, getCredentialConfigsSupported, getCredentialConfigsSupportedBySingleTypeOrId, getCredentialConfigsSupportedMerged, getIdentifierOpts, getIssuanceCryptoSuite, getIssuanceMethod, getIssuanceOpts, getSiopRequest, issuerLocaleBrandingFrom, mapCredentialToAccept, oid4vciCombineDisplayLocalesFrom, oid4vciCredentialDisplayLocalesFrom, oid4vciCredentialLocaleBrandingFrom, oid4vciGetCredentialBrandingFrom, oid4vciHolderContextMethods, oid4vciIssuerCredentialSubjectLocalesFrom, sdJwtCombineDisplayLocalesFrom, sdJwtCredentialClaimLocalesFrom, sdJwtCredentialDisplayLocalesFrom, sdJwtCredentialLocaleBrandingFrom, sdJwtGetCredentialBrandingFrom, selectCredentialLocaleBranding, sendAuthorizationChallengeRequest, sendAuthorizationResponse, signCallback, startFirstPartApplicationMachine, verifyCredentialToAccept };
package/dist/index.js CHANGED
@@ -61,8 +61,7 @@ import { SupportedDidMethodEnum as SupportedDidMethodEnum2 } from "@sphereon/ssi
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 { ensureRawDocument } from "@sphereon/ssi-sdk.data-store-types";
65
- import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, IdentityOrigin } from "@sphereon/ssi-sdk.data-store-types";
64
+ import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, ensureRawDocument, IdentityOrigin } from "@sphereon/ssi-sdk.data-store-types";
66
65
  import { CredentialMapper as CredentialMapper2, CredentialRole, JoseSignatureAlgorithm as JoseSignatureAlgorithm2, Loggers, parseDid } from "@sphereon/ssi-types";
67
66
  import { asArray as asArray2, computeEntryHash } from "@veramo/utils";
68
67
  import fetch from "cross-fetch";
@@ -105,6 +104,7 @@ var OID4VCIMachineStates = /* @__PURE__ */ (function(OID4VCIMachineStates2) {
105
104
  OID4VCIMachineStates2["selectCredentials"] = "selectCredentials";
106
105
  OID4VCIMachineStates2["transitionFromSelectingCredentials"] = "transitionFromSelectingCredentials";
107
106
  OID4VCIMachineStates2["verifyPin"] = "verifyPin";
107
+ OID4VCIMachineStates2["prepareAuthorizationRequest"] = "prepareAuthorizationRequest";
108
108
  OID4VCIMachineStates2["initiateAuthorizationRequest"] = "initiateAuthorizationRequest";
109
109
  OID4VCIMachineStates2["waitForAuthorizationResponse"] = "waitForAuthorizationResponse";
110
110
  OID4VCIMachineStates2["getCredentials"] = "getCredentials";
@@ -169,6 +169,7 @@ var OID4VCIMachineServices = /* @__PURE__ */ (function(OID4VCIMachineServices2)
169
169
  OID4VCIMachineServices2["getFederationTrust"] = "getFederationTrust";
170
170
  OID4VCIMachineServices2["addContactIdentity"] = "addContactIdentity";
171
171
  OID4VCIMachineServices2["createCredentialsToSelectFrom"] = "createCredentialsToSelectFrom";
172
+ OID4VCIMachineServices2["prepareAuthorizationRequest"] = "prepareAuthorizationRequest";
172
173
  OID4VCIMachineServices2["getIssuerBranding"] = "getIssuerBranding";
173
174
  OID4VCIMachineServices2["storeIssuerBranding"] = "storeIssuerBranding";
174
175
  OID4VCIMachineServices2["getCredentials"] = "getCredentials";
@@ -310,9 +311,7 @@ var oid4vciRequireAuthorizationGuard = /* @__PURE__ */ __name((ctx, _event) => {
310
311
  if (!openID4VCIClientState) {
311
312
  throw Error("Missing openID4VCI client state in context");
312
313
  }
313
- if (!openID4VCIClientState.authorizationURL) {
314
- return false;
315
- } else if (openID4VCIClientState.authorizationRequestOpts) {
314
+ if (openID4VCIClientState.authorizationRequestOpts) {
316
315
  return !ctx.openID4VCIClientState?.authorizationCodeResponse;
317
316
  } else if (openID4VCIClientState.credentialOffer?.supportedFlows?.includes(AuthzFlowType.AUTHORIZATION_CODE_FLOW)) {
318
317
  return !ctx.openID4VCIClientState?.authorizationCodeResponse;
@@ -363,7 +362,6 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
363
362
  onDone: {
364
363
  target: OID4VCIMachineStates.createCredentialsToSelectFrom,
365
364
  actions: assign({
366
- authorizationCodeURL: /* @__PURE__ */ __name((_ctx, _event) => _event.data.authorizationCodeURL, "authorizationCodeURL"),
367
365
  credentialBranding: /* @__PURE__ */ __name((_ctx, _event) => _event.data.credentialBranding ?? {}, "credentialBranding"),
368
366
  credentialsSupported: /* @__PURE__ */ __name((_ctx, _event) => _event.data.credentialsSupported, "credentialsSupported"),
369
367
  serverMetadata: /* @__PURE__ */ __name((_ctx, _event) => _event.data.serverMetadata, "serverMetadata"),
@@ -680,7 +678,7 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
680
678
  cond: OID4VCIMachineGuards.requirePinGuard
681
679
  },
682
680
  {
683
- target: OID4VCIMachineStates.initiateAuthorizationRequest,
681
+ target: OID4VCIMachineStates.prepareAuthorizationRequest,
684
682
  cond: OID4VCIMachineGuards.requireAuthorizationGuard
685
683
  },
686
684
  {
@@ -688,6 +686,28 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
688
686
  }
689
687
  ]
690
688
  },
689
+ [OID4VCIMachineStates.prepareAuthorizationRequest]: {
690
+ id: OID4VCIMachineStates.prepareAuthorizationRequest,
691
+ invoke: {
692
+ src: OID4VCIMachineServices.prepareAuthorizationRequest,
693
+ onDone: {
694
+ target: OID4VCIMachineStates.initiateAuthorizationRequest,
695
+ actions: assign({
696
+ authorizationCodeURL: /* @__PURE__ */ __name((_ctx, _event) => _event.data.authorizationCodeURL, "authorizationCodeURL")
697
+ })
698
+ },
699
+ onError: {
700
+ target: OID4VCIMachineStates.handleError,
701
+ actions: assign({
702
+ error: /* @__PURE__ */ __name((_ctx, _event) => ({
703
+ title: translate("oid4vci_machine_prepare_authorization_error_title"),
704
+ message: _event.data.message,
705
+ stack: _event.data.stack
706
+ }), "error")
707
+ })
708
+ }
709
+ }
710
+ },
691
711
  [OID4VCIMachineStates.initiateAuthorizationRequest]: {
692
712
  id: OID4VCIMachineStates.initiateAuthorizationRequest,
693
713
  on: {
@@ -2123,6 +2143,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2123
2143
  oid4vciHolderStart: this.oid4vciHolderStart.bind(this),
2124
2144
  oid4vciHolderGetIssuerMetadata: this.oid4vciHolderGetIssuerMetadata.bind(this),
2125
2145
  oid4vciHolderGetMachineInterpreter: this.oid4vciHolderGetMachineInterpreter.bind(this),
2146
+ oid4vciHolderPrepareAuthorizationRequest: this.oid4vciHolderPrepareAuthorizationRequest.bind(this),
2126
2147
  oid4vciHolderCreateCredentialsToSelectFrom: this.oid4vciHolderCreateCredentialsToSelectFrom.bind(this),
2127
2148
  oid4vciHolderGetContact: this.oid4vciHolderGetContact.bind(this),
2128
2149
  oid4vciHolderGetCredentials: this.oid4vciHolderGetCredentials.bind(this),
@@ -2227,6 +2248,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2227
2248
  stateNavigationListener: opts.firstPartyStateNavigationListener
2228
2249
  }, context),
2229
2250
  [OID4VCIMachineServices.createCredentialsToSelectFrom]: (args) => this.oid4vciHolderCreateCredentialsToSelectFrom(args, context),
2251
+ [OID4VCIMachineServices.prepareAuthorizationRequest]: (args) => this.oid4vciHolderPrepareAuthorizationRequest(args, context),
2230
2252
  [OID4VCIMachineServices.getContact]: (args) => this.oid4vciHolderGetContact(args, context),
2231
2253
  [OID4VCIMachineServices.getCredentials]: (args) => this.oid4vciHolderGetCredentials({
2232
2254
  accessTokenOpts: args.accessTokenOpts ?? opts.accessTokenOpts,
@@ -2311,7 +2333,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2311
2333
  credentialIssuer: uri,
2312
2334
  authorizationRequest: authorizationRequestOpts,
2313
2335
  clientId: authorizationRequestOpts.clientId,
2314
- createAuthorizationRequestURL: requestData.createAuthorizationRequestURL ?? true
2336
+ createAuthorizationRequestURL: false
2315
2337
  });
2316
2338
  } else {
2317
2339
  logger.log(`Credential offer received: ${uri}`);
@@ -2319,7 +2341,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2319
2341
  uri,
2320
2342
  authorizationRequest: authorizationRequestOpts,
2321
2343
  clientId: authorizationRequestOpts.clientId,
2322
- createAuthorizationRequestURL: requestData.createAuthorizationRequestURL ?? true
2344
+ createAuthorizationRequestURL: false
2323
2345
  });
2324
2346
  }
2325
2347
  }
@@ -2339,19 +2361,44 @@ var OID4VCIHolder = class _OID4VCIHolder {
2339
2361
  credentialsSupported,
2340
2362
  context
2341
2363
  });
2342
- const authorizationCodeURL = oid4vciClient.authorizationURL;
2343
- if (authorizationCodeURL) {
2344
- logger.log(`authorization code URL ${authorizationCodeURL}`);
2345
- }
2346
2364
  const oid4vciClientState = JSON.parse(await oid4vciClient.exportState());
2347
2365
  return {
2348
- authorizationCodeURL,
2349
2366
  credentialBranding,
2350
2367
  credentialsSupported,
2351
2368
  serverMetadata,
2352
2369
  oid4vciClientState
2353
2370
  };
2354
2371
  }
2372
+ async oid4vciHolderPrepareAuthorizationRequest(args, context) {
2373
+ const { openID4VCIClientState, contact } = args;
2374
+ if (!openID4VCIClientState) {
2375
+ return Promise.reject(Error("Missing openID4VCI client state in context"));
2376
+ }
2377
+ const clientId = contact?.identities.map((identity) => {
2378
+ const connectionConfig = identity.connection?.config;
2379
+ if (connectionConfig && "clientId" in connectionConfig) {
2380
+ return connectionConfig.clientId;
2381
+ }
2382
+ return void 0;
2383
+ }).find((clientId2) => clientId2);
2384
+ if (!clientId) {
2385
+ return Promise.reject(Error(`Missing client id in contact's connectionConfig`));
2386
+ }
2387
+ const client = await OpenID4VCIClient2.fromState({
2388
+ state: openID4VCIClientState
2389
+ });
2390
+ const authorizationCodeURL = await client.createAuthorizationRequestUrl({
2391
+ authorizationRequest: {
2392
+ clientId
2393
+ }
2394
+ });
2395
+ if (authorizationCodeURL) {
2396
+ logger.log(`authorization code URL ${authorizationCodeURL}`);
2397
+ }
2398
+ return {
2399
+ authorizationCodeURL
2400
+ };
2401
+ }
2355
2402
  async oid4vciHolderCreateCredentialsToSelectFrom(args, context) {
2356
2403
  const { credentialBranding, locale, selectedCredentials, credentialsSupported } = args;
2357
2404
  logger.info(`Credentials supported ${Object.keys(credentialsSupported).join(", ")}`);