@valkey/valkey-glide 1.3.1 → 1.3.3-rc0
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 +4 -4
- package/build-ts/index.js +3 -1
- package/build-ts/src/BaseClient.d.ts +17 -3
- package/build-ts/src/Commands.d.ts +5 -2
- package/build-ts/src/GlideClient.d.ts +1 -1
- package/build-ts/src/GlideClusterClient.d.ts +1 -1
- package/build-ts/src/ProtobufMessage.d.ts +2889 -2
- package/build-ts/src/Transaction.d.ts +2 -3
- package/build-ts/src/server-modules/GlideFtOptions.d.ts +1 -1
- package/build-ts/src/server-modules/GlideJson.d.ts +5 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -14,16 +14,16 @@ The release of Valkey GLIDE was tested on the following platforms:
|
|
|
14
14
|
|
|
15
15
|
Linux:
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- Ubuntu 22.04.1 (x86_64 and aarch64)
|
|
18
|
+
- Amazon Linux 2023 (AL2023) (x86_64)
|
|
19
19
|
|
|
20
20
|
macOS:
|
|
21
21
|
|
|
22
|
-
-
|
|
22
|
+
- macOS 14.7 (Apple silicon/aarch_64)
|
|
23
23
|
|
|
24
24
|
Alpine:
|
|
25
25
|
|
|
26
|
-
-
|
|
26
|
+
- node:alpine (default on aarch64 and x86_64)
|
|
27
27
|
|
|
28
28
|
## NodeJS supported version
|
|
29
29
|
|
package/build-ts/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function loadNativeBinding() {
|
|
|
62
62
|
}
|
|
63
63
|
function initialize() {
|
|
64
64
|
const nativeBinding = loadNativeBinding();
|
|
65
|
-
const { AggregationType, BaseScanOptions, ScanOptions, 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, GlideJson, JsonBatch, GlideFt, Field, TextField, TagField, NumericField, VectorField, VectorFieldAttributesFlat, VectorFieldAttributesHnsw, FtCreateOptions, FtSearchOptions, FtInfoReturnType, FtAggregateOptions, FtAggregateLimit, FtAggregateFilter, FtAggregateGroupBy, FtAggregateReducer, FtAggregateSortBy, FtAggregateSortProperty, FtAggregateApply, FtAggregateReturnType, FtSearchReturnType, GlideRecord, GlideString, JsonGetOptions, JsonArrPopOptions, 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, ProtocolVersion, RangeByIndex, RangeByScore, RangeByLex, ReadFrom, ServerCredentials, SortOptions, 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, Script, ObjectType, ClusterScanCursor, AdvancedGlideClientConfiguration, AdvancedGlideClusterClientConfiguration, BaseClientConfiguration, GlideClusterClientConfiguration, LevelOptions, ReturnTypeRecord, ReturnTypeMap, ClusterResponse, ReturnTypeAttribute, ReturnTypeJson, UniversalReturnTypeJson, } = nativeBinding;
|
|
65
|
+
const { AggregationType, BaseScanOptions, ScanOptions, 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, GlideJson, JsonBatch, GlideFt, Field, TextField, TagField, NumericField, VectorField, VectorFieldAttributesFlat, VectorFieldAttributesHnsw, FtCreateOptions, FtSearchOptions, FtInfoReturnType, FtAggregateOptions, FtAggregateLimit, FtAggregateFilter, FtAggregateGroupBy, FtAggregateReducer, FtAggregateSortBy, FtAggregateSortProperty, FtAggregateApply, FtAggregateReturnType, FtSearchReturnType, GlideRecord, GlideString, JsonGetOptions, JsonArrPopOptions, 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, ProtocolVersion, RangeByIndex, RangeByScore, RangeByLex, ReadFrom, ServerCredentials, SortOptions, 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, Script, ObjectType, ClusterScanCursor, AdvancedGlideClientConfiguration, AdvancedGlideClusterClientConfiguration, BaseClientConfiguration, GlideClusterClientConfiguration, LevelOptions, ReturnTypeRecord, ReturnTypeMap, ClusterResponse, ReturnTypeAttribute, ReturnTypeJson, UniversalReturnTypeJson, Score, ElementAndScore, } = nativeBinding;
|
|
66
66
|
module.exports = {
|
|
67
67
|
AggregationType,
|
|
68
68
|
BaseScanOptions,
|
|
@@ -210,6 +210,8 @@ function initialize() {
|
|
|
210
210
|
ReturnTypeAttribute,
|
|
211
211
|
ReturnTypeJson,
|
|
212
212
|
UniversalReturnTypeJson,
|
|
213
|
+
Score,
|
|
214
|
+
ElementAndScore,
|
|
213
215
|
};
|
|
214
216
|
globalObject = Object.assign(global, nativeBinding);
|
|
215
217
|
}
|
|
@@ -88,6 +88,20 @@ export type HashDataType = {
|
|
|
88
88
|
* The keys of the record are stream entry IDs, which are mapped to key-value pairs of the data.
|
|
89
89
|
*/
|
|
90
90
|
export type StreamEntryDataType = Record<string, [GlideString, GlideString][]>;
|
|
91
|
+
/**
|
|
92
|
+
* Union type that can store either a number or positive/negative infinity.
|
|
93
|
+
*/
|
|
94
|
+
export type Score = number | "+inf" | "-inf";
|
|
95
|
+
/**
|
|
96
|
+
* Data type which represents sorted sets data for input parameter of ZADD command,
|
|
97
|
+
* including element and its respective score.
|
|
98
|
+
*/
|
|
99
|
+
export type ElementAndScore = {
|
|
100
|
+
/** The sorted set element name. */
|
|
101
|
+
element: GlideString;
|
|
102
|
+
/** The element score. */
|
|
103
|
+
score: Score;
|
|
104
|
+
};
|
|
91
105
|
/**
|
|
92
106
|
* @internal
|
|
93
107
|
* This function converts an input from GlideRecord or Record types to GlideRecord.
|
|
@@ -406,8 +420,8 @@ export declare class BaseClient {
|
|
|
406
420
|
* const result = await client.get("key");
|
|
407
421
|
* console.log(result); // Output: 'value'
|
|
408
422
|
* // Example usage of get method to retrieve the value of a key with Bytes decoder
|
|
409
|
-
* const result = await client.get("key", Decoder.Bytes);
|
|
410
|
-
* console.log(result); // Output:
|
|
423
|
+
* const result = await client.get("key", { decoder: Decoder.Bytes });
|
|
424
|
+
* console.log(result); // Output: <Buffer 76 61 6c 75 65>
|
|
411
425
|
* ```
|
|
412
426
|
*/
|
|
413
427
|
get(key: GlideString, options?: DecoderOption): Promise<GlideString | null>;
|
|
@@ -2470,7 +2484,7 @@ export declare class BaseClient {
|
|
|
2470
2484
|
* console.log(result); // Output: 2 - Updates the scores of two existing members in the sorted set "existing_sorted_set."
|
|
2471
2485
|
* ```
|
|
2472
2486
|
*/
|
|
2473
|
-
zadd(key: GlideString, membersAndScores:
|
|
2487
|
+
zadd(key: GlideString, membersAndScores: ElementAndScore[] | Record<string, Score>, options?: ZAddOptions): Promise<number>;
|
|
2474
2488
|
/**
|
|
2475
2489
|
* Increments the score of member in the sorted set stored at `key` by `increment`.
|
|
2476
2490
|
* If `member` does not exist in the sorted set, it is added with `increment` as its score (as if its previous score was 0.0).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
3
|
*/
|
|
4
|
-
import { GlideRecord, GlideString, HashDataType, ObjectType, SortedSetDataType } from "./BaseClient";
|
|
4
|
+
import { GlideRecord, GlideString, HashDataType, Score, ObjectType, SortedSetDataType, ElementAndScore } from "./BaseClient";
|
|
5
5
|
import { command_request } from "./ProtobufMessage";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -47,6 +47,9 @@ export type SetOptions = ({
|
|
|
47
47
|
returnOldValue?: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* If not set, no expiry time will be set for the value.
|
|
50
|
+
*
|
|
51
|
+
* `keepExisting` - Retain the time to live associated with the key.
|
|
52
|
+
* Equivalent to `KEEPTTL` in the Valkey API.
|
|
50
53
|
*/
|
|
51
54
|
expiry?: "keepExisting" | {
|
|
52
55
|
type: TimeUnit;
|
|
@@ -700,7 +703,7 @@ export declare function convertElementsAndScores(membersAndScores: SortedSetData
|
|
|
700
703
|
/**
|
|
701
704
|
* @internal
|
|
702
705
|
*/
|
|
703
|
-
export declare function createZAdd(key: GlideString, membersAndScores:
|
|
706
|
+
export declare function createZAdd(key: GlideString, membersAndScores: ElementAndScore[] | Record<string, Score>, options?: ZAddOptions, incr?: boolean): command_request.Command;
|
|
704
707
|
/**
|
|
705
708
|
* `KeyWeight` - pair of variables represents a weighted key for the `ZINTERSTORE` and `ZUNIONSTORE` sorted sets commands.
|
|
706
709
|
*/
|
|
@@ -501,7 +501,7 @@ export declare class GlideClient extends BaseClient {
|
|
|
501
501
|
* @example
|
|
502
502
|
* ```typescript
|
|
503
503
|
* const code = "#!lua name=mylib \n redis.register_function('myfunc', function(keys, args) return args[1] end)";
|
|
504
|
-
* const result = await client.functionLoad(code, true);
|
|
504
|
+
* const result = await client.functionLoad(code, { replace: true });
|
|
505
505
|
* console.log(result); // Output: 'mylib'
|
|
506
506
|
* ```
|
|
507
507
|
*/
|
|
@@ -907,7 +907,7 @@ export declare class GlideClusterClient extends BaseClient {
|
|
|
907
907
|
* @example
|
|
908
908
|
* ```typescript
|
|
909
909
|
* const code = "#!lua name=mylib \n redis.register_function('myfunc', function(keys, args) return args[1] end)";
|
|
910
|
-
* const result = await client.functionLoad(code, true, 'allNodes');
|
|
910
|
+
* const result = await client.functionLoad(code, { replace: true, route: 'allNodes' });
|
|
911
911
|
* console.log(result); // Output: 'mylib'
|
|
912
912
|
* ```
|
|
913
913
|
*/
|