export type GetApiV1QaScanIdLocalFrameArgs = {path: string, scanId: string}; export type GetApiV1QaScanIdLocalFrameOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/qa/{scanId}/local-frame */ export const getApiV1QaScanIdLocalFrame = async (args: GetApiV1QaScanIdLocalFrameArgs, options: GetApiV1QaScanIdLocalFrameOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.path != null) query.append("path", String(args.path)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/qa/${encodeURIComponent(String(args.scanId))}/local-frame${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 };