From 0655b58542fd081643de4884bac59ab11be253a9 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 2 Apr 2024 12:08:00 -0500 Subject: [PATCH 01/14] events begin --- package.json | 4 ++-- src/services/events/events-router.ts | 14 ++++++++++++ src/services/events/events-schema.ts | 34 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/services/events/events-router.ts create mode 100644 src/services/events/events-schema.ts diff --git a/package.json b/package.json index 43f0f88..a0331e9 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "private": true, "version": "0.0.0", "scripts": { - "dev": "ENV=DEVELOPMENT nodemon -w src/ -x tsx src/app.ts", - "start": "ENV=PRODUCTION tsx src/app.ts", + "dev": "nodemon -w src/ -x tsx src/app.ts", + "start": "tsx src/app.ts", "lint": "yarn prettier . --write", "kill": "kill -9 $(lsof -t -i :3000)", "build": "tsc" diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts new file mode 100644 index 0000000..cebbb2b --- /dev/null +++ b/src/services/events/events-router.ts @@ -0,0 +1,14 @@ +import { Router } from "express"; +import { Database } from "../database"; +import { StatusCodes } from "http-status-codes"; +import { createId } from "@paralleldrive/cuid2"; + +const authRouter = Router(); + +authRouter.get("/", async (req, res) => { +}); + +authRouter.post("/", async (req, res, next) => { +}); + +export default authRouter; \ No newline at end of file diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts new file mode 100644 index 0000000..b47e3ca --- /dev/null +++ b/src/services/events/events-schema.ts @@ -0,0 +1,34 @@ +import { Schema } from "mongoose"; +import { z } from "zod"; + +export const EventInfo = z.object({ + eventId: z.coerce.string().cuid2(), + name: z.string(), + date: z.date(), + start_time: z.date(), + end_time: z.date(), +}); + +export const EventSchema = new Schema({ + eventId: { + type: String, + required: true, + unique: true, + }, + name: { + type: String, + required: true, + }, + date: { + type: Date, + required: true + }, + start_time: { + type: Date, + required: true + }, + end_time: { + type: Date, + required: true + } +}); From de0e73f972f95e576d5c95fdd61af8accc579d57 Mon Sep 17 00:00:00 2001 From: riyap Date: Sun, 7 Apr 2024 17:41:02 -0500 Subject: [PATCH 02/14] post events --- src/app.ts | 2 ++ src/services/events/events-router.ts | 18 +++++++++++++----- src/services/events/events-schema.ts | 10 ++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/app.ts b/src/app.ts index c4bb74f..92c22a8 100644 --- a/src/app.ts +++ b/src/app.ts @@ -8,6 +8,7 @@ import bodyParser from "body-parser"; import errorHandler from "./middleware/error-handler"; import authRouter from "./services/auth/auth-router"; +import eventRouter from "./services/events/events-router"; const app = express(); @@ -21,6 +22,7 @@ app.use("/", morgan("dev")); app.use("/", bodyParser.json()); app.use("/auth", authRouter); +app.use('/api', eventRouter); app.get("/status", (_, res) => { console.log(StatusCodes.OK); diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index cebbb2b..471b8b4 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -1,14 +1,22 @@ import { Router } from "express"; -import { Database } from "../database"; +import { Database } from "../../database"; import { StatusCodes } from "http-status-codes"; import { createId } from "@paralleldrive/cuid2"; +import { Event, EventInfo} from './events-schema'; const authRouter = Router(); +// authRouter.get("/", async (req, res) => { +// }); -authRouter.get("/", async (req, res) => { -}); - -authRouter.post("/", async (req, res, next) => { +authRouter.post("/events", async (req, res, next) => { + try { + const validatedData = EventInfo.parse(req.body); + const event = new Event(validatedData); + await event.save(); + res.status(StatusCodes.CREATED).json(event); + } catch (error) { + next(error); + } }); export default authRouter; \ No newline at end of file diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index b47e3ca..8aaff35 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -1,12 +1,13 @@ +import mongoose from "mongoose"; import { Schema } from "mongoose"; import { z } from "zod"; -export const EventInfo = z.object({ +export const EventInfo= z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), - date: z.date(), - start_time: z.date(), - end_time: z.date(), + date: z.string().transform((str) => new Date(str)), + start_time: z.string().transform((str) => new Date(str)), + end_time: z.string().transform((str) => new Date(str)), }); export const EventSchema = new Schema({ @@ -32,3 +33,4 @@ export const EventSchema = new Schema({ required: true } }); +export const Event = mongoose.model('Event', EventSchema); From 24cef556edad2f430fc41824ef73bd6963e119c2 Mon Sep 17 00:00:00 2001 From: riyap Date: Mon, 8 Apr 2024 16:10:00 -0500 Subject: [PATCH 03/14] events but linted --- .github/workflows/build.yml | 48 ++++++++++++++-------------- src/app.ts | 2 +- src/services/events/events-router.ts | 10 +++--- src/services/events/events-schema.ts | 12 +++---- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b050e5..d837ecb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,24 +1,24 @@ -name: Prettier on Push and PR - -on: - push: - branches: - - 'main' - - 'dev**' - pull_request: - branches: - - 'main' - -jobs: - prettier: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - name: Install dependencies - run: yarn - - name: Run Prettier - run: npx prettier --write . \ No newline at end of file +name: Prettier on Push and PR + +on: + push: + branches: + - "main" + - "dev**" + pull_request: + branches: + - "main" + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "18.x" + - name: Install dependencies + run: yarn + - name: Run Prettier + run: npx prettier --write . diff --git a/src/app.ts b/src/app.ts index 92c22a8..f59e549 100644 --- a/src/app.ts +++ b/src/app.ts @@ -22,7 +22,7 @@ app.use("/", morgan("dev")); app.use("/", bodyParser.json()); app.use("/auth", authRouter); -app.use('/api', eventRouter); +app.use("/api", eventRouter); app.get("/status", (_, res) => { console.log(StatusCodes.OK); diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 471b8b4..5259801 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -2,7 +2,7 @@ import { Router } from "express"; import { Database } from "../../database"; import { StatusCodes } from "http-status-codes"; import { createId } from "@paralleldrive/cuid2"; -import { Event, EventInfo} from './events-schema'; +import { Event, EventInfo } from "./events-schema"; const authRouter = Router(); // authRouter.get("/", async (req, res) => { @@ -13,10 +13,10 @@ authRouter.post("/events", async (req, res, next) => { const validatedData = EventInfo.parse(req.body); const event = new Event(validatedData); await event.save(); - res.status(StatusCodes.CREATED).json(event); - } catch (error) { + return res.status(StatusCodes.CREATED).json(event); + } catch (error) { next(error); - } + } }); -export default authRouter; \ No newline at end of file +export default authRouter; diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 8aaff35..561cbb2 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -2,7 +2,7 @@ import mongoose from "mongoose"; import { Schema } from "mongoose"; import { z } from "zod"; -export const EventInfo= z.object({ +export const EventInfo = z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), date: z.string().transform((str) => new Date(str)), @@ -22,15 +22,15 @@ export const EventSchema = new Schema({ }, date: { type: Date, - required: true + required: true, }, start_time: { type: Date, - required: true + required: true, }, end_time: { type: Date, - required: true - } + required: true, + }, }); -export const Event = mongoose.model('Event', EventSchema); +export const Event = mongoose.model("Event", EventSchema); From de40d35285678c6ee79b91d6dd1993447993d602 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 17:31:50 -0500 Subject: [PATCH 04/14] Update src/services/events/events-router.ts Co-authored-by: Aydan Pirani --- src/services/events/events-router.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 5259801..9a7bfb8 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -1,5 +1,4 @@ import { Router } from "express"; -import { Database } from "../../database"; import { StatusCodes } from "http-status-codes"; import { createId } from "@paralleldrive/cuid2"; import { Event, EventInfo } from "./events-schema"; From 1f54da95471036e58cfdb5dec178c24b038898ca Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 17:31:57 -0500 Subject: [PATCH 05/14] Update src/services/events/events-router.ts Co-authored-by: Aydan Pirani --- src/services/events/events-router.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 9a7bfb8..10dd386 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -1,6 +1,5 @@ import { Router } from "express"; import { StatusCodes } from "http-status-codes"; -import { createId } from "@paralleldrive/cuid2"; import { Event, EventInfo } from "./events-schema"; const authRouter = Router(); From 5cd4a39ea883d8c70ac2ef4026e8fe357b407920 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 17:58:42 -0500 Subject: [PATCH 06/14] pr fixes for basic events --- src/app.ts | 2 +- src/database.ts | 2 ++ src/services/events/events-router.ts | 10 +++++----- src/services/events/events-schema.ts | 11 +++-------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/app.ts b/src/app.ts index f59e549..81276cb 100644 --- a/src/app.ts +++ b/src/app.ts @@ -22,7 +22,7 @@ app.use("/", morgan("dev")); app.use("/", bodyParser.json()); app.use("/auth", authRouter); -app.use("/api", eventRouter); +app.use("/event", eventRouter); app.get("/status", (_, res) => { console.log(StatusCodes.OK); diff --git a/src/database.ts b/src/database.ts index 2e8c4c5..9394232 100644 --- a/src/database.ts +++ b/src/database.ts @@ -1,5 +1,6 @@ import mongoose, { Schema } from "mongoose"; import { RoleInfo, RoleSchema } from "./services/auth/auth-schema"; +import {EventSchema, EventValidator} from "./services/events/events-schema" mongoose.set("toObject", { versionKey: false }); @@ -32,4 +33,5 @@ function initializeModel( // Example usage export const Database = { ROLES: initializeModel("roles", RoleSchema, RoleInfo), + Event: initializeModel("Event", EventSchema, EventValidator), }; diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 5259801..4b21779 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -2,15 +2,15 @@ import { Router } from "express"; import { Database } from "../../database"; import { StatusCodes } from "http-status-codes"; import { createId } from "@paralleldrive/cuid2"; -import { Event, EventInfo } from "./events-schema"; +import { Event, EventValidator } from "./events-schema"; -const authRouter = Router(); +const eventRouter = Router(); // authRouter.get("/", async (req, res) => { // }); -authRouter.post("/events", async (req, res, next) => { +eventRouter.post("/events", async (req, res, next) => { try { - const validatedData = EventInfo.parse(req.body); + const validatedData = EventValidator.parse(req.body); const event = new Event(validatedData); await event.save(); return res.status(StatusCodes.CREATED).json(event); @@ -19,4 +19,4 @@ authRouter.post("/events", async (req, res, next) => { } }); -export default authRouter; +export default eventRouter; diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 561cbb2..bc4ba24 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -2,12 +2,11 @@ import mongoose from "mongoose"; import { Schema } from "mongoose"; import { z } from "zod"; -export const EventInfo = z.object({ +export const EventValidator = z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), - date: z.string().transform((str) => new Date(str)), - start_time: z.string().transform((str) => new Date(str)), - end_time: z.string().transform((str) => new Date(str)), + start_time: z.coerce.string().datetime(), + end_time: z.coerce.string().datetime() }); export const EventSchema = new Schema({ @@ -20,10 +19,6 @@ export const EventSchema = new Schema({ type: String, required: true, }, - date: { - type: Date, - required: true, - }, start_time: { type: Date, required: true, From c6c74c97abb26e9232fed84aaeeb21d238e263e2 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 18:08:43 -0500 Subject: [PATCH 07/14] linted too --- src/database.ts | 2 +- src/services/events/events-schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database.ts b/src/database.ts index 9394232..471c818 100644 --- a/src/database.ts +++ b/src/database.ts @@ -1,6 +1,6 @@ import mongoose, { Schema } from "mongoose"; import { RoleInfo, RoleSchema } from "./services/auth/auth-schema"; -import {EventSchema, EventValidator} from "./services/events/events-schema" +import { EventSchema, EventValidator } from "./services/events/events-schema"; mongoose.set("toObject", { versionKey: false }); diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index bc4ba24..26b4116 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -6,7 +6,7 @@ export const EventValidator = z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), start_time: z.coerce.string().datetime(), - end_time: z.coerce.string().datetime() + end_time: z.coerce.string().datetime(), }); export const EventSchema = new Schema({ From 4b1c8ab1fbc9446484ce23ffa9e865c9d87001d7 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 18:21:47 -0500 Subject: [PATCH 08/14] Update src/database.ts Co-authored-by: Aydan Pirani --- src/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database.ts b/src/database.ts index 471c818..2061d8a 100644 --- a/src/database.ts +++ b/src/database.ts @@ -33,5 +33,5 @@ function initializeModel( // Example usage export const Database = { ROLES: initializeModel("roles", RoleSchema, RoleInfo), - Event: initializeModel("Event", EventSchema, EventValidator), + EVENT: initializeModel("events", EventSchema, EventValidator), }; From 1bc5fa6d90ceb1ae313c15e37e961f5c96ab3837 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 18:22:17 -0500 Subject: [PATCH 09/14] Update src/services/events/events-schema.ts Co-authored-by: Aydan Pirani --- src/services/events/events-schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 26b4116..f1a3d59 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -5,8 +5,8 @@ import { z } from "zod"; export const EventValidator = z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), - start_time: z.coerce.string().datetime(), - end_time: z.coerce.string().datetime(), + startTime: z.coerce.string().datetime(), + endTime: z.coerce.string().datetime(), }); export const EventSchema = new Schema({ From fd4ede4720d9e36316da2327e8fefd9a072e14bf Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 18:22:23 -0500 Subject: [PATCH 10/14] Update src/services/events/events-schema.ts Co-authored-by: Aydan Pirani --- src/services/events/events-schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index f1a3d59..91f6b1e 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -19,11 +19,11 @@ export const EventSchema = new Schema({ type: String, required: true, }, - start_time: { + startTime: { type: Date, required: true, }, - end_time: { + endTime: { type: Date, required: true, }, From 01a61c9d9bd1e26aa262b7076afc0fb2fb8b63c4 Mon Sep 17 00:00:00 2001 From: riyap Date: Tue, 9 Apr 2024 18:57:12 -0500 Subject: [PATCH 11/14] hopefully done events --- src/services/events/events-router.ts | 5 +++-- src/services/events/events-schema.ts | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 29181bf..700e247 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -1,6 +1,7 @@ import { Router } from "express"; import { StatusCodes } from "http-status-codes"; -import { Event, EventValidator } from "./events-schema"; +import { EventValidator } from "./events-schema"; +import { Database } from "../../database"; const eventRouter = Router(); // authRouter.get("/", async (req, res) => { @@ -9,7 +10,7 @@ const eventRouter = Router(); eventRouter.post("/events", async (req, res, next) => { try { const validatedData = EventValidator.parse(req.body); - const event = new Event(validatedData); + const event = new Database.EVENT(validatedData); await event.save(); return res.status(StatusCodes.CREATED).json(event); } catch (error) { diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 91f6b1e..6df2fef 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -1,12 +1,12 @@ -import mongoose from "mongoose"; +// import mongoose from "mongoose"; import { Schema } from "mongoose"; import { z } from "zod"; export const EventValidator = z.object({ eventId: z.coerce.string().cuid2(), name: z.string(), - startTime: z.coerce.string().datetime(), - endTime: z.coerce.string().datetime(), + startTime: z.coerce.date(), + endTime: z.coerce.date(), }); export const EventSchema = new Schema({ @@ -28,4 +28,4 @@ export const EventSchema = new Schema({ required: true, }, }); -export const Event = mongoose.model("Event", EventSchema); +// export const Event = mongoose.model("Event", EventSchema); From a3745c9e457a1f9b77f8e3cda218645ebddd3250 Mon Sep 17 00:00:00 2001 From: riyap Date: Wed, 10 Apr 2024 23:27:47 -0500 Subject: [PATCH 12/14] added points --- src/services/events/events-router.ts | 2 +- src/services/events/events-schema.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 700e247..4aa29c6 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -12,7 +12,7 @@ eventRouter.post("/events", async (req, res, next) => { const validatedData = EventValidator.parse(req.body); const event = new Database.EVENT(validatedData); await event.save(); - return res.status(StatusCodes.CREATED).json(event); + return res.status(StatusCodes.CREATED).json(event.toObject()); } catch (error) { next(error); } diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 6df2fef..22eef8a 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -7,6 +7,7 @@ export const EventValidator = z.object({ name: z.string(), startTime: z.coerce.date(), endTime: z.coerce.date(), + points: z.number().min(0), }); export const EventSchema = new Schema({ @@ -27,5 +28,10 @@ export const EventSchema = new Schema({ type: Date, required: true, }, + + points: { + type: Number, + required: true, + }, }); // export const Event = mongoose.model("Event", EventSchema); From 51bfcfce11732a095c649c237ba9d66383ef9247 Mon Sep 17 00:00:00 2001 From: riyap Date: Wed, 10 Apr 2024 23:48:48 -0500 Subject: [PATCH 13/14] made rest of suggestions im silly --- src/database.ts | 2 +- src/services/events/events-router.ts | 6 ++---- src/services/events/events-schema.ts | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/database.ts b/src/database.ts index 2061d8a..cb789e3 100644 --- a/src/database.ts +++ b/src/database.ts @@ -33,5 +33,5 @@ function initializeModel( // Example usage export const Database = { ROLES: initializeModel("roles", RoleSchema, RoleInfo), - EVENT: initializeModel("events", EventSchema, EventValidator), + EVENTS: initializeModel("events", EventSchema, EventValidator), }; diff --git a/src/services/events/events-router.ts b/src/services/events/events-router.ts index 4aa29c6..ea035a8 100644 --- a/src/services/events/events-router.ts +++ b/src/services/events/events-router.ts @@ -4,13 +4,11 @@ import { EventValidator } from "./events-schema"; import { Database } from "../../database"; const eventRouter = Router(); -// authRouter.get("/", async (req, res) => { -// }); -eventRouter.post("/events", async (req, res, next) => { +eventRouter.post("/", async (req, res, next) => { try { const validatedData = EventValidator.parse(req.body); - const event = new Database.EVENT(validatedData); + const event = new Database.EVENTS(validatedData); await event.save(); return res.status(StatusCodes.CREATED).json(event.toObject()); } catch (error) { diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index 22eef8a..e1b6aac 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -3,7 +3,7 @@ import { Schema } from "mongoose"; import { z } from "zod"; export const EventValidator = z.object({ - eventId: z.coerce.string().cuid2(), + eventId: z.coerce.string(), name: z.string(), startTime: z.coerce.date(), endTime: z.coerce.date(), @@ -34,4 +34,3 @@ export const EventSchema = new Schema({ required: true, }, }); -// export const Event = mongoose.model("Event", EventSchema); From e4072a8fa58659fcb7faa9c8736723af5822c8cf Mon Sep 17 00:00:00 2001 From: Divya Koya <90989518+divyack2@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:13:22 -0500 Subject: [PATCH 14/14] Update src/services/events/events-schema.ts removed the import mongoose statement Co-authored-by: Aydan Pirani --- src/services/events/events-schema.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/services/events/events-schema.ts b/src/services/events/events-schema.ts index e1b6aac..b9731e2 100644 --- a/src/services/events/events-schema.ts +++ b/src/services/events/events-schema.ts @@ -1,4 +1,3 @@ -// import mongoose from "mongoose"; import { Schema } from "mongoose"; import { z } from "zod";