From 8a689e256d88a12255a1c79a898e6676a654b01c Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:55:17 -0800 Subject: [PATCH] chore: allow synthetic default imports for ESM-compatibility, and ignore erroneous TS failures (#5853) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update code for ESM-compatibiliity * Update adaptation_client.ts * Update speech_client.ts * Update adaptation_client.ts * Update speech_client.ts * Update speech_client.ts * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- packages/google-cloud-speech/README.md | 4 ++-- packages/google-cloud-speech/protos/protos.json | 3 +++ packages/google-cloud-speech/src/v1/adaptation_client.ts | 1 + packages/google-cloud-speech/src/v1/speech_client.ts | 1 + .../google-cloud-speech/src/v1p1beta1/adaptation_client.ts | 1 + packages/google-cloud-speech/src/v1p1beta1/speech_client.ts | 1 + packages/google-cloud-speech/src/v2/speech_client.ts | 1 + packages/google-cloud-speech/tsconfig.json | 1 + 8 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-speech/README.md b/packages/google-cloud-speech/README.md index 092734d0f4e..406bf01f244 100644 --- a/packages/google-cloud-speech/README.md +++ b/packages/google-cloud-speech/README.md @@ -43,7 +43,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable the Cloud Speech API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -218,4 +218,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-cloud-speech/protos/protos.json b/packages/google-cloud-speech/protos/protos.json index 848e52d468f..251278b51be 100644 --- a/packages/google-cloud-speech/protos/protos.json +++ b/packages/google-cloud-speech/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-speech/src/v1/adaptation_client.ts b/packages/google-cloud-speech/src/v1/adaptation_client.ts index 9c9c59a8a61..6dd0bbbd921 100644 --- a/packages/google-cloud-speech/src/v1/adaptation_client.ts +++ b/packages/google-cloud-speech/src/v1/adaptation_client.ts @@ -155,6 +155,7 @@ export class AdaptationClient { } // Choose either gRPC or proto-over-HTTP implementation of google-gax. + // @ts-ignore this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. diff --git a/packages/google-cloud-speech/src/v1/speech_client.ts b/packages/google-cloud-speech/src/v1/speech_client.ts index c197f29521d..89ff1d35f7f 100644 --- a/packages/google-cloud-speech/src/v1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1/speech_client.ts @@ -156,6 +156,7 @@ export class SpeechClient { } // Choose either gRPC or proto-over-HTTP implementation of google-gax. + // @ts-ignore this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. diff --git a/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts b/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts index 6b7a004e839..32b01d51f73 100644 --- a/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts +++ b/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts @@ -155,6 +155,7 @@ export class AdaptationClient { } // Choose either gRPC or proto-over-HTTP implementation of google-gax. + // @ts-ignore this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. diff --git a/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts index acdae04de0f..ea81085f977 100644 --- a/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts @@ -156,6 +156,7 @@ export class SpeechClient { } // Choose either gRPC or proto-over-HTTP implementation of google-gax. + // @ts-ignore this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. diff --git a/packages/google-cloud-speech/src/v2/speech_client.ts b/packages/google-cloud-speech/src/v2/speech_client.ts index 5e3e34e1d8b..137a29fd64c 100644 --- a/packages/google-cloud-speech/src/v2/speech_client.ts +++ b/packages/google-cloud-speech/src/v2/speech_client.ts @@ -161,6 +161,7 @@ export class SpeechClient { } // Choose either gRPC or proto-over-HTTP implementation of google-gax. + // @ts-ignore this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. diff --git a/packages/google-cloud-speech/tsconfig.json b/packages/google-cloud-speech/tsconfig.json index c78f1c884ef..5059f3b0608 100644 --- a/packages/google-cloud-speech/tsconfig.json +++ b/packages/google-cloud-speech/tsconfig.json @@ -4,6 +4,7 @@ "rootDir": ".", "outDir": "build", "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, "lib": [ "es2018", "dom"