From a881ab28a5792550db6c83abd2ecf419333cb3ea Mon Sep 17 00:00:00 2001 From: Guian Gumpac Date: Thu, 25 Jul 2024 16:26:24 -0700 Subject: [PATCH] Rebased and resolved conflicts Signed-off-by: Guian Gumpac --- node/src/Commands.ts | 13 ------------- node/tests/TestUtilities.ts | 21 +++++++++------------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/node/src/Commands.ts b/node/src/Commands.ts index 7f5edee633..ff4eac85ae 100644 --- a/node/src/Commands.ts +++ b/node/src/Commands.ts @@ -1699,19 +1699,6 @@ export function createFunctionLoad( return createCommand(RequestType.FunctionLoad, args); } -/** - * Enumeration specifying if index arguments are BYTE indexes or BIT indexes. - * Can be specified in {@link BitOffsetOptions}, which is an optional argument to the {@link BaseClient.bitcount|bitcount} command. - * - * since - Valkey version 7.0.0. - */ -export enum BitmapIndexType { - /** Specifies that indexes provided to {@link BitOffsetOptions} are byte indexes. */ - BYTE = "BYTE", - /** Specifies that indexes provided to {@link BitOffsetOptions} are bit indexes. */ - BIT = "BIT", -} - /** * Represents offsets specifying a string interval to analyze in the {@link BaseClient.bitcount|bitcount} command. The offsets are * zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on. diff --git a/node/tests/TestUtilities.ts b/node/tests/TestUtilities.ts index 30e41b79ca..2b0b0de1dd 100644 --- a/node/tests/TestUtilities.ts +++ b/node/tests/TestUtilities.ts @@ -13,7 +13,9 @@ import { BitmapIndexType, BitwiseOperation, ClusterTransaction, + FlushMode, GeoUnit, + GeospatialData, GlideClient, GlideClusterClient, InsertPosition, @@ -24,11 +26,6 @@ import { ScoreFilter, Transaction, } from ".."; -import { - BitmapIndexType, - FlushMode, - GeospatialData, -} from "../build-ts/src/Commands"; beforeAll(() => { Logger.init("info"); @@ -527,18 +524,18 @@ export async function transactionTest( field + "3", ]); responseData.push(["rpush(key16, [1, 1, 2, 3, 3,])", 5]); - baseTransaction.lpos(key16, field + "1", new LPosOptions({ rank: 2 })); + baseTransaction.lpos(key16, field + "1", { rank: 2 }); responseData.push([ - 'lpos(key16, field + "1", new LPosOptions({ rank: 2 }))', + 'lpos(key16, field + "1", { rank: 2 })', 1, ]); baseTransaction.lpos( key16, field + "1", - new LPosOptions({ rank: 2, count: 0 }), + { rank: 2, count: 0 }, ); responseData.push([ - 'lpos(key16, field + "1", new LPosOptions({ rank: 2, count: 0 }))', + 'lpos(key16, field + "1", { rank: 2, count: 0 })', [1], ]); baseTransaction.sadd(key7, ["bar", "foo"]); @@ -744,8 +741,8 @@ export async function transactionTest( responseData.push(['set(key17, "foobar")', "OK"]); baseTransaction.bitcount(key17); responseData.push(["bitcount(key17)", 26]); - baseTransaction.bitcount(key17, new BitOffsetOptions(1, 1)); - responseData.push(["bitcount(key17, new BitOffsetOptions(1, 1))", 6]); + baseTransaction.bitcount(key17, { start: 1, end: 1 }); + responseData.push(["bitcount(key17, { start: 1, end: 1 })", 6]); baseTransaction.bitpos(key17, 1); responseData.push(["bitpos(key17, 1)", 1]); @@ -762,7 +759,7 @@ export async function transactionTest( if (gte("7.0.0", version)) { baseTransaction.bitcount( key17, - new BitOffsetOptions(5, 30, BitmapIndexType.BIT), + { start: 5, end: 30, indexType: BitmapIndexType.BIT }, ); responseData.push([ "bitcount(key17, new BitOffsetOptions(5, 30, BitmapIndexType.BIT))",