Skip to content

Fix for new resources, fields & endpoints not working in v21 #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

### 21.0.0-
### 21.0.1

- Fixed issue with new v21 resources & fields not being correctly parsed.

### 21.0.0

### Version Upgrade

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-ads-api",
"version": "21.0.0",
"version": "21.0.1",
"description": "Google Ads API Client Library for Node.js",
"repository": "https://github.com/Opteo/google-ads-api",
"main": "build/src/index.js",
Expand Down
24 changes: 5 additions & 19 deletions scripts/resourceName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,13 @@ function buildResourceNameBuilder(stream: fs.WriteStream, text: Text): void {
export async function compileResourceNameFunctions(): Promise<void> {
const service = new CampaignServiceClient();

const pathTemplatesRaw = service.pathTemplates;
// @ts-expect-error
const pathTemplatesRaw: { [path: string]: Omit<PathTemplate, "path"> } =
service.pathTemplates;

const pathTemplates = Object.entries(pathTemplatesRaw).map(
([path, template]) => {
// Extract bindings from segments (public property)
const bindings: { [key: string]: string } = {};
template.segments.forEach((segment) => {
const match = segment.match(/\{([^=}]+)(?:=([^}]+))?\}/);
if (match) {
bindings[match[1]] = match[2] || "*";
}
});

// Use inspect() to get the template string
const data = template.inspect();

return {
path,
bindings,
data,
};
([path, template]: [string, Omit<PathTemplate, "path">]) => {
return { path, ...template };
}
);

Expand Down
Loading
Loading