Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update typescript generator version to publish in dual format (ESM) #1448

Merged
merged 7 commits into from
Nov 9, 2023
9 changes: 4 additions & 5 deletions src/v2/config_service_v2_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ export class ConfigServiceV2Client {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new ConfigServiceV2Client({fallback: 'rest'}, gax);
* const client = new ConfigServiceV2Client({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -168,7 +167,7 @@ export class ConfigServiceV2Client {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down Expand Up @@ -332,7 +331,7 @@ export class ConfigServiceV2Client {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
};
if (opts.fallback === 'rest') {
if (opts.fallback) {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
Expand Down
9 changes: 4 additions & 5 deletions src/v2/logging_service_v2_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ export class LoggingServiceV2Client {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new LoggingServiceV2Client({fallback: 'rest'}, gax);
* const client = new LoggingServiceV2Client({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -165,7 +164,7 @@ export class LoggingServiceV2Client {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down Expand Up @@ -313,7 +312,7 @@ export class LoggingServiceV2Client {
this.descriptors.stream = {
tailLogEntries: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
opts.fallback === 'rest'
!!opts.fallback
),
};

Expand Down
7 changes: 3 additions & 4 deletions src/v2/metrics_service_v2_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ export class MetricsServiceV2Client {
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new MetricsServiceV2Client({fallback: 'rest'}, gax);
* const client = new MetricsServiceV2Client({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -165,7 +164,7 @@ export class MetricsServiceV2Client {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
Expand Down
Loading