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 (#231)
Browse files Browse the repository at this point in the history
* fix: do not modify options object, use defaultScopes

Regenerated the library using gapic-generator-typescript v1.2.1.

* fix(deps): require google-gax ^2.9.2
  • Loading branch information
alexander-fenster authored Nov 7, 2020
1 parent 317c722 commit 6bcb17b
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 385 deletions.
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",
"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 @@ -19,6 +19,7 @@
import * as v1beta1 from './v1beta1';

const DataLabelingServiceClient = v1beta1.DataLabelingServiceClient;
type DataLabelingServiceClient = v1beta1.DataLabelingServiceClient;

export {v1beta1, DataLabelingServiceClient};
export default {v1beta1, DataLabelingServiceClient};
Expand Down
861 changes: 498 additions & 363 deletions src/v1beta1/data_labeling_service_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-datalabeling.git",
"sha": "5280f9030714763165cdc64fcf2f9dc08a4e61e0"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "062f46f246c78fde2160524db593fa0fa7bdbe64",
"internalRef": "337404700"
"remote": "[email protected]:googleapis/nodejs-datalabeling.git",
"sha": "317c722bc888c11f57819cd8e02babd988dad2de"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -87,6 +79,7 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.2707288343",
"protos/google/cloud/datalabeling/v1beta1/annotation.proto",
"protos/google/cloud/datalabeling/v1beta1/annotation_spec_set.proto",
"protos/google/cloud/datalabeling/v1beta1/data_labeling_service.proto",
Expand All @@ -102,6 +95,7 @@
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.1329949583",
"src/index.ts",
"src/v1beta1/data_labeling_service_client.ts",
"src/v1beta1/data_labeling_service_client_config.json",
Expand Down
11 changes: 10 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,17 @@

import {DataLabelingServiceClient} from '@google-cloud/datalabeling';

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

function main() {
new DataLabelingServiceClient();
// check that the client instance can be created
const dataLabelingServiceClient = new DataLabelingServiceClient();
doStuffWithDataLabelingServiceClient(dataLabelingServiceClient);
}

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 6bcb17b

Please sign in to comment.