@idmission/websdk-core 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 +66 -0
- package/dist/attestation/attestationState.d.ts +24 -0
- package/dist/attestation/attestationState.d.ts.map +1 -0
- package/dist/attestation/attestationState.js +57 -0
- package/dist/attestation/clientAttestation.d.ts +40 -0
- package/dist/attestation/clientAttestation.d.ts.map +1 -0
- package/dist/attestation/clientAttestation.js +19 -0
- package/dist/attestation/collectClientAttestation.d.ts +10 -0
- package/dist/attestation/collectClientAttestation.d.ts.map +1 -0
- package/dist/attestation/collectClientAttestation.js +18 -0
- package/dist/attestation/index.d.ts +5 -0
- package/dist/attestation/index.d.ts.map +1 -0
- package/dist/attestation/index.js +4 -0
- package/dist/attestation/nativeAttestationBridge.d.ts +3 -0
- package/dist/attestation/nativeAttestationBridge.d.ts.map +1 -0
- package/dist/attestation/nativeAttestationBridge.js +38 -0
- package/dist/barcode/AAMVAParser.d.ts +77 -0
- package/dist/barcode/AAMVAParser.d.ts.map +1 -0
- package/dist/barcode/AAMVAParser.js +422 -0
- package/dist/barcode/NativeBarcodeDecoder.d.ts +157 -0
- package/dist/barcode/NativeBarcodeDecoder.d.ts.map +1 -0
- package/dist/barcode/NativeBarcodeDecoder.js +832 -0
- package/dist/barcode/Parse.d.ts +6 -0
- package/dist/barcode/Parse.d.ts.map +1 -0
- package/dist/barcode/Parse.js +148 -0
- package/dist/barcode/decodeSummary.d.ts +45 -0
- package/dist/barcode/decodeSummary.d.ts.map +1 -0
- package/dist/barcode/decodeSummary.js +23 -0
- package/dist/barcode/index.d.ts +5 -0
- package/dist/barcode/index.d.ts.map +1 -0
- package/dist/barcode/index.js +4 -0
- package/dist/camera/Camera.d.ts +37 -0
- package/dist/camera/Camera.d.ts.map +1 -0
- package/dist/camera/Camera.js +453 -0
- package/dist/camera/acquireCamera.d.ts +29 -0
- package/dist/camera/acquireCamera.d.ts.map +1 -0
- package/dist/camera/acquireCamera.js +224 -0
- package/dist/camera/cameraSignals.d.ts +23 -0
- package/dist/camera/cameraSignals.d.ts.map +1 -0
- package/dist/camera/cameraSignals.js +32 -0
- package/dist/camera/getUserMediaIntegrity.d.ts +72 -0
- package/dist/camera/getUserMediaIntegrity.d.ts.map +1 -0
- package/dist/camera/getUserMediaIntegrity.js +256 -0
- package/dist/camera/index.d.ts +6 -0
- package/dist/camera/index.d.ts.map +1 -0
- package/dist/camera/index.js +5 -0
- package/dist/camera/isVirtualCamera.d.ts +10 -0
- package/dist/camera/isVirtualCamera.d.ts.map +1 -0
- package/dist/camera/isVirtualCamera.js +11 -0
- package/dist/client/IdmissionClient.d.ts +151 -0
- package/dist/client/IdmissionClient.d.ts.map +1 -0
- package/dist/client/IdmissionClient.js +638 -0
- package/dist/client/additionalDocument.d.ts +14 -0
- package/dist/client/additionalDocument.d.ts.map +1 -0
- package/dist/client/additionalDocument.js +24 -0
- package/dist/client/artifacts.d.ts +146 -0
- package/dist/client/artifacts.d.ts.map +1 -0
- package/dist/client/artifacts.js +1 -0
- package/dist/client/blobToB64.d.ts +2 -0
- package/dist/client/blobToB64.d.ts.map +1 -0
- package/dist/client/blobToB64.js +17 -0
- package/dist/client/endpoints.d.ts +7 -0
- package/dist/client/endpoints.d.ts.map +1 -0
- package/dist/client/endpoints.js +59 -0
- package/dist/client/errors.d.ts +20 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +45 -0
- package/dist/client/index.d.ts +23 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +38 -0
- package/dist/client/payload.d.ts +36 -0
- package/dist/client/payload.d.ts.map +1 -0
- package/dist/client/payload.js +397 -0
- package/dist/client/sessionMachine.d.ts +26 -0
- package/dist/client/sessionMachine.d.ts.map +1 -0
- package/dist/client/sessionMachine.js +23 -0
- package/dist/client/submissionMetadata.d.ts +31 -0
- package/dist/client/submissionMetadata.d.ts.map +1 -0
- package/dist/client/submissionMetadata.js +90 -0
- package/dist/client/timings.d.ts +49 -0
- package/dist/client/timings.d.ts.map +1 -0
- package/dist/client/timings.js +32 -0
- package/dist/client/types.d.ts +305 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +18 -0
- package/dist/client/upload.d.ts +60 -0
- package/dist/client/upload.d.ts.map +1 -0
- package/dist/client/upload.js +313 -0
- package/dist/client/uploadedDocument.d.ts +7 -0
- package/dist/client/uploadedDocument.d.ts.map +1 -0
- package/dist/client/uploadedDocument.js +4 -0
- package/dist/client/urls.d.ts +30 -0
- package/dist/client/urls.d.ts.map +1 -0
- package/dist/client/urls.js +73 -0
- package/dist/client/validateSession.d.ts +7 -0
- package/dist/client/validateSession.d.ts.map +1 -0
- package/dist/client/validateSession.js +63 -0
- package/dist/config/cdn.d.ts +2 -0
- package/dist/config/cdn.d.ts.map +1 -0
- package/dist/config/cdn.js +1 -0
- package/dist/diagnostics/buffer.d.ts +8 -0
- package/dist/diagnostics/buffer.d.ts.map +1 -0
- package/dist/diagnostics/buffer.js +25 -0
- package/dist/diagnostics/envCapability.d.ts +3 -0
- package/dist/diagnostics/envCapability.d.ts.map +1 -0
- package/dist/diagnostics/envCapability.js +40 -0
- package/dist/diagnostics/floodControl.d.ts +6 -0
- package/dist/diagnostics/floodControl.d.ts.map +1 -0
- package/dist/diagnostics/floodControl.js +29 -0
- package/dist/diagnostics/index.d.ts +8 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +17 -0
- package/dist/diagnostics/install.d.ts +20 -0
- package/dist/diagnostics/install.d.ts.map +1 -0
- package/dist/diagnostics/install.js +159 -0
- package/dist/diagnostics/redaction.d.ts +7 -0
- package/dist/diagnostics/redaction.d.ts.map +1 -0
- package/dist/diagnostics/redaction.js +73 -0
- package/dist/diagnostics/transport.d.ts +15 -0
- package/dist/diagnostics/transport.d.ts.map +1 -0
- package/dist/diagnostics/transport.js +35 -0
- package/dist/diagnostics/types.d.ts +59 -0
- package/dist/diagnostics/types.d.ts.map +1 -0
- package/dist/diagnostics/types.js +1 -0
- package/dist/documentCapture/controller.d.ts +35 -0
- package/dist/documentCapture/controller.d.ts.map +1 -0
- package/dist/documentCapture/controller.js +254 -0
- package/dist/documentCapture/index.d.ts +4 -0
- package/dist/documentCapture/index.d.ts.map +1 -0
- package/dist/documentCapture/index.js +8 -0
- package/dist/documentCapture/reducer.d.ts +31 -0
- package/dist/documentCapture/reducer.d.ts.map +1 -0
- package/dist/documentCapture/reducer.js +87 -0
- package/dist/documentCapture/state.d.ts +49 -0
- package/dist/documentCapture/state.d.ts.map +1 -0
- package/dist/documentCapture/state.js +36 -0
- package/dist/idCapture/controller.d.ts +228 -0
- package/dist/idCapture/controller.d.ts.map +1 -0
- package/dist/idCapture/controller.js +1453 -0
- package/dist/idCapture/errors.d.ts +36 -0
- package/dist/idCapture/errors.d.ts.map +1 -0
- package/dist/idCapture/errors.js +18 -0
- package/dist/idCapture/guidance.d.ts +80 -0
- package/dist/idCapture/guidance.d.ts.map +1 -0
- package/dist/idCapture/guidance.js +143 -0
- package/dist/idCapture/index.d.ts +22 -0
- package/dist/idCapture/index.d.ts.map +1 -0
- package/dist/idCapture/index.js +46 -0
- package/dist/idCapture/phase.d.ts +10 -0
- package/dist/idCapture/phase.d.ts.map +1 -0
- package/dist/idCapture/phase.js +28 -0
- package/dist/idCapture/pipeline.d.ts +176 -0
- package/dist/idCapture/pipeline.d.ts.map +1 -0
- package/dist/idCapture/pipeline.js +1028 -0
- package/dist/idCapture/reducer.d.ts +3 -0
- package/dist/idCapture/reducer.d.ts.map +1 -0
- package/dist/idCapture/reducer.js +661 -0
- package/dist/idCapture/requirements.d.ts +10 -0
- package/dist/idCapture/requirements.d.ts.map +1 -0
- package/dist/idCapture/requirements.js +43 -0
- package/dist/idCapture/stabilizer.d.ts +2 -0
- package/dist/idCapture/stabilizer.d.ts.map +1 -0
- package/dist/idCapture/stabilizer.js +4 -0
- package/dist/idCapture/state.d.ts +426 -0
- package/dist/idCapture/state.d.ts.map +1 -0
- package/dist/idCapture/state.js +91 -0
- package/dist/idCapture/submit.d.ts +33 -0
- package/dist/idCapture/submit.d.ts.map +1 -0
- package/dist/idCapture/submit.js +105 -0
- package/dist/idCapture/types.d.ts +20 -0
- package/dist/idCapture/types.d.ts.map +1 -0
- package/dist/idCapture/types.js +12 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/liveness/challengeGeometry.d.ts +66 -0
- package/dist/liveness/challengeGeometry.d.ts.map +1 -0
- package/dist/liveness/challengeGeometry.js +226 -0
- package/dist/liveness/challengeSequence.d.ts +49 -0
- package/dist/liveness/challengeSequence.d.ts.map +1 -0
- package/dist/liveness/challengeSequence.js +71 -0
- package/dist/liveness/index.d.ts +4 -0
- package/dist/liveness/index.d.ts.map +1 -0
- package/dist/liveness/index.js +3 -0
- package/dist/liveness/livenessResult.d.ts +11 -0
- package/dist/liveness/livenessResult.d.ts.map +1 -0
- package/dist/liveness/livenessResult.js +16 -0
- package/dist/models/BarcodeReadability.d.ts +36 -0
- package/dist/models/BarcodeReadability.d.ts.map +1 -0
- package/dist/models/BarcodeReadability.js +71 -0
- package/dist/models/CapabilityProbing.d.ts +25 -0
- package/dist/models/CapabilityProbing.d.ts.map +1 -0
- package/dist/models/CapabilityProbing.js +172 -0
- package/dist/models/DocumentDetection.d.ts +96 -0
- package/dist/models/DocumentDetection.d.ts.map +1 -0
- package/dist/models/DocumentDetection.js +257 -0
- package/dist/models/FaceDetection.d.ts +21 -0
- package/dist/models/FaceDetection.d.ts.map +1 -0
- package/dist/models/FaceDetection.js +4 -0
- package/dist/models/Focus.d.ts +36 -0
- package/dist/models/Focus.d.ts.map +1 -0
- package/dist/models/Focus.js +69 -0
- package/dist/models/FrameLoop.d.ts +13 -0
- package/dist/models/FrameLoop.d.ts.map +1 -0
- package/dist/models/FrameLoop.js +56 -0
- package/dist/models/VisionRuntime.d.ts +18 -0
- package/dist/models/VisionRuntime.d.ts.map +1 -0
- package/dist/models/VisionRuntime.js +158 -0
- package/dist/models/defaults/BarcodeReadability.d.ts +3 -0
- package/dist/models/defaults/BarcodeReadability.d.ts.map +1 -0
- package/dist/models/defaults/BarcodeReadability.js +3 -0
- package/dist/models/defaults/BarcodeReadabilityLiteRT.d.ts +3 -0
- package/dist/models/defaults/BarcodeReadabilityLiteRT.d.ts.map +1 -0
- package/dist/models/defaults/BarcodeReadabilityLiteRT.js +3 -0
- package/dist/models/defaults/DocumentDetector.d.ts +3 -0
- package/dist/models/defaults/DocumentDetector.d.ts.map +1 -0
- package/dist/models/defaults/DocumentDetector.js +3 -0
- package/dist/models/defaults/DocumentDetectorLiteRT.d.ts +3 -0
- package/dist/models/defaults/DocumentDetectorLiteRT.d.ts.map +1 -0
- package/dist/models/defaults/DocumentDetectorLiteRT.js +3 -0
- package/dist/models/defaults/FaceDetector.d.ts +3 -0
- package/dist/models/defaults/FaceDetector.d.ts.map +1 -0
- package/dist/models/defaults/FaceDetector.js +3 -0
- package/dist/models/defaults/FaceLandmarker.d.ts +3 -0
- package/dist/models/defaults/FaceLandmarker.d.ts.map +1 -0
- package/dist/models/defaults/FaceLandmarker.js +8 -0
- package/dist/models/defaults/FaceLandmarkerLiteRT.d.ts +3 -0
- package/dist/models/defaults/FaceLandmarkerLiteRT.d.ts.map +1 -0
- package/dist/models/defaults/FaceLandmarkerLiteRT.js +3 -0
- package/dist/models/defaults/Focus.d.ts +3 -0
- package/dist/models/defaults/Focus.d.ts.map +1 -0
- package/dist/models/defaults/Focus.js +3 -0
- package/dist/models/defaults/FocusLiteRT.d.ts +3 -0
- package/dist/models/defaults/FocusLiteRT.d.ts.map +1 -0
- package/dist/models/defaults/FocusLiteRT.js +3 -0
- package/dist/models/defaults/index.d.ts +31 -0
- package/dist/models/defaults/index.d.ts.map +1 -0
- package/dist/models/defaults/index.js +38 -0
- package/dist/models/helpers.d.ts +25 -0
- package/dist/models/helpers.d.ts.map +1 -0
- package/dist/models/helpers.js +98 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +14 -0
- package/dist/models/modelLifecycle.d.ts +26 -0
- package/dist/models/modelLifecycle.d.ts.map +1 -0
- package/dist/models/modelLifecycle.js +137 -0
- package/dist/models/occlusion.d.ts +20 -0
- package/dist/models/occlusion.d.ts.map +1 -0
- package/dist/models/occlusion.js +109 -0
- package/dist/models/passportBooklet.d.ts +34 -0
- package/dist/models/passportBooklet.d.ts.map +1 -0
- package/dist/models/passportBooklet.js +152 -0
- package/dist/models/preloadModels.d.ts +42 -0
- package/dist/models/preloadModels.d.ts.map +1 -0
- package/dist/models/preloadModels.js +204 -0
- package/dist/models/providers/litert/BarcodeReadability.d.ts +11 -0
- package/dist/models/providers/litert/BarcodeReadability.d.ts.map +1 -0
- package/dist/models/providers/litert/BarcodeReadability.js +135 -0
- package/dist/models/providers/litert/CapabilityProbe.d.ts +3 -0
- package/dist/models/providers/litert/CapabilityProbe.d.ts.map +1 -0
- package/dist/models/providers/litert/CapabilityProbe.js +44 -0
- package/dist/models/providers/litert/DocumentDetection.d.ts +18 -0
- package/dist/models/providers/litert/DocumentDetection.d.ts.map +1 -0
- package/dist/models/providers/litert/DocumentDetection.js +194 -0
- package/dist/models/providers/litert/FaceDetection.d.ts +11 -0
- package/dist/models/providers/litert/FaceDetection.d.ts.map +1 -0
- package/dist/models/providers/litert/FaceDetection.js +204 -0
- package/dist/models/providers/litert/FaceLandmarker.d.ts +11 -0
- package/dist/models/providers/litert/FaceLandmarker.d.ts.map +1 -0
- package/dist/models/providers/litert/FaceLandmarker.js +199 -0
- package/dist/models/providers/litert/Focus.d.ts +11 -0
- package/dist/models/providers/litert/Focus.d.ts.map +1 -0
- package/dist/models/providers/litert/Focus.js +141 -0
- package/dist/models/providers/litert/barcodeReadabilityPrePost.d.ts +6 -0
- package/dist/models/providers/litert/barcodeReadabilityPrePost.d.ts.map +1 -0
- package/dist/models/providers/litert/barcodeReadabilityPrePost.js +68 -0
- package/dist/models/providers/litert/blazeFacePrePost.d.ts +30 -0
- package/dist/models/providers/litert/blazeFacePrePost.d.ts.map +1 -0
- package/dist/models/providers/litert/blazeFacePrePost.js +206 -0
- package/dist/models/providers/litert/docDetectPrePost.d.ts +25 -0
- package/dist/models/providers/litert/docDetectPrePost.d.ts.map +1 -0
- package/dist/models/providers/litert/docDetectPrePost.js +197 -0
- package/dist/models/providers/litert/faceMeshPrePost.d.ts +23 -0
- package/dist/models/providers/litert/faceMeshPrePost.d.ts.map +1 -0
- package/dist/models/providers/litert/faceMeshPrePost.js +86 -0
- package/dist/models/providers/litert/focusPrePost.d.ts +6 -0
- package/dist/models/providers/litert/focusPrePost.d.ts.map +1 -0
- package/dist/models/providers/litert/focusPrePost.js +67 -0
- package/dist/models/providers/litert/runtime.d.ts +14 -0
- package/dist/models/providers/litert/runtime.d.ts.map +1 -0
- package/dist/models/providers/litert/runtime.js +83 -0
- package/dist/models/providers/mediapipe/BarcodeReadability.d.ts +11 -0
- package/dist/models/providers/mediapipe/BarcodeReadability.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/BarcodeReadability.js +68 -0
- package/dist/models/providers/mediapipe/CapabilityProbe.d.ts +2 -0
- package/dist/models/providers/mediapipe/CapabilityProbe.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/CapabilityProbe.js +14 -0
- package/dist/models/providers/mediapipe/DocumentDetection.d.ts +12 -0
- package/dist/models/providers/mediapipe/DocumentDetection.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/DocumentDetection.js +90 -0
- package/dist/models/providers/mediapipe/FaceDetection.d.ts +11 -0
- package/dist/models/providers/mediapipe/FaceDetection.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/FaceDetection.js +93 -0
- package/dist/models/providers/mediapipe/FaceLandmarker.d.ts +46 -0
- package/dist/models/providers/mediapipe/FaceLandmarker.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/FaceLandmarker.js +166 -0
- package/dist/models/providers/mediapipe/Focus.d.ts +11 -0
- package/dist/models/providers/mediapipe/Focus.d.ts.map +1 -0
- package/dist/models/providers/mediapipe/Focus.js +51 -0
- package/dist/models/runtimeSelection.d.ts +5 -0
- package/dist/models/runtimeSelection.d.ts.map +1 -0
- package/dist/models/runtimeSelection.js +21 -0
- package/dist/selfieCapture/challengeRunner.d.ts +38 -0
- package/dist/selfieCapture/challengeRunner.d.ts.map +1 -0
- package/dist/selfieCapture/challengeRunner.js +181 -0
- package/dist/selfieCapture/controller.d.ts +166 -0
- package/dist/selfieCapture/controller.d.ts.map +1 -0
- package/dist/selfieCapture/controller.js +1253 -0
- package/dist/selfieCapture/faceTracking.d.ts +67 -0
- package/dist/selfieCapture/faceTracking.d.ts.map +1 -0
- package/dist/selfieCapture/faceTracking.js +158 -0
- package/dist/selfieCapture/guidance.d.ts +24 -0
- package/dist/selfieCapture/guidance.d.ts.map +1 -0
- package/dist/selfieCapture/guidance.js +41 -0
- package/dist/selfieCapture/index.d.ts +18 -0
- package/dist/selfieCapture/index.d.ts.map +1 -0
- package/dist/selfieCapture/index.js +11 -0
- package/dist/selfieCapture/lighting.d.ts +36 -0
- package/dist/selfieCapture/lighting.d.ts.map +1 -0
- package/dist/selfieCapture/lighting.js +95 -0
- package/dist/selfieCapture/livenessMachine.d.ts +66 -0
- package/dist/selfieCapture/livenessMachine.d.ts.map +1 -0
- package/dist/selfieCapture/livenessMachine.js +137 -0
- package/dist/selfieCapture/pipeline.d.ts +42 -0
- package/dist/selfieCapture/pipeline.d.ts.map +1 -0
- package/dist/selfieCapture/pipeline.js +282 -0
- package/dist/selfieCapture/reducer.d.ts +35 -0
- package/dist/selfieCapture/reducer.d.ts.map +1 -0
- package/dist/selfieCapture/reducer.js +143 -0
- package/dist/selfieCapture/state.d.ts +40 -0
- package/dist/selfieCapture/state.d.ts.map +1 -0
- package/dist/selfieCapture/state.js +36 -0
- package/dist/selfieCapture/testing/challengeFixtures.d.ts +43 -0
- package/dist/selfieCapture/testing/challengeFixtures.d.ts.map +1 -0
- package/dist/selfieCapture/testing/challengeFixtures.js +43 -0
- package/dist/signature/frameDecode.d.ts +48 -0
- package/dist/signature/frameDecode.d.ts.map +1 -0
- package/dist/signature/frameDecode.js +491 -0
- package/dist/signature/index.d.ts +5 -0
- package/dist/signature/index.d.ts.map +1 -0
- package/dist/signature/index.js +4 -0
- package/dist/signature/metadata.d.ts +63 -0
- package/dist/signature/metadata.d.ts.map +1 -0
- package/dist/signature/metadata.js +1 -0
- package/dist/signature/quality.d.ts +169 -0
- package/dist/signature/quality.d.ts.map +1 -0
- package/dist/signature/quality.js +186 -0
- package/dist/signature/signatureValidity.d.ts +149 -0
- package/dist/signature/signatureValidity.d.ts.map +1 -0
- package/dist/signature/signatureValidity.js +305 -0
- package/dist/signatureCapture/controller.d.ts +67 -0
- package/dist/signatureCapture/controller.d.ts.map +1 -0
- package/dist/signatureCapture/controller.js +534 -0
- package/dist/signatureCapture/guidance.d.ts +9 -0
- package/dist/signatureCapture/guidance.d.ts.map +1 -0
- package/dist/signatureCapture/guidance.js +7 -0
- package/dist/signatureCapture/index.d.ts +6 -0
- package/dist/signatureCapture/index.d.ts.map +1 -0
- package/dist/signatureCapture/index.js +5 -0
- package/dist/signatureCapture/pipeline.d.ts +111 -0
- package/dist/signatureCapture/pipeline.d.ts.map +1 -0
- package/dist/signatureCapture/pipeline.js +680 -0
- package/dist/signatureCapture/reducer.d.ts +42 -0
- package/dist/signatureCapture/reducer.d.ts.map +1 -0
- package/dist/signatureCapture/reducer.js +159 -0
- package/dist/signatureCapture/state.d.ts +92 -0
- package/dist/signatureCapture/state.d.ts.map +1 -0
- package/dist/signatureCapture/state.js +24 -0
- package/dist/utils/canvas.d.ts +4 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/canvas.js +21 -0
- package/dist/utils/cropping.d.ts +8 -0
- package/dist/utils/cropping.d.ts.map +1 -0
- package/dist/utils/cropping.js +85 -0
- package/dist/utils/dataUrlToBase64.d.ts +7 -0
- package/dist/utils/dataUrlToBase64.d.ts.map +1 -0
- package/dist/utils/dataUrlToBase64.js +67 -0
- package/dist/utils/getFrameDimensions.d.ts +3 -0
- package/dist/utils/getFrameDimensions.d.ts.map +1 -0
- package/dist/utils/getFrameDimensions.js +12 -0
- package/dist/utils/isMobile.d.ts +3 -0
- package/dist/utils/isMobile.d.ts.map +1 -0
- package/dist/utils/isMobile.js +36 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +25 -0
- package/dist/utils/platform.d.ts +4 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +11 -0
- package/dist/utils/stabilizer.d.ts +26 -0
- package/dist/utils/stabilizer.d.ts.map +1 -0
- package/dist/utils/stabilizer.js +65 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +1 -0
- package/dist/videoIdCapture/controller.d.ts +108 -0
- package/dist/videoIdCapture/controller.d.ts.map +1 -0
- package/dist/videoIdCapture/controller.js +833 -0
- package/dist/videoIdCapture/index.d.ts +5 -0
- package/dist/videoIdCapture/index.d.ts.map +1 -0
- package/dist/videoIdCapture/index.js +2 -0
- package/dist/videoIdCapture/state.d.ts +88 -0
- package/dist/videoIdCapture/state.d.ts.map +1 -0
- package/dist/videoIdCapture/state.js +67 -0
- package/package.json +111 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @idmission/websdk-core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic core engine for the IDmission Web SDK (iteration 3 / SDK 3.0).
|
|
4
|
+
Zero React — enforced by `src/reactFree.test.ts` on every test run.
|
|
5
|
+
|
|
6
|
+
Browser-only: this package drives `getUserMedia`, canvases, and WASM ML
|
|
7
|
+
runtimes. It is framework-agnostic, not environment-agnostic.
|
|
8
|
+
|
|
9
|
+
## Subpath exports
|
|
10
|
+
|
|
11
|
+
| Import | Contents |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `@idmission/websdk-core` | version, CDN config, log level control |
|
|
14
|
+
| `@idmission/websdk-core/barcode` | AAMVA parsing, native barcode decoding |
|
|
15
|
+
| `@idmission/websdk-core/liveness` | liveness challenge geometry + sequence reducer |
|
|
16
|
+
| `@idmission/websdk-core/camera` | getUserMedia wrapper, camera signals, integrity, virtual-camera detection |
|
|
17
|
+
| `@idmission/websdk-core/models` | ML model orchestration: preload, capability probing, runtime selection, LiteRT/MediaPipe providers (providers via deep import) |
|
|
18
|
+
| `@idmission/websdk-core/attestation` | client attestation state + collection |
|
|
19
|
+
| `@idmission/websdk-core/signature` | signature validity, frame decode, quality analysis |
|
|
20
|
+
| `@idmission/websdk-core/client` | session validation, submission, liveness check, tus upload — the framework-agnostic network client |
|
|
21
|
+
| `@idmission/websdk-core/idCapture` | headless ID-capture engine: `createIdCaptureController`, the pure flow reducer (which owns the single-slot guidance stabilizer), guidance derivation, the detection pipeline, and the submit bridge |
|
|
22
|
+
|
|
23
|
+
Build output is bundler-consumable ESM (extensionless relative imports).
|
|
24
|
+
|
|
25
|
+
### `@idmission/websdk-core/client` usage
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { createIdmissionClient, SubmissionAction } from '@idmission/websdk-core/client'
|
|
29
|
+
|
|
30
|
+
const client = createIdmissionClient({ sessionId: 'session-id-from-your-backend' })
|
|
31
|
+
|
|
32
|
+
const checkState = await client.validateSession()
|
|
33
|
+
if (checkState !== 'PASSED') throw new Error(`session invalid: ${checkState}`)
|
|
34
|
+
|
|
35
|
+
const response = await client.submit(
|
|
36
|
+
{ id: { frontImage: 'base64...' }, face: { selfieImage: 'base64...' } },
|
|
37
|
+
{ action: SubmissionAction.VALIDATE },
|
|
38
|
+
)
|
|
39
|
+
console.log(response.status.statusCode) // '000' on success
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### `@idmission/websdk-core/idCapture` usage
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { createIdmissionClient, SubmissionAction } from '@idmission/websdk-core/client'
|
|
46
|
+
import { createIdCaptureController } from '@idmission/websdk-core/idCapture'
|
|
47
|
+
|
|
48
|
+
// authUrl is optional — it defaults to the production portal-api and only
|
|
49
|
+
// needs to be set to reach a different environment; either way it must be
|
|
50
|
+
// one of client/urls.ts's ALLOWED_AUTH_URLS.
|
|
51
|
+
const client = createIdmissionClient({ sessionId: 'session-id-from-your-backend' })
|
|
52
|
+
const ctrl = createIdCaptureController({
|
|
53
|
+
client,
|
|
54
|
+
submission: { action: SubmissionAction.VERIFY },
|
|
55
|
+
})
|
|
56
|
+
const unsub = ctrl.subscribe((s) => {
|
|
57
|
+
// s.guidance is the SINGLE stabilized (debounced + min-held) guidance
|
|
58
|
+
// event; its `satisfied` flag derives from the held code, so text and any
|
|
59
|
+
// green styling always agree. `code === 'NONE'` means show nothing.
|
|
60
|
+
guidanceEl.textContent = s.guidance.code === 'NONE' ? '' : t(s.guidance.code) // your i18n
|
|
61
|
+
progressEl.value = s.progress
|
|
62
|
+
if (s.phase === 'reviewing') showReview(s.capturedDocuments, () => ctrl.actions.submit())
|
|
63
|
+
if (s.phase === 'error') showError(s.error, () => ctrl.actions.retry())
|
|
64
|
+
})
|
|
65
|
+
await ctrl.attach(document.querySelector('video')!)
|
|
66
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { OsAttestation } from './clientAttestation';
|
|
2
|
+
export declare function getLastSessionNonce(): string | null;
|
|
3
|
+
export declare function getLastOsAttestation(): OsAttestation | null;
|
|
4
|
+
/** Store the freshest server-issued nonce. Last-write-wins (see plan invariant). */
|
|
5
|
+
export declare function captureSessionNonce(nonce: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Call the native bridge (if any) and stash its result. Never throws.
|
|
8
|
+
* Commits only if the nonce is still current: a newer ingest may have advanced
|
|
9
|
+
* lastSessionNonce during the (up to multi-second) bridge call, and an OS token
|
|
10
|
+
* is bound to the nonce it was challenged with — committing a stale token under
|
|
11
|
+
* a newer nonce would break the anti-replay binding.
|
|
12
|
+
*/
|
|
13
|
+
export declare function captureOsAttestation(nonce: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Entry point for the auth layer. Validates the value off the ValidateSession
|
|
16
|
+
* response is a non-empty string, captures it, and fires the (async) OS-bridge
|
|
17
|
+
* collection. A missing/invalid nonce clears the holders so a stale prior-session
|
|
18
|
+
* nonce/token can't ride a submission that has no fresh binding -> envelope
|
|
19
|
+
* falls back to 'none'.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ingestSessionAttestation(nonce: unknown): void;
|
|
22
|
+
/** Test-only: clear holders between cases. */
|
|
23
|
+
export declare function resetAttestationState(): void;
|
|
24
|
+
//# sourceMappingURL=attestationState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestationState.d.ts","sourceRoot":"","sources":["../../src/attestation/attestationState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAWxD,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAEnD;AAED,wBAAgB,oBAAoB,IAAI,aAAa,GAAG,IAAI,CAE3D;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKvE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAa7D;AAED,8CAA8C;AAC9C,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { requestOsAttestation } from './nativeAttestationBridge';
|
|
2
|
+
/**
|
|
3
|
+
* Mutable per-session attestation holders, mirroring lib/camera/cameraSignals.
|
|
4
|
+
* The async OS-bridge result is collected ahead of time into a holder so the
|
|
5
|
+
* envelope build at attach time stays synchronous. All writes fail-open.
|
|
6
|
+
*/
|
|
7
|
+
let lastSessionNonce = null;
|
|
8
|
+
let lastOsAttestation = null;
|
|
9
|
+
export function getLastSessionNonce() {
|
|
10
|
+
return lastSessionNonce;
|
|
11
|
+
}
|
|
12
|
+
export function getLastOsAttestation() {
|
|
13
|
+
return lastOsAttestation;
|
|
14
|
+
}
|
|
15
|
+
/** Store the freshest server-issued nonce. Last-write-wins (see plan invariant). */
|
|
16
|
+
export function captureSessionNonce(nonce) {
|
|
17
|
+
lastSessionNonce = nonce;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Call the native bridge (if any) and stash its result. Never throws.
|
|
21
|
+
* Commits only if the nonce is still current: a newer ingest may have advanced
|
|
22
|
+
* lastSessionNonce during the (up to multi-second) bridge call, and an OS token
|
|
23
|
+
* is bound to the nonce it was challenged with — committing a stale token under
|
|
24
|
+
* a newer nonce would break the anti-replay binding.
|
|
25
|
+
*/
|
|
26
|
+
export async function captureOsAttestation(nonce) {
|
|
27
|
+
const result = await requestOsAttestation(nonce);
|
|
28
|
+
if (lastSessionNonce === nonce) {
|
|
29
|
+
lastOsAttestation = result;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Entry point for the auth layer. Validates the value off the ValidateSession
|
|
34
|
+
* response is a non-empty string, captures it, and fires the (async) OS-bridge
|
|
35
|
+
* collection. A missing/invalid nonce clears the holders so a stale prior-session
|
|
36
|
+
* nonce/token can't ride a submission that has no fresh binding -> envelope
|
|
37
|
+
* falls back to 'none'.
|
|
38
|
+
*/
|
|
39
|
+
export function ingestSessionAttestation(nonce) {
|
|
40
|
+
if (typeof nonce !== 'string' || nonce.length === 0) {
|
|
41
|
+
lastSessionNonce = null;
|
|
42
|
+
lastOsAttestation = null;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
captureSessionNonce(nonce);
|
|
46
|
+
// Invalidate any OS token bound to a prior nonce: it would take up to the
|
|
47
|
+
// bridge timeout for the new token to land, and emitting the old token under
|
|
48
|
+
// the new nonce would break the anti-replay binding. Until the new token
|
|
49
|
+
// arrives the envelope falls back to web-integrity.
|
|
50
|
+
lastOsAttestation = null;
|
|
51
|
+
void captureOsAttestation(nonce);
|
|
52
|
+
}
|
|
53
|
+
/** Test-only: clear holders between cases. */
|
|
54
|
+
export function resetAttestationState() {
|
|
55
|
+
lastSessionNonce = null;
|
|
56
|
+
lastOsAttestation = null;
|
|
57
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graded client-attestation envelope. SP1 produces it on every session and
|
|
3
|
+
* ships it via additionalData.metadata; SP2 verifies it. Pure, dependency-free
|
|
4
|
+
* leaf so it is unit-testable in isolation.
|
|
5
|
+
*/
|
|
6
|
+
export type AssuranceLevel = 'os-attested' | 'web-integrity' | 'none';
|
|
7
|
+
/** OS-tier evidence. `token` is opaque to the SDK; only SP2 verifies it. */
|
|
8
|
+
export type OsAttestation = {
|
|
9
|
+
platform: 'android' | 'ios';
|
|
10
|
+
token: string;
|
|
11
|
+
};
|
|
12
|
+
/** Web-tier evidence: the existing client tamper verdict, reported nonce-bound. */
|
|
13
|
+
export type WebIntegrity = {
|
|
14
|
+
tamperDetected: boolean;
|
|
15
|
+
tamperDetails?: string[];
|
|
16
|
+
};
|
|
17
|
+
export type ClientAttestation = {
|
|
18
|
+
assuranceLevel: AssuranceLevel;
|
|
19
|
+
nonce?: string;
|
|
20
|
+
sdkVersion: string;
|
|
21
|
+
os?: OsAttestation;
|
|
22
|
+
web?: WebIntegrity;
|
|
23
|
+
};
|
|
24
|
+
export type BuildClientAttestationInput = {
|
|
25
|
+
nonce?: string;
|
|
26
|
+
sdkVersion: string;
|
|
27
|
+
web?: WebIntegrity;
|
|
28
|
+
os?: OsAttestation | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Grade the envelope from whichever inputs are present:
|
|
32
|
+
* - OS token present -> 'os-attested' (attach `os`)
|
|
33
|
+
* - else nonce present -> 'web-integrity' (attach `web`)
|
|
34
|
+
* - else -> 'none' (omit nonce + web; old SDK / no backend nonce)
|
|
35
|
+
*
|
|
36
|
+
* The web tier requires a nonce to be meaningful (an unbound tamper verdict is
|
|
37
|
+
* replayable), so `web` is only attached at the 'web-integrity' level.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildClientAttestation(input: BuildClientAttestationInput): ClientAttestation;
|
|
40
|
+
//# sourceMappingURL=clientAttestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientAttestation.d.ts","sourceRoot":"","sources":["../../src/attestation/clientAttestation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,MAAM,CAAA;AAErE,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,SAAS,GAAG,KAAK,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,mFAAmF;AACnF,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,GAAG,CAAC,EAAE,YAAY,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,EAAE,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,iBAAiB,CAUnB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grade the envelope from whichever inputs are present:
|
|
3
|
+
* - OS token present -> 'os-attested' (attach `os`)
|
|
4
|
+
* - else nonce present -> 'web-integrity' (attach `web`)
|
|
5
|
+
* - else -> 'none' (omit nonce + web; old SDK / no backend nonce)
|
|
6
|
+
*
|
|
7
|
+
* The web tier requires a nonce to be meaningful (an unbound tamper verdict is
|
|
8
|
+
* replayable), so `web` is only attached at the 'web-integrity' level.
|
|
9
|
+
*/
|
|
10
|
+
export function buildClientAttestation(input) {
|
|
11
|
+
const { nonce, sdkVersion, web, os } = input;
|
|
12
|
+
if (os) {
|
|
13
|
+
return { assuranceLevel: 'os-attested', nonce, sdkVersion, os };
|
|
14
|
+
}
|
|
15
|
+
if (nonce) {
|
|
16
|
+
return { assuranceLevel: 'web-integrity', nonce, sdkVersion, web };
|
|
17
|
+
}
|
|
18
|
+
return { assuranceLevel: 'none', sdkVersion };
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClientAttestation, WebIntegrity } from './clientAttestation';
|
|
2
|
+
/**
|
|
3
|
+
* Assemble the ClientAttestation envelope from the current per-session state and
|
|
4
|
+
* a supplied web tamper verdict. Pure aside from reading the module-level holders,
|
|
5
|
+
* so it is unit-testable without a DOM. The caller (request assembly, browser-only)
|
|
6
|
+
* supplies `web` from checkGetUserMediaIntegrity; pass undefined if the verdict
|
|
7
|
+
* could not be obtained (fail-open -> the web tier is simply omitted).
|
|
8
|
+
*/
|
|
9
|
+
export declare function collectClientAttestation(web: WebIntegrity | undefined): ClientAttestation;
|
|
10
|
+
//# sourceMappingURL=collectClientAttestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectClientAttestation.d.ts","sourceRoot":"","sources":["../../src/attestation/collectClientAttestation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAG1E;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,YAAY,GAAG,SAAS,GAC5B,iBAAiB,CAOnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { webSdkCoreVersion as webSdkVersion } from '../version';
|
|
2
|
+
import { buildClientAttestation } from './clientAttestation';
|
|
3
|
+
import { getLastSessionNonce, getLastOsAttestation } from './attestationState';
|
|
4
|
+
/**
|
|
5
|
+
* Assemble the ClientAttestation envelope from the current per-session state and
|
|
6
|
+
* a supplied web tamper verdict. Pure aside from reading the module-level holders,
|
|
7
|
+
* so it is unit-testable without a DOM. The caller (request assembly, browser-only)
|
|
8
|
+
* supplies `web` from checkGetUserMediaIntegrity; pass undefined if the verdict
|
|
9
|
+
* could not be obtained (fail-open -> the web tier is simply omitted).
|
|
10
|
+
*/
|
|
11
|
+
export function collectClientAttestation(web) {
|
|
12
|
+
return buildClientAttestation({
|
|
13
|
+
nonce: getLastSessionNonce() ?? undefined,
|
|
14
|
+
sdkVersion: webSdkVersion,
|
|
15
|
+
web,
|
|
16
|
+
os: getLastOsAttestation(),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/attestation/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeAttestationBridge.d.ts","sourceRoot":"","sources":["../../src/attestation/nativeAttestationBridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAqBxD,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAA2B,GACrC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAyB/B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host->SDK attestation bridge. A native WebView host assigns
|
|
3
|
+
* `window.IDmissionSDK.attestNative` AFTER the bundle loads (the SDK overwrites
|
|
4
|
+
* the global object on load, so earlier assignment would be clobbered). The SDK
|
|
5
|
+
* only ever reads it. Fail-open: any absence/error/timeout yields null and the
|
|
6
|
+
* caller falls back to the web tier.
|
|
7
|
+
*/
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 3000;
|
|
9
|
+
function isOsAttestation(value) {
|
|
10
|
+
if (typeof value !== 'object' || value === null)
|
|
11
|
+
return false;
|
|
12
|
+
const v = value;
|
|
13
|
+
return ((v.platform === 'android' || v.platform === 'ios') &&
|
|
14
|
+
typeof v.token === 'string' &&
|
|
15
|
+
v.token.length > 0);
|
|
16
|
+
}
|
|
17
|
+
export async function requestOsAttestation(nonce, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
18
|
+
let timer;
|
|
19
|
+
try {
|
|
20
|
+
const bridge = globalThis.IDmissionSDK?.attestNative;
|
|
21
|
+
if (typeof bridge !== 'function')
|
|
22
|
+
return null;
|
|
23
|
+
const timeout = new Promise((resolve) => {
|
|
24
|
+
timer = setTimeout(() => resolve(null), timeoutMs);
|
|
25
|
+
});
|
|
26
|
+
const result = await Promise.race([Promise.resolve(bridge(nonce)), timeout]);
|
|
27
|
+
return isOsAttestation(result) ? result : null;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
// Always clear the timer — including when bridge(nonce) rejects — so a
|
|
34
|
+
// pending timeout can't keep the event loop alive past this call.
|
|
35
|
+
if (timer)
|
|
36
|
+
clearTimeout(timer);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for AAMVA (American Association of Motor Vehicle Administrators)
|
|
3
|
+
* PDF417 barcode data found on US and Canadian driver's licenses.
|
|
4
|
+
*/
|
|
5
|
+
export type ParsedAAMVAField = {
|
|
6
|
+
code: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export type ParsedAAMVAData = {
|
|
11
|
+
fields: ParsedAAMVAField[];
|
|
12
|
+
rawData: string;
|
|
13
|
+
aamvaVersion?: number;
|
|
14
|
+
jurisdictionId?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Parses AAMVA PDF417 barcode data into structured fields
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseAAMVABarcode(rawData: string): ParsedAAMVAData;
|
|
20
|
+
/**
|
|
21
|
+
* Gets a specific field value from parsed AAMVA data
|
|
22
|
+
*/
|
|
23
|
+
export declare function getAAMVAField(parsed: ParsedAAMVAData, code: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the full name from parsed AAMVA data
|
|
26
|
+
*/
|
|
27
|
+
export declare function getFullName(parsed: ParsedAAMVAData): string;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the full address from parsed AAMVA data
|
|
30
|
+
*/
|
|
31
|
+
export declare function getFullAddress(parsed: ParsedAAMVAData): string;
|
|
32
|
+
/**
|
|
33
|
+
* IDData structure for ocrMetadata field in submission API
|
|
34
|
+
*/
|
|
35
|
+
export type OCRMetadataIDData = {
|
|
36
|
+
IDCountry?: string;
|
|
37
|
+
IDCountry_ISO2?: string;
|
|
38
|
+
IssuingCountry?: string;
|
|
39
|
+
IDType?: string;
|
|
40
|
+
IDNumber?: string;
|
|
41
|
+
IDNumber2?: string;
|
|
42
|
+
IDState?: string;
|
|
43
|
+
State?: string;
|
|
44
|
+
FirstName?: string;
|
|
45
|
+
MiddleName?: string;
|
|
46
|
+
LastName?: string;
|
|
47
|
+
Gender?: string;
|
|
48
|
+
DateofBirth?: string;
|
|
49
|
+
DateOfExpiry?: string;
|
|
50
|
+
ExpiryDate?: string;
|
|
51
|
+
DateOfIssue?: string;
|
|
52
|
+
IssueDate?: string;
|
|
53
|
+
AddressLine1?: string;
|
|
54
|
+
City?: string;
|
|
55
|
+
ZipCode?: string;
|
|
56
|
+
Country?: string;
|
|
57
|
+
Eyes?: string;
|
|
58
|
+
Under21?: string;
|
|
59
|
+
DocumentTypeCode?: string;
|
|
60
|
+
BarcodeDataParsed?: string;
|
|
61
|
+
BarcodeAttemptCount?: string;
|
|
62
|
+
};
|
|
63
|
+
export type OCRMetadata = {
|
|
64
|
+
IDData: OCRMetadataIDData;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Converts parsed AAMVA barcode data to ocrMetadata format for submission API.
|
|
68
|
+
* Returns the IDData object ready to be stringified for the ocrMetadata field.
|
|
69
|
+
*/
|
|
70
|
+
export declare function convertAAMVAToOCRMetadata(parsed: ParsedAAMVAData): OCRMetadata;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the ocrMetadata payload reported when a barcode capture flow ran
|
|
73
|
+
* but no barcode was successfully parsed. Records the attempt count so the
|
|
74
|
+
* backend can distinguish "user never tried" from "user tried N times".
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildNoBarcodeOCRMetadata(attemptCount: number): OCRMetadata;
|
|
77
|
+
//# sourceMappingURL=AAMVAParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AAMVAParser.d.ts","sourceRoot":"","sources":["../../src/barcode/AAMVAParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgGH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAsJD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CA8ElE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAGpB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAM3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAW9D;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,iBAAiB,CAAA;CAC1B,CAAA;AAcD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CA0E9E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAO3E"}
|