interface Entry {
    archive: (() => Promise<Entry>);
    createComment: ((data: CreateCommentProps) => Promise<Comment | RichTextComment>);
    createTask: ((data: CreateTaskProps) => Promise<Task>);
    delete: (() => Promise<any>);
    fields: KeyValueMap;
    getComment: ((id: string) => Promise<Comment | RichTextComment>);
    getComments: (() => Promise<Collection<Comment | RichTextComment, CommentProps | RichTextCommentProps>>);
    getSnapshot: ((snapshotId: string) => Promise<Snapshot<EntryProps>>);
    getSnapshots: ((query?: {}) => Promise<Collection<Snapshot<EntryProps>, SnapshotProps<EntryProps>>>);
    getTask: ((id: string) => Promise<Task>);
    getTasks: ((query?: {}) => Promise<Collection<Task, TaskProps>>);
    isArchived: (() => boolean);
    isDraft: (() => boolean);
    isPublished: (() => boolean);
    isUpdated: (() => boolean);
    metadata?: MetadataProps;
    patch: ((ops: OpPatch[]) => Promise<Entry>);
    publish: (() => Promise<Entry>);
    references: ((options?: EntryReferenceOptionsProps) => Promise<Collection<Entry, EntryProps<KeyValueMap>>>);
    sys: EntryMetaSysProps;
    unarchive: (() => Promise<Entry>);
    unpublish: (() => Promise<Entry>);
    update: (() => Promise<Entry>);
    toPlainObject(): EntryProps<KeyValueMap>;
}

Hierarchy (view full)

Properties

archive: (() => Promise<Entry>) = ...

Archives the object

Type declaration

    • (): Promise<Entry>
    • Returns Promise<Entry>

      Object returned from the server with updated metadata.

createComment: ((data: CreateCommentProps) => Promise<Comment | RichTextComment>) = ...

Creates a new comment for an entry

Type declaration

    • (data): Promise<Comment | RichTextComment>
    • Parameters

      Returns Promise<Comment | RichTextComment>

      Promise for the newly created Comment

createTask: ((data: CreateTaskProps) => Promise<Task>) = ...

Creates a new task for an entry

Type declaration

    • (data): Promise<Task>
    • Parameters

      Returns Promise<Task>

      Promise for the newly created Task

delete: (() => Promise<any>) = ...

Deletes this object on the server.

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

fields: KeyValueMap
getComment: ((id: string) => Promise<Comment | RichTextComment>) = ...

Gets a comment of an entry

Type declaration

    • (id): Promise<Comment | RichTextComment>
    • Parameters

      • id: string

      Returns Promise<Comment | RichTextComment>

      const contentful = require('contentful-management')

      const client = contentful.createClient({ accessToken: '<content_management_api_key>' })

      client.getSpace('<space_id>') .then((space) => space.getEnvironment('')) .then((environment) => environment.getEntry('')) .then((entry) => entry.getComment(<comment-id>)) .then((comment) => console.log(comment)) .catch(console.error)

      
      
getComments: (() => Promise<Collection<Comment | RichTextComment, CommentProps | RichTextCommentProps>>) = ...

Gets all comments of an entry

Type declaration

    • (): Promise<Collection<Comment | RichTextComment, CommentProps | RichTextCommentProps>>
    • Returns Promise<Collection<Comment | RichTextComment, CommentProps | RichTextCommentProps>>

      const contentful = require('contentful-management')

      const client = contentful.createClient({ accessToken: '<content_management_api_key>' })

      client.getSpace('<space_id>') .then((space) => space.getEnvironment('')) .then((environment) => environment.getEntry('')) .then((entry) => entry.getComments()) .then((comments) => console.log(comments)) .catch(console.error)

      
      
getSnapshot: ((snapshotId: string) => Promise<Snapshot<EntryProps>>) = ...

Gets a snapshot of an entry

Type declaration

getSnapshots: ((query?: {}) => Promise<Collection<Snapshot<EntryProps>, SnapshotProps<EntryProps>>>) = ...

Gets all snapshots of an entry

getTask: ((id: string) => Promise<Task>) = ...

Gets a task of an entry

Type declaration

    • (id): Promise<Task>
    • Parameters

      • id: string

      Returns Promise<Task>

      const contentful = require('contentful-management')

      const client = contentful.createClient({ accessToken: '<content_management_api_key>' })

      client.getSpace('<space_id>') .then((space) => space.getEnvironment('')) .then((environment) => environment.getEntry('')) .then((entry) => entry.getTask(<task-id>)) .then((task) => console.log(task)) .catch(console.error)

      
      
getTasks: ((query?: {}) => Promise<Collection<Task, TaskProps>>) = ...

Gets all tasks of an entry

Type declaration

    • (query?): Promise<Collection<Task, TaskProps>>
    • Parameters

      • query: {} = {}

        Returns Promise<Collection<Task, TaskProps>>

        const contentful = require('contentful-management')

        const client = contentful.createClient({ accessToken: '<content_management_api_key>' })

        client.getSpace('<space_id>') .then((space) => space.getEnvironment('')) .then((environment) => environment.getEntry('')) .then((entry) => entry.getTasks()) .then((tasks) => console.log(tasks)) .catch(console.error)

        
        
    isArchived: (() => boolean) = ...

    Checks if entry is archived. This means it's not exposed to the Delivery/Preview APIs.

    isDraft: (() => boolean) = ...

    Checks if the entry is in draft mode. This means it is not published.

    isPublished: (() => boolean) = ...

    Checks if the entry is published. A published entry might have unpublished changes

    isUpdated: (() => boolean) = ...

    Checks if the entry is updated. This means the entry was previously published but has unpublished changes.

    metadata?: MetadataProps
    patch: ((ops: OpPatch[]) => Promise<Entry>) = ...

    Sends an JSON patch to the server with any changes made to the object's properties

    Type declaration

      • (ops): Promise<Entry>
      • Parameters

        • ops: OpPatch[]

        Returns Promise<Entry>

        Object returned from the server with updated changes.

    publish: (() => Promise<Entry>) = ...

    Publishes the object

    Type declaration

      • (): Promise<Entry>
      • Returns Promise<Entry>

        Object returned from the server with updated metadata.

    references: ((options?: EntryReferenceOptionsProps) => Promise<Collection<Entry, EntryProps<KeyValueMap>>>) = ...

    Recursively collects references of an entry and their descendants

    unarchive: (() => Promise<Entry>) = ...

    Unarchives the object

    Type declaration

      • (): Promise<Entry>
      • Returns Promise<Entry>

        Object returned from the server with updated metadata.

    unpublish: (() => Promise<Entry>) = ...

    Unpublishes the object

    Type declaration

      • (): Promise<Entry>
      • Returns Promise<Entry>

        Object returned from the server with updated metadata.

    update: (() => Promise<Entry>) = ...

    Sends an update to the server with any changes made to the object's properties

    Type declaration

      • (): Promise<Entry>
      • Returns Promise<Entry>

        Object returned from the server with updated changes.

    Methods