export type DeleteApiApiV1WorkspacesSlugDocumentsArgs = {path: string}; export type DeleteApiApiV1WorkspacesSlugDocumentsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /api/v1/workspaces/{slug}/documents */ export const deleteApiApiV1WorkspacesSlugDocuments = async (args: DeleteApiApiV1WorkspacesSlugDocumentsArgs, options?: DeleteApiApiV1WorkspacesSlugDocumentsOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.path != null) query.append("path", String(args.path)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/documents${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 };