export type GetApiRecordingsIdAudioUrlsArgs = {id: string}; export type GetApiRecordingsIdAudioUrlsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get presigned URLs for every stored audio session of a recording, oldest-first. * A recording finalized more than once (e.g. a post-op dictation after the main capture) * has one entry per session; audio-url returns only the latest. * * GET /Recordings/{id}/audio-urls */ export const getApiRecordingsIdAudioUrls = async (args: GetApiRecordingsIdAudioUrlsArgs, options?: GetApiRecordingsIdAudioUrlsOptions) => { const {baseUrl = "https://api.clinicos.vet/backend/business", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/Recordings/${encodeURIComponent(String(args.id))}/audio-urls${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 };