From 4be59cf999148e6a925dcc6a71635fedfc3a3955 Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Fri, 14 Dec 2018 12:36:39 -0500 Subject: [PATCH] fix(deps): update dependency @google-cloud/bigquery to v2 Fixes: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/pull/949 --- functions/sendgrid/index.js | 3 ++- functions/sendgrid/package.json | 16 ++++++++-------- functions/sendgrid/test/index.test.js | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/functions/sendgrid/index.js b/functions/sendgrid/index.js index 6faa6f07202..af68d0050ca 100644 --- a/functions/sendgrid/index.js +++ b/functions/sendgrid/index.js @@ -24,7 +24,8 @@ const uuid = require('uuid'); // Get a reference to the Cloud Storage component const storage = require('@google-cloud/storage')(); // Get a reference to the BigQuery component -const bigquery = require('@google-cloud/bigquery')(); +const {BigQuery} = require('@google-cloud/bigquery'); +const bigquery = new BigQuery(); // [END functions_sendgrid_setup] // [START functions_sendgrid_get_client] diff --git a/functions/sendgrid/package.json b/functions/sendgrid/package.json index afe22ab1e02..39fbece3de1 100644 --- a/functions/sendgrid/package.json +++ b/functions/sendgrid/package.json @@ -15,17 +15,17 @@ "test": "ava -T 20s --verbose test/*.test.js" }, "dependencies": { - "@google-cloud/bigquery": "0.12.0", - "@google-cloud/storage": "1.7.0", - "safe-buffer": "5.1.2", - "sendgrid": "5.2.3", - "uuid": "3.3.2" + "@google-cloud/bigquery": "^2.0.0", + "@google-cloud/storage": "^1.7.0", + "safe-buffer": "^5.1.2", + "sendgrid": "^5.2.3", + "uuid": "^3.3.2" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.0", - "ava": "0.25.0", - "proxyquire": "2.1.0", - "sinon": "4.0.2" + "ava": "^0.25.0", + "proxyquire": "^2.1.0", + "sinon": "^4.0.2" }, "cloud-repo-tools": { "requiresKeyFile": true, diff --git a/functions/sendgrid/test/index.test.js b/functions/sendgrid/test/index.test.js index bfa46cfbb28..01bab46d16e 100644 --- a/functions/sendgrid/test/index.test.js +++ b/functions/sendgrid/test/index.test.js @@ -92,7 +92,7 @@ function getSample() { return { program: proxyquire(`../`, { sendgrid: sendgrid, - '@google-cloud/bigquery': BigQueryMock, + '@google-cloud/bigquery': {BigQuery: BigQueryMock}, '@google-cloud/storage': StorageMock, './config.json': config, uuid: uuid,