/** * Pure message normalization for the DingTalk stream mode: raw gateway * payloads → dsh-connect `InboundMessage`, and STOMP reply bodies for the * reply destination. Kept free of sockets so every branch is unit-testable. * @module dsh-connect/channels/dingtalk/message */ import type { InboundMessage } from "../../types.js"; /** Raw inbound message payload pushed by the stream gateway. */ export interface DingtalkBotMessage { senderStaffId?: string; senderNick?: string; /** Stable conversation id ("cid…"). */ conversationId?: string; /** "1" = single chat, "2" = group chat. */ conversationType?: string; msgId?: string; msgType?: string; text?: { content?: string; }; /** True when the message @-mentioned the bot (group chats). */ isInAtList?: boolean; /** Mentioned users when `isInAtList` is true. */ atUsers?: Array<{ dingtalkId?: string; staffId?: string; }>; } /** STOMP destination the gateway pushes inbound bot messages on. */ export declare const INBOUND_DESTINATION = "/v1.0/im/bot/messages/get"; /** STOMP destination replies are SENT to. */ export declare const REPLY_DESTINATION = "/v1.0/im/bot/messages/reply"; /** STOMP subscription id used for the inbound topic. */ export declare const INBOUND_SUBSCRIPTION = "inbound"; /** True when the message @-mentioned the bot (used for group requireMention). */ export declare function isAtMentioned(msg: DingtalkBotMessage): boolean; /** * Normalize a gateway payload into an `InboundMessage`. Returns `undefined` * for payloads that cannot be routed (missing conversation/sender) or that * carry no usable text body. */ export declare function normalizeBotMessage(raw: DingtalkBotMessage, channel?: string): InboundMessage | undefined; /** JSON body for a plain-text reply to a message. */ export declare function buildTextReplyBody(msgId: string, content: string): string; /** JSON body for a markdown reply to a message. */ export declare function buildMarkdownReplyBody(msgId: string, title: string, text: string): string; /** JSON body for the STOMP CONNECT frame. */ export declare function buildConnectBody(clientId: string, clientSecret: string): string; //# sourceMappingURL=message.d.ts.map