mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
1181dafc76
* feat(im): support rich-text message attachment zone in send/reply/mget/edit Support the post message attachment zone (top-level files array) end to end: - +messages-send / +messages-reply: repeatable --attachment file_key flags merged into the post content's files array (deduplicated). - +messages-mget: render attachment-zone files/folders as <file>/<folder> tags in content, extract file keys for --download-resources. - +messages-edit: new shortcut (PUT /open-apis/im/v1/messages/:id) with --set-attachments / --clear-attachments; body-only edits preserve the attachment zone by default. - Attachment flags are mutually exclusive with --content carrying a files array (declare the zone via one or the other, not both). - bot-only identity, matching server behavior (user token rejected). - Fixes from review: attachments no longer bypass content mutual-exclusion validation (P1); merge dedups by key. - Docs (SKILL.md, references, affordance) and unit tests updated. * fix(im): address design-review findings (auto-infer post, dedup set, doc routing) - --attachment/--set-attachments/--clear-attachments now infer msg_type=post automatically; only an explicit incompatible --msg-type conflicts. --text is rejected with attachments (text is a standalone message, not a post body) with a hint to use --markdown or --content. - --set-attachments deduplicates repeated keys (docs promised this; the replace helper now enforces it). - Shortcut Description no longer leaks the HTTP path or the raw server error phrase; it describes the command semantically. - affordance/im.md +messages-edit now routes WHEN: interactive cards go to messages.patch, corrected messages go to +messages-send, and attachment tri-state tips are listed. - mget doc no longer claims --format json exposes raw wire fields (the output is the rendered content); download eligibility clarified.
37 lines
736 B
Go
37 lines
736 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package im
|
|
|
|
import "github.com/larksuite/cli/shortcuts/common"
|
|
|
|
// Shortcuts returns all im shortcuts.
|
|
func Shortcuts() []common.Shortcut {
|
|
return []common.Shortcut{
|
|
ImChatCreate,
|
|
ImChatList,
|
|
ImChatMembersList,
|
|
ImChatMessageList,
|
|
ImChatSearch,
|
|
ImChatUpdate,
|
|
ImMessageReadUsers,
|
|
ImMessagesEdit,
|
|
ImMessagesMGet,
|
|
ImMessagesReadStatus,
|
|
ImMessagesReply,
|
|
ImMessagesResourcesDownload,
|
|
ImMessagesSearch,
|
|
ImMessagesSend,
|
|
ImThreadsMessagesList,
|
|
ImFlagCreate,
|
|
ImFlagCancel,
|
|
ImFlagList,
|
|
ImFeedShortcutCreate,
|
|
ImFeedShortcutRemove,
|
|
ImFeedShortcutList,
|
|
ImFeedGroupList,
|
|
ImFeedGroupListItem,
|
|
ImFeedGroupQueryItem,
|
|
}
|
|
}
|