/** * GscAdapter — the FIRST live network `SeoDataSource` (spec-20260715-ultimate-seo-suite, * Sprint 8). Serves `searchAnalytics` + `urlInspection` from the real Google * Search Console API, behind the `"search-console"` egress axis. * * ADR-5 (the load-bearing invariant of this file): EVERY capability method * that would open a socket begins with these two gates, IN ORDER, before any * network work: * 1. `this.egress.assertAllowed("search-console")` — throws when the axis * is off; caught immediately and converted to `abstain` WITHOUT opening * a socket (never hoisted into a caller/runner — see `src/seo/egress.ts`). * 2. `this.governor.admit(req)` — synchronous, never throws, no side * effect; refused admission also aborts before any socket opens. * Only after BOTH gates pass does the injected `HttpClient` make a request. * Any HTTP/network/parse error (including 429/5xx) degrades to * `{ kind: "abstain", reason }` — this method NEVER throws to the caller * (mirrors `MedlineSource.fetchPassages`, * `src/medical/retrieval/medline-source.ts:142-164`). * * The real global `fetch` is referenced NOWHERE in this file — the injected * `HttpClient` (`../adapters/http.js`) is the sole transport, defaulting to * `defaultHttpClient` (production) or a fixture/spy client (tests), so CI * never opens a real socket. */ import type { SeoEgressGuard } from "../egress.js"; import type { SeoQuotaGovernor } from "../quota-governor.js"; import type { HttpClient } from "../adapters/http.js"; import type { SeoDataSource, SeoCapability, SearchAnalyticsQuery, SearchAnalyticsRow, UrlInspectionQuery, UrlInspectionRow, SerpQuery, SerpRow, KeywordQuery, KeywordRow, BacklinkQuery, BacklinkRow, AiVisibilityQuery, AiVisibilityRow, LinkGraphQuery, LinkGraphRow } from "../data-source.js"; import type { DataOutcome } from "../types.js"; /** * Live Google Search Console `SeoDataSource`. Serves `search-analytics` + * `url-inspection`; `serp`/`keywords`/`backlinks` are NOT GSC capabilities * (`{ kind: "disabled" }` unconditionally — DataForSEO serves those in * Sprint 9). * * bober: no OAuth refresh-grant flow here (unlike `WhoopClient`) — the * access token is injected fully-formed via `getAccessToken`; add a * refresh flow only if/when a token store is wired in a later sprint. */ export declare class GscAdapter implements SeoDataSource { private readonly egress; private readonly governor; private readonly http; private readonly getAccessToken; constructor(egress: SeoEgressGuard, governor: SeoQuotaGovernor, http?: HttpClient, getAccessToken?: () => Promise); capabilities(): SeoCapability[]; /** * Search Analytics query. ADR-5 preamble (egress gate, then quota gate) * runs before any network work; `rowLimit` is hard-capped at 25,000 * regardless of what the caller requests (sc-8-3). */ searchAnalytics(q: SearchAnalyticsQuery): Promise>; /** * URL Inspection query. Same ADR-5 preamble as `searchAnalytics`; GSC * inspects exactly one URL per call, so `estRows` is always 1. */ urlInspection(q: UrlInspectionQuery): Promise>; serp(_q: SerpQuery): Promise>; keywords(_q: KeywordQuery): Promise>; backlinks(_q: BacklinkQuery): Promise>; aiVisibility(_q: AiVisibilityQuery): Promise>; linkGraph(_q: LinkGraphQuery): Promise>; } //# sourceMappingURL=gsc-adapter.d.ts.map