@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,231 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Port of sdk2's CustomerIdAndBiometricsEnrollment: enroll a customer's ID
|
|
3
|
+
// document AND biometrics in one submission against /v4/customer/enroll.
|
|
4
|
+
//
|
|
5
|
+
// TWO stage-substitution rules from sdk2's CompositeWizard drive the step list,
|
|
6
|
+
// and they compose:
|
|
7
|
+
// - `captureVideoId` swaps ['IdCapture', 'FaceLiveness'] for the video-ID
|
|
8
|
+
// sequence (CustomerIdAndBiometricsEnrollment.tsx:824-827).
|
|
9
|
+
// - `captureSignatureVideo` REMOVES the face-liveness stage, because the
|
|
10
|
+
// video signature establishes liveness itself (CompositeWizard.tsx:182-185).
|
|
11
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
12
|
+
import { SubmissionAction, } from '@idmission/websdk-core/client';
|
|
13
|
+
import { acquireCamera } from '@idmission/websdk-core/camera';
|
|
14
|
+
import { createIdCaptureController, } from '@idmission/websdk-core/idCapture';
|
|
15
|
+
import { createSelfieCaptureController, } from '@idmission/websdk-core/selfieCapture';
|
|
16
|
+
import { createSignatureCaptureController, } from '@idmission/websdk-core/signatureCapture';
|
|
17
|
+
import { createVideoIdCaptureController, } from '@idmission/websdk-core/videoIdCapture';
|
|
18
|
+
import { FaceLivenessView } from '../FaceLivenessView';
|
|
19
|
+
import { IdCaptureView } from '../IdCaptureView';
|
|
20
|
+
import { CompositeWizard } from './CompositeWizard';
|
|
21
|
+
import { buildAdditionalDocumentsStep } from './additionalDocuments';
|
|
22
|
+
import { buildSelfieArtifacts } from './artifacts';
|
|
23
|
+
import { FlowChassis } from './FlowChassis';
|
|
24
|
+
import { buildRingScreenProps } from './ringScreens';
|
|
25
|
+
import { impliedAutoContinueAfterLoading, impliedSkipSuccessScreen, isRingIntroActive, isRingModeActive, } from './ringIntroImplications';
|
|
26
|
+
import { OrbStatusScreen } from './OrbStatusScreen';
|
|
27
|
+
import { createSharedCameraAcquirer, withVirtualCameras, } from './sharedCamera';
|
|
28
|
+
import { buildSignatureStep, signatureStageMode, signatureStageReplacesFaceLiveness, } from './signatureStep';
|
|
29
|
+
import { buildVideoIdSteps } from './videoIdSteps';
|
|
30
|
+
import { warn } from '../utils/logger';
|
|
31
|
+
import { useTranslations } from '../i18n';
|
|
32
|
+
const EMPTY_ID_CAPTURE = {};
|
|
33
|
+
const EMPTY_FACE_CAPTURE = {};
|
|
34
|
+
const EMPTY_SIGNATURE_CAPTURE = {};
|
|
35
|
+
const EMPTY_VIDEO_ID_CAPTURE = {};
|
|
36
|
+
const EMPTY_ID_VIEW = {};
|
|
37
|
+
const EMPTY_FACE_VIEW = {};
|
|
38
|
+
const EMPTY_ARTIFACTS = {};
|
|
39
|
+
// Goes through the fallback table rather than sitting as a bare constant so
|
|
40
|
+
// it is a translation key like every other string. It used to be translated
|
|
41
|
+
// only via the chassis's session screen, which no longer exists — this screen
|
|
42
|
+
// had its own untranslated copy of the same English.
|
|
43
|
+
const PREPARING_FALLBACKS = { preparingText: 'Getting things ready…' };
|
|
44
|
+
export function CustomerIdAndBiometricsEnrollmentFlow({ client, submission, idController, selfieController, signatureController, videoIdController, idCapture = EMPTY_ID_CAPTURE, faceCapture = EMPTY_FACE_CAPTURE, signatureCapture = EMPTY_SIGNATURE_CAPTURE, videoIdCapture = EMPTY_VIDEO_ID_CAPTURE, idView = EMPTY_ID_VIEW, faceView = EMPTY_FACE_VIEW, signatureView, videoIdView, captureSignature, captureSignatureVideo, captureVideoId = false, allowVirtualCameras, initialArtifacts = EMPTY_ARTIFACTS, theme, className, showSuccessScreen = false, showDiagnostics = false, captureAdditionalDocuments, additionalDocumentClassNames, ringScreenClassNames, onSubmitted, onCaptureError, children, ...callbacks }) {
|
|
45
|
+
const preparing = useTranslations(undefined, PREPARING_FALLBACKS);
|
|
46
|
+
const { checkLivenessOptions, ...selfieCaptureConfig } = faceCapture;
|
|
47
|
+
const clientRef = useRef(client);
|
|
48
|
+
const checkLivenessOptionsRef = useRef(checkLivenessOptions);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
clientRef.current = client;
|
|
51
|
+
}, [client]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
checkLivenessOptionsRef.current = checkLivenessOptions;
|
|
54
|
+
}, [checkLivenessOptions]);
|
|
55
|
+
const signatureMode = signatureStageMode(captureSignature, captureSignatureVideo);
|
|
56
|
+
// The video-ID decision selects between two different step lists, so unlike
|
|
57
|
+
// the signature stages it cannot be a stage that skips itself; it is
|
|
58
|
+
// resolved before the wizard mounts. A boolean needs no resolution.
|
|
59
|
+
const [useVideoId, setUseVideoId] = useState(typeof captureVideoId === 'function' ? null : captureVideoId);
|
|
60
|
+
const videoIdResolvedRef = useRef(false);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (typeof captureVideoId !== 'function')
|
|
63
|
+
return;
|
|
64
|
+
if (videoIdResolvedRef.current)
|
|
65
|
+
return;
|
|
66
|
+
videoIdResolvedRef.current = true;
|
|
67
|
+
let active = true;
|
|
68
|
+
void captureVideoId().then((resolved) => {
|
|
69
|
+
if (active)
|
|
70
|
+
setUseVideoId(resolved);
|
|
71
|
+
}, (cause) => {
|
|
72
|
+
if (!active)
|
|
73
|
+
return;
|
|
74
|
+
// Same rule as the signature stage's rejected decision: fall back to
|
|
75
|
+
// the stage set the flow would run without the opt-in, and say so.
|
|
76
|
+
warn('[websdk-ui] captureVideoId decision rejected; using ID + face liveness', cause);
|
|
77
|
+
setUseVideoId(false);
|
|
78
|
+
});
|
|
79
|
+
return () => {
|
|
80
|
+
active = false;
|
|
81
|
+
};
|
|
82
|
+
}, [captureVideoId]);
|
|
83
|
+
const [sharedAcquireCamera] = useState(() => createSharedCameraAcquirer(selfieCaptureConfig.io?.acquireCamera ??
|
|
84
|
+
signatureCapture.io?.acquireCamera ??
|
|
85
|
+
acquireCamera));
|
|
86
|
+
const [resolvedIdController] = useState(() => idController ??
|
|
87
|
+
createIdCaptureController({
|
|
88
|
+
...idCapture,
|
|
89
|
+
client,
|
|
90
|
+
// The flow-level prop covers EVERY stage's camera, the ID stage
|
|
91
|
+
// included — it was reaching the selfie and signature controllers
|
|
92
|
+
// only. (2.x integrations were unaffected either way: the façade puts
|
|
93
|
+
// the customer's setting in `idCapture.camera`, which is the fallback
|
|
94
|
+
// here.)
|
|
95
|
+
camera: withVirtualCameras(idCapture.camera, allowVirtualCameras),
|
|
96
|
+
submission: { ...submission, action: SubmissionAction.ENROLL },
|
|
97
|
+
flipConfirmation: idCapture.flipConfirmation ??
|
|
98
|
+
(idView.flipReview ? 'manual' : undefined),
|
|
99
|
+
deferCameraAcquisition: idCapture.deferCameraAcquisition ??
|
|
100
|
+
(idView.loadingOverlayMode === 'ring' && idView.showIntroScreen),
|
|
101
|
+
}));
|
|
102
|
+
const [resolvedSelfieController] = useState(() => selfieController ??
|
|
103
|
+
createSelfieCaptureController({
|
|
104
|
+
...selfieCaptureConfig,
|
|
105
|
+
camera: withVirtualCameras(selfieCaptureConfig.camera, allowVirtualCameras),
|
|
106
|
+
deferCameraAcquisition: selfieCaptureConfig.deferCameraAcquisition ??
|
|
107
|
+
(faceView.loadingOverlayMode === 'ring' && faceView.showIntroScreen),
|
|
108
|
+
liveness: {
|
|
109
|
+
...selfieCaptureConfig.liveness,
|
|
110
|
+
checkLiveness: (image) => clientRef.current.checkLiveness(image, checkLivenessOptionsRef.current),
|
|
111
|
+
},
|
|
112
|
+
io: { ...selfieCaptureConfig.io, acquireCamera: sharedAcquireCamera },
|
|
113
|
+
}));
|
|
114
|
+
const [resolvedSignatureController] = useState(() => signatureMode
|
|
115
|
+
? (signatureController ??
|
|
116
|
+
createSignatureCaptureController({
|
|
117
|
+
...signatureCapture,
|
|
118
|
+
// `signatureMode`, NOT `signatureCapture.mode ?? signatureMode`:
|
|
119
|
+
// `buildSignatureStep` picks the STAGE from the captureSignature /
|
|
120
|
+
// captureSignatureVideo pair alone, so honouring a stale mode
|
|
121
|
+
// override here would mount a still-signature stage on a video
|
|
122
|
+
// controller (or the reverse). IdAndFaceValidationFlow already had
|
|
123
|
+
// this right and flows.test.tsx pins the rule.
|
|
124
|
+
mode: signatureMode,
|
|
125
|
+
camera: withVirtualCameras(signatureCapture.camera, allowVirtualCameras),
|
|
126
|
+
deferCameraAcquisition: true,
|
|
127
|
+
io: { ...signatureCapture.io, acquireCamera: sharedAcquireCamera },
|
|
128
|
+
}))
|
|
129
|
+
: null);
|
|
130
|
+
const [resolvedVideoIdController] = useState(() => captureVideoId
|
|
131
|
+
? (videoIdController ??
|
|
132
|
+
createVideoIdCaptureController({
|
|
133
|
+
...videoIdCapture,
|
|
134
|
+
camera: withVirtualCameras({ preferFrontFacingCamera: true, ...videoIdCapture.camera }, allowVirtualCameras),
|
|
135
|
+
deferCameraAcquisition: videoIdCapture.deferCameraAcquisition ??
|
|
136
|
+
(videoIdView?.loadingOverlayMode === 'ring' &&
|
|
137
|
+
videoIdView?.showIntroScreen),
|
|
138
|
+
}))
|
|
139
|
+
: null);
|
|
140
|
+
// See CustomerBiometricsEnrollmentFlow. The intro lives on whichever stage
|
|
141
|
+
// opens the journey, so both view bags are considered.
|
|
142
|
+
const introActive = isRingIntroActive(idView, faceView, videoIdView);
|
|
143
|
+
const hasPrecapturedSelfie = Boolean(initialArtifacts.face?.selfieImage);
|
|
144
|
+
const steps = useMemo(() => {
|
|
145
|
+
if (useVideoId === null)
|
|
146
|
+
return null;
|
|
147
|
+
const result = [];
|
|
148
|
+
const dropFaceLiveness = hasPrecapturedSelfie ||
|
|
149
|
+
signatureStageReplacesFaceLiveness(captureSignatureVideo);
|
|
150
|
+
if (useVideoId && resolvedVideoIdController) {
|
|
151
|
+
const videoSteps = buildVideoIdSteps({
|
|
152
|
+
idController: resolvedIdController,
|
|
153
|
+
selfieController: resolvedSelfieController,
|
|
154
|
+
videoController: resolvedVideoIdController,
|
|
155
|
+
idView,
|
|
156
|
+
faceView,
|
|
157
|
+
view: videoIdView,
|
|
158
|
+
onCaptureError,
|
|
159
|
+
});
|
|
160
|
+
result.push(...(dropFaceLiveness
|
|
161
|
+
? videoSteps.filter((step) => step.id !== 'face-liveness')
|
|
162
|
+
: videoSteps));
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
result.push({
|
|
166
|
+
id: 'id-capture',
|
|
167
|
+
render: (complete) => (_jsx(IdCaptureView, { ...idView, autoContinueAfterLoading: impliedAutoContinueAfterLoading(idView.autoContinueAfterLoading, introActive), skipSuccessScreen: impliedSkipSuccessScreen(idView.skipSuccessScreen, introActive), controller: resolvedIdController, onCollected: complete })),
|
|
168
|
+
});
|
|
169
|
+
if (!dropFaceLiveness) {
|
|
170
|
+
result.push({
|
|
171
|
+
id: 'face-liveness',
|
|
172
|
+
render: (complete) => (_jsx(FaceLivenessView, { ...faceView, transitionFromIdCapture: faceView.transitionFromIdCapture ?? true, autoContinueAfterLoading: impliedAutoContinueAfterLoading(faceView.autoContinueAfterLoading, introActive), skipSuccessScreen: impliedSkipSuccessScreen(faceView.skipSuccessScreen, introActive), controller: resolvedSelfieController, onDone: () => {
|
|
173
|
+
const state = resolvedSelfieController.getState();
|
|
174
|
+
if (!state.capturedSelfie) {
|
|
175
|
+
onCaptureError?.(new Error('ID and biometrics enrollment completed without a captured selfie.'));
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
complete(buildSelfieArtifacts(state.capturedSelfie.dataUrl, state.capturedSelfie.capturedAt, state.capturedAttempt));
|
|
179
|
+
} })),
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (resolvedSignatureController) {
|
|
184
|
+
const signature = buildSignatureStep({
|
|
185
|
+
captureSignature,
|
|
186
|
+
captureSignatureVideo,
|
|
187
|
+
controller: resolvedSignatureController,
|
|
188
|
+
view: signatureView,
|
|
189
|
+
});
|
|
190
|
+
if (signature)
|
|
191
|
+
result.push(signature);
|
|
192
|
+
}
|
|
193
|
+
const additionalDocuments = buildAdditionalDocumentsStep(captureAdditionalDocuments, additionalDocumentClassNames);
|
|
194
|
+
if (additionalDocuments)
|
|
195
|
+
result.push(additionalDocuments);
|
|
196
|
+
return result;
|
|
197
|
+
}, [
|
|
198
|
+
additionalDocumentClassNames,
|
|
199
|
+
captureAdditionalDocuments,
|
|
200
|
+
captureSignature,
|
|
201
|
+
captureSignatureVideo,
|
|
202
|
+
faceView,
|
|
203
|
+
introActive,
|
|
204
|
+
hasPrecapturedSelfie,
|
|
205
|
+
idView,
|
|
206
|
+
onCaptureError,
|
|
207
|
+
resolvedIdController,
|
|
208
|
+
resolvedSelfieController,
|
|
209
|
+
resolvedSignatureController,
|
|
210
|
+
resolvedVideoIdController,
|
|
211
|
+
signatureView,
|
|
212
|
+
useVideoId,
|
|
213
|
+
videoIdView,
|
|
214
|
+
]);
|
|
215
|
+
// Ring-mode terminal screens, with this flow's own copy (sdk2 builds the
|
|
216
|
+
// same pair per flow). Falls back to the generic orb + diagnostic success
|
|
217
|
+
// screen when the flow is not in ring mode.
|
|
218
|
+
const ringScreens = buildRingScreenProps({
|
|
219
|
+
finishingClassNames: ringScreenClassNames?.finishingScreen,
|
|
220
|
+
successClassNames: ringScreenClassNames?.successScreen,
|
|
221
|
+
ringMode: isRingModeActive(idView, faceView, videoIdView),
|
|
222
|
+
finishingVerbiage: { finishingStage1Text: 'Uploading your captures', finishingStage2Text: 'Confirming your identity data' },
|
|
223
|
+
successVerbiage: { successTitleText: "You're enrolled! 🎉", successSubtitleText: '', successIssuerValueText: 'Identity data', successIssuerCaptionText: 'confirmed' },
|
|
224
|
+
});
|
|
225
|
+
return (_jsxs(FlowChassis, { client: client, action: SubmissionAction.ENROLL, submission: submission, theme: theme, className: className, ...callbacks, children: [steps ? (_jsx(CompositeWizard, { ...ringScreens, steps: steps, initialArtifacts: initialArtifacts, showSuccessScreen: showSuccessScreen, showDiagnostics: showDiagnostics, onSubmitted: onSubmitted })) : (
|
|
226
|
+
// `loadingStage` is what enables the customer's `loadingSpinner`:
|
|
227
|
+
// without it OrbStatusScreen hard-renders the orb, so this was the one
|
|
228
|
+
// loading surface in the SDK that ignored a supplied component
|
|
229
|
+
// outright — in the flow whose double-loader prompted the fix.
|
|
230
|
+
_jsx(OrbStatusScreen, { state: "solving", text: preparing.preparingText, loadingStage: "preparing" })), children] }));
|
|
231
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CustomerMatchFlowProps } from './customerMatch/CustomerMatchFlow';
|
|
2
|
+
export type CustomerIdentificationFlowProps = CustomerMatchFlowProps;
|
|
3
|
+
export declare function CustomerIdentificationFlow(props: CustomerIdentificationFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=CustomerIdentificationFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerIdentificationFlow.d.ts","sourceRoot":"","sources":["../../src/flows/CustomerIdentificationFlow.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAA;AAE1C,MAAM,MAAM,+BAA+B,GAAG,sBAAsB,CAAA;AAEpE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,2CAUvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Port of sdk2's CustomerIdentification (1:N face match against the enrolled
|
|
3
|
+
// population). Capture a selfie, optionally gate it on a live-check, POST it to
|
|
4
|
+
// /v4/customer/identify, and classify the response: verificationResultCode
|
|
5
|
+
// '46' is a hit.
|
|
6
|
+
import { SubmissionAction } from '@idmission/websdk-core/client';
|
|
7
|
+
import { identificationAdapter } from './customerMatch/adapters';
|
|
8
|
+
import { CustomerMatchFlow, } from './customerMatch/CustomerMatchFlow';
|
|
9
|
+
export function CustomerIdentificationFlow(props) {
|
|
10
|
+
return (_jsx(CustomerMatchFlow, { ...props, action: SubmissionAction.IDENTIFY, adapter: identificationAdapter, variant: "identification" }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CustomerMatchFlowProps } from './customerMatch/CustomerMatchFlow';
|
|
2
|
+
import type { FlowSubmissionConfig } from './types';
|
|
3
|
+
export type CustomerVerificationFlowProps = Omit<CustomerMatchFlowProps, 'submission'> & {
|
|
4
|
+
submission: FlowSubmissionConfig & {
|
|
5
|
+
enrollmentId: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare function CustomerVerificationFlow(props: CustomerVerificationFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=CustomerVerificationFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerVerificationFlow.d.ts","sourceRoot":"","sources":["../../src/flows/CustomerVerificationFlow.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,sBAAsB,EACtB,YAAY,CACb,GAAG;IACF,UAAU,EAAE,oBAAoB,GAAG;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5D,CAAA;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,2CAS5E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Port of sdk2's CustomerVerification (1:1 face match against ONE enrolled
|
|
3
|
+
// customer). Same loop as CustomerIdentificationFlow against
|
|
4
|
+
// /v4/customer/verify, with verificationResultCode '00' as the match.
|
|
5
|
+
//
|
|
6
|
+
// The 1:1 target is `submission.enrollmentId`, which sdk2 took as a required
|
|
7
|
+
// top-level `enrollmentId` prop and forwarded to its SubmissionProvider. The
|
|
8
|
+
// requirement survives the move into the submission bag: `submission` is
|
|
9
|
+
// mandatory here (it is optional on every other flow) and its `enrollmentId` is
|
|
10
|
+
// non-optional, so omitting it is a compile error rather than a request the
|
|
11
|
+
// backend rejects.
|
|
12
|
+
import { SubmissionAction } from '@idmission/websdk-core/client';
|
|
13
|
+
import { verificationAdapter } from './customerMatch/adapters';
|
|
14
|
+
import { CustomerMatchFlow, } from './customerMatch/CustomerMatchFlow';
|
|
15
|
+
export function CustomerVerificationFlow(props) {
|
|
16
|
+
return (_jsx(CustomerMatchFlow, { ...props, action: SubmissionAction.VERIFY, adapter: verificationAdapter, variant: "verification" }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DocumentCaptureController, type DocumentCaptureControllerConfig } from '@idmission/websdk-core/documentCapture';
|
|
2
|
+
import type { CapturedDocument } from '../components/document/types';
|
|
3
|
+
import type { CommonFlowProps, DocumentCaptureFlowViewProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* The submission-outcome callbacks are omitted rather than inherited-and-ignored.
|
|
6
|
+
* This flow runs capture-only and never posts, so `onComplete` (whose inherited
|
|
7
|
+
* signature takes a `SubmissionResponse`), `onApproved`, `onDenied`,
|
|
8
|
+
* `onSubmissionStarted`, and `onRequestFailure` could never fire — accepting
|
|
9
|
+
* them would typecheck for an integrator and then silently do nothing.
|
|
10
|
+
* `onComplete` is redefined below with sdk2's meaning: every document uploaded.
|
|
11
|
+
*/
|
|
12
|
+
export type DocumentCaptureFlowProps = Omit<CommonFlowProps, 'captureAdditionalDocuments' | 'showSuccessScreen' | 'showDiagnostics' | 'onComplete' | 'onApproved' | 'onDenied' | 'onSubmissionStarted' | 'onRequestFailure'> & {
|
|
13
|
+
controller?: DocumentCaptureController;
|
|
14
|
+
capture?: Omit<DocumentCaptureControllerConfig, 'client' | 'documents'>;
|
|
15
|
+
view?: DocumentCaptureFlowViewProps;
|
|
16
|
+
/** The public parity config, carrying instructions and per-document callbacks. */
|
|
17
|
+
documents?: readonly CapturedDocument[];
|
|
18
|
+
onDocumentCaptured?: (document: CapturedDocument, index: number) => void;
|
|
19
|
+
onDocumentUploaded?: (document: CapturedDocument, index: number) => void;
|
|
20
|
+
onComplete?: (documents: readonly CapturedDocument[]) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare function DocumentCaptureFlow({ client, controller, capture, view, documents, submission, initialArtifacts, theme, className, onDocumentCaptured, onDocumentUploaded, onComplete, children, ...callbacks }: DocumentCaptureFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=DocumentCaptureFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentCaptureFlow.d.ts","sourceRoot":"","sources":["../../src/flows/DocumentCaptureFlow.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EAErC,MAAM,wCAAwC,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAIpE,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAE5E;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,eAAe,EACb,4BAA4B,GAC5B,mBAAmB,GACnB,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,qBAAqB,GACrB,kBAAkB,CACrB,GAAG;IACF,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,OAAO,CAAC,EAAE,IAAI,CAAC,+BAA+B,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAA;IACvE,IAAI,CAAC,EAAE,4BAA4B,CAAA;IACnC,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACvC,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxE,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,KAAK,IAAI,CAAA;CAC9D,CAAA;AAwBD,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,UAAU,EACV,OAAuB,EACvB,IAAiB,EACjB,SAA2B,EAC3B,UAA6B,EAC7B,gBAAkC,EAClC,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,wBAAwB,2CAyH1B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The standalone parity flow for sdk2's customer_flows/DocumentCapture.tsx.
|
|
3
|
+
//
|
|
4
|
+
// It runs the chassis in capture-only mode: sdk2 mounts this flow with
|
|
5
|
+
// SubmissionAction.NONE and never posts a submission — the uploaded document
|
|
6
|
+
// ids reach the integrator through onComplete alone.
|
|
7
|
+
//
|
|
8
|
+
// This layer also owns the per-document callbacks. sdk2's CapturedDocument
|
|
9
|
+
// carries `onCaptured`/`onUploaded` per entry (DocumentCaptureStateProvider
|
|
10
|
+
// .tsx:306-314), but those take React-facing objects and core is React-free, so
|
|
11
|
+
// the controller only ever reports `(entry, index)`. The mapping back to the
|
|
12
|
+
// caller's own objects happens here.
|
|
13
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
|
+
import { SubmissionAction, } from '@idmission/websdk-core/client';
|
|
15
|
+
import { createDocumentCaptureController, } from '@idmission/websdk-core/documentCapture';
|
|
16
|
+
import { useDocumentCapture } from '../bindings/useDocumentCapture';
|
|
17
|
+
import { buildDocumentCaptureStep } from './documentCapture';
|
|
18
|
+
import { CompositeWizard } from './CompositeWizard';
|
|
19
|
+
import { FlowChassis } from './FlowChassis';
|
|
20
|
+
const EMPTY_DOCUMENTS = [];
|
|
21
|
+
const EMPTY_CAPTURE = {};
|
|
22
|
+
const EMPTY_VIEW = {};
|
|
23
|
+
const EMPTY_SUBMISSION = {};
|
|
24
|
+
const EMPTY_ARTIFACTS = {};
|
|
25
|
+
/** Recombines the caller's document with the live entry, so consumers see the
|
|
26
|
+
* populated object sdk2 handed them rather than a bare config. */
|
|
27
|
+
function merge(document, entry) {
|
|
28
|
+
return {
|
|
29
|
+
...document,
|
|
30
|
+
...entry.item,
|
|
31
|
+
content: entry.content ?? undefined,
|
|
32
|
+
contentUrl: entry.contentUrl ?? undefined,
|
|
33
|
+
documentId: entry.documentId ?? undefined,
|
|
34
|
+
uploadState: entry.uploadState,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function DocumentCaptureFlow({ client, controller, capture = EMPTY_CAPTURE, view = EMPTY_VIEW, documents = EMPTY_DOCUMENTS, submission = EMPTY_SUBMISSION, initialArtifacts = EMPTY_ARTIFACTS, theme, className, onDocumentCaptured, onDocumentUploaded, onComplete, children, ...callbacks }) {
|
|
38
|
+
// Latched in refs so the controller, created once, always calls the current
|
|
39
|
+
// props without being torn down and rebuilt on every render.
|
|
40
|
+
const documentsRef = useRef(documents);
|
|
41
|
+
documentsRef.current = documents;
|
|
42
|
+
const capturedRef = useRef(onDocumentCaptured);
|
|
43
|
+
capturedRef.current = onDocumentCaptured;
|
|
44
|
+
const uploadedRef = useRef(onDocumentUploaded);
|
|
45
|
+
uploadedRef.current = onDocumentUploaded;
|
|
46
|
+
const completeRef = useRef(onComplete);
|
|
47
|
+
completeRef.current = onComplete;
|
|
48
|
+
const [resolvedController] = useState(() => controller ??
|
|
49
|
+
createDocumentCaptureController({
|
|
50
|
+
...capture,
|
|
51
|
+
client,
|
|
52
|
+
// Only the React-free half crosses into core.
|
|
53
|
+
documents: documentsRef.current.map(({ title, aspectRatio, processAsPOA, content }) => ({
|
|
54
|
+
title,
|
|
55
|
+
aspectRatio,
|
|
56
|
+
processAsPOA,
|
|
57
|
+
content,
|
|
58
|
+
})),
|
|
59
|
+
}));
|
|
60
|
+
// Callbacks are derived from subscribed state rather than passed into the
|
|
61
|
+
// controller's own config, because `controller` is a caller-supplied prop:
|
|
62
|
+
// a config-based wiring would silently do nothing whenever an integrator
|
|
63
|
+
// brings their own controller, which is the case this flow's own tests hit.
|
|
64
|
+
const state = useDocumentCapture(resolvedController);
|
|
65
|
+
const capturedFired = useRef(new Set());
|
|
66
|
+
const uploadedFired = useRef(new Set());
|
|
67
|
+
const allUploadedFired = useRef(false);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
state.documents.forEach((entry, index) => {
|
|
70
|
+
// Re-arm when an entry reverts, so a retry re-notifies. The prior
|
|
71
|
+
// "everything uploaded" guarantee stops holding at the same moment.
|
|
72
|
+
if (!entry.content && capturedFired.current.has(index)) {
|
|
73
|
+
capturedFired.current.delete(index);
|
|
74
|
+
allUploadedFired.current = false;
|
|
75
|
+
}
|
|
76
|
+
if (entry.uploadState !== 'succeeded' &&
|
|
77
|
+
uploadedFired.current.has(index)) {
|
|
78
|
+
uploadedFired.current.delete(index);
|
|
79
|
+
allUploadedFired.current = false;
|
|
80
|
+
}
|
|
81
|
+
if (entry.content && !capturedFired.current.has(index)) {
|
|
82
|
+
capturedFired.current.add(index);
|
|
83
|
+
const merged = merge(documentsRef.current[index], entry);
|
|
84
|
+
// Per-document first, then flow-level — the order sdk2 used at :312.
|
|
85
|
+
documentsRef.current[index]?.onCaptured?.(merged);
|
|
86
|
+
capturedRef.current?.(merged, index);
|
|
87
|
+
}
|
|
88
|
+
if (entry.uploadState === 'succeeded' &&
|
|
89
|
+
!uploadedFired.current.has(index)) {
|
|
90
|
+
uploadedFired.current.add(index);
|
|
91
|
+
const merged = merge(documentsRef.current[index], entry);
|
|
92
|
+
documentsRef.current[index]?.onUploaded?.(merged);
|
|
93
|
+
uploadedRef.current?.(merged, index);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const everyUploaded = state.documents.length > 0 &&
|
|
97
|
+
state.documents.every((entry) => entry.uploadState === 'succeeded');
|
|
98
|
+
if (everyUploaded && !allUploadedFired.current) {
|
|
99
|
+
allUploadedFired.current = true;
|
|
100
|
+
completeRef.current?.(state.documents.map((entry, index) => merge(documentsRef.current[index], entry)));
|
|
101
|
+
}
|
|
102
|
+
}, [state]);
|
|
103
|
+
// `documents` has to reach the view, not just the controller: only its
|
|
104
|
+
// React-free half crosses into core, so `instructions` and `cameraFeedMode`
|
|
105
|
+
// exist nowhere else. Omitting it silently dropped both — and `aspectRatio`
|
|
106
|
+
// kept working (it travels through the core item), which is what made the
|
|
107
|
+
// prop look plumbed.
|
|
108
|
+
const steps = useMemo(() => [
|
|
109
|
+
buildDocumentCaptureStep(resolvedController, { documents, ...view }),
|
|
110
|
+
], [documents, resolvedController, view]);
|
|
111
|
+
const onArtifactsCollected = useCallback(() => {
|
|
112
|
+
// captureOnly hands the (empty) artifacts back here; completion is reported
|
|
113
|
+
// through onComplete with the documents instead.
|
|
114
|
+
}, []);
|
|
115
|
+
return (_jsxs(FlowChassis, { client: client, action: SubmissionAction.NONE, submission: submission, theme: theme, className: className, ...callbacks, children: [_jsx(CompositeWizard, { steps: steps, initialArtifacts: initialArtifacts, captureOnly: true, onArtifactsCollected: onArtifactsCollected }), children] }));
|
|
116
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SubmissionArtifacts } from '@idmission/websdk-core/client';
|
|
2
|
+
import { type SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
|
|
3
|
+
import type { CommonFlowProps, FaceLivenessFlowConfig, FaceLivenessFlowViewProps, FlowResultCallbacks } from './types';
|
|
4
|
+
export type FaceValidationFlowProps = Omit<CommonFlowProps, keyof FlowResultCallbacks | 'showSuccessScreen' | 'showDiagnostics' | 'captureAdditionalDocuments'> & {
|
|
5
|
+
controller?: SelfieCaptureController;
|
|
6
|
+
capture?: FaceLivenessFlowConfig;
|
|
7
|
+
view?: FaceLivenessFlowViewProps;
|
|
8
|
+
onCaptured?: (artifacts: SubmissionArtifacts) => void;
|
|
9
|
+
onCaptureError?: (error: Error) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function FaceValidationFlow({ client, controller, capture, view, submission, initialArtifacts, theme, className, geolocationEnabled, geolocationRequired, remoteDiagnostics, loadingSpinner, onCaptured, onCaptureError, children, }: FaceValidationFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=FaceValidationFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaceValidationFlow.d.ts","sourceRoot":"","sources":["../../src/flows/FaceValidationFlow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAC1F,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sCAAsC,CAAA;AAU7C,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,eAAe,EAIb,MAAM,mBAAmB,GACzB,mBAAmB,GACnB,iBAAiB,GACjB,4BAA4B,CAC/B,GAAG;IACF,UAAU,CAAC,EAAE,uBAAuB,CAAA;IACpC,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,IAAI,CAAC,EAAE,yBAAyB,CAAA;IAChC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACrD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACxC,CAAA;AAOD,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,UAAU,EACV,OAA4B,EAC5B,IAAsB,EACtB,UAA6B,EAC7B,gBAAkC,EAClC,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,cAAc,EACd,QAAQ,GACT,EAAE,uBAAuB,2CA+FzB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { SubmissionAction } from '@idmission/websdk-core/client';
|
|
4
|
+
import { createSelfieCaptureController, } from '@idmission/websdk-core/selfieCapture';
|
|
5
|
+
import { FaceLivenessView } from '../FaceLivenessView';
|
|
6
|
+
import { impliedAutoContinueAfterLoading, impliedSkipSuccessScreen, isRingIntroActive, } from './ringIntroImplications';
|
|
7
|
+
import { CompositeWizard } from './CompositeWizard';
|
|
8
|
+
import { buildSelfieArtifacts } from './artifacts';
|
|
9
|
+
import { FlowChassis } from './FlowChassis';
|
|
10
|
+
const EMPTY_FACE_CAPTURE = {};
|
|
11
|
+
const EMPTY_FACE_VIEW = {};
|
|
12
|
+
const EMPTY_SUBMISSION = {};
|
|
13
|
+
const EMPTY_ARTIFACTS = {};
|
|
14
|
+
export function FaceValidationFlow({ client, controller, capture = EMPTY_FACE_CAPTURE, view = EMPTY_FACE_VIEW, submission = EMPTY_SUBMISSION, initialArtifacts = EMPTY_ARTIFACTS, theme, className, geolocationEnabled, geolocationRequired, remoteDiagnostics, loadingSpinner, onCaptured, onCaptureError, children, }) {
|
|
15
|
+
const { checkLivenessOptions, ...controllerCapture } = capture;
|
|
16
|
+
const clientRef = useRef(client);
|
|
17
|
+
const checkLivenessOptionsRef = useRef(checkLivenessOptions);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
clientRef.current = client;
|
|
20
|
+
}, [client]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
checkLivenessOptionsRef.current = checkLivenessOptions;
|
|
23
|
+
}, [checkLivenessOptions]);
|
|
24
|
+
const [resolvedController] = useState(() => controller ??
|
|
25
|
+
createSelfieCaptureController({
|
|
26
|
+
...controllerCapture,
|
|
27
|
+
deferCameraAcquisition: controllerCapture.deferCameraAcquisition ??
|
|
28
|
+
(view.loadingOverlayMode === 'ring' && view.showIntroScreen),
|
|
29
|
+
liveness: {
|
|
30
|
+
...controllerCapture.liveness,
|
|
31
|
+
checkLiveness: (image) => clientRef.current.checkLiveness(image, checkLivenessOptionsRef.current),
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
|
+
// sdk2's implied view rules: a ring intro screen has already told the user
|
|
35
|
+
// what is about to happen and taken their tap, so the loading overlay must
|
|
36
|
+
// not ask for a second one, and the per-stage review screen is redundant.
|
|
37
|
+
// See ringIntroImplications.ts for why the two use different operators.
|
|
38
|
+
const introActive = isRingIntroActive(view);
|
|
39
|
+
const steps = useMemo(() => [
|
|
40
|
+
{
|
|
41
|
+
id: 'face-liveness',
|
|
42
|
+
render: (complete) => (_jsx(FaceLivenessView, { ...view, autoContinueAfterLoading: impliedAutoContinueAfterLoading(view.autoContinueAfterLoading, introActive), skipSuccessScreen: impliedSkipSuccessScreen(view.skipSuccessScreen, introActive), controller: resolvedController, onDone: () => {
|
|
43
|
+
const state = resolvedController.getState();
|
|
44
|
+
if (!state.capturedSelfie) {
|
|
45
|
+
onCaptureError?.(new Error('Face validation completed without a captured selfie.'));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
complete(buildSelfieArtifacts(state.capturedSelfie.dataUrl, state.capturedSelfie.capturedAt, state.capturedAttempt));
|
|
49
|
+
} })),
|
|
50
|
+
},
|
|
51
|
+
], [introActive, onCaptureError, resolvedController, view]);
|
|
52
|
+
return (_jsxs(FlowChassis, { client: client, action: SubmissionAction.VALIDATE, submission: submission, theme: theme, className: className, geolocationEnabled: geolocationEnabled, geolocationRequired: geolocationRequired, remoteDiagnostics: remoteDiagnostics, loadingSpinner: loadingSpinner, children: [_jsx(CompositeWizard, { steps: steps, initialArtifacts: initialArtifacts, captureOnly: true, onArtifactsCollected: onCaptured }), children] }));
|
|
53
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { IdmissionClient, SubmissionAction, SubmissionOptions } from '@idmission/websdk-core/client';
|
|
3
|
+
import type { RemoteDiagnostics } from '@idmission/websdk-core/diagnostics';
|
|
4
|
+
import { type ThemeInput } from '../theme';
|
|
5
|
+
import { type SubmissionCallbacks } from './SubmissionProvider';
|
|
6
|
+
import { type LoadingSpinnerComponent } from './OrbStatusScreen';
|
|
7
|
+
export type FlowChassisProps = SubmissionCallbacks & {
|
|
8
|
+
client: IdmissionClient;
|
|
9
|
+
action: SubmissionAction;
|
|
10
|
+
submission?: Omit<SubmissionOptions, 'action'>;
|
|
11
|
+
theme?: ThemeInput;
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Attempt to acquire the user's location for the submission payload.
|
|
15
|
+
* Default `true`, matching 2.x.
|
|
16
|
+
*/
|
|
17
|
+
geolocationEnabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Treat a location denial as fatal: the user cannot capture until they
|
|
20
|
+
* grant permission, exactly like camera access. Default `false`, matching
|
|
21
|
+
* 2.x — with it off, a denial simply means the payload carries no location.
|
|
22
|
+
*/
|
|
23
|
+
geolocationRequired?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Opt-in breadcrumbs, crash capture, and a model-load watchdog. Off unless
|
|
26
|
+
* `enabled` is set, and transmission stays dark until there is a
|
|
27
|
+
* backend/storage spec — `onLog` is the supported sink. 2.x carried this on
|
|
28
|
+
* all ten flows; here the chassis mounts it once.
|
|
29
|
+
*/
|
|
30
|
+
remoteDiagnostics?: RemoteDiagnostics;
|
|
31
|
+
/** Replaces the SDK's own loading indicator on every loading surface the
|
|
32
|
+
* flow shows — session validation, model loading, stage transitions and
|
|
33
|
+
* submission. See `LoadingSpinnerProps` for the `stage`/`progress` it
|
|
34
|
+
* receives and the null-render fallback. */
|
|
35
|
+
loadingSpinner?: LoadingSpinnerComponent;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
};
|
|
38
|
+
export declare function FlowChassis({ client, action, submission, theme, className, geolocationEnabled, geolocationRequired, remoteDiagnostics, loadingSpinner, children, ...callbacks }: FlowChassisProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=FlowChassis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowChassis.d.ts","sourceRoot":"","sources":["../../src/flows/FlowChassis.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AASzD,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAA;AAI1B,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,gBAAgB,CAAA;IACxB,UAAU,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;IAC9C,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC;;;gDAG4C;IAC5C,cAAc,CAAC,EAAE,uBAAuB,CAAA;IACxC,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,MAAM,EACN,UAAU,EACV,KAAiB,EACjB,SAAS,EACT,kBAAyB,EACzB,mBAA2B,EAC3B,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,gBAAgB,2CA+BlB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from 'styled-components';
|
|
3
|
+
import { ThemeProvider } from '../theme';
|
|
4
|
+
import { AuthProvider, useAuthState } from './AuthStateContext';
|
|
5
|
+
import { AuthUrlNotAllowedOverlay, GeolocationAccessDeniedOverlay, SessionIdMissingOverlay, SessionValidationErrorOverlay, SessionValidationFailedOverlay, } from './overlays';
|
|
6
|
+
import { SubmissionProvider, } from './SubmissionProvider';
|
|
7
|
+
import { LoadingSpinnerProvider, } from './OrbStatusScreen';
|
|
8
|
+
import { useGeolocation } from './useGeolocation';
|
|
9
|
+
import { RemoteDiagnosticsMount } from './RemoteDiagnosticsMount';
|
|
10
|
+
export function FlowChassis({ client, action, submission, theme = 'default', className, geolocationEnabled = true, geolocationRequired = false, remoteDiagnostics, loadingSpinner, children, ...callbacks }) {
|
|
11
|
+
const geolocation = useGeolocation(geolocationEnabled);
|
|
12
|
+
return (_jsxs(AuthProvider, { client: client, children: [_jsx(RemoteDiagnosticsMount, { remoteDiagnostics: remoteDiagnostics }), _jsx(ThemeProvider, { theme: theme, children: _jsx(LoadingSpinnerProvider, { spinner: loadingSpinner, children: _jsx(SubmissionProvider, { client: client, action: action, options: submission, geolocation: geolocation.position, ...callbacks, children: _jsx(FlowPage, { className: className, children: _jsx(AuthGate, { children: geolocationRequired && geolocation.blocked ? (_jsx(GeolocationAccessDeniedOverlay, { onRetry: geolocation.retry })) : (children) }) }) }) }) })] }));
|
|
13
|
+
}
|
|
14
|
+
function AuthGate({ children }) {
|
|
15
|
+
const { state, retry } = useAuthState();
|
|
16
|
+
const session = state.session;
|
|
17
|
+
switch (session.sessionCheckState) {
|
|
18
|
+
case 'PASSED':
|
|
19
|
+
return children;
|
|
20
|
+
case 'MISSING':
|
|
21
|
+
return _jsx(SessionIdMissingOverlay, {});
|
|
22
|
+
case 'AUTH_URL_NOT_ALLOWED':
|
|
23
|
+
return _jsx(AuthUrlNotAllowedOverlay, {});
|
|
24
|
+
case 'FAILED':
|
|
25
|
+
return _jsx(SessionValidationFailedOverlay, {});
|
|
26
|
+
case 'ERROR':
|
|
27
|
+
return (_jsx(SessionValidationErrorOverlay, { error: session.authError, onRetry: () => void retry() }));
|
|
28
|
+
case 'READY':
|
|
29
|
+
case 'RUNNING':
|
|
30
|
+
// Capture mounts DURING the session check rather than after it, so the
|
|
31
|
+
// flow shows one continuous loading surface instead of a session screen
|
|
32
|
+
// followed by a separate model-loading overlay.
|
|
33
|
+
//
|
|
34
|
+
// This is 2.x's arrangement, not a new one: all three sdk2 loading
|
|
35
|
+
// overlay variants read `useAuthContext()` themselves
|
|
36
|
+
// (IdCaptureLoadingOverlay{Ring,Default,Legacy}.tsx:37/54/40), which
|
|
37
|
+
// they could only do while mounted, and their readiness is
|
|
38
|
+
// `sessionReady && modelsReady && cameraReady` — one overlay covering
|
|
39
|
+
// all three. The views pick the session state up from `useSessionReady`,
|
|
40
|
+
// report "authenticating" until it passes, and hold capture closed
|
|
41
|
+
// meanwhile.
|
|
42
|
+
//
|
|
43
|
+
// Model download and session validation therefore overlap, which is the
|
|
44
|
+
// point. The failure branches below still replace the whole tree, so a
|
|
45
|
+
// session that fails unmounts capture and releases the camera.
|
|
46
|
+
return children;
|
|
47
|
+
default:
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const FlowPage = styled.div `
|
|
52
|
+
position: relative;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
min-height: 320px;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
isolation: isolate;
|
|
58
|
+
background: ${(props) => props.theme.background ?? '#fff'};
|
|
59
|
+
${(props) => props.theme.fontFamily ? `font-family: ${props.theme.fontFamily};` : ''}
|
|
60
|
+
${(props) => props.theme.isFullscreen === false
|
|
61
|
+
? ''
|
|
62
|
+
: `
|
|
63
|
+
position: fixed;
|
|
64
|
+
top: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
`}
|
|
69
|
+
`;
|