@jeffusion/bungee-types 3.3.1 → 4.1.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/dist/types.d.ts +113 -40
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -71,64 +71,134 @@ export interface AuthConfig {
|
|
|
71
71
|
*/
|
|
72
72
|
tokens: string[];
|
|
73
73
|
}
|
|
74
|
-
export interface
|
|
74
|
+
export interface Endpoint extends ModificationRules {
|
|
75
75
|
id?: string;
|
|
76
76
|
target: string;
|
|
77
77
|
weight?: number;
|
|
78
78
|
priority?: number;
|
|
79
79
|
plugins?: Array<PluginConfig | string>;
|
|
80
|
-
|
|
80
|
+
is_disabled?: boolean;
|
|
81
81
|
description?: string;
|
|
82
82
|
condition?: string;
|
|
83
83
|
}
|
|
84
84
|
export interface StickySessionConfig {
|
|
85
85
|
enabled: boolean;
|
|
86
|
-
|
|
86
|
+
key_expression?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface RouteTimeoutsConfig {
|
|
89
|
+
connect_ms?: number;
|
|
90
|
+
request_ms?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface FailoverPassiveHealthConfig {
|
|
93
|
+
consecutive_failures?: number;
|
|
94
|
+
healthy_successes?: number;
|
|
95
|
+
auto_disable_threshold?: number;
|
|
96
|
+
auto_enable_on_active_health_check?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface FailoverRecoveryConfig {
|
|
99
|
+
probe_interval_ms?: number;
|
|
100
|
+
probe_timeout_ms?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface FailoverSlowStartConfig {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
duration_ms?: number;
|
|
105
|
+
initial_weight_factor?: number;
|
|
106
|
+
}
|
|
107
|
+
export interface FailoverHealthCheckConfig {
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
interval_ms?: number;
|
|
110
|
+
timeout_ms?: number;
|
|
111
|
+
path?: string;
|
|
112
|
+
method?: string;
|
|
113
|
+
expected_status?: number[];
|
|
114
|
+
unhealthy_threshold?: number;
|
|
115
|
+
healthy_threshold?: number;
|
|
116
|
+
body?: string;
|
|
117
|
+
content_type?: string;
|
|
118
|
+
headers?: Record<string, string>;
|
|
119
|
+
query?: Record<string, string>;
|
|
120
|
+
}
|
|
121
|
+
export interface Service {
|
|
122
|
+
name: string;
|
|
123
|
+
endpoints: Endpoint[];
|
|
124
|
+
health_check?: FailoverHealthCheckConfig;
|
|
125
|
+
failover?: FailoverConfig;
|
|
126
|
+
sticky_session?: StickySessionConfig;
|
|
127
|
+
}
|
|
128
|
+
export interface FailoverConfig {
|
|
129
|
+
enabled: boolean;
|
|
130
|
+
retry_on?: number | string | (number | string)[];
|
|
131
|
+
passive_health?: FailoverPassiveHealthConfig;
|
|
132
|
+
recovery?: FailoverRecoveryConfig;
|
|
133
|
+
slow_start?: FailoverSlowStartConfig;
|
|
134
|
+
health_check?: FailoverHealthCheckConfig;
|
|
135
|
+
}
|
|
136
|
+
export interface RateLimitConfig {
|
|
137
|
+
enabled: boolean;
|
|
138
|
+
requests_per_second?: number;
|
|
139
|
+
burst?: number;
|
|
140
|
+
key_expression?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface CorsConfig {
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
allowed_origins?: string[];
|
|
145
|
+
allowed_methods?: string[];
|
|
146
|
+
allowed_headers?: string[];
|
|
147
|
+
expose_headers?: string[];
|
|
148
|
+
allow_credentials?: boolean;
|
|
149
|
+
max_age?: number;
|
|
150
|
+
}
|
|
151
|
+
export interface DirectResponseConfig {
|
|
152
|
+
enabled: boolean;
|
|
153
|
+
status: number;
|
|
154
|
+
body?: string;
|
|
155
|
+
content_type?: string;
|
|
156
|
+
headers?: Record<string, string>;
|
|
157
|
+
}
|
|
158
|
+
export interface RedirectConfig {
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
url: string;
|
|
161
|
+
status?: 301 | 302 | 307 | 308;
|
|
162
|
+
preserve_path?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface ResponseRuleConfig {
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
path: string;
|
|
167
|
+
match_type?: 'exact' | 'prefix' | 'regex';
|
|
168
|
+
type: 'direct_response' | 'redirect';
|
|
169
|
+
status?: number;
|
|
170
|
+
body?: string;
|
|
171
|
+
content_type?: string;
|
|
172
|
+
headers?: Record<string, string>;
|
|
173
|
+
url?: string;
|
|
174
|
+
preserve_path?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export interface RetryConfig {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
max_retries?: number;
|
|
179
|
+
retry_on?: number[];
|
|
180
|
+
per_retry_timeout_ms?: number;
|
|
87
181
|
}
|
|
88
182
|
export interface RouteConfig extends ModificationRules {
|
|
89
183
|
path: string;
|
|
90
|
-
|
|
184
|
+
service?: string;
|
|
185
|
+
endpoints?: Endpoint[];
|
|
186
|
+
path_rewrite?: Record<string, string>;
|
|
91
187
|
auth?: AuthConfig;
|
|
92
188
|
plugins?: Array<PluginConfig | string>;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
recoveryTimeoutMs?: number;
|
|
101
|
-
healthyThreshold?: number;
|
|
102
|
-
requestTimeoutMs?: number;
|
|
103
|
-
connectTimeoutMs?: number;
|
|
104
|
-
autoDisableThreshold?: number;
|
|
105
|
-
autoEnableOnHealthCheck?: boolean;
|
|
106
|
-
slowStart?: {
|
|
107
|
-
enabled: boolean;
|
|
108
|
-
durationMs?: number;
|
|
109
|
-
initialWeightFactor?: number;
|
|
110
|
-
};
|
|
111
|
-
healthCheck?: {
|
|
112
|
-
enabled: boolean;
|
|
113
|
-
intervalMs?: number;
|
|
114
|
-
timeoutMs?: number;
|
|
115
|
-
path?: string;
|
|
116
|
-
method?: string;
|
|
117
|
-
expectedStatus?: number[];
|
|
118
|
-
unhealthyThreshold?: number;
|
|
119
|
-
healthyThreshold?: number;
|
|
120
|
-
body?: string;
|
|
121
|
-
contentType?: string;
|
|
122
|
-
headers?: Record<string, string>;
|
|
123
|
-
query?: Record<string, string>;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
189
|
+
timeouts?: RouteTimeoutsConfig;
|
|
190
|
+
rate_limit?: RateLimitConfig;
|
|
191
|
+
cors?: CorsConfig;
|
|
192
|
+
response_rules?: ResponseRuleConfig[];
|
|
193
|
+
direct_response?: DirectResponseConfig;
|
|
194
|
+
redirect?: RedirectConfig;
|
|
195
|
+
retry?: RetryConfig;
|
|
126
196
|
}
|
|
127
197
|
export interface LoggingConfig {
|
|
128
198
|
body?: {
|
|
129
199
|
enabled: boolean;
|
|
130
|
-
|
|
131
|
-
|
|
200
|
+
max_size: number;
|
|
201
|
+
retention_days: number;
|
|
132
202
|
};
|
|
133
203
|
}
|
|
134
204
|
/**
|
|
@@ -166,9 +236,12 @@ export interface PluginConfig {
|
|
|
166
236
|
enabled?: boolean;
|
|
167
237
|
}
|
|
168
238
|
export interface AppConfig {
|
|
169
|
-
|
|
239
|
+
config_version?: number;
|
|
240
|
+
log_level?: string;
|
|
241
|
+
body_parser_limit?: string;
|
|
170
242
|
auth?: AuthConfig;
|
|
171
243
|
logging?: LoggingConfig;
|
|
172
244
|
plugins?: Array<PluginConfig | string>;
|
|
245
|
+
services?: Service[];
|
|
173
246
|
routes: RouteConfig[];
|
|
174
247
|
}
|