google-ads-api 21.0.2-beta.1 → 22.0.0-beta.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 +5 -5
- package/build/src/customer.js +14 -27
- package/build/src/protos/autogen/enums.d.ts +404 -353
- package/build/src/protos/autogen/enums.js +403 -348
- package/build/src/protos/autogen/fields.d.ts +152 -137
- package/build/src/protos/autogen/fields.js +10 -2
- package/build/src/protos/autogen/resourceNames.d.ts +26 -0
- package/build/src/protos/autogen/resourceNames.js +32 -0
- package/build/src/protos/autogen/serviceFactory.d.ts +222 -174
- package/build/src/protos/autogen/serviceFactory.js +663 -174
- package/build/src/protos/index.d.ts +6 -6
- package/build/src/protos/index.js +5 -5
- package/build/src/service.d.ts +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</p>
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="https://developers.google.com/google-ads/api/docs/release-notes">
|
|
10
|
-
<img src="https://img.shields.io/badge/google%20ads-
|
|
10
|
+
<img src="https://img.shields.io/badge/google%20ads-v22-009688.svg?style=flat-square">
|
|
11
11
|
</a>
|
|
12
12
|
<a href="https://www.npmjs.com/package/google-ads-api">
|
|
13
13
|
<img src="https://img.shields.io/npm/v/google-ads-api.svg?style=flat-square">
|
|
@@ -93,7 +93,7 @@ const customer = client.Customer({
|
|
|
93
93
|
|
|
94
94
|
## List accessible customers
|
|
95
95
|
|
|
96
|
-
This is a special client method for listing the accessible customers for a given refresh token, and is equivalent to [CustomerService.listAccessibleCustomers](https://developers.google.com/google-ads/api/reference/rpc/
|
|
96
|
+
This is a special client method for listing the accessible customers for a given refresh token, and is equivalent to [CustomerService.listAccessibleCustomers](https://developers.google.com/google-ads/api/reference/rpc/v22/CustomerService#listaccessiblecustomers). It returns the resource names of available customer accounts.
|
|
97
97
|
|
|
98
98
|
```ts
|
|
99
99
|
const client = new GoogleAdsApi({
|
|
@@ -385,7 +385,7 @@ const keyword = "24 hour locksmith harlem";
|
|
|
385
385
|
|
|
386
386
|
const operations: MutateOperation<
|
|
387
387
|
resources.IAdGroupCriterion & {
|
|
388
|
-
exempt_policy_violation_keys?: google.ads.googleads.
|
|
388
|
+
exempt_policy_violation_keys?: google.ads.googleads.v22.common.IPolicyViolationKey[];
|
|
389
389
|
}
|
|
390
390
|
>[] = [
|
|
391
391
|
{
|
|
@@ -671,9 +671,9 @@ const customer = client.Customer(
|
|
|
671
671
|
|
|
672
672
|
## Error handling
|
|
673
673
|
|
|
674
|
-
All errors, apart from GRPC specific cases (such as a connection problem or timeout, [see more here](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)), are instances of a [GoogleAdsFailure](https://developers.google.com/google-ads/api/reference/rpc/
|
|
674
|
+
All errors, apart from GRPC specific cases (such as a connection problem or timeout, [see more here](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)), are instances of a [GoogleAdsFailure](https://developers.google.com/google-ads/api/reference/rpc/v22/GoogleAdsFailure).
|
|
675
675
|
|
|
676
|
-
You can find a list of all error types for a specific version in [the official documentation](https://developers.google.com/google-ads/api/reference/rpc/
|
|
676
|
+
You can find a list of all error types for a specific version in [the official documentation](https://developers.google.com/google-ads/api/reference/rpc/v22/AccessInvitationErrorEnum.AccessInvitationError), as well as more information about [handling errors here](https://developers.google.com/google-ads/api/docs/best-practices/error-types).
|
|
677
677
|
|
|
678
678
|
```ts
|
|
679
679
|
import { errors } from "google-ads-api";
|
package/build/src/customer.js
CHANGED
|
@@ -335,35 +335,22 @@ class Customer extends serviceFactory_1.default {
|
|
|
335
335
|
packValues: true,
|
|
336
336
|
packKeys: true,
|
|
337
337
|
});
|
|
338
|
-
const
|
|
339
|
-
const pipeline = (0, stream_chain_1.chain)([stream, parser, streamArrayInstance]);
|
|
338
|
+
const pipeline = (0, stream_chain_1.chain)([stream, parser, (0, StreamArray_1.streamArray)()]);
|
|
340
339
|
let count = 0;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
yield parsed;
|
|
355
|
-
}
|
|
356
|
-
// Clear references to help GC
|
|
357
|
-
data.value = null;
|
|
358
|
-
data.key = null;
|
|
340
|
+
for await (const data of pipeline) {
|
|
341
|
+
const results = data.value.results ??
|
|
342
|
+
(data.value.summaryRow ? [data.value.summaryRow] : undefined) ??
|
|
343
|
+
[];
|
|
344
|
+
count += results.length;
|
|
345
|
+
if (this.clientOptions.max_reporting_rows &&
|
|
346
|
+
count > this.clientOptions.max_reporting_rows &&
|
|
347
|
+
!this.gaqlQueryStringIncludesLimit(gaqlQuery)) {
|
|
348
|
+
throw this.generateTooManyRowsError();
|
|
349
|
+
}
|
|
350
|
+
for (const row of results) {
|
|
351
|
+
const parsed = this.decamelizeKeysIfNeeded(row);
|
|
352
|
+
yield parsed;
|
|
359
353
|
}
|
|
360
|
-
}
|
|
361
|
-
finally {
|
|
362
|
-
// Always destroy all components to prevent memory leaks
|
|
363
|
-
pipeline.destroy();
|
|
364
|
-
parser.destroy();
|
|
365
|
-
streamArrayInstance.destroy();
|
|
366
|
-
stream.destroy();
|
|
367
354
|
}
|
|
368
355
|
return;
|
|
369
356
|
}
|