@google-cloud/nodejs-common 2.5.1 → 2.6.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/package.json +14 -14
- package/src/apis/dfa_reporting.js +10 -10
- package/src/apis/display_video.js +3 -3
- package/src/apis/google_ads_api.js +3 -1
- package/src/apis/search_ads.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/nodejs-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
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,25 +16,25 @@
|
|
|
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": "^
|
|
20
|
-
"@google-cloud/bigquery": "^8.1.
|
|
19
|
+
"@google-cloud/aiplatform": "^6.0.0",
|
|
20
|
+
"@google-cloud/bigquery": "^8.1.1",
|
|
21
21
|
"@google-cloud/datastore": "^9.2.1",
|
|
22
|
-
"@google-cloud/firestore": "^
|
|
22
|
+
"@google-cloud/firestore": "^8.0.0",
|
|
23
23
|
"@google-cloud/logging-winston": "^6.0.1",
|
|
24
24
|
"@google-cloud/pubsub": "^5.2.0",
|
|
25
|
-
"@google-cloud/scheduler": "^5.
|
|
26
|
-
"@google-cloud/secret-manager": "^6.
|
|
27
|
-
"@google-cloud/storage": "^7.
|
|
28
|
-
"@grpc/grpc-js": "^1.
|
|
29
|
-
"gaxios": "^7.
|
|
30
|
-
"google-ads-nodejs-client": "
|
|
31
|
-
"google-auth-library": "^10.
|
|
32
|
-
"googleapis": "^
|
|
25
|
+
"@google-cloud/scheduler": "^5.3.1",
|
|
26
|
+
"@google-cloud/secret-manager": "^6.1.1",
|
|
27
|
+
"@google-cloud/storage": "^7.18.0",
|
|
28
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
29
|
+
"gaxios": "^7.1.3",
|
|
30
|
+
"google-ads-nodejs-client": "22.0.0",
|
|
31
|
+
"google-auth-library": "^10.5.0",
|
|
32
|
+
"googleapis": "^168.0.0",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
|
-
"winston": "^3.
|
|
34
|
+
"winston": "^3.19.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"jasmine": "^5.
|
|
37
|
+
"jasmine": "^5.13.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"test": "node node_modules/jasmine/bin/jasmine"
|
|
@@ -33,7 +33,7 @@ const API_SCOPES = Object.freeze([
|
|
|
33
33
|
'https://www.googleapis.com/auth/dfareporting',
|
|
34
34
|
'https://www.googleapis.com/auth/dfatrafficking',
|
|
35
35
|
]);
|
|
36
|
-
const API_VERSION = '
|
|
36
|
+
const API_VERSION = 'v5';
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Configuration for preparing conversions for Campaign Manager, includes:
|
|
@@ -41,8 +41,8 @@ const API_VERSION = 'v4';
|
|
|
41
41
|
* The 'idType' can be one of the values: 'encryptedUserId', 'gclid' or
|
|
42
42
|
* 'mobileDeviceId'.
|
|
43
43
|
* The 'operation' can be 'insert' or 'update'. The default value is 'insert'.
|
|
44
|
-
* 'insert' stands for https://developers.google.com/doubleclick-advertisers/rest/
|
|
45
|
-
* 'update' stands for https://developers.google.com/doubleclick-advertisers/rest/
|
|
44
|
+
* 'insert' stands for https://developers.google.com/doubleclick-advertisers/rest/v5/conversions/batchinsert
|
|
45
|
+
* 'update' stands for https://developers.google.com/doubleclick-advertisers/rest/v5/conversions/batchupdate
|
|
46
46
|
* For other properties, see
|
|
47
47
|
* https://developers.google.com/doubleclick-advertisers/guides/conversions_update
|
|
48
48
|
*
|
|
@@ -69,7 +69,7 @@ let ConversionsConfig;
|
|
|
69
69
|
/**
|
|
70
70
|
* List of properties that will be take from the data file as elements of a
|
|
71
71
|
* conversion.
|
|
72
|
-
* See https://developers.google.com/doubleclick-advertisers/rest/
|
|
72
|
+
* See https://developers.google.com/doubleclick-advertisers/rest/v5/Conversion
|
|
73
73
|
* @type {Array<string>}
|
|
74
74
|
*/
|
|
75
75
|
const PICKED_PROPERTIES = [
|
|
@@ -92,7 +92,7 @@ const IDENTIFIERS = [
|
|
|
92
92
|
|
|
93
93
|
const MAX_IDENTIFIERS_PER_USER = 5;
|
|
94
94
|
/**
|
|
95
|
-
* Google DfaReport API
|
|
95
|
+
* Google DfaReport API v5 stub.
|
|
96
96
|
* see https://developers.google.com/doubleclick-advertisers/service_accounts
|
|
97
97
|
*/
|
|
98
98
|
class DfaReporting extends GoogleApiClient {
|
|
@@ -164,7 +164,7 @@ class DfaReporting extends GoogleApiClient {
|
|
|
164
164
|
const operation =
|
|
165
165
|
config.operation === 'update' ? 'batchupdate' : 'batchinsert';
|
|
166
166
|
// customVariables is not supported by batchupdate.
|
|
167
|
-
// https://developers.google.com/doubleclick-advertisers/rest/
|
|
167
|
+
// https://developers.google.com/doubleclick-advertisers/rest/v5/Conversion#CustomFloodlightVariable
|
|
168
168
|
if (operation === 'batchupdate' &&
|
|
169
169
|
typeof config.customVariables !== 'undefined') {
|
|
170
170
|
this.logger.warn('customVariables is not supported by batchupdate');
|
|
@@ -252,9 +252,9 @@ class DfaReporting extends GoogleApiClient {
|
|
|
252
252
|
* ConversionStatus object. This function extras failed lines and error
|
|
253
253
|
* messages based on the 'errors'.
|
|
254
254
|
* For 'ConversionStatus', see:
|
|
255
|
-
* https://developers.google.com/doubleclick-advertisers/rest/
|
|
255
|
+
* https://developers.google.com/doubleclick-advertisers/rest/v5/ConversionStatus
|
|
256
256
|
* For 'ConversionError', see:
|
|
257
|
-
* https://developers.google.com/doubleclick-advertisers/rest/
|
|
257
|
+
* https://developers.google.com/doubleclick-advertisers/rest/v5/ConversionStatus#ConversionError
|
|
258
258
|
* @param {!BatchResult} batchResult
|
|
259
259
|
* @param {!Array<!Schema$ConversionStatus>} statuses
|
|
260
260
|
* @param {!Array<string>} lines The original input data.
|
|
@@ -324,7 +324,7 @@ class DfaReporting extends GoogleApiClient {
|
|
|
324
324
|
* has a relative date range, e.g. YESTERDAY. To solve this, if there are
|
|
325
325
|
* `startDate` and `endDate` available in the given `config`, they will be
|
|
326
326
|
* used to update the report before the report is started to run.
|
|
327
|
-
* @see https://developers.google.com/doubleclick-advertisers/rest/
|
|
327
|
+
* @see https://developers.google.com/doubleclick-advertisers/rest/v5/reports/run
|
|
328
328
|
*
|
|
329
329
|
* @param {{
|
|
330
330
|
* accountId:(string|undefined),
|
|
@@ -366,7 +366,7 @@ class DfaReporting extends GoogleApiClient {
|
|
|
366
366
|
* Returns file url from a report. If the report status is 'REPORT_AVAILABLE',
|
|
367
367
|
* then return the apiUrl from the response; if the status is 'PROCESSING' or
|
|
368
368
|
* 'QUEUED', returns undefined as it is unfinished; otherwise throws an error.
|
|
369
|
-
* @see https://developers.google.com/doubleclick-advertisers/rest/
|
|
369
|
+
* @see https://developers.google.com/doubleclick-advertisers/rest/v5/reports/get
|
|
370
370
|
*
|
|
371
371
|
* @param {{
|
|
372
372
|
* accountId:(string|undefined),
|
|
@@ -25,11 +25,11 @@ const { getLogger } = require('../components/utils.js');
|
|
|
25
25
|
const API_SCOPES = Object.freeze([
|
|
26
26
|
'https://www.googleapis.com/auth/display-video',
|
|
27
27
|
]);
|
|
28
|
-
const API_VERSION = '
|
|
28
|
+
const API_VERSION = 'v4';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Display and Video 360 API
|
|
32
|
-
* @see https://developers.google.com/display-video/api/reference/rest/
|
|
31
|
+
* Display and Video 360 API v4 stub.
|
|
32
|
+
* @see https://developers.google.com/display-video/api/reference/rest/v4
|
|
33
33
|
* This is not the same to Reports Display & Video 360 API which is from Google
|
|
34
34
|
* Bid Manager API.
|
|
35
35
|
* @see https://developers.google.com/bid-manager/reference/rest
|
|
@@ -238,6 +238,7 @@ const MAX_IDENTIFIERS = {
|
|
|
238
238
|
*
|
|
239
239
|
* @see https://developers.google.com/google-ads/api/reference/rpc/latest/ClickConversion
|
|
240
240
|
* @typedef {{
|
|
241
|
+
* jobId: (number|undefined),
|
|
241
242
|
* externalAttributionData: (GoogleAdsApi.ExternalAttributionData|undefined),
|
|
242
243
|
* cartData: (object|undefined),
|
|
243
244
|
* gclid: (string|undefined),
|
|
@@ -867,7 +868,7 @@ class GoogleAdsApi extends AuthRestfulApi {
|
|
|
867
868
|
* @return {!Promise<!UploadClickConversionsResponse>}
|
|
868
869
|
*/
|
|
869
870
|
async uploadClickConversions(lines, config) {
|
|
870
|
-
const { customerId, loginCustomerId } = config;
|
|
871
|
+
const { customerId, loginCustomerId, jobId } = config;
|
|
871
872
|
this.logger.debug('Upload click conversions for:', config);
|
|
872
873
|
const conversions = buildConversionJsonList(lines, config,
|
|
873
874
|
CONVERSION_FIELDS.CLICK, IDENTIFIERS.CLICK_CONVERSION, MAX_IDENTIFIERS.CONVERSION);
|
|
@@ -877,6 +878,7 @@ class GoogleAdsApi extends AuthRestfulApi {
|
|
|
877
878
|
const request = new UploadClickConversionsRequest({
|
|
878
879
|
conversions: clickConversions,
|
|
879
880
|
customerId,
|
|
881
|
+
jobId,
|
|
880
882
|
validateOnly: this.debugMode, // when true makes no changes
|
|
881
883
|
partialFailure: true, // Will still create the non-failed entities
|
|
882
884
|
});
|
package/src/apis/search_ads.js
CHANGED
|
@@ -90,7 +90,7 @@ class SearchAds extends GoogleApiClient {
|
|
|
90
90
|
* @param {string} query
|
|
91
91
|
* @param {object=} options Options for `SearchSearchAds360Request`.
|
|
92
92
|
* @see https://developers.google.com/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchsearchads360request
|
|
93
|
-
* @return {!
|
|
93
|
+
* @return {!SearchSearchAds360Response}
|
|
94
94
|
* @see https://developers.google.com/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchsearchads360response
|
|
95
95
|
*/
|
|
96
96
|
async getPaginatedReport(customerId, loginCustomerId, query, options = {}) {
|