@upstash/ratelimit 2.0.1 → 2.0.3
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 +1 -1
- package/dist/index.d.mts +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.js +262 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +262 -226
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ For more information on getting started, you can refer to [our documentation](ht
|
|
|
76
76
|
|
|
77
77
|
## Documentation
|
|
78
78
|
|
|
79
|
-
See [the documentation](https://upstash.com/docs/
|
|
79
|
+
See [the documentation](https://upstash.com/docs/redis/sdks/ratelimit-ts/overview) for more information details about this package.
|
|
80
80
|
|
|
81
81
|
## Contributing
|
|
82
82
|
|
package/dist/index.d.mts
CHANGED
|
@@ -20,12 +20,6 @@ interface EphemeralCache {
|
|
|
20
20
|
type RegionContext = {
|
|
21
21
|
redis: Redis;
|
|
22
22
|
cache?: EphemeralCache;
|
|
23
|
-
scriptHashes: {
|
|
24
|
-
limitHash?: string;
|
|
25
|
-
getRemainingHash?: string;
|
|
26
|
-
resetHash?: string;
|
|
27
|
-
};
|
|
28
|
-
cacheScripts: boolean;
|
|
29
23
|
};
|
|
30
24
|
type MultiRegionContext = {
|
|
31
25
|
regionContexts: Omit<RegionContext[], "cache">;
|
|
@@ -570,8 +564,12 @@ type RegionRatelimitConfig = {
|
|
|
570
564
|
*/
|
|
571
565
|
analytics?: boolean;
|
|
572
566
|
/**
|
|
573
|
-
*
|
|
574
|
-
*
|
|
567
|
+
* @deprecated Has no affect since v2.0.3. Instead, hash values of scripts are
|
|
568
|
+
* hardcoded in the sdk and it attempts to run the script using EVALSHA (with the hash).
|
|
569
|
+
* If it fails, runs script load.
|
|
570
|
+
*
|
|
571
|
+
* Previously, if enabled, lua scripts were sent to Redis with SCRIPT LOAD durint the first request.
|
|
572
|
+
* In the subsequent requests, hash of the script would be used to invoke the scripts
|
|
575
573
|
*
|
|
576
574
|
* @default true
|
|
577
575
|
*/
|
|
@@ -769,4 +767,4 @@ declare namespace ipDenyList {
|
|
|
769
767
|
};
|
|
770
768
|
}
|
|
771
769
|
|
|
772
|
-
export { Algorithm, Analytics, AnalyticsConfig, ipDenyList as IpDenyList, MultiRegionRatelimit, MultiRegionRatelimitConfig, RegionRatelimit as Ratelimit, RegionRatelimitConfig as RatelimitConfig };
|
|
770
|
+
export { Algorithm, Analytics, AnalyticsConfig, Duration, ipDenyList as IpDenyList, MultiRegionRatelimit, MultiRegionRatelimitConfig, RegionRatelimit as Ratelimit, RegionRatelimitConfig as RatelimitConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,12 +20,6 @@ interface EphemeralCache {
|
|
|
20
20
|
type RegionContext = {
|
|
21
21
|
redis: Redis;
|
|
22
22
|
cache?: EphemeralCache;
|
|
23
|
-
scriptHashes: {
|
|
24
|
-
limitHash?: string;
|
|
25
|
-
getRemainingHash?: string;
|
|
26
|
-
resetHash?: string;
|
|
27
|
-
};
|
|
28
|
-
cacheScripts: boolean;
|
|
29
23
|
};
|
|
30
24
|
type MultiRegionContext = {
|
|
31
25
|
regionContexts: Omit<RegionContext[], "cache">;
|
|
@@ -570,8 +564,12 @@ type RegionRatelimitConfig = {
|
|
|
570
564
|
*/
|
|
571
565
|
analytics?: boolean;
|
|
572
566
|
/**
|
|
573
|
-
*
|
|
574
|
-
*
|
|
567
|
+
* @deprecated Has no affect since v2.0.3. Instead, hash values of scripts are
|
|
568
|
+
* hardcoded in the sdk and it attempts to run the script using EVALSHA (with the hash).
|
|
569
|
+
* If it fails, runs script load.
|
|
570
|
+
*
|
|
571
|
+
* Previously, if enabled, lua scripts were sent to Redis with SCRIPT LOAD durint the first request.
|
|
572
|
+
* In the subsequent requests, hash of the script would be used to invoke the scripts
|
|
575
573
|
*
|
|
576
574
|
* @default true
|
|
577
575
|
*/
|
|
@@ -769,4 +767,4 @@ declare namespace ipDenyList {
|
|
|
769
767
|
};
|
|
770
768
|
}
|
|
771
769
|
|
|
772
|
-
export { Algorithm, Analytics, AnalyticsConfig, ipDenyList as IpDenyList, MultiRegionRatelimit, MultiRegionRatelimitConfig, RegionRatelimit as Ratelimit, RegionRatelimitConfig as RatelimitConfig };
|
|
770
|
+
export { Algorithm, Analytics, AnalyticsConfig, Duration, ipDenyList as IpDenyList, MultiRegionRatelimit, MultiRegionRatelimitConfig, RegionRatelimit as Ratelimit, RegionRatelimitConfig as RatelimitConfig };
|