export type CreateApiProjectIdRebaseArgs = {project_id: string}; export type CreateApiProjectIdRebaseOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Rebase a developer project * * POST /{project_id}:rebase */ export const createApiProjectIdRebase = async (args: CreateApiProjectIdRebaseArgs, options?: CreateApiProjectIdRebaseOptions) => { 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(/\/+$/, '')}/${encodeURIComponent(String(args.project_id))}:rebase${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };