Documentation
¶
Overview ¶
Copyright (c) 2026 Lark Technologies Pte. Ltd. SPDX-License-Identifier: MIT
Index ¶
Constants ¶
const ( // WhiteboardExportAsPreview exports a whiteboard preview image. WhiteboardExportAsPreview = "preview" // WhiteboardExportAsSvg exports a whiteboard as SVG. WhiteboardExportAsSvg = "svg" // WhiteboardExportAsSource exports Mermaid or PlantUML source extracted from the whiteboard. WhiteboardExportAsSource = "source" // WhiteboardExportAsRaw exports the raw whiteboard node payload. WhiteboardExportAsRaw = "raw" // Legacy output type names accepted for backward compatibility. WhiteboardQueryAsImage = "image" // WhiteboardQueryAsSvg is deprecated; use WhiteboardExportAsSvg. WhiteboardQueryAsSvg = WhiteboardExportAsSvg WhiteboardQueryAsCode = "code" // WhiteboardQueryAsRaw is deprecated; use WhiteboardExportAsRaw. WhiteboardQueryAsRaw = WhiteboardExportAsRaw )
const ( // FormatRaw sends raw whiteboard node JSON to the create-nodes API. FormatRaw = "raw" // FormatPlantUML sends PlantUML source through the diagram import API. FormatPlantUML = "plantuml" // FormatMermaid sends Mermaid source through the diagram import API. FormatMermaid = "mermaid" // FormatSVG sends SVG source through the diagram import API. FormatSVG = "svg" )
const WhiteboardExportDescription = "Export an existing whiteboard as preview image, SVG, source code or raw nodes structure."
const WhiteboardUpdateDescription = "" /* 137-byte string literal not displayed */
WhiteboardUpdateDescription describes the whiteboard update shortcut.
Variables ¶
var SyntaxTypeExtensionMap = map[SyntaxType]string{ SyntaxTypePlantUML: ".puml", SyntaxTypeMermaid: ".mmd", }
SyntaxTypeExtensionMap maps whiteboard syntax types to their default file extensions.
var SyntaxTypeNameMap = map[SyntaxType]string{ SyntaxTypePlantUML: "plantuml", SyntaxTypeMermaid: "mermaid", }
SyntaxTypeNameMap maps whiteboard syntax types to their CLI output names.
var WhiteboardExport = common.Shortcut{ Service: "whiteboard", Command: "+export", Description: WhiteboardExportDescription, Risk: "read", Scopes: wbExportScopes, AuthTypes: wbExportAuthTypes, Flags: wbExportFlags, HasFormat: true, Validate: wbExportValidate, DryRun: wbExportDryRun, Execute: wbExportExecute, }
WhiteboardExport registers the `whiteboard +export` shortcut.
var WhiteboardQuery = common.Shortcut{ Service: "whiteboard", Command: "+query", Description: WhiteboardExportDescription, Risk: "read", Scopes: wbExportScopes, AuthTypes: wbExportAuthTypes, Flags: wbQueryFlags, HasFormat: true, Hidden: true, Validate: wbQueryValidate, DryRun: wbQueryDryRun, Execute: wbQueryExecute, }
WhiteboardQuery registers the hidden, backward-compatible `whiteboard +query` shortcut.
var WhiteboardUpdate = common.Shortcut{ Service: "whiteboard", Command: "+update", Description: WhiteboardUpdateDescription, Risk: "write", Scopes: wbUpdateScopes, AuthTypes: wbUpdateAuthTypes, Flags: wbUpdateFlags, HasFormat: false, Validate: wbUpdateValidate, DryRun: wbUpdateDryRun, Execute: wbUpdateExecute, }
WhiteboardUpdate registers the `whiteboard +update` shortcut.
var WhiteboardUpdateOld = common.Shortcut{ Service: "docs", Command: "+whiteboard-update", Description: WhiteboardUpdateDescription, Risk: "write", Scopes: wbUpdateScopes, AuthTypes: wbUpdateAuthTypes, Flags: wbUpdateFlags, HasFormat: false, Validate: wbUpdateValidate, DryRun: wbUpdateDryRun, Execute: wbUpdateExecute, }
WhiteboardUpdateOld 向前兼容历史版本 Doc 域下的更新命令
Functions ¶
Types ¶
type SyntaxType ¶ added in v1.0.8
type SyntaxType int
SyntaxType identifies the diagram syntax extracted from whiteboard code blocks.
const ( // SyntaxTypePlantUML marks PlantUML code blocks. SyntaxTypePlantUML SyntaxType = 1 // SyntaxTypeMermaid marks Mermaid code blocks. SyntaxTypeMermaid SyntaxType = 2 )
func (SyntaxType) ExtensionName ¶ added in v1.0.8
func (s SyntaxType) ExtensionName() string
ExtensionName returns the default file extension for the syntax type.
func (SyntaxType) IsValid ¶ added in v1.0.8
func (s SyntaxType) IsValid() bool
IsValid reports whether the syntax type is one of the supported whiteboard code syntaxes.
func (SyntaxType) String ¶ added in v1.0.8
func (s SyntaxType) String() string
String returns the CLI-facing name for the syntax type.
type WbCliOutput ¶
type WbCliOutput struct {
Code int `json:"code"`
Data WbCliOutputData
RawNodes []interface{} `json:"nodes"` // 从 whiteboard-cli -t openapi 输出的原始请求格式
}
type WbCliOutputData ¶
type WbCliOutputData struct {
To string `json:"to"`
Result struct {
Nodes []interface{} `json:"nodes"`
} `json:"result"`
}