Skip to content

Commit

Permalink
feat: capture esm usage in Cloud Tasks (googleapis#5541)
Browse files Browse the repository at this point in the history
* Update cloud_tasks_client.ts

* Update cloud_tasks_client.ts

* Update cloud_tasks_client.ts

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update cloud_tasks_client.ts

* Update cloud_tasks_client.ts

* Update cloud_tasks_client.ts

* Update cloud_tasks_client.ts

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
sofisl and gcf-owl-bot[bot] committed Jul 15, 2024
1 parent 909258d commit 685a710
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
11 changes: 5 additions & 6 deletions packages/google-cloud-tasks/esm/src/v2/cloud_tasks_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ export class CloudTasksClient {
);

// Determine the client header string.

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/${process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -217,11 +221,6 @@ export class CloudTasksClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ export class CloudTasksClient {
);

// Determine the client header string.
// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/${process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -217,11 +220,6 @@ export class CloudTasksClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ export class CloudTasksClient {
);

// Determine the client header string.
// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/${process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -217,11 +220,6 @@ export class CloudTasksClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(
Expand Down

0 comments on commit 685a710

Please sign in to comment.