Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
feat: Turso experimentation (#75)
Thibault Le Ouay76415ac73684
diff --git a/.gitignore b/.gitignoreindex 1c227705c..95515f61c 100644--- a/.gitignore+++ b/.gitignore@@ -38,4 +38,13 @@ yarn-error.log*# packagesdistpackages/emails/.react-email+packages/db/database.db+packages/db/openstatus.db+packages/db/database.db-wal+packages/db/database.db-shm+packages/db/openstatus.db-shm+packages/db/openstatus.db-wal+openstatus.db-wal+openstatus.db+openstatus.db-shmpackages/tinybird/.tinybdiff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.tsindex 4371938b8..bf66303ae 100644--- a/apps/web/src/app/api/checker/cron/_cron.ts+++ b/apps/web/src/app/api/checker/cron/_cron.ts@@ -1,9 +1,7 @@-import { NextResponse } from "next/server";import { Client } from "@upstash/qstash/cloudflare";import type { z } from "zod";-import { db, eq } from "@openstatus/db";-import { monitor, selectMonitorSchema } from "@openstatus/db/src/schema";+import { selectMonitorSchema } from "@openstatus/db/src/schema";import { availableRegions } from "@openstatus/tinybird";import { env } from "@/env.mjs";diff --git a/apps/web/src/app/app/(dashboard)/[workspaceId]/monitors/page.tsx b/apps/web/src/app/app/(dashboard)/[workspaceId]/monitors/page.tsxindex c6ec15850..0a30e02cc 100644--- a/apps/web/src/app/app/(dashboard)/[workspaceId]/monitors/page.tsx+++ b/apps/web/src/app/app/(dashboard)/[workspaceId]/monitors/page.tsx@@ -23,7 +23,7 @@ export default async function MonitorPage({<Header title="Monitors" description="Overview of all your monitors."><CreateForm {...{ workspaceId }} /></Header>- {monitors.map((monitor, index) => (+ {monitors?.map((monitor, index) => (<Containerkey={index}title={monitor.name}diff --git a/apps/web/src/components/forms/montitor-form.tsx b/apps/web/src/components/forms/montitor-form.tsxindex 962f25e37..98da6228f 100644--- a/apps/web/src/components/forms/montitor-form.tsx+++ b/apps/web/src/components/forms/montitor-form.tsx@@ -114,7 +114,6 @@ export function MonitorForm({ id, defaultValues, onSubmit }: Props) {</FormDescription></div><FormControl>- {/* TODO: make the monitor.active a boolean value */}<Switchchecked={field.value === "active" ? true : false}onCheckedChange={(value) =>diff --git a/apps/web/src/components/forms/status-page-form.tsx b/apps/web/src/components/forms/status-page-form.tsxindex d5eab5af3..4642b14b8 100644--- a/apps/web/src/components/forms/status-page-form.tsx+++ b/apps/web/src/components/forms/status-page-form.tsx@@ -32,6 +32,7 @@ export function StatusPageForm({ id, defaultValues, onSubmit }: Props) {title: defaultValues?.title || "",slug: defaultValues?.slug || "",description: defaultValues?.description || "",+ workspaceId: defaultValues?.workspaceId || 0,},});diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.tsindex 3e6ed299b..e901fd545 100644--- a/apps/web/src/middleware.ts+++ b/apps/web/src/middleware.ts@@ -73,6 +73,7 @@ export default authMiddleware({auth.userId &&(req.nextUrl.pathname === "/app" || req.nextUrl.pathname === "/app/")) {+ console.log(auth.userId);// improve on sign-up if the webhook has not been triggered yetconst userQuery = db.select()@@ -83,9 +84,8 @@ export default authMiddleware({.select().from(usersToWorkspaces).innerJoin(userQuery, eq(userQuery.id, usersToWorkspaces.userId))- .execute();-- if (result.length) {+ .all();+ if (result.length > 0) {const orgSelection = new URL(`/app/${result[0].users_to_workspaces.workspaceId}/dashboard`,req.url,diff --git a/packages/api/src/router/clerk/webhook.ts b/packages/api/src/router/clerk/webhook.tsindex 1c8ffbb46..31b446787 100644--- a/packages/api/src/router/clerk/webhook.ts+++ b/packages/api/src/router/clerk/webhook.ts@@ -19,25 +19,29 @@ export const webhookRouter = createTRPCRouter({const alreadyExists = await opts.ctx.db.select({ id: user.id }).from(user)- .where(eq(user.tenantId, opts.input.data.data.id));-- if (alreadyExists.length) return;-+ .where(eq(user.tenantId, opts.input.data.data.id))+ .get();+ if (alreadyExists) return;const userResult = await opts.ctx.db.insert(user).values({tenantId: opts.input.data.data.id,})- .execute();- const workspaceResult = await opts.ctx.db.insert(workspace).values({});-+ .returning({ id: user.id })+ .get();+ const workspaceResult = await opts.ctx.db+ .insert(workspace)+ .values({ name: "" })+ .returning({ id: workspace.id })+ .get();await opts.ctx.db.insert(usersToWorkspaces).values({- userId: Number(userResult.insertId),- workspaceId: Number(workspaceResult.insertId),+ userId: userResult.id,+ workspaceId: workspaceResult.id,})- .execute();+ .returning()+ .get();}}),userUpdated: webhookProcedure.mutation(async (opts) => {diff --git a/packages/api/src/router/incident.ts b/packages/api/src/router/incident.tsindex 1d7b3e816..4a80ee1fb 100644--- a/packages/api/src/router/incident.ts+++ b/packages/api/src/router/incident.ts@@ -15,13 +15,17 @@ export const incidentRouter = createTRPCRouter({createIncident: protectedProcedure.input(insertIncidentSchema).mutation(async (opts) => {- await opts.ctx.db.insert(incident).values(opts.input).execute();+ return opts.ctx.db.insert(incident).values(opts.input).returning().get();}),createIncidentUpdate: protectedProcedure.input(insertIncidentUpdateSchema).mutation(async (opts) => {- await opts.ctx.db.insert(incidentUpdate).values(opts.input).execute();+ return opts.ctx.db+ .insert(incidentUpdate)+ .values(opts.input)+ .returning()+ .get();}),updateIncident: protectedProcedure@@ -32,11 +36,12 @@ export const incidentRouter = createTRPCRouter({}),).mutation(async (opts) => {- await opts.ctx.db+ return opts.ctx.db.update(incident).set(opts.input.status).where(eq(incident.id, opts.input.incidentId))- .execute();+ .returning()+ .get();}),getIncidentByWorkspace: protectedProcedure.input(z.object({ workspaceId: z.number() }))@@ -50,6 +55,6 @@ export const incidentRouter = createTRPCRouter({.select().from(incident).innerJoin(pageQuery, eq(incident.pageId, pageQuery.id))- .execute();+ .all();}),});diff --git a/packages/api/src/router/monitor.ts b/packages/api/src/router/monitor.tsindex 0eae82860..fb2e66878 100644--- a/packages/api/src/router/monitor.ts+++ b/packages/api/src/router/monitor.ts@@ -1,7 +1,13 @@import { z } from "zod";import { eq } from "@openstatus/db";-import { insertMonitorSchema, monitor } from "@openstatus/db/src/schema";+import {+ insertMonitorSchema,+ monitor,+ selectMonitorSchema,+ user,+ usersToWorkspaces,+} from "@openstatus/db/src/schema";import { createTRPCRouter, protectedProcedure } from "../trpc";@@ -9,15 +15,50 @@ export const monitorRouter = createTRPCRouter({createMonitor: protectedProcedure.input(insertMonitorSchema).mutation(async (opts) => {- await opts.ctx.db.insert(monitor).values(opts.input).execute();+ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(opts.input.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ // the user don't have access to this workspace+ if (!result.users_to_workspaces) return;++ await opts.ctx.db.insert(monitor).values(opts.input).returning().get();}),getMonitorById: protectedProcedure.input(z.object({ id: z.number() })).query(async (opts) => {- return await opts.ctx.db.query.monitor- .findFirst({ where: eq(monitor.id, opts.input.id) })- .execute();+ const mon = await opts.ctx.db.query.monitor.findFirst({+ where: eq(monitor.id, opts.input.id),+ });++ if (!mon) return;+ // We make sure user as access to this workspace+ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(eq(usersToWorkspaces.workspaceId, Number(mon.workspaceId)))+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;++ return mon;}),updateMonitorDescription: protectedProcedure@@ -28,23 +69,63 @@ export const monitorRouter = createTRPCRouter({}),).mutation(async (opts) => {- await opts.ctx.db+ // We make sure user as access to this workspace and the monitor+ const currentMonitor = await opts.ctx.db+ .select()+ .from(monitor)+ .where(eq(monitor.id, opts.input.monitorId))+ .get();++ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(currentMonitor.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;++ opts.ctx.db.update(monitor).set({ description: opts.input.description })- .where(eq(monitor.id, opts.input.monitorId))- .execute();+ .where(eq(monitor.id, opts.input.monitorId));}),updateMonitor: protectedProcedure.input(insertMonitorSchema).mutation(async (opts) => {- console.log(opts.input);- const r = await opts.ctx.db+ const currentMonitor = await opts.ctx.db+ .select()+ .from(monitor)+ .where(eq(monitor.id, Number(opts.input.id)))+ .get();++ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(currentMonitor.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;++ opts.ctx.db.update(monitor).set(opts.input)- .where(eq(monitor.id, Number(opts.input.id)))- .execute();- console.log(r);- return r;+ .where(eq(monitor.id, Number(opts.input.id)));}),updateMonitorStatus: protectedProcedure.input(@@ -54,27 +135,88 @@ export const monitorRouter = createTRPCRouter({}),).mutation(async (opts) => {- return await opts.ctx.db+ const currentMonitor = await opts.ctx.db+ .select()+ .from(monitor)+ .where(eq(monitor.id, opts.input.id))+ .get();++ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(currentMonitor.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;++ await opts.ctx.db.update(monitor).set(opts.input.status)- .where(eq(monitor.id, opts.input.id))- .execute();+ .where(eq(monitor.id, opts.input.id));}),deleteMonitor: protectedProcedure.input(z.object({ monitorId: z.number() })).mutation(async (opts) => {- await opts.ctx.db- .delete(monitor)- .where(eq(monitor.id, opts.input.monitorId));+ const currentMonitor = await opts.ctx.db+ .select()+ .from(monitor)+ .where(eq(monitor.id, opts.input.monitorId))+ .get();++ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(currentMonitor.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;++ opts.ctx.db.delete(monitor).where(eq(monitor.id, opts.input.monitorId));}),getMonitorsByWorkspace: protectedProcedure.input(z.object({ workspaceId: z.number() })).query(async (opts) => {- return await opts.ctx.db+ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(opts.input.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ // the user don't have access to this workspace+ if (!result.users_to_workspaces) return;++ const monitors = await opts.ctx.db.select().from(monitor).where(eq(monitor.workspaceId, opts.input.workspaceId))- .execute();+ .all();+ const selectMonitorsArray = selectMonitorSchema.array();++ return selectMonitorsArray.parse(monitors);}),});diff --git a/packages/api/src/router/page.ts b/packages/api/src/router/page.tsindex ac5ff2893..53de55e7c 100644--- a/packages/api/src/router/page.ts+++ b/packages/api/src/router/page.ts@@ -1,7 +1,13 @@import { z } from "zod";import { eq } from "@openstatus/db";-import { insertPageSchema, page } from "@openstatus/db/src/schema";+import {+ insertPageSchema,+ page,+ selectIncidentSchema,+ selectMonitorSchema,+ selectPageSchema,+} from "@openstatus/db/src/schema";import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";@@ -10,36 +16,40 @@ export const pageRouter = createTRPCRouter({createPage: protectedProcedure.input(insertPageSchema).mutation(async (opts) => {- await opts.ctx.db.insert(page).values(opts.input).execute();+ return opts.ctx.db.insert(page).values(opts.input).returning().get();}),getPageById: protectedProcedure.input(z.object({ id: z.number() })).query(async (opts) => {- return await opts.ctx.db.query.page- .findFirst({- where: eq(page.id, opts.input.id),- with: { monitors: true, incidents: true },- })- .execute();+ return await opts.ctx.db.query.page.findFirst({+ where: eq(page.id, opts.input.id),+ with: { monitors: true, incidents: true },+ });}),getPageByWorkspace: protectedProcedure.input(z.object({ workspaceId: z.number() })).query(async (opts) => {- return await opts.ctx.db+ return opts.ctx.db.select().from(page)- .where(eq(page.workspaceId, opts.input.workspaceId));+ .where(eq(page.workspaceId, opts.input.workspaceId))+ .all();}),+// public if we use trpc hooks to get the page from the urlgetPageBySlug: publicProcedure.input(z.object({ slug: z.string() })).query(async (opts) => {- return await opts.ctx.db.query.page- .findFirst({- where: eq(page.slug, opts.input.slug),- with: { monitors: true, incidents: true },- })- .execute();+ const result = opts.ctx.db.query.page.findFirst({+ where: eq(page.slug, opts.input.slug),+ with: { monitors: true, incidents: true },+ });+ const selectPageSchemaWithRelation = selectPageSchema.extend({+ monitors: z.array(selectMonitorSchema),+ incidents: z.array(selectIncidentSchema),+ });++ return selectPageSchemaWithRelation.parse(result);}),});diff --git a/packages/api/src/router/workspace.ts b/packages/api/src/router/workspace.tsindex 911be6d76..08132e7f7 100644--- a/packages/api/src/router/workspace.ts+++ b/packages/api/src/router/workspace.ts@@ -1,12 +1,7 @@import { z } from "zod";import { eq } from "@openstatus/db";-import {- page,- user,- usersToWorkspaces,- workspace,-} from "@openstatus/db/src/schema";+import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema";import { createTRPCRouter, protectedProcedure } from "../trpc";@@ -26,9 +21,25 @@ export const workspaceRouter = createTRPCRouter({getWorkspace: protectedProcedure.input(z.object({ workspaceId: z.number() })).query(async (opts) => {+ const currentUser = opts.ctx.db+ .select()+ .from(user)+ .where(eq(user.tenantId, opts.ctx.auth.userId))+ .as("currentUser");+ const result = await opts.ctx.db+ .select()+ .from(usersToWorkspaces)+ .where(+ eq(usersToWorkspaces.workspaceId, Number(opts.input.workspaceId)),+ )+ .innerJoin(currentUser, eq(usersToWorkspaces.userId, currentUser.id))+ .get();++ if (!result.users_to_workspaces) return;+return await opts.ctx.db.query.workspace.findMany({with: {- page: true,+ pages: true,},where: eq(workspace.id, opts.input.workspaceId),});@@ -37,9 +48,10 @@ export const workspaceRouter = createTRPCRouter({createWorkspace: protectedProcedure.input(z.object({ name: z.string() })).mutation(async (opts) => {- await opts.ctx.db+ return opts.ctx.db.insert(workspace).values({ name: opts.input.name })- .execute();+ .returning()+ .get();}),});diff --git a/packages/db/drizzle.config.ts b/packages/db/drizzle.config.tsindex 123958503..a209d1409 100644--- a/packages/db/drizzle.config.ts+++ b/packages/db/drizzle.config.ts@@ -8,7 +8,9 @@ export default {schema: "./src/schema/index.ts",out: "./drizzle",dbCredentials: {- connectionString: env.DATABASE_URL,+ url: env.DATABASE_URL,+ authToken: env.DATABASE_AUTH_TOKEN,},- driver: "mysql2",+ driver: "turso",+ strict: true,} satisfies Config;diff --git a/packages/db/drizzle/0000_nebulous_shape.sql b/packages/db/drizzle/0000_nebulous_shape.sqlnew file mode 100644index 000000000..d7802c53f--- /dev/null+++ b/packages/db/drizzle/0000_nebulous_shape.sql@@ -0,0 +1,71 @@+CREATE TABLE `incident` (+ `id` integer PRIMARY KEY NOT NULL,+ `status` text(2) NOT NULL,+ `page_id` integer NOT NULL,+ `updated_at` integer DEFAULT (strftime('%s', 'now')),+ FOREIGN KEY (`page_id`) REFERENCES `page`(`id`) ON UPDATE no action ON DELETE no action+);+--> statement-breakpoint+CREATE TABLE `incident_update` (+ `id` integer PRIMARY KEY NOT NULL,+ `incident_date` integer,+ `title` text(256),+ `message` text,+ `incident_id` integer NOT NULL,+ `updated_at` integer DEFAULT (strftime('%s', 'now')),+ FOREIGN KEY (`incident_id`) REFERENCES `incident`(`id`) ON UPDATE no action ON DELETE no action+);+--> statement-breakpoint+CREATE TABLE `page` (+ `id` integer PRIMARY KEY NOT NULL,+ `workspace_id` integer NOT NULL,+ `title` text NOT NULL,+ `description` text NOT NULL,+ `icon` text(256),+ `slug` text(256) NOT NULL,+ `custom_domain` text(256) DEFAULT '' NOT NULL,+ `updated_at` integer DEFAULT (strftime('%s', 'now')),+ FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action+);+--> statement-breakpoint+CREATE TABLE `monitor` (+ `id` integer PRIMARY KEY NOT NULL,+ `job_type` text(3) DEFAULT 'other' NOT NULL,+ `periodicity` text(6) DEFAULT 'other' NOT NULL,+ `status` text(2) DEFAULT 'inactive' NOT NULL,+ `active` integer DEFAULT false,+ `url` text(512) NOT NULL,+ `name` text(256) DEFAULT '' NOT NULL,+ `description` text DEFAULT '' NOT NULL,+ `page_id` integer,+ `workspace_id` integer,+ `updated_at` integer DEFAULT (strftime('%s', 'now')),+ FOREIGN KEY (`page_id`) REFERENCES `page`(`id`) ON UPDATE no action ON DELETE no action,+ FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action+);+--> statement-breakpoint+CREATE TABLE `user` (+ `id` integer PRIMARY KEY NOT NULL,+ `tenant_id` text(256),+ `updated_at` integer DEFAULT (strftime('%s', 'now'))+);+--> statement-breakpoint+CREATE TABLE `users_to_workspaces` (+ `user_id` integer NOT NULL,+ `workspace_id` integer NOT NULL,+ PRIMARY KEY(`user_id`, `workspace_id`),+ FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action,+ FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action+);+--> statement-breakpoint+CREATE TABLE `workspace` (+ `id` integer PRIMARY KEY NOT NULL,+ `stripe_id` text(256),+ `name` text,+ `updated_at` integer DEFAULT (strftime('%s', 'now'))+);+--> statement-breakpoint+CREATE UNIQUE INDEX `page_slug_unique` ON `page` (`slug`);--> statement-breakpoint+CREATE UNIQUE INDEX `page_custom_domain_unique` ON `page` (`custom_domain`);--> statement-breakpoint+CREATE UNIQUE INDEX `user_tenant_id_unique` ON `user` (`tenant_id`);--> statement-breakpoint+CREATE UNIQUE INDEX `workspace_stripe_id_unique` ON `workspace` (`stripe_id`);\ No newline at end of filediff --git a/packages/db/drizzle/0000_overconfident_molten_man.sql b/packages/db/drizzle/0000_overconfident_molten_man.sqldeleted file mode 100644index 857b0f811..000000000--- a/packages/db/drizzle/0000_overconfident_molten_man.sql+++ /dev/null@@ -1,45 +0,0 @@-CREATE TABLE `incident` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `status` enum('resolved','investigatin',''),- `page_id` int,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `incidentUpdate` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `incident_date` datetime,- `title` varchar(256),- `message` text,- `incident_id` int NOT NULL,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `page` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `workspace_id` int NOT NULL,- `slug` varchar(256),- `custom_domain` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `statusJob` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `job_type` enum('website','cron','other') NOT NULL DEFAULT 'other',- `periodicity` enum('every-5-min','every-1-min','every-1-h','other') NOT NULL DEFAULT 'other',- `status` enum('active','inactive') NOT NULL DEFAULT 'inactive',- `url` varchar(512),- `page_id` int NOT NULL,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `user` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `tenant_id` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `workspace` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `stripe_id` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);diff --git a/packages/db/drizzle/0000_superb_hercules.sql b/packages/db/drizzle/0000_superb_hercules.sqldeleted file mode 100644index 8712c341c..000000000--- a/packages/db/drizzle/0000_superb_hercules.sql+++ /dev/null@@ -1,45 +0,0 @@-CREATE TABLE `incident` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `status` enum('resolved','investigatin',''),- `page_id` int,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `incidentUpdate` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `incident_date` datetime,- `title` varchar(256),- `message` text,- `incident_id` int NOT NULL,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `page` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `workspace_id` int NOT NULL,- `slug` varchar(256),- `custom_domain` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `monitor` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `job_type` enum('website','cron','other') NOT NULL DEFAULT 'other',- `periodicity` enum('1m','5m','10m','30m','1h','other') NOT NULL DEFAULT 'other',- `status` enum('active','inactive') NOT NULL DEFAULT 'inactive',- `url` varchar(512),- `page_id` int NOT NULL,- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `user` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `tenant_id` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);---> statement-breakpoint-CREATE TABLE `workspace` (- `id` int AUTO_INCREMENT PRIMARY KEY NOT NULL,- `stripe_id` varchar(256),- `created_at` timestamp NOT NULL DEFAULT (now()),- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP);diff --git a/packages/db/drizzle/meta/0000_snapshot.json b/packages/db/drizzle/meta/0000_snapshot.jsonindex 7b26ff96c..c2c986885 100644--- a/packages/db/drizzle/meta/0000_snapshot.json+++ b/packages/db/drizzle/meta/0000_snapshot.json@@ -1,7 +1,7 @@{"version": "5",- "dialect": "mysql",- "id": "b1ca2235-8b2f-4bb6-b382-484f98713c32",+ "dialect": "sqlite",+ "id": "1c9c9848-d580-4543-9104-566450666ad5","prevId": "00000000-0000-0000-0000-000000000000","tables": {"incident": {@@ -9,66 +9,73 @@"columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"status": {"name": "status",- "type": "enum('resolved','investigatin','')",+ "type": "text(2)","primaryKey": false,- "notNull": false,+ "notNull": true,"autoincrement": false},"page_id": {"name": "page_id",- "type": "int",- "primaryKey": false,- "notNull": false,- "autoincrement": false- },- "created_at": {- "name": "created_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,"notNull": true,- "autoincrement": false,- "default": "(now())"+ "autoincrement": false},"updated_at": {"name": "updated_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "onUpdate": true+ "default": "(strftime('%s', 'now'))"}},"indexes": {},- "foreignKeys": {},- "compositePrimaryKeys": {}+ "foreignKeys": {+ "incident_page_id_page_id_fk": {+ "name": "incident_page_id_page_id_fk",+ "tableFrom": "incident",+ "tableTo": "page",+ "columnsFrom": [+ "page_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}},- "incidentUpdate": {- "name": "incidentUpdate",+ "incident_update": {+ "name": "incident_update","columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"incident_date": {"name": "incident_date",- "type": "datetime",+ "type": "integer","primaryKey": false,"notNull": false,"autoincrement": false},"title": {"name": "title",- "type": "varchar(256)",+ "type": "text(256)","primaryKey": false,"notNull": false,"autoincrement": false@@ -82,97 +89,148 @@},"incident_id": {"name": "incident_id",- "type": "int",+ "type": "integer","primaryKey": false,"notNull": true,"autoincrement": false},- "created_at": {- "name": "created_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true,- "autoincrement": false,- "default": "(now())"- },"updated_at": {"name": "updated_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "onUpdate": true+ "default": "(strftime('%s', 'now'))"}},"indexes": {},- "foreignKeys": {},- "compositePrimaryKeys": {}+ "foreignKeys": {+ "incident_update_incident_id_incident_id_fk": {+ "name": "incident_update_incident_id_incident_id_fk",+ "tableFrom": "incident_update",+ "tableTo": "incident",+ "columnsFrom": [+ "incident_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}},"page": {"name": "page","columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"workspace_id": {"name": "workspace_id",- "type": "int",+ "type": "integer","primaryKey": false,"notNull": true,"autoincrement": false},- "slug": {- "name": "slug",- "type": "varchar(256)",+ "title": {+ "name": "title",+ "type": "text","primaryKey": false,- "notNull": false,+ "notNull": true,"autoincrement": false},- "custom_domain": {- "name": "custom_domain",- "type": "varchar(256)",+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "icon": {+ "name": "icon",+ "type": "text(256)","primaryKey": false,"notNull": false,"autoincrement": false},- "created_at": {- "name": "created_at",- "type": "timestamp",+ "slug": {+ "name": "slug",+ "type": "text(256)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "custom_domain": {+ "name": "custom_domain",+ "type": "text(256)","primaryKey": false,"notNull": true,"autoincrement": false,- "default": "(now())"+ "default": "''"},"updated_at": {"name": "updated_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "onUpdate": true+ "default": "(strftime('%s', 'now'))"}},- "indexes": {},- "foreignKeys": {},- "compositePrimaryKeys": {}+ "indexes": {+ "page_slug_unique": {+ "name": "page_slug_unique",+ "columns": [+ "slug"+ ],+ "isUnique": true+ },+ "page_custom_domain_unique": {+ "name": "page_custom_domain_unique",+ "columns": [+ "custom_domain"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "page_workspace_id_workspace_id_fk": {+ "name": "page_workspace_id_workspace_id_fk",+ "tableFrom": "page",+ "tableTo": "workspace",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}},"monitor": {"name": "monitor","columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"job_type": {"name": "job_type",- "type": "enum('website','cron','other')",+ "type": "text(3)","primaryKey": false,"notNull": true,"autoincrement": false,@@ -180,7 +238,7 @@},"periodicity": {"name": "periodicity",- "type": "enum('1m','5m','10m','30m','1h','other')",+ "type": "text(6)","primaryKey": false,"notNull": true,"autoincrement": false,@@ -188,128 +246,245 @@},"status": {"name": "status",- "type": "enum('active','inactive')",+ "type": "text(2)","primaryKey": false,"notNull": true,"autoincrement": false,"default": "'inactive'"},+ "active": {+ "name": "active",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false,+ "default": false+ },"url": {"name": "url",- "type": "varchar(512)",+ "type": "text(512)","primaryKey": false,- "notNull": false,+ "notNull": true,"autoincrement": false},- "page_id": {- "name": "page_id",- "type": "int",+ "name": {+ "name": "name",+ "type": "text(256)","primaryKey": false,"notNull": true,- "autoincrement": false+ "autoincrement": false,+ "default": "''"},- "created_at": {- "name": "created_at",- "type": "timestamp",+ "description": {+ "name": "description",+ "type": "text","primaryKey": false,"notNull": true,"autoincrement": false,- "default": "(now())"+ "default": "''"+ },+ "page_id": {+ "name": "page_id",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false},"updated_at": {"name": "updated_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "onUpdate": true+ "default": "(strftime('%s', 'now'))"}},"indexes": {},- "foreignKeys": {},- "compositePrimaryKeys": {}+ "foreignKeys": {+ "monitor_page_id_page_id_fk": {+ "name": "monitor_page_id_page_id_fk",+ "tableFrom": "monitor",+ "tableTo": "page",+ "columnsFrom": [+ "page_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "monitor_workspace_id_workspace_id_fk": {+ "name": "monitor_workspace_id_workspace_id_fk",+ "tableFrom": "monitor",+ "tableTo": "workspace",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}},"user": {"name": "user","columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"tenant_id": {"name": "tenant_id",- "type": "varchar(256)",+ "type": "text(256)","primaryKey": false,"notNull": false,"autoincrement": false},- "created_at": {- "name": "created_at",- "type": "timestamp",+ "updated_at": {+ "name": "updated_at",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "default": "(now())"+ "default": "(strftime('%s', 'now'))"+ }+ },+ "indexes": {+ "user_tenant_id_unique": {+ "name": "user_tenant_id_unique",+ "columns": [+ "tenant_id"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}+ },+ "users_to_workspaces": {+ "name": "users_to_workspaces",+ "columns": {+ "user_id": {+ "name": "user_id",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false},- "updated_at": {- "name": "updated_at",- "type": "timestamp",+ "workspace_id": {+ "name": "workspace_id",+ "type": "integer","primaryKey": false,"notNull": true,- "autoincrement": false,- "onUpdate": true+ "autoincrement": false}},"indexes": {},- "foreignKeys": {},- "compositePrimaryKeys": {}+ "foreignKeys": {+ "users_to_workspaces_user_id_user_id_fk": {+ "name": "users_to_workspaces_user_id_user_id_fk",+ "tableFrom": "users_to_workspaces",+ "tableTo": "user",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "users_to_workspaces_workspace_id_workspace_id_fk": {+ "name": "users_to_workspaces_workspace_id_workspace_id_fk",+ "tableFrom": "users_to_workspaces",+ "tableTo": "workspace",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "users_to_workspaces_user_id_workspace_id_pk": {+ "columns": [+ "user_id",+ "workspace_id"+ ]+ }+ },+ "uniqueConstraints": {}},"workspace": {"name": "workspace","columns": {"id": {"name": "id",- "type": "int",+ "type": "integer","primaryKey": true,"notNull": true,- "autoincrement": true+ "autoincrement": false},"stripe_id": {"name": "stripe_id",- "type": "varchar(256)",+ "type": "text(256)","primaryKey": false,"notNull": false,"autoincrement": false},- "created_at": {- "name": "created_at",- "type": "timestamp",+ "name": {+ "name": "name",+ "type": "text","primaryKey": false,- "notNull": true,- "autoincrement": false,- "default": "(now())"+ "notNull": false,+ "autoincrement": false},"updated_at": {"name": "updated_at",- "type": "timestamp",+ "type": "integer","primaryKey": false,- "notNull": true,+ "notNull": false,"autoincrement": false,- "onUpdate": true+ "default": "(strftime('%s', 'now'))"+ }+ },+ "indexes": {+ "workspace_stripe_id_unique": {+ "name": "workspace_stripe_id_unique",+ "columns": [+ "stripe_id"+ ],+ "isUnique": true}},- "indexes": {},"foreignKeys": {},- "compositePrimaryKeys": {}+ "compositePrimaryKeys": {},+ "uniqueConstraints": {}}},- "schemas": {},+ "enums": {},"_meta": {"schemas": {},"tables": {},"columns": {}}-}+}\ No newline at end of filediff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.jsonindex a672e4788..1b51c7b27 100644--- a/packages/db/drizzle/meta/_journal.json+++ b/packages/db/drizzle/meta/_journal.json@@ -1,13 +1,13 @@{"version": "5",- "dialect": "mysql",+ "dialect": "sqlite","entries": [{"idx": 0,"version": "5",- "when": 1687764025255,- "tag": "0000_superb_hercules",+ "when": 1690046393803,+ "tag": "0000_nebulous_shape","breakpoints": true}]-}+}\ No newline at end of filediff --git a/packages/db/env.mjs b/packages/db/env.mjsindex 6c6b7aa67..ca945d0c3 100644--- a/packages/db/env.mjs+++ b/packages/db/env.mjs@@ -4,8 +4,10 @@ import { z } from "zod";export const env = createEnv({server: {DATABASE_URL: z.string().min(1),+ DATABASE_AUTH_TOKEN: z.string().min(1),},runtimeEnv: {DATABASE_URL: process.env.DATABASE_URL,+ DATABASE_AUTH_TOKEN: process.env.DATABASE_AUTH_TOKEN,},});diff --git a/packages/db/package.json b/packages/db/package.jsonindex f16d59100..619515a66 100644--- a/packages/db/package.json+++ b/packages/db/package.json@@ -4,22 +4,28 @@"description": "","main": "src/index.ts","scripts": {- "generate": "drizzle-kit generate:mysql",- "push": "drizzle-kit push:mysql"+ "generate": "drizzle-kit generate:sqlite",+ "push": "drizzle-kit push:sqlite",+ "migrate": "ts-node --esm src/migrate.mts ",+ "studio": "drizzle-kit studio"},"dependencies": {- "@planetscale/database": "1.7.0",- "@t3-oss/env-core": "0.4.1",+ "@libsql/client": "^0.3.1",+ "@t3-oss/env-core": "0.6.0","dotenv": "16.3.1",- "drizzle-orm": "0.27.0",+ "drizzle-orm": "0.27.2","drizzle-zod": "^0.4.4","zod": "3.21.4"},"devDependencies": {"@types/node": "20.3.1",- "drizzle-kit": "0.19.2",+ "drizzle-kit": "0.19.10","tsconfig": "workspace:^",- "typescript": "5.1.3"+ "typescript": "5.1.3",+ "bufferutil": "^4.0.7",+ "utf-8-validate": "^6.0.3",+ "encoding": "0.1.13",+ "ts-node": "^10.9.1"},"author": ""}diff --git a/packages/db/src/db.ts b/packages/db/src/db.tsindex c7a495e13..344c317a4 100644--- a/packages/db/src/db.ts+++ b/packages/db/src/db.ts@@ -1,13 +1,12 @@-import { connect } from "@planetscale/database";-import { drizzle } from "drizzle-orm/planetscale-serverless";+import { createClient } from "@libsql/client/http";+import { drizzle } from "drizzle-orm/libsql";import { env } from "../env.mjs";import * as schema from "./schema";-const config = {+const client = createClient({url: env.DATABASE_URL,-};+ authToken: env.DATABASE_AUTH_TOKEN,+});-const connection = connect(config);--export const db = drizzle(connection, { schema });+export const db = drizzle(client, { schema });diff --git a/packages/db/src/migrate.mts b/packages/db/src/migrate.mtsnew file mode 100644index 000000000..860c25664--- /dev/null+++ b/packages/db/src/migrate.mts@@ -0,0 +1,27 @@+import "dotenv/config";++import { createClient } from "@libsql/client";+import { drizzle } from "drizzle-orm/libsql";+import { migrate } from "drizzle-orm/libsql/migrator";++import { env } from "../env.mjs";++async function main() {+ const db = drizzle(+ createClient({ url: env.DATABASE_URL, authToken: env.DATABASE_AUTH_TOKEN }),+ );++ console.log("Running migrations");++ await migrate(db, { migrationsFolder: "drizzle" });++ console.log("Migrated successfully");++ process.exit(0);+}++main().catch((e) => {+ console.error("Migration failed");+ console.error(e);+ process.exit(1);+});diff --git a/packages/db/src/schema/incident.ts b/packages/db/src/schema/incident.tsindex e01fc44af..e24bc1eaa 100644--- a/packages/db/src/schema/incident.ts+++ b/packages/db/src/schema/incident.ts@@ -1,38 +1,42 @@-import { relations } from "drizzle-orm";-import {- datetime,- int,- mysqlEnum,- mysqlTable,- text,- timestamp,- varchar,-} from "drizzle-orm/mysql-core";+import { relations, sql } from "drizzle-orm";+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";import { createInsertSchema, createSelectSchema } from "drizzle-zod";import { page } from "./page";-export const incident = mysqlTable("incident", {- id: int("id").autoincrement().primaryKey(),+export const incident = sqliteTable("incident", {+ id: integer("id").primaryKey(),- status: mysqlEnum("status", ["resolved", "investigating"]).notNull(),+ status: text("status", ["resolved", "investigating"]).notNull(),- pageId: int("page_id").notNull(),+ pageId: integer("page_id")+ .notNull()+ .references(() => page.id),- createdAt: timestamp("created_at").notNull().defaultNow(),- updatedAt: timestamp("updated_at").notNull().onUpdateNow(),+ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});-export const incidentUpdate = mysqlTable("incidentUpdate", {- id: int("id").autoincrement().primaryKey(),+export const incidentUpdate = sqliteTable("incident_update", {+ id: integer("id").primaryKey(),- date: datetime("incident_date"),- title: varchar("title", { length: 256 }), // title of the incident+ date: integer("incident_date"),+ title: text("title", { length: 256 }), // title of the incidentmessage: text("message"), // where we can write the incident message- incidentId: int("incident_id").notNull(),- createdAt: timestamp("created_at").notNull().defaultNow(),- updatedAt: timestamp("updated_at").notNull().defaultNow().onUpdateNow(),+ incidentId: integer("incident_id")+ .references(() => incident.id)+ .notNull(),+ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});export const incidentRelations = relations(incident, ({ one, many }) => ({diff --git a/packages/db/src/schema/monitor.ts b/packages/db/src/schema/monitor.tsindex 81f718d14..9fea101b0 100644--- a/packages/db/src/schema/monitor.ts+++ b/packages/db/src/schema/monitor.ts@@ -1,52 +1,36 @@-import { relations } from "drizzle-orm";-import {- boolean,- int,- mysqlEnum,- mysqlTable,- text,- timestamp,- varchar,-} from "drizzle-orm/mysql-core";+import { relations, sql } from "drizzle-orm";+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";import { createInsertSchema, createSelectSchema } from "drizzle-zod";import { z } from "zod";import { page } from "./page";import { workspace } from "./workspace";-export const monitor = mysqlTable("monitor", {- id: int("id").autoincrement().primaryKey(),- jobType: mysqlEnum("job_type", ["website", "cron", "other"])+export const monitor = sqliteTable("monitor", {+ id: integer("id").primaryKey(),+ jobType: text("job_type", ["website", "cron", "other"]).default("other").notNull(),- periodicity: mysqlEnum("periodicity", [- "1m",- "5m",- "10m",- "30m",- "1h",- "other",- ])+ periodicity: text("periodicity", ["1m", "5m", "10m", "30m", "1h", "other"]).default("other").notNull(),+ status: text("status", ["active", "inactive"]).default("inactive").notNull(),+ active: integer("active", { mode: "boolean" }).default(false),- // TBD: if we keep or not?!?- status: mysqlEnum("status", ["active", "inactive"])- .default("inactive")- .notNull(),-- active: boolean("active").default(false),-- url: varchar("url", { length: 512 }).notNull(),+ url: text("url", { length: 512 }).notNull(),- name: varchar("name", { length: 256 }).default("").notNull(),+ name: text("name", { length: 256 }).default("").notNull(),description: text("description").default("").notNull(),- pageId: int("page_id"),- workspaceId: int("workspace_id"),+ pageId: integer("page_id").references(() => page.id),+ workspaceId: integer("workspace_id").references(() => workspace.id),- createdAt: timestamp("created_at").notNull().defaultNow(),- updateddAt: timestamp("updated_at").notNull().defaultNow().onUpdateNow(),+ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});export const monitorRelation = relations(monitor, ({ one }) => ({@@ -72,7 +56,14 @@ export const periodicityEnum = z.enum([export const insertMonitorSchema = createInsertSchema(monitor, {periodicity: periodicityEnum,url: z.string().url(),+ status: z.enum(["active", "inactive"]).default("inactive"),+ active: z.boolean().default(false),});// Schema for selecting a Monitor - can be used to validate API responses-export const selectMonitorSchema = createSelectSchema(monitor);+export const selectMonitorSchema = createSelectSchema(monitor, {+ periodicity: periodicityEnum,+ status: z.enum(["active", "inactive"]).default("inactive"),+ jobType: z.enum(["website", "cron", "other"]).default("other"),+ active: z.boolean().default(false),+});diff --git a/packages/db/src/schema/page.ts b/packages/db/src/schema/page.tsindex 11320d670..14c7b946b 100644--- a/packages/db/src/schema/page.ts+++ b/packages/db/src/schema/page.ts@@ -1,40 +1,41 @@-import { relations } from "drizzle-orm";-import {- int,- mysqlTable,- text,- timestamp,- varchar,-} from "drizzle-orm/mysql-core";+import { relations, sql } from "drizzle-orm";+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";import { createInsertSchema, createSelectSchema } from "drizzle-zod";import { z } from "zod";-import { incident } from "./incident";-import { monitor } from "./monitor";+import { incident, selectIncidentSchema } from "./incident";+import { monitor, selectMonitorSchema } from "./monitor";+import { workspace } from "./workspace";-export const page = mysqlTable("page", {- id: int("id").autoincrement().primaryKey(),+export const page = sqliteTable("page", {+ id: integer("id").primaryKey(),- workspaceId: int("workspace_id").notNull(),+ workspaceId: integer("workspace_id")+ .notNull()+ .references(() => workspace.id),title: text("title").notNull(), // title of the pagedescription: text("description").notNull(), // description of the page- icon: varchar("icon", { length: 256 }), // icon of the page- slug: varchar("slug", { length: 256 }).notNull(), // which is used for https://slug.openstatus.dev- customDomain: varchar("custom_domain", { length: 256 }).notNull().default(""),-- // We should store settings of the page- // theme-- createdAt: timestamp("created_at").notNull().defaultNow(),- updatedAt: timestamp("updated_at").notNull().defaultNow().onUpdateNow(),+ icon: text("icon", { length: 256 }), // icon of the page+ slug: text("slug", { length: 256 }).notNull().unique(), // which is used for https://slug.openstatus.dev+ customDomain: text("custom_domain", { length: 256 })+ .notNull()+ .default("")+ .unique(),++ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});export const pageRelations = relations(page, ({ many, one }) => ({incidents: many(incident),- workspace: one(page, {+ workspace: one(workspace, {fields: [page.workspaceId],- references: [page.id],+ references: [workspace.id],}),monitors: many(monitor),}));diff --git a/packages/db/src/schema/user.ts b/packages/db/src/schema/user.tsindex d1ac895d5..cc64df052 100644--- a/packages/db/src/schema/user.ts+++ b/packages/db/src/schema/user.ts@@ -1,31 +1,39 @@-import { relations } from "drizzle-orm";+import { relations, sql } from "drizzle-orm";import {int,- mysqlTable,+ integer,primaryKey,- timestamp,- varchar,-} from "drizzle-orm/mysql-core";+ sqliteTable,+ text,+} from "drizzle-orm/sqlite-core";import { workspace } from "./workspace";-export const user = mysqlTable("user", {- id: int("id").autoincrement().primaryKey(),- tenantId: varchar("tenant_id", { length: 256 }), // the clerk User Id+export const user = sqliteTable("user", {+ id: int("id").primaryKey(),+ tenantId: text("tenant_id", { length: 256 }).unique(), // the clerk User Id- createdAt: timestamp("created_at").notNull().defaultNow(),- updatedAt: timestamp("updated_at").notNull().defaultNow().onUpdateNow(),+ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});export const userRelations = relations(user, ({ many }) => ({usersToWorkspaces: many(usersToWorkspaces),}));-export const usersToWorkspaces = mysqlTable(+export const usersToWorkspaces = sqliteTable("users_to_workspaces",{- userId: int("user_id").notNull(),- workspaceId: int("workspace_id").notNull(),+ userId: int("user_id")+ .notNull()+ .references(() => user.id),+ workspaceId: int("workspace_id")+ .notNull()+ .references(() => workspace.id),},(t) => ({pk: primaryKey(t.userId, t.workspaceId),diff --git a/packages/db/src/schema/workspace.ts b/packages/db/src/schema/workspace.tsindex 624fed59e..5b8f39bf6 100644--- a/packages/db/src/schema/workspace.ts+++ b/packages/db/src/schema/workspace.ts@@ -1,26 +1,24 @@-import { relations } from "drizzle-orm";-import {- int,- mysqlTable,- text,- timestamp,- varchar,-} from "drizzle-orm/mysql-core";+import { relations, sql } from "drizzle-orm";+import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";import { page } from "./page";-import { user, usersToWorkspaces } from "./user";+import { usersToWorkspaces } from "./user";-export const workspace = mysqlTable("workspace", {- id: int("id").autoincrement().primaryKey(),+export const workspace = sqliteTable("workspace", {+ id: integer("id").primaryKey(),- stripeId: varchar("stripe_id", { length: 256 }),+ stripeId: text("stripe_id", { length: 256 }).unique(),name: text("name"),- createdAt: timestamp("created_at").notNull().defaultNow(),- updatedAt: timestamp("updated_at").notNull().defaultNow().onUpdateNow(),+ createdAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),+ updatedAt: integer("updated_at", { mode: "timestamp" }).default(+ sql`(strftime('%s', 'now'))`,+ ),});export const workspaceRelations = relations(workspace, ({ many }) => ({- page: many(page),usersToWorkspaces: many(usersToWorkspaces),+ pages: many(page),}));diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 0a86737d7..38b745685 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -311,21 +311,21 @@ importers:packages/db:dependencies:- '@planetscale/database':- specifier: 1.7.0- version: 1.7.0+ '@libsql/client':+ specifier: ^0.3.1'@t3-oss/env-core':- specifier: 0.4.1- version: 0.4.1([email protected])([email protected])+ specifier: 0.6.0+ version: 0.6.0([email protected])([email protected])dotenv:specifier: 16.3.1version: 16.3.1drizzle-orm:- specifier: 0.27.0- version: 0.27.0(@planetscale/[email protected])+ specifier: 0.27.2+ version: 0.27.2(@libsql/[email protected])drizzle-zod:specifier: ^0.4.4- version: 0.4.4([email protected])([email protected])+ version: 0.4.4([email protected])([email protected])zod:specifier: 3.21.4version: 3.21.4@@ -333,15 +333,27 @@ importers:'@types/node':specifier: 20.3.1version: 20.3.1+ bufferutil:+ specifier: ^4.0.7+ version: 4.0.7drizzle-kit:- specifier: 0.19.2- version: 0.19.2+ specifier: 0.19.10+ version: 0.19.10+ encoding:+ specifier: 0.1.13+ version: 0.1.13+ ts-node:+ specifier: ^10.9.1+ version: 10.9.1(@types/[email protected])([email protected])tsconfig:specifier: workspace:^version: link:../tsconfigtypescript:specifier: 5.1.3version: 5.1.3+ utf-8-validate:+ specifier: ^6.0.3+ version: 6.0.3packages/emails:dependencies:@@ -946,6 +958,10 @@ packages:resolution: {integrity: sha512-ed4pNnfur6UbASEgF34gVxR9p7Mc3qF+Ygbmjiil8ws5IhNFhPDFy5vE5hQAUA9JmVsSxXPcVLM5Rf8LOZqQ5Q==}dev: false+ /@drizzle-team/[email protected]:+ resolution: {integrity: sha512-ps5qF0tMxWRVu+V5gvCRrQNqlY92aTnIKdq27gm9LZMSdaKYZt6AVvSK1dlUMzs6Rt0Jm80b+eWct6xShBKhIw==}+ dev: true+/@effect-ts/[email protected]:resolution: {integrity: sha512-qi1WrtJA90XLMnj2hnUszW9Sx4dXP03ZJtCc5DiUBIOhF4Vw7plfb65/bdBySPoC9s7zy995TdUX1XBSxUkl5w==}dependencies:@@ -1971,6 +1987,49 @@ packages:tslib: 2.5.3dev: false+ resolution: {integrity: sha512-43/zF8fJguXd6ENwYhddpbR05bDVx3BQQUZ/BsJ0b4zLJge+WFa2smC3ILVGqvVu4ZoixbC0sfLTdVPdd2NjDA==}+ dependencies:+ better-sqlite3: 8.4.0+ js-base64: 3.7.5+ transitivePeerDependencies:+ - bufferutil+ - encoding+ - utf-8-validate+ dev: false++ resolution: {integrity: sha512-ZlAXy3PpB8B93iu8MyDyMpzbu1b4G4oa5KOjbABHe7iBybx7yC+t3U/sK7c37QsmpRZQXi0S+vNPpGTlje3bCA==}+ dependencies:+ '@libsql/isomorphic-fetch': 0.1.4([email protected])+ '@libsql/isomorphic-ws': 0.1.3([email protected])([email protected])+ js-base64: 3.7.5+ transitivePeerDependencies:+ - bufferutil+ - encoding+ - utf-8-validate+ dev: false++ /@libsql/[email protected]([email protected]):+ resolution: {integrity: sha512-eRgV4b1d6RVLciafGEKZghDOvrQ7fDuPgfGzelsfPz1HxFERaTQuOwL5FthZcKBtHI6Wqu5zmhUu5bREZr1mpA==}+ dependencies:+ '@types/node-fetch': 2.6.2+ node-fetch: 2.6.11([email protected])+ transitivePeerDependencies:+ - encoding+ dev: false++ resolution: {integrity: sha512-54dZXgYwWDKsnfWv8GCVYvhn6RDlqFDGAc8EQMd941yvGMsGzo06Gn6Iyjw//nJ1iJO97FbXgoQ1apikoFD/WA==}+ dependencies:+ '@types/ws': 8.5.5+ ws: 8.13.0([email protected])([email protected])+ transitivePeerDependencies:+ - bufferutil+ - utf-8-validate+ dev: false+/@manypkg/[email protected]:resolution: {integrity: sha512-NEYRVlZCJYhRTqQURhv+WBpDcvmsp/M423Wcdvggv8lYJYD4GtqnTMLrQaTjA10fYt/PIc3tSdwV+wxJnWqPfQ==}engines: {node: '>=14.18.0'}@@ -2227,7 +2286,7 @@ packages:'@octokit/request-error': 3.0.3'@octokit/types': 9.3.2is-plain-object: 5.0.0- node-fetch: 2.6.11+ node-fetch: 2.6.11([email protected])universal-user-agent: 6.0.0transitivePeerDependencies:- encoding@@ -2471,11 +2530,6 @@ packages:tslib: 2.5.3dev: false- /@planetscale/[email protected]:- resolution: {integrity: sha512-lWR6biXChUyQnxsT4RT1CIeR3ZJvwTQXiQ+158MnY3VjLwjHEGakDzdH9kwUGPk6CHvu6UeqRXp1DgUOVHJFTw==}- engines: {node: '>=16'}- dev: false-/@protobufjs/[email protected]:resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}dev: false@@ -3756,6 +3810,16 @@ packages:zod: 3.21.4dev: false+ resolution: {integrity: sha512-3FkPAba069WRZVVab/sB1m3eSGn/rZeypx5k+sWEu1d+k0OQdRDnvFS+7MtxYgqVrwaRk3b7yVnX2dgSPVmWPQ==}+ peerDependencies:+ typescript: '>=4.7.2'+ zod: ^3.0.0+ dependencies:+ typescript: 5.1.3+ zod: 3.21.4+ dev: false+resolution: {integrity: sha512-lDbewJvZwOW7bFwHzdKtAH4+YcVTvGU7UEJfHwlb1RqVe9ejPrKn6ax2OGv/nFji1JXGKecKYHz3Xkpru6TFbw==}peerDependencies:@@ -4114,6 +4178,12 @@ packages:/@types/[email protected]:resolution: {integrity: sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==}+ /@types/[email protected]:+ resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==}+ dependencies:+ '@types/node': 20.3.1+ dev: false+/@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]):resolution: {integrity: sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}@@ -4543,6 +4613,14 @@ packages:resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==}dev: false+ resolution: {integrity: sha512-NmsNW1CQvqMszu/CFAJ3pLct6NEFlNfuGM6vw72KHkjOD1UDnL96XNN1BMQc1hiHo8vE2GbOWQYIpZ+YM5wrZw==}+ requiresBuild: true+ dependencies:+ bindings: 1.5.0+ prebuild-install: 7.1.1+ dev: false+resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==}engines: {node: '>=0.6'}@@ -4559,6 +4637,12 @@ packages:chainsaw: 0.1.0dev: false+ resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}+ dependencies:+ file-uri-to-path: 1.0.0+ dev: false+resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}dependencies:@@ -4623,6 +4707,13 @@ packages:engines: {node: '>=0.2.0'}dev: false+ resolution: {integrity: sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==}+ engines: {node: '>=6.14.2'}+ requiresBuild: true+ dependencies:+ node-gyp-build: 4.6.0+resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==}dependencies:@@ -4799,6 +4890,10 @@ packages:optionalDependencies:fsevents: 2.3.2+ resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}+ dev: false+resolution: {integrity: sha512-qdRDgfjx3GRb9fpwpSvn+YaidnT7IUJNe4wt5/SWwM+PmUwJUhQRk/8zAyNro0PmVfmen2635UboTjIBXXxy5A==}peerDependencies:@@ -5105,10 +5200,16 @@ packages:dependencies:character-entities: 2.0.2+ resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}+ engines: {node: '>=10'}+ dependencies:+ mimic-response: 3.1.0+ dev: false+resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}engines: {node: '>=4.0.0'}- dev: trueresolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}@@ -5190,6 +5291,11 @@ packages:resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==}+ engines: {node: '>=8'}+ dev: false+resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==}dev: false@@ -5303,10 +5409,11 @@ packages:wordwrap: 1.0.0dev: true- resolution: {integrity: sha512-o+T/+Xc6hlLj2ocvGEo3kyWgTIAFjmsVK/HdBjU7gmbolmFZHv6T3lhaAsAD4mWfOX69uC7IggCmIqLq+zcM4Q==}+ resolution: {integrity: sha512-v7bd+7YUO3NJJTY7hwt9k+DPJVw+31iejG/ztkvNS0hK8zWjJvA6NAECYZVswKQ+efCjzLgPCx+I9X105Zqt6Q==}hasBin: truedependencies:+ '@drizzle-team/studio': 0.0.5'@esbuild-kit/esm-loader': 2.5.5camelcase: 7.0.1chalk: 5.2.0@@ -5322,8 +5429,8 @@ packages:- supports-colordev: true- /[email protected](@planetscale/[email protected]):- resolution: {integrity: sha512-LGiJ0icB+wQwgbSCOvAjONY8Ec6G/EDzQQP5PmUaQYeI9OqgpVKHC2T1fFIbvk5dabWsbokJ5NOciVAxriStig==}+ /[email protected](@libsql/[email protected]):+ resolution: {integrity: sha512-ZvBvceff+JlgP7FxHKe0zOU9CkZ4RcOtibumIrqfYzDGuOeF0YUY0F9iMqYpRM7pxnLRfC+oO7rWOUH3T5oFQA==}peerDependencies:'@aws-sdk/client-rds-data': '>=3''@cloudflare/workers-types': '>=3'@@ -5384,16 +5491,16 @@ packages:sqlite3:optional: truedependencies:- '@planetscale/database': 1.7.0dev: falseresolution: {integrity: sha512-XNn0mjQ306Hvg+CuyKV98wnsWBWeTqv+kgE/N79Zj0EdCvjD2kaoN5sFDGFkMVqPQuP7IB1IPs0lEcOij1RvBA==}peerDependencies:drizzle-orm: '>=0.23.13'zod: '*'dependencies:- drizzle-orm: 0.27.0(@planetscale/[email protected])+ drizzle-orm: 0.27.2(@libsql/[email protected])zod: 3.21.4dev: false@@ -5423,6 +5530,17 @@ packages:resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}dev: false+ resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==}+ dependencies:+ iconv-lite: 0.6.3++ resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}+ dependencies:+ once: 1.4.0+ dev: false+resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==}engines: {node: '>=10.13.0'}@@ -6088,6 +6206,11 @@ packages:strip-final-newline: 3.0.0dev: false+ resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==}+ engines: {node: '>=6'}+ dev: false+resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==}dependencies:@@ -6176,6 +6299,10 @@ packages:dependencies:flat-cache: 3.0.4+ resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==}+ dev: false+resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}engines: {node: '>=8'}@@ -6257,6 +6384,10 @@ packages:resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}dev: true+ resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}+ dev: false+resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}engines: {node: '>=12'}@@ -6365,6 +6496,10 @@ packages:dependencies:resolve-pkg-maps: 1.0.0+ resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==}+ dev: false+resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==}dev: true@@ -6808,6 +6943,12 @@ packages:dependencies:safer-buffer: 2.1.2+ resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}+ engines: {node: '>=0.10.0'}+ dependencies:+ safer-buffer: 2.1.2+resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}@@ -7192,7 +7333,7 @@ packages:resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==}dependencies:- node-fetch: 2.6.11+ node-fetch: 2.6.11([email protected])whatwg-fetch: 3.6.2transitivePeerDependencies:- encoding@@ -7211,6 +7352,10 @@ packages:engines: {node: '>=10'}dev: true+ resolution: {integrity: sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==}+ dev: false+resolution: {integrity: sha512-4S7HFeI9YfRvRgKnEweohs0tgJj28InHVIj4Nl8Htf96Y6pHg3+tJrmo4ucAM9f7l4SHbFI3IvFAZ2a1eQPbyg==}engines: {node: '>=12'}@@ -8093,6 +8238,11 @@ packages:engines: {node: '>=12'}dev: false+ resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}+ engines: {node: '>=10'}+ dev: false+resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}dependencies:@@ -8121,6 +8271,10 @@ packages:resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}+ resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}+ dev: false+resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}hasBin: true@@ -8160,6 +8314,10 @@ packages:hasBin: truedev: false+ resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==}+ dev: false+resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}dev: false@@ -8265,6 +8423,13 @@ packages:tslib: 2.5.3dev: false+ resolution: {integrity: sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ==}+ engines: {node: '>=10'}+ dependencies:+ semver: 7.5.2+ dev: false+resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}engines: {node: '>=10.5.0'}@@ -8274,7 +8439,7 @@ packages:resolution: {integrity: sha512-VzW+TAk2wE4X9maiKMlT+GsPU4OMmR1U9CrHSmd3DFLn2IcZ9VJ6M6BBugGfYUnPCLSYxXdZy17M0BEJyhUTwg==}dev: falseresolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==}engines: {node: 4.x || >=6.0.0}peerDependencies:@@ -8283,6 +8448,7 @@ packages:encoding:optional: truedependencies:+ encoding: 0.1.13whatwg-url: 5.0.0dev: false@@ -8295,6 +8461,10 @@ packages:formdata-polyfill: 4.0.10dev: false+ resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}+ hasBin: true+resolution: {integrity: sha512-Cov028YhBZ5aB7MdMWJEmwyBig43aGL5WT4vdoB28Oitau1zZAcHUn8Sgfk9HM33TqhtLJ9PlM/O0Mv+QpV/4Q==}engines: {node: '>=8.9.4'}@@ -8795,6 +8965,25 @@ packages:picocolors: 1.0.0source-map-js: 1.0.2+ resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==}+ engines: {node: '>=10'}+ hasBin: true+ dependencies:+ detect-libc: 2.0.1+ expand-template: 2.0.3+ github-from-package: 0.0.0+ minimist: 1.2.8+ mkdirp-classic: 0.5.3+ napi-build-utils: 1.0.2+ node-abi: 3.45.0+ pump: 3.0.0+ rc: 1.2.8+ simple-get: 4.0.1+ tar-fs: 2.1.1+ tunnel-agent: 0.6.0+ dev: false+resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}engines: {node: '>= 0.8.0'}@@ -8922,6 +9111,13 @@ packages:resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}dev: false+ resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}+ dependencies:+ end-of-stream: 1.4.4+ once: 1.4.0+ dev: false+resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}engines: {node: '>=6'}@@ -8972,7 +9168,6 @@ packages:ini: 1.3.8minimist: 1.2.8strip-json-comments: 2.0.1- dev: trueresolution: {integrity: sha512-QIC3uOuyGGbtypbd5QEggsCSqVaPNu8kzUWquZ7JjW9fuWB9yv7WyixKmnaFelTLXFdq7h7zU6n/aBleBqe/dA==}@@ -9544,6 +9739,18 @@ packages:resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}+ resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==}+ dev: false++ resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}+ dependencies:+ decompress-response: 6.0.0+ once: 1.4.0+ simple-concat: 1.0.1+ dev: false+resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}dev: true@@ -9752,7 +9959,6 @@ packages:resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}engines: {node: '>=0.10.0'}- dev: trueresolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}@@ -9827,7 +10033,7 @@ packages:resolution: {integrity: sha512-rcADxEFhSqHbraZIsjyZNh4TF6V+koloX1OzZ+AQuObX9mZ2LIMhm1buZeuc5BIZPftZpJCMBsSiBaeszo9tRw==}dependencies:- node-fetch: 2.6.11+ node-fetch: 2.6.11([email protected])whatwg-fetch: 3.6.2transitivePeerDependencies:- encoding@@ -9950,6 +10156,26 @@ packages:engines: {node: '>=6'}dev: false+ resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==}+ dependencies:+ chownr: 1.1.4+ mkdirp-classic: 0.5.3+ pump: 3.0.0+ tar-stream: 2.2.0+ dev: false++ resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}+ engines: {node: '>=6'}+ dependencies:+ bl: 4.1.0+ end-of-stream: 1.4.4+ fs-constants: 1.0.0+ inherits: 2.0.4+ readable-stream: 3.6.2+ dev: false+resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}@@ -10167,6 +10393,12 @@ packages:typescript: 5.1.3dev: false+ resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}+ dependencies:+ safe-buffer: 5.2.1+ dev: false+resolution: {integrity: sha512-s2Gc7i9Ud+H9GDcrGJjPIyscJfzDGQ6il4Sl2snfvwngJs4/TaqKuBoX3HNt/7F4NiFRs7ZhlLV1/Yu9zGBRhw==}cpu: [x64]@@ -10489,6 +10721,13 @@ packages:react: 18.2.0dev: false+ resolution: {integrity: sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==}+ engines: {node: '>=6.14.2'}+ requiresBuild: true+ dependencies:+ node-gyp-build: 4.6.0+resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}@@ -10661,6 +10900,22 @@ packages:resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}+ resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==}+ engines: {node: '>=10.0.0'}+ peerDependencies:+ bufferutil: ^4.0.1+ utf-8-validate: '>=5.0.2'+ peerDependenciesMeta:+ bufferutil:+ optional: true+ utf-8-validate:+ optional: true+ dependencies:+ bufferutil: 4.0.7+ utf-8-validate: 6.0.3+ dev: false+resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}engines: {node: '>=0.4'}