|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Wire protocol v2 for the HTTP adapter. More...
#include "aria/abi/export.hpp"#include <cstdint>#include <optional>#include <string>#include <variant>Go to the source code of this file.
Namespaces | |
| namespace | aria |
| namespace | aria::adapters |
| namespace | aria::adapters::http |
| namespace | aria::adapters::http::wire |
| namespace | aria::adapters::http::wire::fields |
| Field-name string constants used in JSON envelopes. | |
| namespace | aria::adapters::http::wire::event_types |
| namespace | aria::adapters::http::wire::field_kinds |
| namespace | aria::adapters::http::wire::list_ops |
Wire protocol v2 for the HTTP adapter.
All payloads are JSON, UTF-8 encoded. The protocol is intentionally simple — anything that needs to be efficient should use a different adapter. The HTTP adapter is for "ergonomic and ubiquitous", not for "fastest".
Browser/JS ──HTTP/REST──▶ HttpAdapter ──ViewModel──▶ Aria core ▲ │ └────────SSE stream────────┘
SSE (Server-Sent Events) carries server-to-client updates. Protocol 2 preserves int64/uint64 outside JavaScript's safe integer range as decimal strings, with the same typed field tag. Safe integers remain JSON numbers. The SDK exposes unsafe values as BigInt; upgrade v1 clients accordingly. WebSocket transport and list envelopes remain reserved, not implemented.
| Method | Path | Purpose |
|---|---|---|
| GET | /aria/health | Readiness probe |
| GET | /aria/views | Enumerate registered views |
| GET | /aria/state?view=X | Snapshot of one view's shadow state |
| POST | /aria/state | Update a view's value (JSON body) |
| POST | /aria/click | Fire a click event |
| POST | /aria/command | Invoke a custom command |
| GET | /aria/stream | Subscribe to server-sent events |
Server → Client (SSE) — data: lines carry JSON of these shapes:
Client → Server (REST body):
Servers MUST tolerate unknown fields (forward-compat). Clients MUST tolerate unknown type values (forward-compat).