File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,17 @@ export type { Context } from '@netlify/serverless-functions-api'
3
3
type Path = `/${string } `
4
4
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'
5
5
type CronSchedule = string
6
+ type RateLimitAlgorithm = 'sliding_window'
7
+ type RateLimitAggregator = 'domain' | 'ip'
8
+ type RateLimitAction = 'rate_limit' | 'rewrite'
9
+
10
+ interface RateLimitConfig {
11
+ action ?: RateLimitAction
12
+ aggregateBy ?: RateLimitAggregator | RateLimitAggregator [ ]
13
+ algorithm ?: RateLimitAlgorithm
14
+ to ?: string
15
+ windowSize : number
16
+ }
6
17
7
18
interface BaseConfig {
8
19
/**
@@ -16,6 +27,8 @@ interface BaseConfig {
16
27
* function will run for all supported methods.
17
28
*/
18
29
method ?: HTTPMethod | HTTPMethod [ ]
30
+
31
+ rateLimit ?: RateLimitConfig
19
32
}
20
33
21
34
interface ConfigWithPath extends BaseConfig {
You can’t perform that action at this time.
0 commit comments