@http-client-toolkit/dashboard 0.1.0 → 1.0.1
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/client/assets/index-6z-6Qs7v.css +598 -1
- package/dist/client/assets/index-C17ynkdl.js +13634 -14
- package/dist/client/index.html +1 -1
- package/lib/index.cjs +420 -295
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +221 -168
- package/lib/index.d.ts +221 -168
- package/lib/index.js +398 -292
- package/lib/index.js.map +1 -1
- package/package.json +9 -9
package/lib/index.d.ts
CHANGED
|
@@ -1,188 +1,241 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse, Server } from 'http';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
HttpClient,
|
|
4
|
+
CacheStore,
|
|
5
|
+
DedupeStore,
|
|
6
|
+
RateLimitStore,
|
|
7
|
+
} from '@http-client-toolkit/core';
|
|
3
8
|
import { z } from 'zod';
|
|
4
9
|
|
|
5
|
-
declare const ClientConfigSchema: z.ZodEffects<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
declare const DashboardOptionsSchema: z.ZodEffects<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
10
|
+
declare const ClientConfigSchema: z.ZodEffects<
|
|
11
|
+
z.ZodObject<
|
|
12
|
+
{
|
|
13
|
+
client: z.ZodType<HttpClient, z.ZodTypeDef, HttpClient>;
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
},
|
|
16
|
+
'strip',
|
|
17
|
+
z.ZodTypeAny,
|
|
18
|
+
{
|
|
19
|
+
client: HttpClient;
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
client: HttpClient;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
>,
|
|
27
|
+
{
|
|
28
|
+
client: HttpClient;
|
|
29
|
+
name?: string | undefined;
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
client: HttpClient;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
>;
|
|
36
|
+
declare const DashboardOptionsSchema: z.ZodEffects<
|
|
37
|
+
z.ZodObject<
|
|
38
|
+
{
|
|
39
|
+
clients: z.ZodArray<
|
|
40
|
+
z.ZodEffects<
|
|
41
|
+
z.ZodObject<
|
|
42
|
+
{
|
|
43
|
+
client: z.ZodType<HttpClient, z.ZodTypeDef, HttpClient>;
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
},
|
|
46
|
+
'strip',
|
|
47
|
+
z.ZodTypeAny,
|
|
48
|
+
{
|
|
49
|
+
client: HttpClient;
|
|
50
|
+
name?: string | undefined;
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
client: HttpClient;
|
|
54
|
+
name?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
>,
|
|
57
|
+
{
|
|
58
|
+
client: HttpClient;
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
client: HttpClient;
|
|
63
|
+
name?: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
>,
|
|
66
|
+
'many'
|
|
67
|
+
>;
|
|
68
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
69
|
+
pollIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
70
|
+
},
|
|
71
|
+
'strip',
|
|
72
|
+
z.ZodTypeAny,
|
|
73
|
+
{
|
|
74
|
+
clients: {
|
|
75
|
+
client: HttpClient;
|
|
76
|
+
name?: string | undefined;
|
|
77
|
+
}[];
|
|
78
|
+
basePath: string;
|
|
79
|
+
pollIntervalMs: number;
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
clients: {
|
|
83
|
+
client: HttpClient;
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
}[];
|
|
86
|
+
basePath?: string | undefined;
|
|
87
|
+
pollIntervalMs?: number | undefined;
|
|
88
|
+
}
|
|
89
|
+
>,
|
|
90
|
+
{
|
|
61
91
|
clients: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
dedupeStore?: DedupeStore<unknown> | undefined;
|
|
65
|
-
rateLimitStore?: RateLimitStore | undefined;
|
|
92
|
+
client: HttpClient;
|
|
93
|
+
name?: string | undefined;
|
|
66
94
|
}[];
|
|
67
95
|
basePath: string;
|
|
68
96
|
pollIntervalMs: number;
|
|
69
|
-
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
70
99
|
clients: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
dedupeStore?: DedupeStore<unknown> | undefined;
|
|
74
|
-
rateLimitStore?: RateLimitStore | undefined;
|
|
100
|
+
client: HttpClient;
|
|
101
|
+
name?: string | undefined;
|
|
75
102
|
}[];
|
|
76
103
|
basePath?: string | undefined;
|
|
77
104
|
pollIntervalMs?: number | undefined;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
name
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
105
|
+
}
|
|
106
|
+
>;
|
|
107
|
+
declare const StandaloneDashboardOptionsSchema: z.ZodIntersection<
|
|
108
|
+
z.ZodEffects<
|
|
109
|
+
z.ZodObject<
|
|
110
|
+
{
|
|
111
|
+
clients: z.ZodArray<
|
|
112
|
+
z.ZodEffects<
|
|
113
|
+
z.ZodObject<
|
|
114
|
+
{
|
|
115
|
+
client: z.ZodType<HttpClient, z.ZodTypeDef, HttpClient>;
|
|
116
|
+
name: z.ZodOptional<z.ZodString>;
|
|
117
|
+
},
|
|
118
|
+
'strip',
|
|
119
|
+
z.ZodTypeAny,
|
|
120
|
+
{
|
|
121
|
+
client: HttpClient;
|
|
122
|
+
name?: string | undefined;
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
client: HttpClient;
|
|
126
|
+
name?: string | undefined;
|
|
127
|
+
}
|
|
128
|
+
>,
|
|
129
|
+
{
|
|
130
|
+
client: HttpClient;
|
|
131
|
+
name?: string | undefined;
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
client: HttpClient;
|
|
135
|
+
name?: string | undefined;
|
|
136
|
+
}
|
|
137
|
+
>,
|
|
138
|
+
'many'
|
|
139
|
+
>;
|
|
140
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
141
|
+
pollIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
},
|
|
143
|
+
'strip',
|
|
144
|
+
z.ZodTypeAny,
|
|
145
|
+
{
|
|
146
|
+
clients: {
|
|
147
|
+
client: HttpClient;
|
|
148
|
+
name?: string | undefined;
|
|
149
|
+
}[];
|
|
150
|
+
basePath: string;
|
|
151
|
+
pollIntervalMs: number;
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
clients: {
|
|
155
|
+
client: HttpClient;
|
|
156
|
+
name?: string | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
basePath?: string | undefined;
|
|
159
|
+
pollIntervalMs?: number | undefined;
|
|
160
|
+
}
|
|
161
|
+
>,
|
|
162
|
+
{
|
|
163
|
+
clients: {
|
|
164
|
+
client: HttpClient;
|
|
165
|
+
name?: string | undefined;
|
|
166
|
+
}[];
|
|
167
|
+
basePath: string;
|
|
168
|
+
pollIntervalMs: number;
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
clients: {
|
|
172
|
+
client: HttpClient;
|
|
173
|
+
name?: string | undefined;
|
|
174
|
+
}[];
|
|
175
|
+
basePath?: string | undefined;
|
|
176
|
+
pollIntervalMs?: number | undefined;
|
|
177
|
+
}
|
|
178
|
+
>,
|
|
179
|
+
z.ZodObject<
|
|
180
|
+
{
|
|
181
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
182
|
+
host: z.ZodDefault<z.ZodString>;
|
|
183
|
+
},
|
|
184
|
+
'strip',
|
|
185
|
+
z.ZodTypeAny,
|
|
186
|
+
{
|
|
187
|
+
port: number;
|
|
188
|
+
host: string;
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
port?: number | undefined;
|
|
192
|
+
host?: string | undefined;
|
|
193
|
+
}
|
|
194
|
+
>
|
|
195
|
+
>;
|
|
196
|
+
interface NormalizedClientConfig {
|
|
197
|
+
name: string;
|
|
198
|
+
cacheStore?: CacheStore;
|
|
199
|
+
dedupeStore?: DedupeStore;
|
|
200
|
+
rateLimitStore?: RateLimitStore;
|
|
201
|
+
}
|
|
172
202
|
type ClientConfig = z.input<typeof ClientConfigSchema>;
|
|
173
203
|
type DashboardOptions = z.input<typeof DashboardOptionsSchema>;
|
|
174
|
-
type StandaloneDashboardOptions = z.input<
|
|
204
|
+
type StandaloneDashboardOptions = z.input<
|
|
205
|
+
typeof StandaloneDashboardOptionsSchema
|
|
206
|
+
>;
|
|
175
207
|
|
|
176
|
-
type DashboardMiddleware = (
|
|
177
|
-
|
|
208
|
+
type DashboardMiddleware = (
|
|
209
|
+
req: IncomingMessage,
|
|
210
|
+
res: ServerResponse,
|
|
211
|
+
next?: () => void,
|
|
212
|
+
) => void;
|
|
213
|
+
declare function createDashboard(
|
|
214
|
+
options: DashboardOptions,
|
|
215
|
+
): DashboardMiddleware;
|
|
178
216
|
|
|
179
217
|
type DashboardFetchHandler = (request: Request) => Promise<Response>;
|
|
180
|
-
declare function createDashboardHandler(
|
|
218
|
+
declare function createDashboardHandler(
|
|
219
|
+
options: DashboardOptions,
|
|
220
|
+
): DashboardFetchHandler;
|
|
181
221
|
|
|
182
222
|
interface StandaloneDashboardServer {
|
|
183
|
-
|
|
184
|
-
|
|
223
|
+
server: Server;
|
|
224
|
+
close(): Promise<void>;
|
|
185
225
|
}
|
|
186
|
-
declare function startDashboard(
|
|
226
|
+
declare function startDashboard(
|
|
227
|
+
options: StandaloneDashboardOptions,
|
|
228
|
+
): Promise<StandaloneDashboardServer>;
|
|
187
229
|
|
|
188
|
-
export {
|
|
230
|
+
export {
|
|
231
|
+
type ClientConfig,
|
|
232
|
+
type DashboardFetchHandler,
|
|
233
|
+
type DashboardMiddleware,
|
|
234
|
+
type DashboardOptions,
|
|
235
|
+
type NormalizedClientConfig,
|
|
236
|
+
type StandaloneDashboardOptions,
|
|
237
|
+
type StandaloneDashboardServer,
|
|
238
|
+
createDashboard,
|
|
239
|
+
createDashboardHandler,
|
|
240
|
+
startDashboard,
|
|
241
|
+
};
|