//! Fetch gateway helpers that power the `/gateway/data`, `/gateway/fetch`, `/gateway/update`, and `/data` routes.
//!
//! Supports POST and GET entry points, column normalization, cache hydration, and optional post-processing.

mod conditions;
mod execution;
mod get_data;
mod post_processing;
mod request;
mod response;
mod room_id;
mod routes;
mod singleflight;
mod types;
mod update;

pub use post_processing::apply_post_processing;
pub use types::{AggregationStrategy, PostProcessingConfig, SortOptions, TimeGranularity};

pub use get_data::get_data_route;
pub use routes::{fetch_data_route, proxy_fetch_data_route};
pub use update::gateway_update_route;

pub(crate) use conditions::to_query_conditions;
pub(crate) use execution::execute_gateway_fetch_data;
pub(crate) use request::{parse_gateway_fetch_conditions, parse_sort_options_from_body};
pub(crate) use routes::handle_fetch_data_route;
// Stable crate entry point for tests/tools that call the handler without routing (same as `handle_fetch_data_route`).
#[allow(unused_imports)]
pub(crate) use update::handle_gateway_update_route;
