web_plsql 0.18.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +29 -9
  2. package/package.json +17 -7
  3. package/src/admin/client/charts.ts +598 -0
  4. package/src/admin/client/main.js +3 -0
  5. package/src/admin/client/tailwind.css +41 -0
  6. package/src/admin/favicon.svg +3 -0
  7. package/src/admin/index.html +529 -0
  8. package/src/admin/js/api.ts +170 -0
  9. package/src/admin/js/app.ts +614 -0
  10. package/src/admin/js/eslint.config.js +74 -0
  11. package/src/admin/js/schemas.ts +215 -0
  12. package/src/admin/js/templates/config.ts +147 -0
  13. package/src/admin/js/templates/errorRow.ts +21 -0
  14. package/src/admin/js/templates/index.ts +4 -0
  15. package/src/admin/js/templates/poolCard.ts +61 -0
  16. package/src/admin/js/templates/traceRow.ts +24 -0
  17. package/src/admin/js/tsconfig.json +24 -0
  18. package/src/admin/js/types.ts +336 -0
  19. package/src/admin/js/ui/components.ts +44 -0
  20. package/src/admin/js/ui/table.ts +173 -0
  21. package/src/admin/js/ui/theme.ts +93 -0
  22. package/src/admin/js/ui/views.ts +427 -0
  23. package/src/admin/js/util/format.ts +46 -0
  24. package/src/admin/js/util/metrics.ts +24 -0
  25. package/src/admin/lib/chart.bundle.css +1 -0
  26. package/src/admin/lib/chart.bundle.js +146 -0
  27. package/src/admin/style.css +1437 -0
  28. package/src/bin/load-test.js +202 -0
  29. package/src/handler/handlerAdmin.js +293 -0
  30. package/src/handler/plsql/cgi.js +1 -1
  31. package/src/handler/plsql/errorPage.js +31 -6
  32. package/src/handler/plsql/handlerPlSql.js +32 -6
  33. package/src/handler/plsql/owaPageStream.js +93 -0
  34. package/src/handler/plsql/parsePage.js +7 -3
  35. package/src/handler/plsql/procedure.js +221 -105
  36. package/src/handler/plsql/procedureNamed.js +34 -49
  37. package/src/handler/plsql/procedureSanitize.js +120 -45
  38. package/src/handler/plsql/procedureVariable.js +4 -2
  39. package/src/handler/plsql/request.js +8 -3
  40. package/src/handler/plsql/sendResponse.js +43 -5
  41. package/src/index.js +0 -1
  42. package/src/server/adminContext.js +23 -0
  43. package/src/server/config.js +1 -0
  44. package/src/server/server.js +130 -9
  45. package/src/types.js +7 -1
  46. package/src/util/cache.js +123 -0
  47. package/src/util/jsonLogger.js +47 -0
  48. package/src/util/shutdown.js +6 -2
  49. package/src/util/statsManager.js +368 -0
  50. package/src/util/trace.js +7 -6
  51. package/src/util/traceManager.js +68 -0
  52. package/src/version.js +1 -1
  53. package/types/admin/js/schemas.d.ts +384 -0
  54. package/types/admin/js/types.d.ts +312 -0
  55. package/types/handler/handlerAdmin.d.ts +79 -0
  56. package/types/handler/plsql/errorPage.d.ts +1 -0
  57. package/types/handler/plsql/handlerPlSql.d.ts +6 -1
  58. package/types/handler/plsql/owaPageStream.d.ts +28 -0
  59. package/types/handler/plsql/procedure.d.ts +4 -1
  60. package/types/handler/plsql/procedureNamed.d.ts +2 -5
  61. package/types/handler/plsql/procedureSanitize.d.ts +2 -5
  62. package/types/handler/plsql/procedureVariable.d.ts +1 -1
  63. package/types/handler/plsql/request.d.ts +3 -1
  64. package/types/handler/plsql/sendResponse.d.ts +1 -1
  65. package/types/index.d.ts +0 -1
  66. package/types/server/adminContext.d.ts +17 -0
  67. package/types/server/server.d.ts +5 -0
  68. package/types/types.d.ts +19 -1
  69. package/types/util/cache.d.ts +69 -0
  70. package/types/util/jsonLogger.d.ts +45 -0
  71. package/types/util/statsManager.d.ts +395 -0
  72. package/types/util/traceManager.d.ts +35 -0
  73. package/src/handler/handlerMetrics.js +0 -68
  74. package/types/handler/handlerMetrics.d.ts +0 -25
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  [![NPM Version][npm-image]][npm-url]
2
2
  [![NPM Downloads][downloads-image]][downloads-url]
3
- [![Linux Build](https://travis-ci.org/doberkofler/web_plsql.svg?branch=master)](https://travis-ci.org/doberkofler/web_plsql)
4
- [![Build status][appveyor-image]][appveyor-url]
3
+ [![Node.js CI](https://github.com/doberkofler/web_plsql/actions/workflows/node.js.yml/badge.svg)](https://github.com/doberkofler/web_plsql/actions/workflows/node.js.yml)
5
4
  [![Coverage Status](https://coveralls.io/repos/github/doberkofler/web_plsql/badge.svg?branch=master)](https://coveralls.io/github/doberkofler/web_plsql?branch=master)
6
5
 
7
6
  # Oracle PL/SQL Gateway Middleware for the Express web framework for Node.js
@@ -12,6 +11,8 @@ and serve the content using the Express web framework for Node.js.
12
11
 
13
12
  Please feel free to try and suggest any improvements. Your thoughts and ideas are most welcome.
14
13
 
14
+ ![Dashboard](docs/images/admin_console.png)
15
+
15
16
  # Release History
16
17
  See the [changelog](https://github.com/doberkofler/web_plsql/blob/master/CHANGELOG.md).
17
18
 
@@ -31,10 +32,29 @@ Please visit the [node-oracledb](https://node-oracledb.readthedocs.io/en/latest/
31
32
  * Start server using `node examples/config-native.js` after having set the WEB_PLSQL_ORACLE_SERVER environment variable to the database where you just installed the sample schema.
32
33
  * Invoke a browser and open the page `http://localhost/sample`.
33
34
 
34
- ## Container
35
- * Build the image using `npm run image-build`.
36
- * Adapt the `examples/config-docker.json` configuration file. Typically only the `connectString` property must be changed.
37
- * Start the container using `docker compose up -d`.
35
+ # Admin Console
36
+
37
+ `web_plsql` includes a built-in Admin Console for real-time monitoring and management of your gateway.
38
+
39
+ ## Features
40
+ - **Dashboard**: Real-time charts showing requests per second and error rates.
41
+ - **Pool Monitoring**: Visual representation of database connection pool usage.
42
+ - **Cache Management**: View and manage the metadata cache.
43
+ - **Access & Error Logs**: Interactive viewers for the server logs.
44
+ - **System Info**: Overview of the server environment and configuration.
45
+
46
+ ## Configuration
47
+ The admin console is enabled by default in the `startServer` API. You can configure it via the `admin` property in the main configuration object.
48
+
49
+ ```typescript
50
+ /**
51
+ * @typedef {object} configAdminType
52
+ * @property {boolean} [enabled=true] - Whether the admin console is enabled.
53
+ * @property {string} [route='/admin'] - The route path for the admin console.
54
+ */
55
+ ```
56
+
57
+ Access the console at `http://localhost:<port>/admin` (e.g., `http://localhost:8080/admin`).
38
58
 
39
59
  # Configuration
40
60
 
@@ -93,6 +113,7 @@ The `startServer` api uses the following configuration object:
93
113
  /**
94
114
  * @typedef {object} configType
95
115
  * @property {number} port - The server port number.
116
+ * @property {configAdminType} [admin] - The admin console configuration.
96
117
  * @property {configStaticType[]} routeStatic - The static routes.
97
118
  * @property {configPlSqlType[]} routePlSql - The PL/SQL routes.
98
119
  * @property {number} [uploadFileSizeLimit] - Maximum size of each uploaded file in bytes or no limit if omitted.
@@ -180,6 +201,8 @@ The following mod_plsql DAD configuration translates to the configuration option
180
201
  - PlsqlRequestValidationFunction -> routePlSql[].pathAliasProcedure
181
202
  - PlsqlExclusionList
182
203
  - Basic and custom authentication methods, based on the OWA_SEC package and custom packages.
204
+ - Caching of procedure metadata and validation results for high performance.
205
+ - Real-time monitoring and management via a built-in Admin Console.
183
206
 
184
207
  ## Features that are only available in web_plsql
185
208
  - The option `transactionModeType` specifies an optional transaction mode.
@@ -213,6 +236,3 @@ The following mod_plsql DAD configuration translates to the configuration option
213
236
 
214
237
  [downloads-image]: https://img.shields.io/npm/dm/web_plsql.svg
215
238
  [downloads-url]: https://npmjs.org/package/web_plsql
216
-
217
- [appveyor-image]: https://ci.appveyor.com/api/projects/status/github/doberkofler/web_plsql?branch=master&svg=true
218
- [appveyor-url]: https://ci.appveyor.com/project/doberkofler/web-plsql
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web_plsql",
3
- "version": "0.18.0",
3
+ "version": "1.2.0",
4
4
  "author": "Dieter Oberkofler <dieter.oberkofler@gmail.com>",
5
5
  "license": "MIT",
6
6
  "description": "The Express Middleware for Oracle PL/SQL",
@@ -43,14 +43,18 @@
43
43
  "types": "./types/index.d.ts",
44
44
  "type": "module",
45
45
  "scripts": {
46
- "lint": "prettier --check --experimental-cli . && eslint . && tsc --noEmit",
46
+ "build": "npm run build:admin",
47
+ "build:admin": "vite build",
48
+ "lint": "prettier --check --experimental-cli . && eslint . && tsc --noEmit && eslint src/admin --config src/admin/js/eslint.config.js",
47
49
  "test": "vitest run",
50
+ "test:perf": "vitest run tests/performance.test.js",
48
51
  "test:coverage": "vitest run --coverage",
52
+ "stylelint": "stylelint \"src/admin/**/*.css\"",
49
53
  "types": "rm -rf types && tsc --noEmit false --declaration true --declarationDir types --emitDeclarationOnly true --allowJs true --target es2020 --module es2020 --moduleResolution node --allowSyntheticDefaultImports true src/*.js",
50
54
  "clean": "shx rm -f *.tgz && shx rm -f *.log",
51
- "ci": "npm run clean && npm run version && npm run types && npm run lint && npm run test:coverage",
52
55
  "version": "node update-version.js",
53
- "create-package": "shx rm -f *.tgz && npm pack",
56
+ "ci": "npm run clean && npm run version && npm run types && npm run build && npm run lint && npm run stylelint && npm run test:coverage",
57
+ "create-package": "npm run ci && shx rm -f *.tgz && npm pack",
54
58
  "image-build": "docker build --no-cache --progress=plain --tag=web_plsql .",
55
59
  "image-save": "docker save web_plsql | gzip > web_plsql.tar.gz"
56
60
  },
@@ -58,6 +62,7 @@
58
62
  "oracledb": "6.10.0"
59
63
  },
60
64
  "dependencies": {
65
+ "chart.js": "^4.5.1",
61
66
  "compression": "1.8.1",
62
67
  "cookie-parser": "1.4.7",
63
68
  "debug": "4.4.3",
@@ -66,26 +71,31 @@
66
71
  "morgan": "1.10.1",
67
72
  "multer": "2.0.2",
68
73
  "rotating-file-stream": "3.2.8",
69
- "zod": "4.3.6"
74
+ "zod": "^4.3.6"
70
75
  },
71
76
  "devDependencies": {
77
+ "@tailwindcss/vite": "^4.1.18",
72
78
  "@types/compression": "1.8.1",
73
79
  "@types/cookie-parser": "1.4.10",
74
80
  "@types/debug": "4.1.12",
75
81
  "@types/morgan": "1.9.10",
76
82
  "@types/multer": "2.0.0",
77
- "@types/node": "25.2.1",
83
+ "@types/node": "25.2.2",
78
84
  "@types/oracledb": "6.10.1",
79
85
  "@types/supertest": "6.0.3",
80
86
  "@vitest/coverage-v8": "^4.0.18",
81
87
  "eslint": "9.39.2",
82
- "eslint-plugin-jsdoc": "62.5.2",
88
+ "eslint-plugin-jsdoc": "62.5.4",
83
89
  "oracledb": "6.10.0",
84
90
  "prettier": "3.8.1",
85
91
  "shx": "0.4.0",
92
+ "stylelint": "^17.1.1",
93
+ "stylelint-config-standard": "^40.0.0",
86
94
  "supertest": "7.2.2",
95
+ "tailwindcss": "^4.1.18",
87
96
  "typescript": "5.9.3",
88
97
  "typescript-eslint": "8.54.0",
98
+ "vite": "^7.3.1",
89
99
  "vitest": "^4.0.18"
90
100
  }
91
101
  }