@valkey/valkey-glide 2.1.0 → 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.
- package/build-ts/BaseClient.d.ts +55 -0
- package/build-ts/BaseClient.js +56 -0
- package/build-ts/Batch.d.ts +36 -51
- package/build-ts/Batch.js +37 -52
- package/build-ts/GlideClient.d.ts +0 -53
- package/build-ts/GlideClient.js +0 -54
- package/build-ts/GlideClusterClient.d.ts +0 -24
- package/build-ts/GlideClusterClient.js +0 -24
- package/package.json +7 -7
package/build-ts/BaseClient.d.ts
CHANGED
|
@@ -841,6 +841,25 @@ export declare class BaseClient {
|
|
|
841
841
|
* ```
|
|
842
842
|
*/
|
|
843
843
|
msetnx(keysAndValues: Record<string, GlideString> | GlideRecord<GlideString>): Promise<boolean>;
|
|
844
|
+
/**
|
|
845
|
+
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
846
|
+
*
|
|
847
|
+
* @remarks Move is available for cluster mode since Valkey 9.0.0 and above.
|
|
848
|
+
*
|
|
849
|
+
* @see {@link https://valkey.io/commands/move/|valkey.io} for more details.
|
|
850
|
+
*
|
|
851
|
+
* @param key - The key to move.
|
|
852
|
+
* @param dbIndex - The index of the database to move `key` to.
|
|
853
|
+
* @returns `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
854
|
+
* database or does not exist in the source database.
|
|
855
|
+
*
|
|
856
|
+
* @example
|
|
857
|
+
* ```typescript
|
|
858
|
+
* const result = await client.move("key", 1);
|
|
859
|
+
* console.log(result); // Output: true
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
862
|
+
move(key: GlideString, dbIndex: number): Promise<boolean>;
|
|
844
863
|
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
845
864
|
*
|
|
846
865
|
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
@@ -893,6 +912,42 @@ export declare class BaseClient {
|
|
|
893
912
|
* ```
|
|
894
913
|
*/
|
|
895
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>;
|
|
896
951
|
/** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
897
952
|
*
|
|
898
953
|
* @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
|
package/build-ts/BaseClient.js
CHANGED
|
@@ -1052,6 +1052,27 @@ class BaseClient {
|
|
|
1052
1052
|
async msetnx(keysAndValues) {
|
|
1053
1053
|
return this.createWritePromise((0, _1.createMSetNX)(convertGlideRecord(keysAndValues)));
|
|
1054
1054
|
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
1057
|
+
*
|
|
1058
|
+
* @remarks Move is available for cluster mode since Valkey 9.0.0 and above.
|
|
1059
|
+
*
|
|
1060
|
+
* @see {@link https://valkey.io/commands/move/|valkey.io} for more details.
|
|
1061
|
+
*
|
|
1062
|
+
* @param key - The key to move.
|
|
1063
|
+
* @param dbIndex - The index of the database to move `key` to.
|
|
1064
|
+
* @returns `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
1065
|
+
* database or does not exist in the source database.
|
|
1066
|
+
*
|
|
1067
|
+
* @example
|
|
1068
|
+
* ```typescript
|
|
1069
|
+
* const result = await client.move("key", 1);
|
|
1070
|
+
* console.log(result); // Output: true
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
async move(key, dbIndex) {
|
|
1074
|
+
return this.createWritePromise((0, _1.createMove)(key, dbIndex));
|
|
1075
|
+
}
|
|
1055
1076
|
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
1056
1077
|
*
|
|
1057
1078
|
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
@@ -1110,6 +1131,41 @@ class BaseClient {
|
|
|
1110
1131
|
async incrByFloat(key, amount) {
|
|
1111
1132
|
return this.createWritePromise((0, _1.createIncrByFloat)(key, amount));
|
|
1112
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
|
+
}
|
|
1113
1169
|
/** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
1114
1170
|
*
|
|
1115
1171
|
* @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
|
package/build-ts/Batch.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -215,6 +237,20 @@ export declare class BaseBatch<T extends BaseBatch<T>> {
|
|
|
215
237
|
* Command Response - `true` if all keys were set. `false` if no key was set.
|
|
216
238
|
*/
|
|
217
239
|
msetnx(keysAndValues: Record<string, GlideString> | GlideRecord<GlideString>): T;
|
|
240
|
+
/**
|
|
241
|
+
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
242
|
+
*
|
|
243
|
+
* @remarks Move is available for cluster mode since Valkey 9.0.0 and above.
|
|
244
|
+
*
|
|
245
|
+
* @see {@link https://valkey.io/commands/move/|valkey.io} for details.
|
|
246
|
+
*
|
|
247
|
+
* @param key - The key to move.
|
|
248
|
+
* @param dbIndex - The index of the database to move `key` to.
|
|
249
|
+
*
|
|
250
|
+
* Command Response - `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
251
|
+
* database or does not exist in the source database.
|
|
252
|
+
*/
|
|
253
|
+
move(key: GlideString, dbIndex: number): T;
|
|
218
254
|
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
219
255
|
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
220
256
|
*
|
|
@@ -3088,40 +3124,6 @@ export declare class Batch extends BaseBatch<Batch> {
|
|
|
3088
3124
|
* Command Response - A simple `"OK"` response.
|
|
3089
3125
|
*/
|
|
3090
3126
|
select(index: number): Batch;
|
|
3091
|
-
/**
|
|
3092
|
-
* Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
|
|
3093
|
-
* the value will be copied to the database specified, otherwise the current database will be used.
|
|
3094
|
-
* When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
|
|
3095
|
-
* no action.
|
|
3096
|
-
*
|
|
3097
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
3098
|
-
* @remarks Since Valkey version 6.2.0.
|
|
3099
|
-
*
|
|
3100
|
-
* @param source - The key to the source value.
|
|
3101
|
-
* @param destination - The key where the value should be copied to.
|
|
3102
|
-
* @param destinationDB - (Optional) The alternative logical database index for the destination key.
|
|
3103
|
-
* If not provided, the current database will be used.
|
|
3104
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
3105
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
3106
|
-
*
|
|
3107
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3108
|
-
*/
|
|
3109
|
-
copy(source: GlideString, destination: GlideString, options?: {
|
|
3110
|
-
destinationDB?: number;
|
|
3111
|
-
replace?: boolean;
|
|
3112
|
-
}): Batch;
|
|
3113
|
-
/**
|
|
3114
|
-
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
3115
|
-
*
|
|
3116
|
-
* @see {@link https://valkey.io/commands/move/|valkey.io} for details.
|
|
3117
|
-
*
|
|
3118
|
-
* @param key - The key to move.
|
|
3119
|
-
* @param dbIndex - The index of the database to move `key` to.
|
|
3120
|
-
*
|
|
3121
|
-
* Command Response - `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
3122
|
-
* database or does not exist in the source database.
|
|
3123
|
-
*/
|
|
3124
|
-
move(key: GlideString, dbIndex: number): Batch;
|
|
3125
3127
|
/** Publish a message on pubsub channel.
|
|
3126
3128
|
*
|
|
3127
3129
|
* @see {@link https://valkey.io/commands/publish/|valkey.io} for more details.
|
|
@@ -3173,23 +3175,6 @@ export declare class Batch extends BaseBatch<Batch> {
|
|
|
3173
3175
|
* ```
|
|
3174
3176
|
*/
|
|
3175
3177
|
export declare class ClusterBatch extends BaseBatch<ClusterBatch> {
|
|
3176
|
-
/**
|
|
3177
|
-
* Copies the value stored at the `source` to the `destination` key. When `replace` is true,
|
|
3178
|
-
* removes the `destination` key first if it already exists, otherwise performs no action.
|
|
3179
|
-
*
|
|
3180
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
3181
|
-
* @remarks Since Valkey version 6.2.0.
|
|
3182
|
-
*
|
|
3183
|
-
* @param source - The key to the source value.
|
|
3184
|
-
* @param destination - The key where the value should be copied to.
|
|
3185
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
3186
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
3187
|
-
*
|
|
3188
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3189
|
-
*/
|
|
3190
|
-
copy(source: GlideString, destination: GlideString, options?: {
|
|
3191
|
-
replace?: boolean;
|
|
3192
|
-
}): ClusterBatch;
|
|
3193
3178
|
/** Publish a message on pubsub channel.
|
|
3194
3179
|
* This command aggregates PUBLISH and SPUBLISH commands functionalities.
|
|
3195
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
|
*
|
|
@@ -255,6 +276,22 @@ class BaseBatch {
|
|
|
255
276
|
msetnx(keysAndValues) {
|
|
256
277
|
return this.addAndReturn((0, _1.createMSetNX)((0, _1.convertGlideRecord)(keysAndValues)));
|
|
257
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
281
|
+
*
|
|
282
|
+
* @remarks Move is available for cluster mode since Valkey 9.0.0 and above.
|
|
283
|
+
*
|
|
284
|
+
* @see {@link https://valkey.io/commands/move/|valkey.io} for details.
|
|
285
|
+
*
|
|
286
|
+
* @param key - The key to move.
|
|
287
|
+
* @param dbIndex - The index of the database to move `key` to.
|
|
288
|
+
*
|
|
289
|
+
* Command Response - `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
290
|
+
* database or does not exist in the source database.
|
|
291
|
+
*/
|
|
292
|
+
move(key, dbIndex) {
|
|
293
|
+
return this.addAndReturn((0, _1.createMove)(key, dbIndex));
|
|
294
|
+
}
|
|
258
295
|
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
259
296
|
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
260
297
|
*
|
|
@@ -3520,41 +3557,6 @@ class Batch extends BaseBatch {
|
|
|
3520
3557
|
select(index) {
|
|
3521
3558
|
return this.addAndReturn((0, _1.createSelect)(index));
|
|
3522
3559
|
}
|
|
3523
|
-
/**
|
|
3524
|
-
* Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
|
|
3525
|
-
* the value will be copied to the database specified, otherwise the current database will be used.
|
|
3526
|
-
* When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
|
|
3527
|
-
* no action.
|
|
3528
|
-
*
|
|
3529
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
3530
|
-
* @remarks Since Valkey version 6.2.0.
|
|
3531
|
-
*
|
|
3532
|
-
* @param source - The key to the source value.
|
|
3533
|
-
* @param destination - The key where the value should be copied to.
|
|
3534
|
-
* @param destinationDB - (Optional) The alternative logical database index for the destination key.
|
|
3535
|
-
* If not provided, the current database will be used.
|
|
3536
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
3537
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
3538
|
-
*
|
|
3539
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3540
|
-
*/
|
|
3541
|
-
copy(source, destination, options) {
|
|
3542
|
-
return this.addAndReturn((0, _1.createCopy)(source, destination, options));
|
|
3543
|
-
}
|
|
3544
|
-
/**
|
|
3545
|
-
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
3546
|
-
*
|
|
3547
|
-
* @see {@link https://valkey.io/commands/move/|valkey.io} for details.
|
|
3548
|
-
*
|
|
3549
|
-
* @param key - The key to move.
|
|
3550
|
-
* @param dbIndex - The index of the database to move `key` to.
|
|
3551
|
-
*
|
|
3552
|
-
* Command Response - `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
3553
|
-
* database or does not exist in the source database.
|
|
3554
|
-
*/
|
|
3555
|
-
move(key, dbIndex) {
|
|
3556
|
-
return this.addAndReturn((0, _1.createMove)(key, dbIndex));
|
|
3557
|
-
}
|
|
3558
3560
|
/** Publish a message on pubsub channel.
|
|
3559
3561
|
*
|
|
3560
3562
|
* @see {@link https://valkey.io/commands/publish/|valkey.io} for more details.
|
|
@@ -3610,23 +3612,6 @@ exports.Batch = Batch;
|
|
|
3610
3612
|
*/
|
|
3611
3613
|
class ClusterBatch extends BaseBatch {
|
|
3612
3614
|
/// TODO: add all CLUSTER commands
|
|
3613
|
-
/**
|
|
3614
|
-
* Copies the value stored at the `source` to the `destination` key. When `replace` is true,
|
|
3615
|
-
* removes the `destination` key first if it already exists, otherwise performs no action.
|
|
3616
|
-
*
|
|
3617
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
3618
|
-
* @remarks Since Valkey version 6.2.0.
|
|
3619
|
-
*
|
|
3620
|
-
* @param source - The key to the source value.
|
|
3621
|
-
* @param destination - The key where the value should be copied to.
|
|
3622
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
3623
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
3624
|
-
*
|
|
3625
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3626
|
-
*/
|
|
3627
|
-
copy(source, destination, options) {
|
|
3628
|
-
return this.addAndReturn((0, _1.createCopy)(source, destination, options));
|
|
3629
|
-
}
|
|
3630
3615
|
/** Publish a message on pubsub channel.
|
|
3631
3616
|
* This command aggregates PUBLISH and SPUBLISH commands functionalities.
|
|
3632
3617
|
* The mode is selected using the 'sharded' parameter.
|
|
@@ -418,59 +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
|
-
/**
|
|
458
|
-
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
459
|
-
*
|
|
460
|
-
* @see {@link https://valkey.io/commands/move/|valkey.io} for more details.
|
|
461
|
-
*
|
|
462
|
-
* @param key - The key to move.
|
|
463
|
-
* @param dbIndex - The index of the database to move `key` to.
|
|
464
|
-
* @returns `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
465
|
-
* database or does not exist in the source database.
|
|
466
|
-
*
|
|
467
|
-
* @example
|
|
468
|
-
* ```typescript
|
|
469
|
-
* const result = await client.move("key", 1);
|
|
470
|
-
* console.log(result); // Output: true
|
|
471
|
-
* ```
|
|
472
|
-
*/
|
|
473
|
-
move(key: GlideString, dbIndex: number): Promise<boolean>;
|
|
474
421
|
/**
|
|
475
422
|
* Displays a piece of generative computer art and the server version.
|
|
476
423
|
*
|
package/build-ts/GlideClient.js
CHANGED
|
@@ -412,60 +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
|
-
/**
|
|
451
|
-
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
452
|
-
*
|
|
453
|
-
* @see {@link https://valkey.io/commands/move/|valkey.io} for more details.
|
|
454
|
-
*
|
|
455
|
-
* @param key - The key to move.
|
|
456
|
-
* @param dbIndex - The index of the database to move `key` to.
|
|
457
|
-
* @returns `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
458
|
-
* database or does not exist in the source database.
|
|
459
|
-
*
|
|
460
|
-
* @example
|
|
461
|
-
* ```typescript
|
|
462
|
-
* const result = await client.move("key", 1);
|
|
463
|
-
* console.log(result); // Output: true
|
|
464
|
-
* ```
|
|
465
|
-
*/
|
|
466
|
-
async move(key, dbIndex) {
|
|
467
|
-
return this.createWritePromise((0, _1.createMove)(key, dbIndex));
|
|
468
|
-
}
|
|
469
415
|
/**
|
|
470
416
|
* Displays a piece of generative computer art and the server version.
|
|
471
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.
|
|
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.
|
|
138
|
-
"@valkey/valkey-glide-darwin-arm64": "2.1.
|
|
139
|
-
"@valkey/valkey-glide-linux-x64-gnu": "2.1.
|
|
140
|
-
"@valkey/valkey-glide-linux-arm64-gnu": "2.1.
|
|
141
|
-
"@valkey/valkey-glide-linux-x64-musl": "2.1.
|
|
142
|
-
"@valkey/valkey-glide-linux-arm64-musl": "2.1.
|
|
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
|
}
|