web_plsql 1.0.0 → 1.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/README.md +5 -5
- package/package.json +5 -5
- package/src/admin/client/charts.ts +303 -4
- package/src/admin/index.html +283 -69
- package/src/admin/js/api.ts +95 -20
- package/src/admin/js/app.ts +460 -152
- package/src/admin/js/schemas.ts +76 -14
- package/src/admin/js/templates/config.ts +10 -9
- package/src/admin/js/templates/errorRow.ts +8 -5
- package/src/admin/js/templates/index.ts +1 -0
- package/src/admin/js/templates/poolCard.ts +6 -6
- package/src/admin/js/templates/traceRow.ts +24 -0
- package/src/admin/js/types.ts +132 -19
- package/src/admin/js/ui/components.ts +44 -0
- package/src/admin/js/ui/table.ts +173 -0
- package/src/admin/js/ui/views.ts +311 -48
- package/src/admin/js/util/format.ts +22 -3
- package/src/admin/js/util/metrics.ts +24 -0
- package/src/admin/lib/chart.bundle.css +1 -0
- package/src/admin/lib/chart.bundle.js +54 -47
- package/src/admin/style.css +143 -27
- package/src/handler/handlerAdmin.js +121 -26
- package/src/handler/plsql/errorPage.js +0 -4
- package/src/handler/plsql/owaPageStream.js +93 -0
- package/src/handler/plsql/procedure.js +191 -121
- package/src/handler/plsql/procedureNamed.js +17 -3
- package/src/handler/plsql/procedureSanitize.js +24 -0
- package/src/handler/plsql/procedureVariable.js +2 -0
- package/src/handler/plsql/sendResponse.js +41 -3
- package/src/index.js +0 -1
- package/src/server/adminContext.js +23 -0
- package/src/server/server.js +83 -68
- package/src/types.js +1 -1
- package/src/util/statsManager.js +368 -0
- package/src/util/trace.js +2 -1
- package/src/util/traceManager.js +68 -0
- package/src/version.js +1 -1
- package/types/admin/js/schemas.d.ts +384 -0
- package/types/admin/js/types.d.ts +312 -0
- package/types/handler/handlerAdmin.d.ts +70 -0
- package/types/handler/plsql/owaPageStream.d.ts +28 -0
- package/types/handler/plsql/procedure.d.ts +1 -0
- package/types/index.d.ts +0 -1
- package/types/server/adminContext.d.ts +17 -0
- package/types/server/server.d.ts +2 -19
- package/types/types.d.ts +1 -1
- package/types/util/statsManager.d.ts +395 -0
- package/types/util/traceManager.d.ts +35 -0
- package/src/admin/lib/assets/main-zpdhQ1gD.css +0 -1
- package/src/handler/handlerMetrics.js +0 -68
- package/types/handler/handlerMetrics.d.ts +0 -25
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Cache statistics schema.
|
|
4
|
+
*/
|
|
5
|
+
export declare const cacheStatsSchema: z.ZodObject<{
|
|
6
|
+
size: z.ZodNumber;
|
|
7
|
+
hits: z.ZodNumber;
|
|
8
|
+
misses: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* Pool cache snapshot schema.
|
|
12
|
+
*/
|
|
13
|
+
export declare const poolCacheSnapshotSchema: z.ZodObject<{
|
|
14
|
+
procedureName: z.ZodObject<{
|
|
15
|
+
size: z.ZodNumber;
|
|
16
|
+
hits: z.ZodNumber;
|
|
17
|
+
misses: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
argument: z.ZodObject<{
|
|
20
|
+
size: z.ZodNumber;
|
|
21
|
+
hits: z.ZodNumber;
|
|
22
|
+
misses: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
/**
|
|
26
|
+
* Pool statistics schema.
|
|
27
|
+
*/
|
|
28
|
+
export declare const poolStatsSchema: z.ZodObject<{
|
|
29
|
+
totalRequests: z.ZodNumber;
|
|
30
|
+
totalTimeouts: z.ZodNumber;
|
|
31
|
+
totalRequestsEnqueued: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
totalRequestsDequeued: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
totalRequestsFailed: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Pool information schema.
|
|
37
|
+
*/
|
|
38
|
+
export declare const poolInfoSchema: z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
connectionsInUse: z.ZodNumber;
|
|
41
|
+
connectionsOpen: z.ZodNumber;
|
|
42
|
+
stats: z.ZodNullable<z.ZodObject<{
|
|
43
|
+
totalRequests: z.ZodNumber;
|
|
44
|
+
totalTimeouts: z.ZodNumber;
|
|
45
|
+
totalRequestsEnqueued: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
totalRequestsDequeued: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
totalRequestsFailed: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
procedureName: z.ZodObject<{
|
|
51
|
+
size: z.ZodNumber;
|
|
52
|
+
hits: z.ZodNumber;
|
|
53
|
+
misses: z.ZodNumber;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
argument: z.ZodObject<{
|
|
56
|
+
size: z.ZodNumber;
|
|
57
|
+
hits: z.ZodNumber;
|
|
58
|
+
misses: z.ZodNumber;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Server metrics schema.
|
|
64
|
+
*/
|
|
65
|
+
export declare const metricsSchema: z.ZodObject<{
|
|
66
|
+
requestCount: z.ZodNumber;
|
|
67
|
+
errorCount: z.ZodNumber;
|
|
68
|
+
avgResponseTime: z.ZodNumber;
|
|
69
|
+
minResponseTime: z.ZodNumber;
|
|
70
|
+
maxResponseTime: z.ZodNumber;
|
|
71
|
+
maxRequestsPerSecond: z.ZodNumber;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
/**
|
|
74
|
+
* Historical bucket schema.
|
|
75
|
+
*/
|
|
76
|
+
export declare const bucketSchema: z.ZodObject<{
|
|
77
|
+
timestamp: z.ZodNumber;
|
|
78
|
+
requests: z.ZodNumber;
|
|
79
|
+
errors: z.ZodNumber;
|
|
80
|
+
durationMin: z.ZodNumber;
|
|
81
|
+
durationMax: z.ZodNumber;
|
|
82
|
+
durationAvg: z.ZodNumber;
|
|
83
|
+
durationP95: z.ZodNumber;
|
|
84
|
+
durationP99: z.ZodNumber;
|
|
85
|
+
system: z.ZodObject<{
|
|
86
|
+
cpu: z.ZodNumber;
|
|
87
|
+
heapUsed: z.ZodNumber;
|
|
88
|
+
heapTotal: z.ZodNumber;
|
|
89
|
+
rss: z.ZodNumber;
|
|
90
|
+
external: z.ZodNumber;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
pools: z.ZodArray<z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
connectionsInUse: z.ZodNumber;
|
|
95
|
+
connectionsOpen: z.ZodNumber;
|
|
96
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
procedureName: z.ZodObject<{
|
|
98
|
+
size: z.ZodNumber;
|
|
99
|
+
hits: z.ZodNumber;
|
|
100
|
+
misses: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
argument: z.ZodObject<{
|
|
103
|
+
size: z.ZodNumber;
|
|
104
|
+
hits: z.ZodNumber;
|
|
105
|
+
misses: z.ZodNumber;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
/**
|
|
111
|
+
* Route configuration schema.
|
|
112
|
+
*/
|
|
113
|
+
export declare const routeConfigSchema: z.ZodObject<{
|
|
114
|
+
route: z.ZodString;
|
|
115
|
+
user: z.ZodOptional<z.ZodString>;
|
|
116
|
+
password: z.ZodOptional<z.ZodString>;
|
|
117
|
+
connectString: z.ZodOptional<z.ZodString>;
|
|
118
|
+
defaultPage: z.ZodOptional<z.ZodString>;
|
|
119
|
+
pathAlias: z.ZodOptional<z.ZodString>;
|
|
120
|
+
pathAliasProcedure: z.ZodOptional<z.ZodString>;
|
|
121
|
+
documentTable: z.ZodOptional<z.ZodString>;
|
|
122
|
+
exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
requestValidationFunction: z.ZodOptional<z.ZodString>;
|
|
124
|
+
transactionMode: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
+
errorStyle: z.ZodOptional<z.ZodString>;
|
|
126
|
+
directoryPath: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
/**
|
|
129
|
+
* Server configuration schema.
|
|
130
|
+
*/
|
|
131
|
+
export declare const serverConfigSchema: z.ZodObject<{
|
|
132
|
+
port: z.ZodNumber;
|
|
133
|
+
adminRoute: z.ZodOptional<z.ZodString>;
|
|
134
|
+
adminUser: z.ZodOptional<z.ZodString>;
|
|
135
|
+
adminPassword: z.ZodOptional<z.ZodString>;
|
|
136
|
+
loggerFilename: z.ZodString;
|
|
137
|
+
uploadFileSizeLimit: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
routePlSql: z.ZodArray<z.ZodObject<{
|
|
139
|
+
route: z.ZodString;
|
|
140
|
+
user: z.ZodOptional<z.ZodString>;
|
|
141
|
+
password: z.ZodOptional<z.ZodString>;
|
|
142
|
+
connectString: z.ZodOptional<z.ZodString>;
|
|
143
|
+
defaultPage: z.ZodOptional<z.ZodString>;
|
|
144
|
+
pathAlias: z.ZodOptional<z.ZodString>;
|
|
145
|
+
pathAliasProcedure: z.ZodOptional<z.ZodString>;
|
|
146
|
+
documentTable: z.ZodOptional<z.ZodString>;
|
|
147
|
+
exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
148
|
+
requestValidationFunction: z.ZodOptional<z.ZodString>;
|
|
149
|
+
transactionMode: z.ZodOptional<z.ZodUnknown>;
|
|
150
|
+
errorStyle: z.ZodOptional<z.ZodString>;
|
|
151
|
+
directoryPath: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
routeStatic: z.ZodArray<z.ZodObject<{
|
|
154
|
+
route: z.ZodString;
|
|
155
|
+
user: z.ZodOptional<z.ZodString>;
|
|
156
|
+
password: z.ZodOptional<z.ZodString>;
|
|
157
|
+
connectString: z.ZodOptional<z.ZodString>;
|
|
158
|
+
defaultPage: z.ZodOptional<z.ZodString>;
|
|
159
|
+
pathAlias: z.ZodOptional<z.ZodString>;
|
|
160
|
+
pathAliasProcedure: z.ZodOptional<z.ZodString>;
|
|
161
|
+
documentTable: z.ZodOptional<z.ZodString>;
|
|
162
|
+
exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
requestValidationFunction: z.ZodOptional<z.ZodString>;
|
|
164
|
+
transactionMode: z.ZodOptional<z.ZodUnknown>;
|
|
165
|
+
errorStyle: z.ZodOptional<z.ZodString>;
|
|
166
|
+
directoryPath: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strip>>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
/**
|
|
170
|
+
* System information schema.
|
|
171
|
+
*/
|
|
172
|
+
export declare const systemInfoSchema: z.ZodObject<{
|
|
173
|
+
nodeVersion: z.ZodString;
|
|
174
|
+
platform: z.ZodString;
|
|
175
|
+
arch: z.ZodString;
|
|
176
|
+
cpuCores: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
memory: z.ZodObject<{
|
|
178
|
+
rss: z.ZodNumber;
|
|
179
|
+
heapTotal: z.ZodNumber;
|
|
180
|
+
heapUsed: z.ZodNumber;
|
|
181
|
+
external: z.ZodNumber;
|
|
182
|
+
totalMemory: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
rssMax: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
heapTotalMax: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
heapUsedMax: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
externalMax: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
cpu: z.ZodObject<{
|
|
189
|
+
user: z.ZodNumber;
|
|
190
|
+
system: z.ZodNumber;
|
|
191
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
userMax: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
systemMax: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
/**
|
|
197
|
+
* Server status response schema.
|
|
198
|
+
*/
|
|
199
|
+
export declare const statusSchema: z.ZodObject<{
|
|
200
|
+
version: z.ZodString;
|
|
201
|
+
status: z.ZodEnum<{
|
|
202
|
+
stopped: "stopped";
|
|
203
|
+
paused: "paused";
|
|
204
|
+
running: "running";
|
|
205
|
+
}>;
|
|
206
|
+
uptime: z.ZodNumber;
|
|
207
|
+
startTime: z.ZodString;
|
|
208
|
+
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
metrics: z.ZodObject<{
|
|
210
|
+
requestCount: z.ZodNumber;
|
|
211
|
+
errorCount: z.ZodNumber;
|
|
212
|
+
avgResponseTime: z.ZodNumber;
|
|
213
|
+
minResponseTime: z.ZodNumber;
|
|
214
|
+
maxResponseTime: z.ZodNumber;
|
|
215
|
+
maxRequestsPerSecond: z.ZodNumber;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
218
|
+
timestamp: z.ZodNumber;
|
|
219
|
+
requests: z.ZodNumber;
|
|
220
|
+
errors: z.ZodNumber;
|
|
221
|
+
durationMin: z.ZodNumber;
|
|
222
|
+
durationMax: z.ZodNumber;
|
|
223
|
+
durationAvg: z.ZodNumber;
|
|
224
|
+
durationP95: z.ZodNumber;
|
|
225
|
+
durationP99: z.ZodNumber;
|
|
226
|
+
system: z.ZodObject<{
|
|
227
|
+
cpu: z.ZodNumber;
|
|
228
|
+
heapUsed: z.ZodNumber;
|
|
229
|
+
heapTotal: z.ZodNumber;
|
|
230
|
+
rss: z.ZodNumber;
|
|
231
|
+
external: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
pools: z.ZodArray<z.ZodObject<{
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
connectionsInUse: z.ZodNumber;
|
|
236
|
+
connectionsOpen: z.ZodNumber;
|
|
237
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
procedureName: z.ZodObject<{
|
|
239
|
+
size: z.ZodNumber;
|
|
240
|
+
hits: z.ZodNumber;
|
|
241
|
+
misses: z.ZodNumber;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
argument: z.ZodObject<{
|
|
244
|
+
size: z.ZodNumber;
|
|
245
|
+
hits: z.ZodNumber;
|
|
246
|
+
misses: z.ZodNumber;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>>>;
|
|
251
|
+
pools: z.ZodArray<z.ZodObject<{
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
connectionsInUse: z.ZodNumber;
|
|
254
|
+
connectionsOpen: z.ZodNumber;
|
|
255
|
+
stats: z.ZodNullable<z.ZodObject<{
|
|
256
|
+
totalRequests: z.ZodNumber;
|
|
257
|
+
totalTimeouts: z.ZodNumber;
|
|
258
|
+
totalRequestsEnqueued: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
totalRequestsDequeued: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
totalRequestsFailed: z.ZodOptional<z.ZodNumber>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
procedureName: z.ZodObject<{
|
|
264
|
+
size: z.ZodNumber;
|
|
265
|
+
hits: z.ZodNumber;
|
|
266
|
+
misses: z.ZodNumber;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
argument: z.ZodObject<{
|
|
269
|
+
size: z.ZodNumber;
|
|
270
|
+
hits: z.ZodNumber;
|
|
271
|
+
misses: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
}, z.core.$strip>>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
system: z.ZodObject<{
|
|
276
|
+
nodeVersion: z.ZodString;
|
|
277
|
+
platform: z.ZodString;
|
|
278
|
+
arch: z.ZodString;
|
|
279
|
+
cpuCores: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
memory: z.ZodObject<{
|
|
281
|
+
rss: z.ZodNumber;
|
|
282
|
+
heapTotal: z.ZodNumber;
|
|
283
|
+
heapUsed: z.ZodNumber;
|
|
284
|
+
external: z.ZodNumber;
|
|
285
|
+
totalMemory: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
rssMax: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
heapTotalMax: z.ZodOptional<z.ZodNumber>;
|
|
288
|
+
heapUsedMax: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
externalMax: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
cpu: z.ZodObject<{
|
|
292
|
+
user: z.ZodNumber;
|
|
293
|
+
system: z.ZodNumber;
|
|
294
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
userMax: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
systemMax: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
config: z.ZodObject<{
|
|
300
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
adminRoute: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
302
|
+
adminUser: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
303
|
+
adminPassword: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
304
|
+
loggerFilename: z.ZodOptional<z.ZodString>;
|
|
305
|
+
uploadFileSizeLimit: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
306
|
+
routePlSql: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
+
route: z.ZodString;
|
|
308
|
+
user: z.ZodOptional<z.ZodString>;
|
|
309
|
+
password: z.ZodOptional<z.ZodString>;
|
|
310
|
+
connectString: z.ZodOptional<z.ZodString>;
|
|
311
|
+
defaultPage: z.ZodOptional<z.ZodString>;
|
|
312
|
+
pathAlias: z.ZodOptional<z.ZodString>;
|
|
313
|
+
pathAliasProcedure: z.ZodOptional<z.ZodString>;
|
|
314
|
+
documentTable: z.ZodOptional<z.ZodString>;
|
|
315
|
+
exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
316
|
+
requestValidationFunction: z.ZodOptional<z.ZodString>;
|
|
317
|
+
transactionMode: z.ZodOptional<z.ZodUnknown>;
|
|
318
|
+
errorStyle: z.ZodOptional<z.ZodString>;
|
|
319
|
+
directoryPath: z.ZodOptional<z.ZodString>;
|
|
320
|
+
}, z.core.$strip>>>;
|
|
321
|
+
routeStatic: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
322
|
+
route: z.ZodString;
|
|
323
|
+
user: z.ZodOptional<z.ZodString>;
|
|
324
|
+
password: z.ZodOptional<z.ZodString>;
|
|
325
|
+
connectString: z.ZodOptional<z.ZodString>;
|
|
326
|
+
defaultPage: z.ZodOptional<z.ZodString>;
|
|
327
|
+
pathAlias: z.ZodOptional<z.ZodString>;
|
|
328
|
+
pathAliasProcedure: z.ZodOptional<z.ZodString>;
|
|
329
|
+
documentTable: z.ZodOptional<z.ZodString>;
|
|
330
|
+
exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
331
|
+
requestValidationFunction: z.ZodOptional<z.ZodString>;
|
|
332
|
+
transactionMode: z.ZodOptional<z.ZodUnknown>;
|
|
333
|
+
errorStyle: z.ZodOptional<z.ZodString>;
|
|
334
|
+
directoryPath: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>>>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
/**
|
|
339
|
+
* Error log entry schema.
|
|
340
|
+
*/
|
|
341
|
+
export declare const errorLogSchema: z.ZodObject<{
|
|
342
|
+
timestamp: z.ZodString;
|
|
343
|
+
req: z.ZodOptional<z.ZodObject<{
|
|
344
|
+
method: z.ZodOptional<z.ZodString>;
|
|
345
|
+
url: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
message: z.ZodString;
|
|
348
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
349
|
+
fullMessage: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strip>>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
export declare const accessLogResponseSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
|
|
353
|
+
message: z.ZodString;
|
|
354
|
+
}, z.core.$strip>]>;
|
|
355
|
+
/**
|
|
356
|
+
* Trace entry schema.
|
|
357
|
+
*/
|
|
358
|
+
export declare const traceEntrySchema: z.ZodObject<{
|
|
359
|
+
id: z.ZodString;
|
|
360
|
+
timestamp: z.ZodString;
|
|
361
|
+
source: z.ZodString;
|
|
362
|
+
url: z.ZodString;
|
|
363
|
+
method: z.ZodString;
|
|
364
|
+
status: z.ZodString;
|
|
365
|
+
duration: z.ZodNumber;
|
|
366
|
+
procedure: z.ZodOptional<z.ZodString>;
|
|
367
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
368
|
+
uploads: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
369
|
+
downloads: z.ZodOptional<z.ZodObject<{
|
|
370
|
+
fileType: z.ZodString;
|
|
371
|
+
fileSize: z.ZodNumber;
|
|
372
|
+
}, z.core.$strip>>;
|
|
373
|
+
html: z.ZodOptional<z.ZodString>;
|
|
374
|
+
cookies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
375
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
376
|
+
cgi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
377
|
+
error: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
/**
|
|
380
|
+
* API response type helpers.
|
|
381
|
+
*/
|
|
382
|
+
export type StatusResponse = z.infer<typeof statusSchema>;
|
|
383
|
+
export type ErrorLogResponse = z.infer<typeof errorLogSchema>;
|
|
384
|
+
export type AccessLogResponse = z.infer<typeof accessLogResponseSchema>;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache statistics for a cache type.
|
|
3
|
+
*/
|
|
4
|
+
export type CacheStats = {
|
|
5
|
+
hits: number;
|
|
6
|
+
misses: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Cache information for a specific cache type.
|
|
10
|
+
*/
|
|
11
|
+
export type CacheInfo = {
|
|
12
|
+
size: number;
|
|
13
|
+
stats: CacheStats;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Cache data for a connection pool.
|
|
17
|
+
*/
|
|
18
|
+
export type CacheData = {
|
|
19
|
+
poolName: string;
|
|
20
|
+
procedureNameCache: CacheInfo;
|
|
21
|
+
argumentCache: CacheInfo;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Pool statistics.
|
|
25
|
+
*/
|
|
26
|
+
export type PoolStats = {
|
|
27
|
+
totalRequests: number;
|
|
28
|
+
totalTimeouts: number;
|
|
29
|
+
totalRequestsEnqueued: number | undefined;
|
|
30
|
+
totalRequestsDequeued: number | undefined;
|
|
31
|
+
totalRequestsFailed: number | undefined;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Pool information.
|
|
35
|
+
*/
|
|
36
|
+
export type PoolInfo = {
|
|
37
|
+
name: string;
|
|
38
|
+
connectionsInUse: number;
|
|
39
|
+
connectionsOpen: number;
|
|
40
|
+
stats: PoolStats | null;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Server metrics.
|
|
44
|
+
*/
|
|
45
|
+
export type Metrics = {
|
|
46
|
+
requestCount: number;
|
|
47
|
+
errorCount: number;
|
|
48
|
+
avgResponseTime: number;
|
|
49
|
+
minResponseTime: number;
|
|
50
|
+
maxResponseTime: number;
|
|
51
|
+
maxRequestsPerSecond: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Server configuration - route.
|
|
55
|
+
*/
|
|
56
|
+
export type RouteConfig = {
|
|
57
|
+
route: string;
|
|
58
|
+
user?: string;
|
|
59
|
+
password?: string;
|
|
60
|
+
connectString?: string;
|
|
61
|
+
defaultPage?: string;
|
|
62
|
+
pathAlias?: string;
|
|
63
|
+
pathAliasProcedure?: string;
|
|
64
|
+
documentTable?: string;
|
|
65
|
+
exclusionList?: string[];
|
|
66
|
+
requestValidationFunction?: string;
|
|
67
|
+
transactionMode?: unknown;
|
|
68
|
+
errorStyle?: string;
|
|
69
|
+
directoryPath?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Server configuration.
|
|
73
|
+
*/
|
|
74
|
+
export type ServerConfig = {
|
|
75
|
+
port: number;
|
|
76
|
+
adminRoute?: string;
|
|
77
|
+
adminUser?: string;
|
|
78
|
+
adminPassword?: string;
|
|
79
|
+
loggerFilename: string;
|
|
80
|
+
uploadFileSizeLimit?: number;
|
|
81
|
+
routePlSql: RouteConfig[];
|
|
82
|
+
routeStatic: RouteConfig[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Server status response.
|
|
86
|
+
*/
|
|
87
|
+
export type Status = {
|
|
88
|
+
version: string;
|
|
89
|
+
status: 'running' | 'paused' | 'stopped';
|
|
90
|
+
uptime: number;
|
|
91
|
+
startTime: string;
|
|
92
|
+
intervalMs?: number;
|
|
93
|
+
metrics: Metrics;
|
|
94
|
+
pools: PoolInfo[];
|
|
95
|
+
config: Partial<ServerConfig>;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Resident Set Size - total memory used by the process
|
|
99
|
+
*/
|
|
100
|
+
export type HistoryBucket = {
|
|
101
|
+
timestamp: number;
|
|
102
|
+
requests: number;
|
|
103
|
+
errors: number;
|
|
104
|
+
durationMin: number;
|
|
105
|
+
durationMax: number;
|
|
106
|
+
durationAvg: number;
|
|
107
|
+
durationP95: number;
|
|
108
|
+
durationP99: number;
|
|
109
|
+
system: {
|
|
110
|
+
cpu: number;
|
|
111
|
+
heapUsed: number;
|
|
112
|
+
heapTotal: number;
|
|
113
|
+
rss: number;
|
|
114
|
+
external: number;
|
|
115
|
+
};
|
|
116
|
+
pools: {
|
|
117
|
+
name: string;
|
|
118
|
+
connectionsInUse: number;
|
|
119
|
+
connectionsOpen: number;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Historical data for charts.
|
|
124
|
+
*/
|
|
125
|
+
export type HistoryData = {
|
|
126
|
+
labels: string[];
|
|
127
|
+
requests: number[];
|
|
128
|
+
avgResponseTimes: number[];
|
|
129
|
+
p95ResponseTimes?: number[];
|
|
130
|
+
p99ResponseTimes?: number[];
|
|
131
|
+
poolUsage: Record<string, number[]>;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Chart grid options.
|
|
135
|
+
*/
|
|
136
|
+
export type ChartGridOptions = {
|
|
137
|
+
color?: string;
|
|
138
|
+
display?: boolean;
|
|
139
|
+
drawBorder?: boolean;
|
|
140
|
+
drawOnChartArea?: boolean;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Chart ticks options.
|
|
144
|
+
*/
|
|
145
|
+
export type ChartTicksOptions = {
|
|
146
|
+
color?: string;
|
|
147
|
+
display?: boolean;
|
|
148
|
+
stepSize?: number;
|
|
149
|
+
maxRotation?: number;
|
|
150
|
+
autoSkip?: boolean;
|
|
151
|
+
maxTicksLimit?: number;
|
|
152
|
+
callback?: (value: number | string) => string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Chart scale options.
|
|
156
|
+
*/
|
|
157
|
+
export type ChartScaleOptions = {
|
|
158
|
+
display?: boolean;
|
|
159
|
+
grid?: ChartGridOptions;
|
|
160
|
+
ticks?: ChartTicksOptions;
|
|
161
|
+
border?: {
|
|
162
|
+
display?: boolean;
|
|
163
|
+
color?: string;
|
|
164
|
+
};
|
|
165
|
+
title?: {
|
|
166
|
+
display: boolean;
|
|
167
|
+
text: string;
|
|
168
|
+
color: string;
|
|
169
|
+
};
|
|
170
|
+
type?: string;
|
|
171
|
+
position?: string;
|
|
172
|
+
beginAtZero?: boolean;
|
|
173
|
+
max?: number;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Chart options.
|
|
177
|
+
*/
|
|
178
|
+
export type ChartOptions = {
|
|
179
|
+
responsive?: boolean;
|
|
180
|
+
maintainAspectRatio?: boolean;
|
|
181
|
+
scales?: {
|
|
182
|
+
x?: ChartScaleOptions;
|
|
183
|
+
y?: ChartScaleOptions;
|
|
184
|
+
y1?: ChartScaleOptions;
|
|
185
|
+
};
|
|
186
|
+
layout?: {
|
|
187
|
+
padding?: number;
|
|
188
|
+
};
|
|
189
|
+
plugins?: {
|
|
190
|
+
legend?: {
|
|
191
|
+
display?: boolean;
|
|
192
|
+
labels?: {
|
|
193
|
+
color?: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
tooltip?: {
|
|
197
|
+
enabled?: boolean;
|
|
198
|
+
position?: string;
|
|
199
|
+
intersect?: boolean;
|
|
200
|
+
callbacks?: Record<string, unknown>;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
elements?: {
|
|
204
|
+
point?: {
|
|
205
|
+
radius?: number;
|
|
206
|
+
};
|
|
207
|
+
line?: {
|
|
208
|
+
borderWidth?: number;
|
|
209
|
+
};
|
|
210
|
+
bar?: {
|
|
211
|
+
borderWidth?: number;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Chart dataset.
|
|
217
|
+
*/
|
|
218
|
+
export type ChartDataset = {
|
|
219
|
+
label: string;
|
|
220
|
+
data: number[];
|
|
221
|
+
borderColor: string;
|
|
222
|
+
backgroundColor: string | undefined;
|
|
223
|
+
fill?: boolean | undefined;
|
|
224
|
+
tension?: number | undefined;
|
|
225
|
+
barThickness?: number;
|
|
226
|
+
categoryPercentage?: number;
|
|
227
|
+
barPercentage?: number;
|
|
228
|
+
borderWidth?: number;
|
|
229
|
+
yAxisID?: string;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Chart data.
|
|
233
|
+
*/
|
|
234
|
+
export type ChartData = {
|
|
235
|
+
labels: string[];
|
|
236
|
+
datasets: ChartDataset[];
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Chart instance interface.
|
|
240
|
+
*/
|
|
241
|
+
export type ChartInstance = {
|
|
242
|
+
data: ChartData;
|
|
243
|
+
options: ChartOptions;
|
|
244
|
+
update: () => void;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Trace entry.
|
|
248
|
+
*/
|
|
249
|
+
export type TraceEntry = {
|
|
250
|
+
id: string;
|
|
251
|
+
timestamp: string;
|
|
252
|
+
source: string;
|
|
253
|
+
url: string;
|
|
254
|
+
method: string;
|
|
255
|
+
status: string;
|
|
256
|
+
duration: number;
|
|
257
|
+
procedure?: string | undefined;
|
|
258
|
+
parameters?: Record<string, unknown> | undefined;
|
|
259
|
+
uploads?: {
|
|
260
|
+
originalname: string;
|
|
261
|
+
mimetype: string;
|
|
262
|
+
size: number;
|
|
263
|
+
}[] | undefined;
|
|
264
|
+
downloads?: {
|
|
265
|
+
fileType: string;
|
|
266
|
+
fileSize: number;
|
|
267
|
+
} | undefined;
|
|
268
|
+
html?: string | undefined;
|
|
269
|
+
cookies?: Record<string, string> | undefined;
|
|
270
|
+
headers?: Record<string, string> | undefined;
|
|
271
|
+
cgi?: Record<string, string> | undefined;
|
|
272
|
+
error?: string | undefined;
|
|
273
|
+
};
|
|
274
|
+
import type { StatusResponse, ErrorLogResponse, AccessLogResponse } from './schemas.js';
|
|
275
|
+
export type { StatusResponse, ErrorLogResponse, AccessLogResponse };
|
|
276
|
+
/**
|
|
277
|
+
* System metrics for tracking min/max.
|
|
278
|
+
*/
|
|
279
|
+
export type SystemMetrics = {
|
|
280
|
+
heapUsed: number;
|
|
281
|
+
heapTotal: number;
|
|
282
|
+
rss: number;
|
|
283
|
+
external: number;
|
|
284
|
+
cpuUser: number;
|
|
285
|
+
cpuSystem: number;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Application state.
|
|
289
|
+
*/
|
|
290
|
+
export type State = {
|
|
291
|
+
currentView: string;
|
|
292
|
+
status: Partial<StatusResponse>;
|
|
293
|
+
maxHistoryPoints: number;
|
|
294
|
+
lastRequestCount: number;
|
|
295
|
+
lastErrorCount: number;
|
|
296
|
+
lastUpdateTime: number;
|
|
297
|
+
lastBucketTimestamp: number;
|
|
298
|
+
nextRefreshTimeout: ReturnType<typeof setTimeout> | null;
|
|
299
|
+
nextRefreshTime: number;
|
|
300
|
+
countdownInterval: ReturnType<typeof setInterval> | null;
|
|
301
|
+
history: HistoryData & {
|
|
302
|
+
cpuUsage: number[];
|
|
303
|
+
memoryUsage: number[];
|
|
304
|
+
};
|
|
305
|
+
charts: Record<string, ChartInstance>;
|
|
306
|
+
metricsMin: Partial<SystemMetrics>;
|
|
307
|
+
metricsMax: Partial<SystemMetrics>;
|
|
308
|
+
};
|
|
309
|
+
declare global {
|
|
310
|
+
/** Injected by Vite during build */
|
|
311
|
+
const __BUILD_TIME__: string;
|
|
312
|
+
}
|