Skip to content

Commit 70a9d6a

Browse files
committed
(docs) jsdoc comments to time series commands
1 parent 6579aa6 commit 70a9d6a

30 files changed

+255
-0
lines changed

packages/time-series/lib/commands/ADD.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ export interface TsAddOptions {
2929

3030
export default {
3131
IS_READ_ONLY: false,
32+
/**
33+
* Creates or appends a sample to a time series
34+
* @param parser - The command parser
35+
* @param key - The key name for the time series
36+
* @param timestamp - The timestamp of the sample
37+
* @param value - The value of the sample
38+
* @param options - Optional configuration parameters
39+
*/
3240
parseCommand(
3341
parser: CommandParser,
3442
key: RedisArgument,

packages/time-series/lib/commands/ALTER.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export type TsAlterOptions = Pick<TsCreateOptions, 'RETENTION' | 'CHUNK_SIZE' |
88

99
export default {
1010
IS_READ_ONLY: false,
11+
/**
12+
* Alters the configuration of an existing time series
13+
* @param parser - The command parser
14+
* @param key - The key name for the time series
15+
* @param options - Configuration parameters to alter
16+
*/
1117
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsAlterOptions) {
1218
parser.push('TS.ALTER');
1319
parser.pushKey(key);

packages/time-series/lib/commands/CREATE.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ export interface TsCreateOptions {
2424

2525
export default {
2626
IS_READ_ONLY: false,
27+
/**
28+
* Creates a new time series
29+
* @param parser - The command parser
30+
* @param key - The key name for the new time series
31+
* @param options - Optional configuration parameters
32+
*/
2733
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsCreateOptions) {
2834
parser.push('TS.CREATE');
2935
parser.pushKey(key);

packages/time-series/lib/commands/CREATERULE.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ export type TimeSeriesAggregationType = typeof TIME_SERIES_AGGREGATION_TYPE[keyo
2121

2222
export default {
2323
IS_READ_ONLY: false,
24+
/**
25+
* Creates a compaction rule from source time series to destination time series
26+
* @param parser - The command parser
27+
* @param sourceKey - The source time series key
28+
* @param destinationKey - The destination time series key
29+
* @param aggregationType - The aggregation type to use
30+
* @param bucketDuration - The duration of each bucket in milliseconds
31+
* @param alignTimestamp - Optional timestamp for alignment
32+
*/
2433
parseCommand(
2534
parser: CommandParser,
2635
sourceKey: RedisArgument,

packages/time-series/lib/commands/DECRBY.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import INCRBY, { parseIncrByArguments } from './INCRBY';
33

44
export default {
55
IS_READ_ONLY: INCRBY.IS_READ_ONLY,
6+
/**
7+
* Decreases the value of a time series by a given amount
8+
* @param args - Arguments passed to the parseIncrByArguments function
9+
*/
610
parseCommand(...args: Parameters<typeof parseIncrByArguments>) {
711
const parser = args[0];
812

packages/time-series/lib/commands/DEL.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import { RedisArgument, NumberReply, Command, } from '@redis/client/dist/lib/RES
44

55
export default {
66
IS_READ_ONLY: false,
7+
/**
8+
* Deletes samples between two timestamps from a time series
9+
* @param parser - The command parser
10+
* @param key - The key name of the time series
11+
* @param fromTimestamp - Start timestamp to delete from
12+
* @param toTimestamp - End timestamp to delete until
13+
*/
714
parseCommand(parser: CommandParser, key: RedisArgument, fromTimestamp: Timestamp, toTimestamp: Timestamp) {
815
parser.push('TS.DEL');
916
parser.pushKey(key);

packages/time-series/lib/commands/DELETERULE.ts

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

44
export default {
55
IS_READ_ONLY: false,
6+
/**
7+
* Deletes a compaction rule between source and destination time series
8+
* @param parser - The command parser
9+
* @param sourceKey - The source time series key
10+
* @param destinationKey - The destination time series key
11+
*/
612
parseCommand(parser: CommandParser, sourceKey: RedisArgument, destinationKey: RedisArgument) {
713
parser.push('TS.DELETERULE');
814
parser.pushKeys([sourceKey, destinationKey]);

packages/time-series/lib/commands/GET.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ export type TsGetReply = TuplesReply<[]> | TuplesReply<[NumberReply, DoubleReply
99

1010
export default {
1111
IS_READ_ONLY: true,
12+
/**
13+
* Gets the last sample of a time series
14+
* @param parser - The command parser
15+
* @param key - The key name of the time series
16+
* @param options - Optional parameters for the command
17+
*/
1218
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsGetOptions) {
1319
parser.push('TS.GET');
1420
parser.pushKey(key);

packages/time-series/lib/commands/INCRBY.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ export interface TsIncrByOptions {
1212
IGNORE?: TsIgnoreOptions;
1313
}
1414

15+
/**
16+
* Parses arguments for incrementing a time series value
17+
* @param parser - The command parser
18+
* @param key - The key name of the time series
19+
* @param value - The value to increment by
20+
* @param options - Optional parameters for the command
21+
*/
1522
export function parseIncrByArguments(
1623
parser: CommandParser,
1724
key: RedisArgument,
@@ -40,6 +47,10 @@ export function parseIncrByArguments(
4047

4148
export default {
4249
IS_READ_ONLY: false,
50+
/**
51+
* Increases the value of a time series by a given amount
52+
* @param args - Arguments passed to the {@link parseIncrByArguments} function
53+
*/
4354
parseCommand(...args: Parameters<typeof parseIncrByArguments>) {
4455
const parser = args[0];
4556

packages/time-series/lib/commands/INFO.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ export interface InfoReply {
7373

7474
export default {
7575
IS_READ_ONLY: true,
76+
/**
77+
* Gets information about a time series
78+
* @param parser - The command parser
79+
* @param key - The key name of the time series
80+
*/
7681
parseCommand(parser: CommandParser, key: string) {
7782
parser.push('TS.INFO');
7883
parser.pushKey(key);

0 commit comments

Comments
 (0)