carpe/elm-data/4.0.2

NOTE: the latest version is 4.0.5

Rerouted (archive, verified). The original repository is gone. This copy comes from an archive (Software Heritage). The Lamdera package server serves a copy recovered from swh:1:rev:c54ee7c56562d66b549221c6f4ed3a54e4cd2328 (Software Heritage, origin https://github.com/carpe/elm-data).

What we checked: Software Heritage archived tag 4.0.2 of github.com/carpe/elm-data at commit c54ee7c56562; its commit c54ee7c56562 is from 2020-03-01 00:50 UTC, before the version was published (2020-03-01 00:51 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, made from Software Heritage's copy of the files Elm uses, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/carpe/elm-data/zipball/4.0.2/

ElmData.Session

Sessions exist to hold all state associated with your requests.

Right now that's just Auth data, but I think this could also be a great place for cached data to live as well.

type Session
= Unauthenticated
| Active SessionData

The Session

type alias SessionData =
{ authToken : String
, expiration : Int
, permissions : List String
}

Data related to an authenticated session

checkSessionExpiration : Posix -> SessionData -> Result SessionFailure SessionData

Check if session is expired

checkError : Error -> Maybe SessionFailure

Check if a request failure was caused by the session

= Failure String
| Corrupt
| ExpiredSession

Result of the Creation of a Session