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',
    ),

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