@valkey/valkey-glide 1.3.5-rc8 → 2.0.0-rc5
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/README.md +18 -7
- package/build-ts/BaseClient.d.ts +85 -18
- package/build-ts/BaseClient.js +288 -246
- package/build-ts/Batch.d.ts +6 -6
- package/build-ts/Batch.js +230 -230
- package/build-ts/Commands.d.ts +14 -2
- package/build-ts/Commands.js +24 -12
- package/build-ts/Errors.js +1 -0
- package/build-ts/GlideClient.d.ts +7 -38
- package/build-ts/GlideClient.js +56 -55
- package/build-ts/GlideClusterClient.d.ts +12 -4
- package/build-ts/GlideClusterClient.js +60 -54
- package/build-ts/Logger.d.ts +30 -15
- package/build-ts/Logger.js +36 -24
- package/build-ts/OpenTelemetry.d.ts +101 -0
- package/build-ts/OpenTelemetry.js +134 -0
- package/build-ts/ProtobufMessage.d.ts +18 -84
- package/build-ts/ProtobufMessage.js +52 -184
- package/build-ts/index.d.ts +2 -2
- package/build-ts/index.js +2 -25
- package/build-ts/native.d.ts +158 -14
- package/build-ts/native.js +134 -105
- package/build-ts/server-modules/GlideFt.d.ts +1 -4
- package/build-ts/server-modules/GlideFt.js +10 -11
- package/build-ts/server-modules/GlideFtOptions.d.ts +1 -2
- package/build-ts/server-modules/GlideJson.d.ts +3 -5
- package/build-ts/server-modules/GlideJson.js +2 -2
- package/package.json +7 -7
package/build-ts/native.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* tslint:disable */
|
|
3
2
|
/* eslint-disable */
|
|
4
3
|
/* prettier-ignore */
|
|
4
|
+
|
|
5
5
|
/* auto-generated by NAPI-RS */
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
const { existsSync, readFileSync } = require('fs')
|
|
7
8
|
const { join } = require("path");
|
|
9
|
+
|
|
8
10
|
const { platform, arch } = process;
|
|
11
|
+
|
|
9
12
|
let nativeBinding = null;
|
|
10
13
|
let localFileExisted = false;
|
|
11
14
|
let loadError = null;
|
|
15
|
+
|
|
12
16
|
function isMusl() {
|
|
13
17
|
// For Node 10
|
|
14
18
|
if (!process.report || typeof process.report.getReport !== "function") {
|
|
@@ -18,44 +22,43 @@ function isMusl() {
|
|
|
18
22
|
.toString()
|
|
19
23
|
.trim();
|
|
20
24
|
return readFileSync(lddPath, "utf8").includes("musl");
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
25
|
+
} catch (e) {
|
|
23
26
|
return true;
|
|
24
27
|
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
28
|
+
} else {
|
|
27
29
|
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
28
30
|
return !glibcVersionRuntime;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
|
|
31
34
|
switch (platform) {
|
|
32
35
|
case "android":
|
|
33
36
|
switch (arch) {
|
|
34
37
|
case "arm64":
|
|
35
|
-
localFileExisted = existsSync(
|
|
38
|
+
localFileExisted = existsSync(
|
|
39
|
+
join(__dirname, "valkey-glide.android-arm64.node"),
|
|
40
|
+
);
|
|
36
41
|
try {
|
|
37
42
|
if (localFileExisted) {
|
|
38
43
|
nativeBinding = require("./valkey-glide.android-arm64.node");
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
44
|
+
} else {
|
|
41
45
|
nativeBinding = require("@valkey/valkey-glide-android-arm64");
|
|
42
46
|
}
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
47
|
+
} catch (e) {
|
|
45
48
|
loadError = e;
|
|
46
49
|
}
|
|
47
50
|
break;
|
|
48
51
|
case "arm":
|
|
49
|
-
localFileExisted = existsSync(
|
|
52
|
+
localFileExisted = existsSync(
|
|
53
|
+
join(__dirname, "valkey-glide.android-arm-eabi.node"),
|
|
54
|
+
);
|
|
50
55
|
try {
|
|
51
56
|
if (localFileExisted) {
|
|
52
57
|
nativeBinding = require("./valkey-glide.android-arm-eabi.node");
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
58
|
+
} else {
|
|
55
59
|
nativeBinding = require("@valkey/valkey-glide-android-arm-eabi");
|
|
56
60
|
}
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
61
|
+
} catch (e) {
|
|
59
62
|
loadError = e;
|
|
60
63
|
}
|
|
61
64
|
break;
|
|
@@ -66,44 +69,44 @@ switch (platform) {
|
|
|
66
69
|
case "win32":
|
|
67
70
|
switch (arch) {
|
|
68
71
|
case "x64":
|
|
69
|
-
localFileExisted = existsSync(
|
|
72
|
+
localFileExisted = existsSync(
|
|
73
|
+
join(__dirname, "valkey-glide.win32-x64-msvc.node"),
|
|
74
|
+
);
|
|
70
75
|
try {
|
|
71
76
|
if (localFileExisted) {
|
|
72
77
|
nativeBinding = require("./valkey-glide.win32-x64-msvc.node");
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
78
|
+
} else {
|
|
75
79
|
nativeBinding = require("@valkey/valkey-glide-win32-x64-msvc");
|
|
76
80
|
}
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
81
|
+
} catch (e) {
|
|
79
82
|
loadError = e;
|
|
80
83
|
}
|
|
81
84
|
break;
|
|
82
85
|
case "ia32":
|
|
83
|
-
localFileExisted = existsSync(
|
|
86
|
+
localFileExisted = existsSync(
|
|
87
|
+
join(__dirname, "valkey-glide.win32-ia32-msvc.node"),
|
|
88
|
+
);
|
|
84
89
|
try {
|
|
85
90
|
if (localFileExisted) {
|
|
86
91
|
nativeBinding = require("./valkey-glide.win32-ia32-msvc.node");
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
92
|
+
} else {
|
|
89
93
|
nativeBinding = require("@valkey/valkey-glide-win32-ia32-msvc");
|
|
90
94
|
}
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
95
|
+
} catch (e) {
|
|
93
96
|
loadError = e;
|
|
94
97
|
}
|
|
95
98
|
break;
|
|
96
99
|
case "arm64":
|
|
97
|
-
localFileExisted = existsSync(
|
|
100
|
+
localFileExisted = existsSync(
|
|
101
|
+
join(__dirname, "valkey-glide.win32-arm64-msvc.node"),
|
|
102
|
+
);
|
|
98
103
|
try {
|
|
99
104
|
if (localFileExisted) {
|
|
100
105
|
nativeBinding = require("./valkey-glide.win32-arm64-msvc.node");
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
106
|
+
} else {
|
|
103
107
|
nativeBinding = require("@valkey/valkey-glide-win32-arm64-msvc");
|
|
104
108
|
}
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
109
|
+
} catch (e) {
|
|
107
110
|
loadError = e;
|
|
108
111
|
}
|
|
109
112
|
break;
|
|
@@ -112,43 +115,43 @@ switch (platform) {
|
|
|
112
115
|
}
|
|
113
116
|
break;
|
|
114
117
|
case "darwin":
|
|
115
|
-
localFileExisted = existsSync(
|
|
118
|
+
localFileExisted = existsSync(
|
|
119
|
+
join(__dirname, "valkey-glide.darwin-universal.node"),
|
|
120
|
+
);
|
|
116
121
|
try {
|
|
117
122
|
if (localFileExisted) {
|
|
118
123
|
nativeBinding = require("./valkey-glide.darwin-universal.node");
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
124
|
+
} else {
|
|
121
125
|
nativeBinding = require("@valkey/valkey-glide-darwin-universal");
|
|
122
126
|
}
|
|
123
127
|
break;
|
|
124
|
-
}
|
|
125
|
-
catch { }
|
|
128
|
+
} catch {}
|
|
126
129
|
switch (arch) {
|
|
127
130
|
case "x64":
|
|
128
|
-
localFileExisted = existsSync(
|
|
131
|
+
localFileExisted = existsSync(
|
|
132
|
+
join(__dirname, "valkey-glide.darwin-x64.node"),
|
|
133
|
+
);
|
|
129
134
|
try {
|
|
130
135
|
if (localFileExisted) {
|
|
131
136
|
nativeBinding = require("./valkey-glide.darwin-x64.node");
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
137
|
+
} else {
|
|
134
138
|
nativeBinding = require("@valkey/valkey-glide-darwin-x64");
|
|
135
139
|
}
|
|
136
|
-
}
|
|
137
|
-
catch (e) {
|
|
140
|
+
} catch (e) {
|
|
138
141
|
loadError = e;
|
|
139
142
|
}
|
|
140
143
|
break;
|
|
141
144
|
case "arm64":
|
|
142
|
-
localFileExisted = existsSync(
|
|
145
|
+
localFileExisted = existsSync(
|
|
146
|
+
join(__dirname, "valkey-glide.darwin-arm64.node"),
|
|
147
|
+
);
|
|
143
148
|
try {
|
|
144
149
|
if (localFileExisted) {
|
|
145
150
|
nativeBinding = require("./valkey-glide.darwin-arm64.node");
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
151
|
+
} else {
|
|
148
152
|
nativeBinding = require("@valkey/valkey-glide-darwin-arm64");
|
|
149
153
|
}
|
|
150
|
-
}
|
|
151
|
-
catch (e) {
|
|
154
|
+
} catch (e) {
|
|
152
155
|
loadError = e;
|
|
153
156
|
}
|
|
154
157
|
break;
|
|
@@ -160,16 +163,16 @@ switch (platform) {
|
|
|
160
163
|
if (arch !== "x64") {
|
|
161
164
|
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
|
162
165
|
}
|
|
163
|
-
localFileExisted = existsSync(
|
|
166
|
+
localFileExisted = existsSync(
|
|
167
|
+
join(__dirname, "valkey-glide.freebsd-x64.node"),
|
|
168
|
+
);
|
|
164
169
|
try {
|
|
165
170
|
if (localFileExisted) {
|
|
166
171
|
nativeBinding = require("./valkey-glide.freebsd-x64.node");
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
172
|
+
} else {
|
|
169
173
|
nativeBinding = require("@valkey/valkey-glide-freebsd-x64");
|
|
170
174
|
}
|
|
171
|
-
}
|
|
172
|
-
catch (e) {
|
|
175
|
+
} catch (e) {
|
|
173
176
|
loadError = e;
|
|
174
177
|
}
|
|
175
178
|
break;
|
|
@@ -177,135 +180,137 @@ switch (platform) {
|
|
|
177
180
|
switch (arch) {
|
|
178
181
|
case "x64":
|
|
179
182
|
if (isMusl()) {
|
|
180
|
-
localFileExisted = existsSync(
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, "valkey-glide.linux-x64-musl.node"),
|
|
185
|
+
);
|
|
181
186
|
try {
|
|
182
187
|
if (localFileExisted) {
|
|
183
188
|
nativeBinding = require("./valkey-glide.linux-x64-musl.node");
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
189
|
+
} else {
|
|
186
190
|
nativeBinding = require("@valkey/valkey-glide-linux-x64-musl");
|
|
187
191
|
}
|
|
188
|
-
}
|
|
189
|
-
catch (e) {
|
|
192
|
+
} catch (e) {
|
|
190
193
|
loadError = e;
|
|
191
194
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
+
} else {
|
|
196
|
+
localFileExisted = existsSync(
|
|
197
|
+
join(__dirname, "valkey-glide.linux-x64-gnu.node"),
|
|
198
|
+
);
|
|
195
199
|
try {
|
|
196
200
|
if (localFileExisted) {
|
|
197
201
|
nativeBinding = require("./valkey-glide.linux-x64-gnu.node");
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
202
|
+
} else {
|
|
200
203
|
nativeBinding = require("@valkey/valkey-glide-linux-x64-gnu");
|
|
201
204
|
}
|
|
202
|
-
}
|
|
203
|
-
catch (e) {
|
|
205
|
+
} catch (e) {
|
|
204
206
|
loadError = e;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
break;
|
|
208
210
|
case "arm64":
|
|
209
211
|
if (isMusl()) {
|
|
210
|
-
localFileExisted = existsSync(
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, "valkey-glide.linux-arm64-musl.node"),
|
|
214
|
+
);
|
|
211
215
|
try {
|
|
212
216
|
if (localFileExisted) {
|
|
213
217
|
nativeBinding = require("./valkey-glide.linux-arm64-musl.node");
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
218
|
+
} else {
|
|
216
219
|
nativeBinding = require("@valkey/valkey-glide-linux-arm64-musl");
|
|
217
220
|
}
|
|
218
|
-
}
|
|
219
|
-
catch (e) {
|
|
221
|
+
} catch (e) {
|
|
220
222
|
loadError = e;
|
|
221
223
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
} else {
|
|
225
|
+
localFileExisted = existsSync(
|
|
226
|
+
join(__dirname, "valkey-glide.linux-arm64-gnu.node"),
|
|
227
|
+
);
|
|
225
228
|
try {
|
|
226
229
|
if (localFileExisted) {
|
|
227
230
|
nativeBinding = require("./valkey-glide.linux-arm64-gnu.node");
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
231
|
+
} else {
|
|
230
232
|
nativeBinding = require("@valkey/valkey-glide-linux-arm64-gnu");
|
|
231
233
|
}
|
|
232
|
-
}
|
|
233
|
-
catch (e) {
|
|
234
|
+
} catch (e) {
|
|
234
235
|
loadError = e;
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
break;
|
|
238
239
|
case "arm":
|
|
239
240
|
if (isMusl()) {
|
|
240
|
-
localFileExisted = existsSync(
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(
|
|
243
|
+
__dirname,
|
|
244
|
+
"valkey-glide.linux-arm-musleabihf.node",
|
|
245
|
+
),
|
|
246
|
+
);
|
|
241
247
|
try {
|
|
242
248
|
if (localFileExisted) {
|
|
243
249
|
nativeBinding = require("./valkey-glide.linux-arm-musleabihf.node");
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
250
|
+
} else {
|
|
246
251
|
nativeBinding = require("@valkey/valkey-glide-linux-arm-musleabihf");
|
|
247
252
|
}
|
|
248
|
-
}
|
|
249
|
-
catch (e) {
|
|
253
|
+
} catch (e) {
|
|
250
254
|
loadError = e;
|
|
251
255
|
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
} else {
|
|
257
|
+
localFileExisted = existsSync(
|
|
258
|
+
join(
|
|
259
|
+
__dirname,
|
|
260
|
+
"valkey-glide.linux-arm-gnueabihf.node",
|
|
261
|
+
),
|
|
262
|
+
);
|
|
255
263
|
try {
|
|
256
264
|
if (localFileExisted) {
|
|
257
265
|
nativeBinding = require("./valkey-glide.linux-arm-gnueabihf.node");
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
266
|
+
} else {
|
|
260
267
|
nativeBinding = require("@valkey/valkey-glide-linux-arm-gnueabihf");
|
|
261
268
|
}
|
|
262
|
-
}
|
|
263
|
-
catch (e) {
|
|
269
|
+
} catch (e) {
|
|
264
270
|
loadError = e;
|
|
265
271
|
}
|
|
266
272
|
}
|
|
267
273
|
break;
|
|
268
274
|
case "riscv64":
|
|
269
275
|
if (isMusl()) {
|
|
270
|
-
localFileExisted = existsSync(
|
|
276
|
+
localFileExisted = existsSync(
|
|
277
|
+
join(__dirname, "valkey-glide.linux-riscv64-musl.node"),
|
|
278
|
+
);
|
|
271
279
|
try {
|
|
272
280
|
if (localFileExisted) {
|
|
273
281
|
nativeBinding = require("./valkey-glide.linux-riscv64-musl.node");
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
282
|
+
} else {
|
|
276
283
|
nativeBinding = require("@valkey/valkey-glide-linux-riscv64-musl");
|
|
277
284
|
}
|
|
278
|
-
}
|
|
279
|
-
catch (e) {
|
|
285
|
+
} catch (e) {
|
|
280
286
|
loadError = e;
|
|
281
287
|
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
288
|
+
} else {
|
|
289
|
+
localFileExisted = existsSync(
|
|
290
|
+
join(__dirname, "valkey-glide.linux-riscv64-gnu.node"),
|
|
291
|
+
);
|
|
285
292
|
try {
|
|
286
293
|
if (localFileExisted) {
|
|
287
294
|
nativeBinding = require("./valkey-glide.linux-riscv64-gnu.node");
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
295
|
+
} else {
|
|
290
296
|
nativeBinding = require("@valkey/valkey-glide-linux-riscv64-gnu");
|
|
291
297
|
}
|
|
292
|
-
}
|
|
293
|
-
catch (e) {
|
|
298
|
+
} catch (e) {
|
|
294
299
|
loadError = e;
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
break;
|
|
298
303
|
case "s390x":
|
|
299
|
-
localFileExisted = existsSync(
|
|
304
|
+
localFileExisted = existsSync(
|
|
305
|
+
join(__dirname, "valkey-glide.linux-s390x-gnu.node"),
|
|
306
|
+
);
|
|
300
307
|
try {
|
|
301
308
|
if (localFileExisted) {
|
|
302
309
|
nativeBinding = require("./valkey-glide.linux-s390x-gnu.node");
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
310
|
+
} else {
|
|
305
311
|
nativeBinding = require("@valkey/valkey-glide-linux-s390x-gnu");
|
|
306
312
|
}
|
|
307
|
-
}
|
|
308
|
-
catch (e) {
|
|
313
|
+
} catch (e) {
|
|
309
314
|
loadError = e;
|
|
310
315
|
}
|
|
311
316
|
break;
|
|
@@ -316,13 +321,34 @@ switch (platform) {
|
|
|
316
321
|
default:
|
|
317
322
|
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
|
|
318
323
|
}
|
|
324
|
+
|
|
319
325
|
if (!nativeBinding) {
|
|
320
326
|
if (loadError) {
|
|
321
327
|
throw loadError;
|
|
322
328
|
}
|
|
323
329
|
throw new Error(`Failed to load native binding`);
|
|
324
330
|
}
|
|
325
|
-
|
|
331
|
+
|
|
332
|
+
const {
|
|
333
|
+
Level,
|
|
334
|
+
MAX_REQUEST_ARGS_LEN,
|
|
335
|
+
DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS,
|
|
336
|
+
DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS,
|
|
337
|
+
DEFAULT_INFLIGHT_REQUESTS_LIMIT,
|
|
338
|
+
AsyncClient,
|
|
339
|
+
StartSocketConnection,
|
|
340
|
+
InitOpenTelemetry,
|
|
341
|
+
log,
|
|
342
|
+
InitInternalLogger,
|
|
343
|
+
valueFromSplitPointer,
|
|
344
|
+
createLeakedStringVec,
|
|
345
|
+
createLeakedOtelSpan,
|
|
346
|
+
dropOtelSpan,
|
|
347
|
+
Script,
|
|
348
|
+
ClusterScanCursor,
|
|
349
|
+
getStatistics,
|
|
350
|
+
} = nativeBinding;
|
|
351
|
+
|
|
326
352
|
module.exports.Level = Level;
|
|
327
353
|
module.exports.MAX_REQUEST_ARGS_LEN = MAX_REQUEST_ARGS_LEN;
|
|
328
354
|
module.exports.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS =
|
|
@@ -333,10 +359,13 @@ module.exports.DEFAULT_INFLIGHT_REQUESTS_LIMIT =
|
|
|
333
359
|
DEFAULT_INFLIGHT_REQUESTS_LIMIT;
|
|
334
360
|
module.exports.AsyncClient = AsyncClient;
|
|
335
361
|
module.exports.StartSocketConnection = StartSocketConnection;
|
|
362
|
+
module.exports.InitOpenTelemetry = InitOpenTelemetry;
|
|
336
363
|
module.exports.log = log;
|
|
337
364
|
module.exports.InitInternalLogger = InitInternalLogger;
|
|
338
365
|
module.exports.valueFromSplitPointer = valueFromSplitPointer;
|
|
339
366
|
module.exports.createLeakedStringVec = createLeakedStringVec;
|
|
367
|
+
module.exports.createLeakedOtelSpan = createLeakedOtelSpan;
|
|
368
|
+
module.exports.dropOtelSpan = dropOtelSpan;
|
|
340
369
|
module.exports.Script = Script;
|
|
341
370
|
module.exports.ClusterScanCursor = ClusterScanCursor;
|
|
342
371
|
module.exports.getStatistics = getStatistics;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
3
|
*/
|
|
4
|
-
import { DecoderOption, GlideRecord, GlideReturnType, GlideString } from "
|
|
5
|
-
import { GlideClient } from "../GlideClient";
|
|
6
|
-
import { GlideClusterClient } from "../GlideClusterClient";
|
|
7
|
-
import { Field, FtAggregateOptions, FtCreateOptions, FtSearchOptions } from "./GlideFtOptions";
|
|
4
|
+
import { DecoderOption, GlideRecord, GlideReturnType, GlideString, GlideClient, GlideClusterClient, Field, FtAggregateOptions, FtCreateOptions, FtSearchOptions } from "..";
|
|
8
5
|
/** Response type of {@link GlideFt.info | ft.info} command. */
|
|
9
6
|
export type FtInfoReturnType = Record<string, GlideString | number | GlideString[] | Record<string, GlideString | Record<string, GlideString | number>[]>>;
|
|
10
7
|
/**
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GlideFt = void 0;
|
|
7
|
-
const
|
|
8
|
-
const GlideClient_1 = require("../GlideClient");
|
|
7
|
+
const __1 = require("..");
|
|
9
8
|
/** Module for Vector Search commands. */
|
|
10
9
|
class GlideFt {
|
|
11
10
|
/**
|
|
@@ -105,7 +104,7 @@ class GlideFt {
|
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
return _handleCustomCommand(client, args, {
|
|
108
|
-
decoder:
|
|
107
|
+
decoder: __1.Decoder.String,
|
|
109
108
|
});
|
|
110
109
|
}
|
|
111
110
|
/**
|
|
@@ -124,7 +123,7 @@ class GlideFt {
|
|
|
124
123
|
static async dropindex(client, indexName) {
|
|
125
124
|
const args = ["FT.DROPINDEX", indexName];
|
|
126
125
|
return _handleCustomCommand(client, args, {
|
|
127
|
-
decoder:
|
|
126
|
+
decoder: __1.Decoder.String,
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
129
|
/**
|
|
@@ -267,7 +266,7 @@ class GlideFt {
|
|
|
267
266
|
*/
|
|
268
267
|
static async info(client, indexName, options) {
|
|
269
268
|
const args = ["FT.INFO", indexName];
|
|
270
|
-
return _handleCustomCommand(client, args, options).then(
|
|
269
|
+
return _handleCustomCommand(client, args, options).then(__1.convertGlideRecordToRecord);
|
|
271
270
|
}
|
|
272
271
|
/**
|
|
273
272
|
* Parse a query and return information about how that query was parsed.
|
|
@@ -405,7 +404,7 @@ class GlideFt {
|
|
|
405
404
|
if (options) {
|
|
406
405
|
args.push(..._addFtSearchOptions(options));
|
|
407
406
|
}
|
|
408
|
-
return _handleCustomCommand(client, args, options).then((v) => [v[0], (0,
|
|
407
|
+
return _handleCustomCommand(client, args, options).then((v) => [v[0], (0, __1.convertGlideRecordToRecord)(v[1])]);
|
|
409
408
|
}
|
|
410
409
|
/**
|
|
411
410
|
* Runs an aggregate query and collects performance profiling information.
|
|
@@ -453,7 +452,7 @@ class GlideFt {
|
|
|
453
452
|
if (options) {
|
|
454
453
|
args.push(..._addFtAggregateOptions(options));
|
|
455
454
|
}
|
|
456
|
-
return _handleCustomCommand(client, args, options).then((v) => [v[0], (0,
|
|
455
|
+
return _handleCustomCommand(client, args, options).then((v) => [v[0], (0, __1.convertGlideRecordToRecord)(v[1])]);
|
|
457
456
|
}
|
|
458
457
|
/**
|
|
459
458
|
* Adds an alias for an index. The new alias name can be used anywhere that an index name is required.
|
|
@@ -472,7 +471,7 @@ class GlideFt {
|
|
|
472
471
|
static async aliasadd(client, indexName, alias) {
|
|
473
472
|
const args = ["FT.ALIASADD", alias, indexName];
|
|
474
473
|
return _handleCustomCommand(client, args, {
|
|
475
|
-
decoder:
|
|
474
|
+
decoder: __1.Decoder.String,
|
|
476
475
|
});
|
|
477
476
|
}
|
|
478
477
|
/**
|
|
@@ -491,7 +490,7 @@ class GlideFt {
|
|
|
491
490
|
static async aliasdel(client, alias) {
|
|
492
491
|
const args = ["FT.ALIASDEL", alias];
|
|
493
492
|
return _handleCustomCommand(client, args, {
|
|
494
|
-
decoder:
|
|
493
|
+
decoder: __1.Decoder.String,
|
|
495
494
|
});
|
|
496
495
|
}
|
|
497
496
|
/**
|
|
@@ -511,7 +510,7 @@ class GlideFt {
|
|
|
511
510
|
static async aliasupdate(client, alias, indexName) {
|
|
512
511
|
const args = ["FT.ALIASUPDATE", alias, indexName];
|
|
513
512
|
return _handleCustomCommand(client, args, {
|
|
514
|
-
decoder:
|
|
513
|
+
decoder: __1.Decoder.String,
|
|
515
514
|
});
|
|
516
515
|
}
|
|
517
516
|
/**
|
|
@@ -622,7 +621,7 @@ function _addFtSearchOptions(options) {
|
|
|
622
621
|
* @internal
|
|
623
622
|
*/
|
|
624
623
|
async function _handleCustomCommand(client, args, decoderOption = {}) {
|
|
625
|
-
return client instanceof
|
|
624
|
+
return client instanceof __1.GlideClient
|
|
626
625
|
? client.customCommand(args, decoderOption)
|
|
627
626
|
: client.customCommand(args, decoderOption);
|
|
628
627
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
3
|
*/
|
|
4
|
-
import { GlideRecord, GlideString } from "
|
|
5
|
-
import { SortOrder } from "../Commands";
|
|
4
|
+
import { GlideRecord, GlideString, SortOrder } from "..";
|
|
6
5
|
interface BaseField {
|
|
7
6
|
/** The name of the field. */
|
|
8
7
|
name: GlideString;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
3
|
*/
|
|
4
|
-
import { BaseClient, DecoderOption, GlideString } from "
|
|
5
|
-
|
|
6
|
-
import { ConditionalChange } from "../Commands";
|
|
7
|
-
export type ReturnTypeJson<T> = T | (T | null)[];
|
|
4
|
+
import { BaseClient, Batch, ClusterBatch, ConditionalChange, DecoderOption, GlideString } from "..";
|
|
5
|
+
export type ReturnTypeJson<T> = T | null | (T | null)[];
|
|
8
6
|
export type UniversalReturnTypeJson<T> = T | T[];
|
|
9
7
|
/**
|
|
10
8
|
* Represents options for formatting JSON data, to be used in the {@link GlideJson.get | JSON.GET} command.
|
|
@@ -139,7 +137,7 @@ export declare class GlideJson {
|
|
|
139
137
|
* console.log(res); // Output: ["[]", "[false]", null]
|
|
140
138
|
* ```
|
|
141
139
|
*/
|
|
142
|
-
static mget(client: BaseClient, keys: GlideString[], path: GlideString, options?: DecoderOption): Promise<GlideString[]
|
|
140
|
+
static mget(client: BaseClient, keys: GlideString[], path: GlideString, options?: DecoderOption): Promise<ReturnTypeJson<GlideString[]>>;
|
|
143
141
|
/**
|
|
144
142
|
* Inserts one or more values into the array at the specified `path` within the JSON
|
|
145
143
|
* document stored at `key`, before the given `index`.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.JsonBatch = exports.GlideJson = void 0;
|
|
7
|
-
const
|
|
7
|
+
const __1 = require("..");
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
@@ -36,7 +36,7 @@ function _jsonGetOptionsToArgs(options) {
|
|
|
36
36
|
* @internal
|
|
37
37
|
*/
|
|
38
38
|
function _executeCommand(client, args, options) {
|
|
39
|
-
if (client instanceof
|
|
39
|
+
if (client instanceof __1.GlideClient) {
|
|
40
40
|
return client.customCommand(args, options);
|
|
41
41
|
}
|
|
42
42
|
else {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "build-ts/index.js",
|
|
5
5
|
"module": "build-ts/index.js",
|
|
6
6
|
"types": "build-ts/index.d.ts",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "2.0.0-rc5",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": {
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"optionalDependencies": {
|
|
136
|
-
"@valkey/valkey-glide-darwin-x64": "
|
|
137
|
-
"@valkey/valkey-glide-darwin-arm64": "
|
|
138
|
-
"@valkey/valkey-glide-linux-x64-gnu": "
|
|
139
|
-
"@valkey/valkey-glide-linux-arm64-gnu": "
|
|
140
|
-
"@valkey/valkey-glide-linux-x64-musl": "
|
|
141
|
-
"@valkey/valkey-glide-linux-arm64-musl": "
|
|
136
|
+
"@valkey/valkey-glide-darwin-x64": "2.0.0-rc5",
|
|
137
|
+
"@valkey/valkey-glide-darwin-arm64": "2.0.0-rc5",
|
|
138
|
+
"@valkey/valkey-glide-linux-x64-gnu": "2.0.0-rc5",
|
|
139
|
+
"@valkey/valkey-glide-linux-arm64-gnu": "2.0.0-rc5",
|
|
140
|
+
"@valkey/valkey-glide-linux-x64-musl": "2.0.0-rc5",
|
|
141
|
+
"@valkey/valkey-glide-linux-arm64-musl": "2.0.0-rc5"
|
|
142
142
|
}
|
|
143
143
|
}
|