import axios from "axios"; import { apiClient } from "./client"; import { mockHealth, mockMode } from "./mock"; import type { GatewayServicesHealth, ServiceHealth } from "@/types"; export async function getHealth(apiKey?: string, userId?: string) { if (mockMode) return mockHealth(); const { data } = await axios.get("/health", { headers: { ...(apiKey ? { "x-api-key": apiKey } : {}), ...(userId ? { "x-user-id": userId } : {}), }, }); return data; } export async function getServicesHealth() { const { data } = await apiClient.get("/services/health"); return data; }