@upstash/redis 1.0.0-alpha.7 → 1.0.2

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/fastly.js CHANGED
@@ -1004,683 +1004,260 @@ var ZUnionStoreCommand = class extends Command {
1004
1004
  // pkg/pipeline.ts
1005
1005
  var Pipeline = class {
1006
1006
  constructor(client) {
1007
+ this.exec = async () => {
1008
+ if (this.commands.length === 0) {
1009
+ throw new Error("Pipeline is empty");
1010
+ }
1011
+ const res = await this.client.request({
1012
+ path: ["pipeline"],
1013
+ body: Object.values(this.commands).map((c) => c.command)
1014
+ });
1015
+ return res.map(({ error, result }, i) => {
1016
+ if (error) {
1017
+ throw new UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
1018
+ }
1019
+ return this.commands[i].deserialize(result);
1020
+ });
1021
+ };
1022
+ this.append = (...args) => this.chain(new AppendCommand(...args));
1023
+ this.bitcount = (...args) => this.chain(new BitCountCommand(...args));
1024
+ this.bitop = (op, destinationKey, sourceKey, ...sourceKeys) => this.chain(new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys));
1025
+ this.bitpos = (...args) => this.chain(new BitPosCommand(...args));
1026
+ this.dbsize = () => this.chain(new DBSizeCommand());
1027
+ this.decr = (...args) => this.chain(new DecrCommand(...args));
1028
+ this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1029
+ this.del = (...args) => this.chain(new DelCommand(...args));
1030
+ this.echo = (...args) => this.chain(new EchoCommand(...args));
1031
+ this.exists = (...args) => this.chain(new ExistsCommand(...args));
1032
+ this.expire = (...args) => this.chain(new ExpireCommand(...args));
1033
+ this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
1034
+ this.flushall = (...args) => this.chain(new FlushAllCommand(...args));
1035
+ this.flushdb = (...args) => this.chain(new FlushDBCommand(...args));
1036
+ this.get = (...args) => this.chain(new GetCommand(...args));
1037
+ this.getbit = (...args) => this.chain(new GetBitCommand(...args));
1038
+ this.getrange = (...args) => this.chain(new GetRangeCommand(...args));
1039
+ this.getset = (key, value) => this.chain(new GetSetCommand(key, value));
1040
+ this.hdel = (...args) => this.chain(new HDelCommand(...args));
1041
+ this.hexists = (...args) => this.chain(new HExistsCommand(...args));
1042
+ this.hget = (...args) => this.chain(new HGetCommand(...args));
1043
+ this.hgetall = (...args) => this.chain(new HGetAllCommand(...args));
1044
+ this.hincrby = (...args) => this.chain(new HIncrByCommand(...args));
1045
+ this.hincrbyfloat = (...args) => this.chain(new HIncrByFloatCommand(...args));
1046
+ this.hkeys = (...args) => this.chain(new HKeysCommand(...args));
1047
+ this.hlen = (...args) => this.chain(new HLenCommand(...args));
1048
+ this.hmget = (...args) => this.chain(new HMGetCommand(...args));
1049
+ this.hmset = (key, kv) => this.chain(new HMSetCommand(key, kv));
1050
+ this.hscan = (...args) => this.chain(new HScanCommand(...args));
1051
+ this.hset = (key, kv) => this.chain(new HSetCommand(key, kv));
1052
+ this.hsetnx = (key, field, value) => this.chain(new HSetNXCommand(key, field, value));
1053
+ this.hstrlen = (...args) => this.chain(new HStrLenCommand(...args));
1054
+ this.hvals = (...args) => this.chain(new HValsCommand(...args));
1055
+ this.incr = (...args) => this.chain(new IncrCommand(...args));
1056
+ this.incrby = (...args) => this.chain(new IncrByCommand(...args));
1057
+ this.incrbyfloat = (...args) => this.chain(new IncrByFloatCommand(...args));
1058
+ this.keys = (...args) => this.chain(new KeysCommand(...args));
1059
+ this.lindex = (...args) => this.chain(new LIndexCommand(...args));
1060
+ this.linsert = (key, direction, pivot, value) => this.chain(new LInsertCommand(key, direction, pivot, value));
1061
+ this.llen = (...args) => this.chain(new LLenCommand(...args));
1062
+ this.lpop = (...args) => this.chain(new LPopCommand(...args));
1063
+ this.lpush = (key, ...elements) => this.chain(new LPushCommand(key, ...elements));
1064
+ this.lpushx = (key, ...elements) => this.chain(new LPushXCommand(key, ...elements));
1065
+ this.lrange = (...args) => this.chain(new LRangeCommand(...args));
1066
+ this.lrem = (key, count, value) => this.chain(new LRemCommand(key, count, value));
1067
+ this.lset = (key, value, index) => this.chain(new LSetCommand(key, value, index));
1068
+ this.ltrim = (...args) => this.chain(new LTrimCommand(...args));
1069
+ this.mget = (...args) => this.chain(new MGetCommand(...args));
1070
+ this.mset = (kv) => this.chain(new MSetCommand(kv));
1071
+ this.msetnx = (kv) => this.chain(new MSetNXCommand(kv));
1072
+ this.persist = (...args) => this.chain(new PersistCommand(...args));
1073
+ this.pexpire = (...args) => this.chain(new PExpireCommand(...args));
1074
+ this.pexpireat = (...args) => this.chain(new PExpireAtCommand(...args));
1075
+ this.ping = (...args) => this.chain(new PingCommand(...args));
1076
+ this.psetex = (key, ttl, value) => this.chain(new PSetEXCommand(key, ttl, value));
1077
+ this.pttl = (...args) => this.chain(new PTtlCommand(...args));
1078
+ this.randomkey = () => this.chain(new RandomKeyCommand());
1079
+ this.rename = (...args) => this.chain(new RenameCommand(...args));
1080
+ this.renamenx = (...args) => this.chain(new RenameNXCommand(...args));
1081
+ this.rpop = (...args) => this.chain(new RPopCommand(...args));
1082
+ this.rpush = (key, ...elements) => this.chain(new RPushCommand(key, ...elements));
1083
+ this.rpushx = (key, ...elements) => this.chain(new RPushXCommand(key, ...elements));
1084
+ this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
1085
+ this.scan = (...args) => this.chain(new ScanCommand(...args));
1086
+ this.scard = (...args) => this.chain(new SCardCommand(...args));
1087
+ this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
1088
+ this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
1089
+ this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
1090
+ this.setbit = (...args) => this.chain(new SetBitCommand(...args));
1091
+ this.setex = (key, ttl, value) => this.chain(new SetExCommand(key, ttl, value));
1092
+ this.setnx = (key, value) => this.chain(new SetNxCommand(key, value));
1093
+ this.setrange = (...args) => this.chain(new SetRangeCommand(...args));
1094
+ this.sinter = (...args) => this.chain(new SInterCommand(...args));
1095
+ this.sinterstore = (...args) => this.chain(new SInterStoreCommand(...args));
1096
+ this.sismember = (key, member) => this.chain(new SIsMemberCommand(key, member));
1097
+ this.smembers = (...args) => this.chain(new SMembersCommand(...args));
1098
+ this.smove = (source, destination, member) => this.chain(new SMoveCommand(source, destination, member));
1099
+ this.spop = (...args) => this.chain(new SPopCommand(...args));
1100
+ this.srandmember = (...args) => this.chain(new SRandMemberCommand(...args));
1101
+ this.srem = (key, ...members) => this.chain(new SRemCommand(key, ...members));
1102
+ this.sscan = (...args) => this.chain(new SScanCommand(...args));
1103
+ this.strlen = (...args) => this.chain(new StrLenCommand(...args));
1104
+ this.sunion = (...args) => this.chain(new SUnionCommand(...args));
1105
+ this.sunionstore = (...args) => this.chain(new SUnionStoreCommand(...args));
1106
+ this.time = () => this.chain(new TimeCommand());
1107
+ this.touch = (...args) => this.chain(new TouchCommand(...args));
1108
+ this.ttl = (...args) => this.chain(new TtlCommand(...args));
1109
+ this.type = (...args) => this.chain(new TypeCommand(...args));
1110
+ this.unlink = (...args) => this.chain(new UnlinkCommand(...args));
1111
+ this.zadd = (...args) => {
1112
+ if ("score" in args[1]) {
1113
+ return this.chain(new ZAddCommand(args[0], args[1], ...args.slice(2)));
1114
+ }
1115
+ return this.chain(new ZAddCommand(args[0], args[1], ...args.slice(2)));
1116
+ };
1117
+ this.zcard = (...args) => this.chain(new ZCardCommand(...args));
1118
+ this.zcount = (...args) => this.chain(new ZCountCommand(...args));
1119
+ this.zincrby = (key, increment, member) => this.chain(new ZIncrByComand(key, increment, member));
1120
+ this.zinterstore = (...args) => this.chain(new ZInterStoreCommand(...args));
1121
+ this.zlexcount = (...args) => this.chain(new ZLexCountCommand(...args));
1122
+ this.zpopmax = (...args) => this.chain(new ZPopMaxCommand(...args));
1123
+ this.zpopmin = (...args) => this.chain(new ZPopMinCommand(...args));
1124
+ this.zrange = (...args) => this.chain(new ZRangeCommand(...args));
1125
+ this.zrank = (key, member) => this.chain(new ZRankCommand(key, member));
1126
+ this.zrem = (key, ...members) => this.chain(new ZRemCommand(key, ...members));
1127
+ this.zremrangebylex = (...args) => this.chain(new ZRemRangeByLexCommand(...args));
1128
+ this.zremrangebyrank = (...args) => this.chain(new ZRemRangeByRankCommand(...args));
1129
+ this.zremrangebyscore = (...args) => this.chain(new ZRemRangeByScoreCommand(...args));
1130
+ this.zrevrank = (key, member) => this.chain(new ZRevRankCommand(key, member));
1131
+ this.zscan = (...args) => this.chain(new ZScanCommand(...args));
1132
+ this.zscore = (key, member) => this.chain(new ZScoreCommand(key, member));
1133
+ this.zunionstore = (...args) => this.chain(new ZUnionStoreCommand(...args));
1007
1134
  this.client = client;
1008
1135
  this.commands = [];
1009
1136
  }
1010
- async exec() {
1011
- if (this.commands.length === 0) {
1012
- throw new Error("Pipeline is empty");
1013
- }
1014
- const res = await this.client.request({
1015
- path: ["pipeline"],
1016
- body: Object.values(this.commands).map((c) => c.command)
1017
- });
1018
- return res.map(({ error, result }, i) => {
1019
- if (error) {
1020
- throw new UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
1021
- }
1022
- return this.commands[i].deserialize(result);
1023
- });
1024
- }
1025
1137
  chain(command) {
1026
1138
  this.commands.push(command);
1027
1139
  return this;
1028
1140
  }
1029
- append(...args) {
1030
- return this.chain(new AppendCommand(...args));
1031
- }
1032
- bitcount(...args) {
1033
- return this.chain(new BitCountCommand(...args));
1034
- }
1035
- bitop(op, destinationKey, sourceKey, ...sourceKeys) {
1036
- return this.chain(new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys));
1037
- }
1038
- bitpos(...args) {
1039
- return this.chain(new BitPosCommand(...args));
1040
- }
1041
- dbsize() {
1042
- return this.chain(new DBSizeCommand());
1043
- }
1044
- decr(...args) {
1045
- return this.chain(new DecrCommand(...args));
1046
- }
1047
- decrby(...args) {
1048
- return this.chain(new DecrByCommand(...args));
1049
- }
1050
- del(...args) {
1051
- return this.chain(new DelCommand(...args));
1052
- }
1053
- echo(...args) {
1054
- return this.chain(new EchoCommand(...args));
1055
- }
1056
- exists(...args) {
1057
- return this.chain(new ExistsCommand(...args));
1058
- }
1059
- expire(...args) {
1060
- return this.chain(new ExpireCommand(...args));
1061
- }
1062
- expireat(...args) {
1063
- return this.chain(new ExpireAtCommand(...args));
1064
- }
1065
- flushall(...args) {
1066
- return this.chain(new FlushAllCommand(...args));
1067
- }
1068
- flushdb(...args) {
1069
- return this.chain(new FlushDBCommand(...args));
1070
- }
1071
- get(...args) {
1072
- return this.chain(new GetCommand(...args));
1073
- }
1074
- getbit(...args) {
1075
- return this.chain(new GetBitCommand(...args));
1076
- }
1077
- getrange(...args) {
1078
- return this.chain(new GetRangeCommand(...args));
1079
- }
1080
- getset(key, value) {
1081
- return this.chain(new GetSetCommand(key, value));
1082
- }
1083
- hdel(...args) {
1084
- return this.chain(new HDelCommand(...args));
1085
- }
1086
- hexists(...args) {
1087
- return this.chain(new HExistsCommand(...args));
1088
- }
1089
- hget(...args) {
1090
- return this.chain(new HGetCommand(...args));
1091
- }
1092
- hgetall(...args) {
1093
- return this.chain(new HGetAllCommand(...args));
1094
- }
1095
- hincrby(...args) {
1096
- return this.chain(new HIncrByCommand(...args));
1097
- }
1098
- hincrbyfloat(...args) {
1099
- return this.chain(new HIncrByFloatCommand(...args));
1100
- }
1101
- hkeys(...args) {
1102
- return this.chain(new HKeysCommand(...args));
1103
- }
1104
- hlen(...args) {
1105
- return this.chain(new HLenCommand(...args));
1106
- }
1107
- hmget(...args) {
1108
- return this.chain(new HMGetCommand(...args));
1109
- }
1110
- hmset(key, kv) {
1111
- return this.chain(new HMSetCommand(key, kv));
1112
- }
1113
- hscan(...args) {
1114
- return this.chain(new HScanCommand(...args));
1115
- }
1116
- hset(key, kv) {
1117
- return this.chain(new HSetCommand(key, kv));
1118
- }
1119
- hsetnx(key, field, value) {
1120
- return this.chain(new HSetNXCommand(key, field, value));
1121
- }
1122
- hstrlen(...args) {
1123
- return this.chain(new HStrLenCommand(...args));
1124
- }
1125
- hvals(...args) {
1126
- return this.chain(new HValsCommand(...args));
1127
- }
1128
- incr(...args) {
1129
- return this.chain(new IncrCommand(...args));
1130
- }
1131
- incrby(...args) {
1132
- return this.chain(new IncrByCommand(...args));
1133
- }
1134
- incrbyfloat(...args) {
1135
- return this.chain(new IncrByFloatCommand(...args));
1136
- }
1137
- keys(...args) {
1138
- return this.chain(new KeysCommand(...args));
1139
- }
1140
- lindex(...args) {
1141
- return this.chain(new LIndexCommand(...args));
1142
- }
1143
- linsert(key, direction, pivot, value) {
1144
- return this.chain(new LInsertCommand(key, direction, pivot, value));
1145
- }
1146
- llen(...args) {
1147
- return this.chain(new LLenCommand(...args));
1148
- }
1149
- lpop(...args) {
1150
- return this.chain(new LPopCommand(...args));
1151
- }
1152
- lpush(key, ...elements) {
1153
- return this.chain(new LPushCommand(key, ...elements));
1154
- }
1155
- lpushx(key, ...elements) {
1156
- return this.chain(new LPushXCommand(key, ...elements));
1157
- }
1158
- lrange(...args) {
1159
- return this.chain(new LRangeCommand(...args));
1160
- }
1161
- lrem(key, count, value) {
1162
- return this.chain(new LRemCommand(key, count, value));
1163
- }
1164
- lset(key, value, index) {
1165
- return this.chain(new LSetCommand(key, value, index));
1166
- }
1167
- ltrim(...args) {
1168
- return this.chain(new LTrimCommand(...args));
1169
- }
1170
- mget(...args) {
1171
- return this.chain(new MGetCommand(...args));
1172
- }
1173
- mset(kv) {
1174
- return this.chain(new MSetCommand(kv));
1175
- }
1176
- msetnx(kv) {
1177
- return this.chain(new MSetNXCommand(kv));
1178
- }
1179
- persist(...args) {
1180
- return this.chain(new PersistCommand(...args));
1181
- }
1182
- pexpire(...args) {
1183
- return this.chain(new PExpireCommand(...args));
1184
- }
1185
- pexpireat(...args) {
1186
- return this.chain(new PExpireAtCommand(...args));
1187
- }
1188
- ping(...args) {
1189
- return this.chain(new PingCommand(...args));
1190
- }
1191
- psetex(key, ttl, value) {
1192
- return this.chain(new PSetEXCommand(key, ttl, value));
1193
- }
1194
- pttl(...args) {
1195
- return this.chain(new PTtlCommand(...args));
1196
- }
1197
- randomkey() {
1198
- return this.chain(new RandomKeyCommand());
1199
- }
1200
- rename(...args) {
1201
- return this.chain(new RenameCommand(...args));
1202
- }
1203
- renamenx(...args) {
1204
- return this.chain(new RenameNXCommand(...args));
1205
- }
1206
- rpop(...args) {
1207
- return this.chain(new RPopCommand(...args));
1208
- }
1209
- rpush(key, ...elements) {
1210
- return this.chain(new RPushCommand(key, ...elements));
1211
- }
1212
- rpushx(key, ...elements) {
1213
- return this.chain(new RPushXCommand(key, ...elements));
1214
- }
1215
- sadd(key, ...members) {
1216
- return this.chain(new SAddCommand(key, ...members));
1217
- }
1218
- scan(...args) {
1219
- return this.chain(new ScanCommand(...args));
1220
- }
1221
- scard(...args) {
1222
- return this.chain(new SCardCommand(...args));
1223
- }
1224
- sdiff(...args) {
1225
- return this.chain(new SDiffCommand(...args));
1226
- }
1227
- sdiffstore(...args) {
1228
- return this.chain(new SDiffStoreCommand(...args));
1229
- }
1230
- set(key, value, opts) {
1231
- return this.chain(new SetCommand(key, value, opts));
1232
- }
1233
- setbit(...args) {
1234
- return this.chain(new SetBitCommand(...args));
1235
- }
1236
- setex(key, ttl, value) {
1237
- return this.chain(new SetExCommand(key, ttl, value));
1238
- }
1239
- setnx(key, value) {
1240
- return this.chain(new SetNxCommand(key, value));
1241
- }
1242
- setrange(...args) {
1243
- return this.chain(new SetRangeCommand(...args));
1244
- }
1245
- sinter(...args) {
1246
- return this.chain(new SInterCommand(...args));
1247
- }
1248
- sinterstore(...args) {
1249
- return this.chain(new SInterStoreCommand(...args));
1250
- }
1251
- sismember(key, member) {
1252
- return this.chain(new SIsMemberCommand(key, member));
1253
- }
1254
- smembers(...args) {
1255
- return this.chain(new SMembersCommand(...args));
1256
- }
1257
- smove(source, destination, member) {
1258
- return this.chain(new SMoveCommand(source, destination, member));
1259
- }
1260
- spop(...args) {
1261
- return this.chain(new SPopCommand(...args));
1262
- }
1263
- srandmember(...args) {
1264
- return this.chain(new SRandMemberCommand(...args));
1265
- }
1266
- srem(key, ...members) {
1267
- return this.chain(new SRemCommand(key, ...members));
1268
- }
1269
- sscan(...args) {
1270
- return this.chain(new SScanCommand(...args));
1271
- }
1272
- strlen(...args) {
1273
- return this.chain(new StrLenCommand(...args));
1274
- }
1275
- sunion(...args) {
1276
- return this.chain(new SUnionCommand(...args));
1277
- }
1278
- sunionstore(...args) {
1279
- return this.chain(new SUnionStoreCommand(...args));
1280
- }
1281
- time() {
1282
- return this.chain(new TimeCommand());
1283
- }
1284
- touch(...args) {
1285
- return this.chain(new TouchCommand(...args));
1286
- }
1287
- ttl(...args) {
1288
- return this.chain(new TtlCommand(...args));
1289
- }
1290
- type(...args) {
1291
- return this.chain(new TypeCommand(...args));
1292
- }
1293
- unlink(...args) {
1294
- return this.chain(new UnlinkCommand(...args));
1295
- }
1296
- zadd(key, arg1, ...arg2) {
1297
- return this.chain(new ZAddCommand(key, arg1, ...arg2));
1298
- }
1299
- zcard(...args) {
1300
- return this.chain(new ZCardCommand(...args));
1301
- }
1302
- zcount(...args) {
1303
- return this.chain(new ZCountCommand(...args));
1304
- }
1305
- zincrby(key, increment, member) {
1306
- return this.chain(new ZIncrByComand(key, increment, member));
1307
- }
1308
- zinterstore(...args) {
1309
- return this.chain(new ZInterStoreCommand(...args));
1310
- }
1311
- zlexcount(...args) {
1312
- return this.chain(new ZLexCountCommand(...args));
1313
- }
1314
- zpopmax(...args) {
1315
- return this.chain(new ZPopMaxCommand(...args));
1316
- }
1317
- zpopmin(...args) {
1318
- return this.chain(new ZPopMinCommand(...args));
1319
- }
1320
- zrange(...args) {
1321
- return this.chain(new ZRangeCommand(...args));
1322
- }
1323
- zrank(key, member) {
1324
- return this.chain(new ZRankCommand(key, member));
1325
- }
1326
- zrem(key, ...members) {
1327
- return this.chain(new ZRemCommand(key, ...members));
1328
- }
1329
- zremrangebylex(...args) {
1330
- return this.chain(new ZRemRangeByLexCommand(...args));
1331
- }
1332
- zremrangebyrank(...args) {
1333
- return this.chain(new ZRemRangeByRankCommand(...args));
1334
- }
1335
- zremrangebyscore(...args) {
1336
- return this.chain(new ZRemRangeByScoreCommand(...args));
1337
- }
1338
- zrevrank(key, member) {
1339
- return this.chain(new ZRevRankCommand(key, member));
1340
- }
1341
- zscan(...args) {
1342
- return this.chain(new ZScanCommand(...args));
1343
- }
1344
- zscore(key, member) {
1345
- return this.chain(new ZScoreCommand(key, member));
1346
- }
1347
- zunionstore(...args) {
1348
- return this.chain(new ZUnionStoreCommand(...args));
1349
- }
1350
1141
  };
1351
1142
 
1352
1143
  // pkg/redis.ts
1353
1144
  var Redis = class {
1354
1145
  constructor(client) {
1146
+ this.pipeline = () => new Pipeline(this.client);
1147
+ this.append = (...args) => new AppendCommand(...args).exec(this.client);
1148
+ this.bitcount = (...args) => new BitCountCommand(...args).exec(this.client);
1149
+ this.bitop = (op, destinationKey, sourceKey, ...sourceKeys) => new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys).exec(this.client);
1150
+ this.bitpos = (...args) => new BitPosCommand(...args).exec(this.client);
1151
+ this.dbsize = () => new DBSizeCommand().exec(this.client);
1152
+ this.decr = (...args) => new DecrCommand(...args).exec(this.client);
1153
+ this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1154
+ this.del = (...args) => new DelCommand(...args).exec(this.client);
1155
+ this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1156
+ this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1157
+ this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1158
+ this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
1159
+ this.flushall = (...args) => new FlushAllCommand(...args).exec(this.client);
1160
+ this.flushdb = (...args) => new FlushDBCommand(...args).exec(this.client);
1161
+ this.get = (...args) => new GetCommand(...args).exec(this.client);
1162
+ this.getbit = (...args) => new GetBitCommand(...args).exec(this.client);
1163
+ this.getrange = (...args) => new GetRangeCommand(...args).exec(this.client);
1164
+ this.getset = (key, value) => new GetSetCommand(key, value).exec(this.client);
1165
+ this.hdel = (...args) => new HDelCommand(...args).exec(this.client);
1166
+ this.hexists = (...args) => new HExistsCommand(...args).exec(this.client);
1167
+ this.hget = (...args) => new HGetCommand(...args).exec(this.client);
1168
+ this.hgetall = (...args) => new HGetAllCommand(...args).exec(this.client);
1169
+ this.hincrby = (...args) => new HIncrByCommand(...args).exec(this.client);
1170
+ this.hincrbyfloat = (...args) => new HIncrByFloatCommand(...args).exec(this.client);
1171
+ this.hkeys = (...args) => new HKeysCommand(...args).exec(this.client);
1172
+ this.hlen = (...args) => new HLenCommand(...args).exec(this.client);
1173
+ this.hmget = (...args) => new HMGetCommand(...args).exec(this.client);
1174
+ this.hmset = (key, kv) => new HMSetCommand(key, kv).exec(this.client);
1175
+ this.hscan = (...args) => new HScanCommand(...args).exec(this.client);
1176
+ this.hset = (key, kv) => new HSetCommand(key, kv).exec(this.client);
1177
+ this.hsetnx = (key, field, value) => new HSetNXCommand(key, field, value).exec(this.client);
1178
+ this.hstrlen = (...args) => new HStrLenCommand(...args).exec(this.client);
1179
+ this.hvals = (...args) => new HValsCommand(...args).exec(this.client);
1180
+ this.incr = (...args) => new IncrCommand(...args).exec(this.client);
1181
+ this.incrby = (...args) => new IncrByCommand(...args).exec(this.client);
1182
+ this.incrbyfloat = (...args) => new IncrByFloatCommand(...args).exec(this.client);
1183
+ this.keys = (...args) => new KeysCommand(...args).exec(this.client);
1184
+ this.lindex = (...args) => new LIndexCommand(...args).exec(this.client);
1185
+ this.linsert = (key, direction, pivot, value) => new LInsertCommand(key, direction, pivot, value).exec(this.client);
1186
+ this.llen = (...args) => new LLenCommand(...args).exec(this.client);
1187
+ this.lpop = (...args) => new LPopCommand(...args).exec(this.client);
1188
+ this.lpush = (key, ...elements) => new LPushCommand(key, ...elements).exec(this.client);
1189
+ this.lpushx = (key, ...elements) => new LPushXCommand(key, ...elements).exec(this.client);
1190
+ this.lrange = (...args) => new LRangeCommand(...args).exec(this.client);
1191
+ this.lrem = (key, count, value) => new LRemCommand(key, count, value).exec(this.client);
1192
+ this.lset = (key, value, index) => new LSetCommand(key, value, index).exec(this.client);
1193
+ this.ltrim = (...args) => new LTrimCommand(...args).exec(this.client);
1194
+ this.mget = (...args) => new MGetCommand(...args).exec(this.client);
1195
+ this.mset = (kv) => new MSetCommand(kv).exec(this.client);
1196
+ this.msetnx = (kv) => new MSetNXCommand(kv).exec(this.client);
1197
+ this.persist = (...args) => new PersistCommand(...args).exec(this.client);
1198
+ this.pexpire = (...args) => new PExpireCommand(...args).exec(this.client);
1199
+ this.pexpireat = (...args) => new PExpireAtCommand(...args).exec(this.client);
1200
+ this.ping = (...args) => new PingCommand(...args).exec(this.client);
1201
+ this.psetex = (key, ttl, value) => new PSetEXCommand(key, ttl, value).exec(this.client);
1202
+ this.pttl = (...args) => new PTtlCommand(...args).exec(this.client);
1203
+ this.randomkey = () => new RandomKeyCommand().exec(this.client);
1204
+ this.rename = (...args) => new RenameCommand(...args).exec(this.client);
1205
+ this.renamenx = (...args) => new RenameNXCommand(...args).exec(this.client);
1206
+ this.rpop = (...args) => new RPopCommand(...args).exec(this.client);
1207
+ this.rpush = (key, ...elements) => new RPushCommand(key, ...elements).exec(this.client);
1208
+ this.rpushx = (key, ...elements) => new RPushXCommand(key, ...elements).exec(this.client);
1209
+ this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
1210
+ this.scan = (...args) => new ScanCommand(...args).exec(this.client);
1211
+ this.scard = (...args) => new SCardCommand(...args).exec(this.client);
1212
+ this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
1213
+ this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
1214
+ this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
1215
+ this.setbit = (...args) => new SetBitCommand(...args).exec(this.client);
1216
+ this.setex = (key, ttl, value) => new SetExCommand(key, ttl, value).exec(this.client);
1217
+ this.setnx = (key, value) => new SetNxCommand(key, value).exec(this.client);
1218
+ this.setrange = (...args) => new SetRangeCommand(...args).exec(this.client);
1219
+ this.sinter = (...args) => new SInterCommand(...args).exec(this.client);
1220
+ this.sinterstore = (...args) => new SInterStoreCommand(...args).exec(this.client);
1221
+ this.sismember = (key, member) => new SIsMemberCommand(key, member).exec(this.client);
1222
+ this.smembers = (...args) => new SMembersCommand(...args).exec(this.client);
1223
+ this.smove = (source, destination, member) => new SMoveCommand(source, destination, member).exec(this.client);
1224
+ this.spop = (...args) => new SPopCommand(...args).exec(this.client);
1225
+ this.srandmember = (...args) => new SRandMemberCommand(...args).exec(this.client);
1226
+ this.srem = (key, ...members) => new SRemCommand(key, ...members).exec(this.client);
1227
+ this.sscan = (...args) => new SScanCommand(...args).exec(this.client);
1228
+ this.strlen = (...args) => new StrLenCommand(...args).exec(this.client);
1229
+ this.sunion = (...args) => new SUnionCommand(...args).exec(this.client);
1230
+ this.sunionstore = (...args) => new SUnionStoreCommand(...args).exec(this.client);
1231
+ this.time = () => new TimeCommand().exec(this.client);
1232
+ this.touch = (...args) => new TouchCommand(...args).exec(this.client);
1233
+ this.ttl = (...args) => new TtlCommand(...args).exec(this.client);
1234
+ this.type = (...args) => new TypeCommand(...args).exec(this.client);
1235
+ this.unlink = (...args) => new UnlinkCommand(...args).exec(this.client);
1236
+ this.zadd = (...args) => {
1237
+ if ("score" in args[1]) {
1238
+ return new ZAddCommand(args[0], args[1], ...args.slice(2)).exec(this.client);
1239
+ }
1240
+ return new ZAddCommand(args[0], args[1], ...args.slice(2)).exec(this.client);
1241
+ };
1242
+ this.zcard = (...args) => new ZCardCommand(...args).exec(this.client);
1243
+ this.zcount = (...args) => new ZCountCommand(...args).exec(this.client);
1244
+ this.zincrby = (key, increment, member) => new ZIncrByComand(key, increment, member).exec(this.client);
1245
+ this.zinterstore = (...args) => new ZInterStoreCommand(...args).exec(this.client);
1246
+ this.zlexcount = (...args) => new ZLexCountCommand(...args).exec(this.client);
1247
+ this.zpopmax = (...args) => new ZPopMaxCommand(...args).exec(this.client);
1248
+ this.zpopmin = (...args) => new ZPopMinCommand(...args).exec(this.client);
1249
+ this.zrange = (...args) => new ZRangeCommand(...args).exec(this.client);
1250
+ this.zrank = (key, member) => new ZRankCommand(key, member).exec(this.client);
1251
+ this.zrem = (key, ...members) => new ZRemCommand(key, ...members).exec(this.client);
1252
+ this.zremrangebylex = (...args) => new ZRemRangeByLexCommand(...args).exec(this.client);
1253
+ this.zremrangebyrank = (...args) => new ZRemRangeByRankCommand(...args).exec(this.client);
1254
+ this.zremrangebyscore = (...args) => new ZRemRangeByScoreCommand(...args).exec(this.client);
1255
+ this.zrevrank = (key, member) => new ZRevRankCommand(key, member).exec(this.client);
1256
+ this.zscan = (...args) => new ZScanCommand(...args).exec(this.client);
1257
+ this.zscore = (key, member) => new ZScoreCommand(key, member).exec(this.client);
1258
+ this.zunionstore = (...args) => new ZUnionStoreCommand(...args).exec(this.client);
1355
1259
  this.client = client;
1356
1260
  }
1357
- pipeline() {
1358
- return new Pipeline(this.client);
1359
- }
1360
- append(...args) {
1361
- return new AppendCommand(...args).exec(this.client);
1362
- }
1363
- bitcount(...args) {
1364
- return new BitCountCommand(...args).exec(this.client);
1365
- }
1366
- bitop(op, destinationKey, sourceKey, ...sourceKeys) {
1367
- return new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys).exec(this.client);
1368
- }
1369
- bitpos(...args) {
1370
- return new BitPosCommand(...args).exec(this.client);
1371
- }
1372
- dbsize() {
1373
- return new DBSizeCommand().exec(this.client);
1374
- }
1375
- decr(...args) {
1376
- return new DecrCommand(...args).exec(this.client);
1377
- }
1378
- decrby(...args) {
1379
- return new DecrByCommand(...args).exec(this.client);
1380
- }
1381
- del(...args) {
1382
- return new DelCommand(...args).exec(this.client);
1383
- }
1384
- echo(...args) {
1385
- return new EchoCommand(...args).exec(this.client);
1386
- }
1387
- exists(...args) {
1388
- return new ExistsCommand(...args).exec(this.client);
1389
- }
1390
- expire(...args) {
1391
- return new ExpireCommand(...args).exec(this.client);
1392
- }
1393
- expireat(...args) {
1394
- return new ExpireAtCommand(...args).exec(this.client);
1395
- }
1396
- flushall(...args) {
1397
- return new FlushAllCommand(...args).exec(this.client);
1398
- }
1399
- flushdb(...args) {
1400
- return new FlushDBCommand(...args).exec(this.client);
1401
- }
1402
- get(...args) {
1403
- return new GetCommand(...args).exec(this.client);
1404
- }
1405
- getbit(...args) {
1406
- return new GetBitCommand(...args).exec(this.client);
1407
- }
1408
- getrange(...args) {
1409
- return new GetRangeCommand(...args).exec(this.client);
1410
- }
1411
- getset(key, value) {
1412
- return new GetSetCommand(key, value).exec(this.client);
1413
- }
1414
- hdel(...args) {
1415
- return new HDelCommand(...args).exec(this.client);
1416
- }
1417
- hexists(...args) {
1418
- return new HExistsCommand(...args).exec(this.client);
1419
- }
1420
- hget(...args) {
1421
- return new HGetCommand(...args).exec(this.client);
1422
- }
1423
- hgetall(...args) {
1424
- return new HGetAllCommand(...args).exec(this.client);
1425
- }
1426
- hincrby(...args) {
1427
- return new HIncrByCommand(...args).exec(this.client);
1428
- }
1429
- hincrbyfloat(...args) {
1430
- return new HIncrByFloatCommand(...args).exec(this.client);
1431
- }
1432
- hkeys(...args) {
1433
- return new HKeysCommand(...args).exec(this.client);
1434
- }
1435
- hlen(...args) {
1436
- return new HLenCommand(...args).exec(this.client);
1437
- }
1438
- hmget(...args) {
1439
- return new HMGetCommand(...args).exec(this.client);
1440
- }
1441
- hmset(key, kv) {
1442
- return new HMSetCommand(key, kv).exec(this.client);
1443
- }
1444
- hscan(...args) {
1445
- return new HScanCommand(...args).exec(this.client);
1446
- }
1447
- hset(key, kv) {
1448
- return new HSetCommand(key, kv).exec(this.client);
1449
- }
1450
- hsetnx(key, field, value) {
1451
- return new HSetNXCommand(key, field, value).exec(this.client);
1452
- }
1453
- hstrlen(...args) {
1454
- return new HStrLenCommand(...args).exec(this.client);
1455
- }
1456
- hvals(...args) {
1457
- return new HValsCommand(...args).exec(this.client);
1458
- }
1459
- incr(...args) {
1460
- return new IncrCommand(...args).exec(this.client);
1461
- }
1462
- incrby(...args) {
1463
- return new IncrByCommand(...args).exec(this.client);
1464
- }
1465
- incrbyfloat(...args) {
1466
- return new IncrByFloatCommand(...args).exec(this.client);
1467
- }
1468
- keys(...args) {
1469
- return new KeysCommand(...args).exec(this.client);
1470
- }
1471
- lindex(...args) {
1472
- return new LIndexCommand(...args).exec(this.client);
1473
- }
1474
- linsert(key, direction, pivot, value) {
1475
- return new LInsertCommand(key, direction, pivot, value).exec(this.client);
1476
- }
1477
- llen(...args) {
1478
- return new LLenCommand(...args).exec(this.client);
1479
- }
1480
- lpop(...args) {
1481
- return new LPopCommand(...args).exec(this.client);
1482
- }
1483
- lpush(key, ...elements) {
1484
- return new LPushCommand(key, ...elements).exec(this.client);
1485
- }
1486
- lpushx(key, ...elements) {
1487
- return new LPushXCommand(key, ...elements).exec(this.client);
1488
- }
1489
- lrange(...args) {
1490
- return new LRangeCommand(...args).exec(this.client);
1491
- }
1492
- lrem(key, count, value) {
1493
- return new LRemCommand(key, count, value).exec(this.client);
1494
- }
1495
- lset(key, value, index) {
1496
- return new LSetCommand(key, value, index).exec(this.client);
1497
- }
1498
- ltrim(...args) {
1499
- return new LTrimCommand(...args).exec(this.client);
1500
- }
1501
- mget(...args) {
1502
- return new MGetCommand(...args).exec(this.client);
1503
- }
1504
- mset(kv) {
1505
- return new MSetCommand(kv).exec(this.client);
1506
- }
1507
- msetnx(kv) {
1508
- return new MSetNXCommand(kv).exec(this.client);
1509
- }
1510
- persist(...args) {
1511
- return new PersistCommand(...args).exec(this.client);
1512
- }
1513
- pexpire(...args) {
1514
- return new PExpireCommand(...args).exec(this.client);
1515
- }
1516
- pexpireat(...args) {
1517
- return new PExpireAtCommand(...args).exec(this.client);
1518
- }
1519
- ping(...args) {
1520
- return new PingCommand(...args).exec(this.client);
1521
- }
1522
- psetex(key, ttl, value) {
1523
- return new PSetEXCommand(key, ttl, value).exec(this.client);
1524
- }
1525
- pttl(...args) {
1526
- return new PTtlCommand(...args).exec(this.client);
1527
- }
1528
- randomkey() {
1529
- return new RandomKeyCommand().exec(this.client);
1530
- }
1531
- rename(...args) {
1532
- return new RenameCommand(...args).exec(this.client);
1533
- }
1534
- renamenx(...args) {
1535
- return new RenameNXCommand(...args).exec(this.client);
1536
- }
1537
- rpop(...args) {
1538
- return new RPopCommand(...args).exec(this.client);
1539
- }
1540
- rpush(key, ...elements) {
1541
- return new RPushCommand(key, ...elements).exec(this.client);
1542
- }
1543
- rpushx(key, ...elements) {
1544
- return new RPushXCommand(key, ...elements).exec(this.client);
1545
- }
1546
- sadd(key, ...members) {
1547
- return new SAddCommand(key, ...members).exec(this.client);
1548
- }
1549
- scan(...args) {
1550
- return new ScanCommand(...args).exec(this.client);
1551
- }
1552
- scard(...args) {
1553
- return new SCardCommand(...args).exec(this.client);
1554
- }
1555
- sdiff(...args) {
1556
- return new SDiffCommand(...args).exec(this.client);
1557
- }
1558
- sdiffstore(...args) {
1559
- return new SDiffStoreCommand(...args).exec(this.client);
1560
- }
1561
- set(key, value, opts) {
1562
- return new SetCommand(key, value, opts).exec(this.client);
1563
- }
1564
- setbit(...args) {
1565
- return new SetBitCommand(...args).exec(this.client);
1566
- }
1567
- setex(key, ttl, value) {
1568
- return new SetExCommand(key, ttl, value).exec(this.client);
1569
- }
1570
- setnx(key, value) {
1571
- return new SetNxCommand(key, value).exec(this.client);
1572
- }
1573
- setrange(...args) {
1574
- return new SetRangeCommand(...args).exec(this.client);
1575
- }
1576
- sinter(...args) {
1577
- return new SInterCommand(...args).exec(this.client);
1578
- }
1579
- sinterstore(...args) {
1580
- return new SInterStoreCommand(...args).exec(this.client);
1581
- }
1582
- sismember(key, member) {
1583
- return new SIsMemberCommand(key, member).exec(this.client);
1584
- }
1585
- smembers(...args) {
1586
- return new SMembersCommand(...args).exec(this.client);
1587
- }
1588
- smove(source, destination, member) {
1589
- return new SMoveCommand(source, destination, member).exec(this.client);
1590
- }
1591
- spop(...args) {
1592
- return new SPopCommand(...args).exec(this.client);
1593
- }
1594
- srandmember(...args) {
1595
- return new SRandMemberCommand(...args).exec(this.client);
1596
- }
1597
- srem(key, ...members) {
1598
- return new SRemCommand(key, ...members).exec(this.client);
1599
- }
1600
- sscan(...args) {
1601
- return new SScanCommand(...args).exec(this.client);
1602
- }
1603
- strlen(...args) {
1604
- return new StrLenCommand(...args).exec(this.client);
1605
- }
1606
- sunion(...args) {
1607
- return new SUnionCommand(...args).exec(this.client);
1608
- }
1609
- sunionstore(...args) {
1610
- return new SUnionStoreCommand(...args).exec(this.client);
1611
- }
1612
- time() {
1613
- return new TimeCommand().exec(this.client);
1614
- }
1615
- touch(...args) {
1616
- return new TouchCommand(...args).exec(this.client);
1617
- }
1618
- ttl(...args) {
1619
- return new TtlCommand(...args).exec(this.client);
1620
- }
1621
- type(...args) {
1622
- return new TypeCommand(...args).exec(this.client);
1623
- }
1624
- unlink(...args) {
1625
- return new UnlinkCommand(...args).exec(this.client);
1626
- }
1627
- zadd(key, arg1, ...arg2) {
1628
- if ("score" in arg1) {
1629
- return new ZAddCommand(key, arg1, ...arg2).exec(this.client);
1630
- }
1631
- return new ZAddCommand(key, arg1, ...arg2).exec(this.client);
1632
- }
1633
- zcard(...args) {
1634
- return new ZCardCommand(...args).exec(this.client);
1635
- }
1636
- zcount(...args) {
1637
- return new ZCountCommand(...args).exec(this.client);
1638
- }
1639
- zincrby(key, increment, member) {
1640
- return new ZIncrByComand(key, increment, member).exec(this.client);
1641
- }
1642
- zinterstore(...args) {
1643
- return new ZInterStoreCommand(...args).exec(this.client);
1644
- }
1645
- zlexcount(...args) {
1646
- return new ZLexCountCommand(...args).exec(this.client);
1647
- }
1648
- zpopmax(...args) {
1649
- return new ZPopMaxCommand(...args).exec(this.client);
1650
- }
1651
- zpopmin(...args) {
1652
- return new ZPopMinCommand(...args).exec(this.client);
1653
- }
1654
- zrange(...args) {
1655
- return new ZRangeCommand(...args).exec(this.client);
1656
- }
1657
- zrank(key, member) {
1658
- return new ZRankCommand(key, member).exec(this.client);
1659
- }
1660
- zrem(key, ...members) {
1661
- return new ZRemCommand(key, ...members).exec(this.client);
1662
- }
1663
- zremrangebylex(...args) {
1664
- return new ZRemRangeByLexCommand(...args).exec(this.client);
1665
- }
1666
- zremrangebyrank(...args) {
1667
- return new ZRemRangeByRankCommand(...args).exec(this.client);
1668
- }
1669
- zremrangebyscore(...args) {
1670
- return new ZRemRangeByScoreCommand(...args).exec(this.client);
1671
- }
1672
- zrevrank(key, member) {
1673
- return new ZRevRankCommand(key, member).exec(this.client);
1674
- }
1675
- zscan(...args) {
1676
- return new ZScanCommand(...args).exec(this.client);
1677
- }
1678
- zscore(key, member) {
1679
- return new ZScoreCommand(key, member).exec(this.client);
1680
- }
1681
- zunionstore(...args) {
1682
- return new ZUnionStoreCommand(...args).exec(this.client);
1683
- }
1684
1261
  };
1685
1262
 
1686
1263
  // pkg/http.ts