diff --git a/.changeset/stable-device-info-and-ota.md b/.changeset/stable-device-info-and-ota.md index 2d38aa81..27287425 100644 --- a/.changeset/stable-device-info-and-ota.md +++ b/.changeset/stable-device-info-and-ota.md @@ -1,7 +1,6 @@ --- "@microblink/blinkid": patch "@microblink/blinkcard": patch -"@microblink/blinkid-verify": patch --- Fixed slow handling of device info and OTA URLs. diff --git a/.changeset/verify-tooltip-delay.md b/.changeset/verify-tooltip-delay.md deleted file mode 100644 index 9ede049d..00000000 --- a/.changeset/verify-tooltip-delay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@microblink/blinkid-verify-ux-manager": patch ---- - -Updated the default help button tooltip show delay from 5s to 10s diff --git a/apps/examples/README.md b/apps/examples/README.md index e580e672..29157513 100644 --- a/apps/examples/README.md +++ b/apps/examples/README.md @@ -73,7 +73,23 @@ Replace `your-license-key` with the actual license key you obtained. **Note:** The `camera-manager` and `camera-selection` examples do not require a license key. -### 4. Run an Example Application +### 4. Set up BlinkID Verify + +The [simple](./blinkid-verify-simple/) and [advanced](./blinkid-verify-advanced-setup/) BlinkID Verify examples leave `verifyApiBaseUrl` unset, so the SDK posts each capture to this page's origin at `/api/v3/verify`. The SDK sends no API key. While `pnpm dev` is running, the dev server forwards that route to your Verify host and adds `Authorization`. + +In the same `.env.local` file, set: + +```env +VITE_LICENCE_KEY= +VERIFY_API_URL=https://your-verify-api.example.com +VERIFY_API_KEY= +``` + +`VERIFY_API_URL` is the https origin. The forwarded request always uses `/api/v3/verify` on that host. `VERIFY_API_KEY` is optional. When it is set, that string is the `Authorization` header value. Keep the `VERIFY_API_` prefix. Vite inlines only names that start with `VITE_`, so these values stay on the dev server. + +The [custom UI](./blinkid-verify-custom-ui/) example stops after capture, so it needs only the license key. + +### 5. Run an Example Application Navigate to the directory of the example you want to run and start the development server. diff --git a/apps/examples/blinkid-advanced-setup/src/App.tsx b/apps/examples/blinkid-advanced-setup/src/App.tsx index 584922d5..757525a4 100644 --- a/apps/examples/blinkid-advanced-setup/src/App.tsx +++ b/apps/examples/blinkid-advanced-setup/src/App.tsx @@ -59,13 +59,6 @@ export const App: Component = () => { console.log("creating new session"); - /* Optionally use one of our presets for the scanning session settings - const scanningSettings = await blinkIdCore.buildDocumentVideoSettings({ - scenario: "general", - captureEnvironment: "hand-held", - }); - */ - /* * Initialize the session with the default settings. * For additional configuration look at the BlinkIdSessionSettings type. diff --git a/apps/examples/blinkid-verify-advanced-setup/.env.example b/apps/examples/blinkid-verify-advanced-setup/.env.example index b3facb74..2886be76 100644 --- a/apps/examples/blinkid-verify-advanced-setup/.env.example +++ b/apps/examples/blinkid-verify-advanced-setup/.env.example @@ -5,3 +5,10 @@ VITE_LICENCE_KEY=PLACE_YOUR_LICENCE_KEY_HERE + +# Server-side only. Vite reads these and does not inline them into the page. +# The example posts to /api/v3/verify on this dev server. +# VERIFY_API_URL is the https origin. The forwarded path is always /api/v3/verify on that host. +# VERIFY_API_KEY is optional. When set, that string is the Authorization header value. +VERIFY_API_URL=https://your-verify-api.example.com +VERIFY_API_KEY= diff --git a/apps/examples/blinkid-verify-advanced-setup/README.md b/apps/examples/blinkid-verify-advanced-setup/README.md index c1bc175b..1f9e3816 100644 --- a/apps/examples/blinkid-verify-advanced-setup/README.md +++ b/apps/examples/blinkid-verify-advanced-setup/README.md @@ -16,9 +16,9 @@ The application performs the following actions: 5. **Renders the UI**: The application creates and mounts the camera and feedback UI components to the DOM, rendered as a portal outside the root element. It provides an option to show or hide an onboarding guide for the user. -6. **Handles Results**: Upon successful scanning, the application displays the captured front, back, and barcode frame images. It also includes an optional debug overlay that shows live feedback stabilizer scores as a bar chart, the current UX state key, and the processing status. +6. **Handles Results**: Upon successful scanning, the camera UI closes immediately. The capture resolver loads the session result and submits it with `verifyCaptureResult()`. That request goes to this page's origin at `/api/v3/verify`, and the dev server forwards it. The application then displays the captured front, back, and barcode frame images and the Verify API response (the verdict and full JSON, or the error message with status and body when the request fails). It also includes an optional debug overlay that shows live feedback stabilizer scores as a bar chart, the current UX state key, and the processing status. -7. **Cleanup**: When the UI is dismounted, the application terminates the BlinkID Verify Core instance to free up resources. +7. **Cleanup**: When the UI is dismounted before a capture result, the application terminates the BlinkID Verify Core instance. After a successful scan, the core stays alive until the Verify API request settles, then terminates. ## Key Features Demonstrated @@ -26,8 +26,10 @@ The application performs the following actions: - **Manual Control**: Demonstrates how to manually control the initialization, scanning process, and UI components. - **Custom UI**: Provides an example of how to integrate the SDK's UI components into a custom application layout. - **Event Handling**: Shows how to subscribe to events from the `CameraManager` and `BlinkIdVerifyUxManager` to create a responsive user experience. -- **Result Handling**: Illustrates how to receive and display scanning results, including captured document frame images. +- **Result Handling**: Illustrates how to receive and display scanning results, including captured document frame images and the Verify API response from `verifyCaptureResult()`. ## How to Run -For detailed instructions on how to install dependencies and run this example, please refer to the [main README file](./../README.md). +Copy `.env.example` to `.env.local`. Set `VITE_LICENCE_KEY`, and set `VERIFY_API_URL` to the https origin of your Verify API. `VERIFY_API_KEY` is optional. When set, it is sent as the `Authorization` value. The example leaves `verifyApiBaseUrl` unset, so the SDK posts to `/api/v3/verify` on this dev server. + +For install and start commands, see the [examples README](./../README.md). diff --git a/apps/examples/blinkid-verify-advanced-setup/src/App.tsx b/apps/examples/blinkid-verify-advanced-setup/src/App.tsx index 8d87e293..110a4536 100644 --- a/apps/examples/blinkid-verify-advanced-setup/src/App.tsx +++ b/apps/examples/blinkid-verify-advanced-setup/src/App.tsx @@ -4,8 +4,10 @@ import { BlinkIdVerifyProcessResult, - BlinkIdVerifyScanningResult, loadBlinkIdVerifyCore, + type BlinkIdVerifySessionResult, + type VerifyApiError, + type VerifyApiResult, } from "@microblink/blinkid-verify-core"; import { BlinkIdVerifyUxManager, @@ -13,10 +15,7 @@ import { createBlinkIdVerifyUxManager, } from "@microblink/blinkid-verify-ux-manager"; import { CameraManager, createCameraManagerUi } from "@microblink/camera-manager"; -import { Component, createEffect, createMemo, createSignal, onMount, Show } from "solid-js"; - -/** Debug info will be displayed in the UI. */ -const SHOW_DEBUG = true; +import { Component, createEffect, createMemo, createSignal, Match, onMount, Show, Switch } from "solid-js"; /** * If you are using a portal, you can set this to true. Portal is a way to render the UI outside of the root element. @@ -25,30 +24,30 @@ const SHOW_DEBUG = true; const USE_PORTAL = true; /** If the onboarding guide should be shown. */ -const SHOW_ONBOARDING = false; +const SHOW_ONBOARDING = true; /** This is the target node for the UI. */ const targetNode = !USE_PORTAL ? document.getElementById("root")! : undefined; +/** Result of the Verify API request started after capture, or pending while that request is in flight. */ +type VerifyOutcome = + | { status: "pending" } + | { status: "success"; result: VerifyApiResult } + | { status: "error"; error: VerifyApiError }; + /** This is the main component of the application. */ export const App: Component = () => { - const [result, setResult] = createSignal(); + const [result, setResult] = createSignal(); + const [verifyOutcome, setVerifyOutcome] = createSignal(); const [blinkIdVerifyUxManager, setBlinkIdVerifyUxManager] = createSignal(); const [loadState, setLoadState] = createSignal<"not-loaded" | "loading" | "ready">("not-loaded"); - - /** - * This function removes the images from the result object. This is done only so we don't display raw images data in - * the UI. - */ - const resultWithoutImages = () => { - const resultCopy = structuredClone(result()); - - return resultCopy; - }; + let captureGeneration = 0; async function init() { + const generation = ++captureGeneration; setLoadState("loading"); setResult(undefined); + setVerifyOutcome(undefined); /* * We first initialize the direct API. This loads the WASM module and initializes the engine. @@ -59,8 +58,6 @@ export const App: Component = () => { licenseKey: import.meta.env.VITE_LICENCE_KEY, }); - console.log("creating new session"); - /* * Initialize the session with the default settings. * For additional configuration look at the BlinkIdVerifySessionSettings type. @@ -74,13 +71,17 @@ export const App: Component = () => { const cameraManager = new CameraManager(); /* - * Create the UX manager. + * Create the consent gate. RequireConsent does not return a manager until the user accepts. */ - const uxManager = await createBlinkIdVerifyUxManager(cameraManager, session); - // set the timeout duration to null to disable the timeout. - uxManager.setTimeoutDuration(null); - - setBlinkIdVerifyUxManager(uxManager); + const consentGate = await createBlinkIdVerifyUxManager(cameraManager, session, { + consentUxConfig: { + consentMode: "RequireConsent", + consent: { + userId: "example-user", + durationDays: 365, + }, + }, + }); /* * This creates the UI and attaches it to the DOM. @@ -92,22 +93,62 @@ export const App: Component = () => { }); /* - * This callback is called when the UI is dismounted. - * This is useful if you want to perform some actions when the UI is dismounted. + * A finished capture closes the camera immediately, but the core has to stay alive until the Verify API request + * settles. Terminating it here would cancel that request. */ + let preserveCoreForResult = false; cameraUi.addOnDismountCallback(() => { - void blinkIdVerifyCore.terminate(); + if (!preserveCoreForResult) { + void blinkIdVerifyCore.terminate(); + } setBlinkIdVerifyUxManager(undefined); setLoadState("not-loaded"); }); + const uxManager = await consentGate.consentUiResponse(cameraUi); + if (!uxManager) { + await blinkIdVerifyCore.terminate(); + setLoadState("not-loaded"); + return; + } + + // set the timeout duration to null to disable the timeout. + uxManager.setTimeoutDuration(null); + + setBlinkIdVerifyUxManager(uxManager); + /* - * This callback is called when the result is ready. - * This is useful if you want to perform some actions when the result is ready. + * Capture is already complete when this runs, after the success animation. Close the camera right away and let the + * Verify API request finish in the background. */ - uxManager.addOnResultCallback((result) => { - setResult(result); + uxManager.addOnCaptureCompletedCallback(async (resolver) => { + preserveCoreForResult = true; + setVerifyOutcome({ status: "pending" }); cameraUi.dismount(); + + const captureResultPromise = resolver.getCaptureResult().then( + (captureResult) => { + if (generation === captureGeneration) { + setResult(captureResult); + } + }, + (error: unknown) => { + console.error("Failed to load capture result", error); + }, + ); + + try { + const outcome = await resolver.verifyCaptureResult(); + if (generation !== captureGeneration) { + return; + } + setVerifyOutcome( + outcome.ok ? { status: "success", result: outcome.result } : { status: "error", error: outcome.error }, + ); + } finally { + await captureResultPromise; + void blinkIdVerifyCore.terminate(); + } }); /* @@ -115,7 +156,7 @@ export const App: Component = () => { * This is useful if you want to perform some actions on certain results. */ uxManager.addOnFrameProcessCallback((frameProcessResult: BlinkIdVerifyProcessResult) => { - console.log("frame processed", frameProcessResult); + //console.log("frame processed", frameProcessResult); }); /* @@ -186,11 +227,12 @@ export const App: Component = () => { {/* Results */} {(trimmedResult) => } + {(outcome) => } ); }; -function DisplayBlinkIdVerifyResult(props: { result: BlinkIdVerifyScanningResult }) { +function DisplayBlinkIdVerifyResult(props: { result: BlinkIdVerifySessionResult }) { createEffect(() => { console.log(props.result); }); @@ -214,15 +256,46 @@ function DisplayBlinkIdVerifyResult(props: { result: BlinkIdVerifyScanningResult return (
- - + + {(image) => } - - + + {(image) => } - - + + {(image) => }
); } + +function DisplayVerifyApiResult(props: { outcome: VerifyOutcome }) { + return ( + + +

Submitting to the Verify API…

+
+ + {(result) => ( +
+

{result().verification.verdict}

+
{JSON.stringify(result(), null, 2)}
+
+ )} +
+ + {(error) => ( +
+

{error().message}

+ +

Status: {error().status}

+
+ +
{JSON.stringify(error().body, null, 2)}
+
+
+ )} +
+
+ ); +} diff --git a/apps/examples/blinkid-verify-advanced-setup/src/index.css b/apps/examples/blinkid-verify-advanced-setup/src/index.css index 60047cbd..86dfd388 100644 --- a/apps/examples/blinkid-verify-advanced-setup/src/index.css +++ b/apps/examples/blinkid-verify-advanced-setup/src/index.css @@ -5,7 +5,7 @@ body { :root { background-color: #282c34; color: white; - min-height: 300vh; + min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; diff --git a/apps/examples/blinkid-verify-advanced-setup/src/vite-env.d.ts b/apps/examples/blinkid-verify-advanced-setup/src/vite-env.d.ts new file mode 100644 index 00000000..a10e3e2e --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/src/vite-env.d.ts @@ -0,0 +1,11 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +/// + +interface ImportMetaEnv { + readonly VITE_LICENCE_KEY: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/apps/examples/blinkid-verify-advanced-setup/vite.config.ts b/apps/examples/blinkid-verify-advanced-setup/vite.config.ts index c2083eda..26a5c11c 100644 --- a/apps/examples/blinkid-verify-advanced-setup/vite.config.ts +++ b/apps/examples/blinkid-verify-advanced-setup/vite.config.ts @@ -3,6 +3,7 @@ import dns from "dns"; import { moveResources } from "@microblink/repo-utils"; +import { verifyApiDevProxy } from "@microblink/repo-utils/vite/verifyApiDevProxy.mts"; import { ServerOptions, defineConfig } from "vite"; import mkcert from "vite-plugin-mkcert"; import { qrcode } from "vite-plugin-qrcode"; @@ -29,6 +30,7 @@ export default defineConfig((config) => { target: "es2022", }, plugins: [ + verifyApiDevProxy(), // symlink wasm resources to public/resources { name: "move-resources", diff --git a/apps/examples/blinkid-verify-custom-ui/README.md b/apps/examples/blinkid-verify-custom-ui/README.md index 69a57f78..f35a0a6e 100644 --- a/apps/examples/blinkid-verify-custom-ui/README.md +++ b/apps/examples/blinkid-verify-custom-ui/README.md @@ -2,6 +2,8 @@ This plain TypeScript application supplies its own capture UI. It imports the UX Manager and Camera Manager from their `/core` entrypoints, so it does not need the optional UI peer dependencies. +The example captures a document and stops there. It does not call the Verify API, so `VERIFY_API_URL` is not used. + The example starts loading Core and its SDK resources as soon as the page opens. After loading, **Start scanning** creates a new capture session on the existing Core instance. Completing or stopping a capture deletes only that session, allowing another session to start without downloading or initializing the SDK again. **Destroy SDK** demonstrates full teardown; **Load SDK** creates a fresh Core instance afterward. `BlinkIdVerifyCustomUiExample` keeps one Core instance and Camera Manager for the SDK lifetime, while each capture owns a new scanning session, UX Manager, and subscriptions. Session cleanup uses one shared teardown operation to remove callbacks, mark camera interruption as user initiated, destroy the UX Manager, stop the camera stream, and delete the session. A run identifier prevents late asynchronous work from an obsolete capture from changing the current interface. Captured result images remain visible after successful cleanup and are revoked before the next run. diff --git a/apps/examples/blinkid-verify-custom-ui/src/index.ts b/apps/examples/blinkid-verify-custom-ui/src/index.ts index 28c3c377..7fb37f42 100644 --- a/apps/examples/blinkid-verify-custom-ui/src/index.ts +++ b/apps/examples/blinkid-verify-custom-ui/src/index.ts @@ -2,12 +2,13 @@ import { loadBlinkIdVerifyCore, - type BlinkIdVerifyScanningResult, - type CapturedFrame, + type BlinkIdVerifySessionResult, + type PayloadImage, type RemoteScanningSession, } from "@microblink/blinkid-verify-core"; import { createBlinkIdVerifyUxManager, + type BlinkIdVerifyConsentGate, type BlinkIdVerifyUiStateKey, type BlinkIdVerifyUxManager, } from "@microblink/blinkid-verify-ux-manager/core"; @@ -81,12 +82,12 @@ function clearImages(): void { imagesElement.replaceChildren(); } -function renderFrame(label: string, frame: CapturedFrame | undefined): void { - if (!frame) { +function renderImage(label: string, payloadImage: PayloadImage | undefined): void { + if (!payloadImage) { return; } - const jpegBytes = frame.jpegBytes.slice(); + const jpegBytes = payloadImage.jpegBytes.slice(); const imageUrl = URL.createObjectURL(new Blob([jpegBytes.buffer], { type: "image/jpeg" })); imageUrls.push(imageUrl); @@ -101,17 +102,17 @@ function renderFrame(label: string, frame: CapturedFrame | undefined): void { imagesElement.append(figure); } -function renderResult(result: BlinkIdVerifyScanningResult): void { +function renderResult(result: BlinkIdVerifySessionResult): void { clearImages(); - renderFrame("Front frame", result.frontFrame); - renderFrame("Back frame", result.backFrame); - renderFrame("Barcode frame", result.barcodeFrame); + renderImage("First side", result.serializedPayload.imageFirstSide); + renderImage("Second side", result.serializedPayload.imageSecondSide); + renderImage("Barcode", result.serializedPayload.imageBarcode); resultElement.textContent = JSON.stringify( { - frontFrame: result.frontFrame?.orientation, - backFrame: result.backFrame?.orientation, - barcodeFrame: result.barcodeFrame?.orientation, + configuration: result.typedPayload?.configuration, + consent: result.typedPayload?.consent, + traceId: result.typedPayload?.traceId, }, null, 2, @@ -124,6 +125,8 @@ class BlinkIdVerifyCustomUiExample { #session?: RemoteScanningSession; #cameraManager = new CameraManager(); #uxManager?: BlinkIdVerifyUxManager; + #consentGate?: BlinkIdVerifyConsentGate; + #removeConsentOverlay?: () => void; #removeCallbacks: RemoveCallback[] = []; #sessionStop?: Promise; #runId = 0; @@ -203,9 +206,46 @@ class BlinkIdVerifyCustomUiExample { const cameraManager = this.#cameraManager; - const uxManager = await createBlinkIdVerifyUxManager(cameraManager, session); + const consentGate = await createBlinkIdVerifyUxManager(cameraManager, session, { + consentUxConfig: { + consentMode: "RequireConsent", + consent: { + userId: "example-user", + durationDays: 365, + }, + }, + }); if (!this.#isCurrent(runId)) { - uxManager.destroy(); + consentGate.destroy(); + return; + } + this.#consentGate = consentGate; + + const consentOverlay = document.createElement("div"); + reticleElement.append(consentOverlay); + this.#removeConsentOverlay = () => { + consentOverlay.remove(); + this.#removeConsentOverlay = undefined; + }; + + statusElement.textContent = "Review the consent dialog to continue."; + const uxManager = await consentGate.consentUiResponse({ + overlayLayerNode: consentOverlay, + owner: null, + dismount: () => { + this.#removeConsentOverlay?.(); + }, + } as unknown as Parameters[0]); + this.#consentGate = undefined; + this.#removeConsentOverlay?.(); + + if (!this.#isCurrent(runId)) { + uxManager?.destroy(); + return; + } + if (!uxManager) { + statusElement.textContent = "Consent was declined."; + await this.#finish(runId); return; } this.#uxManager = uxManager; @@ -224,11 +264,12 @@ class BlinkIdVerifyCustomUiExample { showError(error); } }), - uxManager.addOnResultCallback((result) => { + uxManager.addOnCaptureCompletedCallback(async (resolver) => { if (!this.#isCurrent(runId)) { return; } + const result = await resolver.getCaptureResult(); renderResult(result); statusElement.textContent = "Capture complete."; void this.#finish(runId, { clearCapturedImages: false }); @@ -417,10 +458,14 @@ class BlinkIdVerifyCustomUiExample { async #disposeSession(): Promise { const session = this.#session; const uxManager = this.#uxManager; + const consentGate = this.#consentGate; const removeCallbacks = this.#removeCallbacks.splice(0); this.#session = undefined; this.#uxManager = undefined; + this.#consentGate = undefined; + this.#removeConsentOverlay?.(); + consentGate?.destroy(); for (const removeCallback of removeCallbacks) { removeCallback(); diff --git a/apps/examples/blinkid-verify-simple/.env.example b/apps/examples/blinkid-verify-simple/.env.example index b3facb74..2886be76 100644 --- a/apps/examples/blinkid-verify-simple/.env.example +++ b/apps/examples/blinkid-verify-simple/.env.example @@ -5,3 +5,10 @@ VITE_LICENCE_KEY=PLACE_YOUR_LICENCE_KEY_HERE + +# Server-side only. Vite reads these and does not inline them into the page. +# The example posts to /api/v3/verify on this dev server. +# VERIFY_API_URL is the https origin. The forwarded path is always /api/v3/verify on that host. +# VERIFY_API_KEY is optional. When set, that string is the Authorization header value. +VERIFY_API_URL=https://your-verify-api.example.com +VERIFY_API_KEY= diff --git a/apps/examples/blinkid-verify-simple/README.md b/apps/examples/blinkid-verify-simple/README.md index acb909f5..bb4f0f2d 100644 --- a/apps/examples/blinkid-verify-simple/README.md +++ b/apps/examples/blinkid-verify-simple/README.md @@ -8,9 +8,9 @@ The application performs the following actions: 1. **Initializes BlinkID Verify**: It calls the `createBlinkIdVerify` function, which handles the entire setup process, including loading the SDK, setting up the camera, and creating the UI. -2. **Sets up a Result Callback**: It registers a callback function that will be invoked when a document is successfully scanned. +2. **Submits the capture**: After a successful scan, `verifyOnScanningCompletion` posts the capture to this page's origin at `/api/v3/verify`. The dev server forwards that request. -3. **Logs the Result**: When the callback is triggered, it logs the scanning result to the console. +3. **Logs the Verify response**: The success callback logs the Verify API result. The error callback logs the failure and retries once when the status is 500–599. 4. **Cleans up Resources**: After logging the result, it calls the `destroy` method to release all resources used by the SDK. @@ -23,4 +23,6 @@ The application performs the following actions: ## How to Run -For detailed instructions on how to install dependencies and run this example, please refer to the [main README file](./../README.md). +Copy `.env.example` to `.env.local`. Set `VITE_LICENCE_KEY`, and set `VERIFY_API_URL` to the https origin of your Verify API. `VERIFY_API_KEY` is optional. When set, it is sent as the `Authorization` value. The example leaves `verifyApiBaseUrl` unset, so the SDK posts to `/api/v3/verify` on this dev server. + +For install and start commands, see the [examples README](./../README.md). diff --git a/apps/examples/blinkid-verify-simple/src/index.ts b/apps/examples/blinkid-verify-simple/src/index.ts index 99b52305..af0ddc7b 100644 --- a/apps/examples/blinkid-verify-simple/src/index.ts +++ b/apps/examples/blinkid-verify-simple/src/index.ts @@ -1,6 +1,6 @@ /** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ -import { BlinkIdVerifyScanningResult, createBlinkIdVerify } from "@microblink/blinkid-verify"; +import { createBlinkIdVerify } from "@microblink/blinkid-verify"; /** * This is the main component of the application. It creates the BlinkID verify instance. For additional configuration @@ -14,10 +14,25 @@ const blinkIdVerify = await createBlinkIdVerify({ }); /** - * This callback is called when the result is ready. This is useful if you want to perform some actions when the result - * is ready. For additional configuration look at the addOnResultCallback function. + * Runs after capture. The SDK posts to this page's origin at `/api/v3/verify`. The dev server forwards that request + * with `VERIFY_API_URL` and `VERIFY_API_KEY` from `.env.local`. */ -blinkIdVerify.addOnResultCallback((result: BlinkIdVerifyScanningResult) => { - console.log("Result:", result); - void blinkIdVerify.destroy(); +blinkIdVerify.verifyOnScanningCompletion({ + onSuccess: (result) => { + console.log("Verify result:", result); + void blinkIdVerify.destroy(); + }, + onError: async (error, resolver) => { + console.error("Verify failed:", error); + const status = error.status; + if (status !== undefined && status >= 500 && status < 600) { + const retry = await resolver.verifyCaptureResult(); + if (retry.ok) { + console.log("Verify result:", retry.result); + } else { + console.error("Verify retry failed:", retry.error); + } + } + void blinkIdVerify.destroy(); + }, }); diff --git a/apps/examples/blinkid-verify-simple/vite.config.ts b/apps/examples/blinkid-verify-simple/vite.config.ts index 0476c99d..c03aa1c4 100644 --- a/apps/examples/blinkid-verify-simple/vite.config.ts +++ b/apps/examples/blinkid-verify-simple/vite.config.ts @@ -3,6 +3,7 @@ import dns from "dns"; import { moveResources } from "@microblink/repo-utils"; +import { verifyApiDevProxy } from "@microblink/repo-utils/vite/verifyApiDevProxy.mts"; import { defineConfig, Plugin, ServerOptions } from "vite"; import mkcert from "vite-plugin-mkcert"; @@ -42,6 +43,7 @@ export default defineConfig((config) => { target: "es2022", }, plugins: [ + verifyApiDevProxy(), // symlink wasm resources to public/resources { name: "move-resources", diff --git a/docs/blinkid-verify/OssDependencies.md b/docs/blinkid-verify/OssDependencies.md index b9b1283b..c17b5a42 100644 --- a/docs/blinkid-verify/OssDependencies.md +++ b/docs/blinkid-verify/OssDependencies.md @@ -6,7 +6,7 @@ This report lists all open source dependencies used in the BlinkID Verify SDK pa This report includes: - **NPM Dependencies**: Production dependencies from all packages in the monorepo (124 packages) -- **C++ Dependencies**: Native dependencies for WebAssembly builds (25 unique packages) +- **C++ Dependencies**: Native dependencies for WebAssembly builds (26 unique packages) ## NPM Dependencies @@ -141,28 +141,29 @@ This report includes: | Package | License | URL | Description | |---------|---------|-----|-------------| -| adv-obfuscator | BSD-3-Clause-Clear | [Link](https://github.com/microblink/ADVObfuscator/archive/refs/tags/mb.20170904.2.tar.gz) | N/A | | concurrentqueue/1.0.4.mb.1 | BSD-2-Clause,BSL-1.0 | N/A | N/A | -| ConfigEx/0.1.0-docver.alpha.8 | MIT | [Link](https://github.com/microblink/config_ex) | N/A | +| ConfigEx/27.0.1 | MIT | [Link](https://github.com/microblink/config_ex) | N/A | +| core-identity++http_archive+adv-obfuscator | BSD-3-Clause-Clear | [Link](https://github.com/microblink/ADVObfuscator) | N/A | +| core-identity++http_archive+kiwaku | BSL-1.0 | [Link](https://github.com/microblink/kiwaku) | N/A | +| core-identity++http_archive+micro-ecc | BSD-2-Clause | [Link](https://github.com/microblink/micro-ecc) | N/A | +| core-identity++http_archive+qoixx | MIT | [Link](https://github.com/wx257osn2/qoixx) | N/A | +| core-identity++http_archive+utfcpp | BSL-1.0 | [Link](https://github.com/nemtrif/utfcpp) | N/A | +| core-identity++http_archive+zxing | Apache-2.0 | [Link](https://github.com/microblink/zxing) | N/A | +| core-identity++http_archive+zxing-cpp | Apache-2.0 | [Link](https://github.com/microblink/zxing-cpp) | N/A | | cpuinfo/0.0.0-20260312-7607ca5.mb.1 | BSD-2-Clause | N/A | N/A | -| eigen/5.0.1.bcr.1 | MPL-2.0 | N/A | N/A | -| Err/0.1.0-docver.alpha.8 | BSL-1.0 | [Link](https://github.com/microblink/err) | N/A | -| Functionoid/0.1.0-docver.alpha.8 | BSL-1.0 | [Link](https://github.com/microblink/functionoid) | N/A | -| Hash/0.1.0-docver.alpha.8 | Zlib | [Link](https://github.com/stbrumme/hash-library) | N/A | -| kiwaku | BSL-1.0 | [Link](https://github.com/microblink/kiwaku/archive/refs/tags/mb.20230809.4.tar.gz) | N/A | +| eigen/5.0.1.bcr.2 | MPL-2.0 | N/A | N/A | +| Err/27.0.1 | BSL-1.0 | [Link](https://github.com/microblink/err) | N/A | +| Functionoid/27.0.1 | BSL-1.0 | [Link](https://github.com/microblink/functionoid) | N/A | +| Hash/27.0.1 | Zlib | [Link](https://github.com/stbrumme/hash-library) | N/A | +| libbacktrace/1.0.0-20250926-7939218.mb.1 | BSD-3-Clause | N/A | N/A | | libdeflate/1.25 | MIT | N/A | N/A | -| libjpeg_turbo/3.1.3.bcr.4 | BSD-3-Clause-Modification,IJG,Zlib | N/A | N/A | -| libpng/1.6.54 | libpng-2.0 | N/A | N/A | -| micro-ecc | BSD-2-Clause | [Link](https://github.com/microblink/micro-ecc/archive/refs/tags/v1.0-mb.1.tar.gz) | N/A | -| MMap/0.1.0-docver.alpha.8 | BSL-1.0 | [Link](https://github.com/microblink/mmap) | N/A | -| opencv/4.13.0.mb.2 | Apache-2.0 | N/A | N/A | -| pimpl/0.1.0-docver.alpha.8 | BSD-2-Clause | [Link](https://github.com/microblink/pimpl) | N/A | +| libjpeg_turbo/3.1.3.bcr.6 | BSD-3-Clause-Modification,IJG,Zlib | N/A | N/A | +| libpng/1.6.58.bcr.1 | libpng-2.0 | N/A | N/A | +| MMap/27.0.1 | BSL-1.0 | [Link](https://github.com/microblink/mmap) | N/A | +| opencv/5.0.0.mb.4 | Apache-2.0 | N/A | N/A | +| pimpl/27.0.1 | BSD-2-Clause | [Link](https://github.com/microblink/pimpl) | N/A | | pthreadpool/0.0.0-20250926-560c60d.mb.1 | BSD-2-Clause | N/A | N/A | -| qoixx | MIT | [Link](https://github.com/wx257osn2/qoixx/archive/refs/tags/v0.1.7.tar.gz) | N/A | | rapidjson/1.1.0.mb.20250205 | MIT | N/A | N/A | -| sweater/0.1.0-docver.alpha.8 | MIT | [Link](https://github.com/microblink/sweater) | N/A | -| utfcpp | BSL-1.0 | [Link](https://github.com/nemtrif/utfcpp/archive/refs/tags/v4.0.9.tar.gz) | N/A | -| xnnpack/20230525.5.0 | BSD-3-Clause | [Link](https://github.com/microblink/XNNPACK) | N/A | -| zlib/1.3.2.mb.1 | Zlib | N/A | N/A | -| zxing | Apache-2.0 | [Link](https://github.com/microblink/zxing/archive/2fb1595417c4dd5604f36e10bad74cb934819ccf.zip) | N/A | -| zxing-cpp | Apache-2.0 | [Link](https://github.com/microblink/zxing-cpp/archive/refs/tags/3.0.2.mb.1.zip) | N/A | +| sweater/27.0.1 | MIT | [Link](https://github.com/microblink/sweater) | N/A | +| xnnpack/20230525.6.0 | BSD-3-Clause | [Link](https://github.com/microblink/XNNPACK) | N/A | +| zlib/1.3.2.mb.2 | Zlib | N/A | N/A | diff --git a/packages/blinkid-verify-core/CHANGELOG.md b/packages/blinkid-verify-core/CHANGELOG.md index 90ffa881..d816984d 100644 --- a/packages/blinkid-verify-core/CHANGELOG.md +++ b/packages/blinkid-verify-core/CHANGELOG.md @@ -1,10 +1,100 @@ # @microblink/blinkid-verify-core +## 4000.0.0 + +### Major Changes + +- Replaced the BlinkID Verify capture pipeline with a v3 session, consent, and Verify API surface. Session settings, consent, `getResult`, and Verify API submit are documented in this package. +- Removed `scanningSettings` from `BlinkIdVerifySessionSettings`. Pass `configuration` (`DocumentVerificationConfiguration`) and an optional `traceId`. These types are re-exported from this package. Choose the new verification values again; the old match-level names are not accepted. + - Replaced `scanningSettings` with `configuration` and optional `traceId`. + - Removed `manualReviewSensitivity` and `captureConditions` from `UseCase`. Use `configuration.verification.useCase` without those fields. + - Replaced `verificationPolicy` values `"permissive"`, `"standard"`, `"strict"`, and `"very-strict"` with `"high-conversion"`, `"balanced"`, and `"high-assurance"`. + - Replaced `treatExpirationAsFraud` with `configuration.verification.settings.rejectExpiredDocuments`. + - Replaced `ImageQualitySettings` and `ImageQualityInterpretation`, including `blurMatchLevel`, `glareMatchLevel`, `lightingMatchLevel`, `sharpnessMatchLevel`, `handOcclusionMatchLevel`, `dpiMatchLevel`, and `tiltMatchLevel`, with `configuration.imageAssessment.imageQualitySensitivity` and `configuration.verification.settings.imageQualityRetryPolicy`. + - Replaced `screenAnalysisMatchLevel` with `configuration.verification.settings.screenPresenceSensitivity`. + - Replaced `barcodeAnomalyMatchLevel` with `configuration.verification.settings.barcodeAuthenticitySensitivity`. + - Replaced `dataMatchMatchLevel` with `configuration.verification.settings.dataMatchSensitivity`. + - Removed `staticSecurityFeaturesMatchLevel`, `scanUnsupportedBack`, and `scanPassportDataPageOnly`. There is no replacement. + - Added `photocopySensitivity`, `portraitForgerySensitivity`, `generativeAiSensitivity`, and `cropAffectsVerdict` on `configuration.verification.settings`. + - Removed exports `ScanningSettings`, `ImageQualitySettings`, `ImageQualityInterpretation`, `ManualReviewSensitivity`, and `CaptureConditions`. There is no replacement. +- ```ts + const sessionSettings: BlinkIdVerifySessionSettings = { + traceId: "optional-correlation-id", + configuration: { + verification: { + useCase: { + verificationPolicy: "balanced", + manualReviewStrategy: "rejected-only", + verificationContext: "remote", + }, + settings: { + rejectExpiredDocuments: true, + screenPresenceSensitivity: "level-5", + dataMatchSensitivity: "level-3", + barcodeAuthenticitySensitivity: "level-4", + imageQualityRetryPolicy: "retry-bad-quality-for-rejections", + }, + }, + extraction: { + redactionSettings: { globalMode: "none" }, + documentCaptureModuleSettings: { + faceImageExtractionEnabled: true, + documentImageReturnEnabled: true, + }, + }, + imageAssessment: { imageQualitySensitivity: "level-2" }, + }, + }; + ``` +- Changed `getResult(consent?, resultDataMode?)` to return a `BlinkIdVerifySessionResult` (`serializedPayload` and optional `typedPayload`) instead of `frontFrame`, `backFrame`, and `barcodeFrame`. The result is no longer an Embind object, so do not call `delete()` on it. Image parts are `serializedPayload.imageFirstSide`, `imageSecondSide`, and `imageBarcode` (`jpegBytes` only; frame `orientation` was removed). Pass `"include-typed-payload"` to receive `typedPayload`. Optional `Consent` (`userId`, `durationDays`, optional `note`, `givenOn`, and `customerContext`) is included in the generated payload. +- ```ts + const consent: Consent = { + durationDays: 30, + userId: "end-user-id", + customerContext: { customerId: "acct-1", transactionId: "txn-9" }, + }; + const result = await session.getResult(consent, "include-typed-payload"); + const front = result.serializedPayload.imageFirstSide?.jpegBytes; + const typedConfiguration = result.typedPayload?.configuration; + ``` +- Removed `GeneratePayloadForBlinkidVerifyRequest`, `BlinkIdVerifyPayload`, and `BlinkIdVerifyRequestOptions`. `loadBlinkIdVerifyCore` returns one `BlinkIdVerifyCore`. Optional `verifyApiBaseUrl` defaults to `window.location.origin`. Relative values resolve against the page URL. Trailing slashes are stripped on the main thread. `createScanningSession` returns a `RemoteScanningSession` that always includes `prepareVerifyRequest` and `submitResult`. +- The SDK always POSTs `{resolved}/api/v3/verify` with `Content-Type` only and `credentials` set to `"same-origin"`. It sends no API key and no `Authorization` header. Send `PreparedVerifyRequest.body` as-is. The `sdkMetadata` signature covers those bytes, so do not rebuild `FormData` from the parts. The customer's server accepts that POST, forwards the multipart body unchanged, and adds `Authorization`. `submitResult` returns `VerifyApiResult`, the typed cloud verification response. Failures throw `VerifyApiError`; `toVerifyApiError` coerces unknown rejections. Submit requests time out after 20 seconds and are aborted by `reset()`, session deletion, and SDK termination. Former request options such as image return and redaction belong on `configuration.extraction` before capture. `microblinkProxyUrl` is unchanged and is only ping and Baltazar. +- ```ts + const core = await loadBlinkIdVerifyCore({ + licenseKey, + verifyApiBaseUrl: "https://example.com/verify-proxy", + }); + const session = await core.createScanningSession(sessionSettings); + const prepared = await session.prepareVerifyRequest(consent); + await fetch(prepared.url, { + method: prepared.method, + headers: prepared.headers, + body: prepared.body, + }); + try { + const verifyResult = await session.submitResult(consent); + } catch (error) { + throw toVerifyApiError(error); + } + ``` +- Removed `userId` from `BlinkIdVerifyInitSettings`. The SDK generates and persists the ping identifier. Put the end-user identity on `Consent.userId`, not on `loadBlinkIdVerifyCore`. +- Added `ScanningSide` (`"first"`, `"second"`, `"barcode"`), and `screenPresenceDetected` plus `scanningSide` on `InputImageAnalysisResult`. `scanningSide` reports the document side of the processed frame. + +### Minor Changes + +- Added the `simd-relaxed` and `simd-relaxed-threads` WebAssembly variants. Browsers that support relaxed SIMD now load these faster builds automatically, while other browsers keep using `simd` or `simd-threads`. The `wasmVariant` setting accepts the new variant names, and the shipped `resources/` tree contains the new variant directories. + +### Patch Changes + +- Updated dependencies + - @microblink/blinkid-verify-wasm@4000.0.0 + - @microblink/blinkid-verify-worker@4000.0.0 + ## 4000.0.0-next.1 ### Patch Changes -- Update declaration bundles +- Updated declaration bundles - Updated package dependencies. - Require HTTPS when loading cross-origin worker resources. - Speeds up BlinkID Verify initialization by compiling WebAssembly while it downloads. Resources served without the `application/wasm` content type or environments without streaming compilation continue to use buffered compilation. diff --git a/packages/blinkid-verify-core/docs/README.md b/packages/blinkid-verify-core/docs/README.md index ad924adc..d5d77272 100644 --- a/packages/blinkid-verify-core/docs/README.md +++ b/packages/blinkid-verify-core/docs/README.md @@ -8,55 +8,99 @@ - [AnalyticService](classes/AnalyticService.md) - [BlinkIdVerifyWorker](classes/BlinkIdVerifyWorker.md) +- [VerifyApiError](classes/VerifyApiError.md) ## Interfaces - [CapturedFrame](interfaces/CapturedFrame.md) - [PingBase](interfaces/PingBase.md) - [UADataValues](interfaces/UADataValues.md) +- [VerifyApiAdditionalProcessingInfo](interfaces/VerifyApiAdditionalProcessingInfo.md) +- [VerifyApiAddressDetailedInfo](interfaces/VerifyApiAddressDetailedInfo.md) +- [VerifyApiAlphabetString](interfaces/VerifyApiAlphabetString.md) +- [VerifyApiBarcodeData](interfaces/VerifyApiBarcodeData.md) +- [VerifyApiBarcodeDriverLicenceDetailedInfo](interfaces/VerifyApiBarcodeDriverLicenceDetailedInfo.md) +- [VerifyApiBarcodeExtendedElement](interfaces/VerifyApiBarcodeExtendedElement.md) +- [VerifyApiBarcodeModuleSettings](interfaces/VerifyApiBarcodeModuleSettings.md) +- [VerifyApiBarcodeResult](interfaces/VerifyApiBarcodeResult.md) +- [VerifyApiBarcodeVehicleClassInfo](interfaces/VerifyApiBarcodeVehicleClassInfo.md) +- [VerifyApiCheck](interfaces/VerifyApiCheck.md) +- [VerifyApiConfigurationUsed](interfaces/VerifyApiConfigurationUsed.md) +- [VerifyApiDateResult](interfaces/VerifyApiDateResult.md) +- [VerifyApiDependentInfo](interfaces/VerifyApiDependentInfo.md) +- [VerifyApiDocumentChecks](interfaces/VerifyApiDocumentChecks.md) +- [VerifyApiDocumentClassInfo](interfaces/VerifyApiDocumentClassInfo.md) +- [VerifyApiDocumentVerificationResponse](interfaces/VerifyApiDocumentVerificationResponse.md) +- [VerifyApiDriverLicenceDetailedInfo](interfaces/VerifyApiDriverLicenceDetailedInfo.md) +- [VerifyApiExtractionAdditionalProcessingInfo](interfaces/VerifyApiExtractionAdditionalProcessingInfo.md) +- [VerifyApiExtractionImages](interfaces/VerifyApiExtractionImages.md) +- [VerifyApiExtractionPipelineStage](interfaces/VerifyApiExtractionPipelineStage.md) +- [VerifyApiExtractionResult](interfaces/VerifyApiExtractionResult.md) +- [VerifyApiExtractionSubResults](interfaces/VerifyApiExtractionSubResults.md) +- [VerifyApiImageAssessment](interfaces/VerifyApiImageAssessment.md) +- [VerifyApiImageAssessmentConfiguration](interfaces/VerifyApiImageAssessmentConfiguration.md) +- [VerifyApiMrzResult](interfaces/VerifyApiMrzResult.md) +- [VerifyApiParentInfo](interfaces/VerifyApiParentInfo.md) +- [VerifyApiPipeline](interfaces/VerifyApiPipeline.md) +- [VerifyApiRedactionSettings](interfaces/VerifyApiRedactionSettings.md) +- [VerifyApiResponseMessage](interfaces/VerifyApiResponseMessage.md) +- [VerifyApiRuntimeInformation](interfaces/VerifyApiRuntimeInformation.md) +- [VerifyApiScanningDataResult](interfaces/VerifyApiScanningDataResult.md) +- [VerifyApiSimpleDateResult](interfaces/VerifyApiSimpleDateResult.md) +- [VerifyApiSingleSideScanningResult](interfaces/VerifyApiSingleSideScanningResult.md) +- [VerifyApiV3ErrorResponse](interfaces/VerifyApiV3ErrorResponse.md) +- [VerifyApiV3ValidationError](interfaces/VerifyApiV3ValidationError.md) +- [VerifyApiV3ValidationErrorResponse](interfaces/VerifyApiV3ValidationErrorResponse.md) +- [VerifyApiV3WorkerErrorResponse](interfaces/VerifyApiV3WorkerErrorResponse.md) +- [VerifyApiVehicleClassInfo](interfaces/VerifyApiVehicleClassInfo.md) +- [VerifyApiVerificationConfigurationUsed](interfaces/VerifyApiVerificationConfigurationUsed.md) +- [VerifyApiVerificationDocumentCaptureModuleSettings](interfaces/VerifyApiVerificationDocumentCaptureModuleSettings.md) +- [VerifyApiVerificationExtractionConfigurationUsed](interfaces/VerifyApiVerificationExtractionConfigurationUsed.md) +- [VerifyApiVerificationPipelineStage](interfaces/VerifyApiVerificationPipelineStage.md) +- [VerifyApiVerificationResult](interfaces/VerifyApiVerificationResult.md) +- [VerifyApiVerificationSettings](interfaces/VerifyApiVerificationSettings.md) +- [VerifyApiVerificationUseCase](interfaces/VerifyApiVerificationUseCase.md) +- [VerifyApiVizModuleSettings](interfaces/VerifyApiVizModuleSettings.md) - [WasmBindings](interfaces/WasmBindings.md) - [WasmModule](interfaces/WasmModule.md) ## Type Aliases +- [BarcodeModuleSettings](type-aliases/BarcodeModuleSettings.md) - [BlinkIdVerifyCore](type-aliases/BlinkIdVerifyCore.md) - [BlinkIdVerifyInitSettings](type-aliases/BlinkIdVerifyInitSettings.md) - [BlinkIdVerifyProcessResult](type-aliases/BlinkIdVerifyProcessResult.md) -- [BlinkIdVerifyRequestAnonymizationMode](type-aliases/BlinkIdVerifyRequestAnonymizationMode.md) -- [BlinkIdVerifyRequestCaptureConditions](type-aliases/BlinkIdVerifyRequestCaptureConditions.md) -- [BlinkIdVerifyRequestImageQualityInterpretation](type-aliases/BlinkIdVerifyRequestImageQualityInterpretation.md) -- [BlinkIdVerifyRequestManualReviewSensitivity](type-aliases/BlinkIdVerifyRequestManualReviewSensitivity.md) -- [BlinkIdVerifyRequestManualReviewStrategy](type-aliases/BlinkIdVerifyRequestManualReviewStrategy.md) -- [BlinkIdVerifyRequestMatchLevel](type-aliases/BlinkIdVerifyRequestMatchLevel.md) -- [BlinkIdVerifyRequestOptions](type-aliases/BlinkIdVerifyRequestOptions.md) -- [BlinkIdVerifyRequestVerificationContext](type-aliases/BlinkIdVerifyRequestVerificationContext.md) - [BlinkIdVerifyScanningResult](type-aliases/BlinkIdVerifyScanningResult.md) - [BlinkIdVerifyScanningSession](type-aliases/BlinkIdVerifyScanningSession.md) +- [BlinkIdVerifySessionResult](type-aliases/BlinkIdVerifySessionResult.md) - [BlinkIdVerifySessionSettings](type-aliases/BlinkIdVerifySessionSettings.md) - [BlinkIdVerifyWorkerInitSettings](type-aliases/BlinkIdVerifyWorkerInitSettings.md) - [BlinkIdVerifyWorkerProxy](type-aliases/BlinkIdVerifyWorkerProxy.md) - [BrowserStorageSupport](type-aliases/BrowserStorageSupport.md) -- [CaptureConditions](type-aliases/CaptureConditions.md) +- [Consent](type-aliases/Consent.md) +- [ConsentCustomerContext](type-aliases/ConsentCustomerContext.md) - [DerivedDeviceInfo](type-aliases/DerivedDeviceInfo.md) - [DetectionStatus](type-aliases/DetectionStatus.md) - [DeviceInfo](type-aliases/DeviceInfo.md) - [DeviceScreenInfo](type-aliases/DeviceScreenInfo.md) +- [DocumentCaptureModuleSettings](type-aliases/DocumentCaptureModuleSettings.md) - [DocumentOrientation](type-aliases/DocumentOrientation.md) - [DocumentRotation](type-aliases/DocumentRotation.md) +- [DocumentVerificationConfiguration](type-aliases/DocumentVerificationConfiguration.md) - [DownloadProgress](type-aliases/DownloadProgress.md) - [FormFactor](type-aliases/FormFactor.md) - [GpuInfo](type-aliases/GpuInfo.md) -- [ImageQualityInterpretation](type-aliases/ImageQualityInterpretation.md) -- [ImageQualitySettings](type-aliases/ImageQualitySettings.md) +- [ImageAssessmentConfiguration](type-aliases/ImageAssessmentConfiguration.md) +- [ImageQualityRetryPolicy](type-aliases/ImageQualityRetryPolicy.md) - [InputImageAnalysisResult](type-aliases/InputImageAnalysisResult.md) - [InputImageSource](type-aliases/InputImageSource.md) - [LicenseRequest](type-aliases/LicenseRequest.md) - [LicenseTokenState](type-aliases/LicenseTokenState.md) - [LicenseUnlockResult](type-aliases/LicenseUnlockResult.md) - [LoadWasmParams](type-aliases/LoadWasmParams.md) -- [ManualReviewSensitivity](type-aliases/ManualReviewSensitivity.md) - [ManualReviewStrategy](type-aliases/ManualReviewStrategy.md) - [MatchLevel](type-aliases/MatchLevel.md) +- [PayloadImage](type-aliases/PayloadImage.md) - [Ping](type-aliases/Ping.md) - [PingBrowserDeviceInfo](type-aliases/PingBrowserDeviceInfo.md) - [PingBrowserDeviceInfoData](type-aliases/PingBrowserDeviceInfoData.md) @@ -81,22 +125,93 @@ - [PingWrapperProductInfo](type-aliases/PingWrapperProductInfo.md) - [PingWrapperProductInfoData](type-aliases/PingWrapperProductInfoData.md) - [Point](type-aliases/Point.md) +- [PreparedVerifyRequest](type-aliases/PreparedVerifyRequest.md) - [ProcessingStatus](type-aliases/ProcessingStatus.md) - [ProcessResultWithBuffer](type-aliases/ProcessResultWithBuffer.md) - [ProgressStatusCallback](type-aliases/ProgressStatusCallback.md) - [Quadrilateral](type-aliases/Quadrilateral.md) +- [RedactionMode](type-aliases/RedactionMode.md) +- [RedactionSettings](type-aliases/RedactionSettings.md) - [RemoteScanningSession](type-aliases/RemoteScanningSession.md) - [ResourceFileType](type-aliases/ResourceFileType.md) - [ResultCompleteness](type-aliases/ResultCompleteness.md) -- [ReturnImageFormat](type-aliases/ReturnImageFormat.md) -- [ScanningSettings](type-aliases/ScanningSettings.md) +- [ResultDataMode](type-aliases/ResultDataMode.md) +- [ScanningSide](type-aliases/ScanningSide.md) - [ScanningStatus](type-aliases/ScanningStatus.md) - [SchemaName](type-aliases/SchemaName.md) +- [SerializedPayload](type-aliases/SerializedPayload.md) - [ServerPermissionErrorReason](type-aliases/ServerPermissionErrorReason.md) - [ServerPermissionSubmitError](type-aliases/ServerPermissionSubmitError.md) +- [SessionResult](type-aliases/SessionResult.md) +- [TypedPayload](type-aliases/TypedPayload.md) - [UseCase](type-aliases/UseCase.md) +- [VerificationConfiguration](type-aliases/VerificationConfiguration.md) - [VerificationContext](type-aliases/VerificationContext.md) +- [VerificationExtractionConfiguration](type-aliases/VerificationExtractionConfiguration.md) - [VerificationPolicy](type-aliases/VerificationPolicy.md) +- [VerificationSettings](type-aliases/VerificationSettings.md) +- [VerifyApiBarcodeAuthenticityChecks](type-aliases/VerifyApiBarcodeAuthenticityChecks.md) +- [VerifyApiBarcodeElementKey](type-aliases/VerifyApiBarcodeElementKey.md) +- [VerifyApiBarcodeElementKeyEnum](type-aliases/VerifyApiBarcodeElementKeyEnum.md) +- [VerifyApiCheckResult](type-aliases/VerifyApiCheckResult.md) +- [VerifyApiCheckResultEnum](type-aliases/VerifyApiCheckResultEnum.md) +- [VerifyApiCountry](type-aliases/VerifyApiCountry.md) +- [VerifyApiCountryEnum](type-aliases/VerifyApiCountryEnum.md) +- [VerifyApiDataFormatChecks](type-aliases/VerifyApiDataFormatChecks.md) +- [VerifyApiDataLogicChecks](type-aliases/VerifyApiDataLogicChecks.md) +- [VerifyApiDataMatchChecks](type-aliases/VerifyApiDataMatchChecks.md) +- [VerifyApiDateLogicChecks](type-aliases/VerifyApiDateLogicChecks.md) +- [VerifyApiDocumentLivenessChecks](type-aliases/VerifyApiDocumentLivenessChecks.md) +- [VerifyApiDocumentValidityChecks](type-aliases/VerifyApiDocumentValidityChecks.md) +- [VerifyApiDocumentVerificationPolicy](type-aliases/VerifyApiDocumentVerificationPolicy.md) +- [VerifyApiDocumentVerificationPolicyEnum](type-aliases/VerifyApiDocumentVerificationPolicyEnum.md) +- [VerifyApiExtractedDataChecks](type-aliases/VerifyApiExtractedDataChecks.md) +- [VerifyApiExtractionDataResult](type-aliases/VerifyApiExtractionDataResult.md) +- [VerifyApiExtractionPipelineStageStatus](type-aliases/VerifyApiExtractionPipelineStageStatus.md) +- [VerifyApiExtractionPipelineStageStatusEnum](type-aliases/VerifyApiExtractionPipelineStageStatusEnum.md) +- [VerifyApiFieldType](type-aliases/VerifyApiFieldType.md) +- [VerifyApiFieldTypeEnum](type-aliases/VerifyApiFieldTypeEnum.md) +- [VerifyApiGenericDataCheck](type-aliases/VerifyApiGenericDataCheck.md) +- [VerifyApiImageAnalysisDetectionStatus](type-aliases/VerifyApiImageAnalysisDetectionStatus.md) +- [VerifyApiImageAnalysisDetectionStatusEnum](type-aliases/VerifyApiImageAnalysisDetectionStatusEnum.md) +- [VerifyApiImageExtractionType](type-aliases/VerifyApiImageExtractionType.md) +- [VerifyApiImageExtractionTypeEnum](type-aliases/VerifyApiImageExtractionTypeEnum.md) +- [VerifyApiImageQualityRetryPolicy](type-aliases/VerifyApiImageQualityRetryPolicy.md) +- [VerifyApiImageQualityRetryPolicyEnum](type-aliases/VerifyApiImageQualityRetryPolicyEnum.md) +- [VerifyApiInjectionAttackChecks](type-aliases/VerifyApiInjectionAttackChecks.md) +- [VerifyApiMrtdDocumentType](type-aliases/VerifyApiMrtdDocumentType.md) +- [VerifyApiMrtdDocumentTypeEnum](type-aliases/VerifyApiMrtdDocumentTypeEnum.md) +- [VerifyApiMrzChecks](type-aliases/VerifyApiMrzChecks.md) +- [VerifyApiMultiSideCheck](type-aliases/VerifyApiMultiSideCheck.md) +- [VerifyApiOpenEnumValue](type-aliases/VerifyApiOpenEnumValue.md) +- [VerifyApiPassesAtOrBelowSensitivity](type-aliases/VerifyApiPassesAtOrBelowSensitivity.md) +- [VerifyApiPassesAtOrBelowSensitivityEnum](type-aliases/VerifyApiPassesAtOrBelowSensitivityEnum.md) +- [VerifyApiProcessingStatus](type-aliases/VerifyApiProcessingStatus.md) +- [VerifyApiProcessingStatusEnum](type-aliases/VerifyApiProcessingStatusEnum.md) +- [VerifyApiRedactionMode](type-aliases/VerifyApiRedactionMode.md) +- [VerifyApiRedactionModeEnum](type-aliases/VerifyApiRedactionModeEnum.md) +- [VerifyApiRegion](type-aliases/VerifyApiRegion.md) +- [VerifyApiRegionEnum](type-aliases/VerifyApiRegionEnum.md) +- [VerifyApiResult](type-aliases/VerifyApiResult.md) +- [VerifyApiReviewStrategy](type-aliases/VerifyApiReviewStrategy.md) +- [VerifyApiReviewStrategyEnum](type-aliases/VerifyApiReviewStrategyEnum.md) +- [VerifyApiSensitivity](type-aliases/VerifyApiSensitivity.md) +- [VerifyApiSensitivityEnum](type-aliases/VerifyApiSensitivityEnum.md) +- [VerifyApiTieredCheck](type-aliases/VerifyApiTieredCheck.md) +- [VerifyApiTieredMultiSideCheck](type-aliases/VerifyApiTieredMultiSideCheck.md) +- [VerifyApiType](type-aliases/VerifyApiType.md) +- [VerifyApiTypeEnum](type-aliases/VerifyApiTypeEnum.md) +- [VerifyApiV3ValidationErrorCode](type-aliases/VerifyApiV3ValidationErrorCode.md) +- [VerifyApiV3ValidationErrorCodeEnum](type-aliases/VerifyApiV3ValidationErrorCodeEnum.md) +- [VerifyApiVerdict](type-aliases/VerifyApiVerdict.md) +- [VerifyApiVerdictEnum](type-aliases/VerifyApiVerdictEnum.md) +- [VerifyApiVerificationContext](type-aliases/VerifyApiVerificationContext.md) +- [VerifyApiVerificationContextEnum](type-aliases/VerifyApiVerificationContextEnum.md) +- [VerifyApiVerificationPipelineStageStatus](type-aliases/VerifyApiVerificationPipelineStageStatus.md) +- [VerifyApiVerificationPipelineStageStatusEnum](type-aliases/VerifyApiVerificationPipelineStageStatusEnum.md) +- [VerifyApiVisualChecks](type-aliases/VerifyApiVisualChecks.md) +- [VerifyApiVizResult](type-aliases/VerifyApiVizResult.md) +- [VizModuleSettings](type-aliases/VizModuleSettings.md) - [WasmBuildType](type-aliases/WasmBuildType.md) - [WasmVariant](type-aliases/WasmVariant.md) - [WorkerScanningSession](type-aliases/WorkerScanningSession.md) @@ -112,8 +227,8 @@ - [createDerivedDeviceInfo](functions/createDerivedDeviceInfo.md) - [createProxyWorker](functions/createProxyWorker.md) -- [GeneratePayloadForBlinkidVerifyRequest](functions/GeneratePayloadForBlinkidVerifyRequest.md) - [getDeviceInfo](functions/getDeviceInfo.md) - [getUserAgentData](functions/getUserAgentData.md) - [getUserId](functions/getUserId.md) - [loadBlinkIdVerifyCore](functions/loadBlinkIdVerifyCore.md) +- [toVerifyApiError](functions/toVerifyApiError.md) diff --git a/packages/blinkid-verify-core/docs/classes/BlinkIdVerifyWorker.md b/packages/blinkid-verify-core/docs/classes/BlinkIdVerifyWorker.md index 5c2b1638..8e94a40f 100644 --- a/packages/blinkid-verify-core/docs/classes/BlinkIdVerifyWorker.md +++ b/packages/blinkid-verify-core/docs/classes/BlinkIdVerifyWorker.md @@ -42,7 +42,7 @@ This method is called when the worker is terminated. ### createScanningSession() -> **createScanningSession**(`sessionSettings?`): `Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"`\> & `object` & `ProxyMarked` +> **createScanningSession**(`sessionSettings?`): `Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"` \| `"setVerifyApiBaseUrl"`\> & `object` & `ProxyMarked` This method creates a BlinkIdVerify scanning session. @@ -50,7 +50,7 @@ This method creates a BlinkIdVerify scanning session. ##### sessionSettings? -`Partial`\<\{ `inputImageSource`: [`InputImageSource`](../type-aliases/InputImageSource.md); `scanningSettings`: [`ScanningSettings`](../type-aliases/ScanningSettings.md); \}\> +`Partial`\<\{ `configuration`: [`DocumentVerificationConfiguration`](../type-aliases/DocumentVerificationConfiguration.md); `inputImageSource`: [`InputImageSource`](../type-aliases/InputImageSource.md); `traceId`: `string`; \}\> The options for the session. diff --git a/packages/blinkid-verify-core/docs/classes/VerifyApiError.md b/packages/blinkid-verify-core/docs/classes/VerifyApiError.md new file mode 100644 index 00000000..7db3fac3 --- /dev/null +++ b/packages/blinkid-verify-core/docs/classes/VerifyApiError.md @@ -0,0 +1,59 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiError + +# Class: VerifyApiError + +Failed BlinkID Verify API request. + +## Extends + +- `Error` + +## Constructors + +### Constructor + +> **new VerifyApiError**(`message`, `options?`): `VerifyApiError` + +#### Parameters + +##### message + +`string` + +##### options? + +###### body? + +`unknown` + +###### cause? + +`unknown` + +###### status? + +`number` + +#### Returns + +`VerifyApiError` + +#### Overrides + +`Error.constructor` + +## Properties + +### body? + +> `readonly` `optional` **body?**: `unknown` + +*** + +### status? + +> `readonly` `optional` **status?**: `number` diff --git a/packages/blinkid-verify-core/docs/functions/GeneratePayloadForBlinkidVerifyRequest.md b/packages/blinkid-verify-core/docs/functions/GeneratePayloadForBlinkidVerifyRequest.md deleted file mode 100644 index 41884d08..00000000 --- a/packages/blinkid-verify-core/docs/functions/GeneratePayloadForBlinkidVerifyRequest.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / GeneratePayloadForBlinkidVerifyRequest - -# Function: GeneratePayloadForBlinkidVerifyRequest() - -> **GeneratePayloadForBlinkidVerifyRequest**(`result`, `sessionId`, `settings`, `options?`): `BlinkIdVerifyPayload` - -Builds the JSON payload for the BlinkID Verify Cloud API from a completed scanning result. - -Maps internal SDK enum values (kebab-case) to their API-facing PascalCase equivalents and encodes captured document -frames as base64 JPEG strings. - -## Parameters - -### result - -[`BlinkIdVerifyScanningResult`](../type-aliases/BlinkIdVerifyScanningResult.md) - -The scanning result produced by the BlinkIdVerify SDK. - -### sessionId - -`string` - -The unique identifier of the capture session to include in the payload. - -### settings - -[`ScanningSettings`](../type-aliases/ScanningSettings.md) - -The scanning settings used during the session, used to derive verification options. - -### options? - -[`BlinkIdVerifyRequestOptions`](../type-aliases/BlinkIdVerifyRequestOptions.md) - -Optional caller-supplied overrides for anonymization, image return, and match levels. - -## Returns - -`BlinkIdVerifyPayload` - -The fully constructed payload ready to be submitted to the BlinkID Verify Cloud API. diff --git a/packages/blinkid-verify-core/docs/functions/loadBlinkIdVerifyCore.md b/packages/blinkid-verify-core/docs/functions/loadBlinkIdVerifyCore.md index c5c31e37..8e26795b 100644 --- a/packages/blinkid-verify-core/docs/functions/loadBlinkIdVerifyCore.md +++ b/packages/blinkid-verify-core/docs/functions/loadBlinkIdVerifyCore.md @@ -6,10 +6,12 @@ # Function: loadBlinkIdVerifyCore() -> **loadBlinkIdVerifyCore**(`settings`, `progressCallback?`): `Promise`\<\{ `progressStatusCallback?`: `Promise`\<`undefined`\> \| `Remote`\<[`ProgressStatusCallback`](../type-aliases/ProgressStatusCallback.md)\>; `createScanningSession`: `Promise`\<`Remote`\<`Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"`\> & `object` & `ProxyMarked`\>\>; `initBlinkIdVerify`: `Promise`\<`void`\>; `reportPinglet`: `Promise`\<`void`\>; `sendPinglets`: `Promise`\<`void`\>; `terminate`: `Promise`\<`void`\>; \}\> +> **loadBlinkIdVerifyCore**(`settings`, `progressCallback?`): `Promise`\<\{ `progressStatusCallback?`: `Promise`\<`undefined`\> \| `Remote`\<[`ProgressStatusCallback`](../type-aliases/ProgressStatusCallback.md)\>; `createScanningSession`: `Promise`\<`Remote`\<`Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"` \| `"setVerifyApiBaseUrl"`\> & `object` & `ProxyMarked`\>\>; `initBlinkIdVerify`: `Promise`\<`void`\>; `reportPinglet`: `Promise`\<`void`\>; `sendPinglets`: `Promise`\<`void`\>; `terminate`: `Promise`\<`void`\>; \}\> Creates and initializes a BlinkIdVerify core instance. +Resolves `verifyApiBaseUrl` to an absolute URL on the main thread and passes that string to the worker. + ## Parameters ### settings @@ -60,11 +62,15 @@ The URL of the Microblink proxy server. This proxy handles requests to Microblin The parent directory where the `/resources` directory is hosted. Defaults to `window.location.href`, at the root of the current page. -#### userId? +#### verifyApiBaseUrl? `string` -A unique identifier for the user/session. Used for analytics and tracking purposes. +Base URL for Verify API requests. + +Omitted means `window.location.origin`. Relative values resolve against the page URL. The SDK always POSTs to +`{resolved}/api/v3/verify`. The customer's server owns the real Verify host and the API key; the SDK sends no +Authorization header. This is not `microblinkProxyUrl` (that remains ping/Baltazar only). #### wasmVariant? @@ -80,9 +86,9 @@ Optional callback for tracking resource download progress (WASM, data files) ## Returns -`Promise`\<\{ `progressStatusCallback?`: `Promise`\<`undefined`\> \| `Remote`\<[`ProgressStatusCallback`](../type-aliases/ProgressStatusCallback.md)\>; `createScanningSession`: `Promise`\<`Remote`\<`Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"`\> & `object` & `ProxyMarked`\>\>; `initBlinkIdVerify`: `Promise`\<`void`\>; `reportPinglet`: `Promise`\<`void`\>; `sendPinglets`: `Promise`\<`void`\>; `terminate`: `Promise`\<`void`\>; \}\> +`Promise`\<\{ `progressStatusCallback?`: `Promise`\<`undefined`\> \| `Remote`\<[`ProgressStatusCallback`](../type-aliases/ProgressStatusCallback.md)\>; `createScanningSession`: `Promise`\<`Remote`\<`Omit`\<[`BlinkIdVerifyScanningSession`](../type-aliases/BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"` \| `"setVerifyApiBaseUrl"`\> & `object` & `ProxyMarked`\>\>; `initBlinkIdVerify`: `Promise`\<`void`\>; `reportPinglet`: `Promise`\<`void`\>; `sendPinglets`: `Promise`\<`void`\>; `terminate`: `Promise`\<`void`\>; \}\> -Promise that resolves with initialized BlinkIdVerify core instance +Promise that resolves with the initialized BlinkID Verify core ## Throws diff --git a/packages/blinkid-verify-core/docs/functions/toVerifyApiError.md b/packages/blinkid-verify-core/docs/functions/toVerifyApiError.md new file mode 100644 index 00000000..8e85dfc3 --- /dev/null +++ b/packages/blinkid-verify-core/docs/functions/toVerifyApiError.md @@ -0,0 +1,21 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / toVerifyApiError + +# Function: toVerifyApiError() + +> **toVerifyApiError**(`error`): [`VerifyApiError`](../classes/VerifyApiError.md) + +Coerces an unknown rejection into [VerifyApiError](../classes/VerifyApiError.md). + +## Parameters + +### error + +`unknown` + +## Returns + +[`VerifyApiError`](../classes/VerifyApiError.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiAdditionalProcessingInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAdditionalProcessingInfo.md new file mode 100644 index 00000000..8d19910d --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAdditionalProcessingInfo.md @@ -0,0 +1,43 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiAdditionalProcessingInfo + +# Interface: VerifyApiAdditionalProcessingInfo + +## Properties + +### extraPresentFields? + +> `optional` **extraPresentFields?**: [`VerifyApiFieldType`](../type-aliases/VerifyApiFieldType.md)[] + +*** + +### imageExtractionFailures? + +> `optional` **imageExtractionFailures?**: [`VerifyApiImageExtractionType`](../type-aliases/VerifyApiImageExtractionType.md)[] + +*** + +### invalidCharacterFields? + +> `optional` **invalidCharacterFields?**: [`VerifyApiFieldType`](../type-aliases/VerifyApiFieldType.md)[] + +*** + +### missingMandatoryFields? + +> `optional` **missingMandatoryFields?**: [`VerifyApiFieldType`](../type-aliases/VerifyApiFieldType.md)[] + +*** + +### processingStatus? + +> `optional` **processingStatus?**: [`VerifyApiProcessingStatus`](../type-aliases/VerifyApiProcessingStatus.md) + +*** + +### realIdDetectionStatus? + +> `optional` **realIdDetectionStatus?**: [`VerifyApiImageAnalysisDetectionStatus`](../type-aliases/VerifyApiImageAnalysisDetectionStatus.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiAddressDetailedInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAddressDetailedInfo.md new file mode 100644 index 00000000..7d1bd94a --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAddressDetailedInfo.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiAddressDetailedInfo + +# Interface: VerifyApiAddressDetailedInfo + +## Properties + +### city? + +> `optional` **city?**: `string` + +*** + +### jurisdiction? + +> `optional` **jurisdiction?**: `string` + +*** + +### postalCode? + +> `optional` **postalCode?**: `string` + +*** + +### street? + +> `optional` **street?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiAlphabetString.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAlphabetString.md new file mode 100644 index 00000000..3fe7ba4f --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiAlphabetString.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiAlphabetString + +# Interface: VerifyApiAlphabetString + +## Properties + +### arabic? + +> `optional` **arabic?**: `string` + +*** + +### cyrillic? + +> `optional` **cyrillic?**: `string` + +*** + +### greek? + +> `optional` **greek?**: `string` + +*** + +### latin? + +> `optional` **latin?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeData.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeData.md new file mode 100644 index 00000000..3c55a645 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeData.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeData + +# Interface: VerifyApiBarcodeData + +## Properties + +### barcodeType? + +> `optional` **barcodeType?**: `string` + +*** + +### rawData? + +> `optional` **rawData?**: `string` + +*** + +### stringData? + +> `optional` **stringData?**: `string` + +*** + +### uncertain? + +> `optional` **uncertain?**: `boolean` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeDriverLicenceDetailedInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeDriverLicenceDetailedInfo.md new file mode 100644 index 00000000..c4c8b2d5 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeDriverLicenceDetailedInfo.md @@ -0,0 +1,37 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeDriverLicenceDetailedInfo + +# Interface: VerifyApiBarcodeDriverLicenceDetailedInfo + +## Properties + +### conditions? + +> `optional` **conditions?**: `string` + +*** + +### endorsements? + +> `optional` **endorsements?**: `string` + +*** + +### restrictions? + +> `optional` **restrictions?**: `string` + +*** + +### vehicleClass? + +> `optional` **vehicleClass?**: `string` + +*** + +### vehicleClassesInfo? + +> `optional` **vehicleClassesInfo?**: [`VerifyApiBarcodeVehicleClassInfo`](VerifyApiBarcodeVehicleClassInfo.md)[] diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeExtendedElement.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeExtendedElement.md new file mode 100644 index 00000000..0f0724ef --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeExtendedElement.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeExtendedElement + +# Interface: VerifyApiBarcodeExtendedElement + +## Properties + +### key + +> **key**: [`VerifyApiBarcodeElementKey`](../type-aliases/VerifyApiBarcodeElementKey.md) + +*** + +### value + +> **value**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeModuleSettings.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeModuleSettings.md new file mode 100644 index 00000000..a1454859 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeModuleSettings.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeModuleSettings + +# Interface: VerifyApiBarcodeModuleSettings + +## Properties + +### barcodeImageReturnEnabled? + +> `optional` **barcodeImageReturnEnabled?**: `boolean` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeResult.md new file mode 100644 index 00000000..8d82d446 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeResult.md @@ -0,0 +1,169 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeResult + +# Interface: VerifyApiBarcodeResult + +## Properties + +### additionalNameInformation? + +> `optional` **additionalNameInformation?**: `string` + +*** + +### address? + +> `optional` **address?**: `string` + +*** + +### addressDetailedInfo? + +> `optional` **addressDetailedInfo?**: [`VerifyApiAddressDetailedInfo`](VerifyApiAddressDetailedInfo.md) + +*** + +### barcodeData? + +> `optional` **barcodeData?**: [`VerifyApiBarcodeData`](VerifyApiBarcodeData.md) + +*** + +### dateOfBirth? + +> `optional` **dateOfBirth?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### dateOfExpiry? + +> `optional` **dateOfExpiry?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### dateOfIssue? + +> `optional` **dateOfIssue?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### documentAdditionalNumber? + +> `optional` **documentAdditionalNumber?**: `string` + +*** + +### documentNumber? + +> `optional` **documentNumber?**: `string` + +*** + +### driverLicenseDetailedInfo? + +> `optional` **driverLicenseDetailedInfo?**: [`VerifyApiBarcodeDriverLicenceDetailedInfo`](VerifyApiBarcodeDriverLicenceDetailedInfo.md) + +*** + +### employer? + +> `optional` **employer?**: `string` + +*** + +### extendedElements? + +> `optional` **extendedElements?**: [`VerifyApiBarcodeExtendedElement`](VerifyApiBarcodeExtendedElement.md)[] + +*** + +### firstName? + +> `optional` **firstName?**: `string` + +*** + +### fullName? + +> `optional` **fullName?**: `string` + +*** + +### issuingAuthority? + +> `optional` **issuingAuthority?**: `string` + +*** + +### lastName? + +> `optional` **lastName?**: `string` + +*** + +### maritalStatus? + +> `optional` **maritalStatus?**: `string` + +*** + +### middleName? + +> `optional` **middleName?**: `string` + +*** + +### nationality? + +> `optional` **nationality?**: `string` + +*** + +### parsed? + +> `optional` **parsed?**: `boolean` + +*** + +### personalIdNumber? + +> `optional` **personalIdNumber?**: `string` + +*** + +### placeOfBirth? + +> `optional` **placeOfBirth?**: `string` + +*** + +### profession? + +> `optional` **profession?**: `string` + +*** + +### race? + +> `optional` **race?**: `string` + +*** + +### religion? + +> `optional` **religion?**: `string` + +*** + +### residentialStatus? + +> `optional` **residentialStatus?**: `string` + +*** + +### sex? + +> `optional` **sex?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeVehicleClassInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeVehicleClassInfo.md new file mode 100644 index 00000000..de637587 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiBarcodeVehicleClassInfo.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeVehicleClassInfo + +# Interface: VerifyApiBarcodeVehicleClassInfo + +## Properties + +### effectiveDate? + +> `optional` **effectiveDate?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### expiryDate? + +> `optional` **expiryDate?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### vehicleClass? + +> `optional` **vehicleClass?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiCheck.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiCheck.md new file mode 100644 index 00000000..678bb46b --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiCheck.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiCheck + +# Interface: VerifyApiCheck + +## Properties + +### result + +> **result**: [`VerifyApiCheckResult`](../type-aliases/VerifyApiCheckResult.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiConfigurationUsed.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiConfigurationUsed.md new file mode 100644 index 00000000..4f056e28 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiConfigurationUsed.md @@ -0,0 +1,27 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiConfigurationUsed + +# Interface: VerifyApiConfigurationUsed + +## Properties + +### extraction? + +> `optional` **extraction?**: [`VerifyApiVerificationExtractionConfigurationUsed`](VerifyApiVerificationExtractionConfigurationUsed.md) + +*** + +### imageAssessment? + +> `optional` **imageAssessment?**: [`VerifyApiImageAssessmentConfiguration`](VerifyApiImageAssessmentConfiguration.md) + +Shared image-assessment settings for /api/v3/verify and /api/v3/extract. + +*** + +### verification? + +> `optional` **verification?**: [`VerifyApiVerificationConfigurationUsed`](VerifyApiVerificationConfigurationUsed.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDateResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDateResult.md new file mode 100644 index 00000000..6b54662b --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDateResult.md @@ -0,0 +1,55 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDateResult + +# Interface: VerifyApiDateResult + +## Properties + +### day? + +> `optional` **day?**: `number` + +#### Format + +int32 + +*** + +### filledByDomainKnowledge? + +> `optional` **filledByDomainKnowledge?**: `boolean` + +*** + +### month? + +> `optional` **month?**: `number` + +#### Format + +int32 + +*** + +### originalString? + +> `optional` **originalString?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### successfullyParsed? + +> `optional` **successfullyParsed?**: `boolean` + +*** + +### year? + +> `optional` **year?**: `number` + +#### Format + +int32 diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDependentInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDependentInfo.md new file mode 100644 index 00000000..671ed740 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDependentInfo.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDependentInfo + +# Interface: VerifyApiDependentInfo + +## Properties + +### dateOfBirth? + +> `optional` **dateOfBirth?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### documentNumber? + +> `optional` **documentNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### fullName? + +> `optional` **fullName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### sex? + +> `optional` **sex?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentChecks.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentChecks.md new file mode 100644 index 00000000..93d93a5e --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentChecks.md @@ -0,0 +1,37 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentChecks + +# Interface: VerifyApiDocumentChecks + +## Properties + +### documentLivenessCheck? + +> `optional` **documentLivenessCheck?**: [`VerifyApiDocumentLivenessChecks`](../type-aliases/VerifyApiDocumentLivenessChecks.md) + +*** + +### documentValidityCheck? + +> `optional` **documentValidityCheck?**: [`VerifyApiDocumentValidityChecks`](../type-aliases/VerifyApiDocumentValidityChecks.md) + +*** + +### extractedDataCheck? + +> `optional` **extractedDataCheck?**: [`VerifyApiExtractedDataChecks`](../type-aliases/VerifyApiExtractedDataChecks.md) + +*** + +### injectionAttackCheck? + +> `optional` **injectionAttackCheck?**: [`VerifyApiInjectionAttackChecks`](../type-aliases/VerifyApiInjectionAttackChecks.md) + +*** + +### visualCheck? + +> `optional` **visualCheck?**: [`VerifyApiVisualChecks`](../type-aliases/VerifyApiVisualChecks.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentClassInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentClassInfo.md new file mode 100644 index 00000000..e6cc9115 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentClassInfo.md @@ -0,0 +1,49 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentClassInfo + +# Interface: VerifyApiDocumentClassInfo + +## Properties + +### country? + +> `optional` **country?**: [`VerifyApiCountry`](../type-aliases/VerifyApiCountry.md) + +*** + +### countryName? + +> `optional` **countryName?**: `string` + +*** + +### isoAlpha2CountryCode? + +> `optional` **isoAlpha2CountryCode?**: `string` + +*** + +### isoAlpha3CountryCode? + +> `optional` **isoAlpha3CountryCode?**: `string` + +*** + +### isoNumericCountryCode? + +> `optional` **isoNumericCountryCode?**: `string` + +*** + +### region? + +> `optional` **region?**: [`VerifyApiRegion`](../type-aliases/VerifyApiRegion.md) + +*** + +### type? + +> `optional` **type?**: [`VerifyApiType`](../type-aliases/VerifyApiType.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentVerificationResponse.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentVerificationResponse.md new file mode 100644 index 00000000..17e26a8d --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDocumentVerificationResponse.md @@ -0,0 +1,55 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentVerificationResponse + +# Interface: VerifyApiDocumentVerificationResponse + +## Properties + +### configurationUsed + +> **configurationUsed**: [`VerifyApiConfigurationUsed`](VerifyApiConfigurationUsed.md) + +*** + +### extraction + +> **extraction**: [`VerifyApiExtractionResult`](VerifyApiExtractionResult.md) + +*** + +### imageAssessment + +> **imageAssessment**: [`VerifyApiImageAssessment`](VerifyApiImageAssessment.md) + +*** + +### images? + +> `optional` **images?**: [`VerifyApiExtractionImages`](VerifyApiExtractionImages.md) + +*** + +### messages? + +> `optional` **messages?**: [`VerifyApiResponseMessage`](VerifyApiResponseMessage.md)[] + +*** + +### pipeline + +> **pipeline**: [`VerifyApiPipeline`](VerifyApiPipeline.md) + +*** + +### runtime + +> **runtime**: [`VerifyApiRuntimeInformation`](VerifyApiRuntimeInformation.md) + +*** + +### verification + +> **verification**: [`VerifyApiVerificationResult`](VerifyApiVerificationResult.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiDriverLicenceDetailedInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDriverLicenceDetailedInfo.md new file mode 100644 index 00000000..a36b6f62 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiDriverLicenceDetailedInfo.md @@ -0,0 +1,37 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDriverLicenceDetailedInfo + +# Interface: VerifyApiDriverLicenceDetailedInfo + +## Properties + +### conditions? + +> `optional` **conditions?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### endorsements? + +> `optional` **endorsements?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### restrictions? + +> `optional` **restrictions?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### vehicleClass? + +> `optional` **vehicleClass?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### vehicleClassesInfo? + +> `optional` **vehicleClassesInfo?**: [`VerifyApiVehicleClassInfo`](VerifyApiVehicleClassInfo.md)[] diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionAdditionalProcessingInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionAdditionalProcessingInfo.md new file mode 100644 index 00000000..3f27eda5 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionAdditionalProcessingInfo.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionAdditionalProcessingInfo + +# Interface: VerifyApiExtractionAdditionalProcessingInfo + +## Properties + +### firstSide? + +> `optional` **firstSide?**: [`VerifyApiAdditionalProcessingInfo`](VerifyApiAdditionalProcessingInfo.md) + +*** + +### secondSide? + +> `optional` **secondSide?**: [`VerifyApiAdditionalProcessingInfo`](VerifyApiAdditionalProcessingInfo.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionImages.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionImages.md new file mode 100644 index 00000000..abf1752b --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionImages.md @@ -0,0 +1,37 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionImages + +# Interface: VerifyApiExtractionImages + +## Properties + +### barcode? + +> `optional` **barcode?**: `string` + +*** + +### face? + +> `optional` **face?**: `string` + +*** + +### firstSideCropped? + +> `optional` **firstSideCropped?**: `string` + +*** + +### secondSideCropped? + +> `optional` **secondSideCropped?**: `string` + +*** + +### signature? + +> `optional` **signature?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionPipelineStage.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionPipelineStage.md new file mode 100644 index 00000000..ad023aa3 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionPipelineStage.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionPipelineStage + +# Interface: VerifyApiExtractionPipelineStage + +## Properties + +### status + +> **status**: [`VerifyApiExtractionPipelineStageStatus`](../type-aliases/VerifyApiExtractionPipelineStageStatus.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionResult.md new file mode 100644 index 00000000..6f6014b4 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionResult.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionResult + +# Interface: VerifyApiExtractionResult + +## Properties + +### additionalProcessingInfo? + +> `optional` **additionalProcessingInfo?**: [`VerifyApiExtractionAdditionalProcessingInfo`](VerifyApiExtractionAdditionalProcessingInfo.md) + +*** + +### processingStatus + +> **processingStatus**: [`VerifyApiProcessingStatus`](../type-aliases/VerifyApiProcessingStatus.md) + +*** + +### result + +> **result**: [`VerifyApiExtractionDataResult`](../type-aliases/VerifyApiExtractionDataResult.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionSubResults.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionSubResults.md new file mode 100644 index 00000000..763bc43f --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiExtractionSubResults.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionSubResults + +# Interface: VerifyApiExtractionSubResults + +## Properties + +### firstSide? + +> `optional` **firstSide?**: [`VerifyApiSingleSideScanningResult`](VerifyApiSingleSideScanningResult.md) + +*** + +### secondSide? + +> `optional` **secondSide?**: [`VerifyApiSingleSideScanningResult`](VerifyApiSingleSideScanningResult.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessment.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessment.md new file mode 100644 index 00000000..cf149b92 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessment.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageAssessment + +# Interface: VerifyApiImageAssessment + +## Properties + +### croppedDocumentCheck? + +> `optional` **croppedDocumentCheck?**: [`VerifyApiMultiSideCheck`](../type-aliases/VerifyApiMultiSideCheck.md) + +*** + +### handPresenceCheck? + +> `optional` **handPresenceCheck?**: [`VerifyApiMultiSideCheck`](../type-aliases/VerifyApiMultiSideCheck.md) + +*** + +### imageQualityCheck? + +> `optional` **imageQualityCheck?**: [`VerifyApiCheck`](VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessmentConfiguration.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessmentConfiguration.md new file mode 100644 index 00000000..5172e44d --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiImageAssessmentConfiguration.md @@ -0,0 +1,18 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageAssessmentConfiguration + +# Interface: VerifyApiImageAssessmentConfiguration + +Shared image-assessment settings for /api/v3/verify and /api/v3/extract. + +## Properties + +### imageQualitySensitivity? + +> `optional` **imageQualitySensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +Single sensitivity applied uniformly to all image-quality dimensions. On /api/v3/verify, verificationPolicy may +adjust the effective value. diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiMrzResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiMrzResult.md new file mode 100644 index 00000000..5a5a7461 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiMrzResult.md @@ -0,0 +1,139 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiMrzResult + +# Interface: VerifyApiMrzResult + +## Properties + +### dateOfBirth? + +> `optional` **dateOfBirth?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### dateOfExpiry? + +> `optional` **dateOfExpiry?**: [`VerifyApiSimpleDateResult`](VerifyApiSimpleDateResult.md) + +*** + +### documentCode? + +> `optional` **documentCode?**: `string` + +*** + +### documentNumber? + +> `optional` **documentNumber?**: `string` + +*** + +### documentType? + +> `optional` **documentType?**: [`VerifyApiMrtdDocumentType`](../type-aliases/VerifyApiMrtdDocumentType.md) + +*** + +### gender? + +> `optional` **gender?**: `string` + +*** + +### issuer? + +> `optional` **issuer?**: `string` + +*** + +### issuerName? + +> `optional` **issuerName?**: `string` + +*** + +### nationality? + +> `optional` **nationality?**: `string` + +*** + +### nationalityName? + +> `optional` **nationalityName?**: `string` + +*** + +### opt1? + +> `optional` **opt1?**: `string` + +*** + +### opt2? + +> `optional` **opt2?**: `string` + +*** + +### primaryId? + +> `optional` **primaryId?**: `string` + +*** + +### rawMrzString? + +> `optional` **rawMrzString?**: `string` + +*** + +### sanitizedDocumentCode? + +> `optional` **sanitizedDocumentCode?**: `string` + +*** + +### sanitizedDocumentNumber? + +> `optional` **sanitizedDocumentNumber?**: `string` + +*** + +### sanitizedIssuer? + +> `optional` **sanitizedIssuer?**: `string` + +*** + +### sanitizedNationality? + +> `optional` **sanitizedNationality?**: `string` + +*** + +### sanitizedOpt1? + +> `optional` **sanitizedOpt1?**: `string` + +*** + +### sanitizedOpt2? + +> `optional` **sanitizedOpt2?**: `string` + +*** + +### secondaryId? + +> `optional` **secondaryId?**: `string` + +*** + +### verified? + +> `optional` **verified?**: `boolean` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiParentInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiParentInfo.md new file mode 100644 index 00000000..b15c8152 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiParentInfo.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiParentInfo + +# Interface: VerifyApiParentInfo + +## Properties + +### firstName? + +> `optional` **firstName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### fullName? + +> `optional` **fullName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### lastName? + +> `optional` **lastName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiPipeline.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiPipeline.md new file mode 100644 index 00000000..5056d58f --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiPipeline.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiPipeline + +# Interface: VerifyApiPipeline + +## Properties + +### extraction + +> **extraction**: [`VerifyApiExtractionPipelineStage`](VerifyApiExtractionPipelineStage.md) + +*** + +### verification + +> **verification**: [`VerifyApiVerificationPipelineStage`](VerifyApiVerificationPipelineStage.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiRedactionSettings.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiRedactionSettings.md new file mode 100644 index 00000000..3c28f603 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiRedactionSettings.md @@ -0,0 +1,15 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRedactionSettings + +# Interface: VerifyApiRedactionSettings + +## Properties + +### globalMode? + +> `optional` **globalMode?**: [`VerifyApiRedactionMode`](../type-aliases/VerifyApiRedactionMode.md) + +Controls redaction of extracted images and result fields. When omitted, FullResult is used. diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiResponseMessage.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiResponseMessage.md new file mode 100644 index 00000000..3f03177a --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiResponseMessage.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiResponseMessage + +# Interface: VerifyApiResponseMessage + +## Properties + +### code + +> **code**: `string` + +*** + +### message + +> **message**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiRuntimeInformation.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiRuntimeInformation.md new file mode 100644 index 00000000..aa619523 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiRuntimeInformation.md @@ -0,0 +1,201 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRuntimeInformation + +# Interface: VerifyApiRuntimeInformation + +## Properties + +### apiImageTag? + +> `optional` **apiImageTag?**: `string` + +*** + +### blinkIdRecognizerVersion? + +> `optional` **blinkIdRecognizerVersion?**: `string` + +*** + +### blinkIdVerifyRecognizerVersion? + +> `optional` **blinkIdVerifyRecognizerVersion?**: `string` + +*** + +### blinkIdVerifyVersion + +> **blinkIdVerifyVersion**: `string` + +*** + +### blinkIdVersion + +> **blinkIdVersion**: `string` + +*** + +### consentId? + +> `optional` **consentId?**: `string` + +#### Format + +uuid + +*** + +### cpus? + +> `optional` **cpus?**: `number` + +#### Format + +int32 + +*** + +### cpuType? + +> `optional` **cpuType?**: `string` + +*** + +### dockerImageTag? + +> `optional` **dockerImageTag?**: `string` + +*** + +### elapsedMs + +> **elapsedMs**: `number` + +#### Format + +int64 + +*** + +### executionId + +> **executionId**: `string` + +*** + +### finishedOn + +> **finishedOn**: `string` + +#### Format + +date-time + +*** + +### gatewayImageTag? + +> `optional` **gatewayImageTag?**: `string` + +*** + +### identityImageTag? + +> `optional` **identityImageTag?**: `string` + +*** + +### inflightLimit? + +> `optional` **inflightLimit?**: `number` + +#### Format + +int32 + +*** + +### internalQueueSize? + +> `optional` **internalQueueSize?**: `number` + +#### Format + +int32 + +*** + +### licenseExpiry? + +> `optional` **licenseExpiry?**: `string` + +#### Format + +date-time + +*** + +### licenseId? + +> `optional` **licenseId?**: `string` + +*** + +### ram? + +> `optional` **ram?**: `number` + +#### Format + +int32 + +*** + +### recognitionPath? + +> `optional` **recognitionPath?**: `string` + +*** + +### startedOn + +> **startedOn**: `string` + +#### Format + +date-time + +*** + +### traceId? + +> `optional` **traceId?**: `string` + +*** + +### workerCount? + +> `optional` **workerCount?**: `number` + +#### Format + +int32 + +*** + +### workerImageTag? + +> `optional` **workerImageTag?**: `string` + +*** + +### workerIndex? + +> `optional` **workerIndex?**: `number` + +#### Format + +int32 diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiScanningDataResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiScanningDataResult.md new file mode 100644 index 00000000..3a903d62 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiScanningDataResult.md @@ -0,0 +1,403 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiScanningDataResult + +# Interface: VerifyApiScanningDataResult + +## Properties + +### additionalAddressInformation? + +> `optional` **additionalAddressInformation?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### additionalNameInformation? + +> `optional` **additionalNameInformation?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### additionalOptionalAddressInformation? + +> `optional` **additionalOptionalAddressInformation?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### additionalPersonalIdNumber? + +> `optional` **additionalPersonalIdNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### address? + +> `optional` **address?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### bloodType? + +> `optional` **bloodType?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### cardAccessNumber? + +> `optional` **cardAccessNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### certificateNumber? + +> `optional` **certificateNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### countryCode? + +> `optional` **countryCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### dateOfBirth? + +> `optional` **dateOfBirth?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### dateOfEntry? + +> `optional` **dateOfEntry?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### dateOfExpiry? + +> `optional` **dateOfExpiry?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### dateOfExpiryPermanent? + +> `optional` **dateOfExpiryPermanent?**: `boolean` + +*** + +### dateOfIssue? + +> `optional` **dateOfIssue?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### dependentsInfo? + +> `optional` **dependentsInfo?**: [`VerifyApiDependentInfo`](VerifyApiDependentInfo.md)[] + +*** + +### documentAdditionalNumber? + +> `optional` **documentAdditionalNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### documentNumber? + +> `optional` **documentNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### documentOptionalAdditionalNumber? + +> `optional` **documentOptionalAdditionalNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### documentSubtype? + +> `optional` **documentSubtype?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### driverLicenseDetailedInfo? + +> `optional` **driverLicenseDetailedInfo?**: [`VerifyApiDriverLicenceDetailedInfo`](VerifyApiDriverLicenceDetailedInfo.md) + +*** + +### effectiveDate? + +> `optional` **effectiveDate?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### eligibilityCategory? + +> `optional` **eligibilityCategory?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### employer? + +> `optional` **employer?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### ethnicity? + +> `optional` **ethnicity?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### fathersName? + +> `optional` **fathersName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### firstName? + +> `optional` **firstName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### fullName? + +> `optional` **fullName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### husbandName? + +> `optional` **husbandName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### issuingAuthority? + +> `optional` **issuingAuthority?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### lastName? + +> `optional` **lastName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### legalStatus? + +> `optional` **legalStatus?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### localityCode? + +> `optional` **localityCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### localizedName? + +> `optional` **localizedName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### maidenName? + +> `optional` **maidenName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### manufacturingYear? + +> `optional` **manufacturingYear?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### maritalStatus? + +> `optional` **maritalStatus?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### mothersName? + +> `optional` **mothersName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### municipalityCode? + +> `optional` **municipalityCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### municipalityOfRegistration? + +> `optional` **municipalityOfRegistration?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### nationalInsuranceNumber? + +> `optional` **nationalInsuranceNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### nationality? + +> `optional` **nationality?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### parentsInfo? + +> `optional` **parentsInfo?**: [`VerifyApiParentInfo`](VerifyApiParentInfo.md)[] + +*** + +### passportNumber? + +> `optional` **passportNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### personalIdNumber? + +> `optional` **personalIdNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### placeOfBirth? + +> `optional` **placeOfBirth?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### pollingStationCode? + +> `optional` **pollingStationCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### profession? + +> `optional` **profession?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### race? + +> `optional` **race?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### registrationCenterCode? + +> `optional` **registrationCenterCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### religion? + +> `optional` **religion?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### remarks? + +> `optional` **remarks?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### residencePermitType? + +> `optional` **residencePermitType?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### residentialStatus? + +> `optional` **residentialStatus?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### sectionCode? + +> `optional` **sectionCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### sex? + +> `optional` **sex?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### socialSecurityStatus? + +> `optional` **socialSecurityStatus?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### specificDocumentValidity? + +> `optional` **specificDocumentValidity?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### sponsor? + +> `optional` **sponsor?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### stateCode? + +> `optional` **stateCode?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### stateName? + +> `optional` **stateName?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### trafficParticipantNumber? + +> `optional` **trafficParticipantNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### vehicleNumber? + +> `optional` **vehicleNumber?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### vehicleOwner? + +> `optional` **vehicleOwner?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### vehicleType? + +> `optional` **vehicleType?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### visaType? + +> `optional` **visaType?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) + +*** + +### workRestriction? + +> `optional` **workRestriction?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiSimpleDateResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiSimpleDateResult.md new file mode 100644 index 00000000..27e66374 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiSimpleDateResult.md @@ -0,0 +1,55 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiSimpleDateResult + +# Interface: VerifyApiSimpleDateResult + +## Properties + +### day? + +> `optional` **day?**: `number` + +#### Format + +int32 + +*** + +### filledByDomainKnowledge? + +> `optional` **filledByDomainKnowledge?**: `boolean` + +*** + +### month? + +> `optional` **month?**: `number` + +#### Format + +int32 + +*** + +### originalString? + +> `optional` **originalString?**: `string` + +*** + +### successfullyParsed? + +> `optional` **successfullyParsed?**: `boolean` + +*** + +### year? + +> `optional` **year?**: `number` + +#### Format + +int32 diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiSingleSideScanningResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiSingleSideScanningResult.md new file mode 100644 index 00000000..1dfc727b --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiSingleSideScanningResult.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiSingleSideScanningResult + +# Interface: VerifyApiSingleSideScanningResult + +## Properties + +### barcode? + +> `optional` **barcode?**: [`VerifyApiBarcodeResult`](VerifyApiBarcodeResult.md) + +*** + +### mrz? + +> `optional` **mrz?**: [`VerifyApiMrzResult`](VerifyApiMrzResult.md) + +*** + +### viz? + +> `optional` **viz?**: [`VerifyApiVizResult`](../type-aliases/VerifyApiVizResult.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ErrorResponse.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ErrorResponse.md new file mode 100644 index 00000000..df5a65c9 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ErrorResponse.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3ErrorResponse + +# Interface: VerifyApiV3ErrorResponse + +## Properties + +### message + +> **message**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationError.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationError.md new file mode 100644 index 00000000..e0b8a7af --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationError.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3ValidationError + +# Interface: VerifyApiV3ValidationError + +## Properties + +### code + +> **code**: [`VerifyApiV3ValidationErrorCode`](../type-aliases/VerifyApiV3ValidationErrorCode.md) + +*** + +### path + +> **path**: `string` + +*** + +### reason + +> **reason**: `string` + +*** + +### relatedPaths? + +> `optional` **relatedPaths?**: `string`[] diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationErrorResponse.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationErrorResponse.md new file mode 100644 index 00000000..5e32878e --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3ValidationErrorResponse.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3ValidationErrorResponse + +# Interface: VerifyApiV3ValidationErrorResponse + +## Properties + +### errors? + +> `optional` **errors?**: [`VerifyApiV3ValidationError`](VerifyApiV3ValidationError.md)[] + +*** + +### message? + +> `optional` **message?**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3WorkerErrorResponse.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3WorkerErrorResponse.md new file mode 100644 index 00000000..2e92afbf --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiV3WorkerErrorResponse.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3WorkerErrorResponse + +# Interface: VerifyApiV3WorkerErrorResponse + +## Properties + +### message + +> **message**: `string` + +*** + +### reason + +> **reason**: `string` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVehicleClassInfo.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVehicleClassInfo.md new file mode 100644 index 00000000..8fcd4324 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVehicleClassInfo.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVehicleClassInfo + +# Interface: VerifyApiVehicleClassInfo + +## Properties + +### effectiveDate? + +> `optional` **effectiveDate?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### expiryDate? + +> `optional` **expiryDate?**: [`VerifyApiDateResult`](VerifyApiDateResult.md) + +*** + +### vehicleClass? + +> `optional` **vehicleClass?**: [`VerifyApiAlphabetString`](VerifyApiAlphabetString.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationConfigurationUsed.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationConfigurationUsed.md new file mode 100644 index 00000000..bb16af1b --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationConfigurationUsed.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationConfigurationUsed + +# Interface: VerifyApiVerificationConfigurationUsed + +## Properties + +### settings? + +> `optional` **settings?**: [`VerifyApiVerificationSettings`](VerifyApiVerificationSettings.md) + +Per-check sensitivities and related verification toggles. + +*** + +### useCase? + +> `optional` **useCase?**: [`VerifyApiVerificationUseCase`](VerifyApiVerificationUseCase.md) + +High-level verification use-case options. diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationDocumentCaptureModuleSettings.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationDocumentCaptureModuleSettings.md new file mode 100644 index 00000000..4214a882 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationDocumentCaptureModuleSettings.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationDocumentCaptureModuleSettings + +# Interface: VerifyApiVerificationDocumentCaptureModuleSettings + +## Properties + +### documentImageReturnEnabled? + +> `optional` **documentImageReturnEnabled?**: `boolean` + +*** + +### faceImageExtractionEnabled? + +> `optional` **faceImageExtractionEnabled?**: `boolean` diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationExtractionConfigurationUsed.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationExtractionConfigurationUsed.md new file mode 100644 index 00000000..fcf5f535 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationExtractionConfigurationUsed.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationExtractionConfigurationUsed + +# Interface: VerifyApiVerificationExtractionConfigurationUsed + +## Properties + +### barcodeModuleSettings? + +> `optional` **barcodeModuleSettings?**: [`VerifyApiBarcodeModuleSettings`](VerifyApiBarcodeModuleSettings.md) + +*** + +### documentCaptureModuleSettings? + +> `optional` **documentCaptureModuleSettings?**: [`VerifyApiVerificationDocumentCaptureModuleSettings`](VerifyApiVerificationDocumentCaptureModuleSettings.md) + +*** + +### redactionSettings? + +> `optional` **redactionSettings?**: [`VerifyApiRedactionSettings`](VerifyApiRedactionSettings.md) + +*** + +### vizModuleSettings? + +> `optional` **vizModuleSettings?**: [`VerifyApiVizModuleSettings`](VerifyApiVizModuleSettings.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationPipelineStage.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationPipelineStage.md new file mode 100644 index 00000000..d4e8d001 --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationPipelineStage.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationPipelineStage + +# Interface: VerifyApiVerificationPipelineStage + +## Properties + +### status + +> **status**: [`VerifyApiVerificationPipelineStageStatus`](../type-aliases/VerifyApiVerificationPipelineStageStatus.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationResult.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationResult.md new file mode 100644 index 00000000..f877adfd --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationResult.md @@ -0,0 +1,25 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationResult + +# Interface: VerifyApiVerificationResult + +## Properties + +### checks? + +> `optional` **checks?**: [`VerifyApiDocumentChecks`](VerifyApiDocumentChecks.md) + +*** + +### failedChecks + +> **failedChecks**: `string`[] + +*** + +### verdict + +> **verdict**: [`VerifyApiVerdict`](../type-aliases/VerifyApiVerdict.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationSettings.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationSettings.md new file mode 100644 index 00000000..53a38bfa --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationSettings.md @@ -0,0 +1,63 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationSettings + +# Interface: VerifyApiVerificationSettings + +Per-check sensitivities and related verification toggles. + +## Properties + +### barcodeAuthenticitySensitivity? + +> `optional` **barcodeAuthenticitySensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +*** + +### cropAffectsVerdict? + +> `optional` **cropAffectsVerdict?**: `boolean` + +*** + +### dataMatchSensitivity? + +> `optional` **dataMatchSensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +*** + +### generativeAiSensitivity? + +> `optional` **generativeAiSensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +*** + +### imageQualityRetryPolicy? + +> `optional` **imageQualityRetryPolicy?**: [`VerifyApiImageQualityRetryPolicy`](../type-aliases/VerifyApiImageQualityRetryPolicy.md) + +*** + +### photocopySensitivity? + +> `optional` **photocopySensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +*** + +### portraitForgerySensitivity? + +> `optional` **portraitForgerySensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) + +*** + +### rejectExpiredDocuments? + +> `optional` **rejectExpiredDocuments?**: `boolean` + +*** + +### screenPresenceSensitivity? + +> `optional` **screenPresenceSensitivity?**: [`VerifyApiSensitivity`](../type-aliases/VerifyApiSensitivity.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationUseCase.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationUseCase.md new file mode 100644 index 00000000..8203ba6c --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVerificationUseCase.md @@ -0,0 +1,27 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationUseCase + +# Interface: VerifyApiVerificationUseCase + +High-level verification use-case options. + +## Properties + +### manualReviewStrategy? + +> `optional` **manualReviewStrategy?**: [`VerifyApiReviewStrategy`](../type-aliases/VerifyApiReviewStrategy.md) + +*** + +### verificationContext? + +> `optional` **verificationContext?**: [`VerifyApiVerificationContext`](../type-aliases/VerifyApiVerificationContext.md) + +*** + +### verificationPolicy? + +> `optional` **verificationPolicy?**: [`VerifyApiDocumentVerificationPolicy`](../type-aliases/VerifyApiDocumentVerificationPolicy.md) diff --git a/packages/blinkid-verify-core/docs/interfaces/VerifyApiVizModuleSettings.md b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVizModuleSettings.md new file mode 100644 index 00000000..d3a3c72c --- /dev/null +++ b/packages/blinkid-verify-core/docs/interfaces/VerifyApiVizModuleSettings.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVizModuleSettings + +# Interface: VerifyApiVizModuleSettings + +## Properties + +### signatureImageExtractionEnabled? + +> `optional` **signatureImageExtractionEnabled?**: `boolean` diff --git a/packages/blinkid-verify-core/docs/type-aliases/BarcodeModuleSettings.md b/packages/blinkid-verify-core/docs/type-aliases/BarcodeModuleSettings.md new file mode 100644 index 00000000..092b14f5 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/BarcodeModuleSettings.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / BarcodeModuleSettings + +# Type Alias: BarcodeModuleSettings + +> **BarcodeModuleSettings** = `Partial`\<\{ `barcodeImageReturnEnabled`: `boolean`; \}\> + +Settings controlling barcode image extraction. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyCore.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyCore.md index 4aca4237..9db115dc 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyCore.md +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyCore.md @@ -8,7 +8,7 @@ > **BlinkIdVerifyCore** = `Simplify`\<`Remote`\<[`BlinkIdVerifyWorkerProxy`](BlinkIdVerifyWorkerProxy.md)\>\> -Represents the BlinkIdVerify core instance. +BlinkID Verify core. -This type extends the Remote type from Comlink, which is used to proxy calls to the BlinkIdVerify worker. It -simplifies the type to remove unnecessary complexity. +[BlinkIdVerifyCore.createScanningSession](../functions/loadBlinkIdVerifyCore.md#loadblinkidverifycore) returns a session that always has `submitResult` and +`prepareVerifyRequest`. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyInitSettings.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyInitSettings.md index f6b56381..fc416276 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyInitSettings.md +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyInitSettings.md @@ -6,9 +6,8 @@ # Type Alias: BlinkIdVerifyInitSettings -> **BlinkIdVerifyInitSettings** = `SetOptional`\<[`BlinkIdVerifyWorkerInitSettings`](BlinkIdVerifyWorkerInitSettings.md), `"userId"`\> +> **BlinkIdVerifyInitSettings** = `Simplify`\<`Omit`\<[`BlinkIdVerifyWorkerInitSettings`](BlinkIdVerifyWorkerInitSettings.md), `"userId"` \| `"verifyApi"` \| `"verifyApiBaseUrl"`\> & `object`\> Configuration options for initializing the BlinkIdVerify core. -This type extends the BlinkIdVerifyWorkerInitSettings type by making the userId and useLightweightBuild properties -optional. It allows for partial configuration of the initialization settings. +Ping `userId` is generated and persisted by the SDK. It is not part of the public initialization settings. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestAnonymizationMode.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestAnonymizationMode.md deleted file mode 100644 index 016ac2bc..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestAnonymizationMode.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestAnonymizationMode - -# Type Alias: BlinkIdVerifyRequestAnonymizationMode - -> **BlinkIdVerifyRequestAnonymizationMode** = `"ImageOnly"` \| `"ResultFieldsOnly"` \| `"FullResult"` \| `"None"` - -Controls which parts of the verification result are anonymized in the API response. - -- `"ImageOnly"` — redacts only the document images. -- `"ResultFieldsOnly"` — redacts only the parsed data fields. -- `"FullResult"` — redacts both images and data fields. -- `"None"` — no anonymization is applied. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestCaptureConditions.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestCaptureConditions.md deleted file mode 100644 index 5a11a2e1..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestCaptureConditions.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestCaptureConditions - -# Type Alias: BlinkIdVerifyRequestCaptureConditions - -> **BlinkIdVerifyRequestCaptureConditions** = `"NoControl"` \| `"Basic"` \| `"Hybrid"` - -Defines the conditions under which the document is captured as part of the `UseCase` settings. - -- `"NoControl"`: Is the same as `"Basic"`, it will be removed in the future. -- `"Basic"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - on the user's side and is limited by the lack of a robust SDK. It is not possible for a cropped document to get a - `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. -- `"Hybrid"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - on the user's side and is limited by the lack of a robust SDK. It is possible for a cropped document to get a - `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestImageQualityInterpretation.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestImageQualityInterpretation.md deleted file mode 100644 index eb4e9653..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestImageQualityInterpretation.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestImageQualityInterpretation - -# Type Alias: BlinkIdVerifyRequestImageQualityInterpretation - -> **BlinkIdVerifyRequestImageQualityInterpretation** = `"Ignore"` \| `"Conservative"` \| `"HighAssurance"` \| `"HighConversion"` \| `"VeryHighConversion"` - -Specifies the strictness of the model when marking the quality of the image. Includes a range of values that allow -for more or less conservative approach. - -- `"Ignore"`: Ensures that BlinkID Verify API returns a `Pass` or `Fail` verdict even if image quality is not good - enough. -- `"Conservative"`: If image quality is not good enough, BlinkID Verify API will refuse to process the image and a - `NotPerformed` verdict will be returned. When a `NotPerformed` verdict is returned, BlinkID Verify API will prompt - the user to repeat the capture process. This is indicated by the `Retry` value under `RecommendedOutcome` in the - response. -- `"HighAssurance"`: A `Fail` verdict can be returned even if image quality is not good enough, but occasionally a - `Pass` verdict will not be returned if image quality is not satisfactory. -- `"HighConversion"`: A `Pass` verdict can be returned even if image quality is not good enough, but occasionally a - `Fail` verdict will not be returned if image quality is not satisfactory. -- `"VeryHighConversion"`: A `Pass` verdict can be returned even if image quality is significantly unsatisfactory, but a - `Fail` verdict will not be returned if image quality is really poor. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewSensitivity.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewSensitivity.md deleted file mode 100644 index 225a3558..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewSensitivity.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestManualReviewSensitivity - -# Type Alias: BlinkIdVerifyRequestManualReviewSensitivity - -> **BlinkIdVerifyRequestManualReviewSensitivity** = `"Low"` \| `"Default"` \| `"High"` - -Defines the volume of documents that will be sent for manual review as part of the `UseCase` settings. The outcome -depends on the selected policy and varies according to the overall verification `CertaintyLevel`. - -If manual review is not used, this setting is ignored. - -- `"Low"`: Only borderline cases are sent for manual review.
Documents where certainty is `Low` alongside a - `SuspiciousDataCheck` fail will be sent for manual review. -- `"Default"`: The manual review process is default. -- `"High"`: The manual review process is high. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewStrategy.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewStrategy.md deleted file mode 100644 index 4e3b4285..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestManualReviewStrategy.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestManualReviewStrategy - -# Type Alias: BlinkIdVerifyRequestManualReviewStrategy - -> **BlinkIdVerifyRequestManualReviewStrategy** = `"Never"` \| `"RejectedAndAccepted"` \| `"RejectedOnly"` \| `"AcceptedOnly"` - -Defines the manual review strategy used during document verification as part of the `UseCase` settings. - -- `"Never"`: No documents will be sent for manual review. -- `"RejectedAndAccepted"`: Both rejected and accepted documents will be sent for manual review. -- `"RejectedOnly"`: Only rejected documents will be sent for manual review. -- `"AcceptedOnly"`: Only accepted documents will be sent for manual review. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestMatchLevel.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestMatchLevel.md deleted file mode 100644 index 8634be5a..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestMatchLevel.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestMatchLevel - -# Type Alias: BlinkIdVerifyRequestMatchLevel - -> **BlinkIdVerifyRequestMatchLevel** = `"Disabled"` \| `"Level1"` \| `"Level2"` \| `"Level3"` \| `"Level4"` \| `"Level5"` \| `"Level6"` \| `"Level7"` \| `"Level8"` \| `"Level9"` \| `"Level10"` - -Specifies the strictness level for a particular match check sent to the BlinkID Verify Cloud API. - -Higher levels apply stricter thresholds. Use `"Disabled"` to skip a check entirely. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestOptions.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestOptions.md deleted file mode 100644 index 75fc3e35..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestOptions.md +++ /dev/null @@ -1,78 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestOptions - -# Type Alias: BlinkIdVerifyRequestOptions - -> **BlinkIdVerifyRequestOptions** = `object` - -Caller-supplied options for the BlinkID Verify Cloud API request. - -These options are merged with settings derived from the scanning session to produce the final -BlinkIdVerifyPayload. Only the subset of options that are relevant to the caller are exposed here. - -## Properties - -### anonymizationMode? - -> `optional` **anonymizationMode?**: [`BlinkIdVerifyRequestAnonymizationMode`](BlinkIdVerifyRequestAnonymizationMode.md) - -Controls which parts of the result are anonymized in the API response. - -*** - -### generativeAiMatchLevel? - -> `optional` **generativeAiMatchLevel?**: [`BlinkIdVerifyRequestMatchLevel`](BlinkIdVerifyRequestMatchLevel.md) - -Match level threshold for the generative AI–based fraud detection check. - -*** - -### photocopyMatchLevel? - -> `optional` **photocopyMatchLevel?**: [`BlinkIdVerifyRequestMatchLevel`](BlinkIdVerifyRequestMatchLevel.md) - -Match level threshold for detecting photocopy fraud. - -*** - -### photoForgeryMatchLevel? - -> `optional` **photoForgeryMatchLevel?**: [`BlinkIdVerifyRequestMatchLevel`](BlinkIdVerifyRequestMatchLevel.md) - -Match level threshold for detecting photo forgery. - -*** - -### returnFaceImage? - -> `optional` **returnFaceImage?**: `boolean` - -Whether to include the face image in the API response. - -*** - -### returnFullDocumentImage? - -> `optional` **returnFullDocumentImage?**: `boolean` - -Whether to include the full document image in the API response. - -*** - -### returnImageFormat? - -> `optional` **returnImageFormat?**: [`ReturnImageFormat`](ReturnImageFormat.md) - -The image format used for returned images. - -*** - -### returnSignatureImage? - -> `optional` **returnSignatureImage?**: `boolean` - -Whether to include the signature image in the API response. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestVerificationContext.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestVerificationContext.md deleted file mode 100644 index 4dd5838c..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyRequestVerificationContext.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifyRequestVerificationContext - -# Type Alias: BlinkIdVerifyRequestVerificationContext - -> **BlinkIdVerifyRequestVerificationContext** = `"Remote"` \| `"InPerson"` - -Defines the context under which document verification is performed as part of the `UseCase` settings. It describes -the setup and conditions in which verification occurs. - -- `"Remote"`: Default policy. Document verification is performed in a remote setting where a user is scanning the - document in their own space, unsupervised. -- `"InPerson"`: Document verification is performed in an in-person environment in which a trained employee is scanning - the document.
Document liveness checks are not performed when `InPerson` policy is set. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyScanningSession.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyScanningSession.md index a8d043da..7cbc2e4d 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyScanningSession.md +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyScanningSession.md @@ -6,6 +6,6 @@ # Type Alias: BlinkIdVerifyScanningSession -> **BlinkIdVerifyScanningSession** = `EmbindObject`\<\{ `allowBarcodeStep`: `void`; `getResult`: [`BlinkIdVerifyScanningResult`](BlinkIdVerifyScanningResult.md); `getSessionId`: `string`; `getSettings`: [`BlinkIdVerifySessionSettings`](BlinkIdVerifySessionSettings.md); `process`: [`BlinkIdVerifyProcessResult`](BlinkIdVerifyProcessResult.md); `reset`: `void`; \}\> +> **BlinkIdVerifyScanningSession** = `EmbindObject`\<\{ `allowBarcodeStep`: `void`; `getResult`: [`SessionResult`](SessionResult.md); `getSessionId`: `string`; `getSettings`: [`BlinkIdVerifySessionSettings`](BlinkIdVerifySessionSettings.md); `prepareVerifyRequest`: `Promise`\<[`PreparedVerifyRequest`](PreparedVerifyRequest.md)\>; `process`: [`BlinkIdVerifyProcessResult`](BlinkIdVerifyProcessResult.md); `reset`: `void`; `setVerifyApiBaseUrl`: `void`; `submitResult`: `Promise`\<[`VerifyApiDocumentVerificationResponse`](../interfaces/VerifyApiDocumentVerificationResponse.md)\>; \}\> Represents a scanning session for BlinkID Verify. diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionResult.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionResult.md new file mode 100644 index 00000000..274c6576 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionResult.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / BlinkIdVerifySessionResult + +# Type Alias: BlinkIdVerifySessionResult + +> **BlinkIdVerifySessionResult** = [`SessionResult`](SessionResult.md) + +BlinkID Verify-specific name for [SessionResult](SessionResult.md). diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionSettings.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionSettings.md index 00b39053..c220c57c 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionSettings.md +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifySessionSettings.md @@ -6,6 +6,6 @@ # Type Alias: BlinkIdVerifySessionSettings -> **BlinkIdVerifySessionSettings** = `Partial`\<\{ `inputImageSource`: [`InputImageSource`](InputImageSource.md); `scanningSettings`: [`ScanningSettings`](ScanningSettings.md); \}\> +> **BlinkIdVerifySessionSettings** = `Partial`\<\{ `configuration`: [`DocumentVerificationConfiguration`](DocumentVerificationConfiguration.md); `inputImageSource`: [`InputImageSource`](InputImageSource.md); `traceId`: `string`; \}\> Settings configuring the whole session diff --git a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyWorkerInitSettings.md b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyWorkerInitSettings.md index c664d1a5..7faedba8 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyWorkerInitSettings.md +++ b/packages/blinkid-verify-core/docs/type-aliases/BlinkIdVerifyWorkerInitSettings.md @@ -71,7 +71,17 @@ the current page. > **userId**: `string` -A unique identifier for the user/session. Used for analytics and tracking purposes. +SDK-generated ping identifier. Generated and persisted by the core SDK before worker initialization. + +*** + +### verifyApiBaseUrl + +> **verifyApiBaseUrl**: `string` + +Absolute base URL for Verify API requests. + +Applied once when a scanning session is created. Requests are POSTed to `{verifyApiBaseUrl}/api/v3/verify`. *** diff --git a/packages/blinkid-verify-core/docs/type-aliases/CaptureConditions.md b/packages/blinkid-verify-core/docs/type-aliases/CaptureConditions.md deleted file mode 100644 index dd47a53c..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/CaptureConditions.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / CaptureConditions - -# Type Alias: CaptureConditions - -> **CaptureConditions** = `"no-control"` \| `"basic"` \| `"hybrid"` - -Defines the conditions under which the document is captured as part of the `UseCase` settings. - -- `"no-control"`: _Deprecated_: Is the same as `"basic"`, it will be removed in the future. -- `"basic"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - on the user's side and is limited by the lack of a robust SDK. It is not possible for a cropped document to get a - `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. -- `"hybrid"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - on the user's side and is limited by the lack of a robust SDK. It is possible for a cropped document to get a - `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. diff --git a/packages/blinkid-verify-core/docs/type-aliases/Consent.md b/packages/blinkid-verify-core/docs/type-aliases/Consent.md new file mode 100644 index 00000000..e375df51 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/Consent.md @@ -0,0 +1,41 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / Consent + +# Type Alias: Consent + +> **Consent** = `object` + +Consent supplied when generating a BlinkID Verify Cloud API payload. + +## Properties + +### customerContext? + +> `optional` **customerContext?**: [`ConsentCustomerContext`](ConsentCustomerContext.md) + +*** + +### durationDays + +> **durationDays**: `number` + +*** + +### givenOn? + +> `optional` **givenOn?**: `string` + +*** + +### note? + +> `optional` **note?**: `string` + +*** + +### userId + +> **userId**: `string` diff --git a/packages/blinkid-verify-core/docs/type-aliases/ConsentCustomerContext.md b/packages/blinkid-verify-core/docs/type-aliases/ConsentCustomerContext.md new file mode 100644 index 00000000..532ae75e --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/ConsentCustomerContext.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / ConsentCustomerContext + +# Type Alias: ConsentCustomerContext + +> **ConsentCustomerContext** = `object` + +Optional customer identifiers attached to a consent record. + +## Properties + +### customerId? + +> `optional` **customerId?**: `string` + +*** + +### transactionId? + +> `optional` **transactionId?**: `string` diff --git a/packages/blinkid-verify-core/docs/type-aliases/DocumentCaptureModuleSettings.md b/packages/blinkid-verify-core/docs/type-aliases/DocumentCaptureModuleSettings.md new file mode 100644 index 00000000..d125cb3a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/DocumentCaptureModuleSettings.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / DocumentCaptureModuleSettings + +# Type Alias: DocumentCaptureModuleSettings + +> **DocumentCaptureModuleSettings** = `Partial`\<\{ `documentImageReturnEnabled`: `boolean`; `faceImageExtractionEnabled`: `boolean`; \}\> + +Settings controlling document and face image extraction. diff --git a/packages/blinkid-verify-core/docs/type-aliases/DocumentVerificationConfiguration.md b/packages/blinkid-verify-core/docs/type-aliases/DocumentVerificationConfiguration.md new file mode 100644 index 00000000..3f5403c2 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/DocumentVerificationConfiguration.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / DocumentVerificationConfiguration + +# Type Alias: DocumentVerificationConfiguration + +> **DocumentVerificationConfiguration** = `Partial`\<\{ `extraction`: [`VerificationExtractionConfiguration`](VerificationExtractionConfiguration.md); `imageAssessment`: [`ImageAssessmentConfiguration`](ImageAssessmentConfiguration.md); `verification`: [`VerificationConfiguration`](VerificationConfiguration.md); \}\> + +Native BlinkID Verify configuration. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ImageAssessmentConfiguration.md b/packages/blinkid-verify-core/docs/type-aliases/ImageAssessmentConfiguration.md new file mode 100644 index 00000000..51db2bf0 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/ImageAssessmentConfiguration.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / ImageAssessmentConfiguration + +# Type Alias: ImageAssessmentConfiguration + +> **ImageAssessmentConfiguration** = `Partial`\<\{ `imageQualitySensitivity`: [`MatchLevel`](MatchLevel.md); \}\> + +Image-assessment configuration shared with the BlinkID Verify API. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ImageQualityInterpretation.md b/packages/blinkid-verify-core/docs/type-aliases/ImageQualityInterpretation.md deleted file mode 100644 index 9b61fdac..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/ImageQualityInterpretation.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / ImageQualityInterpretation - -# Type Alias: ImageQualityInterpretation - -> **ImageQualityInterpretation** = `"ignore"` \| `"conservative"` \| `"high-assurance"` \| `"high-conversion"` \| `"very-high-conversion"` - -Specifies the strictness of the model when marking the quality of the image. Includes a range of values that allow -for more or less conservative approach. - -- `"ignore"`: Ensures that BlinkID Verify returns a `Pass` or `Fail` verdict even if image quality is not good enough. -- `"conservative"`: If image quality is not good enough, BlinkID Verify will refuse to process the image and a - `NotPerformed` verdict will be returned. When a `NotPerformed` verdict is returned, BlinkID Verify will prompt the - user to repeat the capture process. This is indicated by the `Retry` value under `RecommendedOutcome` in the - response. -- `"high-assurance"`: A `Fail` verdict can be returned even if image quality is not good enough, but occasionally a - `Pass` verdict will not be returned if image quality is not satisfactory. -- `"high-conversion"`: A `Pass` verdict can be returned even if image quality is not good enough, but occasionally a - `Fail` verdict will not be returned if image quality is not satisfactory. -- `"very-high-conversion"`: A `Pass` verdict can be returned even if image quality is significantly unsatisfactory, but - a `Fail` verdict will not be returned if image quality is really poor. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ImageQualityRetryPolicy.md b/packages/blinkid-verify-core/docs/type-aliases/ImageQualityRetryPolicy.md new file mode 100644 index 00000000..df84ff66 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/ImageQualityRetryPolicy.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / ImageQualityRetryPolicy + +# Type Alias: ImageQualityRetryPolicy + +> **ImageQualityRetryPolicy** = `"never-retry-bad-quality"` \| `"retry-bad-quality-always"` \| `"retry-bad-quality-for-acceptances"` \| `"retry-bad-quality-for-rejections"` + +Defines how scanning reacts when the captured image quality is insufficient. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ImageQualitySettings.md b/packages/blinkid-verify-core/docs/type-aliases/ImageQualitySettings.md deleted file mode 100644 index 036a0911..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/ImageQualitySettings.md +++ /dev/null @@ -1,12 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / ImageQualitySettings - -# Type Alias: ImageQualitySettings - -> **ImageQualitySettings** = `Partial`\<\{ `blurMatchLevel`: [`MatchLevel`](MatchLevel.md); `dpiMatchLevel`: [`MatchLevel`](MatchLevel.md); `glareMatchLevel`: [`MatchLevel`](MatchLevel.md); `handOcclusionMatchLevel`: [`MatchLevel`](MatchLevel.md); `interpretation`: [`ImageQualityInterpretation`](ImageQualityInterpretation.md); `lightingMatchLevel`: [`MatchLevel`](MatchLevel.md); `sharpnessMatchLevel`: [`MatchLevel`](MatchLevel.md); `tiltMatchLevel`: [`MatchLevel`](MatchLevel.md); \}\> - -Options for image quality settings. Stricter settings will provide better quality images as the scan will not -complete until they are met. If not defined internal defaults will be used. diff --git a/packages/blinkid-verify-core/docs/type-aliases/InputImageAnalysisResult.md b/packages/blinkid-verify-core/docs/type-aliases/InputImageAnalysisResult.md index 50afb5a9..def195ae 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/InputImageAnalysisResult.md +++ b/packages/blinkid-verify-core/docs/type-aliases/InputImageAnalysisResult.md @@ -81,6 +81,18 @@ The status of the processing. Beeing either `success` or a potential `issue in t *** +### scanningSide + +> **scanningSide**: [`ScanningSide`](ScanningSide.md) + +*** + +### screenPresenceDetected + +> **screenPresenceDetected**: `boolean` + +*** + ### tiltDetected > **tiltDetected**: `boolean` diff --git a/packages/blinkid-verify-core/docs/type-aliases/ManualReviewSensitivity.md b/packages/blinkid-verify-core/docs/type-aliases/ManualReviewSensitivity.md deleted file mode 100644 index 27bae848..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/ManualReviewSensitivity.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / ManualReviewSensitivity - -# Type Alias: ManualReviewSensitivity - -> **ManualReviewSensitivity** = `"low"` \| `"default"` \| `"high"` - -Defines the volume of documents that will be sent for manual review as part of the `UseCase` settings. The outcome -depends on the selected policy and varies according to the overall verification `CertaintyLevel`. - -If manual review is not used, this setting is ignored. - -- `"low"`: Only borderline cases are sent for manual review.
Documents where certainty is `Low` alongside a - `SuspiciousDataCheck` fail will be sent for manual review. -- `"default"`: The manual review process is default. -- `"high"`: The manual review process is high. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ManualReviewStrategy.md b/packages/blinkid-verify-core/docs/type-aliases/ManualReviewStrategy.md index 4f8f9d64..11616291 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/ManualReviewStrategy.md +++ b/packages/blinkid-verify-core/docs/type-aliases/ManualReviewStrategy.md @@ -8,9 +8,4 @@ > **ManualReviewStrategy** = `"never"` \| `"rejected-and-accepted"` \| `"rejected-only"` \| `"accepted-only"` -Defines the manual review strategy used during document verification as part of the `UseCase` settings. - -- `"never"`: No documents will be sent for manual review. -- `"rejected-and-accepted"`: Both rejected and accepted documents will be sent for manual review. -- `"rejected-only"`: Only rejected documents will be sent for manual review. -- `"accepted-only"`: Only accepted documents will be sent for manual review. +Defines which outcomes should be sent for manual review. diff --git a/packages/blinkid-verify-core/docs/type-aliases/MatchLevel.md b/packages/blinkid-verify-core/docs/type-aliases/MatchLevel.md index 2a84a826..54b92264 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/MatchLevel.md +++ b/packages/blinkid-verify-core/docs/type-aliases/MatchLevel.md @@ -8,9 +8,6 @@ > **MatchLevel** = `"disabled"` \| `"level-1"` \| `"level-2"` \| `"level-3"` \| `"level-4"` \| `"level-5"` \| `"level-6"` \| `"level-7"` \| `"level-8"` \| `"level-9"` \| `"level-10"` -Represents the level of strictness for a matching check during the document verification process. This enum defines -the different levels that can be configured for various checks, such as photocopy or barcode anomaly detection. -Higher levels indicate stricter requirements, leading to fewer false positives but potentially more false negatives. +Represents the level of strictness for a matching check. -- `"disabled"`: The matching check is disabled, that check will not be performed. -- `"level-1" to "level-10"`: Increasing levels of strictness, from least to most strict. +Maps native `Sensitivity`. Higher levels provide stricter detection. `"disabled"` turns the check off. diff --git a/packages/blinkid-verify-core/docs/type-aliases/PayloadImage.md b/packages/blinkid-verify-core/docs/type-aliases/PayloadImage.md new file mode 100644 index 00000000..559f632d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/PayloadImage.md @@ -0,0 +1,17 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / PayloadImage + +# Type Alias: PayloadImage + +> **PayloadImage** = `object` + +JPEG image included as a multipart file part. + +## Properties + +### jpegBytes + +> **jpegBytes**: `Uint8Array` diff --git a/packages/blinkid-verify-core/docs/type-aliases/PreparedVerifyRequest.md b/packages/blinkid-verify-core/docs/type-aliases/PreparedVerifyRequest.md new file mode 100644 index 00000000..4a3e0d89 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/PreparedVerifyRequest.md @@ -0,0 +1,48 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / PreparedVerifyRequest + +# Type Alias: PreparedVerifyRequest + +> **PreparedVerifyRequest** = `object` + +POST-ready Verify request. `body` is the exact assembled bytes (the payload that would be signed). Do not rebuild +`FormData` from parts. + +`url` is `{baseUrl}/api/v3/verify`. `headers` contain only `Content-Type`. + +## Properties + +### body + +> **body**: `Uint8Array` + +*** + +### headers + +> **headers**: `Record`\<`string`, `string`\> + +Contains only `Content-Type`. + +*** + +### method + +> **method**: `"POST"` + +*** + +### serializedPayload? + +> `optional` **serializedPayload?**: [`SerializedPayload`](SerializedPayload.md) + +Structured multipart parts for inspection and debug only. + +*** + +### url + +> **url**: `string` diff --git a/packages/blinkid-verify-core/docs/type-aliases/RedactionMode.md b/packages/blinkid-verify-core/docs/type-aliases/RedactionMode.md new file mode 100644 index 00000000..b5fadf1d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/RedactionMode.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / RedactionMode + +# Type Alias: RedactionMode + +> **RedactionMode** = `"none"` \| `"image-only"` \| `"result-fields-only"` \| `"full-result"` + +Defines how sensitive data is redacted. diff --git a/packages/blinkid-verify-core/docs/type-aliases/RedactionSettings.md b/packages/blinkid-verify-core/docs/type-aliases/RedactionSettings.md new file mode 100644 index 00000000..a0cc3652 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/RedactionSettings.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / RedactionSettings + +# Type Alias: RedactionSettings + +> **RedactionSettings** = `Partial`\<\{ `globalMode`: [`RedactionMode`](RedactionMode.md); \}\> + +Redaction settings applied to captured images and extracted result fields. diff --git a/packages/blinkid-verify-core/docs/type-aliases/RemoteScanningSession.md b/packages/blinkid-verify-core/docs/type-aliases/RemoteScanningSession.md index ab43268b..073d6624 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/RemoteScanningSession.md +++ b/packages/blinkid-verify-core/docs/type-aliases/RemoteScanningSession.md @@ -8,4 +8,6 @@ > **RemoteScanningSession** = `Remote`\<[`WorkerScanningSession`](WorkerScanningSession.md)\> -Represents a remote scanning session. +Remote scanning session returned by BlinkIdVerifyCore.createScanningSession. + +Includes `submitResult` and `prepareVerifyRequest`. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ResultDataMode.md b/packages/blinkid-verify-core/docs/type-aliases/ResultDataMode.md new file mode 100644 index 00000000..c413446e --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/ResultDataMode.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / ResultDataMode + +# Type Alias: ResultDataMode + +> **ResultDataMode** = `"serialized-only"` \| `"include-typed-payload"` + +Controls whether native typed payload data is copied into the session result. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ReturnImageFormat.md b/packages/blinkid-verify-core/docs/type-aliases/ReturnImageFormat.md deleted file mode 100644 index ad9897b6..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/ReturnImageFormat.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / ReturnImageFormat - -# Type Alias: ReturnImageFormat - -> **ReturnImageFormat** = `"Jpg"` \| `"Png"` \| `"Qoi"` - -The image format used when requesting document images in the API response. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ScanningSettings.md b/packages/blinkid-verify-core/docs/type-aliases/ScanningSettings.md deleted file mode 100644 index 9d16d7ee..00000000 --- a/packages/blinkid-verify-core/docs/type-aliases/ScanningSettings.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@microblink/blinkid-verify-core**](../README.md) - -*** - -[@microblink/blinkid-verify-core](../README.md) / ScanningSettings - -# Type Alias: ScanningSettings - -> **ScanningSettings** = `Partial`\<\{ `barcodeAnomalyMatchLevel`: [`MatchLevel`](MatchLevel.md); `dataMatchMatchLevel`: [`MatchLevel`](MatchLevel.md); `imageQualitySettings`: [`ImageQualitySettings`](ImageQualitySettings.md); `scanPassportDataPageOnly`: `boolean`; `scanUnsupportedBack`: `boolean`; `screenAnalysisMatchLevel`: [`MatchLevel`](MatchLevel.md); `staticSecurityFeaturesMatchLevel`: [`MatchLevel`](MatchLevel.md); `treatExpirationAsFraud`: `boolean`; `useCase`: [`UseCase`](UseCase.md); \}\> - -Represents the configurable settings for scanning a document. diff --git a/packages/blinkid-verify-core/docs/type-aliases/ScanningSide.md b/packages/blinkid-verify-core/docs/type-aliases/ScanningSide.md new file mode 100644 index 00000000..7cd6a1d5 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/ScanningSide.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / ScanningSide + +# Type Alias: ScanningSide + +> **ScanningSide** = `"first"` \| `"second"` \| `"barcode"` + +The side of the document represented by the processed frame. diff --git a/packages/blinkid-verify-core/docs/type-aliases/SerializedPayload.md b/packages/blinkid-verify-core/docs/type-aliases/SerializedPayload.md new file mode 100644 index 00000000..b8fcbe7c --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/SerializedPayload.md @@ -0,0 +1,53 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / SerializedPayload + +# Type Alias: SerializedPayload + +> **SerializedPayload** = `object` + +Canonical BlinkID Verify v3 multipart parts ready for HTTP submission. + +## Properties + +### configuration + +> **configuration**: `string` + +*** + +### consent? + +> `optional` **consent?**: `string` + +*** + +### imageBarcode? + +> `optional` **imageBarcode?**: [`PayloadImage`](PayloadImage.md) + +*** + +### imageFirstSide? + +> `optional` **imageFirstSide?**: [`PayloadImage`](PayloadImage.md) + +*** + +### imageSecondSide? + +> `optional` **imageSecondSide?**: [`PayloadImage`](PayloadImage.md) + +*** + +### sdkMetadata + +> **sdkMetadata**: `string` + +*** + +### traceId? + +> `optional` **traceId?**: `string` diff --git a/packages/blinkid-verify-core/docs/type-aliases/SessionResult.md b/packages/blinkid-verify-core/docs/type-aliases/SessionResult.md new file mode 100644 index 00000000..b4f1ba33 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/SessionResult.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / SessionResult + +# Type Alias: SessionResult + +> **SessionResult** = `object` + +Result generated from captured session frames. + +## Properties + +### serializedPayload + +> **serializedPayload**: [`SerializedPayload`](SerializedPayload.md) + +*** + +### typedPayload? + +> `optional` **typedPayload?**: [`TypedPayload`](TypedPayload.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/TypedPayload.md b/packages/blinkid-verify-core/docs/type-aliases/TypedPayload.md new file mode 100644 index 00000000..495a7453 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/TypedPayload.md @@ -0,0 +1,29 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / TypedPayload + +# Type Alias: TypedPayload + +> **TypedPayload** = `object` + +Typed values captured or configured for the session before serialization. + +## Properties + +### configuration + +> **configuration**: [`DocumentVerificationConfiguration`](DocumentVerificationConfiguration.md) + +*** + +### consent? + +> `optional` **consent?**: [`Consent`](Consent.md) + +*** + +### traceId? + +> `optional` **traceId?**: `string` diff --git a/packages/blinkid-verify-core/docs/type-aliases/UseCase.md b/packages/blinkid-verify-core/docs/type-aliases/UseCase.md index e296694d..bfbcfa11 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/UseCase.md +++ b/packages/blinkid-verify-core/docs/type-aliases/UseCase.md @@ -6,4 +6,6 @@ # Type Alias: UseCase -> **UseCase** = `Partial`\<\{ `captureConditions`: [`CaptureConditions`](CaptureConditions.md); `manualReviewSensitivity`: [`ManualReviewSensitivity`](ManualReviewSensitivity.md); `manualReviewStrategy`: [`ManualReviewStrategy`](ManualReviewStrategy.md); `verificationContext`: [`VerificationContext`](VerificationContext.md); `verificationPolicy`: [`VerificationPolicy`](VerificationPolicy.md); \}\> +> **UseCase** = `Partial`\<\{ `manualReviewStrategy`: [`ManualReviewStrategy`](ManualReviewStrategy.md); `verificationContext`: [`VerificationContext`](VerificationContext.md); `verificationPolicy`: [`VerificationPolicy`](VerificationPolicy.md); \}\> + +Defines the verification policy and context for a scan. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerificationConfiguration.md b/packages/blinkid-verify-core/docs/type-aliases/VerificationConfiguration.md new file mode 100644 index 00000000..dafe1dd2 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerificationConfiguration.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerificationConfiguration + +# Type Alias: VerificationConfiguration + +> **VerificationConfiguration** = `Partial`\<\{ `settings`: [`VerificationSettings`](VerificationSettings.md); `useCase`: [`UseCase`](UseCase.md); \}\> + +Verification configuration shared with the BlinkID Verify API. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerificationContext.md b/packages/blinkid-verify-core/docs/type-aliases/VerificationContext.md index 74c67e39..7aca0fc4 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/VerificationContext.md +++ b/packages/blinkid-verify-core/docs/type-aliases/VerificationContext.md @@ -8,10 +8,4 @@ > **VerificationContext** = `"remote"` \| `"in-person"` -Defines the context under which document verification is performed as part of the `UseCase` settings. It describes -the setup and conditions in which verification occurs. - -- `"remote"`: Default policy. Document verification is performed in a remote setting where a user is scanning the - document in their own space, unsupervised. -- `"in-person"`: Document verification is performed in an in-person environment in which a trained employee is scanning - the document.
Document liveness checks are not performed when `InPerson` policy is set. +Defines whether verification is performed remotely or in person. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerificationExtractionConfiguration.md b/packages/blinkid-verify-core/docs/type-aliases/VerificationExtractionConfiguration.md new file mode 100644 index 00000000..90cf114d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerificationExtractionConfiguration.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerificationExtractionConfiguration + +# Type Alias: VerificationExtractionConfiguration + +> **VerificationExtractionConfiguration** = `Partial`\<\{ `barcodeModuleSettings`: [`BarcodeModuleSettings`](BarcodeModuleSettings.md); `documentCaptureModuleSettings`: [`DocumentCaptureModuleSettings`](DocumentCaptureModuleSettings.md); `redactionSettings`: [`RedactionSettings`](RedactionSettings.md); `vizModuleSettings`: [`VizModuleSettings`](VizModuleSettings.md); \}\> + +Extraction configuration shared with the BlinkID Verify API. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerificationPolicy.md b/packages/blinkid-verify-core/docs/type-aliases/VerificationPolicy.md index dfcbda20..e7c172e3 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/VerificationPolicy.md +++ b/packages/blinkid-verify-core/docs/type-aliases/VerificationPolicy.md @@ -6,15 +6,6 @@ # Type Alias: VerificationPolicy -> **VerificationPolicy** = `"permissive"` \| `"standard"` \| `"strict"` \| `"very-strict"` +> **VerificationPolicy** = `"high-conversion"` \| `"balanced"` \| `"high-assurance"` -Defines the strictness of checks performed by BlinkID Verify as part of the `UseCase` settings. - -- `"permissive"`: Optimized for letting real users through. In cases of doubt or lower confidence, BlinkID Verify will - avoid failing the document. -- `"standard"`: Default policy. It is more strict compared to `Permissive` but still optimized for accepting real - users. -- `"strict"`: Users with damaged documents, bad lighting conditions or lower image quality will probably be rejected. - In cases of doubt or lower confidence, the document will more often be rejected. -- `"very-strict"`: Reasonable only for the most sensitive use cases. Significant user friction is added to stop as much - fraud as possible. +Defines the strictness policy used for document verification. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerificationSettings.md b/packages/blinkid-verify-core/docs/type-aliases/VerificationSettings.md new file mode 100644 index 00000000..9ea5f948 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerificationSettings.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerificationSettings + +# Type Alias: VerificationSettings + +> **VerificationSettings** = `Partial`\<\{ `barcodeAuthenticitySensitivity`: [`MatchLevel`](MatchLevel.md); `cropAffectsVerdict`: `boolean`; `dataMatchSensitivity`: [`MatchLevel`](MatchLevel.md); `generativeAiSensitivity`: [`MatchLevel`](MatchLevel.md); `imageQualityRetryPolicy`: [`ImageQualityRetryPolicy`](ImageQualityRetryPolicy.md); `photocopySensitivity`: [`MatchLevel`](MatchLevel.md); `portraitForgerySensitivity`: [`MatchLevel`](MatchLevel.md); `rejectExpiredDocuments`: `boolean`; `screenPresenceSensitivity`: [`MatchLevel`](MatchLevel.md); \}\> + +Native verification checks configured for the scanning session. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeAuthenticityChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeAuthenticityChecks.md new file mode 100644 index 00000000..6af7267a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeAuthenticityChecks.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeAuthenticityChecks + +# Type Alias: VerifyApiBarcodeAuthenticityChecks + +> **VerifyApiBarcodeAuthenticityChecks** = [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) & `object` + +## Type Declaration + +### contentCheck? + +> `optional` **contentCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### readCheck? + +> `optional` **readCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKey.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKey.md new file mode 100644 index 00000000..43727244 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKey.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeElementKey + +# Type Alias: VerifyApiBarcodeElementKey + +> **VerifyApiBarcodeElementKey** = [`VerifyApiBarcodeElementKeyEnum`](VerifyApiBarcodeElementKeyEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKeyEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKeyEnum.md new file mode 100644 index 00000000..cae7c9d6 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiBarcodeElementKeyEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiBarcodeElementKeyEnum + +# Type Alias: VerifyApiBarcodeElementKeyEnum + +> **VerifyApiBarcodeElementKeyEnum** = `"DocumentType"` \| `"StandardVersionNumber"` \| `"CustomerFamilyName"` \| `"CustomerFirstName"` \| `"CustomerFullName"` \| `"DateOfBirth"` \| `"Sex"` \| `"EyeColor"` \| `"AddressStreet"` \| `"AddressCity"` \| `"AddressJurisdictionCode"` \| `"AddressPostalCode"` \| `"FullAddress"` \| `"Height"` \| `"HeightIn"` \| `"HeightCm"` \| `"CustomerMiddleName"` \| `"HairColor"` \| `"NameSuffix"` \| `"AKAFullName"` \| `"AKAFamilyName"` \| `"AKAGivenName"` \| `"AKASuffixName"` \| `"WeightRange"` \| `"WeightPounds"` \| `"WeightKilograms"` \| `"CustomerIdNumber"` \| `"FamilyNameTruncation"` \| `"FirstNameTruncation"` \| `"MiddleNameTruncation"` \| `"PlaceOfBirth"` \| `"AddressStreet2"` \| `"RaceEthnicity"` \| `"NamePrefix"` \| `"CountryIdentification"` \| `"ResidenceStreetAddress"` \| `"ResidenceStreetAddress2"` \| `"ResidenceCity"` \| `"ResidenceJurisdictionCode"` \| `"ResidencePostalCode"` \| `"ResidenceFullAddress"` \| `"Under18"` \| `"Under19"` \| `"Under21"` \| `"SocialSecurityNumber"` \| `"AKASocialSecurityNumber"` \| `"AKAMiddleName"` \| `"AKAPrefixName"` \| `"OrganDonor"` \| `"Veteran"` \| `"AKADateOfBirth"` \| `"IssuerIdentificationNumber"` \| `"DocumentExpirationDate"` \| `"JurisdictionVersionNumber"` \| `"JurisdictionVehicleClass"` \| `"JurisdictionRestrictionCodes"` \| `"JurisdictionEndorsementCodes"` \| `"JurisdictionRestrictionCodeDescription"` \| `"DocumentIssueDate"` \| `"FederalCommercialVehicleCodes"` \| `"IssuingJurisdiction"` \| `"StandardVehicleClassification"` \| `"IssuingJurisdictionName"` \| `"StandardEndorsementCode"` \| `"StandardRestrictionCode"` \| `"JurisdictionVehicleClassificationDescription"` \| `"JurisdictionEndorsmentCodeDescription"` \| `"InventoryControlNumber"` \| `"CardRevisionDate"` \| `"DocumentDiscriminator"` \| `"LimitedDurationDocument"` \| `"AuditInformation"` \| `"ComplianceType"` \| `"IssueTimestamp"` \| `"PermitExpirationDate"` \| `"PermitIdentifier"` \| `"PermitIssueDate"` \| `"NumberOfDuplicates"` \| `"HAZMATExpirationDate"` \| `"MedicalIndicator"` \| `"NonResident"` \| `"UniqueCustomerId"` \| `"DataDiscriminator"` \| `"DocumentExpirationMonth"` \| `"DocumentNonexpiring"` \| `"SecurityVersion"` \| `"SubFieldDesignator"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResult.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResult.md new file mode 100644 index 00000000..ca41cc5e --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResult.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiCheckResult + +# Type Alias: VerifyApiCheckResult + +> **VerifyApiCheckResult** = [`VerifyApiCheckResultEnum`](VerifyApiCheckResultEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResultEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResultEnum.md new file mode 100644 index 00000000..d31ffc4a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCheckResultEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiCheckResultEnum + +# Type Alias: VerifyApiCheckResultEnum + +> **VerifyApiCheckResultEnum** = `"NotPerformed"` \| `"Pass"` \| `"Fail"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountry.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountry.md new file mode 100644 index 00000000..f4c7860a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountry.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiCountry + +# Type Alias: VerifyApiCountry + +> **VerifyApiCountry** = [`VerifyApiCountryEnum`](VerifyApiCountryEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountryEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountryEnum.md new file mode 100644 index 00000000..b8aa44cd --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiCountryEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiCountryEnum + +# Type Alias: VerifyApiCountryEnum + +> **VerifyApiCountryEnum** = `"None"` \| `"Albania"` \| `"Algeria"` \| `"Argentina"` \| `"Australia"` \| `"Austria"` \| `"Azerbaijan"` \| `"Bahrain"` \| `"Bangladesh"` \| `"Belgium"` \| `"BosniaAndHerzegovina"` \| `"Brunei"` \| `"Bulgaria"` \| `"Cambodia"` \| `"Canada"` \| `"Chile"` \| `"Colombia"` \| `"CostaRica"` \| `"Croatia"` \| `"Cyprus"` \| `"Czechia"` \| `"Denmark"` \| `"DominicanRepublic"` \| `"Egypt"` \| `"Estonia"` \| `"Finland"` \| `"France"` \| `"Georgia"` \| `"Germany"` \| `"Ghana"` \| `"Greece"` \| `"Guatemala"` \| `"HongKong"` \| `"Hungary"` \| `"India"` \| `"Indonesia"` \| `"Ireland"` \| `"Israel"` \| `"Italy"` \| `"Jordan"` \| `"Kazakhstan"` \| `"Kenya"` \| `"Kosovo"` \| `"Kuwait"` \| `"Latvia"` \| `"Lithuania"` \| `"Malaysia"` \| `"Maldives"` \| `"Malta"` \| `"Mauritius"` \| `"Mexico"` \| `"Morocco"` \| `"Netherlands"` \| `"NewZealand"` \| `"Nigeria"` \| `"Pakistan"` \| `"Panama"` \| `"Paraguay"` \| `"Philippines"` \| `"Poland"` \| `"Portugal"` \| `"PuertoRico"` \| `"Qatar"` \| `"Romania"` \| `"Russia"` \| `"SaudiArabia"` \| `"Serbia"` \| `"Singapore"` \| `"Slovakia"` \| `"Slovenia"` \| `"SouthAfrica"` \| `"Spain"` \| `"Sweden"` \| `"Switzerland"` \| `"Taiwan"` \| `"Thailand"` \| `"Tunisia"` \| `"Turkey"` \| `"Uae"` \| `"Uganda"` \| `"Uk"` \| `"Ukraine"` \| `"Usa"` \| `"Vietnam"` \| `"Brazil"` \| `"Norway"` \| `"Oman"` \| `"Ecuador"` \| `"ElSalvador"` \| `"SriLanka"` \| `"Peru"` \| `"Uruguay"` \| `"Bahamas"` \| `"Bermuda"` \| `"Bolivia"` \| `"China"` \| `"EuropeanUnion"` \| `"Haiti"` \| `"Honduras"` \| `"Iceland"` \| `"Japan"` \| `"Luxembourg"` \| `"Montenegro"` \| `"Nicaragua"` \| `"SouthKorea"` \| `"Venezuela"` \| `"Afghanistan"` \| `"AlandIslands"` \| `"AmericanSamoa"` \| `"Andorra"` \| `"Angola"` \| `"Anguilla"` \| `"Antarctica"` \| `"AntiguaAndBarbuda"` \| `"Armenia"` \| `"Aruba"` \| `"BailiwickOfGuernsey"` \| `"BailiwickOfJersey"` \| `"Barbados"` \| `"Belarus"` \| `"Belize"` \| `"Benin"` \| `"Bhutan"` \| `"BonaireSaintEustatiusAndSaba"` \| `"Botswana"` \| `"BouvetIsland"` \| `"BritishIndianOceanTerritory"` \| `"BurkinaFaso"` \| `"Burundi"` \| `"Cameroon"` \| `"CapeVerde"` \| `"CaribbeanNetherlands"` \| `"CaymanIslands"` \| `"CentralAfricanRepublic"` \| `"Chad"` \| `"ChristmasIsland"` \| `"CocosIslands"` \| `"Comoros"` \| `"Congo"` \| `"CookIslands"` \| `"Cuba"` \| `"Curacao"` \| `"DemocraticRepublicOfTheCongo"` \| `"Djibouti"` \| `"Dominica"` \| `"EastTimor"` \| `"EquatorialGuinea"` \| `"Eritrea"` \| `"Ethiopia"` \| `"FalklandIslands"` \| `"FaroeIslands"` \| `"FederatedStatesOfMicronesia"` \| `"Fiji"` \| `"FrenchGuiana"` \| `"FrenchPolynesia"` \| `"FrenchSouthernTerritories"` \| `"Gabon"` \| `"Gambia"` \| `"Gibraltar"` \| `"Greenland"` \| `"Grenada"` \| `"Guadeloupe"` \| `"Guam"` \| `"Guinea"` \| `"GuineaBissau"` \| `"Guyana"` \| `"HeardIslandAndMcdonaldIslands"` \| `"Iran"` \| `"Iraq"` \| `"IsleOfMan"` \| `"IvoryCoast"` \| `"Jamaica"` \| `"Kiribati"` \| `"Kyrgyzstan"` \| `"Laos"` \| `"Lebanon"` \| `"Lesotho"` \| `"Liberia"` \| `"Libya"` \| `"Liechtenstein"` \| `"Macau"` \| `"Madagascar"` \| `"Malawi"` \| `"Mali"` \| `"MarshallIslands"` \| `"Martinique"` \| `"Mauritania"` \| `"Mayotte"` \| `"Moldova"` \| `"Monaco"` \| `"Mongolia"` \| `"Montserrat"` \| `"Mozambique"` \| `"Myanmar"` \| `"Namibia"` \| `"Nauru"` \| `"Nepal"` \| `"NewCaledonia"` \| `"Niger"` \| `"Niue"` \| `"NorfolkIsland"` \| `"NorthernCyprus"` \| `"NorthernMarianaIslands"` \| `"NorthKorea"` \| `"NorthMacedonia"` \| `"Palau"` \| `"Palestine"` \| `"PapuaNewGuinea"` \| `"Pitcairn"` \| `"Reunion"` \| `"Rwanda"` \| `"SaintBarthelemy"` \| `"SaintHelenaAscensionAndTristianDaCunha"` \| `"SaintKittsAndNevis"` \| `"SaintLucia"` \| `"SaintMartin"` \| `"SaintPierreAndMiquelon"` \| `"SaintVincentAndTheGrenadines"` \| `"Samoa"` \| `"SanMarino"` \| `"SaoTomeAndPrincipe"` \| `"Senegal"` \| `"Seychelles"` \| `"SierraLeone"` \| `"SintMaarten"` \| `"SolomonIslands"` \| `"Somalia"` \| `"SouthGeorgiaAndTheSouthSandwichIslands"` \| `"SouthSudan"` \| `"Sudan"` \| `"Suriname"` \| `"SvalbardAndJanMayen"` \| `"Eswatini"` \| `"Syria"` \| `"Tajikistan"` \| `"Tanzania"` \| `"Togo"` \| `"Tokelau"` \| `"Tonga"` \| `"TrinidadAndTobago"` \| `"Turkmenistan"` \| `"TurksAndCaicosIslands"` \| `"Tuvalu"` \| `"UnitedStatesMinorOutlyingIslands"` \| `"Uzbekistan"` \| `"Vanuatu"` \| `"VaticanCity"` \| `"VirginIslandsBritish"` \| `"VirginIslandsUs"` \| `"WallisAndFutuna"` \| `"WesternSahara"` \| `"Yemen"` \| `"Yugoslavia"` \| `"Zambia"` \| `"Zimbabwe"` \| `"SchengenArea"` \| `"SaintThomasAndPrince"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataFormatChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataFormatChecks.md new file mode 100644 index 00000000..ca1ca170 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataFormatChecks.md @@ -0,0 +1,71 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDataFormatChecks + +# Type Alias: VerifyApiDataFormatChecks + +> **VerifyApiDataFormatChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### additionalPersonalIdNumberCheck? + +> `optional` **additionalPersonalIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### classEffectiveDateCheck? + +> `optional` **classEffectiveDateCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### classExpiryDateCheck? + +> `optional` **classExpiryDateCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfBirthCheck? + +> `optional` **dateOfBirthCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfExpiryCheck? + +> `optional` **dateOfExpiryCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfIssueCheck? + +> `optional` **dateOfIssueCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentAdditionalNumberCheck? + +> `optional` **documentAdditionalNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentNumberCheck? + +> `optional` **documentNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentOptionalAdditionalNumberCheck? + +> `optional` **documentOptionalAdditionalNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### issuingAuthorityCheck? + +> `optional` **issuingAuthorityCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### maritalStatusCheck? + +> `optional` **maritalStatusCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### nationalityCheck? + +> `optional` **nationalityCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### personalIdNumberCheck? + +> `optional` **personalIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### religionCheck? + +> `optional` **religionCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### sexCheck? + +> `optional` **sexCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataLogicChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataLogicChecks.md new file mode 100644 index 00000000..71c15125 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataLogicChecks.md @@ -0,0 +1,35 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDataLogicChecks + +# Type Alias: VerifyApiDataLogicChecks + +> **VerifyApiDataLogicChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### customerIdNumberCheck? + +> `optional` **customerIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateLogicCheck? + +> `optional` **dateLogicCheck?**: [`VerifyApiDateLogicChecks`](VerifyApiDateLogicChecks.md) + +### documentDiscriminatorCheck? + +> `optional` **documentDiscriminatorCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentNumberCheck? + +> `optional` **documentNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### inventoryControlNumberCheck? + +> `optional` **inventoryControlNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### personalIdNumberCheck? + +> `optional` **personalIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataMatchChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataMatchChecks.md new file mode 100644 index 00000000..7ecc2b8e --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDataMatchChecks.md @@ -0,0 +1,123 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDataMatchChecks + +# Type Alias: VerifyApiDataMatchChecks + +> **VerifyApiDataMatchChecks** = [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) & `object` + +## Type Declaration + +### additionalAddressInformationCheck? + +> `optional` **additionalAddressInformationCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### additionalNameInformationCheck? + +> `optional` **additionalNameInformationCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### additionalOptionalAddressInformationCheck? + +> `optional` **additionalOptionalAddressInformationCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### additionalPersonalIdNumberCheck? + +> `optional` **additionalPersonalIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### addressCheck? + +> `optional` **addressCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfBirthCheck? + +> `optional` **dateOfBirthCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfExpiryCheck? + +> `optional` **dateOfExpiryCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfIssueCheck? + +> `optional` **dateOfIssueCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentAdditionalNumberCheck? + +> `optional` **documentAdditionalNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentNumberCheck? + +> `optional` **documentNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### documentOptionalAdditionalNumberCheck? + +> `optional` **documentOptionalAdditionalNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### employerCheck? + +> `optional` **employerCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### fathersNameCheck? + +> `optional` **fathersNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### firstNameCheck? + +> `optional` **firstNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### fullNameCheck? + +> `optional` **fullNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### issuingAuthorityCheck? + +> `optional` **issuingAuthorityCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### lastNameCheck? + +> `optional` **lastNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### localizedNameCheck? + +> `optional` **localizedNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### maritalStatusCheck? + +> `optional` **maritalStatusCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### mothersNameCheck? + +> `optional` **mothersNameCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### nationalityCheck? + +> `optional` **nationalityCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### personalIdNumberCheck? + +> `optional` **personalIdNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### placeOfBirthCheck? + +> `optional` **placeOfBirthCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### professionCheck? + +> `optional` **professionCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### raceCheck? + +> `optional` **raceCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### religionCheck? + +> `optional` **religionCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### residentialStatusCheck? + +> `optional` **residentialStatusCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### sexCheck? + +> `optional` **sexCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDateLogicChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDateLogicChecks.md new file mode 100644 index 00000000..4d9d2593 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDateLogicChecks.md @@ -0,0 +1,31 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDateLogicChecks + +# Type Alias: VerifyApiDateLogicChecks + +> **VerifyApiDateLogicChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### dateOfBirthBeforeDateOfExpiryCheck? + +> `optional` **dateOfBirthBeforeDateOfExpiryCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfBirthBeforeDateOfIssueCheck? + +> `optional` **dateOfBirthBeforeDateOfIssueCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfBirthInPastCheck? + +> `optional` **dateOfBirthInPastCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfIssueBeforeDateOfExpiryCheck? + +> `optional` **dateOfIssueBeforeDateOfExpiryCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### dateOfIssueInPastCheck? + +> `optional` **dateOfIssueInPastCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentLivenessChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentLivenessChecks.md new file mode 100644 index 00000000..395f4f7c --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentLivenessChecks.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentLivenessChecks + +# Type Alias: VerifyApiDocumentLivenessChecks + +> **VerifyApiDocumentLivenessChecks** = [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) & `object` + +## Type Declaration + +### photocopyCheck? + +> `optional` **photocopyCheck?**: [`VerifyApiTieredMultiSideCheck`](VerifyApiTieredMultiSideCheck.md) + +### screenPresenceCheck? + +> `optional` **screenPresenceCheck?**: [`VerifyApiTieredMultiSideCheck`](VerifyApiTieredMultiSideCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentValidityChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentValidityChecks.md new file mode 100644 index 00000000..fa9de6aa --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentValidityChecks.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentValidityChecks + +# Type Alias: VerifyApiDocumentValidityChecks + +> **VerifyApiDocumentValidityChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### discontinuedDocumentCheck? + +> `optional` **discontinuedDocumentCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### expiredCheck? + +> `optional` **expiredCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicy.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicy.md new file mode 100644 index 00000000..87f7500b --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicy.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentVerificationPolicy + +# Type Alias: VerifyApiDocumentVerificationPolicy + +> **VerifyApiDocumentVerificationPolicy** = [`VerifyApiDocumentVerificationPolicyEnum`](VerifyApiDocumentVerificationPolicyEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicyEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicyEnum.md new file mode 100644 index 00000000..063e3a06 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiDocumentVerificationPolicyEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiDocumentVerificationPolicyEnum + +# Type Alias: VerifyApiDocumentVerificationPolicyEnum + +> **VerifyApiDocumentVerificationPolicyEnum** = `"HighConversion"` \| `"Balanced"` \| `"HighAssurance"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractedDataChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractedDataChecks.md new file mode 100644 index 00000000..0a52ec62 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractedDataChecks.md @@ -0,0 +1,35 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractedDataChecks + +# Type Alias: VerifyApiExtractedDataChecks + +> **VerifyApiExtractedDataChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### barcodeAuthenticityCheck? + +> `optional` **barcodeAuthenticityCheck?**: [`VerifyApiBarcodeAuthenticityChecks`](VerifyApiBarcodeAuthenticityChecks.md) + +### formatCheck? + +> `optional` **formatCheck?**: [`VerifyApiDataFormatChecks`](VerifyApiDataFormatChecks.md) + +### genericDataCheck? + +> `optional` **genericDataCheck?**: [`VerifyApiGenericDataCheck`](VerifyApiGenericDataCheck.md) + +### logicCheck? + +> `optional` **logicCheck?**: [`VerifyApiDataLogicChecks`](VerifyApiDataLogicChecks.md) + +### matchCheck? + +> `optional` **matchCheck?**: [`VerifyApiDataMatchChecks`](VerifyApiDataMatchChecks.md) + +### mrzCheck? + +> `optional` **mrzCheck?**: [`VerifyApiMrzChecks`](VerifyApiMrzChecks.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionDataResult.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionDataResult.md new file mode 100644 index 00000000..45e795d4 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionDataResult.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionDataResult + +# Type Alias: VerifyApiExtractionDataResult + +> **VerifyApiExtractionDataResult** = [`VerifyApiScanningDataResult`](../interfaces/VerifyApiScanningDataResult.md) & `object` + +## Type Declaration + +### documentClassInfo? + +> `optional` **documentClassInfo?**: [`VerifyApiDocumentClassInfo`](../interfaces/VerifyApiDocumentClassInfo.md) + +### subResults? + +> `optional` **subResults?**: [`VerifyApiExtractionSubResults`](../interfaces/VerifyApiExtractionSubResults.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatus.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatus.md new file mode 100644 index 00000000..08cd5565 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatus.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionPipelineStageStatus + +# Type Alias: VerifyApiExtractionPipelineStageStatus + +> **VerifyApiExtractionPipelineStageStatus** = [`VerifyApiExtractionPipelineStageStatusEnum`](VerifyApiExtractionPipelineStageStatusEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatusEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatusEnum.md new file mode 100644 index 00000000..23ff2fb9 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiExtractionPipelineStageStatusEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiExtractionPipelineStageStatusEnum + +# Type Alias: VerifyApiExtractionPipelineStageStatusEnum + +> **VerifyApiExtractionPipelineStageStatusEnum** = `"NotPerformed"` \| `"Partial"` \| `"Completed"` \| `"Failed"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldType.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldType.md new file mode 100644 index 00000000..225570fc --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldType.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiFieldType + +# Type Alias: VerifyApiFieldType + +> **VerifyApiFieldType** = [`VerifyApiFieldTypeEnum`](VerifyApiFieldTypeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldTypeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldTypeEnum.md new file mode 100644 index 00000000..2656a39c --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiFieldTypeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiFieldTypeEnum + +# Type Alias: VerifyApiFieldTypeEnum + +> **VerifyApiFieldTypeEnum** = `"AdditionalAddressInformation"` \| `"AdditionalNameInformation"` \| `"AdditionalOptionalAddressInformation"` \| `"AdditionalPersonalIdNumber"` \| `"Address"` \| `"BloodType"` \| `"ClassEffectiveDate"` \| `"ClassExpiryDate"` \| `"Conditions"` \| `"DateOfBirth"` \| `"DateOfExpiry"` \| `"DateOfIssue"` \| `"DocumentAdditionalNumber"` \| `"DocumentNumber"` \| `"DocumentOptionalAdditionalNumber"` \| `"Employer"` \| `"Endorsements"` \| `"FathersName"` \| `"FirstName"` \| `"FullName"` \| `"IssuingAuthority"` \| `"LastName"` \| `"LicenceType"` \| `"MaritalStatus"` \| `"MothersName"` \| `"Mrz"` \| `"Nationality"` \| `"PersonalIdNumber"` \| `"PlaceOfBirth"` \| `"Profession"` \| `"Race"` \| `"Religion"` \| `"ResidentialStatus"` \| `"Restrictions"` \| `"Sex"` \| `"Sponsor"` \| `"VehicleClass"` \| `"VisaType"` \| `"CertificateNumber"` \| `"CountryCode"` \| `"DependentDateOfBirth"` \| `"DependentDocumentNumber"` \| `"DependentFullName"` \| `"DependentSex"` \| `"DocumentSubtype"` \| `"EligibilityCategory"` \| `"ManufacturingYear"` \| `"NationalInsuranceNumber"` \| `"Remarks"` \| `"ResidencePermitType"` \| `"SpecificDocumentValidity"` \| `"VehicleOwner"` \| `"VehicleType"` \| `"LocalizedName"` \| `"StateName"` \| `"StateCode"` \| `"SectionCode"` \| `"RegistrationCenterCode"` \| `"MaidenName"` \| `"MunicipalityOfRegistration"` \| `"LocalityCode"` \| `"DateOfEntry"` \| `"MunicipalityCode"` \| `"PollingStationCode"` \| `"EffectiveDate"` \| `"ParentsLastName"` \| `"WorkRestriction"` \| `"ParentsFirstName"` \| `"SocialSecurityStatus"` \| `"LegalStatus"` \| `"HusbandName"` \| `"ParentFullName"` \| `"Ethnicity"` \| `"CardAccessNumber"` \| `"VehicleNumber"` \| `"PassportNumber"` \| `"TrafficParticipantNumber"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiGenericDataCheck.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiGenericDataCheck.md new file mode 100644 index 00000000..aba45f9d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiGenericDataCheck.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiGenericDataCheck + +# Type Alias: VerifyApiGenericDataCheck + +> **VerifyApiGenericDataCheck** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### genericNumberCheck? + +> `optional` **genericNumberCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### genericStringCheck? + +> `optional` **genericStringCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatus.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatus.md new file mode 100644 index 00000000..b9b3f861 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatus.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageAnalysisDetectionStatus + +# Type Alias: VerifyApiImageAnalysisDetectionStatus + +> **VerifyApiImageAnalysisDetectionStatus** = [`VerifyApiImageAnalysisDetectionStatusEnum`](VerifyApiImageAnalysisDetectionStatusEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatusEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatusEnum.md new file mode 100644 index 00000000..960a2280 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageAnalysisDetectionStatusEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageAnalysisDetectionStatusEnum + +# Type Alias: VerifyApiImageAnalysisDetectionStatusEnum + +> **VerifyApiImageAnalysisDetectionStatusEnum** = `"NotAvailable"` \| `"NotDetected"` \| `"Detected"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionType.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionType.md new file mode 100644 index 00000000..d3b6107a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionType.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageExtractionType + +# Type Alias: VerifyApiImageExtractionType + +> **VerifyApiImageExtractionType** = [`VerifyApiImageExtractionTypeEnum`](VerifyApiImageExtractionTypeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionTypeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionTypeEnum.md new file mode 100644 index 00000000..be2d3e30 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageExtractionTypeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageExtractionTypeEnum + +# Type Alias: VerifyApiImageExtractionTypeEnum + +> **VerifyApiImageExtractionTypeEnum** = `"Document"` \| `"Face"` \| `"Signature"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicy.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicy.md new file mode 100644 index 00000000..6ba7eea0 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicy.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageQualityRetryPolicy + +# Type Alias: VerifyApiImageQualityRetryPolicy + +> **VerifyApiImageQualityRetryPolicy** = [`VerifyApiImageQualityRetryPolicyEnum`](VerifyApiImageQualityRetryPolicyEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicyEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicyEnum.md new file mode 100644 index 00000000..af090411 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiImageQualityRetryPolicyEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiImageQualityRetryPolicyEnum + +# Type Alias: VerifyApiImageQualityRetryPolicyEnum + +> **VerifyApiImageQualityRetryPolicyEnum** = `"NeverRetryBadQuality"` \| `"RetryBadQualityAlways"` \| `"RetryBadQualityForAcceptances"` \| `"RetryBadQualityForRejections"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiInjectionAttackChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiInjectionAttackChecks.md new file mode 100644 index 00000000..fdff09f4 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiInjectionAttackChecks.md @@ -0,0 +1,15 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiInjectionAttackChecks + +# Type Alias: VerifyApiInjectionAttackChecks + +> **VerifyApiInjectionAttackChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### sdkPayloadIntegrityCheck? + +> `optional` **sdkPayloadIntegrityCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentType.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentType.md new file mode 100644 index 00000000..a5751fd0 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentType.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiMrtdDocumentType + +# Type Alias: VerifyApiMrtdDocumentType + +> **VerifyApiMrtdDocumentType** = [`VerifyApiMrtdDocumentTypeEnum`](VerifyApiMrtdDocumentTypeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentTypeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentTypeEnum.md new file mode 100644 index 00000000..204c11e2 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrtdDocumentTypeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiMrtdDocumentTypeEnum + +# Type Alias: VerifyApiMrtdDocumentTypeEnum + +> **VerifyApiMrtdDocumentTypeEnum** = `"Unknown"` \| `"IdentityCard"` \| `"Passport"` \| `"Visa"` \| `"GreenCard"` \| `"MysPassIMM13P"` \| `"DriverLicense"` \| `"InternalTravelDocument"` \| `"BorderCrossingCard"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrzChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrzChecks.md new file mode 100644 index 00000000..f3fbc9bb --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMrzChecks.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiMrzChecks + +# Type Alias: VerifyApiMrzChecks + +> **VerifyApiMrzChecks** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### checkDigitsCheck? + +> `optional` **checkDigitsCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### parsedCheck? + +> `optional` **parsedCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMultiSideCheck.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMultiSideCheck.md new file mode 100644 index 00000000..cc02ffc3 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiMultiSideCheck.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiMultiSideCheck + +# Type Alias: VerifyApiMultiSideCheck + +> **VerifyApiMultiSideCheck** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### firstSide? + +> `optional` **firstSide?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) + +### secondSide? + +> `optional` **secondSide?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiOpenEnumValue.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiOpenEnumValue.md new file mode 100644 index 00000000..e1042a31 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiOpenEnumValue.md @@ -0,0 +1,16 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiOpenEnumValue + +# Type Alias: VerifyApiOpenEnumValue + +> **VerifyApiOpenEnumValue** = `string` & `Record`\<`never`, `never`\> + +Known values are listed in the enum schema. Additional string values may be returned by future versions of the API +and should be treated as unknown rather than invalid. + +## Format + +open-enum diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivity.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivity.md new file mode 100644 index 00000000..af5e156d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivity.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiPassesAtOrBelowSensitivity + +# Type Alias: VerifyApiPassesAtOrBelowSensitivity + +> **VerifyApiPassesAtOrBelowSensitivity** = [`VerifyApiPassesAtOrBelowSensitivityEnum`](VerifyApiPassesAtOrBelowSensitivityEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivityEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivityEnum.md new file mode 100644 index 00000000..e618bf82 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiPassesAtOrBelowSensitivityEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiPassesAtOrBelowSensitivityEnum + +# Type Alias: VerifyApiPassesAtOrBelowSensitivityEnum + +> **VerifyApiPassesAtOrBelowSensitivityEnum** = `"Level1"` \| `"Level2"` \| `"Level3"` \| `"Level4"` \| `"Level5"` \| `"Level6"` \| `"Level7"` \| `"Level8"` \| `"Level9"` \| `"Level10"` \| `"NotApplicable"` \| `"None"` \| `"Disabled"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatus.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatus.md new file mode 100644 index 00000000..af004bdd --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatus.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiProcessingStatus + +# Type Alias: VerifyApiProcessingStatus + +> **VerifyApiProcessingStatus** = [`VerifyApiProcessingStatusEnum`](VerifyApiProcessingStatusEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatusEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatusEnum.md new file mode 100644 index 00000000..ee7cebfc --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiProcessingStatusEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiProcessingStatusEnum + +# Type Alias: VerifyApiProcessingStatusEnum + +> **VerifyApiProcessingStatusEnum** = `"Success"` \| `"DetectionFailed"` \| `"ImagePreprocessingFailed"` \| `"StabilityTestFailed"` \| `"ScanningWrongSide"` \| `"FieldIdentificationFailed"` \| `"MandatoryFieldMissing"` \| `"InvalidCharactersFound"` \| `"ImageReturnFailed"` \| `"BarcodeRecognitionFailed"` \| `"MrzParsingFailed"` \| `"UnsupportedDocument"` \| `"AwaitingOtherSide"` \| `"NotScanned"` \| `"BarcodeDetectionFailed"` \| `"MrzDetectionFailed"` \| `"InputImageNotFocused"` \| `"Canceled"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionMode.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionMode.md new file mode 100644 index 00000000..8a55946c --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionMode.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRedactionMode + +# Type Alias: VerifyApiRedactionMode + +> **VerifyApiRedactionMode** = [`VerifyApiRedactionModeEnum`](VerifyApiRedactionModeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionModeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionModeEnum.md new file mode 100644 index 00000000..71dfe675 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRedactionModeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRedactionModeEnum + +# Type Alias: VerifyApiRedactionModeEnum + +> **VerifyApiRedactionModeEnum** = `"None"` \| `"ImageOnly"` \| `"ResultFieldsOnly"` \| `"FullResult"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegion.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegion.md new file mode 100644 index 00000000..9ad5232a --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegion.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRegion + +# Type Alias: VerifyApiRegion + +> **VerifyApiRegion** = [`VerifyApiRegionEnum`](VerifyApiRegionEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegionEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegionEnum.md new file mode 100644 index 00000000..db024115 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiRegionEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiRegionEnum + +# Type Alias: VerifyApiRegionEnum + +> **VerifyApiRegionEnum** = `"None"` \| `"Alabama"` \| `"Alaska"` \| `"Alberta"` \| `"Arizona"` \| `"Arkansas"` \| `"AustralianCapitalTerritory"` \| `"BritishColumbia"` \| `"California"` \| `"Colorado"` \| `"Connecticut"` \| `"Delaware"` \| `"DistrictOfColumbia"` \| `"Florida"` \| `"Georgia"` \| `"Hawaii"` \| `"Idaho"` \| `"Illinois"` \| `"Indiana"` \| `"Iowa"` \| `"Kansas"` \| `"Kentucky"` \| `"Louisiana"` \| `"Maine"` \| `"Manitoba"` \| `"Maryland"` \| `"Massachusetts"` \| `"Michigan"` \| `"Minnesota"` \| `"Mississippi"` \| `"Missouri"` \| `"Montana"` \| `"Nebraska"` \| `"Nevada"` \| `"NewBrunswick"` \| `"NewHampshire"` \| `"NewJersey"` \| `"NewMexico"` \| `"NewSouthWales"` \| `"NewYork"` \| `"NorthernTerritory"` \| `"NorthCarolina"` \| `"NorthDakota"` \| `"NovaScotia"` \| `"Ohio"` \| `"Oklahoma"` \| `"Ontario"` \| `"Oregon"` \| `"Pennsylvania"` \| `"Quebec"` \| `"Queensland"` \| `"RhodeIsland"` \| `"Saskatchewan"` \| `"SouthAustralia"` \| `"SouthCarolina"` \| `"SouthDakota"` \| `"Tasmania"` \| `"Tennessee"` \| `"Texas"` \| `"Utah"` \| `"Vermont"` \| `"Victoria"` \| `"Virginia"` \| `"Washington"` \| `"WesternAustralia"` \| `"WestVirginia"` \| `"Wisconsin"` \| `"Wyoming"` \| `"Yukon"` \| `"CiudadDeMexico"` \| `"Jalisco"` \| `"NewfoundlandAndLabrador"` \| `"NuevoLeon"` \| `"BajaCalifornia"` \| `"Chihuahua"` \| `"Guanajuato"` \| `"Guerrero"` \| `"Mexico"` \| `"Michoacan"` \| `"NewYorkCity"` \| `"Tamaulipas"` \| `"Veracruz"` \| `"Chiapas"` \| `"Coahuila"` \| `"Durango"` \| `"GuerreroCocula"` \| `"GuerreroJuchitan"` \| `"GuerreroTepecoacuilco"` \| `"GuerreroTlacoapa"` \| `"Gujarat"` \| `"Hidalgo"` \| `"Karnataka"` \| `"Kerala"` \| `"KhyberPakhtunkhwa"` \| `"MadhyaPradesh"` \| `"Maharashtra"` \| `"Morelos"` \| `"Nayarit"` \| `"Oaxaca"` \| `"Puebla"` \| `"Punjab"` \| `"Queretaro"` \| `"SanLuisPotosi"` \| `"Sinaloa"` \| `"Sonora"` \| `"Tabasco"` \| `"TamilNadu"` \| `"Yucatan"` \| `"Zacatecas"` \| `"Aguascalientes"` \| `"BajaCaliforniaSur"` \| `"Campeche"` \| `"Colima"` \| `"QuintanaRooBenitoJuarez"` \| `"QuintanaRoo"` \| `"QuintanaRooSolidaridad"` \| `"Tlaxcala"` \| `"QuintanaRooCozumel"` \| `"SaoPaolo"` \| `"RioDeJaneiro"` \| `"RioGrandeDoSul"` \| `"NorthwestTerritories"` \| `"Nunavut"` \| `"PrinceEdwardIsland"` \| `"DistritoFederal"` \| `"Maranhao"` \| `"MatoGrosso"` \| `"MinasGerais"` \| `"Para"` \| `"Parana"` \| `"Pernambuco"` \| `"SantaCatarina"` \| `"AndhraPradesh"` \| `"Ceara"` \| `"Goias"` \| `"GuerreroAcapulcoDeJuarez"` \| `"Haryana"` \| `"Sergipe"` \| `"Alagoas"` \| `"Bangsamoro"` \| `"Telangana"` \| `"Acre"` \| `"EspiritoSanto"` \| `"MatoGrossoDoSul"` \| `"Paraiba"` \| `"Piaui"` \| `"RioGrandeDoNorte"` \| `"Tocantins"` \| `"Odisha"` \| `"Uttarakhand"` \| `"NorthernIreland"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiResult.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiResult.md new file mode 100644 index 00000000..952778a9 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiResult.md @@ -0,0 +1,14 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiResult + +# Type Alias: VerifyApiResult + +> **VerifyApiResult** = [`VerifyApiDocumentVerificationResponse`](../interfaces/VerifyApiDocumentVerificationResponse.md) + +Successful `POST /api/v3/verify` response body. + +Generated from the public v3 OpenAPI document, see [VerifyApiDocumentVerificationResponse](../interfaces/VerifyApiDocumentVerificationResponse.md). Enum-like fields +such as `verification.verdict` accept unknown string values so a newer API can add members without breaking the SDK. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategy.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategy.md new file mode 100644 index 00000000..7717986d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategy.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiReviewStrategy + +# Type Alias: VerifyApiReviewStrategy + +> **VerifyApiReviewStrategy** = [`VerifyApiReviewStrategyEnum`](VerifyApiReviewStrategyEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategyEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategyEnum.md new file mode 100644 index 00000000..06309df6 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiReviewStrategyEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiReviewStrategyEnum + +# Type Alias: VerifyApiReviewStrategyEnum + +> **VerifyApiReviewStrategyEnum** = `"Never"` \| `"RejectedAndAccepted"` \| `"RejectedOnly"` \| `"AcceptedOnly"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivity.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivity.md new file mode 100644 index 00000000..b0bc7aed --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivity.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiSensitivity + +# Type Alias: VerifyApiSensitivity + +> **VerifyApiSensitivity** = [`VerifyApiSensitivityEnum`](VerifyApiSensitivityEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivityEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivityEnum.md new file mode 100644 index 00000000..9c1841d4 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiSensitivityEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiSensitivityEnum + +# Type Alias: VerifyApiSensitivityEnum + +> **VerifyApiSensitivityEnum** = `"Level1"` \| `"Level2"` \| `"Level3"` \| `"Level4"` \| `"Level5"` \| `"Level6"` \| `"Level7"` \| `"Level8"` \| `"Level9"` \| `"Level10"` \| `"Disabled"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredCheck.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredCheck.md new file mode 100644 index 00000000..10def745 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredCheck.md @@ -0,0 +1,15 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiTieredCheck + +# Type Alias: VerifyApiTieredCheck + +> **VerifyApiTieredCheck** = [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) & `object` + +## Type Declaration + +### passesAtOrBelowSensitivity + +> **passesAtOrBelowSensitivity**: [`VerifyApiPassesAtOrBelowSensitivity`](VerifyApiPassesAtOrBelowSensitivity.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredMultiSideCheck.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredMultiSideCheck.md new file mode 100644 index 00000000..50e5a2d9 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTieredMultiSideCheck.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiTieredMultiSideCheck + +# Type Alias: VerifyApiTieredMultiSideCheck + +> **VerifyApiTieredMultiSideCheck** = [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) & `object` + +## Type Declaration + +### firstSide? + +> `optional` **firstSide?**: [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) + +### secondSide? + +> `optional` **secondSide?**: [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiType.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiType.md new file mode 100644 index 00000000..dd56be89 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiType.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiType + +# Type Alias: VerifyApiType + +> **VerifyApiType** = [`VerifyApiTypeEnum`](VerifyApiTypeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTypeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTypeEnum.md new file mode 100644 index 00000000..44780f9f --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiTypeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiTypeEnum + +# Type Alias: VerifyApiTypeEnum + +> **VerifyApiTypeEnum** = `"None"` \| `"ConsularId"` \| `"Dl"` \| `"DlPublicServicesCard"` \| `"EmploymentPass"` \| `"FinCard"` \| `"Id"` \| `"MultipurposeId"` \| `"MyKad"` \| `"MyKid"` \| `"MyPr"` \| `"MyTentera"` \| `"PanCard"` \| `"ProfessionalId"` \| `"PublicServicesCard"` \| `"ResidencePermit"` \| `"ResidentId"` \| `"TemporaryResidencePermit"` \| `"VoterId"` \| `"WorkPermit"` \| `"IKad"` \| `"MilitaryId"` \| `"MyKas"` \| `"SocialSecurityCard"` \| `"HealthInsuranceCard"` \| `"Passport"` \| `"SPass"` \| `"AddressCard"` \| `"AlienId"` \| `"AlienPassport"` \| `"GreenCard"` \| `"MinorsId"` \| `"PostalId"` \| `"ProfessionalDl"` \| `"TaxId"` \| `"WeaponPermit"` \| `"Visa"` \| `"BorderCrossingCard"` \| `"DriverCard"` \| `"GlobalEntryCard"` \| `"MyPolis"` \| `"NexusCard"` \| `"PassportCard"` \| `"ProofOfAgeCard"` \| `"RefugeeId"` \| `"TribalId"` \| `"VeteranId"` \| `"CitizenshipCertificate"` \| `"MyNumberCard"` \| `"ConsularPassport"` \| `"MinorsPassport"` \| `"MinorsPublicServicesCard"` \| `"DrivingPrivilegeCard"` \| `"AsylumRequest"` \| `"DriverQualificationCard"` \| `"ProvisionalDl"` \| `"RefugeePassport"` \| `"SpecialId"` \| `"UniformedServicesId"` \| `"ImmigrantVisa"` \| `"ConsularVoterId"` \| `"TwicCard"` \| `"ExitEntryPermit"` \| `"MainlandTravelPermitTaiwan"` \| `"NbiClearance"` \| `"ProofOfRegistration"` \| `"TemporaryProtectionPermit"` \| `"AfghanCitizenCard"` \| `"Eid"` \| `"Pass"` \| `"SisId"` \| `"AsicCard"` \| `"BidoonCard"` \| `"InterimHealthInsuranceCard"` \| `"NonVoterId"` \| `"ReciprocalHealthInsuranceCard"` \| `"VehicleRegistration"` \| `"EsaadCard"` \| `"RegistrationCertificate"` \| `"MedicalMarijuanaId"` \| `"NonCardTribalId"` \| `"DiplomaticId"` \| `"EmergencyPassport"` \| `"TemporaryPassport"` \| `"MetisFederationCard"` \| `"AdrCertificate"` \| `"NinCard"` \| `"MysssCard"` \| `"GendarmerieId"` \| `"PoliceId"` \| `"OriginCard"` \| `"ByidCard"` \| `"SpecifiedResidenceCard"` \| `"GoldenCard"` \| `"VehicleOwnershipCertificate"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCode.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCode.md new file mode 100644 index 00000000..2dcfb7ae --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCode.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3ValidationErrorCode + +# Type Alias: VerifyApiV3ValidationErrorCode + +> **VerifyApiV3ValidationErrorCode** = [`VerifyApiV3ValidationErrorCodeEnum`](VerifyApiV3ValidationErrorCodeEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) + +BlinkID Verify API v3 response types generated from scripts/verify-api/current.v3.cloud.verify.schema.json. + +Do not edit. Run `pnpm generate:verify-api-types` in `packages/blinkid-verify-wasm` to regenerate. diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCodeEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCodeEnum.md new file mode 100644 index 00000000..96461fb3 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiV3ValidationErrorCodeEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiV3ValidationErrorCodeEnum + +# Type Alias: VerifyApiV3ValidationErrorCodeEnum + +> **VerifyApiV3ValidationErrorCodeEnum** = `"InvalidParameter"` \| `"InvalidParameterValue"` \| `"InvalidParameterCombination"` \| `"DuplicateParameter"` \| `"InvalidRequestFormat"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdict.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdict.md new file mode 100644 index 00000000..7913828d --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdict.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerdict + +# Type Alias: VerifyApiVerdict + +> **VerifyApiVerdict** = [`VerifyApiVerdictEnum`](VerifyApiVerdictEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdictEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdictEnum.md new file mode 100644 index 00000000..07de7ff8 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerdictEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerdictEnum + +# Type Alias: VerifyApiVerdictEnum + +> **VerifyApiVerdictEnum** = `"Unverifiable"` \| `"Reject"` \| `"Accept"` \| `"Retry"` \| `"Review"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContext.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContext.md new file mode 100644 index 00000000..bb2f0815 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContext.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationContext + +# Type Alias: VerifyApiVerificationContext + +> **VerifyApiVerificationContext** = [`VerifyApiVerificationContextEnum`](VerifyApiVerificationContextEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContextEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContextEnum.md new file mode 100644 index 00000000..659e3b5b --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationContextEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationContextEnum + +# Type Alias: VerifyApiVerificationContextEnum + +> **VerifyApiVerificationContextEnum** = `"Remote"` \| `"InPerson"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatus.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatus.md new file mode 100644 index 00000000..eca90d54 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatus.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationPipelineStageStatus + +# Type Alias: VerifyApiVerificationPipelineStageStatus + +> **VerifyApiVerificationPipelineStageStatus** = [`VerifyApiVerificationPipelineStageStatusEnum`](VerifyApiVerificationPipelineStageStatusEnum.md) \| [`VerifyApiOpenEnumValue`](VerifyApiOpenEnumValue.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatusEnum.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatusEnum.md new file mode 100644 index 00000000..49aab7b0 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVerificationPipelineStageStatusEnum.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVerificationPipelineStageStatusEnum + +# Type Alias: VerifyApiVerificationPipelineStageStatusEnum + +> **VerifyApiVerificationPipelineStageStatusEnum** = `"NotPerformed"` \| `"Partial"` \| `"Completed"` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVisualChecks.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVisualChecks.md new file mode 100644 index 00000000..57e73f52 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVisualChecks.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVisualChecks + +# Type Alias: VerifyApiVisualChecks + +> **VerifyApiVisualChecks** = [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) & `object` + +## Type Declaration + +### generativeAiCheck? + +> `optional` **generativeAiCheck?**: [`VerifyApiTieredMultiSideCheck`](VerifyApiTieredMultiSideCheck.md) + +### portraitForgeryCheck? + +> `optional` **portraitForgeryCheck?**: [`VerifyApiTieredCheck`](VerifyApiTieredCheck.md) + +### securityFeaturesCheck? + +> `optional` **securityFeaturesCheck?**: [`VerifyApiCheck`](../interfaces/VerifyApiCheck.md) diff --git a/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVizResult.md b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVizResult.md new file mode 100644 index 00000000..11683103 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VerifyApiVizResult.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VerifyApiVizResult + +# Type Alias: VerifyApiVizResult + +> **VerifyApiVizResult** = [`VerifyApiScanningDataResult`](../interfaces/VerifyApiScanningDataResult.md) & `object` diff --git a/packages/blinkid-verify-core/docs/type-aliases/VizModuleSettings.md b/packages/blinkid-verify-core/docs/type-aliases/VizModuleSettings.md new file mode 100644 index 00000000..5ff00ff0 --- /dev/null +++ b/packages/blinkid-verify-core/docs/type-aliases/VizModuleSettings.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-core**](../README.md) + +*** + +[@microblink/blinkid-verify-core](../README.md) / VizModuleSettings + +# Type Alias: VizModuleSettings + +> **VizModuleSettings** = `Partial`\<\{ `signatureImageExtractionEnabled`: `boolean`; \}\> + +Settings controlling extraction from the visual inspection zone. diff --git a/packages/blinkid-verify-core/docs/type-aliases/WorkerScanningSession.md b/packages/blinkid-verify-core/docs/type-aliases/WorkerScanningSession.md index 2131d862..16115688 100644 --- a/packages/blinkid-verify-core/docs/type-aliases/WorkerScanningSession.md +++ b/packages/blinkid-verify-core/docs/type-aliases/WorkerScanningSession.md @@ -6,7 +6,7 @@ # Type Alias: WorkerScanningSession -> **WorkerScanningSession** = `Omit`\<[`BlinkIdVerifyScanningSession`](BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"`\> & `object` +> **WorkerScanningSession** = `Omit`\<[`BlinkIdVerifyScanningSession`](BlinkIdVerifyScanningSession.md), `"process"` \| `"deleteLater"` \| `"isAliasOf"` \| `"clone"` \| `"setVerifyApiBaseUrl"`\> & `object` The worker scanning session. diff --git a/packages/blinkid-verify-core/package.json b/packages/blinkid-verify-core/package.json index e46dd251..6d13230a 100644 --- a/packages/blinkid-verify-core/package.json +++ b/packages/blinkid-verify-core/package.json @@ -1,6 +1,6 @@ { "name": "@microblink/blinkid-verify-core", - "version": "4000.0.0-next.1", + "version": "4000.0.0", "description": "BlinkID Verify Core SDK", "keywords": [ "aml", @@ -61,6 +61,7 @@ "prepack": "pnpm prepare-publish", "prepare-publish": "tsx scripts/prepare-publish.mts", "publish-test": "pnpm prepare-publish && pnpm pack-check", + "test": "vitest run", "type-rollup": "bundle-declarations --entry index --bundle @microblink/analytics --bundle @microblink/blinkid-verify-wasm --bundle @microblink/blinkid-verify-worker --bundle @microblink/core-common --bundle @microblink/wasm-common --bundle @microblink/worker-common", "watch": "pnpm run --no-bail \"/^watch:(js|types)$/\"", "watch:js": "pnpm run build:js --watch --mode development", diff --git a/packages/blinkid-verify-core/src/BlinkIdVerifyCore.test.ts b/packages/blinkid-verify-core/src/BlinkIdVerifyCore.test.ts new file mode 100644 index 00000000..7aa96c0e --- /dev/null +++ b/packages/blinkid-verify-core/src/BlinkIdVerifyCore.test.ts @@ -0,0 +1,128 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import { beforeEach, describe, expect, it, vi } from "vitest"; + +import type { BlinkIdVerifyCore, BlinkIdVerifyInitSettings } from "./BlinkIdVerifyCore"; + +const { createProxyWorkerMock, getUserIdMock, proxyMock, remoteWorker } = vi.hoisted(() => { + const initBlinkIdVerify = vi.fn(); + const createProxyWorkerMock = vi.fn(); + const getUserIdMock = vi.fn(() => "user-123"); + const proxyMock = vi.fn((callback: unknown) => callback); + + return { + createProxyWorkerMock, + getUserIdMock, + proxyMock, + remoteWorker: { initBlinkIdVerify }, + }; +}); + +vi.mock("@microblink/core-common/createProxyWorker", () => ({ + createProxyWorker: createProxyWorkerMock, +})); + +vi.mock("@microblink/core-common/getUserId", () => ({ + getUserId: getUserIdMock, +})); + +vi.mock("comlink", () => ({ + proxy: proxyMock, +})); + +import { loadBlinkIdVerifyCore } from "./BlinkIdVerifyCore"; + +type Expect = T; +type HasKey = K extends keyof T ? true : false; +type ScanningSession = Awaited>; + +type _SessionHasSubmit = Expect>; +type _SessionHasPrepare = Expect>; +type _InitOmitsVerifyApi = Expect extends false ? true : false>; + +describe("loadBlinkIdVerifyCore", () => { + beforeEach(() => { + vi.clearAllMocks(); + createProxyWorkerMock.mockResolvedValue(remoteWorker); + remoteWorker.initBlinkIdVerify.mockResolvedValue(undefined); + }); + + it("resolves an omitted verifyApiBaseUrl to the page origin", async () => { + const settings: BlinkIdVerifyInitSettings = { licenseKey: "test-key" }; + + const result = await loadBlinkIdVerifyCore(settings); + + expect(result).toBe(remoteWorker); + expect(getUserIdMock).toHaveBeenCalledWith("blinkid-verify-userid"); + expect(settings).not.toHaveProperty("userId"); + expect(settings).not.toHaveProperty("verifyApiBaseUrl"); + expect(settings.resourcesLocation).toBe(window.location.href); + expect(remoteWorker.initBlinkIdVerify).toHaveBeenCalledWith( + { + ...settings, + userId: "user-123", + verifyApiBaseUrl: window.location.origin, + }, + undefined, + ); + }); + + it("resolves a relative verifyApiBaseUrl against the page URL", async () => { + const rawVerifyApiBaseUrl = "custom-verify"; + const settings: BlinkIdVerifyInitSettings = { + licenseKey: "test-key", + verifyApiBaseUrl: rawVerifyApiBaseUrl, + }; + const resolvedVerifyApiBaseUrl = new URL(rawVerifyApiBaseUrl, window.location.href).toString().replace(/\/+$/, ""); + + await loadBlinkIdVerifyCore(settings); + + expect(resolvedVerifyApiBaseUrl).not.toBe(rawVerifyApiBaseUrl); + expect(resolvedVerifyApiBaseUrl.startsWith(window.location.origin)).toBe(true); + expect(remoteWorker.initBlinkIdVerify).toHaveBeenCalledWith( + expect.objectContaining({ + licenseKey: "test-key", + userId: "user-123", + verifyApiBaseUrl: resolvedVerifyApiBaseUrl, + }), + undefined, + ); + expect(settings.verifyApiBaseUrl).toBe(rawVerifyApiBaseUrl); + }); + + it("uses an absolute verifyApiBaseUrl and strips a trailing slash", async () => { + const rawVerifyApiBaseUrl = "https://verify.example.com/tenant/"; + const settings: BlinkIdVerifyInitSettings = { + licenseKey: "test-key", + verifyApiBaseUrl: rawVerifyApiBaseUrl, + }; + + await loadBlinkIdVerifyCore(settings); + + expect(remoteWorker.initBlinkIdVerify).toHaveBeenCalledWith( + expect.objectContaining({ + licenseKey: "test-key", + userId: "user-123", + verifyApiBaseUrl: "https://verify.example.com/tenant", + }), + undefined, + ); + expect(settings.verifyApiBaseUrl).toBe(rawVerifyApiBaseUrl); + }); + + it("ignores a client-supplied ping userId", async () => { + const settings = { licenseKey: "test-key", userId: "integrator-user" }; + + await loadBlinkIdVerifyCore(settings); + + expect(getUserIdMock).toHaveBeenCalledWith("blinkid-verify-userid"); + expect(remoteWorker.initBlinkIdVerify).toHaveBeenCalledWith( + expect.objectContaining({ + licenseKey: "test-key", + userId: "user-123", + verifyApiBaseUrl: window.location.origin, + }), + undefined, + ); + }); +}); diff --git a/packages/blinkid-verify-core/src/BlinkIdVerifyCore.ts b/packages/blinkid-verify-core/src/BlinkIdVerifyCore.ts index a7363e2a..618ee8b3 100644 --- a/packages/blinkid-verify-core/src/BlinkIdVerifyCore.ts +++ b/packages/blinkid-verify-core/src/BlinkIdVerifyCore.ts @@ -8,25 +8,33 @@ import type { import { createProxyWorker } from "@microblink/core-common/createProxyWorker"; import { getUserId } from "@microblink/core-common/getUserId"; import { proxy, Remote } from "comlink"; -import type { SetOptional, Simplify } from "type-fest"; +import type { Simplify } from "type-fest"; /** * Configuration options for initializing the BlinkIdVerify core. * - * This type extends the BlinkIdVerifyWorkerInitSettings type by making the userId and useLightweightBuild properties - * optional. It allows for partial configuration of the initialization settings. + * Ping `userId` is generated and persisted by the SDK. It is not part of the public initialization settings. */ -export type BlinkIdVerifyInitSettings = SetOptional< - BlinkIdVerifyWorkerInitSettings, - // User ID is optional outside the worker scope - "userId" +export type BlinkIdVerifyInitSettings = Simplify< + Omit & { + /** + * Base URL for Verify API requests. + * + * Omitted means `window.location.origin`. Relative values resolve against the page URL. The SDK always POSTs to + * `{resolved}/api/v3/verify`. The customer's server owns the real Verify host and the API key; the SDK sends no + * Authorization header. This is not `microblinkProxyUrl` (that remains ping/Baltazar only). + */ + verifyApiBaseUrl?: string; + } >; /** - * Represents the BlinkIdVerify core instance. + * BlinkID Verify core. + * + * {@link BlinkIdVerifyCore.createScanningSession} returns a session that always has `submitResult` and + * `prepareVerifyRequest`. * - * This type extends the Remote type from Comlink, which is used to proxy calls to the BlinkIdVerify worker. It - * simplifies the type to remove unnecessary complexity. + * @public */ export type BlinkIdVerifyCore = Simplify>; @@ -35,9 +43,11 @@ const STORAGE_KEY = "blinkid-verify-userid"; /** * Creates and initializes a BlinkIdVerify core instance. * + * Resolves `verifyApiBaseUrl` to an absolute URL on the main thread and passes that string to the worker. + * * @param settings - Configuration for BlinkIdVerify initialization including license key and resources location * @param progressCallback - Optional callback for tracking resource download progress (WASM, data files) - * @returns Promise that resolves with initialized BlinkIdVerify core instance + * @returns Promise that resolves with the initialized BlinkID Verify core * @throws Error if initialization fails */ export async function loadBlinkIdVerifyCore( @@ -46,17 +56,25 @@ export async function loadBlinkIdVerifyCore( ): Promise { settings.resourcesLocation ??= window.location.href; + const verifyApiBaseUrl = new URL(settings.verifyApiBaseUrl ?? window.location.origin, window.location.href) + .toString() + .replace(/\/+$/, ""); + const remoteWorker = await createProxyWorker( settings.resourcesLocation, "blinkid-verify-worker.js", ); - settings.userId ??= getUserId(STORAGE_KEY); + const workerSettings = { + ...settings, + userId: getUserId(STORAGE_KEY), + verifyApiBaseUrl, + }; const proxyProgressCallback = progressCallback ? proxy(progressCallback) : undefined; try { - await remoteWorker.initBlinkIdVerify(settings as BlinkIdVerifyWorkerInitSettings, proxyProgressCallback); + await remoteWorker.initBlinkIdVerify(workerSettings, proxyProgressCallback); return remoteWorker; } catch (error) { diff --git a/packages/blinkid-verify-core/src/VerifyApiError.test.ts b/packages/blinkid-verify-core/src/VerifyApiError.test.ts new file mode 100644 index 00000000..95b9730b --- /dev/null +++ b/packages/blinkid-verify-core/src/VerifyApiError.test.ts @@ -0,0 +1,23 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import { describe, expect, test } from "vitest"; + +import { toVerifyApiError, VerifyApiError } from "./VerifyApiError"; + +describe("VerifyApiError", () => { + test("preserves an existing VerifyApiError instance", () => { + const error = new VerifyApiError("failed", { status: 400, body: { code: "bad_request" } }); + expect(toVerifyApiError(error)).toBe(error); + }); + + test("wraps a generic Error and copies status/body when present", () => { + const cause = Object.assign(new Error("timeout"), { status: 504, body: "gateway" }); + const wrapped = toVerifyApiError(cause); + + expect(wrapped).toBeInstanceOf(VerifyApiError); + expect(wrapped.message).toBe("timeout"); + expect(wrapped.status).toBe(504); + expect(wrapped.body).toBe("gateway"); + expect(wrapped.cause).toBe(cause); + }); +}); diff --git a/packages/blinkid-verify-core/src/VerifyApiError.ts b/packages/blinkid-verify-core/src/VerifyApiError.ts new file mode 100644 index 00000000..6aa1df69 --- /dev/null +++ b/packages/blinkid-verify-core/src/VerifyApiError.ts @@ -0,0 +1,31 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +/** Failed BlinkID Verify API request. */ +export class VerifyApiError extends Error { + readonly status?: number; + readonly body?: unknown; + + constructor(message: string, options?: { status?: number; body?: unknown; cause?: unknown }) { + super(message, options?.cause !== undefined ? { cause: options.cause } : undefined); + this.name = "VerifyApiError"; + this.status = options?.status; + this.body = options?.body; + } +} + +/** Coerces an unknown rejection into {@link VerifyApiError}. */ +export function toVerifyApiError(error: unknown): VerifyApiError { + if (error instanceof VerifyApiError) { + return error; + } + + if (error instanceof Error) { + return new VerifyApiError(error.message, { + cause: error, + status: "status" in error && typeof error.status === "number" ? error.status : undefined, + body: "body" in error ? error.body : undefined, + }); + } + + return new VerifyApiError(String(error)); +} diff --git a/packages/blinkid-verify-core/src/generatePayloadForBlinkIdVerifyCloudApi.ts b/packages/blinkid-verify-core/src/generatePayloadForBlinkIdVerifyCloudApi.ts deleted file mode 100644 index c9835ba1..00000000 --- a/packages/blinkid-verify-core/src/generatePayloadForBlinkIdVerifyCloudApi.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ - -import { - BlinkIdVerifyScanningResult, - CaptureConditions, - CapturedFrame, - ImageQualityInterpretation, - ManualReviewSensitivity, - ManualReviewStrategy, - MatchLevel, - ScanningSettings, - VerificationContext, - VerificationPolicy, -} from "@microblink/blinkid-verify-wasm"; - -/** - * Specifies the strictness level for a particular match check sent to the BlinkID Verify Cloud API. - * - * Higher levels apply stricter thresholds. Use `"Disabled"` to skip a check entirely. - */ -export type BlinkIdVerifyRequestMatchLevel = - | "Disabled" - | "Level1" - | "Level2" - | "Level3" - | "Level4" - | "Level5" - | "Level6" - | "Level7" - | "Level8" - | "Level9" - | "Level10"; - -/** - * Controls which parts of the verification result are anonymized in the API response. - * - * - `"ImageOnly"` — redacts only the document images. - * - `"ResultFieldsOnly"` — redacts only the parsed data fields. - * - `"FullResult"` — redacts both images and data fields. - * - `"None"` — no anonymization is applied. - */ -export type BlinkIdVerifyRequestAnonymizationMode = "ImageOnly" | "ResultFieldsOnly" | "FullResult" | "None"; - -/** - * Specifies the strictness of the model when marking the quality of the image. Includes a range of values that allow - * for more or less conservative approach. - * - * - `"Ignore"`: Ensures that BlinkID Verify API returns a `Pass` or `Fail` verdict even if image quality is not good - * enough. - * - `"Conservative"`: If image quality is not good enough, BlinkID Verify API will refuse to process the image and a - * `NotPerformed` verdict will be returned. When a `NotPerformed` verdict is returned, BlinkID Verify API will prompt - * the user to repeat the capture process. This is indicated by the `Retry` value under `RecommendedOutcome` in the - * response. - * - `"HighAssurance"`: A `Fail` verdict can be returned even if image quality is not good enough, but occasionally a - * `Pass` verdict will not be returned if image quality is not satisfactory. - * - `"HighConversion"`: A `Pass` verdict can be returned even if image quality is not good enough, but occasionally a - * `Fail` verdict will not be returned if image quality is not satisfactory. - * - `"VeryHighConversion"`: A `Pass` verdict can be returned even if image quality is significantly unsatisfactory, but a - * `Fail` verdict will not be returned if image quality is really poor. - */ -export type BlinkIdVerifyRequestImageQualityInterpretation = - | "Ignore" - | "Conservative" - | "HighAssurance" - | "HighConversion" - | "VeryHighConversion"; - -/** - * Defines the strictness of checks performed by BlinkID Verify API as part of the `UseCase` settings. - * - * - `"Permissive"`: Optimized for letting real users through. In cases of doubt or lower confidence, BlinkID Verify API - * will avoid failing the document. - * - `"Standard"`: Default policy. It is more strict compared to `Permissive` but still optimized for accepting real - * users. - * - `"Strict"`: Users with damaged documents, bad lighting conditions or lower image quality will probably be rejected. - * In cases of doubt or lower confidence, the document will more often be rejected. - * - `"VeryStrict"`: Reasonable only for the most sensitive use cases. Significant user friction is added to stop as much - * fraud as possible. - */ -type BlinkIdVerifyRequestDocumentVerificationPolicy = "Permissive" | "Standard" | "Strict" | "VeryStrict"; - -/** - * Defines the manual review strategy used during document verification as part of the `UseCase` settings. - * - * - `"Never"`: No documents will be sent for manual review. - * - `"RejectedAndAccepted"`: Both rejected and accepted documents will be sent for manual review. - * - `"RejectedOnly"`: Only rejected documents will be sent for manual review. - * - `"AcceptedOnly"`: Only accepted documents will be sent for manual review. - */ -export type BlinkIdVerifyRequestManualReviewStrategy = - | "Never" - | "RejectedAndAccepted" - | "RejectedOnly" - | "AcceptedOnly"; - -/** - * Defines the volume of documents that will be sent for manual review as part of the `UseCase` settings. The outcome - * depends on the selected policy and varies according to the overall verification `CertaintyLevel`. - * - * If manual review is not used, this setting is ignored. - * - * - `"Low"`: Only borderline cases are sent for manual review.
Documents where certainty is `Low` alongside a - * `SuspiciousDataCheck` fail will be sent for manual review. - * - `"Default"`: The manual review process is default. - * - `"High"`: The manual review process is high. - */ -export type BlinkIdVerifyRequestManualReviewSensitivity = "Low" | "Default" | "High"; - -/** - * Defines the context under which document verification is performed as part of the `UseCase` settings. It describes - * the setup and conditions in which verification occurs. - * - * - `"Remote"`: Default policy. Document verification is performed in a remote setting where a user is scanning the - * document in their own space, unsupervised. - * - `"InPerson"`: Document verification is performed in an in-person environment in which a trained employee is scanning - * the document.
Document liveness checks are not performed when `InPerson` policy is set. - */ -export type BlinkIdVerifyRequestVerificationContext = "Remote" | "InPerson"; - -/** - * Defines the conditions under which the document is captured as part of the `UseCase` settings. - * - * - `"NoControl"`: Is the same as `"Basic"`, it will be removed in the future. - * - `"Basic"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - * on the user's side and is limited by the lack of a robust SDK. It is not possible for a cropped document to get a - * `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. - * - `"Hybrid"`: Allows for processing of fully cropped documents. The integrator has no control over the capture process - * on the user's side and is limited by the lack of a robust SDK. It is possible for a cropped document to get a - * `Pass` or `Accept` in the overall result. Liveness checks will not be performed if the document is fully cropped. - */ -export type BlinkIdVerifyRequestCaptureConditions = "NoControl" | "Basic" | "Hybrid"; - -/** Represents a document image submitted to the BlinkID Verify API. */ -type BlinkIdVerifyRequestDocumentVerificationImageSource = { - /** Base64-encoded JPEG image data, or `null` if no image is available. */ - base64: string | null; -}; - -/** - * The request payload sent to the BlinkID Verify API. - * - * Contains the captured document images, verification options, and use-case configuration derived from the scanning - * result and session settings. - */ -type BlinkIdVerifyPayload = { - /** The front-side image of the document. */ - imageFront?: BlinkIdVerifyRequestDocumentVerificationImageSource; - /** The back-side image of the document. */ - imageBack?: BlinkIdVerifyRequestDocumentVerificationImageSource; - /** The barcode image extracted from the document. */ - imageBarcode?: BlinkIdVerifyRequestDocumentVerificationImageSource; - /** Verification options that control check strictness and returned data. */ - options?: { - /** Whether an expired document should be treated as fraudulent. */ - treatExpirationAsFraud?: boolean; - /** Controls which parts of the result are anonymized. */ - anonymizationMode?: BlinkIdVerifyRequestAnonymizationMode; - /** How image quality issues affect the overall verification outcome. */ - imageQualityInterpretation?: BlinkIdVerifyRequestImageQualityInterpretation; - /** Match level threshold for detecting that the document was displayed on a screen. */ - screenMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for detecting photocopy fraud. */ - photocopyMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for detecting barcode anomalies. */ - barcodeAnomalyMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for detecting photo forgery. */ - photoForgeryMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for verifying static security features. */ - staticSecurityFeaturesMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for data consistency checks across document fields. */ - dataMatchMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the blur image quality check. */ - blurMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the glare image quality check. */ - glareMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the lighting image quality check. */ - lightingMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the sharpness image quality check. */ - sharpnessMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the hand occlusion image quality check. */ - handOcclusionMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the DPI (dots per inch) image quality check. */ - dpiMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for the document tilt image quality check. */ - tiltMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Whether to include the face image in the API response. */ - returnFaceImage?: boolean; - /** Whether to include the full document image in the API response. */ - returnFullDocumentImage?: boolean; - /** Whether to include the signature image in the API response. */ - returnSignatureImage?: boolean; - /** The image format used for returned images. */ - returnImageFormat?: "Jpg" | "Png" | "Qoi"; - /** Match level threshold for the generative AI–based fraud detection check. */ - generativeAiMatchLevel?: BlinkIdVerifyRequestMatchLevel; - }; - /** Use-case configuration that tailors the verification policy to the deployment context. */ - useCase?: { - /** The overall strictness policy applied during document verification. */ - documentVerificationPolicy?: BlinkIdVerifyRequestDocumentVerificationPolicy; - /** The physical context in which the document is being verified. */ - verificationContext?: BlinkIdVerifyRequestVerificationContext; - /** Which verification outcomes are escalated for manual human review. */ - manualReviewStrategy?: BlinkIdVerifyRequestManualReviewStrategy; - /** The sensitivity threshold for triggering manual review. */ - manualReviewSensitivity?: BlinkIdVerifyRequestManualReviewSensitivity; - /** The level of control over image capture conditions. */ - captureConditions?: BlinkIdVerifyRequestCaptureConditions; - }; - /** The unique identifier of the capture session, used to correlate the request with SDK telemetry. */ - captureSessionId: string; -}; - -/** The image format used when requesting document images in the API response. */ -export type ReturnImageFormat = "Jpg" | "Png" | "Qoi"; - -/** - * Caller-supplied options for the BlinkID Verify Cloud API request. - * - * These options are merged with settings derived from the scanning session to produce the final - * {@link BlinkIdVerifyPayload}. Only the subset of options that are relevant to the caller are exposed here. - */ -export type BlinkIdVerifyRequestOptions = { - /** Controls which parts of the result are anonymized in the API response. */ - anonymizationMode?: BlinkIdVerifyRequestAnonymizationMode; - /** Match level threshold for detecting photocopy fraud. */ - photocopyMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Match level threshold for detecting photo forgery. */ - photoForgeryMatchLevel?: BlinkIdVerifyRequestMatchLevel; - /** Whether to include the face image in the API response. */ - returnFaceImage?: boolean; - /** Whether to include the full document image in the API response. */ - returnFullDocumentImage?: boolean; - /** Whether to include the signature image in the API response. */ - returnSignatureImage?: boolean; - /** The image format used for returned images. */ - returnImageFormat?: ReturnImageFormat; - /** Match level threshold for the generative AI–based fraud detection check. */ - generativeAiMatchLevel?: BlinkIdVerifyRequestMatchLevel; -}; - -/** - * Builds the JSON payload for the BlinkID Verify Cloud API from a completed scanning result. - * - * Maps internal SDK enum values (kebab-case) to their API-facing PascalCase equivalents and encodes captured document - * frames as base64 JPEG strings. - * - * @param result - The scanning result produced by the BlinkIdVerify SDK. - * @param sessionId - The unique identifier of the capture session to include in the payload. - * @param settings - The scanning settings used during the session, used to derive verification options. - * @param options - Optional caller-supplied overrides for anonymization, image return, and match levels. - * @returns The fully constructed payload ready to be submitted to the BlinkID Verify Cloud API. - */ -export function GeneratePayloadForBlinkidVerifyRequest( - result: BlinkIdVerifyScanningResult, - sessionId: string, - settings: ScanningSettings, - options?: BlinkIdVerifyRequestOptions, -): BlinkIdVerifyPayload { - const payload: BlinkIdVerifyPayload = { - imageFront: frameToBase64(result.frontFrame), - imageBack: frameToBase64(result.backFrame), - imageBarcode: frameToBase64(result.barcodeFrame), - options: { - treatExpirationAsFraud: settings.treatExpirationAsFraud, - screenMatchLevel: mapMatchLevel(settings.screenAnalysisMatchLevel), - photocopyMatchLevel: options?.photocopyMatchLevel, - photoForgeryMatchLevel: options?.photoForgeryMatchLevel, - staticSecurityFeaturesMatchLevel: mapMatchLevel(settings.staticSecurityFeaturesMatchLevel), - barcodeAnomalyMatchLevel: mapMatchLevel(settings.barcodeAnomalyMatchLevel), - dataMatchMatchLevel: mapMatchLevel(settings.dataMatchMatchLevel), - blurMatchLevel: mapMatchLevel(settings.imageQualitySettings?.blurMatchLevel), - glareMatchLevel: mapMatchLevel(settings.imageQualitySettings?.glareMatchLevel), - lightingMatchLevel: mapMatchLevel(settings.imageQualitySettings?.lightingMatchLevel), - sharpnessMatchLevel: mapMatchLevel(settings.imageQualitySettings?.sharpnessMatchLevel), - handOcclusionMatchLevel: mapMatchLevel(settings.imageQualitySettings?.handOcclusionMatchLevel), - dpiMatchLevel: mapMatchLevel(settings.imageQualitySettings?.dpiMatchLevel), - tiltMatchLevel: mapMatchLevel(settings.imageQualitySettings?.tiltMatchLevel), - imageQualityInterpretation: mapImageQualityInterpretation(settings.imageQualitySettings?.interpretation), - anonymizationMode: options?.anonymizationMode, - returnFaceImage: options?.returnFaceImage, - returnFullDocumentImage: options?.returnFullDocumentImage, - returnSignatureImage: options?.returnSignatureImage, - returnImageFormat: options?.returnImageFormat, - generativeAiMatchLevel: options?.generativeAiMatchLevel, - }, - useCase: { - documentVerificationPolicy: mapDocumentVerificationPolicy(settings.useCase?.verificationPolicy), - verificationContext: mapVerificationContext(settings.useCase?.verificationContext), - manualReviewStrategy: mapManualReviewStrategy(settings.useCase?.manualReviewStrategy), - manualReviewSensitivity: mapManualReviewSensitivity(settings.useCase?.manualReviewSensitivity), - captureConditions: mapCaptureConditions(settings.useCase?.captureConditions), - }, - captureSessionId: sessionId, - }; - - return payload; -} - -function mapManualReviewSensitivity( - sensitivity: ManualReviewSensitivity | undefined, -): BlinkIdVerifyRequestManualReviewSensitivity | undefined { - switch (sensitivity) { - case "low": - return "Low"; - case "default": - return "Default"; - case "high": - return "High"; - default: - return undefined; - } -} - -function mapManualReviewStrategy( - strategy: ManualReviewStrategy | undefined, -): BlinkIdVerifyRequestManualReviewStrategy | undefined { - switch (strategy) { - case "never": - return "Never"; - case "rejected-and-accepted": - return "RejectedAndAccepted"; - case "rejected-only": - return "RejectedOnly"; - case "accepted-only": - return "AcceptedOnly"; - default: - return undefined; - } -} - -function mapDocumentVerificationPolicy( - policy: VerificationPolicy | undefined, -): BlinkIdVerifyRequestDocumentVerificationPolicy | undefined { - switch (policy) { - case "permissive": - return "Permissive"; - case "standard": - return "Standard"; - case "strict": - return "Strict"; - case "very-strict": - return "VeryStrict"; - default: - return undefined; - } -} - -function mapImageQualityInterpretation( - interpretation: ImageQualityInterpretation | undefined, -): BlinkIdVerifyRequestImageQualityInterpretation | undefined { - switch (interpretation) { - case "ignore": - return "Ignore"; - case "conservative": - return "Conservative"; - case "high-assurance": - return "HighAssurance"; - case "high-conversion": - return "HighConversion"; - case "very-high-conversion": - return "VeryHighConversion"; - default: - return undefined; - } -} - -function mapVerificationContext( - context: VerificationContext | undefined, -): BlinkIdVerifyRequestVerificationContext | undefined { - switch (context) { - case "in-person": - return "InPerson"; - case "remote": - return "Remote"; - default: - return undefined; - } -} - -function mapCaptureConditions( - conditions: CaptureConditions | undefined, -): BlinkIdVerifyRequestCaptureConditions | undefined { - switch (conditions) { - case "no-control": - return "NoControl"; - case "basic": - return "Basic"; - case "hybrid": - return "Hybrid"; - default: - return undefined; - } -} - -function mapMatchLevel(level: MatchLevel | undefined): BlinkIdVerifyRequestMatchLevel | undefined { - switch (level) { - case "disabled": - return "Disabled"; - case "level-1": - return "Level1"; - case "level-2": - return "Level2"; - case "level-3": - return "Level3"; - case "level-4": - return "Level4"; - case "level-5": - return "Level5"; - case "level-6": - return "Level6"; - case "level-7": - return "Level7"; - case "level-8": - return "Level8"; - case "level-9": - return "Level9"; - case "level-10": - return "Level10"; - default: - return undefined; - } -} - -function frameToBase64( - frame: CapturedFrame | undefined, -): BlinkIdVerifyRequestDocumentVerificationImageSource | undefined { - if (!frame?.jpegBytes) return undefined; - return { - base64: btoa(new Uint8Array(frame.jpegBytes).reduce((data, byte) => data + String.fromCharCode(byte), "")), - }; -} diff --git a/packages/blinkid-verify-core/src/index.ts b/packages/blinkid-verify-core/src/index.ts index c63f3f51..6335de4e 100644 --- a/packages/blinkid-verify-core/src/index.ts +++ b/packages/blinkid-verify-core/src/index.ts @@ -31,9 +31,13 @@ export { export { getCrossOriginWorkerURL } from "@microblink/core-common/getCrossOriginWorkerURL"; export { getUserId } from "@microblink/core-common/getUserId"; export * from "./BlinkIdVerifyCore"; -export * from "./generatePayloadForBlinkIdVerifyCloudApi"; +export { VerifyApiError, toVerifyApiError } from "./VerifyApiError"; -/** Represents a remote scanning session. */ +/** + * Remote scanning session returned by {@link BlinkIdVerifyCore.createScanningSession}. + * + * Includes `submitResult` and `prepareVerifyRequest`. + */ export type RemoteScanningSession = Remote; // https://newsletter.daishikato.com/p/detecting-dual-module-issues-in-jotai diff --git a/packages/blinkid-verify-ux-manager/CHANGELOG.md b/packages/blinkid-verify-ux-manager/CHANGELOG.md index 003590b5..f84fd000 100644 --- a/packages/blinkid-verify-ux-manager/CHANGELOG.md +++ b/packages/blinkid-verify-ux-manager/CHANGELOG.md @@ -1,5 +1,70 @@ # @microblink/blinkid-verify-ux-manager +## 4000.0.0 + +### Major Changes + +- Replaced the BlinkID Verify capture pipeline with a v3 session, consent, and Verify API surface. +- Removed `addOnResultCallback` and `getSessionResult()`. Register `addOnCaptureCompletedCallback` and call `resolver.getCaptureResult()`. `resolver.verifyCaptureResult()` posts the capture when you submit it yourself. Neither method runs until you call it. If `verifyOnScanningCompletion` is also registered, keep the session alive until its success or error callback finishes. +- ```ts + const cleanup = manager.addOnCaptureCompletedCallback(async (resolver) => { + const result = await resolver.getCaptureResult(); + console.log(result.typedPayload); + }); + ``` +- `createBlinkIdVerifyUxManager` takes a `RemoteScanningSession`. That session always includes `submitResult` and `prepareVerifyRequest`. Omitting `consentUxConfig` still returns a `BlinkIdVerifyUxManager` and defaults to `{ consentMode: "NoConsentUI" }`. `"ProvideExternalConsent"` stores a full `Consent` before capture. `"RequireConsent"` returns a `BlinkIdVerifyConsentGate` instead of a manager: call `consentUiResponse`, which returns the manager on accept and `undefined` on decline. `RequireConsent.consent` is a `ConsentUiInput` (`userId`, `durationDays`, and optional `customerContext`). Call `destroy()` to abandon the gate before acceptance. +- ```ts + const created = await createBlinkIdVerifyUxManager( + cameraManager, + scanningSession, + { + consentUxConfig: { + consentMode: "RequireConsent", + consent: { userId: "user-123", durationDays: 30 }, + }, + } + ); + if (!(created instanceof BlinkIdVerifyConsentGate)) { + return; + } + const manager = await created.consentUiResponse( + cameraManagerComponent, + localizationStrings + ); + if (!manager) { + return; + } + ``` +- Added `verifyOnScanningCompletion({ onSuccess, onError })`. It is always available, and the capture resolver always includes `verifyCaptureResult`. Submit uses the `verifyApiBaseUrl` passed to `loadBlinkIdVerifyCore`. Omitted means the page origin. The SDK POSTs `{resolved}/api/v3/verify` with `Content-Type` only and `credentials` set to `"same-origin"`. It sends no API key and no `Authorization` header. Submit requests time out after 20 seconds and are aborted by `reset()`, session deletion, and SDK termination. `onSuccess` receives `VerifyApiResult` and the capture resolver. `onError` receives `VerifyApiError` and the same resolver. API failures are not reported as `result_retrieval_failed`. This method does not retry. Call `resolver.verifyCaptureResult()` again from `onError` to resubmit that capture while the scanning session is still alive. That call resolves with `{ ok: true, result }` or `{ ok: false, error }` and does not reject for API failures. A later resubmit is not delivered to `onSuccess`. +- ```ts + const manager = await createBlinkIdVerifyUxManager( + cameraManager, + scanningSession, + { + consentUxConfig: { consentMode: "NoConsentUI" }, + } + ); + manager.verifyOnScanningCompletion({ + onSuccess: (apiResult) => { + console.log(apiResult); + }, + onError: async (error, resolver) => { + console.error(error); + const retry = await resolver.verifyCaptureResult(); + if (!retry.ok) { + console.error(retry.error); + } + }, + }); + ``` +- Added `SCREEN_DETECTED` to `BlinkIdVerifyUiStateKey`. It uses the existing `feedback_messages.screen_detected` string. Localization key names in this release are otherwise unchanged. + +### Patch Changes + +- Updated the default `helpTooltipShowDelay` from 5 seconds to 10 seconds. +- Updated dependencies + - @microblink/blinkid-verify-core@4000.0.0 + ## 4000.0.0-next.1 ### Major Changes @@ -29,8 +94,8 @@ ### Patch Changes -- Update declaration bundles -- Turning on the flashlight now shows a glare warning message +- Updated declaration bundles +- Added a glare warning when the flashlight is turned on - Updated package dependencies. - Fixed an issue where frame processing wouldnt stop if showTimeoutModal was configured to false - Improves keyboard focus visibility for controls shown over light and dark backgrounds. diff --git a/packages/blinkid-verify-ux-manager/README.md b/packages/blinkid-verify-ux-manager/README.md index 0e241d47..cd06ff9f 100644 --- a/packages/blinkid-verify-ux-manager/README.md +++ b/packages/blinkid-verify-ux-manager/README.md @@ -208,10 +208,15 @@ You can customize UI strings when creating the feedback UI: createBlinkIdVerifyFeedbackUi(uxManager, cameraUi, { localizationStrings: { flashlight_warning_message: "Move your ID to avoid flashlight glare.", + consent_modal: { + title: "We need your consent to:", + }, }, }); ``` +`createBlinkIdVerify` applies the same `feedbackUiOptions.localizationStrings` to the consent dialog. Consent copy lives under `consent_modal` in `src/ui/locales/en.ts`. + #### Provided Translations
diff --git a/packages/blinkid-verify-ux-manager/docs/core/README.md b/packages/blinkid-verify-ux-manager/docs/core/README.md index 19fdc853..e3d681ef 100644 --- a/packages/blinkid-verify-ux-manager/docs/core/README.md +++ b/packages/blinkid-verify-ux-manager/docs/core/README.md @@ -8,6 +8,18 @@ ## References +### BlinkIdVerifyConsentGate + +Re-exports [BlinkIdVerifyConsentGate](../index/classes/BlinkIdVerifyConsentGate.md) + +*** + +### BlinkIdVerifyConsentUxConfiguration + +Re-exports [BlinkIdVerifyConsentUxConfiguration](../index/type-aliases/BlinkIdVerifyConsentUxConfiguration.md) + +*** + ### BlinkIdVerifyPageTransitionKey Re-exports [BlinkIdVerifyPageTransitionKey](../index/type-aliases/BlinkIdVerifyPageTransitionKey.md) @@ -110,6 +122,24 @@ Re-exports [BlinkIdVerifyUxManagerOptions](../index/type-aliases/BlinkIdVerifyUx *** +### CaptureCompletedCallback + +Re-exports [CaptureCompletedCallback](../index/type-aliases/CaptureCompletedCallback.md) + +*** + +### CaptureResultResolver + +Re-exports [CaptureResultResolver](../index/type-aliases/CaptureResultResolver.md) + +*** + +### ConsentUiInput + +Re-exports [ConsentUiInput](../index/type-aliases/ConsentUiInput.md) + +*** + ### createBlinkIdVerifyUxManager Re-exports [createBlinkIdVerifyUxManager](../index/functions/createBlinkIdVerifyUxManager.md) @@ -146,12 +176,30 @@ Re-exports [HapticFeedbackType](../index/type-aliases/HapticFeedbackType.md) *** +### NoConsentUI + +Re-exports [NoConsentUI](../index/type-aliases/NoConsentUI.md) + +*** + ### PartialProcessResult Re-exports [PartialProcessResult](../index/type-aliases/PartialProcessResult.md) *** +### ProvideExternalConsent + +Re-exports [ProvideExternalConsent](../index/type-aliases/ProvideExternalConsent.md) + +*** + +### RequireConsent + +Re-exports [RequireConsent](../index/type-aliases/RequireConsent.md) + +*** + ### UiState Re-exports [UiState](../index/type-aliases/UiState.md) @@ -167,3 +215,27 @@ Re-exports [UiStateEvent](../index/type-aliases/UiStateEvent.md) ### UiStateMap Re-exports [UiStateMap](../index/type-aliases/UiStateMap.md) + +*** + +### VerifyCaptureResult + +Re-exports [VerifyCaptureResult](../index/type-aliases/VerifyCaptureResult.md) + +*** + +### VerifyOnScanningCompletionCallbacks + +Re-exports [VerifyOnScanningCompletionCallbacks](../index/type-aliases/VerifyOnScanningCompletionCallbacks.md) + +*** + +### VerifyOnScanningCompletionErrorCallback + +Re-exports [VerifyOnScanningCompletionErrorCallback](../index/type-aliases/VerifyOnScanningCompletionErrorCallback.md) + +*** + +### VerifyOnScanningCompletionSuccessCallback + +Re-exports [VerifyOnScanningCompletionSuccessCallback](../index/type-aliases/VerifyOnScanningCompletionSuccessCallback.md) diff --git a/packages/blinkid-verify-ux-manager/docs/index/README.md b/packages/blinkid-verify-ux-manager/docs/index/README.md index 47cd3b52..0e280cb9 100644 --- a/packages/blinkid-verify-ux-manager/docs/index/README.md +++ b/packages/blinkid-verify-ux-manager/docs/index/README.md @@ -8,6 +8,7 @@ ## Classes +- [BlinkIdVerifyConsentGate](classes/BlinkIdVerifyConsentGate.md) - [FeedbackStabilizer](classes/FeedbackStabilizer.md) - [HapticFeedbackManager](classes/HapticFeedbackManager.md) @@ -17,6 +18,7 @@ ## Type Aliases +- [BlinkIdVerifyConsentUxConfiguration](type-aliases/BlinkIdVerifyConsentUxConfiguration.md) - [BlinkIdVerifyPageTransitionKey](type-aliases/BlinkIdVerifyPageTransitionKey.md) - [BlinkIdVerifyProcessingError](type-aliases/BlinkIdVerifyProcessingError.md) - [BlinkIdVerifyReticleType](type-aliases/BlinkIdVerifyReticleType.md) @@ -28,15 +30,25 @@ - [BlinkIdVerifyUiStateMap](type-aliases/BlinkIdVerifyUiStateMap.md) - [BlinkIdVerifyUiStepSuccessKey](type-aliases/BlinkIdVerifyUiStepSuccessKey.md) - [BlinkIdVerifyUxManagerOptions](type-aliases/BlinkIdVerifyUxManagerOptions.md) +- [CaptureCompletedCallback](type-aliases/CaptureCompletedCallback.md) +- [CaptureResultResolver](type-aliases/CaptureResultResolver.md) +- [ConsentUiInput](type-aliases/ConsentUiInput.md) - [FeedbackUiOptions](type-aliases/FeedbackUiOptions.md) - [HapticFeedbackType](type-aliases/HapticFeedbackType.md) - [LocaleRecord](type-aliases/LocaleRecord.md) - [LocalizationStrings](type-aliases/LocalizationStrings.md) +- [NoConsentUI](type-aliases/NoConsentUI.md) - [PartialLocalizationStrings](type-aliases/PartialLocalizationStrings.md) - [PartialProcessResult](type-aliases/PartialProcessResult.md) +- [ProvideExternalConsent](type-aliases/ProvideExternalConsent.md) +- [RequireConsent](type-aliases/RequireConsent.md) - [UiState](type-aliases/UiState.md) - [UiStateEvent](type-aliases/UiStateEvent.md) - [UiStateMap](type-aliases/UiStateMap.md) +- [VerifyCaptureResult](type-aliases/VerifyCaptureResult.md) +- [VerifyOnScanningCompletionCallbacks](type-aliases/VerifyOnScanningCompletionCallbacks.md) +- [VerifyOnScanningCompletionErrorCallback](type-aliases/VerifyOnScanningCompletionErrorCallback.md) +- [VerifyOnScanningCompletionSuccessCallback](type-aliases/VerifyOnScanningCompletionSuccessCallback.md) ## Variables diff --git a/packages/blinkid-verify-ux-manager/docs/index/classes/BlinkIdVerifyConsentGate.md b/packages/blinkid-verify-ux-manager/docs/index/classes/BlinkIdVerifyConsentGate.md new file mode 100644 index 00000000..56b0a6aa --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/classes/BlinkIdVerifyConsentGate.md @@ -0,0 +1,124 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / BlinkIdVerifyConsentGate + +# Class: BlinkIdVerifyConsentGate + +Holds a `BlinkIdVerifyUxManager` until the user accepts `RequireConsent`. + +The factory returns this gate instead of the manager. Acceptance hands the manager to the caller. Decline dismounts +the camera UI and destroys the manager. + +## Constructors + +### Constructor + +> **new BlinkIdVerifyConsentGate**(`manager`, `consentFields`): `BlinkIdVerifyConsentGate` + +#### Parameters + +##### manager + +[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md) + +Manager constructed by the factory. Frame processing stays blocked until consent is accepted. + +##### consentFields + +[`ConsentUiInput`](../type-aliases/ConsentUiInput.md) + +Values used to render the consent UI and generate the accepted consent object. + +#### Returns + +`BlinkIdVerifyConsentGate` + +## Methods + +### consentUiResponse() + +> **consentUiResponse**(`cameraManagerComponent`, `localizationStrings?`): `Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md) \| `undefined`\> + +Shows the consent modal on the camera UI. + +Acceptance returns the manager, which the caller then owns. Decline dismounts the camera UI, destroys the manager, +and returns `undefined`. A second call after acceptance returns the same manager without showing the modal again. + +#### Parameters + +##### cameraManagerComponent + +`CameraManagerComponent` + +Mounted camera UI used to show the consent modal. + +##### localizationStrings? + +Optional overrides for the consent dialog copy. The same object used for the feedback + UI applies here. + +###### consent_modal? + +`string` \| \{ `consent_btn?`: `string`; `consent_switch?`: `string`; `decline_btn?`: `string`; `details?`: `string`; `optional?`: `string`; `privacy_link?`: `string`; `privacy_notice?`: `string`; `title?`: `string`; \} = `...` + +###### document_filtered_modal? + +`string` \| \{ `details?`: `string`; `title?`: `string`; \} = `...` + +###### document_not_recognized_modal? + +`string` \| \{ `details?`: `string`; `title?`: `string`; \} = `...` + +###### feedback_messages? + +`string` \| \{ `blur_detected?`: `string`; `camera_angle_too_steep?`: `string`; `document_scanned_aria?`: `string`; `document_too_close_to_edge?`: `string`; `face_photo_not_fully_visible?`: `string`; `flip_document?`: `string`; `flip_to_back_side?`: `string`; `front_side_scanned_aria?`: `string`; `glare_detected?`: `string`; `keep_document_parallel?`: `string`; `keep_document_still?`: `string`; `move_closer?`: `string`; `move_farther?`: `string`; `move_left?`: `string`; `move_right?`: `string`; `move_top?`: `string`; `occluded?`: `string`; `scan_data_page?`: `string`; `scan_last_page_barcode?`: `string`; `scan_left_page?`: `string`; `scan_right_page?`: `string`; `scan_the_back_side?`: `string`; `scan_the_barcode?`: `string`; `scan_the_front_side?`: `string`; `scan_top_page?`: `string`; `screen_detected?`: `string`; `too_bright?`: `string`; `too_dark?`: `string`; `wrong_left?`: `string`; `wrong_right?`: `string`; `wrong_top?`: `string`; \} = `...` + +###### flashlight_warning_message? + +`string` = "Watch out for flashlight glare.\nGently move your ID around to avoid it." + +###### help_button? + +`string` \| \{ `aria_label?`: `string`; `tooltip?`: `string`; \} = `...` + +###### help_modal? + +`string` \| \{ `aria?`: `string`; `back_btn?`: `string`; `blur?`: `string` \| \{ `details?`: `string`; `details_desktop?`: `string`; `title?`: `string`; \}; `camera_lens?`: `string` \| \{ `details?`: `string`; `title?`: `string`; \}; `done_btn?`: `string`; `done_btn_aria?`: `string`; `lighting?`: `string` \| \{ `details?`: `string`; `title?`: `string`; \}; `next_btn?`: `string`; `visibility?`: `string` \| \{ `details?`: `string`; `title?`: `string`; \}; \} = `...` + +###### onboarding_modal? + +`string` \| \{ `aria?`: `string`; `btn?`: `string`; `details?`: `string`; `details_desktop?`: `string`; `title?`: `string`; `title_desktop?`: `string`; \} = `...` + +###### privacy_notice? + +`string` \| \{ `title?`: `string`; \} = `...` + +###### sdk_aria? + +`string` = `"Document scanning screen"` + +###### timeout_modal? + +`string` \| \{ `cancel_btn?`: `string`; `details?`: `string`; `retry_btn?`: `string`; `title?`: `string`; \} = `...` + +#### Returns + +`Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md) \| `undefined`\> + +The UX manager when consent is accepted, otherwise `undefined`. + +*** + +### destroy() + +> **destroy**(): `void` + +Destroys the manager when the caller abandons the flow before acceptance. + +After a successful `consentUiResponse`, the caller owns the manager and must call `manager.destroy()` instead. + +#### Returns + +`void` diff --git a/packages/blinkid-verify-ux-manager/docs/index/functions/createBlinkIdVerifyUxManager.md b/packages/blinkid-verify-ux-manager/docs/index/functions/createBlinkIdVerifyUxManager.md index 2688d226..33513f09 100644 --- a/packages/blinkid-verify-ux-manager/docs/index/functions/createBlinkIdVerifyUxManager.md +++ b/packages/blinkid-verify-ux-manager/docs/index/functions/createBlinkIdVerifyUxManager.md @@ -6,30 +6,107 @@ # Function: createBlinkIdVerifyUxManager() +## Call Signature + +> **createBlinkIdVerifyUxManager**(`cameraManager`, `scanningSession`, `options`): `Promise`\<[`BlinkIdVerifyConsentGate`](../classes/BlinkIdVerifyConsentGate.md)\> + +Creates a BlinkID Verify UX manager, or a consent gate when scanning must wait for consent. + +### Parameters + +#### cameraManager + +`CameraManager` + +The camera manager. + +#### scanningSession + +`RemoteScanningSession` + +The scanning session. + +#### options + +`ManagerOptionsWithRequireConsent` + +UX manager options. `RequireConsent` returns a [BlinkIdVerifyConsentGate](../classes/BlinkIdVerifyConsentGate.md). Call + `consentUiResponse` before using the manager. Omitting `consentUxConfig`, `NoConsentUI`, and + `ProvideExternalConsent` return a [BlinkIdVerifyUxManager](../interfaces/BlinkIdVerifyUxManager.md) directly. `ProvideExternalConsent` stores its + consent object before the frame callback is registered. + +### Returns + +`Promise`\<[`BlinkIdVerifyConsentGate`](../classes/BlinkIdVerifyConsentGate.md)\> + +The UX manager, or a consent gate when `consentMode` is `RequireConsent`. + +## Call Signature + > **createBlinkIdVerifyUxManager**(`cameraManager`, `scanningSession`, `options?`): `Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md)\> -Creates a BlinkIdVerifyUxManager. +Creates a BlinkID Verify UX manager, or a consent gate when scanning must wait for consent. -## Parameters +### Parameters -### cameraManager +#### cameraManager `CameraManager` The camera manager. -### scanningSession +#### scanningSession `RemoteScanningSession` The scanning session. -### options? +#### options? -[`BlinkIdVerifyUxManagerOptions`](../type-aliases/BlinkIdVerifyUxManagerOptions.md) = `{}` +`ManagerOptionsWithoutRequireConsent` -## Returns +UX manager options. `RequireConsent` returns a [BlinkIdVerifyConsentGate](../classes/BlinkIdVerifyConsentGate.md). Call + `consentUiResponse` before using the manager. Omitting `consentUxConfig`, `NoConsentUI`, and + `ProvideExternalConsent` return a [BlinkIdVerifyUxManager](../interfaces/BlinkIdVerifyUxManager.md) directly. `ProvideExternalConsent` stores its + consent object before the frame callback is registered. + +### Returns `Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md)\> -The BlinkIdVerifyUxManager instance. +The UX manager, or a consent gate when `consentMode` is `RequireConsent`. + +## Call Signature + +> **createBlinkIdVerifyUxManager**(`cameraManager`, `scanningSession`, `options?`): `Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md) \| [`BlinkIdVerifyConsentGate`](../classes/BlinkIdVerifyConsentGate.md)\> + +Creates a BlinkID Verify UX manager, or a consent gate when scanning must wait for consent. + +### Parameters + +#### cameraManager + +`CameraManager` + +The camera manager. + +#### scanningSession + +`RemoteScanningSession` + +The scanning session. + +#### options? + +`Partial`\<[`BlinkIdVerifyUxManagerOptions`](../type-aliases/BlinkIdVerifyUxManagerOptions.md)\> + +UX manager options. `RequireConsent` returns a [BlinkIdVerifyConsentGate](../classes/BlinkIdVerifyConsentGate.md). Call + `consentUiResponse` before using the manager. Omitting `consentUxConfig`, `NoConsentUI`, and + `ProvideExternalConsent` return a [BlinkIdVerifyUxManager](../interfaces/BlinkIdVerifyUxManager.md) directly. `ProvideExternalConsent` stores its + consent object before the frame callback is registered. + +### Returns + +`Promise`\<[`BlinkIdVerifyUxManager`](../interfaces/BlinkIdVerifyUxManager.md) \| [`BlinkIdVerifyConsentGate`](../classes/BlinkIdVerifyConsentGate.md)\> + +The UX manager, or a consent gate when `consentMode` is `RequireConsent`. diff --git a/packages/blinkid-verify-ux-manager/docs/index/interfaces/BlinkIdVerifyUxManager.md b/packages/blinkid-verify-ux-manager/docs/index/interfaces/BlinkIdVerifyUxManager.md index 54f5b475..fc05979e 100644 --- a/packages/blinkid-verify-ux-manager/docs/index/interfaces/BlinkIdVerifyUxManager.md +++ b/packages/blinkid-verify-ux-manager/docs/index/interfaces/BlinkIdVerifyUxManager.md @@ -127,53 +127,57 @@ The currently applied UI state key. ## Methods -### addOnErrorCallback() +### addOnCaptureCompletedCallback() -> **addOnErrorCallback**(`callback`): () => `void` +> **addOnCaptureCompletedCallback**(`callback`): () => `void` -Registers a callback function to be called when an error occurs during processing. +Registers a callback invoked after document capture with a lazy [CaptureResultResolver](../type-aliases/CaptureResultResolver.md). + +Runs after the capture success animation and does not wait for the Verify API. Hosts can tear down scanning UI +here. Capture itself does not copy session results or submit to the Verify API; call resolver methods for the data +you need. If [BlinkIdVerifyUxManager.verifyOnScanningCompletion](#verifyonscanningcompletion) is also registered, keep the session alive +until those success or error callbacks run. #### Parameters ##### callback -(`errorState`) => `void` +[`CaptureCompletedCallback`](../type-aliases/CaptureCompletedCallback.md) -A function that will be called with the error state. +Called with a resolver bound to this capture. #### Returns -A cleanup function that, when called, will remove the registered -callback. +A cleanup function that removes the callback. () => `void` #### Example ```ts -const cleanup = manager.addOnErrorCallback((error) => { - console.error("Processing error:", error); +const cleanup = manager.addOnCaptureCompletedCallback(async (resolver) => { + const result = await resolver.getCaptureResult(); + console.log(result.typedPayload); }); - // Later, to remove the callback: cleanup(); ``` *** -### addOnFrameProcessCallback() +### addOnErrorCallback() -> **addOnFrameProcessCallback**(`callback`): () => `void` +> **addOnErrorCallback**(`callback`): () => `void` -Registers a callback function to be called when a frame is processed. +Registers a callback function to be called when an error occurs during processing. #### Parameters ##### callback -(`frameResult`) => `void` +(`errorState`) => `void` -A function that will be called with the frame analysis result. +A function that will be called with the error state. #### Returns @@ -185,8 +189,8 @@ callback. #### Example ```ts -const cleanup = manager.addOnFrameProcessCallback((frameResult) => { - console.log("Frame processed:", frameResult); +const cleanup = manager.addOnErrorCallback((error) => { + console.error("Processing error:", error); }); // Later, to remove the callback: @@ -195,19 +199,19 @@ const cleanup = manager.addOnFrameProcessCallback((frameResult) => { *** -### addOnResultCallback() +### addOnFrameProcessCallback() -> **addOnResultCallback**(`callback`): () => `void` +> **addOnFrameProcessCallback**(`callback`): () => `void` -Registers a callback function to be called when a scan result is available. +Registers a callback function to be called when a frame is processed. #### Parameters ##### callback -(`result`) => `void` +(`frameResult`) => `void` -A function that will be called with the scan result. +A function that will be called with the frame analysis result. #### Returns @@ -219,8 +223,8 @@ callback. #### Example ```ts -const cleanup = manager.addOnResultCallback((result) => { - console.log("Scan result:", result); +const cleanup = manager.addOnFrameProcessCallback((frameResult) => { + console.log("Frame processed:", frameResult); }); // Later, to remove the callback: @@ -335,20 +339,6 @@ Returns the initial UI state key used when resetting UX state. *** -### getSessionResult() - -> **getSessionResult**(): `Promise`\<`BlinkIdVerifyScanningResult`\> - -Gets the result from the scanning session. - -#### Returns - -`Promise`\<`BlinkIdVerifyScanningResult`\> - -The result. - -*** - ### getTimeoutDuration() > **getTimeoutDuration**(): `number` \| `null` @@ -511,3 +501,54 @@ Throws an error if duration is less than or equal to 0 when not null. #### Returns `void` + +*** + +### verifyOnScanningCompletion() + +> **verifyOnScanningCompletion**(`callbacks`): () => `void` + +Submits the captured session to the Verify API when scanning completes, then invokes success or error callbacks. + +Submit starts after the capture success animation. [BlinkIdVerifyUxManager.addOnCaptureCompletedCallback](#addoncapturecompletedcallback) runs +first and does not wait for the network; these success or error callbacks run when submit settles. Keep the session +alive until then if both APIs are used. Network submit is available on every session. The SDK posts to the base URL +configured at core init and sends no API key. + +API failures are delivered to `onError` with the same resolver. From `onError`, call +[CaptureResultResolver.verifyCaptureResult](../type-aliases/CaptureResultResolver.md#verifycaptureresult) again to resubmit that capture while the scanning session is still +alive. That later call is not delivered to `onSuccess`. + +#### Parameters + +##### callbacks + +[`VerifyOnScanningCompletionCallbacks`](../type-aliases/VerifyOnScanningCompletionCallbacks.md) + +`onSuccess` receives the API result and capture resolver. `onError` receives a + VerifyApiError and the capture resolver. The client chooses whether to resubmit. + +#### Returns + +A cleanup function that removes both callbacks. + +() => `void` + +#### Example + +```ts +const cleanup = manager.verifyOnScanningCompletion({ + onSuccess: (apiResult) => { + console.log(apiResult); + }, + onError: async (error, resolver) => { + console.error(error); + const retry = await resolver.verifyCaptureResult(); + if (!retry.ok) { + console.error(retry.error); + } + }, + }); + + cleanup(); +``` diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyConsentUxConfiguration.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyConsentUxConfiguration.md new file mode 100644 index 00000000..d5767730 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyConsentUxConfiguration.md @@ -0,0 +1,9 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / BlinkIdVerifyConsentUxConfiguration + +# Type Alias: BlinkIdVerifyConsentUxConfiguration + +> **BlinkIdVerifyConsentUxConfiguration** = [`NoConsentUI`](NoConsentUI.md) \| [`RequireConsent`](RequireConsent.md) \| [`ProvideExternalConsent`](ProvideExternalConsent.md) diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyUxManagerOptions.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyUxManagerOptions.md index f669531d..f297ae33 100644 --- a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyUxManagerOptions.md +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/BlinkIdVerifyUxManagerOptions.md @@ -10,6 +10,12 @@ ## Properties +### consentUxConfig + +> **consentUxConfig**: [`BlinkIdVerifyConsentUxConfiguration`](BlinkIdVerifyConsentUxConfiguration.md) + +*** + ### initialUiStateKey? > `optional` **initialUiStateKey?**: [`BlinkIdVerifyUiStateKey`](BlinkIdVerifyUiStateKey.md) diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureCompletedCallback.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureCompletedCallback.md new file mode 100644 index 00000000..42b2dcfe --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureCompletedCallback.md @@ -0,0 +1,19 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / CaptureCompletedCallback + +# Type Alias: CaptureCompletedCallback + +> **CaptureCompletedCallback** = (`resolver`) => `void` \| `Promise`\<`void`\> + +## Parameters + +### resolver + +[`CaptureResultResolver`](CaptureResultResolver.md) + +## Returns + +`void` \| `Promise`\<`void`\> diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureResultResolver.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureResultResolver.md new file mode 100644 index 00000000..bb328c13 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/CaptureResultResolver.md @@ -0,0 +1,36 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / CaptureResultResolver + +# Type Alias: CaptureResultResolver + +> **CaptureResultResolver** = `object` + +Lazy accessors for a finished BlinkID Verify capture. None of these methods run until the client calls them. + +## Methods + +### getCaptureResult() + +> **getCaptureResult**(): `Promise`\<`SessionResult`\> + +Generates the session result with serialized parts, images, and typed payload data. + +#### Returns + +`Promise`\<`SessionResult`\> + +*** + +### verifyCaptureResult() + +> **verifyCaptureResult**(): `Promise`\<[`VerifyCaptureResult`](VerifyCaptureResult.md)\> + +Generates the payload in Wasm and POSTs it from the worker. Resolves with the API result or a +VerifyApiError. + +#### Returns + +`Promise`\<[`VerifyCaptureResult`](VerifyCaptureResult.md)\> diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ConsentUiInput.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ConsentUiInput.md new file mode 100644 index 00000000..db2c7433 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ConsentUiInput.md @@ -0,0 +1,11 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / ConsentUiInput + +# Type Alias: ConsentUiInput + +> **ConsentUiInput** = `Pick`\<`Consent`, `"userId"` \| `"durationDays"` \| `"customerContext"`\> + +Consent values used to render the SDK consent UI. diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/NoConsentUI.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/NoConsentUI.md new file mode 100644 index 00000000..6b7cb75a --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/NoConsentUI.md @@ -0,0 +1,15 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / NoConsentUI + +# Type Alias: NoConsentUI + +> **NoConsentUI** = `object` + +## Properties + +### consentMode + +> **consentMode**: `"NoConsentUI"` diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ProvideExternalConsent.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ProvideExternalConsent.md new file mode 100644 index 00000000..bd477be1 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/ProvideExternalConsent.md @@ -0,0 +1,21 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / ProvideExternalConsent + +# Type Alias: ProvideExternalConsent + +> **ProvideExternalConsent** = `object` + +## Properties + +### consent + +> **consent**: `Consent` + +*** + +### consentMode + +> **consentMode**: `"ProvideExternalConsent"` diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/RequireConsent.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/RequireConsent.md new file mode 100644 index 00000000..13cf1997 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/RequireConsent.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / RequireConsent + +# Type Alias: RequireConsent + +> **RequireConsent** = `object` + +## Properties + +### consent + +> **consent**: [`ConsentUiInput`](ConsentUiInput.md) + +Values used to render the consent UI and generate the accepted consent object. + +*** + +### consentMode + +> **consentMode**: `"RequireConsent"` diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyCaptureResult.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyCaptureResult.md new file mode 100644 index 00000000..07b017ab --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyCaptureResult.md @@ -0,0 +1,13 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / VerifyCaptureResult + +# Type Alias: VerifyCaptureResult + +> **VerifyCaptureResult** = \{ `ok`: `true`; `result`: `VerifyApiResult`; \} \| \{ `error`: `VerifyApiError`; `ok`: `false`; \} + +Settled Verify API submit. + +API failures resolve as `error` instead of rejecting the promise. diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionCallbacks.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionCallbacks.md new file mode 100644 index 00000000..512ab8c9 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionCallbacks.md @@ -0,0 +1,27 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / VerifyOnScanningCompletionCallbacks + +# Type Alias: VerifyOnScanningCompletionCallbacks + +> **VerifyOnScanningCompletionCallbacks** = `object` + +Success and error callbacks for `verifyOnScanningCompletion`. + +## Properties + +### onError + +> **onError**: [`VerifyOnScanningCompletionErrorCallback`](VerifyOnScanningCompletionErrorCallback.md) + +Called with a VerifyApiError and the capture resolver. The client chooses whether to resubmit. + +*** + +### onSuccess + +> **onSuccess**: [`VerifyOnScanningCompletionSuccessCallback`](VerifyOnScanningCompletionSuccessCallback.md) + +Called with the API result and capture resolver. diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionErrorCallback.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionErrorCallback.md new file mode 100644 index 00000000..1a19cf8a --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionErrorCallback.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / VerifyOnScanningCompletionErrorCallback + +# Type Alias: VerifyOnScanningCompletionErrorCallback + +> **VerifyOnScanningCompletionErrorCallback** = (`error`, `resolver`) => `void` \| `Promise`\<`void`\> + +## Parameters + +### error + +`VerifyApiError` + +### resolver + +[`CaptureResultResolver`](CaptureResultResolver.md) + +## Returns + +`void` \| `Promise`\<`void`\> diff --git a/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionSuccessCallback.md b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionSuccessCallback.md new file mode 100644 index 00000000..8b6fc175 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/docs/index/type-aliases/VerifyOnScanningCompletionSuccessCallback.md @@ -0,0 +1,23 @@ +[**@microblink/blinkid-verify-ux-manager**](../../README.md) + +*** + +[@microblink/blinkid-verify-ux-manager](../../README.md) / [index](../README.md) / VerifyOnScanningCompletionSuccessCallback + +# Type Alias: VerifyOnScanningCompletionSuccessCallback + +> **VerifyOnScanningCompletionSuccessCallback** = (`result`, `resolver`) => `void` \| `Promise`\<`void`\> + +## Parameters + +### result + +`VerifyApiResult` + +### resolver + +[`CaptureResultResolver`](CaptureResultResolver.md) + +## Returns + +`void` \| `Promise`\<`void`\> diff --git a/packages/blinkid-verify-ux-manager/docs/index/variables/blinkIdVerifyUiErrorStateKeys.md b/packages/blinkid-verify-ux-manager/docs/index/variables/blinkIdVerifyUiErrorStateKeys.md index 32c2ac44..504d7520 100644 --- a/packages/blinkid-verify-ux-manager/docs/index/variables/blinkIdVerifyUiErrorStateKeys.md +++ b/packages/blinkid-verify-ux-manager/docs/index/variables/blinkIdVerifyUiErrorStateKeys.md @@ -6,6 +6,6 @@ # Variable: blinkIdVerifyUiErrorStateKeys -> `const` **blinkIdVerifyUiErrorStateKeys**: readonly \[`"FRONT_PAGE_NOT_IN_FRAME"`, `"BACK_PAGE_NOT_IN_FRAME"`, `"DATA_PAGE_NOT_IN_FRAME"`, `"TOP_PAGE_NOT_IN_FRAME"`, `"LEFT_PAGE_NOT_IN_FRAME"`, `"RIGHT_PAGE_NOT_IN_FRAME"`, `"LAST_PAGE_NOT_IN_FRAME"`, `"BARCODE_NOT_IN_FRAME"`, `"DOCUMENT_FRAMING_CAMERA_TOO_FAR"`, `"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE"`, `"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP"`, `"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE"`, `"BLUR_DETECTED"`, `"GLARE_DETECTED"`, `"TOO_DARK"`, `"TOO_BRIGHT"`, `"OCCLUDED"`, `"FACE_PHOTO_OCCLUDED"`, `"WRONG_SIDE"`, `"WRONG_TOP_PAGE"`, `"WRONG_LEFT_PAGE"`, `"WRONG_RIGHT_PAGE"`, `"WRONG_LAST_PAGE"`, `"UNSUPPORTED_DOCUMENT"`\] +> `const` **blinkIdVerifyUiErrorStateKeys**: readonly \[`"FRONT_PAGE_NOT_IN_FRAME"`, `"BACK_PAGE_NOT_IN_FRAME"`, `"DATA_PAGE_NOT_IN_FRAME"`, `"TOP_PAGE_NOT_IN_FRAME"`, `"LEFT_PAGE_NOT_IN_FRAME"`, `"RIGHT_PAGE_NOT_IN_FRAME"`, `"LAST_PAGE_NOT_IN_FRAME"`, `"BARCODE_NOT_IN_FRAME"`, `"DOCUMENT_FRAMING_CAMERA_TOO_FAR"`, `"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE"`, `"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP"`, `"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE"`, `"SCREEN_DETECTED"`, `"BLUR_DETECTED"`, `"GLARE_DETECTED"`, `"TOO_DARK"`, `"TOO_BRIGHT"`, `"OCCLUDED"`, `"FACE_PHOTO_OCCLUDED"`, `"WRONG_SIDE"`, `"WRONG_TOP_PAGE"`, `"WRONG_LEFT_PAGE"`, `"WRONG_RIGHT_PAGE"`, `"WRONG_LAST_PAGE"`, `"UNSUPPORTED_DOCUMENT"`\] The error states for BlinkID Verify. Mappable from `ProcessResult`. diff --git a/packages/blinkid-verify-ux-manager/package.json b/packages/blinkid-verify-ux-manager/package.json index 19cdd505..651a2808 100644 --- a/packages/blinkid-verify-ux-manager/package.json +++ b/packages/blinkid-verify-ux-manager/package.json @@ -1,6 +1,6 @@ { "name": "@microblink/blinkid-verify-ux-manager", - "version": "4000.0.0-next.1", + "version": "4000.0.0", "description": "BlinkID Verify UX Manager provides user feedback based on the blinkid-verify process results.", "keywords": [ "aml", @@ -90,6 +90,7 @@ "@microblink/feedback-stabilizer": "workspace:^", "@microblink/repo-utils": "workspace:*", "@microblink/shared-components": "workspace:^", + "@microblink/test-utils": "workspace:*", "@microblink/tsconfig": "workspace:*", "@microblink/unocss-config": "workspace:*", "@microblink/ux-common": "workspace:^", diff --git a/packages/blinkid-verify-ux-manager/src/core.ts b/packages/blinkid-verify-ux-manager/src/core.ts index 9c9a21f0..956e9666 100644 --- a/packages/blinkid-verify-ux-manager/src/core.ts +++ b/packages/blinkid-verify-ux-manager/src/core.ts @@ -9,7 +9,16 @@ export type * from "@microblink/feedback-stabilizer"; export type * from "@microblink/ux-common/hapticFeedback"; export * from "./core/blinkid-verify-ui-state"; export type { BlinkIdVerifyProcessingError } from "./core/BlinkIdVerifyProcessingError"; +export { BlinkIdVerifyConsentGate } from "./core/BlinkIdVerifyConsentGate"; export type { BlinkIdVerifyUxManager } from "./core/BlinkIdVerifyUxManager"; +export type { + CaptureCompletedCallback, + CaptureResultResolver, + VerifyCaptureResult, + VerifyOnScanningCompletionCallbacks, + VerifyOnScanningCompletionErrorCallback, + VerifyOnScanningCompletionSuccessCallback, +} from "./core/capture-result-resolver"; export * from "./core/createBlinkIdVerifyUxManager"; const testSymbol = Symbol(); diff --git a/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyConsentGate.ts b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyConsentGate.ts new file mode 100644 index 00000000..fa15e6a2 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyConsentGate.ts @@ -0,0 +1,98 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { Consent } from "@microblink/blinkid-verify-core"; +import type { CameraManagerComponent } from "@microblink/camera-manager/ui"; + +import type { PartialLocalizationStrings } from "../ui/localization-strings"; +import { showConsentUi } from "../ui/showConsentUi"; +import { acceptRequireConsent, BlinkIdVerifyUxManager } from "./BlinkIdVerifyUxManager"; +import type { ConsentUiInput } from "./createBlinkIdVerifyUxManager"; + +/** + * Holds a `BlinkIdVerifyUxManager` until the user accepts `RequireConsent`. + * + * The factory returns this gate instead of the manager. Acceptance hands the manager to the caller. Decline dismounts + * the camera UI and destroys the manager. + */ +export class BlinkIdVerifyConsentGate { + #manager: BlinkIdVerifyUxManager; + #consentFields: ConsentUiInput; + #handedOffManager?: BlinkIdVerifyUxManager; + #closed = false; + #rejectConsent?: () => void; + + /** + * @param manager - Manager constructed by the factory. Frame processing stays blocked until consent is accepted. + * @param consentFields - Values used to render the consent UI and generate the accepted consent object. + */ + constructor(manager: BlinkIdVerifyUxManager, consentFields: ConsentUiInput) { + this.#manager = manager; + this.#consentFields = consentFields; + } + + /** + * Shows the consent modal on the camera UI. + * + * Acceptance returns the manager, which the caller then owns. Decline dismounts the camera UI, destroys the manager, + * and returns `undefined`. A second call after acceptance returns the same manager without showing the modal again. + * + * @param cameraManagerComponent - Mounted camera UI used to show the consent modal. + * @param localizationStrings - Optional overrides for the consent dialog copy. The same object used for the feedback + * UI applies here. + * @returns The UX manager when consent is accepted, otherwise `undefined`. + */ + async consentUiResponse( + cameraManagerComponent: CameraManagerComponent, + localizationStrings?: PartialLocalizationStrings, + ): Promise { + if (this.#handedOffManager) { + return this.#handedOffManager; + } + + if (this.#closed) { + return undefined; + } + + try { + const consent = await new Promise((resolve, reject) => { + this.#rejectConsent = () => { + reject(); + }; + void showConsentUi(cameraManagerComponent, this.#consentFields, localizationStrings).then(resolve, reject); + }); + this.#rejectConsent = undefined; + + if (this.#closed) { + return undefined; + } + + acceptRequireConsent(this.#manager, consent); + this.#handedOffManager = this.#manager; + this.#closed = true; + return this.#manager; + } catch { + this.#rejectConsent = undefined; + if (!this.#closed) { + this.#closed = true; + this.#manager.destroy(); + cameraManagerComponent.dismount(); + } + return undefined; + } + } + + /** + * Destroys the manager when the caller abandons the flow before acceptance. + * + * After a successful `consentUiResponse`, the caller owns the manager and must call `manager.destroy()` instead. + */ + destroy(): void { + if (this.#closed) { + return; + } + + this.#closed = true; + this.#manager.destroy(); + this.#rejectConsent?.(); + } +} diff --git a/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.capture-result.test.ts b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.capture-result.test.ts new file mode 100644 index 00000000..f92fbcf1 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.capture-result.test.ts @@ -0,0 +1,389 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { + BlinkIdVerifyProcessResult, + BlinkIdVerifySessionResult, + BlinkIdVerifySessionSettings, + Consent, + DeviceInfo, + ProcessResultWithBuffer, + RemoteScanningSession, + VerifyApiResult, +} from "@microblink/blinkid-verify-core"; +import { VerifyApiError } from "@microblink/blinkid-verify-core"; +import type { CameraManager } from "@microblink/camera-manager/core"; +import { + createFakeCameraHarness, + createFakeImageData, + createFakeScanningSession, + enableRafAwareFakeTimers, + setupDestroyableTeardown, +} from "@microblink/test-utils"; +import { advanceAndFlushUi } from "@microblink/test-utils/vitest/timers"; +import { beforeEach, describe, expect, test, vi } from "vitest"; + +import { createVerifyApiResult } from "./__testdata/verifyApiResult"; +import { blinkIdVerifyUiStateMap } from "./blinkid-verify-ui-state"; +import { BlinkIdVerifyUxManager } from "./BlinkIdVerifyUxManager"; +import type { CaptureResultResolver } from "./capture-result-resolver"; + +const mockSleep = vi.hoisted(() => vi.fn().mockResolvedValue(undefined)); + +vi.mock("@microblink/ux-common/utils", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + sleep: mockSleep, + }; +}); + +vi.mock("@microblink/ux-common/deviceOrientationAnalytics", () => ({ + subscribeToDeviceOrientation: vi.fn(() => () => undefined), +})); + +const trackManager = setupDestroyableTeardown(); + +const sessionSettings = { + inputImageSource: "video", +} as BlinkIdVerifySessionSettings; + +const deviceInfo = { userAgent: "test" } as DeviceInfo; + +const serializedResult: BlinkIdVerifySessionResult = { + serializedPayload: { + configuration: "{}", + sdkMetadata: "{}", + }, +}; + +const apiResult = createVerifyApiResult(); + +const createDocumentCapturedProcessResult = (): ProcessResultWithBuffer => + ({ + arrayBuffer: new ArrayBuffer(8), + inputImageAnalysisResult: { + blurDetected: false, + glareDetected: false, + occlusionDetected: false, + tiltDetected: false, + screenPresenceDetected: false, + scanningSide: "first", + hasBarcodeReadingIssue: false, + extractionInputImageAnalysisResult: { + documentLocation: { + upperLeft: { x: 0, y: 0 }, + upperRight: { x: 0, y: 0 }, + lowerLeft: { x: 0, y: 0 }, + lowerRight: { x: 0, y: 0 }, + }, + processingStatus: "success", + detectionStatus: "sucess", + isPassport: false, + isPassportWithBarcode: false, + documentOrientation: "horizontal", + documentRotation: "zero", + }, + }, + resultCompleteness: { + scanningStatus: "document-scanned", + }, + }) as ProcessResultWithBuffer; + +type VerifySessionExtra = { + prepareVerifyRequest?: ReturnType; + submitResult?: ReturnType; +}; + +const createManager = ( + scanningSession: ReturnType, + options: ConstructorParameters[2] = { + consentUxConfig: { consentMode: "NoConsentUI" }, + }, +) => { + const cameraHarness = createFakeCameraHarness(); + const manager = trackManager( + new BlinkIdVerifyUxManager( + cameraHarness.cameraManager as unknown as CameraManager, + scanningSession as unknown as RemoteScanningSession, + options, + sessionSettings, + false, + false, + deviceInfo, + ), + ); + manager.setTimeoutDuration(null); + return { cameraHarness, manager }; +}; + +const captureDocument = async (cameraHarness: ReturnType): Promise => { + cameraHarness.emitPlaybackState("capturing"); + await cameraHarness.emitFrame(createFakeImageData()); + await advanceAndFlushUi(blinkIdVerifyUiStateMap.INTRO_FRONT_PAGE.minDuration + 100); +}; + +describe("BlinkIdVerifyUxManager capture result resolver", () => { + beforeEach(() => { + vi.clearAllMocks(); + enableRafAwareFakeTimers(); + }); + + test("does not call getResult when capture completes", async () => { + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + extra: { + prepareVerifyRequest: vi.fn(), + submitResult: vi.fn(), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onCaptureCompleted = vi.fn(); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + expect(scanningSession.getResult).not.toHaveBeenCalled(); + expect(scanningSession.submitResult).not.toHaveBeenCalled(); + }); + + test("verifyOnScanningCompletion submits once then invokes success with the same resolver", async () => { + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + extra: { + submitResult: vi.fn().mockResolvedValue(apiResult), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onSuccess = vi.fn(); + const onError = vi.fn(); + const onCaptureCompleted = vi.fn(); + manager.verifyOnScanningCompletion({ onSuccess, onError }); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onSuccess).toHaveBeenCalledTimes(1); + }); + + const resolver = onSuccess.mock.calls[0]?.[1] as CaptureResultResolver; + expect(onSuccess).toHaveBeenCalledWith(apiResult, resolver); + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + expect(onCaptureCompleted).toHaveBeenCalledWith(resolver); + expect(scanningSession.submitResult).toHaveBeenCalledTimes(1); + expect(scanningSession.getResult).not.toHaveBeenCalled(); + expect(onError).not.toHaveBeenCalled(); + }); + + test("onCaptureCompleted runs while verify submit is still pending", async () => { + let resolveSubmit!: (value: VerifyApiResult) => void; + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + extra: { + submitResult: vi.fn( + () => + new Promise((resolve) => { + resolveSubmit = resolve; + }), + ), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onSuccess = vi.fn(); + const onError = vi.fn(); + const onCaptureCompleted = vi.fn(); + manager.verifyOnScanningCompletion({ onSuccess, onError }); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + expect(scanningSession.submitResult).toHaveBeenCalledTimes(1); + expect(onSuccess).not.toHaveBeenCalled(); + expect(onError).not.toHaveBeenCalled(); + + resolveSubmit(apiResult); + + await vi.waitFor(() => { + expect(onSuccess).toHaveBeenCalledTimes(1); + }); + expect(onSuccess).toHaveBeenCalledWith(apiResult, onCaptureCompleted.mock.calls[0]?.[0]); + expect(onError).not.toHaveBeenCalled(); + }); + + test("verify API failure goes to onError and is not result_retrieval_failed", async () => { + const apiError = new VerifyApiError("backend failed", { status: 400, body: { error: "bad request" } }); + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + extra: { + submitResult: vi.fn().mockRejectedValue(apiError), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onSuccess = vi.fn(); + const onError = vi.fn(); + const onProcessingError = vi.fn(); + const onCaptureCompleted = vi.fn(); + manager.verifyOnScanningCompletion({ onSuccess, onError }); + manager.addOnErrorCallback(onProcessingError); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onError).toHaveBeenCalledTimes(1); + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + expect(onError.mock.calls[0]?.[0]).toBe(apiError); + expect(onError.mock.calls[0]?.[1]).toBe(onCaptureCompleted.mock.calls[0]?.[0]); + expect(onSuccess).not.toHaveBeenCalled(); + expect(onProcessingError).not.toHaveBeenCalled(); + }); + + test("onError can resubmit the same capture without a new scan", async () => { + const apiError = new VerifyApiError("backend failed", { status: 503, body: { error: "unavailable" } }); + const retryResult = createVerifyApiResult(); + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + extra: { + submitResult: vi.fn().mockRejectedValueOnce(apiError).mockResolvedValueOnce(retryResult), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onSuccess = vi.fn(); + let resubmitted: VerifyApiResult | undefined; + const onError = vi.fn(async (_error: VerifyApiError, resolver: CaptureResultResolver) => { + const retry = await resolver.verifyCaptureResult(); + if (retry.ok) { + resubmitted = retry.result; + } + }); + manager.verifyOnScanningCompletion({ onSuccess, onError }); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(resubmitted).toBe(retryResult); + }); + expect(onError).toHaveBeenCalledTimes(1); + expect(scanningSession.submitResult).toHaveBeenCalledTimes(2); + expect(onSuccess).not.toHaveBeenCalled(); + }); + + test("resetScanningSession from the capture callback accepts later frames", async () => { + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult + >({ + processResult: createDocumentCapturedProcessResult(), + }); + const { cameraHarness, manager } = createManager(scanningSession); + const onCaptureCompleted = vi.fn(async () => { + await manager.resetScanningSession(); + }); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + await onCaptureCompleted.mock.results[0]?.value; + + const processedFrames = scanningSession.process.mock.calls.length; + cameraHarness.emitPlaybackState("capturing"); + await cameraHarness.emitFrame(createFakeImageData()); + + expect(scanningSession.process).toHaveBeenCalledTimes(processedFrames + 1); + }); + + test("resolver methods forward stored consent after external consent is applied", async () => { + const consent: Consent = { + durationDays: 14, + userId: "external-user", + givenOn: "2026-02-01T00:00:00.000Z", + }; + const scanningSession = createFakeScanningSession< + BlinkIdVerifyProcessResult & { arrayBuffer: ArrayBuffer }, + BlinkIdVerifySessionSettings, + BlinkIdVerifySessionResult, + unknown, + VerifySessionExtra + >({ + processResult: createDocumentCapturedProcessResult(), + result: { + serializedPayload: serializedResult.serializedPayload, + typedPayload: { + configuration: {}, + consent, + }, + }, + extra: { + prepareVerifyRequest: vi.fn().mockResolvedValue({ + url: "https://verify.example.com/verify", + method: "POST", + headers: {}, + body: new Uint8Array(), + }), + submitResult: vi.fn().mockResolvedValue(apiResult), + }, + }); + const { cameraHarness, manager } = createManager(scanningSession, { + consentUxConfig: { + consentMode: "ProvideExternalConsent", + consent, + }, + }); + const onCaptureCompleted = vi.fn(); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + await captureDocument(cameraHarness); + + await vi.waitFor(() => { + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + + const resolver = onCaptureCompleted.mock.calls[0]?.[0] as CaptureResultResolver; + await resolver.getCaptureResult(); + await resolver.verifyCaptureResult(); + + expect(scanningSession.getResult).toHaveBeenCalledWith(consent, "include-typed-payload"); + expect(scanningSession.submitResult).toHaveBeenCalledWith(consent); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.consent.test.ts b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.consent.test.ts new file mode 100644 index 00000000..8ef409b0 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.consent.test.ts @@ -0,0 +1,349 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { + BlinkIdVerifySessionSettings, + Consent, + DeviceInfo, + ProcessResultWithBuffer, + RemoteScanningSession, +} from "@microblink/blinkid-verify-core"; +import type { CameraManager } from "@microblink/camera-manager/core"; +import type { CameraManagerComponent } from "@microblink/camera-manager/ui"; +import { + createFakeCameraHarness, + createFakeImageData, + createFakeScanningSession, + enableRafAwareFakeTimers, + setupDestroyableTeardown, +} from "@microblink/test-utils"; +import { advanceAndFlushUi } from "@microblink/test-utils/vitest/timers"; +import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + +import { blinkIdVerifyUiStateMap } from "./blinkid-verify-ui-state"; +import { BlinkIdVerifyConsentGate } from "./BlinkIdVerifyConsentGate"; +import { BlinkIdVerifyUxManager } from "./BlinkIdVerifyUxManager"; +import type { CaptureResultResolver } from "./capture-result-resolver"; + +const mockSleep = vi.hoisted(() => vi.fn().mockResolvedValue(undefined)); + +vi.mock("@microblink/ux-common/utils", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + sleep: mockSleep, + }; +}); + +const mockShowConsentUi = vi.hoisted(() => + vi.fn( + (): Promise => + Promise.resolve({ + durationDays: 365, + userId: "stub-user-id", + givenOn: "2026-01-01T00:00:00.000Z", + }), + ), +); + +vi.mock("../ui/showConsentUi", () => ({ + showConsentUi: mockShowConsentUi, +})); + +vi.mock("@microblink/ux-common/deviceOrientationAnalytics", () => ({ + subscribeToDeviceOrientation: vi.fn(() => () => undefined), +})); + +const trackManager = setupDestroyableTeardown(); + +const sessionSettings = { + inputImageSource: "video", +} as BlinkIdVerifySessionSettings; + +const deviceInfo = { userAgent: "test" } as DeviceInfo; + +const requireConsentConfig = { + consentMode: "RequireConsent" as const, + consent: { + userId: "ui-user", + durationDays: 180, + }, +}; + +const createManager = ( + scanningSession: ReturnType, + options: ConstructorParameters[2] = { + consentUxConfig: requireConsentConfig, + }, +) => { + const cameraHarness = createFakeCameraHarness(); + return { + cameraHarness, + manager: trackManager( + new BlinkIdVerifyUxManager( + cameraHarness.cameraManager as unknown as CameraManager, + scanningSession as unknown as RemoteScanningSession, + options, + sessionSettings, + false, + false, + deviceInfo, + ), + ), + }; +}; + +const createCameraUi = () => { + const dismount = vi.fn(); + const cameraUi = { + overlayLayerNode: document.createElement("div"), + owner: null, + dismount, + } as unknown as CameraManagerComponent; + + return { cameraUi, dismount }; +}; + +const createDocumentCapturedProcessResult = (): ProcessResultWithBuffer => + ({ + arrayBuffer: new ArrayBuffer(8), + inputImageAnalysisResult: { + blurDetected: false, + glareDetected: false, + occlusionDetected: false, + tiltDetected: false, + screenPresenceDetected: false, + scanningSide: "first", + hasBarcodeReadingIssue: false, + extractionInputImageAnalysisResult: { + documentLocation: { + upperLeft: { x: 0, y: 0 }, + upperRight: { x: 0, y: 0 }, + lowerLeft: { x: 0, y: 0 }, + lowerRight: { x: 0, y: 0 }, + }, + processingStatus: "success", + detectionStatus: "sucess", + isPassport: false, + isPassportWithBarcode: false, + documentOrientation: "horizontal", + documentRotation: "zero", + }, + }, + resultCompleteness: { + scanningStatus: "document-scanned", + }, + }) as ProcessResultWithBuffer; + +const createCapturedScanningSession = () => + createFakeScanningSession({ + processResult: createDocumentCapturedProcessResult(), + result: { + serializedPayload: { + configuration: "{}", + sdkMetadata: "{}", + }, + typedPayload: { + configuration: {}, + }, + }, + }); + +/** Completes capture, then reads the session result through the capture resolver. */ +const requestSessionResult = async ( + cameraHarness: ReturnType, + manager: BlinkIdVerifyUxManager, +) => { + manager.setTimeoutDuration(null); + const onCaptureCompleted = vi.fn(); + manager.addOnCaptureCompletedCallback(onCaptureCompleted); + + cameraHarness.emitPlaybackState("capturing"); + await cameraHarness.emitFrame(createFakeImageData()); + await advanceAndFlushUi(blinkIdVerifyUiStateMap.INTRO_FRONT_PAGE.minDuration + 100); + + await vi.waitFor(() => { + expect(onCaptureCompleted).toHaveBeenCalledTimes(1); + }); + + const resolver = onCaptureCompleted.mock.calls[0]?.[0] as CaptureResultResolver; + await resolver.getCaptureResult(); +}; + +describe("BlinkIdVerifyUxManager consent gate", () => { + beforeEach(() => { + vi.clearAllMocks(); + enableRafAwareFakeTimers(); + }); + + afterEach(() => { + vi.useRealTimers(); + document.body.replaceChildren(); + }); + + test("generates the payload without consent when consent UI is disabled", async () => { + const scanningSession = createCapturedScanningSession(); + const { cameraHarness, manager } = createManager(scanningSession, { + consentUxConfig: { consentMode: "NoConsentUI" }, + }); + + await requestSessionResult(cameraHarness, manager); + + expect(mockShowConsentUi).not.toHaveBeenCalled(); + expect(scanningSession.getResult).toHaveBeenCalledWith(undefined, "include-typed-payload"); + }); + + test("applies external consent without showing the modal", async () => { + const consent: Consent = { + durationDays: 30, + userId: "pre-supplied-user", + givenOn: "2026-02-01T00:00:00.000Z", + }; + const scanningSession = createCapturedScanningSession(); + const { cameraHarness, manager } = createManager(scanningSession, { + consentUxConfig: { + consentMode: "ProvideExternalConsent", + consent, + }, + }); + + await requestSessionResult(cameraHarness, manager); + + expect(mockShowConsentUi).not.toHaveBeenCalled(); + expect(scanningSession.getResult).toHaveBeenCalledWith(consent, "include-typed-payload"); + }); + + test("passes the consent generated by the modal into the result payload", async () => { + const generatedConsent: Consent = { + durationDays: 180, + userId: "ui-user", + givenOn: "2026-01-01T00:00:00.000Z", + }; + mockShowConsentUi.mockResolvedValueOnce(generatedConsent); + + const scanningSession = createCapturedScanningSession(); + const { cameraHarness, manager } = createManager(scanningSession, { + consentUxConfig: { + consentMode: "RequireConsent", + consent: { + userId: "ui-user", + durationDays: 180, + customerContext: { customerId: "customer-1" }, + }, + }, + }); + const gate = new BlinkIdVerifyConsentGate(manager, { + userId: "ui-user", + durationDays: 180, + customerContext: { customerId: "customer-1" }, + }); + const { cameraUi } = createCameraUi(); + + await expect(gate.consentUiResponse(cameraUi)).resolves.toBe(manager); + await requestSessionResult(cameraHarness, manager); + + expect(mockShowConsentUi).toHaveBeenCalledWith( + cameraUi, + { + userId: "ui-user", + durationDays: 180, + customerContext: { customerId: "customer-1" }, + }, + undefined, + ); + expect(scanningSession.getResult).toHaveBeenCalledWith(generatedConsent, "include-typed-payload"); + }); + + test("forwards localization overrides into the consent dialog", async () => { + const localizationStrings = { + consent_modal: { + title: "Custom consent title", + }, + }; + const scanningSession = createCapturedScanningSession(); + const { manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi } = createCameraUi(); + + await gate.consentUiResponse(cameraUi, localizationStrings); + + expect(mockShowConsentUi).toHaveBeenCalledWith(cameraUi, requireConsentConfig.consent, localizationStrings); + }); + + test("does not show the modal again after consent is accepted", async () => { + const scanningSession = createFakeScanningSession(); + const { manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi } = createCameraUi(); + + await expect(gate.consentUiResponse(cameraUi)).resolves.toBe(manager); + await expect(gate.consentUiResponse(cameraUi)).resolves.toBe(manager); + + expect(mockShowConsentUi).toHaveBeenCalledTimes(1); + }); + + test("dismounts and destroys the manager when consent is declined", async () => { + mockShowConsentUi.mockRejectedValueOnce(undefined); + + const scanningSession = createFakeScanningSession(); + const { manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi, dismount } = createCameraUi(); + const onResult = vi.fn(); + const onError = vi.fn(); + const destroySpy = vi.spyOn(manager, "destroy"); + + manager.addOnCaptureCompletedCallback(onResult); + manager.addOnErrorCallback(onError); + + await expect(gate.consentUiResponse(cameraUi)).resolves.toBeUndefined(); + + expect(scanningSession.getResult).not.toHaveBeenCalled(); + expect(onResult).not.toHaveBeenCalled(); + expect(onError).not.toHaveBeenCalled(); + expect(dismount).toHaveBeenCalledTimes(1); + expect(destroySpy).toHaveBeenCalledTimes(1); + }); + + test("ignores frames until RequireConsent is accepted", async () => { + const scanningSession = createFakeScanningSession(); + const { cameraHarness, manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi } = createCameraUi(); + + await cameraHarness.emitFrame(createFakeImageData()); + expect(scanningSession.process).not.toHaveBeenCalled(); + + await gate.consentUiResponse(cameraUi); + await cameraHarness.emitFrame(createFakeImageData()); + + expect(scanningSession.process).toHaveBeenCalledTimes(1); + }); + + test("destroy abandons the flow before acceptance", async () => { + const scanningSession = createFakeScanningSession(); + const { cameraHarness, manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi } = createCameraUi(); + + gate.destroy(); + + await expect(gate.consentUiResponse(cameraUi)).resolves.toBeUndefined(); + await cameraHarness.emitFrame(createFakeImageData()); + + expect(mockShowConsentUi).not.toHaveBeenCalled(); + expect(scanningSession.process).not.toHaveBeenCalled(); + }); + + test("destroy after acceptance leaves the manager to the caller", async () => { + const scanningSession = createFakeScanningSession(); + const { manager } = createManager(scanningSession); + const gate = new BlinkIdVerifyConsentGate(manager, requireConsentConfig.consent); + const { cameraUi } = createCameraUi(); + const destroySpy = vi.spyOn(manager, "destroy"); + + await gate.consentUiResponse(cameraUi); + gate.destroy(); + + expect(destroySpy).not.toHaveBeenCalled(); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.ts b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.ts index a9d90766..a29fa329 100644 --- a/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.ts +++ b/packages/blinkid-verify-ux-manager/src/core/BlinkIdVerifyUxManager.ts @@ -6,9 +6,10 @@ import { AnalyticService, DeviceInfo, DocumentRotation, + type VerifyApiError, type BlinkIdVerifyProcessResult, - type BlinkIdVerifyScanningResult, type BlinkIdVerifySessionSettings, + type Consent, type PingCameraInputInfoData, type ProcessResultWithBuffer, type RemoteScanningSession, @@ -39,13 +40,50 @@ import { getUiStateKey, } from "./blinkid-verify-ui-state"; import { BlinkIdVerifyProcessingError } from "./BlinkIdVerifyProcessingError"; -import { BlinkIdVerifyUxManagerOptions } from "./createBlinkIdVerifyUxManager"; +import type { + CaptureCompletedCallback, + CaptureResultResolver, + VerifyOnScanningCompletionCallbacks, +} from "./capture-result-resolver"; +import { createCaptureResultResolver } from "./capture-result-resolver"; +import type { BlinkIdVerifyUxManagerOptions } from "./createBlinkIdVerifyUxManager"; import { ChainedUiStateProps, getChainedUiStateKey } from "./getChainedUiStateKey"; import { DocumentPagination, getDocumentPaginationType, getDocumentRotation } from "./ui-state-utils"; import { mapErrorStateKeyToAnalyticsType, type PingableErrorUiStateKey } from "./uxAnalyticsMappers"; type ProcessingLifecycleState = "ready" | "busy" | "terminal"; +const requireConsentAcceptors = new WeakMap void>(); + +/** + * Records accepted `RequireConsent` and allows frame processing. + * + * Used by `BlinkIdVerifyConsentGate`. This is not part of the public manager API. + */ +export function acceptRequireConsent(manager: BlinkIdVerifyUxManager, consent: Consent): void { + const accept = requireConsentAcceptors.get(manager); + if (!accept) { + return; + } + + accept(consent); + requireConsentAcceptors.delete(manager); +} + +const invokeAsyncCallbacks = async ( + callbacks: Iterable<(...args: T) => void | Promise>, + name: string, + ...args: T +): Promise => { + for (const callback of callbacks) { + try { + await callback(...args); + } catch (error) { + console.error(`Error in ${name} callback`, error); + } + } +}; + /** * The BlinkIdVerifyUxManager class. This is the main class that manages the UX of the BlinkID Verify SDK. It is * responsible for handling the UI state, the timeout, the help tooltip, and the document class filter. @@ -94,6 +132,12 @@ export class BlinkIdVerifyUxManager { /** Protects worker message channel from concurrent/terminal process calls. */ #processingLifecycleState: ProcessingLifecycleState = "ready"; + /** + * Identifies the capture whose completion handler may still be running. + * + * Reset and destroy bump it so that handler cannot force the lifecycle back to terminal after scanning has moved on. + */ + #captureEpoch = 0; /** The scanning session timeout ID. */ #timeoutId?: number; /** Timeout duration in ms for the scanning session. If null, timeout won't be triggered ever. */ @@ -101,12 +145,18 @@ export class BlinkIdVerifyUxManager { /** The callbacks for when the UI state changes. */ #onUiStateChangedCallbacks = new Set<(uiState: BlinkIdVerifyUiState) => void>(); - /** The callbacks for when a scan result is available. */ - #onResultCallbacks = new Set<(result: BlinkIdVerifyScanningResult) => void>(); + /** The callbacks invoked with a lazy capture resolver after document capture. */ + #onCaptureCompletedCallbacks = new Set(); + /** Automatic Verify API submit registrations. */ + #verifyOnScanningCompletionRegistrations = new Set(); /** The callbacks for when a frame is processed. */ #onFrameProcessCallbacks = new Set<(frameResult: ProcessResultWithBuffer) => void>(); /** The callbacks for when an error occurs during processing. */ #onErrorCallbacks = new Set<(errorState: BlinkIdVerifyProcessingError) => void>(); + /** Consent handed to the session when the result payload is generated. */ + #consent?: Consent; + /** `RequireConsent` blocks frame processing until {@link acceptRequireConsent} runs. */ + #awaitingConsent = false; /** Clean up observers, store subscriptions and event listeners. */ #cleanupCallbacks = new Set<() => void>(); @@ -138,7 +188,7 @@ export class BlinkIdVerifyUxManager { constructor( cameraManager: CameraManager, scanningSession: RemoteScanningSession, - options: BlinkIdVerifyUxManagerOptions = {}, + options: BlinkIdVerifyUxManagerOptions, sessionSettings: BlinkIdVerifySessionSettings, showDemoOverlay: boolean, showProductionOverlay: boolean, @@ -151,6 +201,16 @@ export class BlinkIdVerifyUxManager { this.showProductionOverlay = showProductionOverlay; this.deviceInfo = deviceInfo; + if (options.consentUxConfig.consentMode === "ProvideExternalConsent") { + this.#consent = options.consentUxConfig.consent; + } else if (options.consentUxConfig.consentMode === "RequireConsent") { + this.#awaitingConsent = true; + requireConsentAcceptors.set(this, (consent) => { + this.#consent = consent; + this.#awaitingConsent = false; + }); + } + if (options.initialUiStateKey) { this.#initialUiStateKey = options.initialUiStateKey; } @@ -496,24 +556,67 @@ export class BlinkIdVerifyUxManager { } /** - * Registers a callback function to be called when a scan result is available. + * Registers a callback invoked after document capture with a lazy {@link CaptureResultResolver}. + * + * Runs after the capture success animation and does not wait for the Verify API. Hosts can tear down scanning UI + * here. Capture itself does not copy session results or submit to the Verify API; call resolver methods for the data + * you need. If {@link BlinkIdVerifyUxManager.verifyOnScanningCompletion} is also registered, keep the session alive + * until those success or error callbacks run. * * @example - * const cleanup = manager.addOnResultCallback((result) => { - * console.log("Scan result:", result); + * const cleanup = manager.addOnCaptureCompletedCallback(async (resolver) => { + * const result = await resolver.getCaptureResult(); + * console.log(result.typedPayload); * }); * - * // Later, to remove the callback: * cleanup(); * - * @param callback - A function that will be called with the scan result. - * @returns A cleanup function that, when called, will remove the registered - * callback. + * @param callback - Called with a resolver bound to this capture. + * @returns A cleanup function that removes the callback. */ - addOnResultCallback(callback: (result: BlinkIdVerifyScanningResult) => void) { - this.#onResultCallbacks.add(callback); + addOnCaptureCompletedCallback(callback: CaptureCompletedCallback) { + this.#onCaptureCompletedCallbacks.add(callback); return () => { - this.#onResultCallbacks.delete(callback); + this.#onCaptureCompletedCallbacks.delete(callback); + }; + } + + /** + * Submits the captured session to the Verify API when scanning completes, then invokes success or error callbacks. + * + * Submit starts after the capture success animation. {@link BlinkIdVerifyUxManager.addOnCaptureCompletedCallback} runs + * first and does not wait for the network; these success or error callbacks run when submit settles. Keep the session + * alive until then if both APIs are used. Network submit is available on every session. The SDK posts to the base URL + * configured at core init and sends no API key. + * + * API failures are delivered to `onError` with the same resolver. From `onError`, call + * {@link CaptureResultResolver.verifyCaptureResult} again to resubmit that capture while the scanning session is still + * alive. That later call is not delivered to `onSuccess`. + * + * @example + * const cleanup = manager.verifyOnScanningCompletion({ + * onSuccess: (apiResult) => { + * console.log(apiResult); + * }, + * onError: async (error, resolver) => { + * console.error(error); + * const retry = await resolver.verifyCaptureResult(); + * if (!retry.ok) { + * console.error(retry.error); + * } + * }, + * }); + * + * cleanup(); + * + * @param callbacks - `onSuccess` receives the API result and capture resolver. `onError` receives a + * {@link VerifyApiError} and the capture resolver. The client chooses whether to resubmit. + * @returns A cleanup function that removes both callbacks. + */ + verifyOnScanningCompletion(callbacks: VerifyOnScanningCompletionCallbacks) { + this.#verifyOnScanningCompletionRegistrations.add(callbacks); + return () => { + this.#verifyOnScanningCompletionRegistrations.delete(callbacks); }; } @@ -571,15 +674,6 @@ export class BlinkIdVerifyUxManager { invokeCallbacks(this.#onErrorCallbacks, errorState, "onError"); }; - /** - * Invokes the onResult callbacks. - * - * @param result - The result. - */ - #invokeOnResultCallbacks = (result: BlinkIdVerifyScanningResult) => { - invokeCallbacks(this.#onResultCallbacks, result, "onResult"); - }; - /** * Invokes the onFrameProcess callbacks. * @@ -676,7 +770,7 @@ export class BlinkIdVerifyUxManager { * @returns The processed frame's ArrayBuffer, or undefined if not applicable. */ #frameCaptureCallback = async (imageData: ImageData): Promise => { - if (this.#processingLifecycleState === "terminal") { + if (this.#awaitingConsent || this.#processingLifecycleState === "terminal") { return; } @@ -840,7 +934,7 @@ export class BlinkIdVerifyUxManager { /** * Handles side effects triggered by a UI state transition: restarts the scan timeout, resumes frame capture on intro - * states, and orchestrates result retrieval on DOCUMENT_CAPTURED. + * states, and delivers a capture resolver on DOCUMENT_CAPTURED. * * @param uiState - The UI state. */ @@ -863,27 +957,73 @@ export class BlinkIdVerifyUxManager { // handle DOCUMENT_CAPTURED if (uiState.key === "DOCUMENT_CAPTURED") { + const captureEpoch = this.#captureEpoch; console.debug("Handling DOCUMENT_CAPTURED state from #handleUiStateChange"); // Scanning is complete — cancel any running timeout before the animation sleep // to prevent it from firing and triggering a spurious reset during result retrieval. this.clearScanTimeout(); try { await sleep(uiState.minDuration); // allow checkbox success animation to play out - - const result = await this.getSessionResult(); - - this.#invokeOnResultCallbacks(result); + if (captureEpoch !== this.#captureEpoch) { + return; + } + await this.#deliverCaptureResult(); } catch (err) { + if (captureEpoch !== this.#captureEpoch) { + return; + } console.error("Failed to retrieve scan result after document capture:", err); this.#invokeOnErrorCallbacks("result_retrieval_failed"); void this.#analytics.sendPinglets(); } finally { - this.#processingLifecycleState = "terminal"; + // A reset from a capture or Verify API callback has already started a new scan. + if (captureEpoch === this.#captureEpoch) { + this.#processingLifecycleState = "terminal"; + } } } }; + #createCaptureResultResolver(): CaptureResultResolver { + return createCaptureResultResolver(this.scanningSession, () => this.#consent); + } + + #deliverCaptureResult = async () => { + const resolver = this.#createCaptureResultResolver(); + const registrations = + this.#verifyOnScanningCompletionRegistrations.size > 0 + ? [...this.#verifyOnScanningCompletionRegistrations] + : undefined; + const verifyPromise = registrations ? resolver.verifyCaptureResult() : undefined; + + if (this.#onCaptureCompletedCallbacks.size > 0) { + await invokeAsyncCallbacks([...this.#onCaptureCompletedCallbacks], "onCaptureCompleted", resolver); + } + + if (!verifyPromise || !registrations) { + return; + } + + const outcome = await verifyPromise; + if (outcome.ok) { + await invokeAsyncCallbacks( + registrations.map((registration) => registration.onSuccess), + "verifyOnScanningCompletionSuccess", + outcome.result, + resolver, + ); + return; + } + + await invokeAsyncCallbacks( + registrations.map((registration) => registration.onError), + "verifyOnScanningCompletionError", + outcome.error, + resolver, + ); + }; + /** Returns the initial UI state key used when resetting UX state. */ getInitialUiStateKey() { return this.#initialUiStateKey; @@ -902,8 +1042,13 @@ export class BlinkIdVerifyUxManager { } } + #invalidateCaptureCompletion() { + this.#captureEpoch += 1; + } + /** Resets the feedback stabilizer and invokes the onUiStateChanged callbacks. */ #resetUiState = (uiStateKey: BlinkIdVerifyUiStateKey = this.#initialUiStateKey) => { + this.#invalidateCaptureCompletion(); this.feedbackStabilizer.reset(uiStateKey); this.#uiState = this.feedbackStabilizer.currentState; this.#mappedUiStateKey = this.uiState.key; @@ -924,25 +1069,6 @@ export class BlinkIdVerifyUxManager { this.#timeoutId = undefined; } - /** - * Gets the result from the scanning session. - * - * @returns The result. - */ - async getSessionResult(): Promise { - try { - return await this.scanningSession.getResult(); - } catch (error) { - await this.#analytics.logErrorEvent({ - origin: "ux.getSessionResult", - error, - errorType: "NonFatal", - }); - await this.#analytics.sendPinglets(); - throw error; - } - } - /** * Resets the scanning session. * @@ -968,7 +1094,8 @@ export class BlinkIdVerifyUxManager { console.debug("🧹 Clearing all BlinkIdVerifyUxManager user callbacks"); this.#onUiStateChangedCallbacks.clear(); - this.#onResultCallbacks.clear(); + this.#onCaptureCompletedCallbacks.clear(); + this.#verifyOnScanningCompletionRegistrations.clear(); this.#onFrameProcessCallbacks.clear(); this.#onErrorCallbacks.clear(); } @@ -987,6 +1114,7 @@ export class BlinkIdVerifyUxManager { */ reset() { console.debug("🔁 Resetting BlinkIdVerifyUxManager"); + this.#invalidateCaptureCompletion(); this.clearScanTimeout(); this.#clearCameraInputAnalyticsSync(); this.#processingLifecycleState = "ready"; @@ -1004,7 +1132,10 @@ export class BlinkIdVerifyUxManager { */ destroy() { console.debug("💥 Destroying BlinkIdVerifyUxManager"); + this.#invalidateCaptureCompletion(); this.#processingLifecycleState = "terminal"; + this.#awaitingConsent = false; + requireConsentAcceptors.delete(this); this.clearScanTimeout(); this.cleanupAllObservers(); this.clearUserCallbacks(); diff --git a/packages/blinkid-verify-ux-manager/src/core/__testdata/verifyApiResult.ts b/packages/blinkid-verify-ux-manager/src/core/__testdata/verifyApiResult.ts new file mode 100644 index 00000000..1c3e7282 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/__testdata/verifyApiResult.ts @@ -0,0 +1,30 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { VerifyApiResult } from "@microblink/blinkid-verify-core"; + +/** Smallest response that satisfies the generated v3 schema; each call returns a distinct object for identity checks. */ +export const createVerifyApiResult = (overrides: Partial = {}): VerifyApiResult => ({ + pipeline: { + extraction: { status: "Completed" }, + verification: { status: "Completed" }, + }, + verification: { + verdict: "Accept", + failedChecks: [], + }, + imageAssessment: {}, + extraction: { + processingStatus: "Success", + result: {}, + }, + configurationUsed: {}, + runtime: { + startedOn: "2026-01-01T00:00:00.000Z", + finishedOn: "2026-01-01T00:00:01.000Z", + elapsedMs: 1000, + executionId: "execution-1", + blinkIdVersion: "test", + blinkIdVerifyVersion: "test", + }, + ...overrides, +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.test.ts b/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.test.ts new file mode 100644 index 00000000..f466019d --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.test.ts @@ -0,0 +1,128 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { DetectionStatus, ProcessingStatus, ScanningStatus } from "@microblink/blinkid-verify-core"; +import { merge } from "merge-anything"; +import { describe, expect, test } from "vitest"; + +import { getUiStateKey, type PartialProcessResult } from "./blinkid-verify-ui-state"; + +type DeepPartial = { + [K in keyof T]?: T[K] extends object ? DeepPartial : T[K]; +}; + +const defaultProcessResult = { + inputImageAnalysisResult: { + blurDetected: false, + glareDetected: false, + occlusionDetected: false, + tiltDetected: false, + screenPresenceDetected: false, + scanningSide: "first" as const, + hasBarcodeReadingIssue: false, + extractionInputImageAnalysisResult: { + documentLocation: { + upperLeft: { x: 0, y: 0 }, + upperRight: { x: 0, y: 0 }, + lowerLeft: { x: 0, y: 0 }, + lowerRight: { x: 0, y: 0 }, + }, + processingStatus: "success" as ProcessingStatus, + detectionStatus: "sucess" as DetectionStatus, + isPassport: false, + isPassportWithBarcode: false, + documentOrientation: "horizontal" as const, + documentRotation: "zero" as const, + }, + }, + resultCompleteness: { + scanningStatus: "scanning-first" as ScanningStatus, + }, +}; + +const createPartialProcessResult = (overrides: DeepPartial = {}): PartialProcessResult => + merge(defaultProcessResult, overrides) as PartialProcessResult; + +describe("getUiStateKey", () => { + test("returns SCREEN_DETECTED when a screen is present on a successfully detected document", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + screenPresenceDetected: true, + }, + }), + ); + + expect(result).toBe("SCREEN_DETECTED"); + }); + + test("does not return SCREEN_DETECTED while scanning a barcode", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + screenPresenceDetected: true, + }, + resultCompleteness: { + scanningStatus: "scanning-barcode", + }, + }), + ); + + expect(result).not.toBe("SCREEN_DETECTED"); + }); + + test("does not return SCREEN_DETECTED when document detection has failed", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + screenPresenceDetected: true, + extractionInputImageAnalysisResult: { + detectionStatus: "failed", + }, + }, + }), + ); + + expect(result).not.toBe("SCREEN_DETECTED"); + }); + + test("prioritizes SCREEN_DETECTED over GLARE_DETECTED when both flags are set", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + screenPresenceDetected: true, + glareDetected: true, + }, + }), + ); + + expect(result).toBe("SCREEN_DETECTED"); + }); + + test("prioritizes GLARE_DETECTED over BLUR_DETECTED when both flags are set", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + glareDetected: true, + blurDetected: true, + }, + }), + ); + + expect(result).toBe("GLARE_DETECTED"); + }); + + test("prioritizes framing over SCREEN_DETECTED", () => { + const result = getUiStateKey( + createPartialProcessResult({ + inputImageAnalysisResult: { + screenPresenceDetected: true, + extractionInputImageAnalysisResult: { + detectionStatus: "camera-too-far", + }, + }, + }), + ); + + expect(result).toBe("DOCUMENT_FRAMING_CAMERA_TOO_FAR"); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.ts b/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.ts index 9a835562..0e92ab95 100644 --- a/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.ts +++ b/packages/blinkid-verify-ux-manager/src/core/blinkid-verify-ui-state.ts @@ -119,6 +119,7 @@ export const blinkIdVerifyUiErrorStateKeys = [ "DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP", "DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE", // image quality + "SCREEN_DETECTED", "BLUR_DETECTED", "GLARE_DETECTED", "TOO_DARK", @@ -340,6 +341,11 @@ export const blinkIdVerifyUiStateMap: BlinkIdVerifyUiStateMap = { singleEmit: true, }, // image quality checks + SCREEN_DETECTED: { + key: "SCREEN_DETECTED", + reticleType: "error", + minDuration: ERROR_DURATION, + }, BLUR_DETECTED: { key: "BLUR_DETECTED", reticleType: "error", @@ -592,6 +598,21 @@ export function getUiStateKey(frameProcessResult: PartialProcessResult) { }, () => "DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE", ) + // screen presence (before glare: photographing a screen commonly also sets glareDetected) + .with( + { + inputImageAnalysisResult: { + screenPresenceDetected: true, + extractionInputImageAnalysisResult: { + detectionStatus: "sucess", + }, + }, + resultCompleteness: { + scanningStatus: P.when((status) => status !== "scanning-barcode"), + }, + }, + () => "SCREEN_DETECTED", + ) // glare .with( { diff --git a/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.test.ts b/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.test.ts new file mode 100644 index 00000000..4b669597 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.test.ts @@ -0,0 +1,136 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { + Consent, + RemoteScanningSession, + SerializedPayload, + TypedPayload, + VerifyApiResult, +} from "@microblink/blinkid-verify-core"; +import { VerifyApiError } from "@microblink/blinkid-verify-core"; +import { createFakeScanningSession } from "@microblink/test-utils"; +import { beforeEach, describe, expect, test, vi } from "vitest"; + +import { createVerifyApiResult } from "./__testdata/verifyApiResult"; +import { createCaptureResultResolver } from "./capture-result-resolver"; + +const consent: Consent = { + durationDays: 30, + userId: "resolver-user", + givenOn: "2026-01-01T00:00:00.000Z", +}; + +const configuration = { verification: { settings: { cropAffectsVerdict: true } } }; + +const typedPayload = { + configuration, + consent, + traceId: "trace-1", +} as TypedPayload; + +const serializedPayload: SerializedPayload = { + configuration: JSON.stringify(configuration), + consent: JSON.stringify(consent), + sdkMetadata: '{"sdk":"blinkid-verify"}', + traceId: "trace-1", + imageFirstSide: { jpegBytes: new Uint8Array([1, 2, 3]) }, + imageBarcode: { jpegBytes: new Uint8Array([4, 5]) }, +}; + +const apiResult = createVerifyApiResult(); + +const createSession = () => { + return createFakeScanningSession({ + result: { + serializedPayload, + typedPayload, + }, + extra: { + submitResult: vi.fn().mockResolvedValue(apiResult), + }, + }); +}; + +describe("createCaptureResultResolver", () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + test("getCaptureResult always requests typed payload data and returns the whole session result", async () => { + const scanningSession = createSession(); + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => consent); + + const result = await resolver.getCaptureResult(); + + expect(scanningSession.getResult).toHaveBeenCalledWith(consent, "include-typed-payload"); + expect(result).toEqual({ serializedPayload, typedPayload }); + }); + + test("getCaptureResult forwards an absent consent", async () => { + const scanningSession = createSession(); + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => undefined); + + await resolver.getCaptureResult(); + + expect(scanningSession.getResult).toHaveBeenCalledWith(undefined, "include-typed-payload"); + }); + + test("verifyCaptureResult forwards consent", async () => { + const scanningSession = createSession(); + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => consent); + + await expect(resolver.verifyCaptureResult()).resolves.toEqual({ ok: true, result: apiResult }); + + expect(scanningSession.submitResult).toHaveBeenCalledWith(consent); + }); + + test("verifyCaptureResult reuses the in-flight or completed promise", async () => { + const scanningSession = createSession(); + const firstResult = createVerifyApiResult(); + scanningSession.submitResult.mockResolvedValueOnce(firstResult); + + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => consent); + + await expect(resolver.verifyCaptureResult()).resolves.toEqual({ ok: true, result: firstResult }); + await expect(resolver.verifyCaptureResult()).resolves.toEqual({ ok: true, result: firstResult }); + + expect(scanningSession.submitResult).toHaveBeenCalledTimes(1); + }); + + test("verifyCaptureResult resolves a non-VerifyApiError as VerifyApiError", async () => { + const scanningSession = createSession(); + scanningSession.submitResult.mockRejectedValueOnce(new Error("network down")); + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => consent); + + await expect(resolver.verifyCaptureResult()).resolves.toMatchObject({ + ok: false, + error: { name: "VerifyApiError", message: "network down" }, + }); + }); + + test("verifyCaptureResult shares one in-flight failure, then the next call resubmits", async () => { + const scanningSession = createSession(); + const failure = new VerifyApiError("submit failed", { status: 503 }); + const retryResult = createVerifyApiResult(); + let rejectSubmit!: (error: VerifyApiError) => void; + scanningSession.submitResult.mockImplementationOnce( + () => + new Promise((_resolve, reject) => { + rejectSubmit = reject; + }), + ); + + const resolver = createCaptureResultResolver(scanningSession as unknown as RemoteScanningSession, () => consent); + const first = resolver.verifyCaptureResult(); + const second = resolver.verifyCaptureResult(); + rejectSubmit(failure); + + await expect(first).resolves.toEqual({ ok: false, error: failure }); + await expect(second).resolves.toBe(await first); + expect(scanningSession.submitResult).toHaveBeenCalledTimes(1); + + scanningSession.submitResult.mockResolvedValueOnce(retryResult); + await expect(resolver.verifyCaptureResult()).resolves.toEqual({ ok: true, result: retryResult }); + expect(scanningSession.submitResult).toHaveBeenCalledTimes(2); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.ts b/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.ts new file mode 100644 index 00000000..5dcd0777 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/capture-result-resolver.ts @@ -0,0 +1,87 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import { + toVerifyApiError, + type BlinkIdVerifySessionResult, + type Consent, + type RemoteScanningSession, + type VerifyApiError, + type VerifyApiResult, +} from "@microblink/blinkid-verify-core"; + +/** + * Settled Verify API submit. + * + * API failures resolve as `error` instead of rejecting the promise. + */ +export type VerifyCaptureResult = { ok: true; result: VerifyApiResult } | { ok: false; error: VerifyApiError }; + +/** Lazy accessors for a finished BlinkID Verify capture. None of these methods run until the client calls them. */ +export type CaptureResultResolver = { + /** Generates the session result with serialized parts, images, and typed payload data. */ + getCaptureResult(): Promise; + /** + * Generates the payload in Wasm and POSTs it from the worker. Resolves with the API result or a + * {@link VerifyApiError}. + */ + verifyCaptureResult(): Promise; +}; + +export type CaptureCompletedCallback = (resolver: CaptureResultResolver) => void | Promise; + +export type VerifyOnScanningCompletionSuccessCallback = ( + result: VerifyApiResult, + resolver: CaptureResultResolver, +) => void | Promise; + +export type VerifyOnScanningCompletionErrorCallback = ( + error: VerifyApiError, + resolver: CaptureResultResolver, +) => void | Promise; + +/** Success and error callbacks for `verifyOnScanningCompletion`. */ +export type VerifyOnScanningCompletionCallbacks = { + /** Called with the API result and capture resolver. */ + onSuccess: VerifyOnScanningCompletionSuccessCallback; + /** Called with a {@link VerifyApiError} and the capture resolver. The client chooses whether to resubmit. */ + onError: VerifyOnScanningCompletionErrorCallback; +}; + +export const createCaptureResultResolver = ( + scanningSession: RemoteScanningSession, + getConsent: () => Consent | undefined, +): CaptureResultResolver => { + let submitPromise: Promise | undefined; + + return { + getCaptureResult() { + return scanningSession.getResult(getConsent(), "include-typed-payload"); + }, + + verifyCaptureResult() { + if (submitPromise) { + return submitPromise; + } + + let submitted: Promise; + try { + submitted = Promise.resolve(scanningSession.submitResult(getConsent())); + } catch (error) { + return Promise.resolve({ ok: false, error: toVerifyApiError(error) }); + } + + const pending = submitted.then( + (result): VerifyCaptureResult => ({ ok: true, result }), + (error: unknown): VerifyCaptureResult => ({ ok: false, error: toVerifyApiError(error) }), + ); + submitPromise = pending; + // Drop a failed attempt so the client can resubmit. Retry policy stays with the caller. + void pending.then((outcome) => { + if (!outcome.ok && submitPromise === pending) { + submitPromise = undefined; + } + }); + return pending; + }, + }; +}; diff --git a/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.test.ts b/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.test.ts new file mode 100644 index 00000000..4e7d6a1d --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.test.ts @@ -0,0 +1,148 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import type { Consent, RemoteScanningSession } from "@microblink/blinkid-verify-core"; +import { getDeviceInfo } from "@microblink/blinkid-verify-core"; +import type { CameraManager } from "@microblink/camera-manager/core"; +import { createFakeScanningSession } from "@microblink/test-utils"; +import { beforeEach, describe, expect, test, vi } from "vitest"; + +import { BlinkIdVerifyConsentGate } from "./BlinkIdVerifyConsentGate"; +import { BlinkIdVerifyUxManager } from "./BlinkIdVerifyUxManager"; +import { createBlinkIdVerifyUxManager } from "./createBlinkIdVerifyUxManager"; + +vi.mock("./BlinkIdVerifyUxManager", () => ({ + BlinkIdVerifyUxManager: vi.fn(), + acceptRequireConsent: vi.fn(), +})); + +vi.mock("@microblink/blinkid-verify-core", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + getDeviceInfo: vi.fn(), + }; +}); + +describe("createBlinkIdVerifyUxManager", () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + test("forwards consent options into the BlinkIdVerifyUxManager constructor", async () => { + const consent: Consent = { + durationDays: 30, + userId: "user-1", + }; + const cameraManager = {} as CameraManager; + const sessionSettings = { inputImageSource: "video" }; + const scanningSession = createFakeScanningSession({ + settings: sessionSettings, + showDemoOverlay: true, + showProductionOverlay: false, + }); + + const deviceInfo = { userAgent: "ua" } as Awaited>; + vi.mocked(getDeviceInfo).mockResolvedValue(deviceInfo); + + const instance = {} as BlinkIdVerifyUxManager; + vi.mocked(BlinkIdVerifyUxManager).mockImplementation(function () { + return instance; + }); + + const options = { + consentUxConfig: { + consentMode: "ProvideExternalConsent" as const, + consent, + }, + }; + const result = await createBlinkIdVerifyUxManager( + cameraManager, + scanningSession as unknown as RemoteScanningSession, + options, + ); + + expect(result).toBe(instance); + expect(BlinkIdVerifyUxManager).toHaveBeenCalledWith( + cameraManager, + scanningSession, + options, + sessionSettings, + true, + false, + deviceInfo, + ); + }); + + test("defaults consent UX to NoConsentUI when consentUxConfig is omitted", async () => { + const cameraManager = {} as CameraManager; + const sessionSettings = { inputImageSource: "video" }; + const scanningSession = createFakeScanningSession({ + settings: sessionSettings, + showDemoOverlay: true, + showProductionOverlay: false, + }); + + const deviceInfo = { userAgent: "ua" } as Awaited>; + vi.mocked(getDeviceInfo).mockResolvedValue(deviceInfo); + + const instance = {} as BlinkIdVerifyUxManager; + vi.mocked(BlinkIdVerifyUxManager).mockImplementation(function () { + return instance; + }); + + await createBlinkIdVerifyUxManager(cameraManager, scanningSession as unknown as RemoteScanningSession); + + expect(BlinkIdVerifyUxManager).toHaveBeenCalledWith( + cameraManager, + scanningSession, + { consentUxConfig: { consentMode: "NoConsentUI" } }, + sessionSettings, + true, + false, + deviceInfo, + ); + }); + + test("returns a consent gate for RequireConsent and still constructs the manager", async () => { + const cameraManager = {} as CameraManager; + const sessionSettings = { inputImageSource: "video" }; + const scanningSession = createFakeScanningSession({ + settings: sessionSettings, + showDemoOverlay: false, + showProductionOverlay: false, + }); + const deviceInfo = { userAgent: "ua" } as Awaited>; + vi.mocked(getDeviceInfo).mockResolvedValue(deviceInfo); + + const instance = {} as BlinkIdVerifyUxManager; + vi.mocked(BlinkIdVerifyUxManager).mockImplementation(function () { + return instance; + }); + + const options = { + consentUxConfig: { + consentMode: "RequireConsent" as const, + consent: { + userId: "ui-user", + durationDays: 180, + }, + }, + }; + const result = await createBlinkIdVerifyUxManager( + cameraManager, + scanningSession as unknown as RemoteScanningSession, + options, + ); + + expect(result).toBeInstanceOf(BlinkIdVerifyConsentGate); + expect(BlinkIdVerifyUxManager).toHaveBeenCalledWith( + cameraManager, + scanningSession, + options, + sessionSettings, + false, + false, + deviceInfo, + ); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.ts b/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.ts index ccbdb6db..4637abd0 100644 --- a/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.ts +++ b/packages/blinkid-verify-ux-manager/src/core/createBlinkIdVerifyUxManager.ts @@ -1,29 +1,77 @@ /** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ -import { getDeviceInfo, type RemoteScanningSession } from "@microblink/blinkid-verify-core"; +import { getDeviceInfo, type Consent, type RemoteScanningSession } from "@microblink/blinkid-verify-core"; import { CameraManager } from "@microblink/camera-manager/core"; import { BlinkIdVerifyUiStateKey } from "./blinkid-verify-ui-state"; +import { BlinkIdVerifyConsentGate } from "./BlinkIdVerifyConsentGate"; import { BlinkIdVerifyUxManager } from "./BlinkIdVerifyUxManager"; +export type NoConsentUI = { consentMode: "NoConsentUI" }; +/** Consent values used to render the SDK consent UI. */ +export type ConsentUiInput = Pick; +export type RequireConsent = { + consentMode: "RequireConsent"; + /** Values used to render the consent UI and generate the accepted consent object. */ + consent: ConsentUiInput; +}; +export type ProvideExternalConsent = { consentMode: "ProvideExternalConsent"; consent: Consent }; +export type BlinkIdVerifyConsentUxConfiguration = NoConsentUI | RequireConsent | ProvideExternalConsent; + export type BlinkIdVerifyUxManagerOptions = { /** Initial UI state key used by the manager/stabilizer reset flow. Defaults to `INTRO_FRONT_PAGE`. */ initialUiStateKey?: BlinkIdVerifyUiStateKey; + + consentUxConfig: BlinkIdVerifyConsentUxConfiguration; +}; + +type ManagerOptionsWithoutRequireConsent = Partial> & { + consentUxConfig?: NoConsentUI | ProvideExternalConsent; +}; + +type ManagerOptionsWithRequireConsent = Partial> & { + consentUxConfig: RequireConsent; }; /** - * Creates a BlinkIdVerifyUxManager. + * Creates a BlinkID Verify UX manager, or a consent gate when scanning must wait for consent. * * @param cameraManager - The camera manager. * @param scanningSession - The scanning session. - * @returns The BlinkIdVerifyUxManager instance. + * @param options - UX manager options. `RequireConsent` returns a {@link BlinkIdVerifyConsentGate}. Call + * `consentUiResponse` before using the manager. Omitting `consentUxConfig`, `NoConsentUI`, and + * `ProvideExternalConsent` return a {@link BlinkIdVerifyUxManager} directly. `ProvideExternalConsent` stores its + * consent object before the frame callback is registered. + * @returns The UX manager, or a consent gate when `consentMode` is `RequireConsent`. */ -export const createBlinkIdVerifyUxManager = async ( +export async function createBlinkIdVerifyUxManager( + cameraManager: CameraManager, + scanningSession: RemoteScanningSession, + options: ManagerOptionsWithRequireConsent, +): Promise; + +export async function createBlinkIdVerifyUxManager( cameraManager: CameraManager, scanningSession: RemoteScanningSession, - options: BlinkIdVerifyUxManagerOptions = {}, -): Promise => { + options?: ManagerOptionsWithoutRequireConsent, +): Promise; + +export async function createBlinkIdVerifyUxManager( + cameraManager: CameraManager, + scanningSession: RemoteScanningSession, + options?: Partial, +): Promise; + +export async function createBlinkIdVerifyUxManager( + cameraManager: CameraManager, + scanningSession: RemoteScanningSession, + options: Partial = {}, +): Promise { try { + const resolvedOptions: BlinkIdVerifyUxManagerOptions = { + ...options, + consentUxConfig: options.consentUxConfig ?? { consentMode: "NoConsentUI" }, + }; const [sessionSettings, showDemoOverlay, showProductionOverlay, deviceInfo] = await Promise.all([ scanningSession.getSettings(), scanningSession.showDemoOverlay(), @@ -31,15 +79,21 @@ export const createBlinkIdVerifyUxManager = async ( getDeviceInfo(), ]); - return new BlinkIdVerifyUxManager( + const manager = new BlinkIdVerifyUxManager( cameraManager, scanningSession, - options, + resolvedOptions, sessionSettings, showDemoOverlay, showProductionOverlay, deviceInfo, ); + + if (resolvedOptions.consentUxConfig.consentMode === "RequireConsent") { + return new BlinkIdVerifyConsentGate(manager, resolvedOptions.consentUxConfig.consent); + } + + return manager; } catch (error) { try { await scanningSession.ping({ @@ -64,4 +118,4 @@ export const createBlinkIdVerifyUxManager = async ( throw error; } -}; +} diff --git a/packages/blinkid-verify-ux-manager/src/core/uxAnalyticsMappers.ts b/packages/blinkid-verify-ux-manager/src/core/uxAnalyticsMappers.ts index ae65471f..1fff69c1 100644 --- a/packages/blinkid-verify-ux-manager/src/core/uxAnalyticsMappers.ts +++ b/packages/blinkid-verify-ux-manager/src/core/uxAnalyticsMappers.ts @@ -16,6 +16,7 @@ export function mapErrorStateKeyToAnalyticsType( errorKey: PingableErrorUiStateKey, ): PingUxEventData["errorMessageType"] { return match(errorKey) + .with("SCREEN_DETECTED", () => "KeepVisible") .with("BLUR_DETECTED", () => "EliminateBlur") .with("GLARE_DETECTED", () => "EliminateGlare") .with("TOO_DARK", () => "IncreaseLighting") diff --git a/packages/blinkid-verify-ux-manager/src/ui/LocalizationContext.tsx b/packages/blinkid-verify-ux-manager/src/ui/LocalizationContext.tsx index fcefed39..6b5fcae3 100644 --- a/packages/blinkid-verify-ux-manager/src/ui/LocalizationContext.tsx +++ b/packages/blinkid-verify-ux-manager/src/ui/LocalizationContext.tsx @@ -5,40 +5,16 @@ import { ParentComponent, createContext, createEffect, useContext } from "solid- import { SetStoreFunction, createStore } from "solid-js/store"; import enLocaleStrings from "./locales/en"; +import type { LocalizationStrings, PartialLocalizationStrings } from "./localization-strings"; -/** The locale record type. */ -export type LocaleRecord = typeof enLocaleStrings; +export type { LocaleRecord, LocalizationStrings, PartialLocalizationStrings } from "./localization-strings"; -/** Recursively transforms a locale record to allow string overrides at any level. */ -export type LocalizedValue = - T extends Record - ? - | { - [K in keyof T]: LocalizedValue; - } - | (string & Record) - : T | (string & Record); - -/** - * Deep partial type that allows any string to be assigned to override values. This type is permissive to allow any - * partial override structure. - */ -// oxlint-disable typescript/ban-types -type DeepPartialLocalized = - T extends Record - ? { - -readonly [K in keyof T]?: T[K] extends Record ? DeepPartialLocalized | string : string; - } - : never; - -/** - * The localization strings type. This allows for autocomplete for defaults, but also overriding with strings at any - * level. https://twitter.com/mattpocockuk/status/1709281782325977101 - */ -export type LocalizationStrings = LocalizedValue; +/** Plain copy so a store proxy never attaches to the shared locale module. */ +function cloneLocale(value: T): T { + return JSON.parse(JSON.stringify(value)) as T; +} -/** Partial version of LocalizationStrings that allows any string to be assigned. */ -export type PartialLocalizationStrings = DeepPartialLocalized; +const defaultLocaleStrings = cloneLocale(enLocaleStrings); /** The localization context. */ const LocalizationContext = createContext<{ @@ -51,7 +27,7 @@ export const LocalizationProvider: ParentComponent<{ userStrings?: PartialLocalizationStrings; }> = (props) => { const mergedStrings = (): LocalizationStrings => - merge(enLocaleStrings, props.userStrings ?? {}) as LocalizationStrings; + cloneLocale(merge(defaultLocaleStrings, props.userStrings ?? {})) as LocalizationStrings; const [localizationStore, updateLocalizationStore] = createStore(mergedStrings()); diff --git a/packages/blinkid-verify-ux-manager/src/ui/createBlinkIdVerifyFeedbackUi.tsx b/packages/blinkid-verify-ux-manager/src/ui/createBlinkIdVerifyFeedbackUi.tsx index 10f458ee..2abb2a30 100644 --- a/packages/blinkid-verify-ux-manager/src/ui/createBlinkIdVerifyFeedbackUi.tsx +++ b/packages/blinkid-verify-ux-manager/src/ui/createBlinkIdVerifyFeedbackUi.tsx @@ -19,6 +19,7 @@ export type FeedbackUiOptions = { * @defaultValue true */ showOnboardingGuide?: boolean; + /** * If set to `true`, the help button will be shown. * @@ -63,7 +64,7 @@ const defaultFeedbackUiOptions: DefaultFeedbackUiOptions = { localizationStrings: {}, showOnboardingGuide: true, showHelpButton: true, - helpTooltipShowDelay: 5000, + helpTooltipShowDelay: 10_000, helpTooltipHideDelay: 5000, showDocumentFilteredModal: true, showTimeoutModal: true, diff --git a/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.test.tsx b/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.test.tsx new file mode 100644 index 00000000..42f8ffba --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.test.tsx @@ -0,0 +1,272 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import { render } from "solid-js/web"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import { commands } from "vitest/browser"; + +import "virtual:uno.css"; + +import { LocalizationProvider, type PartialLocalizationStrings } from "../LocalizationContext"; +import { ConsentModal } from "./ConsentModal"; + +declare module "vitest/browser" { + interface BrowserCommands { + ariaSnapshot(selector: string): Promise; + } +} + +const consentModalHostId = "consent-modal-host"; +const optionalConsentName = + "I consent to the use of my personal data by the provider for the purpose of optimizing its technology. (Optional)"; + +const themeVariables: Record = { + "--color-gray-50-rgb-value": "249 250 251", + "--color-gray-400-rgb-value": "156 163 175", + "--color-gray-500-rgb-value": "107 114 128", + "--color-gray-700-rgb-value": "55 65 81", + "--color-primary": "0 98 242", +}; + +function ariaName(value: string): string { + return JSON.stringify(value); +} + +function expectedConsentSnapshot({ optionalChecked = false }: { optionalChecked?: boolean } = {}): string { + const checkboxState = optionalChecked ? " [checked]" : ""; + + return [ + `- alertdialog ${ariaName("Consent")}:`, + ` - button ${ariaName("Close")}`, + " - region:", + " - article:", + ` - heading ${ariaName("We need your consent to:")} [level=2]`, + " - paragraph: Store and/or access personal information for the purpose of verifying your identity.", + " - paragraph:", + " - text: Your choices help us protect your personal information and improve our technology while maintaining the highest standards of data privacy as described in the", + ` - link ${ariaName("Privacy Notice (opens in a new tab)")}:`, + " - /url: https://microblink.com/legal/privacy-notice-for-microblink-blinkid-verify/", + " - text: .", + ` - checkbox ${ariaName(optionalConsentName)}${checkboxState}`, + ` - text: ${optionalConsentName}`, + ` - button ${ariaName("Consent")}`, + ` - button ${ariaName("Do not consent")}`, + ].join("\n"); +} + +describe("ConsentModal", () => { + let overlay: HTMLDivElement | undefined; + let cleanup: (() => void) | undefined; + + afterEach(() => { + cleanup?.(); + cleanup = undefined; + overlay?.remove(); + overlay = undefined; + document.body.replaceChildren(); + }); + + const mountModal = (localization?: PartialLocalizationStrings) => { + overlay = document.createElement("div"); + overlay.id = consentModalHostId; + document.body.append(overlay); + + for (const [name, value] of Object.entries(themeVariables)) { + document.documentElement.style.setProperty(name, value); + } + + cleanup = render( + () => ( + + { + void 0; + }} + onDecline={() => { + void 0; + }} + /> + + ), + overlay, + ); + + return overlay; + }; + + test("uses dialog wrappers, left-aligned purpose text, a notice background, and a switch", async () => { + const root = mountModal(); + + const purpose = await vi.waitFor(() => { + const statement = [...root.querySelectorAll("p")].find((candidate) => + candidate.textContent?.includes("Store and/or access personal information"), + ); + expect(statement).toBeDefined(); + return statement!; + }); + + const notice = [...root.querySelectorAll("p")].find((candidate) => + candidate.textContent?.includes("Your choices help us protect your personal information"), + ); + const privacyNoticeLink = notice?.querySelector("a"); + const title = [...root.querySelectorAll("[data-part='title']")].find((candidate) => + candidate.textContent?.includes("We need your consent to:"), + ); + const description = [...root.querySelectorAll("[data-part='description']")].find((candidate) => + candidate.textContent?.includes("Store and/or access personal information"), + ); + const actionButtons = [...root.querySelectorAll("button")].filter((candidate) => { + const label = candidate.textContent ?? ""; + return label.includes("Consent") || label.includes("Do not consent"); + }); + const toggle = root.querySelector("[data-scope='switch'][data-part='root']"); + const optionalLabel = root.querySelector("[data-scope='switch'][data-part='label']"); + const optionalMarker = [...(optionalLabel?.querySelectorAll("span") ?? [])].find((candidate) => + candidate.textContent?.includes("(Optional)"), + ); + + expect(title).toBeDefined(); + expect(title?.className.split(/\s+/)).toContain("dialog-title"); + expect(title?.className.split(/\s+/)).toContain("!text-2xl"); + expect(["center", "middle"]).toContain(getComputedStyle(title!).textAlign); + expect(description).toBeDefined(); + expect(["left", "start"]).toContain(getComputedStyle(purpose).textAlign); + expect(purpose.className.split(/\s+/)).toContain("text-sm"); + expect(purpose.className.split(/\s+/)).toContain("font-bold"); + expect(notice).toBeDefined(); + expect(notice?.className.split(/\s+/)).toContain("bg-gray-50"); + expect(notice?.className.split(/\s+/)).toContain("text-sm"); + expect(privacyNoticeLink).toBeDefined(); + expect(privacyNoticeLink?.textContent).toContain("Privacy Notice"); + expect(privacyNoticeLink?.querySelector(".sr-only")?.textContent?.trim()).toBe("(opens in a new tab)"); + expect(privacyNoticeLink?.getAttribute("href")).toBe( + "https://microblink.com/legal/privacy-notice-for-microblink-blinkid-verify/", + ); + expect(privacyNoticeLink?.getAttribute("target")).toBe("_blank"); + expect(privacyNoticeLink?.getAttribute("rel")).toBe("noopener noreferrer"); + expect(actionButtons).toHaveLength(2); + for (const button of actionButtons) { + expect(button.className.split(/\s+/)).toContain("btn-secondary"); + expect(button.className.split(/\s+/)).not.toContain("btn-primary"); + expect(button.className.split(/\s+/)).toContain("font-bold"); + expect(button.className.split(/\s+/)).toContain("!text-base"); + expect(["center", "middle"]).toContain(getComputedStyle(button).textAlign); + } + expect(toggle).not.toBeNull(); + expect(toggle?.className.split(/\s+/)).toContain("items-center"); + expect(optionalLabel?.className.split(/\s+/)).toContain("text-xs"); + expect(optionalMarker).toBeDefined(); + expect(optionalMarker?.className.split(/\s+/)).toContain("italic"); + expect(getComputedStyle(optionalMarker!).fontStyle).toBe("italic"); + expect(toggle?.getAttribute("data-state")).toBe("unchecked"); + expect(toggle?.textContent).toContain("I consent to the use of my personal data"); + expect(root.querySelector('[role="switch"]') ?? root.querySelector('input[type="checkbox"]')).not.toBeNull(); + expect(await commands.ariaSnapshot(`#${consentModalHostId}`)).toBe(expectedConsentSnapshot()); + + toggle!.click(); + + await vi.waitFor(() => { + expect(toggle?.getAttribute("data-state")).toBe("checked"); + }); + expect(await commands.ariaSnapshot(`#${consentModalHostId}`)).toBe( + expectedConsentSnapshot({ optionalChecked: true }), + ); + }); + + test("names the dialog, wires close and Escape to decline, and keeps initial focus off Close", async () => { + overlay = document.createElement("div"); + overlay.id = consentModalHostId; + document.body.append(overlay); + + for (const [name, value] of Object.entries(themeVariables)) { + document.documentElement.style.setProperty(name, value); + } + + const onConsent = vi.fn(); + const onDecline = vi.fn(); + + cleanup = render( + () => ( + + + + ), + overlay, + ); + + const dialog = await vi.waitFor(() => { + const node = overlay!.querySelector('[role="alertdialog"]'); + expect(node).not.toBeNull(); + return node!; + }); + + const closeButton = [...overlay!.querySelectorAll("button")].find( + (candidate) => candidate.getAttribute("aria-label") === "Close", + ); + const consentButton = [...overlay!.querySelectorAll("button")].find( + (candidate) => candidate.textContent === "Consent", + ); + const privacyNoticeLink = overlay!.querySelector("a"); + const region = overlay!.querySelector('[role="region"]'); + + expect(dialog.getAttribute("aria-label")).toBe("Consent"); + expect(closeButton).toBeDefined(); + expect(consentButton).toBeDefined(); + expect(region).not.toBeNull(); + expect(privacyNoticeLink?.querySelector(".sr-only")?.textContent?.trim()).toBe("(opens in a new tab)"); + + await vi.waitFor(() => { + expect(document.activeElement).toBe(consentButton); + }); + + closeButton!.click(); + expect(onDecline).toHaveBeenCalledTimes(1); + expect(onConsent).not.toHaveBeenCalled(); + + dialog.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true })); + await vi.waitFor(() => { + expect(onDecline).toHaveBeenCalledTimes(2); + }); + }); + + // Safari keeps buttons, links, and checkboxes out of sequential focus navigation unless the tab index is explicit, + // which otherwise leaves Consent and Do not consent unreachable by keyboard. + test("gives every control an explicit tab index so Safari keeps them in the tab order", async () => { + const root = mountModal(); + + const controls = await vi.waitFor(() => { + const candidates = [...root.querySelectorAll("button, a[href], input")]; + expect(candidates.length).toBe(5); + return candidates; + }); + + for (const control of controls) { + expect(control.getAttribute("tabindex")).toBe("0"); + } + }); + + test("renders overridden consent copy", async () => { + const root = mountModal({ + consent_modal: { + title: "Custom consent title", + consent_btn: "Agree", + decline_btn: "Decline", + }, + }); + + await vi.waitFor(() => { + expect(root.textContent).toContain("Custom consent title"); + }); + expect(root.textContent).toContain("Agree"); + expect(root.textContent).toContain("Decline"); + expect(root.textContent).toContain("Store and/or access personal information"); + }); +}); diff --git a/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.tsx b/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.tsx new file mode 100644 index 00000000..7bd3c200 --- /dev/null +++ b/packages/blinkid-verify-ux-manager/src/ui/dialogs/ConsentModal.tsx @@ -0,0 +1,152 @@ +/** Copyright (c) 2026 Microblink Ltd. All rights reserved. */ + +import { Dialog, Switch } from "@ark-ui/solid"; +import type { Consent, ConsentCustomerContext } from "@microblink/blinkid-verify-core"; +import { Modal } from "@microblink/shared-components/Modal"; +import { type Component, createMemo, createSignal } from "solid-js"; + +import { useLocalization } from "../LocalizationContext"; + +import "virtual:uno.css"; + +const privacyNoticeUrl = "https://microblink.com/legal/privacy-notice-for-microblink-blinkid-verify/"; +const privacyLinkPlaceholder = "{{consent_modal::privacy_link}}"; + +/** Props for the ConsentModal component. */ +export type ConsentModalProps = { + /** The HTML element where the modal will be mounted. */ + mountTarget: HTMLElement; + /** End-user id recorded on the generated consent object. */ + userId: string; + /** Consent retention period in days. */ + durationDays: number; + /** Integrator-specific identifiers attached to the generated consent object. */ + customerContext?: ConsentCustomerContext; + /** Called with the generated consent object when the user accepts. */ + onConsent: (consent: Consent) => void; + /** Called when the user declines consent. */ + onDecline: () => void; +}; + +/** + * The ConsentModal component. + * + * @param props - The props for the ConsentModal component. + * @returns The ConsentModal component. + */ +export const ConsentModal: Component = (props) => { + const { t } = useLocalization(); + const privacyNoticeParts = createMemo(() => { + const [before = "", after = ""] = t.consent_modal.privacy_notice.split(privacyLinkPlaceholder); + return { before, after }; + }); + const [consentButtonRef, setConsentButtonRef] = createSignal(null); + const [optionalConsentGranted, setOptionalConsentGranted] = createSignal(false); + + const createConsentFromUi = ( + consentFields: Pick, + ): Consent => { + return { + durationDays: consentFields.durationDays, + userId: consentFields.userId, + note: `${t.consent_modal.details}\n${t.consent_modal.consent_switch}`, + givenOn: new Date().toISOString(), + ...(consentFields.customerContext !== undefined ? { customerContext: consentFields.customerContext } : {}), + }; + }; + + return ( + props.onDecline()} + onCloseClicked={() => props.onDecline()} + initialFocusEl={() => consentButtonRef()} + actions={{ + primary: { + label: t.consent_modal.consent_btn, + variant: "secondary", + class: "font-bold !text-base tracking-normal text-center align-middle h-[52px]", + onClick: () => props.onConsent(createConsentFromUi(props)), + ref: setConsentButtonRef, + }, + secondary: { + label: t.consent_modal.decline_btn, + class: "font-bold !text-base tracking-normal text-center align-middle h-[52px] mt-[10px]", + onClick: props.onDecline, + }, + }} + actionsLayout="stacked" + showCloseButton={true} + scrollable={false} + > +