@veloxts/validation 0.6.89 → 0.6.90

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 +8 -11
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @veloxts/validation
2
2
 
3
+ ## 0.6.90
4
+
5
+ ### Patch Changes
6
+
7
+ - Dependencies updates – fix critical and high severity vulnerabilities
8
+ - Updated dependencies
9
+ - @veloxts/core@0.6.90
10
+
3
11
  ## 0.6.89
4
12
 
5
13
  ### Patch Changes
@@ -159,7 +167,6 @@
159
167
  - ### feat(auth): Unified Adapter-Only Architecture
160
168
 
161
169
  **New Features:**
162
-
163
170
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
164
171
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
165
172
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -167,24 +174,20 @@
167
174
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
168
175
 
169
176
  **Architecture Changes:**
170
-
171
177
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
172
178
  - Single code path for authentication (no more dual native/adapter modes)
173
179
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
174
180
 
175
181
  **Breaking Changes:**
176
-
177
182
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
178
183
  - Remove deprecated `session` field from `AuthConfig`
179
184
  - `User` interface no longer has index signature (extend via declaration merging)
180
185
 
181
186
  **Type Safety Improvements:**
182
-
183
187
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
184
188
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
185
189
 
186
190
  **Migration:**
187
-
188
191
  - Existing `authPlugin` usage remains backward-compatible
189
192
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
190
193
 
@@ -202,12 +205,10 @@
202
205
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
203
206
 
204
207
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
205
-
206
208
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
207
209
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
208
210
 
209
211
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
210
-
211
212
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
212
213
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
213
214
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -215,20 +216,17 @@
215
216
  - Fix jwtManager singleton pattern in templates
216
217
 
217
218
  ### Phase 3: Router Helpers (`@veloxts/router`)
218
-
219
219
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
220
220
  - Add `toRouter()` for router-only use cases
221
221
  - Update all router templates to use `createRouter()`
222
222
 
223
223
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
224
-
225
224
  - Add `NarrowingGuard` interface with phantom `_narrows` type
226
225
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
227
226
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
228
227
  - Enables `ctx.user` to be non-null after guard passes
229
228
 
230
229
  ### Phase 5: Documentation (`@veloxts/router`)
231
-
232
230
  - Document `.rest()` override patterns
233
231
  - Document `createRouter()` helper usage
234
232
  - Document `guardNarrow()` experimental API
@@ -1053,7 +1051,6 @@
1053
1051
  ### Patch Changes
1054
1052
 
1055
1053
  - Fix Prisma client generation in scaffolder
1056
-
1057
1054
  - Added automatic Prisma client generation after dependency installation in create-velox-app
1058
1055
  - Fixed database template to validate DATABASE_URL environment variable
1059
1056
  - Added alpha release warning to all package READMEs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/validation",
3
- "version": "0.6.89",
3
+ "version": "0.6.90",
4
4
  "description": "Zod integration and validation middleware for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "zod": "3.25.76",
26
- "@veloxts/core": "0.6.89"
26
+ "@veloxts/core": "0.6.90"
27
27
  },
28
28
  "devDependencies": {
29
- "@vitest/coverage-v8": "4.0.16",
29
+ "@vitest/coverage-v8": "4.0.18",
30
30
  "typescript": "5.9.3",
31
- "vitest": "4.0.16"
31
+ "vitest": "4.0.18"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "zod": "^3.25.0"