Skip to content

Add a Google Search Console template generated from Google's API description - #473

Merged
tnkuehne merged 3 commits into
discovery-enum-valuesfrom
google-search-console-template
Nov 29, 2026
Merged

tnkuehne merged 3 commits into
discovery-enum-valuesfrom
google-search-console-template

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

Search performance and index status are a common input for internal apps and agents, and no template covers Google Search Console yet. Like Sheets and Calendar, it only needs rules on top of the discovery generator.

What changes

Google Search Console template (templates/google-search-console)

  • Methods: all ten methods of the Search Console API as typed methods with field selections: searchanalyticsQuery, urlInspectionIndexInspect, sitesList/sitesGet/sitesAdd/sitesDelete and sitemapsList/sitemapsGet/sitemapsSubmit/sitemapsDelete.
  • Not offered: urlTestingTools.mobileFriendlyTest.run. Google retired the Mobile-Friendly Test API in December 2023; the method is still in the description but returns no results.
  • Approvals: adding a property only adds it to the user's account and runs at once by default. Submitting a sitemap changes what Google crawls for every owner of the property and asks like an update. Removing properties and sitemaps asks.
  • Scope: https://www.googleapis.com/auth/webmasters, which adding and removing need and every other method accepts. An account connected with webmasters.readonly gets permission_required.
  • Properties: siteUrl and feedpath are passed as Search Console lists them (sc-domain:example.com, https://example.com/) and sent as one encoded path segment each.
  • OAuth: the organization's own Google OAuth client, like the other Google templates.
  • Results: search_console_error carries Google's message, status and reasons. Rate limits including daily quotas (dailyLimitExceeded), missing scopes, revoked tokens and responses over 8 MiB are handled like in the other Google templates.
  • Enum values: Google's description lists the enums of the properties, sitemaps and search analytics methods in capitals (SITE_OWNER, QUERY, BY_PROPERTY). The API sends the values its reference lists (siteOwner, query, byProperty, hourly_all), so the rules map them with enumValues from Let Discovery rules give the enum values an API really uses #485. URL inspection does use capitals and keeps them. Values the reference leaves out, such as the sitemap type OCEANFRONT, follow the other values' spelling.
  • Filter lists: filterLists takes only country and device, the dimensions Google supports for it.
  • Icon: Google's official Search Console icon.

Not run live

  • sitemapsSubmit and sitemapsDelete. They use the same path encoding and empty-response handling as sitesAdd and sitesDelete, which ran live, and are covered by the template tests.

Live run

Run against a real Google account through a deployed copy of the template:

  • sitesList, sitesGet, sitemapsList: Google returns siteOwner, siteFullUser, sitemap type sitemap and content type web, the mapped values.
  • searchanalyticsQuery with query/device dimensions, notContains filter with non-ASCII text, filterLists by country, type: "web", aggregationType: "byProperty", dataState: "all"; and grouped by hour with hourly_all. Google returns responseAggregationType: "byProperty" and metadata.firstIncompleteHour, as the description names it. Requests with the description's capitals (QUERY, BY_PROPERTY) are accepted too; responses always use the mapped values.
  • urlInspectionIndexInspect: returns PASS, ALLOWED, INDEXING_ALLOWED, SUCCESSFUL, MOBILE in capitals, as the description lists them.
  • sitesAdd and sitesDelete with a non-ASCII property URL (https://live-test-größe.widefleet.com/): both return no data; Google stores the property under its punycode host and removes it again.
  • sitemapsSubmit asks first at the default level; declining returns declined.

Tests

  • Template tests: connection, encoded property and sitemap URLs with non-ASCII text, search analytics and URL inspection, empty responses of adding, submitting and removing, approvals per level, Google's errors, rate limits, missing scopes, revoked tokens, refresh and disconnect.
  • Generator tests pass. Google returns the description's methods in a different order on each download, so regenerating reorders src/api.ts and src/schema.ts without changing their content.
  • Type tests: permissionLevel === "siteOwner" compiles; "SITE_OWNER", dimensions: ["QUERY"] and a query filter list don't.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 5f2dac9 Nov 29 2026, 08:48 AM

@tnkuehne
tnkuehne force-pushed the google-search-console-template branch from 26550bf to 9e6da82 Compare November 29, 2026 08:33
@tnkuehne
tnkuehne changed the base branch from main to discovery-enum-values November 29, 2026 08:34
@tnkuehne
tnkuehne added this pull request to stack #486 November 29, 2026 08:34
…ription

All ten methods of the Search Console API as typed methods: search analytics, URL inspection, properties and sitemaps. Adding a property runs at once by default; submitting sitemaps and removing properties and sitemaps ask first. The retired Mobile-Friendly Test is not offered.
Google's description lists the enum values of the properties, sitemaps and
search analytics methods in capitals, such as SITE_OWNER and QUERY. The API
sends and takes the values its reference lists, such as siteOwner, query and
hourly_all, so the rules map each field's values to those. URL inspection
does use capitals and keeps them. Google returns the description's methods in
a different order on each download, which reorders the generated files.
@tnkuehne
tnkuehne force-pushed the google-search-console-template branch from 9e6da82 to 5f2dac9 Compare November 29, 2026 08:47
…ate limits

Filter lists match several values of only a country or device, so their
dimension takes only those. Search Console reports daily quotas, such as URL
inspections per property, as 403 dailyLimitExceeded, which now returns
rate_limited like its other quota errors.
@tnkuehne
tnkuehne marked this pull request as ready for review November 29, 2026 13:01
@tnkuehne
tnkuehne merged commit 3a746a2 into main Nov 29, 2026
17 checks passed
@tnkuehne
tnkuehne deleted the google-search-console-template branch November 29, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant