@upstash/redis 1.36.0-rc.3 → 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.
@@ -424,98 +424,92 @@ function flattenSchema(schema, pathPrefix = []) {
424
424
  }
425
425
  return fields;
426
426
  }
427
- function deserializeQueryResponse(rawResponse, options) {
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 (hasEmptySelect) {
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
- const mergedFields = {};
439
+ let data = {};
441
440
  for (const fieldRaw of rawFields) {
442
- const fieldObj = kvArrayToObject(fieldRaw);
443
- Object.assign(mergedFields, fieldObj);
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 mergedFields) {
446
- const data2 = mergedFields["$"];
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 parseFieldInfo(fieldRaw) {
454
- const fieldType = fieldRaw[1];
455
- const options = fieldRaw.slice(2);
456
- const fieldInfo = { type: fieldType };
457
- for (const option of options) {
458
- switch (option.toUpperCase()) {
459
- case "NOTOKENIZE":
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 "NOSTEM":
463
- fieldInfo.noStem = true;
472
+ case "type":
473
+ description["dataType"] = rawResponse[i + 1].toLowerCase();
464
474
  break;
465
- case "FAST":
466
- fieldInfo.fast = true;
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 fieldInfo;
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.COMMIT", this.name];
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, options);
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.3";
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-DQw_6S0p.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-DQw_6S0p.mjs';
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-DQw_6S0p.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-DQw_6S0p.js';
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, options) {
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 (hasEmptySelect) {
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
- const mergedFields = {};
2541
+ let data = {};
2543
2542
  for (const fieldRaw of rawFields) {
2544
- const fieldObj = kvArrayToObject(fieldRaw);
2545
- Object.assign(mergedFields, fieldObj);
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 mergedFields) {
2548
- const data2 = mergedFields["$"];
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 parseFieldInfo(fieldRaw) {
2556
- const fieldType = fieldRaw[1];
2557
- const options = fieldRaw.slice(2);
2558
- const fieldInfo = { type: fieldType };
2559
- for (const option of options) {
2560
- switch (option.toUpperCase()) {
2561
- case "NOTOKENIZE":
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 "NOSTEM":
2565
- fieldInfo.noStem = true;
2574
+ case "type":
2575
+ description["dataType"] = rawResponse[i + 1].toLowerCase();
2566
2576
  break;
2567
- case "FAST":
2568
- fieldInfo.fast = true;
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 fieldInfo;
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.COMMIT", this.name];
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, options);
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.3";
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
@@ -3,7 +3,7 @@ import {
3
3
  Redis,
4
4
  VERSION,
5
5
  error_exports
6
- } from "./chunk-2HN5OIX5.mjs";
6
+ } from "./chunk-2NDFGHFZ.mjs";
7
7
 
8
8
  // platforms/cloudflare.ts
9
9
  var Redis2 = class _Redis extends Redis {
package/fastly.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RedisOptions, b as RequesterConfig, c as Redis$1 } from './zmscore-DQw_6S0p.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-DQw_6S0p.mjs';
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-DQw_6S0p.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-DQw_6S0p.js';
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, options) {
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 (hasEmptySelect) {
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
- const mergedFields = {};
2541
+ let data = {};
2543
2542
  for (const fieldRaw of rawFields) {
2544
- const fieldObj = kvArrayToObject(fieldRaw);
2545
- Object.assign(mergedFields, fieldObj);
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 mergedFields) {
2548
- const data2 = mergedFields["$"];
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 parseFieldInfo(fieldRaw) {
2556
- const fieldType = fieldRaw[1];
2557
- const options = fieldRaw.slice(2);
2558
- const fieldInfo = { type: fieldType };
2559
- for (const option of options) {
2560
- switch (option.toUpperCase()) {
2561
- case "NOTOKENIZE":
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 "NOSTEM":
2565
- fieldInfo.noStem = true;
2574
+ case "type":
2575
+ description["dataType"] = rawResponse[i + 1].toLowerCase();
2566
2576
  break;
2567
- case "FAST":
2568
- fieldInfo.fast = true;
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 fieldInfo;
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.COMMIT", this.name];
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, options);
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.3";
4862
+ var VERSION = "v1.36.0-rc.5";
4869
4863
 
4870
4864
  // platforms/fastly.ts
4871
4865
  var Redis2 = class extends Redis {