export type CircuitBreakerConfigUpdate = {tenant_id: string, error_threshold?: (number | null) | undefined, violation_threshold?: (number | null) | undefined, window_seconds?: (number | null) | undefined, default_timeout_seconds?: (number | null) | undefined, max_timeout_seconds?: (number | null) | undefined, enable_auto_recovery?: (boolean | null) | undefined}; export type UpdateApiApiV1CircuitBreakerConfigArgs = {Authorization: string, body: CircuitBreakerConfigUpdate}; export type UpdateApiApiV1CircuitBreakerConfigOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update per-tenant circuit breaker config * * PUT /api/v1/circuit-breaker/config */ export const updateApiApiV1CircuitBreakerConfig = async (args: UpdateApiApiV1CircuitBreakerConfigArgs, options?: UpdateApiApiV1CircuitBreakerConfigOptions) => { const {baseUrl = "https://agent.getaxonflow.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/circuit-breaker/config${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };