@sekyro/web 0.1.0-rc.3 → 0.1.0-rc.4

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 (32) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{capture-session-v3-COIO_F2w.d.cts → capture-session-v3-DEInCOUg.d.cts} +30 -1
  3. package/dist/{capture-session-v3-CvIfcwST.d.ts → capture-session-v3-uXJr1Wlm.d.ts} +30 -1
  4. package/dist/{chunk-7TC6TOZ4.js → chunk-EWRNPKTR.js} +31 -3
  5. package/dist/chunk-EWRNPKTR.js.map +1 -0
  6. package/dist/{chunk-FIXX2AXC.js → chunk-TBANUT3X.js} +25 -4
  7. package/dist/chunk-TBANUT3X.js.map +1 -0
  8. package/dist/client/index.cjs.map +1 -1
  9. package/dist/client/index.d.cts +1 -1
  10. package/dist/client/index.d.ts +1 -1
  11. package/dist/core/index.cjs +30 -2
  12. package/dist/core/index.cjs.map +1 -1
  13. package/dist/core/index.d.cts +2 -2
  14. package/dist/core/index.d.ts +2 -2
  15. package/dist/core/index.js +1 -1
  16. package/dist/{create-verification-CP18eq1Q.d.cts → create-verification-Ce1y5kJR.d.ts} +26 -3
  17. package/dist/{create-verification-CswF2As-.d.ts → create-verification-Dkb2tXuY.d.cts} +26 -3
  18. package/dist/{hosted-client-BpvBqu9f.d.cts → hosted-client-DWzCRYJK.d.cts} +14 -1
  19. package/dist/{hosted-client-BpvBqu9f.d.ts → hosted-client-DWzCRYJK.d.ts} +14 -1
  20. package/dist/index.cjs +53 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +3 -3
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +2 -2
  25. package/dist/internal/index.cjs +53 -4
  26. package/dist/internal/index.cjs.map +1 -1
  27. package/dist/internal/index.d.cts +4 -4
  28. package/dist/internal/index.d.ts +4 -4
  29. package/dist/internal/index.js +2 -2
  30. package/package.json +1 -1
  31. package/dist/chunk-7TC6TOZ4.js.map +0 -1
  32. package/dist/chunk-FIXX2AXC.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as CaptureChannel, a as CaptureError, b as CaptureErrorKind, c as CaptureState, d as CapturedArtifacts, D as DEFAULT_API_ORIGIN, G as GateHint, e as GateUpdate, L as LivenessCaptureEvents, f as LivenessCaptureHandle, g as LivenessCaptureOptions, R as ReasonCode, S as SdkFailureReason, V as Verification, h as VerificationEvents, i as VerificationLocale, j as VerificationOptions, k as VerificationResult, l as VerificationStatus, m as createLivenessCapture, n as createVerification } from './create-verification-CP18eq1Q.cjs';
1
+ export { C as CaptureChannel, a as CaptureEngineId, b as CaptureError, c as CaptureErrorKind, d as CaptureState, e as CapturedArtifacts, D as DEFAULT_API_ORIGIN, G as GateHint, f as GateUpdate, L as LivenessCaptureEvents, g as LivenessCaptureHandle, h as LivenessCaptureOptions, R as ReasonCode, S as SdkFailureReason, V as Verification, i as VerificationEvents, j as VerificationLocale, k as VerificationOptions, l as VerificationResult, m as VerificationStatus, n as createLivenessCapture, o as createVerification } from './create-verification-Dkb2tXuY.cjs';
2
2
  export { OpenHostedOptions, PopupBlocked, PopupHandle, SEKYRO_EVENTS, SekyroEvent, SekyroEventName, openHosted } from './popup/index.cjs';
3
3
  export { HostedApiError, KNOWN_CODES, KnownCode, isKnownCode } from './client/index.cjs';
4
- export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView, c as HostedSessionView, d as HostedStepView, L as LivenessReason, P as PhoneOtpReason, e as PopulationReason, S as SessionOutcome, f as SessionStatus } from './hosted-client-BpvBqu9f.cjs';
5
- import './capture-session-v3-COIO_F2w.cjs';
4
+ export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView, c as HostedSessionView, d as HostedStepView, L as LivenessReason, P as PhoneOtpReason, e as PopulationReason, S as SessionOutcome, f as SessionStatus } from './hosted-client-DWzCRYJK.cjs';
5
+ import './capture-session-v3-DEInCOUg.cjs';
6
6
  import './detect-worker-CKXHlXx9.cjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as CaptureChannel, a as CaptureError, b as CaptureErrorKind, c as CaptureState, d as CapturedArtifacts, D as DEFAULT_API_ORIGIN, G as GateHint, e as GateUpdate, L as LivenessCaptureEvents, f as LivenessCaptureHandle, g as LivenessCaptureOptions, R as ReasonCode, S as SdkFailureReason, V as Verification, h as VerificationEvents, i as VerificationLocale, j as VerificationOptions, k as VerificationResult, l as VerificationStatus, m as createLivenessCapture, n as createVerification } from './create-verification-CswF2As-.js';
1
+ export { C as CaptureChannel, a as CaptureEngineId, b as CaptureError, c as CaptureErrorKind, d as CaptureState, e as CapturedArtifacts, D as DEFAULT_API_ORIGIN, G as GateHint, f as GateUpdate, L as LivenessCaptureEvents, g as LivenessCaptureHandle, h as LivenessCaptureOptions, R as ReasonCode, S as SdkFailureReason, V as Verification, i as VerificationEvents, j as VerificationLocale, k as VerificationOptions, l as VerificationResult, m as VerificationStatus, n as createLivenessCapture, o as createVerification } from './create-verification-Ce1y5kJR.js';
2
2
  export { OpenHostedOptions, PopupBlocked, PopupHandle, SEKYRO_EVENTS, SekyroEvent, SekyroEventName, openHosted } from './popup/index.js';
3
3
  export { HostedApiError, KNOWN_CODES, KnownCode, isKnownCode } from './client/index.js';
4
- export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView, c as HostedSessionView, d as HostedStepView, L as LivenessReason, P as PhoneOtpReason, e as PopulationReason, S as SessionOutcome, f as SessionStatus } from './hosted-client-BpvBqu9f.js';
5
- import './capture-session-v3-CvIfcwST.js';
4
+ export { C as CheckReason, a as CheckState, b as CheckType, D as DocReason, F as FaceMatchReason, H as HostedOtpView, c as HostedSessionView, d as HostedStepView, L as LivenessReason, P as PhoneOtpReason, e as PopulationReason, S as SessionOutcome, f as SessionStatus } from './hosted-client-DWzCRYJK.js';
5
+ import './capture-session-v3-uXJr1Wlm.js';
6
6
  import './detect-worker-CKXHlXx9.js';
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import {
6
6
  DEFAULT_API_ORIGIN,
7
7
  createLivenessCapture,
8
8
  createVerification
9
- } from "./chunk-FIXX2AXC.js";
10
- import "./chunk-7TC6TOZ4.js";
9
+ } from "./chunk-TBANUT3X.js";
10
+ import "./chunk-EWRNPKTR.js";
11
11
  import {
12
12
  HostedApiError,
13
13
  KNOWN_CODES,
@@ -2556,7 +2556,8 @@ var FaceGateV3 = class {
2556
2556
  p: this.p,
2557
2557
  factors,
2558
2558
  guidanceKey: this.guidanceOf(factors, quality, q),
2559
- ready
2559
+ ready,
2560
+ accepted: q >= this.t.Q_GOOD
2560
2561
  };
2561
2562
  }
2562
2563
  geometryOf(observation, input) {
@@ -2675,6 +2676,11 @@ var CaptureSessionV3 = class {
2675
2676
  this.profiler = null;
2676
2677
  this.lastGuidanceKey = null;
2677
2678
  this.positioningStartedAt = 0;
2679
+ // Face-capture timing marks of the CURRENT attempt (engine clock; reset per run).
2680
+ this.cameraRequestedAt = null;
2681
+ this.cameraReadyAt = null;
2682
+ this.faceAcquiredAt = null;
2683
+ this.captureCompleteAt = null;
2678
2684
  this.fired = false;
2679
2685
  this.carriedDegrade = 0;
2680
2686
  this.carriedMeans = [];
@@ -2729,6 +2735,10 @@ var CaptureSessionV3 = class {
2729
2735
  this.lastGuidanceKey = null;
2730
2736
  this.carriedDegrade = 0;
2731
2737
  this.carriedMeans = [];
2738
+ this.cameraRequestedAt = null;
2739
+ this.cameraReadyAt = null;
2740
+ this.faceAcquiredAt = null;
2741
+ this.captureCompleteAt = null;
2732
2742
  this.setState("preflight");
2733
2743
  const preflight = cameraPreflight();
2734
2744
  if (preflight !== "OK") {
@@ -2738,6 +2748,7 @@ var CaptureSessionV3 = class {
2738
2748
  this.setState("acquiring");
2739
2749
  const getUserMedia = options.getUserMedia ?? ((constraints) => navigator.mediaDevices.getUserMedia(constraints));
2740
2750
  let stream;
2751
+ this.cameraRequestedAt = this.now();
2741
2752
  try {
2742
2753
  stream = await getUserMedia(buildCaptureConstraints(detectIsMobile(), this.facing));
2743
2754
  } catch (err) {
@@ -2753,6 +2764,7 @@ var CaptureSessionV3 = class {
2753
2764
  options.video.srcObject = stream;
2754
2765
  await options.video.play().catch(() => void 0);
2755
2766
  if (attempt !== this.attempt) return;
2767
+ this.cameraReadyAt = this.now();
2756
2768
  if (this.detector === null) {
2757
2769
  const ladderOptions = {
2758
2770
  ...options.v3AssetBaseUrl !== void 0 ? { v3AssetBaseUrl: options.v3AssetBaseUrl } : {}
@@ -2852,6 +2864,7 @@ var CaptureSessionV3 = class {
2852
2864
  frameWidth: video.videoWidth,
2853
2865
  frameHeight: video.videoHeight
2854
2866
  });
2867
+ if (tick.accepted && this.faceAcquiredAt === null) this.faceAcquiredAt = tick.at;
2855
2868
  this.emit("checks", {
2856
2869
  engine: "v3",
2857
2870
  progress: tick.p,
@@ -2865,6 +2878,7 @@ var CaptureSessionV3 = class {
2865
2878
  }
2866
2879
  if (tick.ready && this.stateValue === "positioning") {
2867
2880
  this.fired = true;
2881
+ this.captureCompleteAt = tick.at;
2868
2882
  void this.fire(attempt);
2869
2883
  }
2870
2884
  }
@@ -2959,7 +2973,21 @@ var CaptureSessionV3 = class {
2959
2973
  finishCapture(artifacts) {
2960
2974
  this.stopTracks();
2961
2975
  this.setState("captured");
2962
- this.emit("artifacts", artifacts);
2976
+ const timing = this.captureTiming();
2977
+ this.emit("artifacts", timing === void 0 ? artifacts : { ...artifacts, timing });
2978
+ }
2979
+ /** The attempt's capture-phase timing (whole ms, ≥ 0); undefined when no mark landed. */
2980
+ captureTiming() {
2981
+ const span = (from, to) => from !== null && to !== null ? Math.max(0, Math.round(to - from)) : void 0;
2982
+ const cameraReadyMs = span(this.cameraRequestedAt, this.cameraReadyAt);
2983
+ const faceAcquireMs = span(this.cameraReadyAt, this.faceAcquiredAt);
2984
+ const captureMs = span(this.faceAcquiredAt, this.captureCompleteAt);
2985
+ const timing = {
2986
+ ...cameraReadyMs !== void 0 ? { cameraReadyMs } : {},
2987
+ ...faceAcquireMs !== void 0 ? { faceAcquireMs } : {},
2988
+ ...captureMs !== void 0 ? { captureMs } : {}
2989
+ };
2990
+ return Object.keys(timing).length > 0 ? timing : void 0;
2963
2991
  }
2964
2992
  // ── defaults for the canvas-bound seams ────────────────────────────────────
2965
2993
  async defaultKeyframe(video) {
@@ -3234,7 +3262,12 @@ function createLivenessCaptureInternal(options, internals = {}) {
3234
3262
  height: options.video.videoHeight || frameHeight,
3235
3263
  ...clipMs !== void 0 ? { clipMs } : {},
3236
3264
  captureChannel: detectIsMobile() ? "mobile" : "desktop",
3237
- ...degraded ? { degraded: "NO_RECORDER" } : {}
3265
+ ...degraded ? { degraded: "NO_RECORDER" } : {},
3266
+ engine: "v3",
3267
+ // Face-capture timing: the engine's marks, forwarded flat (absent → absent).
3268
+ ...artifacts.timing?.cameraReadyMs !== void 0 ? { cameraReadyMs: artifacts.timing.cameraReadyMs } : {},
3269
+ ...artifacts.timing?.faceAcquireMs !== void 0 ? { faceAcquireMs: artifacts.timing.faceAcquireMs } : {},
3270
+ ...artifacts.timing?.captureMs !== void 0 ? { captureMs: artifacts.timing.captureMs } : {}
3238
3271
  });
3239
3272
  }),
3240
3273
  engine.on("error", ({ kind, retryable }) => {
@@ -3733,7 +3766,12 @@ function buildLivenessSubmit(deps, clip, bareMime) {
3733
3766
  deps.onPhase("checking");
3734
3767
  return client.submitCheck(
3735
3768
  "liveness",
3736
- { clipKey, attestation, captureChannel: deps.artifacts.captureChannel },
3769
+ {
3770
+ clipKey,
3771
+ attestation,
3772
+ captureChannel: deps.artifacts.captureChannel,
3773
+ capture: captureInputOf(deps.artifacts)
3774
+ },
3737
3775
  { idempotencyKey }
3738
3776
  );
3739
3777
  },
@@ -3744,6 +3782,17 @@ function buildLivenessSubmit(deps, clip, bareMime) {
3744
3782
  }
3745
3783
  );
3746
3784
  }
3785
+ function captureInputOf(artifacts) {
3786
+ return {
3787
+ ...artifacts.engine !== void 0 ? { engine: artifacts.engine } : {},
3788
+ width: artifacts.width,
3789
+ height: artifacts.height,
3790
+ ...artifacts.clipMs !== void 0 ? { clipMs: artifacts.clipMs } : {},
3791
+ ...artifacts.cameraReadyMs !== void 0 ? { cameraReadyMs: artifacts.cameraReadyMs } : {},
3792
+ ...artifacts.faceAcquireMs !== void 0 ? { faceAcquireMs: artifacts.faceAcquireMs } : {},
3793
+ ...artifacts.captureMs !== void 0 ? { captureMs: artifacts.captureMs } : {}
3794
+ };
3795
+ }
3747
3796
  function buildFaceMatchSubmit(deps, keyframe) {
3748
3797
  let imageKey = null;
3749
3798
  return () => runSubmission(deps, async (client, idempotencyKey) => {