@tsed/platform-cache 8.34.0 → 8.36.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/lib/esm/extends/cache.js +1 -1
- package/lib/esm/interceptors/PlatformCacheInterceptor.js +2 -2
- package/lib/esm/services/PlatformCache.js +3 -3
- package/lib/esm/services/PlatformCacheRefreshService.js +1 -1
- package/lib/types/extends/cache.d.ts +1 -1
- package/lib/types/interceptors/PlatformCacheInterceptor.d.ts +2 -2
- package/lib/types/interfaces/PlatformCacheOptions.d.ts +1 -1
- package/lib/types/interfaces/interfaces.d.ts +2 -2
- package/lib/types/services/PlatformCache.d.ts +2 -2
- package/package.json +8 -9
package/lib/esm/extends/cache.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProviderBuilder } from "@tsed/di";
|
|
2
1
|
import { PlatformCacheInterceptor } from "../interceptors/PlatformCacheInterceptor.js";
|
|
2
|
+
import { ProviderBuilder } from "@tsed/di";
|
|
3
3
|
ProviderBuilder.add("cache", function cache(propertyKey, options = {}) {
|
|
4
4
|
this.intercept(propertyKey, PlatformCacheInterceptor, options);
|
|
5
5
|
return this;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { DIContext, constant, context, inject, interceptor, logger } from "@tsed/di";
|
|
1
2
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
import { isClass, isString, nameOf } from "@tsed/core";
|
|
3
|
-
import { constant, context, DIContext, inject, interceptor, logger } from "@tsed/di";
|
|
4
3
|
import { deserialize, serialize } from "@tsed/json-mapper";
|
|
4
|
+
import { isClass, isString, nameOf } from "@tsed/core";
|
|
5
5
|
import { PlatformCache } from "../services/PlatformCache.js";
|
|
6
6
|
import { PlatformCacheRefreshService } from "../services/PlatformCacheRefreshService.js";
|
|
7
7
|
import { isEndpoint } from "../utils/isEndpoint.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { deserialize, serialize } from "@tsed/json-mapper";
|
|
2
|
+
import { ProviderScope, ProviderType, constant, injectable, logger } from "@tsed/di";
|
|
2
3
|
import { isClass, isFunction, isString } from "@tsed/core";
|
|
3
|
-
import { constant, injectable, logger, ProviderScope, ProviderType } from "@tsed/di";
|
|
4
4
|
import { $asyncEmit } from "@tsed/hooks";
|
|
5
|
-
import {
|
|
5
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { getPrefix } from "../utils/getPrefix.js";
|
|
7
7
|
const defaultKeyResolver = (args) => {
|
|
8
8
|
return args.map((arg) => (isClass(arg) ? JSON.stringify(serialize(arg)) : arg)).join(":");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type BaseContext, DIContext, InterceptorContext, InterceptorMethods, InterceptorNext } from "@tsed/di";
|
|
2
|
-
import { PlatformCachedObject } from "../interfaces/PlatformCachedObject.js";
|
|
3
|
-
import { PlatformCacheOptions } from "../interfaces/PlatformCacheOptions.js";
|
|
4
2
|
import { PlatformCache } from "../services/PlatformCache.js";
|
|
3
|
+
import { PlatformCacheOptions } from "../interfaces/PlatformCacheOptions.js";
|
|
5
4
|
import { PlatformCacheRefreshService } from "../services/PlatformCacheRefreshService.js";
|
|
5
|
+
import { PlatformCachedObject } from "../interfaces/PlatformCachedObject.js";
|
|
6
6
|
interface Response {
|
|
7
7
|
setHeader(key: string, value: string): this;
|
|
8
8
|
setHeaders(headers: Record<string, unknown>): this;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BaseContext } from "@tsed/di";
|
|
2
1
|
import type { Cache, CachingConfig, Store } from "cache-manager";
|
|
3
|
-
import type {
|
|
2
|
+
import type { BaseContext } from "@tsed/di";
|
|
4
3
|
import type { CacheManager } from "../services/PlatformCache.js";
|
|
4
|
+
import type { FactoryStore } from "cache-manager/dist/caching.js";
|
|
5
5
|
export type PlatformCacheSettings<Config extends Record<string, any> = any, S extends Store = any> = CachingConfig<Config> & {
|
|
6
6
|
caches?: Cache[];
|
|
7
7
|
store?: "memory" | Store | FactoryStore<S, Config>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonDeserializerOptions } from "@tsed/json-mapper";
|
|
3
1
|
import type { Cache, CachingConfig, MultiCache } from "cache-manager";
|
|
2
|
+
import { JsonDeserializerOptions } from "@tsed/json-mapper";
|
|
3
|
+
import { Type } from "@tsed/core";
|
|
4
4
|
import { PlatformCacheSettings } from "../interfaces/interfaces.js";
|
|
5
5
|
import { PlatformCachedObject } from "../interfaces/PlatformCachedObject.js";
|
|
6
6
|
export type CacheManager = Cache | MultiCache;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-cache",
|
|
3
|
+
"version": "8.36.0",
|
|
3
4
|
"description": "Platform cache module for Ts.ED Framework",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"version": "8.34.0",
|
|
6
5
|
"source": "./src/index.ts",
|
|
6
|
+
"type": "module",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
9
9
|
"typings": "./lib/types/index.d.ts",
|
|
@@ -28,14 +28,13 @@
|
|
|
28
28
|
"tslib": ">=2.7.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tsed/barrels": "8.
|
|
32
|
-
"@tsed/core": "8.
|
|
33
|
-
"@tsed/di": "8.
|
|
34
|
-
"@tsed/json-mapper": "8.
|
|
35
|
-
"@tsed/schema": "8.
|
|
36
|
-
"@tsed/typescript": "8.
|
|
31
|
+
"@tsed/barrels": "8.36.0",
|
|
32
|
+
"@tsed/core": "8.36.0",
|
|
33
|
+
"@tsed/di": "8.36.0",
|
|
34
|
+
"@tsed/json-mapper": "8.36.0",
|
|
35
|
+
"@tsed/schema": "8.36.0",
|
|
36
|
+
"@tsed/typescript": "8.36.0",
|
|
37
37
|
"@types/micromatch": "^4.0.9",
|
|
38
|
-
"eslint": "9.12.0",
|
|
39
38
|
"typescript": "6.0.2",
|
|
40
39
|
"vitest": "4.1.4"
|
|
41
40
|
},
|