@velion-la/onboarding-sdk-react-native 1.2.0-beta.1 → 1.2.0-beta.5
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 +15 -13
- package/lib/commonjs/camera/DocumentCapture.js +53 -33
- package/lib/commonjs/camera/DocumentCapture.js.map +1 -1
- package/lib/commonjs/camera/LivenessCamera.js +120 -83
- package/lib/commonjs/camera/LivenessCamera.js.map +1 -1
- package/lib/commonjs/camera/MapAddressPicker.js +1 -1
- package/lib/commonjs/camera/MapAddressPicker.js.map +1 -1
- package/lib/commonjs/steps/DocumentsOcrStep.js +2 -2
- package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
- package/lib/commonjs/steps/LivenessMatchStep.js +7 -4
- package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -1
- package/lib/commonjs/ui/overlays/LoadingOverlay.js +1 -1
- package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -1
- package/lib/commonjs/ui/overlays/RetryDialog.js +1 -1
- package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -1
- package/lib/module/camera/DocumentCapture.js +54 -34
- package/lib/module/camera/DocumentCapture.js.map +1 -1
- package/lib/module/camera/LivenessCamera.js +121 -84
- package/lib/module/camera/LivenessCamera.js.map +1 -1
- package/lib/module/camera/MapAddressPicker.js +1 -1
- package/lib/module/camera/MapAddressPicker.js.map +1 -1
- package/lib/module/steps/DocumentsOcrStep.js +2 -2
- package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
- package/lib/module/steps/LivenessMatchStep.js +7 -4
- package/lib/module/steps/LivenessMatchStep.js.map +1 -1
- package/lib/module/ui/overlays/LoadingOverlay.js +1 -1
- package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -1
- package/lib/module/ui/overlays/RetryDialog.js +1 -1
- package/lib/module/ui/overlays/RetryDialog.js.map +1 -1
- package/lib/typescript/camera/DocumentCapture.d.ts +9 -3
- package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -1
- package/lib/typescript/camera/LivenessCamera.d.ts +27 -9
- package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -1
- package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -1
- package/package.json +16 -14
- package/src/camera/DocumentCapture.tsx +56 -39
- package/src/camera/LivenessCamera.tsx +140 -83
- package/src/camera/MapAddressPicker.tsx +1 -1
- package/src/steps/DocumentsOcrStep.tsx +2 -2
- package/src/steps/LivenessMatchStep.tsx +12 -6
- package/src/ui/overlays/LoadingOverlay.tsx +1 -1
- package/src/ui/overlays/RetryDialog.tsx +1 -1
|
@@ -58,8 +58,9 @@ import {
|
|
|
58
58
|
LivenessCamera,
|
|
59
59
|
type LivenessCameraHandle,
|
|
60
60
|
type LivenessOvalCue,
|
|
61
|
+
type LivenessVideoFile,
|
|
61
62
|
} from '../camera/LivenessCamera';
|
|
62
|
-
|
|
63
|
+
|
|
63
64
|
import type { ApiCaller } from '../transport/api';
|
|
64
65
|
import type { StepDeps, StepModule } from './types';
|
|
65
66
|
|
|
@@ -309,7 +310,7 @@ function LivenessMatchView({
|
|
|
309
310
|
}, []);
|
|
310
311
|
|
|
311
312
|
const uploadRecordedVideo = useCallback(
|
|
312
|
-
async (video:
|
|
313
|
+
async (video: LivenessVideoFile): Promise<void> => {
|
|
313
314
|
const target = videoUploadRef.current;
|
|
314
315
|
videoTempPathRef.current = video.path;
|
|
315
316
|
if (!target) {
|
|
@@ -413,7 +414,7 @@ function LivenessMatchView({
|
|
|
413
414
|
[deleteVideoTemp],
|
|
414
415
|
);
|
|
415
416
|
|
|
416
|
-
const startVideoRecordingIfEnabled = useCallback(() => {
|
|
417
|
+
const startVideoRecordingIfEnabled = useCallback(async () => {
|
|
417
418
|
if (!videoUploadRef.current) {
|
|
418
419
|
log.info('[Liveness] video skipped: no video_upload in liveness-init');
|
|
419
420
|
return;
|
|
@@ -453,7 +454,7 @@ function LivenessMatchView({
|
|
|
453
454
|
};
|
|
454
455
|
});
|
|
455
456
|
try {
|
|
456
|
-
camera.startVideoRecording({
|
|
457
|
+
await camera.startVideoRecording({
|
|
457
458
|
onRecordingFinished: (video) => {
|
|
458
459
|
log.info('[Liveness] video recording finished', {
|
|
459
460
|
path: video.path,
|
|
@@ -587,7 +588,9 @@ function LivenessMatchView({
|
|
|
587
588
|
// real-world directions, so we flip the JPEG horizontally here before
|
|
588
589
|
// signing and sending.
|
|
589
590
|
const compressed = await ImageManipulator.manipulateAsync(
|
|
590
|
-
photo.
|
|
591
|
+
photo.filePath.startsWith('file://')
|
|
592
|
+
? photo.filePath
|
|
593
|
+
: `file://${photo.filePath}`,
|
|
591
594
|
[
|
|
592
595
|
{ resize: { width: FRAME_MAX_LONG_EDGE } },
|
|
593
596
|
{ flip: ImageManipulator.FlipType.Horizontal },
|
|
@@ -709,7 +712,10 @@ function LivenessMatchView({
|
|
|
709
712
|
// Start the local mp4 recording in parallel with the frame loop, if
|
|
710
713
|
// the backend opted in via `video_upload` in /liveness-init. Pure
|
|
711
714
|
// best-effort: any failure here is logged and never blocks liveness.
|
|
712
|
-
|
|
715
|
+
// Deliberately not awaited — creating the recorder is asynchronous
|
|
716
|
+
// in v5 and the frame loop must not wait on it. The function
|
|
717
|
+
// swallows its own errors, so the floating promise never rejects.
|
|
718
|
+
void startVideoRecordingIfEnabled();
|
|
713
719
|
resetWatchdog();
|
|
714
720
|
return;
|
|
715
721
|
}
|
|
@@ -88,7 +88,7 @@ export function LoadingOverlay({ message }: LoadingOverlayProps) {
|
|
|
88
88
|
|
|
89
89
|
const styles = StyleSheet.create({
|
|
90
90
|
root: {
|
|
91
|
-
...StyleSheet.
|
|
91
|
+
...StyleSheet.absoluteFill,
|
|
92
92
|
alignItems: 'center',
|
|
93
93
|
justifyContent: 'center',
|
|
94
94
|
paddingHorizontal: 32,
|