export type PatchApiApiV1NamespacesNamespacePodsNameProxyOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * connect PATCH requests to proxy of Pod * * PATCH /api/v1/namespaces/{namespace}/pods/{name}/proxy */ export const patchApiApiV1NamespacesNamespacePodsNameProxy = async (options: PatchApiApiV1NamespacesNamespacePodsNameProxyOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (BearerToken !== undefined) headers.set("authorization", BearerToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/namespaces/${encodeURIComponent(String(args.namespace))}/pods/${encodeURIComponent(String(args.name))}/proxy${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };