@injistack/react-inji-verify-sdk 0.19.0-beta.5 → 0.19.0-beta.7
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.
|
@@ -21,13 +21,90 @@ export interface VpSummarisedVerificationResponse {
|
|
|
21
21
|
}[];
|
|
22
22
|
vpResultStatus: OverallVPStatus;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A single claim requested from a credential.
|
|
26
|
+
*/
|
|
27
|
+
export interface DcqlClaimQuery {
|
|
28
|
+
/** Required if claim_sets is used. Used to reference the claim in claim_sets. */
|
|
29
|
+
id?: string;
|
|
30
|
+
/** Path pointer to navigate the credential structure (JSON pointer segments). */
|
|
31
|
+
path: string[];
|
|
32
|
+
/** Array of allowed values. Claim is returned only if its value matches one of these. */
|
|
33
|
+
values?: unknown[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Trusted authority filter for credential issuers.
|
|
37
|
+
*/
|
|
38
|
+
export interface DcqlTrustedAuthority {
|
|
39
|
+
/** Authority filter type (e.g. aki, etsi_tl, openid_federation; extensible per DCQL). */
|
|
40
|
+
type: string;
|
|
41
|
+
values: string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format-specific metadata constraints for a credential query.
|
|
45
|
+
*/
|
|
46
|
+
export interface DcqlCredentialMeta {
|
|
47
|
+
/** SD-JWT VC: allowed credential type identifiers. */
|
|
48
|
+
vct_values?: string[];
|
|
49
|
+
/** W3C VC (JSON-LD): expanded type values. */
|
|
50
|
+
type_values?: string[][];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A single credential query describing what the Verifier is requesting.
|
|
54
|
+
*/
|
|
55
|
+
export interface DcqlCredentialQuery {
|
|
56
|
+
/** Unique identifier for this credential within the request and response. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** Credential format (e.g., "dc+sd-jwt", "vc+sd-jwt"). */
|
|
59
|
+
format: string;
|
|
60
|
+
/** Whether multiple credentials of this type can be returned. Defaults to false. */
|
|
61
|
+
multiple?: boolean;
|
|
62
|
+
/** Format-specific constraints (required, can be empty). */
|
|
63
|
+
meta: DcqlCredentialMeta;
|
|
64
|
+
/** Trusted issuer authorities filter. */
|
|
65
|
+
trusted_authorities?: DcqlTrustedAuthority[];
|
|
66
|
+
/** Whether proof of possession is required. Defaults to true. */
|
|
67
|
+
require_cryptographic_holder_binding?: boolean;
|
|
68
|
+
/** Individual data points requested from the credential. */
|
|
69
|
+
claims?: DcqlClaimQuery[];
|
|
70
|
+
/**
|
|
71
|
+
* Acceptable combinations of claims (arrays of claim ids).
|
|
72
|
+
* Each inner array represents one valid combination.
|
|
73
|
+
* Wallet evaluates in order and returns the first satisfiable set.
|
|
74
|
+
*/
|
|
75
|
+
claim_sets?: string[][];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Credential set query defining logical combinations of requested credentials.
|
|
79
|
+
*/
|
|
80
|
+
export interface DcqlCredentialSetQuery {
|
|
81
|
+
/**
|
|
82
|
+
* Array of arrays of credential ids.
|
|
83
|
+
* Each inner array = one valid combination (AND within, OR across).
|
|
84
|
+
*/
|
|
85
|
+
options: string[][];
|
|
86
|
+
/** Whether this set is required. Defaults to true. */
|
|
87
|
+
required?: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Top-level DCQL (Digital Credentials Query Language) query object.
|
|
91
|
+
* Used by a Verifier to request specific credentials from a Wallet.
|
|
92
|
+
*/
|
|
93
|
+
export interface DcqlQuery {
|
|
94
|
+
/** List of credential queries describing what is being requested. */
|
|
95
|
+
credentials: DcqlCredentialQuery[];
|
|
96
|
+
/**
|
|
97
|
+
* Rules about acceptable credential combinations.
|
|
98
|
+
* If omitted, all credentials in the `credentials` array are required.
|
|
99
|
+
*/
|
|
100
|
+
credential_sets?: DcqlCredentialSetQuery[];
|
|
101
|
+
}
|
|
24
102
|
export interface VPRequestBody {
|
|
25
103
|
clientId: string;
|
|
26
104
|
nonce: string;
|
|
27
105
|
transactionId?: string;
|
|
28
|
-
presentationDefinitionId?: string;
|
|
29
|
-
presentationDefinition?: PresentationDefinition;
|
|
30
106
|
acceptVPWithoutHolderProof?: boolean;
|
|
107
|
+
dcqlQuery: DcqlQuery;
|
|
31
108
|
/**
|
|
32
109
|
* When true, the verifier backend will generate a short-lived single-use `response_code`
|
|
33
110
|
* and return it via redirect for same-device web-wallet flows.
|
|
@@ -36,23 +113,6 @@ export interface VPRequestBody {
|
|
|
36
113
|
*/
|
|
37
114
|
responseCodeValidationRequired?: boolean;
|
|
38
115
|
}
|
|
39
|
-
type ExclusivePresentationDefinition =
|
|
40
|
-
/**
|
|
41
|
-
* ID of the presentation definition used for verification.
|
|
42
|
-
* Required for some verification flows.
|
|
43
|
-
*/
|
|
44
|
-
{
|
|
45
|
-
presentationDefinitionId: string;
|
|
46
|
-
presentationDefinition?: never;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The full presentation definition JSON string.
|
|
50
|
-
* If provided, it will be used instead of fetching from the backend.
|
|
51
|
-
*/
|
|
52
|
-
| {
|
|
53
|
-
presentationDefinition?: PresentationDefinition;
|
|
54
|
-
presentationDefinitionId?: never;
|
|
55
|
-
};
|
|
56
116
|
type ExclusiveCallbacks =
|
|
57
117
|
/**
|
|
58
118
|
* Callback triggered when the verification presentation (VP) is received.
|
|
@@ -70,26 +130,12 @@ type ExclusiveCallbacks =
|
|
|
70
130
|
onVPProcessed: (VPResult: VerificationResults) => void;
|
|
71
131
|
onVPReceived?: never;
|
|
72
132
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
constraints?: {};
|
|
81
|
-
}
|
|
82
|
-
export interface PresentationDefinition {
|
|
83
|
-
id?: string;
|
|
84
|
-
purpose: string;
|
|
85
|
-
format?: {
|
|
86
|
-
ldp_vc: {
|
|
87
|
-
proof_type: string[];
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
input_descriptors: InputDescriptor[];
|
|
91
|
-
}
|
|
92
|
-
export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & ExclusiveCallbacks & {
|
|
133
|
+
export type OpenID4VPVerificationProps = ExclusiveCallbacks & {
|
|
134
|
+
/**
|
|
135
|
+
* DCQL query object sent to the verifier backend for OpenID4VP 1.0.
|
|
136
|
+
* Must contain a `credentials` array describing the requested credentials.
|
|
137
|
+
*/
|
|
138
|
+
dcqlQuery: DcqlQuery;
|
|
93
139
|
/**
|
|
94
140
|
React element that triggers the verification process (e.g., a button).
|
|
95
141
|
If not provided, the component may automatically start the process.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default as OpenID4VPVerification } from '././components/openid4vp-verification/OpenID4VPVerification';
|
|
2
2
|
export { default as QRCodeVerification } from '././components/qrcode-verification/QRCodeVerification';
|
|
3
|
+
export type { DcqlQuery, DcqlCredentialQuery, DcqlCredentialSetQuery, DcqlClaimQuery, DcqlCredentialMeta, DcqlTrustedAuthority, } from './components/openid4vp-verification/OpenID4VPVerification.types';
|