/** * The ThriveCart HTTP client. * * 3 things worth knowing. * * The base URL is `https://thrivecart.com/api/external`, not * `api.thrivecart.com`. The api. host exists, resolves, and refuses everything, * so getting it wrong looks exactly like a bad API key. * * Authentication is a bearer API key per cart, with no session and no refresh, * so there is nothing to cache. What does need managing is pacing: requests are * spaced by `minRequestIntervalMs`, and 429 and 5xx are retried with backoff * that honours `Retry-After`. A revenue summary walks every page of * transactions, which is where an unpaced client gets itself rate limited. * * Every error carries the account name, because with several carts connected * "401" on its own does not say which key is wrong. */ import type { Account, Config } from "../config.js"; export declare class ThriveCartClient { private readonly config; private lastRequestAt; constructor(config: Config); get accounts(): Account[]; get(account: Account, endpoint: string, query?: Record): Promise; post(account: Account, endpoint: string, body?: Record): Promise; private call; /** Keep at least `minRequestIntervalMs` between outbound requests. */ private pace; }