valtech-components 2.0.849 → 2.0.851
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/esm2022/lib/components/organisms/mfa-modal/mfa-modal.component.mjs +19 -5
- package/esm2022/lib/services/feedback/config.mjs +7 -7
- package/esm2022/lib/services/feedback/feedback.service.mjs +89 -2
- package/esm2022/lib/services/i18n/default-content.mjs +3 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +112 -10
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mfa-modal/mfa-modal.component.d.ts +4 -0
- package/lib/services/feedback/feedback.service.d.ts +23 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -69,6 +69,8 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
69
69
|
readonly totpQr: import("@angular/core").WritableSignal<QrResult>;
|
|
70
70
|
/** Códigos de respaldo recién regenerados — se muestran una sola vez. */
|
|
71
71
|
readonly regeneratedCodes: import("@angular/core").WritableSignal<string[]>;
|
|
72
|
+
/** Marca momentánea cuando el secreto TOTP se acaba de copiar (feedback visual). */
|
|
73
|
+
readonly copiedSecret: import("@angular/core").WritableSignal<boolean>;
|
|
72
74
|
readonly resendCooldown: import("@angular/core").WritableSignal<number>;
|
|
73
75
|
readonly pinControl: FormControl<string>;
|
|
74
76
|
readonly phoneControl: FormControl<string>;
|
|
@@ -115,6 +117,8 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
115
117
|
onDisableSubmit(event: FormSubmit): void;
|
|
116
118
|
/** Copia una lista de códigos de respaldo al portapapeles. */
|
|
117
119
|
copyCodes(codes: string[]): Promise<void>;
|
|
120
|
+
/** Copia el secreto TOTP al portapapeles + feedback visual (check) durante 2s. */
|
|
121
|
+
copySecret(secret: string): Promise<void>;
|
|
118
122
|
/** Etiqueta i18n legible para un método MFA. */
|
|
119
123
|
methodLabel(method: MFAMethod | null): string;
|
|
120
124
|
private resetFlow;
|
|
@@ -25,6 +25,7 @@ export declare class FeedbackService {
|
|
|
25
25
|
private config;
|
|
26
26
|
private http;
|
|
27
27
|
private firestore;
|
|
28
|
+
private storage;
|
|
28
29
|
private auth;
|
|
29
30
|
/**
|
|
30
31
|
* URL base para endpoints de feedback.
|
|
@@ -67,6 +68,28 @@ export declare class FeedbackService {
|
|
|
67
68
|
valid: boolean;
|
|
68
69
|
error?: string;
|
|
69
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Valida el CONTENIDO del archivo por magic-bytes (firma binaria) —
|
|
73
|
+
* defensa contra spoofing del content-type declarado. Lee los primeros 12
|
|
74
|
+
* bytes y los compara con las firmas de JPEG/PNG/WebP/PDF (whitelist
|
|
75
|
+
* estricta). Es client-side, ergo bypasseable; la defensa real vive en las
|
|
76
|
+
* Storage rules. Esto corta el 99% de los casos accidentales o no-targeted.
|
|
77
|
+
*/
|
|
78
|
+
validateFileContent(file: File): Promise<{
|
|
79
|
+
valid: boolean;
|
|
80
|
+
error?: string;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Sube un adjunto a Firebase Storage en `users/{uid}/feedback/{uuid}/{name}`
|
|
84
|
+
* y devuelve su download URL. Ejecuta tres validaciones en orden:
|
|
85
|
+
* 1. tamaño + tipo declarado (`validateFile`)
|
|
86
|
+
* 2. contenido por magic-bytes (`validateFileContent`)
|
|
87
|
+
* 3. usuario autenticado (no soportamos adjuntos en feedback anónimo)
|
|
88
|
+
*
|
|
89
|
+
* Si cualquier validación falla → rechaza la promesa con un Error legible;
|
|
90
|
+
* el componente que la consuma debe cancelar la operación de adjuntar.
|
|
91
|
+
*/
|
|
92
|
+
uploadAttachment(file: File): Promise<string>;
|
|
70
93
|
/**
|
|
71
94
|
* Obtiene la configuración actual del servicio.
|
|
72
95
|
*/
|
package/lib/version.d.ts
CHANGED