## 0.12.12

### Patch Changes

- 0d7b2a3: `CorePikkuFetchOptions` now takes an optional `fetch`, used in place of the global one for every request the client makes, including the SSE stream.

  The global is the only transport a client could use, which is a problem anywhere the useful transport is not a network call. A Cloudflare Worker rendering server-side reaches a sibling Worker through a binding, not through its own public hostname — fetching the latter leaves the isolate, re-enters the edge and fails the TLS handshake. The alternative was to swap `globalThis.fetch` around a call, which is unsound in a Worker because concurrent requests share the global. Passing the implementation per client keeps it where the caller already scopes everything else.

## 0.12.11

### Patch Changes

- 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
  package manager each package's `prepublishOnly` and build scripts invoke, plus
  the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
  declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
  its `uWebSockets.js` peer optional so a bun install of a consumer that brings
  its own uWS app does not try to fetch it from the registry.

  Three published behaviours change, all of them cases where an isolated
  `node_modules` or bun as the runtime had been papered over by yarn's hoisting:

  - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
    through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
    which silently turned every `ON DELETE CASCADE` into a no-op under
    `bunx --bun pikku`.
  - `@pikku/cli` resolves a deploy provider against the project being deployed
    rather than against wherever the CLI itself is installed, which is what its
    own "is not installed" error asks the user to arrange.
  - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
    for the modules it implements itself — as not resolved from the project, so
    it falls back rather than loading the runtime's own copy.

## 0.12.10

### Patch Changes

- 88629af: Only revive a response string as a `Date` when it is an unambiguous ISO-8601 instant — a date, a time, and an explicit zone (`Z` or `±HH:MM`), with fractional seconds optional.

  The previous pattern was unanchored and its time portion optional, so any string merely _beginning_ `YYYY-MM-DD` was replaced. An id like `2026-03-14-invoice-7` or a log line starting with a timestamp became an `Invalid Date`, which then threw wherever the app treated it as the `string` the generated client had typed it as. A field the server declares `z.string()` and sends as `2026-03-14` arrived as a `Date` while the SDK still said `string`, so the transport contradicted the types TypeScript was checking against.

  Requiring the zone closes the other half of it. `2026-03-14` and `2026-03-14T08:12:00` name a day or a wall-clock reading, not a moment, and `new Date` resolves the first as UTC midnight and the second in whatever timezone the client sits in — the same payload decoding to different instants on different machines, with nothing in the types to say so. Both now stay strings, exactly as sent. A string whose shape is right but whose value is not a real time (`2026-02-31T00:00:00Z`) is left alone too, rather than becoming an `Invalid Date`.

  **Behaviour change:** code that relied on a bare `YYYY-MM-DD` or a zoneless date-time being revived now receives the string. Either send a zone from the server, or parse the string where you need a `Date`. Instants that already carried a zone are unaffected.

## 0.12.9

### Patch Changes

- fd9d834: Stop publishing internals that only their own package or file used. The declarations stay; only the entrypoint re-export is removed, so nothing that imported a name from where it is declared is affected.

## 0.12.8

### Patch Changes

- 4b02d73: Decode error responses into a typed `PikkuFetchError` instead of throwing the raw `Response`. `CorePikkuFetch.api`/`uploadFile` now throw a real `Error` carrying the server's `message` and `name` plus `status`/`response`, so `mutation.error.message` shows the actual failure rather than `[object Response]`. `PikkuFetchError` is exported for `instanceof`/status checks.

## 0.12.7

### Patch Changes

- daec082: Drop Node 22 support — the minimum supported runtime is now Node 24 (LTS).

  Node 22 deadlocks `pikku dev` at `loadUserBootstrap` (tsx `register()` + `require(esm)` cycle handling on node 22.12+), and Node 20 is already below our floor. The `engines.node` requirement is raised to `>=24` across all packages, matching `.nvmrc` and the CI test matrix. Closes #751.

## 0.12.6

### Patch Changes

- 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.

  All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.

## 0.12.5

### Patch Changes

- 6f06813: Add `CorePikkuFetch.setHeader(name, value)` to set or clear an arbitrary request header (passing `null` removes it). Enables per-client headers such as admin impersonation (`x-pikku-impersonate-user-id`) without subclassing the fetch client.

## 0.12.4

### Patch Changes

- ade6f0b: `subscribeToSSE`: call `onError` when the stream closes cleanly without the caller having called `close()`. Previously a server-side connection drop (or any clean EOF before the terminal event) exited the read loop silently, leaving the caller's `runPhase` stuck at `'running'` indefinitely with no way to recover.

## 0.12.3

### Patch Changes

- 409ec80: feat(console): Tests page with live SSE streaming and function test harness
  - `@pikku/addon-console`: add `streamFunctionTests` SSE function that runs the
    cucumber/c8 test harness and streams structured per-scenario events
    (scenario-start, step, scenario-done, done)
  - `@pikku/console`: TestsPage live run view — renders scenario names and step
    status in real time during a test run via SSE; adds `usePikkuSSE` hook and
    `showRunButton` prop
  - `@pikku/fetch`: add `subscribePikkuSSE` helper for typed server-sent event
    streams
  - `@pikku/cli`: wire SSE-returning functions through the console serialiser and
    RPC wrapper so the stream route is included in generated clients

## 0.12.2

### Patch Changes

- 9060165: New realtime events system: `pikku realtime` generates a typed `PikkuRealtime` client that pairs with `PikkuRPC`. A `/events` channel can be scaffolded to fan out server events to subscribers over SSE. `pikku dev` wires `LocalEventHubService` automatically so realtime works out of the box locally. The React provider exposes `PikkuRealtime` alongside `PikkuRPC`.
- 9060165: Fix `@pikku/addon-graph` package exports so generated bootstrap files can be imported correctly. The Node.js HTTP server adapter is unified across dev, standalone, and container deployments. Next.js gains a worker-RPC transport. Date values in fetch responses now deserialise correctly.

## 0.12.0

## 0.12.1

### Patch Changes

- 3fbd05c: Encode URI path parameters with encodeURIComponent to prevent path injection via user-supplied data values.

### New Features

- Auto-remove `Content-Type` header for bodyless requests (GET/DELETE)

## 0.11.0

## 0.11.1

### Patch Changes

- ce902b1: fix: method in core pikku fetch should be any to avoid typescript issues

### Minor Changes

- Workflow support

# @pikku/fetch

## 0.10.0

This release includes significant improvements across the framework including tree-shaking support, middleware/permission factories, enhanced CLI functionality, improved TypeScript type safety, and comprehensive test strategies.

For complete details, see https://pikku.dev/changelogs/0_10_0.md

## 0.9.2

### Patch Changes

- a5905a9: chore: updating all dependencies

## 0.9.1

### Patch Changes

- fdb1593: core: bumping everything with a patch to sync up the major release inconsistencies in dependencies

## 0.9.0

### Breaking Changes

- Normalized all transports to use "wirings" instead of events/routes/transports for consistency across the framework

## 0.8.0

- Updating to match remaining packages

## 0.7.0

- Updating to match remaining packages

## 0.6.2

### Patch Changes

- 3062086: fix: renaming AbstractFetch/Websocket to core

## 0.6.1

### Patch Changes

- 2bc64fd: feat: adding methods to fetch wrapper (and small fixes)
- a40a508: fix: Fixing some generation bugs and other minors

## 0.6

Marking a major release to include channels and scheduled tasks

## 0.5.8

### Patch Changes

- 886a2fb: refactor: moving singletons (like routes and channels) to global to avoid nodemodule overrides

## 0.5.7

### Patch Changes

- 0f96787: refactor: dropping cjs support
- c23524a: refactor: bump to versions to ensure correct package usage

## 0.5.6

### Patch Changes

- bba25cc: chore: updating all packages to reflect major changes

## 0.5.5

### Patch Changes

- 35d1a49: fix: server url shouldn't with a /, bug with //

## 0.5.4

### Patch Changes

- 78a17e8: fix: avoid // when concatenating serverUrl and uri

## 0.5.3

### Patch Changes

- effbb4c: doc: adding readme to all packages

## 0.5.2

### Patch Changes

- 725723d: docs: adding typedocs

## 0.5.1

### Patch Changes

- b237ace: fix: fixing bugs in fetch
