import { z } from '@moxxy/sdk'; /** * zod schemas for the Slack Events API request bodies we accept. Every inbound * body is validated against these BEFORE any field is read or the session is * touched (AGENTS.md A8: validate inbound frames with zod first). Unknown event * subtypes parse to the permissive envelope so we never throw on a Slack event * type we don't subscribe to — we just ignore it. */ /** The URL-verification handshake Slack sends once when you set the Request URL. */ export declare const urlVerificationSchema: z.ZodObject<{ type: z.ZodLiteral<"url_verification">; token: z.ZodOptional; challenge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "url_verification"; challenge: string; token?: string | undefined; }, { type: "url_verification"; challenge: string; token?: string | undefined; }>; export type SlackUrlVerification = z.infer; /** A `message` or `app_mention` inner event. Loose on the many optional fields. */ export declare const messageEventSchema: z.ZodObject<{ type: z.ZodEnum<["message", "app_mention"]>; /** Author user id. Absent for some bot/system messages. */ user: z.ZodOptional; /** Set for messages posted by a bot integration (including our own). */ bot_id: z.ZodOptional; /** Message text (may be empty for attachment-only messages). */ text: z.ZodOptional; /** Channel the event occurred in. */ channel: z.ZodOptional; /** Message timestamp (also the thread root when no `thread_ts`). */ ts: z.ZodOptional; /** Present when the message is inside a thread. */ thread_ts: z.ZodOptional; /** `message_changed` / `message_deleted` etc. — we ignore edited/system subtypes. */ subtype: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "message" | "app_mention"; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; }, { type: "message" | "app_mention"; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; }>; export type SlackMessageEvent = z.infer; /** The `event_callback` envelope wrapping an inner event. */ export declare const eventCallbackSchema: z.ZodObject<{ type: z.ZodLiteral<"event_callback">; /** Workspace/team id — the unit we pair against. */ team_id: z.ZodOptional; api_app_id: z.ZodOptional; /** Stable per-event id used for at-least-once dedupe. */ event_id: z.ZodOptional; event_time: z.ZodOptional; /** The actual event. We only act on message/app_mention; others pass through. */ event: z.ZodObject<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; /** Bot user ids this event was authorized for — lets us detect self-authored messages. */ authorizations: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">>; }, "strip", z.ZodTypeAny, { type: "event_callback"; event: { type: string; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; } & { [k: string]: unknown; }; team_id?: string | undefined; api_app_id?: string | undefined; event_id?: string | undefined; event_time?: number | undefined; authorizations?: z.objectOutputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[] | undefined; }, { type: "event_callback"; event: { type: string; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; } & { [k: string]: unknown; }; team_id?: string | undefined; api_app_id?: string | undefined; event_id?: string | undefined; event_time?: number | undefined; authorizations?: z.objectInputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[] | undefined; }>; export type SlackEventCallback = z.infer; /** * The top-level Slack request envelope: either the one-off url_verification * handshake or an event_callback. A discriminated union on `type` so a body * that is neither is rejected with a clear error. */ export declare const slackEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"url_verification">; token: z.ZodOptional; challenge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "url_verification"; challenge: string; token?: string | undefined; }, { type: "url_verification"; challenge: string; token?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"event_callback">; /** Workspace/team id — the unit we pair against. */ team_id: z.ZodOptional; api_app_id: z.ZodOptional; /** Stable per-event id used for at-least-once dedupe. */ event_id: z.ZodOptional; event_time: z.ZodOptional; /** The actual event. We only act on message/app_mention; others pass through. */ event: z.ZodObject<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodString; user: z.ZodOptional; bot_id: z.ZodOptional; text: z.ZodOptional; channel: z.ZodOptional; ts: z.ZodOptional; thread_ts: z.ZodOptional; subtype: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; /** Bot user ids this event was authorized for — lets us detect self-authored messages. */ authorizations: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">>; }, "strip", z.ZodTypeAny, { type: "event_callback"; event: { type: string; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; } & { [k: string]: unknown; }; team_id?: string | undefined; api_app_id?: string | undefined; event_id?: string | undefined; event_time?: number | undefined; authorizations?: z.objectOutputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[] | undefined; }, { type: "event_callback"; event: { type: string; channel?: string | undefined; text?: string | undefined; thread_ts?: string | undefined; ts?: string | undefined; user?: string | undefined; bot_id?: string | undefined; subtype?: string | undefined; } & { [k: string]: unknown; }; team_id?: string | undefined; api_app_id?: string | undefined; event_id?: string | undefined; event_time?: number | undefined; authorizations?: z.objectInputType<{ user_id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[] | undefined; }>]>; export type SlackEnvelope = z.infer; //# sourceMappingURL=schema.d.ts.map