export type GetApiV3AdminBugReportsArgs = {status?: ('open' | 'closed') | undefined, linked?: ('0' | '1') | undefined}; export type GetApiV3AdminBugReportsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Latest bug reports * * GET /v3/admin/bug-reports */ export const getApiV3AdminBugReports = async (args: GetApiV3AdminBugReportsArgs, options?: GetApiV3AdminBugReportsOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.status != null) query.append("status", String(args.status)) if (args.linked != null) query.append("linked", String(args.linked)) if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/admin/bug-reports${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 };