export type DeleteApiV1ProjectsIdArgs = {id: string}; export type DeleteApiV1ProjectsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a project * * DELETE /v1/projects/{id} */ export const deleteApiV1ProjectsId = async (args: DeleteApiV1ProjectsIdArgs, options: DeleteApiV1ProjectsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.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 };