import type { NAMESPACE, Vector } from "@commands/client/types"; import type { Dict } from "@commands/client/types"; import { Command } from "@commands/command"; type RangeCommandPayload = { cursor: number | string; limit: number; includeVectors?: boolean; includeMetadata?: boolean; includeData?: boolean; prefix?: string; }; type RangeCommandOptions = { namespace?: string }; type RangeEndpointVariants = `range` | `range/${NAMESPACE}`; export type RangeResult = { nextCursor: string; vectors: Vector[]; }; export class RangeCommand extends Command> { constructor(payload: RangeCommandPayload, options?: RangeCommandOptions) { let endpoint: RangeEndpointVariants = "range"; if (options?.namespace) { endpoint = `${endpoint}/${options.namespace}`; } super(payload, endpoint); } }