@travetto/cache 6.0.1 → 7.0.0-rc.0

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/README.md CHANGED
@@ -83,7 +83,7 @@ The [@Cache](https://github.com/travetto/travetto/tree/main/module/cache/src/dec
83
83
  * `reinstate` the function to execute on return of a cached value. This allows for any necessary operations to conform to expected output (e.g. re-establishing class instances, etc.). This method should not be used often, as the return values of the methods should naturally serialize to/from `JSON` and the values should be usable either way.
84
84
 
85
85
  ### EvictCache
86
- Additionally, there is support for planned eviction via the [@EvictCache](https://github.com/travetto/travetto/tree/main/module/cache/src/decorator.ts#L38) decorator. On successful execution of a method with this decorator, the matching keySpace/key value will be evicted from the cache. This requires coordination between multiple methods, to use the same `keySpace` and `key` to compute the expected key.
86
+ Additionally, there is support for planned eviction via the [@EvictCache](https://github.com/travetto/travetto/tree/main/module/cache/src/decorator.ts#L44) decorator. On successful execution of a method with this decorator, the matching keySpace/key value will be evicted from the cache. This requires coordination between multiple methods, to use the same `keySpace` and `key` to compute the expected key.
87
87
 
88
88
  **Code: Using decorators to cache/evict user access**
89
89
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cache",
3
- "version": "6.0.1",
3
+ "version": "7.0.0-rc.0",
4
4
  "description": "Caching functionality with decorators for declarative use.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,12 +25,12 @@
25
25
  "directory": "module/cache"
26
26
  },
27
27
  "dependencies": {
28
- "@travetto/di": "^6.0.1",
29
- "@travetto/model": "^6.0.1"
28
+ "@travetto/di": "^7.0.0-rc.0",
29
+ "@travetto/model": "^7.0.0-rc.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@travetto/test": "^6.0.2",
33
- "@travetto/transformer": "^6.0.1"
32
+ "@travetto/test": "^7.0.0-rc.0",
33
+ "@travetto/transformer": "^7.0.0-rc.0"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@travetto/transformer": {
package/src/decorator.ts CHANGED
@@ -7,7 +7,7 @@ import { CoreCacheConfig, CacheConfig, CacheAware, CacheConfigSymbol, EvictConfi
7
7
  * Indicates a method is intended to cache. The return type must be properly serializable
8
8
  * @param field The field of the cache source
9
9
  * @param config The additional cache configuration
10
- * @augments `@travetto/cache:Cache`
10
+ * @kind decorator
11
11
  */
12
12
  export function Cache<F extends string, U extends Record<F, CacheService>>(field: F, maxAge: number | TimeSpan, config?: Omit<CacheConfig, 'maxAge'>): MethodDecorator;
13
13
  export function Cache<F extends string, U extends Record<F, CacheService>>(field: F, cfg?: CacheConfig): MethodDecorator;
@@ -39,7 +39,7 @@ export function Cache<F extends string, U extends Record<F, CacheService>>(
39
39
  * freshest data will be collected
40
40
  * @param field The field of the cache source
41
41
  * @param config The additional cache configuration
42
- * @augments `@travetto/cache:Evict`
42
+ * @kind decorator
43
43
  */
44
44
  export function EvictCache<F extends string, U extends Record<F, CacheService>>(field: F, config: CoreCacheConfig = {}) {
45
45
  return function <R extends Promise<unknown>>(target: U & CacheAware, propertyKey: string, _descriptor: MethodDescriptor<R>): void {
package/src/service.ts CHANGED
@@ -33,7 +33,7 @@ export class CacheService {
33
33
 
34
34
  #modelService: ModelExpirySupport;
35
35
 
36
- constructor(@Inject(CacheModelSymbol, { resolution: 'loose' }) modelService: ModelExpirySupport) {
36
+ constructor(@Inject({ qualifier: CacheModelSymbol, resolution: 'loose' }) modelService: ModelExpirySupport) {
37
37
  this.#modelService = modelService;
38
38
  }
39
39