mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
- 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
18 lines
613 B
TypeScript
18 lines
613 B
TypeScript
import type { RouteTarget } from "../types";
|
|
import type { PlatformDriver } from "./types";
|
|
import { DiscordDriver } from "./discord";
|
|
import { TelegramDriver } from "./telegram";
|
|
import { FeishuDriver } from "./feishu";
|
|
|
|
const drivers: Record<string, PlatformDriver> = {
|
|
discord: new DiscordDriver(),
|
|
telegram: new TelegramDriver(),
|
|
feishu: new FeishuDriver(),
|
|
};
|
|
|
|
export function getDriver(target: RouteTarget): PlatformDriver {
|
|
const platform = target.platform ?? "discord";
|
|
const driver = drivers[platform];
|
|
if (!driver) throw new Error(`No driver for platform "${platform}"`);
|
|
return driver;
|
|
}
|