diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66967908..3b404987 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: ["main"] pull_request: types: [opened, synchronize] @@ -14,6 +12,13 @@ jobs: env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ vars.TURBO_TEAM }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + POSTGRES_URL: ${{ secrets.POSTGRES_URL }} + NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} steps: - name: 🏗 Check out code @@ -34,8 +39,8 @@ jobs: - name: 👷 Install dependencies run: pnpm install - - name: 📀 Install Playwright Browsers - run: npx playwright install --with-deps + # - name: 📀 Install Playwright Browsers + # run: npx playwright install --with-deps - name: 💅 Lint run: pnpm lint diff --git a/.github/workflows/dev-db-migrate.yml b/.github/workflows/dev-db-migrate.yml new file mode 100644 index 00000000..c8f10224 --- /dev/null +++ b/.github/workflows/dev-db-migrate.yml @@ -0,0 +1,47 @@ +name: Run Development Database Migrations + +on: + push: + branches: ["dev"] + +jobs: + build: + name: Build and Run Migrations + timeout-minutes: 15 + runs-on: ubuntu-latest + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + DATABASE_URL: ${{ secrets.DEV_DATABASE_URL }} + POSTGRES_URL: ${{ secrets.POSTGRES_URL }} + NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} + + steps: + - name: 🏗 Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.2 + + - name: 🏗 Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + + - name: 👷 Install dependencies + run: pnpm install + + # - name: 📀 Install Playwright Browsers + # run: npx playwright install --with-deps + + - name: 🥾 Run db migrations + working-directory: "./packages/database" + run: pnpm db:migrate:run diff --git a/.github/workflows/prod-db-migrate.yml b/.github/workflows/prod-db-migrate.yml new file mode 100644 index 00000000..fcfc2f00 --- /dev/null +++ b/.github/workflows/prod-db-migrate.yml @@ -0,0 +1,44 @@ +name: Run Production Database Migrations + +on: + push: + branches: ["main"] + +jobs: + build: + name: Build and Run Migrations + timeout-minutes: 15 + runs-on: ubuntu-latest + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + POSTGRES_URL: ${{ secrets.POSTGRES_URL }} + NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} + + steps: + - name: 🏗 Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.2 + + - name: 🏗 Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + + - name: 👷 Install dependencies + run: pnpm install + + - name: 🥾 Run db migrations + working-directory: "./packages/database" + run: pnpm db:migrate:run diff --git a/README.md b/README.md index 4dff691b..021c9ca3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
- Friend from Artificial Unintelligence + Friend from Artificial Unintelligence
diff --git a/apps/client/next-auth.d.ts b/apps/client/next-auth.d.ts new file mode 100644 index 00000000..ef79b49e --- /dev/null +++ b/apps/client/next-auth.d.ts @@ -0,0 +1,21 @@ +import "next-auth"; + +declare module "next-auth" { + interface User { + id: string; + name: string | null; + nickname: string; + email: string | null; + emailVerified: Date | null; + image: string | null; + createdAt: Date; + } + + /** + * Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context + */ + interface Session { + user: User; + expires: string; + } +} diff --git a/apps/client/next.config.js b/apps/client/next.config.js index 47f1558e..501732d6 100644 --- a/apps/client/next.config.js +++ b/apps/client/next.config.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires const { withSentryConfig } = require("@sentry/nextjs"); /** @type {import('next').NextConfig} */ @@ -19,6 +20,9 @@ const nextConfig = { { hostname: "api.dicebear.com", }, + { + hostname: "lh3.googleusercontent.com", + }, ], }, }; diff --git a/apps/client/package.json b/apps/client/package.json index 694d951d..ee9ea32f 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,5 +1,5 @@ { - "name": "game-ai", + "name": "client", "version": "0.1.0", "private": true, "scripts": { @@ -7,41 +7,45 @@ "build": "next build", "start": "next start", "lint": "next lint", - "test": "playwright test" + "test:e2e": "playwright test" }, "dependencies": { - "@sentry/nextjs": "^7.65.0", - "@tanstack/react-query": "^4.33.0", - "@upstash/ratelimit": "^0.4.3", + "@auth/drizzle-adapter": "^0.3.2", + "@sentry/nextjs": "^7.68.0", + "@tanstack/react-query": "^4.35.0", + "@upstash/ratelimit": "^0.4.4", "@vercel/analytics": "^1.0.2", "@vercel/kv": "^0.2.2", "@xstate/react": "^3.2.2", "autoprefixer": "10.4.15", "clsx": "^2.0.0", - "framer-motion": "^10.16.1", + "database": "workspace:*", + "drizzle-orm": "^0.28.6", + "framer-motion": "^10.16.4", "next": "^13.4.19", - "openai": "^4.3.1", + "next-auth": "^4.23.1", + "openai": "^4.6.0", "postcss": "8.4.29", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", - "react-icons": "^4.10.1", + "react-icons": "^4.11.0", "sharp": "^0.32.5", "socket.io-client": "^4.7.2", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.3.3", "typescript": "5.2.2", - "xstate": "^4.38.2", - "zustand": "^4.4.1" + "xstate": "^4.38.2" }, "devDependencies": { "@playwright/test": "^1.37.1", - "@tailwindcss/typography": "^0.5.9", - "@types/node": "^20.5.7", + "@tailwindcss/forms": "^0.5.6", + "@tailwindcss/typography": "^0.5.10", + "@types/node": "^20.6.0", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "eslint-config-custom": "workspace:*", - "prettier-plugin-tailwindcss": "^0.5.3", + "prettier-plugin-tailwindcss": "^0.5.4", "tsconfig": "workspace:*" }, "engines": { diff --git a/apps/client/src/app/api/generate/route.ts b/apps/client/src/app/api/generate/route.ts index cdf078c9..0540c252 100644 --- a/apps/client/src/app/api/generate/route.ts +++ b/apps/client/src/app/api/generate/route.ts @@ -1,41 +1,20 @@ +import { getServerSession } from "next-auth"; import { NextResponse } from "next/server"; import OpenAI from "openai"; -import { kv } from "@vercel/kv"; -import { Ratelimit } from "@upstash/ratelimit"; -export const runtime = "edge"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY ?? "", }); export async function POST(req: Request) { - if (process.env.KV_REST_API_URL && process.env.KV_REST_API_TOKEN) { - const ip = req.headers.get("x-forwarded-for"); - const ratelimit = new Ratelimit({ - redis: kv, - // rate limit to 5 requests per 10 seconds - limiter: Ratelimit.slidingWindow(5, "10s"), - }); - - const { success, limit, reset, remaining } = await ratelimit.limit( - `ratelimit_${ip}`, - ); + const session = await getServerSession(authOptions(req)); - if (!success) { - return new Response("You have reached your request limit for the day.", { - status: 429, - headers: { - "X-RateLimit-Limit": limit.toString(), - "X-RateLimit-Remaining": remaining.toString(), - "X-RateLimit-Reset": reset.toString(), - }, - }); - } - } else { - console.log( - "KV_REST_API_URL and KV_REST_API_TOKEN env vars not found, not rate limiting...", - ); + if (!session) { + return new Response("Unauthorized", { + status: 401, + }); } const body = await req.json(); @@ -57,7 +36,7 @@ export async function POST(req: Request) { const images = await openai.images.generate({ prompt, n: 2, - size: "1024x1024", + size: "512x512", }); return NextResponse.json({ result: images.data }); diff --git a/apps/client/src/app/api/host/route.ts b/apps/client/src/app/api/host/route.ts new file mode 100644 index 00000000..23c88f0b --- /dev/null +++ b/apps/client/src/app/api/host/route.ts @@ -0,0 +1,32 @@ +import { getServerSession } from "next-auth"; +import { cookies } from "next/headers"; +import { redirect } from "next/navigation"; + +import { existingHost } from "@ai/app/server-actions"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; + +export async function GET(req: Request) { + const session = await getServerSession(authOptions(req)); + + const sessionToken = cookies().get("next-auth.session-token"); + + if (!session || !sessionToken) { + redirect("/"); + } + + const searchParams = new URL(req.url).searchParams; + + const nickname = searchParams.get("nickname"); + + if (!nickname) { + redirect("/"); + } + + const roomForExistingUser = await existingHost({ + userId: session.user.id, + nickname, + sessionToken: sessionToken.value, + }); + + redirect(`/room/${roomForExistingUser.room.code}`); +} diff --git a/apps/client/src/app/api/join/route.ts b/apps/client/src/app/api/join/route.ts new file mode 100644 index 00000000..d312d843 --- /dev/null +++ b/apps/client/src/app/api/join/route.ts @@ -0,0 +1,34 @@ +import { redirect } from "next/navigation"; +import { getServerSession } from "next-auth"; +import { cookies } from "next/headers"; + +import { joinRoom } from "@ai/app/server-actions"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; + +export async function GET(req: Request) { + const session = await getServerSession(authOptions(req)); + + const sessionToken = cookies().get("next-auth.session-token"); + + if (!session || !sessionToken) { + redirect("/"); + } + + const searchParams = new URL(req.url).searchParams; + + const nickname = searchParams.get("nickname"); + const roomCode = searchParams.get("code"); + + if (!roomCode || !nickname) { + redirect("/"); + } + + await joinRoom({ + userId: session.user.id, + nickname, + code: roomCode, + sessionToken: sessionToken.value, + }); + + redirect(`/room/${roomCode}`); +} diff --git a/apps/client/src/app/api/replicate/route.ts b/apps/client/src/app/api/replicate/route.ts index bf8b876b..bf80ab57 100644 --- a/apps/client/src/app/api/replicate/route.ts +++ b/apps/client/src/app/api/replicate/route.ts @@ -1,36 +1,15 @@ -import { Ratelimit } from "@upstash/ratelimit"; -import { kv } from "@vercel/kv"; +import { getServerSession } from "next-auth"; import { NextResponse } from "next/server"; -export const runtime = "edge"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; export async function POST(req: Request) { - if (process.env.KV_REST_API_URL && process.env.KV_REST_API_TOKEN) { - const ip = req.headers.get("x-forwarded-for"); - const ratelimit = new Ratelimit({ - redis: kv, - // rate limit to 5 requests per 10 seconds - limiter: Ratelimit.slidingWindow(5, "10s"), - }); - - const { success, limit, reset, remaining } = await ratelimit.limit( - `ratelimit_${ip}`, - ); + const session = await getServerSession(authOptions(req)); - if (!success) { - return new Response("You have reached your request limit for the day.", { - status: 429, - headers: { - "X-RateLimit-Limit": limit.toString(), - "X-RateLimit-Remaining": remaining.toString(), - "X-RateLimit-Reset": reset.toString(), - }, - }); - } - } else { - console.log( - "KV_REST_API_URL and KV_REST_API_TOKEN env vars not found, not rate limiting...", - ); + if (!session) { + return new Response("Unauthorized", { + status: 401, + }); } const body = await req.json(); @@ -55,10 +34,10 @@ export async function POST(req: Request) { // Pinned to a specific version of Stable Diffusion // See https://replicate.com/stability-ai/sdxl version: - "2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2", + "8beff3369e81422112d93b89ca01426147de542cd4684c244b673b105188fe5f", // This is the text prompt that will be submitted by a form on the frontend - input: { prompt, num_outputs: 2 }, + input: { prompt, num_outputs: 2, width: 768, height: 768 }, }), }, ); diff --git a/apps/client/src/app/error.tsx b/apps/client/src/app/error.tsx new file mode 100644 index 00000000..696e5f42 --- /dev/null +++ b/apps/client/src/app/error.tsx @@ -0,0 +1,19 @@ +"use client"; // Error components must be Client Components + +import { useEffect } from "react"; +import * as Sentry from "@sentry/nextjs"; + +import ErrorScreen from "@ai/components/error-screen"; + +export default function Error({ error }: { error: Error; reset: () => void }) { + useEffect(() => { + console.error(error); + Sentry.captureException(error); + }, [error]); + + return ( + + ); +} diff --git a/apps/client/src/app/invite/[code]/error.tsx b/apps/client/src/app/invite/[code]/error.tsx new file mode 100644 index 00000000..7ac2be3e --- /dev/null +++ b/apps/client/src/app/invite/[code]/error.tsx @@ -0,0 +1,22 @@ +"use client"; // Error components must be Client Components + +import { useEffect } from "react"; +import * as Sentry from "@sentry/nextjs"; +import { useParams } from "next/navigation"; + +import ErrorScreen from "@ai/components/error-screen"; + +export default function Error({ error }: { error: Error; reset: () => void }) { + const params = useParams(); + + useEffect(() => { + console.error(error); + Sentry.captureException(error); + }, [error]); + + return ( + + ); +} diff --git a/apps/client/src/app/invite/[code]/page.tsx b/apps/client/src/app/invite/[code]/page.tsx index dd67bfd3..7d5c2631 100644 --- a/apps/client/src/app/invite/[code]/page.tsx +++ b/apps/client/src/app/invite/[code]/page.tsx @@ -1,32 +1,35 @@ +import { getServerSession } from "next-auth"; + import { getRoomInfo } from "@ai/app/server-actions"; -import ErrorScreen from "@ai/components/error-screen"; import Footer from "@ai/components/footer"; import Friend from "@ai/components/game/friend"; -import NicknameForm from "@ai/components/nickname-form"; +import SignInForm from "@ai/components/sign-in-form"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; +import UserMenu from "@ai/components/user-menu"; export default async function Invite({ params }: { params: { code: string } }) { const roomInfo = await getRoomInfo(params.code); - if ("error" in roomInfo) { - return ( - - ); - } + const session = await getServerSession(authOptions()); return (
+ {session && ( +
+ +
+ )}

artificial
{" "} unintelligence

-
diff --git a/apps/client/src/app/layout.tsx b/apps/client/src/app/layout.tsx index 3487332c..9567b09b 100644 --- a/apps/client/src/app/layout.tsx +++ b/apps/client/src/app/layout.tsx @@ -3,6 +3,7 @@ import { Space_Mono } from "next/font/google"; import { Toaster } from "react-hot-toast"; import { Analytics } from "@vercel/analytics/react"; import "./globals.css"; +import AuthProvider from "@ai/components/auth-provider"; const spaceMono = Space_Mono({ subsets: ["latin"], @@ -31,7 +32,7 @@ export default function RootLayout({ className={`${spaceMono.variable} bg-slate-900 font-space text-white antialiased`} > - {children} + {children} diff --git a/apps/client/src/app/page.tsx b/apps/client/src/app/page.tsx index b1aacc91..cd7add15 100644 --- a/apps/client/src/app/page.tsx +++ b/apps/client/src/app/page.tsx @@ -1,17 +1,68 @@ +import { getServerSession } from "next-auth"; +import { Game, db, games, usersToGames, usersToRooms } from "database"; +import { isNull, and, eq, desc, sql, gt } from "drizzle-orm"; +import { FiLogIn } from "react-icons/fi"; + import Footer from "@ai/components/footer"; import Friend from "@ai/components/game/friend"; -import NicknameForm from "@ai/components/nickname-form"; +import SignInForm from "@ai/components/sign-in-form"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; +import { LinkSecondaryButton } from "@ai/components/button"; +import UserMenu from "@ai/components/user-menu"; + +export default async function Home() { + const session = await getServerSession(authOptions()); + + let runningGame: Game | null = null; + + if (session) { + const runningGameWithUserQuery = await db + .select({ + game: games, + playerCount: sql`count(${usersToRooms.userId})::int`, + }) + .from(games) + .innerJoin(usersToGames, eq(games.id, usersToGames.gameId)) + .innerJoin(usersToRooms, eq(games.roomCode, usersToRooms.roomCode)) + .where( + and( + isNull(games.completedAt), + eq(usersToGames.userId, session.user.id), + ), + ) + .orderBy(desc(games.createdAt)) + .groupBy(games.id) + .having(({ playerCount }) => gt(playerCount, 0)); + + if (runningGameWithUserQuery.length > 0) { + runningGame = runningGameWithUserQuery[0].game; + } + } -export default function Home() { return (
+ {session && ( +
+ +
+ )}
+ {runningGame && ( +
+ + Join Back Into {runningGame ? "Game" : "Room"} + +
+ )}

artificial
{" "} unintelligence

- +
diff --git a/apps/client/src/app/room/[code]/error.tsx b/apps/client/src/app/room/[code]/error.tsx new file mode 100644 index 00000000..eb7c3ae3 --- /dev/null +++ b/apps/client/src/app/room/[code]/error.tsx @@ -0,0 +1,22 @@ +"use client"; // Error components must be Client Components + +import { useEffect } from "react"; +import * as Sentry from "@sentry/nextjs"; +import { useParams } from "next/navigation"; + +import ErrorScreen from "@ai/components/error-screen"; + +export default function Error({ error }: { error: Error; reset: () => void }) { + const params = useParams(); + + useEffect(() => { + console.error(error); + Sentry.captureException(error); + }, [error]); + + return ( + + ); +} diff --git a/apps/client/src/app/room/[code]/game/[gameId]/error.tsx b/apps/client/src/app/room/[code]/game/[gameId]/error.tsx new file mode 100644 index 00000000..4feb5c69 --- /dev/null +++ b/apps/client/src/app/room/[code]/game/[gameId]/error.tsx @@ -0,0 +1,22 @@ +"use client"; // Error components must be Client Components + +import { useEffect } from "react"; +import * as Sentry from "@sentry/nextjs"; +import { useParams } from "next/navigation"; + +import ErrorScreen from "@ai/components/error-screen"; + +export default function Error({ error }: { error: Error; reset: () => void }) { + const params = useParams(); + + useEffect(() => { + console.error(error); + Sentry.captureException(error); + }, [error]); + + return ( + + ); +} diff --git a/apps/client/src/app/room/[code]/game/game.tsx b/apps/client/src/app/room/[code]/game/[gameId]/game.tsx similarity index 91% rename from apps/client/src/app/room/[code]/game/game.tsx rename to apps/client/src/app/room/[code]/game/[gameId]/game.tsx index db9a0c4f..db8140b7 100644 --- a/apps/client/src/app/room/[code]/game/game.tsx +++ b/apps/client/src/app/room/[code]/game/[gameId]/game.tsx @@ -19,35 +19,34 @@ import { getCurrentComponent, } from "@ai/components/game/game-machine"; import { SocketContext } from "@ai/utils/socket-provider"; -import { useStore } from "@ai/utils/store"; import { cn } from "@ai/utils/cn"; +import { Session } from "next-auth"; +import UserMenu from "@ai/components/user-menu"; // ! ----------> TYPES <---------- type GameProps = { gameInfo: GameInfo; + session: Session; }; // ! ----------> COMPONENTS <---------- -export default function Game({ gameInfo }: GameProps) { +export default function Game({ gameInfo, session }: GameProps) { // Socket for real-time communication const socket = useContext(SocketContext); // Next.js router const router = useRouter(); - // game id store state - const { setGameId } = useStore(); - // Wait until the client mounts to avoid hydration errors const [isMounted, setIsMounted] = useState(false); // Id of the user who is the current host of the game - const [hostId, setHostId] = useState(gameInfo.hostId); + const [hostId, setHostId] = useState(gameInfo.hostId); // Store players who have submitted their prompts for a round - const [submittedPlayerIds, setSubmittedPlayerIds] = useState>( + const [submittedPlayerIds, setSubmittedPlayerIds] = useState>( new Set(gameInfo.submittedPlayers), ); @@ -102,7 +101,7 @@ export default function Game({ gameInfo }: GameProps) { ); // Update which players have submitted their generations - const handleOnSubmittedPlayers = (players: number[]) => { + const handleOnSubmittedPlayers = (players: string[]) => { console.log("[HANDLE SUBMITTED PLAYERS]", players); setSubmittedPlayerIds(new Set(players)); }; @@ -154,11 +153,6 @@ export default function Game({ gameInfo }: GameProps) { handleStateChange(); }, [handleStateChange, state]); - // Set gameId state - useEffect(() => { - setGameId(gameId); - }, [gameId, setGameId]); - // Socket.io Effects useEffect(() => { socket.on("roomState", handleRoomState); @@ -187,6 +181,7 @@ export default function Game({ gameInfo }: GameProps) { currFaceOffQuestion, votedPlayers, leaderboard, + session, ); }, [ gameInfo, @@ -197,6 +192,7 @@ export default function Game({ gameInfo }: GameProps) { currFaceOffQuestion, votedPlayers, leaderboard, + session, ]); // Avoid hydration issues by ensuring app has mounted @@ -211,7 +207,10 @@ export default function Game({ gameInfo }: GameProps) { "flex min-h-[100dvh] flex-col justify-center", )} > -
+
+
+ +
{isMounted ? currentComponent : null} diff --git a/apps/client/src/app/room/[code]/game/[gameId]/page.tsx b/apps/client/src/app/room/[code]/game/[gameId]/page.tsx new file mode 100644 index 00000000..74cf8d5f --- /dev/null +++ b/apps/client/src/app/room/[code]/game/[gameId]/page.tsx @@ -0,0 +1,27 @@ +import { redirect } from "next/navigation"; +import { cookies } from "next/headers"; +import { getServerSession } from "next-auth"; + +import { getGameInfo } from "@ai/app/server-actions"; +import Game from "./game"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; + +export default async function GamePage({ + params, +}: { + params: { code: string; gameId: number }; +}) { + const session = await getServerSession(authOptions()); + + const sessionToken = cookies().get("next-auth.session-token"); + + if (!session || !sessionToken) { + redirect("/"); + } + + const gameInfo = await getGameInfo(params.gameId, sessionToken.value); + + console.log("[GAME INFO]", gameInfo); + + return ; +} diff --git a/apps/client/src/app/room/[code]/game/page.tsx b/apps/client/src/app/room/[code]/game/page.tsx deleted file mode 100644 index 52d32ea2..00000000 --- a/apps/client/src/app/room/[code]/game/page.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { getGameInfo } from "@ai/app/server-actions"; -import Game from "./game"; -import ErrorScreen from "@ai/components/error-screen"; - -export default async function GamePage({ - params, -}: { - params: { code: string }; -}) { - const gameInfo = await getGameInfo(params.code); - - console.log("[GAME INFO]", gameInfo); - - if ("error" in gameInfo) { - return ( - - ); - } - - return ; -} diff --git a/apps/client/src/app/room/[code]/lobby.tsx b/apps/client/src/app/room/[code]/lobby.tsx index 73bb353e..6c52cdbf 100644 --- a/apps/client/src/app/room/[code]/lobby.tsx +++ b/apps/client/src/app/room/[code]/lobby.tsx @@ -3,19 +3,26 @@ import { motion } from "framer-motion"; import { useCallback, useContext, useEffect, useState } from "react"; import { useRouter } from "next/navigation"; +import { Session } from "next-auth"; +import type { User } from "database"; import InviteLink from "./invite-link"; import UserCount from "@ai/components/user-count"; -import { RoomInfo, User } from "@ai/app/server-actions"; +import { RoomInfo } from "@ai/app/server-actions"; import UserList from "./user-list"; import StartGame from "./start-game"; -import { useStore } from "@ai/utils/store"; import { SocketContext } from "@ai/utils/socket-provider"; +import UserMenu from "@ai/components/user-menu"; -export default function Lobby({ roomInfo }: { roomInfo: RoomInfo }) { +export default function Lobby({ + roomInfo, + session, +}: { + roomInfo: RoomInfo; + session: Session; +}) { const router = useRouter(); - const { user } = useStore(); - const [hostId, setHostId] = useState(roomInfo.hostId); + const [hostId, setHostId] = useState(roomInfo.hostId); const [players, setPlayers] = useState(roomInfo.players); const [startGameLoading, setStartGameLoading] = useState(false); @@ -29,10 +36,13 @@ export default function Lobby({ roomInfo }: { roomInfo: RoomInfo }) { setPlayers(roomInfo.players); }; - const handleStartGame = useCallback(() => { - console.log("[RECEIVED START GAME]"); - router.push(`/room/${roomInfo.code}/game`); - }, [roomInfo.code, router]); + const handleStartGame = useCallback( + (gameId: number) => { + console.log("[RECEIVED START GAME]"); + router.push(`/room/${roomInfo.code}/game/${gameId}`); + }, + [roomInfo.code, router], + ); const initiateStartGame = () => { setStartGameLoading(true); @@ -44,7 +54,10 @@ export default function Lobby({ roomInfo }: { roomInfo: RoomInfo }) { }; useEffect(() => { - socket.emit("connectToRoom", roomInfo.code); + socket.emit("connectToRoom", { + userId: session.user.id, + code: roomInfo.code, + }); socket.on("roomState", handleRoomState); socket.on("startGame", handleStartGame); socket.on("error", handleError); @@ -54,7 +67,7 @@ export default function Lobby({ roomInfo }: { roomInfo: RoomInfo }) { socket.off("startGame", handleStartGame); socket.off("error", handleError); }; - }, [handleStartGame, roomInfo.code, socket, user?.id]); + }, [handleStartGame, roomInfo.code, socket, session]); return (
@@ -68,7 +81,10 @@ export default function Lobby({ roomInfo }: { roomInfo: RoomInfo }) {
- +
+ +
+
diff --git a/apps/client/src/app/room/[code]/page.tsx b/apps/client/src/app/room/[code]/page.tsx index a0d13634..df031104 100644 --- a/apps/client/src/app/room/[code]/page.tsx +++ b/apps/client/src/app/room/[code]/page.tsx @@ -1,24 +1,23 @@ +import { redirect } from "next/navigation"; +import { getServerSession } from "next-auth"; + import { getRoomInfo } from "@ai/app/server-actions"; import Lobby from "./lobby"; -import ErrorScreen from "@ai/components/error-screen"; import Footer from "@ai/components/footer"; +import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; export default async function Room({ params }: { params: { code: string } }) { - const roomInfo = await getRoomInfo(params.code); - - console.log("[ROOM INFO]", roomInfo); + const session = await getServerSession(authOptions()); - if ("error" in roomInfo) { - return ( - - ); + if (!session) { + redirect("/"); } + const roomInfo = await getRoomInfo(params.code); + return (
- +
); diff --git a/apps/client/src/app/room/[code]/start-game.tsx b/apps/client/src/app/room/[code]/start-game.tsx index ed7740e1..621197b4 100644 --- a/apps/client/src/app/room/[code]/start-game.tsx +++ b/apps/client/src/app/room/[code]/start-game.tsx @@ -3,12 +3,12 @@ import { useEffect, useState } from "react"; import toast from "react-hot-toast"; import { FiCheckSquare, FiPlusSquare, FiPlay } from "react-icons/fi"; +import { Session } from "next-auth"; +import type { User } from "database"; -import { User } from "@ai/app/server-actions"; import Button, { SecondaryButton } from "@ai/components/button"; import Ellipsis from "@ai/components/ellipsis"; import useLinkShare from "@ai/utils/hooks/use-link-share"; -import { useStore } from "@ai/utils/store"; const StartGame = ({ players, @@ -17,15 +17,16 @@ const StartGame = ({ onStartGame, loading, roomIsFull, + session, }: { players: User[]; code: string; - hostId: number | null; + hostId: string | null; onStartGame: () => void; loading: boolean; roomIsFull: boolean; + session: Session; }) => { - const { user } = useStore(); const [isMounted, setIsMounted] = useState(false); const { copying, setCopying, onClick } = useLinkShare({ @@ -50,17 +51,20 @@ const StartGame = ({ return ( <>
- {isMounted && players.length > 2 && user && user.id == hostId && ( - - )} + {isMounted && + players.length > 2 && + session && + session.user.id == hostId && ( + + )} diff --git a/apps/client/src/app/room/[code]/user-list.tsx b/apps/client/src/app/room/[code]/user-list.tsx index 937ea44a..a07a67cd 100644 --- a/apps/client/src/app/room/[code]/user-list.tsx +++ b/apps/client/src/app/room/[code]/user-list.tsx @@ -2,14 +2,17 @@ import { AnimatePresence, motion } from "framer-motion"; -import { User } from "@ai/app/server-actions"; import UserCard from "@ai/components/user-card"; +import { Session } from "next-auth"; +import type { User } from "database"; const UserList = ({ + session, hostId, players, }: { - hostId: number | null; + session: Session; + hostId: string | null; players: User[]; }) => { return ( @@ -24,6 +27,7 @@ const UserList = ({ nickname={player.nickname} color={player.id === hostId ? "INDIGO" : "GRAY"} isHost={player.id === hostId} + isYou={player.id !== hostId && player.id === session.user.id} /> ))} diff --git a/apps/client/src/app/server-actions.ts b/apps/client/src/app/server-actions.ts index e1cb4729..f5471ad4 100644 --- a/apps/client/src/app/server-actions.ts +++ b/apps/client/src/app/server-actions.ts @@ -1,55 +1,23 @@ import { URL } from "@ai/utils/socket"; +import { Game, Generation, Question, Room, User, Vote } from "database"; -export type User = { - createdAt: string; - id: number; - nickname: string; -}; -export type Room = { - hostId: number | null; - code: string; - createdAt: string; -}; export type RoomInfo = { - hostId: number | null; + hostId: string | null; code: string; createdAt: string; players: User[]; }; -export type Game = { - id: number; - roomCode: string; - state: string; - round: number; - createdAt: string; - completedAt: string | null; -}; -export type Generation = { - id: number; - text: string; - imageUrl: string; - userId: number; - questionId: number; - gameId: number; - selected: boolean; - createdAt: string; -}; -export type Question = { + +export type GameQuestion = { id: number; text: string; createdAt: string; gameId: number; round: number; - player1: number; - player2: number; + player1: string; + player2: string; votedOn: boolean; }; -export type Vote = { - createdAt: string; - id: number; - userId: number; - generationId: number; -}; export type UserVote = { vote: Vote; user: User }; @@ -60,20 +28,20 @@ export type GameRoundGeneration = { text: string; round: number; gameId: number; - player1: number; - player2: number; + player1: string; + player2: string; createdAt: Date; }; user: User; }; export type GameInfo = { - hostId: number | null; + hostId: string | null; game: Game; players: User[]; - questions: Question[]; + questions: GameQuestion[]; gameRoundGenerations: GameRoundGeneration[]; - submittedPlayers: number[]; + submittedPlayers: string[]; votedPlayers: UserVote[]; }; @@ -85,8 +53,6 @@ export type QuestionGenerations = { player2Generation: Generation; }; -type ErrorResponse = { error: string }; - // ! ----------> USERS <---------- export type CreateHostResponse = { @@ -100,6 +66,7 @@ export async function createHost(nickname: string) { headers: { "Content-Type": "application/json", }, + credentials: "include", body: JSON.stringify({ nickname, }), @@ -118,13 +85,24 @@ export type ExistingHostResponse = { room: Room; }; -export async function existingHost(userId: number) { +export async function existingHost({ + userId, + nickname, + sessionToken, +}: { + userId: string; + nickname: string; + sessionToken: string; +}) { const response = await fetch(`${URL}/user/existingHost`, { method: "POST", headers: { + Authorization: `Bearer ${sessionToken}`, "Content-Type": "application/json", }, + credentials: "include", body: JSON.stringify({ + nickname, userId, }), }); @@ -144,13 +122,26 @@ export type JoinRoomResponse = { user: User; }; -export async function joinRoom(nickname: string, code: string) { +export async function joinRoom({ + userId, + nickname, + code, + sessionToken, +}: { + userId: string; + nickname: string; + code: string; + sessionToken: string; +}) { const response = await fetch(`${URL}/room/join`, { method: "POST", headers: { + Authorization: `Bearer ${sessionToken}`, "Content-Type": "application/json", }, + credentials: "include", body: JSON.stringify({ + userId, nickname, code, }), @@ -168,10 +159,13 @@ export async function joinRoom(nickname: string, code: string) { return data; } -export type GetRoomInfoResponse = RoomInfo | ErrorResponse; +export type GetRoomInfoResponse = RoomInfo; export async function getRoomInfo(code: string) { - const response = await fetch(`${URL}/room/${code}`, { cache: "no-store" }); + const response = await fetch(`${URL}/room/${code}`, { + cache: "no-store", + credentials: "include", + }); if (!response.ok) { throw new Error("Failed to obtain room info"); @@ -184,10 +178,16 @@ export async function getRoomInfo(code: string) { // ! ----------> GAMES <---------- -export type GetGameInfoResponse = GameInfo | ErrorResponse; +export type GetGameInfoResponse = GameInfo; -export async function getGameInfo(code: string) { - const response = await fetch(`${URL}/game/${code}`, { cache: "no-store" }); +export async function getGameInfo(gameId: number, sessionToken: string) { + const response = await fetch(`${URL}/game/${gameId}`, { + headers: { + Authorization: `Bearer ${sessionToken}`, + }, + cache: "no-store", + credentials: "include", + }); if (!response.ok) { throw new Error("Failed to obtain game info"); @@ -207,6 +207,7 @@ export type GetGameLeaderboardResponse = { export async function getLeaderboardById({ gameId }: { gameId: number }) { const response = await fetch(`${URL}/game/${gameId}/leaderboard`, { cache: "no-store", + credentials: "include", }); if (!response.ok) { @@ -228,7 +229,7 @@ export async function createGenerations({ questionId, images, }: { - userId: number; + userId: string; gameId: number; questionId: number; images: { text: string; imageUrl: string }[]; @@ -238,6 +239,7 @@ export async function createGenerations({ headers: { "Content-Type": "application/json", }, + credentials: "include", body: JSON.stringify({ userId, gameId, questionId, images }), }); @@ -261,7 +263,7 @@ export async function getFaceOffs({ }) { const response = await fetch( `${URL}/generations/gameId/${gameId}/round/${round}`, - { cache: "no-store" }, + { cache: "no-store", credentials: "include" }, ); if (!response.ok) { diff --git a/apps/client/src/components/auth-provider.tsx b/apps/client/src/components/auth-provider.tsx new file mode 100644 index 00000000..a2fd2067 --- /dev/null +++ b/apps/client/src/components/auth-provider.tsx @@ -0,0 +1,12 @@ +"use client"; + +import { SessionProvider } from "next-auth/react"; +import React from "react"; + +export default function AuthProvider({ + children, +}: { + children: React.ReactNode; +}) { + return {children}; +} diff --git a/apps/client/src/components/game/face-off-result-image.tsx b/apps/client/src/components/game/face-off-result-image.tsx index 86a333c7..b4f1c357 100644 --- a/apps/client/src/components/game/face-off-result-image.tsx +++ b/apps/client/src/components/game/face-off-result-image.tsx @@ -184,39 +184,42 @@ const FaceOffResultImage = ({ > +{animatedPoints} - - {votes.map((vote, i) => ( - -

{vote}

-
- ))} -
- {`OpenAI setShowImage(true)} - width={1024} - height={1024} - /> +
+ {`OpenAI setShowImage(true)} + width={1024} + height={1024} + /> + + {votes.map((vote, i) => ( + +

{vote}

+
+ ))} +
+
+
{ - const { user } = useStore(); +const FaceOff = ({ + gameInfo, + currQuestionGenerations, + session, +}: FaceOffProps) => { const socket = useContext(SocketContext); const [loading, setLoading] = useState(false); @@ -24,13 +28,13 @@ const FaceOff = ({ gameInfo, currQuestionGenerations }: FaceOffProps) => { const [voteSubmitted, setVoteSubmitted] = useState(false); const currUserInFaceOff = - user?.id === currQuestionGenerations?.player1.id || - user?.id === currQuestionGenerations?.player2.id; + session.user.id === currQuestionGenerations?.player1.id || + session.user.id === currQuestionGenerations?.player2.id; const onImageChoice = async () => { setLoading(true); - if (user && selectedImage && currQuestionGenerations) { + if (session.user && selectedImage && currQuestionGenerations) { socket.emit("voteSubmitted", { gameId: gameInfo.game.id, questionId: currQuestionGenerations.question.id, @@ -38,7 +42,7 @@ const FaceOff = ({ gameInfo, currQuestionGenerations }: FaceOffProps) => { selectedImage === 1 ? currQuestionGenerations.player1Generation.id : currQuestionGenerations.player2Generation.id, - userId: user.id, + userId: session.user.id, }); } @@ -48,7 +52,6 @@ const FaceOff = ({ gameInfo, currQuestionGenerations }: FaceOffProps) => { return (
- {/* */} {currQuestionGenerations && ( <>
@@ -77,7 +80,7 @@ const FaceOff = ({ gameInfo, currQuestionGenerations }: FaceOffProps) => {
{currUserInFaceOff || voteSubmitted ? ( <> -
+
{

) : ( -
+
How to Play @@ -112,4 +112,4 @@ const NicknameForm = ({ room, submitLabel, type }: NicknameFormProps) => { ); }; -export default NicknameForm; +export default SignInForm; diff --git a/apps/client/src/components/user-card.tsx b/apps/client/src/components/user-card.tsx index f70428dd..97e850c5 100644 --- a/apps/client/src/components/user-card.tsx +++ b/apps/client/src/components/user-card.tsx @@ -7,9 +7,10 @@ type UserCardProps = { nickname: string; color: "GRAY" | "INDIGO"; isHost?: boolean; + isYou?: boolean; }; -const UserCard = ({ nickname, color, isHost }: UserCardProps) => { +const UserCard = ({ nickname, color, isHost, isYou }: UserCardProps) => { return (
{ {nickname} {isHost && {"host"}} + {isYou && {"you"}}
); diff --git a/apps/client/src/components/user-menu.tsx b/apps/client/src/components/user-menu.tsx new file mode 100644 index 00000000..8d0776bf --- /dev/null +++ b/apps/client/src/components/user-menu.tsx @@ -0,0 +1,72 @@ +"use client"; + +import { Session } from "next-auth"; +import { signOut } from "next-auth/react"; +import { useContext, useRef, useState } from "react"; +import { AnimatePresence, motion } from "framer-motion"; + +import useClickAway from "@ai/utils/hooks/use-click-away"; +import { SocketContext } from "@ai/utils/socket-provider"; + +import { FiSettings, FiLogOut } from "react-icons/fi"; + +type UserMenuProps = { + session: Session; + roomCode?: string; +}; + +const UserMenu = ({ session, roomCode }: UserMenuProps) => { + const [showMenu, setShowMenu] = useState(false); + const socket = useContext(SocketContext); + + const userMenuRef = useRef(null); + useClickAway(userMenuRef, () => { + setShowMenu(false); + }); + + const handleSignOutAndLeave = () => { + if (roomCode) { + socket.emit("leaveRoom", { + userId: session.user.id, + code: roomCode, + }); + } + signOut(); + }; + + return ( +
+ + + {showMenu && ( + +
    +
  • + +
  • +
+
+ )} +
+
+ ); +}; + +export default UserMenu; diff --git a/apps/client/src/middleware.ts b/apps/client/src/middleware.ts new file mode 100644 index 00000000..7247ae49 --- /dev/null +++ b/apps/client/src/middleware.ts @@ -0,0 +1,29 @@ +import { NextRequest, NextResponse } from "next/server"; +import { Ratelimit } from "@upstash/ratelimit"; +import { kv } from "@vercel/kv"; + +const ratelimit = new Ratelimit({ + redis: kv, + // 5 requests from the same IP in 10 seconds + limiter: Ratelimit.slidingWindow(5, "10 s"), +}); + +export const config = { + matcher: ["/api/generate", "/api/host", "/api/join", "/api/replicate"], // all api routes except for auth routes +}; + +export default async function middleware(request: NextRequest) { + const ip = + request.ip ?? request.headers.get("x-forwarded-for") ?? "127.0.0.1"; + const { success, limit, remaining, reset } = await ratelimit.limit(ip); + return success + ? NextResponse.next() + : new Response("You have reached your request limit for the day.", { + status: 429, + headers: { + "X-RateLimit-Limit": limit.toString(), + "X-RateLimit-Remaining": remaining.toString(), + "X-RateLimit-Reset": reset.toString(), + }, + }); +} diff --git a/apps/client/src/pages/api/auth/[...nextauth].ts b/apps/client/src/pages/api/auth/[...nextauth].ts new file mode 100644 index 00000000..dc5faebe --- /dev/null +++ b/apps/client/src/pages/api/auth/[...nextauth].ts @@ -0,0 +1,61 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import NextAuth, { NextAuthOptions } from "next-auth"; +import GoogleProvider from "next-auth/providers/google"; +import { db } from "database"; +import { myDrizzleAdapter } from "@ai/components/my-drizzle-adapter"; + +export const authOptions = ( + req?: NextApiRequest | Request, +): NextAuthOptions => { + return { + adapter: myDrizzleAdapter(db), + providers: [ + GoogleProvider({ + clientId: process.env.GOOGLE_CLIENT_ID ?? "", + clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "", + profile(profile) { + const cookieNickname = + req && "cookies" in req && typeof req.cookies === "object" + ? typeof req.cookies["next-auth.callback-url"] === "string" + ? new URL( + req.cookies["next-auth.callback-url"], + ).searchParams.get("nickname") ?? "" + : "" + : ""; + + return { + id: profile.sub, + name: profile.name, + nickname: cookieNickname, + emailVerified: new Date(), + email: profile.email, + image: profile.picture, + createdAt: new Date(), + }; + }, + }), + ], + pages: { + signIn: "/auth", + // signOut: "/auth/signout", + // error: "/auth/error", // Error code passed in query string as ?error= + // verifyRequest: "/auth/verify-request", // (used for check email message) + // newUser: "/auth/new-user", // New users will be directed here on first sign in (leave the property out if not of interest) + }, + callbacks: { + async session({ session, user }) { + session.user = user; + return session; + }, + }, + events: { + createUser({ user }) { + console.log("CREATE USER", user); + }, + }, + }; +}; + +export default async function auth(req: NextApiRequest, res: NextApiResponse) { + return await NextAuth(req, res, authOptions(req)); +} diff --git a/apps/client/src/utils/hooks/use-click-away.ts b/apps/client/src/utils/hooks/use-click-away.ts new file mode 100644 index 00000000..deeb16f0 --- /dev/null +++ b/apps/client/src/utils/hooks/use-click-away.ts @@ -0,0 +1,30 @@ +import { RefObject, useEffect, useRef } from "react"; + +const defaultEvents = ["mousedown", "touchstart"]; + +const useClickAway = ( + ref: RefObject, + onClickAway: (event: E) => void, + events: string[] = defaultEvents, +) => { + const savedCallback = useRef(onClickAway); + useEffect(() => { + savedCallback.current = onClickAway; + }, [onClickAway]); + useEffect(() => { + const handler = (event: E) => { + const { current: el } = ref; + el && !el.contains(event.target as Node) && savedCallback.current(event); + }; + for (const eventName of events) { + document.addEventListener(eventName, handler); + } + return () => { + for (const eventName of events) { + document.removeEventListener(eventName, handler); + } + }; + }, [events, ref]); +}; + +export default useClickAway; diff --git a/apps/client/src/utils/socket-provider.tsx b/apps/client/src/utils/socket-provider.tsx index 917fb91f..35d82b58 100644 --- a/apps/client/src/utils/socket-provider.tsx +++ b/apps/client/src/utils/socket-provider.tsx @@ -4,7 +4,8 @@ import { createContext, useEffect } from "react"; import toast from "react-hot-toast"; import { socket } from "./socket"; -import { useStore } from "./store"; +import { useSession } from "next-auth/react"; +import { useParams } from "next/navigation"; export const SocketContext = createContext(socket); @@ -13,29 +14,43 @@ export default function SocketProvider({ }: { children: React.ReactNode; }) { - const { user, room, gameId } = useStore(); + const { data: session } = useSession(); + const params = useParams(); const socketMessage = (msg: string) => { console.log("Received socket message:", msg); toast(msg); }; - const socketError = (err: string) => { - console.error("Received socket error:", err); + const socketError = (error: string) => { + console.error("Received socket error:", error); toast.error("An Error Occurred"); }; + const socketConnectError = (error: Error) => { + console.error(error.message); + toast.error("Failed to connect to server, please try again later"); + }; + useEffect(() => { - socket.auth = { userId: user?.id, roomCode: room?.code, gameId }; - socket.connect(); + socket.auth = { + userId: session?.user?.id ?? "", + roomCode: params?.code ?? "", + gameId: params?.gameId ?? "", + }; + if (session?.user?.id) { + socket.connect(); + } + socket.on("connect_error", socketConnectError); socket.on("message", socketMessage); socket.on("error", socketError); return () => { + socket.off("connect_error", socketConnectError); socket.off("message", socketMessage); socket.off("error", socketError); socket.disconnect(); }; - }, [user?.id, room?.code, gameId]); + }, [params?.code, params?.gameId, session?.user?.id]); return ( {children} diff --git a/apps/client/src/utils/socket.ts b/apps/client/src/utils/socket.ts index a06be1ff..7c823e0b 100644 --- a/apps/client/src/utils/socket.ts +++ b/apps/client/src/utils/socket.ts @@ -7,16 +7,16 @@ import { gameMachine } from "@ai/components/game/game-machine"; export interface ServerToClientEvents { message: (str: string) => void; roomState: (roomInfo: RoomInfo) => void; - startGame: () => void; + startGame: (gameId: number) => void; playAnotherGame: () => void; serverEvent: (event: EventFrom) => void; - submittedPlayers: (players: number[]) => void; + submittedPlayers: (players: string[]) => void; votedPlayers: (votes: UserVote[]) => void; error: (str: string) => void; } export interface ClientToServerEvents { - connectToRoom: (code: string) => void; + connectToRoom: (data: { code: string; userId: string }) => void; initiateGame: (code: string) => void; clientEvent: (data: { state: string; @@ -32,12 +32,12 @@ export interface ClientToServerEvents { round: number; }) => void; voteSubmitted: (data: { - userId: number; + userId: string; generationId: number; gameId: number; questionId: number; }) => void; - leaveRoom: (code: string) => void; + leaveRoom: (data: { userId: string; code: string }) => void; } export const URL = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8080"; @@ -46,5 +46,6 @@ export const socket: Socket = io( URL, { autoConnect: false, + withCredentials: true, }, ); diff --git a/apps/client/src/utils/store-initializer.ts b/apps/client/src/utils/store-initializer.ts deleted file mode 100644 index 000807ac..00000000 --- a/apps/client/src/utils/store-initializer.ts +++ /dev/null @@ -1,23 +0,0 @@ -"use client"; - -import { useRef } from "react"; -import { StoreState, useStore } from "./store"; - -type StoreInitializerType = Partial< - Pick ->; - -const StoreInitializer = (props: StoreInitializerType) => { - const initialized = useRef(false); - - if (!initialized.current) { - useStore.setState((prevState) => { - return { ...prevState, ...props }; - }); - initialized.current = true; - } - - return null; -}; - -export default StoreInitializer; diff --git a/apps/client/src/utils/store.ts b/apps/client/src/utils/store.ts deleted file mode 100644 index 7538e466..00000000 --- a/apps/client/src/utils/store.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Room, User } from "@ai/app/server-actions"; -import { create } from "zustand"; -import { devtools, persist } from "zustand/middleware"; - -export type StoreState = { - user: User | null; - setUser: (user: User | null) => void; - room: Room | null; - setRoom: (room: Room) => void; - gameId: number | null; - setGameId: (gameId: number | null) => void; - players: User[]; - setPlayers: (players: User[]) => void; -}; - -export const useStore = create()( - devtools( - persist( - (set) => ({ - user: null, - setUser: (user) => set(() => ({ user: user })), - room: null, - setRoom: (room) => set(() => ({ room: room })), - gameId: null, - setGameId: (gameId) => set(() => ({ gameId: gameId })), - players: [], - setPlayers: (players) => set(() => ({ players: players })), - }), - { - name: "storage", - }, - ), - ), -); diff --git a/apps/client/tailwind.config.js b/apps/client/tailwind.config.js index 11f3dad6..dc7e511a 100644 --- a/apps/client/tailwind.config.js +++ b/apps/client/tailwind.config.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const { fontFamily } = require("tailwindcss/defaultTheme"); /** @type {import('tailwindcss').Config} */ @@ -46,5 +47,8 @@ module.exports = { }, }, }, - plugins: [require("@tailwindcss/typography")], + plugins: [ + require("@tailwindcss/forms")({ strategy: "class" }), + require("@tailwindcss/typography"), + ], }; diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index 9168562a..10a14b99 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -10,7 +10,8 @@ "@ai/*": [ "./src/*" ] - } + }, + "strictNullChecks": true }, "include": [ "next-env.d.ts", @@ -21,4 +22,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +} diff --git a/apps/server/package.json b/apps/server/package.json index b261493a..71662a38 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -14,23 +14,26 @@ "sentry:sourcemaps": "sentry-cli sourcemaps inject --org alexander-grattan --project artificial-unintelligence-server ./dist && sentry-cli sourcemaps upload --org alexander-grattan --project artificial-unintelligence-server ./dist" }, "dependencies": { - "@sentry/node": "^7.65.0", + "@sentry/node": "^7.68.0", + "cookie-parser": "^1.4.6", "cors": "^2.8.5", "database": "workspace:*", "dotenv": "^16.3.1", - "drizzle-orm": "^0.28.5", + "drizzle-orm": "^0.28.6", "express": "^4.18.2", + "express-rate-limit": "^6.11.0", "helmet": "^7.0.0", "morgan": "^1.10.0", "socket.io": "^4.7.2" }, "devDependencies": { "@jest/globals": "^29.6.4", - "@sentry/cli": "^2.20.5", - "@types/cors": "^2.8.13", + "@sentry/cli": "^2.20.7", + "@types/cookie-parser": "^1.4.4", + "@types/cors": "^2.8.14", "@types/express": "^4.17.17", "@types/morgan": "^1.9.5", - "@types/node": "^20.5.7", + "@types/node": "^20.6.0", "cross-env": "^7.0.3", "eslint-config-custom": "workspace:*", "jest": "^29.6.4", diff --git a/apps/server/src/controllers/game.controller.ts b/apps/server/src/controllers/game.controller.ts index 65f58cb3..a6ee9e3b 100644 --- a/apps/server/src/controllers/game.controller.ts +++ b/apps/server/src/controllers/game.controller.ts @@ -1,27 +1,33 @@ import type { NextFunction, Request, Response } from "express"; import { + getGameInfo, + getGamePageInfo, getLeaderboardById, - getPageGameInfoByRoomCode, } from "../services/game.service"; -export async function getPageGameInfoByRoomCodeController( - req: Request<{ code: string }>, +export async function getGameInfoController( + req: Request<{ id: string }>, res: Response, next: NextFunction ) { try { - const code = req.params.code; + const gameId = Number(req.params.id); - const gameInfo = await getPageGameInfoByRoomCode({ code }); + const initialGameInfo = await getGameInfo({ gameId }); - if (!gameInfo) { + if (!initialGameInfo) { res .status(404) - .send({ error: `Game with room code of ${code} was not found` }); + .send({ error: `Game with the id of ${gameId} was not found` }); return; } - res.status(200).send(gameInfo); + const gamePageInfo = await getGamePageInfo({ + game: initialGameInfo?.game, + players: initialGameInfo?.players, + }); + + res.status(200).send(gamePageInfo); } catch (error) { next(error); } diff --git a/apps/server/src/controllers/generation.controller.ts b/apps/server/src/controllers/generation.controller.ts index af9c2edc..9bb55431 100644 --- a/apps/server/src/controllers/generation.controller.ts +++ b/apps/server/src/controllers/generation.controller.ts @@ -3,7 +3,6 @@ import { createGeneration, getFaceOffGenerations, getGenerationCount, - getUserGenerationInfo, mapGenerationsByQuestion, } from "../services/generation.service"; @@ -12,9 +11,9 @@ export async function createGenerationsController( {}, {}, { - userId: number; - gameId: number; - questionId: number; + userId: string; + gameId: string; + questionId: string; images: { text: string; imageUrl: string }[]; } >, @@ -24,10 +23,13 @@ export async function createGenerationsController( try { const { userId, gameId, questionId, images } = req.body; + const gameIdToNum = Number.parseInt(gameId); + const questionIdToNum = Number.parseInt(questionId); + const generationCount = await getGenerationCount({ - gameId, + gameId: gameIdToNum, userId, - questionId, + questionId: questionIdToNum, }); if (generationCount >= 8) { @@ -38,8 +40,8 @@ export async function createGenerationsController( images.map((image) => createGeneration({ userId, - gameId, - questionId, + gameId: gameIdToNum, + questionId: questionIdToNum, text: image.text, imageUrl: image.imageUrl, }) @@ -82,36 +84,3 @@ export async function getFaceOffsController( next(error); } } - -export async function getUserGenerationInfoController( - req: Request<{ - gameId: string; - userId: string; - round: string; - }>, - res: Response, - next: NextFunction -) { - try { - const gameId = Number.parseInt(req.params.gameId); - const userId = Number.parseInt(req.params.userId); - const round = Number.parseInt(req.params.round); - - const generationInfo = await getUserGenerationInfo({ - gameId, - userId, - round, - }); - - if (!generationInfo) { - res.status(404).send({ - error: `Generation info with gameId of ${gameId}, round of ${round}, and userId of ${userId} were not found`, - }); - return; - } - - res.status(200).send(generationInfo); - } catch (error) { - next(error); - } -} diff --git a/apps/server/src/controllers/question.controller.ts b/apps/server/src/controllers/question.controller.ts deleted file mode 100644 index b04f0671..00000000 --- a/apps/server/src/controllers/question.controller.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { NextFunction, Request, Response } from "express"; -import { - getQuestionById, - getUserQuestionsForRound, -} from "../services/question.service"; - -export async function getQuestionByIdController( - req: Request<{ id: string }>, - res: Response, - next: NextFunction -) { - try { - const id = Number.parseInt(req.params.id); - - const question = await getQuestionById({ id }); - - if (!question) { - res - .status(404) - .send({ error: `Question with the id of ${id} was not found` }); - } - - res.status(200).send(question); - } catch (error) { - next(error); - } -} - -export async function getQuestionsByUserGameRoundController( - req: Request<{ userId: string; gameId: string; round: string }>, - res: Response, - next: NextFunction -) { - try { - const userId = Number.parseInt(req.params.userId); - const gameId = Number.parseInt(req.params.gameId); - const round = Number.parseInt(req.params.round); - - const questions = await getUserQuestionsForRound({ userId, gameId, round }); - - if (questions.length === 0) { - res.status(404).send({ - error: `Questions for the user: ${userId} could not be found for this game: ${gameId}, and round: ${round}`, - }); - return; - } - - res.status(200).send(questions); - } catch (error) { - next(error); - } -} diff --git a/apps/server/src/controllers/room.controller.ts b/apps/server/src/controllers/room.controller.ts index 41d40ca2..6c1ee979 100644 --- a/apps/server/src/controllers/room.controller.ts +++ b/apps/server/src/controllers/room.controller.ts @@ -1,6 +1,6 @@ import type { NextFunction, Request, Response } from "express"; import { getRoom, joinRoom } from "../services/room.service"; -import { createUser } from "../services/user.service"; +import { updateUserNickname } from "../services/user.service"; export async function getRoomController( req: Request<{ code: string }>, @@ -24,12 +24,12 @@ export async function getRoomController( } export async function joinRoomController( - req: Request<{}, {}, { nickname: string; code: string }>, + req: Request<{}, {}, { userId: string; nickname: string; code: string }>, res: Response, next: NextFunction ) { try { - const { nickname, code } = req.body; + const { userId, nickname, code } = req.body; const checkRoomExists = await getRoom({ code }); @@ -45,15 +45,20 @@ export async function joinRoomController( return; } - const createdUser = await createUser({ nickname }); - const addUserToRoom = await joinRoom({ - userId: createdUser.id, - code, + const updatedUser = await updateUserNickname({ + userId, + nickname, }); - console.log("[ADD USER TO ROOM]:", addUserToRoom); + if (!checkRoomExists.players.some((player) => player.id === userId)) { + const addUserToRoom = await joinRoom({ + userId: userId, + code, + }); + console.log("[ADD USER TO ROOM]:", addUserToRoom); + } - res.status(200).send({ user: createdUser }); + res.status(200).send({ user: updatedUser }); } catch (error) { next(error); } diff --git a/apps/server/src/controllers/user.controller.ts b/apps/server/src/controllers/user.controller.ts index 898568fa..a31f36cb 100644 --- a/apps/server/src/controllers/user.controller.ts +++ b/apps/server/src/controllers/user.controller.ts @@ -1,60 +1,25 @@ import type { NextFunction, Request, Response } from "express"; import { createRoom, joinRoom } from "../services/room.service"; -import { createUser } from "../services/user.service"; +import { updateUserNickname } from "../services/user.service"; -export async function createUserController( - req: Request<{}, {}, { nickname: string }>, - res: Response, - next: NextFunction -) { - try { - const body = req.body; - - const newUser = await createUser(body); - console.log("[CREATE USER]:", newUser); - - res.status(200).json({ user: newUser }); - } catch (error) { - next(error); - } -} - -export async function createHostController( - req: Request<{}, {}, { nickname: string }>, +export async function existingHostController( + req: Request<{}, {}, { userId: string; nickname: string }>, res: Response, next: NextFunction ) { try { - const body = req.body; - - const newUser = await createUser(body); + const { userId, nickname } = req.body; - const newRoom = await createRoom({ hostId: newUser.id }); + const newRoom = await createRoom({ hostId: userId }); - await joinRoom({ - userId: newUser.id, - code: newRoom.code, + await updateUserNickname({ + userId, + nickname, }); - res.status(200).json({ host: newUser, room: newRoom }); - } catch (error) { - next(error); - } -} - -export async function existingHostController( - req: Request<{}, {}, { userId: number }>, - res: Response, - next: NextFunction -) { - try { - const body = req.body; - - const newRoom = await createRoom({ hostId: body.userId }); - await joinRoom({ - userId: body.userId, + userId: userId, code: newRoom.code, }); diff --git a/apps/server/src/handlers/connection.handler.ts b/apps/server/src/handlers/connection.handler.ts index fb73a23a..3c93e32f 100644 --- a/apps/server/src/handlers/connection.handler.ts +++ b/apps/server/src/handlers/connection.handler.ts @@ -11,24 +11,29 @@ import { import { handleSocketError } from "../utils"; export async function checkIfExistingUser( + io: Server, socket: Socket ) { - if (socket.handshake.auth.userId && socket.handshake.auth.roomCode) { - const userId = Number(socket.handshake.auth.userId); + if (socket.handshake.auth.roomCode) { const roomCode: string = socket.handshake.auth.roomCode; socket.join(roomCode); - try { - console.log(`[CHECKING IF ${userId} IS IN ROOM ${roomCode}]`); - const updatedRoomInfo = await checkRoomForUserAndAdd({ - userId, - roomCode, - }); - if (updatedRoomInfo) { - socket.emit("roomState", updatedRoomInfo); - socket.to(roomCode).emit("roomState", updatedRoomInfo); + + if (socket.handshake.auth.userId) { + const userId = socket.handshake.auth.userId; + + try { + console.log(`[CHECKING IF ${userId} IS IN ROOM ${roomCode}]`); + const updatedRoomInfo = await checkRoomForUserAndAdd({ + userId, + roomCode, + }); + if (updatedRoomInfo) { + socket.emit("roomState", updatedRoomInfo); + socket.to(roomCode).emit("roomState", updatedRoomInfo); + } + } catch (error) { + if (error instanceof Error) handleSocketError(error, socket, roomCode); } - } catch (error) { - if (error instanceof Error) handleSocketError(error, socket, roomCode); } } } @@ -42,7 +47,7 @@ export async function connectionSocketHandlers( try { await Promise.all( [...socket.rooms].map(async (room) => { - const userId = Number(socket.handshake.auth.userId); + const userId = socket.handshake.auth.userId; await leaveRoom({ userId, diff --git a/apps/server/src/handlers/game.handler.ts b/apps/server/src/handlers/game.handler.ts index 370d7b88..ce7cf075 100644 --- a/apps/server/src/handlers/game.handler.ts +++ b/apps/server/src/handlers/game.handler.ts @@ -42,8 +42,8 @@ export function gameSocketHandlers( players: roomInfo?.players, }); - socket.emit("startGame"); // `socket.in` which is supposed to send to members including the sender is not working as expected, using two emits as a workaround - socket.to(code).emit("startGame"); + socket.emit("startGame", newGame.id); // `socket.in` which is supposed to send to members including the sender is not working as expected, using two emits as a workaround + socket.to(code).emit("startGame", newGame.id); } catch (error) { if (error instanceof Error) handleSocketError(error, socket, code); } diff --git a/apps/server/src/handlers/room.handler.ts b/apps/server/src/handlers/room.handler.ts index c1eedb28..20815e8f 100644 --- a/apps/server/src/handlers/room.handler.ts +++ b/apps/server/src/handlers/room.handler.ts @@ -1,45 +1,54 @@ import { Server, Socket } from "socket.io"; import { ClientToServerEvents, ServerToClientEvents } from "../types"; -import { getRoom, joinRoom, leaveRoom } from "../services/room.service"; +import { + findNextHost, + getRoom, + joinRoom, + leaveRoom, + updateRoomHost, +} from "../services/room.service"; import { handleSocketError } from "../utils"; export function roomSocketHandlers( io: Server, - socket: Socket + socket: Socket, + gameStateMap: Map ) { - socket.on("connectToRoom", async (code) => { - try { - const userId = Number(socket.handshake.auth.userId); - let roomInfo = await getRoom({ code }); + socket.on("connectToRoom", async (data) => { + const { userId, code } = data; + if (userId && code) { + try { + let roomInfo = await getRoom({ code }); - if (!roomInfo) { - socket.emit("message", `Unable to connect to room`); - return; - } + if (!roomInfo) { + socket.emit("message", `Unable to connect to room`); + return; + } - const playerInRoom = roomInfo.players.some( - (player) => player.id === userId - ); + const playerInRoom = roomInfo.players.some( + (player) => player.id === userId + ); - if (roomInfo.players.length >= 8 && !playerInRoom) { - socket.emit("message", "Room is full, unable to join"); - return; - } + if (roomInfo.players.length >= 8 && !playerInRoom) { + socket.emit("message", "Room is full, unable to join"); + return; + } - if (!playerInRoom) { - await joinRoom({ userId: userId, code }); - roomInfo = await getRoom({ code }); - } + if (!playerInRoom) { + await joinRoom({ userId: userId, code }); + roomInfo = await getRoom({ code }); + } - if (!roomInfo) { - throw new Error("Unable to get room info after join"); - } + if (!roomInfo) { + throw new Error("Unable to get room info after join"); + } - socket.join(code); - socket.to(code).emit("roomState", roomInfo); - } catch (error) { - if (error instanceof Error) handleSocketError(error, socket, code); + socket.join(code); + socket.to(code).emit("roomState", roomInfo); + } catch (error) { + if (error instanceof Error) handleSocketError(error, socket, code); + } } }); @@ -53,8 +62,31 @@ export function roomSocketHandlers( return; } + // TODO: Make this find new host and game state map deletion reusuable + if (roomInfo.hostId === userId) { + const newHost = findNextHost({ + prevHostId: roomInfo.hostId, + players: roomInfo.players, + }); + if (!newHost) { + console.log(`[NO OTHER PLAYERS REMAIN IN ${code}]`); + + const gameId = socket.handshake.auth.gameId + ? Number(socket.handshake.auth.gameId) + : null; + if (gameId) { + gameStateMap.delete(gameId); + } + + return; + } + await updateRoomHost({ + newHostId: newHost.id, + roomCode: code, + }); + } + socket.leave(code); - socket.to(code).emit("message", `${socket.handshake.auth.userId} left`); socket.to(code).emit("roomState", roomInfo); } catch (error) { if (error instanceof Error) handleSocketError(error, socket, code); diff --git a/apps/server/src/middleware/auth.middleware.ts b/apps/server/src/middleware/auth.middleware.ts new file mode 100644 index 00000000..2a75e273 --- /dev/null +++ b/apps/server/src/middleware/auth.middleware.ts @@ -0,0 +1,29 @@ +import { Server } from "socket.io"; +import { ClientToServerEvents, ServerToClientEvents } from "../types"; +import { parseCookie } from "../utils"; +import { checkUserSession } from "../services/user.service"; + +export function authSocketMiddleware( + io: Server +) { + io.use(async (socket, next) => { + const userId = socket.handshake.auth.userId; + const sessionToken = socket.request.headers.cookie + ? parseCookie(socket.request.headers.cookie)["next-auth.session-token"] + : undefined; + + if (!userId || !sessionToken) { + next(new Error("Unauthorized")); + return; + } + + const checkDBForSession = await checkUserSession({ sessionToken }); + + if (!checkDBForSession) { + next(new Error("Unauthorized")); + return; + } + + next(); + }); +} diff --git a/apps/server/src/routes/game.route.ts b/apps/server/src/routes/game.route.ts index dafa8780..d70f21eb 100644 --- a/apps/server/src/routes/game.route.ts +++ b/apps/server/src/routes/game.route.ts @@ -1,10 +1,10 @@ import type { Express } from "express"; import { getLeaderboardByIdController, - getPageGameInfoByRoomCodeController, + getGameInfoController, } from "../controllers/game.controller"; export function gameRoutes(app: Express) { - app.get("/game/:code", getPageGameInfoByRoomCodeController); + app.get("/game/:id", getGameInfoController); app.get("/game/:id/leaderboard", getLeaderboardByIdController); } diff --git a/apps/server/src/routes/generation.route.ts b/apps/server/src/routes/generation.route.ts index 0e79be70..57139bee 100644 --- a/apps/server/src/routes/generation.route.ts +++ b/apps/server/src/routes/generation.route.ts @@ -2,14 +2,9 @@ import type { Express } from "express"; import { createGenerationsController, getFaceOffsController, - getUserGenerationInfoController, } from "../controllers/generation.controller"; export function generationRoutes(app: Express) { - app.get( - "/generations/gameId/:gameId/round/:round/user/:userId", - getUserGenerationInfoController - ); app.get("/generations/gameId/:gameId/round/:round", getFaceOffsController); app.post("/generations", createGenerationsController); diff --git a/apps/server/src/routes/question.route.ts b/apps/server/src/routes/question.route.ts deleted file mode 100644 index 76a3768c..00000000 --- a/apps/server/src/routes/question.route.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Express } from "express"; -import { - getQuestionByIdController, - getQuestionsByUserGameRoundController, -} from "../controllers/question.controller"; - -export function questionRoutes(app: Express) { - app.get("/question/:id", getQuestionByIdController); - app.get( - "/questions/user/:userId/game/:gameId/round/:round", - getQuestionsByUserGameRoundController - ); -} diff --git a/apps/server/src/routes/user.route.ts b/apps/server/src/routes/user.route.ts index 2f340bee..21b87a9d 100644 --- a/apps/server/src/routes/user.route.ts +++ b/apps/server/src/routes/user.route.ts @@ -1,12 +1,6 @@ import type { Express } from "express"; -import { - createHostController, - createUserController, - existingHostController, -} from "../controllers/user.controller"; +import { existingHostController } from "../controllers/user.controller"; export function userRoutes(app: Express) { - app.post("/user", createUserController); - app.post("/user/createHost", createHostController); app.post("/user/existingHost", existingHostController); } diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts index d7321496..3f798ee9 100644 --- a/apps/server/src/server.ts +++ b/apps/server/src/server.ts @@ -9,13 +9,14 @@ import { createServer } from "http"; import cors from "cors"; import morgan from "morgan"; import helmet from "helmet"; +import cookieParser from "cookie-parser"; import * as Sentry from "@sentry/node"; +import { rateLimit } from "express-rate-limit"; import { userRoutes } from "./routes/user.route"; import { roomRoutes } from "./routes/room.route"; import { ClientToServerEvents, ServerToClientEvents } from "./types"; import { gameRoutes } from "./routes/game.route"; -import { questionRoutes } from "./routes/question.route"; import { generationRoutes } from "./routes/generation.route"; import { checkIfExistingUser, @@ -25,11 +26,20 @@ import { roomSocketHandlers } from "./handlers/room.handler"; import { gameSocketHandlers } from "./handlers/game.handler"; import { generationSocketHandlers } from "./handlers/generation.handler"; import { voteSocketHandlers } from "./handlers/vote.handler"; +import { authSocketMiddleware } from "./middleware/auth.middleware"; +import { checkUserSession } from "./services/user.service"; export function buildServer() { const app: Express = express(); const server = createServer(app); + const limiter = rateLimit({ + windowMs: 10 * 60 * 1000, // 100 requests every 10 minutes + max: 100, + standardHeaders: "draft-7", + legacyHeaders: false, + }); + Sentry.init({ dsn: "https://94861f92f5354fe0ae1a921b9a55d909@o4505598670209024.ingest.sentry.io/4505598751211520", integrations: [ @@ -46,7 +56,7 @@ export function buildServer() { tracesSampleRate: process.env.NODE_ENV === "production" ? 0.5 : 1.0, }); - // express middleware + // Express middleware app.use(Sentry.Handlers.requestHandler()); app.use(Sentry.Handlers.tracingHandler()); app.use(express.json()); @@ -54,31 +64,69 @@ export function buildServer() { cors({ methods: ["GET", "POST"], origin: process.env.APP_URL ?? "https://un-ai.vercel.app", + credentials: true, }) ); app.use(helmet()); app.use(morgan("tiny")); + app.use(cookieParser()); + app.use(limiter); + app.use(async (req, res, next) => { + let sessionToken = ""; + + const safeURLs = ["/ping", "/room"]; + + if (safeURLs.some((url) => req.url.includes(url)) && req.method === "GET") { + next(); + return; + } + + if (req.headers.authorization) { + sessionToken = req.headers.authorization?.split("Bearer ")[1]; + } else if (req.cookies["next-auth.session-token"]) { + sessionToken = req.cookies["next-auth.session-token"]; + } - // map to track and memoize the state of running games + if (!sessionToken) { + next(new Error("Unauthorized")); + return; + } + + const checkDBForSession = await checkUserSession({ sessionToken }); + + if (!checkDBForSession) { + next(new Error("Unauthorized")); + return; + } + + next(); + }); + + // Map to track and memoize the state of running games const gameStateMap = new Map(); - // websockets with socket.io + // Websockets with socket.io const io = new Server(server, { cors: { methods: ["GET", "POST"], origin: process.env.APP_URL ?? "https://un-ai.vercel.app", + credentials: true, }, }); io.engine.use(helmet()); + // Check for authenticated session + authSocketMiddleware(io); + + // Socket.io events io.on("connection", async (socket) => { console.log("[CONNECTION]", socket.id); - await checkIfExistingUser(socket); + await checkIfExistingUser(io, socket); connectionSocketHandlers(io, socket, gameStateMap); - roomSocketHandlers(io, socket); + roomSocketHandlers(io, socket, gameStateMap); gameSocketHandlers(io, socket, gameStateMap); generationSocketHandlers(io, socket); voteSocketHandlers(io, socket); @@ -94,10 +142,9 @@ export function buildServer() { userRoutes(app); roomRoutes(app); gameRoutes(app); - questionRoutes(app); generationRoutes(app); - // error handlers + // Error handlers app.use(Sentry.Handlers.errorHandler()); const expressErrorHandler: ErrorRequestHandler = (err, req, res, next) => { if (res.headersSent) { diff --git a/apps/server/src/services/game.service.ts b/apps/server/src/services/game.service.ts index 0610659d..0be1c1a7 100644 --- a/apps/server/src/services/game.service.ts +++ b/apps/server/src/services/game.service.ts @@ -12,6 +12,7 @@ import { questionsToGames, questions, votes, + Game, } from "database"; import { getGameRoundGenerations, @@ -39,15 +40,19 @@ export async function getGameInfo({ gameId }: { gameId: number }) { const game = getGame[0]; - const players = (await db + const players = await db .select({ id: users.id, + email: users.email, + name: users.nickname, nickname: users.nickname, + emailVerified: users.emailVerified, + image: users.image, createdAt: users.createdAt, }) .from(usersToGames) .innerJoin(users, eq(usersToGames.userId, users.id)) - .where(eq(usersToGames.gameId, game.id))) as User[]; + .where(eq(usersToGames.gameId, game.id)); return { game, @@ -55,36 +60,19 @@ export async function getGameInfo({ gameId }: { gameId: number }) { }; } -// TODO: create reusuable function with game info query logic? -export async function getPageGameInfoByRoomCode({ code }: { code: string }) { +export async function getGamePageInfo({ + game, + players, +}: { + game: Game; + players: User[]; +}) { const hostResponse = await db .select({ hostId: rooms.hostId }) .from(rooms) - .where(eq(rooms.code, code)); + .where(eq(rooms.code, game.roomCode)); const hostId = hostResponse.length > 0 ? hostResponse[0].hostId : null; - const latestGames = await db - .select() - .from(games) - .where(eq(games.roomCode, code)) - .orderBy(desc(games.createdAt)); - - if (latestGames.length === 0) { - return null; - } - - const latestGame = latestGames[0]; - - const players = (await db - .select({ - id: users.id, - nickname: users.nickname, - createdAt: users.createdAt, - }) - .from(usersToGames) - .innerJoin(users, eq(usersToGames.userId, users.id)) - .where(eq(usersToGames.gameId, latestGame.id))) as User[]; - const gameQuestions = await db .select({ id: questions.id, @@ -97,15 +85,15 @@ export async function getPageGameInfoByRoomCode({ code }: { code: string }) { }) .from(questionsToGames) .innerJoin(questions, eq(questions.id, questionsToGames.questionId)) - .where(eq(questionsToGames.gameId, latestGame.id)) + .where(eq(questionsToGames.gameId, game.id)) .orderBy(asc(questionsToGames.round), asc(questionsToGames.createdAt)); const gameRoundGenerations = await getGameRoundGenerations({ - gameId: latestGame.id, - round: latestGame.round, + gameId: game.id, + round: game.round, }); - let submittedPlayers: number[] = []; + let submittedPlayers: string[] = []; let votedPlayers: { user: User; vote: Vote }[] = []; if (gameRoundGenerations.length > 0) { @@ -116,14 +104,13 @@ export async function getPageGameInfoByRoomCode({ code }: { code: string }) { ), }); votedPlayers = await getVotesByGameRound({ - gameId: latestGame.id, - round: latestGame.round, + gameId: game.id, + round: game.round, }); } - return { hostId, - game: latestGame, + game: game, players: players, questions: gameQuestions, gameRoundGenerations, diff --git a/apps/server/src/services/generation.service.ts b/apps/server/src/services/generation.service.ts index dc659444..fb2ab7c6 100644 --- a/apps/server/src/services/generation.service.ts +++ b/apps/server/src/services/generation.service.ts @@ -44,10 +44,7 @@ export async function getGameRoundGenerations({ .where( and(eq(generations.gameId, gameId), eq(questionsToGames.round, round)) ) - .orderBy( - desc(questionsToGames.createdAt), - desc(questionsToGames.questionId) - ); + .orderBy(desc(generations.createdAt)); return gameRoundGenerations; } @@ -140,8 +137,8 @@ export function getSubmittedPlayers({ }: { faceOffGenerations: GameRoundGeneration[]; }) { - const userGenerationCountMap = new Map(); - const submittedUsers = faceOffGenerations.reduce((acc, curr) => { + const userGenerationCountMap = new Map(); + const submittedUsers = faceOffGenerations.reduce((acc, curr) => { const currUserId = curr.generation.userId; if (userGenerationCountMap.get(currUserId) === 1) { @@ -201,7 +198,7 @@ export async function getGenerationCount({ questionId, }: { gameId: number; - userId: number; + userId: string; questionId: number; }) { const generationCount = await db @@ -220,45 +217,6 @@ export async function getGenerationCount({ return generationCount[0].count; } -export async function getUserGenerationInfo({ - gameId, - userId, - round, -}: { - gameId: number; - userId: number; - round: number; -}) { - const generationsForUserForRound = await db - .select({ - id: generations.id, - gameId: generations.gameId, - imageUrl: generations.imageUrl, - questionId: generations.questionId, - selected: generations.selected, - text: generations.text, - userId: generations.userId, - createdAt: generations.createdAt, - }) - .from(generations) - .innerJoin( - questionsToGames, - and( - eq(generations.gameId, questionsToGames.gameId), - eq(generations.questionId, questionsToGames.questionId) - ) - ) - .where( - and( - eq(generations.gameId, gameId), - eq(generations.userId, userId), - eq(questionsToGames.round, round) - ) - ); - - return generationsForUserForRound; -} - export async function setGenerationAsSubmitted({ generationId, }: { diff --git a/apps/server/src/services/question.service.ts b/apps/server/src/services/question.service.ts index cb87f73d..53a7d034 100644 --- a/apps/server/src/services/question.service.ts +++ b/apps/server/src/services/question.service.ts @@ -1,7 +1,6 @@ import { and, eq, inArray, or, sql } from "drizzle-orm"; import { db, - NewQuestion, NewQuestionToGame, User, questions, @@ -9,21 +8,6 @@ import { } from "database"; import { shuffleArray } from "../utils"; -export async function getQuestionById({ id }: { id: number }) { - const question = await db - .select() - .from(questions) - .where(eq(questions.id, id)); - - return question[0]; -} - -export async function createQuestions(data: NewQuestion[]) { - const newQuestions = await db.insert(questions).values(data).returning(); - - return newQuestions; -} - export async function createQuestionsToGames(data: NewQuestionToGame[]) { const newQuestions = await db .insert(questionsToGames) @@ -137,7 +121,7 @@ export async function getUserQuestionsForRound({ gameId, round, }: { - userId: number; + userId: string; gameId: number; round: number; }) { diff --git a/apps/server/src/services/room.service.ts b/apps/server/src/services/room.service.ts index 61e08cf1..dc2f8a7e 100644 --- a/apps/server/src/services/room.service.ts +++ b/apps/server/src/services/room.service.ts @@ -10,7 +10,7 @@ import { } from "database"; import { and, eq } from "drizzle-orm"; -export async function createRoom({ hostId }: { hostId: number }) { +export async function createRoom({ hostId }: { hostId: string }) { let validRoomCode = false; let roomCode = crypto.randomBytes(4).toString("hex"); @@ -42,7 +42,7 @@ export async function joinRoom({ userId, code, }: { - userId: number; + userId: string; code: string; }) { const newUserRoomRelationship: NewUserRoom = { @@ -62,7 +62,7 @@ export async function leaveRoom({ userId, code, }: { - userId: number; + userId: string; code: string; }) { const removeUserFromRoom = await db @@ -102,7 +102,7 @@ export async function checkRoomForUserAndAdd({ userId, roomCode, }: { - userId: number; + userId: string; roomCode: string; }) { let roomInfo = await getRoom({ code: roomCode }); @@ -120,7 +120,7 @@ export async function updateRoomHost({ newHostId, roomCode, }: { - newHostId: number; + newHostId: string; roomCode: string; }) { const updatedRoomInfo = await db @@ -136,7 +136,7 @@ export function findNextHost({ prevHostId, players, }: { - prevHostId: number; + prevHostId: string | null; players: User[]; }) { const nextHost = players.find((player) => player.id !== prevHostId); diff --git a/apps/server/src/services/user.service.ts b/apps/server/src/services/user.service.ts index 543c3ed8..a1186ae2 100644 --- a/apps/server/src/services/user.service.ts +++ b/apps/server/src/services/user.service.ts @@ -1,6 +1,45 @@ -import { db, users } from "database"; +import { db, sessions, users } from "database"; +import crypto from "crypto"; +import { and, eq, gt } from "drizzle-orm"; export async function createUser({ nickname }: { nickname: string }) { - const newUser = await db.insert(users).values({ nickname }).returning(); + const newUser = await db + .insert(users) + .values({ id: crypto.randomUUID(), email: "", nickname }) + .returning(); return newUser[0]; } + +export async function updateUserNickname({ + userId, + nickname, +}: { + userId: string; + nickname: string; +}) { + const updatedUser = await db + .update(users) + .set({ nickname }) + .where(eq(users.id, userId)) + .returning(); + + return updatedUser[0]; +} + +export async function checkUserSession({ + sessionToken, +}: { + sessionToken: string; +}) { + const checkDBForSession = await db + .select() + .from(sessions) + .where( + and( + eq(sessions.sessionToken, sessionToken), + gt(sessions.expires, new Date()) + ) + ); + + return checkDBForSession.length > 0; +} diff --git a/apps/server/src/services/vote.service.ts b/apps/server/src/services/vote.service.ts index 06bb1f67..bba45b0d 100644 --- a/apps/server/src/services/vote.service.ts +++ b/apps/server/src/services/vote.service.ts @@ -15,7 +15,7 @@ export async function createVote({ userId, generationId, }: { - userId: number; + userId: string; generationId: number; }) { const newVote = await db @@ -91,7 +91,7 @@ export function createVoteMap({ generations: Generation[]; userVotes: UserVote[]; }) { - const userGenerationMap = generations.reduce>( + const userGenerationMap = generations.reduce>( (acc, curr) => { acc[curr.id] = curr.userId; return acc; @@ -99,7 +99,7 @@ export function createVoteMap({ {} ); - const voteMap = userVotes.reduce>((acc, curr) => { + const voteMap = userVotes.reduce>((acc, curr) => { const userId = userGenerationMap[curr.vote.generationId]; if (!acc[userId]) { @@ -142,11 +142,11 @@ export async function saveVotePoints({ totalVotes, gameId, }: { - voteMap: Record; + voteMap: Record; totalVotes: number; gameId: number; }) { - const userIdArray = Object.keys(voteMap).map((id) => Number.parseInt(id)); + const userIdArray = Object.keys(voteMap).map((id) => id); const previousPoints = await db .select() diff --git a/apps/server/src/tests/generation.test.ts b/apps/server/src/tests/generation.test.ts index e1efcfa3..c99c1528 100644 --- a/apps/server/src/tests/generation.test.ts +++ b/apps/server/src/tests/generation.test.ts @@ -1,4 +1,6 @@ +import crypto from "crypto"; import { describe, expect, test } from "@jest/globals"; + import { filterFaceOffGenerationsByQuestionId } from "../services/generation.service"; import { GameRoundGeneration } from "../types"; @@ -6,12 +8,17 @@ describe("filterGameRoundGenerationsByQuestionId", () => { test("expects the filtered array to not have any generations from other questions", () => { const testQuestionId = 2; + const user1 = crypto.randomUUID(); + const user2 = crypto.randomUUID(); + const user3 = crypto.randomUUID(); + const user4 = crypto.randomUUID(); + const faceOffGenerations: GameRoundGeneration[] = [ { generation: { id: 2, createdAt: new Date(), - userId: 5, + userId: user1, text: "A dog eating a burger", questionId: 2, gameId: 2, @@ -23,13 +30,14 @@ describe("filterGameRoundGenerationsByQuestionId", () => { text: "This is a question", gameId: 2, round: 1, - player1: 5, - player2: 6, + player1: user1, + player2: user2, createdAt: new Date(), }, user: { - id: 5, + id: user1, nickname: "Big Al", + email: "", createdAt: new Date(), }, }, @@ -37,7 +45,7 @@ describe("filterGameRoundGenerationsByQuestionId", () => { generation: { id: 3, createdAt: new Date(), - userId: 6, + userId: user2, text: "A dog eating a salmon", questionId: 2, gameId: 2, @@ -49,13 +57,14 @@ describe("filterGameRoundGenerationsByQuestionId", () => { text: "This is a question", gameId: 2, round: 1, - player1: 5, - player2: 6, + player1: user1, + player2: user2, createdAt: new Date(), }, user: { - id: 6, + id: user2, nickname: "Big Jim", + email: "", createdAt: new Date(), }, }, @@ -63,7 +72,7 @@ describe("filterGameRoundGenerationsByQuestionId", () => { generation: { id: 4, createdAt: new Date(), - userId: 7, + userId: user3, text: "A dog eating a pop tart", questionId: 2, gameId: 2, @@ -75,13 +84,14 @@ describe("filterGameRoundGenerationsByQuestionId", () => { text: "This is a question", gameId: 2, round: 1, - player1: 7, - player2: 8, + player1: user3, + player2: user4, createdAt: new Date(), }, user: { - id: 7, + id: user3, nickname: "Big Tom", + email: "", createdAt: new Date(), }, }, @@ -89,7 +99,7 @@ describe("filterGameRoundGenerationsByQuestionId", () => { generation: { id: 5, createdAt: new Date(), - userId: 8, + userId: user4, text: "A dog eating a hot dog", questionId: 2, gameId: 2, @@ -101,13 +111,14 @@ describe("filterGameRoundGenerationsByQuestionId", () => { text: "This is a question", gameId: 2, round: 1, - player1: 7, - player2: 8, + player1: user3, + player2: user4, createdAt: new Date(), }, user: { - id: 8, + id: user4, nickname: "Big Tom", + email: "", createdAt: new Date(), }, }, diff --git a/apps/server/src/tests/question.test.ts b/apps/server/src/tests/question.test.ts index de21c351..829df902 100644 --- a/apps/server/src/tests/question.test.ts +++ b/apps/server/src/tests/question.test.ts @@ -1,6 +1,8 @@ +import crypto from "crypto"; +import { User } from "database"; import { describe, expect, test } from "@jest/globals"; + import { prepareQuestionsForGame } from "../services/question.service"; -import { User } from "database"; describe("prepareQuestionsForGame", () => { test("expects to contain questions with a randomized ordering of players", () => { @@ -50,18 +52,21 @@ describe("prepareQuestionsForGame", () => { ], players: [ { - id: 1, + id: crypto.randomUUID(), nickname: "Big Al", + email: "", createdAt: new Date(), }, { - id: 2, + id: crypto.randomUUID(), nickname: "Big Dan", + email: "", createdAt: new Date(), }, { - id: 3, + id: crypto.randomUUID(), nickname: "Big Tom", + email: "", createdAt: new Date(), }, ], diff --git a/apps/server/src/tests/room.test.ts b/apps/server/src/tests/room.test.ts index 8f641733..c3774387 100644 --- a/apps/server/src/tests/room.test.ts +++ b/apps/server/src/tests/room.test.ts @@ -1,30 +1,37 @@ -import { describe, expect, test } from "@jest/globals"; +import crypto from "crypto"; import { User } from "database"; +import { describe, expect, test } from "@jest/globals"; + import { findNextHost } from "../services/room.service"; describe("findNextHost", () => { test("expects next host to not be the previous host", () => { - const prevHostId = 1; + const prevHostId = crypto.randomUUID(); + const nextHostId = crypto.randomUUID(); const players: User[] = [ { - id: 1, + id: prevHostId, nickname: "Big Al", + email: "", createdAt: new Date(), }, { - id: 2, + id: nextHostId, nickname: "Big Dan", + email: "", createdAt: new Date(), }, { - id: 3, + id: crypto.randomUUID(), nickname: "Big Tom", + email: "", createdAt: new Date(), }, { - id: 4, + id: crypto.randomUUID(), nickname: "Big Kev", + email: "", createdAt: new Date(), }, ]; @@ -33,15 +40,16 @@ describe("findNextHost", () => { expect(nextHost).toBeDefined(); - expect(nextHost?.id).toBe(2); + expect(nextHost?.id).toBe(nextHostId); }); test("expects to return undefined when no other players exist to become host", () => { - const prevHostId = 1; + const prevHostId = crypto.randomUUID(); const players: User[] = [ { - id: 1, + id: prevHostId, nickname: "Big Al", + email: "", createdAt: new Date(), }, ]; diff --git a/apps/server/src/tests/vote.test.ts b/apps/server/src/tests/vote.test.ts index 13b8f6f4..2ab01cc4 100644 --- a/apps/server/src/tests/vote.test.ts +++ b/apps/server/src/tests/vote.test.ts @@ -1,6 +1,8 @@ +import crypto from "crypto"; import { describe, expect, test } from "@jest/globals"; -import { calculateVotePoints, createVoteMap } from "../services/vote.service"; import { Generation } from "database"; + +import { calculateVotePoints, createVoteMap } from "../services/vote.service"; import { UserVote } from "../types"; describe("calculateVotePoints", () => { @@ -34,11 +36,14 @@ describe("calculateVotePoints", () => { describe("createVoteMap", () => { test("expects to create a map between users and the votes they accumlated for a face off", () => { + const creator1 = crypto.randomUUID(); + const creator2 = crypto.randomUUID(); + const generations: Generation[] = [ { id: 1, createdAt: new Date(), - userId: 3, + userId: creator1, text: "A dog eating a Pop Tart", questionId: 2, gameId: 2, @@ -48,7 +53,7 @@ describe("createVoteMap", () => { { id: 2, createdAt: new Date(), - userId: 4, + userId: creator2, text: "A dog eating a burger", questionId: 2, gameId: 2, @@ -57,31 +62,36 @@ describe("createVoteMap", () => { }, ]; + const voter1 = crypto.randomUUID(); + const voter2 = crypto.randomUUID(); + const userVotes: UserVote[] = [ { user: { - id: 5, + id: voter1, nickname: "Big Al", + email: "", createdAt: new Date(), }, vote: { id: 6, createdAt: new Date(), generationId: 1, - userId: 5, + userId: voter1, }, }, { user: { - id: 10, + id: voter2, nickname: "Big Al", + email: "", createdAt: new Date(), }, vote: { id: 7, createdAt: new Date(), generationId: 2, - userId: 10, + userId: voter2, }, }, ]; @@ -89,8 +99,8 @@ describe("createVoteMap", () => { const voteMap = createVoteMap({ generations, userVotes }); expect(voteMap).toEqual({ - 3: 1, - 4: 1, + [creator1]: 1, + [creator2]: 1, }); }); }); diff --git a/apps/server/src/types.ts b/apps/server/src/types.ts index 525176c1..d3037766 100644 --- a/apps/server/src/types.ts +++ b/apps/server/src/types.ts @@ -13,17 +13,17 @@ type StateMachineEvent = export interface ServerToClientEvents { message: (str: string) => void; roomState: (roomInfo: RoomInfo) => void; - startGame: () => void; + startGame: (gameId: number) => void; playAnotherGame: () => void; serverEvent: (event: StateMachineEvent) => void; - submittedPlayers: (players: number[]) => void; + submittedPlayers: (players: string[]) => void; votedPlayers: (votes: { vote: Vote; user: User }[]) => void; error: (str: string) => void; } export interface ClientToServerEvents { - connectToRoom: (code: string) => void; - leaveRoom: (data: { userId: number; code: string }) => void; + connectToRoom: (data: { code: string; userId: string }) => void; + leaveRoom: (data: { userId: string; code: string }) => void; initiateGame: (code: string) => void; initiatePlayAnotherGame: (code: string) => void; clientEvent: (data: { @@ -39,7 +39,7 @@ export interface ClientToServerEvents { round: number; }) => void; voteSubmitted: (data: { - userId: number; + userId: string; generationId: number; gameId: number; questionId: number; @@ -55,8 +55,8 @@ export type GameRoundGeneration = { text: string; round: number; gameId: number; - player1: number; - player2: number; + player1: string; + player2: string; createdAt: Date; }; user: User; diff --git a/apps/server/src/utils.ts b/apps/server/src/utils.ts index 4cad130c..116e3703 100644 --- a/apps/server/src/utils.ts +++ b/apps/server/src/utils.ts @@ -20,12 +20,25 @@ export function shuffleArray(arr: T[]) { } export function handleSocketError( - e: Error, + error: Error, socket: Socket, code?: string ) { - console.error("Socket Error: ", e); - socket.emit("error", e.message); - Sentry.captureException(e); - if (code) socket.to(code).emit("error", e.message); + console.error("Socket Error: ", error); + socket.emit("error", error.message); + Sentry.captureException(error); + if (code) socket.to(code).emit("error", error.message); +} + +export function parseCookie(cookieHeader: string) { + return cookieHeader + .split(";") + .map((v) => v.split("=")) + .reduce( + (acc, v) => { + acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim()); + return acc; + }, + {} as Record + ); } diff --git a/package.json b/package.json index 9a790a67..463b55f2 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,20 @@ { - "private": true, - "scripts": { - "build": "turbo run build", - "dev": "turbo run dev", - "lint": "turbo run lint", - "test": "turbo run test", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" - }, - "devDependencies": { - "eslint": "^8.48.0", - "prettier": "^3.0.3", - "tsconfig": "workspace:*", - "turbo": "^1.10.12" - }, - "engines": { - "node": "18" - }, - "packageManager": "pnpm@8.6.10" + "private": true, + "scripts": { + "build": "turbo run build", + "dev": "turbo run dev", + "lint": "turbo run lint", + "test": "turbo run test", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" + }, + "devDependencies": { + "eslint": "^8.48.0", + "prettier": "^3.0.3", + "tsconfig": "workspace:*", + "turbo": "^1.10.13" + }, + "engines": { + "node": "18" + }, + "packageManager": "pnpm@8.6.10" } \ No newline at end of file diff --git a/packages/database/drizzle/0000_brief_hobgoblin.sql b/packages/database/drizzle/0000_brief_hobgoblin.sql deleted file mode 100644 index b75c2739..00000000 --- a/packages/database/drizzle/0000_brief_hobgoblin.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE IF NOT EXISTS "users" ( - "id" serial PRIMARY KEY NOT NULL, - "full_name" text, - "phone" varchar(256) -); diff --git a/packages/database/drizzle/0000_rainy_hellion.sql b/packages/database/drizzle/0000_rainy_hellion.sql new file mode 100644 index 00000000..767df135 --- /dev/null +++ b/packages/database/drizzle/0000_rainy_hellion.sql @@ -0,0 +1,202 @@ +CREATE TABLE IF NOT EXISTS "accounts" ( + "user_id" text 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, + CONSTRAINT accounts_provider_provider_account_id PRIMARY KEY("provider","provider_account_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "games" ( + "id" serial PRIMARY KEY NOT NULL, + "room_code" text NOT NULL, + "state" text NOT NULL, + "round" integer NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "completed_at" timestamp +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "generations" ( + "id" serial PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "game_id" integer NOT NULL, + "question_id" integer NOT NULL, + "text" text NOT NULL, + "image_url" text NOT NULL, + "selected" boolean DEFAULT false NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "questions" ( + "id" serial PRIMARY KEY NOT NULL, + "text" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "questions_to_games" ( + "question_id" integer NOT NULL, + "game_id" integer NOT NULL, + "round" integer NOT NULL, + "player_1" text NOT NULL, + "player_2" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT questions_to_games_game_id_question_id PRIMARY KEY("game_id","question_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "rooms" ( + "code" text PRIMARY KEY NOT NULL, + "host_id" text, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "sessions" ( + "session_token" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "expires" timestamp NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "users" ( + "id" text PRIMARY KEY NOT NULL, + "nickname" text, + "name" text, + "email" text NOT NULL, + "email_verified" timestamp, + "image" text, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "users_to_games" ( + "user_id" text NOT NULL, + "game_id" integer NOT NULL, + "points" integer DEFAULT 0 NOT NULL, + CONSTRAINT users_to_games_user_id_game_id PRIMARY KEY("user_id","game_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "users_to_rooms" ( + "user_id" text NOT NULL, + "room_code" text NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + CONSTRAINT users_to_rooms_user_id_room_code PRIMARY KEY("user_id","room_code") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "verification_tokens" ( + "identifier" text NOT NULL, + "token" text NOT NULL, + "expires" timestamp NOT NULL, + CONSTRAINT verification_tokens_identifier_token PRIMARY KEY("identifier","token") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "votes" ( + "id" serial PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "generation_id" integer NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "games" ADD CONSTRAINT "games_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "generations" ADD CONSTRAINT "generations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "generations" ADD CONSTRAINT "generations_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "generations" ADD CONSTRAINT "generations_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_player_1_users_id_fk" FOREIGN KEY ("player_1") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_player_2_users_id_fk" FOREIGN KEY ("player_2") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "rooms" ADD CONSTRAINT "rooms_host_id_users_id_fk" FOREIGN KEY ("host_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "users_to_games" ADD CONSTRAINT "users_to_games_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "users_to_games" ADD CONSTRAINT "users_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "users_to_rooms" ADD CONSTRAINT "users_to_rooms_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "users_to_rooms" ADD CONSTRAINT "users_to_rooms_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "votes" ADD CONSTRAINT "votes_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "votes" ADD CONSTRAINT "votes_generation_id_generations_id_fk" FOREIGN KEY ("generation_id") REFERENCES "generations"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/packages/database/drizzle/0001_clever_microchip.sql b/packages/database/drizzle/0001_clever_microchip.sql deleted file mode 100644 index 73d29d70..00000000 --- a/packages/database/drizzle/0001_clever_microchip.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE IF NOT EXISTS "rooms" ( - "code" text PRIMARY KEY NOT NULL, - "host_id" integer -); - -CREATE TABLE IF NOT EXISTS "user_rooms" ( - "user_id" integer, - "room_code" text -); - -ALTER TABLE "users" RENAME COLUMN "full_name" TO "nickname"; -ALTER TABLE "users" DROP COLUMN IF EXISTS "phone"; -DO $$ BEGIN - ALTER TABLE "rooms" ADD CONSTRAINT "rooms_host_id_users_id_fk" FOREIGN KEY ("host_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "user_rooms" ADD CONSTRAINT "user_rooms_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "user_rooms" ADD CONSTRAINT "user_rooms_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0002_worthless_the_call.sql b/packages/database/drizzle/0001_shallow_moonstone.sql similarity index 100% rename from packages/database/drizzle/0002_worthless_the_call.sql rename to packages/database/drizzle/0001_shallow_moonstone.sql diff --git a/packages/database/drizzle/0003_faulty_madame_hydra.sql b/packages/database/drizzle/0003_faulty_madame_hydra.sql deleted file mode 100644 index 45214f37..00000000 --- a/packages/database/drizzle/0003_faulty_madame_hydra.sql +++ /dev/null @@ -1,66 +0,0 @@ -CREATE TABLE IF NOT EXISTS "games" ( - "id" serial PRIMARY KEY NOT NULL, - "room_code" text, - "first_question_id" integer, - "second_question_id" integer, - "third_question_id" integer, - "created_at" timestamp DEFAULT now() NOT NULL, - "completed_at" timestamp -); - -CREATE TABLE IF NOT EXISTS "generations" ( - "id" serial PRIMARY KEY NOT NULL, - "game_id" integer NOT NULL, - "text" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL -); - -CREATE TABLE IF NOT EXISTS "questions" ( - "id" serial PRIMARY KEY NOT NULL, - "text" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL -); - -CREATE TABLE IF NOT EXISTS "votes" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer, - "created_at" timestamp DEFAULT now() NOT NULL -); - -ALTER TABLE "rooms" ADD COLUMN "created_at" timestamp DEFAULT now() NOT NULL; -ALTER TABLE "user_rooms" ADD COLUMN "created_at" timestamp DEFAULT now() NOT NULL; -ALTER TABLE "users" ADD COLUMN "created_at" timestamp DEFAULT now() NOT NULL; -ALTER TABLE "rooms" DROP CONSTRAINT "rooms_host_id_users_id_fk"; - -ALTER TABLE "rooms" DROP COLUMN IF EXISTS "host_id"; -DO $$ BEGIN - ALTER TABLE "games" ADD CONSTRAINT "games_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "games" ADD CONSTRAINT "games_first_question_id_questions_id_fk" FOREIGN KEY ("first_question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "games" ADD CONSTRAINT "games_second_question_id_questions_id_fk" FOREIGN KEY ("second_question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "games" ADD CONSTRAINT "games_third_question_id_questions_id_fk" FOREIGN KEY ("third_question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "votes" ADD CONSTRAINT "votes_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -ALTER TABLE "user_rooms" ADD CONSTRAINT "user_rooms_user_id_room_code" PRIMARY KEY("user_id","room_code"); \ No newline at end of file diff --git a/packages/database/drizzle/0004_late_warbird.sql b/packages/database/drizzle/0004_late_warbird.sql deleted file mode 100644 index 3016721f..00000000 --- a/packages/database/drizzle/0004_late_warbird.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "votes" ALTER COLUMN "user_id" SET NOT NULL; \ No newline at end of file diff --git a/packages/database/drizzle/0005_silly_zzzax.sql b/packages/database/drizzle/0005_silly_zzzax.sql deleted file mode 100644 index c0092898..00000000 --- a/packages/database/drizzle/0005_silly_zzzax.sql +++ /dev/null @@ -1,34 +0,0 @@ -ALTER TABLE "games" ALTER COLUMN "room_code" SET NOT NULL; -ALTER TABLE "user_rooms" ALTER COLUMN "user_id" SET NOT NULL; -ALTER TABLE "user_rooms" ALTER COLUMN "room_code" SET NOT NULL; -ALTER TABLE "generations" ADD COLUMN "user_id" integer NOT NULL; -ALTER TABLE "generations" ADD COLUMN "question_id" integer NOT NULL; -ALTER TABLE "generations" ADD COLUMN "round" integer NOT NULL; -ALTER TABLE "generations" ADD COLUMN "image_url" text NOT NULL; -ALTER TABLE "games" DROP CONSTRAINT "games_first_question_id_questions_id_fk"; - -ALTER TABLE "games" DROP CONSTRAINT "games_second_question_id_questions_id_fk"; - -ALTER TABLE "games" DROP CONSTRAINT "games_third_question_id_questions_id_fk"; - -DO $$ BEGIN - ALTER TABLE "generations" ADD CONSTRAINT "generations_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "generations" ADD CONSTRAINT "generations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "generations" ADD CONSTRAINT "generations_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -ALTER TABLE "games" DROP COLUMN IF EXISTS "first_question_id"; -ALTER TABLE "games" DROP COLUMN IF EXISTS "second_question_id"; -ALTER TABLE "games" DROP COLUMN IF EXISTS "third_question_id"; \ No newline at end of file diff --git a/packages/database/drizzle/0006_happy_reaper.sql b/packages/database/drizzle/0006_happy_reaper.sql deleted file mode 100644 index e9682017..00000000 --- a/packages/database/drizzle/0006_happy_reaper.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE "games" ADD COLUMN "state" text NOT NULL; -ALTER TABLE "games" ADD COLUMN "round" integer NOT NULL; -ALTER TABLE "votes" ADD COLUMN "generation_id" integer NOT NULL; -DO $$ BEGIN - ALTER TABLE "votes" ADD CONSTRAINT "votes_generation_id_generations_id_fk" FOREIGN KEY ("generation_id") REFERENCES "generations"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0007_young_gauntlet.sql b/packages/database/drizzle/0007_young_gauntlet.sql deleted file mode 100644 index abaf3231..00000000 --- a/packages/database/drizzle/0007_young_gauntlet.sql +++ /dev/null @@ -1,14 +0,0 @@ -ALTER TABLE "generations" ADD COLUMN "voted_on" boolean DEFAULT false NOT NULL; -ALTER TABLE "questions" ADD COLUMN "player_1" integer; -ALTER TABLE "questions" ADD COLUMN "player_2" integer; -DO $$ BEGIN - ALTER TABLE "questions" ADD CONSTRAINT "questions_player_1_users_id_fk" FOREIGN KEY ("player_1") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "questions" ADD CONSTRAINT "questions_player_2_users_id_fk" FOREIGN KEY ("player_2") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0008_striped_smasher.sql b/packages/database/drizzle/0008_striped_smasher.sql deleted file mode 100644 index 40199ab8..00000000 --- a/packages/database/drizzle/0008_striped_smasher.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TABLE "questions" ALTER COLUMN "player_1" SET NOT NULL; -ALTER TABLE "questions" ALTER COLUMN "player_2" SET NOT NULL; -ALTER TABLE "questions" ADD COLUMN "game_id" integer NOT NULL; -ALTER TABLE "questions" ADD COLUMN "round" integer NOT NULL; -ALTER TABLE "questions" ADD COLUMN "voted_on" boolean DEFAULT false NOT NULL; -ALTER TABLE "generations" DROP CONSTRAINT "generations_game_id_games_id_fk"; - -DO $$ BEGIN - ALTER TABLE "questions" ADD CONSTRAINT "questions_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -ALTER TABLE "generations" DROP COLUMN IF EXISTS "game_id"; -ALTER TABLE "generations" DROP COLUMN IF EXISTS "round"; -ALTER TABLE "generations" DROP COLUMN IF EXISTS "voted_on"; \ No newline at end of file diff --git a/packages/database/drizzle/0009_flippant_peter_quill.sql b/packages/database/drizzle/0009_flippant_peter_quill.sql deleted file mode 100644 index 4fac010e..00000000 --- a/packages/database/drizzle/0009_flippant_peter_quill.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE IF NOT EXISTS "user_games" ( - "user_id" integer NOT NULL, - "game_id" integer NOT NULL, - "points" integer DEFAULT 0 NOT NULL -); ---> statement-breakpoint -ALTER TABLE "user_games" ADD CONSTRAINT "user_games_user_id_game_id" PRIMARY KEY("user_id","game_id"); - -DO $$ BEGIN - ALTER TABLE "user_games" ADD CONSTRAINT "user_games_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -DO $$ BEGIN - ALTER TABLE "user_games" ADD CONSTRAINT "user_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0010_productive_stepford_cuckoos.sql b/packages/database/drizzle/0010_productive_stepford_cuckoos.sql deleted file mode 100644 index 31dd8903..00000000 --- a/packages/database/drizzle/0010_productive_stepford_cuckoos.sql +++ /dev/null @@ -1,33 +0,0 @@ -ALTER TABLE "user_games" RENAME TO "users_games";--> statement-breakpoint -ALTER TABLE "user_rooms" RENAME TO "users_rooms";--> statement-breakpoint -ALTER TABLE "users_games" DROP CONSTRAINT "user_games_user_id_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_games" DROP CONSTRAINT "user_games_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_rooms" DROP CONSTRAINT "user_rooms_user_id_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_rooms" DROP CONSTRAINT "user_rooms_room_code_rooms_code_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_games" ADD CONSTRAINT "users_games_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_games" ADD CONSTRAINT "users_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_rooms" ADD CONSTRAINT "users_rooms_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_rooms" ADD CONSTRAINT "users_rooms_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0011_dear_zeigeist.sql b/packages/database/drizzle/0011_dear_zeigeist.sql deleted file mode 100644 index 8584dd77..00000000 --- a/packages/database/drizzle/0011_dear_zeigeist.sql +++ /dev/null @@ -1,33 +0,0 @@ -ALTER TABLE "users_games" RENAME TO "users_to_games";--> statement-breakpoint -ALTER TABLE "users_rooms" RENAME TO "users_to_rooms";--> statement-breakpoint -ALTER TABLE "users_to_games" DROP CONSTRAINT "users_games_user_id_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_games" DROP CONSTRAINT "users_games_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_rooms" DROP CONSTRAINT "users_rooms_user_id_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_rooms" DROP CONSTRAINT "users_rooms_room_code_rooms_code_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_games" ADD CONSTRAINT "users_to_games_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_games" ADD CONSTRAINT "users_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_rooms" ADD CONSTRAINT "users_to_rooms_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_rooms" ADD CONSTRAINT "users_to_rooms_room_code_rooms_code_fk" FOREIGN KEY ("room_code") REFERENCES "rooms"("code") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0012_simple_dracula.sql b/packages/database/drizzle/0012_simple_dracula.sql deleted file mode 100644 index b20b5888..00000000 --- a/packages/database/drizzle/0012_simple_dracula.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "questions" DROP COLUMN IF EXISTS "voted_on"; \ No newline at end of file diff --git a/packages/database/drizzle/0013_spooky_nitro.sql b/packages/database/drizzle/0013_spooky_nitro.sql deleted file mode 100644 index fe5979d7..00000000 --- a/packages/database/drizzle/0013_spooky_nitro.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "rooms" ADD COLUMN "host_id" integer;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "rooms" ADD CONSTRAINT "rooms_host_id_users_id_fk" FOREIGN KEY ("host_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0014_happy_malice.sql b/packages/database/drizzle/0014_happy_malice.sql deleted file mode 100644 index b23d3857..00000000 --- a/packages/database/drizzle/0014_happy_malice.sql +++ /dev/null @@ -1,33 +0,0 @@ -CREATE TABLE IF NOT EXISTS "questions_to_games" ( - "question_id" integer NOT NULL, - "game_id" integer NOT NULL, - "round" integer NOT NULL, - "player_1" integer NOT NULL, - "player_2" integer NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT questions_to_games_game_id_question_id PRIMARY KEY("game_id","question_id") -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "questions"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_player_1_users_id_fk" FOREIGN KEY ("player_1") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "questions_to_games" ADD CONSTRAINT "questions_to_games_player_2_users_id_fk" FOREIGN KEY ("player_2") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0015_nifty_earthquake.sql b/packages/database/drizzle/0015_nifty_earthquake.sql deleted file mode 100644 index 7bc69ff2..00000000 --- a/packages/database/drizzle/0015_nifty_earthquake.sql +++ /dev/null @@ -1,10 +0,0 @@ -ALTER TABLE "questions" DROP CONSTRAINT "questions_game_id_games_id_fk"; ---> statement-breakpoint -ALTER TABLE "questions" DROP CONSTRAINT "questions_player_1_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "questions" DROP CONSTRAINT "questions_player_2_users_id_fk"; ---> statement-breakpoint -ALTER TABLE "questions" DROP COLUMN IF EXISTS "game_id";--> statement-breakpoint -ALTER TABLE "questions" DROP COLUMN IF EXISTS "round";--> statement-breakpoint -ALTER TABLE "questions" DROP COLUMN IF EXISTS "player_1";--> statement-breakpoint -ALTER TABLE "questions" DROP COLUMN IF EXISTS "player_2"; \ No newline at end of file diff --git a/packages/database/drizzle/0016_violet_electro.sql b/packages/database/drizzle/0016_violet_electro.sql deleted file mode 100644 index d9160ae4..00000000 --- a/packages/database/drizzle/0016_violet_electro.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "users_to_games" ADD COLUMN "regeneration_count" integer DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/packages/database/drizzle/0017_nostalgic_northstar.sql b/packages/database/drizzle/0017_nostalgic_northstar.sql deleted file mode 100644 index f092a2dc..00000000 --- a/packages/database/drizzle/0017_nostalgic_northstar.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "generations" ADD COLUMN "game_id" integer;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "generations" ADD CONSTRAINT "generations_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "games"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/database/drizzle/0018_late_thor.sql b/packages/database/drizzle/0018_late_thor.sql deleted file mode 100644 index ae0afaee..00000000 --- a/packages/database/drizzle/0018_late_thor.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "generations" ADD COLUMN "selected" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "users_to_games" DROP COLUMN IF EXISTS "regeneration_count"; \ No newline at end of file diff --git a/packages/database/drizzle/0019_brainy_vector.sql b/packages/database/drizzle/0019_brainy_vector.sql deleted file mode 100644 index ab6c7693..00000000 --- a/packages/database/drizzle/0019_brainy_vector.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "generations" ALTER COLUMN "game_id" SET NOT NULL; \ No newline at end of file diff --git a/packages/database/drizzle/meta/0000_snapshot.json b/packages/database/drizzle/meta/0000_snapshot.json index 4f55c222..e9c82bce 100644 --- a/packages/database/drizzle/meta/0000_snapshot.json +++ b/packages/database/drizzle/meta/0000_snapshot.json @@ -1,35 +1,768 @@ { "version": "5", "dialect": "pg", - "id": "04291abf-bb24-42e2-95ca-fdfe2d7eb8c6", + "id": "41413b09-a886-44e0-ac38-f6538a009b03", "prevId": "00000000-0000-0000-0000-000000000000", "tables": { + "accounts": { + "name": "accounts", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_account_id": { + "name": "provider_account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "token_type": { + "name": "token_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_state": { + "name": "session_state", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "accounts_user_id_users_id_fk": { + "name": "accounts_user_id_users_id_fk", + "tableFrom": "accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "accounts_provider_provider_account_id": { + "name": "accounts_provider_provider_account_id", + "columns": [ + "provider", + "provider_account_id" + ] + } + }, + "uniqueConstraints": {} + }, + "games": { + "name": "games", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "room_code": { + "name": "room_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "round": { + "name": "round", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "games_room_code_rooms_code_fk": { + "name": "games_room_code_rooms_code_fk", + "tableFrom": "games", + "tableTo": "rooms", + "columnsFrom": [ + "room_code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "generations": { + "name": "generations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "question_id": { + "name": "question_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "image_url": { + "name": "image_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selected": { + "name": "selected", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "generations_user_id_users_id_fk": { + "name": "generations_user_id_users_id_fk", + "tableFrom": "generations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "generations_game_id_games_id_fk": { + "name": "generations_game_id_games_id_fk", + "tableFrom": "generations", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "generations_question_id_questions_id_fk": { + "name": "generations_question_id_questions_id_fk", + "tableFrom": "generations", + "tableTo": "questions", + "columnsFrom": [ + "question_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "questions": { + "name": "questions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "questions_to_games": { + "name": "questions_to_games", + "schema": "", + "columns": { + "question_id": { + "name": "question_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "round": { + "name": "round", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "player_1": { + "name": "player_1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "player_2": { + "name": "player_2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "questions_to_games_question_id_questions_id_fk": { + "name": "questions_to_games_question_id_questions_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "questions", + "columnsFrom": [ + "question_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_game_id_games_id_fk": { + "name": "questions_to_games_game_id_games_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_player_1_users_id_fk": { + "name": "questions_to_games_player_1_users_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "users", + "columnsFrom": [ + "player_1" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_player_2_users_id_fk": { + "name": "questions_to_games_player_2_users_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "users", + "columnsFrom": [ + "player_2" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "questions_to_games_game_id_question_id": { + "name": "questions_to_games_game_id_question_id", + "columns": [ + "game_id", + "question_id" + ] + } + }, + "uniqueConstraints": {} + }, + "rooms": { + "name": "rooms", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "rooms_host_id_users_id_fk": { + "name": "rooms_host_id_users_id_fk", + "tableFrom": "rooms", + "tableTo": "users", + "columnsFrom": [ + "host_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "sessions": { + "name": "sessions", + "schema": "", + "columns": { + "session_token": { + "name": "session_token", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, "users": { "name": "users", "schema": "", "columns": { "id": { "name": "id", - "type": "serial", + "type": "text", "primaryKey": true, "notNull": true }, - "full_name": { - "name": "full_name", + "nickname": { + "name": "nickname", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", "type": "text", "primaryKey": false, "notNull": false }, - "phone": { - "name": "phone", - "type": "varchar(256)", + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "image": { + "name": "image", + "type": "text", "primaryKey": false, "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users_to_games": { + "name": "users_to_games", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "points": { + "name": "points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "users_to_games_user_id_users_id_fk": { + "name": "users_to_games_user_id_users_id_fk", + "tableFrom": "users_to_games", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "users_to_games_game_id_games_id_fk": { + "name": "users_to_games_game_id_games_id_fk", + "tableFrom": "users_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "users_to_games_user_id_game_id": { + "name": "users_to_games_user_id_game_id", + "columns": [ + "user_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "users_to_rooms": { + "name": "users_to_rooms", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "room_code": { + "name": "room_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "users_to_rooms_user_id_users_id_fk": { + "name": "users_to_rooms_user_id_users_id_fk", + "tableFrom": "users_to_rooms", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "users_to_rooms_room_code_rooms_code_fk": { + "name": "users_to_rooms_room_code_rooms_code_fk", + "tableFrom": "users_to_rooms", + "tableTo": "rooms", + "columnsFrom": [ + "room_code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "users_to_rooms_user_id_room_code": { + "name": "users_to_rooms_user_id_room_code", + "columns": [ + "user_id", + "room_code" + ] + } + }, + "uniqueConstraints": {} + }, + "verification_tokens": { + "name": "verification_tokens", + "schema": "", + "columns": { + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp", + "primaryKey": false, + "notNull": true } }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": { + "verification_tokens_identifier_token": { + "name": "verification_tokens_identifier_token", + "columns": [ + "identifier", + "token" + ] + } + }, + "uniqueConstraints": {} + }, + "votes": { + "name": "votes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "generation_id": { + "name": "generation_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "votes_user_id_users_id_fk": { + "name": "votes_user_id_users_id_fk", + "tableFrom": "votes", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "votes_generation_id_generations_id_fk": { + "name": "votes_generation_id_generations_id_fk", + "tableFrom": "votes", + "tableTo": "generations", + "columnsFrom": [ + "generation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} } }, "enums": {}, diff --git a/packages/database/drizzle/meta/0001_snapshot.json b/packages/database/drizzle/meta/0001_snapshot.json index 0a55c845..33ffa7b0 100644 --- a/packages/database/drizzle/meta/0001_snapshot.json +++ b/packages/database/drizzle/meta/0001_snapshot.json @@ -1,9 +1,405 @@ { "version": "5", "dialect": "pg", - "id": "b754f4bb-b2d8-4334-a6c6-081f2213737a", - "prevId": "04291abf-bb24-42e2-95ca-fdfe2d7eb8c6", + "id": "2f7d8dac-6c1b-415e-b13c-eaeeaacbc81d", + "prevId": "41413b09-a886-44e0-ac38-f6538a009b03", "tables": { + "accounts": { + "name": "accounts", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_account_id": { + "name": "provider_account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "token_type": { + "name": "token_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_state": { + "name": "session_state", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "accounts_user_id_users_id_fk": { + "name": "accounts_user_id_users_id_fk", + "tableFrom": "accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "accounts_provider_provider_account_id": { + "name": "accounts_provider_provider_account_id", + "columns": [ + "provider", + "provider_account_id" + ] + } + }, + "uniqueConstraints": {} + }, + "games": { + "name": "games", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "room_code": { + "name": "room_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "round": { + "name": "round", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "games_room_code_rooms_code_fk": { + "name": "games_room_code_rooms_code_fk", + "tableFrom": "games", + "tableTo": "rooms", + "columnsFrom": [ + "room_code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "generations": { + "name": "generations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "question_id": { + "name": "question_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "image_url": { + "name": "image_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selected": { + "name": "selected", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "generations_user_id_users_id_fk": { + "name": "generations_user_id_users_id_fk", + "tableFrom": "generations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "generations_game_id_games_id_fk": { + "name": "generations_game_id_games_id_fk", + "tableFrom": "generations", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "generations_question_id_questions_id_fk": { + "name": "generations_question_id_questions_id_fk", + "tableFrom": "generations", + "tableTo": "questions", + "columnsFrom": [ + "question_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "questions": { + "name": "questions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "questions_to_games": { + "name": "questions_to_games", + "schema": "", + "columns": { + "question_id": { + "name": "question_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "round": { + "name": "round", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "player_1": { + "name": "player_1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "player_2": { + "name": "player_2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "questions_to_games_question_id_questions_id_fk": { + "name": "questions_to_games_question_id_questions_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "questions", + "columnsFrom": [ + "question_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_game_id_games_id_fk": { + "name": "questions_to_games_game_id_games_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_player_1_users_id_fk": { + "name": "questions_to_games_player_1_users_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "users", + "columnsFrom": [ + "player_1" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "questions_to_games_player_2_users_id_fk": { + "name": "questions_to_games_player_2_users_id_fk", + "tableFrom": "questions_to_games", + "tableTo": "users", + "columnsFrom": [ + "player_2" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "questions_to_games_game_id_question_id": { + "name": "questions_to_games_game_id_question_id", + "columns": [ + "game_id", + "question_id" + ] + } + }, + "uniqueConstraints": {} + }, "rooms": { "name": "rooms", "schema": "", @@ -16,9 +412,16 @@ }, "host_id": { "name": "host_id", - "type": "integer", + "type": "text", "primaryKey": false, "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, @@ -37,30 +440,197 @@ "onUpdate": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {} }, - "user_rooms": { - "name": "user_rooms", + "sessions": { + "name": "sessions", "schema": "", "columns": { + "session_token": { + "name": "session_token", + "type": "text", + "primaryKey": true, + "notNull": true + }, "user_id": { "name": "user_id", - "type": "integer", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "nickname": { + "name": "nickname", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "timestamp", "primaryKey": false, "notNull": false }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users_to_games": { + "name": "users_to_games", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "game_id": { + "name": "game_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "points": { + "name": "points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "users_to_games_user_id_users_id_fk": { + "name": "users_to_games_user_id_users_id_fk", + "tableFrom": "users_to_games", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "users_to_games_game_id_games_id_fk": { + "name": "users_to_games_game_id_games_id_fk", + "tableFrom": "users_to_games", + "tableTo": "games", + "columnsFrom": [ + "game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "users_to_games_user_id_game_id": { + "name": "users_to_games_user_id_game_id", + "columns": [ + "user_id", + "game_id" + ] + } + }, + "uniqueConstraints": {} + }, + "users_to_rooms": { + "name": "users_to_rooms", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", + "users_to_rooms_user_id_users_id_fk": { + "name": "users_to_rooms_user_id_users_id_fk", + "tableFrom": "users_to_rooms", "tableTo": "users", "columnsFrom": [ "user_id" @@ -71,9 +641,9 @@ "onDelete": "no action", "onUpdate": "no action" }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", + "users_to_rooms_room_code_rooms_code_fk": { + "name": "users_to_rooms_room_code_rooms_code_fk", + "tableFrom": "users_to_rooms", "tableTo": "rooms", "columnsFrom": [ "room_code" @@ -85,10 +655,55 @@ "onUpdate": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": { + "users_to_rooms_user_id_room_code": { + "name": "users_to_rooms_user_id_room_code", + "columns": [ + "user_id", + "room_code" + ] + } + }, + "uniqueConstraints": {} }, - "users": { - "name": "users", + "verification_tokens": { + "name": "verification_tokens", + "schema": "", + "columns": { + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "verification_tokens_identifier_token": { + "name": "verification_tokens_identifier_token", + "columns": [ + "identifier", + "token" + ] + } + }, + "uniqueConstraints": {} + }, + "votes": { + "name": "votes", "schema": "", "columns": { "id": { @@ -97,16 +712,57 @@ "primaryKey": true, "notNull": true }, - "nickname": { - "name": "nickname", + "user_id": { + "name": "user_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true + }, + "generation_id": { + "name": "generation_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} + "foreignKeys": { + "votes_user_id_users_id_fk": { + "name": "votes_user_id_users_id_fk", + "tableFrom": "votes", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "votes_generation_id_generations_id_fk": { + "name": "votes_generation_id_generations_id_fk", + "tableFrom": "votes", + "tableTo": "generations", + "columnsFrom": [ + "generation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} } }, "enums": {}, @@ -114,8 +770,6 @@ "_meta": { "schemas": {}, "tables": {}, - "columns": { - "\"users\".\"full_name\"": "\"users\".\"nickname\"" - } + "columns": {} } } \ No newline at end of file diff --git a/packages/database/drizzle/meta/0002_snapshot.json b/packages/database/drizzle/meta/0002_snapshot.json deleted file mode 100644 index 7e46f79f..00000000 --- a/packages/database/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "f0af0a7c-196f-42a8-af79-38eef438be75", - "prevId": "b754f4bb-b2d8-4334-a6c6-081f2213737a", - "tables": { - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0003_snapshot.json b/packages/database/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 7fcdee7b..00000000 --- a/packages/database/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,337 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "b55a3ede-4572-47a2-a642-859ce12386db", - "prevId": "f0af0a7c-196f-42a8-af79-38eef438be75", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "first_question_id": { - "name": "first_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "second_question_id": { - "name": "second_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "third_question_id": { - "name": "third_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_first_question_id_questions_id_fk": { - "name": "games_first_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "first_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_second_question_id_questions_id_fk": { - "name": "games_second_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "second_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_third_question_id_questions_id_fk": { - "name": "games_third_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "third_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0004_snapshot.json b/packages/database/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 57751504..00000000 --- a/packages/database/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,337 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "0f5558c8-7406-4a51-a71f-a9f5f71e1110", - "prevId": "b55a3ede-4572-47a2-a642-859ce12386db", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "first_question_id": { - "name": "first_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "second_question_id": { - "name": "second_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "third_question_id": { - "name": "third_question_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_first_question_id_questions_id_fk": { - "name": "games_first_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "first_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_second_question_id_questions_id_fk": { - "name": "games_second_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "second_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "games_third_question_id_questions_id_fk": { - "name": "games_third_question_id_questions_id_fk", - "tableFrom": "games", - "tableTo": "questions", - "columnsFrom": [ - "third_question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0005_snapshot.json b/packages/database/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 1dcbf360..00000000 --- a/packages/database/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "f56a7d34-3361-4bab-883d-065ac8eb6d78", - "prevId": "0f5558c8-7406-4a51-a71f-a9f5f71e1110", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0006_snapshot.json b/packages/database/drizzle/meta/0006_snapshot.json deleted file mode 100644 index f5edb89c..00000000 --- a/packages/database/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,375 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "7549100f-2349-4015-81c8-4b2fd04a36cd", - "prevId": "f56a7d34-3361-4bab-883d-065ac8eb6d78", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0007_snapshot.json b/packages/database/drizzle/meta/0007_snapshot.json deleted file mode 100644 index ec78ca99..00000000 --- a/packages/database/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,421 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "963d6bfe-75f4-4fff-8f27-2447f0a6bbd1", - "prevId": "7549100f-2349-4015-81c8-4b2fd04a36cd", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "voted_on": { - "name": "voted_on", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0008_snapshot.json b/packages/database/drizzle/meta/0008_snapshot.json deleted file mode 100644 index f7a71ff9..00000000 --- a/packages/database/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,421 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "5d9fd2a0-db95-43cf-8400-9523dbf08273", - "prevId": "963d6bfe-75f4-4fff-8f27-2447f0a6bbd1", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "voted_on": { - "name": "voted_on", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0009_snapshot.json b/packages/database/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 88921dd0..00000000 --- a/packages/database/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "6c869f66-67ae-4cad-a04b-e0f2a1e51797", - "prevId": "5d9fd2a0-db95-43cf-8400-9523dbf08273", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "voted_on": { - "name": "voted_on", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "user_games": { - "name": "user_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "user_games_user_id_users_id_fk": { - "name": "user_games_user_id_users_id_fk", - "tableFrom": "user_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_games_game_id_games_id_fk": { - "name": "user_games_game_id_games_id_fk", - "tableFrom": "user_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_games_user_id_game_id": { - "name": "user_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - } - }, - "user_rooms": { - "name": "user_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_rooms_user_id_users_id_fk": { - "name": "user_rooms_user_id_users_id_fk", - "tableFrom": "user_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "user_rooms_room_code_rooms_code_fk": { - "name": "user_rooms_room_code_rooms_code_fk", - "tableFrom": "user_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_rooms_user_id_room_code": { - "name": "user_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - } - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0010_snapshot.json b/packages/database/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 68a65dbb..00000000 --- a/packages/database/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "5c4cb7b1-55a3-4cad-b498-7bb3614045a2", - "prevId": "6c869f66-67ae-4cad-a04b-e0f2a1e51797", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "voted_on": { - "name": "voted_on", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_games": { - "name": "users_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_games_user_id_users_id_fk": { - "name": "users_games_user_id_users_id_fk", - "tableFrom": "users_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_games_game_id_games_id_fk": { - "name": "users_games_game_id_games_id_fk", - "tableFrom": "users_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_games_user_id_game_id": { - "name": "users_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_rooms": { - "name": "users_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_rooms_user_id_users_id_fk": { - "name": "users_rooms_user_id_users_id_fk", - "tableFrom": "users_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_rooms_room_code_rooms_code_fk": { - "name": "users_rooms_room_code_rooms_code_fk", - "tableFrom": "users_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_rooms_user_id_room_code": { - "name": "users_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"user_games\"": "\"users_games\"", - "\"user_rooms\"": "\"users_rooms\"" - }, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0011_snapshot.json b/packages/database/drizzle/meta/0011_snapshot.json deleted file mode 100644 index afa475d8..00000000 --- a/packages/database/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "0978ada5-a2e3-4ddd-9e4f-e82f08b639a7", - "prevId": "5c4cb7b1-55a3-4cad-b498-7bb3614045a2", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "voted_on": { - "name": "voted_on", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"users_games\"": "\"users_to_games\"", - "\"users_rooms\"": "\"users_to_rooms\"" - }, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0012_snapshot.json b/packages/database/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 18a0df9d..00000000 --- a/packages/database/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,485 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "cc74bb0d-f595-4f49-97cf-6138b6c3c48b", - "prevId": "0978ada5-a2e3-4ddd-9e4f-e82f08b639a7", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0013_snapshot.json b/packages/database/drizzle/meta/0013_snapshot.json deleted file mode 100644 index 77682fce..00000000 --- a/packages/database/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "c3ce7600-ff19-4bc1-8070-840149ce628b", - "prevId": "cc74bb0d-f595-4f49-97cf-6138b6c3c48b", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0014_snapshot.json b/packages/database/drizzle/meta/0014_snapshot.json deleted file mode 100644 index 71155bea..00000000 --- a/packages/database/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,613 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "8183c16c-8443-4022-82f5-16c032d73575", - "prevId": "c3ce7600-ff19-4bc1-8070-840149ce628b", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_game_id_games_id_fk": { - "name": "questions_game_id_games_id_fk", - "tableFrom": "questions", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_1_users_id_fk": { - "name": "questions_player_1_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_player_2_users_id_fk": { - "name": "questions_player_2_users_id_fk", - "tableFrom": "questions", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0015_snapshot.json b/packages/database/drizzle/meta/0015_snapshot.json deleted file mode 100644 index 5f872673..00000000 --- a/packages/database/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,549 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "9ca8f46e-bc2c-4fce-9b69-40cef729948d", - "prevId": "8183c16c-8443-4022-82f5-16c032d73575", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0016_snapshot.json b/packages/database/drizzle/meta/0016_snapshot.json deleted file mode 100644 index 37f68cf9..00000000 --- a/packages/database/drizzle/meta/0016_snapshot.json +++ /dev/null @@ -1,556 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "3202feed-f2d9-4372-a48b-d55ece7c1bef", - "prevId": "9ca8f46e-bc2c-4fce-9b69-40cef729948d", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "regeneration_count": { - "name": "regeneration_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0017_snapshot.json b/packages/database/drizzle/meta/0017_snapshot.json deleted file mode 100644 index f67e189b..00000000 --- a/packages/database/drizzle/meta/0017_snapshot.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "9036cd8d-8cc3-49fe-8913-9d2d9aca4b6d", - "prevId": "3202feed-f2d9-4372-a48b-d55ece7c1bef", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "regeneration_count": { - "name": "regeneration_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0018_snapshot.json b/packages/database/drizzle/meta/0018_snapshot.json deleted file mode 100644 index f78a8613..00000000 --- a/packages/database/drizzle/meta/0018_snapshot.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "9ce8536e-8d91-4faa-a444-c62347ed2abc", - "prevId": "9036cd8d-8cc3-49fe-8913-9d2d9aca4b6d", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "selected": { - "name": "selected", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/0019_snapshot.json b/packages/database/drizzle/meta/0019_snapshot.json deleted file mode 100644 index 99d58fb6..00000000 --- a/packages/database/drizzle/meta/0019_snapshot.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "id": "07cdecd1-ba81-41cc-ba2b-eb0f56f99c87", - "prevId": "9ce8536e-8d91-4faa-a444-c62347ed2abc", - "tables": { - "games": { - "name": "games", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "completed_at": { - "name": "completed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "games_room_code_rooms_code_fk": { - "name": "games_room_code_rooms_code_fk", - "tableFrom": "games", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "generations": { - "name": "generations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "selected": { - "name": "selected", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "generations_user_id_users_id_fk": { - "name": "generations_user_id_users_id_fk", - "tableFrom": "generations", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_game_id_games_id_fk": { - "name": "generations_game_id_games_id_fk", - "tableFrom": "generations", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "generations_question_id_questions_id_fk": { - "name": "generations_question_id_questions_id_fk", - "tableFrom": "generations", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions": { - "name": "questions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "questions_to_games": { - "name": "questions_to_games", - "schema": "", - "columns": { - "question_id": { - "name": "question_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "round": { - "name": "round", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_1": { - "name": "player_1", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "player_2": { - "name": "player_2", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "questions_to_games_question_id_questions_id_fk": { - "name": "questions_to_games_question_id_questions_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "questions", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_game_id_games_id_fk": { - "name": "questions_to_games_game_id_games_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_1_users_id_fk": { - "name": "questions_to_games_player_1_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_1" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "questions_to_games_player_2_users_id_fk": { - "name": "questions_to_games_player_2_users_id_fk", - "tableFrom": "questions_to_games", - "tableTo": "users", - "columnsFrom": [ - "player_2" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "questions_to_games_game_id_question_id": { - "name": "questions_to_games_game_id_question_id", - "columns": [ - "game_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "rooms": { - "name": "rooms", - "schema": "", - "columns": { - "code": { - "name": "code", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "host_id": { - "name": "host_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "rooms_host_id_users_id_fk": { - "name": "rooms_host_id_users_id_fk", - "tableFrom": "rooms", - "tableTo": "users", - "columnsFrom": [ - "host_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "nickname": { - "name": "nickname", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "users_to_games": { - "name": "users_to_games", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "game_id": { - "name": "game_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "points": { - "name": "points", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_games_user_id_users_id_fk": { - "name": "users_to_games_user_id_users_id_fk", - "tableFrom": "users_to_games", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_games_game_id_games_id_fk": { - "name": "users_to_games_game_id_games_id_fk", - "tableFrom": "users_to_games", - "tableTo": "games", - "columnsFrom": [ - "game_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_games_user_id_game_id": { - "name": "users_to_games_user_id_game_id", - "columns": [ - "user_id", - "game_id" - ] - } - }, - "uniqueConstraints": {} - }, - "users_to_rooms": { - "name": "users_to_rooms", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "room_code": { - "name": "room_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_rooms_user_id_users_id_fk": { - "name": "users_to_rooms_user_id_users_id_fk", - "tableFrom": "users_to_rooms", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_rooms_room_code_rooms_code_fk": { - "name": "users_to_rooms_room_code_rooms_code_fk", - "tableFrom": "users_to_rooms", - "tableTo": "rooms", - "columnsFrom": [ - "room_code" - ], - "columnsTo": [ - "code" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_rooms_user_id_room_code": { - "name": "users_to_rooms_user_id_room_code", - "columns": [ - "user_id", - "room_code" - ] - } - }, - "uniqueConstraints": {} - }, - "votes": { - "name": "votes", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "generation_id": { - "name": "generation_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "votes_user_id_users_id_fk": { - "name": "votes_user_id_users_id_fk", - "tableFrom": "votes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "votes_generation_id_generations_id_fk": { - "name": "votes_generation_id_generations_id_fk", - "tableFrom": "votes", - "tableTo": "generations", - "columnsFrom": [ - "generation_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/packages/database/drizzle/meta/_journal.json b/packages/database/drizzle/meta/_journal.json index 5e770a30..f30bb2d2 100644 --- a/packages/database/drizzle/meta/_journal.json +++ b/packages/database/drizzle/meta/_journal.json @@ -5,141 +5,15 @@ { "idx": 0, "version": "5", - "when": 1682983940417, - "tag": "0000_brief_hobgoblin", - "breakpoints": false - }, - { - "idx": 1, - "version": "5", - "when": 1683072927231, - "tag": "0001_clever_microchip", - "breakpoints": false - }, - { - "idx": 2, - "version": "5", - "when": 1684201994919, - "tag": "0002_worthless_the_call", - "breakpoints": false - }, - { - "idx": 3, - "version": "5", - "when": 1686745688011, - "tag": "0003_faulty_madame_hydra", - "breakpoints": false - }, - { - "idx": 4, - "version": "5", - "when": 1686789807906, - "tag": "0004_late_warbird", - "breakpoints": false - }, - { - "idx": 5, - "version": "5", - "when": 1687103173783, - "tag": "0005_silly_zzzax", - "breakpoints": false - }, - { - "idx": 6, - "version": "5", - "when": 1687183498382, - "tag": "0006_happy_reaper", - "breakpoints": false - }, - { - "idx": 7, - "version": "5", - "when": 1687910108723, - "tag": "0007_young_gauntlet", - "breakpoints": false - }, - { - "idx": 8, - "version": "5", - "when": 1687913822823, - "tag": "0008_striped_smasher", - "breakpoints": false - }, - { - "idx": 9, - "version": "5", - "when": 1688989889781, - "tag": "0009_flippant_peter_quill", - "breakpoints": false - }, - { - "idx": 10, - "version": "5", - "when": 1689164934381, - "tag": "0010_productive_stepford_cuckoos", - "breakpoints": true - }, - { - "idx": 11, - "version": "5", - "when": 1689206614544, - "tag": "0011_dear_zeigeist", - "breakpoints": true - }, - { - "idx": 12, - "version": "5", - "when": 1689901388438, - "tag": "0012_simple_dracula", - "breakpoints": true - }, - { - "idx": 13, - "version": "5", - "when": 1690161874322, - "tag": "0013_spooky_nitro", - "breakpoints": true - }, - { - "idx": 14, - "version": "5", - "when": 1690287046231, - "tag": "0014_happy_malice", - "breakpoints": true - }, - { - "idx": 15, - "version": "5", - "when": 1690287262008, - "tag": "0015_nifty_earthquake", - "breakpoints": true - }, - { - "idx": 16, - "version": "5", - "when": 1691193138475, - "tag": "0016_violet_electro", - "breakpoints": true - }, - { - "idx": 17, - "version": "5", - "when": 1691244559328, - "tag": "0017_nostalgic_northstar", - "breakpoints": true - }, - { - "idx": 18, - "version": "5", - "when": 1693183820410, - "tag": "0018_late_thor", + "when": 1694287910298, + "tag": "0000_rainy_hellion", "breakpoints": true }, { - "idx": 19, + "idx": 1, "version": "5", - "when": 1693755517659, - "tag": "0019_brainy_vector", + "when": 1694300360287, + "tag": "0001_shallow_moonstone", "breakpoints": true } ] diff --git a/packages/database/index.ts b/packages/database/index.ts index 32f0674b..ea0ad373 100644 --- a/packages/database/index.ts +++ b/packages/database/index.ts @@ -1,9 +1,9 @@ -import { drizzle } from "drizzle-orm/node-postgres"; -import { Pool } from "pg"; +import { drizzle } from "drizzle-orm/postgres-js"; +import postgres from "postgres"; -const pool = new Pool({ - connectionString: process.env.DATABASE_URL, -}); +const client = postgres( + process.env.POSTGRES_URL ?? process.env.DATABASE_URL ?? "" +); -export const db = drizzle(pool); +export const db = drizzle(client); export * from "./schema"; diff --git a/packages/database/migrate.ts b/packages/database/migrate.ts index 65e4cafb..9ae6e20a 100644 --- a/packages/database/migrate.ts +++ b/packages/database/migrate.ts @@ -1,22 +1,22 @@ -import { migrate } from "drizzle-orm/node-postgres/migrator"; +import { drizzle } from "drizzle-orm/postgres-js"; +import { migrate } from "drizzle-orm/postgres-js/migrator"; import dotenv from "dotenv"; - -import { Pool } from "pg"; -import { drizzle } from "drizzle-orm/node-postgres"; +import postgres from "postgres"; // Load .env file before importing db dotenv.config(); -const pool = new Pool({ - connectionString: process.env.DATABASE_URL, -}); +const client = postgres( + process.env.POSTGRES_URL ?? process.env.DATABASE_URL ?? "" +); -const migrationDB = drizzle(pool); +const migrationDB = drizzle(client); async function runDatabaseMigrations() { try { await migrate(migrationDB, { migrationsFolder: "./drizzle" }); console.log("Migration completed! ✅"); + process.exit(); } catch (error) { console.error("Migration failed! ❌"); console.error(error); diff --git a/packages/database/package.json b/packages/database/package.json index d3e4f818..f98a7cca 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,28 +1,29 @@ { - "name": "database", - "version": "0.0.0", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "dist/**" - ], - "scripts": { - "build": "tsc", - "dev": "tsc --watch", - "migrate:create": "drizzle-kit generate:pg --out drizzle --schema schema.ts", - "migrate:run": "ts-node migrate.ts" - }, - "dependencies": { - "dotenv": "^16.3.1", - "drizzle-orm": "^0.28.5", - "pg": "^8.11.3" - }, - "devDependencies": { - "@types/pg": "^8.10.2", - "drizzle-kit": "^0.19.13", - "eslint-config-custom": "workspace:*", - "ts-node": "^10.9.1", - "tsconfig": "workspace:*", - "typescript": "^5.2.2" - } + "name": "database", + "version": "0.0.0", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/**" + ], + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "db:push": "drizzle-kit push:pg --schema schema.ts", + "db:migrate:create": "drizzle-kit generate:pg --out drizzle --schema schema.ts", + "db:migrate:run": "ts-node migrate.ts" + }, + "dependencies": { + "dotenv": "^16.3.1", + "drizzle-orm": "^0.28.6", + "postgres": "^3.3.5" + }, + "devDependencies": { + "@auth/core": "^0.14.0", + "drizzle-kit": "^0.19.13", + "eslint-config-custom": "workspace:*", + "ts-node": "^10.9.1", + "tsconfig": "workspace:*", + "typescript": "^5.2.2" + } } \ No newline at end of file diff --git a/packages/database/schema.ts b/packages/database/schema.ts index fd1f82a7..f4c802e0 100644 --- a/packages/database/schema.ts +++ b/packages/database/schema.ts @@ -1,4 +1,3 @@ -import { InferModel } from "drizzle-orm"; import { boolean, integer, @@ -8,23 +7,70 @@ import { text, timestamp, } from "drizzle-orm/pg-core"; +import type { AdapterAccount } from "@auth/core/adapters"; export const users = pgTable("users", { - id: serial("id").primaryKey(), + id: text("id").notNull().primaryKey(), nickname: text("nickname").notNull(), + name: text("name"), + email: text("email").notNull(), + emailVerified: timestamp("email_verified", { mode: "date" }), + image: text("image"), createdAt: timestamp("created_at").defaultNow().notNull(), }); +export const accounts = pgTable( + "accounts", + { + userId: text("user_id") + .notNull() + .references(() => users.id, { onDelete: "cascade" }), + type: text("type").$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(account.provider, account.providerAccountId), + }) +); + +export const sessions = pgTable("sessions", { + sessionToken: text("session_token").notNull().primaryKey(), + userId: text("user_id") + .notNull() + .references(() => users.id, { onDelete: "cascade" }), + expires: timestamp("expires", { mode: "date" }).notNull(), +}); + +export const verificationTokens = pgTable( + "verification_tokens", + { + identifier: text("identifier").notNull(), + token: text("token").notNull(), + expires: timestamp("expires", { mode: "date" }).notNull(), + }, + (vt) => ({ + compoundKey: primaryKey(vt.identifier, vt.token), + }) +); + export const rooms = pgTable("rooms", { code: text("code").primaryKey(), - hostId: integer("host_id").references(() => users.id), + hostId: text("host_id").references(() => users.id), createdAt: timestamp("created_at").defaultNow().notNull(), }); export const usersToRooms = pgTable( "users_to_rooms", { - userId: integer("user_id") + userId: text("user_id") .references(() => users.id) .notNull(), roomCode: text("room_code") @@ -64,10 +110,10 @@ export const questionsToGames = pgTable( .references(() => games.id) .notNull(), round: integer("round").notNull(), - player1: integer("player_1") + player1: text("player_1") .references(() => users.id) .notNull(), - player2: integer("player_2") + player2: text("player_2") .references(() => users.id) .notNull(), createdAt: timestamp("created_at").defaultNow().notNull(), @@ -79,7 +125,7 @@ export const questionsToGames = pgTable( export const generations = pgTable("generations", { id: serial("id").primaryKey(), - userId: integer("user_id") + userId: text("user_id") .references(() => users.id) .notNull(), gameId: integer("game_id") @@ -96,7 +142,7 @@ export const generations = pgTable("generations", { export const votes = pgTable("votes", { id: serial("id").primaryKey(), - userId: integer("user_id") + userId: text("user_id") .references(() => users.id) .notNull(), generationId: integer("generation_id") @@ -108,7 +154,7 @@ export const votes = pgTable("votes", { export const usersToGames = pgTable( "users_to_games", { - userId: integer("user_id") + userId: text("user_id") .references(() => users.id) .notNull(), gameId: integer("game_id") @@ -121,32 +167,35 @@ export const usersToGames = pgTable( }) ); -export type User = InferModel; -export type NewUser = InferModel; +export type User = typeof users.$inferInsert; +export type NewUser = typeof users.$inferInsert; -export type Room = InferModel; -export type NewRoom = InferModel; +export type Room = typeof rooms.$inferSelect; +export type NewRoom = typeof rooms.$inferInsert; export type RoomInfo = { - hostId: number | null; + hostId: string | null; code: string; createdAt: Date; players: User[]; }; -export type UserRoom = InferModel; -export type NewUserRoom = InferModel; +export type UserRoom = typeof usersToRooms.$inferSelect; +export type NewUserRoom = typeof usersToRooms.$inferInsert; + +export type Question = typeof questions.$inferSelect; +export type NewQuestion = typeof questions.$inferInsert; -export type Question = InferModel; -export type NewQuestion = InferModel; +export type Game = typeof games.$inferSelect; +export type NewGame = typeof games.$inferInsert; -export type Game = InferModel; -export type NewGame = InferModel; +export type QuestionToGame = typeof questionsToGames.$inferSelect; +export type NewQuestionToGame = typeof questionsToGames.$inferInsert; -export type QuestionToGame = InferModel; -export type NewQuestionToGame = InferModel; +export type Generation = typeof generations.$inferSelect; +export type NewGeneration = typeof generations.$inferInsert; -export type Generation = InferModel; -export type NewGeneration = InferModel; +export type Vote = typeof votes.$inferSelect; +export type NewVote = typeof votes.$inferInsert; -export type Vote = InferModel; -export type NewVote = InferModel; +export type UserGame = typeof usersToGames.$inferSelect; +export type NewUserGame = typeof games.$inferInsert; diff --git a/packages/tsconfig/nextjs.json b/packages/tsconfig/nextjs.json index b0a1a034..32bf9256 100644 --- a/packages/tsconfig/nextjs.json +++ b/packages/tsconfig/nextjs.json @@ -22,7 +22,7 @@ "noEmit": true, "resolveJsonModule": true, "strict": false, - "target": "es5" + "target": "es6" }, "include": [ "src", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebc468c5..99b845d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,20 +18,23 @@ importers: specifier: workspace:* version: link:packages/tsconfig turbo: - specifier: ^1.10.12 - version: 1.10.12 + specifier: ^1.10.13 + version: 1.10.13 apps/client: dependencies: + '@auth/drizzle-adapter': + specifier: ^0.3.2 + version: 0.3.2 '@sentry/nextjs': - specifier: ^7.65.0 - version: 7.65.0(next@13.4.19)(react@18.2.0) + specifier: ^7.68.0 + version: 7.68.0(next@13.4.19)(react@18.2.0) '@tanstack/react-query': - specifier: ^4.33.0 - version: 4.33.0(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.35.0 + version: 4.35.0(react-dom@18.2.0)(react@18.2.0) '@upstash/ratelimit': - specifier: ^0.4.3 - version: 0.4.3 + specifier: ^0.4.4 + version: 0.4.4 '@vercel/analytics': specifier: ^1.0.2 version: 1.0.2 @@ -47,15 +50,24 @@ importers: clsx: specifier: ^2.0.0 version: 2.0.0 + database: + specifier: workspace:* + version: link:../../packages/database + drizzle-orm: + specifier: ^0.28.6 + version: 0.28.6(postgres@3.3.5) framer-motion: - specifier: ^10.16.1 - version: 10.16.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^10.16.4 + version: 10.16.4(react-dom@18.2.0)(react@18.2.0) next: specifier: ^13.4.19 version: 13.4.19(react-dom@18.2.0)(react@18.2.0) + next-auth: + specifier: ^4.23.1 + version: 4.23.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0) openai: - specifier: ^4.3.1 - version: 4.3.1 + specifier: ^4.6.0 + version: 4.6.0 postcss: specifier: 8.4.29 version: 8.4.29 @@ -69,8 +81,8 @@ importers: specifier: ^2.4.1 version: 2.4.1(csstype@3.1.2)(react-dom@18.2.0)(react@18.2.0) react-icons: - specifier: ^4.10.1 - version: 4.10.1(react@18.2.0) + specifier: ^4.11.0 + version: 4.11.0(react@18.2.0) sharp: specifier: ^0.32.5 version: 0.32.5 @@ -89,9 +101,6 @@ importers: xstate: specifier: ^4.38.2 version: 4.38.2 - zustand: - specifier: ^4.4.1 - version: 4.4.1(@types/react@18.2.21)(react@18.2.0) optionalDependencies: bufferutil: specifier: ^4.0.7 @@ -103,12 +112,15 @@ importers: '@playwright/test': specifier: ^1.37.1 version: 1.37.1 + '@tailwindcss/forms': + specifier: ^0.5.6 + version: 0.5.6(tailwindcss@3.3.3) '@tailwindcss/typography': - specifier: ^0.5.9 - version: 0.5.9(tailwindcss@3.3.3) + specifier: ^0.5.10 + version: 0.5.10(tailwindcss@3.3.3) '@types/node': - specifier: ^20.5.7 - version: 20.5.7 + specifier: ^20.6.0 + version: 20.6.0 '@types/react': specifier: ^18.2.21 version: 18.2.21 @@ -119,8 +131,8 @@ importers: specifier: workspace:* version: link:../../packages/eslint-config-custom prettier-plugin-tailwindcss: - specifier: ^0.5.3 - version: 0.5.3(prettier@3.0.3) + specifier: ^0.5.4 + version: 0.5.4(prettier@3.0.3) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig @@ -128,8 +140,11 @@ importers: apps/server: dependencies: '@sentry/node': - specifier: ^7.65.0 - version: 7.65.0 + specifier: ^7.68.0 + version: 7.68.0 + cookie-parser: + specifier: ^1.4.6 + version: 1.4.6 cors: specifier: ^2.8.5 version: 2.8.5 @@ -140,11 +155,14 @@ importers: specifier: ^16.3.1 version: 16.3.1 drizzle-orm: - specifier: ^0.28.5 - version: 0.28.5(@types/pg@8.10.2)(pg@8.11.3) + specifier: ^0.28.6 + version: 0.28.6(postgres@3.3.5) express: specifier: ^4.18.2 version: 4.18.2 + express-rate-limit: + specifier: ^6.11.0 + version: 6.11.0(express@4.18.2) helmet: specifier: ^7.0.0 version: 7.0.0 @@ -166,11 +184,14 @@ importers: specifier: ^29.6.4 version: 29.6.4 '@sentry/cli': - specifier: ^2.20.5 - version: 2.20.5 + specifier: ^2.20.7 + version: 2.20.7 + '@types/cookie-parser': + specifier: ^1.4.4 + version: 1.4.4 '@types/cors': - specifier: ^2.8.13 - version: 2.8.13 + specifier: ^2.8.14 + version: 2.8.14 '@types/express': specifier: ^4.17.17 version: 4.17.17 @@ -178,8 +199,8 @@ importers: specifier: ^1.9.5 version: 1.9.5 '@types/node': - specifier: ^20.5.7 - version: 20.5.7 + specifier: ^20.6.0 + version: 20.6.0 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -188,16 +209,16 @@ importers: version: link:../../packages/eslint-config-custom jest: specifier: ^29.6.4 - version: 29.6.4(@types/node@20.5.7)(ts-node@10.9.1) + version: 29.6.4(@types/node@20.6.0)(ts-node@10.9.1) nodemon: specifier: ^3.0.1 version: 3.0.1 ts-jest: specifier: ^29.1.1 - version: 29.1.1(@babel/core@7.22.11)(jest@29.6.4)(typescript@5.2.2) + version: 29.1.1(@babel/core@7.22.17)(jest@29.6.4)(typescript@5.2.2) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@20.5.7)(typescript@5.2.2) + version: 10.9.1(@types/node@20.6.0)(typescript@5.2.2) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig @@ -211,15 +232,15 @@ importers: specifier: ^16.3.1 version: 16.3.1 drizzle-orm: - specifier: ^0.28.5 - version: 0.28.5(@types/pg@8.10.2)(pg@8.11.3) - pg: - specifier: ^8.11.3 - version: 8.11.3 + specifier: ^0.28.6 + version: 0.28.6(postgres@3.3.5) + postgres: + specifier: ^3.3.5 + version: 3.3.5 devDependencies: - '@types/pg': - specifier: ^8.10.2 - version: 8.10.2 + '@auth/core': + specifier: ^0.14.0 + version: 0.14.0 drizzle-kit: specifier: ^0.19.13 version: 0.19.13 @@ -228,7 +249,7 @@ importers: version: link:../eslint-config-custom ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@20.5.7)(typescript@5.2.2) + version: 10.9.1(@types/node@20.6.0)(typescript@5.2.2) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -240,19 +261,19 @@ importers: devDependencies: '@typescript-eslint/eslint-plugin': specifier: ^6.5.0 - version: 6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.2.2) + version: 6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.49.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: ^6.5.0 - version: 6.5.0(eslint@8.48.0)(typescript@5.2.2) + version: 6.5.0(eslint@8.49.0)(typescript@5.2.2) eslint-config-next: specifier: ^13.4.19 - version: 13.4.19(eslint@8.48.0)(typescript@5.2.2) + version: 13.4.19(eslint@8.49.0)(typescript@5.2.2) eslint-config-prettier: specifier: ^9.0.0 - version: 9.0.0(eslint@8.48.0) + version: 9.0.0(eslint@8.49.0) eslint-config-turbo: specifier: ^1.10.12 - version: 1.10.12(eslint@8.48.0) + version: 1.10.12(eslint@8.49.0) packages/tsconfig: {} @@ -275,6 +296,46 @@ packages: '@jridgewell/trace-mapping': 0.3.19 dev: true + /@auth/core@0.12.0: + resolution: {integrity: sha512-XYipdAc/nKu014VOgpcPyLlj1ghWlnwyloaB1UjQd9ElZRZQ9YpSizzXGLON23t/a0FyabOBBl0/awD2tW58Rg==} + peerDependencies: + nodemailer: ^6.8.0 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.14.6 + oauth4webapi: 2.3.0 + preact: 10.11.3 + preact-render-to-string: 5.2.3(preact@10.11.3) + dev: false + + /@auth/core@0.14.0: + resolution: {integrity: sha512-kZMwjFWDGxSI/e4+HO6KeTmuMFMWu6qIzgF1k87HbKdxNFis3K1PXz7md3fCB4+5ije93Uld1ZNUdlmB2rAHww==} + peerDependencies: + nodemailer: ^6.8.0 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.14.6 + oauth4webapi: 2.3.0 + preact: 10.11.3 + preact-render-to-string: 5.2.3(preact@10.11.3) + dev: true + + /@auth/drizzle-adapter@0.3.2: + resolution: {integrity: sha512-fHfzwaTomm/RKgFKBO5AJ8JTfR44rX1KX2ASaKRk+4jvVhDh9FCir5BV1Fv68b5ay7XBo9DtcNSQuZp4hbpLYw==} + dependencies: + '@auth/core': 0.12.0 + transitivePeerDependencies: + - nodemailer + dev: false + /@babel/code-frame@7.22.13: resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} engines: {node: '>=6.9.0'} @@ -288,20 +349,20 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.22.11: - resolution: {integrity: sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==} + /@babel/core@7.22.17: + resolution: {integrity: sha512-2EENLmhpwplDux5PSsZnSbnSkB3tZ6QTksgO25xwEL7pIDcNOMhF5v/s6RzwjMZzZzw9Ofc30gHv5ChCC8pifQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.13 - '@babel/generator': 7.22.10 - '@babel/helper-compilation-targets': 7.22.10 - '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.11) - '@babel/helpers': 7.22.11 - '@babel/parser': 7.22.14 - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.11 - '@babel/types': 7.22.11 + '@babel/generator': 7.22.15 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.22.17(@babel/core@7.22.17) + '@babel/helpers': 7.22.15 + '@babel/parser': 7.22.16 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.17 + '@babel/types': 7.22.17 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -311,22 +372,22 @@ packages: - supports-color dev: true - /@babel/generator@7.22.10: - resolution: {integrity: sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==} + /@babel/generator@7.22.15: + resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets@7.22.10: - resolution: {integrity: sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==} + /@babel/helper-compilation-targets@7.22.15: + resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} engines: {node: '>=6.9.0'} dependencies: '@babel/compat-data': 7.22.9 - '@babel/helper-validator-option': 7.22.5 + '@babel/helper-validator-option': 7.22.15 browserslist: 4.21.10 lru-cache: 5.1.1 semver: 6.3.1 @@ -341,36 +402,36 @@ packages: resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.11 + '@babel/template': 7.22.15 + '@babel/types': 7.22.17 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true - /@babel/helper-module-imports@7.22.5: - resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true - /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.11): - resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} + /@babel/helper-module-transforms@7.22.17(@babel/core@7.22.17): + resolution: {integrity: sha512-XouDDhQESrLHTpnBtCKExJdyY4gJCdrvH2Pyv8r8kovX2U8G0dRUOT45T9XlbLtuu9CLXP15eusnkprhoPV5iQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-environment-visitor': 7.22.5 - '@babel/helper-module-imports': 7.22.5 + '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.15 dev: true /@babel/helper-plugin-utils@7.22.5: @@ -382,14 +443,14 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true /@babel/helper-string-parser@7.22.5: @@ -397,23 +458,23 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-identifier@7.22.5: - resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} + /@babel/helper-validator-identifier@7.22.15: + resolution: {integrity: sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.22.5: - resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} + /@babel/helper-validator-option@7.22.15: + resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.22.11: - resolution: {integrity: sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==} + /@babel/helpers@7.22.15: + resolution: {integrity: sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.11 - '@babel/types': 7.22.11 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.17 + '@babel/types': 7.22.17 transitivePeerDependencies: - supports-color dev: true @@ -422,145 +483,145 @@ packages: resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.15 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/parser@7.22.14: - resolution: {integrity: sha512-1KucTHgOvaw/LzCVrEOAyXkr9rQlp0A1HiHRYnSUE9dmb8PvPW7o5sscg+5169r54n3vGlbx6GevTE/Iw/P3AQ==} + /@babel/parser@7.22.16: + resolution: {integrity: sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.11): + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.17): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.11): + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.17): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.11): + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.17): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.11): + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.17): resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.11): + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.17): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.11): + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.17): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.11): + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.17): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.11): + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.17): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.11): + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.17): resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@babel/helper-plugin-utils': 7.22.5 dev: true @@ -571,39 +632,46 @@ packages: regenerator-runtime: 0.14.0 dev: true - /@babel/template@7.22.5: - resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} + /@babel/runtime@7.22.15: + resolution: {integrity: sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.0 + dev: false + + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.13 - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.17 dev: true - /@babel/traverse@7.22.11: - resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} + /@babel/traverse@7.22.17: + resolution: {integrity: sha512-xK4Uwm0JnAMvxYZxOVecss85WxTEIbTa7bnGyf/+EgCL5Zt3U7htUpEOWv9detPlamGKuRzCqw74xVglDWpPdg==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.13 - '@babel/generator': 7.22.10 + '@babel/generator': 7.22.15 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.17 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.22.11: - resolution: {integrity: sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==} + /@babel/types@7.22.17: + resolution: {integrity: sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.15 to-fast-properties: 2.0.0 dev: true @@ -858,6 +926,16 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.49.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.49.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@eslint-community/regexpp@4.8.0: resolution: {integrity: sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -885,6 +963,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@eslint/js@8.49.0: + resolution: {integrity: sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@humanwhocodes/config-array@0.11.11: resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} engines: {node: '>=10.10.0'} @@ -926,7 +1009,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 jest-message-util: 29.6.3 jest-util: 29.6.3 @@ -947,14 +1030,14 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.6.3 - jest-config: 29.6.4(@types/node@20.5.7)(ts-node@10.9.1) + jest-config: 29.6.4(@types/node@20.6.0)(ts-node@10.9.1) jest-haste-map: 29.6.4 jest-message-util: 29.6.3 jest-regex-util: 29.6.3 @@ -982,7 +1065,7 @@ packages: dependencies: '@jest/fake-timers': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 jest-mock: 29.6.3 dev: true @@ -1009,7 +1092,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.5.7 + '@types/node': 20.6.0 jest-message-util: 29.6.3 jest-mock: 29.6.3 jest-util: 29.6.3 @@ -1042,7 +1125,7 @@ packages: '@jest/transform': 29.6.4 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -1104,7 +1187,7 @@ packages: resolution: {integrity: sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 babel-plugin-istanbul: 6.1.1 @@ -1130,7 +1213,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.5.7 + '@types/node': 20.6.0 '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true @@ -1276,12 +1359,15 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + /@panva/hkdf@1.1.1: + resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} + /@playwright/test@1.37.1: resolution: {integrity: sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==} engines: {node: '>=16'} hasBin: true dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 playwright-core: 1.37.1 optionalDependencies: fsevents: 2.3.2 @@ -1324,25 +1410,25 @@ packages: resolution: {integrity: sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==} dev: true - /@sentry-internal/tracing@7.65.0: - resolution: {integrity: sha512-TEYkiq5vKr1Y79YIu+UYr1sO3vEMttQOBsOZLziDbqiC7TvKUARBR4W5XWfb9qBVDeon87EFNKluW0/+7rzYWw==} + /@sentry-internal/tracing@7.68.0: + resolution: {integrity: sha512-nNKS/q21+Iqzxs2K7T/l3dZi8Z9s/uxsAazpk2AYhFzx9mFnPj1Xfe3dgbFoygNifE+IrpUuldr6D5HQamTDPQ==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.65.0 - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/core': 7.68.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 tslib: 2.6.2 dev: false - /@sentry/browser@7.65.0: - resolution: {integrity: sha512-TUzZPAXNJ/Y1yakFODYhsEtdDpLdkgjTfrx5i9MOnXQLrcRR0C4TC1KitqbP6Tv7Xha9WiR0TDZkh7gS/9RxEA==} + /@sentry/browser@7.68.0: + resolution: {integrity: sha512-1RIPLzKcBeUeG8CQc4OIRfQ6F1zmGKku1am7P9QTz0bz//Mu7bEjm75DM69LBoUlP/Ab9cQQA3fZFUvrH0j1Tg==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.65.0 - '@sentry/core': 7.65.0 - '@sentry/replay': 7.65.0 - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry-internal/tracing': 7.68.0 + '@sentry/core': 7.68.0 + '@sentry/replay': 7.68.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 tslib: 2.6.2 dev: false @@ -1363,8 +1449,8 @@ packages: - supports-color dev: false - /@sentry/cli@2.20.5: - resolution: {integrity: sha512-ZvWb86eF0QXH9C5Mbi87aUmr8SH848yEpXJmlM2AoBowpE9kKDnewCAKvyXUihojUFwCSEEjoJhrRMMgmCZqXA==} + /@sentry/cli@2.20.7: + resolution: {integrity: sha512-YaHKEUdsFt59nD8yLvuEGCOZ3/ArirL8GZ/66RkZ8wcD2wbpzOFbzo08Kz4te/Eo3OD5/RdW+1dPaOBgGbrXlA==} engines: {node: '>= 10'} hasBin: true requiresBuild: true @@ -1379,27 +1465,27 @@ packages: - supports-color dev: true - /@sentry/core@7.65.0: - resolution: {integrity: sha512-EwZABW8CtAbRGXV69FqeCqcNApA+Jbq308dko0W+MFdFe+9t2RGubUkpPxpJcbWy/dN2j4LiuENu1T7nWn0ZAQ==} + /@sentry/core@7.68.0: + resolution: {integrity: sha512-mT3ObBWgvAky/QF3dZy4KBoXbRXbNsD6evn+mYi9UEeIZQ5NpnQYDEp78mapiEjI/TAHZIhTIuaBhj1Jk0qUUA==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 tslib: 2.6.2 dev: false - /@sentry/integrations@7.65.0: - resolution: {integrity: sha512-9b54p0UrkWe9+RAWWTObJQ2k/uStqaUj7BkNFyuaxfKQ4IZViqc4Sa7d7zX2X1oynGNL3ic7iqcgVTh7NvNsAQ==} + /@sentry/integrations@7.68.0: + resolution: {integrity: sha512-kCY+rD2QD9YAatx9rFT7ndxCTigP10lWTX1qZHNKZBZqr38SvsaD3tyVpbXVPjaFR1tnpuH0osWAjY/gyjFhlw==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 localforage: 1.10.0 tslib: 2.6.2 dev: false - /@sentry/nextjs@7.65.0(next@13.4.19)(react@18.2.0): - resolution: {integrity: sha512-/Pyuf+UKyIA3GXnqRiLv6qZIT0lsN0BHAB67Is/GaQlYA+0zsqSYX24HGqAJ6U3bz+6d9W0dX5AmyVwobH9Vdg==} + /@sentry/nextjs@7.68.0(next@13.4.19)(react@18.2.0): + resolution: {integrity: sha512-CrIR6ROEQ0AoPiUTeIt1tKVX5UBEehf3ollJG7L7o3CUizC8q4vIalgnAjdj0os5Ahkdn4aQF1u6C3nT4LldWw==} engines: {node: '>=8'} peerDependencies: next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 @@ -1410,12 +1496,12 @@ packages: optional: true dependencies: '@rollup/plugin-commonjs': 24.0.0(rollup@2.78.0) - '@sentry/core': 7.65.0 - '@sentry/integrations': 7.65.0 - '@sentry/node': 7.65.0 - '@sentry/react': 7.65.0(react@18.2.0) - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/core': 7.68.0 + '@sentry/integrations': 7.68.0 + '@sentry/node': 7.68.0 + '@sentry/react': 7.68.0(react@18.2.0) + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 '@sentry/webpack-plugin': 1.20.0 chalk: 3.0.0 next: 13.4.19(react-dom@18.2.0)(react@18.2.0) @@ -1428,14 +1514,14 @@ packages: - supports-color dev: false - /@sentry/node@7.65.0: - resolution: {integrity: sha512-zRCHOO7vIQukgFdEib3X7nP7HA9Uyc/o4QMtBnAREaYKzERGRnArvaB3Na0bXsuLVCOELoCAlrzFH3apmgxBQw==} + /@sentry/node@7.68.0: + resolution: {integrity: sha512-gtcHoi6Xu6Iu8MpPgKJA4E0nozqLvYF0fKtt+27T0QBzWioO6lkxSQkKGWMyJGL0AmpLCex0E28fck/rlbt0LA==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.65.0 - '@sentry/core': 7.65.0 - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry-internal/tracing': 7.68.0 + '@sentry/core': 7.68.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 cookie: 0.4.2 https-proxy-agent: 5.0.1 lru_map: 0.3.3 @@ -1444,39 +1530,39 @@ packages: - supports-color dev: false - /@sentry/react@7.65.0(react@18.2.0): - resolution: {integrity: sha512-1ABxHwEHw5J4avUr8TBch3l7UszbNIroWergwiLPSy+EJU8WuB3Fdx0zSU+hS4Sujf8HNcRgu1JyWThZFTnIMA==} + /@sentry/react@7.68.0(react@18.2.0): + resolution: {integrity: sha512-/WLa21GKfaAlHxLZHMsYgfBac3d18UB7wB90E6zvZ+4uh7+0WQY5E1SVPpHYaQ2IEhqLbB69kVxRN+7L+A96hQ==} engines: {node: '>=8'} peerDependencies: react: 15.x || 16.x || 17.x || 18.x dependencies: - '@sentry/browser': 7.65.0 - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/browser': 7.68.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 hoist-non-react-statics: 3.3.2 react: 18.2.0 tslib: 2.6.2 dev: false - /@sentry/replay@7.65.0: - resolution: {integrity: sha512-vhlk5F9RrhMQ+gOjNlLoWXamAPLNIT6wNII1O9ae+DRhZFmiUYirP5ag6dH5lljvNZndKl+xw+lJGJ3YdjXKlQ==} + /@sentry/replay@7.68.0: + resolution: {integrity: sha512-be8QT2pxcLOTuX6HBRkK0mCVwM97dU5ZLCeofI+xJEWcRnoJdbx00nFwvBXvvoCizbtf4YIMCGwaT2k5LrVxsQ==} engines: {node: '>=12'} dependencies: - '@sentry/core': 7.65.0 - '@sentry/types': 7.65.0 - '@sentry/utils': 7.65.0 + '@sentry/core': 7.68.0 + '@sentry/types': 7.68.0 + '@sentry/utils': 7.68.0 dev: false - /@sentry/types@7.65.0: - resolution: {integrity: sha512-YYq7IDLLhpSBTmHoyWFtq/5ZDaEJ01r7xGuhB0aSIq33cm2I7im/B3ipzoOP/ukGZSIhuYVW9t531xZEO0+6og==} + /@sentry/types@7.68.0: + resolution: {integrity: sha512-5J2pH1Pjx/029zTm3CNY9MaE8Aui81nG7JCtlMp7uEfQ//9Ja4d4Sliz/kV4ARbkIKUZerSgaRAm3xCy5XOXLg==} engines: {node: '>=8'} dev: false - /@sentry/utils@7.65.0: - resolution: {integrity: sha512-2JEBf4jzRSClhp+LJpX/E3QgHEeKvXqFMeNhmwQ07qqd6szhfH2ckYFj4gXk6YiGGY4Act3C6oxLfdZovG71bw==} + /@sentry/utils@7.68.0: + resolution: {integrity: sha512-NecnQegvKARyeFmBx7mYmbI17mTvjARWs1nfzY5jhPyNc3Zk4M3bQsgIdnJ1t+jo93UYudlNND7hxhDzjcBAVg==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.65.0 + '@sentry/types': 7.68.0 tslib: 2.6.2 dev: false @@ -1517,8 +1603,17 @@ packages: tslib: 2.6.2 dev: false - /@tailwindcss/typography@0.5.9(tailwindcss@3.3.3): - resolution: {integrity: sha512-t8Sg3DyynFysV9f4JDOVISGsjazNb48AeIYQwcL+Bsq5uf4RYL75C1giZ43KISjeDGBaTN3Kxh7Xj/vRSMJUUg==} + /@tailwindcss/forms@0.5.6(tailwindcss@3.3.3): + resolution: {integrity: sha512-Fw+2BJ0tmAwK/w01tEFL5TiaJBX1NLT1/YbWgvm7ws3Qcn11kiXxzNTEQDMs5V3mQemhB56l3u0i9dwdzSQldA==} + peerDependencies: + tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1' + dependencies: + mini-svg-data-uri: 1.4.4 + tailwindcss: 3.3.3 + dev: true + + /@tailwindcss/typography@0.5.10(tailwindcss@3.3.3): + resolution: {integrity: sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==} peerDependencies: tailwindcss: '>=3.0.0 || insiders' dependencies: @@ -1529,12 +1624,12 @@ packages: tailwindcss: 3.3.3 dev: true - /@tanstack/query-core@4.33.0: - resolution: {integrity: sha512-qYu73ptvnzRh6se2nyBIDHGBQvPY1XXl3yR769B7B6mIDD7s+EZhdlWHQ67JI6UOTFRaI7wupnTnwJ3gE0Mr/g==} + /@tanstack/query-core@4.35.0: + resolution: {integrity: sha512-4GMcKQuLZQi6RFBiBZNsLhl+hQGYScRZ5ZoVq8QAzfqz9M7vcGin/2YdSESwl7WaV+Qzsb5CZOAbMBes4lNTnA==} dev: false - /@tanstack/react-query@4.33.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-97nGbmDK0/m0B86BdiXzx3EW9RcDYKpnyL2+WwyuLHEgpfThYAnXFaMMmnTDuAO4bQJXEhflumIEUfKmP7ESGA==} + /@tanstack/react-query@4.35.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-LLYDNnM9ewYHgjm2rzhk4KG/puN2rdoqCUD+N9+V7SwlsYwJk5ypX58rpkoZAhFyZ+KmFUJ7Iv2lIEOoUqydIg==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -1545,7 +1640,7 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.33.0 + '@tanstack/query-core': 4.35.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) @@ -1570,8 +1665,8 @@ packages: /@types/babel__core@7.20.1: resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} dependencies: - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.17 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.20.1 @@ -1580,43 +1675,49 @@ packages: /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.17 dev: true /@types/babel__traverse@7.20.1: resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.17 dev: true /@types/body-parser@1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: - '@types/connect': 3.4.35 - '@types/node': 20.5.7 + '@types/connect': 3.4.36 + '@types/node': 20.6.0 + dev: true + + /@types/connect@3.4.36: + resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==} + dependencies: + '@types/node': 20.6.0 dev: true - /@types/connect@3.4.35: - resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + /@types/cookie-parser@1.4.4: + resolution: {integrity: sha512-Var+aj5I6ZgIqsQ05N2V8q5OBrFfZXtIGWWDSrEYLIbMw758obagSwdGcLCjwh1Ga7M7+wj0SDIAaAC/WT7aaA==} dependencies: - '@types/node': 20.5.7 + '@types/express': 4.17.17 dev: true /@types/cookie@0.4.1: resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} dev: false - /@types/cors@2.8.13: - resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} + /@types/cors@2.8.14: + resolution: {integrity: sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ==} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 /@types/estree@1.0.1: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} @@ -1625,7 +1726,7 @@ packages: /@types/express-serve-static-core@4.17.36: resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 '@types/qs': 6.9.8 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -1643,7 +1744,7 @@ packages: /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 dev: true /@types/http-errors@2.0.1: @@ -1685,29 +1786,22 @@ packages: /@types/morgan@1.9.5: resolution: {integrity: sha512-5TgfIWm0lcTGnbCZExwc19dCOMOMmAiiBZQj8Ko3NRxsVDgRxf+AEGRQTqNVA5Yh2xfdWp4clbAEMbYP+jkOqg==} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 dev: true /@types/node-fetch@2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 form-data: 3.0.1 dev: false - /@types/node@18.17.14: - resolution: {integrity: sha512-ZE/5aB73CyGqgQULkLG87N9GnyGe5TcQjv34pwS8tfBs1IkCh0ASM69mydb2znqd6v0eX+9Ytvk6oQRqu8T1Vw==} + /@types/node@18.17.15: + resolution: {integrity: sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==} dev: false - /@types/node@20.5.7: - resolution: {integrity: sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==} - - /@types/pg@8.10.2: - resolution: {integrity: sha512-MKFs9P6nJ+LAeHLU3V0cODEOgyThJ3OAnmOlsZsxux6sfQs3HRXR5bBn7xG5DjckEFhTAxsXi7k7cd0pCMxpJw==} - dependencies: - '@types/node': 20.5.7 - pg-protocol: 1.6.0 - pg-types: 4.0.1 + /@types/node@20.6.0: + resolution: {integrity: sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==} /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} @@ -1744,7 +1838,7 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 20.5.7 + '@types/node': 20.6.0 dev: true /@types/serve-static@1.15.2: @@ -1752,7 +1846,7 @@ packages: dependencies: '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 20.5.7 + '@types/node': 20.6.0 dev: true /@types/stack-utils@2.0.1: @@ -1769,7 +1863,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.2.2): + /@typescript-eslint/eslint-plugin@6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.49.0)(typescript@5.2.2): resolution: {integrity: sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1781,13 +1875,13 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.8.0 - '@typescript-eslint/parser': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.5.0(eslint@8.49.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.5.0 - '@typescript-eslint/type-utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 6.5.0(eslint@8.49.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.5.0(eslint@8.49.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.5.0 debug: 4.3.4 - eslint: 8.48.0 + eslint: 8.49.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 @@ -1798,7 +1892,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.5.0(eslint@8.48.0)(typescript@5.2.2): + /@typescript-eslint/parser@6.5.0(eslint@8.49.0)(typescript@5.2.2): resolution: {integrity: sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1813,7 +1907,7 @@ packages: '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.5.0 debug: 4.3.4 - eslint: 8.48.0 + eslint: 8.49.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -1827,7 +1921,7 @@ packages: '@typescript-eslint/visitor-keys': 6.5.0 dev: true - /@typescript-eslint/type-utils@6.5.0(eslint@8.48.0)(typescript@5.2.2): + /@typescript-eslint/type-utils@6.5.0(eslint@8.49.0)(typescript@5.2.2): resolution: {integrity: sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1838,9 +1932,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.5.0(eslint@8.49.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.48.0 + eslint: 8.49.0 ts-api-utils: 1.0.2(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -1873,19 +1967,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.5.0(eslint@8.48.0)(typescript@5.2.2): + /@typescript-eslint/utils@6.5.0(eslint@8.49.0)(typescript@5.2.2): resolution: {integrity: sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.48.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.49.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.1 '@typescript-eslint/scope-manager': 6.5.0 '@typescript-eslint/types': 6.5.0 '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) - eslint: 8.48.0 + eslint: 8.49.0 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -1909,8 +2003,8 @@ packages: - encoding dev: false - /@upstash/ratelimit@0.4.3: - resolution: {integrity: sha512-Dsp9Mw09Flg28JRklKgFiCXqr3bqv8bbG0kgpUYoHjcgPPolFFyaYOj/I2HExvYLZiogl77NUavBoNvMOK0zUQ==} + /@upstash/ratelimit@0.4.4: + resolution: {integrity: sha512-y3q6cNDdcRQ2MRPRf5UNWBN36IwnZ4kAEkGoH3i6OqdWwz4qlBxNsw4/Rpqn9h93+Nx1cqg5IOq7O2e2zMJY1w==} dependencies: '@upstash/core-analytics': 0.0.6 transitivePeerDependencies: @@ -2193,7 +2287,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.10 - caniuse-lite: 1.0.30001525 + caniuse-lite: 1.0.30001532 fraction.js: 4.3.6 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2221,17 +2315,17 @@ packages: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} dev: false - /babel-jest@29.6.4(@babel/core@7.22.11): + /babel-jest@29.6.4(@babel/core@7.22.17): resolution: {integrity: sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@jest/transform': 29.6.4 '@types/babel__core': 7.20.1 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.22.11) + babel-preset-jest: 29.6.3(@babel/core@7.22.17) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -2256,41 +2350,41 @@ packages: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.11 + '@babel/template': 7.22.15 + '@babel/types': 7.22.17 '@types/babel__core': 7.20.1 '@types/babel__traverse': 7.20.1 dev: true - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.11): + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.17): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.11 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.11) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.11) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.11) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.11) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.11) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.11) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.11) - dev: true - - /babel-preset-jest@29.6.3(@babel/core@7.22.11): + '@babel/core': 7.22.17 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.17) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.17) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.17) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.17) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.17) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.17) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.17) + dev: true + + /babel-preset-jest@29.6.3(@babel/core@7.22.17): resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.11) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.17) dev: true /balanced-match@1.0.2: @@ -2370,8 +2464,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001525 - electron-to-chromium: 1.4.508 + caniuse-lite: 1.0.30001532 + electron-to-chromium: 1.4.513 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) @@ -2392,11 +2486,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /buffer-writer@2.0.0: - resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} - engines: {node: '>=4'} - dev: false - /buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} dependencies: @@ -2454,8 +2543,8 @@ packages: engines: {node: '>=14.16'} dev: true - /caniuse-lite@1.0.30001525: - resolution: {integrity: sha512-/3z+wB4icFt3r0USMwxujAqRvaD/B7rvGTsKhbhSQErVrJvkZCLhgNLJxU8MevahQVH6hCU9FsHdNUFbiwmE7Q==} + /caniuse-lite@1.0.30001532: + resolution: {integrity: sha512-FbDFnNat3nMnrROzqrsg314zhqN5LGQ1kyyMk2opcrwGbVGpHRhgCWtAgD5YJUqNAiQ+dklreil/c3Qf1dfCTw==} /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -2638,10 +2727,23 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true + /cookie-parser@1.4.6: + resolution: {integrity: sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==} + engines: {node: '>= 0.8.0'} + dependencies: + cookie: 0.4.1 + cookie-signature: 1.0.6 + dev: false + /cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false + /cookie@0.4.1: + resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} + engines: {node: '>= 0.6'} + dev: false + /cookie@0.4.2: resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} engines: {node: '>= 0.6'} @@ -2650,7 +2752,6 @@ packages: /cookie@0.5.0: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} - dev: false /cors@2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} @@ -2893,8 +2994,8 @@ packages: - supports-color dev: true - /drizzle-orm@0.28.5(@types/pg@8.10.2)(pg@8.11.3): - resolution: {integrity: sha512-6r6Iw4c38NAmW6TiKH3TUpGUQ1YdlEoLJOQptn8XPx3Z63+vFNKfAiANqrIiYZiMjKR9+NYAL219nFrmo1duXA==} + /drizzle-orm@0.28.6(postgres@3.3.5): + resolution: {integrity: sha512-yBe+F9htrlYER7uXgDJUQsTHFoIrI5yMm5A0bg0GiZ/kY5jNXTWoEy4KQtg35cE27sw1VbgzoMWHAgCckUUUww==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' '@cloudflare/workers-types': '>=3' @@ -2955,16 +3056,15 @@ packages: sqlite3: optional: true dependencies: - '@types/pg': 8.10.2 - pg: 8.11.3 + postgres: 3.3.5 dev: false /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false - /electron-to-chromium@1.4.508: - resolution: {integrity: sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==} + /electron-to-chromium@1.4.513: + resolution: {integrity: sha512-cOB0xcInjm+E5qIssHeXJ29BaUyWpMyFKT5RB3bsLENDheCja0wMkHJyiPl0NBE/VzDI7JDuNEQWhe6RitEUcw==} /emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -3014,8 +3114,8 @@ packages: engines: {node: '>=10.2.0'} dependencies: '@types/cookie': 0.4.1 - '@types/cors': 2.8.13 - '@types/node': 20.5.7 + '@types/cors': 2.8.14 + '@types/node': 20.6.0 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -3229,7 +3329,7 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-next@13.4.19(eslint@8.48.0)(typescript@5.2.2): + /eslint-config-next@13.4.19(eslint@8.49.0)(typescript@5.2.2): resolution: {integrity: sha512-WE8367sqMnjhWHvR5OivmfwENRQ1ixfNE9hZwQqNCsd+iM3KnuMc1V8Pt6ytgjxjf23D+xbesADv9x3xaKfT3g==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 @@ -3240,36 +3340,36 @@ packages: dependencies: '@next/eslint-plugin-next': 13.4.19 '@rushstack/eslint-patch': 1.3.3 - '@typescript-eslint/parser': 6.5.0(eslint@8.48.0)(typescript@5.2.2) - eslint: 8.48.0 + '@typescript-eslint/parser': 6.5.0(eslint@8.49.0)(typescript@5.2.2) + eslint: 8.49.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.48.0) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0) - eslint-plugin-jsx-a11y: 6.7.1(eslint@8.48.0) - eslint-plugin-react: 7.33.2(eslint@8.48.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.48.0) + eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.49.0) + eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0) + eslint-plugin-jsx-a11y: 6.7.1(eslint@8.49.0) + eslint-plugin-react: 7.33.2(eslint@8.49.0) + eslint-plugin-react-hooks: 4.6.0(eslint@8.49.0) typescript: 5.2.2 transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color dev: true - /eslint-config-prettier@9.0.0(eslint@8.48.0): + /eslint-config-prettier@9.0.0(eslint@8.49.0): resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.48.0 + eslint: 8.49.0 dev: true - /eslint-config-turbo@1.10.12(eslint@8.48.0): + /eslint-config-turbo@1.10.12(eslint@8.49.0): resolution: {integrity: sha512-z3jfh+D7UGYlzMWGh+Kqz++hf8LOE96q3o5R8X4HTjmxaBWlLAWG+0Ounr38h+JLR2TJno0hU9zfzoPNkR9BdA==} peerDependencies: eslint: '>6.6.0' dependencies: - eslint: 8.48.0 - eslint-plugin-turbo: 1.10.12(eslint@8.48.0) + eslint: 8.49.0 + eslint-plugin-turbo: 1.10.12(eslint@8.49.0) dev: true /eslint-import-resolver-node@0.3.9: @@ -3282,7 +3382,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.48.0): + /eslint-import-resolver-typescript@3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.49.0): resolution: {integrity: sha512-QTHR9ddNnn35RTxlaEnx2gCxqFlF2SEN0SE2d17SqwyM7YOSI2GHWRYp5BiRkObTUNYPupC/3Fq2a0PpT+EKpg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3291,9 +3391,9 @@ packages: dependencies: debug: 4.3.4 enhanced-resolve: 5.15.0 - eslint: 8.48.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0) + eslint: 8.49.0 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0) + eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0) fast-glob: 3.3.1 get-tsconfig: 4.7.0 is-core-module: 2.13.0 @@ -3305,7 +3405,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3326,16 +3426,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.5.0(eslint@8.49.0)(typescript@5.2.2) debug: 3.2.7(supports-color@5.5.0) - eslint: 8.48.0 + eslint: 8.49.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.48.0) + eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.49.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import@2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0): + /eslint-plugin-import@2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0): resolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==} engines: {node: '>=4'} peerDependencies: @@ -3345,16 +3445,16 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.5.0(eslint@8.49.0)(typescript@5.2.2) array-includes: 3.1.6 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 debug: 3.2.7(supports-color@5.5.0) doctrine: 2.1.0 - eslint: 8.48.0 + eslint: 8.49.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.48.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.49.0) has: 1.0.3 is-core-module: 2.13.0 is-glob: 4.0.3 @@ -3370,7 +3470,7 @@ packages: - supports-color dev: true - /eslint-plugin-jsx-a11y@6.7.1(eslint@8.48.0): + /eslint-plugin-jsx-a11y@6.7.1(eslint@8.49.0): resolution: {integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==} engines: {node: '>=4.0'} peerDependencies: @@ -3385,7 +3485,7 @@ packages: axobject-query: 3.2.1 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 8.48.0 + eslint: 8.49.0 has: 1.0.3 jsx-ast-utils: 3.3.5 language-tags: 1.0.5 @@ -3395,16 +3495,16 @@ packages: semver: 6.3.1 dev: true - /eslint-plugin-react-hooks@4.6.0(eslint@8.48.0): + /eslint-plugin-react-hooks@4.6.0(eslint@8.49.0): resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: - eslint: 8.48.0 + eslint: 8.49.0 dev: true - /eslint-plugin-react@7.33.2(eslint@8.48.0): + /eslint-plugin-react@7.33.2(eslint@8.49.0): resolution: {integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==} engines: {node: '>=4'} peerDependencies: @@ -3415,7 +3515,7 @@ packages: array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 es-iterator-helpers: 1.0.14 - eslint: 8.48.0 + eslint: 8.49.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -3429,13 +3529,13 @@ packages: string.prototype.matchall: 4.0.9 dev: true - /eslint-plugin-turbo@1.10.12(eslint@8.48.0): + /eslint-plugin-turbo@1.10.12(eslint@8.49.0): resolution: {integrity: sha512-uNbdj+ohZaYo4tFJ6dStRXu2FZigwulR1b3URPXe0Q8YaE7thuekKNP+54CHtZPH9Zey9dmDx5btAQl9mfzGOw==} peerDependencies: eslint: '>6.6.0' dependencies: dotenv: 16.0.3 - eslint: 8.48.0 + eslint: 8.49.0 dev: true /eslint-scope@7.2.2: @@ -3497,6 +3597,52 @@ packages: - supports-color dev: true + /eslint@8.49.0: + resolution: {integrity: sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.49.0) + '@eslint-community/regexpp': 4.8.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.49.0 + '@humanwhocodes/config-array': 0.11.11 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.21.0 + graphemer: 1.4.0 + ignore: 5.2.4 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3593,6 +3739,15 @@ packages: jest-util: 29.6.3 dev: true + /express-rate-limit@6.11.0(express@4.18.2): + resolution: {integrity: sha512-H9afltGTaEZcvenAB5LFgb/ysTMHUzMxoB3TJM6UHP5FtAP1p2+heMj1xwTei54Zm4I9I/2qsS5m+XrdKQp/Hw==} + engines: {node: '>= 14'} + peerDependencies: + express: ^4 || ^5 + dependencies: + express: 4.18.2 + dev: false + /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} engines: {node: '>= 0.10.0'} @@ -3768,8 +3923,8 @@ packages: resolution: {integrity: sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==} dev: false - /framer-motion@10.16.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-K6TXr5mZtitC/dxQCBdg7xzdN0d5IAIrlaqCPKtIQVdzVPGC0qBuJKXggHX1vjnP5gPOFwB1KbCCTWcnFc3kWg==} + /framer-motion@10.16.4(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-p9V9nGomS3m6/CALXqv6nFGMuFOxbWsmaOrdmhyQimMIlLl3LC7h7l86wge/Js/8cRu5ktutS/zlzgR7eBOtFA==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 @@ -4374,8 +4529,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.22.11 - '@babel/parser': 7.22.14 + '@babel/core': 7.22.17 + '@babel/parser': 7.22.16 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 @@ -4387,8 +4542,8 @@ packages: resolution: {integrity: sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.22.11 - '@babel/parser': 7.22.14 + '@babel/core': 7.22.17 + '@babel/parser': 7.22.16 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 7.5.4 @@ -4450,7 +4605,7 @@ packages: '@jest/expect': 29.6.4 '@jest/test-result': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -4463,7 +4618,7 @@ packages: jest-util: 29.6.3 p-limit: 3.1.0 pretty-format: 29.6.3 - pure-rand: 6.0.2 + pure-rand: 6.0.3 slash: 3.0.0 stack-utils: 2.0.6 transitivePeerDependencies: @@ -4471,7 +4626,7 @@ packages: - supports-color dev: true - /jest-cli@29.6.4(@types/node@20.5.7)(ts-node@10.9.1): + /jest-cli@29.6.4(@types/node@20.6.0)(ts-node@10.9.1): resolution: {integrity: sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4488,7 +4643,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.6.4(@types/node@20.5.7)(ts-node@10.9.1) + jest-config: 29.6.4(@types/node@20.6.0)(ts-node@10.9.1) jest-util: 29.6.3 jest-validate: 29.6.3 prompts: 2.4.2 @@ -4500,7 +4655,7 @@ packages: - ts-node dev: true - /jest-config@29.6.4(@types/node@20.5.7)(ts-node@10.9.1): + /jest-config@29.6.4(@types/node@20.6.0)(ts-node@10.9.1): resolution: {integrity: sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -4512,11 +4667,11 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 '@jest/test-sequencer': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 - babel-jest: 29.6.4(@babel/core@7.22.11) + '@types/node': 20.6.0 + babel-jest: 29.6.4(@babel/core@7.22.17) chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 @@ -4535,7 +4690,7 @@ packages: pretty-format: 29.6.3 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@20.5.7)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@20.6.0)(typescript@5.2.2) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -4576,7 +4731,7 @@ packages: '@jest/environment': 29.6.4 '@jest/fake-timers': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 jest-mock: 29.6.3 jest-util: 29.6.3 dev: true @@ -4592,7 +4747,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.6 - '@types/node': 20.5.7 + '@types/node': 20.6.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -4643,7 +4798,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 jest-util: 29.6.3 dev: true @@ -4698,7 +4853,7 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -4729,7 +4884,7 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -4752,15 +4907,15 @@ packages: resolution: {integrity: sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.22.11 - '@babel/generator': 7.22.10 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.11) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.11) - '@babel/types': 7.22.11 + '@babel/core': 7.22.17 + '@babel/generator': 7.22.15 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.17) + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.17) + '@babel/types': 7.22.17 '@jest/expect-utils': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.11) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.17) chalk: 4.1.2 expect: 29.6.4 graceful-fs: 4.2.11 @@ -4781,7 +4936,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.11 @@ -4806,7 +4961,7 @@ packages: dependencies: '@jest/test-result': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.5.7 + '@types/node': 20.6.0 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -4818,13 +4973,13 @@ packages: resolution: {integrity: sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.5.7 + '@types/node': 20.6.0 jest-util: 29.6.3 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.6.4(@types/node@20.5.7)(ts-node@10.9.1): + /jest@29.6.4(@types/node@20.6.0)(ts-node@10.9.1): resolution: {integrity: sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4837,7 +4992,7 @@ packages: '@jest/core': 29.6.4(ts-node@10.9.1) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.6.4(@types/node@20.5.7)(ts-node@10.9.1) + jest-cli: 29.6.4(@types/node@20.6.0)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -4845,10 +5000,13 @@ packages: - ts-node dev: true - /jiti@1.19.3: - resolution: {integrity: sha512-5eEbBDQT/jF1xg6l36P+mWGGoH9Spuy0PCdSr2dtWRDGC6ph/w9ZCL4lmESW8f8F7MwT3XKescfP0wnZWAKL9w==} + /jiti@1.20.0: + resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} hasBin: true + /jose@4.14.6: + resolution: {integrity: sha512-EqJPEUlZD0/CSUMubKtMaYUOtWe91tZXTWMJZoKSbLk+KtdhNdcvppH8lA9XwVu2V4Ailvsj0GBZJ2ZwDjfesQ==} + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -5138,6 +5296,11 @@ packages: engines: {node: '>=10'} dev: false + /mini-svg-data-uri@1.4.4: + resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==} + hasBin: true + dev: true + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -5218,6 +5381,31 @@ packages: engines: {node: '>= 0.6'} dev: false + /next-auth@4.23.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-mL083z8KgRtlrIV6CDca2H1kduWJuK/3pTS0Fe2og15KOm4v2kkLGdSDfc2g+019aEBrJUT0pPW2Xx42ImN1WA==} + peerDependencies: + next: ^12.2.5 || ^13 + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.22.15 + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.14.6 + next: 13.4.19(react-dom@18.2.0)(react@18.2.0) + oauth: 0.9.15 + openid-client: 5.5.0 + preact: 10.17.1 + preact-render-to-string: 5.2.6(preact@10.17.1) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + uuid: 8.3.2 + dev: false + /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} dev: true @@ -5240,7 +5428,7 @@ packages: '@next/env': 13.4.19 '@swc/helpers': 0.5.1 busboy: 1.6.0 - caniuse-lite: 1.0.30001525 + caniuse-lite: 1.0.30001532 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5342,10 +5530,22 @@ packages: path-key: 3.1.1 dev: true + /oauth4webapi@2.3.0: + resolution: {integrity: sha512-JGkb5doGrwzVDuHwgrR4nHJayzN4h59VCed6EW8Tql6iHDfZIabCJvg6wtbn5q6pyB2hZruI3b77Nudvq7NmvA==} + + /oauth@0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} + /object-hash@2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -5411,8 +5611,10 @@ packages: es-abstract: 1.22.1 dev: true - /obuf@1.1.2: - resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + /oidc-token-hash@5.0.3: + resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false /on-finished@2.3.0: resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} @@ -5445,11 +5647,11 @@ packages: mimic-fn: 2.1.0 dev: true - /openai@4.3.1: - resolution: {integrity: sha512-64iI2LbJLk0Ss4Nv5IrdGFe6ALNnKlMuXoGuH525bJYxdupJfDCAtra/Jigex1z8it0U82M87tR2TMGU+HYeFQ==} + /openai@4.6.0: + resolution: {integrity: sha512-LuONkTgoe4D172raQCv+eEK5OdLGnY/M4JrUz/pxRGevZwqDqy3xhBbCeWX8QLCbFcnITYsu/VBJXZJ0rDAMpA==} hasBin: true dependencies: - '@types/node': 18.17.14 + '@types/node': 18.17.15 '@types/node-fetch': 2.6.4 abort-controller: 3.0.0 agentkeepalive: 4.5.0 @@ -5461,6 +5663,15 @@ packages: - encoding dev: false + /openid-client@5.5.0: + resolution: {integrity: sha512-Y7Xl8BgsrkzWLHkVDYuroM67hi96xITyEDSkmWaGUiNX6CkcXC3XyQGdv5aWZ6dukVKBFVQCADi9gCavOmU14w==} + dependencies: + jose: 4.14.6 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.3 + dev: false + /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -5506,10 +5717,6 @@ packages: engines: {node: '>=6'} dev: true - /packet-reader@1.0.0: - resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} - dev: false - /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -5558,84 +5765,6 @@ packages: engines: {node: '>=8'} dev: true - /pg-cloudflare@1.1.1: - resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} - requiresBuild: true - dev: false - optional: true - - /pg-connection-string@2.6.2: - resolution: {integrity: sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==} - dev: false - - /pg-int8@1.0.1: - resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} - engines: {node: '>=4.0.0'} - - /pg-numeric@1.0.2: - resolution: {integrity: sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==} - engines: {node: '>=4'} - - /pg-pool@3.6.1(pg@8.11.3): - resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==} - peerDependencies: - pg: '>=8.0' - dependencies: - pg: 8.11.3 - dev: false - - /pg-protocol@1.6.0: - resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} - - /pg-types@2.2.0: - resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} - engines: {node: '>=4'} - dependencies: - pg-int8: 1.0.1 - postgres-array: 2.0.0 - postgres-bytea: 1.0.0 - postgres-date: 1.0.7 - postgres-interval: 1.2.0 - dev: false - - /pg-types@4.0.1: - resolution: {integrity: sha512-hRCSDuLII9/LE3smys1hRHcu5QGcLs9ggT7I/TCs0IE+2Eesxi9+9RWAAwZ0yaGjxoWICF/YHLOEjydGujoJ+g==} - engines: {node: '>=10'} - dependencies: - pg-int8: 1.0.1 - pg-numeric: 1.0.2 - postgres-array: 3.0.2 - postgres-bytea: 3.0.0 - postgres-date: 2.0.1 - postgres-interval: 3.0.0 - postgres-range: 1.1.3 - - /pg@8.11.3: - resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==} - engines: {node: '>= 8.0.0'} - peerDependencies: - pg-native: '>=3.0.1' - peerDependenciesMeta: - pg-native: - optional: true - dependencies: - buffer-writer: 2.0.0 - packet-reader: 1.0.0 - pg-connection-string: 2.6.2 - pg-pool: 3.6.1(pg@8.11.3) - pg-protocol: 1.6.0 - pg-types: 2.2.0 - pgpass: 1.0.5 - optionalDependencies: - pg-cloudflare: 1.1.1 - dev: false - - /pgpass@1.0.5: - resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} - dependencies: - split2: 4.2.0 - dev: false - /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -5744,48 +5873,33 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /postgres-array@2.0.0: - resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} - engines: {node: '>=4'} - dev: false - - /postgres-array@3.0.2: - resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==} - engines: {node: '>=12'} - - /postgres-bytea@1.0.0: - resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} - engines: {node: '>=0.10.0'} + /postgres@3.3.5: + resolution: {integrity: sha512-+JD93VELV9gHkqpV5gdL5/70HdGtEw4/XE1S4BC8f1mcPmdib3K5XsKVbnR1XcAyC41zOnifJ+9YRKxdIsXiUw==} dev: false - /postgres-bytea@3.0.0: - resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==} - engines: {node: '>= 6'} + /preact-render-to-string@5.2.3(preact@10.11.3): + resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==} + peerDependencies: + preact: '>=10' dependencies: - obuf: 1.1.2 - - /postgres-date@1.0.7: - resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} - engines: {node: '>=0.10.0'} - dev: false - - /postgres-date@2.0.1: - resolution: {integrity: sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==} - engines: {node: '>=12'} + preact: 10.11.3 + pretty-format: 3.8.0 - /postgres-interval@1.2.0: - resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} - engines: {node: '>=0.10.0'} + /preact-render-to-string@5.2.6(preact@10.17.1): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' dependencies: - xtend: 4.0.2 + preact: 10.17.1 + pretty-format: 3.8.0 dev: false - /postgres-interval@3.0.0: - resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==} - engines: {node: '>=12'} + /preact@10.11.3: + resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==} - /postgres-range@1.1.3: - resolution: {integrity: sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==} + /preact@10.17.1: + resolution: {integrity: sha512-X9BODrvQ4Ekwv9GURm9AKAGaomqXmip7NQTZgY7gcNmr7XE83adOMJvd3N42id1tMFU7ojiynRsYnY6/BRFxLA==} + dev: false /prebuild-install@7.1.1: resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} @@ -5811,8 +5925,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-plugin-tailwindcss@0.5.3(prettier@3.0.3): - resolution: {integrity: sha512-M5K80V21yM+CTm/FEFYRv9/9LyInYbCSXpIoPAKMm8zy89IOwdiA2e4JVbcO7tvRtAQWz32zdj7/WKcsmFyAVg==} + /prettier-plugin-tailwindcss@0.5.4(prettier@3.0.3): + resolution: {integrity: sha512-QZzzB1bID6qPsKHTeA9qPo1APmmxfFrA5DD3LQ+vbTmAnY40eJI7t9Q1ocqel2EKMWNPLJqdTDWZj1hKYgqSgg==} engines: {node: '>=14.21.3'} peerDependencies: '@ianvs/prettier-plugin-sort-imports': '*' @@ -5881,6 +5995,9 @@ packages: react-is: 18.2.0 dev: true + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -5928,8 +6045,8 @@ packages: engines: {node: '>=6'} dev: true - /pure-rand@6.0.2: - resolution: {integrity: sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==} + /pure-rand@6.0.3: + resolution: {integrity: sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==} dev: true /qs@6.11.0: @@ -5995,8 +6112,8 @@ packages: - csstype dev: false - /react-icons@4.10.1(react@18.2.0): - resolution: {integrity: sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==} + /react-icons@4.11.0(react@18.2.0): + resolution: {integrity: sha512-V+4khzYcE5EBk/BvcuYRq6V/osf11ODUM2J8hg2FDSswRrGvqiYUYPRy4OdrWaQOBj4NcpJfmHZLNaD+VH0TyA==} peerDependencies: react: '*' dependencies: @@ -6051,7 +6168,6 @@ packages: /regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} - dev: true /regexp.prototype.flags@1.5.0: resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} @@ -6364,11 +6480,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} - engines: {node: '>= 10.x'} - dev: false - /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true @@ -6568,7 +6679,7 @@ packages: fast-glob: 3.3.1 glob-parent: 6.0.2 is-glob: 4.0.3 - jiti: 1.19.3 + jiti: 1.20.0 lilconfig: 2.1.0 micromatch: 4.0.5 normalize-path: 3.0.0 @@ -6699,7 +6810,7 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /ts-jest@29.1.1(@babel/core@7.22.11)(jest@29.6.4)(typescript@5.2.2): + /ts-jest@29.1.1(@babel/core@7.22.17)(jest@29.6.4)(typescript@5.2.2): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6720,10 +6831,10 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.17 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.6.4(@types/node@20.5.7)(ts-node@10.9.1) + jest: 29.6.4(@types/node@20.6.0)(ts-node@10.9.1) jest-util: 29.6.3 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -6733,7 +6844,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node@10.9.1(@types/node@20.5.7)(typescript@5.2.2): + /ts-node@10.9.1(@types/node@20.6.0)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6752,7 +6863,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.5.7 + '@types/node': 20.6.0 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -6783,65 +6894,64 @@ packages: safe-buffer: 5.2.1 dev: false - /turbo-darwin-64@1.10.12: - resolution: {integrity: sha512-vmDfGVPl5/aFenAbOj3eOx3ePNcWVUyZwYr7taRl0ZBbmv2TzjRiFotO4vrKCiTVnbqjQqAFQWY2ugbqCI1kOQ==} + /turbo-darwin-64@1.10.13: + resolution: {integrity: sha512-vmngGfa2dlYvX7UFVncsNDMuT4X2KPyPJ2Jj+xvf5nvQnZR/3IeDEGleGVuMi/hRzdinoxwXqgk9flEmAYp0Xw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.10.12: - resolution: {integrity: sha512-3JliEESLNX2s7g54SOBqqkqJ7UhcOGkS0ywMr5SNuvF6kWVTbuUq7uBU/sVbGq8RwvK1ONlhPvJne5MUqBCTCQ==} + /turbo-darwin-arm64@1.10.13: + resolution: {integrity: sha512-eMoJC+k7gIS4i2qL6rKmrIQGP6Wr9nN4odzzgHFngLTMimok2cGLK3qbJs5O5F/XAtEeRAmuxeRnzQwTl/iuAw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.10.12: - resolution: {integrity: sha512-siYhgeX0DidIfHSgCR95b8xPee9enKSOjCzx7EjTLmPqPaCiVebRYvbOIYdQWRqiaKh9yfhUtFmtMOMScUf1gg==} + /turbo-linux-64@1.10.13: + resolution: {integrity: sha512-0CyYmnKTs6kcx7+JRH3nPEqCnzWduM0hj8GP/aodhaIkLNSAGAa+RiYZz6C7IXN+xUVh5rrWTnU2f1SkIy7Gdg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.10.12: - resolution: {integrity: sha512-K/ZhvD9l4SslclaMkTiIrnfcACgos79YcAo4kwc8bnMQaKuUeRpM15sxLpZp3xDjDg8EY93vsKyjaOhdFG2UbA==} + /turbo-linux-arm64@1.10.13: + resolution: {integrity: sha512-0iBKviSGQQlh2OjZgBsGjkPXoxvRIxrrLLbLObwJo3sOjIH0loGmVIimGS5E323soMfi/o+sidjk2wU1kFfD7Q==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.10.12: - resolution: {integrity: sha512-7FSgSwvktWDNOqV65l9AbZwcoueAILeE4L7JvjauNASAjjbuzXGCEq5uN8AQU3U5BOFj4TdXrVmO2dX+lLu8Zg==} + /turbo-windows-64@1.10.13: + resolution: {integrity: sha512-S5XySRfW2AmnTeY1IT+Jdr6Goq7mxWganVFfrmqU+qqq3Om/nr0GkcUX+KTIo9mPrN0D3p5QViBRzulwB5iuUQ==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.10.12: - resolution: {integrity: sha512-gCNXF52dwom1HLY9ry/cneBPOKTBHhzpqhMylcyvJP0vp9zeMQQkt6yjYv+6QdnmELC92CtKNp2FsNZo+z0pyw==} + /turbo-windows-arm64@1.10.13: + resolution: {integrity: sha512-nKol6+CyiExJIuoIc3exUQPIBjP9nIq5SkMJgJuxsot2hkgGrafAg/izVDRDrRduQcXj2s8LdtxJHvvnbI8hEQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.10.12: - resolution: {integrity: sha512-WM3+jTfQWnB9W208pmP4oeehZcC6JQNlydb/ZHMRrhmQa+htGhWLCzd6Q9rLe0MwZLPpSPFV2/bN5egCLyoKjQ==} + /turbo@1.10.13: + resolution: {integrity: sha512-vOF5IPytgQPIsgGtT0n2uGZizR2N3kKuPIn4b5p5DdeLoI0BV7uNiydT7eSzdkPRpdXNnO8UwS658VaI4+YSzQ==} hasBin: true - requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.10.12 - turbo-darwin-arm64: 1.10.12 - turbo-linux-64: 1.10.12 - turbo-linux-arm64: 1.10.12 - turbo-windows-64: 1.10.12 - turbo-windows-arm64: 1.10.12 + turbo-darwin-64: 1.10.13 + turbo-darwin-arm64: 1.10.13 + turbo-linux-64: 1.10.13 + turbo-linux-arm64: 1.10.13 + turbo-windows-64: 1.10.13 + turbo-windows-arm64: 1.10.13 dev: true /type-check@0.4.0: @@ -7001,6 +7111,11 @@ packages: engines: {node: '>= 0.4.0'} dev: false + /uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: false + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true @@ -7160,11 +7275,6 @@ packages: resolution: {integrity: sha512-Fba/DwEPDLneHT3tbJ9F3zafbQXszOlyCJyQqqdzmtlY/cwE2th462KK48yaANf98jHlP6lJvxfNtN0LFKXPQg==} dev: false - /xtend@4.0.2: - resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} - engines: {node: '>=0.4'} - dev: false - /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -7216,23 +7326,3 @@ packages: /zod@3.22.2: resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} dev: true - - /zustand@4.4.1(@types/react@18.2.21)(react@18.2.0): - resolution: {integrity: sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==} - engines: {node: '>=12.7.0'} - peerDependencies: - '@types/react': '>=16.8' - immer: '>=9.0' - react: '>=16.8' - peerDependenciesMeta: - '@types/react': - optional: true - immer: - optional: true - react: - optional: true - dependencies: - '@types/react': 18.2.21 - react: 18.2.0 - use-sync-external-store: 1.2.0(react@18.2.0) - dev: false diff --git a/turbo.json b/turbo.json index 3d892751..d720c30e 100644 --- a/turbo.json +++ b/turbo.json @@ -7,12 +7,15 @@ "build": { "env": [ "CI", + "GOOGLE_CLIENT_ID", + "GOOGLE_CLIENT_SECRET", "NEXT_PUBLIC_API_URL", "KV_REST_API_URL", "KV_REST_API_TOKEN", "OPENAI_API_KEY", "REPLICATE_API_TOKEN", "DATABASE_URL", + "POSTGRES_URL", "PORT", "NODE_ENV", "APP_URL"