vanhecke/celmex/3.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/vanhecke/celmex is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with the same repo name found; no cached copy. Use another version.

Details

Cortex.Request

Opaque request descriptor. Each Cortex.Api.* module builds a Request a describing the endpoint to hit and how to decode its response; Cortex.Client.send is what actually dispatches it.

Only GET and POST are provided — the Cortex Advanced API does not use PUT, PATCH, or DELETE, so adding those verbs would be dead code.

type Request a

A pending HTTP request paired with its response decoder. Opaque so the wire format stays an implementation detail of the SDK.

get : List String -> Decoder a -> Request a

Build a GET request from a path (as a list of segments) and a response decoder.

post : List String -> Value -> Decoder a -> Request a

Build a POST request from a path, a JSON body, and a response decoder.

postEmpty : List String -> Decoder a -> Request a

POST with the empty advanced-API envelope {"request_data": {}} as the body. Used by endpoints that take no filters or paging arguments.

map : (a -> b) -> Request a -> Request b

Transform the decoded response value. Useful for wrapping a typed result into a different shape before it reaches your update.

withDecoder : Decoder b -> Request a -> Request b

Replace the response decoder entirely. Useful when a caller wants the raw JSON (for logging, cache, or piping to another tool) instead of the typed shape the endpoint module provides: Request.withDecoder Decode.value req turns any Request a into a Request Value.

-> { method : String
, path : List String
, query : List ( String, String )
, body : Value
, decoder : Decoder a
}

Extract the raw method/path/query/body/decoder record. Intended as an escape hatch for Cortex.Client.toRequestRecord and custom dispatchers; most consumers should not need this.