interface ApiClientOptions { context?: string; org?: string; apiUrl?: string; fetchImpl?: typeof fetch; } interface ResolvedApiClient { client: ApiClient; contextName: string; apiBaseUrl: string; orgSlug: string; token: string; } interface OrganizationInfo { slug: string; name?: string; /** True for the user's personal org (server marks it via `personal_org_slug`). */ personal?: boolean; } /** HTTP verbs the CLI's REST clients issue. */ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; export interface RequestWithStatusOptions { okStatuses?: number[]; /** Send `Accept: application/json` (default). Off matches the apply client. */ sendAccept?: boolean; /** * Always send `Content-Type: application/json` even with no body. Default * sends it only when a body is present. */ alwaysJsonContentType?: boolean; } export declare class ApiClient { private readonly apiBaseUrl; private readonly token; private readonly fetchImpl; /** Extra headers sent on EVERY request (e.g. `x-lobu-apply-id`). */ private readonly extraHeaders; constructor(apiBaseUrl: string, token: string, fetchImpl?: typeof fetch, /** Extra headers sent on EVERY request (e.g. `x-lobu-apply-id`). */ extraHeaders?: Record); /** * Single HTTP chokepoint: fetch (with retry) → parse JSON → throw `ApiError` * on a non-ok / non-allowed status. Returns the response status alongside the * parsed body so callers that branch on status (e.g. `lobu apply`'s 404/409 * handling) don't reimplement the fetch/parse/error pipeline. */ requestWithStatus(method: HttpMethod, path: string, body?: unknown, options?: RequestWithStatusOptions): Promise<{ status: number; body: T; }>; request(method: HttpMethod, path: string, body?: unknown, options?: { okStatuses?: number[]; }): Promise; get(path: string): Promise; post(path: string, body?: unknown): Promise; patch(path: string, body?: unknown): Promise; delete(path: string): Promise; } export declare function resolveApiClient(options?: ApiClientOptions): Promise; export declare function listOrganizations(options?: Pick): Promise; export declare function apiBaseFromContextUrl(apiUrl: string): string; export {}; //# sourceMappingURL=api-client.d.ts.map