Skip to content

Commit 4d7583e

Browse files
authored
fix: include all scopes (#31)
1 parent 07ea272 commit 4d7583e

File tree

4 files changed

+10077
-511
lines changed

4 files changed

+10077
-511
lines changed

.changeset/dull-clubs-work.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"google-workspace-developer-tools": patch
3+
---
4+
5+
Add all Google APIs and scopes to the diagnostics.

packages/vscode-extension/scripts/fetch-apis.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ const { data: apis } = await discovery.apis.list({
88
fields: "items(title,description,discoveryRestUrl,documentationLink,version)",
99
});
1010

11-
const allApis = (apis.items || [])
12-
.filter(
13-
(x) =>
14-
x.documentationLink?.includes("hangouts") ||
15-
x.documentationLink?.includes("workspace") ||
16-
x.documentationLink?.includes("apps-script"),
17-
)
18-
.sort((a, b) => a.id?.localeCompare(b.id ?? "") || 0);
11+
const allApis = (apis.items || []).sort(
12+
(a, b) => a.id?.localeCompare(b.id ?? "") || 0,
13+
);
1914
const chunkSize = 10;
2015
const apisWithScopes: Array<
2116
typeof apis & {
@@ -80,3 +75,13 @@ await fs.writeFile(
8075
export const GOOGLE_APIS = ${JSON.stringify(apisWithScopes, null, 2)};
8176
`,
8277
);
78+
79+
function _isWorkspaceAPI(api: {
80+
documentationLink?: string;
81+
}): boolean {
82+
return Boolean(
83+
api.documentationLink?.includes("hangouts") ||
84+
api.documentationLink?.includes("workspace") ||
85+
api.documentationLink?.includes("apps-script"),
86+
);
87+
}

0 commit comments

Comments
 (0)