Skip to content

V26.1 - #555

Open
Lewis-Clayton wants to merge 26 commits into
masterfrom
v26.1
Open

V26.1#555
Lewis-Clayton wants to merge 26 commits into
masterfrom
v26.1

Conversation

@Lewis-Clayton

@Lewis-Clayton Lewis-Clayton commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrades the library to Google Ads API v26.1, depending on google-ads-node@26.1.0-beta.0, google-gax@^6.16.0 and google-auth-library@^11.3.3. The version 26.1.0-beta.0 goes out under the beta dist-tag for testing ahead of the stable release.

As a new major, this release also makes the package ES module-only, which lets it move to stream-json 3 (#554), makes developer_token optional (#550), and fixes a set of long-standing defects whose fixes change method shapes. CHANGELOG.md lists every breaking change with what to change in calling code.

Version upgrade

  • google-ads-api → v26.1; google-ads-node → v26.1.0; google-gax → v6.16.0; google-auth-library → v11.3.3; stream-json → v3; esbuild → v0.28
  • New services CustomerBudgetNetworkSettingService and LocalServicesEligibilityService, two new resource names and 15 new enums
  • v26 removes the hotel criteria on ad_group_bid_modifier and customer.conversion_tracking_setting.enhanced_conversions_for_leads_enabled

Packaging

  • "type": "module" with a single tsc build and an export map of types + default, so require("google-ads-api") keeps working on Node 22.12+ through require(esm) and returns the same module instance as import
  • tests/package.mjs asserts the require/import identity, and tests/package.cjs loads the package with a cold require() in its own process; arethetypeswrong runs with --profile esm-only
  • TypeScript CommonJS consumers need module: "nodenext" (TypeScript 5.8+) or "node20" (TypeScript 5.9+); node16 and node18 report TS1479
  • Jest in CommonJS mode needs ESM mode or a transform of google-ads-api, stream-json and stream-chain (ts-jest with allowJs and esModuleInterop); the changelog carries a config verified on Jest 29 and 30
  • CI also type-checks the generator scripts (tsc -p tsconfig.json); files excludes build/*.tsbuildinfo

Breaking changes

  • ES modules only and Node.js 22.12+ (see Packaging)
  • Mutate helpers for the ten single-operation services (customers, customerClientLinks, billingSetups…) take one resource instead of an array
  • Mutation hooks receive mutateOptions on every path; BaseMutationHookArgs requires it
  • Update helpers build the update mask from the plain object passed in: [] clears a repeated field, null clears a field, undefined leaves it alone (in mutateResources too), and a key that names no field reaches the API
  • queryStream, reportStream and reportStreamRaw take StreamRequestOptions / ReportStreamOptions; streams request summary rows with summary_row_setting; stream hooks receive ReportStreamOptions, query hooks keep ReportOptions
  • query and report send page_token and validate_only to search, and enforce max_reporting_rows on decoded rows; query hooks no longer write into the caller's options
  • REST results parse repeated enum and INT64 fields, keep enum names and numbers this version does not know, and take each field's type from its exact proto message (recommendation budget micros now parse as numbers)
  • REST errors become GoogleAdsFailures only when a detail's @type names one; every other REST failure surfaces as an Error with the API message (or the axios code and HTTP status) as cause, never the axios error
  • Paginated service methods return one page as the RPC response; long-running methods carry LROperation types
  • LocalServices getters now read localServicesLeads and localServicesEligibilities
  • ClientOptions["developer_token"] has the type string | undefined

Fixes

Test plan

  • yarn lint, tsc -p tsconfig.json, yarn test (276 tests) and yarn test:package on Node 22.23 and 24.21
  • arethetypeswrong --profile esm-only on the packed tarball; a fresh project loads the tarball through both require() and import
  • Each fix has a regression test that fails without it
  • Jest 29 and 30 consumers load the package with the changelog's transform and in ESM mode; TypeScript 5.9 consumers type-check under nodenext and node20
  • Publish 26.1.0-beta.0 under the beta dist-tag and test downstream
  • Update to google-ads-node 26.1.0 and version 26.1.0 after review
  • Publish 26.1.0 under the latest dist-tag

Lewis-Clayton and others added 20 commits November 5, 2026 16:21
stream-json <= 3.4.0 has a quadratic-time denial of service in its path
filters (GHSA-528h-pc64-c93x). This library only uses the parser and
streamArray, which are not affected, but every install still pulls in a
vulnerable stream-json 1.x and gets flagged for it.

stream-json 3 is ESM-only and changed its API:
- `new Parser(options)` becomes `parser.asStream(options)`, and
  `streamArray()` becomes `streamArray.asStream()`, imported from
  `stream-json/streamers/stream-array.js`.
- stream-chain, which customer.ts imports directly, is now declared
  (^4.2.6) instead of arriving through stream-json.
- The CJS build loads both packages with require(esm), which Node enables
  without a flag from 22.12, so engines moves from >=22 to >=22.12.
- Neither tsconfig resolves types through package `exports`, so
  src/stream-json.d.ts points the streamer subpath at its file.
- Jest compiles the two ESM packages to CommonJS for tests.

New tests pin the error path every failed query() takes
(handleStreamError): a GoogleAdsFailure with details, an API message
without details, and a non-JSON body. They pass unchanged on stream-json
1.9.1 and 3.7.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docs:
- README: move the note into the optional client settings list and
  correct it (an empty token is omitted too, not only an absent one);
  drop the token from the listAccessibleCustomers snippet
- examples/basic: drop the token from both runnable examples
- CHANGELOG: version the entry as 25.1.1, describe the empty-string
  behaviour accurately, and note the ClientOptions type change under
  Breaking Changes
- client.ts JSDoc: say empty behaves like unset
- service.ts: keep only the comment that justifies the truthiness check

Tests:
- callHeaders: keep login/linked customer ids in the fixture so an early
  return cannot pass, cover unset and empty tokens, use toStrictEqual
- request headers: assert the header on the outgoing REST request, with
  and without a token
… to search, and keep policy exemptions on default creates
…perations, and name LocalServices getters correctly
…n buffered queries, keep non-GoogleAdsFailure REST errors and numeric enums
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T09:49:28.862313Z
We couldn’t complete this review. Comment @codex review to try again.
348cf75 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

3 participants