export type UpdateApiV1ConnectPathOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Proxy requests to Gala Connect API * * PUT /v1/connect/{path} */ export const updateApiV1ConnectPath = async (options?: UpdateApiV1ConnectPathOptions) => { const {baseUrl = "https://lpad-backend.stage.defi.ovh.gala.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/connect/${encodeURIComponent(String(args.path))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };