descript-redis-cache 4.0.6 → 4.0.7

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/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CacheInterface } from 'descript';
1
+ import type { CacheInterface, LoggerInterface } from 'descript';
2
2
  import type { ClusterNode, ClusterOptions, RedisOptions } from 'ioredis';
3
3
  import { Cluster, Redis } from 'ioredis';
4
4
  export interface Options {
@@ -14,9 +14,7 @@ export interface Options {
14
14
  options?: ClusterOptions;
15
15
  };
16
16
  }
17
- interface Logger {
18
- log(event: LoggerEvent): void;
19
- }
17
+ type Logger = LoggerInterface<LoggerEvent>;
20
18
  interface Timers {
21
19
  start: number;
22
20
  end: number;
@@ -24,9 +22,6 @@ interface Timers {
24
22
  export type LoggerEvent = ({
25
23
  type: EVENT.REDIS_CACHE_INITIALIZED;
26
24
  options: Options;
27
- } | {
28
- type: EVENT.REDIS_CACHE_ERROR;
29
- error: Error;
30
25
  } | {
31
26
  type: EVENT.REDIS_CACHE_READ_START;
32
27
  key: string;
@@ -73,7 +68,7 @@ export type LoggerEvent = ({
73
68
  timers: Timers;
74
69
  } | {
75
70
  type: EVENT.REDIS_CACHE_WRITE_ERROR;
76
- error: unknown;
71
+ error: Error;
77
72
  key: string;
78
73
  normalizedKey: string;
79
74
  timers: Timers;
@@ -104,7 +99,6 @@ export declare class Cache<Result> implements CacheInterface<Result> {
104
99
  }
105
100
  export declare enum EVENT {
106
101
  REDIS_CACHE_INITIALIZED = "REDIS_CACHE_INITIALIZED",
107
- REDIS_CACHE_ERROR = "REDIS_CACHE_ERROR",
108
102
  REDIS_CACHE_JSON_PARSING_FAILED = "REDIS_CACHE_JSON_PARSING_FAILED",
109
103
  REDIS_CACHE_JSON_STRINGIFY_FAILED = "REDIS_CACHE_JSON_STRINGIFY_FAILED",
110
104
  REDIS_CACHE_READ_DONE = "REDIS_CACHE_READ_DONE",
package/build/index.js CHANGED
@@ -232,7 +232,6 @@ _Cache_client = new WeakMap(), _Cache_logger = new WeakMap(), _Cache_options = n
232
232
  var EVENT;
233
233
  (function (EVENT) {
234
234
  EVENT["REDIS_CACHE_INITIALIZED"] = "REDIS_CACHE_INITIALIZED";
235
- EVENT["REDIS_CACHE_ERROR"] = "REDIS_CACHE_ERROR";
236
235
  EVENT["REDIS_CACHE_JSON_PARSING_FAILED"] = "REDIS_CACHE_JSON_PARSING_FAILED";
237
236
  EVENT["REDIS_CACHE_JSON_STRINGIFY_FAILED"] = "REDIS_CACHE_JSON_STRINGIFY_FAILED";
238
237
  EVENT["REDIS_CACHE_READ_DONE"] = "REDIS_CACHE_READ_DONE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "descript-redis-cache",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "plugin for descript to use redis as cache",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "@stylistic/eslint-plugin-ts": "^2.11.0",
42
42
  "@types/eslint__js": "^8.42.3",
43
43
  "@types/node": "^22.10.0",
44
- "descript": "^4.0.5",
44
+ "descript": "^4.0.6",
45
45
  "eslint": "^9.15.0",
46
46
  "typescript": "^5.7.2",
47
47
  "typescript-eslint": "^8.16.0",