export type DeleteApiApiV1WorkspacesSlugWatchersTopicShareArgs = {topic: string}; export type DeleteApiApiV1WorkspacesSlugWatchersTopicShareOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /api/v1/workspaces/{slug}/watchers/{topic}/share */ export const deleteApiApiV1WorkspacesSlugWatchersTopicShare = async (args: DeleteApiApiV1WorkspacesSlugWatchersTopicShareArgs, options?: DeleteApiApiV1WorkspacesSlugWatchersTopicShareOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/watchers/${encodeURIComponent(String(args.topic))}/share${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 };