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.Client

Drives HTTP for the SDK. This is the only module with effects — every Cortex.Api.* module produces a pure Request that is dispatched through send / sendWith.

type Config

Opaque HTTP client configuration. Holds the tenant base URL, the API credentials, and the per-request timeout. Construct via config and tweak with withTimeout.

{ tenant : String
, credentials : Credentials
}
-> Config

Build a Config from the tenant base URL and credentials. The timeout defaults to 30 seconds; change it with withTimeout.

withTimeout : Float -> Config -> Config

Set a new per-request timeout, in milliseconds.

send : Config -> (Result Error a -> msg) -> Request a -> Cmd msg

Send a request using Time.now for the timestamp and elm/random for the nonce. Suitable for browser apps.

sendWith : Stamp -> Config -> (Result Error a -> msg) -> Request a -> Cmd msg

Send a request with a caller-supplied stamp. The CLI uses this so the nonce comes from Node's crypto.randomBytes rather than Elm's PRNG.

-> Stamp
-> Request a
-> { method : String
, headers : List Header
, url : String
, body : Body
, decoder : Decoder a
}

Build a pure record from a Config, Stamp, and Request. Useful for consumers who want to drive Http themselves.