<!doctype html> Version | Drafts Script Reference

Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Version

Version objects represent individual versions in a draft's version history. Versions are accessed using the versions property of the Draft object.

// loop over versions of a draft, keeping only most recent 3
if (draft.versions.length > 3) {
  let versions = draft.versions.slice(3);
  for (let version of versions) {
    version.delete();
  }
}

Hierarchy

  • Version

Index

Properties

Methods

Properties

Readonly content

content: string

The content of the draft at the time this version was saved

Readonly createdAt

createdAt: Date

Timestamp for the creation of the version

Optional Readonly draft

draft: Draft

The Draft object related to the version. Typically not needed, as versions are accessed through the versions property of a draft.

Readonly uuid

uuid: string

Unique identifier of this version

Methods

delete

  • delete(): any
  • Delete the version. This is permanent and should be used with caution

    Returns any

Generated using TypeDoc