@upstash/redis
Advanced tools
Comparing version 0.0.0-ci.0681c5bc1d0b8d8475e81cded2f12ed58fed4c1c to 0.0.0-ci.0684278061528494d3e77924f9572f2ead11f985-20240819072857
@@ -1,3 +0,3 @@ | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './redis-b1b1b1df.js'; | ||
export { c as Requester, U as UpstashRequest, d as UpstashResponse } from './redis-b1b1b1df.js'; | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-BCX3bKiC.js'; | ||
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetRangeCommand, I as GetSetCommand, J as HDelCommand, K as HExistsCommand, M as HGetAllCommand, L as HGetCommand, N as HIncrByCommand, O as HIncrByFloatCommand, Q as HKeysCommand, S as HLenCommand, T as HMGetCommand, V as HMSetCommand, W as HRandFieldCommand, X as HScanCommand, Y as HSetCommand, Z as HSetNXCommand, _ as HStrLenCommand, $ as HValsCommand, a1 as IncrByCommand, a2 as IncrByFloatCommand, a0 as IncrCommand, a3 as JsonArrAppendCommand, a4 as JsonArrIndexCommand, a5 as JsonArrInsertCommand, a6 as JsonArrLenCommand, a7 as JsonArrPopCommand, a8 as JsonArrTrimCommand, a9 as JsonClearCommand, aa as JsonDelCommand, ab as JsonForgetCommand, ac as JsonGetCommand, ad as JsonMGetCommand, ae as JsonNumIncrByCommand, af as JsonNumMultByCommand, ag as JsonObjKeysCommand, ah as JsonObjLenCommand, ai as JsonRespCommand, aj as JsonSetCommand, ak as JsonStrAppendCommand, al as JsonStrLenCommand, am as JsonToggleCommand, an as JsonTypeCommand, ao as KeysCommand, ap as LIndexCommand, aq as LInsertCommand, ar as LLenCommand, as as LMoveCommand, at as LPopCommand, au as LPushCommand, av as LPushXCommand, aw as LRangeCommand, ax as LRemCommand, ay as LSetCommand, az as LTrimCommand, aA as MGetCommand, aB as MSetCommand, aC as MSetNXCommand, aF as PExpireAtCommand, aE as PExpireCommand, aH as PSetEXCommand, aI as PTtlCommand, aD as PersistCommand, aG as PingCommand, P as Pipeline, aJ as PublishCommand, aN as RPopCommand, aO as RPushCommand, aP as RPushXCommand, aK as RandomKeyCommand, aL as RenameCommand, aM as RenameNXCommand, d as Requester, aQ as SAddCommand, aT as SCardCommand, aX as SDiffCommand, aY as SDiffStoreCommand, b3 as SInterCommand, b4 as SInterStoreCommand, b5 as SIsMemberCommand, b7 as SMIsMemberCommand, b6 as SMembersCommand, b8 as SMoveCommand, b9 as SPopCommand, ba as SRandMemberCommand, bb as SRemCommand, bc as SScanCommand, be as SUnionCommand, bf as SUnionStoreCommand, aR as ScanCommand, aS as ScanCommandOptions, bo as ScoreMember, aU as ScriptExistsCommand, aV as ScriptFlushCommand, aW as ScriptLoadCommand, a$ as SetBitCommand, aZ as SetCommand, a_ as SetCommandOptions, b0 as SetExCommand, b1 as SetNxCommand, b2 as SetRangeCommand, bd as StrLenCommand, bg as TimeCommand, bh as TouchCommand, bi as TtlCommand, bj as Type, bk as TypeCommand, bl as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bm as XAddCommand, bn as XRangeCommand, bq as ZAddCommand, bp as ZAddCommandOptions, br as ZCardCommand, bs as ZCountCommand, bt as ZDiffStoreCommand, bu as ZIncrByCommand, bv as ZInterStoreCommand, bw as ZInterStoreCommandOptions, bx as ZLexCountCommand, by as ZMScoreCommand, bz as ZPopMaxCommand, bA as ZPopMinCommand, bB as ZRangeCommand, bC as ZRangeCommandOptions, bD as ZRankCommand, bE as ZRemCommand, bF as ZRemRangeByLexCommand, bG as ZRemRangeByRankCommand, bH as ZRemRangeByScoreCommand, bI as ZRevRankCommand, bJ as ZScanCommand, bK as ZScoreCommand, bL as ZUnionCommand, bM as ZUnionCommandOptions, bN as ZUnionStoreCommand, bO as ZUnionStoreCommandOptions, e as errors } from './zmscore-BCX3bKiC.js'; | ||
@@ -16,7 +16,17 @@ type Env = { | ||
*/ | ||
url: string; | ||
url: string | undefined; | ||
/** | ||
* UPSTASH_REDIS_REST_TOKEN | ||
*/ | ||
token: string; | ||
token: string | undefined; | ||
/** | ||
* The signal will allow aborting requests on the fly. | ||
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | ||
*/ | ||
signal?: AbortSignal; | ||
keepAlive?: boolean; | ||
/** | ||
* When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client. | ||
*/ | ||
readYourWrites?: boolean; | ||
} & RedisOptions & RequesterConfig & Env; | ||
@@ -46,2 +56,2 @@ /** | ||
export { Redis, RedisConfigCloudflare }; | ||
export { Redis, type RedisConfigCloudflare }; |
@@ -1,1 +0,1 @@ | ||
"use strict";var ye=Object.create;var ee=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var De=(s,n)=>{for(var t in n)ee(s,t,{get:n[t],enumerable:!0})},ce=(s,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let m of Te(n))!we.call(s,m)&&m!==t&&ee(s,m,{get:()=>n[m],enumerable:!(o=be(n,m))||o.enumerable});return s};var ue=(s,n,t)=>(t=s!=null?ye(Oe(s)):{},ce(n||!s||!s.__esModule?ee(t,"default",{value:s,enumerable:!0}):t,s)),Ae=s=>ce(ee({},"__esModule",{value:!0}),s);var Le={};De(Le,{Redis:()=>pe});module.exports=Ae(Le);var c=class extends Error{constructor(n){super(n),this.name="UpstashError"}};var oe=class{baseUrl;headers;options;retry;constructor(n){this.options={backend:n.options?.backend,agent:n.agent,responseEncoding:n.responseEncoding??"base64",cache:n.cache},this.baseUrl=n.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...n.headers},this.options.responseEncoding==="base64"&&(this.headers["Upstash-Encoding"]="base64"),typeof n?.retry=="boolean"&&n?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:n?.retry?.retries??5,backoff:n?.retry?.backoff??(t=>Math.exp(t)*50)}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(","):o[m]=r),o}this.headers=t(this.headers,"Upstash-Telemetry-Runtime",n.runtime),this.headers=t(this.headers,"Upstash-Telemetry-Platform",n.platform),this.headers=t(this.headers,"Upstash-Telemetry-Sdk",n.sdk)}async request(n){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:this.options?.agent,backend:this.options?.backend},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,...n.path??[]].join("/"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw m??new Error("Exhausted all retries");let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return this.options?.responseEncoding==="base64"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:ie(i),error:p})):{result:ie(r.result),error:r.error}:r}};function he(s){let n="";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;r<o;r++)m[r]=t.charCodeAt(r);n=new TextDecoder().decode(m)}catch{n=s}return n}function ie(s){let n;switch(typeof s){case"undefined":return s;case"number":{n=s;break}case"object":{Array.isArray(s)?n=s.map(t=>typeof t=="string"?he(t):Array.isArray(t)?t.map(ie):t):n=null;break}case"string":{n=s==="OK"?"OK":he(s);break}default:break}return n}function le(s){let n=Array.isArray(s)?s.map(t=>{try{return le(t)}catch{return t}}):JSON.parse(s);return typeof n=="number"&&n.toString()!==s?s:n}function Ce(s){try{return le(s)}catch{return s}}var ke=s=>{switch(typeof s){case"string":case"number":case"boolean":return s;default:return JSON.stringify(s)}},e=class{command;serialize;deserialize;constructor(n,t){this.serialize=ke,this.deserialize=typeof t?.automaticDeserialization>"u"||t.automaticDeserialization?t?.deserialize??Ce:o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>"u")throw new Error("Request did not return a result");return this.deserialize(t)}};var l=class extends e{constructor(n,t){super(["append",...n],t)}};var C=class extends e{constructor([n,t,o],m){let r=["bitcount",n];typeof t=="number"&&r.push(t),typeof o=="number"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super(["bitop",...n],t)}};var x=class extends e{constructor(n,t){super(["bitpos",...n],t)}};var f=class extends e{constructor(n){super(["dbsize"],n)}};var y=class extends e{constructor(n,t){super(["decr",...n],t)}};var b=class extends e{constructor(n,t){super(["decrby",...n],t)}};var T=class extends e{constructor(n,t){super(["del",...n],t)}};var O=class extends e{constructor(n,t){super(["echo",...n],t)}};var w=class extends e{constructor([n,t,o],m){super(["eval",n,t.length,...t,...o??[]],m)}};var D=class extends e{constructor([n,t,o],m){super(["evalsha",n,t.length,...t,...o??[]],m)}};var A=class extends e{constructor(n,t){super(["exists",...n],t)}};var k=class extends e{constructor(n,t){super(["expire",...n],t)}};var S=class extends e{constructor(n,t){super(["expireat",...n],t)}};var R=class extends e{constructor(n,t){let o=["flushall"];n&&n.length>0&&n[0].async&&o.push("async"),super(o,t)}};var M=class extends e{constructor([n],t){let o=["flushdb"];n?.async&&o.push("async"),super(o,t)}};var E=class extends e{constructor([n,t,...o],m){let r=["geoadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"latitude"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var v=class extends e{constructor([n,t,o,m="M"],r){super(["GEODIST",n,t,o,m],r)}};var z=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOPOS",o,...m],{deserialize:r=>Se(r),...t})}};function Se(s){let n=[];for(let t of s)!t?.[0]||!t?.[1]||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var L=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOHASH",o,...m],t)}};var I=class extends e{constructor([n,t,o,m,r],a){let i=["GEOSEARCH",n];(t.type==="FROMMEMBER"||t.type==="frommember")&&i.push(t.type,t.member),(t.type==="FROMLONLAT"||t.type==="fromlonlat")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type==="BYRADIUS"||o.type==="byradius")&&i.push(o.type,o.radius,o.radiusType),(o.type==="BYBOX"||o.type==="bybox")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),r?.count&&i.push(r.count.limit,...r.count.any?["ANY"]:[]);let p=de=>!r?.withCoord&&!r?.withDist&&!r?.withHash?de.map(d=>{try{return{member:JSON.parse(d)}}catch{return{member:d}}}):de.map(d=>{let te=1,h={};try{h.member=JSON.parse(d[0])}catch{h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[te++])),r.withHash&&(h.hash=d[te++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[te][0]),lat:parseFloat(d[te][1])}),h});super([...i,...r?.withCoord?["WITHCOORD"]:[],...r?.withDist?["WITHDIST"]:[],...r?.withHash?["WITHHASH"]:[]],{...a,deserialize:p})}};var P=class extends e{constructor([n,t,o,m,r,a],i){let p=["GEOSEARCHSTORE",n,t];(o.type==="FROMMEMBER"||o.type==="frommember")&&p.push(o.type,o.member),(o.type==="FROMLONLAT"||o.type==="fromlonlat")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type==="BYRADIUS"||m.type==="byradius")&&p.push(m.type,m.radius,m.radiusType),(m.type==="BYBOX"||m.type==="bybox")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),a?.count&&p.push(a.count.limit,...a.count.any?["ANY"]:[]),super([...p,...a?.storeDist?["STOREDIST"]:[]],i)}};var J=class extends e{constructor(n,t){super(["get",...n],t)}};var K=class extends e{constructor(n,t){super(["getbit",...n],t)}};var N=class extends e{constructor(n,t){super(["getdel",...n],t)}};var Z=class extends e{constructor(n,t){super(["getrange",...n],t)}};var U=class extends e{constructor(n,t){super(["getset",...n],t)}};var G=class extends e{constructor(n,t){super(["hdel",...n],t)}};var H=class extends e{constructor(n,t){super(["hexists",...n],t)}};var B=class extends e{constructor(n,t){super(["hget",...n],t)}};function Re(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var F=class extends e{constructor(n,t){super(["hgetall",...n],{deserialize:o=>Re(o),...t})}};var q=class extends e{constructor(n,t){super(["hincrby",...n],t)}};var _=class extends e{constructor(n,t){super(["hincrbyfloat",...n],t)}};var $=class extends e{constructor([n],t){super(["hkeys",n],t)}};var X=class extends e{constructor(n,t){super(["hlen",...n],t)}};function Me(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;o<s.length;o++)try{t[s[o]]=JSON.parse(n[o])}catch{t[s[o]]=n[o]}return t}var j=class extends e{constructor([n,...t],o){super(["hmget",n,...t],{deserialize:m=>Me(t,m),...o})}};var Y=class extends e{constructor([n,t],o){super(["hmset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function Ee(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var W=class extends e{constructor(n,t){let o=["hrandfield",n[0]];typeof n[1]=="number"&&o.push(n[1]),n[2]&&o.push("WITHVALUES"),super(o,{deserialize:n[2]?m=>Ee(m):t?.deserialize,...t})}};var V=class extends e{constructor([n,t,o],m){let r=["hscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var Q=class extends e{constructor([n,t],o){super(["hset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var nn=class extends e{constructor(n,t){super(["hsetnx",...n],t)}};var tn=class extends e{constructor(n,t){super(["hstrlen",...n],t)}};var en=class extends e{constructor(n,t){super(["hvals",...n],t)}};var on=class extends e{constructor(n,t){super(["incr",...n],t)}};var sn=class extends e{constructor(n,t){super(["incrby",...n],t)}};var mn=class extends e{constructor(n,t){super(["incrbyfloat",...n],t)}};var rn=class extends e{constructor(n,t){super(["JSON.ARRAPPEND",...n],t)}};var an=class extends e{constructor(n,t){super(["JSON.ARRINDEX",...n],t)}};var pn=class extends e{constructor(n,t){super(["JSON.ARRINSERT",...n],t)}};var dn=class extends e{constructor(n,t){super(["JSON.ARRLEN",n[0],n[1]??"$"],t)}};var cn=class extends e{constructor(n,t){super(["JSON.ARRPOP",...n],t)}};var un=class extends e{constructor(n,t){let o=n[1]??"$",m=n[2]??0,r=n[3]??0;super(["JSON.ARRTRIM",n[0],o,m,r],t)}};var hn=class extends e{constructor(n,t){super(["JSON.CLEAR",...n],t)}};var ln=class extends e{constructor(n,t){super(["JSON.DEL",...n],t)}};var Cn=class extends e{constructor(n,t){super(["JSON.FORGET",...n],t)}};var gn=class extends e{constructor(n,t){let o=["JSON.GET"];typeof n[1]=="string"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push("INDENT",n[1].indent),n[1].newline&&o.push("NEWLINE",n[1].newline),n[1].space&&o.push("SPACE",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var xn=class extends e{constructor(n,t){super(["JSON.MGET",...n[0],n[1]],t)}};var fn=class extends e{constructor(n,t){super(["JSON.NUMINCRBY",...n],t)}};var yn=class extends e{constructor(n,t){super(["JSON.NUMMULTBY",...n],t)}};var bn=class extends e{constructor(n,t){super(["JSON.OBJKEYS",...n],t)}};var Tn=class extends e{constructor(n,t){super(["JSON.OBJLEN",...n],t)}};var On=class extends e{constructor(n,t){super(["JSON.RESP",...n],t)}};var wn=class extends e{constructor(n,t){let o=["JSON.SET",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push("NX"):n[3].xx&&o.push("XX")),super(o,t)}};var Dn=class extends e{constructor(n,t){super(["JSON.STRAPPEND",...n],t)}};var An=class extends e{constructor(n,t){super(["JSON.STRLEN",...n],t)}};var kn=class extends e{constructor(n,t){super(["JSON.TOGGLE",...n],t)}};var Sn=class extends e{constructor(n,t){super(["JSON.TYPE",...n],t)}};var Rn=class extends e{constructor(n,t){super(["keys",...n],t)}};var Mn=class extends e{constructor(n,t){super(["lindex",...n],t)}};var En=class extends e{constructor(n,t){super(["linsert",...n],t)}};var vn=class extends e{constructor(n,t){super(["llen",...n],t)}};var zn=class extends e{constructor(n,t){super(["lmove",...n],t)}};var Ln=class extends e{constructor(n,t){super(["lpop",...n],t)}};var In=class extends e{constructor(n,t){let o=["lpos",n[0],n[1]];typeof n[2]?.rank=="number"&&o.push("rank",n[2].rank),typeof n[2]?.count=="number"&&o.push("count",n[2].count),typeof n[2]?.maxLen=="number"&&o.push("maxLen",n[2].maxLen),super(o,t)}};var Pn=class extends e{constructor(n,t){super(["lpush",...n],t)}};var Jn=class extends e{constructor(n,t){super(["lpushx",...n],t)}};var Kn=class extends e{constructor(n,t){super(["lrange",...n],t)}};var Nn=class extends e{constructor(n,t){super(["lrem",...n],t)}};var Zn=class extends e{constructor(n,t){super(["lset",...n],t)}};var Un=class extends e{constructor(n,t){super(["ltrim",...n],t)}};var Gn=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super(["mget",...o],t)}};var Hn=class extends e{constructor([n],t){super(["mset",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Bn=class extends e{constructor([n],t){super(["msetnx",...Object.entries(n).flatMap(o=>o)],t)}};var Fn=class extends e{constructor(n,t){super(["persist",...n],t)}};var qn=class extends e{constructor(n,t){super(["pexpire",...n],t)}};var _n=class extends e{constructor(n,t){super(["pexpireat",...n],t)}};var $n=class extends e{constructor(n,t){let o=["ping"];typeof n<"u"&&typeof n[0]<"u"&&o.push(n[0]),super(o,t)}};var Xn=class extends e{constructor(n,t){super(["psetex",...n],t)}};var jn=class extends e{constructor(n,t){super(["pttl",...n],t)}};var Yn=class extends e{constructor(n,t){super(["publish",...n],t)}};var Wn=class extends e{constructor(n){super(["randomkey"],n)}};var Vn=class extends e{constructor(n,t){super(["rename",...n],t)}};var Qn=class extends e{constructor(n,t){super(["renamenx",...n],t)}};var nt=class extends e{constructor(n,t){super(["rpop",...n],t)}};var tt=class extends e{constructor(n,t){super(["rpush",...n],t)}};var et=class extends e{constructor(n,t){super(["rpushx",...n],t)}};var ot=class extends e{constructor(n,t){super(["sadd",...n],t)}};var st=class extends e{constructor([n,t],o){let m=["scan",n];t?.match&&m.push("match",t.match),typeof t?.count=="number"&&m.push("count",t.count),t?.type&&t.type.length>0&&m.push("type",t.type),super(m,o)}};var mt=class extends e{constructor(n,t){super(["scard",...n],t)}};var rt=class extends e{constructor(n,t){super(["script","exists",...n],{deserialize:o=>o,...t})}};var at=class extends e{constructor([n],t){let o=["script","flush"];n?.sync?o.push("sync"):n?.async&&o.push("async"),super(o,t)}};var it=class extends e{constructor(n,t){super(["script","load",...n],t)}};var pt=class extends e{constructor(n,t){super(["sdiff",...n],t)}};var dt=class extends e{constructor(n,t){super(["sdiffstore",...n],t)}};var ct=class extends e{constructor([n,t,o],m){let r=["set",n,t];o&&("nx"in o&&o.nx?r.push("nx"):"xx"in o&&o.xx&&r.push("xx"),"get"in o&&o.get&&r.push("get"),"ex"in o&&typeof o.ex=="number"?r.push("ex",o.ex):"px"in o&&typeof o.px=="number"?r.push("px",o.px):"exat"in o&&typeof o.exat=="number"?r.push("exat",o.exat):"pxat"in o&&typeof o.pxat=="number"?r.push("pxat",o.pxat):"keepTtl"in o&&o.keepTtl&&r.push("keepTtl")),super(r,m)}};var ut=class extends e{constructor(n,t){super(["setbit",...n],t)}};var ht=class extends e{constructor(n,t){super(["setex",...n],t)}};var lt=class extends e{constructor(n,t){super(["setnx",...n],t)}};var Ct=class extends e{constructor(n,t){super(["setrange",...n],t)}};var gt=class extends e{constructor(n,t){super(["sinter",...n],t)}};var xt=class extends e{constructor(n,t){super(["sinterstore",...n],t)}};var ft=class extends e{constructor(n,t){super(["sismember",...n],t)}};var yt=class extends e{constructor(n,t){super(["smembers",...n],t)}};var bt=class extends e{constructor(n,t){super(["smismember",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super(["smove",...n],t)}};var Ot=class extends e{constructor([n,t],o){let m=["spop",n];typeof t=="number"&&m.push(t),super(m,o)}};var wt=class extends e{constructor([n,t],o){let m=["srandmember",n];typeof t=="number"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor(n,t){super(["srem",...n],t)}};var At=class extends e{constructor([n,t,o],m){let r=["sscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var kt=class extends e{constructor(n,t){super(["strlen",...n],t)}};var St=class extends e{constructor(n,t){super(["sunion",...n],t)}};var Rt=class extends e{constructor(n,t){super(["sunionstore",...n],t)}};var Mt=class extends e{constructor(n){super(["time"],n)}};var Et=class extends e{constructor(n,t){super(["touch",...n],t)}};var vt=class extends e{constructor(n,t){super(["ttl",...n],t)}};var zt=class extends e{constructor(n,t){super(["type",...n],t)}};var Lt=class extends e{constructor(n,t){super(["unlink",...n],t)}};var se=class extends e{constructor([n,t,o,m],r){let a=["XADD",n];m&&(m.nomkStream&&a.push("NOMKSTREAM"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<"u"&&a.push("LIMIT",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function ve(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch{n[o][r]=a}}}return n}var me=class extends e{constructor([n,t,o,m],r){let a=["XRANGE",n,t,o];typeof m=="number"&&a.push("COUNT",m),super(a,{deserialize:i=>ve(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=["zadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"incr"in t&&t.incr&&r.push("incr"),"score"in t&&"member"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var It=class extends e{constructor(n,t){super(["zcard",...n],t)}};var Pt=class extends e{constructor(n,t){super(["zcount",...n],t)}};var Jt=class extends e{constructor(n,t){super(["zincrby",...n],t)}};var Kt=class extends e{constructor([n,t,o,m],r){let a=["zinterstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super(["zlexcount",...n],t)}};var Zt=class extends e{constructor([n,t],o){let m=["zpopmax",n];typeof t=="number"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t],o){let m=["zpopmin",n];typeof t=="number"&&m.push(t),super(m,o)}};var Gt=class extends e{constructor([n,t,o,m],r){let a=["zrange",n,t,o];m?.byScore&&a.push("byscore"),m?.byLex&&a.push("bylex"),m?.rev&&a.push("rev"),typeof m?.count<"u"&&typeof m?.offset<"u"&&a.push("limit",m.offset,m.count),m?.withScores&&a.push("withscores"),super(a,r)}};var Ht=class extends e{constructor(n,t){super(["zrank",...n],t)}};var Bt=class extends e{constructor(n,t){super(["zrem",...n],t)}};var Ft=class extends e{constructor(n,t){super(["zremrangebylex",...n],t)}};var qt=class extends e{constructor(n,t){super(["zremrangebyrank",...n],t)}};var _t=class extends e{constructor(n,t){super(["zremrangebyscore",...n],t)}};var $t=class extends e{constructor(n,t){super(["zrevrank",...n],t)}};var Xt=class extends e{constructor([n,t,o],m){let r=["zscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var jt=class extends e{constructor(n,t){super(["zscore",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=["zunion",n];Array.isArray(t)?r.push(...t):r.push(t),o&&("weights"in o&&o.weights?r.push("weights",...o.weights):"weight"in o&&typeof o.weight=="number"&&r.push("weights",o.weight),"aggregate"in o&&r.push("aggregate",o.aggregate),o?.withScores&&r.push("withscores")),super(r,m)}};var Wt=class extends e{constructor([n,t,o,m],r){let a=["zunionstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Vt=class extends e{constructor(n,t){super(["zdiffstore",...n],t)}};var Qt=class extends e{constructor(n,t){let[o,m]=n;super(["zmscore",o,...m],t)}};var ne=class{client;commands;commandOptions;multiExec;constructor(n){this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=n.multiExec??!1}exec=async()=>{if(this.commands.length===0)throw new Error("Pipeline is empty");let n=this.multiExec?["multi-exec"]:["pipeline"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})};length(){return this.commands.length}chain(n){return this.commands.push(n),this}append=(...n)=>this.chain(new l(n,this.commandOptions));bitcount=(...n)=>this.chain(new C(n,this.commandOptions));bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions));bitpos=(...n)=>this.chain(new x(n,this.commandOptions));zdiffstore=(...n)=>this.chain(new Vt(n,this.commandOptions));dbsize=()=>this.chain(new f(this.commandOptions));decr=(...n)=>this.chain(new y(n,this.commandOptions));decrby=(...n)=>this.chain(new b(n,this.commandOptions));del=(...n)=>this.chain(new T(n,this.commandOptions));echo=(...n)=>this.chain(new O(n,this.commandOptions));eval=(...n)=>this.chain(new w(n,this.commandOptions));evalsha=(...n)=>this.chain(new D(n,this.commandOptions));exists=(...n)=>this.chain(new A(n,this.commandOptions));expire=(...n)=>this.chain(new k(n,this.commandOptions));expireat=(...n)=>this.chain(new S(n,this.commandOptions));flushall=n=>this.chain(new R(n,this.commandOptions));flushdb=(...n)=>this.chain(new M(n,this.commandOptions));get=(...n)=>this.chain(new J(n,this.commandOptions));getbit=(...n)=>this.chain(new K(n,this.commandOptions));getdel=(...n)=>this.chain(new N(n,this.commandOptions));getrange=(...n)=>this.chain(new Z(n,this.commandOptions));getset=(n,t)=>this.chain(new U([n,t],this.commandOptions));hdel=(...n)=>this.chain(new G(n,this.commandOptions));hexists=(...n)=>this.chain(new H(n,this.commandOptions));hget=(...n)=>this.chain(new B(n,this.commandOptions));hgetall=(...n)=>this.chain(new F(n,this.commandOptions));hincrby=(...n)=>this.chain(new q(n,this.commandOptions));hincrbyfloat=(...n)=>this.chain(new _(n,this.commandOptions));hkeys=(...n)=>this.chain(new $(n,this.commandOptions));hlen=(...n)=>this.chain(new X(n,this.commandOptions));hmget=(...n)=>this.chain(new j(n,this.commandOptions));hmset=(n,t)=>this.chain(new Y([n,t],this.commandOptions));hrandfield=(n,t,o)=>this.chain(new W([n,t,o],this.commandOptions));hscan=(...n)=>this.chain(new V(n,this.commandOptions));hset=(n,t)=>this.chain(new Q([n,t],this.commandOptions));hsetnx=(n,t,o)=>this.chain(new nn([n,t,o],this.commandOptions));hstrlen=(...n)=>this.chain(new tn(n,this.commandOptions));hvals=(...n)=>this.chain(new en(n,this.commandOptions));incr=(...n)=>this.chain(new on(n,this.commandOptions));incrby=(...n)=>this.chain(new sn(n,this.commandOptions));incrbyfloat=(...n)=>this.chain(new mn(n,this.commandOptions));keys=(...n)=>this.chain(new Rn(n,this.commandOptions));lindex=(...n)=>this.chain(new Mn(n,this.commandOptions));linsert=(n,t,o,m)=>this.chain(new En([n,t,o,m],this.commandOptions));llen=(...n)=>this.chain(new vn(n,this.commandOptions));lmove=(...n)=>this.chain(new zn(n,this.commandOptions));lpop=(...n)=>this.chain(new Ln(n,this.commandOptions));lpos=(...n)=>this.chain(new In(n,this.commandOptions));lpush=(n,...t)=>this.chain(new Pn([n,...t],this.commandOptions));lpushx=(n,...t)=>this.chain(new Jn([n,...t],this.commandOptions));lrange=(...n)=>this.chain(new Kn(n,this.commandOptions));lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions));lset=(n,t,o)=>this.chain(new Zn([n,t,o],this.commandOptions));ltrim=(...n)=>this.chain(new Un(n,this.commandOptions));mget=(...n)=>this.chain(new Gn(n,this.commandOptions));mset=n=>this.chain(new Hn([n],this.commandOptions));msetnx=n=>this.chain(new Bn([n],this.commandOptions));persist=(...n)=>this.chain(new Fn(n,this.commandOptions));pexpire=(...n)=>this.chain(new qn(n,this.commandOptions));pexpireat=(...n)=>this.chain(new _n(n,this.commandOptions));ping=n=>this.chain(new $n(n,this.commandOptions));psetex=(n,t,o)=>this.chain(new Xn([n,t,o],this.commandOptions));pttl=(...n)=>this.chain(new jn(n,this.commandOptions));publish=(...n)=>this.chain(new Yn(n,this.commandOptions));randomkey=()=>this.chain(new Wn(this.commandOptions));rename=(...n)=>this.chain(new Vn(n,this.commandOptions));renamenx=(...n)=>this.chain(new Qn(n,this.commandOptions));rpop=(...n)=>this.chain(new nt(n,this.commandOptions));rpush=(n,...t)=>this.chain(new tt([n,...t],this.commandOptions));rpushx=(n,...t)=>this.chain(new et([n,...t],this.commandOptions));sadd=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions));scan=(...n)=>this.chain(new st(n,this.commandOptions));scard=(...n)=>this.chain(new mt(n,this.commandOptions));scriptExists=(...n)=>this.chain(new rt(n,this.commandOptions));scriptFlush=(...n)=>this.chain(new at(n,this.commandOptions));scriptLoad=(...n)=>this.chain(new it(n,this.commandOptions));sdiff=(...n)=>this.chain(new pt(n,this.commandOptions));sdiffstore=(...n)=>this.chain(new dt(n,this.commandOptions));set=(n,t,o)=>this.chain(new ct([n,t,o],this.commandOptions));setbit=(...n)=>this.chain(new ut(n,this.commandOptions));setex=(n,t,o)=>this.chain(new ht([n,t,o],this.commandOptions));setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions));setrange=(...n)=>this.chain(new Ct(n,this.commandOptions));sinter=(...n)=>this.chain(new gt(n,this.commandOptions));sinterstore=(...n)=>this.chain(new xt(n,this.commandOptions));sismember=(n,t)=>this.chain(new ft([n,t],this.commandOptions));smembers=(...n)=>this.chain(new yt(n,this.commandOptions));smismember=(n,t)=>this.chain(new bt([n,t],this.commandOptions));smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions));spop=(...n)=>this.chain(new Ot(n,this.commandOptions));srandmember=(...n)=>this.chain(new wt(n,this.commandOptions));srem=(n,...t)=>this.chain(new Dt([n,...t],this.commandOptions));sscan=(...n)=>this.chain(new At(n,this.commandOptions));strlen=(...n)=>this.chain(new kt(n,this.commandOptions));sunion=(...n)=>this.chain(new St(n,this.commandOptions));sunionstore=(...n)=>this.chain(new Rt(n,this.commandOptions));time=()=>this.chain(new Mt(this.commandOptions));touch=(...n)=>this.chain(new Et(n,this.commandOptions));ttl=(...n)=>this.chain(new vt(n,this.commandOptions));type=(...n)=>this.chain(new zt(n,this.commandOptions));unlink=(...n)=>this.chain(new Lt(n,this.commandOptions));zadd=(...n)=>"score"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions));zcard=(...n)=>this.chain(new It(n,this.commandOptions));zcount=(...n)=>this.chain(new Pt(n,this.commandOptions));zincrby=(n,t,o)=>this.chain(new Jt([n,t,o],this.commandOptions));zinterstore=(...n)=>this.chain(new Kt(n,this.commandOptions));zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions));zmscore=(...n)=>this.chain(new Qt(n,this.commandOptions));zpopmax=(...n)=>this.chain(new Zt(n,this.commandOptions));zpopmin=(...n)=>this.chain(new Ut(n,this.commandOptions));zrange=(...n)=>this.chain(new Gt(n,this.commandOptions));zrank=(n,t)=>this.chain(new Ht([n,t],this.commandOptions));zrem=(n,...t)=>this.chain(new Bt([n,...t],this.commandOptions));zremrangebylex=(...n)=>this.chain(new Ft(n,this.commandOptions));zremrangebyrank=(...n)=>this.chain(new qt(n,this.commandOptions));zremrangebyscore=(...n)=>this.chain(new _t(n,this.commandOptions));zrevrank=(n,t)=>this.chain(new $t([n,t],this.commandOptions));zscan=(...n)=>this.chain(new Xt(n,this.commandOptions));zscore=(n,t)=>this.chain(new jt([n,t],this.commandOptions));zunionstore=(...n)=>this.chain(new Wt(n,this.commandOptions));zunion=(...n)=>this.chain(new Yt(n,this.commandOptions));get json(){return{arrappend:(...n)=>this.chain(new rn(n,this.commandOptions)),arrindex:(...n)=>this.chain(new an(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new pn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new dn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new cn(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new un(n,this.commandOptions)),clear:(...n)=>this.chain(new hn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new Cn(n,this.commandOptions)),geoadd:(...n)=>new E(n,this.commandOptions).exec(this.client),geodist:(...n)=>new v(n,this.commandOptions).exec(this.client),geopos:(...n)=>new z(n,this.commandOptions).exec(this.client),geohash:(...n)=>new L(n,this.commandOptions).exec(this.client),geosearch:(...n)=>new I(n,this.commandOptions).exec(this.client),geosearchstore:(...n)=>new P(n,this.commandOptions).exec(this.client),get:(...n)=>this.chain(new gn(n,this.commandOptions)),mget:(...n)=>this.chain(new xn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new fn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new yn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new bn(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new On(n,this.commandOptions)),set:(...n)=>this.chain(new wn(n,this.commandOptions)),strappend:(...n)=>this.chain(new Dn(n,this.commandOptions)),strlen:(...n)=>this.chain(new An(n,this.commandOptions)),toggle:(...n)=>this.chain(new kn(n,this.commandOptions)),type:(...n)=>this.chain(new Sn(n,this.commandOptions))}}};var ge=ue(require("crypto-js/enc-hex")),xe=ue(require("crypto-js/sha1")),re=class{script;sha1;redis;constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return ge.default.stringify((0,xe.default)(n))}};var ae=class{client;opts;enableTelemetry;constructor(n,t){this.client=n,this.opts=t,this.enableTelemetry=t?.enableTelemetry??!0}get json(){return{arrappend:(...n)=>new rn(n,this.opts).exec(this.client),arrindex:(...n)=>new an(n,this.opts).exec(this.client),arrinsert:(...n)=>new pn(n,this.opts).exec(this.client),arrlen:(...n)=>new dn(n,this.opts).exec(this.client),arrpop:(...n)=>new cn(n,this.opts).exec(this.client),arrtrim:(...n)=>new un(n,this.opts).exec(this.client),clear:(...n)=>new hn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new Cn(n,this.opts).exec(this.client),geoadd:(...n)=>new E(n,this.opts).exec(this.client),geopos:(...n)=>new z(n,this.opts).exec(this.client),geodist:(...n)=>new v(n,this.opts).exec(this.client),geohash:(...n)=>new L(n,this.opts).exec(this.client),geosearch:(...n)=>new I(n,this.opts).exec(this.client),geosearchstore:(...n)=>new P(n,this.opts).exec(this.client),get:(...n)=>new gn(n,this.opts).exec(this.client),mget:(...n)=>new xn(n,this.opts).exec(this.client),numincrby:(...n)=>new fn(n,this.opts).exec(this.client),nummultby:(...n)=>new yn(n,this.opts).exec(this.client),objkeys:(...n)=>new bn(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new On(n,this.opts).exec(this.client),set:(...n)=>new wn(n,this.opts).exec(this.client),strappend:(...n)=>new Dn(n,this.opts).exec(this.client),strlen:(...n)=>new An(n,this.opts).exec(this.client),toggle:(...n)=>new kn(n,this.opts).exec(this.client),type:(...n)=>new Sn(n,this.opts).exec(this.client)}}use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)};addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch{}};createScript(n){return new re(this,n)}pipeline=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!1});multi=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!0});append=(...n)=>new l(n,this.opts).exec(this.client);bitcount=(...n)=>new C(n,this.opts).exec(this.client);bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client);bitpos=(...n)=>new x(n,this.opts).exec(this.client);dbsize=()=>new f(this.opts).exec(this.client);decr=(...n)=>new y(n,this.opts).exec(this.client);decrby=(...n)=>new b(n,this.opts).exec(this.client);del=(...n)=>new T(n,this.opts).exec(this.client);echo=(...n)=>new O(n,this.opts).exec(this.client);eval=(...n)=>new w(n,this.opts).exec(this.client);evalsha=(...n)=>new D(n,this.opts).exec(this.client);exists=(...n)=>new A(n,this.opts).exec(this.client);expire=(...n)=>new k(n,this.opts).exec(this.client);expireat=(...n)=>new S(n,this.opts).exec(this.client);flushall=n=>new R(n,this.opts).exec(this.client);flushdb=(...n)=>new M(n,this.opts).exec(this.client);get=(...n)=>new J(n,this.opts).exec(this.client);getbit=(...n)=>new K(n,this.opts).exec(this.client);getdel=(...n)=>new N(n,this.opts).exec(this.client);getrange=(...n)=>new Z(n,this.opts).exec(this.client);getset=(n,t)=>new U([n,t],this.opts).exec(this.client);hdel=(...n)=>new G(n,this.opts).exec(this.client);hexists=(...n)=>new H(n,this.opts).exec(this.client);hget=(...n)=>new B(n,this.opts).exec(this.client);hgetall=(...n)=>new F(n,this.opts).exec(this.client);hincrby=(...n)=>new q(n,this.opts).exec(this.client);hincrbyfloat=(...n)=>new _(n,this.opts).exec(this.client);hkeys=(...n)=>new $(n,this.opts).exec(this.client);hlen=(...n)=>new X(n,this.opts).exec(this.client);hmget=(...n)=>new j(n,this.opts).exec(this.client);hmset=(n,t)=>new Y([n,t],this.opts).exec(this.client);hrandfield=(n,t,o)=>new W([n,t,o],this.opts).exec(this.client);hscan=(...n)=>new V(n,this.opts).exec(this.client);hset=(n,t)=>new Q([n,t],this.opts).exec(this.client);hsetnx=(n,t,o)=>new nn([n,t,o],this.opts).exec(this.client);hstrlen=(...n)=>new tn(n,this.opts).exec(this.client);hvals=(...n)=>new en(n,this.opts).exec(this.client);incr=(...n)=>new on(n,this.opts).exec(this.client);incrby=(...n)=>new sn(n,this.opts).exec(this.client);incrbyfloat=(...n)=>new mn(n,this.opts).exec(this.client);keys=(...n)=>new Rn(n,this.opts).exec(this.client);lindex=(...n)=>new Mn(n,this.opts).exec(this.client);linsert=(n,t,o,m)=>new En([n,t,o,m],this.opts).exec(this.client);llen=(...n)=>new vn(n,this.opts).exec(this.client);lmove=(...n)=>new zn(n,this.opts).exec(this.client);lpop=(...n)=>new Ln(n,this.opts).exec(this.client);lpos=(...n)=>new In(n,this.opts).exec(this.client);lpush=(n,...t)=>new Pn([n,...t],this.opts).exec(this.client);lpushx=(n,...t)=>new Jn([n,...t],this.opts).exec(this.client);lrange=(...n)=>new Kn(n,this.opts).exec(this.client);lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client);lset=(n,t,o)=>new Zn([n,t,o],this.opts).exec(this.client);ltrim=(...n)=>new Un(n,this.opts).exec(this.client);mget=(...n)=>new Gn(n,this.opts).exec(this.client);mset=n=>new Hn([n],this.opts).exec(this.client);msetnx=n=>new Bn([n],this.opts).exec(this.client);persist=(...n)=>new Fn(n,this.opts).exec(this.client);pexpire=(...n)=>new qn(n,this.opts).exec(this.client);pexpireat=(...n)=>new _n(n,this.opts).exec(this.client);ping=n=>new $n(n,this.opts).exec(this.client);psetex=(n,t,o)=>new Xn([n,t,o],this.opts).exec(this.client);pttl=(...n)=>new jn(n,this.opts).exec(this.client);publish=(...n)=>new Yn(n,this.opts).exec(this.client);randomkey=()=>new Wn().exec(this.client);rename=(...n)=>new Vn(n,this.opts).exec(this.client);renamenx=(...n)=>new Qn(n,this.opts).exec(this.client);rpop=(...n)=>new nt(n,this.opts).exec(this.client);rpush=(n,...t)=>new tt([n,...t],this.opts).exec(this.client);rpushx=(n,...t)=>new et([n,...t],this.opts).exec(this.client);sadd=(n,...t)=>new ot([n,...t],this.opts).exec(this.client);scan=(...n)=>new st(n,this.opts).exec(this.client);scard=(...n)=>new mt(n,this.opts).exec(this.client);scriptExists=(...n)=>new rt(n,this.opts).exec(this.client);scriptFlush=(...n)=>new at(n,this.opts).exec(this.client);scriptLoad=(...n)=>new it(n,this.opts).exec(this.client);sdiff=(...n)=>new pt(n,this.opts).exec(this.client);sdiffstore=(...n)=>new dt(n,this.opts).exec(this.client);set=(n,t,o)=>new ct([n,t,o],this.opts).exec(this.client);setbit=(...n)=>new ut(n,this.opts).exec(this.client);setex=(n,t,o)=>new ht([n,t,o],this.opts).exec(this.client);setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client);setrange=(...n)=>new Ct(n,this.opts).exec(this.client);sinter=(...n)=>new gt(n,this.opts).exec(this.client);sinterstore=(...n)=>new xt(n,this.opts).exec(this.client);sismember=(n,t)=>new ft([n,t],this.opts).exec(this.client);smismember=(n,t)=>new bt([n,t],this.opts).exec(this.client);smembers=(...n)=>new yt(n,this.opts).exec(this.client);smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client);spop=(...n)=>new Ot(n,this.opts).exec(this.client);srandmember=(...n)=>new wt(n,this.opts).exec(this.client);srem=(n,...t)=>new Dt([n,...t],this.opts).exec(this.client);sscan=(...n)=>new At(n,this.opts).exec(this.client);strlen=(...n)=>new kt(n,this.opts).exec(this.client);sunion=(...n)=>new St(n,this.opts).exec(this.client);sunionstore=(...n)=>new Rt(n,this.opts).exec(this.client);time=()=>new Mt().exec(this.client);touch=(...n)=>new Et(n,this.opts).exec(this.client);ttl=(...n)=>new vt(n,this.opts).exec(this.client);type=(...n)=>new zt(n,this.opts).exec(this.client);unlink=(...n)=>new Lt(n,this.opts).exec(this.client);xadd=(...n)=>new se(n,this.opts).exec(this.client);xrange=(...n)=>new me(n,this.opts).exec(this.client);zadd=(...n)=>"score"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client);zcard=(...n)=>new It(n,this.opts).exec(this.client);zcount=(...n)=>new Pt(n,this.opts).exec(this.client);zdiffstore=(...n)=>new Vt(n,this.opts).exec(this.client);zincrby=(n,t,o)=>new Jt([n,t,o],this.opts).exec(this.client);zinterstore=(...n)=>new Kt(n,this.opts).exec(this.client);zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client);zmscore=(...n)=>new Qt(n,this.opts).exec(this.client);zpopmax=(...n)=>new Zt(n,this.opts).exec(this.client);zpopmin=(...n)=>new Ut(n,this.opts).exec(this.client);zrange=(...n)=>new Gt(n,this.opts).exec(this.client);zrank=(n,t)=>new Ht([n,t],this.opts).exec(this.client);zrem=(n,...t)=>new Bt([n,...t],this.opts).exec(this.client);zremrangebylex=(...n)=>new Ft(n,this.opts).exec(this.client);zremrangebyrank=(...n)=>new qt(n,this.opts).exec(this.client);zremrangebyscore=(...n)=>new _t(n,this.opts).exec(this.client);zrevrank=(n,t)=>new $t([n,t],this.opts).exec(this.client);zscan=(...n)=>new Xt(n,this.opts).exec(this.client);zscore=(n,t)=>new jt([n,t],this.opts).exec(this.client);zunion=(...n)=>new Yt(n,this.opts).exec(this.client);zunionstore=(...n)=>new Wt(n,this.opts).exec(this.client)};var fe="v0.0.0-ci.0681c5bc1d0b8d8475e81cded2f12ed58fed4c1c";var pe=class s extends ae{constructor(n,t){(n.url.startsWith(" ")||n.url.endsWith(" ")||/\r|\n/.test(n.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(n.token.startsWith(" ")||n.token.endsWith(" ")||/\r|\n/.test(n.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let o=new oe({retry:n.retry,baseUrl:n.url,headers:{authorization:`Bearer ${n.token}`},responseEncoding:n.responseEncoding});super(o,{enableTelemetry:!t?.UPSTASH_DISABLE_TELEMETRY,automaticDeserialization:n.automaticDeserialization}),this.addTelemetry({platform:"cloudflare",sdk:`@upstash/redis@${fe}`})}static fromEnv(n,t){let o=n?.UPSTASH_REDIS_REST_URL??UPSTASH_REDIS_REST_URL,m=n?.UPSTASH_REDIS_REST_TOKEN??UPSTASH_REDIS_REST_TOKEN;if(!o)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");if(!m)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`");return new s({...t,url:o,token:m},n)}};0&&(module.exports={Redis}); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk444SOLGYjs = require('./chunk-444SOLGY.js');var a=class l extends _chunk444SOLGYjs.c{constructor(e,t){if(!e.url)throw new Error("[Upstash Redis] The 'url' property is missing or undefined in your Redis config.");if(!e.token)throw new Error("[Upstash Redis] The 'token' property is missing or undefined in your Redis config.");(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let r=new (0, _chunk444SOLGYjs.b)({retry:e.retry,baseUrl:e.url,headers:{authorization:`Bearer ${e.token}`},responseEncoding:e.responseEncoding,signal:e.signal,keepAlive:e.keepAlive,readYourWrites:e.readYourWrites});if(super(r,{enableTelemetry:!_optionalChain([t, 'optionalAccess', _ => _.UPSTASH_DISABLE_TELEMETRY]),automaticDeserialization:e.automaticDeserialization,latencyLogging:e.latencyLogging,enableAutoPipelining:e.enableAutoPipelining}),this.addTelemetry({platform:"cloudflare",sdk:`@upstash/redis@${_chunk444SOLGYjs.d}`}),this.enableAutoPipelining)return this.autoPipeline()}static fromEnv(e,t){let r=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.UPSTASH_REDIS_REST_URL]), () => (UPSTASH_REDIS_REST_URL)),n=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _3 => _3.UPSTASH_REDIS_REST_TOKEN]), () => (UPSTASH_REDIS_REST_TOKEN));if(!r)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");if(!n)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`");return new l({...t,url:r,token:n},e)}};exports.Redis = a; exports.errors = _chunk444SOLGYjs.a; |
@@ -1,3 +0,3 @@ | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './redis-b1b1b1df.js'; | ||
export { c as Requester, U as UpstashRequest, d as UpstashResponse } from './redis-b1b1b1df.js'; | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-BCX3bKiC.js'; | ||
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetRangeCommand, I as GetSetCommand, J as HDelCommand, K as HExistsCommand, M as HGetAllCommand, L as HGetCommand, N as HIncrByCommand, O as HIncrByFloatCommand, Q as HKeysCommand, S as HLenCommand, T as HMGetCommand, V as HMSetCommand, W as HRandFieldCommand, X as HScanCommand, Y as HSetCommand, Z as HSetNXCommand, _ as HStrLenCommand, $ as HValsCommand, a1 as IncrByCommand, a2 as IncrByFloatCommand, a0 as IncrCommand, a3 as JsonArrAppendCommand, a4 as JsonArrIndexCommand, a5 as JsonArrInsertCommand, a6 as JsonArrLenCommand, a7 as JsonArrPopCommand, a8 as JsonArrTrimCommand, a9 as JsonClearCommand, aa as JsonDelCommand, ab as JsonForgetCommand, ac as JsonGetCommand, ad as JsonMGetCommand, ae as JsonNumIncrByCommand, af as JsonNumMultByCommand, ag as JsonObjKeysCommand, ah as JsonObjLenCommand, ai as JsonRespCommand, aj as JsonSetCommand, ak as JsonStrAppendCommand, al as JsonStrLenCommand, am as JsonToggleCommand, an as JsonTypeCommand, ao as KeysCommand, ap as LIndexCommand, aq as LInsertCommand, ar as LLenCommand, as as LMoveCommand, at as LPopCommand, au as LPushCommand, av as LPushXCommand, aw as LRangeCommand, ax as LRemCommand, ay as LSetCommand, az as LTrimCommand, aA as MGetCommand, aB as MSetCommand, aC as MSetNXCommand, aF as PExpireAtCommand, aE as PExpireCommand, aH as PSetEXCommand, aI as PTtlCommand, aD as PersistCommand, aG as PingCommand, P as Pipeline, aJ as PublishCommand, aN as RPopCommand, aO as RPushCommand, aP as RPushXCommand, aK as RandomKeyCommand, aL as RenameCommand, aM as RenameNXCommand, d as Requester, aQ as SAddCommand, aT as SCardCommand, aX as SDiffCommand, aY as SDiffStoreCommand, b3 as SInterCommand, b4 as SInterStoreCommand, b5 as SIsMemberCommand, b7 as SMIsMemberCommand, b6 as SMembersCommand, b8 as SMoveCommand, b9 as SPopCommand, ba as SRandMemberCommand, bb as SRemCommand, bc as SScanCommand, be as SUnionCommand, bf as SUnionStoreCommand, aR as ScanCommand, aS as ScanCommandOptions, bo as ScoreMember, aU as ScriptExistsCommand, aV as ScriptFlushCommand, aW as ScriptLoadCommand, a$ as SetBitCommand, aZ as SetCommand, a_ as SetCommandOptions, b0 as SetExCommand, b1 as SetNxCommand, b2 as SetRangeCommand, bd as StrLenCommand, bg as TimeCommand, bh as TouchCommand, bi as TtlCommand, bj as Type, bk as TypeCommand, bl as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bm as XAddCommand, bn as XRangeCommand, bq as ZAddCommand, bp as ZAddCommandOptions, br as ZCardCommand, bs as ZCountCommand, bt as ZDiffStoreCommand, bu as ZIncrByCommand, bv as ZInterStoreCommand, bw as ZInterStoreCommandOptions, bx as ZLexCountCommand, by as ZMScoreCommand, bz as ZPopMaxCommand, bA as ZPopMinCommand, bB as ZRangeCommand, bC as ZRangeCommandOptions, bD as ZRankCommand, bE as ZRemCommand, bF as ZRemRangeByLexCommand, bG as ZRemRangeByRankCommand, bH as ZRemRangeByScoreCommand, bI as ZRevRankCommand, bJ as ZScanCommand, bK as ZScoreCommand, bL as ZUnionCommand, bM as ZUnionCommandOptions, bN as ZUnionStoreCommand, bO as ZUnionStoreCommandOptions, e as errors } from './zmscore-BCX3bKiC.js'; | ||
@@ -12,7 +12,7 @@ /** | ||
*/ | ||
url: string; | ||
url: string | undefined; | ||
/** | ||
* UPSTASH_REDIS_REST_TOKEN | ||
*/ | ||
token: string; | ||
token: string | undefined; | ||
/** | ||
@@ -24,2 +24,7 @@ * A Request can be forwarded to any backend defined on your service. Backends | ||
backend: string; | ||
keepAlive?: boolean; | ||
/** | ||
* When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client. | ||
*/ | ||
readYourWrites?: boolean; | ||
} & RedisOptions & RequesterConfig; | ||
@@ -45,2 +50,2 @@ /** | ||
export { Redis, RedisConfigFastly }; | ||
export { Redis, type RedisConfigFastly }; |
@@ -1,1 +0,1 @@ | ||
"use strict";var ye=Object.create;var ee=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var De=(s,n)=>{for(var t in n)ee(s,t,{get:n[t],enumerable:!0})},ce=(s,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let m of Oe(n))!we.call(s,m)&&m!==t&&ee(s,m,{get:()=>n[m],enumerable:!(o=be(n,m))||o.enumerable});return s};var ue=(s,n,t)=>(t=s!=null?ye(Te(s)):{},ce(n||!s||!s.__esModule?ee(t,"default",{value:s,enumerable:!0}):t,s)),ke=s=>ce(ee({},"__esModule",{value:!0}),s);var Je={};De(Je,{Redis:()=>pe});module.exports=ke(Je);var c=class extends Error{constructor(n){super(n),this.name="UpstashError"}};var oe=class{baseUrl;headers;options;retry;constructor(n){this.options={backend:n.options?.backend,agent:n.agent,responseEncoding:n.responseEncoding??"base64",cache:n.cache},this.baseUrl=n.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...n.headers},this.options.responseEncoding==="base64"&&(this.headers["Upstash-Encoding"]="base64"),typeof n?.retry=="boolean"&&n?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:n?.retry?.retries??5,backoff:n?.retry?.backoff??(t=>Math.exp(t)*50)}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(","):o[m]=r),o}this.headers=t(this.headers,"Upstash-Telemetry-Runtime",n.runtime),this.headers=t(this.headers,"Upstash-Telemetry-Platform",n.platform),this.headers=t(this.headers,"Upstash-Telemetry-Sdk",n.sdk)}async request(n){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:this.options?.agent,backend:this.options?.backend},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,...n.path??[]].join("/"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw m??new Error("Exhausted all retries");let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return this.options?.responseEncoding==="base64"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:ie(i),error:p})):{result:ie(r.result),error:r.error}:r}};function he(s){let n="";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;r<o;r++)m[r]=t.charCodeAt(r);n=new TextDecoder().decode(m)}catch{n=s}return n}function ie(s){let n;switch(typeof s){case"undefined":return s;case"number":{n=s;break}case"object":{Array.isArray(s)?n=s.map(t=>typeof t=="string"?he(t):Array.isArray(t)?t.map(ie):t):n=null;break}case"string":{n=s==="OK"?"OK":he(s);break}default:break}return n}function le(s){let n=Array.isArray(s)?s.map(t=>{try{return le(t)}catch{return t}}):JSON.parse(s);return typeof n=="number"&&n.toString()!==s?s:n}function Ce(s){try{return le(s)}catch{return s}}var Ae=s=>{switch(typeof s){case"string":case"number":case"boolean":return s;default:return JSON.stringify(s)}},e=class{command;serialize;deserialize;constructor(n,t){this.serialize=Ae,this.deserialize=typeof t?.automaticDeserialization>"u"||t.automaticDeserialization?t?.deserialize??Ce:o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>"u")throw new Error("Request did not return a result");return this.deserialize(t)}};var l=class extends e{constructor(n,t){super(["append",...n],t)}};var C=class extends e{constructor([n,t,o],m){let r=["bitcount",n];typeof t=="number"&&r.push(t),typeof o=="number"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super(["bitop",...n],t)}};var x=class extends e{constructor(n,t){super(["bitpos",...n],t)}};var f=class extends e{constructor(n){super(["dbsize"],n)}};var y=class extends e{constructor(n,t){super(["decr",...n],t)}};var b=class extends e{constructor(n,t){super(["decrby",...n],t)}};var O=class extends e{constructor(n,t){super(["del",...n],t)}};var T=class extends e{constructor(n,t){super(["echo",...n],t)}};var w=class extends e{constructor([n,t,o],m){super(["eval",n,t.length,...t,...o??[]],m)}};var D=class extends e{constructor([n,t,o],m){super(["evalsha",n,t.length,...t,...o??[]],m)}};var k=class extends e{constructor(n,t){super(["exists",...n],t)}};var A=class extends e{constructor(n,t){super(["expire",...n],t)}};var S=class extends e{constructor(n,t){super(["expireat",...n],t)}};var R=class extends e{constructor(n,t){let o=["flushall"];n&&n.length>0&&n[0].async&&o.push("async"),super(o,t)}};var M=class extends e{constructor([n],t){let o=["flushdb"];n?.async&&o.push("async"),super(o,t)}};var v=class extends e{constructor([n,t,...o],m){let r=["geoadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"latitude"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var E=class extends e{constructor([n,t,o,m="M"],r){super(["GEODIST",n,t,o,m],r)}};var z=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOPOS",o,...m],{deserialize:r=>Se(r),...t})}};function Se(s){let n=[];for(let t of s)!t?.[0]||!t?.[1]||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOHASH",o,...m],t)}};var K=class extends e{constructor([n,t,o,m,r],a){let i=["GEOSEARCH",n];(t.type==="FROMMEMBER"||t.type==="frommember")&&i.push(t.type,t.member),(t.type==="FROMLONLAT"||t.type==="fromlonlat")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type==="BYRADIUS"||o.type==="byradius")&&i.push(o.type,o.radius,o.radiusType),(o.type==="BYBOX"||o.type==="bybox")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),r?.count&&i.push(r.count.limit,...r.count.any?["ANY"]:[]);let p=de=>!r?.withCoord&&!r?.withDist&&!r?.withHash?de.map(d=>{try{return{member:JSON.parse(d)}}catch{return{member:d}}}):de.map(d=>{let te=1,h={};try{h.member=JSON.parse(d[0])}catch{h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[te++])),r.withHash&&(h.hash=d[te++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[te][0]),lat:parseFloat(d[te][1])}),h});super([...i,...r?.withCoord?["WITHCOORD"]:[],...r?.withDist?["WITHDIST"]:[],...r?.withHash?["WITHHASH"]:[]],{...a,deserialize:p})}};var L=class extends e{constructor([n,t,o,m,r,a],i){let p=["GEOSEARCHSTORE",n,t];(o.type==="FROMMEMBER"||o.type==="frommember")&&p.push(o.type,o.member),(o.type==="FROMLONLAT"||o.type==="fromlonlat")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type==="BYRADIUS"||m.type==="byradius")&&p.push(m.type,m.radius,m.radiusType),(m.type==="BYBOX"||m.type==="bybox")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),a?.count&&p.push(a.count.limit,...a.count.any?["ANY"]:[]),super([...p,...a?.storeDist?["STOREDIST"]:[]],i)}};var Z=class extends e{constructor(n,t){super(["get",...n],t)}};var I=class extends e{constructor(n,t){super(["getbit",...n],t)}};var N=class extends e{constructor(n,t){super(["getdel",...n],t)}};var P=class extends e{constructor(n,t){super(["getrange",...n],t)}};var G=class extends e{constructor(n,t){super(["getset",...n],t)}};var B=class extends e{constructor(n,t){super(["hdel",...n],t)}};var U=class extends e{constructor(n,t){super(["hexists",...n],t)}};var H=class extends e{constructor(n,t){super(["hget",...n],t)}};function Re(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var F=class extends e{constructor(n,t){super(["hgetall",...n],{deserialize:o=>Re(o),...t})}};var q=class extends e{constructor(n,t){super(["hincrby",...n],t)}};var $=class extends e{constructor(n,t){super(["hincrbyfloat",...n],t)}};var X=class extends e{constructor([n],t){super(["hkeys",n],t)}};var j=class extends e{constructor(n,t){super(["hlen",...n],t)}};function Me(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;o<s.length;o++)try{t[s[o]]=JSON.parse(n[o])}catch{t[s[o]]=n[o]}return t}var W=class extends e{constructor([n,...t],o){super(["hmget",n,...t],{deserialize:m=>Me(t,m),...o})}};var Y=class extends e{constructor([n,t],o){super(["hmset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function ve(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var V=class extends e{constructor(n,t){let o=["hrandfield",n[0]];typeof n[1]=="number"&&o.push(n[1]),n[2]&&o.push("WITHVALUES"),super(o,{deserialize:n[2]?m=>ve(m):t?.deserialize,...t})}};var Q=class extends e{constructor([n,t,o],m){let r=["hscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var _=class extends e{constructor([n,t],o){super(["hset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var nn=class extends e{constructor(n,t){super(["hsetnx",...n],t)}};var tn=class extends e{constructor(n,t){super(["hstrlen",...n],t)}};var en=class extends e{constructor(n,t){super(["hvals",...n],t)}};var on=class extends e{constructor(n,t){super(["incr",...n],t)}};var sn=class extends e{constructor(n,t){super(["incrby",...n],t)}};var mn=class extends e{constructor(n,t){super(["incrbyfloat",...n],t)}};var rn=class extends e{constructor(n,t){super(["JSON.ARRAPPEND",...n],t)}};var an=class extends e{constructor(n,t){super(["JSON.ARRINDEX",...n],t)}};var pn=class extends e{constructor(n,t){super(["JSON.ARRINSERT",...n],t)}};var dn=class extends e{constructor(n,t){super(["JSON.ARRLEN",n[0],n[1]??"$"],t)}};var cn=class extends e{constructor(n,t){super(["JSON.ARRPOP",...n],t)}};var un=class extends e{constructor(n,t){let o=n[1]??"$",m=n[2]??0,r=n[3]??0;super(["JSON.ARRTRIM",n[0],o,m,r],t)}};var hn=class extends e{constructor(n,t){super(["JSON.CLEAR",...n],t)}};var ln=class extends e{constructor(n,t){super(["JSON.DEL",...n],t)}};var Cn=class extends e{constructor(n,t){super(["JSON.FORGET",...n],t)}};var gn=class extends e{constructor(n,t){let o=["JSON.GET"];typeof n[1]=="string"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push("INDENT",n[1].indent),n[1].newline&&o.push("NEWLINE",n[1].newline),n[1].space&&o.push("SPACE",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var xn=class extends e{constructor(n,t){super(["JSON.MGET",...n[0],n[1]],t)}};var fn=class extends e{constructor(n,t){super(["JSON.NUMINCRBY",...n],t)}};var yn=class extends e{constructor(n,t){super(["JSON.NUMMULTBY",...n],t)}};var bn=class extends e{constructor(n,t){super(["JSON.OBJKEYS",...n],t)}};var On=class extends e{constructor(n,t){super(["JSON.OBJLEN",...n],t)}};var Tn=class extends e{constructor(n,t){super(["JSON.RESP",...n],t)}};var wn=class extends e{constructor(n,t){let o=["JSON.SET",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push("NX"):n[3].xx&&o.push("XX")),super(o,t)}};var Dn=class extends e{constructor(n,t){super(["JSON.STRAPPEND",...n],t)}};var kn=class extends e{constructor(n,t){super(["JSON.STRLEN",...n],t)}};var An=class extends e{constructor(n,t){super(["JSON.TOGGLE",...n],t)}};var Sn=class extends e{constructor(n,t){super(["JSON.TYPE",...n],t)}};var Rn=class extends e{constructor(n,t){super(["keys",...n],t)}};var Mn=class extends e{constructor(n,t){super(["lindex",...n],t)}};var vn=class extends e{constructor(n,t){super(["linsert",...n],t)}};var En=class extends e{constructor(n,t){super(["llen",...n],t)}};var zn=class extends e{constructor(n,t){super(["lmove",...n],t)}};var Jn=class extends e{constructor(n,t){super(["lpop",...n],t)}};var Kn=class extends e{constructor(n,t){let o=["lpos",n[0],n[1]];typeof n[2]?.rank=="number"&&o.push("rank",n[2].rank),typeof n[2]?.count=="number"&&o.push("count",n[2].count),typeof n[2]?.maxLen=="number"&&o.push("maxLen",n[2].maxLen),super(o,t)}};var Ln=class extends e{constructor(n,t){super(["lpush",...n],t)}};var Zn=class extends e{constructor(n,t){super(["lpushx",...n],t)}};var In=class extends e{constructor(n,t){super(["lrange",...n],t)}};var Nn=class extends e{constructor(n,t){super(["lrem",...n],t)}};var Pn=class extends e{constructor(n,t){super(["lset",...n],t)}};var Gn=class extends e{constructor(n,t){super(["ltrim",...n],t)}};var Bn=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super(["mget",...o],t)}};var Un=class extends e{constructor([n],t){super(["mset",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Hn=class extends e{constructor([n],t){super(["msetnx",...Object.entries(n).flatMap(o=>o)],t)}};var Fn=class extends e{constructor(n,t){super(["persist",...n],t)}};var qn=class extends e{constructor(n,t){super(["pexpire",...n],t)}};var $n=class extends e{constructor(n,t){super(["pexpireat",...n],t)}};var Xn=class extends e{constructor(n,t){let o=["ping"];typeof n<"u"&&typeof n[0]<"u"&&o.push(n[0]),super(o,t)}};var jn=class extends e{constructor(n,t){super(["psetex",...n],t)}};var Wn=class extends e{constructor(n,t){super(["pttl",...n],t)}};var Yn=class extends e{constructor(n,t){super(["publish",...n],t)}};var Vn=class extends e{constructor(n){super(["randomkey"],n)}};var Qn=class extends e{constructor(n,t){super(["rename",...n],t)}};var _n=class extends e{constructor(n,t){super(["renamenx",...n],t)}};var nt=class extends e{constructor(n,t){super(["rpop",...n],t)}};var tt=class extends e{constructor(n,t){super(["rpush",...n],t)}};var et=class extends e{constructor(n,t){super(["rpushx",...n],t)}};var ot=class extends e{constructor(n,t){super(["sadd",...n],t)}};var st=class extends e{constructor([n,t],o){let m=["scan",n];t?.match&&m.push("match",t.match),typeof t?.count=="number"&&m.push("count",t.count),t?.type&&t.type.length>0&&m.push("type",t.type),super(m,o)}};var mt=class extends e{constructor(n,t){super(["scard",...n],t)}};var rt=class extends e{constructor(n,t){super(["script","exists",...n],{deserialize:o=>o,...t})}};var at=class extends e{constructor([n],t){let o=["script","flush"];n?.sync?o.push("sync"):n?.async&&o.push("async"),super(o,t)}};var it=class extends e{constructor(n,t){super(["script","load",...n],t)}};var pt=class extends e{constructor(n,t){super(["sdiff",...n],t)}};var dt=class extends e{constructor(n,t){super(["sdiffstore",...n],t)}};var ct=class extends e{constructor([n,t,o],m){let r=["set",n,t];o&&("nx"in o&&o.nx?r.push("nx"):"xx"in o&&o.xx&&r.push("xx"),"get"in o&&o.get&&r.push("get"),"ex"in o&&typeof o.ex=="number"?r.push("ex",o.ex):"px"in o&&typeof o.px=="number"?r.push("px",o.px):"exat"in o&&typeof o.exat=="number"?r.push("exat",o.exat):"pxat"in o&&typeof o.pxat=="number"?r.push("pxat",o.pxat):"keepTtl"in o&&o.keepTtl&&r.push("keepTtl")),super(r,m)}};var ut=class extends e{constructor(n,t){super(["setbit",...n],t)}};var ht=class extends e{constructor(n,t){super(["setex",...n],t)}};var lt=class extends e{constructor(n,t){super(["setnx",...n],t)}};var Ct=class extends e{constructor(n,t){super(["setrange",...n],t)}};var gt=class extends e{constructor(n,t){super(["sinter",...n],t)}};var xt=class extends e{constructor(n,t){super(["sinterstore",...n],t)}};var ft=class extends e{constructor(n,t){super(["sismember",...n],t)}};var yt=class extends e{constructor(n,t){super(["smembers",...n],t)}};var bt=class extends e{constructor(n,t){super(["smismember",n[0],...n[1]],t)}};var Ot=class extends e{constructor(n,t){super(["smove",...n],t)}};var Tt=class extends e{constructor([n,t],o){let m=["spop",n];typeof t=="number"&&m.push(t),super(m,o)}};var wt=class extends e{constructor([n,t],o){let m=["srandmember",n];typeof t=="number"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor(n,t){super(["srem",...n],t)}};var kt=class extends e{constructor([n,t,o],m){let r=["sscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var At=class extends e{constructor(n,t){super(["strlen",...n],t)}};var St=class extends e{constructor(n,t){super(["sunion",...n],t)}};var Rt=class extends e{constructor(n,t){super(["sunionstore",...n],t)}};var Mt=class extends e{constructor(n){super(["time"],n)}};var vt=class extends e{constructor(n,t){super(["touch",...n],t)}};var Et=class extends e{constructor(n,t){super(["ttl",...n],t)}};var zt=class extends e{constructor(n,t){super(["type",...n],t)}};var Jt=class extends e{constructor(n,t){super(["unlink",...n],t)}};var se=class extends e{constructor([n,t,o,m],r){let a=["XADD",n];m&&(m.nomkStream&&a.push("NOMKSTREAM"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<"u"&&a.push("LIMIT",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function Ee(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch{n[o][r]=a}}}return n}var me=class extends e{constructor([n,t,o,m],r){let a=["XRANGE",n,t,o];typeof m=="number"&&a.push("COUNT",m),super(a,{deserialize:i=>Ee(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=["zadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"incr"in t&&t.incr&&r.push("incr"),"score"in t&&"member"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var Kt=class extends e{constructor(n,t){super(["zcard",...n],t)}};var Lt=class extends e{constructor(n,t){super(["zcount",...n],t)}};var Zt=class extends e{constructor(n,t){super(["zincrby",...n],t)}};var It=class extends e{constructor([n,t,o,m],r){let a=["zinterstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super(["zlexcount",...n],t)}};var Pt=class extends e{constructor([n,t],o){let m=["zpopmax",n];typeof t=="number"&&m.push(t),super(m,o)}};var Gt=class extends e{constructor([n,t],o){let m=["zpopmin",n];typeof t=="number"&&m.push(t),super(m,o)}};var Bt=class extends e{constructor([n,t,o,m],r){let a=["zrange",n,t,o];m?.byScore&&a.push("byscore"),m?.byLex&&a.push("bylex"),m?.rev&&a.push("rev"),typeof m?.count<"u"&&typeof m?.offset<"u"&&a.push("limit",m.offset,m.count),m?.withScores&&a.push("withscores"),super(a,r)}};var Ut=class extends e{constructor(n,t){super(["zrank",...n],t)}};var Ht=class extends e{constructor(n,t){super(["zrem",...n],t)}};var Ft=class extends e{constructor(n,t){super(["zremrangebylex",...n],t)}};var qt=class extends e{constructor(n,t){super(["zremrangebyrank",...n],t)}};var $t=class extends e{constructor(n,t){super(["zremrangebyscore",...n],t)}};var Xt=class extends e{constructor(n,t){super(["zrevrank",...n],t)}};var jt=class extends e{constructor([n,t,o],m){let r=["zscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super(["zscore",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=["zunion",n];Array.isArray(t)?r.push(...t):r.push(t),o&&("weights"in o&&o.weights?r.push("weights",...o.weights):"weight"in o&&typeof o.weight=="number"&&r.push("weights",o.weight),"aggregate"in o&&r.push("aggregate",o.aggregate),o?.withScores&&r.push("withscores")),super(r,m)}};var Vt=class extends e{constructor([n,t,o,m],r){let a=["zunionstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Qt=class extends e{constructor(n,t){super(["zdiffstore",...n],t)}};var _t=class extends e{constructor(n,t){let[o,m]=n;super(["zmscore",o,...m],t)}};var ne=class{client;commands;commandOptions;multiExec;constructor(n){this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=n.multiExec??!1}exec=async()=>{if(this.commands.length===0)throw new Error("Pipeline is empty");let n=this.multiExec?["multi-exec"]:["pipeline"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})};length(){return this.commands.length}chain(n){return this.commands.push(n),this}append=(...n)=>this.chain(new l(n,this.commandOptions));bitcount=(...n)=>this.chain(new C(n,this.commandOptions));bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions));bitpos=(...n)=>this.chain(new x(n,this.commandOptions));zdiffstore=(...n)=>this.chain(new Qt(n,this.commandOptions));dbsize=()=>this.chain(new f(this.commandOptions));decr=(...n)=>this.chain(new y(n,this.commandOptions));decrby=(...n)=>this.chain(new b(n,this.commandOptions));del=(...n)=>this.chain(new O(n,this.commandOptions));echo=(...n)=>this.chain(new T(n,this.commandOptions));eval=(...n)=>this.chain(new w(n,this.commandOptions));evalsha=(...n)=>this.chain(new D(n,this.commandOptions));exists=(...n)=>this.chain(new k(n,this.commandOptions));expire=(...n)=>this.chain(new A(n,this.commandOptions));expireat=(...n)=>this.chain(new S(n,this.commandOptions));flushall=n=>this.chain(new R(n,this.commandOptions));flushdb=(...n)=>this.chain(new M(n,this.commandOptions));get=(...n)=>this.chain(new Z(n,this.commandOptions));getbit=(...n)=>this.chain(new I(n,this.commandOptions));getdel=(...n)=>this.chain(new N(n,this.commandOptions));getrange=(...n)=>this.chain(new P(n,this.commandOptions));getset=(n,t)=>this.chain(new G([n,t],this.commandOptions));hdel=(...n)=>this.chain(new B(n,this.commandOptions));hexists=(...n)=>this.chain(new U(n,this.commandOptions));hget=(...n)=>this.chain(new H(n,this.commandOptions));hgetall=(...n)=>this.chain(new F(n,this.commandOptions));hincrby=(...n)=>this.chain(new q(n,this.commandOptions));hincrbyfloat=(...n)=>this.chain(new $(n,this.commandOptions));hkeys=(...n)=>this.chain(new X(n,this.commandOptions));hlen=(...n)=>this.chain(new j(n,this.commandOptions));hmget=(...n)=>this.chain(new W(n,this.commandOptions));hmset=(n,t)=>this.chain(new Y([n,t],this.commandOptions));hrandfield=(n,t,o)=>this.chain(new V([n,t,o],this.commandOptions));hscan=(...n)=>this.chain(new Q(n,this.commandOptions));hset=(n,t)=>this.chain(new _([n,t],this.commandOptions));hsetnx=(n,t,o)=>this.chain(new nn([n,t,o],this.commandOptions));hstrlen=(...n)=>this.chain(new tn(n,this.commandOptions));hvals=(...n)=>this.chain(new en(n,this.commandOptions));incr=(...n)=>this.chain(new on(n,this.commandOptions));incrby=(...n)=>this.chain(new sn(n,this.commandOptions));incrbyfloat=(...n)=>this.chain(new mn(n,this.commandOptions));keys=(...n)=>this.chain(new Rn(n,this.commandOptions));lindex=(...n)=>this.chain(new Mn(n,this.commandOptions));linsert=(n,t,o,m)=>this.chain(new vn([n,t,o,m],this.commandOptions));llen=(...n)=>this.chain(new En(n,this.commandOptions));lmove=(...n)=>this.chain(new zn(n,this.commandOptions));lpop=(...n)=>this.chain(new Jn(n,this.commandOptions));lpos=(...n)=>this.chain(new Kn(n,this.commandOptions));lpush=(n,...t)=>this.chain(new Ln([n,...t],this.commandOptions));lpushx=(n,...t)=>this.chain(new Zn([n,...t],this.commandOptions));lrange=(...n)=>this.chain(new In(n,this.commandOptions));lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions));lset=(n,t,o)=>this.chain(new Pn([n,t,o],this.commandOptions));ltrim=(...n)=>this.chain(new Gn(n,this.commandOptions));mget=(...n)=>this.chain(new Bn(n,this.commandOptions));mset=n=>this.chain(new Un([n],this.commandOptions));msetnx=n=>this.chain(new Hn([n],this.commandOptions));persist=(...n)=>this.chain(new Fn(n,this.commandOptions));pexpire=(...n)=>this.chain(new qn(n,this.commandOptions));pexpireat=(...n)=>this.chain(new $n(n,this.commandOptions));ping=n=>this.chain(new Xn(n,this.commandOptions));psetex=(n,t,o)=>this.chain(new jn([n,t,o],this.commandOptions));pttl=(...n)=>this.chain(new Wn(n,this.commandOptions));publish=(...n)=>this.chain(new Yn(n,this.commandOptions));randomkey=()=>this.chain(new Vn(this.commandOptions));rename=(...n)=>this.chain(new Qn(n,this.commandOptions));renamenx=(...n)=>this.chain(new _n(n,this.commandOptions));rpop=(...n)=>this.chain(new nt(n,this.commandOptions));rpush=(n,...t)=>this.chain(new tt([n,...t],this.commandOptions));rpushx=(n,...t)=>this.chain(new et([n,...t],this.commandOptions));sadd=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions));scan=(...n)=>this.chain(new st(n,this.commandOptions));scard=(...n)=>this.chain(new mt(n,this.commandOptions));scriptExists=(...n)=>this.chain(new rt(n,this.commandOptions));scriptFlush=(...n)=>this.chain(new at(n,this.commandOptions));scriptLoad=(...n)=>this.chain(new it(n,this.commandOptions));sdiff=(...n)=>this.chain(new pt(n,this.commandOptions));sdiffstore=(...n)=>this.chain(new dt(n,this.commandOptions));set=(n,t,o)=>this.chain(new ct([n,t,o],this.commandOptions));setbit=(...n)=>this.chain(new ut(n,this.commandOptions));setex=(n,t,o)=>this.chain(new ht([n,t,o],this.commandOptions));setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions));setrange=(...n)=>this.chain(new Ct(n,this.commandOptions));sinter=(...n)=>this.chain(new gt(n,this.commandOptions));sinterstore=(...n)=>this.chain(new xt(n,this.commandOptions));sismember=(n,t)=>this.chain(new ft([n,t],this.commandOptions));smembers=(...n)=>this.chain(new yt(n,this.commandOptions));smismember=(n,t)=>this.chain(new bt([n,t],this.commandOptions));smove=(n,t,o)=>this.chain(new Ot([n,t,o],this.commandOptions));spop=(...n)=>this.chain(new Tt(n,this.commandOptions));srandmember=(...n)=>this.chain(new wt(n,this.commandOptions));srem=(n,...t)=>this.chain(new Dt([n,...t],this.commandOptions));sscan=(...n)=>this.chain(new kt(n,this.commandOptions));strlen=(...n)=>this.chain(new At(n,this.commandOptions));sunion=(...n)=>this.chain(new St(n,this.commandOptions));sunionstore=(...n)=>this.chain(new Rt(n,this.commandOptions));time=()=>this.chain(new Mt(this.commandOptions));touch=(...n)=>this.chain(new vt(n,this.commandOptions));ttl=(...n)=>this.chain(new Et(n,this.commandOptions));type=(...n)=>this.chain(new zt(n,this.commandOptions));unlink=(...n)=>this.chain(new Jt(n,this.commandOptions));zadd=(...n)=>"score"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions));zcard=(...n)=>this.chain(new Kt(n,this.commandOptions));zcount=(...n)=>this.chain(new Lt(n,this.commandOptions));zincrby=(n,t,o)=>this.chain(new Zt([n,t,o],this.commandOptions));zinterstore=(...n)=>this.chain(new It(n,this.commandOptions));zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions));zmscore=(...n)=>this.chain(new _t(n,this.commandOptions));zpopmax=(...n)=>this.chain(new Pt(n,this.commandOptions));zpopmin=(...n)=>this.chain(new Gt(n,this.commandOptions));zrange=(...n)=>this.chain(new Bt(n,this.commandOptions));zrank=(n,t)=>this.chain(new Ut([n,t],this.commandOptions));zrem=(n,...t)=>this.chain(new Ht([n,...t],this.commandOptions));zremrangebylex=(...n)=>this.chain(new Ft(n,this.commandOptions));zremrangebyrank=(...n)=>this.chain(new qt(n,this.commandOptions));zremrangebyscore=(...n)=>this.chain(new $t(n,this.commandOptions));zrevrank=(n,t)=>this.chain(new Xt([n,t],this.commandOptions));zscan=(...n)=>this.chain(new jt(n,this.commandOptions));zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions));zunionstore=(...n)=>this.chain(new Vt(n,this.commandOptions));zunion=(...n)=>this.chain(new Yt(n,this.commandOptions));get json(){return{arrappend:(...n)=>this.chain(new rn(n,this.commandOptions)),arrindex:(...n)=>this.chain(new an(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new pn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new dn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new cn(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new un(n,this.commandOptions)),clear:(...n)=>this.chain(new hn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new Cn(n,this.commandOptions)),geoadd:(...n)=>new v(n,this.commandOptions).exec(this.client),geodist:(...n)=>new E(n,this.commandOptions).exec(this.client),geopos:(...n)=>new z(n,this.commandOptions).exec(this.client),geohash:(...n)=>new J(n,this.commandOptions).exec(this.client),geosearch:(...n)=>new K(n,this.commandOptions).exec(this.client),geosearchstore:(...n)=>new L(n,this.commandOptions).exec(this.client),get:(...n)=>this.chain(new gn(n,this.commandOptions)),mget:(...n)=>this.chain(new xn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new fn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new yn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new bn(n,this.commandOptions)),objlen:(...n)=>this.chain(new On(n,this.commandOptions)),resp:(...n)=>this.chain(new Tn(n,this.commandOptions)),set:(...n)=>this.chain(new wn(n,this.commandOptions)),strappend:(...n)=>this.chain(new Dn(n,this.commandOptions)),strlen:(...n)=>this.chain(new kn(n,this.commandOptions)),toggle:(...n)=>this.chain(new An(n,this.commandOptions)),type:(...n)=>this.chain(new Sn(n,this.commandOptions))}}};var ge=ue(require("crypto-js/enc-hex")),xe=ue(require("crypto-js/sha1")),re=class{script;sha1;redis;constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return ge.default.stringify((0,xe.default)(n))}};var ae=class{client;opts;enableTelemetry;constructor(n,t){this.client=n,this.opts=t,this.enableTelemetry=t?.enableTelemetry??!0}get json(){return{arrappend:(...n)=>new rn(n,this.opts).exec(this.client),arrindex:(...n)=>new an(n,this.opts).exec(this.client),arrinsert:(...n)=>new pn(n,this.opts).exec(this.client),arrlen:(...n)=>new dn(n,this.opts).exec(this.client),arrpop:(...n)=>new cn(n,this.opts).exec(this.client),arrtrim:(...n)=>new un(n,this.opts).exec(this.client),clear:(...n)=>new hn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new Cn(n,this.opts).exec(this.client),geoadd:(...n)=>new v(n,this.opts).exec(this.client),geopos:(...n)=>new z(n,this.opts).exec(this.client),geodist:(...n)=>new E(n,this.opts).exec(this.client),geohash:(...n)=>new J(n,this.opts).exec(this.client),geosearch:(...n)=>new K(n,this.opts).exec(this.client),geosearchstore:(...n)=>new L(n,this.opts).exec(this.client),get:(...n)=>new gn(n,this.opts).exec(this.client),mget:(...n)=>new xn(n,this.opts).exec(this.client),numincrby:(...n)=>new fn(n,this.opts).exec(this.client),nummultby:(...n)=>new yn(n,this.opts).exec(this.client),objkeys:(...n)=>new bn(n,this.opts).exec(this.client),objlen:(...n)=>new On(n,this.opts).exec(this.client),resp:(...n)=>new Tn(n,this.opts).exec(this.client),set:(...n)=>new wn(n,this.opts).exec(this.client),strappend:(...n)=>new Dn(n,this.opts).exec(this.client),strlen:(...n)=>new kn(n,this.opts).exec(this.client),toggle:(...n)=>new An(n,this.opts).exec(this.client),type:(...n)=>new Sn(n,this.opts).exec(this.client)}}use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)};addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch{}};createScript(n){return new re(this,n)}pipeline=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!1});multi=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!0});append=(...n)=>new l(n,this.opts).exec(this.client);bitcount=(...n)=>new C(n,this.opts).exec(this.client);bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client);bitpos=(...n)=>new x(n,this.opts).exec(this.client);dbsize=()=>new f(this.opts).exec(this.client);decr=(...n)=>new y(n,this.opts).exec(this.client);decrby=(...n)=>new b(n,this.opts).exec(this.client);del=(...n)=>new O(n,this.opts).exec(this.client);echo=(...n)=>new T(n,this.opts).exec(this.client);eval=(...n)=>new w(n,this.opts).exec(this.client);evalsha=(...n)=>new D(n,this.opts).exec(this.client);exists=(...n)=>new k(n,this.opts).exec(this.client);expire=(...n)=>new A(n,this.opts).exec(this.client);expireat=(...n)=>new S(n,this.opts).exec(this.client);flushall=n=>new R(n,this.opts).exec(this.client);flushdb=(...n)=>new M(n,this.opts).exec(this.client);get=(...n)=>new Z(n,this.opts).exec(this.client);getbit=(...n)=>new I(n,this.opts).exec(this.client);getdel=(...n)=>new N(n,this.opts).exec(this.client);getrange=(...n)=>new P(n,this.opts).exec(this.client);getset=(n,t)=>new G([n,t],this.opts).exec(this.client);hdel=(...n)=>new B(n,this.opts).exec(this.client);hexists=(...n)=>new U(n,this.opts).exec(this.client);hget=(...n)=>new H(n,this.opts).exec(this.client);hgetall=(...n)=>new F(n,this.opts).exec(this.client);hincrby=(...n)=>new q(n,this.opts).exec(this.client);hincrbyfloat=(...n)=>new $(n,this.opts).exec(this.client);hkeys=(...n)=>new X(n,this.opts).exec(this.client);hlen=(...n)=>new j(n,this.opts).exec(this.client);hmget=(...n)=>new W(n,this.opts).exec(this.client);hmset=(n,t)=>new Y([n,t],this.opts).exec(this.client);hrandfield=(n,t,o)=>new V([n,t,o],this.opts).exec(this.client);hscan=(...n)=>new Q(n,this.opts).exec(this.client);hset=(n,t)=>new _([n,t],this.opts).exec(this.client);hsetnx=(n,t,o)=>new nn([n,t,o],this.opts).exec(this.client);hstrlen=(...n)=>new tn(n,this.opts).exec(this.client);hvals=(...n)=>new en(n,this.opts).exec(this.client);incr=(...n)=>new on(n,this.opts).exec(this.client);incrby=(...n)=>new sn(n,this.opts).exec(this.client);incrbyfloat=(...n)=>new mn(n,this.opts).exec(this.client);keys=(...n)=>new Rn(n,this.opts).exec(this.client);lindex=(...n)=>new Mn(n,this.opts).exec(this.client);linsert=(n,t,o,m)=>new vn([n,t,o,m],this.opts).exec(this.client);llen=(...n)=>new En(n,this.opts).exec(this.client);lmove=(...n)=>new zn(n,this.opts).exec(this.client);lpop=(...n)=>new Jn(n,this.opts).exec(this.client);lpos=(...n)=>new Kn(n,this.opts).exec(this.client);lpush=(n,...t)=>new Ln([n,...t],this.opts).exec(this.client);lpushx=(n,...t)=>new Zn([n,...t],this.opts).exec(this.client);lrange=(...n)=>new In(n,this.opts).exec(this.client);lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client);lset=(n,t,o)=>new Pn([n,t,o],this.opts).exec(this.client);ltrim=(...n)=>new Gn(n,this.opts).exec(this.client);mget=(...n)=>new Bn(n,this.opts).exec(this.client);mset=n=>new Un([n],this.opts).exec(this.client);msetnx=n=>new Hn([n],this.opts).exec(this.client);persist=(...n)=>new Fn(n,this.opts).exec(this.client);pexpire=(...n)=>new qn(n,this.opts).exec(this.client);pexpireat=(...n)=>new $n(n,this.opts).exec(this.client);ping=n=>new Xn(n,this.opts).exec(this.client);psetex=(n,t,o)=>new jn([n,t,o],this.opts).exec(this.client);pttl=(...n)=>new Wn(n,this.opts).exec(this.client);publish=(...n)=>new Yn(n,this.opts).exec(this.client);randomkey=()=>new Vn().exec(this.client);rename=(...n)=>new Qn(n,this.opts).exec(this.client);renamenx=(...n)=>new _n(n,this.opts).exec(this.client);rpop=(...n)=>new nt(n,this.opts).exec(this.client);rpush=(n,...t)=>new tt([n,...t],this.opts).exec(this.client);rpushx=(n,...t)=>new et([n,...t],this.opts).exec(this.client);sadd=(n,...t)=>new ot([n,...t],this.opts).exec(this.client);scan=(...n)=>new st(n,this.opts).exec(this.client);scard=(...n)=>new mt(n,this.opts).exec(this.client);scriptExists=(...n)=>new rt(n,this.opts).exec(this.client);scriptFlush=(...n)=>new at(n,this.opts).exec(this.client);scriptLoad=(...n)=>new it(n,this.opts).exec(this.client);sdiff=(...n)=>new pt(n,this.opts).exec(this.client);sdiffstore=(...n)=>new dt(n,this.opts).exec(this.client);set=(n,t,o)=>new ct([n,t,o],this.opts).exec(this.client);setbit=(...n)=>new ut(n,this.opts).exec(this.client);setex=(n,t,o)=>new ht([n,t,o],this.opts).exec(this.client);setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client);setrange=(...n)=>new Ct(n,this.opts).exec(this.client);sinter=(...n)=>new gt(n,this.opts).exec(this.client);sinterstore=(...n)=>new xt(n,this.opts).exec(this.client);sismember=(n,t)=>new ft([n,t],this.opts).exec(this.client);smismember=(n,t)=>new bt([n,t],this.opts).exec(this.client);smembers=(...n)=>new yt(n,this.opts).exec(this.client);smove=(n,t,o)=>new Ot([n,t,o],this.opts).exec(this.client);spop=(...n)=>new Tt(n,this.opts).exec(this.client);srandmember=(...n)=>new wt(n,this.opts).exec(this.client);srem=(n,...t)=>new Dt([n,...t],this.opts).exec(this.client);sscan=(...n)=>new kt(n,this.opts).exec(this.client);strlen=(...n)=>new At(n,this.opts).exec(this.client);sunion=(...n)=>new St(n,this.opts).exec(this.client);sunionstore=(...n)=>new Rt(n,this.opts).exec(this.client);time=()=>new Mt().exec(this.client);touch=(...n)=>new vt(n,this.opts).exec(this.client);ttl=(...n)=>new Et(n,this.opts).exec(this.client);type=(...n)=>new zt(n,this.opts).exec(this.client);unlink=(...n)=>new Jt(n,this.opts).exec(this.client);xadd=(...n)=>new se(n,this.opts).exec(this.client);xrange=(...n)=>new me(n,this.opts).exec(this.client);zadd=(...n)=>"score"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client);zcard=(...n)=>new Kt(n,this.opts).exec(this.client);zcount=(...n)=>new Lt(n,this.opts).exec(this.client);zdiffstore=(...n)=>new Qt(n,this.opts).exec(this.client);zincrby=(n,t,o)=>new Zt([n,t,o],this.opts).exec(this.client);zinterstore=(...n)=>new It(n,this.opts).exec(this.client);zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client);zmscore=(...n)=>new _t(n,this.opts).exec(this.client);zpopmax=(...n)=>new Pt(n,this.opts).exec(this.client);zpopmin=(...n)=>new Gt(n,this.opts).exec(this.client);zrange=(...n)=>new Bt(n,this.opts).exec(this.client);zrank=(n,t)=>new Ut([n,t],this.opts).exec(this.client);zrem=(n,...t)=>new Ht([n,...t],this.opts).exec(this.client);zremrangebylex=(...n)=>new Ft(n,this.opts).exec(this.client);zremrangebyrank=(...n)=>new qt(n,this.opts).exec(this.client);zremrangebyscore=(...n)=>new $t(n,this.opts).exec(this.client);zrevrank=(n,t)=>new Xt([n,t],this.opts).exec(this.client);zscan=(...n)=>new jt(n,this.opts).exec(this.client);zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client);zunion=(...n)=>new Yt(n,this.opts).exec(this.client);zunionstore=(...n)=>new Vt(n,this.opts).exec(this.client)};var fe="v0.0.0-ci.0681c5bc1d0b8d8475e81cded2f12ed58fed4c1c";var pe=class extends ae{constructor(n){(n.url.startsWith(" ")||n.url.endsWith(" ")||/\r|\n/.test(n.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(n.token.startsWith(" ")||n.token.endsWith(" ")||/\r|\n/.test(n.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new oe({baseUrl:n.url,retry:n.retry,headers:{authorization:`Bearer ${n.token}`},options:{backend:n.backend},responseEncoding:n.responseEncoding});super(t,{automaticDeserialization:n.automaticDeserialization}),this.addTelemetry({sdk:`@upstash/redis@${fe}`,platform:"fastly"})}};0&&(module.exports={Redis}); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk444SOLGYjs = require('./chunk-444SOLGY.js');var i=class extends _chunk444SOLGYjs.c{constructor(e){if(!e.url)throw new Error("[Upstash Redis] The 'url' property is missing or undefined in your Redis config.");if(!e.token)throw new Error("[Upstash Redis] The 'token' property is missing or undefined in your Redis config.");(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let o=new (0, _chunk444SOLGYjs.b)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},options:{backend:e.backend},responseEncoding:e.responseEncoding,keepAlive:e.keepAlive,readYourWrites:e.readYourWrites});if(super(o,{automaticDeserialization:e.automaticDeserialization,enableAutoPipelining:e.enableAutoPipelining}),this.addTelemetry({sdk:`@upstash/redis@${_chunk444SOLGYjs.d}`,platform:"fastly"}),this.enableAutoPipelining)return this.autoPipeline()}};exports.Redis = i; exports.errors = _chunk444SOLGYjs.a; |
@@ -1,3 +0,3 @@ | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1, c as Requester } from './redis-b1b1b1df.js'; | ||
export { U as UpstashRequest, d as UpstashResponse } from './redis-b1b1b1df.js'; | ||
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-BCX3bKiC.js'; | ||
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetRangeCommand, I as GetSetCommand, J as HDelCommand, K as HExistsCommand, M as HGetAllCommand, L as HGetCommand, N as HIncrByCommand, O as HIncrByFloatCommand, Q as HKeysCommand, S as HLenCommand, T as HMGetCommand, V as HMSetCommand, W as HRandFieldCommand, X as HScanCommand, Y as HSetCommand, Z as HSetNXCommand, _ as HStrLenCommand, $ as HValsCommand, a1 as IncrByCommand, a2 as IncrByFloatCommand, a0 as IncrCommand, a3 as JsonArrAppendCommand, a4 as JsonArrIndexCommand, a5 as JsonArrInsertCommand, a6 as JsonArrLenCommand, a7 as JsonArrPopCommand, a8 as JsonArrTrimCommand, a9 as JsonClearCommand, aa as JsonDelCommand, ab as JsonForgetCommand, ac as JsonGetCommand, ad as JsonMGetCommand, ae as JsonNumIncrByCommand, af as JsonNumMultByCommand, ag as JsonObjKeysCommand, ah as JsonObjLenCommand, ai as JsonRespCommand, aj as JsonSetCommand, ak as JsonStrAppendCommand, al as JsonStrLenCommand, am as JsonToggleCommand, an as JsonTypeCommand, ao as KeysCommand, ap as LIndexCommand, aq as LInsertCommand, ar as LLenCommand, as as LMoveCommand, at as LPopCommand, au as LPushCommand, av as LPushXCommand, aw as LRangeCommand, ax as LRemCommand, ay as LSetCommand, az as LTrimCommand, aA as MGetCommand, aB as MSetCommand, aC as MSetNXCommand, aF as PExpireAtCommand, aE as PExpireCommand, aH as PSetEXCommand, aI as PTtlCommand, aD as PersistCommand, aG as PingCommand, P as Pipeline, aJ as PublishCommand, aN as RPopCommand, aO as RPushCommand, aP as RPushXCommand, aK as RandomKeyCommand, aL as RenameCommand, aM as RenameNXCommand, d as Requester, aQ as SAddCommand, aT as SCardCommand, aX as SDiffCommand, aY as SDiffStoreCommand, b3 as SInterCommand, b4 as SInterStoreCommand, b5 as SIsMemberCommand, b7 as SMIsMemberCommand, b6 as SMembersCommand, b8 as SMoveCommand, b9 as SPopCommand, ba as SRandMemberCommand, bb as SRemCommand, bc as SScanCommand, be as SUnionCommand, bf as SUnionStoreCommand, aR as ScanCommand, aS as ScanCommandOptions, bo as ScoreMember, aU as ScriptExistsCommand, aV as ScriptFlushCommand, aW as ScriptLoadCommand, a$ as SetBitCommand, aZ as SetCommand, a_ as SetCommandOptions, b0 as SetExCommand, b1 as SetNxCommand, b2 as SetRangeCommand, bd as StrLenCommand, bg as TimeCommand, bh as TouchCommand, bi as TtlCommand, bj as Type, bk as TypeCommand, bl as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bm as XAddCommand, bn as XRangeCommand, bq as ZAddCommand, bp as ZAddCommandOptions, br as ZCardCommand, bs as ZCountCommand, bt as ZDiffStoreCommand, bu as ZIncrByCommand, bv as ZInterStoreCommand, bw as ZInterStoreCommandOptions, bx as ZLexCountCommand, by as ZMScoreCommand, bz as ZPopMaxCommand, bA as ZPopMinCommand, bB as ZRangeCommand, bC as ZRangeCommandOptions, bD as ZRankCommand, bE as ZRemCommand, bF as ZRemRangeByLexCommand, bG as ZRemRangeByRankCommand, bH as ZRemRangeByScoreCommand, bI as ZRevRankCommand, bJ as ZScanCommand, bK as ZScoreCommand, bL as ZUnionCommand, bM as ZUnionCommandOptions, bN as ZUnionStoreCommand, bO as ZUnionStoreCommandOptions, e as errors } from './zmscore-BCX3bKiC.js'; | ||
@@ -12,7 +12,7 @@ /** | ||
*/ | ||
url: string; | ||
url: string | undefined; | ||
/** | ||
* UPSTASH_REDIS_REST_TOKEN | ||
*/ | ||
token: string; | ||
token: string | undefined; | ||
/** | ||
@@ -33,3 +33,14 @@ * An agent allows you to reuse connections to reduce latency for multiple sequential requests. | ||
*/ | ||
agent?: any; | ||
/** | ||
* The signal will allow aborting requests on the fly. | ||
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | ||
*/ | ||
signal?: AbortSignal; | ||
latencyLogging?: boolean; | ||
agent?: unknown; | ||
keepAlive?: boolean; | ||
/** | ||
* When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client. | ||
*/ | ||
readYourWrites?: boolean; | ||
} & RedisOptions & RequesterConfig; | ||
@@ -53,20 +64,2 @@ /** | ||
/** | ||
* Create a new redis client by providing a custom `Requester` implementation | ||
* | ||
* @example | ||
* ```ts | ||
* | ||
* import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis" | ||
* | ||
* const requester: Requester = { | ||
* request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => { | ||
* // ... | ||
* } | ||
* } | ||
* | ||
* const redis = new Redis(requester) | ||
* ``` | ||
*/ | ||
constructor(requesters: Requester); | ||
/** | ||
* Create a new Upstash Redis instance from environment variables. | ||
@@ -83,2 +76,2 @@ * | ||
export { Redis, RedisConfigNodejs, Requester }; | ||
export { Redis, type RedisConfigNodejs }; |
@@ -1,1 +0,1 @@ | ||
"use strict";var ye=Object.create;var ee=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var De=(s,n)=>{for(var t in n)ee(s,t,{get:n[t],enumerable:!0})},ce=(s,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let m of Te(n))!we.call(s,m)&&m!==t&&ee(s,m,{get:()=>n[m],enumerable:!(o=be(n,m))||o.enumerable});return s};var ue=(s,n,t)=>(t=s!=null?ye(Oe(s)):{},ce(n||!s||!s.__esModule?ee(t,"default",{value:s,enumerable:!0}):t,s)),ke=s=>ce(ee({},"__esModule",{value:!0}),s);var Je={};De(Je,{Redis:()=>pe});module.exports=ke(Je);var c=class extends Error{constructor(n){super(n),this.name="UpstashError"}};var oe=class{baseUrl;headers;options;retry;constructor(n){this.options={backend:n.options?.backend,agent:n.agent,responseEncoding:n.responseEncoding??"base64",cache:n.cache},this.baseUrl=n.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...n.headers},this.options.responseEncoding==="base64"&&(this.headers["Upstash-Encoding"]="base64"),typeof n?.retry=="boolean"&&n?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:n?.retry?.retries??5,backoff:n?.retry?.backoff??(t=>Math.exp(t)*50)}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(","):o[m]=r),o}this.headers=t(this.headers,"Upstash-Telemetry-Runtime",n.runtime),this.headers=t(this.headers,"Upstash-Telemetry-Platform",n.platform),this.headers=t(this.headers,"Upstash-Telemetry-Sdk",n.sdk)}async request(n){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:this.options?.agent,backend:this.options?.backend},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,...n.path??[]].join("/"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw m??new Error("Exhausted all retries");let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return this.options?.responseEncoding==="base64"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:ie(i),error:p})):{result:ie(r.result),error:r.error}:r}};function he(s){let n="";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;r<o;r++)m[r]=t.charCodeAt(r);n=new TextDecoder().decode(m)}catch{n=s}return n}function ie(s){let n;switch(typeof s){case"undefined":return s;case"number":{n=s;break}case"object":{Array.isArray(s)?n=s.map(t=>typeof t=="string"?he(t):Array.isArray(t)?t.map(ie):t):n=null;break}case"string":{n=s==="OK"?"OK":he(s);break}default:break}return n}function le(s){let n=Array.isArray(s)?s.map(t=>{try{return le(t)}catch{return t}}):JSON.parse(s);return typeof n=="number"&&n.toString()!==s?s:n}function Ce(s){try{return le(s)}catch{return s}}var Ae=s=>{switch(typeof s){case"string":case"number":case"boolean":return s;default:return JSON.stringify(s)}},e=class{command;serialize;deserialize;constructor(n,t){this.serialize=Ae,this.deserialize=typeof t?.automaticDeserialization>"u"||t.automaticDeserialization?t?.deserialize??Ce:o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>"u")throw new Error("Request did not return a result");return this.deserialize(t)}};var l=class extends e{constructor(n,t){super(["append",...n],t)}};var C=class extends e{constructor([n,t,o],m){let r=["bitcount",n];typeof t=="number"&&r.push(t),typeof o=="number"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super(["bitop",...n],t)}};var x=class extends e{constructor(n,t){super(["bitpos",...n],t)}};var f=class extends e{constructor(n){super(["dbsize"],n)}};var y=class extends e{constructor(n,t){super(["decr",...n],t)}};var b=class extends e{constructor(n,t){super(["decrby",...n],t)}};var T=class extends e{constructor(n,t){super(["del",...n],t)}};var O=class extends e{constructor(n,t){super(["echo",...n],t)}};var w=class extends e{constructor([n,t,o],m){super(["eval",n,t.length,...t,...o??[]],m)}};var D=class extends e{constructor([n,t,o],m){super(["evalsha",n,t.length,...t,...o??[]],m)}};var k=class extends e{constructor(n,t){super(["exists",...n],t)}};var A=class extends e{constructor(n,t){super(["expire",...n],t)}};var S=class extends e{constructor(n,t){super(["expireat",...n],t)}};var R=class extends e{constructor(n,t){let o=["flushall"];n&&n.length>0&&n[0].async&&o.push("async"),super(o,t)}};var v=class extends e{constructor([n],t){let o=["flushdb"];n?.async&&o.push("async"),super(o,t)}};var M=class extends e{constructor([n,t,...o],m){let r=["geoadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"latitude"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var E=class extends e{constructor([n,t,o,m="M"],r){super(["GEODIST",n,t,o,m],r)}};var z=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOPOS",o,...m],{deserialize:r=>Se(r),...t})}};function Se(s){let n=[];for(let t of s)!t?.[0]||!t?.[1]||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOHASH",o,...m],t)}};var L=class extends e{constructor([n,t,o,m,r],a){let i=["GEOSEARCH",n];(t.type==="FROMMEMBER"||t.type==="frommember")&&i.push(t.type,t.member),(t.type==="FROMLONLAT"||t.type==="fromlonlat")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type==="BYRADIUS"||o.type==="byradius")&&i.push(o.type,o.radius,o.radiusType),(o.type==="BYBOX"||o.type==="bybox")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),r?.count&&i.push(r.count.limit,...r.count.any?["ANY"]:[]);let p=de=>!r?.withCoord&&!r?.withDist&&!r?.withHash?de.map(d=>{try{return{member:JSON.parse(d)}}catch{return{member:d}}}):de.map(d=>{let te=1,h={};try{h.member=JSON.parse(d[0])}catch{h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[te++])),r.withHash&&(h.hash=d[te++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[te][0]),lat:parseFloat(d[te][1])}),h});super([...i,...r?.withCoord?["WITHCOORD"]:[],...r?.withDist?["WITHDIST"]:[],...r?.withHash?["WITHHASH"]:[]],{...a,deserialize:p})}};var I=class extends e{constructor([n,t,o,m,r,a],i){let p=["GEOSEARCHSTORE",n,t];(o.type==="FROMMEMBER"||o.type==="frommember")&&p.push(o.type,o.member),(o.type==="FROMLONLAT"||o.type==="fromlonlat")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type==="BYRADIUS"||m.type==="byradius")&&p.push(m.type,m.radius,m.radiusType),(m.type==="BYBOX"||m.type==="bybox")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),a?.count&&p.push(a.count.limit,...a.count.any?["ANY"]:[]),super([...p,...a?.storeDist?["STOREDIST"]:[]],i)}};var K=class extends e{constructor(n,t){super(["get",...n],t)}};var N=class extends e{constructor(n,t){super(["getbit",...n],t)}};var P=class extends e{constructor(n,t){super(["getdel",...n],t)}};var Z=class extends e{constructor(n,t){super(["getrange",...n],t)}};var G=class extends e{constructor(n,t){super(["getset",...n],t)}};var U=class extends e{constructor(n,t){super(["hdel",...n],t)}};var B=class extends e{constructor(n,t){super(["hexists",...n],t)}};var H=class extends e{constructor(n,t){super(["hget",...n],t)}};function Re(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var F=class extends e{constructor(n,t){super(["hgetall",...n],{deserialize:o=>Re(o),...t})}};var $=class extends e{constructor(n,t){super(["hincrby",...n],t)}};var q=class extends e{constructor(n,t){super(["hincrbyfloat",...n],t)}};var j=class extends e{constructor([n],t){super(["hkeys",n],t)}};var X=class extends e{constructor(n,t){super(["hlen",...n],t)}};function ve(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;o<s.length;o++)try{t[s[o]]=JSON.parse(n[o])}catch{t[s[o]]=n[o]}return t}var W=class extends e{constructor([n,...t],o){super(["hmget",n,...t],{deserialize:m=>ve(t,m),...o})}};var Y=class extends e{constructor([n,t],o){super(["hmset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function Me(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch{n[t]=o}}return n}var _=class extends e{constructor(n,t){let o=["hrandfield",n[0]];typeof n[1]=="number"&&o.push(n[1]),n[2]&&o.push("WITHVALUES"),super(o,{deserialize:n[2]?m=>Me(m):t?.deserialize,...t})}};var V=class extends e{constructor([n,t,o],m){let r=["hscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var Q=class extends e{constructor([n,t],o){super(["hset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var nn=class extends e{constructor(n,t){super(["hsetnx",...n],t)}};var tn=class extends e{constructor(n,t){super(["hstrlen",...n],t)}};var en=class extends e{constructor(n,t){super(["hvals",...n],t)}};var on=class extends e{constructor(n,t){super(["incr",...n],t)}};var sn=class extends e{constructor(n,t){super(["incrby",...n],t)}};var mn=class extends e{constructor(n,t){super(["incrbyfloat",...n],t)}};var rn=class extends e{constructor(n,t){super(["JSON.ARRAPPEND",...n],t)}};var an=class extends e{constructor(n,t){super(["JSON.ARRINDEX",...n],t)}};var pn=class extends e{constructor(n,t){super(["JSON.ARRINSERT",...n],t)}};var dn=class extends e{constructor(n,t){super(["JSON.ARRLEN",n[0],n[1]??"$"],t)}};var cn=class extends e{constructor(n,t){super(["JSON.ARRPOP",...n],t)}};var un=class extends e{constructor(n,t){let o=n[1]??"$",m=n[2]??0,r=n[3]??0;super(["JSON.ARRTRIM",n[0],o,m,r],t)}};var hn=class extends e{constructor(n,t){super(["JSON.CLEAR",...n],t)}};var ln=class extends e{constructor(n,t){super(["JSON.DEL",...n],t)}};var Cn=class extends e{constructor(n,t){super(["JSON.FORGET",...n],t)}};var gn=class extends e{constructor(n,t){let o=["JSON.GET"];typeof n[1]=="string"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push("INDENT",n[1].indent),n[1].newline&&o.push("NEWLINE",n[1].newline),n[1].space&&o.push("SPACE",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var xn=class extends e{constructor(n,t){super(["JSON.MGET",...n[0],n[1]],t)}};var fn=class extends e{constructor(n,t){super(["JSON.NUMINCRBY",...n],t)}};var yn=class extends e{constructor(n,t){super(["JSON.NUMMULTBY",...n],t)}};var bn=class extends e{constructor(n,t){super(["JSON.OBJKEYS",...n],t)}};var Tn=class extends e{constructor(n,t){super(["JSON.OBJLEN",...n],t)}};var On=class extends e{constructor(n,t){super(["JSON.RESP",...n],t)}};var wn=class extends e{constructor(n,t){let o=["JSON.SET",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push("NX"):n[3].xx&&o.push("XX")),super(o,t)}};var Dn=class extends e{constructor(n,t){super(["JSON.STRAPPEND",...n],t)}};var kn=class extends e{constructor(n,t){super(["JSON.STRLEN",...n],t)}};var An=class extends e{constructor(n,t){super(["JSON.TOGGLE",...n],t)}};var Sn=class extends e{constructor(n,t){super(["JSON.TYPE",...n],t)}};var Rn=class extends e{constructor(n,t){super(["keys",...n],t)}};var vn=class extends e{constructor(n,t){super(["lindex",...n],t)}};var Mn=class extends e{constructor(n,t){super(["linsert",...n],t)}};var En=class extends e{constructor(n,t){super(["llen",...n],t)}};var zn=class extends e{constructor(n,t){super(["lmove",...n],t)}};var Jn=class extends e{constructor(n,t){super(["lpop",...n],t)}};var Ln=class extends e{constructor(n,t){let o=["lpos",n[0],n[1]];typeof n[2]?.rank=="number"&&o.push("rank",n[2].rank),typeof n[2]?.count=="number"&&o.push("count",n[2].count),typeof n[2]?.maxLen=="number"&&o.push("maxLen",n[2].maxLen),super(o,t)}};var In=class extends e{constructor(n,t){super(["lpush",...n],t)}};var Kn=class extends e{constructor(n,t){super(["lpushx",...n],t)}};var Nn=class extends e{constructor(n,t){super(["lrange",...n],t)}};var Pn=class extends e{constructor(n,t){super(["lrem",...n],t)}};var Zn=class extends e{constructor(n,t){super(["lset",...n],t)}};var Gn=class extends e{constructor(n,t){super(["ltrim",...n],t)}};var Un=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super(["mget",...o],t)}};var Bn=class extends e{constructor([n],t){super(["mset",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Hn=class extends e{constructor([n],t){super(["msetnx",...Object.entries(n).flatMap(o=>o)],t)}};var Fn=class extends e{constructor(n,t){super(["persist",...n],t)}};var $n=class extends e{constructor(n,t){super(["pexpire",...n],t)}};var qn=class extends e{constructor(n,t){super(["pexpireat",...n],t)}};var jn=class extends e{constructor(n,t){let o=["ping"];typeof n<"u"&&typeof n[0]<"u"&&o.push(n[0]),super(o,t)}};var Xn=class extends e{constructor(n,t){super(["psetex",...n],t)}};var Wn=class extends e{constructor(n,t){super(["pttl",...n],t)}};var Yn=class extends e{constructor(n,t){super(["publish",...n],t)}};var _n=class extends e{constructor(n){super(["randomkey"],n)}};var Vn=class extends e{constructor(n,t){super(["rename",...n],t)}};var Qn=class extends e{constructor(n,t){super(["renamenx",...n],t)}};var nt=class extends e{constructor(n,t){super(["rpop",...n],t)}};var tt=class extends e{constructor(n,t){super(["rpush",...n],t)}};var et=class extends e{constructor(n,t){super(["rpushx",...n],t)}};var ot=class extends e{constructor(n,t){super(["sadd",...n],t)}};var st=class extends e{constructor([n,t],o){let m=["scan",n];t?.match&&m.push("match",t.match),typeof t?.count=="number"&&m.push("count",t.count),t?.type&&t.type.length>0&&m.push("type",t.type),super(m,o)}};var mt=class extends e{constructor(n,t){super(["scard",...n],t)}};var rt=class extends e{constructor(n,t){super(["script","exists",...n],{deserialize:o=>o,...t})}};var at=class extends e{constructor([n],t){let o=["script","flush"];n?.sync?o.push("sync"):n?.async&&o.push("async"),super(o,t)}};var it=class extends e{constructor(n,t){super(["script","load",...n],t)}};var pt=class extends e{constructor(n,t){super(["sdiff",...n],t)}};var dt=class extends e{constructor(n,t){super(["sdiffstore",...n],t)}};var ct=class extends e{constructor([n,t,o],m){let r=["set",n,t];o&&("nx"in o&&o.nx?r.push("nx"):"xx"in o&&o.xx&&r.push("xx"),"get"in o&&o.get&&r.push("get"),"ex"in o&&typeof o.ex=="number"?r.push("ex",o.ex):"px"in o&&typeof o.px=="number"?r.push("px",o.px):"exat"in o&&typeof o.exat=="number"?r.push("exat",o.exat):"pxat"in o&&typeof o.pxat=="number"?r.push("pxat",o.pxat):"keepTtl"in o&&o.keepTtl&&r.push("keepTtl")),super(r,m)}};var ut=class extends e{constructor(n,t){super(["setbit",...n],t)}};var ht=class extends e{constructor(n,t){super(["setex",...n],t)}};var lt=class extends e{constructor(n,t){super(["setnx",...n],t)}};var Ct=class extends e{constructor(n,t){super(["setrange",...n],t)}};var gt=class extends e{constructor(n,t){super(["sinter",...n],t)}};var xt=class extends e{constructor(n,t){super(["sinterstore",...n],t)}};var ft=class extends e{constructor(n,t){super(["sismember",...n],t)}};var yt=class extends e{constructor(n,t){super(["smembers",...n],t)}};var bt=class extends e{constructor(n,t){super(["smismember",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super(["smove",...n],t)}};var Ot=class extends e{constructor([n,t],o){let m=["spop",n];typeof t=="number"&&m.push(t),super(m,o)}};var wt=class extends e{constructor([n,t],o){let m=["srandmember",n];typeof t=="number"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor(n,t){super(["srem",...n],t)}};var kt=class extends e{constructor([n,t,o],m){let r=["sscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var At=class extends e{constructor(n,t){super(["strlen",...n],t)}};var St=class extends e{constructor(n,t){super(["sunion",...n],t)}};var Rt=class extends e{constructor(n,t){super(["sunionstore",...n],t)}};var vt=class extends e{constructor(n){super(["time"],n)}};var Mt=class extends e{constructor(n,t){super(["touch",...n],t)}};var Et=class extends e{constructor(n,t){super(["ttl",...n],t)}};var zt=class extends e{constructor(n,t){super(["type",...n],t)}};var Jt=class extends e{constructor(n,t){super(["unlink",...n],t)}};var se=class extends e{constructor([n,t,o,m],r){let a=["XADD",n];m&&(m.nomkStream&&a.push("NOMKSTREAM"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<"u"&&a.push("LIMIT",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function Ee(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch{n[o][r]=a}}}return n}var me=class extends e{constructor([n,t,o,m],r){let a=["XRANGE",n,t,o];typeof m=="number"&&a.push("COUNT",m),super(a,{deserialize:i=>Ee(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=["zadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"incr"in t&&t.incr&&r.push("incr"),"score"in t&&"member"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var Lt=class extends e{constructor(n,t){super(["zcard",...n],t)}};var It=class extends e{constructor(n,t){super(["zcount",...n],t)}};var Kt=class extends e{constructor(n,t){super(["zincrby",...n],t)}};var Nt=class extends e{constructor([n,t,o,m],r){let a=["zinterstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Pt=class extends e{constructor(n,t){super(["zlexcount",...n],t)}};var Zt=class extends e{constructor([n,t],o){let m=["zpopmax",n];typeof t=="number"&&m.push(t),super(m,o)}};var Gt=class extends e{constructor([n,t],o){let m=["zpopmin",n];typeof t=="number"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t,o,m],r){let a=["zrange",n,t,o];m?.byScore&&a.push("byscore"),m?.byLex&&a.push("bylex"),m?.rev&&a.push("rev"),typeof m?.count<"u"&&typeof m?.offset<"u"&&a.push("limit",m.offset,m.count),m?.withScores&&a.push("withscores"),super(a,r)}};var Bt=class extends e{constructor(n,t){super(["zrank",...n],t)}};var Ht=class extends e{constructor(n,t){super(["zrem",...n],t)}};var Ft=class extends e{constructor(n,t){super(["zremrangebylex",...n],t)}};var $t=class extends e{constructor(n,t){super(["zremrangebyrank",...n],t)}};var qt=class extends e{constructor(n,t){super(["zremrangebyscore",...n],t)}};var jt=class extends e{constructor(n,t){super(["zrevrank",...n],t)}};var Xt=class extends e{constructor([n,t,o],m){let r=["zscan",n,t];o?.match&&r.push("match",o.match),typeof o?.count=="number"&&r.push("count",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super(["zscore",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=["zunion",n];Array.isArray(t)?r.push(...t):r.push(t),o&&("weights"in o&&o.weights?r.push("weights",...o.weights):"weight"in o&&typeof o.weight=="number"&&r.push("weights",o.weight),"aggregate"in o&&r.push("aggregate",o.aggregate),o?.withScores&&r.push("withscores")),super(r,m)}};var _t=class extends e{constructor([n,t,o,m],r){let a=["zunionstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Vt=class extends e{constructor(n,t){super(["zdiffstore",...n],t)}};var Qt=class extends e{constructor(n,t){let[o,m]=n;super(["zmscore",o,...m],t)}};var ne=class{client;commands;commandOptions;multiExec;constructor(n){this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=n.multiExec??!1}exec=async()=>{if(this.commands.length===0)throw new Error("Pipeline is empty");let n=this.multiExec?["multi-exec"]:["pipeline"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})};length(){return this.commands.length}chain(n){return this.commands.push(n),this}append=(...n)=>this.chain(new l(n,this.commandOptions));bitcount=(...n)=>this.chain(new C(n,this.commandOptions));bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions));bitpos=(...n)=>this.chain(new x(n,this.commandOptions));zdiffstore=(...n)=>this.chain(new Vt(n,this.commandOptions));dbsize=()=>this.chain(new f(this.commandOptions));decr=(...n)=>this.chain(new y(n,this.commandOptions));decrby=(...n)=>this.chain(new b(n,this.commandOptions));del=(...n)=>this.chain(new T(n,this.commandOptions));echo=(...n)=>this.chain(new O(n,this.commandOptions));eval=(...n)=>this.chain(new w(n,this.commandOptions));evalsha=(...n)=>this.chain(new D(n,this.commandOptions));exists=(...n)=>this.chain(new k(n,this.commandOptions));expire=(...n)=>this.chain(new A(n,this.commandOptions));expireat=(...n)=>this.chain(new S(n,this.commandOptions));flushall=n=>this.chain(new R(n,this.commandOptions));flushdb=(...n)=>this.chain(new v(n,this.commandOptions));get=(...n)=>this.chain(new K(n,this.commandOptions));getbit=(...n)=>this.chain(new N(n,this.commandOptions));getdel=(...n)=>this.chain(new P(n,this.commandOptions));getrange=(...n)=>this.chain(new Z(n,this.commandOptions));getset=(n,t)=>this.chain(new G([n,t],this.commandOptions));hdel=(...n)=>this.chain(new U(n,this.commandOptions));hexists=(...n)=>this.chain(new B(n,this.commandOptions));hget=(...n)=>this.chain(new H(n,this.commandOptions));hgetall=(...n)=>this.chain(new F(n,this.commandOptions));hincrby=(...n)=>this.chain(new $(n,this.commandOptions));hincrbyfloat=(...n)=>this.chain(new q(n,this.commandOptions));hkeys=(...n)=>this.chain(new j(n,this.commandOptions));hlen=(...n)=>this.chain(new X(n,this.commandOptions));hmget=(...n)=>this.chain(new W(n,this.commandOptions));hmset=(n,t)=>this.chain(new Y([n,t],this.commandOptions));hrandfield=(n,t,o)=>this.chain(new _([n,t,o],this.commandOptions));hscan=(...n)=>this.chain(new V(n,this.commandOptions));hset=(n,t)=>this.chain(new Q([n,t],this.commandOptions));hsetnx=(n,t,o)=>this.chain(new nn([n,t,o],this.commandOptions));hstrlen=(...n)=>this.chain(new tn(n,this.commandOptions));hvals=(...n)=>this.chain(new en(n,this.commandOptions));incr=(...n)=>this.chain(new on(n,this.commandOptions));incrby=(...n)=>this.chain(new sn(n,this.commandOptions));incrbyfloat=(...n)=>this.chain(new mn(n,this.commandOptions));keys=(...n)=>this.chain(new Rn(n,this.commandOptions));lindex=(...n)=>this.chain(new vn(n,this.commandOptions));linsert=(n,t,o,m)=>this.chain(new Mn([n,t,o,m],this.commandOptions));llen=(...n)=>this.chain(new En(n,this.commandOptions));lmove=(...n)=>this.chain(new zn(n,this.commandOptions));lpop=(...n)=>this.chain(new Jn(n,this.commandOptions));lpos=(...n)=>this.chain(new Ln(n,this.commandOptions));lpush=(n,...t)=>this.chain(new In([n,...t],this.commandOptions));lpushx=(n,...t)=>this.chain(new Kn([n,...t],this.commandOptions));lrange=(...n)=>this.chain(new Nn(n,this.commandOptions));lrem=(n,t,o)=>this.chain(new Pn([n,t,o],this.commandOptions));lset=(n,t,o)=>this.chain(new Zn([n,t,o],this.commandOptions));ltrim=(...n)=>this.chain(new Gn(n,this.commandOptions));mget=(...n)=>this.chain(new Un(n,this.commandOptions));mset=n=>this.chain(new Bn([n],this.commandOptions));msetnx=n=>this.chain(new Hn([n],this.commandOptions));persist=(...n)=>this.chain(new Fn(n,this.commandOptions));pexpire=(...n)=>this.chain(new $n(n,this.commandOptions));pexpireat=(...n)=>this.chain(new qn(n,this.commandOptions));ping=n=>this.chain(new jn(n,this.commandOptions));psetex=(n,t,o)=>this.chain(new Xn([n,t,o],this.commandOptions));pttl=(...n)=>this.chain(new Wn(n,this.commandOptions));publish=(...n)=>this.chain(new Yn(n,this.commandOptions));randomkey=()=>this.chain(new _n(this.commandOptions));rename=(...n)=>this.chain(new Vn(n,this.commandOptions));renamenx=(...n)=>this.chain(new Qn(n,this.commandOptions));rpop=(...n)=>this.chain(new nt(n,this.commandOptions));rpush=(n,...t)=>this.chain(new tt([n,...t],this.commandOptions));rpushx=(n,...t)=>this.chain(new et([n,...t],this.commandOptions));sadd=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions));scan=(...n)=>this.chain(new st(n,this.commandOptions));scard=(...n)=>this.chain(new mt(n,this.commandOptions));scriptExists=(...n)=>this.chain(new rt(n,this.commandOptions));scriptFlush=(...n)=>this.chain(new at(n,this.commandOptions));scriptLoad=(...n)=>this.chain(new it(n,this.commandOptions));sdiff=(...n)=>this.chain(new pt(n,this.commandOptions));sdiffstore=(...n)=>this.chain(new dt(n,this.commandOptions));set=(n,t,o)=>this.chain(new ct([n,t,o],this.commandOptions));setbit=(...n)=>this.chain(new ut(n,this.commandOptions));setex=(n,t,o)=>this.chain(new ht([n,t,o],this.commandOptions));setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions));setrange=(...n)=>this.chain(new Ct(n,this.commandOptions));sinter=(...n)=>this.chain(new gt(n,this.commandOptions));sinterstore=(...n)=>this.chain(new xt(n,this.commandOptions));sismember=(n,t)=>this.chain(new ft([n,t],this.commandOptions));smembers=(...n)=>this.chain(new yt(n,this.commandOptions));smismember=(n,t)=>this.chain(new bt([n,t],this.commandOptions));smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions));spop=(...n)=>this.chain(new Ot(n,this.commandOptions));srandmember=(...n)=>this.chain(new wt(n,this.commandOptions));srem=(n,...t)=>this.chain(new Dt([n,...t],this.commandOptions));sscan=(...n)=>this.chain(new kt(n,this.commandOptions));strlen=(...n)=>this.chain(new At(n,this.commandOptions));sunion=(...n)=>this.chain(new St(n,this.commandOptions));sunionstore=(...n)=>this.chain(new Rt(n,this.commandOptions));time=()=>this.chain(new vt(this.commandOptions));touch=(...n)=>this.chain(new Mt(n,this.commandOptions));ttl=(...n)=>this.chain(new Et(n,this.commandOptions));type=(...n)=>this.chain(new zt(n,this.commandOptions));unlink=(...n)=>this.chain(new Jt(n,this.commandOptions));zadd=(...n)=>"score"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions));zcard=(...n)=>this.chain(new Lt(n,this.commandOptions));zcount=(...n)=>this.chain(new It(n,this.commandOptions));zincrby=(n,t,o)=>this.chain(new Kt([n,t,o],this.commandOptions));zinterstore=(...n)=>this.chain(new Nt(n,this.commandOptions));zlexcount=(...n)=>this.chain(new Pt(n,this.commandOptions));zmscore=(...n)=>this.chain(new Qt(n,this.commandOptions));zpopmax=(...n)=>this.chain(new Zt(n,this.commandOptions));zpopmin=(...n)=>this.chain(new Gt(n,this.commandOptions));zrange=(...n)=>this.chain(new Ut(n,this.commandOptions));zrank=(n,t)=>this.chain(new Bt([n,t],this.commandOptions));zrem=(n,...t)=>this.chain(new Ht([n,...t],this.commandOptions));zremrangebylex=(...n)=>this.chain(new Ft(n,this.commandOptions));zremrangebyrank=(...n)=>this.chain(new $t(n,this.commandOptions));zremrangebyscore=(...n)=>this.chain(new qt(n,this.commandOptions));zrevrank=(n,t)=>this.chain(new jt([n,t],this.commandOptions));zscan=(...n)=>this.chain(new Xt(n,this.commandOptions));zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions));zunionstore=(...n)=>this.chain(new _t(n,this.commandOptions));zunion=(...n)=>this.chain(new Yt(n,this.commandOptions));get json(){return{arrappend:(...n)=>this.chain(new rn(n,this.commandOptions)),arrindex:(...n)=>this.chain(new an(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new pn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new dn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new cn(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new un(n,this.commandOptions)),clear:(...n)=>this.chain(new hn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new Cn(n,this.commandOptions)),geoadd:(...n)=>new M(n,this.commandOptions).exec(this.client),geodist:(...n)=>new E(n,this.commandOptions).exec(this.client),geopos:(...n)=>new z(n,this.commandOptions).exec(this.client),geohash:(...n)=>new J(n,this.commandOptions).exec(this.client),geosearch:(...n)=>new L(n,this.commandOptions).exec(this.client),geosearchstore:(...n)=>new I(n,this.commandOptions).exec(this.client),get:(...n)=>this.chain(new gn(n,this.commandOptions)),mget:(...n)=>this.chain(new xn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new fn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new yn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new bn(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new On(n,this.commandOptions)),set:(...n)=>this.chain(new wn(n,this.commandOptions)),strappend:(...n)=>this.chain(new Dn(n,this.commandOptions)),strlen:(...n)=>this.chain(new kn(n,this.commandOptions)),toggle:(...n)=>this.chain(new An(n,this.commandOptions)),type:(...n)=>this.chain(new Sn(n,this.commandOptions))}}};var ge=ue(require("crypto-js/enc-hex")),xe=ue(require("crypto-js/sha1")),re=class{script;sha1;redis;constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return ge.default.stringify((0,xe.default)(n))}};var ae=class{client;opts;enableTelemetry;constructor(n,t){this.client=n,this.opts=t,this.enableTelemetry=t?.enableTelemetry??!0}get json(){return{arrappend:(...n)=>new rn(n,this.opts).exec(this.client),arrindex:(...n)=>new an(n,this.opts).exec(this.client),arrinsert:(...n)=>new pn(n,this.opts).exec(this.client),arrlen:(...n)=>new dn(n,this.opts).exec(this.client),arrpop:(...n)=>new cn(n,this.opts).exec(this.client),arrtrim:(...n)=>new un(n,this.opts).exec(this.client),clear:(...n)=>new hn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new Cn(n,this.opts).exec(this.client),geoadd:(...n)=>new M(n,this.opts).exec(this.client),geopos:(...n)=>new z(n,this.opts).exec(this.client),geodist:(...n)=>new E(n,this.opts).exec(this.client),geohash:(...n)=>new J(n,this.opts).exec(this.client),geosearch:(...n)=>new L(n,this.opts).exec(this.client),geosearchstore:(...n)=>new I(n,this.opts).exec(this.client),get:(...n)=>new gn(n,this.opts).exec(this.client),mget:(...n)=>new xn(n,this.opts).exec(this.client),numincrby:(...n)=>new fn(n,this.opts).exec(this.client),nummultby:(...n)=>new yn(n,this.opts).exec(this.client),objkeys:(...n)=>new bn(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new On(n,this.opts).exec(this.client),set:(...n)=>new wn(n,this.opts).exec(this.client),strappend:(...n)=>new Dn(n,this.opts).exec(this.client),strlen:(...n)=>new kn(n,this.opts).exec(this.client),toggle:(...n)=>new An(n,this.opts).exec(this.client),type:(...n)=>new Sn(n,this.opts).exec(this.client)}}use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)};addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch{}};createScript(n){return new re(this,n)}pipeline=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!1});multi=()=>new ne({client:this.client,commandOptions:this.opts,multiExec:!0});append=(...n)=>new l(n,this.opts).exec(this.client);bitcount=(...n)=>new C(n,this.opts).exec(this.client);bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client);bitpos=(...n)=>new x(n,this.opts).exec(this.client);dbsize=()=>new f(this.opts).exec(this.client);decr=(...n)=>new y(n,this.opts).exec(this.client);decrby=(...n)=>new b(n,this.opts).exec(this.client);del=(...n)=>new T(n,this.opts).exec(this.client);echo=(...n)=>new O(n,this.opts).exec(this.client);eval=(...n)=>new w(n,this.opts).exec(this.client);evalsha=(...n)=>new D(n,this.opts).exec(this.client);exists=(...n)=>new k(n,this.opts).exec(this.client);expire=(...n)=>new A(n,this.opts).exec(this.client);expireat=(...n)=>new S(n,this.opts).exec(this.client);flushall=n=>new R(n,this.opts).exec(this.client);flushdb=(...n)=>new v(n,this.opts).exec(this.client);get=(...n)=>new K(n,this.opts).exec(this.client);getbit=(...n)=>new N(n,this.opts).exec(this.client);getdel=(...n)=>new P(n,this.opts).exec(this.client);getrange=(...n)=>new Z(n,this.opts).exec(this.client);getset=(n,t)=>new G([n,t],this.opts).exec(this.client);hdel=(...n)=>new U(n,this.opts).exec(this.client);hexists=(...n)=>new B(n,this.opts).exec(this.client);hget=(...n)=>new H(n,this.opts).exec(this.client);hgetall=(...n)=>new F(n,this.opts).exec(this.client);hincrby=(...n)=>new $(n,this.opts).exec(this.client);hincrbyfloat=(...n)=>new q(n,this.opts).exec(this.client);hkeys=(...n)=>new j(n,this.opts).exec(this.client);hlen=(...n)=>new X(n,this.opts).exec(this.client);hmget=(...n)=>new W(n,this.opts).exec(this.client);hmset=(n,t)=>new Y([n,t],this.opts).exec(this.client);hrandfield=(n,t,o)=>new _([n,t,o],this.opts).exec(this.client);hscan=(...n)=>new V(n,this.opts).exec(this.client);hset=(n,t)=>new Q([n,t],this.opts).exec(this.client);hsetnx=(n,t,o)=>new nn([n,t,o],this.opts).exec(this.client);hstrlen=(...n)=>new tn(n,this.opts).exec(this.client);hvals=(...n)=>new en(n,this.opts).exec(this.client);incr=(...n)=>new on(n,this.opts).exec(this.client);incrby=(...n)=>new sn(n,this.opts).exec(this.client);incrbyfloat=(...n)=>new mn(n,this.opts).exec(this.client);keys=(...n)=>new Rn(n,this.opts).exec(this.client);lindex=(...n)=>new vn(n,this.opts).exec(this.client);linsert=(n,t,o,m)=>new Mn([n,t,o,m],this.opts).exec(this.client);llen=(...n)=>new En(n,this.opts).exec(this.client);lmove=(...n)=>new zn(n,this.opts).exec(this.client);lpop=(...n)=>new Jn(n,this.opts).exec(this.client);lpos=(...n)=>new Ln(n,this.opts).exec(this.client);lpush=(n,...t)=>new In([n,...t],this.opts).exec(this.client);lpushx=(n,...t)=>new Kn([n,...t],this.opts).exec(this.client);lrange=(...n)=>new Nn(n,this.opts).exec(this.client);lrem=(n,t,o)=>new Pn([n,t,o],this.opts).exec(this.client);lset=(n,t,o)=>new Zn([n,t,o],this.opts).exec(this.client);ltrim=(...n)=>new Gn(n,this.opts).exec(this.client);mget=(...n)=>new Un(n,this.opts).exec(this.client);mset=n=>new Bn([n],this.opts).exec(this.client);msetnx=n=>new Hn([n],this.opts).exec(this.client);persist=(...n)=>new Fn(n,this.opts).exec(this.client);pexpire=(...n)=>new $n(n,this.opts).exec(this.client);pexpireat=(...n)=>new qn(n,this.opts).exec(this.client);ping=n=>new jn(n,this.opts).exec(this.client);psetex=(n,t,o)=>new Xn([n,t,o],this.opts).exec(this.client);pttl=(...n)=>new Wn(n,this.opts).exec(this.client);publish=(...n)=>new Yn(n,this.opts).exec(this.client);randomkey=()=>new _n().exec(this.client);rename=(...n)=>new Vn(n,this.opts).exec(this.client);renamenx=(...n)=>new Qn(n,this.opts).exec(this.client);rpop=(...n)=>new nt(n,this.opts).exec(this.client);rpush=(n,...t)=>new tt([n,...t],this.opts).exec(this.client);rpushx=(n,...t)=>new et([n,...t],this.opts).exec(this.client);sadd=(n,...t)=>new ot([n,...t],this.opts).exec(this.client);scan=(...n)=>new st(n,this.opts).exec(this.client);scard=(...n)=>new mt(n,this.opts).exec(this.client);scriptExists=(...n)=>new rt(n,this.opts).exec(this.client);scriptFlush=(...n)=>new at(n,this.opts).exec(this.client);scriptLoad=(...n)=>new it(n,this.opts).exec(this.client);sdiff=(...n)=>new pt(n,this.opts).exec(this.client);sdiffstore=(...n)=>new dt(n,this.opts).exec(this.client);set=(n,t,o)=>new ct([n,t,o],this.opts).exec(this.client);setbit=(...n)=>new ut(n,this.opts).exec(this.client);setex=(n,t,o)=>new ht([n,t,o],this.opts).exec(this.client);setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client);setrange=(...n)=>new Ct(n,this.opts).exec(this.client);sinter=(...n)=>new gt(n,this.opts).exec(this.client);sinterstore=(...n)=>new xt(n,this.opts).exec(this.client);sismember=(n,t)=>new ft([n,t],this.opts).exec(this.client);smismember=(n,t)=>new bt([n,t],this.opts).exec(this.client);smembers=(...n)=>new yt(n,this.opts).exec(this.client);smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client);spop=(...n)=>new Ot(n,this.opts).exec(this.client);srandmember=(...n)=>new wt(n,this.opts).exec(this.client);srem=(n,...t)=>new Dt([n,...t],this.opts).exec(this.client);sscan=(...n)=>new kt(n,this.opts).exec(this.client);strlen=(...n)=>new At(n,this.opts).exec(this.client);sunion=(...n)=>new St(n,this.opts).exec(this.client);sunionstore=(...n)=>new Rt(n,this.opts).exec(this.client);time=()=>new vt().exec(this.client);touch=(...n)=>new Mt(n,this.opts).exec(this.client);ttl=(...n)=>new Et(n,this.opts).exec(this.client);type=(...n)=>new zt(n,this.opts).exec(this.client);unlink=(...n)=>new Jt(n,this.opts).exec(this.client);xadd=(...n)=>new se(n,this.opts).exec(this.client);xrange=(...n)=>new me(n,this.opts).exec(this.client);zadd=(...n)=>"score"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client);zcard=(...n)=>new Lt(n,this.opts).exec(this.client);zcount=(...n)=>new It(n,this.opts).exec(this.client);zdiffstore=(...n)=>new Vt(n,this.opts).exec(this.client);zincrby=(n,t,o)=>new Kt([n,t,o],this.opts).exec(this.client);zinterstore=(...n)=>new Nt(n,this.opts).exec(this.client);zlexcount=(...n)=>new Pt(n,this.opts).exec(this.client);zmscore=(...n)=>new Qt(n,this.opts).exec(this.client);zpopmax=(...n)=>new Zt(n,this.opts).exec(this.client);zpopmin=(...n)=>new Gt(n,this.opts).exec(this.client);zrange=(...n)=>new Ut(n,this.opts).exec(this.client);zrank=(n,t)=>new Bt([n,t],this.opts).exec(this.client);zrem=(n,...t)=>new Ht([n,...t],this.opts).exec(this.client);zremrangebylex=(...n)=>new Ft(n,this.opts).exec(this.client);zremrangebyrank=(...n)=>new $t(n,this.opts).exec(this.client);zremrangebyscore=(...n)=>new qt(n,this.opts).exec(this.client);zrevrank=(n,t)=>new jt([n,t],this.opts).exec(this.client);zscan=(...n)=>new Xt(n,this.opts).exec(this.client);zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client);zunion=(...n)=>new Yt(n,this.opts).exec(this.client);zunionstore=(...n)=>new _t(n,this.opts).exec(this.client)};var fe="v0.0.0-ci.0681c5bc1d0b8d8475e81cded2f12ed58fed4c1c";typeof atob>"u"&&(global.atob=function(s){return Buffer.from(s,"base64").toString("utf-8")});var pe=class s extends ae{constructor(n){if("request"in n){super(n);return}(n.url.startsWith(" ")||n.url.endsWith(" ")||/\r|\n/.test(n.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(n.token.startsWith(" ")||n.token.endsWith(" ")||/\r|\n/.test(n.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new oe({baseUrl:n.url,retry:n.retry,headers:{authorization:`Bearer ${n.token}`},agent:n.agent,responseEncoding:n.responseEncoding,cache:n.cache||"no-store"});super(t,{automaticDeserialization:n.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${fe}`})}static fromEnv(n){if(typeof process?.env>"u")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let t=process?.env.UPSTASH_REDIS_REST_URL;if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let o=process?.env.UPSTASH_REDIS_REST_TOKEN;if(!o)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new s({...n,url:t,token:o})}};0&&(module.exports={Redis}); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunk444SOLGYjs = require('./chunk-444SOLGY.js');typeof atob>"u"&&(global.atob=o=>Buffer.from(o,"base64").toString("utf8"));var a=class o extends _chunk444SOLGYjs.c{constructor(e){if("request"in e){super(e);return}if(!e.url)throw new Error("[Upstash Redis] The 'url' property is missing or undefined in your Redis config.");if(!e.token)throw new Error("[Upstash Redis] The 'token' property is missing or undefined in your Redis config.");(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let n=new (0, _chunk444SOLGYjs.b)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:_nullishCoalesce(e.cache, () => ("no-store")),signal:e.signal,keepAlive:e.keepAlive,readYourWrites:e.readYourWrites});if(super(n,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY,latencyLogging:e.latencyLogging,enableAutoPipelining:e.enableAutoPipelining}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${_chunk444SOLGYjs.d}`}),this.enableAutoPipelining)return this.autoPipeline()}static fromEnv(e){if(process.env===void 0)throw new TypeError('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let n=process.env.UPSTASH_REDIS_REST_URL;if(!n)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let t=process.env.UPSTASH_REDIS_REST_TOKEN;if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new o({...e,url:n,token:t})}};exports.Redis = a; exports.errors = _chunk444SOLGYjs.a; |
@@ -1,54 +0,1 @@ | ||
{ | ||
"name": "@upstash/redis", | ||
"version": "0.0.0-ci.0681c5bc1d0b8d8475e81cded2f12ed58fed4c1c", | ||
"main": "./nodejs.js", | ||
"types": "./nodejs.d.ts", | ||
"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 README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/", | ||
"test": "bun test pkg --coverage", | ||
"fmt": "bunx @biomejs/biome check --apply ./pkg" | ||
}, | ||
"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", | ||
"typesVersions": { | ||
"*": { | ||
"nodejs": [ | ||
"./nodejs.d.ts" | ||
], | ||
"cloudflare": [ | ||
"./cloudflare.d.ts" | ||
], | ||
"fastly": [ | ||
"./fastly.d.ts" | ||
] | ||
} | ||
}, | ||
"devDependencies": { | ||
"@types/crypto-js": "^4.1.3", | ||
"bun-types": "^1.0.6", | ||
"tsup": "^7.2.0" | ||
}, | ||
"dependencies": { | ||
"@biomejs/biome": "^1.3.0", | ||
"crypto-js": "^4.1.1" | ||
} | ||
} | ||
{"name":"@upstash/redis","version":"v0.0.0-ci.0684278061528494d3e77924f9572f2ead11f985-20240819072857","main":"./nodejs.js","module":"./nodejs.mjs","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node.js":"./node.js","./node.mjs":"./node.mjs","./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":"./cloudflare.js","./cloudflare.mjs":"./cloudflare.mjs","./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":"./fastly.js","./fastly.mjs":"./fastly.mjs"},"types":"./nodejs.d.ts","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 README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test pkg","fmt":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","lint":"eslint . --ext .ts,.tsx,.js,.jsx","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","lint:fix":"eslint . --ext .ts,.tsx,.js,.jsx --fix","commit":"cz","lint:format":"bun run lint:fix && bun run format"},"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","typesVersions":{"*":{"nodejs":["./nodejs.d.ts"],"cloudflare":["./cloudflare.d.ts"],"fastly":["./fastly.d.ts"]}},"devDependencies":{"@biomejs/biome":"latest","@commitlint/cli":"^19.3.0","@commitlint/config-conventional":"^19.2.2","@types/crypto-js":"^4.1.3","@typescript-eslint/eslint-plugin":"7.17.0","@typescript-eslint/parser":"7.17.0","bun-types":"1.0.33","eslint":"8.56","eslint-plugin-unicorn":"55.0.0","husky":"^9.1.1","prettier":"^3.3.3","tsup":"^8.2.3","typescript":"latest"},"dependencies":{"crypto-js":"^4.2.0"}} |
@@ -10,2 +10,7 @@ # Upstash Redis | ||
> [!NOTE] | ||
> **This project is in GA Stage.** | ||
> | ||
> The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes. The Upstash team is committed to maintaining and improving its functionality. | ||
It is the only connectionless (HTTP based) Redis client and designed for: | ||
@@ -24,3 +29,3 @@ | ||
See | ||
[the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility) | ||
[the list of APIs](https://upstash.com/docs/redis/overall/rediscompatibility) | ||
supported. | ||
@@ -95,3 +100,3 @@ | ||
See [the documentation](https://docs.upstash.com/features/javascriptsdk) for | ||
See [the documentation](https://upstash.com/docs/redis/sdks/ts/overview) for | ||
details. | ||
@@ -120,3 +125,2 @@ | ||
### Telemetry | ||
@@ -123,0 +127,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
414183
1
19
4030
137
4
13
5
- Removed@biomejs/biome@^1.3.0
- Removed@biomejs/biome@1.9.4(transitive)
- Removed@biomejs/cli-darwin-arm64@1.9.4(transitive)
- Removed@biomejs/cli-darwin-x64@1.9.4(transitive)
- Removed@biomejs/cli-linux-arm64@1.9.4(transitive)
- Removed@biomejs/cli-linux-arm64-musl@1.9.4(transitive)
- Removed@biomejs/cli-linux-x64@1.9.4(transitive)
- Removed@biomejs/cli-linux-x64-musl@1.9.4(transitive)
- Removed@biomejs/cli-win32-arm64@1.9.4(transitive)
- Removed@biomejs/cli-win32-x64@1.9.4(transitive)
Updatedcrypto-js@^4.2.0