import type { CommandOptions } from "./command"; import { Command } from "./command"; /** * @see https://redis.io/commands/xpending * @see node_modules/@upstash/redis/docs/commands/stream/xpending.mdx */ export class XPendingCommand extends Command { constructor( [key, group, start, end, count, options]: [ key: string, group: string, start: string, end: string, count: number, options?: { idleTime?: number; consumer?: string | string[]; }, ], opts?: CommandOptions ) { const consumers = options?.consumer === undefined ? [] : Array.isArray(options.consumer) ? [...options.consumer] : [options.consumer]; super( [ "XPENDING", key, group, ...(options?.idleTime ? ["IDLE", options.idleTime] : []), start, end, count, ...consumers, ], opts ); } }