EntryCollection

EntryCollection

Entry collection.

Constructor

new EntryCollection(request, path, options)

Create an entry collection.

Source:
Parameters:
Name Type Description
request object

Axios client.

path string

Path or plain title.

options object

Parameters that user can specify.

Name Type Attributes Default Description
type CollectionType <optional>
null

Sorting or filtering type.

author string <optional>
null

Username, if type is 'author' set this parameter.

search string <optional>
null

Search text, if type is 'find' set this parameter.

page number <optional>
1

Page number.

cookies string <optional>
null

Cookie string.

Extends

Members

collectionType :CollectionType

Entry sorting or filtering type.

Source:
Type:

currPage :number

Current page.

Overrides:
Source:
Type:
  • number

draftEntry :DraftEntry|null

Draft entry.

Source:
Type:

entries :Array.<(Entry|EntryForMember)>

Entry collection.

Source:
Type:

pageCount :number

Total page count.

Overrides:
Source:
Type:
  • number

searchAuthor :string

Searched user's username.

Source:
Type:
  • string

searchText :string

Searched text.

Source:
Type:
  • string

title :string

Title.

Source:
Type:
  • string

titleId :number

Title ID.

Source:
Type:
  • number

titleSlug :string

Title slug.

Source:
Type:
  • string

titleUrl :string

Title URL.

Source:
Type:
  • string

Methods

(async) createEntry(content, options) → {Promise.<(EntryForMember|DraftEntry)>}

Create entry.

Source:
Parameters:
Name Type Description
content string

Entry content.

options object

Parameters that user can specify.

Name Type Attributes Default Description
saveAsDraft boolean <optional>
false

Save as draft.

Throws:

User not authorized.

Type
AuthError
Returns:
Type:
Promise.<(EntryForMember|DraftEntry)>

Created entry.

(async) first()

Retrieve first page.

Overrides:
Source:

(async) last()

Retrieve last page.

Overrides:
Source:

(async) next()

Retrieve next page.

Overrides:
Source:

(async) prev()

Retrieve previous page.

Overrides:
Source:

retrieve() → {Promise}

Retrieve the entry collection.

Source:
Returns:
Type:
Promise

Promise.