@colinlu50/openclaw-lark-stream 2026.3.17
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/LICENSE +21 -0
- package/README.md +141 -0
- package/README.zh.md +70 -0
- package/bin/openclaw-lark.js +48 -0
- package/index.d.ts +36 -0
- package/index.js +118 -0
- package/openclaw.plugin.json +10 -0
- package/package.json +66 -0
- package/skills/feishu-bitable/SKILL.md +248 -0
- package/skills/feishu-bitable/references/examples.md +813 -0
- package/skills/feishu-bitable/references/field-properties.md +763 -0
- package/skills/feishu-bitable/references/record-values.md +911 -0
- package/skills/feishu-calendar/SKILL.md +244 -0
- package/skills/feishu-channel-rules/SKILL.md +24 -0
- package/skills/feishu-channel-rules/references/markdown-syntax.md +138 -0
- package/skills/feishu-create-doc/SKILL.md +719 -0
- package/skills/feishu-fetch-doc/SKILL.md +93 -0
- package/skills/feishu-im-read/SKILL.md +163 -0
- package/skills/feishu-task/SKILL.md +293 -0
- package/skills/feishu-troubleshoot/SKILL.md +70 -0
- package/skills/feishu-update-doc/SKILL.md +285 -0
- package/src/card/builder.d.ts +106 -0
- package/src/card/builder.js +443 -0
- package/src/card/cardkit.d.ts +90 -0
- package/src/card/cardkit.js +181 -0
- package/src/card/flush-controller.d.ts +45 -0
- package/src/card/flush-controller.js +134 -0
- package/src/card/image-resolver.d.ts +45 -0
- package/src/card/image-resolver.js +112 -0
- package/src/card/markdown-style.d.ts +16 -0
- package/src/card/markdown-style.js +97 -0
- package/src/card/reply-dispatcher-types.d.ts +120 -0
- package/src/card/reply-dispatcher-types.js +57 -0
- package/src/card/reply-dispatcher.d.ts +15 -0
- package/src/card/reply-dispatcher.js +299 -0
- package/src/card/reply-mode.d.ts +38 -0
- package/src/card/reply-mode.js +65 -0
- package/src/card/streaming-card-controller.d.ts +101 -0
- package/src/card/streaming-card-controller.js +810 -0
- package/src/card/unavailable-guard.d.ts +35 -0
- package/src/card/unavailable-guard.js +83 -0
- package/src/channel/abort-detect.d.ts +34 -0
- package/src/channel/abort-detect.js +124 -0
- package/src/channel/chat-queue.d.ts +41 -0
- package/src/channel/chat-queue.js +58 -0
- package/src/channel/config-adapter.d.ts +23 -0
- package/src/channel/config-adapter.js +101 -0
- package/src/channel/directory.d.ts +57 -0
- package/src/channel/directory.js +191 -0
- package/src/channel/event-handlers.d.ts +15 -0
- package/src/channel/event-handlers.js +221 -0
- package/src/channel/monitor.d.ts +17 -0
- package/src/channel/monitor.js +129 -0
- package/src/channel/onboarding-config.d.ts +17 -0
- package/src/channel/onboarding-config.js +88 -0
- package/src/channel/onboarding-migrate.d.ts +25 -0
- package/src/channel/onboarding-migrate.js +67 -0
- package/src/channel/onboarding.d.ts +12 -0
- package/src/channel/onboarding.js +296 -0
- package/src/channel/plugin.d.ts +13 -0
- package/src/channel/plugin.js +278 -0
- package/src/channel/probe.d.ts +14 -0
- package/src/channel/probe.js +21 -0
- package/src/channel/types.d.ts +36 -0
- package/src/channel/types.js +7 -0
- package/src/commands/auth.d.ts +21 -0
- package/src/commands/auth.js +161 -0
- package/src/commands/diagnose.d.ts +69 -0
- package/src/commands/diagnose.js +807 -0
- package/src/commands/doctor.d.ts +26 -0
- package/src/commands/doctor.js +584 -0
- package/src/commands/index.d.ts +25 -0
- package/src/commands/index.js +212 -0
- package/src/commands/locale.d.ts +7 -0
- package/src/commands/locale.js +7 -0
- package/src/core/accounts.d.ts +37 -0
- package/src/core/accounts.js +163 -0
- package/src/core/agent-config.d.ts +100 -0
- package/src/core/agent-config.js +139 -0
- package/src/core/api-error.d.ts +48 -0
- package/src/core/api-error.js +112 -0
- package/src/core/app-owner-fallback.d.ts +21 -0
- package/src/core/app-owner-fallback.js +38 -0
- package/src/core/app-scope-checker.d.ts +87 -0
- package/src/core/app-scope-checker.js +190 -0
- package/src/core/auth-errors.d.ts +144 -0
- package/src/core/auth-errors.js +154 -0
- package/src/core/chat-info-cache.d.ts +57 -0
- package/src/core/chat-info-cache.js +152 -0
- package/src/core/config-schema.d.ts +448 -0
- package/src/core/config-schema.js +200 -0
- package/src/core/device-flow.d.ts +77 -0
- package/src/core/device-flow.js +212 -0
- package/src/core/domains.d.ts +18 -0
- package/src/core/domains.js +28 -0
- package/src/core/feishu-fetch.d.ts +18 -0
- package/src/core/feishu-fetch.js +25 -0
- package/src/core/footer-config.d.ts +24 -0
- package/src/core/footer-config.js +39 -0
- package/src/core/lark-client.d.ts +108 -0
- package/src/core/lark-client.js +353 -0
- package/src/core/lark-logger.d.ts +23 -0
- package/src/core/lark-logger.js +154 -0
- package/src/core/lark-ticket.d.ts +29 -0
- package/src/core/lark-ticket.js +35 -0
- package/src/core/message-unavailable.d.ts +53 -0
- package/src/core/message-unavailable.js +130 -0
- package/src/core/owner-policy.d.ts +31 -0
- package/src/core/owner-policy.js +52 -0
- package/src/core/permission-url.d.ts +22 -0
- package/src/core/permission-url.js +72 -0
- package/src/core/raw-request.d.ts +27 -0
- package/src/core/raw-request.js +62 -0
- package/src/core/scope-manager.d.ts +168 -0
- package/src/core/scope-manager.js +213 -0
- package/src/core/security-check.d.ts +72 -0
- package/src/core/security-check.js +174 -0
- package/src/core/shutdown-hooks.d.ts +22 -0
- package/src/core/shutdown-hooks.js +56 -0
- package/src/core/targets.d.ts +60 -0
- package/src/core/targets.js +164 -0
- package/src/core/token-store.d.ts +54 -0
- package/src/core/token-store.js +314 -0
- package/src/core/tool-client.d.ts +176 -0
- package/src/core/tool-client.js +380 -0
- package/src/core/tool-scopes.d.ts +153 -0
- package/src/core/tool-scopes.js +326 -0
- package/src/core/tools-config.d.ts +55 -0
- package/src/core/tools-config.js +137 -0
- package/src/core/types.d.ts +87 -0
- package/src/core/types.js +11 -0
- package/src/core/uat-client.d.ts +46 -0
- package/src/core/uat-client.js +187 -0
- package/src/core/version.d.ts +25 -0
- package/src/core/version.js +49 -0
- package/src/messaging/converters/audio.d.ts +8 -0
- package/src/messaging/converters/audio.js +21 -0
- package/src/messaging/converters/calendar.d.ts +13 -0
- package/src/messaging/converters/calendar.js +50 -0
- package/src/messaging/converters/content-converter.d.ts +41 -0
- package/src/messaging/converters/content-converter.js +106 -0
- package/src/messaging/converters/file.d.ts +8 -0
- package/src/messaging/converters/file.js +20 -0
- package/src/messaging/converters/folder.d.ts +8 -0
- package/src/messaging/converters/folder.js +20 -0
- package/src/messaging/converters/hongbao.d.ts +8 -0
- package/src/messaging/converters/hongbao.js +16 -0
- package/src/messaging/converters/image.d.ts +8 -0
- package/src/messaging/converters/image.js +18 -0
- package/src/messaging/converters/index.d.ts +8 -0
- package/src/messaging/converters/index.js +50 -0
- package/src/messaging/converters/interactive/card-converter.d.ts +76 -0
- package/src/messaging/converters/interactive/card-converter.js +1173 -0
- package/src/messaging/converters/interactive/card-utils.d.ts +9 -0
- package/src/messaging/converters/interactive/card-utils.js +42 -0
- package/src/messaging/converters/interactive/index.d.ts +8 -0
- package/src/messaging/converters/interactive/index.js +21 -0
- package/src/messaging/converters/interactive/legacy.d.ts +11 -0
- package/src/messaging/converters/interactive/legacy.js +57 -0
- package/src/messaging/converters/interactive/types.d.ts +23 -0
- package/src/messaging/converters/interactive/types.js +24 -0
- package/src/messaging/converters/location.d.ts +8 -0
- package/src/messaging/converters/location.js +19 -0
- package/src/messaging/converters/merge-forward.d.ts +32 -0
- package/src/messaging/converters/merge-forward.js +225 -0
- package/src/messaging/converters/post.d.ts +11 -0
- package/src/messaging/converters/post.js +135 -0
- package/src/messaging/converters/share.d.ts +9 -0
- package/src/messaging/converters/share.js +23 -0
- package/src/messaging/converters/sticker.d.ts +8 -0
- package/src/messaging/converters/sticker.js +18 -0
- package/src/messaging/converters/system.d.ts +12 -0
- package/src/messaging/converters/system.js +32 -0
- package/src/messaging/converters/text.d.ts +8 -0
- package/src/messaging/converters/text.js +14 -0
- package/src/messaging/converters/todo.d.ts +8 -0
- package/src/messaging/converters/todo.js +41 -0
- package/src/messaging/converters/types.d.ts +107 -0
- package/src/messaging/converters/types.js +7 -0
- package/src/messaging/converters/unknown.d.ts +8 -0
- package/src/messaging/converters/unknown.js +16 -0
- package/src/messaging/converters/utils.d.ts +22 -0
- package/src/messaging/converters/utils.js +51 -0
- package/src/messaging/converters/video-chat.d.ts +8 -0
- package/src/messaging/converters/video-chat.js +23 -0
- package/src/messaging/converters/video.d.ts +8 -0
- package/src/messaging/converters/video.js +32 -0
- package/src/messaging/converters/vote.d.ts +8 -0
- package/src/messaging/converters/vote.js +24 -0
- package/src/messaging/inbound/dedup.d.ts +59 -0
- package/src/messaging/inbound/dedup.js +116 -0
- package/src/messaging/inbound/dispatch-builders.d.ts +84 -0
- package/src/messaging/inbound/dispatch-builders.js +152 -0
- package/src/messaging/inbound/dispatch-commands.d.ts +27 -0
- package/src/messaging/inbound/dispatch-commands.js +112 -0
- package/src/messaging/inbound/dispatch-context.d.ts +67 -0
- package/src/messaging/inbound/dispatch-context.js +136 -0
- package/src/messaging/inbound/dispatch.d.ts +47 -0
- package/src/messaging/inbound/dispatch.js +264 -0
- package/src/messaging/inbound/enrich.d.ts +102 -0
- package/src/messaging/inbound/enrich.js +227 -0
- package/src/messaging/inbound/gate-effects.d.ts +23 -0
- package/src/messaging/inbound/gate-effects.js +43 -0
- package/src/messaging/inbound/gate.d.ts +60 -0
- package/src/messaging/inbound/gate.js +233 -0
- package/src/messaging/inbound/handler.d.ts +35 -0
- package/src/messaging/inbound/handler.js +173 -0
- package/src/messaging/inbound/media-resolver.d.ts +32 -0
- package/src/messaging/inbound/media-resolver.js +87 -0
- package/src/messaging/inbound/mention.d.ts +39 -0
- package/src/messaging/inbound/mention.js +81 -0
- package/src/messaging/inbound/parse-io.d.ts +50 -0
- package/src/messaging/inbound/parse-io.js +81 -0
- package/src/messaging/inbound/parse.d.ts +28 -0
- package/src/messaging/inbound/parse.js +106 -0
- package/src/messaging/inbound/permission.d.ts +17 -0
- package/src/messaging/inbound/permission.js +40 -0
- package/src/messaging/inbound/policy.d.ts +94 -0
- package/src/messaging/inbound/policy.js +160 -0
- package/src/messaging/inbound/reaction-handler.d.ts +61 -0
- package/src/messaging/inbound/reaction-handler.js +221 -0
- package/src/messaging/inbound/user-name-cache.d.ts +82 -0
- package/src/messaging/inbound/user-name-cache.js +241 -0
- package/src/messaging/outbound/actions.d.ts +16 -0
- package/src/messaging/outbound/actions.js +309 -0
- package/src/messaging/outbound/chat-manage.d.ts +64 -0
- package/src/messaging/outbound/chat-manage.js +111 -0
- package/src/messaging/outbound/deliver.d.ts +155 -0
- package/src/messaging/outbound/deliver.js +298 -0
- package/src/messaging/outbound/fetch.d.ts +12 -0
- package/src/messaging/outbound/fetch.js +12 -0
- package/src/messaging/outbound/forward.d.ts +26 -0
- package/src/messaging/outbound/forward.js +48 -0
- package/src/messaging/outbound/media-url-utils.d.ts +29 -0
- package/src/messaging/outbound/media-url-utils.js +130 -0
- package/src/messaging/outbound/media.d.ts +260 -0
- package/src/messaging/outbound/media.js +758 -0
- package/src/messaging/outbound/outbound.d.ts +89 -0
- package/src/messaging/outbound/outbound.js +121 -0
- package/src/messaging/outbound/reactions.d.ts +124 -0
- package/src/messaging/outbound/reactions.js +378 -0
- package/src/messaging/outbound/send.d.ts +152 -0
- package/src/messaging/outbound/send.js +355 -0
- package/src/messaging/outbound/typing.d.ts +71 -0
- package/src/messaging/outbound/typing.js +179 -0
- package/src/messaging/shared/message-lookup.d.ts +54 -0
- package/src/messaging/shared/message-lookup.js +117 -0
- package/src/messaging/types.d.ts +176 -0
- package/src/messaging/types.js +10 -0
- package/src/tools/auto-auth.d.ts +56 -0
- package/src/tools/auto-auth.js +919 -0
- package/src/tools/helpers.d.ts +260 -0
- package/src/tools/helpers.js +364 -0
- package/src/tools/mcp/doc/create.d.ts +12 -0
- package/src/tools/mcp/doc/create.js +44 -0
- package/src/tools/mcp/doc/fetch.d.ts +12 -0
- package/src/tools/mcp/doc/fetch.js +36 -0
- package/src/tools/mcp/doc/index.d.ts +12 -0
- package/src/tools/mcp/doc/index.js +41 -0
- package/src/tools/mcp/doc/update.d.ts +12 -0
- package/src/tools/mcp/doc/update.js +61 -0
- package/src/tools/mcp/shared.d.ts +59 -0
- package/src/tools/mcp/shared.js +226 -0
- package/src/tools/oapi/bitable/app-table-field.d.ts +16 -0
- package/src/tools/oapi/bitable/app-table-field.js +222 -0
- package/src/tools/oapi/bitable/app-table-record.d.ts +20 -0
- package/src/tools/oapi/bitable/app-table-record.js +436 -0
- package/src/tools/oapi/bitable/app-table-view.d.ts +17 -0
- package/src/tools/oapi/bitable/app-table-view.js +195 -0
- package/src/tools/oapi/bitable/app-table.d.ts +19 -0
- package/src/tools/oapi/bitable/app-table.js +247 -0
- package/src/tools/oapi/bitable/app.d.ts +18 -0
- package/src/tools/oapi/bitable/app.js +186 -0
- package/src/tools/oapi/bitable/index.d.ts +9 -0
- package/src/tools/oapi/bitable/index.js +9 -0
- package/src/tools/oapi/calendar/calendar.d.ts +15 -0
- package/src/tools/oapi/calendar/calendar.js +122 -0
- package/src/tools/oapi/calendar/event-attendee.d.ts +16 -0
- package/src/tools/oapi/calendar/event-attendee.js +263 -0
- package/src/tools/oapi/calendar/event.d.ts +16 -0
- package/src/tools/oapi/calendar/event.js +709 -0
- package/src/tools/oapi/calendar/freebusy.d.ts +13 -0
- package/src/tools/oapi/calendar/freebusy.js +111 -0
- package/src/tools/oapi/calendar/index.d.ts +8 -0
- package/src/tools/oapi/calendar/index.js +8 -0
- package/src/tools/oapi/chat/chat.d.ts +16 -0
- package/src/tools/oapi/chat/chat.js +124 -0
- package/src/tools/oapi/chat/index.d.ts +10 -0
- package/src/tools/oapi/chat/index.js +15 -0
- package/src/tools/oapi/chat/members.d.ts +11 -0
- package/src/tools/oapi/chat/members.js +81 -0
- package/src/tools/oapi/common/get-user.d.ts +12 -0
- package/src/tools/oapi/common/get-user.js +106 -0
- package/src/tools/oapi/common/index.d.ts +6 -0
- package/src/tools/oapi/common/index.js +6 -0
- package/src/tools/oapi/common/search-user.d.ts +11 -0
- package/src/tools/oapi/common/search-user.js +73 -0
- package/src/tools/oapi/drive/doc-comments.d.ts +15 -0
- package/src/tools/oapi/drive/doc-comments.js +279 -0
- package/src/tools/oapi/drive/doc-media.d.ts +19 -0
- package/src/tools/oapi/drive/doc-media.js +335 -0
- package/src/tools/oapi/drive/file.d.ts +19 -0
- package/src/tools/oapi/drive/file.js +483 -0
- package/src/tools/oapi/drive/index.d.ts +12 -0
- package/src/tools/oapi/drive/index.js +36 -0
- package/src/tools/oapi/helpers.d.ts +182 -0
- package/src/tools/oapi/helpers.js +354 -0
- package/src/tools/oapi/im/format-messages.d.ts +50 -0
- package/src/tools/oapi/im/format-messages.js +165 -0
- package/src/tools/oapi/im/index.d.ts +10 -0
- package/src/tools/oapi/im/index.js +17 -0
- package/src/tools/oapi/im/message-read.d.ts +13 -0
- package/src/tools/oapi/im/message-read.js +411 -0
- package/src/tools/oapi/im/message.d.ts +16 -0
- package/src/tools/oapi/im/message.js +149 -0
- package/src/tools/oapi/im/resource.d.ts +13 -0
- package/src/tools/oapi/im/resource.js +150 -0
- package/src/tools/oapi/im/time-utils.d.ts +46 -0
- package/src/tools/oapi/im/time-utils.js +201 -0
- package/src/tools/oapi/im/user-name-uat.d.ts +26 -0
- package/src/tools/oapi/im/user-name-uat.js +140 -0
- package/src/tools/oapi/index.d.ts +11 -0
- package/src/tools/oapi/index.js +58 -0
- package/src/tools/oapi/sdk-types.d.ts +96 -0
- package/src/tools/oapi/sdk-types.js +12 -0
- package/src/tools/oapi/search/doc-search.d.ts +13 -0
- package/src/tools/oapi/search/doc-search.js +191 -0
- package/src/tools/oapi/search/index.d.ts +12 -0
- package/src/tools/oapi/search/index.js +33 -0
- package/src/tools/oapi/sheets/index.d.ts +12 -0
- package/src/tools/oapi/sheets/index.js +31 -0
- package/src/tools/oapi/sheets/sheet.d.ts +16 -0
- package/src/tools/oapi/sheets/sheet.js +652 -0
- package/src/tools/oapi/task/comment.d.ts +15 -0
- package/src/tools/oapi/task/comment.js +140 -0
- package/src/tools/oapi/task/index.d.ts +8 -0
- package/src/tools/oapi/task/index.js +8 -0
- package/src/tools/oapi/task/subtask.d.ts +14 -0
- package/src/tools/oapi/task/subtask.js +162 -0
- package/src/tools/oapi/task/task.d.ts +16 -0
- package/src/tools/oapi/task/task.js +344 -0
- package/src/tools/oapi/task/tasklist.d.ts +21 -0
- package/src/tools/oapi/task/tasklist.js +321 -0
- package/src/tools/oapi/wiki/index.d.ts +12 -0
- package/src/tools/oapi/wiki/index.js +34 -0
- package/src/tools/oapi/wiki/space-node.d.ts +17 -0
- package/src/tools/oapi/wiki/space-node.js +230 -0
- package/src/tools/oapi/wiki/space.d.ts +15 -0
- package/src/tools/oapi/wiki/space.js +130 -0
- package/src/tools/oauth-batch-auth.d.ts +11 -0
- package/src/tools/oauth-batch-auth.js +142 -0
- package/src/tools/oauth-cards.d.ts +39 -0
- package/src/tools/oauth-cards.js +315 -0
- package/src/tools/oauth.d.ts +47 -0
- package/src/tools/oauth.js +620 -0
- package/src/tools/onboarding-auth.d.ts +27 -0
- package/src/tools/onboarding-auth.js +130 -0
- package/src/tools/tat/im/index.d.ts +15 -0
- package/src/tools/tat/im/index.js +18 -0
- package/src/tools/tat/im/resource.d.ts +15 -0
- package/src/tools/tat/im/resource.js +157 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Converter for "file" message type.
|
|
6
|
+
*/
|
|
7
|
+
import { safeParse } from './utils';
|
|
8
|
+
export const convertFile = (raw) => {
|
|
9
|
+
const parsed = safeParse(raw);
|
|
10
|
+
const fileKey = parsed?.file_key;
|
|
11
|
+
if (!fileKey) {
|
|
12
|
+
return { content: '[file]', resources: [] };
|
|
13
|
+
}
|
|
14
|
+
const fileName = parsed?.file_name ?? '';
|
|
15
|
+
const nameAttr = fileName ? ` name="${fileName}"` : '';
|
|
16
|
+
return {
|
|
17
|
+
content: `<file key="${fileKey}"${nameAttr}/>`,
|
|
18
|
+
resources: [{ type: 'file', fileKey, fileName: fileName || undefined }],
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Converter for "folder" message type.
|
|
6
|
+
*/
|
|
7
|
+
import { safeParse } from './utils';
|
|
8
|
+
export const convertFolder = (raw) => {
|
|
9
|
+
const parsed = safeParse(raw);
|
|
10
|
+
const fileKey = parsed?.file_key;
|
|
11
|
+
if (!fileKey) {
|
|
12
|
+
return { content: '[folder]', resources: [] };
|
|
13
|
+
}
|
|
14
|
+
const fileName = parsed?.file_name ?? '';
|
|
15
|
+
const nameAttr = fileName ? ` name="${fileName}"` : '';
|
|
16
|
+
return {
|
|
17
|
+
content: `<folder key="${fileKey}"${nameAttr}/>`,
|
|
18
|
+
resources: [{ type: 'file', fileKey, fileName: fileName || undefined }],
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Converter for "hongbao" (red packet) message type.
|
|
6
|
+
*/
|
|
7
|
+
import type { ContentConverterFn } from './types';
|
|
8
|
+
export declare const convertHongbao: ContentConverterFn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Converter for "hongbao" (red packet) message type.
|
|
6
|
+
*/
|
|
7
|
+
import { safeParse } from './utils';
|
|
8
|
+
export const convertHongbao = (raw) => {
|
|
9
|
+
const parsed = safeParse(raw);
|
|
10
|
+
const text = parsed?.text;
|
|
11
|
+
const textAttr = text ? ` text="${text}"` : '';
|
|
12
|
+
return {
|
|
13
|
+
content: `<hongbao${textAttr}/>`,
|
|
14
|
+
resources: [],
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Converter for "image" message type.
|
|
6
|
+
*/
|
|
7
|
+
import { safeParse } from './utils';
|
|
8
|
+
export const convertImage = (raw) => {
|
|
9
|
+
const parsed = safeParse(raw);
|
|
10
|
+
const imageKey = parsed?.image_key;
|
|
11
|
+
if (!imageKey) {
|
|
12
|
+
return { content: '[image]', resources: [] };
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
content: ``,
|
|
16
|
+
resources: [{ type: 'image', fileKey: imageKey }],
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Content converter mapping for all Feishu message types.
|
|
6
|
+
*/
|
|
7
|
+
import type { ContentConverterFn } from './types';
|
|
8
|
+
export declare const converters: ReadonlyMap<string, ContentConverterFn>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* Content converter mapping for all Feishu message types.
|
|
6
|
+
*/
|
|
7
|
+
import { convertText } from './text';
|
|
8
|
+
import { convertPost } from './post';
|
|
9
|
+
import { convertImage } from './image';
|
|
10
|
+
import { convertFile } from './file';
|
|
11
|
+
import { convertAudio } from './audio';
|
|
12
|
+
import { convertVideo } from './video';
|
|
13
|
+
import { convertSticker } from './sticker';
|
|
14
|
+
import { convertInteractive } from './interactive/index';
|
|
15
|
+
import { convertShareChat, convertShareUser } from './share';
|
|
16
|
+
import { convertLocation } from './location';
|
|
17
|
+
import { convertMergeForward } from './merge-forward';
|
|
18
|
+
import { convertFolder } from './folder';
|
|
19
|
+
import { convertSystem } from './system';
|
|
20
|
+
import { convertHongbao } from './hongbao';
|
|
21
|
+
import { convertShareCalendarEvent, convertCalendar, convertGeneralCalendar } from './calendar';
|
|
22
|
+
import { convertVideoChat } from './video-chat';
|
|
23
|
+
import { convertTodo } from './todo';
|
|
24
|
+
import { convertVote } from './vote';
|
|
25
|
+
import { convertUnknown } from './unknown';
|
|
26
|
+
export const converters = new Map([
|
|
27
|
+
['text', convertText],
|
|
28
|
+
['post', convertPost],
|
|
29
|
+
['image', convertImage],
|
|
30
|
+
['file', convertFile],
|
|
31
|
+
['audio', convertAudio],
|
|
32
|
+
['video', convertVideo],
|
|
33
|
+
['media', convertVideo],
|
|
34
|
+
['sticker', convertSticker],
|
|
35
|
+
['interactive', convertInteractive],
|
|
36
|
+
['share_chat', convertShareChat],
|
|
37
|
+
['share_user', convertShareUser],
|
|
38
|
+
['location', convertLocation],
|
|
39
|
+
['merge_forward', convertMergeForward],
|
|
40
|
+
['folder', convertFolder],
|
|
41
|
+
['system', convertSystem],
|
|
42
|
+
['hongbao', convertHongbao],
|
|
43
|
+
['share_calendar_event', convertShareCalendarEvent],
|
|
44
|
+
['calendar', convertCalendar],
|
|
45
|
+
['general_calendar', convertGeneralCalendar],
|
|
46
|
+
['video_chat', convertVideoChat],
|
|
47
|
+
['todo', convertTodo],
|
|
48
|
+
['vote', convertVote],
|
|
49
|
+
['unknown', convertUnknown],
|
|
50
|
+
]);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import type { Obj, RawCardContent, ConvertCardResult } from './types';
|
|
6
|
+
export declare const MODE: {
|
|
7
|
+
readonly Concise: 0;
|
|
8
|
+
readonly Detailed: 1;
|
|
9
|
+
};
|
|
10
|
+
type Mode = (typeof MODE)[keyof typeof MODE];
|
|
11
|
+
export declare class CardConverter {
|
|
12
|
+
private mode;
|
|
13
|
+
private attachment;
|
|
14
|
+
constructor(mode: Mode);
|
|
15
|
+
convert(input: RawCardContent): ConvertCardResult;
|
|
16
|
+
private extractBody;
|
|
17
|
+
private extractHeaderTitle;
|
|
18
|
+
private convertBody;
|
|
19
|
+
convertElements(elements: unknown[], depth: number): string;
|
|
20
|
+
convertElement(elem: Obj, depth: number): string;
|
|
21
|
+
extractProperty(elem: Obj): Obj;
|
|
22
|
+
extractTextContent(textElem: unknown): string;
|
|
23
|
+
private extractTextFromProperty;
|
|
24
|
+
convertPlainText(prop: Obj): string;
|
|
25
|
+
convertMarkdown(prop: Obj): string;
|
|
26
|
+
convertMarkdownV1(elem: Obj, prop: Obj): string;
|
|
27
|
+
convertMarkdownElements(elements: unknown[]): string;
|
|
28
|
+
convertDiv(prop: Obj, _id: string): string;
|
|
29
|
+
convertNote(prop: Obj): string;
|
|
30
|
+
convertLink(prop: Obj): string;
|
|
31
|
+
convertEmoji(prop: Obj): string;
|
|
32
|
+
convertLocalDatetime(prop: Obj): string;
|
|
33
|
+
convertList(prop: Obj): string;
|
|
34
|
+
convertBlockquote(prop: Obj): string;
|
|
35
|
+
convertCodeBlock(prop: Obj): string;
|
|
36
|
+
convertCodeSpan(prop: Obj): string;
|
|
37
|
+
convertHeading(prop: Obj): string;
|
|
38
|
+
convertFallbackText(prop: Obj): string;
|
|
39
|
+
convertTextTag(prop: Obj): string;
|
|
40
|
+
convertNumberTag(prop: Obj): string;
|
|
41
|
+
convertUnknown(prop: Obj | undefined, tag: string): string;
|
|
42
|
+
convertColumnSet(prop: Obj, depth: number): string;
|
|
43
|
+
convertColumn(prop: Obj, depth: number): string;
|
|
44
|
+
convertForm(prop: Obj, _id: string): string;
|
|
45
|
+
convertCollapsiblePanel(prop: Obj, _id: string): string;
|
|
46
|
+
convertInteractiveContainer(prop: Obj, _id: string): string;
|
|
47
|
+
convertRepeat(prop: Obj): string;
|
|
48
|
+
convertButton(prop: Obj, _id: string): string;
|
|
49
|
+
convertActions(prop: Obj): string;
|
|
50
|
+
convertSelect(prop: Obj, _id: string, isMulti: boolean): string;
|
|
51
|
+
convertSelectImg(prop: Obj, _id: string): string;
|
|
52
|
+
convertInput(prop: Obj, _id: string): string;
|
|
53
|
+
convertDatePicker(prop: Obj, _id: string, pickerType: string): string;
|
|
54
|
+
convertChecker(prop: Obj, _id: string): string;
|
|
55
|
+
convertOverflow(prop: Obj): string;
|
|
56
|
+
convertPerson(prop: Obj, _id: string): string;
|
|
57
|
+
convertPersonV1(prop: Obj, _id: string): string;
|
|
58
|
+
convertPersonList(prop: Obj): string;
|
|
59
|
+
convertAvatar(prop: Obj, _id: string): string;
|
|
60
|
+
convertAt(prop: Obj): string;
|
|
61
|
+
convertImage(prop: Obj, _id: string): string;
|
|
62
|
+
convertImgCombination(prop: Obj): string;
|
|
63
|
+
convertChart(prop: Obj, _id: string): string;
|
|
64
|
+
private extractChartSummary;
|
|
65
|
+
private extractLineBarSummary;
|
|
66
|
+
private extractPieSummary;
|
|
67
|
+
private extractGenericSummary;
|
|
68
|
+
convertAudio(prop: Obj, _id: string): string;
|
|
69
|
+
convertVideo(prop: Obj, _id: string): string;
|
|
70
|
+
convertTable(prop: Obj): string;
|
|
71
|
+
private extractTableCellValue;
|
|
72
|
+
private extractTextStyle;
|
|
73
|
+
private applyTextStyle;
|
|
74
|
+
private getImageToken;
|
|
75
|
+
}
|
|
76
|
+
export {};
|