@neofaceid/web-sdk 1.36.2 → 1.37.0
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 +29 -2
- package/dist/neoface-id-sdk.es.js +27 -4
- package/dist/neoface-id-sdk.umd.js +1 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -421,6 +421,24 @@ export declare function confirmPasswordReset(token: string, new_password: string
|
|
|
421
421
|
message: string;
|
|
422
422
|
}>;
|
|
423
423
|
|
|
424
|
+
/**
|
|
425
|
+
* Dados de consentimento LGPD informados pelo integrador.
|
|
426
|
+
* Usados pelo SDK para registrar a base legal da coleta biométrica.
|
|
427
|
+
*/
|
|
428
|
+
export declare interface Consent {
|
|
429
|
+
/** Finalidade da coleta (ex: 'authentication', 'onboarding'). */
|
|
430
|
+
purpose: string;
|
|
431
|
+
/**
|
|
432
|
+
* Base legal. Legítimo interesse não é permitido para dado sensível (LGPD art. 11).
|
|
433
|
+
* Valores: 'consent' | 'legal_obligation' | 'fraud_prevention'.
|
|
434
|
+
*/
|
|
435
|
+
legalBasis: 'consent' | 'legal_obligation' | 'fraud_prevention';
|
|
436
|
+
/** URL da política de privacidade apresentada ao titular. */
|
|
437
|
+
privacyPolicyUrl: string;
|
|
438
|
+
/** Prazo de retenção em dias (0 = indefinido/não informado). */
|
|
439
|
+
retentionDays: number;
|
|
440
|
+
}
|
|
441
|
+
|
|
424
442
|
declare type ConsentFlow = 'verification' | 'registration';
|
|
425
443
|
|
|
426
444
|
export declare interface ConsentInfo {
|
|
@@ -684,6 +702,9 @@ export declare function getCachedCaptureSession(): CaptureSession | null;
|
|
|
684
702
|
*/
|
|
685
703
|
export declare function getConfig(): Readonly<SDKConfig>;
|
|
686
704
|
|
|
705
|
+
/** Retorna os dados de consentimento configurados (ou os defaults conservadores). */
|
|
706
|
+
export declare function getConsent(): Consent;
|
|
707
|
+
|
|
687
708
|
/**
|
|
688
709
|
* Retorna o ambiente atual configurado.
|
|
689
710
|
*/
|
|
@@ -1334,7 +1355,7 @@ export declare const registerPersonWithoutFace: (personData: {
|
|
|
1334
1355
|
/**
|
|
1335
1356
|
* Data de lançamento da versão atual
|
|
1336
1357
|
*/
|
|
1337
|
-
export declare const RELEASE_DATE = "2026-09-
|
|
1358
|
+
export declare const RELEASE_DATE = "2026-09-05";
|
|
1338
1359
|
|
|
1339
1360
|
declare interface RequestChallengeWithSessionParams {
|
|
1340
1361
|
applicationToken: string;
|
|
@@ -1446,6 +1467,7 @@ declare interface SDKConfig {
|
|
|
1446
1467
|
theme: SDKTheme;
|
|
1447
1468
|
locale: string;
|
|
1448
1469
|
resolvedTheme: ResolvedTheme | null;
|
|
1470
|
+
consent: Consent;
|
|
1449
1471
|
}
|
|
1450
1472
|
|
|
1451
1473
|
/**
|
|
@@ -1497,6 +1519,11 @@ export declare interface SDKInitOptions {
|
|
|
1497
1519
|
* Locale da UI. Padrão `pt-BR`.
|
|
1498
1520
|
*/
|
|
1499
1521
|
locale?: string;
|
|
1522
|
+
/**
|
|
1523
|
+
* Dados de consentimento LGPD. Se omitido, o SDK usa defaults conservadores
|
|
1524
|
+
* e emite `console.warn` uma única vez.
|
|
1525
|
+
*/
|
|
1526
|
+
consent?: Consent;
|
|
1500
1527
|
}
|
|
1501
1528
|
|
|
1502
1529
|
export declare type SDKRadius = 8 | 16 | 24;
|
|
@@ -1695,7 +1722,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
|
|
|
1695
1722
|
* MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
|
|
1696
1723
|
* PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
|
|
1697
1724
|
*/
|
|
1698
|
-
export declare const VERSION = "1.
|
|
1725
|
+
export declare const VERSION = "1.37.0";
|
|
1699
1726
|
|
|
1700
1727
|
/**
|
|
1701
1728
|
* Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
|
|
@@ -4534,6 +4534,12 @@ function injectScopedStyles(id, css) {
|
|
|
4534
4534
|
document.head.appendChild(style);
|
|
4535
4535
|
}
|
|
4536
4536
|
const __vite_import_meta_env__ = {};
|
|
4537
|
+
const DEFAULT_CONSENT = {
|
|
4538
|
+
purpose: "authentication",
|
|
4539
|
+
legalBasis: "fraud_prevention",
|
|
4540
|
+
privacyPolicyUrl: "",
|
|
4541
|
+
retentionDays: 0
|
|
4542
|
+
};
|
|
4537
4543
|
const ENVIRONMENT_URLS = {
|
|
4538
4544
|
development: "http://localhost:8000",
|
|
4539
4545
|
sandbox: "https://sandbox-core.neofaceid.com",
|
|
@@ -4554,12 +4560,25 @@ function makeDefaultConfig() {
|
|
|
4554
4560
|
radius: DEFAULT_RADIUS,
|
|
4555
4561
|
theme: DEFAULT_THEME,
|
|
4556
4562
|
locale: DEFAULT_LOCALE,
|
|
4557
|
-
resolvedTheme: null
|
|
4563
|
+
resolvedTheme: null,
|
|
4564
|
+
consent: { ...DEFAULT_CONSENT }
|
|
4558
4565
|
};
|
|
4559
4566
|
}
|
|
4560
4567
|
let globalConfig = makeDefaultConfig();
|
|
4568
|
+
let consentWarningShown = false;
|
|
4561
4569
|
function init(options = {}) {
|
|
4562
|
-
const { environment, baseUrl, applicationToken, appName, accent, radius, theme, locale } = options;
|
|
4570
|
+
const { environment, baseUrl, applicationToken, appName, accent, radius, theme, locale, consent } = options;
|
|
4571
|
+
if (consent) {
|
|
4572
|
+
globalConfig.consent = consent;
|
|
4573
|
+
} else {
|
|
4574
|
+
globalConfig.consent = { ...DEFAULT_CONSENT };
|
|
4575
|
+
if (!consentWarningShown) {
|
|
4576
|
+
console.warn(
|
|
4577
|
+
"[NeoFaceID SDK] Consentimento não configurado em init(). Usando valores padrão (fraud_prevention). Configure consent: { purpose, legalBasis, privacyPolicyUrl, retentionDays }."
|
|
4578
|
+
);
|
|
4579
|
+
consentWarningShown = true;
|
|
4580
|
+
}
|
|
4581
|
+
}
|
|
4563
4582
|
if (baseUrl) {
|
|
4564
4583
|
globalConfig.baseUrl = baseUrl;
|
|
4565
4584
|
globalConfig.environment = "custom";
|
|
@@ -4659,6 +4678,9 @@ function getResolvedThemeMode() {
|
|
|
4659
4678
|
function getLocale() {
|
|
4660
4679
|
return globalConfig.locale;
|
|
4661
4680
|
}
|
|
4681
|
+
function getConsent() {
|
|
4682
|
+
return { ...globalConfig.consent };
|
|
4683
|
+
}
|
|
4662
4684
|
const getApiBaseUrl = () => getBaseUrl();
|
|
4663
4685
|
const REQUEST_TIMEOUT = 1e4;
|
|
4664
4686
|
const ensureSecureContext = () => {
|
|
@@ -11177,8 +11199,8 @@ const biometricDetection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
|
|
|
11177
11199
|
initializeBiometricDetection,
|
|
11178
11200
|
isAdvancedDetectionAvailable
|
|
11179
11201
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11180
|
-
const VERSION = "1.
|
|
11181
|
-
const RELEASE_DATE = "2026-09-
|
|
11202
|
+
const VERSION = "1.37.0";
|
|
11203
|
+
const RELEASE_DATE = "2026-09-05";
|
|
11182
11204
|
let cachedSession = null;
|
|
11183
11205
|
function getCachedCaptureSession() {
|
|
11184
11206
|
return cachedSession;
|
|
@@ -14291,6 +14313,7 @@ export {
|
|
|
14291
14313
|
getBaseUrl,
|
|
14292
14314
|
getCachedCaptureSession,
|
|
14293
14315
|
getConfig,
|
|
14316
|
+
getConsent,
|
|
14294
14317
|
getEnvironment,
|
|
14295
14318
|
getLocale,
|
|
14296
14319
|
getRadius,
|