mirror of
https://github.com/larksuite/cli.git
synced 2026-08-03 08:32:46 +08:00
fix(sheets): mark undo shortcut high risk
This commit is contained in:
@@ -4976,7 +4976,7 @@
|
||||
]
|
||||
},
|
||||
"+undo": {
|
||||
"risk": "write",
|
||||
"risk": "high-risk-write",
|
||||
"flags": [
|
||||
{
|
||||
"name": "url",
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user