export type CreateApiAuthoringV1ChangesClassificationIdStatusReadyArgs = {id: string, classification: string, rev?: string | undefined}; export type CreateApiAuthoringV1ChangesClassificationIdStatusReadyOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Mark an item with the specified classification and ID as ready for publishing. * * POST /authoring/v1/changes/{classification}/{id}/status/ready */ export const createApiAuthoringV1ChangesClassificationIdStatusReady = async (args: CreateApiAuthoringV1ChangesClassificationIdStatusReadyArgs, options: CreateApiAuthoringV1ChangesClassificationIdStatusReadyOptions) => { 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.classification))}/${encodeURIComponent(String(args.id))}/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 };