whiteboard

package
v1.0.75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Copyright (c) 2026 Lark Technologies Pte. Ltd. SPDX-License-Identifier: MIT

Index

Constants

View Source
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
)
View Source
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"
)
View Source
const WhiteboardExportDescription = "Export an existing whiteboard as preview image, SVG, source code or raw nodes structure."
View Source
const WhiteboardUpdateDescription = "" /* 137-byte string literal not displayed */

WhiteboardUpdateDescription describes the whiteboard update shortcut.

Variables

View Source
var SyntaxTypeExtensionMap = map[SyntaxType]string{
	SyntaxTypePlantUML: ".puml",
	SyntaxTypeMermaid:  ".mmd",
}

SyntaxTypeExtensionMap maps whiteboard syntax types to their default file extensions.

View Source
var SyntaxTypeNameMap = map[SyntaxType]string{
	SyntaxTypePlantUML: "plantuml",
	SyntaxTypeMermaid:  "mermaid",
}

SyntaxTypeNameMap maps whiteboard syntax types to their CLI output names.

View Source
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.

View Source
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.

View Source
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.

View Source
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

func Shortcuts

func Shortcuts() []common.Shortcut

Shortcuts returns all whiteboard shortcuts.

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL