import type { APIResponse, Clip } from "../types.ts"; import { API_URL, apiFetch } from "./client.ts"; const getClips = async (): Promise => { const result = await apiFetch(API_URL + '/api/v1/clips'); if (result.status === 'error') throw new Error(`Failed to fetch clips: ${result.message}`); return result.data; }; const getClipById = async (id: string): Promise => { const result = await apiFetch(API_URL + `/api/v1/clips/${id}`); if (result.status === 'error') throw new Error(`Failed to fetch clip: ${result.message}`); return result.data; }; // URL for the raw media stream. The