Skip to content

Commit

Permalink
fix: do not modify options object, use defaultScopes (#560)
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 09241de commit 3517c9a
Show file tree
Hide file tree
Showing 6 changed files with 348 additions and 223 deletions.
2 changes: 1 addition & 1 deletion packages/google-privacy-dlp/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 packages/google-privacy-dlp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import * as v2 from './v2';

const DlpServiceClient = v2.DlpServiceClient;
type DlpServiceClient = v2.DlpServiceClient;

export {v2, DlpServiceClient};
export default {v2, DlpServiceClient};
Expand Down
525 changes: 324 additions & 201 deletions packages/google-privacy-dlp/src/v2/dlp_service_client.ts

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions packages/google-privacy-dlp/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-dlp.git",
"sha": "006a73e0e9d38192ba409e1360d8a882bad68f92"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "795f0cacce3799e04fa2fe06590216eec4a5ba52",
"internalRef": "336694775"
"remote": "[email protected]:googleapis/nodejs-dlp.git",
"sha": "e675d52e35cfe7bf1355d9ead289891cb2da2db4"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ba9918cd22874245b55734f57470c719b577e591"
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
}
}
],
Expand Down Expand Up @@ -87,13 +79,15 @@
"README.md",
"api-extractor.json",
"linkinator.config.json",
"package-lock.json.1493547946",
"protos/google/privacy/dlp/v2/dlp.proto",
"protos/google/privacy/dlp/v2/storage.proto",
"protos/protos.d.ts",
"protos/protos.js",
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.701286152",
"src/index.ts",
"src/v2/dlp_service_client.ts",
"src/v2/dlp_service_client_config.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

import {DlpServiceClient} from '@google-cloud/dlp';

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

function main() {
new DlpServiceClient();
// check that the client instance can be created
const dlpServiceClient = new DlpServiceClient();
doStuffWithDlpServiceClient(dlpServiceClient);
}

main();
18 changes: 9 additions & 9 deletions packages/google-privacy-dlp/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 3517c9a

Please sign in to comment.