# Changelog

## [11.0.1] - 2026-05-21

### 📚 Documentation

- Rewrote JSDoc on `DataSet`, `DataSetSetting`, `defineDataSet`, and the helpers to follow the new value-test guidance: dropped restate-the-type narration, kept intent / trade-offs / constraints around authorization, validation, and the lifecycle hooks.

### ⬆️ Dependencies

- Bump dev `vitest` to `^4.1.5`.
- Bumped `vitest` to `^4.1.7`. No source changes — dev-tooling bump only.

## [11.0.0] - 2026-04-25

### 💥 Breaking Changes

The `Repository` class is gone — DataSets are now first-class DI tokens. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for rationale, recipes, and pitfalls.

- Removed `Repository`, `getRepository(injector)`, `Repository.createDataSet(Model, 'pk', settings)`. Declare DataSets with `defineDataSet({ name, store, settings? })` at module scope; the returned `DataSetToken<T, PK>` resolves a configured `DataSet`.
- `getDataSetFor(injector, DataSetToken)` now takes a single token argument. The old `(injector, Model, 'pk')` overload is gone.
- Every consumer that used to take `{ model, primaryKey }` (endpoint generators, `registerModel`, etc.) now takes a `DataSetToken` directly.

## [10.1.11] - 2026-04-17

### ⬆️ Dependencies

- Raised `typescript` to ^6.0.3 and `vitest` to ^4.1.4 so package builds and tests track the workspace toolchain.

## [10.1.10] - 2026-03-27

### ⬆️ Dependencies

- Updated `vitest` to ^4.1.2

## [10.1.9] - 2026-03-25

### 📦 Build

- Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility

### ⬆️ Dependencies

- Upgraded `typescript` from ^5.9.3 to ^6.0.2
- Upgraded `vitest` from ^4.1.0 to ^4.1.1

## [10.1.8] - 2026-03-19

### ⬆️ Dependencies

- Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
- Upgraded `vitest` from ^4.0.18 to ^4.1.0
- Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
- Updated `@furystack/core` dependency to the latest major version.

## [10.1.7] - 2026-03-10

### ⬆️ Dependencies

- Updated `@furystack/core` dependency to the new major version

## [10.1.6] - 2026-03-07

### ⬆️ Dependencies

- Updated internal FuryStack dependencies

## [10.1.5] - 2026-03-06

### ⬆️ Dependencies

- Updated internal FuryStack dependencies

## [10.1.4] - 2026-03-03

### 🔧 Changed

- Added `onListenerError` to `DataSet` event map for consistent EventHub listener error handling across all stores

## [10.1.3] - 2026-02-26

### ⬆️ Dependencies

- Updated internal `@furystack/*` dependencies
- Bumped due to updated workspace dependencies

## [10.1.2] - 2026-02-26

### ⬆️ Dependencies

- Updated `@furystack/core` dependency

## [10.1.1] - 2026-02-22

### ⬆️ Dependencies

- Updated `@furystack/core` dependency

## [10.1.0] - 2026-02-20

### ✨ Features

### Bulk Remove in DataSet

`DataSet.remove()` now accepts multiple primary keys via rest parameters, allowing removal of several entities in a single call. Authorization checks run against all entities before any are deleted (all-or-nothing), and an `onEntityRemoved` event is emitted for each removed entity.

**Usage:**

```typescript
// Before - remove one at a time
await dataSet.remove(injector, key1)
await dataSet.remove(injector, key2)

// After - remove multiple at once
await dataSet.remove(injector, key1, key2, key3)
```

### 🐛 Bug Fixes

- Fixed `DataSet.get()` to fetch the full entity before running `authorizeGetEntity`, then applying field selection afterward. Previously, the entity passed to the authorization callback could have missing fields when `select` was provided.

### ♻️ Refactoring

- `DataSet.get()` return type is now properly generic as `PartialResult<T, TSelect>`, improving type inference for callers that pass a `select` parameter

### 🧪 Tests

- Added tests for bulk removal: removing multiple entities, event emission per key, per-entity authorization, and all-or-nothing rollback when authorization fails

## [10.0.37] - 2026-02-19

### 📚 Documentation

- Expanded JSDoc on `DataSet` class to explain its role as the authorized write gateway with event dispatching
- Expanded JSDoc on `add()`, `update()`, and `remove()` to document authorization checks, hooks, and emitted events
- Expanded JSDoc on `getDataSetFor()` with usage examples for server-side writes using `useSystemIdentityContext`
- Added README section covering server-side writes with the elevated `IdentityContext`, including a warning about bypassing the DataSet layer

### ⬆️ Dependencies

- Updated `@furystack/core`

## [10.0.36] - 2026-02-11

### ⬆️ Dependencies

- Bump `vitest` from `^4.0.17` to `^4.0.18`
- Updated internal dependencies

## [10.0.35] - 2026-02-09

### ⬆️ Dependencies

- Updated `@furystack/core` dependency
- Updated `@furystack/*` dependencies

## [10.0.34] - 2026-01-26

### 🔧 Chores

- Standardized author format, improved keywords, removed obsolete `gitHead`, added `engines` (Node 22+) and `sideEffects: false`

## [10.0.33] - 2026-01-26

### ⬆️ Dependencies

- Updated `@furystack/inject` with fix for singleton injector reference being overwritten by child injectors

## [10.0.32] - 2026-01-22

### ⬆️ Dependencies

- Dependency updates

### 📚 Documentation

- Improved README with clearer examples and better structure

### 🔧 Chores

- Migrated to centralized changelog management system
