Skip to content
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