@veloxts/core 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.
- package/CHANGELOG.md +16 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @veloxts/core
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bump dependencies across packages (April 2026)
|
|
8
|
+
|
|
3
9
|
## 0.8.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -309,6 +315,7 @@
|
|
|
309
315
|
- ### feat(auth): Unified Adapter-Only Architecture
|
|
310
316
|
|
|
311
317
|
**New Features:**
|
|
318
|
+
|
|
312
319
|
- Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
|
|
313
320
|
- Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
|
|
314
321
|
- Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
|
|
@@ -316,20 +323,24 @@
|
|
|
316
323
|
- Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
|
|
317
324
|
|
|
318
325
|
**Architecture Changes:**
|
|
326
|
+
|
|
319
327
|
- `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
|
|
320
328
|
- Single code path for authentication (no more dual native/adapter modes)
|
|
321
329
|
- `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
|
|
322
330
|
|
|
323
331
|
**Breaking Changes:**
|
|
332
|
+
|
|
324
333
|
- Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
|
|
325
334
|
- Remove deprecated `session` field from `AuthConfig`
|
|
326
335
|
- `User` interface no longer has index signature (extend via declaration merging)
|
|
327
336
|
|
|
328
337
|
**Type Safety Improvements:**
|
|
338
|
+
|
|
329
339
|
- `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
|
|
330
340
|
- Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
|
|
331
341
|
|
|
332
342
|
**Migration:**
|
|
343
|
+
|
|
333
344
|
- Existing `authPlugin` usage remains backward-compatible
|
|
334
345
|
- If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
|
|
335
346
|
|
|
@@ -344,10 +355,12 @@
|
|
|
344
355
|
Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
|
|
345
356
|
|
|
346
357
|
### Phase 1: Validation Helpers (`@veloxts/validation`)
|
|
358
|
+
|
|
347
359
|
- Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
|
|
348
360
|
- Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
|
|
349
361
|
|
|
350
362
|
### Phase 2: Template Deduplication (`@veloxts/auth`)
|
|
363
|
+
|
|
351
364
|
- Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
|
|
352
365
|
- Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
|
|
353
366
|
- Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
|
|
@@ -355,17 +368,20 @@
|
|
|
355
368
|
- Fix jwtManager singleton pattern in templates
|
|
356
369
|
|
|
357
370
|
### Phase 3: Router Helpers (`@veloxts/router`)
|
|
371
|
+
|
|
358
372
|
- Add `createRouter()` returning `{ collections, router }` for DRY setup
|
|
359
373
|
- Add `toRouter()` for router-only use cases
|
|
360
374
|
- Update all router templates to use `createRouter()`
|
|
361
375
|
|
|
362
376
|
### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
|
|
377
|
+
|
|
363
378
|
- Add `NarrowingGuard` interface with phantom `_narrows` type
|
|
364
379
|
- Add `authenticatedNarrow` and `hasRoleNarrow()` guards
|
|
365
380
|
- Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
|
|
366
381
|
- Enables `ctx.user` to be non-null after guard passes
|
|
367
382
|
|
|
368
383
|
### Phase 5: Documentation (`@veloxts/router`)
|
|
384
|
+
|
|
369
385
|
- Document `.rest()` override patterns
|
|
370
386
|
- Document `createRouter()` helper usage
|
|
371
387
|
- Document `guardNarrow()` experimental API
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Fastify wrapper and plugin system for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"fastify": "5.8.
|
|
32
|
+
"fastify": "5.8.5",
|
|
33
33
|
"fastify-plugin": "5.1.0",
|
|
34
34
|
"picocolors": "1.1.1"
|
|
35
35
|
},
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@fastify/static": "9.
|
|
46
|
-
"@types/node": "25.
|
|
47
|
-
"@vitest/coverage-v8": "4.1.
|
|
45
|
+
"@fastify/static": "9.1.3",
|
|
46
|
+
"@types/node": "25.6.0",
|
|
47
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
48
48
|
"typescript": "5.9.3",
|
|
49
|
-
"vitest": "4.1.
|
|
49
|
+
"vitest": "4.1.5"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"velox",
|