UNPKG

@mxlabs/okxnotify

Version:

OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle

77 lines (76 loc) 2.03 kB
/** * 接收飞书 webhook 事件 * @param event 事件类型 * @param payload 事件数据 * @returns 返回状态码和数据 */ import { FEISHU_MESSAGE_TYPE } from '@mxlabs/notify'; import { FEISHU_CUSTOM_EVENT_TYPE, FEISHU_EVENT_TYPE } from './constant'; export interface FeishuWebhookPayload { schema: '2.0'; challenge: string; header: { event_id: string; token: string; create_time: string; event_type: FEISHU_EVENT_TYPE; tenant_key: string; app_id: string; }; event: { message: { chat_id: string; /** 消息内容,JSON 字符串 */ content: string; chat_type: 'p2p' | 'group'; create_time: string; message_id: string; message_type: keyof typeof FEISHU_MESSAGE_TYPE; update_time: string; user_agent: string; }; sender: { sender_id: { open_id: string; union_id: string; user_id: string; }; sender_type: 'user' | 'app'; tenant_key: string; }; }; } export interface FeishuCustomEventPayload { schema: '2.0'; challenge: string; header: { event_id: string; token: string; create_time: string; event_type: FEISHU_EVENT_TYPE.BOT_MENU_V6; tenant_key: string; app_id: string; }; event: { operator: { operator_name: string; operator_id: { union_id: string; user_id: string; open_id: string; }; }; event_key: FEISHU_CUSTOM_EVENT_TYPE; timestamp: number; }; } export declare const receiveFeishuRobotMessage: (payload: { encrypt: string; }) => Promise<void>; export declare const syncFeishuWebhookChallengeTest: (payload: { encrypt: string; }) => Promise<{ status: number; challenge: string; message: string; }>;