@scaffoldly/rowdy 0.0.2-1-beta.20251001181536.46b12ea → 0.0.2-1-beta.20251007104846.d76c006
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 +11 -8
- package/dist/index.js +102 -57
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ interface ILoggable {
|
|
|
3
3
|
repr(): string;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
type CheckResult = `${number}ms` | 'timeout' | 'error' | 'unknown';
|
|
7
|
+
|
|
6
8
|
type RouteRuleMatchDetail = {
|
|
7
9
|
type?: 'PathToRegexp' | 'Exact' | 'PathPrefix';
|
|
8
10
|
value?: string;
|
|
@@ -23,22 +25,24 @@ interface IRoutes {
|
|
|
23
25
|
readonly version: RoutesVersion;
|
|
24
26
|
readonly rules: Array<RouteRule>;
|
|
25
27
|
}
|
|
28
|
+
type URIHealth = {
|
|
29
|
+
healthy: boolean;
|
|
30
|
+
latency: CheckResult;
|
|
31
|
+
};
|
|
26
32
|
declare class URI extends URL implements ILoggable {
|
|
27
33
|
readonly insecure: boolean;
|
|
28
34
|
private constructor();
|
|
29
35
|
static from(uri: string): URI;
|
|
36
|
+
health(): Promise<URIHealth>;
|
|
30
37
|
repr(): string;
|
|
31
38
|
}
|
|
32
|
-
type Health =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
origin: string;
|
|
36
|
-
healthy: boolean;
|
|
37
|
-
}>;
|
|
38
|
-
}>;
|
|
39
|
+
type Health = {
|
|
40
|
+
[origin: string]: URIHealth;
|
|
41
|
+
};
|
|
39
42
|
declare class Routes implements IRoutes, ILoggable {
|
|
40
43
|
readonly version: RoutesVersion;
|
|
41
44
|
readonly rules: Array<RouteRule>;
|
|
45
|
+
static fromDataURL(dataUrl?: string): Routes;
|
|
42
46
|
withRules(rules: Array<RouteRule>): this;
|
|
43
47
|
withDefault(target: string): this;
|
|
44
48
|
withPaths(paths: {
|
|
@@ -46,7 +50,6 @@ declare class Routes implements IRoutes, ILoggable {
|
|
|
46
50
|
}): this;
|
|
47
51
|
withPath(path: string, target: string): this;
|
|
48
52
|
withMatch(match: RouteRuleMatch, target: RouteRuleBackendRef): this;
|
|
49
|
-
static fromDataURL(dataUrl?: string): Routes;
|
|
50
53
|
intoDataURL(): string;
|
|
51
54
|
intoURI(path: string): URI | undefined;
|
|
52
55
|
health(): Promise<Health>;
|