@jeffusion/bungee-types 4.0.0 → 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.
Files changed (2) hide show
  1. package/dist/types.d.ts +91 -32
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -71,76 +71,134 @@ export interface AuthConfig {
71
71
  */
72
72
  tokens: string[];
73
73
  }
74
- export interface Upstream extends ModificationRules {
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
- disabled?: boolean;
80
+ is_disabled?: boolean;
81
81
  description?: string;
82
82
  condition?: string;
83
83
  }
84
84
  export interface StickySessionConfig {
85
85
  enabled: boolean;
86
- keyExpression?: string;
86
+ key_expression?: string;
87
87
  }
88
88
  export interface RouteTimeoutsConfig {
89
- connectMs?: number;
90
- requestMs?: number;
89
+ connect_ms?: number;
90
+ request_ms?: number;
91
91
  }
92
92
  export interface FailoverPassiveHealthConfig {
93
- consecutiveFailures?: number;
94
- healthySuccesses?: number;
95
- autoDisableThreshold?: number;
96
- autoEnableOnActiveHealthCheck?: boolean;
93
+ consecutive_failures?: number;
94
+ healthy_successes?: number;
95
+ auto_disable_threshold?: number;
96
+ auto_enable_on_active_health_check?: boolean;
97
97
  }
98
98
  export interface FailoverRecoveryConfig {
99
- probeIntervalMs?: number;
100
- probeTimeoutMs?: number;
99
+ probe_interval_ms?: number;
100
+ probe_timeout_ms?: number;
101
101
  }
102
102
  export interface FailoverSlowStartConfig {
103
103
  enabled: boolean;
104
- durationMs?: number;
105
- initialWeightFactor?: number;
104
+ duration_ms?: number;
105
+ initial_weight_factor?: number;
106
106
  }
107
107
  export interface FailoverHealthCheckConfig {
108
108
  enabled: boolean;
109
- intervalMs?: number;
110
- timeoutMs?: number;
109
+ interval_ms?: number;
110
+ timeout_ms?: number;
111
111
  path?: string;
112
112
  method?: string;
113
- expectedStatus?: number[];
114
- unhealthyThreshold?: number;
115
- healthyThreshold?: number;
113
+ expected_status?: number[];
114
+ unhealthy_threshold?: number;
115
+ healthy_threshold?: number;
116
116
  body?: string;
117
- contentType?: string;
117
+ content_type?: string;
118
118
  headers?: Record<string, string>;
119
119
  query?: Record<string, string>;
120
120
  }
121
+ export interface Service {
122
+ name: string;
123
+ endpoints: Endpoint[];
124
+ health_check?: FailoverHealthCheckConfig;
125
+ failover?: FailoverConfig;
126
+ sticky_session?: StickySessionConfig;
127
+ }
121
128
  export interface FailoverConfig {
122
129
  enabled: boolean;
123
- retryOn?: number | string | (number | string)[];
124
- passiveHealth?: FailoverPassiveHealthConfig;
130
+ retry_on?: number | string | (number | string)[];
131
+ passive_health?: FailoverPassiveHealthConfig;
125
132
  recovery?: FailoverRecoveryConfig;
126
- slowStart?: FailoverSlowStartConfig;
127
- healthCheck?: FailoverHealthCheckConfig;
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;
128
181
  }
129
182
  export interface RouteConfig extends ModificationRules {
130
183
  path: string;
131
- pathRewrite?: Record<string, string>;
184
+ service?: string;
185
+ endpoints?: Endpoint[];
186
+ path_rewrite?: Record<string, string>;
132
187
  auth?: AuthConfig;
133
188
  plugins?: Array<PluginConfig | string>;
134
- stickySession?: StickySessionConfig;
135
- upstreams: Upstream[];
136
189
  timeouts?: RouteTimeoutsConfig;
137
- failover?: FailoverConfig;
190
+ rate_limit?: RateLimitConfig;
191
+ cors?: CorsConfig;
192
+ response_rules?: ResponseRuleConfig[];
193
+ direct_response?: DirectResponseConfig;
194
+ redirect?: RedirectConfig;
195
+ retry?: RetryConfig;
138
196
  }
139
197
  export interface LoggingConfig {
140
198
  body?: {
141
199
  enabled: boolean;
142
- maxSize: number;
143
- retentionDays: number;
200
+ max_size: number;
201
+ retention_days: number;
144
202
  };
145
203
  }
146
204
  /**
@@ -178,11 +236,12 @@ export interface PluginConfig {
178
236
  enabled?: boolean;
179
237
  }
180
238
  export interface AppConfig {
181
- configVersion?: number;
182
- logLevel?: string;
183
- bodyParserLimit?: string;
239
+ config_version?: number;
240
+ log_level?: string;
241
+ body_parser_limit?: string;
184
242
  auth?: AuthConfig;
185
243
  logging?: LoggingConfig;
186
244
  plugins?: Array<PluginConfig | string>;
245
+ services?: Service[];
187
246
  routes: RouteConfig[];
188
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffusion/bungee-types",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "TypeScript type definitions for Bungee",
5
5
  "main": "./dist/index.d.ts",
6
6
  "types": "./dist/index.d.ts",