feat: add google shopping offers (barcode → seller prices)#5
Merged
Conversation
Add client.google.shopping.offers({ barcode, gl?, hl? }) calling
GET /v1/google/shopping/offers — resolves a product by barcode
(GTIN-8/UPC-A/EAN-13/GTIN-14) and returns its multi-seller Google
Shopping offers. New ShoppingOffersParams type, exported from the
google and root barrels. Docs, README, CHANGELOG, and a unit test
mirror the existing shopping methods. Version 0.15.2 -> 0.15.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new method
client.google.shopping.offers({ barcode, gl?, hl? })that callsGET /v1/google/shopping/offers.It resolves a product by barcode (GTIN-8/UPC-A/EAN-13/GTIN-14) via Google web search, then returns that product's multi-seller Google Shopping offers:
Changes
src/google/shopping.ts— newoffers()method, mirroringsearch/product/click.src/google/types.ts— newShoppingOffersParamsinterface (barcoderequired,gl?,hl?).src/google/index.ts+src/index.ts— exportShoppingOffersParams.tests/google.test.ts— unit test asserting the endpoint path and forwarded params.docs/google.md,README.md,CHANGELOG.md— usage, method/credit tables, type list.0.15.2→0.15.3.Responses stay typed as
GoogleResponse(Record<string, unknown>) to match every other Google method in the SDK — the repo does not define concrete response interfaces.Test plan
npm run typecheck— cleannpm run build— successnpm test— 211 passed (incl. newofferstest)npm run lint— 7 pre-existing errors insrc/youtube/types.ts(untouched by this PR); no new lint issues introduced