diff --git a/Client/.eslintrc.cjs b/Client/.eslintrc.cjs index 3d78f264f..7d6029d4b 100644 --- a/Client/.eslintrc.cjs +++ b/Client/.eslintrc.cjs @@ -14,5 +14,6 @@ module.exports = { rules: { "react/jsx-no-target-blank": "off", "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], + "react/no-unescaped-entities": "off", }, }; diff --git a/Client/package-lock.json b/Client/package-lock.json index b66c62dd1..1a610787f 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -20,8 +20,8 @@ "@reduxjs/toolkit": "2.2.5", "axios": "^1.7.4", "chart.js": "^4.4.3", - "dayjs": "1.11.11", - "joi": "17.13.1", + "dayjs": "1.11.13", + "joi": "17.13.3", "jwt-decode": "^4.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -29,7 +29,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.13.0-alpha.4", + "recharts": "2.13.0", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, @@ -2304,9 +2304,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.3", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", - "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", + "version": "18.3.11", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.11.tgz", + "integrity": "sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -2314,9 +2314,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.3.0", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", - "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2606,9 +2606,9 @@ } }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -2766,9 +2766,9 @@ } }, "node_modules/chart.js": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.3.tgz", - "integrity": "sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.5.tgz", + "integrity": "sha512-CVVjg1RYTJV9OCC8WeJPMx8gsV8K6WIyIEQUE3ui4AR9Hfgls9URri6Ja3hyMVBbTF8Q2KFa19PE815gWcWhng==", "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" @@ -3051,9 +3051,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.11", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", - "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==", + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", "license": "MIT" }, "node_modules/debug": { @@ -4686,9 +4686,9 @@ } }, "node_modules/joi": { - "version": "17.13.1", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.1.tgz", - "integrity": "sha512-vaBlIKCyo4FCUtCm7Eu4QZd/q02bWcxfUO6YSXAZOWF6gzcLBeba8kwotUdYJjDLW8Cz8RywsSOqiNJZW0mNvg==", + "version": "17.13.3", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", + "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.3.0", @@ -5448,9 +5448,9 @@ } }, "node_modules/react-toastify": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", - "integrity": "sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==", + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.6.tgz", + "integrity": "sha512-yYjp+omCDf9lhZcrZHKbSq7YMuK0zcYkDFTzfRFgTXkTFHZ1ToxwAonzA4JI5CxA91JpjFLmwEsZEgfYfOqI1A==", "license": "MIT", "dependencies": { "clsx": "^2.1.0" @@ -5477,9 +5477,9 @@ } }, "node_modules/recharts": { - "version": "2.13.0-alpha.4", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.13.0-alpha.4.tgz", - "integrity": "sha512-K9naL6F7pEcDYJE6yFQASSCQecSLPP0JagnvQ9hPtA/aHgsxsnIOjouLP5yrFZehxzfCkV5TEORr7/uNtSr7Qw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.13.0.tgz", + "integrity": "sha512-sbfxjWQ+oLWSZEWmvbq/DFVdeRLqqA6d0CDjKx2PkxVVdoXo16jvENCE+u/x7HxOO+/fwx//nYRwb8p8X6s/lQ==", "license": "MIT", "dependencies": { "clsx": "^2.0.0", @@ -6234,9 +6234,9 @@ } }, "node_modules/vite": { - "version": "5.4.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", - "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", + "version": "5.4.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", + "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", "license": "MIT", "dependencies": { "esbuild": "^0.21.3", diff --git a/Client/package.json b/Client/package.json index 7f9b3db2c..1946c8e54 100644 --- a/Client/package.json +++ b/Client/package.json @@ -22,8 +22,8 @@ "@reduxjs/toolkit": "2.2.5", "axios": "^1.7.4", "chart.js": "^4.4.3", - "dayjs": "1.11.11", - "joi": "17.13.1", + "dayjs": "1.11.13", + "joi": "17.13.3", "jwt-decode": "^4.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -31,7 +31,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.13.0-alpha.4", + "recharts": "2.13.0", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, diff --git a/Client/src/Components/Dialog/genericDialog.jsx b/Client/src/Components/Dialog/genericDialog.jsx new file mode 100644 index 000000000..eb1c287d3 --- /dev/null +++ b/Client/src/Components/Dialog/genericDialog.jsx @@ -0,0 +1,67 @@ +import { useId } from "react"; +import PropTypes from "prop-types"; +import { Modal, Stack, Typography } from "@mui/material"; + +const GenericDialog = ({ title, description, open, onClose, theme, children }) => { + const titleId = useId(); + const descriptionId = useId(); + const ariaDescribedBy = description?.length > 0 ? descriptionId : ""; + return ( + + + + {title} + + {description && ( + + {description} + + )} + {children} + + + ); +}; + +GenericDialog.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + open: PropTypes.bool.isRequired, + onClose: PropTypes.func.isRequired, + theme: PropTypes.object.isRequired, + children: PropTypes.element.isRequired, +}; + +export { GenericDialog }; diff --git a/Client/src/Components/Dialog/index.jsx b/Client/src/Components/Dialog/index.jsx index 55ec801d7..fdc34c0c1 100644 --- a/Client/src/Components/Dialog/index.jsx +++ b/Client/src/Components/Dialog/index.jsx @@ -1,103 +1,62 @@ -import LoadingButton from "@mui/lab/LoadingButton"; -import { Button, Modal, Stack, Typography } from "@mui/material"; import PropTypes from "prop-types"; +import LoadingButton from "@mui/lab/LoadingButton"; +import { Button, Stack } from "@mui/material"; +import { GenericDialog } from "./genericDialog"; + const Dialog = ({ - modelTitle, - modelDescription, - open, - onClose, title, - confirmationBtnLbl, - confirmationBtnOnClick, - cancelBtnLbl, - cancelBtnOnClick, - theme, - isLoading, description, + open, + theme, + onCancel, + confirmationButtonLabel, + onConfirm, + isLoading, }) => { return ( - - - {title} - - {description && ( - - {description} - - )} - + - - - {confirmationBtnLbl} - - + {confirmationButtonLabel} + - + ); }; Dialog.propTypes = { - modelTitle: PropTypes.string.isRequired, - modelDescription: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + description: PropTypes.string, open: PropTypes.bool.isRequired, onClose: PropTypes.func.isRequired, - title: PropTypes.string.isRequired, - confirmationBtnLbl: PropTypes.string.isRequired, - confirmationBtnOnClick: PropTypes.func.isRequired, - cancelBtnLbl: PropTypes.string.isRequired, - cancelBtnOnClick: PropTypes.func.isRequired, theme: PropTypes.object.isRequired, + onCancel: PropTypes.func.isRequired, + confirmationButtonLabel: PropTypes.string.isRequired, + onConfirm: PropTypes.func.isRequired, isLoading: PropTypes.bool.isRequired, - description: PropTypes.string, }; export default Dialog; diff --git a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx index 999e026c7..710d6a59f 100644 --- a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx +++ b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx @@ -1,7 +1,7 @@ import { useTheme } from "@emotion/react"; import { useRef, useState } from "react"; import TabPanel from "@mui/lab/TabPanel"; -import { Box, Button, Divider, Modal, Stack, Typography } from "@mui/material"; +import { Box, Button, Divider, Stack, Typography } from "@mui/material"; import Avatar from "../../Avatar"; import Field from "../../Inputs/Field"; import ImageField from "../../Inputs/Image"; @@ -15,6 +15,8 @@ import { clearUptimeMonitorState } from "../../../Features/UptimeMonitors/uptime import { createToast } from "../../../Utils/toastUtils"; import { logger } from "../../../Utils/Logger"; import LoadingButton from "@mui/lab/LoadingButton"; +import { GenericDialog } from "../../Dialog/genericDialog"; +import Dialog from "../../Dialog"; /** * ProfilePanel component displays a form for editing user profile information @@ -369,158 +371,82 @@ const ProfilePanel = () => { )} {/* TODO - Update ModalPopup Component with @mui for reusability */} - setIsOpen("")} - disablePortal - > - - - Really delete this account? - - - If you delete your account, you will no longer be able to sign in, and all of - your data will be deleted. Deleting your account is permanent and - non-recoverable action. - - - - - Delete account - - - - - setIsOpen("")} + confirmationButtonLabel={"Delete account"} + onConfirm={handleDeleteAccount} + isLoading={isLoading} + /> + + - - - Upload Image - - + {progress.isLoading || progress.value !== 0 || errors["picture"] ? ( + } + label={file?.name} + size={file?.size} + progress={progress.value} + onClick={removePicture} + error={errors["picture"]} /> - {progress.isLoading || progress.value !== 0 || errors["picture"] ? ( - } - label={file?.name} - size={file?.size} - progress={progress.value} - onClick={removePicture} - error={errors["picture"]} - /> - ) : ( - "" - )} - + - - + Remove + + - + ); }; diff --git a/Client/src/Components/TabPanels/Account/TeamPanel.jsx b/Client/src/Components/TabPanels/Account/TeamPanel.jsx index 33218bcbb..7d9171384 100644 --- a/Client/src/Components/TabPanels/Account/TeamPanel.jsx +++ b/Client/src/Components/TabPanels/Account/TeamPanel.jsx @@ -1,6 +1,6 @@ import { useTheme } from "@emotion/react"; import TabPanel from "@mui/lab/TabPanel"; -import { Box, Button, ButtonGroup, Modal, Stack, Typography } from "@mui/material"; +import { Button, ButtonGroup, Stack, Typography } from "@mui/material"; import { useEffect, useState } from "react"; import Field from "../../Inputs/Field"; import { credentials } from "../../../Validation/validation"; @@ -10,6 +10,7 @@ import { useSelector } from "react-redux"; import BasicTable from "../../BasicTable"; import Select from "../../Inputs/Select"; import LoadingButton from "@mui/lab/LoadingButton"; +import { GenericDialog } from "../../Dialog/genericDialog"; /** * TeamPanel component manages the organization and team members, @@ -31,10 +32,10 @@ const TeamPanel = () => { const { authToken, user } = useSelector((state) => state.auth); //TODO - const [orgStates, setOrgStates] = useState({ - name: "Bluewave Labs", - isEdit: false, - }); + // const [orgStates, setOrgStates] = useState({ + // name: "Bluewave Labs", + // isEdit: false, + // }); const [toInvite, setToInvite] = useState({ email: "", role: ["0"], @@ -134,10 +135,10 @@ const TeamPanel = () => { }, [errors, toInvite.email]); // RENAME ORGANIZATION - const toggleEdit = () => { - setOrgStates((prev) => ({ ...prev, isEdit: !prev.isEdit })); - }; - const handleRename = () => {}; + // const toggleEdit = () => { + // setOrgStates((prev) => ({ ...prev, isEdit: !prev.isEdit })); + // }; + // const handleRename = () => {}; // INVITE MEMBER const [isOpen, setIsOpen] = useState(false); @@ -327,100 +328,65 @@ const TeamPanel = () => { table={"team"} /> - + + - setToInvite((prev) => ({ - ...prev, - role: [event.target.value], - })) - } - items={[ - { _id: "admin", name: "Admin" }, - { _id: "user", name: "User" }, - ]} - /> - - - Cancel - - - Send invite - - + Cancel + + + Send invite + - + ); }; diff --git a/Client/src/Pages/AdvancedSettings/index.jsx b/Client/src/Pages/AdvancedSettings/index.jsx index 12016889f..ce1c89250 100644 --- a/Client/src/Pages/AdvancedSettings/index.jsx +++ b/Client/src/Pages/AdvancedSettings/index.jsx @@ -12,47 +12,45 @@ import { useNavigate } from "react-router"; import { getAppSettings, updateAppSettings } from "../../Features/Settings/settingsSlice"; import { useState, useEffect } from "react"; import Select from "../../Components/Inputs/Select"; -import { advancedSettingsValidation } from "../../Validation/validation"; -import { buildErrors, hasValidationErrors } from "../../Validation/error"; const AdvancedSettings = ({ isAdmin }) => { - const navigate = useNavigate(); - useEffect(() => { - if (!isAdmin) { - navigate("/"); - } - }, [navigate, isAdmin]); + const navigate = useNavigate(); - const theme = useTheme(); - const { authToken } = useSelector((state) => state.auth); - const dispatch = useDispatch(); - const settings = useSelector((state) => state.settings); - const [localSettings, setLocalSettings] = useState({ - apiBaseUrl: "", - logLevel: "debug", - systemEmailHost: "", - systemEmailPort: "", - systemEmailAddress: "", - systemEmailPassword: "", - jwtTTL: "", - dbType: "", - redisHost: "", - redisPort: "", - pagespeedApiKey: "", - }); - const [errors, setErrors] = useState({}); + useEffect(() => { + if (!isAdmin) { + navigate("/"); + } + }, [navigate, isAdmin]); - useEffect(() => { - const getSettings = async () => { - const action = await dispatch(getAppSettings({ authToken })); - if (action.payload?.success) { - setLocalSettings(action.payload.data); - } else { - createToast({ body: "Failed to get settings" }); - } - }; - getSettings(); - }, [authToken, dispatch]); + const theme = useTheme(); + const { authToken } = useSelector((state) => state.auth); + const dispatch = useDispatch(); + const settings = useSelector((state) => state.settings); + const [localSettings, setLocalSettings] = useState({ + apiBaseUrl: "", + logLevel: "debug", + systemEmailHost: "", + systemEmailPort: "", + systemEmailAddress: "", + systemEmailPassword: "", + jwtTTL: "", + dbType: "", + redisHost: "", + redisPort: "", + pagespeedApiKey: "", + }); + + useEffect(() => { + const getSettings = async () => { + const action = await dispatch(getAppSettings({ authToken })); + if (action.payload.success) { + setLocalSettings(action.payload.data); + } else { + createToast({ body: "Failed to get settings" }); + } + }; + getSettings(); + }, [authToken, dispatch]); const logItems = [ { _id: 1, name: "none" }, @@ -74,210 +72,189 @@ const AdvancedSettings = ({ isAdmin }) => { setLocalSettings({ ...localSettings, logLevel: newLogLevel }); }; - const handleChange = (event) => { - const { value, id } = event.target; - setLocalSettings({ ...localSettings, [id]: value }); - const { error } = advancedSettingsValidation.validate( - { [id]: value }, - { - abortEarly: false, - } - ); - setErrors((prev) => { - return buildErrors(prev, id, error); - }); - }; + const handleChange = (event) => { + const { value, id } = event.target; + setLocalSettings({ ...localSettings, [id]: value }); + }; - const handleSave = async () => { - if (hasValidationErrors(localSettings, advancedSettingsValidation, setErrors)) - return; - const action = await dispatch( - updateAppSettings({ settings: localSettings, authToken }) - ); - let body = ""; - if (action.payload.success) { - console.log(action.payload.data); - setLocalSettings(action.payload.data); - body = "Settings saved successfully"; - } else { - body = "Failed to save settings"; - } - createToast({ body }); - }; + const handleSave = async () => { + const action = await dispatch( + updateAppSettings({ settings: localSettings, authToken }) + ); + let body = ""; + if (action.payload.success) { + console.log(action.payload.data); + setLocalSettings(action.payload.data); + body = "Settings saved successfully"; + } else { + body = "Failed to save settings"; + } + createToast({ body }); + }; - return ( - - - - - Client settings - - Modify client settings here. - - - - - + + + + + Email settings + + Set your host email settings here. These settings are used for sending + system emails. + + + + + + + + + + + + Server settings + + Modify server settings here. + + + + + + + + + + + + + About + + + BlueWave Uptime v1.0.0 + + Developed by Bluewave Labs. + + + + + + + Save + + + + + ); }; AdvancedSettings.propTypes = { diff --git a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx index d165523f9..4dbf8f747 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx @@ -28,7 +28,6 @@ import { MS_PER_WEEK, } from "../../../Utils/timeUtils"; import { useNavigate, useParams } from "react-router-dom"; -import { buildErrors, hasValidationErrors } from "../../../Validation/error"; const getDurationAndUnit = (durationInMs) => { if (durationInMs % MS_PER_DAY === 0) { @@ -146,36 +145,46 @@ const CreateMaintenance = () => { return; } - const res = await networkService.getMaintenanceWindowById({ - authToken: authToken, - maintenanceWindowId: maintenanceWindowId, - }); - const maintenanceWindow = res.data.data; - const { name, start, end, repeat, monitorId } = maintenanceWindow; - const startTime = dayjs(start); - const endTime = dayjs(end); - const durationInMs = endTime.diff(startTime, "milliseconds").toString(); - const { duration, durationUnit } = getDurationAndUnit(durationInMs); - const monitor = monitors.find((monitor) => monitor._id === monitorId); - setForm({ - ...form, - name, - repeat: REVERSE_REPEAT_LOOKUP[repeat], - startDate: startTime, - startTime, - duration, - durationUnit, - monitors: monitor ? [monitor] : [], - }); - } catch (error) { - createToast({ body: "Failed to fetch data" }); - logger.error("Failed to fetch monitors", error); - } finally { - setIsLoading(false); - } - }; - fetchMonitors(); - }, [authToken, user]); + const res = await networkService.getMaintenanceWindowById({ + authToken: authToken, + maintenanceWindowId: maintenanceWindowId, + }); + const maintenanceWindow = res.data.data; + const { name, start, end, repeat, monitorId } = maintenanceWindow; + const startTime = dayjs(start); + const endTime = dayjs(end); + const durationInMs = endTime.diff(startTime, "milliseconds").toString(); + const { duration, durationUnit } = getDurationAndUnit(durationInMs); + const monitor = monitors.find((monitor) => monitor._id === monitorId); + setForm({ + ...form, + name, + repeat: REVERSE_REPEAT_LOOKUP[repeat], + startDate: startTime, + startTime, + duration, + durationUnit, + monitors: monitor ? [monitor] : [], + }); + } catch (error) { + createToast({ body: "Failed to fetch data" }); + logger.error("Failed to fetch monitors", error); + } finally { + setIsLoading(false); + } + }; + fetchMonitors(); + }, [authToken, user]); + + const buildErrors = (prev, id, error) => { + const updatedErrors = { ...prev }; + if (error) { + updatedErrors[id] = error.details[0].message; + } else { + delete updatedErrors[id]; + } + return updatedErrors; + }; const handleSearch = (value) => { setSearch(value); @@ -214,17 +223,29 @@ const CreateMaintenance = () => { }); }; - const handleSubmit = async () => { - if(hasValidationErrors(form, maintenanceWindowValidation, setErrors)) - return; - // Build timestamp for maintenance window from startDate and startTime - const start = dayjs(form.startDate) - .set("hour", form.startTime.hour()) - .set("minute", form.startTime.minute()); - // Build end timestamp for maintenance window - const MS_MULTIPLIER = MS_LOOKUP[form.durationUnit]; - const durationInMs = form.duration * MS_MULTIPLIER; - const end = start.add(durationInMs); + const handleSubmit = async () => { + const { error } = maintenanceWindowValidation.validate(form, { + abortEarly: false, + }); + + // If errors, return early + if (error) { + const newErrors = {}; + error.details.forEach((err) => { + newErrors[err.path[0]] = err.message; + }); + setErrors(newErrors); + logger.error(error); + return; + } + // Build timestamp for maintenance window from startDate and startTime + const start = dayjs(form.startDate) + .set("hour", form.startTime.hour()) + .set("minute", form.startTime.minute()); + // Build end timestamp for maintenance window + const MS_MULTIPLIER = MS_LOOKUP[form.durationUnit]; + const durationInMs = form.duration * MS_MULTIPLIER; + const end = start.add(durationInMs); // Get repeat value in milliseconds const repeat = REPEAT_LOOKUP[form.repeat]; diff --git a/Client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx b/Client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx index 088dae988..8928b1e05 100644 --- a/Client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx +++ b/Client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx @@ -2,23 +2,16 @@ import { useState } from "react"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; -import { - Button, - IconButton, - Menu, - MenuItem, - Modal, - Stack, - Typography, -} from "@mui/material"; -import LoadingButton from "@mui/lab/LoadingButton"; +import { IconButton, Menu, MenuItem } from "@mui/material"; import { logger } from "../../../../Utils/Logger"; import Settings from "../../../../assets/icons/settings-bold.svg?react"; import PropTypes from "prop-types"; import { networkService } from "../../../../main"; import { createToast } from "../../../../Utils/toastUtils"; -const ActionsMenu = ({ isAdmin, maintenanceWindow, updateCallback }) => { +import Dialog from "../../../../Components/Dialog"; + +const ActionsMenu = ({ /* isAdmin, */ maintenanceWindow, updateCallback }) => { maintenanceWindow; const { authToken } = useSelector((state) => state.auth); const [anchorEl, setAnchorEl] = useState(null); @@ -155,71 +148,21 @@ const ActionsMenu = ({ isAdmin, maintenanceWindow, updateCallback }) => { Remove - { + theme={theme} + title={"Do you really want to remove this maintenance window?"} + onCancel={(e) => { e.stopPropagation(); setIsOpen(false); }} - > - - - Do you really want to remove this maintenance window? - - - - { - e.stopPropagation(e); - handleRemove(e); - }} - > - Delete - - - - + confirmationButtonLabel={"Delete"} + onConfirm={(e) => { + e.stopPropagation(e); + handleRemove(e); + }} + isLoading={isLoading} + /> ); }; diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Monitors/Configure/index.jsx index 9eb27c478..22cc8618e 100644 --- a/Client/src/Pages/Monitors/Configure/index.jsx +++ b/Client/src/Pages/Monitors/Configure/index.jsx @@ -453,20 +453,17 @@ const Configure = () => { )} + setIsOpen(false)} - title="Do you really want to delete this monitor?" - confirmationBtnLbl="Delete" - confirmationBtnOnClick={handleRemove} - cancelBtnLbl="Cancel" - cancelBtnOnClick={() => setIsOpen(false)} theme={theme} - isLoading={isLoading} + title="Do you really want to delete this monitor?" description="Once deleted, this monitor cannot be retrieved." - > + onCancel={() => setIsOpen(false)} + confirmationButtonLabel="Delete" + onConfirm={handleRemove} + isLoading={isLoading} + /> ); }; diff --git a/Client/src/Pages/Monitors/Home/actionsMenu.jsx b/Client/src/Pages/Monitors/Home/actionsMenu.jsx index fb3bd4b49..7efffa93c 100644 --- a/Client/src/Pages/Monitors/Home/actionsMenu.jsx +++ b/Client/src/Pages/Monitors/Home/actionsMenu.jsx @@ -188,25 +188,25 @@ const ActionsMenu = ({ monitor, isAdmin, updateCallback }) => { )} setIsOpen(false)} + theme={theme} title="Do you really want to delete this monitor?" - confirmationBtnLbl="Delete" - confirmationBtnOnClick={(e) => { - e.stopPropagation(); - handleRemove(e); - }} - cancelBtnLbl="Cancel" - cancelBtnOnClick={(e) => { + description="Once deleted, this monitor cannot be retrieved." + /* Do we need stop propagation? */ + onCancel={(e) => { e.stopPropagation(); setIsOpen(false); }} - theme={theme} + confirmationButtonLabel="Delete" + /* Do we need stop propagation? */ + onConfirm={(e) => { + e.stopPropagation(); + handleRemove(e); + }} isLoading={isLoading} - description="Once deleted, this monitor cannot be retrieved." - > + modelTitle="modal-delete-monitor" + modelDescription="delete-monitor-confirmation" + /> ); }; diff --git a/Client/src/Pages/PageSpeed/Configure/index.jsx b/Client/src/Pages/PageSpeed/Configure/index.jsx index 71f3ff083..222fa733f 100644 --- a/Client/src/Pages/PageSpeed/Configure/index.jsx +++ b/Client/src/Pages/PageSpeed/Configure/index.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; import { useTheme } from "@emotion/react"; -import { Box, Button, Modal, Stack, Tooltip, Typography } from "@mui/material"; +import { Box, Stack, Tooltip, Typography } from "@mui/material"; import { useDispatch, useSelector } from "react-redux"; import { useNavigate, useParams } from "react-router"; import { @@ -25,6 +25,7 @@ import PlayCircleOutlineRoundedIcon from "@mui/icons-material/PlayCircleOutlineR import SkeletonLayout from "./skeleton"; import useUtils from "../../Monitors/utils"; import "./index.css"; +import Dialog from "../../../Components/Dialog"; const PageSpeedConfigure = () => { const theme = useTheme(); @@ -37,6 +38,7 @@ const PageSpeedConfigure = () => { const [monitor, setMonitor] = useState({}); const [errors, setErrors] = useState({}); const { statusColor, pagespeedStatusMsg, determineState } = useUtils(); + const [buttonLoading, setButtonLoading] = useState(false); const idMap = { "monitor-url": "url", "monitor-name": "name", @@ -156,12 +158,14 @@ const PageSpeedConfigure = () => { const [isOpen, setIsOpen] = useState(false); const handleRemove = async (event) => { event.preventDefault(); + setButtonLoading(true); const action = await dispatch(deletePageSpeed({ authToken, monitor })); if (action.meta.requestStatus === "fulfilled") { navigate("/pagespeed"); } else { createToast({ body: "Failed to delete monitor." }); } + setButtonLoading(false); }; return ( @@ -428,69 +432,16 @@ const PageSpeedConfigure = () => { )} - setIsOpen(false)} - disablePortal - > - - - Do you really want to delete this monitor? - - - Once deleted, this monitor cannot be retrieved. - - - - - - - + theme={theme} + title={"Do you really want to delete this monitor?"} + description={"Once deleted, this monitor cannot be retrieved."} + onCancel={() => setIsOpen(false)} + confirmationButtonLabel={"Delete"} + onConfirm={handleRemove} + isLoading={buttonLoading} + /> ); }; diff --git a/Client/src/Pages/Settings/index.jsx b/Client/src/Pages/Settings/index.jsx index ad4085ab6..9a8913c39 100644 --- a/Client/src/Pages/Settings/index.jsx +++ b/Client/src/Pages/Settings/index.jsx @@ -263,18 +263,15 @@ const Settings = ({ isAdmin }) => { setIsOpen(deleteStatsMonitorsInitState)} - title="Do you want to clear all stats?" - confirmationBtnLbl="Yes, clear all stats" - confirmationBtnOnClick={handleClearStats} - cancelBtnLbl="Cancel" - cancelBtnOnClick={() => setIsOpen(deleteStatsMonitorsInitState)} theme={theme} + title="Do you want to clear all stats?" + description="Once deleted, this monitor cannot be retrieved." + onCancel={() => setIsOpen(deleteStatsMonitorsInitState)} + confirmationButtonLabel="Yes, clear all stats" + onConfirm={handleClearStats} isLoading={isLoading || authIsLoading || checksIsLoading} - > + /> )} {isAdmin && ( @@ -314,18 +311,14 @@ const Settings = ({ isAdmin }) => { setIsOpen(deleteStatsMonitorsInitState)} - title="Do you want to remove all monitors?" - confirmationBtnLbl="Yes, clear all monitors" - confirmationBtnOnClick={handleDeleteAllMonitors} - cancelBtnLbl="Cancel" - cancelBtnOnClick={() => setIsOpen(deleteStatsMonitorsInitState)} theme={theme} + title="Do you want to remove all monitors?" + onCancel={() => setIsOpen(deleteStatsMonitorsInitState)} + confirmationButtonLabel="Yes, clear all monitors" + onConfirm={handleDeleteAllMonitors} isLoading={isLoading || authIsLoading || checksIsLoading} - > + /> )} {isAdmin && ( diff --git a/Client/src/Validation/error.js b/Client/src/Validation/error.js deleted file mode 100644 index e205ce7d1..000000000 --- a/Client/src/Validation/error.js +++ /dev/null @@ -1,25 +0,0 @@ -const buildErrors = (prev, id, error) => { - const updatedErrors = { ...prev }; - if (error) { - updatedErrors[id] = error.details[0].message?? "Validation error"; - } else { - delete updatedErrors[id]; - } - return updatedErrors; -}; - -const hasValidationErrors = (form, validation, setErrors) => { - const { error } = validation.validate(form, { - abortEarly: false, - }); - if (error) { - const newErrors = {}; - error.details.forEach((err) => { - newErrors[err.path[0]] = err.message?? "Validation error"; - }); - setErrors(newErrors); - return true; - } - return false; -}; -export { buildErrors, hasValidationErrors }; diff --git a/Client/src/Validation/validation.js b/Client/src/Validation/validation.js index a6ec7688c..c620bdf43 100644 --- a/Client/src/Validation/validation.js +++ b/Client/src/Validation/validation.js @@ -128,43 +128,10 @@ const maintenanceWindowValidation = joi.object({ monitors: joi.array().min(1), }); -const advancedSettingsValidation = joi.object({ - apiBaseUrl: joi.string().uri({ allowRelative: true }).trim().messages({ - "string.empty": "API base url is required.", - "string.uri": "The URL you provided is not valid.", - }), - logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""), - systemEmailHost: joi.string().allow(''), - systemEmailPort: joi.string().allow(''), - systemEmailAddress: joi - .string().allow(''), - systemEmailPassword: joi.string().allow(''), - jwtTTL: joi - .string() - .trim() - .messages({ - "string.empty": "JWT TTL is required." - }), - dbType: joi.string().trim().messages({ - "string.empty": "DB type is required", - }), - redisHost: joi.string().trim().messages({ - "string.empty": "Redis host is required", - }), - redisPort: joi.string().allow('').custom((value, helpers) => { - if(value && isNaN(parseInt(value))){ - return helpers.message("Redit port must be a number") - } - return value - }), - pagespeedApiKey: joi.string().allow('') -}); - export { credentials, imageValidation, monitorValidation, settingsValidation, maintenanceWindowValidation, - advancedSettingsValidation, }; diff --git a/Server/controllers/authController.js b/Server/controllers/authController.js index 4ce5a0e2b..fa59b4d05 100644 --- a/Server/controllers/authController.js +++ b/Server/controllers/authController.js @@ -173,6 +173,65 @@ const loginUser = async (req, res, next) => { } }; +/** + * Generates new auth token if the refresh token is valid + * @async + * @param {Express.Request} req - The Express request object. + * @property {Object} req.headers - The parameter of the request. + * @param {Express.Response} res - The Express response object. + * @param {function} next - The next middleware function. + * @returns {Object} The response object with a success status, a message indicating new auth token is generated. + * @throws {Error} If there is an error during the process such as any of the token is not received + */ +const refreshAuthToken = async (req, res, next) => { + try { + // check for refreshToken + const refreshToken = req.headers["x-refresh-token"]; + + if (!refreshToken) { + // No refresh token provided + const error = new Error(errorMessages.NO_REFRESH_TOKEN); + error.status = 401; + error.service = SERVICE_NAME; + error.method = "refreshAuthToken"; + return next(error); + } + + // Verify refresh token + const appSettings = await req.settingsService.getSettings(); + const { refreshTokenSecret } = appSettings; + jwt.verify(refreshToken, refreshTokenSecret, async (refreshErr, refreshDecoded) => { + if (refreshErr) { + // Invalid or expired refresh token, trigger logout + const errorMessage = + refreshErr.name === "TokenExpiredError" + ? errorMessages.EXPIRED_REFRESH_TOKEN + : errorMessages.INVALID_REFRESH_TOKEN; + const error = new Error(errorMessage); + error.status = 401; + error.service = SERVICE_NAME; + return next(error); + } + }); + // Refresh token is valid and unexpired, generate new access token + const oldAuthToken = getTokenFromHeaders(req.headers); + const { jwtSecret } = await req.settingsService.getSettings(); + const payloadData = jwt.verify(oldAuthToken, jwtSecret, { ignoreExpiration: true }); + // delete old token related data + delete payloadData.iat; + delete payloadData.exp; + const newAuthToken = issueToken(payloadData, tokenType.ACCESS_TOKEN, appSettings); + + return res.status(200).json({ + success: true, + msg: successMessages.AUTH_TOKEN_REFRESHED, + data: { user: payloadData, token: newAuthToken, refreshToken: refreshToken }, + }); + } catch (error) { + next(handleError(error, SERVICE_NAME, "refreshAuthToken")); + } +}; + /** * Edits a user's information. If the user wants to change their password, the current password is checked before updating to the new password. * @async @@ -455,6 +514,7 @@ export { issueToken, registerUser, loginUser, + refreshAuthToken, editUser, checkSuperadminExists, requestRecovery, diff --git a/Server/openapi.json b/Server/openapi.json index da5eed94f..9c3e6d062 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -261,6 +261,77 @@ } } }, + "/auth/refresh": { + "post": { + "tags": [ + "auth" + ], + "description": "Generates a new auth token if the refresh token is valid.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + }, + "required": false + }, + "parameters": [ + { + "name": "x-refresh-token", + "in": "header", + "description": "Refresh token required to generate a new auth token.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "authorization", + "in": "header", + "description": "Old access token, used to extract payload).", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "New access token generated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } + } + }, + "401": { + "description": "Unauthorized or invalid refresh token.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, "/auth/user/{userId}": { "put": { "tags": [ @@ -2502,4 +2573,4 @@ } } } -} \ No newline at end of file +} diff --git a/Server/package-lock.json b/Server/package-lock.json index eb2364064..35b52573b 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -26,7 +26,7 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", - "sharp": "0.33.4", + "sharp": "0.33.5", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", "winston": "^3.13.0" @@ -138,9 +138,9 @@ } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.4.tgz", - "integrity": "sha512-p0suNqXufJs9t3RqLBO6vvrgr5OhgbWp76s5gTRvdmxmuv9E1rcaqGUsl3l4mKVmXPkTkTErXediAui4x+8PSA==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", "cpu": [ "arm64" ], @@ -150,23 +150,19 @@ "darwin" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.2" + "@img/sharp-libvips-darwin-arm64": "1.0.4" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.4.tgz", - "integrity": "sha512-0l7yRObwtTi82Z6ebVI2PnHT8EB2NxBgpK2MiKJZJ7cz32R4lxd001ecMhzzsZig3Yv9oclvqqdV93jo9hy+Dw==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", "cpu": [ "x64" ], @@ -176,23 +172,19 @@ "darwin" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.2" + "@img/sharp-libvips-darwin-x64": "1.0.4" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.2.tgz", - "integrity": "sha512-tcK/41Rq8IKlSaKRCCAuuY3lDJjQnYIW1UXU1kxcEKrfL8WR7N6+rzNoOxoQRJWTAECuKwgAHnPvqXGN8XfkHA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", "cpu": [ "arm64" ], @@ -201,20 +193,14 @@ "os": [ "darwin" ], - "engines": { - "macos": ">=11", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.2.tgz", - "integrity": "sha512-Ofw+7oaWa0HiiMiKWqqaZbaYV3/UGL2wAPeLuJTx+9cXpCRdvQhCLG0IH8YGwM0yGWGLpsF4Su9vM1o6aer+Fw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", "cpu": [ "x64" ], @@ -223,20 +209,14 @@ "os": [ "darwin" ], - "engines": { - "macos": ">=10.13", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.2.tgz", - "integrity": "sha512-iLWCvrKgeFoglQxdEwzu1eQV04o8YeYGFXtfWU26Zr2wWT3q3MTzC+QTCO3ZQfWd3doKHT4Pm2kRmLbupT+sZw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", "cpu": [ "arm" ], @@ -245,20 +225,14 @@ "os": [ "linux" ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.2.tgz", - "integrity": "sha512-x7kCt3N00ofFmmkkdshwj3vGPCnmiDh7Gwnd4nUwZln2YjqPxV1NlTyZOvoDWdKQVDL911487HOueBvrpflagw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", "cpu": [ "arm64" ], @@ -267,20 +241,14 @@ "os": [ "linux" ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.2.tgz", - "integrity": "sha512-cmhQ1J4qVhfmS6szYW7RT+gLJq9dH2i4maq+qyXayUSn9/3iY2ZeWpbAgSpSVbV2E1JUL2Gg7pwnYQ1h8rQIog==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", "cpu": [ "s390x" ], @@ -289,20 +257,14 @@ "os": [ "linux" ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.2.tgz", - "integrity": "sha512-E441q4Qdb+7yuyiADVi5J+44x8ctlrqn8XgkDTwr4qPJzWkaHwD489iZ4nGDgcuya4iMN3ULV6NwbhRZJ9Z7SQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", "cpu": [ "x64" ], @@ -311,20 +273,14 @@ "os": [ "linux" ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.2.tgz", - "integrity": "sha512-3CAkndNpYUrlDqkCM5qhksfE+qSIREVpyoeHIU6jd48SJZViAmznoQQLAv4hVXF7xyUB9zf+G++e2v1ABjCbEQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", "cpu": [ "arm64" ], @@ -333,20 +289,14 @@ "os": [ "linux" ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.2.tgz", - "integrity": "sha512-VI94Q6khIHqHWNOh6LLdm9s2Ry4zdjWJwH56WoiJU7NTeDwyApdZZ8c+SADC8OH98KWNQXnE01UdJ9CSfZvwZw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", "cpu": [ "x64" ], @@ -355,20 +305,14 @@ "os": [ "linux" ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.4.tgz", - "integrity": "sha512-RUgBD1c0+gCYZGCCe6mMdTiOFS0Zc/XrN0fYd6hISIKcDUbAW5NtSQW9g/powkrXYm6Vzwd6y+fqmExDuCdHNQ==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", "cpu": [ "arm" ], @@ -378,23 +322,19 @@ "linux" ], "engines": { - "glibc": ">=2.28", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.2" + "@img/sharp-libvips-linux-arm": "1.0.5" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.4.tgz", - "integrity": "sha512-2800clwVg1ZQtxwSoTlHvtm9ObgAax7V6MTAB/hDT945Tfyy3hVkmiHpeLPCKYqYR1Gcmv1uDZ3a4OFwkdBL7Q==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", "cpu": [ "arm64" ], @@ -404,23 +344,19 @@ "linux" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.2" + "@img/sharp-libvips-linux-arm64": "1.0.4" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.4.tgz", - "integrity": "sha512-h3RAL3siQoyzSoH36tUeS0PDmb5wINKGYzcLB5C6DIiAn2F3udeFAum+gj8IbA/82+8RGCTn7XW8WTFnqag4tQ==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", "cpu": [ "s390x" ], @@ -430,23 +366,19 @@ "linux" ], "engines": { - "glibc": ">=2.31", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.2" + "@img/sharp-libvips-linux-s390x": "1.0.4" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.4.tgz", - "integrity": "sha512-GoR++s0XW9DGVi8SUGQ/U4AeIzLdNjHka6jidVwapQ/JebGVQIpi52OdyxCNVRE++n1FCLzjDovJNozif7w/Aw==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", "cpu": [ "x64" ], @@ -456,23 +388,19 @@ "linux" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.0.2" + "@img/sharp-libvips-linux-x64": "1.0.4" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.4.tgz", - "integrity": "sha512-nhr1yC3BlVrKDTl6cO12gTpXMl4ITBUZieehFvMntlCXFzH2bvKG76tBL2Y/OqhupZt81pR7R+Q5YhJxW0rGgQ==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", "cpu": [ "arm64" ], @@ -482,23 +410,19 @@ "linux" ], "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.2" + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.4.tgz", - "integrity": "sha512-uCPTku0zwqDmZEOi4ILyGdmW76tH7dm8kKlOIV1XC5cLyJ71ENAAqarOHQh0RLfpIpbV5KOpXzdU6XkJtS0daw==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", "cpu": [ "x64" ], @@ -508,45 +432,38 @@ "linux" ], "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.2" + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.4.tgz", - "integrity": "sha512-Bmmauh4sXUsUqkleQahpdNXKvo+wa1V9KhT2pDA4VJGKwnKMJXiSTGphn0gnJrlooda0QxCtXc6RX1XAU6hMnQ==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", "cpu": [ "wasm32" ], "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.1.1" + "@emnapi/runtime": "^1.2.0" }, "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.4.tgz", - "integrity": "sha512-99SJ91XzUhYHbx7uhK3+9Lf7+LjwMGQZMDlO/E/YVJ7Nc3lyDFZPGhjwiYdctoH2BOzW9+TnfqcaMKt0jHLdqw==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", "cpu": [ "ia32" ], @@ -556,19 +473,16 @@ "win32" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.4.tgz", - "integrity": "sha512-3QLocdTRVIrFNye5YocZl+KKpYKP+fksi1QhmOArgx7GyhIbQp/WrJRu176jm8IxromS7RIkzMiMINVdBtC8Aw==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", "cpu": [ "x64" ], @@ -578,10 +492,7 @@ "win32" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" @@ -1106,9 +1017,10 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -1655,11 +1567,12 @@ } }, "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=18" } }, "node_modules/concat-map": { @@ -1738,9 +1651,10 @@ } }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -2205,6 +2119,31 @@ "node": ">= 0.8" } }, + "node_modules/encoding-sniffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", + "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -2268,6 +2207,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-3.0.0.tgz", "integrity": "sha512-w3PwNZJwRxlp47QGzhuEBldEqVHHhh8/tIPcl6ecf2Bou99cdAt0knihBV0Ecc7CGxYduXVBDheH1K2oADRlvw==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -2310,9 +2250,9 @@ } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", @@ -2320,7 +2260,7 @@ "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -3231,21 +3171,66 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/juice": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/juice/-/juice-10.0.0.tgz", - "integrity": "sha512-9f68xmhGrnIi6DBkiiP3rUrQN33SEuaKu1+njX6VgMP+jwZAsnT33WIzlrWICL9matkhYu3OyrqSUP55YTIdGg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/juice/-/juice-11.0.0.tgz", + "integrity": "sha512-sGF8hPz9/Wg+YXbaNDqc1Iuoaw+J/P9lBHNQKXAGc9pPNjCd4fyPai0Zxj7MRtdjMr0lcgk5PjEIkP2b8R9F3w==", + "license": "MIT", "dependencies": { - "cheerio": "^1.0.0-rc.12", - "commander": "^6.1.0", + "cheerio": "^1.0.0", + "commander": "^12.1.0", "mensch": "^0.3.4", "slick": "^1.12.2", - "web-resource-inliner": "^6.0.1" + "web-resource-inliner": "^7.0.0" }, "bin": { "juice": "bin/juice" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.17" + } + }, + "node_modules/juice/node_modules/cheerio": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", + "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", + "license": "MIT", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "encoding-sniffer": "^0.2.0", + "htmlparser2": "^9.1.0", + "parse5": "^7.1.2", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^6.19.5", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=18.17" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/juice/node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" } }, "node_modules/just-extend": { @@ -3573,7 +3558,8 @@ "node_modules/mensch": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/mensch/-/mensch-0.3.4.tgz", - "integrity": "sha512-IAeFvcOnV9V0Yk+bFhYR07O3yNina9ANIN5MoXBKYJ/RLYPurd2d0yw14MDhpr9/momp0WofT1bPUh3hkzdi/g==" + "integrity": "sha512-IAeFvcOnV9V0Yk+bFhYR07O3yNina9ANIN5MoXBKYJ/RLYPurd2d0yw14MDhpr9/momp0WofT1bPUh3hkzdi/g==", + "license": "MIT" }, "node_modules/merge-descriptors": { "version": "1.0.3", @@ -3675,73 +3661,79 @@ } }, "node_modules/mjml": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml/-/mjml-5.0.0-alpha.4.tgz", - "integrity": "sha512-SUdO4F/XYtXkIYKgjC3hO2oplSllb3DRsHxdNNMuyYh0y2HMxVgqjCcViCBLKc8zJrWM4NO5deZwO+8NjLcM2Q==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml/-/mjml-5.0.0-alpha.6.tgz", + "integrity": "sha512-unizId6dKTQSHq1nGnRQqe58kpD7VJu9p+vfMsKO4911/+VCrxkFe0oiwS7Q6XA3rc224MVChO2Mvueyeh16jg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", - "mjml-cli": "5.0.0-alpha.4", - "mjml-core": "5.0.0-alpha.4", - "mjml-preset-core": "5.0.0-alpha.4", - "mjml-validator": "5.0.0-alpha.4" + "mjml-cli": "5.0.0-alpha.6", + "mjml-core": "5.0.0-alpha.6", + "mjml-preset-core": "5.0.0-alpha.6", + "mjml-validator": "5.0.0-alpha.6" }, "bin": { "mjml": "bin/mjml" } }, "node_modules/mjml-accordion": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-accordion/-/mjml-accordion-5.0.0-alpha.4.tgz", - "integrity": "sha512-Mw1DnHRJHwHLqkwAXcRLBHZMYLtw7qqDNJdxISihz5KyY2arc8MbZixoUHCd3M/2zw04J8fU5HJ8WslANrmu9g==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-accordion/-/mjml-accordion-5.0.0-alpha.6.tgz", + "integrity": "sha512-K7FS8HZQsfUNkvwUWMjCmaEEtHRrqEDddyaVoOE6+ir4H6aWAJUZqp1j/USQsYwMI3YAS3UDpqQEOagG4pRDqg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-body": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-body/-/mjml-body-5.0.0-alpha.4.tgz", - "integrity": "sha512-hPa4JpaF7rmKgKdC/DqC9SM97XoXoWPAf8c+8GpSvn/9AwXnt9X0TgBoP7/sUR26N06j26+/fprB7cTiqy/glA==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-body/-/mjml-body-5.0.0-alpha.6.tgz", + "integrity": "sha512-otkINnYsBVbKSYqOz/FmhQruOpYzT10w9+UGcOZdBwv+UqDoKHXAD8QeSFZxr7fDSFhc6qeFAKNSY5uciT1ZuQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-button": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-button/-/mjml-button-5.0.0-alpha.4.tgz", - "integrity": "sha512-4rOobUMBuoDjsnqFgtLMBZMdnTmS8vMLI+ZfrvyyxaPL9RbeISZlbl3/RvxiZjAyctPh92X/PazKhHJyeSSqeg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-button/-/mjml-button-5.0.0-alpha.6.tgz", + "integrity": "sha512-Z+0J6F2hk7QxKydlABna/vcGtTl7WfMWMLH74x9T1VgNylUAZ2TaWOUAo1AbWICgYBmZfNw1UkDj4EFvb+B1LA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-carousel": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-carousel/-/mjml-carousel-5.0.0-alpha.4.tgz", - "integrity": "sha512-cUPIFLoseSlsq0/w/gB5/sMd88P2LCPK+ISllSdvyO4Lo2+uHDlmwMxRCBBIuWJBunqVH9v2Z2MtAIOL6DqJsQ==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-carousel/-/mjml-carousel-5.0.0-alpha.6.tgz", + "integrity": "sha512-G2n6D6smGmQEKGByjR52UD14D/0gtVokaEI4wjG7UjisSGYGbDXJW4thfDv2RdwIoozXyGhJD3vRuHsoCPeFnw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-cli": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-cli/-/mjml-cli-5.0.0-alpha.4.tgz", - "integrity": "sha512-YXaCYxQ64I1DFmlJe5OI6S1U3jbF3CdfSw+IsOTxxY+i0lEyuiqJxLceKA2ogAwMjlZEm1BBGENqNnvDjeXmUw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-cli/-/mjml-cli-5.0.0-alpha.6.tgz", + "integrity": "sha512-mHmw5MCLNImcUUnYwl1yPF3meAd2EApnriMp8DTEN3zCqXsMg1RV8EB1npp4Camwz8HvVMTvEjSoVotwNWxAMg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "chokidar": "^3.0.0", "glob": "^10.3.10", "lodash": "^4.17.21", "minimatch": "^9.0.3", - "mjml-core": "5.0.0-alpha.4", - "mjml-parser-xml": "5.0.0-alpha.4", - "mjml-validator": "5.0.0-alpha.4", + "mjml-core": "5.0.0-alpha.6", + "mjml-parser-xml": "5.0.0-alpha.6", + "mjml-validator": "5.0.0-alpha.6", "yargs": "^17.7.2" }, "bin": { @@ -3798,172 +3790,188 @@ } }, "node_modules/mjml-column": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-column/-/mjml-column-5.0.0-alpha.4.tgz", - "integrity": "sha512-5gT0YNU+aAjpUxS39ySS2SqL+NLyXkCi4BPutzZTnmz2CvIwrBIOJVEHRAWSjNUWFfFLS4scquI8yO4g8AVfdA==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-column/-/mjml-column-5.0.0-alpha.6.tgz", + "integrity": "sha512-FWpmyCH1kzV3g0P6po1OMVOLTgQXDTbo6z30ew+CylUYnn1w5Vh30T1ZvSPYQDc2jGqjsX1zuWO/JUjOJ5B2RQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-core": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-core/-/mjml-core-5.0.0-alpha.4.tgz", - "integrity": "sha512-QioM27JKUWhCfDbHxY1YnkgpTF0Y+hV1MHy5XeVTQlvIbEeRcO+gAPzhVooGYsKqQL/dWNM9jl34el0peRoscQ==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-core/-/mjml-core-5.0.0-alpha.6.tgz", + "integrity": "sha512-rrGr+xrOCnJ+3V/+LeqA4BCp7jrXiRq0q37FlmSs+etE86yNqMMFMgEFEbeGYTTQO07WuqXlhPSuq85ucAoivg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "cheerio": "1.0.0-rc.12", "cssnano": "^7.0.1", "detect-node": "^2.0.4", "htmlnano": "^2.1.1", - "juice": "^10.0.0", + "juice": "^11.0.0", "lodash": "^4.17.21", - "mjml-parser-xml": "5.0.0-alpha.4", - "mjml-validator": "5.0.0-alpha.4", + "mjml-parser-xml": "5.0.0-alpha.6", + "mjml-validator": "5.0.0-alpha.6", "postcss": "^8.4.33", "prettier": "^3.2.4" } }, "node_modules/mjml-divider": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-divider/-/mjml-divider-5.0.0-alpha.4.tgz", - "integrity": "sha512-sPv5CARR7NX6ohbpJCzErgv3Y1rUnmtOs3SeiEgp4Y9J+O+wKaOZa/ffuNHVrxkC26U91e3zmbWItfIILPUgYA==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-divider/-/mjml-divider-5.0.0-alpha.6.tgz", + "integrity": "sha512-lw0rQNn2Y4LRcF/ad4JUjVRsyXhYXdaos6yOXPFjRN8aK1T4p7XctZyP5RMl7m8YfXTNxxyN//hN3bQI5DwvgQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-group": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-group/-/mjml-group-5.0.0-alpha.4.tgz", - "integrity": "sha512-V+YuKGwL6JMTAnvTsKQM4wF6VPiHCgo92aN9iNuY46N8oYM349pEgrHDBAWRhyZ7UAov/UoPUUJRydJk4PCGyw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-group/-/mjml-group-5.0.0-alpha.6.tgz", + "integrity": "sha512-No9EeJC9GSpqmxfo0laCmUU0w0xhHb3HaliFJPh7YlzObyRE3nvawHtPYpfNW3lgYNl0U7oYMlN9AQum/DaW2Q==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head/-/mjml-head-5.0.0-alpha.4.tgz", - "integrity": "sha512-QF+l4pCYbmTvFPz522k8hbzJgWGmOj16/bTwE+mhGueRRMGmVAp7gCqeNnI9PO/O8zTF7fisgseUuHmAWkCIFg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head/-/mjml-head-5.0.0-alpha.6.tgz", + "integrity": "sha512-owBfZUcwHV2Wjow32QkRNZClbVHIAthacskvowAODUlOfTG1Xj0czlAM6iCG73cSqmZFuocOD9hy47y0l00Qeg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-attributes": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-attributes/-/mjml-head-attributes-5.0.0-alpha.4.tgz", - "integrity": "sha512-EmyiNar6SeaMDcTa8gchUoONfNbUfCjI3eAwjkHy1SfDl5tXKku2W1oXCst8vtNpjoBzllHcTW81x0OpgDM4Cg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-attributes/-/mjml-head-attributes-5.0.0-alpha.6.tgz", + "integrity": "sha512-CW/E+IEw3MOLTWkTMbN6egPwoeg22Iup+fICAH9rmITD6SBJ6f37/MFiACSmpkDQIlWdFokBFFKpikbPWFJKQA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-breakpoint": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-breakpoint/-/mjml-head-breakpoint-5.0.0-alpha.4.tgz", - "integrity": "sha512-S8FBpMKO2wDTJscy6EtQuQRZMu1YSOD5fCZ6sHINWC2A40I1ZFsCAvlLtW/vr9P50XjgX06m1T/vTcYifMCMMQ==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-breakpoint/-/mjml-head-breakpoint-5.0.0-alpha.6.tgz", + "integrity": "sha512-3RsHM0l3VU+NhG4MAsXevLH50s/uOJqbZznGVKkgEBsodKDhFK2ndlmUWZ5ywDO6H2g/qDrZse4c1K43uGoyzA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-font": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-font/-/mjml-head-font-5.0.0-alpha.4.tgz", - "integrity": "sha512-bc/bduI1BljN1rjcF8w5TOBZ+D0eBu5O0BnSqLwoct7xeoTTvYLxuTsdgoloh6Jm1vf3RMqr4ANySDrXvFkoPw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-font/-/mjml-head-font-5.0.0-alpha.6.tgz", + "integrity": "sha512-+HZ/Ppd/hfFgob9M27Tz9qio/vWwyTwjo40PsYSI6zXKmIUHC5icBcHaezUKMDGadgd+11aXlPLVfs6zGb0hVg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-html-attributes": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-html-attributes/-/mjml-head-html-attributes-5.0.0-alpha.4.tgz", - "integrity": "sha512-NJwXgE3o1E3BcVTG6+Hl/ofCZFsoKnjt//Sm/Ks+0u+aZD7VycsF+nXxBlMLOWhMQrP+JIZAok7mYE+A1ztAPg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-html-attributes/-/mjml-head-html-attributes-5.0.0-alpha.6.tgz", + "integrity": "sha512-INI3irUFHozLfJCW0pi/499DhlwqpsFEoGQ++NdHlFH87hbQ2XTNlrTHWpgjhSuiJkRJinPYHphRuNyM3KLyVw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-preview": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-preview/-/mjml-head-preview-5.0.0-alpha.4.tgz", - "integrity": "sha512-cH2VaTVapSeYd+OIfeG7yQtZVDSGqV86iUE4UHasTFpaxcPigpaS5NzAiDL9f7Pzp83q/eL6tdc3r7jX7IHkBQ==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-preview/-/mjml-head-preview-5.0.0-alpha.6.tgz", + "integrity": "sha512-HGLcYmJ7q4aYD5VNTUKIvk6wvpXUawI5j4yl9m+DEhk2ptKYmayxLpjiAvH+LioNuPh0zTCGt7U9f5Ja0948gQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-style": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-style/-/mjml-head-style-5.0.0-alpha.4.tgz", - "integrity": "sha512-7WAsEctOMFOsH8WYrJ/6ZZ2x+m4SKCdpgXWoJwcIVVXiwt/I9C0iGW5b82ZJh0jaGEH5i1dsKMcMcvKnHuiTog==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-style/-/mjml-head-style-5.0.0-alpha.6.tgz", + "integrity": "sha512-yQcHIvZGH641irNt21r4hzODp5rEI/qKJRvGVJ6vzyGm7poYbaoxhK7Re9cRu+xZxLpkiTRgf1DYFjyZN45SiQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-head-title": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-head-title/-/mjml-head-title-5.0.0-alpha.4.tgz", - "integrity": "sha512-GL/LKPkqbyCb0fRrf5NL0Xx/1xX0nF5dVQsmwfH7YdGM8Syx+ging2lrOhRxUic6NE0STXz5H16c0+oisU2HCQ==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-head-title/-/mjml-head-title-5.0.0-alpha.6.tgz", + "integrity": "sha512-m6dGCAItgobZSJ7wlETFPth6rU0+617ZVk1f88Mz5I+YVuOgaAqdNDQWdue5Uj7B19c55NmtdZwsgOKmhHuwow==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-hero": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-hero/-/mjml-hero-5.0.0-alpha.4.tgz", - "integrity": "sha512-KNjc+uEuEs5edlQxkoLnSSQw302M+GSBuGYEO1kThiFeJavZvdCeV9W+bTdeM6i7Cbn+UjfJQPPVaAo+yT6ETg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-hero/-/mjml-hero-5.0.0-alpha.6.tgz", + "integrity": "sha512-OLOKTK/VW4fQOH8yQz1e5kKHfyF0heECghPhmxgnEHigJLbaJy/rmb4x4aq0Lr74Bme8hsMjkR+oktGej1c4iQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-image": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-image/-/mjml-image-5.0.0-alpha.4.tgz", - "integrity": "sha512-9oQJOOav9dWQcl8lUnn0ZVHCKnV/4Z8G6roT5FZBF6yKoqMCcgCJ9Sfhp3KqRzDvTVAsTnM8EzNDC+tBImD6Og==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-image/-/mjml-image-5.0.0-alpha.6.tgz", + "integrity": "sha512-NENjbEOzobM0iQLlxJUNuqiNlFSP5E1DfiP37bY8smYmpVe4MXi5HC5ajTH5ZBKWsTN4/UVZL7t+ZSqniTnS5w==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-navbar": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-navbar/-/mjml-navbar-5.0.0-alpha.4.tgz", - "integrity": "sha512-cMgeW1SeSlqYuMe7knVk/PXkroLwdI/jBopXetJVWFSURJij9AHto6vKmd+/aFlfPC8oWKPBKvEieCwEDgk6Lg==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-navbar/-/mjml-navbar-5.0.0-alpha.6.tgz", + "integrity": "sha512-bj328dixWJqox9CaA/rvIKsTZ7c5g1mN9B0gL2vuzVMXgX4qnXkzIfN2hw98TdffaKGsKXC6N25iIDVocj1RrQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-parser-xml": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-parser-xml/-/mjml-parser-xml-5.0.0-alpha.4.tgz", - "integrity": "sha512-pk2sWuaUgiX2CwbL2qsh1g7Ry110YQMnX84KuIcEnzOQaCyuvGtOGIXuOiOthLRbVnKz15P7EsNnwHRg/d/Ihw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-parser-xml/-/mjml-parser-xml-5.0.0-alpha.6.tgz", + "integrity": "sha512-2gxzFJXBFq6l8f2/HlDq7MBLtWQja0KPSqePxPBOXmNLjqw6bdSflnQu+OhWVptdywuHm907LNIQVIq0wSo2FQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "detect-node": "2.1.0", "htmlparser2": "^9.1.0", - "lodash": "^4.17.15" + "lodash": "^4.17.21" } }, "node_modules/mjml-parser-xml/node_modules/htmlparser2": { @@ -3977,6 +3985,7 @@ "url": "https://github.com/sponsors/fb55" } ], + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -3985,115 +3994,124 @@ } }, "node_modules/mjml-preset-core": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-preset-core/-/mjml-preset-core-5.0.0-alpha.4.tgz", - "integrity": "sha512-V5I+3NJoSV/pFia5MjP5u8BgqJwHqR4KigUjGtOr5chZljyehFNOeL8ghEZ551BCzMrtMzarnChsEnkHI1Qirw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-preset-core/-/mjml-preset-core-5.0.0-alpha.6.tgz", + "integrity": "sha512-6K9sPXlxQfe9Vx/8/wAFW2Sy6ImWU1AP37VG08Ge7Mj117cNeKk3S1piagbj6LpyTd7E7AueO8G+xzvmC5YBBw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", - "mjml-accordion": "5.0.0-alpha.4", - "mjml-body": "5.0.0-alpha.4", - "mjml-button": "5.0.0-alpha.4", - "mjml-carousel": "5.0.0-alpha.4", - "mjml-column": "5.0.0-alpha.4", - "mjml-divider": "5.0.0-alpha.4", - "mjml-group": "5.0.0-alpha.4", - "mjml-head": "5.0.0-alpha.4", - "mjml-head-attributes": "5.0.0-alpha.4", - "mjml-head-breakpoint": "5.0.0-alpha.4", - "mjml-head-font": "5.0.0-alpha.4", - "mjml-head-html-attributes": "5.0.0-alpha.4", - "mjml-head-preview": "5.0.0-alpha.4", - "mjml-head-style": "5.0.0-alpha.4", - "mjml-head-title": "5.0.0-alpha.4", - "mjml-hero": "5.0.0-alpha.4", - "mjml-image": "5.0.0-alpha.4", - "mjml-navbar": "5.0.0-alpha.4", - "mjml-raw": "5.0.0-alpha.4", - "mjml-section": "5.0.0-alpha.4", - "mjml-social": "5.0.0-alpha.4", - "mjml-spacer": "5.0.0-alpha.4", - "mjml-table": "5.0.0-alpha.4", - "mjml-text": "5.0.0-alpha.4", - "mjml-wrapper": "5.0.0-alpha.4" + "mjml-accordion": "5.0.0-alpha.6", + "mjml-body": "5.0.0-alpha.6", + "mjml-button": "5.0.0-alpha.6", + "mjml-carousel": "5.0.0-alpha.6", + "mjml-column": "5.0.0-alpha.6", + "mjml-divider": "5.0.0-alpha.6", + "mjml-group": "5.0.0-alpha.6", + "mjml-head": "5.0.0-alpha.6", + "mjml-head-attributes": "5.0.0-alpha.6", + "mjml-head-breakpoint": "5.0.0-alpha.6", + "mjml-head-font": "5.0.0-alpha.6", + "mjml-head-html-attributes": "5.0.0-alpha.6", + "mjml-head-preview": "5.0.0-alpha.6", + "mjml-head-style": "5.0.0-alpha.6", + "mjml-head-title": "5.0.0-alpha.6", + "mjml-hero": "5.0.0-alpha.6", + "mjml-image": "5.0.0-alpha.6", + "mjml-navbar": "5.0.0-alpha.6", + "mjml-raw": "5.0.0-alpha.6", + "mjml-section": "5.0.0-alpha.6", + "mjml-social": "5.0.0-alpha.6", + "mjml-spacer": "5.0.0-alpha.6", + "mjml-table": "5.0.0-alpha.6", + "mjml-text": "5.0.0-alpha.6", + "mjml-wrapper": "5.0.0-alpha.6" } }, "node_modules/mjml-raw": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-raw/-/mjml-raw-5.0.0-alpha.4.tgz", - "integrity": "sha512-puCKbIuMVFlFyZx1vaKy45iS3iTgFpmFcah5C+E5VnEyKDOB6su6Fs8OnuAHkq+TIdGc6q9kqI1MwlRn0Mrr8w==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-raw/-/mjml-raw-5.0.0-alpha.6.tgz", + "integrity": "sha512-tY2P+g7bcydVHrk0NPPm2sd+rIB9l5TdCeIdtw+NSOXoHN7vXVezcdr7UYK8TePibzeymh8w9YTWEAIN8fWvLg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-section": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-section/-/mjml-section-5.0.0-alpha.4.tgz", - "integrity": "sha512-sbXvB9ik9i1zueCj996LvmiGn7EsZR5E8KXu08My3YxRbIoQrZtYdVOFM//858zDXtE/HB39HcLVXt1sG7GLig==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-section/-/mjml-section-5.0.0-alpha.6.tgz", + "integrity": "sha512-gJL+9t9hiAfnXl3gG481Xum1qzURXs6bZ+rZnU47R/070+kinOJTCHt82hFGctjyDi264r/BeM6H6y+m0FIq/w==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-social": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-social/-/mjml-social-5.0.0-alpha.4.tgz", - "integrity": "sha512-lP+ykZB0wppYulBv1q0xM3kFCoYaKLyROZJgDjzvMlBRUA+p21/nu4JEjqYGdq0gQqoAhLQGW8hOUnEnS0Aydw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-social/-/mjml-social-5.0.0-alpha.6.tgz", + "integrity": "sha512-vPRBYHKeEUwEiVwXLrXgQnWBblizdQTlrZ2V45xEH9+3Jqolw3SlTw+uoZzhcFSBNl7+ytdQgwp7gRC7Bn5IYQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-spacer": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-spacer/-/mjml-spacer-5.0.0-alpha.4.tgz", - "integrity": "sha512-xHEunDOUL7Al3Rs5z20mwJsPllZdClriOptti5DP2hJjPkF2X/nwFTaH/kXvaPd2/CSZGHO+aQ5r/X2huV/43w==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-spacer/-/mjml-spacer-5.0.0-alpha.6.tgz", + "integrity": "sha512-ZyLcoAElvkWnijny2eW0ulX6RxoDQT8AZwv5pJ8O16s0mnfcPAPMaZGTCQZHxPbACKJcCKsIoZrQllQuShf3XA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-table": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-table/-/mjml-table-5.0.0-alpha.4.tgz", - "integrity": "sha512-TCh5IJ6IDkv0bkn/8r7GslEpDiRaRoUonHzbFbsi1rNojayg+oOJbaUhpMh1gvBzVlmAyMeX2XGA92A1EiqJjw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-table/-/mjml-table-5.0.0-alpha.6.tgz", + "integrity": "sha512-ze7iNRyT6uX099KxZoV33u1jOlibmfxkUUY/8BXbyfWUIgcwRzb1DfKtIWT/GOqI2WAqh5ZwHd5XZgueimttEA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-text": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-text/-/mjml-text-5.0.0-alpha.4.tgz", - "integrity": "sha512-yJi6D1hDaKxtJLu0M330yHn0BLo55T9+TaOw9GaWWlF28yphUZ6Ge+ppSZYeMbmzWwCUMVPPOcsYMpaLHtd7Iw==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-text/-/mjml-text-5.0.0-alpha.6.tgz", + "integrity": "sha512-k7/pUgwZo9ZwnoCVvohsGdpOrJuLpScH183ZxjyPYO8+kOruSFpE2yrGhK/jeLaV4UhdXndNk8dz80wbN0fKjw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6" } }, "node_modules/mjml-validator": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-validator/-/mjml-validator-5.0.0-alpha.4.tgz", - "integrity": "sha512-0RWcTmUxluJc6XR/7Wmve9z4ydUGnLTUuyaHWX624V/xOaRPIThCllluh67TbSK6W2t4mwIHCdT+MgQC/wFwog==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-validator/-/mjml-validator-5.0.0-alpha.6.tgz", + "integrity": "sha512-kL5IJGYXdNN7VunXXJEWyAP40oODRiSNu5NIx5moOXREPHvn7lRqi/XS8MXa48/UBLmKMbltDSQ0DcnESJbodQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9" } }, "node_modules/mjml-wrapper": { - "version": "5.0.0-alpha.4", - "resolved": "https://registry.npmjs.org/mjml-wrapper/-/mjml-wrapper-5.0.0-alpha.4.tgz", - "integrity": "sha512-sISlNUC3EVj5YMZfdQw19B9AIwCmgT8XWJ5r6HsBfYtxwdeYBHA/stygx84lEjDYPJK7U5FL65u01vfP71vM/w==", + "version": "5.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/mjml-wrapper/-/mjml-wrapper-5.0.0-alpha.6.tgz", + "integrity": "sha512-qJisqqkQrtq4U74BTgRaNoPjpf2PwYff/QxH5yvkFDXK3fYEoNt011K7lrm/+u5wS9mx4msHZN0WA4TI/EeeOw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "lodash": "^4.17.21", - "mjml-core": "5.0.0-alpha.4", - "mjml-section": "5.0.0-alpha.4" + "mjml-core": "5.0.0-alpha.6", + "mjml-section": "5.0.0-alpha.6" } }, "node_modules/mkdirp": { @@ -4600,9 +4618,10 @@ "license": "MIT" }, "node_modules/nodemailer": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.14.tgz", - "integrity": "sha512-Dobp/ebDKBvz91sbtRKhcznLThrKxKt97GI2FAlAyy+fk19j73Uz3sBXolVtmcXjaorivqsbbbjDY+Jkt4/bQA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.15.tgz", + "integrity": "sha512-AHf04ySLC6CIfuRtRiEYtGEXgRfa6INgWGluDhnxTZhHSKvrBu7lc1VVchQ0d8nPc4cFaZoPq8vkyNoZr0TpGQ==", + "license": "MIT-0", "engines": { "node": ">=6.0.0" } @@ -4841,6 +4860,18 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "license": "MIT", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -5684,9 +5715,10 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -5786,43 +5818,42 @@ "license": "ISC" }, "node_modules/sharp": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.4.tgz", - "integrity": "sha512-7i/dt5kGl7qR4gwPRD2biwD2/SvBn3O04J77XKFgL2OnZtQw+AG9wnuS/csmu80nPRHLYE9E41fyEiG8nhH6/Q==", + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", - "semver": "^7.6.0" + "semver": "^7.6.3" }, "engines": { - "libvips": ">=8.15.2", "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.33.4", - "@img/sharp-darwin-x64": "0.33.4", - "@img/sharp-libvips-darwin-arm64": "1.0.2", - "@img/sharp-libvips-darwin-x64": "1.0.2", - "@img/sharp-libvips-linux-arm": "1.0.2", - "@img/sharp-libvips-linux-arm64": "1.0.2", - "@img/sharp-libvips-linux-s390x": "1.0.2", - "@img/sharp-libvips-linux-x64": "1.0.2", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.2", - "@img/sharp-libvips-linuxmusl-x64": "1.0.2", - "@img/sharp-linux-arm": "0.33.4", - "@img/sharp-linux-arm64": "0.33.4", - "@img/sharp-linux-s390x": "0.33.4", - "@img/sharp-linux-x64": "0.33.4", - "@img/sharp-linuxmusl-arm64": "0.33.4", - "@img/sharp-linuxmusl-x64": "0.33.4", - "@img/sharp-wasm32": "0.33.4", - "@img/sharp-win32-ia32": "0.33.4", - "@img/sharp-win32-x64": "0.33.4" + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" } }, "node_modules/sharp/node_modules/color": { @@ -5978,6 +6009,7 @@ "version": "1.12.2", "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", "integrity": "sha512-4qdtOGcBjral6YIBCWJ0ljFSKNLz9KkhbWtuGvUyRowl1kxfuE1x/Z/aJcaiilpb3do9bl5K7/1h9XC5wWpY/A==", + "license": "MIT (http://mootools.net/license.txt)", "engines": { "node": "*" } @@ -6317,6 +6349,15 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, + "node_modules/undici": { + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.20.1.tgz", + "integrity": "sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==", + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, "node_modules/unfetch": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz", @@ -6411,6 +6452,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/valid-data-url/-/valid-data-url-3.0.1.tgz", "integrity": "sha512-jOWVmzVceKlVVdwjNSenT4PbGghU0SBIizAev8ofZVgivk/TVHXSbNL8LP6M3spZvkR9/QolkyJavGSX5Cs0UA==", + "license": "MIT", "engines": { "node": ">=10" } @@ -6424,15 +6466,15 @@ } }, "node_modules/web-resource-inliner": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/web-resource-inliner/-/web-resource-inliner-6.0.1.tgz", - "integrity": "sha512-kfqDxt5dTB1JhqsCUQVFDj0rmY+4HLwGQIsLPbyrsN9y9WV/1oFDSx3BQ4GfCv9X+jVeQ7rouTqwK53rA/7t8A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/web-resource-inliner/-/web-resource-inliner-7.0.0.tgz", + "integrity": "sha512-NlfnGF8MY9ZUwFjyq3vOUBx7KwF8bmE+ywR781SB0nWB6MoMxN4BA8gtgP1KGTZo/O/AyWJz7HZpR704eaj4mg==", + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", "escape-goat": "^3.0.0", "htmlparser2": "^5.0.0", "mime": "^2.4.6", - "node-fetch": "^2.6.0", "valid-data-url": "^3.0.0" }, "engines": { @@ -6443,6 +6485,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", @@ -6456,6 +6499,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.2.0" }, @@ -6470,6 +6514,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz", "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==", + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.0.1" }, @@ -6484,6 +6529,7 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -6497,6 +6543,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.2.0" }, @@ -6511,6 +6558,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } @@ -6519,6 +6567,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-5.0.1.tgz", "integrity": "sha512-vKZZra6CSe9qsJzh0BjBGXo8dvzNsq/oGvsjfRdOrrryfeD9UOBEEQdeoqCRmKZchF5h2zOBMQ6YuQ0uRUmdbQ==", + "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^3.3.0", @@ -6533,6 +6582,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -6548,6 +6598,39 @@ "node": ">=12" } }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/whatwg-url": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", diff --git a/Server/package.json b/Server/package.json index 6d31c2165..a0f419490 100644 --- a/Server/package.json +++ b/Server/package.json @@ -29,7 +29,7 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", - "sharp": "0.33.4", + "sharp": "0.33.5", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", "winston": "^3.13.0" diff --git a/Server/routes/authRoute.js b/Server/routes/authRoute.js index 11e371654..e19f855db 100644 --- a/Server/routes/authRoute.js +++ b/Server/routes/authRoute.js @@ -11,6 +11,7 @@ const upload = multer(); import { registerUser, loginUser, + refreshAuthToken, editUser, requestRecovery, validateRecovery, @@ -23,6 +24,7 @@ import { //Auth routes router.post("/register", upload.single("profileImage"), registerUser); router.post("/login", loginUser); +router.post("/refresh", refreshAuthToken); router.put("/user/:userId", upload.single("profileImage"), verifyJWT, editUser); router.get("/users/superadmin", checkSuperadminExists); router.get("/users", verifyJWT, isAllowed(["admin", "superadmin"]), getAllUsers); diff --git a/Server/tests/controllers/authController.test.js b/Server/tests/controllers/authController.test.js index 40c4939dd..d9329e54e 100644 --- a/Server/tests/controllers/authController.test.js +++ b/Server/tests/controllers/authController.test.js @@ -2,6 +2,7 @@ import { issueToken, registerUser, loginUser, + refreshAuthToken, editUser, checkSuperadminExists, requestRecovery, @@ -13,8 +14,9 @@ import { import jwt from "jsonwebtoken"; import { errorMessages, successMessages } from "../../utils/messages.js"; import sinon from "sinon"; -import { tokenType } from "../../utils/utils.js"; +import { getTokenFromHeaders, tokenType } from "../../utils/utils.js"; import logger from "../../utils/logger.js"; +import e from "cors"; describe("Auth Controller - issueToken", () => { let stub; @@ -303,6 +305,97 @@ describe("Auth Controller - loginUser", () => { }); }); +describe("Auth Controller - refreshAuthToken", () => { + let req, res, next, issueTokenStub; + + beforeEach(() => { + req = { + headers: { + "x-refresh-token": "valid_refresh_token", + authorization: "Bearer old_auth_token", + }, + settingsService: { + getSettings: sinon.stub().resolves({ + jwtSecret: "my_secret", + refreshTokenSecret: "my_refresh_secret", + }), + }, + }; + res = { + status: sinon.stub().returnsThis(), + json: sinon.stub(), + }; + next = sinon.stub(); + sinon.stub(jwt, "verify"); + + issueTokenStub = sinon.stub().returns("new_auth_token"); + sinon.replace({ issueToken }, "issueToken", issueTokenStub); + }); + + afterEach(() => { + sinon.restore(); + }); + + it("should reject if no refresh token is provided", async () => { + delete req.headers["x-refresh-token"]; + await refreshAuthToken(req, res, next); + + expect(next.firstCall.args[0]).to.be.an("error"); + expect(next.firstCall.args[0].message).to.equal(errorMessages.NO_REFRESH_TOKEN); + expect(next.firstCall.args[0].status).to.equal(401); + }); + + it("should reject if the refresh token is invalid", async () => { + jwt.verify.yields(new Error("invalid token")); + await refreshAuthToken(req, res, next); + + expect(next.firstCall.args[0]).to.be.an("error"); + expect(next.firstCall.args[0].message).to.equal(errorMessages.INVALID_REFRESH_TOKEN); + expect(next.firstCall.args[0].status).to.equal(401); + }); + + it("should reject if the refresh token is expired", async () => { + const error = new Error("Token expired"); + error.name = "TokenExpiredError"; + jwt.verify.yields(error); + await refreshAuthToken(req, res, next); + expect(next.firstCall.args[0]).to.be.an("error"); + expect(next.firstCall.args[0].message).to.equal(errorMessages.EXPIRED_REFRESH_TOKEN); + expect(next.firstCall.args[0].status).to.equal(401); + }); + + it("should reject if settingsService.getSettings fails", async () => { + req.settingsService.getSettings.rejects( + new Error("settingsService.getSettings error") + ); + await refreshAuthToken(req, res, next); + + expect(next.firstCall.args[0]).to.be.an("error"); + expect(next.firstCall.args[0].message).to.equal("settingsService.getSettings error"); + }); + + it("should generate a new auth token if the refresh token is valid", async () => { + const decodedPayload = { expiresIn: "60" }; + jwt.verify.callsFake(() => { + return decodedPayload; + }); + await refreshAuthToken(req, res, next); + + expect(res.status.calledWith(200)).to.be.true; + expect( + res.json.calledWith({ + success: true, + msg: successMessages.AUTH_TOKEN_REFRESHED, + data: { + user: decodedPayload, + token: sinon.match.string, + refreshToken: "valid_refresh_token", + }, + }) + ).to.be.true; + }); +}); + describe("Auth Controller - editUser", async () => { let req, res, next, stub, user; beforeEach(() => { diff --git a/Server/utils/messages.js b/Server/utils/messages.js index a42498d65..dd7f0f76a 100644 --- a/Server/utils/messages.js +++ b/Server/utils/messages.js @@ -62,7 +62,6 @@ const successMessages = { ALERT_EDIT: "Alert edited successfully", ALERT_DELETE: "Alert deleted successfully", - // Auth Controller AUTH_CREATE_USER: "User created successfully", AUTH_LOGIN_USER: "User logged in successfully", AUTH_LOGOUT_USER: "User logged out successfully", @@ -72,6 +71,7 @@ const successMessages = { AUTH_RESET_PASSWORD: "Password reset successfully", AUTH_ADMIN_CHECK: "Admin check completed successfully", AUTH_DELETE_USER: "User deleted successfully", + AUTH_TOKEN_REFRESHED: "Auth token is refreshed", // Check Controller CHECK_CREATE: "Check created successfully",