axelerator/elm-jscontact/2.0.0

JSContact

decoder : Decoder JSContact

A JSON decoder for JSContact.

type alias JSContact =
{ kind : Kind
, version : String
, uid : Uid
, created : Maybe UTCDateTime
, updated : Maybe UTCDateTime
, language : Maybe String
, name : Maybe Name
, members : List Uid
, prodId : Maybe String
, relatedTo : RelatedTo
, emails : Emails
, addresses : Addresses
, phones : Phones
, onlineServices : OnlineServices
, preferredLanguages : PreferredLanguages
}

The contact card.

type alias Address =
{ contexts : List String
, components : List AddressComponent
, isOrdered : Bool
, countryCode : Maybe String
, coordinates : Maybe String
, timeZone : Maybe String
, full : Maybe String
, defaultSeparator : Maybe String
, pref : Maybe Int
, phoneticScript : Maybe String
, phoneticSystem : Maybe String
}

The address of the entity represented by the Card

type alias AddressComponent =
{ value : String
, phonetic : Maybe String
}

The components that make up the address. The component list MUST have at least one entry that has a kind property value other than "separator".

= Room
| Apartment
| Floor
| Building
| StreetNumber
| AddressName
| Block
| Subdistrict
| District
| Locality
| Region
| Postcode
| Country
| Direction
| Landmark
| PostOfficeBox
| Separator
| Other String

The kind of the address component.

type alias Addresses =
Dict String Address

This section defines properties for postal addresses and geographical locations associated with the entity represented by the Card

type alias Email =
{ contexts : List String
, address : String
, pref : Maybe Int
}

The email addresses in which to contact the entity represented by the Card.

type alias Emails =
Dict String Email

This section defines how properties contact the entity represented by the Card.

type Kind
= Individual
| Group
| Organization
| Location
| Device
| Application

The kind of the entity the Card represents

type alias OnlineService =
{ service : Maybe String
, user : Maybe String
, uri : String
, contexts : List String
, pref : Maybe Int
}

The online services that are associated with the entity represented by the Card. This can be messaging services, social media profiles, and other.

type alias OnlineServices =
Dict String OnlineService

The online services in which to contact the entity represented by the Card

type alias Phone =
{ contexts : List String
, phone : String
, pref : Maybe Int
}

A phone number by which to contact the entity represented by the Card

type alias Phones =
Dict String Phone

The phone numbers by which to contact the entity represented by the Card

type alias PreferredLanguage =
{ language : String
, contexts : List String
, pref : Maybe Int
}

A preferred language for contacting the entity associated with the Card

type alias PreferredLanguages =
Dict String PreferredLanguage

The preferred languages for contacting the entity associated with the Card.

type alias RelatedTo =
Dict Uid (List RelationType)

The set of Card objects that relate to the Card. The value is a map, where each key is the uid property value of the related Card, and the value defines the relation

= Aquaintance
| Agent
| Child
| Coresident
| Coworker
| Colleague
| Contact
| Crush
| Date
| Emergency
| Friend
| Kin
| Me
| Met
| Muse
| Neighbor
| Parent
| Sibling
| Spouse
| Sweetheart

The variants define the relation type between the two objects.

type alias UTCDateTime =
String

The UTCDateTime type is a String in "date-time" format [RFC3339]

type alias Uid =
String

An identifier that associates the object as the same across different systems, address books, and views. The value SHOULD be a URN [RFC8141], but for compatibility with [RFC6350], it MAY also be a URI [RFC3986] or free-text value. The value of the URN SHOULD be in the "uuid" namespace [RFC9562]. [RFC9562] describes multiple versions of Universally Unique IDentifiers (UUIDs); UUID version 4 is RECOMMENDED.

type alias Name =
{ components : List NameComponent
, isOrdered : Bool
, defaultSeparator : Maybe String
, full : Maybe String
, sortAs : List ( NameComponentKind, String )
, phoneticScript : Maybe String
, phoneticSystem : Maybe String
}

A Name object as defined in RFC 9553.

type alias NameComponent =
, value : String
, phonetic : Maybe String
}

A NameComponent object as defined in RFC 9553.

= Title
| Given
| Given2
| Surname
| Surname2
| Credential
| Generation
| NameComponentSeparator

The kind of the name component.