1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-21 03:27:01 +00:00

ui: Initial Elm UI import

Merged from https://github.com/jhillyerd/inbucket-elm

Uses https://github.com/halfzebra/create-elm-app
This commit is contained in:
James Hillyerd
2018-06-02 12:44:15 -07:00
parent 8b5a05eb40
commit c5b5321be3
24 changed files with 3027 additions and 1 deletions

44
ui/src/Data/Message.elm Normal file
View File

@@ -0,0 +1,44 @@
module Data.Message exposing (..)
import Json.Decode as Decode exposing (..)
import Json.Decode.Pipeline exposing (..)
type alias Message =
{ mailbox : String
, id : String
, from : String
, to : List String
, subject : String
, date : String
, size : Int
, seen : Bool
, body : Body
}
type alias Body =
{ text : String
, html : String
}
decoder : Decoder Message
decoder =
decode Message
|> required "mailbox" string
|> required "id" string
|> optional "from" string ""
|> required "to" (list string)
|> optional "subject" string ""
|> required "date" string
|> required "size" int
|> required "seen" bool
|> required "body" bodyDecoder
bodyDecoder : Decoder Body
bodyDecoder =
decode Body
|> required "text" string
|> required "html" string