-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs(slides): document --no-lint, the issues field and 4000153 #2608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ lark-cli slides +replace-slide --as user \ | |
| | `--parts` | 是 | JSON 数组(`[{...}, ...]`),单次最多 200 条。支持 `@<file>` 和 `-`(stdin)读取 | | ||
| | `--revision-id` | 否 | 基础版本号;默认 `-1` 表示基于最新版执行;传具体版本号时,服务端以该版本为 base 执行;**传不存在的版本号(超过当前 revision)返回 3350002** | | ||
| | `--tid` | 否 | 并发事务 ID;多人协作长事务才用,单次单人调用留空 | | ||
| | `--no-lint` | 否 | 跳过服务端版式校验(默认开启)。**校验主体是这些 parts 拼装后的整页**,不是片段本身 | | ||
|
|
||
| ## parts 元素结构 | ||
|
|
||
|
|
@@ -172,6 +173,7 @@ lark-cli slides +replace-slide --as user \ | |
| | `revision_id` | 成功后的新版本号,下次做乐观锁时用 | | ||
| | `failed_part_index` | 有部分失败时存在,指向第几条 part 失败 | | ||
| | `failed_reason` | 失败原因文字描述 | | ||
| | `issues` | 与 `failed_reason` 相对:parts 已全部生效,服务端只是仍有发现,不影响本次调用的成功状态。内容是未达阻断级的版式校验发现;校验主体是**拼装后的整页**,因此可能报出页面上原有的元素。格式不固定,不要解析;出现就用 `+screenshot` 复核该页 | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Document both sources of The
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
|
|
||
| 整批作为原子事务:任一 part 失败则整批不生效,服务端通过 `failed_part_index` / `failed_reason` 告诉你是哪条;按此定位修正后重发。 | ||
|
|
||
|
|
@@ -249,6 +251,7 @@ lark-cli slides +replace-slide --as user \ | |
| | `--parts[i] (block_replace) requires non-empty block_id` / `replacement` | 字段名对,但值缺失或是空串 | 按 parts 元素结构补齐值 | | ||
| | `<img>` 不显示 / 显示破图 | `src` 写了外链 URL | 换成通过 [`+media-upload`](lark-slides-media-upload.md) 拿到的 `file_token` | | ||
| | 3350001 | `replacement` 不是合法单根 XML 片段,或 `block_id` 不存在 | CLI 已自动注入 `id` 和 `<content/>`;如果仍报错,重新 `slide.get` 拿最新 XML 确认 `block_id` 存在;检查 XML 结构是否合法;坐标是否超出 960×540 | | ||
| | 4000153 `xml lint blocked` | 服务端版式校验拒绝了本次提交,页面维持原状;校验主体是拼装后的整页,因此片段自身合法也可能因与相邻元素重叠、或页面原有元素越界而被拒 | `error.message` 是完整的校验报告,按其中每条发现给出的修改建议修正;需要调整既有元素时,在同一批 `--parts` 内一并提交 | | ||
| | 403 | 权限不足 | 需要 `slides:presentation:update` 或 `slides:presentation:write_only`;wiki URL 还需要 `wiki:node:read` | | ||
|
|
||
| ## 相关命令 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ | |
| | 1061004 forbidden | 当前用户对演示文稿无编辑权限 | 确认当前用户对目标 PPT 有编辑权限 | | ||
| | 3350001 | XML 非 well-formed、XML 结构不符合服务端要求,或 replace 片段问题 | 优先检查未转义字符;replace 场景再看 `block_id` 和 `<content/>` | | ||
| | 3350002 | `revision_id` 大于当前版本 | 用 `-1` 取当前版本,或重新用 `slides +xml-get` 取最新 `revision_id` | | ||
| | 4000153 `xml lint blocked` | 服务端版式校验拒绝了本次写入,被拒的页面未写入(`+create` 逐页提交,之前的页面保留) | 完整的校验报告在 `error.message`;`+replace-pages --continue-on-error` 不中断整批,被拒的那几页改在 `results[]` 里以 `error_code: 4000153` + `error`(同一份报告)+ `hint` 给出。按报告里每条发现的修改建议修正后重试。只有阻断级发现会拦截,未拦截的发现不会丢失——写入成功时通过返回值里的 `issues` 字段给出。确认误判时才用 `--no-lint` | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Use the command-specific issue field name. This row also covers 🤖 Prompt for AI Agents |
||
| | validation: unsafe file path | `--file` 给了绝对路径或上层路径 | `--file` 必须是 CWD 内相对路径;先 `cd` 到素材目录再执行 | | ||
|
|
||
| ## Command-Specific References | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Qualify the per-page validation statement.
When
--no-lintis set, the CLI skips server-side layout validation. Therefore, “每页各过一次服务端版式校验” is not unconditional and conflicts with the--no-lintparameter description. Change it to “默认每页各过一次” or “未传--no-lint时每页各过一次”.🤖 Prompt for AI Agents