@valkey/valkey-glide 2.4.2-rc2 → 2.5.0-rc2

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.
@@ -4,7 +4,7 @@
4
4
  import { ClusterScanCursor, Script } from "../build-ts/native";
5
5
  import { AdvancedBaseClientConfiguration, BaseClient, BaseClientConfiguration, DecoderOption, GlideReturnType, GlideString, PubSubMsg } from "./BaseClient";
6
6
  import { ClusterBatch } from "./Batch";
7
- import { ClusterBatchOptions, ClusterScanOptions, FlushMode, FunctionListOptions, FunctionListResponse, FunctionRestorePolicy, FunctionStatsSingleResponse, InfoOptions, LolwutOptions } from "./Commands";
7
+ import { ClientPauseMode, ClientTrackingInfo, ClusterBatchOptions, ClusterScanOptions, FlushMode, FunctionListOptions, FunctionListResponse, FunctionRestorePolicy, FunctionStatsSingleResponse, InfoOptions, LatencyEntry, LatencyEventInfo, LolwutOptions, MemoryStats } from "./Commands";
8
8
  /**
9
9
  * Constant representing all sharded channels.
10
10
  * Use this to unsubscribe from all sharded channel subscriptions at once..
@@ -796,6 +796,31 @@ export declare class GlideClusterClient extends BaseClient {
796
796
  * ```
797
797
  */
798
798
  clientId(options?: RouteOption): Promise<ClusterResponse<number>>;
799
+ /**
800
+ * Returns information about the current client connection's use
801
+ * of the server assisted client side caching feature.
802
+ *
803
+ * The command will be routed to a random node, unless `route` is provided.
804
+ *
805
+ * @see {@link https://valkey.io/commands/client-trackinginfo/|valkey.io} for details.
806
+ *
807
+ * @param options - (Optional) See {@link RouteOption}.
808
+ * @returns A {@link ClusterResponse} containing tracking info(s) for the client.
809
+ *
810
+ * @example
811
+ * ```typescript
812
+ * const info = await client.clientTrackingInfo();
813
+ * console.log(info.flags); // Set { "off" }
814
+ * console.log(info.redirect); // -1
815
+ * ```
816
+ *
817
+ * @example
818
+ * ```typescript
819
+ * const info = await client.clientTrackingInfo({ route: "allNodes" });
820
+ * // info is Record<string, ClientTrackingInfo>
821
+ * ```
822
+ */
823
+ clientTrackingInfo(options?: RouteOption): Promise<ClusterResponse<ClientTrackingInfo>>;
799
824
  /**
800
825
  * Reads the configuration parameters of the running server.
801
826
  * Starting from server version 7, command supports multiple parameters.
@@ -1310,6 +1335,147 @@ export declare class GlideClusterClient extends BaseClient {
1310
1335
  * ```
1311
1336
  */
1312
1337
  lastsave(options?: RouteOption): Promise<ClusterResponse<number>>;
1338
+ /**
1339
+ * Returns the latency spike time series for the specified event.
1340
+ *
1341
+ * The command will be routed to all primary nodes, unless `route` is provided.
1342
+ *
1343
+ * @see {@link https://valkey.io/commands/latency-history/|valkey.io} for details.
1344
+ *
1345
+ * @param event - The name of the latency event (e.g., `"command"`).
1346
+ * @param options - (Optional) See {@link RouteOption}.
1347
+ * @returns A {@link ClusterResponse} containing array(s) of {@link LatencyEntry} for the event.
1348
+ *
1349
+ * @example
1350
+ * ```typescript
1351
+ * const history = await client.latencyHistory("command");
1352
+ * // history is Record<string, LatencyEntry[]> (multi-node) or LatencyEntry[] (single-node)
1353
+ * ```
1354
+ */
1355
+ latencyHistory(event: GlideString, options?: RouteOption): Promise<ClusterResponse<LatencyEntry[]>>;
1356
+ /**
1357
+ * Reports the latest latency events logged by the server.
1358
+ *
1359
+ * The command will be routed to all primary nodes, unless `route` is provided.
1360
+ *
1361
+ * @see {@link https://valkey.io/commands/latency-latest/|valkey.io} for details.
1362
+ *
1363
+ * @param options - (Optional) See {@link RouteOption}.
1364
+ * @returns A {@link ClusterResponse} containing array(s) of {@link LatencyEventInfo} for the latest latency events.
1365
+ *
1366
+ * @example
1367
+ * ```typescript
1368
+ * const latest = await client.latencyLatest();
1369
+ * // latest is Record<string, LatencyEventInfo[]> (multi-node) or LatencyEventInfo[] (single-node)
1370
+ * ```
1371
+ */
1372
+ latencyLatest(options?: RouteOption): Promise<ClusterResponse<LatencyEventInfo[]>>;
1373
+ /**
1374
+ * Resets the latency spike time series for all or specified events.
1375
+ * If no events are provided, resets the latency spike time series for all events.
1376
+ *
1377
+ * The command will be routed to all primary nodes, unless `route` is provided.
1378
+ *
1379
+ * @see {@link https://valkey.io/commands/latency-reset/|valkey.io} for details.
1380
+ *
1381
+ * @param events - The event names to reset. If not provided, resets all events.
1382
+ * @param options - (Optional) See {@link RouteOption}.
1383
+ * @returns The total number of event time series that were reset across all nodes.
1384
+ *
1385
+ * @example
1386
+ * ```typescript
1387
+ * await client.latencyReset(); // Resets all events
1388
+ * await client.latencyReset(["command"], { route: "allNodes" });
1389
+ * ```
1390
+ */
1391
+ latencyReset(events?: GlideString[], options?: RouteOption): Promise<number>;
1392
+ /**
1393
+ * Synchronously saves the dataset to disk.
1394
+ *
1395
+ * The command will be routed to all primary nodes, unless `route` is provided.
1396
+ *
1397
+ * @see {@link https://valkey.io/commands/save/|valkey.io} for more details.
1398
+ *
1399
+ * @param options - (Optional) See {@link RouteOption}.
1400
+ * @returns `"OK"`
1401
+ *
1402
+ * @example
1403
+ * ```typescript
1404
+ * const result = await client.save();
1405
+ * console.log(result); // "OK"
1406
+ * ```
1407
+ */
1408
+ save(options?: RouteOption): Promise<"OK">;
1409
+ /**
1410
+ * Asynchronously saves the dataset to disk in the background.
1411
+ *
1412
+ * The command will be routed to all primary nodes, unless `route` is provided.
1413
+ *
1414
+ * @see {@link https://valkey.io/commands/bgsave/|valkey.io} for more details.
1415
+ *
1416
+ * @param options - (Optional) See {@link RouteOption}.
1417
+ * @returns A non-empty status string.
1418
+ *
1419
+ * @example
1420
+ * ```typescript
1421
+ * const result = await client.bgsave();
1422
+ * console.log(result); // "Background saving started"
1423
+ * ```
1424
+ */
1425
+ bgsave(options?: RouteOption): Promise<ClusterResponse<string>>;
1426
+ /**
1427
+ * Schedules a background save of the database.
1428
+ *
1429
+ * The command will be routed to all primary nodes, unless `route` is provided.
1430
+ *
1431
+ * @see {@link https://valkey.io/commands/bgsave/|valkey.io} for more details.
1432
+ *
1433
+ * @param options - (Optional) See {@link RouteOption}.
1434
+ * @returns A non-empty status string.
1435
+ *
1436
+ * @example
1437
+ * ```typescript
1438
+ * const result = await client.bgsaveSchedule();
1439
+ * console.log(result); // "Background saving scheduled"
1440
+ * ```
1441
+ */
1442
+ bgsaveSchedule(options?: RouteOption): Promise<ClusterResponse<string>>;
1443
+ /**
1444
+ * Aborts all in-progress and scheduled background saves.
1445
+ *
1446
+ * The command will be routed to all primary nodes, unless `route` is provided.
1447
+ *
1448
+ * @see {@link https://valkey.io/commands/bgsave/|valkey.io} for more details.
1449
+ *
1450
+ * @since Valkey 8.1
1451
+ *
1452
+ * @param options - (Optional) See {@link RouteOption}.
1453
+ * @returns A non-empty status string.
1454
+ *
1455
+ * @example
1456
+ * ```typescript
1457
+ * const result = await client.bgsaveCancel();
1458
+ * console.log(result); // "Background saving cancelled"
1459
+ * ```
1460
+ */
1461
+ bgsaveCancel(options?: RouteOption): Promise<ClusterResponse<string>>;
1462
+ /**
1463
+ * Initiates a background rewrite of the append-only file (AOF).
1464
+ *
1465
+ * The command will be routed to all primary nodes, unless `route` is provided.
1466
+ *
1467
+ * @see {@link https://valkey.io/commands/bgrewriteaof/|valkey.io} for more details.
1468
+ *
1469
+ * @param options - (Optional) See {@link RouteOption}.
1470
+ * @returns A non-empty status string.
1471
+ *
1472
+ * @example
1473
+ * ```typescript
1474
+ * const result = await client.bgrewriteaof();
1475
+ * console.log(result); // "Background append only file rewriting started"
1476
+ * ```
1477
+ */
1478
+ bgrewriteaof(options?: RouteOption): Promise<ClusterResponse<string>>;
1313
1479
  /**
1314
1480
  * Returns a random existing key name.
1315
1481
  *
@@ -1345,6 +1511,49 @@ export declare class GlideClusterClient extends BaseClient {
1345
1511
  * ```
1346
1512
  */
1347
1513
  unwatch(options?: RouteOption): Promise<"OK">;
1514
+ /**
1515
+ * Suspends all clients for the specified timeout.
1516
+ *
1517
+ * The command will be routed to all primary nodes, unless `route` is provided.
1518
+ *
1519
+ * @see {@link https://valkey.io/commands/client-pause/|valkey.io} for details.
1520
+ *
1521
+ * @param timeout - The time in milliseconds to pause clients.
1522
+ * @param mode - (Optional) The pause mode to use.
1523
+ * + If not provided, all commands are paused.
1524
+ * @param options - (Optional) See {@link RouteOption} and {@link DecoderOption}.
1525
+ * @returns `"OK"` response on success.
1526
+ *
1527
+ * @example
1528
+ * ```typescript
1529
+ * const result = await client.clientPause(1000);
1530
+ * console.log(result); // Output: 'OK'
1531
+ * ```
1532
+ *
1533
+ * @example
1534
+ * ```typescript
1535
+ * const result = await client.clientPause(1000, ClientPauseMode.WRITE);
1536
+ * console.log(result); // Output: 'OK'
1537
+ * ```
1538
+ */
1539
+ clientPause(timeout: number, mode?: ClientPauseMode, options?: RouteOption & DecoderOption): Promise<"OK">;
1540
+ /**
1541
+ * Resumes processing commands on all clients.
1542
+ *
1543
+ * The command will be routed to all primary nodes, unless `route` is provided.
1544
+ *
1545
+ * @see {@link https://valkey.io/commands/client-unpause/|valkey.io} for details.
1546
+ *
1547
+ * @param options - (Optional) See {@link RouteOption} and {@link DecoderOption}.
1548
+ * @returns `"OK"` response on success.
1549
+ *
1550
+ * @example
1551
+ * ```typescript
1552
+ * const result = await client.clientUnpause();
1553
+ * console.log(result); // Output: 'OK'
1554
+ * ```
1555
+ */
1556
+ clientUnpause(options?: RouteOption & DecoderOption): Promise<"OK">;
1348
1557
  /**
1349
1558
  * Invokes a Lua script with arguments.
1350
1559
  * This method simplifies the process of invoking scripts on a Valkey server by using an object that represents a Lua script.
@@ -1517,4 +1726,72 @@ export declare class GlideClusterClient extends BaseClient {
1517
1726
  * ```
1518
1727
  */
1519
1728
  getSubscriptions(): Promise<ClusterPubSubState>;
1729
+ /**
1730
+ * Returns a report about memory problems detected by the server.
1731
+ *
1732
+ * The command will be routed to all primary nodes, unless `route` is provided.
1733
+ *
1734
+ * @see {@link https://valkey.io/commands/memory-doctor/|valkey.io} for details.
1735
+ *
1736
+ * @param options - (Optional) See {@link RouteOption} to specify the route to override the default.
1737
+ * @returns A {@link ClusterResponse} containing the memory diagnostic report string(s).
1738
+ *
1739
+ * @example
1740
+ * ```typescript
1741
+ * const report = await client.memoryDoctor();
1742
+ * // report is Record<string, string> (multi-node) or string (single-node)
1743
+ * ```
1744
+ */
1745
+ memoryDoctor(options?: RouteOption): Promise<ClusterResponse<string>>;
1746
+ /**
1747
+ * Returns the internal statistics of the memory allocator.
1748
+ *
1749
+ * The command will be routed to all primary nodes, unless `route` is provided.
1750
+ *
1751
+ * @see {@link https://valkey.io/commands/memory-malloc-stats/|valkey.io} for details.
1752
+ *
1753
+ * @param options - (Optional) See {@link RouteOption} to specify the route to override the default.
1754
+ * @returns A {@link ClusterResponse} containing the memory allocator statistics string(s).
1755
+ *
1756
+ * @example
1757
+ * ```typescript
1758
+ * const stats = await client.memoryMallocStats();
1759
+ * // stats is Record<string, string> (multi-node) or string (single-node)
1760
+ * ```
1761
+ */
1762
+ memoryMallocStats(options?: RouteOption): Promise<ClusterResponse<string>>;
1763
+ /**
1764
+ * Asks the server to reclaim memory from the allocator back to the operating system.
1765
+ *
1766
+ * The command will be routed to all primary nodes, unless `route` is provided.
1767
+ *
1768
+ * @see {@link https://valkey.io/commands/memory-purge/|valkey.io} for details.
1769
+ *
1770
+ * @param options - (Optional) See {@link RouteOption} to specify the route to override the default.
1771
+ * @returns `"OK"`.
1772
+ *
1773
+ * @example
1774
+ * ```typescript
1775
+ * const result = await client.memoryPurge();
1776
+ * console.log(result); // Output: 'OK'
1777
+ * ```
1778
+ */
1779
+ memoryPurge(options?: RouteOption): Promise<"OK">;
1780
+ /**
1781
+ * Returns detailed memory consumption statistics of the server.
1782
+ *
1783
+ * The command will be routed to all primary nodes, unless `route` is provided.
1784
+ *
1785
+ * @see {@link https://valkey.io/commands/memory-stats/|valkey.io} for details.
1786
+ *
1787
+ * @param options - (Optional) See {@link RouteOption} to specify the route to override the default.
1788
+ * @returns A {@link ClusterResponse} containing {@link MemoryStats} object(s).
1789
+ *
1790
+ * @example
1791
+ * ```typescript
1792
+ * const stats = await client.memoryStats();
1793
+ * // stats is Record<string, MemoryStats> (multi-node) or MemoryStats (single-node)
1794
+ * ```
1795
+ */
1796
+ memoryStats(options?: RouteOption): Promise<ClusterResponse<MemoryStats>>;
1520
1797
  }