Namespace: Entry

Entry

Entry instances

Type Definitions

Entry #

Properties:
Name Type Description
sys Meta.Sys Standard system metadata with additional entry specific properties
Properties
Name Type Attributes Description
contentType Meta.Link Content Type used by this Entry
locale string <optional>
If present, indicates the locale which this entry uses
fields Object.<EntryFields.Field> Object with content for each field
toPlainObject() function Returns this Entry as a plain JS object
Source:

EntryCollection #

Properties:
Name Type Attributes Description
total number
skip number
limit number
items Array.<Entry.Entry>
errors Array.<Object> <optional>
Array of errors that might occur when retrieving entries.
toPlainObject() function Returns this Entry collection as a plain JS object
Source:

Methods

(static) archive() → {Promise.<Entry>} #

Archives the object
Returns:
Object returned from the server with updated metadata.
Type:
Promise.<Entry>
Source:
Example
entry.archive()
.then(entry => console.log(entry.sys.archivedVersion))

(static) delete() → {Promise} #

Deletes this object on the server.
Returns:
Promise for the deletion. It contains no data, but the Promise error case should be handled.
Type:
Promise
Source:
Example
entry.delete()
.catch(err => console.log(err))

(static) isArchived() → {boolean} #

Checks if entry is archived. This means it's not exposed to the Delivery/Preview APIs.
Returns:
Type:
boolean
Source:

(static) isDraft() → {boolean} #

Checks if the entry is in draft mode. This means it is not published.
Returns:
Type:
boolean
Source:

(static) isPublished() → {boolean} #

Checks if the entry is published. A published entry might have unpublished changes (@see {Entry.isUpdated})
Returns:
Type:
boolean
Source:

(static) isUpdated() → {boolean} #

Checks if the entry is updated. This means the entry was previously published but has unpublished changes.
Returns:
Type:
boolean
Source:

(static) publish() → {Promise.<Entry>} #

Publishes the object
Returns:
Object returned from the server with updated metadata.
Type:
Promise.<Entry>
Source:
Example
entry.publish()
.then(entry => console.log(entry.sys.publishedVersion))

(static) unarchive() → {Promise.<Entry>} #

Unarchives the object
Returns:
Object returned from the server with updated metadata.
Type:
Promise.<Entry>
Source:
Example
entry.unarchive()
.then(entry => console.log(entry.sys))

(static) unpublish() → {Promise.<Entry>} #

Unpublishes the object
Returns:
Object returned from the server with updated metadata.
Type:
Promise.<Entry>
Source:
Example
entry.unpublish()
.then(entry => console.log(entry.sys))

(static) update() → {Promise.<Entry>} #

Sends an update to the server with any changes made to the object's properties
Returns:
Object returned from the server with updated changes.
Type:
Promise.<Entry>
Source:
Example
entry.fields.name['en-US'] = 'Blog Post'
entry.update()
.then(entry => console.log(entry.fields.name['en-US']))