Some checks failed
CI/CD Pipeline - Xpeditis PreProd / Backend - Build & Test (push) Failing after 5m57s
CI/CD Pipeline - Xpeditis PreProd / Backend - Docker Build & Push (push) Has been skipped
CI/CD Pipeline - Xpeditis PreProd / Frontend - Build & Test (push) Failing after 6m0s
CI/CD Pipeline - Xpeditis PreProd / Frontend - 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
151 lines
3.4 KiB
TypeScript
151 lines
3.4 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';
|
|
|
|
// Re-export as API objects for backward compatibility
|
|
import * as bookingsModule from './bookings';
|
|
import * as ratesModule from './rates';
|
|
import * as usersModule from './users';
|
|
import * as authModule from './auth';
|
|
import * as organizationsModule from './organizations';
|
|
import * as notificationsModule from './notifications';
|
|
import * as auditModule from './audit';
|
|
import * as webhooksModule from './webhooks';
|
|
import * as gdprModule from './gdpr';
|
|
|
|
export const bookingsApi = bookingsModule;
|
|
export const ratesApi = ratesModule;
|
|
export const usersApi = usersModule;
|
|
export const authApi = authModule;
|
|
export const organizationsApi = organizationsModule;
|
|
export const notificationsApi = notificationsModule;
|
|
export const auditApi = auditModule;
|
|
export const webhooksApi = webhooksModule;
|
|
export const gdprApi = gdprModule;
|