You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
(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
This commit is contained in:
@@ -29,6 +29,14 @@ export interface TsAddOptions {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Creates or appends a sample to a time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name for the time series
|
||||
* @param timestamp - The timestamp of the sample
|
||||
* @param value - The value of the sample
|
||||
* @param options - Optional configuration parameters
|
||||
*/
|
||||
parseCommand(
|
||||
parser: CommandParser,
|
||||
key: RedisArgument,
|
||||
|
@@ -8,6 +8,12 @@ export type TsAlterOptions = Pick<TsCreateOptions, 'RETENTION' | 'CHUNK_SIZE' |
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Alters the configuration of an existing time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name for the time series
|
||||
* @param options - Configuration parameters to alter
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsAlterOptions) {
|
||||
parser.push('TS.ALTER');
|
||||
parser.pushKey(key);
|
||||
|
@@ -24,6 +24,12 @@ export interface TsCreateOptions {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Creates a new time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name for the new time series
|
||||
* @param options - Optional configuration parameters
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsCreateOptions) {
|
||||
parser.push('TS.CREATE');
|
||||
parser.pushKey(key);
|
||||
|
@@ -21,6 +21,15 @@ export type TimeSeriesAggregationType = typeof TIME_SERIES_AGGREGATION_TYPE[keyo
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Creates a compaction rule from source time series to destination time series
|
||||
* @param parser - The command parser
|
||||
* @param sourceKey - The source time series key
|
||||
* @param destinationKey - The destination time series key
|
||||
* @param aggregationType - The aggregation type to use
|
||||
* @param bucketDuration - The duration of each bucket in milliseconds
|
||||
* @param alignTimestamp - Optional timestamp for alignment
|
||||
*/
|
||||
parseCommand(
|
||||
parser: CommandParser,
|
||||
sourceKey: RedisArgument,
|
||||
|
@@ -3,6 +3,10 @@ import INCRBY, { parseIncrByArguments } from './INCRBY';
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: INCRBY.IS_READ_ONLY,
|
||||
/**
|
||||
* Decreases the value of a time series by a given amount
|
||||
* @param args - Arguments passed to the parseIncrByArguments function
|
||||
*/
|
||||
parseCommand(...args: Parameters<typeof parseIncrByArguments>) {
|
||||
const parser = args[0];
|
||||
|
||||
|
@@ -4,6 +4,13 @@ import { RedisArgument, NumberReply, Command, } from '@redis/client/dist/lib/RES
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Deletes samples between two timestamps from a time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name of the time series
|
||||
* @param fromTimestamp - Start timestamp to delete from
|
||||
* @param toTimestamp - End timestamp to delete until
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, fromTimestamp: Timestamp, toTimestamp: Timestamp) {
|
||||
parser.push('TS.DEL');
|
||||
parser.pushKey(key);
|
||||
|
@@ -3,6 +3,12 @@ import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/li
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Deletes a compaction rule between source and destination time series
|
||||
* @param parser - The command parser
|
||||
* @param sourceKey - The source time series key
|
||||
* @param destinationKey - The destination time series key
|
||||
*/
|
||||
parseCommand(parser: CommandParser, sourceKey: RedisArgument, destinationKey: RedisArgument) {
|
||||
parser.push('TS.DELETERULE');
|
||||
parser.pushKeys([sourceKey, destinationKey]);
|
||||
|
@@ -9,6 +9,12 @@ export type TsGetReply = TuplesReply<[]> | TuplesReply<[NumberReply, DoubleReply
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets the last sample of a time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name of the time series
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, options?: TsGetOptions) {
|
||||
parser.push('TS.GET');
|
||||
parser.pushKey(key);
|
||||
|
@@ -12,6 +12,13 @@ export interface TsIncrByOptions {
|
||||
IGNORE?: TsIgnoreOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses arguments for incrementing a time series value
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name of the time series
|
||||
* @param value - The value to increment by
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
export function parseIncrByArguments(
|
||||
parser: CommandParser,
|
||||
key: RedisArgument,
|
||||
@@ -40,6 +47,10 @@ export function parseIncrByArguments(
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Increases the value of a time series by a given amount
|
||||
* @param args - Arguments passed to the {@link parseIncrByArguments} function
|
||||
*/
|
||||
parseCommand(...args: Parameters<typeof parseIncrByArguments>) {
|
||||
const parser = args[0];
|
||||
|
||||
|
@@ -73,6 +73,11 @@ export interface InfoReply {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets information about a time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name of the time series
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: string) {
|
||||
parser.push('TS.INFO');
|
||||
parser.pushKey(key);
|
||||
|
@@ -38,6 +38,11 @@ export interface InfoDebugReply extends InfoReply {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: INFO.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets debug information about a time series
|
||||
* @param parser - The command parser
|
||||
* @param key - The key name of the time series
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: string) {
|
||||
INFO.parseCommand(parser, key);
|
||||
parser.push('DEBUG');
|
||||
|
@@ -10,6 +10,11 @@ export interface TsMAddSample {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Adds multiple samples to multiple time series
|
||||
* @param parser - The command parser
|
||||
* @param toAdd - Array of samples to add to different time series
|
||||
*/
|
||||
parseCommand(parser: CommandParser, toAdd: Array<TsMAddSample>) {
|
||||
parser.push('TS.MADD');
|
||||
|
||||
|
@@ -7,12 +7,22 @@ export interface TsMGetOptions {
|
||||
LATEST?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds LATEST argument to command if specified
|
||||
* @param parser - The command parser
|
||||
* @param latest - Whether to include the LATEST argument
|
||||
*/
|
||||
export function parseLatestArgument(parser: CommandParser, latest?: boolean) {
|
||||
if (latest) {
|
||||
parser.push('LATEST');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds FILTER argument to command
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
*/
|
||||
export function parseFilterArgument(parser: CommandParser, filter: RedisVariadicArgument) {
|
||||
parser.push('FILTER');
|
||||
parser.pushVariadic(filter);
|
||||
@@ -37,6 +47,12 @@ export type MGetRawReply3 = MapReply<
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets the last samples matching a specific filter from multiple time series
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand(parser: CommandParser, filter: RedisVariadicArgument, options?: TsMGetOptions) {
|
||||
parser.push('TS.MGET');
|
||||
parseLatestArgument(parser, options?.LATEST);
|
||||
|
@@ -7,6 +7,13 @@ import { createTransformMGetLabelsReply } from './MGET_WITHLABELS';
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets the last samples matching a specific filter with selected labels
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param selectedLabels - Labels to include in the output
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand(parser: CommandParser, filter: RedisVariadicArgument, selectedLabels: RedisVariadicArgument, options?: TsMGetOptions) {
|
||||
parser.push('TS.MGET');
|
||||
parseLatestArgument(parser, options?.LATEST);
|
||||
|
@@ -52,6 +52,12 @@ export function createTransformMGetLabelsReply<T extends RawLabelValue>() {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets the last samples matching a specific filter with labels
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand(parser: CommandParser, filter: RedisVariadicArgument, options?: TsMGetWithLabelsOptions) {
|
||||
parser.push('TS.MGET');
|
||||
parseLatestArgument(parser, options?.LATEST);
|
||||
|
@@ -22,6 +22,10 @@ export type TsMRangeRawReply3 = MapReply<
|
||||
]>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Creates a function that parses arguments for multi-range commands
|
||||
* @param command - The command name to use (TS.MRANGE or TS.MREVRANGE)
|
||||
*/
|
||||
export function createTransformMRangeArguments(command: RedisArgument) {
|
||||
return (
|
||||
parser: CommandParser,
|
||||
@@ -45,6 +49,14 @@ export function createTransformMRangeArguments(command: RedisArgument) {
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a specific filter within a time range
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2(reply: TsMRangeRawReply2, _?: any, typeMapping?: TypeMapping) {
|
||||
|
@@ -25,6 +25,11 @@ export interface TsMRangeGroupBy {
|
||||
REDUCE: TimeSeriesReducer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds GROUPBY arguments to command
|
||||
* @param parser - The command parser
|
||||
* @param groupBy - Group by parameters
|
||||
*/
|
||||
export function parseGroupByArguments(parser: CommandParser, groupBy: TsMRangeGroupBy) {
|
||||
parser.push('GROUPBY', groupBy.label, 'REDUCE', groupBy.REDUCE);
|
||||
}
|
||||
@@ -51,6 +56,10 @@ export type TsMRangeGroupByRawReply3 = MapReply<
|
||||
]>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Creates a function that parses arguments for multi-range commands with grouping
|
||||
* @param command - The command name to use (TS.MRANGE or TS.MREVRANGE)
|
||||
*/
|
||||
export function createTransformMRangeGroupByArguments(command: RedisArgument) {
|
||||
return (
|
||||
parser: CommandParser,
|
||||
@@ -69,6 +78,10 @@ export function createTransformMRangeGroupByArguments(command: RedisArgument) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts source keys from RESP3 metadata reply
|
||||
* @param raw - Raw metadata from RESP3 reply
|
||||
*/
|
||||
export function extractResp3MRangeSources(raw: TsMRangeGroupByRawMetadataReply3) {
|
||||
const unwrappedMetadata2 = raw as unknown as UnwrapReply<typeof raw>;
|
||||
if (unwrappedMetadata2 instanceof Map) {
|
||||
@@ -82,6 +95,15 @@ export function extractResp3MRangeSources(raw: TsMRangeGroupByRawMetadataReply3)
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a filter within a time range with grouping
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeGroupByArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2(reply: TsMRangeGroupByRawReply2, _?: any, typeMapping?: TypeMapping) {
|
||||
|
@@ -25,6 +25,10 @@ export type TsMRangeSelectedLabelsRawReply3 = MapReply<
|
||||
]>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Creates a function that parses arguments for multi-range commands with selected labels
|
||||
* @param command - The command name to use (TS.MRANGE or TS.MREVRANGE)
|
||||
*/
|
||||
export function createTransformMRangeSelectedLabelsArguments(command: RedisArgument) {
|
||||
return (
|
||||
parser: CommandParser,
|
||||
@@ -50,6 +54,15 @@ export function createTransformMRangeSelectedLabelsArguments(command: RedisArgum
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with selected labels
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param selectedLabels - Labels to include in the output
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeSelectedLabelsArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2(reply: TsMRangeSelectedLabelsRawReply2, _?: any, typeMapping?: TypeMapping) {
|
||||
|
@@ -17,6 +17,10 @@ export type TsMRangeWithLabelsGroupByRawReply3 = MapReply<
|
||||
]>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Creates a function that parses arguments for multi-range commands with selected labels and grouping
|
||||
* @param command - The command name to use (TS.MRANGE or TS.MREVRANGE)
|
||||
*/
|
||||
export function createMRangeSelectedLabelsGroupByTransformArguments(
|
||||
command: RedisArgument
|
||||
) {
|
||||
@@ -47,6 +51,16 @@ export function createMRangeSelectedLabelsGroupByTransformArguments(
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with selected labels and grouping
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param selectedLabels - Labels to include in the output
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createMRangeSelectedLabelsGroupByTransformArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2: MRANGE_SELECTED_LABELS.transformReply[2],
|
||||
|
@@ -25,6 +25,10 @@ export type TsMRangeWithLabelsRawReply3 = MapReply<
|
||||
]>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Creates a function that parses arguments for multi-range commands with labels
|
||||
* @param command - The command name to use (TS.MRANGE or TS.MREVRANGE)
|
||||
*/
|
||||
export function createTransformMRangeWithLabelsArguments(command: RedisArgument) {
|
||||
return (
|
||||
parser: CommandParser,
|
||||
@@ -50,6 +54,14 @@ export function createTransformMRangeWithLabelsArguments(command: RedisArgument)
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with labels
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeWithLabelsArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2(reply: TsMRangeWithLabelsRawReply2, _?: any, typeMapping?: TypeMapping) {
|
||||
|
@@ -54,6 +54,15 @@ export function createMRangeWithLabelsGroupByTransformArguments(command: RedisAr
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with labels and grouping
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createMRangeWithLabelsGroupByTransformArguments('TS.MRANGE'),
|
||||
transformReply: {
|
||||
2(reply: TsMRangeWithLabelsGroupByRawReply2, _?: any, typeMapping?: TypeMapping) {
|
||||
|
@@ -4,6 +4,14 @@ import MRANGE, { createTransformMRangeArguments } from './MRANGE';
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: MRANGE.NOT_KEYED_COMMAND,
|
||||
IS_READ_ONLY: MRANGE.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a specific filter within a time range (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -3,6 +3,15 @@ import MRANGE_GROUPBY, { createTransformMRangeGroupByArguments } from './MRANGE_
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: MRANGE_GROUPBY.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a filter within a time range with grouping (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeGroupByArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE_GROUPBY.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -3,6 +3,15 @@ import MRANGE_SELECTED_LABELS, { createTransformMRangeSelectedLabelsArguments }
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: MRANGE_SELECTED_LABELS.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with selected labels (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param selectedLabels - Labels to include in the output
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeSelectedLabelsArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE_SELECTED_LABELS.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -3,6 +3,16 @@ import MRANGE_SELECTED_LABELS_GROUPBY, { createMRangeSelectedLabelsGroupByTransf
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: MRANGE_SELECTED_LABELS_GROUPBY.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with selected labels and grouping (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param selectedLabels - Labels to include in the output
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createMRangeSelectedLabelsGroupByTransformArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE_SELECTED_LABELS_GROUPBY.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -4,6 +4,14 @@ import MRANGE_WITHLABELS, { createTransformMRangeWithLabelsArguments } from './M
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: MRANGE_WITHLABELS.NOT_KEYED_COMMAND,
|
||||
IS_READ_ONLY: MRANGE_WITHLABELS.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with labels (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createTransformMRangeWithLabelsArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE_WITHLABELS.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -3,6 +3,15 @@ import MRANGE_WITHLABELS_GROUPBY, { createMRangeWithLabelsGroupByTransformArgume
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: MRANGE_WITHLABELS_GROUPBY.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples for time series matching a filter with labels and grouping (in reverse order)
|
||||
* @param parser - The command parser
|
||||
* @param fromTimestamp - Start timestamp for range
|
||||
* @param toTimestamp - End timestamp for range
|
||||
* @param filter - Filter to match time series keys
|
||||
* @param groupBy - Group by parameters
|
||||
* @param options - Optional parameters for the command
|
||||
*/
|
||||
parseCommand: createMRangeWithLabelsGroupByTransformArguments('TS.MREVRANGE'),
|
||||
transformReply: MRANGE_WITHLABELS_GROUPBY.transformReply,
|
||||
} as const satisfies Command;
|
||||
|
@@ -5,6 +5,11 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
|
||||
export default {
|
||||
NOT_KEYED_COMMAND: true,
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Queries the index for time series matching a specific filter
|
||||
* @param parser - The command parser
|
||||
* @param filter - Filter to match time series labels
|
||||
*/
|
||||
parseCommand(parser: CommandParser, filter: RedisVariadicArgument) {
|
||||
parser.push('TS.QUERYINDEX');
|
||||
parser.pushVariadic(filter);
|
||||
|
@@ -101,6 +101,10 @@ export function transformRangeArguments(
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Gets samples from a time series within a time range
|
||||
* @param args - Arguments passed to the {@link transformRangeArguments} function
|
||||
*/
|
||||
parseCommand(...args: Parameters<typeof transformRangeArguments>) {
|
||||
const parser = args[0];
|
||||
|
||||
|
@@ -3,6 +3,10 @@ import RANGE, { transformRangeArguments } from './RANGE';
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: RANGE.IS_READ_ONLY,
|
||||
/**
|
||||
* Gets samples from a time series within a time range (in reverse order)
|
||||
* @param args - Arguments passed to the {@link transformRangeArguments} function
|
||||
*/
|
||||
parseCommand(...args: Parameters<typeof transformRangeArguments>) {
|
||||
const parser = args[0];
|
||||
|
||||
|
Reference in New Issue
Block a user