@beignet/provider-redis 0.0.3 → 0.0.5
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 +40 -0
- package/README.md +58 -16
- package/dist/index.d.ts +93 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +307 -223
- package/dist/index.js.map +1 -1
- package/package.json +38 -3
- package/src/index.ts +396 -245
package/dist/index.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* Configuration:
|
|
7
7
|
* - REDIS_URL: Redis connection URL (required)
|
|
8
8
|
* - REDIS_DB: Redis database number (optional, default: 0)
|
|
9
|
+
* - REDIS_CONNECT_TIMEOUT_MS: Initial connection timeout in milliseconds (optional, default: 5000)
|
|
10
|
+
* - REDIS_MAX_RETRIES_PER_REQUEST: Per-command retry limit (optional, default: 2)
|
|
11
|
+
* - REDIS_CONNECT_MAX_ATTEMPTS: Connection attempts before startup fails (optional, default: 3)
|
|
9
12
|
*
|
|
10
13
|
* @example
|
|
11
14
|
* ```ts
|
|
@@ -29,8 +32,16 @@
|
|
|
29
32
|
* ```
|
|
30
33
|
*/
|
|
31
34
|
import { createProvider, createProviderInstrumentation, } from "@beignet/core/providers";
|
|
32
|
-
import Redis from "ioredis";
|
|
35
|
+
import { Redis } from "ioredis";
|
|
33
36
|
import { z } from "zod";
|
|
37
|
+
const DEFAULT_CONNECT_TIMEOUT_MS = 5000;
|
|
38
|
+
const DEFAULT_MAX_RETRIES_PER_REQUEST = 2;
|
|
39
|
+
const DEFAULT_CONNECT_MAX_ATTEMPTS = 3;
|
|
40
|
+
const RECONNECT_BACKOFF_CAP_MS = 2000;
|
|
41
|
+
const NumberString = z
|
|
42
|
+
.string()
|
|
43
|
+
.regex(/^\d+$/, "Expected a non-negative integer string")
|
|
44
|
+
.transform((value) => Number.parseInt(value, 10));
|
|
34
45
|
/**
|
|
35
46
|
* Configuration schema for the Redis provider.
|
|
36
47
|
* Validates environment variables with REDIS_ prefix.
|
|
@@ -45,251 +56,324 @@ const RedisConfigSchema = z.object({
|
|
|
45
56
|
* Redis database number (optional).
|
|
46
57
|
* Defaults to 0 if not specified.
|
|
47
58
|
*/
|
|
48
|
-
DB:
|
|
59
|
+
DB: NumberString.optional(),
|
|
60
|
+
/**
|
|
61
|
+
* Timeout for the initial connection attempt, in milliseconds.
|
|
62
|
+
* Defaults to 5000.
|
|
63
|
+
*/
|
|
64
|
+
CONNECT_TIMEOUT_MS: NumberString.default(DEFAULT_CONNECT_TIMEOUT_MS),
|
|
65
|
+
/**
|
|
66
|
+
* How many times a single command is retried before its promise rejects.
|
|
67
|
+
* Defaults to 2.
|
|
68
|
+
*/
|
|
69
|
+
MAX_RETRIES_PER_REQUEST: NumberString.default(DEFAULT_MAX_RETRIES_PER_REQUEST),
|
|
70
|
+
/**
|
|
71
|
+
* Connection attempts allowed before startup `connect()` rejects.
|
|
72
|
+
* Defaults to 3.
|
|
73
|
+
*/
|
|
74
|
+
CONNECT_MAX_ATTEMPTS: NumberString.default(DEFAULT_CONNECT_MAX_ATTEMPTS),
|
|
49
75
|
});
|
|
50
76
|
function errorMessage(error) {
|
|
51
77
|
return error instanceof Error ? error.message : String(error);
|
|
52
78
|
}
|
|
79
|
+
function reconnectBackoff(attempt) {
|
|
80
|
+
return Math.min(2 ** attempt * 100, RECONNECT_BACKOFF_CAP_MS);
|
|
81
|
+
}
|
|
53
82
|
/**
|
|
54
|
-
*
|
|
83
|
+
* Create an env-backed Redis cache provider.
|
|
55
84
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* - REDIS_DB: Redis database number (optional)
|
|
85
|
+
* Reads `REDIS_*` env vars, contributes `ports.cache`, and exposes
|
|
86
|
+
* `ports.redis` for raw ioredis client access.
|
|
59
87
|
*
|
|
60
88
|
* @example
|
|
61
89
|
* ```ts
|
|
62
|
-
* const
|
|
63
|
-
* ports: basePorts,
|
|
64
|
-
* providers: [redisProvider],
|
|
65
|
-
* // ...
|
|
66
|
-
* });
|
|
90
|
+
* const provider = createRedisProvider({ connectTimeoutMs: 2000 });
|
|
67
91
|
* ```
|
|
68
92
|
*/
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
operation: event.operation,
|
|
105
|
-
key: event.key,
|
|
106
|
-
...event.details,
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
// Extend ports with cache API
|
|
111
|
-
const cache = {
|
|
112
|
-
get: async (key) => {
|
|
113
|
-
const startedAt = Date.now();
|
|
114
|
-
try {
|
|
115
|
-
const value = await client.get(key);
|
|
116
|
-
recordCacheEvent({
|
|
117
|
-
operation: "get",
|
|
118
|
-
key,
|
|
119
|
-
summary: value == null ? "Cache miss" : "Cache hit",
|
|
120
|
-
details: {
|
|
121
|
-
hit: value != null,
|
|
122
|
-
durationMs: Date.now() - startedAt,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
return value;
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
recordCacheEvent({
|
|
129
|
-
operation: "get.failed",
|
|
130
|
-
key,
|
|
131
|
-
summary: "Cache get failed",
|
|
132
|
-
details: {
|
|
133
|
-
durationMs: Date.now() - startedAt,
|
|
134
|
-
error: errorMessage(error),
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
throw error;
|
|
93
|
+
export function createRedisProvider(options = {}) {
|
|
94
|
+
const ConfigSchema = RedisConfigSchema.extend({
|
|
95
|
+
DB: options.db !== undefined
|
|
96
|
+
? NumberString.default(options.db)
|
|
97
|
+
: RedisConfigSchema.shape.DB,
|
|
98
|
+
CONNECT_TIMEOUT_MS: options.connectTimeoutMs !== undefined
|
|
99
|
+
? NumberString.default(options.connectTimeoutMs)
|
|
100
|
+
: RedisConfigSchema.shape.CONNECT_TIMEOUT_MS,
|
|
101
|
+
MAX_RETRIES_PER_REQUEST: options.maxRetriesPerRequest !== undefined
|
|
102
|
+
? NumberString.default(options.maxRetriesPerRequest)
|
|
103
|
+
: RedisConfigSchema.shape.MAX_RETRIES_PER_REQUEST,
|
|
104
|
+
});
|
|
105
|
+
return createProvider({
|
|
106
|
+
name: "redis",
|
|
107
|
+
config: {
|
|
108
|
+
schema: ConfigSchema,
|
|
109
|
+
envPrefix: "REDIS_",
|
|
110
|
+
},
|
|
111
|
+
async setup({ ports, config }) {
|
|
112
|
+
if (!config) {
|
|
113
|
+
throw new Error("[redisProvider] Missing Redis config. " +
|
|
114
|
+
"Please set REDIS_URL environment variable.");
|
|
115
|
+
}
|
|
116
|
+
const connectMaxAttempts = config.CONNECT_MAX_ATTEMPTS ?? DEFAULT_CONNECT_MAX_ATTEMPTS;
|
|
117
|
+
// ioredis uses a single retryStrategy for both the initial connect and
|
|
118
|
+
// later reconnects, so track whether the first connect ever succeeded.
|
|
119
|
+
let connectedOnce = false;
|
|
120
|
+
const defaultRetryStrategy = (attempt) => {
|
|
121
|
+
if (!connectedOnce) {
|
|
122
|
+
// Stop retrying during the initial connect so `connect()` below
|
|
123
|
+
// rejects promptly instead of hanging against an unreachable host.
|
|
124
|
+
if (attempt >= connectMaxAttempts) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return reconnectBackoff(attempt);
|
|
138
128
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
// After a successful connection, keep reconnecting with capped
|
|
130
|
+
// exponential backoff.
|
|
131
|
+
return reconnectBackoff(attempt);
|
|
132
|
+
};
|
|
133
|
+
const client = new Redis(config.URL, {
|
|
134
|
+
db: config.DB ?? options.db ?? 0,
|
|
135
|
+
// Defer connecting until the explicit connect() below so startup can
|
|
136
|
+
// surface a clear error instead of connecting in the background.
|
|
137
|
+
lazyConnect: true,
|
|
138
|
+
connectTimeout: config.CONNECT_TIMEOUT_MS ??
|
|
139
|
+
options.connectTimeoutMs ??
|
|
140
|
+
DEFAULT_CONNECT_TIMEOUT_MS,
|
|
141
|
+
maxRetriesPerRequest: config.MAX_RETRIES_PER_REQUEST ??
|
|
142
|
+
options.maxRetriesPerRequest ??
|
|
143
|
+
DEFAULT_MAX_RETRIES_PER_REQUEST,
|
|
144
|
+
retryStrategy: options.retryStrategy ?? defaultRetryStrategy,
|
|
145
|
+
});
|
|
146
|
+
// Test connection
|
|
147
|
+
try {
|
|
148
|
+
await client.connect();
|
|
149
|
+
connectedOnce = true;
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
client.disconnect();
|
|
153
|
+
throw new Error(`[redisProvider] Failed to connect to Redis at ${config.URL}: ${error instanceof Error ? error.message : String(error)}`);
|
|
154
|
+
}
|
|
155
|
+
const instrumentation = createProviderInstrumentation(ports, {
|
|
156
|
+
providerName: "redis",
|
|
157
|
+
watcher: "cache",
|
|
158
|
+
});
|
|
159
|
+
const recordCacheEvent = (event) => {
|
|
160
|
+
instrumentation.custom({
|
|
161
|
+
name: `cache.${event.operation}`,
|
|
162
|
+
label: `Cache ${event.operation}`,
|
|
163
|
+
summary: event.summary,
|
|
164
|
+
details: {
|
|
165
|
+
operation: event.operation,
|
|
166
|
+
key: event.key,
|
|
167
|
+
...event.details,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
// Extend ports with cache API
|
|
172
|
+
const cache = {
|
|
173
|
+
get: async (key) => {
|
|
174
|
+
const startedAt = Date.now();
|
|
175
|
+
try {
|
|
176
|
+
const value = await client.get(key);
|
|
177
|
+
recordCacheEvent({
|
|
178
|
+
operation: "get",
|
|
179
|
+
key,
|
|
180
|
+
summary: value == null ? "Cache miss" : "Cache hit",
|
|
181
|
+
details: {
|
|
182
|
+
hit: value != null,
|
|
183
|
+
durationMs: Date.now() - startedAt,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
return value;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
recordCacheEvent({
|
|
190
|
+
operation: "get.failed",
|
|
191
|
+
key,
|
|
192
|
+
summary: "Cache get failed",
|
|
193
|
+
details: {
|
|
194
|
+
durationMs: Date.now() - startedAt,
|
|
195
|
+
error: errorMessage(error),
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
throw error;
|
|
145
199
|
}
|
|
146
|
-
|
|
147
|
-
|
|
200
|
+
},
|
|
201
|
+
set: async (key, value, options) => {
|
|
202
|
+
const startedAt = Date.now();
|
|
203
|
+
try {
|
|
204
|
+
if (options?.ttlSeconds != null && options.ttlSeconds > 0) {
|
|
205
|
+
await client.set(key, value, "EX", options.ttlSeconds);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
await client.set(key, value);
|
|
209
|
+
}
|
|
210
|
+
recordCacheEvent({
|
|
211
|
+
operation: "set",
|
|
212
|
+
key,
|
|
213
|
+
summary: "Cache set",
|
|
214
|
+
details: {
|
|
215
|
+
ttlSeconds: options?.ttlSeconds ?? null,
|
|
216
|
+
durationMs: Date.now() - startedAt,
|
|
217
|
+
},
|
|
218
|
+
});
|
|
148
219
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
220
|
+
catch (error) {
|
|
221
|
+
recordCacheEvent({
|
|
222
|
+
operation: "set.failed",
|
|
223
|
+
key,
|
|
224
|
+
summary: "Cache set failed",
|
|
225
|
+
details: {
|
|
226
|
+
ttlSeconds: options?.ttlSeconds ?? null,
|
|
227
|
+
durationMs: Date.now() - startedAt,
|
|
228
|
+
error: errorMessage(error),
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
delete: async (key) => {
|
|
235
|
+
const startedAt = Date.now();
|
|
236
|
+
try {
|
|
237
|
+
const deleted = (await client.del(key)) > 0;
|
|
238
|
+
recordCacheEvent({
|
|
239
|
+
operation: "delete",
|
|
240
|
+
key,
|
|
241
|
+
summary: deleted ? "Cache key deleted" : "Cache key missing",
|
|
242
|
+
details: {
|
|
243
|
+
deleted,
|
|
244
|
+
durationMs: Date.now() - startedAt,
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
return deleted;
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
recordCacheEvent({
|
|
251
|
+
operation: "delete.failed",
|
|
252
|
+
key,
|
|
253
|
+
summary: "Cache delete failed",
|
|
254
|
+
details: {
|
|
255
|
+
durationMs: Date.now() - startedAt,
|
|
256
|
+
error: errorMessage(error),
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
has: async (key) => {
|
|
263
|
+
const startedAt = Date.now();
|
|
264
|
+
try {
|
|
265
|
+
const result = await client.exists(key);
|
|
266
|
+
const exists = result === 1;
|
|
267
|
+
recordCacheEvent({
|
|
268
|
+
operation: "has",
|
|
269
|
+
key,
|
|
270
|
+
summary: exists ? "Cache key exists" : "Cache key missing",
|
|
271
|
+
details: {
|
|
272
|
+
exists,
|
|
273
|
+
durationMs: Date.now() - startedAt,
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
return exists;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
recordCacheEvent({
|
|
280
|
+
operation: "has.failed",
|
|
281
|
+
key,
|
|
282
|
+
summary: "Cache has failed",
|
|
283
|
+
details: {
|
|
284
|
+
durationMs: Date.now() - startedAt,
|
|
285
|
+
error: errorMessage(error),
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
throw error;
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
remember: async (key, factory, options) => {
|
|
292
|
+
const startedAt = Date.now();
|
|
293
|
+
try {
|
|
294
|
+
const cached = await client.get(key);
|
|
295
|
+
if (cached != null) {
|
|
296
|
+
recordCacheEvent({
|
|
297
|
+
operation: "remember",
|
|
298
|
+
key,
|
|
299
|
+
summary: "Cache remember hit",
|
|
300
|
+
details: {
|
|
301
|
+
hit: true,
|
|
302
|
+
ttlSeconds: options?.ttlSeconds ?? null,
|
|
303
|
+
durationMs: Date.now() - startedAt,
|
|
304
|
+
},
|
|
305
|
+
});
|
|
306
|
+
return cached;
|
|
307
|
+
}
|
|
308
|
+
const value = await factory();
|
|
309
|
+
if (options?.ttlSeconds != null && options.ttlSeconds > 0) {
|
|
310
|
+
await client.set(key, value, "EX", options.ttlSeconds);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
await client.set(key, value);
|
|
314
|
+
}
|
|
235
315
|
recordCacheEvent({
|
|
236
316
|
operation: "remember",
|
|
237
317
|
key,
|
|
238
|
-
summary: "Cache remember
|
|
318
|
+
summary: "Cache remember miss",
|
|
239
319
|
details: {
|
|
240
|
-
hit:
|
|
320
|
+
hit: false,
|
|
241
321
|
ttlSeconds: options?.ttlSeconds ?? null,
|
|
242
322
|
durationMs: Date.now() - startedAt,
|
|
243
323
|
},
|
|
244
324
|
});
|
|
245
|
-
return
|
|
325
|
+
return value;
|
|
246
326
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
327
|
+
catch (error) {
|
|
328
|
+
recordCacheEvent({
|
|
329
|
+
operation: "remember.failed",
|
|
330
|
+
key,
|
|
331
|
+
summary: "Cache remember failed",
|
|
332
|
+
details: {
|
|
333
|
+
ttlSeconds: options?.ttlSeconds ?? null,
|
|
334
|
+
durationMs: Date.now() - startedAt,
|
|
335
|
+
error: errorMessage(error),
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
throw error;
|
|
250
339
|
}
|
|
251
|
-
|
|
252
|
-
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
return {
|
|
343
|
+
ports: {
|
|
344
|
+
cache,
|
|
345
|
+
redis: { client },
|
|
346
|
+
},
|
|
347
|
+
async stop() {
|
|
348
|
+
try {
|
|
349
|
+
await client.quit();
|
|
253
350
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return {
|
|
283
|
-
ports: { cache },
|
|
284
|
-
async stop() {
|
|
285
|
-
try {
|
|
286
|
-
await client.quit();
|
|
287
|
-
}
|
|
288
|
-
catch {
|
|
289
|
-
// Silently ignore errors during shutdown
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
};
|
|
293
|
-
},
|
|
294
|
-
});
|
|
351
|
+
catch {
|
|
352
|
+
// Silently ignore errors during shutdown
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Default env-backed Redis provider.
|
|
361
|
+
*
|
|
362
|
+
* Configuration via environment variables:
|
|
363
|
+
* - REDIS_URL: Redis connection URL (required)
|
|
364
|
+
* - REDIS_DB: Redis database number (optional)
|
|
365
|
+
* - REDIS_CONNECT_TIMEOUT_MS: Initial connection timeout in ms (optional)
|
|
366
|
+
* - REDIS_MAX_RETRIES_PER_REQUEST: Per-command retry limit (optional)
|
|
367
|
+
* - REDIS_CONNECT_MAX_ATTEMPTS: Connection attempts before startup fails (optional)
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* const server = await createNextServer({
|
|
372
|
+
* ports: basePorts,
|
|
373
|
+
* providers: [redisProvider],
|
|
374
|
+
* // ...
|
|
375
|
+
* });
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
export const redisProvider = createRedisProvider();
|
|
295
379
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,EACL,cAAc,EACd,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAC1C,MAAM,4BAA4B,GAAG,CAAC,CAAC;AACvC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,EAAE;KACR,KAAK,CAAC,OAAO,EAAE,wCAAwC,CAAC;KACxD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC;;;OAGG;IACH,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAErB;;;OAGG;IACH,EAAE,EAAE,YAAY,CAAC,QAAQ,EAAE;IAE3B;;;OAGG;IACH,kBAAkB,EAAE,YAAY,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAEpE;;;OAGG;IACH,uBAAuB,EAAE,YAAY,CAAC,OAAO,CAC3C,+BAA+B,CAChC;IAED;;;OAG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