@jeffusion/bungee-types 4.1.0 → 4.2.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 +17 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export interface FailoverHealthCheckConfig {
|
|
|
121
121
|
export interface Service {
|
|
122
122
|
name: string;
|
|
123
123
|
endpoints: Endpoint[];
|
|
124
|
+
plugins?: Array<PluginConfig | string>;
|
|
124
125
|
health_check?: FailoverHealthCheckConfig;
|
|
125
126
|
failover?: FailoverConfig;
|
|
126
127
|
sticky_session?: StickySessionConfig;
|
|
@@ -235,6 +236,22 @@ export interface PluginConfig {
|
|
|
235
236
|
*/
|
|
236
237
|
enabled?: boolean;
|
|
237
238
|
}
|
|
239
|
+
/** Plugin execution phase in the three-phase pipeline */
|
|
240
|
+
export type PluginPhase = 'route' | 'service' | 'upstream';
|
|
241
|
+
/**
|
|
242
|
+
* Result of onInterceptRequest hook.
|
|
243
|
+
* Distinguishes terminal short-circuit from failover trigger.
|
|
244
|
+
* - respond: terminal short-circuit, no failover
|
|
245
|
+
* - failover: trigger upstream switch (only valid in Phase 3/upstream)
|
|
246
|
+
* - undefined: continue normal flow
|
|
247
|
+
*/
|
|
248
|
+
export type InterceptResult = {
|
|
249
|
+
action: 'respond';
|
|
250
|
+
response: Response;
|
|
251
|
+
} | {
|
|
252
|
+
action: 'failover';
|
|
253
|
+
reason?: string;
|
|
254
|
+
} | undefined;
|
|
238
255
|
export interface AppConfig {
|
|
239
256
|
config_version?: number;
|
|
240
257
|
log_level?: string;
|