@upstash/redis 1.36.0-rc.4 → 1.36.0-rc.5
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-P45C5Z47.mjs → chunk-2NDFGHFZ.mjs} +64 -70
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +64 -70
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +64 -70
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +2 -2
- package/nodejs.d.ts +2 -2
- package/nodejs.js +64 -70
- package/nodejs.mjs +1 -1
- package/package.json +1 -1
- package/{zmscore-BfRVhSFL.d.mts → zmscore-DtGaZZXE.d.mts} +22 -5
- package/{zmscore-BfRVhSFL.d.ts → zmscore-DtGaZZXE.d.ts} +22 -5
|
@@ -424,98 +424,92 @@ function flattenSchema(schema, pathPrefix = []) {
|
|
|
424
424
|
}
|
|
425
425
|
return fields;
|
|
426
426
|
}
|
|
427
|
-
function deserializeQueryResponse(rawResponse
|
|
428
|
-
const hasEmptySelect = options?.select && Object.keys(options.select).length === 0;
|
|
427
|
+
function deserializeQueryResponse(rawResponse) {
|
|
429
428
|
return rawResponse.map((itemRaw) => {
|
|
430
429
|
const raw = itemRaw;
|
|
431
430
|
const key = raw[0];
|
|
432
431
|
const score = raw[1];
|
|
433
432
|
const rawFields = raw[2];
|
|
434
|
-
if (
|
|
433
|
+
if (rawFields === void 0) {
|
|
435
434
|
return { key, score };
|
|
436
435
|
}
|
|
437
436
|
if (!Array.isArray(rawFields) || rawFields.length === 0) {
|
|
438
437
|
return { key, score, data: {} };
|
|
439
438
|
}
|
|
440
|
-
|
|
439
|
+
let data = {};
|
|
441
440
|
for (const fieldRaw of rawFields) {
|
|
442
|
-
const
|
|
443
|
-
|
|
441
|
+
const key2 = fieldRaw[0];
|
|
442
|
+
const value = fieldRaw[1];
|
|
443
|
+
const pathParts = key2.split(".");
|
|
444
|
+
if (pathParts.length == 1) {
|
|
445
|
+
data[key2] = value;
|
|
446
|
+
} else {
|
|
447
|
+
let currentObj = data;
|
|
448
|
+
for (let i = 0; i < pathParts.length - 1; i++) {
|
|
449
|
+
const pathPart = pathParts[i];
|
|
450
|
+
if (!(pathPart in currentObj)) {
|
|
451
|
+
currentObj[pathPart] = {};
|
|
452
|
+
}
|
|
453
|
+
currentObj = currentObj[pathPart];
|
|
454
|
+
}
|
|
455
|
+
currentObj[pathParts[pathParts.length - 1]] = value;
|
|
456
|
+
}
|
|
444
457
|
}
|
|
445
|
-
if ("$" in
|
|
446
|
-
|
|
447
|
-
return { key, score, data: data2 };
|
|
458
|
+
if ("$" in data) {
|
|
459
|
+
data = data["$"];
|
|
448
460
|
}
|
|
449
|
-
const data = dotNotationToNested(mergedFields);
|
|
450
461
|
return { key, score, data };
|
|
451
462
|
});
|
|
452
463
|
}
|
|
453
|
-
function
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
fieldInfo.noTokenize = true;
|
|
464
|
+
function deserializeDescribeResponse(rawResponse) {
|
|
465
|
+
const description = {};
|
|
466
|
+
for (let i = 0; i < rawResponse.length; i += 2) {
|
|
467
|
+
const descriptor = rawResponse[i];
|
|
468
|
+
switch (descriptor) {
|
|
469
|
+
case "name":
|
|
470
|
+
description["name"] = rawResponse[i + 1];
|
|
461
471
|
break;
|
|
462
|
-
case "
|
|
463
|
-
|
|
472
|
+
case "type":
|
|
473
|
+
description["dataType"] = rawResponse[i + 1].toLowerCase();
|
|
464
474
|
break;
|
|
465
|
-
case "
|
|
466
|
-
|
|
475
|
+
case "prefixes":
|
|
476
|
+
description["prefixes"] = rawResponse[i + 1];
|
|
477
|
+
break;
|
|
478
|
+
case "language":
|
|
479
|
+
description["language"] = rawResponse[i + 1];
|
|
480
|
+
break;
|
|
481
|
+
case "schema":
|
|
482
|
+
const schema = {};
|
|
483
|
+
for (const fieldDescription of rawResponse[i + 1]) {
|
|
484
|
+
const fieldName = fieldDescription[0];
|
|
485
|
+
const fieldInfo = { type: fieldDescription[1] };
|
|
486
|
+
if (fieldDescription.length > 2) {
|
|
487
|
+
for (let j = 2; j < fieldDescription.length; j++) {
|
|
488
|
+
const fieldOption = fieldDescription[j];
|
|
489
|
+
switch (fieldOption) {
|
|
490
|
+
case "NOSTEM":
|
|
491
|
+
fieldInfo.noStem = true;
|
|
492
|
+
break;
|
|
493
|
+
case "NOTOKENIZE":
|
|
494
|
+
fieldInfo.noTokenize = true;
|
|
495
|
+
break;
|
|
496
|
+
case "FAST":
|
|
497
|
+
fieldInfo.fast = true;
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
schema[fieldName] = fieldInfo;
|
|
503
|
+
}
|
|
504
|
+
description["schema"] = schema;
|
|
467
505
|
break;
|
|
468
506
|
}
|
|
469
507
|
}
|
|
470
|
-
return
|
|
471
|
-
}
|
|
472
|
-
function deserializeDescribeResponse(rawResponse) {
|
|
473
|
-
const raw = kvArrayToObject(rawResponse);
|
|
474
|
-
const schema = {};
|
|
475
|
-
if (Array.isArray(raw.schema)) {
|
|
476
|
-
for (const fieldRaw of raw.schema) {
|
|
477
|
-
if (Array.isArray(fieldRaw) && fieldRaw.length >= 2) {
|
|
478
|
-
const fieldName = fieldRaw[0];
|
|
479
|
-
schema[fieldName] = parseFieldInfo(fieldRaw);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
return {
|
|
484
|
-
name: raw.name,
|
|
485
|
-
dataType: raw.type.toLowerCase(),
|
|
486
|
-
prefixes: raw.prefixes,
|
|
487
|
-
...raw.language && { language: raw.language },
|
|
488
|
-
schema
|
|
489
|
-
};
|
|
508
|
+
return description;
|
|
490
509
|
}
|
|
491
510
|
function parseCountResponse(rawResponse) {
|
|
492
511
|
return typeof rawResponse === "number" ? rawResponse : parseInt(rawResponse, 10);
|
|
493
512
|
}
|
|
494
|
-
function kvArrayToObject(v) {
|
|
495
|
-
if (typeof v === "object" && v !== null && !Array.isArray(v)) return v;
|
|
496
|
-
if (!Array.isArray(v)) return {};
|
|
497
|
-
const obj = {};
|
|
498
|
-
for (let i = 0; i < v.length; i += 2) {
|
|
499
|
-
if (typeof v[i] === "string") obj[v[i]] = v[i + 1];
|
|
500
|
-
}
|
|
501
|
-
return obj;
|
|
502
|
-
}
|
|
503
|
-
function dotNotationToNested(obj) {
|
|
504
|
-
const result = {};
|
|
505
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
506
|
-
const parts = key.split(".");
|
|
507
|
-
let current = result;
|
|
508
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
509
|
-
const part = parts[i];
|
|
510
|
-
if (!(part in current)) {
|
|
511
|
-
current[part] = {};
|
|
512
|
-
}
|
|
513
|
-
current = current[part];
|
|
514
|
-
}
|
|
515
|
-
current[parts[parts.length - 1]] = value;
|
|
516
|
-
}
|
|
517
|
-
return result;
|
|
518
|
-
}
|
|
519
513
|
|
|
520
514
|
// pkg/commands/search/command-builder.ts
|
|
521
515
|
function buildQueryCommand(redisCommand, name, options) {
|
|
@@ -596,7 +590,7 @@ var SearchIndex = class {
|
|
|
596
590
|
this.client = client;
|
|
597
591
|
}
|
|
598
592
|
async waitIndexing() {
|
|
599
|
-
const command = ["SEARCH.
|
|
593
|
+
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
600
594
|
const result = await new ExecCommand(command).exec(
|
|
601
595
|
this.client
|
|
602
596
|
);
|
|
@@ -614,7 +608,7 @@ var SearchIndex = class {
|
|
|
614
608
|
const rawResult = await new ExecCommand(command).exec(
|
|
615
609
|
this.client
|
|
616
610
|
);
|
|
617
|
-
return deserializeQueryResponse(rawResult
|
|
611
|
+
return deserializeQueryResponse(rawResult);
|
|
618
612
|
}
|
|
619
613
|
async count({ filter }) {
|
|
620
614
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -4869,7 +4863,7 @@ var Redis = class {
|
|
|
4869
4863
|
};
|
|
4870
4864
|
|
|
4871
4865
|
// version.ts
|
|
4872
|
-
var VERSION = "v1.36.0-rc.
|
|
4866
|
+
var VERSION = "v1.36.0-rc.5";
|
|
4873
4867
|
|
|
4874
4868
|
export {
|
|
4875
4869
|
error_exports,
|
package/cloudflare.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-DtGaZZXE.mjs';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-DtGaZZXE.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, R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-DtGaZZXE.js';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-DtGaZZXE.js';
|
|
3
3
|
|
|
4
4
|
type Env = {
|
|
5
5
|
UPSTASH_DISABLE_TELEMETRY?: string;
|
package/cloudflare.js
CHANGED
|
@@ -2526,98 +2526,92 @@ function flattenSchema(schema, pathPrefix = []) {
|
|
|
2526
2526
|
}
|
|
2527
2527
|
return fields;
|
|
2528
2528
|
}
|
|
2529
|
-
function deserializeQueryResponse(rawResponse
|
|
2530
|
-
const hasEmptySelect = options?.select && Object.keys(options.select).length === 0;
|
|
2529
|
+
function deserializeQueryResponse(rawResponse) {
|
|
2531
2530
|
return rawResponse.map((itemRaw) => {
|
|
2532
2531
|
const raw = itemRaw;
|
|
2533
2532
|
const key = raw[0];
|
|
2534
2533
|
const score = raw[1];
|
|
2535
2534
|
const rawFields = raw[2];
|
|
2536
|
-
if (
|
|
2535
|
+
if (rawFields === void 0) {
|
|
2537
2536
|
return { key, score };
|
|
2538
2537
|
}
|
|
2539
2538
|
if (!Array.isArray(rawFields) || rawFields.length === 0) {
|
|
2540
2539
|
return { key, score, data: {} };
|
|
2541
2540
|
}
|
|
2542
|
-
|
|
2541
|
+
let data = {};
|
|
2543
2542
|
for (const fieldRaw of rawFields) {
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2543
|
+
const key2 = fieldRaw[0];
|
|
2544
|
+
const value = fieldRaw[1];
|
|
2545
|
+
const pathParts = key2.split(".");
|
|
2546
|
+
if (pathParts.length == 1) {
|
|
2547
|
+
data[key2] = value;
|
|
2548
|
+
} else {
|
|
2549
|
+
let currentObj = data;
|
|
2550
|
+
for (let i = 0; i < pathParts.length - 1; i++) {
|
|
2551
|
+
const pathPart = pathParts[i];
|
|
2552
|
+
if (!(pathPart in currentObj)) {
|
|
2553
|
+
currentObj[pathPart] = {};
|
|
2554
|
+
}
|
|
2555
|
+
currentObj = currentObj[pathPart];
|
|
2556
|
+
}
|
|
2557
|
+
currentObj[pathParts[pathParts.length - 1]] = value;
|
|
2558
|
+
}
|
|
2546
2559
|
}
|
|
2547
|
-
if ("$" in
|
|
2548
|
-
|
|
2549
|
-
return { key, score, data: data2 };
|
|
2560
|
+
if ("$" in data) {
|
|
2561
|
+
data = data["$"];
|
|
2550
2562
|
}
|
|
2551
|
-
const data = dotNotationToNested(mergedFields);
|
|
2552
2563
|
return { key, score, data };
|
|
2553
2564
|
});
|
|
2554
2565
|
}
|
|
2555
|
-
function
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
fieldInfo.noTokenize = true;
|
|
2566
|
+
function deserializeDescribeResponse(rawResponse) {
|
|
2567
|
+
const description = {};
|
|
2568
|
+
for (let i = 0; i < rawResponse.length; i += 2) {
|
|
2569
|
+
const descriptor = rawResponse[i];
|
|
2570
|
+
switch (descriptor) {
|
|
2571
|
+
case "name":
|
|
2572
|
+
description["name"] = rawResponse[i + 1];
|
|
2563
2573
|
break;
|
|
2564
|
-
case "
|
|
2565
|
-
|
|
2574
|
+
case "type":
|
|
2575
|
+
description["dataType"] = rawResponse[i + 1].toLowerCase();
|
|
2566
2576
|
break;
|
|
2567
|
-
case "
|
|
2568
|
-
|
|
2577
|
+
case "prefixes":
|
|
2578
|
+
description["prefixes"] = rawResponse[i + 1];
|
|
2579
|
+
break;
|
|
2580
|
+
case "language":
|
|
2581
|
+
description["language"] = rawResponse[i + 1];
|
|
2582
|
+
break;
|
|
2583
|
+
case "schema":
|
|
2584
|
+
const schema = {};
|
|
2585
|
+
for (const fieldDescription of rawResponse[i + 1]) {
|
|
2586
|
+
const fieldName = fieldDescription[0];
|
|
2587
|
+
const fieldInfo = { type: fieldDescription[1] };
|
|
2588
|
+
if (fieldDescription.length > 2) {
|
|
2589
|
+
for (let j = 2; j < fieldDescription.length; j++) {
|
|
2590
|
+
const fieldOption = fieldDescription[j];
|
|
2591
|
+
switch (fieldOption) {
|
|
2592
|
+
case "NOSTEM":
|
|
2593
|
+
fieldInfo.noStem = true;
|
|
2594
|
+
break;
|
|
2595
|
+
case "NOTOKENIZE":
|
|
2596
|
+
fieldInfo.noTokenize = true;
|
|
2597
|
+
break;
|
|
2598
|
+
case "FAST":
|
|
2599
|
+
fieldInfo.fast = true;
|
|
2600
|
+
break;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
schema[fieldName] = fieldInfo;
|
|
2605
|
+
}
|
|
2606
|
+
description["schema"] = schema;
|
|
2569
2607
|
break;
|
|
2570
2608
|
}
|
|
2571
2609
|
}
|
|
2572
|
-
return
|
|
2573
|
-
}
|
|
2574
|
-
function deserializeDescribeResponse(rawResponse) {
|
|
2575
|
-
const raw = kvArrayToObject(rawResponse);
|
|
2576
|
-
const schema = {};
|
|
2577
|
-
if (Array.isArray(raw.schema)) {
|
|
2578
|
-
for (const fieldRaw of raw.schema) {
|
|
2579
|
-
if (Array.isArray(fieldRaw) && fieldRaw.length >= 2) {
|
|
2580
|
-
const fieldName = fieldRaw[0];
|
|
2581
|
-
schema[fieldName] = parseFieldInfo(fieldRaw);
|
|
2582
|
-
}
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
return {
|
|
2586
|
-
name: raw.name,
|
|
2587
|
-
dataType: raw.type.toLowerCase(),
|
|
2588
|
-
prefixes: raw.prefixes,
|
|
2589
|
-
...raw.language && { language: raw.language },
|
|
2590
|
-
schema
|
|
2591
|
-
};
|
|
2610
|
+
return description;
|
|
2592
2611
|
}
|
|
2593
2612
|
function parseCountResponse(rawResponse) {
|
|
2594
2613
|
return typeof rawResponse === "number" ? rawResponse : parseInt(rawResponse, 10);
|
|
2595
2614
|
}
|
|
2596
|
-
function kvArrayToObject(v) {
|
|
2597
|
-
if (typeof v === "object" && v !== null && !Array.isArray(v)) return v;
|
|
2598
|
-
if (!Array.isArray(v)) return {};
|
|
2599
|
-
const obj = {};
|
|
2600
|
-
for (let i = 0; i < v.length; i += 2) {
|
|
2601
|
-
if (typeof v[i] === "string") obj[v[i]] = v[i + 1];
|
|
2602
|
-
}
|
|
2603
|
-
return obj;
|
|
2604
|
-
}
|
|
2605
|
-
function dotNotationToNested(obj) {
|
|
2606
|
-
const result = {};
|
|
2607
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2608
|
-
const parts = key.split(".");
|
|
2609
|
-
let current = result;
|
|
2610
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
2611
|
-
const part = parts[i];
|
|
2612
|
-
if (!(part in current)) {
|
|
2613
|
-
current[part] = {};
|
|
2614
|
-
}
|
|
2615
|
-
current = current[part];
|
|
2616
|
-
}
|
|
2617
|
-
current[parts[parts.length - 1]] = value;
|
|
2618
|
-
}
|
|
2619
|
-
return result;
|
|
2620
|
-
}
|
|
2621
2615
|
|
|
2622
2616
|
// pkg/commands/search/command-builder.ts
|
|
2623
2617
|
function buildQueryCommand(redisCommand, name, options) {
|
|
@@ -2698,7 +2692,7 @@ var SearchIndex = class {
|
|
|
2698
2692
|
this.client = client;
|
|
2699
2693
|
}
|
|
2700
2694
|
async waitIndexing() {
|
|
2701
|
-
const command = ["SEARCH.
|
|
2695
|
+
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
2702
2696
|
const result = await new ExecCommand(command).exec(
|
|
2703
2697
|
this.client
|
|
2704
2698
|
);
|
|
@@ -2716,7 +2710,7 @@ var SearchIndex = class {
|
|
|
2716
2710
|
const rawResult = await new ExecCommand(command).exec(
|
|
2717
2711
|
this.client
|
|
2718
2712
|
);
|
|
2719
|
-
return deserializeQueryResponse(rawResult
|
|
2713
|
+
return deserializeQueryResponse(rawResult);
|
|
2720
2714
|
}
|
|
2721
2715
|
async count({ filter }) {
|
|
2722
2716
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -4865,7 +4859,7 @@ var Redis = class {
|
|
|
4865
4859
|
};
|
|
4866
4860
|
|
|
4867
4861
|
// version.ts
|
|
4868
|
-
var VERSION = "v1.36.0-rc.
|
|
4862
|
+
var VERSION = "v1.36.0-rc.5";
|
|
4869
4863
|
|
|
4870
4864
|
// platforms/cloudflare.ts
|
|
4871
4865
|
var Redis2 = class _Redis extends Redis {
|
package/cloudflare.mjs
CHANGED
package/fastly.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-DtGaZZXE.mjs';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-DtGaZZXE.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|
package/fastly.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-DtGaZZXE.js';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, d as Requester, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, e as errors } from './zmscore-DtGaZZXE.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|
package/fastly.js
CHANGED
|
@@ -2526,98 +2526,92 @@ function flattenSchema(schema, pathPrefix = []) {
|
|
|
2526
2526
|
}
|
|
2527
2527
|
return fields;
|
|
2528
2528
|
}
|
|
2529
|
-
function deserializeQueryResponse(rawResponse
|
|
2530
|
-
const hasEmptySelect = options?.select && Object.keys(options.select).length === 0;
|
|
2529
|
+
function deserializeQueryResponse(rawResponse) {
|
|
2531
2530
|
return rawResponse.map((itemRaw) => {
|
|
2532
2531
|
const raw = itemRaw;
|
|
2533
2532
|
const key = raw[0];
|
|
2534
2533
|
const score = raw[1];
|
|
2535
2534
|
const rawFields = raw[2];
|
|
2536
|
-
if (
|
|
2535
|
+
if (rawFields === void 0) {
|
|
2537
2536
|
return { key, score };
|
|
2538
2537
|
}
|
|
2539
2538
|
if (!Array.isArray(rawFields) || rawFields.length === 0) {
|
|
2540
2539
|
return { key, score, data: {} };
|
|
2541
2540
|
}
|
|
2542
|
-
|
|
2541
|
+
let data = {};
|
|
2543
2542
|
for (const fieldRaw of rawFields) {
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2543
|
+
const key2 = fieldRaw[0];
|
|
2544
|
+
const value = fieldRaw[1];
|
|
2545
|
+
const pathParts = key2.split(".");
|
|
2546
|
+
if (pathParts.length == 1) {
|
|
2547
|
+
data[key2] = value;
|
|
2548
|
+
} else {
|
|
2549
|
+
let currentObj = data;
|
|
2550
|
+
for (let i = 0; i < pathParts.length - 1; i++) {
|
|
2551
|
+
const pathPart = pathParts[i];
|
|
2552
|
+
if (!(pathPart in currentObj)) {
|
|
2553
|
+
currentObj[pathPart] = {};
|
|
2554
|
+
}
|
|
2555
|
+
currentObj = currentObj[pathPart];
|
|
2556
|
+
}
|
|
2557
|
+
currentObj[pathParts[pathParts.length - 1]] = value;
|
|
2558
|
+
}
|
|
2546
2559
|
}
|
|
2547
|
-
if ("$" in
|
|
2548
|
-
|
|
2549
|
-
return { key, score, data: data2 };
|
|
2560
|
+
if ("$" in data) {
|
|
2561
|
+
data = data["$"];
|
|
2550
2562
|
}
|
|
2551
|
-
const data = dotNotationToNested(mergedFields);
|
|
2552
2563
|
return { key, score, data };
|
|
2553
2564
|
});
|
|
2554
2565
|
}
|
|
2555
|
-
function
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
fieldInfo.noTokenize = true;
|
|
2566
|
+
function deserializeDescribeResponse(rawResponse) {
|
|
2567
|
+
const description = {};
|
|
2568
|
+
for (let i = 0; i < rawResponse.length; i += 2) {
|
|
2569
|
+
const descriptor = rawResponse[i];
|
|
2570
|
+
switch (descriptor) {
|
|
2571
|
+
case "name":
|
|
2572
|
+
description["name"] = rawResponse[i + 1];
|
|
2563
2573
|
break;
|
|
2564
|
-
case "
|
|
2565
|
-
|
|
2574
|
+
case "type":
|
|
2575
|
+
description["dataType"] = rawResponse[i + 1].toLowerCase();
|
|
2566
2576
|
break;
|
|
2567
|
-
case "
|
|
2568
|
-
|
|
2577
|
+
case "prefixes":
|
|
2578
|
+
description["prefixes"] = rawResponse[i + 1];
|
|
2579
|
+
break;
|
|
2580
|
+
case "language":
|
|
2581
|
+
description["language"] = rawResponse[i + 1];
|
|
2582
|
+
break;
|
|
2583
|
+
case "schema":
|
|
2584
|
+
const schema = {};
|
|
2585
|
+
for (const fieldDescription of rawResponse[i + 1]) {
|
|
2586
|
+
const fieldName = fieldDescription[0];
|
|
2587
|
+
const fieldInfo = { type: fieldDescription[1] };
|
|
2588
|
+
if (fieldDescription.length > 2) {
|
|
2589
|
+
for (let j = 2; j < fieldDescription.length; j++) {
|
|
2590
|
+
const fieldOption = fieldDescription[j];
|
|
2591
|
+
switch (fieldOption) {
|
|
2592
|
+
case "NOSTEM":
|
|
2593
|
+
fieldInfo.noStem = true;
|
|
2594
|
+
break;
|
|
2595
|
+
case "NOTOKENIZE":
|
|
2596
|
+
fieldInfo.noTokenize = true;
|
|
2597
|
+
break;
|
|
2598
|
+
case "FAST":
|
|
2599
|
+
fieldInfo.fast = true;
|
|
2600
|
+
break;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
schema[fieldName] = fieldInfo;
|
|
2605
|
+
}
|
|
2606
|
+
description["schema"] = schema;
|
|
2569
2607
|
break;
|
|
2570
2608
|
}
|
|
2571
2609
|
}
|
|
2572
|
-
return
|
|
2573
|
-
}
|
|
2574
|
-
function deserializeDescribeResponse(rawResponse) {
|
|
2575
|
-
const raw = kvArrayToObject(rawResponse);
|
|
2576
|
-
const schema = {};
|
|
2577
|
-
if (Array.isArray(raw.schema)) {
|
|
2578
|
-
for (const fieldRaw of raw.schema) {
|
|
2579
|
-
if (Array.isArray(fieldRaw) && fieldRaw.length >= 2) {
|
|
2580
|
-
const fieldName = fieldRaw[0];
|
|
2581
|
-
schema[fieldName] = parseFieldInfo(fieldRaw);
|
|
2582
|
-
}
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
return {
|
|
2586
|
-
name: raw.name,
|
|
2587
|
-
dataType: raw.type.toLowerCase(),
|
|
2588
|
-
prefixes: raw.prefixes,
|
|
2589
|
-
...raw.language && { language: raw.language },
|
|
2590
|
-
schema
|
|
2591
|
-
};
|
|
2610
|
+
return description;
|
|
2592
2611
|
}
|
|
2593
2612
|
function parseCountResponse(rawResponse) {
|
|
2594
2613
|
return typeof rawResponse === "number" ? rawResponse : parseInt(rawResponse, 10);
|
|
2595
2614
|
}
|
|
2596
|
-
function kvArrayToObject(v) {
|
|
2597
|
-
if (typeof v === "object" && v !== null && !Array.isArray(v)) return v;
|
|
2598
|
-
if (!Array.isArray(v)) return {};
|
|
2599
|
-
const obj = {};
|
|
2600
|
-
for (let i = 0; i < v.length; i += 2) {
|
|
2601
|
-
if (typeof v[i] === "string") obj[v[i]] = v[i + 1];
|
|
2602
|
-
}
|
|
2603
|
-
return obj;
|
|
2604
|
-
}
|
|
2605
|
-
function dotNotationToNested(obj) {
|
|
2606
|
-
const result = {};
|
|
2607
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2608
|
-
const parts = key.split(".");
|
|
2609
|
-
let current = result;
|
|
2610
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
2611
|
-
const part = parts[i];
|
|
2612
|
-
if (!(part in current)) {
|
|
2613
|
-
current[part] = {};
|
|
2614
|
-
}
|
|
2615
|
-
current = current[part];
|
|
2616
|
-
}
|
|
2617
|
-
current[parts[parts.length - 1]] = value;
|
|
2618
|
-
}
|
|
2619
|
-
return result;
|
|
2620
|
-
}
|
|
2621
2615
|
|
|
2622
2616
|
// pkg/commands/search/command-builder.ts
|
|
2623
2617
|
function buildQueryCommand(redisCommand, name, options) {
|
|
@@ -2698,7 +2692,7 @@ var SearchIndex = class {
|
|
|
2698
2692
|
this.client = client;
|
|
2699
2693
|
}
|
|
2700
2694
|
async waitIndexing() {
|
|
2701
|
-
const command = ["SEARCH.
|
|
2695
|
+
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
2702
2696
|
const result = await new ExecCommand(command).exec(
|
|
2703
2697
|
this.client
|
|
2704
2698
|
);
|
|
@@ -2716,7 +2710,7 @@ var SearchIndex = class {
|
|
|
2716
2710
|
const rawResult = await new ExecCommand(command).exec(
|
|
2717
2711
|
this.client
|
|
2718
2712
|
);
|
|
2719
|
-
return deserializeQueryResponse(rawResult
|
|
2713
|
+
return deserializeQueryResponse(rawResult);
|
|
2720
2714
|
}
|
|
2721
2715
|
async count({ filter }) {
|
|
2722
2716
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -4865,7 +4859,7 @@ var Redis = class {
|
|
|
4865
4859
|
};
|
|
4866
4860
|
|
|
4867
4861
|
// version.ts
|
|
4868
|
-
var VERSION = "v1.36.0-rc.
|
|
4862
|
+
var VERSION = "v1.36.0-rc.5";
|
|
4869
4863
|
|
|
4870
4864
|
// platforms/fastly.ts
|
|
4871
4865
|
var Redis2 = class extends Redis {
|
package/fastly.mjs
CHANGED
package/nodejs.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NumericField, a as NestedIndexSchema, H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1, d as Requester } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, c8 as FlatIndexSchema, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, c6 as SearchIndexProps, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, c4 as createIndex, c7 as createIndexProps, e as errors, c5 as index } from './zmscore-
|
|
1
|
+
import { N as NumericField, a as NestedIndexSchema, H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1, d as Requester } from './zmscore-DtGaZZXE.mjs';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, c8 as FlatIndexSchema, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, c6 as SearchIndexProps, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, c4 as createIndex, c7 as createIndexProps, e as errors, c5 as index } from './zmscore-DtGaZZXE.mjs';
|
|
3
3
|
|
|
4
4
|
declare const BUILD: unique symbol;
|
|
5
5
|
declare class TextFieldBuilder<NoTokenize extends Record<"noTokenize", boolean> = {
|
package/nodejs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NumericField, a as NestedIndexSchema, H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1, d as Requester } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, c8 as FlatIndexSchema, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, c6 as SearchIndexProps, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, c4 as createIndex, c7 as createIndexProps, e as errors, c5 as index } from './zmscore-
|
|
1
|
+
import { N as NumericField, a as NestedIndexSchema, H as HttpClientConfig, R as RedisOptions, b as RequesterConfig, c as Redis$1, d as Requester } from './zmscore-DtGaZZXE.js';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, g as BitOpCommand, h as BitPosCommand, C as CopyCommand, D as DBSizeCommand, j as DecrByCommand, i as DecrCommand, k as DelCommand, E as EchoCommand, m as EvalCommand, l as EvalROCommand, o as EvalshaCommand, n as EvalshaROCommand, p as ExistsCommand, s as ExpireAtCommand, q as ExpireCommand, r as ExpireOption, c8 as FlatIndexSchema, F as FlushAllCommand, t as FlushDBCommand, G as GeoAddCommand, u as GeoAddCommandOptions, w as GeoDistCommand, x as GeoHashCommand, v as GeoMember, y as GeoPosCommand, z as GeoSearchCommand, I as GeoSearchStoreCommand, K as GetBitCommand, J as GetCommand, L as GetDelCommand, M as GetExCommand, O as GetRangeCommand, Q as GetSetCommand, S as HDelCommand, T as HExistsCommand, W as HExpireAtCommand, V as HExpireCommand, X as HExpireTimeCommand, a3 as HGetAllCommand, a2 as HGetCommand, a4 as HIncrByCommand, a5 as HIncrByFloatCommand, a6 as HKeysCommand, a7 as HLenCommand, a8 as HMGetCommand, a9 as HMSetCommand, _ as HPExpireAtCommand, Z as HPExpireCommand, $ as HPExpireTimeCommand, a0 as HPTtlCommand, a1 as HPersistCommand, aa as HRandFieldCommand, ab as HScanCommand, ac as HSetCommand, ad as HSetNXCommand, ae as HStrLenCommand, Y as HTtlCommand, af as HValsCommand, ah as IncrByCommand, ai as IncrByFloatCommand, ag as IncrCommand, aj as JsonArrAppendCommand, ak as JsonArrIndexCommand, al as JsonArrInsertCommand, am as JsonArrLenCommand, an as JsonArrPopCommand, ao as JsonArrTrimCommand, ap as JsonClearCommand, aq as JsonDelCommand, ar as JsonForgetCommand, as as JsonGetCommand, au as JsonMGetCommand, at as JsonMergeCommand, av as JsonNumIncrByCommand, aw as JsonNumMultByCommand, ax as JsonObjKeysCommand, ay as JsonObjLenCommand, az as JsonRespCommand, aA as JsonSetCommand, aB as JsonStrAppendCommand, aC as JsonStrLenCommand, aD as JsonToggleCommand, aE as JsonTypeCommand, aF as KeysCommand, aG as LIndexCommand, aH as LInsertCommand, aI as LLenCommand, aJ as LMoveCommand, aK as LPopCommand, aL as LPushCommand, aM as LPushXCommand, aN as LRangeCommand, aO as LRemCommand, aP as LSetCommand, aQ as LTrimCommand, aR as MGetCommand, aS as MSetCommand, aT as MSetNXCommand, aW as PExpireAtCommand, aV as PExpireCommand, aY as PSetEXCommand, aZ as PTtlCommand, aU as PersistCommand, aX as PingCommand, P as Pipeline, a_ as PublishCommand, b2 as RPopCommand, b3 as RPushCommand, b4 as RPushXCommand, a$ as RandomKeyCommand, b0 as RenameCommand, b1 as RenameNXCommand, b5 as SAddCommand, b8 as SCardCommand, bc as SDiffCommand, bd as SDiffStoreCommand, bk as SInterCommand, bl as SInterStoreCommand, bm as SIsMemberCommand, bo as SMIsMemberCommand, bn as SMembersCommand, bp as SMoveCommand, bq as SPopCommand, br as SRandMemberCommand, bs as SRemCommand, bt as SScanCommand, bv as SUnionCommand, bw as SUnionStoreCommand, b6 as ScanCommand, b7 as ScanCommandOptions, bF as ScoreMember, b9 as ScriptExistsCommand, ba as ScriptFlushCommand, bb as ScriptLoadCommand, c6 as SearchIndexProps, bg as SetBitCommand, be as SetCommand, bf as SetCommandOptions, bh as SetExCommand, bi as SetNxCommand, bj as SetRangeCommand, bu as StrLenCommand, bx as TimeCommand, by as TouchCommand, bz as TtlCommand, bA as Type, bB as TypeCommand, bC as UnlinkCommand, U as UpstashRequest, f as UpstashResponse, bD as XAddCommand, bE as XRangeCommand, bH as ZAddCommand, bG as ZAddCommandOptions, bI as ZCardCommand, bJ as ZCountCommand, bK as ZDiffStoreCommand, bL as ZIncrByCommand, bM as ZInterStoreCommand, bN as ZInterStoreCommandOptions, bO as ZLexCountCommand, bP as ZMScoreCommand, bQ as ZPopMaxCommand, bR as ZPopMinCommand, bS as ZRangeCommand, bT as ZRangeCommandOptions, bU as ZRankCommand, bV as ZRemCommand, bW as ZRemRangeByLexCommand, bX as ZRemRangeByRankCommand, bY as ZRemRangeByScoreCommand, bZ as ZRevRankCommand, b_ as ZScanCommand, b$ as ZScoreCommand, c0 as ZUnionCommand, c1 as ZUnionCommandOptions, c2 as ZUnionStoreCommand, c3 as ZUnionStoreCommandOptions, c4 as createIndex, c7 as createIndexProps, e as errors, c5 as index } from './zmscore-DtGaZZXE.js';
|
|
3
3
|
|
|
4
4
|
declare const BUILD: unique symbol;
|
|
5
5
|
declare class TextFieldBuilder<NoTokenize extends Record<"noTokenize", boolean> = {
|
package/nodejs.js
CHANGED
|
@@ -2529,98 +2529,92 @@ function flattenSchema(schema, pathPrefix = []) {
|
|
|
2529
2529
|
}
|
|
2530
2530
|
return fields;
|
|
2531
2531
|
}
|
|
2532
|
-
function deserializeQueryResponse(rawResponse
|
|
2533
|
-
const hasEmptySelect = options?.select && Object.keys(options.select).length === 0;
|
|
2532
|
+
function deserializeQueryResponse(rawResponse) {
|
|
2534
2533
|
return rawResponse.map((itemRaw) => {
|
|
2535
2534
|
const raw = itemRaw;
|
|
2536
2535
|
const key = raw[0];
|
|
2537
2536
|
const score = raw[1];
|
|
2538
2537
|
const rawFields = raw[2];
|
|
2539
|
-
if (
|
|
2538
|
+
if (rawFields === void 0) {
|
|
2540
2539
|
return { key, score };
|
|
2541
2540
|
}
|
|
2542
2541
|
if (!Array.isArray(rawFields) || rawFields.length === 0) {
|
|
2543
2542
|
return { key, score, data: {} };
|
|
2544
2543
|
}
|
|
2545
|
-
|
|
2544
|
+
let data = {};
|
|
2546
2545
|
for (const fieldRaw of rawFields) {
|
|
2547
|
-
const
|
|
2548
|
-
|
|
2546
|
+
const key2 = fieldRaw[0];
|
|
2547
|
+
const value = fieldRaw[1];
|
|
2548
|
+
const pathParts = key2.split(".");
|
|
2549
|
+
if (pathParts.length == 1) {
|
|
2550
|
+
data[key2] = value;
|
|
2551
|
+
} else {
|
|
2552
|
+
let currentObj = data;
|
|
2553
|
+
for (let i = 0; i < pathParts.length - 1; i++) {
|
|
2554
|
+
const pathPart = pathParts[i];
|
|
2555
|
+
if (!(pathPart in currentObj)) {
|
|
2556
|
+
currentObj[pathPart] = {};
|
|
2557
|
+
}
|
|
2558
|
+
currentObj = currentObj[pathPart];
|
|
2559
|
+
}
|
|
2560
|
+
currentObj[pathParts[pathParts.length - 1]] = value;
|
|
2561
|
+
}
|
|
2549
2562
|
}
|
|
2550
|
-
if ("$" in
|
|
2551
|
-
|
|
2552
|
-
return { key, score, data: data2 };
|
|
2563
|
+
if ("$" in data) {
|
|
2564
|
+
data = data["$"];
|
|
2553
2565
|
}
|
|
2554
|
-
const data = dotNotationToNested(mergedFields);
|
|
2555
2566
|
return { key, score, data };
|
|
2556
2567
|
});
|
|
2557
2568
|
}
|
|
2558
|
-
function
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
fieldInfo.noTokenize = true;
|
|
2569
|
+
function deserializeDescribeResponse(rawResponse) {
|
|
2570
|
+
const description = {};
|
|
2571
|
+
for (let i = 0; i < rawResponse.length; i += 2) {
|
|
2572
|
+
const descriptor = rawResponse[i];
|
|
2573
|
+
switch (descriptor) {
|
|
2574
|
+
case "name":
|
|
2575
|
+
description["name"] = rawResponse[i + 1];
|
|
2566
2576
|
break;
|
|
2567
|
-
case "
|
|
2568
|
-
|
|
2577
|
+
case "type":
|
|
2578
|
+
description["dataType"] = rawResponse[i + 1].toLowerCase();
|
|
2569
2579
|
break;
|
|
2570
|
-
case "
|
|
2571
|
-
|
|
2580
|
+
case "prefixes":
|
|
2581
|
+
description["prefixes"] = rawResponse[i + 1];
|
|
2582
|
+
break;
|
|
2583
|
+
case "language":
|
|
2584
|
+
description["language"] = rawResponse[i + 1];
|
|
2585
|
+
break;
|
|
2586
|
+
case "schema":
|
|
2587
|
+
const schema = {};
|
|
2588
|
+
for (const fieldDescription of rawResponse[i + 1]) {
|
|
2589
|
+
const fieldName = fieldDescription[0];
|
|
2590
|
+
const fieldInfo = { type: fieldDescription[1] };
|
|
2591
|
+
if (fieldDescription.length > 2) {
|
|
2592
|
+
for (let j = 2; j < fieldDescription.length; j++) {
|
|
2593
|
+
const fieldOption = fieldDescription[j];
|
|
2594
|
+
switch (fieldOption) {
|
|
2595
|
+
case "NOSTEM":
|
|
2596
|
+
fieldInfo.noStem = true;
|
|
2597
|
+
break;
|
|
2598
|
+
case "NOTOKENIZE":
|
|
2599
|
+
fieldInfo.noTokenize = true;
|
|
2600
|
+
break;
|
|
2601
|
+
case "FAST":
|
|
2602
|
+
fieldInfo.fast = true;
|
|
2603
|
+
break;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
schema[fieldName] = fieldInfo;
|
|
2608
|
+
}
|
|
2609
|
+
description["schema"] = schema;
|
|
2572
2610
|
break;
|
|
2573
2611
|
}
|
|
2574
2612
|
}
|
|
2575
|
-
return
|
|
2576
|
-
}
|
|
2577
|
-
function deserializeDescribeResponse(rawResponse) {
|
|
2578
|
-
const raw = kvArrayToObject(rawResponse);
|
|
2579
|
-
const schema = {};
|
|
2580
|
-
if (Array.isArray(raw.schema)) {
|
|
2581
|
-
for (const fieldRaw of raw.schema) {
|
|
2582
|
-
if (Array.isArray(fieldRaw) && fieldRaw.length >= 2) {
|
|
2583
|
-
const fieldName = fieldRaw[0];
|
|
2584
|
-
schema[fieldName] = parseFieldInfo(fieldRaw);
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
}
|
|
2588
|
-
return {
|
|
2589
|
-
name: raw.name,
|
|
2590
|
-
dataType: raw.type.toLowerCase(),
|
|
2591
|
-
prefixes: raw.prefixes,
|
|
2592
|
-
...raw.language && { language: raw.language },
|
|
2593
|
-
schema
|
|
2594
|
-
};
|
|
2613
|
+
return description;
|
|
2595
2614
|
}
|
|
2596
2615
|
function parseCountResponse(rawResponse) {
|
|
2597
2616
|
return typeof rawResponse === "number" ? rawResponse : parseInt(rawResponse, 10);
|
|
2598
2617
|
}
|
|
2599
|
-
function kvArrayToObject(v) {
|
|
2600
|
-
if (typeof v === "object" && v !== null && !Array.isArray(v)) return v;
|
|
2601
|
-
if (!Array.isArray(v)) return {};
|
|
2602
|
-
const obj = {};
|
|
2603
|
-
for (let i = 0; i < v.length; i += 2) {
|
|
2604
|
-
if (typeof v[i] === "string") obj[v[i]] = v[i + 1];
|
|
2605
|
-
}
|
|
2606
|
-
return obj;
|
|
2607
|
-
}
|
|
2608
|
-
function dotNotationToNested(obj) {
|
|
2609
|
-
const result = {};
|
|
2610
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2611
|
-
const parts = key.split(".");
|
|
2612
|
-
let current = result;
|
|
2613
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
2614
|
-
const part = parts[i];
|
|
2615
|
-
if (!(part in current)) {
|
|
2616
|
-
current[part] = {};
|
|
2617
|
-
}
|
|
2618
|
-
current = current[part];
|
|
2619
|
-
}
|
|
2620
|
-
current[parts[parts.length - 1]] = value;
|
|
2621
|
-
}
|
|
2622
|
-
return result;
|
|
2623
|
-
}
|
|
2624
2618
|
|
|
2625
2619
|
// pkg/commands/search/command-builder.ts
|
|
2626
2620
|
function buildQueryCommand(redisCommand, name, options) {
|
|
@@ -2701,7 +2695,7 @@ var SearchIndex = class {
|
|
|
2701
2695
|
this.client = client;
|
|
2702
2696
|
}
|
|
2703
2697
|
async waitIndexing() {
|
|
2704
|
-
const command = ["SEARCH.
|
|
2698
|
+
const command = ["SEARCH.WAITINDEXING", this.name];
|
|
2705
2699
|
const result = await new ExecCommand(command).exec(
|
|
2706
2700
|
this.client
|
|
2707
2701
|
);
|
|
@@ -2719,7 +2713,7 @@ var SearchIndex = class {
|
|
|
2719
2713
|
const rawResult = await new ExecCommand(command).exec(
|
|
2720
2714
|
this.client
|
|
2721
2715
|
);
|
|
2722
|
-
return deserializeQueryResponse(rawResult
|
|
2716
|
+
return deserializeQueryResponse(rawResult);
|
|
2723
2717
|
}
|
|
2724
2718
|
async count({ filter }) {
|
|
2725
2719
|
const command = buildQueryCommand("SEARCH.COUNT", this.name, { filter });
|
|
@@ -4893,7 +4887,7 @@ var Redis = class {
|
|
|
4893
4887
|
};
|
|
4894
4888
|
|
|
4895
4889
|
// version.ts
|
|
4896
|
-
var VERSION = "v1.36.0-rc.
|
|
4890
|
+
var VERSION = "v1.36.0-rc.5";
|
|
4897
4891
|
|
|
4898
4892
|
// platforms/nodejs.ts
|
|
4899
4893
|
if (typeof atob === "undefined") {
|
package/nodejs.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/redis","version":"v1.36.0-rc.
|
|
1
|
+
{"name":"@upstash/redis","version":"v1.36.0-rc.5","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"}}
|
|
@@ -421,7 +421,17 @@ type StringOperationMap<T extends string> = {
|
|
|
421
421
|
distance?: number;
|
|
422
422
|
transpositionCostOne?: boolean;
|
|
423
423
|
};
|
|
424
|
-
$phrase: T
|
|
424
|
+
$phrase: T | {
|
|
425
|
+
value: T;
|
|
426
|
+
} | {
|
|
427
|
+
value: T;
|
|
428
|
+
slop: number;
|
|
429
|
+
prefix?: never;
|
|
430
|
+
} | {
|
|
431
|
+
value: T;
|
|
432
|
+
prefix: boolean;
|
|
433
|
+
slop?: never;
|
|
434
|
+
};
|
|
425
435
|
$regex: T;
|
|
426
436
|
};
|
|
427
437
|
type NumberOperationMap<T extends number> = {
|
|
@@ -442,6 +452,10 @@ type DateOperationMap<T extends string | Date> = {
|
|
|
442
452
|
$eq: T;
|
|
443
453
|
$ne: T;
|
|
444
454
|
$in: T[];
|
|
455
|
+
$gt: T;
|
|
456
|
+
$gte: T;
|
|
457
|
+
$lte: T;
|
|
458
|
+
$lt: T;
|
|
445
459
|
};
|
|
446
460
|
type StringOperations = {
|
|
447
461
|
[K in keyof StringOperationMap<string>]: {
|
|
@@ -573,7 +587,7 @@ type BoolNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TS
|
|
|
573
587
|
$or?: never;
|
|
574
588
|
};
|
|
575
589
|
type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | OrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | NotNode<TSchema> | AndNotNode<TSchema> | OrNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
|
|
576
|
-
type RootQueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | RootOrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> |
|
|
590
|
+
type RootQueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | RootOrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | AndNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
|
|
577
591
|
type RootOrNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
578
592
|
[P in SchemaPaths<TSchema>]?: never;
|
|
579
593
|
} & {
|
|
@@ -592,7 +606,7 @@ type DescribeFieldInfo = {
|
|
|
592
606
|
};
|
|
593
607
|
type IndexDescription<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
594
608
|
name: string;
|
|
595
|
-
dataType: "hash" | "string";
|
|
609
|
+
dataType: "hash" | "string" | "json";
|
|
596
610
|
prefixes: string[];
|
|
597
611
|
language?: Language;
|
|
598
612
|
schema: Record<SchemaPaths<TSchema>, DescribeFieldInfo>;
|
|
@@ -607,6 +621,9 @@ type createIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
|
607
621
|
} & ({
|
|
608
622
|
dataType: "string";
|
|
609
623
|
schema: TSchema extends NestedIndexSchema ? TSchema : never;
|
|
624
|
+
} | {
|
|
625
|
+
dataType: "json";
|
|
626
|
+
schema: TSchema extends NestedIndexSchema ? TSchema : never;
|
|
610
627
|
} | {
|
|
611
628
|
dataType: "hash";
|
|
612
629
|
schema: TSchema extends FlatIndexSchema ? TSchema : never;
|
|
@@ -631,7 +648,7 @@ declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema> {
|
|
|
631
648
|
}>;
|
|
632
649
|
drop(): Promise<string>;
|
|
633
650
|
}
|
|
634
|
-
declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
651
|
+
declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
635
652
|
declare function index<TSchema extends NestedIndexSchema | FlatIndexSchema>(client: Requester, name: string, schema: TSchema): SearchIndex<TSchema>;
|
|
636
653
|
declare function index(client: Requester, name: string): SearchIndex<any>;
|
|
637
654
|
|
|
@@ -3473,7 +3490,7 @@ declare class Redis {
|
|
|
3473
3490
|
readonly?: TReadonly;
|
|
3474
3491
|
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3475
3492
|
get search(): {
|
|
3476
|
-
createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
3493
|
+
createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
3477
3494
|
index: <TSchema extends NestedIndexSchema | FlatIndexSchema>(name: string, schema?: TSchema extends NestedIndexSchema ? TSchema : never) => SearchIndex<TSchema>;
|
|
3478
3495
|
};
|
|
3479
3496
|
/**
|
|
@@ -421,7 +421,17 @@ type StringOperationMap<T extends string> = {
|
|
|
421
421
|
distance?: number;
|
|
422
422
|
transpositionCostOne?: boolean;
|
|
423
423
|
};
|
|
424
|
-
$phrase: T
|
|
424
|
+
$phrase: T | {
|
|
425
|
+
value: T;
|
|
426
|
+
} | {
|
|
427
|
+
value: T;
|
|
428
|
+
slop: number;
|
|
429
|
+
prefix?: never;
|
|
430
|
+
} | {
|
|
431
|
+
value: T;
|
|
432
|
+
prefix: boolean;
|
|
433
|
+
slop?: never;
|
|
434
|
+
};
|
|
425
435
|
$regex: T;
|
|
426
436
|
};
|
|
427
437
|
type NumberOperationMap<T extends number> = {
|
|
@@ -442,6 +452,10 @@ type DateOperationMap<T extends string | Date> = {
|
|
|
442
452
|
$eq: T;
|
|
443
453
|
$ne: T;
|
|
444
454
|
$in: T[];
|
|
455
|
+
$gt: T;
|
|
456
|
+
$gte: T;
|
|
457
|
+
$lte: T;
|
|
458
|
+
$lt: T;
|
|
445
459
|
};
|
|
446
460
|
type StringOperations = {
|
|
447
461
|
[K in keyof StringOperationMap<string>]: {
|
|
@@ -573,7 +587,7 @@ type BoolNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TS
|
|
|
573
587
|
$or?: never;
|
|
574
588
|
};
|
|
575
589
|
type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | OrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | NotNode<TSchema> | AndNotNode<TSchema> | OrNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
|
|
576
|
-
type RootQueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | RootOrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> |
|
|
590
|
+
type RootQueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | RootOrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | AndNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
|
|
577
591
|
type RootOrNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
578
592
|
[P in SchemaPaths<TSchema>]?: never;
|
|
579
593
|
} & {
|
|
@@ -592,7 +606,7 @@ type DescribeFieldInfo = {
|
|
|
592
606
|
};
|
|
593
607
|
type IndexDescription<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
594
608
|
name: string;
|
|
595
|
-
dataType: "hash" | "string";
|
|
609
|
+
dataType: "hash" | "string" | "json";
|
|
596
610
|
prefixes: string[];
|
|
597
611
|
language?: Language;
|
|
598
612
|
schema: Record<SchemaPaths<TSchema>, DescribeFieldInfo>;
|
|
@@ -607,6 +621,9 @@ type createIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
|
607
621
|
} & ({
|
|
608
622
|
dataType: "string";
|
|
609
623
|
schema: TSchema extends NestedIndexSchema ? TSchema : never;
|
|
624
|
+
} | {
|
|
625
|
+
dataType: "json";
|
|
626
|
+
schema: TSchema extends NestedIndexSchema ? TSchema : never;
|
|
610
627
|
} | {
|
|
611
628
|
dataType: "hash";
|
|
612
629
|
schema: TSchema extends FlatIndexSchema ? TSchema : never;
|
|
@@ -631,7 +648,7 @@ declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema> {
|
|
|
631
648
|
}>;
|
|
632
649
|
drop(): Promise<string>;
|
|
633
650
|
}
|
|
634
|
-
declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
651
|
+
declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
635
652
|
declare function index<TSchema extends NestedIndexSchema | FlatIndexSchema>(client: Requester, name: string, schema: TSchema): SearchIndex<TSchema>;
|
|
636
653
|
declare function index(client: Requester, name: string): SearchIndex<any>;
|
|
637
654
|
|
|
@@ -3473,7 +3490,7 @@ declare class Redis {
|
|
|
3473
3490
|
readonly?: TReadonly;
|
|
3474
3491
|
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3475
3492
|
get search(): {
|
|
3476
|
-
createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
3493
|
+
createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
|
|
3477
3494
|
index: <TSchema extends NestedIndexSchema | FlatIndexSchema>(name: string, schema?: TSchema extends NestedIndexSchema ? TSchema : never) => SearchIndex<TSchema>;
|
|
3478
3495
|
};
|
|
3479
3496
|
/**
|