@neofaceid/web-sdk 2.0.0 → 2.0.1
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/dist/index.d.ts +2 -2
- package/dist/neoface-id-sdk.es.js +23 -5
- package/dist/neoface-id-sdk.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1391,7 +1391,7 @@ export declare const registerPersonWithoutFace: (personData: {
|
|
|
1391
1391
|
/**
|
|
1392
1392
|
* Data de lançamento da versão atual
|
|
1393
1393
|
*/
|
|
1394
|
-
export declare const RELEASE_DATE = "2026-09-
|
|
1394
|
+
export declare const RELEASE_DATE = "2026-09-20";
|
|
1395
1395
|
|
|
1396
1396
|
declare interface RequestChallengeWithSessionParams {
|
|
1397
1397
|
applicationToken: string;
|
|
@@ -1864,7 +1864,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
|
|
|
1864
1864
|
* MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
|
|
1865
1865
|
* PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
|
|
1866
1866
|
*/
|
|
1867
|
-
export declare const VERSION = "2.0.
|
|
1867
|
+
export declare const VERSION = "2.0.1";
|
|
1868
1868
|
|
|
1869
1869
|
/**
|
|
1870
1870
|
* Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
|
|
@@ -6095,9 +6095,22 @@ const recordFaceVideo = async (options = {}) => {
|
|
|
6095
6095
|
const pollTaskStatus = async (taskId, applicationToken, options = {}) => {
|
|
6096
6096
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
6097
6097
|
const { maxAttempts = 60, intervalMs = 1e3, onStatusChange } = options;
|
|
6098
|
-
const wait = () => new Promise((resolve) => {
|
|
6099
|
-
setTimeout(resolve,
|
|
6100
|
-
});
|
|
6098
|
+
const wait = (ms = intervalMs) => new Promise((resolve) => {
|
|
6099
|
+
setTimeout(resolve, ms);
|
|
6100
|
+
});
|
|
6101
|
+
const retryAfterMs = (response) => {
|
|
6102
|
+
var _a3, _b2;
|
|
6103
|
+
const raw = (_b2 = (_a3 = response.headers) == null ? void 0 : _a3.get) == null ? void 0 : _b2.call(_a3, "Retry-After");
|
|
6104
|
+
if (!raw) return intervalMs;
|
|
6105
|
+
const seconds = Number(raw);
|
|
6106
|
+
if (Number.isFinite(seconds) && seconds > 0) return seconds * 1e3;
|
|
6107
|
+
const date2 = Date.parse(raw);
|
|
6108
|
+
if (Number.isFinite(date2)) {
|
|
6109
|
+
const delta = date2 - Date.now();
|
|
6110
|
+
if (delta > 0) return delta;
|
|
6111
|
+
}
|
|
6112
|
+
return intervalMs;
|
|
6113
|
+
};
|
|
6101
6114
|
let attempts = 0;
|
|
6102
6115
|
let lastTransient = "";
|
|
6103
6116
|
while (attempts < maxAttempts) {
|
|
@@ -6121,6 +6134,11 @@ const pollTaskStatus = async (taskId, applicationToken, options = {}) => {
|
|
|
6121
6134
|
await wait();
|
|
6122
6135
|
continue;
|
|
6123
6136
|
}
|
|
6137
|
+
if (response.status === 429) {
|
|
6138
|
+
lastTransient = "HTTP 429";
|
|
6139
|
+
await wait(retryAfterMs(response));
|
|
6140
|
+
continue;
|
|
6141
|
+
}
|
|
6124
6142
|
if (response.status === 401 || response.status === 403) {
|
|
6125
6143
|
throw new NeoFaceError("Invalid application token", ErrorType.INVALID_TOKEN);
|
|
6126
6144
|
}
|
|
@@ -8898,8 +8916,8 @@ function BiometricRegistrationModal({
|
|
|
8898
8916
|
/* @__PURE__ */ jsx("canvas", { ref: canvasRef })
|
|
8899
8917
|
] });
|
|
8900
8918
|
}
|
|
8901
|
-
const VERSION = "2.0.
|
|
8902
|
-
const RELEASE_DATE = "2026-09-
|
|
8919
|
+
const VERSION = "2.0.1";
|
|
8920
|
+
const RELEASE_DATE = "2026-09-20";
|
|
8903
8921
|
const CONSENT_TRAIL_STORAGE_KEY = "neoface_consent_trail_v1";
|
|
8904
8922
|
const CONSENT_TRAIL_MAX_LIMIT = 100;
|
|
8905
8923
|
async function hashString(inputStr) {
|