export type SupportArchiveFormat = 'unspecified' | 'zip' | 'bos' | 'zipencrypted'; export type GetSupportArchive = {format: SupportArchiveFormat}; export type GetApiApiV1MinerSupportArchiveArgs = {body: GetSupportArchive}; export type GetApiApiV1MinerSupportArchiveOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stream support archive * * GET /api/v1/miner/support-archive */ export const getApiApiV1MinerSupportArchive = async (args: GetApiApiV1MinerSupportArchiveArgs, options?: GetApiApiV1MinerSupportArchiveOptions) => { const {baseUrl = "http://miner", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/octet-stream") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/miner/support-archive${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };