From 03bb6df4f458f84b669993bc4a4f63f7f3f9136a Mon Sep 17 00:00:00 2001 From: Lisa Liu Date: Mon, 1 Apr 2024 11:31:57 -0700 Subject: [PATCH 1/4] edit branch commit --- backend/src/controllers/program.ts | 28 ++ backend/src/routes/program.ts | 1 + backend/src/validators/program.ts | 20 +- frontend/package-lock.json | 466 ++++++++++++++++------------- 4 files changed, 312 insertions(+), 203 deletions(-) diff --git a/backend/src/controllers/program.ts b/backend/src/controllers/program.ts index 03f42655..2cfef83d 100644 --- a/backend/src/controllers/program.ts +++ b/backend/src/controllers/program.ts @@ -1,11 +1,13 @@ /* eslint-disable @typescript-eslint/no-misused-promises */ import { RequestHandler } from "express"; import { validationResult } from "express-validator"; +//import { error } from "firebase-functions/logger"; import ProgramFormModel from "../models/program-form"; import validationErrorParser from "../util/validationErrorParser"; export type Program = { + _id: string; name: string; abbreviation: string; type: string; @@ -28,3 +30,29 @@ export const createForm: RequestHandler = async (req, res, next) => { next(error); } }; + +export const updateForm: RequestHandler = async (req, res, next) => { + const errors = validationResult(req); + try { + validationErrorParser(errors); + + const programId = req.params.id; + const programData = req.body as Program; + + if (programId !== programData._id) { + return res.status(400).json({ message: "Invalid student ID" }); + } + + const editedProgram = await ProgramFormModel.findOneAndUpdate({ _id: programId }, programData, { + new: true, + }); + + if (!editedProgram) { + return res.status(404).json({ message: "No object in database with provided ID" }); + } + + res.status(200).json(editedProgram); + } catch (error) { + next(error); + } +}; diff --git a/backend/src/routes/program.ts b/backend/src/routes/program.ts index f043d540..783bb32f 100644 --- a/backend/src/routes/program.ts +++ b/backend/src/routes/program.ts @@ -10,5 +10,6 @@ import * as ProgramValidator from "../validators/program"; const router = express.Router(); router.post("/", ProgramValidator.createForm, ProgramController.createForm); +router.patch("/:id", ProgramValidator.updateForm, ProgramController.updateForm); export default router; diff --git a/backend/src/validators/program.ts b/backend/src/validators/program.ts index 488f214c..bc116730 100644 --- a/backend/src/validators/program.ts +++ b/backend/src/validators/program.ts @@ -101,7 +101,14 @@ const makeColorValidator = () => } return true; }); -// check for first chara being # and others being 1-F +const makeIDValidator = () => + // mongoID + body("_id") + .exists() + .withMessage("_id is required") + .bail() + .isMongoId() + .withMessage("_id must be a MongoDB object ID"); export const createForm = [ makeNameValidator(), @@ -112,3 +119,14 @@ export const createForm = [ makeEndDateValidator(), makeColorValidator(), ]; + +export const updateForm = [ + makeIDValidator(), + makeNameValidator(), + makeAbbreviationValidator(), + makeTypeValidator(), + makeDaysOfWeekValidator(), + makeStartDateValidator(), + makeEndDateValidator(), + makeColorValidator(), +]; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5790dfc2..46cfbeed 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -921,20 +921,22 @@ } }, "node_modules/@fastify/busboy": { - "version": "2.1.0", - "license": "MIT", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", "engines": { "node": ">=14" } }, "node_modules/@firebase/analytics": { - "version": "0.10.0", - "license": "Apache-2.0", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.1.tgz", + "integrity": "sha512-5mnH1aQa99J5lZMJwTNzIoRc4yGXHf+fOn+EoEWhCDA3XGPweGHcylCbqq+G1wVJmfILL57fohDMa8ftMZ+44g==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/installations": "0.6.4", + "@firebase/component": "0.6.5", + "@firebase/installations": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -942,13 +944,14 @@ } }, "node_modules/@firebase/analytics-compat": { - "version": "0.2.6", - "license": "Apache-2.0", + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.7.tgz", + "integrity": "sha512-17VCly4P0VFBDqaaal7m1nhyYQwsygtaTpSsnc51sFPRrr9XIYtnD8ficon9fneEGEoJQ2g7OtASvhwX9EbK8g==", "dependencies": { - "@firebase/analytics": "0.10.0", + "@firebase/analytics": "0.10.1", "@firebase/analytics-types": "0.8.0", - "@firebase/component": "0.6.4", - "@firebase/util": "1.9.3", + "@firebase/component": "0.6.5", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -957,26 +960,29 @@ }, "node_modules/@firebase/analytics-types": { "version": "0.8.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.0.tgz", + "integrity": "sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw==" }, "node_modules/@firebase/app": { - "version": "0.9.25", - "license": "Apache-2.0", + "version": "0.9.28", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.9.28.tgz", + "integrity": "sha512-MS0+EtNixrwJbVDs5Bt/lhUhzeWGUtUoP6X+zYZck5GAZwI5g4F91noVA9oIXlFlpn6Q1xIbiaHA2GwGk7/7Ag==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "idb": "7.1.1", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-check": { - "version": "0.8.1", - "license": "Apache-2.0", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.2.tgz", + "integrity": "sha512-A2B5+ldOguYAeqW1quFN5qNdruSNRrg4W59ag1Eq6QzxuHNIkrE+TrapfrW/z5NYFjCxAYqr/unVCgmk80Dwcg==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -984,14 +990,15 @@ } }, "node_modules/@firebase/app-check-compat": { - "version": "0.3.8", - "license": "Apache-2.0", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.9.tgz", + "integrity": "sha512-7LxyupQ8XeEHRh72mO+tqm69kHT6KbWi2KtFMGedJ6tNbwzFzojcXESMKN8RpADXbYoQgY3loWMJjMx4r2Zt7w==", "dependencies": { - "@firebase/app-check": "0.8.1", + "@firebase/app-check": "0.8.2", "@firebase/app-check-types": "0.5.0", - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1000,36 +1007,41 @@ }, "node_modules/@firebase/app-check-interop-types": { "version": "0.3.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.0.tgz", + "integrity": "sha512-xAxHPZPIgFXnI+vb4sbBjZcde7ZluzPPaSK7Lx3/nmuVk4TjZvnL8ONnkd4ERQKL8WePQySU+pRcWkh8rDf5Sg==" }, "node_modules/@firebase/app-check-types": { "version": "0.5.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.0.tgz", + "integrity": "sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ==" }, "node_modules/@firebase/app-compat": { - "version": "0.2.25", - "license": "Apache-2.0", + "version": "0.2.28", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.28.tgz", + "integrity": "sha512-Mr2NbeM1Oaayuw5unUAMzt+7/MN+e2uklT1l87D+ZLJl2UvhZAZmMt74GjEI9N3sDYKMeszSbszBqtJ1fGVafQ==", "dependencies": { - "@firebase/app": "0.9.25", - "@firebase/component": "0.6.4", + "@firebase/app": "0.9.28", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-types": { "version": "0.9.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.0.tgz", + "integrity": "sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q==" }, "node_modules/@firebase/auth": { - "version": "1.5.1", - "license": "Apache-2.0", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.6.1.tgz", + "integrity": "sha512-oOuQVOxtxKr+kTTqEkkI2qXIeGbkNLpA8FzO030LF4KXmMcETqsPaIqw7Aw1Y4Zl82l1qpZtpc4vN4Da2qZdfQ==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.3" }, "peerDependencies": { "@firebase/app": "0.x", @@ -1042,15 +1054,16 @@ } }, "node_modules/@firebase/auth-compat": { - "version": "0.5.1", - "license": "Apache-2.0", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.3.tgz", + "integrity": "sha512-2pVtVEvu8P7SF6jSPfLPKWUClQFj+StqAZ0fD/uQ6mv8DyWn7AuuANFEu7Pv96JPcaL6Gy9jC5dFqjpptjqSRA==", "dependencies": { - "@firebase/auth": "1.5.1", + "@firebase/auth": "1.6.1", "@firebase/auth-types": "0.12.0", - "@firebase/component": "0.6.4", - "@firebase/util": "1.9.3", + "@firebase/component": "0.6.5", + "@firebase/util": "1.9.4", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.3" }, "peerDependencies": { "@firebase/app-compat": "0.x" @@ -1058,69 +1071,76 @@ }, "node_modules/@firebase/auth-interop-types": { "version": "0.2.1", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.1.tgz", + "integrity": "sha512-VOaGzKp65MY6P5FI84TfYKBXEPi6LmOCSMMzys6o2BN2LOsqy7pCuZCup7NYnfbk5OkkQKzvIfHOzTm0UDpkyg==" }, "node_modules/@firebase/auth-types": { "version": "0.12.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.0.tgz", + "integrity": "sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/component": { - "version": "0.6.4", - "license": "Apache-2.0", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.5.tgz", + "integrity": "sha512-2tVDk1ixi12sbDmmfITK8lxSjmcb73BMF6Qwc3U44hN/J1Fi1QY/Hnnb6klFlbB9/G16a3J3d4nXykye2EADTw==", "dependencies": { - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/database": { - "version": "1.0.2", - "license": "Apache-2.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.3.tgz", + "integrity": "sha512-9fjqLt9JzL46gw9+NRqsgQEMjgRwfd8XtzcKqG+UYyhVeFCdVRQ0Wp6Dw/dvYHnbH5vNEKzNv36dcB4p+PIAAA==", "dependencies": { "@firebase/app-check-interop-types": "0.3.0", "@firebase/auth-interop-types": "0.2.1", - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "faye-websocket": "0.11.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-compat": { - "version": "1.0.2", - "license": "Apache-2.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.3.tgz", + "integrity": "sha512-7tHEOcMbK5jJzHWyphPux4osogH/adWwncxdMxdBpB9g1DNIyY4dcz1oJdlkXGM/i/AjUBesZsd5CuwTRTBNTw==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/database": "1.0.2", - "@firebase/database-types": "1.0.0", + "@firebase/component": "0.6.5", + "@firebase/database": "1.0.3", + "@firebase/database-types": "1.0.1", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-types": { - "version": "1.0.0", - "license": "Apache-2.0", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.1.tgz", + "integrity": "sha512-Tmcmx5XgiI7UVF/4oGg2P3AOTfq3WKEPsm2yf+uXtN7uG/a4WTWhVMrXGYRY2ZUL1xPxv9V33wQRJ+CcrUhVXw==", "dependencies": { "@firebase/app-types": "0.9.0", - "@firebase/util": "1.9.3" + "@firebase/util": "1.9.4" } }, "node_modules/@firebase/firestore": { - "version": "4.4.0", - "license": "Apache-2.0", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.4.3.tgz", + "integrity": "sha512-Ix61zbeuTsHf0WFbk6+67n89Vzd9M8MMTdnz7c7z+BRE3BS5Vuc3gX5ZcHFjqPkQJ7rpLB1egHsYe4Przp5C2g==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "@firebase/webchannel-wrapper": "0.10.5", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.3" }, "engines": { "node": ">=10.10.0" @@ -1130,13 +1150,14 @@ } }, "node_modules/@firebase/firestore-compat": { - "version": "0.3.23", - "license": "Apache-2.0", + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.26.tgz", + "integrity": "sha512-dNrKiH5Cn6ItANV9nJI2Y0msKBj/skO7skDlRo/BUSQE1DKbNzumxpJEz+PK/PV1nTegnRgVvs47gpQeVWXtYQ==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/firestore": "4.4.0", + "@firebase/component": "0.6.5", + "@firebase/firestore": "4.4.3", "@firebase/firestore-types": "3.0.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1145,36 +1166,39 @@ }, "node_modules/@firebase/firestore-types": { "version": "3.0.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.0.tgz", + "integrity": "sha512-Meg4cIezHo9zLamw0ymFYBD4SMjLb+ZXIbuN7T7ddXN6MGoICmOTq3/ltdCGoDCS2u+H1XJs2u/cYp75jsX9Qw==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/functions": { - "version": "0.11.0", - "license": "Apache-2.0", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.2.tgz", + "integrity": "sha512-2NULTYOZbu0rXczwfYdqQH0w1FmmYrKjTy1YPQSHLCAkMBdfewoKmVm4Lyo2vRn0H9ZndciLY7NszKDFt9MKCQ==", "dependencies": { "@firebase/app-check-interop-types": "0.3.0", "@firebase/auth-interop-types": "0.2.1", - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/messaging-interop-types": "0.2.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.3" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/functions-compat": { - "version": "0.3.6", - "license": "Apache-2.0", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.8.tgz", + "integrity": "sha512-VDHSw6UOu8RxfgAY/q8e+Jn+9Fh60Fc28yck0yfMsi2e0BiWgonIMWkFspFGGLgOJebTHl+hc+9v91rhzU6xlg==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/functions": "0.11.0", + "@firebase/component": "0.6.5", + "@firebase/functions": "0.11.2", "@firebase/functions-types": "0.6.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1183,15 +1207,17 @@ }, "node_modules/@firebase/functions-types": { "version": "0.6.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.0.tgz", + "integrity": "sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw==" }, "node_modules/@firebase/installations": { - "version": "0.6.4", - "license": "Apache-2.0", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.5.tgz", + "integrity": "sha512-0xxnQWw8rSRzu0ZOCkZaO+MJ0LkDAfwwTB2Z1SxRK6FAz5xkxD1ZUwM0WbCRni49PKubCrZYOJ6yg7tSjU7AKA==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/util": "1.9.3", - "idb": "7.0.1", + "@firebase/component": "0.6.5", + "@firebase/util": "1.9.4", + "idb": "7.1.1", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1199,13 +1225,14 @@ } }, "node_modules/@firebase/installations-compat": { - "version": "0.2.4", - "license": "Apache-2.0", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.5.tgz", + "integrity": "sha512-usvoIaog5CHEw082HXLrKAZ1qd4hIC3N/LDe2NqBgI3pkGE/7auLVM4Gn5gvyryp0x8z/IP1+d9fkGUj2OaGLQ==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/installations": "0.6.4", + "@firebase/component": "0.6.5", + "@firebase/installations": "0.6.5", "@firebase/installations-types": "0.5.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1214,30 +1241,29 @@ }, "node_modules/@firebase/installations-types": { "version": "0.5.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.0.tgz", + "integrity": "sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg==", "peerDependencies": { "@firebase/app-types": "0.x" } }, - "node_modules/@firebase/installations/node_modules/idb": { - "version": "7.0.1", - "license": "ISC" - }, "node_modules/@firebase/logger": { "version": "0.4.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.0.tgz", + "integrity": "sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA==", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/@firebase/messaging": { - "version": "0.12.5", - "license": "Apache-2.0", + "version": "0.12.6", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.6.tgz", + "integrity": "sha512-IORsPp9IPWq4j4yEhTOZ6GAGi3gQwGc+4yexmTAlya+qeBRSdRnJg2iIU/aj+tcKDQYr9RQuQPgHHOdFIx//vA==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/installations": "0.6.4", + "@firebase/component": "0.6.5", + "@firebase/installations": "0.6.5", "@firebase/messaging-interop-types": "0.2.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "idb": "7.1.1", "tslib": "^2.1.0" }, @@ -1246,12 +1272,13 @@ } }, "node_modules/@firebase/messaging-compat": { - "version": "0.2.5", - "license": "Apache-2.0", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.6.tgz", + "integrity": "sha512-Q2xC1s4L7Vpss7P7Gy6GuIS+xmJrf/vm9+gX76IK1Bo1TjoKwleCLHt1LHkPz5Rvqg5pTgzzI8qqPhBpZosFCg==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/messaging": "0.12.5", - "@firebase/util": "1.9.3", + "@firebase/component": "0.6.5", + "@firebase/messaging": "0.12.6", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1260,16 +1287,18 @@ }, "node_modules/@firebase/messaging-interop-types": { "version": "0.2.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz", + "integrity": "sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ==" }, "node_modules/@firebase/performance": { - "version": "0.6.4", - "license": "Apache-2.0", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.5.tgz", + "integrity": "sha512-OzAGcWhOqEFH9GdwUuY0oC5FSlnMejcnmSAhR+EjpI7exdDvixyLyCR4txjSHYNTbumrFBG+EP8GO11CNXRaJA==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/installations": "0.6.4", + "@firebase/component": "0.6.5", + "@firebase/installations": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1277,14 +1306,15 @@ } }, "node_modules/@firebase/performance-compat": { - "version": "0.2.4", - "license": "Apache-2.0", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.5.tgz", + "integrity": "sha512-jJwJkVyDcIMBaVGrZ6CRGs4m5FCZsWB5QCWYI3FdsHyIa9/TfteNDilxj9wGciF2naFIHDW7TgE69U5dAH9Ktg==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/performance": "0.6.4", + "@firebase/performance": "0.6.5", "@firebase/performance-types": "0.2.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1293,16 +1323,18 @@ }, "node_modules/@firebase/performance-types": { "version": "0.2.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.0.tgz", + "integrity": "sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA==" }, "node_modules/@firebase/remote-config": { - "version": "0.4.4", - "license": "Apache-2.0", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.5.tgz", + "integrity": "sha512-rGLqc/4OmxrS39RA9kgwa6JmgWytQuMo+B8pFhmGp3d++x2Hf9j+MLQfhOLyyUo64fNw20J19mLXhrXvKHsjZQ==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/installations": "0.6.4", + "@firebase/component": "0.6.5", + "@firebase/installations": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1310,14 +1342,15 @@ } }, "node_modules/@firebase/remote-config-compat": { - "version": "0.2.4", - "license": "Apache-2.0", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.5.tgz", + "integrity": "sha512-ImkNnLuGrD/bylBHDJigSY6LMwRrwt37wQbsGZhWG4QQ6KLzHzSf0nnFRRFvkOZodEUE57Ib8l74d6Yn/6TDUQ==", "dependencies": { - "@firebase/component": "0.6.4", + "@firebase/component": "0.6.5", "@firebase/logger": "0.4.0", - "@firebase/remote-config": "0.4.4", + "@firebase/remote-config": "0.4.5", "@firebase/remote-config-types": "0.3.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1326,29 +1359,32 @@ }, "node_modules/@firebase/remote-config-types": { "version": "0.3.0", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz", + "integrity": "sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA==" }, "node_modules/@firebase/storage": { - "version": "0.12.0", - "license": "Apache-2.0", + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.12.2.tgz", + "integrity": "sha512-MzanOBcxDx9oOwDaDPMuiYxd6CxcN1xZm+os5uNE3C1itbRKLhM9rzpODDKWzcbnHHFtXk3Q3lsK/d3Xa1WYYw==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/util": "1.9.3", + "@firebase/component": "0.6.5", + "@firebase/util": "1.9.4", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.3" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/storage-compat": { - "version": "0.3.3", - "license": "Apache-2.0", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.5.tgz", + "integrity": "sha512-5dJXfY5NxCF5NAk4dLvJqC+m6cgcf0Fr29nrMHwhwI34pBheQq2PdRZqALsqZCES9dnHTuFNlqGQDpLr+Ph4rw==", "dependencies": { - "@firebase/component": "0.6.4", - "@firebase/storage": "0.12.0", + "@firebase/component": "0.6.5", + "@firebase/storage": "0.12.2", "@firebase/storage-types": "0.8.0", - "@firebase/util": "1.9.3", + "@firebase/util": "1.9.4", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1357,22 +1393,25 @@ }, "node_modules/@firebase/storage-types": { "version": "0.8.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.0.tgz", + "integrity": "sha512-isRHcGrTs9kITJC0AVehHfpraWFui39MPaU7Eo8QfWlqW7YPymBmRgjDrlOgFdURh6Cdeg07zmkLP5tzTKRSpg==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/util": { - "version": "1.9.3", - "license": "Apache-2.0", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.4.tgz", + "integrity": "sha512-WLonYmS1FGHT97TsUmRN3qnTh5TeeoJp1Gg5fithzuAgdZOUtsYECfy7/noQ3llaguios8r5BuXSEiK82+UrxQ==", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/@firebase/webchannel-wrapper": { "version": "0.10.5", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.5.tgz", + "integrity": "sha512-eSkJsnhBWv5kCTSU1tSUVl9mpFu+5NXXunZc83le8GMjMlsWwQArSc7cJJ4yl+aDFY0NGLi0AjZWMn1axOrkRg==" }, "node_modules/@floating-ui/core": { "version": "1.5.3", @@ -1409,8 +1448,9 @@ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, "node_modules/@grpc/grpc-js": { - "version": "1.9.13", - "license": "Apache-2.0", + "version": "1.9.14", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.14.tgz", + "integrity": "sha512-nOpuzZ2G3IuMFN+UPPpKrC6NsLmWsTqSsm66IRfnBt1D4pwTqE27lmbpcPM+l2Ua4gE7PfjRHI6uedAy7hoXUw==", "dependencies": { "@grpc/proto-loader": "^0.7.8", "@types/node": ">=12.12.47" @@ -1421,7 +1461,8 @@ }, "node_modules/@grpc/proto-loader": { "version": "0.7.10", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz", + "integrity": "sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==", "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", @@ -2149,23 +2190,28 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -2173,23 +2219,28 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "node_modules/@protobufjs/path": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@radix-ui/primitive": { "version": "1.0.1", @@ -4843,7 +4894,8 @@ }, "node_modules/faye-websocket": { "version": "0.11.4", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", "dependencies": { "websocket-driver": ">=0.5.1" }, @@ -4897,35 +4949,36 @@ } }, "node_modules/firebase": { - "version": "10.7.1", - "license": "Apache-2.0", - "dependencies": { - "@firebase/analytics": "0.10.0", - "@firebase/analytics-compat": "0.2.6", - "@firebase/app": "0.9.25", - "@firebase/app-check": "0.8.1", - "@firebase/app-check-compat": "0.3.8", - "@firebase/app-compat": "0.2.25", + "version": "10.8.1", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.8.1.tgz", + "integrity": "sha512-4B2jzhU/aumfKL446MG41/T5+t+9d9urf5XGrjC0HRQUm4Ya/amV48HBchnje69ExaJP5f2WxO9OX3wh9ee4wA==", + "dependencies": { + "@firebase/analytics": "0.10.1", + "@firebase/analytics-compat": "0.2.7", + "@firebase/app": "0.9.28", + "@firebase/app-check": "0.8.2", + "@firebase/app-check-compat": "0.3.9", + "@firebase/app-compat": "0.2.28", "@firebase/app-types": "0.9.0", - "@firebase/auth": "1.5.1", - "@firebase/auth-compat": "0.5.1", - "@firebase/database": "1.0.2", - "@firebase/database-compat": "1.0.2", - "@firebase/firestore": "4.4.0", - "@firebase/firestore-compat": "0.3.23", - "@firebase/functions": "0.11.0", - "@firebase/functions-compat": "0.3.6", - "@firebase/installations": "0.6.4", - "@firebase/installations-compat": "0.2.4", - "@firebase/messaging": "0.12.5", - "@firebase/messaging-compat": "0.2.5", - "@firebase/performance": "0.6.4", - "@firebase/performance-compat": "0.2.4", - "@firebase/remote-config": "0.4.4", - "@firebase/remote-config-compat": "0.2.4", - "@firebase/storage": "0.12.0", - "@firebase/storage-compat": "0.3.3", - "@firebase/util": "1.9.3" + "@firebase/auth": "1.6.1", + "@firebase/auth-compat": "0.5.3", + "@firebase/database": "1.0.3", + "@firebase/database-compat": "1.0.3", + "@firebase/firestore": "4.4.3", + "@firebase/firestore-compat": "0.3.26", + "@firebase/functions": "0.11.2", + "@firebase/functions-compat": "0.3.8", + "@firebase/installations": "0.6.5", + "@firebase/installations-compat": "0.2.5", + "@firebase/messaging": "0.12.6", + "@firebase/messaging-compat": "0.2.6", + "@firebase/performance": "0.6.5", + "@firebase/performance-compat": "0.2.5", + "@firebase/remote-config": "0.4.5", + "@firebase/remote-config-compat": "0.2.5", + "@firebase/storage": "0.12.2", + "@firebase/storage-compat": "0.3.5", + "@firebase/util": "1.9.4" } }, "node_modules/flat-cache": { @@ -5294,7 +5347,8 @@ }, "node_modules/http-parser-js": { "version": "0.5.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==" }, "node_modules/human-signals": { "version": "2.1.0", @@ -5321,7 +5375,8 @@ }, "node_modules/idb": { "version": "7.1.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==" }, "node_modules/ignore": { "version": "5.3.0", @@ -6568,7 +6623,8 @@ }, "node_modules/lodash.camelcase": { "version": "4.3.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -6582,7 +6638,8 @@ }, "node_modules/long": { "version": "5.2.3", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/loose-envify": { "version": "1.4.0", @@ -7511,9 +7568,10 @@ } }, "node_modules/protobufjs": { - "version": "7.2.5", + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", + "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -7892,6 +7950,8 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -7905,8 +7965,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/safe-regex-test": { "version": "1.0.0", @@ -8675,8 +8734,9 @@ } }, "node_modules/undici": { - "version": "5.26.5", - "license": "MIT", + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -8806,7 +8866,8 @@ }, "node_modules/websocket-driver": { "version": "0.7.4", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", "dependencies": { "http-parser-js": ">=0.5.1", "safe-buffer": ">=5.1.0", @@ -8818,7 +8879,8 @@ }, "node_modules/websocket-extensions": { "version": "0.1.4", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", "engines": { "node": ">=0.8.0" } From 13f2d399b8d5c880e36daa1d6b0334e4daa48c86 Mon Sep 17 00:00:00 2001 From: Lisa Liu Date: Mon, 8 Apr 2024 09:53:19 -0700 Subject: [PATCH 2/4] changed createForm to createProgram, updateForm to updateProgram, and removed _id field in update --- backend/src/controllers/program.ts | 10 +++------- backend/src/routes/program.ts | 4 ++-- backend/src/validators/program.ts | 15 +++------------ 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/backend/src/controllers/program.ts b/backend/src/controllers/program.ts index 2cfef83d..4c3cae2c 100644 --- a/backend/src/controllers/program.ts +++ b/backend/src/controllers/program.ts @@ -17,7 +17,7 @@ export type Program = { color: string; //colorValueHex; }; -export const createForm: RequestHandler = async (req, res, next) => { +export const createProgram: RequestHandler = async (req, res, next) => { const errors = validationResult(req); try { @@ -31,18 +31,14 @@ export const createForm: RequestHandler = async (req, res, next) => { } }; -export const updateForm: RequestHandler = async (req, res, next) => { +export const updateProgram: RequestHandler = async (req, res, next) => { const errors = validationResult(req); try { validationErrorParser(errors); const programId = req.params.id; const programData = req.body as Program; - - if (programId !== programData._id) { - return res.status(400).json({ message: "Invalid student ID" }); - } - + const editedProgram = await ProgramFormModel.findOneAndUpdate({ _id: programId }, programData, { new: true, }); diff --git a/backend/src/routes/program.ts b/backend/src/routes/program.ts index 783bb32f..19915fb9 100644 --- a/backend/src/routes/program.ts +++ b/backend/src/routes/program.ts @@ -9,7 +9,7 @@ import * as ProgramValidator from "../validators/program"; const router = express.Router(); -router.post("/", ProgramValidator.createForm, ProgramController.createForm); -router.patch("/:id", ProgramValidator.updateForm, ProgramController.updateForm); +router.post("/", ProgramValidator.createProgram, ProgramController.createProgram); +router.patch("/:id", ProgramValidator.updateProgram, ProgramController.updateProgram); export default router; diff --git a/backend/src/validators/program.ts b/backend/src/validators/program.ts index bc116730..2f3518ad 100644 --- a/backend/src/validators/program.ts +++ b/backend/src/validators/program.ts @@ -101,16 +101,8 @@ const makeColorValidator = () => } return true; }); -const makeIDValidator = () => - // mongoID - body("_id") - .exists() - .withMessage("_id is required") - .bail() - .isMongoId() - .withMessage("_id must be a MongoDB object ID"); - -export const createForm = [ + +export const createProgram = [ makeNameValidator(), makeAbbreviationValidator(), makeTypeValidator(), @@ -120,8 +112,7 @@ export const createForm = [ makeColorValidator(), ]; -export const updateForm = [ - makeIDValidator(), +export const updateProgram = [ makeNameValidator(), makeAbbreviationValidator(), makeTypeValidator(), From 9fb4970648a665377681f57e1b8333a10e4051f8 Mon Sep 17 00:00:00 2001 From: Lisa Liu Date: Sun, 14 Apr 2024 22:30:53 -0700 Subject: [PATCH 3/4] finished v2 edit changes --- backend/package-lock.json | 644 ++++++++++++++--------------- backend/package.json | 2 +- backend/src/controllers/program.ts | 2 +- backend/src/models/program-form.ts | 6 +- backend/src/validators/program.ts | 88 +++- 5 files changed, 416 insertions(+), 326 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index 450a1dd0..a79cfa64 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -17,7 +17,7 @@ "firebase-admin": "^12.0.0", "firebase-functions": "^4.7.0", "mongodb": "^6.3.0", - "mongoose": "^8.0.3", + "mongoose": "^8.3.1", "tsc-alias": "^1.8.8" }, "devDependencies": { @@ -158,14 +158,14 @@ } }, "node_modules/@firebase/analytics": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.1.tgz", - "integrity": "sha512-5mnH1aQa99J5lZMJwTNzIoRc4yGXHf+fOn+EoEWhCDA3XGPweGHcylCbqq+G1wVJmfILL57fohDMa8ftMZ+44g==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/installations": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.2.tgz", + "integrity": "sha512-6Gv/Fndih+dOEEfsBJEeKlwxw9EvCO9D/y+yJMasblvCmj78wUVtn+T96zguSrbhfZ2yBhLS1vukYiPg6hI49w==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/installations": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -173,14 +173,14 @@ } }, "node_modules/@firebase/analytics-compat": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.7.tgz", - "integrity": "sha512-17VCly4P0VFBDqaaal7m1nhyYQwsygtaTpSsnc51sFPRrr9XIYtnD8ficon9fneEGEoJQ2g7OtASvhwX9EbK8g==", - "dependencies": { - "@firebase/analytics": "0.10.1", - "@firebase/analytics-types": "0.8.0", - "@firebase/component": "0.6.5", - "@firebase/util": "1.9.4", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.8.tgz", + "integrity": "sha512-scvzDPIsP9HcLWM77YQD7F3yLQksGvPUzyfqUrPo9XxIx26txJvGMJAS8O8BHa6jIvsjUenaTZ5oXEtKqNZQ9Q==", + "dependencies": { + "@firebase/analytics": "0.10.2", + "@firebase/analytics-types": "0.8.1", + "@firebase/component": "0.6.6", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -188,30 +188,30 @@ } }, "node_modules/@firebase/analytics-types": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.0.tgz", - "integrity": "sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.1.tgz", + "integrity": "sha512-niv/67/EOkTlGUxyiOYfIkysSMGYxkIUHJzT9pNkeIGt6zOz759oCUXOAwwjJzckh11dMBFjIYBmtWrdSgbmJw==" }, "node_modules/@firebase/app": { - "version": "0.9.27", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.9.27.tgz", - "integrity": "sha512-p2Dvl1ge4kRsyK5+wWcmdAIE9MSwZ0pDKAYB51LZgZuz6wciUZk4E1yAEdkfQlRxuHehn+Ol9WP5Qk2XQZiHGg==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.1.tgz", + "integrity": "sha512-H8hvbSVxNt+QaUQ1O0Gqidksi5ilj6eL8iMYxUNZgsMwZ1yOTgXc2C9zktbPQKokgcMq+EbF0k/t5iouslSkiA==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "idb": "7.1.1", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-check": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.2.tgz", - "integrity": "sha512-A2B5+ldOguYAeqW1quFN5qNdruSNRrg4W59ag1Eq6QzxuHNIkrE+TrapfrW/z5NYFjCxAYqr/unVCgmk80Dwcg==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.3.tgz", + "integrity": "sha512-nvlsj5oZBtYDjFTygQJ6xpyiYj8Jao2bFFyNJkUUPdg/QB8uhqDeG74P+gUH6iY9qzd1g5ZokmmGsoIhv9tdSQ==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -219,15 +219,15 @@ } }, "node_modules/@firebase/app-check-compat": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.9.tgz", - "integrity": "sha512-7LxyupQ8XeEHRh72mO+tqm69kHT6KbWi2KtFMGedJ6tNbwzFzojcXESMKN8RpADXbYoQgY3loWMJjMx4r2Zt7w==", - "dependencies": { - "@firebase/app-check": "0.8.2", - "@firebase/app-check-types": "0.5.0", - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.10.tgz", + "integrity": "sha512-v+jiLG3rQ1fhpIuNIm3WqrL4dkPUIkgOWoic7QABVsZKSAv2YhOFvAenp7IhSP/pz/aiPniJ8G7el/MWieECTg==", + "dependencies": { + "@firebase/app-check": "0.8.3", + "@firebase/app-check-types": "0.5.1", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -235,42 +235,42 @@ } }, "node_modules/@firebase/app-check-interop-types": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.0.tgz", - "integrity": "sha512-xAxHPZPIgFXnI+vb4sbBjZcde7ZluzPPaSK7Lx3/nmuVk4TjZvnL8ONnkd4ERQKL8WePQySU+pRcWkh8rDf5Sg==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.1.tgz", + "integrity": "sha512-NILZbe6RH3X1pZmJnfOfY2gLIrlKmrkUMMrrK6VSXHcSE0eQv28xFEcw16D198i9JYZpy5Kwq394My62qCMaIw==" }, "node_modules/@firebase/app-check-types": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.0.tgz", - "integrity": "sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.1.tgz", + "integrity": "sha512-NqeIcuGzZjl+khpXV0qsyOoaTqLeiG/K0kIDrebol+gb7xpmfOvXXqPEls+1WFBgHcPGdu+XRLhBA7xLzrVdpA==" }, "node_modules/@firebase/app-compat": { - "version": "0.2.27", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.27.tgz", - "integrity": "sha512-SYlqocfUDKPHR6MSFC8hree0BTiWFu5o8wbf6zFlYXyG41w7TcHp4wJi4H/EL5V6cM4kxwruXTJtqXX/fRAZtw==", - "dependencies": { - "@firebase/app": "0.9.27", - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "0.2.31", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.31.tgz", + "integrity": "sha512-TP9EwOiqDDL4tsP9EyOJn+RYUTkopS0nCg6TZ0PH8XiUgLlgDAF2waAZNha0+18elUkVjbWoXcudCgJ0iVWEVA==", + "dependencies": { + "@firebase/app": "0.10.1", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-types": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.0.tgz", - "integrity": "sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q==" + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.1.tgz", + "integrity": "sha512-nFGqTYsnDFn1oXf1tCwPAc+hQPxyvBT/QB7qDjwK+IDYThOn63nGhzdUTXxVD9Ca8gUY/e5PQMngeo0ZW/E3uQ==" }, "node_modules/@firebase/auth": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.6.0.tgz", - "integrity": "sha512-Qhl35eJTV6BwvuueTPCY6x8kUlYyzALtjp/Ws0X3fw3AnjVVfuVb7oQ3Xh5VPVfMFhaIuUAd1KXwcAuIklkSDw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.1.tgz", + "integrity": "sha512-h1nTQ/bKuKmXnwhQP1hi73aSnEp3YQnw+9k8ICwvNB9FhG0XJS5VNtR08cpLUpwl9clSTujg3EP/Hs/chZnq4A==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.4" }, "peerDependencies": { "@firebase/app": "0.x", @@ -283,93 +283,93 @@ } }, "node_modules/@firebase/auth-compat": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.2.tgz", - "integrity": "sha512-pRgje5BPCNR1vXyvGOVXwOHtv88A2WooXfklI8sV7/jWi03ExFqNfpJT26GUo/oD39NoKJ3Kt6rD5gVvdV7lMw==", - "dependencies": { - "@firebase/auth": "1.6.0", - "@firebase/auth-types": "0.12.0", - "@firebase/component": "0.6.5", - "@firebase/util": "1.9.4", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.6.tgz", + "integrity": "sha512-zXo0CnGG8UqFtXW76XfXdKmDaAUW7QEN0BYXYH04VuzdPCmkWaR5Uybjp/Tglh3+UqE4AhYcYe0p2n+mxmkLqA==", + "dependencies": { + "@firebase/auth": "1.7.1", + "@firebase/auth-types": "0.12.1", + "@firebase/component": "0.6.6", + "@firebase/util": "1.9.5", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.4" }, "peerDependencies": { "@firebase/app-compat": "0.x" } }, "node_modules/@firebase/auth-interop-types": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.1.tgz", - "integrity": "sha512-VOaGzKp65MY6P5FI84TfYKBXEPi6LmOCSMMzys6o2BN2LOsqy7pCuZCup7NYnfbk5OkkQKzvIfHOzTm0UDpkyg==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.2.tgz", + "integrity": "sha512-k3NA28Jfoo0+o391bFjoV9X5QLnUL1WbLhZZRbTQhZdmdGYJfX8ixtNNlHsYQ94bwG0QRbsmvkzDnzuhHrV11w==" }, "node_modules/@firebase/auth-types": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.0.tgz", - "integrity": "sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.1.tgz", + "integrity": "sha512-B3dhiWRWf/njWosx4zdhSEoD4WHJmr4zbnBw6t20mRG/IZ4u0rWUBlMP1vFjhMstKIow1XmoGhTwD65X5ZXLjw==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/component": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.5.tgz", - "integrity": "sha512-2tVDk1ixi12sbDmmfITK8lxSjmcb73BMF6Qwc3U44hN/J1Fi1QY/Hnnb6klFlbB9/G16a3J3d4nXykye2EADTw==", + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.6.tgz", + "integrity": "sha512-pp7sWqHmAAlA3os6ERgoM3k5Cxff510M9RLXZ9Mc8KFKMBc2ct3RkZTWUF7ixJNvMiK/iNgRLPDrLR2gtRJ9iQ==", "dependencies": { - "@firebase/util": "1.9.4", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" } }, "node_modules/@firebase/database": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.3.tgz", - "integrity": "sha512-9fjqLt9JzL46gw9+NRqsgQEMjgRwfd8XtzcKqG+UYyhVeFCdVRQ0Wp6Dw/dvYHnbH5vNEKzNv36dcB4p+PIAAA==", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.0", - "@firebase/auth-interop-types": "0.2.1", - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.4.tgz", + "integrity": "sha512-k84cXh+dtpzvY6yOhfyr1B+I1vjvSMtmlqotE0lTNVylc8m5nmOohjzpTLEQDrBWvwACX/VP5fEyajAdmnOKqA==", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.1", + "@firebase/auth-interop-types": "0.2.2", + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "faye-websocket": "0.11.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-compat": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.3.tgz", - "integrity": "sha512-7tHEOcMbK5jJzHWyphPux4osogH/adWwncxdMxdBpB9g1DNIyY4dcz1oJdlkXGM/i/AjUBesZsd5CuwTRTBNTw==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/database": "1.0.3", - "@firebase/database-types": "1.0.1", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.4.tgz", + "integrity": "sha512-GEEDAvsSMAkqy0BIFSVtFzoOIIcKHFfDM4aXHtWL/JCaNn4OOjH7td73jDfN3ALvpIN4hQki0FcxQ89XjqaTjQ==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/database": "1.0.4", + "@firebase/database-types": "1.0.2", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-types": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.1.tgz", - "integrity": "sha512-Tmcmx5XgiI7UVF/4oGg2P3AOTfq3WKEPsm2yf+uXtN7uG/a4WTWhVMrXGYRY2ZUL1xPxv9V33wQRJ+CcrUhVXw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.2.tgz", + "integrity": "sha512-JRigr5JNLEHqOkI99tAGHDZF47469/cJz1tRAgGs8Feh+3ZmQy/vVChSqwMp2DuVUGp9PlmGsNSlpINJ/hDuIA==", "dependencies": { - "@firebase/app-types": "0.9.0", - "@firebase/util": "1.9.4" + "@firebase/app-types": "0.9.1", + "@firebase/util": "1.9.5" } }, "node_modules/@firebase/firestore": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.4.2.tgz", - "integrity": "sha512-YaX6ypa/RzU6OkxzUQlpSxwhOIWdTraCNz7sMsbaSEjjl/pj/QvX6TqjkdWGzuBYh2S6rz7ErhDO0g39oZZw/g==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", - "@firebase/webchannel-wrapper": "0.10.5", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.6.0.tgz", + "integrity": "sha512-mul4L2Bp+Q5R5mV1nf5Z6OmsHHFid7uSEeR8oTM89p5G0nMam4GKaBAvgLSxwsXQbyy2WW9nNnuAWLfD7HDxFA==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", + "@firebase/webchannel-wrapper": "0.10.6", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.4" }, "engines": { "node": ">=10.10.0" @@ -379,14 +379,14 @@ } }, "node_modules/@firebase/firestore-compat": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.25.tgz", - "integrity": "sha512-+xI7WmsgZCBhMn/+uhDKcg+lsOUJ9FJyt5PGTzkFPbCsozWfeQZ7eVnfPh0rMkUOf0yIQ924RIe04gwvEIbcoQ==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/firestore": "4.4.2", - "@firebase/firestore-types": "3.0.0", - "@firebase/util": "1.9.4", + "version": "0.3.29", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.29.tgz", + "integrity": "sha512-ylBtvIQo2Caj1qXUd7ksj8xcL9l1b/F2Et6rq0smogPvl5CGvrv49xC5wVLJDmkMmH7IBEJb26KKC/RW1XYymg==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/firestore": "4.6.0", + "@firebase/firestore-types": "3.0.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -394,40 +394,40 @@ } }, "node_modules/@firebase/firestore-types": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.0.tgz", - "integrity": "sha512-Meg4cIezHo9zLamw0ymFYBD4SMjLb+ZXIbuN7T7ddXN6MGoICmOTq3/ltdCGoDCS2u+H1XJs2u/cYp75jsX9Qw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.1.tgz", + "integrity": "sha512-mVhPcHr5FICjF67m6JHgj+XRvAz/gZ62xifeGfcm00RFl6tNKfCzCfKeyB2BDIEc9dUnEstkmIXlmLIelOWoaA==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/functions": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.1.tgz", - "integrity": "sha512-3uUa1hB79Gmy6E1gHTfzoHeZolBeHc/I/n3+lOCDe6BOos9AHmzRjKygcFE/7VA2FJjitCE0K+OHI6+OuoY8fQ==", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.0", - "@firebase/auth-interop-types": "0.2.1", - "@firebase/component": "0.6.5", - "@firebase/messaging-interop-types": "0.2.0", - "@firebase/util": "1.9.4", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.4.tgz", + "integrity": "sha512-FeMpXtlZG8hnxUauI5J8BSmIbY/Gcv7UVlByxHuHmGxxeS8mJPuAdIxPLUBNtV/naf+MeimIPcpPMslYr6tN6w==", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.1", + "@firebase/auth-interop-types": "0.2.2", + "@firebase/component": "0.6.6", + "@firebase/messaging-interop-types": "0.2.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.4" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/functions-compat": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.7.tgz", - "integrity": "sha512-uXe6Kmku5lNogp3OpPBcOJbSvnaCOn+YxS3zlXKNU6Q/NLwcvO3RY1zwYyctCos2RemEw3KEQ7YdzcECXjHWLw==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/functions": "0.11.1", - "@firebase/functions-types": "0.6.0", - "@firebase/util": "1.9.4", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.10.tgz", + "integrity": "sha512-2Yidp6Dgf2k8LqJDQUTqdYFdf4ySNmZ71yeDX4lThby1HRMww+Y3nN98YaM6hHarZX3PUfaMUiMBZMHCRRT2IA==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/functions": "0.11.4", + "@firebase/functions-types": "0.6.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -435,17 +435,17 @@ } }, "node_modules/@firebase/functions-types": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.0.tgz", - "integrity": "sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw==" + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.1.tgz", + "integrity": "sha512-DirqgTXSBzyKsQwcKnx/YdGMaRdJhywnThrINP+Iog8QfQnrL7aprTXHDFHlpZEMwykS54YRk53xzz7j396QXQ==" }, "node_modules/@firebase/installations": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.5.tgz", - "integrity": "sha512-0xxnQWw8rSRzu0ZOCkZaO+MJ0LkDAfwwTB2Z1SxRK6FAz5xkxD1ZUwM0WbCRni49PKubCrZYOJ6yg7tSjU7AKA==", + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.6.tgz", + "integrity": "sha512-dNGRGoHmstgEJqh9Kzk22fR2ZrVBH1JWliaL6binQ6pIzlWscreHNczzJDgOKoVT0PjWTrAmh/azztiX/e2uTw==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/util": "1.9.5", "idb": "7.1.1", "tslib": "^2.1.0" }, @@ -454,14 +454,14 @@ } }, "node_modules/@firebase/installations-compat": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.5.tgz", - "integrity": "sha512-usvoIaog5CHEw082HXLrKAZ1qd4hIC3N/LDe2NqBgI3pkGE/7auLVM4Gn5gvyryp0x8z/IP1+d9fkGUj2OaGLQ==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/installations": "0.6.5", - "@firebase/installations-types": "0.5.0", - "@firebase/util": "1.9.4", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.6.tgz", + "integrity": "sha512-uxBAt2WsuEMT5dalA/1O+Uyi9DS25zKHgIPdrQ7KO1ZUdBURiGScIyjdhIM/7NMSvHGYugK4PUVdK9NFIffeiw==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/installations": "0.6.6", + "@firebase/installations-types": "0.5.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -469,30 +469,30 @@ } }, "node_modules/@firebase/installations-types": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.0.tgz", - "integrity": "sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.1.tgz", + "integrity": "sha512-OyREnRTfe2wIWTrzCz65ajyo4lFm6VgbeVqMMP+3GJLfCtNvY9VXkmqs3WFEsyYezzdcRqOt39FynZoLlkO+cQ==", "peerDependencies": { "@firebase/app-types": "0.x" } }, "node_modules/@firebase/logger": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.0.tgz", - "integrity": "sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.1.tgz", + "integrity": "sha512-tTIixB5UJbG9ZHSGZSZdX7THr3KWOLrejZ9B7jYsm6fpwgRNngKznQKA2wgYVyvBc1ta7dGFh9NtJ8n7qfiYIw==", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/@firebase/messaging": { - "version": "0.12.6", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.6.tgz", - "integrity": "sha512-IORsPp9IPWq4j4yEhTOZ6GAGi3gQwGc+4yexmTAlya+qeBRSdRnJg2iIU/aj+tcKDQYr9RQuQPgHHOdFIx//vA==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/installations": "0.6.5", - "@firebase/messaging-interop-types": "0.2.0", - "@firebase/util": "1.9.4", + "version": "0.12.8", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.8.tgz", + "integrity": "sha512-FbCTNhv5DUBo8It+Wj3XbKM1xf3PeoHsHk8PjMWBNm0yP+LL8Jhd3ejRsukEYdysTMvgxY4sU5Cs5YNTK44qTQ==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/installations": "0.6.6", + "@firebase/messaging-interop-types": "0.2.1", + "@firebase/util": "1.9.5", "idb": "7.1.1", "tslib": "^2.1.0" }, @@ -501,13 +501,13 @@ } }, "node_modules/@firebase/messaging-compat": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.6.tgz", - "integrity": "sha512-Q2xC1s4L7Vpss7P7Gy6GuIS+xmJrf/vm9+gX76IK1Bo1TjoKwleCLHt1LHkPz5Rvqg5pTgzzI8qqPhBpZosFCg==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.8.tgz", + "integrity": "sha512-/2ibL9u64jn76g67qjAZutVnPTV6euu0z3BvCjcqlNbMMdtoyNjyHOBRe/D7eVcrRt0uB4rTPnjr3A6sVKdjuA==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/messaging": "0.12.6", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/messaging": "0.12.8", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -515,19 +515,19 @@ } }, "node_modules/@firebase/messaging-interop-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz", - "integrity": "sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.1.tgz", + "integrity": "sha512-jfGJ7Jc32BDHXvXHyXi34mVLzZY8X0t929DTMwz7Tj2Hc40Zuzx8VRCIPLRrRUyvBrJCd5EpIcQgCygXhtaN1A==" }, "node_modules/@firebase/performance": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.5.tgz", - "integrity": "sha512-OzAGcWhOqEFH9GdwUuY0oC5FSlnMejcnmSAhR+EjpI7exdDvixyLyCR4txjSHYNTbumrFBG+EP8GO11CNXRaJA==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/installations": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.6.tgz", + "integrity": "sha512-UOUHhvj2GJcjyJewdX1ShnON0/eqTswHvYzzQPC4nrIuMFvHwMGk8NpCaqh7JZmpaxh9AMr6kM+M/p37DrKWXA==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/installations": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -535,15 +535,15 @@ } }, "node_modules/@firebase/performance-compat": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.5.tgz", - "integrity": "sha512-jJwJkVyDcIMBaVGrZ6CRGs4m5FCZsWB5QCWYI3FdsHyIa9/TfteNDilxj9wGciF2naFIHDW7TgE69U5dAH9Ktg==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/performance": "0.6.5", - "@firebase/performance-types": "0.2.0", - "@firebase/util": "1.9.4", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.6.tgz", + "integrity": "sha512-JSGdNNHBAMRTocGpN+m+7tk+9rulBcwuG+Ejw/ooDj45FGcON1Eymxh/qbe5M6Dlj5P1ClbkHLj4yf7MiCHOag==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/performance": "0.6.6", + "@firebase/performance-types": "0.2.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -551,19 +551,19 @@ } }, "node_modules/@firebase/performance-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.0.tgz", - "integrity": "sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.1.tgz", + "integrity": "sha512-kQ8pEr4d6ArhPoYrngcFlEJMNWMdEZTpvMAttWH0C2vegBgj47cm6xXFy9+0j27OBhOIiPn48Z+2WE2XNu33CQ==" }, "node_modules/@firebase/remote-config": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.5.tgz", - "integrity": "sha512-rGLqc/4OmxrS39RA9kgwa6JmgWytQuMo+B8pFhmGp3d++x2Hf9j+MLQfhOLyyUo64fNw20J19mLXhrXvKHsjZQ==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/installations": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/util": "1.9.4", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.6.tgz", + "integrity": "sha512-qtanFS+AX5k/7e/+Azf27Hq4reX28QsUvRcYWyS5cOaRMS9jtll4MK4winWmzX8MdJY637nFzIx43PlMKVnaKw==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/installations": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -571,15 +571,15 @@ } }, "node_modules/@firebase/remote-config-compat": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.5.tgz", - "integrity": "sha512-ImkNnLuGrD/bylBHDJigSY6LMwRrwt37wQbsGZhWG4QQ6KLzHzSf0nnFRRFvkOZodEUE57Ib8l74d6Yn/6TDUQ==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/logger": "0.4.0", - "@firebase/remote-config": "0.4.5", - "@firebase/remote-config-types": "0.3.0", - "@firebase/util": "1.9.4", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.6.tgz", + "integrity": "sha512-cFdpmN/rzDhm4pbk0WpOzK9JQ9I1ZhXzhtYbKRBwUag3pG1odEfIORygMDCGQniPpcae/QGXho4srJHfoijKuw==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/logger": "0.4.1", + "@firebase/remote-config": "0.4.6", + "@firebase/remote-config-types": "0.3.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -587,33 +587,33 @@ } }, "node_modules/@firebase/remote-config-types": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz", - "integrity": "sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.1.tgz", + "integrity": "sha512-PgmfUugcJAinPLsJlYcBbNZe7KE2omdQw1WCT/z46nKkNVGkuHdVFSq54s3wiFa9BoHmLZ01u4hGXIhm6MdLOw==" }, "node_modules/@firebase/storage": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.12.1.tgz", - "integrity": "sha512-KJ5NV7FUh54TeTlEjdkTTX60ciCKOp9EqlbLnpdcXUYRJg0Z4810TXbilPc1z7fTIG4iPjtdi95bGE9n4dBX8A==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.12.4.tgz", + "integrity": "sha512-HcmUcp2kSSr5cHkIqFrgUW+i20925EEjkXepQxgBcI2Vx0cyqshr8iETtGow2+cMBFeY8H2swsKKabOKAjIwlQ==", "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/util": "1.9.4", + "@firebase/component": "0.6.6", + "@firebase/util": "1.9.5", "tslib": "^2.1.0", - "undici": "5.26.5" + "undici": "5.28.4" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/storage-compat": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.4.tgz", - "integrity": "sha512-Y0m5e2gS/wB9Ioth2X/Sgz76vcxvqgQrCmfa9qwhss/N31kxY2Gks6Frv0nrE18AjVfcSmcfDitqUwxcMOTRSg==", - "dependencies": { - "@firebase/component": "0.6.5", - "@firebase/storage": "0.12.1", - "@firebase/storage-types": "0.8.0", - "@firebase/util": "1.9.4", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.7.tgz", + "integrity": "sha512-pTlNAm8/QPN7vhYRyd5thr2ouCykP+wIFXHY1AV42WTrk98sTGdIlt/tusHzmrH4mJ34MPaICS0cn2lYikiq8w==", + "dependencies": { + "@firebase/component": "0.6.6", + "@firebase/storage": "0.12.4", + "@firebase/storage-types": "0.8.1", + "@firebase/util": "1.9.5", "tslib": "^2.1.0" }, "peerDependencies": { @@ -621,26 +621,26 @@ } }, "node_modules/@firebase/storage-types": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.0.tgz", - "integrity": "sha512-isRHcGrTs9kITJC0AVehHfpraWFui39MPaU7Eo8QfWlqW7YPymBmRgjDrlOgFdURh6Cdeg07zmkLP5tzTKRSpg==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.1.tgz", + "integrity": "sha512-yj0vypPT9UbbfYYwzpXPYchnjWqCADcTbGNawAIebww8rnQYPGbESYTKQdFRPXiLspYPB7xCHTXThmMJuvDcsQ==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, "node_modules/@firebase/util": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.4.tgz", - "integrity": "sha512-WLonYmS1FGHT97TsUmRN3qnTh5TeeoJp1Gg5fithzuAgdZOUtsYECfy7/noQ3llaguios8r5BuXSEiK82+UrxQ==", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.5.tgz", + "integrity": "sha512-PP4pAFISDxsf70l3pEy34Mf3GkkUcVQ3MdKp6aSVb7tcpfUQxnsdV7twDd8EkfB6zZylH6wpUAoangQDmCUMqw==", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/@firebase/webchannel-wrapper": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.5.tgz", - "integrity": "sha512-eSkJsnhBWv5kCTSU1tSUVl9mpFu+5NXXunZc83le8GMjMlsWwQArSc7cJJ4yl+aDFY0NGLi0AjZWMn1axOrkRg==" + "version": "0.10.6", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.6.tgz", + "integrity": "sha512-EnfRJvrnzkHwN3BPMCayCFT5lCqInzg3RdlRsDjDvB1EJli6Usj26T6lJ67BU2UcYXBS5xcp1Wj4+zRzj2NaZg==" }, "node_modules/@google-cloud/firestore": { "version": "7.1.0", @@ -848,9 +848,9 @@ } }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.1.tgz", - "integrity": "sha512-t7c5K033joZZMspnHg/gWPE4kandgc2OxE74aYOtGKfgB9VPuVJPix0H6fhmm2erj5PBJ21mqcx34lpIGtUCsQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz", + "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==", "dependencies": { "sparse-bitfield": "^3.0.3" } @@ -1858,12 +1858,12 @@ } }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -1871,7 +1871,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -1902,9 +1902,9 @@ } }, "node_modules/bson": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz", - "integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.6.0.tgz", + "integrity": "sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA==", "engines": { "node": ">=16.20.1" } @@ -2079,9 +2079,9 @@ } }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } @@ -2739,16 +2739,16 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -2928,36 +2928,36 @@ } }, "node_modules/firebase": { - "version": "10.8.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.8.0.tgz", - "integrity": "sha512-UJpC24vw8JFuHEOQyArBGKTUd7+kohLISCzHyn0M/prP0KOTx2io1eyLliEid330QqnWI7FOlPxoU97qecCSfQ==", - "dependencies": { - "@firebase/analytics": "0.10.1", - "@firebase/analytics-compat": "0.2.7", - "@firebase/app": "0.9.27", - "@firebase/app-check": "0.8.2", - "@firebase/app-check-compat": "0.3.9", - "@firebase/app-compat": "0.2.27", - "@firebase/app-types": "0.9.0", - "@firebase/auth": "1.6.0", - "@firebase/auth-compat": "0.5.2", - "@firebase/database": "1.0.3", - "@firebase/database-compat": "1.0.3", - "@firebase/firestore": "4.4.2", - "@firebase/firestore-compat": "0.3.25", - "@firebase/functions": "0.11.1", - "@firebase/functions-compat": "0.3.7", - "@firebase/installations": "0.6.5", - "@firebase/installations-compat": "0.2.5", - "@firebase/messaging": "0.12.6", - "@firebase/messaging-compat": "0.2.6", - "@firebase/performance": "0.6.5", - "@firebase/performance-compat": "0.2.5", - "@firebase/remote-config": "0.4.5", - "@firebase/remote-config-compat": "0.2.5", - "@firebase/storage": "0.12.1", - "@firebase/storage-compat": "0.3.4", - "@firebase/util": "1.9.4" + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.11.0.tgz", + "integrity": "sha512-stWqB0cmUBFidaWCgDV6on6uQyAV8jFe9XdOp0Y1GRM/LUn0MjPSgW06Tc3pFlaefQ+WTLR/CNwL+0qGhxDLIA==", + "dependencies": { + "@firebase/analytics": "0.10.2", + "@firebase/analytics-compat": "0.2.8", + "@firebase/app": "0.10.1", + "@firebase/app-check": "0.8.3", + "@firebase/app-check-compat": "0.3.10", + "@firebase/app-compat": "0.2.31", + "@firebase/app-types": "0.9.1", + "@firebase/auth": "1.7.1", + "@firebase/auth-compat": "0.5.6", + "@firebase/database": "1.0.4", + "@firebase/database-compat": "1.0.4", + "@firebase/firestore": "4.6.0", + "@firebase/firestore-compat": "0.3.29", + "@firebase/functions": "0.11.4", + "@firebase/functions-compat": "0.3.10", + "@firebase/installations": "0.6.6", + "@firebase/installations-compat": "0.2.6", + "@firebase/messaging": "0.12.8", + "@firebase/messaging-compat": "0.2.8", + "@firebase/performance": "0.6.6", + "@firebase/performance-compat": "0.2.6", + "@firebase/remote-config": "0.4.6", + "@firebase/remote-config-compat": "0.2.6", + "@firebase/storage": "0.12.4", + "@firebase/storage-compat": "0.3.7", + "@firebase/util": "1.9.5" } }, "node_modules/firebase-admin": { @@ -4001,9 +4001,9 @@ "dev": true }, "node_modules/jose": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", - "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -4177,9 +4177,9 @@ } }, "node_modules/kareem": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", - "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", "engines": { "node": ">=12.0.0" } @@ -4437,12 +4437,12 @@ } }, "node_modules/mongodb": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.3.0.tgz", - "integrity": "sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz", + "integrity": "sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==", "dependencies": { - "@mongodb-js/saslprep": "^1.1.0", - "bson": "^6.2.0", + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.4.0", "mongodb-connection-string-url": "^3.0.0" }, "engines": { @@ -4491,13 +4491,13 @@ } }, "node_modules/mongoose": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.1.0.tgz", - "integrity": "sha512-kOA4Xnq2goqNpN9EmYElGNWfxA9H80fxcr7UdJKWi3UMflza0R7wpTihCpM67dE/0MNFljoa0sjQtlXVkkySAQ==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.1.tgz", + "integrity": "sha512-D78C+s7QI4+pJQhs3XbOxzrHFEti4x+BDhaH94QrdV1/cmMA7fHc50LgLSXjzA/5q89TBK8DAXyf3VwDZbQJlA==", "dependencies": { - "bson": "^6.2.0", - "kareem": "2.5.1", - "mongodb": "6.3.0", + "bson": "^6.5.0", + "kareem": "2.6.3", + "mongodb": "6.5.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -5028,9 +5028,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -5954,9 +5954,9 @@ } }, "node_modules/undici": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.5.tgz", - "integrity": "sha512-cSb4bPFd5qgR7qr2jYAi0hlX9n5YKK2ONKkLFkxl+v/9BvC0sOpZjBHDBSXc5lWAf5ty9oZdRXytBIHzgUcerw==", + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -5970,9 +5970,9 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/undici/node_modules/@fastify/busboy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", - "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", "engines": { "node": ">=14" } diff --git a/backend/package.json b/backend/package.json index f9b91b4f..6ae883cc 100644 --- a/backend/package.json +++ b/backend/package.json @@ -24,7 +24,7 @@ "firebase-admin": "^12.0.0", "firebase-functions": "^4.7.0", "mongodb": "^6.3.0", - "mongoose": "^8.0.3", + "mongoose": "^8.3.1", "tsc-alias": "^1.8.8" }, "devDependencies": { diff --git a/backend/src/controllers/program.ts b/backend/src/controllers/program.ts index 4c3cae2c..470cd559 100644 --- a/backend/src/controllers/program.ts +++ b/backend/src/controllers/program.ts @@ -38,7 +38,7 @@ export const updateProgram: RequestHandler = async (req, res, next) => { const programId = req.params.id; const programData = req.body as Program; - + const editedProgram = await ProgramFormModel.findOneAndUpdate({ _id: programId }, programData, { new: true, }); diff --git a/backend/src/models/program-form.ts b/backend/src/models/program-form.ts index c77b4760..b7b13a38 100644 --- a/backend/src/models/program-form.ts +++ b/backend/src/models/program-form.ts @@ -9,7 +9,11 @@ const programSchema = new Schema({ daysOfWeek: { type: [String], required: true }, // M, T, W, TH, F startDate: { type: Date, required: true }, endDate: { type: Date, required: true }, - color: { type: String, required: true }, // options: 1 (teal, #4FA197), 2 (yellow, #FFB800), 3 (pink, #FF7A5E), 4 (olive, #B6BF0E) + color: { type: String, required: true }, + studentUIDs: { type: [String], required: true }, + renewalDate: { type: Date, required: true }, + hourlyPay: { type: Number, required: true }, + sessions: { type: [[String]], required: true }, }); type ProgramForm = InferSchemaType; diff --git a/backend/src/validators/program.ts b/backend/src/validators/program.ts index 2f3518ad..51b1ef0b 100644 --- a/backend/src/validators/program.ts +++ b/backend/src/validators/program.ts @@ -1,4 +1,5 @@ import { body } from "express-validator"; +import mongoose from "mongoose"; import { Program } from "../controllers/program"; @@ -101,7 +102,84 @@ const makeColorValidator = () => } return true; }); - +const makeStudentUIDsValidator = () => + // mongoID + body("studentUIDs") + .exists() + .withMessage("student UIDs list needed") + .bail() + .isArray() + .bail() + .withMessage("students must be an array") + .custom((students: string[]) => { + students.forEach((studentId) => { + if (!mongoose.Types.ObjectId.isValid(studentId)) + throw new Error("students must be valid student ids"); + }); + return true; + }) + .bail() + .withMessage("students must be valid student ids"); +const makeRenewalDateValidator = () => + body("renewalDate") + .exists() + .withMessage("renewal date needed") + .bail() + .isISO8601() + .withMessage("renewal date must be a valid date-time string"); +const makeHourlyPayValidator = () => + body("hourlyPay") + .exists() + .withMessage("hourly pay needed") + .bail() + .isNumeric() + .withMessage("hourly pay must be a valid number"); +const makeSessionsValidator = () => + body("sessions") + .exists() + .withMessage("sessions list needed") + .bail() + .isArray() + .withMessage("sessions list must be an array") + .custom((value: [string[]]) => { + for (const arr of value) { + // each time interval must be array + if (!Array.isArray(arr)) throw new Error("each session must be formatted as an array"); + // array: [10:00, 13:00] + for (let j = 0; j <= 1; j++) { + if (arr[j].length !== 5) throw new Error("times should be 5 characters, in XX:XX format"); + if (arr[j][2] !== ":") throw new Error("middle character should be :"); + // first character is 0 or 1 + if (arr[j].charCodeAt(0) === 48 || arr[j].charCodeAt(0) === 49) { + if (!(arr[j].charCodeAt(1) > 47 && arr[j].charCodeAt(1) < 58)) + throw new Error("second number should be 0-9"); + } + // first character is 2 + else if (arr[j].charCodeAt(0) === 50) { + if (!(arr[j].charCodeAt(1) > 47 && arr[j].charCodeAt(1) < 52)) + throw new Error("second number should be 0-3"); + } else { + throw new Error("first number should be 0, 1, or 2"); + } + // third character is 0 - 5 + if (!(arr[j].charCodeAt(3) > 47 && arr[j].charCodeAt(3) < 54)) + throw new Error("third number should be 0-5"); + // fourth character is 0 - 9 + if (!(arr[j].charCodeAt(4) > 47 && arr[j].charCodeAt(4) < 58)) + throw new Error("fourth number should be 0-9"); + for (let i = 0; i <= 4; i++) { + if (i === 2) continue; + const code = arr[j].charCodeAt(i); + if (!(code > 47 && code < 58)) { + // numeric (0-9) + throw new Error("color hex must be a hex string, with characters 0-9 or A-F"); + } + } + } + } + return true; + }); + export const createProgram = [ makeNameValidator(), makeAbbreviationValidator(), @@ -110,6 +188,10 @@ export const createProgram = [ makeStartDateValidator(), makeEndDateValidator(), makeColorValidator(), + makeStudentUIDsValidator(), + makeRenewalDateValidator(), + makeHourlyPayValidator(), + makeSessionsValidator(), ]; export const updateProgram = [ @@ -120,4 +202,8 @@ export const updateProgram = [ makeStartDateValidator(), makeEndDateValidator(), makeColorValidator(), + makeStudentUIDsValidator(), + makeRenewalDateValidator(), + makeHourlyPayValidator(), + makeSessionsValidator(), ]; From 532694bd94a35f484f06cd5fc52b3108e8c84f57 Mon Sep 17 00:00:00 2001 From: Lisa Liu Date: Sun, 14 Apr 2024 23:59:21 -0700 Subject: [PATCH 4/4] fixed lint --- backend/src/controllers/program.ts | 10 +++++++++- backend/src/routes/program.ts | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/src/controllers/program.ts b/backend/src/controllers/program.ts index b982682c..a241b7cc 100644 --- a/backend/src/controllers/program.ts +++ b/backend/src/controllers/program.ts @@ -15,6 +15,10 @@ export type Program = { startDate: string; endDate: string; color: string; //colorValueHex; + studentUIDs: string[]; + renewalDate: string; + hourlyPay: string; + sessions: [string[]]; }; export const createProgram: RequestHandler = async (req, res, next) => { @@ -39,7 +43,7 @@ export const updateProgram: RequestHandler = async (req, res, next) => { const programId = req.params.id; const programData = req.body as Program; - const editedProgram = await ProgramFormModel.findOneAndUpdate({ _id: programId }, programData, { + const editedProgram = await ProgramModel.findOneAndUpdate({ _id: programId }, programData, { new: true, }); @@ -48,6 +52,10 @@ export const updateProgram: RequestHandler = async (req, res, next) => { } res.status(200).json(editedProgram); + } catch (error) { + next(error); + } +}; export const getAllPrograms: RequestHandler = async (req, res, next) => { try { diff --git a/backend/src/routes/program.ts b/backend/src/routes/program.ts index 7a52c996..c1cd0b7b 100644 --- a/backend/src/routes/program.ts +++ b/backend/src/routes/program.ts @@ -11,7 +11,7 @@ const router = express.Router(); router.post("/", ProgramValidator.createProgram, ProgramController.createProgram); router.patch("/:id", ProgramValidator.updateProgram, ProgramController.updateProgram); -router.post("/create", ProgramValidator.createForm, ProgramController.createForm); +router.post("/create", ProgramValidator.createProgram, ProgramController.createProgram); router.get("/all", ProgramController.getAllPrograms); export default router;