@upstash/redis 1.36.1 → 1.36.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/{chunk-LLI2WIYN.mjs → chunk-Q3SWX4BB.mjs} +164 -25
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +164 -25
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +164 -25
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +2 -2
- package/nodejs.d.ts +2 -2
- package/nodejs.js +164 -25
- package/nodejs.mjs +1 -1
- package/package.json +1 -1
- package/{zmscore-0SAuWM0q.d.mts → zmscore-BjNXmrug.d.mts} +340 -2
- package/{zmscore-0SAuWM0q.d.ts → zmscore-BjNXmrug.d.ts} +340 -2
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) {
|
|
@@ -2077,6 +2146,16 @@ var XAckCommand = class extends Command {
|
|
|
2077
2146
|
}
|
|
2078
2147
|
};
|
|
2079
2148
|
|
|
2149
|
+
// pkg/commands/xackdel.ts
|
|
2150
|
+
var XAckDelCommand = class extends Command {
|
|
2151
|
+
constructor([key, group, opts, ...ids], cmdOpts) {
|
|
2152
|
+
const command = ["XACKDEL", key, group];
|
|
2153
|
+
command.push(opts.toUpperCase());
|
|
2154
|
+
command.push("IDS", ids.length, ...ids);
|
|
2155
|
+
super(command, cmdOpts);
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2080
2159
|
// pkg/commands/xadd.ts
|
|
2081
2160
|
var XAddCommand = class extends Command {
|
|
2082
2161
|
constructor([key, id, entries, opts], commandOptions) {
|
|
@@ -2149,6 +2228,18 @@ var XDelCommand = class extends Command {
|
|
|
2149
2228
|
}
|
|
2150
2229
|
};
|
|
2151
2230
|
|
|
2231
|
+
// pkg/commands/xdelex.ts
|
|
2232
|
+
var XDelExCommand = class extends Command {
|
|
2233
|
+
constructor([key, opts, ...ids], cmdOpts) {
|
|
2234
|
+
const command = ["XDELEX", key];
|
|
2235
|
+
if (opts) {
|
|
2236
|
+
command.push(opts.toUpperCase());
|
|
2237
|
+
}
|
|
2238
|
+
command.push("IDS", ids.length, ...ids);
|
|
2239
|
+
super(command, cmdOpts);
|
|
2240
|
+
}
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2152
2243
|
// pkg/commands/xgroup.ts
|
|
2153
2244
|
var XGroupCommand = class extends Command {
|
|
2154
2245
|
constructor([key, opts], commandOptions) {
|
|
@@ -2899,6 +2990,10 @@ var Pipeline = class {
|
|
|
2899
2990
|
* @see https://redis.io/commands/bitpos
|
|
2900
2991
|
*/
|
|
2901
2992
|
bitpos = (...args) => this.chain(new BitPosCommand(args, this.commandOptions));
|
|
2993
|
+
/**
|
|
2994
|
+
* @see https://redis.io/commands/client-setinfo
|
|
2995
|
+
*/
|
|
2996
|
+
clientSetinfo = (...args) => this.chain(new ClientSetInfoCommand(args, this.commandOptions));
|
|
2902
2997
|
/**
|
|
2903
2998
|
* @see https://redis.io/commands/copy
|
|
2904
2999
|
*/
|
|
@@ -3063,6 +3158,14 @@ var Pipeline = class {
|
|
|
3063
3158
|
* @see https://redis.io/commands/hgetall
|
|
3064
3159
|
*/
|
|
3065
3160
|
hgetall = (...args) => this.chain(new HGetAllCommand(args, this.commandOptions));
|
|
3161
|
+
/**
|
|
3162
|
+
* @see https://redis.io/commands/hgetdel
|
|
3163
|
+
*/
|
|
3164
|
+
hgetdel = (...args) => this.chain(new HGetDelCommand(args, this.commandOptions));
|
|
3165
|
+
/**
|
|
3166
|
+
* @see https://redis.io/commands/hgetex
|
|
3167
|
+
*/
|
|
3168
|
+
hgetex = (...args) => this.chain(new HGetExCommand(args, this.commandOptions));
|
|
3066
3169
|
/**
|
|
3067
3170
|
* @see https://redis.io/commands/hincrby
|
|
3068
3171
|
*/
|
|
@@ -3099,6 +3202,10 @@ var Pipeline = class {
|
|
|
3099
3202
|
* @see https://redis.io/commands/hset
|
|
3100
3203
|
*/
|
|
3101
3204
|
hset = (key, kv) => this.chain(new HSetCommand([key, kv], this.commandOptions));
|
|
3205
|
+
/**
|
|
3206
|
+
* @see https://redis.io/commands/hsetex
|
|
3207
|
+
*/
|
|
3208
|
+
hsetex = (...args) => this.chain(new HSetExCommand(args, this.commandOptions));
|
|
3102
3209
|
/**
|
|
3103
3210
|
* @see https://redis.io/commands/hsetnx
|
|
3104
3211
|
*/
|
|
@@ -3403,10 +3510,18 @@ var Pipeline = class {
|
|
|
3403
3510
|
* @see https://redis.io/commands/xack
|
|
3404
3511
|
*/
|
|
3405
3512
|
xack = (...args) => this.chain(new XAckCommand(args, this.commandOptions));
|
|
3513
|
+
/**
|
|
3514
|
+
* @see https://redis.io/commands/xackdel
|
|
3515
|
+
*/
|
|
3516
|
+
xackdel = (...args) => this.chain(new XAckDelCommand(args, this.commandOptions));
|
|
3406
3517
|
/**
|
|
3407
3518
|
* @see https://redis.io/commands/xdel
|
|
3408
3519
|
*/
|
|
3409
3520
|
xdel = (...args) => this.chain(new XDelCommand(args, this.commandOptions));
|
|
3521
|
+
/**
|
|
3522
|
+
* @see https://redis.io/commands/xdelex
|
|
3523
|
+
*/
|
|
3524
|
+
xdelex = (...args) => this.chain(new XDelExCommand(args, this.commandOptions));
|
|
3410
3525
|
/**
|
|
3411
3526
|
* @see https://redis.io/commands/xgroup
|
|
3412
3527
|
*/
|
|
@@ -4064,6 +4179,10 @@ var Redis = class {
|
|
|
4064
4179
|
* @see https://redis.io/commands/bitpos
|
|
4065
4180
|
*/
|
|
4066
4181
|
bitpos = (...args) => new BitPosCommand(args, this.opts).exec(this.client);
|
|
4182
|
+
/**
|
|
4183
|
+
* @see https://redis.io/commands/client-setinfo
|
|
4184
|
+
*/
|
|
4185
|
+
clientSetinfo = (...args) => new ClientSetInfoCommand(args, this.opts).exec(this.client);
|
|
4067
4186
|
/**
|
|
4068
4187
|
* @see https://redis.io/commands/copy
|
|
4069
4188
|
*/
|
|
@@ -4228,6 +4347,14 @@ var Redis = class {
|
|
|
4228
4347
|
* @see https://redis.io/commands/hgetall
|
|
4229
4348
|
*/
|
|
4230
4349
|
hgetall = (...args) => new HGetAllCommand(args, this.opts).exec(this.client);
|
|
4350
|
+
/**
|
|
4351
|
+
* @see https://redis.io/commands/hgetdel
|
|
4352
|
+
*/
|
|
4353
|
+
hgetdel = (...args) => new HGetDelCommand(args, this.opts).exec(this.client);
|
|
4354
|
+
/**
|
|
4355
|
+
* @see https://redis.io/commands/hgetex
|
|
4356
|
+
*/
|
|
4357
|
+
hgetex = (...args) => new HGetExCommand(args, this.opts).exec(this.client);
|
|
4231
4358
|
/**
|
|
4232
4359
|
* @see https://redis.io/commands/hincrby
|
|
4233
4360
|
*/
|
|
@@ -4264,6 +4391,10 @@ var Redis = class {
|
|
|
4264
4391
|
* @see https://redis.io/commands/hset
|
|
4265
4392
|
*/
|
|
4266
4393
|
hset = (key, kv) => new HSetCommand([key, kv], this.opts).exec(this.client);
|
|
4394
|
+
/**
|
|
4395
|
+
* @see https://redis.io/commands/hsetex
|
|
4396
|
+
*/
|
|
4397
|
+
hsetex = (...args) => new HSetExCommand(args, this.opts).exec(this.client);
|
|
4267
4398
|
/**
|
|
4268
4399
|
* @see https://redis.io/commands/hsetnx
|
|
4269
4400
|
*/
|
|
@@ -4565,10 +4696,18 @@ var Redis = class {
|
|
|
4565
4696
|
* @see https://redis.io/commands/xack
|
|
4566
4697
|
*/
|
|
4567
4698
|
xack = (...args) => new XAckCommand(args, this.opts).exec(this.client);
|
|
4699
|
+
/**
|
|
4700
|
+
* @see https://redis.io/commands/xackdel
|
|
4701
|
+
*/
|
|
4702
|
+
xackdel = (...args) => new XAckDelCommand(args, this.opts).exec(this.client);
|
|
4568
4703
|
/**
|
|
4569
4704
|
* @see https://redis.io/commands/xdel
|
|
4570
4705
|
*/
|
|
4571
4706
|
xdel = (...args) => new XDelCommand(args, this.opts).exec(this.client);
|
|
4707
|
+
/**
|
|
4708
|
+
* @see https://redis.io/commands/xdelex
|
|
4709
|
+
*/
|
|
4710
|
+
xdelex = (...args) => new XDelExCommand(args, this.opts).exec(this.client);
|
|
4572
4711
|
/**
|
|
4573
4712
|
* @see https://redis.io/commands/xgroup
|
|
4574
4713
|
*/
|
|
@@ -4710,7 +4849,7 @@ var Redis = class {
|
|
|
4710
4849
|
};
|
|
4711
4850
|
|
|
4712
4851
|
// version.ts
|
|
4713
|
-
var VERSION = "v1.36.
|
|
4852
|
+
var VERSION = "v1.36.2";
|
|
4714
4853
|
|
|
4715
4854
|
// platforms/nodejs.ts
|
|
4716
4855
|
if (typeof atob === "undefined") {
|
package/nodejs.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/redis","version":"v1.36.
|
|
1
|
+
{"name":"@upstash/redis","version":"v1.36.2","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"}}
|