@sekyro/web 0.1.0-rc.8 → 0.1.0-rc.9

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +54 -61
  3. package/dist/{capture-session-doc-YBE3UMJJ.js → capture-session-doc-QQHDBZG4.js} +1 -1
  4. package/dist/{chunk-YPG7CB4O.js → chunk-4Q7EMVP7.js} +1 -1
  5. package/dist/{chunk-RNRFHUJA.js → chunk-56GT33O3.js} +1 -1
  6. package/dist/{chunk-DQWW4OCK.js → chunk-EVVGQSNJ.js} +1 -1
  7. package/dist/chunk-F5ST423J.js +1 -0
  8. package/dist/chunk-GBTZIKGZ.js +1 -0
  9. package/dist/chunk-H6HC7B77.js +1 -0
  10. package/dist/{chunk-LQ7C44JG.js → chunk-LUHNRNTO.js} +1 -1
  11. package/dist/{chunk-RVHAKRAI.js → chunk-WRKUWIJW.js} +1 -1
  12. package/dist/chunk-ZUHTYCY4.js +1 -0
  13. package/dist/client/index.cjs +1 -1
  14. package/dist/client/index.d.cts +26 -4
  15. package/dist/client/index.d.ts +26 -4
  16. package/dist/client/index.js +1 -1
  17. package/dist/core/index.cjs +1 -1
  18. package/dist/core/index.js +1 -1
  19. package/dist/create-document-capture-DWRNFXA2.js +1 -0
  20. package/dist/{create-verification-DoFpgzok.d.cts → create-verification-BS2qbe75.d.cts} +101 -16
  21. package/dist/{create-verification-C0AVIcVW.d.ts → create-verification-CCR-CwVQ.d.ts} +101 -16
  22. package/dist/{icao-gate-D8qm1O2t.d.cts → icao-gate-DKbWXP51.d.cts} +104 -39
  23. package/dist/{icao-gate-D8qm1O2t.d.ts → icao-gate-DKbWXP51.d.ts} +104 -39
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.cts +4 -4
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +1 -1
  28. package/dist/internal/index.cjs +1 -1
  29. package/dist/internal/index.d.cts +11 -20
  30. package/dist/internal/index.d.ts +11 -20
  31. package/dist/internal/index.js +1 -1
  32. package/dist/{plan-runner-UBK4B4CG.js → plan-runner-X4YW3INX.js} +1 -1
  33. package/package.json +1 -1
  34. package/sbom.cdx.json +7 -7
  35. package/dist/chunk-4RS2YIL4.js +0 -1
  36. package/dist/chunk-MY6EXEL2.js +0 -1
  37. package/dist/chunk-XLN5OT25.js +0 -1
  38. package/dist/chunk-YDQBVWXG.js +0 -1
  39. package/dist/create-document-capture-T4APHJMY.js +0 -1
@@ -442,21 +442,82 @@ type EidAfterPass = "end" | "continue";
442
442
  * `contact`, Step 2 `identity`, Step 3 `live_photo`. Open: a value this SDK
443
443
  * does not know is kept as is, so a client still places the step.
444
444
  */
445
- type StepSection = "contact" | "identity" | "live_photo" | (string & {});
446
- /** A contact channel of a `one_of` session (`otpChoice.options`). */
445
+ type StepSection = "contact" | "identity" | "live_photo" | "screening" | (string & {});
446
+ /** A contact channel of a contact choice (`phone_otp` → `phone`, `email_otp` → `email`). */
447
447
  type ContactChannel = "phone" | "email";
448
448
  /**
449
- * Step 1 contact choice (`HostedSessionView.otpChoice`), present only on a
450
- * `contact.mode = one_of` session: the person confirms a phone number OR an
451
- * email address. `selected` is `null` until they choose
452
- * ({@link HostedClient.selectContact}, or implicitly with the first OTP
453
- * submission); `locked` once a contact step passed.
449
+ * @deprecated Sekyro flows: the contact choice is `plan.choice` (kind `contact`,
450
+ * {@link PlanChoiceView}); the view no longer carries this shape.
454
451
  */
455
452
  interface OtpChoiceView {
456
453
  options: ContactChannel[];
457
454
  selected: ContactChannel | null;
458
455
  locked: boolean;
459
456
  }
457
+ /** The flow version a session runs (`HostedSessionView.flow`). */
458
+ interface HostedFlowRef {
459
+ id: string;
460
+ slug: string;
461
+ version: number;
462
+ }
463
+ /** The kind of a choice node (Sekyro flows §7.4); a newer server's kind is kept as is. */
464
+ type PlanChoiceKind = "identity_method" | "contact" | "generic" | (string & {});
465
+ /** One option of a choice node, in the server's display order. */
466
+ interface PlanChoiceOption {
467
+ /** The option id sent back with {@link HostedClient.choose} (`document`, `registry`, `phone`, …). */
468
+ id: string;
469
+ /** The service of the option's lane (`document`, `nfc`, `population_registry`, `national_eid`, `phone_otp`, `email_otp`, …). */
470
+ service: string;
471
+ /** Unavailable options are omitted by the server; always `true` when listed. */
472
+ available: boolean;
473
+ /** `national_eid` options: the provider ("Verify with Houwiyeti"); absent or `null` otherwise and on older APIs. */
474
+ nationalEid?: NationalEidOption | null;
475
+ }
476
+ /** `plan.choice`: the choice the person makes now (or may still switch, while `locked` is false). */
477
+ interface PlanChoiceView {
478
+ nodeId: string;
479
+ kind: PlanChoiceKind;
480
+ /** The chosen option id, `null` before a pick. */
481
+ selected: string | null;
482
+ /** The choice can no longer change (a submission into the chosen lane, or the option settled). */
483
+ locked: boolean;
484
+ options: PlanChoiceOption[];
485
+ }
486
+ /** Submissions used on a step and its cap (remaining = `max - used`). */
487
+ interface PlanAttempts {
488
+ used: number;
489
+ max: number;
490
+ }
491
+ /**
492
+ * A step of the plan (a visited node or the current one, never an untaken lane):
493
+ * its node id, service and state plus today's per-type extras (`otp`, `emailOtp`,
494
+ * `eid`, `nfc`, `docCapture`, `nniFromDocument`, `reason`, `icao`, `requiresMobile`, …).
495
+ * A node with two checks yields two steps (`n_live` liveness, `n_live.icao` the ICAO portrait).
496
+ */
497
+ interface PlanStepView extends Omit<HostedStepView, "checkType" | "attemptsRemaining" | "section"> {
498
+ /** The node id (`n_doc`), stable across views; `<node>.icao` for the ICAO portrait of a liveness node. */
499
+ id: string;
500
+ /** The catalog service of the node (`document`, `liveness`, `summary_confirm`, …). */
501
+ service: string;
502
+ /** The check this step submits (`doc_ocr`, `portrait_icao`, `identity_confirm`, …). */
503
+ checkType: CheckType | (string & {});
504
+ section: StepSection;
505
+ attempts: PlanAttempts;
506
+ }
507
+ /** A segment of the progress bar (`plan.sections`): the sections still possible on any remaining path. */
508
+ interface PlanSectionView {
509
+ id: StepSection;
510
+ state: "done" | "current" | "upcoming";
511
+ }
512
+ /** `HostedSessionView.plan` (Sekyro flows §8.1). */
513
+ interface HostedPlanView {
514
+ /** A choice node id (`plan.choice.nodeId`) or a step id; `null` while nothing waits on the person. */
515
+ current: string | null;
516
+ /** Present while `current` is a choice (and, on newer servers, while its lane can still be switched). */
517
+ choice?: PlanChoiceView;
518
+ steps: PlanStepView[];
519
+ sections: PlanSectionView[];
520
+ }
460
521
  /** Where the identity summary's data came from. */
461
522
  type IdentitySummarySource = "registry" | "document" | "chip";
462
523
  /**
@@ -498,10 +559,10 @@ interface IdentitySummaryView {
498
559
  /** The answer to the identity summary ({@link HostedClient.confirmIdentity}). */
499
560
  type IdentityConfirmDecision = "confirm" | "retake";
500
561
  /**
501
- * The identity-method choice of a session (`HostedSessionView.methodChoice`).
502
- * While `available && selected === null` no check can be submitted (409
503
- * `method_required`): the page asks first and sends the answer with
504
- * `POST /hosted/method` ({@link HostedClient.selectMethod}).
562
+ * The pending identity-method choice in the 0.1 vocabulary, read from
563
+ * `plan.choice` (`kind: identity_method`): `document` → `document_photo`,
564
+ * `nfc` → `document_chip`, `population_registry` → `national_number`,
565
+ * `national_eid` → `national_eid`. See {@link Verification.methodChoice}.
505
566
  */
506
567
  interface MethodChoiceView {
507
568
  /** The session offers the choice (the app's document mode is `optional`). */
@@ -632,6 +693,13 @@ interface NfcStepView {
632
693
  default: Record<string, true | "unknown">;
633
694
  byIssuer: Record<string, Record<string, true | "unknown">>;
634
695
  };
696
+ /**
697
+ * Sekyro flows §7.7: where the chip key's MRZ comes from — `capture` (an
698
+ * MRZ-only scan before the chip read) or `document` (the earlier document step).
699
+ */
700
+ mrz?: {
701
+ source: "capture" | "document" | (string & {});
702
+ };
635
703
  }
636
704
  /**
637
705
  * Per-check projection in a {@link HostedSessionView} — the spec'd hosted step
@@ -840,7 +908,6 @@ interface HostedSessionView {
840
908
  sessionId: string;
841
909
  status: SessionStatus;
842
910
  outcome: SessionOutcome | null;
843
- steps: HostedStepView[];
844
911
  /** ISO-8601 timestamp (Date on the server, string on the wire). */
845
912
  expiresAt: string;
846
913
  consentRecorded: boolean;
@@ -897,12 +964,6 @@ interface HostedSessionView {
897
964
  * picker. Absent on older APIs (fall back to `acceptedDocumentTypes` for MR).
898
965
  */
899
966
  acceptedDocuments?: HostedAcceptedDocuments;
900
- /**
901
- * The identity-method choice (profile v2 step 3). Absent when the session
902
- * has no choice (and on older APIs). While `available && selected === null`
903
- * every check submission answers 409 `method_required`.
904
- */
905
- methodChoice?: MethodChoiceView;
906
967
  /**
907
968
  * ISO-8601 time from which this device may verify again — set with
908
969
  * `failureReason: 'device_cooldown'` (profile v2 step 4). Absent otherwise
@@ -939,12 +1000,23 @@ interface HostedSessionView {
939
1000
  purpose: "verification";
940
1001
  icao: HostedIcaoPolicy;
941
1002
  };
942
- /** Step 1 contact choice of a `one_of` session (flow model 2026-10-23). */
943
- otpChoice?: OtpChoiceView;
1003
+ /** The flow version the session runs (Sekyro flows §9.2). */
1004
+ flow?: HostedFlowRef;
1005
+ /**
1006
+ * What the person does now (Sekyro flows §8.1), the only source of the
1007
+ * steps: render `plan.current`. Absent on an active session only from a
1008
+ * backend older than the flows release (the SDK then asks for an update).
1009
+ */
1010
+ plan?: HostedPlanView;
944
1011
  /** Step 2b identity summary, present only while its confirmation is pending. */
945
1012
  identitySummary?: IdentitySummaryView;
946
1013
  }
947
1014
  /** `POST /hosted/consent` result — 201 on first record, 200 `{alreadyRecorded: true}` on replay. */
1015
+ /**
1016
+ * `POST /hosted/consent` answer (Sekyro flows §8.2): the hosted view with
1017
+ * `consentRecorded: true`, plus whether consent was already on record.
1018
+ */
1019
+ type HostedConsentView = HostedSessionView & RecordConsentResult;
948
1020
  interface RecordConsentResult {
949
1021
  alreadyRecorded: boolean;
950
1022
  }
@@ -1289,8 +1361,7 @@ interface HostedClientOptions {
1289
1361
  *
1290
1362
  * GET /api/v2/hosted/session → {@link getSession}
1291
1363
  * POST /api/v2/hosted/consent → {@link recordConsent}
1292
- * POST /api/v2/hosted/method → {@link selectMethod}
1293
- * POST /api/v2/hosted/contact → {@link selectContact}
1364
+ * POST /api/v2/hosted/choice → {@link choose}
1294
1365
  * POST /api/v2/hosted/identity/confirm → {@link confirmIdentity}
1295
1366
  * GET /api/v2/hosted/identity/portrait → {@link identityPortrait}
1296
1367
  * POST /api/v2/sessions/:id/media → {@link presign}
@@ -1333,21 +1404,14 @@ declare class HostedClient {
1333
1404
  * `alreadyRecorded: true`). Until recorded, media presign/complete AND check
1334
1405
  * submission answer 409 `consent_required`.
1335
1406
  */
1336
- recordConsent(locale: ConsentLocale): Promise<RecordConsentResult>;
1337
- /**
1338
- * Send the person's identity method (profile v2 step 3) when the view offers
1339
- * a choice (`methodChoice.available`). Returns the updated hosted view —
1340
- * continue from it. 409 `method_locked` when the method can no longer
1341
- * change (a check of the chosen method was already submitted).
1342
- */
1343
- selectMethod(method: IdentityMethod): Promise<HostedSessionView>;
1407
+ recordConsent(locale: ConsentLocale): Promise<HostedConsentView>;
1344
1408
  /**
1345
- * Choose how the person confirms their contact (flow model 2026-10-23, Step 1)
1346
- * on a `one_of` session (`otpChoice` in the view): `phone` or `email`. Returns
1347
- * the updated hosted view. The person may switch until a contact step passed;
1348
- * then (or on a session without the choice) 409 `contact_locked`.
1409
+ * Pick an option of the current choice (Sekyro flows §7.4): `plan.choice`'s
1410
+ * `nodeId` and one of its option ids. Returns the updated hosted view —
1411
+ * render it. The person may switch while `plan.choice.locked` is false.
1412
+ * Errors: 409 `choice_locked`, 409 `choice_option_unavailable`, 404 `choice_not_found`.
1349
1413
  */
1350
- selectContact(channel: ContactChannel): Promise<HostedSessionView>;
1414
+ choose(nodeId: string, option: string): Promise<HostedSessionView>;
1351
1415
  /**
1352
1416
  * Answer the identity summary (`identitySummary` in the view, Step 2b):
1353
1417
  * `confirm` lifts the live-photo gate, `retake` re-opens the identity checks
@@ -1414,9 +1478,10 @@ declare class HostedClient {
1414
1478
  completeMedia(key: string): Promise<CompleteMediaResult>;
1415
1479
  /**
1416
1480
  * Submit one check. Sends `{input, forceOutcome?}` (SubmitCheckSchema) and the
1417
- * optional `x-idempotency-key` header. Returns the whitelisted SessionView.
1481
+ * optional `x-idempotency-key` header. Returns the hosted view after the
1482
+ * submission (Sekyro flows §8.2: with its `plan`) — render it.
1418
1483
  */
1419
- submitCheck<T extends CheckType>(checkType: T, input: CheckInputByType[T], opts?: SubmitOptions): Promise<SessionView>;
1484
+ submitCheck<T extends CheckType>(checkType: T, input: CheckInputByType[T], opts?: SubmitOptions): Promise<HostedSessionView>;
1420
1485
  /**
1421
1486
  * Convenience composition: presign → PUT → complete → submit, passing the
1422
1487
  * PROMOTED key (from complete's response — never the pending presign key)
@@ -1426,7 +1491,7 @@ declare class HostedClient {
1426
1491
  * param-stripped ONCE and used for both presign and PUT, so the signed
1427
1492
  * header always matches.
1428
1493
  */
1429
- uploadAndSubmit<T extends MediaCheckType>(checkType: T, media: UploadMedia, extraInput: Omit<CheckInputByType[T], (typeof MEDIA_INPUT_FIELD)[T]>, opts?: SubmitOptions): Promise<SessionView>;
1494
+ uploadAndSubmit<T extends MediaCheckType>(checkType: T, media: UploadMedia, extraInput: Omit<CheckInputByType[T], (typeof MEDIA_INPUT_FIELD)[T]>, opts?: SubmitOptions): Promise<HostedSessionView>;
1430
1495
  /** The token's own sessionId — cached from getSession(), lazily bootstrapped. */
1431
1496
  private ensureSessionId;
1432
1497
  /**
@@ -1652,4 +1717,4 @@ interface IcaoGateOptions {
1652
1717
  }
1653
1718
  declare function createIcaoGate(t: ResolvedIcaoTuning, options?: IcaoGateOptions): IcaoGate;
1654
1719
 
1655
- export { type PopulationReason as $, type AcceptedDocumentType as A, type IcaoCoachKey as B, type CheckReason as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type IcaoCriterion as G, type HeadPose as H, type IcaoCaptureTuning as I, type IcaoCriterionState as J, type IcaoGateCriterion as K, type IcaoGateSummary as L, type IcaoGateUpdate as M, type IcaoReportEntry as N, type IdentityConfirmDecision as O, type IdentityMethod as P, type IdentitySummarySource as Q, type IdentitySummaryView as R, type LivenessReason as S, type MatchReason as T, type MethodChoiceView as U, type NationalEidOption as V, type NfcChipReason as W, type NfcStepView as X, type OtpChoiceView as Y, type PhoneOtpReason as Z, type PolicyFailureReason as _, type CheckState as a, type MediaCheckType as a$, type PortraitIcaoInput as a0, type PortraitIcaoReason as a1, type SessionFailureReason as a2, type SessionOutcome as a3, type SessionStatus as a4, type StepSection as a5, type SessionView as a6, type BackgroundStats as a7, type Box as a8, CLIPPED_LUMA as a9, icaoWindow as aA, judgeIcao as aB, lumaPlane as aC, percentile as aD, portraitCropRegion as aE, poseFromMatrix as aF, regionStats as aG, resolveIcaoTuning as aH, scoreFrame as aI, windowOverflow as aJ, type PersonMask as aK, HostedClient as aL, type AttestationInput as aM, type CaptureContext as aN, type CaptureNoncesResult as aO, type CaptureProof as aP, type CheckInputByType as aQ, type CompleteMediaResult as aR, type ConsentLocale as aS, type DocDeviceRead as aT, type DocOcrInput as aU, type DocSide as aV, type EmailOtpInput as aW, type FaceMatchInput as aX, type HostedClientOptions as aY, type LivenessCaptureInput as aZ, type LivenessInput as a_, type FaceGeometry as aa, type FaceLighting as ab, ICAO_CANVAS as ac, ICAO_FALLBACK as ad, ICAO_GATE_CRITERIA as ae, ICAO_SHARP_REF as af, type IcaoFrameObservation as ag, type IcaoGate as ah, type IcaoGateOptions as ai, type IcaoJudgedCriterion as aj, type IcaoMeasures as ak, type IcaoPixelStats as al, type IcaoProfile as am, type LumaPlane as an, type Point as ao, type RegionStats as ap, type ResolvedIcaoTuning as aq, backgroundStats as ar, createIcaoGate as as, eyeLineRoll as at, eyeOpenness as au, eyeSpecular as av, faceGeometry as aw, faceLighting as ax, faceSharpness as ay, icaoPixelStats as az, type CheckType as b, type MediaKind as b0, type PhoneOtpInput as b1, type PopulationInput as b2, type PresignRequest as b3, type PresignUploadResult as b4, type RecordConsentResult as b5, type SessionStepView as b6, type SubmitCheckBody as b7, type SubmitOptions as b8, type UploadMedia as b9, stripMimeParams as ba, type ContactChannel as c, type DocReason as d, type EidAuthInput as e, type EidReason as f, type EmailOtpReason as g, type HostedAcceptedDocuments as h, type HostedBranding as i, type HostedBrandingColorKey as j, type HostedCaptureTuning as k, type HostedDocumentCaptureTuning as l, type HostedDocumentScanTuning as m, type HostedEidView as n, type HostedEmailOtpView as o, type HostedIcaoPolicy as p, type HostedIntegrity as q, type HostedLivePhotoTuning as r, type HostedNativeCaptureTuning as s, type HostedOcrTuning as t, type HostedOtpView as u, type HostedPortraitView as v, type HostedSessionView as w, type HostedStepView as x, type HostedVoiceLocale as y, type HostedVoiceView as z };
1720
+ export { type OtpChoiceView as $, type AcceptedDocumentType as A, type HostedStepView as B, type CheckReason as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedVoiceLocale as G, type HeadPose as H, type HostedVoiceView as I, type IcaoCaptureTuning as J, type IcaoCoachKey as K, type IcaoCriterion as L, type IcaoCriterionState as M, type IcaoGateCriterion as N, type IcaoGateSummary as O, type IcaoGateUpdate as P, type IcaoReportEntry as Q, type IdentityConfirmDecision as R, type IdentityMethod as S, type IdentitySummarySource as T, type IdentitySummaryView as U, type LivenessReason as V, type MatchReason as W, type MethodChoiceView as X, type NationalEidOption as Y, type NfcChipReason as Z, type NfcStepView as _, type CheckState as a, type DocDeviceRead as a$, type PhoneOtpReason as a0, type PlanAttempts as a1, type PlanChoiceKind as a2, type PlanChoiceOption as a3, type PlanChoiceView as a4, type PlanSectionView as a5, type PlanStepView as a6, type PolicyFailureReason as a7, type PopulationReason as a8, type PortraitIcaoInput as a9, createIcaoGate as aA, eyeLineRoll as aB, eyeOpenness as aC, eyeSpecular as aD, faceGeometry as aE, faceLighting as aF, faceSharpness as aG, icaoPixelStats as aH, icaoWindow as aI, judgeIcao as aJ, lumaPlane as aK, percentile as aL, portraitCropRegion as aM, poseFromMatrix as aN, regionStats as aO, resolveIcaoTuning as aP, scoreFrame as aQ, windowOverflow as aR, type PersonMask as aS, HostedClient as aT, type AttestationInput as aU, type CaptureContext as aV, type CaptureNoncesResult as aW, type CaptureProof as aX, type CheckInputByType as aY, type CompleteMediaResult as aZ, type ConsentLocale as a_, type PortraitIcaoReason as aa, type SessionFailureReason as ab, type SessionOutcome as ac, type SessionStatus as ad, type StepSection as ae, type BackgroundStats as af, type Box as ag, CLIPPED_LUMA as ah, type FaceGeometry as ai, type FaceLighting as aj, ICAO_CANVAS as ak, ICAO_FALLBACK as al, ICAO_GATE_CRITERIA as am, ICAO_SHARP_REF as an, type IcaoFrameObservation as ao, type IcaoGate as ap, type IcaoGateOptions as aq, type IcaoJudgedCriterion as ar, type IcaoMeasures as as, type IcaoPixelStats as at, type IcaoProfile as au, type LumaPlane as av, type Point as aw, type RegionStats as ax, type ResolvedIcaoTuning as ay, backgroundStats as az, type CheckType as b, type DocOcrInput as b0, type DocSide as b1, type EmailOtpInput as b2, type FaceMatchInput as b3, type HostedClientOptions as b4, type LivenessCaptureInput as b5, type LivenessInput as b6, type MediaCheckType as b7, type MediaKind as b8, type PhoneOtpInput as b9, type PopulationInput as ba, type PresignRequest as bb, type PresignUploadResult as bc, type RecordConsentResult as bd, type SessionStepView as be, type SessionView as bf, type SubmitCheckBody as bg, type SubmitOptions as bh, type UploadMedia as bi, stripMimeParams as bj, type ContactChannel as c, type DocReason as d, type EidAuthInput as e, type EidReason as f, type EmailOtpReason as g, type HostedAcceptedDocuments as h, type HostedBranding as i, type HostedBrandingColorKey as j, type HostedCaptureTuning as k, type HostedConsentView as l, type HostedDocumentCaptureTuning as m, type HostedDocumentScanTuning as n, type HostedEidView as o, type HostedEmailOtpView as p, type HostedFlowRef as q, type HostedIcaoPolicy as r, type HostedIntegrity as s, type HostedLivePhotoTuning as t, type HostedNativeCaptureTuning as u, type HostedOcrTuning as v, type HostedOtpView as w, type HostedPlanView as x, type HostedPortraitView as y, type HostedSessionView as z };