valtech-components 2.0.835 → 2.0.837
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/molecules/phone-input/phone-input.component.mjs +20 -1
- package/esm2022/lib/components/organisms/mfa-modal/mfa-modal.component.mjs +63 -13
- package/esm2022/lib/services/auth/auth.service.mjs +27 -17
- package/esm2022/lib/services/auth/oauth-callback.component.mjs +19 -1
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +120 -26
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/phone-input/phone-input.component.d.ts +10 -2
- package/lib/components/organisms/mfa-modal/mfa-modal.component.d.ts +18 -3
- package/lib/services/auth/types.d.ts +9 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { DoCheck, EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
3
|
import { PhoneInputMetadata, PhoneInputChangeEvent, CountryCode } from './types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class PhoneInputComponent implements OnInit, OnChanges, OnDestroy {
|
|
5
|
+
export declare class PhoneInputComponent implements OnInit, OnChanges, OnDestroy, DoCheck {
|
|
6
6
|
private presets;
|
|
7
7
|
/**
|
|
8
8
|
* Preset name to apply. Presets define reusable phone input configurations
|
|
@@ -31,8 +31,16 @@ export declare class PhoneInputComponent implements OnInit, OnChanges, OnDestroy
|
|
|
31
31
|
internalNumberControl: FormControl<string>;
|
|
32
32
|
private valueSubscription;
|
|
33
33
|
private isInternalUpdate;
|
|
34
|
+
/** Último valor del control externo ya reflejado en el input. */
|
|
35
|
+
private lastSyncedValue;
|
|
34
36
|
ngOnInit(): void;
|
|
35
37
|
ngOnChanges(changes: SimpleChanges): void;
|
|
38
|
+
/**
|
|
39
|
+
* Refleja cambios del control externo que NO emiten `valueChanges` — p. ej.
|
|
40
|
+
* `patchValue(..., { emitEvent: false })` en una carga programática de datos.
|
|
41
|
+
* Sin esto el input quedaría vacío tras un `patchValue` silencioso.
|
|
42
|
+
*/
|
|
43
|
+
ngDoCheck(): void;
|
|
36
44
|
ngOnDestroy(): void;
|
|
37
45
|
/**
|
|
38
46
|
* Merge preset configuration with explicit props.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { FormMetadata, FormSubmit } from '../../types';
|
|
3
4
|
import { MFAMethod, TOTPSetupResponse } from '../../../services/auth/types';
|
|
4
5
|
import { QrResult } from '../../../services/qr-generator/types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
@@ -39,6 +40,12 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
39
40
|
/** Controla la visibilidad. Cada apertura re-resuelve el estado MFA. */
|
|
40
41
|
set isOpen(value: boolean);
|
|
41
42
|
get isOpen(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Código MFA pre-cargado (deep-link desde el email de setup MFA-email). Si
|
|
45
|
+
* está presente al abrir, el modal salta directo al paso de confirmación
|
|
46
|
+
* con el código rellenado.
|
|
47
|
+
*/
|
|
48
|
+
prefillCode?: string;
|
|
42
49
|
/** Emite cuando el estado MFA cambia (habilitado / deshabilitado). */
|
|
43
50
|
changed: EventEmitter<void>;
|
|
44
51
|
/** Emite cuando el user cierra el modal (botón X o backdrop). */
|
|
@@ -46,6 +53,7 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
46
53
|
private auth;
|
|
47
54
|
private toast;
|
|
48
55
|
private i18n;
|
|
56
|
+
private i18nHelper;
|
|
49
57
|
private qrGen;
|
|
50
58
|
private readonly _step;
|
|
51
59
|
/** Paso actual del flujo. */
|
|
@@ -63,7 +71,6 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
63
71
|
readonly regeneratedCodes: import("@angular/core").WritableSignal<string[]>;
|
|
64
72
|
readonly resendCooldown: import("@angular/core").WritableSignal<number>;
|
|
65
73
|
readonly pinControl: FormControl<string>;
|
|
66
|
-
readonly passwordControl: FormControl<string>;
|
|
67
74
|
readonly phoneControl: FormControl<string>;
|
|
68
75
|
readonly pinInputProps: {
|
|
69
76
|
control: FormControl<string>;
|
|
@@ -72,6 +79,8 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
72
79
|
allowNumbersOnly: boolean;
|
|
73
80
|
autoFocus: boolean;
|
|
74
81
|
};
|
|
82
|
+
/** Form de deshabilitación — `val-form` con un campo de contraseña. */
|
|
83
|
+
readonly disableFormProps: import("@angular/core").Signal<FormMetadata>;
|
|
75
84
|
private resendTimer;
|
|
76
85
|
constructor();
|
|
77
86
|
ngOnDestroy(): void;
|
|
@@ -79,6 +88,12 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
79
88
|
t(key: string): string;
|
|
80
89
|
/** Cierre iniciado por el user (X / backdrop). */
|
|
81
90
|
close(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Punto de entrada al abrir el modal. Con `prefillCode` (deep-link del email
|
|
93
|
+
* de setup MFA-email) salta directo a la confirmación; si no, resuelve el
|
|
94
|
+
* estado MFA actual.
|
|
95
|
+
*/
|
|
96
|
+
private open;
|
|
82
97
|
/** Consulta el perfil para conocer el estado MFA y posicionar el flujo. */
|
|
83
98
|
private resolveStatus;
|
|
84
99
|
private loadBackupCount;
|
|
@@ -97,7 +112,7 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
97
112
|
/** Regenera los códigos de respaldo TOTP y los muestra una vez. */
|
|
98
113
|
regenerateBackupCodes(): void;
|
|
99
114
|
/** Deshabilita MFA — requiere la contraseña de la cuenta. */
|
|
100
|
-
|
|
115
|
+
onDisableSubmit(event: FormSubmit): void;
|
|
101
116
|
/** Copia una lista de códigos de respaldo al portapapeles. */
|
|
102
117
|
copyCodes(codes: string[]): Promise<void>;
|
|
103
118
|
/** Etiqueta i18n legible para un método MFA. */
|
|
@@ -109,6 +124,6 @@ export declare class MfaModalComponent implements OnDestroy {
|
|
|
109
124
|
private resolveError;
|
|
110
125
|
private showToast;
|
|
111
126
|
static ɵfac: i0.ɵɵFactoryDeclaration<MfaModalComponent, never>;
|
|
112
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MfaModalComponent, "val-mfa-modal", never, { "isOpen": { "alias": "isOpen"; "required": false; }; }, { "changed": "changed"; "dismissed": "dismissed"; }, never, never, true, never>;
|
|
127
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MfaModalComponent, "val-mfa-modal", never, { "isOpen": { "alias": "isOpen"; "required": false; }; "prefillCode": { "alias": "prefillCode"; "required": false; }; }, { "changed": "changed"; "dismissed": "dismissed"; }, never, never, true, never>;
|
|
113
128
|
}
|
|
114
129
|
export {};
|
|
@@ -767,6 +767,15 @@ export interface OAuthResult {
|
|
|
767
767
|
isNewUser?: boolean;
|
|
768
768
|
/** Indica si la cuenta fue vinculada a usuario existente */
|
|
769
769
|
linked?: boolean;
|
|
770
|
+
/**
|
|
771
|
+
* `true` si el backend exige verificación MFA tras el OAuth. En ese caso
|
|
772
|
+
* NO vienen `accessToken`/`refreshToken` — el flujo continúa con `mfaToken`.
|
|
773
|
+
*/
|
|
774
|
+
mfaRequired?: boolean;
|
|
775
|
+
/** Token temporal para el challenge MFA (presente si `mfaRequired`). */
|
|
776
|
+
mfaToken?: string;
|
|
777
|
+
/** Método MFA configurado por el usuario (presente si `mfaRequired`). */
|
|
778
|
+
mfaMethod?: MFAMethod;
|
|
770
779
|
}
|
|
771
780
|
/**
|
|
772
781
|
* Error de OAuth.
|
package/lib/version.d.ts
CHANGED