@velion-la/onboarding-sdk-react-native 1.0.0-beta.2 → 1.0.0-beta.4

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 (48) hide show
  1. package/lib/commonjs/camera/LivenessCamera.js +85 -6
  2. package/lib/commonjs/camera/LivenessCamera.js.map +1 -1
  3. package/lib/commonjs/core/VelionOnboarding.js +3 -0
  4. package/lib/commonjs/core/VelionOnboarding.js.map +1 -1
  5. package/lib/commonjs/i18n/strings/en.js +1 -0
  6. package/lib/commonjs/i18n/strings/en.js.map +1 -1
  7. package/lib/commonjs/i18n/strings/es.js +1 -0
  8. package/lib/commonjs/i18n/strings/es.js.map +1 -1
  9. package/lib/commonjs/steps/DocumentsOcrStep.js +8 -4
  10. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
  11. package/lib/commonjs/steps/LivenessMatchStep.js +493 -16
  12. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -1
  13. package/lib/commonjs/types/index.js +16 -0
  14. package/lib/commonjs/types/index.js.map +1 -1
  15. package/lib/module/camera/LivenessCamera.js +86 -7
  16. package/lib/module/camera/LivenessCamera.js.map +1 -1
  17. package/lib/module/core/VelionOnboarding.js +3 -0
  18. package/lib/module/core/VelionOnboarding.js.map +1 -1
  19. package/lib/module/i18n/strings/en.js +1 -0
  20. package/lib/module/i18n/strings/en.js.map +1 -1
  21. package/lib/module/i18n/strings/es.js +1 -0
  22. package/lib/module/i18n/strings/es.js.map +1 -1
  23. package/lib/module/steps/DocumentsOcrStep.js +9 -5
  24. package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
  25. package/lib/module/steps/LivenessMatchStep.js +492 -16
  26. package/lib/module/steps/LivenessMatchStep.js.map +1 -1
  27. package/lib/module/types/index.js +19 -0
  28. package/lib/module/types/index.js.map +1 -1
  29. package/lib/typescript/camera/LivenessCamera.d.ts +18 -1
  30. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -1
  31. package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -1
  32. package/lib/typescript/i18n/strings/en.d.ts.map +1 -1
  33. package/lib/typescript/i18n/strings/es.d.ts +1 -0
  34. package/lib/typescript/i18n/strings/es.d.ts.map +1 -1
  35. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -1
  36. package/lib/typescript/steps/types.d.ts +7 -1
  37. package/lib/typescript/steps/types.d.ts.map +1 -1
  38. package/lib/typescript/types/index.d.ts +57 -0
  39. package/lib/typescript/types/index.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/src/camera/LivenessCamera.tsx +100 -3
  42. package/src/core/VelionOnboarding.ts +3 -0
  43. package/src/i18n/strings/en.ts +1 -0
  44. package/src/i18n/strings/es.ts +1 -0
  45. package/src/steps/DocumentsOcrStep.tsx +7 -3
  46. package/src/steps/LivenessMatchStep.tsx +522 -17
  47. package/src/steps/types.ts +7 -1
  48. package/src/types/index.ts +61 -0
@@ -8,7 +8,7 @@
8
8
 
9
9
  import type { ReactNode } from 'react';
10
10
  import type { ApiCaller } from '../transport/api';
11
- import type { OnboardingStep, SdkError } from '../types';
11
+ import type { LivenessVideoRef, OnboardingStep, SdkError } from '../types';
12
12
 
13
13
  /**
14
14
  * Internal contract every step module must implement. The orchestrator awaits
@@ -63,6 +63,12 @@ export interface StepDeps {
63
63
  * `LivenessMatchStep`.
64
64
  */
65
65
  livenessCalibrationLabel?: string;
66
+ /**
67
+ * Forwarded `VelionConfig.onLivenessVideoUploaded` callback. Invoked by
68
+ * `LivenessMatchStep` only when the recorded session video uploaded
69
+ * successfully to GCS. Other steps ignore it.
70
+ */
71
+ onLivenessVideoUploaded?: (ref: LivenessVideoRef) => void;
66
72
  }
67
73
 
68
74
  /**
@@ -531,6 +531,16 @@ export interface VelionCallbacks {
531
531
  * (only when the final result screen is shown). `onSuccess` has already run.
532
532
  */
533
533
  onFinalResultScreenDismiss?: () => void;
534
+
535
+ /**
536
+ * Fires when the LIVENESS_MATCH step successfully uploaded the recorded
537
+ * session video to the onboarding storage (GCS PUT returned 200). Best-effort:
538
+ * if the upload failed or the session had no `video_upload` URL, the
539
+ * callback is not invoked — liveness still completes normally.
540
+ *
541
+ * @param ref - URL and metadata of the uploaded video.
542
+ */
543
+ onLivenessVideoUploaded?: (ref: LivenessVideoRef) => void;
534
544
  }
535
545
 
536
546
  // ─────────────────────────────────────────────────────────────────────────────
@@ -887,6 +897,57 @@ export interface LivenessSessionResponse {
887
897
  * frame in a JSON envelope (canonical line: `sessionId\nframeId\nts\nsha256hex(jpeg)`).
888
898
  */
889
899
  frame_integrity_key_base64?: string;
900
+ /**
901
+ * Signed PUT URL the SDK uses to upload the locally-recorded liveness video
902
+ * directly to the onboarding GCS bucket. `null` when video recording is
903
+ * disabled or the signing failed — the SDK should skip the upload silently
904
+ * (liveness still works without the video; only the back-office loses the
905
+ * playback evidence).
906
+ */
907
+ video_upload?: VideoUpload | null;
908
+ }
909
+
910
+ /**
911
+ * Signed-upload payload returned by `POST /liveness-init`. Mirrors the backend
912
+ * `LivenessInitResponseDto.VideoUpload`. The SDK PUTs the recorded mp4 bytes
913
+ * to `upload_url` (Content-Type matching `video/mp4`) before calling
914
+ * `POST /liveness-verify` with the resulting metadata.
915
+ */
916
+ export interface VideoUpload {
917
+ /** Absolute https://storage.googleapis.com/... URL with V4 signature params. */
918
+ upload_url: string;
919
+ /** ISO-8601 instant after which GCS rejects the signature. */
920
+ expires_at: string;
921
+ /** HTTP method to use. Always `"PUT"` today; future-proofing. */
922
+ method: 'PUT' | string;
923
+ }
924
+
925
+ /**
926
+ * Optional body of `POST /liveness-verify`. The SDK only includes it when the
927
+ * recorded video uploaded successfully (HTTP 200 from GCS). When omitted, the
928
+ * backend completes liveness based on the Iris score only.
929
+ */
930
+ export interface LivenessVerifyVideoMeta {
931
+ /** MIME type that was sent in the PUT `Content-Type` header. */
932
+ content_type: string;
933
+ /** Recorded video duration in milliseconds, or `null` if vision-camera did not report it. */
934
+ duration_ms: number | null;
935
+ }
936
+
937
+ /**
938
+ * Payload delivered to the optional `onLivenessVideoUploaded` callback after a
939
+ * successful upload of the liveness video. Best-effort: the callback only
940
+ * fires when the GCS PUT returned 200.
941
+ */
942
+ export interface LivenessVideoRef {
943
+ /** Signed `upload_url` the SDK PUT the video to (without the signature query). */
944
+ upload_url: string;
945
+ /** MIME type used in the PUT. */
946
+ content_type: string;
947
+ /** Recorded video duration in milliseconds, or `null` when unknown. */
948
+ duration_ms: number | null;
949
+ /** Recorded file size in bytes, or `null` when unknown. */
950
+ size_bytes: number | null;
890
951
  }
891
952
 
892
953
  /**