Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

fix: do not modify options object, use defaultScopes #484

Merged
merged 2 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"api-documenter": "api-documenter yaml --input-folder=temp"
},
"dependencies": {
"google-gax": "^2.1.0"
"google-gax": "^2.9.2"
},
"devDependencies": {
"@types/mocha": "^8.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as v2beta2 from './v2beta2';
import * as v2beta3 from './v2beta3';

const CloudTasksClient = v2.CloudTasksClient;
type CloudTasksClient = v2.CloudTasksClient;

export {v2, v2beta2, v2beta3, CloudTasksClient};
export default {v2, v2beta2, v2beta3, CloudTasksClient};
Expand Down
264 changes: 162 additions & 102 deletions src/v2/cloud_tasks_client.ts

Large diffs are not rendered by default.

288 changes: 182 additions & 106 deletions src/v2beta2/cloud_tasks_client.ts

Large diffs are not rendered by default.

264 changes: 162 additions & 102 deletions src/v2beta3/cloud_tasks_client.ts

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-tasks.git",
"sha": "253847d51804a30b670cb6dbd8f6074d4ae13591"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb",
"internalRef": "327369997"
"remote": "git@github.com:googleapis/nodejs-tasks.git",
"sha": "c7104dc7bee055124c687555d2ed7fd00e1489ba"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -105,6 +97,7 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.2001645315",
"protos/google/cloud/tasks/v2/cloudtasks.proto",
"protos/google/cloud/tasks/v2/queue.proto",
"protos/google/cloud/tasks/v2/target.proto",
Expand All @@ -122,6 +115,7 @@
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.2594585339",
"src/index.ts",
"src/v2/cloud_tasks_client.ts",
"src/v2/cloud_tasks_client_config.json",
Expand Down
9 changes: 8 additions & 1 deletion system-test/fixtures/sample/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

import {CloudTasksClient} from '@google-cloud/tasks';

// check that the client class type name can be used
function doStuffWithCloudTasksClient(client: CloudTasksClient) {
client.close();
}

function main() {
new CloudTasksClient();
// check that the client instance can be created
const cloudTasksClient = new CloudTasksClient();
doStuffWithCloudTasksClient(cloudTasksClient);
}

main();
18 changes: 9 additions & 9 deletions system-test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play';
import {readFileSync} from 'fs';
import {describe, it} from 'mocha';

describe('typescript consumer tests', () => {
it('should have correct type signature for typescript users', async function () {
describe('📦 pack-n-play test', () => {
it('TypeScript code', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
packageDir: process.cwd(),
sample: {
description: 'typescript based user can use the type definitions',
description: 'TypeScript user can use the type definitions',
ts: readFileSync(
'./system-test/fixtures/sample/src/index.ts'
).toString(),
},
};
await packNTest(options); // will throw upon error.
await packNTest(options);
});

it('should have correct type signature for javascript users', async function () {
it('JavaScript code', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
packageDir: process.cwd(),
sample: {
description: 'typescript based user can use the type definitions',
description: 'JavaScript user can use the library',
ts: readFileSync(
'./system-test/fixtures/sample/src/index.js'
).toString(),
},
};
await packNTest(options); // will throw upon error.
await packNTest(options);
});
});