export type GetApiBlobRawIdFullIdFilenameArgs = {id: number, fullId: string, filename: string}; export type GetApiBlobRawIdFullIdFilenameOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download raw blob data (with content disposition) * * GET /blob/raw/{id}/{fullId}/{filename} */ export const getApiBlobRawIdFullIdFilename = async (args: GetApiBlobRawIdFullIdFilenameArgs, options?: GetApiBlobRawIdFullIdFilenameOptions) => { const {baseUrl = "https://app.testiny.io/api/v1", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/blob/raw/${encodeURIComponent(String(args.id))}/${encodeURIComponent(String(args.fullId))}/${encodeURIComponent(String(args.filename))}${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 };