import { apiRequest } from './apiClient';

import type {
  NetworkTrafficResponse,
  VpsHealth,
} from '@/types/api';

export const vpsApi = {
  health: () =>
    apiRequest<VpsHealth>(
      '/api/vps/health',
    ),

  networkTraffic: () =>
    apiRequest<NetworkTrafficResponse>(
      '/api/vps/network-traffic',
    ),

  udp2rawTraffic: () =>
    apiRequest<NetworkTrafficResponse>(
      '/api/vps/udp2raw-traffic',
    ),

  rollbackLastBackup: () =>
    apiRequest<{ restored: boolean }>(
      '/api/vps/wireguard/rollback-last-backup',
      {
        method: 'POST',
      },
    ),
};