@injistack/react-inji-verify-sdk 0.18.0-beta.3 → 0.18.0-beta.31
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/README.md +604 -120
- package/dist/components/openid4vp-verification/OpenID4VPVerification.types.d.ts +68 -9
- package/dist/components/qrcode-verification/QRCodeVerification.d.ts +1 -1
- package/dist/components/qrcode-verification/QRCodeVerification.types.d.ts +68 -12
- package/dist/index.js +1 -1
- package/dist/utils/api.d.ts +11 -3
- package/dist/utils/utils.d.ts +5 -0
- package/package.json +5 -3
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export type VerificationStatus = "
|
|
2
|
+
export type VerificationStatus = "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
|
|
3
|
+
export type OverallVPStatus = "SUCCESS" | "INVALID";
|
|
3
4
|
export interface VerificationResult {
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
Verified credential data (structured per implementation).
|
|
8
|
+
*/
|
|
8
9
|
vc: Record<string, unknown>;
|
|
9
10
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,6 +28,13 @@ export interface VPRequestBody {
|
|
|
20
28
|
presentationDefinitionId?: string;
|
|
21
29
|
presentationDefinition?: PresentationDefinition;
|
|
22
30
|
acceptVPWithoutHolderProof?: boolean;
|
|
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;
|
|
23
38
|
}
|
|
24
39
|
type ExclusivePresentationDefinition =
|
|
25
40
|
/**
|
|
@@ -126,14 +141,58 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
|
|
|
126
141
|
When true, allows unsigned VPs (VPs without proof).
|
|
127
142
|
*/
|
|
128
143
|
acceptVPWithoutHolderProof?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
The base URL of the wallet.
|
|
146
|
+
*/
|
|
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;
|
|
129
158
|
};
|
|
130
159
|
export interface SessionState {
|
|
131
160
|
requestId: string;
|
|
132
|
-
transactionId: string;
|
|
133
161
|
}
|
|
134
162
|
export type AppError = {
|
|
135
163
|
errorMessage: string;
|
|
136
164
|
errorCode?: string;
|
|
137
165
|
transactionId?: string | null;
|
|
138
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
|
+
}
|
|
139
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
|
-
*
|
|
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
|
/**
|
|
@@ -81,25 +83,79 @@ export type QRCodeVerificationProps = ExclusiveCallbacks & {
|
|
|
81
83
|
When true, allows unsigned VPs (VPs without proof).
|
|
82
84
|
*/
|
|
83
85
|
acceptVPWithoutHolderProof?: boolean;
|
|
84
|
-
};
|
|
85
|
-
interface VerificationResult {
|
|
86
|
-
/**
|
|
87
|
-
* Verified credential data (structure depends on implementation).
|
|
88
|
-
*/
|
|
89
|
-
vc: unknown;
|
|
90
86
|
/**
|
|
91
|
-
*
|
|
87
|
+
* Configuration object used to control VC verification behaviour.
|
|
88
|
+
*
|
|
89
|
+
* Allows enabling/disabling specific verification checks such as:
|
|
90
|
+
* - Schema & signature validation
|
|
91
|
+
* - Expiry validation
|
|
92
|
+
* - Status checks (e.g., revocation)
|
|
92
93
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
export type VcStatus = "SUCCESS" | "INVALID" | "EXPIRED";
|
|
94
|
+
vcVerificationV2Request?: VCVerificationV2Request;
|
|
95
|
+
summariseResults?: boolean;
|
|
96
|
+
};
|
|
97
|
+
export type VcStatus = "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
|
|
97
98
|
export type scanResult = {
|
|
98
99
|
data: any;
|
|
99
100
|
error: Error | null;
|
|
100
101
|
};
|
|
102
|
+
export interface ValidationCheck {
|
|
103
|
+
purpose?: string;
|
|
104
|
+
valid: boolean;
|
|
105
|
+
error?: {
|
|
106
|
+
errorCode?: string;
|
|
107
|
+
errorMessage?: string;
|
|
108
|
+
} | null;
|
|
109
|
+
}
|
|
110
|
+
export interface VCVerificationV2Request {
|
|
111
|
+
skipStatusChecks?: boolean;
|
|
112
|
+
statusCheckFilters?: string[];
|
|
113
|
+
includeClaims?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface VCVerificationV2Response {
|
|
116
|
+
allChecksSuccessful: boolean;
|
|
117
|
+
schemaAndSignatureCheck: ValidationCheck;
|
|
118
|
+
expiryCheck: ValidationCheck;
|
|
119
|
+
statusCheck: ValidationCheck[];
|
|
120
|
+
claims?: Record<string, any>;
|
|
121
|
+
}
|
|
122
|
+
export interface VCSummarisedVerificationResponse {
|
|
123
|
+
verificationStatus: "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
|
|
124
|
+
}
|
|
125
|
+
export type VerificationResults = {
|
|
126
|
+
vc: any;
|
|
127
|
+
verificationResponse: VCVerificationV2Response | VCSummarisedVerificationResponse | VpSummarisedVerificationResponse;
|
|
128
|
+
}[];
|
|
129
|
+
export interface VpSummarisedVerificationResponse {
|
|
130
|
+
vcResults: {
|
|
131
|
+
vc: Record<string, unknown>;
|
|
132
|
+
vcStatus: VerificationStatus;
|
|
133
|
+
}[];
|
|
134
|
+
vpResultStatus: OverallVPStatus;
|
|
135
|
+
}
|
|
101
136
|
export interface vcSubmissionBody {
|
|
102
137
|
vc: any;
|
|
103
138
|
transactionId?: string;
|
|
104
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
|
+
}
|
|
105
161
|
export {};
|