- add 45 public document shortcuts and 2 reviewed expert-only paths - preserve six historical command and Schema identities alongside canonical leaves - add safe local download primitives and document access/share orchestration - keep comment create/reply confirmation backward-compatible - ensure grant-and-share upgrades insufficient roles before messaging - return non-zero partial/failure message ledgers and structured partial-write recovery metadata - enumerate every selection candidate and use rune-safe Unicode keyword contexts - assert zero-call confirmation boundaries for destructive shortcuts Validation: - full Go test suite and repository policy - real DingTalk E2E for 34 canonical shortcuts, all 8 compatibility-affected entries, READER-to-EDITOR grant-and-share upgrade, and same-block selection ambiguity with zero comment writes - command compatibility across 1,221 historical nodes and complete Schema compatibility - 1,152 Agent examples including 62 real Cobra dry-runs - 100% changed-code coverage across 1,260 executable statements
25 lines
887 B
Go
25 lines
887 B
Go
// Copyright 2026 Alibaba Group
|
|
// Licensed under the Apache License, Version 2.0
|
|
|
|
package helpers
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
// RunDocImportShortcut exposes the existing, fully-tested Doc import pipeline
|
|
// to the Shortcut application layer. The Cobra leaf still owns its own flags
|
|
// and Contract; this bridge only shares the raw/API execution primitive.
|
|
func RunDocImportShortcut(cmd *cobra.Command) error {
|
|
return runImportCommand(cmd, nil, docImportFlowConfig())
|
|
}
|
|
|
|
// RunDocMediaInsertShortcut shares the existing prepare + OSS PUT + block
|
|
// insertion implementation with the canonical Doc Shortcut.
|
|
func RunDocMediaInsertShortcut(cmd *cobra.Command) error {
|
|
return runMediaInsert(cmd, nil)
|
|
}
|
|
|
|
// RunDocResourceUpdateShortcut shares the cover upload/transfer pipeline.
|
|
func RunDocResourceUpdateShortcut(cmd *cobra.Command) error {
|
|
return runDocStyleCoverSet(cmd, nil)
|
|
}
|