diff --git a/app/api/daily/leaderboard/route.ts b/app/api/daily/leaderboard/route.ts new file mode 100644 index 0000000..82c39a3 --- /dev/null +++ b/app/api/daily/leaderboard/route.ts @@ -0,0 +1,23 @@ +import { NextResponse } from "next/server"; +import { prisma } from "../../../../lib/prisma"; + +export async function GET() { + const date = new Date().toISOString().slice(0, 10); + const puzzle = await prisma.dailyPuzzle.findUnique({ where: { date } }); + if (!puzzle) return NextResponse.json([]); + + const results = await prisma.dailyResult.findMany({ + where: { puzzleId: puzzle.id, won: true }, + include: { user: { select: { name: true } } }, + orderBy: [{ clicks: "asc" }, { timeSeconds: "asc" }], + take: 20, + }); + + return NextResponse.json(results.map((r, i) => ({ + rank: i + 1, + name: r.user.name, + clicks: r.clicks, + timeSeconds: r.timeSeconds, + userId: r.userId, + }))); +} diff --git a/app/api/daily/route.ts b/app/api/daily/route.ts new file mode 100644 index 0000000..b80f8a9 --- /dev/null +++ b/app/api/daily/route.ts @@ -0,0 +1,61 @@ +import { NextResponse } from "next/server"; +import { auth } from "../../../auth"; +import { prisma } from "../../../lib/prisma"; +import { pickTwoArticles } from "../../../lib/wiki"; + +function todayKey() { + return new Date().toISOString().slice(0, 10); // "YYYY-MM-DD" +} + +async function getOrCreatePuzzle() { + const date = todayKey(); + const existing = await prisma.dailyPuzzle.findUnique({ where: { date } }); + if (existing) return existing; + + const { start, target } = await pickTwoArticles(); + return prisma.dailyPuzzle.create({ data: { date, startArticle: start, targetArticle: target } }); +} + +// GET — retourne le puzzle du jour + si l'utilisateur a déjà joué +export async function GET() { + const session = await auth(); + const puzzle = await getOrCreatePuzzle(); + + let myResult = null; + if (session?.user?.id) { + myResult = await prisma.dailyResult.findUnique({ + where: { puzzleId_userId: { puzzleId: puzzle.id, userId: session.user.id } }, + }); + } + + return NextResponse.json({ + puzzle: { id: puzzle.id, date: puzzle.date, startArticle: puzzle.startArticle, targetArticle: puzzle.targetArticle }, + alreadyPlayed: !!myResult, + myResult: myResult ? { clicks: myResult.clicks, timeSeconds: myResult.timeSeconds, won: myResult.won, path: JSON.parse(myResult.path) } : null, + }); +} + +// POST — soumettre un résultat +export async function POST(req: Request) { + const session = await auth(); + if (!session?.user?.id) return NextResponse.json({ error: "Non connecté" }, { status: 401 }); + + const { puzzleId, path, clicks, timeSeconds, won } = await req.json() as { + puzzleId: string; path: string[]; clicks: number; timeSeconds: number; won: boolean; + }; + + // Vérifier que le puzzle est bien celui du jour + const puzzle = await prisma.dailyPuzzle.findUnique({ where: { id: puzzleId } }); + if (!puzzle || puzzle.date !== todayKey()) { + return NextResponse.json({ error: "Puzzle invalide" }, { status: 400 }); + } + + // Upsert — on n'enregistre qu'une fois + const result = await prisma.dailyResult.upsert({ + where: { puzzleId_userId: { puzzleId, userId: session.user.id } }, + create: { puzzleId, userId: session.user.id, path: JSON.stringify(path), clicks, timeSeconds, won }, + update: {}, + }); + + return NextResponse.json({ id: result.id }); +} diff --git a/app/components/BlitzScreen.tsx b/app/components/BlitzScreen.tsx new file mode 100644 index 0000000..8ff0359 --- /dev/null +++ b/app/components/BlitzScreen.tsx @@ -0,0 +1,116 @@ +"use client"; + +import { useBlitzGame } from "../../lib/useBlitzGame"; +import { ArticleView } from "./ArticleView"; + +function fmtLeft(s: number): string { + const m = Math.floor(s / 60); + const sec = Math.floor(s % 60); + return `${m}:${String(sec).padStart(2, "0")}`; +} + +export function BlitzScreen({ onBack }: { onBack: () => void }) { + const game = useBlitzGame(); + + const btnPrimary = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#7c3aed] text-white hover:bg-[#6d28d9] disabled:opacity-50 cursor-pointer transition-colors"; + const btnGhost = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#242424] border border-[#2e2e2e] text-[#f0f0f0] hover:bg-[#1a1a1a] cursor-pointer transition-colors"; + + const danger = game.timeLeft < 30; + + if (game.phase === "setup") return ( +
+ +
+

Mode Blitz

+

+ Tu as 2 minutes pour visiter un maximum d'articles Wikipedia différents en cliquant sur les liens. Ton score = nombre d'articles uniques visités. +

+ +
+ ); + + if (game.phase === "ended") return ( +
+
+
+

Temps écoulé !

+
+
+ {game.visited.length} + articles visités +
+
+ {game.clicks} + clics +
+
+
+ {game.visited.map((t, i) => ( + + {i > 0 && } + {t} + + ))} +
+
+ + +
+
+
+ ); + + // Playing + return ( +
+
+
+ {game.title &&

{game.title}

} + {game.loading && ( +
Chargement...
+ )} + {game.loadError && ( +
+

{game.loadError}

+ +
+ )} + {!game.loading && !game.loadError && game.html && ( + + )} +
+
+ + {/* Bottom bar */} +
+
+
+ ⚡ Articles + {game.visited.length} +
+
+ Clics + {game.clicks} +
+
+ + {/* Timer */} +
+ {fmtLeft(game.timeLeft)} +
+ +
+ {game.visited.length > 0 ? game.visited[game.visited.length - 1] : ""} +
+
+
+ ); +} diff --git a/app/components/DailyScreen.tsx b/app/components/DailyScreen.tsx new file mode 100644 index 0000000..2131efb --- /dev/null +++ b/app/components/DailyScreen.tsx @@ -0,0 +1,175 @@ +"use client"; + +import { useEffect, useRef, useState } from "react"; +import { useDailyGame } from "../../lib/useDailyGame"; +import { fmt } from "../../lib/utils"; +import { ArticleView } from "./ArticleView"; +import { Breadcrumbs } from "./Breadcrumbs"; + +const MEDALS = ["🥇", "🥈", "🥉"]; + +type LeaderboardEntry = { rank: number; name: string; clicks: number; timeSeconds: number; userId: string }; + +export function DailyScreen({ onBack, currentUserId }: { onBack: () => void; currentUserId?: string }) { + const game = useDailyGame(); + const breadcrumbEndRef = useRef(null); + const [leaderboard, setLeaderboard] = useState([]); + const [loadingLb, setLoadingLb] = useState(false); + + useEffect(() => { + breadcrumbEndRef.current?.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "end" }); + }, [game.history]); + + function fetchLeaderboard() { + setLoadingLb(true); + fetch("/api/daily/leaderboard") + .then((r) => r.json()) + .then(setLeaderboard) + .finally(() => setLoadingLb(false)); + } + + useEffect(() => { + if (game.phase === "won" || game.phase === "gave_up" || game.phase === "already_played") { + fetchLeaderboard(); + } + }, [game.phase]); + + const btnPrimary = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#7c3aed] text-white hover:bg-[#6d28d9] disabled:opacity-50 cursor-pointer transition-colors"; + const btnGhost = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#242424] border border-[#2e2e2e] text-[#f0f0f0] hover:bg-[#1a1a1a] cursor-pointer transition-colors"; + + // Loading initial + if (game.phase === "loading") return ( +
+
+
+ ); + + // Erreur initiale + if (game.loadError && game.phase === "loading") return ( +
+

{game.loadError}

+ +
+ ); + + // Résultat (won / gave_up / already_played) + if (game.phase === "won" || game.phase === "gave_up" || game.phase === "already_played") { + const result = game.myResult; + return ( +
+ + +
+
Défi du jour — {game.puzzle?.date}
+
+ {game.phase === "won" ? "🎉 Réussi !" : game.phase === "gave_up" ? "😔 Abandonné" : "✅ Déjà joué"} +
+
+ {game.puzzle?.startArticle} + + {game.puzzle?.targetArticle} +
+
+ + {result && ( +
+
+
+
{result.clicks}
+
clics
+
+
+
{fmt(result.timeSeconds)}
+
temps
+
+
+ {result.path.length > 0 && ( +
+ {result.path.map((t, i) => ( + + {i > 0 && } + {t} + + ))} +
+ )} +
+ )} + + {/* Classement du jour */} +
+

Classement du jour

+ {loadingLb ? ( +
+ ) : leaderboard.length === 0 ? ( +

Aucun résultat pour l'instant.

+ ) : ( +
+ {leaderboard.map((entry, i) => ( +
+ {MEDALS[i] ?? `#${entry.rank}`} + {entry.name} + {entry.clicks} clics · {fmt(entry.timeSeconds)} +
+ ))} +
+ )} +
+ + +
+ ); + } + + // Playing + return ( +
+
+
+ {game.title &&

{game.title}

} + {game.loading && ( +
Chargement...
+ )} + {game.loadError && ( +
+

{game.loadError}

+ +
+ )} + {!game.loading && !game.loadError && game.html && ( + + )} +
+
+ + {/* Bottom bar */} +
+
+
+ 🗓 Défi du jour · cible + {game.puzzle?.targetArticle} +
+ +
+
+
+ Clics + {game.clicks} +
+ {game.canGoBack && ( + + )} + +
+
+
+ ); +} diff --git a/app/components/HomeScreen.tsx b/app/components/HomeScreen.tsx index 669864f..aa452f4 100644 --- a/app/components/HomeScreen.tsx +++ b/app/components/HomeScreen.tsx @@ -18,12 +18,14 @@ type HomeScreenProps = { onShowAuth: () => void; onShowProfile: () => void; onShowLeaderboard: () => void; + onDaily: () => void; + onBlitz: () => void; }; export function HomeScreen({ playerName, setPlayerName, joinCode, setJoinCode, error, setError, loading, onCreateRoom, onJoinRoom, onSolo, - session, onShowAuth, onShowProfile, onShowLeaderboard, + session, onShowAuth, onShowProfile, onShowLeaderboard, onDaily, onBlitz, }: HomeScreenProps) { const btnGhost = "min-h-9 px-3 rounded-lg text-xs sm:text-sm font-semibold bg-[#242424] border border-[#2e2e2e] text-[#f0f0f0] hover:bg-[#1a1a1a] cursor-pointer whitespace-nowrap"; @@ -114,7 +116,19 @@ export function HomeScreen({ className="w-full min-h-11 rounded-xl text-sm font-semibold bg-[#242424] border border-[#2e2e2e] text-[#f0f0f0] hover:bg-[#1a1a1a] cursor-pointer transition-colors" onClick={onSolo} > - Jouer en solo + 🎯 Jouer en solo + + +
diff --git a/app/components/ScreenRouter.tsx b/app/components/ScreenRouter.tsx index 31003e6..1982066 100644 --- a/app/components/ScreenRouter.tsx +++ b/app/components/ScreenRouter.tsx @@ -14,6 +14,8 @@ import { GameScreen } from "./GameScreen"; import { AuthModal } from "./AuthModal"; import { ProfileScreen } from "./ProfileScreen"; import { LeaderboardScreen } from "./LeaderboardScreen"; +import { DailyScreen } from "./DailyScreen"; +import { BlitzScreen } from "./BlitzScreen"; type Props = { screen: Screen; @@ -46,6 +48,14 @@ export function ScreenRouter({ setScreen("home")} /> ); + if (screen === "daily") return ( + setScreen("home")} currentUserId={session?.user?.id ?? undefined} /> + ); + + if (screen === "blitz") return ( + setScreen("home")} /> + ); + if (screen === "home") return ( <> setShowAuth(true)} onShowProfile={() => setScreen("profile")} onShowLeaderboard={() => setScreen("leaderboard")} + onDaily={() => setScreen("daily")} + onBlitz={() => setScreen("blitz")} /> {showAuth && setShowAuth(false)} onSuccess={() => setShowAuth(false)} />} diff --git a/lib/generated/prisma/browser.ts b/lib/generated/prisma/browser.ts index 77f5215..e76e7ba 100644 --- a/lib/generated/prisma/browser.ts +++ b/lib/generated/prisma/browser.ts @@ -27,3 +27,13 @@ export type User = Prisma.UserModel * */ export type Game = Prisma.GameModel +/** + * Model DailyPuzzle + * + */ +export type DailyPuzzle = Prisma.DailyPuzzleModel +/** + * Model DailyResult + * + */ +export type DailyResult = Prisma.DailyResultModel diff --git a/lib/generated/prisma/client.ts b/lib/generated/prisma/client.ts index dc62c40..009bb85 100644 --- a/lib/generated/prisma/client.ts +++ b/lib/generated/prisma/client.ts @@ -51,3 +51,13 @@ export type User = Prisma.UserModel * */ export type Game = Prisma.GameModel +/** + * Model DailyPuzzle + * + */ +export type DailyPuzzle = Prisma.DailyPuzzleModel +/** + * Model DailyResult + * + */ +export type DailyResult = Prisma.DailyResultModel diff --git a/lib/generated/prisma/internal/class.ts b/lib/generated/prisma/internal/class.ts index f2c898d..eadcbd7 100644 --- a/lib/generated/prisma/internal/class.ts +++ b/lib/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.7.0", "engineVersion": "75cbdc1eb7150937890ad5465d861175c6624711", "activeProvider": "sqlite", - "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../lib/generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel User {\n id String @id @default(cuid())\n name String\n email String @unique\n password String\n createdAt DateTime @default(now())\n games Game[]\n}\n\nmodel Game {\n id String @id @default(cuid())\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n mode String // \"solo\" | \"multi\"\n startArticle String\n targetArticle String\n path String // JSON array de titres\n clicks Int\n timeSeconds Float\n won Boolean @default(true)\n playedAt DateTime @default(now())\n\n @@index([userId])\n}\n", + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../lib/generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel User {\n id String @id @default(cuid())\n name String\n email String @unique\n password String\n createdAt DateTime @default(now())\n games Game[]\n dailyResults DailyResult[]\n}\n\nmodel Game {\n id String @id @default(cuid())\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n mode String // \"solo\" | \"multi\" | \"daily\" | \"blitz\"\n startArticle String\n targetArticle String\n path String // JSON array de titres\n clicks Int\n timeSeconds Float\n won Boolean @default(true)\n playedAt DateTime @default(now())\n\n @@index([userId])\n}\n\nmodel DailyPuzzle {\n id String @id @default(cuid())\n date String @unique // \"YYYY-MM-DD\"\n startArticle String\n targetArticle String\n results DailyResult[]\n}\n\nmodel DailyResult {\n id String @id @default(cuid())\n puzzleId String\n puzzle DailyPuzzle @relation(fields: [puzzleId], references: [id], onDelete: Cascade)\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n path String // JSON\n clicks Int\n timeSeconds Float\n won Boolean\n playedAt DateTime @default(now())\n\n @@unique([puzzleId, userId])\n @@index([puzzleId])\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -32,10 +32,10 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"games\",\"kind\":\"object\",\"type\":\"Game\",\"relationName\":\"GameToUser\"}],\"dbName\":null},\"Game\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"GameToUser\"},{\"name\":\"mode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"startArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"targetArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"path\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"clicks\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timeSeconds\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"won\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"playedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"games\",\"kind\":\"object\",\"type\":\"Game\",\"relationName\":\"GameToUser\"},{\"name\":\"dailyResults\",\"kind\":\"object\",\"type\":\"DailyResult\",\"relationName\":\"DailyResultToUser\"}],\"dbName\":null},\"Game\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"GameToUser\"},{\"name\":\"mode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"startArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"targetArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"path\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"clicks\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timeSeconds\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"won\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"playedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"DailyPuzzle\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"startArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"targetArticle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"results\",\"kind\":\"object\",\"type\":\"DailyResult\",\"relationName\":\"DailyPuzzleToDailyResult\"}],\"dbName\":null},\"DailyResult\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"puzzleId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"puzzle\",\"kind\":\"object\",\"type\":\"DailyPuzzle\",\"relationName\":\"DailyPuzzleToDailyResult\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"DailyResultToUser\"},{\"name\":\"path\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"clicks\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timeSeconds\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"won\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"playedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") config.parameterizationSchema = { - strings: JSON.parse("[\"where\",\"orderBy\",\"cursor\",\"user\",\"games\",\"_count\",\"User.findUnique\",\"User.findUniqueOrThrow\",\"User.findFirst\",\"User.findFirstOrThrow\",\"User.findMany\",\"data\",\"User.createOne\",\"User.createMany\",\"User.createManyAndReturn\",\"User.updateOne\",\"User.updateMany\",\"User.updateManyAndReturn\",\"create\",\"update\",\"User.upsertOne\",\"User.deleteOne\",\"User.deleteMany\",\"having\",\"_min\",\"_max\",\"User.groupBy\",\"User.aggregate\",\"Game.findUnique\",\"Game.findUniqueOrThrow\",\"Game.findFirst\",\"Game.findFirstOrThrow\",\"Game.findMany\",\"Game.createOne\",\"Game.createMany\",\"Game.createManyAndReturn\",\"Game.updateOne\",\"Game.updateMany\",\"Game.updateManyAndReturn\",\"Game.upsertOne\",\"Game.deleteOne\",\"Game.deleteMany\",\"_avg\",\"_sum\",\"Game.groupBy\",\"Game.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"userId\",\"mode\",\"startArticle\",\"targetArticle\",\"path\",\"clicks\",\"timeSeconds\",\"won\",\"playedAt\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"not\",\"contains\",\"startsWith\",\"endsWith\",\"name\",\"email\",\"password\",\"createdAt\",\"every\",\"some\",\"none\",\"is\",\"isNot\",\"connectOrCreate\",\"upsert\",\"createMany\",\"set\",\"disconnect\",\"delete\",\"connect\",\"updateMany\",\"deleteMany\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), - graph: "cxQgCQQAAEkAIC4AAEYAMC8AAAkAEDAAAEYAMDEBAAAAAUYBAEcAIUcBAAAAAUgBAEcAIUlAAEgAIQEAAAABACAOAwAATgAgLgAASgAwLwAAAwAQMAAASgAwMQEARwAhMgEARwAhMwEARwAhNAEARwAhNQEARwAhNgEARwAhNwIASwAhOAgATAAhOSAATQAhOkAASAAhAQMAAG0AIA4DAABOACAuAABKADAvAAADABAwAABKADAxAQAAAAEyAQBHACEzAQBHACE0AQBHACE1AQBHACE2AQBHACE3AgBLACE4CABMACE5IABNACE6QABIACEDAAAAAwAgAQAABAAwAgAABQAgAQAAAAMAIAEAAAABACAJBAAASQAgLgAARgAwLwAACQAQMAAARgAwMQEARwAhRgEARwAhRwEARwAhSAEARwAhSUAASAAhAQQAAGwAIAMAAAAJACABAAAKADACAAABACADAAAACQAgAQAACgAwAgAAAQAgAwAAAAkAIAEAAAoAMAIAAAEAIAY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AVAAhSAEAVAAhSUAAWAAhBTEBAFQAIUYBAFQAIUcBAFQAIUgBAFQAIUlAAFgAIQIEBgIFAAMBAwABAQQHAAAAAAMFAAgYAAkZAAoAAAADBQAIGAAJGQAKAQMAAQEDAAEFBQAPGAASGQATKgAQKwARAAAAAAAFBQAPGAASGQATKgAQKwARBgIBBwgBCAsBCQwBCg0BDA8BDREEDhIFDxQBEBYEERcGFBgBFRkBFhoEGh0HGx4LHB8CHSACHiECHyICICMCISUCIicEIygMJCoCJSwEJi0NJy4CKC8CKTAELDMOLTQU" + strings: JSON.parse("[\"where\",\"orderBy\",\"cursor\",\"user\",\"games\",\"results\",\"_count\",\"puzzle\",\"dailyResults\",\"User.findUnique\",\"User.findUniqueOrThrow\",\"User.findFirst\",\"User.findFirstOrThrow\",\"User.findMany\",\"data\",\"User.createOne\",\"User.createMany\",\"User.createManyAndReturn\",\"User.updateOne\",\"User.updateMany\",\"User.updateManyAndReturn\",\"create\",\"update\",\"User.upsertOne\",\"User.deleteOne\",\"User.deleteMany\",\"having\",\"_min\",\"_max\",\"User.groupBy\",\"User.aggregate\",\"Game.findUnique\",\"Game.findUniqueOrThrow\",\"Game.findFirst\",\"Game.findFirstOrThrow\",\"Game.findMany\",\"Game.createOne\",\"Game.createMany\",\"Game.createManyAndReturn\",\"Game.updateOne\",\"Game.updateMany\",\"Game.updateManyAndReturn\",\"Game.upsertOne\",\"Game.deleteOne\",\"Game.deleteMany\",\"_avg\",\"_sum\",\"Game.groupBy\",\"Game.aggregate\",\"DailyPuzzle.findUnique\",\"DailyPuzzle.findUniqueOrThrow\",\"DailyPuzzle.findFirst\",\"DailyPuzzle.findFirstOrThrow\",\"DailyPuzzle.findMany\",\"DailyPuzzle.createOne\",\"DailyPuzzle.createMany\",\"DailyPuzzle.createManyAndReturn\",\"DailyPuzzle.updateOne\",\"DailyPuzzle.updateMany\",\"DailyPuzzle.updateManyAndReturn\",\"DailyPuzzle.upsertOne\",\"DailyPuzzle.deleteOne\",\"DailyPuzzle.deleteMany\",\"DailyPuzzle.groupBy\",\"DailyPuzzle.aggregate\",\"DailyResult.findUnique\",\"DailyResult.findUniqueOrThrow\",\"DailyResult.findFirst\",\"DailyResult.findFirstOrThrow\",\"DailyResult.findMany\",\"DailyResult.createOne\",\"DailyResult.createMany\",\"DailyResult.createManyAndReturn\",\"DailyResult.updateOne\",\"DailyResult.updateMany\",\"DailyResult.updateManyAndReturn\",\"DailyResult.upsertOne\",\"DailyResult.deleteOne\",\"DailyResult.deleteMany\",\"DailyResult.groupBy\",\"DailyResult.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"puzzleId\",\"userId\",\"path\",\"clicks\",\"timeSeconds\",\"won\",\"playedAt\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"not\",\"contains\",\"startsWith\",\"endsWith\",\"date\",\"startArticle\",\"targetArticle\",\"every\",\"some\",\"none\",\"mode\",\"name\",\"email\",\"password\",\"createdAt\",\"puzzleId_userId\",\"is\",\"isNot\",\"connectOrCreate\",\"upsert\",\"createMany\",\"set\",\"disconnect\",\"delete\",\"connect\",\"updateMany\",\"deleteMany\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), + graph: "4wEnQAoEAACDAQAgCAAAfgAgUQAAgQEAMFIAABAAEFMAAIEBADBUAQAAAAFuAQB9ACFvAQAAAAFwAQB9ACFxQACCAQAhAQAAAAEAIA4DAACKAQAgUQAAiwEAMFIAAAMAEFMAAIsBADBUAQB9ACFWAQB9ACFXAQB9ACFYAgCGAQAhWQgAhwEAIVogAIgBACFbQACCAQAhaAEAfQAhaQEAfQAhbQEAfQAhAQMAANEBACAOAwAAigEAIFEAAIsBADBSAAADABBTAACLAQAwVAEAAAABVgEAfQAhVwEAfQAhWAIAhgEAIVkIAIcBACFaIACIAQAhW0AAggEAIWgBAH0AIWkBAH0AIW0BAH0AIQMAAAADACABAAAEADACAAAFACANAwAAigEAIAcAAIkBACBRAACFAQAwUgAABwAQUwAAhQEAM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2gEAIARUAQAAAAFnAQAAAAFoAQAAAAFpAQAAAAECAAAAPAAgFQAA3AEAIAMAAAAQACAVAADaAQAgFgAA4AEAIAgAAAAQACAEAAC2AQAgDgAA4AEAIFQBAJEBACFuAQCRAQAhbwEAkQEAIXABAJEBACFxQACVAQAhBgQAALYBACBUAQCRAQAhbgEAkQEAIW8BAJEBACFwAQCRAQAhcUAAlQEAIQMAAAA_ACAVAADcAQAgFgAA4wEAIAYAAAA_ACAOAADjAQAgVAEAkQEAIWcBAJEBACFoAQCRAQAhaQEAkQEAIQRUAQCRAQAhZwEAkQEAIWgBAJEBACFpAQCRAQAhAwQGAgYABggKAwEDAAECAwABBwAEAgULAwYABQEFDAACBA0ACA4AAAAAAwYACxsADBwADQAAAAMGAAsbAAwcAA0BAwABAQMAAQUGABIbABUcABYtABMuABQAAAAAAAUGABIbABUcABYtABMuABQAAAMGABsbABwcAB0AAAADBgAbGwAcHAAdAgMAAQcABAIDAAEHAAQFBgAiGwAlHAAmLQAjLgAkAAAAAAAFBgAiGwAlHAAmLQAjLgAkCQIBCg8BCxIBDBMBDRQBDxYBEBgHERkIEhsBEx0HFB4JFx8BGCABGSEHHSQKHiUOHyYCICcCISgCIikCIyoCJCwCJS4HJi8PJzECKDMHKTQQKjUCKzYCLDcHLzoRMDsXMT0EMj4EM0EENEIENUMENkUEN0cHOEgYOUoEOkwHO00ZPE4EPU8EPlAHP1MaQFQeQVUDQlYDQ1cDRFgDRVkDRlsDR10HSF4fSWADSmIHS2MgTGQDTWUDTmYHT2khUGon" } async function decodeBase64AsWasm(wasmBase64: string): Promise { @@ -207,6 +207,26 @@ export interface PrismaClient< * ``` */ get game(): Prisma.GameDelegate; + + /** + * `prisma.dailyPuzzle`: Exposes CRUD operations for the **DailyPuzzle** model. + * Example usage: + * ```ts + * // Fetch zero or more DailyPuzzles + * const dailyPuzzles = await prisma.dailyPuzzle.findMany() + * ``` + */ + get dailyPuzzle(): Prisma.DailyPuzzleDelegate; + + /** + * `prisma.dailyResult`: Exposes CRUD operations for the **DailyResult** model. + * Example usage: + * ```ts + * // Fetch zero or more DailyResults + * const dailyResults = await prisma.dailyResult.findMany() + * ``` + */ + get dailyResult(): Prisma.DailyResultDelegate; } export function getPrismaClientClass(): PrismaClientConstructor { diff --git a/lib/generated/prisma/internal/prismaNamespace.ts b/lib/generated/prisma/internal/prismaNamespace.ts index 6f21abd..001e6ac 100644 --- a/lib/generated/prisma/internal/prismaNamespace.ts +++ b/lib/generated/prisma/internal/prismaNamespace.ts @@ -385,7 +385,9 @@ type FieldRefInputType = Model extends never ? never : FieldRe export const ModelName = { User: 'User', - Game: 'Game' + Game: 'Game', + DailyPuzzle: 'DailyPuzzle', + DailyResult: 'DailyResult' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -401,7 +403,7 @@ export type TypeMap + fields: Prisma.DailyPuzzleFieldRefs + operations: { + findUnique: { + args: Prisma.DailyPuzzleFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DailyPuzzleFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.DailyPuzzleFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DailyPuzzleFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.DailyPuzzleFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.DailyPuzzleCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.DailyPuzzleCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.DailyPuzzleCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.DailyPuzzleDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.DailyPuzzleUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DailyPuzzleDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DailyPuzzleUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.DailyPuzzleUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.DailyPuzzleUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.DailyPuzzleAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.DailyPuzzleGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.DailyPuzzleCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + DailyResult: { + payload: Prisma.$DailyResultPayload + fields: Prisma.DailyResultFieldRefs + operations: { + findUnique: { + args: Prisma.DailyResultFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DailyResultFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.DailyResultFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DailyResultFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.DailyResultFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.DailyResultCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.DailyResultCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.DailyResultCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.DailyResultDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.DailyResultUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DailyResultDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DailyResultUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.DailyResultUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.DailyResultUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.DailyResultAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.DailyResultGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.DailyResultCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } } } & { other: { @@ -616,6 +766,30 @@ export const GameScalarFieldEnum = { export type GameScalarFieldEnum = (typeof GameScalarFieldEnum)[keyof typeof GameScalarFieldEnum] +export const DailyPuzzleScalarFieldEnum = { + id: 'id', + date: 'date', + startArticle: 'startArticle', + targetArticle: 'targetArticle' +} as const + +export type DailyPuzzleScalarFieldEnum = (typeof DailyPuzzleScalarFieldEnum)[keyof typeof DailyPuzzleScalarFieldEnum] + + +export const DailyResultScalarFieldEnum = { + id: 'id', + puzzleId: 'puzzleId', + userId: 'userId', + path: 'path', + clicks: 'clicks', + timeSeconds: 'timeSeconds', + won: 'won', + playedAt: 'playedAt' +} as const + +export type DailyResultScalarFieldEnum = (typeof DailyResultScalarFieldEnum)[keyof typeof DailyResultScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -761,6 +935,8 @@ export type PrismaClientOptions = ({ export type GlobalOmitConfig = { user?: Prisma.UserOmit game?: Prisma.GameOmit + dailyPuzzle?: Prisma.DailyPuzzleOmit + dailyResult?: Prisma.DailyResultOmit } /* Types for Logging */ diff --git a/lib/generated/prisma/internal/prismaNamespaceBrowser.ts b/lib/generated/prisma/internal/prismaNamespaceBrowser.ts index adeb1f3..19949e3 100644 --- a/lib/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/lib/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -52,7 +52,9 @@ export const AnyNull = runtime.AnyNull export const ModelName = { User: 'User', - Game: 'Game' + Game: 'Game', + DailyPuzzle: 'DailyPuzzle', + DailyResult: 'DailyResult' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -95,6 +97,30 @@ export const GameScalarFieldEnum = { export type GameScalarFieldEnum = (typeof GameScalarFieldEnum)[keyof typeof GameScalarFieldEnum] +export const DailyPuzzleScalarFieldEnum = { + id: 'id', + date: 'date', + startArticle: 'startArticle', + targetArticle: 'targetArticle' +} as const + +export type DailyPuzzleScalarFieldEnum = (typeof DailyPuzzleScalarFieldEnum)[keyof typeof DailyPuzzleScalarFieldEnum] + + +export const DailyResultScalarFieldEnum = { + id: 'id', + puzzleId: 'puzzleId', + userId: 'userId', + path: 'path', + clicks: 'clicks', + timeSeconds: 'timeSeconds', + won: 'won', + playedAt: 'playedAt' +} as const + +export type DailyResultScalarFieldEnum = (typeof DailyResultScalarFieldEnum)[keyof typeof DailyResultScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' diff --git a/lib/generated/prisma/models.ts b/lib/generated/prisma/models.ts index 1581a86..0d11a74 100644 --- a/lib/generated/prisma/models.ts +++ b/lib/generated/prisma/models.ts @@ -10,4 +10,6 @@ */ export type * from './models/User' export type * from './models/Game' +export type * from './models/DailyPuzzle' +export type * from './models/DailyResult' export type * from './commonInputTypes' \ No newline at end of file diff --git a/lib/generated/prisma/models/DailyPuzzle.ts b/lib/generated/prisma/models/DailyPuzzle.ts new file mode 100644 index 0000000..0f9d716 --- /dev/null +++ b/lib/generated/prisma/models/DailyPuzzle.ts @@ -0,0 +1,1293 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `DailyPuzzle` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model DailyPuzzle + * + */ +export type DailyPuzzleModel = runtime.Types.Result.DefaultSelection + +export type AggregateDailyPuzzle = { + _count: DailyPuzzleCountAggregateOutputType | null + _min: DailyPuzzleMinAggregateOutputType | null + _max: DailyPuzzleMaxAggregateOutputType | null +} + +export type DailyPuzzleMinAggregateOutputType = { + id: string | null + date: string | null + startArticle: string | null + targetArticle: string | null +} + +export type DailyPuzzleMaxAggregateOutputType = { + id: string | null + date: string | null + startArticle: string | null + targetArticle: string | null +} + +export type DailyPuzzleCountAggregateOutputType = { + id: number + date: number + startArticle: number + targetArticle: number + _all: number +} + + +export type DailyPuzzleMinAggregateInputType = { + id?: true + date?: true + startArticle?: true + targetArticle?: true +} + +export type DailyPuzzleMaxAggregateInputType = { + id?: true + date?: true + startArticle?: true + targetArticle?: true +} + +export type DailyPuzzleCountAggregateInputType = { + id?: true + date?: true + startArticle?: true + targetArticle?: true + _all?: true +} + +export type DailyPuzzleAggregateArgs = { + /** + * Filter which DailyPuzzle to aggregate. + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyPuzzles to fetch. + */ + orderBy?: Prisma.DailyPuzzleOrderByWithRelationInput | Prisma.DailyPuzzleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.DailyPuzzleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyPuzzles from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyPuzzles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned DailyPuzzles + **/ + _count?: true | DailyPuzzleCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DailyPuzzleMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DailyPuzzleMaxAggregateInputType +} + +export type GetDailyPuzzleAggregateType = { + [P in keyof T & keyof AggregateDailyPuzzle]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type DailyPuzzleGroupByArgs = { + where?: Prisma.DailyPuzzleWhereInput + orderBy?: Prisma.DailyPuzzleOrderByWithAggregationInput | Prisma.DailyPuzzleOrderByWithAggregationInput[] + by: Prisma.DailyPuzzleScalarFieldEnum[] | Prisma.DailyPuzzleScalarFieldEnum + having?: Prisma.DailyPuzzleScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DailyPuzzleCountAggregateInputType | true + _min?: DailyPuzzleMinAggregateInputType + _max?: DailyPuzzleMaxAggregateInputType +} + +export type DailyPuzzleGroupByOutputType = { + id: string + date: string + startArticle: string + targetArticle: string + _count: DailyPuzzleCountAggregateOutputType | null + _min: DailyPuzzleMinAggregateOutputType | null + _max: DailyPuzzleMaxAggregateOutputType | null +} + +export type GetDailyPuzzleGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof DailyPuzzleGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type DailyPuzzleWhereInput = { + AND?: Prisma.DailyPuzzleWhereInput | Prisma.DailyPuzzleWhereInput[] + OR?: Prisma.DailyPuzzleWhereInput[] + NOT?: Prisma.DailyPuzzleWhereInput | Prisma.DailyPuzzleWhereInput[] + id?: Prisma.StringFilter<"DailyPuzzle"> | string + date?: Prisma.StringFilter<"DailyPuzzle"> | string + startArticle?: Prisma.StringFilter<"DailyPuzzle"> | string + targetArticle?: Prisma.StringFilter<"DailyPuzzle"> | string + results?: Prisma.DailyResultListRelationFilter +} + +export type DailyPuzzleOrderByWithRelationInput = { + id?: Prisma.SortOrder + date?: Prisma.SortOrder + startArticle?: Prisma.SortOrder + targetArticle?: Prisma.SortOrder + results?: Prisma.DailyResultOrderByRelationAggregateInput +} + +export type DailyPuzzleWhereUniqueInput = Prisma.AtLeast<{ + id?: string + date?: string + AND?: Prisma.DailyPuzzleWhereInput | Prisma.DailyPuzzleWhereInput[] + OR?: Prisma.DailyPuzzleWhereInput[] + NOT?: Prisma.DailyPuzzleWhereInput | Prisma.DailyPuzzleWhereInput[] + startArticle?: Prisma.StringFilter<"DailyPuzzle"> | string + targetArticle?: Prisma.StringFilter<"DailyPuzzle"> | string + results?: Prisma.DailyResultListRelationFilter +}, "id" | "date"> + +export type DailyPuzzleOrderByWithAggregationInput = { + id?: Prisma.SortOrder + date?: Prisma.SortOrder + startArticle?: Prisma.SortOrder + targetArticle?: Prisma.SortOrder + _count?: Prisma.DailyPuzzleCountOrderByAggregateInput + _max?: Prisma.DailyPuzzleMaxOrderByAggregateInput + _min?: Prisma.DailyPuzzleMinOrderByAggregateInput +} + +export type DailyPuzzleScalarWhereWithAggregatesInput = { + AND?: Prisma.DailyPuzzleScalarWhereWithAggregatesInput | Prisma.DailyPuzzleScalarWhereWithAggregatesInput[] + OR?: Prisma.DailyPuzzleScalarWhereWithAggregatesInput[] + NOT?: Prisma.DailyPuzzleScalarWhereWithAggregatesInput | Prisma.DailyPuzzleScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"DailyPuzzle"> | string + date?: Prisma.StringWithAggregatesFilter<"DailyPuzzle"> | string + startArticle?: Prisma.StringWithAggregatesFilter<"DailyPuzzle"> | string + targetArticle?: Prisma.StringWithAggregatesFilter<"DailyPuzzle"> | string +} + +export type DailyPuzzleCreateInput = { + id?: string + date: string + startArticle: string + targetArticle: string + results?: Prisma.DailyResultCreateNestedManyWithoutPuzzleInput +} + +export type DailyPuzzleUncheckedCreateInput = { + id?: string + date: string + startArticle: string + targetArticle: string + results?: Prisma.DailyResultUncheckedCreateNestedManyWithoutPuzzleInput +} + +export type DailyPuzzleUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string + results?: Prisma.DailyResultUpdateManyWithoutPuzzleNestedInput +} + +export type DailyPuzzleUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string + results?: Prisma.DailyResultUncheckedUpdateManyWithoutPuzzleNestedInput +} + +export type DailyPuzzleCreateManyInput = { + id?: string + date: string + startArticle: string + targetArticle: string +} + +export type DailyPuzzleUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type DailyPuzzleUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type DailyPuzzleCountOrderByAggregateInput = { + id?: Prisma.SortOrder + date?: Prisma.SortOrder + startArticle?: Prisma.SortOrder + targetArticle?: Prisma.SortOrder +} + +export type DailyPuzzleMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + date?: Prisma.SortOrder + startArticle?: Prisma.SortOrder + targetArticle?: Prisma.SortOrder +} + +export type DailyPuzzleMinOrderByAggregateInput = { + id?: Prisma.SortOrder + date?: Prisma.SortOrder + startArticle?: Prisma.SortOrder + targetArticle?: Prisma.SortOrder +} + +export type DailyPuzzleScalarRelationFilter = { + is?: Prisma.DailyPuzzleWhereInput + isNot?: Prisma.DailyPuzzleWhereInput +} + +export type DailyPuzzleCreateNestedOneWithoutResultsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DailyPuzzleCreateOrConnectWithoutResultsInput + connect?: Prisma.DailyPuzzleWhereUniqueInput +} + +export type DailyPuzzleUpdateOneRequiredWithoutResultsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DailyPuzzleCreateOrConnectWithoutResultsInput + upsert?: Prisma.DailyPuzzleUpsertWithoutResultsInput + connect?: Prisma.DailyPuzzleWhereUniqueInput + update?: Prisma.XOR, Prisma.DailyPuzzleUncheckedUpdateWithoutResultsInput> +} + +export type DailyPuzzleCreateWithoutResultsInput = { + id?: string + date: string + startArticle: string + targetArticle: string +} + +export type DailyPuzzleUncheckedCreateWithoutResultsInput = { + id?: string + date: string + startArticle: string + targetArticle: string +} + +export type DailyPuzzleCreateOrConnectWithoutResultsInput = { + where: Prisma.DailyPuzzleWhereUniqueInput + create: Prisma.XOR +} + +export type DailyPuzzleUpsertWithoutResultsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.DailyPuzzleWhereInput +} + +export type DailyPuzzleUpdateToOneWithWhereWithoutResultsInput = { + where?: Prisma.DailyPuzzleWhereInput + data: Prisma.XOR +} + +export type DailyPuzzleUpdateWithoutResultsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type DailyPuzzleUncheckedUpdateWithoutResultsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + date?: Prisma.StringFieldUpdateOperationsInput | string + startArticle?: Prisma.StringFieldUpdateOperationsInput | string + targetArticle?: Prisma.StringFieldUpdateOperationsInput | string +} + + +/** + * Count Type DailyPuzzleCountOutputType + */ + +export type DailyPuzzleCountOutputType = { + results: number +} + +export type DailyPuzzleCountOutputTypeSelect = { + results?: boolean | DailyPuzzleCountOutputTypeCountResultsArgs +} + +/** + * DailyPuzzleCountOutputType without action + */ +export type DailyPuzzleCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the DailyPuzzleCountOutputType + */ + select?: Prisma.DailyPuzzleCountOutputTypeSelect | null +} + +/** + * DailyPuzzleCountOutputType without action + */ +export type DailyPuzzleCountOutputTypeCountResultsArgs = { + where?: Prisma.DailyResultWhereInput +} + + +export type DailyPuzzleSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + date?: boolean + startArticle?: boolean + targetArticle?: boolean + results?: boolean | Prisma.DailyPuzzle$resultsArgs + _count?: boolean | Prisma.DailyPuzzleCountOutputTypeDefaultArgs +}, ExtArgs["result"]["dailyPuzzle"]> + +export type DailyPuzzleSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + date?: boolean + startArticle?: boolean + targetArticle?: boolean +}, ExtArgs["result"]["dailyPuzzle"]> + +export type DailyPuzzleSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + date?: boolean + startArticle?: boolean + targetArticle?: boolean +}, ExtArgs["result"]["dailyPuzzle"]> + +export type DailyPuzzleSelectScalar = { + id?: boolean + date?: boolean + startArticle?: boolean + targetArticle?: boolean +} + +export type DailyPuzzleOmit = runtime.Types.Extensions.GetOmit<"id" | "date" | "startArticle" | "targetArticle", ExtArgs["result"]["dailyPuzzle"]> +export type DailyPuzzleInclude = { + results?: boolean | Prisma.DailyPuzzle$resultsArgs + _count?: boolean | Prisma.DailyPuzzleCountOutputTypeDefaultArgs +} +export type DailyPuzzleIncludeCreateManyAndReturn = {} +export type DailyPuzzleIncludeUpdateManyAndReturn = {} + +export type $DailyPuzzlePayload = { + name: "DailyPuzzle" + objects: { + results: Prisma.$DailyResultPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + date: string + startArticle: string + targetArticle: string + }, ExtArgs["result"]["dailyPuzzle"]> + composites: {} +} + +export type DailyPuzzleGetPayload = runtime.Types.Result.GetResult + +export type DailyPuzzleCountArgs = + Omit & { + select?: DailyPuzzleCountAggregateInputType | true + } + +export interface DailyPuzzleDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['DailyPuzzle'], meta: { name: 'DailyPuzzle' } } + /** + * Find zero or one DailyPuzzle that matches the filter. + * @param {DailyPuzzleFindUniqueArgs} args - Arguments to find a DailyPuzzle + * @example + * // Get one DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one DailyPuzzle that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DailyPuzzleFindUniqueOrThrowArgs} args - Arguments to find a DailyPuzzle + * @example + * // Get one DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DailyPuzzle that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleFindFirstArgs} args - Arguments to find a DailyPuzzle + * @example + * // Get one DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DailyPuzzle that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleFindFirstOrThrowArgs} args - Arguments to find a DailyPuzzle + * @example + * // Get one DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more DailyPuzzles that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all DailyPuzzles + * const dailyPuzzles = await prisma.dailyPuzzle.findMany() + * + * // Get first 10 DailyPuzzles + * const dailyPuzzles = await prisma.dailyPuzzle.findMany({ take: 10 }) + * + * // Only select the `id` + * const dailyPuzzleWithIdOnly = await prisma.dailyPuzzle.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a DailyPuzzle. + * @param {DailyPuzzleCreateArgs} args - Arguments to create a DailyPuzzle. + * @example + * // Create one DailyPuzzle + * const DailyPuzzle = await prisma.dailyPuzzle.create({ + * data: { + * // ... data to create a DailyPuzzle + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many DailyPuzzles. + * @param {DailyPuzzleCreateManyArgs} args - Arguments to create many DailyPuzzles. + * @example + * // Create many DailyPuzzles + * const dailyPuzzle = await prisma.dailyPuzzle.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many DailyPuzzles and returns the data saved in the database. + * @param {DailyPuzzleCreateManyAndReturnArgs} args - Arguments to create many DailyPuzzles. + * @example + * // Create many DailyPuzzles + * const dailyPuzzle = await prisma.dailyPuzzle.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many DailyPuzzles and only return the `id` + * const dailyPuzzleWithIdOnly = await prisma.dailyPuzzle.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a DailyPuzzle. + * @param {DailyPuzzleDeleteArgs} args - Arguments to delete one DailyPuzzle. + * @example + * // Delete one DailyPuzzle + * const DailyPuzzle = await prisma.dailyPuzzle.delete({ + * where: { + * // ... filter to delete one DailyPuzzle + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one DailyPuzzle. + * @param {DailyPuzzleUpdateArgs} args - Arguments to update one DailyPuzzle. + * @example + * // Update one DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more DailyPuzzles. + * @param {DailyPuzzleDeleteManyArgs} args - Arguments to filter DailyPuzzles to delete. + * @example + * // Delete a few DailyPuzzles + * const { count } = await prisma.dailyPuzzle.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DailyPuzzles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many DailyPuzzles + * const dailyPuzzle = await prisma.dailyPuzzle.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DailyPuzzles and returns the data updated in the database. + * @param {DailyPuzzleUpdateManyAndReturnArgs} args - Arguments to update many DailyPuzzles. + * @example + * // Update many DailyPuzzles + * const dailyPuzzle = await prisma.dailyPuzzle.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more DailyPuzzles and only return the `id` + * const dailyPuzzleWithIdOnly = await prisma.dailyPuzzle.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one DailyPuzzle. + * @param {DailyPuzzleUpsertArgs} args - Arguments to update or create a DailyPuzzle. + * @example + * // Update or create a DailyPuzzle + * const dailyPuzzle = await prisma.dailyPuzzle.upsert({ + * create: { + * // ... data to create a DailyPuzzle + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the DailyPuzzle we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__DailyPuzzleClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of DailyPuzzles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleCountArgs} args - Arguments to filter DailyPuzzles to count. + * @example + * // Count the number of DailyPuzzles + * const count = await prisma.dailyPuzzle.count({ + * where: { + * // ... the filter for the DailyPuzzles we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a DailyPuzzle. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by DailyPuzzle. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyPuzzleGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends DailyPuzzleGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: DailyPuzzleGroupByArgs['orderBy'] } + : { orderBy?: DailyPuzzleGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetDailyPuzzleGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the DailyPuzzle model + */ +readonly fields: DailyPuzzleFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for DailyPuzzle. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__DailyPuzzleClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + results = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the DailyPuzzle model + */ +export interface DailyPuzzleFieldRefs { + readonly id: Prisma.FieldRef<"DailyPuzzle", 'String'> + readonly date: Prisma.FieldRef<"DailyPuzzle", 'String'> + readonly startArticle: Prisma.FieldRef<"DailyPuzzle", 'String'> + readonly targetArticle: Prisma.FieldRef<"DailyPuzzle", 'String'> +} + + +// Custom InputTypes +/** + * DailyPuzzle findUnique + */ +export type DailyPuzzleFindUniqueArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter, which DailyPuzzle to fetch. + */ + where: Prisma.DailyPuzzleWhereUniqueInput +} + +/** + * DailyPuzzle findUniqueOrThrow + */ +export type DailyPuzzleFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter, which DailyPuzzle to fetch. + */ + where: Prisma.DailyPuzzleWhereUniqueInput +} + +/** + * DailyPuzzle findFirst + */ +export type DailyPuzzleFindFirstArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter, which DailyPuzzle to fetch. + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyPuzzles to fetch. + */ + orderBy?: Prisma.DailyPuzzleOrderByWithRelationInput | Prisma.DailyPuzzleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DailyPuzzles. + */ + cursor?: Prisma.DailyPuzzleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyPuzzles from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyPuzzles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyPuzzles. + */ + distinct?: Prisma.DailyPuzzleScalarFieldEnum | Prisma.DailyPuzzleScalarFieldEnum[] +} + +/** + * DailyPuzzle findFirstOrThrow + */ +export type DailyPuzzleFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter, which DailyPuzzle to fetch. + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyPuzzles to fetch. + */ + orderBy?: Prisma.DailyPuzzleOrderByWithRelationInput | Prisma.DailyPuzzleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DailyPuzzles. + */ + cursor?: Prisma.DailyPuzzleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyPuzzles from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyPuzzles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyPuzzles. + */ + distinct?: Prisma.DailyPuzzleScalarFieldEnum | Prisma.DailyPuzzleScalarFieldEnum[] +} + +/** + * DailyPuzzle findMany + */ +export type DailyPuzzleFindManyArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter, which DailyPuzzles to fetch. + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyPuzzles to fetch. + */ + orderBy?: Prisma.DailyPuzzleOrderByWithRelationInput | Prisma.DailyPuzzleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing DailyPuzzles. + */ + cursor?: Prisma.DailyPuzzleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyPuzzles from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyPuzzles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyPuzzles. + */ + distinct?: Prisma.DailyPuzzleScalarFieldEnum | Prisma.DailyPuzzleScalarFieldEnum[] +} + +/** + * DailyPuzzle create + */ +export type DailyPuzzleCreateArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * The data needed to create a DailyPuzzle. + */ + data: Prisma.XOR +} + +/** + * DailyPuzzle createMany + */ +export type DailyPuzzleCreateManyArgs = { + /** + * The data used to create many DailyPuzzles. + */ + data: Prisma.DailyPuzzleCreateManyInput | Prisma.DailyPuzzleCreateManyInput[] +} + +/** + * DailyPuzzle createManyAndReturn + */ +export type DailyPuzzleCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelectCreateManyAndReturn | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * The data used to create many DailyPuzzles. + */ + data: Prisma.DailyPuzzleCreateManyInput | Prisma.DailyPuzzleCreateManyInput[] +} + +/** + * DailyPuzzle update + */ +export type DailyPuzzleUpdateArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * The data needed to update a DailyPuzzle. + */ + data: Prisma.XOR + /** + * Choose, which DailyPuzzle to update. + */ + where: Prisma.DailyPuzzleWhereUniqueInput +} + +/** + * DailyPuzzle updateMany + */ +export type DailyPuzzleUpdateManyArgs = { + /** + * The data used to update DailyPuzzles. + */ + data: Prisma.XOR + /** + * Filter which DailyPuzzles to update + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * Limit how many DailyPuzzles to update. + */ + limit?: number +} + +/** + * DailyPuzzle updateManyAndReturn + */ +export type DailyPuzzleUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * The data used to update DailyPuzzles. + */ + data: Prisma.XOR + /** + * Filter which DailyPuzzles to update + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * Limit how many DailyPuzzles to update. + */ + limit?: number +} + +/** + * DailyPuzzle upsert + */ +export type DailyPuzzleUpsertArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * The filter to search for the DailyPuzzle to update in case it exists. + */ + where: Prisma.DailyPuzzleWhereUniqueInput + /** + * In case the DailyPuzzle found by the `where` argument doesn't exist, create a new DailyPuzzle with this data. + */ + create: Prisma.XOR + /** + * In case the DailyPuzzle was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * DailyPuzzle delete + */ +export type DailyPuzzleDeleteArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null + /** + * Filter which DailyPuzzle to delete. + */ + where: Prisma.DailyPuzzleWhereUniqueInput +} + +/** + * DailyPuzzle deleteMany + */ +export type DailyPuzzleDeleteManyArgs = { + /** + * Filter which DailyPuzzles to delete + */ + where?: Prisma.DailyPuzzleWhereInput + /** + * Limit how many DailyPuzzles to delete. + */ + limit?: number +} + +/** + * DailyPuzzle.results + */ +export type DailyPuzzle$resultsArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + where?: Prisma.DailyResultWhereInput + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + cursor?: Prisma.DailyResultWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.DailyResultScalarFieldEnum | Prisma.DailyResultScalarFieldEnum[] +} + +/** + * DailyPuzzle without action + */ +export type DailyPuzzleDefaultArgs = { + /** + * Select specific fields to fetch from the DailyPuzzle + */ + select?: Prisma.DailyPuzzleSelect | null + /** + * Omit specific fields from the DailyPuzzle + */ + omit?: Prisma.DailyPuzzleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyPuzzleInclude | null +} diff --git a/lib/generated/prisma/models/DailyResult.ts b/lib/generated/prisma/models/DailyResult.ts new file mode 100644 index 0000000..1698e6e --- /dev/null +++ b/lib/generated/prisma/models/DailyResult.ts @@ -0,0 +1,1640 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `DailyResult` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model DailyResult + * + */ +export type DailyResultModel = runtime.Types.Result.DefaultSelection + +export type AggregateDailyResult = { + _count: DailyResultCountAggregateOutputType | null + _avg: DailyResultAvgAggregateOutputType | null + _sum: DailyResultSumAggregateOutputType | null + _min: DailyResultMinAggregateOutputType | null + _max: DailyResultMaxAggregateOutputType | null +} + +export type DailyResultAvgAggregateOutputType = { + clicks: number | null + timeSeconds: number | null +} + +export type DailyResultSumAggregateOutputType = { + clicks: number | null + timeSeconds: number | null +} + +export type DailyResultMinAggregateOutputType = { + id: string | null + puzzleId: string | null + userId: string | null + path: string | null + clicks: number | null + timeSeconds: number | null + won: boolean | null + playedAt: Date | null +} + +export type DailyResultMaxAggregateOutputType = { + id: string | null + puzzleId: string | null + userId: string | null + path: string | null + clicks: number | null + timeSeconds: number | null + won: boolean | null + playedAt: Date | null +} + +export type DailyResultCountAggregateOutputType = { + id: number + puzzleId: number + userId: number + path: number + clicks: number + timeSeconds: number + won: number + playedAt: number + _all: number +} + + +export type DailyResultAvgAggregateInputType = { + clicks?: true + timeSeconds?: true +} + +export type DailyResultSumAggregateInputType = { + clicks?: true + timeSeconds?: true +} + +export type DailyResultMinAggregateInputType = { + id?: true + puzzleId?: true + userId?: true + path?: true + clicks?: true + timeSeconds?: true + won?: true + playedAt?: true +} + +export type DailyResultMaxAggregateInputType = { + id?: true + puzzleId?: true + userId?: true + path?: true + clicks?: true + timeSeconds?: true + won?: true + playedAt?: true +} + +export type DailyResultCountAggregateInputType = { + id?: true + puzzleId?: true + userId?: true + path?: true + clicks?: true + timeSeconds?: true + won?: true + playedAt?: true + _all?: true +} + +export type DailyResultAggregateArgs = { + /** + * Filter which DailyResult to aggregate. + */ + where?: Prisma.DailyResultWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyResults to fetch. + */ + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.DailyResultWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyResults from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyResults. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned DailyResults + **/ + _count?: true | DailyResultCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: DailyResultAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: DailyResultSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DailyResultMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DailyResultMaxAggregateInputType +} + +export type GetDailyResultAggregateType = { + [P in keyof T & keyof AggregateDailyResult]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type DailyResultGroupByArgs = { + where?: Prisma.DailyResultWhereInput + orderBy?: Prisma.DailyResultOrderByWithAggregationInput | Prisma.DailyResultOrderByWithAggregationInput[] + by: Prisma.DailyResultScalarFieldEnum[] | Prisma.DailyResultScalarFieldEnum + having?: Prisma.DailyResultScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DailyResultCountAggregateInputType | true + _avg?: DailyResultAvgAggregateInputType + _sum?: DailyResultSumAggregateInputType + _min?: DailyResultMinAggregateInputType + _max?: DailyResultMaxAggregateInputType +} + +export type DailyResultGroupByOutputType = { + id: string + puzzleId: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt: Date + _count: DailyResultCountAggregateOutputType | null + _avg: DailyResultAvgAggregateOutputType | null + _sum: DailyResultSumAggregateOutputType | null + _min: DailyResultMinAggregateOutputType | null + _max: DailyResultMaxAggregateOutputType | null +} + +export type GetDailyResultGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof DailyResultGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type DailyResultWhereInput = { + AND?: Prisma.DailyResultWhereInput | Prisma.DailyResultWhereInput[] + OR?: Prisma.DailyResultWhereInput[] + NOT?: Prisma.DailyResultWhereInput | Prisma.DailyResultWhereInput[] + id?: Prisma.StringFilter<"DailyResult"> | string + puzzleId?: Prisma.StringFilter<"DailyResult"> | string + userId?: Prisma.StringFilter<"DailyResult"> | string + path?: Prisma.StringFilter<"DailyResult"> | string + clicks?: Prisma.IntFilter<"DailyResult"> | number + timeSeconds?: Prisma.FloatFilter<"DailyResult"> | number + won?: Prisma.BoolFilter<"DailyResult"> | boolean + playedAt?: Prisma.DateTimeFilter<"DailyResult"> | Date | string + puzzle?: Prisma.XOR + user?: Prisma.XOR +} + +export type DailyResultOrderByWithRelationInput = { + id?: Prisma.SortOrder + puzzleId?: Prisma.SortOrder + userId?: Prisma.SortOrder + path?: Prisma.SortOrder + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder + won?: Prisma.SortOrder + playedAt?: Prisma.SortOrder + puzzle?: Prisma.DailyPuzzleOrderByWithRelationInput + user?: Prisma.UserOrderByWithRelationInput +} + +export type DailyResultWhereUniqueInput = Prisma.AtLeast<{ + id?: string + puzzleId_userId?: Prisma.DailyResultPuzzleIdUserIdCompoundUniqueInput + AND?: Prisma.DailyResultWhereInput | Prisma.DailyResultWhereInput[] + OR?: Prisma.DailyResultWhereInput[] + NOT?: Prisma.DailyResultWhereInput | Prisma.DailyResultWhereInput[] + puzzleId?: Prisma.StringFilter<"DailyResult"> | string + userId?: Prisma.StringFilter<"DailyResult"> | string + path?: Prisma.StringFilter<"DailyResult"> | string + clicks?: Prisma.IntFilter<"DailyResult"> | number + timeSeconds?: Prisma.FloatFilter<"DailyResult"> | number + won?: Prisma.BoolFilter<"DailyResult"> | boolean + playedAt?: Prisma.DateTimeFilter<"DailyResult"> | Date | string + puzzle?: Prisma.XOR + user?: Prisma.XOR +}, "id" | "puzzleId_userId"> + +export type DailyResultOrderByWithAggregationInput = { + id?: Prisma.SortOrder + puzzleId?: Prisma.SortOrder + userId?: Prisma.SortOrder + path?: Prisma.SortOrder + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder + won?: Prisma.SortOrder + playedAt?: Prisma.SortOrder + _count?: Prisma.DailyResultCountOrderByAggregateInput + _avg?: Prisma.DailyResultAvgOrderByAggregateInput + _max?: Prisma.DailyResultMaxOrderByAggregateInput + _min?: Prisma.DailyResultMinOrderByAggregateInput + _sum?: Prisma.DailyResultSumOrderByAggregateInput +} + +export type DailyResultScalarWhereWithAggregatesInput = { + AND?: Prisma.DailyResultScalarWhereWithAggregatesInput | Prisma.DailyResultScalarWhereWithAggregatesInput[] + OR?: Prisma.DailyResultScalarWhereWithAggregatesInput[] + NOT?: Prisma.DailyResultScalarWhereWithAggregatesInput | Prisma.DailyResultScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"DailyResult"> | string + puzzleId?: Prisma.StringWithAggregatesFilter<"DailyResult"> | string + userId?: Prisma.StringWithAggregatesFilter<"DailyResult"> | string + path?: Prisma.StringWithAggregatesFilter<"DailyResult"> | string + clicks?: Prisma.IntWithAggregatesFilter<"DailyResult"> | number + timeSeconds?: Prisma.FloatWithAggregatesFilter<"DailyResult"> | number + won?: Prisma.BoolWithAggregatesFilter<"DailyResult"> | boolean + playedAt?: Prisma.DateTimeWithAggregatesFilter<"DailyResult"> | Date | string +} + +export type DailyResultCreateInput = { + id?: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string + puzzle: Prisma.DailyPuzzleCreateNestedOneWithoutResultsInput + user: Prisma.UserCreateNestedOneWithoutDailyResultsInput +} + +export type DailyResultUncheckedCreateInput = { + id?: string + puzzleId: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + puzzle?: Prisma.DailyPuzzleUpdateOneRequiredWithoutResultsNestedInput + user?: Prisma.UserUpdateOneRequiredWithoutDailyResultsNestedInput +} + +export type DailyResultUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + puzzleId?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultCreateManyInput = { + id?: string + puzzleId: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + puzzleId?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultListRelationFilter = { + every?: Prisma.DailyResultWhereInput + some?: Prisma.DailyResultWhereInput + none?: Prisma.DailyResultWhereInput +} + +export type DailyResultOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type DailyResultPuzzleIdUserIdCompoundUniqueInput = { + puzzleId: string + userId: string +} + +export type DailyResultCountOrderByAggregateInput = { + id?: Prisma.SortOrder + puzzleId?: Prisma.SortOrder + userId?: Prisma.SortOrder + path?: Prisma.SortOrder + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder + won?: Prisma.SortOrder + playedAt?: Prisma.SortOrder +} + +export type DailyResultAvgOrderByAggregateInput = { + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder +} + +export type DailyResultMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + puzzleId?: Prisma.SortOrder + userId?: Prisma.SortOrder + path?: Prisma.SortOrder + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder + won?: Prisma.SortOrder + playedAt?: Prisma.SortOrder +} + +export type DailyResultMinOrderByAggregateInput = { + id?: Prisma.SortOrder + puzzleId?: Prisma.SortOrder + userId?: Prisma.SortOrder + path?: Prisma.SortOrder + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder + won?: Prisma.SortOrder + playedAt?: Prisma.SortOrder +} + +export type DailyResultSumOrderByAggregateInput = { + clicks?: Prisma.SortOrder + timeSeconds?: Prisma.SortOrder +} + +export type DailyResultCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutUserInput[] | Prisma.DailyResultUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutUserInput | Prisma.DailyResultCreateOrConnectWithoutUserInput[] + createMany?: Prisma.DailyResultCreateManyUserInputEnvelope + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] +} + +export type DailyResultUncheckedCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutUserInput[] | Prisma.DailyResultUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutUserInput | Prisma.DailyResultCreateOrConnectWithoutUserInput[] + createMany?: Prisma.DailyResultCreateManyUserInputEnvelope + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] +} + +export type DailyResultUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutUserInput[] | Prisma.DailyResultUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutUserInput | Prisma.DailyResultCreateOrConnectWithoutUserInput[] + upsert?: Prisma.DailyResultUpsertWithWhereUniqueWithoutUserInput | Prisma.DailyResultUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.DailyResultCreateManyUserInputEnvelope + set?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + disconnect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + delete?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + update?: Prisma.DailyResultUpdateWithWhereUniqueWithoutUserInput | Prisma.DailyResultUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.DailyResultUpdateManyWithWhereWithoutUserInput | Prisma.DailyResultUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] +} + +export type DailyResultUncheckedUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutUserInput[] | Prisma.DailyResultUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutUserInput | Prisma.DailyResultCreateOrConnectWithoutUserInput[] + upsert?: Prisma.DailyResultUpsertWithWhereUniqueWithoutUserInput | Prisma.DailyResultUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.DailyResultCreateManyUserInputEnvelope + set?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + disconnect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + delete?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + update?: Prisma.DailyResultUpdateWithWhereUniqueWithoutUserInput | Prisma.DailyResultUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.DailyResultUpdateManyWithWhereWithoutUserInput | Prisma.DailyResultUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] +} + +export type DailyResultCreateNestedManyWithoutPuzzleInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutPuzzleInput[] | Prisma.DailyResultUncheckedCreateWithoutPuzzleInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutPuzzleInput | Prisma.DailyResultCreateOrConnectWithoutPuzzleInput[] + createMany?: Prisma.DailyResultCreateManyPuzzleInputEnvelope + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] +} + +export type DailyResultUncheckedCreateNestedManyWithoutPuzzleInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutPuzzleInput[] | Prisma.DailyResultUncheckedCreateWithoutPuzzleInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutPuzzleInput | Prisma.DailyResultCreateOrConnectWithoutPuzzleInput[] + createMany?: Prisma.DailyResultCreateManyPuzzleInputEnvelope + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] +} + +export type DailyResultUpdateManyWithoutPuzzleNestedInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutPuzzleInput[] | Prisma.DailyResultUncheckedCreateWithoutPuzzleInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutPuzzleInput | Prisma.DailyResultCreateOrConnectWithoutPuzzleInput[] + upsert?: Prisma.DailyResultUpsertWithWhereUniqueWithoutPuzzleInput | Prisma.DailyResultUpsertWithWhereUniqueWithoutPuzzleInput[] + createMany?: Prisma.DailyResultCreateManyPuzzleInputEnvelope + set?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + disconnect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + delete?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + update?: Prisma.DailyResultUpdateWithWhereUniqueWithoutPuzzleInput | Prisma.DailyResultUpdateWithWhereUniqueWithoutPuzzleInput[] + updateMany?: Prisma.DailyResultUpdateManyWithWhereWithoutPuzzleInput | Prisma.DailyResultUpdateManyWithWhereWithoutPuzzleInput[] + deleteMany?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] +} + +export type DailyResultUncheckedUpdateManyWithoutPuzzleNestedInput = { + create?: Prisma.XOR | Prisma.DailyResultCreateWithoutPuzzleInput[] | Prisma.DailyResultUncheckedCreateWithoutPuzzleInput[] + connectOrCreate?: Prisma.DailyResultCreateOrConnectWithoutPuzzleInput | Prisma.DailyResultCreateOrConnectWithoutPuzzleInput[] + upsert?: Prisma.DailyResultUpsertWithWhereUniqueWithoutPuzzleInput | Prisma.DailyResultUpsertWithWhereUniqueWithoutPuzzleInput[] + createMany?: Prisma.DailyResultCreateManyPuzzleInputEnvelope + set?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + disconnect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + delete?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + connect?: Prisma.DailyResultWhereUniqueInput | Prisma.DailyResultWhereUniqueInput[] + update?: Prisma.DailyResultUpdateWithWhereUniqueWithoutPuzzleInput | Prisma.DailyResultUpdateWithWhereUniqueWithoutPuzzleInput[] + updateMany?: Prisma.DailyResultUpdateManyWithWhereWithoutPuzzleInput | Prisma.DailyResultUpdateManyWithWhereWithoutPuzzleInput[] + deleteMany?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] +} + +export type DailyResultCreateWithoutUserInput = { + id?: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string + puzzle: Prisma.DailyPuzzleCreateNestedOneWithoutResultsInput +} + +export type DailyResultUncheckedCreateWithoutUserInput = { + id?: string + puzzleId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultCreateOrConnectWithoutUserInput = { + where: Prisma.DailyResultWhereUniqueInput + create: Prisma.XOR +} + +export type DailyResultCreateManyUserInputEnvelope = { + data: Prisma.DailyResultCreateManyUserInput | Prisma.DailyResultCreateManyUserInput[] +} + +export type DailyResultUpsertWithWhereUniqueWithoutUserInput = { + where: Prisma.DailyResultWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type DailyResultUpdateWithWhereUniqueWithoutUserInput = { + where: Prisma.DailyResultWhereUniqueInput + data: Prisma.XOR +} + +export type DailyResultUpdateManyWithWhereWithoutUserInput = { + where: Prisma.DailyResultScalarWhereInput + data: Prisma.XOR +} + +export type DailyResultScalarWhereInput = { + AND?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] + OR?: Prisma.DailyResultScalarWhereInput[] + NOT?: Prisma.DailyResultScalarWhereInput | Prisma.DailyResultScalarWhereInput[] + id?: Prisma.StringFilter<"DailyResult"> | string + puzzleId?: Prisma.StringFilter<"DailyResult"> | string + userId?: Prisma.StringFilter<"DailyResult"> | string + path?: Prisma.StringFilter<"DailyResult"> | string + clicks?: Prisma.IntFilter<"DailyResult"> | number + timeSeconds?: Prisma.FloatFilter<"DailyResult"> | number + won?: Prisma.BoolFilter<"DailyResult"> | boolean + playedAt?: Prisma.DateTimeFilter<"DailyResult"> | Date | string +} + +export type DailyResultCreateWithoutPuzzleInput = { + id?: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string + user: Prisma.UserCreateNestedOneWithoutDailyResultsInput +} + +export type DailyResultUncheckedCreateWithoutPuzzleInput = { + id?: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultCreateOrConnectWithoutPuzzleInput = { + where: Prisma.DailyResultWhereUniqueInput + create: Prisma.XOR +} + +export type DailyResultCreateManyPuzzleInputEnvelope = { + data: Prisma.DailyResultCreateManyPuzzleInput | Prisma.DailyResultCreateManyPuzzleInput[] +} + +export type DailyResultUpsertWithWhereUniqueWithoutPuzzleInput = { + where: Prisma.DailyResultWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type DailyResultUpdateWithWhereUniqueWithoutPuzzleInput = { + where: Prisma.DailyResultWhereUniqueInput + data: Prisma.XOR +} + +export type DailyResultUpdateManyWithWhereWithoutPuzzleInput = { + where: Prisma.DailyResultScalarWhereInput + data: Prisma.XOR +} + +export type DailyResultCreateManyUserInput = { + id?: string + puzzleId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + puzzle?: Prisma.DailyPuzzleUpdateOneRequiredWithoutResultsNestedInput +} + +export type DailyResultUncheckedUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + puzzleId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultUncheckedUpdateManyWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + puzzleId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultCreateManyPuzzleInput = { + id?: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt?: Date | string +} + +export type DailyResultUpdateWithoutPuzzleInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutDailyResultsNestedInput +} + +export type DailyResultUncheckedUpdateWithoutPuzzleInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DailyResultUncheckedUpdateManyWithoutPuzzleInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + path?: Prisma.StringFieldUpdateOperationsInput | string + clicks?: Prisma.IntFieldUpdateOperationsInput | number + timeSeconds?: Prisma.FloatFieldUpdateOperationsInput | number + won?: Prisma.BoolFieldUpdateOperationsInput | boolean + playedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type DailyResultSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + puzzleId?: boolean + userId?: boolean + path?: boolean + clicks?: boolean + timeSeconds?: boolean + won?: boolean + playedAt?: boolean + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["dailyResult"]> + +export type DailyResultSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + puzzleId?: boolean + userId?: boolean + path?: boolean + clicks?: boolean + timeSeconds?: boolean + won?: boolean + playedAt?: boolean + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["dailyResult"]> + +export type DailyResultSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + puzzleId?: boolean + userId?: boolean + path?: boolean + clicks?: boolean + timeSeconds?: boolean + won?: boolean + playedAt?: boolean + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["dailyResult"]> + +export type DailyResultSelectScalar = { + id?: boolean + puzzleId?: boolean + userId?: boolean + path?: boolean + clicks?: boolean + timeSeconds?: boolean + won?: boolean + playedAt?: boolean +} + +export type DailyResultOmit = runtime.Types.Extensions.GetOmit<"id" | "puzzleId" | "userId" | "path" | "clicks" | "timeSeconds" | "won" | "playedAt", ExtArgs["result"]["dailyResult"]> +export type DailyResultInclude = { + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} +export type DailyResultIncludeCreateManyAndReturn = { + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} +export type DailyResultIncludeUpdateManyAndReturn = { + puzzle?: boolean | Prisma.DailyPuzzleDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} + +export type $DailyResultPayload = { + name: "DailyResult" + objects: { + puzzle: Prisma.$DailyPuzzlePayload + user: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + puzzleId: string + userId: string + path: string + clicks: number + timeSeconds: number + won: boolean + playedAt: Date + }, ExtArgs["result"]["dailyResult"]> + composites: {} +} + +export type DailyResultGetPayload = runtime.Types.Result.GetResult + +export type DailyResultCountArgs = + Omit & { + select?: DailyResultCountAggregateInputType | true + } + +export interface DailyResultDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['DailyResult'], meta: { name: 'DailyResult' } } + /** + * Find zero or one DailyResult that matches the filter. + * @param {DailyResultFindUniqueArgs} args - Arguments to find a DailyResult + * @example + * // Get one DailyResult + * const dailyResult = await prisma.dailyResult.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one DailyResult that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DailyResultFindUniqueOrThrowArgs} args - Arguments to find a DailyResult + * @example + * // Get one DailyResult + * const dailyResult = await prisma.dailyResult.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DailyResult that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultFindFirstArgs} args - Arguments to find a DailyResult + * @example + * // Get one DailyResult + * const dailyResult = await prisma.dailyResult.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DailyResult that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultFindFirstOrThrowArgs} args - Arguments to find a DailyResult + * @example + * // Get one DailyResult + * const dailyResult = await prisma.dailyResult.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more DailyResults that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all DailyResults + * const dailyResults = await prisma.dailyResult.findMany() + * + * // Get first 10 DailyResults + * const dailyResults = await prisma.dailyResult.findMany({ take: 10 }) + * + * // Only select the `id` + * const dailyResultWithIdOnly = await prisma.dailyResult.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a DailyResult. + * @param {DailyResultCreateArgs} args - Arguments to create a DailyResult. + * @example + * // Create one DailyResult + * const DailyResult = await prisma.dailyResult.create({ + * data: { + * // ... data to create a DailyResult + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many DailyResults. + * @param {DailyResultCreateManyArgs} args - Arguments to create many DailyResults. + * @example + * // Create many DailyResults + * const dailyResult = await prisma.dailyResult.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many DailyResults and returns the data saved in the database. + * @param {DailyResultCreateManyAndReturnArgs} args - Arguments to create many DailyResults. + * @example + * // Create many DailyResults + * const dailyResult = await prisma.dailyResult.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many DailyResults and only return the `id` + * const dailyResultWithIdOnly = await prisma.dailyResult.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a DailyResult. + * @param {DailyResultDeleteArgs} args - Arguments to delete one DailyResult. + * @example + * // Delete one DailyResult + * const DailyResult = await prisma.dailyResult.delete({ + * where: { + * // ... filter to delete one DailyResult + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one DailyResult. + * @param {DailyResultUpdateArgs} args - Arguments to update one DailyResult. + * @example + * // Update one DailyResult + * const dailyResult = await prisma.dailyResult.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more DailyResults. + * @param {DailyResultDeleteManyArgs} args - Arguments to filter DailyResults to delete. + * @example + * // Delete a few DailyResults + * const { count } = await prisma.dailyResult.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DailyResults. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many DailyResults + * const dailyResult = await prisma.dailyResult.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DailyResults and returns the data updated in the database. + * @param {DailyResultUpdateManyAndReturnArgs} args - Arguments to update many DailyResults. + * @example + * // Update many DailyResults + * const dailyResult = await prisma.dailyResult.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more DailyResults and only return the `id` + * const dailyResultWithIdOnly = await prisma.dailyResult.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one DailyResult. + * @param {DailyResultUpsertArgs} args - Arguments to update or create a DailyResult. + * @example + * // Update or create a DailyResult + * const dailyResult = await prisma.dailyResult.upsert({ + * create: { + * // ... data to create a DailyResult + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the DailyResult we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__DailyResultClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of DailyResults. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultCountArgs} args - Arguments to filter DailyResults to count. + * @example + * // Count the number of DailyResults + * const count = await prisma.dailyResult.count({ + * where: { + * // ... the filter for the DailyResults we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a DailyResult. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by DailyResult. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DailyResultGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends DailyResultGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: DailyResultGroupByArgs['orderBy'] } + : { orderBy?: DailyResultGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetDailyResultGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the DailyResult model + */ +readonly fields: DailyResultFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for DailyResult. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__DailyResultClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + puzzle = {}>(args?: Prisma.Subset>): Prisma.Prisma__DailyPuzzleClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the DailyResult model + */ +export interface DailyResultFieldRefs { + readonly id: Prisma.FieldRef<"DailyResult", 'String'> + readonly puzzleId: Prisma.FieldRef<"DailyResult", 'String'> + readonly userId: Prisma.FieldRef<"DailyResult", 'String'> + readonly path: Prisma.FieldRef<"DailyResult", 'String'> + readonly clicks: Prisma.FieldRef<"DailyResult", 'Int'> + readonly timeSeconds: Prisma.FieldRef<"DailyResult", 'Float'> + readonly won: Prisma.FieldRef<"DailyResult", 'Boolean'> + readonly playedAt: Prisma.FieldRef<"DailyResult", 'DateTime'> +} + + +// Custom InputTypes +/** + * DailyResult findUnique + */ +export type DailyResultFindUniqueArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter, which DailyResult to fetch. + */ + where: Prisma.DailyResultWhereUniqueInput +} + +/** + * DailyResult findUniqueOrThrow + */ +export type DailyResultFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter, which DailyResult to fetch. + */ + where: Prisma.DailyResultWhereUniqueInput +} + +/** + * DailyResult findFirst + */ +export type DailyResultFindFirstArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter, which DailyResult to fetch. + */ + where?: Prisma.DailyResultWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyResults to fetch. + */ + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DailyResults. + */ + cursor?: Prisma.DailyResultWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyResults from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyResults. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyResults. + */ + distinct?: Prisma.DailyResultScalarFieldEnum | Prisma.DailyResultScalarFieldEnum[] +} + +/** + * DailyResult findFirstOrThrow + */ +export type DailyResultFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter, which DailyResult to fetch. + */ + where?: Prisma.DailyResultWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyResults to fetch. + */ + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DailyResults. + */ + cursor?: Prisma.DailyResultWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyResults from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyResults. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyResults. + */ + distinct?: Prisma.DailyResultScalarFieldEnum | Prisma.DailyResultScalarFieldEnum[] +} + +/** + * DailyResult findMany + */ +export type DailyResultFindManyArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter, which DailyResults to fetch. + */ + where?: Prisma.DailyResultWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DailyResults to fetch. + */ + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing DailyResults. + */ + cursor?: Prisma.DailyResultWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DailyResults from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DailyResults. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DailyResults. + */ + distinct?: Prisma.DailyResultScalarFieldEnum | Prisma.DailyResultScalarFieldEnum[] +} + +/** + * DailyResult create + */ +export type DailyResultCreateArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * The data needed to create a DailyResult. + */ + data: Prisma.XOR +} + +/** + * DailyResult createMany + */ +export type DailyResultCreateManyArgs = { + /** + * The data used to create many DailyResults. + */ + data: Prisma.DailyResultCreateManyInput | Prisma.DailyResultCreateManyInput[] +} + +/** + * DailyResult createManyAndReturn + */ +export type DailyResultCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelectCreateManyAndReturn | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * The data used to create many DailyResults. + */ + data: Prisma.DailyResultCreateManyInput | Prisma.DailyResultCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultIncludeCreateManyAndReturn | null +} + +/** + * DailyResult update + */ +export type DailyResultUpdateArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * The data needed to update a DailyResult. + */ + data: Prisma.XOR + /** + * Choose, which DailyResult to update. + */ + where: Prisma.DailyResultWhereUniqueInput +} + +/** + * DailyResult updateMany + */ +export type DailyResultUpdateManyArgs = { + /** + * The data used to update DailyResults. + */ + data: Prisma.XOR + /** + * Filter which DailyResults to update + */ + where?: Prisma.DailyResultWhereInput + /** + * Limit how many DailyResults to update. + */ + limit?: number +} + +/** + * DailyResult updateManyAndReturn + */ +export type DailyResultUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * The data used to update DailyResults. + */ + data: Prisma.XOR + /** + * Filter which DailyResults to update + */ + where?: Prisma.DailyResultWhereInput + /** + * Limit how many DailyResults to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultIncludeUpdateManyAndReturn | null +} + +/** + * DailyResult upsert + */ +export type DailyResultUpsertArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * The filter to search for the DailyResult to update in case it exists. + */ + where: Prisma.DailyResultWhereUniqueInput + /** + * In case the DailyResult found by the `where` argument doesn't exist, create a new DailyResult with this data. + */ + create: Prisma.XOR + /** + * In case the DailyResult was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * DailyResult delete + */ +export type DailyResultDeleteArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + /** + * Filter which DailyResult to delete. + */ + where: Prisma.DailyResultWhereUniqueInput +} + +/** + * DailyResult deleteMany + */ +export type DailyResultDeleteManyArgs = { + /** + * Filter which DailyResults to delete + */ + where?: Prisma.DailyResultWhereInput + /** + * Limit how many DailyResults to delete. + */ + limit?: number +} + +/** + * DailyResult without action + */ +export type DailyResultDefaultArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null +} diff --git a/lib/generated/prisma/models/User.ts b/lib/generated/prisma/models/User.ts index 084c877..452066e 100644 --- a/lib/generated/prisma/models/User.ts +++ b/lib/generated/prisma/models/User.ts @@ -183,6 +183,7 @@ export type UserWhereInput = { password?: Prisma.StringFilter<"User"> | string createdAt?: Prisma.DateTimeFilter<"User"> | Date | string games?: Prisma.GameListRelationFilter + dailyResults?: Prisma.DailyResultListRelationFilter } export type UserOrderByWithRelationInput = { @@ -192,6 +193,7 @@ export type UserOrderByWithRelationInput = { password?: Prisma.SortOrder createdAt?: Prisma.SortOrder games?: Prisma.GameOrderByRelationAggregateInput + dailyResults?: Prisma.DailyResultOrderByRelationAggregateInput } export type UserWhereUniqueInput = Prisma.AtLeast<{ @@ -204,6 +206,7 @@ export type UserWhereUniqueInput = Prisma.AtLeast<{ password?: Prisma.StringFilter<"User"> | string createdAt?: Prisma.DateTimeFilter<"User"> | Date | string games?: Prisma.GameListRelationFilter + dailyResults?: Prisma.DailyResultListRelationFilter }, "id" | "email"> export type UserOrderByWithAggregationInput = { @@ -235,6 +238,7 @@ export type UserCreateInput = { password: string createdAt?: Date | string games?: Prisma.GameCreateNestedManyWithoutUserInput + dailyResults?: Prisma.DailyResultCreateNestedManyWithoutUserInput } export type UserUncheckedCreateInput = { @@ -244,6 +248,7 @@ export type UserUncheckedCreateInput = { password: string createdAt?: Date | string games?: Prisma.GameUncheckedCreateNestedManyWithoutUserInput + dailyResults?: Prisma.DailyResultUncheckedCreateNestedManyWithoutUserInput } export type UserUpdateInput = { @@ -253,6 +258,7 @@ export type UserUpdateInput = { password?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string games?: Prisma.GameUpdateManyWithoutUserNestedInput + dailyResults?: Prisma.DailyResultUpdateManyWithoutUserNestedInput } export type UserUncheckedUpdateInput = { @@ -262,6 +268,7 @@ export type UserUncheckedUpdateInput = { password?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string games?: Prisma.GameUncheckedUpdateManyWithoutUserNestedInput + dailyResults?: Prisma.DailyResultUncheckedUpdateManyWithoutUserNestedInput } export type UserCreateManyInput = { @@ -339,12 +346,27 @@ export type UserUpdateOneRequiredWithoutGamesNestedInput = { update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutGamesInput> } +export type UserCreateNestedOneWithoutDailyResultsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutDailyResultsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutDailyResultsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutDailyResultsInput + upsert?: Prisma.UserUpsertWithoutDailyResultsInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutDailyResultsInput> +} + export type UserCreateWithoutGamesInput = { id?: string name: string email: string password: string createdAt?: Date | string + dailyResults?: Prisma.DailyResultCreateNestedManyWithoutUserInput } export type UserUncheckedCreateWithoutGamesInput = { @@ -353,6 +375,7 @@ export type UserUncheckedCreateWithoutGamesInput = { email: string password: string createdAt?: Date | string + dailyResults?: Prisma.DailyResultUncheckedCreateNestedManyWithoutUserInput } export type UserCreateOrConnectWithoutGamesInput = { @@ -377,6 +400,7 @@ export type UserUpdateWithoutGamesInput = { email?: Prisma.StringFieldUpdateOperationsInput | string password?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + dailyResults?: Prisma.DailyResultUpdateManyWithoutUserNestedInput } export type UserUncheckedUpdateWithoutGamesInput = { @@ -385,6 +409,59 @@ export type UserUncheckedUpdateWithoutGamesInput = { email?: Prisma.StringFieldUpdateOperationsInput | string password?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + dailyResults?: Prisma.DailyResultUncheckedUpdateManyWithoutUserNestedInput +} + +export type UserCreateWithoutDailyResultsInput = { + id?: string + name: string + email: string + password: string + createdAt?: Date | string + games?: Prisma.GameCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateWithoutDailyResultsInput = { + id?: string + name: string + email: string + password: string + createdAt?: Date | string + games?: Prisma.GameUncheckedCreateNestedManyWithoutUserInput +} + +export type UserCreateOrConnectWithoutDailyResultsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutDailyResultsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutDailyResultsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutDailyResultsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + games?: Prisma.GameUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateWithoutDailyResultsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + games?: Prisma.GameUncheckedUpdateManyWithoutUserNestedInput } @@ -394,10 +471,12 @@ export type UserUncheckedUpdateWithoutGamesInput = { export type UserCountOutputType = { games: number + dailyResults: number } export type UserCountOutputTypeSelect = { games?: boolean | UserCountOutputTypeCountGamesArgs + dailyResults?: boolean | UserCountOutputTypeCountDailyResultsArgs } /** @@ -417,6 +496,13 @@ export type UserCountOutputTypeCountGamesArgs = { + where?: Prisma.DailyResultWhereInput +} + export type UserSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -425,6 +511,7 @@ export type UserSelect + dailyResults?: boolean | Prisma.User$dailyResultsArgs _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs }, ExtArgs["result"]["user"]> @@ -455,6 +542,7 @@ export type UserSelectScalar = { export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "email" | "password" | "createdAt", ExtArgs["result"]["user"]> export type UserInclude = { games?: boolean | Prisma.User$gamesArgs + dailyResults?: boolean | Prisma.User$dailyResultsArgs _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs } export type UserIncludeCreateManyAndReturn = {} @@ -464,6 +552,7 @@ export type $UserPayload[] + dailyResults: Prisma.$DailyResultPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -866,6 +955,7 @@ readonly fields: UserFieldRefs; export interface Prisma__UserClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" games = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + dailyResults = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1314,6 +1404,30 @@ export type User$gamesArgs = { + /** + * Select specific fields to fetch from the DailyResult + */ + select?: Prisma.DailyResultSelect | null + /** + * Omit specific fields from the DailyResult + */ + omit?: Prisma.DailyResultOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DailyResultInclude | null + where?: Prisma.DailyResultWhereInput + orderBy?: Prisma.DailyResultOrderByWithRelationInput | Prisma.DailyResultOrderByWithRelationInput[] + cursor?: Prisma.DailyResultWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.DailyResultScalarFieldEnum | Prisma.DailyResultScalarFieldEnum[] +} + /** * User without action */ diff --git a/lib/types.ts b/lib/types.ts index 9cca4a5..d2c90f4 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,4 +1,4 @@ -export type Screen = "home" | "lobby" | "game" | "solo" | "profile" | "leaderboard"; +export type Screen = "home" | "lobby" | "game" | "solo" | "profile" | "leaderboard" | "daily" | "blitz"; export type WikiArticle = { title: string; diff --git a/lib/useBlitzGame.ts b/lib/useBlitzGame.ts new file mode 100644 index 0000000..44b6786 --- /dev/null +++ b/lib/useBlitzGame.ts @@ -0,0 +1,132 @@ +"use client"; + +import { useState, useCallback, useRef, useEffect } from "react"; +import { fetchArticle, pickTwoArticles } from "./wiki"; + +const BLITZ_DURATION = 120; // 2 minutes en secondes + +export type BlitzPhase = "setup" | "playing" | "ended"; + +export function useBlitzGame() { + const [phase, setPhase] = useState("setup"); + const [html, setHtml] = useState(""); + const [title, setTitle] = useState(""); + const [loading, setLoading] = useState(false); + const [loadError, setLoadError] = useState(null); + + const [timeLeft, setTimeLeft] = useState(BLITZ_DURATION); + const [clicks, setClicks] = useState(0); + const [visited, setVisited] = useState([]); // articles uniques + + const clicksRef = useRef(0); + const visitedRef = useRef>(new Set()); + const visitedListRef = useRef([]); + const loadingRef = useRef(false); + const endedRef = useRef(false); + const intervalRef = useRef | null>(null); + const startTimeRef = useRef(0); + + function startTimer() { + startTimeRef.current = Date.now(); + intervalRef.current = setInterval(() => { + const elapsed = (Date.now() - startTimeRef.current) / 1000; + const left = Math.max(0, BLITZ_DURATION - elapsed); + setTimeLeft(left); + if (left <= 0) endGame(); + }, 200); + } + + function endGame() { + if (endedRef.current) return; + endedRef.current = true; + if (intervalRef.current) clearInterval(intervalRef.current); + setPhase("ended"); + // Sauvegarder + fetch("/api/games", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + mode: "blitz", + startArticle: visitedListRef.current[0] ?? "", + targetArticle: "", + path: visitedListRef.current, + clicks: clicksRef.current, + timeSeconds: BLITZ_DURATION, + won: true, + }), + }).catch(() => {}); + } + + useEffect(() => () => { if (intervalRef.current) clearInterval(intervalRef.current); }, []); + + async function loadArticle(t: string) { + setLoadError(null); + setLoading(true); + loadingRef.current = true; + const art = await fetchArticle(t); + setLoading(false); + loadingRef.current = false; + if (!art) { setLoadError(`Impossible de charger "${t}".`); return null; } + setHtml(art.html); + setTitle(art.title); + return art.title; + } + + async function start() { + setLoading(true); + clicksRef.current = 0; setClicks(0); + visitedRef.current = new Set(); + visitedListRef.current = []; + endedRef.current = false; + setTimeLeft(BLITZ_DURATION); + setVisited([]); + setLoadError(null); + + const { start: startArticle } = await pickTwoArticles(); + const canonical = await loadArticle(startArticle); + if (!canonical) return; + + visitedRef.current.add(canonical); + visitedListRef.current = [canonical]; + setVisited([canonical]); + setPhase("playing"); + startTimer(); + } + + const navigate = useCallback(async (t: string) => { + if (loadingRef.current || endedRef.current) return; + clicksRef.current += 1; + setClicks(clicksRef.current); + + const canonical = await loadArticle(t); + if (!canonical) return; + + if (!visitedRef.current.has(canonical)) { + visitedRef.current.add(canonical); + visitedListRef.current = [...visitedListRef.current, canonical]; + setVisited([...visitedListRef.current]); + } + window.scrollTo({ top: 0, behavior: "smooth" }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + function reset() { + if (intervalRef.current) clearInterval(intervalRef.current); + endedRef.current = false; + clicksRef.current = 0; setClicks(0); + visitedRef.current = new Set(); + visitedListRef.current = []; + setVisited([]); + setHtml(""); setTitle(""); + setTimeLeft(BLITZ_DURATION); + setPhase("setup"); + setLoadError(null); + } + + return { + phase, html, title, loading, loadError, + timeLeft, clicks, visited, + start, navigate, reset, + retryLoad: () => title && loadArticle(title), + }; +} diff --git a/lib/useDailyGame.ts b/lib/useDailyGame.ts new file mode 100644 index 0000000..87913a6 --- /dev/null +++ b/lib/useDailyGame.ts @@ -0,0 +1,144 @@ +"use client"; + +import { useState, useCallback, useRef, useEffect } from "react"; +import { fetchArticle, normalizeTitle } from "./wiki"; +import { useTimer } from "./useTimer"; + +export type DailyPhase = "loading" | "playing" | "won" | "gave_up" | "already_played"; + +export type DailyPuzzleInfo = { + id: string; + date: string; + startArticle: string; + targetArticle: string; +}; + +export type DailyResult = { + clicks: number; + timeSeconds: number; + won: boolean; + path: string[]; +}; + +export function useDailyGame() { + const timer = useTimer(); + const [phase, setPhase] = useState("loading"); + const [puzzle, setPuzzle] = useState(null); + const [myResult, setMyResult] = useState(null); + + const [html, setHtml] = useState(""); + const [title, setTitle] = useState(""); + const [loading, setLoading] = useState(false); + const [loadError, setLoadError] = useState(null); + + const clicksRef = useRef(0); + const [clicks, setClicks] = useState(0); + const pathRef = useRef([]); + const [history, setHistory] = useState([]); + const timerStartedRef = useRef(false); + const gameEndedRef = useRef(false); + const loadingRef = useRef(false); + + useEffect(() => { + fetch("/api/daily") + .then((r) => r.json()) + .then(async (data: { puzzle: DailyPuzzleInfo; alreadyPlayed: boolean; myResult: DailyResult | null }) => { + setPuzzle(data.puzzle); + if (data.alreadyPlayed && data.myResult) { + setMyResult(data.myResult); + setPhase("already_played"); + return; + } + // Charger l'article de départ + const art = await fetchArticle(data.puzzle.startArticle); + if (!art) { setLoadError("Impossible de charger l'article de départ."); return; } + setHtml(art.html); + setTitle(art.title); + pathRef.current = [art.title]; + setHistory([art.title]); + setPhase("playing"); + }) + .catch(() => setLoadError("Impossible de charger le défi du jour.")); + }, []); + + async function loadArticle(t: string) { + setLoadError(null); + setLoading(true); + loadingRef.current = true; + const art = await fetchArticle(t); + setLoading(false); + loadingRef.current = false; + if (!art) { setLoadError(`Impossible de charger "${t}".`); return null; } + setHtml(art.html); + setTitle(art.title); + return art.title; + } + + async function submitResult(won: boolean) { + if (!puzzle) return; + const result: DailyResult = { + clicks: clicksRef.current, + timeSeconds: timer.elapsed, + won, + path: pathRef.current, + }; + setMyResult(result); + await fetch("/api/daily", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ puzzleId: puzzle.id, ...result, path: result.path }), + }).catch(() => {}); + } + + const navigate = useCallback(async (t: string) => { + if (loadingRef.current || gameEndedRef.current) return; + clicksRef.current += 1; + setClicks(clicksRef.current); + if (!timerStartedRef.current) { timer.start(); timerStartedRef.current = true; } + + const canonical = await loadArticle(t); + if (!canonical) return; + const newPath = [...pathRef.current, canonical]; + pathRef.current = newPath; + setHistory(newPath); + window.scrollTo({ top: 0, behavior: "smooth" }); + + if (puzzle && normalizeTitle(canonical) === normalizeTitle(puzzle.targetArticle)) { + timer.stop(); + gameEndedRef.current = true; + setPhase("won"); + await submitResult(true); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [puzzle]); + + const goBack = useCallback(async () => { + if (loadingRef.current || gameEndedRef.current || pathRef.current.length <= 1) return; + clicksRef.current += 1; + setClicks(clicksRef.current); + if (!timerStartedRef.current) { timer.start(); timerStartedRef.current = true; } + const newPath = pathRef.current.slice(0, -1); + const canonical = await loadArticle(newPath[newPath.length - 1]); + if (!canonical) return; + pathRef.current = newPath; + setHistory(newPath); + window.scrollTo({ top: 0, behavior: "smooth" }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + async function giveUp() { + timer.stop(); + gameEndedRef.current = true; + setPhase("gave_up"); + await submitResult(false); + } + + return { + phase, puzzle, myResult, + html, title, loading, loadError, + history, clicks, elapsed: timer.elapsed, + canGoBack: pathRef.current.length > 1, + navigate, goBack, giveUp, + retryLoad: () => title && loadArticle(title), + }; +} diff --git a/prisma/migrations/20260410193825_add_daily_blitz/migration.sql b/prisma/migrations/20260410193825_add_daily_blitz/migration.sql new file mode 100644 index 0000000..e22938c --- /dev/null +++ b/prisma/migrations/20260410193825_add_daily_blitz/migration.sql @@ -0,0 +1,30 @@ +-- CreateTable +CREATE TABLE "DailyPuzzle" ( + "id" TEXT NOT NULL PRIMARY KEY, + "date" TEXT NOT NULL, + "startArticle" TEXT NOT NULL, + "targetArticle" TEXT NOT NULL +); + +-- CreateTable +CREATE TABLE "DailyResult" ( + "id" TEXT NOT NULL PRIMARY KEY, + "puzzleId" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "clicks" INTEGER NOT NULL, + "timeSeconds" REAL NOT NULL, + "won" BOOLEAN NOT NULL, + "playedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "DailyResult_puzzleId_fkey" FOREIGN KEY ("puzzleId") REFERENCES "DailyPuzzle" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "DailyResult_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateIndex +CREATE UNIQUE INDEX "DailyPuzzle_date_key" ON "DailyPuzzle"("date"); + +-- CreateIndex +CREATE INDEX "DailyResult_puzzleId_idx" ON "DailyResult"("puzzleId"); + +-- CreateIndex +CREATE UNIQUE INDEX "DailyResult_puzzleId_userId_key" ON "DailyResult"("puzzleId", "userId"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index be17fa4..c792f3f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -15,14 +15,15 @@ model User { email String @unique password String createdAt DateTime @default(now()) - games Game[] + games Game[] + dailyResults DailyResult[] } model Game { id String @id @default(cuid()) userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) - mode String // "solo" | "multi" + mode String // "solo" | "multi" | "daily" | "blitz" startArticle String targetArticle String path String // JSON array de titres @@ -33,3 +34,27 @@ model Game { @@index([userId]) } + +model DailyPuzzle { + id String @id @default(cuid()) + date String @unique // "YYYY-MM-DD" + startArticle String + targetArticle String + results DailyResult[] +} + +model DailyResult { + id String @id @default(cuid()) + puzzleId String + puzzle DailyPuzzle @relation(fields: [puzzleId], references: [id], onDelete: Cascade) + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + path String // JSON + clicks Int + timeSeconds Float + won Boolean + playedAt DateTime @default(now()) + + @@unique([puzzleId, userId]) + @@index([puzzleId]) +} diff --git a/wikirace.db b/wikirace.db index f777f2c..8909f14 100644 Binary files a/wikirace.db and b/wikirace.db differ