@veloxts/cache 0.6.89 → 0.6.91

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @veloxts/cache
2
2
 
3
+ ## 0.6.91
4
+
5
+ ### Patch Changes
6
+
7
+ - removed unused DI system
8
+ - Updated dependencies
9
+ - @veloxts/core@0.6.91
10
+
11
+ ## 0.6.90
12
+
13
+ ### Patch Changes
14
+
15
+ - Dependencies updates – fix critical and high severity vulnerabilities
16
+ - Updated dependencies
17
+ - @veloxts/core@0.6.90
18
+
3
19
  ## 0.6.89
4
20
 
5
21
  ### Patch Changes
@@ -159,7 +175,6 @@
159
175
  - ### feat(auth): Unified Adapter-Only Architecture
160
176
 
161
177
  **New Features:**
162
-
163
178
  - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
164
179
  - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
165
180
  - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
@@ -167,24 +182,20 @@
167
182
  - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
168
183
 
169
184
  **Architecture Changes:**
170
-
171
185
  - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
172
186
  - Single code path for authentication (no more dual native/adapter modes)
173
187
  - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
174
188
 
175
189
  **Breaking Changes:**
176
-
177
190
  - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
178
191
  - Remove deprecated `session` field from `AuthConfig`
179
192
  - `User` interface no longer has index signature (extend via declaration merging)
180
193
 
181
194
  **Type Safety Improvements:**
182
-
183
195
  - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
184
196
  - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
185
197
 
186
198
  **Migration:**
187
-
188
199
  - Existing `authPlugin` usage remains backward-compatible
189
200
  - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
190
201
 
@@ -202,12 +213,10 @@
202
213
  Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
203
214
 
204
215
  ### Phase 1: Validation Helpers (`@veloxts/validation`)
205
-
206
216
  - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
207
217
  - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
208
218
 
209
219
  ### Phase 2: Template Deduplication (`@veloxts/auth`)
210
-
211
220
  - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
212
221
  - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
213
222
  - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
@@ -215,20 +224,17 @@
215
224
  - Fix jwtManager singleton pattern in templates
216
225
 
217
226
  ### Phase 3: Router Helpers (`@veloxts/router`)
218
-
219
227
  - Add `createRouter()` returning `{ collections, router }` for DRY setup
220
228
  - Add `toRouter()` for router-only use cases
221
229
  - Update all router templates to use `createRouter()`
222
230
 
223
231
  ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
224
-
225
232
  - Add `NarrowingGuard` interface with phantom `_narrows` type
226
233
  - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
227
234
  - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
228
235
  - Enables `ctx.user` to be non-null after guard passes
229
236
 
230
237
  ### Phase 5: Documentation (`@veloxts/router`)
231
-
232
238
  - Document `.rest()` override patterns
233
239
  - Document `createRouter()` helper usage
234
240
  - Document `guardNarrow()` experimental API
package/dist/index.d.ts CHANGED
@@ -58,22 +58,3 @@ export type { CacheConfig, CacheDriver, CacheEntry, CacheOptions, CachePluginOpt
58
58
  * ```
59
59
  */
60
60
  export { formatTtl, isDurationString, parseTtl, parseTtlMs, } from './utils.js';
61
- /**
62
- * DI tokens and providers for @veloxts/cache
63
- *
64
- * Use these to integrate cache services with the @veloxts/core DI container.
65
- *
66
- * @example
67
- * ```typescript
68
- * import { Container } from '@veloxts/core';
69
- * import { registerCacheProviders, CACHE_MANAGER } from '@veloxts/cache';
70
- *
71
- * const container = new Container();
72
- * await registerCacheProviders(container, { driver: 'memory' });
73
- *
74
- * const cache = container.resolve(CACHE_MANAGER);
75
- * await cache.put('key', 'value', '1h');
76
- * ```
77
- */
78
- export { registerCacheProviders } from './providers.js';
79
- export { CACHE_CONFIG, CACHE_MANAGER, CACHE_STORE } from './tokens.js';
package/dist/index.js CHANGED
@@ -60,27 +60,3 @@ export { cachePlugin, closeCache, getCache, getCacheFromInstance, initCache, } f
60
60
  * ```
61
61
  */
62
62
  export { formatTtl, isDurationString, parseTtl, parseTtlMs, } from './utils.js';
63
- // ============================================================================
64
- // Dependency Injection
65
- // ============================================================================
66
- /**
67
- * DI tokens and providers for @veloxts/cache
68
- *
69
- * Use these to integrate cache services with the @veloxts/core DI container.
70
- *
71
- * @example
72
- * ```typescript
73
- * import { Container } from '@veloxts/core';
74
- * import { registerCacheProviders, CACHE_MANAGER } from '@veloxts/cache';
75
- *
76
- * const container = new Container();
77
- * await registerCacheProviders(container, { driver: 'memory' });
78
- *
79
- * const cache = container.resolve(CACHE_MANAGER);
80
- * await cache.put('key', 'value', '1h');
81
- * ```
82
- */
83
- // Provider exports - factory functions for registering services
84
- export { registerCacheProviders } from './providers.js';
85
- // Token exports - unique identifiers for DI resolution
86
- export { CACHE_CONFIG, CACHE_MANAGER, CACHE_STORE } from './tokens.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/cache",
3
- "version": "0.6.89",
3
+ "version": "0.6.91",
4
4
  "description": "Multi-driver caching layer for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,11 +31,11 @@
31
31
  "CHANGELOG.md"
32
32
  ],
33
33
  "dependencies": {
34
- "fastify": "5.6.2",
34
+ "fastify": "5.7.2",
35
35
  "fastify-plugin": "5.1.0",
36
- "lru-cache": "11.1.0",
37
- "superjson": "2.2.2",
38
- "@veloxts/core": "0.6.89"
36
+ "lru-cache": "11.2.5",
37
+ "superjson": "2.2.6",
38
+ "@veloxts/core": "0.6.91"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "ioredis": ">=5.0.0"
@@ -46,12 +46,12 @@
46
46
  }
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "25.0.3",
50
- "@vitest/coverage-v8": "4.0.16",
51
- "ioredis": "5.6.1",
49
+ "@types/node": "25.1.0",
50
+ "@vitest/coverage-v8": "4.0.18",
51
+ "ioredis": "5.9.2",
52
52
  "typescript": "5.9.3",
53
- "vitest": "4.0.16",
54
- "@veloxts/testing": "0.6.89"
53
+ "vitest": "4.0.18",
54
+ "@veloxts/testing": "0.6.91"
55
55
  },
56
56
  "keywords": [
57
57
  "velox",