Skip to content

List queries now return metadata with pagination options

Choose a tag to compare

released this 29 Nov 19:53
· 23 commits to working since this release

This release updates list query behavior to include metadata and adds pagination controls. It also adjusts method signatures to support these capabilities and limits CI tests to push events.

Breaking Changes

  • all() now returns an AllOperationResult instead of a plain array, containing { items, metadata }. Consumers must read result.items instead of using the array directly (src/ops/all.ts; tests updated to assert metadata) (commit 1109e99).
  • PItemAPI.all signature extended to accept locations and allOptions (AllOptions). Calls that previously passed only query should update to the new signature as needed (src/PItemAPI.ts; tests updated to expect ({}, [], undefined)) (commit 1109e99).

New Features & Improvements

  • Return metadata for list queries and add pagination options. all() accepts AllOptions and will override limit and offset query params when provided (src/ops/all.ts) (commit 1109e99).
  • Enhance logging for list queries to include allOptions and returned metadata (src/ops/all.ts) (commit 1109e99).
  • Update one() to read from AllOperationResult, process result.items, and return the first item; remove the forced params.limit = '1' (src/ops/one.ts) (commit 1109e99).

Testing Improvements

  • Update tests to mock and assert the AllOperationResult shape for list queries, including metadata checks and the new PItemAPI.all call signature (tests/AItemAPI.test.ts, tests/PItemAPI.test.ts) (commit 1109e99).

Dependency Updates

  • Bump @fjell/* packages: core to 4.4.64, http-api to 4.4.54, logging to 4.4.59, registry to 4.4.70; devDependency @fjell/common-config to 1.1.31 (package.json) (commit 1109e99).

CI/Workflow

  • Limit CI test workflow to push events only; remove pull_request trigger for main. Push triggers retained for main, working, and feature/** (/.github/workflows/test.yml) (commit 24818f2).