@google-cloud/nodejs-common 1.5.6-beta → 1.5.8-beta
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/nodejs-common",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8-beta",
|
|
4
4
|
"description": "A NodeJs common library for solutions based on Cloud Functions",
|
|
5
5
|
"author": "Google Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -16,21 +16,21 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/GoogleCloudPlatform/cloud-for-marketing/blob/master/marketing-analytics/activation/common-libs/nodejs-common/README.md",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@google-cloud/aiplatform": "^2.
|
|
20
|
-
"@google-cloud/automl": "^3.1.
|
|
21
|
-
"@google-cloud/bigquery": "^6.0
|
|
22
|
-
"@google-cloud/datastore": "^7.
|
|
23
|
-
"@google-cloud/firestore": "^6.
|
|
24
|
-
"@google-cloud/logging-winston": "^5.
|
|
25
|
-
"@google-cloud/pubsub": "^3.
|
|
26
|
-
"@google-cloud/storage": "^6.
|
|
27
|
-
"@google-cloud/scheduler": "^3.0
|
|
28
|
-
"@google-cloud/secret-manager": "^4.
|
|
19
|
+
"@google-cloud/aiplatform": "^2.5.0",
|
|
20
|
+
"@google-cloud/automl": "^3.1.2",
|
|
21
|
+
"@google-cloud/bigquery": "^6.1.0",
|
|
22
|
+
"@google-cloud/datastore": "^7.1.0",
|
|
23
|
+
"@google-cloud/firestore": "^6.4.2",
|
|
24
|
+
"@google-cloud/logging-winston": "^5.3.0",
|
|
25
|
+
"@google-cloud/pubsub": "^3.3.0",
|
|
26
|
+
"@google-cloud/storage": "^6.9.2",
|
|
27
|
+
"@google-cloud/scheduler": "^3.2.0",
|
|
28
|
+
"@google-cloud/secret-manager": "^4.2.0",
|
|
29
29
|
"gaxios": "^5.0.2",
|
|
30
|
-
"google-ads-api": "^
|
|
31
|
-
"google-ads-node": "^
|
|
32
|
-
"google-auth-library": "^8.
|
|
33
|
-
"googleapis": "^
|
|
30
|
+
"google-ads-api": "^12.0.1",
|
|
31
|
+
"google-ads-node": "^10.0.0",
|
|
32
|
+
"google-auth-library": "^8.7.0",
|
|
33
|
+
"googleapis": "^110.0.0",
|
|
34
34
|
"winston": "^3.8.2",
|
|
35
35
|
"lodash": "^4.17.21"
|
|
36
36
|
},
|
package/src/apis/google_ads.js
CHANGED
|
@@ -123,34 +123,47 @@ class MeasurementProtocolGA4 {
|
|
|
123
123
|
let retriedTimes = 0;
|
|
124
124
|
let response;
|
|
125
125
|
while (retriedTimes <= RETRY_TIMES) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
try {
|
|
127
|
+
response = await request(requestOptions);
|
|
128
|
+
if (response.status < 500) break; // Only retry when server errors.
|
|
129
|
+
this.logger.warn('Got a 5XX error', response);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
this.logger.warn('Got an error', error);
|
|
132
|
+
if (retriedTimes === RETRY_TIMES) {
|
|
133
|
+
this.logger.error('Maximum retry times exceeded.');
|
|
134
|
+
batchResult.result = false;
|
|
135
|
+
batchResult.errors = [error.toString()];
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
129
139
|
retriedTimes++;
|
|
130
140
|
await wait(retriedTimes * 1000);
|
|
141
|
+
this.logger.warn('Will retry now...');
|
|
131
142
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (response.data.validationMessages.length === 0) {
|
|
149
|
-
batchResult.result = true;
|
|
143
|
+
if (response) {
|
|
144
|
+
this.logger.debug('Configuration:', config);
|
|
145
|
+
this.logger.debug('Input Data: ', lines);
|
|
146
|
+
this.logger.debug(`Batch[${batchId}] status: ${response.status}`);
|
|
147
|
+
this.logger.debug(response.data);
|
|
148
|
+
// There is not enough information from the non-debug mode.
|
|
149
|
+
if (!this.debugMode) {
|
|
150
|
+
if (response.status >= 200 && response.status < 300) {
|
|
151
|
+
batchResult.result = true;
|
|
152
|
+
} else {
|
|
153
|
+
batchResult.result = false;
|
|
154
|
+
const errorMessage =
|
|
155
|
+
`MP GA4 [${batchId}] http status ${response.status}.`;
|
|
156
|
+
this.logger.error(errorMessage, line);
|
|
157
|
+
batchResult.errors = [errorMessage];
|
|
158
|
+
}
|
|
150
159
|
} else {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
160
|
+
if (response.data.validationMessages.length === 0) {
|
|
161
|
+
batchResult.result = true;
|
|
162
|
+
} else {
|
|
163
|
+
batchResult.result = false;
|
|
164
|
+
batchResult.errors = response.data.validationMessages.map(
|
|
165
|
+
({ description }) => description);
|
|
166
|
+
}
|
|
154
167
|
}
|
|
155
168
|
}
|
|
156
169
|
if (!batchResult.result) {
|