diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 1b3626833..d1e8b5e6e 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -9,9 +9,9 @@ branchProtectionRules: - "ci/kokoro: System test" - docs - lint - - test (10) - test (12) - test (14) + - test (16) - cla/google - windows - OwlBot Post Processor diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25251dbb7..f447b84ab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [10, 12, 14] + node: [12, 14, 16] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/.kokoro/continuous/node10/common.cfg b/.kokoro/continuous/node10/common.cfg deleted file mode 100644 index 339ca8c90..000000000 --- a/.kokoro/continuous/node10/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Bring in codecov.io token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node10/docs.cfg b/.kokoro/continuous/node10/docs.cfg deleted file mode 100644 index b0e21f9bf..000000000 --- a/.kokoro/continuous/node10/docs.cfg +++ /dev/null @@ -1,4 +0,0 @@ -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/docs.sh" -} diff --git a/.kokoro/continuous/node10/lint.cfg b/.kokoro/continuous/node10/lint.cfg deleted file mode 100644 index 018ec7aa0..000000000 --- a/.kokoro/continuous/node10/lint.cfg +++ /dev/null @@ -1,4 +0,0 @@ -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/lint.sh" -} diff --git a/.kokoro/continuous/node10/test.cfg b/.kokoro/continuous/node10/test.cfg deleted file mode 100644 index 609c0cf0a..000000000 --- a/.kokoro/continuous/node10/test.cfg +++ /dev/null @@ -1,9 +0,0 @@ -# Bring in codecov.io token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/.kokoro/continuous/node8/common.cfg b/.kokoro/continuous/node8/common.cfg deleted file mode 100644 index a120432cf..000000000 --- a/.kokoro/continuous/node8/common.cfg +++ /dev/null @@ -1,24 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gax-nodejs/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node8/test.cfg b/.kokoro/continuous/node8/test.cfg deleted file mode 100644 index e69de29bb..000000000 diff --git a/package.json b/package.json index 140131ddf..4616b05ef 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "abort-controller": "^3.0.0", "duplexify": "^4.0.0", "fast-text-encoding": "^1.0.3", - "google-auth-library": "^7.14.0", + "google-auth-library": "^8.0.2", "is-stream-ended": "^0.1.4", "node-fetch": "^2.6.1", "object-hash": "^3.0.0", @@ -33,7 +33,7 @@ "@types/fs-extra": "^9.0.0", "@types/mocha": "^9.0.0", "@types/ncp": "^2.0.1", - "@types/node": ">=15.6.0", + "@types/node": "^17.0.31", "@types/node-fetch": "^2.5.4", "@types/object-hash": "^2.1.0", "@types/proxyquire": "^1.3.28", @@ -47,7 +47,7 @@ "file-loader": "^6.0.0", "fs-extra": "^10.0.0", "google-proto-files": "^2.5.0", - "gts": "^2.0.0", + "gts": "^3.1.0", "is-docker": "^3.0.0", "json-loader": "^0.5.7", "karma": "^6.0.0", @@ -58,7 +58,7 @@ "karma-remap-coverage": "^0.1.5", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^5.0.0", - "linkinator": "^2.0.0", + "linkinator": "^3.0.0", "long": "^4.0.0", "mkdirp": "^1.0.0", "mocha": "^9.0.0", @@ -71,7 +71,7 @@ "sinon": "^13.0.0", "stream-events": "^1.0.4", "ts-loader": "^9.0.0", - "typescript": "^3.8.3", + "typescript": "^4.6.4", "walkdir": "^0.4.0", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" @@ -112,7 +112,7 @@ }, "homepage": "https://github.com/googleapis/gax-nodejs#readme", "engines": { - "node": ">=10" + "node": ">=12" }, "browser": "build/src/fallback.js" } diff --git a/src/streamingCalls/streaming.ts b/src/streamingCalls/streaming.ts index 8c3d975c6..7715b91a2 100644 --- a/src/streamingCalls/streaming.ts +++ b/src/streamingCalls/streaming.ts @@ -17,7 +17,6 @@ /* This file describes the gRPC-streaming. */ import {Duplex, DuplexOptions, Readable, Stream, Writable} from 'stream'; -import {Metadata} from '@grpc/grpc-js'; import { APICallback, @@ -77,13 +76,6 @@ export enum StreamType { BIDI_STREAMING = 3, } -interface Status { - code: number; - details: string; - message?: string; - metadata?: Metadata; -} - export class StreamProxy extends duplexify implements GRPCCallResult { type: StreamType; private _callback: APICallback; diff --git a/test/browser-test/test.endtoend.ts b/test/browser-test/test.endtoend.ts index b4ea18801..cbfeb21bd 100644 --- a/test/browser-test/test.endtoend.ts +++ b/test/browser-test/test.endtoend.ts @@ -44,7 +44,7 @@ describe('Run tests against gRPC server', () => { port: 1337, }; - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore global.isBrowser = true; const client = new EchoClient(opts); diff --git a/test/browser-test/test.grpc-fallback.ts b/test/browser-test/test.grpc-fallback.ts index 0fa0ece8b..9858e78d6 100644 --- a/test/browser-test/test.grpc-fallback.ts +++ b/test/browser-test/test.grpc-fallback.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import * as assert from 'assert'; import {GoogleAuth} from 'google-auth-library'; diff --git a/test/browser-test/test.unit.ts b/test/browser-test/test.unit.ts index 6113a2901..177987a6e 100644 --- a/test/browser-test/test.unit.ts +++ b/test/browser-test/test.unit.ts @@ -23,9 +23,7 @@ import {Transform} from 'stream'; import {EchoClient} from '../fixtures/google-gax-packaging-test-app/src/v1beta1'; import {GoogleAuth} from 'google-auth-library'; import {GoogleError} from '../../src'; -interface Operation { - promise(): Function; -} + describe('Run unit tests of echo client', () => { interface GoogleError extends Error { code: number; diff --git a/test/fixtures/google-gax-packaging-test-app/package.json b/test/fixtures/google-gax-packaging-test-app/package.json index c6d704134..10d2eb458 100644 --- a/test/fixtures/google-gax-packaging-test-app/package.json +++ b/test/fixtures/google-gax-packaging-test-app/package.json @@ -29,6 +29,6 @@ "protobufjs": "^6.10.2" }, "engines": { - "node": ">=10.0.0" + "node": ">=12.0.0" } } diff --git a/test/fixtures/google-gax-packaging-test-app/src/index.ts b/test/fixtures/google-gax-packaging-test-app/src/index.ts index 561df790f..2e04dbc3c 100644 --- a/test/fixtures/google-gax-packaging-test-app/src/index.ts +++ b/test/fixtures/google-gax-packaging-test-app/src/index.ts @@ -179,7 +179,7 @@ async function testEchoError(client: EchoClient) { Error); try { await client.echo(request); - } catch (err) { + } catch (err: any) { clearTimeout(timer); assert.strictEqual(JSON.stringify(err.statusDetails), JSON.stringify(expectedDetails)); assert.ok(errorInfo!) diff --git a/test/unit/bundling.ts b/test/unit/bundling.ts index 5daab2462..d757d311b 100644 --- a/test/unit/bundling.ts +++ b/test/unit/bundling.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable no-prototype-builtins */ import * as assert from 'assert'; diff --git a/test/unit/gax.ts b/test/unit/gax.ts index 3744dac12..d7eb4a99d 100644 --- a/test/unit/gax.ts +++ b/test/unit/gax.ts @@ -20,7 +20,7 @@ * allowing that causes another errors of non-camelcase symbols anyways. * Therefore quote-props is disabled explicitly only in this file. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import * as assert from 'assert'; import {describe, it} from 'mocha'; diff --git a/test/unit/googleError.ts b/test/unit/googleError.ts index 76d305184..c129d70f4 100644 --- a/test/unit/googleError.ts +++ b/test/unit/googleError.ts @@ -141,6 +141,7 @@ describe('gRPC-google error decoding', () => { try { decoder.decodeProtobufAny(any); } catch (err) { + assert(err instanceof Error); assert.strictEqual( 0, err @@ -161,6 +162,7 @@ describe('gRPC-google error decoding', () => { try { decoder.decodeProtobufAny(any); } catch (err) { + assert(err instanceof Error); assert.strictEqual(0, err.toString().indexOf('Error: no such type')); } }); diff --git a/test/unit/grpc-fallback.ts b/test/unit/grpc-fallback.ts index e054c2cf7..d88433563 100644 --- a/test/unit/grpc-fallback.ts +++ b/test/unit/grpc-fallback.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable no-undef */ import * as assert from 'assert'; diff --git a/test/unit/grpc.ts b/test/unit/grpc.ts index 56d0b36da..6940318f5 100644 --- a/test/unit/grpc.ts +++ b/test/unit/grpc.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable no-prototype-builtins */ /* eslint-disable @typescript-eslint/no-var-requires */ diff --git a/test/unit/longrunning.ts b/test/unit/longrunning.ts index f7cd0ba31..03580f670 100644 --- a/test/unit/longrunning.ts +++ b/test/unit/longrunning.ts @@ -668,7 +668,7 @@ describe('longrunning', () => { finalOperation: PENDING_OP, }); const apiCall = createApiCall(func, client); - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore incomplete options apiCall( {}, diff --git a/test/unit/pagedIteration.ts b/test/unit/pagedIteration.ts index bdaefa6d1..73d34db1a 100644 --- a/test/unit/pagedIteration.ts +++ b/test/unit/pagedIteration.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable no-prototype-builtins */ import * as assert from 'assert'; diff --git a/test/unit/regapic.ts b/test/unit/regapic.ts index 783c62b13..fd0a2005c 100644 --- a/test/unit/regapic.ts +++ b/test/unit/regapic.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* xslint-disable @typescript-eslint/ban-ts-ignore */ +/* xslint-disable @typescript-eslint/ban-ts-comment */ /* xslint-disable no-undef */ import * as assert from 'assert'; diff --git a/test/unit/streaming.ts b/test/unit/streaming.ts index ea957ab37..384b5fdfd 100644 --- a/test/unit/streaming.ts +++ b/test/unit/streaming.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import * as assert from 'assert'; import * as sinon from 'sinon'; diff --git a/test/unit/transcoding.ts b/test/unit/transcoding.ts index 209edfa5b..008938af5 100644 --- a/test/unit/transcoding.ts +++ b/test/unit/transcoding.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import {describe, it} from 'mocha'; import {RequestType} from '../../src/apitypes';