fix(sheets): mark undo shortcut high risk

This commit is contained in:
zhengzhijie
2026-07-17 15:54:51 +08:00
parent 8c9ded190b
commit dda3e7adb0
4 changed files with 6 additions and 3 deletions

View File

@@ -4976,7 +4976,7 @@
]
},
"+undo": {
"risk": "write",
"risk": "high-risk-write",
"flags": [
{
"name": "url",

View File

@@ -998,7 +998,7 @@ var flagDefs = map[string]commandDef{
},
},
"+undo": {
Risk: "write",
Risk: "high-risk-write",
Flags: []flagDef{
{Name: "url", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"},
{Name: "spreadsheet-token", Kind: "public", Type: "string", Required: "xor", Desc: "Spreadsheet locator"},

View File

@@ -13,7 +13,7 @@ var Undo = common.Shortcut{
Service: "sheets",
Command: "+undo",
Description: "Undo the current user's latest spreadsheet write.",
Risk: "write",
Risk: "high-risk-write",
Scopes: []string{"sheets:spreadsheet:write_only"},
AuthTypes: []string{"user"},
HasFormat: true,

View File

@@ -10,6 +10,9 @@ import (
func TestUndo_DryRun(t *testing.T) {
t.Parallel()
if Undo.Risk != "high-risk-write" {
t.Fatalf("Undo.Risk = %q, want high-risk-write", Undo.Risk)
}
args := []string{"--url", testURL, "--as", "user"}
callURL := dryRunFirstCallURL(t, Undo, args)