@jeffusion/bungee-types 6.4.0 → 6.5.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.
@@ -1,4 +1,4 @@
1
- import type { AppConfig, Endpoint, PluginConfigOptions, RouteConfig, Service } from './types.js';
1
+ import type { AppConfig, Endpoint, PluginConfigOptions, RouteConfig, Service, ServiceReference } from './types.js';
2
2
  export type ConfigurationId = string;
3
3
  export type Sha256Digest = `sha256:${string}`;
4
4
  export interface PluginActivation {
@@ -16,7 +16,7 @@ export interface UpstreamManagedBy {
16
16
  readonly contributionId: string;
17
17
  readonly bindingId: ConfigurationId;
18
18
  }
19
- type ConfigurationUpstreamPolicy = Omit<Endpoint, 'id' | 'plugins' | 'weight' | 'priority' | 'is_disabled'>;
19
+ type ConfigurationUpstreamPolicy = Omit<Endpoint, 'id' | 'position' | 'plugins' | 'weight' | 'priority' | 'is_disabled'>;
20
20
  export interface ConfigurationUpstream extends ConfigurationUpstreamPolicy {
21
21
  readonly id: ConfigurationId;
22
22
  readonly position: number;
@@ -26,15 +26,16 @@ export interface ConfigurationUpstream extends ConfigurationUpstreamPolicy {
26
26
  readonly managedBy?: UpstreamManagedBy;
27
27
  readonly plugins: readonly PluginBinding[];
28
28
  }
29
- type ConfigurationServicePolicy = Omit<Service, 'name' | 'endpoints' | 'plugins'>;
29
+ type ConfigurationServicePolicy = Omit<Service, 'name' | 'endpoints' | 'plugins' | 'service_references'>;
30
30
  export interface ConfigurationService extends ConfigurationServicePolicy {
31
31
  readonly id: ConfigurationId;
32
32
  readonly position: number;
33
33
  readonly name: string;
34
34
  readonly endpoints: readonly ConfigurationUpstream[];
35
+ readonly service_references?: readonly ServiceReference[];
35
36
  readonly plugins: readonly PluginBinding[];
36
37
  }
37
- type ConfigurationRoutePolicy = Omit<RouteConfig, 'path' | 'service' | 'endpoints' | 'plugins'>;
38
+ type ConfigurationRoutePolicy = Omit<RouteConfig, 'path' | 'service_references' | 'endpoints' | 'plugins'>;
38
39
  interface ConfigurationRouteBase extends ConfigurationRoutePolicy {
39
40
  readonly id: ConfigurationId;
40
41
  readonly position: number;
@@ -42,11 +43,11 @@ interface ConfigurationRouteBase extends ConfigurationRoutePolicy {
42
43
  readonly plugins: readonly PluginBinding[];
43
44
  }
44
45
  export interface ConfigurationServiceRoute extends ConfigurationRouteBase {
45
- readonly service_id: ConfigurationId;
46
+ readonly service_references: readonly [ServiceReference, ...ServiceReference[]];
46
47
  readonly endpoints?: never;
47
48
  }
48
49
  export interface ConfigurationDirectRoute extends ConfigurationRouteBase {
49
- readonly service_id?: never;
50
+ readonly service_references?: never;
50
51
  readonly endpoints: readonly ConfigurationUpstream[];
51
52
  }
52
53
  export type ConfigurationRoute = ConfigurationServiceRoute | ConfigurationDirectRoute;
package/dist/types.d.ts CHANGED
@@ -84,6 +84,8 @@ export interface DirectionalModificationRules {
84
84
  }
85
85
  export interface Endpoint extends DirectionalModificationRules {
86
86
  id?: string;
87
+ /** Ordering shared with Service references in the same selection layer. */
88
+ position?: number;
87
89
  target: string;
88
90
  weight?: number;
89
91
  priority?: number;
@@ -144,11 +146,21 @@ export interface LoadBalancingConfig {
144
146
  hash_policy?: HashPolicyConfig;
145
147
  }
146
148
  export type LLMProtocol = 'responses' | 'chat_completions' | 'anthropic_messages';
149
+ export interface ServiceReference {
150
+ id: string;
151
+ position: number;
152
+ service_id: string;
153
+ weight: number;
154
+ priority: number;
155
+ is_disabled: boolean;
156
+ }
157
+ export type ServiceSelectionFailoverConfig = Pick<FailoverConfig, 'enabled' | 'retry_on' | 'retry_on_response'>;
147
158
  export interface Service {
148
159
  /** Stable identity supplied by the runtime compiler. */
149
160
  id?: string;
150
161
  name: string;
151
162
  endpoints: Endpoint[];
163
+ service_references?: ServiceReference[];
152
164
  plugins?: Array<PluginConfig | string>;
153
165
  health_check?: ServiceHealthCheckConfig;
154
166
  failover?: FailoverConfig;
@@ -219,8 +231,9 @@ export interface RouteConfig extends DirectionalModificationRules {
219
231
  /** Stable logical route identity, present only in compiled runtime config. */
220
232
  id?: string;
221
233
  path: string;
222
- service?: string;
223
- service_id?: string;
234
+ service_references?: ServiceReference[];
235
+ load_balancing?: LoadBalancingConfig;
236
+ failover?: ServiceSelectionFailoverConfig;
224
237
  endpoints?: Endpoint[];
225
238
  path_rewrite?: Record<string, string>;
226
239
  auth?: AuthConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffusion/bungee-types",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "description": "TypeScript type definitions for Bungee",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",