@veloxts/web 0.8.3 → 0.9.0
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.
- package/CHANGELOG.md +17 -10
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @veloxts/web
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- feat(router): add raw() response primitive for redirects, cookies, custom headers and .check() post-middleware authorization primitive
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [e1c32a2]
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- Updated dependencies [ca6ede3]
|
|
14
|
+
- Updated dependencies [83c5da1]
|
|
15
|
+
- @veloxts/router@0.9.0
|
|
16
|
+
- @veloxts/auth@0.9.0
|
|
17
|
+
- @veloxts/client@0.9.0
|
|
18
|
+
- @veloxts/core@0.9.0
|
|
19
|
+
|
|
3
20
|
## 0.8.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -571,7 +588,6 @@
|
|
|
571
588
|
- ### feat(auth): Unified Adapter-Only Architecture
|
|
572
589
|
|
|
573
590
|
**New Features:**
|
|
574
|
-
|
|
575
591
|
- Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
|
|
576
592
|
- Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
|
|
577
593
|
- Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
|
|
@@ -579,24 +595,20 @@
|
|
|
579
595
|
- Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
|
|
580
596
|
|
|
581
597
|
**Architecture Changes:**
|
|
582
|
-
|
|
583
598
|
- `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
|
|
584
599
|
- Single code path for authentication (no more dual native/adapter modes)
|
|
585
600
|
- `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
|
|
586
601
|
|
|
587
602
|
**Breaking Changes:**
|
|
588
|
-
|
|
589
603
|
- Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
|
|
590
604
|
- Remove deprecated `session` field from `AuthConfig`
|
|
591
605
|
- `User` interface no longer has index signature (extend via declaration merging)
|
|
592
606
|
|
|
593
607
|
**Type Safety Improvements:**
|
|
594
|
-
|
|
595
608
|
- `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
|
|
596
609
|
- Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
|
|
597
610
|
|
|
598
611
|
**Migration:**
|
|
599
|
-
|
|
600
612
|
- Existing `authPlugin` usage remains backward-compatible
|
|
601
613
|
- If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
|
|
602
614
|
|
|
@@ -617,12 +629,10 @@
|
|
|
617
629
|
Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
|
|
618
630
|
|
|
619
631
|
### Phase 1: Validation Helpers (`@veloxts/validation`)
|
|
620
|
-
|
|
621
632
|
- Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
|
|
622
633
|
- Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
|
|
623
634
|
|
|
624
635
|
### Phase 2: Template Deduplication (`@veloxts/auth`)
|
|
625
|
-
|
|
626
636
|
- Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
|
|
627
637
|
- Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
|
|
628
638
|
- Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
|
|
@@ -630,20 +640,17 @@
|
|
|
630
640
|
- Fix jwtManager singleton pattern in templates
|
|
631
641
|
|
|
632
642
|
### Phase 3: Router Helpers (`@veloxts/router`)
|
|
633
|
-
|
|
634
643
|
- Add `createRouter()` returning `{ collections, router }` for DRY setup
|
|
635
644
|
- Add `toRouter()` for router-only use cases
|
|
636
645
|
- Update all router templates to use `createRouter()`
|
|
637
646
|
|
|
638
647
|
### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
|
|
639
|
-
|
|
640
648
|
- Add `NarrowingGuard` interface with phantom `_narrows` type
|
|
641
649
|
- Add `authenticatedNarrow` and `hasRoleNarrow()` guards
|
|
642
650
|
- Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
|
|
643
651
|
- Enables `ctx.user` to be non-null after guard passes
|
|
644
652
|
|
|
645
653
|
### Phase 5: Documentation (`@veloxts/router`)
|
|
646
|
-
|
|
647
654
|
- Document `.rest()` override patterns
|
|
648
655
|
- Document `createRouter()` helper usage
|
|
649
656
|
- Document `guardNarrow()` experimental API
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "React Server Components integration for VeloxTS framework using Vinxi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": ">=19.2.0",
|
|
74
74
|
"react-dom": ">=19.2.0",
|
|
75
|
-
"@veloxts/auth": "0.
|
|
76
|
-
"@veloxts/core": "0.
|
|
77
|
-
"@veloxts/client": "0.
|
|
78
|
-
"@veloxts/router": "0.
|
|
75
|
+
"@veloxts/auth": "0.9.0",
|
|
76
|
+
"@veloxts/core": "0.9.0",
|
|
77
|
+
"@veloxts/client": "0.9.0",
|
|
78
|
+
"@veloxts/router": "0.9.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
81
81
|
"@veloxts/auth": {
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
"react-dom": "19.2.5",
|
|
98
98
|
"typescript": "5.9.3",
|
|
99
99
|
"vitest": "4.1.5",
|
|
100
|
-
"@veloxts/auth": "0.
|
|
101
|
-
"@veloxts/
|
|
102
|
-
"@veloxts/router": "0.
|
|
103
|
-
"@veloxts/
|
|
100
|
+
"@veloxts/auth": "0.9.0",
|
|
101
|
+
"@veloxts/client": "0.9.0",
|
|
102
|
+
"@veloxts/router": "0.9.0",
|
|
103
|
+
"@veloxts/core": "0.9.0"
|
|
104
104
|
},
|
|
105
105
|
"keywords": [
|
|
106
106
|
"velox",
|