/** * Process-local SourceAdapterRegistry + OwnedBookingHandlerRegistry * for the catalog booking engine. Source adapter wiring stays here; owned * vertical booking handlers live in focused registration modules. */ import { type OwnedBookingHandlerRegistry, type SourceAdapterRegistry } from "@voyant-travel/catalog/booking-engine"; import type { Context } from "hono"; /** * Returns the (lazy-initialized) booking-engine registry and kicks the * per-connection Connect warm in the background. Route handlers should prefer * `getBookingEngineRegistryFromContext` (which ties the warm to the request via * `ctx.waitUntil`); async batch entry points should prefer * `ensureBookingEngineRegistry` (which awaits the warm). */ export declare function getBookingEngineRegistry(env: BookingEngineEnv): SourceAdapterRegistry; /** * Returns the booking-engine registry after the per-connection Connect warm has * completed. Use from async batch entry points such as scheduled jobs * where the connection-enumeration latency is acceptable and per-connection * routing matters for the whole run. */ export declare function ensureBookingEngineRegistry(env: BookingEngineEnv): Promise; /** * Re-enumerate Connect connections and register the current set, discarding the * memoized warm first. * * `warmBookingEngineConnectSources` keeps its fulfilled promise for the life of * the isolate, which is right for request paths — but it means a resident Node * deployment that warmed once never sees a connection added later. Batch entry * points whose whole purpose is to pick up new connections (the discovery sync, * on its schedule or on a connection-add wakeup) must refresh instead of reusing * that warm. Registration is keyed by connection id and replaces in place, so a * refresh that overlaps an in-flight warm converges on the same registry. */ export declare function refreshBookingEngineConnectSources(env: BookingEngineEnv): Promise; /** * Returns the (lazy-initialized) owned-handler registry. Phase A registers * products plus retained resale verticals such as accommodations and cruises. */ export declare function getOwnedBookingHandlerRegistry(env: BookingEngineEnv): OwnedBookingHandlerRegistry; export interface BookingEngineEnv { VOYANT_API_KEY?: string; VOYANT_CLOUD_API_KEY?: string; VOYANT_CONNECT_API_KEY?: string; VOYANT_CONNECT_API_URL?: string; VOYANT_CONNECT_MARKET?: string; VOYANT_CONNECT_OPERATOR_ID?: string; VOYANT_CONNECT_SYNC_LIMIT?: string; } /** * Convenience helper for route handlers — pulls env from the Hono context, * returns the cached source registry, and ties the per-connection Connect warm * to the request via `ctx.waitUntil` so the enumeration isn't torn down when the * request ends. Non-blocking: the request proceeds on the un-scoped fallback * during the first per-isolate warm. */ export declare function getBookingEngineRegistryFromContext(c: Context): SourceAdapterRegistry; /** * Convenience helper for route handlers — pulls env from the Hono context and * returns the cached owned-handler registry. */ export declare function getOwnedBookingHandlerRegistryFromContext(c: Context): OwnedBookingHandlerRegistry;