@veloxts/orm 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 +19 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @veloxts/orm
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bump dependencies across packages (April 2026)
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @veloxts/core@0.8.3
|
|
10
|
+
|
|
3
11
|
## 0.8.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -413,6 +421,7 @@
|
|
|
413
421
|
- ### feat(auth): Unified Adapter-Only Architecture
|
|
414
422
|
|
|
415
423
|
**New Features:**
|
|
424
|
+
|
|
416
425
|
- Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
|
|
417
426
|
- Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
|
|
418
427
|
- Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
|
|
@@ -420,20 +429,24 @@
|
|
|
420
429
|
- Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
|
|
421
430
|
|
|
422
431
|
**Architecture Changes:**
|
|
432
|
+
|
|
423
433
|
- `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
|
|
424
434
|
- Single code path for authentication (no more dual native/adapter modes)
|
|
425
435
|
- `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
|
|
426
436
|
|
|
427
437
|
**Breaking Changes:**
|
|
438
|
+
|
|
428
439
|
- Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
|
|
429
440
|
- Remove deprecated `session` field from `AuthConfig`
|
|
430
441
|
- `User` interface no longer has index signature (extend via declaration merging)
|
|
431
442
|
|
|
432
443
|
**Type Safety Improvements:**
|
|
444
|
+
|
|
433
445
|
- `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
|
|
434
446
|
- Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
|
|
435
447
|
|
|
436
448
|
**Migration:**
|
|
449
|
+
|
|
437
450
|
- Existing `authPlugin` usage remains backward-compatible
|
|
438
451
|
- If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
|
|
439
452
|
|
|
@@ -451,10 +464,12 @@
|
|
|
451
464
|
Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
|
|
452
465
|
|
|
453
466
|
### Phase 1: Validation Helpers (`@veloxts/validation`)
|
|
467
|
+
|
|
454
468
|
- Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
|
|
455
469
|
- Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
|
|
456
470
|
|
|
457
471
|
### Phase 2: Template Deduplication (`@veloxts/auth`)
|
|
472
|
+
|
|
458
473
|
- Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
|
|
459
474
|
- Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
|
|
460
475
|
- Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
|
|
@@ -462,17 +477,20 @@
|
|
|
462
477
|
- Fix jwtManager singleton pattern in templates
|
|
463
478
|
|
|
464
479
|
### Phase 3: Router Helpers (`@veloxts/router`)
|
|
480
|
+
|
|
465
481
|
- Add `createRouter()` returning `{ collections, router }` for DRY setup
|
|
466
482
|
- Add `toRouter()` for router-only use cases
|
|
467
483
|
- Update all router templates to use `createRouter()`
|
|
468
484
|
|
|
469
485
|
### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
|
|
486
|
+
|
|
470
487
|
- Add `NarrowingGuard` interface with phantom `_narrows` type
|
|
471
488
|
- Add `authenticatedNarrow` and `hasRoleNarrow()` guards
|
|
472
489
|
- Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
|
|
473
490
|
- Enables `ctx.user` to be non-null after guard passes
|
|
474
491
|
|
|
475
492
|
### Phase 5: Documentation (`@veloxts/router`)
|
|
493
|
+
|
|
476
494
|
- Document `.rest()` override patterns
|
|
477
495
|
- Document `createRouter()` helper usage
|
|
478
496
|
- Document `guardNarrow()` experimental API
|
|
@@ -1297,6 +1315,7 @@
|
|
|
1297
1315
|
### Patch Changes
|
|
1298
1316
|
|
|
1299
1317
|
- Fix Prisma client generation in scaffolder
|
|
1318
|
+
|
|
1300
1319
|
- Added automatic Prisma client generation after dependency installation in create-velox-app
|
|
1301
1320
|
- Fixed database template to validate DATABASE_URL environment variable
|
|
1302
1321
|
- Added alpha release warning to all package READMEs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/orm",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Prisma wrapper with enhanced DX for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"fastify": "5.8.
|
|
19
|
+
"fastify": "5.8.5",
|
|
20
20
|
"pg": "8.20.0",
|
|
21
21
|
"pg-format": "1.0.4",
|
|
22
|
-
"@veloxts/core": "0.8.
|
|
22
|
+
"@veloxts/core": "0.8.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/pg": "8.
|
|
25
|
+
"@types/pg": "8.20.0",
|
|
26
26
|
"@types/pg-format": "1.0.5",
|
|
27
|
-
"@vitest/coverage-v8": "4.1.
|
|
27
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
28
28
|
"typescript": "5.9.3",
|
|
29
|
-
"vitest": "4.1.
|
|
29
|
+
"vitest": "4.1.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@prisma/client": ">=7.0.0"
|