@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.32.1-feature.VDX.341.56 → 0.32.1-feature.oid4vp.rest.api.improv.bootcamp.187

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.
@@ -1,5 +1,5 @@
1
1
  import {
2
- DcqlQueryResponseOpts,
2
+ DcqlResponseOpts,
3
3
  PresentationDefinitionWithLocation,
4
4
  PresentationSignCallback,
5
5
  ResponseMode,
@@ -123,8 +123,9 @@ export interface IOpsSendSiopAuthorizationResponseArgs {
123
123
  // verifiedAuthorizationRequest: VerifiedAuthorizationRequest
124
124
  presentationSubmission?: PresentationSubmission
125
125
  verifiablePresentations?: W3CVerifiablePresentation[]
126
- dcqlQuery?: DcqlQueryResponseOpts
126
+ dcqlResponse?: DcqlResponseOpts
127
127
  hasher?: Hasher
128
+ isFirstParty?: boolean
128
129
  }
129
130
 
130
131
  export enum events {
@@ -199,4 +200,15 @@ export interface IGetPresentationExchangeArgs {
199
200
  hasher?: Hasher
200
201
  }
201
202
 
203
+ // It was added here because it's not exported from DCQL anymore
204
+ export type Json =
205
+ | string
206
+ | number
207
+ | boolean
208
+ | null
209
+ | {
210
+ [key: string]: Json
211
+ }
212
+ | Json[]
213
+
202
214
  export const DEFAULT_JWT_PROOF_TYPE = 'JwtProof2020'
@@ -18,6 +18,7 @@ export type Siopv2MachineContext = {
18
18
  contactAlias: string
19
19
  selectableCredentialsMap?: SelectableCredentialsMap
20
20
  selectedCredentials: Array<UniqueDigitalCredential>
21
+ isFirstParty?: boolean
21
22
  error?: ErrorDetails
22
23
  }
23
24
 
@@ -1,4 +1,8 @@
1
- import { PresentationDefinitionWithLocation, RPRegistrationMetadataPayload } from '@sphereon/did-auth-siop'
1
+ import {
2
+ PresentationDefinitionWithLocation,
3
+ PresentationSignCallback,
4
+ RPRegistrationMetadataPayload, VerifiedAuthorizationRequest
5
+ } from '@sphereon/did-auth-siop'
2
6
  import { IIdentifierResolution, ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
3
7
  import { IContactManager } from '@sphereon/ssi-sdk.contact-manager'
4
8
  import { ICredentialStore, UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
@@ -8,10 +12,14 @@ import { IAgentContext, IDIDManager, IIdentifier, IResolver } from '@veramo/core
8
12
  import { IDidAuthSiopOpAuthenticator } from '../IDidAuthSiopOpAuthenticator'
9
13
  import { Siopv2MachineContext, Siopv2MachineInterpreter, Siopv2MachineState } from '../machine'
10
14
  import { DcqlQuery } from 'dcql'
15
+ import { Hasher } from '@sphereon/ssi-types'
11
16
 
12
17
  export type DidAuthSiopOpAuthenticatorOptions = {
18
+ presentationSignCallback?: PresentationSignCallback
19
+ customApprovals?: Record<string, (verifiedAuthorizationRequest: VerifiedAuthorizationRequest, sessionId: string) => Promise<void>>
13
20
  onContactIdentityCreated?: (args: OnContactIdentityCreatedArgs) => Promise<void>
14
21
  onIdentifierCreated?: (args: OnIdentifierCreatedArgs) => Promise<void>
22
+ hasher?: Hasher
15
23
  }
16
24
 
17
25
  export type GetMachineArgs = {
@@ -20,12 +28,21 @@ export type GetMachineArgs = {
20
28
  stateNavigationListener?: (siopv2Machine: Siopv2MachineInterpreter, state: Siopv2MachineState, navigation?: any) => Promise<void>
21
29
  }
22
30
 
23
- export type CreateConfigArgs = Pick<Siopv2MachineContext, 'url'>
31
+ export type CreateConfigArgs = { url: string }
24
32
  export type CreateConfigResult = Omit<DidAuthConfig, 'stateId' | 'idOpts'>
25
- export type GetSiopRequestArgs = Pick<Siopv2MachineContext, 'didAuthConfig' | 'url'>
33
+ export type GetSiopRequestArgs = { didAuthConfig?: Omit<DidAuthConfig, 'identifier'>, url: string }
34
+ // FIXME it would be nicer if these function are not tied to a certain machine so that we can start calling them for anywhere
26
35
  export type RetrieveContactArgs = Pick<Siopv2MachineContext, 'url' | 'authorizationRequestData'>
36
+ // FIXME it would be nicer if these function are not tied to a certain machine so that we can start calling them for anywhere
27
37
  export type AddIdentityArgs = Pick<Siopv2MachineContext, 'contact' | 'authorizationRequestData'>
28
- export type SendResponseArgs = Pick<Siopv2MachineContext, 'didAuthConfig' | 'authorizationRequestData' | 'selectedCredentials' | 'idOpts'>
38
+ export type SendResponseArgs = {
39
+ didAuthConfig?: Omit<DidAuthConfig, 'identifier'>,
40
+ authorizationRequestData?: Siopv2AuthorizationRequestData,
41
+ selectedCredentials: Array<UniqueDigitalCredential>
42
+ idOpts?: ManagedIdentifierOptsOrResult
43
+ isFirstParty?: boolean
44
+ }
45
+ // FIXME it would be nicer if these function are not tied to a certain machine so that we can start calling them for anywhere
29
46
  export type GetSelectableCredentialsArgs = Pick<Siopv2MachineContext, 'authorizationRequestData'>
30
47
 
31
48
  export enum Siopv2HolderEvent {
@@ -39,7 +56,7 @@ export enum SupportedLanguage {
39
56
  }
40
57
 
41
58
  export type Siopv2AuthorizationResponseData = {
42
- body?: string
59
+ body?: string | Record<string, any>
43
60
  url?: string
44
61
  queryParams?: Record<string, any>
45
62
  }