Versions

envless.versions.listAllEntries()

Collect every version entry for rotation

ts
listAllEntries(project: string, environment: string, options?: ScopedListOptions): Promise<Array<VersionEntryResource>>

Walks every page and resolves one array holding every version entry in the environment. This is the shape a rotation wants: decrypt each value and defaultValue with the old key, re-encrypt with the new one, then write the results back in batches through reencryptEntries.

It holds the entire encrypted history of the environment in memory at once, and the server rebuilds that history on every request, so prefer iterateEntries on a large environment. options.limit only sets the page size used while walking, clamped to 100, it does not cap how many entries come back.

rotateWorkspacePassphrase from the package root already does this walk plus the re-encryption and the batched write back for both live variables and history, so call this directly only when you need a custom rotation.

Example

ts
const entries = await envless.versions.listAllEntries('api', 'production', { product: 'billing' })

console.log(entries.filter((entry) => entry.value).length)

Parameters

ParameterTypeRequiredDescription
projectstringYesProject slug or project uniqueId.
environmentstringYesEnvironment slug, since an environment uniqueId will not resolve here.
options.productstringNoProduct slug used to disambiguate a project slug shared across products.
options.limitnumberNoPage size used while walking, clamped to 100.
options.offsetnumberNoRow to start the walk from.
options.signalAbortSignalNoCancels every request in the walk.

Returns

Array<VersionEntryResource> holding every entry across every version of the environment.

Reads the entries collection. list returns one page as { items, pagination }, listAll collects every page into an array, and iterate streams one item at a time without buffering the whole set.

Worth knowing

  • Entries with a null value do occur. Skip them instead of feeding them to a decrypt call.
  • Split the array into batches of at most 200 before writing it back, since a longer entries array is rejected with 400.

Required scopes

versions:read and variables:read

Underlying endpoint

GET /projects/{slug}/environments/{environmentSlug}/versions/entries

Request and response schema, every error code, and a live playground.

In Python

envless.versions.list_all_entries()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.versions.list_all_entries

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->versions->listAllEntries()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.