fleeta-api-lib
Version:
A comprehensive library for fleet management applications - API, Auth, Device management
49 lines • 1.15 kB
TypeScript
/**
* GPS WebSocket Authentication Manager
* Handles JWT token management and URL generation
*/
/**
* Authentication configuration
*/
export interface AuthConfig {
baseUrl: string;
authMethod: 'query' | 'header' | 'message';
}
/**
* Authentication Manager class
* Separated authentication logic for better maintainability
*/
export declare class AuthManager {
private config;
private currentToken;
constructor(config: AuthConfig);
/**
* Set JWT authentication token
*/
setToken(token: string): void;
/**
* Get current JWT token
*/
getToken(): string | null;
/**
* Check if token is valid
*/
hasValidToken(): boolean;
/**
* Generate connection URL based on auth method
*/
generateConnectionUrl(): string;
/**
* Create authentication message for message-based auth
*/
createAuthMessage(): object | null;
/**
* Update authentication configuration
*/
updateConfig(newConfig: Partial<AuthConfig>): void;
/**
* Clear authentication data
*/
clear(): void;
}
//# sourceMappingURL=AuthManager.d.ts.map