Add new Frontend API folder

This commit is contained in:
Urtzi Alfaro
2025-08-03 17:48:34 +02:00
parent 935f45a283
commit 03e9dc6469
50 changed files with 4737 additions and 3321 deletions

71
frontend/src/api/index.ts Normal file
View File

@@ -0,0 +1,71 @@
// frontend/src/api/index.ts
/**
* Main API Export
* Central entry point for all API functionality
*/
// Setup interceptors on import
import { setupInterceptors } from './client/interceptors';
setupInterceptors();
// Export main API client and services
export { apiClient } from './client';
export { api } from './services';
// Export all services individually
export {
authService,
tenantService,
dataService,
trainingService,
forecastingService,
notificationService,
healthService,
} from './services';
// Export all hooks
export {
useAuth,
useAuthHeaders,
useTenant,
useData,
useTraining,
useForecast,
useNotification,
useApiHooks,
} from './hooks';
// Export WebSocket functionality
export {
WebSocketManager,
useWebSocket,
useTrainingWebSocket,
useForecastWebSocket,
} from './websocket';
// Export utilities
export {
ApiErrorHandler,
ResponseProcessor,
RequestValidator,
DataTransformer,
} from './utils';
// Export types
export * from './types';
// Export interceptors for manual control
export {
AuthInterceptor,
LoggingInterceptor,
TenantInterceptor,
ErrorRecoveryInterceptor,
PerformanceInterceptor,
setupInterceptors,
} from './client/interceptors';
// Export configuration
export { apiConfig, serviceEndpoints, featureFlags } from './client/config';
// Default export for convenience
export default api;