@sekyro/node 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.
@@ -0,0 +1,1541 @@
1
+ /**
2
+ * Wire-level enums and shapes of the Sekyro AI partner API (`/api/v2`). These
3
+ * mirror the backend's frozen partner contract; they are plain string unions so
4
+ * a newer API value never throws at runtime — it simply widens the type in the
5
+ * next SDK release.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ /** Session lifecycle status. @public */
10
+ type SessionStatus = "created" | "in_progress" | "review_pending" | "completed" | "expired" | "failed";
11
+ /**
12
+ * Terminal verdict, orthogonal to {@link SessionStatus}. `null` until the session
13
+ * reaches a terminal status; `review` when a human reviewer must adjudicate.
14
+ * @public
15
+ */
16
+ type SessionOutcome = "approved" | "review" | "rejected";
17
+ /**
18
+ * What a finished session proved: `1` a live, real person (human), `2` that
19
+ * person's identity (document, chip, registry or supplied data bound to the
20
+ * face), `3` an identity corroborated by an independent source. `0` on a
21
+ * rejected session.
22
+ * @public
23
+ */
24
+ type VerificationLevel = 0 | 1 | 2 | 3;
25
+ /**
26
+ * How a session's {@link VerificationLevel} was proved: `live_only` (liveness
27
+ * only), `live_unique` (liveness plus a duplicate search), and the
28
+ * `*_biometric` values, where a face match bound the person to a document,
29
+ * its chip, the registry record or partner-supplied identity data, and
30
+ * `eid_authenticated`, where the person signed in with a national digital
31
+ * identity (level 3 without a Sekyro selfie).
32
+ * @public
33
+ */
34
+ type VerificationAssurance = "live_only" | "live_unique" | "document_biometric" | "chip_biometric" | "registry_biometric" | "supplied_biometric" | "eid_authenticated";
35
+ /** The one billing unit a finished session consumed. @public */
36
+ type VerificationUnit = "human_verification" | "identity_verification";
37
+ /** The lowest and highest {@link VerificationLevel} the session's flow can reach. @public */
38
+ interface LevelTarget {
39
+ min: VerificationLevel;
40
+ max: VerificationLevel;
41
+ }
42
+ /**
43
+ * Device and network risk facts of a finished session (booleans and a level
44
+ * word, never scores).
45
+ * @public
46
+ */
47
+ interface ResultRisk {
48
+ level: "low" | "medium" | "high";
49
+ vpn: boolean;
50
+ ipDocumentMismatch: boolean;
51
+ deviceTampered: boolean;
52
+ }
53
+ /**
54
+ * What the liveness step verified about the capture itself: the device
55
+ * attestation, the capture proof and the injection signals.
56
+ * @public
57
+ */
58
+ interface ResultCheckProofs {
59
+ attestation: "verified" | "missing" | "failed";
60
+ captureProof: "verified" | "missing";
61
+ injectionSignals: "clear" | "flagged";
62
+ }
63
+ /**
64
+ * How a session proved the person's minimum age: `estimated` (the age check
65
+ * (selfie) step estimated the face over the threshold by a safety margin), or
66
+ * from identity data: `document`, `chip`, `registry` or `eid`.
67
+ * @public
68
+ */
69
+ type AgeMethod = "estimated" | "document" | "chip" | "registry" | "eid";
70
+ /**
71
+ * The age answer of a session whose flow sets a minimum age. `over` is the
72
+ * flow's minimum age (the threshold), never the person's age. `estimate`
73
+ * (years, one decimal) and `sigma` (its spread in years) are present only on
74
+ * the API session and webhooks, and only when the age check (selfie) step's
75
+ * "Keep and show the estimated age" setting is on; the result token never
76
+ * carries them.
77
+ * @public
78
+ */
79
+ interface AgeResult {
80
+ over: number;
81
+ method: AgeMethod;
82
+ estimate?: number;
83
+ sigma?: number;
84
+ }
85
+ /** Another subject the person's face already matched (duplicate search). @public */
86
+ interface ResultDuplicate {
87
+ subjectId: string;
88
+ externalRef?: string;
89
+ }
90
+ /**
91
+ * How a `subject.reuse` session runs: `recheck` verifies the same person
92
+ * again (liveness and face match against the stored photo), `step_up` raises
93
+ * the subject to identity level with a flow that proves level 2 on every path.
94
+ * @public
95
+ */
96
+ type SubjectReuseMode = "recheck" | "step_up";
97
+ /**
98
+ * Where the hosted flow sends the person when the session ends: an `https`
99
+ * URL on one of the app's web origins, or the app's `sekyro-<slug>://` scheme.
100
+ * `state` (up to 256 characters) is echoed back on the redirect.
101
+ * @public
102
+ */
103
+ interface SessionLinkInput {
104
+ returnUrl?: string;
105
+ state?: string;
106
+ }
107
+ /**
108
+ * How the person proves their identity on an optional-document app: type the
109
+ * national number, or photograph the document (`document_chip`: native NFC clients only).
110
+ * `national_eid`: the country's national eID (e.g. Houwiyeti for Mauritania),
111
+ * offered when the app's profile turns the national eID on.
112
+ * @public
113
+ */
114
+ type IdentityMethod = "national_number" | "document_photo" | "document_chip" | "national_eid";
115
+ /** The verification checks a flow may contain. @public */
116
+ type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
117
+ /** Per-check execution state within a session. @public */
118
+ type CheckState = "pending" | "input_required" | "processing" | "passed" | "failed" | "review" | "skipped";
119
+ /**
120
+ * Why a session was stopped by a profile-v2 policy gate rather than by a
121
+ * failed check:
122
+ * - `location_not_allowed` — the end user's IP location is not allowed for the app;
123
+ * - `anonymizer_blocked` — an anonymizer (VPN / proxy / Tor) was detected while the app blocks them;
124
+ * - `capture_tampered` — the device reported a tampered capture (virtual
125
+ * camera, hooking, emulator…) while the app's `device.tamper` is `block`;
126
+ * - `device_velocity_exceeded` — the device already verified more different
127
+ * people than `device.velocity` allows, with `action: 'block'`;
128
+ * - `device_cooldown` — the device had too many rejected sessions
129
+ * (`cooldown` tiers); {@link Session.retryAfter} says when it may try again.
130
+ * Not billed.
131
+ * @public
132
+ */
133
+ type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown";
134
+ /**
135
+ * Profile-v2 decision-mode reasons a check's {@link SessionStep.reason} may
136
+ * carry when the app decides automatically (`decisions.mode: 'automatic'`)
137
+ * instead of routing to human review. All are retryable within the step's
138
+ * attempts: `liveness_inconclusive` (liveness middle band),
139
+ * `match_inconclusive` (face match middle band on every reference),
140
+ * `document_authenticity` (doc_ocr authenticity warning — retake the original)
141
+ * and `mobile_required` (liveness captured on a desktop — continue on a phone;
142
+ * not billed). Every inconclusive attempt is billed.
143
+ * @public
144
+ */
145
+ type DecisionReason = "liveness_inconclusive" | "match_inconclusive" | "document_authenticity" | "mobile_required";
146
+ /**
147
+ * Profile-v2 eligibility reasons a check's {@link SessionStep.reason} may carry:
148
+ * `document_type_not_accepted` (doc_ocr; the person may pick another
149
+ * document), `nationality_not_allowed` and `underage` (doc_ocr or
150
+ * population_registry; terminal), and `age_unverifiable` (the app sets a
151
+ * minimum age but the birth date could not be read — doc_ocr: retryable with
152
+ * a clearer photo; population_registry: terminal).
153
+ * @public
154
+ */
155
+ type EligibilityReason = "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "underage_estimated";
156
+ /**
157
+ * Why a profile-v2 policy ended a session: a session-level
158
+ * {@link SessionFailureReason} (location / anonymizer gate), or the failed
159
+ * check's policy reason — an {@link EligibilityReason} or
160
+ * `document_nni_mismatch` (the document belongs to someone other than the
161
+ * NNI the session was created for), or `camera_unavailable` (spec 2026-10-29 §3.4: the person had no usable camera,
162
+ * so the live step ended without a capture; the session is rejected at level 0 unless your flow has a fallback).
163
+ * @public
164
+ */
165
+ type PolicyFailureReason = SessionFailureReason | EligibilityReason | "document_nni_mismatch" | "camera_unavailable";
166
+ /**
167
+ * Why the person had no camera (spec 2026-10-29 §3.4, 2026-10-30), when the SDK said: `denied` (the
168
+ * person refused camera access) or `no_camera` (no usable camera: none found, an insecure page or a
169
+ * browser that cannot capture). A detail under `failureReason: "camera_unavailable"`, never a reason of its own.
170
+ * @public
171
+ */
172
+ type CameraUnavailableCause = "denied" | "no_camera";
173
+ /**
174
+ * Profile-v2 matching reasons a check's {@link SessionStep.reason} may carry
175
+ * when the data you sent in {@link CreateSessionInput.subject} differs from the
176
+ * reference identity: `name_mismatch`, `birth_date_mismatch`,
177
+ * `nationality_mismatch` (doc_ocr or population_registry) and
178
+ * `document_number_mismatch` (doc_ocr). All are final.
179
+ * @public
180
+ */
181
+ type MatchReason = "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
182
+ /**
183
+ * Face-match probe-binding reason a `face_match` {@link SessionStep.reason} may
184
+ * carry (SDK spec §4.10): `probe_not_from_liveness` — the face image isn't the
185
+ * person in the liveness clip. Retryable within the step's attempts (the
186
+ * person re-takes the liveness capture); billed.
187
+ * @public
188
+ */
189
+ type ProbeBindingReason = "probe_not_from_liveness";
190
+ /**
191
+ * The languages the person being verified sees (hosted flow and SDK screens; spec 2026-10-29 §9). `ar`, `fr` and `en`
192
+ * carry every screen; `es`, `pt` and `de` carry the Human verification screens and show English elsewhere. SMS and
193
+ * email messages stay in `ar`, `fr` or `en` (English for the three others).
194
+ * @public
195
+ */
196
+ type Locale = "ar" | "fr" | "en" | "es" | "pt" | "de";
197
+ /** The environment a webhook was emitted from. @public */
198
+ type SekyroEnvironment = "sandbox" | "live";
199
+ /**
200
+ * One check of a session, as the partner API projects it: enum/id fields only,
201
+ * never civil data.
202
+ * @public
203
+ */
204
+ interface SessionStep {
205
+ checkType: CheckType;
206
+ state: CheckState;
207
+ /** Sekyro flows: the flow node this check belongs to (e.g. `n_live`). */
208
+ nodeId?: string;
209
+ /** Sekyro flows: the service of that node. */
210
+ service?: ServiceId;
211
+ /** Sekyro flows: the check failed and the flow's fallback took over. */
212
+ handled?: true;
213
+ /** Machine-readable failure/review reason, when the check has one. */
214
+ reason?: string;
215
+ /** With reason `camera_unavailable`: why, when the SDK said (`denied` or `no_camera`). */
216
+ reasonDetail?: CameraUnavailableCause;
217
+ /** Calibrated model score in [0, 1] for scored checks (liveness, face match). */
218
+ calibratedScore?: number;
219
+ /** The check failed after using all of its attempts. */
220
+ attemptsExhausted?: boolean;
221
+ /**
222
+ * `portrait_icao` only (ID mode): the per-criterion ICAO report of the last
223
+ * attempt — numbers and enums only, never the image.
224
+ */
225
+ report?: PortraitReportEntry[];
226
+ /**
227
+ * `face_match` only: the probe-quality measurement of the selfie that was
228
+ * matched (occlusion, head pose, eye openness, sharpness). Recorded for
229
+ * information only: it never changes the step's state or reason.
230
+ */
231
+ probeQuality?: ProbeQuality;
232
+ }
233
+ /**
234
+ * The probe-quality measurement on a `face_match` step. Numbers only; `null`
235
+ * means the value could not be measured. Informational: no threshold applies.
236
+ * @public
237
+ */
238
+ interface ProbeQuality {
239
+ /** Share of the inner face that is covered (a hand, a mask, a phone), in [0, 1]. */
240
+ occlusion: number | null;
241
+ /** Head pose in degrees. */
242
+ pose: {
243
+ yaw: number | null;
244
+ pitch: number | null;
245
+ roll: number | null;
246
+ };
247
+ /** Openness of the less-open eye, in [0, 1]. */
248
+ eyesOpen: number | null;
249
+ /** Sharpness of the face region (higher is sharper; no fixed scale). */
250
+ sharpness: number | null;
251
+ }
252
+ /**
253
+ * One row of the `portrait_icao` report (ID mode): the server's measurement of
254
+ * one ICAO criterion and the threshold that applied.
255
+ * @public
256
+ */
257
+ interface PortraitReportEntry {
258
+ criterion: "pose" | "eyes" | "mouth" | "occlusion" | "glare" | "lighting" | "background" | "resolution";
259
+ value: number | null;
260
+ threshold: number | string | null;
261
+ pass: boolean;
262
+ }
263
+ /**
264
+ * A short-lived link to a session's ICAO portrait (480×640 JPEG), from
265
+ * {@link SessionsApi.portrait}. Download it before `expiresAt`; never store the URL.
266
+ * @public
267
+ */
268
+ interface SessionPortraitLink {
269
+ url: string;
270
+ /** ISO 8601 (about 5 minutes after the call). */
271
+ expiresAt: string;
272
+ }
273
+ /**
274
+ * Out-of-band delivery of the session's hosted link, sent by Sekyro AI after the
275
+ * session is created. Best effort: a failed send never fails the create.
276
+ * @public
277
+ */
278
+ interface DeliverOptions {
279
+ /** Delivery channel. */
280
+ channel: "sms" | "whatsapp";
281
+ /** E.164 phone number of the recipient, e.g. `+22236123456`. */
282
+ to: string;
283
+ }
284
+ /**
285
+ * What you already know about the person (`subject` at session create). A
286
+ * closed object: unknown keys are refused (`400`). Every field is optional;
287
+ * `null` or blank counts as absent. Identity fields are compared with the
288
+ * person's document or registry record when the app's profile turns name
289
+ * matching on; `nni` binds the session to that identity.
290
+ * @public
291
+ */
292
+ interface SessionSubjectInput {
293
+ /** 10-digit Mauritanian NNI, as a string. */
294
+ nni?: string;
295
+ /** E.164 phone number, e.g. `+22236123456`. */
296
+ phone?: string;
297
+ fullName?: string;
298
+ /** ISO 8601 date (`YYYY-MM-DD`). */
299
+ birthDate?: string;
300
+ /** ISO 3166-1 alpha-2, e.g. `MR`. */
301
+ nationality?: string;
302
+ /** Identity-document number (1–40 characters). */
303
+ documentNumber?: string;
304
+ /**
305
+ * Your own id for this person (1–128 characters). Echoed on the session and
306
+ * its webhooks, and searchable on the subjects API.
307
+ */
308
+ externalRef?: string;
309
+ /**
310
+ * Returning user (profile v2 step 5): verify this already-verified subject
311
+ * again with liveness + face match only, against the reference photo stored
312
+ * on the subject. Name exactly one target. Errors at create:
313
+ * `404 subject_not_found`, `409 subject_revoked`, `409 subject_no_reference`,
314
+ * `409 subject_stale` (older than the flow's `returning.maxAgeMonths`),
315
+ * `409 reuse_disabled` (the flow turns returning-user sessions off) and
316
+ * `400` / `409 reuse_target_ambiguous`.
317
+ */
318
+ reuse?: SubjectReuseTarget;
319
+ }
320
+ /**
321
+ * An identity document for {@link SubjectReuseTarget}: the document type, the
322
+ * issuing country (ISO 3166-1 alpha-2 or alpha-3) and its number.
323
+ * @public
324
+ */
325
+ interface SubjectReuseDocument {
326
+ type: "national_id" | "passport" | "residence_permit";
327
+ issuingCountry: string;
328
+ number: string;
329
+ }
330
+ /**
331
+ * Which subject a returning-user session re-verifies — exactly ONE of the
332
+ * subject id, your own `externalRef` (must match a single subject), the NNI
333
+ * or an identity document the person verified with.
334
+ * @public
335
+ */
336
+ type SubjectReuseTarget = ({
337
+ subjectId: string;
338
+ externalRef?: never;
339
+ nni?: never;
340
+ document?: never;
341
+ } | {
342
+ externalRef: string;
343
+ subjectId?: never;
344
+ nni?: never;
345
+ document?: never;
346
+ } | {
347
+ nni: string;
348
+ subjectId?: never;
349
+ externalRef?: never;
350
+ document?: never;
351
+ } | {
352
+ document: SubjectReuseDocument;
353
+ subjectId?: never;
354
+ externalRef?: never;
355
+ nni?: never;
356
+ }) & {
357
+ /**
358
+ * `recheck` (default) or `step_up` ({@link SubjectReuseMode}). `step_up` on
359
+ * a flow that does not prove level 2 on every path answers
360
+ * `400 step_up_flow_too_weak`.
361
+ */
362
+ mode?: SubjectReuseMode;
363
+ };
364
+ /** A document type the backend reads (kyc-docs-v2 vocabulary; `carte_identite` = identity card of any issuer). @public */
365
+ type ProfileDocumentType = "carte_identite" | "passport" | "residence_permit";
366
+ /**
367
+ * The services a Sekyro flow is built from. A session's steps
368
+ * ({@link SessionStep.service}) and {@link FlowOverrides.services} use these
369
+ * ids; one service may run several checks (e.g. `liveness` with an ICAO
370
+ * portrait).
371
+ * @public
372
+ */
373
+ type ServiceId = "device_network" | "phone_otp" | "email_otp" | "national_eid" | "document" | "nfc" | "population_registry" | "supplied_identity" | "summary_confirm" | "liveness" | "face_match" | "aml_screening" | "face_dedup" | "age_estimation";
374
+ /**
375
+ * The general settings of a flow that a session may override (the flow's
376
+ * `link`, `language` and override policy are not overridable). Country codes
377
+ * are ISO 3166-1 alpha-2 (`MR`). Used through {@link FlowOverrides.settings}.
378
+ * @public
379
+ */
380
+ interface FlowOverridableSettings {
381
+ /** Who may be verified. */
382
+ eligibility: {
383
+ /** Accepted nationalities: `'*'` or a list, optionally per IP location. */
384
+ nationalities: {
385
+ default: "*" | string[];
386
+ byLocation?: Record<string, "*" | string[]>;
387
+ };
388
+ /** Minimum age in years (1–120), or `null` for none. */
389
+ minAge: number | null;
390
+ };
391
+ /** Automatic decisions instead of human review (`retryConfidentRejects` lets confident rejects retry). */
392
+ decisions?: {
393
+ mode: "automatic" | "review";
394
+ retryConfidentRejects: boolean;
395
+ };
396
+ /** Data consistency across sources. */
397
+ fraud: {
398
+ /** Comparison of your `subject` data with the reference identity. */
399
+ nameMatch?: {
400
+ level: "strict" | "standard" | "lenient";
401
+ onMismatch: "fail" | "signal";
402
+ };
403
+ };
404
+ /** Returning-user sessions (`subject.reuse`). */
405
+ returning: {
406
+ /** `false`: returning-user sessions are refused (`409 reuse_disabled`). */
407
+ enabled: boolean;
408
+ /** Maximum age in months (1–120) of the subject's last verification; `null` = no limit. */
409
+ maxAgeMonths: number | null;
410
+ };
411
+ /** Identity-document rules. */
412
+ documents: {
413
+ /** Accepted document types: `'*'` (all) or a list, optionally per issuing country. */
414
+ accepted: {
415
+ default: "*" | ProfileDocumentType[];
416
+ byIssuer?: Record<string, ProfileDocumentType[]>;
417
+ };
418
+ /** Expired documents: refused, allowed, or allowed for `graceDays` (1–365) after expiry. */
419
+ expired: "reject" | "allow" | {
420
+ graceDays: number;
421
+ };
422
+ authenticity: "standard" | "off";
423
+ };
424
+ }
425
+ /**
426
+ * Document substitution: the portrait a `document` or `nfc` step produces is
427
+ * compared with the registry portrait (or the chip with the printed photo).
428
+ * `signal` records a risk signal on a clear mismatch, `review` also sends the
429
+ * session to review, `off` compares nothing. `failBelow` is the mismatch bound
430
+ * in (0, 1), absent = the platform bound.
431
+ * @public
432
+ */
433
+ interface DocumentSubstitutionSettings {
434
+ mode: "off" | "signal" | "review";
435
+ failBelow?: number;
436
+ }
437
+ /**
438
+ * The per-service settings a session may override, by {@link ServiceId}.
439
+ * `attempts` limits are per step (absent = the platform default).
440
+ * @public
441
+ */
442
+ interface FlowServiceSettings {
443
+ /** Device & Network Intelligence: IP location, anonymizers, cooldown, device and capture postures. */
444
+ device_network: {
445
+ /** Where the end user may be (IP location). */
446
+ locations: {
447
+ mode: "all";
448
+ } | {
449
+ mode: "only" | "all_except";
450
+ countries: string[];
451
+ };
452
+ /** VPN / proxy / Tor. */
453
+ anonymizers: "allow" | "block";
454
+ /** Device cooldown after repeated rejections (at most 5 tiers; `[]` = off). */
455
+ cooldown?: {
456
+ tiers: Array<{
457
+ rejectedSessions: number;
458
+ windowHours: number;
459
+ waitMinutes: number;
460
+ }>;
461
+ };
462
+ /** Device tamper and velocity actions. */
463
+ device?: {
464
+ tamper: "block" | "signal";
465
+ velocity: {
466
+ maxIdentitiesPerDevice: number;
467
+ windowDays: number;
468
+ action: "signal" | "block";
469
+ };
470
+ };
471
+ attestation?: "off" | "signal" | "enforce";
472
+ captureIntegrity?: "off" | "signal" | "enforce";
473
+ };
474
+ phone_otp: {
475
+ /** Where the number comes from: your `subject.phone` / `input.phone`, the person, or either. */
476
+ numberSource: "prefilled" | "user_entered" | "prefilled_or_entered";
477
+ /** Narrow the channels the person may choose from (absent = every channel the org has on). */
478
+ channels?: Array<"whatsapp" | "sms">;
479
+ /** Which countries codes may be sent to (absent = the flow's allowed `locations`). */
480
+ destinations?: "locations" | "any" | {
481
+ countries: string[];
482
+ };
483
+ attempts?: number;
484
+ };
485
+ email_otp: {
486
+ /** Where the address comes from: your `input.email`, the person, or either. */
487
+ emailSource: "prefilled" | "user_entered" | "prefilled_or_entered";
488
+ /** Disposable (temporary) addresses: allowed, flagged as a risk signal (default), or refused. */
489
+ disposable?: "allow" | "signal" | "block";
490
+ attempts?: number;
491
+ };
492
+ national_eid: {
493
+ /**
494
+ * `'org'` (every national eID the org can use, resolved at session create)
495
+ * or provider ids (`{country}.{provider}`, e.g. `MR.houwiyeti`).
496
+ */
497
+ providers: "org" | string[];
498
+ /** The eID portrait is the face-match reference. */
499
+ portraitReference: boolean;
500
+ };
501
+ document: {
502
+ attempts?: number;
503
+ /** Compare the document photo with the registry photo (absent = the platform default). */
504
+ documentSubstitution?: DocumentSubstitutionSettings;
505
+ };
506
+ /** The chip read (its MRZ source is derived from the flow and is not overridable). */
507
+ nfc: {
508
+ maxAttempts?: number;
509
+ /** Compare the chip photo with the registry photo (absent = the platform default). */
510
+ documentSubstitution?: DocumentSubstitutionSettings;
511
+ };
512
+ population_registry: {
513
+ /** `'org'` (every registry the org can use, resolved at session create) or registry ids. */
514
+ sources: "org" | Array<"MR.anrpts">;
515
+ nniSource: "auto" | "typed" | "bound_only";
516
+ onUncovered: "skip";
517
+ attempts?: number;
518
+ };
519
+ supplied_identity: Record<string, never>;
520
+ summary_confirm: {
521
+ /** Offer « Reprendre » (re-open the identity source). */
522
+ retake: boolean;
523
+ };
524
+ liveness: {
525
+ /** `off`, selfie ICAO `alert` / `reject`, or `id_document` (ID-photo portrait, always rejects). */
526
+ icao: "off" | "alert" | "reject" | "id_document";
527
+ attempts?: number;
528
+ };
529
+ face_match: {
530
+ reference: "auto" | "document" | "registry";
531
+ attempts?: number;
532
+ };
533
+ aml_screening: {
534
+ lists: Array<"sanctions" | "pep" | "adverse_media">;
535
+ onHit: "review" | "fail";
536
+ };
537
+ face_dedup: {
538
+ scope: "app" | "org";
539
+ onDuplicate: "review" | "fail";
540
+ };
541
+ /** The age check (selfie); the threshold is the flow's `eligibility.minAge`. */
542
+ age_estimation: {
543
+ /** Keep and show the estimated age ({@link AgeResult.estimate}) on the API session and webhooks. Default `false`. */
544
+ showEstimatedAge?: boolean;
545
+ };
546
+ }
547
+ /**
548
+ * `T` with every property optional, recursively. Arrays are replaced as a
549
+ * whole, never merged element by element.
550
+ * @public
551
+ */
552
+ type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
553
+ [K in keyof T]?: DeepPartial<T[K]>;
554
+ } : T;
555
+ /**
556
+ * A per-session override of the flow ({@link CreateSessionInput.overrides}).
557
+ *
558
+ * - `settings`: any subset of {@link FlowOverridableSettings}, at any depth.
559
+ * - `services`: keyed by service (applied to every node of that service): any
560
+ * subset of its {@link FlowServiceSettings}, or `'off'` to remove it from
561
+ * the flow. A service the flow does not use is ignored.
562
+ *
563
+ * Objects merge into the flow; arrays and scalar values replace. Unknown keys
564
+ * and invalid results answer `400 override_invalid`. An override may only
565
+ * make the flow stricter unless the flow allows widening; turning a service
566
+ * `'off'` always widens. A widening change answers `403 override_widens_flow`.
567
+ * The changed paths are reported on {@link Session.overriddenFields}.
568
+ *
569
+ * @example
570
+ * ```ts
571
+ * await sekyro.sessions.create({
572
+ * flow: "foreigners",
573
+ * overrides: {
574
+ * settings: { eligibility: { minAge: 21 } },
575
+ * services: { liveness: { attempts: 2 } },
576
+ * },
577
+ * });
578
+ * ```
579
+ * @public
580
+ */
581
+ interface FlowOverrides {
582
+ settings?: DeepPartial<FlowOverridableSettings>;
583
+ services?: {
584
+ [S in ServiceId]?: DeepPartial<FlowServiceSettings[S]> | "off";
585
+ };
586
+ }
587
+ /**
588
+ * The flow version a session runs: its `flw_` id, its slug and the published
589
+ * version pinned at create.
590
+ * @public
591
+ */
592
+ interface SessionFlowRef {
593
+ id: string;
594
+ slug: string;
595
+ version: number;
596
+ }
597
+ /**
598
+ * One flow of your app, from {@link Sekyro.listFlows}. Published flows only;
599
+ * pass `slug` or `id` as {@link CreateSessionInput.flow}.
600
+ * @public
601
+ */
602
+ interface FlowSummary {
603
+ /** `flw_` id. */
604
+ id: string;
605
+ slug: string;
606
+ name: string;
607
+ /** The published version a new session runs. */
608
+ version: number;
609
+ /** The flow a session runs when you send no `flow`. */
610
+ isDefault: boolean;
611
+ }
612
+ /**
613
+ * Input of {@link SessionsApi.create}. The API key belongs to an app; the
614
+ * app's flow (its default flow, or the one named in `flow`) decides the steps.
615
+ * @public
616
+ */
617
+ interface CreateSessionInput {
618
+ /**
619
+ * The app's flow to run: its slug (e.g. `foreigners`) or `flw_` id, as
620
+ * {@link Sekyro.listFlows} lists them. Absent = the app's default flow.
621
+ * Errors: `404 flow_not_found` (no such flow in the key's app),
622
+ * `409 flow_not_published`, `409 flow_archived`.
623
+ */
624
+ flow?: string;
625
+ /** Pins the hosted-flow language. Omit to let the person's device decide. */
626
+ locale?: Locale;
627
+ /**
628
+ * Pre-choose the identity method when the flow offers a choice of identity
629
+ * method (the hosted choice screen is then skipped). Ignored otherwise.
630
+ */
631
+ identityMethod?: IdentityMethod;
632
+ /**
633
+ * Session lifetime in minutes. Must fall within the flow's link range,
634
+ * otherwise the API answers `400 ttl_out_of_policy`. Omit to use the
635
+ * flow's default.
636
+ */
637
+ ttlMinutes?: number;
638
+ /** Also send the hosted link to the person by SMS or WhatsApp. */
639
+ deliver?: DeliverOptions;
640
+ /**
641
+ * Where the hosted flow returns the person when the session ends
642
+ * ({@link SessionLinkInput}). A URL outside the app's web origins and app
643
+ * scheme answers `400 return_url_not_allowed`.
644
+ */
645
+ link?: SessionLinkInput;
646
+ /**
647
+ * What you already know about the person (preferred over `input` for
648
+ * identity data). A key sent in both `subject` and `input` with different
649
+ * values answers `400 subject_input_conflict`.
650
+ */
651
+ subject?: SessionSubjectInput;
652
+ /**
653
+ * Your own id for the agent filming the person, for flows whose liveness
654
+ * capture is `assisted` (1 to 128 characters). Stored as is and echoed on
655
+ * the session and in webhooks.
656
+ */
657
+ assistedBy?: {
658
+ externalRef: string;
659
+ };
660
+ /**
661
+ * Override the flow for this session only ({@link FlowOverrides}): its
662
+ * general settings and per-service settings, or turn a service `'off'`.
663
+ * `400 override_invalid` for an unknown key or an invalid result;
664
+ * `403 override_widens_flow` for a change that makes the flow less strict
665
+ * when the flow does not allow widening.
666
+ */
667
+ overrides?: FlowOverrides;
668
+ /**
669
+ * Step inputs consumed server-side. The known anchors are typed (all
670
+ * strings — an `nni` is a 10-digit string, never a number); further keys
671
+ * pass through to the API as-is. `nni` binds the session to that identity:
672
+ * the hosted flow may omit it but cannot substitute another.
673
+ */
674
+ input?: {
675
+ /** 10-digit Mauritanian NNI, as a string. */
676
+ nni?: string;
677
+ /** E.164 phone number, e.g. `+22236123456`. */
678
+ phone?: string;
679
+ /** Email address for the email OTP step (`emailSource` `prefilled` / `prefilled_or_entered`). */
680
+ email?: string;
681
+ fullName?: string;
682
+ /** ISO 8601 date (`YYYY-MM-DD`). */
683
+ birthDate?: string;
684
+ /**
685
+ * Partner-supplied identity data (`supplied` mode only): the person's
686
+ * biographic record and photo as YOUR system holds them — for example
687
+ * from your own ANRPTS answer, converted with {@link registryFromAnrpts}.
688
+ * Sekyro AI stores it as data you vouch for, makes no registry call, and
689
+ * never receives or stores any registry key. `nni` must be set too and
690
+ * equal `suppliedIdentity.nni`. Refused unless Sekyro AI enabled the mode
691
+ * for the environment (`403 supplied_identity_not_entitled`); required in
692
+ * that mode when the app verifies identity (`422 supplied_identity_required`).
693
+ */
694
+ suppliedIdentity?: SuppliedIdentityRecord;
695
+ } & Record<string, unknown>;
696
+ }
697
+ /**
698
+ * Partner-supplied identity data (`sessions.create` `input.suppliedIdentity`):
699
+ * the person's biographic record and photo, as your organization holds them.
700
+ * Sekyro AI treats it as identity data supplied by your organization, not as
701
+ * a registry lookup. Refusals at create: `400 supplied_identity_nni_mismatch`,
702
+ * `422 supplied_identity_stale` (`fetchedAt` older than 24 h),
703
+ * `422 supplied_identity_photo_unusable` (not a JPEG/PNG of at most 1 MB within the
704
+ * size bounds). In a `supplied` environment whose app verifies identity, a create
705
+ * without `input.suppliedIdentity` is `422 supplied_identity_required`. The face on
706
+ * the photo is checked after consent, at the face match (`no_face_reference`).
707
+ * @public
708
+ */
709
+ interface SuppliedIdentityRecord {
710
+ /** 10-digit NNI, as a string. */
711
+ nni: string;
712
+ firstNameFr: string;
713
+ lastNameFr: string;
714
+ fatherNameFr?: string;
715
+ firstNameAr: string;
716
+ lastNameAr: string;
717
+ fatherNameAr?: string;
718
+ /** ISO 8601 date (`YYYY-MM-DD`). */
719
+ birthDate: string;
720
+ birthPlaceFr?: string;
721
+ birthPlaceAr?: string;
722
+ sex?: "M" | "F";
723
+ /** Nationality text as your source holds it (e.g. `Mauritanienne`). */
724
+ nationalities?: string[];
725
+ /** Base64 JPEG or PNG (at most 1 MB decoded). */
726
+ photo: string;
727
+ /** ISO 8601 date (`YYYY-MM-DD`) of the registry photo. */
728
+ photoDate?: string;
729
+ /** ISO 8601 date-time at which your system obtained this record. */
730
+ fetchedAt: string;
731
+ }
732
+ /** Per-request options. @public */
733
+ interface RequestOptions {
734
+ /**
735
+ * Sent as `X-Idempotency-Key`. Replaying the same key within 24 h returns the
736
+ * original response instead of creating a second session.
737
+ */
738
+ idempotencyKey?: string;
739
+ }
740
+ /**
741
+ * Result of {@link SessionsApi.create}. `clientToken` is returned ONCE and never
742
+ * again — hand it to the browser (`@sekyro/web`) and do not persist it.
743
+ * @public
744
+ */
745
+ interface CreatedSession {
746
+ id: string;
747
+ status: SessionStatus;
748
+ /** One-time credential for the client SDK / hosted flow. */
749
+ clientToken: string;
750
+ /** Hosted verification link for this session. */
751
+ hostedUrl: string;
752
+ /** The flow version the session runs (the default flow when you sent no `flow`). */
753
+ flow?: SessionFlowRef;
754
+ /** The checks on the session's path (checks of a lane not taken are omitted). */
755
+ steps: SessionStep[];
756
+ /** ISO 8601 — when the session (and its link) stop accepting input. */
757
+ expiresAt: string;
758
+ /** The levels the flow can reach on its paths; absent from older API versions. */
759
+ levelTarget?: LevelTarget;
760
+ }
761
+ /**
762
+ * Input of {@link SubjectsApi.createSession}: a re-check or step-up session
763
+ * for an existing subject in one call.
764
+ * @public
765
+ */
766
+ interface SubjectSessionInput {
767
+ mode: SubjectReuseMode;
768
+ /** The app's flow to run (slug or `flw_` id); absent = the app's default flow. */
769
+ flow?: string;
770
+ link?: SessionLinkInput;
771
+ /** Session lifetime in minutes, within the flow's link range. */
772
+ ttlMinutes?: number;
773
+ locale?: Locale;
774
+ }
775
+ /**
776
+ * Which subject {@link SubjectsApi.createSession} targets: the subject id or
777
+ * your own external reference.
778
+ * @public
779
+ */
780
+ type SubjectSessionTarget = {
781
+ subjectId: string;
782
+ } | {
783
+ externalRef: string;
784
+ };
785
+ /** Result of {@link SessionsApi.resultToken}: a freshly signed result token. @public */
786
+ interface ResultTokenResponse {
787
+ /** ES256 JWT; check it with {@link verifyResultToken}. */
788
+ token: string;
789
+ /** ISO 8601: when the token expires (10 minutes after signing). */
790
+ expiresAt: string;
791
+ }
792
+ /**
793
+ * The end user's network at the start of the session (IP-derived, approximate).
794
+ * @public
795
+ */
796
+ interface SessionNetworkEvent {
797
+ /** ISO 8601. */
798
+ at: string;
799
+ /** ISO 3166-1 alpha-2. */
800
+ country?: string;
801
+ region?: string;
802
+ city?: string;
803
+ asn?: number;
804
+ operator?: string;
805
+ connectionType: "mobile" | "hosting" | "unknown";
806
+ anonymizer: {
807
+ vpn: boolean;
808
+ tor: boolean;
809
+ hosting: boolean;
810
+ };
811
+ /** IANA time zone reported by the end user's device. */
812
+ browserTimezone?: string;
813
+ /** True when the device time zone does not belong to the IP country. */
814
+ timezoneMismatch?: boolean;
815
+ }
816
+ /**
817
+ * End-user network context; absent when not recorded.
818
+ * @public
819
+ */
820
+ interface SessionNetwork {
821
+ /** The start event's IP address. Never sent in webhooks. */
822
+ ip?: string;
823
+ /** True when a later call came from a different country than the start. */
824
+ countryChanged: boolean;
825
+ start: SessionNetworkEvent;
826
+ }
827
+ /**
828
+ * Device signals detected on the end user's device.
829
+ * @public
830
+ */
831
+ type SessionDeviceSignal = "webdriver" | "headless" | "emulator" | "rooted" | "jailbroken" | "debugger" | "hooking" | "virtual_camera";
832
+ /**
833
+ * End-user device summary; absent when not recorded.
834
+ * @public
835
+ */
836
+ interface SessionDevice {
837
+ platform: "web" | "android" | "ios";
838
+ sdk?: string;
839
+ os?: string;
840
+ osVersion?: string;
841
+ browser?: string;
842
+ browserVersion?: string;
843
+ deviceClass: "mobile" | "tablet" | "desktop" | "unknown";
844
+ model?: string;
845
+ /** Device ids hashed with a key unique to your organization. */
846
+ deviceKeys: string[];
847
+ signals: SessionDeviceSignal[];
848
+ }
849
+ /**
850
+ * The national eID that verified the session's identity (the `eid_auth` check
851
+ * passed): the provider id (`{country}.{provider}`, e.g. `MR.houwiyeti`), its
852
+ * ISO 3166-1 alpha-2 country and when. A passed eID ends the session.
853
+ * @public
854
+ */
855
+ interface EidResult {
856
+ provider: string;
857
+ country: string;
858
+ verifiedAt: string;
859
+ }
860
+ /**
861
+ * The full phone number and email address the person verified in a session
862
+ * (an OTP check that passed) — sent ONLY to you (the session view and your
863
+ * webhooks), never to the person's browser, and removed when the session's
864
+ * personal data is purged. You are the controller of these values. A
865
+ * prefilled value that was not verified is never listed.
866
+ * @public
867
+ */
868
+ interface VerifiedContacts {
869
+ /** From a passed `phone_otp` check. */
870
+ phone?: {
871
+ /** E.164, e.g. `+22236123456`. */
872
+ number: string;
873
+ /** The channel the code was delivered on. */
874
+ channel: "whatsapp" | "sms";
875
+ /** ISO 8601. */
876
+ verifiedAt: string;
877
+ };
878
+ /** From a passed `email_otp` check. */
879
+ email?: {
880
+ /** The verified address (domain lowercased). */
881
+ address: string;
882
+ /** ISO 8601. */
883
+ verifiedAt: string;
884
+ };
885
+ }
886
+ /**
887
+ * The whitelisted session view returned by {@link SessionsApi.get}. Never
888
+ * contains the client token.
889
+ * @public
890
+ */
891
+ interface Session {
892
+ id: string;
893
+ /** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
894
+ flow?: SessionFlowRef;
895
+ status: SessionStatus;
896
+ outcome: SessionOutcome | null;
897
+ /**
898
+ * What the session proved ({@link VerificationLevel}); `null` while the
899
+ * session is active, `0` when it was rejected. Absent from older API versions.
900
+ */
901
+ level?: VerificationLevel | null;
902
+ /** How the level was proved; `null` while the session is active. */
903
+ assurance?: VerificationAssurance | null;
904
+ /** The billing unit the session consumed; `null` while the session is active. */
905
+ unit?: VerificationUnit | null;
906
+ /** The levels the session's flow can reach. */
907
+ levelTarget?: LevelTarget;
908
+ /** The checks on the session's path (checks of a lane the person did not take are omitted). */
909
+ steps: SessionStep[];
910
+ /** ISO 8601. */
911
+ expiresAt: string;
912
+ /** ISO 8601. */
913
+ createdAt: string;
914
+ /** ISO 8601: when the session reached a terminal state; `null` while it is active. */
915
+ completedAt?: string | null;
916
+ /** End-user network context; absent when not recorded. */
917
+ network?: SessionNetwork;
918
+ /** End-user device; absent when not recorded. */
919
+ device?: SessionDevice;
920
+ /**
921
+ * Set when a profile-v2 policy ended the session: a session-level gate
922
+ * (location, anonymizer) or a failed check's policy reason (eligibility,
923
+ * `document_nni_mismatch`). Absent otherwise.
924
+ */
925
+ failureReason?: PolicyFailureReason;
926
+ /** With failureReason `camera_unavailable`: why (`denied` or `no_camera`), when the SDK said. Absent otherwise. */
927
+ failureDetail?: CameraUnavailableCause;
928
+ /** The subject (person) this session is linked to, once an identifier is known. */
929
+ subjectId?: string;
930
+ /** Your own id for the person, from `subject.externalRef` at create. */
931
+ externalRef?: string;
932
+ /** The agent reference sent as `assistedBy` at create, for assisted capture. */
933
+ assistedBy?: {
934
+ externalRef: string;
935
+ };
936
+ /**
937
+ * `true` when an identifier this session read already belongs to a
938
+ * different subject than `subjectId` — the subjects are never merged.
939
+ */
940
+ subjectConflict?: boolean;
941
+ /**
942
+ * ISO 8601 — when the end user's device may verify again; set with
943
+ * `failureReason: 'device_cooldown'`.
944
+ */
945
+ retryAfter?: string;
946
+ /**
947
+ * Dotted paths this session's {@link CreateSessionInput.overrides} changed
948
+ * (e.g. `settings.decisions.mode`, `services.liveness`).
949
+ */
950
+ overriddenFields?: string[];
951
+ /**
952
+ * Risk signals recorded on the session (e.g. `device_velocity`,
953
+ * `timezone_mismatch`, `icao_non_compliant` when an `alert` ICAO policy flagged
954
+ * the selfie) — signals only, never a verdict by themselves.
955
+ */
956
+ riskSignals?: string[];
957
+ /**
958
+ * `true` for a returning-user session (created with
959
+ * {@link SessionSubjectInput.reuse}): liveness + face match against the
960
+ * subject's stored reference photo only.
961
+ */
962
+ returning?: true;
963
+ /** On a returning-user session: the subject (person) it re-verifies. */
964
+ reuseOf?: string;
965
+ /**
966
+ * On a session created for an existing subject: `recheck` (the same person
967
+ * again) or `step_up` (raised to identity level). Absent otherwise.
968
+ */
969
+ reuseMode?: SubjectReuseMode;
970
+ /** The contacts verified in this session (passed OTP checks only); absent when none. */
971
+ verifiedContacts?: VerifiedContacts;
972
+ /** The national eID that verified this session (the `eid_auth` check passed); absent otherwise. */
973
+ eid?: EidResult;
974
+ /**
975
+ * When the flow sets a minimum age and the session proved it: the threshold
976
+ * and how it was proved ({@link AgeResult}). Absent otherwise.
977
+ */
978
+ age?: AgeResult;
979
+ /**
980
+ * ID mode (`portrait.purpose = id_document`) only: the ICAO portrait can be
981
+ * fetched with {@link SessionsApi.portrait}.
982
+ */
983
+ portraitAvailable?: boolean;
984
+ }
985
+ /**
986
+ * `data` of the terminal / review-pending session lifecycle events
987
+ * (`session.completed` | `session.failed` | `session.review_pending` |
988
+ * `session.expired`): ids and enums only, no civil data,
989
+ * scores or links. `outcome` and `steps` travel on `completed` / `failed`;
990
+ * `review_pending` carries `steps` without an outcome; `expired` carries the
991
+ * status and the session's refs (`flow`, subject ids, `overriddenFields`).
992
+ * @public
993
+ */
994
+ interface SessionLifecycleEventData {
995
+ sessionId: string;
996
+ status: SessionStatus;
997
+ outcome?: SessionOutcome | null;
998
+ /** On `completed` / `failed`: the app the session belongs to. */
999
+ appId?: string;
1000
+ /** On `completed` / `failed`: what the session proved ({@link VerificationLevel}). */
1001
+ level?: VerificationLevel | null;
1002
+ /** On `completed` / `failed`: how the level was proved. */
1003
+ assurance?: VerificationAssurance | null;
1004
+ /** On `completed` / `failed`: the billing unit the session consumed. */
1005
+ unit?: VerificationUnit | null;
1006
+ /** On `completed` / `failed`: ISO 8601 terminal time. */
1007
+ verifiedAt?: string;
1008
+ /** On `completed` / `failed`: device and network risk facts, when recorded. */
1009
+ risk?: ResultRisk;
1010
+ /** On `completed` / `failed`: other subjects the face matched, when a duplicate search ran. */
1011
+ duplicates?: ResultDuplicate[];
1012
+ /**
1013
+ * On `completed` / `failed`: the signed result token (ES256 JWT, valid
1014
+ * 10 minutes). Check it with {@link verifyResultToken}; absent when
1015
+ * result tokens are not enabled.
1016
+ */
1017
+ resultToken?: string;
1018
+ /** The checks on the session's path (checks of a lane the person did not take are omitted). */
1019
+ steps?: Array<Pick<SessionStep, "checkType" | "state" | "nodeId" | "service">>;
1020
+ /** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
1021
+ flow?: SessionFlowRef;
1022
+ /** Machine-readable reason, when the transition has one. */
1023
+ reason?: string;
1024
+ /** End-user network context (no IP); on `completed` / `failed` when recorded. */
1025
+ network?: Omit<SessionNetwork, "ip">;
1026
+ /** End-user device; on `completed` / `failed` when recorded. */
1027
+ device?: SessionDevice;
1028
+ /**
1029
+ * On `session.failed`: set when a profile-v2 policy ended the session — a
1030
+ * session-level gate (location, anonymizer) or a failed check's policy
1031
+ * reason (eligibility, `document_nni_mismatch`).
1032
+ */
1033
+ failureReason?: PolicyFailureReason;
1034
+ /** On `session.failed` with failureReason `camera_unavailable`: why (`denied` or `no_camera`), when the SDK said. Absent otherwise. */
1035
+ failureDetail?: CameraUnavailableCause;
1036
+ /** The subject (person) the session is linked to, when known. */
1037
+ subjectId?: string;
1038
+ /** Your own id for the person, from `subject.externalRef` at create. */
1039
+ externalRef?: string;
1040
+ /**
1041
+ * `true` when an identifier this session read already belongs to a
1042
+ * different subject than `subjectId` — the subjects are never merged.
1043
+ */
1044
+ subjectConflict?: boolean;
1045
+ /** `true` on a returning-user session (liveness + face match against the stored photo). */
1046
+ returning?: true;
1047
+ /** On a returning-user session: the subject (person) it re-verifies. */
1048
+ reuseOf?: string;
1049
+ /**
1050
+ * On a session created for an existing subject: `recheck` (the same person
1051
+ * again) or `step_up` (raised to identity level). Absent otherwise.
1052
+ */
1053
+ reuseMode?: SubjectReuseMode;
1054
+ /**
1055
+ * On `completed` / `failed`: the `link.state` the session was created
1056
+ * with, echoed back; absent when the session had none.
1057
+ */
1058
+ link?: {
1059
+ state: string;
1060
+ };
1061
+ /**
1062
+ * On `session.failed` with `failureReason: 'device_cooldown'`: ISO time
1063
+ * from which the device may start a new verification.
1064
+ */
1065
+ retryAfter?: string;
1066
+ /** Dotted paths the session's create-time {@link CreateSessionInput.overrides} changed. */
1067
+ overriddenFields?: string[];
1068
+ /** On `completed` / `failed`: the contacts verified in this session (passed OTP checks only). */
1069
+ verifiedContacts?: VerifiedContacts;
1070
+ /** On `completed` / `failed`: the national eID that verified this session, when one did. */
1071
+ eid?: EidResult;
1072
+ /** On `completed` / `failed`: the minimum age the session proved and how ({@link AgeResult}), when the flow sets one. */
1073
+ age?: AgeResult;
1074
+ /**
1075
+ * ID mode only, on `completed` / `failed`: the ICAO portrait can be fetched
1076
+ * with {@link SessionsApi.portrait} (the event never carries the image).
1077
+ */
1078
+ portraitAvailable?: boolean;
1079
+ }
1080
+ /**
1081
+ * `data` of `subject.updated` — either a session linked to the subject reached
1082
+ * a terminal state (`sessionId`, session `status`, `outcome`), or the subject
1083
+ * was revoked (`status: 'revoked'`, no session). Ids and enums only.
1084
+ * @public
1085
+ */
1086
+ interface SubjectUpdatedEventData {
1087
+ subjectId: string;
1088
+ /** The session that reached a terminal state; absent on a revocation. */
1089
+ sessionId?: string;
1090
+ status: SessionStatus | "revoked";
1091
+ /** The session outcome; absent on a revocation. */
1092
+ outcome?: SessionOutcome | null;
1093
+ /** The session's level; absent on a revocation. */
1094
+ level?: VerificationLevel | null;
1095
+ /** The session's assurance; absent on a revocation. */
1096
+ assurance?: VerificationAssurance | null;
1097
+ /**
1098
+ * Your own ids for the person (`subject.externalRef` values), so a
1099
+ * revocation can find your user without a lookup. Absent from older API versions.
1100
+ */
1101
+ externalRefs?: string[];
1102
+ }
1103
+ /**
1104
+ * `data` of `subject.enrolled` — the subject's first reference photo was
1105
+ * stored (it can now be used for returning-user sessions). Ids and enums only.
1106
+ * @public
1107
+ */
1108
+ interface SubjectEnrolledEventData {
1109
+ subjectId: string;
1110
+ /** The approved session the reference photo came from. */
1111
+ sessionId: string;
1112
+ assurance: SubjectAssurance;
1113
+ }
1114
+ /**
1115
+ * `data` of `subject.deleted`. A delete through the subjects API carries
1116
+ * `subjectId`; a right-to-erasure request carries the tokenized `subjectRef`
1117
+ * (with `orgId` / `env`) instead — never the national number.
1118
+ * @public
1119
+ */
1120
+ interface SubjectDeletedEventData {
1121
+ subjectId?: string;
1122
+ subjectRef?: string;
1123
+ orgId?: string;
1124
+ env?: SekyroEnvironment;
1125
+ /**
1126
+ * With `subjectId` (a delete through the subjects API): your own ids for
1127
+ * the person, so you can find your user. Never on the erasure variant.
1128
+ */
1129
+ externalRefs?: string[];
1130
+ }
1131
+ /** Subject lifecycle: a revoked subject cannot be reused. @public */
1132
+ type SubjectStatus = "active" | "revoked";
1133
+ /**
1134
+ * How strongly a subject's identity was established: the reference photo
1135
+ * came from the national registry, the document's chip (`chip_biometric`, a
1136
+ * passed chip read plus a face match) or the document, and a face match passed
1137
+ * (`*_biometric`) or the session had no face match (`*_only`). `supplied_*`:
1138
+ * partner-supplied identity data (`input.suppliedIdentity`), with
1139
+ * (`supplied_biometric`) or without (`supplied_only`) a face match against its photo.
1140
+ * @public
1141
+ */
1142
+ type SubjectAssurance = "registry_biometric" | "chip_biometric" | "document_biometric" | "registry_only" | "document_only" | "supplied_biometric" | "supplied_only";
1143
+ /**
1144
+ * Origin of a subject's stored reference photo, best first (`chip`: the document chip's portrait;
1145
+ * `org_supplied`: the photo of your partner-supplied identity data).
1146
+ * @public
1147
+ */
1148
+ type SubjectReferenceSource = "registry" | "doc_registry" | "chip" | "org_supplied" | "document";
1149
+ /** One session linked to a subject. @public */
1150
+ interface SubjectSession {
1151
+ sessionId: string;
1152
+ appId: string | null;
1153
+ /** ISO 8601 — when the session was linked. */
1154
+ at: string;
1155
+ status: SessionStatus;
1156
+ outcome: SessionOutcome | null;
1157
+ /** What the session proved; present only when stored (sessions linked before the field existed have none). */
1158
+ level?: VerificationLevel;
1159
+ /** How the session's level was proved; present only when stored. */
1160
+ assurance?: VerificationAssurance;
1161
+ }
1162
+ /**
1163
+ * A subject (the same person across your apps), as `GET /subjects/:id`
1164
+ * returns it. Never contains photo keys or URLs.
1165
+ * @public
1166
+ */
1167
+ interface Subject {
1168
+ id: string;
1169
+ status: SubjectStatus;
1170
+ /** ISO 8601 — present only when revoked. */
1171
+ revokedAt?: string;
1172
+ sessions: SubjectSession[];
1173
+ externalRefs: string[];
1174
+ /** ISO 8601. */
1175
+ firstSeenAt: string;
1176
+ /** ISO 8601. */
1177
+ lastSeenAt: string;
1178
+ /** ISO 8601, or `null` before the first approved session. */
1179
+ lastPassedAt: string | null;
1180
+ /** ISO 8601 of the last approved full or returning session, or `null`. */
1181
+ lastVerifiedAt: string | null;
1182
+ /** The stored reference photo's origin and date — `null` until one is stored. */
1183
+ reference: {
1184
+ source: SubjectReferenceSource;
1185
+ capturedAt: string;
1186
+ } | null;
1187
+ assurance: SubjectAssurance | null;
1188
+ /**
1189
+ * The highest {@link VerificationLevel} an approved linked session proved;
1190
+ * `0` once the subject is revoked; `null` when no terminal session was
1191
+ * recorded since the field exists. Absent from API versions before the field.
1192
+ */
1193
+ level?: VerificationLevel | null | undefined;
1194
+ /** ISO 8601: when {@link Subject.level} was last proved (the latest approved session at that level or higher); `null` with it. Absent with it. */
1195
+ levelAt?: string | null | undefined;
1196
+ /** The assurance of the session that proved {@link Subject.level}; `null` with it. Absent with it. */
1197
+ levelAssurance?: VerificationAssurance | null | undefined;
1198
+ /**
1199
+ * A returning-user session can be created now: active, a reference photo is
1200
+ * stored, and the last FULL verification (returning-user sessions do not
1201
+ * reset it) is within the returning-user limit of your app's default flow
1202
+ * (`settings.returning`: turned on, and `maxAgeMonths` when set).
1203
+ */
1204
+ returningReady: boolean;
1205
+ /** The verified name / birth date of the latest approved session. */
1206
+ display?: {
1207
+ name?: string;
1208
+ birthDate?: string;
1209
+ };
1210
+ }
1211
+ /**
1212
+ * Filters of {@link SessionsApi.list}: your own user id
1213
+ * (`subject.externalRef` at create) and/or a status.
1214
+ * @public
1215
+ */
1216
+ interface ListSessionsQuery {
1217
+ /** Your own id for the person (1 to 128 characters). */
1218
+ externalRef?: string;
1219
+ status?: SessionStatus;
1220
+ }
1221
+ /** Result of {@link SubjectsApi.delete}. @public */
1222
+ interface DeletedSubject {
1223
+ id: string;
1224
+ deleted: true;
1225
+ }
1226
+ /** Options of {@link SubjectsApi.revoke}. @public */
1227
+ interface RevokeSubjectInput {
1228
+ /** Kept on the audit trail only (≤ 500 characters). Do not put personal data here. */
1229
+ reason?: string;
1230
+ }
1231
+ /**
1232
+ * `data` of `subject.suspicious_activity` — a device already linked to
1233
+ * ANOTHER subject was used for a session of this subject. `count` is the
1234
+ * subject's running total of such events. Ids only.
1235
+ * @public
1236
+ */
1237
+ interface SubjectSuspiciousActivityEventData {
1238
+ subjectId: string;
1239
+ sessionId: string;
1240
+ count: number;
1241
+ }
1242
+ /**
1243
+ * `data` of `session.step.completed` — the check that just passed.
1244
+ * @public
1245
+ */
1246
+ interface SessionStepCompletedEventData {
1247
+ sessionId: string;
1248
+ checkType: CheckType;
1249
+ state: CheckState;
1250
+ /** Sekyro flows: the flow node of the passed check. */
1251
+ nodeId?: string;
1252
+ /** Sekyro flows: the service of that node. */
1253
+ service?: ServiceId;
1254
+ /** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
1255
+ flow?: SessionFlowRef;
1256
+ /** The subject (person) the session is linked to, when known. */
1257
+ subjectId?: string;
1258
+ /** Your own id for the person, from `subject.externalRef` at create. */
1259
+ externalRef?: string;
1260
+ /**
1261
+ * `true` when an identifier this session read already belongs to a
1262
+ * different subject than `subjectId` — the subjects are never merged.
1263
+ */
1264
+ subjectConflict?: boolean;
1265
+ /** `true` on a returning-user session (liveness + face match against the stored photo). */
1266
+ returning?: true;
1267
+ /** On a returning-user session: the subject (person) it re-verifies. */
1268
+ reuseOf?: string;
1269
+ /** When the passed check is `phone_otp` / `email_otp`: that one verified contact. */
1270
+ verifiedContacts?: VerifiedContacts;
1271
+ }
1272
+ /**
1273
+ * `data` of `session.review_decided` — a human (or the review-timeout sweep)
1274
+ * decided a pending review. `outcome` speaks the REVIEW vocabulary
1275
+ * (`pass` | `fail`), not the session outcome; `reason` is the reviewer's code
1276
+ * (e.g. `review_timeout` for an expired review).
1277
+ * @public
1278
+ */
1279
+ interface SessionReviewDecidedEventData {
1280
+ sessionId: string;
1281
+ outcome: "pass" | "fail";
1282
+ reason: string;
1283
+ /** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
1284
+ flow?: SessionFlowRef;
1285
+ /** The subject (person) the session is linked to, when known. */
1286
+ subjectId?: string;
1287
+ /** Your own id for the person, from `subject.externalRef` at create. */
1288
+ externalRef?: string;
1289
+ /**
1290
+ * `true` when an identifier this session read already belongs to a
1291
+ * different subject than `subjectId` — the subjects are never merged.
1292
+ */
1293
+ subjectConflict?: boolean;
1294
+ /** `true` on a returning-user session (liveness + face match against the stored photo). */
1295
+ returning?: true;
1296
+ /** On a returning-user session: the subject (person) it re-verifies. */
1297
+ reuseOf?: string;
1298
+ /** ID mode only: the ICAO portrait can be fetched with {@link SessionsApi.portrait}. */
1299
+ portraitAvailable?: boolean;
1300
+ }
1301
+ /**
1302
+ * `usage.threshold_reached`: a usage, credit or spend threshold of the organization's
1303
+ * plan was reached (sent once per threshold and period). `kind` is `tier` for a monthly
1304
+ * tier, or the alert, e.g. `credit_80`, `usage_100_paid`, `spend_cap_reached`.
1305
+ * @public
1306
+ */
1307
+ interface UsageThresholdReachedEventData {
1308
+ kind: string;
1309
+ /** The verification unit, on per-unit alerts. */
1310
+ unit?: "human_verification" | "identity_verification";
1311
+ /** Percent of the limit (80, 100), or `overage` for the first verification beyond a tier. */
1312
+ threshold?: number | "overage";
1313
+ used?: number;
1314
+ limit?: number;
1315
+ /** UTC month, `YYYY-MM`. */
1316
+ period?: string;
1317
+ /** Tier alerts: verifications that reached a result this month. */
1318
+ confirmed?: number;
1319
+ /** Tier alerts: verifications beyond the tier this month. */
1320
+ overage?: number;
1321
+ }
1322
+ /**
1323
+ * Event type → the shape of its `data`. Session events are typed; the
1324
+ * remaining events carry an open record until their payloads are frozen.
1325
+ * @public
1326
+ */
1327
+ interface WebhookEventDataMap {
1328
+ "session.created": Record<string, unknown>;
1329
+ "session.started": Record<string, unknown>;
1330
+ "session.step.completed": SessionStepCompletedEventData;
1331
+ "session.review_pending": SessionLifecycleEventData;
1332
+ "session.review_decided": SessionReviewDecidedEventData;
1333
+ "session.completed": SessionLifecycleEventData;
1334
+ "session.expired": SessionLifecycleEventData;
1335
+ "session.failed": SessionLifecycleEventData;
1336
+ "subject.enrolled": SubjectEnrolledEventData;
1337
+ "subject.updated": SubjectUpdatedEventData;
1338
+ "subject.suspicious_activity": SubjectSuspiciousActivityEventData;
1339
+ "subject.deleted": SubjectDeletedEventData;
1340
+ "aml.match_flagged": Record<string, unknown>;
1341
+ "payment.received": Record<string, unknown>;
1342
+ "invoice.generated": Record<string, unknown>;
1343
+ "invoice.paid": Record<string, unknown>;
1344
+ "invoice.overdue": Record<string, unknown>;
1345
+ "usage.threshold_reached": UsageThresholdReachedEventData;
1346
+ "webhook.test": Record<string, unknown>;
1347
+ }
1348
+ /** Every event a partner endpoint may receive. @public */
1349
+ type WebhookEventType = keyof WebhookEventDataMap;
1350
+ /**
1351
+ * The signed webhook payload for ONE event type. There is no global API
1352
+ * version; each event carries its own per-event `version`. Retried deliveries
1353
+ * keep the same `id` — de-duplicate on it.
1354
+ * @public
1355
+ */
1356
+ interface WebhookEnvelopeOf<E extends WebhookEventType> {
1357
+ /** UUIDv7, stable across delivery retries. */
1358
+ id: string;
1359
+ event: E;
1360
+ /** Per-event payload version. */
1361
+ version: number;
1362
+ /** ISO 8601. */
1363
+ createdAt: string;
1364
+ orgId: string;
1365
+ env: SekyroEnvironment;
1366
+ data: WebhookEventDataMap[E];
1367
+ }
1368
+ /**
1369
+ * The signed webhook payload, discriminated on `event`: narrowing on
1370
+ * `envelope.event` narrows `envelope.data` to that event's shape.
1371
+ *
1372
+ * @example
1373
+ * ```ts
1374
+ * const envelope = verifyWebhook(rawBody, header, secret);
1375
+ * switch (envelope.event) {
1376
+ * case "session.completed":
1377
+ * envelope.data.outcome; // SessionOutcome | null | undefined
1378
+ * break;
1379
+ * case "session.review_decided":
1380
+ * envelope.data.outcome; // "pass" | "fail"
1381
+ * break;
1382
+ * }
1383
+ * ```
1384
+ * @public
1385
+ */
1386
+ type WebhookEnvelope<E extends WebhookEventType = WebhookEventType> = E extends WebhookEventType ? WebhookEnvelopeOf<E> : never;
1387
+ /**
1388
+ * `data` of any `session.*` event.
1389
+ * @deprecated Use {@link SessionLifecycleEventData}, {@link SessionStepCompletedEventData}
1390
+ * or {@link SessionReviewDecidedEventData}, or narrow a {@link WebhookEnvelope} on `event`.
1391
+ * @public
1392
+ */
1393
+ type SessionEventData = SessionLifecycleEventData | SessionStepCompletedEventData | SessionReviewDecidedEventData;
1394
+
1395
+ /** Default partner API origin + version prefix. @public */
1396
+ declare const DEFAULT_BASE_URL = "https://api.sekyro.ai/api/v2";
1397
+ /** Default per-request timeout. @public */
1398
+ declare const DEFAULT_TIMEOUT_MS = 30000;
1399
+ /** `fetch`-compatible function; the global `fetch` by default. @public */
1400
+ type FetchLike = typeof globalThis.fetch;
1401
+ /** Constructor options of {@link Sekyro}. @public */
1402
+ interface SekyroOptions {
1403
+ /** Partner API key (server-side only). Sent as `Authorization: Bearer`. */
1404
+ apiKey: string;
1405
+ /** API base URL incl. the `/api/v2` prefix. Default {@link DEFAULT_BASE_URL}. */
1406
+ baseUrl?: string;
1407
+ /** Per-request timeout in ms. Default {@link DEFAULT_TIMEOUT_MS}. */
1408
+ timeoutMs?: number;
1409
+ /** Custom `fetch` (tests, proxies, custom agents). Default `globalThis.fetch`. */
1410
+ fetch?: FetchLike;
1411
+ }
1412
+ /**
1413
+ * `sekyro.sessions` — create and read verification sessions.
1414
+ *
1415
+ * Exported as a TYPE only (`import type { SessionsApi }`): the class value is
1416
+ * not part of the package surface, so it can only be obtained through
1417
+ * {@link Sekyro.sessions} — never constructed by hand with an unchecked
1418
+ * transport.
1419
+ * @public
1420
+ */
1421
+ declare class SessionsApi {
1422
+ private readonly call;
1423
+ /**
1424
+ * Constructed by {@link Sekyro}; the transport is kept out of the public
1425
+ * surface on purpose (only its bound `call` crosses this boundary).
1426
+ * @internal
1427
+ */
1428
+ constructor(call: <T>(method: "GET" | "POST" | "DELETE", path: string, body?: unknown, idempotencyKey?: string) => Promise<T>);
1429
+ /**
1430
+ * `POST /sessions`. Returns the one-time `clientToken` — hand it to the
1431
+ * browser, never persist it. Pass an `idempotencyKey` so a retried call
1432
+ * cannot create a second session.
1433
+ */
1434
+ create(input?: CreateSessionInput, opts?: RequestOptions): Promise<CreatedSession>;
1435
+ /**
1436
+ * `POST /sessions/:id/method` — choose the identity method of an
1437
+ * optional-document session on the person's behalf (the hosted method
1438
+ * screen is then skipped). `409 method_locked` once the choice can no
1439
+ * longer change; `409 session_not_active` on a finished or expired session.
1440
+ * On a flow session: `409 choice_not_found` (the flow has no identity-method
1441
+ * choice), `409 choice_locked`, `409 choice_option_unavailable` (see
1442
+ * {@link isFlowError}).
1443
+ */
1444
+ selectMethod(id: string, method: IdentityMethod): Promise<Session>;
1445
+ /** `GET /sessions/:id` — the whitelisted view (no client token). */
1446
+ get(id: string): Promise<Session>;
1447
+ /**
1448
+ * `GET /sessions?externalRef=&status=`: your newest sessions (at most 100),
1449
+ * optionally filtered by your own user id and/or a status. The filters are
1450
+ * applied again to the answer, so an API that ignores them never returns
1451
+ * another user's sessions.
1452
+ */
1453
+ list(query?: ListSessionsQuery): Promise<Session[]>;
1454
+ /**
1455
+ * `GET /sessions/:id/portrait?format=url` — ID mode: a 5-minute presigned
1456
+ * link to the 480×640 ICAO portrait (JPEG). Needs the `portrait:read` scope
1457
+ * (keys minted from the dashboard carry it). `404 portrait_not_available`
1458
+ * until the session's `portrait_icao` check has passed (`portraitAvailable`).
1459
+ */
1460
+ portrait(id: string): Promise<SessionPortraitLink>;
1461
+ /**
1462
+ * `GET /sessions/:id/result-token`: a freshly signed result token for a
1463
+ * finished session (valid 10 minutes; check it with
1464
+ * {@link verifyResultToken}). `409 session_not_terminal` while the session
1465
+ * is still active. Needs the `sessions:read` scope.
1466
+ */
1467
+ resultToken(id: string): Promise<ResultTokenResponse>;
1468
+ }
1469
+ /**
1470
+ * `sekyro.subjects` — read and manage subjects (the same person across your
1471
+ * apps). Reads need the `subjects:read` scope, `revoke` / `delete` the
1472
+ * `subjects:write` scope (keys minted from the dashboard carry both; an older
1473
+ * key answers `403 insufficient_scope`). A foreign or unknown id answers
1474
+ * `404 subject_not_found`.
1475
+ *
1476
+ * Type-only export, like {@link SessionsApi}: obtained through
1477
+ * {@link Sekyro.subjects}.
1478
+ * @public
1479
+ */
1480
+ declare class SubjectsApi {
1481
+ private readonly call;
1482
+ /** @internal */
1483
+ constructor(call: <T>(method: "GET" | "POST" | "DELETE", path: string, body?: unknown, idempotencyKey?: string) => Promise<T>);
1484
+ /** `GET /subjects/:id` — the subject, its sessions and its returning-user readiness. */
1485
+ get(id: string): Promise<Subject>;
1486
+ /** `GET /subjects?externalRef=…` — the subjects carrying your own id (newest first, at most 50). */
1487
+ list(query: {
1488
+ externalRef: string;
1489
+ }): Promise<Subject[]>;
1490
+ /**
1491
+ * `POST /subjects/:id/revoke` — the subject can no longer be used for
1492
+ * returning-user sessions. Idempotent: revoking again returns the same view.
1493
+ * Emits `subject.updated` with `status: 'revoked'`.
1494
+ */
1495
+ revoke(id: string, input?: RevokeSubjectInput, opts?: RequestOptions): Promise<Subject>;
1496
+ /**
1497
+ * `DELETE /subjects/:id` — deletes the subject's stored photos, face
1498
+ * templates and identifiers, and unlinks its sessions. Emits
1499
+ * `subject.deleted`. Cannot be undone; a second call answers `404`.
1500
+ */
1501
+ delete(id: string): Promise<DeletedSubject>;
1502
+ /**
1503
+ * A re-check or step-up session for an existing subject in one call:
1504
+ * `POST /subjects/:id/sessions` when `target` is a subject id (24
1505
+ * hexadecimal characters) or `{ subjectId }`, otherwise
1506
+ * `POST /subjects/by-external-ref/:externalRef/sessions` (pass
1507
+ * `{ externalRef }` to force it). Same result and errors as
1508
+ * {@link SessionsApi.create}; needs the `sessions:create` and
1509
+ * `subjects:read` scopes.
1510
+ */
1511
+ createSession(target: string | SubjectSessionTarget, input: SubjectSessionInput, opts?: RequestOptions): Promise<CreatedSession>;
1512
+ }
1513
+ /**
1514
+ * Sekyro AI partner API client. Server-side only: it carries your API key.
1515
+ *
1516
+ * Throws {@link SekyroConfigError} synchronously when `apiKey` is missing or
1517
+ * `baseUrl` is not `https:` (plain `http:` is accepted for `localhost`,
1518
+ * `127.0.0.1` and `[::1]` only).
1519
+ *
1520
+ * @example
1521
+ * ```ts
1522
+ * const sekyro = new Sekyro({ apiKey: process.env.SEKYRO_API_KEY! });
1523
+ * const { id, clientToken } = await sekyro.sessions.create({ input: { nni: "1357924632" } });
1524
+ * ```
1525
+ * @public
1526
+ */
1527
+ declare class Sekyro {
1528
+ #private;
1529
+ readonly sessions: SessionsApi;
1530
+ readonly subjects: SubjectsApi;
1531
+ constructor(opts: SekyroOptions);
1532
+ /**
1533
+ * `GET /flows` — the published flows of the API key's app (default flow
1534
+ * first, then by name). Pass a flow's `slug` or `id` as
1535
+ * {@link CreateSessionInput.flow}. Needs the `sessions:create` scope; an
1536
+ * invalid key answers `401 unauthorized`.
1537
+ */
1538
+ listFlows(): Promise<FlowSummary[]>;
1539
+ }
1540
+
1541
+ export { type SessionFailureReason as $, type AgeMethod as A, type LevelTarget as B, type CreatedSession as C, DEFAULT_BASE_URL as D, type EidResult as E, type FetchLike as F, type ListSessionsQuery as G, type PortraitReportEntry as H, type IdentityMethod as I, type ProbeBindingReason as J, type ProbeQuality as K, type Locale as L, type MatchReason as M, type ProfileDocumentType as N, type RequestOptions as O, type PolicyFailureReason as P, type ResultTokenResponse as Q, type ResultRisk as R, Sekyro as S, type RevokeSubjectInput as T, type SekyroOptions as U, type VerificationLevel as V, type WebhookEventType as W, type Session as X, type SessionDevice as Y, type SessionDeviceSignal as Z, type SessionEventData as _, type ServiceId as a, type SessionFlowRef as a0, type SessionLifecycleEventData as a1, type SessionLinkInput as a2, type SessionNetwork as a3, type SessionNetworkEvent as a4, type SessionPortraitLink as a5, type SessionReviewDecidedEventData as a6, type SessionStatus as a7, type SessionStep as a8, type SessionStepCompletedEventData as a9, type SessionSubjectInput as aa, SessionsApi as ab, type Subject as ac, type SubjectAssurance as ad, type SubjectDeletedEventData as ae, type SubjectEnrolledEventData as af, type SubjectReferenceSource as ag, type SubjectReuseDocument as ah, type SubjectReuseTarget as ai, type SubjectSession as aj, type SubjectSessionInput as ak, type SubjectSessionTarget as al, type SubjectStatus as am, type SubjectSuspiciousActivityEventData as an, type SubjectUpdatedEventData as ao, SubjectsApi as ap, type UsageThresholdReachedEventData as aq, type VerifiedContacts as ar, type WebhookEnvelopeOf as as, type WebhookEventDataMap as at, type SuppliedIdentityRecord as b, type WebhookEnvelope as c, type SekyroEnvironment as d, type VerificationAssurance as e, type SessionOutcome as f, type VerificationUnit as g, type SubjectReuseMode as h, type ResultCheckProofs as i, type ResultDuplicate as j, type AgeResult as k, type CameraUnavailableCause as l, type CheckState as m, type CheckType as n, type CreateSessionInput as o, DEFAULT_TIMEOUT_MS as p, type DecisionReason as q, type DeepPartial as r, type DeletedSubject as s, type DeliverOptions as t, type DocumentSubstitutionSettings as u, type EligibilityReason as v, type FlowOverridableSettings as w, type FlowOverrides as x, type FlowServiceSettings as y, type FlowSummary as z };