export type UpdateApiProjectsProjectIndexedArgs = {project: string, body: BodyInit}; export type UpdateApiProjectsProjectIndexedOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark project as indexed * * PUT /projects/{project}/indexed */ export const updateApiProjectsProjectIndexed = async (args: UpdateApiProjectsProjectIndexedArgs, options: UpdateApiProjectsProjectIndexedOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "text/plain") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project))}/indexed${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };