export type GetApiMfV1RmbLogDownloadEventIdArgs = {eventId: number}; export type GetApiMfV1RmbLogDownloadEventIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download rmb log file by event id * * GET /mf/v1/rmbLog/Download/{eventId} */ export const getApiMfV1RmbLogDownloadEventId = async (args: GetApiMfV1RmbLogDownloadEventIdArgs, options?: GetApiMfV1RmbLogDownloadEventIdOptions) => { const {baseUrl = "http://gateway.mlss.mf", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") const url = `${baseUrl.replace(/\/+$/, '')}/mf/v1/rmbLog/Download/${encodeURIComponent(String(args.eventId))}${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 res.blob() };