From 7cfb5912faaf7b7e2ac085b944ed2f9eb93cf7cd Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Sat, 18 May 2024 02:27:38 +0530 Subject: [PATCH] webservice: automatically handle async errors --- bot-monitor/web-endpoint.ts | 73 ++-- db-tabulator/web-endpoint.ts | 1 + dyk-counts/web-endpoint.ts | 1 + most-gans/web-endpoint.ts | 1 + package-lock.json | 653 ++++++++++++++++++++++++----- package.json | 3 +- utils.ts | 3 +- webservice/package-lock.json | 15 + webservice/package.json | 1 + webservice/routes/articlesearch.ts | 1 + webservice/routes/summary.ts | 1 + 11 files changed, 598 insertions(+), 155 deletions(-) diff --git a/bot-monitor/web-endpoint.ts b/bot-monitor/web-endpoint.ts index af3ed79..74c9c57 100644 --- a/bot-monitor/web-endpoint.ts +++ b/bot-monitor/web-endpoint.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import {alertsDb} from "./AlertsDb"; import {bot} from "../botbase"; import {CustomError} from "../utils"; @@ -8,47 +9,43 @@ const router = express.Router(); alertsDb.connect(); router.all('/pause', async (req, res, next) => { - try { - const { task, webKey } = req.query as Record; - const { date, unpause } = req.body as Record; - if (!webKey || !task) { - return next(new CustomError(400, "Missing one of required query params: task, webKey")); - } + const { task, webKey } = req.query as Record; + const { date, unpause } = req.body as Record; + if (!webKey || !task) { + return next(new CustomError(400, "Missing one of required query params: task, webKey")); + } - let current = ''; - let dateVal = ''; - if (date) { // POST - const tillDate = new bot.Date(date); - tillDate.setUTCHours(23, 59, 59); // pause till end of selected day - const rowsUpdated = await alertsDb.setPausedTillTime(task, webKey, tillDate); - if (!rowsUpdated) { - return next(new CustomError(403, "Unauthorized")); - } - current = `Successfully paused notifications till ${tillDate.format('D MMMM YYYY')} (UTC).`; - dateVal = tillDate.format('YYYY-MM-DD'); - } else if (unpause) { // POST - const rowsUpdated = await alertsDb.setPausedTillTime(task, webKey); - if (!rowsUpdated) { - return next(new CustomError(403, "Unauthorized")); - } - current = `Successfully unpaused notifications.`; - } else { // GET - let pausedTill = await alertsDb.getPausedTillTime(task, webKey); - if (pausedTill) { - current = `Notifications are currently paused till ${pausedTill.format('D MMMM YYYY')} (UTC).`; - dateVal = pausedTill.format('YYYY-MM-DD'); - } + let current = ''; + let dateVal = ''; + if (date) { // POST + const tillDate = new bot.Date(date); + tillDate.setUTCHours(23, 59, 59); // pause till end of selected day + const rowsUpdated = await alertsDb.setPausedTillTime(task, webKey, tillDate); + if (!rowsUpdated) { + return next(new CustomError(403, "Unauthorized")); + } + current = `Successfully paused notifications till ${tillDate.format('D MMMM YYYY')} (UTC).`; + dateVal = tillDate.format('YYYY-MM-DD'); + } else if (unpause) { // POST + const rowsUpdated = await alertsDb.setPausedTillTime(task, webKey); + if (!rowsUpdated) { + return next(new CustomError(403, "Unauthorized")); + } + current = `Successfully unpaused notifications.`; + } else { // GET + let pausedTill = await alertsDb.getPausedTillTime(task, webKey); + if (pausedTill) { + current = `Notifications are currently paused till ${pausedTill.format('D MMMM YYYY')} (UTC).`; + dateVal = pausedTill.format('YYYY-MM-DD'); } - - return res.render('bot-monitor/web-endpoint', { - task, - webKey, - current, - dateVal - }); - } catch (e) { - next(e); } + + return res.render('bot-monitor/web-endpoint', { + task, + webKey, + current, + dateVal + }); }); diff --git a/db-tabulator/web-endpoint.ts b/db-tabulator/web-endpoint.ts index b8ff0ec..cc6bc91 100644 --- a/db-tabulator/web-endpoint.ts +++ b/db-tabulator/web-endpoint.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import { checkShutoff, fetchQueriesForPage, diff --git a/dyk-counts/web-endpoint.ts b/dyk-counts/web-endpoint.ts index be566cb..09b3380 100644 --- a/dyk-counts/web-endpoint.ts +++ b/dyk-counts/web-endpoint.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import { enwikidb } from "../db"; import { getRedisInstance } from "../redis"; diff --git a/most-gans/web-endpoint.ts b/most-gans/web-endpoint.ts index ea2631d..94f22f8 100644 --- a/most-gans/web-endpoint.ts +++ b/most-gans/web-endpoint.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import { toolsdb } from '../db'; import { AuthManager, bot } from "../botbase"; import { TABLE } from '../../SDZeroBot/most-gans/model'; diff --git a/package-lock.json b/package-lock.json index 1792a38..b04c4a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,11 +20,12 @@ "cassandra-driver": "^4.6.4", "eventsource": "^1.0.7", "express": "^4.17.1", + "express-async-errors": "^3.1.1", "jsdom": "^16.2.1", "memory-cache": "^0.2.0", "minimist": "^1.2.5", "moment": "^2.29.1", - "mwn": "0.9.0", + "mwn": "2.0.2", "mysql2": "^2.1.0", "nodemailer": "^6.7.8", "object-hash": "^2.0.3", @@ -61,6 +62,17 @@ "js-tokens": "^4.0.0" } }, + "node_modules/@babel/parser": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz", + "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", @@ -109,6 +121,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, "node_modules/@kubernetes/client-node": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.18.1.tgz", @@ -259,11 +276,6 @@ "@types/node": "*" } }, - "node_modules/@types/eventsource": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.5.tgz", - "integrity": "sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg==" - }, "node_modules/@types/express": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.11.tgz", @@ -285,6 +297,14 @@ "@types/range-parser": "*" } }, + "node_modules/@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "dependencies": { + "@types/sizzle": "*" + } + }, "node_modules/@types/js-yaml": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.5.tgz", @@ -336,6 +356,20 @@ "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" }, + "node_modules/@types/oojs": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/oojs/-/oojs-7.0.6.tgz", + "integrity": "sha512-e6UBEoqJ3bLBvxtPnaFmqkK4HzPwrS3sqfB2dORUmAaShp/T7WhMoYjlwhe+7g748qv7eeX/q4WdOaeeVG2LtA==" + }, + "node_modules/@types/oojs-ui": { + "version": "0.46.4", + "resolved": "https://registry.npmjs.org/@types/oojs-ui/-/oojs-ui-0.46.4.tgz", + "integrity": "sha512-tpQyPjxr6FhMRNaactbjNXkr4uCsKNQMOVNJiAO5AvzxoPddChNZp4gG37Pm80jAeDP11k9ww4durnEjzqqKsQ==", + "dependencies": { + "@types/jquery": "*", + "@types/oojs": "*" + } + }, "node_modules/@types/qs": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", @@ -387,10 +421,15 @@ "@types/node": "*" } }, + "node_modules/@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==" + }, "node_modules/@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==" }, "node_modules/@types/ws": { "version": "8.5.4", @@ -400,6 +439,108 @@ "@types/node": "*" } }, + "node_modules/@vue/compiler-core": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.9.tgz", + "integrity": "sha512-+/Lf68Vr/nFBA6ol4xOtJrW+BQWv3QWKfRwGSm70jtXwfhZNF4R/eRgyVJYoxFRhdCTk/F6g99BP0ffPgZihfQ==", + "dependencies": { + "@babel/parser": "^7.23.3", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.9.tgz", + "integrity": "sha512-nfWubTtLXuT4iBeDSZ5J3m218MjOy42Vp2pmKVuBKo2/BLcrFUX8nCSr/bKRFiJ32R8qbdnnnBgRn9AdU5v0Sg==", + "dependencies": { + "@vue/compiler-core": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.9.tgz", + "integrity": "sha512-wy0CNc8z4ihoDzjASCOCsQuzW0A/HP27+0MDSSICMjVIFzk/rFViezkR3dzH+miS2NDEz8ywMdbjO5ylhOLI2A==", + "dependencies": { + "@babel/parser": "^7.23.3", + "@vue/compiler-core": "3.3.9", + "@vue/compiler-dom": "3.3.9", + "@vue/compiler-ssr": "3.3.9", + "@vue/reactivity-transform": "3.3.9", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5", + "postcss": "^8.4.31", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.9.tgz", + "integrity": "sha512-NO5oobAw78R0G4SODY5A502MGnDNiDjf6qvhn7zD7TJGc8XDeIEw4fg6JU705jZ/YhuokBKz0A5a/FL/XZU73g==", + "dependencies": { + "@vue/compiler-dom": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.9.tgz", + "integrity": "sha512-VmpIqlNp+aYDg2X0xQhJqHx9YguOmz2UxuUJDckBdQCNkipJvfk9yA75woLWElCa0Jtyec3lAAt49GO0izsphw==", + "dependencies": { + "@vue/shared": "3.3.9" + } + }, + "node_modules/@vue/reactivity-transform": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.9.tgz", + "integrity": "sha512-HnUFm7Ry6dFa4Lp63DAxTixUp8opMtQr6RxQCpDI1vlh12rkGIeYqMvJtK+IKyEfEOa2I9oCkD1mmsPdaGpdVg==", + "dependencies": { + "@babel/parser": "^7.23.3", + "@vue/compiler-core": "3.3.9", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.9.tgz", + "integrity": "sha512-xxaG9KvPm3GTRuM4ZyU8Tc+pMVzcu6eeoSRQJ9IE7NmCcClW6z4B3Ij6L4EDl80sxe/arTtQ6YmgiO4UZqRc+w==", + "dependencies": { + "@vue/reactivity": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.9.tgz", + "integrity": "sha512-e7LIfcxYSWbV6BK1wQv9qJyxprC75EvSqF/kQKe6bdZEDNValzeRXEVgiX7AHI6hZ59HA4h7WT5CGvm69vzJTQ==", + "dependencies": { + "@vue/runtime-core": "3.3.9", + "@vue/shared": "3.3.9", + "csstype": "^3.1.2" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.9.tgz", + "integrity": "sha512-w0zT/s5l3Oa3ZjtLW88eO4uV6AQFqU8X5GOgzq7SkQQu6vVr+8tfm+OI2kDBplS/W/XgCBuFXiPw6T5EdwXP0A==", + "dependencies": { + "@vue/compiler-ssr": "3.3.9", + "@vue/shared": "3.3.9" + }, + "peerDependencies": { + "vue": "3.3.9" + } + }, + "node_modules/@vue/shared": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.9.tgz", + "integrity": "sha512-ZE0VTIR0LmYgeyhurPTpy4KzKsuDyQbMSdM49eKkMnT5X4VfFBLysMzjIZhLEFQYjjOVVfbvUDHckwjDFiO2eA==" + }, "node_modules/abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -633,11 +774,11 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", + "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", "dependencies": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.7" } }, "node_modules/axios-cookiejar-support": { @@ -968,14 +1109,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1075,6 +1208,11 @@ "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -1774,6 +1912,11 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -1841,6 +1984,14 @@ "node": ">= 0.10.0" } }, + "node_modules/express-async-errors": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", + "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "peerDependencies": { + "express": "^4.16.2" + } + }, "node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1999,9 +2150,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz", - "integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -2848,6 +2999,14 @@ "node": ">=10" } }, + "node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -3258,21 +3417,22 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mwn": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mwn/-/mwn-0.9.0.tgz", - "integrity": "sha512-eP7lKeGqH/nrTcRHbQVRYcHgoLeWB3oRSRvNYEAQ8DsE9oF86mP/cEinLzBbx6WAYdGUyHh+CdQhRuAEmcurog==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mwn/-/mwn-2.0.2.tgz", + "integrity": "sha512-idb5znyx9E+VrmOJsyrQJ8X/pnk0tFYXKwk0ETh3fswhf0Z81Gd2GDXBsI07oEtUz4lvsWqph+pR7ZxV85TDGA==", "dependencies": { - "@types/eventsource": "^1.1.4", - "@types/node": "^14.11.10", - "@types/tough-cookie": "^4.0.0", - "axios": "^0.21.1", - "axios-cookiejar-support": "^1.0.0", + "@types/node": "^14.14.25", + "@types/tough-cookie": "^4.0.5", + "axios": "^0.25.0", + "axios-cookiejar-support": "^1.0.1", "chalk": "^1.1.3", - "eventsource": "^1.0.7", "form-data": "^3.0.0", "oauth-1.0a": "^2.2.6", - "prettyjson": "^1.1.3", - "tough-cookie": "^4.0.0" + "tough-cookie": "^4.1.3", + "types-mediawiki": "^1.4.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/mwn/node_modules/ansi-regex": { @@ -3368,6 +3528,23 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3575,9 +3752,9 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/nodemailer": { - "version": "6.7.8", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.8.tgz", - "integrity": "sha512-2zaTFGqZixVmTxpJRCFC+Vk5eGRd/fYtvIR+dl5u9QXLTQWGIf48x/JXvo58g9sa0bU6To04XUv554Paykum3g==", + "version": "6.9.13", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.13.tgz", + "integrity": "sha512-7o38Yogx6krdoBf3jCAqnIN4oSQFx+fMa0I7dK1D+me9kBxx12D+/33wSb+fhOCtIxvYJ+4x4IMEhmhCKfAiOA==", "engines": { "node": ">=6.0.0" } @@ -3931,6 +4108,11 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, "node_modules/picomatch": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", @@ -3943,6 +4125,33 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3952,18 +4161,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prettyjson": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", - "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", - "dependencies": { - "colors": "^1.1.2", - "minimist": "^1.2.0" - }, - "bin": { - "prettyjson": "bin/prettyjson" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -4452,6 +4649,14 @@ "node": ">=8" } }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", @@ -4790,13 +4995,14 @@ } }, "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { "node": ">=6" @@ -4989,11 +5195,21 @@ "node": ">= 0.6" } }, + "node_modules/types-mediawiki": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/types-mediawiki/-/types-mediawiki-1.7.0.tgz", + "integrity": "sha512-N5z9etgWf2ZUdpj1mXhZ42IQX/P9/j6z7IFFxkgtUjLUFEsc4hd6RlPGGylf05+36wUrnxPpKTdeH1NNFKloWQ==", + "dependencies": { + "@types/jquery": "^3.5.5", + "@types/oojs-ui": "^0.46.0", + "vue": "3.3.9" + } + }, "node_modules/typescript": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5023,9 +5239,9 @@ "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" }, "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "engines": { "node": ">= 4.0.0" } @@ -5047,9 +5263,9 @@ } }, "node_modules/url-parse": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", - "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -5103,6 +5319,26 @@ "extsprintf": "^1.2.0" } }, + "node_modules/vue": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.9.tgz", + "integrity": "sha512-sy5sLCTR8m6tvUk1/ijri3Yqzgpdsmxgj6n6yl7GXXCXqVbmW2RCXe9atE4cEI6Iv7L89v5f35fZRRr5dChP9w==", + "dependencies": { + "@vue/compiler-dom": "3.3.9", + "@vue/compiler-sfc": "3.3.9", + "@vue/runtime-dom": "3.3.9", + "@vue/server-renderer": "3.3.9", + "@vue/shared": "3.3.9" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -5438,6 +5674,11 @@ "js-tokens": "^4.0.0" } }, + "@babel/parser": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz", + "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==" + }, "@eslint/eslintrc": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", @@ -5476,6 +5717,11 @@ } } }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, "@kubernetes/client-node": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.18.1.tgz", @@ -5591,11 +5837,6 @@ "@types/node": "*" } }, - "@types/eventsource": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.5.tgz", - "integrity": "sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg==" - }, "@types/express": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.11.tgz", @@ -5617,6 +5858,14 @@ "@types/range-parser": "*" } }, + "@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "requires": { + "@types/sizzle": "*" + } + }, "@types/js-yaml": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.5.tgz", @@ -5668,6 +5917,20 @@ "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" }, + "@types/oojs": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/oojs/-/oojs-7.0.6.tgz", + "integrity": "sha512-e6UBEoqJ3bLBvxtPnaFmqkK4HzPwrS3sqfB2dORUmAaShp/T7WhMoYjlwhe+7g748qv7eeX/q4WdOaeeVG2LtA==" + }, + "@types/oojs-ui": { + "version": "0.46.4", + "resolved": "https://registry.npmjs.org/@types/oojs-ui/-/oojs-ui-0.46.4.tgz", + "integrity": "sha512-tpQyPjxr6FhMRNaactbjNXkr4uCsKNQMOVNJiAO5AvzxoPddChNZp4gG37Pm80jAeDP11k9ww4durnEjzqqKsQ==", + "requires": { + "@types/jquery": "*", + "@types/oojs": "*" + } + }, "@types/qs": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", @@ -5718,10 +5981,15 @@ "@types/node": "*" } }, + "@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==" + }, "@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==" }, "@types/ws": { "version": "8.5.4", @@ -5731,6 +5999,105 @@ "@types/node": "*" } }, + "@vue/compiler-core": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.9.tgz", + "integrity": "sha512-+/Lf68Vr/nFBA6ol4xOtJrW+BQWv3QWKfRwGSm70jtXwfhZNF4R/eRgyVJYoxFRhdCTk/F6g99BP0ffPgZihfQ==", + "requires": { + "@babel/parser": "^7.23.3", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "@vue/compiler-dom": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.9.tgz", + "integrity": "sha512-nfWubTtLXuT4iBeDSZ5J3m218MjOy42Vp2pmKVuBKo2/BLcrFUX8nCSr/bKRFiJ32R8qbdnnnBgRn9AdU5v0Sg==", + "requires": { + "@vue/compiler-core": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "@vue/compiler-sfc": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.9.tgz", + "integrity": "sha512-wy0CNc8z4ihoDzjASCOCsQuzW0A/HP27+0MDSSICMjVIFzk/rFViezkR3dzH+miS2NDEz8ywMdbjO5ylhOLI2A==", + "requires": { + "@babel/parser": "^7.23.3", + "@vue/compiler-core": "3.3.9", + "@vue/compiler-dom": "3.3.9", + "@vue/compiler-ssr": "3.3.9", + "@vue/reactivity-transform": "3.3.9", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5", + "postcss": "^8.4.31", + "source-map-js": "^1.0.2" + } + }, + "@vue/compiler-ssr": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.9.tgz", + "integrity": "sha512-NO5oobAw78R0G4SODY5A502MGnDNiDjf6qvhn7zD7TJGc8XDeIEw4fg6JU705jZ/YhuokBKz0A5a/FL/XZU73g==", + "requires": { + "@vue/compiler-dom": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "@vue/reactivity": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.9.tgz", + "integrity": "sha512-VmpIqlNp+aYDg2X0xQhJqHx9YguOmz2UxuUJDckBdQCNkipJvfk9yA75woLWElCa0Jtyec3lAAt49GO0izsphw==", + "requires": { + "@vue/shared": "3.3.9" + } + }, + "@vue/reactivity-transform": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.9.tgz", + "integrity": "sha512-HnUFm7Ry6dFa4Lp63DAxTixUp8opMtQr6RxQCpDI1vlh12rkGIeYqMvJtK+IKyEfEOa2I9oCkD1mmsPdaGpdVg==", + "requires": { + "@babel/parser": "^7.23.3", + "@vue/compiler-core": "3.3.9", + "@vue/shared": "3.3.9", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5" + } + }, + "@vue/runtime-core": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.9.tgz", + "integrity": "sha512-xxaG9KvPm3GTRuM4ZyU8Tc+pMVzcu6eeoSRQJ9IE7NmCcClW6z4B3Ij6L4EDl80sxe/arTtQ6YmgiO4UZqRc+w==", + "requires": { + "@vue/reactivity": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "@vue/runtime-dom": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.9.tgz", + "integrity": "sha512-e7LIfcxYSWbV6BK1wQv9qJyxprC75EvSqF/kQKe6bdZEDNValzeRXEVgiX7AHI6hZ59HA4h7WT5CGvm69vzJTQ==", + "requires": { + "@vue/runtime-core": "3.3.9", + "@vue/shared": "3.3.9", + "csstype": "^3.1.2" + } + }, + "@vue/server-renderer": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.9.tgz", + "integrity": "sha512-w0zT/s5l3Oa3ZjtLW88eO4uV6AQFqU8X5GOgzq7SkQQu6vVr+8tfm+OI2kDBplS/W/XgCBuFXiPw6T5EdwXP0A==", + "requires": { + "@vue/compiler-ssr": "3.3.9", + "@vue/shared": "3.3.9" + } + }, + "@vue/shared": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.9.tgz", + "integrity": "sha512-ZE0VTIR0LmYgeyhurPTpy4KzKsuDyQbMSdM49eKkMnT5X4VfFBLysMzjIZhLEFQYjjOVVfbvUDHckwjDFiO2eA==" + }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -5915,11 +6282,11 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", + "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.7" } }, "axios-cookiejar-support": { @@ -6187,11 +6554,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -6275,6 +6637,11 @@ } } }, + "csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -6790,6 +7157,11 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -6865,6 +7237,12 @@ } } }, + "express-async-errors": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", + "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "requires": {} + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -6971,9 +7349,9 @@ "dev": true }, "follow-redirects": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz", - "integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==" + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, "forever-agent": { "version": "0.6.1", @@ -7611,6 +7989,14 @@ "yallist": "^4.0.0" } }, + "magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -7925,21 +8311,19 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mwn": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mwn/-/mwn-0.9.0.tgz", - "integrity": "sha512-eP7lKeGqH/nrTcRHbQVRYcHgoLeWB3oRSRvNYEAQ8DsE9oF86mP/cEinLzBbx6WAYdGUyHh+CdQhRuAEmcurog==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mwn/-/mwn-2.0.2.tgz", + "integrity": "sha512-idb5znyx9E+VrmOJsyrQJ8X/pnk0tFYXKwk0ETh3fswhf0Z81Gd2GDXBsI07oEtUz4lvsWqph+pR7ZxV85TDGA==", "requires": { - "@types/eventsource": "^1.1.4", - "@types/node": "^14.11.10", - "@types/tough-cookie": "^4.0.0", - "axios": "^0.21.1", - "axios-cookiejar-support": "^1.0.0", + "@types/node": "^14.14.25", + "@types/tough-cookie": "^4.0.5", + "axios": "^0.25.0", + "axios-cookiejar-support": "^1.0.1", "chalk": "^1.1.3", - "eventsource": "^1.0.7", "form-data": "^3.0.0", "oauth-1.0a": "^2.2.6", - "prettyjson": "^1.1.3", - "tough-cookie": "^4.0.0" + "tough-cookie": "^4.1.3", + "types-mediawiki": "^1.4.0" }, "dependencies": { "ansi-regex": { @@ -8018,6 +8402,11 @@ } } }, + "nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8187,9 +8576,9 @@ } }, "nodemailer": { - "version": "6.7.8", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.8.tgz", - "integrity": "sha512-2zaTFGqZixVmTxpJRCFC+Vk5eGRd/fYtvIR+dl5u9QXLTQWGIf48x/JXvo58g9sa0bU6To04XUv554Paykum3g==" + "version": "6.9.13", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.13.tgz", + "integrity": "sha512-7o38Yogx6krdoBf3jCAqnIN4oSQFx+fMa0I7dK1D+me9kBxx12D+/33wSb+fhOCtIxvYJ+4x4IMEhmhCKfAiOA==" }, "nopt": { "version": "3.0.6", @@ -8456,27 +8845,33 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, "picomatch": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", "dev": true }, + "postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "prettyjson": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", - "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", - "requires": { - "colors": "^1.1.2", - "minimist": "^1.2.0" - } - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -8869,6 +9264,11 @@ } } }, + "source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==" + }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", @@ -9130,13 +9530,14 @@ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" } }, "tr46": { @@ -9276,11 +9677,21 @@ "mime-types": "~2.1.24" } }, + "types-mediawiki": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/types-mediawiki/-/types-mediawiki-1.7.0.tgz", + "integrity": "sha512-N5z9etgWf2ZUdpj1mXhZ42IQX/P9/j6z7IFFxkgtUjLUFEsc4hd6RlPGGylf05+36wUrnxPpKTdeH1NNFKloWQ==", + "requires": { + "@types/jquery": "^3.5.5", + "@types/oojs-ui": "^0.46.0", + "vue": "3.3.9" + } + }, "typescript": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true + "devOptional": true }, "unbox-primitive": { "version": "1.0.1", @@ -9300,9 +9711,9 @@ "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==" }, "unpipe": { "version": "1.0.0", @@ -9318,9 +9729,9 @@ } }, "url-parse": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", - "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -9362,6 +9773,18 @@ "extsprintf": "^1.2.0" } }, + "vue": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.9.tgz", + "integrity": "sha512-sy5sLCTR8m6tvUk1/ijri3Yqzgpdsmxgj6n6yl7GXXCXqVbmW2RCXe9atE4cEI6Iv7L89v5f35fZRRr5dChP9w==", + "requires": { + "@vue/compiler-dom": "3.3.9", + "@vue/compiler-sfc": "3.3.9", + "@vue/runtime-dom": "3.3.9", + "@vue/server-renderer": "3.3.9", + "@vue/shared": "3.3.9" + } + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index f09b3e0..994c890 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,12 @@ "cassandra-driver": "^4.6.4", "eventsource": "^1.0.7", "express": "^4.17.1", + "express-async-errors": "^3.1.1", "jsdom": "^16.2.1", "memory-cache": "^0.2.0", "minimist": "^1.2.5", "moment": "^2.29.1", - "mwn": "0.9.0", + "mwn": "2.0.2", "mysql2": "^2.1.0", "nodemailer": "^6.7.8", "object-hash": "^2.0.3", diff --git a/utils.ts b/utils.ts index d23cb69..11b6fca 100644 --- a/utils.ts +++ b/utils.ts @@ -2,6 +2,7 @@ import { bot, fs, log } from "./botbase"; import { spawn } from "child_process"; import { ENWIKI_DB_HOST, TOOLS_DB_HOST } from "./db"; import { REDIS_HOST } from "./redis"; +import {SECOND} from "./millis"; export function readFile(file: string) { try { @@ -84,7 +85,7 @@ export async function createLocalSSHTunnel(host: string, localPort?: number, rem detached: true }) ); - await bot.sleep(5000); + await bot.sleep(5 * SECOND); } } diff --git a/webservice/package-lock.json b/webservice/package-lock.json index 0ff5c0e..3f18422 100644 --- a/webservice/package-lock.json +++ b/webservice/package-lock.json @@ -12,6 +12,7 @@ "cors": "^2.8.5", "debug": "~2.6.9", "express": "~4.16.1", + "express-async-errors": "^3.1.1", "express-redis-cache": "^1.1.3", "hbs": "~4.0.4", "http-errors": "~1.6.3", @@ -1072,6 +1073,14 @@ "node": ">= 0.10.0" } }, + "node_modules/express-async-errors": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", + "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "peerDependencies": { + "express": "^4.16.2" + } + }, "node_modules/express-redis-cache": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/express-redis-cache/-/express-redis-cache-1.1.3.tgz", @@ -3678,6 +3687,12 @@ } } }, + "express-async-errors": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", + "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "requires": {} + }, "express-redis-cache": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/express-redis-cache/-/express-redis-cache-1.1.3.tgz", diff --git a/webservice/package.json b/webservice/package.json index 1dcdac5..bad3442 100644 --- a/webservice/package.json +++ b/webservice/package.json @@ -14,6 +14,7 @@ "cors": "^2.8.5", "debug": "~2.6.9", "express": "~4.16.1", + "express-async-errors": "^3.1.1", "express-redis-cache": "^1.1.3", "hbs": "~4.0.4", "http-errors": "~1.6.3", diff --git a/webservice/routes/articlesearch.ts b/webservice/routes/articlesearch.ts index d791e10..ec3e02d 100644 --- a/webservice/routes/articlesearch.ts +++ b/webservice/routes/articlesearch.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import { JSDOM } from 'jsdom'; import { bot, TextExtractor } from '../../../SDZeroBot/botbase'; import { numericArg } from "../utils"; diff --git a/webservice/routes/summary.ts b/webservice/routes/summary.ts index 3b6d698..69a555a 100644 --- a/webservice/routes/summary.ts +++ b/webservice/routes/summary.ts @@ -1,4 +1,5 @@ import * as express from "express"; +import 'express-async-errors'; import {bot, TextExtractor} from '../../../SDZeroBot/botbase'; const router = express.Router();