export type DeleteApiApiV3MetaWorkspacesWorkspaceIdArgs = {workspaceId: string}; export type DeleteApiApiV3MetaWorkspacesWorkspaceIdOptions = {baseUrl?: string | undefined, xcToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete workspace * * DELETE /api/v3/meta/workspaces/{workspaceId} * * Also accepts auth: bearerAuth */ export const deleteApiApiV3MetaWorkspacesWorkspaceId = async (args: DeleteApiApiV3MetaWorkspacesWorkspaceIdArgs, options?: DeleteApiApiV3MetaWorkspacesWorkspaceIdOptions) => { const {baseUrl = "https://app.nocodb.com", fetch: fetchFn = fetch, xcToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xcToken !== undefined) headers.set("xc-token", xcToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/meta/workspaces/${encodeURIComponent(String(args.workspaceId))}${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 };