@neofaceid/web-sdk 1.27.0 → 1.28.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 CHANGED
@@ -33,6 +33,8 @@ export declare interface AuthorizationOptions {
33
33
  onProgress?: (step: number, totalSteps: number, instruction: string) => void;
34
34
  onPhotoTaken?: (photoNumber: number, blob: Blob) => void;
35
35
  captureDelay?: number;
36
+ /** Nome do integrador exibido no topo do modal de consentimento (US14.2). */
37
+ appName?: string;
36
38
  }
37
39
 
38
40
  export declare interface AuthorizationResult {
@@ -141,6 +143,11 @@ export declare function biometricLogin(applicationToken: string, mode?: 'face' |
141
143
 
142
144
  export declare interface BiometricLoginOptions {
143
145
  applicationToken: string;
146
+ /**
147
+ * Nome do integrador exibido no topo do modal de consentimento (US14.2).
148
+ * Ausência gera console.warn e cai para o fallback "sua aplicação".
149
+ */
150
+ appName?: string;
144
151
  onSuccess: (result: BiometricLoginResult) => void;
145
152
  onError: (error: NeoFaceError) => void;
146
153
  onCancel?: () => void;
@@ -350,16 +357,15 @@ export declare function confirmPasswordReset(token: string, new_password: string
350
357
  message: string;
351
358
  }>;
352
359
 
360
+ declare type ConsentFlow = 'verification' | 'registration';
361
+
353
362
  export declare interface ConsentInfo {
354
- purpose: string;
355
- legalBasis: string;
356
- privacyPolicyUrl: string;
357
- retentionDays: number;
363
+ appName?: string;
364
+ flow?: ConsentFlow;
365
+ privacyPolicyUrl?: string;
366
+ retentionDays?: number;
358
367
  }
359
368
 
360
- /**
361
- * Gerencia o ciclo de vida (montagem/desmontagem) do modal de consentimento.
362
- */
363
369
  export declare class ConsentModal {
364
370
  private container;
365
371
  private root;
@@ -367,21 +373,18 @@ export declare class ConsentModal {
367
373
  close(): void;
368
374
  }
369
375
 
370
- /**
371
- * Props do modal de consentimento LGPD exibido antes de qualquer captura de câmera.
372
- */
373
376
  export declare interface ConsentModalProps {
374
- purpose: string;
375
- legalBasis: string;
376
- privacyPolicyUrl: string;
377
- retentionDays: number;
377
+ appName: string;
378
+ flow: ConsentFlow;
379
+ privacyPolicyUrl?: string;
380
+ retentionDays?: number;
378
381
  onAccept: () => void;
379
382
  onDecline: () => void;
380
383
  }
381
384
 
382
385
  /**
383
- * Defaults conservadores usados enquanto `SDKInitOptions` não expõe `consent` (US7.2).
384
- * Quando essa opção existir, este helper passa a ler `getConfig().consent`.
386
+ * Compatibilidade com callers antigos que passavam `{ purpose, legalBasis }`.
387
+ * Deprecated — remover quando US14.4 unificar tokens.
385
388
  */
386
389
  export declare const DEFAULT_CONSENT_INFO: ConsentInfo;
387
390
 
@@ -444,6 +447,9 @@ export declare interface DocumentCaptureOptions {
444
447
  useBackCamera?: boolean;
445
448
  onCancel?: () => void;
446
449
  preSelectedDocument?: DocumentType_2;
450
+ /** Nome do integrador exibido no topo do modal de consentimento (US14.2). */
451
+ appName?: string;
452
+ /* Excluded from this release type: skipConsent */
447
453
  }
448
454
 
449
455
  export declare interface DocumentCaptureResult {
@@ -1232,8 +1238,12 @@ declare interface RequestChallengeWithSessionParams {
1232
1238
  /**
1233
1239
  * Exibe o modal de consentimento e resolve `true` se o titular aceitou,
1234
1240
  * `false` se recusou. Deve ser chamado antes de qualquer `getUserMedia()`.
1241
+ *
1242
+ * `appName` é obrigatório na prática — omitir gera console.warn e fallback.
1243
+ * `flow` decide a copy da terceira linha: 'verification' (padrão) descarta a
1244
+ * imagem; 'registration' informa que o vetor biométrico é armazenado.
1235
1245
  */
1236
- export declare function requestConsent(info?: Partial<ConsentInfo>): Promise<boolean>;
1246
+ export declare function requestConsent(info?: ConsentInfo): Promise<boolean>;
1237
1247
 
1238
1248
  /**
1239
1249
  * Pede ao servidor a sequência de gestos do desafio de liveness.
@@ -1349,7 +1359,9 @@ export declare const simpleIdentification: (documentType: string, documentNumber
1349
1359
  };
1350
1360
  }>;
1351
1361
 
1352
- export declare function start(applicationToken: string, callbacks: Callbacks): void;
1362
+ export declare function start(applicationToken: string, callbacks: Callbacks, options?: {
1363
+ appName?: string;
1364
+ }): void;
1353
1365
 
1354
1366
  /**
1355
1367
  * Inicia o processo de login com detecção automática do tipo biométrico
@@ -1371,6 +1383,7 @@ export declare function startBiometricRegistration(personData: {
1371
1383
  password: string;
1372
1384
  }, applicationToken: string, callbacks: BiometricRegistrationCallbacks, options?: {
1373
1385
  useRealApi?: boolean;
1386
+ appName?: string;
1374
1387
  }): void;
1375
1388
 
1376
1389
  /**
@@ -1400,6 +1413,8 @@ export declare function startLivenessCapture(applicationToken: string, callbacks
1400
1413
  onSuccess(photos: Blob[]): void;
1401
1414
  onError(code: string, message: string): void;
1402
1415
  onCancel?(): void;
1416
+ }, options?: {
1417
+ appName?: string;
1403
1418
  }): void;
1404
1419
 
1405
1420
  /**
@@ -1414,6 +1429,8 @@ export declare interface StartOnboardingOptions {
1414
1429
  countdown?: number;
1415
1430
  title?: string;
1416
1431
  subtitle?: string;
1432
+ /** Nome do integrador exibido no topo do modal de consentimento (US14.2). */
1433
+ appName?: string;
1417
1434
  onSuccess: (result: {
1418
1435
  success: boolean;
1419
1436
  message: string;
@@ -1477,7 +1494,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1477
1494
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1478
1495
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1479
1496
  */
1480
- export declare const VERSION = "1.27.0";
1497
+ export declare const VERSION = "1.28.0";
1481
1498
 
1482
1499
  /**
1483
1500
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),