@veloxts/velox 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.
Files changed (2) hide show
  1. package/CHANGELOG.md +24 -10
  2. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @veloxts/velox
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/cache@0.9.0
18
+ - @veloxts/core@0.9.0
19
+ - @veloxts/events@0.9.0
20
+ - @veloxts/mail@0.9.0
21
+ - @veloxts/orm@0.9.0
22
+ - @veloxts/queue@0.9.0
23
+ - @veloxts/scheduler@0.9.0
24
+ - @veloxts/storage@0.9.0
25
+ - @veloxts/validation@0.9.0
26
+
3
27
  ## 0.8.3
4
28
 
5
29
  ### Patch Changes
@@ -819,7 +843,6 @@
819
843
  - ### feat(auth): Unified Adapter-Only Architecture
820
844
 
821
845
  **New Features:**
822
-
823
846
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
824
847
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
825
848
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -827,24 +850,20 @@
827
850
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
828
851
 
829
852
  **Architecture Changes:**
830
-
831
853
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
832
854
  - Single code path for authentication (no more dual native/adapter modes)
833
855
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
834
856
 
835
857
  **Breaking Changes:**
836
-
837
858
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
838
859
  - Remove deprecated `session` field from `AuthConfig`
839
860
  - `User` interface no longer has index signature (extend via declaration merging)
840
861
 
841
862
  **Type Safety Improvements:**
842
-
843
863
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
844
864
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
845
865
 
846
866
  **Migration:**
847
-
848
867
  - Existing `authPlugin` usage remains backward-compatible
849
868
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
850
869
 
@@ -866,12 +885,10 @@
866
885
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
867
886
 
868
887
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
869
-
870
888
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
871
889
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
872
890
 
873
891
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
874
-
875
892
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
876
893
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
877
894
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -879,20 +896,17 @@
879
896
  - Fix jwtManager singleton pattern in templates
880
897
 
881
898
  ### Phase 3: Router Helpers (`@veloxts/router`)
882
-
883
899
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
884
900
  - Add `toRouter()` for router-only use cases
885
901
  - Update all router templates to use `createRouter()`
886
902
 
887
903
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
888
-
889
904
  - Add `NarrowingGuard` interface with phantom `_narrows` type
890
905
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
891
906
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
892
907
  - Enables `ctx.user` to be non-null after guard passes
893
908
 
894
909
  ### Phase 5: Documentation (`@veloxts/router`)
895
-
896
910
  - Document `.rest()` override patterns
897
911
  - Document `createRouter()` helper usage
898
912
  - Document `guardNarrow()` experimental API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/velox",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Complete VeloxTS framework - batteries included",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,30 +39,30 @@
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "dependencies": {
42
- "@veloxts/core": "0.8.3",
43
- "@veloxts/validation": "0.8.3",
44
- "@veloxts/orm": "0.8.3",
45
- "@veloxts/auth": "0.8.3",
46
- "@veloxts/router": "0.8.3"
42
+ "@veloxts/validation": "0.9.0",
43
+ "@veloxts/orm": "0.9.0",
44
+ "@veloxts/auth": "0.9.0",
45
+ "@veloxts/core": "0.9.0",
46
+ "@veloxts/router": "0.9.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "typescript": "5.9.3",
50
50
  "vitest": "4.1.5",
51
- "@veloxts/events": "0.8.3",
52
- "@veloxts/mail": "0.8.3",
53
- "@veloxts/cache": "0.8.3",
54
- "@veloxts/scheduler": "0.8.3",
55
- "@veloxts/storage": "0.8.3",
56
- "@veloxts/queue": "0.8.3"
51
+ "@veloxts/events": "0.9.0",
52
+ "@veloxts/queue": "0.9.0",
53
+ "@veloxts/cache": "0.9.0",
54
+ "@veloxts/mail": "0.9.0",
55
+ "@veloxts/storage": "0.9.0",
56
+ "@veloxts/scheduler": "0.9.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "zod": "^4.3.0",
60
- "@veloxts/cache": "0.8.3",
61
- "@veloxts/queue": "0.8.3",
62
- "@veloxts/mail": "0.8.3",
63
- "@veloxts/storage": "0.8.3",
64
- "@veloxts/events": "0.8.3",
65
- "@veloxts/scheduler": "0.8.3"
60
+ "@veloxts/cache": "0.9.0",
61
+ "@veloxts/queue": "0.9.0",
62
+ "@veloxts/mail": "0.9.0",
63
+ "@veloxts/events": "0.9.0",
64
+ "@veloxts/storage": "0.9.0",
65
+ "@veloxts/scheduler": "0.9.0"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "@veloxts/cache": {