Skip to content

Commit

Permalink
fix: do not modify options object, use defaultScopes (#416)
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 7, 2020
1 parent 0ecba70 commit d231fca
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 127 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-iot/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": {
"@microsoft/api-documenter": "^7.8.10",
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-iot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import * as v1 from './v1';

const DeviceManagerClient = v1.DeviceManagerClient;
type DeviceManagerClient = v1.DeviceManagerClient;

export {v1, DeviceManagerClient};
export default {v1, DeviceManagerClient};
Expand Down
282 changes: 177 additions & 105 deletions packages/google-cloud-iot/src/v1/device_manager_client.ts

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions packages/google-cloud-iot/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-iot.git",
"sha": "c776e898bbca783045cc7cdf669d2d2e999ac76c"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb",
"internalRef": "327369997"
"remote": "[email protected]:googleapis/nodejs-iot.git",
"sha": "6e416f7f428f1d653f9364a051d468c607fe2d91"
}
},
{
"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.1462975402",
"protos/google/cloud/iot/v1/device_manager.proto",
"protos/google/cloud/iot/v1/resources.proto",
"protos/protos.d.ts",
"protos/protos.js",
"protos/protos.json",
"renovate.json",
"samples/README.md",
"samples/package-lock.json.1264602173",
"src/index.ts",
"src/v1/device_manager_client.ts",
"src/v1/device_manager_client_config.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

import {DeviceManagerClient} from '@google-cloud/iot';

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

function main() {
new DeviceManagerClient();
// check that the client instance can be created
const deviceManagerClient = new DeviceManagerClient();
doStuffWithDeviceManagerClient(deviceManagerClient);
}

main();
18 changes: 9 additions & 9 deletions packages/google-cloud-iot/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 d231fca

Please sign in to comment.