From 63d422db25afd38c4a71b8bbd4ed191a1ca29639 Mon Sep 17 00:00:00 2001 From: Prateek Kumar Date: Wed, 18 Sep 2024 17:06:50 -0700 Subject: [PATCH] Script class added Signed-off-by: Prateek Kumar --- node/tests/GlideClient.test.ts | 8 +++++++- node/tests/GlideClusterClient.test.ts | 8 +++++++- node/tests/SharedTests.ts | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/node/tests/GlideClient.test.ts b/node/tests/GlideClient.test.ts index 667d266a15..826e0900aa 100644 --- a/node/tests/GlideClient.test.ts +++ b/node/tests/GlideClient.test.ts @@ -20,7 +20,6 @@ import { GlideString, ProtocolVersion, RequestError, - Script, Transaction, } from "@valkey/valkey-glide"; import { v4 as uuidv4 } from "uuid"; @@ -49,6 +48,13 @@ import { const TIMEOUT = 50000; +export declare class Script { + /** Construct with the script's code. */ + constructor(code: string | Uint8Array); + /** Returns the hash of the script. */ + getHash(): string; +} + describe("GlideClient", () => { let testsFailed = 0; let cluster: ValkeyCluster; diff --git a/node/tests/GlideClusterClient.test.ts b/node/tests/GlideClusterClient.test.ts index aa68ac4cb7..674c25f2d0 100644 --- a/node/tests/GlideClusterClient.test.ts +++ b/node/tests/GlideClusterClient.test.ts @@ -27,7 +27,6 @@ import { RequestError, Routes, ScoreFilter, - Script, SlotKeyTypes, SortOrder, } from "@valkey/valkey-glide"; @@ -56,6 +55,13 @@ import { waitForScriptNotBusy, } from "./TestUtilities"; +export declare class Script { + /** Construct with the script's code. */ + constructor(code: string | Uint8Array); + /** Returns the hash of the script. */ + getHash(): string; +} + const TIMEOUT = 50000; /** * Union type that can store either a valid UTF-8 string or array of bytes. diff --git a/node/tests/SharedTests.ts b/node/tests/SharedTests.ts index 6498fe794f..147f62a96e 100644 --- a/node/tests/SharedTests.ts +++ b/node/tests/SharedTests.ts @@ -40,7 +40,6 @@ import { ProtocolVersion, RequestError, ScoreFilter, - Script, SignedEncoding, SingleNodeRoute, SortOrder, @@ -55,6 +54,13 @@ import { v4 as uuidv4 } from "uuid"; import { ValkeyCluster } from "../../utils/TestUtils"; import { Client, GetAndSetRandomValue, getFirstResult } from "./TestUtilities"; +export declare class Script { + /** Construct with the script's code. */ + constructor(code: string | Uint8Array); + /** Returns the hash of the script. */ + getHash(): string; +} + export type BaseClient = GlideClient | GlideClusterClient; // Same as `BaseClientConfiguration`, but all fields are optional