web_plsql 1.8.3 → 1.8.4

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.
@@ -6,8 +6,8 @@
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-YSfTixL2.js"></script>
10
- <link rel="stylesheet" crossorigin href="/admin/assets/main-z1idaLd3.css">
9
+ <script type="module" crossorigin src="/admin/assets/main-DhSIoaS4.js"></script>
10
+ <link rel="stylesheet" crossorigin href="/admin/assets/main-CBxeWHJN.css">
11
11
  </head>
12
12
  <body class="dark">
13
13
  <div class="app-container">
Binary file
Binary file
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import z$1, { z } from "zod";
1
+ import z, { z as z$1 } from "zod";
2
2
  import oracledb, { BindParameter, BindParameters, BindParameters as BindParameters$1, Connection, Connection as Connection$1, DbType, ExecuteOptions, Lob, Pool, Pool as Pool$1, Result, Result as Result$1 } from "oracledb";
3
3
  import http from "node:http";
4
4
  import https from "node:https";
@@ -99,39 +99,39 @@ type CustomAuthCallback = (req: Request, connectionPool: Pool) => Promise<string
99
99
  /**
100
100
  * PL/SQL handler behavior configuration
101
101
  */
102
- declare const z$configPlSqlHandlerType: z$1.ZodObject<{
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
- errorStyle: z$1.ZodEnum<{
102
+ declare const z$configPlSqlHandlerType: z.ZodObject<{
103
+ defaultPage: z.ZodString;
104
+ pathAlias: z.ZodOptional<z.ZodString>;
105
+ pathAliasProcedure: z.ZodOptional<z.ZodString>;
106
+ documentTable: z.ZodString;
107
+ exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ requestValidationFunction: z.ZodOptional<z.ZodString>;
109
+ transactionMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<transactionCallbackType, transactionCallbackType>, z.ZodLiteral<"commit">, z.ZodLiteral<"rollback">, z.ZodUndefined, z.ZodNull]>>;
110
+ errorStyle: z.ZodEnum<{
111
111
  basic: "basic";
112
112
  debug: "debug";
113
113
  }>;
114
- cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
115
- auth: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
116
- type: z$1.ZodLiteral<"basic">;
117
- callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
118
- realm: z$1.ZodOptional<z$1.ZodString>;
119
- }, z$1.core.$strict>, z$1.ZodObject<{
120
- type: z$1.ZodLiteral<"custom">;
121
- callback: z$1.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
122
- }, z$1.core.$strict>]>>;
123
- }, z$1.core.$strict>;
124
- type configPlSqlHandlerType = z$1.infer<typeof z$configPlSqlHandlerType>;
114
+ cgi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
115
+ auth: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
116
+ type: z.ZodLiteral<"basic">;
117
+ callback: z.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
118
+ realm: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strict>, z.ZodObject<{
120
+ type: z.ZodLiteral<"custom">;
121
+ callback: z.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
122
+ }, z.core.$strict>]>>;
123
+ }, z.core.$strict>;
124
+ type configPlSqlHandlerType = z.infer<typeof z$configPlSqlHandlerType>;
125
125
  /**
126
126
  * Database connection configuration for a PL/SQL route
127
127
  */
128
- declare const z$configPlSqlConfigType: z$1.ZodObject<{
129
- route: z$1.ZodString;
130
- user: z$1.ZodString;
131
- password: z$1.ZodString;
132
- connectString: z$1.ZodString;
133
- }, z$1.core.$strict>;
134
- type configPlSqlConfigType = z$1.infer<typeof z$configPlSqlConfigType>;
128
+ declare const z$configPlSqlConfigType: z.ZodObject<{
129
+ route: z.ZodString;
130
+ user: z.ZodString;
131
+ password: z.ZodString;
132
+ connectString: z.ZodString;
133
+ }, z.core.$strict>;
134
+ type configPlSqlConfigType = z.infer<typeof z$configPlSqlConfigType>;
135
135
  /**
136
136
  * Complete PL/SQL route configuration combining handler and connection settings
137
137
  */
@@ -139,54 +139,54 @@ type configPlSqlType = configPlSqlHandlerType & configPlSqlConfigType;
139
139
  /**
140
140
  * Root application configuration
141
141
  */
142
- declare const z$configType: z$1.ZodObject<{
143
- port: z$1.ZodNumber;
144
- routeStatic: z$1.ZodArray<z$1.ZodObject<{
145
- route: z$1.ZodString;
146
- directoryPath: z$1.ZodString;
147
- spaFallback: z$1.ZodOptional<z$1.ZodBoolean>;
148
- }, z$1.core.$strict>>;
149
- routePlSql: z$1.ZodArray<z$1.ZodObject<{
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
- errorStyle: z$1.ZodEnum<{
142
+ declare const z$configType: z.ZodObject<{
143
+ port: z.ZodNumber;
144
+ routeStatic: z.ZodArray<z.ZodObject<{
145
+ route: z.ZodString;
146
+ directoryPath: z.ZodString;
147
+ spaFallback: z.ZodOptional<z.ZodBoolean>;
148
+ }, z.core.$strict>>;
149
+ routePlSql: z.ZodArray<z.ZodObject<{
150
+ route: z.ZodString;
151
+ user: z.ZodString;
152
+ password: z.ZodString;
153
+ connectString: z.ZodString;
154
+ defaultPage: z.ZodString;
155
+ pathAlias: z.ZodOptional<z.ZodString>;
156
+ pathAliasProcedure: z.ZodOptional<z.ZodString>;
157
+ documentTable: z.ZodString;
158
+ exclusionList: z.ZodOptional<z.ZodArray<z.ZodString>>;
159
+ requestValidationFunction: z.ZodOptional<z.ZodString>;
160
+ transactionMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<transactionCallbackType, transactionCallbackType>, z.ZodLiteral<"commit">, z.ZodLiteral<"rollback">, z.ZodUndefined, z.ZodNull]>>;
161
+ errorStyle: z.ZodEnum<{
162
162
  basic: "basic";
163
163
  debug: "debug";
164
164
  }>;
165
- cgi: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
166
- auth: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
167
- type: z$1.ZodLiteral<"basic">;
168
- callback: z$1.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
169
- realm: z$1.ZodOptional<z$1.ZodString>;
170
- }, z$1.core.$strict>, z$1.ZodObject<{
171
- type: z$1.ZodLiteral<"custom">;
172
- callback: z$1.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
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>;
181
- setupExtensions: z$1.ZodOptional<z$1.ZodCustom<(app: Express, pools: Pool[]) => void | Promise<void>, (app: Express, pools: Pool[]) => void | Promise<void>>>;
182
- oracle: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
183
- poolMin: z$1.ZodDefault<z$1.ZodInt>;
184
- poolMax: z$1.ZodDefault<z$1.ZodInt>;
185
- poolIncrement: z$1.ZodDefault<z$1.ZodInt>;
186
- }, z$1.core.$strict>>>;
187
- }, z$1.core.$strict>;
188
- type configInputType = z$1.input<typeof z$configType>;
189
- type configType = z$1.output<typeof z$configType>;
165
+ cgi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
166
+ auth: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
167
+ type: z.ZodLiteral<"basic">;
168
+ callback: z.ZodCustom<BasicAuthCallback, BasicAuthCallback>;
169
+ realm: z.ZodOptional<z.ZodString>;
170
+ }, z.core.$strict>, z.ZodObject<{
171
+ type: z.ZodLiteral<"custom">;
172
+ callback: z.ZodCustom<CustomAuthCallback, CustomAuthCallback>;
173
+ }, z.core.$strict>]>>;
174
+ }, z.core.$strict>>;
175
+ uploadFileSizeLimit: z.ZodOptional<z.ZodNumber>;
176
+ loggerFilename: z.ZodString;
177
+ adminRoute: z.ZodOptional<z.ZodString>;
178
+ adminUser: z.ZodOptional<z.ZodString>;
179
+ adminPassword: z.ZodOptional<z.ZodString>;
180
+ devMode: z.ZodOptional<z.ZodBoolean>;
181
+ setupExtensions: z.ZodOptional<z.ZodCustom<(app: Express, pools: Pool[]) => void | Promise<void>, (app: Express, pools: Pool[]) => void | Promise<void>>>;
182
+ oracle: z.ZodDefault<z.ZodOptional<z.ZodObject<{
183
+ poolMin: z.ZodDefault<z.ZodInt>;
184
+ poolMax: z.ZodDefault<z.ZodInt>;
185
+ poolIncrement: z.ZodDefault<z.ZodInt>;
186
+ }, z.core.$strict>>>;
187
+ }, z.core.$strict>;
188
+ type configInputType = z.input<typeof z$configType>;
189
+ type configType = z.output<typeof z$configType>;
190
190
  /**
191
191
  * Mapping of PL/SQL procedure argument names to their database types
192
192
  */
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
- import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
2
- import { n as setExecuteCallback } from "./oracledb-mock-Cya43xKB.mjs";
3
- import z$1, { z } from "zod";
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import z, { z as z$1 } from "zod";
4
3
  import oracledb from "oracledb";
5
4
  import chalk from "chalk";
6
5
  import stringWidth from "string-width";
@@ -28,71 +27,71 @@ import process$1 from "node:process";
28
27
  /**
29
28
  * Configuration for serving static files
30
29
  */
31
- const configStaticSchema = z$1.strictObject({
30
+ const configStaticSchema = z.strictObject({
32
31
  /** URL route prefix for static assets */
33
- route: z$1.string(),
32
+ route: z.string(),
34
33
  /** Local filesystem path to the static assets directory */
35
- directoryPath: z$1.string(),
34
+ directoryPath: z.string(),
36
35
  /**
37
36
  * Enable SPA fallback mode.
38
37
  * When true, serves index.html for unmatched routes (for React Router, Vue Router, etc.)
39
38
  * Requires: Application uses HTML5 History Mode routing
40
39
  * Default: false
41
40
  */
42
- spaFallback: z$1.boolean().optional()
41
+ spaFallback: z.boolean().optional()
43
42
  });
44
43
  //#endregion
45
44
  //#region src/common/procedureTraceEntry.ts
46
- const procedureTraceEntrySchema = z.strictObject({
47
- id: z.string(),
48
- timestamp: z.string(),
49
- source: z.string(),
50
- url: z.string(),
51
- method: z.string(),
52
- status: z.string(),
53
- duration: z.number(),
54
- procedure: z.string().optional(),
55
- parameters: z.union([z.record(z.string(), z.unknown()), z.array(z.unknown())]).optional(),
56
- uploads: z.array(z.strictObject({
57
- originalname: z.string(),
58
- mimetype: z.string(),
59
- size: z.number()
45
+ const procedureTraceEntrySchema = z$1.strictObject({
46
+ id: z$1.string(),
47
+ timestamp: z$1.string(),
48
+ source: z$1.string(),
49
+ url: z$1.string(),
50
+ method: z$1.string(),
51
+ status: z$1.string(),
52
+ duration: z$1.number(),
53
+ procedure: z$1.string().optional(),
54
+ parameters: z$1.union([z$1.record(z$1.string(), z$1.unknown()), z$1.array(z$1.unknown())]).optional(),
55
+ uploads: z$1.array(z$1.strictObject({
56
+ originalname: z$1.string(),
57
+ mimetype: z$1.string(),
58
+ size: z$1.number()
60
59
  })).optional(),
61
- downloads: z.strictObject({
62
- fileType: z.string(),
63
- fileSize: z.number()
60
+ downloads: z$1.strictObject({
61
+ fileType: z$1.string(),
62
+ fileSize: z$1.number()
64
63
  }).optional(),
65
- html: z.string().optional(),
66
- cookies: z.record(z.string(), z.string()).optional(),
67
- headers: z.record(z.string(), z.string()).optional(),
68
- cgi: z.record(z.string(), z.string()).optional(),
69
- error: z.string().optional()
64
+ html: z$1.string().optional(),
65
+ cookies: z$1.record(z$1.string(), z$1.string()).optional(),
66
+ headers: z$1.record(z$1.string(), z$1.string()).optional(),
67
+ cgi: z$1.record(z$1.string(), z$1.string()).optional(),
68
+ error: z$1.string().optional()
70
69
  });
71
70
  //#endregion
72
71
  //#region src/common/logEntrySchema.ts
73
72
  /**
74
73
  * Error log entry schema.
75
74
  */
76
- const logEntryTypeSchema = z.union([
77
- z.literal("error"),
78
- z.literal("info"),
79
- z.literal("warning")
75
+ const logEntryTypeSchema = z$1.union([
76
+ z$1.literal("error"),
77
+ z$1.literal("info"),
78
+ z$1.literal("warning")
80
79
  ]);
81
- const logEntrySchema = z.strictObject({
82
- timestamp: z.string(),
80
+ const logEntrySchema = z$1.strictObject({
81
+ timestamp: z$1.string(),
83
82
  type: logEntryTypeSchema,
84
- message: z.string(),
85
- req: z.strictObject({
86
- method: z.string().optional(),
87
- url: z.string().optional(),
88
- ip: z.string().optional(),
89
- userAgent: z.string().optional()
83
+ message: z$1.string(),
84
+ req: z$1.strictObject({
85
+ method: z$1.string().optional(),
86
+ url: z$1.string().optional(),
87
+ ip: z$1.string().optional(),
88
+ userAgent: z$1.string().optional()
90
89
  }).optional(),
91
- details: z.strictObject({
92
- fullMessage: z.string().optional(),
93
- sql: z.string().optional(),
94
- bind: z.unknown().optional(),
95
- environment: z.record(z.string(), z.string()).optional()
90
+ details: z$1.strictObject({
91
+ fullMessage: z$1.string().optional(),
92
+ sql: z$1.string().optional(),
93
+ bind: z$1.unknown().optional(),
94
+ environment: z$1.record(z$1.string(), z$1.string()).optional()
96
95
  }).optional()
97
96
  });
98
97
  //#endregion
@@ -102,106 +101,106 @@ const logEntrySchema = z.strictObject({
102
101
  * 'basic': standard error messages
103
102
  * 'debug': detailed error messages including database context
104
103
  */
105
- const z$errorStyleType = z$1.enum(["basic", "debug"]);
104
+ const z$errorStyleType = z.enum(["basic", "debug"]);
106
105
  /**
107
106
  * Defines how transactions are handled after procedure execution
108
107
  * 'commit': automatically commit
109
108
  * 'rollback': automatically rollback
110
109
  * callback: custom function for manual handling
111
110
  */
112
- const transactionModeSchema = z$1.union([
113
- z$1.custom((val) => typeof val === "function", { message: "Invalid transaction callback" }),
114
- z$1.literal("commit"),
115
- z$1.literal("rollback"),
116
- z$1.undefined(),
117
- z$1.null()
111
+ const transactionModeSchema = z.union([
112
+ z.custom((val) => typeof val === "function", { message: "Invalid transaction callback" }),
113
+ z.literal("commit"),
114
+ z.literal("rollback"),
115
+ z.undefined(),
116
+ z.null()
118
117
  ]);
119
118
  /**
120
119
  * Authentication configuration for a PL/SQL route
121
120
  */
122
- const z$authSchema = z$1.union([z$1.strictObject({
121
+ const z$authSchema = z.union([z.strictObject({
123
122
  /** Authentication type */
124
- type: z$1.literal("basic"),
123
+ type: z.literal("basic"),
125
124
  /** Callback function to validate credentials */
126
- callback: z$1.custom((val) => typeof val === "function", { message: "Invalid auth callback" }),
125
+ callback: z.custom((val) => typeof val === "function", { message: "Invalid auth callback" }),
127
126
  /** Authentication realm */
128
- realm: z$1.string().optional()
129
- }), z$1.strictObject({
127
+ realm: z.string().optional()
128
+ }), z.strictObject({
130
129
  /** Authentication type */
131
- type: z$1.literal("custom"),
130
+ type: z.literal("custom"),
132
131
  /** Callback function to validate request */
133
- callback: z$1.custom((val) => typeof val === "function", { message: "Invalid auth callback" })
132
+ callback: z.custom((val) => typeof val === "function", { message: "Invalid auth callback" })
134
133
  })]);
135
134
  /**
136
135
  * PL/SQL handler behavior configuration
137
136
  */
138
- const z$configPlSqlHandlerType = z$1.strictObject({
137
+ const z$configPlSqlHandlerType = z.strictObject({
139
138
  /** Default procedure to execute if none specified */
140
- defaultPage: z$1.string(),
139
+ defaultPage: z.string(),
141
140
  /** Virtual path alias for procedures */
142
- pathAlias: z$1.string().optional(),
141
+ pathAlias: z.string().optional(),
143
142
  /** Procedure name associated with the path alias */
144
- pathAliasProcedure: z$1.string().optional(),
143
+ pathAliasProcedure: z.string().optional(),
145
144
  /** Database table used for file uploads/downloads */
146
- documentTable: z$1.string(),
145
+ documentTable: z.string(),
147
146
  /** List of pattern/procedure names excluded from execution */
148
- exclusionList: z$1.array(z$1.string()).optional(),
147
+ exclusionList: z.array(z.string()).optional(),
149
148
  /** PL/SQL function called to validate requests */
150
- requestValidationFunction: z$1.string().optional(),
149
+ requestValidationFunction: z.string().optional(),
151
150
  /** Post-execution transaction behavior */
152
151
  transactionMode: transactionModeSchema.optional(),
153
152
  /** Error reporting style */
154
153
  errorStyle: z$errorStyleType,
155
154
  /** Static CGI environment variables to be passed to the session */
156
- cgi: z$1.record(z$1.string(), z$1.string()).optional(),
155
+ cgi: z.record(z.string(), z.string()).optional(),
157
156
  /** Authentication settings */
158
157
  auth: z$authSchema.optional()
159
158
  });
160
159
  /**
161
160
  * Database connection configuration for a PL/SQL route
162
161
  */
163
- const z$configPlSqlConfigType = z$1.strictObject({
162
+ const z$configPlSqlConfigType = z.strictObject({
164
163
  /** URL route prefix for this database connection */
165
- route: z$1.string(),
164
+ route: z.string(),
166
165
  /** Database username */
167
- user: z$1.string(),
166
+ user: z.string(),
168
167
  /** Database password */
169
- password: z$1.string(),
168
+ password: z.string(),
170
169
  /** Oracle connection string (TNS or EZConnect) */
171
- connectString: z$1.string()
170
+ connectString: z.string()
172
171
  });
173
- const z$configPlSqlType = z$1.strictObject({
172
+ const z$configPlSqlType = z.strictObject({
174
173
  ...z$configPlSqlHandlerType.shape,
175
174
  ...z$configPlSqlConfigType.shape
176
175
  });
177
176
  /**
178
177
  * Root application configuration
179
178
  */
180
- const z$configType = z$1.strictObject({
179
+ const z$configType = z.strictObject({
181
180
  /** Server listening port */
182
- port: z$1.number(),
181
+ port: z.number(),
183
182
  /** Array of static file routes */
184
- routeStatic: z$1.array(configStaticSchema),
183
+ routeStatic: z.array(configStaticSchema),
185
184
  /** Array of PL/SQL routes */
186
- routePlSql: z$1.array(z$configPlSqlType),
185
+ routePlSql: z.array(z$configPlSqlType),
187
186
  /** Maximum allowed size for file uploads (bytes) */
188
- uploadFileSizeLimit: z$1.number().optional(),
187
+ uploadFileSizeLimit: z.number().optional(),
189
188
  /** Path to the log file */
190
- loggerFilename: z$1.string(),
189
+ loggerFilename: z.string(),
191
190
  /** URL route prefix for the admin console */
192
- adminRoute: z$1.string().optional(),
191
+ adminRoute: z.string().optional(),
193
192
  /** Username for admin console authentication */
194
- adminUser: z$1.string().optional(),
193
+ adminUser: z.string().optional(),
195
194
  /** Password for admin console authentication */
196
- adminPassword: z$1.string().optional(),
195
+ adminPassword: z.string().optional(),
197
196
  /** Developer mode (skips frontend build check, enables CORS) */
198
- devMode: z$1.boolean().optional(),
197
+ devMode: z.boolean().optional(),
199
198
  /** Callback function to setup custom Express extensions */
200
- setupExtensions: z$1.custom((val) => typeof val === "function", { message: "Invalid setupExtensions callback" }).optional(),
201
- oracle: z$1.strictObject({
202
- poolMin: z$1.int().min(10).default(10),
203
- poolMax: z$1.int().min(10).default(100),
204
- poolIncrement: z$1.int().min(1).default(10)
199
+ setupExtensions: z.custom((val) => typeof val === "function", { message: "Invalid setupExtensions callback" }).optional(),
200
+ oracle: z.strictObject({
201
+ poolMin: z.int().min(10).default(10),
202
+ poolMax: z.int().min(10).default(100),
203
+ poolIncrement: z.int().min(1).default(10)
205
204
  }).optional().default({
206
205
  poolMin: 10,
207
206
  poolMax: 100,
@@ -209,6 +208,69 @@ const z$configType = z$1.strictObject({
209
208
  })
210
209
  });
211
210
  //#endregion
211
+ //#region src/backend/util/oracledb-mock.ts
212
+ var oracledb_mock_exports = /* @__PURE__ */ __exportAll({
213
+ createPool: () => createPool$1,
214
+ setExecuteCallback: () => setExecuteCallback
215
+ });
216
+ let executeCallback = null;
217
+ /**
218
+ * Test utility: Set the callback for execute calls.
219
+ * @param cb - The callback
220
+ */
221
+ const setExecuteCallback = (cb) => {
222
+ executeCallback = cb;
223
+ };
224
+ /**
225
+ * Mock LOB class.
226
+ */
227
+ var MockLob = class {
228
+ type;
229
+ constructor(type) {
230
+ this.type = type;
231
+ }
232
+ destroy() {}
233
+ };
234
+ /**
235
+ * Mock Connection class.
236
+ */
237
+ var MockConnection = class {
238
+ async execute(sql, bindParams, _options) {
239
+ if (executeCallback) return await executeCallback(sql, bindParams);
240
+ return { rows: [] };
241
+ }
242
+ async createLob(type) {
243
+ return new MockLob(type);
244
+ }
245
+ async commit() {}
246
+ async rollback() {}
247
+ async release() {}
248
+ };
249
+ /**
250
+ * Mock Pool class.
251
+ */
252
+ var MockPool = class {
253
+ connectionsOpen = 0;
254
+ connectionsInUse = 0;
255
+ async getConnection() {
256
+ this.connectionsInUse++;
257
+ this.connectionsOpen = Math.max(this.connectionsOpen, this.connectionsInUse);
258
+ return new MockConnection();
259
+ }
260
+ async close(_drainTime) {
261
+ this.connectionsOpen = 0;
262
+ this.connectionsInUse = 0;
263
+ }
264
+ };
265
+ /**
266
+ * Mock createPool function.
267
+ * @param _config - The configuration
268
+ * @returns The pool
269
+ */
270
+ async function createPool$1(_config) {
271
+ return new MockPool();
272
+ }
273
+ //#endregion
212
274
  //#region src/backend/util/oracledb-provider.ts
213
275
  var oracledb_provider_exports = /* @__PURE__ */ __exportAll({
214
276
  BIND_IN: () => BIND_IN,
@@ -235,7 +297,7 @@ const USE_MOCK = process.env.MOCK_ORACLE === "true";
235
297
  * @returns The pool.
236
298
  */
237
299
  async function createPool(config) {
238
- if (USE_MOCK) return (await import("./oracledb-mock-Cya43xKB.mjs").then((n) => n.t)).createPool(config);
300
+ if (USE_MOCK) return (await Promise.resolve().then(() => oracledb_mock_exports)).createPool(config);
239
301
  return await oracledb.createPool(config);
240
302
  }
241
303
  const BIND_IN = oracledb.BIND_IN;
@@ -259,7 +321,7 @@ globalThis.__VERSION__ ??= "**development**";
259
321
  * Returns the current library version
260
322
  * @returns {string} - Version.
261
323
  */
262
- const getVersion = () => "1.8.3";
324
+ const getVersion = () => "1.8.4";
263
325
  //#endregion
264
326
  //#region src/backend/server/printBanner.ts
265
327
  const IS_TTY = process.stdout.isTTY === true;
@@ -1420,15 +1482,15 @@ const errorToString = (error) => {
1420
1482
  //#endregion
1421
1483
  //#region src/backend/handler/plsql/upload.ts
1422
1484
  const debug$11 = debugModule("webplsql:fileUpload");
1423
- const z$reqFiles = z$1.array(z$1.strictObject({
1424
- fieldname: z$1.string(),
1425
- originalname: z$1.string(),
1426
- encoding: z$1.string(),
1427
- mimetype: z$1.string(),
1428
- destination: z$1.string(),
1429
- filename: z$1.string(),
1430
- path: z$1.string(),
1431
- size: z$1.number()
1485
+ const z$reqFiles = z.array(z.strictObject({
1486
+ fieldname: z.string(),
1487
+ originalname: z.string(),
1488
+ encoding: z.string(),
1489
+ mimetype: z.string(),
1490
+ destination: z.string(),
1491
+ filename: z.string(),
1492
+ path: z.string(),
1493
+ size: z.number()
1432
1494
  }));
1433
1495
  /**
1434
1496
  * Get the files
@@ -1624,9 +1686,9 @@ const loadArguments = async (procedure, databaseConnection) => {
1624
1686
  }
1625
1687
  let data;
1626
1688
  try {
1627
- data = z$1.object({
1628
- names: z$1.array(z$1.string().nullable()),
1629
- types: z$1.array(z$1.string().nullable())
1689
+ data = z.object({
1690
+ names: z.array(z.string().nullable()),
1691
+ types: z.array(z.string().nullable())
1630
1692
  }).parse(result.outBinds);
1631
1693
  } catch (err) {
1632
1694
  /* v8 ignore start */
@@ -2264,7 +2326,7 @@ const resolveProcedureName = async (procName, databaseConnection, procedureNameC
2264
2326
  };
2265
2327
  try {
2266
2328
  const result = await databaseConnection.execute(sql, bind);
2267
- const { resolved } = z$1.strictObject({ resolved: z$1.string() }).parse(result.outBinds);
2329
+ const { resolved } = z.strictObject({ resolved: z.string() }).parse(result.outBinds);
2268
2330
  if (!resolved) throw new RequestError(`Could not resolve procedure name "${procName}"`);
2269
2331
  debug$6(`resolveProcedureName: Resolved "${procName}" -> "${resolved}"`);
2270
2332
  procedureNameCache.set(procName, resolved);
@@ -2363,7 +2425,7 @@ const loadRequestValid = async (procName, requestValidationFunction, databaseCon
2363
2425
  throw new RequestError(`Error when validating procedure name "${procName}"\n${SQL}\n${errorToString(err)}`);
2364
2426
  }
2365
2427
  try {
2366
- return z$1.strictObject({ valid: z$1.number() }).parse(result.outBinds).valid === 1;
2428
+ return z.strictObject({ valid: z.number() }).parse(result.outBinds).valid === 1;
2367
2429
  } catch (err) {
2368
2430
  /* v8 ignore start */
2369
2431
  debug$6("result", result.outBinds);
@@ -2434,9 +2496,9 @@ var OWAPageStream = class extends Readable {
2434
2496
  const sqlStatement = "BEGIN owa.get_page(thepage=>:lines, irows=>:irows); END;";
2435
2497
  try {
2436
2498
  const result = await this.databaseConnection.execute(sqlStatement, bindParameter);
2437
- const { lines, irows } = z$1.strictObject({
2438
- irows: z$1.number(),
2439
- lines: z$1.array(z$1.string())
2499
+ const { lines, irows } = z.strictObject({
2500
+ irows: z.number(),
2501
+ lines: z.array(z.string())
2440
2502
  }).parse(result.outBinds);
2441
2503
  debug$5(`fetched ${lines.length} lines (irows=${irows})`);
2442
2504
  if (lines.length < this.chunkSize) this.isDone = true;
@@ -2667,10 +2729,10 @@ END;
2667
2729
  /* v8 ignore stop */
2668
2730
  throw new ProcedureError(`procedureDownloadFiles: error when downloading files\n${errorToString(err)}`, {}, sqlStatement, bindParameter);
2669
2731
  }
2670
- return z$1.object({
2671
- fileType: z$1.string().nullable().transform((val) => val ?? ""),
2672
- fileSize: z$1.number().nullable().transform((val) => val ?? 0),
2673
- fileBlob: z$1.instanceof(stream.Readable).nullable()
2732
+ return z.object({
2733
+ fileType: z.string().nullable().transform((val) => val ?? ""),
2734
+ fileSize: z.number().nullable().transform((val) => val ?? 0),
2735
+ fileBlob: z.instanceof(stream.Readable).nullable()
2674
2736
  }).parse(result.outBinds);
2675
2737
  };
2676
2738
  /**
@@ -3348,7 +3410,7 @@ const createAdminRouter = (adminContext) => {
3348
3410
  return null;
3349
3411
  }
3350
3412
  }).filter((l) => l !== null);
3351
- const logs = z.array(logEntrySchema).safeParse(parsedLines);
3413
+ const logs = z$1.array(logEntrySchema).safeParse(parsedLines);
3352
3414
  if (!logs.success) throw new Error(`Validation failed: ${logs.error.message}`);
3353
3415
  return res.json(logs.data.toReversed());
3354
3416
  } catch (err) {
@@ -3429,7 +3491,7 @@ const createAdminRouter = (adminContext) => {
3429
3491
  return null;
3430
3492
  }
3431
3493
  }).filter((l) => l !== null);
3432
- const logs = z.array(procedureTraceEntrySchema).safeParse(parsedLines);
3494
+ const logs = z$1.array(procedureTraceEntrySchema).safeParse(parsedLines);
3433
3495
  if (!logs.success) throw new Error(`Validation failed: ${logs.error.message}`);
3434
3496
  return res.json(logs.data.toReversed());
3435
3497
  } catch (err) {