@valkey/valkey-glide-darwin-arm64 1.3.4 → 1.3.5-rc1

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.
Files changed (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +36 -14
  3. package/package.json +45 -101
  4. package/valkey-glide.darwin-arm64.node +0 -0
  5. package/build-ts/index.d.ts +0 -14
  6. package/build-ts/index.js +0 -34
  7. package/build-ts/index.js.map +0 -1
  8. package/build-ts/src/BaseClient.d.ts +0 -5254
  9. package/build-ts/src/BaseClient.js +0 -6391
  10. package/build-ts/src/BaseClient.js.map +0 -1
  11. package/build-ts/src/Commands.d.ts +0 -1034
  12. package/build-ts/src/Commands.js +0 -2710
  13. package/build-ts/src/Commands.js.map +0 -1
  14. package/build-ts/src/Errors.d.ts +0 -21
  15. package/build-ts/src/Errors.js +0 -43
  16. package/build-ts/src/Errors.js.map +0 -1
  17. package/build-ts/src/GlideClient.d.ts +0 -832
  18. package/build-ts/src/GlideClient.js +0 -940
  19. package/build-ts/src/GlideClient.js.map +0 -1
  20. package/build-ts/src/GlideClusterClient.d.ts +0 -1323
  21. package/build-ts/src/GlideClusterClient.js +0 -1276
  22. package/build-ts/src/GlideClusterClient.js.map +0 -1
  23. package/build-ts/src/Logger.d.ts +0 -32
  24. package/build-ts/src/Logger.js +0 -68
  25. package/build-ts/src/Logger.js.map +0 -1
  26. package/build-ts/src/ProtobufMessage.d.ts +0 -2889
  27. package/build-ts/src/ProtobufMessage.js +0 -8785
  28. package/build-ts/src/ProtobufMessage.js.map +0 -1
  29. package/build-ts/src/Transaction.d.ts +0 -2963
  30. package/build-ts/src/Transaction.js +0 -3388
  31. package/build-ts/src/Transaction.js.map +0 -1
  32. package/build-ts/src/server-modules/GlideFt.d.ts +0 -412
  33. package/build-ts/src/server-modules/GlideFt.js +0 -664
  34. package/build-ts/src/server-modules/GlideFt.js.map +0 -1
  35. package/build-ts/src/server-modules/GlideFtOptions.d.ts +0 -244
  36. package/build-ts/src/server-modules/GlideFtOptions.js +0 -6
  37. package/build-ts/src/server-modules/GlideFtOptions.js.map +0 -1
  38. package/build-ts/src/server-modules/GlideJson.d.ts +0 -1335
  39. package/build-ts/src/server-modules/GlideJson.js +0 -1628
  40. package/build-ts/src/server-modules/GlideJson.js.map +0 -1
  41. package/index.ts +0 -15
  42. package/node_modules/glide-rs/glide-rs.darwin-arm64.node +0 -0
  43. package/node_modules/glide-rs/index.d.ts +0 -71
  44. package/node_modules/glide-rs/index.js +0 -317
  45. package/node_modules/glide-rs/package.json +0 -65
  46. package/npm/glide/index.ts +0 -391
  47. package/npm/glide/package.json +0 -67
@@ -1,1034 +0,0 @@
1
- /**
2
- * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
- */
4
- import { GlideString, HashDataType, ObjectType } from "./BaseClient";
5
- export type SetOptions = ({
6
- /**
7
- * `onlyIfDoesNotExist` - Only set the key if it does not already exist.
8
- * `NX` in the Valkey API.
9
- *
10
- * `onlyIfExists` - Only set the key if it already exists.
11
- * `EX` in the Valkey API.
12
- */
13
- conditionalSet?: "onlyIfExists" | "onlyIfDoesNotExist";
14
- } | {
15
- /**
16
- * `onlyIfEqual` - Only set the key if the comparison value equals the current value of key.
17
- * `IFEQ` in the Valkey API.
18
- */
19
- conditionalSet: "onlyIfEqual";
20
- /**
21
- * The value to compare the existing value with.
22
- */
23
- comparisonValue: GlideString;
24
- }) & {
25
- /**
26
- * Return the old string stored at key, or nil if key did not exist. An error
27
- * is returned and SET aborted if the value stored at key is not a string.
28
- * Equivalent to `GET` in the Valkey API.
29
- */
30
- returnOldValue?: boolean;
31
- /**
32
- * If not set, no expiry time will be set for the value.
33
- *
34
- * `keepExisting` - Retain the time to live associated with the key.
35
- * Equivalent to `KEEPTTL` in the Valkey API.
36
- */
37
- expiry?: "keepExisting" | {
38
- type: TimeUnit;
39
- count: number;
40
- };
41
- };
42
- /**
43
- * INFO option: a specific section of information:
44
- * When no parameter is provided, the default option is assumed.
45
- */
46
- export declare enum InfoOptions {
47
- /**
48
- * SERVER: General information about the server
49
- */
50
- Server = "server",
51
- /**
52
- * CLIENTS: Client connections section
53
- */
54
- Clients = "clients",
55
- /**
56
- * MEMORY: Memory consumption related information
57
- */
58
- Memory = "memory",
59
- /**
60
- * PERSISTENCE: RDB and AOF related information
61
- */
62
- Persistence = "persistence",
63
- /**
64
- * STATS: General statistics
65
- */
66
- Stats = "stats",
67
- /**
68
- * REPLICATION: Master/replica replication information
69
- */
70
- Replication = "replication",
71
- /**
72
- * CPU: CPU consumption statistics
73
- */
74
- Cpu = "cpu",
75
- /**
76
- * COMMANDSTATS: Valkey command statistics
77
- */
78
- Commandstats = "commandstats",
79
- /**
80
- * LATENCYSTATS: Valkey command latency percentile distribution statistics
81
- */
82
- Latencystats = "latencystats",
83
- /**
84
- * SENTINEL: Valkey Sentinel section (only applicable to Sentinel instances)
85
- */
86
- Sentinel = "sentinel",
87
- /**
88
- * CLUSTER: Valkey Cluster section
89
- */
90
- Cluster = "cluster",
91
- /**
92
- * MODULES: Modules section
93
- */
94
- Modules = "modules",
95
- /**
96
- * KEYSPACE: Database related statistics
97
- */
98
- Keyspace = "keyspace",
99
- /**
100
- * ERRORSTATS: Valkey error statistics
101
- */
102
- Errorstats = "errorstats",
103
- /**
104
- * ALL: Return all sections (excluding module generated ones)
105
- */
106
- All = "all",
107
- /**
108
- * DEFAULT: Return only the default set of sections
109
- */
110
- Default = "default",
111
- /**
112
- * EVERYTHING: Includes all and modules
113
- */
114
- Everything = "everything"
115
- }
116
- /**
117
- * This function converts an input from {@link HashDataType} or `Record` types to `HashDataType`.
118
- *
119
- * @param fieldsAndValues - field names and their values.
120
- * @returns HashDataType array containing field names and their values.
121
- */
122
- export declare function convertFieldsAndValuesToHashDataType(fieldsAndValues: HashDataType | Record<string, GlideString>): HashDataType;
123
- /**
124
- * Enumeration defining the bitwise operation to use in the {@link BaseClient.bitop|bitop} command. Specifies the
125
- * bitwise operation to perform between the passed in keys.
126
- */
127
- export declare enum BitwiseOperation {
128
- AND = "AND",
129
- OR = "OR",
130
- XOR = "XOR",
131
- NOT = "NOT"
132
- }
133
- /**
134
- * Represents a signed or unsigned argument encoding for the {@link BaseClient.bitfield|bitfield} or
135
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
136
- */
137
- export interface BitEncoding {
138
- /**
139
- * Returns the encoding as a string argument to be used in the {@link BaseClient.bitfield|bitfield} or
140
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
141
- *
142
- * @returns The encoding as a string argument.
143
- */
144
- toArg(): string;
145
- }
146
- /**
147
- * Represents a signed argument encoding.
148
- */
149
- export declare class SignedEncoding implements BitEncoding {
150
- private static readonly SIGNED_ENCODING_PREFIX;
151
- private readonly encoding;
152
- /**
153
- * Creates an instance of SignedEncoding.
154
- *
155
- * @param encodingLength - The bit size of the encoding. Must be less than 65 bits long.
156
- */
157
- constructor(encodingLength: number);
158
- toArg(): string;
159
- }
160
- /**
161
- * Represents an unsigned argument encoding.
162
- */
163
- export declare class UnsignedEncoding implements BitEncoding {
164
- private static readonly UNSIGNED_ENCODING_PREFIX;
165
- private readonly encoding;
166
- /**
167
- * Creates an instance of UnsignedEncoding.
168
- *
169
- * @param encodingLength - The bit size of the encoding. Must be less than 64 bits long.
170
- */
171
- constructor(encodingLength: number);
172
- toArg(): string;
173
- }
174
- /**
175
- * Represents an offset for an array of bits for the {@link BaseClient.bitfield|bitfield} or
176
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
177
- */
178
- export interface BitFieldOffset {
179
- /**
180
- * Returns the offset as a string argument to be used in the {@link BaseClient.bitfield|bitfield} or
181
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
182
- *
183
- * @returns The offset as a string argument.
184
- */
185
- toArg(): string;
186
- }
187
- /**
188
- * Represents an offset in an array of bits for the {@link BaseClient.bitfield|bitfield} or
189
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
190
- *
191
- * For example, if we have the binary `01101001` with offset of 1 for an unsigned encoding of size 4, then the value
192
- * is 13 from `0(1101)001`.
193
- */
194
- export declare class BitOffset implements BitFieldOffset {
195
- private readonly offset;
196
- /**
197
- * Creates an instance of BitOffset.
198
- *
199
- * @param offset - The bit index offset in the array of bits. Must be greater than or equal to 0.
200
- */
201
- constructor(offset: number);
202
- toArg(): string;
203
- }
204
- /**
205
- * Represents an offset in an array of bits for the {@link BaseClient.bitfield|bitfield} or
206
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands. The bit offset index is calculated as the numerical
207
- * value of the offset multiplied by the encoding value.
208
- *
209
- * For example, if we have the binary 01101001 with offset multiplier of 1 for an unsigned encoding of size 4, then the
210
- * value is 9 from `0110(1001)`.
211
- */
212
- export declare class BitOffsetMultiplier implements BitFieldOffset {
213
- private static readonly OFFSET_MULTIPLIER_PREFIX;
214
- private readonly offset;
215
- /**
216
- * Creates an instance of BitOffsetMultiplier.
217
- *
218
- * @param offset - The offset in the array of bits, which will be multiplied by the encoding value to get the final
219
- * bit index offset.
220
- */
221
- constructor(offset: number);
222
- toArg(): string;
223
- }
224
- /**
225
- * Represents subcommands for the {@link BaseClient.bitfield|bitfield} or
226
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
227
- */
228
- export interface BitFieldSubCommands {
229
- /**
230
- * Returns the subcommand as a list of string arguments to be used in the {@link BaseClient.bitfield|bitfield} or
231
- * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
232
- *
233
- * @returns The subcommand as a list of string arguments.
234
- */
235
- toArgs(): string[];
236
- }
237
- /**
238
- * Represents the "GET" subcommand for getting a value in the binary representation of the string stored in `key`.
239
- */
240
- export declare class BitFieldGet implements BitFieldSubCommands {
241
- private static readonly GET_COMMAND_STRING;
242
- private readonly encoding;
243
- private readonly offset;
244
- /**
245
- * Creates an instance of BitFieldGet.
246
- *
247
- * @param encoding - The bit encoding for the subcommand.
248
- * @param offset - The offset in the array of bits from which to get the value.
249
- */
250
- constructor(encoding: BitEncoding, offset: BitFieldOffset);
251
- toArgs(): string[];
252
- }
253
- /**
254
- * Represents the "SET" subcommand for setting bits in the binary representation of the string stored in `key`.
255
- */
256
- export declare class BitFieldSet implements BitFieldSubCommands {
257
- private static readonly SET_COMMAND_STRING;
258
- private readonly encoding;
259
- private readonly offset;
260
- private readonly value;
261
- /**
262
- * Creates an instance of BitFieldSet
263
- *
264
- * @param encoding - The bit encoding for the subcommand.
265
- * @param offset - The offset in the array of bits where the value will be set.
266
- * @param value - The value to set the bits in the binary value to.
267
- */
268
- constructor(encoding: BitEncoding, offset: BitFieldOffset, value: number);
269
- toArgs(): string[];
270
- }
271
- /**
272
- * Represents the "INCRBY" subcommand for increasing or decreasing bits in the binary representation of the string
273
- * stored in `key`.
274
- */
275
- export declare class BitFieldIncrBy implements BitFieldSubCommands {
276
- private static readonly INCRBY_COMMAND_STRING;
277
- private readonly encoding;
278
- private readonly offset;
279
- private readonly increment;
280
- /**
281
- * Creates an instance of BitFieldIncrBy
282
- *
283
- * @param encoding - The bit encoding for the subcommand.
284
- * @param offset - The offset in the array of bits where the value will be incremented.
285
- * @param increment - The value to increment the bits in the binary value by.
286
- */
287
- constructor(encoding: BitEncoding, offset: BitFieldOffset, increment: number);
288
- toArgs(): string[];
289
- }
290
- /**
291
- * Enumeration specifying bit overflow controls for the {@link BaseClient.bitfield|bitfield} command.
292
- */
293
- export declare enum BitOverflowControl {
294
- /**
295
- * Performs modulo when overflows occur with unsigned encoding. When overflows occur with signed encoding, the value
296
- * restarts at the most negative value. When underflows occur with signed encoding, the value restarts at the most
297
- * positive value.
298
- */
299
- WRAP = "WRAP",
300
- /**
301
- * Underflows remain set to the minimum value, and overflows remain set to the maximum value.
302
- */
303
- SAT = "SAT",
304
- /**
305
- * Returns `None` when overflows occur.
306
- */
307
- FAIL = "FAIL"
308
- }
309
- /**
310
- * Represents the "OVERFLOW" subcommand that determines the result of the "SET" or "INCRBY"
311
- * {@link BaseClient.bitfield|bitfield} subcommands when an underflow or overflow occurs.
312
- */
313
- export declare class BitFieldOverflow implements BitFieldSubCommands {
314
- private static readonly OVERFLOW_COMMAND_STRING;
315
- private readonly overflowControl;
316
- /**
317
- * Creates an instance of BitFieldOverflow.
318
- *
319
- * @param overflowControl - The desired overflow behavior.
320
- */
321
- constructor(overflowControl: BitOverflowControl);
322
- toArgs(): string[];
323
- }
324
- /**
325
- * Enumeration representing element popping or adding direction for the List Based Commands.
326
- */
327
- export declare enum ListDirection {
328
- /**
329
- * Represents the option that elements should be popped from or added to the left side of a list.
330
- */
331
- LEFT = "LEFT",
332
- /**
333
- * Represents the option that elements should be popped from or added to the right side of a list.
334
- */
335
- RIGHT = "RIGHT"
336
- }
337
- export declare enum ExpireOptions {
338
- /**
339
- * `HasNoExpiry` - Sets expiry only when the key has no expiry.
340
- */
341
- HasNoExpiry = "NX",
342
- /**
343
- * `HasExistingExpiry` - Sets expiry only when the key has an existing expiry.
344
- */
345
- HasExistingExpiry = "XX",
346
- /**
347
- * `NewExpiryGreaterThanCurrent` - Sets expiry only when the new expiry is
348
- * greater than current one.
349
- */
350
- NewExpiryGreaterThanCurrent = "GT",
351
- /**
352
- * `NewExpiryLessThanCurrent` - Sets expiry only when the new expiry is less
353
- * than current one.
354
- */
355
- NewExpiryLessThanCurrent = "LT"
356
- }
357
- /**
358
- * Options for updating elements of a sorted set key.
359
- */
360
- export declare enum UpdateByScore {
361
- /** Only update existing elements if the new score is less than the current score. */
362
- LESS_THAN = "LT",
363
- /** Only update existing elements if the new score is greater than the current score. */
364
- GREATER_THAN = "GT"
365
- }
366
- export interface ZAddOptions {
367
- /**
368
- * Options for handling existing members.
369
- */
370
- conditionalChange?: ConditionalChange;
371
- /**
372
- * Options for updating scores.
373
- */
374
- updateOptions?: UpdateByScore;
375
- /**
376
- * Modify the return value from the number of new elements added, to the total number of elements changed.
377
- */
378
- changed?: boolean;
379
- }
380
- /**
381
- * `KeyWeight` - pair of variables represents a weighted key for the `ZINTERSTORE` and `ZUNIONSTORE` sorted sets commands.
382
- */
383
- export type KeyWeight = [GlideString, number];
384
- /**
385
- * `AggregationType` - representing aggregation types for `ZINTERSTORE` and `ZUNIONSTORE` sorted set commands.
386
- */
387
- export type AggregationType = "SUM" | "MIN" | "MAX";
388
- export declare enum InfBoundary {
389
- /**
390
- * Positive infinity bound.
391
- */
392
- PositiveInfinity = "+",
393
- /**
394
- * Negative infinity bound.
395
- */
396
- NegativeInfinity = "-"
397
- }
398
- /**
399
- * Defines the boundaries of a range.
400
- */
401
- export type Boundary<T> =
402
- /**
403
- * Represents an lower/upper boundary.
404
- */
405
- InfBoundary
406
- /**
407
- * Represents a specific boundary.
408
- */
409
- | {
410
- /**
411
- * The comparison value.
412
- */
413
- value: T;
414
- /**
415
- * Whether the value is inclusive. Defaults to `true`.
416
- */
417
- isInclusive?: boolean;
418
- };
419
- /**
420
- * Represents a range by index (rank) in a sorted set.
421
- * The `start` and `end` arguments represent zero-based indexes.
422
- */
423
- export interface RangeByIndex {
424
- /**
425
- * The start index of the range.
426
- */
427
- start: number;
428
- /**
429
- * The end index of the range.
430
- */
431
- end: number;
432
- }
433
- /**
434
- * Represents a range by score or a range by lex in a sorted set.
435
- * The `start` and `end` arguments represent score boundaries.
436
- */
437
- interface SortedSetRange<T> {
438
- /**
439
- * The start boundary.
440
- */
441
- start: Boundary<T>;
442
- /**
443
- * The end boundary.
444
- */
445
- end: Boundary<T>;
446
- /**
447
- * The limit argument for a range query.
448
- * Represents a limit argument for a range query in a sorted set to
449
- * be used in [ZRANGE](https://valkey.io/commands/zrange) command.
450
- *
451
- * The optional LIMIT argument can be used to obtain a sub-range from the
452
- * matching elements (similar to SELECT LIMIT offset, count in SQL).
453
- */
454
- limit?: {
455
- /**
456
- * The offset from the start of the range.
457
- */
458
- offset: number;
459
- /**
460
- * The number of elements to include in the range.
461
- * A negative count returns all elements from the offset.
462
- */
463
- count: number;
464
- };
465
- }
466
- export type RangeByScore = SortedSetRange<number> & {
467
- type: "byScore";
468
- };
469
- export type RangeByLex = SortedSetRange<GlideString> & {
470
- type: "byLex";
471
- };
472
- /**
473
- * Defines where to insert new elements into a list.
474
- */
475
- export declare enum InsertPosition {
476
- /**
477
- * Insert new element before the pivot.
478
- */
479
- Before = "before",
480
- /**
481
- * Insert new element after the pivot.
482
- */
483
- After = "after"
484
- }
485
- export type StreamTrimOptions = ({
486
- /**
487
- * Trim the stream according to entry ID.
488
- * Equivalent to `MINID` in the Valkey API.
489
- */
490
- method: "minid";
491
- threshold: GlideString;
492
- } | {
493
- /**
494
- * Trim the stream according to length.
495
- * Equivalent to `MAXLEN` in the Valkey API.
496
- */
497
- method: "maxlen";
498
- threshold: number;
499
- }) & {
500
- /**
501
- * If `true`, the stream will be trimmed exactly. Equivalent to `=` in the
502
- * Valkey API. Otherwise the stream will be trimmed in a near-exact manner,
503
- * which is more efficient, equivalent to `~` in the Valkey API.
504
- */
505
- exact: boolean;
506
- /**
507
- * If set, sets the maximal amount of entries that will be deleted.
508
- */
509
- limit?: number;
510
- };
511
- export interface StreamAddOptions {
512
- /**
513
- * If set, the new entry will be added with this ID.
514
- */
515
- id?: string;
516
- /**
517
- * If set to `false`, a new stream won't be created if no stream matches the
518
- * given key. Equivalent to `NOMKSTREAM` in the Valkey API.
519
- */
520
- makeStream?: boolean;
521
- /**
522
- * If set, the add operation will also trim the older entries in the stream.
523
- */
524
- trim?: StreamTrimOptions;
525
- }
526
- /** Optional arguments for `FUNCTION LIST` command. */
527
- export interface FunctionListOptions {
528
- /** A wildcard pattern for matching library names. */
529
- libNamePattern?: GlideString;
530
- /** Specifies whether to request the library code from the server or not. */
531
- withCode?: boolean;
532
- }
533
- /** Type of the response of `FUNCTION LIST` command. */
534
- export type FunctionListResponse = Record<string, GlideString | Record<string, GlideString | null | GlideString[]>[]>[];
535
- /** Response for `FUNCTION STATS` command on a single node.
536
- * The response is a map with 2 keys:
537
- * 1. Information about the current running function/script (or null if none).
538
- * 2. Details about the execution engines.
539
- */
540
- export type FunctionStatsSingleResponse = Record<string, null | Record<string, GlideString | GlideString[] | number> | Record<string, Record<string, number>>>;
541
- /** Full response for `FUNCTION STATS` command across multiple nodes.
542
- * It maps node addresses to the per-node response.
543
- */
544
- export type FunctionStatsFullResponse = Record<string, // Node address
545
- FunctionStatsSingleResponse>;
546
- /**
547
- * Option for `FUNCTION RESTORE` command: {@link GlideClient.functionRestore} and
548
- * {@link GlideClusterClient.functionRestore}.
549
- *
550
- * @see {@link https://valkey.io/commands/function-restore/"|valkey.io} for more details.
551
- */
552
- export declare enum FunctionRestorePolicy {
553
- /**
554
- * Appends the restored libraries to the existing libraries and aborts on collision. This is the
555
- * default policy.
556
- */
557
- APPEND = "APPEND",
558
- /** Deletes all existing libraries before restoring the payload. */
559
- FLUSH = "FLUSH",
560
- /**
561
- * Appends the restored libraries to the existing libraries, replacing any existing ones in case
562
- * of name collisions. Note that this policy doesn't prevent function name collisions, only
563
- * libraries.
564
- */
565
- REPLACE = "REPLACE"
566
- }
567
- /**
568
- * Represents offsets specifying a string interval to analyze in the {@link BaseClient.bitcount | bitcount} and {@link BaseClient.bitpos | bitpos} commands.
569
- * The offsets are zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on.
570
- * The offsets can also be negative numbers indicating offsets starting at the end of the string, with `-1` being
571
- * the last index of the string, `-2` being the penultimate, and so on.
572
- *
573
- * If you are using Valkey 7.0.0 or above, the optional `indexType` can also be provided to specify whether the
574
- * `start` and `end` offsets specify `BIT` or `BYTE` offsets. If `indexType` is not provided, `BYTE` offsets
575
- * are assumed. If `BIT` is specified, `start=0` and `end=2` means to look at the first three bits. If `BYTE` is
576
- * specified, `start=0` and `end=2` means to look at the first three bytes.
577
- *
578
- * @see {@link https://valkey.io/commands/bitcount/ | bitcount} and {@link https://valkey.io/commands/bitpos/ | bitpos} for more details.
579
- */
580
- export interface BitOffsetOptions {
581
- /** The starting offset index. */
582
- start: number;
583
- /**
584
- * The ending offset index. Optional since Valkey version 8.0 and above for the BITCOUNT command.
585
- * If not provided, it will default to the end of the string.
586
- * Could be defined only if `start` is defined.
587
- */
588
- end?: number;
589
- /**
590
- * The index offset type. This option can only be specified if you are using server version 7.0.0 or above.
591
- * Could be either {@link BitmapIndexType.BYTE} or {@link BitmapIndexType.BIT}.
592
- * If no index type is provided, the indexes will be assumed to be byte indexes.
593
- */
594
- indexType?: BitmapIndexType;
595
- }
596
- /**
597
- * Enumeration specifying if index arguments are BYTE indexes or BIT indexes.
598
- * Can be specified in {@link BitOffsetOptions}, which is an optional argument to the {@link BaseClient.bitcount|bitcount} command.
599
- * Can also be specified as an optional argument to the {@link BaseClient.bitposInverval|bitposInterval} command.
600
- *
601
- * since - Valkey version 7.0.0.
602
- */
603
- export declare enum BitmapIndexType {
604
- /** Specifies that provided indexes are byte indexes. */
605
- BYTE = "BYTE",
606
- /** Specifies that provided indexes are bit indexes. */
607
- BIT = "BIT"
608
- }
609
- /**
610
- * Defines flushing mode for {@link GlideClient.flushall}, {@link GlideClusterClient.flushall},
611
- * {@link GlideClient.functionFlush}, {@link GlideClusterClient.functionFlush},
612
- * {@link GlideClient.flushdb} and {@link GlideClusterClient.flushdb} commands.
613
- *
614
- * See https://valkey.io/commands/flushall/ and https://valkey.io/commands/flushdb/ for details.
615
- */
616
- export declare enum FlushMode {
617
- /**
618
- * Flushes synchronously.
619
- *
620
- * since Valkey version 6.2.0.
621
- */
622
- SYNC = "SYNC",
623
- /** Flushes asynchronously. */
624
- ASYNC = "ASYNC"
625
- }
626
- /** Optional arguments for {@link BaseClient.xread|xread} command. */
627
- export interface StreamReadOptions {
628
- /**
629
- * If set, the read request will block for the set amount of milliseconds or
630
- * until the server has the required number of entries. A value of `0` will block indefinitely.
631
- * Equivalent to `BLOCK` in the Valkey API.
632
- */
633
- block?: number;
634
- /**
635
- * The maximal number of elements requested.
636
- * Equivalent to `COUNT` in the Valkey API.
637
- */
638
- count?: number;
639
- }
640
- /** Optional arguments for {@link BaseClient.xreadgroup|xreadgroup} command. */
641
- export type StreamReadGroupOptions = StreamReadOptions & {
642
- /**
643
- * If set, messages are not added to the Pending Entries List (PEL). This is equivalent to
644
- * acknowledging the message when it is read.
645
- */
646
- noAck?: boolean;
647
- };
648
- /** Optional arguments for {@link BaseClient.xpendingWithOptions|xpending}. */
649
- export interface StreamPendingOptions {
650
- /** Filter pending entries by their idle time - in milliseconds. Available since Valkey 6.2.0. */
651
- minIdleTime?: number;
652
- /** Starting stream ID bound for range. Exclusive range is available since Valkey 6.2.0. */
653
- start: Boundary<string>;
654
- /** Ending stream ID bound for range. Exclusive range is available since Valkey 6.2.0. */
655
- end: Boundary<string>;
656
- /** Limit the number of messages returned. */
657
- count: number;
658
- /** Filter pending entries by consumer. */
659
- consumer?: GlideString;
660
- }
661
- /** Optional parameters for {@link BaseClient.xclaim|xclaim} command. */
662
- export interface StreamClaimOptions {
663
- /**
664
- * Set the idle time (last time it was delivered) of the message in milliseconds. If `idle`
665
- * is not specified, an `idle` of `0` is assumed, that is, the time count is reset
666
- * because the message now has a new owner trying to process it.
667
- */
668
- idle?: number;
669
- /**
670
- * This is the same as {@link idle} but instead of a relative amount of milliseconds, it sets the
671
- * idle time to a specific Unix time (in milliseconds). This is useful in order to rewrite the AOF
672
- * file generating `XCLAIM` commands.
673
- */
674
- idleUnixTime?: number;
675
- /**
676
- * Set the retry counter to the specified value. This counter is incremented every time a message
677
- * is delivered again. Normally {@link BaseClient.xclaim|xclaim} does not alter this counter,
678
- * which is just served to clients when the {@link BaseClient.xpending|xpending} command is called:
679
- * this way clients can detect anomalies, like messages that are never processed for some reason
680
- * after a big number of delivery attempts.
681
- */
682
- retryCount?: number;
683
- /**
684
- * Creates the pending message entry in the PEL even if certain specified IDs are not already in
685
- * the PEL assigned to a different client. However, the message must exist in the stream,
686
- * otherwise the IDs of non-existing messages are ignored.
687
- */
688
- isForce?: boolean;
689
- }
690
- /**
691
- * Optional arguments for {@link BaseClient.xgroupCreate|xgroupCreate}.
692
- *
693
- * See https://valkey.io/commands/xgroup-create/ for more details.
694
- */
695
- export interface StreamGroupOptions {
696
- /**
697
- * If `true`and the stream doesn't exist, creates a new stream with a length of `0`.
698
- */
699
- mkStream?: boolean;
700
- /**
701
- * An arbitrary ID (that isn't the first ID, last ID, or the zero `"0-0"`. Use it to
702
- * find out how many entries are between the arbitrary ID (excluding it) and the stream's last
703
- * entry.
704
- *
705
- * since Valkey version 7.0.0.
706
- */
707
- entriesRead?: string;
708
- }
709
- /** Additional parameters for `LOLWUT` command. */
710
- export interface LolwutOptions {
711
- /**
712
- * An optional argument that can be used to specify the version of computer art to generate.
713
- */
714
- version?: number;
715
- /**
716
- * An optional argument that can be used to specify the output:
717
- * - For version `5`, those are length of the line, number of squares per row, and number of squares per column.
718
- * - For version `6`, those are number of columns and number of lines.
719
- */
720
- parameters?: number[];
721
- }
722
- /**
723
- * Optional arguments for `RESTORE` command.
724
- *
725
- * @See {@link https://valkey.io/commands/restore/|valkey.io} for details.
726
- * @remarks `IDLETIME` and `FREQ` modifiers cannot be set at the same time.
727
- */
728
- export interface RestoreOptions {
729
- /**
730
- * Set to `true` to replace the key if it exists.
731
- */
732
- replace?: boolean;
733
- /**
734
- * Set to `true` to specify that `ttl` argument of {@link BaseClient.restore} represents
735
- * an absolute Unix timestamp (in milliseconds).
736
- */
737
- absttl?: boolean;
738
- /**
739
- * Set the `IDLETIME` option with object idletime to the given key.
740
- */
741
- idletime?: number;
742
- /**
743
- * Set the `FREQ` option with object frequency to the given key.
744
- */
745
- frequency?: number;
746
- }
747
- /**
748
- * Optional arguments to LPOS command.
749
- *
750
- * See https://valkey.io/commands/lpos/ for more details.
751
- */
752
- export interface LPosOptions {
753
- /** The rank of the match to return. */
754
- rank?: number;
755
- /** The specific number of matching indices from a list. */
756
- count?: number;
757
- /** The maximum number of comparisons to make between the element and the items in the list. */
758
- maxLength?: number;
759
- }
760
- /**
761
- * An optional condition to the {@link BaseClient.geoadd | geoadd},
762
- * {@link BaseClient.zadd | zadd} and {@link BaseClient.set | set} commands.
763
- */
764
- export declare enum ConditionalChange {
765
- /**
766
- * Only update elements that already exist. Don't add new elements. Equivalent to `XX` in the Valkey API.
767
- */
768
- ONLY_IF_EXISTS = "XX",
769
- /**
770
- * Only add new elements. Don't update already existing elements. Equivalent to `NX` in the Valkey API.
771
- */
772
- ONLY_IF_DOES_NOT_EXIST = "NX"
773
- }
774
- /**
775
- * Represents a geographic position defined by longitude and latitude.
776
- * The exact limits, as specified by `EPSG:900913 / EPSG:3785 / OSGEO:41001` are the
777
- * following:
778
- *
779
- * Valid longitudes are from `-180` to `180` degrees.
780
- * Valid latitudes are from `-85.05112878` to `85.05112878` degrees.
781
- */
782
- export interface GeospatialData {
783
- /** The longitude coordinate. */
784
- longitude: number;
785
- /** The latitude coordinate. */
786
- latitude: number;
787
- }
788
- /**
789
- * Optional arguments for the GeoAdd command.
790
- *
791
- * See https://valkey.io/commands/geoadd/ for more details.
792
- */
793
- export interface GeoAddOptions {
794
- /** Options for handling existing members. See {@link ConditionalChange}. */
795
- updateMode?: ConditionalChange;
796
- /** If `true`, returns the count of changed elements instead of new elements added. */
797
- changed?: boolean;
798
- }
799
- /** Enumeration representing distance units options. */
800
- export declare enum GeoUnit {
801
- /** Represents distance in meters. */
802
- METERS = "m",
803
- /** Represents distance in kilometers. */
804
- KILOMETERS = "km",
805
- /** Represents distance in miles. */
806
- MILES = "mi",
807
- /** Represents distance in feet. */
808
- FEET = "ft"
809
- }
810
- /**
811
- * Optional parameters for {@link BaseClient.geosearch|geosearch} command which defines what should be included in the
812
- * search results and how results should be ordered and limited.
813
- */
814
- export type GeoSearchResultOptions = GeoSearchCommonResultOptions & {
815
- /** Include the coordinate of the returned items. */
816
- withCoord?: boolean;
817
- /**
818
- * Include the distance of the returned items from the specified center point.
819
- * The distance is returned in the same unit as specified for the `searchBy` argument.
820
- */
821
- withDist?: boolean;
822
- /** Include the geohash of the returned items. */
823
- withHash?: boolean;
824
- };
825
- /**
826
- * Optional parameters for {@link BaseClient.geosearchstore|geosearchstore} command which defines what should be included in the
827
- * search results and how results should be ordered and limited.
828
- */
829
- export type GeoSearchStoreResultOptions = GeoSearchCommonResultOptions & {
830
- /**
831
- * Determines what is stored as the sorted set score. Defaults to `false`.
832
- * - If set to `false`, the geohash of the location will be stored as the sorted set score.
833
- * - If set to `true`, the distance from the center of the shape (circle or box) will be stored as the sorted set score. The distance is represented as a floating-point number in the same unit specified for that shape.
834
- */
835
- storeDist?: boolean;
836
- };
837
- interface GeoSearchCommonResultOptions {
838
- /** Indicates the order the result should be sorted in. */
839
- sortOrder?: SortOrder;
840
- /** Indicates the number of matches the result should be limited to. */
841
- count?: number;
842
- /** Whether to allow returning as enough matches are found. This requires `count` parameter to be set. */
843
- isAny?: boolean;
844
- }
845
- /** Defines the sort order for nested results. */
846
- export declare enum SortOrder {
847
- /** Sort by ascending order. */
848
- ASC = "ASC",
849
- /** Sort by descending order. */
850
- DESC = "DESC"
851
- }
852
- export type GeoSearchShape = GeoCircleShape | GeoBoxShape;
853
- /** Circle search shape defined by the radius value and measurement unit. */
854
- export interface GeoCircleShape {
855
- /** The radius to search by. */
856
- radius: number;
857
- /** The measurement unit of the radius. */
858
- unit: GeoUnit;
859
- }
860
- /** Rectangle search shape defined by the width and height and measurement unit. */
861
- export interface GeoBoxShape {
862
- /** The width of the rectangle to search by. */
863
- width: number;
864
- /** The height of the rectangle to search by. */
865
- height: number;
866
- /** The measurement unit of the width and height. */
867
- unit: GeoUnit;
868
- }
869
- export type SearchOrigin = CoordOrigin | MemberOrigin;
870
- /** The search origin represented by a {@link GeospatialData} position. */
871
- export interface CoordOrigin {
872
- /** The pivot location to search from. */
873
- position: GeospatialData;
874
- }
875
- /** The search origin represented by an existing member. */
876
- export interface MemberOrigin {
877
- /** Member (location) name stored in the sorted set to use as a search pivot. */
878
- member: GlideString;
879
- }
880
- /**
881
- * Mandatory option for zmpop.
882
- * Defines which elements to pop from the sorted set.
883
- */
884
- export declare enum ScoreFilter {
885
- /** Pop elements with the highest scores. */
886
- MAX = "MAX",
887
- /** Pop elements with the lowest scores. */
888
- MIN = "MIN"
889
- }
890
- /**
891
- * Optional arguments to {@link BaseClient.sort|sort}, {@link BaseClient.sortStore|sortStore} and {@link BaseClient.sortReadOnly|sortReadOnly} commands.
892
- *
893
- * See https://valkey.io/commands/sort/ for more details.
894
- *
895
- * @remarks When in cluster mode, {@link SortOptions.byPattern|byPattern} and {@link SortOptions.getPatterns|getPattern} must map to the same hash
896
- * slot as the key, and this is supported only since Valkey version 8.0.
897
- */
898
- export interface SortOptions {
899
- /**
900
- * A pattern to sort by external keys instead of by the elements stored at the key themselves. The
901
- * pattern should contain an asterisk (*) as a placeholder for the element values, where the value
902
- * from the key replaces the asterisk to create the key name. For example, if `key`
903
- * contains IDs of objects, `byPattern` can be used to sort these IDs based on an
904
- * attribute of the objects, like their weights or timestamps.
905
- * Supported in cluster mode since Valkey version 8.0 and above.
906
- */
907
- byPattern?: GlideString;
908
- /**
909
- * Limiting the range of the query by setting offset and result count. See {@link Limit} class for
910
- * more information.
911
- */
912
- limit?: Limit;
913
- /**
914
- * A pattern used to retrieve external keys' values, instead of the elements at `key`.
915
- * The pattern should contain an asterisk (`*`) as a placeholder for the element values, where the
916
- * value from `key` replaces the asterisk to create the `key` name. This
917
- * allows the sorted elements to be transformed based on the related keys values. For example, if
918
- * `key` contains IDs of users, `getPatterns` can be used to retrieve
919
- * specific attributes of these users, such as their names or email addresses. E.g., if
920
- * `getPatterns` is `name_*`, the command will return the values of the keys
921
- * `name_<element>` for each sorted element. Multiple `getPatterns`
922
- * arguments can be provided to retrieve multiple attributes. The special value `#` can
923
- * be used to include the actual element from `key` being sorted. If not provided, only
924
- * the sorted elements themselves are returned.
925
- * Supported in cluster mode since Valkey version 8.0 and above.
926
- */
927
- getPatterns?: GlideString[];
928
- /** Options for sorting order of elements. */
929
- orderBy?: SortOrder;
930
- /**
931
- * When `true`, sorts elements lexicographically. When `false` (default),
932
- * sorts elements numerically. Use this when the list, set, or sorted set contains string values
933
- * that cannot be converted into double precision floating point numbers.
934
- */
935
- isAlpha?: boolean;
936
- }
937
- /**
938
- * The `LIMIT` argument is commonly used to specify a subset of results from the
939
- * matching elements, similar to the `LIMIT` clause in SQL (e.g., `SELECT LIMIT offset, count`).
940
- */
941
- export interface Limit {
942
- /** The starting position of the range, zero based. */
943
- offset: number;
944
- /** The maximum number of elements to include in the range. A negative count returns all elements from the offset. */
945
- count: number;
946
- }
947
- /**
948
- * This base class represents the common set of optional arguments for the SCAN family of commands.
949
- * Concrete implementations of this class are tied to specific SCAN commands (`SCAN`, `SSCAN`).
950
- */
951
- export interface BaseScanOptions {
952
- /**
953
- * The match filter is applied to the result of the command and will only include
954
- * strings that match the pattern specified. If the sorted set is large enough for scan commands to return
955
- * only a subset of the sorted set then there could be a case where the result is empty although there are
956
- * items that match the pattern specified. This is due to the default `COUNT` being `10` which indicates
957
- * that it will only fetch and match `10` items from the list.
958
- */
959
- match?: GlideString;
960
- /**
961
- * `COUNT` is a just a hint for the command for how many elements to fetch from the
962
- * sorted set. `COUNT` could be ignored until the sorted set is large enough for the `SCAN` commands to
963
- * represent the results as compact single-allocation packed encoding.
964
- */
965
- readonly count?: number;
966
- }
967
- /**
968
- * Options for the SCAN command.
969
- * `match`: The match filter is applied to the result of the command and will only include keys that match the pattern specified.
970
- * `count`: `COUNT` is a just a hint for the command for how many elements to fetch from the server, the default is 10.
971
- * `type`: The type of the object to scan.
972
- * Types are the data types of Valkey: `string`, `list`, `set`, `zset`, `hash`, `stream`.
973
- */
974
- export interface ScanOptions extends BaseScanOptions {
975
- type?: ObjectType;
976
- }
977
- /**
978
- * Options for the SCAN command.
979
- * `match`: The match filter is applied to the result of the command and will only include keys that match the pattern specified.
980
- * `count`: `COUNT` is a just a hint for the command for how many elements to fetch from the server, the default is 10.
981
- * `type`: The type of the object to scan.
982
- * Types are the data types of Valkey: `string`, `list`, `set`, `zset`, `hash`, `stream`.
983
- * `allowNonCoveredSlots`: If true, the scan will keep scanning even if slots are not covered by the cluster.
984
- * By default, the scan will stop if slots are not covered by the cluster.
985
- */
986
- export interface ClusterScanOptions extends ScanOptions {
987
- allowNonCoveredSlots?: boolean;
988
- }
989
- /**
990
- * Options specific to the ZSCAN command, extending from the base scan options.
991
- */
992
- export type ZScanOptions = BaseScanOptions & {
993
- /**
994
- * If true, the scores are not included in the results.
995
- * Supported from Valkey 8.0.0 and above.
996
- */
997
- readonly noScores?: boolean;
998
- };
999
- /**
1000
- * Options specific to the HSCAN command, extending from the base scan options.
1001
- */
1002
- export type HScanOptions = BaseScanOptions & {
1003
- /**
1004
- * If true, the values of the fields are not included in the results.
1005
- * Supported from Valkey 8.0.0 and above.
1006
- */
1007
- readonly noValues?: boolean;
1008
- };
1009
- /**
1010
- * Time unit representation which is used in optional arguments for {@link BaseClient.getex|getex} and {@link BaseClient.set|set} command.
1011
- */
1012
- export declare enum TimeUnit {
1013
- /**
1014
- * Set the specified expire time, in seconds. Equivalent to
1015
- * `EX` in the VALKEY API.
1016
- */
1017
- Seconds = "EX",
1018
- /**
1019
- * Set the specified expire time, in milliseconds. Equivalent
1020
- * to `PX` in the VALKEY API.
1021
- */
1022
- Milliseconds = "PX",
1023
- /**
1024
- * Set the specified Unix time at which the key will expire,
1025
- * in seconds. Equivalent to `EXAT` in the VALKEY API.
1026
- */
1027
- UnixSeconds = "EXAT",
1028
- /**
1029
- * Set the specified Unix time at which the key will expire,
1030
- * in milliseconds. Equivalent to `PXAT` in the VALKEY API.
1031
- */
1032
- UnixMilliseconds = "PXAT"
1033
- }
1034
- export {};