Skip to main content

vantage_api_client/
lib.rs

1// @llm-protected: public API must not be extended on a whim. All features are implemented, do not add duplicates.
2//! Vantage adapters for HTTP-based API backends.
3//!
4//! Two protocol adapters live side by side:
5//!
6//! * [`rest`] — generic REST API client. Maps `Table<RestApi, E>` to
7//!   `GET {base_url}/{table_name}` with eq-conditions and pagination
8//!   peeled into the URL query string.
9//! * [`graphql`] — GraphQL API client. Renders typed query documents
10//!   with inline filters + variable-typed pagination, supports both
11//!   Hasura and flat-argument (e.g. SpaceX) dialects, and bridges
12//!   into Vista via a YAML schema map.
13//!
14//! Every type a caller needs is re-exported here; see [`prelude`] for a
15//! one-stop import. Requests go through `vantage-api-pool`'s
16//! [`ResilientClient`], whose types are re-exported too. The HTTP client
17//! is `reqwest` 0.12, which appears in the public API
18//! ([`RestApiBuilder::http_client`], [`RestApi::http_request`]).
19
20#![warn(missing_docs)]
21
22pub mod graphql;
23pub mod prelude;
24pub mod rest;
25mod row_keys;
26mod transport;
27
28pub use transport::BearerSource;
29pub use vantage_api_pool::resilient::{
30    AuthFuture, AuthRefresher, BreakerMode, BreakerState, CallPolicy, ClientError, ErrorKind,
31    ResilientClient, ResilientClientBuilder, RetryMode, RetryPolicy, TransportEvent,
32    TransportObserver,
33};
34pub use vantage_core::Priority;
35
36pub use graphql::{
37    AnyGraphqlType, CountMode, FieldCondition, FilterDialect, GraphqlApi, GraphqlApiBuilder,
38    GraphqlApiTableShell, GraphqlApiVistaFactory, GraphqlApiVistaSpec, GraphqlBlock,
39    GraphqlColumnBlock, GraphqlColumnExtras, GraphqlCondition, GraphqlOp, GraphqlOperation,
40    GraphqlSelect, GraphqlTableExtras, GraphqlType, GraphqlTypeVariants, RenderedQuery, Supports,
41};
42pub use rest::{
43    ApiColumnExtras, ApiReferenceExtras, ApiTableBlock, ApiTableExtras, FilterStrategy,
44    OrderingParams, PaginationMode, PaginationParams, ResponseShape, RestApi, RestApiBuilder,
45    RestApiTableShell, RestApiVistaFactory, RestApiVistaSpec, eq_condition,
46};
47pub(crate) use rest::{cbor_to_query_string, condition_to_query_param};