Skip to content

Client API v4.4.32 — Affected‑items API, allAction simplification, dependency and CI updates

Choose a tag to compare

released this 04 Sep 04:49
· 49 commits to working since this release

This release (4.4.32) packages several coordinated changes: formalizing the "affected items" return shape in the client API, simplifying the allAction/getAllAction operation surface by removing an Express-specific empty-object workaround, updating runtime and linting dependencies to recent patch versions, adjusting test and build tooling (ESM build/test settings and Node polyfills), and simplifying the npm publish workflow. The changes include type and documentation updates, unit test adjustments, lockfile normalizations, and CI/workflow simplification that affect how packages are published and how client code handles action results.

New Features

  • Affected‑items tuple return in Client API
    • Client API types and docs now document and support action/allAction returning a tuple [primaryResult, affectedItems].
    • Type changes applied to: src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts and operation modules so the second tuple element can be an array of primary keys, composite keys, or location-key arrays (LocKeyArray). This surfaces items indirectly affected by operations to callers.
    • Public documentation updated (docs/public/api-reference.md) with examples and guidance for processing affected items.
    • Tests updated to assert the new tuple-based return shape where previously a single-value return was assumed.

Improvements

  • Simplified allAction/getAllAction API surface

    • The allAction factory signature was simplified by removing redundant outer parameters and declaring the expected parameters directly where used.
    • Response handling in src/ops/allAction.ts now destructures the returned tuple directly into [items, affectedItems] rather than performing a special-case conversion or maintaining an intermediate processedResponse value.
    • The explicit Express empty-object ("{}") workaround and related warning logging were removed. The code now relies on server responses being normalized to the expected tuple/array shapes.
    • Unit tests in tests/ops/allAction.test.ts were updated to match the simplified behavior and to remove expectations around conversion of {} or "{}" into [[], []].
  • Dependency and dev tooling updates

    • Runtime dependency bumps in package.json to patched versions:
      • @fjell/core: ^4.4.41
      • @fjell/http-api: ^4.4.38
      • @fjell/logging: ^4.4.46
      • @fjell/registry: ^4.4.36
    • ESLint/JS tooling additions and bumps: @eslint/eslintrc ^3.3.1 and @eslint/js ^9.33.0; @fjell/eslint-config bumped to ^1.1.24.
    • package-lock.json normalized to reflect these bumps and to ensure deterministic install metadata (tarball URLs, integrity checksums, consistent node_modules blocks).
  • ESM output and test environment improvements

    • Build/test configuration updated to ESM-style outputs and stricter TypeScript settings: module/exports mapping, emit source maps, declaration generation, outDir set to dist, target ES2022, and other compiler simplifications.
    • Test environment changes (vitest) provide Node-friendly polyfills for fetch/FormData/Blob/File using undici and node:buffer so tests run under Node without jsdom.
    • Dev dependency adjustments for tests: replacement of some devDeps, addition of undici and vitest-fetch-mock, and removal of large global logging mocks in tests/setup.ts; vitest config simplified and formatted consistently.

Bug Fixes and Stabilization

  • esbuild version conflict resolved for docs build

    • esbuild pinned to exact version 0.25.9 and npm overrides added where relevant to force consistent esbuild across packages.
    • GitHub Actions changes now prefer npm ci for reproducible installs in CI.
  • Lockfile normalization

    • package-lock.json entries were updated to align resolved versions and integrity values for multiple packages, reducing nondeterminism during installs.

Refactoring and Code Cleanup

  • allAction code cleanup

    • Removed processing indirection and extra logging; simplified function signature and internal destructuring for clearer logic and fewer special cases.
    • A file-level ESLint exception (/* eslint-disable no-undefined */) was added to allow explicit undefined usage where needed.
  • Type and docs updates to support new return shapes

    • Type signatures across operation modules and public client entry points were updated to reflect the affected-items tuple.
    • Documentation (API reference) revised to show the new tuple return shape and to provide examples and guidance for consumers.

CI / Workflow Changes

  • npm publish workflow simplified
    • The separate build job was removed from .github/workflows/npm-publish.yml. Steps that previously ran checkout, setup-node (node 22), npm ci, lint, build, test, and Codecov upload were deleted.
    • The publish-npm job was decoupled from needs: build and now runs without waiting on a separate build job; it runs on ubuntu-latest and begins with actions/checkout@v4.
    • Rationale: the publish workflow no longer requires a dedicated build/test step within this workflow; publishing is now simpler and does not block on the removed build job. (Note: this affects the CI gating previously provided by the build job — consumers/maintainers should confirm alternative CI coverage exists if needed.)

Documentation Updates

  • API reference and examples updated

    • docs/public/api-reference.md updated to document the affected-items feature: change signatures, examples, and guidance for action/allAction and location-aware variants.
  • Minor formatting and EOF normalizations

    • package.json files across changes were normalized for trailing newline consistency and version entry formatting.

Testing Improvements

  • Tests updated to reflect API and behavior changes
    • tests/ops/allAction.test.ts updated to remove assertions tied to the removed Express empty-object workaround and to assert direct tuple handling.
    • Other tests that relied on previous single-value returns were adjusted to expect the new [primaryResult, affectedItems] tuple.

Breaking Changes and Migration Notes

  • API return shape: action/allAction now use a tuple return in types and docs

    • Consumers that previously expected a single return value from action or allAction should update call sites and type annotations to handle [primaryResult, affectedItems]. Review any code that destructured or assumed a single value.
  • Removed Express empty-object workaround in allAction

    • If any client code depended on the previous special-case conversion of empty-object responses into [[], []], those behaviors are no longer provided. The client now relies on upstream servers returning the expected tuple/array shapes. Tests that simulated the old behavior should be updated accordingly.
  • CI change: publish workflow no longer runs the prior build/test/codecov steps

    • Publishing is no longer gated by the removed build job inside the npm-publish workflow. If CI gating (build/test) is required prior to publishing, ensure it is provided by a separate workflow or prior job.

Developer Experience

  • Local/test setup

    • Test environment now includes Node fetch/FormData/Blob/File polyfills via undici which removes reliance on jsdom for many tests; vitest configuration simplified for better ESM support.
    • package-lock.json and package.json normalizations improve deterministic installs across environments.
  • Linting and tooling

    • ESLint tooling updated and normalized; new @eslint packages added to align with the current linting setup and to avoid mismatches in tooling.

Release housekeeping

  • Versioning
    • The package version was finalized to 4.4.32 in package.json for this release. Several intermediate development bumps (dev.0) and prior patch releases are present in the history and have been consolidated into this release.

Files and components affected (high level)

  • Source

    • src/ops/allAction.ts (API/behavior simplification, ESLint exception)
    • src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts (type updates for tuple return)
    • src/ops/action.ts (type/signature adjustments)
  • Tests

    • tests/ops/allAction.test.ts and other tests updated for tuple returns and removed Express edge-case expectations
    • tests/setup.ts (Node polyfills and test environment adjustments)
  • Build & config

    • package.json (version, dependencies, devDependencies, formatting normalization)
    • package-lock.json (normalized resolved/integrity metadata)
    • .github/workflows/npm-publish.yml (removed build job, simplified publish job)
    • vitest.config.ts, tsconfig.json (ESM/test/build adjustments)
    • docs/public/api-reference.md (documentation for affected-items tuple)

Notes and recommended actions for consumers

  • Update code that calls action/allAction to support the [result, affectedItems] tuple. Inspect type annotations and unit tests for affected call sites.
  • If CI relied on the removed build job in .github/workflows/npm-publish.yml to prevent bad publishes, ensure an equivalent build/test workflow runs before publish (outside this workflow) to preserve release safety.
  • After pulling this release, run npm ci to pick up the normalized lockfile entries and ensure reproducible installs.
  • Review tests that previously mocked or relied on the Express-specific empty-object behavior; adjust mocks to return the normalized tuple shapes expected by the updated client.

If additional migration help is needed (for example, quick code snippets showing how to destructure the new tuple return from an action/allAction call), include a request and examples can be provided.