export type CreateApi0AdminWorkerWorkerRecycleArgs = {worker: string}; export type CreateApi0AdminWorkerWorkerRecycleOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /0/admin/worker/{worker}/recycle */ export const createApi0AdminWorkerWorkerRecycle = async (args: CreateApi0AdminWorkerWorkerRecycleArgs, options: CreateApi0AdminWorkerWorkerRecycleOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/0/admin/worker/${encodeURIComponent(String(args.worker))}/recycle${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 };