···1515 href: "",
1616 icon: "layout-dashboard",
1717 },
1818- {
1919- title: "Endpoints",
2020- description: "Keep track of all your endpoints.",
2121- href: "/endpoint",
2222- icon: "link",
2323- },
1818+2419 {
2520 title: "Monitors",
2621 description: "Check all the responses in one place.",
2727- href: "/monitor",
2222+ href: "/monitors",
2823 icon: "activity",
2924 },
3025 {
3131- title: "Pages",
2626+ title: "Status Pages",
3227 description: "Wher you can see all the pages.",
3333- href: "/page",
2828+ href: "/status-pages",
3429 icon: "panel-top",
3530 },
3631 {
3732 title: "Incidents",
3833 description: "War room where you handle the incidents.",
3939- href: "/incident",
3434+ href: "/incidents",
4035 icon: "siren",
4141- disabled: true,
4236 },
4337 // ...
4438] satisfies Page[];
-1
apps/web/src/middleware.ts
···3232 auth.userId &&
3333 (req.nextUrl.pathname === "/app" || req.nextUrl.pathname === "/app/")
3434 ) {
3535- console.log(auth.userId);
3635 // improve on sign-up if the webhook has not been triggered yet
3736 const userQuery = db
3837 .select()
+16-4
packages/db/src/schema/monitor.ts
···88 varchar,
99} from "drizzle-orm/mysql-core";
1010import { createInsertSchema, createSelectSchema } from "drizzle-zod";
1111+import { z } from "zod";
11121213import { page } from "./page";
1314import { workspace } from "./workspace";
···3132 .default("inactive")
3233 .notNull(),
33343434- url: varchar("url", { length: 512 }),
3535+ url: varchar("url", { length: 512 }).notNull(),
35363636- name: varchar("name", { length: 256 }),
3737- description: text("description"),
3737+ name: varchar("name", { length: 256 }).default("").notNull(),
3838+ description: text("description").default("").notNull(),
38393940 pageId: int("page_id"),
4041 workspaceId: int("workspace_id"),
···5455 }),
5556}));
56575858+export const periodicityEnum = z.enum([
5959+ "1m",
6060+ "5m",
6161+ "10m",
6262+ "30m",
6363+ "1h",
6464+ "other",
6565+]);
5766// Schema for inserting a Monitor - can be used to validate API requests
5858-export const insertMonitorSchema = createInsertSchema(monitor);
6767+export const insertMonitorSchema = createInsertSchema(monitor, {
6868+ periodicity: periodicityEnum,
6969+ url: z.string().url(),
7070+});
59716072// Schema for selecting a Monitor - can be used to validate API responses
6173export const selectMonitorSchema = createSelectSchema(monitor);
+8-4
packages/db/src/schema/page.ts
···77 varchar,
88} from "drizzle-orm/mysql-core";
99import { createInsertSchema, createSelectSchema } from "drizzle-zod";
1010+import { z } from "zod";
10111112import { incident } from "./incident";
1213import { monitor } from "./monitor";
···16171718 workspaceId: int("workspace_id").notNull(),
18191919- title: text("title"), // title of the page
2020+ title: text("title").notNull(), // title of the page
2121+ description: text("description").notNull(), // description of the page
2022 icon: varchar("icon", { length: 256 }), // icon of the page
2121- slug: varchar("slug", { length: 256 }), // which is used for https://slug.openstatus.dev
2222- customDomain: varchar("custom_domain", { length: 256 }),
2323+ slug: varchar("slug", { length: 256 }).notNull(), // which is used for https://slug.openstatus.dev
2424+ customDomain: varchar("custom_domain", { length: 256 }).notNull().default(""),
23252426 // We should store settings of the page
2527 // theme
···3840}));
39414042// Schema for inserting a Page - can be used to validate API requests
4141-export const insertPageSchema = createInsertSchema(page);
4343+export const insertPageSchema = createInsertSchema(page, {
4444+ customDomain: z.string().optional(),
4545+});
42464347// Schema for selecting a Page - can be used to validate API responses
4448export const selectPageSchema = createSelectSchema(page);