@sekyro/web 0.1.0-rc.3 → 0.1.0-rc.5
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 +30 -0
- package/README.md +44 -0
- package/dist/{capture-session-v3-CvIfcwST.d.ts → capture-session-v3-Okq0EQHG.d.ts} +38 -2
- package/dist/{capture-session-v3-COIO_F2w.d.cts → capture-session-v3-UQU_WjO2.d.cts} +38 -2
- package/dist/{chunk-FIXX2AXC.js → chunk-SGDXLAXR.js} +309 -10
- package/dist/chunk-SGDXLAXR.js.map +1 -0
- package/dist/{chunk-7TC6TOZ4.js → chunk-TG5IE552.js} +37 -4
- package/dist/chunk-TG5IE552.js.map +1 -0
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/core/index.cjs +36 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/{create-verification-CswF2As-.d.ts → create-verification-CA-3szPI.d.cts} +108 -8
- package/dist/{create-verification-CP18eq1Q.d.cts → create-verification-c98uAxbl.d.ts} +108 -8
- package/dist/{hosted-client-BpvBqu9f.d.cts → hosted-client-DWzCRYJK.d.cts} +14 -1
- package/dist/{hosted-client-BpvBqu9f.d.ts → hosted-client-DWzCRYJK.d.ts} +14 -1
- package/dist/index.cjs +384 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +61 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/index.cjs +261 -11
- package/dist/internal/index.cjs.map +1 -1
- package/dist/internal/index.d.cts +4 -4
- package/dist/internal/index.d.ts +4 -4
- package/dist/internal/index.js +12 -2
- package/dist/internal/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7TC6TOZ4.js.map +0 -1
- package/dist/chunk-FIXX2AXC.js.map +0 -1
package/dist/core/index.cjs
CHANGED
|
@@ -777,7 +777,8 @@ var FaceGateV3 = class {
|
|
|
777
777
|
p: this.p,
|
|
778
778
|
factors,
|
|
779
779
|
guidanceKey: this.guidanceOf(factors, quality, q),
|
|
780
|
-
ready
|
|
780
|
+
ready,
|
|
781
|
+
accepted: q >= this.t.Q_GOOD
|
|
781
782
|
};
|
|
782
783
|
}
|
|
783
784
|
geometryOf(observation, input) {
|
|
@@ -1170,6 +1171,11 @@ var CaptureSessionV3 = class {
|
|
|
1170
1171
|
this.profiler = null;
|
|
1171
1172
|
this.lastGuidanceKey = null;
|
|
1172
1173
|
this.positioningStartedAt = 0;
|
|
1174
|
+
// Face-capture timing marks of the CURRENT attempt (engine clock; reset per run).
|
|
1175
|
+
this.cameraRequestedAt = null;
|
|
1176
|
+
this.cameraReadyAt = null;
|
|
1177
|
+
this.faceAcquiredAt = null;
|
|
1178
|
+
this.captureCompleteAt = null;
|
|
1173
1179
|
this.fired = false;
|
|
1174
1180
|
this.carriedDegrade = 0;
|
|
1175
1181
|
this.carriedMeans = [];
|
|
@@ -1196,10 +1202,15 @@ var CaptureSessionV3 = class {
|
|
|
1196
1202
|
handler(payload);
|
|
1197
1203
|
}
|
|
1198
1204
|
}
|
|
1199
|
-
async start() {
|
|
1205
|
+
async start(options = {}) {
|
|
1206
|
+
if (options.facingMode !== void 0) this.facing = options.facingMode;
|
|
1200
1207
|
this.attempt += 1;
|
|
1201
1208
|
await this.run(this.attempt);
|
|
1202
1209
|
}
|
|
1210
|
+
/** The camera the current/next attempt requests (start option, switchCamera toggles). */
|
|
1211
|
+
get facingMode() {
|
|
1212
|
+
return this.facing;
|
|
1213
|
+
}
|
|
1203
1214
|
/** Full reset + camera restart — the documented recovery path (v1 parity). */
|
|
1204
1215
|
retry() {
|
|
1205
1216
|
this.teardownAttempt();
|
|
@@ -1224,6 +1235,10 @@ var CaptureSessionV3 = class {
|
|
|
1224
1235
|
this.lastGuidanceKey = null;
|
|
1225
1236
|
this.carriedDegrade = 0;
|
|
1226
1237
|
this.carriedMeans = [];
|
|
1238
|
+
this.cameraRequestedAt = null;
|
|
1239
|
+
this.cameraReadyAt = null;
|
|
1240
|
+
this.faceAcquiredAt = null;
|
|
1241
|
+
this.captureCompleteAt = null;
|
|
1227
1242
|
this.setState("preflight");
|
|
1228
1243
|
const preflight = cameraPreflight();
|
|
1229
1244
|
if (preflight !== "OK") {
|
|
@@ -1233,6 +1248,7 @@ var CaptureSessionV3 = class {
|
|
|
1233
1248
|
this.setState("acquiring");
|
|
1234
1249
|
const getUserMedia = options.getUserMedia ?? ((constraints) => navigator.mediaDevices.getUserMedia(constraints));
|
|
1235
1250
|
let stream;
|
|
1251
|
+
this.cameraRequestedAt = this.now();
|
|
1236
1252
|
try {
|
|
1237
1253
|
stream = await getUserMedia(buildCaptureConstraints(detectIsMobile(), this.facing));
|
|
1238
1254
|
} catch (err) {
|
|
@@ -1248,6 +1264,7 @@ var CaptureSessionV3 = class {
|
|
|
1248
1264
|
options.video.srcObject = stream;
|
|
1249
1265
|
await options.video.play().catch(() => void 0);
|
|
1250
1266
|
if (attempt !== this.attempt) return;
|
|
1267
|
+
this.cameraReadyAt = this.now();
|
|
1251
1268
|
if (this.detector === null) {
|
|
1252
1269
|
const ladderOptions = {
|
|
1253
1270
|
...options.v3AssetBaseUrl !== void 0 ? { v3AssetBaseUrl: options.v3AssetBaseUrl } : {}
|
|
@@ -1347,6 +1364,7 @@ var CaptureSessionV3 = class {
|
|
|
1347
1364
|
frameWidth: video.videoWidth,
|
|
1348
1365
|
frameHeight: video.videoHeight
|
|
1349
1366
|
});
|
|
1367
|
+
if (tick.accepted && this.faceAcquiredAt === null) this.faceAcquiredAt = tick.at;
|
|
1350
1368
|
this.emit("checks", {
|
|
1351
1369
|
engine: "v3",
|
|
1352
1370
|
progress: tick.p,
|
|
@@ -1360,6 +1378,7 @@ var CaptureSessionV3 = class {
|
|
|
1360
1378
|
}
|
|
1361
1379
|
if (tick.ready && this.stateValue === "positioning") {
|
|
1362
1380
|
this.fired = true;
|
|
1381
|
+
this.captureCompleteAt = tick.at;
|
|
1363
1382
|
void this.fire(attempt);
|
|
1364
1383
|
}
|
|
1365
1384
|
}
|
|
@@ -1454,7 +1473,21 @@ var CaptureSessionV3 = class {
|
|
|
1454
1473
|
finishCapture(artifacts) {
|
|
1455
1474
|
this.stopTracks();
|
|
1456
1475
|
this.setState("captured");
|
|
1457
|
-
this.
|
|
1476
|
+
const timing = this.captureTiming();
|
|
1477
|
+
this.emit("artifacts", timing === void 0 ? artifacts : { ...artifacts, timing });
|
|
1478
|
+
}
|
|
1479
|
+
/** The attempt's capture-phase timing (whole ms, ≥ 0); undefined when no mark landed. */
|
|
1480
|
+
captureTiming() {
|
|
1481
|
+
const span = (from, to) => from !== null && to !== null ? Math.max(0, Math.round(to - from)) : void 0;
|
|
1482
|
+
const cameraReadyMs = span(this.cameraRequestedAt, this.cameraReadyAt);
|
|
1483
|
+
const faceAcquireMs = span(this.cameraReadyAt, this.faceAcquiredAt);
|
|
1484
|
+
const captureMs = span(this.faceAcquiredAt, this.captureCompleteAt);
|
|
1485
|
+
const timing = {
|
|
1486
|
+
...cameraReadyMs !== void 0 ? { cameraReadyMs } : {},
|
|
1487
|
+
...faceAcquireMs !== void 0 ? { faceAcquireMs } : {},
|
|
1488
|
+
...captureMs !== void 0 ? { captureMs } : {}
|
|
1489
|
+
};
|
|
1490
|
+
return Object.keys(timing).length > 0 ? timing : void 0;
|
|
1458
1491
|
}
|
|
1459
1492
|
// ── defaults for the canvas-bound seams ────────────────────────────────────
|
|
1460
1493
|
async defaultKeyframe(video) {
|