Skip to content

Commit 5639e60

Browse files
authored
Merge pull request #523 from Opteo/fix-missing-new-fields-in-v21
Fix for new resources, fields & endpoints not working in v21
2 parents 79a7482 + e2a8b8d commit 5639e60

6 files changed

Lines changed: 5137 additions & 869 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
### 21.0.0-
3+
### 21.0.1
4+
5+
- Fixed issue with new v21 resources & fields not being correctly parsed.
6+
7+
### 21.0.0
48

59
### Version Upgrade
610

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "google-ads-api",
3-
"version": "21.0.0",
3+
"version": "21.0.1",
44
"description": "Google Ads API Client Library for Node.js",
55
"repository": "https://github.com/Opteo/google-ads-api",
66
"main": "build/src/index.js",

scripts/resourceName.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,13 @@ function buildResourceNameBuilder(stream: fs.WriteStream, text: Text): void {
102102
export async function compileResourceNameFunctions(): Promise<void> {
103103
const service = new CampaignServiceClient();
104104

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

107109
const pathTemplates = Object.entries(pathTemplatesRaw).map(
108-
([path, template]) => {
109-
// Extract bindings from segments (public property)
110-
const bindings: { [key: string]: string } = {};
111-
template.segments.forEach((segment) => {
112-
const match = segment.match(/\{([^=}]+)(?:=([^}]+))?\}/);
113-
if (match) {
114-
bindings[match[1]] = match[2] || "*";
115-
}
116-
});
117-
118-
// Use inspect() to get the template string
119-
const data = template.inspect();
120-
121-
return {
122-
path,
123-
bindings,
124-
data,
125-
};
110+
([path, template]: [string, Omit<PathTemplate, "path">]) => {
111+
return { path, ...template };
126112
}
127113
);
128114

0 commit comments

Comments
 (0)