google-ads-api 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -20
- package/build/src/customer.js +11 -11
- package/build/src/index.js +5 -1
- package/build/src/parser.js +1 -1
- package/build/src/protos/autogen/enums.d.ts +505 -340
- package/build/src/protos/autogen/enums.js +505 -336
- package/build/src/protos/autogen/fields.d.ts +136 -105
- package/build/src/protos/autogen/fields.js +19 -3
- package/build/src/protos/autogen/resourceNames.d.ts +33 -8
- package/build/src/protos/autogen/resourceNames.js +45 -14
- package/build/src/protos/autogen/serviceFactory.d.ts +184 -185
- package/build/src/protos/autogen/serviceFactory.js +598 -710
- package/build/src/protos/index.d.ts +6 -6
- package/build/src/protos/index.js +5 -5
- package/build/src/service.js +7 -7
- package/build/src/testUtils.js +5 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/package.json +6 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import allProtos, { protos } from "google-ads-node";
|
|
2
|
-
export declare const VERSION: "
|
|
3
|
-
export import common = protos.google.ads.googleads.
|
|
4
|
-
export import errors = protos.google.ads.googleads.
|
|
5
|
-
export import resources = protos.google.ads.googleads.
|
|
6
|
-
export import services = protos.google.ads.googleads.
|
|
7
|
-
export import internalEnums = protos.google.ads.googleads.
|
|
2
|
+
export declare const VERSION: "v12";
|
|
3
|
+
export import common = protos.google.ads.googleads.v12.common;
|
|
4
|
+
export import errors = protos.google.ads.googleads.v12.errors;
|
|
5
|
+
export import resources = protos.google.ads.googleads.v12.resources;
|
|
6
|
+
export import services = protos.google.ads.googleads.v12.services;
|
|
7
|
+
export import internalEnums = protos.google.ads.googleads.v12.enums;
|
|
8
8
|
export { enums } from "./autogen/enums";
|
|
9
9
|
export { fields } from "./autogen/fields";
|
|
10
10
|
export { GoogleAdsServiceClient } from "google-ads-node";
|
|
@@ -7,12 +7,12 @@ const version_1 = require("../version");
|
|
|
7
7
|
exports.VERSION = version_1.googleAdsVersion;
|
|
8
8
|
// -- Expose the googleads generated types --
|
|
9
9
|
// The namespace path is shortened for ease of use
|
|
10
|
-
exports.common = google_ads_node_1.protos.google.ads.googleads.
|
|
11
|
-
exports.errors = google_ads_node_1.protos.google.ads.googleads.
|
|
12
|
-
exports.resources = google_ads_node_1.protos.google.ads.googleads.
|
|
13
|
-
exports.services = google_ads_node_1.protos.google.ads.googleads.
|
|
10
|
+
exports.common = google_ads_node_1.protos.google.ads.googleads.v12.common;
|
|
11
|
+
exports.errors = google_ads_node_1.protos.google.ads.googleads.v12.errors;
|
|
12
|
+
exports.resources = google_ads_node_1.protos.google.ads.googleads.v12.resources;
|
|
13
|
+
exports.services = google_ads_node_1.protos.google.ads.googleads.v12.services;
|
|
14
14
|
// We compile enums ourselves, the Google ones should be used internally only
|
|
15
|
-
exports.internalEnums = google_ads_node_1.protos.google.ads.googleads.
|
|
15
|
+
exports.internalEnums = google_ads_node_1.protos.google.ads.googleads.v12.enums;
|
|
16
16
|
var enums_1 = require("./autogen/enums");
|
|
17
17
|
Object.defineProperty(exports, "enums", { enumerable: true, get: function () { return enums_1.enums; } });
|
|
18
18
|
var fields_1 = require("./autogen/fields");
|
package/build/src/service.js
CHANGED
|
@@ -71,13 +71,13 @@ class Service {
|
|
|
71
71
|
return googleAdsFailure;
|
|
72
72
|
}
|
|
73
73
|
decodePartialFailureError(response) {
|
|
74
|
-
var _a
|
|
75
|
-
if (typeof (
|
|
76
|
-
!(
|
|
74
|
+
var _a;
|
|
75
|
+
if (typeof (response === null || response === void 0 ? void 0 : response.partial_failure_error) === "undefined" ||
|
|
76
|
+
!(response === null || response === void 0 ? void 0 : response.partial_failure_error)) {
|
|
77
77
|
return response;
|
|
78
78
|
}
|
|
79
79
|
const { details } = response.partial_failure_error;
|
|
80
|
-
const buffer = (
|
|
80
|
+
const buffer = (_a = details === null || details === void 0 ? void 0 : details.find((d) => d.type_url.includes("errors.GoogleAdsFailure"))) === null || _a === void 0 ? void 0 : _a.value;
|
|
81
81
|
if (typeof buffer === "undefined") {
|
|
82
82
|
return response;
|
|
83
83
|
}
|
|
@@ -109,13 +109,13 @@ class Service {
|
|
|
109
109
|
const service = this.loadService("GoogleAdsServiceClient");
|
|
110
110
|
const mutateOperations = mutations.map((mutation) => {
|
|
111
111
|
var _a;
|
|
112
|
-
const opKey = utils_1.toSnakeCase(`${mutation.entity}Operation`);
|
|
112
|
+
const opKey = (0, utils_1.toSnakeCase)(`${mutation.entity}Operation`);
|
|
113
113
|
const operation = {
|
|
114
114
|
[(_a = mutation.operation) !== null && _a !== void 0 ? _a : "create"]: mutation.resource,
|
|
115
115
|
};
|
|
116
116
|
if (mutation.operation === "update") {
|
|
117
117
|
// @ts-expect-error Resource operations should have updateMask defined
|
|
118
|
-
operation.update_mask = utils_1.getFieldMask(mutation.resource);
|
|
118
|
+
operation.update_mask = (0, utils_1.getFieldMask)(mutation.resource);
|
|
119
119
|
}
|
|
120
120
|
const mutateOperation = new protos_1.services.MutateOperation({
|
|
121
121
|
[opKey]: operation,
|
|
@@ -137,7 +137,7 @@ class Service {
|
|
|
137
137
|
};
|
|
138
138
|
if (type === "update") {
|
|
139
139
|
// @ts-expect-error Field required for updates
|
|
140
|
-
op.update_mask = utils_1.getFieldMask(
|
|
140
|
+
op.update_mask = (0, utils_1.getFieldMask)(
|
|
141
141
|
// @ts-expect-error Message types have a toObject method
|
|
142
142
|
message.toObject(e, {
|
|
143
143
|
defaults: false,
|
package/build/src/testUtils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/build/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const googleAdsVersion = "
|
|
1
|
+
export declare const googleAdsVersion = "v12";
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-ads-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Google Ads API Client Library for Node.js",
|
|
5
5
|
"repository": "https://github.com/Opteo/google-ads-api",
|
|
6
6
|
"main": "build/src/index.js",
|
|
@@ -17,19 +17,20 @@
|
|
|
17
17
|
"author": "Opteo",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"google-ads-node": "^
|
|
20
|
+
"google-ads-node": "^10.0.0",
|
|
21
21
|
"google-auth-library": "^7.1.0",
|
|
22
|
-
"google-gax": "^3.
|
|
22
|
+
"google-gax": "^3.5.2",
|
|
23
23
|
"long": "^4.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@types/jest": "^29.0.1",
|
|
26
27
|
"@types/pluralize": "^0.0.29",
|
|
27
28
|
"@typescript-eslint/eslint-plugin": "^4.8.2",
|
|
28
29
|
"@typescript-eslint/parser": "^4.8.2",
|
|
29
30
|
"eslint": "^7.14.0",
|
|
30
|
-
"jest": "^
|
|
31
|
+
"jest": "^29.0.3",
|
|
31
32
|
"pluralize": "^8.0.0",
|
|
32
|
-
"ts-jest": "^
|
|
33
|
+
"ts-jest": "^29.0.0",
|
|
33
34
|
"typescript": "^4.1.2"
|
|
34
35
|
},
|
|
35
36
|
"keywords": [
|