From 2ea6da1cfb18aac12ca2207ebb69f136925abd40 Mon Sep 17 00:00:00 2001 From: Maxim Kosterin Date: Fri, 26 Jun 2026 00:04:00 +0200 Subject: [PATCH] feat(services): add Chrome Web Store API to the service registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chrome Web Store API (`chromewebstore`, v1.1) is a Discovery-listed Google API for managing your own store items — uploading and publishing Chrome extensions, themes, and apps. It was not in the static service registry, so `gws chromewebstore ...` failed with "Unknown service". The error text suggests `:` for unlisted APIs, but that path still calls `resolve_service`, which only knows the registered aliases — so there was no way to reach the API at all. Register it like any other service (per AGENTS.md, new services only need a `services.rs` entry). Its discovery doc is served from `https://chromewebstore.googleapis.com/$discovery/rest?version=v1.1`, which the existing `$discovery/rest` fallback in `discovery.rs` already handles (the standard `discovery/v1/apis/...` URL 404s for this API). Verified end-to-end: $ gws schema chromewebstore.items.get # returns the live method schema Methods exposed: items.insert / get / update (media upload) / publish. Scopes: https://www.googleapis.com/auth/chromewebstore (+ .readonly). --- crates/google-workspace/src/services.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/google-workspace/src/services.rs b/crates/google-workspace/src/services.rs index 72c96329..225a85e0 100644 --- a/crates/google-workspace/src/services.rs +++ b/crates/google-workspace/src/services.rs @@ -136,6 +136,12 @@ pub const SERVICES: &[ServiceEntry] = &[ version: "v1", description: "Manage Google Apps Script projects", }, + ServiceEntry { + aliases: &["chromewebstore"], + api_name: "chromewebstore", + version: "v1.1", + description: "Manage Chrome Web Store items (upload and publish extensions)", + }, ]; /// Resolves a service alias to (api_name, version). @@ -174,6 +180,10 @@ mod tests { resolve_service("reports").unwrap(), ("admin".to_string(), "reports_v1".to_string()) ); + assert_eq!( + resolve_service("chromewebstore").unwrap(), + ("chromewebstore".to_string(), "v1.1".to_string()) + ); } #[test]