@upstash/redis 0.0.0-ci.ed40a9ac-20230414 → 0.0.0-ci.ee21c87148cceb1a3548ec2eaef164f04178a10f
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/README.md +11 -4
- package/cloudflare.d.mts +45 -0
- package/cloudflare.d.ts +45 -0
- package/cloudflare.js +1 -0
- package/cloudflare.mjs +1 -0
- package/fastly.d.mts +43 -0
- package/fastly.d.ts +43 -0
- package/fastly.js +1 -0
- package/fastly.mjs +1 -0
- package/nodejs.d.mts +80 -0
- package/nodejs.d.ts +80 -0
- package/nodejs.js +1 -0
- package/nodejs.mjs +1 -0
- package/package.json +29 -63
- package/zmscore-10fd3773.d.ts +3126 -0
- package/.releaserc +0 -14
- package/esm/deps/deno.land/x/base64@v0.2.1/base.js +0 -100
- package/esm/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -9
- package/esm/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -1
- package/esm/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -191
- package/esm/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -50
- package/esm/package.json +0 -3
- package/esm/pkg/commands/append.js +0 -9
- package/esm/pkg/commands/bitcount.js +0 -16
- package/esm/pkg/commands/bitop.js +0 -9
- package/esm/pkg/commands/bitpos.js +0 -9
- package/esm/pkg/commands/command.js +0 -66
- package/esm/pkg/commands/dbsize.js +0 -9
- package/esm/pkg/commands/decr.js +0 -9
- package/esm/pkg/commands/decrby.js +0 -9
- package/esm/pkg/commands/del.js +0 -9
- package/esm/pkg/commands/echo.js +0 -9
- package/esm/pkg/commands/eval.js +0 -9
- package/esm/pkg/commands/evalsha.js +0 -9
- package/esm/pkg/commands/exists.js +0 -9
- package/esm/pkg/commands/expire.js +0 -9
- package/esm/pkg/commands/expireat.js +0 -9
- package/esm/pkg/commands/flushall.js +0 -13
- package/esm/pkg/commands/flushdb.js +0 -13
- package/esm/pkg/commands/get.js +0 -9
- package/esm/pkg/commands/getbit.js +0 -9
- package/esm/pkg/commands/getdel.js +0 -9
- package/esm/pkg/commands/getrange.js +0 -9
- package/esm/pkg/commands/getset.js +0 -9
- package/esm/pkg/commands/hdel.js +0 -9
- package/esm/pkg/commands/hexists.js +0 -9
- package/esm/pkg/commands/hget.js +0 -9
- package/esm/pkg/commands/hgetall.js +0 -29
- package/esm/pkg/commands/hincrby.js +0 -9
- package/esm/pkg/commands/hincrbyfloat.js +0 -9
- package/esm/pkg/commands/hkeys.js +0 -9
- package/esm/pkg/commands/hlen.js +0 -9
- package/esm/pkg/commands/hmget.js +0 -35
- package/esm/pkg/commands/hmset.js +0 -13
- package/esm/pkg/commands/hrandfield.js +0 -39
- package/esm/pkg/commands/hscan.js +0 -16
- package/esm/pkg/commands/hset.js +0 -13
- package/esm/pkg/commands/hsetnx.js +0 -9
- package/esm/pkg/commands/hstrlen.js +0 -9
- package/esm/pkg/commands/hvals.js +0 -9
- package/esm/pkg/commands/incr.js +0 -9
- package/esm/pkg/commands/incrby.js +0 -9
- package/esm/pkg/commands/incrbyfloat.js +0 -9
- package/esm/pkg/commands/json_arrappend.js +0 -9
- package/esm/pkg/commands/json_arrindex.js +0 -9
- package/esm/pkg/commands/json_arrinsert.js +0 -9
- package/esm/pkg/commands/json_arrlen.js +0 -9
- package/esm/pkg/commands/json_arrpop.js +0 -9
- package/esm/pkg/commands/json_arrtrim.js +0 -12
- package/esm/pkg/commands/json_clear.js +0 -9
- package/esm/pkg/commands/json_del.js +0 -9
- package/esm/pkg/commands/json_forget.js +0 -9
- package/esm/pkg/commands/json_get.js +0 -30
- package/esm/pkg/commands/json_mget.js +0 -9
- package/esm/pkg/commands/json_numincrby.js +0 -9
- package/esm/pkg/commands/json_nummultby.js +0 -9
- package/esm/pkg/commands/json_objkeys.js +0 -9
- package/esm/pkg/commands/json_objlen.js +0 -9
- package/esm/pkg/commands/json_resp.js +0 -9
- package/esm/pkg/commands/json_set.js +0 -18
- package/esm/pkg/commands/json_strappend.js +0 -9
- package/esm/pkg/commands/json_strlen.js +0 -9
- package/esm/pkg/commands/json_toggle.js +0 -9
- package/esm/pkg/commands/json_type.js +0 -9
- package/esm/pkg/commands/keys.js +0 -9
- package/esm/pkg/commands/lindex.js +0 -6
- package/esm/pkg/commands/linsert.js +0 -6
- package/esm/pkg/commands/llen.js +0 -9
- package/esm/pkg/commands/lmove.js +0 -9
- package/esm/pkg/commands/lpop.js +0 -9
- package/esm/pkg/commands/lpos.js +0 -19
- package/esm/pkg/commands/lpush.js +0 -9
- package/esm/pkg/commands/lpushx.js +0 -9
- package/esm/pkg/commands/lrange.js +0 -6
- package/esm/pkg/commands/lrem.js +0 -6
- package/esm/pkg/commands/lset.js +0 -6
- package/esm/pkg/commands/ltrim.js +0 -6
- package/esm/pkg/commands/mget.js +0 -9
- package/esm/pkg/commands/mod.js +0 -140
- package/esm/pkg/commands/mset.js +0 -12
- package/esm/pkg/commands/msetnx.js +0 -9
- package/esm/pkg/commands/persist.js +0 -9
- package/esm/pkg/commands/pexpire.js +0 -9
- package/esm/pkg/commands/pexpireat.js +0 -9
- package/esm/pkg/commands/ping.js +0 -13
- package/esm/pkg/commands/psetex.js +0 -9
- package/esm/pkg/commands/pttl.js +0 -9
- package/esm/pkg/commands/publish.js +0 -9
- package/esm/pkg/commands/randomkey.js +0 -9
- package/esm/pkg/commands/rename.js +0 -9
- package/esm/pkg/commands/renamenx.js +0 -9
- package/esm/pkg/commands/rpop.js +0 -9
- package/esm/pkg/commands/rpush.js +0 -9
- package/esm/pkg/commands/rpushx.js +0 -9
- package/esm/pkg/commands/sadd.js +0 -9
- package/esm/pkg/commands/scan.js +0 -19
- package/esm/pkg/commands/scard.js +0 -9
- package/esm/pkg/commands/script_exists.js +0 -12
- package/esm/pkg/commands/script_flush.js +0 -16
- package/esm/pkg/commands/script_load.js +0 -9
- package/esm/pkg/commands/sdiff.js +0 -9
- package/esm/pkg/commands/sdiffstore.js +0 -9
- package/esm/pkg/commands/set.js +0 -36
- package/esm/pkg/commands/setbit.js +0 -9
- package/esm/pkg/commands/setex.js +0 -9
- package/esm/pkg/commands/setnx.js +0 -9
- package/esm/pkg/commands/setrange.js +0 -9
- package/esm/pkg/commands/sinter.js +0 -9
- package/esm/pkg/commands/sinterstore.js +0 -9
- package/esm/pkg/commands/sismember.js +0 -9
- package/esm/pkg/commands/smembers.js +0 -9
- package/esm/pkg/commands/smismember.js +0 -9
- package/esm/pkg/commands/smove.js +0 -9
- package/esm/pkg/commands/spop.js +0 -13
- package/esm/pkg/commands/srandmember.js +0 -13
- package/esm/pkg/commands/srem.js +0 -9
- package/esm/pkg/commands/sscan.js +0 -16
- package/esm/pkg/commands/strlen.js +0 -9
- package/esm/pkg/commands/sunion.js +0 -9
- package/esm/pkg/commands/sunionstore.js +0 -9
- package/esm/pkg/commands/time.js +0 -9
- package/esm/pkg/commands/touch.js +0 -9
- package/esm/pkg/commands/ttl.js +0 -9
- package/esm/pkg/commands/type.js +0 -9
- package/esm/pkg/commands/unlink.js +0 -9
- package/esm/pkg/commands/zadd.js +0 -26
- package/esm/pkg/commands/zcard.js +0 -9
- package/esm/pkg/commands/zcount.js +0 -9
- package/esm/pkg/commands/zdiffstore.js +0 -9
- package/esm/pkg/commands/zincrby.js +0 -9
- package/esm/pkg/commands/zinterstore.js +0 -27
- package/esm/pkg/commands/zlexcount.js +0 -9
- package/esm/pkg/commands/zmscore.js +0 -10
- package/esm/pkg/commands/zpopmax.js +0 -13
- package/esm/pkg/commands/zpopmin.js +0 -13
- package/esm/pkg/commands/zrange.js +0 -26
- package/esm/pkg/commands/zrank.js +0 -9
- package/esm/pkg/commands/zrem.js +0 -9
- package/esm/pkg/commands/zremrangebylex.js +0 -9
- package/esm/pkg/commands/zremrangebyrank.js +0 -9
- package/esm/pkg/commands/zremrangebyscore.js +0 -9
- package/esm/pkg/commands/zrevrank.js +0 -9
- package/esm/pkg/commands/zscan.js +0 -16
- package/esm/pkg/commands/zscore.js +0 -9
- package/esm/pkg/commands/zunionstore.js +0 -27
- package/esm/pkg/error.js +0 -9
- package/esm/pkg/http.js +0 -167
- package/esm/pkg/pipeline.js +0 -1291
- package/esm/pkg/redis.js +0 -1288
- package/esm/pkg/script.js +0 -77
- package/esm/pkg/types.js +0 -1
- package/esm/pkg/util.js +0 -31
- package/esm/platforms/cloudflare.js +0 -70
- package/esm/platforms/fastly.js +0 -46
- package/esm/platforms/node_with_fetch.js +0 -85
- package/esm/platforms/nodejs.js +0 -80
- package/esm/version.js +0 -1
- package/script/deps/deno.land/x/base64@v0.2.1/base.js +0 -104
- package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -13
- package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -6
- package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -196
- package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -55
- package/script/package.json +0 -3
- package/script/pkg/commands/append.js +0 -13
- package/script/pkg/commands/bitcount.js +0 -20
- package/script/pkg/commands/bitop.js +0 -13
- package/script/pkg/commands/bitpos.js +0 -13
- package/script/pkg/commands/command.js +0 -70
- package/script/pkg/commands/dbsize.js +0 -13
- package/script/pkg/commands/decr.js +0 -13
- package/script/pkg/commands/decrby.js +0 -13
- package/script/pkg/commands/del.js +0 -13
- package/script/pkg/commands/echo.js +0 -13
- package/script/pkg/commands/eval.js +0 -13
- package/script/pkg/commands/evalsha.js +0 -13
- package/script/pkg/commands/exists.js +0 -13
- package/script/pkg/commands/expire.js +0 -13
- package/script/pkg/commands/expireat.js +0 -13
- package/script/pkg/commands/flushall.js +0 -17
- package/script/pkg/commands/flushdb.js +0 -17
- package/script/pkg/commands/get.js +0 -13
- package/script/pkg/commands/getbit.js +0 -13
- package/script/pkg/commands/getdel.js +0 -13
- package/script/pkg/commands/getrange.js +0 -13
- package/script/pkg/commands/getset.js +0 -13
- package/script/pkg/commands/hdel.js +0 -13
- package/script/pkg/commands/hexists.js +0 -13
- package/script/pkg/commands/hget.js +0 -13
- package/script/pkg/commands/hgetall.js +0 -33
- package/script/pkg/commands/hincrby.js +0 -13
- package/script/pkg/commands/hincrbyfloat.js +0 -13
- package/script/pkg/commands/hkeys.js +0 -13
- package/script/pkg/commands/hlen.js +0 -13
- package/script/pkg/commands/hmget.js +0 -39
- package/script/pkg/commands/hmset.js +0 -17
- package/script/pkg/commands/hrandfield.js +0 -43
- package/script/pkg/commands/hscan.js +0 -20
- package/script/pkg/commands/hset.js +0 -17
- package/script/pkg/commands/hsetnx.js +0 -13
- package/script/pkg/commands/hstrlen.js +0 -13
- package/script/pkg/commands/hvals.js +0 -13
- package/script/pkg/commands/incr.js +0 -13
- package/script/pkg/commands/incrby.js +0 -13
- package/script/pkg/commands/incrbyfloat.js +0 -13
- package/script/pkg/commands/json_arrappend.js +0 -13
- package/script/pkg/commands/json_arrindex.js +0 -13
- package/script/pkg/commands/json_arrinsert.js +0 -13
- package/script/pkg/commands/json_arrlen.js +0 -13
- package/script/pkg/commands/json_arrpop.js +0 -13
- package/script/pkg/commands/json_arrtrim.js +0 -16
- package/script/pkg/commands/json_clear.js +0 -13
- package/script/pkg/commands/json_del.js +0 -13
- package/script/pkg/commands/json_forget.js +0 -13
- package/script/pkg/commands/json_get.js +0 -34
- package/script/pkg/commands/json_mget.js +0 -13
- package/script/pkg/commands/json_numincrby.js +0 -13
- package/script/pkg/commands/json_nummultby.js +0 -13
- package/script/pkg/commands/json_objkeys.js +0 -13
- package/script/pkg/commands/json_objlen.js +0 -13
- package/script/pkg/commands/json_resp.js +0 -13
- package/script/pkg/commands/json_set.js +0 -22
- package/script/pkg/commands/json_strappend.js +0 -13
- package/script/pkg/commands/json_strlen.js +0 -13
- package/script/pkg/commands/json_toggle.js +0 -13
- package/script/pkg/commands/json_type.js +0 -13
- package/script/pkg/commands/keys.js +0 -13
- package/script/pkg/commands/lindex.js +0 -10
- package/script/pkg/commands/linsert.js +0 -10
- package/script/pkg/commands/llen.js +0 -13
- package/script/pkg/commands/lmove.js +0 -13
- package/script/pkg/commands/lpop.js +0 -13
- package/script/pkg/commands/lpos.js +0 -23
- package/script/pkg/commands/lpush.js +0 -13
- package/script/pkg/commands/lpushx.js +0 -13
- package/script/pkg/commands/lrange.js +0 -10
- package/script/pkg/commands/lrem.js +0 -10
- package/script/pkg/commands/lset.js +0 -10
- package/script/pkg/commands/ltrim.js +0 -10
- package/script/pkg/commands/mget.js +0 -13
- package/script/pkg/commands/mod.js +0 -156
- package/script/pkg/commands/mset.js +0 -16
- package/script/pkg/commands/msetnx.js +0 -13
- package/script/pkg/commands/persist.js +0 -13
- package/script/pkg/commands/pexpire.js +0 -13
- package/script/pkg/commands/pexpireat.js +0 -13
- package/script/pkg/commands/ping.js +0 -17
- package/script/pkg/commands/psetex.js +0 -13
- package/script/pkg/commands/pttl.js +0 -13
- package/script/pkg/commands/publish.js +0 -13
- package/script/pkg/commands/randomkey.js +0 -13
- package/script/pkg/commands/rename.js +0 -13
- package/script/pkg/commands/renamenx.js +0 -13
- package/script/pkg/commands/rpop.js +0 -13
- package/script/pkg/commands/rpush.js +0 -13
- package/script/pkg/commands/rpushx.js +0 -13
- package/script/pkg/commands/sadd.js +0 -13
- package/script/pkg/commands/scan.js +0 -23
- package/script/pkg/commands/scard.js +0 -13
- package/script/pkg/commands/script_exists.js +0 -16
- package/script/pkg/commands/script_flush.js +0 -20
- package/script/pkg/commands/script_load.js +0 -13
- package/script/pkg/commands/sdiff.js +0 -13
- package/script/pkg/commands/sdiffstore.js +0 -13
- package/script/pkg/commands/set.js +0 -40
- package/script/pkg/commands/setbit.js +0 -13
- package/script/pkg/commands/setex.js +0 -13
- package/script/pkg/commands/setnx.js +0 -13
- package/script/pkg/commands/setrange.js +0 -13
- package/script/pkg/commands/sinter.js +0 -13
- package/script/pkg/commands/sinterstore.js +0 -13
- package/script/pkg/commands/sismember.js +0 -13
- package/script/pkg/commands/smembers.js +0 -13
- package/script/pkg/commands/smismember.js +0 -13
- package/script/pkg/commands/smove.js +0 -13
- package/script/pkg/commands/spop.js +0 -17
- package/script/pkg/commands/srandmember.js +0 -17
- package/script/pkg/commands/srem.js +0 -13
- package/script/pkg/commands/sscan.js +0 -20
- package/script/pkg/commands/strlen.js +0 -13
- package/script/pkg/commands/sunion.js +0 -13
- package/script/pkg/commands/sunionstore.js +0 -13
- package/script/pkg/commands/time.js +0 -13
- package/script/pkg/commands/touch.js +0 -13
- package/script/pkg/commands/ttl.js +0 -13
- package/script/pkg/commands/type.js +0 -13
- package/script/pkg/commands/unlink.js +0 -13
- package/script/pkg/commands/zadd.js +0 -30
- package/script/pkg/commands/zcard.js +0 -13
- package/script/pkg/commands/zcount.js +0 -13
- package/script/pkg/commands/zdiffstore.js +0 -13
- package/script/pkg/commands/zincrby.js +0 -13
- package/script/pkg/commands/zinterstore.js +0 -31
- package/script/pkg/commands/zlexcount.js +0 -13
- package/script/pkg/commands/zmscore.js +0 -14
- package/script/pkg/commands/zpopmax.js +0 -17
- package/script/pkg/commands/zpopmin.js +0 -17
- package/script/pkg/commands/zrange.js +0 -30
- package/script/pkg/commands/zrank.js +0 -13
- package/script/pkg/commands/zrem.js +0 -13
- package/script/pkg/commands/zremrangebylex.js +0 -13
- package/script/pkg/commands/zremrangebyrank.js +0 -13
- package/script/pkg/commands/zremrangebyscore.js +0 -13
- package/script/pkg/commands/zrevrank.js +0 -13
- package/script/pkg/commands/zscan.js +0 -20
- package/script/pkg/commands/zscore.js +0 -13
- package/script/pkg/commands/zunionstore.js +0 -31
- package/script/pkg/error.js +0 -13
- package/script/pkg/http.js +0 -171
- package/script/pkg/pipeline.js +0 -1295
- package/script/pkg/redis.js +0 -1292
- package/script/pkg/script.js +0 -81
- package/script/pkg/types.js +0 -2
- package/script/pkg/util.js +0 -35
- package/script/platforms/cloudflare.js +0 -97
- package/script/platforms/fastly.js +0 -73
- package/script/platforms/node_with_fetch.js +0 -112
- package/script/platforms/nodejs.js +0 -107
- package/script/version.js +0 -4
- package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +0 -5
- package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +0 -1
- package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +0 -1
- package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +0 -26
- package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +0 -3
- package/types/pkg/commands/append.d.ts +0 -7
- package/types/pkg/commands/bitcount.d.ts +0 -8
- package/types/pkg/commands/bitop.d.ts +0 -12
- package/types/pkg/commands/bitpos.d.ts +0 -7
- package/types/pkg/commands/command.d.ts +0 -37
- package/types/pkg/commands/dbsize.d.ts +0 -7
- package/types/pkg/commands/decr.d.ts +0 -7
- package/types/pkg/commands/decrby.d.ts +0 -7
- package/types/pkg/commands/del.d.ts +0 -7
- package/types/pkg/commands/echo.d.ts +0 -7
- package/types/pkg/commands/eval.d.ts +0 -7
- package/types/pkg/commands/evalsha.d.ts +0 -7
- package/types/pkg/commands/exists.d.ts +0 -7
- package/types/pkg/commands/expire.d.ts +0 -7
- package/types/pkg/commands/expireat.d.ts +0 -7
- package/types/pkg/commands/flushall.d.ts +0 -9
- package/types/pkg/commands/flushdb.d.ts +0 -9
- package/types/pkg/commands/get.d.ts +0 -7
- package/types/pkg/commands/getbit.d.ts +0 -7
- package/types/pkg/commands/getdel.d.ts +0 -7
- package/types/pkg/commands/getrange.d.ts +0 -7
- package/types/pkg/commands/getset.d.ts +0 -7
- package/types/pkg/commands/hdel.d.ts +0 -7
- package/types/pkg/commands/hexists.d.ts +0 -7
- package/types/pkg/commands/hget.d.ts +0 -7
- package/types/pkg/commands/hgetall.d.ts +0 -7
- package/types/pkg/commands/hincrby.d.ts +0 -7
- package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
- package/types/pkg/commands/hkeys.d.ts +0 -7
- package/types/pkg/commands/hlen.d.ts +0 -7
- package/types/pkg/commands/hmget.d.ts +0 -15
- package/types/pkg/commands/hmset.d.ts +0 -9
- package/types/pkg/commands/hrandfield.d.ts +0 -9
- package/types/pkg/commands/hscan.d.ts +0 -24
- package/types/pkg/commands/hset.d.ts +0 -9
- package/types/pkg/commands/hsetnx.d.ts +0 -7
- package/types/pkg/commands/hstrlen.d.ts +0 -7
- package/types/pkg/commands/hvals.d.ts +0 -7
- package/types/pkg/commands/incr.d.ts +0 -7
- package/types/pkg/commands/incrby.d.ts +0 -7
- package/types/pkg/commands/incrbyfloat.d.ts +0 -7
- package/types/pkg/commands/json_arrappend.d.ts +0 -7
- package/types/pkg/commands/json_arrindex.d.ts +0 -13
- package/types/pkg/commands/json_arrinsert.d.ts +0 -7
- package/types/pkg/commands/json_arrlen.d.ts +0 -7
- package/types/pkg/commands/json_arrpop.d.ts +0 -7
- package/types/pkg/commands/json_arrtrim.d.ts +0 -7
- package/types/pkg/commands/json_clear.d.ts +0 -7
- package/types/pkg/commands/json_del.d.ts +0 -7
- package/types/pkg/commands/json_forget.d.ts +0 -7
- package/types/pkg/commands/json_get.d.ts +0 -15
- package/types/pkg/commands/json_mget.d.ts +0 -7
- package/types/pkg/commands/json_numincrby.d.ts +0 -7
- package/types/pkg/commands/json_nummultby.d.ts +0 -7
- package/types/pkg/commands/json_objkeys.d.ts +0 -7
- package/types/pkg/commands/json_objlen.d.ts +0 -7
- package/types/pkg/commands/json_resp.d.ts +0 -7
- package/types/pkg/commands/json_set.d.ts +0 -18
- package/types/pkg/commands/json_strappend.d.ts +0 -7
- package/types/pkg/commands/json_strlen.d.ts +0 -7
- package/types/pkg/commands/json_toggle.d.ts +0 -7
- package/types/pkg/commands/json_type.d.ts +0 -7
- package/types/pkg/commands/keys.d.ts +0 -7
- package/types/pkg/commands/lindex.d.ts +0 -4
- package/types/pkg/commands/linsert.d.ts +0 -9
- package/types/pkg/commands/llen.d.ts +0 -7
- package/types/pkg/commands/lmove.d.ts +0 -12
- package/types/pkg/commands/lpop.d.ts +0 -7
- package/types/pkg/commands/lpos.d.ts +0 -15
- package/types/pkg/commands/lpush.d.ts +0 -7
- package/types/pkg/commands/lpushx.d.ts +0 -7
- package/types/pkg/commands/lrange.d.ts +0 -4
- package/types/pkg/commands/lrem.d.ts +0 -4
- package/types/pkg/commands/lset.d.ts +0 -4
- package/types/pkg/commands/ltrim.d.ts +0 -4
- package/types/pkg/commands/mget.d.ts +0 -7
- package/types/pkg/commands/mod.d.ts +0 -140
- package/types/pkg/commands/mset.d.ts +0 -9
- package/types/pkg/commands/msetnx.d.ts +0 -9
- package/types/pkg/commands/persist.d.ts +0 -7
- package/types/pkg/commands/pexpire.d.ts +0 -7
- package/types/pkg/commands/pexpireat.d.ts +0 -7
- package/types/pkg/commands/ping.d.ts +0 -7
- package/types/pkg/commands/psetex.d.ts +0 -7
- package/types/pkg/commands/pttl.d.ts +0 -7
- package/types/pkg/commands/publish.d.ts +0 -7
- package/types/pkg/commands/randomkey.d.ts +0 -7
- package/types/pkg/commands/rename.d.ts +0 -7
- package/types/pkg/commands/renamenx.d.ts +0 -7
- package/types/pkg/commands/rpop.d.ts +0 -7
- package/types/pkg/commands/rpush.d.ts +0 -7
- package/types/pkg/commands/rpushx.d.ts +0 -7
- package/types/pkg/commands/sadd.d.ts +0 -7
- package/types/pkg/commands/scan.d.ts +0 -18
- package/types/pkg/commands/scard.d.ts +0 -7
- package/types/pkg/commands/script_exists.d.ts +0 -7
- package/types/pkg/commands/script_flush.d.ts +0 -14
- package/types/pkg/commands/script_load.d.ts +0 -7
- package/types/pkg/commands/sdiff.d.ts +0 -7
- package/types/pkg/commands/sdiffstore.d.ts +0 -7
- package/types/pkg/commands/set.d.ts +0 -55
- package/types/pkg/commands/setbit.d.ts +0 -7
- package/types/pkg/commands/setex.d.ts +0 -7
- package/types/pkg/commands/setnx.d.ts +0 -7
- package/types/pkg/commands/setrange.d.ts +0 -7
- package/types/pkg/commands/sinter.d.ts +0 -7
- package/types/pkg/commands/sinterstore.d.ts +0 -7
- package/types/pkg/commands/sismember.d.ts +0 -7
- package/types/pkg/commands/smembers.d.ts +0 -7
- package/types/pkg/commands/smismember.d.ts +0 -7
- package/types/pkg/commands/smove.d.ts +0 -7
- package/types/pkg/commands/spop.d.ts +0 -7
- package/types/pkg/commands/srandmember.d.ts +0 -7
- package/types/pkg/commands/srem.d.ts +0 -7
- package/types/pkg/commands/sscan.d.ts +0 -24
- package/types/pkg/commands/strlen.d.ts +0 -7
- package/types/pkg/commands/sunion.d.ts +0 -7
- package/types/pkg/commands/sunionstore.d.ts +0 -7
- package/types/pkg/commands/time.d.ts +0 -7
- package/types/pkg/commands/touch.d.ts +0 -7
- package/types/pkg/commands/ttl.d.ts +0 -7
- package/types/pkg/commands/type.d.ts +0 -8
- package/types/pkg/commands/unlink.d.ts +0 -7
- package/types/pkg/commands/zadd.d.ts +0 -35
- package/types/pkg/commands/zcard.d.ts +0 -7
- package/types/pkg/commands/zcount.d.ts +0 -7
- package/types/pkg/commands/zdiffstore.d.ts +0 -7
- package/types/pkg/commands/zincrby.d.ts +0 -7
- package/types/pkg/commands/zinterstore.d.ts +0 -30
- package/types/pkg/commands/zlexcount.d.ts +0 -7
- package/types/pkg/commands/zmscore.d.ts +0 -7
- package/types/pkg/commands/zpopmax.d.ts +0 -7
- package/types/pkg/commands/zpopmin.d.ts +0 -7
- package/types/pkg/commands/zrange.d.ts +0 -42
- package/types/pkg/commands/zrank.d.ts +0 -7
- package/types/pkg/commands/zrem.d.ts +0 -7
- package/types/pkg/commands/zremrangebylex.d.ts +0 -7
- package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
- package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
- package/types/pkg/commands/zrevrank.d.ts +0 -7
- package/types/pkg/commands/zscan.d.ts +0 -24
- package/types/pkg/commands/zscore.d.ts +0 -7
- package/types/pkg/commands/zunionstore.d.ts +0 -30
- package/types/pkg/error.d.ts +0 -6
- package/types/pkg/http.d.ts +0 -91
- package/types/pkg/pipeline.d.ts +0 -603
- package/types/pkg/redis.d.ts +0 -658
- package/types/pkg/script.d.ts +0 -42
- package/types/pkg/types.d.ts +0 -27
- package/types/pkg/util.d.ts +0 -1
- package/types/platforms/cloudflare.d.ts +0 -43
- package/types/platforms/fastly.d.ts +0 -41
- package/types/platforms/node_with_fetch.d.ts +0 -63
- package/types/platforms/nodejs.d.ts +0 -78
- package/types/version.d.ts +0 -1
|
@@ -0,0 +1,3126 @@
|
|
|
1
|
+
type CommandArgs<TCommand extends new (..._args: any) => any> = ConstructorParameters<TCommand>[0];
|
|
2
|
+
type Telemetry = {
|
|
3
|
+
/**
|
|
4
|
+
* Upstash-Telemetry-Sdk
|
|
5
|
+
* @example @upstash/redis@v1.1.1
|
|
6
|
+
*/
|
|
7
|
+
sdk?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Upstash-Telemetry-Platform
|
|
10
|
+
* @example cloudflare
|
|
11
|
+
*/
|
|
12
|
+
platform?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Upstash-Telemetry-Runtime
|
|
15
|
+
* @example node@v18
|
|
16
|
+
*/
|
|
17
|
+
runtime?: string;
|
|
18
|
+
};
|
|
19
|
+
type RedisOptions = {
|
|
20
|
+
/**
|
|
21
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
automaticDeserialization?: boolean;
|
|
26
|
+
enableTelemetry?: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
30
|
+
type UpstashRequest = {
|
|
31
|
+
path?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Request body will be serialized to json
|
|
34
|
+
*/
|
|
35
|
+
body?: unknown;
|
|
36
|
+
};
|
|
37
|
+
type UpstashResponse<TResult> = {
|
|
38
|
+
result?: TResult;
|
|
39
|
+
error?: string;
|
|
40
|
+
};
|
|
41
|
+
interface Requester {
|
|
42
|
+
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
43
|
+
}
|
|
44
|
+
type RetryConfig = false | {
|
|
45
|
+
/**
|
|
46
|
+
* The number of retries to attempt before giving up.
|
|
47
|
+
*
|
|
48
|
+
* @default 5
|
|
49
|
+
*/
|
|
50
|
+
retries?: number;
|
|
51
|
+
/**
|
|
52
|
+
* A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
|
|
53
|
+
*
|
|
54
|
+
* @default
|
|
55
|
+
* ```ts
|
|
56
|
+
* Math.exp(retryCount) * 50
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
backoff?: (retryCount: number) => number;
|
|
60
|
+
};
|
|
61
|
+
type RequesterConfig = {
|
|
62
|
+
/**
|
|
63
|
+
* Configure the retry behaviour in case of network errors
|
|
64
|
+
*/
|
|
65
|
+
retry?: RetryConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
|
|
68
|
+
* valid json and will therefore cause errors when deserializing. This used to happen very
|
|
69
|
+
* frequently with non-utf8 data, such as emojis.
|
|
70
|
+
*
|
|
71
|
+
* By default we will therefore encode the data as base64 on the server, before sending it to the
|
|
72
|
+
* client. The client will then decode the base64 data and parse it as utf8.
|
|
73
|
+
*
|
|
74
|
+
* For very large entries, this can add a few milliseconds, so if you are sure that your data is
|
|
75
|
+
* valid utf8, you can disable this behaviour by setting this option to false.
|
|
76
|
+
*
|
|
77
|
+
* Here's what the response body looks like:
|
|
78
|
+
*
|
|
79
|
+
* ```json
|
|
80
|
+
* {
|
|
81
|
+
* result?: "base64-encoded",
|
|
82
|
+
* error?: string
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @default "base64"
|
|
87
|
+
*/
|
|
88
|
+
responseEncoding?: false | "base64";
|
|
89
|
+
/**
|
|
90
|
+
* Configure the cache behaviour
|
|
91
|
+
* @default "no-store"
|
|
92
|
+
*/
|
|
93
|
+
cache?: CacheSetting;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type Serialize = (data: unknown) => string | number | boolean;
|
|
97
|
+
type Deserialize<TResult, TData> = (result: TResult) => TData;
|
|
98
|
+
type CommandOptions<TResult, TData> = {
|
|
99
|
+
/**
|
|
100
|
+
* Custom deserializer
|
|
101
|
+
*/
|
|
102
|
+
deserialize?: (result: TResult) => TData;
|
|
103
|
+
/**
|
|
104
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
105
|
+
*
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
108
|
+
automaticDeserialization?: boolean;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Command offers default (de)serialization and the exec method to all commands.
|
|
112
|
+
*
|
|
113
|
+
* TData represents what the user will enter or receive,
|
|
114
|
+
* TResult is the raw data returned from upstash, which may need to be transformed or parsed.
|
|
115
|
+
*/
|
|
116
|
+
declare class Command<TResult, TData> {
|
|
117
|
+
readonly command: (string | number | boolean)[];
|
|
118
|
+
readonly serialize: Serialize;
|
|
119
|
+
readonly deserialize: Deserialize<TResult, TData>;
|
|
120
|
+
/**
|
|
121
|
+
* Create a new command instance.
|
|
122
|
+
*
|
|
123
|
+
* You can define a custom `deserialize` function. By default we try to deserialize as json.
|
|
124
|
+
*/
|
|
125
|
+
constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
|
|
126
|
+
/**
|
|
127
|
+
* Execute the command using a client.
|
|
128
|
+
*/
|
|
129
|
+
exec(client: Requester): Promise<TData>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type ZUnionStoreCommandOptions = {
|
|
133
|
+
aggregate?: "sum" | "min" | "max";
|
|
134
|
+
} & ({
|
|
135
|
+
weight: number;
|
|
136
|
+
weights?: never;
|
|
137
|
+
} | {
|
|
138
|
+
weight?: never;
|
|
139
|
+
weights: number[];
|
|
140
|
+
} | {
|
|
141
|
+
weight?: never;
|
|
142
|
+
weights?: never;
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* @see https://redis.io/commands/zunionstore
|
|
146
|
+
*/
|
|
147
|
+
declare class ZUnionStoreCommand extends Command<number, number> {
|
|
148
|
+
constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
149
|
+
constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type ZUnionCommandOptions = {
|
|
153
|
+
withScores?: boolean;
|
|
154
|
+
aggregate?: "sum" | "min" | "max";
|
|
155
|
+
} & ({
|
|
156
|
+
weight: number;
|
|
157
|
+
weights?: never;
|
|
158
|
+
} | {
|
|
159
|
+
weight?: never;
|
|
160
|
+
weights: number[];
|
|
161
|
+
} | {
|
|
162
|
+
weight?: never;
|
|
163
|
+
weights?: never;
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* @see https://redis.io/commands/zunion
|
|
167
|
+
*/
|
|
168
|
+
declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
|
|
169
|
+
constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
170
|
+
constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type ZInterStoreCommandOptions = {
|
|
174
|
+
aggregate?: "sum" | "min" | "max";
|
|
175
|
+
} & ({
|
|
176
|
+
weight: number;
|
|
177
|
+
weights?: never;
|
|
178
|
+
} | {
|
|
179
|
+
weight?: never;
|
|
180
|
+
weights: number[];
|
|
181
|
+
} | {
|
|
182
|
+
weight?: never;
|
|
183
|
+
weights?: never;
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* @see https://redis.io/commands/zInterstore
|
|
187
|
+
*/
|
|
188
|
+
declare class ZInterStoreCommand extends Command<number, number> {
|
|
189
|
+
constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
190
|
+
constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
|
|
194
|
+
/**
|
|
195
|
+
* @see https://redis.io/commands/type
|
|
196
|
+
*/
|
|
197
|
+
declare class TypeCommand extends Command<Type, Type> {
|
|
198
|
+
constructor(cmd: [key: string], opts?: CommandOptions<Type, Type>);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
type ScriptFlushCommandOptions = {
|
|
202
|
+
sync: true;
|
|
203
|
+
async?: never;
|
|
204
|
+
} | {
|
|
205
|
+
sync?: never;
|
|
206
|
+
async: true;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* @see https://redis.io/commands/script-flush
|
|
210
|
+
*/
|
|
211
|
+
declare class ScriptFlushCommand extends Command<"OK", "OK"> {
|
|
212
|
+
constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
type ScanCommandOptions = {
|
|
216
|
+
match?: string;
|
|
217
|
+
count?: number;
|
|
218
|
+
type?: string;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* @see https://redis.io/commands/scan
|
|
222
|
+
*/
|
|
223
|
+
declare class ScanCommand extends Command<[number, string[]], [number, string[]]> {
|
|
224
|
+
constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, string[]], [number, string[]]>);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
type GeoAddCommandOptions = {
|
|
228
|
+
nx?: boolean;
|
|
229
|
+
xx?: never;
|
|
230
|
+
} | ({
|
|
231
|
+
nx?: never;
|
|
232
|
+
xx?: boolean;
|
|
233
|
+
} & {
|
|
234
|
+
ch?: boolean;
|
|
235
|
+
});
|
|
236
|
+
interface GeoMember<TMemberType> {
|
|
237
|
+
latitude: number;
|
|
238
|
+
longitude: number;
|
|
239
|
+
member: TMemberType;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* @see https://redis.io/commands/geoadd
|
|
243
|
+
*/
|
|
244
|
+
declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
|
|
245
|
+
constructor([key, arg1, ...arg2]: [
|
|
246
|
+
string,
|
|
247
|
+
GeoMember<TMemberType> | GeoAddCommandOptions,
|
|
248
|
+
...GeoMember<TMemberType>[]
|
|
249
|
+
], opts?: CommandOptions<number | null, number | null>);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @see https://redis.io/commands/append
|
|
254
|
+
*/
|
|
255
|
+
declare class AppendCommand extends Command<number, number> {
|
|
256
|
+
constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @see https://redis.io/commands/bitcount
|
|
261
|
+
*/
|
|
262
|
+
declare class BitCountCommand extends Command<number, number> {
|
|
263
|
+
constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
|
|
264
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @see https://redis.io/commands/bitop
|
|
269
|
+
*/
|
|
270
|
+
declare class BitOpCommand extends Command<number, number> {
|
|
271
|
+
constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
|
|
272
|
+
constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @see https://redis.io/commands/bitpos
|
|
277
|
+
*/
|
|
278
|
+
declare class BitPosCommand extends Command<number, number> {
|
|
279
|
+
constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @see https://redis.io/commands/copy
|
|
284
|
+
*/
|
|
285
|
+
declare class CopyCommand extends Command<number, "COPIED" | "NOT_COPIED"> {
|
|
286
|
+
constructor([key, destinationKey, opts]: [key: string, destinationKey: string, opts?: {
|
|
287
|
+
replace: boolean;
|
|
288
|
+
}], commandOptions?: CommandOptions<number, "COPIED" | "NOT_COPIED">);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @see https://redis.io/commands/dbsize
|
|
293
|
+
*/
|
|
294
|
+
declare class DBSizeCommand extends Command<number, number> {
|
|
295
|
+
constructor(opts?: CommandOptions<number, number>);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @see https://redis.io/commands/decr
|
|
300
|
+
*/
|
|
301
|
+
declare class DecrCommand extends Command<number, number> {
|
|
302
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @see https://redis.io/commands/decrby
|
|
307
|
+
*/
|
|
308
|
+
declare class DecrByCommand extends Command<number, number> {
|
|
309
|
+
constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @see https://redis.io/commands/del
|
|
314
|
+
*/
|
|
315
|
+
declare class DelCommand extends Command<number, number> {
|
|
316
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @see https://redis.io/commands/echo
|
|
321
|
+
*/
|
|
322
|
+
declare class EchoCommand extends Command<string, string> {
|
|
323
|
+
constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @see https://redis.io/commands/eval
|
|
328
|
+
*/
|
|
329
|
+
declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
330
|
+
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @see https://redis.io/commands/evalsha
|
|
335
|
+
*/
|
|
336
|
+
declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
337
|
+
constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @see https://redis.io/commands/exists
|
|
342
|
+
*/
|
|
343
|
+
declare class ExistsCommand extends Command<number, number> {
|
|
344
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @see https://redis.io/commands/expire
|
|
349
|
+
*/
|
|
350
|
+
declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
351
|
+
constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @see https://redis.io/commands/expireat
|
|
356
|
+
*/
|
|
357
|
+
declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
358
|
+
constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* @see https://redis.io/commands/flushall
|
|
363
|
+
*/
|
|
364
|
+
declare class FlushAllCommand extends Command<"OK", "OK"> {
|
|
365
|
+
constructor(args?: [{
|
|
366
|
+
async?: boolean;
|
|
367
|
+
}], opts?: CommandOptions<"OK", "OK">);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @see https://redis.io/commands/flushdb
|
|
372
|
+
*/
|
|
373
|
+
declare class FlushDBCommand extends Command<"OK", "OK"> {
|
|
374
|
+
constructor([opts]: [opts?: {
|
|
375
|
+
async?: boolean;
|
|
376
|
+
}], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @see https://redis.io/commands/geodist
|
|
381
|
+
*/
|
|
382
|
+
declare class GeoDistCommand<TMemberType = string> extends Command<number | null, number | null> {
|
|
383
|
+
constructor([key, member1, member2, unit]: [
|
|
384
|
+
key: string,
|
|
385
|
+
member1: TMemberType,
|
|
386
|
+
member2: TMemberType,
|
|
387
|
+
unit?: "M" | "KM" | "FT" | "MI"
|
|
388
|
+
], opts?: CommandOptions<number | null, number | null>);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
type Coordinates = {
|
|
392
|
+
lng: number;
|
|
393
|
+
lat: number;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* @see https://redis.io/commands/geopos
|
|
397
|
+
*/
|
|
398
|
+
declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][], Coordinates[]> {
|
|
399
|
+
constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @see https://redis.io/commands/geohash
|
|
404
|
+
*/
|
|
405
|
+
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
406
|
+
constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
|
|
410
|
+
type CenterPoint$1<TMemberType> = {
|
|
411
|
+
type: "FROMMEMBER" | "frommember";
|
|
412
|
+
member: TMemberType;
|
|
413
|
+
} | {
|
|
414
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
415
|
+
coordinate: {
|
|
416
|
+
lon: number;
|
|
417
|
+
lat: number;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
type Shape$1 = {
|
|
421
|
+
type: "BYRADIUS" | "byradius";
|
|
422
|
+
radius: number;
|
|
423
|
+
radiusType: RadiusOptions$1;
|
|
424
|
+
} | {
|
|
425
|
+
type: "BYBOX" | "bybox";
|
|
426
|
+
rect: {
|
|
427
|
+
width: number;
|
|
428
|
+
height: number;
|
|
429
|
+
};
|
|
430
|
+
rectType: RadiusOptions$1;
|
|
431
|
+
};
|
|
432
|
+
type GeoSearchCommandOptions$1 = {
|
|
433
|
+
count?: {
|
|
434
|
+
limit: number;
|
|
435
|
+
any?: boolean;
|
|
436
|
+
};
|
|
437
|
+
withCoord?: boolean;
|
|
438
|
+
withDist?: boolean;
|
|
439
|
+
withHash?: boolean;
|
|
440
|
+
};
|
|
441
|
+
type OptionMappings = {
|
|
442
|
+
withHash: "hash";
|
|
443
|
+
withCoord: "coord";
|
|
444
|
+
withDist: "dist";
|
|
445
|
+
};
|
|
446
|
+
type GeoSearchOptions<TOptions> = {
|
|
447
|
+
[K in keyof TOptions as K extends keyof OptionMappings ? OptionMappings[K] : never]: K extends "withHash" ? string : K extends "withCoord" ? {
|
|
448
|
+
long: number;
|
|
449
|
+
lat: number;
|
|
450
|
+
} : K extends "withDist" ? number : never;
|
|
451
|
+
};
|
|
452
|
+
type GeoSearchResponse<TOptions, TMemberType> = ({
|
|
453
|
+
member: TMemberType;
|
|
454
|
+
} & GeoSearchOptions<TOptions>)[];
|
|
455
|
+
/**
|
|
456
|
+
* @see https://redis.io/commands/geosearch
|
|
457
|
+
*/
|
|
458
|
+
declare class GeoSearchCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions$1 = GeoSearchCommandOptions$1> extends Command<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>> {
|
|
459
|
+
constructor([key, centerPoint, shape, order, opts]: [
|
|
460
|
+
key: string,
|
|
461
|
+
centerPoint: CenterPoint$1<TMemberType>,
|
|
462
|
+
shape: Shape$1,
|
|
463
|
+
order: "ASC" | "DESC" | "asc" | "desc",
|
|
464
|
+
opts?: TOptions
|
|
465
|
+
], commandOptions?: CommandOptions<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>>);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
type RadiusOptions = "M" | "KM" | "FT" | "MI";
|
|
469
|
+
type CenterPoint<TMemberType> = {
|
|
470
|
+
type: "FROMMEMBER" | "frommember";
|
|
471
|
+
member: TMemberType;
|
|
472
|
+
} | {
|
|
473
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
474
|
+
coordinate: {
|
|
475
|
+
lon: number;
|
|
476
|
+
lat: number;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
type Shape = {
|
|
480
|
+
type: "BYRADIUS" | "byradius";
|
|
481
|
+
radius: number;
|
|
482
|
+
radiusType: RadiusOptions;
|
|
483
|
+
} | {
|
|
484
|
+
type: "BYBOX" | "bybox";
|
|
485
|
+
rect: {
|
|
486
|
+
width: number;
|
|
487
|
+
height: number;
|
|
488
|
+
};
|
|
489
|
+
rectType: RadiusOptions;
|
|
490
|
+
};
|
|
491
|
+
type GeoSearchCommandOptions = {
|
|
492
|
+
count?: {
|
|
493
|
+
limit: number;
|
|
494
|
+
any?: boolean;
|
|
495
|
+
};
|
|
496
|
+
storeDist?: boolean;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* @see https://redis.io/commands/geosearchstore
|
|
500
|
+
*/
|
|
501
|
+
declare class GeoSearchStoreCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions = GeoSearchCommandOptions> extends Command<any[] | any[][], number> {
|
|
502
|
+
constructor([destination, key, centerPoint, shape, order, opts]: [
|
|
503
|
+
destination: string,
|
|
504
|
+
key: string,
|
|
505
|
+
centerPoint: CenterPoint<TMemberType>,
|
|
506
|
+
shape: Shape,
|
|
507
|
+
order: "ASC" | "DESC" | "asc" | "desc",
|
|
508
|
+
opts?: TOptions
|
|
509
|
+
], commandOptions?: CommandOptions<any[] | any[][], number>);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @see https://redis.io/commands/get
|
|
514
|
+
*/
|
|
515
|
+
declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
516
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* @see https://redis.io/commands/getbit
|
|
521
|
+
*/
|
|
522
|
+
declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
|
|
523
|
+
constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* @see https://redis.io/commands/getdel
|
|
528
|
+
*/
|
|
529
|
+
declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
530
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* @see https://redis.io/commands/getrange
|
|
535
|
+
*/
|
|
536
|
+
declare class GetRangeCommand extends Command<string, string> {
|
|
537
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* @see https://redis.io/commands/getset
|
|
542
|
+
*/
|
|
543
|
+
declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
544
|
+
constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* @see https://redis.io/commands/hdel
|
|
549
|
+
*/
|
|
550
|
+
declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
|
|
551
|
+
constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @see https://redis.io/commands/hexists
|
|
556
|
+
*/
|
|
557
|
+
declare class HExistsCommand extends Command<number, number> {
|
|
558
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* @see https://redis.io/commands/hget
|
|
563
|
+
*/
|
|
564
|
+
declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
|
|
565
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* @see https://redis.io/commands/hgetall
|
|
570
|
+
*/
|
|
571
|
+
declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
|
|
572
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @see https://redis.io/commands/hincrby
|
|
577
|
+
*/
|
|
578
|
+
declare class HIncrByCommand extends Command<number, number> {
|
|
579
|
+
constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
584
|
+
*/
|
|
585
|
+
declare class HIncrByFloatCommand extends Command<number, number> {
|
|
586
|
+
constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* @see https://redis.io/commands/hkeys
|
|
591
|
+
*/
|
|
592
|
+
declare class HKeysCommand extends Command<string[], string[]> {
|
|
593
|
+
constructor([key]: [key: string], opts?: CommandOptions<string[], string[]>);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @see https://redis.io/commands/hlen
|
|
598
|
+
*/
|
|
599
|
+
declare class HLenCommand extends Command<number, number> {
|
|
600
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* hmget returns an object of all requested fields from a hash
|
|
605
|
+
* The field values are returned as an object like this:
|
|
606
|
+
* ```ts
|
|
607
|
+
* {[fieldName: string]: T | null}
|
|
608
|
+
* ```
|
|
609
|
+
*
|
|
610
|
+
* In case the hash does not exist or all fields are empty `null` is returned
|
|
611
|
+
*
|
|
612
|
+
* @see https://redis.io/commands/hmget
|
|
613
|
+
*/
|
|
614
|
+
declare class HMGetCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
|
|
615
|
+
constructor([key, ...fields]: [key: string, ...fields: string[]], opts?: CommandOptions<(string | null)[], TData | null>);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* @see https://redis.io/commands/hmset
|
|
620
|
+
*/
|
|
621
|
+
declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
|
|
622
|
+
constructor([key, kv]: [key: string, kv: {
|
|
623
|
+
[field: string]: TData;
|
|
624
|
+
}], opts?: CommandOptions<"OK", "OK">);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* @see https://redis.io/commands/hrandfield
|
|
629
|
+
*/
|
|
630
|
+
declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
|
|
631
|
+
constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
|
|
632
|
+
constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
|
|
633
|
+
constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* @see https://redis.io/commands/hscan
|
|
638
|
+
*/
|
|
639
|
+
declare class HScanCommand extends Command<[
|
|
640
|
+
number,
|
|
641
|
+
(string | number)[]
|
|
642
|
+
], [
|
|
643
|
+
number,
|
|
644
|
+
(string | number)[]
|
|
645
|
+
]> {
|
|
646
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @see https://redis.io/commands/hset
|
|
651
|
+
*/
|
|
652
|
+
declare class HSetCommand<TData> extends Command<number, number> {
|
|
653
|
+
constructor([key, kv]: [key: string, kv: {
|
|
654
|
+
[field: string]: TData;
|
|
655
|
+
}], opts?: CommandOptions<number, number>);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* @see https://redis.io/commands/hsetnx
|
|
660
|
+
*/
|
|
661
|
+
declare class HSetNXCommand<TData> extends Command<"0" | "1", 0 | 1> {
|
|
662
|
+
constructor(cmd: [key: string, field: string, value: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* @see https://redis.io/commands/hstrlen
|
|
667
|
+
*/
|
|
668
|
+
declare class HStrLenCommand extends Command<number, number> {
|
|
669
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* @see https://redis.io/commands/hvals
|
|
674
|
+
*/
|
|
675
|
+
declare class HValsCommand<TData extends unknown[]> extends Command<unknown[], TData> {
|
|
676
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* @see https://redis.io/commands/incr
|
|
681
|
+
*/
|
|
682
|
+
declare class IncrCommand extends Command<number, number> {
|
|
683
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* @see https://redis.io/commands/incrby
|
|
688
|
+
*/
|
|
689
|
+
declare class IncrByCommand extends Command<number, number> {
|
|
690
|
+
constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
695
|
+
*/
|
|
696
|
+
declare class IncrByFloatCommand extends Command<number, number> {
|
|
697
|
+
constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* @see https://redis.io/commands/json.arrappend
|
|
702
|
+
*/
|
|
703
|
+
declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
|
|
704
|
+
constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* @see https://redis.io/commands/json.arrindex
|
|
709
|
+
*/
|
|
710
|
+
declare class JsonArrIndexCommand<TValue> extends Command<(null | string)[], (null | number)[]> {
|
|
711
|
+
constructor(cmd: [key: string, path: string, value: TValue, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
716
|
+
*/
|
|
717
|
+
declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
|
|
718
|
+
constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @see https://redis.io/commands/json.arrlen
|
|
723
|
+
*/
|
|
724
|
+
declare class JsonArrLenCommand extends Command<(null | string)[], (null | number)[]> {
|
|
725
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* @see https://redis.io/commands/json.arrpop
|
|
730
|
+
*/
|
|
731
|
+
declare class JsonArrPopCommand<TData> extends Command<(null | string)[], (TData | null)[]> {
|
|
732
|
+
constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
737
|
+
*/
|
|
738
|
+
declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
|
|
739
|
+
constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* @see https://redis.io/commands/json.clear
|
|
744
|
+
*/
|
|
745
|
+
declare class JsonClearCommand extends Command<number, number> {
|
|
746
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* @see https://redis.io/commands/json.del
|
|
751
|
+
*/
|
|
752
|
+
declare class JsonDelCommand extends Command<number, number> {
|
|
753
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* @see https://redis.io/commands/json.forget
|
|
758
|
+
*/
|
|
759
|
+
declare class JsonForgetCommand extends Command<number, number> {
|
|
760
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* @see https://redis.io/commands/json.get
|
|
765
|
+
*/
|
|
766
|
+
declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
|
|
767
|
+
constructor(cmd: [
|
|
768
|
+
key: string,
|
|
769
|
+
opts?: {
|
|
770
|
+
indent?: string;
|
|
771
|
+
newline?: string;
|
|
772
|
+
space?: string;
|
|
773
|
+
},
|
|
774
|
+
...path: string[]
|
|
775
|
+
] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @see https://redis.io/commands/json.mget
|
|
780
|
+
*/
|
|
781
|
+
declare class JsonMGetCommand<TData extends (unknown | Record<string, unknown>)[]> extends Command<TData, TData> {
|
|
782
|
+
constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* @see https://redis.io/commands/json.numincrby
|
|
787
|
+
*/
|
|
788
|
+
declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
789
|
+
constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @see https://redis.io/commands/json.nummultby
|
|
794
|
+
*/
|
|
795
|
+
declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
796
|
+
constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* @see https://redis.io/commands/json.objkeys
|
|
801
|
+
*/
|
|
802
|
+
declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
|
|
803
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* @see https://redis.io/commands/json.objlen
|
|
808
|
+
*/
|
|
809
|
+
declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
810
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* @see https://redis.io/commands/json.resp
|
|
815
|
+
*/
|
|
816
|
+
declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
|
|
817
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* @see https://redis.io/commands/json.set
|
|
822
|
+
*/
|
|
823
|
+
declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
824
|
+
constructor(cmd: [
|
|
825
|
+
key: string,
|
|
826
|
+
path: string,
|
|
827
|
+
value: TData,
|
|
828
|
+
opts?: {
|
|
829
|
+
nx: true;
|
|
830
|
+
xx?: never;
|
|
831
|
+
} | {
|
|
832
|
+
nx?: never;
|
|
833
|
+
xx: true;
|
|
834
|
+
}
|
|
835
|
+
], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* @see https://redis.io/commands/json.strappend
|
|
840
|
+
*/
|
|
841
|
+
declare class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
|
|
842
|
+
constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @see https://redis.io/commands/json.strlen
|
|
847
|
+
*/
|
|
848
|
+
declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
849
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* @see https://redis.io/commands/json.toggle
|
|
854
|
+
*/
|
|
855
|
+
declare class JsonToggleCommand extends Command<number[], number[]> {
|
|
856
|
+
constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* @see https://redis.io/commands/json.type
|
|
861
|
+
*/
|
|
862
|
+
declare class JsonTypeCommand extends Command<string[], string[]> {
|
|
863
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* @see https://redis.io/commands/keys
|
|
868
|
+
*/
|
|
869
|
+
declare class KeysCommand extends Command<string[], string[]> {
|
|
870
|
+
constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
declare class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
874
|
+
constructor(cmd: [key: string, index: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare class LInsertCommand<TData = string> extends Command<number, number> {
|
|
878
|
+
constructor(cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData], opts?: CommandOptions<number, number>);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* @see https://redis.io/commands/llen
|
|
883
|
+
*/
|
|
884
|
+
declare class LLenCommand extends Command<number, number> {
|
|
885
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* @see https://redis.io/commands/lmove
|
|
890
|
+
*/
|
|
891
|
+
declare class LMoveCommand<TData = string> extends Command<TData, TData> {
|
|
892
|
+
constructor(cmd: [
|
|
893
|
+
source: string,
|
|
894
|
+
destination: string,
|
|
895
|
+
whereFrom: "left" | "right",
|
|
896
|
+
whereTo: "left" | "right"
|
|
897
|
+
], opts?: CommandOptions<TData, TData>);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* @see https://redis.io/commands/lpop
|
|
902
|
+
*/
|
|
903
|
+
declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
904
|
+
constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* @see https://redis.io/commands/lpush
|
|
909
|
+
*/
|
|
910
|
+
declare class LPushCommand<TData = string> extends Command<number, number> {
|
|
911
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* @see https://redis.io/commands/lpushx
|
|
916
|
+
*/
|
|
917
|
+
declare class LPushXCommand<TData> extends Command<number, number> {
|
|
918
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
declare class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
|
|
922
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
declare class LRemCommand<TData> extends Command<number, number> {
|
|
926
|
+
constructor(cmd: [key: string, count: number, value: TData], opts?: CommandOptions<number, number>);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare class LSetCommand<TData = string> extends Command<"OK", "OK"> {
|
|
930
|
+
constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
declare class LTrimCommand extends Command<"OK", "OK"> {
|
|
934
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* @see https://redis.io/commands/mget
|
|
939
|
+
*/
|
|
940
|
+
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
941
|
+
constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* @see https://redis.io/commands/mset
|
|
946
|
+
*/
|
|
947
|
+
declare class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
948
|
+
constructor([kv]: [kv: {
|
|
949
|
+
[key: string]: TData;
|
|
950
|
+
}], opts?: CommandOptions<"OK", "OK">);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* @see https://redis.io/commands/msetnx
|
|
955
|
+
*/
|
|
956
|
+
declare class MSetNXCommand<TData = string> extends Command<number, number> {
|
|
957
|
+
constructor([kv]: [kv: {
|
|
958
|
+
[key: string]: TData;
|
|
959
|
+
}], opts?: CommandOptions<number, number>);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* @see https://redis.io/commands/persist
|
|
964
|
+
*/
|
|
965
|
+
declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
|
|
966
|
+
constructor(cmd: [key: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* @see https://redis.io/commands/pexpire
|
|
971
|
+
*/
|
|
972
|
+
declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
973
|
+
constructor(cmd: [key: string, milliseconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* @see https://redis.io/commands/pexpireat
|
|
978
|
+
*/
|
|
979
|
+
declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
980
|
+
constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* @see https://redis.io/commands/ping
|
|
985
|
+
*/
|
|
986
|
+
declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
|
|
987
|
+
constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* @see https://redis.io/commands/psetex
|
|
992
|
+
*/
|
|
993
|
+
declare class PSetEXCommand<TData = string> extends Command<string, string> {
|
|
994
|
+
constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<string, string>);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* @see https://redis.io/commands/pttl
|
|
999
|
+
*/
|
|
1000
|
+
declare class PTtlCommand extends Command<number, number> {
|
|
1001
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* @see https://redis.io/commands/publish
|
|
1006
|
+
*/
|
|
1007
|
+
declare class PublishCommand<TMessage = unknown> extends Command<number, number> {
|
|
1008
|
+
constructor(cmd: [channel: string, message: TMessage], opts?: CommandOptions<number, number>);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* @see https://redis.io/commands/randomkey
|
|
1013
|
+
*/
|
|
1014
|
+
declare class RandomKeyCommand extends Command<string | null, string | null> {
|
|
1015
|
+
constructor(opts?: CommandOptions<string | null, string | null>);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* @see https://redis.io/commands/rename
|
|
1020
|
+
*/
|
|
1021
|
+
declare class RenameCommand extends Command<"OK", "OK"> {
|
|
1022
|
+
constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* @see https://redis.io/commands/renamenx
|
|
1027
|
+
*/
|
|
1028
|
+
declare class RenameNXCommand extends Command<"0" | "1", 0 | 1> {
|
|
1029
|
+
constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* @see https://redis.io/commands/rpop
|
|
1034
|
+
*/
|
|
1035
|
+
declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
|
|
1036
|
+
constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* @see https://redis.io/commands/rpush
|
|
1041
|
+
*/
|
|
1042
|
+
declare class RPushCommand<TData = string> extends Command<number, number> {
|
|
1043
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* @see https://redis.io/commands/rpushx
|
|
1048
|
+
*/
|
|
1049
|
+
declare class RPushXCommand<TData = string> extends Command<number, number> {
|
|
1050
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* @see https://redis.io/commands/sadd
|
|
1055
|
+
*/
|
|
1056
|
+
declare class SAddCommand<TData = string> extends Command<number, number> {
|
|
1057
|
+
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* @see https://redis.io/commands/scard
|
|
1062
|
+
*/
|
|
1063
|
+
declare class SCardCommand extends Command<number, number> {
|
|
1064
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* @see https://redis.io/commands/script-exists
|
|
1069
|
+
*/
|
|
1070
|
+
declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
|
|
1071
|
+
constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* @see https://redis.io/commands/script-load
|
|
1076
|
+
*/
|
|
1077
|
+
declare class ScriptLoadCommand extends Command<string, string> {
|
|
1078
|
+
constructor(args: [script: string], opts?: CommandOptions<string, string>);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* @see https://redis.io/commands/sdiff
|
|
1083
|
+
*/
|
|
1084
|
+
declare class SDiffCommand<TData> extends Command<unknown[], TData[]> {
|
|
1085
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* @see https://redis.io/commands/sdiffstore
|
|
1090
|
+
*/
|
|
1091
|
+
declare class SDiffStoreCommand extends Command<number, number> {
|
|
1092
|
+
constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
type SetCommandOptions = {
|
|
1096
|
+
get?: boolean;
|
|
1097
|
+
} & ({
|
|
1098
|
+
ex: number;
|
|
1099
|
+
px?: never;
|
|
1100
|
+
exat?: never;
|
|
1101
|
+
pxat?: never;
|
|
1102
|
+
keepTtl?: never;
|
|
1103
|
+
} | {
|
|
1104
|
+
ex?: never;
|
|
1105
|
+
px: number;
|
|
1106
|
+
exat?: never;
|
|
1107
|
+
pxat?: never;
|
|
1108
|
+
keepTtl?: never;
|
|
1109
|
+
} | {
|
|
1110
|
+
ex?: never;
|
|
1111
|
+
px?: never;
|
|
1112
|
+
exat: number;
|
|
1113
|
+
pxat?: never;
|
|
1114
|
+
keepTtl?: never;
|
|
1115
|
+
} | {
|
|
1116
|
+
ex?: never;
|
|
1117
|
+
px?: never;
|
|
1118
|
+
exat?: never;
|
|
1119
|
+
pxat: number;
|
|
1120
|
+
keepTtl?: never;
|
|
1121
|
+
} | {
|
|
1122
|
+
ex?: never;
|
|
1123
|
+
px?: never;
|
|
1124
|
+
exat?: never;
|
|
1125
|
+
pxat?: never;
|
|
1126
|
+
keepTtl: true;
|
|
1127
|
+
} | {
|
|
1128
|
+
ex?: never;
|
|
1129
|
+
px?: never;
|
|
1130
|
+
exat?: never;
|
|
1131
|
+
pxat?: never;
|
|
1132
|
+
keepTtl?: never;
|
|
1133
|
+
}) & ({
|
|
1134
|
+
nx: true;
|
|
1135
|
+
xx?: never;
|
|
1136
|
+
} | {
|
|
1137
|
+
xx: true;
|
|
1138
|
+
nx?: never;
|
|
1139
|
+
} | {
|
|
1140
|
+
xx?: never;
|
|
1141
|
+
nx?: never;
|
|
1142
|
+
});
|
|
1143
|
+
/**
|
|
1144
|
+
* @see https://redis.io/commands/set
|
|
1145
|
+
*/
|
|
1146
|
+
declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
|
|
1147
|
+
constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* @see https://redis.io/commands/setbit
|
|
1152
|
+
*/
|
|
1153
|
+
declare class SetBitCommand extends Command<"0" | "1", 0 | 1> {
|
|
1154
|
+
constructor(cmd: [key: string, offset: number, value: 0 | 1], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* @see https://redis.io/commands/setex
|
|
1159
|
+
*/
|
|
1160
|
+
declare class SetExCommand<TData = string> extends Command<"OK", "OK"> {
|
|
1161
|
+
constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<"OK", "OK">);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* @see https://redis.io/commands/setnx
|
|
1166
|
+
*/
|
|
1167
|
+
declare class SetNxCommand<TData = string> extends Command<number, number> {
|
|
1168
|
+
constructor(cmd: [key: string, value: TData], opts?: CommandOptions<number, number>);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* @see https://redis.io/commands/setrange
|
|
1173
|
+
*/
|
|
1174
|
+
declare class SetRangeCommand extends Command<number, number> {
|
|
1175
|
+
constructor(cmd: [key: string, offset: number, value: string], opts?: CommandOptions<number, number>);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* @see https://redis.io/commands/sinter
|
|
1180
|
+
*/
|
|
1181
|
+
declare class SInterCommand<TData = string> extends Command<unknown[], TData[]> {
|
|
1182
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* @see https://redis.io/commands/sinterstore
|
|
1187
|
+
*/
|
|
1188
|
+
declare class SInterStoreCommand extends Command<number, number> {
|
|
1189
|
+
constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* @see https://redis.io/commands/sismember
|
|
1194
|
+
*/
|
|
1195
|
+
declare class SIsMemberCommand<TData = string> extends Command<"0" | "1", 0 | 1> {
|
|
1196
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* @see https://redis.io/commands/smembers
|
|
1201
|
+
*/
|
|
1202
|
+
declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
|
|
1203
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* @see https://redis.io/commands/smismember
|
|
1208
|
+
*/
|
|
1209
|
+
declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
|
|
1210
|
+
constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* @see https://redis.io/commands/smove
|
|
1215
|
+
*/
|
|
1216
|
+
declare class SMoveCommand<TData> extends Command<"0" | "1", 0 | 1> {
|
|
1217
|
+
constructor(cmd: [source: string, destination: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* @see https://redis.io/commands/spop
|
|
1222
|
+
*/
|
|
1223
|
+
declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
|
|
1224
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* @see https://redis.io/commands/srandmember
|
|
1229
|
+
*/
|
|
1230
|
+
declare class SRandMemberCommand<TData> extends Command<string | null, TData | null> {
|
|
1231
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* @see https://redis.io/commands/srem
|
|
1236
|
+
*/
|
|
1237
|
+
declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
1238
|
+
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* @see https://redis.io/commands/sscan
|
|
1243
|
+
*/
|
|
1244
|
+
declare class SScanCommand extends Command<[
|
|
1245
|
+
number,
|
|
1246
|
+
(string | number)[]
|
|
1247
|
+
], [
|
|
1248
|
+
number,
|
|
1249
|
+
(string | number)[]
|
|
1250
|
+
]> {
|
|
1251
|
+
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* @see https://redis.io/commands/strlen
|
|
1256
|
+
*/
|
|
1257
|
+
declare class StrLenCommand extends Command<number, number> {
|
|
1258
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* @see https://redis.io/commands/sunion
|
|
1263
|
+
*/
|
|
1264
|
+
declare class SUnionCommand<TData> extends Command<string[], TData[]> {
|
|
1265
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<string[], TData[]>);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* @see https://redis.io/commands/sunionstore
|
|
1270
|
+
*/
|
|
1271
|
+
declare class SUnionStoreCommand extends Command<number, number> {
|
|
1272
|
+
constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* @see https://redis.io/commands/time
|
|
1277
|
+
*/
|
|
1278
|
+
declare class TimeCommand extends Command<[number, number], [number, number]> {
|
|
1279
|
+
constructor(opts?: CommandOptions<[number, number], [number, number]>);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* @see https://redis.io/commands/touch
|
|
1284
|
+
*/
|
|
1285
|
+
declare class TouchCommand extends Command<number, number> {
|
|
1286
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @see https://redis.io/commands/ttl
|
|
1291
|
+
*/
|
|
1292
|
+
declare class TtlCommand extends Command<number, number> {
|
|
1293
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* @see https://redis.io/commands/unlink
|
|
1298
|
+
*/
|
|
1299
|
+
declare class UnlinkCommand extends Command<number, number> {
|
|
1300
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
type XAddCommandOptions = {
|
|
1304
|
+
nomkStream?: boolean;
|
|
1305
|
+
trim?: ({
|
|
1306
|
+
type: "MAXLEN" | "maxlen";
|
|
1307
|
+
threshold: number;
|
|
1308
|
+
} | {
|
|
1309
|
+
type: "MINID" | "minid";
|
|
1310
|
+
threshold: string;
|
|
1311
|
+
}) & ({
|
|
1312
|
+
comparison: "~";
|
|
1313
|
+
limit?: number;
|
|
1314
|
+
} | {
|
|
1315
|
+
comparison: "=";
|
|
1316
|
+
limit?: never;
|
|
1317
|
+
});
|
|
1318
|
+
};
|
|
1319
|
+
/**
|
|
1320
|
+
* @see https://redis.io/commands/xadd
|
|
1321
|
+
*/
|
|
1322
|
+
declare class XAddCommand extends Command<string, string> {
|
|
1323
|
+
constructor([key, id, entries, opts]: [
|
|
1324
|
+
key: string,
|
|
1325
|
+
id: "*" | string,
|
|
1326
|
+
entries: {
|
|
1327
|
+
[field: string]: unknown;
|
|
1328
|
+
},
|
|
1329
|
+
opts?: XAddCommandOptions
|
|
1330
|
+
], commandOptions?: CommandOptions<string, string>);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
|
|
1334
|
+
constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
type ZAddCommandOptions = ({
|
|
1338
|
+
nx: true;
|
|
1339
|
+
xx?: never;
|
|
1340
|
+
} | {
|
|
1341
|
+
nx?: never;
|
|
1342
|
+
xx: true;
|
|
1343
|
+
} | {
|
|
1344
|
+
nx?: never;
|
|
1345
|
+
xx?: never;
|
|
1346
|
+
}) & {
|
|
1347
|
+
ch?: true;
|
|
1348
|
+
};
|
|
1349
|
+
type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
|
|
1350
|
+
incr: true;
|
|
1351
|
+
};
|
|
1352
|
+
type ScoreMember<TData> = {
|
|
1353
|
+
score: number;
|
|
1354
|
+
member: TData;
|
|
1355
|
+
};
|
|
1356
|
+
/**
|
|
1357
|
+
* @see https://redis.io/commands/zadd
|
|
1358
|
+
*/
|
|
1359
|
+
declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
|
|
1360
|
+
constructor(cmd: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
|
|
1361
|
+
constructor(cmd: [
|
|
1362
|
+
key: string,
|
|
1363
|
+
opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
|
|
1364
|
+
...scoreMemberPairs: ScoreMember<TData>[]
|
|
1365
|
+
], opts?: CommandOptions<number | null, number | null>);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* @see https://redis.io/commands/zcard
|
|
1370
|
+
*/
|
|
1371
|
+
declare class ZCardCommand extends Command<number, number> {
|
|
1372
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* @see https://redis.io/commands/zcount
|
|
1377
|
+
*/
|
|
1378
|
+
declare class ZCountCommand extends Command<number, number> {
|
|
1379
|
+
constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* @see https://redis.io/commands/zincrby
|
|
1384
|
+
*/
|
|
1385
|
+
declare class ZIncrByCommand<TData> extends Command<number, number> {
|
|
1386
|
+
constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* @see https://redis.io/commands/zlexcount
|
|
1391
|
+
*/
|
|
1392
|
+
declare class ZLexCountCommand extends Command<number, number> {
|
|
1393
|
+
constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* @see https://redis.io/commands/zpopmax
|
|
1398
|
+
*/
|
|
1399
|
+
declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
|
|
1400
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* @see https://redis.io/commands/zpopmin
|
|
1405
|
+
*/
|
|
1406
|
+
declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
|
|
1407
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
type ZRangeCommandOptions = {
|
|
1411
|
+
withScores?: boolean;
|
|
1412
|
+
rev?: boolean;
|
|
1413
|
+
} & ({
|
|
1414
|
+
byScore: true;
|
|
1415
|
+
byLex?: never;
|
|
1416
|
+
} | {
|
|
1417
|
+
byScore?: never;
|
|
1418
|
+
byLex: true;
|
|
1419
|
+
} | {
|
|
1420
|
+
byScore?: never;
|
|
1421
|
+
byLex?: never;
|
|
1422
|
+
}) & ({
|
|
1423
|
+
offset: number;
|
|
1424
|
+
count: number;
|
|
1425
|
+
} | {
|
|
1426
|
+
offset?: never;
|
|
1427
|
+
count?: never;
|
|
1428
|
+
});
|
|
1429
|
+
/**
|
|
1430
|
+
* @see https://redis.io/commands/zrange
|
|
1431
|
+
*/
|
|
1432
|
+
declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
|
|
1433
|
+
constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
1434
|
+
constructor(cmd: [
|
|
1435
|
+
key: string,
|
|
1436
|
+
min: `(${string}` | `[${string}` | "-" | "+",
|
|
1437
|
+
max: `(${string}` | `[${string}` | "-" | "+",
|
|
1438
|
+
opts: {
|
|
1439
|
+
byLex: true;
|
|
1440
|
+
} & ZRangeCommandOptions
|
|
1441
|
+
], cmdOpts?: CommandOptions<string[], TData>);
|
|
1442
|
+
constructor(cmd: [
|
|
1443
|
+
key: string,
|
|
1444
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
1445
|
+
max: number | `(${number}` | "-inf" | "+inf",
|
|
1446
|
+
opts: {
|
|
1447
|
+
byScore: true;
|
|
1448
|
+
} & ZRangeCommandOptions
|
|
1449
|
+
], cmdOpts?: CommandOptions<string[], TData>);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* @see https://redis.io/commands/zrank
|
|
1454
|
+
*/
|
|
1455
|
+
declare class ZRankCommand<TData> extends Command<number | null, number | null> {
|
|
1456
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @see https://redis.io/commands/zrem
|
|
1461
|
+
*/
|
|
1462
|
+
declare class ZRemCommand<TData = string> extends Command<number, number> {
|
|
1463
|
+
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
1468
|
+
*/
|
|
1469
|
+
declare class ZRemRangeByLexCommand extends Command<number, number> {
|
|
1470
|
+
constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
1475
|
+
*/
|
|
1476
|
+
declare class ZRemRangeByRankCommand extends Command<number, number> {
|
|
1477
|
+
constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
1482
|
+
*/
|
|
1483
|
+
declare class ZRemRangeByScoreCommand extends Command<number, number> {
|
|
1484
|
+
constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* @see https://redis.io/commands/zrevrank
|
|
1489
|
+
*/
|
|
1490
|
+
declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
|
|
1491
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* @see https://redis.io/commands/zscan
|
|
1496
|
+
*/
|
|
1497
|
+
declare class ZScanCommand extends Command<[
|
|
1498
|
+
number,
|
|
1499
|
+
(string | number)[]
|
|
1500
|
+
], [
|
|
1501
|
+
number,
|
|
1502
|
+
(string | number)[]
|
|
1503
|
+
]> {
|
|
1504
|
+
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* @see https://redis.io/commands/zscore
|
|
1509
|
+
*/
|
|
1510
|
+
declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
|
|
1511
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
type InferResponseData<T extends unknown[]> = {
|
|
1515
|
+
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
1516
|
+
};
|
|
1517
|
+
/**
|
|
1518
|
+
* Upstash REST API supports command pipelining to send multiple commands in
|
|
1519
|
+
* batch, instead of sending each command one by one and waiting for a response.
|
|
1520
|
+
* When using pipelines, several commands are sent using a single HTTP request,
|
|
1521
|
+
* and a single JSON array response is returned. Each item in the response array
|
|
1522
|
+
* corresponds to the command in the same order within the pipeline.
|
|
1523
|
+
*
|
|
1524
|
+
* **NOTE:**
|
|
1525
|
+
*
|
|
1526
|
+
* Execution of the pipeline is not atomic. Even though each command in
|
|
1527
|
+
* the pipeline will be executed in order, commands sent by other clients can
|
|
1528
|
+
* interleave with the pipeline.
|
|
1529
|
+
*
|
|
1530
|
+
* **Examples:**
|
|
1531
|
+
*
|
|
1532
|
+
* ```ts
|
|
1533
|
+
* const p = redis.pipeline() // or redis.multi()
|
|
1534
|
+
* p.set("key","value")
|
|
1535
|
+
* p.get("key")
|
|
1536
|
+
* const res = await p.exec()
|
|
1537
|
+
* ```
|
|
1538
|
+
*
|
|
1539
|
+
* You can also chain commands together
|
|
1540
|
+
* ```ts
|
|
1541
|
+
* const p = redis.pipeline()
|
|
1542
|
+
* const res = await p.set("key","value").get("key").exec()
|
|
1543
|
+
* ```
|
|
1544
|
+
*
|
|
1545
|
+
* Return types are inferred if all commands are chained, but you can still
|
|
1546
|
+
* override the response type manually:
|
|
1547
|
+
* ```ts
|
|
1548
|
+
* redis.pipeline()
|
|
1549
|
+
* .set("key", { greeting: "hello"})
|
|
1550
|
+
* .get("key")
|
|
1551
|
+
* .exec<["OK", { greeting: string } ]>()
|
|
1552
|
+
*
|
|
1553
|
+
* ```
|
|
1554
|
+
*/
|
|
1555
|
+
declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
1556
|
+
private client;
|
|
1557
|
+
private commands;
|
|
1558
|
+
private commandOptions?;
|
|
1559
|
+
private multiExec;
|
|
1560
|
+
constructor(opts: {
|
|
1561
|
+
client: Requester;
|
|
1562
|
+
commandOptions?: CommandOptions<any, any>;
|
|
1563
|
+
multiExec?: boolean;
|
|
1564
|
+
});
|
|
1565
|
+
/**
|
|
1566
|
+
* Send the pipeline request to upstash.
|
|
1567
|
+
*
|
|
1568
|
+
* Returns an array with the results of all pipelined commands.
|
|
1569
|
+
*
|
|
1570
|
+
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
1571
|
+
* ```ts
|
|
1572
|
+
* const p = redis.pipeline()
|
|
1573
|
+
* p.get("key")
|
|
1574
|
+
* const result = p.exec<[{ greeting: string }]>()
|
|
1575
|
+
* ```
|
|
1576
|
+
*/
|
|
1577
|
+
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Returns the length of pipeline before the execution
|
|
1580
|
+
*/
|
|
1581
|
+
length(): number;
|
|
1582
|
+
/**
|
|
1583
|
+
* Pushes a command into the pipeline and returns a chainable instance of the
|
|
1584
|
+
* pipeline
|
|
1585
|
+
*/
|
|
1586
|
+
private chain;
|
|
1587
|
+
/**
|
|
1588
|
+
* @see https://redis.io/commands/append
|
|
1589
|
+
*/
|
|
1590
|
+
append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1591
|
+
/**
|
|
1592
|
+
* @see https://redis.io/commands/bitcount
|
|
1593
|
+
*/
|
|
1594
|
+
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1595
|
+
/**
|
|
1596
|
+
* @see https://redis.io/commands/bitop
|
|
1597
|
+
*/
|
|
1598
|
+
bitop: {
|
|
1599
|
+
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
1600
|
+
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* @see https://redis.io/commands/bitpos
|
|
1604
|
+
*/
|
|
1605
|
+
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1606
|
+
/**
|
|
1607
|
+
* @see https://redis.io/commands/copy
|
|
1608
|
+
*/
|
|
1609
|
+
copy: (key: string, destinationKey: string, opts?: {
|
|
1610
|
+
replace: boolean;
|
|
1611
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
|
|
1612
|
+
/**
|
|
1613
|
+
* @see https://redis.io/commands/zdiffstore
|
|
1614
|
+
*/
|
|
1615
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1616
|
+
/**
|
|
1617
|
+
* @see https://redis.io/commands/dbsize
|
|
1618
|
+
*/
|
|
1619
|
+
dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1620
|
+
/**
|
|
1621
|
+
* @see https://redis.io/commands/decr
|
|
1622
|
+
*/
|
|
1623
|
+
decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1624
|
+
/**
|
|
1625
|
+
* @see https://redis.io/commands/decrby
|
|
1626
|
+
*/
|
|
1627
|
+
decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1628
|
+
/**
|
|
1629
|
+
* @see https://redis.io/commands/del
|
|
1630
|
+
*/
|
|
1631
|
+
del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1632
|
+
/**
|
|
1633
|
+
* @see https://redis.io/commands/echo
|
|
1634
|
+
*/
|
|
1635
|
+
echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
1636
|
+
/**
|
|
1637
|
+
* @see https://redis.io/commands/eval
|
|
1638
|
+
*/
|
|
1639
|
+
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1640
|
+
/**
|
|
1641
|
+
* @see https://redis.io/commands/evalsha
|
|
1642
|
+
*/
|
|
1643
|
+
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1644
|
+
/**
|
|
1645
|
+
* @see https://redis.io/commands/exists
|
|
1646
|
+
*/
|
|
1647
|
+
exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1648
|
+
/**
|
|
1649
|
+
* @see https://redis.io/commands/expire
|
|
1650
|
+
*/
|
|
1651
|
+
expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1652
|
+
/**
|
|
1653
|
+
* @see https://redis.io/commands/expireat
|
|
1654
|
+
*/
|
|
1655
|
+
expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1656
|
+
/**
|
|
1657
|
+
* @see https://redis.io/commands/flushall
|
|
1658
|
+
*/
|
|
1659
|
+
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1660
|
+
/**
|
|
1661
|
+
* @see https://redis.io/commands/flushdb
|
|
1662
|
+
*/
|
|
1663
|
+
flushdb: (opts?: {
|
|
1664
|
+
async?: boolean | undefined;
|
|
1665
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1666
|
+
/**
|
|
1667
|
+
* @see https://redis.io/commands/get
|
|
1668
|
+
*/
|
|
1669
|
+
get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1670
|
+
/**
|
|
1671
|
+
* @see https://redis.io/commands/getbit
|
|
1672
|
+
*/
|
|
1673
|
+
getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1674
|
+
/**
|
|
1675
|
+
* @see https://redis.io/commands/getdel
|
|
1676
|
+
*/
|
|
1677
|
+
getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1678
|
+
/**
|
|
1679
|
+
* @see https://redis.io/commands/getrange
|
|
1680
|
+
*/
|
|
1681
|
+
getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
1682
|
+
/**
|
|
1683
|
+
* @see https://redis.io/commands/getset
|
|
1684
|
+
*/
|
|
1685
|
+
getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1686
|
+
/**
|
|
1687
|
+
* @see https://redis.io/commands/hdel
|
|
1688
|
+
*/
|
|
1689
|
+
hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1690
|
+
/**
|
|
1691
|
+
* @see https://redis.io/commands/hexists
|
|
1692
|
+
*/
|
|
1693
|
+
hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1694
|
+
/**
|
|
1695
|
+
* @see https://redis.io/commands/hget
|
|
1696
|
+
*/
|
|
1697
|
+
hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1698
|
+
/**
|
|
1699
|
+
* @see https://redis.io/commands/hgetall
|
|
1700
|
+
*/
|
|
1701
|
+
hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1702
|
+
/**
|
|
1703
|
+
* @see https://redis.io/commands/hincrby
|
|
1704
|
+
*/
|
|
1705
|
+
hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1706
|
+
/**
|
|
1707
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
1708
|
+
*/
|
|
1709
|
+
hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1710
|
+
/**
|
|
1711
|
+
* @see https://redis.io/commands/hkeys
|
|
1712
|
+
*/
|
|
1713
|
+
hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
1714
|
+
/**
|
|
1715
|
+
* @see https://redis.io/commands/hlen
|
|
1716
|
+
*/
|
|
1717
|
+
hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1718
|
+
/**
|
|
1719
|
+
* @see https://redis.io/commands/hmget
|
|
1720
|
+
*/
|
|
1721
|
+
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1722
|
+
/**
|
|
1723
|
+
* @see https://redis.io/commands/hmset
|
|
1724
|
+
*/
|
|
1725
|
+
hmset: <TData>(key: string, kv: {
|
|
1726
|
+
[field: string]: TData;
|
|
1727
|
+
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1728
|
+
/**
|
|
1729
|
+
* @see https://redis.io/commands/hrandfield
|
|
1730
|
+
*/
|
|
1731
|
+
hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1732
|
+
/**
|
|
1733
|
+
* @see https://redis.io/commands/hscan
|
|
1734
|
+
*/
|
|
1735
|
+
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
1736
|
+
/**
|
|
1737
|
+
* @see https://redis.io/commands/hset
|
|
1738
|
+
*/
|
|
1739
|
+
hset: <TData>(key: string, kv: {
|
|
1740
|
+
[field: string]: TData;
|
|
1741
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1742
|
+
/**
|
|
1743
|
+
* @see https://redis.io/commands/hsetnx
|
|
1744
|
+
*/
|
|
1745
|
+
hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1746
|
+
/**
|
|
1747
|
+
* @see https://redis.io/commands/hstrlen
|
|
1748
|
+
*/
|
|
1749
|
+
hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1750
|
+
/**
|
|
1751
|
+
* @see https://redis.io/commands/hvals
|
|
1752
|
+
*/
|
|
1753
|
+
hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1754
|
+
/**
|
|
1755
|
+
* @see https://redis.io/commands/incr
|
|
1756
|
+
*/
|
|
1757
|
+
incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1758
|
+
/**
|
|
1759
|
+
* @see https://redis.io/commands/incrby
|
|
1760
|
+
*/
|
|
1761
|
+
incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1762
|
+
/**
|
|
1763
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
1764
|
+
*/
|
|
1765
|
+
incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1766
|
+
/**
|
|
1767
|
+
* @see https://redis.io/commands/keys
|
|
1768
|
+
*/
|
|
1769
|
+
keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
1770
|
+
/**
|
|
1771
|
+
* @see https://redis.io/commands/lindex
|
|
1772
|
+
*/
|
|
1773
|
+
lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1774
|
+
/**
|
|
1775
|
+
* @see https://redis.io/commands/linsert
|
|
1776
|
+
*/
|
|
1777
|
+
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1778
|
+
/**
|
|
1779
|
+
* @see https://redis.io/commands/llen
|
|
1780
|
+
*/
|
|
1781
|
+
llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1782
|
+
/**
|
|
1783
|
+
* @see https://redis.io/commands/lmove
|
|
1784
|
+
*/
|
|
1785
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1786
|
+
/**
|
|
1787
|
+
* @see https://redis.io/commands/lpop
|
|
1788
|
+
*/
|
|
1789
|
+
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1790
|
+
/**
|
|
1791
|
+
* @see https://redis.io/commands/lpos
|
|
1792
|
+
*/
|
|
1793
|
+
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
1794
|
+
rank?: number | undefined;
|
|
1795
|
+
count?: number | undefined;
|
|
1796
|
+
maxLen?: number | undefined;
|
|
1797
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1798
|
+
/**
|
|
1799
|
+
* @see https://redis.io/commands/lpush
|
|
1800
|
+
*/
|
|
1801
|
+
lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1802
|
+
/**
|
|
1803
|
+
* @see https://redis.io/commands/lpushx
|
|
1804
|
+
*/
|
|
1805
|
+
lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1806
|
+
/**
|
|
1807
|
+
* @see https://redis.io/commands/lrange
|
|
1808
|
+
*/
|
|
1809
|
+
lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
|
|
1810
|
+
/**
|
|
1811
|
+
* @see https://redis.io/commands/lrem
|
|
1812
|
+
*/
|
|
1813
|
+
lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1814
|
+
/**
|
|
1815
|
+
* @see https://redis.io/commands/lset
|
|
1816
|
+
*/
|
|
1817
|
+
lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1818
|
+
/**
|
|
1819
|
+
* @see https://redis.io/commands/ltrim
|
|
1820
|
+
*/
|
|
1821
|
+
ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1822
|
+
/**
|
|
1823
|
+
* @see https://redis.io/commands/mget
|
|
1824
|
+
*/
|
|
1825
|
+
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1826
|
+
/**
|
|
1827
|
+
* @see https://redis.io/commands/mset
|
|
1828
|
+
*/
|
|
1829
|
+
mset: <TData>(kv: {
|
|
1830
|
+
[key: string]: TData;
|
|
1831
|
+
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1832
|
+
/**
|
|
1833
|
+
* @see https://redis.io/commands/msetnx
|
|
1834
|
+
*/
|
|
1835
|
+
msetnx: <TData>(kv: {
|
|
1836
|
+
[key: string]: TData;
|
|
1837
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1838
|
+
/**
|
|
1839
|
+
* @see https://redis.io/commands/persist
|
|
1840
|
+
*/
|
|
1841
|
+
persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1842
|
+
/**
|
|
1843
|
+
* @see https://redis.io/commands/pexpire
|
|
1844
|
+
*/
|
|
1845
|
+
pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1846
|
+
/**
|
|
1847
|
+
* @see https://redis.io/commands/pexpireat
|
|
1848
|
+
*/
|
|
1849
|
+
pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1850
|
+
/**
|
|
1851
|
+
* @see https://redis.io/commands/ping
|
|
1852
|
+
*/
|
|
1853
|
+
ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
1854
|
+
/**
|
|
1855
|
+
* @see https://redis.io/commands/psetex
|
|
1856
|
+
*/
|
|
1857
|
+
psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
1858
|
+
/**
|
|
1859
|
+
* @see https://redis.io/commands/pttl
|
|
1860
|
+
*/
|
|
1861
|
+
pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1862
|
+
/**
|
|
1863
|
+
* @see https://redis.io/commands/publish
|
|
1864
|
+
*/
|
|
1865
|
+
publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1866
|
+
/**
|
|
1867
|
+
* @see https://redis.io/commands/randomkey
|
|
1868
|
+
*/
|
|
1869
|
+
randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
|
|
1870
|
+
/**
|
|
1871
|
+
* @see https://redis.io/commands/rename
|
|
1872
|
+
*/
|
|
1873
|
+
rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1874
|
+
/**
|
|
1875
|
+
* @see https://redis.io/commands/renamenx
|
|
1876
|
+
*/
|
|
1877
|
+
renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1878
|
+
/**
|
|
1879
|
+
* @see https://redis.io/commands/rpop
|
|
1880
|
+
*/
|
|
1881
|
+
rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1882
|
+
/**
|
|
1883
|
+
* @see https://redis.io/commands/rpush
|
|
1884
|
+
*/
|
|
1885
|
+
rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1886
|
+
/**
|
|
1887
|
+
* @see https://redis.io/commands/rpushx
|
|
1888
|
+
*/
|
|
1889
|
+
rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1890
|
+
/**
|
|
1891
|
+
* @see https://redis.io/commands/sadd
|
|
1892
|
+
*/
|
|
1893
|
+
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1894
|
+
/**
|
|
1895
|
+
* @see https://redis.io/commands/scan
|
|
1896
|
+
*/
|
|
1897
|
+
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
|
|
1898
|
+
/**
|
|
1899
|
+
* @see https://redis.io/commands/scard
|
|
1900
|
+
*/
|
|
1901
|
+
scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1902
|
+
/**
|
|
1903
|
+
* @see https://redis.io/commands/script-exists
|
|
1904
|
+
*/
|
|
1905
|
+
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
1906
|
+
/**
|
|
1907
|
+
* @see https://redis.io/commands/script-flush
|
|
1908
|
+
*/
|
|
1909
|
+
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1910
|
+
/**
|
|
1911
|
+
* @see https://redis.io/commands/script-load
|
|
1912
|
+
*/
|
|
1913
|
+
scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
1914
|
+
sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
1915
|
+
/**
|
|
1916
|
+
* @see https://redis.io/commands/sdiffstore
|
|
1917
|
+
*/
|
|
1918
|
+
sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1919
|
+
/**
|
|
1920
|
+
* @see https://redis.io/commands/set
|
|
1921
|
+
*/
|
|
1922
|
+
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
|
|
1923
|
+
/**
|
|
1924
|
+
* @see https://redis.io/commands/setbit
|
|
1925
|
+
*/
|
|
1926
|
+
setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1927
|
+
/**
|
|
1928
|
+
* @see https://redis.io/commands/setex
|
|
1929
|
+
*/
|
|
1930
|
+
setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1931
|
+
/**
|
|
1932
|
+
* @see https://redis.io/commands/setnx
|
|
1933
|
+
*/
|
|
1934
|
+
setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1935
|
+
/**
|
|
1936
|
+
* @see https://redis.io/commands/setrange
|
|
1937
|
+
*/
|
|
1938
|
+
setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1939
|
+
/**
|
|
1940
|
+
* @see https://redis.io/commands/sinter
|
|
1941
|
+
*/
|
|
1942
|
+
sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
1943
|
+
/**
|
|
1944
|
+
* @see https://redis.io/commands/sinterstore
|
|
1945
|
+
*/
|
|
1946
|
+
sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1947
|
+
/**
|
|
1948
|
+
* @see https://redis.io/commands/sismember
|
|
1949
|
+
*/
|
|
1950
|
+
sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1951
|
+
/**
|
|
1952
|
+
* @see https://redis.io/commands/smembers
|
|
1953
|
+
*/
|
|
1954
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1955
|
+
/**
|
|
1956
|
+
* @see https://redis.io/commands/smismember
|
|
1957
|
+
*/
|
|
1958
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
|
|
1959
|
+
/**
|
|
1960
|
+
* @see https://redis.io/commands/smove
|
|
1961
|
+
*/
|
|
1962
|
+
smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1963
|
+
/**
|
|
1964
|
+
* @see https://redis.io/commands/spop
|
|
1965
|
+
*/
|
|
1966
|
+
spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1967
|
+
/**
|
|
1968
|
+
* @see https://redis.io/commands/srandmember
|
|
1969
|
+
*/
|
|
1970
|
+
srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1971
|
+
/**
|
|
1972
|
+
* @see https://redis.io/commands/srem
|
|
1973
|
+
*/
|
|
1974
|
+
srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1975
|
+
/**
|
|
1976
|
+
* @see https://redis.io/commands/sscan
|
|
1977
|
+
*/
|
|
1978
|
+
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
1979
|
+
/**
|
|
1980
|
+
* @see https://redis.io/commands/strlen
|
|
1981
|
+
*/
|
|
1982
|
+
strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1983
|
+
/**
|
|
1984
|
+
* @see https://redis.io/commands/sunion
|
|
1985
|
+
*/
|
|
1986
|
+
sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
1987
|
+
/**
|
|
1988
|
+
* @see https://redis.io/commands/sunionstore
|
|
1989
|
+
*/
|
|
1990
|
+
sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1991
|
+
/**
|
|
1992
|
+
* @see https://redis.io/commands/time
|
|
1993
|
+
*/
|
|
1994
|
+
time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
|
|
1995
|
+
/**
|
|
1996
|
+
* @see https://redis.io/commands/touch
|
|
1997
|
+
*/
|
|
1998
|
+
touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1999
|
+
/**
|
|
2000
|
+
* @see https://redis.io/commands/ttl
|
|
2001
|
+
*/
|
|
2002
|
+
ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2003
|
+
/**
|
|
2004
|
+
* @see https://redis.io/commands/type
|
|
2005
|
+
*/
|
|
2006
|
+
type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
|
|
2007
|
+
/**
|
|
2008
|
+
* @see https://redis.io/commands/unlink
|
|
2009
|
+
*/
|
|
2010
|
+
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2011
|
+
/**
|
|
2012
|
+
* @see https://redis.io/commands/zadd
|
|
2013
|
+
*/
|
|
2014
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2015
|
+
/**
|
|
2016
|
+
* @see https://redis.io/commands/zcard
|
|
2017
|
+
*/
|
|
2018
|
+
zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2019
|
+
/**
|
|
2020
|
+
* @see https://redis.io/commands/zcount
|
|
2021
|
+
*/
|
|
2022
|
+
zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2023
|
+
/**
|
|
2024
|
+
* @see https://redis.io/commands/zincrby
|
|
2025
|
+
*/
|
|
2026
|
+
zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2027
|
+
/**
|
|
2028
|
+
* @see https://redis.io/commands/zinterstore
|
|
2029
|
+
*/
|
|
2030
|
+
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2031
|
+
/**
|
|
2032
|
+
* @see https://redis.io/commands/zlexcount
|
|
2033
|
+
*/
|
|
2034
|
+
zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2035
|
+
/**
|
|
2036
|
+
* @see https://redis.io/commands/zmscore
|
|
2037
|
+
*/
|
|
2038
|
+
zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
|
|
2039
|
+
/**
|
|
2040
|
+
* @see https://redis.io/commands/zpopmax
|
|
2041
|
+
*/
|
|
2042
|
+
zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
2043
|
+
/**
|
|
2044
|
+
* @see https://redis.io/commands/zpopmin
|
|
2045
|
+
*/
|
|
2046
|
+
zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
2047
|
+
/**
|
|
2048
|
+
* @see https://redis.io/commands/zrange
|
|
2049
|
+
*/
|
|
2050
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
2051
|
+
key: string,
|
|
2052
|
+
min: `(${string}` | `[${string}` | "-" | "+",
|
|
2053
|
+
max: `(${string}` | `[${string}` | "-" | "+",
|
|
2054
|
+
opts: {
|
|
2055
|
+
byLex: true;
|
|
2056
|
+
} & ZRangeCommandOptions
|
|
2057
|
+
] | [
|
|
2058
|
+
key: string,
|
|
2059
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
2060
|
+
max: number | `(${number}` | "-inf" | "+inf",
|
|
2061
|
+
opts: {
|
|
2062
|
+
byScore: true;
|
|
2063
|
+
} & ZRangeCommandOptions
|
|
2064
|
+
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2065
|
+
/**
|
|
2066
|
+
* @see https://redis.io/commands/zrank
|
|
2067
|
+
*/
|
|
2068
|
+
zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2069
|
+
/**
|
|
2070
|
+
* @see https://redis.io/commands/zrem
|
|
2071
|
+
*/
|
|
2072
|
+
zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2073
|
+
/**
|
|
2074
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
2075
|
+
*/
|
|
2076
|
+
zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2077
|
+
/**
|
|
2078
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
2079
|
+
*/
|
|
2080
|
+
zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2081
|
+
/**
|
|
2082
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
2083
|
+
*/
|
|
2084
|
+
zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2085
|
+
/**
|
|
2086
|
+
* @see https://redis.io/commands/zrevrank
|
|
2087
|
+
*/
|
|
2088
|
+
zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2089
|
+
/**
|
|
2090
|
+
* @see https://redis.io/commands/zscan
|
|
2091
|
+
*/
|
|
2092
|
+
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
2093
|
+
/**
|
|
2094
|
+
* @see https://redis.io/commands/zscore
|
|
2095
|
+
*/
|
|
2096
|
+
zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2097
|
+
/**
|
|
2098
|
+
* @see https://redis.io/commands/zunionstore
|
|
2099
|
+
*/
|
|
2100
|
+
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2101
|
+
/**
|
|
2102
|
+
* @see https://redis.io/commands/zunion
|
|
2103
|
+
*/
|
|
2104
|
+
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2105
|
+
/**
|
|
2106
|
+
* @see https://redis.io/commands/?group=json
|
|
2107
|
+
*/
|
|
2108
|
+
get json(): {
|
|
2109
|
+
/**
|
|
2110
|
+
* @see https://redis.io/commands/json.arrappend
|
|
2111
|
+
*/
|
|
2112
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2113
|
+
/**
|
|
2114
|
+
* @see https://redis.io/commands/json.arrindex
|
|
2115
|
+
*/
|
|
2116
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2117
|
+
/**
|
|
2118
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
2119
|
+
*/
|
|
2120
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2121
|
+
/**
|
|
2122
|
+
* @see https://redis.io/commands/json.arrlen
|
|
2123
|
+
*/
|
|
2124
|
+
arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2125
|
+
/**
|
|
2126
|
+
* @see https://redis.io/commands/json.arrpop
|
|
2127
|
+
*/
|
|
2128
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2129
|
+
/**
|
|
2130
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
2131
|
+
*/
|
|
2132
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2133
|
+
/**
|
|
2134
|
+
* @see https://redis.io/commands/json.clear
|
|
2135
|
+
*/
|
|
2136
|
+
clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2137
|
+
/**
|
|
2138
|
+
* @see https://redis.io/commands/json.del
|
|
2139
|
+
*/
|
|
2140
|
+
del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2141
|
+
/**
|
|
2142
|
+
* @see https://redis.io/commands/json.forget
|
|
2143
|
+
*/
|
|
2144
|
+
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2145
|
+
/**
|
|
2146
|
+
* @see https://redis.io/commands/geoadd
|
|
2147
|
+
*/
|
|
2148
|
+
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2149
|
+
/**
|
|
2150
|
+
* @see https://redis.io/commands/geodist
|
|
2151
|
+
*/
|
|
2152
|
+
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2153
|
+
/**
|
|
2154
|
+
* @see https://redis.io/commands/geopos
|
|
2155
|
+
*/
|
|
2156
|
+
geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
|
|
2157
|
+
lng: number;
|
|
2158
|
+
lat: number;
|
|
2159
|
+
}[]>]>;
|
|
2160
|
+
/**
|
|
2161
|
+
* @see https://redis.io/commands/geohash
|
|
2162
|
+
*/
|
|
2163
|
+
geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
2164
|
+
/**
|
|
2165
|
+
* @see https://redis.io/commands/geosearch
|
|
2166
|
+
*/
|
|
2167
|
+
geosearch: (key: string, centerPoint: {
|
|
2168
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2169
|
+
coordinate: {
|
|
2170
|
+
lon: number;
|
|
2171
|
+
lat: number;
|
|
2172
|
+
};
|
|
2173
|
+
} | {
|
|
2174
|
+
type: "FROMMEMBER" | "frommember";
|
|
2175
|
+
member: unknown;
|
|
2176
|
+
}, shape: {
|
|
2177
|
+
type: "BYRADIUS" | "byradius";
|
|
2178
|
+
radius: number;
|
|
2179
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2180
|
+
} | {
|
|
2181
|
+
type: "BYBOX" | "bybox";
|
|
2182
|
+
rect: {
|
|
2183
|
+
width: number;
|
|
2184
|
+
height: number;
|
|
2185
|
+
};
|
|
2186
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2187
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2188
|
+
count?: {
|
|
2189
|
+
limit: number;
|
|
2190
|
+
any?: boolean | undefined;
|
|
2191
|
+
} | undefined;
|
|
2192
|
+
withCoord?: boolean | undefined;
|
|
2193
|
+
withDist?: boolean | undefined;
|
|
2194
|
+
withHash?: boolean | undefined;
|
|
2195
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
2196
|
+
member: unknown;
|
|
2197
|
+
} & {
|
|
2198
|
+
coord?: {
|
|
2199
|
+
long: number;
|
|
2200
|
+
lat: number;
|
|
2201
|
+
} | undefined;
|
|
2202
|
+
dist?: number | undefined;
|
|
2203
|
+
hash?: string | undefined;
|
|
2204
|
+
})[]>]>;
|
|
2205
|
+
/**
|
|
2206
|
+
* @see https://redis.io/commands/geosearchstore
|
|
2207
|
+
*/
|
|
2208
|
+
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2209
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2210
|
+
coordinate: {
|
|
2211
|
+
lon: number;
|
|
2212
|
+
lat: number;
|
|
2213
|
+
};
|
|
2214
|
+
} | {
|
|
2215
|
+
type: "FROMMEMBER" | "frommember";
|
|
2216
|
+
member: unknown;
|
|
2217
|
+
}, shape: {
|
|
2218
|
+
type: "BYRADIUS" | "byradius";
|
|
2219
|
+
radius: number;
|
|
2220
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2221
|
+
} | {
|
|
2222
|
+
type: "BYBOX" | "bybox";
|
|
2223
|
+
rect: {
|
|
2224
|
+
width: number;
|
|
2225
|
+
height: number;
|
|
2226
|
+
};
|
|
2227
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2228
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2229
|
+
count?: {
|
|
2230
|
+
limit: number;
|
|
2231
|
+
any?: boolean | undefined;
|
|
2232
|
+
} | undefined;
|
|
2233
|
+
storeDist?: boolean | undefined;
|
|
2234
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2235
|
+
/**
|
|
2236
|
+
* @see https://redis.io/commands/json.get
|
|
2237
|
+
*/
|
|
2238
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2239
|
+
/**
|
|
2240
|
+
* @see https://redis.io/commands/json.mget
|
|
2241
|
+
*/
|
|
2242
|
+
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2243
|
+
/**
|
|
2244
|
+
* @see https://redis.io/commands/json.numincrby
|
|
2245
|
+
*/
|
|
2246
|
+
numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2247
|
+
/**
|
|
2248
|
+
* @see https://redis.io/commands/json.nummultby
|
|
2249
|
+
*/
|
|
2250
|
+
nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2251
|
+
/**
|
|
2252
|
+
* @see https://redis.io/commands/json.objkeys
|
|
2253
|
+
*/
|
|
2254
|
+
objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
|
|
2255
|
+
/**
|
|
2256
|
+
* @see https://redis.io/commands/json.objlen
|
|
2257
|
+
*/
|
|
2258
|
+
objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2259
|
+
/**
|
|
2260
|
+
* @see https://redis.io/commands/json.resp
|
|
2261
|
+
*/
|
|
2262
|
+
resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2263
|
+
/**
|
|
2264
|
+
* @see https://redis.io/commands/json.set
|
|
2265
|
+
*/
|
|
2266
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2267
|
+
nx: true;
|
|
2268
|
+
xx?: undefined;
|
|
2269
|
+
} | {
|
|
2270
|
+
nx?: undefined;
|
|
2271
|
+
xx: true;
|
|
2272
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2273
|
+
/**
|
|
2274
|
+
* @see https://redis.io/commands/json.strappend
|
|
2275
|
+
*/
|
|
2276
|
+
strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2277
|
+
/**
|
|
2278
|
+
* @see https://redis.io/commands/json.strlen
|
|
2279
|
+
*/
|
|
2280
|
+
strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
2281
|
+
/**
|
|
2282
|
+
* @see https://redis.io/commands/json.toggle
|
|
2283
|
+
*/
|
|
2284
|
+
toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2285
|
+
/**
|
|
2286
|
+
* @see https://redis.io/commands/json.type
|
|
2287
|
+
*/
|
|
2288
|
+
type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
2289
|
+
};
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* Creates a new script.
|
|
2294
|
+
*
|
|
2295
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
2296
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
2297
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
2298
|
+
*
|
|
2299
|
+
* @example
|
|
2300
|
+
* ```ts
|
|
2301
|
+
* const redis = new Redis({...})
|
|
2302
|
+
*
|
|
2303
|
+
* const script = redis.createScript<string>("return ARGV[1];")
|
|
2304
|
+
* const arg1 = await script.eval([], ["Hello World"])
|
|
2305
|
+
* expect(arg1, "Hello World")
|
|
2306
|
+
* ```
|
|
2307
|
+
*/
|
|
2308
|
+
declare class Script<TResult = unknown> {
|
|
2309
|
+
readonly script: string;
|
|
2310
|
+
readonly sha1: string;
|
|
2311
|
+
private readonly redis;
|
|
2312
|
+
constructor(redis: Redis, script: string);
|
|
2313
|
+
/**
|
|
2314
|
+
* Send an `EVAL` command to redis.
|
|
2315
|
+
*/
|
|
2316
|
+
eval(keys: string[], args: string[]): Promise<TResult>;
|
|
2317
|
+
/**
|
|
2318
|
+
* Calculates the sha1 hash of the script and then calls `EVALSHA`.
|
|
2319
|
+
*/
|
|
2320
|
+
evalsha(keys: string[], args: string[]): Promise<TResult>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Optimistically try to run `EVALSHA` first.
|
|
2323
|
+
* If the script is not loaded in redis, it will fall back and try again with `EVAL`.
|
|
2324
|
+
*
|
|
2325
|
+
* Following calls will be able to use the cached script
|
|
2326
|
+
*/
|
|
2327
|
+
exec(keys: string[], args: string[]): Promise<TResult>;
|
|
2328
|
+
/**
|
|
2329
|
+
* Compute the sha1 hash of the script and return its hex representation.
|
|
2330
|
+
*/
|
|
2331
|
+
private digest;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
/**
|
|
2335
|
+
* Serverless redis client for upstash.
|
|
2336
|
+
*/
|
|
2337
|
+
declare class Redis {
|
|
2338
|
+
protected client: Requester;
|
|
2339
|
+
protected opts?: CommandOptions<any, any>;
|
|
2340
|
+
protected enableTelemetry: boolean;
|
|
2341
|
+
/**
|
|
2342
|
+
* Create a new redis client
|
|
2343
|
+
*
|
|
2344
|
+
* @example
|
|
2345
|
+
* ```typescript
|
|
2346
|
+
* const redis = new Redis({
|
|
2347
|
+
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
2348
|
+
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
2349
|
+
* });
|
|
2350
|
+
* ```
|
|
2351
|
+
*/
|
|
2352
|
+
constructor(client: Requester, opts?: RedisOptions);
|
|
2353
|
+
get json(): {
|
|
2354
|
+
/**
|
|
2355
|
+
* @see https://redis.io/commands/json.arrappend
|
|
2356
|
+
*/
|
|
2357
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
2358
|
+
/**
|
|
2359
|
+
* @see https://redis.io/commands/json.arrindex
|
|
2360
|
+
*/
|
|
2361
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
2362
|
+
/**
|
|
2363
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
2364
|
+
*/
|
|
2365
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
2366
|
+
/**
|
|
2367
|
+
* @see https://redis.io/commands/json.arrlen
|
|
2368
|
+
*/
|
|
2369
|
+
arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
2370
|
+
/**
|
|
2371
|
+
* @see https://redis.io/commands/json.arrpop
|
|
2372
|
+
*/
|
|
2373
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
|
|
2374
|
+
/**
|
|
2375
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
2376
|
+
*/
|
|
2377
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
2378
|
+
/**
|
|
2379
|
+
* @see https://redis.io/commands/json.clear
|
|
2380
|
+
*/
|
|
2381
|
+
clear: (key: string, path?: string | undefined) => Promise<number>;
|
|
2382
|
+
/**
|
|
2383
|
+
* @see https://redis.io/commands/json.del
|
|
2384
|
+
*/
|
|
2385
|
+
del: (key: string, path?: string | undefined) => Promise<number>;
|
|
2386
|
+
/**
|
|
2387
|
+
* @see https://redis.io/commands/json.forget
|
|
2388
|
+
*/
|
|
2389
|
+
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
2390
|
+
/**
|
|
2391
|
+
* @see https://redis.io/commands/geoadd
|
|
2392
|
+
*/
|
|
2393
|
+
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
|
|
2394
|
+
/**
|
|
2395
|
+
* @see https://redis.io/commands/geopos
|
|
2396
|
+
*/
|
|
2397
|
+
geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
2398
|
+
lng: number;
|
|
2399
|
+
lat: number;
|
|
2400
|
+
}[]>;
|
|
2401
|
+
/**
|
|
2402
|
+
* @see https://redis.io/commands/geodist
|
|
2403
|
+
*/
|
|
2404
|
+
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
2405
|
+
/**
|
|
2406
|
+
* @see https://redis.io/commands/geohash
|
|
2407
|
+
*/
|
|
2408
|
+
geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
|
|
2409
|
+
/**
|
|
2410
|
+
* @see https://redis.io/commands/geosearch
|
|
2411
|
+
*/
|
|
2412
|
+
geosearch: (key: string, centerPoint: {
|
|
2413
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2414
|
+
coordinate: {
|
|
2415
|
+
lon: number;
|
|
2416
|
+
lat: number;
|
|
2417
|
+
};
|
|
2418
|
+
} | {
|
|
2419
|
+
type: "FROMMEMBER" | "frommember";
|
|
2420
|
+
member: unknown;
|
|
2421
|
+
}, shape: {
|
|
2422
|
+
type: "BYRADIUS" | "byradius";
|
|
2423
|
+
radius: number;
|
|
2424
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2425
|
+
} | {
|
|
2426
|
+
type: "BYBOX" | "bybox";
|
|
2427
|
+
rect: {
|
|
2428
|
+
width: number;
|
|
2429
|
+
height: number;
|
|
2430
|
+
};
|
|
2431
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2432
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2433
|
+
count?: {
|
|
2434
|
+
limit: number;
|
|
2435
|
+
any?: boolean | undefined;
|
|
2436
|
+
} | undefined;
|
|
2437
|
+
withCoord?: boolean | undefined;
|
|
2438
|
+
withDist?: boolean | undefined;
|
|
2439
|
+
withHash?: boolean | undefined;
|
|
2440
|
+
} | undefined) => Promise<({
|
|
2441
|
+
member: unknown;
|
|
2442
|
+
} & {
|
|
2443
|
+
coord?: {
|
|
2444
|
+
long: number;
|
|
2445
|
+
lat: number;
|
|
2446
|
+
} | undefined;
|
|
2447
|
+
dist?: number | undefined;
|
|
2448
|
+
hash?: string | undefined;
|
|
2449
|
+
})[]>;
|
|
2450
|
+
/**
|
|
2451
|
+
* @see https://redis.io/commands/geosearchstore
|
|
2452
|
+
*/
|
|
2453
|
+
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2454
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2455
|
+
coordinate: {
|
|
2456
|
+
lon: number;
|
|
2457
|
+
lat: number;
|
|
2458
|
+
};
|
|
2459
|
+
} | {
|
|
2460
|
+
type: "FROMMEMBER" | "frommember";
|
|
2461
|
+
member: unknown;
|
|
2462
|
+
}, shape: {
|
|
2463
|
+
type: "BYRADIUS" | "byradius";
|
|
2464
|
+
radius: number;
|
|
2465
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2466
|
+
} | {
|
|
2467
|
+
type: "BYBOX" | "bybox";
|
|
2468
|
+
rect: {
|
|
2469
|
+
width: number;
|
|
2470
|
+
height: number;
|
|
2471
|
+
};
|
|
2472
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2473
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2474
|
+
count?: {
|
|
2475
|
+
limit: number;
|
|
2476
|
+
any?: boolean | undefined;
|
|
2477
|
+
} | undefined;
|
|
2478
|
+
storeDist?: boolean | undefined;
|
|
2479
|
+
} | undefined) => Promise<number>;
|
|
2480
|
+
/**
|
|
2481
|
+
* @see https://redis.io/commands/json.get
|
|
2482
|
+
*/
|
|
2483
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
|
|
2484
|
+
/**
|
|
2485
|
+
* @see https://redis.io/commands/json.mget
|
|
2486
|
+
*/
|
|
2487
|
+
mget: (keys: string[], path: string) => Promise<any>;
|
|
2488
|
+
/**
|
|
2489
|
+
* @see https://redis.io/commands/json.numincrby
|
|
2490
|
+
*/
|
|
2491
|
+
numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
2492
|
+
/**
|
|
2493
|
+
* @see https://redis.io/commands/json.nummultby
|
|
2494
|
+
*/
|
|
2495
|
+
nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
2496
|
+
/**
|
|
2497
|
+
* @see https://redis.io/commands/json.objkeys
|
|
2498
|
+
*/
|
|
2499
|
+
objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
|
|
2500
|
+
/**
|
|
2501
|
+
* @see https://redis.io/commands/json.objlen
|
|
2502
|
+
*/
|
|
2503
|
+
objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
2504
|
+
/**
|
|
2505
|
+
* @see https://redis.io/commands/json.resp
|
|
2506
|
+
*/
|
|
2507
|
+
resp: (key: string, path?: string | undefined) => Promise<any>;
|
|
2508
|
+
/**
|
|
2509
|
+
* @see https://redis.io/commands/json.set
|
|
2510
|
+
*/
|
|
2511
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2512
|
+
nx: true;
|
|
2513
|
+
xx?: undefined;
|
|
2514
|
+
} | {
|
|
2515
|
+
nx?: undefined;
|
|
2516
|
+
xx: true;
|
|
2517
|
+
} | undefined) => Promise<"OK" | null>;
|
|
2518
|
+
/**
|
|
2519
|
+
* @see https://redis.io/commands/json.strappend
|
|
2520
|
+
*/
|
|
2521
|
+
strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
|
|
2522
|
+
/**
|
|
2523
|
+
* @see https://redis.io/commands/json.strlen
|
|
2524
|
+
*/
|
|
2525
|
+
strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
2526
|
+
/**
|
|
2527
|
+
* @see https://redis.io/commands/json.toggle
|
|
2528
|
+
*/
|
|
2529
|
+
toggle: (key: string, path: string) => Promise<number[]>;
|
|
2530
|
+
/**
|
|
2531
|
+
* @see https://redis.io/commands/json.type
|
|
2532
|
+
*/
|
|
2533
|
+
type: (key: string, path?: string | undefined) => Promise<string[]>;
|
|
2534
|
+
};
|
|
2535
|
+
/**
|
|
2536
|
+
* Wrap a new middleware around the HTTP client.
|
|
2537
|
+
*/
|
|
2538
|
+
use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
|
|
2539
|
+
/**
|
|
2540
|
+
* Technically this is not private, we can hide it from intellisense by doing this
|
|
2541
|
+
*/
|
|
2542
|
+
protected addTelemetry: (telemetry: Telemetry) => void;
|
|
2543
|
+
createScript(script: string): Script;
|
|
2544
|
+
/**
|
|
2545
|
+
* Create a new pipeline that allows you to send requests in bulk.
|
|
2546
|
+
*
|
|
2547
|
+
* @see {@link Pipeline}
|
|
2548
|
+
*/
|
|
2549
|
+
pipeline: () => Pipeline<[]>;
|
|
2550
|
+
/**
|
|
2551
|
+
* Create a new transaction to allow executing multiple steps atomically.
|
|
2552
|
+
*
|
|
2553
|
+
* All the commands in a transaction are serialized and executed sequentially. A request sent by
|
|
2554
|
+
* another client will never be served in the middle of the execution of a Redis Transaction. This
|
|
2555
|
+
* guarantees that the commands are executed as a single isolated operation.
|
|
2556
|
+
*
|
|
2557
|
+
* @see {@link Pipeline}
|
|
2558
|
+
*/
|
|
2559
|
+
multi: () => Pipeline<[]>;
|
|
2560
|
+
/**
|
|
2561
|
+
* @see https://redis.io/commands/append
|
|
2562
|
+
*/
|
|
2563
|
+
append: (key: string, value: string) => Promise<number>;
|
|
2564
|
+
/**
|
|
2565
|
+
* @see https://redis.io/commands/bitcount
|
|
2566
|
+
*/
|
|
2567
|
+
bitcount: (key: string, start: number, end: number) => Promise<number>;
|
|
2568
|
+
/**
|
|
2569
|
+
* @see https://redis.io/commands/bitop
|
|
2570
|
+
*/
|
|
2571
|
+
bitop: {
|
|
2572
|
+
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
|
|
2573
|
+
(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
|
|
2574
|
+
};
|
|
2575
|
+
/**
|
|
2576
|
+
* @see https://redis.io/commands/bitpos
|
|
2577
|
+
*/
|
|
2578
|
+
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
|
|
2579
|
+
/**
|
|
2580
|
+
* @see https://redis.io/commands/copy
|
|
2581
|
+
*/
|
|
2582
|
+
copy: (key: string, destinationKey: string, opts?: {
|
|
2583
|
+
replace: boolean;
|
|
2584
|
+
} | undefined) => Promise<"COPIED" | "NOT_COPIED">;
|
|
2585
|
+
/**
|
|
2586
|
+
* @see https://redis.io/commands/dbsize
|
|
2587
|
+
*/
|
|
2588
|
+
dbsize: () => Promise<number>;
|
|
2589
|
+
/**
|
|
2590
|
+
* @see https://redis.io/commands/decr
|
|
2591
|
+
*/
|
|
2592
|
+
decr: (key: string) => Promise<number>;
|
|
2593
|
+
/**
|
|
2594
|
+
* @see https://redis.io/commands/decrby
|
|
2595
|
+
*/
|
|
2596
|
+
decrby: (key: string, decrement: number) => Promise<number>;
|
|
2597
|
+
/**
|
|
2598
|
+
* @see https://redis.io/commands/del
|
|
2599
|
+
*/
|
|
2600
|
+
del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
|
|
2601
|
+
/**
|
|
2602
|
+
* @see https://redis.io/commands/echo
|
|
2603
|
+
*/
|
|
2604
|
+
echo: (message: string) => Promise<string>;
|
|
2605
|
+
/**
|
|
2606
|
+
* @see https://redis.io/commands/eval
|
|
2607
|
+
*/
|
|
2608
|
+
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
2609
|
+
/**
|
|
2610
|
+
* @see https://redis.io/commands/evalsha
|
|
2611
|
+
*/
|
|
2612
|
+
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
2613
|
+
/**
|
|
2614
|
+
* @see https://redis.io/commands/exists
|
|
2615
|
+
*/
|
|
2616
|
+
exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
|
|
2617
|
+
/**
|
|
2618
|
+
* @see https://redis.io/commands/expire
|
|
2619
|
+
*/
|
|
2620
|
+
expire: (key: string, seconds: number) => Promise<0 | 1>;
|
|
2621
|
+
/**
|
|
2622
|
+
* @see https://redis.io/commands/expireat
|
|
2623
|
+
*/
|
|
2624
|
+
expireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
2625
|
+
/**
|
|
2626
|
+
* @see https://redis.io/commands/flushall
|
|
2627
|
+
*/
|
|
2628
|
+
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
|
|
2629
|
+
/**
|
|
2630
|
+
* @see https://redis.io/commands/flushdb
|
|
2631
|
+
*/
|
|
2632
|
+
flushdb: (opts?: {
|
|
2633
|
+
async?: boolean | undefined;
|
|
2634
|
+
} | undefined) => Promise<"OK">;
|
|
2635
|
+
/**
|
|
2636
|
+
* @see https://redis.io/commands/get
|
|
2637
|
+
*/
|
|
2638
|
+
get: <TData>(key: string) => Promise<TData | null>;
|
|
2639
|
+
/**
|
|
2640
|
+
* @see https://redis.io/commands/getbit
|
|
2641
|
+
*/
|
|
2642
|
+
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
2643
|
+
/**
|
|
2644
|
+
* @see https://redis.io/commands/getdel
|
|
2645
|
+
*/
|
|
2646
|
+
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
2647
|
+
/**
|
|
2648
|
+
* @see https://redis.io/commands/getrange
|
|
2649
|
+
*/
|
|
2650
|
+
getrange: (key: string, start: number, end: number) => Promise<string>;
|
|
2651
|
+
/**
|
|
2652
|
+
* @see https://redis.io/commands/getset
|
|
2653
|
+
*/
|
|
2654
|
+
getset: <TData>(key: string, value: TData) => Promise<TData | null>;
|
|
2655
|
+
/**
|
|
2656
|
+
* @see https://redis.io/commands/hdel
|
|
2657
|
+
*/
|
|
2658
|
+
hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
|
|
2659
|
+
/**
|
|
2660
|
+
* @see https://redis.io/commands/hexists
|
|
2661
|
+
*/
|
|
2662
|
+
hexists: (key: string, field: string) => Promise<number>;
|
|
2663
|
+
/**
|
|
2664
|
+
* @see https://redis.io/commands/hget
|
|
2665
|
+
*/
|
|
2666
|
+
hget: <TData>(key: string, field: string) => Promise<TData | null>;
|
|
2667
|
+
/**
|
|
2668
|
+
* @see https://redis.io/commands/hgetall
|
|
2669
|
+
*/
|
|
2670
|
+
hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
|
|
2671
|
+
/**
|
|
2672
|
+
* @see https://redis.io/commands/hincrby
|
|
2673
|
+
*/
|
|
2674
|
+
hincrby: (key: string, field: string, increment: number) => Promise<number>;
|
|
2675
|
+
/**
|
|
2676
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
2677
|
+
*/
|
|
2678
|
+
hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
|
|
2679
|
+
/**
|
|
2680
|
+
* @see https://redis.io/commands/hkeys
|
|
2681
|
+
*/
|
|
2682
|
+
hkeys: (key: string) => Promise<string[]>;
|
|
2683
|
+
/**
|
|
2684
|
+
* @see https://redis.io/commands/hlen
|
|
2685
|
+
*/
|
|
2686
|
+
hlen: (key: string) => Promise<number>;
|
|
2687
|
+
/**
|
|
2688
|
+
* @see https://redis.io/commands/hmget
|
|
2689
|
+
*/
|
|
2690
|
+
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
|
|
2691
|
+
/**
|
|
2692
|
+
* @see https://redis.io/commands/hmset
|
|
2693
|
+
*/
|
|
2694
|
+
hmset: <TData>(key: string, kv: {
|
|
2695
|
+
[field: string]: TData;
|
|
2696
|
+
}) => Promise<"OK">;
|
|
2697
|
+
/**
|
|
2698
|
+
* @see https://redis.io/commands/hrandfield
|
|
2699
|
+
*/
|
|
2700
|
+
hrandfield: {
|
|
2701
|
+
(key: string): Promise<string>;
|
|
2702
|
+
(key: string, count: number): Promise<string[]>;
|
|
2703
|
+
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
2704
|
+
};
|
|
2705
|
+
/**
|
|
2706
|
+
* @see https://redis.io/commands/hscan
|
|
2707
|
+
*/
|
|
2708
|
+
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
2709
|
+
/**
|
|
2710
|
+
* @see https://redis.io/commands/hset
|
|
2711
|
+
*/
|
|
2712
|
+
hset: <TData>(key: string, kv: {
|
|
2713
|
+
[field: string]: TData;
|
|
2714
|
+
}) => Promise<number>;
|
|
2715
|
+
/**
|
|
2716
|
+
* @see https://redis.io/commands/hsetnx
|
|
2717
|
+
*/
|
|
2718
|
+
hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
|
|
2719
|
+
/**
|
|
2720
|
+
* @see https://redis.io/commands/hstrlen
|
|
2721
|
+
*/
|
|
2722
|
+
hstrlen: (key: string, field: string) => Promise<number>;
|
|
2723
|
+
/**
|
|
2724
|
+
* @see https://redis.io/commands/hvals
|
|
2725
|
+
*/
|
|
2726
|
+
hvals: (key: string) => Promise<any>;
|
|
2727
|
+
/**
|
|
2728
|
+
* @see https://redis.io/commands/incr
|
|
2729
|
+
*/
|
|
2730
|
+
incr: (key: string) => Promise<number>;
|
|
2731
|
+
/**
|
|
2732
|
+
* @see https://redis.io/commands/incrby
|
|
2733
|
+
*/
|
|
2734
|
+
incrby: (key: string, value: number) => Promise<number>;
|
|
2735
|
+
/**
|
|
2736
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
2737
|
+
*/
|
|
2738
|
+
incrbyfloat: (key: string, value: number) => Promise<number>;
|
|
2739
|
+
/**
|
|
2740
|
+
* @see https://redis.io/commands/keys
|
|
2741
|
+
*/
|
|
2742
|
+
keys: (pattern: string) => Promise<string[]>;
|
|
2743
|
+
/**
|
|
2744
|
+
* @see https://redis.io/commands/lindex
|
|
2745
|
+
*/
|
|
2746
|
+
lindex: (key: string, index: number) => Promise<any>;
|
|
2747
|
+
/**
|
|
2748
|
+
* @see https://redis.io/commands/linsert
|
|
2749
|
+
*/
|
|
2750
|
+
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
|
|
2751
|
+
/**
|
|
2752
|
+
* @see https://redis.io/commands/llen
|
|
2753
|
+
*/
|
|
2754
|
+
llen: (key: string) => Promise<number>;
|
|
2755
|
+
/**
|
|
2756
|
+
* @see https://redis.io/commands/lmove
|
|
2757
|
+
*/
|
|
2758
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
|
|
2759
|
+
/**
|
|
2760
|
+
* @see https://redis.io/commands/lpop
|
|
2761
|
+
*/
|
|
2762
|
+
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
2763
|
+
/**
|
|
2764
|
+
* @see https://redis.io/commands/lpos
|
|
2765
|
+
*/
|
|
2766
|
+
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
2767
|
+
rank?: number | undefined;
|
|
2768
|
+
count?: number | undefined;
|
|
2769
|
+
maxLen?: number | undefined;
|
|
2770
|
+
} | undefined) => Promise<TData>;
|
|
2771
|
+
/**
|
|
2772
|
+
* @see https://redis.io/commands/lpush
|
|
2773
|
+
*/
|
|
2774
|
+
lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
2775
|
+
/**
|
|
2776
|
+
* @see https://redis.io/commands/lpushx
|
|
2777
|
+
*/
|
|
2778
|
+
lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
2779
|
+
/**
|
|
2780
|
+
* @see https://redis.io/commands/lrange
|
|
2781
|
+
*/
|
|
2782
|
+
lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
|
|
2783
|
+
/**
|
|
2784
|
+
* @see https://redis.io/commands/lrem
|
|
2785
|
+
*/
|
|
2786
|
+
lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
|
|
2787
|
+
/**
|
|
2788
|
+
* @see https://redis.io/commands/lset
|
|
2789
|
+
*/
|
|
2790
|
+
lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
|
|
2791
|
+
/**
|
|
2792
|
+
* @see https://redis.io/commands/ltrim
|
|
2793
|
+
*/
|
|
2794
|
+
ltrim: (key: string, start: number, end: number) => Promise<"OK">;
|
|
2795
|
+
/**
|
|
2796
|
+
* @see https://redis.io/commands/mget
|
|
2797
|
+
*/
|
|
2798
|
+
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
|
|
2799
|
+
/**
|
|
2800
|
+
* @see https://redis.io/commands/mset
|
|
2801
|
+
*/
|
|
2802
|
+
mset: <TData>(kv: {
|
|
2803
|
+
[key: string]: TData;
|
|
2804
|
+
}) => Promise<"OK">;
|
|
2805
|
+
/**
|
|
2806
|
+
* @see https://redis.io/commands/msetnx
|
|
2807
|
+
*/
|
|
2808
|
+
msetnx: <TData>(kv: {
|
|
2809
|
+
[key: string]: TData;
|
|
2810
|
+
}) => Promise<number>;
|
|
2811
|
+
/**
|
|
2812
|
+
* @see https://redis.io/commands/persist
|
|
2813
|
+
*/
|
|
2814
|
+
persist: (key: string) => Promise<0 | 1>;
|
|
2815
|
+
/**
|
|
2816
|
+
* @see https://redis.io/commands/pexpire
|
|
2817
|
+
*/
|
|
2818
|
+
pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
|
|
2819
|
+
/**
|
|
2820
|
+
* @see https://redis.io/commands/pexpireat
|
|
2821
|
+
*/
|
|
2822
|
+
pexpireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
2823
|
+
/**
|
|
2824
|
+
* @see https://redis.io/commands/ping
|
|
2825
|
+
*/
|
|
2826
|
+
ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
|
|
2827
|
+
/**
|
|
2828
|
+
* @see https://redis.io/commands/psetex
|
|
2829
|
+
*/
|
|
2830
|
+
psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
|
|
2831
|
+
/**
|
|
2832
|
+
* @see https://redis.io/commands/pttl
|
|
2833
|
+
*/
|
|
2834
|
+
pttl: (key: string) => Promise<number>;
|
|
2835
|
+
/**
|
|
2836
|
+
* @see https://redis.io/commands/publish
|
|
2837
|
+
*/
|
|
2838
|
+
publish: (channel: string, message: unknown) => Promise<number>;
|
|
2839
|
+
/**
|
|
2840
|
+
* @see https://redis.io/commands/randomkey
|
|
2841
|
+
*/
|
|
2842
|
+
randomkey: () => Promise<string | null>;
|
|
2843
|
+
/**
|
|
2844
|
+
* @see https://redis.io/commands/rename
|
|
2845
|
+
*/
|
|
2846
|
+
rename: (source: string, destination: string) => Promise<"OK">;
|
|
2847
|
+
/**
|
|
2848
|
+
* @see https://redis.io/commands/renamenx
|
|
2849
|
+
*/
|
|
2850
|
+
renamenx: (source: string, destination: string) => Promise<0 | 1>;
|
|
2851
|
+
/**
|
|
2852
|
+
* @see https://redis.io/commands/rpop
|
|
2853
|
+
*/
|
|
2854
|
+
rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
2855
|
+
/**
|
|
2856
|
+
* @see https://redis.io/commands/rpush
|
|
2857
|
+
*/
|
|
2858
|
+
rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
2859
|
+
/**
|
|
2860
|
+
* @see https://redis.io/commands/rpushx
|
|
2861
|
+
*/
|
|
2862
|
+
rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
2863
|
+
/**
|
|
2864
|
+
* @see https://redis.io/commands/sadd
|
|
2865
|
+
*/
|
|
2866
|
+
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
2867
|
+
/**
|
|
2868
|
+
* @see https://redis.io/commands/scan
|
|
2869
|
+
*/
|
|
2870
|
+
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
|
|
2871
|
+
/**
|
|
2872
|
+
* @see https://redis.io/commands/scard
|
|
2873
|
+
*/
|
|
2874
|
+
scard: (key: string) => Promise<number>;
|
|
2875
|
+
/**
|
|
2876
|
+
* @see https://redis.io/commands/script-exists
|
|
2877
|
+
*/
|
|
2878
|
+
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
|
|
2879
|
+
/**
|
|
2880
|
+
* @see https://redis.io/commands/script-flush
|
|
2881
|
+
*/
|
|
2882
|
+
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
|
|
2883
|
+
/**
|
|
2884
|
+
* @see https://redis.io/commands/script-load
|
|
2885
|
+
*/
|
|
2886
|
+
scriptLoad: (script: string) => Promise<string>;
|
|
2887
|
+
/**
|
|
2888
|
+
* @see https://redis.io/commands/sdiff
|
|
2889
|
+
*/
|
|
2890
|
+
sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
2891
|
+
/**
|
|
2892
|
+
* @see https://redis.io/commands/sdiffstore
|
|
2893
|
+
*/
|
|
2894
|
+
sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
|
|
2895
|
+
/**
|
|
2896
|
+
* @see https://redis.io/commands/set
|
|
2897
|
+
*/
|
|
2898
|
+
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
|
|
2899
|
+
/**
|
|
2900
|
+
* @see https://redis.io/commands/setbit
|
|
2901
|
+
*/
|
|
2902
|
+
setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
|
|
2903
|
+
/**
|
|
2904
|
+
* @see https://redis.io/commands/setex
|
|
2905
|
+
*/
|
|
2906
|
+
setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
|
|
2907
|
+
/**
|
|
2908
|
+
* @see https://redis.io/commands/setnx
|
|
2909
|
+
*/
|
|
2910
|
+
setnx: <TData>(key: string, value: TData) => Promise<number>;
|
|
2911
|
+
/**
|
|
2912
|
+
* @see https://redis.io/commands/setrange
|
|
2913
|
+
*/
|
|
2914
|
+
setrange: (key: string, offset: number, value: string) => Promise<number>;
|
|
2915
|
+
/**
|
|
2916
|
+
* @see https://redis.io/commands/sinter
|
|
2917
|
+
*/
|
|
2918
|
+
sinter: (key: string, ...keys: string[]) => Promise<string[]>;
|
|
2919
|
+
/**
|
|
2920
|
+
* @see https://redis.io/commands/sinterstore
|
|
2921
|
+
*/
|
|
2922
|
+
sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
2923
|
+
/**
|
|
2924
|
+
* @see https://redis.io/commands/sismember
|
|
2925
|
+
*/
|
|
2926
|
+
sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
|
|
2927
|
+
/**
|
|
2928
|
+
* @see https://redis.io/commands/smismember
|
|
2929
|
+
*/
|
|
2930
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
|
|
2931
|
+
/**
|
|
2932
|
+
* @see https://redis.io/commands/smembers
|
|
2933
|
+
*/
|
|
2934
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
|
|
2935
|
+
/**
|
|
2936
|
+
* @see https://redis.io/commands/smove
|
|
2937
|
+
*/
|
|
2938
|
+
smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
|
|
2939
|
+
/**
|
|
2940
|
+
* @see https://redis.io/commands/spop
|
|
2941
|
+
*/
|
|
2942
|
+
spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
2943
|
+
/**
|
|
2944
|
+
* @see https://redis.io/commands/srandmember
|
|
2945
|
+
*/
|
|
2946
|
+
srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
2947
|
+
/**
|
|
2948
|
+
* @see https://redis.io/commands/srem
|
|
2949
|
+
*/
|
|
2950
|
+
srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
2951
|
+
/**
|
|
2952
|
+
* @see https://redis.io/commands/sscan
|
|
2953
|
+
*/
|
|
2954
|
+
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
2955
|
+
/**
|
|
2956
|
+
* @see https://redis.io/commands/strlen
|
|
2957
|
+
*/
|
|
2958
|
+
strlen: (key: string) => Promise<number>;
|
|
2959
|
+
/**
|
|
2960
|
+
* @see https://redis.io/commands/sunion
|
|
2961
|
+
*/
|
|
2962
|
+
sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
2963
|
+
/**
|
|
2964
|
+
* @see https://redis.io/commands/sunionstore
|
|
2965
|
+
*/
|
|
2966
|
+
sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
2967
|
+
/**
|
|
2968
|
+
* @see https://redis.io/commands/time
|
|
2969
|
+
*/
|
|
2970
|
+
time: () => Promise<[number, number]>;
|
|
2971
|
+
/**
|
|
2972
|
+
* @see https://redis.io/commands/touch
|
|
2973
|
+
*/
|
|
2974
|
+
touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
|
|
2975
|
+
/**
|
|
2976
|
+
* @see https://redis.io/commands/ttl
|
|
2977
|
+
*/
|
|
2978
|
+
ttl: (key: string) => Promise<number>;
|
|
2979
|
+
/**
|
|
2980
|
+
* @see https://redis.io/commands/type
|
|
2981
|
+
*/
|
|
2982
|
+
type: (key: string) => Promise<Type>;
|
|
2983
|
+
/**
|
|
2984
|
+
* @see https://redis.io/commands/unlink
|
|
2985
|
+
*/
|
|
2986
|
+
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
|
|
2987
|
+
/**
|
|
2988
|
+
* @see https://redis.io/commands/xadd
|
|
2989
|
+
*/
|
|
2990
|
+
xadd: (key: string, id: string, entries: {
|
|
2991
|
+
[field: string]: unknown;
|
|
2992
|
+
}, opts?: {
|
|
2993
|
+
nomkStream?: boolean | undefined;
|
|
2994
|
+
trim?: (({
|
|
2995
|
+
type: "MAXLEN" | "maxlen";
|
|
2996
|
+
threshold: number;
|
|
2997
|
+
} | {
|
|
2998
|
+
type: "MINID" | "minid";
|
|
2999
|
+
threshold: string;
|
|
3000
|
+
}) & ({
|
|
3001
|
+
comparison: "~";
|
|
3002
|
+
limit?: number | undefined;
|
|
3003
|
+
} | {
|
|
3004
|
+
comparison: "=";
|
|
3005
|
+
limit?: undefined;
|
|
3006
|
+
})) | undefined;
|
|
3007
|
+
} | undefined) => Promise<string>;
|
|
3008
|
+
/**
|
|
3009
|
+
* @see https://redis.io/commands/xrange
|
|
3010
|
+
*/
|
|
3011
|
+
xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
3012
|
+
/**
|
|
3013
|
+
* @see https://redis.io/commands/zadd
|
|
3014
|
+
*/
|
|
3015
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
|
|
3016
|
+
/**
|
|
3017
|
+
* @see https://redis.io/commands/zcard
|
|
3018
|
+
*/
|
|
3019
|
+
zcard: (key: string) => Promise<number>;
|
|
3020
|
+
/**
|
|
3021
|
+
* @see https://redis.io/commands/zcount
|
|
3022
|
+
*/
|
|
3023
|
+
zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
|
|
3024
|
+
/**
|
|
3025
|
+
* @see https://redis.io/commands/zdiffstore
|
|
3026
|
+
*/
|
|
3027
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
|
|
3028
|
+
/**
|
|
3029
|
+
* @see https://redis.io/commands/zincrby
|
|
3030
|
+
*/
|
|
3031
|
+
zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
|
|
3032
|
+
/**
|
|
3033
|
+
* @see https://redis.io/commands/zinterstore
|
|
3034
|
+
*/
|
|
3035
|
+
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
|
|
3036
|
+
/**
|
|
3037
|
+
* @see https://redis.io/commands/zlexcount
|
|
3038
|
+
*/
|
|
3039
|
+
zlexcount: (key: string, min: string, max: string) => Promise<number>;
|
|
3040
|
+
/**
|
|
3041
|
+
* @see https://redis.io/commands/zmscore
|
|
3042
|
+
*/
|
|
3043
|
+
zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
|
|
3044
|
+
/**
|
|
3045
|
+
* @see https://redis.io/commands/zpopmax
|
|
3046
|
+
*/
|
|
3047
|
+
zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
3048
|
+
/**
|
|
3049
|
+
* @see https://redis.io/commands/zpopmin
|
|
3050
|
+
*/
|
|
3051
|
+
zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
3052
|
+
/**
|
|
3053
|
+
* @see https://redis.io/commands/zrange
|
|
3054
|
+
*/
|
|
3055
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
3056
|
+
key: string,
|
|
3057
|
+
min: `(${string}` | `[${string}` | "-" | "+",
|
|
3058
|
+
max: `(${string}` | `[${string}` | "-" | "+",
|
|
3059
|
+
opts: {
|
|
3060
|
+
byLex: true;
|
|
3061
|
+
} & ZRangeCommandOptions
|
|
3062
|
+
] | [
|
|
3063
|
+
key: string,
|
|
3064
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
3065
|
+
max: number | `(${number}` | "-inf" | "+inf",
|
|
3066
|
+
opts: {
|
|
3067
|
+
byScore: true;
|
|
3068
|
+
} & ZRangeCommandOptions
|
|
3069
|
+
]) => Promise<TData>;
|
|
3070
|
+
/**
|
|
3071
|
+
* @see https://redis.io/commands/zrank
|
|
3072
|
+
*/
|
|
3073
|
+
zrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
3074
|
+
/**
|
|
3075
|
+
* @see https://redis.io/commands/zrem
|
|
3076
|
+
*/
|
|
3077
|
+
zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
3078
|
+
/**
|
|
3079
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
3080
|
+
*/
|
|
3081
|
+
zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
|
|
3082
|
+
/**
|
|
3083
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
3084
|
+
*/
|
|
3085
|
+
zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
|
|
3086
|
+
/**
|
|
3087
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
3088
|
+
*/
|
|
3089
|
+
zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
|
|
3090
|
+
/**
|
|
3091
|
+
* @see https://redis.io/commands/zrevrank
|
|
3092
|
+
*/
|
|
3093
|
+
zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
3094
|
+
/**
|
|
3095
|
+
* @see https://redis.io/commands/zscan
|
|
3096
|
+
*/
|
|
3097
|
+
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
3098
|
+
/**
|
|
3099
|
+
* @see https://redis.io/commands/zscore
|
|
3100
|
+
*/
|
|
3101
|
+
zscore: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
3102
|
+
/**
|
|
3103
|
+
* @see https://redis.io/commands/zunion
|
|
3104
|
+
*/
|
|
3105
|
+
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
|
|
3106
|
+
/**
|
|
3107
|
+
* @see https://redis.io/commands/zunionstore
|
|
3108
|
+
*/
|
|
3109
|
+
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
/**
|
|
3113
|
+
* @see https://redis.io/commands/zdiffstore
|
|
3114
|
+
*/
|
|
3115
|
+
declare class ZDiffStoreCommand extends Command<number, number> {
|
|
3116
|
+
constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
/**
|
|
3120
|
+
* @see https://redis.io/commands/zmscore
|
|
3121
|
+
*/
|
|
3122
|
+
declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
|
|
3123
|
+
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
export { IncrByCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetSetCommand as H, HDelCommand as I, HExistsCommand as J, HGetCommand as K, HGetAllCommand as L, HIncrByCommand as M, HIncrByFloatCommand as N, HKeysCommand as O, HLenCommand as P, HMGetCommand as Q, RedisOptions as R, HMSetCommand as S, HRandFieldCommand as T, UpstashRequest as U, HScanCommand as V, HSetCommand as W, HSetNXCommand as X, HStrLenCommand as Y, HValsCommand as Z, IncrCommand as _, RequesterConfig as a, SetNxCommand as a$, IncrByFloatCommand as a0, JsonArrAppendCommand as a1, JsonArrIndexCommand as a2, JsonArrInsertCommand as a3, JsonArrLenCommand as a4, JsonArrPopCommand as a5, JsonArrTrimCommand as a6, JsonClearCommand as a7, JsonDelCommand as a8, JsonForgetCommand as a9, MSetNXCommand as aA, PersistCommand as aB, PExpireCommand as aC, PExpireAtCommand as aD, PingCommand as aE, PSetEXCommand as aF, PTtlCommand as aG, PublishCommand as aH, RandomKeyCommand as aI, RenameCommand as aJ, RenameNXCommand as aK, RPopCommand as aL, RPushCommand as aM, RPushXCommand as aN, SAddCommand as aO, ScanCommand as aP, ScanCommandOptions as aQ, SCardCommand as aR, ScriptExistsCommand as aS, ScriptFlushCommand as aT, ScriptLoadCommand as aU, SDiffCommand as aV, SDiffStoreCommand as aW, SetCommand as aX, SetCommandOptions as aY, SetBitCommand as aZ, SetExCommand as a_, JsonGetCommand as aa, JsonMGetCommand as ab, JsonNumIncrByCommand as ac, JsonNumMultByCommand as ad, JsonObjKeysCommand as ae, JsonObjLenCommand as af, JsonRespCommand as ag, JsonSetCommand as ah, JsonStrAppendCommand as ai, JsonStrLenCommand as aj, JsonToggleCommand as ak, JsonTypeCommand as al, KeysCommand as am, LIndexCommand as an, LInsertCommand as ao, LLenCommand as ap, LMoveCommand as aq, LPopCommand as ar, LPushCommand as as, LPushXCommand as at, LRangeCommand as au, LRemCommand as av, LSetCommand as aw, LTrimCommand as ax, MGetCommand as ay, MSetCommand as az, Redis as b, SetRangeCommand as b0, SInterCommand as b1, SInterStoreCommand as b2, SIsMemberCommand as b3, SMembersCommand as b4, SMIsMemberCommand as b5, SMoveCommand as b6, SPopCommand as b7, SRandMemberCommand as b8, SRemCommand as b9, ZRangeCommand as bA, ZRangeCommandOptions as bB, ZRankCommand as bC, ZRemCommand as bD, ZRemRangeByLexCommand as bE, ZRemRangeByRankCommand as bF, ZRemRangeByScoreCommand as bG, ZRevRankCommand as bH, ZScanCommand as bI, ZScoreCommand as bJ, ZUnionCommand as bK, ZUnionCommandOptions as bL, ZUnionStoreCommand as bM, ZUnionStoreCommandOptions as bN, SScanCommand as ba, StrLenCommand as bb, SUnionCommand as bc, SUnionStoreCommand as bd, TimeCommand as be, TouchCommand as bf, TtlCommand as bg, Type as bh, TypeCommand as bi, UnlinkCommand as bj, XAddCommand as bk, XRangeCommand as bl, ScoreMember as bm, ZAddCommandOptions as bn, ZAddCommandOptionsWithIncr as bo, ZAddCommand as bp, ZCardCommand as bq, ZCountCommand as br, ZDiffStoreCommand as bs, ZIncrByCommand as bt, ZInterStoreCommand as bu, ZInterStoreCommandOptions as bv, ZLexCountCommand as bw, ZMScoreCommand as bx, ZPopMaxCommand as by, ZPopMinCommand as bz, Requester as c, UpstashResponse as d, BitOpCommand as e, BitPosCommand as f, DecrCommand as g, DecrByCommand as h, DelCommand as i, EvalCommand as j, EvalshaCommand as k, ExistsCommand as l, ExpireCommand as m, ExpireAtCommand as n, FlushDBCommand as o, GeoAddCommandOptions as p, GeoMember as q, GeoDistCommand as r, GeoHashCommand as s, GeoPosCommand as t, GeoSearchCommand as u, GeoSearchStoreCommand as v, GetCommand as w, GetBitCommand as x, GetDelCommand as y, GetRangeCommand as z };
|