web_plsql 1.8.0 → 1.8.2
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/frontend/assets/main-CryM96vZ.js +172 -0
- package/dist/frontend/assets/main-CryM96vZ.js.br +0 -0
- package/dist/frontend/assets/main-CryM96vZ.js.gz +0 -0
- package/dist/frontend/index.html +1 -1
- package/dist/frontend/index.html.br +0 -0
- package/dist/frontend/index.html.gz +0 -0
- package/dist/index.d.mts +40 -40
- package/dist/index.mjs +47 -8
- package/dist/index.mjs.map +1 -1
- package/examples/config-apex.js +0 -0
- package/examples/config-docker.js +0 -0
- package/examples/config-docker.json +0 -0
- package/package.json +125 -124
- package/dist/frontend/assets/main-Co9Kke3j.js +0 -147
- package/dist/frontend/assets/main-Co9Kke3j.js.br +0 -0
- package/dist/frontend/assets/main-Co9Kke3j.js.gz +0 -0
|
Binary file
|
|
Binary file
|
package/dist/frontend/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>web_plsql Admin Console</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/admin/assets/favicon-mQAM4tVu.svg" />
|
|
8
8
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
|
9
|
-
<script type="module" crossorigin src="/admin/assets/main-
|
|
9
|
+
<script type="module" crossorigin src="/admin/assets/main-CryM96vZ.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/admin/assets/main-CoERzZAr.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body class="dark">
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -100,24 +100,24 @@ type CustomAuthCallback = (req: Request, connectionPool: Pool) => Promise<string
|
|
|
100
100
|
* PL/SQL handler behavior configuration
|
|
101
101
|
*/
|
|
102
102
|
declare const z$configPlSqlHandlerType: z$1.ZodObject<{
|
|
103
|
-
|
|
104
|
-
pathAlias: z$1.ZodOptional<z$1.ZodString>;
|
|
105
|
-
pathAliasProcedure: z$1.ZodOptional<z$1.ZodString>;
|
|
106
|
-
documentTable: z$1.ZodString;
|
|
107
|
-
exclusionList: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
108
|
-
requestValidationFunction: z$1.ZodOptional<z$1.ZodString>;
|
|
109
|
-
transactionMode: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodCustom<transactionCallbackType, transactionCallbackType>, z$1.ZodLiteral<"commit">, z$1.ZodLiteral<"rollback">, z$1.ZodUndefined, z$1.ZodNull]>>;
|
|
103
|
+
defaultPage: z$1.ZodString;
|
|
104
|
+
pathAlias: z$1.ZodOptional<z$1.ZodString>;
|
|
105
|
+
pathAliasProcedure: z$1.ZodOptional<z$1.ZodString>;
|
|
106
|
+
documentTable: z$1.ZodString;
|
|
107
|
+
exclusionList: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
108
|
+
requestValidationFunction: z$1.ZodOptional<z$1.ZodString>;
|
|
109
|
+
transactionMode: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodCustom<transactionCallbackType, transactionCallbackType>, z$1.ZodLiteral<"commit">, z$1.ZodLiteral<"rollback">, z$1.ZodUndefined, z$1.ZodNull]>>;
|
|
110
110
|
errorStyle: z$1.ZodEnum<{
|
|
111
111
|
basic: "basic";
|
|
112
112
|
debug: "debug";
|
|
113
|
-
}>;
|
|
114
|
-
cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
113
|
+
}>;
|
|
114
|
+
cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
115
115
|
auth: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
116
|
-
|
|
117
|
-
callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
|
|
116
|
+
type: z$1.ZodLiteral<"basic">;
|
|
117
|
+
callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
|
|
118
118
|
realm: z$1.ZodOptional<z$1.ZodString>;
|
|
119
119
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
120
|
-
|
|
120
|
+
type: z$1.ZodLiteral<"custom">;
|
|
121
121
|
callback: z$1.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
|
|
122
122
|
}, z$1.core.$strict>]>>;
|
|
123
123
|
}, z$1.core.$strict>;
|
|
@@ -126,9 +126,9 @@ type configPlSqlHandlerType = z$1.infer<typeof z$configPlSqlHandlerType>;
|
|
|
126
126
|
* Database connection configuration for a PL/SQL route
|
|
127
127
|
*/
|
|
128
128
|
declare const z$configPlSqlConfigType: z$1.ZodObject<{
|
|
129
|
-
|
|
130
|
-
user: z$1.ZodString;
|
|
131
|
-
password: z$1.ZodString;
|
|
129
|
+
route: z$1.ZodString;
|
|
130
|
+
user: z$1.ZodString;
|
|
131
|
+
password: z$1.ZodString;
|
|
132
132
|
connectString: z$1.ZodString;
|
|
133
133
|
}, z$1.core.$strict>;
|
|
134
134
|
type configPlSqlConfigType = z$1.infer<typeof z$configPlSqlConfigType>;
|
|
@@ -140,44 +140,44 @@ type configPlSqlType = configPlSqlHandlerType & configPlSqlConfigType;
|
|
|
140
140
|
* Root application configuration
|
|
141
141
|
*/
|
|
142
142
|
declare const z$configType: z$1.ZodObject<{
|
|
143
|
-
|
|
143
|
+
port: z$1.ZodNumber;
|
|
144
144
|
routeStatic: z$1.ZodArray<z$1.ZodObject<{
|
|
145
145
|
route: z$1.ZodString;
|
|
146
146
|
directoryPath: z$1.ZodString;
|
|
147
147
|
spaFallback: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
148
|
-
}, z$1.core.$strict>>;
|
|
148
|
+
}, z$1.core.$strict>>;
|
|
149
149
|
routePlSql: z$1.ZodArray<z$1.ZodObject<{
|
|
150
|
-
|
|
151
|
-
user: z$1.ZodString;
|
|
152
|
-
password: z$1.ZodString;
|
|
153
|
-
connectString: z$1.ZodString;
|
|
154
|
-
defaultPage: z$1.ZodString;
|
|
155
|
-
pathAlias: z$1.ZodOptional<z$1.ZodString>;
|
|
156
|
-
pathAliasProcedure: z$1.ZodOptional<z$1.ZodString>;
|
|
157
|
-
documentTable: z$1.ZodString;
|
|
158
|
-
exclusionList: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
159
|
-
requestValidationFunction: z$1.ZodOptional<z$1.ZodString>;
|
|
160
|
-
transactionMode: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodCustom<transactionCallbackType, transactionCallbackType>, z$1.ZodLiteral<"commit">, z$1.ZodLiteral<"rollback">, z$1.ZodUndefined, z$1.ZodNull]>>;
|
|
150
|
+
route: z$1.ZodString;
|
|
151
|
+
user: z$1.ZodString;
|
|
152
|
+
password: z$1.ZodString;
|
|
153
|
+
connectString: z$1.ZodString;
|
|
154
|
+
defaultPage: z$1.ZodString;
|
|
155
|
+
pathAlias: z$1.ZodOptional<z$1.ZodString>;
|
|
156
|
+
pathAliasProcedure: z$1.ZodOptional<z$1.ZodString>;
|
|
157
|
+
documentTable: z$1.ZodString;
|
|
158
|
+
exclusionList: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
159
|
+
requestValidationFunction: z$1.ZodOptional<z$1.ZodString>;
|
|
160
|
+
transactionMode: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodCustom<transactionCallbackType, transactionCallbackType>, z$1.ZodLiteral<"commit">, z$1.ZodLiteral<"rollback">, z$1.ZodUndefined, z$1.ZodNull]>>;
|
|
161
161
|
errorStyle: z$1.ZodEnum<{
|
|
162
162
|
basic: "basic";
|
|
163
163
|
debug: "debug";
|
|
164
|
-
}>;
|
|
165
|
-
cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
164
|
+
}>;
|
|
165
|
+
cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
166
166
|
auth: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
167
|
-
|
|
168
|
-
callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
|
|
167
|
+
type: z$1.ZodLiteral<"basic">;
|
|
168
|
+
callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
|
|
169
169
|
realm: z$1.ZodOptional<z$1.ZodString>;
|
|
170
170
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
171
|
-
|
|
171
|
+
type: z$1.ZodLiteral<"custom">;
|
|
172
172
|
callback: z$1.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
|
|
173
173
|
}, z$1.core.$strict>]>>;
|
|
174
|
-
}, z$1.core.$strict>>;
|
|
175
|
-
uploadFileSizeLimit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
176
|
-
loggerFilename: z$1.ZodString;
|
|
177
|
-
adminRoute: z$1.ZodOptional<z$1.ZodString>;
|
|
178
|
-
adminUser: z$1.ZodOptional<z$1.ZodString>;
|
|
179
|
-
adminPassword: z$1.ZodOptional<z$1.ZodString>;
|
|
180
|
-
devMode: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
174
|
+
}, z$1.core.$strict>>;
|
|
175
|
+
uploadFileSizeLimit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
176
|
+
loggerFilename: z$1.ZodString;
|
|
177
|
+
adminRoute: z$1.ZodOptional<z$1.ZodString>;
|
|
178
|
+
adminUser: z$1.ZodOptional<z$1.ZodString>;
|
|
179
|
+
adminPassword: z$1.ZodOptional<z$1.ZodString>;
|
|
180
|
+
devMode: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
181
181
|
setupExtensions: z$1.ZodOptional<z$1.ZodCustom<(app: Express, pools: Pool[]) => void | Promise<void>, (app: Express, pools: Pool[]) => void | Promise<void>>>;
|
|
182
182
|
oracle: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
183
183
|
poolMin: z$1.ZodDefault<z$1.ZodInt>;
|
package/dist/index.mjs
CHANGED
|
@@ -29,8 +29,16 @@ import process$1 from "node:process";
|
|
|
29
29
|
* Configuration for serving static files
|
|
30
30
|
*/
|
|
31
31
|
const configStaticSchema = z$1.strictObject({
|
|
32
|
+
/** URL route prefix for static assets */
|
|
32
33
|
route: z$1.string(),
|
|
34
|
+
/** Local filesystem path to the static assets directory */
|
|
33
35
|
directoryPath: z$1.string(),
|
|
36
|
+
/**
|
|
37
|
+
* Enable SPA fallback mode.
|
|
38
|
+
* When true, serves index.html for unmatched routes (for React Router, Vue Router, etc.)
|
|
39
|
+
* Requires: Application uses HTML5 History Mode routing
|
|
40
|
+
* Default: false
|
|
41
|
+
*/
|
|
34
42
|
spaFallback: z$1.boolean().optional()
|
|
35
43
|
});
|
|
36
44
|
//#endregion
|
|
@@ -112,35 +120,54 @@ const transactionModeSchema = z$1.union([
|
|
|
112
120
|
* Authentication configuration for a PL/SQL route
|
|
113
121
|
*/
|
|
114
122
|
const z$authSchema = z$1.union([z$1.strictObject({
|
|
123
|
+
/** Authentication type */
|
|
115
124
|
type: z$1.literal("basic"),
|
|
125
|
+
/** Callback function to validate credentials */
|
|
116
126
|
callback: z$1.custom((val) => typeof val === "function", { message: "Invalid auth callback" }),
|
|
127
|
+
/** Authentication realm */
|
|
117
128
|
realm: z$1.string().optional()
|
|
118
129
|
}), z$1.strictObject({
|
|
130
|
+
/** Authentication type */
|
|
119
131
|
type: z$1.literal("custom"),
|
|
132
|
+
/** Callback function to validate request */
|
|
120
133
|
callback: z$1.custom((val) => typeof val === "function", { message: "Invalid auth callback" })
|
|
121
134
|
})]);
|
|
122
135
|
/**
|
|
123
136
|
* PL/SQL handler behavior configuration
|
|
124
137
|
*/
|
|
125
138
|
const z$configPlSqlHandlerType = z$1.strictObject({
|
|
139
|
+
/** Default procedure to execute if none specified */
|
|
126
140
|
defaultPage: z$1.string(),
|
|
141
|
+
/** Virtual path alias for procedures */
|
|
127
142
|
pathAlias: z$1.string().optional(),
|
|
143
|
+
/** Procedure name associated with the path alias */
|
|
128
144
|
pathAliasProcedure: z$1.string().optional(),
|
|
145
|
+
/** Database table used for file uploads/downloads */
|
|
129
146
|
documentTable: z$1.string(),
|
|
147
|
+
/** List of pattern/procedure names excluded from execution */
|
|
130
148
|
exclusionList: z$1.array(z$1.string()).optional(),
|
|
149
|
+
/** PL/SQL function called to validate requests */
|
|
131
150
|
requestValidationFunction: z$1.string().optional(),
|
|
151
|
+
/** Post-execution transaction behavior */
|
|
132
152
|
transactionMode: transactionModeSchema.optional(),
|
|
153
|
+
/** Error reporting style */
|
|
133
154
|
errorStyle: z$errorStyleType,
|
|
155
|
+
/** Static CGI environment variables to be passed to the session */
|
|
134
156
|
cgi: z$1.record(z$1.string(), z$1.string()).optional(),
|
|
157
|
+
/** Authentication settings */
|
|
135
158
|
auth: z$authSchema.optional()
|
|
136
159
|
});
|
|
137
160
|
/**
|
|
138
161
|
* Database connection configuration for a PL/SQL route
|
|
139
162
|
*/
|
|
140
163
|
const z$configPlSqlConfigType = z$1.strictObject({
|
|
164
|
+
/** URL route prefix for this database connection */
|
|
141
165
|
route: z$1.string(),
|
|
166
|
+
/** Database username */
|
|
142
167
|
user: z$1.string(),
|
|
168
|
+
/** Database password */
|
|
143
169
|
password: z$1.string(),
|
|
170
|
+
/** Oracle connection string (TNS or EZConnect) */
|
|
144
171
|
connectString: z$1.string()
|
|
145
172
|
});
|
|
146
173
|
const z$configPlSqlType = z$1.strictObject({
|
|
@@ -151,15 +178,25 @@ const z$configPlSqlType = z$1.strictObject({
|
|
|
151
178
|
* Root application configuration
|
|
152
179
|
*/
|
|
153
180
|
const z$configType = z$1.strictObject({
|
|
181
|
+
/** Server listening port */
|
|
154
182
|
port: z$1.number(),
|
|
183
|
+
/** Array of static file routes */
|
|
155
184
|
routeStatic: z$1.array(configStaticSchema),
|
|
185
|
+
/** Array of PL/SQL routes */
|
|
156
186
|
routePlSql: z$1.array(z$configPlSqlType),
|
|
187
|
+
/** Maximum allowed size for file uploads (bytes) */
|
|
157
188
|
uploadFileSizeLimit: z$1.number().optional(),
|
|
189
|
+
/** Path to the log file */
|
|
158
190
|
loggerFilename: z$1.string(),
|
|
191
|
+
/** URL route prefix for the admin console */
|
|
159
192
|
adminRoute: z$1.string().optional(),
|
|
193
|
+
/** Username for admin console authentication */
|
|
160
194
|
adminUser: z$1.string().optional(),
|
|
195
|
+
/** Password for admin console authentication */
|
|
161
196
|
adminPassword: z$1.string().optional(),
|
|
197
|
+
/** Developer mode (skips frontend build check, enables CORS) */
|
|
162
198
|
devMode: z$1.boolean().optional(),
|
|
199
|
+
/** Callback function to setup custom Express extensions */
|
|
163
200
|
setupExtensions: z$1.custom((val) => typeof val === "function", { message: "Invalid setupExtensions callback" }).optional(),
|
|
164
201
|
oracle: z$1.strictObject({
|
|
165
202
|
poolMin: z$1.int().min(10).default(10),
|
|
@@ -222,9 +259,10 @@ globalThis.__VERSION__ ??= "**development**";
|
|
|
222
259
|
* Returns the current library version
|
|
223
260
|
* @returns {string} - Version.
|
|
224
261
|
*/
|
|
225
|
-
const getVersion = () => "1.8.
|
|
262
|
+
const getVersion = () => "1.8.2";
|
|
226
263
|
//#endregion
|
|
227
264
|
//#region src/backend/server/printBanner.ts
|
|
265
|
+
const IS_TTY = process.stdout.isTTY === true;
|
|
228
266
|
const ICON_GLOBE = "🌐";
|
|
229
267
|
const ICON_KEY = "🔑";
|
|
230
268
|
const ICON_DOC = "📄";
|
|
@@ -252,8 +290,9 @@ const padTo = (s, w) => {
|
|
|
252
290
|
return delta > 0 ? s + " ".repeat(delta) : s;
|
|
253
291
|
};
|
|
254
292
|
const truncateTo = (s, w) => w > 0 ? sliceAnsi(s, 0, w) : "";
|
|
255
|
-
const divider = () => chalk.dim(BOX.ml + BOX.h.repeat(W - 2) + BOX.mr);
|
|
256
|
-
const
|
|
293
|
+
const divider = () => IS_TTY ? chalk.dim(BOX.ml + BOX.h.repeat(W - 2) + BOX.mr) : "-".repeat(W);
|
|
294
|
+
const borderOpen = () => IS_TTY ? chalk.dim(BOX.tl + BOX.h.repeat(W - 2) + BOX.tr) : divider();
|
|
295
|
+
const borderClose = () => IS_TTY ? chalk.dim(BOX.bl + BOX.h.repeat(W - 2) + BOX.br) : divider();
|
|
257
296
|
/**
|
|
258
297
|
* Single key/value row.
|
|
259
298
|
* @param key - Label text.
|
|
@@ -262,12 +301,12 @@ const bottom = () => chalk.dim(BOX.bl + BOX.h.repeat(W - 2) + BOX.br);
|
|
|
262
301
|
* @returns Formatted string.
|
|
263
302
|
*/
|
|
264
303
|
const row = (key, value, icon) => {
|
|
265
|
-
const label = padTo(icon ? `${icon} ${key}` : ` ${key}`, LABEL_W);
|
|
304
|
+
const label = padTo(IS_TTY ? icon ? `${icon} ${key}` : ` ${key}` : `${key}`, LABEL_W);
|
|
266
305
|
const hasValue = value !== null && value !== void 0 && value !== "";
|
|
267
306
|
const valueText = hasValue ? String(value) : "—";
|
|
268
307
|
const colorFn = hasValue ? chalk.white : chalk.dim;
|
|
269
308
|
const valueCell = padTo(truncateTo(valueText, VALUE_W), VALUE_W);
|
|
270
|
-
return chalk.dim(BOX.v) + " " + chalk.dim(label) + " " + colorFn(valueCell) + " " + chalk.dim(BOX.v);
|
|
309
|
+
return IS_TTY ? chalk.dim(BOX.v) + " " + chalk.dim(label) + " " + colorFn(valueCell) + " " + chalk.dim(BOX.v) : label + " " + valueCell;
|
|
271
310
|
};
|
|
272
311
|
/**
|
|
273
312
|
* Renders the server startup banner to stdout.
|
|
@@ -277,10 +316,10 @@ const printBanner = (cfg) => {
|
|
|
277
316
|
const adminRoute = cfg.adminRoute ?? "/admin";
|
|
278
317
|
const baseUrl = `http://localhost:${cfg.port}`;
|
|
279
318
|
const lines = [];
|
|
319
|
+
lines.push(borderOpen());
|
|
280
320
|
const title = `NODE PL/SQL SERVER ${getVersion()}`;
|
|
281
321
|
const pad = W - 2 - displayWidth(title);
|
|
282
|
-
lines.push(chalk.dim(BOX.
|
|
283
|
-
lines.push(chalk.dim(BOX.v) + " ".repeat(Math.floor(pad / 2)) + chalk.bold.cyan(title) + " ".repeat(Math.ceil(pad / 2)) + chalk.dim(BOX.v));
|
|
322
|
+
lines.push(IS_TTY ? chalk.dim(BOX.v) + " ".repeat(Math.floor(pad / 2)) + chalk.bold.cyan(title) + " ".repeat(Math.ceil(pad / 2)) + chalk.dim(BOX.v) : title);
|
|
284
323
|
lines.push(divider());
|
|
285
324
|
lines.push(row("Port", cfg.port, ICON_GLOBE));
|
|
286
325
|
lines.push(row("Admin route", `${adminRoute}${cfg.adminUser ? " (authenticated)" : ""}`, ICON_KEY));
|
|
@@ -321,7 +360,7 @@ const printBanner = (cfg) => {
|
|
|
321
360
|
cfg.routePlSql.forEach((r) => {
|
|
322
361
|
lines.push(row(r.route, `${baseUrl}${r.route}`, ICON_GEAR));
|
|
323
362
|
});
|
|
324
|
-
lines.push(
|
|
363
|
+
lines.push(borderClose());
|
|
325
364
|
console.log(lines.join("\n"));
|
|
326
365
|
};
|
|
327
366
|
//#endregion
|