Skip to content

Commit

Permalink
Script class added
Browse files Browse the repository at this point in the history
Signed-off-by: Prateek Kumar <[email protected]>
  • Loading branch information
prateek-kumar-improving committed Sep 19, 2024
1 parent 31731e8 commit 63d422d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion node/tests/GlideClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
GlideString,
ProtocolVersion,
RequestError,
Script,
Transaction,
} from "@valkey/valkey-glide";
import { v4 as uuidv4 } from "uuid";
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion node/tests/GlideClusterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
RequestError,
Routes,
ScoreFilter,
Script,
SlotKeyTypes,
SortOrder,
} from "@valkey/valkey-glide";
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
ProtocolVersion,
RequestError,
ScoreFilter,
Script,
SignedEncoding,
SingleNodeRoute,
SortOrder,
Expand All @@ -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
Expand Down

0 comments on commit 63d422d

Please sign in to comment.