From 547f1a1e32e6ff39cb9cbfddbef3e479ddfedebb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 11 May 2019 16:10:14 -0700 Subject: [PATCH] fix(deps): update dependency google-gax to v1 (#402) --- package.json | 3 ++- src/index.ts | 2 +- test/index.ts | 4 ++-- test/request.ts | 8 +++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index fcbb33e0a..f6b9fece7 100644 --- a/package.json +++ b/package.json @@ -48,13 +48,14 @@ "dependencies": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", + "@grpc/grpc-js": "^0.4.0", "@types/duplexify": "^3.6.0", "@types/long": "^4.0.0", "arrify": "^2.0.0", "concat-stream": "^2.0.0", "extend": "^3.0.1", "google-auth-library": "^4.0.0", - "google-gax": "^0.26.0", + "google-gax": "^1.0.0", "is": "^3.2.1", "lodash.merge": "^4.6.1", "split-array-stream": "^2.0.0", diff --git a/src/index.ts b/src/index.ts index 8b618a08e..a15083338 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,7 +27,7 @@ import arrify = require('arrify'); import {GoogleAuth, GoogleAuthOptions} from 'google-auth-library'; import {GrpcClient} from 'google-gax'; -import {ChannelCredentials} from 'grpc'; +import {ChannelCredentials} from '@grpc/grpc-js'; import * as is from 'is'; import {entity} from './entity'; diff --git a/test/index.ts b/test/index.ts index afab2a323..1c96a061d 100644 --- a/test/index.ts +++ b/test/index.ts @@ -77,7 +77,7 @@ const fakeGoogleGax = { constructor(opts: gax.GrpcClientOptions) { // super constructor must be called first! super(opts); - this.grpc = { + this.grpc = ({ credentials: { createInsecure() { return (createInsecureOverride || (() => {})).apply( @@ -86,7 +86,7 @@ const fakeGoogleGax = { ); }, }, - } as gax.GrpcModule; + } as {}) as gax.GrpcModule; } }, }; diff --git a/test/request.ts b/test/request.ts index ee69e5c88..246c40921 100644 --- a/test/request.ts +++ b/test/request.ts @@ -18,7 +18,7 @@ import * as pjy from '@google-cloud/projectify'; import * as pfy from '@google-cloud/promisify'; import * as assert from 'assert'; import * as extend from 'extend'; -import {CallOptions} from 'grpc'; +import {CallOptions} from '@grpc/grpc-js'; import * as is from 'is'; import * as proxyquire from 'proxyquire'; import * as sinon from 'sinon'; @@ -1649,7 +1649,8 @@ describe('Request', () => { it('should send gaxOpts', done => { request.datastore.clients_ = new Map(); request.datastore.clients_.set(CONFIG.client, { - [CONFIG.method](_: object, gaxO: CallOptions) { + // tslint:disable-next-line no-any + [CONFIG.method](_: object, gaxO: any) { delete gaxO.headers; assert.deepStrictEqual(gaxO, CONFIG.gaxOpts); done(); @@ -1662,7 +1663,8 @@ describe('Request', () => { it('should send google-cloud-resource-prefix', done => { request.datastore.clients_ = new Map(); request.datastore.clients_.set(CONFIG.client, { - [CONFIG.method](_: object, gaxO: CallOptions) { + // tslint:disable-next-line no-any + [CONFIG.method](_: object, gaxO: any) { assert.deepStrictEqual(gaxO.headers, { 'google-cloud-resource-prefix': 'projects/' + PROJECT_ID, });