Skip to content

Commit 496529e

Browse files
committed
feat: add script.container.ui and script.send_mail scopes with descriptions and tests.
1 parent 9932d27 commit 496529e

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

.changeset/wild-peaches-relate.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 `https://www.googleapis.com/auth/script.container.ui` and `https://www.googleapis.com/auth/script.send_mail` to hardcoded scopes.

packages/vscode-extension/src/scopes.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ SCOPES.set(SCRIPT_EXTERNAL_REQUEST_SCOPE, {
7171
apis: [],
7272
});
7373

74+
export const SCRIPT_CONTAINER_UI_SCOPE =
75+
"https://www.googleapis.com/auth/script.container.ui";
76+
SCOPES.set(SCRIPT_CONTAINER_UI_SCOPE, {
77+
description:
78+
"Display and run third-party web content in prompts and sidebars inside Google applications.",
79+
apis: [],
80+
});
81+
82+
export const SCRIPT_SEND_MAIL_SCOPE =
83+
"https://www.googleapis.com/auth/script.send_mail";
84+
SCOPES.set(SCRIPT_SEND_MAIL_SCOPE, {
85+
description: "Send email on your behalf.",
86+
apis: [],
87+
});
88+
7489
/**
7590
* Scopes that are only available for the current document.
7691
*

packages/vscode-extension/src/test/scopes.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
import * as assert from "node:assert";
1818
import {
1919
SCOPES,
20+
SCRIPT_CONTAINER_UI_SCOPE,
2021
SCRIPT_EXTERNAL_REQUEST_SCOPE,
22+
SCRIPT_SEND_MAIL_SCOPE,
2123
getScopeMarkdown,
2224
} from "../scopes.js";
2325

@@ -37,4 +39,19 @@ suite("getScopeMarkdown", () => {
3739
assert.ok(scope);
3840
assert.strictEqual(scope?.description, "Connect to an external service");
3941
});
42+
43+
test("it returns scope for script.container.ui", () => {
44+
const scope = SCOPES.get(SCRIPT_CONTAINER_UI_SCOPE);
45+
assert.ok(scope);
46+
assert.strictEqual(
47+
scope?.description,
48+
"Display and run third-party web content in prompts and sidebars inside Google applications.",
49+
);
50+
});
51+
52+
test("it returns scope for script.send_mail", () => {
53+
const scope = SCOPES.get(SCRIPT_SEND_MAIL_SCOPE);
54+
assert.ok(scope);
55+
assert.strictEqual(scope?.description, "Send email on your behalf.");
56+
});
4057
});

0 commit comments

Comments
 (0)