/** * Service for fetching Google Pollen API (`pollen.googleapis.com`) day-1 * forecasts — the **optional keyed global fallback** for pollen data. * * Open-Meteo's air-quality endpoint carries pollen only from the CAMS * *European* model: real grains/m³ in Europe, all-null everywhere else. This * service exists purely to fill that gap for the rest of the world when the * caller has configured a `GOOGLE_POLLEN_API_KEY` — see * `docs/plans/global-pollen-fallback-plan.md` D2/D3. **Europe keeps the richer * keyless CAMS grains/m³ data and never contacts this service** — the * air-quality handler only calls in when every CAMS species comes back null. * * **Security: the key lives in the URL (query string).** Error mapping below * never logs or throws the request URL, and never interpolates the raw axios * error message/object into a thrown message or a log call — every thrown * error is a fixed, pre-written string (the `firms.ts`/`nifc.ts` * fixed-message-per-bucket style), so the key can never leak through a log * line or an error surfaced to a caller. Logs carry only `{ status, code }`; * coordinates in log metadata go through `redactCoordinatesForLogging`. */ import type { GooglePollenDailyInfo } from '../types/googlePollen.js'; /** * Thrown when the Google Pollen API rejects the configured * `GOOGLE_POLLEN_API_KEY` (HTTP 400/403 with a key-rejection marker in the * response body — see `mapPollenApiError`). Deliberately carries a fixed, * sanitized message — never the key or the request URL — so callers (the * air-quality handler) can catch this specific case and render a * misconfiguration note without ever touching the rejected key again. * * Not `ApiError` — `ApiServiceName` (`src/errors/ApiError.ts`) is a closed * union and this service deliberately stays outside it, mirroring * `FIRMSKeyRejectedError`. */ export declare class GooglePollenKeyRejectedError extends Error { constructor(); } export interface GooglePollenServiceConfig { timeout?: number; /** Overrides the `GOOGLE_POLLEN_API_KEY` env var — primarily for tests. */ apiKey?: string; } export declare class GooglePollenService { private client; private cache; private readonly apiKey; constructor(config?: GooglePollenServiceConfig); /** * Get cache statistics */ getCacheStats(): import("../utils/cache.js").CacheStats; /** * Clear the cache */ clearCache(): void; /** * True when a non-empty Google Pollen API key is configured. */ isKeyAvailable(): boolean; /** * Day-1 ("current") pollen forecast for a location. * * Returns `undefined` when the region has no data (uncovered region, or an * empty/absent `dailyInfo`) — that outcome is cached as a null sentinel so * the same location isn't re-probed for the TTL. **No retries.** * * @throws {GooglePollenKeyRejectedError} the configured key was rejected * @throws {Error} no key configured, invalid coordinates, or any other failure */ getCurrentPollen(latitude: number, longitude: number): Promise; private fetchCurrentPollen; } //# sourceMappingURL=googlePollen.d.ts.map