export type CreateApiAuthoringV1ChangesUidStatusReadyArgs = {uid: string, rev?: string | undefined}; export type CreateApiAuthoringV1ChangesUidStatusReadyOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Mark the item with the specified unique ID as ready for publishing. * * POST /authoring/v1/changes/{uid}/status/ready */ export const createApiAuthoringV1ChangesUidStatusReady = async (args: CreateApiAuthoringV1ChangesUidStatusReadyArgs, options: CreateApiAuthoringV1ChangesUidStatusReadyOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.rev != null) query.append("rev", String(args.rev)) const url = `${baseUrl.replace(/\/+$/, '')}/authoring/v1/changes/${encodeURIComponent(String(args.uid))}/status/ready${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 };