/** * Decoding the `im.message.receive_v1` event envelope into a typed inbound * event: envelope metadata (`narrowMetaFromEvent`) plus the message body * (`parseInbound`), combined into one routable shape. */ import { type InboundResource } from './content.js'; import type { Mention } from './mentions.js'; export interface FeishuInboundEvent { messageId: string; chatId: string; chatType: string; /** Stable Feishu topic identity when the event belongs to a thread/topic. */ threadId?: string; /** Diagnostic reply ancestry; never used as a topic identity fallback. */ rootId?: string; parentId?: string; /** Post-gate, best-effort type of the actionable reply/quote parent. */ parentMessageType?: string; senderId: string; /** * The sender's `union_id`, when Feishu provides it. Diagnostic only — it is * surfaced in inbound-drop logs to help tell "same bot, different app-scoped * open_id" apart from "different entity", and is never used for access * gating. Absent when Feishu omits it. */ senderUnionId?: string; senderType: string; /** * Best-effort event display name. Feishu normally omits it, so the accepted * inbound path may later enrich an empty value through the transport seam. */ senderName: string; messageType: string; /** Raw JSON-encoded content as Feishu delivered it. */ rawContent: string; /** * The message as text. A mention stands as the placeholder its `mentions` * record names; an image or file stands as its resource key. */ text: string; /** Every resource the text refers to, once each. */ resources: InboundResource[]; /** The body omits visible content the parser could not read. */ contentIncomplete?: boolean; mentions: Mention[]; createTime: string; /** The full original Feishu event payload (for storage / audit). */ raw: unknown; } /** * Reshape a raw `im.message.receive_v1` payload into a `FeishuInboundEvent`, * using `parseInbound` + `narrowMetaFromEvent` for the body and the * event-envelope metadata. Returns `null` for a payload missing the * message_id or chat_id that make it routable. */ export declare function parseFeishuInboundEvent(raw: unknown): FeishuInboundEvent | null; //# sourceMappingURL=message-event.d.ts.map