@valkey/valkey-glide 1.1.0 → 1.2.0-rc003

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.
@@ -8,4 +8,5 @@ export * from "./src/Errors";
8
8
  export * from "./src/GlideClient";
9
9
  export * from "./src/GlideClusterClient";
10
10
  export * from "./src/Logger";
11
+ export * from "./src/server-modules/GlideJson";
11
12
  export * from "./src/Transaction";
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, Script, ObjectType, ClusterScanCursor, BaseClientConfiguration, GlideClusterClientConfiguration, LevelOptions, ReturnTypeRecord, ReturnTypeMap, ClusterResponse, ReturnTypeAttribute, } = 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, GlideJson, GlideRecord, GlideString, JsonGetOptions, 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,
@@ -89,7 +89,9 @@ function initialize() {
89
89
  DecoderOption,
90
90
  GeoAddOptions,
91
91
  GlideRecord,
92
+ GlideJson,
92
93
  GlideString,
94
+ JsonGetOptions,
93
95
  SortedSetDataType,
94
96
  StreamEntryDataType,
95
97
  HashDataType,
@@ -201,6 +201,13 @@ export interface BaseClientConfiguration {
201
201
  * If not set, 'Decoder.String' will be used.
202
202
  */
203
203
  defaultDecoder?: Decoder;
204
+ /**
205
+ * The maximum number of concurrent requests allowed to be in-flight (sent but not yet completed).
206
+ * This limit is used to control the memory usage and prevent the client from overwhelming the
207
+ * server or getting stuck in case of a queue backlog. If not set, a default value of 1000 will be
208
+ * used.
209
+ */
210
+ inflightRequestsLimit?: number;
204
211
  }
205
212
  /**
206
213
  * Enum of Valkey data types
@@ -245,6 +252,7 @@ export declare class BaseClient {
245
252
  protected defaultDecoder: Decoder;
246
253
  private readonly pubsubFutures;
247
254
  private pendingPushNotification;
255
+ private readonly inflightRequestsLimit;
248
256
  private config;
249
257
  protected configurePubsub(options: GlideClusterClientConfiguration | GlideClientConfiguration, configuration: connection_request.IConnectionRequest): void;
250
258
  private handleReadData;
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
3
  */
4
- import { ClusterScanCursor } from "glide-rs";
5
- import { Script } from "index";
4
+ import { ClusterScanCursor, Script } from "glide-rs";
6
5
  import * as net from "net";
7
6
  import { BaseClient, BaseClientConfiguration, DecoderOption, GlideReturnType, GlideString, PubSubMsg } from "./BaseClient";
8
7
  import { FlushMode, FunctionListOptions, FunctionListResponse, FunctionRestorePolicy, FunctionStatsSingleResponse, InfoOptions, LolwutOptions, ScanOptions } from "./Commands";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
3
  */
4
- export type LevelOptions = "error" | "warn" | "info" | "debug" | "trace";
4
+ export type LevelOptions = "error" | "warn" | "info" | "debug" | "trace" | "off";
5
5
  export declare class Logger {
6
6
  private static _instance;
7
7
  private static logger_level;
@@ -19,12 +19,14 @@ export declare class Logger {
19
19
  * Initialize a logger if it wasn't initialized before - this method is meant to be used when there is no intention to replace an existing logger.
20
20
  * The logger will filter all logs with a level lower than the given level,
21
21
  * If given a fileName argument, will write the logs to files postfixed with fileName. If fileName isn't provided, the logs will be written to the console.
22
+ * To turn off the logger, provide the level "off".
22
23
  */
23
24
  static init(level?: LevelOptions, fileName?: string): void;
24
25
  /**
25
26
  * configure the logger.
26
27
  * the level argument is the level of the logs you want the system to provide (error logs, warn logs, etc.)
27
28
  * the filename argument is optional - if provided the target of the logs will be the file mentioned, else will be the console
29
+ * To turn off the logger, provide the level "off".
28
30
  */
29
31
  static setLoggerConfig(level: LevelOptions, fileName?: string): void;
30
32
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valkey/valkey-glide",
3
3
  "types": "build-ts/index.d.ts",
4
- "version": "1.1.0",
4
+ "version": "1.2.0-rc003",
5
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",
@@ -40,12 +40,12 @@
40
40
  "typescript": "^4.9.4"
41
41
  },
42
42
  "optionalDependencies": {
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"
43
+ "@valkey/valkey-glide-darwin-arm64": "1.2.0-rc003",
44
+ "@valkey/valkey-glide-darwin-x64": "1.2.0-rc003",
45
+ "@valkey/valkey-glide-linux-arm64": "1.2.0-rc003",
46
+ "@valkey/valkey-glide-linux-x64": "1.2.0-rc003",
47
+ "@valkey/valkey-glide-linux-musl-arm64": "1.2.0-rc003",
48
+ "@valkey/valkey-glide-linux-musl-x64": "1.2.0-rc003"
49
49
  },
50
50
  "eslintConfig": {
51
51
  "extends": [