import { OpenAPIHono } from "@hono/zod-openapi"; import type { EventBus, ModuleContainer } from "@voyant-travel/core"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { BookingDocumentAttachmentResolver } from "./service-booking-documents.js"; import type { NotificationProvider } from "./types.js"; type Env = { Bindings: Record; Variables: { container: ModuleContainer; db: PostgresJsDatabase; userId?: string; }; }; export type NotificationsRoutesOptions = { providers?: ReadonlyArray; resolveProviders?: (bindings: Record) => ReadonlyArray; publicCheckoutBaseUrl?: string | null; resolvePublicCheckoutBaseUrl?: (bindings: Record) => string | null | undefined; publicCustomerPortalBaseUrl?: string | null; resolvePublicCustomerPortalBaseUrl?: (bindings: Record) => string | null | undefined; documentAttachmentResolver?: BookingDocumentAttachmentResolver; resolveDocumentAttachmentResolver?: (bindings: Record) => BookingDocumentAttachmentResolver | undefined; eventBus?: EventBus; resolveEventBus?: (bindings: Record) => EventBus | undefined; }; export type NotificationsRouteRuntime = { providers: ReadonlyArray; publicCheckoutBaseUrl?: string | null; publicCustomerPortalBaseUrl?: string | null; documentAttachmentResolver?: BookingDocumentAttachmentResolver; eventBus?: EventBus; }; export declare const NOTIFICATIONS_ROUTE_RUNTIME_CONTAINER_KEY = "providers.notifications.runtime"; export declare function buildNotificationsRouteRuntime(bindings: Record, options?: NotificationsRoutesOptions): NotificationsRouteRuntime; export declare function createNotificationsRoutes(options?: NotificationsRoutesOptions): OpenAPIHono & import("hono/types").MergeSchemaPath<{ "/notification-settings": { $get: { input: {}; output: { data: { id: string; scope: string; quietHoursLocal: { start: string; end: string; tz: string; } | null; blackoutDates: string[] | null; skipWeekends: boolean; recipientRateLimitPerDay: number | null; suppressionWindowHours: number; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/notification-settings": { $patch: { input: { json: { scope?: string | undefined; quietHoursLocal?: { start: string; end: string; tz: string; } | null | undefined; blackoutDates?: string[] | null | undefined; skipWeekends?: boolean | undefined; recipientRateLimitPerDay?: unknown; suppressionWindowHours?: unknown; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { json: { scope?: string | undefined; quietHoursLocal?: { start: string; end: string; tz: string; } | null | undefined; blackoutDates?: string[] | null | undefined; skipWeekends?: boolean | undefined; recipientRateLimitPerDay?: unknown; suppressionWindowHours?: unknown; metadata?: Record | null | undefined; }; }; output: { data: { id: string; scope: string; quietHoursLocal: { start: string; end: string; tz: string; } | null; blackoutDates: string[] | null; skipWeekends: boolean; recipientRateLimitPerDay: number | null; suppressionWindowHours: number; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminders/preview": { $get: { input: { query: { date?: string | undefined; ruleId?: string | undefined; targetId?: string | undefined; }; }; output: { data: { ruleId: string; ruleName: string; ruleSlug: string; targetType: string; targetId: string; bookingId: string | null; stageId: string; stageName: string | null; stageOrderIndex: number; anchor: string; anchorDate: string; scheduledAt: string; sendCountAtFire: number; reasoning: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-runs": { $get: { input: { query: { limit?: unknown; offset?: unknown; reminderRuleId?: string | undefined; targetType?: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment" | undefined; targetId?: string | undefined; scheduleId?: string | undefined; invoiceId?: string | undefined; bookingId?: string | undefined; paymentSessionId?: string | undefined; notificationDeliveryId?: string | undefined; personId?: string | undefined; organizationId?: string | undefined; recipient?: string | undefined; status?: "sent" | "failed" | "processing" | "queued" | "skipped" | undefined; }; }; output: { data: { id: string; reminderRuleId: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; targetId: string; dedupeKey: string; status: "sent" | "failed" | "processing" | "queued" | "skipped"; recipient: string | null; scheduledFor: string; processedAt: string; errorMessage: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; links: { bookingId: string | null; bookingPaymentScheduleId: string | null; invoiceId: string | null; paymentSessionId: string | null; personId: string | null; organizationId: string | null; notificationDeliveryId: string | null; }; reminderRule: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; }; delivery: { id: string; status: "pending" | "sent" | "failed" | "cancelled"; channel: "email" | "sms"; provider: string; toAddress: string; subject: string | null; sentAt: string | null; failedAt: string | null; errorMessage: string | null; } | null; }[]; total: number; limit: number; offset: number; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-runs/:id": { $get: { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; }; output: { data: { id: string; reminderRuleId: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; targetId: string; dedupeKey: string; status: "sent" | "failed" | "processing" | "queued" | "skipped"; recipient: string | null; scheduledFor: string; processedAt: string; errorMessage: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; links: { bookingId: string | null; bookingPaymentScheduleId: string | null; invoiceId: string | null; paymentSessionId: string | null; personId: string | null; organizationId: string | null; notificationDeliveryId: string | null; }; reminderRule: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; }; delivery: { id: string; status: "pending" | "sent" | "failed" | "cancelled"; channel: "email" | "sms"; provider: string; toAddress: string; subject: string | null; sentAt: string | null; failedAt: string | null; errorMessage: string | null; } | null; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminders/run-due": { $post: { input: {}; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: {}; output: { data: { processed: number; sent: number; skipped: number; failed: number; }; }; outputFormat: "json"; status: 200; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/reminder-rules/:id/stages/:stageId/channels": { $get: { input: { param: { id: string; stageId: string; }; }; output: { data: { id: string; stageId: string; orderIndex: number; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; recipientKind: "primary" | "cc" | "bcc"; recipientRole: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id/stages/:stageId/channels": { $post: { input: { param: { id: string; stageId: string; }; } & { json: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; stageId: string; }; } & { json: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; stageId: string; orderIndex: number; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; recipientKind: "primary" | "cc" | "bcc"; recipientRole: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; }; }; } & { "/reminder-rules/:id/stages/:stageId/channels/:channelId": { $patch: { input: { param: { id: string; stageId: string; channelId: string; }; } & { json: { orderIndex?: unknown; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; stageId: string; channelId: string; }; } & { json: { orderIndex?: unknown; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; stageId: string; channelId: string; }; } & { json: { orderIndex?: unknown; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; stageId: string; orderIndex: number; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; recipientKind: "primary" | "cc" | "bcc"; recipientRole: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id/stages/:stageId/channels/:channelId": { $delete: { input: { param: { id: string; stageId: string; channelId: string; }; }; output: {}; outputFormat: string; status: 204; } | { input: { param: { id: string; stageId: string; channelId: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/reminder-rules/:id/stages": { $get: { input: { param: { id: string; }; }; output: { data: { id: string; reminderRuleId: string; orderIndex: number; name: string | null; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: number; windowEndDays: number; cadenceKind: "once" | "every_n_days" | "escalating"; cadenceEveryDays: number | null; cadenceIntervals: { repeatEveryDays: number; whenDaysUntilDueGT?: number | null | undefined; whenDaysUntilDueLT?: number | null | undefined; }[] | null; maxSendsInStage: number | null; respectQuietHours: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id/stages": { $post: { input: { param: { id: string; }; } & { json: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; reminderRuleId: string; orderIndex: number; name: string | null; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: number; windowEndDays: number; cadenceKind: "once" | "every_n_days" | "escalating"; cadenceEveryDays: number | null; cadenceIntervals: { repeatEveryDays: number; whenDaysUntilDueGT?: number | null | undefined; whenDaysUntilDueLT?: number | null | undefined; }[] | null; maxSendsInStage: number | null; respectQuietHours: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; }; }; } & { "/reminder-rules/:id/stages/reorder": { $post: { input: { param: { id: string; }; } & { json: { stageIds: string[]; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { stageIds: string[]; }; }; output: { data: { id: string; reminderRuleId: string; orderIndex: number; name: string | null; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: number; windowEndDays: number; cadenceKind: "once" | "every_n_days" | "escalating"; cadenceEveryDays: number | null; cadenceIntervals: { repeatEveryDays: number; whenDaysUntilDueGT?: number | null | undefined; whenDaysUntilDueLT?: number | null | undefined; }[] | null; maxSendsInStage: number | null; respectQuietHours: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id/stages/:stageId": { $patch: { input: { param: { id: string; stageId: string; }; } & { json: { name?: string | null | undefined; orderIndex?: unknown; anchor?: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at" | undefined; windowStartDays?: unknown; windowEndDays?: unknown; cadenceKind?: "once" | "every_n_days" | "escalating" | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; stageId: string; }; } & { json: { name?: string | null | undefined; orderIndex?: unknown; anchor?: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at" | undefined; windowStartDays?: unknown; windowEndDays?: unknown; cadenceKind?: "once" | "every_n_days" | "escalating" | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; stageId: string; }; } & { json: { name?: string | null | undefined; orderIndex?: unknown; anchor?: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at" | undefined; windowStartDays?: unknown; windowEndDays?: unknown; cadenceKind?: "once" | "every_n_days" | "escalating" | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; reminderRuleId: string; orderIndex: number; name: string | null; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: number; windowEndDays: number; cadenceKind: "once" | "every_n_days" | "escalating"; cadenceEveryDays: number | null; cadenceIntervals: { repeatEveryDays: number; whenDaysUntilDueGT?: number | null | undefined; whenDaysUntilDueLT?: number | null | undefined; }[] | null; maxSendsInStage: number | null; respectQuietHours: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id/stages/:stageId": { $delete: { input: { param: { id: string; stageId: string; }; }; output: {}; outputFormat: string; status: 204; } | { input: { param: { id: string; stageId: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/reminder-rules": { $get: { input: { query: { limit?: unknown; offset?: unknown; status?: "draft" | "active" | "archived" | undefined; targetType?: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment" | undefined; channel?: "email" | "sms" | undefined; search?: string | undefined; }; }; output: { data: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; priority: number; suppressionGroup: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules": { $post: { input: { json: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { json: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; priority: number; suppressionGroup: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; }; }; } & { "/reminder-rules/compose": { $post: { input: { json: { rule: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; stages: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; channels: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }[]; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }[]; idempotencyKey?: string | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { json: { rule: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; stages: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; channels: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }[]; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }[]; idempotencyKey?: string | undefined; }; }; output: { data: { ruleId: string; stages: { id: string; orderIndex: number; channels: { id: string; orderIndex: number; }[]; }[]; }; }; outputFormat: "json"; status: 200; } | { input: { json: { rule: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; stages: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; channels: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }[]; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }[]; idempotencyKey?: string | undefined; }; }; output: { data: { ruleId: string; stages: { id: string; orderIndex: number; channels: { id: string; orderIndex: number; }[]; }[]; }; }; outputFormat: "json"; status: 201; } | { input: { json: { rule: { slug: string; name: string; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; status?: "draft" | "active" | "archived" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; stages: { orderIndex: unknown; anchor: "due_date" | "booking_created_at" | "departure_date" | "invoice_issued_at" | "last_send_at"; windowStartDays: unknown; windowEndDays: unknown; cadenceKind: "once" | "every_n_days" | "escalating"; channels: { channel: "email" | "sms"; orderIndex?: unknown; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; recipientKind?: "primary" | "cc" | "bcc" | undefined; recipientRole?: string | null | undefined; metadata?: Record | null | undefined; }[]; name?: string | null | undefined; cadenceEveryDays?: unknown; cadenceIntervals?: { repeatEveryDays: unknown; whenDaysUntilDueGT?: unknown; whenDaysUntilDueLT?: unknown; }[] | null | undefined; maxSendsInStage?: unknown; respectQuietHours?: boolean | undefined; metadata?: Record | null | undefined; }[]; idempotencyKey?: string | undefined; }; }; output: { error: "invalid_reminder_rule_graph"; issues: { code: string; message: string; field?: string | undefined; fix?: string | undefined; }[]; }; outputFormat: "json"; status: 422; }; }; } & { "/reminder-rules/:id": { $get: { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; }; output: { data: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; priority: number; suppressionGroup: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id": { $patch: { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; status?: "draft" | "active" | "archived" | undefined; targetType?: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment" | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; status?: "draft" | "active" | "archived" | undefined; targetType?: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment" | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; status?: "draft" | "active" | "archived" | undefined; targetType?: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment" | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; templateId?: string | null | undefined; templateSlug?: string | null | undefined; priority?: unknown; suppressionGroup?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; slug: string; name: string; status: "draft" | "active" | "archived"; targetType: "booking_payment_schedule" | "invoice" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment"; channel: "email" | "sms"; provider: string | null; templateId: string | null; templateSlug: string | null; priority: number; suppressionGroup: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/reminder-rules/:id": { $delete: { input: { param: { id: string; }; }; output: {}; outputFormat: string; status: 204; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/deliveries": { $get: { input: { query: { limit?: unknown; offset?: unknown; channel?: "email" | "sms" | undefined; provider?: string | undefined; status?: "pending" | "sent" | "failed" | "cancelled" | undefined; templateSlug?: string | undefined; targetType?: "booking" | "booking_payment_schedule" | "booking_guarantee" | "invoice" | "payment_session" | "person" | "organization" | "other" | undefined; targetId?: string | undefined; bookingId?: string | undefined; invoiceId?: string | undefined; paymentSessionId?: string | undefined; personId?: string | undefined; organizationId?: string | undefined; }; }; output: { data: { id: string; templateId: string | null; templateSlug: string | null; targetType: "booking" | "booking_payment_schedule" | "booking_guarantee" | "invoice" | "payment_session" | "person" | "organization" | "other"; targetId: string | null; personId: string | null; organizationId: string | null; bookingId: string | null; invoiceId: string | null; paymentSessionId: string | null; channel: "email" | "sms"; provider: string; providerMessageId: string | null; status: "pending" | "sent" | "failed" | "cancelled"; toAddress: string; fromAddress: string | null; subject: string | null; htmlBody: string | null; textBody: string | null; payloadData: { [x: string]: import("hono/utils/types").JSONValue; } | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; errorMessage: string | null; scheduledFor: string | null; sentAt: string | null; failedAt: string | null; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }; outputFormat: "json"; status: 200; }; }; } & { "/deliveries/:id": { $get: { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; }; output: { data: { id: string; templateId: string | null; templateSlug: string | null; targetType: "booking" | "booking_payment_schedule" | "booking_guarantee" | "invoice" | "payment_session" | "person" | "organization" | "other"; targetId: string | null; personId: string | null; organizationId: string | null; bookingId: string | null; invoiceId: string | null; paymentSessionId: string | null; channel: "email" | "sms"; provider: string; providerMessageId: string | null; status: "pending" | "sent" | "failed" | "cancelled"; toAddress: string; fromAddress: string | null; subject: string | null; htmlBody: string | null; textBody: string | null; payloadData: { [x: string]: import("hono/utils/types").JSONValue; } | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; errorMessage: string | null; scheduledFor: string | null; sentAt: string | null; failedAt: string | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/deliveries/:id/resend": { $post: { input: { param: { id: string; }; } & { json: { idempotencyKey: string; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { idempotencyKey: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; } | { input: { param: { id: string; }; } & { json: { idempotencyKey: string; }; }; output: { data: { id: string; templateId: string | null; templateSlug: string | null; targetType: "booking" | "booking_payment_schedule" | "booking_guarantee" | "invoice" | "payment_session" | "person" | "organization" | "other"; targetId: string | null; personId: string | null; organizationId: string | null; bookingId: string | null; invoiceId: string | null; paymentSessionId: string | null; channel: "email" | "sms"; provider: string; providerMessageId: string | null; status: "pending" | "sent" | "failed" | "cancelled"; toAddress: string; fromAddress: string | null; subject: string | null; htmlBody: string | null; textBody: string | null; payloadData: { [x: string]: import("hono/utils/types").JSONValue; } | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; errorMessage: string | null; scheduledFor: string | null; sentAt: string | null; failedAt: string | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; }; }; }, "/"> & import("hono/types").MergeSchemaPath<{ "/templates": { $get: { input: { query: { limit?: unknown; offset?: unknown; channel?: "email" | "sms" | undefined; provider?: string | undefined; status?: "draft" | "active" | "archived" | undefined; search?: string | undefined; }; }; output: { data: { id: string; slug: string; name: string; channel: "email" | "sms"; provider: string | null; status: "draft" | "active" | "archived"; subjectTemplate: string | null; htmlTemplate: string | null; textTemplate: string | null; fromAddress: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }; outputFormat: "json"; status: 200; }; }; } & { "/templates": { $post: { input: { json: { slug: string; name: string; channel: "email" | "sms"; provider?: string | null | undefined; status?: "draft" | "active" | "archived" | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; slug: string; name: string; channel: "email" | "sms"; provider: string | null; status: "draft" | "active" | "archived"; subjectTemplate: string | null; htmlTemplate: string | null; textTemplate: string | null; fromAddress: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 201; } | { input: { json: { slug: string; name: string; channel: "email" | "sms"; provider?: string | null | undefined; status?: "draft" | "active" | "archived" | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; }; }; } & { "/templates/:id": { $get: { input: { param: { id: string; }; }; output: { data: { id: string; slug: string; name: string; channel: "email" | "sms"; provider: string | null; status: "draft" | "active" | "archived"; subjectTemplate: string | null; htmlTemplate: string | null; textTemplate: string | null; fromAddress: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; } & { "/templates/:id": { $patch: { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; status?: "draft" | "active" | "archived" | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; status?: "draft" | "active" | "archived" | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { data: { id: string; slug: string; name: string; channel: "email" | "sms"; provider: string | null; status: "draft" | "active" | "archived"; subjectTemplate: string | null; htmlTemplate: string | null; textTemplate: string | null; fromAddress: string | null; isSystem: boolean; metadata: { [x: string]: import("hono/utils/types").JSONValue; } | null; createdAt: string; updatedAt: string; }; }; outputFormat: "json"; status: 200; } | { input: { param: { id: string; }; } & { json: { slug?: string | undefined; name?: string | undefined; channel?: "email" | "sms" | undefined; provider?: string | null | undefined; status?: "draft" | "active" | "archived" | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; isSystem?: boolean | undefined; metadata?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; } & { "/templates/:id": { $delete: { input: { param: { id: string; }; }; output: {}; outputFormat: string; status: 204; } | { input: { param: { id: string; }; }; output: { error: string; }; outputFormat: "json"; status: 404; }; }; } & { "/preview": { $post: { input: { json: { channel: "email" | "sms"; provider?: string | null | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; data?: Record | null | undefined; }; }; output: { error: string; }; outputFormat: "json"; status: 400; } | { input: { json: { channel: "email" | "sms"; provider?: string | null | undefined; subjectTemplate?: string | null | undefined; htmlTemplate?: string | null | undefined; textTemplate?: string | null | undefined; fromAddress?: string | null | undefined; data?: Record | null | undefined; }; }; output: { data: { channel: "email" | "sms"; provider: string | null; fromAddress: string | null; subject: string | null; html: string | null; text: string | null; }; }; outputFormat: "json"; status: 200; }; }; }, "/">, "/">; export {};