Skip to content

Open-source status page, incident response and uptime monitoring

migrate: Clerk to Next Auth (#801)

Maximilian Kaskeeb21f8644bd7
diff --git a/README.md b/README.md
index 6c9fc45ab..1f811c07c 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
</a>
</p>
- <p align="center"> The Open-Source frontend performance monitoring platform.
+ <p align="center">The Open-Source frontend performance monitoring platform.
<br />
<a href="https://www.openstatus.dev"><strong>Learn more »</strong></a>
<br />
@@ -82,7 +82,6 @@ Made with [Contrib.rocks](https://contrib.rocks)
- [tinybird](http://tinybird.co/?ref=openstatus.dev)
- [turso](http://turso.tech/)
- [drizzle](https://orm.drizzle.team/)
-- [clerk](https://clerk.com/)
- [Resend](https://resend.com/)
## Getting Started 🚀
@@ -133,8 +132,6 @@ Made with [Contrib.rocks](https://contrib.rocks)
server health check
- open [http://localhost:3002](http://localhost:3002) for the docs
-For [clerk](https://clerk.com), you will need to create a webhook endpoint. To
-access the link, you can use tunneling tools like
[Tunnelmole](https://github.com/robbie-cahill/tunnelmole-client), an open source
tunnelling tool or ngrok, a popular closed source tunnelling tool.
@@ -153,16 +150,6 @@ http://bvdo5f-ip-49-183-170-144.tunnelmole.net is forwarding to localhost:3000
https://bvdo5f-ip-49-183-170-144.tunnelmole.net is forwarding to localhost:3000
```
-Append `/api/webhook/clerk` to the HTTPs URL.
-
-### Using ngrok
-
-After login, append `/api/webhook/clerk` to the link you get after entering:
-
-```
-$ ngrok http 3000
-```
-
### Videos
Videos to better understand the OpenStatus codebase:
diff --git a/apps/docs/contributing/get-started.mdx b/apps/docs/contributing/get-started.mdx
index e8e669e5c..11922bb3c 100644
--- a/apps/docs/contributing/get-started.mdx
+++ b/apps/docs/contributing/get-started.mdx
@@ -65,15 +65,3 @@ pnpm dev
> cd apps/web
> pnpm dev
> ```
-
-7. Clerk Authentication
-
-For authentication we are using [Clerk](https://clerk.dev/), you will need to
-create an account and get your API keys. If you want to work on the backend and
-or authenfied page
-
-After creating an account on clerk you will need to set up a tunnel with ngrok
-or svix to your local server.
-
-Otherwise you can send a post request to the `/api/webhook/clerk` endpoint with
-the following body you will find on clerk
diff --git a/apps/docs/contributing/setup-env.mdx b/apps/docs/contributing/setup-env.mdx
index 02483b5c1..4d6c849ab 100644
--- a/apps/docs/contributing/setup-env.mdx
+++ b/apps/docs/contributing/setup-env.mdx
@@ -9,42 +9,6 @@ configured for the application to work correctly. Below, I will explain how to
obtain the values for some of these variables, focusing on the section related
to Cleark Auth.
-## Setting up Clerk for auth
-
-1. Log in to your Clerk account at [https://clerk.com/](https://clerk.com/) or
- create a new account if you don't have one yet.
-
-2. Once logged in, go to your dashboard at
- [https://dashboard.clerk.com/](https://dashboard.clerk.com/) and select
- create a new app if you do not have any application already.
-
-3. On the create new app screen, enter your app name and select **Google** and
- or **GitHub** under the section _How will your users sign in?_
-
- > Please note that using other providers will cause issues in the application
- > due to the different payload received from Clerk.
-
-4. After setting up your app, navigate to the "DEVELOPERS" section in the
- left-hand menu and find "API Keys."
-
-5. In the "Quick Copy" section, make sure that Next.js is selected, then click
- the copy icon to obtain the keys. Copy the values for
- "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY" and "CLERK_SECRET_KEY."
-
-6. Paste these values into the `.env` file under their respective variables. It
- should look something like this (real values without censorship):
-
-![Create your monitor](/images/setup-env/clerk.png)
-
-```
-# CLERK for auth
-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_••••••••••••••••••••••••••••••••••••••••••
-CLERK_SECRET_KEY=sk_test_••••••••••••••••••••••••••••••••••••••••••
-```
-
-Remember to replace the key values with the actual keys obtained from your Clerk
-account.
-
## Setting up Resend for sending emails
The "RESEND for email" section in the `.env` file contains the "RESEND_API_KEY"
@@ -380,24 +344,7 @@ the following command:
turso dev --db-file openstatus-dev.db
```
-It contains some dummy data that you can use to test the application. You still
-need to update the `tenant_id` in table `user` with your user account from
-Clerk.
-
-Do the following to get your `tenant_id`:
-
-![Sign up with clerk](/images/setup-env/clerk-step1.png)
-
-Then go in the user section:
-
-![Sign up with clerk](/images/setup-env/clerk-step2.png)
-
-Then copy the `tenant_id`:
-
-![Sign up with clerk](/images/setup-env/clerk-step3.png)
-
-then update the `tenant_id` in the database, for this you can use
-drizzle-studio:
+It contains some dummy data that you can use to test the application.
![Drizzle studio](/images/setup-env/drizzle-studio.png)
diff --git a/apps/ingest-worker/package.json b/apps/ingest-worker/package.json
index ee9678832..fc6e7a2c4 100644
--- a/apps/ingest-worker/package.json
+++ b/apps/ingest-worker/package.json
@@ -7,7 +7,7 @@
"dependencies": {
"@clickhouse/client-web": "0.3.0",
"@hono/zod-validator": "0.2.1",
- "detect-browser": "^5.3.0",
+ "detect-browser": "5.3.0",
"hono": "4.1.4",
"zod": "3.22.4"
},
diff --git a/apps/web/.env.example b/apps/web/.env.example
index 83313be59..d92529792 100644
--- a/apps/web/.env.example
+++ b/apps/web/.env.example
@@ -1,12 +1,3 @@
-# CLERK for auth
-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=clerk-public-key
-CLERK_SECRET_KEY=clerk-secret-key
-CLERK_WEBHOOK_SECRET=clerk
-NEXT_PUBLIC_CLERK_SIGN_IN_URL=/app/sign-in
-NEXT_PUBLIC_CLERK_SIGN_UP_URL=/app/sign-up
-NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/app
-NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/app
-
# RESEND for email
RESEND_API_KEY=resend-api-key
@@ -69,4 +60,11 @@ PLAYGROUND_UNKEY_API_KEY=
# RUM server with separate clickhouse for self-host
CLICKHOUSE_URL=
CLICKHOUSE_USERNAME=
-CLICKHOUSE_PASSWORD=
\ No newline at end of file
+CLICKHOUSE_PASSWORD=
+
+AUTH_SECRET=
+AUTH_DRIZZLE_URL=http://127.0.0.1:8080
+AUTH_GITHUB_ID=
+AUTH_GITHUB_SECRET=
+AUTH_GOOGLE_ID=
+AUTH_GOOGLE_SECRET=
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index c02db0b34..71259378c 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -15,6 +15,10 @@ const nextConfig = {
// "better-sqlite3"
],
optimizePackageImports: ["@tremor/react"],
+ // FIXME: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
+ // TODO: https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering
+ // TODO: https://nextjs.org/docs/messages/deopted-into-client-rendering
+ missingSuspenseWithCSRBailout: false,
},
logging: {
fetches: {
diff --git a/apps/web/package.json b/apps/web/package.json
index f1cabcac0..446936fa0 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -10,27 +10,29 @@
"tsc": "tsc --noEmit"
},
"dependencies": {
- "@clerk/nextjs": "4.29.9",
+ "@auth/core": "0.30.0",
+ "@auth/drizzle-adapter": "1.0.1",
"@google-cloud/tasks": "5.0.0",
"@headlessui/react": "1.7.17",
"@hookform/resolvers": "3.3.1",
+ "@libsql/client": "0.6.0",
"@openstatus/analytics": "workspace:*",
"@openstatus/api": "workspace:*",
"@openstatus/assertions": "workspace:*",
"@openstatus/db": "workspace:*",
"@openstatus/emails": "workspace:*",
+ "@openstatus/next-monitoring": "0.0.2",
"@openstatus/notification-discord": "workspace:*",
"@openstatus/notification-emails": "workspace:*",
"@openstatus/notification-slack": "workspace:*",
- "@openstatus/next-monitoring": "0.0.2",
"@openstatus/plans": "workspace:*",
"@openstatus/react": "workspace:*",
+ "@openstatus/rum": "workspace:*",
"@openstatus/tinybird": "workspace:*",
"@openstatus/tracker": "workspace:*",
"@openstatus/ui": "workspace:*",
"@openstatus/upstash": "workspace:*",
"@openstatus/utils": "workspace:*",
- "@openstatus/rum": "workspace:*",
"@sentry/integrations": "7.100.1",
"@sentry/nextjs": "7.100.1",
"@stripe/stripe-js": "2.1.6",
@@ -58,10 +60,12 @@
"luxon": "3.3.0",
"micro": "10.0.1",
"nanoid": "5.0.1",
- "next": "14.2.1",
+ "next": "14.2.3",
+ "next-auth": "5.0.0-beta.17",
"next-contentlayer": "0.3.4",
"next-plausible": "3.12.0",
"next-themes": "0.2.1",
+ "random-word-slugs": "0.1.7",
"react": "18.2.0",
"react-day-picker": "8.8.2",
"react-dom": "18.2.0",
@@ -73,7 +77,7 @@
"remark-parse": "10.0.2",
"remark-rehype": "10.1.0",
"resend": "1.1.0",
- "rss": "^1.2.2",
+ "rss": "1.2.2",
"shiki": "0.14.4",
"sonner": "1.3.1",
"stripe": "13.8.0",
@@ -90,7 +94,7 @@
"@types/node": "20.8.0",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
- "@types/rss": "^0.0.32",
+ "@types/rss": "0.0.32",
"autoprefixer": "10.4.16",
"postcss": "8.4.31",
"rehype-autolink-headings": "7.1.0",
diff --git a/apps/web/src/app/api/auth/[...nextauth]/route.ts b/apps/web/src/app/api/auth/[...nextauth]/route.ts
new file mode 100644
index 000000000..c55a45ed7
--- /dev/null
+++ b/apps/web/src/app/api/auth/[...nextauth]/route.ts
@@ -0,0 +1,3 @@
+import { handlers } from "@/lib/auth";
+
+export const { GET, POST } = handlers;
diff --git a/apps/web/src/app/api/webhook/clerk/route.ts b/apps/web/src/app/api/webhook/clerk/route.ts
deleted file mode 100644
index 7d5f8ad42..000000000
--- a/apps/web/src/app/api/webhook/clerk/route.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import type { NextRequest } from "next/server";
-import { NextResponse } from "next/server";
-
-import { createTRPCContext } from "@openstatus/api";
-import { lambdaRouter } from "@openstatus/api/src/lambda";
-import { clerkEvent } from "@openstatus/api/src/router/clerk/type";
-
-// import { clerkEvent } from "@openstatus/api/src/router/clerk";
-
-// export const config = {
-// api: {
-// bodyParser: false,
-// },
-// };
-
-export async function POST(req: NextRequest) {
- // Get witch headers is missing
- // const wh = new Webhook(env.CLERK_WEBHOOK_SECRET);
- // const msg = wh.verify(JSON.stringify(await req.json()), req.headers as any);
- const json = await req.json();
- const r = clerkEvent.safeParse(json);
- if (!r.success) {
- return NextResponse.json(
- { error: "Internal Server Error" },
- { status: 500 },
- );
- }
-
- const ctx = createTRPCContext({ req });
- const caller = lambdaRouter.createCaller(ctx);
- const event = r.data.type;
- switch (event) {
- case "user.created":
- await caller.clerkRouter.webhooks.userCreated({ data: r.data });
- break;
- case "user.updated":
- case "user.deleted":
- break;
-
- case "session.created":
- await caller.clerkRouter.webhooks.userSignedIn({ data: r.data });
- break;
- case "session.revoked":
- case "session.removed":
- case "session.ended":
- break;
-
- case "organization.created":
- case "organizationMembership.created":
- break;
-
- default:
- ((d: never) => console.error(`${d} not handled here`))(event);
- break;
- }
- return NextResponse.json({ success: true });
-}
diff --git a/apps/web/src/app/api/webhook/stripe/route.ts b/apps/web/src/app/api/webhook/stripe/route.ts
index 49476264a..32b56303e 100644
--- a/apps/web/src/app/api/webhook/stripe/route.ts
+++ b/apps/web/src/app/api/webhook/stripe/route.ts
@@ -22,7 +22,7 @@ export async function POST(req: NextRequest) {
/**
* Forward to tRPC API to handle the webhook event
*/
- const ctx = createTRPCContext({ req });
+ const ctx = await createTRPCContext({ req });
const caller = lambdaRouter.createCaller(ctx);
switch (event.type) {
diff --git a/apps/web/src/app/app/(auth)/layout.tsx b/apps/web/src/app/app/(auth)/layout.tsx
index 38673dcee..21814f3b1 100644
--- a/apps/web/src/app/app/(auth)/layout.tsx
+++ b/apps/web/src/app/app/(auth)/layout.tsx
@@ -1,21 +1,31 @@
import * as React from "react";
+import Image from "next/image";
+import Link from "next/link";
import { redirect } from "next/navigation";
-import { auth } from "@clerk/nextjs";
-export default function AuthLayout({
+import { auth } from "@/lib/auth";
+
+export default async function AuthLayout({
children,
}: {
children: React.ReactNode;
}) {
- const { userId } = auth();
+ const session = await auth();
+ if (session) redirect("/app");
- if (userId) {
- redirect("/app");
- }
return (
- <div className="grid min-h-screen grid-cols-1 md:grid-cols-2 xl:grid-cols-3">
- <aside className="border-border col-span-1 flex w-full items-center justify-center border p-3 backdrop-blur-[2px] md:p-6">
- <div className="w-full max-w-lg text-left">
+ <div className="grid min-h-screen grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-5">
+ <aside className="border-border col-span-1 flex w-full flex-col gap-4 border p-4 backdrop-blur-[2px] md:p-8 xl:col-span-2">
+ <Link href="/" className="relative">
+ <Image
+ src="/icon.png"
+ alt="OpenStatus"
+ height={30}
+ width={30}
+ className="border-border rounded-full border"
+ />
+ </Link>
+ <div className="flex w-full max-w-lg flex-1 flex-col justify-center text-left">
<h1 className="font-cal text-foreground mb-3 text-2xl">
Open Source Monitoring Service
</h1>
@@ -34,14 +44,10 @@ export default function AuthLayout({
</a>{" "}
and let us know your use case!
</p>
- {/* Add Demo tracker here? */}
- <div className="h-12" />
- {/* <p className="text-muted-foreground text-right text-sm font-light">
- *your data is safe
- </p> */}
</div>
+ <div className="md:h-[30px]" />
</aside>
- <main className="container col-span-1 mx-auto flex items-center justify-center md:col-span-1 xl:col-span-2">
+ <main className="container col-span-1 mx-auto flex items-center justify-center md:col-span-1 xl:col-span-3">
{children}
</main>
</div>
diff --git a/apps/web/src/app/app/(auth)/login/page.tsx b/apps/web/src/app/app/(auth)/login/page.tsx
new file mode 100644
index 000000000..9a2ece15c
--- /dev/null
+++ b/apps/web/src/app/app/(auth)/login/page.tsx
@@ -0,0 +1,76 @@
+import Link from "next/link";
+import { z } from "zod";
+
+import { Button } from "@openstatus/ui";
+
+import { Shell } from "@/components/dashboard/shell";
+import { Icons } from "@/components/icons";
+import { signIn } from "@/lib/auth";
+
+/**
+ * allowed URL search params
+ */
+const searchParamsSchema = z.object({
+ redirectTo: z.string().optional().default("/app"),
+});
+
+export default function Page({
+ searchParams,
+}: {
+ searchParams: { [key: string]: string | string[] | undefined };
+}) {
+ const search = searchParamsSchema.safeParse(searchParams);
+ const redirectTo = search.success ? search.data.redirectTo : "/app";
+
+ return (
+ <Shell className="my-4 grid w-full max-w-xl gap-6 md:p-10">
+ <div className="flex flex-col gap-2 text-center">
+ <h1 className="text-3xl font-semibold tracking-tight">Sign In</h1>
+ <p className="text-muted-foreground text-sm">
+ Get started now. No credit card required.
+ </p>
+ </div>
+ <div className="grid gap-3">
+ <form
+ action={async () => {
+ "use server";
+ await signIn("github", { redirectTo });
+ }}
+ className="w-full"
+ >
+ <Button type="submit" className="w-full">
+ Signin with GitHub <Icons.github className="ml-2 h-4 w-4" />
+ </Button>
+ </form>
+ <form
+ action={async () => {
+ "use server";
+ await signIn("google", { redirectTo });
+ }}
+ className="w-full"
+ >
+ <Button type="submit" className="w-full" variant="outline">
+ Signin with Google <Icons.google className="ml-2 h-4 w-4" />
+ </Button>
+ </form>
+ </div>
+ <p className="text-muted-foreground px-8 text-center text-sm">
+ By clicking continue, you agree to our{" "}
+ <Link
+ href="/legal/terms"
+ className="hover:text-primary underline underline-offset-4 hover:no-underline"
+ >
+ Terms of Service
+ </Link>{" "}
+ and{" "}
+ <Link
+ href="/legal/privacy"
+ className="hover:text-primary underline underline-offset-4 hover:no-underline"
+ >
+ Privacy Policy
+ </Link>
+ .
+ </p>
+ </Shell>
+ );
+}
diff --git a/apps/web/src/app/app/(auth)/sign-in/[[...sign-in]]/page.tsx b/apps/web/src/app/app/(auth)/sign-in/[[...sign-in]]/page.tsx
deleted file mode 100644
index 889711c52..000000000
--- a/apps/web/src/app/app/(auth)/sign-in/[[...sign-in]]/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { SignIn } from "@clerk/nextjs";
-
-export default function Page() {
- return <SignIn redirectUrl={"/app"} afterSignInUrl={"/app"} />;
-}
diff --git a/apps/web/src/app/app/(auth)/sign-in/page.tsx b/apps/web/src/app/app/(auth)/sign-in/page.tsx
new file mode 100644
index 000000000..448133216
--- /dev/null
+++ b/apps/web/src/app/app/(auth)/sign-in/page.tsx
@@ -0,0 +1,5 @@
+import { redirect } from "next/navigation";
+
+export default function Page() {
+ return redirect("/app/login");
+}
diff --git a/apps/web/src/app/app/(auth)/sign-up/[[...sign-up]]/page.tsx b/apps/web/src/app/app/(auth)/sign-up/[[...sign-up]]/page.tsx
deleted file mode 100644
index effaf9b5f..000000000
--- a/apps/web/src/app/app/(auth)/sign-up/[[...sign-up]]/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { SignUp } from "@clerk/nextjs";
-
-export default function Page() {
- return <SignUp redirectUrl={"/app"} afterSignUpUrl={"/app"} />;
-}
diff --git a/apps/web/src/app/app/(auth)/sign-up/page.tsx b/apps/web/src/app/app/(auth)/sign-up/page.tsx
new file mode 100644
index 000000000..448133216
--- /dev/null
+++ b/apps/web/src/app/app/(auth)/sign-up/page.tsx
@@ -0,0 +1,5 @@
+import { redirect } from "next/navigation";
+
+export default function Page() {
+ return redirect("/app/login");
+}
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/api-token/_components/actions.ts b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/api-token/_components/actions.ts
index e2c02e5de..367af7d89 100644
--- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/api-token/_components/actions.ts
+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/api-token/_components/actions.ts
@@ -1,28 +1,28 @@
"use server";
-import { currentUser } from "@clerk/nextjs";
import { Unkey } from "@unkey/api";
import { db, eq } from "@openstatus/db";
import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema";
import { env } from "@/env";
+import { auth } from "@/lib/auth";
const unkey = new Unkey({ token: env.UNKEY_TOKEN, cache: "no-cache" });
// REMINDER: server actions should have middlewares to do auth checks
export async function create(ownerId: number) {
- const _user = await currentUser();
+ const session = await auth();
- if (!_user) return;
+ if (!session?.user?.id) return;
const allowedWorkspaces = await db
.select()
.from(usersToWorkspaces)
.innerJoin(user, eq(user.id, usersToWorkspaces.userId))
.innerJoin(workspace, eq(workspace.id, usersToWorkspaces.workspaceId))
- .where(eq(user.tenantId, _user.id))
+ .where(eq(user.tenantId, session.user.id))
.all();
const allowedIds = allowedWorkspaces.map((i) => i.workspace.id);
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/layout.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/layout.tsx
new file mode 100644
index 000000000..3f66cdd00
--- /dev/null
+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/layout.tsx
@@ -0,0 +1,13 @@
+import { Header } from "@/components/dashboard/header";
+import { getPageBySegment } from "@/config/pages";
+
+const page = getPageBySegment(["settings", "user"]);
+
+export default function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ <Header title={page?.title} description={page?.description} />
+ {children}
+ </>
+ );
+}
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/loading.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/loading.tsx
new file mode 100644
index 000000000..5eb7326c5
--- /dev/null
+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/loading.tsx
@@ -0,0 +1,7 @@
+import { Skeleton } from "@openstatus/ui";
+
+// TODO: can be improved...
+
+export default function Loading() {
+ return <Skeleton className="h-72 w-full" />;
+}
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/page.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/page.tsx
new file mode 100644
index 000000000..277170f93
--- /dev/null
+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/settings/user/page.tsx
@@ -0,0 +1,54 @@
+"use client";
+
+import { useSession } from "next-auth/react";
+
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+ Input,
+ Label,
+} from "@openstatus/ui";
+
+import Loading from "./loading";
+
+export default function UserPage() {
+ const session = useSession();
+
+ if (!session.data?.user) {
+ return <Loading />;
+ }
+
+ return (
+ <div className="flex flex-col gap-8">
+ <div className="grid max-w-sm gap-3">
+ <div className="grid w-full items-center gap-1.5">
+ <Label htmlFor="fullname">Full name</Label>
+ <Input id="fullname" value={`${session.data.user?.name}`} disabled />
+ </div>
+ <div className="grid w-full items-center gap-1.5">
+ <Label htmlFor="email">Email</Label>
+ <Input
+ id="email"
+ type="email"
+ value={`${session.data.user?.email}`}
+ disabled
+ />
+ </div>
+ {/* <div className="flex flex-wrap items-end gap-2">
+ <div className="grid items-center gap-1.5">
+ <Label htmlFor="avatar">Image</Label>
+ <Input id="avatar" type="file" className="w-56" disabled />
+ </div>
+ <Avatar className="h-10 w-10">
+ <AvatarImage
+ src={session.data.user?.photoUrl || undefined}
+ alt={`${session.data.user?.name}`}
+ />
+ <AvatarFallback></AvatarFallback>
+ </Avatar>
+ </div> */}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/app/layout.tsx b/apps/web/src/app/app/layout.tsx
index cf2abb09f..4b5d121aa 100644
--- a/apps/web/src/app/app/layout.tsx
+++ b/apps/web/src/app/app/layout.tsx
@@ -1,9 +1,9 @@
-import { ClerkProvider } from "@clerk/nextjs";
+import { SessionProvider } from "next-auth/react";
export default function AuthLayout({
children, // will be a page or nested layout
}: {
children: React.ReactNode;
}) {
- return <ClerkProvider>{children}</ClerkProvider>;
+ return <SessionProvider>{children}</SessionProvider>;
}
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 0b987e3d9..2983538c1 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -38,7 +38,6 @@ export default function RootLayout({
}: {
children: React.ReactNode;
}) {
- // If you want to develop locally without Clerk, Comment the provider below
return (
<html lang="en">
<body className={`${inter.className} ${calSans.variable}`}>
diff --git a/apps/web/src/app/status-page/[domain]/_components/user-button.tsx b/apps/web/src/app/status-page/[domain]/_components/user-button.tsx
deleted file mode 100644
index 3c2ca4618..000000000
--- a/apps/web/src/app/status-page/[domain]/_components/user-button.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-"use client";
-
-import Link from "next/link";
-import { useUser } from "@clerk/nextjs";
-
-import { Button } from "@openstatus/ui";
-
-// Create a button only displayed if you are logged in and are the owner of the status page
-export function UserButton() {
- const { isSignedIn } = useUser();
- if (isSignedIn) {
- return (
- <Button asChild>
- <Link href="https://openstatus.dev/app">OpenStatus Dashboard</Link>
- </Button>
- );
- }
- return null;
-}
diff --git a/apps/web/src/components/icons.tsx b/apps/web/src/components/icons.tsx
index 9f25b1a2e..1c105181c 100644
--- a/apps/web/src/components/icons.tsx
+++ b/apps/web/src/components/icons.tsx
@@ -45,6 +45,7 @@ import {
ToyBrick,
Trash,
TwitterIcon,
+ UserCircle,
Users,
Webhook,
Youtube,
@@ -106,6 +107,7 @@ export const Icons = {
"hour-glass": Hourglass,
"candlestick-chart": CandlestickChart,
ratio: Ratio,
+ user: UserCircle,
discord: ({ ...props }: LucideProps) => (
<svg viewBox="0 0 640 512" {...props}>
<path
@@ -114,6 +116,14 @@ export const Icons = {
/>
</svg>
),
+ google: (props: LucideProps) => (
+ <svg viewBox="0 0 24 24" {...props}>
+ <path
+ fill="currentColor"
+ d="M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"
+ />
+ </svg>
+ ),
github: (props: LucideProps) => (
<svg viewBox="0 0 438.549 438.549" {...props}>
<path
diff --git a/apps/web/src/components/layout/header/app-header.tsx b/apps/web/src/components/layout/header/app-header.tsx
index 9f8e23362..23dd5529f 100644
--- a/apps/web/src/components/layout/header/app-header.tsx
+++ b/apps/web/src/components/layout/header/app-header.tsx
@@ -1,7 +1,6 @@
"use client";
import Link from "next/link";
-import { UserButton, useUser } from "@clerk/nextjs";
import { allChangelogs } from "contentlayer/generated";
import { ArrowUpRight } from "lucide-react";
@@ -11,6 +10,7 @@ import { Shell } from "@/components/dashboard/shell";
import { useCookieState } from "@/hooks/use-cookie-state";
import { AppTabs } from "./app-tabs";
import { Breadcrumbs } from "./breadcrumbs";
+import { UserNav } from "./user-nav";
const lastChangelog = allChangelogs
.sort(
@@ -20,7 +20,6 @@ const lastChangelog = allChangelogs
.pop();
export function AppHeader() {
- const { isLoaded, isSignedIn } = useUser();
const [lastViewed, setLastViewed] = useCookieState(
"last-viewed-changelog",
new Date(0).toISOString(),
@@ -67,7 +66,7 @@ export function AppHeader() {
<div className="relative">
<Skeleton className="h-8 w-8 rounded-full" />
<div className="absolute inset-0">
- {isLoaded && isSignedIn && <UserButton />}
+ <UserNav />
</div>
</div>
</div>
diff --git a/apps/web/src/components/layout/header/user-nav.tsx b/apps/web/src/components/layout/header/user-nav.tsx
new file mode 100644
index 000000000..fb52a4de5
--- /dev/null
+++ b/apps/web/src/components/layout/header/user-nav.tsx
@@ -0,0 +1,70 @@
+import Link from "next/link";
+import { useParams } from "next/navigation";
+import { signOut, useSession } from "next-auth/react";
+
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+ Button,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+ Skeleton,
+} from "@openstatus/ui";
+
+export function UserNav() {
+ const session = useSession();
+ const { workspaceSlug } = useParams<{ workspaceSlug: string }>();
+
+ if (session.status !== "authenticated") {
+ return <Skeleton className="h-8 w-8 rounded-full" />;
+ }
+
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="ghost" className="relative h-8 w-8 rounded-full">
+ <Avatar className="h-8 w-8">
+ <AvatarImage
+ src={session.data.user?.photoUrl || undefined}
+ alt={
+ session.data.user?.name ||
+ `${session.data.user?.firstName} ${session.data.user?.lastName}`
+ }
+ />
+ <AvatarFallback></AvatarFallback>
+ </Avatar>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-56" align="end" forceMount>
+ <DropdownMenuLabel className="font-normal">
+ <div className="flex flex-col space-y-1">
+ <p className="truncate text-sm font-medium leading-none">
+ {session.data.user?.name ||
+ `${session.data.user?.firstName} ${session.data.user?.lastName}`}
+ </p>
+ <p className="text-muted-foreground truncate text-xs leading-none">
+ {session.data.user?.email}
+ </p>
+ </div>
+ </DropdownMenuLabel>
+ <DropdownMenuSeparator />
+ <DropdownMenuGroup>
+ <DropdownMenuItem asChild>
+ <Link href={`/app/${workspaceSlug}/settings/billing`}>Billing</Link>
+ </DropdownMenuItem>
+ <DropdownMenuItem asChild>
+ <Link href={`/app/${workspaceSlug}/settings/user`}>Profile</Link>
+ </DropdownMenuItem>
+ </DropdownMenuGroup>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => signOut()}>Log out</DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ );
+}
diff --git a/apps/web/src/components/layout/login-button.tsx b/apps/web/src/components/layout/login-button.tsx
index 7b15f15cc..072051294 100644
--- a/apps/web/src/components/layout/login-button.tsx
+++ b/apps/web/src/components/layout/login-button.tsx
@@ -1,7 +1,7 @@
"use client";
import Link from "next/link";
-import { useUser } from "@clerk/nextjs";
+import { useSession } from "next-auth/react";
import type { ButtonProps } from "@openstatus/ui";
import { Button } from "@openstatus/ui";
@@ -9,14 +9,14 @@ import { Button } from "@openstatus/ui";
import { cn } from "@/lib/utils";
export function LoginButton({ className, ...props }: ButtonProps) {
- const { isSignedIn } = useUser();
+ const session = useSession();
return (
<Button asChild className={cn("rounded-full", className)} {...props}>
- {isSignedIn ? (
+ {session.status === "authenticated" ? (
<Link href="/app">Dashboard</Link>
) : (
- <Link href="/app/sign-up">Sign Up</Link>
+ <Link href="/app/login">Sign In</Link>
)}
</Button>
);
diff --git a/apps/web/src/components/layout/marketing-layout.tsx b/apps/web/src/components/layout/marketing-layout.tsx
index b7805efe4..545167473 100644
--- a/apps/web/src/components/layout/marketing-layout.tsx
+++ b/apps/web/src/components/layout/marketing-layout.tsx
@@ -1,4 +1,4 @@
-import { ClerkProvider } from "@clerk/nextjs";
+import { SessionProvider } from "next-auth/react";
import PlausibleProvider from "next-plausible";
import { MarketingFooter } from "./marketing-footer";
@@ -7,7 +7,7 @@ import { MarketingHeader } from "./marketing-header";
export function MarketingLayout({ children }: { children: React.ReactNode }) {
return (
<PlausibleProvider domain="openstatus.dev">
- <ClerkProvider>
+ <SessionProvider>
<main className="flex min-h-screen w-full flex-col items-center justify-center gap-8 p-4 md:p-8">
<MarketingHeader className="mx-auto w-full max-w-4xl" />
<div className="mx-auto flex w-full max-w-4xl flex-1 flex-col items-start justify-center">
@@ -15,7 +15,7 @@ export function MarketingLayout({ children }: { children: React.ReactNode }) {
</div>
<MarketingFooter className="mx-auto w-full max-w-4xl" />
</main>
- </ClerkProvider>
+ </SessionProvider>
</PlausibleProvider>
);
}
diff --git a/apps/web/src/components/layout/public-layout.tsx b/apps/web/src/components/layout/public-layout.tsx
index 2e468ea38..5c3988a6a 100644
--- a/apps/web/src/components/layout/public-layout.tsx
+++ b/apps/web/src/components/layout/public-layout.tsx
@@ -1,11 +1,11 @@
-import { ClerkProvider } from "@clerk/nextjs";
+import { SessionProvider } from "next-auth/react";
import { MarketingFooter } from "./marketing-footer";
import { PublicHeader } from "./public-header";
export function PublicLayout({ children }: { children: React.ReactNode }) {
return (
- <ClerkProvider>
+ <SessionProvider>
<main className="flex min-h-screen w-full flex-col items-center justify-center gap-8 p-4 md:p-8">
<PublicHeader className="mx-auto w-full max-w-4xl" />
<div className="mx-auto flex w-full max-w-4xl flex-1 flex-col items-start justify-center">
@@ -13,6 +13,6 @@ export function PublicLayout({ children }: { children: React.ReactNode }) {
</div>
<MarketingFooter className="mx-auto w-full max-w-4xl" />
</main>
- </ClerkProvider>
+ </SessionProvider>
);
}
diff --git a/apps/web/src/components/monitor-dashboard/response-details.tsx b/apps/web/src/components/monitor-dashboard/response-details.tsx
index 979922a7e..cff4796f3 100644
--- a/apps/web/src/components/monitor-dashboard/response-details.tsx
+++ b/apps/web/src/components/monitor-dashboard/response-details.tsx
@@ -60,7 +60,7 @@ export async function ResponseDetails(props: ResponseDetailsParams) {
<div>
<pre
className="bg-muted text-wrap rounded-md p-4 text-sm"
- // @ts-expect-error textWrap is not a valid prop even though it is
+ // @ts-expect-error some issues with types
style={{ textWrap: "wrap" }}
>
{message}
diff --git a/apps/web/src/components/ping-response-analysis/response-detail-tabs.tsx b/apps/web/src/components/ping-response-analysis/response-detail-tabs.tsx
index 04d9423d7..62a758110 100644
--- a/apps/web/src/components/ping-response-analysis/response-detail-tabs.tsx
+++ b/apps/web/src/components/ping-response-analysis/response-detail-tabs.tsx
@@ -53,7 +53,7 @@ export async function ResponseDetailTabs({
<div>
<pre
className="bg-muted text-wrap rounded-md p-4 text-sm"
- // @ts-expect-error textWrap is not a valid prop even though it is
+ // @ts-expect-error some issues with types
style={{ textWrap: "wrap" }}
>
{message}
diff --git a/apps/web/src/config/pages.ts b/apps/web/src/config/pages.ts
index 68ef5676f..36dcb1774 100644
--- a/apps/web/src/config/pages.ts
+++ b/apps/web/src/config/pages.ts
@@ -46,6 +46,13 @@ export const settingsPagesConfig: Page[] = [
icon: "sun",
segment: "appearance",
},
+ {
+ title: "User",
+ description: "Profile settings for the user.",
+ href: "/settings/user",
+ icon: "user",
+ segment: "user",
+ },
];
export const monitorPagesConfig: Page[] = [
diff --git a/apps/web/src/env.ts b/apps/web/src/env.ts
index 6a7f9af88..6a29407d8 100644
--- a/apps/web/src/env.ts
+++ b/apps/web/src/env.ts
@@ -6,10 +6,8 @@ import "@openstatus/analytics/env";
export const env = createEnv({
server: {
- CLERK_SECRET_KEY: z.string().min(1),
TINY_BIRD_API_KEY: z.string().min(1),
RESEND_API_KEY: z.string().min(1),
- CLERK_WEBHOOK_SECRET: z.string().min(1),
QSTASH_CURRENT_SIGNING_KEY: z.string().min(1),
QSTASH_NEXT_SIGNING_KEY: z.string().min(1),
QSTASH_TOKEN: z.string().min(1),
@@ -27,28 +25,13 @@ export const env = createEnv({
CLICKHOUSE_PASSWORD: z.string(),
},
client: {
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
- NEXT_PUBLIC_CLERK_SIGN_IN_URL: z.string().min(1),
- NEXT_PUBLIC_CLERK_SIGN_UP_URL: z.string().min(1),
- NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: z.string().min(1),
- NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL: z.string().min(1),
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: z.string(),
NEXT_PUBLIC_URL: z.string(),
NEXT_PUBLIC_SENTRY_DSN: z.string(),
},
runtimeEnv: {
- CLERK_SECRET_KEY: process.env.CLERK_SECRET_KEY,
TINY_BIRD_API_KEY: process.env.TINY_BIRD_API_KEY,
RESEND_API_KEY: process.env.RESEND_API_KEY,
- CLERK_WEBHOOK_SECRET: process.env.CLERK_WEBHOOK_SECRET,
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
- process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
- NEXT_PUBLIC_CLERK_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,
- NEXT_PUBLIC_CLERK_SIGN_UP_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL,
- NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL:
- process.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL,
- NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL:
- process.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL,
QSTASH_CURRENT_SIGNING_KEY: process.env.QSTASH_CURRENT_SIGNING_KEY,
QSTASH_NEXT_SIGNING_KEY: process.env.QSTASH_NEXT_SIGNING_KEY,
QSTASH_TOKEN: process.env.QSTASH_TOKEN,
diff --git a/apps/web/src/lib/auth/adapter.ts b/apps/web/src/lib/auth/adapter.ts
new file mode 100644
index 000000000..e9fa5b549
--- /dev/null
+++ b/apps/web/src/lib/auth/adapter.ts
@@ -0,0 +1,36 @@
+import { DrizzleAdapter } from "@auth/drizzle-adapter";
+import type { DefaultSession } from "next-auth";
+import type { Adapter } from "next-auth/adapters";
+
+import { db } from "@openstatus/db";
+import {
+ account,
+ session,
+ user,
+ verificationToken,
+} from "@openstatus/db/src/schema";
+
+import { createUser, getUser } from "./helper";
+
+export type { DefaultSession };
+
+export const adapter: Adapter = {
+ ...DrizzleAdapter(
+ // @ts-expect-error some issues with types
+ db,
+ {
+ usersTable: user,
+ accountsTable: account,
+ sessionsTable: session,
+ verificationTokensTable: verificationToken,
+ },
+ ),
+ // @ts-expect-error some issues with types
+ createUser: async (data) => {
+ return await createUser(data);
+ },
+ // @ts-expect-error some issues with types
+ getUser: async (id) => {
+ return await getUser(id);
+ },
+};
diff --git a/apps/web/src/lib/auth/helper.ts b/apps/web/src/lib/auth/helper.ts
new file mode 100644
index 000000000..358c40115
--- /dev/null
+++ b/apps/web/src/lib/auth/helper.ts
@@ -0,0 +1,69 @@
+import type { AdapterUser } from "next-auth/adapters";
+import * as randomWordSlugs from "random-word-slugs";
+
+import { db, eq } from "@openstatus/db";
+import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema";
+
+export async function createUser(data: AdapterUser) {
+ const { id, ...rest } = data;
+
+ const newUser = await db
+ .insert(user)
+ .values({ email: rest.email, photoUrl: rest.image, name: rest.name })
+ .returning({
+ id: user.id,
+ email: user.email,
+ emailVerified: user.emailVerified,
+ })
+ .get();
+
+ let slug: string | undefined = undefined;
+
+ while (!slug) {
+ slug = randomWordSlugs.generateSlug(2);
+ const slugAlreadyExists = await db
+ .select()
+ .from(workspace)
+ .where(eq(workspace.slug, slug))
+ .get();
+
+ if (slugAlreadyExists) {
+ console.log(`slug already exists: '${slug}'`);
+ slug = undefined;
+ }
+ }
+
+ const newWorkspace = await db
+ .insert(workspace)
+ .values({ slug, name: "" })
+ .returning({ id: workspace.id })
+ .get();
+
+ await db
+ .insert(usersToWorkspaces)
+ .values({
+ userId: newUser.id,
+ workspaceId: newWorkspace.id,
+ role: "owner",
+ })
+ .returning()
+ .get();
+
+ return newUser;
+}
+
+export async function getUser(id: string) {
+ const _user = await db
+ .select({
+ id: user.id,
+ email: user.email,
+ firstName: user.firstName,
+ lastName: user.lastName,
+ photoUrl: user.photoUrl,
+ })
+ .from(user)
+ .where(eq(user.id, Number(id)))
+ .get();
+
+ return _user || null;
+}
diff --git a/apps/web/src/lib/auth/index.ts b/apps/web/src/lib/auth/index.ts
new file mode 100644
index 000000000..27547e9eb
--- /dev/null
+++ b/apps/web/src/lib/auth/index.ts
@@ -0,0 +1,117 @@
+import type { DefaultSession } from "next-auth";
+import NextAuth from "next-auth";
+import GitHub from "next-auth/providers/github";
+import Google from "next-auth/providers/google";
+
+import { analytics, trackAnalytics } from "@openstatus/analytics";
+// import Credentials from "next-auth/providers/credentials";
+
+import { db, eq } from "@openstatus/db";
+import { user } from "@openstatus/db/src/schema";
+import { sendEmail, WelcomeEmail } from "@openstatus/emails";
+
+import { adapter } from "./adapter";
+
+export type { DefaultSession };
+
+export const { handlers, signIn, signOut, auth } = NextAuth({
+ // debug: true,
+ adapter,
+ providers: [
+ GitHub({ allowDangerousEmailAccountLinking: true }),
+ Google({
+ allowDangerousEmailAccountLinking: true,
+ authorization: {
+ params: {
+ // See https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
+ prompt: "select_account",
+ // scope:
+ // "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
+ },
+ },
+ }),
+ ],
+ callbacks: {
+ async signIn(params) {
+ // We keep updating the user info when we loggin in
+
+ if (params.account?.provider === "google") {
+ if (!params.profile) return true;
+ if (Number.isNaN(Number(params.user.id))) return true;
+
+ console.log(params.profile);
+
+ await db
+ .update(user)
+ .set({
+ firstName: params.profile.given_name,
+ lastName: params.profile.family_name,
+ photoUrl: params.profile.picture,
+ // keep the name in sync
+ name: `${params.profile.given_name} ${params.profile.family_name}`,
+ })
+ .where(eq(user.id, Number(params.user.id)))
+ .run();
+ }
+ if (params.account?.provider === "github") {
+ if (!params.profile) return true;
+ if (Number.isNaN(Number(params.user.id))) return true;
+
+ console.log(params.profile);
+
+ await db
+ .update(user)
+ .set({
+ name: params.profile.name,
+ photoUrl: String(params.profile.avatar_url),
+ })
+ .where(eq(user.id, Number(params.user.id)))
+ .run();
+ }
+
+ return true;
+ },
+ async session(params) {
+ return params.session;
+ },
+ },
+ events: {
+ // That should probably done in the callback method instead
+ async createUser(params) {
+ if (!params.user.id || !params.user.email) {
+ throw new Error("User id & email is required");
+ }
+
+ // this means the user has already been created with clerk
+ if (params.user.tenantId) return;
+
+ await sendEmail({
+ from: "Thibault Le Ouay Ducasse <[email protected]>",
+ subject: "Level up your website and API monitoring.",
+ to: [params.user.email],
+ react: WelcomeEmail(),
+ });
+
+ const { id: userId, email } = params.user;
+
+ await analytics.identify(userId, { email, userId });
+ await trackAnalytics({ event: "User Created", userId, email });
+ },
+
+ async signIn(params) {
+ if (params.isNewUser) return;
+ if (!params.user.id || !params.user.email) return;
+
+ const { id: userId, email } = params.user;
+
+ await analytics.identify(userId, { userId, email });
+ await trackAnalytics({ event: "User Signed In" });
+ },
+ },
+ pages: {
+ signIn: "/app/login",
+ // newUser: "/app/onboarding", // TODO: rethink this as we still have the `slug` to use
+ },
+ // basePath: "/api/auth", // default is `/api/auth`
+ // secret: process.env.AUTH_SECRET, // default is `AUTH_SECRET`
+});
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index f1ea84652..847e46230 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -1,38 +1,11 @@
-import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
-import { authMiddleware, redirectToSignIn } from "@clerk/nextjs";
import { db, eq } from "@openstatus/db";
-import {
- monitor,
- user,
- usersToWorkspaces,
- workspace,
-} from "@openstatus/db/src/schema";
+import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema";
+import { auth } from "@/lib/auth";
import { env } from "./env";
-const before = (req: NextRequest) => {
- const url = req.nextUrl.clone();
-
- if (url.pathname.includes("api/trpc")) {
- return NextResponse.next();
- }
-
- const host = req.headers.get("host");
- const subdomain = getValidSubdomain(host);
- if (subdomain) {
- // Subdomain available, rewriting
- console.log(
- `>>> Rewriting: ${url.pathname} to /status-page/${subdomain}${url.pathname}`,
- );
- url.pathname = `/status-page/${subdomain}${url.pathname}`;
- return NextResponse.rewrite(url);
- }
-
- return NextResponse.next();
-};
-
export const getValidSubdomain = (host?: string | null) => {
let subdomain: string | null = null;
if (!host && typeof window !== "undefined") {
@@ -60,102 +33,86 @@ export const getValidSubdomain = (host?: string | null) => {
return subdomain;
};
-export default authMiddleware({
- publicRoutes: [
- "/",
- "/play",
- "/play/(.*)",
- "/monitor/(.*)",
- "/api/(.*)",
- "/api/webhook/clerk",
- "/api/checker/regions/(.*)",
- "/api/checker/cron/10m",
- "/blog",
- "/blog/(.*)",
- "/status",
- "/status/(.*)",
- "/changelog",
- "/changelog/(.*)",
- "/legal/(.*)",
- "/about",
- "/cal",
- "/discord",
- "/github",
- "/pricing",
- "/oss-friends",
- "/status-page/(.*)",
- "/incidents", // used when trying subdomain slug via status.documenso.com/incidents
- "/incidents/(.*)", // used when trying subdomain slug via status.documenso.com/incidents/123
- "/monitors", // used when trying subdomain slug via status.documenso.com/monitors
- "/monitors/(.*)", // used when trying subdomain slug via status.documenso.com/monitors/123
- "/verify/(.*)", // used when trying subdomain slug via status.documenso.com/incidents
- "/public/(.*)",
- "/badge", // used when trying subdomain slug via status.documenso.com/badge to get the badge
- ],
- ignoredRoutes: ["/api/og", "/discord", "/github", "/status-page/(.*)"], // FIXME: we should check the `publicRoutes`
- beforeAuth: before,
- debug: true, // FIXME: status.revert.dev
- async afterAuth(auth, req) {
- // handle users who aren't authenticated
- if (!auth.userId && !auth.isPublicRoute) {
- return redirectToSignIn({ returnBackUrl: req.url });
- }
+const publicAppPaths = [
+ "/app/sign-in",
+ "/app/sign-up",
+ "/app/login",
+ "/app/invite",
+];
- if (auth.userId) {
- const pathname = req.nextUrl.pathname;
- if (pathname.startsWith("/app") && !pathname.startsWith("/app/invite")) {
- const workspaceSlug = req.nextUrl.pathname.split("/")?.[2];
- const hasWorkspaceSlug = !!workspaceSlug && workspaceSlug.trim() !== "";
-
- const allowedWorkspaces = await db
- .select()
- .from(usersToWorkspaces)
- .innerJoin(user, eq(user.id, usersToWorkspaces.userId))
- .innerJoin(workspace, eq(workspace.id, usersToWorkspaces.workspaceId))
- .where(eq(user.tenantId, auth.userId))
- .all();
-
- // means, we are "not only on `/app` or `/app/`"
- if (hasWorkspaceSlug) {
- console.log(">>> Workspace slug", workspaceSlug);
- const hasAccessToWorkspace = allowedWorkspaces.find(
- ({ workspace }) => workspace.slug === workspaceSlug,
- );
- if (hasAccessToWorkspace) {
- console.log(">>> Allowed! Attaching to cookie", workspaceSlug);
- req.cookies.set("workspace-slug", workspaceSlug);
- } else {
- console.log(">>> Not allowed, redirecting to /app", workspaceSlug);
- const appURL = new URL("/app", req.url);
- return NextResponse.redirect(appURL);
- }
+// remove auth middleware if needed
+// export const middleware = () => NextResponse.next();
+
+export default auth(async (req) => {
+ const url = req.nextUrl.clone();
+
+ if (url.pathname.includes("api/trpc")) {
+ return NextResponse.next();
+ }
+
+ const host = req.headers.get("host");
+ const subdomain = getValidSubdomain(host);
+
+ // Rewriting to status page!
+ if (subdomain) {
+ url.pathname = `/status-page/${subdomain}${url.pathname}`;
+ return NextResponse.rewrite(url);
+ }
+
+ const pathname = req.nextUrl.pathname;
+
+ const isPublicAppPath = publicAppPaths.some((path) =>
+ pathname.startsWith(path),
+ );
+
+ if (!req.auth && pathname.startsWith("/app") && !isPublicAppPath) {
+ return NextResponse.redirect(
+ new URL(`/app/login?redirectTo=${encodeURIComponent(pathname)}`, req.url),
+ );
+ }
+
+ if (req.auth && req.auth.user?.id) {
+ if (pathname.startsWith("/app") && !isPublicAppPath) {
+ const workspaceSlug = req.nextUrl.pathname.split("/")?.[2];
+ const hasWorkspaceSlug = !!workspaceSlug && workspaceSlug.trim() !== "";
+
+ const allowedWorkspaces = await db
+ .select()
+ .from(usersToWorkspaces)
+ .innerJoin(user, eq(user.id, usersToWorkspaces.userId))
+ .innerJoin(workspace, eq(workspace.id, usersToWorkspaces.workspaceId))
+ .where(eq(user.id, parseInt(req.auth.user.id)))
+ .all();
+
+ if (hasWorkspaceSlug) {
+ const hasAccessToWorkspace = allowedWorkspaces.find(
+ ({ workspace }) => workspace.slug === workspaceSlug,
+ );
+ if (hasAccessToWorkspace) {
+ const response = NextResponse.next();
+ response.cookies.set("workspace-slug", workspaceSlug);
+ return response;
} else {
- console.log(">>> No workspace slug available");
- if (allowedWorkspaces.length > 0) {
- const firstWorkspace = allowedWorkspaces[0].workspace;
- const { id, slug } = firstWorkspace;
- console.log(">>> Redirecting to first related workspace", slug);
- const firstMonitor = await db
- .select()
- .from(monitor)
- .where(eq(monitor.workspaceId, firstWorkspace.id))
- .get();
-
- if (!firstMonitor) {
- console.log(`>>> Redirecting to onboarding`, slug);
- const onboardingURL = new URL(`/app/${slug}/onboarding`, req.url);
- return NextResponse.redirect(onboardingURL);
- }
-
- console.log(">>> Redirecting to workspace", slug);
- const monitorURL = new URL(`/app/${slug}/monitors`, req.url);
- return NextResponse.redirect(monitorURL);
- }
- console.log(">>> No action taken");
+ return NextResponse.redirect(new URL("/app", req.url));
+ }
+ } else {
+ if (allowedWorkspaces.length > 0) {
+ const firstWorkspace = allowedWorkspaces[0].workspace;
+ const { slug } = firstWorkspace;
+ return NextResponse.redirect(
+ new URL(`/app/${slug}/monitors`, req.url),
+ );
}
}
}
- },
+ }
+
+ // reset workspace slug cookie if no auth
+ if (!req.auth && req.cookies.has("workspace-slug")) {
+ const response = NextResponse.next();
+ response.cookies.delete("workspace-slug");
+ return response;
+ }
});
export const config = {
@@ -165,4 +122,20 @@ export const config = {
"/(api/webhook|api/trpc)(.*)",
"/(!api/checker/:path*|!api/og|!api/ping)",
],
+ unstable_allowDynamic: [
+ // use a glob to allow anything in the function-bind 3rd party module
+ // "**/packages/analytics/src/**",
+ // // "@jitsu/js/**",
+ // "**/node_modules/@jitsu/**",
+ // "**/node_modules/**/@jitsu/**",
+ // "**/node_modules/@openstatus/analytics/**",
+ // "@openstatus/analytics/**",
+ // "@jitsu/js/dist/jitsu.es.js",
+ // "**/analytics/src/**",
+ // "**/node_modules/.pnpm/@jitsu/**",
+ // "/node_modules/function-bind/**",
+ // "**/node_modules/.pnpm/**/function-bind/**",
+ // "../../packages/analytics/src/index.ts",
+ "**/node_modules/.pnpm/@jitsu*/**",
+ ],
};
diff --git a/apps/web/src/next-auth.d.ts b/apps/web/src/next-auth.d.ts
new file mode 100644
index 000000000..b8241f8cc
--- /dev/null
+++ b/apps/web/src/next-auth.d.ts
@@ -0,0 +1,11 @@
+import type { DefaultUser } from "next-auth";
+
+// FIXME: this is very wrong - no type `DefaultUser` exists
+// also doenst provide autocomplete and type safety-ness
+
+declare module "next-auth" {
+ interface User extends Omit<DefaultUser, "id"> {
+ id: number;
+ email: string;
+ }
+}
diff --git a/apps/web/src/trpc/shared.ts b/apps/web/src/trpc/shared.ts
index 6bed7dd2a..6cdf264fc 100644
--- a/apps/web/src/trpc/shared.ts
+++ b/apps/web/src/trpc/shared.ts
@@ -10,7 +10,7 @@ const getBaseUrl = () => {
return `http://localhost:3000`;
};
-const lambdas = ["clerkRouter", "stripeRouter", "rumRouter"];
+const lambdas = ["stripeRouter", "rumRouter"];
export const endingLink = (opts?: {
headers?: HTTPHeaders | (() => HTTPHeaders);
diff --git a/packages/analytics/package.json b/packages/analytics/package.json
index c712730db..93289612b 100644
--- a/packages/analytics/package.json
+++ b/packages/analytics/package.json
@@ -4,7 +4,7 @@
"description": "",
"main": "src/index.ts",
"dependencies": {
- "@jitsu/js": "1.3.0",
+ "@jitsu/js": "1.9.2",
"@t3-oss/env-core": "0.7.0",
"zod": "3.22.4"
},
diff --git a/packages/api/package.json b/packages/api/package.json
index 3a4bbb869..e6ef07c2b 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -7,7 +7,6 @@
"test": "bun test"
},
"dependencies": {
- "@clerk/nextjs": "4.29.9",
"@openstatus/analytics": "workspace:*",
"@openstatus/assertions": "workspace:*",
"@openstatus/db": "workspace:*",
@@ -19,7 +18,7 @@
"@trpc/server": "10.45.1",
"nanoid": "5.0.7",
"nanoid-dictionary": "5.0.0-beta.1",
- "next": "14.2.1",
+ "next": "14.2.3",
"random-word-slugs": "0.1.7",
"stripe": "13.8.0",
"superjson": "1.13.3",
diff --git a/packages/api/src/lambda.ts b/packages/api/src/lambda.ts
index 711890733..f6d866ff5 100644
--- a/packages/api/src/lambda.ts
+++ b/packages/api/src/lambda.ts
@@ -1,11 +1,9 @@
-import { clerkRouter } from "./router/clerk/webhook";
import { rumRouter } from "./router/rum";
import { stripeRouter } from "./router/stripe";
import { createTRPCRouter } from "./trpc";
// Deployed to /trpc/lambda/**
export const lambdaRouter = createTRPCRouter({
- clerkRouter: clerkRouter,
stripeRouter: stripeRouter,
rumRouter: rumRouter,
});
diff --git a/packages/api/src/router/clerk/type.ts b/packages/api/src/router/clerk/type.ts
deleted file mode 100644
index 66a682b70..000000000
--- a/packages/api/src/router/clerk/type.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import { z } from "zod";
-
-export const clerkEvent = z.discriminatedUnion("type", [
- z.object({
- type: z.literal("user.created"),
- data: z.object({
- id: z.string(),
- // username: z.string(),
- created_at: z.number(),
- email_addresses: z.array(
- z.object({
- email_address: z.string(),
- }),
- ),
- first_name: z.string().nullable(),
- last_name: z.string().nullable(),
- }),
- }),
- z.object({
- type: z.literal("user.updated"),
- data: z.object({
- id: z.string(),
- updated_at: z.number(),
- }),
- }),
- z.object({
- type: z.literal("user.deleted"),
- data: z.object({
- id: z.string(),
- }),
- }),
- z.object({
- type: z.literal("organization.created"),
- data: z.object({
- id: z.string(),
- slug: z.string(),
- name: z.string(),
- created_at: z.number(),
- }),
- }),
- z.object({
- type: z.literal("session.created"),
- data: z.object({
- id: z.string(),
- user_id: z.string(),
- created_at: z.number(),
- expire_at: z.number(),
- }),
- }),
- z.object({
- type: z.literal("session.revoked"),
- data: z.object({
- id: z.string(),
- user_id: z.string(),
- }),
- }),
- z.object({
- type: z.literal("session.removed"),
- data: z.object({
- id: z.string(),
- user_id: z.string(),
- }),
- }),
- z.object({
- type: z.literal("session.ended"),
- data: z.object({
- id: z.string(),
- user_id: z.string(),
- }),
- }),
- z.object({
- type: z.literal("organizationMembership.created"),
- data: z.object({
- created_at: z.number(),
- organization: z.object({
- id: z.string(),
- slug: z.string(),
- name: z.string(),
- }),
- public_user_data: z.object({
- user_id: z.string(),
- }),
- }),
- }),
-]);
diff --git a/packages/api/src/router/clerk/webhook.ts b/packages/api/src/router/clerk/webhook.ts
deleted file mode 100644
index d31051569..000000000
--- a/packages/api/src/router/clerk/webhook.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import * as randomWordSlugs from "random-word-slugs";
-import * as z from "zod";
-
-import { analytics, trackAnalytics } from "@openstatus/analytics";
-import { eq } from "@openstatus/db";
-import { user, usersToWorkspaces, workspace } from "@openstatus/db/src/schema";
-import { sendEmail, WelcomeEmail } from "@openstatus/emails";
-
-import { createTRPCRouter, publicProcedure } from "../../trpc";
-import { clerkEvent } from "./type";
-
-export const webhookProcedure = publicProcedure.input(
- z.object({
- data: clerkEvent,
- }),
-);
-
-export const webhookRouter = createTRPCRouter({
- userCreated: webhookProcedure.mutation(async (opts) => {
- if (opts.input.data.type === "user.created") {
- // There's no primary key with drizzle I checked the tennant is not already in the database
- const alreadyExists = await opts.ctx.db
- .select({ id: user.id })
- .from(user)
- .where(eq(user.tenantId, opts.input.data.data.id))
- .get();
- if (alreadyExists) return;
- const userResult = await opts.ctx.db
- .insert(user)
- .values({
- email: opts.input.data.data.email_addresses[0].email_address,
- tenantId: opts.input.data.data.id,
- firstName: opts.input.data.data.first_name,
- lastName: opts.input.data.data.last_name || "",
- })
- .returning()
- .get();
-
- // guarantee the slug is unique accross our workspace entries
- let slug: string | undefined = undefined;
-
- while (!slug) {
- slug = randomWordSlugs.generateSlug(2);
- const slugAlreadyExists = await opts.ctx.db
- .select()
- .from(workspace)
- .where(eq(workspace.slug, slug))
- .get();
- if (slugAlreadyExists) {
- console.log(`slug already exists: '${slug}'`);
- slug = undefined;
- }
- }
-
- const workspaceResult = await opts.ctx.db
- .insert(workspace)
- .values({ slug, name: "" })
- .returning({ id: workspace.id })
- .get();
- await opts.ctx.db
- .insert(usersToWorkspaces)
- .values({
- userId: userResult.id,
- workspaceId: workspaceResult.id,
- role: "owner",
- })
- .returning()
- .get();
-
- await sendEmail({
- from: "Thibault Le Ouay Ducasse <[email protected]>",
- subject: "Level up your website and API monitoring.",
- to: [opts.input.data.data.email_addresses[0].email_address],
- react: WelcomeEmail(),
- });
-
- await analytics.identify(String(userResult.id), {
- email: opts.input.data.data.email_addresses[0].email_address,
- userId: userResult.id,
- });
- await trackAnalytics({
- event: "User Created",
- userId: String(userResult.id),
- email: opts.input.data.data.email_addresses[0].email_address,
- });
- }
- }),
- userUpdated: webhookProcedure.mutation(async (opts) => {
- if (opts.input.data.type === "user.updated") {
- // We should do something
- }
- }),
- userSignedIn: webhookProcedure.mutation(async (opts) => {
- if (opts.input.data.type === "session.created") {
- const currentUser = await opts.ctx.db
- .select({ id: user.id, email: user.email })
- .from(user)
- .where(eq(user.tenantId, opts.input.data.data.user_id))
- .get();
- // Then it's the new user it might be null
- if (!currentUser) return;
-
- await analytics.identify(String(currentUser.id), {
- userId: currentUser.id,
- email: currentUser.email,
- });
- await trackAnalytics({ event: "User Signed In" });
- }
- }),
-});
-
-export const clerkRouter = createTRPCRouter({
- webhooks: webhookRouter,
-});
diff --git a/packages/api/src/router/invitation.ts b/packages/api/src/router/invitation.ts
index 572d49f65..33be60eee 100644
--- a/packages/api/src/router/invitation.ts
+++ b/packages/api/src/router/invitation.ts
@@ -132,8 +132,10 @@ export const invitationRouter = createTRPCRouter({
},
});
+ if (!opts.ctx.user?.id) return "Missing user";
+
const _user = await opts.ctx.db.query.user.findFirst({
- where: eq(user.tenantId, opts.ctx.auth?.userId || ""),
+ where: eq(user.id, opts.ctx.user.id),
});
if (!_user) return "Invalid user";
diff --git a/packages/api/src/router/stripe/index.ts b/packages/api/src/router/stripe/index.ts
index a3c4f89bb..45037aecc 100644
--- a/packages/api/src/router/stripe/index.ts
+++ b/packages/api/src/router/stripe/index.ts
@@ -35,7 +35,7 @@ export const stripeRouter = createTRPCRouter({
const currentUser = opts.ctx.db
.select()
.from(user)
- .where(eq(user.tenantId, opts.ctx.auth.userId))
+ .where(eq(user.id, opts.ctx.user.id))
.as("currentUser");
const userHasAccess = await opts.ctx.db
.select()
@@ -97,7 +97,7 @@ export const stripeRouter = createTRPCRouter({
const currentUser = opts.ctx.db
.select()
.from(user)
- .where(eq(user.tenantId, opts.ctx.auth.userId))
+ .where(eq(user.id, opts.ctx.user.id))
.as("currentUser");
const userHasAccess = await opts.ctx.db
.select()
@@ -112,7 +112,7 @@ export const stripeRouter = createTRPCRouter({
const currentUser = await opts.ctx.db
.select()
.from(user)
- .where(eq(user.tenantId, opts.ctx.auth.userId))
+ .where(eq(user.id, opts.ctx.user.id))
.get();
const customerData: {
metadata: { workspaceId: string };
diff --git a/packages/api/src/router/user.ts b/packages/api/src/router/user.ts
index b7df97ab4..da31dbb99 100644
--- a/packages/api/src/router/user.ts
+++ b/packages/api/src/router/user.ts
@@ -10,7 +10,7 @@ export const userRouter = createTRPCRouter({
const currentUser = await opts.ctx.db
.select()
.from(user)
- .where(eq(user.tenantId, opts.ctx.auth.userId))
+ .where(eq(user.id, opts.ctx.user.id))
.get();
return currentUser;
}),
diff --git a/packages/api/src/router/workspace.test.ts b/packages/api/src/router/workspace.test.ts
index ab2a41d9f..1ff76961f 100644
--- a/packages/api/src/router/workspace.test.ts
+++ b/packages/api/src/router/workspace.test.ts
@@ -6,10 +6,11 @@ import { createInnerTRPCContext } from "../trpc";
test("Get Test Workspace", async () => {
const ctx = createInnerTRPCContext({
req: undefined,
- // @ts-expect-error
- auth: {
- userId: "1",
- sessionId: "1",
+ // @ts-expect-error some issues with types
+ session: {
+ user: {
+ id: "1",
+ },
},
//@ts-expect-error
workspace: {
@@ -37,10 +38,11 @@ test("Get Test Workspace", async () => {
test("by default we get the first workspace", async () => {
const ctx = createInnerTRPCContext({
req: undefined,
- // @ts-expect-error
- auth: {
- userId: "1",
- sessionId: "1",
+ // @ts-expect-error some issues with types
+ session: {
+ user: {
+ id: "1",
+ },
},
workspace: undefined,
});
@@ -65,10 +67,11 @@ test("by default we get the first workspace", async () => {
test("All workspaces", async () => {
const ctx = createInnerTRPCContext({
req: undefined,
- // @ts-expect-error
- auth: {
- userId: "1",
- sessionId: "1",
+ // @ts-expect-error some issues with types
+ session: {
+ user: {
+ id: "1",
+ },
},
});
diff --git a/packages/api/src/router/workspace.ts b/packages/api/src/router/workspace.ts
index f602a3b17..714fd5eac 100644
--- a/packages/api/src/router/workspace.ts
+++ b/packages/api/src/router/workspace.ts
@@ -1,5 +1,6 @@
import { TRPCError } from "@trpc/server";
import { generateSlug } from "random-word-slugs";
+import * as randomWordSlugs from "random-word-slugs";
import { z } from "zod";
import { and, eq, sql } from "@openstatus/db";
@@ -18,6 +19,41 @@ import { Limits } from "@openstatus/plans";
import { createTRPCRouter, protectedProcedure } from "../trpc";
export const workspaceRouter = createTRPCRouter({
+ createWorkspace: protectedProcedure
+ .input(z.object({ userId: z.string() }))
+ .mutation(async (opts) => {
+ // guarantee the slug is unique accross our workspace entries
+ let slug: string | undefined = undefined;
+
+ while (!slug) {
+ slug = randomWordSlugs.generateSlug(2);
+ const slugAlreadyExists = await opts.ctx.db
+ .select()
+ .from(workspace)
+ .where(eq(workspace.slug, slug))
+ .get();
+ if (slugAlreadyExists) {
+ console.log(`slug already exists: '${slug}'`);
+ slug = undefined;
+ }
+ }
+
+ const _workspace = await opts.ctx.db
+ .insert(workspace)
+ .values({ slug, name: "" })
+ .returning({ id: workspace.id })
+ .get();
+
+ await opts.ctx.db
+ .insert(usersToWorkspaces)
+ .values({
+ userId: opts.ctx.user.id,
+ workspaceId: _workspace.id,
+ role: "owner",
+ })
+ .returning()
+ .get();
+ }),
getUserWithWorkspace: protectedProcedure.query(async (opts) => {
return await opts.ctx.db.query.user.findMany({
with: {
@@ -27,7 +63,7 @@ export const workspaceRouter = createTRPCRouter({
},
},
},
- where: eq(user.tenantId, opts.ctx.auth.userId),
+ where: eq(user.id, opts.ctx.user.id),
});
}),
@@ -40,6 +76,8 @@ export const workspaceRouter = createTRPCRouter({
}),
getUserWorkspaces: protectedProcedure.query(async (opts) => {
+ console.log(opts.ctx.user);
+
const result = await opts.ctx.db.query.usersToWorkspaces.findMany({
where: eq(usersToWorkspaces.userId, opts.ctx.user.id),
with: {
@@ -147,18 +185,6 @@ export const workspaceRouter = createTRPCRouter({
.where(eq(workspace.id, opts.ctx.workspace.id));
}),
- createWorkspace: protectedProcedure
- .input(z.object({ name: z.string() }))
- .mutation(async (opts) => {
- const slug = generateSlug(2);
-
- return opts.ctx.db
- .insert(workspace)
- .values({ slug: slug, name: opts.input.name })
- .returning()
- .get();
- }),
-
getCurrentWorkspaceNumbers: protectedProcedure.query(async (opts) => {
const currentNumbers = await opts.ctx.db.transaction(async (tx) => {
const notifications = await tx
diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts
index 074b5fec3..67b3ea352 100644
--- a/packages/api/src/trpc.ts
+++ b/packages/api/src/trpc.ts
@@ -1,9 +1,4 @@
import type { NextRequest } from "next/server";
-import type {
- SignedInAuthObject,
- SignedOutAuthObject,
-} from "@clerk/nextjs/api";
-import { getAuth } from "@clerk/nextjs/server";
import { inferAsyncReturnType, initTRPC, TRPCError } from "@trpc/server";
import superjson from "superjson";
import { ZodError } from "zod";
@@ -11,6 +6,12 @@ import { ZodError } from "zod";
import { clickhouseClient, db, eq, schema } from "@openstatus/db";
import type { User, Workspace } from "@openstatus/db/src/schema";
+// TODO: create a package for this
+import {
+ auth,
+ DefaultSession as Session,
+} from "../../../apps/web/src/lib/auth";
+
/**
* 1. CONTEXT
*
@@ -21,7 +22,7 @@ import type { User, Workspace } from "@openstatus/db/src/schema";
*
*/
type CreateContextOptions = {
- auth: SignedInAuthObject | SignedOutAuthObject | null;
+ session: Session | null;
workspace?: Workspace | null;
user?: User | null;
req?: NextRequest;
@@ -49,16 +50,16 @@ export const createInnerTRPCContext = (opts: CreateContextOptions) => {
* process every request that goes through your tRPC endpoint
* @link https://trpc.io/docs/context
*/
-export const createTRPCContext = (opts: {
+export const createTRPCContext = async (opts: {
req: NextRequest;
serverSideCall?: boolean;
}) => {
- const auth = !opts.serverSideCall ? getAuth(opts.req) : null;
+ const session = await auth();
const workspace = null;
const user = null;
return createInnerTRPCContext({
- auth,
+ session,
workspace,
user,
req: opts.req,
@@ -115,7 +116,7 @@ export const publicProcedure = t.procedure;
* procedure
*/
const enforceUserIsAuthed = t.middleware(async ({ ctx, next }) => {
- if (!ctx.auth?.userId) {
+ if (!ctx.session?.user?.id) {
throw new TRPCError({ code: "UNAUTHORIZED" });
}
@@ -124,7 +125,7 @@ const enforceUserIsAuthed = t.middleware(async ({ ctx, next }) => {
// * comparing the `user.tenantId` to clerk's `auth.userId`
// */
const userAndWorkspace = await db.query.user.findFirst({
- where: eq(schema.user.tenantId, ctx.auth.userId),
+ where: eq(schema.user.id, Number(ctx.session.user.id)),
with: {
usersToWorkspaces: {
with: {
@@ -176,10 +177,6 @@ const enforceUserIsAuthed = t.middleware(async ({ ctx, next }) => {
return next({
ctx: {
...ctx,
- auth: {
- ...ctx.auth,
- userId: ctx.auth.userId,
- },
user,
workspace,
},
diff --git a/packages/config/eslint/package.json b/packages/config/eslint/package.json
index 26e25a0cc..10e5f4efb 100644
--- a/packages/config/eslint/package.json
+++ b/packages/config/eslint/package.json
@@ -7,7 +7,7 @@
"@types/eslint": "8.44.3",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
- "eslint-config-next": "14.2.1",
+ "eslint-config-next": "14.2.3",
"eslint-config-prettier": "9.0.0",
"eslint-config-turbo": "1.10.14",
"eslint-plugin-import": "2.28.1",
diff --git a/packages/db/.env.example b/packages/db/.env.example
index 9341e418e..0e045f7e3 100644
--- a/packages/db/.env.example
+++ b/packages/db/.env.example
@@ -1,2 +1,7 @@
DATABASE_URL=http://127.0.0.1:8080
DATABASE_AUTH_TOKEN=any-token
+
+
+CLICKHOUSE_URL=http://localhost:8123
+CLICKHOUSE_USERNAME=default
+CLICKHOUSE_PASSWORD=
\ No newline at end of file
diff --git a/packages/db/drizzle/0028_thin_power_pack.sql b/packages/db/drizzle/0028_thin_power_pack.sql
new file mode 100644
index 000000000..4561c83a5
--- /dev/null
+++ b/packages/db/drizzle/0028_thin_power_pack.sql
@@ -0,0 +1,32 @@
+CREATE TABLE `account` (
+ `user_id` integer NOT NULL,
+ `type` text NOT NULL,
+ `provider` text NOT NULL,
+ `provider_account_id` text NOT NULL,
+ `refresh_token` text,
+ `access_token` text,
+ `expires_at` integer,
+ `token_type` text,
+ `scope` text,
+ `id_token` text,
+ `session_state` text,
+ PRIMARY KEY(`provider`, `provider_account_id`),
+ FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `session` (
+ `session_token` text PRIMARY KEY NOT NULL,
+ `user_id` integer NOT NULL,
+ `expires` integer NOT NULL,
+ FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `verification_token` (
+ `identifier` text NOT NULL,
+ `token` text NOT NULL,
+ `expires` integer NOT NULL,
+ PRIMARY KEY(`identifier`, `token`)
+);
+--> statement-breakpoint
+ALTER TABLE user ADD `name` text;--> statement-breakpoint
+ALTER TABLE user ADD `emailVerified` integer;
\ No newline at end of file
diff --git a/packages/db/drizzle/meta/0028_snapshot.json b/packages/db/drizzle/meta/0028_snapshot.json
new file mode 100644
index 000000000..1a6ef53bd
--- /dev/null
+++ b/packages/db/drizzle/meta/0028_snapshot.json
@@ -0,0 +1,1875 @@
+{
+ "version": "5",
+ "dialect": "sqlite",
+ "id": "715da58c-9c0f-42fe-920a-46f8c03c92ba",
+ "prevId": "4488e03b-52ea-45eb-aac9-7d263c8f2e43",
+ "tables": {
+ "status_report_to_monitors": {
+ "name": "status_report_to_monitors",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status_report_id": {
+ "name": "status_report_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "status_report_to_monitors_monitor_id_monitor_id_fk": {
+ "name": "status_report_to_monitors_monitor_id_monitor_id_fk",
+ "tableFrom": "status_report_to_monitors",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "status_report_to_monitors_status_report_id_status_report_id_fk": {
+ "name": "status_report_to_monitors_status_report_id_status_report_id_fk",
+ "tableFrom": "status_report_to_monitors",
+ "tableTo": "status_report",
+ "columnsFrom": [
+ "status_report_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "status_report_to_monitors_monitor_id_status_report_id_pk": {
+ "columns": [
+ "monitor_id",
+ "status_report_id"
+ ],
+ "name": "status_report_to_monitors_monitor_id_status_report_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "status_reports_to_pages": {
+ "name": "status_reports_to_pages",
+ "columns": {
+ "page_id": {
+ "name": "page_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status_report_id": {
+ "name": "status_report_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "status_reports_to_pages_page_id_page_id_fk": {
+ "name": "status_reports_to_pages_page_id_page_id_fk",
+ "tableFrom": "status_reports_to_pages",
+ "tableTo": "page",
+ "columnsFrom": [
+ "page_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "status_reports_to_pages_status_report_id_status_report_id_fk": {
+ "name": "status_reports_to_pages_status_report_id_status_report_id_fk",
+ "tableFrom": "status_reports_to_pages",
+ "tableTo": "status_report",
+ "columnsFrom": [
+ "status_report_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "status_reports_to_pages_page_id_status_report_id_pk": {
+ "columns": [
+ "page_id",
+ "status_report_id"
+ ],
+ "name": "status_reports_to_pages_page_id_status_report_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "status_report": {
+ "name": "status_report",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "status_report_workspace_id_workspace_id_fk": {
+ "name": "status_report_workspace_id_workspace_id_fk",
+ "tableFrom": "status_report",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "status_report_update": {
+ "name": "status_report_update",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text(4)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "date": {
+ "name": "date",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status_report_id": {
+ "name": "status_report_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "status_report_update_status_report_id_status_report_id_fk": {
+ "name": "status_report_update_status_report_id_status_report_id_fk",
+ "tableFrom": "status_report_update",
+ "tableTo": "status_report",
+ "columnsFrom": [
+ "status_report_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "integration": {
+ "name": "integration",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "credential": {
+ "name": "credential",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "external_id": {
+ "name": "external_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "integration_workspace_id_workspace_id_fk": {
+ "name": "integration_workspace_id_workspace_id_fk",
+ "tableFrom": "integration",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "page": {
+ "name": "page",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "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
+ },
+ "published": {
+ "name": "published",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "password_protected": {
+ "name": "password_protected",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {
+ "page_slug_unique": {
+ "name": "page_slug_unique",
+ "columns": [
+ "slug"
+ ],
+ "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": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "monitor": {
+ "name": "monitor",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "job_type": {
+ "name": "job_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'other'"
+ },
+ "periodicity": {
+ "name": "periodicity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'other'"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'active'"
+ },
+ "active": {
+ "name": "active",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "regions": {
+ "name": "regions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "url": {
+ "name": "url",
+ "type": "text(2048)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "headers": {
+ "name": "headers",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "method": {
+ "name": "method",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'GET'"
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "assertions": {
+ "name": "assertions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "public": {
+ "name": "public",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "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": {}
+ },
+ "monitors_to_pages": {
+ "name": "monitors_to_pages",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "page_id": {
+ "name": "page_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "monitors_to_pages_monitor_id_monitor_id_fk": {
+ "name": "monitors_to_pages_monitor_id_monitor_id_fk",
+ "tableFrom": "monitors_to_pages",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "monitors_to_pages_page_id_page_id_fk": {
+ "name": "monitors_to_pages_page_id_page_id_fk",
+ "tableFrom": "monitors_to_pages",
+ "tableTo": "page",
+ "columnsFrom": [
+ "page_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "monitors_to_pages_monitor_id_page_id_pk": {
+ "columns": [
+ "monitor_id",
+ "page_id"
+ ],
+ "name": "monitors_to_pages_monitor_id_page_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "account": {
+ "name": "account",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider": {
+ "name": "provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "token_type": {
+ "name": "token_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "session_state": {
+ "name": "session_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "account_user_id_user_id_fk": {
+ "name": "account_user_id_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "account_provider_provider_account_id_pk": {
+ "columns": [
+ "provider",
+ "provider_account_id"
+ ],
+ "name": "account_provider_provider_account_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "session": {
+ "name": "session",
+ "columns": {
+ "session_token": {
+ "name": "session_token",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires": {
+ "name": "expires",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_user_id_user_id_fk": {
+ "name": "session_user_id_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "user": {
+ "name": "user",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "tenant_id": {
+ "name": "tenant_id",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "first_name": {
+ "name": "first_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "last_name": {
+ "name": "last_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "photo_url": {
+ "name": "photo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "emailVerified": {
+ "name": "emailVerified",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "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
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "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"
+ ],
+ "name": "users_to_workspaces_user_id_workspace_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "verification_token": {
+ "name": "verification_token",
+ "columns": {
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires": {
+ "name": "expires",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "verification_token_identifier_token_pk": {
+ "columns": [
+ "identifier",
+ "token"
+ ],
+ "name": "verification_token_identifier_token_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "page_subscriber": {
+ "name": "page_subscriber",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "page_id": {
+ "name": "page_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "page_subscriber_page_id_page_id_fk": {
+ "name": "page_subscriber_page_id_page_id_fk",
+ "tableFrom": "page_subscriber",
+ "tableTo": "page",
+ "columnsFrom": [
+ "page_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "workspace": {
+ "name": "workspace",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "stripe_id": {
+ "name": "stripe_id",
+ "type": "text(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "subscription_id": {
+ "name": "subscription_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "plan": {
+ "name": "plan",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "ends_at": {
+ "name": "ends_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "paid_until": {
+ "name": "paid_until",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "dsn": {
+ "name": "dsn",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "workspace_slug_unique": {
+ "name": "workspace_slug_unique",
+ "columns": [
+ "slug"
+ ],
+ "isUnique": true
+ },
+ "workspace_stripe_id_unique": {
+ "name": "workspace_stripe_id_unique",
+ "columns": [
+ "stripe_id"
+ ],
+ "isUnique": true
+ },
+ "workspace_id_dsn_unique": {
+ "name": "workspace_id_dsn_unique",
+ "columns": [
+ "id",
+ "dsn"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "notification": {
+ "name": "notification",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "provider": {
+ "name": "provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'{}'"
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_workspace_id_workspace_id_fk": {
+ "name": "notification_workspace_id_workspace_id_fk",
+ "tableFrom": "notification",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "notifications_to_monitors": {
+ "name": "notifications_to_monitors",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "notification_id": {
+ "name": "notification_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notifications_to_monitors_monitor_id_monitor_id_fk": {
+ "name": "notifications_to_monitors_monitor_id_monitor_id_fk",
+ "tableFrom": "notifications_to_monitors",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "notifications_to_monitors_notification_id_notification_id_fk": {
+ "name": "notifications_to_monitors_notification_id_notification_id_fk",
+ "tableFrom": "notifications_to_monitors",
+ "tableTo": "notification",
+ "columnsFrom": [
+ "notification_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "notifications_to_monitors_monitor_id_notification_id_pk": {
+ "columns": [
+ "monitor_id",
+ "notification_id"
+ ],
+ "name": "notifications_to_monitors_monitor_id_notification_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "monitor_status": {
+ "name": "monitor_status",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "region": {
+ "name": "region",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'active'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {
+ "monitor_status_idx": {
+ "name": "monitor_status_idx",
+ "columns": [
+ "monitor_id",
+ "region"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "monitor_status_monitor_id_monitor_id_fk": {
+ "name": "monitor_status_monitor_id_monitor_id_fk",
+ "tableFrom": "monitor_status",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "monitor_status_monitor_id_region_pk": {
+ "columns": [
+ "monitor_id",
+ "region"
+ ],
+ "name": "monitor_status_monitor_id_region_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ },
+ "invitation": {
+ "name": "invitation",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'member'"
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "incident": {
+ "name": "incident",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'triage'"
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "acknowledged_at": {
+ "name": "acknowledged_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "acknowledged_by": {
+ "name": "acknowledged_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "resolved_by": {
+ "name": "resolved_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "incident_screenshot_url": {
+ "name": "incident_screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "recovery_screenshot_url": {
+ "name": "recovery_screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "auto_resolved": {
+ "name": "auto_resolved",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {
+ "incident_monitor_id_started_at_unique": {
+ "name": "incident_monitor_id_started_at_unique",
+ "columns": [
+ "monitor_id",
+ "started_at"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "incident_monitor_id_monitor_id_fk": {
+ "name": "incident_monitor_id_monitor_id_fk",
+ "tableFrom": "incident",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set default",
+ "onUpdate": "no action"
+ },
+ "incident_workspace_id_workspace_id_fk": {
+ "name": "incident_workspace_id_workspace_id_fk",
+ "tableFrom": "incident",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "incident_acknowledged_by_user_id_fk": {
+ "name": "incident_acknowledged_by_user_id_fk",
+ "tableFrom": "incident",
+ "tableTo": "user",
+ "columnsFrom": [
+ "acknowledged_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "incident_resolved_by_user_id_fk": {
+ "name": "incident_resolved_by_user_id_fk",
+ "tableFrom": "incident",
+ "tableTo": "user",
+ "columnsFrom": [
+ "resolved_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "monitor_tag": {
+ "name": "monitor_tag",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "monitor_tag_workspace_id_workspace_id_fk": {
+ "name": "monitor_tag_workspace_id_workspace_id_fk",
+ "tableFrom": "monitor_tag",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
+ "monitor_tag_to_monitor": {
+ "name": "monitor_tag_to_monitor",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "monitor_tag_id": {
+ "name": "monitor_tag_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "(strftime('%s', 'now'))"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "monitor_tag_to_monitor_monitor_id_monitor_id_fk": {
+ "name": "monitor_tag_to_monitor_monitor_id_monitor_id_fk",
+ "tableFrom": "monitor_tag_to_monitor",
+ "tableTo": "monitor",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk": {
+ "name": "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk",
+ "tableFrom": "monitor_tag_to_monitor",
+ "tableTo": "monitor_tag",
+ "columnsFrom": [
+ "monitor_tag_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk": {
+ "columns": [
+ "monitor_id",
+ "monitor_tag_id"
+ ],
+ "name": "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk"
+ }
+ },
+ "uniqueConstraints": {}
+ }
+ },
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ }
+}
\ No newline at end of file
diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json
index a08d6a8df..67e16a9fb 100644
--- a/packages/db/drizzle/meta/_journal.json
+++ b/packages/db/drizzle/meta/_journal.json
@@ -197,6 +197,13 @@
"when": 1714586658374,
"tag": "0027_bizarre_bastion",
"breakpoints": true
+ },
+ {
+ "idx": 28,
+ "version": "5",
+ "when": 1715173356076,
+ "tag": "0028_thin_power_pack",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/packages/db/package.json b/packages/db/package.json
index e3e14e17f..fe8f59b42 100644
--- a/packages/db/package.json
+++ b/packages/db/package.json
@@ -28,6 +28,7 @@
"bufferutil": "4.0.7",
"drizzle-kit": "0.20.17",
"encoding": "0.1.13",
+ "next-auth": "5.0.0-beta.17",
"typescript": "5.4.5",
"utf-8-validate": "6.0.3"
},
diff --git a/packages/db/src/db.ts b/packages/db/src/db.ts
index 344c317a4..3d4e1dade 100644
--- a/packages/db/src/db.ts
+++ b/packages/db/src/db.ts
@@ -1,4 +1,4 @@
-import { createClient } from "@libsql/client/http";
+import { createClient } from "@libsql/client";
import { drizzle } from "drizzle-orm/libsql";
import { env } from "../env.mjs";
diff --git a/packages/db/src/schema/users/user.ts b/packages/db/src/schema/users/user.ts
index 3a0e3dc39..6732a081c 100644
--- a/packages/db/src/schema/users/user.ts
+++ b/packages/db/src/schema/users/user.ts
@@ -5,18 +5,24 @@ import {
sqliteTable,
text,
} from "drizzle-orm/sqlite-core";
+import type { AdapterAccount } from "next-auth/adapters";
import { workspace, workspaceRole } from "../workspaces";
export const user = sqliteTable("user", {
id: integer("id").primaryKey(),
- tenantId: text("tenant_id", { length: 256 }).unique(), // the clerk User Id
+ // clerk fields
+ tenantId: text("tenant_id", { length: 256 }).unique(), // the clerk User Id
firstName: text("first_name").default(""),
lastName: text("last_name").default(""),
- email: text("email").default(""),
photoUrl: text("photo_url").default(""),
+ // next-auth fields
+ name: text("name"),
+ email: text("email").default(""),
+ emailVerified: integer("emailVerified", { mode: "timestamp_ms" }),
+
createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(strftime('%s', 'now'))`,
),
@@ -61,3 +67,49 @@ export const usersToWorkspaceRelations = relations(
}),
}),
);
+
+// NEXT AUTH TABLES
+
+export const account = sqliteTable(
+ "account",
+ {
+ userId: integer("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ type: text("type").$type<AdapterAccount["type"]>().notNull(),
+ provider: text("provider").notNull(),
+ providerAccountId: text("provider_account_id").notNull(),
+ refresh_token: text("refresh_token"),
+ access_token: text("access_token"),
+ expires_at: integer("expires_at"),
+ token_type: text("token_type"),
+ scope: text("scope"),
+ id_token: text("id_token"),
+ session_state: text("session_state"),
+ },
+ (account) => ({
+ compoundKey: primaryKey({
+ columns: [account.provider, account.providerAccountId],
+ }),
+ }),
+);
+
+export const session = sqliteTable("session", {
+ sessionToken: text("session_token").primaryKey(),
+ userId: integer("user_id")
+ .notNull()
+ .references(() => user.id, { onDelete: "cascade" }),
+ expires: integer("expires", { mode: "timestamp_ms" }).notNull(),
+});
+
+export const verificationToken = sqliteTable(
+ "verification_token",
+ {
+ identifier: text("identifier").notNull(),
+ token: text("token").notNull(),
+ expires: integer("expires", { mode: "timestamp_ms" }).notNull(),
+ },
+ (vt) => ({
+ compoundKey: primaryKey({ columns: [vt.identifier, vt.token] }),
+ }),
+);
diff --git a/packages/notifications/discord/package.json b/packages/notifications/discord/package.json
index 26ed94131..f3501a093 100644
--- a/packages/notifications/discord/package.json
+++ b/packages/notifications/discord/package.json
@@ -10,7 +10,7 @@
"@types/node": "20.8.0",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
- "next": "14.2.1",
+ "next": "14.2.3",
"typescript": "5.4.5"
}
}
diff --git a/packages/notifications/email/package.json b/packages/notifications/email/package.json
index 6ed464852..e9206c273 100644
--- a/packages/notifications/email/package.json
+++ b/packages/notifications/email/package.json
@@ -18,7 +18,7 @@
"@types/node": "20.8.0",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
- "next": "14.2.1",
+ "next": "14.2.3",
"typescript": "5.4.5"
}
}
diff --git a/packages/notifications/slack/package.json b/packages/notifications/slack/package.json
index aaa9ac175..c464e6b82 100644
--- a/packages/notifications/slack/package.json
+++ b/packages/notifications/slack/package.json
@@ -10,7 +10,7 @@
"@types/node": "20.8.0",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
- "next": "14.2.1",
+ "next": "14.2.3",
"typescript": "5.4.5"
}
}
diff --git a/packages/notifications/twillio-sms/package.json b/packages/notifications/twillio-sms/package.json
index 96729241b..fbea4fbb6 100644
--- a/packages/notifications/twillio-sms/package.json
+++ b/packages/notifications/twillio-sms/package.json
@@ -14,7 +14,7 @@
"@types/node": "20.8.0",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
- "next": "14.2.1",
+ "next": "14.2.3",
"typescript": "5.4.5"
}
}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 663fc1f8d..5bda1aba7 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -30,7 +30,7 @@
"@radix-ui/react-hover-card": "1.0.7",
"@radix-ui/react-label": "2.0.2",
"@radix-ui/react-popover": "1.0.7",
- "@radix-ui/react-progress": "^1.0.3",
+ "@radix-ui/react-progress": "1.0.3",
"@radix-ui/react-radio-group": "1.1.3",
"@radix-ui/react-select": "2.0.0",
"@radix-ui/react-separator": "1.0.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2fe7f11bf..37f802375 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -44,7 +44,7 @@ importers:
specifier: 0.2.1
detect-browser:
- specifier: ^5.3.0
+ specifier: 5.3.0
version: 5.3.0
hono:
specifier: 4.1.4
@@ -227,9 +227,12 @@ importers:
apps/web:
dependencies:
- '@clerk/nextjs':
- specifier: 4.29.9
+ '@auth/core':
+ specifier: 0.30.0
+ version: 0.30.0
+ '@auth/drizzle-adapter':
+ specifier: 1.0.1
+ version: 1.0.1
'@google-cloud/tasks':
specifier: 5.0.0
version: 5.0.0([email protected])
@@ -239,6 +242,9 @@ importers:
'@hookform/resolvers':
specifier: 3.3.1
+ '@libsql/client':
+ specifier: 0.6.0
'@openstatus/analytics':
specifier: workspace:*
version: link:../../packages/analytics
@@ -256,7 +262,7 @@ importers:
version: link:../../packages/emails
'@openstatus/next-monitoring':
specifier: 0.0.2
'@openstatus/notification-discord':
specifier: workspace:*
version: link:../../packages/notifications/discord
@@ -295,7 +301,7 @@ importers:
version: 7.100.1
'@sentry/nextjs':
specifier: 7.100.1
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -319,7 +325,7 @@ importers:
version: 10.45.1(@trpc/[email protected])
'@trpc/next':
specifier: 10.45.1
'@trpc/react-query':
specifier: 10.45.1
@@ -372,17 +378,23 @@ importers:
specifier: 5.0.1
version: 5.0.1
next:
- specifier: 14.2.1
+ specifier: 14.2.3
+ next-auth:
+ specifier: 5.0.0-beta.17
next-contentlayer:
specifier: 0.3.4
next-plausible:
specifier: 3.12.0
next-themes:
specifier: 0.2.1
+ random-word-slugs:
+ specifier: 0.1.7
+ version: 0.1.7
react:
specifier: 18.2.0
version: 18.2.0
@@ -417,7 +429,7 @@ importers:
specifier: 1.1.0
version: 1.1.0
rss:
- specifier: ^1.2.2
+ specifier: 1.2.2
version: 1.2.2
shiki:
specifier: 0.14.4
@@ -463,7 +475,7 @@ importers:
specifier: 18.2.21
version: 18.2.21
'@types/rss':
- specifier: ^0.0.32
+ specifier: 0.0.32
version: 0.0.32
autoprefixer:
specifier: 10.4.16
@@ -493,8 +505,8 @@ importers:
packages/analytics:
dependencies:
'@jitsu/js':
- specifier: 1.3.0
- version: 1.3.0(@types/[email protected])
+ specifier: 1.9.2
+ version: 1.9.2(@types/[email protected])
'@t3-oss/env-core':
specifier: 0.7.0
@@ -514,9 +526,6 @@ importers:
packages/api:
dependencies:
- '@clerk/nextjs':
- specifier: 4.29.9
'@openstatus/analytics':
specifier: workspace:*
version: link:../analytics
@@ -551,8 +560,8 @@ importers:
specifier: 5.0.0-beta.1
version: 5.0.0-beta.1
next:
- specifier: 14.2.1
+ specifier: 14.2.3
random-word-slugs:
specifier: 0.1.7
version: 0.1.7
@@ -603,8 +612,8 @@ importers:
specifier: 6.7.3
eslint-config-next:
- specifier: 14.2.1
+ specifier: 14.2.3
eslint-config-prettier:
specifier: 9.0.0
version: 9.0.0([email protected])
@@ -670,6 +679,9 @@ importers:
encoding:
specifier: 0.1.13
version: 0.1.13
+ next-auth:
+ specifier: 5.0.0-beta.17
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -742,8 +754,8 @@ importers:
specifier: 18.2.21
version: 18.2.21
next:
- specifier: 14.2.1
+ specifier: 14.2.3
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -788,8 +800,8 @@ importers:
specifier: 18.2.21
version: 18.2.21
next:
- specifier: 14.2.1
+ specifier: 14.2.3
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -813,8 +825,8 @@ importers:
specifier: 18.2.21
version: 18.2.21
next:
- specifier: 14.2.1
+ specifier: 14.2.3
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -850,8 +862,8 @@ importers:
specifier: 18.2.21
version: 18.2.21
next:
- specifier: 14.2.1
+ specifier: 14.2.3
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -992,7 +1004,7 @@ importers:
specifier: 1.0.7
'@radix-ui/react-progress':
- specifier: ^1.0.3
+ specifier: 1.0.3
'@radix-ui/react-radio-group':
specifier: 1.1.3
@@ -1038,7 +1050,7 @@ importers:
version: 3.3.0
next-themes:
specifier: 0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -1160,6 +1172,23 @@ packages:
peerDependencies:
zod: ^3.20.2
+ resolution: {integrity: sha512-8AE4m/nk+4EIiVCJwxZAsJeAQuzpEC8M8768mmKVn60CGDdupKQkVhxbRlm5Qh7eNRCoFFME+0DvtaX2aXrYaA==}
+ peerDependencies:
+ '@simplewebauthn/browser': ^9.0.1
+ '@simplewebauthn/server': ^9.0.2
+ nodemailer: ^6.8.0
+ peerDependenciesMeta:
+ '@simplewebauthn/browser':
+ optional: true
+ '@simplewebauthn/server':
+ optional: true
+ nodemailer:
+ optional: true
+
+ resolution: {integrity: sha512-E4np2F48p930q+YeQ5ipZPv/L+9gmQcB7g6NQQyux2wtanRNOXNW4TG8wMjSRfTzccNq161YZ8Fm5le/5snkGQ==}
+
'@aws-crypto/[email protected]':
resolution: {integrity: sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==}
@@ -1490,40 +1519,6 @@ packages:
'@chronark/[email protected]':
resolution: {integrity: sha512-hE8kCGLJK5ncH8F7uPaqPiOOqo68vUI66nusg7HO5X9BcyN8lXfeQliu6Ou1kOSq95OYshf9nB2fk2+LEvF4ng==}
- '@clerk/[email protected]':
- resolution: {integrity: sha512-k14WRljVNETpIYrt99MBP/Zd7KEwkudQKSCEMatQbiRkWgrpwDWE8Czv+JzF1J7sdMiicBI+p2ph9biX1EOFzw==}
- engines: {node: '>=14'}
-
- '@clerk/[email protected]':
- resolution: {integrity: sha512-+6Q1hVteqn66gFLiCKSqqSdz2MBjsEjs1fkGLAEKZC1GdfOKrH6oWcLuSwUdyqRvJWuyjeIgwq15zoHtXKyztA==}
- engines: {node: '>=14'}
- peerDependencies:
- react: '>=16'
-
- '@clerk/[email protected]':
- resolution: {integrity: sha512-6CiRx61SW0B7i+4STlID537LvwFJvNGWxxQZY96OPHQnvYGYsp+9PdEyY4zaQiyLQBLYJt1+uc7VsdSYY5Omww==}
- engines: {node: '>=14'}
-
- '@clerk/[email protected]':
- resolution: {integrity: sha512-RsOz+lxlPYJi9cBvhBRqAUVUOMBT20R3ppt3eof97DkqCT6YaHJx/S13XcYUuo6ojYRDDJ/nI6XiLcfpqIJO6g==}
- engines: {node: '>=14'}
- peerDependencies:
- next: '>=10'
- react: ^17.0.2 || ^18.0.0-0
- react-dom: ^17.0.2 || ^18.0.0-0
-
- '@clerk/[email protected]':
- resolution: {integrity: sha512-Eein8cK72dlvY6Q1uFuw9K9MJH1OPjU8FzWloMTKklBo+iPiM6+uENGeGwlY5KId3q/kgPwRc2hBQnUoaijxCQ==}
- peerDependencies:
- react: '>=16'
- peerDependenciesMeta:
- react:
- optional: true
-
- '@clerk/[email protected]':
- resolution: {integrity: sha512-RmQhWB7EMZw2nE24viQG79VyEUULZYWndYew5oXiZx06DyvysMNCorDyEGRmgBbprv7bnbYhHdOtKmx8Wj0jug==}
- engines: {node: '>=14'}
-
'@clickhouse/[email protected]':
resolution: {integrity: sha512-LcfJfyMglUTbGuDN/s6e/R3LwtbQXpv6juIJID+tVXxcGzPijhDB+XXQpqbprunqnm48vHmLfCB6/68Pgp5qvg==}
@@ -2394,8 +2389,8 @@ packages:
resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- '@jitsu/[email protected]':
- resolution: {integrity: sha512-7k3dM84xqf6Ivaama8VWwGYOcmGI/WWQTUHmHNXao+M/tneU6L72SCNlUE587vgtaxvoN2oROo4sBGO+sTh4ZQ==}
+ '@jitsu/[email protected]':
+ resolution: {integrity: sha512-IFwVJczP/c9Lp5BFQZP5ebHgepbr5N1A+bE5m/CG1Sjekcr/oHuVtw1hjZFHJBa3eK6Gbn0Ax8Ih0LSPZkxiUg==}
'@jridgewell/[email protected]':
resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
@@ -2506,62 +2501,62 @@ packages:
'@neon-rs/[email protected]':
resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==}
- resolution: {integrity: sha512-qsHJle3GU3CmVx7pUoXcghX4sRN+vINkbLdH611T8ZlsP//grzqVW87BSUgOZeSAD4q7ZdZicdwNe/20U2janA==}
+ resolution: {integrity: sha512-W7fd7IbkfmeeY2gXrzJYDx8D2lWKbVoTIj1o1ScPHNzvp30s1AuoEFSdr39bC5sjxJaxTtq3OTCZboNp0lNWHA==}
- resolution: {integrity: sha512-Fp+mthEBjkn8r9qd6o4JgxKp0IDEzW0VYHD8ZC05xS5/lFNwHKuOdr2kVhWG7BQCO9L6eeepshM1Wbs2T+LgSg==}
+ resolution: {integrity: sha512-L3oDricIIjgj1AVnRdRor21gI7mShlSwU/1ZGHmqM3LzHhXXhdkrfeNY5zif25Bi5Dd7fiJHsbhoZCHfXYvlAw==}
- resolution: {integrity: sha512-kGjnjcIJehEcd3rT/3NAATJQndAEELk0J9GmGMXHSC75TMnvpOhONcjNHbjtcWE5HUQnIHy5JVkatrnYm1QhVw==}
+ resolution: {integrity: sha512-3pEYo/RaGqPP0YzwnlmPN2puaF2WMLM3apt5jLW2fFdXD9+pqcoTzRk+iZsf8ta7+quAe4Q6Ms0nR0SFGFdS1A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
- resolution: {integrity: sha512-dAdWndgdQi7BK2WSXrx4lae7mYcOYjbHJUhvOUnJjMNYrmYhxbbvJ2xElZpxNxdfA6zkqagIB9He2tQk+l16ew==}
+ resolution: {integrity: sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
- resolution: {integrity: sha512-2ZctfnyFOGvTkoD6L+DtQtO3BfFz4CapoHnyLTXkOxbZkVRgg3TQBUjTD/xKrO1QWeydeo8AWfZRg8539qNKrg==}
+ resolution: {integrity: sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- resolution: {integrity: sha512-jazZXctiaanemy4r+TPIpFP36t1mMwWCKMsmrTRVChRqE6putyAxZA4PDujx0SnfvZHosjdkx9xIq9BzBB5tWg==}
+ resolution: {integrity: sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- resolution: {integrity: sha512-VjCHWCjsAzQAAo8lkBOLEIkBZFdfW+Z18qcQ056kL4KpUYc8o59JhLDCBlhg+hINQRgzQ2UPGma2AURGOH0+Qg==}
+ resolution: {integrity: sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- resolution: {integrity: sha512-7HZKYKvAp4nAHiHIbY04finRqjeYvkITOGOurP1aLMexIFG/1+oCnqhGogBdc4lao/lkMW1c+AkwWSzSlLasqw==}
+ resolution: {integrity: sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- resolution: {integrity: sha512-YGHklaJ/Cj/F0Xd8jxgj2p8po4JTCi6H7Z3Yics3xJhm9CPIqtl8erlpK1CLv+HInDqEWfXilqatF8YsLxxA2Q==}
+ resolution: {integrity: sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
- resolution: {integrity: sha512-o+ISKOlvU/L43ZhtAAfCjwIfcwuZstiHVXq/BDsZwGqQE0h/81td95MPHliWCnFoikzWcYqh+hz54ZB2FIT8RA==}
+ resolution: {integrity: sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
- resolution: {integrity: sha512-GmRoTiLcvCLifujlisknv4zu9/C4i9r0ktsA8E51EMqJL4bD4CpO7lDYr7SrUxCR0tS4RVcrqKmCak24T0ohaw==}
+ resolution: {integrity: sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
@@ -2735,16 +2730,8 @@ packages:
resolution: {integrity: sha512-LMGqfSZkaMQXqewO0o1wvWr/2fQdCh4a3Sqlxka/UsJCe0cfLulh6x2aqnKLnsrSGiCq5rSCwvINd152i0nCqw==}
engines: {node: '>=14'}
- '@peculiar/[email protected]':
- resolution: {integrity: sha512-ULB1XqHKx1WBU/tTFIA+uARuRoBVZ4pNdOA878RDrRbBfBGcSzi5HBkdScC6ZbHn8z7L8gmKCgPC1LHRrP46tA==}
-
- '@peculiar/[email protected]':
- resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==}
- engines: {node: '>=8.0.0'}
-
- '@peculiar/[email protected]':
- resolution: {integrity: sha512-eK4C6WTNYxoI7JOabMoZICiyqRRtJB220bh0Mbj5RwRycleZf9BPyZoxsTvpP0FpmVS2aS13NKOuh5/tN3sIRw==}
- engines: {node: '>=10.12.0'}
+ '@panva/[email protected]':
+ resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==}
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
@@ -3978,17 +3965,11 @@ packages:
resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-N7UDG0/xiPQa2D/XrVJXjkWbpqHCd2sBaB32ggRF2l83RhPfamgKGF8gwwqyksS95qUS5ZYF9aF+lLPRlwI2UA==}
-
resolution: {integrity: sha512-2in/lrHRNmDvHPgyormtEralhPcN3An1gLjJzj2Bw145VBxkQ75JEXW6CTdMAwShiHQcYsl2d10IjQSdJSJz4g==}
- '@types/[email protected]':
- resolution: {integrity: sha512-zBUSRqkfZ59OcwXon4HVxhx5oWCJmc0OtBTK05M+p0dYjgN6iTwIL2T/WbsQZrEsdnwaF9cWQ+azOnpPvIqY3Q==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
resolution: {integrity: sha512-mZowFN3p64ajCJJ4riVYlOjNlBJv3hctgAY01pjw3qTnJePD8s9DZmYDzhHKvzfCYvdjwylkU38+Vdt7Cu2FDA==}
@@ -4032,12 +4013,6 @@ packages:
resolution: {integrity: sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==}
-
resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
@@ -4047,9 +4022,6 @@ packages:
resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-pP0P/9BnCj1OVvQR2lF41EkDG/lWWnDyA203b/4Fmi2eTyORnBtcDoKDwjWQthELrBvWkMOrvSOnZ8OVlW6tXA==}
-
resolution: {integrity: sha512-rjaYQ9b9y/VFGOpqBEXRavc3jh0a+e6evAbI31tMda8VlPaSy0AZJfXsvmIe3wklc7W6C3zCSfleuMXR7NOyXw==}
@@ -4074,9 +4046,6 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-/tjWYD8StMrINelsrHNmpXceo9s3/Y22AzePH1qCvXIgmz/aQp2YFFr6HqhNQVIOdcvaVyp5GS+yjHGuF7Rwsg==}
-
resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==}
@@ -4089,12 +4058,6 @@ packages:
resolution: {integrity: sha512-OKMdj17y8Cs+k1r0XFyp59ChSOwf8ODGtMQ4mnpfz5eFDk1aO41yN3pSKGuvVzmWAkFp37seubY1tzOVpwfWwg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-1Gjee59G25MrQGk8bsNvC6fxNiRgUlGn2wlhGf95a59DrprnnHk80FIMMFG9XHMdrfsuA119ht06QPDXA1Z7tw==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-i8MBln35l856k5iOhKk2XJ4SeAWg75mLIpZB4v6imOagKL6twsukBZGDMNhdOVk7yRFTMPpfILocMos59Q1otQ==}
-
resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
@@ -4104,15 +4067,9 @@ packages:
resolution: {integrity: sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==}
-
resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==}
-
resolution: {integrity: sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==}
@@ -4125,12 +4082,6 @@ packages:
resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==}
- '@types/[email protected]':
- resolution: {integrity: sha512-wYLxw35euwqGvTDx6zfY1vokBFnsK0HNrzc6xNHchxfO2hpuRg74GbkEW7e3sSmPvj0TjCDT1VCa6OtHXnubsg==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-+0autS93xyXizIYiyL02FCY8N+KkKPhILhcUSA276HxzreZ16kl+cmwvV2qAM/PuCCwPXzOXOWhiPcw20uSFcA==}
-
resolution: {integrity: sha512-gnvBA/21SA4xxqNXEwNiVcP0xSGHh/gi1VhWv9Bl46a0ItbTT5nFY+G9VSQpaG/8N/qdJpJ+vftQ4zflTtnjLw==}
@@ -4152,12 +4103,6 @@ packages:
resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-/7fKxvKUoETxjFUsuFlPB9YndePpxxRAOfGC/yJdc9kTjTeP5kRCTzfnE8kPUKCeyiyIZu0YQ76s50hCedI1ug==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-aqqNfs1XTF0HDrFdlY//+SGUxmdSUbjeRXb5iaZc3x0/vMbYmdw9qvOgHWOyyLFxSSRnUuP5+724zBgfw8/WAw==}
-
resolution: {integrity: sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==}
@@ -4437,10 +4382,6 @@ packages:
resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==}
- resolution: {integrity: sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==}
- engines: {node: '>=12.0.0'}
-
resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==}
@@ -4609,9 +4550,6 @@ packages:
resolution: {integrity: sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==}
- resolution: {integrity: sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==}
-
resolution: {integrity: sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==}
@@ -4809,6 +4747,10 @@ packages:
resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==}
engines: {node: '>= 0.6'}
+ resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==}
+ engines: {node: '>= 0.6'}
+
resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==}
engines: {node: '>=12.13'}
@@ -4844,9 +4786,6 @@ packages:
resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
-
resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
@@ -4969,10 +4908,6 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
- resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==}
- engines: {node: '>=0.10.0'}
-
resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
engines: {node: '>=0.10.0'}
@@ -5091,9 +5026,6 @@ packages:
resolution: {integrity: sha512-HnM6ZlFqcajLsyudHq7LeeLDr2rFAVYtDv/hV5qchQEidSck8j9OPUsXY9KwJv/lHMtYlX4DjRQqwFYa+0r8Ug==}
- resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
-
resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==}
engines: {node: '>=12'}
@@ -5410,8 +5342,8 @@ packages:
engines: {node: '>=6.0'}
hasBin: true
- resolution: {integrity: sha512-BgD0kPCWMlqoItRf3xe9fG0MqwObKfVch+f2ccwDpZiCJA8ghkz2wrASH+bI6nLZzGcOJOpMm1v1Q1euhfpt4Q==}
+ resolution: {integrity: sha512-ZkNztm3Q7hjqvB1rRlOX8P9E/cXRL9ajRcs8jufEtwMfTVYRqnmtnaSu57QqHyBlovMuiB8LEzfLBkh5RYV6Fg==}
peerDependencies:
eslint: ^7.23.0 || ^8.0.0
typescript: '>=3.3.1'
@@ -5678,10 +5610,6 @@ packages:
resolution: {integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==}
engines: {node: '>= 0.12'}
- resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
@@ -6368,6 +6296,9 @@ packages:
resolution: {integrity: sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==}
+ resolution: {integrity: sha512-6ScbIk2WWCeXkmzF6bRPmEuaqy1m8SbsRFMa/FLrSCkGIhj8OLVG/IH+XHVmNMx/KUo8cVWEE6oKR4dJ+S0Rkg==}
+
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
@@ -6380,10 +6311,6 @@ packages:
engines: {node: '>=12'}
hasBin: true
- resolution: {integrity: sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==}
- engines: {node: '>=12'}
-
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -6950,6 +6877,22 @@ packages:
resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==}
engines: {node: '>= 0.4.0'}
+ resolution: {integrity: sha512-XA/7JtAjOgDfAeotJPFUsFZGGItZwzZrxLt9Gc9fE7EchLk6zydZfuZ22Vvwixs3IilkN644D5IoD5tEOAFGCQ==}
+ peerDependencies:
+ '@simplewebauthn/browser': ^9.0.1
+ '@simplewebauthn/server': ^9.0.2
+ next: ^14
+ nodemailer: ^6.6.5
+ react: ^18.2.0
+ peerDependenciesMeta:
+ '@simplewebauthn/browser':
+ optional: true
+ '@simplewebauthn/server':
+ optional: true
+ nodemailer:
+ optional: true
+
resolution: {integrity: sha512-UtUCwgAl159KwfhNaOwyiI7Lg6sdioyKMeh+E7jxx0CJ29JuXGxBEYmCI6+72NxFGIFZKx8lvttbbQhbnYWYSw==}
peerDependencies:
@@ -6975,8 +6918,8 @@ packages:
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
- resolution: {integrity: sha512-SF3TJnKdH43PMkCcErLPv+x/DY1YCklslk3ZmwaVoyUfDgHKexuKlf9sEfBQ69w+ue8jQ3msLb+hSj1T19hGag==}
+ resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==}
engines: {node: '>=18.17.0'}
hasBin: true
peerDependencies:
@@ -7007,9 +6950,6 @@ packages:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
- resolution: {integrity: sha512-VzW+TAk2wE4X9maiKMlT+GsPU4OMmR1U9CrHSmd3DFLn2IcZ9VJ6M6BBugGfYUnPCLSYxXdZy17M0BEJyhUTwg==}
-
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
@@ -7064,6 +7004,9 @@ packages:
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
+ resolution: {integrity: sha512-DSoj8QoChzOCQlJkRmYxAJCIpnXFW32R0Uq7avyghIeB6iJq0XAblOD7pcq3mx4WEBDwMuKr0Y1qveCBleG2Xw==}
+
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
engines: {node: '>=0.10.0'}
@@ -7342,6 +7285,14 @@ packages:
resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==}
engines: {node: ^10 || ^12 || >=14}
+ resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==}
+ peerDependencies:
+ preact: '>=10'
+
+ resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==}
+
resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==}
engines: {node: '>=10'}
@@ -7412,6 +7363,9 @@ packages:
resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==}
+
resolution: {integrity: sha512-G9xUchgTEiNpormdYBl+Pha50gOUovT18IvAe7EYMZ1/f9W/WWMPRn+xI68yXNMUk3QXHDwo/1wV/4NejVNe1w==}
engines: {node: '>=0.10.0'}
@@ -7460,13 +7414,6 @@ packages:
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
engines: {node: '>=6'}
- resolution: {integrity: sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==}
-
- resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==}
- engines: {node: '>=6.0.0'}
-
resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==}
engines: {node: '>=0.6'}
@@ -7922,17 +7869,6 @@ packages:
resolution: {integrity: sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==}
- resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
-
- resolution: {integrity: sha512-CjU5pyRfwOtaOITYv5C8DzpZ8XA/ieRsDpr93HI2r6e3YInC6moZpSQbmUtg8cTk58tq2x3jcG2gv+p1IZGmMA==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-YTywJG93yxwHLgrYLZjlC75moVEX04LZM4FHfihjHe1FCXm+QaLOFfSf535aXOAd0ArVQMWUAe8ZPm4VtWyXaA==}
- engines: {node: '>=12'}
-
resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==}
engines: {node: '>= 14'}
@@ -8157,11 +8093,6 @@ packages:
resolution: {integrity: sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==}
- resolution: {integrity: sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==}
- peerDependencies:
- react: ^16.11.0 || ^17.0.0 || ^18.0.0
-
resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==}
peerDependencies:
@@ -8238,19 +8169,10 @@ packages:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
- resolution: {integrity: sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==}
-
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
- resolution: {integrity: sha512-joRpzBAk1Bhi2eGEYBjukEWHOe/IvclOkiJl3DtA91jV6NwQ3MwXA4FHYeqk8BNp/D8bmi9tcNbRu/SozP0jbQ==}
-
- resolution: {integrity: sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA==}
-
resolution: {integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==}
engines: {node: '>=0.6'}
@@ -8331,9 +8253,6 @@ packages:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
- resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==}
-
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
@@ -8433,10 +8352,6 @@ packages:
resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
- engines: {node: '>=12.20'}
-
resolution: {integrity: sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==}
engines: {node: '>=14.16'}
@@ -8691,9 +8606,6 @@ packages:
resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==}
engines: {node: '>= 8'}
- resolution: {integrity: sha512-7FjigXNsBfopEj+5DV2nhNpfic2vumtjjgPmeDKk45z+MJwXKKfhPB7118Pfzrmh4jqOMST6Ch37iPAHoImg5g==}
-
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
@@ -8922,6 +8834,24 @@ snapshots:
openapi3-ts: 4.1.2
zod: 3.22.4
+ dependencies:
+ '@panva/hkdf': 1.1.1
+ '@types/cookie': 0.6.0
+ cookie: 0.6.0
+ jose: 5.2.4
+ oauth4webapi: 2.10.4
+ preact: 10.11.3
+ preact-render-to-string: 5.2.3([email protected])
+
+ dependencies:
+ '@auth/core': 0.30.0
+ transitivePeerDependencies:
+ - '@simplewebauthn/browser'
+ - '@simplewebauthn/server'
+ - nodemailer
+
'@aws-crypto/[email protected]':
dependencies:
'@aws-crypto/util': 3.0.0
@@ -9618,66 +9548,6 @@ snapshots:
dependencies:
zod: 3.22.4
- dependencies:
- '@clerk/shared': 1.3.3([email protected])
- '@clerk/types': 3.62.1
- '@peculiar/webcrypto': 1.4.1
- '@types/node': 16.18.6
- cookie: 0.5.0
- deepmerge: 4.2.2
- node-fetch-native: 1.0.1
- snakecase-keys: 5.4.4
- tslib: 2.4.1
- transitivePeerDependencies:
- - react
-
- dependencies:
- '@clerk/shared': 1.3.3([email protected])
- '@clerk/types': 3.62.1
- react: 18.2.0
- tslib: 2.4.1
-
- dependencies:
- '@clerk/backend': 0.38.3([email protected])
- '@clerk/shared': 1.3.3([email protected])
- '@clerk/types': 3.62.1
- '@types/cookies': 0.7.7
- '@types/express': 4.17.14
- '@types/node-fetch': 2.6.2
- camelcase-keys: 6.2.2
- snakecase-keys: 3.2.1
- tslib: 2.4.1
- transitivePeerDependencies:
- - react
-
- dependencies:
- '@clerk/backend': 0.38.3([email protected])
- '@clerk/clerk-react': 4.30.7([email protected])
- '@clerk/clerk-sdk-node': 4.13.11([email protected])
- '@clerk/shared': 1.3.3([email protected])
- '@clerk/types': 3.62.1
- path-to-regexp: 6.2.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- tslib: 2.4.1
-
- dependencies:
- glob-to-regexp: 0.4.1
- js-cookie: 3.0.1
- swr: 2.2.0([email protected])
- optionalDependencies:
- react: 18.2.0
-
- '@clerk/[email protected]':
- dependencies:
- csstype: 3.1.1
-
'@clickhouse/[email protected]': {}
'@clickhouse/[email protected]': {}
@@ -10362,7 +10232,7 @@ snapshots:
'@types/yargs': 17.0.29
chalk: 4.1.2
dependencies:
analytics: 0.8.9(@types/[email protected])
transitivePeerDependencies:
@@ -10513,37 +10383,37 @@ snapshots:
'@neon-rs/[email protected]': {}
- '@next/[email protected]': {}
+ '@next/[email protected]': {}
dependencies:
glob: 10.3.10
optional: true
optional: true
optional: true
optional: true
optional: true
optional: true
optional: true
optional: true
optional: true
'@nodelib/[email protected]':
@@ -10641,9 +10511,9 @@ snapshots:
'@one-ini/[email protected]': {}
dependencies:
react: 18.2.0
'@opentelemetry/[email protected]':
@@ -10743,23 +10613,7 @@ snapshots:
'@opentelemetry/[email protected]': {}
- '@peculiar/[email protected]':
- dependencies:
- asn1js: 3.0.5
- pvtsutils: 1.3.5
- tslib: 2.6.2
-
- '@peculiar/[email protected]':
- dependencies:
- tslib: 2.6.2
-
- '@peculiar/[email protected]':
- dependencies:
- '@peculiar/asn1-schema': 2.3.8
- '@peculiar/json-schema': 1.1.12
- pvtsutils: 1.3.5
- tslib: 2.6.2
- webcrypto-core: 1.7.7
+ '@panva/[email protected]': {}
optional: true
@@ -11768,7 +11622,7 @@ snapshots:
localforage: 1.10.0
tslib: 2.6.2
dependencies:
'@rollup/plugin-commonjs': 24.0.0([email protected])
'@sentry/core': 7.100.1
@@ -11780,7 +11634,7 @@ snapshots:
'@sentry/vercel-edge': 7.100.1
'@sentry/webpack-plugin': 1.21.0([email protected])
chalk: 3.0.0
react: 18.2.0
resolve: 1.22.8
rollup: 2.78.0
@@ -12266,13 +12120,13 @@ snapshots:
dependencies:
'@trpc/server': 10.45.1
dependencies:
'@tanstack/react-query': 4.36.1([email protected]([email protected]))([email protected])
'@trpc/client': 10.45.1(@trpc/[email protected])
'@trpc/server': 10.45.1
react: 18.2.0
react-dom: 18.2.0([email protected])
@@ -12318,23 +12172,9 @@ snapshots:
dependencies:
'@types/estree': 1.0.3
- '@types/[email protected]':
- dependencies:
- '@types/connect': 3.4.37
- '@types/node': 20.8.0
-
'@types/[email protected]': {}
- '@types/[email protected]':
- dependencies:
- '@types/node': 20.8.0
-
- '@types/[email protected]':
- dependencies:
- '@types/connect': 3.4.37
- '@types/express': 4.17.14
- '@types/keygrip': 1.0.4
- '@types/node': 20.8.0
+ '@types/[email protected]': {}
'@types/[email protected]': {}
@@ -12377,20 +12217,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]':
- dependencies:
- '@types/node': 20.8.0
- '@types/qs': 6.9.9
- '@types/range-parser': 1.2.6
- '@types/send': 0.17.3
-
- '@types/[email protected]':
- dependencies:
- '@types/body-parser': 1.19.4
- '@types/express-serve-static-core': 4.17.39
- '@types/qs': 6.9.9
- '@types/serve-static': 1.15.4
-
dependencies:
'@types/minimatch': 5.1.2
@@ -12404,8 +12230,6 @@ snapshots:
dependencies:
'@types/unist': 2.0.9
- '@types/[email protected]': {}
-
dependencies:
'@types/through': 0.0.32
@@ -12433,8 +12257,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -12445,27 +12267,16 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
'@types/[email protected]': {}
'@types/[email protected]': {}
'@types/[email protected]': {}
- '@types/[email protected]':
- dependencies:
- '@types/node': 20.8.0
- form-data: 3.0.1
-
dependencies:
'@types/node': 20.8.0
- '@types/[email protected]': {}
-
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -12474,10 +12285,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
- '@types/[email protected]': {}
-
dependencies:
'@types/react': 18.2.64
@@ -12503,17 +12310,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]':
- dependencies:
- '@types/mime': 1.3.4
- '@types/node': 20.8.0
-
- '@types/[email protected]':
- dependencies:
- '@types/http-errors': 2.0.3
- '@types/mime': 3.0.3
- '@types/node': 20.8.0
-
'@types/[email protected]': {}
@@ -12848,12 +12644,6 @@ snapshots:
dependencies:
printable-characters: 1.0.42
- dependencies:
- pvtsutils: 1.3.5
- pvutils: 1.1.3
- tslib: 2.6.2
-
@@ -13014,8 +12804,6 @@ snapshots:
-
@@ -13233,6 +13021,8 @@ snapshots:
+
dependencies:
is-what: 4.1.15
@@ -13261,8 +13051,6 @@ snapshots:
dependencies:
cssom: 0.3.8
-
@@ -13361,8 +13149,6 @@ snapshots:
-
@@ -13484,11 +13270,6 @@ snapshots:
dependencies:
no-case: 2.3.2
- dependencies:
- no-case: 3.0.4
- tslib: 2.6.2
-
@@ -13832,9 +13613,9 @@ snapshots:
optionalDependencies:
source-map: 0.6.1
dependencies:
- '@next/eslint-plugin-next': 14.2.1
+ '@next/eslint-plugin-next': 14.2.3
'@rushstack/eslint-patch': 1.5.1
'@typescript-eslint/parser': 6.7.3([email protected])([email protected])
eslint: 8.50.0
@@ -14202,12 +13983,6 @@ snapshots:
combined-stream: 1.0.8
mime-types: 2.1.35
- dependencies:
- asynckit: 0.4.0
- combined-stream: 1.0.8
- mime-types: 2.1.35
-
dependencies:
asynckit: 0.4.0
@@ -15069,6 +14844,8 @@ snapshots:
+
@@ -15080,8 +14857,6 @@ snapshots:
glob: 8.1.0
nopt: 6.0.0
-
@@ -15939,12 +15714,18 @@ snapshots:
+ dependencies:
+ '@auth/core': 0.30.0
+ react: 18.2.0
+
dependencies:
'@contentlayer/core': 0.3.4([email protected])
'@contentlayer/utils': 0.3.4
contentlayer: 0.3.4([email protected])
react: 18.2.0
react-dom: 18.2.0([email protected])
transitivePeerDependencies:
@@ -15953,41 +15734,41 @@ snapshots:
- markdown-wasm
- supports-color
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
dependencies:
- '@next/env': 14.2.1
+ '@next/env': 14.2.3
'@swc/helpers': 0.5.5
busboy: 1.6.0
- caniuse-lite: 1.0.30001585
+ caniuse-lite: 1.0.30001612
graceful-fs: 4.2.11
postcss: 8.4.31
react: 18.2.0
react-dom: 18.2.0([email protected])
styled-jsx: 5.1.1(@babel/[email protected])([email protected])
optionalDependencies:
- '@next/swc-darwin-arm64': 14.2.1
- '@next/swc-darwin-x64': 14.2.1
- '@next/swc-linux-arm64-gnu': 14.2.1
- '@next/swc-linux-arm64-musl': 14.2.1
- '@next/swc-linux-x64-gnu': 14.2.1
- '@next/swc-linux-x64-musl': 14.2.1
- '@next/swc-win32-arm64-msvc': 14.2.1
- '@next/swc-win32-ia32-msvc': 14.2.1
- '@next/swc-win32-x64-msvc': 14.2.1
+ '@next/swc-darwin-arm64': 14.2.3
+ '@next/swc-darwin-x64': 14.2.3
+ '@next/swc-linux-arm64-gnu': 14.2.3
+ '@next/swc-linux-arm64-musl': 14.2.3
+ '@next/swc-linux-x64-gnu': 14.2.3
+ '@next/swc-linux-x64-musl': 14.2.3
+ '@next/swc-win32-arm64-msvc': 14.2.3
+ '@next/swc-win32-ia32-msvc': 14.2.3
+ '@next/swc-win32-x64-msvc': 14.2.3
'@opentelemetry/api': 1.4.1
transitivePeerDependencies:
- '@babel/core'
@@ -16008,8 +15789,6 @@ snapshots:
-
dependencies:
whatwg-url: 5.0.0
@@ -16065,6 +15844,8 @@ snapshots:
+
@@ -16374,6 +16155,13 @@ snapshots:
picocolors: 1.0.0
source-map-js: 1.0.2
+ dependencies:
+ preact: 10.11.3
+ pretty-format: 3.8.0
+
+
dependencies:
detect-libc: 2.0.2
@@ -16405,6 +16193,8 @@ snapshots:
ansi-styles: 5.2.0
react-is: 18.2.0
+
dependencies:
condense-newlines: 0.2.1
@@ -16470,12 +16260,6 @@ snapshots:
- dependencies:
- tslib: 2.6.2
-
-
dependencies:
side-channel: 1.0.4
@@ -17025,22 +16809,6 @@ snapshots:
dependencies:
no-case: 2.3.2
- dependencies:
- dot-case: 3.0.4
- tslib: 2.6.2
-
- dependencies:
- map-obj: 4.3.0
- to-snake-case: 1.0.0
-
- dependencies:
- map-obj: 4.3.0
- snake-case: 3.0.4
- type-fest: 2.19.0
-
dependencies:
agent-base: 7.1.0
@@ -17284,11 +17052,6 @@ snapshots:
lower-case: 1.1.4
upper-case: 1.1.3
- dependencies:
- react: 18.2.0
- use-sync-external-store: 1.2.0([email protected])
-
dependencies:
client-only: 0.0.1
@@ -17419,20 +17182,10 @@ snapshots:
-
dependencies:
is-number: 7.0.0
- dependencies:
- to-space-case: 1.0.0
-
- dependencies:
- to-no-case: 1.0.2
-
@@ -17523,8 +17276,6 @@ snapshots:
-
@@ -17611,8 +17362,6 @@ snapshots:
-
@@ -17920,14 +17669,6 @@ snapshots:
- dependencies:
- '@peculiar/asn1-schema': 2.3.8
- '@peculiar/json-schema': 1.1.12
- asn1js: 3.0.5
- pvtsutils: 1.3.5
- tslib: 2.6.2
-
diff --git a/turbo.json b/turbo.json
index 5848a37c6..799777d78 100644
--- a/turbo.json
+++ b/turbo.json
@@ -10,12 +10,6 @@
"!NEXT_PUBLIC_GIT_*",
"DATABASE_URL",
"TINY_BIRD_API_KEY",
- "CLERK_SECRET_KEY",
- "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY",
- "NEXT_PUBLIC_CLERK_SIGN_IN_URL",
- "NEXT_PUBLIC_CLERK_SIGN_UP_URL",
- "NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL",
- "NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL",
"NODE_ENV",
"VERCEL_URL"
],