export type GetApiApiV1GuidesFiguresArgs = {keys: string}; export type GetApiApiV1GuidesFiguresOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v1/guides/figures */ export const getApiApiV1GuidesFigures = async (args: GetApiApiV1GuidesFiguresArgs, options?: GetApiApiV1GuidesFiguresOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.keys != null) query.append("keys", String(args.keys)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/guides/figures${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 };