@amaster.ai/pi-lark 0.1.2-beta.47 → 0.1.2-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/lark-apps/SKILL.md +1 -0
- package/skills/lark-apps/references/lark-apps-cache.md +61 -0
- package/skills/lark-base/SKILL.md +16 -7
- package/skills/lark-base/references/lark-base-data-query.md +11 -4
- package/skills/lark-base/references/lark-base-filter-condition.md +179 -0
- package/skills/lark-base/references/lark-base-form-questions-create.md +40 -7
- package/skills/lark-base/references/lark-base-form-questions-update.md +73 -20
- package/skills/lark-base/references/lark-base-role-guide.md +11 -0
- package/skills/lark-base/references/lark-base-view-set-filter.md +11 -137
- package/skills/lark-base/references/role-config.md +31 -5
- package/skills/lark-calendar/SKILL.md +14 -8
- package/skills/lark-calendar/references/lark-calendar-create.md +6 -6
- package/skills/lark-calendar/references/lark-calendar-recurring.md +1 -0
- package/skills/lark-calendar/references/lark-calendar-room-find.md +2 -1
- package/skills/lark-calendar/references/lark-calendar-schedule-clear-time.md +1 -0
- package/skills/lark-calendar/references/lark-calendar-suggestion.md +1 -1
- package/skills/lark-calendar/references/lark-calendar-update.md +7 -4
- package/skills/lark-contact/SKILL.md +19 -3
- package/skills/lark-contact/references/lark-contact-search-bot.md +60 -0
- package/skills/lark-drive/SKILL.md +21 -44
- package/skills/lark-drive/references/lark-drive-add-comment.md +2 -4
- package/skills/lark-drive/references/lark-drive-add-reply.md +47 -0
- package/skills/lark-drive/references/lark-drive-apply-permission.md +2 -2
- package/skills/lark-drive/references/lark-drive-batch-query-comments.md +46 -0
- package/skills/lark-drive/references/lark-drive-comment-content.md +50 -0
- package/skills/lark-drive/references/lark-drive-comment-location.md +7 -13
- package/skills/lark-drive/references/lark-drive-delete-reply.md +48 -0
- package/skills/lark-drive/references/lark-drive-download.md +5 -1
- package/skills/lark-drive/references/lark-drive-list-comments.md +25 -68
- package/skills/lark-drive/references/lark-drive-list-replies.md +54 -0
- package/skills/lark-drive/references/lark-drive-member-add.md +2 -2
- package/skills/lark-drive/references/lark-drive-member-list.md +65 -0
- package/skills/lark-drive/references/lark-drive-permission-get-setting.md +48 -0
- package/skills/lark-drive/references/lark-drive-preview.md +11 -1
- package/skills/lark-drive/references/lark-drive-react-reply.md +51 -0
- package/skills/lark-drive/references/lark-drive-reactions.md +27 -25
- package/skills/lark-drive/references/lark-drive-resolve-comment.md +45 -0
- package/skills/lark-drive/references/lark-drive-restore-comment.md +46 -0
- package/skills/lark-drive/references/lark-drive-search.md +6 -1
- package/skills/lark-drive/references/lark-drive-secure-label.md +1 -1
- package/skills/lark-drive/references/lark-drive-update-reply.md +46 -0
- package/skills/lark-drive/references/lark-drive-workflow-permission-governance-commands.md +38 -8
- package/skills/lark-drive/references/lark-drive-workflow-permission-governance-outputs.md +10 -10
- package/skills/lark-drive/references/lark-drive-workflow-permission-governance.md +22 -20
- package/skills/lark-slides/SKILL.md +16 -26
- package/skills/lark-slides/references/lark-slides-create.md +14 -5
- package/skills/lark-slides/references/lark-slides-media-upload.md +1 -1
- package/skills/lark-slides/references/slides_xml_schema_definition.xml +491 -31
- package/skills/lark-slides/references/xml-schema-quick-ref.md +39 -0
- package/skills/lark-slides/scripts/sxsd_validator.py +908 -0
- package/skills/lark-slides/scripts/xml_text_overlap_lint.py +633 -124
- package/skills/lark-slides/scripts/xml_text_overlap_lint_test.py +2038 -219
- package/skills/lark-task/references/lark-task-create.md +9 -0
- package/skills/lark-drive/references/lark-drive-comments-guide.md +0 -80
|
@@ -14,72 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# 推荐:直接传用户给出的完整 URL。默认只查未解决评论。
|
|
17
|
-
lark-cli drive +list-comments
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
lark-cli drive +list-comments \
|
|
22
|
-
--url "<DOCUMENT_URL>" \
|
|
23
|
-
--solved-status all
|
|
24
|
-
|
|
25
|
-
# 查询已解决评论。
|
|
26
|
-
lark-cli drive +list-comments \
|
|
27
|
-
--url "<DOCUMENT_URL>" \
|
|
28
|
-
--solved-status true
|
|
29
|
-
|
|
30
|
-
# 只查全文评论或局部评论。
|
|
31
|
-
lark-cli drive +list-comments \
|
|
32
|
-
--url "<DOCUMENT_URL>" \
|
|
33
|
-
--comment-scope whole
|
|
34
|
-
|
|
35
|
-
lark-cli drive +list-comments \
|
|
36
|
-
--url "<DOCUMENT_URL>" \
|
|
37
|
-
--comment-scope partial
|
|
38
|
-
|
|
39
|
-
# 电子表格 URL 保留 /sheets/ 路径,直接原样传入;不要把 sheet token 拼成 /docx/<token>。
|
|
40
|
-
lark-cli drive +list-comments \
|
|
41
|
-
--url "https://example.larksuite.com/sheets/<SHEET_TOKEN>"
|
|
42
|
-
|
|
43
|
-
# 妙搭 apps URL 使用 /page/<token>,shortcut 会识别为 file_type=apps。
|
|
44
|
-
lark-cli drive +list-comments \
|
|
45
|
-
--url "https://example.feishu.cn/page/<APPS_TOKEN>/"
|
|
46
|
-
|
|
47
|
-
# wiki URL 会自动解包。
|
|
48
|
-
lark-cli drive +list-comments \
|
|
49
|
-
--url "https://example.larksuite.com/wiki/<WIKI_TOKEN>"
|
|
50
|
-
|
|
51
|
-
# 裸 wiki token 也支持,但必须显式声明 --type wiki。
|
|
52
|
-
lark-cli drive +list-comments \
|
|
53
|
-
--token "<WIKI_TOKEN>" \
|
|
54
|
-
--type wiki
|
|
55
|
-
|
|
56
|
-
# 裸 token 需要声明 token 对应类型;不要默认当作 docx。这里以 sheet 为例。
|
|
57
|
-
lark-cli drive +list-comments \
|
|
58
|
-
--token "<DOCUMENT_TOKEN>" \
|
|
59
|
-
--type sheet \
|
|
60
|
-
--page-size 100
|
|
61
|
-
|
|
62
|
-
# 妙搭裸 apps token 需要显式声明 --type apps。
|
|
63
|
-
lark-cli drive +list-comments \
|
|
64
|
-
--token "<APPS_TOKEN>" \
|
|
65
|
-
--type apps
|
|
66
|
-
|
|
67
|
-
# docx 需要评论定位关系时再带 need-relation;非 docx 会静默忽略。
|
|
68
|
-
lark-cli drive +list-comments \
|
|
69
|
-
--url "https://example.larksuite.com/docx/<DOCX_TOKEN>" \
|
|
70
|
-
--need-relation
|
|
71
|
-
|
|
72
|
-
# 分页续跑。
|
|
73
|
-
# 先看上一页输出的 has_more;只有 has_more=true 时,才用返回的 page_token 继续。
|
|
74
|
-
lark-cli drive +list-comments \
|
|
75
|
-
--url "<DOCUMENT_URL>" \
|
|
76
|
-
--page-size 100 \
|
|
77
|
-
--page-token "<NEXT_PAGE_TOKEN>"
|
|
78
|
-
|
|
79
|
-
# 预览请求链路,不发真实请求。
|
|
80
|
-
lark-cli drive +list-comments \
|
|
81
|
-
--url "https://example.larksuite.com/wiki/<WIKI_TOKEN>" \
|
|
82
|
-
--dry-run
|
|
17
|
+
lark-cli drive +list-comments --url "<DOCUMENT_URL>"
|
|
18
|
+
|
|
19
|
+
# 只有用户明确要求包含已解决评论时,才传 --solved-status all。
|
|
20
|
+
lark-cli drive +list-comments --url "<DOCUMENT_URL>" --solved-status all
|
|
83
21
|
```
|
|
84
22
|
|
|
85
23
|
## 参数
|
|
@@ -103,7 +41,26 @@ lark-cli drive +list-comments \
|
|
|
103
41
|
- URL 输入时不需要传 `--type`;如果 URL 类型和显式 `--type` 冲突,shortcut 会返回 validation error,建议移除 `--type`。
|
|
104
42
|
- wiki 输入会自动解析到真实文档,再查询评论列表。JSON 输出不额外返回 wiki token 或 wiki node。
|
|
105
43
|
- 输出中的 `items` 保留评论卡片字段,外层补充 `file_token`、`file_type`、`has_more`、`page_token`、`count`;`count` 是当前页返回的评论卡片数。是否继续分页以 `has_more` 为准,而不是只看 `page_token` 是否存在。
|
|
106
|
-
|
|
44
|
+
|
|
45
|
+
## 评论卡片模型
|
|
46
|
+
|
|
47
|
+
- 返回的 `items` 是评论卡片列表,每个 `item` 对应用户界面中的一张评论卡片,不是平铺的互动消息列表。
|
|
48
|
+
- 创建评论时会同时创建该卡片里的第一条 reply;真正承载正文的是 `item.reply_list.replies`,其中第一条 reply(根回复)在用户视角下就是这张卡片里的“评论本身”。更新根回复即改写评论正文(见 [`lark-drive-update-reply.md`](lark-drive-update-reply.md));删除按 reply 逐条生效,卡片在最后一条回复被删时才消失(见 [`lark-drive-delete-reply.md`](lark-drive-delete-reply.md))。
|
|
49
|
+
- `item.has_more=true` 表示该评论卡片下还有回复未包含在本次返回中;这与外层 `has_more`(是否还有下一页评论卡片)是两个不同字段。需要完整回复时继续用 `drive +list-replies --comment-id <id>` 分页拉全。
|
|
50
|
+
|
|
51
|
+
## 统计口径
|
|
52
|
+
|
|
53
|
+
- 统计“评论数”或“评论卡片数”:统计 `items` 长度;全量统计时对所有分页返回的 `items` 长度累加。
|
|
54
|
+
- 统计“回复数”:统计所有 `item.reply_list.replies` 长度之和,再减去 `items` 长度。
|
|
55
|
+
- 统计“总互动数”:统计所有 `item.reply_list.replies` 长度之和,包含每张评论卡片里的首条评论。
|
|
56
|
+
- 任一 `item.has_more=true` 时,先用 `drive +list-replies --comment-id <id>` 把该卡片的回复拉全,再做回复数或总互动数统计,否则会少算。
|
|
57
|
+
|
|
58
|
+
## 排序
|
|
59
|
+
|
|
60
|
+
- 只有当用户明确提到“最新评论”“最后评论”“最早评论”时,才需要按 `create_time` 排序。
|
|
61
|
+
- 排序前必须拉完所有评论分页,不能只取第一页。
|
|
62
|
+
- “最新评论”/“最后评论”:按 `create_time` 降序取第一条。“最早评论”:按 `create_time` 升序取第一条。
|
|
63
|
+
- 用户只说“第一条评论”时,直接使用返回的第一条,不需要额外排序。
|
|
107
64
|
|
|
108
65
|
## 输出
|
|
109
66
|
|
|
@@ -121,5 +78,5 @@ lark-cli drive +list-comments \
|
|
|
121
78
|
## 参考
|
|
122
79
|
|
|
123
80
|
- [lark-drive](../SKILL.md) -- 云空间(云盘/云存储)全部命令
|
|
124
|
-
- [lark-drive-
|
|
81
|
+
- [lark-drive-list-replies](lark-drive-list-replies.md) -- 拉全某张卡片下的回复(统计与 `item.has_more` 补全)
|
|
125
82
|
- [lark-drive-comment-location](lark-drive-comment-location.md) -- 使用 `need_relation` 定位 docx 正文
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# drive +list-replies
|
|
2
|
+
|
|
3
|
+
> **前置条件:** 先阅读 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和权限处理。
|
|
4
|
+
|
|
5
|
+
分页获取某条评论下的回复。
|
|
6
|
+
|
|
7
|
+
## 命令
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 推荐:完整 URL + 评论 ID
|
|
11
|
+
lark-cli drive +list-replies --url "https://example.larksuite.com/docx/<DOCX_TOKEN>" --comment-id '<id>'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 参数
|
|
15
|
+
|
|
16
|
+
| 参数 | 必填 | 说明 |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `--url` | 与 `--token` 二选一 | 推荐入口。支持 doc/docx/sheet/file/slides/base/bitable/apps/wiki URL;apps 妙搭 URL 使用 `/page/<token>`;wiki URL 会自动解析到真实文档。 |
|
|
19
|
+
| `--token` | 与 `--url` 二选一 | 裸 token 或 URL。裸 token 必须搭配 `--type`;wiki token 使用 `--type wiki`。 |
|
|
20
|
+
| `--type` | 裸 token 时必填 | 传 token 对应类型:`doc`、`docx`、`sheet`、`file`、`slides`、`bitable`、`base`、`apps`、`wiki`。wiki token 使用 `wiki`;传 `base` 时,CLI 会按 `bitable` 类型处理。 |
|
|
21
|
+
| `--comment-id` | 是 | 评论 ID;来自 `drive +list-comments` 的 `items[].comment_id` |
|
|
22
|
+
| `--page-size` | 否 | 1-100,默认 50 |
|
|
23
|
+
| `--page-token` | 否 | 上次输出的 `page_token`;`has_more=true` 时用它续拉 |
|
|
24
|
+
| `--need-reaction` | 否 | 在回复上返回 reaction 数据,见 [`lark-drive-reactions.md`](lark-drive-reactions.md) |
|
|
25
|
+
|
|
26
|
+
## 行为说明
|
|
27
|
+
|
|
28
|
+
- 根回复承载评论正文本身,是回复列表中创建最早的一条:**仅第一页(未传 `--page-token`)的 `items[0]` 是根回复**;翻页后(传了 `--page-token`)返回的 `items[0]` 只是普通回复,不要按位置当作根回复去更新或删除。
|
|
29
|
+
- 输出字段:`items[].reply_id` / `user_id` / `create_time` / `update_time` / `content.elements`,供 `+update-reply`、`+delete-reply` 使用。
|
|
30
|
+
- 检查回复归属(更新/删除前):比对 `items[].user_id`(open_id)与当前身份,判断是不是自己创建的回复。
|
|
31
|
+
- 输出的 `items` 始终是 JSON 数组(服务端省略时归一化为 `[]`)。
|
|
32
|
+
|
|
33
|
+
## 输出
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"file_token": "docx_token",
|
|
38
|
+
"file_type": "docx",
|
|
39
|
+
"comment_id": "<comment_id>",
|
|
40
|
+
"items": [],
|
|
41
|
+
"has_more": false,
|
|
42
|
+
"page_token": "",
|
|
43
|
+
"count": 0
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`items` 是回复数组;是否继续翻页以 `has_more` 为准,`has_more=true` 时用返回的 `page_token` 续拉。
|
|
48
|
+
|
|
49
|
+
## 参考
|
|
50
|
+
|
|
51
|
+
- [lark-drive-list-comments](lark-drive-list-comments.md) -- 评论卡片模型与统计口径
|
|
52
|
+
- [lark-drive-update-reply](lark-drive-update-reply.md) -- 更新回复
|
|
53
|
+
- [lark-drive-delete-reply](lark-drive-delete-reply.md) -- 删除回复
|
|
54
|
+
- [lark-drive-reactions](lark-drive-reactions.md) -- reaction 查询与写入
|
|
@@ -20,8 +20,8 @@ lark-cli drive +member-add \
|
|
|
20
20
|
|
|
21
21
|
| 参数 | 必填 | 说明 |
|
|
22
22
|
|------|----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
23
|
-
| `--token` | 是 | 裸 token 或完整 URL。路径支持 `/drive/folder/`、`/docx/`、`/doc/`、`/sheets/`、`/base/`、`/bitable/`、`/wiki/`、`/file/`、`/mindnotes/`、`/slides/`、`/minutes/`;URL 输入可从路径推断 `--type`,裸 token 不做前缀推断 |
|
|
24
|
-
| `--type` | 必填 | 目标资源类型:`docx` / `doc` / `sheet` / `bitable` / `file` / `folder` / `wiki` / `mindnote` / `slides` / `minutes`。传 URL 时可省略;裸 token 必须显式传;若同时传 URL 和 `--type`,显式 `--type` 覆盖 URL 推断
|
|
23
|
+
| `--token` | 是 | 裸 token 或完整 URL。路径支持 `/drive/folder/`、`/docx/`、`/doc/`、`/sheets/`、`/base/`、`/bitable/`、`/wiki/`、`/file/`、`/mindnotes/`、`/slides/`、`/minutes/`、`/page/`;URL 输入可从路径推断 `--type`,裸 token 不做前缀推断 |
|
|
24
|
+
| `--type` | 必填 | 目标资源类型:`docx` / `doc` / `sheet` / `bitable` / `file` / `folder` / `wiki` / `mindnote` / `slides` / `minutes` / `apps`。传 URL 时可省略;裸 token 必须显式传;若同时传 URL 和 `--type`,显式 `--type` 覆盖 URL 推断 |
|
|
25
25
|
| `--member-id` | 是 | 协作者 ID;逗号分隔可批量添加,最多 10 个 |
|
|
26
26
|
| `--member-type` | 是 | member-id 的类型;支持 `email` / `openid` / `unionid` / `openchat` / `opendepartmentid` / `groupid` / `appid` / `wikispaceid`。在实际使用里,给当前应用授权仍优先推荐 bot `open_id` + `openid`。 |
|
|
27
27
|
| `--member-kind` | 条件必填 | 仅当 `--member-type=wikispaceid` 时填写,映射到请求 body 的 `type` 字段。取值:`wiki_space_member` / `wiki_space_viewer` / `wiki_space_editor`。其他 member-type 禁止传此参数。 |
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# drive +member-list(查询协作者/授权成员列表)
|
|
2
|
+
|
|
3
|
+
本 skill 对应 shortcut:`lark-cli drive +member-list`。它读取 Drive 文档、文件、文件夹或 wiki 节点的协作者/授权成员列表。
|
|
4
|
+
|
|
5
|
+
## 命令
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# URL 自动推断 type
|
|
9
|
+
lark-cli drive +member-list \
|
|
10
|
+
--token 'https://example.feishu.cn/drive/folder/<folder_token>' \
|
|
11
|
+
--as user --format json
|
|
12
|
+
|
|
13
|
+
# 查询附加字段
|
|
14
|
+
lark-cli drive +member-list \
|
|
15
|
+
--token '<token>' \
|
|
16
|
+
--type docx \
|
|
17
|
+
--fields 'name,type,external_label' \
|
|
18
|
+
--as user --format json
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 参数
|
|
23
|
+
|
|
24
|
+
| 参数 | 必填 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| `--token` | 是 | 裸 token 或完整 URL。URL 路径支持 `/folder/`、`/docx/`、`/doc/`、`/sheets/`、`/base/`、`/bitable/`、`/wiki/`、`/file/`、`/mindnotes/`、`/slides/`、`/minutes/`、`/page/`。 |
|
|
27
|
+
| `--type` | 裸 token 必填 | 目标类型:`doc` / `sheet` / `file` / `wiki` / `bitable` / `docx` / `mindnote` / `minutes` / `slides` / `folder` / `apps`。URL 可自动推断;如果同时传 URL 和冲突的 `--type`,CLI 会拒绝。 |
|
|
28
|
+
| `--fields` | 否 | 默认不传。可取 `name` / `type` / `avatar` / `external_label`,支持逗号分隔;也可传 `*` 请求当前支持的所有附加字段。该参数只声明期望返回的字段,不授予字段级权限。 |
|
|
29
|
+
| `--perm-type` | 否 | 仅 `--type wiki` 有效;取值 `container` / `single_page`。 |
|
|
30
|
+
| `--dry-run` | 否 | 只打印请求,不调用 API。 |
|
|
31
|
+
|
|
32
|
+
## 输出
|
|
33
|
+
|
|
34
|
+
JSON 输出原样透传 API 的 `data` :
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"ok": true,
|
|
39
|
+
"identity": "user",
|
|
40
|
+
"data": {
|
|
41
|
+
"items": [
|
|
42
|
+
{
|
|
43
|
+
"member_type": "openid",
|
|
44
|
+
"member_id": "ou_xxx",
|
|
45
|
+
"perm": "view",
|
|
46
|
+
"perm_type": "container",
|
|
47
|
+
"type": "user",
|
|
48
|
+
"name": "zhangsan",
|
|
49
|
+
"external_label": false
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`--format pretty` 会轻量展示成员 ID、成员类型、权限、wiki `perm_type` 和已返回的附加字段。机器读取优先使用 `--format json`。
|
|
57
|
+
|
|
58
|
+
## 行为说明
|
|
59
|
+
|
|
60
|
+
- **身份支持**:`--as user` 和 `--as bot` 均可用;缺 scope 或目标权限时按统一 permission 错误路径处理。
|
|
61
|
+
- **接口 scope**:查询成员列表需要 `docs:permission.member:retrieve`。
|
|
62
|
+
- **fields 默认**:不传 `--fields` 时按官方 API 默认,不请求姓名、头像、外部标签等附加字段;需要时显式指定。
|
|
63
|
+
- **字段级权限**:`--fields` 只控制请求哪些附加字段,不保证服务端一定返回。请求用户的 `name` / `avatar` 时,应用还需开通 `contact:user.base:readonly`(“获取用户基本信息”;已具备官方兼容的历史通讯录权限也可满足要求)。
|
|
64
|
+
- **缺字段语义**:字段级权限或数据可见性不足时,接口仍可能成功,但会省略相应敏感字段。响应中缺少已请求字段表示“服务端未返回”,不能解释为字段值为空,也不能据此认定成员信息完整。
|
|
65
|
+
- **folder 支持**:CLI 支持 `--type folder` 并会按需求发送 `type=folder`;部分环境的后端如果尚未放开 folder 枚举,可能返回 `99992402 field validation failed`。
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# drive +permission-get-setting(查询权限设置)
|
|
2
|
+
|
|
3
|
+
本 skill 对应 shortcut:`lark-cli drive +permission-get-setting`。它读取单个 Drive 资源自身的公开访问、分享、协作者管理、安全与评论权限设置,不递归读取文件夹中的子资源。
|
|
4
|
+
|
|
5
|
+
## 命令
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 通过 URL 自动推断 type
|
|
9
|
+
lark-cli drive +permission-get-setting \
|
|
10
|
+
--token 'https://example.feishu.cn/drive/folder/<folder_token>' \
|
|
11
|
+
--as user --format json
|
|
12
|
+
|
|
13
|
+
# 通过 bare token 显式指定 type
|
|
14
|
+
lark-cli drive +permission-get-setting \
|
|
15
|
+
--token '<folder_token>' \
|
|
16
|
+
--type folder \
|
|
17
|
+
--as user --format json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 参数
|
|
21
|
+
|
|
22
|
+
| 参数 | 必填 | 说明 |
|
|
23
|
+
|------|------|------|
|
|
24
|
+
| `--token` | 是 | bare token 或完整 URL。URL 路径支持 `/folder/`、`/docx/`、`/doc/`、`/sheets/`、`/base/`、`/bitable/`、`/wiki/`、`/file/`、`/mindnotes/`、`/slides/`、`/minutes/`、`/page/`。 |
|
|
25
|
+
| `--type` | bare token 必填 | 目标类型:`doc` / `sheet` / `file` / `wiki` / `bitable` / `docx` / `mindnote` / `minutes` / `slides` / `folder` / `apps`。URL 可自动推断;如果同时传 URL 和冲突的 `--type`,CLI 会拒绝。 |
|
|
26
|
+
| `--dry-run` | 否 | 只打印请求,不调用 API。 |
|
|
27
|
+
|
|
28
|
+
## 输出
|
|
29
|
+
|
|
30
|
+
JSON 输出中的 `data.permission_public` 是目标当前的权限设置;服务端未返回该字段时,命令会报响应结构错误,而不会把其他字段伪装成权限设置。
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"ok": true,
|
|
35
|
+
"identity": "user",
|
|
36
|
+
"data": {
|
|
37
|
+
"permission_public": {}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`--format pretty` 会展示完整的 `permission_public` 对象,包括服务端将来新增的字段。
|
|
43
|
+
|
|
44
|
+
## 行为说明
|
|
45
|
+
|
|
46
|
+
- **身份支持**:`--as user` 和 `--as bot` 均可用。
|
|
47
|
+
- **所需 scope**:`docs:permission.setting:read`。
|
|
48
|
+
- **单目标读取**:命令只读取 `--token` 指向资源自身的权限设置;`--type folder` 不会递归读取子资源。
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、权限处理和安全规则。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
查看或下载 Drive 文件内容,或列出并获取文件可用的预览产物。这个 shortcut 不猜测默认类型:
|
|
6
6
|
|
|
7
|
+
- 如果只需要查看或下载文件内容,或不关心 PDF/text/image 等转换预览,优先使用 `--type source_file --output <path>`
|
|
7
8
|
- 只想看候选项时,用 `--list-only`
|
|
9
|
+
- 如果需要服务端生成的预览效果,例如 doc/docx 的 PDF 版式预览,先用 `--list-only` 查看候选项,再按候选项选择 `--type pdf` / `text` / `image` 等
|
|
8
10
|
- 想下载时,必须显式传 `--type` 和 `--output`
|
|
11
|
+
- 如果 `--list-only` 没有可用预览候选项,或错误提示明确建议使用 `--type source_file`,可以改用 `--type source_file --output <path>` 查看文件内容;资源不存在、token 无效等终态错误需要先修正输入
|
|
9
12
|
- 如果某个候选项还在生成中,会返回结构化错误并提示先重新 `--list-only`
|
|
10
13
|
|
|
11
14
|
### 命令
|
|
12
15
|
|
|
13
16
|
```bash
|
|
17
|
+
# 查看文件内容
|
|
18
|
+
lark-cli drive +preview \
|
|
19
|
+
--file-token "<FILE_TOKEN>" \
|
|
20
|
+
--type source_file \
|
|
21
|
+
--output ./artifacts/source
|
|
22
|
+
|
|
14
23
|
# 列出可用预览候选项
|
|
15
24
|
lark-cli drive +preview \
|
|
16
25
|
--file-token "<FILE_TOKEN>" \
|
|
@@ -78,6 +87,7 @@ lark-cli drive +preview \
|
|
|
78
87
|
|
|
79
88
|
- 不传 `--list-only` 时,必须显式传 `--type` 和 `--output`
|
|
80
89
|
- 不会隐式选择“第一个候选项”作为默认下载目标
|
|
90
|
+
- `--type source_file` 用于查看文件内容,不依赖 `--list-only` 返回的候选项;它适合读取或保存源内容,不等同于 PDF/text/image 等转换预览
|
|
81
91
|
- 候选项状态来自后端 `preview_status` 枚举,例如 `READY` / `PROCESSING` / `FAILED` / `NO_SUPPORT`
|
|
82
92
|
- 本地文件名在未显式带扩展名时,会结合响应头自动补扩展名
|
|
83
93
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# drive +react-reply
|
|
2
|
+
|
|
3
|
+
> **前置条件:** 先阅读 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和权限处理。reaction 查询规则、语义联想与完整 `reaction_type` 枚举见跨切面专题 [`lark-drive-reactions.md`](lark-drive-reactions.md)。
|
|
4
|
+
|
|
5
|
+
给一条回复添加或删除表情回应(reaction)。操作对象始终是 `reply_id`。
|
|
6
|
+
|
|
7
|
+
## 命令
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 加 reaction
|
|
11
|
+
lark-cli drive +react-reply --url "https://example.larksuite.com/docx/<DOCX_TOKEN>" --reply-id '<id>' --emoji THUMBSUP --action add
|
|
12
|
+
|
|
13
|
+
# 删除自己加的 reaction:仍需传要删除的那个 --emoji
|
|
14
|
+
lark-cli drive +react-reply --url "https://example.larksuite.com/docx/<DOCX_TOKEN>" --reply-id '<id>' --emoji THUMBSUP --action delete
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 参数
|
|
18
|
+
|
|
19
|
+
| 参数 | 必填 | 说明 |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `--url` | 与 `--token` 二选一 | 推荐入口。支持 doc/docx/sheet/file/slides/base/bitable/apps/wiki URL;apps 妙搭 URL 使用 `/page/<token>`;wiki URL 会自动解析到真实文档。 |
|
|
22
|
+
| `--token` | 与 `--url` 二选一 | 裸 token 或 URL。裸 token 必须搭配 `--type`;wiki token 使用 `--type wiki`。 |
|
|
23
|
+
| `--type` | 裸 token 时必填 | 传 token 对应类型:`doc`、`docx`、`sheet`、`file`、`slides`、`bitable`、`base`、`apps`、`wiki`。wiki token 使用 `wiki`;传 `base` 时,CLI 会按 `bitable` 类型处理。 |
|
|
24
|
+
| `--reply-id` | 是 | 要操作的回复 ID;来自 `drive +list-replies` 的 `items[].reply_id`。给“这条评论”加/删表情时取该评论根回复(第一页 `items[0]`)的 `reply_id` |
|
|
25
|
+
| `--emoji` | 是 | `reaction_type` 值,大小写敏感;本地按平台枚举校验。完整列表与语义映射见 [`lark-drive-reactions.md`](lark-drive-reactions.md) |
|
|
26
|
+
| `--action` | 是 | `add` 添加;`delete` 删除当前身份自己加的 reaction |
|
|
27
|
+
|
|
28
|
+
## 行为说明
|
|
29
|
+
|
|
30
|
+
- `--emoji` 大小写敏感(如 `THUMBSUP` 与 `ThumbsDown`),并做本地枚举校验兜底。服务端不校验 `reaction_type`:任意字符串都会被接受并持久化成一条损坏的 reaction,所以本地校验是唯一防线;直接调原生命令时必须自行保证取值合法。
|
|
31
|
+
- add / delete 幂等:重复添加已有 reaction、删除不存在的 reaction 都会成功返回且无副作用;delete 只取消当前身份自己加的 reaction。
|
|
32
|
+
- 对根回复操作等价于给评论本身加 / 删表情。
|
|
33
|
+
- 读回 reaction:在 `drive +list-replies` / `drive +batch-query-comments` 上带 `--need-reaction`;`count=0` 的条目是已删除 reaction 的残留,判断存在与否按 `count>0` 过滤。
|
|
34
|
+
|
|
35
|
+
## 输出
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"file_token": "docx_token",
|
|
40
|
+
"file_type": "docx",
|
|
41
|
+
"reply_id": "<reply_id>",
|
|
42
|
+
"reaction_type": "THUMBSUP",
|
|
43
|
+
"action": "add",
|
|
44
|
+
"updated": true
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 参考
|
|
49
|
+
|
|
50
|
+
- [lark-drive-reactions](lark-drive-reactions.md) -- reaction 查询规则、语义与完整枚举
|
|
51
|
+
- [lark-drive-list-replies](lark-drive-list-replies.md) -- 获取 reply_id
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# drive reactions
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../SKILL.md`](../SKILL.md) 了解 Drive 评论入口,再阅读 [`lark-drive-comments
|
|
3
|
+
> **前置条件:** 先阅读 [`../SKILL.md`](../SKILL.md) 了解 Drive 评论入口,再阅读 [`lark-drive-list-comments.md`](lark-drive-list-comments.md) 了解评论卡片模型、评论数/回复数统计口径、`file_token` / `file_type` 规则;同时阅读 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
4
|
|
|
5
|
-
处理文档评论 / 回复上的 reaction(点赞、表情、各表情数量、谁点了什么、添加/删除表情)。这个场景不常见,但规则比较集中:查询时只有在用户明确需要 reaction
|
|
5
|
+
处理文档评论 / 回复上的 reaction(点赞、表情、各表情数量、谁点了什么、添加/删除表情)。这个场景不常见,但规则比较集中:查询时只有在用户明确需要 reaction 信息时才在 `drive +list-comments` / `+batch-query-comments` / `+list-replies` 上带 `--need-reaction`;写入优先使用 `drive +react-reply`(命令参数细节见 [`lark-drive-react-reply.md`](lark-drive-react-reply.md)),操作对象始终是 `reply_id`。本文是跨切面专题,集中放 reaction 的查询规则、语义联想和完整枚举。
|
|
6
6
|
|
|
7
7
|
> [!IMPORTANT]
|
|
8
8
|
> **`reaction_type` 只能使用本文下方“完整 `reaction_type` 列表”中定义的枚举值。**
|
|
@@ -16,49 +16,50 @@
|
|
|
16
16
|
|
|
17
17
|
## 查询规则
|
|
18
18
|
|
|
19
|
-
- `drive
|
|
20
|
-
- `
|
|
21
|
-
- 遍历评论卡片并顺带拿 reaction:使用 `drive
|
|
22
|
-
- 已知评论 ID,批量查看 reaction:使用 `drive
|
|
23
|
-
- 某张评论卡片下继续翻页拉 reply reaction:使用 `drive
|
|
24
|
-
-
|
|
19
|
+
- `drive +list-comments`、`drive +batch-query-comments`、`drive +list-replies` 都支持 `--need-reaction`。
|
|
20
|
+
- `--need-reaction` 只在用户明确需要 reaction 信息时再带;如果用户只关心评论正文、回复正文、评论数 / 回复数,默认不要加。
|
|
21
|
+
- 遍历评论卡片并顺带拿 reaction:使用 `drive +list-comments --need-reaction`。
|
|
22
|
+
- 已知评论 ID,批量查看 reaction:使用 `drive +batch-query-comments --need-reaction`。
|
|
23
|
+
- 某张评论卡片下继续翻页拉 reply reaction:使用 `drive +list-replies --need-reaction`,每一页都要持续带。
|
|
24
|
+
- 返回形状:`items[].reactions[]` 为 `{reaction_key, count, ahead_users[]}`;**`count=0` 的条目是已删除 reaction 的残留,统计与判断是否存在都要按 `count>0` 过滤**。
|
|
25
25
|
|
|
26
26
|
## 查询示例
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# 遍历评论卡片,并把 reaction 一起拿回来
|
|
30
|
-
lark-cli drive
|
|
31
|
-
--params '{"file_token":"<DOC_TOKEN>","file_type":"docx","need_reaction":true}'
|
|
30
|
+
lark-cli drive +list-comments --url '<DOC_URL>' --need-reaction
|
|
32
31
|
|
|
33
32
|
# 已知 comment_id,批量查询评论卡片 reaction
|
|
34
|
-
lark-cli drive
|
|
35
|
-
--params '{"file_token":"<DOC_TOKEN>","file_type":"docx"}' \
|
|
36
|
-
--data '{"comment_ids":["<COMMENT_ID>"],"need_reaction":true}'
|
|
33
|
+
lark-cli drive +batch-query-comments --url '<DOC_URL>' --comment-ids '<COMMENT_ID>' --need-reaction
|
|
37
34
|
|
|
38
35
|
# 继续翻某张评论卡片下的 replies,并把 reaction 一起拿回来
|
|
39
|
-
lark-cli drive
|
|
40
|
-
--params '{"file_token":"<DOC_TOKEN>","comment_id":"<COMMENT_ID>","file_type":"docx","need_reaction":true}'
|
|
36
|
+
lark-cli drive +list-replies --url '<DOC_URL>' --comment-id '<COMMENT_ID>' --need-reaction
|
|
41
37
|
```
|
|
42
38
|
|
|
43
39
|
## 写入规则
|
|
44
40
|
|
|
45
|
-
- 添加 / 删除 reaction
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
41
|
+
- 添加 / 删除 reaction 优先使用 `drive +react-reply`;命令参数、目标定位和 dry-run 见 [`lark-drive-react-reply.md`](lark-drive-react-reply.md)。
|
|
42
|
+
- 操作对象是 `reply_id`(来自 `drive +list-replies` 的 `items[].reply_id`),不是 `comment_id`。
|
|
43
|
+
- 如果用户说要给"这条评论"加 / 删 reaction,取该评论卡片根回复(第一页 `items[0]`)的 `reply_id` 再操作。
|
|
44
|
+
- add / delete 幂等:重复添加已有 reaction、删除不存在的 reaction 都会成功返回且无副作用;delete 只取消当前身份自己加的 reaction。
|
|
45
|
+
- **服务端不校验 `reaction_type`:任意字符串都会被接受并持久化成一条损坏的 reaction**;`+react-reply --emoji` 会按平台枚举做本地校验兜底,直接调原生命令时必须自行保证取值合法。
|
|
46
|
+
- 原生 `drive file.comment.reply.reactions update_reaction` 只在需要 shortcut 未暴露的字段时兜底使用,`--params` 带 `file_token`/`file_type`,`--data` 传 `action=add|delete`、`reply_id`、`reaction_type`。
|
|
49
47
|
|
|
50
48
|
## 写入示例
|
|
51
49
|
|
|
52
50
|
```bash
|
|
53
51
|
# 给某条 reply 添加一个点赞 reaction
|
|
54
|
-
lark-cli drive
|
|
55
|
-
--
|
|
56
|
-
|
|
52
|
+
lark-cli drive +react-reply --url '<DOC_URL>' \
|
|
53
|
+
--reply-id '<REPLY_ID>' --emoji THUMBSUP --action add
|
|
54
|
+
|
|
55
|
+
# 删除某条 reply 上已有的 DONE reaction(wiki URL 自动解包)
|
|
56
|
+
lark-cli drive +react-reply --url '<WIKI_URL>' \
|
|
57
|
+
--reply-id '<REPLY_ID>' --emoji DONE --action delete
|
|
57
58
|
|
|
58
|
-
#
|
|
59
|
+
# 原生命令兜底(注意:原生路径没有本地枚举校验)
|
|
59
60
|
lark-cli drive file.comment.reply.reactions update_reaction \
|
|
60
61
|
--params '{"file_token":"<DOC_TOKEN>","file_type":"docx"}' \
|
|
61
|
-
--data '{"action":"
|
|
62
|
+
--data '{"action":"add","reply_id":"<REPLY_ID>","reaction_type":"THUMBSUP"}'
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
> [!CAUTION]
|
|
@@ -66,7 +67,7 @@ lark-cli drive file.comment.reply.reactions update_reaction \
|
|
|
66
67
|
|
|
67
68
|
## `reaction_type` 使用规则
|
|
68
69
|
|
|
69
|
-
- `reaction_type`
|
|
70
|
+
- `reaction_type` 必须传平台定义的枚举字符串,大小写敏感;`drive +react-reply` 的 `--emoji` 会本地校验(原生命令不校验、服务端也不校验)。
|
|
70
71
|
- 不要擅自把 mixed-case 值改成全大写,例如 `Yes`、`No`、`Get`、`EatingFood`、`CheckMark`、`CrossMark` 都要按原值传。
|
|
71
72
|
- **不要编造列表外的 `reaction_type`,也不要把自然语言描述臆造成平台未定义的新枚举**。
|
|
72
73
|
- 如果用户给的是自然语言语义(如“点赞”“在处理中”“确认一下”),可以在下方枚举列表内选择语义最接近的现有值;如果是近似映射,应在执行时明确告知用户。
|
|
@@ -110,4 +111,5 @@ Music, Typing, Pepper, CheckMark, CrossMark
|
|
|
110
111
|
## 参考
|
|
111
112
|
|
|
112
113
|
- [lark-drive](../SKILL.md) -- 云空间(云盘/云存储)全部命令
|
|
114
|
+
- [lark-drive-react-reply](lark-drive-react-reply.md) -- `+react-reply` 命令参数
|
|
113
115
|
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# drive +resolve-comment
|
|
2
|
+
|
|
3
|
+
> **前置条件:** 先阅读 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和权限处理。
|
|
4
|
+
|
|
5
|
+
把一条评论标记为已解决。反向操作——重新打开已解决评论——是独立命令 [`lark-drive-restore-comment.md`](lark-drive-restore-comment.md)。
|
|
6
|
+
|
|
7
|
+
用户说“把这条评论标记为已处理 / 已完成 / 关闭”对应本命令。
|
|
8
|
+
|
|
9
|
+
## 命令
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 推荐:完整 URL + 评论 ID
|
|
13
|
+
lark-cli drive +resolve-comment --url "https://example.larksuite.com/docx/<DOCX_TOKEN>" --comment-id '<id>'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 参数
|
|
17
|
+
|
|
18
|
+
| 参数 | 必填 | 说明 |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `--url` | 与 `--token` 二选一 | 推荐入口。支持 doc/docx/sheet/file/slides/base/bitable/apps/wiki URL;apps 妙搭 URL 使用 `/page/<token>`;wiki URL 会自动解析到真实文档。 |
|
|
21
|
+
| `--token` | 与 `--url` 二选一 | 裸 token 或 URL。裸 token 必须搭配 `--type`;wiki token 使用 `--type wiki`。 |
|
|
22
|
+
| `--type` | 裸 token 时必填 | 传 token 对应类型:`doc`、`docx`、`sheet`、`file`、`slides`、`bitable`、`base`、`apps`、`wiki`。wiki token 使用 `wiki`;传 `base` 时,CLI 会按 `bitable` 类型处理。 |
|
|
23
|
+
| `--comment-id` | 是 | 要解决的评论 ID;来自 `drive +list-comments` 的 `items[].comment_id` |
|
|
24
|
+
|
|
25
|
+
## 行为说明
|
|
26
|
+
|
|
27
|
+
- 这是写操作。
|
|
28
|
+
- 对同一条评论连续翻转解决状态可能触发服务端限流(HTTP 429);连续调用之间留间隔或短暂延迟后重试。
|
|
29
|
+
|
|
30
|
+
## 输出
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"file_token": "docx_token",
|
|
35
|
+
"file_type": "docx",
|
|
36
|
+
"comment_id": "<comment_id>",
|
|
37
|
+
"action": "resolve",
|
|
38
|
+
"is_solved": true,
|
|
39
|
+
"updated": true
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 参考
|
|
44
|
+
|
|
45
|
+
- [lark-drive-restore-comment](lark-drive-restore-comment.md) -- 恢复(重新打开)评论
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# drive +restore-comment
|
|
2
|
+
|
|
3
|
+
> **前置条件:** 先阅读 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和权限处理。
|
|
4
|
+
|
|
5
|
+
恢复 / 重新打开一条已解决的评论。反向操作——把评论标记为已解决——是独立命令 [`lark-drive-resolve-comment.md`](lark-drive-resolve-comment.md)。
|
|
6
|
+
|
|
7
|
+
用户说“重新打开 / 取消解决 / 恢复这条评论”对应本命令。
|
|
8
|
+
|
|
9
|
+
## 命令
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 推荐:完整 URL + 评论 ID
|
|
13
|
+
lark-cli drive +restore-comment --url "https://example.larksuite.com/docx/<DOCX_TOKEN>" --comment-id '<id>'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 参数
|
|
17
|
+
|
|
18
|
+
| 参数 | 必填 | 说明 |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `--url` | 与 `--token` 二选一 | 推荐入口。支持 doc/docx/sheet/file/slides/base/bitable/apps/wiki URL;apps 妙搭 URL 使用 `/page/<token>`;wiki URL 会自动解析到真实文档。 |
|
|
21
|
+
| `--token` | 与 `--url` 二选一 | 裸 token 或 URL。裸 token 必须搭配 `--type`;wiki token 使用 `--type wiki`。 |
|
|
22
|
+
| `--type` | 裸 token 时必填 | 传 token 对应类型:`doc`、`docx`、`sheet`、`file`、`slides`、`bitable`、`base`、`apps`、`wiki`。wiki token 使用 `wiki`;传 `base` 时,CLI 会按 `bitable` 类型处理。 |
|
|
23
|
+
| `--comment-id` | 是 | 要恢复的评论 ID;来自 `drive +list-comments` 的 `items[].comment_id` |
|
|
24
|
+
|
|
25
|
+
## 行为说明
|
|
26
|
+
|
|
27
|
+
- 这是写操作。
|
|
28
|
+
- **找目标评论必须带 `--solved-status`**:`drive +list-comments` 默认只返回未解决评论,本命令的目标恰好是已解决评论,直接用默认口径查会一条都找不到。先用 `drive +list-comments --solved-status true`(只看已解决)或 `--solved-status all`(全部)取 `items[].comment_id`。
|
|
29
|
+
- 对同一条评论连续翻转解决状态可能触发服务端限流(HTTP 429);连续调用之间留间隔或短暂延迟后重试。
|
|
30
|
+
|
|
31
|
+
## 输出
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"file_token": "docx_token",
|
|
36
|
+
"file_type": "docx",
|
|
37
|
+
"comment_id": "<comment_id>",
|
|
38
|
+
"action": "restore",
|
|
39
|
+
"is_solved": false,
|
|
40
|
+
"updated": true
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 参考
|
|
45
|
+
|
|
46
|
+
- [lark-drive-resolve-comment](lark-drive-resolve-comment.md) -- 解决(标记已解决)评论
|
|
@@ -26,11 +26,16 @@
|
|
|
26
26
|
> **`--query` 最长 30 个字符**:按字符数(Unicode 码点)算,中文每字算 1 个,与 ASCII 同口径;超过 30 会被服务端拒绝(`99992402 field validation failed`,**是报错不是截断**)。长关键词必须先压缩成核心实体 + 主题词(如把整句问题压成「项目名 + 主题」再搜),不要把整句原问塞进 `--query`。
|
|
27
27
|
>
|
|
28
28
|
> **列表型请求不要硬塞关键词**:如果用户只是要求"我这月创建的所有文档"、"最近半年我编辑过的文档"、"按类型分类统计"这类范围浏览 / 汇总请求,且没有给出标题片段或业务关键词,应使用 `--query ""` 搭配 `--created-by-me`、`--mine`、`--created-*`、`--edited-*`、`--doc-types` 等过滤条件。不要把"查找"、"所有文档"、"最近更新过"、"按类型分类统计"这类动作词或统计意图放进 `--query`,否则会把本来应靠 filter 命中的结果过度收窄。
|
|
29
|
+
>
|
|
30
|
+
> **标题词 + 正文词联合搜索**:如果用户同时给出标题关键词和正文关键词,并要求同一资源同时满足两项条件,优先执行一条普通联合搜索:`lark-cli drive +search --query "标题词 正文词"`,并在同一条命令中叠加用户指定的 `--folder-tokens`、`--doc-types` 等过滤条件。不要把这种联合搜索拆成“标题搜索 + 正文搜索”后自行拼交集;也不要把 `--only-title` 或 `intitle:` 用作主候选路径。只有用户明确只查标题时,才使用 `--only-title` 或 `intitle:`。
|
|
31
|
+
>
|
|
32
|
+
> 用户要求最终返回 N 条时,N 是输出上限,不等于 `--page-size N`。逐页根据 `title` 和 `summary_highlighted` 保留同时满足两项条件的候选;有效候选不足 N 且 `has_more=true` 时,保持同一 query 和过滤条件,使用 `--page-token` 继续,最多检查 3 页。摘要不足以判断正文条件时,只对标题已匹配的候选串行读取正文,确认一个再处理下一个,找到 N 条后停止;不要并发拉取正文。检查 3 页后仍不足时,返回已确认结果并建议用户调整标题词、正文词或搜索范围,不要无界扫描。
|
|
29
33
|
|
|
30
34
|
### 自然语言 → 命令映射速查
|
|
31
35
|
|
|
32
36
|
| 用户说 | 命令 |
|
|
33
37
|
|---|---|
|
|
38
|
+
| 标题含某词且正文含某词,限定文件夹内最多 N 个结果(N 为最终输出上限;按上文规则分页筛选,勿作为 `--page-size`) | `lark-cli drive +search --query "标题词 正文词" --folder-tokens <FOLDER_TOKEN>` |
|
|
34
39
|
| 我这月创建的所有文档,按类型分类统计 | `lark-cli drive +search --query "" --created-by-me --created-since "<YYYY-MM-DD>" --created-until "<YYYY-MM-DD>"` |
|
|
35
40
|
| 最近半年我编辑过的文档,看看哪些最近更新过 | `lark-cli drive +search --query "" --edited-since 6m --sort edit_time` |
|
|
36
41
|
| 最近一个月我编辑过的文档 | `lark-cli drive +search --query "" --edited-since 1m` |
|
|
@@ -217,7 +222,7 @@ stdout 的 JSON 输出不受影响。`open_time` / `create_time` 不做 snap。
|
|
|
217
222
|
- **日历表达**("上个月"、"上周"、"本月"、"前年"、"今年 3 月"等明确日历单位)→ **必须算出绝对 `YYYY-MM-DD` 边界**(如"上个月" = 上一个日历月的 1 号 → 当月 1 号),**不要近似成 `1m`/`2m`**:CLI 里 `m` 是固定 30 天、`y` 固定 365 天,跟日历差 0-3 天,月末月初尤其容易偏出去
|
|
218
223
|
- 文档中的 `"<YYYY-MM-DD>"` 是运行时占位符:执行命令前按当前日期计算并替换。例如"本月"应替换为本月第一天和下月第一天,不要把示例生成时的月份硬编码进答案
|
|
219
224
|
- 绝对日期 → 直接 `YYYY-MM-DD` 或 RFC3339
|
|
220
|
-
- **分页策略**:默认只返回第一页,并说明 `has_more`
|
|
225
|
+
- **分页策略**:默认只返回第一页,并说明 `has_more` 和下一页命令。用户明确要"全部 / 全量 / 继续翻"时继续;标题词 + 正文词联合搜索尚未找到足够的有效 Top N 候选时,按上文规则最多检查 3 页。其他场景单轮翻页上限 5 页。
|
|
221
226
|
- **原始返回**:用户要求"原始数据"、"接口返回"时用 `--format json`,不做客户端精确过滤或摘要重写。
|
|
222
227
|
|
|
223
228
|
## 权限
|
|
@@ -28,7 +28,7 @@ lark-cli drive +secure-label-list --page-size 10 --lang zh
|
|
|
28
28
|
```bash
|
|
29
29
|
lark-cli drive +secure-label-update \
|
|
30
30
|
--token "https://example.feishu.cn/docx/doxcnxxxx" \
|
|
31
|
-
--label-id
|
|
31
|
+
--label-id '<label-id>' # replace $LABEL_ID before running
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
参数:
|