valtech-components 2.0.915 → 2.0.916
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/change-email-modal/change-email-modal.component.mjs +293 -0
- package/esm2022/lib/services/auth/auth.service.mjs +24 -3
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/esm2022/lib/services/i18n/default-content.mjs +41 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/valtech-components.mjs +346 -4
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/change-email-modal/change-email-modal.component.d.ts +54 -0
- package/lib/services/auth/auth.service.d.ts +4 -1
- package/lib/services/auth/types.d.ts +24 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormMetadata, FormSubmit } from '../../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
type EmailModalStep = 'loading' | 'no-password' | 'step1' | 'step2' | 'step3';
|
|
5
|
+
/**
|
|
6
|
+
* `val-change-email-modal` — modal de cambio de email en 3 pasos.
|
|
7
|
+
*
|
|
8
|
+
* Paso 1: contraseña actual + nuevo email → `initiateEmailChange()`
|
|
9
|
+
* Paso 2: código enviado al email actual → `confirmEmailChangeStep1()`
|
|
10
|
+
* Paso 3: código enviado al nuevo email → `confirmEmailChangeStep2()`
|
|
11
|
+
*
|
|
12
|
+
* Si el user no tiene contraseña (cuenta OAuth-only), muestra aviso.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <val-change-email-modal
|
|
17
|
+
* [isOpen]="isEmailModalOpen()"
|
|
18
|
+
* (changed)="isEmailModalOpen.set(false)"
|
|
19
|
+
* (dismissed)="isEmailModalOpen.set(false)"
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChangeEmailModalComponent {
|
|
24
|
+
private _isOpen;
|
|
25
|
+
set isOpen(value: boolean);
|
|
26
|
+
get isOpen(): boolean;
|
|
27
|
+
/** Emite al completar el cambio de email con éxito. El padre cierra el modal. */
|
|
28
|
+
changed: EventEmitter<void>;
|
|
29
|
+
/** Emite cuando el user cierra el modal. */
|
|
30
|
+
dismissed: EventEmitter<void>;
|
|
31
|
+
private auth;
|
|
32
|
+
private toast;
|
|
33
|
+
private i18n;
|
|
34
|
+
private i18nHelper;
|
|
35
|
+
readonly _step: import("@angular/core").WritableSignal<EmailModalStep>;
|
|
36
|
+
readonly _pendingEmail: import("@angular/core").WritableSignal<string>;
|
|
37
|
+
private readonly _formState;
|
|
38
|
+
t(key: string): string;
|
|
39
|
+
readonly noPasswordTitle: import("@angular/core").Signal<string>;
|
|
40
|
+
readonly noPasswordHint: import("@angular/core").Signal<string>;
|
|
41
|
+
readonly step1Props: import("@angular/core").Signal<FormMetadata>;
|
|
42
|
+
readonly step2Props: import("@angular/core").Signal<FormMetadata>;
|
|
43
|
+
readonly step3Props: import("@angular/core").Signal<FormMetadata>;
|
|
44
|
+
close(): void;
|
|
45
|
+
private resolveMode;
|
|
46
|
+
handleStep1(event: FormSubmit): void;
|
|
47
|
+
handleStep2(event: FormSubmit): void;
|
|
48
|
+
handleStep3(event: FormSubmit): void;
|
|
49
|
+
private resolveError;
|
|
50
|
+
private showToast;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChangeEmailModalComponent, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChangeEmailModalComponent, "val-change-email-modal", never, { "isOpen": { "alias": "isOpen"; "required": false; }; }, { "changed": "changed"; "dismissed": "dismissed"; }, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -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, MFADisableRequest, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, ChangePasswordResponse, DeleteAccountResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult, TOTPSetupResponse, TOTPVerifySetupResponse, TOTPDisableResponse, RegenerateBackupCodesResponse, BackupCodesCountResponse, OAuthProvider, LinkedProvider, HasPasswordResponse, UpdateHandleResponse, CheckHandleResponse, UpdateAvatarRequest, UpdateAvatarResponse } from './types';
|
|
9
|
+
import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, GetProfileResponse, UpdateProfileRequest, UpdateProfileResponse, MFASetupResponse, MFAConfirmResponse, MFADisableRequest, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, ChangePasswordResponse, DeleteAccountResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult, TOTPSetupResponse, TOTPVerifySetupResponse, TOTPDisableResponse, RegenerateBackupCodesResponse, BackupCodesCountResponse, OAuthProvider, LinkedProvider, HasPasswordResponse, UpdateHandleResponse, CheckHandleResponse, UpdateAvatarRequest, UpdateAvatarResponse, InitiateEmailChangeResponse, ConfirmEmailChangeStep1Response, ConfirmEmailChangeStep2Response } from './types';
|
|
10
10
|
import { OAuthService } from './oauth.service';
|
|
11
11
|
import { FirebaseService, MessagingService } from '../firebase';
|
|
12
12
|
import { I18nService } from '../i18n';
|
|
@@ -293,6 +293,9 @@ export declare class AuthService implements OnDestroy {
|
|
|
293
293
|
* Requiere la contraseña actual para verificación.
|
|
294
294
|
*/
|
|
295
295
|
changePassword(currentPassword: string, newPassword: string): Observable<ChangePasswordResponse>;
|
|
296
|
+
initiateEmailChange(currentPassword: string, newEmail: string): Observable<InitiateEmailChangeResponse>;
|
|
297
|
+
confirmEmailChangeStep1(code: string): Observable<ConfirmEmailChangeStep1Response>;
|
|
298
|
+
confirmEmailChangeStep2(code: string): Observable<ConfirmEmailChangeStep2Response>;
|
|
296
299
|
/**
|
|
297
300
|
* Elimina la cuenta del usuario (soft delete).
|
|
298
301
|
* Requiere confirmación de contraseña por seguridad.
|
|
@@ -889,3 +889,27 @@ export interface UnlinkProviderResponse {
|
|
|
889
889
|
operationId: string;
|
|
890
890
|
unlinked: boolean;
|
|
891
891
|
}
|
|
892
|
+
export interface InitiateEmailChangeRequest {
|
|
893
|
+
currentPassword: string;
|
|
894
|
+
newEmail: string;
|
|
895
|
+
}
|
|
896
|
+
export interface InitiateEmailChangeResponse {
|
|
897
|
+
operationId: string;
|
|
898
|
+
pendingEmail: string;
|
|
899
|
+
requestLocation: string;
|
|
900
|
+
}
|
|
901
|
+
export interface ConfirmEmailChangeStep1Request {
|
|
902
|
+
code: string;
|
|
903
|
+
}
|
|
904
|
+
export interface ConfirmEmailChangeStep1Response {
|
|
905
|
+
operationId: string;
|
|
906
|
+
verified: boolean;
|
|
907
|
+
}
|
|
908
|
+
export interface ConfirmEmailChangeStep2Request {
|
|
909
|
+
code: string;
|
|
910
|
+
}
|
|
911
|
+
export interface ConfirmEmailChangeStep2Response {
|
|
912
|
+
operationId: string;
|
|
913
|
+
success: boolean;
|
|
914
|
+
newEmail: string;
|
|
915
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -188,6 +188,7 @@ export * from './lib/components/organisms/article/types';
|
|
|
188
188
|
export * from './lib/components/organisms/banner/banner.component';
|
|
189
189
|
export * from './lib/components/organisms/banner/types';
|
|
190
190
|
export * from './lib/components/organisms/change-password-modal/change-password-modal.component';
|
|
191
|
+
export * from './lib/components/organisms/change-email-modal/change-email-modal.component';
|
|
191
192
|
export * from './lib/components/organisms/cookie-banner/cookie-banner.component';
|
|
192
193
|
export * from './lib/components/organisms/cookie-banner/types';
|
|
193
194
|
export * from './lib/components/organisms/debug-console/config';
|