1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
Bobby I. 20c16e0c2c (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
2025-06-03 14:38:07 +03:00

33 lines
1.2 KiB
TypeScript

import { CommandParser } from '@redis/client/dist/lib/client/parser';
import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/lib/RESP/types';
import { TsCreateOptions } from './CREATE';
import { parseRetentionArgument, parseChunkSizeArgument, parseDuplicatePolicy, parseLabelsArgument, parseIgnoreArgument } from './helpers';
export type TsAlterOptions = Pick<TsCreateOptions, 'RETENTION' | 'CHUNK_SIZE' | 'DUPLICATE_POLICY' | 'LABELS' | 'IGNORE'>;
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);
parseRetentionArgument(parser, options?.RETENTION);
parseChunkSizeArgument(parser, options?.CHUNK_SIZE);
parseDuplicatePolicy(parser, options?.DUPLICATE_POLICY);
parseLabelsArgument(parser, options?.LABELS);
parseIgnoreArgument(parser, options?.IGNORE);
},
transformReply: undefined as unknown as () => SimpleStringReply<'OK'>
} as const satisfies Command;