Skip to content

Commit d231fca

Browse files
fix: do not modify options object, use defaultScopes (#416)
Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1.
1 parent 0ecba70 commit d231fca

File tree

6 files changed

+201
-127
lines changed

6 files changed

+201
-127
lines changed

packages/google-cloud-iot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"api-documenter": "api-documenter yaml --input-folder=temp"
4646
},
4747
"dependencies": {
48-
"google-gax": "^2.1.0"
48+
"google-gax": "^2.9.2"
4949
},
5050
"devDependencies": {
5151
"@microsoft/api-documenter": "^7.8.10",

packages/google-cloud-iot/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import * as v1 from './v1';
2020

2121
const DeviceManagerClient = v1.DeviceManagerClient;
22+
type DeviceManagerClient = v1.DeviceManagerClient;
2223

2324
export {v1, DeviceManagerClient};
2425
export default {v1, DeviceManagerClient};

packages/google-cloud-iot/src/v1/device_manager_client.ts

Lines changed: 177 additions & 105 deletions
Large diffs are not rendered by default.

packages/google-cloud-iot/synth.metadata

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,15 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "https://github.com/googleapis/nodejs-iot.git",
7-
"sha": "c776e898bbca783045cc7cdf669d2d2e999ac76c"
8-
}
9-
},
10-
{
11-
"git": {
12-
"name": "googleapis",
13-
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb",
15-
"internalRef": "327369997"
6+
"remote": "[email protected]:googleapis/nodejs-iot.git",
7+
"sha": "6e416f7f428f1d653f9364a051d468c607fe2d91"
168
}
179
},
1810
{
1911
"git": {
2012
"name": "synthtool",
2113
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "ba9918cd22874245b55734f57470c719b577e591"
14+
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
2315
}
2416
}
2517
],
@@ -87,13 +79,15 @@
8779
"README.md",
8880
"api-extractor.json",
8981
"linkinator.config.json",
82+
"package-lock.json.1462975402",
9083
"protos/google/cloud/iot/v1/device_manager.proto",
9184
"protos/google/cloud/iot/v1/resources.proto",
9285
"protos/protos.d.ts",
9386
"protos/protos.js",
9487
"protos/protos.json",
9588
"renovate.json",
9689
"samples/README.md",
90+
"samples/package-lock.json.1264602173",
9791
"src/index.ts",
9892
"src/v1/device_manager_client.ts",
9993
"src/v1/device_manager_client_config.json",

packages/google-cloud-iot/system-test/fixtures/sample/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@
1818

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

21+
// check that the client class type name can be used
22+
function doStuffWithDeviceManagerClient(client: DeviceManagerClient) {
23+
client.close();
24+
}
25+
2126
function main() {
22-
new DeviceManagerClient();
27+
// check that the client instance can be created
28+
const deviceManagerClient = new DeviceManagerClient();
29+
doStuffWithDeviceManagerClient(deviceManagerClient);
2330
}
2431

2532
main();

packages/google-cloud-iot/system-test/install.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play';
2020
import {readFileSync} from 'fs';
2121
import {describe, it} from 'mocha';
2222

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

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

0 commit comments

Comments
 (0)