export type CreateApiTranscriptionsHistoryParentContributionIdArgs = {parentContributionId: string}; export type CreateApiTranscriptionsHistoryParentContributionIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the history of a transcription. * * POST /transcriptions/history/:parentContributionId */ export const createApiTranscriptionsHistoryParentContributionId = async (args: CreateApiTranscriptionsHistoryParentContributionIdArgs, options?: CreateApiTranscriptionsHistoryParentContributionIdOptions) => { const {baseUrl = "https://catalog.archives.gov/api/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.parentContributionId != null) query.append("parentContributionId", String(args.parentContributionId)) const url = `${baseUrl.replace(/\/+$/, '')}/transcriptions/history/:parentContributionId${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 };