Class: Account

Account

new Account(jmap, id, optsopt)

This class represents a JMAP Account.

Parameters:
Name Type Attributes Description
jmap Client

The Client instance that created this Account.

id String

The unique identifier of this Account.

opts Object <optional>

The optional properties of this Account.

Properties
Name Type Attributes Default Description
name String <optional>
''

The name of this Account.

isPrimary Boolean <optional>
false

Whether this Account is the primary email account.

isReadOnly Boolean <optional>
false

Whether the entire Account is read-only

hasDataFor Array.<String> <optional>
[]

A list of the data profiles available in this account server.

Source:
See:

Extends

Methods

(static) fromJSONObject(jmap, object) → {Account}

Creates an Account from its JSON representation.

Parameters:
Name Type Description
jmap Client

The Client instance passed to the Account constructor.

object Object

The JSON representation of the Account, as a Javascript object.

Properties
Name Type Description
id String

The identifier of the Account.

Source:
Returns:
Type
Account

getMailboxes(optionsopt) → {Promise}

Fetches all mailboxes of this Account.
This will delegate to Client#getMailboxes, passing this Account's id as the accountId option.

Parameters:
Name Type Attributes Description
options Object <optional>

The options object passed to Client#getMailboxes. Please note that the accountId option will be overriden if defined.

Source:
See:
Returns:

A promise that eventually resolves with an array of Mailbox instances.

Type
Promise

hasCalendars() → {Boolean}

Returns whether this Account supports calendars or not.

Source:
Returns:

true if and only if this Account has calendars enabled, false otherwise.

Type
Boolean

hasContacts() → {Boolean}

Returns whether this Account supports contacts or not.

Source:
Returns:

true if and only if this Account has contacts enabled, false otherwise.

Type
Boolean

hasMail() → {Boolean}

Returns whether this Account supports mail or not.

Source:
Returns:

true if and only if this Account has mail enabled, false otherwise.

Type
Boolean

toJSONObject()

Creates a JSON representation from this Account.

Source:
Returns:

JSON object with only owned properties and non-null default values.