mdcast_api/wire/mod.rs
1//! HTTP wire protocol: the request and response bodies `mdcast-server` and
2//! `mdcast-client` exchange. Types only — no transport, no handler logic.
3//!
4//! The shape of the exchange:
5//!
6//! 1. The client posts a render request ([`RenderMarkdownRequest`] or
7//! [`RenderTemplateRequest`]) whose [`crate::AssetManifest`] names the
8//! assets the render needs, by digest — never inline bytes.
9//! 2. If the server holds every digest, it renders and answers with the
10//! artifact bytes.
11//! 3. If it does not, it answers `409 Conflict` with a
12//! [`MissingBlobsError`]; the client uploads those blobs and retries.
13//! [`BlobCheckRequest`]/[`BlobCheckResponse`] let a client skip a doomed
14//! render round-trip and ask up front.
15//! 4. Any other failure answers with an [`ErrorResponse`].
16//!
17//! Separately, `GET /v1/capabilities` ([`CapabilitiesResponse`]) is an
18//! unauthenticated, cacheable read of deployment shape — which targets and
19//! template formats this instance can actually produce, and its upload size
20//! ceiling — so a client can feature-gate its UI before attempting any of
21//! the above.
22
23pub mod blob;
24pub mod capabilities;
25pub mod error;
26pub mod generated;
27pub mod render;
28
29pub use blob::{BlobCheckRequest, BlobCheckResponse, MissingBlob, MissingBlobsError};
30pub use capabilities::CapabilitiesResponse;
31pub use error::{ErrorCode, ErrorResponse};
32pub use generated::{
33 BoardOptions, BoardTheme, GeneratedAsset, GeneratedSpec, Generator, QrEcLevel,
34};
35pub use render::{RenderMarkdownRequest, RenderOptions, RenderTemplateRequest, TemplateFormat};