import { OnDestroy } from '@angular/core'; import { Observable } from 'rxjs'; import { FgsActiveSession } from '../models/config.model'; import { CreateSessionRequest, CreateSessionResponse, ValidateSessionResponse, RefreshSessionResponse, ActiveSessionResponse, RevokeSessionResponse, LogoutResponse, SessionState, SessionConflictState, ConflictAction } from '../models/session.model'; import * as i0 from "@angular/core"; /** * Main session management service */ export declare class FgsSessionService implements OnDestroy { private config; private http; private router; private storageService; private deviceInfoService; private sessionTimer; private activityTracker; private broadcastService; private networkStatusService; private destroy$; private sessionState; private conflictState; private isSessionLocked; private sessionCreated; private sessionValidated; private sessionRefreshed; private sessionRevoked; private loggedOut; private conflictDetected; private sessionLocked; private sessionUnlocked; private networkStatusChanged; private lastRefreshTime; private isRefreshing; private validationInterval; private readonly validationIntervalMs; private proactiveRefreshTimeout; private readonly proactiveRefreshThresholdMs; private readonly maxRetryAttempts; private readonly retryDelayMs; sessionCreated$: Observable; sessionValidated$: Observable; sessionRefreshed$: Observable; sessionRevoked$: Observable; loggedOut$: Observable; conflictDetected$: Observable; conflictState$: Observable; sessionLocked$: Observable; sessionUnlocked$: Observable; isSessionLocked$: Observable; networkStatusChanged$: Observable; isAuthenticated: import("@angular/core").Signal; currentSessionId: import("@angular/core").Signal; currentUserId: import("@angular/core").Signal; isLocked: import("@angular/core").Signal; private get apiBaseUrl(); private get endpoints(); private get features(); private get uiConfig(); private get routes(); private get refreshThrottleMs(); private get debug(); ngOnDestroy(): void; /** * Initialize cross-window synchronization and network monitoring * Call this early in your app initialization */ initializeBroadcastAndNetwork(): void; /** * Handle logout broadcast from another tab */ private handleBroadcastLogout; /** * Handle session expired broadcast from another tab */ private handleBroadcastSessionExpired; /** * Handle session locked broadcast from another tab */ private handleBroadcastSessionLocked; /** * Handle session unlocked broadcast from another tab */ private handleBroadcastSessionUnlocked; /** * Handle network coming back online */ private handleNetworkOnline; /** * Handle network going offline */ private handleNetworkOffline; /** * Start periodic session validation */ private startValidationInterval; /** * Stop periodic session validation */ private stopValidationInterval; /** * Schedule proactive session refresh before expiry */ private scheduleProactiveRefresh; /** * Stop proactive refresh */ private stopProactiveRefresh; /** * Initialize session after successful login * Call this method after your login API returns successfully */ initializeSession(userData: any, authToken: string, userId?: string, userCode?: string): Promise; /** * Check if error should not be retried */ private isNonRetryableError; /** * Utility delay function */ private delay; /** * Create a new session */ createSession(request: CreateSessionRequest): Observable; /** * Validate current session */ validateSession(): Observable; /** * Refresh session (get new token) */ refreshSession(): Observable; /** * Extend session (alias for refreshSession with timer reset) */ extendSession(): Observable; /** * Get list of active sessions for user */ getActiveSessions(userId?: string): Observable; /** * Check for session conflicts (other active sessions) * Uses distributed locking to prevent race conditions across tabs */ checkForSessionConflicts(userId: string, currentSessionId: string): Promise; /** * Lock the session (pause activity, show lock screen) * Broadcasts to all tabs */ lockSession(): void; /** * Unlock the session (resume activity) * Broadcasts to all tabs */ unlockSession(): void; /** * Check if session is currently locked */ getIsLocked(): boolean; /** * Revoke a specific session */ revokeSession(sessionId: string, reason?: string): Observable; /** * Revoke all other sessions (keep current) * Uses distributed locking to prevent race conditions */ revokeAllOtherSessions(): Observable; /** * Handle conflict action */ handleConflictAction(action: ConflictAction): void; /** * Clear conflict state */ private clearConflictState; /** * Perform logout without returning observable (for internal use) */ private performLogout; /** * Enable force logout in conflict modal */ enableForceLogout(): void; /** * Update conflict countdown */ updateConflictCountdown(seconds: number): void; /** * Logout and clear session * Broadcasts logout to all other tabs */ logout(): Observable; /** * Navigate to login route with error handling */ private navigateToLogin; /** * Force logout (from 401 or session expiry) * Broadcasts session expired to all other tabs */ forceLogout(reason?: string): void; /** * Clear all session data */ private clearSession; /** * Clear session data locally (without emitting events) * Used when receiving broadcast from another tab */ private clearSessionLocal; /** * Handle invalid session (401 or validation failure) */ private handleInvalidSession; /** * Update session state */ private updateSessionState; /** * Get HTTP headers */ private getHeaders; /** * Normalize session response (handle different API response formats) */ private normalizeSessionResponse; /** * Get current session state */ getSessionState(): SessionState; /** * Check if session is valid (has token and not expired) */ isSessionValid(): boolean; /** * Debug logging */ private log; /** * Error logging (always logs regardless of debug mode) */ private logError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } //# sourceMappingURL=session.service.d.ts.map