web_plsql 1.2.0 → 1.3.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.
Files changed (119) hide show
  1. package/README.md +103 -8
  2. package/dist/chunk-DQk6qfdC.mjs +18 -0
  3. package/dist/frontend/assets/main-C8GKnEhz.js +147 -0
  4. package/dist/frontend/assets/main-C8GKnEhz.js.br +0 -0
  5. package/dist/frontend/assets/main-C8GKnEhz.js.gz +0 -0
  6. package/dist/frontend/assets/main-bU4x_yEW.css +1 -0
  7. package/dist/frontend/assets/main-bU4x_yEW.css.br +0 -0
  8. package/dist/frontend/assets/main-bU4x_yEW.css.gz +0 -0
  9. package/{src/admin → dist/frontend}/index.html +12 -25
  10. package/dist/frontend/index.html.br +0 -0
  11. package/dist/frontend/index.html.gz +0 -0
  12. package/dist/index.d.mts +646 -0
  13. package/dist/index.mjs +3559 -0
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/oracledb-mock-Dn8aHtd7.mjs +68 -0
  16. package/dist/oracledb-mock-Dn8aHtd7.mjs.map +1 -0
  17. package/examples/config-apex.js +1 -1
  18. package/examples/config-docker.js +1 -2
  19. package/package.json +48 -32
  20. package/examples/config-native.js +0 -68
  21. package/src/admin/client/charts.ts +0 -598
  22. package/src/admin/client/main.js +0 -3
  23. package/src/admin/client/tailwind.css +0 -41
  24. package/src/admin/js/api.ts +0 -170
  25. package/src/admin/js/app.ts +0 -614
  26. package/src/admin/js/eslint.config.js +0 -74
  27. package/src/admin/js/schemas.ts +0 -215
  28. package/src/admin/js/templates/config.ts +0 -147
  29. package/src/admin/js/templates/errorRow.ts +0 -21
  30. package/src/admin/js/templates/index.ts +0 -4
  31. package/src/admin/js/templates/poolCard.ts +0 -61
  32. package/src/admin/js/templates/traceRow.ts +0 -24
  33. package/src/admin/js/tsconfig.json +0 -24
  34. package/src/admin/js/types.ts +0 -336
  35. package/src/admin/js/ui/components.ts +0 -44
  36. package/src/admin/js/ui/table.ts +0 -173
  37. package/src/admin/js/ui/theme.ts +0 -93
  38. package/src/admin/js/ui/views.ts +0 -427
  39. package/src/admin/js/util/format.ts +0 -46
  40. package/src/admin/js/util/metrics.ts +0 -24
  41. package/src/admin/lib/chart.bundle.css +0 -1
  42. package/src/admin/lib/chart.bundle.js +0 -146
  43. package/src/admin/style.css +0 -1437
  44. package/src/bin/load-test.js +0 -202
  45. package/src/handler/handlerAdmin.js +0 -293
  46. package/src/handler/handlerLogger.js +0 -21
  47. package/src/handler/handlerUpload.js +0 -26
  48. package/src/handler/plsql/cgi.js +0 -131
  49. package/src/handler/plsql/errorPage.js +0 -113
  50. package/src/handler/plsql/handlerPlSql.js +0 -90
  51. package/src/handler/plsql/owaPageStream.js +0 -93
  52. package/src/handler/plsql/parsePage.js +0 -213
  53. package/src/handler/plsql/procedure.js +0 -426
  54. package/src/handler/plsql/procedureError.js +0 -40
  55. package/src/handler/plsql/procedureNamed.js +0 -282
  56. package/src/handler/plsql/procedureSanitize.js +0 -286
  57. package/src/handler/plsql/procedureVariable.js +0 -56
  58. package/src/handler/plsql/request.js +0 -124
  59. package/src/handler/plsql/requestError.js +0 -23
  60. package/src/handler/plsql/sendResponse.js +0 -174
  61. package/src/handler/plsql/stream.js +0 -28
  62. package/src/handler/plsql/upload.js +0 -109
  63. package/src/index.js +0 -19
  64. package/src/server/adminContext.js +0 -23
  65. package/src/server/config.js +0 -57
  66. package/src/server/connections.js +0 -40
  67. package/src/server/server.js +0 -304
  68. package/src/types.js +0 -150
  69. package/src/util/cache.js +0 -123
  70. package/src/util/errorToString.js +0 -24
  71. package/src/util/file.js +0 -91
  72. package/src/util/html.js +0 -53
  73. package/src/util/jsonLogger.js +0 -47
  74. package/src/util/oracle.js +0 -80
  75. package/src/util/shutdown.js +0 -44
  76. package/src/util/statsManager.js +0 -368
  77. package/src/util/trace.js +0 -326
  78. package/src/util/traceManager.js +0 -68
  79. package/src/util/type.js +0 -6
  80. package/src/util/util.js +0 -66
  81. package/src/version.js +0 -5
  82. package/types/admin/js/schemas.d.ts +0 -384
  83. package/types/admin/js/types.d.ts +0 -312
  84. package/types/handler/handlerAdmin.d.ts +0 -79
  85. package/types/handler/handlerLogger.d.ts +0 -2
  86. package/types/handler/handlerUpload.d.ts +0 -7
  87. package/types/handler/plsql/cgi.d.ts +0 -4
  88. package/types/handler/plsql/errorPage.d.ts +0 -11
  89. package/types/handler/plsql/handlerPlSql.d.ts +0 -13
  90. package/types/handler/plsql/owaPageStream.d.ts +0 -28
  91. package/types/handler/plsql/parsePage.d.ts +0 -3
  92. package/types/handler/plsql/procedure.d.ts +0 -13
  93. package/types/handler/plsql/procedureError.d.ts +0 -23
  94. package/types/handler/plsql/procedureNamed.d.ts +0 -14
  95. package/types/handler/plsql/procedureSanitize.d.ts +0 -11
  96. package/types/handler/plsql/procedureVariable.d.ts +0 -10
  97. package/types/handler/plsql/request.d.ts +0 -9
  98. package/types/handler/plsql/requestError.d.ts +0 -8
  99. package/types/handler/plsql/sendResponse.d.ts +0 -6
  100. package/types/handler/plsql/upload.d.ts +0 -5
  101. package/types/index.d.ts +0 -10
  102. package/types/server/adminContext.d.ts +0 -17
  103. package/types/server/config.d.ts +0 -2
  104. package/types/server/server.d.ts +0 -57
  105. package/types/types.d.ts +0 -328
  106. package/types/util/cache.d.ts +0 -69
  107. package/types/util/errorToString.d.ts +0 -1
  108. package/types/util/file.d.ts +0 -6
  109. package/types/util/html.d.ts +0 -3
  110. package/types/util/jsonLogger.d.ts +0 -45
  111. package/types/util/oracle.d.ts +0 -5
  112. package/types/util/shutdown.d.ts +0 -2
  113. package/types/util/statsManager.d.ts +0 -395
  114. package/types/util/trace.d.ts +0 -22
  115. package/types/util/traceManager.d.ts +0 -35
  116. package/types/util/type.d.ts +0 -1
  117. package/types/util/util.d.ts +0 -3
  118. package/types/version.d.ts +0 -1
  119. /package/{src/admin/favicon.svg → dist/frontend/assets/favicon-mQAM4tVu.svg} +0 -0
package/types/types.d.ts DELETED
@@ -1,328 +0,0 @@
1
- /**
2
- * @typedef {import('oracledb').BindParameter} BindParameter
3
- * @typedef {import('oracledb').Connection} Connection
4
- * @typedef {import('express').CookieOptions} CookieOptions
5
- * @typedef {import('express').Request} Request
6
- */
7
- /**
8
- * @typedef {'basic' | 'debug'} errorStyleType
9
- */
10
- export const z$errorStyleType: z.ZodEnum<{
11
- basic: "basic";
12
- debug: "debug";
13
- }>;
14
- /**
15
- * @typedef {object} configStaticType
16
- * @property {string} route - The Static route path.
17
- * @property {string} directoryPath - The Static directory.
18
- */
19
- export const z$configStaticType: z.ZodObject<{
20
- route: z.ZodString;
21
- directoryPath: z.ZodString;
22
- }, z.core.$strict>;
23
- /**
24
- * @typedef {(connection: Connection, procedure: string) => void | Promise<void>} transactionCallbackType
25
- * @typedef {'commit' | 'rollback' | transactionCallbackType | undefined | null} transactionModeType
26
- */
27
- /**
28
- * @typedef {object} configPlSqlHandlerType
29
- * @property {string} defaultPage - The default page.
30
- * @property {string} [pathAlias] - The path alias.
31
- * @property {string} [pathAliasProcedure] - The path alias.
32
- * @property {string} documentTable - The document table.
33
- * @property {string[]} [exclusionList] - The exclusion list.
34
- * @property {string} [requestValidationFunction] - The request validation function.
35
- * @property {Record<string, string>} [cgi] - The additional CGI.
36
- * @property {transactionModeType} [transactionMode] - Specifies an optional transaction mode.
37
- * "commit" this automatically commits any open transaction after each request. This is the defaults because this is what mod_plsql and ohs are doing.
38
- * "rollback" this automatically rolles back any open transaction after each request.
39
- * "transactionCallbackType" this allows to defined a custom handler as a JavaScript function.
40
- * @property {errorStyleType} errorStyle - The error style.
41
- */
42
- export const z$configPlSqlHandlerType: z.ZodObject<{
43
- defaultPage: z.ZodString;
44
- pathAlias: z.ZodOptional<z.ZodString>;
45
- pathAliasProcedure: z.ZodOptional<z.ZodString>;
46
- documentTable: z.ZodString;
47
- exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
- requestValidationFunction: z.ZodOptional<z.ZodString>;
49
- transactionMode: z.ZodOptional<z.ZodUnknown>;
50
- errorStyle: z.ZodEnum<{
51
- basic: "basic";
52
- debug: "debug";
53
- }>;
54
- }, z.core.$strict>;
55
- /**
56
- * @typedef {object} configPlSqlConfigType
57
- * @property {string} route - The PL/SQL route path.
58
- * @property {string} user - The Oracle username.
59
- * @property {string} password - The Oracle password.
60
- * @property {string} connectString - The Oracle connect string.
61
- */
62
- export const z$configPlSqlConfigType: z.ZodObject<{
63
- route: z.ZodString;
64
- user: z.ZodString;
65
- password: z.ZodString;
66
- connectString: z.ZodString;
67
- }, z.core.$strict>;
68
- /**
69
- * @typedef {configPlSqlHandlerType & configPlSqlConfigType} configPlSqlType
70
- */
71
- export const z$configPlSqlType: z.ZodObject<{
72
- route: z.ZodString;
73
- user: z.ZodString;
74
- password: z.ZodString;
75
- connectString: z.ZodString;
76
- defaultPage: z.ZodString;
77
- pathAlias: z.ZodOptional<z.ZodString>;
78
- pathAliasProcedure: z.ZodOptional<z.ZodString>;
79
- documentTable: z.ZodString;
80
- exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
- requestValidationFunction: z.ZodOptional<z.ZodString>;
82
- transactionMode: z.ZodOptional<z.ZodUnknown>;
83
- errorStyle: z.ZodEnum<{
84
- basic: "basic";
85
- debug: "debug";
86
- }>;
87
- }, z.core.$strict>;
88
- /**
89
- * @typedef {object} configType
90
- * @property {number} port - The server port number.
91
- * @property {configStaticType[]} routeStatic - The static routes.
92
- * @property {configPlSqlType[]} routePlSql - The PL/SQL routes.
93
- * @property {number} [uploadFileSizeLimit] - Maximum size of each uploaded file in bytes or no limit if omitted.
94
- * @property {string} loggerFilename - name of the request logger filename or '' if not required.
95
- * @property {string} [adminRoute] - Optional route for the admin console (defaults to /admin).
96
- * @property {string} [adminUser] - Optional username for admin console basic auth.
97
- * @property {string} [adminPassword] - Optional password for admin console basic auth.
98
- */
99
- export const z$configType: z.ZodObject<{
100
- port: z.ZodNumber;
101
- routeStatic: z.ZodArray<z.ZodObject<{
102
- route: z.ZodString;
103
- directoryPath: z.ZodString;
104
- }, z.core.$strict>>;
105
- routePlSql: z.ZodArray<z.ZodObject<{
106
- route: z.ZodString;
107
- user: z.ZodString;
108
- password: z.ZodString;
109
- connectString: z.ZodString;
110
- defaultPage: z.ZodString;
111
- pathAlias: z.ZodOptional<z.ZodString>;
112
- pathAliasProcedure: z.ZodOptional<z.ZodString>;
113
- documentTable: z.ZodString;
114
- exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
115
- requestValidationFunction: z.ZodOptional<z.ZodString>;
116
- transactionMode: z.ZodOptional<z.ZodUnknown>;
117
- errorStyle: z.ZodEnum<{
118
- basic: "basic";
119
- debug: "debug";
120
- }>;
121
- }, z.core.$strict>>;
122
- uploadFileSizeLimit: z.ZodOptional<z.ZodNumber>;
123
- loggerFilename: z.ZodString;
124
- adminRoute: z.ZodOptional<z.ZodString>;
125
- adminUser: z.ZodOptional<z.ZodString>;
126
- adminPassword: z.ZodOptional<z.ZodString>;
127
- }, z.core.$strict>;
128
- export type BindParameter = import("oracledb").BindParameter;
129
- export type Connection = import("oracledb").Connection;
130
- export type CookieOptions = import("express").CookieOptions;
131
- export type Request = import("express").Request;
132
- export type errorStyleType = "basic" | "debug";
133
- export type configStaticType = {
134
- /**
135
- * - The Static route path.
136
- */
137
- route: string;
138
- /**
139
- * - The Static directory.
140
- */
141
- directoryPath: string;
142
- };
143
- export type transactionCallbackType = (connection: Connection, procedure: string) => void | Promise<void>;
144
- export type transactionModeType = "commit" | "rollback" | transactionCallbackType | undefined | null;
145
- export type configPlSqlHandlerType = {
146
- /**
147
- * - The default page.
148
- */
149
- defaultPage: string;
150
- /**
151
- * - The path alias.
152
- */
153
- pathAlias?: string;
154
- /**
155
- * - The path alias.
156
- */
157
- pathAliasProcedure?: string;
158
- /**
159
- * - The document table.
160
- */
161
- documentTable: string;
162
- /**
163
- * - The exclusion list.
164
- */
165
- exclusionList?: string[];
166
- /**
167
- * - The request validation function.
168
- */
169
- requestValidationFunction?: string;
170
- /**
171
- * - The additional CGI.
172
- */
173
- cgi?: Record<string, string>;
174
- /**
175
- * - Specifies an optional transaction mode.
176
- * "commit" this automatically commits any open transaction after each request. This is the defaults because this is what mod_plsql and ohs are doing.
177
- * "rollback" this automatically rolles back any open transaction after each request.
178
- * "transactionCallbackType" this allows to defined a custom handler as a JavaScript function.
179
- */
180
- transactionMode?: transactionModeType;
181
- /**
182
- * - The error style.
183
- */
184
- errorStyle: errorStyleType;
185
- };
186
- export type configPlSqlConfigType = {
187
- /**
188
- * - The PL/SQL route path.
189
- */
190
- route: string;
191
- /**
192
- * - The Oracle username.
193
- */
194
- user: string;
195
- /**
196
- * - The Oracle password.
197
- */
198
- password: string;
199
- /**
200
- * - The Oracle connect string.
201
- */
202
- connectString: string;
203
- };
204
- export type configPlSqlType = configPlSqlHandlerType & configPlSqlConfigType;
205
- export type configType = {
206
- /**
207
- * - The server port number.
208
- */
209
- port: number;
210
- /**
211
- * - The static routes.
212
- */
213
- routeStatic: configStaticType[];
214
- /**
215
- * - The PL/SQL routes.
216
- */
217
- routePlSql: configPlSqlType[];
218
- /**
219
- * - Maximum size of each uploaded file in bytes or no limit if omitted.
220
- */
221
- uploadFileSizeLimit?: number;
222
- /**
223
- * - name of the request logger filename or '' if not required.
224
- */
225
- loggerFilename: string;
226
- /**
227
- * - Optional route for the admin console (defaults to /admin).
228
- */
229
- adminRoute?: string;
230
- /**
231
- * - Optional username for admin console basic auth.
232
- */
233
- adminUser?: string;
234
- /**
235
- * - Optional password for admin console basic auth.
236
- */
237
- adminPassword?: string;
238
- };
239
- /**
240
- * Environment variables as string key-value pairs
241
- */
242
- export type environmentType = Record<string, string>;
243
- /**
244
- * Oracle database bind parameter configuration
245
- */
246
- export type BindParameterConfig = Record<string, BindParameter>;
247
- /**
248
- * Arguments object with string or string array values
249
- */
250
- export type argObjType = Record<string, string | string[]>;
251
- /**
252
- * File upload metadata
253
- */
254
- export type fileUploadType = {
255
- /**
256
- * - The field value.
257
- */
258
- fieldname: string;
259
- /**
260
- * - The filename.
261
- */
262
- originalname: string;
263
- /**
264
- * - The encoding.
265
- */
266
- encoding: string;
267
- /**
268
- * - The mimetype.
269
- */
270
- mimetype: string;
271
- /**
272
- * - The filename.
273
- */
274
- filename: string;
275
- /**
276
- * - The path.
277
- */
278
- path: string;
279
- /**
280
- * - The size.
281
- */
282
- size: number;
283
- };
284
- export type cookieType = {
285
- /**
286
- * - The name of the cookie.
287
- */
288
- name: string;
289
- /**
290
- * - The value of the cookie.
291
- */
292
- value: string;
293
- /**
294
- * - The cookie options.
295
- */
296
- options: CookieOptions;
297
- };
298
- /**
299
- * - The page.
300
- */
301
- export type pageType = {
302
- /**
303
- * - The body of the page.
304
- */
305
- body: string | import("node:stream").Readable;
306
- /**
307
- * - The head of the page.
308
- */
309
- head: {
310
- cookies: cookieType[];
311
- contentType?: string;
312
- contentLength?: number;
313
- statusCode?: number;
314
- statusDescription?: string;
315
- redirectLocation?: string;
316
- otherHeaders: Record<string, string>;
317
- server?: string;
318
- };
319
- /**
320
- * - The file.
321
- */
322
- file: {
323
- fileType: string | null;
324
- fileSize: number | null;
325
- fileBlob: import("node:stream").Readable | Buffer | null;
326
- };
327
- };
328
- import z from 'zod';
@@ -1,69 +0,0 @@
1
- /**
2
- * @template T
3
- * @typedef {{hitCount: number, value: T}} cacheEntryType
4
- */
5
- /**
6
- * Generic Cache class with LFU (Least Frequently Used) eviction policy.
7
- * @template T
8
- */
9
- export class Cache<T> {
10
- /**
11
- * @param {number} maxSize - Maximum number of entries in the cache.
12
- */
13
- constructor(maxSize?: number);
14
- /** @type {Map<string, cacheEntryType<T>>} */
15
- cache: Map<string, cacheEntryType<T>>;
16
- maxSize: number;
17
- hits: number;
18
- misses: number;
19
- /**
20
- * Get an entry from the cache.
21
- * @param {string} key - The key.
22
- * @returns {T | undefined} - The value or undefined if not found.
23
- */
24
- get(key: string): T | undefined;
25
- /**
26
- * Set an entry in the cache.
27
- * @param {string} key - The key.
28
- * @param {T} value - The value.
29
- */
30
- set(key: string, value: T): void;
31
- /**
32
- * Delete an entry from the cache.
33
- * @param {string} key - The key.
34
- */
35
- delete(key: string): void;
36
- /**
37
- * Clear the cache.
38
- */
39
- clear(): void;
40
- /**
41
- * Prune the cache by removing the least frequently used entries.
42
- * Removes 10% of the cache size.
43
- */
44
- prune(): void;
45
- /**
46
- * Get the size of the cache.
47
- * @returns {number} - The size.
48
- */
49
- get size(): number;
50
- /**
51
- * Get all keys in the cache.
52
- * @returns {string[]} - The keys.
53
- */
54
- keys(): string[];
55
- /**
56
- * Get cache statistics.
57
- * @returns {{size: number, maxSize: number, hits: number, misses: number}} - The statistics.
58
- */
59
- getStats(): {
60
- size: number;
61
- maxSize: number;
62
- hits: number;
63
- misses: number;
64
- };
65
- }
66
- export type cacheEntryType<T> = {
67
- hitCount: number;
68
- value: T;
69
- };
@@ -1 +0,0 @@
1
- export function errorToString(error: unknown): string;
@@ -1,6 +0,0 @@
1
- export function readFileSyncUtf8(filePath: string): string;
2
- export function readFile(filePath: string): Promise<Buffer>;
3
- export function removeFile(filePath: string): Promise<void>;
4
- export function getJsonFile(filePath: string): unknown;
5
- export function isDirectory(directoryPath: unknown): Promise<boolean>;
6
- export function isFile(filePath: unknown): Promise<boolean>;
@@ -1,3 +0,0 @@
1
- export function escapeHtml(value: string): string;
2
- export function convertAsciiToHtml(text: string): string;
3
- export function getHtmlPage(body: string): string;
@@ -1,45 +0,0 @@
1
- /**
2
- * @typedef {object} LogEntry
3
- * @property {string} timestamp - ISO string
4
- * @property {'error'|'info'|'warning'} type - Log level
5
- * @property {string} message - Error message
6
- * @property {object} [req] - Request details
7
- * @property {object} [details] - Additional details (stack, sql, etc)
8
- */
9
- export class JsonLogger {
10
- constructor(filename?: string);
11
- stream: rotatingFileStream.RotatingFileStream;
12
- /**
13
- * Log an entry as NDJSON.
14
- * @param {LogEntry} entry - The entry to log.
15
- */
16
- log(entry: LogEntry): void;
17
- /**
18
- * Close the stream.
19
- */
20
- close(): void;
21
- }
22
- export const jsonLogger: JsonLogger;
23
- export type LogEntry = {
24
- /**
25
- * - ISO string
26
- */
27
- timestamp: string;
28
- /**
29
- * - Log level
30
- */
31
- type: "error" | "info" | "warning";
32
- /**
33
- * - Error message
34
- */
35
- message: string;
36
- /**
37
- * - Request details
38
- */
39
- req?: object;
40
- /**
41
- * - Additional details (stack, sql, etc)
42
- */
43
- details?: object;
44
- };
45
- import * as rotatingFileStream from 'rotating-file-stream';
@@ -1,5 +0,0 @@
1
- export function connectionValid(connectionPool: Pool): Promise<boolean>;
2
- export function poolCreate(user: string, password: string, connectString: string, poolMin?: number, poolMax?: number): Promise<Pool>;
3
- export function poolClose(pool: Pool): Promise<void>;
4
- export function poolsClose(pools: Pool[]): Promise<void>;
5
- export type Pool = import("oracledb").Pool;
@@ -1,2 +0,0 @@
1
- export function installShutdown(handler: () => Promise<void>): void;
2
- export function forceShutdown(): void;