valtech-components 2.0.483 → 2.0.484

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.
@@ -6,7 +6,7 @@ import { AuthStateService } from './auth-state.service';
6
6
  import { TokenService } from './token.service';
7
7
  import { AuthStorageService } from './storage.service';
8
8
  import { AuthSyncService } from './sync.service';
9
- import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, GetProfileResponse, UpdateProfileRequest, UpdateProfileResponse, MFASetupResponse, MFAConfirmResponse, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult } from './types';
9
+ import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, GetProfileResponse, UpdateProfileRequest, UpdateProfileResponse, MFASetupResponse, MFAConfirmResponse, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult, TOTPSetupResponse, TOTPVerifySetupResponse, TOTPDisableResponse, RegenerateBackupCodesResponse, BackupCodesCountResponse } from './types';
10
10
  import { FirebaseService, MessagingService } from '../firebase';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
@@ -114,6 +114,29 @@ export declare class AuthService implements OnDestroy {
114
114
  * Deshabilita MFA.
115
115
  */
116
116
  disableMFA(password: string): Observable<MFADisableResponse>;
117
+ /**
118
+ * Inicia configuración de TOTP MFA.
119
+ * Retorna el secreto, URL para QR code y códigos de respaldo.
120
+ */
121
+ setupTOTP(): Observable<TOTPSetupResponse>;
122
+ /**
123
+ * Verifica el código TOTP y activa MFA.
124
+ * Debe llamarse después de setupTOTP con el código del authenticator.
125
+ */
126
+ verifyTOTPSetup(code: string): Observable<TOTPVerifySetupResponse>;
127
+ /**
128
+ * Regenera los códigos de respaldo TOTP.
129
+ * Los códigos anteriores son invalidados.
130
+ */
131
+ regenerateBackupCodes(): Observable<RegenerateBackupCodesResponse>;
132
+ /**
133
+ * Obtiene la cantidad de códigos de respaldo restantes.
134
+ */
135
+ getBackupCodesCount(): Observable<BackupCodesCountResponse>;
136
+ /**
137
+ * Desactiva TOTP MFA (requiere contraseña).
138
+ */
139
+ disableTOTP(password: string): Observable<TOTPDisableResponse>;
117
140
  /**
118
141
  * Cambia la organización activa del usuario.
119
142
  * Genera un nuevo Firebase token con el activeOrg actualizado.
@@ -80,7 +80,7 @@ export interface AuthError {
80
80
  */
81
81
  export declare const INITIAL_AUTH_STATE: AuthState;
82
82
  /** Métodos de MFA soportados */
83
- export type MFAMethod = 'EMAIL' | 'SMS';
83
+ export type MFAMethod = 'EMAIL' | 'SMS' | 'TOTP';
84
84
  /**
85
85
  * Estado de MFA pendiente.
86
86
  */
@@ -107,6 +107,63 @@ export interface MFAStatus {
107
107
  enabled: boolean;
108
108
  method: MFAMethod | null;
109
109
  }
110
+ /**
111
+ * Response de setup de TOTP.
112
+ */
113
+ export interface TOTPSetupResponse {
114
+ operationId: string;
115
+ /** Secreto TOTP en base32 (para entrada manual) */
116
+ secret: string;
117
+ /** URL para generar QR code (otpauth://...) */
118
+ qrCodeUrl: string;
119
+ /** Códigos de respaldo de un solo uso */
120
+ backupCodes: string[];
121
+ message: string;
122
+ }
123
+ /**
124
+ * Request para verificar setup de TOTP.
125
+ */
126
+ export interface TOTPVerifySetupRequest {
127
+ /** Código TOTP de 6 dígitos */
128
+ code: string;
129
+ }
130
+ /**
131
+ * Response de verificación de setup TOTP.
132
+ */
133
+ export interface TOTPVerifySetupResponse {
134
+ operationId: string;
135
+ enabled: boolean;
136
+ message: string;
137
+ }
138
+ /**
139
+ * Request para deshabilitar TOTP.
140
+ */
141
+ export interface TOTPDisableRequest {
142
+ password: string;
143
+ }
144
+ /**
145
+ * Response de deshabilitar TOTP.
146
+ */
147
+ export interface TOTPDisableResponse {
148
+ operationId: string;
149
+ disabled: boolean;
150
+ message: string;
151
+ }
152
+ /**
153
+ * Response de regenerar códigos de respaldo.
154
+ */
155
+ export interface RegenerateBackupCodesResponse {
156
+ operationId: string;
157
+ backupCodes: string[];
158
+ message: string;
159
+ }
160
+ /**
161
+ * Response de cantidad de códigos de respaldo.
162
+ */
163
+ export interface BackupCodesCountResponse {
164
+ operationId: string;
165
+ count: number;
166
+ }
110
167
  /**
111
168
  * Request para signup (registro).
112
169
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.483",
3
+ "version": "2.0.484",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"