@veloxts/validation 0.6.88 → 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 +16 -11
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
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
+
11
+ ## 0.6.89
12
+
13
+ ### Patch Changes
14
+
15
+ - expand preset system with server config, auth presets, and security validation
16
+ - Updated dependencies
17
+ - @veloxts/core@0.6.89
18
+
3
19
  ## 0.6.88
4
20
 
5
21
  ### Patch Changes
@@ -151,7 +167,6 @@
151
167
  - ### feat(auth): Unified Adapter-Only Architecture
152
168
 
153
169
  **New Features:**
154
-
155
170
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
156
171
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
157
172
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -159,24 +174,20 @@
159
174
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
160
175
 
161
176
  **Architecture Changes:**
162
-
163
177
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
164
178
  - Single code path for authentication (no more dual native/adapter modes)
165
179
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
166
180
 
167
181
  **Breaking Changes:**
168
-
169
182
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
170
183
  - Remove deprecated `session` field from `AuthConfig`
171
184
  - `User` interface no longer has index signature (extend via declaration merging)
172
185
 
173
186
  **Type Safety Improvements:**
174
-
175
187
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
176
188
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
177
189
 
178
190
  **Migration:**
179
-
180
191
  - Existing `authPlugin` usage remains backward-compatible
181
192
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
182
193
 
@@ -194,12 +205,10 @@
194
205
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
195
206
 
196
207
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
197
-
198
208
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
199
209
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
200
210
 
201
211
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
202
-
203
212
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
204
213
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
205
214
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -207,20 +216,17 @@
207
216
  - Fix jwtManager singleton pattern in templates
208
217
 
209
218
  ### Phase 3: Router Helpers (`@veloxts/router`)
210
-
211
219
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
212
220
  - Add `toRouter()` for router-only use cases
213
221
  - Update all router templates to use `createRouter()`
214
222
 
215
223
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
216
-
217
224
  - Add `NarrowingGuard` interface with phantom `_narrows` type
218
225
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
219
226
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
220
227
  - Enables `ctx.user` to be non-null after guard passes
221
228
 
222
229
  ### Phase 5: Documentation (`@veloxts/router`)
223
-
224
230
  - Document `.rest()` override patterns
225
231
  - Document `createRouter()` helper usage
226
232
  - Document `guardNarrow()` experimental API
@@ -1045,7 +1051,6 @@
1045
1051
  ### Patch Changes
1046
1052
 
1047
1053
  - Fix Prisma client generation in scaffolder
1048
-
1049
1054
  - Added automatic Prisma client generation after dependency installation in create-velox-app
1050
1055
  - Fixed database template to validate DATABASE_URL environment variable
1051
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.88",
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.88"
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"