import type { GeoipSettingsPatch, GeoipStatusDto, GeoipUpdateSnapshotDto, } from "@mmapp/contracts/geoip" import { requestJson } from "@/shared/api/http-client" export async function getGeoipStatus(baseUrl: string): Promise { return requestJson(baseUrl, "/api/geoip") } export async function putGeoipSettings( baseUrl: string, patch: GeoipSettingsPatch, ): Promise<{ ok: boolean; status: GeoipStatusDto }> { return requestJson(baseUrl, "/api/geoip", { method: "PUT", body: JSON.stringify(patch), }) } export async function runGeoipUpdateNow(baseUrl: string): Promise<{ ok: boolean snapshot: GeoipUpdateSnapshotDto }> { return requestJson(baseUrl, "/api/geoip/update", { method: "POST" }) }