@valkey/valkey-glide 2.1.1-rc1 → 2.1.1-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.
@@ -912,6 +912,42 @@ export declare class BaseClient {
912
912
  * ```
913
913
  */
914
914
  incrByFloat(key: GlideString, amount: number): Promise<number>;
915
+ /**
916
+ * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
917
+ * the value will be copied to the database specified, otherwise the current database will be used.
918
+ * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
919
+ * no action.
920
+ *
921
+ * @see {@link https://valkey.io/commands/copy/|valkey.io} for more details.
922
+ * @remarks Since Valkey version 6.2.0. destinationDB parameter for cluster mode is supported since Valkey 9.0.0 and above
923
+ *
924
+ * @param source - The key to the source value.
925
+ * @param destination - The key where the value should be copied to.
926
+ * @param options - (Optional) Additional parameters:
927
+ * - (Optional) `destinationDB`: the alternative logical database index for the destination key.
928
+ * If not provided, the current database will be used.
929
+ * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
930
+ * value to it. If not provided, no action will be performed if the key already exists.
931
+ * @returns `true` if `source` was copied, `false` if the `source` was not copied.
932
+ *
933
+ * @example
934
+ * ```typescript
935
+ * const result = await client.copy("set1", "set2");
936
+ * console.log(result); // Output: true - "set1" was copied to "set2".
937
+ * ```
938
+ * ```typescript
939
+ * const result = await client.copy("set1", "set2", { replace: true });
940
+ * console.log(result); // Output: true - "set1" was copied to "set2".
941
+ * ```
942
+ * ```typescript
943
+ * const result = await client.copy("set1", "set2", { destinationDB: 1, replace: false });
944
+ * console.log(result); // Output: true - "set1" was copied to "set2".
945
+ * ```
946
+ */
947
+ copy(source: GlideString, destination: GlideString, options?: {
948
+ destinationDB?: number;
949
+ replace?: boolean;
950
+ }): Promise<boolean>;
915
951
  /** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
916
952
  *
917
953
  * @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
@@ -1131,6 +1131,41 @@ class BaseClient {
1131
1131
  async incrByFloat(key, amount) {
1132
1132
  return this.createWritePromise((0, _1.createIncrByFloat)(key, amount));
1133
1133
  }
1134
+ /**
1135
+ * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
1136
+ * the value will be copied to the database specified, otherwise the current database will be used.
1137
+ * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
1138
+ * no action.
1139
+ *
1140
+ * @see {@link https://valkey.io/commands/copy/|valkey.io} for more details.
1141
+ * @remarks Since Valkey version 6.2.0. destinationDB parameter for cluster mode is supported since Valkey 9.0.0 and above
1142
+ *
1143
+ * @param source - The key to the source value.
1144
+ * @param destination - The key where the value should be copied to.
1145
+ * @param options - (Optional) Additional parameters:
1146
+ * - (Optional) `destinationDB`: the alternative logical database index for the destination key.
1147
+ * If not provided, the current database will be used.
1148
+ * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
1149
+ * value to it. If not provided, no action will be performed if the key already exists.
1150
+ * @returns `true` if `source` was copied, `false` if the `source` was not copied.
1151
+ *
1152
+ * @example
1153
+ * ```typescript
1154
+ * const result = await client.copy("set1", "set2");
1155
+ * console.log(result); // Output: true - "set1" was copied to "set2".
1156
+ * ```
1157
+ * ```typescript
1158
+ * const result = await client.copy("set1", "set2", { replace: true });
1159
+ * console.log(result); // Output: true - "set1" was copied to "set2".
1160
+ * ```
1161
+ * ```typescript
1162
+ * const result = await client.copy("set1", "set2", { destinationDB: 1, replace: false });
1163
+ * console.log(result); // Output: true - "set1" was copied to "set2".
1164
+ * ```
1165
+ */
1166
+ async copy(source, destination, options) {
1167
+ return this.createWritePromise((0, _1.createCopy)(source, destination, options));
1168
+ }
1134
1169
  /** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
1135
1170
  *
1136
1171
  * @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
@@ -115,6 +115,28 @@ export declare class BaseBatch<T extends BaseBatch<T>> {
115
115
  * Command Response - `"PONG"` if `message` is not provided, otherwise return a copy of `message`.
116
116
  */
117
117
  ping(message?: GlideString): T;
118
+ /**
119
+ * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
120
+ * the value will be copied to the database specified, otherwise the current database will be used.
121
+ * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
122
+ * no action.
123
+ *
124
+ * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
125
+ * @remarks Since Valkey version 6.2.0. destinationDB parameter for cluster mode is supported since Valkey 9.0.0 and above
126
+ *
127
+ * @param source - The key to the source value.
128
+ * @param destination - The key where the value should be copied to.
129
+ * @param destinationDB - (Optional) The alternative logical database index for the destination key.
130
+ * If not provided, the current database will be used.
131
+ * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
132
+ * value to it. If not provided, no action will be performed if the key already exists.
133
+ *
134
+ * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
135
+ */
136
+ copy(source: GlideString, destination: GlideString, options?: {
137
+ destinationDB?: number;
138
+ replace?: boolean;
139
+ }): T;
118
140
  /**
119
141
  * Gets information and statistics about the server.
120
142
  *
@@ -3102,28 +3124,6 @@ export declare class Batch extends BaseBatch<Batch> {
3102
3124
  * Command Response - A simple `"OK"` response.
3103
3125
  */
3104
3126
  select(index: number): Batch;
3105
- /**
3106
- * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
3107
- * the value will be copied to the database specified, otherwise the current database will be used.
3108
- * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
3109
- * no action.
3110
- *
3111
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
3112
- * @remarks Since Valkey version 6.2.0.
3113
- *
3114
- * @param source - The key to the source value.
3115
- * @param destination - The key where the value should be copied to.
3116
- * @param destinationDB - (Optional) The alternative logical database index for the destination key.
3117
- * If not provided, the current database will be used.
3118
- * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
3119
- * value to it. If not provided, no action will be performed if the key already exists.
3120
- *
3121
- * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
3122
- */
3123
- copy(source: GlideString, destination: GlideString, options?: {
3124
- destinationDB?: number;
3125
- replace?: boolean;
3126
- }): Batch;
3127
3127
  /** Publish a message on pubsub channel.
3128
3128
  *
3129
3129
  * @see {@link https://valkey.io/commands/publish/|valkey.io} for more details.
@@ -3175,23 +3175,6 @@ export declare class Batch extends BaseBatch<Batch> {
3175
3175
  * ```
3176
3176
  */
3177
3177
  export declare class ClusterBatch extends BaseBatch<ClusterBatch> {
3178
- /**
3179
- * Copies the value stored at the `source` to the `destination` key. When `replace` is true,
3180
- * removes the `destination` key first if it already exists, otherwise performs no action.
3181
- *
3182
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
3183
- * @remarks Since Valkey version 6.2.0.
3184
- *
3185
- * @param source - The key to the source value.
3186
- * @param destination - The key where the value should be copied to.
3187
- * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
3188
- * value to it. If not provided, no action will be performed if the key already exists.
3189
- *
3190
- * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
3191
- */
3192
- copy(source: GlideString, destination: GlideString, options?: {
3193
- replace?: boolean;
3194
- }): ClusterBatch;
3195
3178
  /** Publish a message on pubsub channel.
3196
3179
  * This command aggregates PUBLISH and SPUBLISH commands functionalities.
3197
3180
  * The mode is selected using the 'sharded' parameter.
package/build-ts/Batch.js CHANGED
@@ -135,6 +135,27 @@ class BaseBatch {
135
135
  ping(message) {
136
136
  return this.addAndReturn((0, _1.createPing)(message));
137
137
  }
138
+ /**
139
+ * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
140
+ * the value will be copied to the database specified, otherwise the current database will be used.
141
+ * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
142
+ * no action.
143
+ *
144
+ * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
145
+ * @remarks Since Valkey version 6.2.0. destinationDB parameter for cluster mode is supported since Valkey 9.0.0 and above
146
+ *
147
+ * @param source - The key to the source value.
148
+ * @param destination - The key where the value should be copied to.
149
+ * @param destinationDB - (Optional) The alternative logical database index for the destination key.
150
+ * If not provided, the current database will be used.
151
+ * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
152
+ * value to it. If not provided, no action will be performed if the key already exists.
153
+ *
154
+ * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
155
+ */
156
+ copy(source, destination, options) {
157
+ return this.addAndReturn((0, _1.createCopy)(source, destination, options));
158
+ }
138
159
  /**
139
160
  * Gets information and statistics about the server.
140
161
  *
@@ -3536,27 +3557,6 @@ class Batch extends BaseBatch {
3536
3557
  select(index) {
3537
3558
  return this.addAndReturn((0, _1.createSelect)(index));
3538
3559
  }
3539
- /**
3540
- * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
3541
- * the value will be copied to the database specified, otherwise the current database will be used.
3542
- * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
3543
- * no action.
3544
- *
3545
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
3546
- * @remarks Since Valkey version 6.2.0.
3547
- *
3548
- * @param source - The key to the source value.
3549
- * @param destination - The key where the value should be copied to.
3550
- * @param destinationDB - (Optional) The alternative logical database index for the destination key.
3551
- * If not provided, the current database will be used.
3552
- * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
3553
- * value to it. If not provided, no action will be performed if the key already exists.
3554
- *
3555
- * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
3556
- */
3557
- copy(source, destination, options) {
3558
- return this.addAndReturn((0, _1.createCopy)(source, destination, options));
3559
- }
3560
3560
  /** Publish a message on pubsub channel.
3561
3561
  *
3562
3562
  * @see {@link https://valkey.io/commands/publish/|valkey.io} for more details.
@@ -3612,23 +3612,6 @@ exports.Batch = Batch;
3612
3612
  */
3613
3613
  class ClusterBatch extends BaseBatch {
3614
3614
  /// TODO: add all CLUSTER commands
3615
- /**
3616
- * Copies the value stored at the `source` to the `destination` key. When `replace` is true,
3617
- * removes the `destination` key first if it already exists, otherwise performs no action.
3618
- *
3619
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
3620
- * @remarks Since Valkey version 6.2.0.
3621
- *
3622
- * @param source - The key to the source value.
3623
- * @param destination - The key where the value should be copied to.
3624
- * @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
3625
- * value to it. If not provided, no action will be performed if the key already exists.
3626
- *
3627
- * Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
3628
- */
3629
- copy(source, destination, options) {
3630
- return this.addAndReturn((0, _1.createCopy)(source, destination, options));
3631
- }
3632
3615
  /** Publish a message on pubsub channel.
3633
3616
  * This command aggregates PUBLISH and SPUBLISH commands functionalities.
3634
3617
  * The mode is selected using the 'sharded' parameter.
@@ -418,42 +418,6 @@ export declare class GlideClient extends BaseClient {
418
418
  * ```
419
419
  */
420
420
  time(): Promise<[string, string]>;
421
- /**
422
- * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
423
- * the value will be copied to the database specified, otherwise the current database will be used.
424
- * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
425
- * no action.
426
- *
427
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for more details.
428
- * @remarks Since Valkey version 6.2.0.
429
- *
430
- * @param source - The key to the source value.
431
- * @param destination - The key where the value should be copied to.
432
- * @param options - (Optional) Additional parameters:
433
- * - (Optional) `destinationDB`: the alternative logical database index for the destination key.
434
- * If not provided, the current database will be used.
435
- * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
436
- * value to it. If not provided, no action will be performed if the key already exists.
437
- * @returns `true` if `source` was copied, `false` if the `source` was not copied.
438
- *
439
- * @example
440
- * ```typescript
441
- * const result = await client.copy("set1", "set2");
442
- * console.log(result); // Output: true - "set1" was copied to "set2".
443
- * ```
444
- * ```typescript
445
- * const result = await client.copy("set1", "set2", { replace: true });
446
- * console.log(result); // Output: true - "set1" was copied to "set2".
447
- * ```
448
- * ```typescript
449
- * const result = await client.copy("set1", "set2", { destinationDB: 1, replace: false });
450
- * console.log(result); // Output: true - "set1" was copied to "set2".
451
- * ```
452
- */
453
- copy(source: GlideString, destination: GlideString, options?: {
454
- destinationDB?: number;
455
- replace?: boolean;
456
- }): Promise<boolean>;
457
421
  /**
458
422
  * Displays a piece of generative computer art and the server version.
459
423
  *
@@ -412,41 +412,6 @@ class GlideClient extends _1.BaseClient {
412
412
  decoder: _1.Decoder.String,
413
413
  });
414
414
  }
415
- /**
416
- * Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
417
- * the value will be copied to the database specified, otherwise the current database will be used.
418
- * When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
419
- * no action.
420
- *
421
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for more details.
422
- * @remarks Since Valkey version 6.2.0.
423
- *
424
- * @param source - The key to the source value.
425
- * @param destination - The key where the value should be copied to.
426
- * @param options - (Optional) Additional parameters:
427
- * - (Optional) `destinationDB`: the alternative logical database index for the destination key.
428
- * If not provided, the current database will be used.
429
- * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
430
- * value to it. If not provided, no action will be performed if the key already exists.
431
- * @returns `true` if `source` was copied, `false` if the `source` was not copied.
432
- *
433
- * @example
434
- * ```typescript
435
- * const result = await client.copy("set1", "set2");
436
- * console.log(result); // Output: true - "set1" was copied to "set2".
437
- * ```
438
- * ```typescript
439
- * const result = await client.copy("set1", "set2", { replace: true });
440
- * console.log(result); // Output: true - "set1" was copied to "set2".
441
- * ```
442
- * ```typescript
443
- * const result = await client.copy("set1", "set2", { destinationDB: 1, replace: false });
444
- * console.log(result); // Output: true - "set1" was copied to "set2".
445
- * ```
446
- */
447
- async copy(source, destination, options) {
448
- return this.createWritePromise((0, _1.createCopy)(source, destination, options));
449
- }
450
415
  /**
451
416
  * Displays a piece of generative computer art and the server version.
452
417
  *
@@ -843,30 +843,6 @@ export declare class GlideClusterClient extends BaseClient {
843
843
  * ```
844
844
  */
845
845
  time(options?: RouteOption): Promise<ClusterResponse<[string, string]>>;
846
- /**
847
- * Copies the value stored at the `source` to the `destination` key. When `replace` is `true`,
848
- * removes the `destination` key first if it already exists, otherwise performs no action.
849
- *
850
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
851
- * @remarks When in cluster mode, `source` and `destination` must map to the same hash slot.
852
- * @remarks Since Valkey version 6.2.0.
853
- *
854
- * @param source - The key to the source value.
855
- * @param destination - The key where the value should be copied to.
856
- * @param options - (Optional) Additional parameters:
857
- * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
858
- * value to it. If not provided, no action will be performed if the key already exists.
859
- * @returns `true` if `source` was copied, `false` if the `source` was not copied.
860
- *
861
- * @example
862
- * ```typescript
863
- * const result = await client.copy("set1", "set2", { replace: true });
864
- * console.log(result); // Output: true - "set1" was copied to "set2".
865
- * ```
866
- */
867
- copy(source: GlideString, destination: GlideString, options?: {
868
- replace?: boolean;
869
- }): Promise<boolean>;
870
846
  /**
871
847
  * Displays a piece of generative computer art and the server version.
872
848
  *
@@ -626,30 +626,6 @@ class GlideClusterClient extends _1.BaseClient {
626
626
  async time(options) {
627
627
  return this.createWritePromise((0, _1.createTime)(), options).then((res) => convertClusterGlideRecord(res, true, options?.route));
628
628
  }
629
- /**
630
- * Copies the value stored at the `source` to the `destination` key. When `replace` is `true`,
631
- * removes the `destination` key first if it already exists, otherwise performs no action.
632
- *
633
- * @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
634
- * @remarks When in cluster mode, `source` and `destination` must map to the same hash slot.
635
- * @remarks Since Valkey version 6.2.0.
636
- *
637
- * @param source - The key to the source value.
638
- * @param destination - The key where the value should be copied to.
639
- * @param options - (Optional) Additional parameters:
640
- * - (Optional) `replace`: if `true`, the `destination` key should be removed before copying the
641
- * value to it. If not provided, no action will be performed if the key already exists.
642
- * @returns `true` if `source` was copied, `false` if the `source` was not copied.
643
- *
644
- * @example
645
- * ```typescript
646
- * const result = await client.copy("set1", "set2", { replace: true });
647
- * console.log(result); // Output: true - "set1" was copied to "set2".
648
- * ```
649
- */
650
- async copy(source, destination, options) {
651
- return this.createWritePromise((0, _1.createCopy)(source, destination, options));
652
- }
653
629
  /**
654
630
  * Displays a piece of generative computer art and the server version.
655
631
  *
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "build-ts/index.js",
5
5
  "module": "build-ts/index.js",
6
6
  "types": "build-ts/index.d.ts",
7
- "version": "2.1.1-rc1",
7
+ "version": "2.1.1-rc2",
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": {
@@ -134,11 +134,11 @@
134
134
  }
135
135
  },
136
136
  "optionalDependencies": {
137
- "@valkey/valkey-glide-darwin-x64": "2.1.1-rc1",
138
- "@valkey/valkey-glide-darwin-arm64": "2.1.1-rc1",
139
- "@valkey/valkey-glide-linux-x64-gnu": "2.1.1-rc1",
140
- "@valkey/valkey-glide-linux-arm64-gnu": "2.1.1-rc1",
141
- "@valkey/valkey-glide-linux-x64-musl": "2.1.1-rc1",
142
- "@valkey/valkey-glide-linux-arm64-musl": "2.1.1-rc1"
137
+ "@valkey/valkey-glide-darwin-x64": "2.1.1-rc2",
138
+ "@valkey/valkey-glide-darwin-arm64": "2.1.1-rc2",
139
+ "@valkey/valkey-glide-linux-x64-gnu": "2.1.1-rc2",
140
+ "@valkey/valkey-glide-linux-arm64-gnu": "2.1.1-rc2",
141
+ "@valkey/valkey-glide-linux-x64-musl": "2.1.1-rc2",
142
+ "@valkey/valkey-glide-linux-arm64-musl": "2.1.1-rc2"
143
143
  }
144
144
  }