export type GetApiApiOrgIdServiceStreamsArgs = {org_id: string}; export type GetApiApiOrgIdServiceStreamsOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/{org_id}/service_streams */ export const getApiApiOrgIdServiceStreams = async (args: GetApiApiOrgIdServiceStreamsArgs, options: GetApiApiOrgIdServiceStreamsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/service_streams${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 };