@smile_identity/react-native 10.0.3 → 10.1.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.
- package/android/build.gradle +0 -1
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/smileidentity/react/SmileIdModule.kt +116 -4
- package/android/src/oldarch/SmileIdSpec.kt +8 -0
- package/ios/RNSmileID.mm +5 -0
- package/ios/RNSmileID.swift +146 -3
- package/ios/View/SmileIDBiometricKYCView.swift +16 -1
- package/ios/View/SmileIDDocumentVerificationView.swift +11 -7
- package/ios/View/SmileIDEnhancedDocumentVerificationView.swift +13 -8
- package/ios/View/SmileIDSmartSelfieAuthView.swift +15 -18
- package/ios/View/SmileIDSmartSelfieEnrollmentView.swift +15 -18
- package/lib/commonjs/NativeSmileId.js.map +1 -1
- package/lib/commonjs/index.js +67 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/NativeSmileId.js.map +1 -1
- package/lib/module/index.js +63 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/NativeSmileId.d.ts +4 -0
- package/lib/typescript/NativeSmileId.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +34 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +2 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +8 -5
- package/react-native-smile-id.podspec +1 -1
- package/src/NativeSmileId.ts +16 -0
- package/src/index.tsx +82 -0
- package/src/types.ts +2 -0
package/src/index.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
SmartSelfieJobStatusResponse,
|
|
30
30
|
UploadRequest,
|
|
31
31
|
ValidDocumentsResponse,
|
|
32
|
+
JobType,
|
|
32
33
|
} from './types';
|
|
33
34
|
|
|
34
35
|
const LINKING_ERROR =
|
|
@@ -133,6 +134,86 @@ const SmileID = {
|
|
|
133
134
|
* Get available services
|
|
134
135
|
*/
|
|
135
136
|
getServices: () => _SmileID.getServices(),
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Polls the status of a smart selfie job.
|
|
140
|
+
*
|
|
141
|
+
* @param {JobStatusRequest} request - The job status request object.
|
|
142
|
+
* @param {number} interval - The interval duration (in milliseconds) between each polling attempt.
|
|
143
|
+
* @param {number} numAttempts - The number of polling attempts before stopping.
|
|
144
|
+
*/
|
|
145
|
+
pollSmartSelfieJobStatus: (
|
|
146
|
+
request: JobStatusRequest,
|
|
147
|
+
interval: number,
|
|
148
|
+
numAttempts: number
|
|
149
|
+
) => {
|
|
150
|
+
if (!Number.isInteger(interval) || !Number.isInteger(numAttempts)) {
|
|
151
|
+
throw new Error(`interval and numAttempts must be an integer.`);
|
|
152
|
+
}
|
|
153
|
+
request.interval = interval;
|
|
154
|
+
request.numAttempts = numAttempts;
|
|
155
|
+
_SmileID.pollSmartSelfieJobStatus(request);
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Polls the status of a document verification job.
|
|
160
|
+
*
|
|
161
|
+
* @param {JobStatusRequest} request - The job status request object.
|
|
162
|
+
* @param {number} interval - The interval duration (in milliseconds) between each polling attempt.
|
|
163
|
+
* @param {number} numAttempts - The number of polling attempts before stopping.
|
|
164
|
+
*/
|
|
165
|
+
pollDocumentVerificationJobStatus: (
|
|
166
|
+
request: JobStatusRequest,
|
|
167
|
+
interval: number,
|
|
168
|
+
numAttempts: number
|
|
169
|
+
) => {
|
|
170
|
+
if (!Number.isInteger(interval) || !Number.isInteger(numAttempts)) {
|
|
171
|
+
throw new Error(`interval and numAttempts must be an integer.`);
|
|
172
|
+
}
|
|
173
|
+
request.interval = interval;
|
|
174
|
+
request.numAttempts = numAttempts;
|
|
175
|
+
_SmileID.pollDocumentVerificationJobStatus(request);
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Polls the status of a biometric KYC job.
|
|
180
|
+
*
|
|
181
|
+
* @param {JobStatusRequest} request - The job status request object.
|
|
182
|
+
* @param {number} interval - The interval duration (in milliseconds) between each polling attempt.
|
|
183
|
+
* @param {number} numAttempts - The number of polling attempts before stopping.
|
|
184
|
+
*/
|
|
185
|
+
pollBiometricKycJobStatus: (
|
|
186
|
+
request: JobStatusRequest,
|
|
187
|
+
interval: number,
|
|
188
|
+
numAttempts: number
|
|
189
|
+
) => {
|
|
190
|
+
if (!Number.isInteger(interval) || !Number.isInteger(numAttempts)) {
|
|
191
|
+
throw new Error(`interval and numAttempts must be an integer.`);
|
|
192
|
+
}
|
|
193
|
+
request.interval = interval;
|
|
194
|
+
request.numAttempts = numAttempts;
|
|
195
|
+
_SmileID.pollBiometricKycJobStatus(request);
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Polls the status of an enhanced document verification job.
|
|
200
|
+
*
|
|
201
|
+
* @param {JobStatusRequest} request - The job status request object.
|
|
202
|
+
* @param {number} interval - The interval duration (in milliseconds) between each polling attempt.
|
|
203
|
+
* @param {number} numAttempts - The number of polling attempts before stopping.
|
|
204
|
+
*/
|
|
205
|
+
pollEnhancedDocumentVerificationJobStatus: (
|
|
206
|
+
request: JobStatusRequest,
|
|
207
|
+
interval: number,
|
|
208
|
+
numAttempts: number
|
|
209
|
+
) => {
|
|
210
|
+
if (!Number.isInteger(interval) || !Number.isInteger(numAttempts)) {
|
|
211
|
+
throw new Error(`interval and numAttempts must be an integer.`);
|
|
212
|
+
}
|
|
213
|
+
request.interval = interval;
|
|
214
|
+
request.numAttempts = numAttempts;
|
|
215
|
+
_SmileID.pollEnhancedDocumentVerificationJobStatus(request);
|
|
216
|
+
},
|
|
136
217
|
};
|
|
137
218
|
|
|
138
219
|
export {
|
|
@@ -146,6 +227,7 @@ export {
|
|
|
146
227
|
SmileIDEnhancedDocumentVerificationView,
|
|
147
228
|
SmileIDConsentView,
|
|
148
229
|
//types
|
|
230
|
+
JobType,
|
|
149
231
|
EnhancedKycRequest,
|
|
150
232
|
DocumentVerificationRequest,
|
|
151
233
|
SmartSelfieEnrollmentRequest,
|