The mailman-client API

0.1

A Node.js client for mailman-core

List Class

Extends ApiRequest
Defined in: lib/List.js:16
Module: List
Parent Module: mailman-client

List extends ApiRequest to perform operations on the list resource

Properties

_info Object private

Defined in lib/List.js:58

Object containing the resource information, will be null if getInfo() is never called

Default: null

_keys Array private

Defined in lib/List.js:86

Keys of the _info object

Default: []

_options Object private

Inherited from BaseRequest but overwritten in lib/List.js:29

Configuration options such as the endpoint of the API, auth parameters etc.

Default: {}

_params Object private

The object containing the query parameters

Default: {}

_path Object private

Inherited from BaseRequest but overwritten in lib/List.js:96

Object containing request path variables used to assemble the request URI

Default: {}

_queryParams Boolean private

A boolean flag that is set when there are query parameters to be rendered

Default: false

_rootTemplate String private

Defined in lib/List.js:68

Root template string for the list resource used to compose the _template value

_supportedMethods Array private

Inherited from BaseRequest but overwritten in lib/List.js:48

Supported HTTP methods

Default: ['get','delete']

_template String private

Inherited from BaseRequest but overwritten in lib/List.js:77

The URI template used to generate the URI to request

_url String private

Defined in lib/List.js:39

URL of the list resource

display_name String

Defined in lib/List.js:175

Display name of the list

fqdn_listname String

Defined in lib/List.js:147

The fully qualified list name

list_id String

Defined in lib/List.js:161

The list identifier

list_name String

Defined in lib/List.js:168

Name of the list

mail_host String

Defined in lib/List.js:154

The mail host of the list

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Constructor

List
(
  • options
  • url
)

Defined in lib/List.js:16

Parameters:

  • options Object

    A hash of options for the List instance

    • endpoint String

      The endpoint URI to request

    • [username] String optional

      A username for authenticating API requests

    • [password] String optional

      A password for authenticating API requests

  • url String

    Location of the list resource on the server

Methods

_auth () Object private

Performs auth on the superagent request object if implied externally

Returns:

Object:

The superagent request object by performing auth on it

_checkAuthParameters () Boolean private

Checks if authentication is externally forced on the request object by passing in username & password

Returns:

Boolean:

Returns true if auth is forced else false

_checkMethodSupport
(
  • method
)
Boolean private

Verify that the request object in use supports a HTTP method

Parameters:

  • method String

    An HTTP method to check ('get', 'post', etc)

Returns:

Boolean:

Returns true if the HTTP method is supported else it will throw

_renderPath () String private

Renders the request path by using _path and _template

Returns:

String:

The rendered path string

_renderQuery () String private

Compose query string by using the recorded query parameters

Returns:

String:

Returns the query string to be appended in the final URI

_renderURI () String private

Renders the URI to request after checking for query parameters

Returns:

String:

The URI enpoint to request

_setAccessors () private

Defined in lib/List.js:140

Set the accessors on the object for the resource information i.e _info object

acceptMessage
(
  • requestId
  • [callback]
)
Promise async

Defined in lib/List.js:684

Accept a held message

Parameters:

  • requestId String

    Identifier describing the held message

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

acceptRequest
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:747

Accept a subscription request

Parameters:

  • requestId String

    Identifier describing the subscription request

  • action String

    The action to take on the subscription request

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

addModerator
(
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:525

Add a list moderator

Parameters:

  • address Function

    The email address of the moderator

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

addOwner
(
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:509

Add a list onwer

Parameters:

  • address Function

    The email address of the owner

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

addRole
(
  • role
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:479

Assign a role to an address corresponding to a list

Parameters:

  • role String

    The role to be assigned, owner,moderator etc.

  • address String

    The email address

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

deferMessage
(
  • requestId
  • [callback]
)
Promise async

Defined in lib/List.js:668

Defer a held message

Parameters:

  • requestId String

    Identifier describing the held message

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

deferRequest
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:781

Defer a subscription request

Parameters:

  • requestId String

    Identifier describing the subscription request

  • action String

    The action to take on the subscription request

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

delete
(
  • [callback]
  • transform
)
Promise async

Parameters:

  • [callback] Function optional

    A callback to invoke with the results of the DELETE request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

deleteList
(
  • [callback]
)
Promise async

Defined in lib/List.js:915

Delete the mailing list

Parameters:

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

discardMessage
(
  • requestId
  • [callback]
)
Promise async

Defined in lib/List.js:636

Discard a held message

Parameters:

  • requestId String

    Identifier describing the held message

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

discardRequest
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:764

Discard a subscription request

Parameters:

  • requestId String

    Identifier describing the subscription request

  • action String

    The action to take on the subscription request

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

get
(
  • [callback]
  • transform
)
Promise async

Parameters:

  • [callback] Function optional

    A callback to invoke with the results of the GET request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

getArchivers
(
  • [callback]
)
Promise async

Defined in lib/List.js:456

The ListArchivers instance corresponding to the List instance

Parameters:

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The ListArchivers instance

Returns:

Promise:

Promise to the ListArchivers instance

getHeldMesssages
(
  • [callback]
)
Promise async

Defined in lib/List.js:394

Provides an array of objects describing the list subscriptions requests

Parameters:

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of objects describing the list subscriptions requests

Returns:

Promise:

Promise to an array of objects describing the list subscriptions requests

getHeldMesssages
(
  • [callback]
)
Promise async

Defined in lib/List.js:357

Provides an array of objects describing the held messages information

Parameters:

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of objects describing the held messages

Returns:

Promise:

Promise to an array of objects describing the held messages

getInfo
(
  • [callback]
)
Promise async

Defined in lib/List.js:111

Fetch the resource by making a HTTP GET request and calls the callback(if any), and provide a promise to the Domain object itself

Parameters:

  • [callback] Function optional

    The callback function to be invoked with the results

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List object itself

Returns:

Promise:

Promise to the List object itself

getMemberByEmail
(
  • email
  • [callback]
)
Promise async

Defined in lib/List.js:798

Get a list member by it's email address, it not found throw an Error

Parameters:

  • email String

    The email address of the list member

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The Member instance

Returns:

Promise:

Promise to the Member instance

getMemberPage
(
  • count
  • page
  • [callback]
)
Promise async

Defined in lib/List.js:308

Provides a paging interface to the list members

Parameters:

  • count Number

    Number of items on a page

  • page Page

    Number of pages to be requested

  • [callback] Function optional

    The callback function to be invoked with a Page instance

    • err Error | Object

      Any errors encountered during the request

    • result Object

      A Page instance

Returns:

Promise:

Promise to a Page instance

getMembers
(
  • [callback]
)
Promise async

Defined in lib/List.js:248

Provides an array of Member instances that are list members

Parameters:

  • [callback] Function optional

    The callback function to be invoked with an array of Member instances

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of Member instances

Returns:

Promise:

Promise to an array of Member instances

getModerators
(
  • [callback]
)
Promise async

Defined in lib/List.js:221

Provides an array of Member instances that are list moderators

Parameters:

  • [callback] Function optional

    The callback function to be invoked with an array of Member instances

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of Member instances

Returns:

Promise:

Promise to an array of Member instances

getNonMembers
(
  • [callback]
)
Promise async

Defined in lib/List.js:277

Provides an array of Member instances that are non-members of the list

Parameters:

  • [callback] Function optional

    The callback function to be invoked with an array of Member instances

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of Member instances

Returns:

Promise:

Promise to an array of Member instances

getOwners
(
  • [callback]
)
Promise async

Defined in lib/List.js:194

Provides an array of Member instances that are list owners

Parameters:

  • [callback] Function optional

    The callback function to be invoked with an array of Member instances

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of Member instances

Returns:

Promise:

Promise to an array of Member instances

getSettings
(
  • [callback]
)
Promise async

Defined in lib/List.js:336

Provides the list settings, i.e the Settings instance corresponding to the List instance

Parameters:

  • [callback] Function optional

    The callback function to be invoked with a Settings instance

    • err Error | Object

      Any errors encountered during the request

    • result Object

      A Settings instance

Returns:

Promise:

Promise to a Settings instance

head
(
  • [callback]
  • transform
)
Promise async

Parameters:

  • [callback] Function optional

    A callback to invoke with the results of the HEAD request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

manageRequest
(
  • token
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:430

Take actions on a subscription request i.e accept|reject|discard|defer it

Parameters:

  • token String

    The token identifier for the subscription request

  • action String

    Action to take on the list, accept|reject|discard|defer

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      An array of objects describing the list subscriptions requests

Returns:

Promise:

Promise to an array of objects describing the list subscriptions requests

moderateMessage
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:604

Moderate a held message

Parameters:

  • requestId String

    Identifier describing the held message

  • action String

    The action to take on the held message, viz. defer|accept|reject|discard

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

moderateRequest
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:700

Moderate a subscription request

Parameters:

  • requestId String

    Identifier describing the subscription request

  • action String

    The action to take on the subscription request, viz. defer|accept|reject|discard

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

patch
(
  • data
  • [callback]
  • transform
)
Promise async

Parameters:

  • data Object

    The patch data

  • [callback] Function optional

    A callback to invoke with the results of the PATCH request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

post
(
  • data
  • [callback]
  • transform
)
Promise async

Parameters:

  • data Object

    The post data

  • [callback] Function optional

    A callback to invoke with the results of the POST request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

put
(
  • data
  • [callback]
  • transform
)
Promise async

Parameters:

  • data Object

    The put data

  • [callback] Function optional

    A callback to invoke with the results of the PUT request

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The response of the request

  • transform String

    Flag to get the full response object by passing in identity

Returns:

Promise:

A promise to the results of the HTTP request

query
(
  • key
  • [value]
)
Object chainable

Record query parameters to be rendered in the final URI

Parameters:

  • key String | Object

    The name of the query parameter or an object containing query parameters as key,val pairs repectively

  • [value] String | Array optional

    If the supplied key is a String, then value can be of type Array or String

Returns:

Object:

Returns the ApiRequest instance itself if the arguments are in the required form else throw an Error

rejectMessage
(
  • requestId
  • [callback]
)
Promise async

Defined in lib/List.js:652

Reject a held message

Parameters:

  • requestId String

    Identifier describing the held message

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

rejectRequest
(
  • requestId
  • action
  • [callback]
)
Promise async

Defined in lib/List.js:731

Reject a subscription request

Parameters:

  • requestId String

    Identifier describing the subscription request

  • action String

    The action to take on the subscription request

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The request response

Returns:

Promise:

Promise to the request response

removeModerator
(
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:572

Remove a list moderator

Parameters:

  • address String

    The address of the moderator

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

removeOnwer
(
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:588

Remove a list owner

Parameters:

  • address String

    The address of the list owner

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

removeRole
(
  • role
  • address
  • [callback]
)
Promise async

Defined in lib/List.js:541

Remove an address from a role

Parameters:

  • role String

    The role from which the address is to be removed

  • address String

    The address which is to be removed

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

subscribe
(
  • address
  • displayName
  • preVerified
  • preConfirmed
  • preConfirmed
  • [callback]
)
Promise async

Defined in lib/List.js:833

Subscribe an email address to the list and provide the created Member instance

Parameters:

  • address String

    The email address to be subscribed to the list

  • displayName String

    The display name of the adddress

  • preVerified Boolean

    Addeess is pre verified or not

  • preConfirmed Boolean

    Address is pre confirmed or not

  • preConfirmed Boolean

    Address is pre approved or not

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The Member instance

Returns:

Promise:

Promise to the Member instance

toString () String

Defined in lib/List.js:938

Returns the string representation of the List instance

Returns:

String:

Returns the string representation of the List instance

unsubscribe
(
  • email
  • [callback]
)
Promise async

Defined in lib/List.js:877

Unsubscribe an email address from the list, in case the address is not already subscribed expect it to throw

Parameters:

  • email String

    The email address to be unsubscribed

  • [callback] Function optional

    The callback function to be invoked

    • err Error | Object

      Any errors encountered during the request

    • result Object

      The List instance

Returns:

Promise:

Promise to the List instance

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index