Skip to content

cozy-client / models / contact

Namespace: contact

models.contact

Type aliases

FullnameAttributes

Ƭ FullnameAttributes<>: "namePrefix" | "givenName" | "additionalName" | "familyName" | "nameSuffix"

Defined in

packages/cozy-client/src/models/contact.js:9

Variables

CONTACTS_DOCTYPE

Const CONTACTS_DOCTYPE: "io.cozy.contacts"

Defined in

packages/cozy-client/src/models/contact.js:6

Functions

getDefaultSortIndexValue

getDefaultSortIndexValue(contact): string

Returns ‘byFamilyNameGivenNameEmailCozyUrl’ index of a contact

Parameters

Name Type Description
contact any A contact

Returns

string

  • the contact’s ‘byFamilyNameGivenNameEmailCozyUrl’ index

Defined in

packages/cozy-client/src/models/contact.js:214


getDisplayName

getDisplayName(contact): string

Returns a display name for the contact

Parameters

Name Type Description
contact any A contact

Returns

string

  • the contact’s display name

Defined in

packages/cozy-client/src/models/contact.js:176


getFullname

getFullname(contact): string

Returns the contact’s fullname

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s fullname

Defined in

packages/cozy-client/src/models/contact.js:137


getIndexByFamilyNameGivenNameEmailCozyUrl

getIndexByFamilyNameGivenNameEmailCozyUrl(contact): string

Returns ‘byFamilyNameGivenNameEmailCozyUrl’ index of a contact

deprecated Prefer to use getDefaultSortIndexValue.

Parameters

Name Type Description
contact any A contact

Returns

string

  • the contact’s ‘byFamilyNameGivenNameEmailCozyUrl’ index

Defined in

packages/cozy-client/src/models/contact.js:235


getInitials

getInitials(contact): string

Returns the initials of the contact.

Parameters

Name Type Description
contact IOCozyContact A contact

Returns

string

  • the contact’s initials

Defined in

packages/cozy-client/src/models/contact.js:23


getPrimaryAddress

getPrimaryAddress(contact): string

Returns the contact’s main address

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s main address

Defined in

packages/cozy-client/src/models/contact.js:96


getPrimaryCozy

getPrimaryCozy(contact): string

Returns the contact’s main cozy

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s main cozy

Defined in

packages/cozy-client/src/models/contact.js:61


getPrimaryCozyDomain

getPrimaryCozyDomain(contact): string

Returns the contact’s main cozy url without protocol

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s main cozy url

Defined in

packages/cozy-client/src/models/contact.js:72


getPrimaryEmail

getPrimaryEmail(contact): string

Returns the contact’s main email

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s main email

Defined in

packages/cozy-client/src/models/contact.js:50


getPrimaryOrFirst

getPrimaryOrFirst(property): (obj: any) => any

Parameters

Name Type
property any

Returns

fn

▸ (obj): any

Parameters

Name Type
obj any

Returns

any

Defined in

packages/cozy-client/src/models/contact.js:12


getPrimaryPhone

getPrimaryPhone(contact): string

Returns the contact’s main phone number

Parameters

Name Type Description
contact any A contact

Returns

string

  • The contact’s main phone number

Defined in

packages/cozy-client/src/models/contact.js:87


isContact

isContact(doc): boolean

Whether the document is a contact

Parameters

Name Type Description
doc any A document (from io.cozy.something, or com.bitwarden or anything else)

Returns

boolean

Defined in

packages/cozy-client/src/models/contact.js:249


makeDefaultSortIndexValue

makeDefaultSortIndexValue(contact): string

Makes ‘byFamilyNameGivenNameEmailCozyUrl’ index of a contact

Parameters

Name Type Description
contact any A contact

Returns

string

  • the contact’s ‘byFamilyNameGivenNameEmailCozyUrl’ index

Defined in

packages/cozy-client/src/models/contact.js:190


makeDisplayName

makeDisplayName(contact, opts): string

Makes displayName from contact data

Parameters

Name Type Description
contact any A contact
opts Object -
opts.attributesFullname FullnameAttributes[] -

Returns

string

  • The contact’s displayName

Defined in

packages/cozy-client/src/models/contact.js:152


makeFullname

makeFullname(contact, opts): string

Makes fullname from contact name

Parameters

Name Type Description
contact any A contact
opts Object -
opts.attributesFullname FullnameAttributes[] -

Returns

string

  • The contact’s fullname

Defined in

packages/cozy-client/src/models/contact.js:117