1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +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:
Bobby I.
2025-06-03 14:38:07 +03:00
committed by GitHub
parent e4a1ca467f
commit 20c16e0c2c
491 changed files with 3861 additions and 1 deletions

View File

@@ -1,6 +1,13 @@
import { TuplesReply, BlobStringReply, ArrayReply, UnwrapReply, Command } from '../RESP/types';
import XAUTOCLAIM from './XAUTOCLAIM';
/**
* Raw reply structure for XAUTOCLAIM JUSTID command
*
* @property nextId - The ID to use for the next XAUTOCLAIM call
* @property messages - Array of message IDs that were claimed
* @property deletedMessages - Array of message IDs that no longer exist
*/
type XAutoClaimJustIdRawReply = TuplesReply<[
nextId: BlobStringReply,
messages: ArrayReply<BlobStringReply>,
@@ -9,11 +16,24 @@ type XAutoClaimJustIdRawReply = TuplesReply<[
export default {
IS_READ_ONLY: XAUTOCLAIM.IS_READ_ONLY,
/**
* Constructs the XAUTOCLAIM command with JUSTID option to get only message IDs
*
* @param args - Same parameters as XAUTOCLAIM command
* @returns Object containing nextId and arrays of claimed and deleted message IDs
* @see https://redis.io/commands/xautoclaim/
*/
parseCommand(...args: Parameters<typeof XAUTOCLAIM.parseCommand>) {
const parser = args[0];
XAUTOCLAIM.parseCommand(...args);
parser.push('JUSTID');
},
/**
* Transforms the raw XAUTOCLAIM JUSTID reply into a structured object
*
* @param reply - Raw reply from Redis
* @returns Structured object containing nextId, message IDs, and deleted message IDs
*/
transformReply(reply: UnwrapReply<XAutoClaimJustIdRawReply>) {
return {
nextId: reply[0],