import type { ActivityDetailResponse, ActivityItemsResponse, ActivityListResponse, ChangeType, CompetitorDetailListResponse, CompetitorListResponse, CompetitorOverviewResponse, DigestLatestResponse, DigestListResponse, DigestResponse, MeResponse, SectionSlug } from "./types.js"; export declare const DEFAULT_BASE_URL = "https://api.meertrack.com/v1"; /** Resolve the upstream base URL, honoring `MEERTRACK_API_BASE_URL` for staging/local. */ export declare function resolveBaseUrl(override?: string): string; export interface MeertrackClientOptions { baseUrl?: string; apiKey: string; /** Test/DI seam — defaults to global fetch. */ fetchImpl?: typeof fetch; /** Optional override for the User-Agent suffix (tests). */ userAgent?: string; /** * Fired after every upstream response (success or failure) with the parsed * `X-Request-Id` header. Used by the HTTP transport to fold the upstream * trace ID into the per-request structured log line so a Fly log entry can * be cross-referenced against Meertrack backend logs. */ onUpstreamResponse?: (info: { status: number; requestId: string | null; }) => void; } /** * Typed error thrown for every non-2xx upstream response. `code` reflects the * upstream error envelope's `error.code` when present, else a generic fallback * (`http_`, `transport_error`, `invalid_response`). */ export declare class MeertrackApiError extends Error { readonly status: number; readonly code: string; readonly rateLimitReset?: number; constructor(params: { status: number; code: string; message: string; rateLimitReset?: number; }); } export interface ListActivityParams { competitor_ids?: string[]; sections?: SectionSlug[]; change_types?: ChangeType[]; from?: string; to?: string; limit?: number; cursor?: string; } export interface ListCompetitorsParams { active?: boolean; ids?: string[]; expand?: "full"; } export interface ListDigestsParams { competitor_id?: string[]; from?: string; to?: string; limit?: number; cursor?: string; } /** * Thin typed wrapper over `api.meertrack.com/v1`. Each method is a 1:1 shadow * of its endpoint. No retry/backoff in v1 — a 429 throws with the reset * epoch and the caller (the MCP tool layer) decides what to tell the agent. */ export declare class MeertrackClient { readonly baseUrl: string; readonly apiKey: string; private readonly fetchImpl; private readonly userAgent; private readonly onUpstreamResponse?; constructor(opts: MeertrackClientOptions); me(): Promise; listCompetitors(params?: ListCompetitorsParams): Promise; getCompetitor(id: string): Promise; listActivity(params?: ListActivityParams): Promise; getActivityItem(rowUuid: string): Promise; getActivityItems(rowUuids: string[]): Promise; listDigests(params?: ListDigestsParams): Promise; listLatestDigests(): Promise; getDigest(id: string): Promise; private request; } /** Parse an upstream non-2xx into a `MeertrackApiError`. Exported for tests. */ export declare function toApiError(response: Response): Promise; //# sourceMappingURL=client.d.ts.map