Skip to content

Commit 871fb42

Browse files
authored
Merge branch 'main' into renovate/sinon-21.x
2 parents e432efc + 8a2f8ff commit 871fb42

2 files changed

Lines changed: 28 additions & 23 deletions

File tree

src/generator/disclaimer.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ export const gfs = {
5252
*/
5353
export async function main() {
5454
const res = await request<LibraryMetadata[]>({url: libraryListUrl});
55-
const disclaimers = res.data.map(lib => {
56-
return {
57-
api: lib.api_id.split('.')[0],
58-
package: lib.distribution_name,
59-
};
60-
});
55+
const disclaimers = JSON.parse(res.data as unknown as string).map(
56+
(lib: LibraryMetadata) => {
57+
return {
58+
api: lib.api_id.split('.')[0],
59+
package: lib.distribution_name,
60+
};
61+
},
62+
);
6163
gfs.writeFileSync('./disclaimers.json', JSON.stringify(disclaimers, null, 2));
6264
}
6365

test/test.disclaimer.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,27 @@ import * as nock from 'nock';
1919
import {URL} from 'url';
2020
import * as disclaimer from '../src/generator/disclaimer';
2121

22-
const mockResponse = [
22+
const mockResponse = `[
2323
{
24-
name: 'asset',
25-
name_pretty: 'Asset Inventory',
26-
product_documentation:
27-
'https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview',
28-
client_documentation: 'https://googleapis.dev/nodejs/asset/latest',
29-
issue_tracker: 'https://issuetracker.google.com/savedsearches/559757',
30-
release_level: 'ga',
31-
language: 'nodejs',
32-
repo: 'googleapis/nodejs-asset',
33-
distribution_name: '@google-cloud/asset',
34-
api_id: 'cloudasset.googleapis.com',
35-
requires_billing: true,
36-
support_documentation:
37-
'https://cloud.google.com/resource-manager/docs/getting-support',
38-
},
39-
];
24+
"name": "cloudasset",
25+
"name_pretty": "Asset Inventory",
26+
"product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview",
27+
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest",
28+
"issue_tracker": "https://issuetracker.google.com/savedsearches/559757",
29+
"release_level": "stable",
30+
"language": "nodejs",
31+
"repo": "googleapis/google-cloud-node",
32+
"distribution_name": "@google-cloud/asset",
33+
"api_id": "cloudasset.googleapis.com",
34+
"requires_billing": true,
35+
"default_version": "v1",
36+
"codeowner_team": "@googleapis/cloud-asset-team",
37+
"api_shortname": "cloudasset",
38+
"library_type": "GAPIC_AUTO",
39+
"linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset",
40+
"support_documentation": "https://cloud.google.com/resource-manager/docs/getting-support"
41+
}
42+
]`;
4043

4144
nock.disableNetConnect();
4245

0 commit comments

Comments
 (0)