@upstash/redis 1.40.0 → 1.41.0
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 +5 -0
- package/{chunk-RLVWMRRX.mjs → chunk-CGMWROAN.mjs} +557 -4
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +557 -4
- package/cloudflare.mjs +1 -1
- package/docs/advanced.mdx +83 -0
- package/docs/commands/array/arcount.mdx +28 -0
- package/docs/commands/array/ardel.mdx +30 -0
- package/docs/commands/array/ardelrange.mdx +32 -0
- package/docs/commands/array/arget.mdx +33 -0
- package/docs/commands/array/argetrange.mdx +38 -0
- package/docs/commands/array/argrep.mdx +69 -0
- package/docs/commands/array/arinfo.mdx +49 -0
- package/docs/commands/array/arinsert.mdx +32 -0
- package/docs/commands/array/arlastitems.mdx +40 -0
- package/docs/commands/array/arlen.mdx +28 -0
- package/docs/commands/array/armget.mdx +31 -0
- package/docs/commands/array/armset.mdx +31 -0
- package/docs/commands/array/arnext.mdx +25 -0
- package/docs/commands/array/arop.mdx +44 -0
- package/docs/commands/array/arring.mdx +36 -0
- package/docs/commands/array/arscan.mdx +42 -0
- package/docs/commands/array/arseek.mdx +34 -0
- package/docs/commands/array/arset.mdx +35 -0
- package/docs/commands/auth/echo.mdx +24 -0
- package/docs/commands/auth/ping.mdx +21 -0
- package/docs/commands/bitmap/bitcount.mdx +39 -0
- package/docs/commands/bitmap/bitop.mdx +142 -0
- package/docs/commands/bitmap/bitpos.mdx +39 -0
- package/docs/commands/bitmap/getbit.mdx +28 -0
- package/docs/commands/bitmap/setbit.mdx +31 -0
- package/docs/commands/connection/client_setinfo.mdx +91 -0
- package/docs/commands/functions/call.mdx +72 -0
- package/docs/commands/functions/call_ro.mdx +57 -0
- package/docs/commands/functions/delete.mdx +22 -0
- package/docs/commands/functions/flush.mdx +16 -0
- package/docs/commands/functions/list.mdx +72 -0
- package/docs/commands/functions/load.mdx +64 -0
- package/docs/commands/functions/stats.mdx +46 -0
- package/docs/commands/generic/del.mdx +29 -0
- package/docs/commands/generic/exists.mdx +26 -0
- package/docs/commands/generic/expire.mdx +29 -0
- package/docs/commands/generic/expireat.mdx +29 -0
- package/docs/commands/generic/keys.mdx +32 -0
- package/docs/commands/generic/persist.mdx +23 -0
- package/docs/commands/generic/pexpire.mdx +28 -0
- package/docs/commands/generic/pexpireat.mdx +29 -0
- package/docs/commands/generic/pttl.mdx +23 -0
- package/docs/commands/generic/randomkey.mdx +21 -0
- package/docs/commands/generic/rename.mdx +28 -0
- package/docs/commands/generic/renamenx.mdx +28 -0
- package/docs/commands/generic/scan.mdx +38 -0
- package/docs/commands/generic/touch.mdx +23 -0
- package/docs/commands/generic/ttl.mdx +23 -0
- package/docs/commands/generic/type.mdx +27 -0
- package/docs/commands/generic/unlink.mdx +29 -0
- package/docs/commands/hash/hdel.mdx +28 -0
- package/docs/commands/hash/hexists.mdx +30 -0
- package/docs/commands/hash/hexpire.mdx +49 -0
- package/docs/commands/hash/hexpireat.mdx +48 -0
- package/docs/commands/hash/hexpiretime.mdx +35 -0
- package/docs/commands/hash/hget.mdx +29 -0
- package/docs/commands/hash/hgetall.mdx +27 -0
- package/docs/commands/hash/hgetdel.mdx +67 -0
- package/docs/commands/hash/hgetex.mdx +123 -0
- package/docs/commands/hash/hincrby.mdx +34 -0
- package/docs/commands/hash/hincrbyfloat.mdx +34 -0
- package/docs/commands/hash/hkeys.mdx +28 -0
- package/docs/commands/hash/hlen.mdx +28 -0
- package/docs/commands/hash/hmget.mdx +33 -0
- package/docs/commands/hash/hpersist.mdx +37 -0
- package/docs/commands/hash/hpexpire.mdx +50 -0
- package/docs/commands/hash/hpexpireat.mdx +48 -0
- package/docs/commands/hash/hpexpiretime.mdx +35 -0
- package/docs/commands/hash/hpttl.mdx +35 -0
- package/docs/commands/hash/hrandfield.mdx +57 -0
- package/docs/commands/hash/hscan.mdx +65 -0
- package/docs/commands/hash/hset.mdx +32 -0
- package/docs/commands/hash/hsetex.mdx +186 -0
- package/docs/commands/hash/hsetnx.mdx +30 -0
- package/docs/commands/hash/hstrlen.mdx +28 -0
- package/docs/commands/hash/httl.mdx +35 -0
- package/docs/commands/hash/hvals.mdx +29 -0
- package/docs/commands/json/arrappend.mdx +35 -0
- package/docs/commands/json/arrindex.mdx +37 -0
- package/docs/commands/json/arrinsert.mdx +34 -0
- package/docs/commands/json/arrlen.mdx +26 -0
- package/docs/commands/json/arrpop.mdx +36 -0
- package/docs/commands/json/arrtrim.mdx +34 -0
- package/docs/commands/json/clear.mdx +30 -0
- package/docs/commands/json/del.mdx +26 -0
- package/docs/commands/json/forget.mdx +26 -0
- package/docs/commands/json/get.mdx +53 -0
- package/docs/commands/json/merge.mdx +32 -0
- package/docs/commands/json/mget.mdx +27 -0
- package/docs/commands/json/mset.mdx +26 -0
- package/docs/commands/json/numincrby.mdx +33 -0
- package/docs/commands/json/nummultby.mdx +33 -0
- package/docs/commands/json/objkeys.mdx +27 -0
- package/docs/commands/json/objlen.mdx +27 -0
- package/docs/commands/json/set.mdx +42 -0
- package/docs/commands/json/strappend.mdx +32 -0
- package/docs/commands/json/strlen.mdx +26 -0
- package/docs/commands/json/toggle.mdx +28 -0
- package/docs/commands/json/type.mdx +28 -0
- package/docs/commands/list/lindex.mdx +32 -0
- package/docs/commands/list/linsert.mdx +41 -0
- package/docs/commands/list/llen.mdx +26 -0
- package/docs/commands/list/lmove.mdx +34 -0
- package/docs/commands/list/lpop.mdx +37 -0
- package/docs/commands/list/lpos.mdx +56 -0
- package/docs/commands/list/lpush.mdx +32 -0
- package/docs/commands/list/lpushx.mdx +38 -0
- package/docs/commands/list/lrange.mdx +37 -0
- package/docs/commands/list/lrem.mdx +33 -0
- package/docs/commands/list/lset.mdx +34 -0
- package/docs/commands/list/ltrim.mdx +33 -0
- package/docs/commands/list/rpop.mdx +37 -0
- package/docs/commands/list/rpush.mdx +32 -0
- package/docs/commands/list/rpushx.mdx +38 -0
- package/docs/commands/overview.mdx +692 -0
- package/docs/commands/pubsub/psubscribe.mdx +36 -0
- package/docs/commands/pubsub/publish.mdx +27 -0
- package/docs/commands/pubsub/subscribe.mdx +28 -0
- package/docs/commands/scripts/eval.mdx +36 -0
- package/docs/commands/scripts/eval_ro.mdx +36 -0
- package/docs/commands/scripts/evalsha.mdx +36 -0
- package/docs/commands/scripts/evalsha_ro.mdx +36 -0
- package/docs/commands/scripts/script_exists.mdx +26 -0
- package/docs/commands/scripts/script_flush.mdx +28 -0
- package/docs/commands/scripts/script_load.mdx +28 -0
- package/docs/commands/server/dbsize.mdx +22 -0
- package/docs/commands/server/flushall.mdx +25 -0
- package/docs/commands/server/flushdb.mdx +25 -0
- package/docs/commands/set/sadd.mdx +32 -0
- package/docs/commands/set/scard.mdx +26 -0
- package/docs/commands/set/sdiff.mdx +27 -0
- package/docs/commands/set/sdiffstore.mdx +32 -0
- package/docs/commands/set/sinter.mdx +27 -0
- package/docs/commands/set/sinterstore.mdx +33 -0
- package/docs/commands/set/sismember.mdx +30 -0
- package/docs/commands/set/smembers.mdx +25 -0
- package/docs/commands/set/smismember.mdx +31 -0
- package/docs/commands/set/smove.mdx +34 -0
- package/docs/commands/set/spop.mdx +36 -0
- package/docs/commands/set/srandmember.mdx +36 -0
- package/docs/commands/set/srem.mdx +29 -0
- package/docs/commands/set/sscan.mdx +39 -0
- package/docs/commands/set/sunion.mdx +27 -0
- package/docs/commands/set/sunionstore.mdx +33 -0
- package/docs/commands/stream/xack.mdx +37 -0
- package/docs/commands/stream/xackdel.mdx +211 -0
- package/docs/commands/stream/xadd.mdx +137 -0
- package/docs/commands/stream/xautoclaim.mdx +80 -0
- package/docs/commands/stream/xclaim.mdx +84 -0
- package/docs/commands/stream/xdel.mdx +34 -0
- package/docs/commands/stream/xdelex.mdx +119 -0
- package/docs/commands/stream/xgroup.mdx +141 -0
- package/docs/commands/stream/xinfo.mdx +77 -0
- package/docs/commands/stream/xlen.mdx +22 -0
- package/docs/commands/stream/xpending.mdx +75 -0
- package/docs/commands/stream/xrange.mdx +59 -0
- package/docs/commands/stream/xread.mdx +65 -0
- package/docs/commands/stream/xreadgroup.mdx +87 -0
- package/docs/commands/stream/xrevrange.mdx +65 -0
- package/docs/commands/stream/xtrim.mdx +75 -0
- package/docs/commands/string/append.mdx +28 -0
- package/docs/commands/string/decr.mdx +27 -0
- package/docs/commands/string/decrby.mdx +30 -0
- package/docs/commands/string/get.mdx +34 -0
- package/docs/commands/string/getdel.mdx +29 -0
- package/docs/commands/string/getrange.mdx +34 -0
- package/docs/commands/string/getset.mdx +28 -0
- package/docs/commands/string/incr.mdx +27 -0
- package/docs/commands/string/incrby.mdx +30 -0
- package/docs/commands/string/incrbyfloat.mdx +30 -0
- package/docs/commands/string/mget.mdx +31 -0
- package/docs/commands/string/mset.mdx +32 -0
- package/docs/commands/string/msetnx.mdx +29 -0
- package/docs/commands/string/set.mdx +79 -0
- package/docs/commands/string/setrange.mdx +38 -0
- package/docs/commands/string/strlen.mdx +26 -0
- package/docs/commands/transaction.mdx +22 -0
- package/docs/commands/zset/zadd.mdx +102 -0
- package/docs/commands/zset/zcard.mdx +31 -0
- package/docs/commands/zset/zcount.mdx +47 -0
- package/docs/commands/zset/zdiffstore.mdx +33 -0
- package/docs/commands/zset/zincrby.mdx +37 -0
- package/docs/commands/zset/zinterstore.mdx +98 -0
- package/docs/commands/zset/zlexcount.mdx +43 -0
- package/docs/commands/zset/zmscore.mdx +34 -0
- package/docs/commands/zset/zpopmax.mdx +25 -0
- package/docs/commands/zset/zpopmin.mdx +25 -0
- package/docs/commands/zset/zrange.mdx +85 -0
- package/docs/commands/zset/zrank.mdx +29 -0
- package/docs/commands/zset/zrem.mdx +33 -0
- package/docs/commands/zset/zremrangebylex.mdx +32 -0
- package/docs/commands/zset/zremrangebyrank.mdx +32 -0
- package/docs/commands/zset/zremrangebyscore.mdx +32 -0
- package/docs/commands/zset/zrevrank.mdx +29 -0
- package/docs/commands/zset/zscan.mdx +58 -0
- package/docs/commands/zset/zscore.mdx +34 -0
- package/docs/commands/zset/zunionstore.mdx +98 -0
- package/docs/deployment.mdx +117 -0
- package/docs/developing.mdx +118 -0
- package/docs/getstarted.mdx +68 -0
- package/docs/overview.mdx +29 -0
- package/docs/pipelining/auto-pipeline.mdx +108 -0
- package/docs/pipelining/pipeline-transaction.mdx +65 -0
- package/docs/retries.mdx +24 -0
- package/docs/troubleshooting.mdx +80 -0
- package/{error-BNzLTXJG.d.mts → error-4e36-PC0.d.mts} +838 -8
- package/{error-BNzLTXJG.d.ts → error-4e36-PC0.d.ts} +838 -8
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +557 -4
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +34 -2
- package/nodejs.d.ts +34 -2
- package/nodejs.js +586 -4
- package/nodejs.mjs +30 -1
- package/package.json +16 -5
- package/src/pkg/auto-pipeline.ts +284 -0
- package/src/pkg/commands/append.ts +12 -0
- package/src/pkg/commands/arcount.ts +14 -0
- package/src/pkg/commands/ardel.ts +19 -0
- package/src/pkg/commands/ardelrange.ts +19 -0
- package/src/pkg/commands/arget.ts +17 -0
- package/src/pkg/commands/argetrange.ts +20 -0
- package/src/pkg/commands/argrep.ts +109 -0
- package/src/pkg/commands/arinfo.ts +88 -0
- package/src/pkg/commands/arinsert.ts +24 -0
- package/src/pkg/commands/arlastitems.ts +29 -0
- package/src/pkg/commands/arlen.ts +23 -0
- package/src/pkg/commands/armget.ts +18 -0
- package/src/pkg/commands/armset.ts +26 -0
- package/src/pkg/commands/arnext.ts +20 -0
- package/src/pkg/commands/arop.ts +48 -0
- package/src/pkg/commands/arring.ts +23 -0
- package/src/pkg/commands/arscan.ts +44 -0
- package/src/pkg/commands/arseek.ts +17 -0
- package/src/pkg/commands/arset.ts +20 -0
- package/src/pkg/commands/bitcount.ts +30 -0
- package/src/pkg/commands/bitfield.ts +50 -0
- package/src/pkg/commands/bitop.ts +35 -0
- package/src/pkg/commands/bitpos.ts +15 -0
- package/src/pkg/commands/client_setinfo.ts +17 -0
- package/src/pkg/commands/command.ts +142 -0
- package/src/pkg/commands/copy.ts +22 -0
- package/src/pkg/commands/dbsize.ts +12 -0
- package/src/pkg/commands/decr.ts +12 -0
- package/src/pkg/commands/decrby.ts +12 -0
- package/src/pkg/commands/del.ts +12 -0
- package/src/pkg/commands/echo.ts +12 -0
- package/src/pkg/commands/eval.ts +18 -0
- package/src/pkg/commands/evalRo.ts +18 -0
- package/src/pkg/commands/evalsha.ts +18 -0
- package/src/pkg/commands/evalshaRo.ts +18 -0
- package/src/pkg/commands/exec.ts +23 -0
- package/src/pkg/commands/exists.ts +12 -0
- package/src/pkg/commands/expire.ts +13 -0
- package/src/pkg/commands/expireat.ts +16 -0
- package/src/pkg/commands/fcall.ts +15 -0
- package/src/pkg/commands/fcall_ro.ts +18 -0
- package/src/pkg/commands/flushall.ts +15 -0
- package/src/pkg/commands/flushdb.ts +15 -0
- package/src/pkg/commands/function_delete.ts +12 -0
- package/src/pkg/commands/function_flush.ts +12 -0
- package/src/pkg/commands/function_list.ts +77 -0
- package/src/pkg/commands/function_load.ts +31 -0
- package/src/pkg/commands/function_stats.ts +42 -0
- package/src/pkg/commands/geo_add.ts +54 -0
- package/src/pkg/commands/geo_dist.ts +19 -0
- package/src/pkg/commands/geo_hash.ts +23 -0
- package/src/pkg/commands/geo_pos.ts +39 -0
- package/src/pkg/commands/geo_search.ts +140 -0
- package/src/pkg/commands/geo_search_store.ts +69 -0
- package/src/pkg/commands/get.ts +15 -0
- package/src/pkg/commands/getbit.ts +12 -0
- package/src/pkg/commands/getdel.ts +15 -0
- package/src/pkg/commands/getex.ts +36 -0
- package/src/pkg/commands/getrange.ts +15 -0
- package/src/pkg/commands/getset.ts +15 -0
- package/src/pkg/commands/hdel.ts +12 -0
- package/src/pkg/commands/hexists.ts +12 -0
- package/src/pkg/commands/hexpire.ts +30 -0
- package/src/pkg/commands/hexpireat.ts +30 -0
- package/src/pkg/commands/hexpiretime.ts +13 -0
- package/src/pkg/commands/hget.ts +18 -0
- package/src/pkg/commands/hgetall.ts +44 -0
- package/src/pkg/commands/hgetdel.ts +30 -0
- package/src/pkg/commands/hgetex.ts +56 -0
- package/src/pkg/commands/hincrby.ts +15 -0
- package/src/pkg/commands/hincrbyfloat.ts +15 -0
- package/src/pkg/commands/hkeys.ts +12 -0
- package/src/pkg/commands/hlen.ts +12 -0
- package/src/pkg/commands/hmget.ts +53 -0
- package/src/pkg/commands/hmset.ts +14 -0
- package/src/pkg/commands/hpersist.ts +13 -0
- package/src/pkg/commands/hpexpire.ts +30 -0
- package/src/pkg/commands/hpexpireat.ts +30 -0
- package/src/pkg/commands/hpexpiretime.ts +13 -0
- package/src/pkg/commands/hpttl.ts +13 -0
- package/src/pkg/commands/hrandfield.ts +52 -0
- package/src/pkg/commands/hscan.ts +31 -0
- package/src/pkg/commands/hset.ts +15 -0
- package/src/pkg/commands/hsetex.ts +59 -0
- package/src/pkg/commands/hsetnx.ts +15 -0
- package/src/pkg/commands/hstrlen.ts +12 -0
- package/src/pkg/commands/httl.ts +13 -0
- package/src/pkg/commands/hvals.ts +12 -0
- package/src/pkg/commands/incr.ts +12 -0
- package/src/pkg/commands/incrby.ts +12 -0
- package/src/pkg/commands/incrbyfloat.ts +12 -0
- package/src/pkg/commands/json_arrappend.ts +18 -0
- package/src/pkg/commands/json_arrindex.ts +15 -0
- package/src/pkg/commands/json_arrinsert.ts +18 -0
- package/src/pkg/commands/json_arrlen.ts +15 -0
- package/src/pkg/commands/json_arrpop.ts +15 -0
- package/src/pkg/commands/json_arrtrim.ts +19 -0
- package/src/pkg/commands/json_clear.ts +12 -0
- package/src/pkg/commands/json_del.ts +12 -0
- package/src/pkg/commands/json_forget.ts +12 -0
- package/src/pkg/commands/json_get.ts +45 -0
- package/src/pkg/commands/json_merge.ts +18 -0
- package/src/pkg/commands/json_mget.ts +12 -0
- package/src/pkg/commands/json_mset.ts +27 -0
- package/src/pkg/commands/json_numincrby.ts +15 -0
- package/src/pkg/commands/json_nummultby.ts +15 -0
- package/src/pkg/commands/json_objkeys.ts +15 -0
- package/src/pkg/commands/json_objlen.ts +15 -0
- package/src/pkg/commands/json_resp.ts +11 -0
- package/src/pkg/commands/json_set.ts +35 -0
- package/src/pkg/commands/json_strappend.ts +15 -0
- package/src/pkg/commands/json_strlen.ts +15 -0
- package/src/pkg/commands/json_toggle.ts +12 -0
- package/src/pkg/commands/json_type.ts +12 -0
- package/src/pkg/commands/keys.ts +12 -0
- package/src/pkg/commands/lindex.ts +11 -0
- package/src/pkg/commands/linsert.ts +10 -0
- package/src/pkg/commands/llen.ts +12 -0
- package/src/pkg/commands/lmove.ts +20 -0
- package/src/pkg/commands/lmpop.ts +19 -0
- package/src/pkg/commands/lpop.ts +18 -0
- package/src/pkg/commands/lpos.ts +26 -0
- package/src/pkg/commands/lpush.ts +12 -0
- package/src/pkg/commands/lpushx.ts +12 -0
- package/src/pkg/commands/lrange.ts +11 -0
- package/src/pkg/commands/lrem.ts +10 -0
- package/src/pkg/commands/lset.ts +8 -0
- package/src/pkg/commands/ltrim.ts +8 -0
- package/src/pkg/commands/mget.ts +15 -0
- package/src/pkg/commands/mod.ts +222 -0
- package/src/pkg/commands/mset.ts +12 -0
- package/src/pkg/commands/msetnx.ts +12 -0
- package/src/pkg/commands/persist.ts +12 -0
- package/src/pkg/commands/pexpire.ts +16 -0
- package/src/pkg/commands/pexpireat.ts +16 -0
- package/src/pkg/commands/pfadd.ts +11 -0
- package/src/pkg/commands/pfcount.ts +11 -0
- package/src/pkg/commands/pfmerge.ts +11 -0
- package/src/pkg/commands/ping.ts +15 -0
- package/src/pkg/commands/psetex.ts +14 -0
- package/src/pkg/commands/psubscribe.ts +26 -0
- package/src/pkg/commands/pttl.ts +12 -0
- package/src/pkg/commands/publish.ts +12 -0
- package/src/pkg/commands/randomkey.ts +12 -0
- package/src/pkg/commands/rename.ts +12 -0
- package/src/pkg/commands/renamenx.ts +12 -0
- package/src/pkg/commands/rpop.ts +21 -0
- package/src/pkg/commands/rpush.ts +12 -0
- package/src/pkg/commands/rpushx.ts +12 -0
- package/src/pkg/commands/sadd.ts +15 -0
- package/src/pkg/commands/scan.ts +63 -0
- package/src/pkg/commands/scard.ts +11 -0
- package/src/pkg/commands/script_exists.ts +15 -0
- package/src/pkg/commands/script_flush.ts +22 -0
- package/src/pkg/commands/script_load.ts +12 -0
- package/src/pkg/commands/sdiff.ts +11 -0
- package/src/pkg/commands/sdiffstore.ts +14 -0
- package/src/pkg/commands/search/command-builder.ts +162 -0
- package/src/pkg/commands/search/index.ts +4 -0
- package/src/pkg/commands/search/schema-builder.ts +320 -0
- package/src/pkg/commands/search/search.ts +218 -0
- package/src/pkg/commands/search/types.ts +1029 -0
- package/src/pkg/commands/search/utils.ts +275 -0
- package/src/pkg/commands/set.ts +52 -0
- package/src/pkg/commands/setbit.ts +15 -0
- package/src/pkg/commands/setex.ts +11 -0
- package/src/pkg/commands/setnx.ts +11 -0
- package/src/pkg/commands/setrange.ts +15 -0
- package/src/pkg/commands/sinter.ts +11 -0
- package/src/pkg/commands/sintercard.ts +19 -0
- package/src/pkg/commands/sinterstore.ts +14 -0
- package/src/pkg/commands/sismember.ts +11 -0
- package/src/pkg/commands/smembers.ts +12 -0
- package/src/pkg/commands/smismember.ts +17 -0
- package/src/pkg/commands/smove.ts +14 -0
- package/src/pkg/commands/spop.ts +18 -0
- package/src/pkg/commands/srandmember.ts +18 -0
- package/src/pkg/commands/srem.ts +11 -0
- package/src/pkg/commands/sscan.ts +31 -0
- package/src/pkg/commands/strlen.ts +12 -0
- package/src/pkg/commands/subscribe.ts +254 -0
- package/src/pkg/commands/sunion.ts +12 -0
- package/src/pkg/commands/sunionstore.ts +15 -0
- package/src/pkg/commands/time.ts +10 -0
- package/src/pkg/commands/touch.ts +12 -0
- package/src/pkg/commands/ttl.ts +12 -0
- package/src/pkg/commands/type.ts +13 -0
- package/src/pkg/commands/types.ts +201 -0
- package/src/pkg/commands/unlink.ts +12 -0
- package/src/pkg/commands/vector/index.ts +11 -0
- package/src/pkg/commands/vector/types.ts +63 -0
- package/src/pkg/commands/vector/utils.ts +67 -0
- package/src/pkg/commands/vector/vector.ts +131 -0
- package/src/pkg/commands/vector_add.ts +18 -0
- package/src/pkg/commands/vector_count.ts +11 -0
- package/src/pkg/commands/vector_create.ts +28 -0
- package/src/pkg/commands/vector_del.ts +13 -0
- package/src/pkg/commands/vector_drop.ts +13 -0
- package/src/pkg/commands/vector_get.ts +18 -0
- package/src/pkg/commands/vector_info.ts +25 -0
- package/src/pkg/commands/vector_query.ts +24 -0
- package/src/pkg/commands/xack.ts +16 -0
- package/src/pkg/commands/xackdel.ts +21 -0
- package/src/pkg/commands/xadd.ts +70 -0
- package/src/pkg/commands/xautoclaim.ts +31 -0
- package/src/pkg/commands/xclaim.ts +56 -0
- package/src/pkg/commands/xdel.ts +16 -0
- package/src/pkg/commands/xdelex.ts +25 -0
- package/src/pkg/commands/xgroup.ts +101 -0
- package/src/pkg/commands/xinfo.ts +28 -0
- package/src/pkg/commands/xlen.ts +12 -0
- package/src/pkg/commands/xpending.ts +44 -0
- package/src/pkg/commands/xrange.ts +49 -0
- package/src/pkg/commands/xread.ts +78 -0
- package/src/pkg/commands/xreadgroup.ts +74 -0
- package/src/pkg/commands/xrevrange.ts +48 -0
- package/src/pkg/commands/xtrim.ts +25 -0
- package/src/pkg/commands/zadd.ts +54 -0
- package/src/pkg/commands/zcard.ts +12 -0
- package/src/pkg/commands/zcount.ts +14 -0
- package/src/pkg/commands/zdiffstore.ts +15 -0
- package/src/pkg/commands/zincrby.ts +14 -0
- package/src/pkg/commands/zinterstore.ts +51 -0
- package/src/pkg/commands/zlexcount.ts +11 -0
- package/src/pkg/commands/zmscore.ts +16 -0
- package/src/pkg/commands/zpopmax.ts +18 -0
- package/src/pkg/commands/zpopmin.ts +18 -0
- package/src/pkg/commands/zrange.ts +72 -0
- package/src/pkg/commands/zrank.ts +14 -0
- package/src/pkg/commands/zrem.ts +11 -0
- package/src/pkg/commands/zremrangebylex.ts +11 -0
- package/src/pkg/commands/zremrangebyrank.ts +14 -0
- package/src/pkg/commands/zremrangebyscore.ts +18 -0
- package/src/pkg/commands/zrevrank.ts +14 -0
- package/src/pkg/commands/zscan.ts +31 -0
- package/src/pkg/commands/zscore.ts +15 -0
- package/src/pkg/commands/zunion.ts +54 -0
- package/src/pkg/commands/zunionstore.ts +52 -0
- package/src/pkg/error.ts +28 -0
- package/src/pkg/http.ts +458 -0
- package/src/pkg/index.ts +1 -0
- package/src/pkg/pipeline.ts +2041 -0
- package/src/pkg/redis.ts +2130 -0
- package/src/pkg/script.ts +100 -0
- package/src/pkg/scriptRo.ts +98 -0
- package/src/pkg/types.ts +35 -0
- package/src/pkg/util.ts +115 -0
- package/src/platforms/cloudflare.ts +162 -0
- package/src/platforms/fastly.ts +105 -0
- package/src/platforms/nodejs.ts +231 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,2041 @@
|
|
|
1
|
+
import type { Command, CommandOptions } from "./commands/command";
|
|
2
|
+
import { HRandFieldCommand } from "./commands/hrandfield";
|
|
3
|
+
import type {
|
|
4
|
+
ScoreMember,
|
|
5
|
+
SetCommandOptions,
|
|
6
|
+
ZAddCommandOptions,
|
|
7
|
+
ZRangeCommandOptions,
|
|
8
|
+
} from "./commands/mod";
|
|
9
|
+
import type { ArGrepOptions, ArMSetValues, ArOpOperation } from "./commands/mod";
|
|
10
|
+
import {
|
|
11
|
+
AppendCommand,
|
|
12
|
+
ArCountCommand,
|
|
13
|
+
ArDelCommand,
|
|
14
|
+
ArDelRangeCommand,
|
|
15
|
+
ArGetCommand,
|
|
16
|
+
ArGetRangeCommand,
|
|
17
|
+
ArGrepCommand,
|
|
18
|
+
ArInfoCommand,
|
|
19
|
+
ArInsertCommand,
|
|
20
|
+
ArLastItemsCommand,
|
|
21
|
+
ArLenCommand,
|
|
22
|
+
ArMGetCommand,
|
|
23
|
+
ArMSetCommand,
|
|
24
|
+
ArNextCommand,
|
|
25
|
+
ArOpCommand,
|
|
26
|
+
ArRingCommand,
|
|
27
|
+
ArScanCommand,
|
|
28
|
+
ArSeekCommand,
|
|
29
|
+
ArSetCommand,
|
|
30
|
+
BitCountCommand,
|
|
31
|
+
BitFieldCommand,
|
|
32
|
+
BitOpCommand,
|
|
33
|
+
BitPosCommand,
|
|
34
|
+
ClientSetInfoCommand,
|
|
35
|
+
CopyCommand,
|
|
36
|
+
DBSizeCommand,
|
|
37
|
+
DecrByCommand,
|
|
38
|
+
DecrCommand,
|
|
39
|
+
DelCommand,
|
|
40
|
+
EchoCommand,
|
|
41
|
+
EvalROCommand,
|
|
42
|
+
EvalCommand,
|
|
43
|
+
EvalshaROCommand,
|
|
44
|
+
EvalshaCommand,
|
|
45
|
+
ExistsCommand,
|
|
46
|
+
ExpireAtCommand,
|
|
47
|
+
ExpireCommand,
|
|
48
|
+
FCallCommand,
|
|
49
|
+
FCallRoCommand,
|
|
50
|
+
FlushAllCommand,
|
|
51
|
+
FlushDBCommand,
|
|
52
|
+
FunctionDeleteCommand,
|
|
53
|
+
FunctionFlushCommand,
|
|
54
|
+
FunctionListCommand,
|
|
55
|
+
FunctionLoadCommand,
|
|
56
|
+
FunctionStatsCommand,
|
|
57
|
+
GeoAddCommand,
|
|
58
|
+
GeoDistCommand,
|
|
59
|
+
GeoHashCommand,
|
|
60
|
+
GeoPosCommand,
|
|
61
|
+
GeoSearchCommand,
|
|
62
|
+
GeoSearchStoreCommand,
|
|
63
|
+
GetBitCommand,
|
|
64
|
+
GetCommand,
|
|
65
|
+
GetDelCommand,
|
|
66
|
+
GetExCommand,
|
|
67
|
+
GetRangeCommand,
|
|
68
|
+
GetSetCommand,
|
|
69
|
+
HDelCommand,
|
|
70
|
+
HExistsCommand,
|
|
71
|
+
HExpireCommand,
|
|
72
|
+
HExpireAtCommand,
|
|
73
|
+
HExpireTimeCommand,
|
|
74
|
+
HTtlCommand,
|
|
75
|
+
HPExpireCommand,
|
|
76
|
+
HPExpireAtCommand,
|
|
77
|
+
HPExpireTimeCommand,
|
|
78
|
+
HPTtlCommand,
|
|
79
|
+
HPersistCommand,
|
|
80
|
+
HGetAllCommand,
|
|
81
|
+
HGetCommand,
|
|
82
|
+
HGetDelCommand,
|
|
83
|
+
HGetExCommand,
|
|
84
|
+
HIncrByCommand,
|
|
85
|
+
HIncrByFloatCommand,
|
|
86
|
+
HKeysCommand,
|
|
87
|
+
HLenCommand,
|
|
88
|
+
HMGetCommand,
|
|
89
|
+
HMSetCommand,
|
|
90
|
+
HScanCommand,
|
|
91
|
+
HSetCommand,
|
|
92
|
+
HSetExCommand,
|
|
93
|
+
HSetNXCommand,
|
|
94
|
+
HStrLenCommand,
|
|
95
|
+
HValsCommand,
|
|
96
|
+
IncrByCommand,
|
|
97
|
+
IncrByFloatCommand,
|
|
98
|
+
IncrCommand,
|
|
99
|
+
JsonArrAppendCommand,
|
|
100
|
+
JsonArrIndexCommand,
|
|
101
|
+
JsonArrInsertCommand,
|
|
102
|
+
JsonArrLenCommand,
|
|
103
|
+
JsonArrPopCommand,
|
|
104
|
+
JsonArrTrimCommand,
|
|
105
|
+
JsonClearCommand,
|
|
106
|
+
JsonDelCommand,
|
|
107
|
+
JsonForgetCommand,
|
|
108
|
+
JsonGetCommand,
|
|
109
|
+
JsonMergeCommand,
|
|
110
|
+
JsonMGetCommand,
|
|
111
|
+
JsonMSetCommand,
|
|
112
|
+
JsonNumIncrByCommand,
|
|
113
|
+
JsonNumMultByCommand,
|
|
114
|
+
JsonObjKeysCommand,
|
|
115
|
+
JsonObjLenCommand,
|
|
116
|
+
JsonRespCommand,
|
|
117
|
+
JsonSetCommand,
|
|
118
|
+
JsonStrAppendCommand,
|
|
119
|
+
JsonStrLenCommand,
|
|
120
|
+
JsonToggleCommand,
|
|
121
|
+
JsonTypeCommand,
|
|
122
|
+
KeysCommand,
|
|
123
|
+
LIndexCommand,
|
|
124
|
+
LInsertCommand,
|
|
125
|
+
LLenCommand,
|
|
126
|
+
LMoveCommand,
|
|
127
|
+
LPopCommand,
|
|
128
|
+
LPosCommand,
|
|
129
|
+
LPushCommand,
|
|
130
|
+
LPushXCommand,
|
|
131
|
+
LRangeCommand,
|
|
132
|
+
LRemCommand,
|
|
133
|
+
LSetCommand,
|
|
134
|
+
LTrimCommand,
|
|
135
|
+
LmPopCommand,
|
|
136
|
+
MGetCommand,
|
|
137
|
+
MSetCommand,
|
|
138
|
+
MSetNXCommand,
|
|
139
|
+
PExpireAtCommand,
|
|
140
|
+
PExpireCommand,
|
|
141
|
+
PSetEXCommand,
|
|
142
|
+
PTtlCommand,
|
|
143
|
+
PersistCommand,
|
|
144
|
+
PfAddCommand,
|
|
145
|
+
PfCountCommand,
|
|
146
|
+
PfMergeCommand,
|
|
147
|
+
PingCommand,
|
|
148
|
+
PublishCommand,
|
|
149
|
+
RPopCommand,
|
|
150
|
+
RPushCommand,
|
|
151
|
+
RPushXCommand,
|
|
152
|
+
RandomKeyCommand,
|
|
153
|
+
RenameCommand,
|
|
154
|
+
RenameNXCommand,
|
|
155
|
+
SAddCommand,
|
|
156
|
+
SCardCommand,
|
|
157
|
+
SDiffCommand,
|
|
158
|
+
SDiffStoreCommand,
|
|
159
|
+
SInterCommand,
|
|
160
|
+
SInterCardCommand,
|
|
161
|
+
SInterStoreCommand,
|
|
162
|
+
SIsMemberCommand,
|
|
163
|
+
SMIsMemberCommand,
|
|
164
|
+
SMembersCommand,
|
|
165
|
+
SMoveCommand,
|
|
166
|
+
SPopCommand,
|
|
167
|
+
SRandMemberCommand,
|
|
168
|
+
SRemCommand,
|
|
169
|
+
SScanCommand,
|
|
170
|
+
SUnionCommand,
|
|
171
|
+
SUnionStoreCommand,
|
|
172
|
+
ScanCommand,
|
|
173
|
+
ScriptExistsCommand,
|
|
174
|
+
ScriptFlushCommand,
|
|
175
|
+
ScriptLoadCommand,
|
|
176
|
+
SetBitCommand,
|
|
177
|
+
SetCommand,
|
|
178
|
+
SetExCommand,
|
|
179
|
+
SetNxCommand,
|
|
180
|
+
SetRangeCommand,
|
|
181
|
+
StrLenCommand,
|
|
182
|
+
TimeCommand,
|
|
183
|
+
TouchCommand,
|
|
184
|
+
TtlCommand,
|
|
185
|
+
TypeCommand,
|
|
186
|
+
UnlinkCommand,
|
|
187
|
+
XAckCommand,
|
|
188
|
+
XAckDelCommand,
|
|
189
|
+
XAddCommand,
|
|
190
|
+
XAutoClaim,
|
|
191
|
+
XClaimCommand,
|
|
192
|
+
XDelCommand,
|
|
193
|
+
XDelExCommand,
|
|
194
|
+
XGroupCommand,
|
|
195
|
+
XInfoCommand,
|
|
196
|
+
XLenCommand,
|
|
197
|
+
XPendingCommand,
|
|
198
|
+
XRangeCommand,
|
|
199
|
+
XReadCommand,
|
|
200
|
+
XReadGroupCommand,
|
|
201
|
+
XRevRangeCommand,
|
|
202
|
+
XTrimCommand,
|
|
203
|
+
ZAddCommand,
|
|
204
|
+
ZCardCommand,
|
|
205
|
+
ZCountCommand,
|
|
206
|
+
ZIncrByCommand,
|
|
207
|
+
ZInterStoreCommand,
|
|
208
|
+
ZLexCountCommand,
|
|
209
|
+
ZPopMaxCommand,
|
|
210
|
+
ZPopMinCommand,
|
|
211
|
+
ZRangeCommand,
|
|
212
|
+
ZRankCommand,
|
|
213
|
+
ZRemCommand,
|
|
214
|
+
ZRemRangeByLexCommand,
|
|
215
|
+
ZRemRangeByRankCommand,
|
|
216
|
+
ZRemRangeByScoreCommand,
|
|
217
|
+
ZRevRankCommand,
|
|
218
|
+
ZScanCommand,
|
|
219
|
+
ZScoreCommand,
|
|
220
|
+
ZUnionCommand,
|
|
221
|
+
ZUnionStoreCommand,
|
|
222
|
+
} from "./commands/mod";
|
|
223
|
+
import { ZDiffStoreCommand } from "./commands/zdiffstore";
|
|
224
|
+
import { ZMScoreCommand } from "./commands/zmscore";
|
|
225
|
+
import { UpstashError } from "./error";
|
|
226
|
+
import type { Requester, UpstashResponse } from "./http";
|
|
227
|
+
import type { CommandArgs } from "./types";
|
|
228
|
+
|
|
229
|
+
// Given a tuple of commands, returns a tuple of the response data of each command
|
|
230
|
+
type InferResponseData<T extends unknown[]> = {
|
|
231
|
+
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
interface ExecMethod<TCommands extends Command<any, any>[]> {
|
|
235
|
+
/**
|
|
236
|
+
* Send the pipeline request to upstash.
|
|
237
|
+
*
|
|
238
|
+
* Returns an array with the results of all pipelined commands.
|
|
239
|
+
*
|
|
240
|
+
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
241
|
+
* ```ts
|
|
242
|
+
* const p = redis.pipeline()
|
|
243
|
+
* p.get("key")
|
|
244
|
+
* const result = p.exec<[{ greeting: string }]>()
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* If one of the commands get an error, the whole pipeline fails. Alternatively, you can set the keepErrors option to true in order to get the errors individually.
|
|
248
|
+
*
|
|
249
|
+
* If keepErrors is set to true, a list of objects is returned where each object corresponds to a command and is of type: `{ result: unknown, error?: string }`.
|
|
250
|
+
*
|
|
251
|
+
* ```ts
|
|
252
|
+
* const p = redis.pipeline()
|
|
253
|
+
* p.get("key")
|
|
254
|
+
*
|
|
255
|
+
* const result = await p.exec({ keepErrors: true });
|
|
256
|
+
* const getResult = result[0].result
|
|
257
|
+
* const getError = result[0].error
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
<
|
|
261
|
+
TCommandResults extends unknown[] = [] extends TCommands
|
|
262
|
+
? unknown[]
|
|
263
|
+
: InferResponseData<TCommands>,
|
|
264
|
+
>(): Promise<TCommandResults>;
|
|
265
|
+
<
|
|
266
|
+
TCommandResults extends unknown[] = [] extends TCommands
|
|
267
|
+
? unknown[]
|
|
268
|
+
: InferResponseData<TCommands>,
|
|
269
|
+
>(options: {
|
|
270
|
+
keepErrors: true;
|
|
271
|
+
}): Promise<{ [K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]> }>;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Upstash REST API supports command pipelining to send multiple commands in
|
|
276
|
+
* batch, instead of sending each command one by one and waiting for a response.
|
|
277
|
+
* When using pipelines, several commands are sent using a single HTTP request,
|
|
278
|
+
* and a single JSON array response is returned. Each item in the response array
|
|
279
|
+
* corresponds to the command in the same order within the pipeline.
|
|
280
|
+
*
|
|
281
|
+
* **NOTE:**
|
|
282
|
+
*
|
|
283
|
+
* Execution of the pipeline is not atomic. Even though each command in
|
|
284
|
+
* the pipeline will be executed in order, commands sent by other clients can
|
|
285
|
+
* interleave with the pipeline.
|
|
286
|
+
*
|
|
287
|
+
* **Examples:**
|
|
288
|
+
*
|
|
289
|
+
* ```ts
|
|
290
|
+
* const p = redis.pipeline() // or redis.multi()
|
|
291
|
+
* p.set("key","value")
|
|
292
|
+
* p.get("key")
|
|
293
|
+
* const res = await p.exec()
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* You can also chain commands together
|
|
297
|
+
* ```ts
|
|
298
|
+
* const p = redis.pipeline()
|
|
299
|
+
* const res = await p.set("key","value").get("key").exec()
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* Return types are inferred if all commands are chained, but you can still
|
|
303
|
+
* override the response type manually:
|
|
304
|
+
* ```ts
|
|
305
|
+
* redis.pipeline()
|
|
306
|
+
* .set("key", { greeting: "hello"})
|
|
307
|
+
* .get("key")
|
|
308
|
+
* .exec<["OK", { greeting: string } ]>()
|
|
309
|
+
*
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
312
|
+
export class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
313
|
+
private client: Requester;
|
|
314
|
+
private commands: TCommands;
|
|
315
|
+
private commandOptions?: CommandOptions<any, any>;
|
|
316
|
+
private multiExec: boolean;
|
|
317
|
+
|
|
318
|
+
constructor(opts: {
|
|
319
|
+
client: Requester;
|
|
320
|
+
commandOptions?: CommandOptions<any, any>;
|
|
321
|
+
multiExec?: boolean;
|
|
322
|
+
}) {
|
|
323
|
+
this.client = opts.client;
|
|
324
|
+
|
|
325
|
+
this.commands = [] as unknown as TCommands; // the TCommands generic in the class definition is only used for carrying through chained command types and should never be explicitly set when instantiating the class
|
|
326
|
+
this.commandOptions = opts.commandOptions;
|
|
327
|
+
this.multiExec = opts.multiExec ?? false;
|
|
328
|
+
|
|
329
|
+
if (this.commandOptions?.latencyLogging) {
|
|
330
|
+
const originalExec = this.exec.bind(this);
|
|
331
|
+
this.exec = async <
|
|
332
|
+
TCommandResults extends unknown[] = [] extends TCommands
|
|
333
|
+
? unknown[]
|
|
334
|
+
: InferResponseData<TCommands>,
|
|
335
|
+
>(options?: {
|
|
336
|
+
keepErrors: true;
|
|
337
|
+
}): Promise<TCommandResults> => {
|
|
338
|
+
const start = performance.now();
|
|
339
|
+
const result = await (options ? originalExec(options) : originalExec());
|
|
340
|
+
const end = performance.now();
|
|
341
|
+
const loggerResult = (end - start).toFixed(2);
|
|
342
|
+
// eslint-disable-next-line no-console
|
|
343
|
+
console.log(
|
|
344
|
+
`Latency for \u001B[38;2;19;185;39m${
|
|
345
|
+
this.multiExec ? ["MULTI-EXEC"] : ["PIPELINE"].toString().toUpperCase()
|
|
346
|
+
}\u001B[0m: \u001B[38;2;0;255;255m${loggerResult} ms\u001B[0m`
|
|
347
|
+
);
|
|
348
|
+
return result as TCommandResults;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
exec: ExecMethod<TCommands> = async (options?: { keepErrors: true }) => {
|
|
354
|
+
if (this.commands.length === 0) {
|
|
355
|
+
throw new Error("Pipeline is empty");
|
|
356
|
+
}
|
|
357
|
+
const path = this.multiExec ? ["multi-exec"] : ["pipeline"];
|
|
358
|
+
|
|
359
|
+
const res = (await this.client.request({
|
|
360
|
+
path,
|
|
361
|
+
body: Object.values(this.commands).map((c) => c.command),
|
|
362
|
+
})) as UpstashResponse<any>[];
|
|
363
|
+
|
|
364
|
+
return options?.keepErrors
|
|
365
|
+
? res.map(({ error, result }, i) => {
|
|
366
|
+
return {
|
|
367
|
+
error: error,
|
|
368
|
+
result: this.commands[i].deserialize(result),
|
|
369
|
+
};
|
|
370
|
+
})
|
|
371
|
+
: res.map(({ error, result }, i) => {
|
|
372
|
+
if (error) {
|
|
373
|
+
throw new UpstashError(
|
|
374
|
+
`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return this.commands[i].deserialize(result);
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Returns the length of pipeline before the execution
|
|
384
|
+
*/
|
|
385
|
+
length(): number {
|
|
386
|
+
return this.commands.length;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Pushes a command into the pipeline and returns a chainable instance of the
|
|
391
|
+
* pipeline
|
|
392
|
+
*/
|
|
393
|
+
private chain<T>(command: Command<any, T>): Pipeline<[...TCommands, Command<any, T>]> {
|
|
394
|
+
this.commands.push(command);
|
|
395
|
+
return this as any; // TS thinks we're returning Pipeline<[]> here, because we're not creating a new instance of the class, hence the cast
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* @see https://redis.io/commands/append
|
|
400
|
+
* @see node_modules/@upstash/redis/docs/commands/string/append.mdx
|
|
401
|
+
*/
|
|
402
|
+
append = (...args: CommandArgs<typeof AppendCommand>) =>
|
|
403
|
+
this.chain(new AppendCommand(args, this.commandOptions));
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* @see https://upstash.com/docs/redis/commands/array/arcount
|
|
407
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arcount.mdx
|
|
408
|
+
*/
|
|
409
|
+
arcount = (...args: CommandArgs<typeof ArCountCommand>) =>
|
|
410
|
+
this.chain(new ArCountCommand(args, this.commandOptions));
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* @see https://upstash.com/docs/redis/commands/array/ardel
|
|
414
|
+
* @see node_modules/@upstash/redis/docs/commands/array/ardel.mdx
|
|
415
|
+
*/
|
|
416
|
+
ardel = (...args: CommandArgs<typeof ArDelCommand>) =>
|
|
417
|
+
this.chain(new ArDelCommand(args, this.commandOptions));
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @see https://upstash.com/docs/redis/commands/array/ardelrange
|
|
421
|
+
* @see node_modules/@upstash/redis/docs/commands/array/ardelrange.mdx
|
|
422
|
+
*/
|
|
423
|
+
ardelrange = (...args: CommandArgs<typeof ArDelRangeCommand>) =>
|
|
424
|
+
this.chain(new ArDelRangeCommand(args, this.commandOptions));
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* @see https://upstash.com/docs/redis/commands/array/arget
|
|
428
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arget.mdx
|
|
429
|
+
*/
|
|
430
|
+
arget = <TData = string>(...args: CommandArgs<typeof ArGetCommand>) =>
|
|
431
|
+
this.chain(new ArGetCommand<TData>(args, this.commandOptions));
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @see https://upstash.com/docs/redis/commands/array/argetrange
|
|
435
|
+
* @see node_modules/@upstash/redis/docs/commands/array/argetrange.mdx
|
|
436
|
+
*/
|
|
437
|
+
argetrange = <TData = string>(...args: CommandArgs<typeof ArGetRangeCommand>) =>
|
|
438
|
+
this.chain(new ArGetRangeCommand<TData>(args, this.commandOptions));
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* @see https://upstash.com/docs/redis/commands/array/argrep
|
|
442
|
+
* @see node_modules/@upstash/redis/docs/commands/array/argrep.mdx
|
|
443
|
+
*/
|
|
444
|
+
argrep = <TData = string, TOpts extends ArGrepOptions = ArGrepOptions>(
|
|
445
|
+
key: string,
|
|
446
|
+
start: number | string,
|
|
447
|
+
end: number | string,
|
|
448
|
+
opts: TOpts
|
|
449
|
+
) => this.chain(new ArGrepCommand<TData, TOpts>([key, start, end, opts], this.commandOptions));
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @see https://upstash.com/docs/redis/commands/array/arinfo
|
|
453
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arinfo.mdx
|
|
454
|
+
*/
|
|
455
|
+
arinfo = (...args: CommandArgs<typeof ArInfoCommand>) =>
|
|
456
|
+
this.chain(new ArInfoCommand(args, this.commandOptions));
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* @see https://upstash.com/docs/redis/commands/array/arinsert
|
|
460
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arinsert.mdx
|
|
461
|
+
*/
|
|
462
|
+
arinsert = <TData>(key: string, ...values: TData[]) =>
|
|
463
|
+
this.chain(new ArInsertCommand<TData>([key, ...values], this.commandOptions));
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @see https://upstash.com/docs/redis/commands/array/arlastitems
|
|
467
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arlastitems.mdx
|
|
468
|
+
*/
|
|
469
|
+
arlastitems = <TData = string>(...args: CommandArgs<typeof ArLastItemsCommand>) =>
|
|
470
|
+
this.chain(new ArLastItemsCommand<TData>(args, this.commandOptions));
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* @see https://upstash.com/docs/redis/commands/array/arlen
|
|
474
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arlen.mdx
|
|
475
|
+
*/
|
|
476
|
+
arlen = (...args: CommandArgs<typeof ArLenCommand>) =>
|
|
477
|
+
this.chain(new ArLenCommand(args, this.commandOptions));
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @see https://upstash.com/docs/redis/commands/array/armget
|
|
481
|
+
* @see node_modules/@upstash/redis/docs/commands/array/armget.mdx
|
|
482
|
+
*/
|
|
483
|
+
armget = <TData = string>(...args: CommandArgs<typeof ArMGetCommand>) =>
|
|
484
|
+
this.chain(new ArMGetCommand<TData>(args, this.commandOptions));
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* @see https://upstash.com/docs/redis/commands/array/armset
|
|
488
|
+
* @see node_modules/@upstash/redis/docs/commands/array/armset.mdx
|
|
489
|
+
*/
|
|
490
|
+
armset = <TData>(key: string, values: ArMSetValues<TData>) =>
|
|
491
|
+
this.chain(new ArMSetCommand<TData>([key, values], this.commandOptions));
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* @see https://upstash.com/docs/redis/commands/array/arnext
|
|
495
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arnext.mdx
|
|
496
|
+
*/
|
|
497
|
+
arnext = (...args: CommandArgs<typeof ArNextCommand>) =>
|
|
498
|
+
this.chain(new ArNextCommand(args, this.commandOptions));
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @see https://upstash.com/docs/redis/commands/array/arop
|
|
502
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arop.mdx
|
|
503
|
+
*/
|
|
504
|
+
arop = <TData = string>(
|
|
505
|
+
key: string,
|
|
506
|
+
start: number | string,
|
|
507
|
+
end: number | string,
|
|
508
|
+
operation: ArOpOperation<TData>
|
|
509
|
+
) => this.chain(new ArOpCommand<TData>([key, start, end, operation], this.commandOptions));
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* @see https://upstash.com/docs/redis/commands/array/arring
|
|
513
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arring.mdx
|
|
514
|
+
*/
|
|
515
|
+
arring = <TData>(key: string, size: number, ...values: TData[]) =>
|
|
516
|
+
this.chain(new ArRingCommand<TData>([key, size, ...values], this.commandOptions));
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @see https://upstash.com/docs/redis/commands/array/arscan
|
|
520
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arscan.mdx
|
|
521
|
+
*/
|
|
522
|
+
arscan = <TData = string>(...args: CommandArgs<typeof ArScanCommand>) =>
|
|
523
|
+
this.chain(new ArScanCommand<TData>(args, this.commandOptions));
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* @see https://upstash.com/docs/redis/commands/array/arseek
|
|
527
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arseek.mdx
|
|
528
|
+
*/
|
|
529
|
+
arseek = (...args: CommandArgs<typeof ArSeekCommand>) =>
|
|
530
|
+
this.chain(new ArSeekCommand(args, this.commandOptions));
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @see https://upstash.com/docs/redis/commands/array/arset
|
|
534
|
+
* @see node_modules/@upstash/redis/docs/commands/array/arset.mdx
|
|
535
|
+
*/
|
|
536
|
+
arset = <TData>(key: string, index: number | string, ...values: TData[]) =>
|
|
537
|
+
this.chain(new ArSetCommand<TData>([key, index, ...values], this.commandOptions));
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* @see https://redis.io/commands/bitcount
|
|
541
|
+
* @see node_modules/@upstash/redis/docs/commands/bitmap/bitcount.mdx
|
|
542
|
+
*/
|
|
543
|
+
bitcount = (...args: CommandArgs<typeof BitCountCommand>) =>
|
|
544
|
+
this.chain(new BitCountCommand(args, this.commandOptions));
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```typescript
|
|
551
|
+
* redis.set("mykey", 0);
|
|
552
|
+
* const result = await redis.pipeline()
|
|
553
|
+
* .bitfield("mykey")
|
|
554
|
+
* .set("u4", 0, 16)
|
|
555
|
+
* .incr("u4", "#1", 1)
|
|
556
|
+
* .exec();
|
|
557
|
+
* console.log(result); // [[0, 1]]
|
|
558
|
+
* ```
|
|
559
|
+
*
|
|
560
|
+
* @see https://redis.io/commands/bitfield
|
|
561
|
+
*/
|
|
562
|
+
bitfield = (...args: CommandArgs<typeof BitFieldCommand>) =>
|
|
563
|
+
new BitFieldCommand(args, this.client, this.commandOptions, this.chain.bind(this));
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* @see https://redis.io/commands/bitop
|
|
567
|
+
* @see node_modules/@upstash/redis/docs/commands/bitmap/bitop.mdx
|
|
568
|
+
*/
|
|
569
|
+
bitop: {
|
|
570
|
+
(
|
|
571
|
+
op: "and" | "or" | "xor",
|
|
572
|
+
destinationKey: string,
|
|
573
|
+
sourceKey: string,
|
|
574
|
+
...sourceKeys: string[]
|
|
575
|
+
): Pipeline<[...TCommands, BitOpCommand]>;
|
|
576
|
+
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
577
|
+
(
|
|
578
|
+
op: "diff" | "diff1" | "andor",
|
|
579
|
+
destinationKey: string,
|
|
580
|
+
x: string,
|
|
581
|
+
...y: string[]
|
|
582
|
+
): Pipeline<[...TCommands, BitOpCommand]>;
|
|
583
|
+
(
|
|
584
|
+
op: "one",
|
|
585
|
+
destinationKey: string,
|
|
586
|
+
...sourceKeys: string[]
|
|
587
|
+
): Pipeline<[...TCommands, BitOpCommand]>;
|
|
588
|
+
} = (
|
|
589
|
+
op: "and" | "or" | "xor" | "not" | "diff" | "diff1" | "andor" | "one",
|
|
590
|
+
destinationKey: string,
|
|
591
|
+
sourceKey: string,
|
|
592
|
+
...sourceKeys: string[]
|
|
593
|
+
) =>
|
|
594
|
+
this.chain(
|
|
595
|
+
new BitOpCommand([op as any, destinationKey, sourceKey, ...sourceKeys], this.commandOptions)
|
|
596
|
+
);
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* @see https://redis.io/commands/bitpos
|
|
600
|
+
* @see node_modules/@upstash/redis/docs/commands/bitmap/bitpos.mdx
|
|
601
|
+
*/
|
|
602
|
+
bitpos = (...args: CommandArgs<typeof BitPosCommand>) =>
|
|
603
|
+
this.chain(new BitPosCommand(args, this.commandOptions));
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* @see https://redis.io/commands/client-setinfo
|
|
607
|
+
* @see node_modules/@upstash/redis/docs/commands/connection/client_setinfo.mdx
|
|
608
|
+
*/
|
|
609
|
+
clientSetinfo = (...args: CommandArgs<typeof ClientSetInfoCommand>) =>
|
|
610
|
+
this.chain(new ClientSetInfoCommand(args, this.commandOptions));
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* @see https://redis.io/commands/copy
|
|
614
|
+
*/
|
|
615
|
+
copy = (...args: CommandArgs<typeof CopyCommand>) =>
|
|
616
|
+
this.chain(new CopyCommand(args, this.commandOptions));
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* @see https://redis.io/commands/zdiffstore
|
|
620
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zdiffstore.mdx
|
|
621
|
+
*/
|
|
622
|
+
zdiffstore = (...args: CommandArgs<typeof ZDiffStoreCommand>) =>
|
|
623
|
+
this.chain(new ZDiffStoreCommand(args, this.commandOptions));
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* @see https://redis.io/commands/dbsize
|
|
627
|
+
* @see node_modules/@upstash/redis/docs/commands/server/dbsize.mdx
|
|
628
|
+
*/
|
|
629
|
+
dbsize = () => this.chain(new DBSizeCommand(this.commandOptions));
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* @see https://redis.io/commands/decr
|
|
633
|
+
* @see node_modules/@upstash/redis/docs/commands/string/decr.mdx
|
|
634
|
+
*/
|
|
635
|
+
decr = (...args: CommandArgs<typeof DecrCommand>) =>
|
|
636
|
+
this.chain(new DecrCommand(args, this.commandOptions));
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* @see https://redis.io/commands/decrby
|
|
640
|
+
* @see node_modules/@upstash/redis/docs/commands/string/decrby.mdx
|
|
641
|
+
*/
|
|
642
|
+
decrby = (...args: CommandArgs<typeof DecrByCommand>) =>
|
|
643
|
+
this.chain(new DecrByCommand(args, this.commandOptions));
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* @see https://redis.io/commands/del
|
|
647
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/del.mdx
|
|
648
|
+
*/
|
|
649
|
+
del = (...args: CommandArgs<typeof DelCommand>) =>
|
|
650
|
+
this.chain(new DelCommand(args, this.commandOptions));
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @see https://redis.io/commands/echo
|
|
654
|
+
* @see node_modules/@upstash/redis/docs/commands/auth/echo.mdx
|
|
655
|
+
*/
|
|
656
|
+
echo = (...args: CommandArgs<typeof EchoCommand>) =>
|
|
657
|
+
this.chain(new EchoCommand(args, this.commandOptions));
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @see https://redis.io/commands/eval_ro
|
|
661
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/eval_ro.mdx
|
|
662
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
663
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
664
|
+
* to receive raw strings.
|
|
665
|
+
*/
|
|
666
|
+
evalRo = <TArgs extends unknown[], TData = unknown>(
|
|
667
|
+
...args: [script: string, keys: string[], args: TArgs]
|
|
668
|
+
) => this.chain(new EvalROCommand<TArgs, TData>(args, this.commandOptions));
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* @see https://redis.io/commands/eval
|
|
672
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/eval.mdx
|
|
673
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
674
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
675
|
+
* to receive raw strings.
|
|
676
|
+
*/
|
|
677
|
+
eval = <TArgs extends unknown[], TData = unknown>(
|
|
678
|
+
...args: [script: string, keys: string[], args: TArgs]
|
|
679
|
+
) => this.chain(new EvalCommand<TArgs, TData>(args, this.commandOptions));
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
683
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/evalsha_ro.mdx
|
|
684
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
685
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
686
|
+
* to receive raw strings.
|
|
687
|
+
*/
|
|
688
|
+
evalshaRo = <TArgs extends unknown[], TData = unknown>(
|
|
689
|
+
...args: [sha1: string, keys: string[], args: TArgs]
|
|
690
|
+
) => this.chain(new EvalshaROCommand<TArgs, TData>(args, this.commandOptions));
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @see https://redis.io/commands/evalsha
|
|
694
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/evalsha.mdx
|
|
695
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
696
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
697
|
+
* to receive raw strings.
|
|
698
|
+
*/
|
|
699
|
+
evalsha = <TArgs extends unknown[], TData = unknown>(
|
|
700
|
+
...args: [sha1: string, keys: string[], args: TArgs]
|
|
701
|
+
) => this.chain(new EvalshaCommand<TArgs, TData>(args, this.commandOptions));
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* @see https://redis.io/commands/exists
|
|
705
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/exists.mdx
|
|
706
|
+
*/
|
|
707
|
+
exists = (...args: CommandArgs<typeof ExistsCommand>) =>
|
|
708
|
+
this.chain(new ExistsCommand(args, this.commandOptions));
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* @see https://redis.io/commands/expire
|
|
712
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/expire.mdx
|
|
713
|
+
*/
|
|
714
|
+
expire = (...args: CommandArgs<typeof ExpireCommand>) =>
|
|
715
|
+
this.chain(new ExpireCommand(args, this.commandOptions));
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* @see https://redis.io/commands/expireat
|
|
719
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/expireat.mdx
|
|
720
|
+
*/
|
|
721
|
+
expireat = (...args: CommandArgs<typeof ExpireAtCommand>) =>
|
|
722
|
+
this.chain(new ExpireAtCommand(args, this.commandOptions));
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* @see https://redis.io/commands/flushall
|
|
726
|
+
* @see node_modules/@upstash/redis/docs/commands/server/flushall.mdx
|
|
727
|
+
*/
|
|
728
|
+
flushall = (args?: CommandArgs<typeof FlushAllCommand>) =>
|
|
729
|
+
this.chain(new FlushAllCommand(args, this.commandOptions));
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* @see https://redis.io/commands/flushdb
|
|
733
|
+
* @see node_modules/@upstash/redis/docs/commands/server/flushdb.mdx
|
|
734
|
+
*/
|
|
735
|
+
flushdb = (...args: CommandArgs<typeof FlushDBCommand>) =>
|
|
736
|
+
this.chain(new FlushDBCommand(args, this.commandOptions));
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* @see https://redis.io/commands/geoadd
|
|
740
|
+
*/
|
|
741
|
+
geoadd = <TData>(...args: CommandArgs<typeof GeoAddCommand<TData>>) =>
|
|
742
|
+
this.chain(new GeoAddCommand<TData>(args, this.commandOptions));
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* @see https://redis.io/commands/geodist
|
|
746
|
+
*/
|
|
747
|
+
geodist = <TData>(...args: CommandArgs<typeof GeoDistCommand<TData>>) =>
|
|
748
|
+
this.chain(new GeoDistCommand<TData>(args, this.commandOptions));
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* @see https://redis.io/commands/geopos
|
|
752
|
+
*/
|
|
753
|
+
geopos = <TData>(...args: CommandArgs<typeof GeoPosCommand<TData>>) =>
|
|
754
|
+
this.chain(new GeoPosCommand<TData>(args, this.commandOptions));
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* @see https://redis.io/commands/geohash
|
|
758
|
+
*/
|
|
759
|
+
geohash = <TData>(...args: CommandArgs<typeof GeoHashCommand<TData>>) =>
|
|
760
|
+
this.chain(new GeoHashCommand<TData>(args, this.commandOptions));
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* @see https://redis.io/commands/geosearch
|
|
764
|
+
*/
|
|
765
|
+
geosearch = <TData>(...args: CommandArgs<typeof GeoSearchCommand<TData>>) =>
|
|
766
|
+
this.chain(new GeoSearchCommand<TData>(args, this.commandOptions));
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @see https://redis.io/commands/geosearchstore
|
|
770
|
+
*/
|
|
771
|
+
geosearchstore = <TData>(...args: CommandArgs<typeof GeoSearchStoreCommand<TData>>) =>
|
|
772
|
+
this.chain(new GeoSearchStoreCommand<TData>(args, this.commandOptions));
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* @see https://redis.io/commands/get
|
|
776
|
+
* @see node_modules/@upstash/redis/docs/commands/string/get.mdx
|
|
777
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
778
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
779
|
+
* to receive raw strings.
|
|
780
|
+
*/
|
|
781
|
+
get = <TData>(...args: CommandArgs<typeof GetCommand>) =>
|
|
782
|
+
this.chain(new GetCommand<TData>(args, this.commandOptions));
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @see https://redis.io/commands/getbit
|
|
786
|
+
* @see node_modules/@upstash/redis/docs/commands/bitmap/getbit.mdx
|
|
787
|
+
*/
|
|
788
|
+
getbit = (...args: CommandArgs<typeof GetBitCommand>) =>
|
|
789
|
+
this.chain(new GetBitCommand(args, this.commandOptions));
|
|
790
|
+
/**
|
|
791
|
+
* @see https://redis.io/commands/getdel
|
|
792
|
+
* @see node_modules/@upstash/redis/docs/commands/string/getdel.mdx
|
|
793
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
794
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
795
|
+
* to receive raw strings.
|
|
796
|
+
*/
|
|
797
|
+
getdel = <TData>(...args: CommandArgs<typeof GetDelCommand>) =>
|
|
798
|
+
this.chain(new GetDelCommand<TData>(args, this.commandOptions));
|
|
799
|
+
/**
|
|
800
|
+
* @see https://redis.io/commands/getex
|
|
801
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
802
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
803
|
+
* to receive raw strings.
|
|
804
|
+
*/
|
|
805
|
+
getex = <TData>(...args: CommandArgs<typeof GetExCommand>) =>
|
|
806
|
+
this.chain(new GetExCommand<TData>(args, this.commandOptions));
|
|
807
|
+
/**
|
|
808
|
+
* @see https://redis.io/commands/getrange
|
|
809
|
+
* @see node_modules/@upstash/redis/docs/commands/string/getrange.mdx
|
|
810
|
+
*/
|
|
811
|
+
getrange = (...args: CommandArgs<typeof GetRangeCommand>) =>
|
|
812
|
+
this.chain(new GetRangeCommand(args, this.commandOptions));
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* @see https://redis.io/commands/getset
|
|
816
|
+
* @see node_modules/@upstash/redis/docs/commands/string/getset.mdx
|
|
817
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
818
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
819
|
+
* to receive raw strings.
|
|
820
|
+
*/
|
|
821
|
+
getset = <TData>(key: string, value: TData) =>
|
|
822
|
+
this.chain(new GetSetCommand<TData>([key, value], this.commandOptions));
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @see https://redis.io/commands/hdel
|
|
826
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hdel.mdx
|
|
827
|
+
*/
|
|
828
|
+
hdel = (...args: CommandArgs<typeof HDelCommand>) =>
|
|
829
|
+
this.chain(new HDelCommand(args, this.commandOptions));
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* @see https://redis.io/commands/hexists
|
|
833
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hexists.mdx
|
|
834
|
+
*/
|
|
835
|
+
hexists = (...args: CommandArgs<typeof HExistsCommand>) =>
|
|
836
|
+
this.chain(new HExistsCommand(args, this.commandOptions));
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* @see https://redis.io/commands/hexpire
|
|
840
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hexpire.mdx
|
|
841
|
+
*/
|
|
842
|
+
hexpire = (...args: CommandArgs<typeof HExpireCommand>) =>
|
|
843
|
+
this.chain(new HExpireCommand(args, this.commandOptions));
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @see https://redis.io/commands/hexpireat
|
|
847
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hexpireat.mdx
|
|
848
|
+
*/
|
|
849
|
+
hexpireat = (...args: CommandArgs<typeof HExpireAtCommand>) =>
|
|
850
|
+
this.chain(new HExpireAtCommand(args, this.commandOptions));
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* @see https://redis.io/commands/hexpiretime
|
|
854
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hexpiretime.mdx
|
|
855
|
+
*/
|
|
856
|
+
hexpiretime = (...args: CommandArgs<typeof HExpireTimeCommand>) =>
|
|
857
|
+
this.chain(new HExpireTimeCommand(args, this.commandOptions));
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* @see https://redis.io/commands/httl
|
|
861
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/httl.mdx
|
|
862
|
+
*/
|
|
863
|
+
httl = (...args: CommandArgs<typeof HTtlCommand>) =>
|
|
864
|
+
this.chain(new HTtlCommand(args, this.commandOptions));
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* @see https://redis.io/commands/hpexpire
|
|
868
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hpexpire.mdx
|
|
869
|
+
*/
|
|
870
|
+
hpexpire = (...args: CommandArgs<typeof HPExpireCommand>) =>
|
|
871
|
+
this.chain(new HPExpireCommand(args, this.commandOptions));
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* @see https://redis.io/commands/hpexpireat
|
|
875
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hpexpireat.mdx
|
|
876
|
+
*/
|
|
877
|
+
hpexpireat = (...args: CommandArgs<typeof HPExpireAtCommand>) =>
|
|
878
|
+
this.chain(new HPExpireAtCommand(args, this.commandOptions));
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* @see https://redis.io/commands/hpexpiretime
|
|
882
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hpexpiretime.mdx
|
|
883
|
+
*/
|
|
884
|
+
hpexpiretime = (...args: CommandArgs<typeof HPExpireTimeCommand>) =>
|
|
885
|
+
this.chain(new HPExpireTimeCommand(args, this.commandOptions));
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* @see https://redis.io/commands/hpttl
|
|
889
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hpttl.mdx
|
|
890
|
+
*/
|
|
891
|
+
hpttl = (...args: CommandArgs<typeof HPTtlCommand>) =>
|
|
892
|
+
this.chain(new HPTtlCommand(args, this.commandOptions));
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* @see https://redis.io/commands/hpersist
|
|
896
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hpersist.mdx
|
|
897
|
+
*/
|
|
898
|
+
hpersist = (...args: CommandArgs<typeof HPersistCommand>) =>
|
|
899
|
+
this.chain(new HPersistCommand(args, this.commandOptions));
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* @see https://redis.io/commands/hget
|
|
903
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hget.mdx
|
|
904
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
905
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
906
|
+
* to receive raw strings.
|
|
907
|
+
*/
|
|
908
|
+
hget = <TData>(...args: CommandArgs<typeof HGetCommand>) =>
|
|
909
|
+
this.chain(new HGetCommand<TData>(args, this.commandOptions));
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* @see https://redis.io/commands/hgetall
|
|
913
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hgetall.mdx
|
|
914
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
915
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
916
|
+
* to receive raw strings.
|
|
917
|
+
* With automaticDeserialization: false, hgetall returns a flat array instead, such as
|
|
918
|
+
* ["text", "123", "version", "1"], and [] for a missing key.
|
|
919
|
+
*/
|
|
920
|
+
hgetall = <TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>) =>
|
|
921
|
+
this.chain(new HGetAllCommand<TData>(args, this.commandOptions));
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* @see https://redis.io/commands/hgetdel
|
|
925
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hgetdel.mdx
|
|
926
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
927
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
928
|
+
* to receive raw strings.
|
|
929
|
+
* With automaticDeserialization: false, hgetdel returns an array of values in field order instead,
|
|
930
|
+
* such as ["123", null], with null for each field when the key is missing.
|
|
931
|
+
*/
|
|
932
|
+
hgetdel = <TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetDelCommand>) =>
|
|
933
|
+
this.chain(new HGetDelCommand<TData>(args, this.commandOptions));
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* @see https://redis.io/commands/hgetex
|
|
937
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hgetex.mdx
|
|
938
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
939
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
940
|
+
* to receive raw strings.
|
|
941
|
+
* With automaticDeserialization: false, hgetex returns an array of values in field order instead,
|
|
942
|
+
* such as ["123", null], with null for each field when the key is missing.
|
|
943
|
+
*/
|
|
944
|
+
hgetex = <TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetExCommand>) =>
|
|
945
|
+
this.chain(new HGetExCommand<TData>(args, this.commandOptions));
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* @see https://redis.io/commands/hincrby
|
|
949
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hincrby.mdx
|
|
950
|
+
*/
|
|
951
|
+
hincrby = (...args: CommandArgs<typeof HIncrByCommand>) =>
|
|
952
|
+
this.chain(new HIncrByCommand(args, this.commandOptions));
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
956
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hincrbyfloat.mdx
|
|
957
|
+
*/
|
|
958
|
+
hincrbyfloat = (...args: CommandArgs<typeof HIncrByFloatCommand>) =>
|
|
959
|
+
this.chain(new HIncrByFloatCommand(args, this.commandOptions));
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* @see https://redis.io/commands/hkeys
|
|
963
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hkeys.mdx
|
|
964
|
+
*/
|
|
965
|
+
hkeys = (...args: CommandArgs<typeof HKeysCommand>) =>
|
|
966
|
+
this.chain(new HKeysCommand(args, this.commandOptions));
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* @see https://redis.io/commands/hlen
|
|
970
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hlen.mdx
|
|
971
|
+
*/
|
|
972
|
+
hlen = (...args: CommandArgs<typeof HLenCommand>) =>
|
|
973
|
+
this.chain(new HLenCommand(args, this.commandOptions));
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* @see https://redis.io/commands/hmget
|
|
977
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hmget.mdx
|
|
978
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
979
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
980
|
+
* to receive raw strings.
|
|
981
|
+
* With automaticDeserialization: false, hmget returns an array of values in field order instead,
|
|
982
|
+
* such as ["123", null], with null for each field when the key is missing.
|
|
983
|
+
*/
|
|
984
|
+
hmget = <TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>) =>
|
|
985
|
+
this.chain(new HMGetCommand<TData>(args, this.commandOptions));
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* @see https://redis.io/commands/hmset
|
|
989
|
+
*/
|
|
990
|
+
hmset = <TData>(key: string, kv: Record<string, TData>) =>
|
|
991
|
+
this.chain(new HMSetCommand([key, kv], this.commandOptions));
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* @see https://redis.io/commands/hrandfield
|
|
995
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hrandfield.mdx
|
|
996
|
+
*/
|
|
997
|
+
hrandfield = <TData extends string | string[] | Record<string, unknown>>(
|
|
998
|
+
key: string,
|
|
999
|
+
count?: number,
|
|
1000
|
+
withValues?: boolean
|
|
1001
|
+
) =>
|
|
1002
|
+
this.chain(new HRandFieldCommand<TData>([key, count, withValues] as any, this.commandOptions));
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* @see https://redis.io/commands/hscan
|
|
1006
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hscan.mdx
|
|
1007
|
+
*/
|
|
1008
|
+
hscan = (...args: CommandArgs<typeof HScanCommand>) =>
|
|
1009
|
+
this.chain(new HScanCommand(args, this.commandOptions));
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* @see https://redis.io/commands/hset
|
|
1013
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hset.mdx
|
|
1014
|
+
*/
|
|
1015
|
+
hset = <TData>(key: string, kv: Record<string, TData>) =>
|
|
1016
|
+
this.chain(new HSetCommand<TData>([key, kv], this.commandOptions));
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* @see https://redis.io/commands/hsetex
|
|
1020
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hsetex.mdx
|
|
1021
|
+
*/
|
|
1022
|
+
hsetex = <TData>(...args: CommandArgs<typeof HSetExCommand<TData>>) =>
|
|
1023
|
+
this.chain(new HSetExCommand<TData>(args as any, this.commandOptions));
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* @see https://redis.io/commands/hsetnx
|
|
1027
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hsetnx.mdx
|
|
1028
|
+
*/
|
|
1029
|
+
hsetnx = <TData>(key: string, field: string, value: TData) =>
|
|
1030
|
+
this.chain(new HSetNXCommand<TData>([key, field, value], this.commandOptions));
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* @see https://redis.io/commands/hstrlen
|
|
1034
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hstrlen.mdx
|
|
1035
|
+
*/
|
|
1036
|
+
hstrlen = (...args: CommandArgs<typeof HStrLenCommand>) =>
|
|
1037
|
+
this.chain(new HStrLenCommand(args, this.commandOptions));
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* @see https://redis.io/commands/hvals
|
|
1041
|
+
* @see node_modules/@upstash/redis/docs/commands/hash/hvals.mdx
|
|
1042
|
+
*/
|
|
1043
|
+
hvals = (...args: CommandArgs<typeof HValsCommand>) =>
|
|
1044
|
+
this.chain(new HValsCommand(args, this.commandOptions));
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* @see https://redis.io/commands/incr
|
|
1048
|
+
* @see node_modules/@upstash/redis/docs/commands/string/incr.mdx
|
|
1049
|
+
*/
|
|
1050
|
+
incr = (...args: CommandArgs<typeof IncrCommand>) =>
|
|
1051
|
+
this.chain(new IncrCommand(args, this.commandOptions));
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* @see https://redis.io/commands/incrby
|
|
1055
|
+
* @see node_modules/@upstash/redis/docs/commands/string/incrby.mdx
|
|
1056
|
+
*/
|
|
1057
|
+
incrby = (...args: CommandArgs<typeof IncrByCommand>) =>
|
|
1058
|
+
this.chain(new IncrByCommand(args, this.commandOptions));
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
1062
|
+
* @see node_modules/@upstash/redis/docs/commands/string/incrbyfloat.mdx
|
|
1063
|
+
*/
|
|
1064
|
+
incrbyfloat = (...args: CommandArgs<typeof IncrByFloatCommand>) =>
|
|
1065
|
+
this.chain(new IncrByFloatCommand(args, this.commandOptions));
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* @see https://redis.io/commands/keys
|
|
1069
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/keys.mdx
|
|
1070
|
+
*/
|
|
1071
|
+
keys = (...args: CommandArgs<typeof KeysCommand>) =>
|
|
1072
|
+
this.chain(new KeysCommand(args, this.commandOptions));
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* @see https://redis.io/commands/lindex
|
|
1076
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lindex.mdx
|
|
1077
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1078
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1079
|
+
* to receive raw strings.
|
|
1080
|
+
*/
|
|
1081
|
+
lindex = (...args: CommandArgs<typeof LIndexCommand>) =>
|
|
1082
|
+
this.chain(new LIndexCommand(args, this.commandOptions));
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* @see https://redis.io/commands/linsert
|
|
1086
|
+
* @see node_modules/@upstash/redis/docs/commands/list/linsert.mdx
|
|
1087
|
+
*/
|
|
1088
|
+
linsert = <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) =>
|
|
1089
|
+
this.chain(new LInsertCommand<TData>([key, direction, pivot, value], this.commandOptions));
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* @see https://redis.io/commands/llen
|
|
1093
|
+
* @see node_modules/@upstash/redis/docs/commands/list/llen.mdx
|
|
1094
|
+
*/
|
|
1095
|
+
llen = (...args: CommandArgs<typeof LLenCommand>) =>
|
|
1096
|
+
this.chain(new LLenCommand(args, this.commandOptions));
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* @see https://redis.io/commands/lmove
|
|
1100
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lmove.mdx
|
|
1101
|
+
*/
|
|
1102
|
+
lmove = <TData = string>(...args: CommandArgs<typeof LMoveCommand>) =>
|
|
1103
|
+
this.chain(new LMoveCommand<TData>(args, this.commandOptions));
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* @see https://redis.io/commands/lpop
|
|
1107
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpop.mdx
|
|
1108
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1109
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1110
|
+
* to receive raw strings.
|
|
1111
|
+
*/
|
|
1112
|
+
lpop = <TData>(...args: CommandArgs<typeof LPopCommand>) =>
|
|
1113
|
+
this.chain(new LPopCommand<TData>(args, this.commandOptions));
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* @see https://redis.io/commands/lmpop
|
|
1117
|
+
*/
|
|
1118
|
+
lmpop = <TData>(...args: CommandArgs<typeof LmPopCommand>) =>
|
|
1119
|
+
this.chain(new LmPopCommand<TData>(args, this.commandOptions));
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* @see https://redis.io/commands/lpos
|
|
1123
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpos.mdx
|
|
1124
|
+
*/
|
|
1125
|
+
lpos = <TData>(...args: CommandArgs<typeof LPosCommand>) =>
|
|
1126
|
+
this.chain(new LPosCommand<TData>(args, this.commandOptions));
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* @see https://redis.io/commands/lpush
|
|
1130
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpush.mdx
|
|
1131
|
+
*/
|
|
1132
|
+
lpush = <TData>(key: string, ...elements: TData[]) =>
|
|
1133
|
+
this.chain(new LPushCommand<TData>([key, ...elements], this.commandOptions));
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* @see https://redis.io/commands/lpushx
|
|
1137
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpushx.mdx
|
|
1138
|
+
*/
|
|
1139
|
+
lpushx = <TData>(key: string, ...elements: TData[]) =>
|
|
1140
|
+
this.chain(new LPushXCommand<TData>([key, ...elements], this.commandOptions));
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @see https://redis.io/commands/lrange
|
|
1144
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lrange.mdx
|
|
1145
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1146
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1147
|
+
* to receive raw strings.
|
|
1148
|
+
*/
|
|
1149
|
+
lrange = <TResult = string>(...args: CommandArgs<typeof LRangeCommand>) =>
|
|
1150
|
+
this.chain(new LRangeCommand<TResult>(args, this.commandOptions));
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* @see https://redis.io/commands/lrem
|
|
1154
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lrem.mdx
|
|
1155
|
+
*/
|
|
1156
|
+
lrem = <TData>(key: string, count: number, value: TData) =>
|
|
1157
|
+
this.chain(new LRemCommand([key, count, value], this.commandOptions));
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* @see https://redis.io/commands/lset
|
|
1161
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lset.mdx
|
|
1162
|
+
*/
|
|
1163
|
+
lset = <TData>(key: string, index: number, value: TData) =>
|
|
1164
|
+
this.chain(new LSetCommand([key, index, value], this.commandOptions));
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* @see https://redis.io/commands/ltrim
|
|
1168
|
+
* @see node_modules/@upstash/redis/docs/commands/list/ltrim.mdx
|
|
1169
|
+
*/
|
|
1170
|
+
ltrim = (...args: CommandArgs<typeof LTrimCommand>) =>
|
|
1171
|
+
this.chain(new LTrimCommand(args, this.commandOptions));
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* @see https://redis.io/commands/mget
|
|
1175
|
+
* @see node_modules/@upstash/redis/docs/commands/string/mget.mdx
|
|
1176
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1177
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1178
|
+
* to receive raw strings.
|
|
1179
|
+
*/
|
|
1180
|
+
mget = <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) =>
|
|
1181
|
+
this.chain(new MGetCommand<TData>(args, this.commandOptions));
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* @see https://redis.io/commands/mset
|
|
1185
|
+
* @see node_modules/@upstash/redis/docs/commands/string/mset.mdx
|
|
1186
|
+
*/
|
|
1187
|
+
mset = <TData>(kv: Record<string, TData>) =>
|
|
1188
|
+
this.chain(new MSetCommand<TData>([kv], this.commandOptions));
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* @see https://redis.io/commands/msetnx
|
|
1192
|
+
* @see node_modules/@upstash/redis/docs/commands/string/msetnx.mdx
|
|
1193
|
+
*/
|
|
1194
|
+
msetnx = <TData>(kv: Record<string, TData>) =>
|
|
1195
|
+
this.chain(new MSetNXCommand<TData>([kv], this.commandOptions));
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* @see https://redis.io/commands/persist
|
|
1199
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/persist.mdx
|
|
1200
|
+
*/
|
|
1201
|
+
persist = (...args: CommandArgs<typeof PersistCommand>) =>
|
|
1202
|
+
this.chain(new PersistCommand(args, this.commandOptions));
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* @see https://redis.io/commands/pexpire
|
|
1206
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/pexpire.mdx
|
|
1207
|
+
*/
|
|
1208
|
+
pexpire = (...args: CommandArgs<typeof PExpireCommand>) =>
|
|
1209
|
+
this.chain(new PExpireCommand(args, this.commandOptions));
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* @see https://redis.io/commands/pexpireat
|
|
1213
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/pexpireat.mdx
|
|
1214
|
+
*/
|
|
1215
|
+
pexpireat = (...args: CommandArgs<typeof PExpireAtCommand>) =>
|
|
1216
|
+
this.chain(new PExpireAtCommand(args, this.commandOptions));
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* @see https://redis.io/commands/pfadd
|
|
1220
|
+
*/
|
|
1221
|
+
pfadd = (...args: CommandArgs<typeof PfAddCommand>) =>
|
|
1222
|
+
this.chain(new PfAddCommand(args, this.commandOptions));
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* @see https://redis.io/commands/pfcount
|
|
1226
|
+
*/
|
|
1227
|
+
pfcount = (...args: CommandArgs<typeof PfCountCommand>) =>
|
|
1228
|
+
this.chain(new PfCountCommand(args, this.commandOptions));
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* @see https://redis.io/commands/pfmerge
|
|
1232
|
+
*/
|
|
1233
|
+
pfmerge = (...args: CommandArgs<typeof PfMergeCommand>) =>
|
|
1234
|
+
this.chain(new PfMergeCommand(args, this.commandOptions));
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* @see https://redis.io/commands/ping
|
|
1238
|
+
* @see node_modules/@upstash/redis/docs/commands/auth/ping.mdx
|
|
1239
|
+
*/
|
|
1240
|
+
ping = (args?: CommandArgs<typeof PingCommand>) =>
|
|
1241
|
+
this.chain(new PingCommand(args, this.commandOptions));
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @see https://redis.io/commands/psetex
|
|
1245
|
+
*/
|
|
1246
|
+
psetex = <TData>(key: string, ttl: number, value: TData) =>
|
|
1247
|
+
this.chain(new PSetEXCommand<TData>([key, ttl, value], this.commandOptions));
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* @see https://redis.io/commands/pttl
|
|
1251
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/pttl.mdx
|
|
1252
|
+
*/
|
|
1253
|
+
pttl = (...args: CommandArgs<typeof PTtlCommand>) =>
|
|
1254
|
+
this.chain(new PTtlCommand(args, this.commandOptions));
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* @see https://redis.io/commands/publish
|
|
1258
|
+
* @see node_modules/@upstash/redis/docs/commands/pubsub/publish.mdx
|
|
1259
|
+
*/
|
|
1260
|
+
publish = (...args: CommandArgs<typeof PublishCommand>) =>
|
|
1261
|
+
this.chain(new PublishCommand(args, this.commandOptions));
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* @see https://redis.io/commands/randomkey
|
|
1265
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/randomkey.mdx
|
|
1266
|
+
*/
|
|
1267
|
+
randomkey = () => this.chain(new RandomKeyCommand(this.commandOptions));
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @see https://redis.io/commands/rename
|
|
1271
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/rename.mdx
|
|
1272
|
+
*/
|
|
1273
|
+
rename = (...args: CommandArgs<typeof RenameCommand>) =>
|
|
1274
|
+
this.chain(new RenameCommand(args, this.commandOptions));
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* @see https://redis.io/commands/renamenx
|
|
1278
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/renamenx.mdx
|
|
1279
|
+
*/
|
|
1280
|
+
renamenx = (...args: CommandArgs<typeof RenameNXCommand>) =>
|
|
1281
|
+
this.chain(new RenameNXCommand(args, this.commandOptions));
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* @see https://redis.io/commands/rpop
|
|
1285
|
+
* @see node_modules/@upstash/redis/docs/commands/list/rpop.mdx
|
|
1286
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1287
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1288
|
+
* to receive raw strings.
|
|
1289
|
+
*/
|
|
1290
|
+
rpop = <TData = string>(...args: CommandArgs<typeof RPopCommand>) =>
|
|
1291
|
+
this.chain(new RPopCommand<TData>(args, this.commandOptions));
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* @see https://redis.io/commands/rpush
|
|
1295
|
+
* @see node_modules/@upstash/redis/docs/commands/list/rpush.mdx
|
|
1296
|
+
*/
|
|
1297
|
+
rpush = <TData>(key: string, ...elements: TData[]) =>
|
|
1298
|
+
this.chain(new RPushCommand([key, ...elements], this.commandOptions));
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* @see https://redis.io/commands/rpushx
|
|
1302
|
+
* @see node_modules/@upstash/redis/docs/commands/list/rpushx.mdx
|
|
1303
|
+
*/
|
|
1304
|
+
rpushx = <TData>(key: string, ...elements: TData[]) =>
|
|
1305
|
+
this.chain(new RPushXCommand([key, ...elements], this.commandOptions));
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* @see https://redis.io/commands/sadd
|
|
1309
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sadd.mdx
|
|
1310
|
+
*/
|
|
1311
|
+
sadd = <TData>(key: string, member: TData, ...members: TData[]) =>
|
|
1312
|
+
this.chain(new SAddCommand<TData>([key, member, ...members], this.commandOptions));
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* @see https://redis.io/commands/scan
|
|
1316
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/scan.mdx
|
|
1317
|
+
*/
|
|
1318
|
+
scan = (...args: CommandArgs<typeof ScanCommand>) =>
|
|
1319
|
+
this.chain(new ScanCommand(args, this.commandOptions));
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* @see https://redis.io/commands/scard
|
|
1323
|
+
* @see node_modules/@upstash/redis/docs/commands/set/scard.mdx
|
|
1324
|
+
*/
|
|
1325
|
+
scard = (...args: CommandArgs<typeof SCardCommand>) =>
|
|
1326
|
+
this.chain(new SCardCommand(args, this.commandOptions));
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* @see https://redis.io/commands/script-exists
|
|
1330
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/script_exists.mdx
|
|
1331
|
+
*/
|
|
1332
|
+
scriptExists = (...args: CommandArgs<typeof ScriptExistsCommand>) =>
|
|
1333
|
+
this.chain(new ScriptExistsCommand(args, this.commandOptions));
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* @see https://redis.io/commands/script-flush
|
|
1337
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/script_flush.mdx
|
|
1338
|
+
*/
|
|
1339
|
+
scriptFlush = (...args: CommandArgs<typeof ScriptFlushCommand>) =>
|
|
1340
|
+
this.chain(new ScriptFlushCommand(args, this.commandOptions));
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* @see https://redis.io/commands/script-load
|
|
1344
|
+
* @see node_modules/@upstash/redis/docs/commands/scripts/script_load.mdx
|
|
1345
|
+
*/
|
|
1346
|
+
scriptLoad = (...args: CommandArgs<typeof ScriptLoadCommand>) =>
|
|
1347
|
+
this.chain(new ScriptLoadCommand(args, this.commandOptions));
|
|
1348
|
+
/*)*
|
|
1349
|
+
* @see https://redis.io/commands/sdiff
|
|
1350
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sdiff.mdx
|
|
1351
|
+
*/
|
|
1352
|
+
sdiff = (...args: CommandArgs<typeof SDiffCommand>) =>
|
|
1353
|
+
this.chain(new SDiffCommand(args, this.commandOptions));
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* @see https://redis.io/commands/sdiffstore
|
|
1357
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sdiffstore.mdx
|
|
1358
|
+
*/
|
|
1359
|
+
sdiffstore = (...args: CommandArgs<typeof SDiffStoreCommand>) =>
|
|
1360
|
+
this.chain(new SDiffStoreCommand(args, this.commandOptions));
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* @see https://redis.io/commands/set
|
|
1364
|
+
* @see node_modules/@upstash/redis/docs/commands/string/set.mdx
|
|
1365
|
+
*/
|
|
1366
|
+
set = <TData>(key: string, value: TData, opts?: SetCommandOptions) =>
|
|
1367
|
+
this.chain(new SetCommand<TData>([key, value, opts], this.commandOptions));
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* @see https://redis.io/commands/setbit
|
|
1371
|
+
* @see node_modules/@upstash/redis/docs/commands/bitmap/setbit.mdx
|
|
1372
|
+
*/
|
|
1373
|
+
setbit = (...args: CommandArgs<typeof SetBitCommand>) =>
|
|
1374
|
+
this.chain(new SetBitCommand(args, this.commandOptions));
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* @see https://redis.io/commands/setex
|
|
1378
|
+
*/
|
|
1379
|
+
setex = <TData>(key: string, ttl: number, value: TData) =>
|
|
1380
|
+
this.chain(new SetExCommand<TData>([key, ttl, value], this.commandOptions));
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* @see https://redis.io/commands/setnx
|
|
1384
|
+
*/
|
|
1385
|
+
setnx = <TData>(key: string, value: TData) =>
|
|
1386
|
+
this.chain(new SetNxCommand<TData>([key, value], this.commandOptions));
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* @see https://redis.io/commands/setrange
|
|
1390
|
+
* @see node_modules/@upstash/redis/docs/commands/string/setrange.mdx
|
|
1391
|
+
*/
|
|
1392
|
+
setrange = (...args: CommandArgs<typeof SetRangeCommand>) =>
|
|
1393
|
+
this.chain(new SetRangeCommand(args, this.commandOptions));
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* @see https://redis.io/commands/sinter
|
|
1397
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sinter.mdx
|
|
1398
|
+
*/
|
|
1399
|
+
sinter = (...args: CommandArgs<typeof SInterCommand>) =>
|
|
1400
|
+
this.chain(new SInterCommand(args, this.commandOptions));
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* @see https://redis.io/commands/sintercard
|
|
1404
|
+
*/
|
|
1405
|
+
sintercard = (...args: CommandArgs<typeof SInterCardCommand>) =>
|
|
1406
|
+
this.chain(new SInterCardCommand(args, this.commandOptions));
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* @see https://redis.io/commands/sinterstore
|
|
1410
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sinterstore.mdx
|
|
1411
|
+
*/
|
|
1412
|
+
sinterstore = (...args: CommandArgs<typeof SInterStoreCommand>) =>
|
|
1413
|
+
this.chain(new SInterStoreCommand(args, this.commandOptions));
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* @see https://redis.io/commands/sismember
|
|
1417
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sismember.mdx
|
|
1418
|
+
*/
|
|
1419
|
+
sismember = <TData>(key: string, member: TData) =>
|
|
1420
|
+
this.chain(new SIsMemberCommand<TData>([key, member], this.commandOptions));
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* @see https://redis.io/commands/smembers
|
|
1424
|
+
* @see node_modules/@upstash/redis/docs/commands/set/smembers.mdx
|
|
1425
|
+
*/
|
|
1426
|
+
smembers = <TData extends unknown[] = string[]>(...args: CommandArgs<typeof SMembersCommand>) =>
|
|
1427
|
+
this.chain(new SMembersCommand<TData>(args, this.commandOptions));
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* @see https://redis.io/commands/smismember
|
|
1431
|
+
* @see node_modules/@upstash/redis/docs/commands/set/smismember.mdx
|
|
1432
|
+
*/
|
|
1433
|
+
smismember = <TMembers extends unknown[]>(key: string, members: TMembers) =>
|
|
1434
|
+
this.chain(new SMIsMemberCommand<TMembers>([key, members], this.commandOptions));
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* @see https://redis.io/commands/smove
|
|
1438
|
+
* @see node_modules/@upstash/redis/docs/commands/set/smove.mdx
|
|
1439
|
+
*/
|
|
1440
|
+
smove = <TData>(source: string, destination: string, member: TData) =>
|
|
1441
|
+
this.chain(new SMoveCommand<TData>([source, destination, member], this.commandOptions));
|
|
1442
|
+
|
|
1443
|
+
/**
|
|
1444
|
+
* @see https://redis.io/commands/spop
|
|
1445
|
+
* @see node_modules/@upstash/redis/docs/commands/set/spop.mdx
|
|
1446
|
+
*/
|
|
1447
|
+
spop = <TData>(...args: CommandArgs<typeof SPopCommand>) =>
|
|
1448
|
+
this.chain(new SPopCommand<TData>(args, this.commandOptions));
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* @see https://redis.io/commands/srandmember
|
|
1452
|
+
* @see node_modules/@upstash/redis/docs/commands/set/srandmember.mdx
|
|
1453
|
+
*/
|
|
1454
|
+
srandmember = <TData>(...args: CommandArgs<typeof SRandMemberCommand>) =>
|
|
1455
|
+
this.chain(new SRandMemberCommand<TData>(args, this.commandOptions));
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* @see https://redis.io/commands/srem
|
|
1459
|
+
* @see node_modules/@upstash/redis/docs/commands/set/srem.mdx
|
|
1460
|
+
*/
|
|
1461
|
+
srem = <TData>(key: string, ...members: TData[]) =>
|
|
1462
|
+
this.chain(new SRemCommand<TData>([key, ...members], this.commandOptions));
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* @see https://redis.io/commands/sscan
|
|
1466
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sscan.mdx
|
|
1467
|
+
*/
|
|
1468
|
+
sscan = (...args: CommandArgs<typeof SScanCommand>) =>
|
|
1469
|
+
this.chain(new SScanCommand(args, this.commandOptions));
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* @see https://redis.io/commands/strlen
|
|
1473
|
+
* @see node_modules/@upstash/redis/docs/commands/string/strlen.mdx
|
|
1474
|
+
*/
|
|
1475
|
+
strlen = (...args: CommandArgs<typeof StrLenCommand>) =>
|
|
1476
|
+
this.chain(new StrLenCommand(args, this.commandOptions));
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* @see https://redis.io/commands/sunion
|
|
1480
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sunion.mdx
|
|
1481
|
+
*/
|
|
1482
|
+
sunion = (...args: CommandArgs<typeof SUnionCommand>) =>
|
|
1483
|
+
this.chain(new SUnionCommand(args, this.commandOptions));
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* @see https://redis.io/commands/sunionstore
|
|
1487
|
+
* @see node_modules/@upstash/redis/docs/commands/set/sunionstore.mdx
|
|
1488
|
+
*/
|
|
1489
|
+
sunionstore = (...args: CommandArgs<typeof SUnionStoreCommand>) =>
|
|
1490
|
+
this.chain(new SUnionStoreCommand(args, this.commandOptions));
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* @see https://redis.io/commands/time
|
|
1494
|
+
*/
|
|
1495
|
+
time = () => this.chain(new TimeCommand(this.commandOptions));
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* @see https://redis.io/commands/touch
|
|
1499
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/touch.mdx
|
|
1500
|
+
*/
|
|
1501
|
+
touch = (...args: CommandArgs<typeof TouchCommand>) =>
|
|
1502
|
+
this.chain(new TouchCommand(args, this.commandOptions));
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
* @see https://redis.io/commands/ttl
|
|
1506
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/ttl.mdx
|
|
1507
|
+
*/
|
|
1508
|
+
ttl = (...args: CommandArgs<typeof TtlCommand>) =>
|
|
1509
|
+
this.chain(new TtlCommand(args, this.commandOptions));
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* @see https://redis.io/commands/type
|
|
1513
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/type.mdx
|
|
1514
|
+
*/
|
|
1515
|
+
type = (...args: CommandArgs<typeof TypeCommand>) =>
|
|
1516
|
+
this.chain(new TypeCommand(args, this.commandOptions));
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @see https://redis.io/commands/unlink
|
|
1520
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/unlink.mdx
|
|
1521
|
+
*/
|
|
1522
|
+
unlink = (...args: CommandArgs<typeof UnlinkCommand>) =>
|
|
1523
|
+
this.chain(new UnlinkCommand(args, this.commandOptions));
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* @see https://redis.io/commands/zadd
|
|
1527
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zadd.mdx
|
|
1528
|
+
*/
|
|
1529
|
+
zadd = <TData>(
|
|
1530
|
+
...args:
|
|
1531
|
+
| [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]]
|
|
1532
|
+
| [
|
|
1533
|
+
key: string,
|
|
1534
|
+
opts: ZAddCommandOptions,
|
|
1535
|
+
...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]],
|
|
1536
|
+
]
|
|
1537
|
+
) => {
|
|
1538
|
+
if ("score" in args[1]) {
|
|
1539
|
+
return this.chain(
|
|
1540
|
+
new ZAddCommand<TData>([args[0], args[1], ...(args.slice(2) as any)], this.commandOptions)
|
|
1541
|
+
);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
return this.chain(
|
|
1545
|
+
new ZAddCommand<TData>(
|
|
1546
|
+
[args[0], args[1] as any, ...(args.slice(2) as any)],
|
|
1547
|
+
this.commandOptions
|
|
1548
|
+
)
|
|
1549
|
+
);
|
|
1550
|
+
};
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* @see https://redis.io/commands/xadd
|
|
1554
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xadd.mdx
|
|
1555
|
+
*/
|
|
1556
|
+
xadd = (...args: CommandArgs<typeof XAddCommand>) =>
|
|
1557
|
+
this.chain(new XAddCommand(args, this.commandOptions));
|
|
1558
|
+
|
|
1559
|
+
/**
|
|
1560
|
+
* @see https://redis.io/commands/xack
|
|
1561
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xack.mdx
|
|
1562
|
+
*/
|
|
1563
|
+
xack = (...args: CommandArgs<typeof XAckCommand>) =>
|
|
1564
|
+
this.chain(new XAckCommand(args, this.commandOptions));
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* @see https://redis.io/commands/xackdel
|
|
1568
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xackdel.mdx
|
|
1569
|
+
*/
|
|
1570
|
+
xackdel = (...args: CommandArgs<typeof XAckDelCommand>) =>
|
|
1571
|
+
this.chain(new XAckDelCommand(args, this.commandOptions));
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* @see https://redis.io/commands/xdel
|
|
1575
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xdel.mdx
|
|
1576
|
+
*/
|
|
1577
|
+
xdel = (...args: CommandArgs<typeof XDelCommand>) =>
|
|
1578
|
+
this.chain(new XDelCommand(args, this.commandOptions));
|
|
1579
|
+
|
|
1580
|
+
/**
|
|
1581
|
+
* @see https://redis.io/commands/xdelex
|
|
1582
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xdelex.mdx
|
|
1583
|
+
*/
|
|
1584
|
+
xdelex = (...args: CommandArgs<typeof XDelExCommand>) =>
|
|
1585
|
+
this.chain(new XDelExCommand(args, this.commandOptions));
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* @see https://redis.io/commands/xgroup
|
|
1589
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xgroup.mdx
|
|
1590
|
+
*/
|
|
1591
|
+
xgroup = (...args: CommandArgs<typeof XGroupCommand>) =>
|
|
1592
|
+
this.chain(new XGroupCommand(args, this.commandOptions));
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* @see https://redis.io/commands/xread
|
|
1596
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xread.mdx
|
|
1597
|
+
*/
|
|
1598
|
+
xread = (...args: CommandArgs<typeof XReadCommand>) =>
|
|
1599
|
+
this.chain(new XReadCommand(args, this.commandOptions));
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* @see https://redis.io/commands/xreadgroup
|
|
1603
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xreadgroup.mdx
|
|
1604
|
+
*/
|
|
1605
|
+
xreadgroup = (...args: CommandArgs<typeof XReadGroupCommand>) =>
|
|
1606
|
+
this.chain(new XReadGroupCommand(args, this.commandOptions));
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* @see https://redis.io/commands/xinfo
|
|
1610
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xinfo.mdx
|
|
1611
|
+
*/
|
|
1612
|
+
xinfo = (...args: CommandArgs<typeof XInfoCommand>) =>
|
|
1613
|
+
this.chain(new XInfoCommand(args, this.commandOptions));
|
|
1614
|
+
|
|
1615
|
+
/**
|
|
1616
|
+
* @see https://redis.io/commands/xlen
|
|
1617
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xlen.mdx
|
|
1618
|
+
*/
|
|
1619
|
+
xlen = (...args: CommandArgs<typeof XLenCommand>) =>
|
|
1620
|
+
this.chain(new XLenCommand(args, this.commandOptions));
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* @see https://redis.io/commands/xpending
|
|
1624
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xpending.mdx
|
|
1625
|
+
*/
|
|
1626
|
+
xpending = (...args: CommandArgs<typeof XPendingCommand>) =>
|
|
1627
|
+
this.chain(new XPendingCommand(args, this.commandOptions));
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* @see https://redis.io/commands/xclaim
|
|
1631
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xclaim.mdx
|
|
1632
|
+
*/
|
|
1633
|
+
xclaim = (...args: CommandArgs<typeof XClaimCommand>) =>
|
|
1634
|
+
this.chain(new XClaimCommand(args, this.commandOptions));
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* @see https://redis.io/commands/xautoclaim
|
|
1638
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xautoclaim.mdx
|
|
1639
|
+
*/
|
|
1640
|
+
xautoclaim = (...args: CommandArgs<typeof XAutoClaim>) =>
|
|
1641
|
+
this.chain(new XAutoClaim(args, this.commandOptions));
|
|
1642
|
+
|
|
1643
|
+
/**
|
|
1644
|
+
* @see https://redis.io/commands/xtrim
|
|
1645
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xtrim.mdx
|
|
1646
|
+
*/
|
|
1647
|
+
xtrim = (...args: CommandArgs<typeof XTrimCommand>) =>
|
|
1648
|
+
this.chain(new XTrimCommand(args, this.commandOptions));
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* @see https://redis.io/commands/xrange
|
|
1652
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xrange.mdx
|
|
1653
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1654
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1655
|
+
* to receive raw strings.
|
|
1656
|
+
* With automaticDeserialization: false, xrange returns [id, [field, value, ...]] entries instead,
|
|
1657
|
+
* such as [["1790341484470-0", ["text", "123"]]], and [] for a missing key.
|
|
1658
|
+
*/
|
|
1659
|
+
xrange = <TData extends Record<string, unknown>>(...args: CommandArgs<typeof XRangeCommand>) =>
|
|
1660
|
+
this.chain(new XRangeCommand<Record<string, TData>>(args, this.commandOptions));
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* @see https://redis.io/commands/xrevrange
|
|
1664
|
+
* @see node_modules/@upstash/redis/docs/commands/stream/xrevrange.mdx
|
|
1665
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1666
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1667
|
+
* to receive raw strings.
|
|
1668
|
+
* With automaticDeserialization: false, xrevrange returns [id, [field, value, ...]] entries instead,
|
|
1669
|
+
* such as [["1790341484470-0", ["text", "123"]]], and [] for a missing key.
|
|
1670
|
+
*/
|
|
1671
|
+
xrevrange = <TData extends Record<string, unknown>>(
|
|
1672
|
+
...args: CommandArgs<typeof XRevRangeCommand>
|
|
1673
|
+
) => this.chain(new XRevRangeCommand<Record<string, TData>>(args, this.commandOptions));
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* @see https://redis.io/commands/zcard
|
|
1677
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zcard.mdx
|
|
1678
|
+
*/
|
|
1679
|
+
zcard = (...args: CommandArgs<typeof ZCardCommand>) =>
|
|
1680
|
+
this.chain(new ZCardCommand(args, this.commandOptions));
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* @see https://redis.io/commands/zcount
|
|
1684
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zcount.mdx
|
|
1685
|
+
*/
|
|
1686
|
+
zcount = (...args: CommandArgs<typeof ZCountCommand>) =>
|
|
1687
|
+
this.chain(new ZCountCommand(args, this.commandOptions));
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* @see https://redis.io/commands/zincrby
|
|
1691
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zincrby.mdx
|
|
1692
|
+
*/
|
|
1693
|
+
zincrby = <TData>(key: string, increment: number, member: TData) =>
|
|
1694
|
+
this.chain(new ZIncrByCommand<TData>([key, increment, member], this.commandOptions));
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* @see https://redis.io/commands/zinterstore
|
|
1698
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zinterstore.mdx
|
|
1699
|
+
*/
|
|
1700
|
+
zinterstore = (...args: CommandArgs<typeof ZInterStoreCommand>) =>
|
|
1701
|
+
this.chain(new ZInterStoreCommand(args, this.commandOptions));
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* @see https://redis.io/commands/zlexcount
|
|
1705
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zlexcount.mdx
|
|
1706
|
+
*/
|
|
1707
|
+
zlexcount = (...args: CommandArgs<typeof ZLexCountCommand>) =>
|
|
1708
|
+
this.chain(new ZLexCountCommand(args, this.commandOptions));
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* @see https://redis.io/commands/zmscore
|
|
1712
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zmscore.mdx
|
|
1713
|
+
*/
|
|
1714
|
+
zmscore = (...args: CommandArgs<typeof ZMScoreCommand>) =>
|
|
1715
|
+
this.chain(new ZMScoreCommand(args, this.commandOptions));
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* @see https://redis.io/commands/zpopmax
|
|
1719
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zpopmax.mdx
|
|
1720
|
+
*/
|
|
1721
|
+
zpopmax = <TData>(...args: CommandArgs<typeof ZPopMaxCommand>) =>
|
|
1722
|
+
this.chain(new ZPopMaxCommand<TData>(args, this.commandOptions));
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* @see https://redis.io/commands/zpopmin
|
|
1726
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zpopmin.mdx
|
|
1727
|
+
*/
|
|
1728
|
+
zpopmin = <TData>(...args: CommandArgs<typeof ZPopMinCommand>) =>
|
|
1729
|
+
this.chain(new ZPopMinCommand<TData>(args, this.commandOptions));
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* @see https://redis.io/commands/zrange
|
|
1733
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zrange.mdx
|
|
1734
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
1735
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
1736
|
+
* to receive raw strings.
|
|
1737
|
+
*/
|
|
1738
|
+
zrange = <TData extends unknown[]>(
|
|
1739
|
+
...args:
|
|
1740
|
+
| [key: string, min: number, max: number, opts?: ZRangeCommandOptions]
|
|
1741
|
+
| [
|
|
1742
|
+
key: string,
|
|
1743
|
+
min: `(${string}` | `[${string}` | "-" | "+",
|
|
1744
|
+
max: `(${string}` | `[${string}` | "-" | "+",
|
|
1745
|
+
opts: { byLex: true } & ZRangeCommandOptions,
|
|
1746
|
+
]
|
|
1747
|
+
| [
|
|
1748
|
+
key: string,
|
|
1749
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
1750
|
+
max: number | `(${number}` | "-inf" | "+inf",
|
|
1751
|
+
opts: { byScore: true } & ZRangeCommandOptions,
|
|
1752
|
+
]
|
|
1753
|
+
) => this.chain(new ZRangeCommand<TData>(args as any, this.commandOptions));
|
|
1754
|
+
|
|
1755
|
+
/**
|
|
1756
|
+
* @see https://redis.io/commands/zrank
|
|
1757
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zrank.mdx
|
|
1758
|
+
*/
|
|
1759
|
+
zrank = <TData>(key: string, member: TData) =>
|
|
1760
|
+
this.chain(new ZRankCommand<TData>([key, member], this.commandOptions));
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* @see https://redis.io/commands/zrem
|
|
1764
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zrem.mdx
|
|
1765
|
+
*/
|
|
1766
|
+
zrem = <TData>(key: string, ...members: TData[]) =>
|
|
1767
|
+
this.chain(new ZRemCommand<TData>([key, ...members], this.commandOptions));
|
|
1768
|
+
|
|
1769
|
+
/**
|
|
1770
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
1771
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zremrangebylex.mdx
|
|
1772
|
+
*/
|
|
1773
|
+
zremrangebylex = (...args: CommandArgs<typeof ZRemRangeByLexCommand>) =>
|
|
1774
|
+
this.chain(new ZRemRangeByLexCommand(args, this.commandOptions));
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
1778
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zremrangebyrank.mdx
|
|
1779
|
+
*/
|
|
1780
|
+
zremrangebyrank = (...args: CommandArgs<typeof ZRemRangeByRankCommand>) =>
|
|
1781
|
+
this.chain(new ZRemRangeByRankCommand(args, this.commandOptions));
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
1785
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zremrangebyscore.mdx
|
|
1786
|
+
*/
|
|
1787
|
+
zremrangebyscore = (...args: CommandArgs<typeof ZRemRangeByScoreCommand>) =>
|
|
1788
|
+
this.chain(new ZRemRangeByScoreCommand(args, this.commandOptions));
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* @see https://redis.io/commands/zrevrank
|
|
1792
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zrevrank.mdx
|
|
1793
|
+
*/
|
|
1794
|
+
zrevrank = <TData>(key: string, member: TData) =>
|
|
1795
|
+
this.chain(new ZRevRankCommand<TData>([key, member], this.commandOptions));
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* @see https://redis.io/commands/zscan
|
|
1799
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zscan.mdx
|
|
1800
|
+
*/
|
|
1801
|
+
zscan = (...args: CommandArgs<typeof ZScanCommand>) =>
|
|
1802
|
+
this.chain(new ZScanCommand(args, this.commandOptions));
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* @see https://redis.io/commands/zscore
|
|
1806
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zscore.mdx
|
|
1807
|
+
*/
|
|
1808
|
+
zscore = <TData>(key: string, member: TData) =>
|
|
1809
|
+
this.chain(new ZScoreCommand<TData>([key, member], this.commandOptions));
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* @see https://redis.io/commands/zunionstore
|
|
1813
|
+
* @see node_modules/@upstash/redis/docs/commands/zset/zunionstore.mdx
|
|
1814
|
+
*/
|
|
1815
|
+
zunionstore = (...args: CommandArgs<typeof ZUnionStoreCommand>) =>
|
|
1816
|
+
this.chain(new ZUnionStoreCommand(args, this.commandOptions));
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* @see https://redis.io/commands/zunion
|
|
1820
|
+
*/
|
|
1821
|
+
zunion = (...args: CommandArgs<typeof ZUnionCommand>) =>
|
|
1822
|
+
this.chain(new ZUnionCommand(args, this.commandOptions));
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* @see https://redis.io/commands/?group=json
|
|
1826
|
+
*/
|
|
1827
|
+
get json() {
|
|
1828
|
+
return {
|
|
1829
|
+
/**
|
|
1830
|
+
* @see https://redis.io/commands/json.arrappend
|
|
1831
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrappend.mdx
|
|
1832
|
+
*/
|
|
1833
|
+
arrappend: (...args: CommandArgs<typeof JsonArrAppendCommand>) =>
|
|
1834
|
+
this.chain(new JsonArrAppendCommand(args, this.commandOptions)),
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* @see https://redis.io/commands/json.arrindex
|
|
1838
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrindex.mdx
|
|
1839
|
+
*/
|
|
1840
|
+
arrindex: (...args: CommandArgs<typeof JsonArrIndexCommand>) =>
|
|
1841
|
+
this.chain(new JsonArrIndexCommand(args, this.commandOptions)),
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
1845
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrinsert.mdx
|
|
1846
|
+
*/
|
|
1847
|
+
arrinsert: (...args: CommandArgs<typeof JsonArrInsertCommand>) =>
|
|
1848
|
+
this.chain(new JsonArrInsertCommand(args, this.commandOptions)),
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* @see https://redis.io/commands/json.arrlen
|
|
1852
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrlen.mdx
|
|
1853
|
+
*/
|
|
1854
|
+
arrlen: (...args: CommandArgs<typeof JsonArrLenCommand>) =>
|
|
1855
|
+
this.chain(new JsonArrLenCommand(args, this.commandOptions)),
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* @see https://redis.io/commands/json.arrpop
|
|
1859
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrpop.mdx
|
|
1860
|
+
*/
|
|
1861
|
+
arrpop: (...args: CommandArgs<typeof JsonArrPopCommand>) =>
|
|
1862
|
+
this.chain(new JsonArrPopCommand(args, this.commandOptions)),
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
1866
|
+
* @see node_modules/@upstash/redis/docs/commands/json/arrtrim.mdx
|
|
1867
|
+
*/
|
|
1868
|
+
arrtrim: (...args: CommandArgs<typeof JsonArrTrimCommand>) =>
|
|
1869
|
+
this.chain(new JsonArrTrimCommand(args, this.commandOptions)),
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* @see https://redis.io/commands/json.clear
|
|
1873
|
+
* @see node_modules/@upstash/redis/docs/commands/json/clear.mdx
|
|
1874
|
+
*/
|
|
1875
|
+
clear: (...args: CommandArgs<typeof JsonClearCommand>) =>
|
|
1876
|
+
this.chain(new JsonClearCommand(args, this.commandOptions)),
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* @see https://redis.io/commands/json.del
|
|
1880
|
+
* @see node_modules/@upstash/redis/docs/commands/json/del.mdx
|
|
1881
|
+
*/
|
|
1882
|
+
del: (...args: CommandArgs<typeof JsonDelCommand>) =>
|
|
1883
|
+
this.chain(new JsonDelCommand(args, this.commandOptions)),
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* @see https://redis.io/commands/json.forget
|
|
1887
|
+
* @see node_modules/@upstash/redis/docs/commands/json/forget.mdx
|
|
1888
|
+
*/
|
|
1889
|
+
forget: (...args: CommandArgs<typeof JsonForgetCommand>) =>
|
|
1890
|
+
this.chain(new JsonForgetCommand(args, this.commandOptions)),
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* @see https://redis.io/commands/json.get
|
|
1894
|
+
* @see node_modules/@upstash/redis/docs/commands/json/get.mdx
|
|
1895
|
+
*/
|
|
1896
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) =>
|
|
1897
|
+
this.chain(new JsonGetCommand(args, this.commandOptions)),
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* @see https://redis.io/commands/json.merge
|
|
1901
|
+
* @see node_modules/@upstash/redis/docs/commands/json/merge.mdx
|
|
1902
|
+
*/
|
|
1903
|
+
merge: (...args: CommandArgs<typeof JsonMergeCommand>) =>
|
|
1904
|
+
this.chain(new JsonMergeCommand(args, this.commandOptions)),
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* @see https://redis.io/commands/json.mget
|
|
1908
|
+
* @see node_modules/@upstash/redis/docs/commands/json/mget.mdx
|
|
1909
|
+
*/
|
|
1910
|
+
mget: (...args: CommandArgs<typeof JsonMGetCommand>) =>
|
|
1911
|
+
this.chain(new JsonMGetCommand(args, this.commandOptions)),
|
|
1912
|
+
|
|
1913
|
+
/**
|
|
1914
|
+
* @see https://redis.io/commands/json.mset
|
|
1915
|
+
* @see node_modules/@upstash/redis/docs/commands/json/mset.mdx
|
|
1916
|
+
*/
|
|
1917
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) =>
|
|
1918
|
+
this.chain(new JsonMSetCommand(args, this.commandOptions)),
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* @see https://redis.io/commands/json.numincrby
|
|
1922
|
+
* @see node_modules/@upstash/redis/docs/commands/json/numincrby.mdx
|
|
1923
|
+
*/
|
|
1924
|
+
numincrby: (...args: CommandArgs<typeof JsonNumIncrByCommand>) =>
|
|
1925
|
+
this.chain(new JsonNumIncrByCommand(args, this.commandOptions)),
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* @see https://redis.io/commands/json.nummultby
|
|
1929
|
+
* @see node_modules/@upstash/redis/docs/commands/json/nummultby.mdx
|
|
1930
|
+
*/
|
|
1931
|
+
nummultby: (...args: CommandArgs<typeof JsonNumMultByCommand>) =>
|
|
1932
|
+
this.chain(new JsonNumMultByCommand(args, this.commandOptions)),
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* @see https://redis.io/commands/json.objkeys
|
|
1936
|
+
* @see node_modules/@upstash/redis/docs/commands/json/objkeys.mdx
|
|
1937
|
+
*/
|
|
1938
|
+
objkeys: (...args: CommandArgs<typeof JsonObjKeysCommand>) =>
|
|
1939
|
+
this.chain(new JsonObjKeysCommand(args, this.commandOptions)),
|
|
1940
|
+
|
|
1941
|
+
/**
|
|
1942
|
+
* @see https://redis.io/commands/json.objlen
|
|
1943
|
+
* @see node_modules/@upstash/redis/docs/commands/json/objlen.mdx
|
|
1944
|
+
*/
|
|
1945
|
+
objlen: (...args: CommandArgs<typeof JsonObjLenCommand>) =>
|
|
1946
|
+
this.chain(new JsonObjLenCommand(args, this.commandOptions)),
|
|
1947
|
+
|
|
1948
|
+
/**
|
|
1949
|
+
* @see https://redis.io/commands/json.resp
|
|
1950
|
+
*/
|
|
1951
|
+
resp: (...args: CommandArgs<typeof JsonRespCommand>) =>
|
|
1952
|
+
this.chain(new JsonRespCommand(args, this.commandOptions)),
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* @see https://redis.io/commands/json.set
|
|
1956
|
+
* @see node_modules/@upstash/redis/docs/commands/json/set.mdx
|
|
1957
|
+
*/
|
|
1958
|
+
set: (...args: CommandArgs<typeof JsonSetCommand>) =>
|
|
1959
|
+
this.chain(new JsonSetCommand(args, this.commandOptions)),
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* @see https://redis.io/commands/json.strappend
|
|
1963
|
+
* @see node_modules/@upstash/redis/docs/commands/json/strappend.mdx
|
|
1964
|
+
*/
|
|
1965
|
+
strappend: (...args: CommandArgs<typeof JsonStrAppendCommand>) =>
|
|
1966
|
+
this.chain(new JsonStrAppendCommand(args, this.commandOptions)),
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* @see https://redis.io/commands/json.strlen
|
|
1970
|
+
* @see node_modules/@upstash/redis/docs/commands/json/strlen.mdx
|
|
1971
|
+
*/
|
|
1972
|
+
strlen: (...args: CommandArgs<typeof JsonStrLenCommand>) =>
|
|
1973
|
+
this.chain(new JsonStrLenCommand(args, this.commandOptions)),
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* @see https://redis.io/commands/json.toggle
|
|
1977
|
+
* @see node_modules/@upstash/redis/docs/commands/json/toggle.mdx
|
|
1978
|
+
*/
|
|
1979
|
+
toggle: (...args: CommandArgs<typeof JsonToggleCommand>) =>
|
|
1980
|
+
this.chain(new JsonToggleCommand(args, this.commandOptions)),
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* @see https://redis.io/commands/json.type
|
|
1984
|
+
* @see node_modules/@upstash/redis/docs/commands/json/type.mdx
|
|
1985
|
+
*/
|
|
1986
|
+
type: (...args: CommandArgs<typeof JsonTypeCommand>) =>
|
|
1987
|
+
this.chain(new JsonTypeCommand(args, this.commandOptions)),
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
get functions() {
|
|
1992
|
+
return {
|
|
1993
|
+
/**
|
|
1994
|
+
* @see https://redis.io/docs/latest/commands/function-load/
|
|
1995
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/load.mdx
|
|
1996
|
+
*/
|
|
1997
|
+
load: (...args: CommandArgs<typeof FunctionLoadCommand>) =>
|
|
1998
|
+
this.chain(new FunctionLoadCommand(args, this.commandOptions)),
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* @see https://redis.io/docs/latest/commands/function-list/
|
|
2002
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/list.mdx
|
|
2003
|
+
*/
|
|
2004
|
+
list: (...args: CommandArgs<typeof FunctionListCommand>) =>
|
|
2005
|
+
this.chain(new FunctionListCommand(args, this.commandOptions)),
|
|
2006
|
+
|
|
2007
|
+
/**
|
|
2008
|
+
* @see https://redis.io/docs/latest/commands/function-delete/
|
|
2009
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/delete.mdx
|
|
2010
|
+
*/
|
|
2011
|
+
delete: (...args: CommandArgs<typeof FunctionDeleteCommand>) =>
|
|
2012
|
+
this.chain(new FunctionDeleteCommand(args, this.commandOptions)),
|
|
2013
|
+
|
|
2014
|
+
/**
|
|
2015
|
+
* @see https://redis.io/docs/latest/commands/function-flush/
|
|
2016
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/flush.mdx
|
|
2017
|
+
*/
|
|
2018
|
+
flush: () => this.chain(new FunctionFlushCommand(this.commandOptions)),
|
|
2019
|
+
|
|
2020
|
+
/**
|
|
2021
|
+
* @see https://redis.io/docs/latest/commands/function-stats/
|
|
2022
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/stats.mdx
|
|
2023
|
+
*/
|
|
2024
|
+
stats: () => this.chain(new FunctionStatsCommand(this.commandOptions)),
|
|
2025
|
+
|
|
2026
|
+
/**
|
|
2027
|
+
* @see https://redis.io/docs/latest/commands/fcall/
|
|
2028
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/call.mdx
|
|
2029
|
+
*/
|
|
2030
|
+
call: <TData = unknown>(...args: CommandArgs<typeof FCallCommand<TData>>) =>
|
|
2031
|
+
this.chain(new FCallCommand<TData>(args, this.commandOptions)),
|
|
2032
|
+
|
|
2033
|
+
/**
|
|
2034
|
+
* @see https://redis.io/docs/latest/commands/fcall_ro/
|
|
2035
|
+
* @see node_modules/@upstash/redis/docs/commands/functions/call_ro.mdx
|
|
2036
|
+
*/
|
|
2037
|
+
callRo: <TData = unknown>(...args: CommandArgs<typeof FCallRoCommand<TData>>) =>
|
|
2038
|
+
this.chain(new FCallRoCommand<TData>(args, this.commandOptions)),
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
}
|