hayson-binding-shared 0.21.0

Shared error mapping, JSON shapes, options and predicate parsing for hayson's NAPI and WASM language bindings
Documentation
# Changelog

All notable changes to `hayson-binding-shared` are documented here. Format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## 0.21.0 — 2026-10-16

- `aggregate::parse_aggregate`, `aggregate_result_to_json` and `grouped_aggregate_result_to_json` carry
  the engine's `Table::aggregate` / `aggregate_grouped` across the bindings.

## 0.20.0 — 2026-10-16

- `parse_convert_options` and `convert_result_to_json` carry `hayson-engine` 0.27.0's
  `convert_encryption` across the bindings. Depends on `hayson-engine` 0.27.0.

## 0.19.0 — 2026-10-16

- Fix: `parse_restore_options` never read `maxImageBytes` (0.18.0 and before), so `restore()` ignored the
  limit the 0.17.0 engine supports; it reads it, and `encryption`, now.

- `parse_open_options` reads `encryption`; `parse_backup_options`, `parse_restore_options`,
  `parse_pack_options` (also per `include` entry), `parse_unpack_options` (plus `includeEncryption`) and
  `parse_verify_options` read it too (`parse_encryption`). `describe_io_error` answers a sealed unit that
  did not open as a `Cipher` envelope. Depends on `hayson-engine` 0.26.0.

## 0.18.0 — 2026-10-15

- `parse_pack_options` reads `include`; `pack_result_to_json` adds `databases`. Depends on
  `hayson-engine` 0.25.0.

## 0.17.0 — 2026-10-15

- `parse_backup_options` and `parse_pack_options` read `excludeTables`; `parse_restore_options` and `parse_unpack_options` read `maxImageBytes`. Depends on `hayson-engine` 0.24.0.

## 0.16.0 — 2026-10-15

- `parse_open_options` reads `passwordHash` (`memoryKiB`, `iterations`, `parallelism`) and
  `password_check_to_json` answers `{ ok, needsRehash }`. Depends on `hayson-engine` 0.23.0.

## 0.15.0 — 2026-10-15

- `parse_open_options` reads `maxImageBytes`; `describe_io_error` answers an `ImageTooLarge`
  envelope (`bytes`, `maxBytes`). Depends on `hayson-engine` 0.22.0.

## 0.14.0 — 2026-10-15

- `describe_io_error` (and every describer that falls back to it) answers `CorruptLog`
  (`path`, `offset`, `reason`) and `ImageClash` (`physicalPath`) envelopes. Depends on
  `hayson-engine` 0.21.0.

## 0.13.0 — 2026-10-15

- `parse_pack_options`, `parse_unpack_options`, `parse_pack_limits_options` and `pack_result_to_json`
  carry `hayson-engine` 0.20.0's `pack_database`, `unpack_database` and `read_pack_entry` across the
  bindings. Depends on `hayson-engine` 0.20.0.

## 0.12.0 — 2026-10-14

- `parse_backup_options`, `parse_restore_options`, `backup_result_to_json` and
  `restore_result_to_json` carry `hayson-engine` 0.19.0's `backup_database` and `restore_database`
  across the bindings. Depends on `hayson-engine` 0.19.0.

## 0.11.0 — 2026-10-13

- `images_to_json` and `image_usage_to_json` carry `hayson-engine` 0.18.0's image blob API across
  the bindings. `parse_verify_options` reads `images` and `maxImageBytes`. Depends on `hayson-engine` 0.18.0.

## 0.10.0 — 2026-10-12

- `parse_verify_options` and `verify_report_to_json` carry `hayson-engine` 0.17.0's `verify()`
  across the bindings. Depends on `hayson-engine` 0.17.0.

## 0.9.0 — 2026-09-28

- `describe_io_error` maps `hayson-engine` 0.13.0's `HaysonLogReplacedError` (boxed in an
  `io::Error`) to the new envelope code `LogReplaced` with `path`. Depends on `hayson-engine` 0.13.0.

## 0.8.0 — 2026-09-22

- `describe_table_error` maps `hayson-engine` 0.12.0's new `TableError::RelationRestrict` to the
  error envelope code `code::RELATION_RESTRICT`, carrying `relation`/`table`/`key`/
  `referencingTable`/`referencingField`/`referencing`.

## 0.7.0 — 2026-09-22

- `describe_table_error` maps `hayson-engine` 0.10.0's new `TableError::Relation` to the error
  envelope code `code::RELATION_VIOLATION`, carrying `relation`/`table`/`field`/`value`.

## 0.6.0 — 2026-09-18

- `errors::describe_migrate_format1_error` and `json::migrate_format1_outcome_to_json` — the error
  envelope and answer shape for `hayson-engine` 0.9.0's `catalog::migrate_format1`, so `hayson-napi`
  and `hayson-wasm` can expose it as `migrateFormat1()`.

## 0.5.0 — 2026-09-11

- `options::parse_migrate_layout_options` and `json::layout_migration_to_json` — the options
  document and the answer of `hayson-engine` 0.7.0's `migrate_layout`, so both bindings carry the
  move across the boundary in the shape the TypeScript `LayoutMigrationOptions` and
  `LayoutMigrationResult` already had.

## 0.4.0 — 2026-09-10

- Follows `hayson-engine` 0.6.0's curated public surface: query types are imported from
  `hayson_engine::query` rather than from `query::planner`, `query::predicates` and
  `registry::fulltext_index`. No behaviour change.

## 0.3.0 — 2026-09-10

- `broken_links_to_json` and `rotation_result_to_json` — JSON envelopes for `hayson-engine`'s new
  `BrokenLink` and rotation-result types, used by both the NAPI and WASM bindings.
- New `keys` module: `CypherKeyring` loads and validates a `{ keys, keyId, keyEncoding,
  onMissingKey }` document from a file or inline JSON (the same shape `open({ cypher })` takes),
  shared by `hayson-cli` and `hayson-server` for startup key configuration. `options::parse_cypher`
  is now `pub` so this module can reuse it without re-parsing the document itself.

## 0.2.0 — 2026-09-10

- **Breaking:** the error envelope's version marker is now `"envelopeVersion"`, not `"hayson"`.
  The envelope is generated fresh per call and consumed immediately by the matching same-release
  TS shim, so no back-compat is needed — both sides of this session's boundary move together.
  See ADR-68rg (cerebro).

## 0.1.0 — initial release

- Error mapping from every `hayson-engine` `DatabaseError`/`TableError` variant onto a stable,
  machine-readable JSON envelope, so a language shim can re-throw the matching typed error.
- JSON conversions for the engine's result types (`HaysonRecord`, `TableStats`,
  `IntegrityReport`, `CompactionResult`, query-plan summaries).
- Parsing of the `open()` options JSON document into the engine's native `OpenOptions`.
- Parsing of the predicate/query JSON document `Table::query` takes, including the operator
  aliases `hayson-server`'s `predicate_json` accepts.
- Shared foundation for the `hayson-napi` (Node native addon) and `hayson-wasm`
  (`wasm32-wasip1`) bindings — neither binding duplicates error, option or predicate handling.