@upstash/redis 1.37.0-rc.8 → 1.37.0
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-3HKMGXM7.mjs → chunk-IH7W44G6.mjs} +72 -31
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +72 -31
- package/cloudflare.mjs +1 -1
- package/{zmscore-CjaAkTRU.d.mts → error-8y4qG0W2.d.mts} +677 -857
- package/{zmscore-CjaAkTRU.d.ts → error-8y4qG0W2.d.ts} +677 -857
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +72 -31
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +9 -3
- package/nodejs.d.ts +9 -3
- package/nodejs.js +81 -32
- package/nodejs.mjs +10 -2
- package/package.json +78 -1
|
@@ -142,7 +142,6 @@ var HttpClient = class {
|
|
|
142
142
|
const signal = req.signal ?? this.options.signal;
|
|
143
143
|
const isSignalFunction = typeof signal === "function";
|
|
144
144
|
const requestOptions = {
|
|
145
|
-
//@ts-expect-error this should throw due to bun regression
|
|
146
145
|
cache: this.options.cache,
|
|
147
146
|
method: "POST",
|
|
148
147
|
headers: requestHeaders,
|
|
@@ -402,7 +401,16 @@ var ExecCommand = class extends Command {
|
|
|
402
401
|
};
|
|
403
402
|
|
|
404
403
|
// pkg/commands/search/types.ts
|
|
405
|
-
var FIELD_TYPES = [
|
|
404
|
+
var FIELD_TYPES = [
|
|
405
|
+
"TEXT",
|
|
406
|
+
"U64",
|
|
407
|
+
"I64",
|
|
408
|
+
"F64",
|
|
409
|
+
"BOOL",
|
|
410
|
+
"DATE",
|
|
411
|
+
"KEYWORD",
|
|
412
|
+
"FACET"
|
|
413
|
+
];
|
|
406
414
|
|
|
407
415
|
// pkg/commands/search/utils.ts
|
|
408
416
|
function isFieldType(value) {
|
|
@@ -457,7 +465,7 @@ function deserializeQueryResponse(rawResponse) {
|
|
|
457
465
|
const key2 = fieldRaw[0];
|
|
458
466
|
const value = fieldRaw[1];
|
|
459
467
|
const pathParts = key2.split(".");
|
|
460
|
-
if (pathParts.length
|
|
468
|
+
if (pathParts.length === 1) {
|
|
461
469
|
data[key2] = value;
|
|
462
470
|
} else {
|
|
463
471
|
let currentObj = data;
|
|
@@ -519,6 +527,10 @@ function deserializeDescribeResponse(rawResponse) {
|
|
|
519
527
|
fieldInfo.fast = true;
|
|
520
528
|
break;
|
|
521
529
|
}
|
|
530
|
+
case "FROM": {
|
|
531
|
+
fieldInfo.from = fieldDescription[++j];
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
522
534
|
}
|
|
523
535
|
}
|
|
524
536
|
}
|
|
@@ -534,16 +546,8 @@ function deserializeDescribeResponse(rawResponse) {
|
|
|
534
546
|
function parseCountResponse(rawResponse) {
|
|
535
547
|
return typeof rawResponse === "number" ? rawResponse : Number.parseInt(rawResponse, 10);
|
|
536
548
|
}
|
|
537
|
-
function deserializeAggregateResponse(rawResponse
|
|
538
|
-
|
|
539
|
-
const aggregationResult = parseAggregationArray(rawResponse[0]);
|
|
540
|
-
const searchResults = deserializeQueryResponse(rawResponse[1]);
|
|
541
|
-
return [aggregationResult, searchResults];
|
|
542
|
-
}
|
|
543
|
-
if (Array.isArray(rawResponse) && rawResponse.length === 1 && Array.isArray(rawResponse[0])) {
|
|
544
|
-
return parseAggregationArray(rawResponse[0]);
|
|
545
|
-
}
|
|
546
|
-
return rawResponse;
|
|
549
|
+
function deserializeAggregateResponse(rawResponse) {
|
|
550
|
+
return parseAggregationArray(rawResponse);
|
|
547
551
|
}
|
|
548
552
|
function parseAggregationArray(arr) {
|
|
549
553
|
const result = {};
|
|
@@ -562,6 +566,12 @@ function parseAggregationArray(arr) {
|
|
|
562
566
|
}
|
|
563
567
|
return result;
|
|
564
568
|
}
|
|
569
|
+
function coerceNumericString(value) {
|
|
570
|
+
if (typeof value === "string" && value !== "" && !Number.isNaN(Number(value))) {
|
|
571
|
+
return Number(value);
|
|
572
|
+
}
|
|
573
|
+
return value;
|
|
574
|
+
}
|
|
565
575
|
function parseStatsValue(arr) {
|
|
566
576
|
const result = {};
|
|
567
577
|
for (let i = 0; i < arr.length; i += 2) {
|
|
@@ -576,14 +586,14 @@ function parseStatsValue(arr) {
|
|
|
576
586
|
result[key] = value;
|
|
577
587
|
}
|
|
578
588
|
} else {
|
|
579
|
-
result[key] = value;
|
|
589
|
+
result[key] = coerceNumericString(value);
|
|
580
590
|
}
|
|
581
591
|
}
|
|
582
592
|
return result;
|
|
583
593
|
}
|
|
584
594
|
function parseBucketsValue(arr) {
|
|
585
595
|
if (arr[0] === "buckets" && Array.isArray(arr[1])) {
|
|
586
|
-
|
|
596
|
+
const result = {
|
|
587
597
|
buckets: arr[1].map((bucket) => {
|
|
588
598
|
const bucketObj = {};
|
|
589
599
|
for (let i = 0; i < bucket.length; i += 2) {
|
|
@@ -594,6 +604,10 @@ function parseBucketsValue(arr) {
|
|
|
594
604
|
return bucketObj;
|
|
595
605
|
})
|
|
596
606
|
};
|
|
607
|
+
for (let i = 2; i < arr.length; i += 2) {
|
|
608
|
+
result[arr[i]] = arr[i + 1];
|
|
609
|
+
}
|
|
610
|
+
return result;
|
|
597
611
|
}
|
|
598
612
|
return arr;
|
|
599
613
|
}
|
|
@@ -717,11 +731,7 @@ function buildCreateIndexCommand(params) {
|
|
|
717
731
|
function buildAggregateCommand(name, options) {
|
|
718
732
|
const query = JSON.stringify(options?.filter ?? {});
|
|
719
733
|
const aggregations = JSON.stringify(options.aggregations);
|
|
720
|
-
|
|
721
|
-
if (options?.limit !== void 0) {
|
|
722
|
-
command.push("LIMIT", options.limit.toString());
|
|
723
|
-
}
|
|
724
|
-
return command;
|
|
734
|
+
return ["SEARCH.AGGREGATE", name, query, aggregations];
|
|
725
735
|
}
|
|
726
736
|
|
|
727
737
|
// pkg/commands/search/search.ts
|
|
@@ -736,13 +746,14 @@ var SearchIndex = class {
|
|
|
736
746
|
}
|
|
737
747
|
async waitIndexing() {
|
|
738
748
|
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
739
|
-
await new ExecCommand(command).exec(this.client);
|
|
749
|
+
return await new ExecCommand(command).exec(this.client);
|
|
740
750
|
}
|
|
741
751
|
async describe() {
|
|
742
752
|
const command = ["SEARCH.DESCRIBE", this.name];
|
|
743
753
|
const rawResult = await new ExecCommand(command).exec(
|
|
744
754
|
this.client
|
|
745
755
|
);
|
|
756
|
+
if (!rawResult) return null;
|
|
746
757
|
return deserializeDescribeResponse(rawResult);
|
|
747
758
|
}
|
|
748
759
|
async query(options) {
|
|
@@ -750,6 +761,7 @@ var SearchIndex = class {
|
|
|
750
761
|
const rawResult = await new ExecCommand(command).exec(
|
|
751
762
|
this.client
|
|
752
763
|
);
|
|
764
|
+
if (!rawResult) return rawResult;
|
|
753
765
|
return deserializeQueryResponse(rawResult);
|
|
754
766
|
}
|
|
755
767
|
async aggregate(options) {
|
|
@@ -757,7 +769,7 @@ var SearchIndex = class {
|
|
|
757
769
|
const rawResult = await new ExecCommand(
|
|
758
770
|
command
|
|
759
771
|
).exec(this.client);
|
|
760
|
-
return deserializeAggregateResponse(rawResult
|
|
772
|
+
return deserializeAggregateResponse(rawResult);
|
|
761
773
|
}
|
|
762
774
|
async count({ filter }) {
|
|
763
775
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -2295,6 +2307,18 @@ var SInterCommand = class extends Command {
|
|
|
2295
2307
|
}
|
|
2296
2308
|
};
|
|
2297
2309
|
|
|
2310
|
+
// pkg/commands/sintercard.ts
|
|
2311
|
+
var SInterCardCommand = class extends Command {
|
|
2312
|
+
constructor(cmd, cmdOpts) {
|
|
2313
|
+
const [keys, opts] = cmd;
|
|
2314
|
+
const command = ["sintercard", keys.length, ...keys];
|
|
2315
|
+
if (opts?.limit !== void 0) {
|
|
2316
|
+
command.push("LIMIT", opts.limit);
|
|
2317
|
+
}
|
|
2318
|
+
super(command, cmdOpts);
|
|
2319
|
+
}
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2298
2322
|
// pkg/commands/sinterstore.ts
|
|
2299
2323
|
var SInterStoreCommand = class extends Command {
|
|
2300
2324
|
constructor(cmd, opts) {
|
|
@@ -2444,8 +2468,7 @@ var XAckCommand = class extends Command {
|
|
|
2444
2468
|
var XAckDelCommand = class extends Command {
|
|
2445
2469
|
constructor([key, group, opts, ...ids], cmdOpts) {
|
|
2446
2470
|
const command = ["XACKDEL", key, group];
|
|
2447
|
-
command.push(opts.toUpperCase());
|
|
2448
|
-
command.push("IDS", ids.length, ...ids);
|
|
2471
|
+
command.push(opts.toUpperCase(), "IDS", ids.length, ...ids);
|
|
2449
2472
|
super(command, cmdOpts);
|
|
2450
2473
|
}
|
|
2451
2474
|
};
|
|
@@ -3526,6 +3549,10 @@ var Pipeline = class {
|
|
|
3526
3549
|
* @see https://redis.io/commands/sinter
|
|
3527
3550
|
*/
|
|
3528
3551
|
sinter = (...args) => this.chain(new SInterCommand(args, this.commandOptions));
|
|
3552
|
+
/**
|
|
3553
|
+
* @see https://redis.io/commands/sintercard
|
|
3554
|
+
*/
|
|
3555
|
+
sintercard = (...args) => this.chain(new SInterCardCommand(args, this.commandOptions));
|
|
3529
3556
|
/**
|
|
3530
3557
|
* @see https://redis.io/commands/sinterstore
|
|
3531
3558
|
*/
|
|
@@ -4181,6 +4208,7 @@ var Script = class {
|
|
|
4181
4208
|
* future major release.
|
|
4182
4209
|
*/
|
|
4183
4210
|
sha1;
|
|
4211
|
+
initPromise;
|
|
4184
4212
|
redis;
|
|
4185
4213
|
constructor(redis, script) {
|
|
4186
4214
|
this.redis = redis;
|
|
@@ -4191,9 +4219,13 @@ var Script = class {
|
|
|
4191
4219
|
/**
|
|
4192
4220
|
* Initialize the script by computing its SHA-1 hash.
|
|
4193
4221
|
*/
|
|
4194
|
-
|
|
4195
|
-
if (this.
|
|
4196
|
-
|
|
4222
|
+
init(script) {
|
|
4223
|
+
if (!this.initPromise) {
|
|
4224
|
+
this.initPromise = this.digest(script).then((sha1) => {
|
|
4225
|
+
this.sha1 = sha1;
|
|
4226
|
+
});
|
|
4227
|
+
}
|
|
4228
|
+
return this.initPromise;
|
|
4197
4229
|
}
|
|
4198
4230
|
/**
|
|
4199
4231
|
* Send an `EVAL` command to redis.
|
|
@@ -4248,6 +4280,7 @@ var ScriptRO = class {
|
|
|
4248
4280
|
* future major release.
|
|
4249
4281
|
*/
|
|
4250
4282
|
sha1;
|
|
4283
|
+
initPromise;
|
|
4251
4284
|
redis;
|
|
4252
4285
|
constructor(redis, script) {
|
|
4253
4286
|
this.redis = redis;
|
|
@@ -4255,9 +4288,13 @@ var ScriptRO = class {
|
|
|
4255
4288
|
this.script = script;
|
|
4256
4289
|
void this.init(script);
|
|
4257
4290
|
}
|
|
4258
|
-
|
|
4259
|
-
if (this.
|
|
4260
|
-
|
|
4291
|
+
init(script) {
|
|
4292
|
+
if (!this.initPromise) {
|
|
4293
|
+
this.initPromise = this.digest(script).then((sha1) => {
|
|
4294
|
+
this.sha1 = sha1;
|
|
4295
|
+
});
|
|
4296
|
+
}
|
|
4297
|
+
return this.initPromise;
|
|
4261
4298
|
}
|
|
4262
4299
|
/**
|
|
4263
4300
|
* Send an `EVAL_RO` command to redis.
|
|
@@ -5028,6 +5065,10 @@ var Redis = class {
|
|
|
5028
5065
|
* @see https://redis.io/commands/sinter
|
|
5029
5066
|
*/
|
|
5030
5067
|
sinter = (...args) => new SInterCommand(args, this.opts).exec(this.client);
|
|
5068
|
+
/**
|
|
5069
|
+
* @see https://redis.io/commands/sintercard
|
|
5070
|
+
*/
|
|
5071
|
+
sintercard = (...args) => new SInterCardCommand(args, this.opts).exec(this.client);
|
|
5031
5072
|
/**
|
|
5032
5073
|
* @see https://redis.io/commands/sinterstore
|
|
5033
5074
|
*/
|
|
@@ -5264,7 +5305,7 @@ var Redis = class {
|
|
|
5264
5305
|
};
|
|
5265
5306
|
|
|
5266
5307
|
// version.ts
|
|
5267
|
-
var VERSION = "v1.
|
|
5308
|
+
var VERSION = "v1.30.2";
|
|
5268
5309
|
|
|
5269
5310
|
export {
|
|
5270
5311
|
error_exports,
|
package/cloudflare.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClientConfig,
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand,
|
|
1
|
+
import { R as Redis$1, H as HttpClientConfig, a as RedisOptions, b as RequesterConfig } from './error-8y4qG0W2.mjs';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, c as BitOpCommand, d as BitPosCommand, C as ClientSetInfoAttribute, e as ClientSetInfoCommand, f as CopyCommand, D as DBSizeCommand, g as DecrByCommand, h as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalROCommand, l as EvalshaCommand, m as EvalshaROCommand, n as ExistsCommand, o as ExpireAtCommand, p as ExpireCommand, q as ExpireOption, F as FlushAllCommand, r as FlushDBCommand, G as GeoAddCommand, s as GeoAddCommandOptions, t as GeoDistCommand, u as GeoHashCommand, v as GeoMember, w as GeoPosCommand, x as GeoSearchCommand, y as GeoSearchStoreCommand, z as GetBitCommand, I as GetCommand, J as GetDelCommand, K as GetExCommand, L as GetRangeCommand, M as GetSetCommand, N as HDelCommand, O as HExistsCommand, P as HExpireAtCommand, Q as HExpireCommand, S as HExpireTimeCommand, T as HGetAllCommand, U as HGetCommand, V as HGetDelCommand, W as HGetExCommand, X as HIncrByCommand, Y as HIncrByFloatCommand, Z as HKeysCommand, _ as HLenCommand, $ as HMGetCommand, a0 as HMSetCommand, a1 as HPExpireAtCommand, a2 as HPExpireCommand, a3 as HPExpireTimeCommand, a4 as HPTtlCommand, a5 as HPersistCommand, a6 as HRandFieldCommand, a7 as HScanCommand, a8 as HSetCommand, a9 as HSetExCommand, aa as HSetNXCommand, ab as HStrLenCommand, ac as HTtlCommand, ad as HValsCommand, ae as IncrByCommand, af as IncrByFloatCommand, ag as IncrCommand, ah as JsonArrAppendCommand, ai as JsonArrIndexCommand, aj as JsonArrInsertCommand, ak as JsonArrLenCommand, al as JsonArrPopCommand, am as JsonArrTrimCommand, an as JsonClearCommand, ao as JsonDelCommand, ap as JsonForgetCommand, aq as JsonGetCommand, ar as JsonMGetCommand, as as JsonMergeCommand, at as JsonNumIncrByCommand, au as JsonNumMultByCommand, av as JsonObjKeysCommand, aw as JsonObjLenCommand, ax as JsonRespCommand, ay as JsonSetCommand, az as JsonStrAppendCommand, aA as JsonStrLenCommand, aB as JsonToggleCommand, aC as JsonTypeCommand, aD as KeysCommand, aE as LIndexCommand, aF as LInsertCommand, aG as LLenCommand, aH as LMoveCommand, aI as LPopCommand, aJ as LPushCommand, aK as LPushXCommand, aL as LRangeCommand, aM as LRemCommand, aN as LSetCommand, aO as LTrimCommand, aP as MGetCommand, aQ as MSetCommand, aR as MSetNXCommand, aS as PExpireAtCommand, aT as PExpireCommand, aU as PSetEXCommand, aV as PTtlCommand, aW as PersistCommand, aX as PingCommand, aY as Pipeline, aZ as PublishCommand, a_ as RPopCommand, a$ as RPushCommand, b0 as RPushXCommand, b1 as RandomKeyCommand, b2 as RenameCommand, b3 as RenameNXCommand, b4 as Requester, b5 as SAddCommand, b6 as SCardCommand, b7 as SDiffCommand, b8 as SDiffStoreCommand, b9 as SInterCardCommand, ba as SInterCommand, bb as SInterStoreCommand, bc as SIsMemberCommand, bd as SMIsMemberCommand, be as SMembersCommand, bf as SMoveCommand, bg as SPopCommand, bh as SRandMemberCommand, bi as SRemCommand, bj as SScanCommand, bk as SUnionCommand, bl as SUnionStoreCommand, bm as ScanCommand, bn as ScanCommandOptions, bo as ScoreMember, bp as ScriptExistsCommand, bq as ScriptFlushCommand, br as ScriptLoadCommand, bs as SetBitCommand, bt as SetCommand, bu as SetCommandOptions, bv as SetExCommand, bw as SetNxCommand, bx as SetRangeCommand, by as StrLenCommand, bz as TimeCommand, bA as TouchCommand, bB as TtlCommand, bC as Type, bD as TypeCommand, bE as UnlinkCommand, bF as UpstashRequest, bG as UpstashResponse, bH as XAckDelCommand, bI as XAddCommand, bJ as XDelExCommand, bK as XRangeCommand, bL as ZAddCommand, bM as ZAddCommandOptions, bN as ZCardCommand, bO as ZCountCommand, bP as ZDiffStoreCommand, bQ as ZIncrByCommand, bR as ZInterStoreCommand, bS as ZInterStoreCommandOptions, bT as ZLexCountCommand, bU as ZMScoreCommand, bV as ZPopMaxCommand, bW as ZPopMinCommand, bX as ZRangeCommand, bY as ZRangeCommandOptions, bZ as ZRankCommand, b_ as ZRemCommand, b$ as ZRemRangeByLexCommand, c0 as ZRemRangeByRankCommand, c1 as ZRemRangeByScoreCommand, c2 as ZRevRankCommand, c3 as ZScanCommand, c4 as ZScoreCommand, c5 as ZUnionCommand, c6 as ZUnionCommandOptions, c7 as ZUnionStoreCommand, c8 as ZUnionStoreCommandOptions, c9 as errors } from './error-8y4qG0W2.mjs';
|
|
3
3
|
|
|
4
4
|
type Env = {
|
|
5
5
|
UPSTASH_DISABLE_TELEMETRY?: string;
|
package/cloudflare.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClientConfig,
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand,
|
|
1
|
+
import { R as Redis$1, H as HttpClientConfig, a as RedisOptions, b as RequesterConfig } from './error-8y4qG0W2.js';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, c as BitOpCommand, d as BitPosCommand, C as ClientSetInfoAttribute, e as ClientSetInfoCommand, f as CopyCommand, D as DBSizeCommand, g as DecrByCommand, h as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalROCommand, l as EvalshaCommand, m as EvalshaROCommand, n as ExistsCommand, o as ExpireAtCommand, p as ExpireCommand, q as ExpireOption, F as FlushAllCommand, r as FlushDBCommand, G as GeoAddCommand, s as GeoAddCommandOptions, t as GeoDistCommand, u as GeoHashCommand, v as GeoMember, w as GeoPosCommand, x as GeoSearchCommand, y as GeoSearchStoreCommand, z as GetBitCommand, I as GetCommand, J as GetDelCommand, K as GetExCommand, L as GetRangeCommand, M as GetSetCommand, N as HDelCommand, O as HExistsCommand, P as HExpireAtCommand, Q as HExpireCommand, S as HExpireTimeCommand, T as HGetAllCommand, U as HGetCommand, V as HGetDelCommand, W as HGetExCommand, X as HIncrByCommand, Y as HIncrByFloatCommand, Z as HKeysCommand, _ as HLenCommand, $ as HMGetCommand, a0 as HMSetCommand, a1 as HPExpireAtCommand, a2 as HPExpireCommand, a3 as HPExpireTimeCommand, a4 as HPTtlCommand, a5 as HPersistCommand, a6 as HRandFieldCommand, a7 as HScanCommand, a8 as HSetCommand, a9 as HSetExCommand, aa as HSetNXCommand, ab as HStrLenCommand, ac as HTtlCommand, ad as HValsCommand, ae as IncrByCommand, af as IncrByFloatCommand, ag as IncrCommand, ah as JsonArrAppendCommand, ai as JsonArrIndexCommand, aj as JsonArrInsertCommand, ak as JsonArrLenCommand, al as JsonArrPopCommand, am as JsonArrTrimCommand, an as JsonClearCommand, ao as JsonDelCommand, ap as JsonForgetCommand, aq as JsonGetCommand, ar as JsonMGetCommand, as as JsonMergeCommand, at as JsonNumIncrByCommand, au as JsonNumMultByCommand, av as JsonObjKeysCommand, aw as JsonObjLenCommand, ax as JsonRespCommand, ay as JsonSetCommand, az as JsonStrAppendCommand, aA as JsonStrLenCommand, aB as JsonToggleCommand, aC as JsonTypeCommand, aD as KeysCommand, aE as LIndexCommand, aF as LInsertCommand, aG as LLenCommand, aH as LMoveCommand, aI as LPopCommand, aJ as LPushCommand, aK as LPushXCommand, aL as LRangeCommand, aM as LRemCommand, aN as LSetCommand, aO as LTrimCommand, aP as MGetCommand, aQ as MSetCommand, aR as MSetNXCommand, aS as PExpireAtCommand, aT as PExpireCommand, aU as PSetEXCommand, aV as PTtlCommand, aW as PersistCommand, aX as PingCommand, aY as Pipeline, aZ as PublishCommand, a_ as RPopCommand, a$ as RPushCommand, b0 as RPushXCommand, b1 as RandomKeyCommand, b2 as RenameCommand, b3 as RenameNXCommand, b4 as Requester, b5 as SAddCommand, b6 as SCardCommand, b7 as SDiffCommand, b8 as SDiffStoreCommand, b9 as SInterCardCommand, ba as SInterCommand, bb as SInterStoreCommand, bc as SIsMemberCommand, bd as SMIsMemberCommand, be as SMembersCommand, bf as SMoveCommand, bg as SPopCommand, bh as SRandMemberCommand, bi as SRemCommand, bj as SScanCommand, bk as SUnionCommand, bl as SUnionStoreCommand, bm as ScanCommand, bn as ScanCommandOptions, bo as ScoreMember, bp as ScriptExistsCommand, bq as ScriptFlushCommand, br as ScriptLoadCommand, bs as SetBitCommand, bt as SetCommand, bu as SetCommandOptions, bv as SetExCommand, bw as SetNxCommand, bx as SetRangeCommand, by as StrLenCommand, bz as TimeCommand, bA as TouchCommand, bB as TtlCommand, bC as Type, bD as TypeCommand, bE as UnlinkCommand, bF as UpstashRequest, bG as UpstashResponse, bH as XAckDelCommand, bI as XAddCommand, bJ as XDelExCommand, bK as XRangeCommand, bL as ZAddCommand, bM as ZAddCommandOptions, bN as ZCardCommand, bO as ZCountCommand, bP as ZDiffStoreCommand, bQ as ZIncrByCommand, bR as ZInterStoreCommand, bS as ZInterStoreCommandOptions, bT as ZLexCountCommand, bU as ZMScoreCommand, bV as ZPopMaxCommand, bW as ZPopMinCommand, bX as ZRangeCommand, bY as ZRangeCommandOptions, bZ as ZRankCommand, b_ as ZRemCommand, b$ as ZRemRangeByLexCommand, c0 as ZRemRangeByRankCommand, c1 as ZRemRangeByScoreCommand, c2 as ZRevRankCommand, c3 as ZScanCommand, c4 as ZScoreCommand, c5 as ZUnionCommand, c6 as ZUnionCommandOptions, c7 as ZUnionStoreCommand, c8 as ZUnionStoreCommandOptions, c9 as errors } from './error-8y4qG0W2.js';
|
|
3
3
|
|
|
4
4
|
type Env = {
|
|
5
5
|
UPSTASH_DISABLE_TELEMETRY?: string;
|
package/cloudflare.js
CHANGED
|
@@ -163,7 +163,6 @@ var HttpClient = class {
|
|
|
163
163
|
const signal = req.signal ?? this.options.signal;
|
|
164
164
|
const isSignalFunction = typeof signal === "function";
|
|
165
165
|
const requestOptions = {
|
|
166
|
-
//@ts-expect-error this should throw due to bun regression
|
|
167
166
|
cache: this.options.cache,
|
|
168
167
|
method: "POST",
|
|
169
168
|
headers: requestHeaders,
|
|
@@ -2001,6 +2000,18 @@ var SInterCommand = class extends Command {
|
|
|
2001
2000
|
}
|
|
2002
2001
|
};
|
|
2003
2002
|
|
|
2003
|
+
// pkg/commands/sintercard.ts
|
|
2004
|
+
var SInterCardCommand = class extends Command {
|
|
2005
|
+
constructor(cmd, cmdOpts) {
|
|
2006
|
+
const [keys, opts] = cmd;
|
|
2007
|
+
const command = ["sintercard", keys.length, ...keys];
|
|
2008
|
+
if (opts?.limit !== void 0) {
|
|
2009
|
+
command.push("LIMIT", opts.limit);
|
|
2010
|
+
}
|
|
2011
|
+
super(command, cmdOpts);
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2004
2015
|
// pkg/commands/sinterstore.ts
|
|
2005
2016
|
var SInterStoreCommand = class extends Command {
|
|
2006
2017
|
constructor(cmd, opts) {
|
|
@@ -2150,8 +2161,7 @@ var XAckCommand = class extends Command {
|
|
|
2150
2161
|
var XAckDelCommand = class extends Command {
|
|
2151
2162
|
constructor([key, group, opts, ...ids], cmdOpts) {
|
|
2152
2163
|
const command = ["XACKDEL", key, group];
|
|
2153
|
-
command.push(opts.toUpperCase());
|
|
2154
|
-
command.push("IDS", ids.length, ...ids);
|
|
2164
|
+
command.push(opts.toUpperCase(), "IDS", ids.length, ...ids);
|
|
2155
2165
|
super(command, cmdOpts);
|
|
2156
2166
|
}
|
|
2157
2167
|
};
|
|
@@ -2693,7 +2703,16 @@ var ZUnionStoreCommand = class extends Command {
|
|
|
2693
2703
|
};
|
|
2694
2704
|
|
|
2695
2705
|
// pkg/commands/search/types.ts
|
|
2696
|
-
var FIELD_TYPES = [
|
|
2706
|
+
var FIELD_TYPES = [
|
|
2707
|
+
"TEXT",
|
|
2708
|
+
"U64",
|
|
2709
|
+
"I64",
|
|
2710
|
+
"F64",
|
|
2711
|
+
"BOOL",
|
|
2712
|
+
"DATE",
|
|
2713
|
+
"KEYWORD",
|
|
2714
|
+
"FACET"
|
|
2715
|
+
];
|
|
2697
2716
|
|
|
2698
2717
|
// pkg/commands/search/utils.ts
|
|
2699
2718
|
function isFieldType(value) {
|
|
@@ -2748,7 +2767,7 @@ function deserializeQueryResponse(rawResponse) {
|
|
|
2748
2767
|
const key2 = fieldRaw[0];
|
|
2749
2768
|
const value = fieldRaw[1];
|
|
2750
2769
|
const pathParts = key2.split(".");
|
|
2751
|
-
if (pathParts.length
|
|
2770
|
+
if (pathParts.length === 1) {
|
|
2752
2771
|
data[key2] = value;
|
|
2753
2772
|
} else {
|
|
2754
2773
|
let currentObj = data;
|
|
@@ -2810,6 +2829,10 @@ function deserializeDescribeResponse(rawResponse) {
|
|
|
2810
2829
|
fieldInfo.fast = true;
|
|
2811
2830
|
break;
|
|
2812
2831
|
}
|
|
2832
|
+
case "FROM": {
|
|
2833
|
+
fieldInfo.from = fieldDescription[++j];
|
|
2834
|
+
break;
|
|
2835
|
+
}
|
|
2813
2836
|
}
|
|
2814
2837
|
}
|
|
2815
2838
|
}
|
|
@@ -2825,16 +2848,8 @@ function deserializeDescribeResponse(rawResponse) {
|
|
|
2825
2848
|
function parseCountResponse(rawResponse) {
|
|
2826
2849
|
return typeof rawResponse === "number" ? rawResponse : Number.parseInt(rawResponse, 10);
|
|
2827
2850
|
}
|
|
2828
|
-
function deserializeAggregateResponse(rawResponse
|
|
2829
|
-
|
|
2830
|
-
const aggregationResult = parseAggregationArray(rawResponse[0]);
|
|
2831
|
-
const searchResults = deserializeQueryResponse(rawResponse[1]);
|
|
2832
|
-
return [aggregationResult, searchResults];
|
|
2833
|
-
}
|
|
2834
|
-
if (Array.isArray(rawResponse) && rawResponse.length === 1 && Array.isArray(rawResponse[0])) {
|
|
2835
|
-
return parseAggregationArray(rawResponse[0]);
|
|
2836
|
-
}
|
|
2837
|
-
return rawResponse;
|
|
2851
|
+
function deserializeAggregateResponse(rawResponse) {
|
|
2852
|
+
return parseAggregationArray(rawResponse);
|
|
2838
2853
|
}
|
|
2839
2854
|
function parseAggregationArray(arr) {
|
|
2840
2855
|
const result = {};
|
|
@@ -2853,6 +2868,12 @@ function parseAggregationArray(arr) {
|
|
|
2853
2868
|
}
|
|
2854
2869
|
return result;
|
|
2855
2870
|
}
|
|
2871
|
+
function coerceNumericString(value) {
|
|
2872
|
+
if (typeof value === "string" && value !== "" && !Number.isNaN(Number(value))) {
|
|
2873
|
+
return Number(value);
|
|
2874
|
+
}
|
|
2875
|
+
return value;
|
|
2876
|
+
}
|
|
2856
2877
|
function parseStatsValue(arr) {
|
|
2857
2878
|
const result = {};
|
|
2858
2879
|
for (let i = 0; i < arr.length; i += 2) {
|
|
@@ -2867,14 +2888,14 @@ function parseStatsValue(arr) {
|
|
|
2867
2888
|
result[key] = value;
|
|
2868
2889
|
}
|
|
2869
2890
|
} else {
|
|
2870
|
-
result[key] = value;
|
|
2891
|
+
result[key] = coerceNumericString(value);
|
|
2871
2892
|
}
|
|
2872
2893
|
}
|
|
2873
2894
|
return result;
|
|
2874
2895
|
}
|
|
2875
2896
|
function parseBucketsValue(arr) {
|
|
2876
2897
|
if (arr[0] === "buckets" && Array.isArray(arr[1])) {
|
|
2877
|
-
|
|
2898
|
+
const result = {
|
|
2878
2899
|
buckets: arr[1].map((bucket) => {
|
|
2879
2900
|
const bucketObj = {};
|
|
2880
2901
|
for (let i = 0; i < bucket.length; i += 2) {
|
|
@@ -2885,6 +2906,10 @@ function parseBucketsValue(arr) {
|
|
|
2885
2906
|
return bucketObj;
|
|
2886
2907
|
})
|
|
2887
2908
|
};
|
|
2909
|
+
for (let i = 2; i < arr.length; i += 2) {
|
|
2910
|
+
result[arr[i]] = arr[i + 1];
|
|
2911
|
+
}
|
|
2912
|
+
return result;
|
|
2888
2913
|
}
|
|
2889
2914
|
return arr;
|
|
2890
2915
|
}
|
|
@@ -3008,11 +3033,7 @@ function buildCreateIndexCommand(params) {
|
|
|
3008
3033
|
function buildAggregateCommand(name, options) {
|
|
3009
3034
|
const query = JSON.stringify(options?.filter ?? {});
|
|
3010
3035
|
const aggregations = JSON.stringify(options.aggregations);
|
|
3011
|
-
|
|
3012
|
-
if (options?.limit !== void 0) {
|
|
3013
|
-
command.push("LIMIT", options.limit.toString());
|
|
3014
|
-
}
|
|
3015
|
-
return command;
|
|
3036
|
+
return ["SEARCH.AGGREGATE", name, query, aggregations];
|
|
3016
3037
|
}
|
|
3017
3038
|
|
|
3018
3039
|
// pkg/commands/search/search.ts
|
|
@@ -3027,13 +3048,14 @@ var SearchIndex = class {
|
|
|
3027
3048
|
}
|
|
3028
3049
|
async waitIndexing() {
|
|
3029
3050
|
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
3030
|
-
await new ExecCommand(command).exec(this.client);
|
|
3051
|
+
return await new ExecCommand(command).exec(this.client);
|
|
3031
3052
|
}
|
|
3032
3053
|
async describe() {
|
|
3033
3054
|
const command = ["SEARCH.DESCRIBE", this.name];
|
|
3034
3055
|
const rawResult = await new ExecCommand(command).exec(
|
|
3035
3056
|
this.client
|
|
3036
3057
|
);
|
|
3058
|
+
if (!rawResult) return null;
|
|
3037
3059
|
return deserializeDescribeResponse(rawResult);
|
|
3038
3060
|
}
|
|
3039
3061
|
async query(options) {
|
|
@@ -3041,6 +3063,7 @@ var SearchIndex = class {
|
|
|
3041
3063
|
const rawResult = await new ExecCommand(command).exec(
|
|
3042
3064
|
this.client
|
|
3043
3065
|
);
|
|
3066
|
+
if (!rawResult) return rawResult;
|
|
3044
3067
|
return deserializeQueryResponse(rawResult);
|
|
3045
3068
|
}
|
|
3046
3069
|
async aggregate(options) {
|
|
@@ -3048,7 +3071,7 @@ var SearchIndex = class {
|
|
|
3048
3071
|
const rawResult = await new ExecCommand(
|
|
3049
3072
|
command
|
|
3050
3073
|
).exec(this.client);
|
|
3051
|
-
return deserializeAggregateResponse(rawResult
|
|
3074
|
+
return deserializeAggregateResponse(rawResult);
|
|
3052
3075
|
}
|
|
3053
3076
|
async count({ filter }) {
|
|
3054
3077
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -3833,6 +3856,10 @@ var Pipeline = class {
|
|
|
3833
3856
|
* @see https://redis.io/commands/sinter
|
|
3834
3857
|
*/
|
|
3835
3858
|
sinter = (...args) => this.chain(new SInterCommand(args, this.commandOptions));
|
|
3859
|
+
/**
|
|
3860
|
+
* @see https://redis.io/commands/sintercard
|
|
3861
|
+
*/
|
|
3862
|
+
sintercard = (...args) => this.chain(new SInterCardCommand(args, this.commandOptions));
|
|
3836
3863
|
/**
|
|
3837
3864
|
* @see https://redis.io/commands/sinterstore
|
|
3838
3865
|
*/
|
|
@@ -4202,6 +4229,7 @@ var Script = class {
|
|
|
4202
4229
|
* future major release.
|
|
4203
4230
|
*/
|
|
4204
4231
|
sha1;
|
|
4232
|
+
initPromise;
|
|
4205
4233
|
redis;
|
|
4206
4234
|
constructor(redis, script) {
|
|
4207
4235
|
this.redis = redis;
|
|
@@ -4212,9 +4240,13 @@ var Script = class {
|
|
|
4212
4240
|
/**
|
|
4213
4241
|
* Initialize the script by computing its SHA-1 hash.
|
|
4214
4242
|
*/
|
|
4215
|
-
|
|
4216
|
-
if (this.
|
|
4217
|
-
|
|
4243
|
+
init(script) {
|
|
4244
|
+
if (!this.initPromise) {
|
|
4245
|
+
this.initPromise = this.digest(script).then((sha1) => {
|
|
4246
|
+
this.sha1 = sha1;
|
|
4247
|
+
});
|
|
4248
|
+
}
|
|
4249
|
+
return this.initPromise;
|
|
4218
4250
|
}
|
|
4219
4251
|
/**
|
|
4220
4252
|
* Send an `EVAL` command to redis.
|
|
@@ -4269,6 +4301,7 @@ var ScriptRO = class {
|
|
|
4269
4301
|
* future major release.
|
|
4270
4302
|
*/
|
|
4271
4303
|
sha1;
|
|
4304
|
+
initPromise;
|
|
4272
4305
|
redis;
|
|
4273
4306
|
constructor(redis, script) {
|
|
4274
4307
|
this.redis = redis;
|
|
@@ -4276,9 +4309,13 @@ var ScriptRO = class {
|
|
|
4276
4309
|
this.script = script;
|
|
4277
4310
|
void this.init(script);
|
|
4278
4311
|
}
|
|
4279
|
-
|
|
4280
|
-
if (this.
|
|
4281
|
-
|
|
4312
|
+
init(script) {
|
|
4313
|
+
if (!this.initPromise) {
|
|
4314
|
+
this.initPromise = this.digest(script).then((sha1) => {
|
|
4315
|
+
this.sha1 = sha1;
|
|
4316
|
+
});
|
|
4317
|
+
}
|
|
4318
|
+
return this.initPromise;
|
|
4282
4319
|
}
|
|
4283
4320
|
/**
|
|
4284
4321
|
* Send an `EVAL_RO` command to redis.
|
|
@@ -5049,6 +5086,10 @@ var Redis = class {
|
|
|
5049
5086
|
* @see https://redis.io/commands/sinter
|
|
5050
5087
|
*/
|
|
5051
5088
|
sinter = (...args) => new SInterCommand(args, this.opts).exec(this.client);
|
|
5089
|
+
/**
|
|
5090
|
+
* @see https://redis.io/commands/sintercard
|
|
5091
|
+
*/
|
|
5092
|
+
sintercard = (...args) => new SInterCardCommand(args, this.opts).exec(this.client);
|
|
5052
5093
|
/**
|
|
5053
5094
|
* @see https://redis.io/commands/sinterstore
|
|
5054
5095
|
*/
|
|
@@ -5285,7 +5326,7 @@ var Redis = class {
|
|
|
5285
5326
|
};
|
|
5286
5327
|
|
|
5287
5328
|
// version.ts
|
|
5288
|
-
var VERSION = "v1.
|
|
5329
|
+
var VERSION = "v1.30.2";
|
|
5289
5330
|
|
|
5290
5331
|
// platforms/cloudflare.ts
|
|
5291
5332
|
var Redis2 = class _Redis extends Redis {
|