valtech-components 2.0.461 → 2.0.463
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/services/auth/auth.service.mjs +38 -2
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/fesm2022/valtech-components.mjs +37 -1
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/article/article.component.d.ts +1 -1
- package/lib/services/auth/auth.service.d.ts +16 -1
- package/lib/services/auth/types.d.ts +16 -1
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
92
92
|
shape?: "round";
|
|
93
93
|
size?: "small" | "large" | "default";
|
|
94
94
|
fill?: "default" | "clear" | "outline" | "solid";
|
|
95
|
-
type: "
|
|
95
|
+
type: "button" | "submit" | "reset";
|
|
96
96
|
token?: string;
|
|
97
97
|
ref?: any;
|
|
98
98
|
handler?: (value: any) => any;
|
|
@@ -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, MFAMethod, AuthError, ValtechAuthConfig } 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 } from './types';
|
|
10
10
|
import { FirebaseService } from '../firebase';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
/**
|
|
@@ -111,6 +111,21 @@ export declare class AuthService implements OnDestroy {
|
|
|
111
111
|
* Deshabilita MFA.
|
|
112
112
|
*/
|
|
113
113
|
disableMFA(password: string): Observable<MFADisableResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* Cambia la organización activa del usuario.
|
|
116
|
+
* Genera un nuevo Firebase token con el activeOrg actualizado.
|
|
117
|
+
*
|
|
118
|
+
* @param organizationId - ID de la organización a la que cambiar
|
|
119
|
+
* @returns Observable con el nuevo Firebase token y activeOrg
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* await firstValueFrom(this.auth.switchOrg('org_xyz789'));
|
|
124
|
+
* // Firebase ya está re-autenticado con la nueva org
|
|
125
|
+
* const activeOrg = await this.firebase.getActiveOrg();
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
switchOrg(organizationId: string): Observable<SwitchOrgResponse>;
|
|
114
129
|
/**
|
|
115
130
|
* Obtiene el perfil del usuario autenticado.
|
|
116
131
|
* Incluye información de MFA y teléfono.
|
|
@@ -335,8 +335,22 @@ export interface UpdateProfileResponse {
|
|
|
335
335
|
operationId: string;
|
|
336
336
|
updated: boolean;
|
|
337
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Request para cambiar de organización activa.
|
|
340
|
+
*/
|
|
341
|
+
export interface SwitchOrgRequest {
|
|
342
|
+
organizationId: string;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Response de cambio de organización.
|
|
346
|
+
*/
|
|
347
|
+
export interface SwitchOrgResponse {
|
|
348
|
+
operationId: string;
|
|
349
|
+
firebaseToken: string;
|
|
350
|
+
activeOrg: string;
|
|
351
|
+
}
|
|
338
352
|
/** Tipos de eventos de sincronización entre pestañas */
|
|
339
|
-
export type AuthSyncEventType = 'LOGIN' | 'LOGOUT' | 'TOKEN_REFRESH' | 'PERMISSIONS_UPDATE';
|
|
353
|
+
export type AuthSyncEventType = 'LOGIN' | 'LOGOUT' | 'TOKEN_REFRESH' | 'PERMISSIONS_UPDATE' | 'ORG_SWITCH';
|
|
340
354
|
/**
|
|
341
355
|
* Evento de sincronización entre pestañas.
|
|
342
356
|
*/
|
|
@@ -346,6 +360,7 @@ export interface AuthSyncEvent {
|
|
|
346
360
|
payload?: {
|
|
347
361
|
accessToken?: string;
|
|
348
362
|
expiresAt?: number;
|
|
363
|
+
activeOrg?: string;
|
|
349
364
|
};
|
|
350
365
|
}
|
|
351
366
|
/**
|