@scaffoldly/rowdy 0.0.2-1-beta.20251008111131.3b3025c → 0.0.2-1-beta.20251008133520.50f4675

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/index.d.ts CHANGED
@@ -5,6 +5,10 @@ interface ILoggable {
5
5
 
6
6
  type CheckResult = `${number}ms` | 'timeout' | 'error' | 'unknown';
7
7
 
8
+ type RoutesApiVersion = 'rowdy.run/v1alpha1';
9
+ type RoutePaths = {
10
+ [key: string]: string | undefined;
11
+ };
8
12
  type RouteRuleMatchDetail = {
9
13
  type?: 'PathToRegexp' | 'Exact' | 'PathPrefix';
10
14
  value?: string;
@@ -20,9 +24,8 @@ type RouteRule = {
20
24
  matches?: Array<RouteRuleMatch>;
21
25
  backendRefs?: Array<RouteRuleBackendRef>;
22
26
  };
23
- type RoutesVersion = 'v1alpha1';
24
27
  interface IRoutes {
25
- readonly version: RoutesVersion;
28
+ readonly version: RoutesApiVersion;
26
29
  readonly rules: Array<RouteRule>;
27
30
  }
28
31
  type URIHealth = {
@@ -40,19 +43,18 @@ type Health = {
40
43
  [origin: string]: URIHealth;
41
44
  };
42
45
  declare class Routes implements IRoutes, ILoggable {
43
- readonly version: RoutesVersion;
46
+ readonly version: RoutesApiVersion;
44
47
  readonly rules: Array<RouteRule>;
45
48
  static fromURL(url: string): Routes;
46
49
  static fromPath(path: string): Routes;
47
50
  static fromDataURL(dataUrl: string): Routes;
48
- withRules(rules: Array<RouteRule>): this;
49
51
  withDefault(target: string): this;
50
- withPaths(paths: {
51
- [key: string]: string | undefined;
52
- }): this;
52
+ withPaths(paths: RoutePaths): this;
53
53
  withPath(path: string, target: string): this;
54
54
  withMatch(match: RouteRuleMatch, target: RouteRuleBackendRef): this;
55
55
  intoDataURL(): string;
56
+ intoDefault(): string;
57
+ intoPaths(): RoutePaths;
56
58
  intoURI(path: string): URI | undefined;
57
59
  health(): Promise<Health>;
58
60
  repr(): string;