Skip to content

Opt-in pagination for find operations; findOne handles new result shape

Choose a tag to compare

released this 30 Nov 00:23
· 24 commits to working since this release

This release introduces opt-in pagination support for find operations and updates findOne to work with both the new paginated result shape and legacy array returns. It also includes dependency updates and versioning adjustments.

New Features

  • Add opt-in pagination support to find operations (commit 8fa6cb2)
    • find now accepts an additional findOptions parameter and forwards it to user-defined finder functions.
    • Finders may now return a FindOperationResult with items and metadata, in addition to the legacy V[] array.

Improvements

  • Adapt findOne to new result shape (commit 8fa6cb2)
    • findOne now calls the finder with { limit: 1 } and extracts the first item.
    • Supports both the new FindOperationResult { items, metadata } and legacy array results, returning the first item or null.
  • Type compatibility improvements for user finders (commit 8fa6cb2)
    • Internal type assertions are used when invoking user finders to accommodate potentially stale FinderMethod typing.

Dependency Updates

  • Bump Fjell package versions in package.json (commit 96a36bf)
    • @fjell/core to ^4.4.65
    • @fjell/lib to ^4.4.74
    • @fjell/registry to ^4.4.71

Versioning

  • Set package version to 4.4.14 in package.json (commit 03227e2)

Upgrade notes

  • Existing custom finders that return arrays will continue to work without changes.
  • To use pagination, update custom finders to accept the new findOptions argument and optionally return FindOperationResult with items and metadata.