You've already forked node-redis
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:
@@ -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],
|
||||
|
Reference in New Issue
Block a user