@google-cloud/nodejs-common 1.4.9-alpha → 1.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/nodejs-common",
3
- "version": "1.4.9-alpha",
3
+ "version": "1.5.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",
@@ -34,7 +34,7 @@ const API_SCOPES = Object.freeze([
34
34
  'https://www.googleapis.com/auth/dfareporting',
35
35
  'https://www.googleapis.com/auth/dfatrafficking',
36
36
  ]);
37
- const API_VERSION = 'v3.5';
37
+ const API_VERSION = 'v4';
38
38
 
39
39
  /**
40
40
  * Configuration for preparing conversions for Campaign Manager, includes:
@@ -65,7 +65,7 @@ let InsertConversionsConfig;
65
65
  /**
66
66
  * List of properties that will be take from the data file as elements of a
67
67
  * conversion.
68
- * See https://developers.google.com/doubleclick-advertisers/rest/v3.5/Conversion
68
+ * See https://developers.google.com/doubleclick-advertisers/rest/v4/Conversion
69
69
  * @type {Array<string>}
70
70
  */
71
71
  const PICKED_PROPERTIES = [
@@ -216,9 +216,9 @@ class DfaReporting {
216
216
  * ConversionStatus object. This function extras failed lines and error
217
217
  * messages based on the 'errors'.
218
218
  * For 'ConversionStatus', see:
219
- * https://developers.google.com/doubleclick-advertisers/rest/v3.5/ConversionStatus
219
+ * https://developers.google.com/doubleclick-advertisers/rest/v4/ConversionStatus
220
220
  * For 'ConversionError', see:
221
- * https://developers.google.com/doubleclick-advertisers/rest/v3.5/ConversionStatus#ConversionError
221
+ * https://developers.google.com/doubleclick-advertisers/rest/v4/ConversionStatus#ConversionError
222
222
  * @param {!BatchResult} batchResult
223
223
  * @param {!Array<!Schema$ConversionStatus>} statuses
224
224
  * @param {!Array<string>} lines The original input data.
@@ -284,7 +284,7 @@ class DfaReporting {
284
284
  * Runs a report and return the file Id. As an asynchronized process, the
285
285
  * returned file Id will be a placeholder until the status changes to
286
286
  * 'REPORT_AVAILABLE' in the response of `getFile`.
287
- * @see https://developers.google.com/doubleclick-advertisers/rest/v3.5/reports/run
287
+ * @see https://developers.google.com/doubleclick-advertisers/rest/v4/reports/run
288
288
  *
289
289
  * @param {{
290
290
  * accountId:(string|undefined),
@@ -306,9 +306,9 @@ class DfaReporting {
306
306
 
307
307
  /**
308
308
  * Returns file url from a report. If the report status is 'REPORT_AVAILABLE',
309
- * then return the apiUrl from the response; if the status is 'PROCESSING',
310
- * returns undefined; otherwise throws an error.
311
- * @see https://developers.google.com/doubleclick-advertisers/rest/v3.5/reports/get
309
+ * then return the apiUrl from the response; if the status is 'PROCESSING' or
310
+ * 'QUEUED', returns undefined as it is unfinished; otherwise throws an error.
311
+ * @see https://developers.google.com/doubleclick-advertisers/rest/v4/reports/get
312
312
  *
313
313
  * @param {{
314
314
  * accountId:(string|undefined),
@@ -326,8 +326,8 @@ class DfaReporting {
326
326
  reportId: config.reportId,
327
327
  fileId: config.fileId,
328
328
  });
329
- const {data} = response;
330
- if (data.status === 'PROCESSING') return;
329
+ const { data } = response;
330
+ if (data.status === 'PROCESSING' || data.status === 'QUEUED') return;
331
331
  if (data.status === 'REPORT_AVAILABLE') return data.urls.apiUrl;
332
332
  throw new Error(`Unsupported report status: ${data.status}`);
333
333
  }