@valkey/valkey-glide 1.1.0-rc8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -6,16 +6,20 @@ Valkey General Language Independent Driver for the Enterprise (GLIDE), is an ope
|
|
|
6
6
|
|
|
7
7
|
Refer to the [Supported Engine Versions table](https://github.com/valkey-io/valkey-glide/blob/main/README.md#supported-engine-versions) for details.
|
|
8
8
|
|
|
9
|
-
## Current Status
|
|
10
|
-
|
|
11
|
-
We've made Valkey GLIDE an open-source project, and are releasing it in Preview to the community to gather feedback, and actively collaborate on the project roadmap. We welcome questions and contributions from all Redis stakeholders.
|
|
12
|
-
This preview release is recommended for testing purposes only.
|
|
13
|
-
|
|
14
9
|
# Getting Started - Node Wrapper
|
|
15
10
|
|
|
16
11
|
## System Requirements
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
The release of Valkey GLIDE was tested on the following platforms:
|
|
14
|
+
|
|
15
|
+
Linux:
|
|
16
|
+
|
|
17
|
+
- Ubuntu 22.04.1 (x86_64)
|
|
18
|
+
- Amazon Linux 2023 (AL2023) (x86_64)
|
|
19
|
+
|
|
20
|
+
macOS:
|
|
21
|
+
|
|
22
|
+
- macOS 12.7 (Apple silicon/aarch_64 and Intel/x86_64)
|
|
19
23
|
|
|
20
24
|
## NodeJS supported version
|
|
21
25
|
|
|
@@ -29,6 +33,63 @@ Visit our [wiki](https://github.com/valkey-io/valkey-glide/wiki/NodeJS-wrapper)
|
|
|
29
33
|
|
|
30
34
|
Development instructions for local building & testing the package are in the [DEVELOPER.md](https://github.com/valkey-io/valkey-glide/blob/main/node/DEVELOPER.md#build-from-source) file.
|
|
31
35
|
|
|
36
|
+
## Basic Examples
|
|
37
|
+
|
|
38
|
+
#### Standalone Mode:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { GlideClient, GlideClusterClient, Logger } from "@valkey/valkey-glide";
|
|
42
|
+
// When Valkey is in standalone mode, add address of the primary node, and any replicas you'd like to be able to read from.
|
|
43
|
+
const addresses = [
|
|
44
|
+
{
|
|
45
|
+
host: "localhost",
|
|
46
|
+
port: 6379,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
// Check `GlideClientConfiguration/GlideClusterClientConfiguration` for additional options.
|
|
50
|
+
const client = await GlideClient.createClient({
|
|
51
|
+
addresses: addresses,
|
|
52
|
+
// if the server uses TLS, you'll need to enable it. Otherwise, the connection attempt will time out silently.
|
|
53
|
+
// useTLS: true,
|
|
54
|
+
clientName: "test_standalone_client",
|
|
55
|
+
});
|
|
56
|
+
// The empty array signifies that there are no additional arguments.
|
|
57
|
+
const pong = await client.customCommand(["PING"]);
|
|
58
|
+
console.log(pong);
|
|
59
|
+
const set_response = await client.set("foo", "bar");
|
|
60
|
+
console.log(`Set response is = ${set_response}`);
|
|
61
|
+
const get_response = await client.get("foo");
|
|
62
|
+
console.log(`Get response is = ${get_response}`);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Cluster Mode:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { GlideClient, GlideClusterClient, Logger } from "@valkey/valkey-glide";
|
|
69
|
+
// When Valkey is in cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
|
|
70
|
+
const addresses = [
|
|
71
|
+
{
|
|
72
|
+
host: "localhost",
|
|
73
|
+
port: 6379,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
// Check `GlideClientConfiguration/GlideClusterClientConfiguration` for additional options.
|
|
77
|
+
const client = await GlideClusterClient.createClient({
|
|
78
|
+
addresses: addresses,
|
|
79
|
+
// if the cluster nodes use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
|
|
80
|
+
// useTLS: true,
|
|
81
|
+
clientName: "test_cluster_client",
|
|
82
|
+
});
|
|
83
|
+
// The empty array signifies that there are no additional arguments.
|
|
84
|
+
const pong = await client.customCommand(["PING"], { route: "randomNode" });
|
|
85
|
+
console.log(pong);
|
|
86
|
+
const set_response = await client.set("foo", "bar");
|
|
87
|
+
console.log(`Set response is = ${set_response}`);
|
|
88
|
+
const get_response = await client.get("foo");
|
|
89
|
+
console.log(`Get response is = ${get_response}`);
|
|
90
|
+
client.close();
|
|
91
|
+
```
|
|
92
|
+
|
|
32
93
|
### Supported platforms
|
|
33
94
|
|
|
34
95
|
Currentlly the package is supported on:
|
package/build-ts/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function loadNativeBinding() {
|
|
|
65
65
|
}
|
|
66
66
|
function initialize() {
|
|
67
67
|
const nativeBinding = loadNativeBinding();
|
|
68
|
-
const { AggregationType, BaseScanOptions, ZScanOptions, HScanOptions, BitEncoding, BitFieldGet, BitFieldIncrBy, BitFieldOffset, BitFieldOverflow, BitFieldSet, BitFieldSubCommands, BitOffset, BitOffsetMultiplier, BitOffsetOptions, BitOverflowControl, BitmapIndexType, BitwiseOperation, ConditionalChange, Decoder, DecoderOption, GeoAddOptions, CoordOrigin, MemberOrigin, SearchOrigin, GeoBoxShape, GeoCircleShape, GeoSearchShape, GeoSearchResultOptions, GeoSearchStoreResultOptions, SortOrder, GeoUnit, GeospatialData, GlideClient, GlideClusterClient, GlideClientConfiguration, GlideRecord, GlideString, SortedSetDataType, StreamEntryDataType, HashDataType, FunctionListOptions, FunctionListResponse, FunctionStatsSingleResponse, FunctionStatsFullResponse, FunctionRestorePolicy, SlotIdTypes, SlotKeyTypes, TimeUnit, RouteByAddress, RouteOption, Routes, RestoreOptions, SingleNodeRoute, PeriodicChecksManualInterval, PeriodicChecks, Logger, Limit, LolwutOptions, LPosOptions, ListDirection, ExpireOptions, FlushMode, InfoOptions, InsertPosition, SetOptions, ZAddOptions, InfBoundary, KeyWeight, Boundary, UpdateOptions, ProtocolVersion, RangeByIndex, RangeByScore, RangeByLex, ReadFrom, ServerCredentials, SortClusterOptions, SortOptions, SortedSetRange, StreamGroupOptions, StreamTrimOptions, StreamAddOptions, StreamReadGroupOptions, StreamReadOptions, StreamClaimOptions, StreamPendingOptions, ClosingError, ConfigurationError, ExecAbortError, ValkeyError, GlideReturnType, StreamEntries, ReturnTypeXinfoStream, RequestError, TimeoutError, ConnectionError, ClusterTransaction, Transaction, PubSubMsg, ScoreFilter, SignedEncoding, UnsignedEncoding, UpdateByScore, createLeakedArray, createLeakedAttribute, createLeakedBigint, createLeakedDouble, createLeakedMap, createLeakedString, parseInfoResponse, } = nativeBinding;
|
|
68
|
+
const { AggregationType, BaseScanOptions, ZScanOptions, HScanOptions, BitEncoding, BitFieldGet, BitFieldIncrBy, BitFieldOffset, BitFieldOverflow, BitFieldSet, BitFieldSubCommands, BitOffset, BitOffsetMultiplier, BitOffsetOptions, BitOverflowControl, BitmapIndexType, BitwiseOperation, ConditionalChange, Decoder, DecoderOption, GeoAddOptions, CoordOrigin, MemberOrigin, SearchOrigin, GeoBoxShape, GeoCircleShape, GeoSearchShape, GeoSearchResultOptions, GeoSearchStoreResultOptions, SortOrder, GeoUnit, GeospatialData, GlideClient, GlideClusterClient, GlideClientConfiguration, GlideRecord, GlideString, SortedSetDataType, StreamEntryDataType, HashDataType, FunctionListOptions, FunctionListResponse, FunctionStatsSingleResponse, FunctionStatsFullResponse, FunctionRestorePolicy, SlotIdTypes, SlotKeyTypes, TimeUnit, RouteByAddress, RouteOption, Routes, RestoreOptions, SingleNodeRoute, PeriodicChecksManualInterval, PeriodicChecks, Logger, Limit, LolwutOptions, LPosOptions, ListDirection, ExpireOptions, FlushMode, InfoOptions, InsertPosition, SetOptions, ZAddOptions, InfBoundary, KeyWeight, Boundary, UpdateOptions, ProtocolVersion, RangeByIndex, RangeByScore, RangeByLex, ReadFrom, ServerCredentials, SortClusterOptions, SortOptions, SortedSetRange, StreamGroupOptions, StreamTrimOptions, StreamAddOptions, StreamReadGroupOptions, StreamReadOptions, StreamClaimOptions, StreamPendingOptions, ClosingError, ConfigurationError, ExecAbortError, ValkeyError, GlideReturnType, StreamEntries, ReturnTypeXinfoStream, RequestError, TimeoutError, ConnectionError, ClusterTransaction, Transaction, PubSubMsg, ScoreFilter, SignedEncoding, UnsignedEncoding, UpdateByScore, createLeakedArray, createLeakedAttribute, createLeakedBigint, createLeakedDouble, createLeakedMap, createLeakedString, parseInfoResponse, Script, ObjectType, ClusterScanCursor, BaseClientConfiguration, GlideClusterClientConfiguration, LevelOptions, ReturnTypeRecord, ReturnTypeMap, ClusterResponse, ReturnTypeAttribute, } = nativeBinding;
|
|
69
69
|
module.exports = {
|
|
70
70
|
AggregationType,
|
|
71
71
|
BaseScanOptions,
|
|
@@ -177,6 +177,16 @@ function initialize() {
|
|
|
177
177
|
createLeakedMap,
|
|
178
178
|
createLeakedString,
|
|
179
179
|
parseInfoResponse,
|
|
180
|
+
Script,
|
|
181
|
+
ObjectType,
|
|
182
|
+
ClusterScanCursor,
|
|
183
|
+
BaseClientConfiguration,
|
|
184
|
+
GlideClusterClientConfiguration,
|
|
185
|
+
LevelOptions,
|
|
186
|
+
ReturnTypeRecord,
|
|
187
|
+
ReturnTypeMap,
|
|
188
|
+
ClusterResponse,
|
|
189
|
+
ReturnTypeAttribute,
|
|
180
190
|
};
|
|
181
191
|
globalObject = Object.assign(global, nativeBinding);
|
|
182
192
|
}
|
|
@@ -3622,7 +3622,7 @@ export declare class BaseClient {
|
|
|
3622
3622
|
* // ]
|
|
3623
3623
|
* ```
|
|
3624
3624
|
*/
|
|
3625
|
-
xinfoGroups(key:
|
|
3625
|
+
xinfoGroups(key: GlideString, options?: DecoderOption): Promise<Record<string, GlideString | number | null>[]>;
|
|
3626
3626
|
/**
|
|
3627
3627
|
* Changes the ownership of a pending message.
|
|
3628
3628
|
*
|
|
@@ -1174,7 +1174,7 @@ export declare function createXReadGroup(group: GlideString, consumer: GlideStri
|
|
|
1174
1174
|
*/
|
|
1175
1175
|
export declare function createXInfoStream(key: GlideString, options: boolean | number): command_request.Command;
|
|
1176
1176
|
/** @internal */
|
|
1177
|
-
export declare function createXInfoGroups(key:
|
|
1177
|
+
export declare function createXInfoGroups(key: GlideString): command_request.Command;
|
|
1178
1178
|
/**
|
|
1179
1179
|
* @internal
|
|
1180
1180
|
*/
|
package/build-ts/src/Logger.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
3
|
*/
|
|
4
|
-
type LevelOptions = "error" | "warn" | "info" | "debug" | "trace";
|
|
4
|
+
export type LevelOptions = "error" | "warn" | "info" | "debug" | "trace";
|
|
5
5
|
export declare class Logger {
|
|
6
6
|
private static _instance;
|
|
7
7
|
private static logger_level;
|
|
@@ -28,4 +28,3 @@ export declare class Logger {
|
|
|
28
28
|
*/
|
|
29
29
|
static setLoggerConfig(level: LevelOptions, fileName?: string): void;
|
|
30
30
|
}
|
|
31
|
-
export {};
|
|
@@ -761,7 +761,7 @@ export declare class BaseTransaction<T extends BaseTransaction<T>> {
|
|
|
761
761
|
* Command Response - the number of the removed elements.
|
|
762
762
|
* If `key` does not exist, 0 is returned.
|
|
763
763
|
*/
|
|
764
|
-
lrem(key: GlideString, count: number, element:
|
|
764
|
+
lrem(key: GlideString, count: number, element: GlideString): T;
|
|
765
765
|
/** Inserts all the specified values at the tail of the list stored at `key`.
|
|
766
766
|
* `elements` are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element.
|
|
767
767
|
* If `key` does not exist, it is created as empty list before performing the push operations.
|
|
@@ -1820,7 +1820,7 @@ export declare class BaseTransaction<T extends BaseTransaction<T>> {
|
|
|
1820
1820
|
* attributes of a consumer group for the stream at `key`.
|
|
1821
1821
|
* The response comes in format `GlideRecord<GlideString | number | null>[]`, see {@link GlideRecord}.
|
|
1822
1822
|
*/
|
|
1823
|
-
xinfoGroups(key:
|
|
1823
|
+
xinfoGroups(key: GlideString): T;
|
|
1824
1824
|
/**
|
|
1825
1825
|
* Returns the server time.
|
|
1826
1826
|
*
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valkey/valkey-glide",
|
|
3
3
|
"types": "build-ts/index.d.ts",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "General Language Independent Driver for the Enterprise (GLIDE) for Valkey",
|
|
6
6
|
"main": "build-ts/index.js",
|
|
7
7
|
"module": "build-ts/index.js",
|
|
8
8
|
"type": "commonjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"client",
|
|
27
27
|
"valkey-glide"
|
|
28
28
|
],
|
|
29
|
-
"author": "
|
|
29
|
+
"author": "Valkey GLIDE Maintainers",
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/valkey-io/valkey-glide/issues"
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"typescript": "^4.9.4"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@valkey/valkey-glide-darwin-arm64": "
|
|
44
|
-
"@valkey/valkey-glide-darwin-x64": "
|
|
45
|
-
"@valkey/valkey-glide-linux-arm64": "
|
|
46
|
-
"@valkey/valkey-glide-linux-x64": "
|
|
47
|
-
"@valkey/valkey-glide-linux-musl-arm64": "
|
|
48
|
-
"@valkey/valkey-glide-linux-musl-x64": "
|
|
43
|
+
"@valkey/valkey-glide-darwin-arm64": "1.1.0",
|
|
44
|
+
"@valkey/valkey-glide-darwin-x64": "1.1.0",
|
|
45
|
+
"@valkey/valkey-glide-linux-arm64": "1.1.0",
|
|
46
|
+
"@valkey/valkey-glide-linux-x64": "1.1.0",
|
|
47
|
+
"@valkey/valkey-glide-linux-musl-arm64": "1.1.0",
|
|
48
|
+
"@valkey/valkey-glide-linux-musl-x64": "1.1.0"
|
|
49
49
|
},
|
|
50
50
|
"eslintConfig": {
|
|
51
51
|
"extends": [
|