export type GetApiV1FindingsIdHistoryArgs = {id: string}; export type GetApiV1FindingsIdHistoryOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get activity history for a finding * * GET /v1/findings/{id}/history */ export const getApiV1FindingsIdHistory = async (args: GetApiV1FindingsIdHistoryArgs, options?: GetApiV1FindingsIdHistoryOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/findings/${encodeURIComponent(String(args.id))}/history${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 };