@baas-id/react 0.2.2
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/LICENSE.md +176 -0
- package/README.md +171 -0
- package/THIRD_PARTY_NOTICES.md +44 -0
- package/dist/esm/baas-id-react.css +1 -0
- package/dist/esm/chunks/ContinueFlow-YFSpSOio.js +7500 -0
- package/dist/esm/continue.js +10 -0
- package/dist/esm/index.js +218 -0
- package/dist/esm/preview.js +368 -0
- package/dist/esm/workers/detector.worker-DtuL8TFY.js +22435 -0
- package/dist/types/continue.d.ts +3 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/preview.d.ts +5 -0
- package/dist/types/react/DocumentCapture.d.ts +27 -0
- package/dist/types/react/FaceCapture.d.ts +19 -0
- package/dist/types/react/capture/ProximityMeter.d.ts +9 -0
- package/dist/types/react/capture/TurnGauge.d.ts +12 -0
- package/dist/types/react/capture/YawDial.d.ts +6 -0
- package/dist/types/react/capture/api.d.ts +50 -0
- package/dist/types/react/capture/attestation.d.ts +32 -0
- package/dist/types/react/capture/binding.d.ts +51 -0
- package/dist/types/react/capture/camera.d.ts +4 -0
- package/dist/types/react/capture/chrome.d.ts +24 -0
- package/dist/types/react/capture/demo.d.ts +2 -0
- package/dist/types/react/capture/errors.d.ts +18 -0
- package/dist/types/react/capture/frames.d.ts +18 -0
- package/dist/types/react/capture/index.d.ts +15 -0
- package/dist/types/react/capture/integrity.d.ts +32 -0
- package/dist/types/react/capture/keyframes.d.ts +19 -0
- package/dist/types/react/capture/overlays.d.ts +10 -0
- package/dist/types/react/capture/run.d.ts +14 -0
- package/dist/types/react/capture/useCaptureRun.d.ts +4 -0
- package/dist/types/react/document/CardFrame.d.ts +10 -0
- package/dist/types/react/document/DocumentParts.d.ts +49 -0
- package/dist/types/react/document/advisory.d.ts +47 -0
- package/dist/types/react/document/bestFrames.d.ts +18 -0
- package/dist/types/react/document/cues.d.ts +28 -0
- package/dist/types/react/document/flow.d.ts +52 -0
- package/dist/types/react/document/gate.d.ts +114 -0
- package/dist/types/react/document/latch.d.ts +25 -0
- package/dist/types/react/document/mrz.d.ts +29 -0
- package/dist/types/react/document/overlay.d.ts +52 -0
- package/dist/types/react/document/quad.d.ts +5 -0
- package/dist/types/react/document/resolution.d.ts +42 -0
- package/dist/types/react/document/review.d.ts +50 -0
- package/dist/types/react/document/sideCheck.d.ts +32 -0
- package/dist/types/react/document/telemetry.d.ts +14 -0
- package/dist/types/react/document/track.d.ts +36 -0
- package/dist/types/react/document/useDocumentCapture.d.ts +78 -0
- package/dist/types/react/face/FaceGuide.d.ts +22 -0
- package/dist/types/react/face/FaceParts.d.ts +15 -0
- package/dist/types/react/face/faceMesh.d.ts +68 -0
- package/dist/types/react/face/faceRegion.d.ts +16 -0
- package/dist/types/react/face/faceView.d.ts +21 -0
- package/dist/types/react/face/meshBench.d.ts +7 -0
- package/dist/types/react/face/meshCanvas.d.ts +20 -0
- package/dist/types/react/face/qualityGate.d.ts +59 -0
- package/dist/types/react/face/runLiveness.d.ts +37 -0
- package/dist/types/react/face/scanState.d.ts +40 -0
- package/dist/types/react/face/upload.d.ts +14 -0
- package/dist/types/react/face/useFaceCapture.d.ts +45 -0
- package/dist/types/react/flows/ConsentStep.d.ts +8 -0
- package/dist/types/react/flows/EnrollmentFlow.d.ts +2 -0
- package/dist/types/react/flows/FlowResult.d.ts +13 -0
- package/dist/types/react/flows/FlowShell.d.ts +48 -0
- package/dist/types/react/flows/IdentifyFlow.d.ts +2 -0
- package/dist/types/react/flows/ReverificationFlow.d.ts +2 -0
- package/dist/types/react/flows/SignInFlow.d.ts +2 -0
- package/dist/types/react/flows/StepIntro.d.ts +10 -0
- package/dist/types/react/flows/VerificationFlow.d.ts +4 -0
- package/dist/types/react/flows/experience.d.ts +35 -0
- package/dist/types/react/flows/failureDetail.d.ts +12 -0
- package/dist/types/react/flows/index.d.ts +6 -0
- package/dist/types/react/flows/session.d.ts +5 -0
- package/dist/types/react/flows/state.d.ts +106 -0
- package/dist/types/react/flows/types.d.ts +255 -0
- package/dist/types/react/flows/useFlowSession.d.ts +21 -0
- package/dist/types/react/flows.d.ts +1 -0
- package/dist/types/react/handoff/ContinueFlow.d.ts +28 -0
- package/dist/types/react/handoff/ContinueOnPhone.d.ts +60 -0
- package/dist/types/react/handoff/api.d.ts +41 -0
- package/dist/types/react/handoff/qr.d.ts +9 -0
- package/dist/types/react/hooks.d.ts +7 -0
- package/dist/types/react/i18n/en.d.ts +3 -0
- package/dist/types/react/i18n/es-419.d.ts +3 -0
- package/dist/types/react/i18n/index.d.ts +10 -0
- package/dist/types/react/i18n/types.d.ts +250 -0
- package/dist/types/react/icons.d.ts +25 -0
- package/dist/types/react/liveness/challenges.d.ts +26 -0
- package/dist/types/react/liveness/framing.d.ts +33 -0
- package/dist/types/react/liveness/index.d.ts +8 -0
- package/dist/types/react/liveness/nod.d.ts +4 -0
- package/dist/types/react/liveness/scoring.d.ts +29 -0
- package/dist/types/react/liveness/script.d.ts +7 -0
- package/dist/types/react/liveness/signals.d.ts +38 -0
- package/dist/types/react/liveness/timing.d.ts +20 -0
- package/dist/types/react/liveness/turn.d.ts +18 -0
- package/dist/types/react/preview/FlowPreview.d.ts +34 -0
- package/dist/types/react/preview/contrast.d.ts +17 -0
- package/dist/types/react/preview/specimen.d.ts +35 -0
- package/dist/types/react/styles/index.d.ts +0 -0
- package/dist/types/react/telemetry/bus.d.ts +13 -0
- package/dist/types/react/telemetry/device.d.ts +66 -0
- package/dist/types/react/telemetry/reporter.d.ts +27 -0
- package/dist/types/react/theme/appearance.d.ts +22 -0
- package/dist/types/react/version.d.ts +1 -0
- package/dist/types/react/vision/authenticity.d.ts +43 -0
- package/dist/types/react/vision/authenticityPixels.d.ts +6 -0
- package/dist/types/react/vision/authenticitySpecular.d.ts +2 -0
- package/dist/types/react/vision/cardCorners.d.ts +21 -0
- package/dist/types/react/vision/cardDetector.d.ts +15 -0
- package/dist/types/react/vision/cornerGeometry.d.ts +10 -0
- package/dist/types/react/vision/cornerImage.d.ts +34 -0
- package/dist/types/react/vision/cornerLines.d.ts +12 -0
- package/dist/types/react/vision/cornerScore.d.ts +17 -0
- package/dist/types/react/vision/corners.d.ts +60 -0
- package/dist/types/react/vision/detector.worker.d.ts +1 -0
- package/dist/types/react/vision/document.d.ts +13 -0
- package/dist/types/react/vision/engine.d.ts +5 -0
- package/dist/types/react/vision/face.d.ts +17 -0
- package/dist/types/react/vision/index.d.ts +7 -0
- package/dist/types/react/vision/modelCache.d.ts +16 -0
- package/dist/types/react/vision/modelsCdn.d.ts +4 -0
- package/dist/types/react/vision/quality.d.ts +10 -0
- package/dist/types/react/vision/sideClassifier.d.ts +4 -0
- package/dist/types/react/vision/tinyCore.d.ts +21 -0
- package/dist/types/react/vision/tinyDetector.d.ts +36 -0
- package/dist/types/react/vision/types.d.ts +62 -0
- package/dist/types/react/vision/warp.d.ts +18 -0
- package/package.json +104 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export type Locale = "en" | "es-419";
|
|
2
|
+
export type ClientReason = "CAMERA_UNAVAILABLE" | "ENGINE_UNAVAILABLE" | "UPLOAD_FAILED" | "SESSION_OPEN_FAILED" | "MOVEMENT_TIMEOUT" | "RECENTER_TIMEOUT" | "MOIRE_SUSPECTED" | "SPOOF_SUSPECTED" | "MOVEMENT_DISCONTINUOUS" | "PATTERN_SUSPECTED" | "LOW_QUALITY" | "DOC_DAMAGED_REPEATED";
|
|
3
|
+
export type ServerReason = "DOC_QUALITY_LOW" | "DOC_SIDE_MISMATCH" | "PORTRAIT_NOT_FOUND" | "FACE_MISMATCH" | "TEMPLATE_STALE" | "FACE_NOT_FOUND" | "FACE_MISSING" | "DOCUMENT_MISSING" | "PAD_REJECTED" | "NOT_ENROLLED" | "ALREADY_ENROLLED" | "SESSION_EXPIRED" | "SESSION_FINALIZED" | "SESSION_NOT_FOUND" | "WRONG_PURPOSE" | "CAPTURE_TOKEN_INVALID" | "CAPTURE_TOKEN_EXPIRED" | "CAPTURE_TOKEN_SESSION_MISMATCH" | "CREDENTIALS_REQUIRED" | "INVALID_API_KEY" | "RPID_UNREACHABLE" | "RETRIES_EXHAUSTED" | "FACE_RETRY" | "AI_ASSESSMENT" | "DOC_SCREEN_REPLAY" | "DOC_PAPER_COPY" | "DOC_TAMPERED" | "DOC_DAMAGED" | "DOC_SIDES_INCONSISTENT" | "DOC_FIELDS_CHANGED" | "DUPLICATE_SUSPECT" | "MATCH_FOUND" | "NO_MATCH" | "AMBIGUOUS_MATCH" | "DOC_BACK_MISMATCH" | "DOC_BACK_UNREADABLE" | "REPLAY_SUSPECTED" | "INJECTION_SUSPECTED" | "CHALLENGE_UNVERIFIED" | "PAD_SUSPECTED" | "HANDOFF_CODE_INVALID" | "HANDOFF_CODE_EXPIRED" | "HANDOFF_CODE_USED" | "HANDOFF_REVOKED" | "HANDOFF_ACTIVE" | "HANDOFF_DISABLED" | "HANDOFF_ALREADY_CLAIMED" | "HANDOFF_RATE_LIMITED" | "CAPTURE_TOKEN_REVOKED";
|
|
4
|
+
export type Reason = ClientReason | ServerReason;
|
|
5
|
+
export type Recovery = "retry" | "restart" | "support";
|
|
6
|
+
export interface ReasonEntry {
|
|
7
|
+
message: string;
|
|
8
|
+
recovery: Recovery;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
export type GuideKey = "no_face" | "no_card" | "too_dark" | "too_bright" | "hold_still" | "move_closer" | "move_back" | "recenter" | "perfect" | "ready" | "find_light" | "look_straight" | "loading" | "too_far" | "bad_framing" | "screen_suspected" | "paper_suspected" | "tilt_less" | "low_contrast" | "wrong_side_front" | "wrong_side_back" | "blurred" | "glare" | "steady" | "uploading" | "mrz_reading" | "mrz_unreadable" | "mrz_verified" | "closer_more" | "done_short" | "abrupt" | "a_bit_more" | "nod_start" | "nod_return" | "turn_left" | "turn_right" | "turn_wrong_left" | "turn_wrong_right" | "turn_slower" | "turn_lost" | "turn_return_center" | "turn_done" | "turn_hold_steady" | "turn_going_well" | "turn_almost" | "turn_complete" | "recenter_front" | "recenter_center" | "try_other_movement";
|
|
12
|
+
export type EngineStage = "starting" | "downloading" | "warming" | "downloading_face" | "ready";
|
|
13
|
+
export type DistanceHint = "too_far" | "bit_far" | "ideal" | "bit_close" | "too_close";
|
|
14
|
+
export interface Strings {
|
|
15
|
+
reasons: Record<Reason, ReasonEntry>;
|
|
16
|
+
guide: Record<GuideKey, string>;
|
|
17
|
+
engine: Record<EngineStage, string>;
|
|
18
|
+
distance: Record<DistanceHint, string>;
|
|
19
|
+
challenge: Record<"turn_left" | "turn_right" | "move_closer" | "blink_x2" | "nod", string>;
|
|
20
|
+
meter: {
|
|
21
|
+
centered: string;
|
|
22
|
+
centeredAria: string;
|
|
23
|
+
distance: string;
|
|
24
|
+
distanceAria: string;
|
|
25
|
+
near: string;
|
|
26
|
+
far: string;
|
|
27
|
+
};
|
|
28
|
+
turn: {
|
|
29
|
+
turningLeft: string;
|
|
30
|
+
turningRight: string;
|
|
31
|
+
towardLeft: string;
|
|
32
|
+
towardRight: string;
|
|
33
|
+
progressAria: string;
|
|
34
|
+
};
|
|
35
|
+
loading: {
|
|
36
|
+
note: string;
|
|
37
|
+
progressAria: string;
|
|
38
|
+
processing: string;
|
|
39
|
+
processingNote: string;
|
|
40
|
+
processingAria: string;
|
|
41
|
+
};
|
|
42
|
+
chip: {
|
|
43
|
+
sharpness: string;
|
|
44
|
+
glare: string;
|
|
45
|
+
light: string;
|
|
46
|
+
gloss: string;
|
|
47
|
+
front: string;
|
|
48
|
+
back: string;
|
|
49
|
+
};
|
|
50
|
+
tele: {
|
|
51
|
+
engineStarting: string;
|
|
52
|
+
loadingModels: string;
|
|
53
|
+
loadingFaceDetector: string;
|
|
54
|
+
engineReady: string;
|
|
55
|
+
detectorUnavailable: string;
|
|
56
|
+
searchingDoc: string;
|
|
57
|
+
uploadingDoc: string;
|
|
58
|
+
uploadingCapture: string;
|
|
59
|
+
centerFace: string;
|
|
60
|
+
side: string;
|
|
61
|
+
front: string;
|
|
62
|
+
back: string;
|
|
63
|
+
sharpness: string;
|
|
64
|
+
glare: string;
|
|
65
|
+
light: string;
|
|
66
|
+
face: string;
|
|
67
|
+
centered: string;
|
|
68
|
+
inside: string;
|
|
69
|
+
area: string;
|
|
70
|
+
challenge: string;
|
|
71
|
+
progress: string;
|
|
72
|
+
recentering: string;
|
|
73
|
+
id: string;
|
|
74
|
+
focus: string;
|
|
75
|
+
moire: string;
|
|
76
|
+
framing: string;
|
|
77
|
+
ok: string;
|
|
78
|
+
mrz: string;
|
|
79
|
+
reading: string;
|
|
80
|
+
verified: string;
|
|
81
|
+
unreadable: string;
|
|
82
|
+
none: string;
|
|
83
|
+
grid: string;
|
|
84
|
+
gloss: string;
|
|
85
|
+
static: string;
|
|
86
|
+
corner: string;
|
|
87
|
+
texture: string;
|
|
88
|
+
screenCue: string;
|
|
89
|
+
paperCue: string;
|
|
90
|
+
};
|
|
91
|
+
doc: {
|
|
92
|
+
shutter: string;
|
|
93
|
+
shutterNote: string;
|
|
94
|
+
detected: string;
|
|
95
|
+
captured: string;
|
|
96
|
+
cardFound: string;
|
|
97
|
+
edgesLocked: string;
|
|
98
|
+
photoTaken: string;
|
|
99
|
+
stepsAria: string;
|
|
100
|
+
stepOf: string;
|
|
101
|
+
stepDone: string;
|
|
102
|
+
stepCurrent: string;
|
|
103
|
+
reviewTitle: string;
|
|
104
|
+
reviewNone: string;
|
|
105
|
+
verify: string;
|
|
106
|
+
confirmed: string;
|
|
107
|
+
confirmTitle: string;
|
|
108
|
+
confirmTitleFront: string;
|
|
109
|
+
confirmTitleBack: string;
|
|
110
|
+
confirmHint: string;
|
|
111
|
+
confirmNote: string;
|
|
112
|
+
confirmUse: string;
|
|
113
|
+
confirmRetake: string;
|
|
114
|
+
confirmAria: string;
|
|
115
|
+
regionPortrait: string;
|
|
116
|
+
regionCode: string;
|
|
117
|
+
fieldName: string;
|
|
118
|
+
fieldNumber: string;
|
|
119
|
+
fieldBirth: string;
|
|
120
|
+
fieldExpiry: string;
|
|
121
|
+
};
|
|
122
|
+
retake: {
|
|
123
|
+
action: string;
|
|
124
|
+
continue: string;
|
|
125
|
+
notFrontTitle: string;
|
|
126
|
+
notFrontBody: string;
|
|
127
|
+
notBackTitle: string;
|
|
128
|
+
notBackBody: string;
|
|
129
|
+
noPortraitTitle: string;
|
|
130
|
+
noPortraitBody: string;
|
|
131
|
+
backMismatchTitle: string;
|
|
132
|
+
backMismatchBody: string;
|
|
133
|
+
frontMismatchTitle: string;
|
|
134
|
+
frontMismatchBody: string;
|
|
135
|
+
unverifiedTitle: string;
|
|
136
|
+
unverifiedBody: string;
|
|
137
|
+
mismatchFields: string;
|
|
138
|
+
pending: string;
|
|
139
|
+
finalTitle: string;
|
|
140
|
+
};
|
|
141
|
+
face: {
|
|
142
|
+
ovalAria: string;
|
|
143
|
+
aligned: string;
|
|
144
|
+
capturing: string;
|
|
145
|
+
done: string;
|
|
146
|
+
verifying: string;
|
|
147
|
+
locked: string;
|
|
148
|
+
stepDone: string;
|
|
149
|
+
};
|
|
150
|
+
intro: {
|
|
151
|
+
frontTitle: string;
|
|
152
|
+
frontBody: string;
|
|
153
|
+
backTitle: string;
|
|
154
|
+
backBody: string;
|
|
155
|
+
faceTitle: string;
|
|
156
|
+
faceBody: string;
|
|
157
|
+
needs: string;
|
|
158
|
+
start: string;
|
|
159
|
+
timeMovements: string;
|
|
160
|
+
timeMovementsOne: string;
|
|
161
|
+
timeNone: string;
|
|
162
|
+
timeSession: string;
|
|
163
|
+
};
|
|
164
|
+
handoff: {
|
|
165
|
+
title: string;
|
|
166
|
+
lede: string;
|
|
167
|
+
why1: string;
|
|
168
|
+
why2: string;
|
|
169
|
+
why3: string;
|
|
170
|
+
scan: string;
|
|
171
|
+
qrAlt: string;
|
|
172
|
+
linkLabel: string;
|
|
173
|
+
copy: string;
|
|
174
|
+
copied: string;
|
|
175
|
+
copyFailed: string;
|
|
176
|
+
validFor: string;
|
|
177
|
+
expired: string;
|
|
178
|
+
newCode: string;
|
|
179
|
+
creating: string;
|
|
180
|
+
createFailed: string;
|
|
181
|
+
retry: string;
|
|
182
|
+
forTenant: string;
|
|
183
|
+
codeHint: string;
|
|
184
|
+
continueHere: string;
|
|
185
|
+
cancel: string;
|
|
186
|
+
waiting: string;
|
|
187
|
+
connected: string;
|
|
188
|
+
capturing: string;
|
|
189
|
+
finished: string;
|
|
190
|
+
keepOpen: string;
|
|
191
|
+
stepWaiting: string;
|
|
192
|
+
stepConnected: string;
|
|
193
|
+
stepCapturing: string;
|
|
194
|
+
statusAria: string;
|
|
195
|
+
regenerateAria: string;
|
|
196
|
+
phoneTitle: string;
|
|
197
|
+
phoneBody: string;
|
|
198
|
+
phoneWarning: string;
|
|
199
|
+
phoneContinue: string;
|
|
200
|
+
phoneChecking: string;
|
|
201
|
+
doneTitle: string;
|
|
202
|
+
doneBody: string;
|
|
203
|
+
linkErrorTitle: string;
|
|
204
|
+
};
|
|
205
|
+
flow: {
|
|
206
|
+
stepFront: string;
|
|
207
|
+
stepBack: string;
|
|
208
|
+
stepFace: string;
|
|
209
|
+
titleFront: string;
|
|
210
|
+
titleBack: string;
|
|
211
|
+
titleFace: string;
|
|
212
|
+
titleSignIn: string;
|
|
213
|
+
opening: string;
|
|
214
|
+
finalizing: string;
|
|
215
|
+
serverDecides: string;
|
|
216
|
+
enrolled: string;
|
|
217
|
+
signedIn: string;
|
|
218
|
+
retry: string;
|
|
219
|
+
restart: string;
|
|
220
|
+
supportHint: string;
|
|
221
|
+
failedTitle: string;
|
|
222
|
+
pending: string;
|
|
223
|
+
privacy: string;
|
|
224
|
+
consentTitle: string;
|
|
225
|
+
consentContinue: string;
|
|
226
|
+
consentLearnMore: string;
|
|
227
|
+
assurance: string;
|
|
228
|
+
match: string;
|
|
229
|
+
policy: string;
|
|
230
|
+
assuranceBasic: string;
|
|
231
|
+
attemptsLeft: string;
|
|
232
|
+
lastAttempt: string;
|
|
233
|
+
faceRetry: string;
|
|
234
|
+
faceRetryLast: string;
|
|
235
|
+
underReview: string;
|
|
236
|
+
titleReverify: string;
|
|
237
|
+
reverifyNote: string;
|
|
238
|
+
reverifyNoteFace: string;
|
|
239
|
+
reverified: string;
|
|
240
|
+
titleIdentify: string;
|
|
241
|
+
identifying: string;
|
|
242
|
+
identified: string;
|
|
243
|
+
noMatch: string;
|
|
244
|
+
ambiguousMatch: string;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
export type StringOverrides = {
|
|
248
|
+
[K in keyof Strings]?: Partial<Strings[K]>;
|
|
249
|
+
};
|
|
250
|
+
export type TeleRecipe = (s: Strings) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SVGProps } from "react";
|
|
2
|
+
export declare const CheckIcon: (p: SVGProps<SVGSVGElement> & {
|
|
3
|
+
size?: number;
|
|
4
|
+
}) => import("react").JSX.Element;
|
|
5
|
+
export declare const CardIcon: (p: SVGProps<SVGSVGElement> & {
|
|
6
|
+
size?: number;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
export declare const FaceIcon: (p: SVGProps<SVGSVGElement> & {
|
|
9
|
+
size?: number;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
export declare const AlertIcon: (p: SVGProps<SVGSVGElement> & {
|
|
12
|
+
size?: number;
|
|
13
|
+
}) => import("react").JSX.Element;
|
|
14
|
+
export declare const RotateIcon: (p: SVGProps<SVGSVGElement> & {
|
|
15
|
+
size?: number;
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
export declare const ShieldIcon: (p: SVGProps<SVGSVGElement> & {
|
|
18
|
+
size?: number;
|
|
19
|
+
}) => import("react").JSX.Element;
|
|
20
|
+
export declare const ClockIcon: (p: SVGProps<SVGSVGElement> & {
|
|
21
|
+
size?: number;
|
|
22
|
+
}) => import("react").JSX.Element;
|
|
23
|
+
export declare const PhoneIcon: (p: SVGProps<SVGSVGElement> & {
|
|
24
|
+
size?: number;
|
|
25
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GuideKey } from "../i18n";
|
|
2
|
+
import type { ChallengeKind, FaceSignals } from "./signals";
|
|
3
|
+
export declare const CLOSER_GROWTH = 1.28;
|
|
4
|
+
export declare const RECENTER_YAW = 0.25;
|
|
5
|
+
export interface ChallengeUpdate {
|
|
6
|
+
done: boolean;
|
|
7
|
+
feedbackKey: GuideKey;
|
|
8
|
+
progress: number;
|
|
9
|
+
peak: number;
|
|
10
|
+
jumps?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface Challenge {
|
|
13
|
+
kind: ChallengeKind;
|
|
14
|
+
update(sig: FaceSignals): ChallengeUpdate;
|
|
15
|
+
}
|
|
16
|
+
export interface Evidence {
|
|
17
|
+
peak: number;
|
|
18
|
+
jumps: number;
|
|
19
|
+
}
|
|
20
|
+
export type StepResult = Pick<ChallengeUpdate, "done" | "feedbackKey" | "progress">;
|
|
21
|
+
export declare function createChallenge(kind: ChallengeKind, baseline: {
|
|
22
|
+
faceFrac: number;
|
|
23
|
+
}): Challenge;
|
|
24
|
+
export declare function createRecenter(): {
|
|
25
|
+
update(sig: FaceSignals): ChallengeUpdate;
|
|
26
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FaceSignals } from "./signals";
|
|
2
|
+
export declare const FACE_W_MIN = 0.27;
|
|
3
|
+
export declare const FACE_W_MAX = 0.68;
|
|
4
|
+
export declare const FACE_W_COMFORT_MIN = 0.34;
|
|
5
|
+
export declare const FACE_W_COMFORT_MAX = 0.54;
|
|
6
|
+
export declare function faceWidthOf(s: {
|
|
7
|
+
faceW?: number;
|
|
8
|
+
faceFrac: number;
|
|
9
|
+
}): number;
|
|
10
|
+
export declare const CENTER_OFFSET_TOL = 0.6;
|
|
11
|
+
export declare const CENTER_MIN = 0.6;
|
|
12
|
+
export declare const CONTAIN_MIN = 0.9;
|
|
13
|
+
export declare const RECENTER_CENTERING = 0.6;
|
|
14
|
+
export declare function centeringFrom(faceCx: number, faceCy: number, oval: {
|
|
15
|
+
cx: number;
|
|
16
|
+
cy: number;
|
|
17
|
+
rx: number;
|
|
18
|
+
ry: number;
|
|
19
|
+
}): number;
|
|
20
|
+
export type CenterBlocker = "no_face" | "too_dark" | "too_bright" | "move_closer" | "move_back" | "hold_still" | "recenter";
|
|
21
|
+
export declare function centerBlocker(input: {
|
|
22
|
+
found: boolean;
|
|
23
|
+
lighting: FaceSignals["lighting"];
|
|
24
|
+
centering: number;
|
|
25
|
+
fill: number;
|
|
26
|
+
faceW: number;
|
|
27
|
+
unsteady: boolean;
|
|
28
|
+
}): CenterBlocker | null;
|
|
29
|
+
export type Proximity = "far" | "good" | "close";
|
|
30
|
+
export declare function proximityOf(faceW: number): Proximity;
|
|
31
|
+
export type DistanceHint = "too_far" | "bit_far" | "ideal" | "bit_close" | "too_close";
|
|
32
|
+
export declare function distanceHintOf(faceW: number): DistanceHint;
|
|
33
|
+
export declare function distanceTrackPos(faceW: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { signalsFromFace, type ChallengeKind, type FaceSignals, type FaceGeometry } from "./signals";
|
|
2
|
+
export { FACE_W_MIN, FACE_W_MAX, FACE_W_COMFORT_MIN, FACE_W_COMFORT_MAX, faceWidthOf, CENTER_OFFSET_TOL, CENTER_MIN, CONTAIN_MIN, RECENTER_CENTERING, centeringFrom, centerBlocker, proximityOf, distanceHintOf, distanceTrackPos, type CenterBlocker, type Proximity, type DistanceHint, } from "./framing";
|
|
3
|
+
export { YAW_TARGET, YAW_CONFIDENCE_MIN, YAW_MAX_STEP, JUMP_HELD_TOL, YAW_POSITIVE_SIDE, stepJump, isTurn, type JumpState, type TurnSide, } from "./turn";
|
|
4
|
+
export { NOD_TARGET } from "./nod";
|
|
5
|
+
export { CLOSER_GROWTH, RECENTER_YAW, createChallenge, createRecenter, type Challenge, type ChallengeUpdate, } from "./challenges";
|
|
6
|
+
export { LivenessTracker, periodicityScore, padVerdict, MOIRE_FACE_MAX, MOIRE_DOC_MAX, type PadSummary, } from "./scoring";
|
|
7
|
+
export { ISSUABLE, parseChallengeScript, alternateChallenge, shuffle, type Rng } from "./script";
|
|
8
|
+
export * from "./timing";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FaceSignals } from "./signals";
|
|
2
|
+
export declare class LivenessTracker {
|
|
3
|
+
private prev;
|
|
4
|
+
private motionSum;
|
|
5
|
+
private motionN;
|
|
6
|
+
private parallaxMax;
|
|
7
|
+
private yawExtent;
|
|
8
|
+
private pitchMin;
|
|
9
|
+
private pitchMax;
|
|
10
|
+
private yawJumps;
|
|
11
|
+
private jumpSt;
|
|
12
|
+
lastJitter: number;
|
|
13
|
+
ingest(sig: FaceSignals): void;
|
|
14
|
+
summary(): {
|
|
15
|
+
motion: number;
|
|
16
|
+
parallax: number;
|
|
17
|
+
yaw_extent: number;
|
|
18
|
+
pitch_extent: number;
|
|
19
|
+
yaw_jumps: number;
|
|
20
|
+
frozen: boolean;
|
|
21
|
+
flat: boolean;
|
|
22
|
+
cut: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function periodicityScore(gray: Float32Array, w: number, h: number): number;
|
|
26
|
+
export declare const MOIRE_FACE_MAX = 0.5;
|
|
27
|
+
export declare const MOIRE_DOC_MAX = 0.55;
|
|
28
|
+
export type PadSummary = ReturnType<LivenessTracker["summary"]>;
|
|
29
|
+
export declare function padVerdict(pad: Pick<PadSummary, "frozen" | "flat" | "cut">, moire: number): "SPOOF_SUSPECTED" | "MOVEMENT_DISCONTINUOUS" | "PATTERN_SUSPECTED" | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChallengeKind } from "./signals";
|
|
2
|
+
export declare const ISSUABLE: readonly ChallengeKind[];
|
|
3
|
+
export declare const FALLBACK_SCRIPT: readonly ChallengeKind[];
|
|
4
|
+
export type Rng = () => number;
|
|
5
|
+
export declare function shuffle<T>(items: readonly T[], rng?: Rng): T[];
|
|
6
|
+
export declare function parseChallengeScript(script: readonly string[], rng?: Rng): ChallengeKind[];
|
|
7
|
+
export declare function alternateChallenge(kind: ChallengeKind, rng?: Rng): ChallengeKind;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type ChallengeKind = "turn_left" | "turn_right" | "move_closer" | "blink_x2" | "nod";
|
|
2
|
+
export interface FaceSignals {
|
|
3
|
+
found: boolean;
|
|
4
|
+
centering: number;
|
|
5
|
+
fill: number;
|
|
6
|
+
brightness: number;
|
|
7
|
+
lighting: "good" | "too_dark" | "too_bright";
|
|
8
|
+
yaw: number;
|
|
9
|
+
yawConfidence: number;
|
|
10
|
+
roll: number;
|
|
11
|
+
pitch: number;
|
|
12
|
+
faceFrac: number;
|
|
13
|
+
faceW?: number;
|
|
14
|
+
geom?: FaceGeometry;
|
|
15
|
+
cx: number;
|
|
16
|
+
cy: number;
|
|
17
|
+
eyeDist: number;
|
|
18
|
+
noseYaw?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface FaceGeometry {
|
|
21
|
+
box: {
|
|
22
|
+
x1: number;
|
|
23
|
+
y1: number;
|
|
24
|
+
x2: number;
|
|
25
|
+
y2: number;
|
|
26
|
+
};
|
|
27
|
+
landmarks: Array<[number, number]>;
|
|
28
|
+
W: number;
|
|
29
|
+
H: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function signalsFromFace(landmarks: Array<[number, number]>, box: {
|
|
32
|
+
x1: number;
|
|
33
|
+
y1: number;
|
|
34
|
+
x2: number;
|
|
35
|
+
y2: number;
|
|
36
|
+
}, frameW: number, frameH: number): Omit<FaceSignals, "found" | "fill" | "centering" | "brightness" | "lighting"> & {
|
|
37
|
+
noseYaw: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const FACE_TICK_MS = 180;
|
|
2
|
+
export declare const CENTER_HOLD_MS = 1000;
|
|
3
|
+
export declare const CENTER_JITTER_MAX = 0.055;
|
|
4
|
+
export declare const CENTER_UNSTEADY_FRAMES = 2;
|
|
5
|
+
export declare const HOLD_FRAMES = 3;
|
|
6
|
+
export declare const CHALLENGE_TIMEOUT_MS = 12000;
|
|
7
|
+
export declare const RECENTER_TIMEOUT_MS = 8000;
|
|
8
|
+
export declare const REISSUE_PAUSE_MS = 600;
|
|
9
|
+
export declare const MAX_REISSUES = 1;
|
|
10
|
+
export declare const centerHoldFrames: (tickMs?: number, holdMs?: number) => number;
|
|
11
|
+
export declare function nextUnsteadyFrames(prev: number, found: boolean, jitter: number): number;
|
|
12
|
+
export type DeadlineAction = {
|
|
13
|
+
k: "continue";
|
|
14
|
+
} | {
|
|
15
|
+
k: "reissue";
|
|
16
|
+
} | {
|
|
17
|
+
k: "fail";
|
|
18
|
+
reason: "FACE_MISSING" | "MOVEMENT_TIMEOUT";
|
|
19
|
+
};
|
|
20
|
+
export declare function challengeDeadline(now: number, deadline: number, gotFace: boolean, reissues: number): DeadlineAction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChallengeKind, FaceSignals } from "./signals";
|
|
2
|
+
import type { Evidence, StepResult } from "./challenges";
|
|
3
|
+
export declare const YAW_TARGET = 0.42;
|
|
4
|
+
export declare const YAW_CONFIDENCE_MIN = 0.45;
|
|
5
|
+
export declare const YAW_MAX_STEP = 0.8;
|
|
6
|
+
export declare const JUMP_HELD_TOL = 0.22;
|
|
7
|
+
export interface JumpState {
|
|
8
|
+
prev: number | null;
|
|
9
|
+
pending: {
|
|
10
|
+
from: number;
|
|
11
|
+
to: number;
|
|
12
|
+
} | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function stepJump(st: JumpState, yaw: number): "open" | "teleport" | null;
|
|
15
|
+
export type TurnSide = "left" | "right";
|
|
16
|
+
export declare const YAW_POSITIVE_SIDE: TurnSide;
|
|
17
|
+
export declare function createTurnStep(kind: "turn_left" | "turn_right"): (sig: FaceSignals, ev: Evidence) => StepResult;
|
|
18
|
+
export declare const isTurn: (k: ChallengeKind) => k is "turn_left" | "turn_right";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Locale } from "../i18n";
|
|
2
|
+
import { type TenantInstructions } from "../flows/experience";
|
|
3
|
+
import { type CaptureId } from "../flows/state";
|
|
4
|
+
import type { Purpose } from "../flows/types";
|
|
5
|
+
import { type Appearance } from "../theme/appearance";
|
|
6
|
+
export type PreviewScreen = "intro" | "capture" | "success" | "error" | "handoff" | "continue" | "continueDone";
|
|
7
|
+
export interface PreviewHandoff {
|
|
8
|
+
mode?: "auto" | "suggest";
|
|
9
|
+
copy?: Partial<Record<Locale, {
|
|
10
|
+
title?: string;
|
|
11
|
+
body?: string;
|
|
12
|
+
}>>;
|
|
13
|
+
ttlMinutes?: number;
|
|
14
|
+
tenant?: string;
|
|
15
|
+
continueUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
export type PreviewChallenge = "center" | "turn_left" | "turn_right" | "move_closer";
|
|
18
|
+
export interface FlowPreviewProps {
|
|
19
|
+
screen: PreviewScreen;
|
|
20
|
+
step?: CaptureId;
|
|
21
|
+
challenge?: PreviewChallenge;
|
|
22
|
+
purpose?: Purpose;
|
|
23
|
+
locale: Locale;
|
|
24
|
+
appearance?: Appearance | null;
|
|
25
|
+
instructions?: TenantInstructions | null;
|
|
26
|
+
messages?: unknown;
|
|
27
|
+
errorCode?: string;
|
|
28
|
+
documentSides?: "front_back" | "front";
|
|
29
|
+
document?: boolean;
|
|
30
|
+
challenges?: number;
|
|
31
|
+
privacyNote?: string | null;
|
|
32
|
+
handoff?: PreviewHandoff | null;
|
|
33
|
+
}
|
|
34
|
+
export declare function FlowPreview(props: FlowPreviewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Appearance, ColorKey } from "../theme/appearance";
|
|
2
|
+
export declare const DEFAULT_COLORS: Record<ColorKey, string>;
|
|
3
|
+
export declare const DEFAULT_RADIUS = 12;
|
|
4
|
+
export declare const CONTRAST_PAIRS: ReadonlyArray<{
|
|
5
|
+
fg: ColorKey;
|
|
6
|
+
bg: ColorKey;
|
|
7
|
+
min: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
10
|
+
export interface ContrastCheck {
|
|
11
|
+
fg: ColorKey;
|
|
12
|
+
bg: ColorKey;
|
|
13
|
+
ratio: number;
|
|
14
|
+
min: number;
|
|
15
|
+
pass: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function contrastChecks(a: Appearance | null | undefined): ContrastCheck[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Quad } from "../document/overlay";
|
|
2
|
+
export declare function specimenQuad(viewW: number, viewH: number): Quad;
|
|
3
|
+
export declare function drawDocumentScene(canvas: HTMLCanvasElement, side: "front" | "back"): void;
|
|
4
|
+
export declare function specimenThumb(side: "front" | "back"): string | undefined;
|
|
5
|
+
export declare const FACE_SRC: {
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function faceGeometry(yaw?: number, near?: number): {
|
|
10
|
+
cx: number;
|
|
11
|
+
cy: number;
|
|
12
|
+
rx: number;
|
|
13
|
+
ry: number;
|
|
14
|
+
eyes: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}[];
|
|
18
|
+
nose: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
mouth: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
ears: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
export declare function facePoints(yaw?: number, near?: number): {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}[];
|
|
35
|
+
export declare function drawFaceScene(canvas: HTMLCanvasElement, yaw?: number, near?: number): void;
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ClientEventType = "camera_permission" | "camera_error" | "camera_not_found" | "camera_started" | "model_load_start" | "model_load_done" | "model_load_failed" | "model_load_timeout" | "engine_unavailable" | "visibility" | "step_shown" | "retry" | "abandoned" | "flow_failed" | "handoff_shown" | "continue_here" | "capture_review_shown" | "capture_confirmed" | "capture_retaken";
|
|
2
|
+
export interface ClientEvent {
|
|
3
|
+
type: ClientEventType;
|
|
4
|
+
t?: number;
|
|
5
|
+
step?: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
data?: Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
8
|
+
}
|
|
9
|
+
type Listener = (e: ClientEvent) => void;
|
|
10
|
+
export declare function reportClient(e: ClientEvent): void;
|
|
11
|
+
export declare function subscribeClient(fn: Listener): () => void;
|
|
12
|
+
export declare function trackFacts(stream: MediaStream | null | undefined): ClientEvent["data"];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type DeviceKind = "mobile" | "tablet" | "desktop";
|
|
2
|
+
export interface DeviceReading {
|
|
3
|
+
kind: DeviceKind;
|
|
4
|
+
touch: boolean;
|
|
5
|
+
reasons: string[];
|
|
6
|
+
}
|
|
7
|
+
type Nav = Navigator & {
|
|
8
|
+
userAgentData?: {
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
platform?: string;
|
|
11
|
+
brands?: Array<{
|
|
12
|
+
brand: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}>;
|
|
15
|
+
getHighEntropyValues?: (hints: string[]) => Promise<Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
connection?: {
|
|
18
|
+
effectiveType?: string;
|
|
19
|
+
downlink?: number;
|
|
20
|
+
rtt?: number;
|
|
21
|
+
saveData?: boolean;
|
|
22
|
+
};
|
|
23
|
+
deviceMemory?: number;
|
|
24
|
+
};
|
|
25
|
+
interface Env {
|
|
26
|
+
nav?: Nav;
|
|
27
|
+
matchMedia?: (q: string) => {
|
|
28
|
+
matches: boolean;
|
|
29
|
+
};
|
|
30
|
+
screen?: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare function detectDevice(e?: Env): DeviceReading;
|
|
36
|
+
export declare function inAppBrowser(ua: string): string | null;
|
|
37
|
+
export interface ParsedUa {
|
|
38
|
+
os: {
|
|
39
|
+
name?: string;
|
|
40
|
+
version?: string;
|
|
41
|
+
};
|
|
42
|
+
browser: {
|
|
43
|
+
name?: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
};
|
|
46
|
+
model?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function parseUserAgent(ua: string): ParsedUa;
|
|
49
|
+
export interface DeviceSnapshot {
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
export interface SnapshotOptions {
|
|
53
|
+
sdkVersion: string;
|
|
54
|
+
locale?: string;
|
|
55
|
+
runtime?: {
|
|
56
|
+
tfBackend?: string;
|
|
57
|
+
models?: Array<{
|
|
58
|
+
name: string;
|
|
59
|
+
ms?: number;
|
|
60
|
+
cache?: "hit" | "miss";
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
webgl?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function collectSnapshot(opts: SnapshotOptions): Promise<DeviceSnapshot>;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RpidClientConfig } from "../capture";
|
|
2
|
+
import { postClientEvents, postDevice } from "../handoff/api";
|
|
3
|
+
import { type ClientEvent } from "./bus";
|
|
4
|
+
export declare const FLUSH_MS = 2000;
|
|
5
|
+
export declare const BATCH = 10;
|
|
6
|
+
export declare const MAX_EVENTS = 300;
|
|
7
|
+
export declare class TelemetryReporter {
|
|
8
|
+
private cfg;
|
|
9
|
+
private locale?;
|
|
10
|
+
private send;
|
|
11
|
+
private sendDevice;
|
|
12
|
+
private queue;
|
|
13
|
+
private sent;
|
|
14
|
+
private timer;
|
|
15
|
+
private last;
|
|
16
|
+
private models;
|
|
17
|
+
private runtimeSent;
|
|
18
|
+
step: string;
|
|
19
|
+
finished: boolean;
|
|
20
|
+
constructor(cfg: RpidClientConfig, locale?: string | undefined, send?: typeof postClientEvents, sendDevice?: typeof postDevice);
|
|
21
|
+
start(): () => void;
|
|
22
|
+
add(e: ClientEvent): void;
|
|
23
|
+
private runtimeSnapshot;
|
|
24
|
+
flush(beacon?: boolean): void;
|
|
25
|
+
pagehide(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare function useTelemetry(cfg: RpidClientConfig | null, step: string, finished: boolean, locale?: string, enabled?: boolean): TelemetryReporter | null;
|