web_plsql 1.0.0 → 1.3.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 +108 -13
- package/dist/chunk-DQk6qfdC.mjs +18 -0
- package/dist/frontend/assets/main-0oxRTIkL.js +147 -0
- package/dist/frontend/assets/main-0oxRTIkL.js.br +0 -0
- package/dist/frontend/assets/main-0oxRTIkL.js.gz +0 -0
- package/dist/frontend/assets/main-TYgLak6O.css +1 -0
- package/dist/frontend/assets/main-TYgLak6O.css.br +0 -0
- package/dist/frontend/assets/main-TYgLak6O.css.gz +0 -0
- package/dist/frontend/index.html +516 -0
- package/dist/frontend/index.html.br +0 -0
- package/dist/frontend/index.html.gz +0 -0
- package/dist/index.d.mts +646 -0
- package/dist/index.mjs +3548 -0
- package/dist/index.mjs.map +1 -0
- package/dist/oracledb-mock-Dn8aHtd7.mjs +68 -0
- package/dist/oracledb-mock-Dn8aHtd7.mjs.map +1 -0
- package/examples/config-apex.js +1 -1
- package/examples/config-docker.js +1 -2
- package/package.json +45 -32
- package/examples/config-native.js +0 -68
- package/src/admin/client/charts.ts +0 -299
- package/src/admin/client/main.js +0 -3
- package/src/admin/client/tailwind.css +0 -41
- package/src/admin/index.html +0 -315
- package/src/admin/js/api.ts +0 -95
- package/src/admin/js/app.ts +0 -306
- package/src/admin/js/eslint.config.js +0 -74
- package/src/admin/js/schemas.ts +0 -153
- package/src/admin/js/templates/config.ts +0 -146
- package/src/admin/js/templates/errorRow.ts +0 -18
- package/src/admin/js/templates/index.ts +0 -3
- package/src/admin/js/templates/poolCard.ts +0 -61
- package/src/admin/js/tsconfig.json +0 -24
- package/src/admin/js/types.ts +0 -223
- package/src/admin/js/ui/theme.ts +0 -93
- package/src/admin/js/ui/views.ts +0 -164
- package/src/admin/js/util/format.ts +0 -27
- package/src/admin/lib/assets/main-zpdhQ1gD.css +0 -1
- package/src/admin/lib/chart.bundle.js +0 -139
- package/src/admin/style.css +0 -1321
- package/src/bin/load-test.js +0 -202
- package/src/handler/handlerAdmin.js +0 -198
- package/src/handler/handlerLogger.js +0 -21
- package/src/handler/handlerMetrics.js +0 -68
- package/src/handler/handlerUpload.js +0 -26
- package/src/handler/plsql/cgi.js +0 -131
- package/src/handler/plsql/errorPage.js +0 -117
- package/src/handler/plsql/handlerPlSql.js +0 -90
- package/src/handler/plsql/parsePage.js +0 -213
- package/src/handler/plsql/procedure.js +0 -356
- package/src/handler/plsql/procedureError.js +0 -40
- package/src/handler/plsql/procedureNamed.js +0 -268
- package/src/handler/plsql/procedureSanitize.js +0 -262
- package/src/handler/plsql/procedureVariable.js +0 -54
- package/src/handler/plsql/request.js +0 -124
- package/src/handler/plsql/requestError.js +0 -23
- package/src/handler/plsql/sendResponse.js +0 -136
- package/src/handler/plsql/stream.js +0 -28
- package/src/handler/plsql/upload.js +0 -109
- package/src/index.js +0 -20
- package/src/server/config.js +0 -57
- package/src/server/connections.js +0 -40
- package/src/server/server.js +0 -289
- package/src/types.js +0 -150
- package/src/util/cache.js +0 -123
- package/src/util/errorToString.js +0 -24
- package/src/util/file.js +0 -91
- package/src/util/html.js +0 -53
- package/src/util/jsonLogger.js +0 -47
- package/src/util/oracle.js +0 -80
- package/src/util/shutdown.js +0 -44
- package/src/util/trace.js +0 -325
- package/src/util/type.js +0 -6
- package/src/util/util.js +0 -66
- package/src/version.js +0 -5
- package/types/handler/handlerAdmin.d.ts +0 -9
- package/types/handler/handlerLogger.d.ts +0 -2
- package/types/handler/handlerMetrics.d.ts +0 -25
- package/types/handler/handlerUpload.d.ts +0 -7
- package/types/handler/plsql/cgi.d.ts +0 -4
- package/types/handler/plsql/errorPage.d.ts +0 -11
- package/types/handler/plsql/handlerPlSql.d.ts +0 -13
- package/types/handler/plsql/parsePage.d.ts +0 -3
- package/types/handler/plsql/procedure.d.ts +0 -12
- package/types/handler/plsql/procedureError.d.ts +0 -23
- package/types/handler/plsql/procedureNamed.d.ts +0 -14
- package/types/handler/plsql/procedureSanitize.d.ts +0 -11
- package/types/handler/plsql/procedureVariable.d.ts +0 -10
- package/types/handler/plsql/request.d.ts +0 -9
- package/types/handler/plsql/requestError.d.ts +0 -8
- package/types/handler/plsql/sendResponse.d.ts +0 -6
- package/types/handler/plsql/upload.d.ts +0 -5
- package/types/index.d.ts +0 -11
- package/types/server/config.d.ts +0 -2
- package/types/server/server.d.ts +0 -74
- package/types/types.d.ts +0 -328
- package/types/util/cache.d.ts +0 -69
- package/types/util/errorToString.d.ts +0 -1
- package/types/util/file.d.ts +0 -6
- package/types/util/html.d.ts +0 -3
- package/types/util/jsonLogger.d.ts +0 -45
- package/types/util/oracle.d.ts +0 -5
- package/types/util/shutdown.d.ts +0 -2
- package/types/util/trace.d.ts +0 -22
- package/types/util/type.d.ts +0 -1
- package/types/util/util.d.ts +0 -3
- package/types/version.d.ts +0 -1
- /package/{src/admin/favicon.svg → dist/frontend/assets/favicon-mQAM4tVu.svg} +0 -0
package/types/server/server.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export namespace AdminContext {
|
|
2
|
-
let startTime: Date;
|
|
3
|
-
let config: configType | null;
|
|
4
|
-
let pools: Pool[];
|
|
5
|
-
let caches: Array<{
|
|
6
|
-
poolName: string;
|
|
7
|
-
procedureNameCache: Cache<string>;
|
|
8
|
-
argumentCache: Cache<argsType>;
|
|
9
|
-
}>;
|
|
10
|
-
let paused: boolean;
|
|
11
|
-
namespace metrics {
|
|
12
|
-
let requestCount: number;
|
|
13
|
-
let errorCount: number;
|
|
14
|
-
let totalDuration: number;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function createServer(app: Express, ssl?: sslConfig): http.Server | https.Server;
|
|
18
|
-
export function startServer(config: configType, ssl?: sslConfig): Promise<webServer>;
|
|
19
|
-
export function loadConfig(filename?: string): configType;
|
|
20
|
-
export function startServerConfig(filename?: string, ssl?: sslConfig): Promise<webServer>;
|
|
21
|
-
export type Socket = import("node:net").Socket;
|
|
22
|
-
export type Express = import("express").Express;
|
|
23
|
-
export type Request = import("express").Request;
|
|
24
|
-
export type Response = import("express").Response;
|
|
25
|
-
export type NextFunction = import("express").NextFunction;
|
|
26
|
-
export type Pool = import("oracledb").Pool;
|
|
27
|
-
export type environmentType = import("../types.js").environmentType;
|
|
28
|
-
export type configType = import("../types.js").configType;
|
|
29
|
-
export type argsType = import("../handler/plsql/procedureNamed.js").argsType;
|
|
30
|
-
export type ExtendedRequestHandler = import("express").RequestHandler & {
|
|
31
|
-
procedureNameCache: Cache<string>;
|
|
32
|
-
argumentCache: Cache<argsType>;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* - Web server interface.
|
|
36
|
-
*/
|
|
37
|
-
export type webServer = {
|
|
38
|
-
/**
|
|
39
|
-
* - Configuration object.
|
|
40
|
-
*/
|
|
41
|
-
config: configType;
|
|
42
|
-
/**
|
|
43
|
-
* - Oracle connection pools.
|
|
44
|
-
*/
|
|
45
|
-
connectionPools: Pool[];
|
|
46
|
-
/**
|
|
47
|
-
* - Express app.
|
|
48
|
-
*/
|
|
49
|
-
app: Express;
|
|
50
|
-
/**
|
|
51
|
-
* - Native Node http(s) server instance.
|
|
52
|
-
*/
|
|
53
|
-
server: http.Server | https.Server;
|
|
54
|
-
/**
|
|
55
|
-
* - Shutdown function.
|
|
56
|
-
*/
|
|
57
|
-
shutdown: () => Promise<void>;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* - SSL configuration.
|
|
61
|
-
*/
|
|
62
|
-
export type sslConfig = {
|
|
63
|
-
/**
|
|
64
|
-
* - key filename.
|
|
65
|
-
*/
|
|
66
|
-
keyFilename: string;
|
|
67
|
-
/**
|
|
68
|
-
* - cert filename.
|
|
69
|
-
*/
|
|
70
|
-
certFilename: string;
|
|
71
|
-
};
|
|
72
|
-
import { Cache } from '../util/cache.js';
|
|
73
|
-
import http from 'node:http';
|
|
74
|
-
import https from 'node:https';
|
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;
|
|
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';
|
package/types/util/cache.d.ts
DELETED
|
@@ -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;
|
package/types/util/file.d.ts
DELETED
|
@@ -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>;
|
package/types/util/html.d.ts
DELETED
|
@@ -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';
|
package/types/util/oracle.d.ts
DELETED
|
@@ -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;
|
package/types/util/shutdown.d.ts
DELETED
package/types/util/trace.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function inspect(value: unknown, depth?: number | null): string;
|
|
2
|
-
export function toTable(head: string[], body: string[][]): outputType;
|
|
3
|
-
export function logToFile(text: string): void;
|
|
4
|
-
export function getBlock(title: string, body: string): string;
|
|
5
|
-
export function getFormattedMessage(para: messageType): outputType;
|
|
6
|
-
export function warningMessage(para: messageType): void;
|
|
7
|
-
export type Request = import("express").Request;
|
|
8
|
-
export type BindParameterConfig = import("../types.js").BindParameterConfig;
|
|
9
|
-
export type environmentType = import("../types.js").environmentType;
|
|
10
|
-
export type outputType = {
|
|
11
|
-
html: string;
|
|
12
|
-
text: string;
|
|
13
|
-
};
|
|
14
|
-
export type messageType = {
|
|
15
|
-
type: "error" | "warning" | "trace";
|
|
16
|
-
message: string;
|
|
17
|
-
timestamp?: Date | null;
|
|
18
|
-
req?: Request | null;
|
|
19
|
-
environment?: environmentType | null;
|
|
20
|
-
sql?: string | null;
|
|
21
|
-
bind?: BindParameterConfig | null;
|
|
22
|
-
};
|
package/types/util/type.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function isStringOrArrayOfString(value: unknown): value is string | string[];
|
package/types/util/util.d.ts
DELETED
package/types/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getVersion(): string;
|
|
File without changes
|