Add new Frontend API folder
This commit is contained in:
71
frontend/src/api/index.ts
Normal file
71
frontend/src/api/index.ts
Normal 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;
|
||||
Reference in New Issue
Block a user