From c1d7ac9ab71e2d188f9885a53de0495e8bd65cda Mon Sep 17 00:00:00 2001 From: Yi-Pin Chen Date: Mon, 16 Sep 2024 14:32:19 -0700 Subject: [PATCH] Node: include missing exports in the npm release Signed-off-by: Yi-Pin Chen Signed-off-by: Andrew Carbonetto --- CHANGELOG.md | 1 + examples/node/index.ts | 2 +- examples/node/package.json | 2 +- node/npm/glide/index.ts | 12 ++++++++++++ node/src/Logger.ts | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a454a708..f8809ae7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ #### Changes +* Node: Fixed missing exports ([#2301](https://github.com/valkey-io/valkey-glide/pull/2301)) * Node: Use `options` struct for all optional arguments ([#2287](https://github.com/valkey-io/valkey-glide/pull/2287)) * Node: Added `invokeScript` API with routing for cluster client ([#2284](https://github.com/valkey-io/valkey-glide/pull/2284)) * Java: Expanded tests for converting non UTF-8 bytes to Strings ([#2286](https://github.com/valkey-io/valkey-glide/pull/2286)) diff --git a/examples/node/index.ts b/examples/node/index.ts index 49fa9a531d..a72180b17c 100644 --- a/examples/node/index.ts +++ b/examples/node/index.ts @@ -49,7 +49,7 @@ async function sendPingToRandomNodeInCluster() { clientName: "test_cluster_client", }); // The empty array signifies that there are no additional arguments. - const pong = await client.customCommand(["PING"], "randomNode"); + const pong = await client.customCommand(["PING"], { route: "randomNode" }); console.log(pong); await send_set_and_get(client); client.close(); diff --git a/examples/node/package.json b/examples/node/package.json index 1521a6d8c4..712ae76e02 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -1,7 +1,7 @@ { "type": "module", "dependencies": { - "@valkey/valkey-glide": "^1.0.0", + "@valkey/valkey-glide": "^1.1.0", "@types/node": "^20.4.8" }, "devDependencies": { diff --git a/node/npm/glide/index.ts b/node/npm/glide/index.ts index 546f3ebe83..7d307b3c0c 100644 --- a/node/npm/glide/index.ts +++ b/node/npm/glide/index.ts @@ -192,6 +192,12 @@ function initialize() { createLeakedMap, createLeakedString, parseInfoResponse, + Script, + ObjectType, + ClusterScanCursor, + BaseClientConfiguration, + GlideClusterClientConfiguration, + LevelOptions, } = nativeBinding; module.exports = { @@ -305,6 +311,12 @@ function initialize() { createLeakedMap, createLeakedString, parseInfoResponse, + Script, + ObjectType, + ClusterScanCursor, + BaseClientConfiguration, + GlideClusterClientConfiguration, + LevelOptions, }; globalObject = Object.assign(global, nativeBinding); diff --git a/node/src/Logger.ts b/node/src/Logger.ts index f5f09d269d..df38c77994 100644 --- a/node/src/Logger.ts +++ b/node/src/Logger.ts @@ -12,7 +12,7 @@ const LEVEL = new Map([ ["trace", Level.Trace], [undefined, undefined], ]); -type LevelOptions = "error" | "warn" | "info" | "debug" | "trace"; +export type LevelOptions = "error" | "warn" | "info" | "debug" | "trace"; /* * A singleton class that allows logging which is consistent with logs from the internal rust core.