@upstash/redis 1.36.1 → 1.36.3

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/nodejs.js CHANGED
@@ -580,6 +580,13 @@ var BitPosCommand = class extends Command {
580
580
  }
581
581
  };
582
582
 
583
+ // pkg/commands/client_setinfo.ts
584
+ var ClientSetInfoCommand = class extends Command {
585
+ constructor([attribute, value], opts) {
586
+ super(["CLIENT", "SETINFO", attribute.toUpperCase(), value], opts);
587
+ }
588
+ };
589
+
583
590
  // pkg/commands/copy.ts
584
591
  var CopyCommand = class extends Command {
585
592
  constructor([key, destinationKey, opts], commandOptions) {
@@ -1177,6 +1184,63 @@ var HGetAllCommand = class extends Command {
1177
1184
  }
1178
1185
  };
1179
1186
 
1187
+ // pkg/commands/hmget.ts
1188
+ function deserialize4(fields, result) {
1189
+ if (result.every((field) => field === null)) {
1190
+ return null;
1191
+ }
1192
+ const obj = {};
1193
+ for (const [i, field] of fields.entries()) {
1194
+ try {
1195
+ obj[field] = JSON.parse(result[i]);
1196
+ } catch {
1197
+ obj[field] = result[i];
1198
+ }
1199
+ }
1200
+ return obj;
1201
+ }
1202
+ var HMGetCommand = class extends Command {
1203
+ constructor([key, ...fields], opts) {
1204
+ super(["hmget", key, ...fields], {
1205
+ deserialize: (result) => deserialize4(fields, result),
1206
+ ...opts
1207
+ });
1208
+ }
1209
+ };
1210
+
1211
+ // pkg/commands/hgetdel.ts
1212
+ var HGetDelCommand = class extends Command {
1213
+ constructor([key, ...fields], opts) {
1214
+ super(["hgetdel", key, "FIELDS", fields.length, ...fields], {
1215
+ deserialize: (result) => deserialize4(fields.map(String), result),
1216
+ ...opts
1217
+ });
1218
+ }
1219
+ };
1220
+
1221
+ // pkg/commands/hgetex.ts
1222
+ var HGetExCommand = class extends Command {
1223
+ constructor([key, opts, ...fields], cmdOpts) {
1224
+ const command = ["hgetex", key];
1225
+ if ("ex" in opts && typeof opts.ex === "number") {
1226
+ command.push("EX", opts.ex);
1227
+ } else if ("px" in opts && typeof opts.px === "number") {
1228
+ command.push("PX", opts.px);
1229
+ } else if ("exat" in opts && typeof opts.exat === "number") {
1230
+ command.push("EXAT", opts.exat);
1231
+ } else if ("pxat" in opts && typeof opts.pxat === "number") {
1232
+ command.push("PXAT", opts.pxat);
1233
+ } else if ("persist" in opts && opts.persist) {
1234
+ command.push("PERSIST");
1235
+ }
1236
+ command.push("FIELDS", fields.length, ...fields);
1237
+ super(command, {
1238
+ deserialize: (result) => deserialize4(fields.map(String), result),
1239
+ ...cmdOpts
1240
+ });
1241
+ }
1242
+ };
1243
+
1180
1244
  // pkg/commands/hincrby.ts
1181
1245
  var HIncrByCommand = class extends Command {
1182
1246
  constructor(cmd, opts) {
@@ -1205,30 +1269,6 @@ var HLenCommand = class extends Command {
1205
1269
  }
1206
1270
  };
1207
1271
 
1208
- // pkg/commands/hmget.ts
1209
- function deserialize4(fields, result) {
1210
- if (result.every((field) => field === null)) {
1211
- return null;
1212
- }
1213
- const obj = {};
1214
- for (const [i, field] of fields.entries()) {
1215
- try {
1216
- obj[field] = JSON.parse(result[i]);
1217
- } catch {
1218
- obj[field] = result[i];
1219
- }
1220
- }
1221
- return obj;
1222
- }
1223
- var HMGetCommand = class extends Command {
1224
- constructor([key, ...fields], opts) {
1225
- super(["hmget", key, ...fields], {
1226
- deserialize: (result) => deserialize4(fields, result),
1227
- ...opts
1228
- });
1229
- }
1230
- };
1231
-
1232
1272
  // pkg/commands/hmset.ts
1233
1273
  var HMSetCommand = class extends Command {
1234
1274
  constructor([key, kv], opts) {
@@ -1294,6 +1334,35 @@ var HSetCommand = class extends Command {
1294
1334
  }
1295
1335
  };
1296
1336
 
1337
+ // pkg/commands/hsetex.ts
1338
+ var HSetExCommand = class extends Command {
1339
+ constructor([key, opts, kv], cmdOpts) {
1340
+ const command = ["hsetex", key];
1341
+ if (opts.conditional) {
1342
+ command.push(opts.conditional.toUpperCase());
1343
+ }
1344
+ if (opts.expiration) {
1345
+ if ("ex" in opts.expiration && typeof opts.expiration.ex === "number") {
1346
+ command.push("EX", opts.expiration.ex);
1347
+ } else if ("px" in opts.expiration && typeof opts.expiration.px === "number") {
1348
+ command.push("PX", opts.expiration.px);
1349
+ } else if ("exat" in opts.expiration && typeof opts.expiration.exat === "number") {
1350
+ command.push("EXAT", opts.expiration.exat);
1351
+ } else if ("pxat" in opts.expiration && typeof opts.expiration.pxat === "number") {
1352
+ command.push("PXAT", opts.expiration.pxat);
1353
+ } else if ("keepttl" in opts.expiration && opts.expiration.keepttl) {
1354
+ command.push("KEEPTTL");
1355
+ }
1356
+ }
1357
+ const entries = Object.entries(kv);
1358
+ command.push("FIELDS", entries.length);
1359
+ for (const [field, value] of entries) {
1360
+ command.push(field, value);
1361
+ }
1362
+ super(command, cmdOpts);
1363
+ }
1364
+ };
1365
+
1297
1366
  // pkg/commands/hsetnx.ts
1298
1367
  var HSetNXCommand = class extends Command {
1299
1368
  constructor(cmd, opts) {
@@ -1932,6 +2001,18 @@ var SInterCommand = class extends Command {
1932
2001
  }
1933
2002
  };
1934
2003
 
2004
+ // pkg/commands/sintercard.ts
2005
+ var SInterCardCommand = class extends Command {
2006
+ constructor(cmd, cmdOpts) {
2007
+ const [keys, opts] = cmd;
2008
+ const command = ["sintercard", keys.length, ...keys];
2009
+ if (opts?.limit !== void 0) {
2010
+ command.push("LIMIT", opts.limit);
2011
+ }
2012
+ super(command, cmdOpts);
2013
+ }
2014
+ };
2015
+
1935
2016
  // pkg/commands/sinterstore.ts
1936
2017
  var SInterStoreCommand = class extends Command {
1937
2018
  constructor(cmd, opts) {
@@ -2077,6 +2158,16 @@ var XAckCommand = class extends Command {
2077
2158
  }
2078
2159
  };
2079
2160
 
2161
+ // pkg/commands/xackdel.ts
2162
+ var XAckDelCommand = class extends Command {
2163
+ constructor([key, group, opts, ...ids], cmdOpts) {
2164
+ const command = ["XACKDEL", key, group];
2165
+ command.push(opts.toUpperCase());
2166
+ command.push("IDS", ids.length, ...ids);
2167
+ super(command, cmdOpts);
2168
+ }
2169
+ };
2170
+
2080
2171
  // pkg/commands/xadd.ts
2081
2172
  var XAddCommand = class extends Command {
2082
2173
  constructor([key, id, entries, opts], commandOptions) {
@@ -2149,6 +2240,18 @@ var XDelCommand = class extends Command {
2149
2240
  }
2150
2241
  };
2151
2242
 
2243
+ // pkg/commands/xdelex.ts
2244
+ var XDelExCommand = class extends Command {
2245
+ constructor([key, opts, ...ids], cmdOpts) {
2246
+ const command = ["XDELEX", key];
2247
+ if (opts) {
2248
+ command.push(opts.toUpperCase());
2249
+ }
2250
+ command.push("IDS", ids.length, ...ids);
2251
+ super(command, cmdOpts);
2252
+ }
2253
+ };
2254
+
2152
2255
  // pkg/commands/xgroup.ts
2153
2256
  var XGroupCommand = class extends Command {
2154
2257
  constructor([key, opts], commandOptions) {
@@ -2899,6 +3002,10 @@ var Pipeline = class {
2899
3002
  * @see https://redis.io/commands/bitpos
2900
3003
  */
2901
3004
  bitpos = (...args) => this.chain(new BitPosCommand(args, this.commandOptions));
3005
+ /**
3006
+ * @see https://redis.io/commands/client-setinfo
3007
+ */
3008
+ clientSetinfo = (...args) => this.chain(new ClientSetInfoCommand(args, this.commandOptions));
2902
3009
  /**
2903
3010
  * @see https://redis.io/commands/copy
2904
3011
  */
@@ -3063,6 +3170,14 @@ var Pipeline = class {
3063
3170
  * @see https://redis.io/commands/hgetall
3064
3171
  */
3065
3172
  hgetall = (...args) => this.chain(new HGetAllCommand(args, this.commandOptions));
3173
+ /**
3174
+ * @see https://redis.io/commands/hgetdel
3175
+ */
3176
+ hgetdel = (...args) => this.chain(new HGetDelCommand(args, this.commandOptions));
3177
+ /**
3178
+ * @see https://redis.io/commands/hgetex
3179
+ */
3180
+ hgetex = (...args) => this.chain(new HGetExCommand(args, this.commandOptions));
3066
3181
  /**
3067
3182
  * @see https://redis.io/commands/hincrby
3068
3183
  */
@@ -3099,6 +3214,10 @@ var Pipeline = class {
3099
3214
  * @see https://redis.io/commands/hset
3100
3215
  */
3101
3216
  hset = (key, kv) => this.chain(new HSetCommand([key, kv], this.commandOptions));
3217
+ /**
3218
+ * @see https://redis.io/commands/hsetex
3219
+ */
3220
+ hsetex = (...args) => this.chain(new HSetExCommand(args, this.commandOptions));
3102
3221
  /**
3103
3222
  * @see https://redis.io/commands/hsetnx
3104
3223
  */
@@ -3311,6 +3430,10 @@ var Pipeline = class {
3311
3430
  * @see https://redis.io/commands/sinter
3312
3431
  */
3313
3432
  sinter = (...args) => this.chain(new SInterCommand(args, this.commandOptions));
3433
+ /**
3434
+ * @see https://redis.io/commands/sintercard
3435
+ */
3436
+ sintercard = (...args) => this.chain(new SInterCardCommand(args, this.commandOptions));
3314
3437
  /**
3315
3438
  * @see https://redis.io/commands/sinterstore
3316
3439
  */
@@ -3403,10 +3526,18 @@ var Pipeline = class {
3403
3526
  * @see https://redis.io/commands/xack
3404
3527
  */
3405
3528
  xack = (...args) => this.chain(new XAckCommand(args, this.commandOptions));
3529
+ /**
3530
+ * @see https://redis.io/commands/xackdel
3531
+ */
3532
+ xackdel = (...args) => this.chain(new XAckDelCommand(args, this.commandOptions));
3406
3533
  /**
3407
3534
  * @see https://redis.io/commands/xdel
3408
3535
  */
3409
3536
  xdel = (...args) => this.chain(new XDelCommand(args, this.commandOptions));
3537
+ /**
3538
+ * @see https://redis.io/commands/xdelex
3539
+ */
3540
+ xdelex = (...args) => this.chain(new XDelExCommand(args, this.commandOptions));
3410
3541
  /**
3411
3542
  * @see https://redis.io/commands/xgroup
3412
3543
  */
@@ -4064,6 +4195,10 @@ var Redis = class {
4064
4195
  * @see https://redis.io/commands/bitpos
4065
4196
  */
4066
4197
  bitpos = (...args) => new BitPosCommand(args, this.opts).exec(this.client);
4198
+ /**
4199
+ * @see https://redis.io/commands/client-setinfo
4200
+ */
4201
+ clientSetinfo = (...args) => new ClientSetInfoCommand(args, this.opts).exec(this.client);
4067
4202
  /**
4068
4203
  * @see https://redis.io/commands/copy
4069
4204
  */
@@ -4228,6 +4363,14 @@ var Redis = class {
4228
4363
  * @see https://redis.io/commands/hgetall
4229
4364
  */
4230
4365
  hgetall = (...args) => new HGetAllCommand(args, this.opts).exec(this.client);
4366
+ /**
4367
+ * @see https://redis.io/commands/hgetdel
4368
+ */
4369
+ hgetdel = (...args) => new HGetDelCommand(args, this.opts).exec(this.client);
4370
+ /**
4371
+ * @see https://redis.io/commands/hgetex
4372
+ */
4373
+ hgetex = (...args) => new HGetExCommand(args, this.opts).exec(this.client);
4231
4374
  /**
4232
4375
  * @see https://redis.io/commands/hincrby
4233
4376
  */
@@ -4264,6 +4407,10 @@ var Redis = class {
4264
4407
  * @see https://redis.io/commands/hset
4265
4408
  */
4266
4409
  hset = (key, kv) => new HSetCommand([key, kv], this.opts).exec(this.client);
4410
+ /**
4411
+ * @see https://redis.io/commands/hsetex
4412
+ */
4413
+ hsetex = (...args) => new HSetExCommand(args, this.opts).exec(this.client);
4267
4414
  /**
4268
4415
  * @see https://redis.io/commands/hsetnx
4269
4416
  */
@@ -4482,6 +4629,10 @@ var Redis = class {
4482
4629
  * @see https://redis.io/commands/sinter
4483
4630
  */
4484
4631
  sinter = (...args) => new SInterCommand(args, this.opts).exec(this.client);
4632
+ /**
4633
+ * @see https://redis.io/commands/sintercard
4634
+ */
4635
+ sintercard = (...args) => new SInterCardCommand(args, this.opts).exec(this.client);
4485
4636
  /**
4486
4637
  * @see https://redis.io/commands/sinterstore
4487
4638
  */
@@ -4565,10 +4716,18 @@ var Redis = class {
4565
4716
  * @see https://redis.io/commands/xack
4566
4717
  */
4567
4718
  xack = (...args) => new XAckCommand(args, this.opts).exec(this.client);
4719
+ /**
4720
+ * @see https://redis.io/commands/xackdel
4721
+ */
4722
+ xackdel = (...args) => new XAckDelCommand(args, this.opts).exec(this.client);
4568
4723
  /**
4569
4724
  * @see https://redis.io/commands/xdel
4570
4725
  */
4571
4726
  xdel = (...args) => new XDelCommand(args, this.opts).exec(this.client);
4727
+ /**
4728
+ * @see https://redis.io/commands/xdelex
4729
+ */
4730
+ xdelex = (...args) => new XDelExCommand(args, this.opts).exec(this.client);
4572
4731
  /**
4573
4732
  * @see https://redis.io/commands/xgroup
4574
4733
  */
@@ -4710,7 +4869,7 @@ var Redis = class {
4710
4869
  };
4711
4870
 
4712
4871
  // version.ts
4713
- var VERSION = "v1.36.1";
4872
+ var VERSION = "v1.36.3";
4714
4873
 
4715
4874
  // platforms/nodejs.ts
4716
4875
  if (typeof atob === "undefined") {
package/nodejs.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Redis,
4
4
  VERSION,
5
5
  error_exports
6
- } from "./chunk-LLI2WIYN.mjs";
6
+ } from "./chunk-NB23BFCV.mjs";
7
7
 
8
8
  // platforms/nodejs.ts
9
9
  if (typeof atob === "undefined") {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@upstash/redis","version":"v1.36.1","main":"./nodejs.js","module":"./nodejs.mjs","types":"./nodejs.d.ts","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.mjs":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.mjs":{"import":"./fastly.mjs","require":"./fastly.js"}},"description":"An HTTP/REST based Redis client built on top of Upstash REST API.","repository":{"type":"git","url":"git+https://github.com/upstash/upstash-redis.git"},"keywords":["redis","database","serverless","edge","upstash"],"files":["./*"],"scripts":{"build":"tsup && cp package.json README.md LICENSE dist/","test":"bun test pkg","fmt":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","lint":"eslint \"**/*.{js,ts,tsx}\" --quiet --fix","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","lint:fix":"eslint . -c .ts,.tsx,.js,.jsx --fix","commit":"cz","lint:format":"bun run lint:fix && bun run format","check-exports":"bun run build && cd dist && attw -P"},"author":"Andreas Thomas <dev@chronark.com>","license":"MIT","bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"homepage":"https://github.com/upstash/upstash-redis#readme","devDependencies":{"@biomejs/biome":"latest","@commitlint/cli":"^19.3.0","@commitlint/config-conventional":"^19.2.2","@typescript-eslint/eslint-plugin":"8.4.0","@typescript-eslint/parser":"8.4.0","bun-types":"1.0.33","eslint":"9.10.0","eslint-plugin-unicorn":"55.0.0","husky":"^9.1.1","prettier":"^3.3.3","tsup":"^8.2.3","typescript":"latest"},"dependencies":{"uncrypto":"^0.1.3"}}
1
+ {"name":"@upstash/redis","version":"v1.36.3","main":"./nodejs.js","module":"./nodejs.mjs","types":"./nodejs.d.ts","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.mjs":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.mjs":{"import":"./fastly.mjs","require":"./fastly.js"}},"description":"An HTTP/REST based Redis client built on top of Upstash REST API.","repository":{"type":"git","url":"git@github.com:upstash/redis-js.git"},"keywords":["redis","database","serverless","edge","upstash"],"files":["./*"],"scripts":{"build":"tsup && cp package.json README.md LICENSE dist/","test":"bun test pkg","fmt":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","lint":"eslint \"**/*.{js,ts,tsx}\" --quiet --fix","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","lint:fix":"eslint . -c .ts,.tsx,.js,.jsx --fix","commit":"cz","lint:format":"bun run lint:fix && bun run format","check-exports":"bun run build && cd dist && attw -P"},"author":"Andreas Thomas <dev@chronark.com>","license":"MIT","bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"homepage":"https://github.com/upstash/upstash-redis#readme","devDependencies":{"@biomejs/biome":"latest","@commitlint/cli":"^19.3.0","@commitlint/config-conventional":"^19.2.2","@typescript-eslint/eslint-plugin":"8.4.0","@typescript-eslint/parser":"8.4.0","bun-types":"1.0.33","eslint":"9.10.0","eslint-plugin-unicorn":"55.0.0","husky":"^9.1.1","prettier":"^3.3.3","tsup":"^8.2.3","typescript":"latest"},"dependencies":{"uncrypto":"^0.1.3"}}