@whiteplusms/dsh-redis 0.0.0-stage → 0.1.3
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/LICENSE +21 -0
- package/README.md +184 -2
- package/README.zh.md +185 -0
- package/cordis.patch.yml +4 -0
- package/icon.svg +1 -0
- package/lib/client/index.d.ts +4 -0
- package/lib/client.js +7684 -0
- package/lib/connection-errors.d.ts +66 -0
- package/lib/connection-errors.js +21 -0
- package/lib/domain.d.ts +451 -0
- package/lib/domain.js +20 -0
- package/lib/host/ai-answer.d.ts +7 -0
- package/lib/host/ai-answer.js +132 -0
- package/lib/host/ai-budget.d.ts +43 -0
- package/lib/host/ai-budget.js +78 -0
- package/lib/host/ai-connection-tools.d.ts +8 -0
- package/lib/host/ai-connection-tools.js +49 -0
- package/lib/host/ai-hash-filter.d.ts +13 -0
- package/lib/host/ai-hash-filter.js +97 -0
- package/lib/host/ai-hash-pages.d.ts +15 -0
- package/lib/host/ai-hash-pages.js +42 -0
- package/lib/host/ai-key-pages.d.ts +14 -0
- package/lib/host/ai-key-pages.js +27 -0
- package/lib/host/ai-locate-tool.d.ts +6 -0
- package/lib/host/ai-locate-tool.js +234 -0
- package/lib/host/ai-match-tools.d.ts +7 -0
- package/lib/host/ai-match-tools.js +112 -0
- package/lib/host/ai-page-coordinator.d.ts +21 -0
- package/lib/host/ai-page-coordinator.js +81 -0
- package/lib/host/ai-page-store.d.ts +40 -0
- package/lib/host/ai-page-store.js +104 -0
- package/lib/host/ai-profile-tools.d.ts +7 -0
- package/lib/host/ai-profile-tools.js +44 -0
- package/lib/host/ai-query-scope.d.ts +42 -0
- package/lib/host/ai-query-scope.js +104 -0
- package/lib/host/ai-reader.d.ts +219 -0
- package/lib/host/ai-reader.js +1221 -0
- package/lib/host/ai-report-samples.d.ts +26 -0
- package/lib/host/ai-report-samples.js +77 -0
- package/lib/host/ai-report-tools.d.ts +11 -0
- package/lib/host/ai-report-tools.js +70 -0
- package/lib/host/ai-set-pages.d.ts +15 -0
- package/lib/host/ai-set-pages.js +40 -0
- package/lib/host/ai-stream-pages.d.ts +15 -0
- package/lib/host/ai-stream-pages.js +42 -0
- package/lib/host/ai-tools.d.ts +4 -0
- package/lib/host/ai-tools.js +106 -0
- package/lib/host/ai-ui-tools.d.ts +10 -0
- package/lib/host/ai-ui-tools.js +72 -0
- package/lib/host/ai-value.d.ts +12 -0
- package/lib/host/ai-value.js +15 -0
- package/lib/host/ai-write-tools.d.ts +5 -0
- package/lib/host/ai-write-tools.js +101 -0
- package/lib/host/ai-writer.d.ts +25 -0
- package/lib/host/ai-writer.js +77 -0
- package/lib/host/ai-zset-pages.d.ts +15 -0
- package/lib/host/ai-zset-pages.js +40 -0
- package/lib/host/byte-identity.d.ts +3 -0
- package/lib/host/byte-identity.js +12 -0
- package/lib/host/client-list.d.ts +13 -0
- package/lib/host/client-list.js +35 -0
- package/lib/host/connection-service.d.ts +71 -0
- package/lib/host/connection-service.js +468 -0
- package/lib/host/database-reader.d.ts +10 -0
- package/lib/host/database-reader.js +62 -0
- package/lib/host/hash-reader.d.ts +12 -0
- package/lib/host/hash-reader.js +91 -0
- package/lib/host/key-reader.d.ts +20 -0
- package/lib/host/key-reader.js +65 -0
- package/lib/host/list-reader.d.ts +8 -0
- package/lib/host/list-reader.js +61 -0
- package/lib/host/match-preset-store.d.ts +36 -0
- package/lib/host/match-preset-store.js +201 -0
- package/lib/host/profile-snapshots.d.ts +32 -0
- package/lib/host/profile-snapshots.js +187 -0
- package/lib/host/profile-store.d.ts +15 -0
- package/lib/host/profile-store.js +120 -0
- package/lib/host/read-context.d.ts +23 -0
- package/lib/host/read-context.js +41 -0
- package/lib/host/redis-transport.d.ts +34 -0
- package/lib/host/redis-transport.js +262 -0
- package/lib/host/redis-write-transaction.d.ts +28 -0
- package/lib/host/redis-write-transaction.js +180 -0
- package/lib/host/resp.d.ts +38 -0
- package/lib/host/resp.js +174 -0
- package/lib/host/scan-cursors.d.ts +25 -0
- package/lib/host/scan-cursors.js +59 -0
- package/lib/host/selected-reader.d.ts +22 -0
- package/lib/host/selected-reader.js +84 -0
- package/lib/host/set-reader.d.ts +12 -0
- package/lib/host/set-reader.js +85 -0
- package/lib/host/stream-groups.d.ts +17 -0
- package/lib/host/stream-groups.js +42 -0
- package/lib/host/stream-reader.d.ts +12 -0
- package/lib/host/stream-reader.js +105 -0
- package/lib/host/string-reader.d.ts +9 -0
- package/lib/host/string-reader.js +81 -0
- package/lib/host/ui-action-channel.d.ts +4 -0
- package/lib/host/ui-action-channel.js +182 -0
- package/lib/host/ui-action-coordinator.d.ts +28 -0
- package/lib/host/ui-action-coordinator.js +188 -0
- package/lib/host/value-prefix.d.ts +5 -0
- package/lib/host/value-prefix.js +11 -0
- package/lib/host/write-bytes.d.ts +3 -0
- package/lib/host/write-bytes.js +9 -0
- package/lib/host/write-history.d.ts +18 -0
- package/lib/host/write-history.js +79 -0
- package/lib/host/write-proposals.d.ts +46 -0
- package/lib/host/write-proposals.js +132 -0
- package/lib/host/zset-reader.d.ts +12 -0
- package/lib/host/zset-reader.js +103 -0
- package/lib/host/zset-values.d.ts +6 -0
- package/lib/host/zset-values.js +26 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +5 -0
- package/lib/redis-answer.d.ts +32 -0
- package/lib/redis-answer.js +215 -0
- package/lib/redis-databases.d.ts +3 -0
- package/lib/redis-databases.js +21 -0
- package/lib/redis-read-tools.d.ts +2 -0
- package/lib/redis-read-tools.js +7 -0
- package/lib/redis-result.d.ts +4 -0
- package/lib/redis-result.js +18 -0
- package/lib/redis-score.d.ts +2 -0
- package/lib/redis-score.js +6 -0
- package/lib/remote-service.d.ts +69 -0
- package/lib/remote-service.js +187 -0
- package/lib/runtime.d.ts +3 -0
- package/lib/runtime.js +29 -0
- package/lib/stream-id.d.ts +7 -0
- package/lib/stream-id.js +19 -0
- package/lib/typert.host.d.ts +13 -0
- package/lib/typert.host.js +7 -0
- package/lib/typert.remote-client.d.ts +98 -0
- package/lib/typert.remote-client.js +3 -0
- package/lib/typert.shared.d.ts +62 -0
- package/lib/typert.shared.js +735 -0
- package/lib/ui-action-selection.d.ts +3 -0
- package/lib/ui-action-selection.js +12 -0
- package/licenses/THIRD_PARTY_NOTICES.txt +9 -0
- package/licenses/deepseek-harness-MIT.txt +21 -0
- package/licenses/dsh-database-MIT.txt +21 -0
- package/licenses/dsh-git-graph-MIT.txt +21 -0
- package/licenses/lucide-react-LICENSE.txt +43 -0
- package/licenses/phosphor-icons-MIT.txt +21 -0
- package/package.json +132 -3
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
/** Standalone connection lifecycle adapted from Database's Redis open/close paths. */
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { RedisTransport, RedisTransportError } from "./redis-transport.js";
|
|
4
|
+
import { RedisFrameError, RedisReplyError } from "./resp.js";
|
|
5
|
+
import { profileCollectionSchema } from "../typert.shared.js";
|
|
6
|
+
export class ConnectionFailure extends Error {
|
|
7
|
+
code;
|
|
8
|
+
constructor(code) {
|
|
9
|
+
super(code);
|
|
10
|
+
this.code = code;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Map server messages to fixed public codes, never echoing host, URI or secrets. */
|
|
14
|
+
export function connectionErrorCode(error) {
|
|
15
|
+
if (error instanceof ConnectionFailure || error instanceof RedisTransportError || error instanceof RedisFrameError)
|
|
16
|
+
return error.code;
|
|
17
|
+
if (error instanceof Error && /^(NOPERM|DENIED)(?: |$)/u.test(error.message))
|
|
18
|
+
return 'permission';
|
|
19
|
+
if (error instanceof RedisReplyError && /^WRONGTYPE(?: |$)/u.test(error.message))
|
|
20
|
+
return 'type-changed';
|
|
21
|
+
if (error instanceof RedisReplyError && /^ERR DB index is out of range/u.test(error.message))
|
|
22
|
+
return 'database';
|
|
23
|
+
const code = error instanceof Error && 'code' in error && typeof error.code === 'string' ? error.code : '';
|
|
24
|
+
if (code === 'ERR_TLS_CERT_ALTNAME_INVALID')
|
|
25
|
+
return 'tls-hostname';
|
|
26
|
+
if (/^(ERR_TLS_|ERR_SSL_|ERR_OSSL_)|CERT_|SELF_SIGNED|UNABLE_TO_(GET_ISSUER|VERIFY_LEAF)/u.test(code))
|
|
27
|
+
return 'tls-certificate';
|
|
28
|
+
if (error instanceof Error && /^(?:(?:WRONGPASS|NOAUTH)(?: |$)|ERR AUTH(?: |$))/u.test(error.message))
|
|
29
|
+
return 'auth';
|
|
30
|
+
return 'network';
|
|
31
|
+
}
|
|
32
|
+
/** Authentication, TLS and bounded replies share one owned socket; no reconnect. */
|
|
33
|
+
export const openRedis = async (settings, signal) => {
|
|
34
|
+
const transport = await RedisTransport.open(settings, signal);
|
|
35
|
+
const link = {
|
|
36
|
+
close: () => { transport.close(); },
|
|
37
|
+
execute: (command, arguments_, requestSignal, beforeDispatch, deadline) => transport.execute(command, arguments_, requestSignal, beforeDispatch, deadline),
|
|
38
|
+
sampleExisting: (request, requestSignal, guard) => transport.sampleExisting(request, requestSignal, guard),
|
|
39
|
+
replaceExisting: (request, requestSignal, guard, submitted, readback) => transport.replaceExisting(request, requestSignal, guard, submitted, readback),
|
|
40
|
+
onFailure: listener => transport.onFailure(error => { listener(connectionErrorCode(error)); }),
|
|
41
|
+
};
|
|
42
|
+
return link;
|
|
43
|
+
};
|
|
44
|
+
/** Abort waiting even if an injected operation ignores its signal; dispose late results. */
|
|
45
|
+
function waitFor(operation, signal, onLate) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
let settled = false;
|
|
48
|
+
const abort = () => { if (!settled) {
|
|
49
|
+
settled = true;
|
|
50
|
+
reject(new ConnectionFailure('cancelled'));
|
|
51
|
+
} };
|
|
52
|
+
if (signal.aborted)
|
|
53
|
+
abort();
|
|
54
|
+
else
|
|
55
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
56
|
+
operation.then(value => {
|
|
57
|
+
if (settled) {
|
|
58
|
+
onLate?.(value);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
settled = true;
|
|
62
|
+
signal.removeEventListener('abort', abort);
|
|
63
|
+
resolve(value);
|
|
64
|
+
}, error => {
|
|
65
|
+
if (settled)
|
|
66
|
+
return;
|
|
67
|
+
settled = true;
|
|
68
|
+
signal.removeEventListener('abort', abort);
|
|
69
|
+
reject(error);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** One current connection per trusted session; hiding/reopening a pane does not open another. */
|
|
74
|
+
export class RedisConnections {
|
|
75
|
+
open;
|
|
76
|
+
sessions = new Map();
|
|
77
|
+
candidates = new Map();
|
|
78
|
+
unreleased = new Set();
|
|
79
|
+
generation = 0;
|
|
80
|
+
constructor(open = openRedis) {
|
|
81
|
+
this.open = open;
|
|
82
|
+
}
|
|
83
|
+
view(record) {
|
|
84
|
+
return { id: record.id, generation: record.generation, db: record.db, state: record.state, error: record.error, target: record.target };
|
|
85
|
+
}
|
|
86
|
+
release(record) {
|
|
87
|
+
// Each operation is independent: a broken listener must not prevent socket closure.
|
|
88
|
+
const unsubscribe = record.unsubscribe;
|
|
89
|
+
delete record.unsubscribe;
|
|
90
|
+
if (unsubscribe !== undefined) {
|
|
91
|
+
try {
|
|
92
|
+
unsubscribe();
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
record.unsubscribe = unsubscribe;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const link = record.link;
|
|
99
|
+
delete record.link;
|
|
100
|
+
if (link !== undefined) {
|
|
101
|
+
try {
|
|
102
|
+
link.close();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
record.link = link;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (record.unsubscribe !== undefined || record.link !== undefined) {
|
|
109
|
+
this.unreleased.add(record);
|
|
110
|
+
console.warn('[dsh-redis] Redis connection release uncertain');
|
|
111
|
+
return 'uncertain';
|
|
112
|
+
}
|
|
113
|
+
this.unreleased.delete(record);
|
|
114
|
+
return 'closed';
|
|
115
|
+
}
|
|
116
|
+
close(record) {
|
|
117
|
+
record.cancellation.abort();
|
|
118
|
+
const released = this.release(record);
|
|
119
|
+
record.state = 'disconnected';
|
|
120
|
+
record.error = null;
|
|
121
|
+
return released;
|
|
122
|
+
}
|
|
123
|
+
cancelCandidate(sessionId) {
|
|
124
|
+
const candidate = this.candidates.get(sessionId);
|
|
125
|
+
if (candidate !== undefined) {
|
|
126
|
+
this.candidates.delete(sessionId);
|
|
127
|
+
candidate.abort();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Internal preparation only: the gate owns authorization and must call commit synchronously. */
|
|
131
|
+
async connectCandidate(sessionId, settings, signal, gate, preflight, beforeExchange = () => undefined) {
|
|
132
|
+
signal.throwIfAborted();
|
|
133
|
+
if (this.status(sessionId).state === 'connecting')
|
|
134
|
+
return { state: 'failed', error: 'stale' };
|
|
135
|
+
this.cancelCandidate(sessionId);
|
|
136
|
+
const controller = new AbortController();
|
|
137
|
+
this.candidates.set(sessionId, controller);
|
|
138
|
+
const combined = AbortSignal.any([signal, controller.signal]);
|
|
139
|
+
const previous = this.sessions.get(sessionId);
|
|
140
|
+
const previousView = this.status(sessionId);
|
|
141
|
+
const snapshot = { ...settings, tls: settings.tls === null ? null : { ...settings.tls } };
|
|
142
|
+
const resources = {};
|
|
143
|
+
let failure;
|
|
144
|
+
let promoted;
|
|
145
|
+
let committed;
|
|
146
|
+
let gateActive = true;
|
|
147
|
+
const cleanup = () => { this.release(resources); };
|
|
148
|
+
const committedResult = () => {
|
|
149
|
+
if (committed === undefined || committed.state === 'failed')
|
|
150
|
+
return undefined;
|
|
151
|
+
// Exchange and later connection failure/replacement are separate facts.
|
|
152
|
+
return this.isCurrentView(sessionId, committed.view) ? committed : { ...committed, state: 'changed', view: this.status(sessionId) };
|
|
153
|
+
};
|
|
154
|
+
combined.addEventListener('abort', cleanup, { once: true });
|
|
155
|
+
try {
|
|
156
|
+
// Register this candidate before an asynchronous preflight so newer user
|
|
157
|
+
// actions can cancel it; a preflight mismatch prevents opening the socket.
|
|
158
|
+
const check = preflight(combined);
|
|
159
|
+
const permitted = typeof check === 'boolean' ? check : await waitFor(check, combined);
|
|
160
|
+
if (!permitted || combined.aborted)
|
|
161
|
+
return { state: 'failed', error: signal.aborted ? 'cancelled' : failure ?? 'stale' };
|
|
162
|
+
resources.link = await waitFor(this.open(snapshot, combined), combined, link => {
|
|
163
|
+
// A late opener may finish after dispose has already retried its known resources.
|
|
164
|
+
// Give this newly arrived socket its own bounded retry, retaining failures.
|
|
165
|
+
const late = { link };
|
|
166
|
+
if (this.release(late) === 'uncertain')
|
|
167
|
+
this.release(late);
|
|
168
|
+
});
|
|
169
|
+
// An opener can ignore cancellation and return a late socket.
|
|
170
|
+
if (combined.aborted)
|
|
171
|
+
return { state: 'failed', error: signal.aborted ? 'cancelled' : failure ?? 'stale' };
|
|
172
|
+
resources.unsubscribe = resources.link.onFailure(code => {
|
|
173
|
+
if (promoted !== undefined) {
|
|
174
|
+
if (this.sessions.get(sessionId) !== promoted || promoted.cancellation.signal.aborted)
|
|
175
|
+
return;
|
|
176
|
+
this.release(promoted);
|
|
177
|
+
promoted.state = 'error';
|
|
178
|
+
promoted.error = code;
|
|
179
|
+
console.info('[dsh-redis] Redis connection lost');
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
failure = code;
|
|
183
|
+
controller.abort();
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
if (combined.aborted)
|
|
187
|
+
return { state: 'failed', error: signal.aborted ? 'cancelled' : failure ?? 'stale' };
|
|
188
|
+
await waitFor(gate(combined, () => {
|
|
189
|
+
if (!gateActive || committed !== undefined || combined.aborted || resources.link === undefined)
|
|
190
|
+
return undefined;
|
|
191
|
+
const current = this.status(sessionId);
|
|
192
|
+
if (current.state === 'connecting' || this.candidates.get(sessionId) !== controller || this.sessions.get(sessionId) !== previous || current.id !== previousView.id || current.generation !== previousView.generation || current.db !== previousView.db || current.state !== previousView.state || current.error !== previousView.error)
|
|
193
|
+
return undefined;
|
|
194
|
+
// The gate's synchronous callback contains both the final CAS and exchange.
|
|
195
|
+
const record = {
|
|
196
|
+
id: previous?.id ?? randomUUID(), generation: ++this.generation, db: 0,
|
|
197
|
+
target: { host: snapshot.host, port: snapshot.port, username: snapshot.username, ...(snapshot.environment === undefined ? {} : { environment: snapshot.environment }), tls: snapshot.tls !== null },
|
|
198
|
+
cancellation: new AbortController(), state: 'connected', error: null, link: resources.link,
|
|
199
|
+
...(resources.unsubscribe === undefined ? {} : { unsubscribe: resources.unsubscribe }),
|
|
200
|
+
};
|
|
201
|
+
// Clear the old target's owned state in the same synchronous exchange;
|
|
202
|
+
// if cleanup fails, the old connection stays in place.
|
|
203
|
+
beforeExchange();
|
|
204
|
+
promoted = record;
|
|
205
|
+
this.sessions.set(sessionId, record);
|
|
206
|
+
delete resources.link;
|
|
207
|
+
delete resources.unsubscribe;
|
|
208
|
+
this.candidates.delete(sessionId);
|
|
209
|
+
// Report the actual exchange even if later resource release fails unexpectedly.
|
|
210
|
+
committed = { state: 'connected', view: this.view(record), previousRelease: 'uncertain' };
|
|
211
|
+
const previousRelease = previous === undefined ? 'closed' : this.close(previous);
|
|
212
|
+
committed = { state: 'connected', view: this.view(record), previousRelease };
|
|
213
|
+
console.info('[dsh-redis] Redis connected');
|
|
214
|
+
return undefined;
|
|
215
|
+
}), combined);
|
|
216
|
+
return committedResult() ?? { state: 'failed', error: signal.aborted ? 'cancelled' : failure ?? 'stale' };
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
return committedResult() ?? { state: 'failed', error: signal.aborted ? 'cancelled' : failure ?? (controller.signal.aborted ? 'stale' : connectionErrorCode(error)) };
|
|
220
|
+
}
|
|
221
|
+
finally {
|
|
222
|
+
gateActive = false;
|
|
223
|
+
combined.removeEventListener('abort', cleanup);
|
|
224
|
+
cleanup();
|
|
225
|
+
if (this.candidates.get(sessionId) === controller)
|
|
226
|
+
this.candidates.delete(sessionId);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/** Bind candidate settings to the same normalized profile verified at commit. */
|
|
230
|
+
connectProfileCandidate(sessionId, profile, password, signal, profiles, beforeExchange = () => undefined) {
|
|
231
|
+
const expected = profileCollectionSchema.parse({ profiles: [profile], selectedId: null }).profiles[0];
|
|
232
|
+
return this.connectCandidate(sessionId, { ...expected.settings, password }, signal, (candidateSignal, commit) => profiles.withVerifiedProfile(expected, candidateSignal, commit), candidateSignal => profiles.withVerifiedProfile(expected, candidateSignal, () => undefined), beforeExchange);
|
|
233
|
+
}
|
|
234
|
+
async connect(sessionId, settings, signal) {
|
|
235
|
+
signal.throwIfAborted();
|
|
236
|
+
this.cancelCandidate(sessionId);
|
|
237
|
+
const previous = this.sessions.get(sessionId);
|
|
238
|
+
if (previous !== undefined)
|
|
239
|
+
this.close(previous);
|
|
240
|
+
const record = {
|
|
241
|
+
id: previous?.id ?? randomUUID(), generation: ++this.generation, db: 0,
|
|
242
|
+
target: { host: settings.host, port: settings.port, username: settings.username, ...(settings.environment === undefined ? {} : { environment: settings.environment }), tls: settings.tls !== null },
|
|
243
|
+
cancellation: new AbortController(), state: 'connecting', error: null,
|
|
244
|
+
};
|
|
245
|
+
this.sessions.set(sessionId, record);
|
|
246
|
+
const current = () => this.sessions.get(sessionId) === record && !record.cancellation.signal.aborted;
|
|
247
|
+
try {
|
|
248
|
+
const link = await this.open(settings, AbortSignal.any([signal, record.cancellation.signal]));
|
|
249
|
+
if (!current()) {
|
|
250
|
+
link.close();
|
|
251
|
+
return { ...this.view(record), state: 'error', error: 'stale' };
|
|
252
|
+
}
|
|
253
|
+
if (signal.aborted) {
|
|
254
|
+
link.close();
|
|
255
|
+
record.state = 'error';
|
|
256
|
+
record.error = 'cancelled';
|
|
257
|
+
return this.view(record);
|
|
258
|
+
}
|
|
259
|
+
record.link = link;
|
|
260
|
+
record.state = 'connected';
|
|
261
|
+
record.unsubscribe = link.onFailure(code => {
|
|
262
|
+
if (!current())
|
|
263
|
+
return;
|
|
264
|
+
this.release(record);
|
|
265
|
+
record.state = 'error';
|
|
266
|
+
record.error = code;
|
|
267
|
+
console.info('[dsh-redis] Redis connection lost');
|
|
268
|
+
});
|
|
269
|
+
console.info('[dsh-redis] Redis connected');
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
if (!current())
|
|
273
|
+
return { ...this.view(record), state: 'error', error: 'stale' };
|
|
274
|
+
record.state = 'error';
|
|
275
|
+
record.error = signal.aborted ? 'cancelled' : connectionErrorCode(error);
|
|
276
|
+
}
|
|
277
|
+
return this.view(record);
|
|
278
|
+
}
|
|
279
|
+
status(sessionId) {
|
|
280
|
+
const record = this.sessions.get(sessionId);
|
|
281
|
+
return record === undefined ? { id: null, generation: 0, db: 0, state: 'disconnected', error: null, target: null } : this.view(record);
|
|
282
|
+
}
|
|
283
|
+
/** A completed operation may have been superseded before its caller resumes. */
|
|
284
|
+
isCurrentView(sessionId, view) {
|
|
285
|
+
const current = this.status(sessionId);
|
|
286
|
+
return view.error !== 'stale' && current.id === view.id && current.generation === view.generation && current.db === view.db && current.state === view.state && current.error === view.error;
|
|
287
|
+
}
|
|
288
|
+
require(sessionId, target) {
|
|
289
|
+
const record = this.sessions.get(sessionId);
|
|
290
|
+
if (record === undefined || record.id !== target.id || record.generation !== target.generation || record.state !== 'connected' || record.link === undefined)
|
|
291
|
+
throw new ConnectionFailure('stale');
|
|
292
|
+
return record;
|
|
293
|
+
}
|
|
294
|
+
assertTarget(sessionId, target) {
|
|
295
|
+
if (this.require(sessionId, target).db !== target.db)
|
|
296
|
+
throw new ConnectionFailure('stale');
|
|
297
|
+
}
|
|
298
|
+
/** A failed read may still describe this exact connection after it has failed. */
|
|
299
|
+
isFailedTarget(sessionId, target, error) {
|
|
300
|
+
const current = this.status(sessionId);
|
|
301
|
+
return current.state === 'error' && current.id === target.id && current.generation === target.generation && current.db === target.db && (error === undefined || current.error === error);
|
|
302
|
+
}
|
|
303
|
+
assertReadResult(sessionId, target, error) {
|
|
304
|
+
if (error !== null && error !== 'stale' && this.isFailedTarget(sessionId, target, error))
|
|
305
|
+
return;
|
|
306
|
+
this.assertTarget(sessionId, target);
|
|
307
|
+
}
|
|
308
|
+
/** Validate again after queueing and after receipt: SELECT cannot mix old DB results. */
|
|
309
|
+
async read(sessionId, target, command, arguments_, signal, validate = () => undefined, deadline) {
|
|
310
|
+
const guard = () => {
|
|
311
|
+
signal.throwIfAborted();
|
|
312
|
+
const record = this.require(sessionId, target);
|
|
313
|
+
if (record.db !== target.db)
|
|
314
|
+
throw new ConnectionFailure('stale');
|
|
315
|
+
validate();
|
|
316
|
+
return record;
|
|
317
|
+
};
|
|
318
|
+
try {
|
|
319
|
+
// SELECT must advance the session generation through selectDatabase,
|
|
320
|
+
// even if an untyped caller bypasses the compile-time command union.
|
|
321
|
+
if (command === 'SELECT')
|
|
322
|
+
throw new ConnectionFailure('protocol');
|
|
323
|
+
const record = guard();
|
|
324
|
+
const value = await record.link.execute(command, arguments_, signal, guard, deadline);
|
|
325
|
+
guard();
|
|
326
|
+
return value;
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
// Readers classify command-specific refusals before mapping them to fixed
|
|
330
|
+
// DTO states. Preserve them only inside Host, after rechecking ownership.
|
|
331
|
+
if (!signal.aborted && error instanceof RedisReplyError) {
|
|
332
|
+
guard();
|
|
333
|
+
throw error;
|
|
334
|
+
}
|
|
335
|
+
throw new ConnectionFailure(signal.aborted ? 'cancelled' : connectionErrorCode(error));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/** Keep the original result even if the connection changes after submission. */
|
|
339
|
+
async sampleExisting(sessionId, target, request, signal, validate) {
|
|
340
|
+
signal.throwIfAborted();
|
|
341
|
+
const record = this.require(sessionId, target);
|
|
342
|
+
if (record.db !== target.db || !('sampleExisting' in record.link) || typeof record.link.sampleExisting !== 'function')
|
|
343
|
+
throw new ConnectionFailure('stale');
|
|
344
|
+
const link = record.link;
|
|
345
|
+
const guard = () => {
|
|
346
|
+
signal.throwIfAborted();
|
|
347
|
+
const current = this.require(sessionId, target);
|
|
348
|
+
if (current !== record || current.db !== target.db)
|
|
349
|
+
throw new ConnectionFailure('stale');
|
|
350
|
+
validate();
|
|
351
|
+
};
|
|
352
|
+
guard();
|
|
353
|
+
const result = await link.sampleExisting(request, signal, guard);
|
|
354
|
+
guard();
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
/** Keep the original result even if the connection changes after submission. */
|
|
358
|
+
async replaceExisting(sessionId, target, request, signal, validate, submitted, readback) {
|
|
359
|
+
let wasSubmitted = false;
|
|
360
|
+
try {
|
|
361
|
+
signal.throwIfAborted();
|
|
362
|
+
const record = this.require(sessionId, target);
|
|
363
|
+
if (record.db !== target.db || !('replaceExisting' in record.link) || typeof record.link.replaceExisting !== 'function')
|
|
364
|
+
return 'not-executed';
|
|
365
|
+
const link = record.link;
|
|
366
|
+
const guard = (afterSubmission) => {
|
|
367
|
+
const current = this.require(sessionId, target);
|
|
368
|
+
if (current !== record || current.db !== target.db)
|
|
369
|
+
throw new ConnectionFailure('stale');
|
|
370
|
+
if (!afterSubmission)
|
|
371
|
+
validate();
|
|
372
|
+
};
|
|
373
|
+
guard(false);
|
|
374
|
+
return await link.replaceExisting(request, signal, guard, () => { submitted(); wasSubmitted = true; }, readback);
|
|
375
|
+
}
|
|
376
|
+
catch {
|
|
377
|
+
return wasSubmitted ? 'unknown' : 'not-executed';
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
async selectDatabase(sessionId, target, signal, onInvalidate = () => undefined) {
|
|
381
|
+
let record;
|
|
382
|
+
let operationGeneration;
|
|
383
|
+
try {
|
|
384
|
+
signal.throwIfAborted();
|
|
385
|
+
const connected = this.require(sessionId, target);
|
|
386
|
+
this.cancelCandidate(sessionId);
|
|
387
|
+
record = connected;
|
|
388
|
+
if (record.db === target.db) {
|
|
389
|
+
record.error = null;
|
|
390
|
+
return this.view(record);
|
|
391
|
+
}
|
|
392
|
+
// Invalidate queued/current reads before SELECT; only this session owns the socket.
|
|
393
|
+
const generation = ++this.generation;
|
|
394
|
+
record.generation = generation;
|
|
395
|
+
record.state = 'connecting';
|
|
396
|
+
record.error = null;
|
|
397
|
+
operationGeneration = generation;
|
|
398
|
+
// Clear old per-session state before another selection can be accepted.
|
|
399
|
+
onInvalidate();
|
|
400
|
+
const guard = () => {
|
|
401
|
+
signal.throwIfAborted();
|
|
402
|
+
if (this.sessions.get(sessionId) !== connected || connected.generation !== generation || connected.state !== 'connecting')
|
|
403
|
+
throw new ConnectionFailure('stale');
|
|
404
|
+
};
|
|
405
|
+
const reply = await connected.link.execute('SELECT', [String(target.db)], signal, guard);
|
|
406
|
+
guard();
|
|
407
|
+
if (reply !== 'OK')
|
|
408
|
+
throw new RedisFrameError('protocol');
|
|
409
|
+
connected.db = target.db;
|
|
410
|
+
connected.state = 'connected';
|
|
411
|
+
return this.view(connected);
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
const code = signal.aborted ? 'cancelled' : connectionErrorCode(error);
|
|
415
|
+
if (record === undefined)
|
|
416
|
+
return { ...this.status(sessionId), error: code };
|
|
417
|
+
// A late result cannot change a replacement or a manually disconnected
|
|
418
|
+
// connection; preserve a transport failure already recorded by onFailure.
|
|
419
|
+
if (this.sessions.get(sessionId) !== record || record.generation !== operationGeneration)
|
|
420
|
+
return { ...this.status(sessionId), error: 'stale' };
|
|
421
|
+
if (record.state === 'error' && record.error !== null)
|
|
422
|
+
return this.view(record);
|
|
423
|
+
if (record.state !== 'connecting')
|
|
424
|
+
return { ...this.status(sessionId), error: 'stale' };
|
|
425
|
+
if (error instanceof RedisReplyError && (code === 'permission' || code === 'database')) {
|
|
426
|
+
// A fully framed Redis refusal leaves the prior selected database unchanged.
|
|
427
|
+
record.state = 'connected';
|
|
428
|
+
record.error = code;
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
// Cancellation after SELECT dispatch makes DB state uncertain; discard our socket.
|
|
432
|
+
record.cancellation.abort();
|
|
433
|
+
this.release(record);
|
|
434
|
+
record.state = 'error';
|
|
435
|
+
record.error = code;
|
|
436
|
+
}
|
|
437
|
+
return this.view(record);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
disconnect(sessionId, target) {
|
|
441
|
+
const record = this.sessions.get(sessionId);
|
|
442
|
+
if (record === undefined) {
|
|
443
|
+
// A first connection can be in flight before a live record exists.
|
|
444
|
+
this.cancelCandidate(sessionId);
|
|
445
|
+
return this.status(sessionId);
|
|
446
|
+
}
|
|
447
|
+
if (record.id !== target.id || record.generation !== target.generation)
|
|
448
|
+
return { ...this.view(record), error: 'stale' };
|
|
449
|
+
this.cancelCandidate(sessionId);
|
|
450
|
+
this.close(record);
|
|
451
|
+
console.info('[dsh-redis] Redis disconnected');
|
|
452
|
+
return this.view(record);
|
|
453
|
+
}
|
|
454
|
+
disposeSession(sessionId) {
|
|
455
|
+
this.cancelCandidate(sessionId);
|
|
456
|
+
const record = this.sessions.get(sessionId);
|
|
457
|
+
this.sessions.delete(sessionId);
|
|
458
|
+
if (record !== undefined)
|
|
459
|
+
this.close(record);
|
|
460
|
+
}
|
|
461
|
+
dispose() {
|
|
462
|
+
for (const sessionId of new Set([...this.sessions.keys(), ...this.candidates.keys()]))
|
|
463
|
+
this.disposeSession(sessionId);
|
|
464
|
+
// Retry only resources retained after a failed release; never touch other sessions.
|
|
465
|
+
for (const record of [...this.unreleased])
|
|
466
|
+
this.release(record);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DatabasesReadRequest, type DatabasesReadResult } from '../domain.js';
|
|
2
|
+
import type { RedisConnections } from './connection-service.js';
|
|
3
|
+
/** Three fixed reads share one owner/DB guard and one absolute deadline.
|
|
4
|
+
* ACL/disabled metadata is optional; transport and invalid replies are failures.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RedisDatabases {
|
|
7
|
+
private readonly connections;
|
|
8
|
+
constructor(connections: RedisConnections);
|
|
9
|
+
read(sessionId: string, request: DatabasesReadRequest, signal: AbortSignal): Promise<DatabasesReadResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MAX_INFO_BYTES } from "../domain.js";
|
|
2
|
+
import { parseDatabaseKeyspace } from "../redis-databases.js";
|
|
3
|
+
import { RedisFrameError, RedisReplyError } from "./resp.js";
|
|
4
|
+
import { RedisReadContext } from "./read-context.js";
|
|
5
|
+
/** Three fixed reads share one owner/DB guard and one absolute deadline.
|
|
6
|
+
* ACL/disabled metadata is optional; transport and invalid replies are failures.
|
|
7
|
+
*/
|
|
8
|
+
export class RedisDatabases {
|
|
9
|
+
connections;
|
|
10
|
+
constructor(connections) {
|
|
11
|
+
this.connections = connections;
|
|
12
|
+
}
|
|
13
|
+
async read(sessionId, request, signal) {
|
|
14
|
+
const context = new RedisReadContext(this.connections, sessionId, request.target, signal);
|
|
15
|
+
const optional = async (command, args) => {
|
|
16
|
+
try {
|
|
17
|
+
return await context.command(command, args);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof RedisReplyError && /^(?:NOPERM|ERR unknown command|ERR unknown subcommand)/iu.test(error.message))
|
|
21
|
+
return undefined;
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
const size = await optional('DBSIZE', []);
|
|
27
|
+
if (size !== undefined && (typeof size !== 'bigint' || size < 0n || size > (1n << 63n) - 1n))
|
|
28
|
+
throw new RedisFrameError('protocol');
|
|
29
|
+
const info = await optional('INFO', ['keyspace']);
|
|
30
|
+
let keyspace = null;
|
|
31
|
+
if (info !== undefined) {
|
|
32
|
+
if (!Buffer.isBuffer(info))
|
|
33
|
+
throw new RedisFrameError('protocol');
|
|
34
|
+
if (info.length > MAX_INFO_BYTES)
|
|
35
|
+
throw new RedisFrameError('oversize');
|
|
36
|
+
try {
|
|
37
|
+
keyspace = parseDatabaseKeyspace(new TextDecoder('utf-8', { fatal: true }).decode(info));
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new RedisFrameError(error instanceof RangeError ? 'oversize' : 'protocol');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const config = await optional('CONFIG', ['GET', 'databases']);
|
|
44
|
+
let databaseCount = null;
|
|
45
|
+
if (config !== undefined) {
|
|
46
|
+
if (!Array.isArray(config) || config.length !== 2 || !Buffer.isBuffer(config[0]) || !config[0].equals(Buffer.from('databases')) || !Buffer.isBuffer(config[1]) || !/^[1-9]\d{0,4}$/u.test(config[1].toString('utf8')))
|
|
47
|
+
throw new RedisFrameError('protocol');
|
|
48
|
+
databaseCount = Number(config[1].toString('utf8'));
|
|
49
|
+
if (databaseCount > 65536 || request.target.db >= databaseCount || keyspace?.some(item => item.db >= databaseCount))
|
|
50
|
+
throw new RedisFrameError('protocol');
|
|
51
|
+
}
|
|
52
|
+
context.signal.throwIfAborted();
|
|
53
|
+
return { state: 'value', error: null, catalog: { databaseCount, keyspace, currentKeys: size === undefined ? null : String(size) }, sampledAt: new Date().toISOString() };
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return { state: 'failed', error: context.error(error), catalog: null, sampledAt: new Date().toISOString() };
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
context.dispose();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ScanHashRequest, type ScanHashResult } from '../domain.js';
|
|
2
|
+
import type { RedisConnections } from './connection-service.js';
|
|
3
|
+
/** One HSCAN per explicit action. COUNT is a hint, never a memory guarantee. */
|
|
4
|
+
export declare class RedisHashes {
|
|
5
|
+
private readonly connections;
|
|
6
|
+
private readonly retryCancelled;
|
|
7
|
+
private readonly scans;
|
|
8
|
+
constructor(connections: RedisConnections, retryCancelled?: boolean);
|
|
9
|
+
disposeSession(sessionId: string): void;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
scan(sessionId: string, request: ScanHashRequest, signal: AbortSignal): Promise<ScanHashResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { MAX_KEY_BYTES, MAX_SCAN_KEYS, MAX_SCAN_JSON_BYTES } from "../domain.js";
|
|
2
|
+
import { RedisFrameError } from "./resp.js";
|
|
3
|
+
import { RedisReadContext } from "./read-context.js";
|
|
4
|
+
import { RedisScanCursors, scanReply } from "./scan-cursors.js";
|
|
5
|
+
import { byteIdentity } from "./byte-identity.js";
|
|
6
|
+
import { valuePrefix } from "./value-prefix.js";
|
|
7
|
+
/** One HSCAN per explicit action. COUNT is a hint, never a memory guarantee. */
|
|
8
|
+
export class RedisHashes {
|
|
9
|
+
connections;
|
|
10
|
+
retryCancelled;
|
|
11
|
+
scans = new RedisScanCursors();
|
|
12
|
+
constructor(connections, retryCancelled = false) {
|
|
13
|
+
this.connections = connections;
|
|
14
|
+
this.retryCancelled = retryCancelled;
|
|
15
|
+
}
|
|
16
|
+
disposeSession(sessionId) { this.scans.disposeSession(sessionId); }
|
|
17
|
+
dispose() { this.scans.dispose(); }
|
|
18
|
+
async scan(sessionId, request, signal) {
|
|
19
|
+
let scan;
|
|
20
|
+
const context = new RedisReadContext(this.connections, sessionId, request.target, signal, () => { if (scan !== undefined)
|
|
21
|
+
this.scans.validate(sessionId, scan); });
|
|
22
|
+
const result = (state, error = null, metadata = null) => ({ state, error, metadata, entries: [], cursor: null, sampledAt: new Date().toISOString() });
|
|
23
|
+
try {
|
|
24
|
+
signal.throwIfAborted();
|
|
25
|
+
this.connections.assertTarget(sessionId, request.target);
|
|
26
|
+
scan = this.scans.begin(sessionId, JSON.stringify([request.target.id, request.target.generation, request.target.db, request.keyBase64, request.pattern]), request.cursor);
|
|
27
|
+
const key = Buffer.from(request.keyBase64, 'base64'), firstType = await context.type(key);
|
|
28
|
+
if (firstType === 'none')
|
|
29
|
+
return result('missing');
|
|
30
|
+
const firstTtl = await context.ttl(key);
|
|
31
|
+
if (firstTtl === -2n)
|
|
32
|
+
return result('missing');
|
|
33
|
+
if (firstType !== 'hash')
|
|
34
|
+
return result('unsupported', null, { type: firstType, ttlMs: String(firstTtl), length: null });
|
|
35
|
+
const length = await context.integer('HLEN', [key]);
|
|
36
|
+
const reply = await context.command('HSCAN', [key, scan.cursor, 'MATCH', request.pattern, 'COUNT', '100']);
|
|
37
|
+
const { cursor, values } = scanReply(reply);
|
|
38
|
+
if (values.length % 2 !== 0)
|
|
39
|
+
throw new RedisFrameError('protocol');
|
|
40
|
+
if (values.length / 2 > MAX_SCAN_KEYS)
|
|
41
|
+
throw new RedisFrameError('oversize');
|
|
42
|
+
const entries = new Map();
|
|
43
|
+
for (let index = 0; index < values.length; index += 2) {
|
|
44
|
+
const field = values[index], value = values[index + 1];
|
|
45
|
+
if (!Buffer.isBuffer(field) || !Buffer.isBuffer(value))
|
|
46
|
+
throw new RedisFrameError('protocol');
|
|
47
|
+
if (field.length > MAX_KEY_BYTES)
|
|
48
|
+
throw new RedisFrameError('oversize');
|
|
49
|
+
const identity = byteIdentity(field);
|
|
50
|
+
entries.set(identity.base64, { field: identity, value: valuePrefix(value) });
|
|
51
|
+
}
|
|
52
|
+
const secondType = await context.type(key);
|
|
53
|
+
if (secondType === 'none')
|
|
54
|
+
return result('missing');
|
|
55
|
+
if (secondType !== 'hash')
|
|
56
|
+
return result('changed');
|
|
57
|
+
const secondLength = await context.integer('HLEN', [key]), ttl = await context.ttl(key);
|
|
58
|
+
if (ttl === -2n)
|
|
59
|
+
return result('missing');
|
|
60
|
+
if (length !== secondLength || BigInt(entries.size) > secondLength)
|
|
61
|
+
return result('changed');
|
|
62
|
+
context.signal.throwIfAborted();
|
|
63
|
+
// Budget before issuing a new token; do not drop a tail while advancing.
|
|
64
|
+
const page = { ...result('page', null, { type: 'hash', ttlMs: String(ttl), length: String(secondLength) }), entries: [...entries.values()] };
|
|
65
|
+
if (Buffer.byteLength(JSON.stringify(page)) + 36 > MAX_SCAN_JSON_BYTES)
|
|
66
|
+
throw new RedisFrameError('oversize');
|
|
67
|
+
const token = this.scans.advance(sessionId, scan, cursor);
|
|
68
|
+
scan = undefined; // The returned token owns the continuation now.
|
|
69
|
+
return { ...page, cursor: token };
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
const code = context.error(error);
|
|
73
|
+
// Only the AI reader opts in; an explicit cancellation may retry its
|
|
74
|
+
// original stateless cursor if this session and scan are still current.
|
|
75
|
+
if (this.retryCancelled && signal.aborted && scan !== undefined) {
|
|
76
|
+
try {
|
|
77
|
+
this.connections.assertTarget(sessionId, request.target);
|
|
78
|
+
if (this.scans.restore(sessionId, scan, request.cursor))
|
|
79
|
+
scan = undefined;
|
|
80
|
+
}
|
|
81
|
+
catch { /* target changed */ }
|
|
82
|
+
}
|
|
83
|
+
return code === 'type-changed' ? result('changed') : result('failed', code);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
if (scan !== undefined)
|
|
87
|
+
this.scans.discard(sessionId, scan);
|
|
88
|
+
context.dispose();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ScanKeysRequest, type ScanKeysResult } from '../domain.js';
|
|
2
|
+
import { type RedisConnections } from './connection-service.js';
|
|
3
|
+
/** MATCH filters returned names; COUNT is a Redis work hint, not a hard limit. */
|
|
4
|
+
export declare const KEY_SCAN_SCOPE: Readonly<{
|
|
5
|
+
readonly command: "SCAN";
|
|
6
|
+
readonly traversal: "current_db_keyspace";
|
|
7
|
+
readonly match: "key_names";
|
|
8
|
+
readonly countHint: 100;
|
|
9
|
+
readonly countIsLimit: false;
|
|
10
|
+
readonly fullIterationMayTraverseEntireKeyspace: true;
|
|
11
|
+
}>;
|
|
12
|
+
/** Exactly one SCAN per explicit action; cursor tokens cannot be replayed or moved. */
|
|
13
|
+
export declare class RedisKeys {
|
|
14
|
+
private readonly connections;
|
|
15
|
+
private readonly scans;
|
|
16
|
+
constructor(connections: RedisConnections);
|
|
17
|
+
disposeSession(sessionId: string): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
scan(sessionId: string, request: ScanKeysRequest, signal: AbortSignal): Promise<ScanKeysResult>;
|
|
20
|
+
}
|