Skip to content

chore(release): version packages - #61

Merged
klnap merged 1 commit into
mainfrom
changeset-release/main
Dec 6, 2026
Merged

klnap merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@klnap/cache-invalidation@0.5.0

Minor Changes

  • f328658: Framework-agnostic, multi-target cache invalidation.

    New

    • Webhook ingress with three explicit modes: { secret }, { secret, decode } and { adapter }. A decoder converts a Standard Webhooks payload that is not CloudEvents; an adapter owns authentication and normalization for any other protocol, such as Sanity or Contentful. Decoder and adapter output is validated as untrusted data and bounded by maxEvents, maxNormalizedBytes and adapterTimeoutMs. The README includes complete Contentful and Sanity adapters, tested against signatures from the providers' official SDKs.
    • @klnap/cache-invalidation/consumers with createCacheConsumer(): schemas, rules and application-owned executors with no HTTP, Payload or Next.js dependency, and direct consume(events).
    • createNextCacheConsumer() for direct Next.js consumption. The Route Handler is now the same consumer behind the shared receiver.
    • Webhook dispatcher targets accept a synchronous event predicate. A predicate that throws or returns a non-boolean fails that target (FILTER_FAILED) instead of skipping it.
    • Payload: a webhooks configuration builds the native dispatcher; collections: true and globals: true select models explicitly; exclude removes models from every path; per-target filter: { collections, globals } routes by model, including media events through their affected models; functional filters cover models shared by several sites; media: false turns dependency handling off.
    • CacheForbiddenError is exported. consume() throws it for a disallowed event source.

    Breaking (pre-1.0)

    • The entrypoints /dispatchers, /dispatchers/http and /consumers/http are replaced by /webhooks. http() is now createWebhookDispatcher(), and the Http* types are Webhook*.
    • createCacheInvalidationHandler({ cache }) replaces { config: cache.config }. defineCache() no longer returns a config property, and DefineCacheInput is now CacheConfig.
    • Payload hooks is removed, and setting it throws. All lifecycle hooks are installed; use filter to ignore operations.
    • excludeFields lists combine across the plugin, central, local and media levels instead of the local list replacing the others.
    • resolveExcludeFields and readCacheInvalidationExcludeFields are removed from the Payload entrypoint.
    • Payload requires exactly one of webhooks and dispatcher when enabled.
    • Payload log lines no longer contain exception messages. They record the error class and, when present, a short machine code, and dispatcher failures are logged by code. Alerts that match message text must match the class or code instead.

    Fixes

    • Library-owned logging and error responses no longer expose exception messages, so values echoed by Payload, database drivers or application hooks cannot reach them.
    • A consumer now applies its own maxEvents and maxNormalizedBytes to every batch, including batches received from a native webhook; the stricter of the handler's and the consumer's limits wins.
    • De-duplication treated Uint8Array([1]) and { "0": 1 } as the same data, and comparing duplicate events with very deep data could exhaust the stack.
    • Centrally enabled globals were not discovered as media dependents.
    • A globally excluded or explicitly disabled media collection could re-enable itself through media dependency handling, and discovery re-read local custom independently of the resolved configuration.
    • Media locale resolution hard-coded the collection slug media.
    • The documented Contentful and Sanity adapters decode the body with ignoreBOM: true, so a leading byte order mark cannot make different bytes verify as the signed text, and the Contentful adapter reads the signed-header list exactly as the SDK does. The library's native receiver verifies raw bytes and was not affected.

@klnap
klnap merged commit 55caff3 into main Dec 6, 2026
4 checks passed
@klnap
klnap deleted the changeset-release/main branch December 6, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant