支持以编程方式创建和操作飞书白板。
需要在环境变量或 config.json 中设置 FEISHU_APP_ID 和 FEISHU_APP_SECRET。
所需权限范围:board:whiteboard:node:create
node skills/feishu-whiteboard/create.js "我的架构图"
输出:包含 whiteboard_id 的 JSON。
node skills/feishu-whiteboard/draw.js <whiteboard_id> demo
添加一个矩形、一个圆形以及连接它们的线条。
const { createWhiteboard } = require('./create');
const { addNodes, createShape, createConnector } = require('./draw');
const board = await createWhiteboard("系统设计");
const nodes = [
createShape("web", "rect", 0, 0, 200, 100, "Web 服务器"),
createShape("db", "cylinder", 0, 300, 100, 100, "数据库"),
createConnector("link1", "web", "db")
];
await addNodes(board.whiteboard_id, nodes);
如果遇到 404 page not found 错误,通常意味着您的租户未启用白板 API 或端点 URL 已变更。当前实现使用的端点为 /open-apis/board/v1/whiteboards。