@sekyro/node 0.1.0-rc.10 → 0.1.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +165 -87
- package/dist/chunk-D53NUEJ6.js +1 -0
- package/dist/{chunk-TAPXGI3Q.js → chunk-SZQEL3LK.js} +1 -1
- package/dist/{client-Hkxwn6ZA.d.cts → client-edr9f2Ec.d.cts} +805 -110
- package/dist/{client-Hkxwn6ZA.d.ts → client-edr9f2Ec.d.ts} +805 -110
- package/dist/connect/express/index.cjs +1 -1
- package/dist/connect/express/index.d.cts +2 -2
- package/dist/connect/express/index.d.ts +2 -2
- package/dist/connect/express/index.js +1 -1
- package/dist/connect/index.cjs +1 -1
- package/dist/connect/index.d.cts +2 -2
- package/dist/connect/index.d.ts +2 -2
- package/dist/connect/index.js +1 -1
- package/dist/connect/next/index.cjs +1 -1
- package/dist/connect/next/index.d.cts +2 -2
- package/dist/connect/next/index.d.ts +2 -2
- package/dist/connect/next/index.js +1 -1
- package/dist/{connector-C4NuetEm.d.cts → connector-C0M4NWwZ.d.cts} +23 -14
- package/dist/{connector-BInF_yHb.d.ts → connector-DKP_ebGH.d.ts} +23 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +61 -14
- package/dist/index.d.ts +61 -14
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +7 -7
- package/dist/chunk-O5GJ3YJV.js +0 -1
|
@@ -11,9 +11,15 @@ type SessionStatus = "created" | "in_progress" | "review_pending" | "completed"
|
|
|
11
11
|
/**
|
|
12
12
|
* Terminal verdict, orthogonal to {@link SessionStatus}. `null` until the session
|
|
13
13
|
* reaches a terminal status; `review` when a human reviewer must adjudicate.
|
|
14
|
+
* A session that waited for a review and was taken over by a newer attempt of
|
|
15
|
+
* the same person (`session.superseded`) has `outcome: null` and names that
|
|
16
|
+
* attempt in {@link Session.supersededBy}: read the newer session for the
|
|
17
|
+
* verdict. `superseded` is no longer sent on the session view, its webhooks or
|
|
18
|
+
* the result token; it stays in this union for one release and may still
|
|
19
|
+
* appear on {@link PersonSession.outcome}.
|
|
14
20
|
* @public
|
|
15
21
|
*/
|
|
16
|
-
type SessionOutcome = "approved" | "review" | "rejected";
|
|
22
|
+
type SessionOutcome = "approved" | "review" | "rejected" | "superseded";
|
|
17
23
|
/**
|
|
18
24
|
* What a finished session proved: `1` a live, real person (human), `2` that
|
|
19
25
|
* person's identity (document, chip, registry or supplied data bound to the
|
|
@@ -82,8 +88,9 @@ interface AgeResult {
|
|
|
82
88
|
estimate?: number;
|
|
83
89
|
sigma?: number;
|
|
84
90
|
}
|
|
85
|
-
/** Another
|
|
91
|
+
/** Another person the face already matched (duplicate search). @public */
|
|
86
92
|
interface ResultDuplicate {
|
|
93
|
+
/** That person's id, bare (24 hexadecimal characters). */
|
|
87
94
|
subjectId: string;
|
|
88
95
|
externalRef?: string;
|
|
89
96
|
}
|
|
@@ -127,10 +134,14 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
|
|
|
127
134
|
* people than `device.velocity` allows, with `action: 'block'`;
|
|
128
135
|
* - `device_cooldown` — the device had too many rejected sessions
|
|
129
136
|
* (`cooldown` tiers); {@link Session.retryAfter} says when it may try again.
|
|
130
|
-
* Not billed
|
|
137
|
+
* Not billed;
|
|
138
|
+
* - `platform_unsupported` — the flow requires a chip read and the person
|
|
139
|
+
* opened the link on the web (the link stays usable in a native app);
|
|
140
|
+
* - `cancelled_by_organization` — you cancelled the session
|
|
141
|
+
* ({@link SessionsApi.cancel}).
|
|
131
142
|
* @public
|
|
132
143
|
*/
|
|
133
|
-
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown";
|
|
144
|
+
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "cancelled_by_organization";
|
|
134
145
|
/**
|
|
135
146
|
* Profile-v2 decision-mode reasons a check's {@link SessionStep.reason} may
|
|
136
147
|
* carry when the app decides automatically (`decisions.mode: 'automatic'`)
|
|
@@ -160,10 +171,13 @@ type EligibilityReason = "document_type_not_accepted" | "nationality_not_allowed
|
|
|
160
171
|
* `document_id_number_mismatch` (the document belongs to someone other than the
|
|
161
172
|
* ID number the session was created for; `document_nni_mismatch` is its former
|
|
162
173
|
* name, still sent until the API switches to the new names), or `camera_unavailable` (spec 2026-10-29 §3.4: the person had no usable camera,
|
|
163
|
-
* so the live step ended without a capture; the session is rejected at level 0 unless your flow has a fallback)
|
|
174
|
+
* so the live step ended without a capture; the session is rejected at level 0 unless your flow has a fallback),
|
|
175
|
+
* `subject_face_mismatch` (a step-up whose face did not match the person it was created for), or a review that
|
|
176
|
+
* ended at its deadline: `review_timeout` (nobody decided it) or `review_split` (two reviewers disagreed and
|
|
177
|
+
* nobody settled it); those two carry `decidedBy: "automatic"`.
|
|
164
178
|
* @public
|
|
165
179
|
*/
|
|
166
|
-
type PolicyFailureReason = SessionFailureReason | EligibilityReason | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable";
|
|
180
|
+
type PolicyFailureReason = SessionFailureReason | EligibilityReason | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable" | "subject_face_mismatch" | "review_timeout" | "review_split";
|
|
167
181
|
/**
|
|
168
182
|
* The ID-number reasons a check's {@link SessionStep.reason} may carry (person data
|
|
169
183
|
* spec Appendix A.2), each under its generic name and its former Mauritanian name:
|
|
@@ -191,6 +205,92 @@ type CameraUnavailableCause = "denied" | "no_camera";
|
|
|
191
205
|
* @public
|
|
192
206
|
*/
|
|
193
207
|
type MatchReason = "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
|
|
208
|
+
/**
|
|
209
|
+
* Reasons a `face_match` {@link SessionStep.reason} carries when an earlier
|
|
210
|
+
* human review of the same person, reference photo and face settled the match
|
|
211
|
+
* score instead of a new review: `prior_review_approved` (the step passed;
|
|
212
|
+
* final) and `prior_review_rejected` (the step failed; retryable, a better
|
|
213
|
+
* capture sends the session to a reviewer again). Both are billed like
|
|
214
|
+
* `review_band`. The step's {@link SessionStep.decision} has
|
|
215
|
+
* `source: "prior_review"` and names your earlier session.
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
type PriorReviewReason = "prior_review_approved" | "prior_review_rejected";
|
|
219
|
+
/**
|
|
220
|
+
* Review outcome reasons any reviewable step may carry: `superseded_by_retry`
|
|
221
|
+
* (a newer attempt of the same person took the review over; the session ends
|
|
222
|
+
* with `outcome: null` and {@link Session.supersededBy}) and `review_split` (two reviewers disagreed and
|
|
223
|
+
* nobody settled it before the review deadline; the session is rejected).
|
|
224
|
+
* Both are billed and retryable: the person may verify again. Neither counts
|
|
225
|
+
* toward the device cooldown.
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
type ReviewOutcomeReason = "superseded_by_retry" | "review_split";
|
|
229
|
+
/**
|
|
230
|
+
* What a review decision is about, on {@link SessionStepDecision.reasons}: the
|
|
231
|
+
* part that failed on a rejection (several may apply), or the check the
|
|
232
|
+
* reviewer overrode on an approval.
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
type ReviewReason = "document_authenticity" | "liveness" | "face_match" | "data_mismatch" | "other";
|
|
236
|
+
/**
|
|
237
|
+
* How a person decided a step: a reviewer (`source: "review"`), or an earlier
|
|
238
|
+
* review of the same person, reference photo and face that was reused
|
|
239
|
+
* (`source: "prior_review"`). Counts and enums only: never a reviewer's
|
|
240
|
+
* identity and never an individual vote.
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
interface SessionStepDecision {
|
|
244
|
+
source: "review" | "prior_review";
|
|
245
|
+
/** One reviewer (`single`) or two independent reviewers (`dual`). */
|
|
246
|
+
mode: "single" | "dual";
|
|
247
|
+
/** How many reviewer votes formed the decision (a third vote settles a dual split). */
|
|
248
|
+
votes: 1 | 2 | 3;
|
|
249
|
+
/** Dual review only: whether the first two reviewers agreed. */
|
|
250
|
+
agreement?: boolean;
|
|
251
|
+
/** What the decision was about ({@link ReviewReason}). */
|
|
252
|
+
reasons: ReviewReason[];
|
|
253
|
+
/** ISO 8601: when the decision was made. */
|
|
254
|
+
decidedAt: string;
|
|
255
|
+
/** `prior_review` only: your earlier session whose review decided this one. */
|
|
256
|
+
sessionId?: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A failure identification match (terminal sessions, when the flow's
|
|
260
|
+
* identify-failures setting is on and the search found one): who the face
|
|
261
|
+
* matches when the face match did not prove the claimed identity against a
|
|
262
|
+
* registry portrait. A signal, never a decision: the session state is
|
|
263
|
+
* unchanged. Ids, enums and numbers only, never a name or an ID number.
|
|
264
|
+
*
|
|
265
|
+
* `kind`: `presenter` (the live person is most likely the matched record),
|
|
266
|
+
* `shown_face` (the photo or screen shown carries the matched record, a
|
|
267
|
+
* possible victim) or `other_identity`. `other_identity` is informational
|
|
268
|
+
* only: the registry also knows this face under another record. The person may
|
|
269
|
+
* legitimately hold more than one identity document, for example a foreign
|
|
270
|
+
* passport, an older document, a second nationality or a residence permit. Do
|
|
271
|
+
* not treat this signal alone as fraud: use it as a lead for your own process.
|
|
272
|
+
* @public
|
|
273
|
+
*/
|
|
274
|
+
interface FailureIdentification {
|
|
275
|
+
kind: "presenter" | "shown_face" | "other_identity";
|
|
276
|
+
/** The search scope: your verified persons (`org`) or the whole registry index (`registry`). */
|
|
277
|
+
scope: "org" | "registry";
|
|
278
|
+
match: {
|
|
279
|
+
/** Your verified subject for the matched person, when you hold one. */
|
|
280
|
+
subjectId?: string;
|
|
281
|
+
/** An opaque reference of the matched person when you hold no verified subject for it, scoped to your organisation. */
|
|
282
|
+
reference?: string;
|
|
283
|
+
/** The registry photo that matched (an opaque id, scoped to your organisation). */
|
|
284
|
+
photoId?: string;
|
|
285
|
+
/** The grade of that photo: `1` or `2` registry, `3` an older bulk import photo. */
|
|
286
|
+
tier: 1 | 2 | 3;
|
|
287
|
+
/** Calibrated similarity on the face match scale, in [0, 1]. */
|
|
288
|
+
score: number;
|
|
289
|
+
band: "strong" | "moderate";
|
|
290
|
+
};
|
|
291
|
+
/** With `other_identity`: the reference the session passed against. */
|
|
292
|
+
referenceSource?: "registry" | "chip" | "document" | "subject" | "org_supplied";
|
|
293
|
+
}
|
|
194
294
|
/**
|
|
195
295
|
* Face-match probe-binding reason a `face_match` {@link SessionStep.reason} may
|
|
196
296
|
* carry (SDK spec §4.10): `probe_not_from_liveness` — the face image isn't the
|
|
@@ -214,12 +314,18 @@ type SekyroEnvironment = "sandbox" | "live";
|
|
|
214
314
|
* @public
|
|
215
315
|
*/
|
|
216
316
|
interface SessionStep {
|
|
317
|
+
/** The node of your flow this step belongs to (e.g. `n_live`): the name of the step. Absent on sessions created before flows. */
|
|
318
|
+
id?: string;
|
|
319
|
+
/** What the step runs: the service of its node. Absent on sessions created before flows. */
|
|
320
|
+
service?: ServiceId;
|
|
321
|
+
/**
|
|
322
|
+
* @deprecated Read {@link SessionStep.service}. The internal check this step
|
|
323
|
+
* runs; removed from the API after this release.
|
|
324
|
+
*/
|
|
217
325
|
checkType: CheckType;
|
|
218
326
|
state: CheckState;
|
|
219
|
-
/**
|
|
327
|
+
/** @deprecated Read {@link SessionStep.id}, which holds the same node id. */
|
|
220
328
|
nodeId?: string;
|
|
221
|
-
/** Sekyro flows: the service of that node. */
|
|
222
|
-
service?: ServiceId;
|
|
223
329
|
/** Sekyro flows: the check failed and the flow's fallback took over. */
|
|
224
330
|
handled?: true;
|
|
225
331
|
/** Machine-readable failure/review reason, when the check has one. */
|
|
@@ -241,6 +347,13 @@ interface SessionStep {
|
|
|
241
347
|
* information only: it never changes the step's state or reason.
|
|
242
348
|
*/
|
|
243
349
|
probeQuality?: ProbeQuality;
|
|
350
|
+
/**
|
|
351
|
+
* How a person decided this step ({@link SessionStepDecision}); absent when
|
|
352
|
+
* no person decided it.
|
|
353
|
+
*/
|
|
354
|
+
decision?: SessionStepDecision;
|
|
355
|
+
/** The step last ran simulated in the Sandbox (no paid or external service). */
|
|
356
|
+
simulated?: true;
|
|
244
357
|
}
|
|
245
358
|
/**
|
|
246
359
|
* The probe-quality measurement on a `face_match` step. Numbers only; `null`
|
|
@@ -275,6 +388,7 @@ interface PortraitReportEntry {
|
|
|
275
388
|
/**
|
|
276
389
|
* A short-lived link to a session's ICAO portrait (480×640 JPEG), from
|
|
277
390
|
* {@link SessionsApi.portrait}. Download it before `expiresAt`; never store the URL.
|
|
391
|
+
* @deprecated Use {@link SessionsApi.media} and its `icao_portrait` item ({@link MediaItem}).
|
|
278
392
|
* @public
|
|
279
393
|
*/
|
|
280
394
|
interface SessionPortraitLink {
|
|
@@ -319,7 +433,28 @@ interface SubjectName {
|
|
|
319
433
|
patronymic?: string;
|
|
320
434
|
}
|
|
321
435
|
/**
|
|
322
|
-
*
|
|
436
|
+
* One birth place entry of {@link SessionPersonInput.birthPlace}: the place in
|
|
437
|
+
* one script (ISO 15924 code, e.g. `Latn` or `Arab`), 1 to 120 characters.
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
interface PersonBirthPlaceInput {
|
|
441
|
+
script: string;
|
|
442
|
+
value: string;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* The person's identity document ({@link SessionPersonInput.document}): its
|
|
446
|
+
* type, issuing country (ISO 3166-1 alpha-2 or alpha-3) and the number it
|
|
447
|
+
* prints (1 to 40 letters, digits, spaces or hyphens). Compared with what the
|
|
448
|
+
* capture reads; it does not bind the session (`idNumber` does).
|
|
449
|
+
* @public
|
|
450
|
+
*/
|
|
451
|
+
interface PersonDocumentInput {
|
|
452
|
+
type: "national_id" | "passport" | "residence_permit";
|
|
453
|
+
issuingCountry: string;
|
|
454
|
+
number: string;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* What you already know about the person (`person` at session create). A
|
|
323
458
|
* closed object: unknown keys are refused (`400`). Every field is optional;
|
|
324
459
|
* `null` or blank counts as absent.
|
|
325
460
|
*
|
|
@@ -332,7 +467,7 @@ interface SubjectName {
|
|
|
332
467
|
* substitute another number.
|
|
333
468
|
* @public
|
|
334
469
|
*/
|
|
335
|
-
interface
|
|
470
|
+
interface SessionPersonInput {
|
|
336
471
|
/** The person's ID number. Binds the session. */
|
|
337
472
|
idNumber?: SubjectIdNumber;
|
|
338
473
|
/**
|
|
@@ -350,14 +485,24 @@ interface SessionSubjectInput {
|
|
|
350
485
|
names?: SubjectName[];
|
|
351
486
|
/** ISO 8601 date (`YYYY-MM-DD`). */
|
|
352
487
|
birthDate?: string;
|
|
353
|
-
/**
|
|
354
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Place of birth (kept only with a reference record): a string of 1 to 120
|
|
490
|
+
* characters in any script, or one entry per script (at most 4).
|
|
491
|
+
*/
|
|
492
|
+
birthPlace?: string | PersonBirthPlaceInput[];
|
|
355
493
|
/** `M`, `F` or `X` (ICAO 9303 values; kept only with a reference record). */
|
|
356
494
|
sex?: "M" | "F" | "X";
|
|
357
|
-
/** ISO 3166-1 alpha-2. */
|
|
495
|
+
/** ISO 3166-1 alpha-2 codes, 1 to 4. */
|
|
496
|
+
nationalities?: string[];
|
|
497
|
+
/**
|
|
498
|
+
* @deprecated Send `nationalities: [code]`. ISO 3166-1 alpha-2. Both keys
|
|
499
|
+
* with different values answer `400 subject_input_conflict`.
|
|
500
|
+
*/
|
|
358
501
|
nationality?: string;
|
|
502
|
+
/** The person's identity document ({@link PersonDocumentInput}). */
|
|
503
|
+
document?: PersonDocumentInput;
|
|
359
504
|
/**
|
|
360
|
-
* @deprecated
|
|
505
|
+
* @deprecated Send `document` (`type`, `issuingCountry`, `number`).
|
|
361
506
|
* Identity-document number (1 to 40 characters).
|
|
362
507
|
*/
|
|
363
508
|
documentNumber?: string;
|
|
@@ -376,7 +521,7 @@ interface SessionSubjectInput {
|
|
|
376
521
|
fetchedAt?: string;
|
|
377
522
|
/**
|
|
378
523
|
* Your own id for this person (1–128 characters). Echoed on the session and
|
|
379
|
-
* its webhooks, and searchable on the
|
|
524
|
+
* its webhooks, and searchable on the people API ({@link PeopleApi.list}).
|
|
380
525
|
*/
|
|
381
526
|
externalRef?: string;
|
|
382
527
|
/**
|
|
@@ -390,6 +535,11 @@ interface SessionSubjectInput {
|
|
|
390
535
|
*/
|
|
391
536
|
reuse?: SubjectReuseTarget;
|
|
392
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* @deprecated Use {@link SessionPersonInput} (the `person` create key).
|
|
540
|
+
* @public
|
|
541
|
+
*/
|
|
542
|
+
type SessionSubjectInput = SessionPersonInput;
|
|
393
543
|
/**
|
|
394
544
|
* An identity document for {@link SubjectReuseTarget}: the document type, the
|
|
395
545
|
* issuing country (ISO 3166-1 alpha-2 or alpha-3) and its number.
|
|
@@ -738,10 +888,16 @@ interface CreateSessionInput {
|
|
|
738
888
|
link?: SessionLinkInput;
|
|
739
889
|
/**
|
|
740
890
|
* What you already know about the person (preferred over `input` for
|
|
741
|
-
* identity data). A key sent in both `
|
|
891
|
+
* identity data). A key sent in both `person` and `input` with different
|
|
742
892
|
* values answers `400 subject_input_conflict`.
|
|
743
893
|
*/
|
|
744
|
-
|
|
894
|
+
person?: SessionPersonInput;
|
|
895
|
+
/**
|
|
896
|
+
* @deprecated Send {@link CreateSessionInput.person}, the same object. The
|
|
897
|
+
* same value under both keys is accepted; different values answer
|
|
898
|
+
* `400 subject_input_conflict`.
|
|
899
|
+
*/
|
|
900
|
+
subject?: SessionPersonInput;
|
|
745
901
|
/**
|
|
746
902
|
* Your own id for the agent filming the person, for flows whose liveness
|
|
747
903
|
* capture is `assisted` (1 to 128 characters). Stored as is and echoed on
|
|
@@ -859,6 +1015,13 @@ interface CreatedSession {
|
|
|
859
1015
|
subjectUse?: "reference" | "prefill";
|
|
860
1016
|
/** One entry per deprecated request key you used, naming its replacement. Absent otherwise. */
|
|
861
1017
|
warnings?: CreatedSessionWarning[];
|
|
1018
|
+
/**
|
|
1019
|
+
* With {@link CreateSessionInput.deliver} only: the send of the hosted link.
|
|
1020
|
+
* `failed` never fails the create; `simulated` on a simulated Sandbox session.
|
|
1021
|
+
*/
|
|
1022
|
+
delivery?: {
|
|
1023
|
+
status: "queued" | "failed" | "simulated";
|
|
1024
|
+
};
|
|
862
1025
|
}
|
|
863
1026
|
/**
|
|
864
1027
|
* A deprecation warning of {@link CreatedSession.warnings}: `field` is the
|
|
@@ -872,11 +1035,11 @@ interface CreatedSessionWarning {
|
|
|
872
1035
|
replacement: string;
|
|
873
1036
|
}
|
|
874
1037
|
/**
|
|
875
|
-
* Input of {@link
|
|
876
|
-
* for an existing
|
|
1038
|
+
* Input of {@link PeopleApi.createSession}: a re-check or step-up session
|
|
1039
|
+
* for an existing person in one call.
|
|
877
1040
|
* @public
|
|
878
1041
|
*/
|
|
879
|
-
interface
|
|
1042
|
+
interface PersonSessionInput {
|
|
880
1043
|
mode: SubjectReuseMode;
|
|
881
1044
|
/** The app's flow to run (slug or `flw_` id); absent = the app's default flow. */
|
|
882
1045
|
flow?: string;
|
|
@@ -885,16 +1048,24 @@ interface SubjectSessionInput {
|
|
|
885
1048
|
ttlMinutes?: number;
|
|
886
1049
|
locale?: Locale;
|
|
887
1050
|
}
|
|
1051
|
+
/** @deprecated Use {@link PersonSessionInput}. @public */
|
|
1052
|
+
type SubjectSessionInput = PersonSessionInput;
|
|
888
1053
|
/**
|
|
889
|
-
* Which
|
|
890
|
-
* your own external
|
|
1054
|
+
* Which person {@link PeopleApi.createSession} targets: the person id
|
|
1055
|
+
* (`per_...` or the bare 24 hexadecimal characters) or your own external
|
|
1056
|
+
* reference. `{ subjectId }` is the deprecated name of `{ personId }`.
|
|
891
1057
|
* @public
|
|
892
1058
|
*/
|
|
893
|
-
type
|
|
1059
|
+
type PersonSessionTarget = {
|
|
1060
|
+
personId: string;
|
|
1061
|
+
} | {
|
|
1062
|
+
/** @deprecated Use `personId`. */
|
|
894
1063
|
subjectId: string;
|
|
895
1064
|
} | {
|
|
896
1065
|
externalRef: string;
|
|
897
1066
|
};
|
|
1067
|
+
/** @deprecated Use {@link PersonSessionTarget}. @public */
|
|
1068
|
+
type SubjectSessionTarget = PersonSessionTarget;
|
|
898
1069
|
/** Result of {@link SessionsApi.resultToken}: a freshly signed result token. @public */
|
|
899
1070
|
interface ResultTokenResponse {
|
|
900
1071
|
/** ES256 JWT; check it with {@link verifyResultToken}. */
|
|
@@ -917,9 +1088,19 @@ interface SessionNetworkEvent {
|
|
|
917
1088
|
operator?: string;
|
|
918
1089
|
connectionType: "mobile" | "hosting" | "unknown";
|
|
919
1090
|
anonymizer: {
|
|
1091
|
+
/** A known commercial VPN service exit. */
|
|
920
1092
|
vpn: boolean;
|
|
1093
|
+
/** A Tor exit. */
|
|
921
1094
|
tor: boolean;
|
|
1095
|
+
/** A cloud, hosting or data center network. */
|
|
922
1096
|
hosting: boolean;
|
|
1097
|
+
/** A public open proxy. Present only when true. */
|
|
1098
|
+
proxy?: boolean;
|
|
1099
|
+
/**
|
|
1100
|
+
* Apple iCloud Private Relay. A privacy relay for Apple accounts, not counted
|
|
1101
|
+
* as an anonymizer. Present only when true.
|
|
1102
|
+
*/
|
|
1103
|
+
relay?: boolean;
|
|
923
1104
|
};
|
|
924
1105
|
/** IANA time zone reported by the end user's device. */
|
|
925
1106
|
browserTimezone?: string;
|
|
@@ -996,6 +1177,183 @@ interface VerifiedContacts {
|
|
|
996
1177
|
verifiedAt: string;
|
|
997
1178
|
};
|
|
998
1179
|
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Where a value of {@link Identity} comes from: the `document` (its machine
|
|
1182
|
+
* readable zone or printed text), the passport `chip`, the population
|
|
1183
|
+
* `registry`, a national `eid`, or the record you `supplied` at create.
|
|
1184
|
+
* @public
|
|
1185
|
+
*/
|
|
1186
|
+
type IdentitySource = "document" | "chip" | "registry" | "eid" | "supplied";
|
|
1187
|
+
/**
|
|
1188
|
+
* How a name of {@link Identity.names} was obtained: `mrz` (the ICAO
|
|
1189
|
+
* transliteration of the machine readable zone: upper case, truncated, no
|
|
1190
|
+
* diacritics), `printed` (the visual zone, as written), `chip` (the chip's
|
|
1191
|
+
* data groups), `registry`, `eid` or `supplied`.
|
|
1192
|
+
* @public
|
|
1193
|
+
*/
|
|
1194
|
+
type NameForm = "mrz" | "printed" | "chip" | "registry" | "eid" | "supplied";
|
|
1195
|
+
/**
|
|
1196
|
+
* One name as one source gives it. Names from different sources are never
|
|
1197
|
+
* merged. For an `mrz` entry `family` holds the ICAO primary identifier and
|
|
1198
|
+
* `given` the secondary one, as the document arranges them. To show a name,
|
|
1199
|
+
* pick the first entry whose `form` is not `mrz`.
|
|
1200
|
+
* @public
|
|
1201
|
+
*/
|
|
1202
|
+
interface IdentityName {
|
|
1203
|
+
/** ISO 15924 script, e.g. `Latn` or `Arab`. */
|
|
1204
|
+
script: string;
|
|
1205
|
+
form: NameForm;
|
|
1206
|
+
/** Given names (the secondary identifier). */
|
|
1207
|
+
given?: string;
|
|
1208
|
+
/** Family name (the primary identifier). */
|
|
1209
|
+
family?: string;
|
|
1210
|
+
/** The father's given name, when the source distinguishes it. */
|
|
1211
|
+
patronymic?: string;
|
|
1212
|
+
/** The name as one string, when the source gives one (never built from the parts). */
|
|
1213
|
+
fullName?: string;
|
|
1214
|
+
source: IdentitySource;
|
|
1215
|
+
}
|
|
1216
|
+
/** One birth place as one source wrote it ({@link Identity.birthPlace}). @public */
|
|
1217
|
+
interface IdentityBirthPlace {
|
|
1218
|
+
/** ISO 15924 script. */
|
|
1219
|
+
script: string;
|
|
1220
|
+
value: string;
|
|
1221
|
+
source: IdentitySource;
|
|
1222
|
+
}
|
|
1223
|
+
/** The holder's national number, when a per-country rule recognises it ({@link Identity.idNumber}). @public */
|
|
1224
|
+
interface IdentityIdNumber {
|
|
1225
|
+
type: "national_id" | "passport" | "residence_permit";
|
|
1226
|
+
/** ISO 3166-1 alpha-2. */
|
|
1227
|
+
issuingCountry: string;
|
|
1228
|
+
/** The number, normalised. */
|
|
1229
|
+
number: string;
|
|
1230
|
+
}
|
|
1231
|
+
/** The document or chip that was read ({@link Identity.document}). @public */
|
|
1232
|
+
interface IdentityDocument {
|
|
1233
|
+
type: "national_id" | "passport" | "residence_permit";
|
|
1234
|
+
/** ISO 3166-1 alpha-2, or the ICAO code as read when it has no ISO equivalent. */
|
|
1235
|
+
issuingCountry?: string;
|
|
1236
|
+
/** The document number as read: upper case, no spaces. */
|
|
1237
|
+
number?: string;
|
|
1238
|
+
/** `YYYY-MM-DD`. */
|
|
1239
|
+
expiryDate?: string;
|
|
1240
|
+
/** `YYYY-MM-DD`, from the chip. */
|
|
1241
|
+
issueDate?: string;
|
|
1242
|
+
/** The issuing authority as written, from the chip. */
|
|
1243
|
+
issuingAuthority?: string;
|
|
1244
|
+
/** The keys whose value a check digit protects. Never the names. */
|
|
1245
|
+
mrzVerified?: Array<"number" | "birthDate" | "expiryDate" | "idNumber">;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* The scalar keys of {@link Identity} that {@link Identity.sources} reports on.
|
|
1249
|
+
* @public
|
|
1250
|
+
*/
|
|
1251
|
+
type IdentityScalarKey = "idNumber" | "birthDate" | "sex" | "nationalities" | "document.number" | "document.expiryDate";
|
|
1252
|
+
/**
|
|
1253
|
+
* For each scalar key, the sources whose value equals the returned one. A
|
|
1254
|
+
* source that read another value is not listed (its step carries the mismatch
|
|
1255
|
+
* reason).
|
|
1256
|
+
* @public
|
|
1257
|
+
*/
|
|
1258
|
+
type IdentitySources = Partial<Record<IdentityScalarKey, IdentitySource[]>>;
|
|
1259
|
+
/**
|
|
1260
|
+
* The identity data a session read (its document, chip, registry, eID or your
|
|
1261
|
+
* supplied record), present once one identity step settled, whatever the
|
|
1262
|
+
* outcome. On a person ({@link Person.identity}), the identity of the latest
|
|
1263
|
+
* approved session that read one. Every key is optional. Sent to you only (the
|
|
1264
|
+
* session view, the person view and the terminal webhooks).
|
|
1265
|
+
* @public
|
|
1266
|
+
*/
|
|
1267
|
+
interface Identity {
|
|
1268
|
+
idNumber?: IdentityIdNumber;
|
|
1269
|
+
/** One entry per source and script, registry forms first. */
|
|
1270
|
+
names?: IdentityName[];
|
|
1271
|
+
/** ISO 8601 with the precision the source has: `YYYY-MM-DD`, `YYYY-MM` or `YYYY`. */
|
|
1272
|
+
birthDate?: string;
|
|
1273
|
+
birthPlace?: IdentityBirthPlace[];
|
|
1274
|
+
/** `null` when the source read an unspecified value; absent when no source read it. */
|
|
1275
|
+
sex?: "M" | "F" | "X" | null;
|
|
1276
|
+
/** ISO 3166-1 alpha-2 codes, or the ICAO code when it has no ISO equivalent. */
|
|
1277
|
+
nationalities?: string[];
|
|
1278
|
+
/** Set when the nationality code is not a country (e.g. `stateless`). */
|
|
1279
|
+
nationalityKind?: string;
|
|
1280
|
+
document?: IdentityDocument;
|
|
1281
|
+
sources?: IdentitySources;
|
|
1282
|
+
/** The registry a registry step passed against. */
|
|
1283
|
+
registry?: {
|
|
1284
|
+
id: string;
|
|
1285
|
+
fetchedAt?: string;
|
|
1286
|
+
};
|
|
1287
|
+
/** The national eID that verified the identity. */
|
|
1288
|
+
eid?: {
|
|
1289
|
+
provider: string;
|
|
1290
|
+
country: string;
|
|
1291
|
+
verifiedAt?: string;
|
|
1292
|
+
};
|
|
1293
|
+
/** ISO 8601: when the last identity step settled. */
|
|
1294
|
+
verifiedAt?: string;
|
|
1295
|
+
/** @deprecated Read {@link Identity.names}. The first Latin name as one string. */
|
|
1296
|
+
name?: string;
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* The media kinds of a session, in the order the API lists them.
|
|
1300
|
+
* `reference_portrait` is the photo the face match compared against.
|
|
1301
|
+
* @public
|
|
1302
|
+
*/
|
|
1303
|
+
type MediaKind = "icao_portrait" | "document_front" | "document_back" | "document_portrait" | "chip_portrait" | "reference_portrait" | "supplied_photo" | "selfie" | "liveness_clip";
|
|
1304
|
+
/**
|
|
1305
|
+
* One media object of a session ({@link SessionsApi.media}). `url` is a
|
|
1306
|
+
* download link valid 15 minutes, or the bytes route on this API
|
|
1307
|
+
* (`/api/v2/sessions/{id}/media/{kind}`), which needs your key: read it with
|
|
1308
|
+
* {@link SessionsApi.mediaBytes}. Never store the URL.
|
|
1309
|
+
* @public
|
|
1310
|
+
*/
|
|
1311
|
+
interface MediaItem {
|
|
1312
|
+
kind: MediaKind;
|
|
1313
|
+
/** The check that produced or used it. */
|
|
1314
|
+
check: string;
|
|
1315
|
+
/** The attempt it came from (1, 2, ...); absent when it is not per attempt. */
|
|
1316
|
+
attempt?: number;
|
|
1317
|
+
/** It belongs to the attempt that settled the check. */
|
|
1318
|
+
decisive: boolean;
|
|
1319
|
+
/** The state of that attempt, else of the check. */
|
|
1320
|
+
state?: string;
|
|
1321
|
+
/** The reason of that attempt, when it did not pass. */
|
|
1322
|
+
reason?: string;
|
|
1323
|
+
/** The attempt was set aside (for example a retake) and not counted. */
|
|
1324
|
+
voided?: string;
|
|
1325
|
+
contentType: "image/jpeg" | "image/png" | "video/mp4" | "video/webm";
|
|
1326
|
+
/** `reference_portrait` and `supplied_photo`: where the photo came from (`stored`: kept from an earlier verification). */
|
|
1327
|
+
source?: "registry" | "eid" | "chip" | "document" | "supplied" | "stored";
|
|
1328
|
+
/** `reference_portrait`: the registry photo was fetched again for this match. */
|
|
1329
|
+
refreshed?: true;
|
|
1330
|
+
url: string;
|
|
1331
|
+
/** ISO 8601: when `url` expires. List the media again for fresh links. */
|
|
1332
|
+
expiresAt: string;
|
|
1333
|
+
}
|
|
1334
|
+
/** Result of {@link SessionsApi.media}. @public */
|
|
1335
|
+
interface MediaList {
|
|
1336
|
+
items: MediaItem[];
|
|
1337
|
+
}
|
|
1338
|
+
/** Options of {@link SessionsApi.mediaBytes}. @public */
|
|
1339
|
+
interface MediaBytesOptions {
|
|
1340
|
+
/** The attempt (1, 2, ...) to read; default: the decisive item, else the latest attempt. */
|
|
1341
|
+
attempt?: number;
|
|
1342
|
+
/** `reference_portrait` only: the first reference, when a second one decided the step. */
|
|
1343
|
+
reference?: "first";
|
|
1344
|
+
}
|
|
1345
|
+
/** Result of {@link SessionsApi.mediaBytes}: the bytes and their media type. @public */
|
|
1346
|
+
interface MediaBytes {
|
|
1347
|
+
contentType: string;
|
|
1348
|
+
bytes: Uint8Array;
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Who closed a completed or failed session: `review` when a person decided
|
|
1352
|
+
* the verdict (the deciding step carries its {@link SessionStepDecision}),
|
|
1353
|
+
* `automatic` otherwise (a review deadline included).
|
|
1354
|
+
* @public
|
|
1355
|
+
*/
|
|
1356
|
+
type DecidedBy = "automatic" | "review";
|
|
999
1357
|
/**
|
|
1000
1358
|
* The whitelisted session view returned by {@link SessionsApi.get}. Never
|
|
1001
1359
|
* contains the client token.
|
|
@@ -1007,9 +1365,17 @@ interface Session {
|
|
|
1007
1365
|
flow?: SessionFlowRef;
|
|
1008
1366
|
status: SessionStatus;
|
|
1009
1367
|
outcome: SessionOutcome | null;
|
|
1368
|
+
/** Completed and failed sessions: who decided the verdict ({@link DecidedBy}). */
|
|
1369
|
+
decidedBy?: DecidedBy;
|
|
1370
|
+
/**
|
|
1371
|
+
* A session closed because a newer attempt of the same person took over its
|
|
1372
|
+
* review: that session's id (`outcome` is `null`). Watch it instead.
|
|
1373
|
+
*/
|
|
1374
|
+
supersededBy?: string;
|
|
1010
1375
|
/**
|
|
1011
|
-
* What the session proved ({@link VerificationLevel})
|
|
1012
|
-
* session
|
|
1376
|
+
* What the session proved ({@link VerificationLevel}), on a completed or
|
|
1377
|
+
* failed session: `0` when it was rejected. Absent while the session is
|
|
1378
|
+
* active, and from older API versions.
|
|
1013
1379
|
*/
|
|
1014
1380
|
level?: VerificationLevel | null;
|
|
1015
1381
|
/** How the level was proved; `null` while the session is active. */
|
|
@@ -1022,8 +1388,8 @@ interface Session {
|
|
|
1022
1388
|
steps: SessionStep[];
|
|
1023
1389
|
/** ISO 8601. */
|
|
1024
1390
|
expiresAt: string;
|
|
1025
|
-
/** ISO 8601. */
|
|
1026
|
-
createdAt
|
|
1391
|
+
/** ISO 8601. Absent on a session view that does not carry it. */
|
|
1392
|
+
createdAt?: string;
|
|
1027
1393
|
/** ISO 8601: when the session reached a terminal state; `null` while it is active. */
|
|
1028
1394
|
completedAt?: string | null;
|
|
1029
1395
|
/** End-user network context; absent when not recorded. */
|
|
@@ -1038,9 +1404,14 @@ interface Session {
|
|
|
1038
1404
|
failureReason?: PolicyFailureReason;
|
|
1039
1405
|
/** With failureReason `camera_unavailable`: why (`denied` or `no_camera`), when the SDK said. Absent otherwise. */
|
|
1040
1406
|
failureDetail?: CameraUnavailableCause;
|
|
1041
|
-
/** The
|
|
1407
|
+
/** The person (`per_...`) this session is linked to, once that person has passed a verification (absent before that). */
|
|
1408
|
+
personId?: string;
|
|
1409
|
+
/**
|
|
1410
|
+
* @deprecated Read {@link Session.personId}. The same person with the id
|
|
1411
|
+
* bare (no `per_` prefix), as the result token's `sub` names it.
|
|
1412
|
+
*/
|
|
1042
1413
|
subjectId?: string;
|
|
1043
|
-
/** Your own id for the person, from `
|
|
1414
|
+
/** Your own id for the person, from `person.externalRef` at create. */
|
|
1044
1415
|
externalRef?: string;
|
|
1045
1416
|
/** The agent reference sent as `assistedBy` at create, for assisted capture. */
|
|
1046
1417
|
assistedBy?: {
|
|
@@ -1069,7 +1440,7 @@ interface Session {
|
|
|
1069
1440
|
riskSignals?: string[];
|
|
1070
1441
|
/**
|
|
1071
1442
|
* `true` for a returning-user session (created with
|
|
1072
|
-
* {@link
|
|
1443
|
+
* {@link SessionPersonInput.reuse}): liveness + face match against the
|
|
1073
1444
|
* subject's stored reference photo only.
|
|
1074
1445
|
*/
|
|
1075
1446
|
returning?: true;
|
|
@@ -1082,7 +1453,10 @@ interface Session {
|
|
|
1082
1453
|
reuseMode?: SubjectReuseMode;
|
|
1083
1454
|
/** The contacts verified in this session (passed OTP checks only); absent when none. */
|
|
1084
1455
|
verifiedContacts?: VerifiedContacts;
|
|
1085
|
-
/**
|
|
1456
|
+
/**
|
|
1457
|
+
* The national eID that verified this session (the `eid_auth` check passed); absent otherwise.
|
|
1458
|
+
* @deprecated Read `identity.eid` ({@link Identity}) instead.
|
|
1459
|
+
*/
|
|
1086
1460
|
eid?: EidResult;
|
|
1087
1461
|
/**
|
|
1088
1462
|
* When the flow sets a minimum age and the session proved it: the threshold
|
|
@@ -1090,24 +1464,55 @@ interface Session {
|
|
|
1090
1464
|
*/
|
|
1091
1465
|
age?: AgeResult;
|
|
1092
1466
|
/**
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1467
|
+
* @deprecated Read {@link Session.media}: `true` when it includes
|
|
1468
|
+
* `icao_portrait`. ID mode only: the ICAO portrait can be fetched.
|
|
1095
1469
|
*/
|
|
1096
1470
|
portraitAvailable?: boolean;
|
|
1471
|
+
/**
|
|
1472
|
+
* The identity data the session read ({@link Identity}), once one identity
|
|
1473
|
+
* step settled. On an approved returning-user session, with a key that also
|
|
1474
|
+
* holds `people:read`, the identity stored on the person.
|
|
1475
|
+
*/
|
|
1476
|
+
identity?: Identity;
|
|
1477
|
+
/** The media kinds this session has, in kind order: fetch them with {@link SessionsApi.media}. */
|
|
1478
|
+
media?: MediaKind[];
|
|
1479
|
+
/**
|
|
1480
|
+
* Terminal sessions, when result tokens are on: a signed result token
|
|
1481
|
+
* (ES256 JWT, valid 10 minutes). Check it with {@link verifyResultToken}.
|
|
1482
|
+
*/
|
|
1483
|
+
resultToken?: string;
|
|
1484
|
+
/** Terminal sessions: other people the face matched in the duplicate search (non-empty only). */
|
|
1485
|
+
duplicates?: ResultDuplicate[];
|
|
1486
|
+
/** Terminal sessions: the duplicate search could not run. */
|
|
1487
|
+
dedupUnavailable?: true;
|
|
1488
|
+
/**
|
|
1489
|
+
* Terminal sessions: a failure identification match
|
|
1490
|
+
* ({@link FailureIdentification}), present only for a match and only when the
|
|
1491
|
+
* setting is on. A signal, never a decision.
|
|
1492
|
+
*/
|
|
1493
|
+
failureIdentification?: FailureIdentification;
|
|
1097
1494
|
}
|
|
1098
1495
|
/**
|
|
1099
|
-
* `data` of the
|
|
1100
|
-
*
|
|
1101
|
-
* `session.expired`)
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1496
|
+
* `data` of the session lifecycle events (`session.started` |
|
|
1497
|
+
* `session.review_pending` | `session.completed` | `session.failed` |
|
|
1498
|
+
* `session.expired`). `outcome`, `decidedBy` and `steps` travel on
|
|
1499
|
+
* `completed` / `failed`, which are the one terminal event of a session: a
|
|
1500
|
+
* reviewer's decision arrives as one of them with `decidedBy: "review"` and
|
|
1501
|
+
* the `decision`. `review_pending` carries `steps` without an outcome;
|
|
1502
|
+
* `expired` carries the status and the session's refs (`flow`, person ids,
|
|
1503
|
+
* `overriddenFields`). `identity` and `media` (kinds only, never links) ride on
|
|
1504
|
+
* `completed` / `failed` when the platform sends them.
|
|
1105
1505
|
* @public
|
|
1106
1506
|
*/
|
|
1107
1507
|
interface SessionLifecycleEventData {
|
|
1508
|
+
/** The session id (`ses_...`). */
|
|
1108
1509
|
sessionId: string;
|
|
1109
1510
|
status: SessionStatus;
|
|
1110
1511
|
outcome?: SessionOutcome | null;
|
|
1512
|
+
/** On `completed` / `failed`: who decided the verdict ({@link DecidedBy}). */
|
|
1513
|
+
decidedBy?: DecidedBy;
|
|
1514
|
+
/** On `completed` / `failed` with `decidedBy: "review"`: how the deciding step was decided. */
|
|
1515
|
+
decision?: SessionStepDecision;
|
|
1111
1516
|
/** On `completed` / `failed`: the app the session belongs to. */
|
|
1112
1517
|
appId?: string;
|
|
1113
1518
|
/** On `completed` / `failed`: what the session proved ({@link VerificationLevel}). */
|
|
@@ -1128,8 +1533,13 @@ interface SessionLifecycleEventData {
|
|
|
1128
1533
|
* result tokens are not enabled.
|
|
1129
1534
|
*/
|
|
1130
1535
|
resultToken?: string;
|
|
1131
|
-
/**
|
|
1132
|
-
|
|
1536
|
+
/** On `completed` / `failed`: the duplicate search could not run. */
|
|
1537
|
+
dedupUnavailable?: true;
|
|
1538
|
+
/**
|
|
1539
|
+
* The checks on the session's path (checks of a lane the person did not take
|
|
1540
|
+
* are omitted), each with its {@link SessionStepDecision} when a person decided it.
|
|
1541
|
+
*/
|
|
1542
|
+
steps?: Array<Pick<SessionStep, "id" | "service" | "checkType" | "state" | "nodeId" | "simulated" | "decision">>;
|
|
1133
1543
|
/** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
|
|
1134
1544
|
flow?: SessionFlowRef;
|
|
1135
1545
|
/** Machine-readable reason, when the transition has one. */
|
|
@@ -1146,21 +1556,30 @@ interface SessionLifecycleEventData {
|
|
|
1146
1556
|
failureReason?: PolicyFailureReason;
|
|
1147
1557
|
/** On `session.failed` with failureReason `camera_unavailable`: why (`denied` or `no_camera`), when the SDK said. Absent otherwise. */
|
|
1148
1558
|
failureDetail?: CameraUnavailableCause;
|
|
1149
|
-
/** The
|
|
1559
|
+
/** The person (`per_...`) the session is linked to, once that person has passed a verification (absent before that). */
|
|
1560
|
+
personId?: string;
|
|
1561
|
+
/**
|
|
1562
|
+
* @deprecated Read {@link SessionLifecycleEventData.personId}. The same
|
|
1563
|
+
* person with the id bare (no `per_` prefix).
|
|
1564
|
+
*/
|
|
1150
1565
|
subjectId?: string;
|
|
1151
|
-
/** Your own id for the person, from `
|
|
1566
|
+
/** Your own id for the person, from `person.externalRef` at create. */
|
|
1152
1567
|
externalRef?: string;
|
|
1568
|
+
/** The agent reference sent as `assistedBy` at create, for assisted capture. */
|
|
1569
|
+
assistedBy?: {
|
|
1570
|
+
externalRef: string;
|
|
1571
|
+
};
|
|
1153
1572
|
/**
|
|
1154
1573
|
* `true` when an identifier this session read already belongs to a
|
|
1155
|
-
* different
|
|
1574
|
+
* different person than `personId`: the people are never merged.
|
|
1156
1575
|
*/
|
|
1157
1576
|
subjectConflict?: boolean;
|
|
1158
1577
|
/** `true` on a returning-user session (liveness + face match against the stored photo). */
|
|
1159
1578
|
returning?: true;
|
|
1160
|
-
/** On a returning-user session: the
|
|
1579
|
+
/** On a returning-user session: the person (`per_...`) it re-verifies. */
|
|
1161
1580
|
reuseOf?: string;
|
|
1162
1581
|
/**
|
|
1163
|
-
* On a session created for an existing
|
|
1582
|
+
* On a session created for an existing person: `recheck` (the same person
|
|
1164
1583
|
* again) or `step_up` (raised to identity level). Absent otherwise.
|
|
1165
1584
|
*/
|
|
1166
1585
|
reuseMode?: SubjectReuseMode;
|
|
@@ -1185,10 +1604,20 @@ interface SessionLifecycleEventData {
|
|
|
1185
1604
|
/** On `completed` / `failed`: the minimum age the session proved and how ({@link AgeResult}), when the flow sets one. */
|
|
1186
1605
|
age?: AgeResult;
|
|
1187
1606
|
/**
|
|
1188
|
-
* ID mode only, on
|
|
1189
|
-
*
|
|
1607
|
+
* @deprecated Read {@link SessionLifecycleEventData.media}. ID mode only, on
|
|
1608
|
+
* `completed` / `failed`: the ICAO portrait can be fetched.
|
|
1190
1609
|
*/
|
|
1191
1610
|
portraitAvailable?: boolean;
|
|
1611
|
+
/** On `completed` / `failed`: the identity data the session read ({@link Identity}), when the platform sends it. */
|
|
1612
|
+
identity?: Identity;
|
|
1613
|
+
/** On `completed` / `failed`: the media kinds of the session (never links), when the platform sends them. */
|
|
1614
|
+
media?: MediaKind[];
|
|
1615
|
+
/**
|
|
1616
|
+
* On `completed` / `failed`: a failure identification match
|
|
1617
|
+
* ({@link FailureIdentification}), when the setting is on and the search
|
|
1618
|
+
* found one before the event was sent. A signal, never a decision.
|
|
1619
|
+
*/
|
|
1620
|
+
failureIdentification?: FailureIdentification;
|
|
1192
1621
|
}
|
|
1193
1622
|
/**
|
|
1194
1623
|
* `data` of `subject.updated` — either a session linked to the subject reached
|
|
@@ -1259,8 +1688,9 @@ type SubjectAssurance = "registry_biometric" | "chip_biometric" | "document_biom
|
|
|
1259
1688
|
* @public
|
|
1260
1689
|
*/
|
|
1261
1690
|
type SubjectReferenceSource = "registry" | "doc_registry" | "chip" | "org_supplied" | "document";
|
|
1262
|
-
/** One session linked to a
|
|
1263
|
-
interface
|
|
1691
|
+
/** One session linked to a person. @public */
|
|
1692
|
+
interface PersonSession {
|
|
1693
|
+
/** The session id (`ses_...`). */
|
|
1264
1694
|
sessionId: string;
|
|
1265
1695
|
appId: string | null;
|
|
1266
1696
|
/** ISO 8601 — when the session was linked. */
|
|
@@ -1272,17 +1702,22 @@ interface SubjectSession {
|
|
|
1272
1702
|
/** How the session's level was proved; present only when stored. */
|
|
1273
1703
|
assurance?: VerificationAssurance;
|
|
1274
1704
|
}
|
|
1705
|
+
/** @deprecated Use {@link PersonSession}. @public */
|
|
1706
|
+
type SubjectSession = PersonSession;
|
|
1275
1707
|
/**
|
|
1276
|
-
* A
|
|
1708
|
+
* A person (the same person across your apps), as `GET /people/:id`
|
|
1277
1709
|
* returns it. Never contains photo keys or URLs.
|
|
1278
1710
|
* @public
|
|
1279
1711
|
*/
|
|
1280
|
-
interface
|
|
1712
|
+
interface Person {
|
|
1713
|
+
/** The person id (`per_...`). */
|
|
1281
1714
|
id: string;
|
|
1715
|
+
/** The same value as `id`. Absent from older API versions. */
|
|
1716
|
+
personId?: string;
|
|
1282
1717
|
status: SubjectStatus;
|
|
1283
1718
|
/** ISO 8601 — present only when revoked. */
|
|
1284
1719
|
revokedAt?: string;
|
|
1285
|
-
sessions:
|
|
1720
|
+
sessions: PersonSession[];
|
|
1286
1721
|
externalRefs: string[];
|
|
1287
1722
|
/** ISO 8601. */
|
|
1288
1723
|
firstSeenAt: string;
|
|
@@ -1304,9 +1739,9 @@ interface Subject {
|
|
|
1304
1739
|
* recorded since the field exists. Absent from API versions before the field.
|
|
1305
1740
|
*/
|
|
1306
1741
|
level?: VerificationLevel | null | undefined;
|
|
1307
|
-
/** ISO 8601: when {@link
|
|
1742
|
+
/** ISO 8601: when {@link Person.level} was last proved (the latest approved session at that level or higher); `null` with it. Absent with it. */
|
|
1308
1743
|
levelAt?: string | null | undefined;
|
|
1309
|
-
/** The assurance of the session that proved {@link
|
|
1744
|
+
/** The assurance of the session that proved {@link Person.level}; `null` with it. Absent with it. */
|
|
1310
1745
|
levelAssurance?: VerificationAssurance | null | undefined;
|
|
1311
1746
|
/**
|
|
1312
1747
|
* A returning-user session can be created now: active, a reference photo is
|
|
@@ -1320,27 +1755,92 @@ interface Subject {
|
|
|
1320
1755
|
name?: string;
|
|
1321
1756
|
birthDate?: string;
|
|
1322
1757
|
};
|
|
1758
|
+
/** The identity of the latest approved session that read one ({@link Identity}). */
|
|
1759
|
+
identity?: Identity;
|
|
1323
1760
|
}
|
|
1761
|
+
/** @deprecated Use {@link Person}. @public */
|
|
1762
|
+
type Subject = Person;
|
|
1324
1763
|
/**
|
|
1325
|
-
* Filters of {@link SessionsApi.list}
|
|
1326
|
-
*
|
|
1764
|
+
* Filters of {@link SessionsApi.list}, {@link SessionsApi.listPage} and
|
|
1765
|
+
* {@link SessionsApi.iterate}, combined with AND. Newest first.
|
|
1327
1766
|
* @public
|
|
1328
1767
|
*/
|
|
1329
1768
|
interface ListSessionsQuery {
|
|
1330
|
-
/** Your own id for the person (1 to 128 characters). */
|
|
1769
|
+
/** Your own id for the person (1 to 128 characters), exact match. */
|
|
1331
1770
|
externalRef?: string;
|
|
1332
1771
|
status?: SessionStatus;
|
|
1772
|
+
/** A flow id (`flw_...`) or slug. */
|
|
1773
|
+
flow?: string;
|
|
1774
|
+
/** Sessions created at or after this time (ISO 8601 or a `Date`). */
|
|
1775
|
+
createdAfter?: string | Date;
|
|
1776
|
+
/** Sessions created before this time (ISO 8601 or a `Date`). */
|
|
1777
|
+
createdBefore?: string | Date;
|
|
1778
|
+
/** Page size, 1 to 100 (the API's default is 50). */
|
|
1779
|
+
limit?: number;
|
|
1780
|
+
/** The {@link Page.nextCursor} of the previous page. */
|
|
1781
|
+
cursor?: string;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Filters of {@link PeopleApi.list}, {@link PeopleApi.listPage} and
|
|
1785
|
+
* {@link PeopleApi.iterate}. Newest first; only people who passed a verification.
|
|
1786
|
+
* @public
|
|
1787
|
+
*/
|
|
1788
|
+
interface ListPeopleQuery {
|
|
1789
|
+
/** Your own id for the person, exact match. */
|
|
1790
|
+
externalRef?: string;
|
|
1791
|
+
/** Page size, 1 to 100 (the API's default is 50). */
|
|
1792
|
+
limit?: number;
|
|
1793
|
+
/** The {@link Page.nextCursor} of the previous page. */
|
|
1794
|
+
cursor?: string;
|
|
1333
1795
|
}
|
|
1334
|
-
/**
|
|
1335
|
-
|
|
1796
|
+
/**
|
|
1797
|
+
* One page of a list: the items and, when more exist, the cursor of the next
|
|
1798
|
+
* page (pass it as `cursor`). Opaque; absent on the last page.
|
|
1799
|
+
* @public
|
|
1800
|
+
*/
|
|
1801
|
+
interface Page<T> {
|
|
1802
|
+
data: T[];
|
|
1803
|
+
nextCursor?: string;
|
|
1804
|
+
}
|
|
1805
|
+
/** Result of {@link PeopleApi.delete}. @public */
|
|
1806
|
+
interface DeletedPerson {
|
|
1807
|
+
/** The person id (`per_...`). */
|
|
1336
1808
|
id: string;
|
|
1337
1809
|
deleted: true;
|
|
1338
1810
|
}
|
|
1339
|
-
/**
|
|
1340
|
-
|
|
1811
|
+
/** @deprecated Use {@link DeletedPerson}. @public */
|
|
1812
|
+
type DeletedSubject = DeletedPerson;
|
|
1813
|
+
/** Options of {@link PeopleApi.revoke}. @public */
|
|
1814
|
+
interface RevokePersonInput {
|
|
1341
1815
|
/** Kept on the audit trail only (≤ 500 characters). Do not put personal data here. */
|
|
1342
1816
|
reason?: string;
|
|
1343
1817
|
}
|
|
1818
|
+
/** @deprecated Use {@link RevokePersonInput}. @public */
|
|
1819
|
+
type RevokeSubjectInput = RevokePersonInput;
|
|
1820
|
+
/**
|
|
1821
|
+
* Input of {@link SessionsApi.extendLink}: the new link lifetime in minutes,
|
|
1822
|
+
* counted from the session creation, or the new expiry. It must be later than
|
|
1823
|
+
* the current expiry and within the flow's maximum link lifetime.
|
|
1824
|
+
* @public
|
|
1825
|
+
*/
|
|
1826
|
+
type ExtendLinkInput = {
|
|
1827
|
+
ttlMinutes: number;
|
|
1828
|
+
} | {
|
|
1829
|
+
expiresAt: string | Date;
|
|
1830
|
+
};
|
|
1831
|
+
/** Result of {@link SessionsApi.resendLink}: the new delivery attempt. @public */
|
|
1832
|
+
interface SessionLinkDelivery {
|
|
1833
|
+
delivery: {
|
|
1834
|
+
channel: "sms" | "whatsapp" | "email";
|
|
1835
|
+
/** `simulated` in the Sandbox: nothing is sent. */
|
|
1836
|
+
status: "queued" | "sent" | "failed" | "simulated";
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
/** Result of {@link SessionsApi.extendLink}. @public */
|
|
1840
|
+
interface SessionLinkExpiry {
|
|
1841
|
+
/** ISO 8601: the new expiry of the link and its session. */
|
|
1842
|
+
expiresAt: string;
|
|
1843
|
+
}
|
|
1344
1844
|
/**
|
|
1345
1845
|
* `data` of `subject.suspicious_activity` — a device already linked to
|
|
1346
1846
|
* ANOTHER subject was used for a session of this subject. `count` is the
|
|
@@ -1352,8 +1852,35 @@ interface SubjectSuspiciousActivityEventData {
|
|
|
1352
1852
|
sessionId: string;
|
|
1353
1853
|
count: number;
|
|
1354
1854
|
}
|
|
1855
|
+
/**
|
|
1856
|
+
* `data` of `person.updated`: the `subject.updated` data plus `personId`
|
|
1857
|
+
* (`per_...`). `subjectId` names the same person bare during this release.
|
|
1858
|
+
* @public
|
|
1859
|
+
*/
|
|
1860
|
+
interface PersonUpdatedEventData extends SubjectUpdatedEventData {
|
|
1861
|
+
personId: string;
|
|
1862
|
+
}
|
|
1863
|
+
/** `data` of `person.enrolled`: the `subject.enrolled` data plus `personId` (`per_...`). @public */
|
|
1864
|
+
interface PersonEnrolledEventData extends SubjectEnrolledEventData {
|
|
1865
|
+
personId: string;
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* `data` of `person.deleted`: the `subject.deleted` data plus `personId`
|
|
1869
|
+
* (`per_...`) when the delete names the person (a delete through the people
|
|
1870
|
+
* API); the erasure variant carries `subjectRef` instead.
|
|
1871
|
+
* @public
|
|
1872
|
+
*/
|
|
1873
|
+
interface PersonDeletedEventData extends SubjectDeletedEventData {
|
|
1874
|
+
personId?: string;
|
|
1875
|
+
}
|
|
1876
|
+
/** `data` of `person.suspicious_activity`: the `subject.suspicious_activity` data plus `personId` (`per_...`). @public */
|
|
1877
|
+
interface PersonSuspiciousActivityEventData extends SubjectSuspiciousActivityEventData {
|
|
1878
|
+
personId: string;
|
|
1879
|
+
}
|
|
1355
1880
|
/**
|
|
1356
1881
|
* `data` of `session.step.completed` — the check that just passed.
|
|
1882
|
+
* @deprecated The event leaves the catalog after this release: read the steps
|
|
1883
|
+
* of the terminal event (`session.completed` / `session.failed`).
|
|
1357
1884
|
* @public
|
|
1358
1885
|
*/
|
|
1359
1886
|
interface SessionStepCompletedEventData {
|
|
@@ -1383,16 +1910,64 @@ interface SessionStepCompletedEventData {
|
|
|
1383
1910
|
verifiedContacts?: VerifiedContacts;
|
|
1384
1911
|
}
|
|
1385
1912
|
/**
|
|
1386
|
-
* `data` of `session.review_decided
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1913
|
+
* `data` of `session.review_decided`: a human (or the review deadline) decided
|
|
1914
|
+
* a pending review. `outcome` speaks the REVIEW vocabulary (`pass` | `fail`),
|
|
1915
|
+
* not the session outcome; `reason` is the reviewer's code, `review_timeout`
|
|
1916
|
+
* when the review expired, or `review_split` when two reviewers disagreed and
|
|
1917
|
+
* nobody settled it by the deadline. A reviewer's decision also carries
|
|
1918
|
+
* `reasons`, `decision` and the terminal fields of `session.completed` /
|
|
1919
|
+
* `session.failed`; a deadline carries the ids only.
|
|
1920
|
+
* @deprecated The event leaves the catalog after this release: a reviewer's
|
|
1921
|
+
* decision arrives as `session.completed` or `session.failed` with
|
|
1922
|
+
* `decidedBy: "review"` and the `decision`; a review deadline as
|
|
1923
|
+
* `session.failed` with `failureReason: "review_timeout" | "review_split"`.
|
|
1390
1924
|
* @public
|
|
1391
1925
|
*/
|
|
1392
1926
|
interface SessionReviewDecidedEventData {
|
|
1393
1927
|
sessionId: string;
|
|
1394
1928
|
outcome: "pass" | "fail";
|
|
1395
1929
|
reason: string;
|
|
1930
|
+
/** A reviewer's decision: what it was about ({@link ReviewReason}). */
|
|
1931
|
+
reasons?: ReviewReason[];
|
|
1932
|
+
/** A reviewer's decision: how it was formed ({@link SessionStepDecision}; counts only). */
|
|
1933
|
+
decision?: SessionStepDecision;
|
|
1934
|
+
/** The app the session belongs to. */
|
|
1935
|
+
appId?: string;
|
|
1936
|
+
/** What the session proved ({@link VerificationLevel}). */
|
|
1937
|
+
level?: VerificationLevel | null;
|
|
1938
|
+
/** How the level was proved. */
|
|
1939
|
+
assurance?: VerificationAssurance | null;
|
|
1940
|
+
/** The billing unit the session consumed. */
|
|
1941
|
+
unit?: VerificationUnit | null;
|
|
1942
|
+
/** ISO 8601 terminal time. */
|
|
1943
|
+
verifiedAt?: string;
|
|
1944
|
+
/** Device and network risk facts, when recorded. */
|
|
1945
|
+
risk?: ResultRisk;
|
|
1946
|
+
/** Other subjects the face matched, when a duplicate search ran. */
|
|
1947
|
+
duplicates?: ResultDuplicate[];
|
|
1948
|
+
/** The duplicate search could not run. */
|
|
1949
|
+
dedupUnavailable?: true;
|
|
1950
|
+
/** The minimum age the session proved and how ({@link AgeResult}), when the flow sets one. */
|
|
1951
|
+
age?: AgeResult;
|
|
1952
|
+
/** A failure identification match ({@link FailureIdentification}), when the setting is on and the search found one. */
|
|
1953
|
+
failureIdentification?: FailureIdentification;
|
|
1954
|
+
/** The `link.state` the session was created with, echoed back; absent when the session had none. */
|
|
1955
|
+
link?: {
|
|
1956
|
+
state: string;
|
|
1957
|
+
};
|
|
1958
|
+
/** The signed result token (ES256 JWT, valid 10 minutes), when result tokens are enabled. */
|
|
1959
|
+
resultToken?: string;
|
|
1960
|
+
/** The agent reference sent as `assistedBy` at create, for assisted capture. */
|
|
1961
|
+
assistedBy?: {
|
|
1962
|
+
externalRef: string;
|
|
1963
|
+
};
|
|
1964
|
+
/** Dotted paths the session's create-time {@link CreateSessionInput.overrides} changed. */
|
|
1965
|
+
overriddenFields?: string[];
|
|
1966
|
+
/**
|
|
1967
|
+
* On a session created for an existing subject: `recheck` (the same person
|
|
1968
|
+
* again) or `step_up` (raised to identity level). Absent otherwise.
|
|
1969
|
+
*/
|
|
1970
|
+
reuseMode?: SubjectReuseMode;
|
|
1396
1971
|
/** Sekyro flows: the flow version the session runs (absent on sessions created before flows). */
|
|
1397
1972
|
flow?: SessionFlowRef;
|
|
1398
1973
|
/** The subject (person) the session is linked to, once that subject has passed a verification (absent before that). */
|
|
@@ -1411,6 +1986,26 @@ interface SessionReviewDecidedEventData {
|
|
|
1411
1986
|
/** ID mode only: the ICAO portrait can be fetched with {@link SessionsApi.portrait}. */
|
|
1412
1987
|
portraitAvailable?: boolean;
|
|
1413
1988
|
}
|
|
1989
|
+
/**
|
|
1990
|
+
* `data` of `session.superseded`: a session that waited for a review closed
|
|
1991
|
+
* because a newer attempt of the same person took that review over. The
|
|
1992
|
+
* session ends with status `completed`, `outcome: null` and `supersededBy`;
|
|
1993
|
+
* its review step failed with `superseded_by_retry`; nothing of it is deleted.
|
|
1994
|
+
* Read the newer session (`supersededBy`) for the verdict. This is the one
|
|
1995
|
+
* terminal event of the superseded session.
|
|
1996
|
+
* @public
|
|
1997
|
+
*/
|
|
1998
|
+
interface SessionSupersededEventData {
|
|
1999
|
+
/** The superseded session (`ses_...`). */
|
|
2000
|
+
sessionId: string;
|
|
2001
|
+
/** The newer session of the same person that took the review over (`ses_...`). */
|
|
2002
|
+
supersededBy: string;
|
|
2003
|
+
/** @deprecated No longer sent: the review case is internal. */
|
|
2004
|
+
caseId?: string;
|
|
2005
|
+
reason: "superseded_by_retry";
|
|
2006
|
+
/** Your own id for the person, from `subject.externalRef` at create. */
|
|
2007
|
+
externalRef?: string;
|
|
2008
|
+
}
|
|
1414
2009
|
/**
|
|
1415
2010
|
* `usage.threshold_reached`: a usage, credit or spend threshold of the organization's
|
|
1416
2011
|
* plan was reached (sent once per threshold and period). `kind` is `tier` for a monthly
|
|
@@ -1438,18 +2033,31 @@ interface UsageThresholdReachedEventData {
|
|
|
1438
2033
|
* @public
|
|
1439
2034
|
*/
|
|
1440
2035
|
interface WebhookEventDataMap {
|
|
2036
|
+
/** @deprecated Leaves the catalog after this release (you created the session). */
|
|
1441
2037
|
"session.created": Record<string, unknown>;
|
|
1442
2038
|
"session.started": Record<string, unknown>;
|
|
2039
|
+
/** @deprecated Leaves the catalog after this release: read the steps of the terminal event. */
|
|
1443
2040
|
"session.step.completed": SessionStepCompletedEventData;
|
|
1444
2041
|
"session.review_pending": SessionLifecycleEventData;
|
|
2042
|
+
/** @deprecated Leaves the catalog after this release: see {@link SessionReviewDecidedEventData}. */
|
|
1445
2043
|
"session.review_decided": SessionReviewDecidedEventData;
|
|
1446
2044
|
"session.completed": SessionLifecycleEventData;
|
|
1447
2045
|
"session.expired": SessionLifecycleEventData;
|
|
1448
2046
|
"session.failed": SessionLifecycleEventData;
|
|
2047
|
+
"session.superseded": SessionSupersededEventData;
|
|
2048
|
+
"person.enrolled": PersonEnrolledEventData;
|
|
2049
|
+
"person.updated": PersonUpdatedEventData;
|
|
2050
|
+
"person.suspicious_activity": PersonSuspiciousActivityEventData;
|
|
2051
|
+
"person.deleted": PersonDeletedEventData;
|
|
2052
|
+
/** @deprecated Subscribe to `person.enrolled`, sent next to it with `personId`. */
|
|
1449
2053
|
"subject.enrolled": SubjectEnrolledEventData;
|
|
2054
|
+
/** @deprecated Subscribe to `person.updated`, sent next to it with `personId`. */
|
|
1450
2055
|
"subject.updated": SubjectUpdatedEventData;
|
|
2056
|
+
/** @deprecated Subscribe to `person.suspicious_activity`, sent next to it with `personId`. */
|
|
1451
2057
|
"subject.suspicious_activity": SubjectSuspiciousActivityEventData;
|
|
2058
|
+
/** @deprecated Subscribe to `person.deleted`, sent next to it with `personId`. */
|
|
1452
2059
|
"subject.deleted": SubjectDeletedEventData;
|
|
2060
|
+
/** @deprecated Leaves the catalog after this release (no AML feature behind it). */
|
|
1453
2061
|
"aml.match_flagged": Record<string, unknown>;
|
|
1454
2062
|
"payment.received": Record<string, unknown>;
|
|
1455
2063
|
"invoice.generated": Record<string, unknown>;
|
|
@@ -1489,8 +2097,8 @@ interface WebhookEnvelopeOf<E extends WebhookEventType> {
|
|
|
1489
2097
|
* case "session.completed":
|
|
1490
2098
|
* envelope.data.outcome; // SessionOutcome | null | undefined
|
|
1491
2099
|
* break;
|
|
1492
|
-
* case "
|
|
1493
|
-
* envelope.data.
|
|
2100
|
+
* case "person.updated":
|
|
2101
|
+
* envelope.data.personId; // "per_..."
|
|
1494
2102
|
* break;
|
|
1495
2103
|
* }
|
|
1496
2104
|
* ```
|
|
@@ -1547,13 +2155,17 @@ interface ConnectorIdentity {
|
|
|
1547
2155
|
* @public
|
|
1548
2156
|
*/
|
|
1549
2157
|
declare class SessionsApi {
|
|
1550
|
-
private readonly
|
|
2158
|
+
private readonly t;
|
|
1551
2159
|
/**
|
|
1552
2160
|
* Constructed by {@link Sekyro}; the transport is kept out of the public
|
|
1553
|
-
* surface on purpose (only its bound
|
|
2161
|
+
* surface on purpose (only its bound calls cross this boundary).
|
|
1554
2162
|
* @internal
|
|
1555
2163
|
*/
|
|
1556
|
-
constructor(
|
|
2164
|
+
constructor(t: {
|
|
2165
|
+
call<T>(method: "GET" | "POST" | "DELETE", path: string, body?: unknown, idempotencyKey?: string): Promise<T>;
|
|
2166
|
+
page<T>(path: string): Promise<Page<T>>;
|
|
2167
|
+
bytes(path: string): Promise<MediaBytes>;
|
|
2168
|
+
});
|
|
1557
2169
|
/**
|
|
1558
2170
|
* `POST /sessions`. Returns the one-time `clientToken` — hand it to the
|
|
1559
2171
|
* browser, never persist it. Pass an `idempotencyKey` so a retried call
|
|
@@ -1570,20 +2182,79 @@ declare class SessionsApi {
|
|
|
1570
2182
|
* {@link isFlowError}).
|
|
1571
2183
|
*/
|
|
1572
2184
|
selectMethod(id: string, method: IdentityMethod): Promise<Session>;
|
|
1573
|
-
/** `GET /sessions/:id` — the whitelisted view (no client token). */
|
|
2185
|
+
/** `GET /sessions/:id` — the whitelisted view (no client token). Either id form (`ses_...` or bare) works. */
|
|
1574
2186
|
get(id: string): Promise<Session>;
|
|
1575
2187
|
/**
|
|
1576
|
-
* `
|
|
1577
|
-
*
|
|
2188
|
+
* `POST /sessions/:id/cancel` — stop a session that has not ended. The
|
|
2189
|
+
* hosted link stops working, and one `session.failed` with
|
|
2190
|
+
* `failureReason: "cancelled_by_organization"` is sent. Returns the
|
|
2191
|
+
* cancelled session. `409 session_not_cancellable` once the session has
|
|
2192
|
+
* ended (a repeated cancel included). Needs the `sessions:create` scope.
|
|
2193
|
+
*/
|
|
2194
|
+
cancel(id: string, opts?: RequestOptions): Promise<Session>;
|
|
2195
|
+
/**
|
|
2196
|
+
* `POST /sessions/:id/link/resend` — send the hosted link again through the
|
|
2197
|
+
* session's own `deliver` channel, to the same destination (neither can be
|
|
2198
|
+
* changed). Only for sessions created with `deliver`:
|
|
2199
|
+
* `409 link_not_deliverable` otherwise, `409 link_not_usable` once the
|
|
2200
|
+
* session ended, `429 resend_rate_limited` past the send limits. Needs the
|
|
2201
|
+
* `sessions:create` scope.
|
|
2202
|
+
*/
|
|
2203
|
+
resendLink(id: string, opts?: RequestOptions): Promise<SessionLinkDelivery>;
|
|
2204
|
+
/**
|
|
2205
|
+
* `POST /sessions/:id/link/extend` — a later expiry for the hosted link
|
|
2206
|
+
* and its session: `{ ttlMinutes }` counted from the session creation, or
|
|
2207
|
+
* `{ expiresAt }`. `400 ttl_out_of_policy` when it is not later than the
|
|
2208
|
+
* current expiry or past the flow's maximum. Only for sessions created with
|
|
2209
|
+
* `deliver`. Needs the `sessions:create` scope.
|
|
2210
|
+
*/
|
|
2211
|
+
extendLink(id: string, input: ExtendLinkInput, opts?: RequestOptions): Promise<SessionLinkExpiry>;
|
|
2212
|
+
/**
|
|
2213
|
+
* The first page of your sessions, newest first (`GET /sessions`; the API
|
|
2214
|
+
* returns 50 by default, at most 100 with `limit`). Read every page with
|
|
2215
|
+
* {@link SessionsApi.iterate}, or one page and its cursor with
|
|
2216
|
+
* {@link SessionsApi.listPage}. The `externalRef` and `status` filters are
|
|
1578
2217
|
* applied again to the answer, so an API that ignores them never returns
|
|
1579
2218
|
* another user's sessions.
|
|
1580
2219
|
*/
|
|
1581
2220
|
list(query?: ListSessionsQuery): Promise<Session[]>;
|
|
2221
|
+
/** One page of {@link SessionsApi.list} with its `nextCursor` (absent on the last page). */
|
|
2222
|
+
listPage(query?: ListSessionsQuery): Promise<Page<Session>>;
|
|
2223
|
+
/**
|
|
2224
|
+
* Every session matching `query`, newest first, following `nextCursor` page
|
|
2225
|
+
* after page (`limit` sets the page size).
|
|
2226
|
+
*
|
|
2227
|
+
* @example
|
|
2228
|
+
* ```ts
|
|
2229
|
+
* for await (const s of sekyro.sessions.iterate({ status: "completed" })) {
|
|
2230
|
+
* console.log(s.id);
|
|
2231
|
+
* }
|
|
2232
|
+
* ```
|
|
2233
|
+
*/
|
|
2234
|
+
iterate(query?: ListSessionsQuery): AsyncGenerator<Session, void, undefined>;
|
|
2235
|
+
/**
|
|
2236
|
+
* `GET /sessions/:id/media` — the session's media (documents, portraits,
|
|
2237
|
+
* the selfie, the clips), each with its check, attempt tags and a URL valid
|
|
2238
|
+
* 15 minutes ({@link MediaItem}). Needs the `sessions:read` scope.
|
|
2239
|
+
*/
|
|
2240
|
+
media(id: string): Promise<MediaList>;
|
|
2241
|
+
/**
|
|
2242
|
+
* `GET /sessions/:id/media/:kind` — the bytes of one media item: the
|
|
2243
|
+
* decisive attempt of that kind by default, `attempt` for another one,
|
|
2244
|
+
* `reference: "first"` for the first reference of a `reference_portrait`
|
|
2245
|
+
* a second reference decided. `404 media_not_available` when the kind, the
|
|
2246
|
+
* attempt or the object is not there. Needs the `sessions:read` scope.
|
|
2247
|
+
*/
|
|
2248
|
+
mediaBytes(id: string, kind: MediaKind, opts?: MediaBytesOptions): Promise<MediaBytes>;
|
|
1582
2249
|
/**
|
|
1583
|
-
* `GET /sessions/:id/portrait?format=url` — ID mode: a
|
|
1584
|
-
* link to the 480×640 ICAO portrait (JPEG). Needs the
|
|
1585
|
-
*
|
|
1586
|
-
* until the session's `portrait_icao` check
|
|
2250
|
+
* `GET /sessions/:id/portrait?format=url` — ID mode: a short-lived
|
|
2251
|
+
* presigned link to the 480×640 ICAO portrait (JPEG). Needs the
|
|
2252
|
+
* `sessions:read` scope (the older `portrait:read` still works).
|
|
2253
|
+
* `404 portrait_not_available` until the session's `portrait_icao` check
|
|
2254
|
+
* has passed (`portraitAvailable`).
|
|
2255
|
+
* @deprecated Use {@link SessionsApi.media} (the `icao_portrait` item) or
|
|
2256
|
+
* {@link SessionsApi.mediaBytes} with `icao_portrait`. This method stays on
|
|
2257
|
+
* the portrait route for its last release.
|
|
1587
2258
|
*/
|
|
1588
2259
|
portrait(id: string): Promise<SessionPortraitLink>;
|
|
1589
2260
|
/**
|
|
@@ -1595,49 +2266,71 @@ declare class SessionsApi {
|
|
|
1595
2266
|
resultToken(id: string): Promise<ResultTokenResponse>;
|
|
1596
2267
|
}
|
|
1597
2268
|
/**
|
|
1598
|
-
* `sekyro.
|
|
1599
|
-
* apps). Reads need the `
|
|
1600
|
-
* `
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
2269
|
+
* `sekyro.people` — read and manage people (the same person across your
|
|
2270
|
+
* apps). Reads need the `people:read` scope, `revoke` / `delete` the
|
|
2271
|
+
* `people:write` scope (`subjects:read` and `subjects:write`, the older
|
|
2272
|
+
* names, still work; keys minted from the dashboard carry both). A person is
|
|
2273
|
+
* visible once they have passed a verification: a person who never passed,
|
|
2274
|
+
* an unknown id and a person of another organization or environment all
|
|
2275
|
+
* answer the same `404 subject_not_found` on `get`, `revoke` and `delete`,
|
|
2276
|
+
* and `list` leaves them out. Ids are `per_...`; the bare 24 hexadecimal
|
|
2277
|
+
* characters name the same person.
|
|
1603
2278
|
*
|
|
1604
2279
|
* Type-only export, like {@link SessionsApi}: obtained through
|
|
1605
|
-
* {@link Sekyro.
|
|
2280
|
+
* {@link Sekyro.people}.
|
|
1606
2281
|
* @public
|
|
1607
2282
|
*/
|
|
1608
|
-
declare class
|
|
1609
|
-
private readonly
|
|
2283
|
+
declare class PeopleApi {
|
|
2284
|
+
private readonly t;
|
|
1610
2285
|
/** @internal */
|
|
1611
|
-
constructor(
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2286
|
+
constructor(t: {
|
|
2287
|
+
call<T>(method: "GET" | "POST" | "DELETE", path: string, body?: unknown, idempotencyKey?: string): Promise<T>;
|
|
2288
|
+
page<T>(path: string): Promise<Page<T>>;
|
|
2289
|
+
});
|
|
2290
|
+
/** `GET /people/:id` — the person, their sessions and their returning-user readiness. */
|
|
2291
|
+
get(id: string): Promise<Person>;
|
|
2292
|
+
/**
|
|
2293
|
+
* The first page of the people who have passed a verification, newest
|
|
2294
|
+
* first (`GET /people`; 50 by default, at most 100 with `limit`),
|
|
2295
|
+
* optionally only those carrying your own id (`externalRef`). The list can
|
|
2296
|
+
* be empty while sessions with this `externalRef` exist. Every page:
|
|
2297
|
+
* {@link PeopleApi.iterate}.
|
|
2298
|
+
*/
|
|
2299
|
+
list(query?: ListPeopleQuery): Promise<Person[]>;
|
|
2300
|
+
/** One page of {@link PeopleApi.list} with its `nextCursor` (absent on the last page). */
|
|
2301
|
+
listPage(query?: ListPeopleQuery): Promise<Page<Person>>;
|
|
2302
|
+
/** Every person matching `query`, newest first, following `nextCursor` page after page. */
|
|
2303
|
+
iterate(query?: ListPeopleQuery): AsyncGenerator<Person, void, undefined>;
|
|
1618
2304
|
/**
|
|
1619
|
-
* `POST /
|
|
2305
|
+
* `POST /people/:id/revoke` — the person can no longer be used for
|
|
1620
2306
|
* returning-user sessions. Idempotent: revoking again returns the same view.
|
|
1621
|
-
* Emits `subject.updated` with `status: 'revoked'`.
|
|
2307
|
+
* Emits `person.updated` (and `subject.updated`) with `status: 'revoked'`.
|
|
1622
2308
|
*/
|
|
1623
|
-
revoke(id: string, input?:
|
|
2309
|
+
revoke(id: string, input?: RevokePersonInput, opts?: RequestOptions): Promise<Person>;
|
|
1624
2310
|
/**
|
|
1625
|
-
* `DELETE /
|
|
1626
|
-
* templates and identifiers, and
|
|
1627
|
-
*
|
|
2311
|
+
* `DELETE /people/:id` — deletes the person's stored photos, face
|
|
2312
|
+
* templates and identifiers, and the personal data and media of their
|
|
2313
|
+
* sessions, which it unlinks (they keep their outcome and steps). Emits
|
|
2314
|
+
* `person.deleted` (and `subject.deleted`). Cannot be undone; a second call answers `404`.
|
|
1628
2315
|
*/
|
|
1629
|
-
delete(id: string): Promise<
|
|
2316
|
+
delete(id: string): Promise<DeletedPerson>;
|
|
1630
2317
|
/**
|
|
1631
|
-
* A re-check or step-up session for an existing
|
|
1632
|
-
* `POST /
|
|
1633
|
-
* hexadecimal characters) or `{
|
|
1634
|
-
* `POST /
|
|
2318
|
+
* A re-check or step-up session for an existing person in one call:
|
|
2319
|
+
* `POST /people/:id/sessions` when `target` is a person id (`per_...` or 24
|
|
2320
|
+
* hexadecimal characters) or `{ personId }`, otherwise
|
|
2321
|
+
* `POST /people/by-external-ref/:externalRef/sessions` (pass
|
|
1635
2322
|
* `{ externalRef }` to force it). Same result and errors as
|
|
1636
2323
|
* {@link SessionsApi.create}; needs the `sessions:create` and
|
|
1637
|
-
* `
|
|
2324
|
+
* `people:read` scopes.
|
|
1638
2325
|
*/
|
|
1639
|
-
createSession(target: string |
|
|
2326
|
+
createSession(target: string | PersonSessionTarget, input: PersonSessionInput, opts?: RequestOptions): Promise<CreatedSession>;
|
|
1640
2327
|
}
|
|
2328
|
+
/**
|
|
2329
|
+
* @deprecated Use {@link PeopleApi} ({@link Sekyro.people}); `sekyro.subjects`
|
|
2330
|
+
* is the same object.
|
|
2331
|
+
* @public
|
|
2332
|
+
*/
|
|
2333
|
+
type SubjectsApi = PeopleApi;
|
|
1641
2334
|
/**
|
|
1642
2335
|
* Sekyro AI partner API client. Server-side only: it carries your API key.
|
|
1643
2336
|
*
|
|
@@ -1648,14 +2341,16 @@ declare class SubjectsApi {
|
|
|
1648
2341
|
* @example
|
|
1649
2342
|
* ```ts
|
|
1650
2343
|
* const sekyro = new Sekyro({ apiKey: process.env.SEKYRO_API_KEY! });
|
|
1651
|
-
* const { id,
|
|
2344
|
+
* const { id, hostedUrl } = await sekyro.sessions.create({ person: { externalRef: "<your user id>" } });
|
|
1652
2345
|
* ```
|
|
1653
2346
|
* @public
|
|
1654
2347
|
*/
|
|
1655
2348
|
declare class Sekyro {
|
|
1656
2349
|
#private;
|
|
1657
2350
|
readonly sessions: SessionsApi;
|
|
1658
|
-
readonly
|
|
2351
|
+
readonly people: PeopleApi;
|
|
2352
|
+
/** @deprecated Use {@link Sekyro.people}: the same object. */
|
|
2353
|
+
readonly subjects: PeopleApi;
|
|
1659
2354
|
constructor(opts: SekyroOptions);
|
|
1660
2355
|
/**
|
|
1661
2356
|
* `GET /flows` — the published flows of the API key's app (default flow
|
|
@@ -1666,4 +2361,4 @@ declare class Sekyro {
|
|
|
1666
2361
|
listFlows(): Promise<FlowSummary[]>;
|
|
1667
2362
|
}
|
|
1668
2363
|
|
|
1669
|
-
export { type
|
|
2364
|
+
export { type LevelTarget as $, type AgeMethod as A, type DocumentSubstitutionSettings as B, type CreatedSession as C, DEFAULT_BASE_URL as D, type EidResult as E, type FetchLike as F, type EligibilityReason as G, type ExtendLinkInput as H, type FlowOverridableSettings as I, type FlowOverrides as J, type FlowServiceSettings as K, type Locale as L, type FlowSummary as M, type IdNumberReason as N, type Identity as O, type IdentityBirthPlace as P, type IdentityDocument as Q, type ReviewReason as R, Sekyro as S, type IdentityIdNumber as T, type IdentityMethod as U, type VerificationLevel as V, type WebhookEventType as W, type IdentityName as X, type IdentityScalarKey as Y, type IdentitySource as Z, type IdentitySources as _, type ServiceId as a, type SubjectSession as a$, type ListPeopleQuery as a0, type ListSessionsQuery as a1, type MatchReason as a2, type MediaBytes as a3, type MediaBytesOptions as a4, type MediaItem as a5, type MediaKind as a6, type MediaList as a7, type NameForm as a8, type Page as a9, type SessionEventData as aA, type SessionFailureReason as aB, type SessionFlowRef as aC, type SessionLifecycleEventData as aD, type SessionLinkDelivery as aE, type SessionLinkExpiry as aF, type SessionLinkInput as aG, type SessionNetwork as aH, type SessionNetworkEvent as aI, type SessionPortraitLink as aJ, type SessionReviewDecidedEventData as aK, type SessionStatus as aL, type SessionStep as aM, type SessionStepCompletedEventData as aN, type SessionStepDecision as aO, type SessionSubjectInput as aP, type SessionSupersededEventData as aQ, SessionsApi as aR, type Subject as aS, type SubjectAssurance as aT, type SubjectDeletedEventData as aU, type SubjectEnrolledEventData as aV, type SubjectIdNumber as aW, type SubjectName as aX, type SubjectReferenceSource as aY, type SubjectReuseDocument as aZ, type SubjectReuseTarget as a_, PeopleApi as aa, type Person as ab, type PersonBirthPlaceInput as ac, type PersonDeletedEventData as ad, type PersonDocumentInput as ae, type PersonEnrolledEventData as af, type PersonSession as ag, type PersonSessionInput as ah, type PersonSessionTarget as ai, type PersonSuspiciousActivityEventData as aj, type PersonUpdatedEventData as ak, type PolicyFailureReason as al, type PortraitReportEntry as am, type PriorReviewReason as an, type ProbeBindingReason as ao, type ProbeQuality as ap, type ProfileDocumentType as aq, type RequestOptions as ar, type ResultTokenResponse as as, type ReviewOutcomeReason as at, type RevokePersonInput as au, type RevokeSubjectInput as av, type SekyroOptions as aw, type Session as ax, type SessionDevice as ay, type SessionDeviceSignal as az, type SessionPersonInput as b, type SubjectSessionInput as b0, type SubjectSessionTarget as b1, type SubjectStatus as b2, type SubjectSuspiciousActivityEventData as b3, type SubjectUpdatedEventData as b4, type SubjectsApi as b5, type SuppliedIdentityRecord as b6, type UsageThresholdReachedEventData as b7, type VerifiedContacts as b8, type WebhookEnvelopeOf as b9, type WebhookEventDataMap as ba, 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 ResultRisk as i, type ResultCheckProofs as j, type ResultDuplicate as k, type FailureIdentification as l, type AgeResult as m, type CameraUnavailableCause as n, type CheckState as o, type CheckType as p, type ConnectorIdentity as q, type CreateSessionInput as r, type CreatedSessionWarning as s, DEFAULT_TIMEOUT_MS as t, type DecidedBy as u, type DecisionReason as v, type DeepPartial as w, type DeletedPerson as x, type DeletedSubject as y, type DeliverOptions as z };
|