@injistack/react-inji-verify-sdk 0.18.0-beta.8 → 0.19.0-beta.1

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,18 +1,26 @@
1
1
  /// <reference types="react" />
2
- export type VerificationStatus = "valid" | "invalid" | "expired";
2
+ export type VerificationStatus = "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
3
+ export type OverallVPStatus = "SUCCESS" | "INVALID";
3
4
  export interface VerificationResult {
4
5
  /**
5
-
6
- Verified credential data (structured per implementation).
7
- */
6
+
7
+ Verified credential data (structured per implementation).
8
+ */
8
9
  vc: Record<string, unknown>;
9
10
  /**
10
-
11
- The status of the verification.
12
- */
13
- vcStatus: VerificationStatus;
11
+
12
+ Full verification result, including per-check outcomes and optional claims.
13
+ */
14
+ verificationResponse: CredentialResult | VpSummarisedVerificationResponse;
14
15
  }
15
16
  export type VerificationResults = VerificationResult[];
17
+ export interface VpSummarisedVerificationResponse {
18
+ vcResults: {
19
+ vc: Record<string, unknown>;
20
+ vcStatus: VerificationStatus;
21
+ }[];
22
+ vpResultStatus: OverallVPStatus;
23
+ }
16
24
  export interface VPRequestBody {
17
25
  clientId: string;
18
26
  nonce: string;
@@ -20,7 +28,13 @@ export interface VPRequestBody {
20
28
  presentationDefinitionId?: string;
21
29
  presentationDefinition?: PresentationDefinition;
22
30
  acceptVPWithoutHolderProof?: boolean;
23
- presentationFlow?: string;
31
+ /**
32
+ * When true, the verifier backend will generate a short-lived single-use `response_code`
33
+ * and return it via redirect for same-device web-wallet flows.
34
+ *
35
+ * Must be omitted/false for cross-device and same-device mobile-wallet (deeplink) flows.
36
+ */
37
+ responseCodeValidationRequired?: boolean;
24
38
  }
25
39
  type ExclusivePresentationDefinition =
26
40
  /**
@@ -131,14 +145,54 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
131
145
  The base URL of the wallet.
132
146
  */
133
147
  webWalletBaseUrl?: string;
148
+ /**
149
+ * Configuration object used to control VP verification behaviour.
150
+ *
151
+ * Allows enabling/disabling specific verification checks such as:
152
+ * - Schema & signature validation
153
+ * - Expiry validation
154
+ * - Status checks (e.g., revocation)
155
+ */
156
+ vpVerificationRequest?: VPVerificationRequest;
157
+ summariseResults?: boolean;
134
158
  };
135
159
  export interface SessionState {
136
160
  requestId: string;
137
- transactionId: string;
138
161
  }
139
162
  export type AppError = {
140
163
  errorMessage: string;
141
164
  errorCode?: string;
142
165
  transactionId?: string | null;
143
166
  };
167
+ export interface VPVerificationRequest {
168
+ skipStatusChecks?: boolean;
169
+ statusCheckFilters?: string[];
170
+ includeClaims?: boolean;
171
+ }
172
+ export interface VPVerificationV2Response {
173
+ transactionId: string;
174
+ allChecksSuccessful: boolean;
175
+ credentialResults: CredentialResult[];
176
+ }
177
+ export interface CredentialResult {
178
+ verifiableCredential: string | object;
179
+ allChecksSuccessful: boolean;
180
+ holderProofCheck?: {
181
+ valid: boolean;
182
+ error: any;
183
+ } | null;
184
+ schemaAndSignatureCheck?: {
185
+ valid: boolean;
186
+ error: any;
187
+ };
188
+ expiryCheck?: {
189
+ valid: boolean;
190
+ };
191
+ statusChecks?: {
192
+ purpose: string;
193
+ valid: boolean;
194
+ error: any;
195
+ }[];
196
+ claims?: Record<string, any>;
197
+ }
144
198
  export {};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { OverallVPStatus, VerificationStatus } from "../openid4vp-verification/OpenID4VPVerification.types";
2
3
  type ExclusiveCallbacks =
3
4
  /**
4
5
  * Callback triggered when the verification presentation (VP) is received.
@@ -19,7 +20,8 @@ type ExclusiveCallbacks =
19
20
  export type QRCodeVerificationProps = ExclusiveCallbacks & {
20
21
  /**
21
22
  * React element that triggers the verification process (e.g., a button).
22
- * If not provided, the component may automatically start the process.
23
+ * When set, the default file upload control is not shown; upload runs via this trigger.
24
+ * If omitted, the visible file input is shown (when upload is enabled).
23
25
  */
24
26
  triggerElement?: React.ReactNode;
25
27
  /**
@@ -90,6 +92,7 @@ export type QRCodeVerificationProps = ExclusiveCallbacks & {
90
92
  * - Status checks (e.g., revocation)
91
93
  */
92
94
  vcVerificationV2Request?: VCVerificationV2Request;
95
+ summariseResults?: boolean;
93
96
  };
94
97
  export type VcStatus = "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
95
98
  export type scanResult = {
@@ -116,20 +119,43 @@ export interface VCVerificationV2Response {
116
119
  statusCheck: ValidationCheck[];
117
120
  claims?: Record<string, any>;
118
121
  }
122
+ export interface VCSummarisedVerificationResponse {
123
+ verificationStatus: "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
124
+ }
119
125
  export type VerificationResults = {
120
126
  vc: any;
121
- vcStatus: VcStatus;
122
- claims?: Record<string, any>;
123
- details?: {
124
- checks: {
125
- schema: ValidationCheck;
126
- expiry: ValidationCheck;
127
- status: ValidationCheck[];
128
- };
129
- };
127
+ verificationResponse: VCVerificationV2Response | VCSummarisedVerificationResponse | VpSummarisedVerificationResponse;
130
128
  }[];
129
+ export interface VpSummarisedVerificationResponse {
130
+ vcResults: {
131
+ vc: Record<string, unknown>;
132
+ vcStatus: VerificationStatus;
133
+ }[];
134
+ vpResultStatus: OverallVPStatus;
135
+ }
131
136
  export interface vcSubmissionBody {
132
137
  vc: any;
133
138
  transactionId?: string;
134
139
  }
140
+ export interface CredentialResult {
141
+ verifiableCredential: string | object;
142
+ allChecksSuccessful: boolean;
143
+ holderProofCheck?: {
144
+ valid: boolean;
145
+ error: any;
146
+ } | null;
147
+ schemaAndSignatureCheck?: {
148
+ valid: boolean;
149
+ error: any;
150
+ };
151
+ expiryCheck?: {
152
+ valid: boolean;
153
+ };
154
+ statusChecks?: {
155
+ purpose: string;
156
+ valid: boolean;
157
+ error: any;
158
+ }[];
159
+ claims?: Record<string, any>;
160
+ }
135
161
  export {};