@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.
Files changed (42) hide show
  1. package/README.md +15 -13
  2. package/lib/commonjs/camera/DocumentCapture.js +53 -33
  3. package/lib/commonjs/camera/DocumentCapture.js.map +1 -1
  4. package/lib/commonjs/camera/LivenessCamera.js +120 -83
  5. package/lib/commonjs/camera/LivenessCamera.js.map +1 -1
  6. package/lib/commonjs/camera/MapAddressPicker.js +1 -1
  7. package/lib/commonjs/camera/MapAddressPicker.js.map +1 -1
  8. package/lib/commonjs/steps/DocumentsOcrStep.js +2 -2
  9. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
  10. package/lib/commonjs/steps/LivenessMatchStep.js +7 -4
  11. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -1
  12. package/lib/commonjs/ui/overlays/LoadingOverlay.js +1 -1
  13. package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -1
  14. package/lib/commonjs/ui/overlays/RetryDialog.js +1 -1
  15. package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -1
  16. package/lib/module/camera/DocumentCapture.js +54 -34
  17. package/lib/module/camera/DocumentCapture.js.map +1 -1
  18. package/lib/module/camera/LivenessCamera.js +121 -84
  19. package/lib/module/camera/LivenessCamera.js.map +1 -1
  20. package/lib/module/camera/MapAddressPicker.js +1 -1
  21. package/lib/module/camera/MapAddressPicker.js.map +1 -1
  22. package/lib/module/steps/DocumentsOcrStep.js +2 -2
  23. package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
  24. package/lib/module/steps/LivenessMatchStep.js +7 -4
  25. package/lib/module/steps/LivenessMatchStep.js.map +1 -1
  26. package/lib/module/ui/overlays/LoadingOverlay.js +1 -1
  27. package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -1
  28. package/lib/module/ui/overlays/RetryDialog.js +1 -1
  29. package/lib/module/ui/overlays/RetryDialog.js.map +1 -1
  30. package/lib/typescript/camera/DocumentCapture.d.ts +9 -3
  31. package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -1
  32. package/lib/typescript/camera/LivenessCamera.d.ts +27 -9
  33. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -1
  34. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -1
  35. package/package.json +16 -14
  36. package/src/camera/DocumentCapture.tsx +56 -39
  37. package/src/camera/LivenessCamera.tsx +140 -83
  38. package/src/camera/MapAddressPicker.tsx +1 -1
  39. package/src/steps/DocumentsOcrStep.tsx +2 -2
  40. package/src/steps/LivenessMatchStep.tsx +12 -6
  41. package/src/ui/overlays/LoadingOverlay.tsx +1 -1
  42. 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
- import type { VideoFile } from 'react-native-vision-camera';
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: VideoFile): Promise<void> => {
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.path.startsWith('file://') ? photo.path : `file://${photo.path}`,
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
- startVideoRecordingIfEnabled();
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.absoluteFillObject,
91
+ ...StyleSheet.absoluteFill,
92
92
  alignItems: 'center',
93
93
  justifyContent: 'center',
94
94
  paddingHorizontal: 32,
@@ -81,7 +81,7 @@ export function RetryDialog({
81
81
 
82
82
  const styles = StyleSheet.create({
83
83
  root: {
84
- ...StyleSheet.absoluteFillObject,
84
+ ...StyleSheet.absoluteFill,
85
85
  alignItems: 'center',
86
86
  justifyContent: 'center',
87
87
  padding: 24,