@tsed/platform-cache 6.95.7 → 6.96.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/package.json +11 -11
- package/lib/cjs/decorators/useCache.d.ts +0 -2
- package/lib/cjs/index.d.ts +0 -3
- package/lib/cjs/interceptors/PlatformCacheInterceptor.d.ts +0 -23
- package/lib/cjs/interfaces/PlatformCacheOptions.d.ts +0 -7
- package/lib/cjs/interfaces/PlatformCachedObject.d.ts +0 -7
- package/lib/cjs/interfaces/index.d.ts +0 -23
- package/lib/cjs/services/PlatformCache.d.ts +0 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-cache",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.96.0",
|
|
4
4
|
"description": "Platform cache module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"tslib": "2.2.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@tsed/core": "6.
|
|
28
|
-
"@tsed/di": "6.
|
|
29
|
-
"@tsed/exceptions": "6.
|
|
30
|
-
"@tsed/json-mapper": "6.
|
|
31
|
-
"@tsed/schema": "6.
|
|
27
|
+
"@tsed/core": "6.96.0",
|
|
28
|
+
"@tsed/di": "6.96.0",
|
|
29
|
+
"@tsed/exceptions": "6.96.0",
|
|
30
|
+
"@tsed/json-mapper": "6.96.0",
|
|
31
|
+
"@tsed/schema": "6.96.0",
|
|
32
32
|
"@types/cache-manager": "^3.4.2",
|
|
33
33
|
"@types/micromatch": "^4.0.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@tsed/core": "^6.
|
|
37
|
-
"@tsed/di": "^6.
|
|
38
|
-
"@tsed/exceptions": "^6.
|
|
39
|
-
"@tsed/json-mapper": "^6.
|
|
40
|
-
"@tsed/schema": "^6.
|
|
36
|
+
"@tsed/core": "^6.96.0",
|
|
37
|
+
"@tsed/di": "^6.96.0",
|
|
38
|
+
"@tsed/exceptions": "^6.96.0",
|
|
39
|
+
"@tsed/json-mapper": "^6.96.0",
|
|
40
|
+
"@tsed/schema": "^6.96.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": "https://github.com/tsedio/tsed",
|
|
43
43
|
"bugs": {
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BaseContext, InterceptorContext, InterceptorMethods, InterceptorNext } from "@tsed/di";
|
|
2
|
-
import { PlatformCachedObject } from "../interfaces/PlatformCachedObject";
|
|
3
|
-
import { PlatformCacheOptions } from "../interfaces/PlatformCacheOptions";
|
|
4
|
-
import { PlatformCache } from "../services/PlatformCache";
|
|
5
|
-
/**
|
|
6
|
-
* @platform
|
|
7
|
-
*/
|
|
8
|
-
export declare class PlatformCacheInterceptor implements InterceptorMethods {
|
|
9
|
-
protected cache: PlatformCache;
|
|
10
|
-
intercept(context: InterceptorContext<any, PlatformCacheOptions>, next: InterceptorNext): Promise<any>;
|
|
11
|
-
protected getArgs(context: InterceptorContext<unknown, PlatformCacheOptions>): any;
|
|
12
|
-
protected getOptions(context: InterceptorContext<any, PlatformCacheOptions>): {
|
|
13
|
-
ttl: number | import("cache-manager").TtlFunction | undefined;
|
|
14
|
-
type: any;
|
|
15
|
-
args: any;
|
|
16
|
-
collectionType: any;
|
|
17
|
-
keyArgs: string;
|
|
18
|
-
};
|
|
19
|
-
protected isEndpoint({ target, propertyKey }: InterceptorContext<any, PlatformCacheOptions>): boolean;
|
|
20
|
-
protected cacheMethod(context: InterceptorContext<any, PlatformCacheOptions>, next: InterceptorNext): Promise<any>;
|
|
21
|
-
protected cacheResponse(context: InterceptorContext<any, PlatformCacheOptions>, next: InterceptorNext): Promise<any>;
|
|
22
|
-
protected sendResponse(cachedObject: PlatformCachedObject, $ctx: BaseContext): any;
|
|
23
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MetadataTypes } from "@tsed/core";
|
|
2
|
-
import { BaseContext } from "@tsed/di";
|
|
3
|
-
import type { TtlFunction } from "cache-manager";
|
|
4
|
-
export interface PlatformCacheOptions extends MetadataTypes {
|
|
5
|
-
ttl?: number | TtlFunction;
|
|
6
|
-
key?: string | ((args: any[], ctx?: BaseContext) => string);
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { BaseContext } from "@tsed/di";
|
|
2
|
-
import type { Cache, CacheOptions, CachingConfig, Store } from "cache-manager";
|
|
3
|
-
export * from "./PlatformCachedObject";
|
|
4
|
-
export interface PlatformCacheSettings extends CacheOptions, CachingConfig {
|
|
5
|
-
caches?: Cache[];
|
|
6
|
-
store?: "memory" | "none" | Store | {
|
|
7
|
-
create(...args: any[]): Store;
|
|
8
|
-
} | (() => any);
|
|
9
|
-
max?: number;
|
|
10
|
-
keyResolver?: (args: any[], ctx: BaseContext) => string;
|
|
11
|
-
/**
|
|
12
|
-
* You may pass in any other arguments these will be passed on to the `create` method of your store,
|
|
13
|
-
* otherwise they will be ignored.
|
|
14
|
-
*/
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
declare global {
|
|
18
|
-
namespace TsED {
|
|
19
|
-
interface Configuration {
|
|
20
|
-
cache?: PlatformCacheSettings | false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Configuration } from "@tsed/di";
|
|
2
|
-
import { JsonDeserializerOptions } from "@tsed/json-mapper";
|
|
3
|
-
import type { Cache, CachingConfig, MultiCache, TtlFunction } from "cache-manager";
|
|
4
|
-
import { PlatformCacheSettings } from "../interfaces";
|
|
5
|
-
export declare type CacheManager = (Cache | MultiCache) & {
|
|
6
|
-
keys?(): Promise<string[]>;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @platform
|
|
10
|
-
*/
|
|
11
|
-
export declare class PlatformCache {
|
|
12
|
-
settings: Configuration;
|
|
13
|
-
cache: CacheManager | undefined;
|
|
14
|
-
disabled(): boolean;
|
|
15
|
-
$onInit(): Promise<void>;
|
|
16
|
-
defaultKeyResolver(): (args: any[], ctx?: any) => string;
|
|
17
|
-
defaultTtl(): number | TtlFunction;
|
|
18
|
-
ttl(result?: any, currentTtl?: number | TtlFunction): number;
|
|
19
|
-
wrap<T>(key: string, fetch: () => Promise<T>, options?: CachingConfig): Promise<T>;
|
|
20
|
-
get<T>(key: string, options?: JsonDeserializerOptions): Promise<T | undefined>;
|
|
21
|
-
set<T>(key: string, value: any, options?: CachingConfig): Promise<T | undefined>;
|
|
22
|
-
del(key: string): Promise<void>;
|
|
23
|
-
reset(): Promise<void>;
|
|
24
|
-
keys(): Promise<string[]>;
|
|
25
|
-
getMatchingKeys(patterns: string): Promise<string[]>;
|
|
26
|
-
deleteMatchingKeys(patterns: string): Promise<string[]>;
|
|
27
|
-
protected createCacheManager(settings: PlatformCacheSettings): Promise<MultiCache>;
|
|
28
|
-
}
|