Class Api

Defined in: src/api.coffee

Overview

Public: kitchen sink class for various convenience methods Examples require('cozydb').api.getCozyInstance (err, instance) ->

Examples:

require('cozydb').api.getCozyInstance (err, instance) ->

Instance Method Summary

Instance Method Details

::getCozyDomain(callback) Source

Public: get the Cozy domain Warning : Your app need to ask the CozyInstance permission domain is normalized with https and trailing / callback - Function(Error err, String domain) Returns null

Parameters:

Returns:

  • Returns null

::getCozyInstance(callback) Source

Public: get the CozyInstance object Warning : Your app need to ask the CozyInstance permission callback - Function(Error err, {CozyInstance} instance) Returns null

Parameters:

  • (Function) callbackFunction(Error err, {CozyInstance} instance)

Returns:

  • Returns null

::getCozyLocale(callback) Source

Public: get the Cozy locale Warning : Your app need to ask the CozyInstance permission callback - Function(Error err, String locale) Returns null

Parameters:

Returns:

  • Returns null

::getCozyOwnerEmail(callback) Source

Public: get the Cozy owner's email Warning : Your app need to ask the User permission callback - Function(Error err, String email) Returns null

Parameters:

Returns:

  • Returns null

::getCozyTags(callback) Source

Public: get all existing tags in the cozy callback - Function(Error err, [String] tags) Returns null

Parameters:

Returns:

  • Returns null

::getCozyTimezone(callback) Source

Public: get the Cozy timezone Warning : Your app need to ask the User permission callback - Function(Error err, String timezone) Returns null

Parameters:

Returns:

  • Returns null

::getCozyUser(callback) Source

Public: get the CozyUser object Warning : Your app need to ask the User permission callback - Function(Error err, {CozyUser} instance) Returns null

Parameters:

  • (Function) callbackFunction(Error err, {CozyUser} instance)

Returns:

  • Returns null

::sendMail(data, callback) Source

Public: send an email Warning : Your app need to ask the "send mail" permission data - Object :to :from :subject :cc :bcc :replyTo :inReplyTo :references :headers :alternatives :envelope :messageId :date :encoding :text :html callback - Function(Error err) Returns null

Parameters:

  • (Object) dataObject
    • to
    • from
    • subject
    • cc
    • bcc
    • replyTo
    • inReplyTo
    • references
    • headers
    • alternatives
    • envelope
    • messageId
    • date
    • encoding
    • text
    • html
  • (Function) callbackFunction(Error err)

Returns:

  • Returns null

::sendMailFromUser(data, callback) Source

Public: send an email from the cozy owner Warning : Your app need to ask the "send mail from user" permission data - Object :to :subject :text :html callback - Function(Error err) Returns null

Parameters:

Returns:

  • Returns null

::sendMailToUser(data, callback) Source

Public: send an email to the cozy owner Warning : Your app need to ask the "send mail to user" permission data - Object :to :subject :text :html callback - Function(Error err) Returns null

Parameters:

Returns:

  • Returns null