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

Commit

Permalink
fix: do not modify options object, use defaultScopes (#305)
Browse files Browse the repository at this point in the history
Regenerated the library using
[gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript)
v1.2.1.
  • Loading branch information
alexander-fenster authored Nov 6, 2020
1 parent 55217ba commit 7f8b30c
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 156 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"api-documenter": "api-documenter yaml --input-folder=temp"
},
"dependencies": {
"google-gax": "^2.1.0",
"google-gax": "^2.9.2",
"protobufjs": "^6.8.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as v1 from './v1';
import * as v1beta1 from './v1beta1';

const CloudSchedulerClient = v1.CloudSchedulerClient;
type CloudSchedulerClient = v1.CloudSchedulerClient;

export {v1, v1beta1, CloudSchedulerClient};
export default {v1, v1beta1, CloudSchedulerClient};
Expand Down
165 changes: 98 additions & 67 deletions src/v1/cloud_scheduler_client.ts

Large diffs are not rendered by default.

165 changes: 98 additions & 67 deletions src/v1beta1/cloud_scheduler_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-scheduler.git",
"sha": "ea510b8f0a0c047ca408cb63ccd6a3a00c1c595b"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb",
"internalRef": "327369997"
"remote": "git@github.com:googleapis/nodejs-scheduler.git",
"sha": "55217ba4a8de447875a55e2d7b94a910f5773871"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -96,6 +88,7 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.1975481685",
"protos/google/cloud/scheduler/v1/cloudscheduler.proto",
"protos/google/cloud/scheduler/v1/job.proto",
"protos/google/cloud/scheduler/v1/target.proto",
Expand All @@ -107,6 +100,7 @@
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.3211560438",
"src/index.ts",
"src/v1/cloud_scheduler_client.ts",
"src/v1/cloud_scheduler_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 {CloudSchedulerClient} from '@google-cloud/scheduler';

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

function main() {
new CloudSchedulerClient();
// check that the client instance can be created
const cloudSchedulerClient = new CloudSchedulerClient();
doStuffWithCloudSchedulerClient(cloudSchedulerClient);
}

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);
});
});

0 comments on commit 7f8b30c

Please sign in to comment.