@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.26.RP.58 → 0.34.1-feature.SSISDK.44.finish.dcql.310
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 +440 -402
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -14
- package/dist/index.d.ts +23 -14
- package/dist/index.js +440 -402
- package/dist/index.js.map +1 -1
- package/package.json +25 -24
- package/src/agent/OID4VCIHolder.ts +65 -42
- package/src/machines/firstPartyMachine.ts +1 -1
- package/src/machines/oid4vciMachine.ts +38 -6
- package/src/mappers/OIDC4VCIBrandingMapper.ts +1 -1
- package/src/services/OID4VCIHolderService.ts +43 -66
- package/src/types/FirstPartyMachine.ts +6 -5
- package/src/types/IOID4VCIHolder.ts +19 -12
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RPRegistrationMetadataPayload } from '@sphereon/did-auth-siop'
|
|
2
2
|
import { OpenID4VCIClientState } from '@sphereon/oid4vci-client'
|
|
3
|
-
import { DidAuthConfig, Party } from '@sphereon/ssi-sdk.data-store'
|
|
4
|
-
import { PresentationDefinitionWithLocation, RPRegistrationMetadataPayload } from '@sphereon/did-auth-siop'
|
|
5
|
-
import { UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
|
|
6
3
|
import { AuthorizationChallengeCodeResponse } from '@sphereon/oid4vci-common'
|
|
4
|
+
import { UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
|
|
5
|
+
import { DidAuthConfig, Party } from '@sphereon/ssi-sdk.data-store-types'
|
|
7
6
|
import { IIdentifier } from '@veramo/core'
|
|
7
|
+
import { DcqlQuery } from 'dcql'
|
|
8
|
+
import { BaseActionObject, Interpreter, ResolveTypegenMeta, ServiceMap, State, StateMachine, StatesConfig, TypegenDisabled } from 'xstate'
|
|
8
9
|
import { ErrorDetails, RequiredContext } from './IOID4VCIHolder'
|
|
9
10
|
|
|
10
11
|
export enum FirstPartyMachineStateTypes {
|
|
@@ -149,7 +150,7 @@ export type SiopV2AuthorizationRequestData = {
|
|
|
149
150
|
clientIdScheme?: string
|
|
150
151
|
clientId?: string
|
|
151
152
|
entityId?: string
|
|
152
|
-
|
|
153
|
+
dcqlQuery: DcqlQuery
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
export type FirstPartyMachineNavigationArgs = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common'
|
|
2
|
+
import { OpenID4VCIClientState, OpenID4VCIClientV1_0_15 } from '@sphereon/oid4vci-client'
|
|
2
3
|
import {
|
|
3
4
|
AuthorizationRequestOpts,
|
|
4
5
|
AuthorizationResponse,
|
|
@@ -15,7 +16,6 @@ import {
|
|
|
15
16
|
MetadataDisplay,
|
|
16
17
|
NotificationRequest,
|
|
17
18
|
} from '@sphereon/oid4vci-common'
|
|
18
|
-
import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common'
|
|
19
19
|
import { CreateOrGetIdentifierOpts, IdentifierProviderOpts, SupportedDidMethodEnum } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
20
20
|
import {
|
|
21
21
|
IIdentifierResolution,
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
27
27
|
import { IContactManager } from '@sphereon/ssi-sdk.contact-manager'
|
|
28
28
|
import { ICredentialStore } from '@sphereon/ssi-sdk.credential-store'
|
|
29
|
+
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation'
|
|
29
30
|
import {
|
|
30
31
|
DigitalCredential,
|
|
31
32
|
IBasicCredentialClaim,
|
|
@@ -34,11 +35,10 @@ import {
|
|
|
34
35
|
Identity,
|
|
35
36
|
IIssuerLocaleBranding,
|
|
36
37
|
Party,
|
|
37
|
-
} from '@sphereon/ssi-sdk.data-store'
|
|
38
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
38
39
|
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding'
|
|
39
40
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'
|
|
40
41
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
|
|
41
|
-
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation'
|
|
42
42
|
import { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth'
|
|
43
43
|
import {
|
|
44
44
|
HasherSync,
|
|
@@ -79,6 +79,7 @@ export interface IOID4VCIHolder extends IPluginMethodMap {
|
|
|
79
79
|
context: RequiredContext,
|
|
80
80
|
): Promise<Array<CredentialToSelectFromResult>>
|
|
81
81
|
|
|
82
|
+
oid4vciHolderPrepareAuthorizationRequest(args: PrepareAuthorizationRequestArgs, context: RequiredContext): Promise<PrepareAuthorizationResult>
|
|
82
83
|
oid4vciHolderGetContact(args: GetContactArgs, context: RequiredContext): Promise<Party | undefined>
|
|
83
84
|
|
|
84
85
|
oid4vciHolderGetCredentials(args: GetCredentialsArgs, context: RequiredContext): Promise<Array<MappedCredentialToAccept>>
|
|
@@ -148,6 +149,7 @@ export type PrepareStartArgs = Pick<
|
|
|
148
149
|
OID4VCIMachineContext,
|
|
149
150
|
'requestData' | 'authorizationRequestOpts' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'
|
|
150
151
|
>
|
|
152
|
+
export type PrepareAuthorizationRequestArgs = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'>
|
|
151
153
|
export type CreateCredentialsToSelectFromArgs = Pick<
|
|
152
154
|
OID4VCIMachineContext,
|
|
153
155
|
'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'
|
|
@@ -256,6 +258,7 @@ export enum OID4VCIMachineStates {
|
|
|
256
258
|
selectCredentials = 'selectCredentials',
|
|
257
259
|
transitionFromSelectingCredentials = 'transitionFromSelectingCredentials',
|
|
258
260
|
verifyPin = 'verifyPin',
|
|
261
|
+
prepareAuthorizationRequest = 'prepareAuthorizationRequest',
|
|
259
262
|
initiateAuthorizationRequest = 'initiateAuthorizationRequest',
|
|
260
263
|
waitForAuthorizationResponse = 'waitForAuthorizationResponse',
|
|
261
264
|
getCredentials = 'getCredentials',
|
|
@@ -395,6 +398,7 @@ export enum OID4VCIMachineServices {
|
|
|
395
398
|
getFederationTrust = 'getFederationTrust',
|
|
396
399
|
addContactIdentity = 'addContactIdentity',
|
|
397
400
|
createCredentialsToSelectFrom = 'createCredentialsToSelectFrom',
|
|
401
|
+
prepareAuthorizationRequest = 'prepareAuthorizationRequest',
|
|
398
402
|
getIssuerBranding = 'getIssuerBranding',
|
|
399
403
|
storeIssuerBranding = 'storeIssuerBranding',
|
|
400
404
|
getCredentials = 'getCredentials',
|
|
@@ -460,13 +464,16 @@ export type OID4VCIMachine = {
|
|
|
460
464
|
}
|
|
461
465
|
|
|
462
466
|
export type StartResult = {
|
|
463
|
-
authorizationCodeURL?: string
|
|
464
467
|
credentialBranding?: Record<string, Array<IBasicCredentialLocaleBranding>>
|
|
465
468
|
credentialsSupported: Record<string, CredentialConfigurationSupported>
|
|
466
469
|
serverMetadata: EndpointMetadataResult
|
|
467
470
|
oid4vciClientState: OpenID4VCIClientState
|
|
468
471
|
}
|
|
469
472
|
|
|
473
|
+
export type PrepareAuthorizationResult = {
|
|
474
|
+
authorizationCodeURL?: string
|
|
475
|
+
}
|
|
476
|
+
|
|
470
477
|
export type SelectAppLocaleBrandingArgs = {
|
|
471
478
|
locale?: string
|
|
472
479
|
localeBranding?: Array<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding>
|
|
@@ -507,7 +514,7 @@ export type CredentialToAccept = {
|
|
|
507
514
|
}
|
|
508
515
|
|
|
509
516
|
export type GetCredentialConfigsSupportedArgs = {
|
|
510
|
-
client:
|
|
517
|
+
client: OpenID4VCIClientV1_0_15
|
|
511
518
|
vcFormatPreferences: Array<string>
|
|
512
519
|
format?: Array<string>
|
|
513
520
|
types?: Array<Array<string>>
|
|
@@ -519,7 +526,7 @@ export type GetCredentialConfigsSupportedArgs = {
|
|
|
519
526
|
* It can potentially return multiple results mainly because of different formats.
|
|
520
527
|
*/
|
|
521
528
|
export type GetCredentialConfigsSupportedBySingleTypeOrIdArgs = {
|
|
522
|
-
client:
|
|
529
|
+
client: OpenID4VCIClientV1_0_15
|
|
523
530
|
vcFormatPreferences: Array<string>
|
|
524
531
|
format?: string[]
|
|
525
532
|
types?: string[]
|
|
@@ -554,7 +561,7 @@ export type GetDefaultIssuanceOptsArgs = {
|
|
|
554
561
|
}
|
|
555
562
|
|
|
556
563
|
export type DefaultIssuanceOpts = {
|
|
557
|
-
client:
|
|
564
|
+
client: OpenID4VCIClientV1_0_15
|
|
558
565
|
}
|
|
559
566
|
|
|
560
567
|
export type GetIdentifierArgs = {
|
|
@@ -591,7 +598,7 @@ export type CreateIdentifierCreateOpts = {
|
|
|
591
598
|
}
|
|
592
599
|
|
|
593
600
|
export type GetIssuanceOptsArgs = {
|
|
594
|
-
client:
|
|
601
|
+
client: OpenID4VCIClientV1_0_15
|
|
595
602
|
credentialsSupported: Record<string, CredentialConfigurationSupported>
|
|
596
603
|
serverMetadata: EndpointMetadataResult
|
|
597
604
|
context: RequiredContext
|
|
@@ -603,13 +610,13 @@ export type GetIssuanceOptsArgs = {
|
|
|
603
610
|
|
|
604
611
|
export type GetIssuanceDidMethodArgs = {
|
|
605
612
|
credentialSupported: CredentialConfigurationSupported
|
|
606
|
-
client:
|
|
613
|
+
client: OpenID4VCIClientV1_0_15
|
|
607
614
|
didMethodPreferences: Array<SupportedDidMethodEnum>
|
|
608
615
|
}
|
|
609
616
|
|
|
610
617
|
export type GetIssuanceCryptoSuiteArgs = {
|
|
611
618
|
credentialSupported: CredentialConfigurationSupported
|
|
612
|
-
client:
|
|
619
|
+
client: OpenID4VCIClientV1_0_15
|
|
613
620
|
jwtCryptographicSuitePreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>
|
|
614
621
|
jsonldCryptographicSuitePreferences: Array<string>
|
|
615
622
|
}
|
|
@@ -617,7 +624,7 @@ export type GetIssuanceCryptoSuiteArgs = {
|
|
|
617
624
|
export type GetCredentialArgs = {
|
|
618
625
|
pin?: string
|
|
619
626
|
issuanceOpt: IssuanceOpts
|
|
620
|
-
client:
|
|
627
|
+
client: OpenID4VCIClientV1_0_15
|
|
621
628
|
accessTokenOpts?: AccessTokenOpts
|
|
622
629
|
}
|
|
623
630
|
|