feat: add Feishu/Lark adapter (@chat-adapter/feishu)#108
Open
moeyua wants to merge 4 commits intovercel:mainfrom
Open
feat: add Feishu/Lark adapter (@chat-adapter/feishu)#108moeyua wants to merge 4 commits intovercel:mainfrom
moeyua wants to merge 4 commits intovercel:mainfrom
Conversation
Implement complete Feishu/Lark platform adapter following existing adapter patterns: - FeishuAdapter class implementing full Adapter interface - FeishuFormatConverter extending BaseFormatConverter for rich text (post) format - Interactive card support (cardToFeishuPayload, cardToFallbackText) - Webhook verification, message parsing, reactions, thread management - createFeishuAdapter() factory function with config validation - Add FEISHU_* env vars to turbo.json globalEnv - Tests for cards (18) and markdown (30) converters, all passing
…s, file uploads - Add AES-256-CBC event decryption with SHA-256 key derivation - Add SHA-256 signature verification for webhook security - Fix removeReaction to list-then-delete by reaction UUID - Broaden mention regex to support hyphens/dots in usernames - Add logger.warn for silently dropped file attachments - Add 10 new tests covering all fixes (87 total, all passing)
Contributor
|
@moeyua is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…ader rejection, DM routing - Use crypto.timingSafeEqual for signature verification to prevent timing attacks - Return 401 when encryptKey is configured but signature headers are missing - Add sendToChat() helper to route DM threads via message.create instead of reply - Update and add corresponding unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a complete Feishu (飞书/Lark) adapter to the Chat SDK, implementing the full
Adapterinterface with production-quality security and platform integration.New Package
@chat-adapter/feishu— 11 new files, ~3,200 lines (source + tests + config)Source Files
src/index.ts— FullAdapterimplementation: webhook handling, message CRUD, reactions, typing indicators, thread/channel operations, DM supportsrc/types.ts— Feishu API types (events, messages, responses, config)src/markdown.ts— Bidirectional mdast ↔ Feishu markdown conversion (bold, italic, links, code blocks, lists, mentions)src/cards.ts— Interactive card message conversion (Card → Feishu card JSON)Tests (87 total, all passing)
src/index.test.ts— 35 tests: webhook verification, message parsing, encryption/decryption, signature verification, thread ID encoding, config validationsrc/markdown.test.ts— 34 tests: format conversion, mention parsing, edge casessrc/cards.test.ts— 18 tests: card element conversion, nested structuresKey Features
feishu:{chatId}:{base64(messageId)}ValidationErrorfrom@chat-adapter/sharedcreateFeishuAdapter(config)matching existing adapter conventionsMonorepo Integration
turbo.jsonupdated withFEISHU_*env varspnpm validatepasses (knip, biome check, typecheck 23/23, all test suites, build)Checklist
Adapterinterface frompackages/chat/src/types.tspnpm validateclean (knip + biome + typecheck + test + build)as any/@ts-ignore/@ts-expect-error