export async function purgeCloudflareCache(urls: string[]): Promise<void> {
  const zoneId = process.env.CF_ZONE_ID
  const token = process.env.CF_API_TOKEN
  if (!zoneId || !token) return

  await fetch(`https://api.cloudflare.com/client/v4/zones/${zoneId}/purge_cache`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${token}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ files: urls }),
  })
}
