import type { IncomingMessage, ServerResponse } from 'node:http'; import { type ConnectorDefinition } from '../services/connector-store.js'; import type { TriggerRequest } from '../services/trigger-types.js'; import { type ResolveConnectorMentionIdentities } from '../services/connector-topic-template.js'; import { type TriggerApiDeps } from './trigger-api.js'; export type WebhookRouteDeps = TriggerApiDeps & { createLifecycleGroup?: (connector: ConnectorDefinition, args: { dedupKey: string; }) => Promise<{ chatId: string; creatorLarkAppId?: string; }>; resolveMentionIdentities?: ResolveConnectorMentionIdentities; }; export declare function verifyWebhookSignature(secret: string, ts: string, rawBody: Buffer, sig: string): boolean; export declare function verifyWebhookToken(secret: string, presented: string): boolean; /** Resolve the connector-owned topic seed once at the trusted webhook edge. * The request body can never override this presentation setting. */ export declare function connectorTriggerPresentation(connector: ConnectorDefinition): TriggerRequest['presentation'] | undefined; interface ConnectorMentionIdentityDeps { resolveRaw: (botId: string, identities: string[]) => Promise<{ map: Map; }>; getProfile: (botId: string, userId: string, idType: 'open_id') => Promise<{ status: string; }>; } /** Resolve indirect identities normally, but require direct open_ids from the * untrusted payload to be visible through this target Bot before accepting them. */ export declare function resolveConnectorMentionIdentities(botId: string, identities: string[], deps: ConnectorMentionIdentityDeps): Promise>; /** Template rendering is asynchronous because identities from untrusted event * data must be resolved into this connector Bot's app-scoped open_ids before * they may become native Lark mentions. */ export declare function resolveConnectorTriggerPresentation(connector: ConnectorDefinition, payload: unknown, resolveMentions?: ResolveConnectorMentionIdentities): Promise; export declare function handleWebhookRoute(req: IncomingMessage, res: ServerResponse, url: URL, deps: WebhookRouteDeps): Promise; export {}; //# sourceMappingURL=webhook-routes.d.ts.map