/** * Small HTTP/network atoms shared across the fleet: `Retry-After` parsing * (getyourguide / musicbrainz / viator / tripadvisor), host splitting * (workday's multi-datacenter subdomains), descriptive User-Agent lines * (musicbrainz / getyourguide — rate-limited public APIs block generic UAs), * and RFC 6266 `Content-Disposition` filename extraction (ofw downloads). */ /** Options for {@link parseRetryAfterMs}. */ export interface ParseRetryAfterOptions { /** Delay when the header is missing or unparseable. Defaults to 2000 ms. */ defaultMs?: number; /** Upper bound on the honored delay. Defaults to 30 000 ms. */ capMs?: number; } /** * Parse an RFC 9110 `Retry-After` header (the delta-seconds form) into a * bounded delay in milliseconds. Missing / non-numeric / negative values fall * back to `defaultMs` **verbatim** — `capMs` bounds only header-derived delays * (an upstream asking for a 10-minute wait shouldn't pin a tool call open, but * the caller's own configured fallback is trusted as-is). The HTTP-date form * is not parsed (no donor upstream uses it) and falls back to the default. */ export declare function parseRetryAfterMs(header: string | null | undefined, opts?: ParseRetryAfterOptions): number; /** Result of {@link splitHost}. */ export interface SplitHost { /** The registrable-ish domain: the last two labels (or the whole host when ≤ 2 labels). */ domain: string; /** Everything left of the domain, when present (`'wd5'`, `'a.b'`). */ subdomain?: string; } /** * Split a hostname into `{ domain, subdomain? }` where `domain` is the last * two labels: `wd5.myworkday.com` → `{ domain: 'myworkday.com', subdomain: * 'wd5' }`. Hosts with ≤ 2 labels return just `{ domain }`. Consolidates * workday's `splitHost`, which computes a fetchproxy transport's * `domains`/`defaultSubdomain` pair from the configured host. (Naive * two-label split — public-suffix domains like `.co.uk` aren't special-cased; * no fleet upstream lives on one.) */ export declare function splitHost(host: string): SplitHost; /** * Build the descriptive `User-Agent` a rate-limited public API expects: * `name/version (+contactUrl)`. MusicBrainz-style APIs block empty/generic * UAs, so every fleet client should send one of these. */ export declare function buildUserAgent(name: string, version: string, contactUrl?: string): string; /** * Extract the filename from a `Content-Disposition` header, preferring the * RFC 6266 `filename*=UTF-8''percent-encoded` form over the quoted * `filename="…"` fallback (matching ofw's download path). Returns `undefined` * when the header is missing or carries no filename. */ export declare function parseContentDispositionFilename(header: string | null | undefined): string | undefined; //# sourceMappingURL=net-atoms.d.ts.map