@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.6-beta",
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.3.0",
20
- "@google-cloud/automl": "^3.1.0",
21
- "@google-cloud/bigquery": "^6.0.3",
22
- "@google-cloud/datastore": "^7.0.0",
23
- "@google-cloud/firestore": "^6.3.0",
24
- "@google-cloud/logging-winston": "^5.1.5",
25
- "@google-cloud/pubsub": "^3.2.0",
26
- "@google-cloud/storage": "^6.5.2",
27
- "@google-cloud/scheduler": "^3.0.4",
28
- "@google-cloud/secret-manager": "^4.1.3",
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": "^11.1.0",
31
- "google-ads-node": "^9.1.0",
32
- "google-auth-library": "^8.5.2",
33
- "googleapis": "^108.0.0",
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
  },
@@ -77,6 +77,8 @@ const PICKED_PROPERTIES = [
77
77
  'external_attribution_data',
78
78
  'cart_data',
79
79
  'user_identifiers',
80
+ 'gbraid',
81
+ 'wbraid',
80
82
  'gclid',
81
83
  'caller_id',
82
84
  'call_start_date_time',
@@ -123,34 +123,47 @@ class MeasurementProtocolGA4 {
123
123
  let retriedTimes = 0;
124
124
  let response;
125
125
  while (retriedTimes <= RETRY_TIMES) {
126
- response = await request(requestOptions);
127
- if (response.status < 500) break; // Only retry when server errors.
128
- this.logger.warn('Got an 5XX error', response);
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
- this.logger.debug('Configuration:', config);
133
- this.logger.debug('Input Data: ', lines);
134
- this.logger.debug(`Batch[${batchId}] status: ${response.status}`);
135
- this.logger.debug(response.data);
136
- // There is not enough information from the non-debug mode.
137
- if (!this.debugMode) {
138
- if (response.status >= 200 && response.status < 300) {
139
- batchResult.result = true;
140
- } else {
141
- batchResult.result = false;
142
- const errorMessage =
143
- `MP GA4 [${batchId}] http status ${response.status}.`;
144
- this.logger.error(errorMessage, line);
145
- batchResult.errors = [errorMessage];
146
- }
147
- } else {
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
- batchResult.result = false;
152
- batchResult.errors = response.data.validationMessages.map(
153
- ({ description }) => description);
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) {
@@ -115,6 +115,7 @@ class DatastoreModeAccess {
115
115
  .save({
116
116
  key: key,
117
117
  data: data,
118
+ excludeLargeProperties: true,
118
119
  })
119
120
  .then((apiResponse) => {
120
121
  // Default key in Datastore is a number in response like following.