mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat(feishu): add Feishu inbound webhook, /gh commands and card actions
- add feishu_links D1 table and link store helpers - implement X-Lark-Signature verification, url_verification, /gh login|logout|comment|merge|close and card.action.trigger Merge/Close - render interactive cards with clickable title link, inline links and callback buttons (no whole-card card_link) - bind Feishu account in OAuth callback - document event subscription and required scopes
This commit is contained in:
parent
3437ac5513
commit
4b99f6d33d
38 changed files with 2449 additions and 1412 deletions
|
|
@ -119,3 +119,34 @@ export async function removeTelegramLink(db: D1Database, telegramUserId: string)
|
|||
.bind(telegramUserId)
|
||||
.run();
|
||||
}
|
||||
|
||||
export async function saveFeishuLink(
|
||||
db: D1Database,
|
||||
feishuUserId: string,
|
||||
githubUserId: string,
|
||||
): Promise<void> {
|
||||
await db
|
||||
.prepare(
|
||||
"INSERT OR REPLACE INTO feishu_links (feishu_user_id, github_user_id) VALUES (?, ?)",
|
||||
)
|
||||
.bind(feishuUserId, githubUserId)
|
||||
.run();
|
||||
}
|
||||
|
||||
export async function getFeishuLink(
|
||||
db: D1Database,
|
||||
feishuUserId: string,
|
||||
): Promise<string | null> {
|
||||
const { results } = await db
|
||||
.prepare("SELECT github_user_id FROM feishu_links WHERE feishu_user_id = ?")
|
||||
.bind(feishuUserId)
|
||||
.all<{ github_user_id: string }>();
|
||||
return results[0]?.github_user_id ?? null;
|
||||
}
|
||||
|
||||
export async function removeFeishuLink(db: D1Database, feishuUserId: string): Promise<void> {
|
||||
await db
|
||||
.prepare("DELETE FROM feishu_links WHERE feishu_user_id = ?")
|
||||
.bind(feishuUserId)
|
||||
.run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue