export type DeleteApiProjectProjectIdResourcebundlesResourceBundlePathArgs = {project_id: string, resource_bundle_path: string}; export type DeleteApiProjectProjectIdResourcebundlesResourceBundlePathOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Dissociate a resource bundle document from a project * * DELETE /project/{project_id}/resourcebundles/{resource_bundle_path} */ export const deleteApiProjectProjectIdResourcebundlesResourceBundlePath = async (args: DeleteApiProjectProjectIdResourcebundlesResourceBundlePathArgs, options?: DeleteApiProjectProjectIdResourcebundlesResourceBundlePathOptions) => { const {baseUrl = "https://developers.bloomreach.io/delivery/site/v2/documents", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/project/${encodeURIComponent(String(args.project_id))}/resourcebundles/${encodeURIComponent(String(args.resource_bundle_path))}${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 };