Skip to content

Commit 20c16e0

Browse files
authored
(docs) add jsdoc comments to command parsers (#2984)
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
1 parent e4a1ca4 commit 20c16e0

File tree

491 files changed

+3861
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

491 files changed

+3861
-1
lines changed

packages/bloom/lib/commands/bloom/ADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Adds an item to a Bloom Filter
9+
* @param parser - The command parser
10+
* @param key - The name of the Bloom filter
11+
* @param item - The item to add to the filter
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('BF.ADD');
915
parser.pushKey(key);

packages/bloom/lib/commands/bloom/CARD.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { RedisArgument, NumberReply, Command } from '@redis/client/dist/lib/RESP
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Returns the cardinality (number of items) in a Bloom Filter
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to query
10+
*/
611
parseCommand(parser: CommandParser, key: RedisArgument) {
712
parser.push('BF.CARD');
813
parser.pushKey(key);

packages/bloom/lib/commands/bloom/EXISTS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: true,
7+
/**
8+
* Checks if an item exists in a Bloom Filter
9+
* @param parser - The command parser
10+
* @param key - The name of the Bloom filter
11+
* @param item - The item to check for existence
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('BF.EXISTS');
915
parser.pushKey(key);

packages/bloom/lib/commands/bloom/INFO.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export type BfInfoReplyMap = TuplesToMapReply<[
1212

1313
export default {
1414
IS_READ_ONLY: true,
15+
/**
16+
* Returns information about a Bloom Filter, including capacity, size, number of filters, items inserted, and expansion rate
17+
* @param parser - The command parser
18+
* @param key - The name of the Bloom filter to get information about
19+
*/
1520
parseCommand(parser: CommandParser, key: RedisArgument) {
1621
parser.push('BF.INFO');
1722
parser.pushKey(key);

packages/bloom/lib/commands/bloom/INSERT.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ export interface BfInsertOptions {
1313

1414
export default {
1515
IS_READ_ONLY: false,
16+
/**
17+
* Adds one or more items to a Bloom Filter, creating it if it does not exist
18+
* @param parser - The command parser
19+
* @param key - The name of the Bloom filter
20+
* @param items - One or more items to add to the filter
21+
* @param options - Optional parameters for filter creation
22+
* @param options.CAPACITY - Desired capacity for a new filter
23+
* @param options.ERROR - Desired error rate for a new filter
24+
* @param options.EXPANSION - Expansion rate for a new filter
25+
* @param options.NOCREATE - If true, prevents automatic filter creation
26+
* @param options.NONSCALING - Prevents the filter from creating additional sub-filters
27+
*/
1628
parseCommand(
1729
parser: CommandParser,
1830
key: RedisArgument,

packages/bloom/lib/commands/bloom/LOADCHUNK.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Restores a Bloom Filter chunk previously saved using SCANDUMP
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to restore
10+
* @param iterator - Iterator value from the SCANDUMP command
11+
* @param chunk - Data chunk from the SCANDUMP command
12+
*/
613
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number, chunk: RedisArgument) {
714
parser.push('BF.LOADCHUNK');
815
parser.pushKey(key);

packages/bloom/lib/commands/bloom/MADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { transformBooleanArrayReply } from '@redis/client/dist/lib/commands/gene
55

66
export default {
77
IS_READ_ONLY: false,
8+
/**
9+
* Adds multiple items to a Bloom Filter in a single call
10+
* @param parser - The command parser
11+
* @param key - The name of the Bloom filter
12+
* @param items - One or more items to add to the filter
13+
*/
814
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
915
parser.push('BF.MADD');
1016
parser.pushKey(key);

packages/bloom/lib/commands/bloom/MEXISTS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { transformBooleanArrayReply } from '@redis/client/dist/lib/commands/gene
55

66
export default {
77
IS_READ_ONLY: true,
8+
/**
9+
* Checks if multiple items exist in a Bloom Filter in a single call
10+
* @param parser - The command parser
11+
* @param key - The name of the Bloom filter
12+
* @param items - One or more items to check for existence
13+
*/
814
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
915
parser.push('BF.MEXISTS');
1016
parser.pushKey(key);

packages/bloom/lib/commands/bloom/RESERVE.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ export interface BfReserveOptions {
88

99
export default {
1010
IS_READ_ONLY: true,
11+
/**
12+
* Creates an empty Bloom Filter with a given desired error ratio and initial capacity
13+
* @param parser - The command parser
14+
* @param key - The name of the Bloom filter to create
15+
* @param errorRate - The desired probability for false positives (between 0 and 1)
16+
* @param capacity - The number of entries intended to be added to the filter
17+
* @param options - Optional parameters to tune the filter
18+
* @param options.EXPANSION - Expansion rate for the filter
19+
* @param options.NONSCALING - Prevents the filter from creating additional sub-filters
20+
*/
1121
parseCommand(
1222
parser: CommandParser,
1323
key: RedisArgument,

packages/bloom/lib/commands/bloom/SCANDUMP.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, UnwrapReply,
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Begins an incremental save of a Bloom Filter. This is useful for large filters that can't be saved at once
8+
* @param parser - The command parser
9+
* @param key - The name of the Bloom filter to save
10+
* @param iterator - Iterator value; Start at 0, and use the iterator from the response for the next chunk
11+
*/
612
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number) {
713
parser.push('BF.SCANDUMP');
814
parser.pushKey(key);

packages/bloom/lib/commands/count-min-sketch/INCRBY.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export interface BfIncrByItem {
88

99
export default {
1010
IS_READ_ONLY: false,
11+
/**
12+
* Increases the count of one or more items in a Count-Min Sketch
13+
* @param parser - The command parser
14+
* @param key - The name of the sketch
15+
* @param items - A single item or array of items to increment, each with an item and increment value
16+
*/
1117
parseCommand(
1218
parser: CommandParser,
1319
key: RedisArgument,

packages/bloom/lib/commands/count-min-sketch/INFO.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export interface CmsInfoReply {
1616

1717
export default {
1818
IS_READ_ONLY: true,
19+
/**
20+
* Returns width, depth, and total count of items in a Count-Min Sketch
21+
* @param parser - The command parser
22+
* @param key - The name of the sketch to get information about
23+
*/
1924
parseCommand(parser: CommandParser, key: RedisArgument) {
2025
parser.push('CMS.INFO');
2126
parser.pushKey(key);

packages/bloom/lib/commands/count-min-sketch/INITBYDIM.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Initialize a Count-Min Sketch using width and depth parameters
8+
* @param parser - The command parser
9+
* @param key - The name of the sketch
10+
* @param width - Number of counters in each array (must be a multiple of 2)
11+
* @param depth - Number of counter arrays (determines accuracy of estimates)
12+
*/
613
parseCommand(parser: CommandParser, key: RedisArgument, width: number, depth: number) {
714
parser.push('CMS.INITBYDIM');
815
parser.pushKey(key);

packages/bloom/lib/commands/count-min-sketch/INITBYPROB.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Initialize a Count-Min Sketch using error rate and probability parameters
8+
* @param parser - The command parser
9+
* @param key - The name of the sketch
10+
* @param error - Estimate error, as a decimal between 0 and 1
11+
* @param probability - The desired probability for inflated count, as a decimal between 0 and 1
12+
*/
613
parseCommand(parser: CommandParser, key: RedisArgument, error: number, probability: number) {
714
parser.push('CMS.INITBYPROB');
815
parser.pushKey(key);

packages/bloom/lib/commands/count-min-sketch/MERGE.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ export type BfMergeSketches = Array<RedisArgument> | Array<BfMergeSketch>;
1010

1111
export default {
1212
IS_READ_ONLY: false,
13+
/**
14+
* Merges multiple Count-Min Sketches into a single sketch, with optional weights
15+
* @param parser - The command parser
16+
* @param destination - The name of the destination sketch
17+
* @param source - Array of sketch names or array of sketches with weights
18+
*/
1319
parseCommand(
1420
parser: CommandParser,
1521
destination: RedisArgument,

packages/bloom/lib/commands/count-min-sketch/QUERY.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: true,
7+
/**
8+
* Returns the count for one or more items in a Count-Min Sketch
9+
* @param parser - The command parser
10+
* @param key - The name of the sketch
11+
* @param items - One or more items to get counts for
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
814
parser.push('CMS.QUERY');
915
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/ADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Adds an item to a Cuckoo Filter, creating the filter if it does not exist
9+
* @param parser - The command parser
10+
* @param key - The name of the Cuckoo filter
11+
* @param item - The item to add to the filter
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('CF.ADD');
915
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/ADDNX.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Adds an item to a Cuckoo Filter only if it does not exist
9+
* @param parser - The command parser
10+
* @param key - The name of the Cuckoo filter
11+
* @param item - The item to add to the filter if it doesn't exist
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('CF.ADDNX');
915
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/COUNT.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { RedisArgument, NumberReply, Command } from '@redis/client/dist/lib/RESP
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Returns the number of times an item appears in a Cuckoo Filter
8+
* @param parser - The command parser
9+
* @param key - The name of the Cuckoo filter
10+
* @param item - The item to count occurrences of
11+
*/
612
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
713
parser.push('CF.COUNT');
814
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/DEL.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Removes an item from a Cuckoo Filter if it exists
9+
* @param parser - The command parser
10+
* @param key - The name of the Cuckoo filter
11+
* @param item - The item to remove from the filter
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('CF.DEL');
915
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/EXISTS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { transformBooleanReply } from '@redis/client/dist/lib/commands/generic-t
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Checks if an item exists in a Cuckoo Filter
9+
* @param parser - The command parser
10+
* @param key - The name of the Cuckoo filter
11+
* @param item - The item to check for existence
12+
*/
713
parseCommand(parser: CommandParser, key: RedisArgument, item: RedisArgument) {
814
parser.push('CF.EXISTS');
915
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/INFO.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export type CfInfoReplyMap = TuplesToMapReply<[
1515

1616
export default {
1717
IS_READ_ONLY: true,
18+
/**
19+
* Returns detailed information about a Cuckoo Filter including size, buckets, filters count, items statistics and configuration
20+
* @param parser - The command parser
21+
* @param key - The name of the Cuckoo filter to get information about
22+
*/
1823
parseCommand(parser: CommandParser, key: RedisArgument) {
1924
parser.push('CF.INFO');
2025
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/INSERT.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export function parseCfInsertArguments(
2929

3030
export default {
3131
IS_READ_ONLY: false,
32+
/**
33+
* Adds one or more items to a Cuckoo Filter, creating it if it does not exist
34+
* @param parser - The command parser
35+
* @param key - The name of the Cuckoo filter
36+
* @param items - One or more items to add to the filter
37+
* @param options - Optional parameters for filter creation
38+
* @param options.CAPACITY - The number of entries intended to be added to the filter
39+
* @param options.NOCREATE - If true, prevents automatic filter creation
40+
*/
3241
parseCommand(...args: Parameters<typeof parseCfInsertArguments>) {
3342
args[0].push('CF.INSERT');
3443
parseCfInsertArguments(...args);

packages/bloom/lib/commands/cuckoo/INSERTNX.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import { Command } from '@redis/client/dist/lib/RESP/types';
22
import INSERT, { parseCfInsertArguments } from './INSERT';
33

4+
/**
5+
* Adds one or more items to a Cuckoo Filter only if they do not exist yet, creating the filter if needed
6+
* @param parser - The command parser
7+
* @param key - The name of the Cuckoo filter
8+
* @param items - One or more items to add to the filter
9+
* @param options - Optional parameters for filter creation
10+
* @param options.CAPACITY - The number of entries intended to be added to the filter
11+
* @param options.NOCREATE - If true, prevents automatic filter creation
12+
*/
413
export default {
514
IS_READ_ONLY: INSERT.IS_READ_ONLY,
615
parseCommand(...args: Parameters<typeof parseCfInsertArguments>) {

packages/bloom/lib/commands/cuckoo/LOADCHUNK.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { SimpleStringReply, Command, RedisArgument } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Restores a Cuckoo Filter chunk previously saved using SCANDUMP
8+
* @param parser - The command parser
9+
* @param key - The name of the Cuckoo filter to restore
10+
* @param iterator - Iterator value from the SCANDUMP command
11+
* @param chunk - Data chunk from the SCANDUMP command
12+
*/
613
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number, chunk: RedisArgument) {
714
parser.push('CF.LOADCHUNK');
815
parser.pushKey(key);

packages/bloom/lib/commands/cuckoo/RESERVE.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ export interface CfReserveOptions {
99

1010
export default {
1111
IS_READ_ONLY: false,
12+
/**
13+
* Creates an empty Cuckoo Filter with specified capacity and parameters
14+
* @param parser - The command parser
15+
* @param key - The name of the Cuckoo filter to create
16+
* @param capacity - The number of entries intended to be added to the filter
17+
* @param options - Optional parameters to tune the filter
18+
* @param options.BUCKETSIZE - Number of items in each bucket
19+
* @param options.MAXITERATIONS - Maximum number of iterations before declaring filter full
20+
* @param options.EXPANSION - Number of additional buckets per expansion
21+
*/
1222
parseCommand(
1323
parser: CommandParser,
1424
key: RedisArgument,

packages/bloom/lib/commands/cuckoo/SCANDUMP.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { RedisArgument, TuplesReply, NumberReply, BlobStringReply, NullReply, Un
33

44
export default {
55
IS_READ_ONLY: true,
6+
/**
7+
* Begins an incremental save of a Cuckoo Filter. This is useful for large filters that can't be saved at once
8+
* @param parser - The command parser
9+
* @param key - The name of the Cuckoo filter to save
10+
* @param iterator - Iterator value; Start at 0, and use the iterator from the response for the next chunk
11+
*/
612
parseCommand(parser: CommandParser, key: RedisArgument, iterator: number) {
713
parser.push('CF.SCANDUMP');
814
parser.pushKey(key);

packages/bloom/lib/commands/t-digest/ADD.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { SimpleStringReply, Command, RedisArgument } from '@redis/client/dist/li
33

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Adds one or more observations to a t-digest sketch
8+
* @param parser - The command parser
9+
* @param key - The name of the t-digest sketch
10+
* @param values - Array of numeric values to add to the sketch
11+
*/
612
parseCommand(parser: CommandParser, key: RedisArgument, values: Array<number>) {
713
parser.push('TDIGEST.ADD');
814
parser.pushKey(key);

packages/bloom/lib/commands/t-digest/BYRANK.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export function transformByRankArguments(
1616

1717
export default {
1818
IS_READ_ONLY: true,
19+
/**
20+
* Returns value estimates for one or more ranks in a t-digest sketch
21+
* @param parser - The command parser
22+
* @param key - The name of the t-digest sketch
23+
* @param ranks - Array of ranks to get value estimates for (ascending order)
24+
*/
1925
parseCommand(...args: Parameters<typeof transformByRankArguments>) {
2026
args[0].push('TDIGEST.BYRANK');
2127
transformByRankArguments(...args);

0 commit comments

Comments
 (0)