@upstash/ratelimit 0.2.0-rc.0 → 0.3.0-rc.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 +14 -0
- package/esm/analytics.js +84 -0
- package/esm/deps/deno.land/x/base64@v0.2.1/base.js +100 -0
- package/esm/deps/deno.land/x/base64@v0.2.1/base64url.js +9 -0
- package/esm/deps/deno.land/x/sha1@v1.0.3/deps.js +1 -0
- package/esm/deps/deno.land/x/sha1@v1.0.3/mod.js +191 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/mod.js +66 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/append.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitcount.js +16 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitop.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitpos.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/command.js +57 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/dbsize.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decr.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decrby.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/del.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/echo.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/eval.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/evalsha.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/exists.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expire.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expireat.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushall.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushdb.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/get.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getbit.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getdel.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getrange.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getset.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hdel.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hexists.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hget.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hgetall.js +29 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrby.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrbyfloat.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hkeys.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hlen.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmget.js +35 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmset.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hrandfield.js +39 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hscan.js +16 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hset.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hsetnx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hstrlen.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hvals.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incr.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrby.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrbyfloat.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/keys.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lindex.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/linsert.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/llen.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lmove.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpop.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpos.js +19 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpush.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpushx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrange.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrem.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lset.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ltrim.js +6 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mget.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mod.js +119 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mset.js +12 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/msetnx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/persist.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpire.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpireat.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ping.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/psetex.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pttl.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/publish.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/randomkey.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rename.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/renamenx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpop.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpush.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpushx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sadd.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scan.js +19 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scard.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_exists.js +12 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_flush.js +16 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_load.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiff.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiffstore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/set.js +36 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setbit.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setex.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setnx.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setrange.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinter.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinterstore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sismember.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smembers.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smismember.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smove.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/spop.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srandmember.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srem.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sscan.js +16 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/strlen.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunion.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunionstore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/time.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/touch.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ttl.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/type.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/unlink.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zadd.js +26 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcard.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcount.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zdiffstore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zincrby.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zinterstore.js +27 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zlexcount.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zmscore.js +10 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmax.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmin.js +13 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrange.js +26 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrank.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrem.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebylex.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyrank.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyscore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrevrank.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscan.js +16 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscore.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zunionstore.js +27 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/error.js +9 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/http.js +165 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/pipeline.js +1199 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/redis.js +1200 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/script.js +77 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/types.js +1 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/pkg/util.js +31 -0
- package/esm/deps/deno.land/x/upstash_redis@v1.19.3/version.js +1 -0
- package/esm/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +50 -0
- package/esm/multi.js +1 -0
- package/esm/ratelimit.js +28 -2
- package/esm/single.js +1 -0
- package/package.json +1 -1
- package/script/analytics.js +88 -0
- package/script/deps/deno.land/x/base64@v0.2.1/base.js +104 -0
- package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +13 -0
- package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +6 -0
- package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +196 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/mod.js +93 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/append.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitcount.js +20 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitop.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitpos.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/command.js +61 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/dbsize.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decr.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decrby.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/del.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/echo.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/eval.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/evalsha.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/exists.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expire.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expireat.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushall.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushdb.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/get.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getbit.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getdel.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getrange.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getset.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hdel.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hexists.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hget.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hgetall.js +33 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrby.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrbyfloat.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hkeys.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hlen.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmget.js +39 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmset.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hrandfield.js +43 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hscan.js +20 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hset.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hsetnx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hstrlen.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hvals.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incr.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrby.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrbyfloat.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/keys.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lindex.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/linsert.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/llen.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lmove.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpop.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpos.js +23 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpush.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpushx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrange.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrem.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lset.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ltrim.js +10 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mget.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mod.js +135 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mset.js +16 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/msetnx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/persist.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpire.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpireat.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ping.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/psetex.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pttl.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/publish.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/randomkey.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rename.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/renamenx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpop.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpush.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpushx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sadd.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scan.js +23 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scard.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_exists.js +16 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_flush.js +20 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_load.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiff.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiffstore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/set.js +40 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setbit.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setex.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setnx.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setrange.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinter.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinterstore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sismember.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smembers.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smismember.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smove.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/spop.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srandmember.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srem.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sscan.js +20 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/strlen.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunion.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunionstore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/time.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/touch.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ttl.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/type.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/unlink.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zadd.js +30 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcard.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcount.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zdiffstore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zincrby.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zinterstore.js +31 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zlexcount.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zmscore.js +14 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmax.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmin.js +17 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrange.js +30 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrank.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrem.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebylex.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyrank.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyscore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrevrank.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscan.js +20 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscore.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zunionstore.js +31 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/error.js +13 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/http.js +169 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/pipeline.js +1203 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/redis.js +1204 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/script.js +81 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/types.js +2 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/pkg/util.js +35 -0
- package/script/deps/deno.land/x/upstash_redis@v1.19.3/version.js +4 -0
- package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +55 -0
- package/script/multi.js +1 -0
- package/script/ratelimit.js +28 -2
- package/script/single.js +1 -0
- package/types/analytics.d.ts +36 -0
- package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +5 -0
- package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +1 -0
- package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +1 -0
- package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +26 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/mod.d.ts +41 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/append.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitcount.d.ts +8 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitop.d.ts +12 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/bitpos.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/command.d.ts +37 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/dbsize.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decr.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/decrby.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/del.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/echo.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/eval.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/evalsha.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/exists.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expire.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/expireat.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushall.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/flushdb.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/get.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getbit.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getdel.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getrange.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/getset.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hdel.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hexists.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hget.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hgetall.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrby.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hincrbyfloat.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hkeys.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hlen.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmget.d.ts +15 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hmset.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hrandfield.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hscan.d.ts +24 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hset.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hsetnx.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hstrlen.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/hvals.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incr.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrby.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/incrbyfloat.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/keys.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lindex.d.ts +4 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/linsert.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/llen.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lmove.d.ts +12 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpop.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpos.d.ts +15 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpush.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lpushx.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrange.d.ts +4 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lrem.d.ts +4 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/lset.d.ts +4 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ltrim.d.ts +4 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mget.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mod.d.ts +119 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/mset.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/msetnx.d.ts +9 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/persist.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpire.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pexpireat.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ping.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/psetex.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/pttl.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/publish.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/randomkey.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rename.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/renamenx.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpop.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpush.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/rpushx.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sadd.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scan.d.ts +18 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/scard.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_exists.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_flush.d.ts +14 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/script_load.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiff.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sdiffstore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/set.d.ts +55 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setbit.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setex.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setnx.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/setrange.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinter.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sinterstore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sismember.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smembers.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smismember.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/smove.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/spop.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srandmember.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/srem.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sscan.d.ts +24 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/strlen.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunion.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/sunionstore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/time.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/touch.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/ttl.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/type.d.ts +8 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/unlink.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zadd.d.ts +35 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcard.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zcount.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zdiffstore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zincrby.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zinterstore.d.ts +30 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zlexcount.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zmscore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmax.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zpopmin.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrange.d.ts +42 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrank.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrem.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebylex.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyrank.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zremrangebyscore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zrevrank.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscan.d.ts +24 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zscore.d.ts +7 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/commands/zunionstore.d.ts +30 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/error.d.ts +6 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/http.d.ts +87 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/pipeline.d.ts +577 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/redis.d.ts +575 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/script.d.ts +42 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/types.d.ts +18 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/pkg/util.d.ts +1 -0
- package/types/deps/deno.land/x/upstash_redis@v1.19.3/version.d.ts +1 -0
- package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +3 -0
- package/types/multi.d.ts +8 -1
- package/types/ratelimit.d.ts +12 -1
- package/types/single.d.ts +8 -1
- package/types/types.d.ts +1 -4
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Script = void 0;
|
|
4
|
+
const mod_js_1 = require("../../sha1@v1.0.3/mod.js");
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new script.
|
|
7
|
+
*
|
|
8
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
9
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
10
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const redis = new Redis({...})
|
|
15
|
+
*
|
|
16
|
+
* const script = redis.createScript<string>("return ARGV[1];")
|
|
17
|
+
* const arg1 = await script.eval([], ["Hello World"])
|
|
18
|
+
* assertEquals(arg1, "Hello World")
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
class Script {
|
|
22
|
+
constructor(redis, script) {
|
|
23
|
+
Object.defineProperty(this, "script", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "sha1", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "redis", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: void 0
|
|
40
|
+
});
|
|
41
|
+
this.redis = redis;
|
|
42
|
+
this.sha1 = this.digest(script);
|
|
43
|
+
this.script = script;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Send an `EVAL` command to redis.
|
|
47
|
+
*/
|
|
48
|
+
async eval(keys, args) {
|
|
49
|
+
return await this.redis.eval(this.script, keys, args);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Calculates the sha1 hash of the script and then calls `EVALSHA`.
|
|
53
|
+
*/
|
|
54
|
+
async evalsha(keys, args) {
|
|
55
|
+
return await this.redis.evalsha(this.sha1, keys, args);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Optimistically try to run `EVALSHA` first.
|
|
59
|
+
* If the script is not loaded in redis, it will fall back and try again with `EVAL`.
|
|
60
|
+
*
|
|
61
|
+
* Following calls will be able to use the cached script
|
|
62
|
+
*/
|
|
63
|
+
async exec(keys, args) {
|
|
64
|
+
const res = await this.redis.evalsha(this.sha1, keys, args).catch(async (err) => {
|
|
65
|
+
if (err instanceof Error &&
|
|
66
|
+
err.message.toLowerCase().includes("noscript")) {
|
|
67
|
+
return await this.redis.eval(this.script, keys, args);
|
|
68
|
+
}
|
|
69
|
+
throw err;
|
|
70
|
+
});
|
|
71
|
+
return res;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Compute the sha1 hash of the script and return its hex representation.
|
|
75
|
+
*/
|
|
76
|
+
digest(s) {
|
|
77
|
+
const hash = (0, mod_js_1.sha1)(s, "utf8", "hex");
|
|
78
|
+
return typeof hash === "string" ? hash : new TextDecoder().decode(hash);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.Script = Script;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseResponse = void 0;
|
|
4
|
+
function parseRecursive(obj) {
|
|
5
|
+
const parsed = Array.isArray(obj)
|
|
6
|
+
? obj.map((o) => {
|
|
7
|
+
try {
|
|
8
|
+
return parseRecursive(o);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return o;
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
: JSON.parse(obj);
|
|
15
|
+
/**
|
|
16
|
+
* Parsing very large numbers can result in MAX_SAFE_INTEGER
|
|
17
|
+
* overflow. In that case we return the number as string instead.
|
|
18
|
+
*/
|
|
19
|
+
if (typeof parsed === "number" && parsed.toString() != obj) {
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
return parsed;
|
|
23
|
+
}
|
|
24
|
+
function parseResponse(result) {
|
|
25
|
+
try {
|
|
26
|
+
/**
|
|
27
|
+
* Try to parse the response if possible
|
|
28
|
+
*/
|
|
29
|
+
return parseRecursive(result);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.parseResponse = parseResponse;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encode = exports.decode = void 0;
|
|
4
|
+
const base64url_js_1 = require("../../../deno.land/x/base64@v0.2.1/base64url.js");
|
|
5
|
+
const decoder = new TextDecoder();
|
|
6
|
+
const encoder = new TextEncoder();
|
|
7
|
+
/** Serializes a Uint8Array to a hexadecimal string. */
|
|
8
|
+
function toHexString(buf) {
|
|
9
|
+
return buf.reduce((hex, byte) => `${hex}${byte < 16 ? "0" : ""}${byte.toString(16)}`, "");
|
|
10
|
+
}
|
|
11
|
+
/** Deserializes a Uint8Array from a hexadecimal string. */
|
|
12
|
+
function fromHexString(hex) {
|
|
13
|
+
const len = hex.length;
|
|
14
|
+
if (len % 2 || !/^[0-9a-fA-F]+$/.test(hex)) {
|
|
15
|
+
throw new TypeError("Invalid hex string.");
|
|
16
|
+
}
|
|
17
|
+
hex = hex.toLowerCase();
|
|
18
|
+
const buf = new Uint8Array(Math.floor(len / 2));
|
|
19
|
+
const end = len / 2;
|
|
20
|
+
for (let i = 0; i < end; ++i) {
|
|
21
|
+
buf[i] = parseInt(hex.substr(i * 2, 2), 16);
|
|
22
|
+
}
|
|
23
|
+
return buf;
|
|
24
|
+
}
|
|
25
|
+
/** Decodes a Uint8Array to utf8-, base64-, or hex-encoded string. */
|
|
26
|
+
function decode(buf, encoding = "utf8") {
|
|
27
|
+
if (/^utf-?8$/i.test(encoding)) {
|
|
28
|
+
return decoder.decode(buf);
|
|
29
|
+
}
|
|
30
|
+
else if (/^base64$/i.test(encoding)) {
|
|
31
|
+
return (0, base64url_js_1.fromUint8Array)(buf);
|
|
32
|
+
}
|
|
33
|
+
else if (/^hex(?:adecimal)?$/i.test(encoding)) {
|
|
34
|
+
return toHexString(buf);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throw new TypeError("Unsupported string encoding.");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.decode = decode;
|
|
41
|
+
function encode(str, encoding = "utf8") {
|
|
42
|
+
if (/^utf-?8$/i.test(encoding)) {
|
|
43
|
+
return encoder.encode(str);
|
|
44
|
+
}
|
|
45
|
+
else if (/^base64$/i.test(encoding)) {
|
|
46
|
+
return (0, base64url_js_1.toUint8Array)(str);
|
|
47
|
+
}
|
|
48
|
+
else if (/^hex(?:adecimal)?$/i.test(encoding)) {
|
|
49
|
+
return fromHexString(str);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
throw new TypeError("Unsupported string encoding.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.encode = encode;
|
package/script/multi.js
CHANGED
package/script/ratelimit.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Ratelimit = exports.TimeoutError = void 0;
|
|
4
|
+
const analytics_js_1 = require("./analytics.js");
|
|
4
5
|
const cache_js_1 = require("./cache.js");
|
|
5
6
|
class TimeoutError extends Error {
|
|
6
7
|
constructor() {
|
|
@@ -50,6 +51,12 @@ class Ratelimit {
|
|
|
50
51
|
writable: true,
|
|
51
52
|
value: void 0
|
|
52
53
|
});
|
|
54
|
+
Object.defineProperty(this, "analytics", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
53
60
|
/**
|
|
54
61
|
* Determine if a request should pass or be rejected based on the identifier and previously chosen ratelimit.
|
|
55
62
|
*
|
|
@@ -73,7 +80,7 @@ class Ratelimit {
|
|
|
73
80
|
enumerable: true,
|
|
74
81
|
configurable: true,
|
|
75
82
|
writable: true,
|
|
76
|
-
value: async (identifier) => {
|
|
83
|
+
value: async (identifier, req) => {
|
|
77
84
|
const key = [this.prefix, identifier].join(":");
|
|
78
85
|
let timeoutId = null;
|
|
79
86
|
try {
|
|
@@ -91,7 +98,18 @@ class Ratelimit {
|
|
|
91
98
|
}, this.timeout);
|
|
92
99
|
}));
|
|
93
100
|
}
|
|
94
|
-
|
|
101
|
+
const res = await Promise.race(arr);
|
|
102
|
+
if (this.analytics) {
|
|
103
|
+
const geo = req ? this.analytics.extractGeo(req) : undefined;
|
|
104
|
+
const analyticsP = this.analytics.record({
|
|
105
|
+
identifier,
|
|
106
|
+
time: Date.now(),
|
|
107
|
+
success: res.success,
|
|
108
|
+
...geo,
|
|
109
|
+
});
|
|
110
|
+
res.pending = Promise.all([res.pending, analyticsP]);
|
|
111
|
+
}
|
|
112
|
+
return res;
|
|
95
113
|
}
|
|
96
114
|
finally {
|
|
97
115
|
if (timeoutId) {
|
|
@@ -165,6 +183,14 @@ class Ratelimit {
|
|
|
165
183
|
this.limiter = config.limiter;
|
|
166
184
|
this.timeout = config.timeout;
|
|
167
185
|
this.prefix = config.prefix ?? "@upstash/ratelimit";
|
|
186
|
+
this.analytics = config.analytics !== false
|
|
187
|
+
? new analytics_js_1.Analytics({
|
|
188
|
+
redis: Array.isArray(this.ctx.redis)
|
|
189
|
+
? this.ctx.redis[0]
|
|
190
|
+
: this.ctx.redis,
|
|
191
|
+
prefix: this.prefix,
|
|
192
|
+
})
|
|
193
|
+
: undefined;
|
|
168
194
|
if (config.ephemeralCache instanceof Map) {
|
|
169
195
|
this.ctx.cache = new cache_js_1.Cache(config.ephemeralCache);
|
|
170
196
|
}
|
package/script/single.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Redis } from "./deps/deno.land/x/upstash_redis@v1.19.3/mod.js";
|
|
2
|
+
export type Geo = {
|
|
3
|
+
country?: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
region?: string;
|
|
6
|
+
ip?: string;
|
|
7
|
+
};
|
|
8
|
+
export type Event = Geo & {
|
|
9
|
+
identifier: string;
|
|
10
|
+
time: number;
|
|
11
|
+
success: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type AnalyticsConfig = {
|
|
14
|
+
redis: Redis;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class Analytics {
|
|
18
|
+
private readonly redis;
|
|
19
|
+
private readonly prefix;
|
|
20
|
+
constructor(config: AnalyticsConfig);
|
|
21
|
+
extractGeo(req: {
|
|
22
|
+
geo?: Geo;
|
|
23
|
+
}): Geo;
|
|
24
|
+
record(event: Event): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Aggregates the events by the given field and returns the number of successes and failures per value
|
|
27
|
+
*
|
|
28
|
+
* @param aggregateBy - The field to aggregate by
|
|
29
|
+
* @param cutoff - Timestamp in milliseconds to limit the aggregation to `cutoff` until now
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
aggregate<TAggregateBy extends keyof Omit<Event, "time">>(aggregateBy: TAggregateBy, cutoff?: number): Promise<Record<string, {
|
|
33
|
+
success: number;
|
|
34
|
+
blocked: number;
|
|
35
|
+
}>[]>;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const byteLength: (b64: string) => number, toUint8Array: (b64: string) => Uint8Array, fromUint8Array: (buf: Uint8Array) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { encode, decode } from "../../../denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Byte length of a SHA1 digest. */
|
|
2
|
+
export declare const BYTES: number;
|
|
3
|
+
/** A class representation of the SHA1 algorithm. */
|
|
4
|
+
export declare class SHA1 {
|
|
5
|
+
readonly hashSize: number;
|
|
6
|
+
private _buf;
|
|
7
|
+
private _bufIdx;
|
|
8
|
+
private _count;
|
|
9
|
+
private _K;
|
|
10
|
+
private _H;
|
|
11
|
+
private _finalized;
|
|
12
|
+
/** Creates a SHA1 instance. */
|
|
13
|
+
constructor();
|
|
14
|
+
/** Reduces the four input numbers to a single one. */
|
|
15
|
+
protected static F(t: number, b: number, c: number, d: number): number;
|
|
16
|
+
/** Initializes a hash instance. */
|
|
17
|
+
init(): SHA1;
|
|
18
|
+
/** Updates a hash with additional message data. */
|
|
19
|
+
update(msg: string | Uint8Array, inputEncoding?: string): SHA1;
|
|
20
|
+
/** Finalizes a hash with additional message data. */
|
|
21
|
+
digest(outputEncoding?: string): string | Uint8Array;
|
|
22
|
+
/** Performs one transformation cycle. */
|
|
23
|
+
private transform;
|
|
24
|
+
}
|
|
25
|
+
/** Generates a SHA1 hash of the input data. */
|
|
26
|
+
export declare function sha1(msg: string | Uint8Array, inputEncoding?: string, outputEncoding?: string): string | Uint8Array;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RequesterConfig, RetryConfig } from "./pkg/http.js";
|
|
2
|
+
import * as core from "./pkg/redis.js";
|
|
3
|
+
export type { Requester, UpstashRequest, UpstashResponse } from "./pkg/http.js";
|
|
4
|
+
/**
|
|
5
|
+
* Connection credentials for upstash redis.
|
|
6
|
+
* Get them from https://console.upstash.com/redis/<uuid>
|
|
7
|
+
*/
|
|
8
|
+
export type RedisConfigDeno = {
|
|
9
|
+
/**
|
|
10
|
+
* UPSTASH_REDIS_REST_URL
|
|
11
|
+
*/
|
|
12
|
+
url: string;
|
|
13
|
+
/**
|
|
14
|
+
* UPSTASH_REDIS_REST_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
token: string;
|
|
17
|
+
/**
|
|
18
|
+
* Configure the retry behaviour in case of network errors
|
|
19
|
+
*
|
|
20
|
+
* Set false to disable retries
|
|
21
|
+
*/
|
|
22
|
+
retry?: RetryConfig;
|
|
23
|
+
} & core.RedisOptions & RequesterConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Serverless redis client for upstash.
|
|
26
|
+
*/
|
|
27
|
+
export declare class Redis extends core.Redis {
|
|
28
|
+
/**
|
|
29
|
+
* Create a new redis client
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const redis = new Redis({
|
|
34
|
+
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
35
|
+
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
constructor(config: RedisConfigDeno);
|
|
40
|
+
static fromEnv(opts?: Omit<RedisConfigDeno, "url" | "token">): Redis;
|
|
41
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/append
|
|
4
|
+
*/
|
|
5
|
+
export declare class AppendCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/bitcount
|
|
4
|
+
*/
|
|
5
|
+
export declare class BitCountCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
|
|
7
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/bitop
|
|
4
|
+
*/
|
|
5
|
+
export declare class BitOpCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [
|
|
7
|
+
op: "and" | "or" | "xor",
|
|
8
|
+
destinationKey: string,
|
|
9
|
+
...sourceKeys: string[]
|
|
10
|
+
], opts?: CommandOptions<number, number>);
|
|
11
|
+
constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/bitpos
|
|
4
|
+
*/
|
|
5
|
+
export declare class BitPosCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Requester } from "../http.js";
|
|
2
|
+
type Serialize = (data: unknown) => string;
|
|
3
|
+
type Deserialize<TResult, TData> = (result: TResult) => TData;
|
|
4
|
+
export type CommandOptions<TResult, TData> = {
|
|
5
|
+
/**
|
|
6
|
+
* Custom deserializer
|
|
7
|
+
*/
|
|
8
|
+
deserialize?: (result: TResult) => TData;
|
|
9
|
+
/**
|
|
10
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
automaticDeserialization?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Command offers default (de)serialization and the exec method to all commands.
|
|
18
|
+
*
|
|
19
|
+
* TData represents what the user will enter or receive,
|
|
20
|
+
* TResult is the raw data returned from upstash, which may need to be transformed or parsed.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Command<TResult, TData> {
|
|
23
|
+
readonly command: string[];
|
|
24
|
+
readonly serialize: Serialize;
|
|
25
|
+
readonly deserialize: Deserialize<TResult, TData>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new command instance.
|
|
28
|
+
*
|
|
29
|
+
* You can define a custom `deserialize` function. By default we try to deserialize as json.
|
|
30
|
+
*/
|
|
31
|
+
constructor(command: (string | unknown)[], opts?: CommandOptions<TResult, TData>);
|
|
32
|
+
/**
|
|
33
|
+
* Execute the command using a client.
|
|
34
|
+
*/
|
|
35
|
+
exec(client: Requester): Promise<TData>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/decrby
|
|
4
|
+
*/
|
|
5
|
+
export declare class DecrByCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/eval
|
|
4
|
+
*/
|
|
5
|
+
export declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
6
|
+
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/evalsha
|
|
4
|
+
*/
|
|
5
|
+
export declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
6
|
+
constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/expire
|
|
4
|
+
*/
|
|
5
|
+
export declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
6
|
+
constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/expireat
|
|
4
|
+
*/
|
|
5
|
+
export declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
6
|
+
constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/flushall
|
|
4
|
+
*/
|
|
5
|
+
export declare class FlushAllCommand extends Command<"OK", "OK"> {
|
|
6
|
+
constructor(args?: [{
|
|
7
|
+
async?: boolean;
|
|
8
|
+
}], opts?: CommandOptions<"OK", "OK">);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/flushdb
|
|
4
|
+
*/
|
|
5
|
+
export declare class FlushDBCommand extends Command<"OK", "OK"> {
|
|
6
|
+
constructor([opts]: [opts?: {
|
|
7
|
+
async?: boolean;
|
|
8
|
+
}], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/get
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/getbit
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
|
|
6
|
+
constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/getdel
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/getrange
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetRangeCommand extends Command<string, string> {
|
|
6
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/getset
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/hdel
|
|
4
|
+
*/
|
|
5
|
+
export declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
|
|
6
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/hexists
|
|
4
|
+
*/
|
|
5
|
+
export declare class HExistsCommand extends Command<number, number> {
|
|
6
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/hget
|
|
4
|
+
*/
|
|
5
|
+
export declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/hgetall
|
|
4
|
+
*/
|
|
5
|
+
export declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|