export type DeleteApiApiProjectsIdArgs = {id: number}; export type DeleteApiApiProjectsIdOptions = {baseUrl: string, sessionCookie?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a project * * DELETE /api/projects/{id} * * Also accepts auth: apiKey */ export const deleteApiApiProjectsId = async (args: DeleteApiApiProjectsIdArgs, options: DeleteApiApiProjectsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, sessionCookie} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (sessionCookie !== undefined) cookies.push("__Host-mc-session=" + encodeURIComponent(sessionCookie)) const url = `${baseUrl.replace(/\/+$/, '')}/api/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 };