@sekyro/web 0.1.0-rc.6 → 0.1.0-rc.8
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 +114 -0
- package/LICENSE +25 -16
- package/README.md +6 -8
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/background-monitor-A7FKJOAG.js +1 -0
- package/dist/capture-session-doc-YBE3UMJJ.js +1 -0
- package/dist/{capture-session-v3-Okq0EQHG.d.ts → capture-session-v3-CQK-G-qX.d.ts} +72 -3
- package/dist/{capture-session-v3-UQU_WjO2.d.cts → capture-session-v3-Dvob-uH2.d.cts} +72 -3
- package/dist/chunk-4RS2YIL4.js +1 -0
- package/dist/chunk-7V2M6Y2W.js +1 -0
- package/dist/chunk-7ZCZY3ZP.js +1 -0
- package/dist/chunk-A3FUGHAH.js +2 -0
- package/dist/chunk-BPE5NSQ2.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-DFTCAWMP.js +1 -0
- package/dist/chunk-DK5YPBDQ.js +1 -0
- package/dist/chunk-DQWW4OCK.js +1 -0
- package/dist/chunk-FHJ7HO3M.js +1 -0
- package/dist/chunk-FPXL63KZ.js +1 -0
- package/dist/chunk-G6LKLN4U.js +1 -0
- package/dist/chunk-GI3UFGRQ.js +1 -0
- package/dist/chunk-LQ7C44JG.js +1 -0
- package/dist/chunk-M43ET4NJ.js +1 -0
- package/dist/chunk-MXWLCDFX.js +1 -0
- package/dist/chunk-MY6EXEL2.js +1 -0
- package/dist/chunk-O5WKNZ2C.js +1 -0
- package/dist/chunk-OKWG3PVH.js +1 -0
- package/dist/chunk-POIQGEZM.js +1 -0
- package/dist/chunk-RI3E7GBN.js +1 -0
- package/dist/chunk-RNRFHUJA.js +1 -0
- package/dist/chunk-RVHAKRAI.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-SXZCL5NO.js +1 -0
- package/dist/chunk-TDLIXFDT.js +1 -0
- package/dist/chunk-XLN5OT25.js +1 -0
- package/dist/chunk-YDQBVWXG.js +1 -0
- package/dist/chunk-YPG7CB4O.js +1 -0
- package/dist/client/index.cjs +1 -357
- package/dist/client/index.d.cts +13 -3
- package/dist/client/index.d.ts +13 -3
- package/dist/client/index.js +1 -15
- package/dist/core/index.cjs +1 -1639
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -139
- package/dist/core/ocr/worker.bundle.js +42 -0
- package/dist/core/ocr/worker.cjs +42 -0
- package/dist/core/ocr/worker.d.cts +84 -0
- package/dist/core/ocr/worker.d.ts +84 -0
- package/dist/core/ocr/worker.js +41 -0
- package/dist/core/v3/detect-worker.cjs +1 -392
- 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 -13
- package/dist/create-document-capture-T4APHJMY.js +1 -0
- package/dist/create-portrait-capture-B57GE5FU.js +1 -0
- package/dist/create-verification-C0AVIcVW.d.ts +2787 -0
- package/dist/create-verification-DoFpgzok.d.cts +2787 -0
- package/dist/{detect-worker-CKXHlXx9.d.cts → detect-worker-DclNxkZT.d.cts} +6 -0
- package/dist/{detect-worker-CKXHlXx9.d.ts → detect-worker-DclNxkZT.d.ts} +6 -0
- package/dist/detector-scanic-YCDNLCGV.js +1 -0
- package/dist/icao-gate-D8qm1O2t.d.cts +1655 -0
- package/dist/icao-gate-D8qm1O2t.d.ts +1655 -0
- package/dist/icao-gate-PWBMKRGC.js +1 -0
- package/dist/icao-tuning-4GGVX6B4.js +1 -0
- package/dist/index.cjs +1 -3030
- package/dist/index.d.cts +52 -6
- package/dist/index.d.ts +52 -6
- package/dist/index.js +1 -85
- package/dist/internal/index.cjs +1 -4439
- package/dist/internal/index.d.cts +352 -312
- package/dist/internal/index.d.ts +352 -312
- package/dist/internal/index.js +1 -657
- package/dist/keyframe-rank-YAJLYJYF.js +1 -0
- package/dist/landmarker-KB7LVXAU.js +1 -0
- package/dist/mrz-band-VYHOTDHY.js +1 -0
- package/dist/plan-runner-UBK4B4CG.js +1 -0
- package/dist/popup/index.cjs +1 -76
- package/dist/popup/index.js +1 -11
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/turnstile-FATNZ4AG.js +1 -0
- package/package.json +25 -10
- package/sbom.cdx.json +195 -0
- package/dist/chunk-MWNFSNMP.js +0 -52
- package/dist/chunk-MWNFSNMP.js.map +0 -1
- package/dist/chunk-NILNKLK6.js +0 -50
- package/dist/chunk-NILNKLK6.js.map +0 -1
- package/dist/chunk-NWF46H7K.js +0 -359
- package/dist/chunk-NWF46H7K.js.map +0 -1
- package/dist/chunk-R3SJQHYU.js +0 -1173
- package/dist/chunk-R3SJQHYU.js.map +0 -1
- package/dist/chunk-TG5IE552.js +0 -1128
- package/dist/chunk-TG5IE552.js.map +0 -1
- package/dist/chunk-WY6U7AIK.js +0 -193
- package/dist/chunk-WY6U7AIK.js.map +0 -1
- package/dist/chunk-YVFF4Q4G.js +0 -327
- package/dist/chunk-YVFF4Q4G.js.map +0 -1
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/v3/detect-worker.cjs.map +0 -1
- package/dist/core/v3/detect-worker.js.map +0 -1
- package/dist/create-verification-BKc9NFQj.d.cts +0 -455
- package/dist/create-verification-DjcMZHAQ.d.ts +0 -455
- package/dist/detector-scanic-4C6IEW2K.js +0 -787
- package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
- package/dist/hosted-client-DJXq_CB9.d.cts +0 -449
- package/dist/hosted-client-DJXq_CB9.d.ts +0 -449
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.js.map +0 -1
- package/dist/popup/index.cjs.map +0 -1
- package/dist/popup/index.js.map +0 -1
- package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
- package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { D as DocumentCaptureOptions, a as DocumentCaptureHandle, P as PortraitCaptureOptions, b as PortraitCaptureHandle } from './create-verification-DoFpgzok.cjs';
|
|
2
|
+
export { A as AcceptedDocumentsLike, C as CameraFacing, c as CaptureChannel, d as CaptureEngineId, e as CaptureError, f as CaptureErrorKind, g as CaptureState, h as CapturedArtifacts, i as CapturedDocument, j as CapturedPortrait, k as ContactChoiceSnapshot, l as ContactChoiceStepHandle, m as DEFAULT_API_ORIGIN, n as DOCUMENT_TYPE_ORDER, o as DeriveStepEnv, p as DocumentCaptureEvents, q as DocumentCaptureState, r as DocumentFeedback, s as DocumentFeedbackKey, t as DocumentGateUpdate, u as DocumentGuide, v as DocumentGuideMeasure, w as DocumentLiveMrzOptions, x as DocumentMrzUpdate, y as DocumentPoint, z as DocumentQuad, B as DocumentReticle, E as DocumentScanPhase, F as DocumentScanUpdate, G as DocumentSide, H as DocumentSnapshot, I as DocumentStepHandle, J as EidSnapshot, K as EidStepHandle, L as EmailOtpSnapshot, M as EmailOtpStepHandle, N as EmailSource, O as GateHint, Q as GateUpdate, R as ISSUER_CODES, S as IdentitySummarySnapshot, T as IdentitySummaryStepHandle, U as LivePhotoGateUpdate, V as LivePhotoPlan, W as LivenessAssetsStatus, X as LivenessCaptureEvents, Y as LivenessCaptureHandle, Z as LivenessCaptureOptions, _ as LivenessSnapshot, $ as LivenessStartOptions, a0 as LivenessStepHandle, a1 as MethodSnapshot, a2 as MethodStepHandle, a3 as MobileRequiredSnapshot, a4 as MobileRequiredStepHandle, a5 as OtpChannel, a6 as OtpNumberSource, a7 as PLATFORM_UNSUPPORTED, a8 as PhoneOtpSnapshot, a9 as PhoneOtpStepHandle, aa as PortraitCaptureEvents, ab as PortraitCaptureState, ac as PortraitGateUpdate, ad as PortraitSnapshot, ae as PortraitStepHandle, af as PreloadLivenessAssetsOptions, ag as ProcessingSnapshot, ah as ProcessingStepHandle, ai as ReasonCode, aj as RegistrySnapshot, ak as RegistrySource, al as RegistryStepHandle, am as ResultDisplay, an as ResultSnapshot, ao as ResultStepHandle, ap as SdkFailureReason, aq as StepAttempts, ar as StepContext, as as StepSnapshot, at as UnsupportedReason, au as UnsupportedSnapshot, av as UnsupportedStepHandle, aw as Verification, ax as VerificationBusy, ay as VerificationEvents, az as VerificationLocale, aA as VerificationOptions, aB as VerificationResult, aC as VerificationStatus, aD as VerificationStep, aE as WEB_IDENTITY_METHODS, aF as acceptedIssuers, aG as acceptedTypesFor, aH as createLivenessCapture, aI as createVerification, aJ as deriveStep, aK as flagOf, aL as getLivenessAssetsStatus, aM as preloadLivenessAssets, aN as releaseLivenessAssets, aO as resolveAcceptedDocuments, aP as sectionOf, aQ as subscribeLivenessAssets } from './create-verification-DoFpgzok.cjs';
|
|
2
3
|
export { OpenHostedOptions, PopupBlocked, PopupHandle, SEKYRO_EVENTS, SekyroEvent, SekyroEventName, openHosted } from './popup/index.cjs';
|
|
3
|
-
export { HostedApiError, KNOWN_CODES, KnownCode, isKnownCode } from './client/index.cjs';
|
|
4
|
-
export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView,
|
|
5
|
-
import './detect-worker-
|
|
6
|
-
import './capture-session-v3-
|
|
4
|
+
export { HostedApiError, KNOWN_CODES, KnownCode, icaoPolicyOf, isKnownCode } from './client/index.cjs';
|
|
5
|
+
export { A as AcceptedDocumentType, C as CheckReason, a as CheckState, b as CheckType, c as ContactChannel, D as DecisionReason, d as DocReason, E as EidAfterPass, e as EidAuthInput, f as EidReason, g as EmailOtpReason, F as FaceMatchReason, H as HeadPose, h as HostedAcceptedDocuments, i as HostedBranding, j as HostedBrandingColorKey, k as HostedCaptureTuning, l as HostedDocumentCaptureTuning, m as HostedDocumentScanTuning, n as HostedEidView, o as HostedEmailOtpView, p as HostedIcaoPolicy, q as HostedIntegrity, r as HostedLivePhotoTuning, s as HostedNativeCaptureTuning, t as HostedOcrTuning, u as HostedOtpView, v as HostedPortraitView, w as HostedSessionView, x as HostedStepView, y as HostedVoiceLocale, z as HostedVoiceView, I as IcaoCaptureTuning, B as IcaoCoachKey, G as IcaoCriterion, J as IcaoCriterionState, K as IcaoGateCriterion, L as IcaoGateSummary, M as IcaoGateUpdate, N as IcaoReportEntry, O as IdentityConfirmDecision, P as IdentityMethod, Q as IdentitySummarySource, R as IdentitySummaryView, S as LivenessReason, T as MatchReason, U as MethodChoiceView, V as NationalEidOption, W as NfcChipReason, X as NfcStepView, Y as OtpChoiceView, Z as PhoneOtpReason, _ as PolicyFailureReason, $ as PopulationReason, a0 as PortraitIcaoInput, a1 as PortraitIcaoReason, a2 as SessionFailureReason, a3 as SessionOutcome, a4 as SessionStatus, a5 as StepSection } from './icao-gate-D8qm1O2t.cjs';
|
|
6
|
+
import './detect-worker-DclNxkZT.cjs';
|
|
7
|
+
import './capture-session-v3-Dvob-uH2.cjs';
|
|
7
8
|
|
|
8
9
|
/** Camera permission as the Permissions API reports it; `'unknown'` where it cannot tell. */
|
|
9
10
|
type CameraPermissionState = "granted" | "prompt" | "denied" | "unknown";
|
|
@@ -25,4 +26,49 @@ declare function subscribeCameraPermission(listener: (state: CameraPermissionSta
|
|
|
25
26
|
*/
|
|
26
27
|
declare function hasMultipleCameras(): Promise<boolean>;
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
/** A step action refused its input before any network call (nothing was submitted or billed). */
|
|
30
|
+
declare class InvalidInputError extends Error {
|
|
31
|
+
readonly field: "phone" | "code" | "nni";
|
|
32
|
+
readonly kind: "format" | "check_digit";
|
|
33
|
+
constructor(field: "phone" | "code" | "nni", kind: "format" | "check_digit");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* An OTP step action refused its input before any network call (Plan 8; nothing
|
|
37
|
+
* was submitted or billed): the phone OTP `channel` choice is `required`
|
|
38
|
+
* (several channels offered, none chosen) or `unavailable` (not one of the
|
|
39
|
+
* step's channels), or the email OTP `email` address has a bad `format`.
|
|
40
|
+
*/
|
|
41
|
+
declare class OtpInputError extends Error {
|
|
42
|
+
readonly field: "channel" | "email";
|
|
43
|
+
readonly kind: "format" | "required" | "unavailable";
|
|
44
|
+
constructor(field: "channel" | "email", kind: "format" | "required" | "unavailable");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** `true` for exactly 10 ASCII digits whose value ≡ 1 (mod 97). */
|
|
48
|
+
declare function isValidNni(nni: string): boolean;
|
|
49
|
+
/** Strip spaces and dashes; map Arabic-Indic (U+0660–0669) and extended (U+06F0–06F9) digits to ASCII. */
|
|
50
|
+
declare function normalizeNni(input: string): string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The guided rear-camera document scanner for identity cards (ID-1 or ID-2),
|
|
54
|
+
* residence permits and passport data pages of any issuing country. Live camera
|
|
55
|
+
* only; `captured` delivers an upload-ready JPEG per face. The engine loads on
|
|
56
|
+
* the first `start()`.
|
|
57
|
+
*/
|
|
58
|
+
declare function createDocumentCapture(options: DocumentCaptureOptions): DocumentCaptureHandle;
|
|
59
|
+
/** Prefetch the document engine (call when the document step mounts). */
|
|
60
|
+
declare function warmDocumentCapture(): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The ICAO portrait capture for sessions whose selfie is ICAO-checked
|
|
64
|
+
* (`icaoPolicyOf(view)` not null; pass its `policy`): front camera, live
|
|
65
|
+
* per-criterion coaching (pose, eyes against the person's own baseline, mouth,
|
|
66
|
+
* framing, lighting, background, glare, resolution, sharpness) and an
|
|
67
|
+
* automatic full-resolution still once every criterion has held. The server
|
|
68
|
+
* re-checks every criterion. The engine loads on the first `start()`.
|
|
69
|
+
*/
|
|
70
|
+
declare function createPortraitCapture(options: PortraitCaptureOptions): PortraitCaptureHandle;
|
|
71
|
+
/** Prefetch the portrait engine (call when the portrait step mounts). */
|
|
72
|
+
declare function warmPortraitCapture(): void;
|
|
73
|
+
|
|
74
|
+
export { type CameraPermissionState, DocumentCaptureHandle, DocumentCaptureOptions, InvalidInputError, OtpInputError, PortraitCaptureHandle, PortraitCaptureOptions, createDocumentCapture, createPortraitCapture, hasMultipleCameras, isValidNni, normalizeNni, queryCameraPermission, subscribeCameraPermission, warmDocumentCapture, warmPortraitCapture };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { D as DocumentCaptureOptions, a as DocumentCaptureHandle, P as PortraitCaptureOptions, b as PortraitCaptureHandle } from './create-verification-C0AVIcVW.js';
|
|
2
|
+
export { A as AcceptedDocumentsLike, C as CameraFacing, c as CaptureChannel, d as CaptureEngineId, e as CaptureError, f as CaptureErrorKind, g as CaptureState, h as CapturedArtifacts, i as CapturedDocument, j as CapturedPortrait, k as ContactChoiceSnapshot, l as ContactChoiceStepHandle, m as DEFAULT_API_ORIGIN, n as DOCUMENT_TYPE_ORDER, o as DeriveStepEnv, p as DocumentCaptureEvents, q as DocumentCaptureState, r as DocumentFeedback, s as DocumentFeedbackKey, t as DocumentGateUpdate, u as DocumentGuide, v as DocumentGuideMeasure, w as DocumentLiveMrzOptions, x as DocumentMrzUpdate, y as DocumentPoint, z as DocumentQuad, B as DocumentReticle, E as DocumentScanPhase, F as DocumentScanUpdate, G as DocumentSide, H as DocumentSnapshot, I as DocumentStepHandle, J as EidSnapshot, K as EidStepHandle, L as EmailOtpSnapshot, M as EmailOtpStepHandle, N as EmailSource, O as GateHint, Q as GateUpdate, R as ISSUER_CODES, S as IdentitySummarySnapshot, T as IdentitySummaryStepHandle, U as LivePhotoGateUpdate, V as LivePhotoPlan, W as LivenessAssetsStatus, X as LivenessCaptureEvents, Y as LivenessCaptureHandle, Z as LivenessCaptureOptions, _ as LivenessSnapshot, $ as LivenessStartOptions, a0 as LivenessStepHandle, a1 as MethodSnapshot, a2 as MethodStepHandle, a3 as MobileRequiredSnapshot, a4 as MobileRequiredStepHandle, a5 as OtpChannel, a6 as OtpNumberSource, a7 as PLATFORM_UNSUPPORTED, a8 as PhoneOtpSnapshot, a9 as PhoneOtpStepHandle, aa as PortraitCaptureEvents, ab as PortraitCaptureState, ac as PortraitGateUpdate, ad as PortraitSnapshot, ae as PortraitStepHandle, af as PreloadLivenessAssetsOptions, ag as ProcessingSnapshot, ah as ProcessingStepHandle, ai as ReasonCode, aj as RegistrySnapshot, ak as RegistrySource, al as RegistryStepHandle, am as ResultDisplay, an as ResultSnapshot, ao as ResultStepHandle, ap as SdkFailureReason, aq as StepAttempts, ar as StepContext, as as StepSnapshot, at as UnsupportedReason, au as UnsupportedSnapshot, av as UnsupportedStepHandle, aw as Verification, ax as VerificationBusy, ay as VerificationEvents, az as VerificationLocale, aA as VerificationOptions, aB as VerificationResult, aC as VerificationStatus, aD as VerificationStep, aE as WEB_IDENTITY_METHODS, aF as acceptedIssuers, aG as acceptedTypesFor, aH as createLivenessCapture, aI as createVerification, aJ as deriveStep, aK as flagOf, aL as getLivenessAssetsStatus, aM as preloadLivenessAssets, aN as releaseLivenessAssets, aO as resolveAcceptedDocuments, aP as sectionOf, aQ as subscribeLivenessAssets } from './create-verification-C0AVIcVW.js';
|
|
2
3
|
export { OpenHostedOptions, PopupBlocked, PopupHandle, SEKYRO_EVENTS, SekyroEvent, SekyroEventName, openHosted } from './popup/index.js';
|
|
3
|
-
export { HostedApiError, KNOWN_CODES, KnownCode, isKnownCode } from './client/index.js';
|
|
4
|
-
export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView,
|
|
5
|
-
import './detect-worker-
|
|
6
|
-
import './capture-session-v3-
|
|
4
|
+
export { HostedApiError, KNOWN_CODES, KnownCode, icaoPolicyOf, isKnownCode } from './client/index.js';
|
|
5
|
+
export { A as AcceptedDocumentType, C as CheckReason, a as CheckState, b as CheckType, c as ContactChannel, D as DecisionReason, d as DocReason, E as EidAfterPass, e as EidAuthInput, f as EidReason, g as EmailOtpReason, F as FaceMatchReason, H as HeadPose, h as HostedAcceptedDocuments, i as HostedBranding, j as HostedBrandingColorKey, k as HostedCaptureTuning, l as HostedDocumentCaptureTuning, m as HostedDocumentScanTuning, n as HostedEidView, o as HostedEmailOtpView, p as HostedIcaoPolicy, q as HostedIntegrity, r as HostedLivePhotoTuning, s as HostedNativeCaptureTuning, t as HostedOcrTuning, u as HostedOtpView, v as HostedPortraitView, w as HostedSessionView, x as HostedStepView, y as HostedVoiceLocale, z as HostedVoiceView, I as IcaoCaptureTuning, B as IcaoCoachKey, G as IcaoCriterion, J as IcaoCriterionState, K as IcaoGateCriterion, L as IcaoGateSummary, M as IcaoGateUpdate, N as IcaoReportEntry, O as IdentityConfirmDecision, P as IdentityMethod, Q as IdentitySummarySource, R as IdentitySummaryView, S as LivenessReason, T as MatchReason, U as MethodChoiceView, V as NationalEidOption, W as NfcChipReason, X as NfcStepView, Y as OtpChoiceView, Z as PhoneOtpReason, _ as PolicyFailureReason, $ as PopulationReason, a0 as PortraitIcaoInput, a1 as PortraitIcaoReason, a2 as SessionFailureReason, a3 as SessionOutcome, a4 as SessionStatus, a5 as StepSection } from './icao-gate-D8qm1O2t.js';
|
|
6
|
+
import './detect-worker-DclNxkZT.js';
|
|
7
|
+
import './capture-session-v3-CQK-G-qX.js';
|
|
7
8
|
|
|
8
9
|
/** Camera permission as the Permissions API reports it; `'unknown'` where it cannot tell. */
|
|
9
10
|
type CameraPermissionState = "granted" | "prompt" | "denied" | "unknown";
|
|
@@ -25,4 +26,49 @@ declare function subscribeCameraPermission(listener: (state: CameraPermissionSta
|
|
|
25
26
|
*/
|
|
26
27
|
declare function hasMultipleCameras(): Promise<boolean>;
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
/** A step action refused its input before any network call (nothing was submitted or billed). */
|
|
30
|
+
declare class InvalidInputError extends Error {
|
|
31
|
+
readonly field: "phone" | "code" | "nni";
|
|
32
|
+
readonly kind: "format" | "check_digit";
|
|
33
|
+
constructor(field: "phone" | "code" | "nni", kind: "format" | "check_digit");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* An OTP step action refused its input before any network call (Plan 8; nothing
|
|
37
|
+
* was submitted or billed): the phone OTP `channel` choice is `required`
|
|
38
|
+
* (several channels offered, none chosen) or `unavailable` (not one of the
|
|
39
|
+
* step's channels), or the email OTP `email` address has a bad `format`.
|
|
40
|
+
*/
|
|
41
|
+
declare class OtpInputError extends Error {
|
|
42
|
+
readonly field: "channel" | "email";
|
|
43
|
+
readonly kind: "format" | "required" | "unavailable";
|
|
44
|
+
constructor(field: "channel" | "email", kind: "format" | "required" | "unavailable");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** `true` for exactly 10 ASCII digits whose value ≡ 1 (mod 97). */
|
|
48
|
+
declare function isValidNni(nni: string): boolean;
|
|
49
|
+
/** Strip spaces and dashes; map Arabic-Indic (U+0660–0669) and extended (U+06F0–06F9) digits to ASCII. */
|
|
50
|
+
declare function normalizeNni(input: string): string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The guided rear-camera document scanner for identity cards (ID-1 or ID-2),
|
|
54
|
+
* residence permits and passport data pages of any issuing country. Live camera
|
|
55
|
+
* only; `captured` delivers an upload-ready JPEG per face. The engine loads on
|
|
56
|
+
* the first `start()`.
|
|
57
|
+
*/
|
|
58
|
+
declare function createDocumentCapture(options: DocumentCaptureOptions): DocumentCaptureHandle;
|
|
59
|
+
/** Prefetch the document engine (call when the document step mounts). */
|
|
60
|
+
declare function warmDocumentCapture(): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The ICAO portrait capture for sessions whose selfie is ICAO-checked
|
|
64
|
+
* (`icaoPolicyOf(view)` not null; pass its `policy`): front camera, live
|
|
65
|
+
* per-criterion coaching (pose, eyes against the person's own baseline, mouth,
|
|
66
|
+
* framing, lighting, background, glare, resolution, sharpness) and an
|
|
67
|
+
* automatic full-resolution still once every criterion has held. The server
|
|
68
|
+
* re-checks every criterion. The engine loads on the first `start()`.
|
|
69
|
+
*/
|
|
70
|
+
declare function createPortraitCapture(options: PortraitCaptureOptions): PortraitCaptureHandle;
|
|
71
|
+
/** Prefetch the portrait engine (call when the portrait step mounts). */
|
|
72
|
+
declare function warmPortraitCapture(): void;
|
|
73
|
+
|
|
74
|
+
export { type CameraPermissionState, DocumentCaptureHandle, DocumentCaptureOptions, InvalidInputError, OtpInputError, PortraitCaptureHandle, PortraitCaptureOptions, createDocumentCapture, createPortraitCapture, hasMultipleCameras, isValidNni, normalizeNni, queryCameraPermission, subscribeCameraPermission, warmDocumentCapture, warmPortraitCapture };
|
package/dist/index.js
CHANGED
|
@@ -1,85 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SEKYRO_EVENTS,
|
|
3
|
-
openHosted
|
|
4
|
-
} from "./chunk-NILNKLK6.js";
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_API_ORIGIN,
|
|
7
|
-
createLivenessCapture,
|
|
8
|
-
createVerification,
|
|
9
|
-
getLivenessAssetsStatus,
|
|
10
|
-
preloadLivenessAssets,
|
|
11
|
-
releaseLivenessAssets,
|
|
12
|
-
subscribeLivenessAssets
|
|
13
|
-
} from "./chunk-R3SJQHYU.js";
|
|
14
|
-
import "./chunk-TG5IE552.js";
|
|
15
|
-
import {
|
|
16
|
-
HostedApiError,
|
|
17
|
-
KNOWN_CODES,
|
|
18
|
-
isKnownCode
|
|
19
|
-
} from "./chunk-YVFF4Q4G.js";
|
|
20
|
-
import "./chunk-NWF46H7K.js";
|
|
21
|
-
import "./chunk-MWNFSNMP.js";
|
|
22
|
-
|
|
23
|
-
// src/capture/camera-probe.ts
|
|
24
|
-
async function permissionStatus() {
|
|
25
|
-
try {
|
|
26
|
-
if (typeof navigator === "undefined" || typeof navigator.permissions?.query !== "function") return null;
|
|
27
|
-
return await navigator.permissions.query({ name: "camera" });
|
|
28
|
-
} catch {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function asState(state) {
|
|
33
|
-
return state === "granted" || state === "prompt" || state === "denied" ? state : "unknown";
|
|
34
|
-
}
|
|
35
|
-
async function queryCameraPermission() {
|
|
36
|
-
const status = await permissionStatus();
|
|
37
|
-
return status === null ? "unknown" : asState(status.state);
|
|
38
|
-
}
|
|
39
|
-
function subscribeCameraPermission(listener) {
|
|
40
|
-
let stopped = false;
|
|
41
|
-
let status = null;
|
|
42
|
-
const onChange = () => {
|
|
43
|
-
if (!stopped && status !== null) listener(asState(status.state));
|
|
44
|
-
};
|
|
45
|
-
void permissionStatus().then((resolved) => {
|
|
46
|
-
if (stopped) return;
|
|
47
|
-
status = resolved;
|
|
48
|
-
listener(resolved === null ? "unknown" : asState(resolved.state));
|
|
49
|
-
resolved?.addEventListener?.("change", onChange);
|
|
50
|
-
});
|
|
51
|
-
return () => {
|
|
52
|
-
stopped = true;
|
|
53
|
-
status?.removeEventListener?.("change", onChange);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
async function hasMultipleCameras() {
|
|
57
|
-
if (typeof navigator === "undefined") return false;
|
|
58
|
-
const ua = String(navigator.userAgent ?? "");
|
|
59
|
-
if (/Android|iPhone|iPad|iPod/i.test(ua)) return true;
|
|
60
|
-
if (/Macintosh/.test(ua) && (navigator.maxTouchPoints ?? 0) > 1) return true;
|
|
61
|
-
try {
|
|
62
|
-
const devices = await navigator.mediaDevices?.enumerateDevices?.() ?? [];
|
|
63
|
-
return devices.filter((device) => device.kind === "videoinput").length >= 2;
|
|
64
|
-
} catch {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export {
|
|
69
|
-
DEFAULT_API_ORIGIN,
|
|
70
|
-
HostedApiError,
|
|
71
|
-
KNOWN_CODES,
|
|
72
|
-
SEKYRO_EVENTS,
|
|
73
|
-
createLivenessCapture,
|
|
74
|
-
createVerification,
|
|
75
|
-
getLivenessAssetsStatus,
|
|
76
|
-
hasMultipleCameras,
|
|
77
|
-
isKnownCode,
|
|
78
|
-
openHosted,
|
|
79
|
-
preloadLivenessAssets,
|
|
80
|
-
queryCameraPermission,
|
|
81
|
-
releaseLivenessAssets,
|
|
82
|
-
subscribeCameraPermission,
|
|
83
|
-
subscribeLivenessAssets
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as K,c as q}from"./chunk-SXZCL5NO.js";import{a as M,f as b,h as G,i as f,j as C,k as S,l as v,m as D,n as U,o as z,p as F,r as _}from"./chunk-XLN5OT25.js";import{s as m,t as y}from"./chunk-YDQBVWXG.js";import{e as L,f as R,g as I,h as A,n as w}from"./chunk-RVHAKRAI.js";import"./chunk-7V2M6Y2W.js";import"./chunk-DQWW4OCK.js";import"./chunk-POIQGEZM.js";import"./chunk-FHJ7HO3M.js";import"./chunk-FPXL63KZ.js";import{a as T,b as V,c as k,f as N}from"./chunk-4RS2YIL4.js";import"./chunk-LQ7C44JG.js";import"./chunk-OKWG3PVH.js";async function P(){try{return typeof navigator>"u"||typeof navigator.permissions?.query!="function"?null:await navigator.permissions.query({name:"camera"})}catch{return null}}function l(t){return t==="granted"||t==="prompt"||t==="denied"?t:"unknown"}async function B(){let t=await P();return t===null?"unknown":l(t.state)}function Y(t){let e=!1,o=null,r=()=>{!e&&o!==null&&t(l(o.state))};return P().then(i=>{e||(o=i,t(i===null?"unknown":l(i.state)),i?.addEventListener?.("change",r))}),()=>{e=!0,o?.removeEventListener?.("change",r)}}async function W(){if(typeof navigator>"u")return!1;let t=String(navigator.userAgent??"");if(/Android|iPhone|iPad|iPod/i.test(t)||/Macintosh/.test(t)&&(navigator.maxTouchPoints??0)>1)return!0;try{return(await navigator.mediaDevices?.enumerateDevices?.()??[]).filter(o=>o.kind==="videoinput").length>=2}catch{return!1}}function Q(t){return/^\d{10}$/.test(t)&&Number(t)%97===1}function $(t){let e="";for(let o of t){let r=o.codePointAt(0)??0;r>=1632&&r<=1641?e+=String(r-1632):r>=1776&&r<=1785?e+=String(r-1776):o!==" "&&o!=="-"&&o!=="\xA0"&&(e+=o)}return e}var pe=f,ue=C,ce=S,de=v,le=D;var h=()=>import("./create-document-capture-T4APHJMY.js");function H(t){let e=null,o=null,r=!1,i=null,c=null,d=[],a=(n,s)=>{n.off=s.on(n.event,n.handler)},p=()=>(o??(o=h().then(n=>{if(r)return null;let s=n.createDocumentCaptureInternal(t,{}).handle;for(let u of d)u.removed||a(u,s);return i!==null&&s.setSide(i),c!==null&&s.setGuide(c.guide),e=s,s})),o);return{get state(){return e?.state??"idle"},on:(n,s)=>{let u={event:n,handler:s,off:null,removed:!1};return d.push(u),e!==null&&a(u,e),()=>{u.removed=!0,u.off?.()}},start:async()=>{let n=await p();n!==null&&!r&&await n.start()},retry:()=>{e!==null?e.retry():p().then(n=>n?.start())},setSide:n=>{e!==null?e.setSide(n):i=n},shutter:()=>e?.shutter(),setTorch:n=>e?.setTorch(n),focusAt:(n,s)=>e?.focusAt(n,s),setGuide:n=>{e!==null?e.setGuide(n):c={guide:n}},destroy:()=>{r=!0,e?.destroy(),e=null,d.length=0}}}function g(){h().then(t=>t.warmDocumentCapture()).catch(()=>{})}function Se(t){return H(t)}function ve(){g()}var E=()=>import("./create-portrait-capture-B57GE5FU.js");function x(t){let e=null,o=null,r=!1,i=[],c=(a,p)=>{a.off=p.on(a.event,a.handler)},d=()=>(o??(o=E().then(a=>{if(r)return null;let p=a.createPortraitCaptureInternal(t).handle;for(let n of i)n.removed||c(n,p);return e=p,p})),o);return{get state(){return e?.state??"idle"},on:(a,p)=>{let n={event:a,handler:p,off:null,removed:!1};return i.push(n),e!==null&&c(n,e),()=>{n.removed=!0,n.off?.()}},start:async()=>{let a=await d();a!==null&&!r&&await a.start()},retry:()=>{e!==null?e.retry():d().then(a=>a?.start())},destroy:()=>{r=!0,e?.destroy(),e=null,i.length=0}}}function O(){E().then(t=>t.warmPortraitCapture()).catch(()=>{})}function ge(t){return x(t)}function Ee(){O()}export{M as DEFAULT_API_ORIGIN,pe as DOCUMENT_TYPE_ORDER,k as HostedApiError,G as ISSUER_CODES,m as InvalidInputError,T as KNOWN_CODES,y as OtpInputError,z as PLATFORM_UNSUPPORTED,K as SEKYRO_EVENTS,U as WEB_IDENTITY_METHODS,ce as acceptedIssuers,ue as acceptedTypesFor,Se as createDocumentCapture,w as createLivenessCapture,ge as createPortraitCapture,b as createVerification,_ as deriveStep,le as flagOf,R as getLivenessAssetsStatus,W as hasMultipleCameras,N as icaoPolicyOf,V as isKnownCode,Q as isValidNni,$ as normalizeNni,q as openHosted,L as preloadLivenessAssets,B as queryCameraPermission,A as releaseLivenessAssets,de as resolveAcceptedDocuments,F as sectionOf,Y as subscribeCameraPermission,I as subscribeLivenessAssets,ve as warmDocumentCapture,Ee as warmPortraitCapture};
|