google-ads-api 21.0.0 → 21.0.2-beta.1
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/build/src/customer.js +27 -14
- package/build/src/protos/autogen/fields.d.ts +219 -171
- package/build/src/protos/autogen/fields.js +20 -2
- package/build/src/protos/autogen/resourceNames.d.ts +57 -0
- package/build/src/protos/autogen/resourceNames.js +69 -0
- package/build/src/protos/autogen/serviceFactory.d.ts +184 -171
- package/build/src/protos/autogen/serviceFactory.js +305 -171
- package/package.json +1 -1
package/build/src/customer.js
CHANGED
|
@@ -335,23 +335,36 @@ class Customer extends serviceFactory_1.default {
|
|
|
335
335
|
packValues: true,
|
|
336
336
|
packKeys: true,
|
|
337
337
|
});
|
|
338
|
-
const
|
|
338
|
+
const streamArrayInstance = (0, StreamArray_1.streamArray)();
|
|
339
|
+
const pipeline = (0, stream_chain_1.chain)([stream, parser, streamArrayInstance]);
|
|
339
340
|
let count = 0;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
341
|
+
try {
|
|
342
|
+
for await (const data of pipeline) {
|
|
343
|
+
const results = data.value.results ??
|
|
344
|
+
(data.value.summaryRow ? [data.value.summaryRow] : undefined) ??
|
|
345
|
+
[];
|
|
346
|
+
count += results.length;
|
|
347
|
+
if (this.clientOptions.max_reporting_rows &&
|
|
348
|
+
count > this.clientOptions.max_reporting_rows &&
|
|
349
|
+
!this.gaqlQueryStringIncludesLimit(gaqlQuery)) {
|
|
350
|
+
throw this.generateTooManyRowsError();
|
|
351
|
+
}
|
|
352
|
+
for (const row of results) {
|
|
353
|
+
const parsed = this.decamelizeKeysIfNeeded(row);
|
|
354
|
+
yield parsed;
|
|
355
|
+
}
|
|
356
|
+
// Clear references to help GC
|
|
357
|
+
data.value = null;
|
|
358
|
+
data.key = null;
|
|
353
359
|
}
|
|
354
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
|
+
}
|
|
355
368
|
return;
|
|
356
369
|
}
|
|
357
370
|
catch (e) {
|