@superinterface/server 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_btwyo7 +1 -1
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3a25f63d._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__3a25f63d._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__47b17fad._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__47b17fad._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__4d829477._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__4d829477._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__6169c901._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__6169c901._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f6f61507._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__f6f61507._.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js.map +1 -1
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js +2 -2
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js.map +1 -1
- package/.next/server/chunks/supercorp_superinterface_packages_server_src_lib_redis_index_ts_48651b89._.js +1 -1
- package/.next/server/chunks/supercorp_superinterface_packages_server_src_lib_redis_index_ts_48651b89._.js.map +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/trace +1 -1
- package/dist/lib/functions/handleFunction/handleAssistant.d.ts.map +1 -1
- package/dist/lib/functions/handleFunction/handleAssistant.js +2 -1
- package/dist/lib/mcpServers/mcpServerSchema.d.ts +38 -38
- package/package.json +13 -13
- /package/.next/static/{cZmvRia199GN-T-igoV-V → dXEiOKbSMZ_04KIJ80L9x}/_buildManifest.js +0 -0
- /package/.next/static/{cZmvRia199GN-T-igoV-V → dXEiOKbSMZ_04KIJ80L9x}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{cZmvRia199GN-T-igoV-V → dXEiOKbSMZ_04KIJ80L9x}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[44784,e=>{"use strict";e.s(["redis",()=>sR],44784);var t=e.i(66680);let s=t.default.webcrypto?.subtle||{};var n=Object.defineProperty;((e,t)=>{for(var s in t)n(e,s,{get:t[s],enumerable:!0})})({},{UpstashError:()=>i,UrlError:()=>r});var i=class extends Error{constructor(e){super(e),this.name="UpstashError"}},r=class extends Error{constructor(e){super(`Upstash Redis client was passed an invalid URL. You should pass a URL starting with https. Received: "${e}". `),this.name="UrlError"}};function c(e){try{return function e(t){let s=Array.isArray(t)?t.map(t=>{try{return e(t)}catch{return t}}):JSON.parse(t);return"number"==typeof s&&s.toString()!==t?t:s}(e)}catch{return e}}function o(e){return[e[0],...c(e.slice(1))]}function h(e){let[t,s]=e,n=[];for(let e=0;e<s.length;e+=2)n.push({key:s[e],type:s[e+1]});return[t,n]}var a=class{baseUrl;headers;options;readYourWrites;upstashSyncToken="";hasCredentials;retry;constructor(e){if(this.options={backend:e.options?.backend,agent:e.agent,responseEncoding:e.responseEncoding??"base64",cache:e.cache,signal:e.signal,keepAlive:e.keepAlive??!0},this.upstashSyncToken="",this.readYourWrites=e.readYourWrites??!0,this.baseUrl=(e.baseUrl||"").replace(/\/$/,""),this.baseUrl&&!/^https?:\/\/[^\s#$./?].\S*$/.test(this.baseUrl))throw new r(this.baseUrl);this.headers={"Content-Type":"application/json",...e.headers},this.hasCredentials=!!(this.baseUrl&&this.headers.authorization.split(" ")[1]),"base64"===this.options.responseEncoding&&(this.headers["Upstash-Encoding"]="base64"),this.retry="boolean"!=typeof e.retry||e.retry?{attempts:e.retry?.retries??5,backoff:e.retry?.backoff??(e=>50*Math.exp(e))}:{attempts:1,backoff:()=>0}}mergeTelemetry(e){this.headers=u(this.headers,"Upstash-Telemetry-Runtime",e.runtime),this.headers=u(this.headers,"Upstash-Telemetry-Platform",e.platform),this.headers=u(this.headers,"Upstash-Telemetry-Sdk",e.sdk)}async request(e){let t=function(...e){let t={};for(let s of e)if(s)for(let[e,n]of Object.entries(s))null!=n&&(t[e]=n);return t}(this.headers,e.headers??{}),s=[this.baseUrl,...e.path??[]].join("/"),n="text/event-stream"===t.Accept,r=e.signal??this.options.signal,c="function"==typeof r,o={cache:this.options.cache,method:"POST",headers:t,body:JSON.stringify(e.body),keepalive:this.options.keepAlive,agent:this.options.agent,signal:c?r():r,backend:this.options.backend};if(this.hasCredentials||console.warn("[Upstash Redis] Redis client was initialized without url or token. Failed to execute command."),this.readYourWrites){let e=this.upstashSyncToken;this.headers["upstash-sync-token"]=e}let h=null,a=null;for(let e=0;e<=this.retry.attempts;e++)try{h=await fetch(s,o);break}catch(t){if(o.signal?.aborted&&c)throw t;if(o.signal?.aborted){h=new Response(new Blob([JSON.stringify({result:o.signal.reason??"Aborted"})]),{status:200,statusText:o.signal.reason??"Aborted"});break}a=t,e<this.retry.attempts&&await new Promise(t=>setTimeout(t,this.retry.backoff(e)))}if(!h)throw a??Error("Exhausted all retries");if(!h.ok){let t=await h.json();throw new i(`${t.error}, command was: ${JSON.stringify(e.body)}`)}if(this.readYourWrites){let e=h.headers;this.upstashSyncToken=e.get("upstash-sync-token")??""}if(n&&e&&e.onMessage&&h.body){let t=h.body.getReader(),s=new TextDecoder;return(async()=>{try{for(;;){let{value:n,done:i}=await t.read();if(i)break;for(let t of s.decode(n).split("\n"))if(t.startsWith("data: ")){let s=t.slice(6);e.onMessage?.(s)}}}catch(e){e instanceof Error&&"AbortError"===e.name||console.error("Stream reading error:",e)}finally{try{await t.cancel()}catch{}}})(),{result:1}}let p=await h.json();if(this.readYourWrites){let e=h.headers;this.upstashSyncToken=e.get("upstash-sync-token")??""}return"base64"===this.options.responseEncoding?Array.isArray(p)?p.map(({result:e,error:t})=>({result:l(e),error:t})):{result:l(p.result),error:p.error}:p}};function p(e){let t="";try{let s=atob(e),n=s.length,i=new Uint8Array(n);for(let e=0;e<n;e++)i[e]=s.charCodeAt(e);t=new TextDecoder().decode(i)}catch{t=e}return t}function l(e){let t;switch(typeof e){case"undefined":return e;case"number":t=e;break;case"object":t=Array.isArray(e)?e.map(e=>"string"==typeof e?p(e):Array.isArray(e)?e.map(e=>l(e)):e):null;break;case"string":t="OK"===e?"OK":p(e)}return t}function u(e,t,s){return s&&(e[t]=e[t]?[e[t],s].join(","):s),e}var m=e=>{switch(typeof e){case"string":case"number":case"boolean":return e;default:return JSON.stringify(e)}},d=class{command;serialize;deserialize;headers;path;onMessage;isStreaming;signal;constructor(e,t){if(this.serialize=m,this.deserialize=t?.automaticDeserialization===void 0||t.automaticDeserialization?t?.deserialize??c:e=>e,this.command=e.map(e=>this.serialize(e)),this.headers=t?.headers,this.path=t?.path,this.onMessage=t?.streamOptions?.onMessage,this.isStreaming=t?.streamOptions?.isStreaming??!1,this.signal=t?.streamOptions?.signal,t?.latencyLogging){let e=this.exec.bind(this);this.exec=async t=>{let s=performance.now(),n=await e(t),i=(performance.now()-s).toFixed(2);return console.log(`Latency for \x1b[38;2;19;185;39m${this.command[0].toString().toUpperCase()}\x1b[0m: \x1b[38;2;0;255;255m${i} ms\x1b[0m`),n}}}async exec(e){let{result:t,error:s}=await e.request({body:this.command,path:this.path,upstashSyncToken:e.upstashSyncToken,headers:this.headers,onMessage:this.onMessage,isStreaming:this.isStreaming,signal:this.signal});if(s)throw new i(s);if(void 0===t)throw TypeError("Request did not return a result");return this.deserialize(t)}},x=class extends d{constructor(e,t){let s=["hrandfield",e[0]];"number"==typeof e[1]&&s.push(e[1]),e[2]&&s.push("WITHVALUES"),super(s,{deserialize:e[2]?e=>(function(e){if(0===e.length)return null;let t={};for(let s=0;s<e.length;s+=2){let n=e[s],i=e[s+1];try{t[n]=JSON.parse(i)}catch{t[n]=i}}return t})(e):t?.deserialize,...t})}},w=class extends d{constructor(e,t){super(["append",...e],t)}},y=class extends d{constructor([e,t,s],n){let i=["bitcount",e];"number"==typeof t&&i.push(t),"number"==typeof s&&i.push(s),super(i,n)}},g=class{constructor(e,t,s,n=e=>e.exec(this.client)){this.client=t,this.opts=s,this.execOperation=n,this.command=["bitfield",...e]}command;chain(...e){return this.command.push(...e),this}get(...e){return this.chain("get",...e)}set(...e){return this.chain("set",...e)}incrby(...e){return this.chain("incrby",...e)}overflow(e){return this.chain("overflow",e)}exec(){let e=new d(this.command,this.opts);return this.execOperation(e)}},O=class extends d{constructor(e,t){super(["bitop",...e],t)}},b=class extends d{constructor(e,t){super(["bitpos",...e],t)}},f=class extends d{constructor([e,t,s],n){super(["COPY",e,t,...s?.replace?["REPLACE"]:[]],{...n,deserialize:e=>e>0?"COPIED":"NOT_COPIED"})}},E=class extends d{constructor(e){super(["dbsize"],e)}},S=class extends d{constructor(e,t){super(["decr",...e],t)}},A=class extends d{constructor(e,t){super(["decrby",...e],t)}},T=class extends d{constructor(e,t){super(["del",...e],t)}},R=class extends d{constructor(e,t){super(["echo",...e],t)}},v=class extends d{constructor([e,t,s],n){super(["eval_ro",e,t.length,...t,...s??[]],n)}},N=class extends d{constructor([e,t,s],n){super(["eval",e,t.length,...t,...s??[]],n)}},z=class extends d{constructor([e,t,s],n){super(["evalsha_ro",e,t.length,...t,...s??[]],n)}},k=class extends d{constructor([e,t,s],n){super(["evalsha",e,t.length,...t,...s??[]],n)}},U=class extends d{constructor(e,t){super(e.map(e=>"string"==typeof e?e:String(e)),t)}},C=class extends d{constructor(e,t){super(["exists",...e],t)}},P=class extends d{constructor(e,t){super(["expire",...e.filter(Boolean)],t)}},L=class extends d{constructor(e,t){super(["expireat",...e],t)}},I=class extends d{constructor(e,t){let s=["flushall"];e&&e.length>0&&e[0].async&&s.push("async"),super(s,t)}},M=class extends d{constructor([e],t){let s=["flushdb"];e?.async&&s.push("async"),super(s,t)}},D=class extends d{constructor([e,t,...s],n){let i=["geoadd",e];"nx"in t&&t.nx?i.push("nx"):"xx"in t&&t.xx&&i.push("xx"),"ch"in t&&t.ch&&i.push("ch"),"latitude"in t&&t.latitude&&i.push(t.longitude,t.latitude,t.member),i.push(...s.flatMap(({latitude:e,longitude:t,member:s})=>[t,e,s])),super(i,n)}},J=class extends d{constructor([e,t,s,n="M"],i){super(["GEODIST",e,t,s,n],i)}},F=class extends d{constructor(e,t){let[s]=e;super(["GEOHASH",s,...Array.isArray(e[1])?e[1]:e.slice(1)],t)}},Y=class extends d{constructor(e,t){let[s]=e;super(["GEOPOS",s,...Array.isArray(e[1])?e[1]:e.slice(1)],{deserialize:e=>(function(e){let t=[];for(let s of e)s?.[0]&&s?.[1]&&t.push({lng:Number.parseFloat(s[0]),lat:Number.parseFloat(s[1])});return t})(e),...t})}},j=class extends d{constructor([e,t,s,n,i],r){let c=["GEOSEARCH",e];("FROMMEMBER"===t.type||"frommember"===t.type)&&c.push(t.type,t.member),("FROMLONLAT"===t.type||"fromlonlat"===t.type)&&c.push(t.type,t.coordinate.lon,t.coordinate.lat),("BYRADIUS"===s.type||"byradius"===s.type)&&c.push(s.type,s.radius,s.radiusType),("BYBOX"===s.type||"bybox"===s.type)&&c.push(s.type,s.rect.width,s.rect.height,s.rectType),c.push(n),i?.count&&c.push("COUNT",i.count.limit,...i.count.any?["ANY"]:[]),super([...c,...i?.withCoord?["WITHCOORD"]:[],...i?.withDist?["WITHDIST"]:[],...i?.withHash?["WITHHASH"]:[]],{deserialize:e=>i?.withCoord||i?.withDist||i?.withHash?e.map(e=>{let t=1,s={};try{s.member=JSON.parse(e[0])}catch{s.member=e[0]}return i.withDist&&(s.dist=Number.parseFloat(e[t++])),i.withHash&&(s.hash=e[t++].toString()),i.withCoord&&(s.coord={long:Number.parseFloat(e[t][0]),lat:Number.parseFloat(e[t][1])}),s}):e.map(e=>{try{return{member:JSON.parse(e)}}catch{return{member:e}}}),...r})}},_=class extends d{constructor([e,t,s,n,i,r],c){let o=["GEOSEARCHSTORE",e,t];("FROMMEMBER"===s.type||"frommember"===s.type)&&o.push(s.type,s.member),("FROMLONLAT"===s.type||"fromlonlat"===s.type)&&o.push(s.type,s.coordinate.lon,s.coordinate.lat),("BYRADIUS"===n.type||"byradius"===n.type)&&o.push(n.type,n.radius,n.radiusType),("BYBOX"===n.type||"bybox"===n.type)&&o.push(n.type,n.rect.width,n.rect.height,n.rectType),o.push(i),r?.count&&o.push("COUNT",r.count.limit,...r.count.any?["ANY"]:[]),super([...o,...r?.storeDist?["STOREDIST"]:[]],c)}},$=class extends d{constructor(e,t){super(["get",...e],t)}},W=class extends d{constructor(e,t){super(["getbit",...e],t)}},X=class extends d{constructor(e,t){super(["getdel",...e],t)}},G=class extends d{constructor([e,t],s){let n=["getex",e];t&&("ex"in t&&"number"==typeof t.ex?n.push("ex",t.ex):"px"in t&&"number"==typeof t.px?n.push("px",t.px):"exat"in t&&"number"==typeof t.exat?n.push("exat",t.exat):"pxat"in t&&"number"==typeof t.pxat?n.push("pxat",t.pxat):"persist"in t&&t.persist&&n.push("persist")),super(n,s)}},H=class extends d{constructor(e,t){super(["getrange",...e],t)}},B=class extends d{constructor(e,t){super(["getset",...e],t)}},K=class extends d{constructor(e,t){super(["hdel",...e],t)}},q=class extends d{constructor(e,t){super(["hexists",...e],t)}},V=class extends d{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hexpire",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},Q=class extends d{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hexpireat",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},Z=class extends d{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hexpiretime",s,"FIELDS",i.length,...i],t)}},ee=class extends d{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpersist",s,"FIELDS",i.length,...i],t)}},et=class extends d{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hpexpire",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},es=class extends d{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hpexpireat",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},en=class extends d{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpexpiretime",s,"FIELDS",i.length,...i],t)}},ei=class extends d{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpttl",s,"FIELDS",i.length,...i],t)}},er=class extends d{constructor(e,t){super(["hget",...e],t)}},ec=class extends d{constructor(e,t){super(["hgetall",...e],{deserialize:e=>(function(e){if(0===e.length)return null;let t={};for(let s=0;s<e.length;s+=2){let n=e[s],i=e[s+1];try{let e=!Number.isNaN(Number(i))&&!Number.isSafeInteger(Number(i));t[n]=e?i:JSON.parse(i)}catch{t[n]=i}}return t})(e),...t})}},eo=class extends d{constructor(e,t){super(["hincrby",...e],t)}},eh=class extends d{constructor(e,t){super(["hincrbyfloat",...e],t)}},ea=class extends d{constructor([e],t){super(["hkeys",e],t)}},ep=class extends d{constructor(e,t){super(["hlen",...e],t)}},el=class extends d{constructor([e,...t],s){super(["hmget",e,...t],{deserialize:e=>(function(e,t){if(t.every(e=>null===e))return null;let s={};for(let[n,i]of e.entries())try{s[i]=JSON.parse(t[n])}catch{s[i]=t[n]}return s})(t,e),...s})}},eu=class extends d{constructor([e,t],s){super(["hmset",e,...Object.entries(t).flatMap(([e,t])=>[e,t])],s)}},em=class extends d{constructor([e,t,s],n){let i=["hscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:o,...n})}},ed=class extends d{constructor([e,t],s){super(["hset",e,...Object.entries(t).flatMap(([e,t])=>[e,t])],s)}},ex=class extends d{constructor(e,t){super(["hsetnx",...e],t)}},ew=class extends d{constructor(e,t){super(["hstrlen",...e],t)}},ey=class extends d{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["httl",s,"FIELDS",i.length,...i],t)}},eg=class extends d{constructor(e,t){super(["hvals",...e],t)}},eO=class extends d{constructor(e,t){super(["incr",...e],t)}},eb=class extends d{constructor(e,t){super(["incrby",...e],t)}},ef=class extends d{constructor(e,t){super(["incrbyfloat",...e],t)}},eE=class extends d{constructor(e,t){super(["JSON.ARRAPPEND",...e],t)}},eS=class extends d{constructor(e,t){super(["JSON.ARRINDEX",...e],t)}},eA=class extends d{constructor(e,t){super(["JSON.ARRINSERT",...e],t)}},eT=class extends d{constructor(e,t){super(["JSON.ARRLEN",e[0],e[1]??"$"],t)}},eR=class extends d{constructor(e,t){super(["JSON.ARRPOP",...e],t)}},ev=class extends d{constructor(e,t){let s=e[1]??"$";super(["JSON.ARRTRIM",e[0],s,e[2]??0,e[3]??0],t)}},eN=class extends d{constructor(e,t){super(["JSON.CLEAR",...e],t)}},ez=class extends d{constructor(e,t){super(["JSON.DEL",...e],t)}},ek=class extends d{constructor(e,t){super(["JSON.FORGET",...e],t)}},eU=class extends d{constructor(e,t){let s=["JSON.GET"];"string"==typeof e[1]?s.push(...e):(s.push(e[0]),e[1]&&(e[1].indent&&s.push("INDENT",e[1].indent),e[1].newline&&s.push("NEWLINE",e[1].newline),e[1].space&&s.push("SPACE",e[1].space)),s.push(...e.slice(2))),super(s,t)}},eC=class extends d{constructor(e,t){super(["JSON.MERGE",...e],t)}},eP=class extends d{constructor(e,t){super(["JSON.MGET",...e[0],e[1]],t)}},eL=class extends d{constructor(e,t){let s=["JSON.MSET"];for(let t of e)s.push(t.key,t.path,t.value);super(s,t)}},eI=class extends d{constructor(e,t){super(["JSON.NUMINCRBY",...e],t)}},eM=class extends d{constructor(e,t){super(["JSON.NUMMULTBY",...e],t)}},eD=class extends d{constructor(e,t){super(["JSON.OBJKEYS",...e],t)}},eJ=class extends d{constructor(e,t){super(["JSON.OBJLEN",...e],t)}},eF=class extends d{constructor(e,t){super(["JSON.RESP",...e],t)}},eY=class extends d{constructor(e,t){let s=["JSON.SET",e[0],e[1],e[2]];e[3]&&(e[3].nx?s.push("NX"):e[3].xx&&s.push("XX")),super(s,t)}},ej=class extends d{constructor(e,t){super(["JSON.STRAPPEND",...e],t)}},e_=class extends d{constructor(e,t){super(["JSON.STRLEN",...e],t)}},e$=class extends d{constructor(e,t){super(["JSON.TOGGLE",...e],t)}},eW=class extends d{constructor(e,t){super(["JSON.TYPE",...e],t)}},eX=class extends d{constructor(e,t){super(["keys",...e],t)}},eG=class extends d{constructor(e,t){super(["lindex",...e],t)}},eH=class extends d{constructor(e,t){super(["linsert",...e],t)}},eB=class extends d{constructor(e,t){super(["llen",...e],t)}},eK=class extends d{constructor(e,t){super(["lmove",...e],t)}},eq=class extends d{constructor(e,t){let[s,n,i,r]=e;super(["LMPOP",s,...n,i,...r?["COUNT",r]:[]],t)}},eV=class extends d{constructor(e,t){super(["lpop",...e],t)}},eQ=class extends d{constructor(e,t){let s=["lpos",e[0],e[1]];"number"==typeof e[2]?.rank&&s.push("rank",e[2].rank),"number"==typeof e[2]?.count&&s.push("count",e[2].count),"number"==typeof e[2]?.maxLen&&s.push("maxLen",e[2].maxLen),super(s,t)}},eZ=class extends d{constructor(e,t){super(["lpush",...e],t)}},e1=class extends d{constructor(e,t){super(["lpushx",...e],t)}},e0=class extends d{constructor(e,t){super(["lrange",...e],t)}},e2=class extends d{constructor(e,t){super(["lrem",...e],t)}},e5=class extends d{constructor(e,t){super(["lset",...e],t)}},e8=class extends d{constructor(e,t){super(["ltrim",...e],t)}},e3=class extends d{constructor(e,t){super(["mget",...Array.isArray(e[0])?e[0]:e],t)}},e4=class extends d{constructor([e],t){super(["mset",...Object.entries(e).flatMap(([e,t])=>[e,t])],t)}},e6=class extends d{constructor([e],t){super(["msetnx",...Object.entries(e).flat()],t)}},e9=class extends d{constructor(e,t){super(["persist",...e],t)}},e7=class extends d{constructor(e,t){super(["pexpire",...e],t)}},te=class extends d{constructor(e,t){super(["pexpireat",...e],t)}},tt=class extends d{constructor(e,t){super(["pfadd",...e],t)}},ts=class extends d{constructor(e,t){super(["pfcount",...e],t)}},tn=class extends d{constructor(e,t){super(["pfmerge",...e],t)}},ti=class extends d{constructor(e,t){let s=["ping"];e?.[0]!==void 0&&s.push(e[0]),super(s,t)}},tr=class extends d{constructor(e,t){super(["psetex",...e],t)}},tc=class extends d{constructor(e,t){super(["pttl",...e],t)}},to=class extends d{constructor(e,t){super(["publish",...e],t)}},th=class extends d{constructor(e){super(["randomkey"],e)}},ta=class extends d{constructor(e,t){super(["rename",...e],t)}},tp=class extends d{constructor(e,t){super(["renamenx",...e],t)}},tl=class extends d{constructor(e,t){super(["rpop",...e],t)}},tu=class extends d{constructor(e,t){super(["rpush",...e],t)}},tm=class extends d{constructor(e,t){super(["rpushx",...e],t)}},td=class extends d{constructor(e,t){super(["sadd",...e],t)}},tx=class extends d{constructor([e,t],s){let n=["scan",e];t?.match&&n.push("match",t.match),"number"==typeof t?.count&&n.push("count",t.count),t&&"withType"in t&&!0===t.withType?n.push("withtype"):t&&"type"in t&&t.type&&t.type.length>0&&n.push("type",t.type),super(n,{deserialize:t?.withType?h:o,...s})}},tw=class extends d{constructor(e,t){super(["scard",...e],t)}},ty=class extends d{constructor(e,t){super(["script","exists",...e],{deserialize:e=>e,...t})}},tg=class extends d{constructor([e],t){let s=["script","flush"];e?.sync?s.push("sync"):e?.async&&s.push("async"),super(s,t)}},tO=class extends d{constructor(e,t){super(["script","load",...e],t)}},tb=class extends d{constructor(e,t){super(["sdiff",...e],t)}},tf=class extends d{constructor(e,t){super(["sdiffstore",...e],t)}},tE=class extends d{constructor([e,t,s],n){let i=["set",e,t];s&&("nx"in s&&s.nx?i.push("nx"):"xx"in s&&s.xx&&i.push("xx"),"get"in s&&s.get&&i.push("get"),"ex"in s&&"number"==typeof s.ex?i.push("ex",s.ex):"px"in s&&"number"==typeof s.px?i.push("px",s.px):"exat"in s&&"number"==typeof s.exat?i.push("exat",s.exat):"pxat"in s&&"number"==typeof s.pxat?i.push("pxat",s.pxat):"keepTtl"in s&&s.keepTtl&&i.push("keepTtl")),super(i,n)}},tS=class extends d{constructor(e,t){super(["setbit",...e],t)}},tA=class extends d{constructor(e,t){super(["setex",...e],t)}},tT=class extends d{constructor(e,t){super(["setnx",...e],t)}},tR=class extends d{constructor(e,t){super(["setrange",...e],t)}},tv=class extends d{constructor(e,t){super(["sinter",...e],t)}},tN=class extends d{constructor(e,t){super(["sinterstore",...e],t)}},tz=class extends d{constructor(e,t){super(["sismember",...e],t)}},tk=class extends d{constructor(e,t){super(["smembers",...e],t)}},tU=class extends d{constructor(e,t){super(["smismember",e[0],...e[1]],t)}},tC=class extends d{constructor(e,t){super(["smove",...e],t)}},tP=class extends d{constructor([e,t],s){let n=["spop",e];"number"==typeof t&&n.push(t),super(n,s)}},tL=class extends d{constructor([e,t],s){let n=["srandmember",e];"number"==typeof t&&n.push(t),super(n,s)}},tI=class extends d{constructor(e,t){super(["srem",...e],t)}},tM=class extends d{constructor([e,t,s],n){let i=["sscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:o,...n})}},tD=class extends d{constructor(e,t){super(["strlen",...e],t)}},tJ=class extends d{constructor(e,t){super(["sunion",...e],t)}},tF=class extends d{constructor(e,t){super(["sunionstore",...e],t)}},tY=class extends d{constructor(e){super(["time"],e)}},tj=class extends d{constructor(e,t){super(["touch",...e],t)}},t_=class extends d{constructor(e,t){super(["ttl",...e],t)}},t$=class extends d{constructor(e,t){super(["type",...e],t)}},tW=class extends d{constructor(e,t){super(["unlink",...e],t)}},tX=class extends d{constructor([e,t,s],n){super(["XACK",e,t,...Array.isArray(s)?[...s]:[s]],n)}},tG=class extends d{constructor([e,t,s,n],i){let r=["XADD",e];for(let[e,i]of(n&&(n.nomkStream&&r.push("NOMKSTREAM"),n.trim&&(r.push(n.trim.type,n.trim.comparison,n.trim.threshold),void 0!==n.trim.limit&&r.push("LIMIT",n.trim.limit))),r.push(t),Object.entries(s)))r.push(e,i);super(r,i)}},tH=class extends d{constructor([e,t,s,n,i,r],c){let o=[];r?.count&&o.push("COUNT",r.count),r?.justId&&o.push("JUSTID"),super(["XAUTOCLAIM",e,t,s,n,i,...o],c)}},tB=class extends d{constructor([e,t,s,n,i,r],c){let o=Array.isArray(i)?[...i]:[i],h=[];r?.idleMS&&h.push("IDLE",r.idleMS),r?.idleMS&&h.push("TIME",r.timeMS),r?.retryCount&&h.push("RETRYCOUNT",r.retryCount),r?.force&&h.push("FORCE"),r?.justId&&h.push("JUSTID"),r?.lastId&&h.push("LASTID",r.lastId),super(["XCLAIM",e,t,s,n,...o,...h],c)}},tK=class extends d{constructor([e,t],s){super(["XDEL",e,...Array.isArray(t)?[...t]:[t]],s)}},tq=class extends d{constructor([e,t],s){let n=["XGROUP"];switch(t.type){case"CREATE":n.push("CREATE",e,t.group,t.id),t.options&&(t.options.MKSTREAM&&n.push("MKSTREAM"),void 0!==t.options.ENTRIESREAD&&n.push("ENTRIESREAD",t.options.ENTRIESREAD.toString()));break;case"CREATECONSUMER":n.push("CREATECONSUMER",e,t.group,t.consumer);break;case"DELCONSUMER":n.push("DELCONSUMER",e,t.group,t.consumer);break;case"DESTROY":n.push("DESTROY",e,t.group);break;case"SETID":n.push("SETID",e,t.group,t.id),t.options?.ENTRIESREAD!==void 0&&n.push("ENTRIESREAD",t.options.ENTRIESREAD.toString());break;default:throw Error("Invalid XGROUP")}super(n,s)}},tV=class extends d{constructor([e,t],s){let n=[];"CONSUMERS"===t.type?n.push("CONSUMERS",e,t.group):n.push("GROUPS",e),super(["XINFO",...n],s)}},tQ=class extends d{constructor(e,t){super(["XLEN",...e],t)}},tZ=class extends d{constructor([e,t,s,n,i,r],c){super(["XPENDING",e,t,...r?.idleTime?["IDLE",r.idleTime]:[],s,n,i,...r?.consumer===void 0?[]:Array.isArray(r.consumer)?[...r.consumer]:[r.consumer]],c)}},t1=class extends d{constructor([e,t,s,n],i){let r=["XRANGE",e,t,s];"number"==typeof n&&r.push("COUNT",n),super(r,{deserialize:e=>(function(e){let t={};for(let s of e)for(let e=0;e<s.length;e+=2){let n=s[e],i=s[e+1];n in t||(t[n]={});for(let e=0;e<i.length;e+=2){let s=i[e],r=i[e+1];try{t[n][s]=JSON.parse(r)}catch{t[n][s]=r}}}return t})(e),...i})}},t0=class extends d{constructor([e,t,s],n){if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)throw Error("ERR Unbalanced XREAD list of streams: for each stream key an ID or '$' must be specified");let i=[];"number"==typeof s?.count&&i.push("COUNT",s.count),"number"==typeof s?.blockMS&&i.push("BLOCK",s.blockMS),i.push("STREAMS",...Array.isArray(e)?[...e]:[e],...Array.isArray(t)?[...t]:[t]),super(["XREAD",...i],n)}},t2=class extends d{constructor([e,t,s,n,i],r){if(Array.isArray(s)&&Array.isArray(n)&&s.length!==n.length)throw Error("ERR Unbalanced XREADGROUP list of streams: for each stream key an ID or '$' must be specified");let c=[];"number"==typeof i?.count&&c.push("COUNT",i.count),"number"==typeof i?.blockMS&&c.push("BLOCK",i.blockMS),"boolean"==typeof i?.NOACK&&i.NOACK&&c.push("NOACK"),c.push("STREAMS",...Array.isArray(s)?[...s]:[s],...Array.isArray(n)?[...n]:[n]),super(["XREADGROUP","GROUP",e,t,...c],r)}},t5=class extends d{constructor([e,t,s,n],i){let r=["XREVRANGE",e,t,s];"number"==typeof n&&r.push("COUNT",n),super(r,{deserialize:e=>(function(e){let t={};for(let s of e)for(let e=0;e<s.length;e+=2){let n=s[e],i=s[e+1];n in t||(t[n]={});for(let e=0;e<i.length;e+=2){let s=i[e],r=i[e+1];try{t[n][s]=JSON.parse(r)}catch{t[n][s]=r}}}return t})(e),...i})}},t8=class extends d{constructor([e,t],s){let{limit:n,strategy:i,threshold:r,exactness:c="~"}=t;super(["XTRIM",e,i,c,r,...n?["LIMIT",n]:[]],s)}},t3=class extends d{constructor([e,t,...s],n){let i=["zadd",e];"nx"in t&&t.nx?i.push("nx"):"xx"in t&&t.xx&&i.push("xx"),"ch"in t&&t.ch&&i.push("ch"),"incr"in t&&t.incr&&i.push("incr"),"lt"in t&&t.lt?i.push("lt"):"gt"in t&&t.gt&&i.push("gt"),"score"in t&&"member"in t&&i.push(t.score,t.member),i.push(...s.flatMap(({score:e,member:t})=>[e,t])),super(i,n)}},t4=class extends d{constructor(e,t){super(["zcard",...e],t)}},t6=class extends d{constructor(e,t){super(["zcount",...e],t)}},t9=class extends d{constructor(e,t){super(["zincrby",...e],t)}},t7=class extends d{constructor([e,t,s,n],i){let r=["zinterstore",e,t];Array.isArray(s)?r.push(...s):r.push(s),n&&("weights"in n&&n.weights?r.push("weights",...n.weights):"weight"in n&&"number"==typeof n.weight&&r.push("weights",n.weight),"aggregate"in n&&r.push("aggregate",n.aggregate)),super(r,i)}},se=class extends d{constructor(e,t){super(["zlexcount",...e],t)}},st=class extends d{constructor([e,t],s){let n=["zpopmax",e];"number"==typeof t&&n.push(t),super(n,s)}},ss=class extends d{constructor([e,t],s){let n=["zpopmin",e];"number"==typeof t&&n.push(t),super(n,s)}},sn=class extends d{constructor([e,t,s,n],i){let r=["zrange",e,t,s];n?.byScore&&r.push("byscore"),n?.byLex&&r.push("bylex"),n?.rev&&r.push("rev"),n?.count!==void 0&&void 0!==n.offset&&r.push("limit",n.offset,n.count),n?.withScores&&r.push("withscores"),super(r,i)}},si=class extends d{constructor(e,t){super(["zrank",...e],t)}},sr=class extends d{constructor(e,t){super(["zrem",...e],t)}},sc=class extends d{constructor(e,t){super(["zremrangebylex",...e],t)}},so=class extends d{constructor(e,t){super(["zremrangebyrank",...e],t)}},sh=class extends d{constructor(e,t){super(["zremrangebyscore",...e],t)}},sa=class extends d{constructor(e,t){super(["zrevrank",...e],t)}},sp=class extends d{constructor([e,t,s],n){let i=["zscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:o,...n})}},sl=class extends d{constructor(e,t){super(["zscore",...e],t)}},su=class extends d{constructor([e,t,s],n){let i=["zunion",e];Array.isArray(t)?i.push(...t):i.push(t),s&&("weights"in s&&s.weights?i.push("weights",...s.weights):"weight"in s&&"number"==typeof s.weight&&i.push("weights",s.weight),"aggregate"in s&&i.push("aggregate",s.aggregate),s.withScores&&i.push("withscores")),super(i,n)}},sm=class extends d{constructor([e,t,s,n],i){let r=["zunionstore",e,t];Array.isArray(s)?r.push(...s):r.push(s),n&&("weights"in n&&n.weights?r.push("weights",...n.weights):"weight"in n&&"number"==typeof n.weight&&r.push("weights",n.weight),"aggregate"in n&&r.push("aggregate",n.aggregate)),super(r,i)}},sd=class extends d{constructor(e,t){super(["zdiffstore",...e],t)}},sx=class extends d{constructor(e,t){let[s,n]=e;super(["zmscore",s,...n],t)}},sw=class{client;commands;commandOptions;multiExec;constructor(e){if(this.client=e.client,this.commands=[],this.commandOptions=e.commandOptions,this.multiExec=e.multiExec??!1,this.commandOptions?.latencyLogging){let e=this.exec.bind(this);this.exec=async t=>{let s=performance.now(),n=await (t?e(t):e()),i=(performance.now()-s).toFixed(2);return console.log(`Latency for \x1b[38;2;19;185;39m${this.multiExec?["MULTI-EXEC"]:["PIPELINE"].toString().toUpperCase()}\x1b[0m: \x1b[38;2;0;255;255m${i} ms\x1b[0m`),n}}}exec=async e=>{if(0===this.commands.length)throw Error("Pipeline is empty");let t=this.multiExec?["multi-exec"]:["pipeline"],s=await this.client.request({path:t,body:Object.values(this.commands).map(e=>e.command)});return e?.keepErrors?s.map(({error:e,result:t},s)=>({error:e,result:this.commands[s].deserialize(t)})):s.map(({error:e,result:t},s)=>{if(e)throw new i(`Command ${s+1} [ ${this.commands[s].command[0]} ] failed: ${e}`);return this.commands[s].deserialize(t)})};length(){return this.commands.length}chain(e){return this.commands.push(e),this}append=(...e)=>this.chain(new w(e,this.commandOptions));bitcount=(...e)=>this.chain(new y(e,this.commandOptions));bitfield=(...e)=>new g(e,this.client,this.commandOptions,this.chain.bind(this));bitop=(e,t,s,...n)=>this.chain(new O([e,t,s,...n],this.commandOptions));bitpos=(...e)=>this.chain(new b(e,this.commandOptions));copy=(...e)=>this.chain(new f(e,this.commandOptions));zdiffstore=(...e)=>this.chain(new sd(e,this.commandOptions));dbsize=()=>this.chain(new E(this.commandOptions));decr=(...e)=>this.chain(new S(e,this.commandOptions));decrby=(...e)=>this.chain(new A(e,this.commandOptions));del=(...e)=>this.chain(new T(e,this.commandOptions));echo=(...e)=>this.chain(new R(e,this.commandOptions));evalRo=(...e)=>this.chain(new v(e,this.commandOptions));eval=(...e)=>this.chain(new N(e,this.commandOptions));evalshaRo=(...e)=>this.chain(new z(e,this.commandOptions));evalsha=(...e)=>this.chain(new k(e,this.commandOptions));exists=(...e)=>this.chain(new C(e,this.commandOptions));expire=(...e)=>this.chain(new P(e,this.commandOptions));expireat=(...e)=>this.chain(new L(e,this.commandOptions));flushall=e=>this.chain(new I(e,this.commandOptions));flushdb=(...e)=>this.chain(new M(e,this.commandOptions));geoadd=(...e)=>this.chain(new D(e,this.commandOptions));geodist=(...e)=>this.chain(new J(e,this.commandOptions));geopos=(...e)=>this.chain(new Y(e,this.commandOptions));geohash=(...e)=>this.chain(new F(e,this.commandOptions));geosearch=(...e)=>this.chain(new j(e,this.commandOptions));geosearchstore=(...e)=>this.chain(new _(e,this.commandOptions));get=(...e)=>this.chain(new $(e,this.commandOptions));getbit=(...e)=>this.chain(new W(e,this.commandOptions));getdel=(...e)=>this.chain(new X(e,this.commandOptions));getex=(...e)=>this.chain(new G(e,this.commandOptions));getrange=(...e)=>this.chain(new H(e,this.commandOptions));getset=(e,t)=>this.chain(new B([e,t],this.commandOptions));hdel=(...e)=>this.chain(new K(e,this.commandOptions));hexists=(...e)=>this.chain(new q(e,this.commandOptions));hexpire=(...e)=>this.chain(new V(e,this.commandOptions));hexpireat=(...e)=>this.chain(new Q(e,this.commandOptions));hexpiretime=(...e)=>this.chain(new Z(e,this.commandOptions));httl=(...e)=>this.chain(new ey(e,this.commandOptions));hpexpire=(...e)=>this.chain(new et(e,this.commandOptions));hpexpireat=(...e)=>this.chain(new es(e,this.commandOptions));hpexpiretime=(...e)=>this.chain(new en(e,this.commandOptions));hpttl=(...e)=>this.chain(new ei(e,this.commandOptions));hpersist=(...e)=>this.chain(new ee(e,this.commandOptions));hget=(...e)=>this.chain(new er(e,this.commandOptions));hgetall=(...e)=>this.chain(new ec(e,this.commandOptions));hincrby=(...e)=>this.chain(new eo(e,this.commandOptions));hincrbyfloat=(...e)=>this.chain(new eh(e,this.commandOptions));hkeys=(...e)=>this.chain(new ea(e,this.commandOptions));hlen=(...e)=>this.chain(new ep(e,this.commandOptions));hmget=(...e)=>this.chain(new el(e,this.commandOptions));hmset=(e,t)=>this.chain(new eu([e,t],this.commandOptions));hrandfield=(e,t,s)=>this.chain(new x([e,t,s],this.commandOptions));hscan=(...e)=>this.chain(new em(e,this.commandOptions));hset=(e,t)=>this.chain(new ed([e,t],this.commandOptions));hsetnx=(e,t,s)=>this.chain(new ex([e,t,s],this.commandOptions));hstrlen=(...e)=>this.chain(new ew(e,this.commandOptions));hvals=(...e)=>this.chain(new eg(e,this.commandOptions));incr=(...e)=>this.chain(new eO(e,this.commandOptions));incrby=(...e)=>this.chain(new eb(e,this.commandOptions));incrbyfloat=(...e)=>this.chain(new ef(e,this.commandOptions));keys=(...e)=>this.chain(new eX(e,this.commandOptions));lindex=(...e)=>this.chain(new eG(e,this.commandOptions));linsert=(e,t,s,n)=>this.chain(new eH([e,t,s,n],this.commandOptions));llen=(...e)=>this.chain(new eB(e,this.commandOptions));lmove=(...e)=>this.chain(new eK(e,this.commandOptions));lpop=(...e)=>this.chain(new eV(e,this.commandOptions));lmpop=(...e)=>this.chain(new eq(e,this.commandOptions));lpos=(...e)=>this.chain(new eQ(e,this.commandOptions));lpush=(e,...t)=>this.chain(new eZ([e,...t],this.commandOptions));lpushx=(e,...t)=>this.chain(new e1([e,...t],this.commandOptions));lrange=(...e)=>this.chain(new e0(e,this.commandOptions));lrem=(e,t,s)=>this.chain(new e2([e,t,s],this.commandOptions));lset=(e,t,s)=>this.chain(new e5([e,t,s],this.commandOptions));ltrim=(...e)=>this.chain(new e8(e,this.commandOptions));mget=(...e)=>this.chain(new e3(e,this.commandOptions));mset=e=>this.chain(new e4([e],this.commandOptions));msetnx=e=>this.chain(new e6([e],this.commandOptions));persist=(...e)=>this.chain(new e9(e,this.commandOptions));pexpire=(...e)=>this.chain(new e7(e,this.commandOptions));pexpireat=(...e)=>this.chain(new te(e,this.commandOptions));pfadd=(...e)=>this.chain(new tt(e,this.commandOptions));pfcount=(...e)=>this.chain(new ts(e,this.commandOptions));pfmerge=(...e)=>this.chain(new tn(e,this.commandOptions));ping=e=>this.chain(new ti(e,this.commandOptions));psetex=(e,t,s)=>this.chain(new tr([e,t,s],this.commandOptions));pttl=(...e)=>this.chain(new tc(e,this.commandOptions));publish=(...e)=>this.chain(new to(e,this.commandOptions));randomkey=()=>this.chain(new th(this.commandOptions));rename=(...e)=>this.chain(new ta(e,this.commandOptions));renamenx=(...e)=>this.chain(new tp(e,this.commandOptions));rpop=(...e)=>this.chain(new tl(e,this.commandOptions));rpush=(e,...t)=>this.chain(new tu([e,...t],this.commandOptions));rpushx=(e,...t)=>this.chain(new tm([e,...t],this.commandOptions));sadd=(e,t,...s)=>this.chain(new td([e,t,...s],this.commandOptions));scan=(...e)=>this.chain(new tx(e,this.commandOptions));scard=(...e)=>this.chain(new tw(e,this.commandOptions));scriptExists=(...e)=>this.chain(new ty(e,this.commandOptions));scriptFlush=(...e)=>this.chain(new tg(e,this.commandOptions));scriptLoad=(...e)=>this.chain(new tO(e,this.commandOptions));sdiff=(...e)=>this.chain(new tb(e,this.commandOptions));sdiffstore=(...e)=>this.chain(new tf(e,this.commandOptions));set=(e,t,s)=>this.chain(new tE([e,t,s],this.commandOptions));setbit=(...e)=>this.chain(new tS(e,this.commandOptions));setex=(e,t,s)=>this.chain(new tA([e,t,s],this.commandOptions));setnx=(e,t)=>this.chain(new tT([e,t],this.commandOptions));setrange=(...e)=>this.chain(new tR(e,this.commandOptions));sinter=(...e)=>this.chain(new tv(e,this.commandOptions));sinterstore=(...e)=>this.chain(new tN(e,this.commandOptions));sismember=(e,t)=>this.chain(new tz([e,t],this.commandOptions));smembers=(...e)=>this.chain(new tk(e,this.commandOptions));smismember=(e,t)=>this.chain(new tU([e,t],this.commandOptions));smove=(e,t,s)=>this.chain(new tC([e,t,s],this.commandOptions));spop=(...e)=>this.chain(new tP(e,this.commandOptions));srandmember=(...e)=>this.chain(new tL(e,this.commandOptions));srem=(e,...t)=>this.chain(new tI([e,...t],this.commandOptions));sscan=(...e)=>this.chain(new tM(e,this.commandOptions));strlen=(...e)=>this.chain(new tD(e,this.commandOptions));sunion=(...e)=>this.chain(new tJ(e,this.commandOptions));sunionstore=(...e)=>this.chain(new tF(e,this.commandOptions));time=()=>this.chain(new tY(this.commandOptions));touch=(...e)=>this.chain(new tj(e,this.commandOptions));ttl=(...e)=>this.chain(new t_(e,this.commandOptions));type=(...e)=>this.chain(new t$(e,this.commandOptions));unlink=(...e)=>this.chain(new tW(e,this.commandOptions));zadd=(...e)=>("score"in e[1],this.chain(new t3([e[0],e[1],...e.slice(2)],this.commandOptions)));xadd=(...e)=>this.chain(new tG(e,this.commandOptions));xack=(...e)=>this.chain(new tX(e,this.commandOptions));xdel=(...e)=>this.chain(new tK(e,this.commandOptions));xgroup=(...e)=>this.chain(new tq(e,this.commandOptions));xread=(...e)=>this.chain(new t0(e,this.commandOptions));xreadgroup=(...e)=>this.chain(new t2(e,this.commandOptions));xinfo=(...e)=>this.chain(new tV(e,this.commandOptions));xlen=(...e)=>this.chain(new tQ(e,this.commandOptions));xpending=(...e)=>this.chain(new tZ(e,this.commandOptions));xclaim=(...e)=>this.chain(new tB(e,this.commandOptions));xautoclaim=(...e)=>this.chain(new tH(e,this.commandOptions));xtrim=(...e)=>this.chain(new t8(e,this.commandOptions));xrange=(...e)=>this.chain(new t1(e,this.commandOptions));xrevrange=(...e)=>this.chain(new t5(e,this.commandOptions));zcard=(...e)=>this.chain(new t4(e,this.commandOptions));zcount=(...e)=>this.chain(new t6(e,this.commandOptions));zincrby=(e,t,s)=>this.chain(new t9([e,t,s],this.commandOptions));zinterstore=(...e)=>this.chain(new t7(e,this.commandOptions));zlexcount=(...e)=>this.chain(new se(e,this.commandOptions));zmscore=(...e)=>this.chain(new sx(e,this.commandOptions));zpopmax=(...e)=>this.chain(new st(e,this.commandOptions));zpopmin=(...e)=>this.chain(new ss(e,this.commandOptions));zrange=(...e)=>this.chain(new sn(e,this.commandOptions));zrank=(e,t)=>this.chain(new si([e,t],this.commandOptions));zrem=(e,...t)=>this.chain(new sr([e,...t],this.commandOptions));zremrangebylex=(...e)=>this.chain(new sc(e,this.commandOptions));zremrangebyrank=(...e)=>this.chain(new so(e,this.commandOptions));zremrangebyscore=(...e)=>this.chain(new sh(e,this.commandOptions));zrevrank=(e,t)=>this.chain(new sa([e,t],this.commandOptions));zscan=(...e)=>this.chain(new sp(e,this.commandOptions));zscore=(e,t)=>this.chain(new sl([e,t],this.commandOptions));zunionstore=(...e)=>this.chain(new sm(e,this.commandOptions));zunion=(...e)=>this.chain(new su(e,this.commandOptions));get json(){return{arrappend:(...e)=>this.chain(new eE(e,this.commandOptions)),arrindex:(...e)=>this.chain(new eS(e,this.commandOptions)),arrinsert:(...e)=>this.chain(new eA(e,this.commandOptions)),arrlen:(...e)=>this.chain(new eT(e,this.commandOptions)),arrpop:(...e)=>this.chain(new eR(e,this.commandOptions)),arrtrim:(...e)=>this.chain(new ev(e,this.commandOptions)),clear:(...e)=>this.chain(new eN(e,this.commandOptions)),del:(...e)=>this.chain(new ez(e,this.commandOptions)),forget:(...e)=>this.chain(new ek(e,this.commandOptions)),get:(...e)=>this.chain(new eU(e,this.commandOptions)),merge:(...e)=>this.chain(new eC(e,this.commandOptions)),mget:(...e)=>this.chain(new eP(e,this.commandOptions)),mset:(...e)=>this.chain(new eL(e,this.commandOptions)),numincrby:(...e)=>this.chain(new eI(e,this.commandOptions)),nummultby:(...e)=>this.chain(new eM(e,this.commandOptions)),objkeys:(...e)=>this.chain(new eD(e,this.commandOptions)),objlen:(...e)=>this.chain(new eJ(e,this.commandOptions)),resp:(...e)=>this.chain(new eF(e,this.commandOptions)),set:(...e)=>this.chain(new eY(e,this.commandOptions)),strappend:(...e)=>this.chain(new ej(e,this.commandOptions)),strlen:(...e)=>this.chain(new e_(e,this.commandOptions)),toggle:(...e)=>this.chain(new e$(e,this.commandOptions)),type:(...e)=>this.chain(new eW(e,this.commandOptions))}}},sy=new Set(["scan","keys","flushdb","flushall","dbsize","hscan","hgetall","hkeys","lrange","sscan","smembers","xrange","xrevrange","zscan","zrange","exec"]),sg=class{pipelinePromises=new WeakMap;activePipeline=null;indexInCurrentPipeline=0;redis;pipeline;pipelineCounter=0;constructor(e){this.redis=e,this.pipeline=e.pipeline()}async withAutoPipeline(e){let t=this.activePipeline??this.redis.pipeline();this.activePipeline||(this.activePipeline=t,this.indexInCurrentPipeline=0);let s=this.indexInCurrentPipeline++;e(t);let n=this.deferExecution().then(()=>{if(!this.pipelinePromises.has(t)){let e=t.exec({keepErrors:!0});this.pipelineCounter+=1,this.pipelinePromises.set(t,e),this.activePipeline=null}return this.pipelinePromises.get(t)}),r=(await n)[s];if(r.error)throw new i(`Command failed: ${r.error}`);return r.result}async deferExecution(){await Promise.resolve(),await Promise.resolve()}},sO=class extends d{constructor(e,t){super([],{...t,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},path:["psubscribe",...e],streamOptions:{isStreaming:!0,onMessage:t?.streamOptions?.onMessage,signal:t?.streamOptions?.signal}})}},sb=class extends EventTarget{subscriptions;client;listeners;opts;constructor(e,t,s=!1,n){for(let i of(super(),this.client=e,this.subscriptions=new Map,this.listeners=new Map,this.opts=n,t))s?this.subscribeToPattern(i):this.subscribeToChannel(i)}subscribeToChannel(e){let t=new AbortController,s=new sf([e],{streamOptions:{signal:t.signal,onMessage:e=>this.handleMessage(e,!1)}});s.exec(this.client).catch(e=>{"AbortError"!==e.name&&this.dispatchToListeners("error",e)}),this.subscriptions.set(e,{command:s,controller:t,isPattern:!1})}subscribeToPattern(e){let t=new AbortController,s=new sO([e],{streamOptions:{signal:t.signal,onMessage:e=>this.handleMessage(e,!0)}});s.exec(this.client).catch(e=>{"AbortError"!==e.name&&this.dispatchToListeners("error",e)}),this.subscriptions.set(e,{command:s,controller:t,isPattern:!0})}handleMessage(e,t){let s=e.replace(/^data:\s*/,""),n=s.indexOf(","),i=s.indexOf(",",n+1),r=t?s.indexOf(",",i+1):-1;if(-1!==n&&-1!==i){let e=s.slice(0,n);if(t&&"pmessage"===e&&-1!==r){let e=s.slice(n+1,i),t=s.slice(i+1,r),c=s.slice(r+1);try{let s=this.opts?.automaticDeserialization===!1?c:JSON.parse(c);this.dispatchToListeners("pmessage",{pattern:e,channel:t,message:s}),this.dispatchToListeners(`pmessage:${e}`,{pattern:e,channel:t,message:s})}catch(e){this.dispatchToListeners("error",Error(`Failed to parse message: ${e}`))}}else{let t=s.slice(n+1,i),r=s.slice(i+1);try{if("subscribe"===e||"psubscribe"===e||"unsubscribe"===e||"punsubscribe"===e){let t=Number.parseInt(r);this.dispatchToListeners(e,t)}else{let s=this.opts?.automaticDeserialization===!1?r:sE(r);this.dispatchToListeners(e,{channel:t,message:s}),this.dispatchToListeners(`${e}:${t}`,{channel:t,message:s})}}catch(e){this.dispatchToListeners("error",Error(`Failed to parse message: ${e}`))}}}}dispatchToListeners(e,t){let s=this.listeners.get(e);if(s)for(let e of s)e(t)}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e)?.add(t)}removeAllListeners(){this.listeners.clear()}async unsubscribe(e){if(e)for(let t of e){let e=this.subscriptions.get(t);if(e){try{e.controller.abort()}catch{}this.subscriptions.delete(t)}}else{for(let e of this.subscriptions.values())try{e.controller.abort()}catch{}this.subscriptions.clear(),this.removeAllListeners()}}getSubscribedChannels(){return[...this.subscriptions.keys()]}},sf=class extends d{constructor(e,t){super([],{...t,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},path:["subscribe",...e],streamOptions:{isStreaming:!0,onMessage:t?.streamOptions?.onMessage,signal:t?.streamOptions?.signal}})}},sE=e=>{try{return JSON.parse(e)}catch{return e}},sS=class{script;sha1;redis;constructor(e,t){this.redis=e,this.script=t,this.sha1="",this.init(t)}async init(e){this.sha1||(this.sha1=await this.digest(e))}async eval(e,t){return await this.init(this.script),await this.redis.eval(this.script,e,t)}async evalsha(e,t){return await this.init(this.script),await this.redis.evalsha(this.sha1,e,t)}async exec(e,t){return await this.init(this.script),await this.redis.evalsha(this.sha1,e,t).catch(async s=>{if(s instanceof Error&&s.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,e,t);throw s})}async digest(e){let t=new TextEncoder().encode(e);return[...new Uint8Array(await s.digest("SHA-1",t))].map(e=>e.toString(16).padStart(2,"0")).join("")}},sA=class{script;sha1;redis;constructor(e,t){this.redis=e,this.sha1="",this.script=t,this.init(t)}async init(e){this.sha1||(this.sha1=await this.digest(e))}async evalRo(e,t){return await this.init(this.script),await this.redis.evalRo(this.script,e,t)}async evalshaRo(e,t){return await this.init(this.script),await this.redis.evalshaRo(this.sha1,e,t)}async exec(e,t){return await this.init(this.script),await this.redis.evalshaRo(this.sha1,e,t).catch(async s=>{if(s instanceof Error&&s.message.toLowerCase().includes("noscript"))return await this.redis.evalRo(this.script,e,t);throw s})}async digest(e){let t=new TextEncoder().encode(e);return[...new Uint8Array(await s.digest("SHA-1",t))].map(e=>e.toString(16).padStart(2,"0")).join("")}},sT=class{client;opts;enableTelemetry;enableAutoPipelining;constructor(e,t){this.client=e,this.opts=t,this.enableTelemetry=t?.enableTelemetry??!0,t?.readYourWrites===!1&&(this.client.readYourWrites=!1),this.enableAutoPipelining=t?.enableAutoPipelining??!0}get readYourWritesSyncToken(){return this.client.upstashSyncToken}set readYourWritesSyncToken(e){this.client.upstashSyncToken=e}get json(){return{arrappend:(...e)=>new eE(e,this.opts).exec(this.client),arrindex:(...e)=>new eS(e,this.opts).exec(this.client),arrinsert:(...e)=>new eA(e,this.opts).exec(this.client),arrlen:(...e)=>new eT(e,this.opts).exec(this.client),arrpop:(...e)=>new eR(e,this.opts).exec(this.client),arrtrim:(...e)=>new ev(e,this.opts).exec(this.client),clear:(...e)=>new eN(e,this.opts).exec(this.client),del:(...e)=>new ez(e,this.opts).exec(this.client),forget:(...e)=>new ek(e,this.opts).exec(this.client),get:(...e)=>new eU(e,this.opts).exec(this.client),merge:(...e)=>new eC(e,this.opts).exec(this.client),mget:(...e)=>new eP(e,this.opts).exec(this.client),mset:(...e)=>new eL(e,this.opts).exec(this.client),numincrby:(...e)=>new eI(e,this.opts).exec(this.client),nummultby:(...e)=>new eM(e,this.opts).exec(this.client),objkeys:(...e)=>new eD(e,this.opts).exec(this.client),objlen:(...e)=>new eJ(e,this.opts).exec(this.client),resp:(...e)=>new eF(e,this.opts).exec(this.client),set:(...e)=>new eY(e,this.opts).exec(this.client),strappend:(...e)=>new ej(e,this.opts).exec(this.client),strlen:(...e)=>new e_(e,this.opts).exec(this.client),toggle:(...e)=>new e$(e,this.opts).exec(this.client),type:(...e)=>new eW(e,this.opts).exec(this.client)}}use=e=>{let t=this.client.request.bind(this.client);this.client.request=s=>e(s,t)};addTelemetry=e=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(e)}catch{}};createScript(e,t){return t?.readonly?new sA(this,e):new sS(this,e)}pipeline=()=>new sw({client:this.client,commandOptions:this.opts,multiExec:!1});autoPipeline=()=>(function e(t,s){return t.autoPipelineExecutor||(t.autoPipelineExecutor=new sg(t)),new Proxy(t,{get:(t,n)=>{if("pipelineCounter"===n)return t.autoPipelineExecutor.pipelineCounter;if("json"===n)return e(t,!0);let i=n in t&&!(n in t.autoPipelineExecutor.pipeline),r=sy.has(n);return i||r?t[n]:(s?"function"==typeof t.autoPipelineExecutor.pipeline.json[n]:"function"==typeof t.autoPipelineExecutor.pipeline[n])?(...e)=>t.autoPipelineExecutor.withAutoPipeline(t=>{s?t.json[n](...e):t[n](...e)}):t.autoPipelineExecutor.pipeline[n]}})})(this);multi=()=>new sw({client:this.client,commandOptions:this.opts,multiExec:!0});bitfield=(...e)=>new g(e,this.client,this.opts);append=(...e)=>new w(e,this.opts).exec(this.client);bitcount=(...e)=>new y(e,this.opts).exec(this.client);bitop=(e,t,s,...n)=>new O([e,t,s,...n],this.opts).exec(this.client);bitpos=(...e)=>new b(e,this.opts).exec(this.client);copy=(...e)=>new f(e,this.opts).exec(this.client);dbsize=()=>new E(this.opts).exec(this.client);decr=(...e)=>new S(e,this.opts).exec(this.client);decrby=(...e)=>new A(e,this.opts).exec(this.client);del=(...e)=>new T(e,this.opts).exec(this.client);echo=(...e)=>new R(e,this.opts).exec(this.client);evalRo=(...e)=>new v(e,this.opts).exec(this.client);eval=(...e)=>new N(e,this.opts).exec(this.client);evalshaRo=(...e)=>new z(e,this.opts).exec(this.client);evalsha=(...e)=>new k(e,this.opts).exec(this.client);exec=e=>new U(e,this.opts).exec(this.client);exists=(...e)=>new C(e,this.opts).exec(this.client);expire=(...e)=>new P(e,this.opts).exec(this.client);expireat=(...e)=>new L(e,this.opts).exec(this.client);flushall=e=>new I(e,this.opts).exec(this.client);flushdb=(...e)=>new M(e,this.opts).exec(this.client);geoadd=(...e)=>new D(e,this.opts).exec(this.client);geopos=(...e)=>new Y(e,this.opts).exec(this.client);geodist=(...e)=>new J(e,this.opts).exec(this.client);geohash=(...e)=>new F(e,this.opts).exec(this.client);geosearch=(...e)=>new j(e,this.opts).exec(this.client);geosearchstore=(...e)=>new _(e,this.opts).exec(this.client);get=(...e)=>new $(e,this.opts).exec(this.client);getbit=(...e)=>new W(e,this.opts).exec(this.client);getdel=(...e)=>new X(e,this.opts).exec(this.client);getex=(...e)=>new G(e,this.opts).exec(this.client);getrange=(...e)=>new H(e,this.opts).exec(this.client);getset=(e,t)=>new B([e,t],this.opts).exec(this.client);hdel=(...e)=>new K(e,this.opts).exec(this.client);hexists=(...e)=>new q(e,this.opts).exec(this.client);hexpire=(...e)=>new V(e,this.opts).exec(this.client);hexpireat=(...e)=>new Q(e,this.opts).exec(this.client);hexpiretime=(...e)=>new Z(e,this.opts).exec(this.client);httl=(...e)=>new ey(e,this.opts).exec(this.client);hpexpire=(...e)=>new et(e,this.opts).exec(this.client);hpexpireat=(...e)=>new es(e,this.opts).exec(this.client);hpexpiretime=(...e)=>new en(e,this.opts).exec(this.client);hpttl=(...e)=>new ei(e,this.opts).exec(this.client);hpersist=(...e)=>new ee(e,this.opts).exec(this.client);hget=(...e)=>new er(e,this.opts).exec(this.client);hgetall=(...e)=>new ec(e,this.opts).exec(this.client);hincrby=(...e)=>new eo(e,this.opts).exec(this.client);hincrbyfloat=(...e)=>new eh(e,this.opts).exec(this.client);hkeys=(...e)=>new ea(e,this.opts).exec(this.client);hlen=(...e)=>new ep(e,this.opts).exec(this.client);hmget=(...e)=>new el(e,this.opts).exec(this.client);hmset=(e,t)=>new eu([e,t],this.opts).exec(this.client);hrandfield=(e,t,s)=>new x([e,t,s],this.opts).exec(this.client);hscan=(...e)=>new em(e,this.opts).exec(this.client);hset=(e,t)=>new ed([e,t],this.opts).exec(this.client);hsetnx=(e,t,s)=>new ex([e,t,s],this.opts).exec(this.client);hstrlen=(...e)=>new ew(e,this.opts).exec(this.client);hvals=(...e)=>new eg(e,this.opts).exec(this.client);incr=(...e)=>new eO(e,this.opts).exec(this.client);incrby=(...e)=>new eb(e,this.opts).exec(this.client);incrbyfloat=(...e)=>new ef(e,this.opts).exec(this.client);keys=(...e)=>new eX(e,this.opts).exec(this.client);lindex=(...e)=>new eG(e,this.opts).exec(this.client);linsert=(e,t,s,n)=>new eH([e,t,s,n],this.opts).exec(this.client);llen=(...e)=>new eB(e,this.opts).exec(this.client);lmove=(...e)=>new eK(e,this.opts).exec(this.client);lpop=(...e)=>new eV(e,this.opts).exec(this.client);lmpop=(...e)=>new eq(e,this.opts).exec(this.client);lpos=(...e)=>new eQ(e,this.opts).exec(this.client);lpush=(e,...t)=>new eZ([e,...t],this.opts).exec(this.client);lpushx=(e,...t)=>new e1([e,...t],this.opts).exec(this.client);lrange=(...e)=>new e0(e,this.opts).exec(this.client);lrem=(e,t,s)=>new e2([e,t,s],this.opts).exec(this.client);lset=(e,t,s)=>new e5([e,t,s],this.opts).exec(this.client);ltrim=(...e)=>new e8(e,this.opts).exec(this.client);mget=(...e)=>new e3(e,this.opts).exec(this.client);mset=e=>new e4([e],this.opts).exec(this.client);msetnx=e=>new e6([e],this.opts).exec(this.client);persist=(...e)=>new e9(e,this.opts).exec(this.client);pexpire=(...e)=>new e7(e,this.opts).exec(this.client);pexpireat=(...e)=>new te(e,this.opts).exec(this.client);pfadd=(...e)=>new tt(e,this.opts).exec(this.client);pfcount=(...e)=>new ts(e,this.opts).exec(this.client);pfmerge=(...e)=>new tn(e,this.opts).exec(this.client);ping=e=>new ti(e,this.opts).exec(this.client);psetex=(e,t,s)=>new tr([e,t,s],this.opts).exec(this.client);psubscribe=e=>{let t=Array.isArray(e)?e:[e];return new sb(this.client,t,!0,this.opts)};pttl=(...e)=>new tc(e,this.opts).exec(this.client);publish=(...e)=>new to(e,this.opts).exec(this.client);randomkey=()=>new th().exec(this.client);rename=(...e)=>new ta(e,this.opts).exec(this.client);renamenx=(...e)=>new tp(e,this.opts).exec(this.client);rpop=(...e)=>new tl(e,this.opts).exec(this.client);rpush=(e,...t)=>new tu([e,...t],this.opts).exec(this.client);rpushx=(e,...t)=>new tm([e,...t],this.opts).exec(this.client);sadd=(e,t,...s)=>new td([e,t,...s],this.opts).exec(this.client);scan(e,t){return new tx([e,t],this.opts).exec(this.client)}scard=(...e)=>new tw(e,this.opts).exec(this.client);scriptExists=(...e)=>new ty(e,this.opts).exec(this.client);scriptFlush=(...e)=>new tg(e,this.opts).exec(this.client);scriptLoad=(...e)=>new tO(e,this.opts).exec(this.client);sdiff=(...e)=>new tb(e,this.opts).exec(this.client);sdiffstore=(...e)=>new tf(e,this.opts).exec(this.client);set=(e,t,s)=>new tE([e,t,s],this.opts).exec(this.client);setbit=(...e)=>new tS(e,this.opts).exec(this.client);setex=(e,t,s)=>new tA([e,t,s],this.opts).exec(this.client);setnx=(e,t)=>new tT([e,t],this.opts).exec(this.client);setrange=(...e)=>new tR(e,this.opts).exec(this.client);sinter=(...e)=>new tv(e,this.opts).exec(this.client);sinterstore=(...e)=>new tN(e,this.opts).exec(this.client);sismember=(e,t)=>new tz([e,t],this.opts).exec(this.client);smismember=(e,t)=>new tU([e,t],this.opts).exec(this.client);smembers=(...e)=>new tk(e,this.opts).exec(this.client);smove=(e,t,s)=>new tC([e,t,s],this.opts).exec(this.client);spop=(...e)=>new tP(e,this.opts).exec(this.client);srandmember=(...e)=>new tL(e,this.opts).exec(this.client);srem=(e,...t)=>new tI([e,...t],this.opts).exec(this.client);sscan=(...e)=>new tM(e,this.opts).exec(this.client);strlen=(...e)=>new tD(e,this.opts).exec(this.client);subscribe=e=>{let t=Array.isArray(e)?e:[e];return new sb(this.client,t,!1,this.opts)};sunion=(...e)=>new tJ(e,this.opts).exec(this.client);sunionstore=(...e)=>new tF(e,this.opts).exec(this.client);time=()=>new tY().exec(this.client);touch=(...e)=>new tj(e,this.opts).exec(this.client);ttl=(...e)=>new t_(e,this.opts).exec(this.client);type=(...e)=>new t$(e,this.opts).exec(this.client);unlink=(...e)=>new tW(e,this.opts).exec(this.client);xadd=(...e)=>new tG(e,this.opts).exec(this.client);xack=(...e)=>new tX(e,this.opts).exec(this.client);xdel=(...e)=>new tK(e,this.opts).exec(this.client);xgroup=(...e)=>new tq(e,this.opts).exec(this.client);xread=(...e)=>new t0(e,this.opts).exec(this.client);xreadgroup=(...e)=>new t2(e,this.opts).exec(this.client);xinfo=(...e)=>new tV(e,this.opts).exec(this.client);xlen=(...e)=>new tQ(e,this.opts).exec(this.client);xpending=(...e)=>new tZ(e,this.opts).exec(this.client);xclaim=(...e)=>new tB(e,this.opts).exec(this.client);xautoclaim=(...e)=>new tH(e,this.opts).exec(this.client);xtrim=(...e)=>new t8(e,this.opts).exec(this.client);xrange=(...e)=>new t1(e,this.opts).exec(this.client);xrevrange=(...e)=>new t5(e,this.opts).exec(this.client);zadd=(...e)=>("score"in e[1],new t3([e[0],e[1],...e.slice(2)],this.opts).exec(this.client));zcard=(...e)=>new t4(e,this.opts).exec(this.client);zcount=(...e)=>new t6(e,this.opts).exec(this.client);zdiffstore=(...e)=>new sd(e,this.opts).exec(this.client);zincrby=(e,t,s)=>new t9([e,t,s],this.opts).exec(this.client);zinterstore=(...e)=>new t7(e,this.opts).exec(this.client);zlexcount=(...e)=>new se(e,this.opts).exec(this.client);zmscore=(...e)=>new sx(e,this.opts).exec(this.client);zpopmax=(...e)=>new st(e,this.opts).exec(this.client);zpopmin=(...e)=>new ss(e,this.opts).exec(this.client);zrange=(...e)=>new sn(e,this.opts).exec(this.client);zrank=(e,t)=>new si([e,t],this.opts).exec(this.client);zrem=(e,...t)=>new sr([e,...t],this.opts).exec(this.client);zremrangebylex=(...e)=>new sc(e,this.opts).exec(this.client);zremrangebyrank=(...e)=>new so(e,this.opts).exec(this.client);zremrangebyscore=(...e)=>new sh(e,this.opts).exec(this.client);zrevrank=(e,t)=>new sa([e,t],this.opts).exec(this.client);zscan=(...e)=>new sp(e,this.opts).exec(this.client);zscore=(e,t)=>new sl([e,t],this.opts).exec(this.client);zunion=(...e)=>new su(e,this.opts).exec(this.client);zunionstore=(...e)=>new sm(e,this.opts).exec(this.client)};"undefined"==typeof atob&&(e.g.atob=e=>Buffer.from(e,"base64").toString("utf8"));let sR=(class e extends sT{constructor(e){if("request"in e)return void super(e);if(e.url?(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("[Upstash Redis] The redis url contains whitespace or newline, which can cause errors!"):console.warn("[Upstash Redis] The 'url' property is missing or undefined in your Redis config."),e.token?(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("[Upstash Redis] The redis token contains whitespace or newline, which can cause errors!"):console.warn("[Upstash Redis] The 'token' property is missing or undefined in your Redis config."),super(new a({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache??"no-store",signal:e.signal,keepAlive:e.keepAlive,readYourWrites:e.readYourWrites}),{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY,latencyLogging:e.latencyLogging,enableAutoPipelining:e.enableAutoPipelining}),this.addTelemetry({runtime:"string"==typeof EdgeRuntime?"edge-light":`node@${process.version}`,platform:process.env.UPSTASH_CONSOLE?"console":process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:"@upstash/redis@v1.35.5"}),this.enableAutoPipelining)return this.autoPipeline()}static fromEnv(t){if(void 0===process.env)throw TypeError('[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let s=process.env.UPSTASH_REDIS_REST_URL||process.env.KV_REST_API_URL;s||console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let n=process.env.UPSTASH_REDIS_REST_TOKEN||process.env.KV_REST_API_TOKEN;return n||console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`"),new e({...t,url:s,token:n})}}).fromEnv()}];
|
|
1
|
+
module.exports=[44784,e=>{"use strict";e.s(["redis",()=>sN],44784);var t=e.i(66680);let s=t.default.webcrypto?.subtle||{};var n=Object.defineProperty;((e,t)=>{for(var s in t)n(e,s,{get:t[s],enumerable:!0})})({},{UpstashError:()=>i,UpstashJSONParseError:()=>c,UrlError:()=>r});var i=class extends Error{constructor(e,t){super(e,t),this.name="UpstashError"}},r=class extends Error{constructor(e){super(`Upstash Redis client was passed an invalid URL. You should pass a URL starting with https. Received: "${e}". `),this.name="UrlError"}},c=class extends i{constructor(e,t){super(`Unable to parse response body: ${e.length>200?e.slice(0,200)+"...":e}`,t),this.name="UpstashJSONParseError"}};function o(e){try{return function e(t){let s=Array.isArray(t)?t.map(t=>{try{return e(t)}catch{return t}}):JSON.parse(t);return"number"==typeof s&&s.toString()!==t?t:s}(e)}catch{return e}}function h(e){return[e[0],...o(e.slice(1))]}function a(e){let[t,s]=e,n=[];for(let e=0;e<s.length;e+=2)n.push({key:s[e],type:s[e+1]});return[t,n]}var p=class{baseUrl;headers;options;readYourWrites;upstashSyncToken="";hasCredentials;retry;constructor(e){if(this.options={backend:e.options?.backend,agent:e.agent,responseEncoding:e.responseEncoding??"base64",cache:e.cache,signal:e.signal,keepAlive:e.keepAlive??!0},this.upstashSyncToken="",this.readYourWrites=e.readYourWrites??!0,this.baseUrl=(e.baseUrl||"").replace(/\/$/,""),this.baseUrl&&!/^https?:\/\/[^\s#$./?].\S*$/.test(this.baseUrl))throw new r(this.baseUrl);this.headers={"Content-Type":"application/json",...e.headers},this.hasCredentials=!!(this.baseUrl&&this.headers.authorization.split(" ")[1]),"base64"===this.options.responseEncoding&&(this.headers["Upstash-Encoding"]="base64"),this.retry="boolean"!=typeof e.retry||e.retry?{attempts:e.retry?.retries??5,backoff:e.retry?.backoff??(e=>50*Math.exp(e))}:{attempts:1,backoff:()=>0}}mergeTelemetry(e){this.headers=m(this.headers,"Upstash-Telemetry-Runtime",e.runtime),this.headers=m(this.headers,"Upstash-Telemetry-Platform",e.platform),this.headers=m(this.headers,"Upstash-Telemetry-Sdk",e.sdk)}async request(e){let t,s=function(...e){let t={};for(let s of e)if(s)for(let[e,n]of Object.entries(s))null!=n&&(t[e]=n);return t}(this.headers,e.headers??{}),n=[this.baseUrl,...e.path??[]].join("/"),r="text/event-stream"===s.Accept,o=e.signal??this.options.signal,h="function"==typeof o,a={cache:this.options.cache,method:"POST",headers:s,body:JSON.stringify(e.body),keepalive:this.options.keepAlive,agent:this.options.agent,signal:h?o():o,backend:this.options.backend};if(this.hasCredentials||console.warn("[Upstash Redis] Redis client was initialized without url or token. Failed to execute command."),this.readYourWrites){let e=this.upstashSyncToken;this.headers["upstash-sync-token"]=e}let p=null,l=null;for(let e=0;e<=this.retry.attempts;e++)try{p=await fetch(n,a);break}catch(t){if(a.signal?.aborted&&h)throw t;if(a.signal?.aborted){p=new Response(new Blob([JSON.stringify({result:a.signal.reason??"Aborted"})]),{status:200,statusText:a.signal.reason??"Aborted"});break}l=t,e<this.retry.attempts&&await new Promise(t=>setTimeout(t,this.retry.backoff(e)))}if(!p)throw l??Error("Exhausted all retries");if(!p.ok){let t,s=await p.text();try{t=JSON.parse(s)}catch(e){throw new c(s,{cause:e})}throw new i(`${t.error}, command was: ${JSON.stringify(e.body)}`)}if(this.readYourWrites){let e=p.headers;this.upstashSyncToken=e.get("upstash-sync-token")??""}if(r&&e&&e.onMessage&&p.body){let t=p.body.getReader(),s=new TextDecoder;return(async()=>{try{for(;;){let{value:n,done:i}=await t.read();if(i)break;for(let t of s.decode(n).split("\n"))if(t.startsWith("data: ")){let s=t.slice(6);e.onMessage?.(s)}}}catch(e){e instanceof Error&&"AbortError"===e.name||console.error("Stream reading error:",e)}finally{try{await t.cancel()}catch{}}})(),{result:1}}let m=await p.text();try{t=JSON.parse(m)}catch(e){throw new c(m,{cause:e})}if(this.readYourWrites){let e=p.headers;this.upstashSyncToken=e.get("upstash-sync-token")??""}return"base64"===this.options.responseEncoding?Array.isArray(t)?t.map(({result:e,error:t})=>({result:u(e),error:t})):{result:u(t.result),error:t.error}:t}};function l(e){let t="";try{let s=atob(e),n=s.length,i=new Uint8Array(n);for(let e=0;e<n;e++)i[e]=s.charCodeAt(e);t=new TextDecoder().decode(i)}catch{t=e}return t}function u(e){let t;switch(typeof e){case"undefined":return e;case"number":t=e;break;case"object":t=Array.isArray(e)?e.map(e=>"string"==typeof e?l(e):Array.isArray(e)?e.map(e=>u(e)):e):null;break;case"string":t="OK"===e?"OK":l(e)}return t}function m(e,t,s){return s&&(e[t]=e[t]?[e[t],s].join(","):s),e}var d=e=>{switch(typeof e){case"string":case"number":case"boolean":return e;default:return JSON.stringify(e)}},x=class{command;serialize;deserialize;headers;path;onMessage;isStreaming;signal;constructor(e,t){if(this.serialize=d,this.deserialize=t?.automaticDeserialization===void 0||t.automaticDeserialization?t?.deserialize??o:e=>e,this.command=e.map(e=>this.serialize(e)),this.headers=t?.headers,this.path=t?.path,this.onMessage=t?.streamOptions?.onMessage,this.isStreaming=t?.streamOptions?.isStreaming??!1,this.signal=t?.streamOptions?.signal,t?.latencyLogging){let e=this.exec.bind(this);this.exec=async t=>{let s=performance.now(),n=await e(t),i=(performance.now()-s).toFixed(2);return console.log(`Latency for \x1b[38;2;19;185;39m${this.command[0].toString().toUpperCase()}\x1b[0m: \x1b[38;2;0;255;255m${i} ms\x1b[0m`),n}}}async exec(e){let{result:t,error:s}=await e.request({body:this.command,path:this.path,upstashSyncToken:e.upstashSyncToken,headers:this.headers,onMessage:this.onMessage,isStreaming:this.isStreaming,signal:this.signal});if(s)throw new i(s);if(void 0===t)throw TypeError("Request did not return a result");return this.deserialize(t)}},w=class extends x{constructor(e,t){let s=["hrandfield",e[0]];"number"==typeof e[1]&&s.push(e[1]),e[2]&&s.push("WITHVALUES"),super(s,{deserialize:e[2]?e=>(function(e){if(0===e.length)return null;let t={};for(let s=0;s<e.length;s+=2){let n=e[s],i=e[s+1];try{t[n]=JSON.parse(i)}catch{t[n]=i}}return t})(e):t?.deserialize,...t})}},y=class extends x{constructor(e,t){super(["append",...e],t)}},g=class extends x{constructor([e,t,s],n){let i=["bitcount",e];"number"==typeof t&&i.push(t),"number"==typeof s&&i.push(s),super(i,n)}},O=class{constructor(e,t,s,n=e=>e.exec(this.client)){this.client=t,this.opts=s,this.execOperation=n,this.command=["bitfield",...e]}command;chain(...e){return this.command.push(...e),this}get(...e){return this.chain("get",...e)}set(...e){return this.chain("set",...e)}incrby(...e){return this.chain("incrby",...e)}overflow(e){return this.chain("overflow",e)}exec(){let e=new x(this.command,this.opts);return this.execOperation(e)}},b=class extends x{constructor(e,t){super(["bitop",...e],t)}},f=class extends x{constructor(e,t){super(["bitpos",...e],t)}},E=class extends x{constructor([e,t,s],n){super(["COPY",e,t,...s?.replace?["REPLACE"]:[]],{...n,deserialize:e=>e>0?"COPIED":"NOT_COPIED"})}},S=class extends x{constructor(e){super(["dbsize"],e)}},A=class extends x{constructor(e,t){super(["decr",...e],t)}},T=class extends x{constructor(e,t){super(["decrby",...e],t)}},R=class extends x{constructor(e,t){super(["del",...e],t)}},N=class extends x{constructor(e,t){super(["echo",...e],t)}},v=class extends x{constructor([e,t,s],n){super(["eval_ro",e,t.length,...t,...s??[]],n)}},z=class extends x{constructor([e,t,s],n){super(["eval",e,t.length,...t,...s??[]],n)}},k=class extends x{constructor([e,t,s],n){super(["evalsha_ro",e,t.length,...t,...s??[]],n)}},U=class extends x{constructor([e,t,s],n){super(["evalsha",e,t.length,...t,...s??[]],n)}},P=class extends x{constructor(e,t){super(e.map(e=>"string"==typeof e?e:String(e)),t)}},C=class extends x{constructor(e,t){super(["exists",...e],t)}},L=class extends x{constructor(e,t){super(["expire",...e.filter(Boolean)],t)}},I=class extends x{constructor(e,t){super(["expireat",...e],t)}},M=class extends x{constructor(e,t){let s=["flushall"];e&&e.length>0&&e[0].async&&s.push("async"),super(s,t)}},D=class extends x{constructor([e],t){let s=["flushdb"];e?.async&&s.push("async"),super(s,t)}},J=class extends x{constructor([e,t,...s],n){let i=["geoadd",e];"nx"in t&&t.nx?i.push("nx"):"xx"in t&&t.xx&&i.push("xx"),"ch"in t&&t.ch&&i.push("ch"),"latitude"in t&&t.latitude&&i.push(t.longitude,t.latitude,t.member),i.push(...s.flatMap(({latitude:e,longitude:t,member:s})=>[t,e,s])),super(i,n)}},F=class extends x{constructor([e,t,s,n="M"],i){super(["GEODIST",e,t,s,n],i)}},Y=class extends x{constructor(e,t){let[s]=e;super(["GEOHASH",s,...Array.isArray(e[1])?e[1]:e.slice(1)],t)}},$=class extends x{constructor(e,t){let[s]=e;super(["GEOPOS",s,...Array.isArray(e[1])?e[1]:e.slice(1)],{deserialize:e=>(function(e){let t=[];for(let s of e)s?.[0]&&s?.[1]&&t.push({lng:Number.parseFloat(s[0]),lat:Number.parseFloat(s[1])});return t})(e),...t})}},_=class extends x{constructor([e,t,s,n,i],r){let c=["GEOSEARCH",e];("FROMMEMBER"===t.type||"frommember"===t.type)&&c.push(t.type,t.member),("FROMLONLAT"===t.type||"fromlonlat"===t.type)&&c.push(t.type,t.coordinate.lon,t.coordinate.lat),("BYRADIUS"===s.type||"byradius"===s.type)&&c.push(s.type,s.radius,s.radiusType),("BYBOX"===s.type||"bybox"===s.type)&&c.push(s.type,s.rect.width,s.rect.height,s.rectType),c.push(n),i?.count&&c.push("COUNT",i.count.limit,...i.count.any?["ANY"]:[]),super([...c,...i?.withCoord?["WITHCOORD"]:[],...i?.withDist?["WITHDIST"]:[],...i?.withHash?["WITHHASH"]:[]],{deserialize:e=>i?.withCoord||i?.withDist||i?.withHash?e.map(e=>{let t=1,s={};try{s.member=JSON.parse(e[0])}catch{s.member=e[0]}return i.withDist&&(s.dist=Number.parseFloat(e[t++])),i.withHash&&(s.hash=e[t++].toString()),i.withCoord&&(s.coord={long:Number.parseFloat(e[t][0]),lat:Number.parseFloat(e[t][1])}),s}):e.map(e=>{try{return{member:JSON.parse(e)}}catch{return{member:e}}}),...r})}},j=class extends x{constructor([e,t,s,n,i,r],c){let o=["GEOSEARCHSTORE",e,t];("FROMMEMBER"===s.type||"frommember"===s.type)&&o.push(s.type,s.member),("FROMLONLAT"===s.type||"fromlonlat"===s.type)&&o.push(s.type,s.coordinate.lon,s.coordinate.lat),("BYRADIUS"===n.type||"byradius"===n.type)&&o.push(n.type,n.radius,n.radiusType),("BYBOX"===n.type||"bybox"===n.type)&&o.push(n.type,n.rect.width,n.rect.height,n.rectType),o.push(i),r?.count&&o.push("COUNT",r.count.limit,...r.count.any?["ANY"]:[]),super([...o,...r?.storeDist?["STOREDIST"]:[]],c)}},W=class extends x{constructor(e,t){super(["get",...e],t)}},X=class extends x{constructor(e,t){super(["getbit",...e],t)}},G=class extends x{constructor(e,t){super(["getdel",...e],t)}},H=class extends x{constructor([e,t],s){let n=["getex",e];t&&("ex"in t&&"number"==typeof t.ex?n.push("ex",t.ex):"px"in t&&"number"==typeof t.px?n.push("px",t.px):"exat"in t&&"number"==typeof t.exat?n.push("exat",t.exat):"pxat"in t&&"number"==typeof t.pxat?n.push("pxat",t.pxat):"persist"in t&&t.persist&&n.push("persist")),super(n,s)}},B=class extends x{constructor(e,t){super(["getrange",...e],t)}},K=class extends x{constructor(e,t){super(["getset",...e],t)}},q=class extends x{constructor(e,t){super(["hdel",...e],t)}},V=class extends x{constructor(e,t){super(["hexists",...e],t)}},Q=class extends x{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hexpire",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},Z=class extends x{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hexpireat",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},ee=class extends x{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hexpiretime",s,"FIELDS",i.length,...i],t)}},et=class extends x{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpersist",s,"FIELDS",i.length,...i],t)}},es=class extends x{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hpexpire",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},en=class extends x{constructor(e,t){let[s,n,i,r]=e,c=Array.isArray(n)?n:[n];super(["hpexpireat",s,i,...r?[r]:[],"FIELDS",c.length,...c],t)}},ei=class extends x{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpexpiretime",s,"FIELDS",i.length,...i],t)}},er=class extends x{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["hpttl",s,"FIELDS",i.length,...i],t)}},ec=class extends x{constructor(e,t){super(["hget",...e],t)}},eo=class extends x{constructor(e,t){super(["hgetall",...e],{deserialize:e=>(function(e){if(0===e.length)return null;let t={};for(let s=0;s<e.length;s+=2){let n=e[s],i=e[s+1];try{let e=!Number.isNaN(Number(i))&&!Number.isSafeInteger(Number(i));t[n]=e?i:JSON.parse(i)}catch{t[n]=i}}return t})(e),...t})}},eh=class extends x{constructor(e,t){super(["hincrby",...e],t)}},ea=class extends x{constructor(e,t){super(["hincrbyfloat",...e],t)}},ep=class extends x{constructor([e],t){super(["hkeys",e],t)}},el=class extends x{constructor(e,t){super(["hlen",...e],t)}},eu=class extends x{constructor([e,...t],s){super(["hmget",e,...t],{deserialize:e=>(function(e,t){if(t.every(e=>null===e))return null;let s={};for(let[n,i]of e.entries())try{s[i]=JSON.parse(t[n])}catch{s[i]=t[n]}return s})(t,e),...s})}},em=class extends x{constructor([e,t],s){super(["hmset",e,...Object.entries(t).flatMap(([e,t])=>[e,t])],s)}},ed=class extends x{constructor([e,t,s],n){let i=["hscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:h,...n})}},ex=class extends x{constructor([e,t],s){super(["hset",e,...Object.entries(t).flatMap(([e,t])=>[e,t])],s)}},ew=class extends x{constructor(e,t){super(["hsetnx",...e],t)}},ey=class extends x{constructor(e,t){super(["hstrlen",...e],t)}},eg=class extends x{constructor(e,t){let[s,n]=e,i=Array.isArray(n)?n:[n];super(["httl",s,"FIELDS",i.length,...i],t)}},eO=class extends x{constructor(e,t){super(["hvals",...e],t)}},eb=class extends x{constructor(e,t){super(["incr",...e],t)}},ef=class extends x{constructor(e,t){super(["incrby",...e],t)}},eE=class extends x{constructor(e,t){super(["incrbyfloat",...e],t)}},eS=class extends x{constructor(e,t){super(["JSON.ARRAPPEND",...e],t)}},eA=class extends x{constructor(e,t){super(["JSON.ARRINDEX",...e],t)}},eT=class extends x{constructor(e,t){super(["JSON.ARRINSERT",...e],t)}},eR=class extends x{constructor(e,t){super(["JSON.ARRLEN",e[0],e[1]??"$"],t)}},eN=class extends x{constructor(e,t){super(["JSON.ARRPOP",...e],t)}},ev=class extends x{constructor(e,t){let s=e[1]??"$";super(["JSON.ARRTRIM",e[0],s,e[2]??0,e[3]??0],t)}},ez=class extends x{constructor(e,t){super(["JSON.CLEAR",...e],t)}},ek=class extends x{constructor(e,t){super(["JSON.DEL",...e],t)}},eU=class extends x{constructor(e,t){super(["JSON.FORGET",...e],t)}},eP=class extends x{constructor(e,t){let s=["JSON.GET"];"string"==typeof e[1]?s.push(...e):(s.push(e[0]),e[1]&&(e[1].indent&&s.push("INDENT",e[1].indent),e[1].newline&&s.push("NEWLINE",e[1].newline),e[1].space&&s.push("SPACE",e[1].space)),s.push(...e.slice(2))),super(s,t)}},eC=class extends x{constructor(e,t){super(["JSON.MERGE",...e],t)}},eL=class extends x{constructor(e,t){super(["JSON.MGET",...e[0],e[1]],t)}},eI=class extends x{constructor(e,t){let s=["JSON.MSET"];for(let t of e)s.push(t.key,t.path,t.value);super(s,t)}},eM=class extends x{constructor(e,t){super(["JSON.NUMINCRBY",...e],t)}},eD=class extends x{constructor(e,t){super(["JSON.NUMMULTBY",...e],t)}},eJ=class extends x{constructor(e,t){super(["JSON.OBJKEYS",...e],t)}},eF=class extends x{constructor(e,t){super(["JSON.OBJLEN",...e],t)}},eY=class extends x{constructor(e,t){super(["JSON.RESP",...e],t)}},e$=class extends x{constructor(e,t){let s=["JSON.SET",e[0],e[1],e[2]];e[3]&&(e[3].nx?s.push("NX"):e[3].xx&&s.push("XX")),super(s,t)}},e_=class extends x{constructor(e,t){super(["JSON.STRAPPEND",...e],t)}},ej=class extends x{constructor(e,t){super(["JSON.STRLEN",...e],t)}},eW=class extends x{constructor(e,t){super(["JSON.TOGGLE",...e],t)}},eX=class extends x{constructor(e,t){super(["JSON.TYPE",...e],t)}},eG=class extends x{constructor(e,t){super(["keys",...e],t)}},eH=class extends x{constructor(e,t){super(["lindex",...e],t)}},eB=class extends x{constructor(e,t){super(["linsert",...e],t)}},eK=class extends x{constructor(e,t){super(["llen",...e],t)}},eq=class extends x{constructor(e,t){super(["lmove",...e],t)}},eV=class extends x{constructor(e,t){let[s,n,i,r]=e;super(["LMPOP",s,...n,i,...r?["COUNT",r]:[]],t)}},eQ=class extends x{constructor(e,t){super(["lpop",...e],t)}},eZ=class extends x{constructor(e,t){let s=["lpos",e[0],e[1]];"number"==typeof e[2]?.rank&&s.push("rank",e[2].rank),"number"==typeof e[2]?.count&&s.push("count",e[2].count),"number"==typeof e[2]?.maxLen&&s.push("maxLen",e[2].maxLen),super(s,t)}},e1=class extends x{constructor(e,t){super(["lpush",...e],t)}},e0=class extends x{constructor(e,t){super(["lpushx",...e],t)}},e2=class extends x{constructor(e,t){super(["lrange",...e],t)}},e5=class extends x{constructor(e,t){super(["lrem",...e],t)}},e8=class extends x{constructor(e,t){super(["lset",...e],t)}},e6=class extends x{constructor(e,t){super(["ltrim",...e],t)}},e3=class extends x{constructor(e,t){super(["mget",...Array.isArray(e[0])?e[0]:e],t)}},e4=class extends x{constructor([e],t){super(["mset",...Object.entries(e).flatMap(([e,t])=>[e,t])],t)}},e9=class extends x{constructor([e],t){super(["msetnx",...Object.entries(e).flat()],t)}},e7=class extends x{constructor(e,t){super(["persist",...e],t)}},te=class extends x{constructor(e,t){super(["pexpire",...e],t)}},tt=class extends x{constructor(e,t){super(["pexpireat",...e],t)}},ts=class extends x{constructor(e,t){super(["pfadd",...e],t)}},tn=class extends x{constructor(e,t){super(["pfcount",...e],t)}},ti=class extends x{constructor(e,t){super(["pfmerge",...e],t)}},tr=class extends x{constructor(e,t){let s=["ping"];e?.[0]!==void 0&&s.push(e[0]),super(s,t)}},tc=class extends x{constructor(e,t){super(["psetex",...e],t)}},to=class extends x{constructor(e,t){super(["pttl",...e],t)}},th=class extends x{constructor(e,t){super(["publish",...e],t)}},ta=class extends x{constructor(e){super(["randomkey"],e)}},tp=class extends x{constructor(e,t){super(["rename",...e],t)}},tl=class extends x{constructor(e,t){super(["renamenx",...e],t)}},tu=class extends x{constructor(e,t){super(["rpop",...e],t)}},tm=class extends x{constructor(e,t){super(["rpush",...e],t)}},td=class extends x{constructor(e,t){super(["rpushx",...e],t)}},tx=class extends x{constructor(e,t){super(["sadd",...e],t)}},tw=class extends x{constructor([e,t],s){let n=["scan",e];t?.match&&n.push("match",t.match),"number"==typeof t?.count&&n.push("count",t.count),t&&"withType"in t&&!0===t.withType?n.push("withtype"):t&&"type"in t&&t.type&&t.type.length>0&&n.push("type",t.type),super(n,{deserialize:t?.withType?a:h,...s})}},ty=class extends x{constructor(e,t){super(["scard",...e],t)}},tg=class extends x{constructor(e,t){super(["script","exists",...e],{deserialize:e=>e,...t})}},tO=class extends x{constructor([e],t){let s=["script","flush"];e?.sync?s.push("sync"):e?.async&&s.push("async"),super(s,t)}},tb=class extends x{constructor(e,t){super(["script","load",...e],t)}},tf=class extends x{constructor(e,t){super(["sdiff",...e],t)}},tE=class extends x{constructor(e,t){super(["sdiffstore",...e],t)}},tS=class extends x{constructor([e,t,s],n){let i=["set",e,t];s&&("nx"in s&&s.nx?i.push("nx"):"xx"in s&&s.xx&&i.push("xx"),"get"in s&&s.get&&i.push("get"),"ex"in s&&"number"==typeof s.ex?i.push("ex",s.ex):"px"in s&&"number"==typeof s.px?i.push("px",s.px):"exat"in s&&"number"==typeof s.exat?i.push("exat",s.exat):"pxat"in s&&"number"==typeof s.pxat?i.push("pxat",s.pxat):"keepTtl"in s&&s.keepTtl&&i.push("keepTtl")),super(i,n)}},tA=class extends x{constructor(e,t){super(["setbit",...e],t)}},tT=class extends x{constructor(e,t){super(["setex",...e],t)}},tR=class extends x{constructor(e,t){super(["setnx",...e],t)}},tN=class extends x{constructor(e,t){super(["setrange",...e],t)}},tv=class extends x{constructor(e,t){super(["sinter",...e],t)}},tz=class extends x{constructor(e,t){super(["sinterstore",...e],t)}},tk=class extends x{constructor(e,t){super(["sismember",...e],t)}},tU=class extends x{constructor(e,t){super(["smembers",...e],t)}},tP=class extends x{constructor(e,t){super(["smismember",e[0],...e[1]],t)}},tC=class extends x{constructor(e,t){super(["smove",...e],t)}},tL=class extends x{constructor([e,t],s){let n=["spop",e];"number"==typeof t&&n.push(t),super(n,s)}},tI=class extends x{constructor([e,t],s){let n=["srandmember",e];"number"==typeof t&&n.push(t),super(n,s)}},tM=class extends x{constructor(e,t){super(["srem",...e],t)}},tD=class extends x{constructor([e,t,s],n){let i=["sscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:h,...n})}},tJ=class extends x{constructor(e,t){super(["strlen",...e],t)}},tF=class extends x{constructor(e,t){super(["sunion",...e],t)}},tY=class extends x{constructor(e,t){super(["sunionstore",...e],t)}},t$=class extends x{constructor(e){super(["time"],e)}},t_=class extends x{constructor(e,t){super(["touch",...e],t)}},tj=class extends x{constructor(e,t){super(["ttl",...e],t)}},tW=class extends x{constructor(e,t){super(["type",...e],t)}},tX=class extends x{constructor(e,t){super(["unlink",...e],t)}},tG=class extends x{constructor([e,t,s],n){super(["XACK",e,t,...Array.isArray(s)?[...s]:[s]],n)}},tH=class extends x{constructor([e,t,s,n],i){let r=["XADD",e];for(let[e,i]of(n&&(n.nomkStream&&r.push("NOMKSTREAM"),n.trim&&(r.push(n.trim.type,n.trim.comparison,n.trim.threshold),void 0!==n.trim.limit&&r.push("LIMIT",n.trim.limit))),r.push(t),Object.entries(s)))r.push(e,i);super(r,i)}},tB=class extends x{constructor([e,t,s,n,i,r],c){let o=[];r?.count&&o.push("COUNT",r.count),r?.justId&&o.push("JUSTID"),super(["XAUTOCLAIM",e,t,s,n,i,...o],c)}},tK=class extends x{constructor([e,t,s,n,i,r],c){let o=Array.isArray(i)?[...i]:[i],h=[];r?.idleMS&&h.push("IDLE",r.idleMS),r?.idleMS&&h.push("TIME",r.timeMS),r?.retryCount&&h.push("RETRYCOUNT",r.retryCount),r?.force&&h.push("FORCE"),r?.justId&&h.push("JUSTID"),r?.lastId&&h.push("LASTID",r.lastId),super(["XCLAIM",e,t,s,n,...o,...h],c)}},tq=class extends x{constructor([e,t],s){super(["XDEL",e,...Array.isArray(t)?[...t]:[t]],s)}},tV=class extends x{constructor([e,t],s){let n=["XGROUP"];switch(t.type){case"CREATE":n.push("CREATE",e,t.group,t.id),t.options&&(t.options.MKSTREAM&&n.push("MKSTREAM"),void 0!==t.options.ENTRIESREAD&&n.push("ENTRIESREAD",t.options.ENTRIESREAD.toString()));break;case"CREATECONSUMER":n.push("CREATECONSUMER",e,t.group,t.consumer);break;case"DELCONSUMER":n.push("DELCONSUMER",e,t.group,t.consumer);break;case"DESTROY":n.push("DESTROY",e,t.group);break;case"SETID":n.push("SETID",e,t.group,t.id),t.options?.ENTRIESREAD!==void 0&&n.push("ENTRIESREAD",t.options.ENTRIESREAD.toString());break;default:throw Error("Invalid XGROUP")}super(n,s)}},tQ=class extends x{constructor([e,t],s){let n=[];"CONSUMERS"===t.type?n.push("CONSUMERS",e,t.group):n.push("GROUPS",e),super(["XINFO",...n],s)}},tZ=class extends x{constructor(e,t){super(["XLEN",...e],t)}},t1=class extends x{constructor([e,t,s,n,i,r],c){super(["XPENDING",e,t,...r?.idleTime?["IDLE",r.idleTime]:[],s,n,i,...r?.consumer===void 0?[]:Array.isArray(r.consumer)?[...r.consumer]:[r.consumer]],c)}},t0=class extends x{constructor([e,t,s,n],i){let r=["XRANGE",e,t,s];"number"==typeof n&&r.push("COUNT",n),super(r,{deserialize:e=>(function(e){let t={};for(let s of e)for(let e=0;e<s.length;e+=2){let n=s[e],i=s[e+1];n in t||(t[n]={});for(let e=0;e<i.length;e+=2){let s=i[e],r=i[e+1];try{t[n][s]=JSON.parse(r)}catch{t[n][s]=r}}}return t})(e),...i})}},t2=class extends x{constructor([e,t,s],n){if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)throw Error("ERR Unbalanced XREAD list of streams: for each stream key an ID or '$' must be specified");let i=[];"number"==typeof s?.count&&i.push("COUNT",s.count),"number"==typeof s?.blockMS&&i.push("BLOCK",s.blockMS),i.push("STREAMS",...Array.isArray(e)?[...e]:[e],...Array.isArray(t)?[...t]:[t]),super(["XREAD",...i],n)}},t5=class extends x{constructor([e,t,s,n,i],r){if(Array.isArray(s)&&Array.isArray(n)&&s.length!==n.length)throw Error("ERR Unbalanced XREADGROUP list of streams: for each stream key an ID or '$' must be specified");let c=[];"number"==typeof i?.count&&c.push("COUNT",i.count),"number"==typeof i?.blockMS&&c.push("BLOCK",i.blockMS),"boolean"==typeof i?.NOACK&&i.NOACK&&c.push("NOACK"),c.push("STREAMS",...Array.isArray(s)?[...s]:[s],...Array.isArray(n)?[...n]:[n]),super(["XREADGROUP","GROUP",e,t,...c],r)}},t8=class extends x{constructor([e,t,s,n],i){let r=["XREVRANGE",e,t,s];"number"==typeof n&&r.push("COUNT",n),super(r,{deserialize:e=>(function(e){let t={};for(let s of e)for(let e=0;e<s.length;e+=2){let n=s[e],i=s[e+1];n in t||(t[n]={});for(let e=0;e<i.length;e+=2){let s=i[e],r=i[e+1];try{t[n][s]=JSON.parse(r)}catch{t[n][s]=r}}}return t})(e),...i})}},t6=class extends x{constructor([e,t],s){let{limit:n,strategy:i,threshold:r,exactness:c="~"}=t;super(["XTRIM",e,i,c,r,...n?["LIMIT",n]:[]],s)}},t3=class extends x{constructor([e,t,...s],n){let i=["zadd",e];"nx"in t&&t.nx?i.push("nx"):"xx"in t&&t.xx&&i.push("xx"),"ch"in t&&t.ch&&i.push("ch"),"incr"in t&&t.incr&&i.push("incr"),"lt"in t&&t.lt?i.push("lt"):"gt"in t&&t.gt&&i.push("gt"),"score"in t&&"member"in t&&i.push(t.score,t.member),i.push(...s.flatMap(({score:e,member:t})=>[e,t])),super(i,n)}},t4=class extends x{constructor(e,t){super(["zcard",...e],t)}},t9=class extends x{constructor(e,t){super(["zcount",...e],t)}},t7=class extends x{constructor(e,t){super(["zincrby",...e],t)}},se=class extends x{constructor([e,t,s,n],i){let r=["zinterstore",e,t];Array.isArray(s)?r.push(...s):r.push(s),n&&("weights"in n&&n.weights?r.push("weights",...n.weights):"weight"in n&&"number"==typeof n.weight&&r.push("weights",n.weight),"aggregate"in n&&r.push("aggregate",n.aggregate)),super(r,i)}},st=class extends x{constructor(e,t){super(["zlexcount",...e],t)}},ss=class extends x{constructor([e,t],s){let n=["zpopmax",e];"number"==typeof t&&n.push(t),super(n,s)}},sn=class extends x{constructor([e,t],s){let n=["zpopmin",e];"number"==typeof t&&n.push(t),super(n,s)}},si=class extends x{constructor([e,t,s,n],i){let r=["zrange",e,t,s];n?.byScore&&r.push("byscore"),n?.byLex&&r.push("bylex"),n?.rev&&r.push("rev"),n?.count!==void 0&&void 0!==n.offset&&r.push("limit",n.offset,n.count),n?.withScores&&r.push("withscores"),super(r,i)}},sr=class extends x{constructor(e,t){super(["zrank",...e],t)}},sc=class extends x{constructor(e,t){super(["zrem",...e],t)}},so=class extends x{constructor(e,t){super(["zremrangebylex",...e],t)}},sh=class extends x{constructor(e,t){super(["zremrangebyrank",...e],t)}},sa=class extends x{constructor(e,t){super(["zremrangebyscore",...e],t)}},sp=class extends x{constructor(e,t){super(["zrevrank",...e],t)}},sl=class extends x{constructor([e,t,s],n){let i=["zscan",e,t];s?.match&&i.push("match",s.match),"number"==typeof s?.count&&i.push("count",s.count),super(i,{deserialize:h,...n})}},su=class extends x{constructor(e,t){super(["zscore",...e],t)}},sm=class extends x{constructor([e,t,s],n){let i=["zunion",e];Array.isArray(t)?i.push(...t):i.push(t),s&&("weights"in s&&s.weights?i.push("weights",...s.weights):"weight"in s&&"number"==typeof s.weight&&i.push("weights",s.weight),"aggregate"in s&&i.push("aggregate",s.aggregate),s.withScores&&i.push("withscores")),super(i,n)}},sd=class extends x{constructor([e,t,s,n],i){let r=["zunionstore",e,t];Array.isArray(s)?r.push(...s):r.push(s),n&&("weights"in n&&n.weights?r.push("weights",...n.weights):"weight"in n&&"number"==typeof n.weight&&r.push("weights",n.weight),"aggregate"in n&&r.push("aggregate",n.aggregate)),super(r,i)}},sx=class extends x{constructor(e,t){super(["zdiffstore",...e],t)}},sw=class extends x{constructor(e,t){let[s,n]=e;super(["zmscore",s,...n],t)}},sy=class{client;commands;commandOptions;multiExec;constructor(e){if(this.client=e.client,this.commands=[],this.commandOptions=e.commandOptions,this.multiExec=e.multiExec??!1,this.commandOptions?.latencyLogging){let e=this.exec.bind(this);this.exec=async t=>{let s=performance.now(),n=await (t?e(t):e()),i=(performance.now()-s).toFixed(2);return console.log(`Latency for \x1b[38;2;19;185;39m${this.multiExec?["MULTI-EXEC"]:["PIPELINE"].toString().toUpperCase()}\x1b[0m: \x1b[38;2;0;255;255m${i} ms\x1b[0m`),n}}}exec=async e=>{if(0===this.commands.length)throw Error("Pipeline is empty");let t=this.multiExec?["multi-exec"]:["pipeline"],s=await this.client.request({path:t,body:Object.values(this.commands).map(e=>e.command)});return e?.keepErrors?s.map(({error:e,result:t},s)=>({error:e,result:this.commands[s].deserialize(t)})):s.map(({error:e,result:t},s)=>{if(e)throw new i(`Command ${s+1} [ ${this.commands[s].command[0]} ] failed: ${e}`);return this.commands[s].deserialize(t)})};length(){return this.commands.length}chain(e){return this.commands.push(e),this}append=(...e)=>this.chain(new y(e,this.commandOptions));bitcount=(...e)=>this.chain(new g(e,this.commandOptions));bitfield=(...e)=>new O(e,this.client,this.commandOptions,this.chain.bind(this));bitop=(e,t,s,...n)=>this.chain(new b([e,t,s,...n],this.commandOptions));bitpos=(...e)=>this.chain(new f(e,this.commandOptions));copy=(...e)=>this.chain(new E(e,this.commandOptions));zdiffstore=(...e)=>this.chain(new sx(e,this.commandOptions));dbsize=()=>this.chain(new S(this.commandOptions));decr=(...e)=>this.chain(new A(e,this.commandOptions));decrby=(...e)=>this.chain(new T(e,this.commandOptions));del=(...e)=>this.chain(new R(e,this.commandOptions));echo=(...e)=>this.chain(new N(e,this.commandOptions));evalRo=(...e)=>this.chain(new v(e,this.commandOptions));eval=(...e)=>this.chain(new z(e,this.commandOptions));evalshaRo=(...e)=>this.chain(new k(e,this.commandOptions));evalsha=(...e)=>this.chain(new U(e,this.commandOptions));exists=(...e)=>this.chain(new C(e,this.commandOptions));expire=(...e)=>this.chain(new L(e,this.commandOptions));expireat=(...e)=>this.chain(new I(e,this.commandOptions));flushall=e=>this.chain(new M(e,this.commandOptions));flushdb=(...e)=>this.chain(new D(e,this.commandOptions));geoadd=(...e)=>this.chain(new J(e,this.commandOptions));geodist=(...e)=>this.chain(new F(e,this.commandOptions));geopos=(...e)=>this.chain(new $(e,this.commandOptions));geohash=(...e)=>this.chain(new Y(e,this.commandOptions));geosearch=(...e)=>this.chain(new _(e,this.commandOptions));geosearchstore=(...e)=>this.chain(new j(e,this.commandOptions));get=(...e)=>this.chain(new W(e,this.commandOptions));getbit=(...e)=>this.chain(new X(e,this.commandOptions));getdel=(...e)=>this.chain(new G(e,this.commandOptions));getex=(...e)=>this.chain(new H(e,this.commandOptions));getrange=(...e)=>this.chain(new B(e,this.commandOptions));getset=(e,t)=>this.chain(new K([e,t],this.commandOptions));hdel=(...e)=>this.chain(new q(e,this.commandOptions));hexists=(...e)=>this.chain(new V(e,this.commandOptions));hexpire=(...e)=>this.chain(new Q(e,this.commandOptions));hexpireat=(...e)=>this.chain(new Z(e,this.commandOptions));hexpiretime=(...e)=>this.chain(new ee(e,this.commandOptions));httl=(...e)=>this.chain(new eg(e,this.commandOptions));hpexpire=(...e)=>this.chain(new es(e,this.commandOptions));hpexpireat=(...e)=>this.chain(new en(e,this.commandOptions));hpexpiretime=(...e)=>this.chain(new ei(e,this.commandOptions));hpttl=(...e)=>this.chain(new er(e,this.commandOptions));hpersist=(...e)=>this.chain(new et(e,this.commandOptions));hget=(...e)=>this.chain(new ec(e,this.commandOptions));hgetall=(...e)=>this.chain(new eo(e,this.commandOptions));hincrby=(...e)=>this.chain(new eh(e,this.commandOptions));hincrbyfloat=(...e)=>this.chain(new ea(e,this.commandOptions));hkeys=(...e)=>this.chain(new ep(e,this.commandOptions));hlen=(...e)=>this.chain(new el(e,this.commandOptions));hmget=(...e)=>this.chain(new eu(e,this.commandOptions));hmset=(e,t)=>this.chain(new em([e,t],this.commandOptions));hrandfield=(e,t,s)=>this.chain(new w([e,t,s],this.commandOptions));hscan=(...e)=>this.chain(new ed(e,this.commandOptions));hset=(e,t)=>this.chain(new ex([e,t],this.commandOptions));hsetnx=(e,t,s)=>this.chain(new ew([e,t,s],this.commandOptions));hstrlen=(...e)=>this.chain(new ey(e,this.commandOptions));hvals=(...e)=>this.chain(new eO(e,this.commandOptions));incr=(...e)=>this.chain(new eb(e,this.commandOptions));incrby=(...e)=>this.chain(new ef(e,this.commandOptions));incrbyfloat=(...e)=>this.chain(new eE(e,this.commandOptions));keys=(...e)=>this.chain(new eG(e,this.commandOptions));lindex=(...e)=>this.chain(new eH(e,this.commandOptions));linsert=(e,t,s,n)=>this.chain(new eB([e,t,s,n],this.commandOptions));llen=(...e)=>this.chain(new eK(e,this.commandOptions));lmove=(...e)=>this.chain(new eq(e,this.commandOptions));lpop=(...e)=>this.chain(new eQ(e,this.commandOptions));lmpop=(...e)=>this.chain(new eV(e,this.commandOptions));lpos=(...e)=>this.chain(new eZ(e,this.commandOptions));lpush=(e,...t)=>this.chain(new e1([e,...t],this.commandOptions));lpushx=(e,...t)=>this.chain(new e0([e,...t],this.commandOptions));lrange=(...e)=>this.chain(new e2(e,this.commandOptions));lrem=(e,t,s)=>this.chain(new e5([e,t,s],this.commandOptions));lset=(e,t,s)=>this.chain(new e8([e,t,s],this.commandOptions));ltrim=(...e)=>this.chain(new e6(e,this.commandOptions));mget=(...e)=>this.chain(new e3(e,this.commandOptions));mset=e=>this.chain(new e4([e],this.commandOptions));msetnx=e=>this.chain(new e9([e],this.commandOptions));persist=(...e)=>this.chain(new e7(e,this.commandOptions));pexpire=(...e)=>this.chain(new te(e,this.commandOptions));pexpireat=(...e)=>this.chain(new tt(e,this.commandOptions));pfadd=(...e)=>this.chain(new ts(e,this.commandOptions));pfcount=(...e)=>this.chain(new tn(e,this.commandOptions));pfmerge=(...e)=>this.chain(new ti(e,this.commandOptions));ping=e=>this.chain(new tr(e,this.commandOptions));psetex=(e,t,s)=>this.chain(new tc([e,t,s],this.commandOptions));pttl=(...e)=>this.chain(new to(e,this.commandOptions));publish=(...e)=>this.chain(new th(e,this.commandOptions));randomkey=()=>this.chain(new ta(this.commandOptions));rename=(...e)=>this.chain(new tp(e,this.commandOptions));renamenx=(...e)=>this.chain(new tl(e,this.commandOptions));rpop=(...e)=>this.chain(new tu(e,this.commandOptions));rpush=(e,...t)=>this.chain(new tm([e,...t],this.commandOptions));rpushx=(e,...t)=>this.chain(new td([e,...t],this.commandOptions));sadd=(e,t,...s)=>this.chain(new tx([e,t,...s],this.commandOptions));scan=(...e)=>this.chain(new tw(e,this.commandOptions));scard=(...e)=>this.chain(new ty(e,this.commandOptions));scriptExists=(...e)=>this.chain(new tg(e,this.commandOptions));scriptFlush=(...e)=>this.chain(new tO(e,this.commandOptions));scriptLoad=(...e)=>this.chain(new tb(e,this.commandOptions));sdiff=(...e)=>this.chain(new tf(e,this.commandOptions));sdiffstore=(...e)=>this.chain(new tE(e,this.commandOptions));set=(e,t,s)=>this.chain(new tS([e,t,s],this.commandOptions));setbit=(...e)=>this.chain(new tA(e,this.commandOptions));setex=(e,t,s)=>this.chain(new tT([e,t,s],this.commandOptions));setnx=(e,t)=>this.chain(new tR([e,t],this.commandOptions));setrange=(...e)=>this.chain(new tN(e,this.commandOptions));sinter=(...e)=>this.chain(new tv(e,this.commandOptions));sinterstore=(...e)=>this.chain(new tz(e,this.commandOptions));sismember=(e,t)=>this.chain(new tk([e,t],this.commandOptions));smembers=(...e)=>this.chain(new tU(e,this.commandOptions));smismember=(e,t)=>this.chain(new tP([e,t],this.commandOptions));smove=(e,t,s)=>this.chain(new tC([e,t,s],this.commandOptions));spop=(...e)=>this.chain(new tL(e,this.commandOptions));srandmember=(...e)=>this.chain(new tI(e,this.commandOptions));srem=(e,...t)=>this.chain(new tM([e,...t],this.commandOptions));sscan=(...e)=>this.chain(new tD(e,this.commandOptions));strlen=(...e)=>this.chain(new tJ(e,this.commandOptions));sunion=(...e)=>this.chain(new tF(e,this.commandOptions));sunionstore=(...e)=>this.chain(new tY(e,this.commandOptions));time=()=>this.chain(new t$(this.commandOptions));touch=(...e)=>this.chain(new t_(e,this.commandOptions));ttl=(...e)=>this.chain(new tj(e,this.commandOptions));type=(...e)=>this.chain(new tW(e,this.commandOptions));unlink=(...e)=>this.chain(new tX(e,this.commandOptions));zadd=(...e)=>("score"in e[1],this.chain(new t3([e[0],e[1],...e.slice(2)],this.commandOptions)));xadd=(...e)=>this.chain(new tH(e,this.commandOptions));xack=(...e)=>this.chain(new tG(e,this.commandOptions));xdel=(...e)=>this.chain(new tq(e,this.commandOptions));xgroup=(...e)=>this.chain(new tV(e,this.commandOptions));xread=(...e)=>this.chain(new t2(e,this.commandOptions));xreadgroup=(...e)=>this.chain(new t5(e,this.commandOptions));xinfo=(...e)=>this.chain(new tQ(e,this.commandOptions));xlen=(...e)=>this.chain(new tZ(e,this.commandOptions));xpending=(...e)=>this.chain(new t1(e,this.commandOptions));xclaim=(...e)=>this.chain(new tK(e,this.commandOptions));xautoclaim=(...e)=>this.chain(new tB(e,this.commandOptions));xtrim=(...e)=>this.chain(new t6(e,this.commandOptions));xrange=(...e)=>this.chain(new t0(e,this.commandOptions));xrevrange=(...e)=>this.chain(new t8(e,this.commandOptions));zcard=(...e)=>this.chain(new t4(e,this.commandOptions));zcount=(...e)=>this.chain(new t9(e,this.commandOptions));zincrby=(e,t,s)=>this.chain(new t7([e,t,s],this.commandOptions));zinterstore=(...e)=>this.chain(new se(e,this.commandOptions));zlexcount=(...e)=>this.chain(new st(e,this.commandOptions));zmscore=(...e)=>this.chain(new sw(e,this.commandOptions));zpopmax=(...e)=>this.chain(new ss(e,this.commandOptions));zpopmin=(...e)=>this.chain(new sn(e,this.commandOptions));zrange=(...e)=>this.chain(new si(e,this.commandOptions));zrank=(e,t)=>this.chain(new sr([e,t],this.commandOptions));zrem=(e,...t)=>this.chain(new sc([e,...t],this.commandOptions));zremrangebylex=(...e)=>this.chain(new so(e,this.commandOptions));zremrangebyrank=(...e)=>this.chain(new sh(e,this.commandOptions));zremrangebyscore=(...e)=>this.chain(new sa(e,this.commandOptions));zrevrank=(e,t)=>this.chain(new sp([e,t],this.commandOptions));zscan=(...e)=>this.chain(new sl(e,this.commandOptions));zscore=(e,t)=>this.chain(new su([e,t],this.commandOptions));zunionstore=(...e)=>this.chain(new sd(e,this.commandOptions));zunion=(...e)=>this.chain(new sm(e,this.commandOptions));get json(){return{arrappend:(...e)=>this.chain(new eS(e,this.commandOptions)),arrindex:(...e)=>this.chain(new eA(e,this.commandOptions)),arrinsert:(...e)=>this.chain(new eT(e,this.commandOptions)),arrlen:(...e)=>this.chain(new eR(e,this.commandOptions)),arrpop:(...e)=>this.chain(new eN(e,this.commandOptions)),arrtrim:(...e)=>this.chain(new ev(e,this.commandOptions)),clear:(...e)=>this.chain(new ez(e,this.commandOptions)),del:(...e)=>this.chain(new ek(e,this.commandOptions)),forget:(...e)=>this.chain(new eU(e,this.commandOptions)),get:(...e)=>this.chain(new eP(e,this.commandOptions)),merge:(...e)=>this.chain(new eC(e,this.commandOptions)),mget:(...e)=>this.chain(new eL(e,this.commandOptions)),mset:(...e)=>this.chain(new eI(e,this.commandOptions)),numincrby:(...e)=>this.chain(new eM(e,this.commandOptions)),nummultby:(...e)=>this.chain(new eD(e,this.commandOptions)),objkeys:(...e)=>this.chain(new eJ(e,this.commandOptions)),objlen:(...e)=>this.chain(new eF(e,this.commandOptions)),resp:(...e)=>this.chain(new eY(e,this.commandOptions)),set:(...e)=>this.chain(new e$(e,this.commandOptions)),strappend:(...e)=>this.chain(new e_(e,this.commandOptions)),strlen:(...e)=>this.chain(new ej(e,this.commandOptions)),toggle:(...e)=>this.chain(new eW(e,this.commandOptions)),type:(...e)=>this.chain(new eX(e,this.commandOptions))}}},sg=new Set(["scan","keys","flushdb","flushall","dbsize","hscan","hgetall","hkeys","lrange","sscan","smembers","xrange","xrevrange","zscan","zrange","exec"]),sO=class{pipelinePromises=new WeakMap;activePipeline=null;indexInCurrentPipeline=0;redis;pipeline;pipelineCounter=0;constructor(e){this.redis=e,this.pipeline=e.pipeline()}async withAutoPipeline(e){let t=this.activePipeline??this.redis.pipeline();this.activePipeline||(this.activePipeline=t,this.indexInCurrentPipeline=0);let s=this.indexInCurrentPipeline++;e(t);let n=this.deferExecution().then(()=>{if(!this.pipelinePromises.has(t)){let e=t.exec({keepErrors:!0});this.pipelineCounter+=1,this.pipelinePromises.set(t,e),this.activePipeline=null}return this.pipelinePromises.get(t)}),r=(await n)[s];if(r.error)throw new i(`Command failed: ${r.error}`);return r.result}async deferExecution(){await Promise.resolve(),await Promise.resolve()}},sb=class extends x{constructor(e,t){super([],{...t,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},path:["psubscribe",...e],streamOptions:{isStreaming:!0,onMessage:t?.streamOptions?.onMessage,signal:t?.streamOptions?.signal}})}},sf=class extends EventTarget{subscriptions;client;listeners;opts;constructor(e,t,s=!1,n){for(let i of(super(),this.client=e,this.subscriptions=new Map,this.listeners=new Map,this.opts=n,t))s?this.subscribeToPattern(i):this.subscribeToChannel(i)}subscribeToChannel(e){let t=new AbortController,s=new sE([e],{streamOptions:{signal:t.signal,onMessage:e=>this.handleMessage(e,!1)}});s.exec(this.client).catch(e=>{"AbortError"!==e.name&&this.dispatchToListeners("error",e)}),this.subscriptions.set(e,{command:s,controller:t,isPattern:!1})}subscribeToPattern(e){let t=new AbortController,s=new sb([e],{streamOptions:{signal:t.signal,onMessage:e=>this.handleMessage(e,!0)}});s.exec(this.client).catch(e=>{"AbortError"!==e.name&&this.dispatchToListeners("error",e)}),this.subscriptions.set(e,{command:s,controller:t,isPattern:!0})}handleMessage(e,t){let s=e.replace(/^data:\s*/,""),n=s.indexOf(","),i=s.indexOf(",",n+1),r=t?s.indexOf(",",i+1):-1;if(-1!==n&&-1!==i){let e=s.slice(0,n);if(t&&"pmessage"===e&&-1!==r){let e=s.slice(n+1,i),t=s.slice(i+1,r),c=s.slice(r+1);try{let s=this.opts?.automaticDeserialization===!1?c:JSON.parse(c);this.dispatchToListeners("pmessage",{pattern:e,channel:t,message:s}),this.dispatchToListeners(`pmessage:${e}`,{pattern:e,channel:t,message:s})}catch(e){this.dispatchToListeners("error",Error(`Failed to parse message: ${e}`))}}else{let t=s.slice(n+1,i),r=s.slice(i+1);try{if("subscribe"===e||"psubscribe"===e||"unsubscribe"===e||"punsubscribe"===e){let t=Number.parseInt(r);this.dispatchToListeners(e,t)}else{let s=this.opts?.automaticDeserialization===!1?r:sS(r);this.dispatchToListeners(e,{channel:t,message:s}),this.dispatchToListeners(`${e}:${t}`,{channel:t,message:s})}}catch(e){this.dispatchToListeners("error",Error(`Failed to parse message: ${e}`))}}}}dispatchToListeners(e,t){let s=this.listeners.get(e);if(s)for(let e of s)e(t)}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e)?.add(t)}removeAllListeners(){this.listeners.clear()}async unsubscribe(e){if(e)for(let t of e){let e=this.subscriptions.get(t);if(e){try{e.controller.abort()}catch{}this.subscriptions.delete(t)}}else{for(let e of this.subscriptions.values())try{e.controller.abort()}catch{}this.subscriptions.clear(),this.removeAllListeners()}}getSubscribedChannels(){return[...this.subscriptions.keys()]}},sE=class extends x{constructor(e,t){super([],{...t,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},path:["subscribe",...e],streamOptions:{isStreaming:!0,onMessage:t?.streamOptions?.onMessage,signal:t?.streamOptions?.signal}})}},sS=e=>{try{return JSON.parse(e)}catch{return e}},sA=class{script;sha1;redis;constructor(e,t){this.redis=e,this.script=t,this.sha1="",this.init(t)}async init(e){this.sha1||(this.sha1=await this.digest(e))}async eval(e,t){return await this.init(this.script),await this.redis.eval(this.script,e,t)}async evalsha(e,t){return await this.init(this.script),await this.redis.evalsha(this.sha1,e,t)}async exec(e,t){return await this.init(this.script),await this.redis.evalsha(this.sha1,e,t).catch(async s=>{if(s instanceof Error&&s.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,e,t);throw s})}async digest(e){let t=new TextEncoder().encode(e);return[...new Uint8Array(await s.digest("SHA-1",t))].map(e=>e.toString(16).padStart(2,"0")).join("")}},sT=class{script;sha1;redis;constructor(e,t){this.redis=e,this.sha1="",this.script=t,this.init(t)}async init(e){this.sha1||(this.sha1=await this.digest(e))}async evalRo(e,t){return await this.init(this.script),await this.redis.evalRo(this.script,e,t)}async evalshaRo(e,t){return await this.init(this.script),await this.redis.evalshaRo(this.sha1,e,t)}async exec(e,t){return await this.init(this.script),await this.redis.evalshaRo(this.sha1,e,t).catch(async s=>{if(s instanceof Error&&s.message.toLowerCase().includes("noscript"))return await this.redis.evalRo(this.script,e,t);throw s})}async digest(e){let t=new TextEncoder().encode(e);return[...new Uint8Array(await s.digest("SHA-1",t))].map(e=>e.toString(16).padStart(2,"0")).join("")}},sR=class{client;opts;enableTelemetry;enableAutoPipelining;constructor(e,t){this.client=e,this.opts=t,this.enableTelemetry=t?.enableTelemetry??!0,t?.readYourWrites===!1&&(this.client.readYourWrites=!1),this.enableAutoPipelining=t?.enableAutoPipelining??!0}get readYourWritesSyncToken(){return this.client.upstashSyncToken}set readYourWritesSyncToken(e){this.client.upstashSyncToken=e}get json(){return{arrappend:(...e)=>new eS(e,this.opts).exec(this.client),arrindex:(...e)=>new eA(e,this.opts).exec(this.client),arrinsert:(...e)=>new eT(e,this.opts).exec(this.client),arrlen:(...e)=>new eR(e,this.opts).exec(this.client),arrpop:(...e)=>new eN(e,this.opts).exec(this.client),arrtrim:(...e)=>new ev(e,this.opts).exec(this.client),clear:(...e)=>new ez(e,this.opts).exec(this.client),del:(...e)=>new ek(e,this.opts).exec(this.client),forget:(...e)=>new eU(e,this.opts).exec(this.client),get:(...e)=>new eP(e,this.opts).exec(this.client),merge:(...e)=>new eC(e,this.opts).exec(this.client),mget:(...e)=>new eL(e,this.opts).exec(this.client),mset:(...e)=>new eI(e,this.opts).exec(this.client),numincrby:(...e)=>new eM(e,this.opts).exec(this.client),nummultby:(...e)=>new eD(e,this.opts).exec(this.client),objkeys:(...e)=>new eJ(e,this.opts).exec(this.client),objlen:(...e)=>new eF(e,this.opts).exec(this.client),resp:(...e)=>new eY(e,this.opts).exec(this.client),set:(...e)=>new e$(e,this.opts).exec(this.client),strappend:(...e)=>new e_(e,this.opts).exec(this.client),strlen:(...e)=>new ej(e,this.opts).exec(this.client),toggle:(...e)=>new eW(e,this.opts).exec(this.client),type:(...e)=>new eX(e,this.opts).exec(this.client)}}use=e=>{let t=this.client.request.bind(this.client);this.client.request=s=>e(s,t)};addTelemetry=e=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(e)}catch{}};createScript(e,t){return t?.readonly?new sT(this,e):new sA(this,e)}pipeline=()=>new sy({client:this.client,commandOptions:this.opts,multiExec:!1});autoPipeline=()=>(function e(t,s){return t.autoPipelineExecutor||(t.autoPipelineExecutor=new sO(t)),new Proxy(t,{get:(t,n)=>{if("pipelineCounter"===n)return t.autoPipelineExecutor.pipelineCounter;if("json"===n)return e(t,!0);let i=n in t&&!(n in t.autoPipelineExecutor.pipeline),r=sg.has(n);return i||r?t[n]:(s?"function"==typeof t.autoPipelineExecutor.pipeline.json[n]:"function"==typeof t.autoPipelineExecutor.pipeline[n])?(...e)=>t.autoPipelineExecutor.withAutoPipeline(t=>{s?t.json[n](...e):t[n](...e)}):t.autoPipelineExecutor.pipeline[n]}})})(this);multi=()=>new sy({client:this.client,commandOptions:this.opts,multiExec:!0});bitfield=(...e)=>new O(e,this.client,this.opts);append=(...e)=>new y(e,this.opts).exec(this.client);bitcount=(...e)=>new g(e,this.opts).exec(this.client);bitop=(e,t,s,...n)=>new b([e,t,s,...n],this.opts).exec(this.client);bitpos=(...e)=>new f(e,this.opts).exec(this.client);copy=(...e)=>new E(e,this.opts).exec(this.client);dbsize=()=>new S(this.opts).exec(this.client);decr=(...e)=>new A(e,this.opts).exec(this.client);decrby=(...e)=>new T(e,this.opts).exec(this.client);del=(...e)=>new R(e,this.opts).exec(this.client);echo=(...e)=>new N(e,this.opts).exec(this.client);evalRo=(...e)=>new v(e,this.opts).exec(this.client);eval=(...e)=>new z(e,this.opts).exec(this.client);evalshaRo=(...e)=>new k(e,this.opts).exec(this.client);evalsha=(...e)=>new U(e,this.opts).exec(this.client);exec=e=>new P(e,this.opts).exec(this.client);exists=(...e)=>new C(e,this.opts).exec(this.client);expire=(...e)=>new L(e,this.opts).exec(this.client);expireat=(...e)=>new I(e,this.opts).exec(this.client);flushall=e=>new M(e,this.opts).exec(this.client);flushdb=(...e)=>new D(e,this.opts).exec(this.client);geoadd=(...e)=>new J(e,this.opts).exec(this.client);geopos=(...e)=>new $(e,this.opts).exec(this.client);geodist=(...e)=>new F(e,this.opts).exec(this.client);geohash=(...e)=>new Y(e,this.opts).exec(this.client);geosearch=(...e)=>new _(e,this.opts).exec(this.client);geosearchstore=(...e)=>new j(e,this.opts).exec(this.client);get=(...e)=>new W(e,this.opts).exec(this.client);getbit=(...e)=>new X(e,this.opts).exec(this.client);getdel=(...e)=>new G(e,this.opts).exec(this.client);getex=(...e)=>new H(e,this.opts).exec(this.client);getrange=(...e)=>new B(e,this.opts).exec(this.client);getset=(e,t)=>new K([e,t],this.opts).exec(this.client);hdel=(...e)=>new q(e,this.opts).exec(this.client);hexists=(...e)=>new V(e,this.opts).exec(this.client);hexpire=(...e)=>new Q(e,this.opts).exec(this.client);hexpireat=(...e)=>new Z(e,this.opts).exec(this.client);hexpiretime=(...e)=>new ee(e,this.opts).exec(this.client);httl=(...e)=>new eg(e,this.opts).exec(this.client);hpexpire=(...e)=>new es(e,this.opts).exec(this.client);hpexpireat=(...e)=>new en(e,this.opts).exec(this.client);hpexpiretime=(...e)=>new ei(e,this.opts).exec(this.client);hpttl=(...e)=>new er(e,this.opts).exec(this.client);hpersist=(...e)=>new et(e,this.opts).exec(this.client);hget=(...e)=>new ec(e,this.opts).exec(this.client);hgetall=(...e)=>new eo(e,this.opts).exec(this.client);hincrby=(...e)=>new eh(e,this.opts).exec(this.client);hincrbyfloat=(...e)=>new ea(e,this.opts).exec(this.client);hkeys=(...e)=>new ep(e,this.opts).exec(this.client);hlen=(...e)=>new el(e,this.opts).exec(this.client);hmget=(...e)=>new eu(e,this.opts).exec(this.client);hmset=(e,t)=>new em([e,t],this.opts).exec(this.client);hrandfield=(e,t,s)=>new w([e,t,s],this.opts).exec(this.client);hscan=(...e)=>new ed(e,this.opts).exec(this.client);hset=(e,t)=>new ex([e,t],this.opts).exec(this.client);hsetnx=(e,t,s)=>new ew([e,t,s],this.opts).exec(this.client);hstrlen=(...e)=>new ey(e,this.opts).exec(this.client);hvals=(...e)=>new eO(e,this.opts).exec(this.client);incr=(...e)=>new eb(e,this.opts).exec(this.client);incrby=(...e)=>new ef(e,this.opts).exec(this.client);incrbyfloat=(...e)=>new eE(e,this.opts).exec(this.client);keys=(...e)=>new eG(e,this.opts).exec(this.client);lindex=(...e)=>new eH(e,this.opts).exec(this.client);linsert=(e,t,s,n)=>new eB([e,t,s,n],this.opts).exec(this.client);llen=(...e)=>new eK(e,this.opts).exec(this.client);lmove=(...e)=>new eq(e,this.opts).exec(this.client);lpop=(...e)=>new eQ(e,this.opts).exec(this.client);lmpop=(...e)=>new eV(e,this.opts).exec(this.client);lpos=(...e)=>new eZ(e,this.opts).exec(this.client);lpush=(e,...t)=>new e1([e,...t],this.opts).exec(this.client);lpushx=(e,...t)=>new e0([e,...t],this.opts).exec(this.client);lrange=(...e)=>new e2(e,this.opts).exec(this.client);lrem=(e,t,s)=>new e5([e,t,s],this.opts).exec(this.client);lset=(e,t,s)=>new e8([e,t,s],this.opts).exec(this.client);ltrim=(...e)=>new e6(e,this.opts).exec(this.client);mget=(...e)=>new e3(e,this.opts).exec(this.client);mset=e=>new e4([e],this.opts).exec(this.client);msetnx=e=>new e9([e],this.opts).exec(this.client);persist=(...e)=>new e7(e,this.opts).exec(this.client);pexpire=(...e)=>new te(e,this.opts).exec(this.client);pexpireat=(...e)=>new tt(e,this.opts).exec(this.client);pfadd=(...e)=>new ts(e,this.opts).exec(this.client);pfcount=(...e)=>new tn(e,this.opts).exec(this.client);pfmerge=(...e)=>new ti(e,this.opts).exec(this.client);ping=e=>new tr(e,this.opts).exec(this.client);psetex=(e,t,s)=>new tc([e,t,s],this.opts).exec(this.client);psubscribe=e=>{let t=Array.isArray(e)?e:[e];return new sf(this.client,t,!0,this.opts)};pttl=(...e)=>new to(e,this.opts).exec(this.client);publish=(...e)=>new th(e,this.opts).exec(this.client);randomkey=()=>new ta().exec(this.client);rename=(...e)=>new tp(e,this.opts).exec(this.client);renamenx=(...e)=>new tl(e,this.opts).exec(this.client);rpop=(...e)=>new tu(e,this.opts).exec(this.client);rpush=(e,...t)=>new tm([e,...t],this.opts).exec(this.client);rpushx=(e,...t)=>new td([e,...t],this.opts).exec(this.client);sadd=(e,t,...s)=>new tx([e,t,...s],this.opts).exec(this.client);scan(e,t){return new tw([e,t],this.opts).exec(this.client)}scard=(...e)=>new ty(e,this.opts).exec(this.client);scriptExists=(...e)=>new tg(e,this.opts).exec(this.client);scriptFlush=(...e)=>new tO(e,this.opts).exec(this.client);scriptLoad=(...e)=>new tb(e,this.opts).exec(this.client);sdiff=(...e)=>new tf(e,this.opts).exec(this.client);sdiffstore=(...e)=>new tE(e,this.opts).exec(this.client);set=(e,t,s)=>new tS([e,t,s],this.opts).exec(this.client);setbit=(...e)=>new tA(e,this.opts).exec(this.client);setex=(e,t,s)=>new tT([e,t,s],this.opts).exec(this.client);setnx=(e,t)=>new tR([e,t],this.opts).exec(this.client);setrange=(...e)=>new tN(e,this.opts).exec(this.client);sinter=(...e)=>new tv(e,this.opts).exec(this.client);sinterstore=(...e)=>new tz(e,this.opts).exec(this.client);sismember=(e,t)=>new tk([e,t],this.opts).exec(this.client);smismember=(e,t)=>new tP([e,t],this.opts).exec(this.client);smembers=(...e)=>new tU(e,this.opts).exec(this.client);smove=(e,t,s)=>new tC([e,t,s],this.opts).exec(this.client);spop=(...e)=>new tL(e,this.opts).exec(this.client);srandmember=(...e)=>new tI(e,this.opts).exec(this.client);srem=(e,...t)=>new tM([e,...t],this.opts).exec(this.client);sscan=(...e)=>new tD(e,this.opts).exec(this.client);strlen=(...e)=>new tJ(e,this.opts).exec(this.client);subscribe=e=>{let t=Array.isArray(e)?e:[e];return new sf(this.client,t,!1,this.opts)};sunion=(...e)=>new tF(e,this.opts).exec(this.client);sunionstore=(...e)=>new tY(e,this.opts).exec(this.client);time=()=>new t$().exec(this.client);touch=(...e)=>new t_(e,this.opts).exec(this.client);ttl=(...e)=>new tj(e,this.opts).exec(this.client);type=(...e)=>new tW(e,this.opts).exec(this.client);unlink=(...e)=>new tX(e,this.opts).exec(this.client);xadd=(...e)=>new tH(e,this.opts).exec(this.client);xack=(...e)=>new tG(e,this.opts).exec(this.client);xdel=(...e)=>new tq(e,this.opts).exec(this.client);xgroup=(...e)=>new tV(e,this.opts).exec(this.client);xread=(...e)=>new t2(e,this.opts).exec(this.client);xreadgroup=(...e)=>new t5(e,this.opts).exec(this.client);xinfo=(...e)=>new tQ(e,this.opts).exec(this.client);xlen=(...e)=>new tZ(e,this.opts).exec(this.client);xpending=(...e)=>new t1(e,this.opts).exec(this.client);xclaim=(...e)=>new tK(e,this.opts).exec(this.client);xautoclaim=(...e)=>new tB(e,this.opts).exec(this.client);xtrim=(...e)=>new t6(e,this.opts).exec(this.client);xrange=(...e)=>new t0(e,this.opts).exec(this.client);xrevrange=(...e)=>new t8(e,this.opts).exec(this.client);zadd=(...e)=>("score"in e[1],new t3([e[0],e[1],...e.slice(2)],this.opts).exec(this.client));zcard=(...e)=>new t4(e,this.opts).exec(this.client);zcount=(...e)=>new t9(e,this.opts).exec(this.client);zdiffstore=(...e)=>new sx(e,this.opts).exec(this.client);zincrby=(e,t,s)=>new t7([e,t,s],this.opts).exec(this.client);zinterstore=(...e)=>new se(e,this.opts).exec(this.client);zlexcount=(...e)=>new st(e,this.opts).exec(this.client);zmscore=(...e)=>new sw(e,this.opts).exec(this.client);zpopmax=(...e)=>new ss(e,this.opts).exec(this.client);zpopmin=(...e)=>new sn(e,this.opts).exec(this.client);zrange=(...e)=>new si(e,this.opts).exec(this.client);zrank=(e,t)=>new sr([e,t],this.opts).exec(this.client);zrem=(e,...t)=>new sc([e,...t],this.opts).exec(this.client);zremrangebylex=(...e)=>new so(e,this.opts).exec(this.client);zremrangebyrank=(...e)=>new sh(e,this.opts).exec(this.client);zremrangebyscore=(...e)=>new sa(e,this.opts).exec(this.client);zrevrank=(e,t)=>new sp([e,t],this.opts).exec(this.client);zscan=(...e)=>new sl(e,this.opts).exec(this.client);zscore=(e,t)=>new su([e,t],this.opts).exec(this.client);zunion=(...e)=>new sm(e,this.opts).exec(this.client);zunionstore=(...e)=>new sd(e,this.opts).exec(this.client)};"undefined"==typeof atob&&(e.g.atob=e=>Buffer.from(e,"base64").toString("utf8"));let sN=(class e extends sR{constructor(e){if("request"in e)return void super(e);if(e.url?(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("[Upstash Redis] The redis url contains whitespace or newline, which can cause errors!"):console.warn("[Upstash Redis] The 'url' property is missing or undefined in your Redis config."),e.token?(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("[Upstash Redis] The redis token contains whitespace or newline, which can cause errors!"):console.warn("[Upstash Redis] The 'token' property is missing or undefined in your Redis config."),super(new p({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache??"no-store",signal:e.signal,keepAlive:e.keepAlive,readYourWrites:e.readYourWrites}),{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY,latencyLogging:e.latencyLogging,enableAutoPipelining:e.enableAutoPipelining}),this.addTelemetry({runtime:"string"==typeof EdgeRuntime?"edge-light":`node@${process.version}`,platform:process.env.UPSTASH_CONSOLE?"console":process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:"@upstash/redis@v1.35.6"}),this.enableAutoPipelining)return this.autoPipeline()}static fromEnv(t){if(void 0===process.env)throw TypeError('[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let s=process.env.UPSTASH_REDIS_REST_URL||process.env.KV_REST_API_URL;s||console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let n=process.env.UPSTASH_REDIS_REST_TOKEN||process.env.KV_REST_API_TOKEN;return n||console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`"),new e({...t,url:s,token:n})}}).fromEnv()}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=supercorp_superinterface_packages_server_src_lib_redis_index_ts_48651b89._.js.map
|