@idmission/websdk-ui 0.1.0-rc.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/README.md +189 -0
- package/dist/DocumentCaptureView.d.ts +111 -0
- package/dist/DocumentCaptureView.d.ts.map +1 -0
- package/dist/DocumentCaptureView.js +225 -0
- package/dist/FaceLivenessView.d.ts +88 -0
- package/dist/FaceLivenessView.d.ts.map +1 -0
- package/dist/FaceLivenessView.js +298 -0
- package/dist/IdCaptureView.d.ts +271 -0
- package/dist/IdCaptureView.d.ts.map +1 -0
- package/dist/IdCaptureView.js +454 -0
- package/dist/SelfieCaptureView.d.ts +119 -0
- package/dist/SelfieCaptureView.d.ts.map +1 -0
- package/dist/SelfieCaptureView.js +168 -0
- package/dist/SignatureCaptureView.d.ts +136 -0
- package/dist/SignatureCaptureView.d.ts.map +1 -0
- package/dist/SignatureCaptureView.js +521 -0
- package/dist/VideoIdCaptureView.d.ts +104 -0
- package/dist/VideoIdCaptureView.d.ts.map +1 -0
- package/dist/VideoIdCaptureView.js +253 -0
- package/dist/bindings/useDocumentCapture.d.ts +3 -0
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -0
- package/dist/bindings/useDocumentCapture.js +6 -0
- package/dist/bindings/useIdCapture.d.ts +5 -0
- package/dist/bindings/useIdCapture.d.ts.map +1 -0
- package/dist/bindings/useIdCapture.js +53 -0
- package/dist/bindings/useSelfieCapture.d.ts +5 -0
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -0
- package/dist/bindings/useSelfieCapture.js +53 -0
- package/dist/bindings/useSignatureCapture.d.ts +3 -0
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -0
- package/dist/bindings/useSignatureCapture.js +6 -0
- package/dist/bindings/useVideoIdCapture.d.ts +3 -0
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -0
- package/dist/bindings/useVideoIdCapture.js +6 -0
- package/dist/components/CameraFeed.d.ts +36 -0
- package/dist/components/CameraFeed.d.ts.map +1 -0
- package/dist/components/CameraFeed.js +74 -0
- package/dist/components/ExitCaptureButton.d.ts +6 -0
- package/dist/components/ExitCaptureButton.d.ts.map +1 -0
- package/dist/components/ExitCaptureButton.js +32 -0
- package/dist/components/GuidanceMessage.d.ts +25 -0
- package/dist/components/GuidanceMessage.d.ts.map +1 -0
- package/dist/components/GuidanceMessage.js +39 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts +20 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts.map +1 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.js +55 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts +41 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.js +118 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts +18 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.js +93 -0
- package/dist/components/additional_documents/sequence.d.ts +10 -0
- package/dist/components/additional_documents/sequence.d.ts.map +1 -0
- package/dist/components/additional_documents/sequence.js +11 -0
- package/dist/components/additional_documents/types.d.ts +15 -0
- package/dist/components/additional_documents/types.d.ts.map +1 -0
- package/dist/components/additional_documents/types.js +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +23 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.js +157 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts +7 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.js +58 -0
- package/dist/components/common/ButtonsRow.d.ts +2 -0
- package/dist/components/common/ButtonsRow.d.ts.map +1 -0
- package/dist/components/common/ButtonsRow.js +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts.map +1 -0
- package/dist/components/common/CapturedDocumentImg.js +31 -0
- package/dist/components/common/Card.d.ts +9 -0
- package/dist/components/common/Card.d.ts.map +1 -0
- package/dist/components/common/Card.js +16 -0
- package/dist/components/common/LoaderButton.d.ts +31 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -0
- package/dist/components/common/LoaderButton.js +444 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts +5 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts.map +1 -0
- package/dist/components/common/LoadingListItemIndicator.js +8 -0
- package/dist/components/common/animation.d.ts +5 -0
- package/dist/components/common/animation.d.ts.map +1 -0
- package/dist/components/common/animation.js +35 -0
- package/dist/components/common/downloadingLabel.d.ts +10 -0
- package/dist/components/common/downloadingLabel.d.ts.map +1 -0
- package/dist/components/common/downloadingLabel.js +15 -0
- package/dist/components/common/overlay.d.ts +142 -0
- package/dist/components/common/overlay.d.ts.map +1 -0
- package/dist/components/common/overlay.js +183 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts +37 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchFailure.js +38 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts +35 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchSuccess.js +44 -0
- package/dist/components/debug/debug.d.ts +91 -0
- package/dist/components/debug/debug.d.ts.map +1 -0
- package/dist/components/debug/debug.js +270 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +15 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.js +148 -0
- package/dist/components/document/guideRect.d.ts +11 -0
- package/dist/components/document/guideRect.d.ts.map +1 -0
- package/dist/components/document/guideRect.js +25 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -0
- package/dist/components/document/types.js +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +31 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.js +45 -0
- package/dist/components/error/ErrorScreen.d.ts +60 -0
- package/dist/components/error/ErrorScreen.d.ts.map +1 -0
- package/dist/components/error/ErrorScreen.js +150 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +35 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessFailure.js +30 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +31 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.js +56 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts +58 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureFallback.js +128 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts +75 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.js +205 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts +54 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/SelfieCaptureFallback.js +106 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts +5 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts.map +1 -0
- package/dist/components/fallback/fallbackInstructionStep.js +18 -0
- package/dist/components/fallback/readFile.d.ts +2 -0
- package/dist/components/fallback/readFile.d.ts.map +1 -0
- package/dist/components/fallback/readFile.js +14 -0
- package/dist/components/guide_images/backToFront.d.ts +3 -0
- package/dist/components/guide_images/backToFront.d.ts.map +1 -0
- package/dist/components/guide_images/backToFront.js +17 -0
- package/dist/components/guide_images/byUrl.d.ts +3 -0
- package/dist/components/guide_images/byUrl.d.ts.map +1 -0
- package/dist/components/guide_images/byUrl.js +6 -0
- package/dist/components/guide_images/defaults.d.ts +37 -0
- package/dist/components/guide_images/defaults.d.ts.map +1 -0
- package/dist/components/guide_images/defaults.js +37 -0
- package/dist/components/guide_images/index.d.ts +7 -0
- package/dist/components/guide_images/index.d.ts.map +1 -0
- package/dist/components/guide_images/index.js +5 -0
- package/dist/components/guide_images/orientation.d.ts +2 -0
- package/dist/components/guide_images/orientation.d.ts.map +1 -0
- package/dist/components/guide_images/orientation.js +5 -0
- package/dist/components/guide_images/types.d.ts +15 -0
- package/dist/components/guide_images/types.d.ts.map +1 -0
- package/dist/components/guide_images/types.js +1 -0
- package/dist/components/guide_images/useGuideImages.d.ts +3 -0
- package/dist/components/guide_images/useGuideImages.d.ts.map +1 -0
- package/dist/components/guide_images/useGuideImages.js +19 -0
- package/dist/components/guides/FlipIdPrompt.d.ts +28 -0
- package/dist/components/guides/FlipIdPrompt.d.ts.map +1 -0
- package/dist/components/guides/FlipIdPrompt.js +54 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts +51 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureFitGuide.js +199 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +100 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuideOverlay.js +137 -0
- package/dist/components/guides/IdCaptureGuides.d.ts +47 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuides.js +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuidesCommon.js +123 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.js +76 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts +134 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.js +13 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +196 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts +4 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.js +69 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.js +260 -0
- package/dist/components/loading/RingIntroScreen.d.ts +39 -0
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -0
- package/dist/components/loading/RingIntroScreen.js +216 -0
- package/dist/components/loading/RingProgress.d.ts +9 -0
- package/dist/components/loading/RingProgress.d.ts.map +1 -0
- package/dist/components/loading/RingProgress.js +24 -0
- package/dist/components/loading/RingStageTransition.d.ts +27 -0
- package/dist/components/loading/RingStageTransition.d.ts.map +1 -0
- package/dist/components/loading/RingStageTransition.js +145 -0
- package/dist/components/loading/customerSpinner.d.ts +58 -0
- package/dist/components/loading/customerSpinner.d.ts.map +1 -0
- package/dist/components/loading/customerSpinner.js +69 -0
- package/dist/components/loading/ringIntro.d.ts +15 -0
- package/dist/components/loading/ringIntro.d.ts.map +1 -0
- package/dist/components/loading/ringIntro.js +5 -0
- package/dist/components/loading/ringStatus.d.ts +8 -0
- package/dist/components/loading/ringStatus.d.ts.map +1 -0
- package/dist/components/loading/ringStatus.js +13 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts +8 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts.map +1 -0
- package/dist/components/loading/useAutoContinueWhenReady.js +25 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts +27 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts.map +1 -0
- package/dist/components/review/ReviewDiagnosticsPanel.js +475 -0
- package/dist/components/review/ReviewScreen.d.ts +34 -0
- package/dist/components/review/ReviewScreen.d.ts.map +1 -0
- package/dist/components/review/ReviewScreen.js +91 -0
- package/dist/components/ring/RingFailureScreen.d.ts +41 -0
- package/dist/components/ring/RingFailureScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFailureScreen.js +384 -0
- package/dist/components/ring/RingFinishingScreen.d.ts +27 -0
- package/dist/components/ring/RingFinishingScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFinishingScreen.js +184 -0
- package/dist/components/ring/RingSuccessScreen.d.ts +33 -0
- package/dist/components/ring/RingSuccessScreen.d.ts.map +1 -0
- package/dist/components/ring/RingSuccessScreen.js +185 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +17 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +39 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts +8 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCameraFeed.js +16 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +15 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +111 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts +4 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.js +28 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +126 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureSurface.js +248 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts +136 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.js +13 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +181 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.js +67 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.js +265 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +42 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -0
- package/dist/components/videoId/VideoIdCaptureGuides.js +173 -0
- package/dist/flows/AuthStateContext.d.ts +33 -0
- package/dist/flows/AuthStateContext.d.ts.map +1 -0
- package/dist/flows/AuthStateContext.js +47 -0
- package/dist/flows/CompositeWizard.d.ts +76 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -0
- package/dist/flows/CompositeWizard.js +200 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +28 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +138 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +47 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +231 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts +4 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdentificationFlow.js +11 -0
- package/dist/flows/CustomerVerificationFlow.d.ts +9 -0
- package/dist/flows/CustomerVerificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerVerificationFlow.js +17 -0
- package/dist/flows/DocumentCaptureFlow.d.ts +23 -0
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -0
- package/dist/flows/DocumentCaptureFlow.js +116 -0
- package/dist/flows/FaceValidationFlow.d.ts +12 -0
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/FaceValidationFlow.js +53 -0
- package/dist/flows/FlowChassis.d.ts +39 -0
- package/dist/flows/FlowChassis.d.ts.map +1 -0
- package/dist/flows/FlowChassis.js +69 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts +36 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdAndFaceValidationFlow.js +168 -0
- package/dist/flows/IdValidationFlow.d.ts +29 -0
- package/dist/flows/IdValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdValidationFlow.js +106 -0
- package/dist/flows/OrbStatusScreen.d.ts +14 -0
- package/dist/flows/OrbStatusScreen.d.ts.map +1 -0
- package/dist/flows/OrbStatusScreen.js +60 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts +6 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts.map +1 -0
- package/dist/flows/RemoteDiagnosticsMount.js +57 -0
- package/dist/flows/SignatureKYCFlow.d.ts +33 -0
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -0
- package/dist/flows/SignatureKYCFlow.js +228 -0
- package/dist/flows/SubmissionProvider.d.ts +40 -0
- package/dist/flows/SubmissionProvider.d.ts.map +1 -0
- package/dist/flows/SubmissionProvider.js +136 -0
- package/dist/flows/SubmissionSuccess.d.ts +48 -0
- package/dist/flows/SubmissionSuccess.d.ts.map +1 -0
- package/dist/flows/SubmissionSuccess.js +488 -0
- package/dist/flows/VideoIdValidationFlow.d.ts +61 -0
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -0
- package/dist/flows/VideoIdValidationFlow.js +171 -0
- package/dist/flows/additionalDocuments.d.ts +5 -0
- package/dist/flows/additionalDocuments.d.ts.map +1 -0
- package/dist/flows/additionalDocuments.js +26 -0
- package/dist/flows/artifacts.d.ts +8 -0
- package/dist/flows/artifacts.d.ts.map +1 -0
- package/dist/flows/artifacts.js +80 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts +53 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.js +211 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +94 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.js +209 -0
- package/dist/flows/customerMatch/adapters.d.ts +34 -0
- package/dist/flows/customerMatch/adapters.d.ts.map +1 -0
- package/dist/flows/customerMatch/adapters.js +63 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/identificationReducer.js +75 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/verificationReducer.js +77 -0
- package/dist/flows/documentCapture.d.ts +5 -0
- package/dist/flows/documentCapture.d.ts.map +1 -0
- package/dist/flows/documentCapture.js +8 -0
- package/dist/flows/jsonHighlight.d.ts +19 -0
- package/dist/flows/jsonHighlight.d.ts.map +1 -0
- package/dist/flows/jsonHighlight.js +90 -0
- package/dist/flows/overlays.d.ts +91 -0
- package/dist/flows/overlays.d.ts.map +1 -0
- package/dist/flows/overlays.js +150 -0
- package/dist/flows/ringIntroImplications.d.ts +30 -0
- package/dist/flows/ringIntroImplications.d.ts.map +1 -0
- package/dist/flows/ringIntroImplications.js +58 -0
- package/dist/flows/ringScreens.d.ts +27 -0
- package/dist/flows/ringScreens.d.ts.map +1 -0
- package/dist/flows/ringScreens.js +18 -0
- package/dist/flows/sequencer.d.ts +12 -0
- package/dist/flows/sequencer.d.ts.map +1 -0
- package/dist/flows/sequencer.js +18 -0
- package/dist/flows/sharedCamera.d.ts +23 -0
- package/dist/flows/sharedCamera.d.ts.map +1 -0
- package/dist/flows/sharedCamera.js +64 -0
- package/dist/flows/signatureStep.d.ts +25 -0
- package/dist/flows/signatureStep.d.ts.map +1 -0
- package/dist/flows/signatureStep.js +99 -0
- package/dist/flows/types.d.ts +106 -0
- package/dist/flows/types.d.ts.map +1 -0
- package/dist/flows/types.js +1 -0
- package/dist/flows/useGeolocation.d.ts +24 -0
- package/dist/flows/useGeolocation.d.ts.map +1 -0
- package/dist/flows/useGeolocation.js +82 -0
- package/dist/flows/useShowSuccessScreen.d.ts +3 -0
- package/dist/flows/useShowSuccessScreen.d.ts.map +1 -0
- package/dist/flows/useShowSuccessScreen.js +51 -0
- package/dist/flows/useTimeout.d.ts +7 -0
- package/dist/flows/useTimeout.d.ts.map +1 -0
- package/dist/flows/useTimeout.js +68 -0
- package/dist/flows/videoIdSteps.d.ts +33 -0
- package/dist/flows/videoIdSteps.d.ts.map +1 -0
- package/dist/flows/videoIdSteps.js +54 -0
- package/dist/guidance/selfieStrings.d.ts +18 -0
- package/dist/guidance/selfieStrings.d.ts.map +1 -0
- package/dist/guidance/selfieStrings.js +97 -0
- package/dist/guidance/strings.d.ts +4 -0
- package/dist/guidance/strings.d.ts.map +1 -0
- package/dist/guidance/strings.js +43 -0
- package/dist/guidance/videoIdStrings.d.ts +23 -0
- package/dist/guidance/videoIdStrings.d.ts.map +1 -0
- package/dist/guidance/videoIdStrings.js +23 -0
- package/dist/i18n/index.d.ts +1221 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +92 -0
- package/dist/i18n/locales/de.d.ts +149 -0
- package/dist/i18n/locales/de.d.ts.map +1 -0
- package/dist/i18n/locales/de.js +147 -0
- package/dist/i18n/locales/en.d.ts +3 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +149 -0
- package/dist/i18n/locales/es.d.ts.map +1 -0
- package/dist/i18n/locales/es.js +147 -0
- package/dist/i18n/locales/fr.d.ts +149 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -0
- package/dist/i18n/locales/fr.js +147 -0
- package/dist/i18n/locales/it.d.ts +149 -0
- package/dist/i18n/locales/it.d.ts.map +1 -0
- package/dist/i18n/locales/it.js +147 -0
- package/dist/i18n/locales/ja.d.ts +149 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -0
- package/dist/i18n/locales/ja.js +147 -0
- package/dist/i18n/locales/pt.d.ts +149 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -0
- package/dist/i18n/locales/pt.js +147 -0
- package/dist/i18n/locales/ru.d.ts +149 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -0
- package/dist/i18n/locales/ru.js +147 -0
- package/dist/i18n/locales/zh.d.ts +149 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -0
- package/dist/i18n/locales/zh.js +147 -0
- package/dist/i18n/render.d.ts +3 -0
- package/dist/i18n/render.d.ts.map +1 -0
- package/dist/i18n/render.js +7 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +191 -0
- package/dist/layout/GuideLayoutContext.d.ts +24 -0
- package/dist/layout/GuideLayoutContext.d.ts.map +1 -0
- package/dist/layout/GuideLayoutContext.js +19 -0
- package/dist/layout/GuideOrientationContext.d.ts +16 -0
- package/dist/layout/GuideOrientationContext.d.ts.map +1 -0
- package/dist/layout/GuideOrientationContext.js +40 -0
- package/dist/layout/useResizeObserver.d.ts +11 -0
- package/dist/layout/useResizeObserver.d.ts.map +1 -0
- package/dist/layout/useResizeObserver.js +114 -0
- package/dist/testing/alignGlobals.d.ts +2 -0
- package/dist/testing/alignGlobals.d.ts.map +1 -0
- package/dist/testing/alignGlobals.js +25 -0
- package/dist/testing/buildDocumentState.d.ts +4 -0
- package/dist/testing/buildDocumentState.d.ts.map +1 -0
- package/dist/testing/buildDocumentState.js +19 -0
- package/dist/testing/buildSelfieState.d.ts +8 -0
- package/dist/testing/buildSelfieState.d.ts.map +1 -0
- package/dist/testing/buildSelfieState.js +84 -0
- package/dist/testing/buildSignatureState.d.ts +3 -0
- package/dist/testing/buildSignatureState.d.ts.map +1 -0
- package/dist/testing/buildSignatureState.js +12 -0
- package/dist/testing/buildState.d.ts +3 -0
- package/dist/testing/buildState.d.ts.map +1 -0
- package/dist/testing/buildState.js +34 -0
- package/dist/testing/buildVideoIdState.d.ts +3 -0
- package/dist/testing/buildVideoIdState.d.ts.map +1 -0
- package/dist/testing/buildVideoIdState.js +11 -0
- package/dist/testing/classNamesLeaves.d.ts +14 -0
- package/dist/testing/classNamesLeaves.d.ts.map +1 -0
- package/dist/testing/classNamesLeaves.js +144 -0
- package/dist/testing/fakeClient.d.ts +61 -0
- package/dist/testing/fakeClient.d.ts.map +1 -0
- package/dist/testing/fakeClient.js +142 -0
- package/dist/testing/fakeController.d.ts +18 -0
- package/dist/testing/fakeController.d.ts.map +1 -0
- package/dist/testing/fakeController.js +165 -0
- package/dist/testing/fakeDocumentController.d.ts +37 -0
- package/dist/testing/fakeDocumentController.d.ts.map +1 -0
- package/dist/testing/fakeDocumentController.js +104 -0
- package/dist/testing/fakeSelfieController.d.ts +15 -0
- package/dist/testing/fakeSelfieController.d.ts.map +1 -0
- package/dist/testing/fakeSelfieController.js +154 -0
- package/dist/testing/fakeSignatureController.d.ts +12 -0
- package/dist/testing/fakeSignatureController.d.ts.map +1 -0
- package/dist/testing/fakeSignatureController.js +58 -0
- package/dist/testing/fakeVideoIdController.d.ts +12 -0
- package/dist/testing/fakeVideoIdController.d.ts.map +1 -0
- package/dist/testing/fakeVideoIdController.js +50 -0
- package/dist/testing/index.d.ts +15 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +18 -0
- package/dist/testing/stubSignatureCanvas.d.ts +2 -0
- package/dist/testing/stubSignatureCanvas.d.ts.map +1 -0
- package/dist/testing/stubSignatureCanvas.js +26 -0
- package/dist/testing/stubVideoCaptureDom.d.ts +2 -0
- package/dist/testing/stubVideoCaptureDom.d.ts.map +1 -0
- package/dist/testing/stubVideoCaptureDom.js +36 -0
- package/dist/theme/color.d.ts +14 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +1 -0
- package/dist/theme/index.d.ts +405 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +230 -0
- package/dist/utils/canvas.d.ts +3 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/canvas.js +16 -0
- package/dist/utils/cdn.d.ts +2 -0
- package/dist/utils/cdn.d.ts.map +1 -0
- package/dist/utils/cdn.js +3 -0
- package/dist/utils/cropping.d.ts +4 -0
- package/dist/utils/cropping.d.ts.map +1 -0
- package/dist/utils/cropping.js +11 -0
- package/dist/utils/flowClock.d.ts +6 -0
- package/dist/utils/flowClock.d.ts.map +1 -0
- package/dist/utils/flowClock.js +22 -0
- package/dist/utils/isMobile.d.ts +3 -0
- package/dist/utils/isMobile.d.ts.map +1 -0
- package/dist/utils/isMobile.js +35 -0
- package/dist/utils/loadProgressHooks.d.ts +25 -0
- package/dist/utils/loadProgressHooks.d.ts.map +1 -0
- package/dist/utils/loadProgressHooks.js +79 -0
- package/dist/utils/logger.d.ts +18 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/merge.d.ts +3 -0
- package/dist/utils/merge.d.ts.map +1 -0
- package/dist/utils/merge.js +23 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts +16 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts.map +1 -0
- package/dist/utils/signaturePadStrokeGuard.js +70 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/package.json +71 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { acquireCamera, } from '@idmission/websdk-core/camera';
|
|
2
|
+
/**
|
|
3
|
+
* Shares one camera acquisition across consecutive capture controllers.
|
|
4
|
+
* Each caller receives its own idempotent lease; the underlying camera is
|
|
5
|
+
* released only after every controller has detached.
|
|
6
|
+
*/
|
|
7
|
+
export function createSharedCameraAcquirer(baseAcquire = acquireCamera) {
|
|
8
|
+
let current = null;
|
|
9
|
+
let pending = null;
|
|
10
|
+
return async (video, options) => {
|
|
11
|
+
if (!current) {
|
|
12
|
+
pending ??= baseAcquire(video, options).then((acquired) => {
|
|
13
|
+
const shared = { acquired, leases: 0 };
|
|
14
|
+
current = shared;
|
|
15
|
+
return shared;
|
|
16
|
+
});
|
|
17
|
+
try {
|
|
18
|
+
current = await pending;
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
pending = null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const shared = current;
|
|
25
|
+
if (!shared) {
|
|
26
|
+
throw new Error('Shared camera acquisition did not produce a camera');
|
|
27
|
+
}
|
|
28
|
+
shared.leases += 1;
|
|
29
|
+
video.srcObject = shared.acquired.camera.stream;
|
|
30
|
+
let released = false;
|
|
31
|
+
return {
|
|
32
|
+
...shared.acquired,
|
|
33
|
+
release() {
|
|
34
|
+
if (released)
|
|
35
|
+
return;
|
|
36
|
+
released = true;
|
|
37
|
+
shared.leases -= 1;
|
|
38
|
+
if (current !== shared || shared.leases !== 0)
|
|
39
|
+
return;
|
|
40
|
+
current = null;
|
|
41
|
+
shared.acquired.release();
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Applies a flow-level `allowVirtualCameras` over a stage's camera options
|
|
48
|
+
* WITHOUT clobbering the stage's own setting when the flow prop is absent.
|
|
49
|
+
*
|
|
50
|
+
* The cascade-default trap this repo keeps hitting: a flow that destructured
|
|
51
|
+
* `allowVirtualCameras = false` and then spread it over `capture.camera`
|
|
52
|
+
* overwrote whatever the caller had put there — and the 2.x façade puts the
|
|
53
|
+
* customer's `allowVirtualCameras` in exactly that place (`mapCameraOptions`),
|
|
54
|
+
* so a 2.x integration that enabled virtual cameras had them silently
|
|
55
|
+
* disabled. The flow prop stays `undefined` when omitted; the stage's own
|
|
56
|
+
* value is the fallback.
|
|
57
|
+
*/
|
|
58
|
+
export function withVirtualCameras(camera, allowVirtualCameras) {
|
|
59
|
+
const base = { ...(camera ?? {}) };
|
|
60
|
+
if (allowVirtualCameras === undefined)
|
|
61
|
+
return base;
|
|
62
|
+
base.allowVirtualCameras = allowVirtualCameras;
|
|
63
|
+
return base;
|
|
64
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SignatureCaptureController } from '@idmission/websdk-core/signatureCapture';
|
|
2
|
+
import { type SignatureCaptureViewProps } from '../SignatureCaptureView';
|
|
3
|
+
import type { CompositeWizardStep } from './CompositeWizard';
|
|
4
|
+
/** sdk2's `boolean | (() => Promise<boolean>)` stage-inclusion prop shape. */
|
|
5
|
+
export type SignatureStageDecision = boolean | (() => Promise<boolean>);
|
|
6
|
+
export type SignatureFlowViewProps = Omit<SignatureCaptureViewProps, 'controller' | 'sessionReady' | 'onCompleted'>;
|
|
7
|
+
export type BuildSignatureStepOptions = {
|
|
8
|
+
captureSignature?: SignatureStageDecision;
|
|
9
|
+
captureSignatureVideo?: SignatureStageDecision;
|
|
10
|
+
controller: SignatureCaptureController;
|
|
11
|
+
view?: SignatureFlowViewProps;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* True when the flow must DROP its face-liveness stage because a video
|
|
15
|
+
* signature will supply the liveness instead (sdk2 CompositeWizard.tsx:182-185).
|
|
16
|
+
* Callers assemble their step list around this; an async
|
|
17
|
+
* `captureSignatureVideo` decision counts as "video signature requested",
|
|
18
|
+
* exactly as sdk2's `checks` memo does — it reads the prop's truthiness, not
|
|
19
|
+
* its resolved value.
|
|
20
|
+
*/
|
|
21
|
+
export declare function signatureStageReplacesFaceLiveness(captureSignatureVideo?: SignatureStageDecision): boolean;
|
|
22
|
+
/** The signature controller mode a given prop pair implies, or null for no stage. */
|
|
23
|
+
export declare function signatureStageMode(captureSignature?: SignatureStageDecision, captureSignatureVideo?: SignatureStageDecision): 'still' | 'video' | null;
|
|
24
|
+
export declare function buildSignatureStep({ captureSignature, captureSignatureVideo, controller, view, }: BuildSignatureStepOptions): CompositeWizardStep | null;
|
|
25
|
+
//# sourceMappingURL=signatureStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signatureStep.d.ts","sourceRoot":"","sources":["../../src/flows/signatureStep.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,8EAA8E;AAC9E,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAEvE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,yBAAyB,EACzB,YAAY,GAAG,cAAc,GAAG,aAAa,CAC9C,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,qBAAqB,CAAC,EAAE,sBAAsB,CAAA;IAC9C,UAAU,EAAE,0BAA0B,CAAA;IACtC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAC9B,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,qBAAqB,CAAC,EAAE,sBAAsB,GAC7C,OAAO,CAET;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,gBAAgB,CAAC,EAAE,sBAAsB,EACzC,qBAAqB,CAAC,EAAE,sBAAsB,GAC7C,OAAO,GAAG,OAAO,GAAG,IAAI,CAS1B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACV,IAAI,GACL,EAAE,yBAAyB,GAAG,mBAAmB,GAAG,IAAI,CAiBxD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The adapter between signature capture and the flow chassis, replacing sdk2's
|
|
3
|
+
// `CompositeWizardCheck = 'SignatureCapture' | 'VideoSignatureCapture'` stages
|
|
4
|
+
// (components/CompositeWizard.tsx:173-185).
|
|
5
|
+
//
|
|
6
|
+
// Workstream 02 built SignatureKYCFlow as a bespoke shared-camera stage machine
|
|
7
|
+
// and never extracted a reusable step, so the enrollment flows get one here —
|
|
8
|
+
// same shape as buildAdditionalDocumentsStep.
|
|
9
|
+
//
|
|
10
|
+
// Three sdk2 behaviors this preserves, all of them load-bearing:
|
|
11
|
+
// 1. `captureSignature` and `captureSignatureVideo` are MUTUALLY EXCLUSIVE
|
|
12
|
+
// (:173-177 throws). Still capture uses the controller's 'still' mode;
|
|
13
|
+
// video capture uses 'video'.
|
|
14
|
+
// 2. Either prop may be an async decision (`() => Promise<boolean>`) resolved
|
|
15
|
+
// when the stage becomes current; resolving false SKIPS the stage
|
|
16
|
+
// (:243-265). Because the chassis only mounts the current step, that
|
|
17
|
+
// resolution happens on mount here.
|
|
18
|
+
// 3. `captureSignatureVideo` REMOVES the face-liveness stage — "video
|
|
19
|
+
// signature already has it" (:182-185). That is the CALLER's business
|
|
20
|
+
// (the step list is assembled by the flow), so it is enforced by
|
|
21
|
+
// `signatureStageReplacesFaceLiveness` below rather than here.
|
|
22
|
+
//
|
|
23
|
+
// One deliberate divergence, matching the additional-documents port: sdk2 has
|
|
24
|
+
// no `catch` on the decision promise, so a rejection left the wizard stuck on a
|
|
25
|
+
// stage it could neither run nor skip. A rejection is treated as "do not skip"
|
|
26
|
+
// and logged.
|
|
27
|
+
import { useEffect, useRef, useState } from 'react';
|
|
28
|
+
import { SignatureCaptureView, } from '../SignatureCaptureView';
|
|
29
|
+
import { warn } from '../utils/logger';
|
|
30
|
+
/**
|
|
31
|
+
* True when the flow must DROP its face-liveness stage because a video
|
|
32
|
+
* signature will supply the liveness instead (sdk2 CompositeWizard.tsx:182-185).
|
|
33
|
+
* Callers assemble their step list around this; an async
|
|
34
|
+
* `captureSignatureVideo` decision counts as "video signature requested",
|
|
35
|
+
* exactly as sdk2's `checks` memo does — it reads the prop's truthiness, not
|
|
36
|
+
* its resolved value.
|
|
37
|
+
*/
|
|
38
|
+
export function signatureStageReplacesFaceLiveness(captureSignatureVideo) {
|
|
39
|
+
return Boolean(captureSignatureVideo);
|
|
40
|
+
}
|
|
41
|
+
/** The signature controller mode a given prop pair implies, or null for no stage. */
|
|
42
|
+
export function signatureStageMode(captureSignature, captureSignatureVideo) {
|
|
43
|
+
if (captureSignature && captureSignatureVideo) {
|
|
44
|
+
throw new Error('captureSignature and captureSignatureVideo cannot be used together');
|
|
45
|
+
}
|
|
46
|
+
if (captureSignature)
|
|
47
|
+
return 'still';
|
|
48
|
+
if (captureSignatureVideo)
|
|
49
|
+
return 'video';
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
export function buildSignatureStep({ captureSignature, captureSignatureVideo, controller, view, }) {
|
|
53
|
+
const mode = signatureStageMode(captureSignature, captureSignatureVideo);
|
|
54
|
+
if (!mode)
|
|
55
|
+
return null;
|
|
56
|
+
const decision = mode === 'still' ? captureSignature : captureSignatureVideo;
|
|
57
|
+
return {
|
|
58
|
+
id: mode === 'still' ? 'signature-capture' : 'video-signature-capture',
|
|
59
|
+
render: (complete) => (_jsx(SignatureStage, { controller: controller, decision: decision, view: view, onComplete: complete })),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function SignatureStage({ controller, decision, view, onComplete, }) {
|
|
63
|
+
// `true` needs no resolution; a callback is resolved once, on mount.
|
|
64
|
+
const [included, setIncluded] = useState(typeof decision !== 'function');
|
|
65
|
+
const resolvedRef = useRef(false);
|
|
66
|
+
const onCompleteRef = useRef(onComplete);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
onCompleteRef.current = onComplete;
|
|
69
|
+
}, [onComplete]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (typeof decision !== 'function')
|
|
72
|
+
return;
|
|
73
|
+
// Invocation guard, same reasoning as AdditionalDocumentCaptureWizard's:
|
|
74
|
+
// StrictMode mounts effects twice and the decision may be a network call.
|
|
75
|
+
if (resolvedRef.current)
|
|
76
|
+
return;
|
|
77
|
+
resolvedRef.current = true;
|
|
78
|
+
let active = true;
|
|
79
|
+
void decision().then((shouldProceed) => {
|
|
80
|
+
if (!active)
|
|
81
|
+
return;
|
|
82
|
+
if (shouldProceed)
|
|
83
|
+
setIncluded(true);
|
|
84
|
+
else
|
|
85
|
+
onCompleteRef.current();
|
|
86
|
+
}, (cause) => {
|
|
87
|
+
if (!active)
|
|
88
|
+
return;
|
|
89
|
+
warn('[websdk-ui] signature stage decision rejected; capturing anyway', cause);
|
|
90
|
+
setIncluded(true);
|
|
91
|
+
});
|
|
92
|
+
return () => {
|
|
93
|
+
active = false;
|
|
94
|
+
};
|
|
95
|
+
}, [decision]);
|
|
96
|
+
if (!included)
|
|
97
|
+
return null;
|
|
98
|
+
return (_jsx(SignatureCaptureView, { ...view, controller: controller, onCompleted: onComplete }));
|
|
99
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IdmissionClient, LivenessOptions, SubmissionArtifacts, SubmissionOptions, SubmissionResponse } from '@idmission/websdk-core/client';
|
|
3
|
+
import type { IdCaptureController, IdCaptureControllerConfig } from '@idmission/websdk-core/idCapture';
|
|
4
|
+
import type { SelfieCaptureController, SelfieCaptureControllerConfig, SelfieLivenessConfig } from '@idmission/websdk-core/selfieCapture';
|
|
5
|
+
import type { RemoteDiagnostics } from '@idmission/websdk-core/diagnostics';
|
|
6
|
+
import type { RingFinishingScreenClassNames } from '../components/ring/RingFinishingScreen';
|
|
7
|
+
import type { RingSuccessScreenClassNames } from '../components/ring/RingSuccessScreen';
|
|
8
|
+
import type { ThemeInput } from '../theme';
|
|
9
|
+
import type { IdCaptureViewProps } from '../IdCaptureView';
|
|
10
|
+
import type { FaceLivenessViewProps } from '../FaceLivenessView';
|
|
11
|
+
import type { SelfieCaptureViewProps } from '../SelfieCaptureView';
|
|
12
|
+
import type { DocumentCaptureViewProps } from '../DocumentCaptureView';
|
|
13
|
+
import type { AdditionalDocument } from '../components/additional_documents/types';
|
|
14
|
+
import type { AdditionalDocumentCaptureWizardClassNames } from '../components/additional_documents/AdditionalDocumentCaptureWizard';
|
|
15
|
+
import type { SubmissionCallbacks } from './SubmissionProvider';
|
|
16
|
+
import type { LoadingSpinnerComponent } from './OrbStatusScreen';
|
|
17
|
+
export type FlowSubmissionConfig = Omit<SubmissionOptions, 'action'>;
|
|
18
|
+
export type FlowResultCallbacks = SubmissionCallbacks & {
|
|
19
|
+
onSubmitted?: (response: SubmissionResponse) => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The three `FlowChassis` gates every flow re-exposes verbatim.
|
|
23
|
+
*
|
|
24
|
+
* They live on the chassis (one geolocation acquisition, one diagnostics
|
|
25
|
+
* mount), but 2.x declares all three on all ten flows, so every flow has to
|
|
26
|
+
* offer them or the compat façade has nowhere to map them to.
|
|
27
|
+
*/
|
|
28
|
+
export type FlowChassisPassthroughProps = {
|
|
29
|
+
/**
|
|
30
|
+
* Attempt to acquire the user's location for the submission payload.
|
|
31
|
+
* Default `true`, matching 2.x.
|
|
32
|
+
*/
|
|
33
|
+
geolocationEnabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Treat a location denial as fatal: the user cannot capture until they grant
|
|
36
|
+
* permission, exactly like camera access. Default `false`, matching 2.x.
|
|
37
|
+
*/
|
|
38
|
+
geolocationRequired?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Opt-in breadcrumbs, crash capture, and a model-load watchdog. Off unless
|
|
41
|
+
* `enabled` is set.
|
|
42
|
+
*/
|
|
43
|
+
remoteDiagnostics?: RemoteDiagnostics;
|
|
44
|
+
/** Replaces the animated orb during session validation and submission.
|
|
45
|
+
* Status text and screen-reader announcements remain owned by the SDK. */
|
|
46
|
+
loadingSpinner?: LoadingSpinnerComponent;
|
|
47
|
+
};
|
|
48
|
+
export type CommonFlowProps = FlowResultCallbacks & FlowChassisPassthroughProps & {
|
|
49
|
+
client: IdmissionClient;
|
|
50
|
+
submission?: FlowSubmissionConfig;
|
|
51
|
+
initialArtifacts?: SubmissionArtifacts;
|
|
52
|
+
theme?: ThemeInput;
|
|
53
|
+
className?: string;
|
|
54
|
+
showSuccessScreen?: boolean;
|
|
55
|
+
/** Show the full submission response on the success screen. May contain PII. */
|
|
56
|
+
showDiagnostics?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Documents the user is asked to supply from device storage after every
|
|
59
|
+
* camera capture step. Appended last, matching sdk2's stage ordering. An
|
|
60
|
+
* empty or omitted list adds no step at all.
|
|
61
|
+
*/
|
|
62
|
+
captureAdditionalDocuments?: readonly AdditionalDocument[];
|
|
63
|
+
/**
|
|
64
|
+
* Customer classes for that step's screen (sdk2
|
|
65
|
+
* `classNames.additionalDocumentCapture`). Flow-level for the same reason
|
|
66
|
+
* the document list is: the step belongs to the flow, not to a capture stage.
|
|
67
|
+
*/
|
|
68
|
+
additionalDocumentClassNames?: AdditionalDocumentCaptureWizardClassNames;
|
|
69
|
+
/**
|
|
70
|
+
* Customer classes for the two ring-mode terminal screens (sdk2
|
|
71
|
+
* `classNames.finishingScreen` / `classNames.successScreen`). Every flow
|
|
72
|
+
* hands these to `buildRingScreenProps`; they are flow-level rather than
|
|
73
|
+
* per-stage because the screens belong to the submission, not to a capture.
|
|
74
|
+
*/
|
|
75
|
+
ringScreenClassNames?: RingScreenClassNames;
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
};
|
|
78
|
+
export type RingScreenClassNames = {
|
|
79
|
+
finishingScreen?: RingFinishingScreenClassNames;
|
|
80
|
+
successScreen?: RingSuccessScreenClassNames;
|
|
81
|
+
};
|
|
82
|
+
export type IdCaptureFlowConfig = Omit<IdCaptureControllerConfig, 'client' | 'submission'>;
|
|
83
|
+
export type IdCaptureFlowViewProps = Omit<IdCaptureViewProps, 'controller' | 'sessionReady' | 'onCollected' | 'onSubmitted'>;
|
|
84
|
+
export type FaceLivenessFlowConfig = Omit<SelfieCaptureControllerConfig, 'liveness'> & {
|
|
85
|
+
liveness?: Omit<SelfieLivenessConfig, 'checkLiveness'>;
|
|
86
|
+
checkLivenessOptions?: Omit<LivenessOptions, 'softFail'>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Controller config for flows that run PLAIN selfie capture and drive the
|
|
90
|
+
* live-check themselves (customer identification/verification) rather than
|
|
91
|
+
* handing the controller a `liveness` config. Omitting `liveness` is what keeps
|
|
92
|
+
* those flows off the challenge-response liveness machine `FaceLivenessView`
|
|
93
|
+
* uses; `checkLivenessOptions` still reaches the flow's own
|
|
94
|
+
* `client.checkLiveness` call.
|
|
95
|
+
*/
|
|
96
|
+
export type SelfieCaptureFlowConfig = Omit<SelfieCaptureControllerConfig, 'liveness'> & {
|
|
97
|
+
checkLivenessOptions?: Omit<LivenessOptions, 'softFail'>;
|
|
98
|
+
};
|
|
99
|
+
export type FaceLivenessFlowViewProps = Omit<FaceLivenessViewProps, 'controller' | 'sessionReady' | 'onDone'>;
|
|
100
|
+
export type SelfieFlowViewProps = Omit<SelfieCaptureViewProps, 'controller' | 'sessionReady' | 'onCaptured'>;
|
|
101
|
+
export type DocumentCaptureFlowViewProps = Omit<DocumentCaptureViewProps, 'controller' | 'sessionReady' | 'onCompleted'>;
|
|
102
|
+
export type ControllerOverrides = {
|
|
103
|
+
idController?: IdCaptureController;
|
|
104
|
+
selfieController?: SelfieCaptureController;
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/flows/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type GeolocationGateState = {
|
|
2
|
+
/** Resolved position, or null while pending / unavailable. */
|
|
3
|
+
position: GeolocationPosition | null;
|
|
4
|
+
/**
|
|
5
|
+
* The user actively DENIED permission (PositionError.code === 1). Distinct
|
|
6
|
+
* from "no position yet": only a denial can hard-gate capture, because a
|
|
7
|
+
* timeout or a device with no GPS is not the user's refusal.
|
|
8
|
+
*/
|
|
9
|
+
blocked: boolean;
|
|
10
|
+
/** Re-arms the acquisition effect; wired to the overlay's retry button. */
|
|
11
|
+
retry: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Ports sdk2's geolocation acquisition (SubmissionProvider.tsx:587-590 state
|
|
15
|
+
* triple, :1590-1606 effect) into the v3 flow chassis, where one copy serves
|
|
16
|
+
* all ten flows instead of ten copies of the same three `useState`s.
|
|
17
|
+
*
|
|
18
|
+
* Acquisition is separate from enforcement on purpose: this hook always tries
|
|
19
|
+
* when enabled, and `geolocationRequired` decides whether a denial blocks
|
|
20
|
+
* capture. That mirrors 2.x, where a flow could collect location opportunis-
|
|
21
|
+
* tically for the submission payload without making it a precondition.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useGeolocation(enabled: boolean): GeolocationGateState;
|
|
24
|
+
//# sourceMappingURL=useGeolocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGeolocation.d.ts","sourceRoot":"","sources":["../../src/flows/useGeolocation.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CA8ErE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { error, log } from '../utils/logger';
|
|
3
|
+
/**
|
|
4
|
+
* Ports sdk2's geolocation acquisition (SubmissionProvider.tsx:587-590 state
|
|
5
|
+
* triple, :1590-1606 effect) into the v3 flow chassis, where one copy serves
|
|
6
|
+
* all ten flows instead of ten copies of the same three `useState`s.
|
|
7
|
+
*
|
|
8
|
+
* Acquisition is separate from enforcement on purpose: this hook always tries
|
|
9
|
+
* when enabled, and `geolocationRequired` decides whether a denial blocks
|
|
10
|
+
* capture. That mirrors 2.x, where a flow could collect location opportunis-
|
|
11
|
+
* tically for the submission payload without making it a precondition.
|
|
12
|
+
*/
|
|
13
|
+
export function useGeolocation(enabled) {
|
|
14
|
+
const [position, setPosition] = useState(null);
|
|
15
|
+
const [attempts, setAttempts] = useState(0);
|
|
16
|
+
const [blocked, setBlocked] = useState(false);
|
|
17
|
+
const retry = useCallback(() => setAttempts((n) => n + 1), []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// Acquisition turned off: drop any position already held, so a flow that
|
|
20
|
+
// disables it mid-session cannot keep shipping a stale fix in the
|
|
21
|
+
// submission metadata.
|
|
22
|
+
if (!enabled) {
|
|
23
|
+
setPosition(null);
|
|
24
|
+
setBlocked(false);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// Guards a late callback from a superseded attempt (a retry, or a disable)
|
|
28
|
+
// from writing state that no longer reflects the current request.
|
|
29
|
+
let active = true;
|
|
30
|
+
// `navigator.geolocation` is not universally present: browsers omit it in
|
|
31
|
+
// non-secure contexts, and it is absent under jsdom. sdk2 dereferenced it
|
|
32
|
+
// unguarded, which never surfaced there because nothing rendered the
|
|
33
|
+
// provider outside a real page — here it would take down every flow.
|
|
34
|
+
// Treated as "no position available", never as a denial.
|
|
35
|
+
//
|
|
36
|
+
// `typeof navigator`, not `globalThis.navigator`: this module is bundled
|
|
37
|
+
// into the ES5 UMD artifact loader.js serves, and `globalThis` is ES2020 —
|
|
38
|
+
// an unguarded reference is a ReferenceError on any engine old enough to
|
|
39
|
+
// need the ES5 build in the first place.
|
|
40
|
+
const geolocation = typeof navigator === 'undefined' ? undefined : navigator.geolocation;
|
|
41
|
+
if (!geolocation) {
|
|
42
|
+
log('geolocation unavailable in this context; continuing without it');
|
|
43
|
+
// Not a refusal, so it must never leave the gate closed.
|
|
44
|
+
setBlocked(false);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
log('making geolocation attempt', attempts);
|
|
48
|
+
geolocation.getCurrentPosition((result) => {
|
|
49
|
+
if (!active)
|
|
50
|
+
return;
|
|
51
|
+
setPosition(result);
|
|
52
|
+
setBlocked(false);
|
|
53
|
+
}, (positionError) => {
|
|
54
|
+
if (!active)
|
|
55
|
+
return;
|
|
56
|
+
if (positionError.code === 1) {
|
|
57
|
+
setBlocked(true);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// DIVERGENCE from sdk2 (SubmissionProvider.tsx:1600), recorded for the
|
|
61
|
+
// ledger: sdk2 does `throw new Error(positionError.message)` here.
|
|
62
|
+
// That throw is inert in a browser only because geolocation dispatches
|
|
63
|
+
// its callbacks asynchronously, so it escapes as an uncaught error
|
|
64
|
+
// event and never unwinds anything. Re-raising it from inside an
|
|
65
|
+
// effect is a real crash risk the moment the callback runs
|
|
66
|
+
// synchronously, which is exactly what happens under test doubles.
|
|
67
|
+
// Log instead: same diagnostic signal, no timing-dependent failure.
|
|
68
|
+
//
|
|
69
|
+
// POSITION_UNAVAILABLE (2) and TIMEOUT (3) deliberately do NOT block —
|
|
70
|
+
// a device with no GPS never refused anything, and gating capture on it
|
|
71
|
+
// would lock out users who were never asked. Clearing here matters on a
|
|
72
|
+
// RETRY after a denial: without it the overlay would stay up reporting
|
|
73
|
+
// a refusal the user has already moved past.
|
|
74
|
+
setBlocked(false);
|
|
75
|
+
error('geolocation attempt failed', positionError.message);
|
|
76
|
+
});
|
|
77
|
+
return () => {
|
|
78
|
+
active = false;
|
|
79
|
+
};
|
|
80
|
+
}, [attempts, enabled]);
|
|
81
|
+
return { position, blocked, retry };
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShowSuccessScreen.d.ts","sourceRoot":"","sources":["../../src/flows/useShowSuccessScreen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAElE,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,OAAO,EAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAwDT"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
export function useShowSuccessScreen(skipSuccessScreen, successScreenReady, onDone) {
|
|
3
|
+
const [showAfterResolution, setShowAfterResolution] = useState(false);
|
|
4
|
+
const completionHandledRef = useRef(false);
|
|
5
|
+
const onDoneRef = useRef(onDone);
|
|
6
|
+
const skipCallbackRef = useRef(typeof skipSuccessScreen === 'function' ? skipSuccessScreen : null);
|
|
7
|
+
const skipMode = typeof skipSuccessScreen === 'function'
|
|
8
|
+
? 'callback'
|
|
9
|
+
: skipSuccessScreen
|
|
10
|
+
? 'always'
|
|
11
|
+
: 'never';
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
onDoneRef.current = onDone;
|
|
14
|
+
}, [onDone]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (typeof skipSuccessScreen === 'function') {
|
|
17
|
+
skipCallbackRef.current = skipSuccessScreen;
|
|
18
|
+
}
|
|
19
|
+
}, [skipSuccessScreen]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let active = true;
|
|
22
|
+
if (!successScreenReady ||
|
|
23
|
+
skipMode === 'never' ||
|
|
24
|
+
completionHandledRef.current) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
completionHandledRef.current = true;
|
|
28
|
+
if (skipMode === 'always') {
|
|
29
|
+
onDoneRef.current?.();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const resolveSkip = skipCallbackRef.current;
|
|
33
|
+
if (!resolveSkip)
|
|
34
|
+
return;
|
|
35
|
+
void resolveSkip().then((skip) => {
|
|
36
|
+
if (!active)
|
|
37
|
+
return;
|
|
38
|
+
if (skip)
|
|
39
|
+
onDoneRef.current?.();
|
|
40
|
+
else
|
|
41
|
+
setShowAfterResolution(true);
|
|
42
|
+
}, () => {
|
|
43
|
+
if (active)
|
|
44
|
+
setShowAfterResolution(true);
|
|
45
|
+
});
|
|
46
|
+
return () => {
|
|
47
|
+
active = false;
|
|
48
|
+
};
|
|
49
|
+
}, [skipMode, successScreenReady]);
|
|
50
|
+
return !skipSuccessScreen || showAfterResolution;
|
|
51
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** sdk2 useTimeout.ts:38 — the hardcoded `shouldWaitLonger` grace window. */
|
|
2
|
+
export declare const TIMEOUT_WAIT_LONGER_MS = 120000;
|
|
3
|
+
export declare const useTimeout: (durationMs?: number, onTimeout?: () => void, timeoutAverted?: boolean, shouldWaitLonger?: boolean, shouldStart?: boolean, resetKey?: unknown) => {
|
|
4
|
+
timedOut: boolean;
|
|
5
|
+
timeoutStartedAt: Date | null;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useTimeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimeout.d.ts","sourceRoot":"","sources":["../../src/flows/useTimeout.ts"],"names":[],"mappings":"AAiBA,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,YAAY,MAAM,IAAI,EACtB,iBAAiB,OAAO,EACxB,mBAAmB,OAAO,EAC1B,cAAa,OAAc,EAG3B,WAAW,OAAO;;;CAsDnB,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Ported from sdk2/src/lib/utils/useTimeout.ts.
|
|
2
|
+
//
|
|
3
|
+
// Why the flow layer needs its own copy: core's selfie controller arms a
|
|
4
|
+
// kick-out timer only when it was created with a `liveness` config
|
|
5
|
+
// (selfieCapture/controller.ts's attach path). The customer
|
|
6
|
+
// identification/verification flows deliberately run a liveness-LESS controller
|
|
7
|
+
// — plain selfie capture plus a softFail /live-check — so nothing in core
|
|
8
|
+
// implements their `captureGuidanceTimeoutDurationMs` prop. sdk2 drove it from
|
|
9
|
+
// this hook (CustomerIdentificationCapture.tsx:215-220), and so do we.
|
|
10
|
+
//
|
|
11
|
+
// Two behaviors that look like bugs but are the source's, kept for parity:
|
|
12
|
+
// - `shouldWaitLonger` grants a HARDCODED 120s grace, not a caller-supplied
|
|
13
|
+
// one, so a slow backend can't boot a user mid-check.
|
|
14
|
+
// - The countdown effect does not depend on `timeoutAverted`; averting stops
|
|
15
|
+
// the callback from firing but never cancels the underlying timer.
|
|
16
|
+
import { useEffect, useRef, useState } from 'react';
|
|
17
|
+
/** sdk2 useTimeout.ts:38 — the hardcoded `shouldWaitLonger` grace window. */
|
|
18
|
+
export const TIMEOUT_WAIT_LONGER_MS = 120000;
|
|
19
|
+
export const useTimeout = (durationMs, onTimeout, timeoutAverted, shouldWaitLonger, shouldStart = true,
|
|
20
|
+
// When this value changes the countdown restarts from zero (e.g. reset the
|
|
21
|
+
// kick-out timer after each completed instruction). Omit for a single timer.
|
|
22
|
+
resetKey) => {
|
|
23
|
+
const [timedOut, setTimedOut] = useState(false);
|
|
24
|
+
const [timeoutStartedAt, setTimeoutStartedAt] = useState(null);
|
|
25
|
+
// Callers pass an inline arrow, so `onTimeout`'s identity changes on every
|
|
26
|
+
// render. Depending on it directly meant the delivery effect below re-ran
|
|
27
|
+
// while `timedOut` was still true, which either fired the callback again on
|
|
28
|
+
// each render or restarted the 120s grace so it could never elapse. The ref
|
|
29
|
+
// keeps delivery on the LATEST callback without making identity a trigger.
|
|
30
|
+
const onTimeoutRef = useRef(onTimeout);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
onTimeoutRef.current = onTimeout;
|
|
33
|
+
});
|
|
34
|
+
// One delivery per countdown; reset whenever a new countdown begins.
|
|
35
|
+
const deliveredRef = useRef(false);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!durationMs || !shouldStart)
|
|
38
|
+
return;
|
|
39
|
+
deliveredRef.current = false;
|
|
40
|
+
setTimedOut(false);
|
|
41
|
+
setTimeoutStartedAt(new Date());
|
|
42
|
+
const timer = setTimeout(() => {
|
|
43
|
+
setTimedOut(true);
|
|
44
|
+
}, durationMs);
|
|
45
|
+
return () => {
|
|
46
|
+
clearTimeout(timer);
|
|
47
|
+
};
|
|
48
|
+
// `resetKey` is the documented restart seam: it is not read inside the
|
|
49
|
+
// effect, it only forces a re-run.
|
|
50
|
+
}, [durationMs, shouldStart, resetKey]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!timedOut || timeoutAverted || deliveredRef.current)
|
|
53
|
+
return;
|
|
54
|
+
const deliver = () => {
|
|
55
|
+
deliveredRef.current = true;
|
|
56
|
+
onTimeoutRef.current?.();
|
|
57
|
+
};
|
|
58
|
+
if (!shouldWaitLonger) {
|
|
59
|
+
deliver();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const t = setTimeout(deliver, TIMEOUT_WAIT_LONGER_MS);
|
|
63
|
+
return () => {
|
|
64
|
+
clearTimeout(t);
|
|
65
|
+
};
|
|
66
|
+
}, [shouldWaitLonger, timedOut, timeoutAverted]);
|
|
67
|
+
return { timedOut, timeoutStartedAt };
|
|
68
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IdCaptureController } from '@idmission/websdk-core/idCapture';
|
|
2
|
+
import type { SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
|
|
3
|
+
import type { VideoIdCaptureController } from '@idmission/websdk-core/videoIdCapture';
|
|
4
|
+
import { type VideoIdCaptureViewProps } from '../VideoIdCaptureView';
|
|
5
|
+
import type { CompositeWizardStep } from './CompositeWizard';
|
|
6
|
+
import type { FaceLivenessFlowViewProps, IdCaptureFlowViewProps } from './types';
|
|
7
|
+
export type VideoIdFlowViewProps = Omit<VideoIdCaptureViewProps, 'controller' | 'sessionReady' | 'onCompleted'>;
|
|
8
|
+
export type BuildVideoIdStepsOptions = {
|
|
9
|
+
idController: IdCaptureController;
|
|
10
|
+
selfieController: SelfieCaptureController;
|
|
11
|
+
videoController: VideoIdCaptureController;
|
|
12
|
+
idView?: IdCaptureFlowViewProps;
|
|
13
|
+
faceView?: FaceLivenessFlowViewProps;
|
|
14
|
+
view?: VideoIdFlowViewProps;
|
|
15
|
+
onCaptureError?: (error: Error) => void;
|
|
16
|
+
/**
|
|
17
|
+
* False drops the face-liveness stage, leaving ID capture -> recording.
|
|
18
|
+
* sdk2's `captureSignatureVideo` rule: the video signature establishes the
|
|
19
|
+
* liveness, so running the face stage as well asks the user to prove it
|
|
20
|
+
* twice (CompositeWizard.tsx:182-185). Defaults to true.
|
|
21
|
+
*/
|
|
22
|
+
includeFaceLiveness?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* False drops the ID-capture stage, leaving face liveness -> recording.
|
|
25
|
+
* sdk2's `skipIdCapture`. Defaults to true.
|
|
26
|
+
*/
|
|
27
|
+
includeIdCapture?: boolean;
|
|
28
|
+
/** The read-aloud sentence; its presence renders sdk2's prompt stage. */
|
|
29
|
+
readTextPrompt?: VideoIdCaptureViewProps['readTextPrompt'];
|
|
30
|
+
onMicrophoneAccessDenied?: () => void;
|
|
31
|
+
};
|
|
32
|
+
export declare function buildVideoIdSteps({ idController, selfieController, videoController, idView, faceView, view, onCaptureError, includeFaceLiveness, includeIdCapture, readTextPrompt, onMicrophoneAccessDenied, }: BuildVideoIdStepsOptions): CompositeWizardStep[];
|
|
33
|
+
//# sourceMappingURL=videoIdSteps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoIdSteps.d.ts","sourceRoot":"","sources":["../../src/flows/videoIdSteps.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAGrF,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EACV,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,uBAAuB,EACvB,YAAY,GAAG,cAAc,GAAG,aAAa,CAC9C,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,EAAE,mBAAmB,CAAA;IACjC,gBAAgB,EAAE,uBAAuB,CAAA;IACzC,eAAe,EAAE,wBAAwB,CAAA;IACzC,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAC/B,QAAQ,CAAC,EAAE,yBAAyB,CAAA;IACpC,IAAI,CAAC,EAAE,oBAAoB,CAAA;IAC3B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IACvC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yEAAyE;IACzE,cAAc,CAAC,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAC1D,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAA;CACtC,CAAA;AAMD,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,MAAsB,EACtB,QAA0B,EAC1B,IAAuB,EACvB,cAAc,EACd,mBAA0B,EAC1B,gBAAuB,EACvB,cAAc,EACd,wBAAwB,GACzB,EAAE,wBAAwB,GAAG,mBAAmB,EAAE,CAoFlD"}
|