export type DeleteApiApiV1StreamStreamIdSinkSinkIdArgs = {stream_id: string, sink_id: string}; export type DeleteApiApiV1StreamStreamIdSinkSinkIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Sink * * DELETE /api/v1/stream/{stream_id}/sink/{sink_id} */ export const deleteApiApiV1StreamStreamIdSinkSinkId = async (args: DeleteApiApiV1StreamStreamIdSinkSinkIdArgs, options?: DeleteApiApiV1StreamStreamIdSinkSinkIdOptions) => { const {baseUrl = "https://api.eu.svix.com", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/stream/${encodeURIComponent(String(args.stream_id))}/sink/${encodeURIComponent(String(args.sink_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };