@veloxts/core 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @veloxts/core
2
2
 
3
+ ## 0.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - bump dependencies across packages (April 2026)
8
+
9
+ ## 0.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - merge URL params into POST input for flat .rest() paths
14
+
3
15
  ## 0.8.1
4
16
 
5
17
  ### Patch Changes
@@ -303,6 +315,7 @@
303
315
  - ### feat(auth): Unified Adapter-Only Architecture
304
316
 
305
317
  **New Features:**
318
+
306
319
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
307
320
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
308
321
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -310,20 +323,24 @@
310
323
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
311
324
 
312
325
  **Architecture Changes:**
326
+
313
327
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
314
328
  - Single code path for authentication (no more dual native/adapter modes)
315
329
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
316
330
 
317
331
  **Breaking Changes:**
332
+
318
333
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
319
334
  - Remove deprecated `session` field from `AuthConfig`
320
335
  - `User` interface no longer has index signature (extend via declaration merging)
321
336
 
322
337
  **Type Safety Improvements:**
338
+
323
339
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
324
340
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
325
341
 
326
342
  **Migration:**
343
+
327
344
  - Existing `authPlugin` usage remains backward-compatible
328
345
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
329
346
 
@@ -338,10 +355,12 @@
338
355
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
339
356
 
340
357
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
358
+
341
359
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
342
360
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
343
361
 
344
362
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
363
+
345
364
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
346
365
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
347
366
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -349,17 +368,20 @@
349
368
  - Fix jwtManager singleton pattern in templates
350
369
 
351
370
  ### Phase 3: Router Helpers (`@veloxts/router`)
371
+
352
372
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
353
373
  - Add `toRouter()` for router-only use cases
354
374
  - Update all router templates to use `createRouter()`
355
375
 
356
376
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
377
+
357
378
  - Add `NarrowingGuard` interface with phantom `_narrows` type
358
379
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
359
380
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
360
381
  - Enables `ctx.user` to be non-null after guard passes
361
382
 
362
383
  ### Phase 5: Documentation (`@veloxts/router`)
384
+
363
385
  - Document `.rest()` override patterns
364
386
  - Document `createRouter()` helper usage
365
387
  - Document `guardNarrow()` experimental API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/core",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Fastify wrapper and plugin system for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "fastify": "5.8.2",
32
+ "fastify": "5.8.5",
33
33
  "fastify-plugin": "5.1.0",
34
34
  "picocolors": "1.1.1"
35
35
  },
@@ -42,11 +42,11 @@
42
42
  }
43
43
  },
44
44
  "devDependencies": {
45
- "@fastify/static": "9.0.0",
46
- "@types/node": "25.5.0",
47
- "@vitest/coverage-v8": "4.1.0",
45
+ "@fastify/static": "9.1.3",
46
+ "@types/node": "25.6.0",
47
+ "@vitest/coverage-v8": "4.1.5",
48
48
  "typescript": "5.9.3",
49
- "vitest": "4.1.0"
49
+ "vitest": "4.1.5"
50
50
  },
51
51
  "keywords": [
52
52
  "velox",