From a07d4c1de0851674c718c94364e225547c3f8974 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 14 Dec 2018 18:26:10 +0000 Subject: [PATCH] chore(deps): update dependency @google-cloud/storage to v2 Fixes: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/979 --- appengine/storage/flexible/app.js | 4 ++-- appengine/storage/flexible/package.json | 2 +- appengine/storage/flexible/system-test/app.test.js | 4 ++-- appengine/storage/standard/app.js | 4 ++-- appengine/storage/standard/package.json | 2 +- appengine/storage/standard/system-test/app.test.js | 4 ++-- functions/gcs/index.js | 4 ++-- functions/gcs/package.json | 2 +- functions/gcs/test/index.test.js | 2 +- functions/helloworld/package.json | 2 +- functions/helloworld/test/sample.system.storage.test.js | 4 ++-- functions/http/index.js | 3 ++- functions/http/package.json | 2 +- functions/imagemagick/index.js | 3 ++- functions/imagemagick/package.json | 2 +- functions/imagemagick/test/index.test.js | 2 +- functions/ocr/app/index.js | 3 ++- functions/ocr/app/package.json | 2 +- functions/ocr/app/test/index.test.js | 2 +- functions/sendgrid/package.json | 2 +- package.json | 2 +- storage-transfer/package.json | 2 +- storage-transfer/system-test/transfer.test.js | 3 ++- 23 files changed, 33 insertions(+), 29 deletions(-) diff --git a/appengine/storage/flexible/app.js b/appengine/storage/flexible/app.js index 035d6bb0a86..33256cbe258 100644 --- a/appengine/storage/flexible/app.js +++ b/appengine/storage/flexible/app.js @@ -28,10 +28,10 @@ const bodyParser = require('body-parser'); // the project specified by the GOOGLE_CLOUD_PROJECT environment variable. See // https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/docs/authentication.md // These environment variables are set automatically on Google App Engine -const Storage = require('@google-cloud/storage'); +const {Storage} = require('@google-cloud/storage'); // Instantiate a storage client -const storage = Storage(); +const storage = new Storage(); const app = express(); app.set('view engine', 'pug'); diff --git a/appengine/storage/flexible/package.json b/appengine/storage/flexible/package.json index 7de22ed17d9..46e3a01341a 100644 --- a/appengine/storage/flexible/package.json +++ b/appengine/storage/flexible/package.json @@ -9,7 +9,7 @@ "node": ">=8.0.0" }, "dependencies": { - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "body-parser": "1.18.2", "express": "4.16.4", "multer": "1.4.1", diff --git a/appengine/storage/flexible/system-test/app.test.js b/appengine/storage/flexible/system-test/app.test.js index 339956b5d21..2a95f67ce32 100644 --- a/appengine/storage/flexible/system-test/app.test.js +++ b/appengine/storage/flexible/system-test/app.test.js @@ -14,8 +14,8 @@ 'use strict'; const path = require(`path`); -const Storage = require(`@google-cloud/storage`); -const storage = Storage(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const test = require(`ava`); const utils = require(`@google-cloud/nodejs-repo-tools`); diff --git a/appengine/storage/standard/app.js b/appengine/storage/standard/app.js index 45485f4d579..66bee978693 100644 --- a/appengine/storage/standard/app.js +++ b/appengine/storage/standard/app.js @@ -28,10 +28,10 @@ const bodyParser = require('body-parser'); // the project specified by the GOOGLE_CLOUD_PROJECT environment variable. See // https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/docs/authentication.md // These environment variables are set automatically on Google App Engine -const Storage = require('@google-cloud/storage'); +const {Storage} = require('@google-cloud/storage'); // Instantiate a storage client -const storage = Storage(); +const storage = new Storage(); const app = express(); app.set('view engine', 'pug'); diff --git a/appengine/storage/standard/package.json b/appengine/storage/standard/package.json index 34de17ebca6..ced4c878f4e 100644 --- a/appengine/storage/standard/package.json +++ b/appengine/storage/standard/package.json @@ -9,7 +9,7 @@ "node": ">=8" }, "dependencies": { - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "body-parser": "1.18.2", "express": "4.16.4", "multer": "1.4.1", diff --git a/appengine/storage/standard/system-test/app.test.js b/appengine/storage/standard/system-test/app.test.js index 339956b5d21..2a95f67ce32 100644 --- a/appengine/storage/standard/system-test/app.test.js +++ b/appengine/storage/standard/system-test/app.test.js @@ -14,8 +14,8 @@ 'use strict'; const path = require(`path`); -const Storage = require(`@google-cloud/storage`); -const storage = Storage(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const test = require(`ava`); const utils = require(`@google-cloud/nodejs-repo-tools`); diff --git a/functions/gcs/index.js b/functions/gcs/index.js index 4c855d65636..b0e31f18e84 100644 --- a/functions/gcs/index.js +++ b/functions/gcs/index.js @@ -16,11 +16,11 @@ 'use strict'; // [START functions_word_count_setup] -const Storage = require('@google-cloud/storage'); +const {Storage} = require('@google-cloud/storage'); const readline = require('readline'); // Instantiates a client -const storage = Storage(); +const storage = new Storage(); // [END functions_word_count_setup] function getFileStream(file) { diff --git a/functions/gcs/package.json b/functions/gcs/package.json index 7827205e795..1df976da388 100644 --- a/functions/gcs/package.json +++ b/functions/gcs/package.json @@ -15,7 +15,7 @@ "test": "ava -T 20s --verbose test/*.test.js" }, "dependencies": { - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "request": "2.88.0" }, "devDependencies": { diff --git a/functions/gcs/test/index.test.js b/functions/gcs/test/index.test.js index 10f3ad66319..6e85198697b 100644 --- a/functions/gcs/test/index.test.js +++ b/functions/gcs/test/index.test.js @@ -38,7 +38,7 @@ function getSample() { return { program: proxyquire(`../`, { - '@google-cloud/storage': StorageMock, + '@google-cloud/storage': {Storage: StorageMock}, }), mocks: { Storage: StorageMock, diff --git a/functions/helloworld/package.json b/functions/helloworld/package.json index be14cebe978..4f35159c00b 100644 --- a/functions/helloworld/package.json +++ b/functions/helloworld/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.2.5", "@google-cloud/pubsub": "^0.22.0", - "@google-cloud/storage": "^1.5.0", + "@google-cloud/storage": "^2.0.0", "ava": "0.25.0", "express": "^4.16.3", "proxyquire": "2.1.0", diff --git a/functions/helloworld/test/sample.system.storage.test.js b/functions/helloworld/test/sample.system.storage.test.js index 110cd069db7..180470fc757 100644 --- a/functions/helloworld/test/sample.system.storage.test.js +++ b/functions/helloworld/test/sample.system.storage.test.js @@ -14,8 +14,8 @@ */ // [START functions_storage_system_test] -const Storage = require(`@google-cloud/storage`); -const storage = Storage(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const uuid = require(`uuid`); const test = require(`ava`); const path = require(`path`); diff --git a/functions/http/index.js b/functions/http/index.js index b7c0ef6f94c..45b6b175638 100644 --- a/functions/http/index.js +++ b/functions/http/index.js @@ -194,7 +194,8 @@ exports.uploadFile = (req, res) => { // [END functions_http_form_data] // [START functions_http_signed_url] -const storage = require('@google-cloud/storage')(); +const {Storage} = require('@google-cloud/storage'); +const storage = new Storage(); /** * HTTP function that generates a signed URL diff --git a/functions/http/package.json b/functions/http/package.json index d475eb752a9..c09fd2ed6ee 100644 --- a/functions/http/package.json +++ b/functions/http/package.json @@ -21,7 +21,7 @@ "sinon": "4.4.2" }, "dependencies": { - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "busboy": "^0.2.14", "escape-html": "^1.0.3", "safe-buffer": "5.1.2" diff --git a/functions/imagemagick/index.js b/functions/imagemagick/index.js index 7cfd2c2002f..a174e580471 100644 --- a/functions/imagemagick/index.js +++ b/functions/imagemagick/index.js @@ -19,7 +19,8 @@ const gm = require('gm').subClass({imageMagick: true}); const fs = require('fs'); const path = require('path'); -const storage = require('@google-cloud/storage')(); +const {Storage} = require('@google-cloud/storage'); +const storage = new Storage(); const vision = require('@google-cloud/vision').v1p1beta1; const client = new vision.ImageAnnotatorClient(); diff --git a/functions/imagemagick/package.json b/functions/imagemagick/package.json index 442f38482f9..59c18afec6d 100644 --- a/functions/imagemagick/package.json +++ b/functions/imagemagick/package.json @@ -15,7 +15,7 @@ "test": "ava -T 20s --verbose test/*.test.js" }, "dependencies": { - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "@google-cloud/vision": "0.23.0", "gm": "^1.23.1" }, diff --git a/functions/imagemagick/test/index.test.js b/functions/imagemagick/test/index.test.js index d456667b186..217923d0b52 100644 --- a/functions/imagemagick/test/index.test.js +++ b/functions/imagemagick/test/index.test.js @@ -68,7 +68,7 @@ function getSample(filename) { return { program: proxyquire(`../`, { - '@google-cloud/storage': StorageMock, + '@google-cloud/storage': {Storage: StorageMock}, gm: gmMock, fs: fsMock, }), diff --git a/functions/ocr/app/index.js b/functions/ocr/app/index.js index 01c7dd04cd9..5cf900010f7 100644 --- a/functions/ocr/app/index.js +++ b/functions/ocr/app/index.js @@ -22,7 +22,8 @@ const config = require('./config.json'); const {PubSub} = require('@google-cloud/pubsub'); const pubsub = new PubSub(); // Get a reference to the Cloud Storage component -const storage = require('@google-cloud/storage')(); +const {Storage} = require('@google-cloud/storage'); +const storage = new Storage(); // Get a reference to the Cloud Vision API component const vision = require('@google-cloud/vision')(); // Get a reference to the Translate API component diff --git a/functions/ocr/app/package.json b/functions/ocr/app/package.json index 5d2ae56ee05..aa6c148c04b 100644 --- a/functions/ocr/app/package.json +++ b/functions/ocr/app/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/pubsub": "0.22.2", - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "@google-cloud/translate": "2.1.3", "@google-cloud/vision": "0.23.0", "safe-buffer": "5.1.2" diff --git a/functions/ocr/app/test/index.test.js b/functions/ocr/app/test/index.test.js index 539adc81218..ebdd0cba28c 100644 --- a/functions/ocr/app/test/index.test.js +++ b/functions/ocr/app/test/index.test.js @@ -71,7 +71,7 @@ function getSample() { '@google-cloud/translate': {Translate: TranslateMock}, '@google-cloud/vision': VisionMock, '@google-cloud/pubsub': {PubSub: PubsubMock}, - '@google-cloud/storage': StorageMock, + '@google-cloud/storage': {Storage: StorageMock}, './config.json': config, }), mocks: { diff --git a/functions/sendgrid/package.json b/functions/sendgrid/package.json index 39fbece3de1..ba2407eef65 100644 --- a/functions/sendgrid/package.json +++ b/functions/sendgrid/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/bigquery": "^2.0.0", - "@google-cloud/storage": "^1.7.0", + "@google-cloud/storage": "^2.3.1", "safe-buffer": "^5.1.2", "sendgrid": "^5.2.3", "uuid": "^3.3.2" diff --git a/package.json b/package.json index 257806921fe..277b2700e14 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.6", - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "ava": "0.25.0", "eslint": "^5.9.0", "eslint-config-prettier": "^3.3.0", diff --git a/storage-transfer/package.json b/storage-transfer/package.json index 5ef103bab8a..f4b62b61d76 100644 --- a/storage-transfer/package.json +++ b/storage-transfer/package.json @@ -26,7 +26,7 @@ "ava": "0.25.0", "proxyquire": "2.1.0", "sinon": "4.4.8", - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.1", "uuid": "3.3.2" }, "cloud-repo-tools": { diff --git a/storage-transfer/system-test/transfer.test.js b/storage-transfer/system-test/transfer.test.js index e8c0fe14d00..cc6e5140142 100644 --- a/storage-transfer/system-test/transfer.test.js +++ b/storage-transfer/system-test/transfer.test.js @@ -16,7 +16,8 @@ /* eslint no-empty: 0 */ 'use strict'; -const storage = require(`@google-cloud/storage`)(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const test = require(`ava`); const tools = require(`@google-cloud/nodejs-repo-tools`); const uuid = require(`uuid`);