From 0a9ffc8c437db9cec498939b6a67e8b5d963702a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 14 Dec 2018 20:27:36 -0500 Subject: [PATCH] chore(deps): update dependency @google-cloud/storage to v2.3.3 (#959) * chore(deps): update dependency @google-cloud/storage to v2.3.3 * Update syntax for new Storage --- appengine/storage/flexible/app.js | 4 ++-- appengine/storage/flexible/package.json | 12 ++++++------ appengine/storage/flexible/system-test/app.test.js | 4 ++-- appengine/storage/standard/app.js | 4 ++-- appengine/storage/standard/package.json | 12 ++++++------ appengine/storage/standard/system-test/app.test.js | 4 ++-- functions/helloworld/package.json | 14 +++++++------- functions/helloworld/shim.js | 4 ++-- functions/helloworld/test/index.test.js | 3 ++- .../helloworld/test/sample.system.storage.test.js | 4 ++-- functions/helloworld/test/shim.test.js | 4 ++-- functions/http/package.json | 10 +++++----- functions/imagemagick/index.js | 3 ++- functions/imagemagick/package.json | 10 +++++----- 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/index.js | 3 ++- functions/sendgrid/package.json | 2 +- functions/sendgrid/test/index.test.js | 2 +- package.json | 2 +- storage-transfer/package.json | 2 +- storage-transfer/system-test/transfer.test.js | 3 ++- 24 files changed, 60 insertions(+), 55 deletions(-) diff --git a/appengine/storage/flexible/app.js b/appengine/storage/flexible/app.js index 035d6bb0a8..33256cbe25 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 656d6c9fad..ab1efcf726 100644 --- a/appengine/storage/flexible/package.json +++ b/appengine/storage/flexible/package.json @@ -9,15 +9,15 @@ "node": ">=8.0.0" }, "dependencies": { - "@google-cloud/storage": "1.7.0", - "body-parser": "1.18.3", - "express": "4.16.4", - "multer": "1.4.1", - "pug": "2.0.3" + "@google-cloud/storage": "^2.3.3", + "body-parser": "^1.18.3", + "express": "^4.16.4", + "multer": "^1.4.1", + "pug": "^2.0.3" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", - "ava": "0.25.0" + "ava": "^0.25.0" }, "cloud-repo-tools": { "requiresProjectId": true, diff --git a/appengine/storage/flexible/system-test/app.test.js b/appengine/storage/flexible/system-test/app.test.js index 339956b5d2..2a95f67ce3 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 45485f4d57..66bee97869 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 9e7596f4dc..5eb3c95826 100644 --- a/appengine/storage/standard/package.json +++ b/appengine/storage/standard/package.json @@ -9,15 +9,15 @@ "node": ">=8" }, "dependencies": { - "@google-cloud/storage": "1.7.0", - "body-parser": "1.18.3", - "express": "4.16.4", - "multer": "1.4.1", - "pug": "2.0.3" + "@google-cloud/storage": "^2.3.3", + "body-parser": "^1.18.3", + "express": "^4.16.4", + "multer": "^1.4.1", + "pug": "^2.0.3" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", - "ava": "0.25.0" + "ava": "^0.25.0" }, "cloud-repo-tools": { "requiresProjectId": true, diff --git a/appengine/storage/standard/system-test/app.test.js b/appengine/storage/standard/system-test/app.test.js index 339956b5d2..2a95f67ce3 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/helloworld/package.json b/functions/helloworld/package.json index 007731feca..d7b3c61eb5 100644 --- a/functions/helloworld/package.json +++ b/functions/helloworld/package.json @@ -17,19 +17,19 @@ "system-test": "export FUNCTIONS_CMD='functions-emulator' && sh test/updateFunctions.sh && export BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" && ava -T 20s --verbose test/*.test.js" }, "dependencies": { - "@google-cloud/debug-agent": "2.6.0", + "@google-cloud/debug-agent": "^2.6.0", "escape-html": "^1.0.3", - "pug": "2.0.3", - "safe-buffer": "5.1.2" + "pug": "^2.0.3", + "safe-buffer": "^5.1.2" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", "@google-cloud/pubsub": "^0.22.0", - "@google-cloud/storage": "^1.5.0", - "ava": "0.25.0", + "@google-cloud/storage": "^2.0.0", + "ava": "^0.25.0", "express": "^4.16.3", - "proxyquire": "2.1.0", - "sinon": "4.5.0", + "proxyquire": "^2.1.0", + "sinon": "^4.5.0", "supertest": "^3.0.0", "uuid": "^3.1.0", "yargs": "^11.0.0" diff --git a/functions/helloworld/shim.js b/functions/helloworld/shim.js index 0b3862de3d..e5f5d2ebda 100644 --- a/functions/helloworld/shim.js +++ b/functions/helloworld/shim.js @@ -74,9 +74,9 @@ const storageShim = (gcfFn, bucketName, topicName, subscriptionName) => { // [START functions_testing_shim_storage] // Import dependencies const Pubsub = require('@google-cloud/pubsub'); - const Storage = require(`@google-cloud/storage`); + const {Storage} = require(`@google-cloud/storage`); const pubsub = Pubsub(); - const storage = Storage(); + const storage = new Storage(); // TODO(developer): specify a function to test // const gcfCode = require('./index.js'); diff --git a/functions/helloworld/test/index.test.js b/functions/helloworld/test/index.test.js index 6e1bb4fda4..f05f979872 100644 --- a/functions/helloworld/test/index.test.js +++ b/functions/helloworld/test/index.test.js @@ -22,7 +22,8 @@ const uuid = require(`uuid`); const {PubSub} = require(`@google-cloud/pubsub`); const pubsub = new PubSub(); -const storage = require(`@google-cloud/storage`)(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const baseCmd = process.env.FUNCTIONS_CMD; const topicName = process.env.FUNCTIONS_TOPIC; diff --git a/functions/helloworld/test/sample.system.storage.test.js b/functions/helloworld/test/sample.system.storage.test.js index 110cd069db..180470fc75 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/helloworld/test/shim.test.js b/functions/helloworld/test/shim.test.js index 3a5e4d8608..c62d1d217d 100644 --- a/functions/helloworld/test/shim.test.js +++ b/functions/helloworld/test/shim.test.js @@ -18,8 +18,8 @@ const Supertest = require(`supertest`); const tools = require(`@google-cloud/nodejs-repo-tools`); const {PubSub} = require(`@google-cloud/pubsub`); const pubsub = new PubSub(); -const Storage = require(`@google-cloud/storage`); -const storage = Storage(); +const {Storage} = require(`@google-cloud/storage`); +const storage = new Storage(); const uuid = require(`uuid`); const path = require(`path`); diff --git a/functions/http/package.json b/functions/http/package.json index ca43ade59f..6229de2cfb 100644 --- a/functions/http/package.json +++ b/functions/http/package.json @@ -16,16 +16,16 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", - "ava": "0.25.0", - "proxyquire": "2.1.0", - "sinon": "4.5.0", + "ava": "^0.25.0", + "proxyquire": "^2.1.0", + "sinon": "^4.5.0", "uuid": "^3.3.2" }, "dependencies": { - "@google-cloud/storage": "2.3.1", + "@google-cloud/storage": "^2.3.3", "busboy": "^0.2.14", "escape-html": "^1.0.3", - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.2" }, "cloud-repo-tools": { "requiresKeyFile": true, diff --git a/functions/imagemagick/index.js b/functions/imagemagick/index.js index 7cfd2c2002..a174e58047 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 6cbe992e3a..e0fbf02882 100644 --- a/functions/imagemagick/package.json +++ b/functions/imagemagick/package.json @@ -15,15 +15,15 @@ "test": "ava -T 20s --verbose test/*.test.js" }, "dependencies": { - "@google-cloud/storage": "1.7.0", - "@google-cloud/vision": "0.23.0", + "@google-cloud/storage": "^2.3.3", + "@google-cloud/vision": "^0.23.0", "gm": "^1.23.1" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", - "ava": "0.25.0", - "proxyquire": "2.1.0", - "sinon": "4.5.0" + "ava": "^0.25.0", + "proxyquire": "^2.1.0", + "sinon": "^4.5.0" }, "cloud-repo-tools": { "requiresKeyFile": true, diff --git a/functions/imagemagick/test/index.test.js b/functions/imagemagick/test/index.test.js index d456667b18..217923d0b5 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 76f5565921..b67b3ff7d5 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'); diff --git a/functions/ocr/app/package.json b/functions/ocr/app/package.json index 4da59e9d99..f65a078a4e 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.3", "@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 e13a23b26d..829fb5cb4c 100644 --- a/functions/ocr/app/test/index.test.js +++ b/functions/ocr/app/test/index.test.js @@ -95,7 +95,7 @@ function getSample() { '@google-cloud/translate': translateStub, '@google-cloud/vision': visionStub, '@google-cloud/pubsub': {PubSub: PubsubMock}, - '@google-cloud/storage': StorageMock, + '@google-cloud/storage': {Storage: StorageMock}, './config.json': config, }), mocks: { diff --git a/functions/sendgrid/index.js b/functions/sendgrid/index.js index af68d0050c..ab09c3299c 100644 --- a/functions/sendgrid/index.js +++ b/functions/sendgrid/index.js @@ -22,7 +22,8 @@ const config = require('./config.json'); const uuid = require('uuid'); // 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 BigQuery component const {BigQuery} = require('@google-cloud/bigquery'); const bigquery = new BigQuery(); diff --git a/functions/sendgrid/package.json b/functions/sendgrid/package.json index 6525b16bbf..45429cdb57 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.0.0", "safe-buffer": "^5.1.2", "sendgrid": "^5.2.3", "uuid": "^3.3.2" diff --git a/functions/sendgrid/test/index.test.js b/functions/sendgrid/test/index.test.js index 01bab46d16..f7f9479bc8 100644 --- a/functions/sendgrid/test/index.test.js +++ b/functions/sendgrid/test/index.test.js @@ -93,7 +93,7 @@ function getSample() { program: proxyquire(`../`, { sendgrid: sendgrid, '@google-cloud/bigquery': {BigQuery: BigQueryMock}, - '@google-cloud/storage': StorageMock, + '@google-cloud/storage': {Storage: StorageMock}, './config.json': config, uuid: uuid, }), diff --git a/package.json b/package.json index b8386b217c..d9ed207ef2 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "2.3.3", "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 b940bad1d0..4056958262 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.5.0", - "@google-cloud/storage": "1.7.0", + "@google-cloud/storage": "^2.3.3", "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 e8c0fe14d0..cc6e514014 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`);