export type GetApiApiRecordsetsRecentArgs = {count?: number | undefined}; export type GetApiApiRecordsetsRecentOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Gets the list of recent published recordsets * * GET /api/recordsets/recent */ export const getApiApiRecordsetsRecent = async (args: GetApiApiRecordsetsRecentArgs, options: GetApiApiRecordsetsRecentOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.count != null) query.append("count", String(args.count)) const url = `${baseUrl.replace(/\/+$/, '')}/api/recordsets/recent${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };