Home > @uniformdev/canvas > EntryManagementClient

EntryManagementClient class

Full-CRUD management client for entries. Reads the canonical (PUT-safe) shape from the origin host and defaults state to draft and bypassCache to true.

Signature:

Extends: ContentClientBase

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Constructs a new instance of the EntryManagementClient class

Methods

Method

Modifiers

Description

get(args)

Fetches one entry by id or slug in canonical shape (throws ApiClientError(404) if absent).

history(args)

Fetches historical versions of an entry.

list(args)

Fetches a list of entries in canonical shape.

remove(selector)

Deletes across all states. Scoped to a single edition when editionId is supplied; otherwise deletes all states and editions. Use unpublish to drop only the published state.

save(body, opts)

Creates or updates an entry. Returns the new x-modified-at timestamp.

saveAndPublish(body, opts)

Saves the draft and publishes in one call (two PUTs).

unpublish(selector)

Removes only the published state, leaving the draft intact. Scoped to a single edition when editionId is supplied; otherwise unpublishes all editions. To unpublish only the base edition, pass editionId and entryId as the same value.