@sphereon/ssi-sdk.oid4vci-holder 0.36.1-feature.SSISDK.82.and.SSISDK.70.35 → 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 +13 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +13 -19
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +3 -13
- package/src/link-handler/index.ts +2 -5
- package/src/machines/oid4vciMachine.ts +9 -2
- package/src/services/OID4VCIHolderService.ts +1 -1
- package/src/types/IOID4VCIHolder.ts +1 -6
package/dist/index.d.cts
CHANGED
|
@@ -169,7 +169,6 @@ type OnIdentifierCreatedArgs = {
|
|
|
169
169
|
};
|
|
170
170
|
type GetMachineArgs = {
|
|
171
171
|
requestData: RequestData;
|
|
172
|
-
walletType: WalletType;
|
|
173
172
|
trustAnchors?: Array<string>;
|
|
174
173
|
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
175
174
|
clientOpts?: AuthorizationServerClientOpts;
|
|
@@ -182,7 +181,7 @@ type PrepareStartArgs = Pick<OID4VCIMachineContext, 'requestData' | 'authorizati
|
|
|
182
181
|
type PrepareAuthorizationRequestArgs = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'>;
|
|
183
182
|
type CreateCredentialsToSelectFromArgs = Pick<OID4VCIMachineContext, 'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'>;
|
|
184
183
|
type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>;
|
|
185
|
-
type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'
|
|
184
|
+
type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
|
|
186
185
|
type AddContactIdentityArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'contact'>;
|
|
187
186
|
type GetIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'serverMetadata' | 'contact'>;
|
|
188
187
|
type StoreIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'issuerBranding' | 'contact'>;
|
|
@@ -245,7 +244,6 @@ type OID4VCIMachineContext = {
|
|
|
245
244
|
openID4VCIClientState?: OpenID4VCIClientState;
|
|
246
245
|
credentialToSelectFrom: Array<CredentialToSelectFromResult>;
|
|
247
246
|
contactAlias: string;
|
|
248
|
-
walletType: WalletType;
|
|
249
247
|
contact?: Party;
|
|
250
248
|
selectedCredentials: Array<string>;
|
|
251
249
|
credentialsToAccept: Array<MappedCredentialToAccept>;
|
|
@@ -308,7 +306,6 @@ type OID4VCIStateMachine = StateMachine<OID4VCIMachineContext, any, OID4VCIMachi
|
|
|
308
306
|
}, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, OID4VCIMachineEventTypes, BaseActionObject, ServiceMap>>;
|
|
309
307
|
type CreateOID4VCIMachineOpts = {
|
|
310
308
|
requestData: RequestData;
|
|
311
|
-
walletType: WalletType;
|
|
312
309
|
machineName?: string;
|
|
313
310
|
locale?: string;
|
|
314
311
|
trustAnchors?: Array<string>;
|
|
@@ -672,7 +669,6 @@ type SdJwtCombineDisplayLocalesFromArgs = {
|
|
|
672
669
|
claimsMetadata?: Map<string, Array<IBasicCredentialClaim>>;
|
|
673
670
|
};
|
|
674
671
|
type DynamicRegistrationClientMetadataDisplay = Pick<DynamicRegistrationClientMetadata, 'client_name' | 'client_uri' | 'contacts' | 'tos_uri' | 'policy_uri' | 'logo_uri'>;
|
|
675
|
-
type WalletType = 'NATURAL_PERSON' | 'ORGANIZATIONAL';
|
|
676
672
|
type DidAgents = TAgent<IResolver & IDIDManager>;
|
|
677
673
|
type RequiredContext = IAgentContext<IIssuanceBranding & IContactManager & ICredentialValidation & ICredentialVerifier & ICredentialIssuer & ICredentialStore & IIdentifierResolution & IJwtService & IDIDManager & IResolver & IKeyManager & ISDJwtPlugin & ImDLMdoc & IDidAuthSiopOpAuthenticator>;
|
|
678
674
|
|
|
@@ -714,7 +710,6 @@ declare class OID4VCIHolder implements IAgentPlugin {
|
|
|
714
710
|
private oid4vciHolderCreateCredentialsToSelectFrom;
|
|
715
711
|
private oid4vciHolderGetContact;
|
|
716
712
|
private oid4vciHolderGetCredentials;
|
|
717
|
-
private selectDidMethodPreferences;
|
|
718
713
|
private oid4vciHolderGetCredential;
|
|
719
714
|
private oid4vciHolderAddContactIdentity;
|
|
720
715
|
private oid4vciHolderGetIssuerBranding;
|
|
@@ -781,11 +776,10 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
|
|
|
781
776
|
private readonly stateNavigationListener?;
|
|
782
777
|
private readonly firstPartyStateNavigationListener?;
|
|
783
778
|
private readonly noStateMachinePersistence;
|
|
784
|
-
private readonly walletType;
|
|
785
779
|
private readonly authorizationRequestOpts?;
|
|
786
780
|
private readonly clientOpts?;
|
|
787
781
|
private readonly trustAnchors?;
|
|
788
|
-
constructor(args: Pick<GetMachineArgs, 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'
|
|
782
|
+
constructor(args: Pick<GetMachineArgs, 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'> & {
|
|
789
783
|
priority?: number | DefaultLinkPriorities;
|
|
790
784
|
protocols?: Array<string | RegExp>;
|
|
791
785
|
noStateMachinePersistence?: boolean;
|
|
@@ -800,4 +794,4 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
|
|
|
800
794
|
}): Promise<void>;
|
|
801
795
|
}
|
|
802
796
|
|
|
803
|
-
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,
|
|
797
|
+
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
|
@@ -169,7 +169,6 @@ type OnIdentifierCreatedArgs = {
|
|
|
169
169
|
};
|
|
170
170
|
type GetMachineArgs = {
|
|
171
171
|
requestData: RequestData;
|
|
172
|
-
walletType: WalletType;
|
|
173
172
|
trustAnchors?: Array<string>;
|
|
174
173
|
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
175
174
|
clientOpts?: AuthorizationServerClientOpts;
|
|
@@ -182,7 +181,7 @@ type PrepareStartArgs = Pick<OID4VCIMachineContext, 'requestData' | 'authorizati
|
|
|
182
181
|
type PrepareAuthorizationRequestArgs = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'>;
|
|
183
182
|
type CreateCredentialsToSelectFromArgs = Pick<OID4VCIMachineContext, 'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'>;
|
|
184
183
|
type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>;
|
|
185
|
-
type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'
|
|
184
|
+
type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
|
|
186
185
|
type AddContactIdentityArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'contact'>;
|
|
187
186
|
type GetIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'serverMetadata' | 'contact'>;
|
|
188
187
|
type StoreIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'issuerBranding' | 'contact'>;
|
|
@@ -245,7 +244,6 @@ type OID4VCIMachineContext = {
|
|
|
245
244
|
openID4VCIClientState?: OpenID4VCIClientState;
|
|
246
245
|
credentialToSelectFrom: Array<CredentialToSelectFromResult>;
|
|
247
246
|
contactAlias: string;
|
|
248
|
-
walletType: WalletType;
|
|
249
247
|
contact?: Party;
|
|
250
248
|
selectedCredentials: Array<string>;
|
|
251
249
|
credentialsToAccept: Array<MappedCredentialToAccept>;
|
|
@@ -308,7 +306,6 @@ type OID4VCIStateMachine = StateMachine<OID4VCIMachineContext, any, OID4VCIMachi
|
|
|
308
306
|
}, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, OID4VCIMachineEventTypes, BaseActionObject, ServiceMap>>;
|
|
309
307
|
type CreateOID4VCIMachineOpts = {
|
|
310
308
|
requestData: RequestData;
|
|
311
|
-
walletType: WalletType;
|
|
312
309
|
machineName?: string;
|
|
313
310
|
locale?: string;
|
|
314
311
|
trustAnchors?: Array<string>;
|
|
@@ -672,7 +669,6 @@ type SdJwtCombineDisplayLocalesFromArgs = {
|
|
|
672
669
|
claimsMetadata?: Map<string, Array<IBasicCredentialClaim>>;
|
|
673
670
|
};
|
|
674
671
|
type DynamicRegistrationClientMetadataDisplay = Pick<DynamicRegistrationClientMetadata, 'client_name' | 'client_uri' | 'contacts' | 'tos_uri' | 'policy_uri' | 'logo_uri'>;
|
|
675
|
-
type WalletType = 'NATURAL_PERSON' | 'ORGANIZATIONAL';
|
|
676
672
|
type DidAgents = TAgent<IResolver & IDIDManager>;
|
|
677
673
|
type RequiredContext = IAgentContext<IIssuanceBranding & IContactManager & ICredentialValidation & ICredentialVerifier & ICredentialIssuer & ICredentialStore & IIdentifierResolution & IJwtService & IDIDManager & IResolver & IKeyManager & ISDJwtPlugin & ImDLMdoc & IDidAuthSiopOpAuthenticator>;
|
|
678
674
|
|
|
@@ -714,7 +710,6 @@ declare class OID4VCIHolder implements IAgentPlugin {
|
|
|
714
710
|
private oid4vciHolderCreateCredentialsToSelectFrom;
|
|
715
711
|
private oid4vciHolderGetContact;
|
|
716
712
|
private oid4vciHolderGetCredentials;
|
|
717
|
-
private selectDidMethodPreferences;
|
|
718
713
|
private oid4vciHolderGetCredential;
|
|
719
714
|
private oid4vciHolderAddContactIdentity;
|
|
720
715
|
private oid4vciHolderGetIssuerBranding;
|
|
@@ -781,11 +776,10 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
|
|
|
781
776
|
private readonly stateNavigationListener?;
|
|
782
777
|
private readonly firstPartyStateNavigationListener?;
|
|
783
778
|
private readonly noStateMachinePersistence;
|
|
784
|
-
private readonly walletType;
|
|
785
779
|
private readonly authorizationRequestOpts?;
|
|
786
780
|
private readonly clientOpts?;
|
|
787
781
|
private readonly trustAnchors?;
|
|
788
|
-
constructor(args: Pick<GetMachineArgs, 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'
|
|
782
|
+
constructor(args: Pick<GetMachineArgs, 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'> & {
|
|
789
783
|
priority?: number | DefaultLinkPriorities;
|
|
790
784
|
protocols?: Array<string | RegExp>;
|
|
791
785
|
noStateMachinePersistence?: boolean;
|
|
@@ -800,4 +794,4 @@ declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
|
|
|
800
794
|
}): Promise<void>;
|
|
801
795
|
}
|
|
802
796
|
|
|
803
|
-
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,
|
|
797
|
+
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
|
@@ -333,7 +333,6 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
333
333
|
// 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
|
|
334
334
|
accessTokenOpts: opts?.accessTokenOpts,
|
|
335
335
|
requestData: opts?.requestData,
|
|
336
|
-
walletType: opts?.walletType ?? "NATURAL_PERSON",
|
|
337
336
|
trustAnchors: opts?.trustAnchors ?? [],
|
|
338
337
|
issuanceOpt: opts?.issuanceOpt,
|
|
339
338
|
didMethodPreferences: opts?.didMethodPreferences,
|
|
@@ -498,7 +497,7 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
498
497
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
499
498
|
},
|
|
500
499
|
{
|
|
501
|
-
target: OID4VCIMachineStates.
|
|
500
|
+
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
502
501
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
503
502
|
},
|
|
504
503
|
{
|
|
@@ -603,6 +602,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
603
602
|
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
604
603
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
605
604
|
},
|
|
605
|
+
{
|
|
606
|
+
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
607
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
608
|
+
},
|
|
606
609
|
{
|
|
607
610
|
target: OID4VCIMachineStates.verifyPin,
|
|
608
611
|
cond: OID4VCIMachineGuards.requirePinGuard
|
|
@@ -682,6 +685,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
682
685
|
target: OID4VCIMachineStates.verifyPin,
|
|
683
686
|
cond: OID4VCIMachineGuards.requirePinGuard
|
|
684
687
|
},
|
|
688
|
+
{
|
|
689
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
690
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
691
|
+
},
|
|
685
692
|
{
|
|
686
693
|
target: OID4VCIMachineStates.getCredentials
|
|
687
694
|
}
|
|
@@ -2386,7 +2393,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2386
2393
|
if (!clientId) {
|
|
2387
2394
|
return Promise.reject(Error(`Missing client id in contact's connectionConfig`));
|
|
2388
2395
|
}
|
|
2389
|
-
const client = await
|
|
2396
|
+
const client = await OpenID4VCIClient2.fromState({
|
|
2390
2397
|
state: openID4VCIClientState
|
|
2391
2398
|
});
|
|
2392
2399
|
const authorizationCodeURL = await client.createAuthorizationRequestUrl({
|
|
@@ -2469,7 +2476,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2469
2476
|
return party;
|
|
2470
2477
|
}
|
|
2471
2478
|
async oid4vciHolderGetCredentials(args, context) {
|
|
2472
|
-
const { verificationCode, openID4VCIClientState, didMethodPreferences, issuanceOpt, accessTokenOpts
|
|
2479
|
+
const { verificationCode, openID4VCIClientState, didMethodPreferences = this.didMethodPreferences, issuanceOpt, accessTokenOpts } = args;
|
|
2473
2480
|
logger.debug(`Getting credentials`, issuanceOpt, accessTokenOpts);
|
|
2474
2481
|
if (!openID4VCIClientState) {
|
|
2475
2482
|
return Promise.reject(Error("Missing openID4VCI client state in context"));
|
|
@@ -2488,7 +2495,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2488
2495
|
credentialsSupported,
|
|
2489
2496
|
serverMetadata,
|
|
2490
2497
|
context,
|
|
2491
|
-
didMethodPreferences:
|
|
2498
|
+
didMethodPreferences: Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences,
|
|
2492
2499
|
jwtCryptographicSuitePreferences: this.jwtCryptographicSuitePreferences,
|
|
2493
2500
|
jsonldCryptographicSuitePreferences: this.jsonldCryptographicSuitePreferences,
|
|
2494
2501
|
...issuanceOpt && {
|
|
@@ -2505,16 +2512,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2505
2512
|
logger.log(`Credentials received`, allCredentials);
|
|
2506
2513
|
return allCredentials;
|
|
2507
2514
|
}
|
|
2508
|
-
selectDidMethodPreferences(didMethodPreferences, walletType) {
|
|
2509
|
-
const supportedDidMethodEnums = Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences;
|
|
2510
|
-
if (walletType === "ORGANIZATIONAL") {
|
|
2511
|
-
return [
|
|
2512
|
-
SupportedDidMethodEnum2.DID_WEB,
|
|
2513
|
-
...supportedDidMethodEnums
|
|
2514
|
-
];
|
|
2515
|
-
}
|
|
2516
|
-
return supportedDidMethodEnums;
|
|
2517
|
-
}
|
|
2518
2515
|
async oid4vciHolderGetCredential(args, context) {
|
|
2519
2516
|
const { issuanceOpt, pin, client, accessTokenOpts } = args;
|
|
2520
2517
|
logger.info(`Getting credential`, issuanceOpt);
|
|
@@ -3066,7 +3063,6 @@ var OID4VCIHolderLinkHandler = class extends LinkHandlerAdapter {
|
|
|
3066
3063
|
stateNavigationListener;
|
|
3067
3064
|
firstPartyStateNavigationListener;
|
|
3068
3065
|
noStateMachinePersistence;
|
|
3069
|
-
walletType;
|
|
3070
3066
|
authorizationRequestOpts;
|
|
3071
3067
|
clientOpts;
|
|
3072
3068
|
trustAnchors;
|
|
@@ -3078,7 +3074,6 @@ var OID4VCIHolderLinkHandler = class extends LinkHandlerAdapter {
|
|
|
3078
3074
|
this.authorizationRequestOpts = args.authorizationRequestOpts;
|
|
3079
3075
|
this.clientOpts = args.clientOpts;
|
|
3080
3076
|
this.context = args.context;
|
|
3081
|
-
this.walletType = args.walletType ?? "NATURAL_PERSON";
|
|
3082
3077
|
this.noStateMachinePersistence = args.noStateMachinePersistence === true;
|
|
3083
3078
|
this.stateNavigationListener = args.stateNavigationListener;
|
|
3084
3079
|
this.firstPartyStateNavigationListener = args.firstPartyStateNavigationListener;
|
|
@@ -3115,8 +3110,7 @@ var OID4VCIHolderLinkHandler = class extends LinkHandlerAdapter {
|
|
|
3115
3110
|
clientOpts
|
|
3116
3111
|
},
|
|
3117
3112
|
stateNavigationListener: this.stateNavigationListener,
|
|
3118
|
-
firstPartyStateNavigationListener: this.firstPartyStateNavigationListener
|
|
3119
|
-
walletType: this.walletType
|
|
3113
|
+
firstPartyStateNavigationListener: this.firstPartyStateNavigationListener
|
|
3120
3114
|
});
|
|
3121
3115
|
const interpreter = oid4vciMachine.interpreter;
|
|
3122
3116
|
if (!opts?.machineState && this.context.agent.availableMethods().includes("machineStatesFindActive")) {
|