@veloxts/router 0.8.2 → 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 +20 -0
  2. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @veloxts/router
2
2
 
3
+ ## 0.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - bump dependencies across packages (April 2026)
8
+ - Updated dependencies
9
+ - @veloxts/core@0.8.3
10
+ - @veloxts/validation@0.8.3
11
+
3
12
  ## 0.8.2
4
13
 
5
14
  ### Patch Changes
@@ -462,6 +471,7 @@
462
471
  - ### feat(auth): Unified Adapter-Only Architecture
463
472
 
464
473
  **New Features:**
474
+
465
475
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
466
476
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
467
477
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -469,20 +479,24 @@
469
479
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
470
480
 
471
481
  **Architecture Changes:**
482
+
472
483
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
473
484
  - Single code path for authentication (no more dual native/adapter modes)
474
485
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
475
486
 
476
487
  **Breaking Changes:**
488
+
477
489
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
478
490
  - Remove deprecated `session` field from `AuthConfig`
479
491
  - `User` interface no longer has index signature (extend via declaration merging)
480
492
 
481
493
  **Type Safety Improvements:**
494
+
482
495
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
483
496
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
484
497
 
485
498
  **Migration:**
499
+
486
500
  - Existing `authPlugin` usage remains backward-compatible
487
501
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
488
502
 
@@ -501,10 +515,12 @@
501
515
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
502
516
 
503
517
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
518
+
504
519
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
505
520
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
506
521
 
507
522
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
523
+
508
524
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
509
525
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
510
526
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -512,17 +528,20 @@
512
528
  - Fix jwtManager singleton pattern in templates
513
529
 
514
530
  ### Phase 3: Router Helpers (`@veloxts/router`)
531
+
515
532
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
516
533
  - Add `toRouter()` for router-only use cases
517
534
  - Update all router templates to use `createRouter()`
518
535
 
519
536
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
537
+
520
538
  - Add `NarrowingGuard` interface with phantom `_narrows` type
521
539
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
522
540
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
523
541
  - Enables `ctx.user` to be non-null after guard passes
524
542
 
525
543
  ### Phase 5: Documentation (`@veloxts/router`)
544
+
526
545
  - Document `.rest()` override patterns
527
546
  - Document `createRouter()` helper usage
528
547
  - Document `guardNarrow()` experimental API
@@ -1447,6 +1466,7 @@
1447
1466
  ### Patch Changes
1448
1467
 
1449
1468
  - Fix Prisma client generation in scaffolder
1469
+
1450
1470
  - Added automatic Prisma client generation after dependency installation in create-velox-app
1451
1471
  - Fixed database template to validate DATABASE_URL environment variable
1452
1472
  - Added alpha release warning to all package READMEs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/router",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Procedure definitions with tRPC and REST routing for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,17 +37,17 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@trpc/server": "11.12.0",
41
- "fastify": "5.8.2",
42
- "@veloxts/core": "0.8.2",
43
- "@veloxts/validation": "0.8.2"
40
+ "@trpc/server": "11.16.0",
41
+ "fastify": "5.8.5",
42
+ "@veloxts/core": "0.8.3",
43
+ "@veloxts/validation": "0.8.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@vitest/coverage-v8": "4.1.0",
47
- "esbuild": "0.27.4",
46
+ "@vitest/coverage-v8": "4.1.5",
47
+ "esbuild": "0.28.0",
48
48
  "typescript": "5.9.3",
49
- "vite": "7.3.1",
50
- "vitest": "4.1.0",
49
+ "vite": "7.3.2",
50
+ "vitest": "4.1.5",
51
51
  "zod": "4.3.6"
52
52
  },
53
53
  "peerDependencies": {