@sekyro/web 0.1.0-rc.21 → 0.1.0-rc.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +12 -11
- package/dist/background-monitor-GCMNCJMG.js +1 -0
- package/dist/camera-trait-HVV5ZEDI.js +1 -0
- package/dist/{capture-constraints-B5omafmk.d.cts → capture-constraints-CVqpMNGA.d.cts} +7 -3
- package/dist/{capture-constraints-B5omafmk.d.ts → capture-constraints-CVqpMNGA.d.ts} +7 -3
- package/dist/capture-session-doc-VSUEDAEN.js +1 -0
- package/dist/{capture-session-v3-26FgzBIl.d.cts → capture-session-v3-C-Q-21Fm.d.ts} +90 -13
- package/dist/{capture-session-v3-ZO0QOeQH.d.ts → capture-session-v3-DD-MXSU4.d.cts} +90 -13
- package/dist/chunk-6RJTKX5I.js +1 -0
- package/dist/chunk-7KXJEF7P.js +1 -0
- package/dist/chunk-7TGVXBW6.js +1 -0
- package/dist/chunk-ACP2ZOVW.js +1 -0
- package/dist/{chunk-MXWLCDFX.js → chunk-AXJ2VWIK.js} +1 -1
- package/dist/chunk-CDDYFUER.js +1 -0
- package/dist/chunk-CPK5FYNJ.js +1 -0
- package/dist/{chunk-G6LKLN4U.js → chunk-EKEHAFEK.js} +1 -1
- package/dist/{chunk-QYYJLXKA.js → chunk-FSJPKOCC.js} +1 -1
- package/dist/chunk-H6REKPZ4.js +1 -0
- package/dist/{chunk-A3FUGHAH.js → chunk-HFCVN6AG.js} +1 -1
- package/dist/chunk-J5IQ6THP.js +1 -0
- package/dist/chunk-NHXLIDQJ.js +1 -0
- package/dist/chunk-PVSYKKMP.js +1 -0
- package/dist/chunk-RJZ5SARR.js +1 -0
- package/dist/chunk-TTD5LQG2.js +1 -0
- package/dist/{chunk-RI3E7GBN.js → chunk-TYJA2XJR.js} +1 -1
- package/dist/chunk-UBRNDTTD.js +1 -0
- package/dist/chunk-V4VFZ7NQ.js +1 -0
- package/dist/chunk-XB4KLBHY.js +1 -0
- package/dist/chunk-XK4CCTLL.js +1 -0
- package/dist/{chunk-33KKMPJ5.js → chunk-XLYHT4ZQ.js} +1 -1
- package/dist/chunk-ZGDUIZC2.js +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/clip-inspect-HZ7N2YOP.js +1 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +1 -1
- package/dist/core/ocr/worker.js +1 -1
- package/dist/core/v3/detect-worker.cjs +1 -1
- package/dist/core/v3/detect-worker.d.cts +1 -1
- package/dist/core/v3/detect-worker.d.ts +1 -1
- package/dist/core/v3/detect-worker.js +1 -1
- package/dist/create-document-capture-D7GUVFWF.js +1 -0
- package/dist/create-portrait-capture-VRZZOMJS.js +1 -0
- package/dist/{create-verification-KlHIU4Fy.d.ts → create-verification-BsZ038gI.d.cts} +175 -80
- package/dist/{create-verification-CXhXxknV.d.cts → create-verification-CfSZiPSN.d.ts} +175 -80
- package/dist/{detect-worker-DclNxkZT.d.ts → detect-worker-CHqsPJoM.d.cts} +19 -2
- package/dist/{detect-worker-DclNxkZT.d.cts → detect-worker-CHqsPJoM.d.ts} +19 -2
- package/dist/{detector-scanic-YCDNLCGV.js → detector-scanic-F3Y5X3DF.js} +1 -1
- package/dist/{icao-gate-DI8VePWd.d.ts → icao-gate-BrnPW_gd.d.ts} +1 -1
- package/dist/{icao-gate-DvzOzHq6.d.cts → icao-gate-Bw0Fxd30.d.cts} +1 -1
- package/dist/icao-gate-SO6YJ7RV.js +1 -0
- package/dist/{icao-policy-DztbA50-.d.ts → icao-policy-C14ZKZ7r.d.ts} +2 -2
- package/dist/{icao-policy-MRB8NMAu.d.cts → icao-policy-DcaumEDt.d.cts} +2 -2
- package/dist/icao-tuning-DCZCMCEQ.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +11 -15
- package/dist/index.d.ts +11 -15
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +1 -1
- package/dist/internal/index.d.cts +52 -33
- package/dist/internal/index.d.ts +52 -33
- package/dist/internal/index.js +1 -1
- package/dist/{landmarker-KB7LVXAU.js → landmarker-3BBP3RBY.js} +1 -1
- package/dist/mrz-band-DCXFWDBD.js +1 -0
- package/dist/plan-runner-5UZYQ2XH.js +1 -0
- package/dist/popup/index.cjs +1 -1
- package/dist/popup/index.d.cts +2 -2
- package/dist/popup/index.d.ts +2 -2
- package/dist/popup/index.js +1 -1
- package/dist/{print-AYSCRSZB.js → print-4WOMNRBE.js} +1 -1
- package/dist/{turnstile-FATNZ4AG.js → turnstile-MX6YN4YH.js} +1 -1
- package/dist/{types-C_XP92JQ.d.ts → types-ChKVytm_.d.cts} +129 -74
- package/dist/{types-C_XP92JQ.d.cts → types-ChKVytm_.d.ts} +129 -74
- package/package.json +1 -1
- package/sbom.cdx.json +10 -10
- package/dist/background-monitor-A7FKJOAG.js +0 -1
- package/dist/camera-trait-45MJTW4K.js +0 -1
- package/dist/capture-session-doc-XBZGXWOP.js +0 -1
- package/dist/chunk-234OZEDB.js +0 -1
- package/dist/chunk-7Q4YPMAF.js +0 -1
- package/dist/chunk-B2X33ZW2.js +0 -1
- package/dist/chunk-CQ7SKLMC.js +0 -1
- package/dist/chunk-FUHDOEBP.js +0 -1
- package/dist/chunk-GT2ZLGF7.js +0 -1
- package/dist/chunk-H3HVCWLF.js +0 -1
- package/dist/chunk-O5WKNZ2C.js +0 -1
- package/dist/chunk-OKWG3PVH.js +0 -1
- package/dist/chunk-P3H3D33O.js +0 -1
- package/dist/chunk-P6UP4UQY.js +0 -1
- package/dist/chunk-SNACCYTL.js +0 -1
- package/dist/chunk-TQB3URP2.js +0 -1
- package/dist/chunk-VIAT4DEA.js +0 -1
- package/dist/chunk-ZADZTM3M.js +0 -1
- package/dist/chunk-ZNIZACXD.js +0 -1
- package/dist/create-document-capture-23R2F47A.js +0 -1
- package/dist/create-portrait-capture-AGFHECK7.js +0 -1
- package/dist/icao-gate-T3BTOKFJ.js +0 -1
- package/dist/icao-tuning-4ETMF53W.js +0 -1
- package/dist/mrz-band-VYHOTDHY.js +0 -1
- package/dist/plan-runner-NUWONT7F.js +0 -1
- /package/dist/{chunk-53POX7U4.js → chunk-25TEJBSB.js} +0 -0
- /package/dist/{chunk-TDLIXFDT.js → chunk-BPKDXDDH.js} +0 -0
- /package/dist/{chunk-FPXL63KZ.js → chunk-FK2DJADA.js} +0 -0
- /package/dist/{chunk-GI3UFGRQ.js → chunk-LL3YYUKR.js} +0 -0
- /package/dist/{chunk-DK5YPBDQ.js → chunk-LYYLXNA4.js} +0 -0
- /package/dist/{chunk-SMKCBUJL.js → chunk-NYRFUVAR.js} +0 -0
- /package/dist/{chunk-POIQGEZM.js → chunk-V5P5P3HY.js} +0 -0
- /package/dist/{chunk-DFTCAWMP.js → chunk-VP37FW6C.js} +0 -0
- /package/dist/{chunk-CJHMFPL6.js → chunk-YH7DR3PF.js} +0 -0
- /package/dist/{keyframe-rank-YAJLYJYF.js → keyframe-rank-R4NPQGN3.js} +0 -0
- /package/dist/{scanic-ml-stub-KW7IZHUT.js → scanic-ml-stub-XPNKT2N3.js} +0 -0
- /package/dist/{segmenter-USLNBX65.js → segmenter-3CVPTZMM.js} +0 -0
- /package/dist/{upload-file-UYXOHCRG.js → upload-file-C4MFKLT3.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as Detector } from './detect-worker-
|
|
2
|
-
import { A as AcceptedDocumentType,
|
|
3
|
-
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1,
|
|
4
|
-
import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, p as IcaoGateScores, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-
|
|
1
|
+
import { b as Detector } from './detect-worker-CHqsPJoM.js';
|
|
2
|
+
import { A as AcceptedDocumentType, a7 as NationalEidOption, aG as StepSection, aP as HostedBranding, al as PlanSectionView, ai as PlanChoiceKind, T as HostedSimulationView, l as ContactChannel, f as CheckReason, aT as RetakeHint, af as PhotoSource, ag as PhotoSourcePick, _ as IdentityMethod, E as EidAfterPass, $ as IdentitySummarySource, J as HostedIcaoPolicy, ab as PhoneCountryRule, Y as IcaoReportEntry, aS as IcaoCaptureTuning, Q as HostedPortraitPendingFix, b as CaptureMode, aA as SessionReason, ay as SessionDecidingStep, S as HostedSessionView, U as HostedStepView, am as PlanStepView, ax as ResolvedCaptureMode, aX as ScreenRampReport, aO as CaptureProvenance, aV as ScreenRampPaint, az as SessionFailureReason, aL as AgeEstimationReason, aJ as VerificationLevel, aI as VerificationAssurance, a6 as MethodChoiceView, aM as CameraUnavailableCause, aN as CaptureIssueReport, W as HostedVoiceView, aU as ScreenRampChallenge, b0 as PersonMask, a as AttestationInput, h as CheckType, ar as PortraitIcaoInput } from './types-ChKVytm_.js';
|
|
3
|
+
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, q as DeviceClass, b as CaptureArtifacts, ad as EngineErrorDetail, W as V3GateQuality, _ as V3TelemetryEvent } from './capture-session-v3-C-Q-21Fm.js';
|
|
4
|
+
import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, p as IcaoGateScores, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-BrnPW_gd.js';
|
|
5
5
|
|
|
6
6
|
declare const ISSUER_CODES: readonly string[];
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ declare const resolveAcceptedDocuments: (view: {
|
|
|
25
25
|
declare const flagOf: (iso2: string) => string;
|
|
26
26
|
|
|
27
27
|
declare const WEB_IDENTITY_METHODS: readonly IdentityMethod[];
|
|
28
|
-
/** Plan 4's web stop for `nfc.mode = mandatory` (view-only `
|
|
28
|
+
/** Plan 4's web stop for `nfc.mode = mandatory` (view-only `reasonCode`) and the skip reason in `preferred`. */
|
|
29
29
|
declare const PLATFORM_UNSUPPORTED = "platform_unsupported";
|
|
30
30
|
/** A step's section: the view's value (kept even when unknown), else the check type's. */
|
|
31
31
|
declare function sectionOf(step: Pick<HostedStepView, "checkType" | "section">): StepSection | null;
|
|
@@ -48,7 +48,10 @@ declare function laneOf(view: HostedSessionView): InLaneSwitch | null;
|
|
|
48
48
|
declare function otherOptions(lane: InLaneSwitch | null | undefined): ChoiceOptionSnapshot[];
|
|
49
49
|
type DocumentSide = "recto" | "verso" | "single";
|
|
50
50
|
interface DeriveStepEnv {
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* A phone / tablet browser. `false` (a desktop) routes a `requiresMobile` camera step to `mobile_required`, and a
|
|
53
|
+
* `choice` photo step to its upload with the camera on a phone (`photo.cameraOnPhone`). Absent: neither.
|
|
54
|
+
*/
|
|
52
55
|
isMobile?: boolean;
|
|
53
56
|
}
|
|
54
57
|
interface StepContext {
|
|
@@ -86,6 +89,7 @@ interface StepAttempts {
|
|
|
86
89
|
/** Liveness v7 §5.2: what to change for the next capture, when the API reports it (prefer `hints.*` copy). */
|
|
87
90
|
retakeHint?: RetakeHint;
|
|
88
91
|
attemptsRemaining: number;
|
|
92
|
+
/** Every counted attempt is used (`attempts.used >= attempts.max`): no try is left. */
|
|
89
93
|
attemptsExhausted: boolean;
|
|
90
94
|
}
|
|
91
95
|
type OtpNumberSource = "prefilled" | "user_entered" | "prefilled_or_entered";
|
|
@@ -367,6 +371,11 @@ interface PhotoSourceState {
|
|
|
367
371
|
pick: PhotoSourcePick | null;
|
|
368
372
|
/** An upload is accepted now (`uploadDocument` / `uploadPortrait`). */
|
|
369
373
|
uploadOffered: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Spec 2026-11-06 §3.1, a `choice` step on a desktop: the camera runs on a phone only. Offer the upload and
|
|
376
|
+
* "Continue on my phone" (the hand-over), never the webcam. Absent otherwise.
|
|
377
|
+
*/
|
|
378
|
+
cameraOnPhone?: true;
|
|
370
379
|
}
|
|
371
380
|
interface LivenessSnapshot extends StepAttempts {
|
|
372
381
|
/**
|
|
@@ -469,7 +478,8 @@ interface MobileRequiredSnapshot {
|
|
|
469
478
|
kind: "mobile_required";
|
|
470
479
|
key: string;
|
|
471
480
|
context: StepContext;
|
|
472
|
-
|
|
481
|
+
/** The camera step to continue on a phone (spec 2026-11-06 §3.1: every live camera capture, in every decision mode). */
|
|
482
|
+
checkType: "liveness" | "face_match" | "doc_ocr" | "portrait_icao";
|
|
473
483
|
}
|
|
474
484
|
interface ProcessingSnapshot {
|
|
475
485
|
/**
|
|
@@ -502,7 +512,15 @@ interface UnsupportedSnapshot {
|
|
|
502
512
|
checkType: string;
|
|
503
513
|
reason: UnsupportedReason;
|
|
504
514
|
}
|
|
505
|
-
|
|
515
|
+
/**
|
|
516
|
+
* The result screen to show (session outcome model §5.1): `verified`; `review`; `rejected` (a
|
|
517
|
+
* verdict against the person); `inconclusive` (no verdict could be reached); `unavailable` (the
|
|
518
|
+
* check could not run); `expired` (the person left, nobody opened the link, the organization
|
|
519
|
+
* cancelled it or a newer session took it over: this link is over); `policy` (a flow rule
|
|
520
|
+
* stopped it); `cooldown` (this device may try again later); `platform_unsupported` (this
|
|
521
|
+
* client cannot run a required step).
|
|
522
|
+
*/
|
|
523
|
+
type ResultDisplay = "verified" | "review" | "rejected" | "inconclusive" | "unavailable" | "expired" | "policy" | "cooldown" | "platform_unsupported";
|
|
506
524
|
interface ResultSnapshot {
|
|
507
525
|
/**
|
|
508
526
|
* Flow model 2026-10-23: the section of the flow (`contact`, `identity`,
|
|
@@ -515,7 +533,12 @@ interface ResultSnapshot {
|
|
|
515
533
|
context: StepContext;
|
|
516
534
|
display: ResultDisplay;
|
|
517
535
|
result: VerificationResult;
|
|
518
|
-
|
|
536
|
+
/** `not_verified` only: why ({@link SessionReason}). */
|
|
537
|
+
reason?: SessionReason;
|
|
538
|
+
/** The detailed code behind the result (`spoof_detected`, `device_cooldown`, `platform_unsupported`, ...). */
|
|
539
|
+
reasonCode?: string;
|
|
540
|
+
/** `not_verified` only: the step that decided it, when one did. */
|
|
541
|
+
step?: SessionDecidingStep;
|
|
519
542
|
retryAfter?: string;
|
|
520
543
|
}
|
|
521
544
|
type StepSnapshot = PhoneOtpSnapshot | EmailOtpSnapshot | ContactChoiceSnapshot | IdentitySummarySnapshot | MethodSnapshot | ChoiceSnapshot | EidSnapshot | RegistrySnapshot | DocumentSnapshot | LivenessSnapshot | PortraitSnapshot | MobileRequiredSnapshot | ProcessingSnapshot | UnsupportedSnapshot | ResultSnapshot;
|
|
@@ -679,7 +702,7 @@ interface DocumentCaptureHandle {
|
|
|
679
702
|
* handle belongs to a plan-runner step;
|
|
680
703
|
* - `error` — camera or model failure (`error` fired).
|
|
681
704
|
*/
|
|
682
|
-
type PortraitCaptureState = "idle" | "starting" | "gating" | "captured" | "uploading" | "checking" | "done" | "error";
|
|
705
|
+
type PortraitCaptureState = "idle" | "starting" | "gating" | "captured" | "uploading" | "checking" | "done" | "error" | "mode_switch";
|
|
683
706
|
/** One gate evaluation: per-criterion state, the one coaching message, readiness. */
|
|
684
707
|
type PortraitGateUpdate = IcaoGateUpdate;
|
|
685
708
|
interface CapturedPortrait {
|
|
@@ -695,6 +718,8 @@ interface CapturedPortrait {
|
|
|
695
718
|
gate: IcaoGateSummary;
|
|
696
719
|
/** `capture.tuningVersion` the gate ran with, when the server sent one. */
|
|
697
720
|
tuningVersion?: string;
|
|
721
|
+
/** The camera the photo was taken with (as the live track reports it, else as requested). */
|
|
722
|
+
facingMode: CameraFacing;
|
|
698
723
|
}
|
|
699
724
|
interface PortraitCaptureEvents {
|
|
700
725
|
state: PortraitCaptureState;
|
|
@@ -709,9 +734,8 @@ interface PortraitCaptureOptions {
|
|
|
709
734
|
*/
|
|
710
735
|
video: HTMLVideoElement;
|
|
711
736
|
/**
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
* {@link createPortraitCapture}) always opens the front camera and ignores it.
|
|
737
|
+
* Ignored: the capture mode sets the camera. A `self` capture (every standalone {@link createPortraitCapture}) opens
|
|
738
|
+
* the front camera and an `assisted` capture the back camera; the other camera is ignored with a console warning.
|
|
715
739
|
*/
|
|
716
740
|
facing?: CameraFacing;
|
|
717
741
|
/** `HostedSessionView.capture.icao`; missing fields use the bundled fallbacks. */
|
|
@@ -739,20 +763,35 @@ interface PortraitCaptureHandle {
|
|
|
739
763
|
readonly captureMode: CaptureMode;
|
|
740
764
|
/** The camera of the live stream (as its track reports it, else as requested); `'user'` before the first start. */
|
|
741
765
|
readonly facingMode: CameraFacing;
|
|
742
|
-
/** Open the camera, load the model and start the gate.
|
|
766
|
+
/** Open the capture mode's camera, load the model and start the gate. */
|
|
743
767
|
start(options?: PortraitStartOptions): Promise<void>;
|
|
744
768
|
/** Take the photo again (gate only — the camera stays open), or restart after an error. */
|
|
745
769
|
retry(): void;
|
|
746
770
|
/**
|
|
747
|
-
*
|
|
748
|
-
*
|
|
771
|
+
* Does nothing and returns `false` (with a console warning): the capture mode sets the camera, the front one in
|
|
772
|
+
* `self` and the back one in `assisted`. Under `choice` the person switches the mode
|
|
773
|
+
* ({@link PortraitCaptureHandle.setCaptureMode}).
|
|
749
774
|
*/
|
|
750
775
|
switchCamera(): boolean;
|
|
776
|
+
/**
|
|
777
|
+
* Spec 2026-11-06 §3.3, a portrait step whose capture mode is `choice`: whether the person can switch between `self`
|
|
778
|
+
* and `assisted` on the camera view (a device with a front/back choice). `false` otherwise and on a standalone
|
|
779
|
+
* capture. Never rejects.
|
|
780
|
+
*/
|
|
781
|
+
canSwitchCaptureMode(): Promise<boolean>;
|
|
782
|
+
/**
|
|
783
|
+
* Spec 2026-11-06 §3.3: switch the capture mode under `choice` ({@link PortraitCaptureHandle.canSwitchCaptureMode}).
|
|
784
|
+
* The pick is recorded for the session (`Verification.chooseCaptureMode`), and the camera reopens in the new mode
|
|
785
|
+
* (`self`: the front one, `assisted`: the back one) with the gate from zero, through the `mode_switch` state.
|
|
786
|
+
* Before the first start it only records the pick. Resolves `false` and changes nothing when the switch is not
|
|
787
|
+
* offered, the mode is already in force, or the photo was taken.
|
|
788
|
+
*/
|
|
789
|
+
setCaptureMode(mode: ResolvedCaptureMode): Promise<boolean>;
|
|
751
790
|
destroy(): void;
|
|
752
791
|
}
|
|
753
792
|
/** Options of {@link PortraitCaptureHandle.start}. */
|
|
754
793
|
interface PortraitStartOptions {
|
|
755
|
-
/**
|
|
794
|
+
/** Ignored: the capture mode sets the camera (`self` the front one, `assisted` the back one), with a console warning. */
|
|
756
795
|
facing?: CameraFacing;
|
|
757
796
|
}
|
|
758
797
|
|
|
@@ -760,8 +799,10 @@ interface PortraitStartOptions {
|
|
|
760
799
|
* Gate guidance code. `'hold'` is emitted while the clip records. `'upright'`:
|
|
761
800
|
* the phone is held sideways (a landscape camera frame on a phone); the gate
|
|
762
801
|
* waits, and a clip being recorded is dropped, until it is upright again.
|
|
802
|
+
* `'one_face'`: the camera sees a second person of meaningful size; the gate
|
|
803
|
+
* waits until only one face is in the frame.
|
|
763
804
|
*/
|
|
764
|
-
type GateHint = "center" | "closer" | "farther" | "light" | "still" | "hold" | "upright";
|
|
805
|
+
type GateHint = "center" | "closer" | "farther" | "light" | "still" | "hold" | "upright" | "one_face";
|
|
765
806
|
/**
|
|
766
807
|
* Capture + verification state, as seen by the partner:
|
|
767
808
|
* - `idle → starting → gating → recording → captured` is the engine's run;
|
|
@@ -769,7 +810,7 @@ type GateHint = "center" | "closer" | "farther" | "light" | "still" | "hold" | "
|
|
|
769
810
|
* {@link Verification.liveness} (the SDK uploads and submits after `captured`);
|
|
770
811
|
* - `error` on a camera / engine failure (see {@link CaptureError}).
|
|
771
812
|
*/
|
|
772
|
-
type CaptureState = "idle" | "starting" | "gating" | "recording" | "captured" | "uploading" | "checking" | "done" | "error";
|
|
813
|
+
type CaptureState = "idle" | "starting" | "gating" | "recording" | "captured" | "uploading" | "checking" | "done" | "error" | "mode_switch";
|
|
773
814
|
/** Declared capture channel — the liveness band is mobile-calibrated. */
|
|
774
815
|
type CaptureChannel = "mobile" | "desktop";
|
|
775
816
|
/** Gate ring update: integrator progress 0..1 and the current guidance code. */
|
|
@@ -800,8 +841,16 @@ interface CapturedArtifacts {
|
|
|
800
841
|
width: number;
|
|
801
842
|
/** Intrinsic video height at capture time. */
|
|
802
843
|
height: number;
|
|
803
|
-
/**
|
|
844
|
+
/** The clip's duration (ms) read from its container; recording start → stop when the container was not read. */
|
|
804
845
|
clipMs?: number;
|
|
846
|
+
/** Video frames in the clip (read from its container). */
|
|
847
|
+
clipFrames?: number;
|
|
848
|
+
/** The clip's frame rate: frames over its duration. */
|
|
849
|
+
fps?: number;
|
|
850
|
+
/** Silent re-recordings (0 or 1): the first take was short, unreadable or errored. */
|
|
851
|
+
clipRetakes?: number;
|
|
852
|
+
/** The clip's codec (`avc1.42E01E`, `h264`, `vp8`, …), from the recorder's type. */
|
|
853
|
+
codec?: string;
|
|
805
854
|
/** `'mobile'` on phones/tablets (the calibrated channel), else `'desktop'`. */
|
|
806
855
|
captureChannel: CaptureChannel;
|
|
807
856
|
/** Set when the browser has no MediaRecorder: a keyframe-only capture. */
|
|
@@ -917,15 +966,15 @@ interface LivenessCaptureEvents {
|
|
|
917
966
|
animations: "full" | "reduced";
|
|
918
967
|
};
|
|
919
968
|
/**
|
|
920
|
-
*
|
|
921
|
-
* (`null`). Fires while the clip records, at the
|
|
922
|
-
*
|
|
969
|
+
* Ramp v2: paint a full-screen layer this colour (`screenRampColourValue(colour)`), black (`"dark"`, the dark-gap
|
|
970
|
+
* arm; `screenRampColourValue("dark")`) or clear it (`null`). Fires while the clip records, at the times the
|
|
971
|
+
* session's challenge issued. Subscribing is the acknowledgement: the engine runs the ramp only when a listener is bound when the
|
|
923
972
|
* recording starts, and the stamps it reports describe exactly these calls. `@sekyro/react` paints it; a host on
|
|
924
973
|
* `@sekyro/web` alone paints it itself (a `position: fixed; inset: 0` element behind its chrome) or leaves the
|
|
925
974
|
* event unbound. Never fires in an assisted capture or a keyframe-only capture.
|
|
926
975
|
*/
|
|
927
976
|
ramp: {
|
|
928
|
-
colour:
|
|
977
|
+
colour: ScreenRampPaint;
|
|
929
978
|
};
|
|
930
979
|
}
|
|
931
980
|
/** Which camera to open: the selfie camera (`'user'`) or the rear one (`'environment'`). */
|
|
@@ -933,10 +982,8 @@ type CameraFacing = "user" | "environment";
|
|
|
933
982
|
/** Options of {@link LivenessCaptureHandle.start}. */
|
|
934
983
|
interface LivenessStartOptions {
|
|
935
984
|
/**
|
|
936
|
-
*
|
|
937
|
-
*
|
|
938
|
-
* `'environment'` on a device with a front/back choice and `'user'` without one). A `self` capture always opens the front camera and
|
|
939
|
-
* ignores `'environment'` (with a console warning).
|
|
985
|
+
* Ignored: the capture mode sets the camera. A `self` capture opens the front camera and an `assisted` capture the
|
|
986
|
+
* back camera; the other camera is ignored with a console warning.
|
|
940
987
|
*/
|
|
941
988
|
facing?: CameraFacing;
|
|
942
989
|
}
|
|
@@ -949,8 +996,8 @@ interface LivenessCaptureHandle {
|
|
|
949
996
|
* session (`HostedSessionView.capture.mode`, set in the flow; `self` until
|
|
950
997
|
* the view is known; under `choice` the person's pick, `self` until
|
|
951
998
|
* {@link Verification.chooseCaptureMode}); a standalone {@link createLivenessCapture} is always
|
|
952
|
-
* `self`.
|
|
953
|
-
* does nothing
|
|
999
|
+
* `self`. The mode sets the camera: `self` the front one, `assisted` the back one
|
|
1000
|
+
* ({@link LivenessCaptureHandle.switchCamera} does nothing). Never `choice`.
|
|
954
1001
|
*/
|
|
955
1002
|
readonly captureMode: CaptureMode;
|
|
956
1003
|
/**
|
|
@@ -962,18 +1009,32 @@ interface LivenessCaptureHandle {
|
|
|
962
1009
|
/** Subscribe; returns the unsubscribe function. */
|
|
963
1010
|
on<K extends keyof LivenessCaptureEvents>(event: K, handler: (payload: LivenessCaptureEvents[K]) => void): () => void;
|
|
964
1011
|
/**
|
|
965
|
-
* Ask for the camera and start gating. Resolves once the attempt is running or failed.
|
|
966
|
-
* `options.facing` picks the camera for this attempt and later retries.
|
|
1012
|
+
* Ask for the capture mode's camera and start gating. Resolves once the attempt is running or failed.
|
|
967
1013
|
*/
|
|
968
1014
|
start(options?: LivenessStartOptions): Promise<void>;
|
|
969
1015
|
/** Fresh attempt: resets the engine and restarts the camera. */
|
|
970
1016
|
retry(): void;
|
|
971
1017
|
/**
|
|
972
|
-
*
|
|
973
|
-
* `
|
|
974
|
-
*
|
|
1018
|
+
* Does nothing and returns `false` (with a console warning): the capture mode sets the camera, the front one in
|
|
1019
|
+
* `self` and the back one in `assisted`. Under `choice` the person switches the mode
|
|
1020
|
+
* ({@link LivenessCaptureHandle.setCaptureMode}).
|
|
975
1021
|
*/
|
|
976
1022
|
switchCamera(): boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* Spec 2026-11-06 §3.3, a session whose capture mode is `choice`: whether the person can switch between `self`
|
|
1025
|
+
* and `assisted` on the camera view (a device with a front/back choice). `false` on a `self` or `assisted`
|
|
1026
|
+
* session, on a one-camera device (the person captures in `self`) and on a standalone capture. Never rejects.
|
|
1027
|
+
*/
|
|
1028
|
+
canSwitchCaptureMode(): Promise<boolean>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Spec 2026-11-06 §3.3: switch the capture mode under `choice` ({@link LivenessCaptureHandle.canSwitchCaptureMode}).
|
|
1031
|
+
* The pick is recorded for the session (`Verification.chooseCaptureMode`, so `captureMode` follows it), and a
|
|
1032
|
+
* running take restarts in the new mode: a recording is discarded (never submitted, no attempt used), the state
|
|
1033
|
+
* passes through `mode_switch`, and the camera reopens (`self`: the front one, `assisted`: the back one). Before
|
|
1034
|
+
* the first start it only records the pick. Resolves `false` and changes nothing when the switch is not offered,
|
|
1035
|
+
* the mode is already in force, or a take is being submitted (`captured`, `uploading`, `checking`).
|
|
1036
|
+
*/
|
|
1037
|
+
setCaptureMode(mode: ResolvedCaptureMode): Promise<boolean>;
|
|
977
1038
|
/** Stop the camera, release the detector, drop all listeners. */
|
|
978
1039
|
destroy(): void;
|
|
979
1040
|
}
|
|
@@ -982,11 +1043,9 @@ interface LivenessCaptureOptions {
|
|
|
982
1043
|
/** Host-owned `<video playsInline muted>` element. */
|
|
983
1044
|
video: HTMLVideoElement;
|
|
984
1045
|
/**
|
|
985
|
-
*
|
|
986
|
-
*
|
|
987
|
-
*
|
|
988
|
-
* standalone capture, and sessions whose flow films the person themselves)
|
|
989
|
-
* always uses `'user'` and ignores `'environment'` with a console warning.
|
|
1046
|
+
* Ignored: the capture mode sets the camera. A `self` capture (every standalone capture, and sessions whose flow
|
|
1047
|
+
* films the person themselves) uses `'user'` and an `assisted` capture `'environment'`; the other camera is ignored
|
|
1048
|
+
* with a console warning.
|
|
990
1049
|
*/
|
|
991
1050
|
facing?: CameraFacing;
|
|
992
1051
|
/** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
|
|
@@ -1033,13 +1092,15 @@ type SdkFailureReason = "no_recorder" | "attestation" | "network" | "nni_unbound
|
|
|
1033
1092
|
/** Backend reason taxonomy ∪ the SDK-side failure reasons. */
|
|
1034
1093
|
type ReasonCode = CheckReason | SessionFailureReason | SdkFailureReason | AgeEstimationReason;
|
|
1035
1094
|
/**
|
|
1036
|
-
* - `
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
* -
|
|
1040
|
-
*
|
|
1095
|
+
* - `verified` / `not_verified` / `review`: the session's end state (a `not_verified`
|
|
1096
|
+
* result says why in {@link VerificationResult.reason});
|
|
1097
|
+
* - `retry`: the capture was not conclusive and attempts remain (`autoRetry` on);
|
|
1098
|
+
* the capture re-arms by itself;
|
|
1099
|
+
* - `unavailable`: the check could not run (the service was unavailable, no
|
|
1100
|
+
* MediaRecorder, attestation failed, network or API failure, or a step only a
|
|
1101
|
+
* phone can capture). Treat as "not finished".
|
|
1041
1102
|
*/
|
|
1042
|
-
type VerificationStatus = "
|
|
1103
|
+
type VerificationStatus = "verified" | "not_verified" | "review" | "retry" | "unavailable";
|
|
1043
1104
|
/** The verdict for this session / capture (`on('result')`). */
|
|
1044
1105
|
interface VerificationResult {
|
|
1045
1106
|
/**
|
|
@@ -1048,10 +1109,20 @@ interface VerificationResult {
|
|
|
1048
1109
|
*/
|
|
1049
1110
|
sessionId: string;
|
|
1050
1111
|
status: VerificationStatus;
|
|
1051
|
-
/** Backend check or session-policy reason, or SDK-side reason for `unavailable`. */
|
|
1052
|
-
reason?: ReasonCode;
|
|
1053
1112
|
/**
|
|
1054
|
-
* `
|
|
1113
|
+
* `not_verified` only: why ({@link SessionReason}). On a capture refused while the session
|
|
1114
|
+
* is still open (`autoRetry` off, or no attempt left), the reason the step's result gives
|
|
1115
|
+
* (`rejected`, `inconclusive`, `unavailable`).
|
|
1116
|
+
*/
|
|
1117
|
+
reason?: SessionReason;
|
|
1118
|
+
/**
|
|
1119
|
+
* The detailed code: the backend check or session-policy reason (`spoof_detected`,
|
|
1120
|
+
* `match_inconclusive`, `device_cooldown`, ...), or the SDK-side reason of an
|
|
1121
|
+
* `unavailable` result.
|
|
1122
|
+
*/
|
|
1123
|
+
reasonCode?: ReasonCode;
|
|
1124
|
+
/**
|
|
1125
|
+
* `retry` (and a `not_verified` on a still-parked step): submissions left for
|
|
1055
1126
|
* the parked check after this one, for the host's coaching copy.
|
|
1056
1127
|
*/
|
|
1057
1128
|
attemptsRemaining?: number;
|
|
@@ -1062,14 +1133,14 @@ interface VerificationResult {
|
|
|
1062
1133
|
*/
|
|
1063
1134
|
retakeHint?: RetakeHint;
|
|
1064
1135
|
/**
|
|
1065
|
-
* ISO-8601 time from which this device may verify again
|
|
1066
|
-
* `
|
|
1136
|
+
* ISO-8601 time from which this device may verify again, set on a
|
|
1137
|
+
* `not_verified` result with reason code `device_cooldown` (profile v2 step 4).
|
|
1067
1138
|
*/
|
|
1068
1139
|
retryAfter?: string;
|
|
1069
1140
|
/**
|
|
1070
|
-
* What the session proved (`
|
|
1141
|
+
* What the session proved (`verified`, `not_verified`, `review`), when the API
|
|
1071
1142
|
* reports it: `1` a live person, `2` their identity, `3` corroborated, `0`
|
|
1072
|
-
*
|
|
1143
|
+
* not verified. A display hint: confirm on your server with the result token.
|
|
1073
1144
|
*/
|
|
1074
1145
|
level?: VerificationLevel;
|
|
1075
1146
|
/** How the level was proved, when the API reports it. */
|
|
@@ -1178,10 +1249,12 @@ interface Verification {
|
|
|
1178
1249
|
*/
|
|
1179
1250
|
reportCaptureIssue?(issue: CaptureIssueReport): void;
|
|
1180
1251
|
/**
|
|
1181
|
-
* The session's
|
|
1182
|
-
*
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1252
|
+
* The session's current camera step (liveness, a selfie face match, a
|
|
1253
|
+
* camera document or portrait photo; spec 2026-11-06 §3.1, every decision
|
|
1254
|
+
* mode), or its pending liveness step, must be captured on a phone
|
|
1255
|
+
* (`HostedStepView.requiresMobile`) and this browser is not one: show
|
|
1256
|
+
* "continue on your phone" instead of starting the camera. A `choice` photo
|
|
1257
|
+
* step is not: its upload stays on the desktop. Bootstraps the hosted view when needed; `false` when
|
|
1185
1258
|
* the bootstrap fails or the verification was destroyed. Never rejects.
|
|
1186
1259
|
* Optional so custom / older `Verification` implementations stay valid —
|
|
1187
1260
|
* treat an absent member as "no phone requirement".
|
|
@@ -1190,9 +1263,10 @@ interface Verification {
|
|
|
1190
1263
|
/**
|
|
1191
1264
|
* Who films the face in this session (`HostedSessionView.capture.mode`, a
|
|
1192
1265
|
* flow setting): `self` (the person, front camera), `assisted` (an agent,
|
|
1193
|
-
* back camera) or `choice` (the
|
|
1194
|
-
*
|
|
1195
|
-
*
|
|
1266
|
+
* back camera) or `choice` (the camera opens in `self` and the person
|
|
1267
|
+
* switches on the camera view: {@link LivenessCaptureHandle.setCaptureMode}).
|
|
1268
|
+
* Once picked (on this page, or the session's latest pick `capture.pick`),
|
|
1269
|
+
* resolves to the pick. Bootstraps the hosted
|
|
1196
1270
|
* view when needed; `self` when the bootstrap fails or the verification was
|
|
1197
1271
|
* destroyed. Never rejects.
|
|
1198
1272
|
* Optional so custom / older `Verification` implementations stay valid:
|
|
@@ -1207,7 +1281,10 @@ interface Verification {
|
|
|
1207
1281
|
* Optional so custom / older `Verification` implementations stay valid.
|
|
1208
1282
|
*/
|
|
1209
1283
|
chooseCaptureMode?(mode: ResolvedCaptureMode): void;
|
|
1210
|
-
/**
|
|
1284
|
+
/**
|
|
1285
|
+
* Under `choice`: the pick made with {@link Verification.chooseCaptureMode}, else the session's latest
|
|
1286
|
+
* (`HostedSessionView.capture.pick`, once the view is known); `null` before either.
|
|
1287
|
+
*/
|
|
1211
1288
|
readonly captureChoice?: ResolvedCaptureMode | null;
|
|
1212
1289
|
/**
|
|
1213
1290
|
* The session is a returning-user session (`HostedSessionView.returning`,
|
|
@@ -1362,6 +1439,11 @@ interface RegistryStepHandle extends RegistrySnapshot {
|
|
|
1362
1439
|
interface DocumentStepHandle extends DocumentSnapshot {
|
|
1363
1440
|
/** Switch to another option of the open choice (`context.switchable`; `POST /hosted/choice`). Present only with it. */
|
|
1364
1441
|
chooseOption?(option: string): Promise<void>;
|
|
1442
|
+
/**
|
|
1443
|
+
* Spec 2026-11-06 §3.1, present only with `photo.cameraOnPhone` (a `choice` step on a desktop): re-read the session,
|
|
1444
|
+
* so the page follows the person who continued on their phone (the hand-over polls it).
|
|
1445
|
+
*/
|
|
1446
|
+
refresh?(): Promise<void>;
|
|
1365
1447
|
/** The picked issuer (`null` until picked; a verso keeps the recto's pick). */
|
|
1366
1448
|
issuer: string | null;
|
|
1367
1449
|
/** The picked type (`null` until picked). */
|
|
@@ -1429,6 +1511,11 @@ interface LivePhotoGateUpdate {
|
|
|
1429
1511
|
interface PortraitStepHandle extends PortraitSnapshot {
|
|
1430
1512
|
/** Switch to another option of the open choice (`context.switchable`; `POST /hosted/choice`). Present only with it. */
|
|
1431
1513
|
chooseOption?(option: string): Promise<void>;
|
|
1514
|
+
/**
|
|
1515
|
+
* Spec 2026-11-06 §3.1, present only with `photo.cameraOnPhone` (a `choice` step on a desktop): re-read the session,
|
|
1516
|
+
* so the page follows the person who continued on their phone (the hand-over polls it).
|
|
1517
|
+
*/
|
|
1518
|
+
refresh?(): Promise<void>;
|
|
1432
1519
|
/**
|
|
1433
1520
|
* The last submission failed on the network (nothing was decided): in the
|
|
1434
1521
|
* `capture` phase offer a new take (`retry()` on the capture handle), in the
|
|
@@ -1514,6 +1601,8 @@ interface CaptureEngine {
|
|
|
1514
1601
|
}): Promise<void>;
|
|
1515
1602
|
retry(): void;
|
|
1516
1603
|
switchCamera(): void;
|
|
1604
|
+
/** Drop the running attempt (discarding a recording) and start again on `facingMode`. */
|
|
1605
|
+
restart(facingMode: "user" | "environment"): void;
|
|
1517
1606
|
destroy(): void;
|
|
1518
1607
|
/** Device-profile chrome hint (LOW class → `'reduced'`); absent on doubles. */
|
|
1519
1608
|
readonly animations?: "full" | "reduced";
|
|
@@ -1536,8 +1625,17 @@ interface LivenessCaptureInternals {
|
|
|
1536
1625
|
declare function mapGuidanceHint(key: string): GateHint | null;
|
|
1537
1626
|
/** Engine state → public state (`preflight|acquiring → starting`, `positioning → gating`). */
|
|
1538
1627
|
declare function mapEngineState(state: CaptureState$1): CaptureState;
|
|
1539
|
-
/** Engine error kinds → the public six (`models|cliptoolarge|recorder|overconstrained → generic`). */
|
|
1628
|
+
/** Engine error kinds → the public six (`models|cliptoolarge|recorder|overconstrained → generic`, `backcamera → notfound`). */
|
|
1540
1629
|
declare function mapErrorKind(kind: CaptureErrorKind$1): CaptureErrorKind;
|
|
1630
|
+
/**
|
|
1631
|
+
* Spec 2026-11-06 §3.3: the capture mode switch of a capture bound to a session. `session` is the session's own mode
|
|
1632
|
+
* (the switch exists under `choice` only); `onModeChange` records the person's pick (`Verification.chooseCaptureMode`)
|
|
1633
|
+
* so the `captureMode` getter of the handle follows it.
|
|
1634
|
+
*/
|
|
1635
|
+
interface CaptureModeSwitch {
|
|
1636
|
+
session(): CaptureMode;
|
|
1637
|
+
onModeChange(mode: ResolvedCaptureMode): void;
|
|
1638
|
+
}
|
|
1541
1639
|
/** Handle + the hooks the verification layer uses to drive the flow states. */
|
|
1542
1640
|
interface LivenessCaptureInternalHandle {
|
|
1543
1641
|
handle: LivenessCaptureHandle;
|
|
@@ -1558,7 +1656,9 @@ captureMode?: () => ResolvedCaptureMode,
|
|
|
1558
1656
|
* starts. The engine gets it only for a `self` capture with a `ramp` listener bound (the host paints); absent (a
|
|
1559
1657
|
* capture bound to no session, older backends) → no ramp.
|
|
1560
1658
|
*/
|
|
1561
|
-
screenRamp?: () => ScreenRampChallenge | undefined
|
|
1659
|
+
screenRamp?: () => ScreenRampChallenge | undefined,
|
|
1660
|
+
/** Spec 2026-11-06 §3.3: the mode switch under `choice`; absent (a capture bound to no session) → none. */
|
|
1661
|
+
modeSwitch?: CaptureModeSwitch): LivenessCaptureInternalHandle;
|
|
1562
1662
|
/**
|
|
1563
1663
|
* Create a standalone liveness capture (no upload — pair it with your own
|
|
1564
1664
|
* submission, or use {@link Verification.liveness} for the full flow).
|
|
@@ -1921,19 +2021,7 @@ interface DocCameraTuning {
|
|
|
1921
2021
|
declare const DOC_CAMERA_TUNING_DEFAULTS: Readonly<DocCameraTuning>;
|
|
1922
2022
|
/** Field-by-field merge of a server `capture.document.camera` block over the defaults (bad fields ignored). */
|
|
1923
2023
|
declare function resolveDocCameraTuning(raw: unknown): DocCameraTuning;
|
|
1924
|
-
|
|
1925
|
-
/** What a camera label says about its lens (labels are English on Android Chrome / iOS Safari). */
|
|
1926
|
-
declare function lensKindOf(label: string): LensKind;
|
|
1927
|
-
/**
|
|
1928
|
-
* Back cameras best-first: main wide lenses (lowest Android index first), then
|
|
1929
|
-
* iOS virtual multi-lens devices; ultra-wide, telephoto, depth and front lenses
|
|
1930
|
-
* are dropped. Empty when nothing is identifiable (keep the browser's pick).
|
|
1931
|
-
*/
|
|
1932
|
-
declare function rankBackCameras(devices: ReadonlyArray<{
|
|
1933
|
-
deviceId: string;
|
|
1934
|
-
label: string;
|
|
1935
|
-
kind?: string;
|
|
1936
|
-
}>): string[];
|
|
2024
|
+
|
|
1937
2025
|
declare const LENS_STORAGE_KEY = "sekyro.doc.camera";
|
|
1938
2026
|
/** The remembered document camera (per browser), or null (storage blocked / empty). */
|
|
1939
2027
|
declare function readStoredLens(): string | null;
|
|
@@ -2003,8 +2091,7 @@ interface OpenDocCameraDeps {
|
|
|
2003
2091
|
type LensSource = "stored" | "selected" | "default";
|
|
2004
2092
|
/** Focus is fine when the camera offers continuous AF, or reports no focus modes at all (Safari / Firefox). */
|
|
2005
2093
|
declare function focusOk(stream: MediaStream): boolean;
|
|
2006
|
-
|
|
2007
|
-
declare const LENS_TRY_MAX = 3;
|
|
2094
|
+
|
|
2008
2095
|
/**
|
|
2009
2096
|
* Open the back camera: the remembered lens first, else `facingMode:
|
|
2010
2097
|
* environment` (the permission prompt; labels appear after it), then the
|
|
@@ -3055,6 +3142,12 @@ interface PortraitCaptureInternals {
|
|
|
3055
3142
|
/** The background-uniformity check's selfie segmenter (default: MediaPipe, lazy). */
|
|
3056
3143
|
createSegmenter?: (assetBaseUrl: string) => Promise<SegmenterLike>;
|
|
3057
3144
|
getUserMedia?: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
|
|
3145
|
+
/** (navigator.mediaDevices.enumerateDevices, only without a `getUserMedia` double) — the back lenses by id. */
|
|
3146
|
+
enumerateDevices?: () => Promise<ReadonlyArray<{
|
|
3147
|
+
deviceId: string;
|
|
3148
|
+
label: string;
|
|
3149
|
+
kind?: string;
|
|
3150
|
+
}>>;
|
|
3058
3151
|
/** Draw the video scaled to `longEdge` (analysis) or at full size (`null`). */
|
|
3059
3152
|
grabFrame?: (video: HTMLVideoElement, longEdge: number | null) => GrabbedFrame | null;
|
|
3060
3153
|
/** Cut `region` out of a full-size frame, scale to `outHeight`, encode JPEG. */
|
|
@@ -3080,7 +3173,9 @@ declare function createPortraitCaptureInternal(options: PortraitCaptureOptions,
|
|
|
3080
3173
|
* Who films the face (spec 2026-10-28 §4.3): the portrait step reads the session's `capture.mode` at every start
|
|
3081
3174
|
* and switch, as the liveness capture does. Absent (a standalone capture) → `self`: the front camera only.
|
|
3082
3175
|
*/
|
|
3083
|
-
captureMode?: () => ResolvedCaptureMode
|
|
3176
|
+
captureMode?: () => ResolvedCaptureMode,
|
|
3177
|
+
/** Spec 2026-11-06 §3.3: the capture mode switch of a `choice` step; absent (a standalone capture) → none. */
|
|
3178
|
+
modeSwitch?: CaptureModeSwitch): PortraitCaptureController;
|
|
3084
3179
|
|
|
3085
3180
|
/**
|
|
3086
3181
|
* The client surface the flow needs — `HostedClient` or a test fake. D8: the
|
|
@@ -3310,4 +3405,4 @@ declare function createVerification(options: VerificationOptions): Verification;
|
|
|
3310
3405
|
/** {@link createVerification} with construction seams (tests / Sekyro AI-internal hosts). */
|
|
3311
3406
|
declare function createVerificationInternal(options: VerificationOptions, internals: VerificationInternals): Verification;
|
|
3312
3407
|
|
|
3313
|
-
export { type LivePhotoPlan as $, type AcceptedDocumentsLike as A, type DocumentGuideMeasure as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentLiveMrzOptions as E, type DocumentMrzUpdate as F, type DocumentPoint as G, type DocumentQuad as H, type DocumentReticle as I, type DocumentScanPhase as J, type DocumentScanUpdate as K, type DocumentSide as L, type DocumentSnapshot as M, type DocumentStepHandle as N, type EidSnapshot as O, type PortraitCaptureOptions as P, type EidStepHandle as Q, type EmailOtpSnapshot as R, type EmailOtpStepHandle as S, type EmailSource as T, type GateHint as U, type GateUpdate as V, ISSUER_CODES as W, type IdentitySummarySnapshot as X, type IdentitySummaryStepHandle as Y, type InLaneSwitch as Z, type LivePhotoGateUpdate as _, type DocumentCaptureHandle as a, sectionOf as a$, type LivenessAssetsStatus as a0, type LivenessCaptureEvents as a1, type LivenessCaptureHandle as a2, type LivenessCaptureOptions as a3, type LivenessSnapshot as a4, type LivenessStartOptions as a5, type LivenessStepHandle as a6, type MethodSnapshot as a7, type MethodStepHandle as a8, type MobileRequiredSnapshot as a9, type StepContext as aA, type StepSnapshot as aB, type UnsupportedReason as aC, type UnsupportedSnapshot as aD, type UnsupportedStepHandle as aE, type Verification as aF, type VerificationBusy as aG, type VerificationEvents as aH, type VerificationLocale as aI, type VerificationOptions as aJ, type VerificationResult as aK, type VerificationStatus as aL, type VerificationStep as aM, WEB_IDENTITY_METHODS as aN, acceptedIssuers as aO, acceptedTypesFor as aP, cameraUnavailableCauseOf as aQ, createLivenessCapture as aR, createVerification as aS, deriveStep as aT, flagOf as aU, getLivenessAssetsStatus as aV, laneOf as aW, otherOptions as aX, preloadLivenessAssets as aY, releaseLivenessAssets as aZ, resolveAcceptedDocuments as a_, type MobileRequiredStepHandle as aa, type OtpChannel as ab, type OtpNumberSource as ac, PLATFORM_UNSUPPORTED as ad, type PhoneOtpSnapshot as ae, type PhoneOtpStepHandle as af, type PhotoSourceState as ag, type PlanChoiceSnapshot as ah, type PortraitCaptureEvents as ai, type PortraitCaptureState as aj, type PortraitGateUpdate as ak, type PortraitSnapshot as al, type PortraitStartOptions as am, type PortraitStepHandle as an, type PreloadLivenessAssetsOptions as ao, type ProcessingSnapshot as ap, type ProcessingStepHandle as aq, type ReasonCode as ar, type RegistrySnapshot as as, type RegistrySource as at, type RegistryStepHandle as au, type ResultDisplay as av, type ResultSnapshot as aw, type ResultStepHandle as ax, type SdkFailureReason as ay, type StepAttempts as az, type PortraitCaptureHandle as b, type EncodedDocument as b$, subscribeLivenessAssets as b0, type DocCatalogEntry as b1, type LiveMrzTuning as b2, type TextLockTuning as b3, type OcrEngineClient as b4, type DocAssistReport as b5, type ReadyInfo as b6, type LoadFailure as b7, type OcrEngineOptions as b8, type SubmitRuntime as b9, DocAssist as bA, type DocAssistEngine as bB, type DocAssistTick as bC, type DocCameraTuning as bD, type DocCaptureReport as bE, type DocCaptureVia as bF, type DocChecksPayload as bG, type DocEngineLike as bH, DocFeedbackAggregator as bI, type DocFeedbackKey as bJ, type DocFeedbackState as bK, type DocFormat as bL, type DocFrameAnalysis as bM, type DocFrameMeasures as bN, type DocGateQuality as bO, type DocGateThresholds as bP, type DocGateTick as bQ, type DocGateTickInput as bR, DocGateV1 as bS, type DocQuad as bT, type DocQuadPoint as bU, type DocShutterReason as bV, type DocShutterTuning as bW, type DocSide as bX, type DocumentCaptureController as bY, type DocumentCaptureInternals as bZ, EMPTY_GUIDE_METRICS as b_, type HostedClientLike as ba, ANALYSIS_LONG_EDGE as bb, ASPECT_BANDS as bc, AttestationError as bd, BLUR_REFUSE_SHARPNESS_MAX as be, type BlurStatus as bf, CAPTURE_CANDIDATE_SPACING_MS as bg, CAPTURE_EXTRA_CANDIDATES as bh, CLIP_MIME_ALLOWLIST as bi, type CaptureEngine as bj, CaptureSessionDoc as bk, type CaptureSessionDocEvents as bl, type CaptureSessionDocOptions as bm, DOC_ANALYSIS_DEFAULTS as bn, DOC_BLACK_FRAME_LUMA as bo, DOC_BLACK_FRAME_TICKS as bp, DOC_CADENCE_HZ as bq, DOC_CAMERA_TUNING_DEFAULTS as br, DOC_CATALOG as bs, DOC_DETECT_WIDTH as bt, DOC_FEEDBACK_STATES as bu, DOC_FIRST_FRAME_MS as bv, DOC_GATE_V1_DEFAULTS as bw, DOC_SHUTTER_DEFAULTS as bx, type DeviceReadHint as by, type DocArtifacts as bz, type CaptureChannel as c,
|
|
3408
|
+
export { type LivePhotoPlan as $, type AcceptedDocumentsLike as A, type DocumentGuideMeasure as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentLiveMrzOptions as E, type DocumentMrzUpdate as F, type DocumentPoint as G, type DocumentQuad as H, type DocumentReticle as I, type DocumentScanPhase as J, type DocumentScanUpdate as K, type DocumentSide as L, type DocumentSnapshot as M, type DocumentStepHandle as N, type EidSnapshot as O, type PortraitCaptureOptions as P, type EidStepHandle as Q, type EmailOtpSnapshot as R, type EmailOtpStepHandle as S, type EmailSource as T, type GateHint as U, type GateUpdate as V, ISSUER_CODES as W, type IdentitySummarySnapshot as X, type IdentitySummaryStepHandle as Y, type InLaneSwitch as Z, type LivePhotoGateUpdate as _, type DocumentCaptureHandle as a, sectionOf as a$, type LivenessAssetsStatus as a0, type LivenessCaptureEvents as a1, type LivenessCaptureHandle as a2, type LivenessCaptureOptions as a3, type LivenessSnapshot as a4, type LivenessStartOptions as a5, type LivenessStepHandle as a6, type MethodSnapshot as a7, type MethodStepHandle as a8, type MobileRequiredSnapshot as a9, type StepContext as aA, type StepSnapshot as aB, type UnsupportedReason as aC, type UnsupportedSnapshot as aD, type UnsupportedStepHandle as aE, type Verification as aF, type VerificationBusy as aG, type VerificationEvents as aH, type VerificationLocale as aI, type VerificationOptions as aJ, type VerificationResult as aK, type VerificationStatus as aL, type VerificationStep as aM, WEB_IDENTITY_METHODS as aN, acceptedIssuers as aO, acceptedTypesFor as aP, cameraUnavailableCauseOf as aQ, createLivenessCapture as aR, createVerification as aS, deriveStep as aT, flagOf as aU, getLivenessAssetsStatus as aV, laneOf as aW, otherOptions as aX, preloadLivenessAssets as aY, releaseLivenessAssets as aZ, resolveAcceptedDocuments as a_, type MobileRequiredStepHandle as aa, type OtpChannel as ab, type OtpNumberSource as ac, PLATFORM_UNSUPPORTED as ad, type PhoneOtpSnapshot as ae, type PhoneOtpStepHandle as af, type PhotoSourceState as ag, type PlanChoiceSnapshot as ah, type PortraitCaptureEvents as ai, type PortraitCaptureState as aj, type PortraitGateUpdate as ak, type PortraitSnapshot as al, type PortraitStartOptions as am, type PortraitStepHandle as an, type PreloadLivenessAssetsOptions as ao, type ProcessingSnapshot as ap, type ProcessingStepHandle as aq, type ReasonCode as ar, type RegistrySnapshot as as, type RegistrySource as at, type RegistryStepHandle as au, type ResultDisplay as av, type ResultSnapshot as aw, type ResultStepHandle as ax, type SdkFailureReason as ay, type StepAttempts as az, type PortraitCaptureHandle as b, type EncodedDocument as b$, subscribeLivenessAssets as b0, type DocCatalogEntry as b1, type LiveMrzTuning as b2, type TextLockTuning as b3, type OcrEngineClient as b4, type DocAssistReport as b5, type ReadyInfo as b6, type LoadFailure as b7, type OcrEngineOptions as b8, type SubmitRuntime as b9, DocAssist as bA, type DocAssistEngine as bB, type DocAssistTick as bC, type DocCameraTuning as bD, type DocCaptureReport as bE, type DocCaptureVia as bF, type DocChecksPayload as bG, type DocEngineLike as bH, DocFeedbackAggregator as bI, type DocFeedbackKey as bJ, type DocFeedbackState as bK, type DocFormat as bL, type DocFrameAnalysis as bM, type DocFrameMeasures as bN, type DocGateQuality as bO, type DocGateThresholds as bP, type DocGateTick as bQ, type DocGateTickInput as bR, DocGateV1 as bS, type DocQuad as bT, type DocQuadPoint as bU, type DocShutterReason as bV, type DocShutterTuning as bW, type DocSide as bX, type DocumentCaptureController as bY, type DocumentCaptureInternals as bZ, EMPTY_GUIDE_METRICS as b_, type HostedClientLike as ba, ANALYSIS_LONG_EDGE as bb, ASPECT_BANDS as bc, AttestationError as bd, BLUR_REFUSE_SHARPNESS_MAX as be, type BlurStatus as bf, CAPTURE_CANDIDATE_SPACING_MS as bg, CAPTURE_EXTRA_CANDIDATES as bh, CLIP_MIME_ALLOWLIST as bi, type CaptureEngine as bj, CaptureSessionDoc as bk, type CaptureSessionDocEvents as bl, type CaptureSessionDocOptions as bm, DOC_ANALYSIS_DEFAULTS as bn, DOC_BLACK_FRAME_LUMA as bo, DOC_BLACK_FRAME_TICKS as bp, DOC_CADENCE_HZ as bq, DOC_CAMERA_TUNING_DEFAULTS as br, DOC_CATALOG as bs, DOC_DETECT_WIDTH as bt, DOC_FEEDBACK_STATES as bu, DOC_FIRST_FRAME_MS as bv, DOC_GATE_V1_DEFAULTS as bw, DOC_SHUTTER_DEFAULTS as bx, type DeviceReadHint as by, type DocArtifacts as bz, type CaptureChannel as c, analyzeGuide as c$, FLIP_FILL_MIN as c0, FLIP_GAP_MS as c1, FLIP_TIMEOUT_MS as c2, type FocusCaps as c3, type FramingStatus as c4, GUIDE_LOCK_DEFAULTS as c5, type GlareStatus as c6, type GrabbedFrame as c7, type GuideBlocker as c8, GuideLock as c9, MANUAL_SHUTTER_MS as cA, MR_DOC_CATALOG as cB, NO_REPORT_MS as cC, type OpenDocCameraDeps as cD, PORTRAIT_JPEG_QUALITY as cE, PRELOAD_BLAZE_INIT_TIMEOUT_MS as cF, PRELOAD_BUDGET_MS as cG, PROCESSING_POLL_DELAY_MS as cH, PROCESSING_POLL_MAX as cI, type PortraitCaptureController as cJ, type PortraitCaptureInternals as cK, REGISTRY_RETRY_DELAY_MS as cL, type ReticleType as cM, SAME_FACE_MAX_DROPS as cN, type ScanEvent as cO, type ScanLayout as cP, type ScanNotice as cQ, type ScanPhase as cR, type ScanReport as cS, type ScanSide as cT, type ScanState as cU, type SubmitExecutor as cV, TEXT_LOCK_DEFAULTS as cW, TRANSPORT_REPLAY_ATTEMPTS as cX, TRANSPORT_REPLAY_DELAY_MS as cY, type VerificationInternals as cZ, analyzeDocFrame as c_, type GuideLockTick as ca, type GuideLockTuning as cb, type GuideMetrics as cc, type GuideRect as cd, INFERENCE_RETRY_ATTEMPTS as ce, INFERENCE_RETRY_DEFAULT_S as cf, LANDMARKER_MODEL as cg, LENS_STORAGE_KEY as ch, LIVE_MRZ_DEFAULTS as ci, LIVE_PHOTO_IDLE_MS as cj, LIVE_PHOTO_MAX_HZ as ck, type LandmarkedFace as cl, type LandmarkerLike as cm, type LensSource as cn, type LightingStatus as co, type LiveMrzCapture as cp, type LiveMrzState as cq, type LivePhotoGate as cr, type LivePhotoKit as cs, type LivePhotoKitInternals as ct, type LivePhotoKitOptions as cu, type LivePhotoStill as cv, type LivenessCaptureInternalHandle as cw, type LivenessCaptureInternals as cx, type LivenessFlowDeps as cy, type LivenessFlowOutcome as cz, type CaptureEngineId as d, aspectBand as d0, aspectFits as d1, buildDeviceReadHint as d2, coverPointToVideo as d3, createDocumentCaptureInternal as d4, createFaceLandmarker as d5, createLivePhotoKit as d6, createLivenessCaptureInternal as d7, createPortraitCaptureInternal as d8, createVerificationInternal as d9, resolveDocShutterTuning as dA, resolveGuideLockTuning as dB, runLivenessFlow as dC, runSubmission as dD, scannerFormatFor as dE, setPreloadLoaderForTests as dF, settledHint as dG, singleShotFocusAt as dH, specularFraction as dI, supportsFocusMode as dJ, warmDocDetector as dK, writeStoredLens as dL, docZoomFor as da, encodeDocumentImage as db, facesOf as dc, feedbackVoteOf as dd, focusOk as de, guideQuad as df, guideRegionInFrame as dg, initialScanState as dh, mapEngineState as di, mapErrorKind as dj, mapGuidanceHint as dk, nextScanState as dl, observe as dm, openDocCamera as dn, passportBandOf as dp, portraitMatchStep as dq, preloadedDetectorFactory as dr, quadAreaFrac as ds, quadBounds as dt, quadIou as du, quadTiltRatio as dv, randomUuid as dw, readStoredLens as dx, resetLivenessAssetsForTests as dy, resolveDocCameraTuning as dz, type CaptureError as e, type CaptureErrorDetail as f, type CaptureErrorKind as g, type CaptureErrorPhase as h, type CaptureState as i, type CapturedArtifacts as j, type CapturedDocument as k, type CapturedPortrait as l, type ChoiceOptionSnapshot as m, type ChoiceSnapshot as n, type ChoiceStepHandle as o, type ContactChoiceSnapshot as p, type ContactChoiceStepHandle as q, DEFAULT_API_ORIGIN as r, DOCUMENT_TYPE_ORDER as s, type DeriveStepEnv as t, type DocumentCaptureEvents as u, type DocumentCaptureState as v, type DocumentFeedback as w, type DocumentFeedbackKey as x, type DocumentGateUpdate as y, type DocumentGuide as z };
|
|
@@ -27,7 +27,23 @@ interface FaceObservation {
|
|
|
27
27
|
y: number;
|
|
28
28
|
};
|
|
29
29
|
score: number;
|
|
30
|
+
/** Other faces in the same detection whose box area is at least {@link SECOND_FACE_AREA_RATIO} of this
|
|
31
|
+
* face's ({@link countExtraFaces}). The gate blocks while it is above 0 (single-face liveness). Absent = 0. */
|
|
32
|
+
extraFaces?: number;
|
|
30
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Single-face liveness (2026-11-08): another face counts when its box area is at least this fraction of the
|
|
36
|
+
* main face's: half its width, a person within about twice the main person's distance from the camera.
|
|
37
|
+
* Passers-by further back, an ID card portrait or a poster are far smaller and never block. The same value
|
|
38
|
+
* on iOS and Android, and on the server (kyc-liveness-v2 `V2_SECOND_FACE_AREA_RATIO`).
|
|
39
|
+
*/
|
|
40
|
+
declare const SECOND_FACE_AREA_RATIO = 0.25;
|
|
41
|
+
/** How many of `boxes` other than `boxes[mainIndex]` reach {@link SECOND_FACE_AREA_RATIO} of its area. Pure;
|
|
42
|
+
* the boxes are the ones the detector already returned (no extra detection). */
|
|
43
|
+
declare function countExtraFaces(boxes: ReadonlyArray<{
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
}>, mainIndex: number): number;
|
|
31
47
|
interface Detector {
|
|
32
48
|
readonly tier: "native" | "blaze";
|
|
33
49
|
/** Why higher tiers were skipped (telemetry) — absent when the first
|
|
@@ -35,7 +51,8 @@ interface Detector {
|
|
|
35
51
|
readonly fallbackReason?: string;
|
|
36
52
|
/** Detect on a (possibly downscaled) snapshot; `sourceWidth/Height` are the
|
|
37
53
|
* STREAM dimensions the observation must be normalized to. Returns the
|
|
38
|
-
*
|
|
54
|
+
* main face (with `extraFaces` counted from the same detection) or null;
|
|
55
|
+
* NEVER rejects. */
|
|
39
56
|
detect(source: CanvasImageSource, sourceWidth: number, sourceHeight: number): Promise<FaceObservation | null>;
|
|
40
57
|
destroy(): void;
|
|
41
58
|
}
|
|
@@ -108,4 +125,4 @@ declare class WorkerDetectorProxy implements Detector {
|
|
|
108
125
|
destroy(): void;
|
|
109
126
|
}
|
|
110
127
|
|
|
111
|
-
export { type CreateDetectorOptions as C, DEFAULT_TIER_ORDER as D, type FaceObservation as F, type WorkerLike as W, DEFAULT_V3_ASSET_BASE_URL as a, type Detector as b, DetectorLadderError as c,
|
|
128
|
+
export { type CreateDetectorOptions as C, DEFAULT_TIER_ORDER as D, type FaceObservation as F, SECOND_FACE_AREA_RATIO as S, type WorkerLike as W, DEFAULT_V3_ASSET_BASE_URL as a, type Detector as b, DetectorLadderError as c, countExtraFaces as d, createDetector as e, WORKER_PROTOCOL_VERSION as f, WorkerDetectorProxy as g, type WorkerScopeLike as h, intrinsicSize as i, installWorkerDetectorHost as j, toStreamPixels as t, workerOffloadSupported as w };
|