export type DeleteApiApiV1FolderSiteNameArgs = {siteName: string, body: Array}; export type DeleteApiApiV1FolderSiteNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete one or more path for a site * * DELETE /api/v1/folder/{siteName} */ export const deleteApiApiV1FolderSiteName = async (args: DeleteApiApiV1FolderSiteNameArgs, options: DeleteApiApiV1FolderSiteNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/folder/${encodeURIComponent(String(args.siteName))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };