@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,27 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.mset
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/mset.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonMSetCommand<
|
|
9
|
+
TData extends
|
|
10
|
+
| number
|
|
11
|
+
| string
|
|
12
|
+
| boolean
|
|
13
|
+
| Record<string, unknown>
|
|
14
|
+
| (number | string | boolean | Record<string, unknown>)[],
|
|
15
|
+
> extends Command<"OK" | null, "OK" | null> {
|
|
16
|
+
constructor(
|
|
17
|
+
cmd: { key: string; path: string; value: TData }[],
|
|
18
|
+
opts?: CommandOptions<"OK" | null, "OK" | null>
|
|
19
|
+
) {
|
|
20
|
+
const command: unknown[] = ["JSON.MSET"];
|
|
21
|
+
|
|
22
|
+
for (const c of cmd) {
|
|
23
|
+
command.push(c.key, c.path, c.value);
|
|
24
|
+
}
|
|
25
|
+
super(command, opts);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.numincrby
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/numincrby.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path: string, value: number],
|
|
11
|
+
opts?: CommandOptions<(null | string)[], (null | number)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.NUMINCRBY", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.nummultby
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/nummultby.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path: string, value: number],
|
|
11
|
+
opts?: CommandOptions<(null | string)[], (null | number)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.NUMMULTBY", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.objkeys
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/objkeys.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path?: string],
|
|
11
|
+
opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.OBJKEYS", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.objlen
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/objlen.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path?: string],
|
|
11
|
+
opts?: CommandOptions<(number | null)[], (number | null)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.OBJLEN", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.resp
|
|
6
|
+
*/
|
|
7
|
+
export class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
|
|
8
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>) {
|
|
9
|
+
super(["JSON.RESP", ...cmd], opts);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.set
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/set.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonSetCommand<
|
|
9
|
+
TData extends
|
|
10
|
+
| number
|
|
11
|
+
| string
|
|
12
|
+
| boolean
|
|
13
|
+
| Record<string, unknown>
|
|
14
|
+
| (number | string | boolean | Record<string, unknown>)[],
|
|
15
|
+
> extends Command<"OK" | null, "OK" | null> {
|
|
16
|
+
constructor(
|
|
17
|
+
cmd: [
|
|
18
|
+
key: string,
|
|
19
|
+
path: string,
|
|
20
|
+
value: TData,
|
|
21
|
+
opts?: { nx: true; xx?: never } | { nx?: never; xx: true },
|
|
22
|
+
],
|
|
23
|
+
opts?: CommandOptions<"OK" | null, "OK" | null>
|
|
24
|
+
) {
|
|
25
|
+
const command = ["JSON.SET", cmd[0], cmd[1], cmd[2]];
|
|
26
|
+
if (cmd[3]) {
|
|
27
|
+
if (cmd[3].nx) {
|
|
28
|
+
command.push("NX");
|
|
29
|
+
} else if (cmd[3].xx) {
|
|
30
|
+
command.push("XX");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
super(command, opts);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.strappend
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/strappend.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path: string, value: string],
|
|
11
|
+
opts?: CommandOptions<(null | string)[], (null | number)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.STRAPPEND", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.strlen
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/strlen.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, path?: string],
|
|
11
|
+
opts?: CommandOptions<(number | null)[], (number | null)[]>
|
|
12
|
+
) {
|
|
13
|
+
super(["JSON.STRLEN", ...cmd], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.toggle
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/toggle.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonToggleCommand extends Command<number[], number[]> {
|
|
9
|
+
constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>) {
|
|
10
|
+
super(["JSON.TOGGLE", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/json.type
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/json/type.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class JsonTypeCommand extends Command<string[], string[]> {
|
|
9
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>) {
|
|
10
|
+
super(["JSON.TYPE", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/keys
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/generic/keys.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class KeysCommand extends Command<string[], string[]> {
|
|
9
|
+
constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>) {
|
|
10
|
+
super(["keys", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
export class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
5
|
+
constructor(
|
|
6
|
+
cmd: [key: string, index: number],
|
|
7
|
+
opts?: CommandOptions<unknown | null, TData | null>
|
|
8
|
+
) {
|
|
9
|
+
super(["lindex", ...cmd], opts);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
export class LInsertCommand<TData = string> extends Command<number, number> {
|
|
4
|
+
constructor(
|
|
5
|
+
cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData],
|
|
6
|
+
opts?: CommandOptions<number, number>
|
|
7
|
+
) {
|
|
8
|
+
super(["linsert", ...cmd], opts);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/llen
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/llen.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class LLenCommand extends Command<number, number> {
|
|
9
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>) {
|
|
10
|
+
super(["llen", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lmove
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lmove.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class LMoveCommand<TData = string> extends Command<TData, TData> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [
|
|
11
|
+
source: string,
|
|
12
|
+
destination: string,
|
|
13
|
+
whereFrom: "left" | "right",
|
|
14
|
+
whereTo: "left" | "right",
|
|
15
|
+
],
|
|
16
|
+
opts?: CommandOptions<TData, TData>
|
|
17
|
+
) {
|
|
18
|
+
super(["lmove", ...cmd], opts);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lmpop
|
|
6
|
+
*/
|
|
7
|
+
export class LmPopCommand<TValues> extends Command<
|
|
8
|
+
[string, TValues[]] | null,
|
|
9
|
+
[string, TValues[]] | null
|
|
10
|
+
> {
|
|
11
|
+
constructor(
|
|
12
|
+
cmd: [numkeys: number, keys: string[], "LEFT" | "RIGHT", count?: number],
|
|
13
|
+
opts?: CommandOptions<[string, TValues[]] | null, [string, TValues[]] | null>
|
|
14
|
+
) {
|
|
15
|
+
const [numkeys, keys, direction, count] = cmd;
|
|
16
|
+
|
|
17
|
+
super(["LMPOP", numkeys, ...keys, direction, ...(count ? ["COUNT", count] : [])], opts);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lpop
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpop.mdx
|
|
7
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
8
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
9
|
+
* to receive raw strings.
|
|
10
|
+
*/
|
|
11
|
+
export class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
12
|
+
constructor(
|
|
13
|
+
cmd: [key: string, count?: number],
|
|
14
|
+
opts?: CommandOptions<unknown | null, TData | null>
|
|
15
|
+
) {
|
|
16
|
+
super(["lpop", ...cmd], opts);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lpos
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpos.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class LPosCommand<TData = number> extends Command<TData, TData> {
|
|
9
|
+
constructor(
|
|
10
|
+
cmd: [key: string, element: unknown, opts?: { rank?: number; count?: number; maxLen?: number }],
|
|
11
|
+
opts?: CommandOptions<TData, TData>
|
|
12
|
+
) {
|
|
13
|
+
const args = ["lpos", cmd[0], cmd[1]];
|
|
14
|
+
|
|
15
|
+
if (typeof cmd[2]?.rank === "number") {
|
|
16
|
+
args.push("rank", cmd[2].rank);
|
|
17
|
+
}
|
|
18
|
+
if (typeof cmd[2]?.count === "number") {
|
|
19
|
+
args.push("count", cmd[2].count);
|
|
20
|
+
}
|
|
21
|
+
if (typeof cmd[2]?.maxLen === "number") {
|
|
22
|
+
args.push("maxLen", cmd[2].maxLen);
|
|
23
|
+
}
|
|
24
|
+
super(args, opts);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lpush
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpush.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class LPushCommand<TData = string> extends Command<number, number> {
|
|
9
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>) {
|
|
10
|
+
super(["lpush", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/lpushx
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/list/lpushx.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class LPushXCommand<TData> extends Command<number, number> {
|
|
9
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>) {
|
|
10
|
+
super(["lpushx", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
export class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
|
|
5
|
+
constructor(
|
|
6
|
+
cmd: [key: string, start: number, end: number],
|
|
7
|
+
opts?: CommandOptions<unknown[], TData[]>
|
|
8
|
+
) {
|
|
9
|
+
super(["lrange", ...cmd], opts);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
export class LRemCommand<TData> extends Command<number, number> {
|
|
4
|
+
constructor(
|
|
5
|
+
cmd: [key: string, count: number, value: TData],
|
|
6
|
+
opts?: CommandOptions<number, number>
|
|
7
|
+
) {
|
|
8
|
+
super(["lrem", ...cmd], opts);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
export class LSetCommand<TData = string> extends Command<"OK", "OK"> {
|
|
5
|
+
constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">) {
|
|
6
|
+
super(["lset", ...cmd], opts);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
export class LTrimCommand extends Command<"OK", "OK"> {
|
|
5
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">) {
|
|
6
|
+
super(["ltrim", ...cmd], opts);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
/**
|
|
4
|
+
* @see https://redis.io/commands/mget
|
|
5
|
+
* @see node_modules/@upstash/redis/docs/commands/string/mget.mdx
|
|
6
|
+
* Responses are JSON-parsed automatically: a stored "123" comes back as the number 123, "true" as
|
|
7
|
+
* true, and '{"a":1}' as an object. Pass automaticDeserialization: false to the Redis constructor
|
|
8
|
+
* to receive raw strings.
|
|
9
|
+
*/
|
|
10
|
+
export class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
11
|
+
constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>) {
|
|
12
|
+
const keys = Array.isArray(cmd[0]) ? cmd[0] : (cmd as string[]);
|
|
13
|
+
super(["mget", ...keys], opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
export * from "./append";
|
|
2
|
+
export * from "./arcount";
|
|
3
|
+
export * from "./ardel";
|
|
4
|
+
export * from "./ardelrange";
|
|
5
|
+
export * from "./arget";
|
|
6
|
+
export * from "./argetrange";
|
|
7
|
+
export * from "./argrep";
|
|
8
|
+
export * from "./arinfo";
|
|
9
|
+
export * from "./arinsert";
|
|
10
|
+
export * from "./arlastitems";
|
|
11
|
+
export * from "./arlen";
|
|
12
|
+
export * from "./armget";
|
|
13
|
+
export * from "./armset";
|
|
14
|
+
export * from "./arnext";
|
|
15
|
+
export * from "./arop";
|
|
16
|
+
export * from "./arring";
|
|
17
|
+
export * from "./arscan";
|
|
18
|
+
export * from "./arseek";
|
|
19
|
+
export * from "./arset";
|
|
20
|
+
export * from "./bitcount";
|
|
21
|
+
export * from "./bitfield";
|
|
22
|
+
export * from "./bitop";
|
|
23
|
+
export * from "./bitpos";
|
|
24
|
+
export * from "./client_setinfo";
|
|
25
|
+
export * from "./command";
|
|
26
|
+
export * from "./copy";
|
|
27
|
+
export * from "./dbsize";
|
|
28
|
+
export * from "./decr";
|
|
29
|
+
export * from "./decrby";
|
|
30
|
+
export * from "./del";
|
|
31
|
+
export * from "./echo";
|
|
32
|
+
export * from "./evalRo";
|
|
33
|
+
export * from "./eval";
|
|
34
|
+
export * from "./evalshaRo";
|
|
35
|
+
export * from "./evalsha";
|
|
36
|
+
export * from "./exec";
|
|
37
|
+
export * from "./exists";
|
|
38
|
+
export * from "./expire";
|
|
39
|
+
export * from "./expireat";
|
|
40
|
+
export * from "./fcall";
|
|
41
|
+
export * from "./fcall_ro";
|
|
42
|
+
export * from "./flushall";
|
|
43
|
+
export * from "./flushdb";
|
|
44
|
+
export * from "./function_delete";
|
|
45
|
+
export * from "./function_flush";
|
|
46
|
+
export * from "./function_list";
|
|
47
|
+
export * from "./function_load";
|
|
48
|
+
export * from "./function_stats";
|
|
49
|
+
export * from "./geo_add";
|
|
50
|
+
export * from "./geo_dist";
|
|
51
|
+
export * from "./geo_hash";
|
|
52
|
+
export * from "./geo_pos";
|
|
53
|
+
export * from "./geo_search";
|
|
54
|
+
export * from "./geo_search_store";
|
|
55
|
+
export * from "./get";
|
|
56
|
+
export * from "./getbit";
|
|
57
|
+
export * from "./getdel";
|
|
58
|
+
export * from "./getex";
|
|
59
|
+
export * from "./getrange";
|
|
60
|
+
export * from "./getset";
|
|
61
|
+
export * from "./hdel";
|
|
62
|
+
export * from "./hexists";
|
|
63
|
+
export * from "./hexpire";
|
|
64
|
+
export * from "./hexpireat";
|
|
65
|
+
export * from "./hexpiretime";
|
|
66
|
+
export * from "./hpersist";
|
|
67
|
+
export * from "./hpexpire";
|
|
68
|
+
export * from "./hpexpireat";
|
|
69
|
+
export * from "./hpexpiretime";
|
|
70
|
+
export * from "./hpttl";
|
|
71
|
+
export * from "./hget";
|
|
72
|
+
export * from "./hgetall";
|
|
73
|
+
export * from "./hgetdel";
|
|
74
|
+
export * from "./hgetex";
|
|
75
|
+
export * from "./hincrby";
|
|
76
|
+
export * from "./hincrbyfloat";
|
|
77
|
+
export * from "./hkeys";
|
|
78
|
+
export * from "./hlen";
|
|
79
|
+
export * from "./hmget";
|
|
80
|
+
export * from "./hmset";
|
|
81
|
+
export * from "./hrandfield";
|
|
82
|
+
export * from "./hscan";
|
|
83
|
+
export * from "./hset";
|
|
84
|
+
export * from "./hsetex";
|
|
85
|
+
export * from "./hsetnx";
|
|
86
|
+
export * from "./hstrlen";
|
|
87
|
+
export * from "./httl";
|
|
88
|
+
export * from "./hvals";
|
|
89
|
+
export * from "./incr";
|
|
90
|
+
export * from "./incrby";
|
|
91
|
+
export * from "./incrbyfloat";
|
|
92
|
+
export * from "./json_arrappend";
|
|
93
|
+
export * from "./json_arrindex";
|
|
94
|
+
export * from "./json_arrinsert";
|
|
95
|
+
export * from "./json_arrlen";
|
|
96
|
+
export * from "./json_arrpop";
|
|
97
|
+
export * from "./json_arrtrim";
|
|
98
|
+
export * from "./json_clear";
|
|
99
|
+
export * from "./json_del";
|
|
100
|
+
export * from "./json_forget";
|
|
101
|
+
export * from "./json_get";
|
|
102
|
+
export * from "./json_merge";
|
|
103
|
+
export * from "./json_mget";
|
|
104
|
+
export * from "./json_mset";
|
|
105
|
+
export * from "./json_numincrby";
|
|
106
|
+
export * from "./json_nummultby";
|
|
107
|
+
export * from "./json_objkeys";
|
|
108
|
+
export * from "./json_objlen";
|
|
109
|
+
export * from "./json_resp";
|
|
110
|
+
export * from "./json_set";
|
|
111
|
+
export * from "./json_strappend";
|
|
112
|
+
export * from "./json_strlen";
|
|
113
|
+
export * from "./json_toggle";
|
|
114
|
+
export * from "./json_type";
|
|
115
|
+
export * from "./keys";
|
|
116
|
+
export * from "./lindex";
|
|
117
|
+
export * from "./linsert";
|
|
118
|
+
export * from "./llen";
|
|
119
|
+
export * from "./lmove";
|
|
120
|
+
export * from "./lmpop";
|
|
121
|
+
export * from "./lpop";
|
|
122
|
+
export * from "./lpos";
|
|
123
|
+
export * from "./lpush";
|
|
124
|
+
export * from "./lpushx";
|
|
125
|
+
export * from "./lrange";
|
|
126
|
+
export * from "./lrem";
|
|
127
|
+
export * from "./lset";
|
|
128
|
+
export * from "./ltrim";
|
|
129
|
+
export * from "./mget";
|
|
130
|
+
export * from "./mset";
|
|
131
|
+
export * from "./msetnx";
|
|
132
|
+
export * from "./persist";
|
|
133
|
+
export * from "./pexpire";
|
|
134
|
+
export * from "./pexpireat";
|
|
135
|
+
export * from "./pfadd";
|
|
136
|
+
export * from "./pfcount";
|
|
137
|
+
export * from "./pfmerge";
|
|
138
|
+
export * from "./ping";
|
|
139
|
+
export * from "./psetex";
|
|
140
|
+
export * from "./pttl";
|
|
141
|
+
export * from "./publish";
|
|
142
|
+
export * from "./randomkey";
|
|
143
|
+
export * from "./rename";
|
|
144
|
+
export * from "./renamenx";
|
|
145
|
+
export * from "./rpop";
|
|
146
|
+
export * from "./rpush";
|
|
147
|
+
export * from "./rpushx";
|
|
148
|
+
export * from "./sadd";
|
|
149
|
+
export * from "./scan";
|
|
150
|
+
export * from "./scard";
|
|
151
|
+
export * from "./script_exists";
|
|
152
|
+
export * from "./script_flush";
|
|
153
|
+
export * from "./script_load";
|
|
154
|
+
export * from "./sdiff";
|
|
155
|
+
export * from "./sdiffstore";
|
|
156
|
+
export * from "./set";
|
|
157
|
+
export * from "./setbit";
|
|
158
|
+
export * from "./setex";
|
|
159
|
+
export * from "./setnx";
|
|
160
|
+
export * from "./setrange";
|
|
161
|
+
export * from "./sinter";
|
|
162
|
+
export * from "./sintercard";
|
|
163
|
+
export * from "./sinterstore";
|
|
164
|
+
export * from "./sismember";
|
|
165
|
+
export * from "./smembers";
|
|
166
|
+
export * from "./smismember";
|
|
167
|
+
export * from "./smove";
|
|
168
|
+
export * from "./spop";
|
|
169
|
+
export * from "./srandmember";
|
|
170
|
+
export * from "./srem";
|
|
171
|
+
export * from "./sscan";
|
|
172
|
+
export * from "./strlen";
|
|
173
|
+
export * from "./sunion";
|
|
174
|
+
export * from "./sunionstore";
|
|
175
|
+
export * from "./time";
|
|
176
|
+
export * from "./touch";
|
|
177
|
+
export * from "./ttl";
|
|
178
|
+
export * from "./type";
|
|
179
|
+
export * from "./unlink";
|
|
180
|
+
export * from "./vector_add";
|
|
181
|
+
export * from "./vector_count";
|
|
182
|
+
export * from "./vector_create";
|
|
183
|
+
export * from "./vector_del";
|
|
184
|
+
export * from "./vector_drop";
|
|
185
|
+
export * from "./vector_get";
|
|
186
|
+
export * from "./vector_info";
|
|
187
|
+
export * from "./vector_query";
|
|
188
|
+
export * from "./xack";
|
|
189
|
+
export * from "./xackdel";
|
|
190
|
+
export * from "./xadd";
|
|
191
|
+
export * from "./xautoclaim";
|
|
192
|
+
export * from "./xclaim";
|
|
193
|
+
export * from "./xdel";
|
|
194
|
+
export * from "./xdelex";
|
|
195
|
+
export * from "./xgroup";
|
|
196
|
+
export * from "./xinfo";
|
|
197
|
+
export * from "./xlen";
|
|
198
|
+
export * from "./xpending";
|
|
199
|
+
export * from "./xrange";
|
|
200
|
+
export * from "./xread";
|
|
201
|
+
export * from "./xreadgroup";
|
|
202
|
+
export * from "./xrevrange";
|
|
203
|
+
export * from "./xtrim";
|
|
204
|
+
export * from "./zadd";
|
|
205
|
+
export * from "./zcard";
|
|
206
|
+
export * from "./zcount";
|
|
207
|
+
export * from "./zincrby";
|
|
208
|
+
export * from "./zinterstore";
|
|
209
|
+
export * from "./zlexcount";
|
|
210
|
+
export * from "./zpopmax";
|
|
211
|
+
export * from "./zpopmin";
|
|
212
|
+
export * from "./zrange";
|
|
213
|
+
export * from "./zrank";
|
|
214
|
+
export * from "./zrem";
|
|
215
|
+
export * from "./zremrangebylex";
|
|
216
|
+
export * from "./zremrangebyrank";
|
|
217
|
+
export * from "./zremrangebyscore";
|
|
218
|
+
export * from "./zrevrank";
|
|
219
|
+
export * from "./zscan";
|
|
220
|
+
export * from "./zscore";
|
|
221
|
+
export * from "./zunion";
|
|
222
|
+
export * from "./zunionstore";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandOptions } from "./command";
|
|
2
|
+
import { Command } from "./command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @see https://redis.io/commands/mset
|
|
6
|
+
* @see node_modules/@upstash/redis/docs/commands/string/mset.mdx
|
|
7
|
+
*/
|
|
8
|
+
export class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
9
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">) {
|
|
10
|
+
super(["mset", ...Object.entries(kv).flatMap(([key, value]) => [key, value])], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|