@google-cloud/nodejs-common 1.8.1-alpha → 1.9.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/README.md CHANGED
@@ -33,10 +33,10 @@ and [Data Tasks Coordinator]. This library includes:
33
33
 
34
34
  1. Utilities wrapper class for Google Cloud Products:
35
35
 
36
- - **Firestore Access Object**: Firestore has two modes which are excluded to
37
- each other and can't be changed once selected in a Cloud Project[[2]].
38
- This class, with its two successors offer a unified interface to operate
39
- data objects on either Firestore or Datastore.
36
+ - **Firestore Access Object**: Firestore has two modes[[comparison]] which
37
+ have different API. This class, with its two successors, offer a unified
38
+ interface to operate data objects within or not a transaction on either
39
+ Firestore Native mode or Firestore Datastore mode.
40
40
 
41
41
  - **AutoMl Tables API**: Offers a unified entry to use this API based on
42
42
  Google Cloud client library combined with REST requests to service
@@ -61,15 +61,14 @@ and [Data Tasks Coordinator]. This library includes:
61
61
  - **Cloud Scheduler Adapter**: A wrapper to pause and resume Cloud Scheduler
62
62
  jobs.
63
63
 
64
- - **Cloud Functions Adapter**: Cloud Functions have different parameters in
65
- different environments, e.g. Node6 vs Node8[[1]]. This utility file offers
64
+ - ~~**Cloud Functions Adapter**: Cloud Functions have different parameters in
65
+ different environments, e.g. Node6 vs Node8. This utility file offers
66
66
  an adapter to wrap a Node8 Cloud Functions into Node6 and Node8 compatible
67
- functions.
67
+ functions.~~ (This has been removed since v1.9.0)
68
68
 
69
69
  1. A share library for [Bash] to facilitate installation tasks.
70
70
 
71
71
  [gmp and google ads connector]: https://github.com/GoogleCloudPlatform/cloud-for-marketing/tree/master/marketing-analytics/activation/gmp-googleads-connector
72
72
  [data tasks coordinator]: https://github.com/GoogleCloudPlatform/cloud-for-marketing/tree/master/marketing-analytics/activation/data-tasks-coordinator
73
- [1]: https://cloud.google.com/functions/docs/writing/background#functions-writing-background-hello-pubsub-node8-10
74
- [2]: https://cloud.google.com/datastore/docs/concepts/overview#comparison_with_traditional_databases
73
+ [comparison]: https://cloud.google.com/datastore/docs/firestore-or-datastore
75
74
  [bash]: https://www.gnu.org/software/bash/
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
 
17
17
  # Cloud Functions Runtime Environment.
18
- CF_RUNTIME="${CF_RUNTIME:=nodejs14}"
18
+ CF_RUNTIME="${CF_RUNTIME:=nodejs18}"
19
19
  CF_MEMORY="${CF_MEMORY:=2048MB}"
20
20
 
21
21
  # Counter for steps.
@@ -1933,7 +1933,7 @@ check_firestore_existence() {
1933
1933
  local firestore mode appRegion
1934
1934
  mode="${1}"
1935
1935
  appRegion="${2}"
1936
- firestore=$(gcloud app describe --format="csv[no-heading](databaseType)")
1936
+ firestore=$(gcloud firestore databases list --format="csv[no-heading](databases.type)")
1937
1937
  if [[ -z "${firestore}" ]]; then
1938
1938
  printf '%s\n' "Firestore is not ready. Creating a new Firestore database\
1939
1939
  is an irreversible operation, so read carefully before continue:"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/nodejs-common",
3
- "version": "1.8.1-alpha",
3
+ "version": "1.9.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",
@@ -141,7 +141,7 @@ class DoubleClickBidManager {
141
141
  const { status } = await doubleclickbidmanager.queries.delete({ queryId });
142
142
  return status === 200;
143
143
  } catch (error) {
144
- console.error(error);
144
+ this.logger.error(error);
145
145
  return false;
146
146
  }
147
147
  }
@@ -81,6 +81,7 @@ class MeasurementProtocol {
81
81
  const path = (this.debugMode) ? '/debug/collect' : '/batch';
82
82
  const requestOptions = {
83
83
  method: 'POST',
84
+ responseType: 'json',
84
85
  url: `${BASE_URL}${path}`,
85
86
  body: payload,
86
87
  headers: {'User-Agent': 'Tentacles/MeasurementProtocol-v1'}