xpeditis2.0/apps/frontend/src/lib/api/index.ts
David 890bc189ee
Some checks failed
CI/CD Pipeline - Xpeditis PreProd / Frontend - Build & Test (push) Failing after 5m31s
CI/CD Pipeline - Xpeditis PreProd / Frontend - Docker Build & Push (push) Has been skipped
CI/CD Pipeline - Xpeditis PreProd / Backend - Build & Test (push) Failing after 5m42s
CI/CD Pipeline - Xpeditis PreProd / Backend - Docker Build & Push (push) Has been skipped
CI/CD Pipeline - Xpeditis PreProd / Deploy to PreProd Server (push) Has been skipped
CI/CD Pipeline - Xpeditis PreProd / Run Smoke Tests (push) Has been skipped
fix v0.2
2025-11-12 18:00:33 +01:00

130 lines
2.6 KiB
TypeScript

/**
* API Client - Central Export
*
* This file exports all API services for easy import throughout the application.
* All 60 backend endpoints are now connected to the frontend.
*
* Usage:
* import { login, searchCsvRates, createBooking } from '@/lib/api';
*/
// Base client utilities
export {
getAuthToken,
setAuthTokens,
clearAuthTokens,
createHeaders,
apiRequest,
get,
post,
patch,
del,
upload,
download,
ApiError,
} from './client';
// Authentication (5 endpoints)
export { register, login, refreshToken, logout, getCurrentUser } from './auth';
// Rates (4 endpoints)
export { searchRates, searchCsvRates, getAvailableCompanies, getFilterOptions } from './rates';
// Bookings (7 endpoints)
export {
createBooking,
getBooking,
getBookingByNumber,
listBookings,
fuzzySearchBookings,
advancedSearchBookings,
exportBookings,
updateBookingStatus,
// CSV Bookings
createCsvBooking,
getCsvBooking,
listCsvBookings,
getCsvBookingStats,
cancelCsvBooking,
acceptCsvBooking,
rejectCsvBooking,
type CsvBookingResponse,
type CsvBookingListResponse,
type CsvBookingStatsResponse,
} from './bookings';
// Users (6 endpoints)
export { listUsers, getUser, createUser, updateUser, deleteUser, restoreUser } from './users';
// Organizations (4 endpoints)
export {
listOrganizations,
getOrganization,
createOrganization,
updateOrganization,
} from './organizations';
// Notifications (7 endpoints)
export {
listNotifications,
getNotification,
createNotification,
markNotificationAsRead,
markAllNotificationsAsRead,
deleteNotification,
getNotificationPreferences,
updateNotificationPreferences,
} from './notifications';
// Audit Logs (5 endpoints)
export {
listAuditLogs,
getEntityAuditLogs,
getUserAuditLogs,
getAuditStats,
exportAuditLogs,
} from './audit';
// Webhooks (7 endpoints)
export {
listWebhooks,
getWebhook,
createWebhook,
updateWebhook,
deleteWebhook,
testWebhook,
listWebhookEvents,
} from './webhooks';
// GDPR (6 endpoints)
export {
requestDataExport,
downloadDataExport,
requestAccountDeletion,
cancelAccountDeletion,
getConsentPreferences,
updateConsentPreferences,
} from './gdpr';
// Admin CSV Rates (5 endpoints) - already exists
export {
uploadCsvRates,
listCsvFiles,
deleteCsvFile,
getCsvFileStats,
convertCsvFormat,
} from './admin/csv-rates';
// Dashboard (4 endpoints)
export {
getKPIs,
getBookingsChart,
getTopTradeLanes,
getAlerts,
dashboardApi,
type DashboardKPIs,
type BookingsChartData,
type TradeLane,
type DashboardAlert,
} from './dashboard';