Class: VersionList

VersionList()

Load a version list for the specified environment and module, then interact with it such as adding a new VersionEntry, or grabbing the latest VersionEntry.

Constructor

new VersionList()

Source:

Members

getAndRemoveArchivableVersions

Removes all but the most recent 2 versions from the version list and returns an array of VersionEntrys removed.

Source:

Methods

add(entry, opts) → {VersionList}

Add a new VersionEntry to the VersionList.

Parameters:
Name Type Description
entry VersionEntry
opts
Source:
Returns:
Type
VersionList

find(findFunc) → {VersionEntry}

Return the VersionEntry matching the one specified according to the findFunc param.

Parameters:
Name Type Description
findFunc
Source:
Returns:
Type
VersionEntry

getEnvironment() → {string}

Return the environment the VersionList was loaded for.

Source:
Returns:
Type
string

getModule() → {string}

Return the module the VersionList was loaded for.

Source:
Returns:
Type
string

getVersions() → {Array.<VersionEntry>}

Return the current VersionList (including any modifications made to it).

Source:
Returns:
Type
Array.<VersionEntry>

latest() → {VersionEntry}

Return the latest VersionEntry.

Source:
Returns:
Type
VersionEntry

(async) load() → {Promise.<VersionList>}

Load the remote VersionList from the CDN and return the sorted VersionEntry instances.

Source:
Returns:
Type
Promise.<VersionList>

next(release) → {string}

Return the semver string to be used for the next version.

Parameters:
Name Type Default Description
release minor
Source:
Returns:
Type
string

previous(release) → {string}

Return the semver string for the version directly preceding the latest.

Parameters:
Name Type Default Description
release minor
Source:
Returns:
Type
string

remove(entry)

Remove a VersionEntry of the specified properties from the version list. Supports VersionEntry instances and semver strings.

Parameters:
Name Type Description
entry string | VersionEntry
Source:

toJson()

Convert the VersionList and it's array of VersionEntrys to a serializable object.

Source:

verifyOrNext(targetVersion, allowOverride) → {VersionEntry}

Verify the target VersionEntry is allowed, or return the next best version.

Parameters:
Name Type Description
targetVersion VersionEntry
allowOverride Boolean
Source:
Returns:
Type
VersionEntry