import type log from "loglevel"; import type { RequestInit } from "undici"; import type { MeticulousClient, RequestConfig, Response } from "./types/client.types"; export declare const buildUserAgent: (appInfo?: string) => string; export interface ClientOptions { apiToken: string | null | undefined; /** * Optional identifier for the consuming application, appended to the * User-Agent of every request (e.g. `report-diffs-action/cloud-compute@v1`). * Use it to attribute backend traffic to a specific consumer/version. */ appInfo?: string; } export interface MakeRequestOptions { url: string; headers: Record; options: RequestInit; config: RequestConfig; logger: log.Logger; } export declare const makeRequest: (requestOptions: MakeRequestOptions) => Promise>; /** * The token to authenticate requests with. A plain string is used as-is for the * client's lifetime; a provider function is invoked on every request so the * token can be refreshed (e.g. short-lived OAuth access tokens). `null` means * the request is sent without an Authorization header (some environments * inject auth themselves). */ type TokenProvider = string | null | (() => Promise); export declare const buildClient: (token: TokenProvider, logger: log.Logger, appInfo?: string) => MeticulousClient; export declare const createClient: (options: ClientOptions) => MeticulousClient; export declare const isInteractiveContext: () => boolean; /** * Resolves an API token using the full auth chain (explicit token → env var → * stored OAuth → legacy config file), and falls back to an interactive browser * OAuth login when nothing is stored and the process is attached to a TTY. * * Returns `null` if no token can be obtained (instead of exiting). Callers * should proceed with unauthenticated requests — some environments inject auth * into outbound traffic. Use this anywhere a CLI command needs an API token — * either to build a client (see `createClientWithOAuth`) or to pass directly * to a launcher. */ export declare const resolveApiTokenWithOAuth: (options: ClientOptions & { enableOAuthLogin?: boolean; }) => Promise; export declare const createClientWithOAuth: (options: ClientOptions & { enableOAuthLogin?: boolean; }) => Promise; export {}; //# sourceMappingURL=client.d.ts.map