diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3c92a8b..d8c0b1f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [24.4.1] + node-version: [25.2.1] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -25,7 +25,7 @@ jobs: - name: ⎔ Setup pnpm uses: pnpm/action-setup@v4 with: - version: 10.13.1 + version: 10.27.0 - name: Setup Node.js uses: actions/setup-node@v4 @@ -41,6 +41,6 @@ jobs: - name: Lint run: pnpm lint - + - name: Build project run: pnpm build diff --git a/.pnpm-store/v10/projects/9e1b7cceca46cdd071268608ba856edf b/.pnpm-store/v10/projects/9e1b7cceca46cdd071268608ba856edf new file mode 120000 index 0000000..a8a4f8c --- /dev/null +++ b/.pnpm-store/v10/projects/9e1b7cceca46cdd071268608ba856edf @@ -0,0 +1 @@ +../../.. \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..038f19c --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,85 @@ +# Agent Guidelines + +## Project Structure + +- **Backend**: `apps/api/` - NestJS with Drizzle ORM +- **Frontend**: `apps/web/` - TanStack Start +- **Shared**: `packages/typescript-config/` - Shared TypeScript configs + +## Frontend + +### Routing (TanStack Start) + +- Use Tanstack Start best practices + +### Data Fetching (TanStack Query) + +- Query keys: `['resource', id, 'sub-resource']` +- Use `invalidateQueries()` without parameters + +### Forms (TanStack Forms) + +- Use `useForm()`, ShadCN Field components (`Field`, `FieldLabel`, `FieldError`), `form.useField()` for fields + +### UI Components (ShadCN + BaseUI) + +- Components: `apps/web/src/components/ui/` - ShadCN +- Prefer BaseUI primitives over raw html (`@base-ui/react`) +- Utils: `apps/web/src/lib/utils.ts` - `cn()` helper +- Tailwind CSS with ShadCN design tokens + +### Type Safety + +- E2E types: `apps/api/generated/openapi.d.ts` (auto-generated) + +### Creating Routes/Components + +- Routes: `apps/web/src/routes/{path}.tsx` with `createFileRoute()` +- Components: `apps/web/src/components/` using ShadCN UI + `cn()` + +## Backend + +### Database + +- Schema: `apps/api/src/databases/drizzle.schema.ts` +- Tables: `apps/api/src/databases/tables/*.table.ts` +- Utils: `apps/api/src/databases/drizzle.utils.ts` +- Provider: `apps/api/src/databases/drizzle.provider.ts` + +### Authentication + +- Provider: `apps/api/src/auth/better-auth.provider.ts` +- Guard: `apps/api/src/auth/guards/auth.guard.ts` +- Decorators: `@Auth()`, `@ActiveUser()`, `@ActiveSession()` + +### Transactions + +- Use `@Transactional()` decorator +- Inject `TransactionHost` +- Don't manually wrap with `tx.transaction()` + +### Services + +- Providers for external clients (Better Auth, Drizzle) +- Services handle business logic +- Export providers with `Inject*()` helpers + +### Error Handling + +- Use NestJS exceptions (`NotFoundException`, `UnauthorizedException`, etc.) + +### Type Safety + +- E2E types: `apps/api/generated/openapi.d.ts` (auto-generated) +- Use `Serialize` decorator for DTO transformation + +### Creating Tables + +1. Create `apps/api/src/databases/tables/{name}.table.ts` +2. Export from `drizzle.schema.ts` +3. Add relations in `drizzle.relations.ts` + +## Important Notes + +- Don't nest transactions - use `@Transactional()` decorator +- Avoid `as any` - use proper types or `as` with specific types diff --git a/apps/api/.env.example b/apps/api/.env.example index d2a5313..b4f5f33 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -1,20 +1,23 @@ # app -PORT=8000 -BASE_URL=http://localhost:8000 -NODE_ENV=development +APP_NAME=SojuStack +APP_PORT=8000 +APP_URL=http://localhost:8000 +APP_WEB_URL=http://localhost:3000 -# better-auth +# auth AUTH_SECRET=CHANGE_THIS_FOR_PROD -# databases -POSTGRES_URL=postgres://postgres:postgres@localhost:5432/postgres -REDIS_URL=redis://localhost:6379 +# database +DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres + +# cache +CACHE_URL=redis://localhost:6379 # email -EMAIL_DOMAIN=example.com +MAIL_DOMAIN=example.com # storage -STORAGE_HOST=localhost -STORAGE_PORT=9000 -STORAGE_ACCESS_KEY=user -STORAGE_SECRET_KEY=password \ No newline at end of file +STORAGE_URL=http://localhost:9000 +STORAGE_REGION=us-east-1 +STORAGE_ACCESS_KEY=admin +STORAGE_SECRET_KEY=admin \ No newline at end of file diff --git a/apps/api/.gitignore b/apps/api/.gitignore index 4b56acf..98c2c51 100644 --- a/apps/api/.gitignore +++ b/apps/api/.gitignore @@ -54,3 +54,5 @@ pids # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +.nestjs_repl_history +generated \ No newline at end of file diff --git a/apps/api/.nestjs_repl_history b/apps/api/.nestjs_repl_history new file mode 100644 index 0000000..4adacb8 --- /dev/null +++ b/apps/api/.nestjs_repl_history @@ -0,0 +1 @@ +$(AppService).getHello() \ No newline at end of file diff --git a/apps/api/drizzle.config.ts b/apps/api/drizzle.config.ts new file mode 100644 index 0000000..b53d39f --- /dev/null +++ b/apps/api/drizzle.config.ts @@ -0,0 +1,12 @@ +// @ts-nocheck +import 'dotenv/config'; +import { defineConfig } from 'drizzle-kit'; + +export default defineConfig({ + dialect: 'postgresql', + schema: './src/databases/drizzle.schema.ts', + out: './src/databases/migrations', + dbCredentials: { + url: process.env['DATABASE_URL']!, + }, +}); diff --git a/apps/api/generated/openapi.d.ts b/apps/api/generated/openapi.d.ts deleted file mode 100644 index d0f475c..0000000 --- a/apps/api/generated/openapi.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -export interface paths { - "/healthz": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: operations["AppController_healthz"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/auth/user": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: operations["AuthController_user"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/auth/session": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: operations["AuthController_session"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/auth/test": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: operations["AuthController_test"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/auth/sessions": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: operations["AuthController_sessions"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/users/me": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch: operations["UsersController_update"]; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - ActiveUserDto: { - id: string; - name: string; - emailVerified: boolean; - email: string; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - image?: string | null; - }; - ActiveSessionDto: { - id: string; - token: string; - userId: string; - /** Format: date-time */ - expiresAt: string; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - ipAddress?: string | null; - userAgent?: string | null; - }; - UpdateUserDto: { - /** Format: binary */ - image: Blob; - name?: string; - }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - AppController_healthz: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - AuthController_user: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ActiveUserDto"]; - }; - }; - }; - }; - AuthController_session: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ActiveSessionDto"]; - }; - }; - }; - }; - AuthController_test: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - AuthController_sessions: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": Record[]; - }; - }; - }; - }; - UsersController_update: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "multipart/form-data": components["schemas"]["UpdateUserDto"]; - }; - }; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; -} diff --git a/apps/api/package.json b/apps/api/package.json index ea36320..b52a92a 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -7,13 +7,15 @@ "private": true, "scripts": { "build": "nest build", - "db:generate": "prisma generate", - "db:migrate:generate": "prisma migrate dev", - "db:migrate:deploy": "prisma migrate deploy", - "db:push": "prisma db push", - "db:reset": "prisma migrate reset", - "db:studio": "prisma studio", + "db:push": "drizzle-kit push", + "db:pull": "drizzle-kit pull", + "db:generate": "drizzle-kit generate", + "db:migrate": "drizzle-kit migrate", + "db:reset": "drizzle-kit reset", + "db:studio": "drizzle-kit studio", + "seed:users": "tsx src/cli.ts seed-users", "dev": "nest start --watch", + "repl": "nest start --watch --entryFile repl", "email:dev": "email dev --dir ./src/notifications/emails --port 3030", "nuke": "docker compose down -v --remove-orphans && docker compose up -d", "start": "nest start", @@ -23,80 +25,78 @@ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", "test:watch": "jest --watch", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit", + "depcheck": "depcheck" }, "dependencies": { - "@aws-sdk/client-s3": "^3.940.0", - "@aws-sdk/s3-request-presigner": "^3.940.0", - "@itgorillaz/configify": "^4.0.1", - "@keyv/redis": "^5.1.4", + "@aws-sdk/client-s3": "^3.958.0", + "@faker-js/faker": "^10.1.0", + "@itgorillaz/configify": "^4.0.2", + "@keyv/redis": "^5.1.5", "@keyv/valkey": "^1.0.11", "@nest-lab/throttler-storage-redis": "^1.1.0", "@nestjs-cls/transactional": "^3.1.1", - "@nestjs-cls/transactional-adapter-prisma": "^1.3.1", - "@nestjs/cache-manager": "^3.0.1", - "@nestjs/common": "^11.1.9", + "@nestjs-cls/transactional-adapter-drizzle-orm": "^1.2.1", + "@nestjs/cache-manager": "^3.1.0", + "@nestjs/common": "^11.1.11", "@nestjs/config": "^4.0.2", - "@nestjs/core": "^11.1.9", + "@nestjs/core": "^11.1.11", "@nestjs/event-emitter": "^3.0.1", - "@nestjs/platform-express": "^11.1.9", + "@nestjs/platform-express": "^11.1.11", "@nestjs/swagger": "^11.2.3", - "@nestjs/throttler": "^6.4.0", - "@paralleldrive/cuid2": "^3.0.4", - "@prisma/adapter-pg": "^7.0.1", - "@prisma/client": "^7.0.1", - "@prisma/client-runtime-utils": "^7.0.1", - "@react-email/components": "^1.0.1", - "@react-email/render": "2.0.0", - "better-auth": "^1.4.1", - "cache-manager": "^7.2.5", - "cacheable": "^2.2.0", + "@nestjs/throttler": "^6.5.0", + "@paralleldrive/cuid2": "^3.0.6", + "@react-email/components": "^1.0.3", + "@react-email/render": "2.0.1", + "@scalar/nestjs-api-reference": "^1.0.13", + "better-auth": "^1.4.10", + "cache-manager": "^7.2.7", + "cacheable": "^2.3.1", "chalk": "^5.6.2", "class-transformer": "^0.5.1", "class-validator": "^0.14.3", - "cookie-parser": "^1.4.7", "cors": "^2.8.5", "date-fns": "^4.1.0", "dotenv": "^17.2.3", - "keyv": "^5.5.4", - "minio": "^8.0.6", + "drizzle-orm": "1.0.0-beta.8-734e789", + "keyv": "^5.5.5", "nestjs-cls": "^6.1.0", "pg": "^8.16.3", - "react": "^19.2.0", - "react-dom": "^19.2.0", + "react": "^19.2.3", + "react-dom": "^19.2.3", "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", - "set-cookie-parser": "^2.7.2", "sharp": "^0.34.5", - "tsx": "^4.20.6" + "tsx": "^4.21.0" }, "devDependencies": { - "@nestjs/cli": "^11.0.12", + "@nestjs/cli": "^11.0.14", "@nestjs/schematics": "^11.0.9", - "@nestjs/testing": "^11.1.9", + "@nestjs/testing": "^11.1.11", "@package/typescript-config": "workspace:*", - "@react-email/preview-server": "5.0.5", + "@react-email/preview-server": "5.1.1", "@swc/cli": "^0.7.9", - "@swc/core": "^1.15.3", + "@swc/core": "^1.15.8", "@types/cookie-parser": "^1.4.10", "@types/cors": "^2.8.19", - "@types/express": "^5.0.5", + "@types/express": "^5.0.6", "@types/jest": "^30.0.0", "@types/multer": "^2.0.0", - "@types/node": "^24.10.1", - "@types/pg": "^8.15.6", + "@types/node": "^25.0.3", + "@types/pg": "^8.16.0", "@types/react": "^19.2.7", "@types/supertest": "^6.0.3", + "depcheck": "^1.4.7", + "drizzle-kit": "1.0.0-beta.8-734e789", "globals": "^16.5.0", "install": "^0.13.0", "jest": "^30.2.0", "openapi-typescript": "^7.10.1", - "pnpm": "^10.23.0", - "prisma": "^7.0.1", - "react-email": "5.0.5", + "pnpm": "^10.27.0", + "react-email": "5.1.1", "source-map-support": "^0.5.21", "supertest": "^7.1.4", - "ts-jest": "^29.4.5", + "ts-jest": "^29.4.6", "ts-loader": "^9.5.4", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", @@ -121,9 +121,5 @@ "moduleNameMapper": { "^src/(.*)$": "/$1" } - }, - "packageManager": "pnpm@10.13.1", - "engines": { - "node": ">=22.17.1" } } diff --git a/apps/api/prisma.config.ts b/apps/api/prisma.config.ts deleted file mode 100644 index 89a6d3c..0000000 --- a/apps/api/prisma.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was generated by Prisma and assumes you have installed the following: -// npm install --save-dev prisma dotenv -import 'dotenv/config'; -import { defineConfig, env } from 'prisma/config'; - -export default defineConfig({ - schema: 'src/databases/schema.prisma', - migrations: { - path: 'src/databases/migrations', - }, - datasource: { - url: env('DATABASE_URL'), - }, -}); diff --git a/apps/api/src/app.module.ts b/apps/api/src/app.module.ts index a4f6dc7..106e01c 100644 --- a/apps/api/src/app.module.ts +++ b/apps/api/src/app.module.ts @@ -18,8 +18,8 @@ import { ClsPluginTransactional } from '@nestjs-cls/transactional'; import { ClsModule } from 'nestjs-cls'; import { ConfigifyModule } from '@itgorillaz/configify'; import { CacheConfig } from './common/config/cache.config'; -import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; -import { PrismaService } from './databases/prisma.service'; +import { TransactionalAdapterDrizzleOrm } from '@nestjs-cls/transactional-adapter-drizzle-orm'; +import { DRIZZLE_PROVIDER } from './databases/drizzle.provider'; @Module({ imports: [ @@ -35,13 +35,11 @@ import { PrismaService } from './databases/prisma.service'; }, }), ClsModule.forRoot({ - global: true, plugins: [ new ClsPluginTransactional({ imports: [DatabasesModule], - adapter: new TransactionalAdapterPrisma({ - prismaInjectionToken: PrismaService, - sqlFlavor: 'postgresql', + adapter: new TransactionalAdapterDrizzleOrm({ + drizzleInstanceToken: DRIZZLE_PROVIDER, }), }), ], diff --git a/apps/api/src/app.service.ts b/apps/api/src/app.service.ts index 927d7cc..8ee62f7 100644 --- a/apps/api/src/app.service.ts +++ b/apps/api/src/app.service.ts @@ -1,8 +1,32 @@ -import { Injectable } from '@nestjs/common'; +import { + Injectable, + OnApplicationBootstrap, + OnApplicationShutdown, +} from '@nestjs/common'; +import { S3Service } from './storage/s3.service'; +import { StorageConfig } from './common/config/storage.config'; @Injectable() -export class AppService { - getHello(): string { - return 'Hello World!'; +export class AppService implements OnApplicationBootstrap { + constructor( + private readonly s3Service: S3Service, + private readonly storageConfig: StorageConfig, + ) {} + + async onApplicationBootstrap() { + await this.setupStorage(); + } + + private async setupStorage() { + const bucketExists = await this.s3Service.bucketExists( + this.storageConfig.bucketName, + ); + + if (bucketExists) return; + await this.s3Service.createBucket(this.storageConfig.bucketName); + await this.s3Service.setBucketPolicy( + this.storageConfig.bucketName, + this.s3Service.getPublicBucketPolicy(this.storageConfig.bucketName), + ); } } diff --git a/apps/api/src/auth/auth.controller.ts b/apps/api/src/auth/auth.controller.ts index 01cac71..d4bec88 100644 --- a/apps/api/src/auth/auth.controller.ts +++ b/apps/api/src/auth/auth.controller.ts @@ -1,23 +1,26 @@ import { Controller, Get, - Request, + Req, + Res, SerializeOptions, UseInterceptors, + All, } from '@nestjs/common'; import { ActiveUser } from './decorators/active-user.decorator'; import { Auth, AuthType } from './decorators/auth.decorator'; import { ActiveUserDto } from './dtos/active-user.dto'; -import { BetterAuthService } from './better-auth.service'; -import { Request as ExpressRequest } from 'express'; -import { fromNodeHeaders } from 'better-auth/node'; +import type { Request, Response } from 'express'; +import { toNodeHandler } from 'better-auth/node'; import { ActiveSession } from './decorators/active-session.decorator'; import { ActiveSessionDto } from './dtos/active-session.dto'; import { TransformDataInterceptor } from 'src/common/interceptors/transform-data.interceptor'; +import { Auth as BetterAuth } from 'better-auth'; +import { InjectBetterAuth } from './better-auth.provider'; @Controller('auth') export class AuthController { - constructor(private readonly betterAuthService: BetterAuthService) {} + constructor(@InjectBetterAuth() private readonly betterAuth: BetterAuth) {} @Get('/user') @UseInterceptors(new TransformDataInterceptor(ActiveUserDto)) @@ -31,22 +34,21 @@ export class AuthController { @Auth(AuthType.Public) @SerializeOptions({ type: ActiveSessionDto }) session(@ActiveSession() session: ActiveSessionDto) { - console.log(session); return session; } - @Get('/test') - @Auth(AuthType.Public) - test() { - return { test: 'test' }; - } + // @Get('/sessions') + // @UseInterceptors(new TransformDataInterceptor(ActiveSessionDto)) + // @Auth(AuthType.Required) + // sessions(@Request() req: ExpressRequest) { + // return this.betterAuth.api.listSessions({ + // headers: fromNodeHeaders(req.headers), + // }); + // } - @Get('/sessions') - @UseInterceptors(new TransformDataInterceptor(ActiveSessionDto)) - @Auth(AuthType.Required) - sessions(@Request() req: ExpressRequest) { - return this.betterAuthService.client.api.listSessions({ - headers: fromNodeHeaders(req.headers), - }); + @All('/client/*path') + @Auth(AuthType.Public) + async handler(@Req() req: Request, @Res() res: Response) { + return toNodeHandler(this.betterAuth)(req, res); } } diff --git a/apps/api/src/auth/auth.module.ts b/apps/api/src/auth/auth.module.ts index f4ae6aa..2016e35 100644 --- a/apps/api/src/auth/auth.module.ts +++ b/apps/api/src/auth/auth.module.ts @@ -1,30 +1,12 @@ import { Module } from '@nestjs/common'; -import { BetterAuthService } from './better-auth.service'; import { AuthController } from './auth.controller'; -import { HttpAdapterHost } from '@nestjs/core'; -import { toNodeHandler } from 'better-auth/node'; import { NotificationsModule } from 'src/notifications/notifications.module'; -import cors, { CorsOptions } from 'cors'; -import { AppConfig } from 'src/common/config/app.config'; -import { AuthConfig } from 'src/common/config/auth.config'; +import { BetterAuthProvider } from './better-auth.provider'; @Module({ imports: [NotificationsModule], - providers: [BetterAuthService], + providers: [BetterAuthProvider], controllers: [AuthController], - exports: [BetterAuthService], + exports: [BetterAuthProvider], }) -export class AuthModule { - constructor( - private readonly adapter: HttpAdapterHost, - private readonly betterAuthService: BetterAuthService, - private readonly appConfig: AppConfig, - private readonly authConfig: AuthConfig, - ) { - this.adapter.httpAdapter.use(cors(this.appConfig.cors as CorsOptions)); - this.adapter.httpAdapter.all( - `${this.authConfig.basePath}/{*any}`, - toNodeHandler(this.betterAuthService.client), - ); - } -} +export class AuthModule {} diff --git a/apps/api/src/auth/better-auth.service.ts b/apps/api/src/auth/better-auth.provider.ts similarity index 57% rename from apps/api/src/auth/better-auth.service.ts rename to apps/api/src/auth/better-auth.provider.ts index 99beb26..a347cb0 100644 --- a/apps/api/src/auth/better-auth.service.ts +++ b/apps/api/src/auth/better-auth.provider.ts @@ -1,56 +1,65 @@ -import { Injectable } from '@nestjs/common'; -import { Auth, betterAuth, BetterAuthOptions } from 'better-auth'; +import { Inject } from '@nestjs/common'; +import { betterAuth, BetterAuthOptions } from 'better-auth'; import { emailOTP, openAPI } from 'better-auth/plugins'; -import { MailService } from 'src/notifications/mail.service'; +import { drizzleAdapter } from 'better-auth/adapters/drizzle'; import { Cache } from '@nestjs/cache-manager'; import { seconds } from '@nestjs/throttler'; +import { TransactionHost } from '@nestjs-cls/transactional'; +import { DrizzleTransactionClient } from 'src/databases/drizzle.provider'; +import * as schema from 'src/databases/drizzle.schema'; +import { MailService } from 'src/notifications/mail.service'; import { AuthConfig } from 'src/common/config/auth.config'; import { AppConfig } from 'src/common/config/app.config'; -import { prismaAdapter } from 'better-auth/adapters/prisma'; -import { TransactionHost } from '@nestjs-cls/transactional'; -import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; -import { PrismaClient } from 'src/generated/prisma/client'; -@Injectable() -export class BetterAuthService { - readonly client: Auth; +const BETTER_AUTH = Symbol('BETTER_AUTH'); +export const InjectBetterAuth = () => Inject(BETTER_AUTH); +export type BetterAuth = ReturnType; - constructor( - private readonly txHost: TransactionHost< - TransactionalAdapterPrisma - >, - private readonly mailService: MailService, - private readonly cache: Cache, - private readonly appConfig: AppConfig, - private readonly authConfig: AuthConfig, - ) { - this.client = betterAuth({ - experimental: { joins: true }, - database: prismaAdapter(this.txHost.tx, { - provider: 'postgresql', +export const BetterAuthProvider = { + provide: BETTER_AUTH, + inject: [TransactionHost, MailService, Cache, AppConfig, AuthConfig], + useFactory: ( + txHost: TransactionHost, + mailService: MailService, + cache: Cache, + appConfig: AppConfig, + authConfig: AuthConfig, + ) => { + return betterAuth({ + database: drizzleAdapter(txHost.tx, { + provider: 'pg', + schema: { + ...schema, + user: schema.users, + session: schema.sessions, + account: schema.accounts, + verification: schema.verifications, + }, }), advanced: { + cookiePrefix: appConfig.name, database: { generateId: false, }, }, secondaryStorage: { get: async (key) => { - const value = await this.cache.get(key); - return value ? value : null; + const value = await cache.get(key); + return value ?? null; }, set: async (key, value, ttl) => { - if (ttl) await this.cache.set(key, value, seconds(ttl)); - else await this.cache.set(key, value); + if (ttl) await cache.set(key, value, seconds(ttl)); + else await cache.set(key, value); }, delete: async (key) => { - await this.cache.del(key); + await cache.del(key); }, }, - secret: this.authConfig.secret, - baseURL: this.appConfig.url, - basePath: this.authConfig.basePath, - trustedOrigins: this.authConfig.trustedOrigins, + secret: authConfig.secret, + appName: appConfig.name, + baseURL: appConfig.url, + basePath: authConfig.basePath, + trustedOrigins: authConfig.trustedOrigins, session: { cookieCache: { enabled: true, @@ -61,7 +70,7 @@ export class BetterAuthService { changeEmail: { enabled: true, sendChangeEmailVerification: async ({ user, newEmail, url }) => { - await this.mailService.sendChangeEmailVerificationEmail({ + await mailService.sendChangeEmailVerificationEmail({ to: user.email, props: { newEmail, @@ -74,7 +83,7 @@ export class BetterAuthService { emailVerification: { sendOnSignUp: true, sendVerificationEmail: async ({ user, url }) => { - return this.mailService.sendVerificationEmail({ + return mailService.sendVerificationEmail({ to: user.email, props: { expirationHours: 24, @@ -86,13 +95,12 @@ export class BetterAuthService { autoSignInAfterVerification: true, expiresIn: 3600, // 1 hour }, - emailAndPassword: { resetPasswordTokenExpiresIn: 3600, // 1 hour enabled: true, autoSignIn: true, sendResetPassword: async ({ user, url }) => { - return this.mailService.sendPasswordResetEmail({ + return mailService.sendPasswordResetEmail({ to: user.email, props: { expirationHours: 1, @@ -110,7 +118,7 @@ export class BetterAuthService { allowedAttempts: 5, sendVerificationOTP: async ({ email, otp, type }) => { if (type === 'sign-in') { - return this.mailService.sendSignInOtpEmail({ + return mailService.sendSignInOtpEmail({ to: email, props: { otpCode: otp, @@ -121,9 +129,9 @@ export class BetterAuthService { }, }), openAPI({ - path: '/reference', + disableDefaultReference: true, }), ], }); - } -} + }, +}; diff --git a/apps/api/src/auth/guards/auth.guard.ts b/apps/api/src/auth/guards/auth.guard.ts index 442b61a..59739a7 100644 --- a/apps/api/src/auth/guards/auth.guard.ts +++ b/apps/api/src/auth/guards/auth.guard.ts @@ -3,11 +3,12 @@ import { ExecutionContext, Injectable, UnauthorizedException, + Inject, } from '@nestjs/common'; -import { BetterAuthService } from '../better-auth.service'; import { AUTH_TYPE_KEY, AuthType } from '../decorators/auth.decorator'; import { Reflector } from '@nestjs/core'; import { Session, User } from 'better-auth/*'; +import { BetterAuth, InjectBetterAuth } from '../better-auth.provider'; export interface AuthGuardRequest extends Request { session?: Session; @@ -19,7 +20,7 @@ export class AuthGuard implements CanActivate { private static readonly defaultAuthType = AuthType.Required; constructor( - private readonly betterAuthService: BetterAuthService, + @InjectBetterAuth() private readonly betterAuth: BetterAuth, private readonly reflector: Reflector, ) {} @@ -34,7 +35,7 @@ export class AuthGuard implements CanActivate { const request: AuthGuardRequest = context.switchToHttp().getRequest(); // get session from better-auth - const session = await this.betterAuthService.client.api.getSession({ + const session = await this.betterAuth.api.getSession({ headers: request.headers, }); diff --git a/apps/api/src/common/config/app.config.ts b/apps/api/src/common/config/app.config.ts index 64299a7..c1d5455 100644 --- a/apps/api/src/common/config/app.config.ts +++ b/apps/api/src/common/config/app.config.ts @@ -5,11 +5,16 @@ import { IsNotEmpty, IsNumber, IsObject, + IsString, IsUrl, } from 'class-validator'; @Configuration() export class AppConfig { + @IsString() + @Value('APP_NAME') + name!: string; + @IsNumber() @IsNotEmpty() @Value('APP_PORT', { parse: (value) => +value }) diff --git a/apps/api/src/common/config/auth.config.ts b/apps/api/src/common/config/auth.config.ts index df77a8e..606ae11 100644 --- a/apps/api/src/common/config/auth.config.ts +++ b/apps/api/src/common/config/auth.config.ts @@ -14,5 +14,5 @@ export class AuthConfig { @IsString({ each: true }) @IsNotEmpty() - trustedOrigins = ['http://localhost:3000']; + trustedOrigins = [process.env['APP_WEB_URL']!]; } diff --git a/apps/api/src/common/config/storage.config.ts b/apps/api/src/common/config/storage.config.ts index b28700d..8ac7f0a 100644 --- a/apps/api/src/common/config/storage.config.ts +++ b/apps/api/src/common/config/storage.config.ts @@ -13,6 +13,10 @@ export class StorageConfig { @Value('STORAGE_REGION', { default: 'us-east-1' }) region!: string; + @IsString() + @IsNotEmpty() + bucketName = 'public'; + @IsString() @IsNotEmpty() @Value('STORAGE_ACCESS_KEY') diff --git a/apps/api/src/common/decorators/serialize.decorator.ts b/apps/api/src/common/decorators/serialize.decorator.ts new file mode 100644 index 0000000..33923f6 --- /dev/null +++ b/apps/api/src/common/decorators/serialize.decorator.ts @@ -0,0 +1,13 @@ +import { UseInterceptors } from '@nestjs/common'; +import { ClassConstructor } from 'class-transformer'; +import { TransformDataInterceptor } from '../interceptors/transform-data.interceptor'; + +/** + * Decorator that applies data transformation using class-transformer + * @param classToUse - The class to transform the response data to + */ +export const Serialize = ( + classToUse: ClassConstructor, +): MethodDecorator => { + return UseInterceptors(new TransformDataInterceptor(classToUse)); +}; diff --git a/apps/api/src/common/guards/browser-session.interceptor.ts b/apps/api/src/common/guards/browser-session.interceptor.ts deleted file mode 100644 index 365cfac..0000000 --- a/apps/api/src/common/guards/browser-session.interceptor.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - Injectable, - NestInterceptor, - ExecutionContext, - CallHandler, -} from '@nestjs/common'; -import { Request, Response } from 'express'; -import { Observable } from 'rxjs'; -import { tap } from 'rxjs/operators'; -import { randomUUID } from 'crypto'; -import { AppConfig } from 'src/common/config/app.config'; - -@Injectable() -export class BrowserSessionInterceptor implements NestInterceptor { - constructor(private readonly appConfig: AppConfig) {} - - intercept(context: ExecutionContext, next: CallHandler): Observable { - return next.handle().pipe( - tap(() => { - const request = context.switchToHttp().getRequest(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const hasBrowserSession = request.signedCookies['browser_sid']; - - if (hasBrowserSession) { - return; - } - - const response = context.switchToHttp().getResponse(); - - response.cookie('browser_sid', randomUUID(), { - httpOnly: true, - path: '/', - signed: true, - sameSite: this.appConfig.isProduction ? 'strict' : 'lax', - }); - }), - ); - } -} diff --git a/apps/api/src/common/interceptors/transform-data.interceptor.ts b/apps/api/src/common/interceptors/transform-data.interceptor.ts index 8bf2f70..fb5fdf9 100644 --- a/apps/api/src/common/interceptors/transform-data.interceptor.ts +++ b/apps/api/src/common/interceptors/transform-data.interceptor.ts @@ -14,6 +14,9 @@ export class TransformDataInterceptor implements NestInterceptor { intercept(_context: ExecutionContext, next: CallHandler) { return next.handle().pipe( map((data) => { + if (data === null || data === undefined) { + return data; + } return plainToInstance(this.classToUse, data); }), ); diff --git a/apps/api/src/databases/database.provider.ts b/apps/api/src/databases/database.provider.ts deleted file mode 100644 index d877e31..0000000 --- a/apps/api/src/databases/database.provider.ts +++ /dev/null @@ -1,19 +0,0 @@ -// import { Inject } from '@nestjs/common'; -// import { DatabaseConfig } from 'src/common/config/database.config'; -// import { PrismaPg } from '@prisma/adapter-pg'; -// import { PrismaClient } from '../../generated/prisma/client'; -// import { TransactionHost } from '@nestjs-cls/transactional'; -// import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; - -// export const DB_PROVIDER = 'DB_PROVIDER'; -// export const InjectDb = () => Inject(DB_PROVIDER); - -// export const dbProvider = { -// provide: DB_PROVIDER, -// inject: [DatabaseConfig], -// useFactory: (databaseConfig: DatabaseConfig) => { -// const adapter = new PrismaPg({ connectionString: databaseConfig.url }); -// const prisma = new PrismaClient({ adapter }); -// return prisma; -// }, -// }; diff --git a/apps/api/src/databases/databases.module.ts b/apps/api/src/databases/databases.module.ts index db929dc..d9a1257 100644 --- a/apps/api/src/databases/databases.module.ts +++ b/apps/api/src/databases/databases.module.ts @@ -1,9 +1,9 @@ import { Global, Module } from '@nestjs/common'; -import { PrismaService } from './prisma.service'; +import { drizzleProvider } from './drizzle.provider'; @Global() @Module({ - providers: [PrismaService], - exports: [PrismaService], + providers: [drizzleProvider], + exports: [drizzleProvider], }) export class DatabasesModule {} diff --git a/apps/api/src/databases/drizzle.provider.ts b/apps/api/src/databases/drizzle.provider.ts new file mode 100644 index 0000000..7a83336 --- /dev/null +++ b/apps/api/src/databases/drizzle.provider.ts @@ -0,0 +1,21 @@ +import { Inject } from '@nestjs/common'; +import { drizzle } from 'drizzle-orm/node-postgres'; +import { DatabaseConfig } from 'src/common/config/database.config'; +import { TransactionalAdapterDrizzleOrm } from '@nestjs-cls/transactional-adapter-drizzle-orm'; +import * as schema from './drizzle.schema'; +import { relations } from './drizzle.relations'; + +export const DRIZZLE_PROVIDER = 'DRIZZLE_PROVIDER'; +export const InjectDrizzle = () => Inject(DRIZZLE_PROVIDER); + +type DrizzleClient = ReturnType; +export type DrizzleTransactionClient = + TransactionalAdapterDrizzleOrm; + +export const drizzleProvider = { + provide: DRIZZLE_PROVIDER, + inject: [DatabaseConfig], + useFactory: (databaseConfig: DatabaseConfig) => { + return drizzle(databaseConfig.url, { schema, relations }); + }, +}; diff --git a/apps/api/src/databases/drizzle.relations.ts b/apps/api/src/databases/drizzle.relations.ts new file mode 100644 index 0000000..ee85d16 --- /dev/null +++ b/apps/api/src/databases/drizzle.relations.ts @@ -0,0 +1,29 @@ +import { defineRelations } from 'drizzle-orm/relations'; +import * as schema from './drizzle.schema'; + +export const relations = defineRelations(schema, (r) => ({ + files: {}, + users: { + accounts: r.many.accounts({ + from: r.users.id, + to: r.accounts.userId, + }), + sessions: r.many.sessions({ + from: r.users.id, + to: r.sessions.userId, + }), + }, + sessions: { + user: r.one.users({ + from: r.sessions.userId, + to: r.users.id, + }), + }, + accounts: { + user: r.one.users({ + from: r.accounts.userId, + to: r.users.id, + }), + }, + verifications: {}, +})); diff --git a/apps/api/src/databases/drizzle.schema.ts b/apps/api/src/databases/drizzle.schema.ts new file mode 100644 index 0000000..6f59909 --- /dev/null +++ b/apps/api/src/databases/drizzle.schema.ts @@ -0,0 +1,5 @@ +export * from './tables/users.table'; +export * from './tables/sessions.table'; +export * from './tables/accounts.table'; +export * from './tables/verifications.table'; +export * from './tables/files.table'; diff --git a/apps/api/src/databases/drizzle.utils.ts b/apps/api/src/databases/drizzle.utils.ts new file mode 100644 index 0000000..5678652 --- /dev/null +++ b/apps/api/src/databases/drizzle.utils.ts @@ -0,0 +1,28 @@ +import { NotFoundException } from '@nestjs/common'; +import { customType, timestamp } from 'drizzle-orm/pg-core'; + +export const citext = customType<{ data: string }>({ + dataType() { + return 'citext'; + }, +}); + +export const timestampz = (name: string) => + timestamp(name, { + withTimezone: true, + mode: 'date', + precision: 3, // milliseconds - matches JavaScript Date precision + }); + +// get the first element of an array or return undefined +export const takeFirst = (values: T[]): T | undefined => { + return values[0]; +}; + +// get the first element of an array or throw a 404 error +export const takeFirstOrThrow = (values: T[]): T => { + const value = values[0]; + if (value === undefined) + throw new NotFoundException('The requested resource was not found.'); + return value; +}; diff --git a/apps/api/src/databases/migrations/20251126210801_init/migration.sql b/apps/api/src/databases/migrations/20251126210801_init/migration.sql deleted file mode 100644 index d21844d..0000000 --- a/apps/api/src/databases/migrations/20251126210801_init/migration.sql +++ /dev/null @@ -1,87 +0,0 @@ -CREATE EXTENSION IF NOT EXISTS citext; - --- CreateTable -CREATE TABLE "user" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "email" TEXT NOT NULL, - "emailVerified" BOOLEAN NOT NULL, - "image" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "user_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "session" ( - "id" TEXT NOT NULL, - "expiresAt" TIMESTAMP(3) NOT NULL, - "token" TEXT NOT NULL, - "ipAddress" TEXT, - "userAgent" TEXT, - "userId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "session_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "account" ( - "id" TEXT NOT NULL, - "accountId" TEXT NOT NULL, - "providerId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "accessToken" TEXT, - "refreshToken" TEXT, - "idToken" TEXT, - "accessTokenExpiresAt" TIMESTAMP(3), - "refreshTokenExpiresAt" TIMESTAMP(3), - "scope" TEXT, - "password" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "account_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "verification" ( - "id" TEXT NOT NULL, - "identifier" TEXT NOT NULL, - "value" TEXT NOT NULL, - "expiresAt" TIMESTAMP(3) NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "verification_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "File" ( - "id" TEXT NOT NULL, - "storageKey" TEXT NOT NULL, - "name" TEXT NOT NULL, - "mimeType" TEXT NOT NULL, - "sizeBytes" BIGINT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "File_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "user_email_key" ON "user"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "session_token_key" ON "session"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "File_storageKey_key" ON "File"("storageKey"); - --- AddForeignKey -ALTER TABLE "session" ADD CONSTRAINT "session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "account" ADD CONSTRAINT "account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/api/src/databases/migrations/20251231192353_fancy_dagger/migration.sql b/apps/api/src/databases/migrations/20251231192353_fancy_dagger/migration.sql new file mode 100644 index 0000000..a3289eb --- /dev/null +++ b/apps/api/src/databases/migrations/20251231192353_fancy_dagger/migration.sql @@ -0,0 +1,65 @@ +CREATE EXTENSION IF NOT EXISTS "citext"; + +CREATE TABLE "users" ( + "id" text PRIMARY KEY, + "name" text NOT NULL, + "email" text NOT NULL UNIQUE, + "email_verified" boolean NOT NULL, + "image" text, + "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "sessions" ( + "id" text PRIMARY KEY, + "expires_at" timestamp(3) with time zone NOT NULL, + "token" text NOT NULL UNIQUE, + "ip_address" text, + "user_agent" text, + "user_id" text NOT NULL, + "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "accounts" ( + "id" text PRIMARY KEY, + "account_id" text NOT NULL, + "provider_id" text NOT NULL, + "user_id" text NOT NULL, + "access_token" text, + "refresh_token" text, + "id_token" text, + "access_token_expires_at" timestamp(3) with time zone, + "refresh_token_expires_at" timestamp(3) with time zone, + "scope" text, + "password" text, + "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "verifications" ( + "id" text PRIMARY KEY, + "identifier" text NOT NULL, + "value" text NOT NULL, + "expires_at" timestamp(3) with time zone NOT NULL, + "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "files" ( + "id" text PRIMARY KEY, + "storage_key" text NOT NULL UNIQUE, + "name" text NOT NULL, + "mime_type" text NOT NULL, + "size_bytes" bigint NOT NULL, + "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE UNIQUE INDEX "users_email_idx" ON "users" ("email");--> statement-breakpoint +CREATE INDEX "sessions_user_id_idx" ON "sessions" ("user_id");--> statement-breakpoint +CREATE INDEX "sessions_token_idx" ON "sessions" ("token");--> statement-breakpoint +CREATE INDEX "accounts_user_id_idx" ON "accounts" ("user_id");--> statement-breakpoint +CREATE INDEX "verifications_identifier_idx" ON "verifications" ("identifier");--> statement-breakpoint +ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE; \ No newline at end of file diff --git a/apps/api/src/databases/migrations/20251231192353_fancy_dagger/snapshot.json b/apps/api/src/databases/migrations/20251231192353_fancy_dagger/snapshot.json new file mode 100644 index 0000000..954b47e --- /dev/null +++ b/apps/api/src/databases/migrations/20251231192353_fancy_dagger/snapshot.json @@ -0,0 +1,796 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "5fd5ba53-a402-494f-8ac2-abb46387b710", + "prevIds": [ + "00000000-0000-0000-0000-000000000000" + ], + "ddl": [ + { + "isRlsEnabled": false, + "name": "users", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "sessions", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "accounts", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "verifications", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "files", + "entityType": "tables", + "schema": "public" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "users" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "verifications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_key", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mime_type", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size_bytes", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "type": "timestamp(3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "files" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "users_email_idx", + "entityType": "indexes", + "schema": "public", + "table": "users" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "sessions_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "sessions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "token", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "sessions_token_idx", + "entityType": "indexes", + "schema": "public", + "table": "sessions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "accounts_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "accounts" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "identifier", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "verifications_identifier_idx", + "entityType": "indexes", + "schema": "public", + "table": "verifications" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sessions_user_id_users_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "sessions" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "accounts_user_id_users_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "accounts" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "users_pkey", + "schema": "public", + "table": "users", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sessions_pkey", + "schema": "public", + "table": "sessions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "accounts_pkey", + "schema": "public", + "table": "accounts", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "verifications_pkey", + "schema": "public", + "table": "verifications", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "files_pkey", + "schema": "public", + "table": "files", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "users_email_key", + "schema": "public", + "table": "users", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "sessions_token_key", + "schema": "public", + "table": "sessions", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "storage_key" + ], + "nullsNotDistinct": false, + "name": "files_storage_key_key", + "schema": "public", + "table": "files", + "entityType": "uniques" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/apps/api/src/databases/migrations/migration_lock.toml b/apps/api/src/databases/migrations/migration_lock.toml deleted file mode 100644 index 044d57c..0000000 --- a/apps/api/src/databases/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (e.g., Git) -provider = "postgresql" diff --git a/apps/api/src/databases/prisma.service.ts b/apps/api/src/databases/prisma.service.ts deleted file mode 100644 index 58e0b68..0000000 --- a/apps/api/src/databases/prisma.service.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common'; -import { PrismaPg } from '@prisma/adapter-pg'; -import { DatabaseConfig } from 'src/common/config/database.config'; -import { PrismaClient } from 'src/generated/prisma/client'; - -@Injectable() -export class PrismaService - extends PrismaClient - implements OnModuleInit, OnModuleDestroy -{ - constructor(protected readonly databaseConfig: DatabaseConfig) { - super({ - adapter: new PrismaPg({ connectionString: databaseConfig.url }), - }); - } - - async onModuleInit() { - await this.$connect(); - } - - async onModuleDestroy() { - await this.$disconnect(); - } -} diff --git a/apps/api/src/databases/schema.prisma b/apps/api/src/databases/schema.prisma deleted file mode 100644 index 65ae636..0000000 --- a/apps/api/src/databases/schema.prisma +++ /dev/null @@ -1,85 +0,0 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - -generator client { - provider = "prisma-client" - output = "../generated/prisma" - previewFeatures = ["relationJoins"] -} - -datasource db { - provider = "postgresql" -} - -model User { - id String @id @default(cuid()) - name String - email String - emailVerified Boolean - image String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - sessions Session[] - accounts Account[] - - @@unique([email]) - @@map("user") -} - -model Session { - id String @id @default(cuid()) - expiresAt DateTime - token String - ipAddress String? - userAgent String? - userId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - @@unique([token]) - @@map("session") -} - -model Account { - id String @id @default(cuid()) - accountId String - providerId String - userId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - accessToken String? - refreshToken String? - idToken String? - accessTokenExpiresAt DateTime? - refreshTokenExpiresAt DateTime? - scope String? - password String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - @@map("account") -} - -model Verification { - id String @id @default(cuid()) - identifier String - value String - expiresAt DateTime - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - @@map("verification") -} - -model File { - id String @id @default(cuid()) - storageKey String @unique - name String - mimeType String - sizeBytes BigInt - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt -} \ No newline at end of file diff --git a/apps/api/src/databases/tables/accounts.table.ts b/apps/api/src/databases/tables/accounts.table.ts new file mode 100644 index 0000000..7fe6114 --- /dev/null +++ b/apps/api/src/databases/tables/accounts.table.ts @@ -0,0 +1,31 @@ +import { createId } from '@paralleldrive/cuid2'; +import { index, pgTable, text } from 'drizzle-orm/pg-core'; +import { users } from './users.table'; +import { timestampz } from '../drizzle.utils'; + +export const accounts = pgTable( + 'accounts', + { + id: text('id') + .primaryKey() + .$defaultFn(() => createId()), + accountId: text('account_id').notNull(), + providerId: text('provider_id').notNull(), + userId: text('user_id') + .notNull() + .references(() => users.id, { onDelete: 'cascade' }), + accessToken: text('access_token'), + refreshToken: text('refresh_token'), + idToken: text('id_token'), + accessTokenExpiresAt: timestampz('access_token_expires_at'), + refreshTokenExpiresAt: timestampz('refresh_token_expires_at'), + scope: text('scope'), + password: text('password'), + createdAt: timestampz('created_at').notNull().defaultNow(), + updatedAt: timestampz('updated_at') + .notNull() + .defaultNow() + .$onUpdateFn(() => new Date()), + }, + (table) => [index('accounts_user_id_idx').on(table.userId)], +); diff --git a/apps/api/src/databases/tables/files.table.ts b/apps/api/src/databases/tables/files.table.ts new file mode 100644 index 0000000..8ee0051 --- /dev/null +++ b/apps/api/src/databases/tables/files.table.ts @@ -0,0 +1,18 @@ +import { createId } from '@paralleldrive/cuid2'; +import { bigint, pgTable, text } from 'drizzle-orm/pg-core'; +import { timestampz } from '../drizzle.utils'; + +export const files = pgTable('files', { + id: text('id') + .primaryKey() + .$defaultFn(() => createId()), + storageKey: text('storage_key').notNull().unique(), + name: text('name').notNull(), + mimeType: text('mime_type').notNull(), + sizeBytes: bigint('size_bytes', { mode: 'number' }).notNull(), + createdAt: timestampz('created_at').defaultNow().notNull(), + updatedAt: timestampz('updated_at') + .defaultNow() + .notNull() + .$onUpdateFn(() => new Date()), +}); diff --git a/apps/api/src/databases/tables/sessions.table.ts b/apps/api/src/databases/tables/sessions.table.ts new file mode 100644 index 0000000..cae1087 --- /dev/null +++ b/apps/api/src/databases/tables/sessions.table.ts @@ -0,0 +1,29 @@ +import { createId } from '@paralleldrive/cuid2'; +import { index, pgTable, text } from 'drizzle-orm/pg-core'; +import { users } from './users.table'; +import { timestampz } from '../drizzle.utils'; + +export const sessions = pgTable( + 'sessions', + { + id: text('id') + .primaryKey() + .$defaultFn(() => createId()), + expiresAt: timestampz('expires_at').notNull(), + token: text('token').notNull().unique(), + ipAddress: text('ip_address'), + userAgent: text('user_agent'), + userId: text('user_id') + .notNull() + .references(() => users.id, { onDelete: 'cascade' }), + createdAt: timestampz('created_at').notNull().defaultNow(), + updatedAt: timestampz('updated_at') + .notNull() + .defaultNow() + .$onUpdateFn(() => new Date()), + }, + (table) => [ + index('sessions_user_id_idx').on(table.userId), + index('sessions_token_idx').on(table.token), + ], +); diff --git a/apps/api/src/databases/tables/users.table.ts b/apps/api/src/databases/tables/users.table.ts new file mode 100644 index 0000000..03cdd3b --- /dev/null +++ b/apps/api/src/databases/tables/users.table.ts @@ -0,0 +1,24 @@ +import { createId } from '@paralleldrive/cuid2'; +import { boolean, pgTable, text, uniqueIndex } from 'drizzle-orm/pg-core'; +import { timestampz } from '../drizzle.utils'; + +export const users = pgTable( + 'users', + { + id: text('id') + .primaryKey() + .$defaultFn(() => createId()), + name: text('name').notNull(), + email: text('email').notNull().unique(), + emailVerified: boolean('email_verified') + .$defaultFn(() => false) + .notNull(), + image: text('image'), + createdAt: timestampz('created_at').defaultNow().notNull(), + updatedAt: timestampz('updated_at') + .defaultNow() + .notNull() + .$onUpdateFn(() => new Date()), + }, + (table) => [uniqueIndex('users_email_idx').on(table.email)], +); diff --git a/apps/api/src/databases/tables/verifications.table.ts b/apps/api/src/databases/tables/verifications.table.ts new file mode 100644 index 0000000..ae3e233 --- /dev/null +++ b/apps/api/src/databases/tables/verifications.table.ts @@ -0,0 +1,21 @@ +import { createId } from '@paralleldrive/cuid2'; +import { index, pgTable, text } from 'drizzle-orm/pg-core'; +import { timestampz } from '../drizzle.utils'; + +export const verifications = pgTable( + 'verifications', + { + id: text('id') + .primaryKey() + .$defaultFn(() => createId()), + identifier: text('identifier').notNull(), + value: text('value').notNull(), + expiresAt: timestampz('expires_at').notNull(), + createdAt: timestampz('created_at').notNull().defaultNow(), + updatedAt: timestampz('updated_at') + .notNull() + .defaultNow() + .$onUpdateFn(() => new Date()), + }, + (table) => [index('verifications_identifier_idx').on(table.identifier)], +); diff --git a/apps/api/src/generated/prisma/browser.ts b/apps/api/src/generated/prisma/browser.ts deleted file mode 100644 index 8850827..0000000 --- a/apps/api/src/generated/prisma/browser.ts +++ /dev/null @@ -1,44 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file should be your main import to use Prisma-related types and utilities in a browser. - * Use it to get access to models, enums, and input types. - * - * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. - * See `client.ts` for the standard, server-side entry point. - * - * 🟢 You can import this file directly. - */ - -import * as Prisma from './internal/prismaNamespaceBrowser' -export { Prisma } -export * as $Enums from './enums' -export * from './enums'; -/** - * Model User - * - */ -export type User = Prisma.UserModel -/** - * Model Session - * - */ -export type Session = Prisma.SessionModel -/** - * Model Account - * - */ -export type Account = Prisma.AccountModel -/** - * Model Verification - * - */ -export type Verification = Prisma.VerificationModel -/** - * Model File - * - */ -export type File = Prisma.FileModel diff --git a/apps/api/src/generated/prisma/client.ts b/apps/api/src/generated/prisma/client.ts deleted file mode 100644 index 105f625..0000000 --- a/apps/api/src/generated/prisma/client.ts +++ /dev/null @@ -1,64 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. - * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. - * - * 🟢 You can import this file directly. - */ - -import * as process from 'node:process' -import * as path from 'node:path' - -import * as runtime from "@prisma/client/runtime/client" -import * as $Enums from "./enums" -import * as $Class from "./internal/class" -import * as Prisma from "./internal/prismaNamespace" - -export * as $Enums from './enums' -export * from "./enums" -/** - * ## Prisma Client - * - * Type-safe database client for TypeScript - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ -export const PrismaClient = $Class.getPrismaClientClass() -export type PrismaClient = $Class.PrismaClient -export { Prisma } - -/** - * Model User - * - */ -export type User = Prisma.UserModel -/** - * Model Session - * - */ -export type Session = Prisma.SessionModel -/** - * Model Account - * - */ -export type Account = Prisma.AccountModel -/** - * Model Verification - * - */ -export type Verification = Prisma.VerificationModel -/** - * Model File - * - */ -export type File = Prisma.FileModel diff --git a/apps/api/src/generated/prisma/commonInputTypes.ts b/apps/api/src/generated/prisma/commonInputTypes.ts deleted file mode 100644 index 222af29..0000000 --- a/apps/api/src/generated/prisma/commonInputTypes.ts +++ /dev/null @@ -1,363 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports various common sort, input & filter types that are not directly linked to a particular model. - * - * 🟢 You can import this file directly. - */ - -import type * as runtime from "@prisma/client/runtime/client" -import * as $Enums from "./enums" -import type * as Prisma from "./internal/prismaNamespace" - - -export type StringFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - mode?: Prisma.QueryMode - not?: Prisma.NestedStringFilter<$PrismaModel> | string -} - -export type BoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean -} - -export type StringNullableFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - mode?: Prisma.QueryMode - not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null -} - -export type DateTimeFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string -} - -export type SortOrderInput = { - sort: Prisma.SortOrder - nulls?: Prisma.NullsOrder -} - -export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - mode?: Prisma.QueryMode - not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedStringFilter<$PrismaModel> - _max?: Prisma.NestedStringFilter<$PrismaModel> -} - -export type BoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> -} - -export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - mode?: Prisma.QueryMode - not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedStringNullableFilter<$PrismaModel> - _max?: Prisma.NestedStringNullableFilter<$PrismaModel> -} - -export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeFilter<$PrismaModel> -} - -export type DateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - -export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> -} - -export type BigIntFilter<$PrismaModel = never> = { - equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - in?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - notIn?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number -} - -export type BigIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - in?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - notIn?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedBigIntFilter<$PrismaModel> - _min?: Prisma.NestedBigIntFilter<$PrismaModel> - _max?: Prisma.NestedBigIntFilter<$PrismaModel> -} - -export type NestedStringFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - not?: Prisma.NestedStringFilter<$PrismaModel> | string -} - -export type NestedBoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean -} - -export type NestedStringNullableFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null -} - -export type NestedDateTimeFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string -} - -export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedStringFilter<$PrismaModel> - _max?: Prisma.NestedStringFilter<$PrismaModel> -} - -export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntFilter<$PrismaModel> | number -} - -export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> -} - -export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedStringNullableFilter<$PrismaModel> - _max?: Prisma.NestedStringNullableFilter<$PrismaModel> -} - -export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null -} - -export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeFilter<$PrismaModel> -} - -export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - -export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> -} - -export type NestedBigIntFilter<$PrismaModel = never> = { - equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - in?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - notIn?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number -} - -export type NestedBigIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - in?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - notIn?: bigint[] | number[] | Prisma.ListBigIntFieldRefInput<$PrismaModel> - lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel> - not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedBigIntFilter<$PrismaModel> - _min?: Prisma.NestedBigIntFilter<$PrismaModel> - _max?: Prisma.NestedBigIntFilter<$PrismaModel> -} - -export type NestedFloatFilter<$PrismaModel = never> = { - equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> - in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> - notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> - lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - not?: Prisma.NestedFloatFilter<$PrismaModel> | number -} - - diff --git a/apps/api/src/generated/prisma/enums.ts b/apps/api/src/generated/prisma/enums.ts deleted file mode 100644 index 043572d..0000000 --- a/apps/api/src/generated/prisma/enums.ts +++ /dev/null @@ -1,15 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* -* This file exports all enum related types from the schema. -* -* 🟢 You can import this file directly. -*/ - - - -// This file is empty because there are no enums in the schema. -export {} diff --git a/apps/api/src/generated/prisma/internal/class.ts b/apps/api/src/generated/prisma/internal/class.ts deleted file mode 100644 index ffbf9c7..0000000 --- a/apps/api/src/generated/prisma/internal/class.ts +++ /dev/null @@ -1,232 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * WARNING: This is an internal file that is subject to change! - * - * 🛑 Under no circumstances should you import this file directly! 🛑 - * - * Please import the `PrismaClient` class from the `client.ts` file instead. - */ - -import * as runtime from "@prisma/client/runtime/client" -import type * as Prisma from "./prismaNamespace" - - -const config: runtime.GetPrismaClientConfig = { - "previewFeatures": [ - "relationJoins" - ], - "clientVersion": "7.0.1", - "engineVersion": "f09f2815f091dbba658cdcd2264306d88bb5bda6", - "activeProvider": "postgresql", - "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n previewFeatures = [\"relationJoins\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id @default(cuid())\n name String\n email String\n emailVerified Boolean\n image String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n sessions Session[]\n accounts Account[]\n\n @@unique([email])\n @@map(\"user\")\n}\n\nmodel Session {\n id String @id @default(cuid())\n expiresAt DateTime\n token String\n ipAddress String?\n userAgent String?\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([token])\n @@map(\"session\")\n}\n\nmodel Account {\n id String @id @default(cuid())\n accountId String\n providerId String\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n accessToken String?\n refreshToken String?\n idToken String?\n accessTokenExpiresAt DateTime?\n refreshTokenExpiresAt DateTime?\n scope String?\n password String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@map(\"account\")\n}\n\nmodel Verification {\n id String @id @default(cuid())\n identifier String\n value String\n expiresAt DateTime\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@map(\"verification\")\n}\n\nmodel File {\n id String @id @default(cuid())\n storageKey String @unique\n name String\n mimeType String\n sizeBytes BigInt\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n", - "runtimeDataModel": { - "models": {}, - "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\":\"emailVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"image\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sessions\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"}],\"dbName\":\"user\"},\"Session\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"SessionToUser\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"session\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accountId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"providerId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AccountToUser\"},{\"name\":\"accessToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refreshToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"idToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"scope\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"account\"},\"Verification\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"identifier\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"verification\"},\"File\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"storageKey\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") - -async function decodeBase64AsWasm(wasmBase64: string): Promise { - const { Buffer } = await import('node:buffer') - const wasmArray = Buffer.from(wasmBase64, 'base64') - return new WebAssembly.Module(wasmArray) -} - -config.compilerWasm = { - getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.js"), - - getQueryCompilerWasmModule: async () => { - const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.js") - return await decodeBase64AsWasm(wasm) - } -} - - - -export type LogOptions = - 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never - -export interface PrismaClientConstructor { - /** - * ## Prisma Client - * - * Type-safe database client for TypeScript - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - - new < - Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - LogOpts extends LogOptions = LogOptions, - OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs - >(options: Prisma.Subset ): PrismaClient -} - -/** - * ## Prisma Client - * - * Type-safe database client for TypeScript - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - -export interface PrismaClient< - in LogOpts extends Prisma.LogLevel = never, - in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined, - in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; - - /** - * Connect with the database - */ - $connect(): runtime.Types.Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): runtime.Types.Utils.JsPromise; - -/** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * ``` - * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a prepared raw query and returns the `SELECT` data. - * @example - * ``` - * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the `SELECT` data. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - - /** - * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - * @example - * ``` - * const [george, bob, alice] = await prisma.$transaction([ - * prisma.user.create({ data: { name: 'George' } }), - * prisma.user.create({ data: { name: 'Bob' } }), - * prisma.user.create({ data: { name: 'Alice' } }), - * ]) - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - */ - $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise> - - $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise - - $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { - extArgs: ExtArgs - }>> - - /** - * `prisma.user`: Exposes CRUD operations for the **User** model. - * Example usage: - * ```ts - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - */ - get user(): Prisma.UserDelegate; - - /** - * `prisma.session`: Exposes CRUD operations for the **Session** model. - * Example usage: - * ```ts - * // Fetch zero or more Sessions - * const sessions = await prisma.session.findMany() - * ``` - */ - get session(): Prisma.SessionDelegate; - - /** - * `prisma.account`: Exposes CRUD operations for the **Account** model. - * Example usage: - * ```ts - * // Fetch zero or more Accounts - * const accounts = await prisma.account.findMany() - * ``` - */ - get account(): Prisma.AccountDelegate; - - /** - * `prisma.verification`: Exposes CRUD operations for the **Verification** model. - * Example usage: - * ```ts - * // Fetch zero or more Verifications - * const verifications = await prisma.verification.findMany() - * ``` - */ - get verification(): Prisma.VerificationDelegate; - - /** - * `prisma.file`: Exposes CRUD operations for the **File** model. - * Example usage: - * ```ts - * // Fetch zero or more Files - * const files = await prisma.file.findMany() - * ``` - */ - get file(): Prisma.FileDelegate; -} - -export function getPrismaClientClass(): PrismaClientConstructor { - return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor -} diff --git a/apps/api/src/generated/prisma/internal/prismaNamespace.ts b/apps/api/src/generated/prisma/internal/prismaNamespace.ts deleted file mode 100644 index 98b27b0..0000000 --- a/apps/api/src/generated/prisma/internal/prismaNamespace.ts +++ /dev/null @@ -1,1151 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * WARNING: This is an internal file that is subject to change! - * - * 🛑 Under no circumstances should you import this file directly! 🛑 - * - * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. - * While this enables partial backward compatibility, it is not part of the stable public API. - * - * If you are looking for your Models, Enums, and Input Types, please import them from the respective - * model files in the `model` directory! - */ - -import * as runtime from "@prisma/client/runtime/client" -import type * as Prisma from "../models" -import { type PrismaClient } from "./class" - -export type * from '../models' - -export type DMMF = typeof runtime.DMMF - -export type PrismaPromise = runtime.Types.Public.PrismaPromise - -/** - * Prisma Errors - */ - -export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError -export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError - -export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError -export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError - -export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError -export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError - -export const PrismaClientInitializationError = runtime.PrismaClientInitializationError -export type PrismaClientInitializationError = runtime.PrismaClientInitializationError - -export const PrismaClientValidationError = runtime.PrismaClientValidationError -export type PrismaClientValidationError = runtime.PrismaClientValidationError - -/** - * Re-export of sql-template-tag - */ -export const sql = runtime.sqltag -export const empty = runtime.empty -export const join = runtime.join -export const raw = runtime.raw -export const Sql = runtime.Sql -export type Sql = runtime.Sql - - - -/** - * Decimal.js - */ -export const Decimal = runtime.Decimal -export type Decimal = runtime.Decimal - -export type DecimalJsLike = runtime.DecimalJsLike - -/** -* Extensions -*/ -export type Extension = runtime.Types.Extensions.UserArgs -export const getExtensionContext = runtime.Extensions.getExtensionContext -export type Args = runtime.Types.Public.Args -export type Payload = runtime.Types.Public.Payload -export type Result = runtime.Types.Public.Result -export type Exact = runtime.Types.Public.Exact - -export type PrismaVersion = { - client: string - engine: string -} - -/** - * Prisma Client JS version: 7.0.1 - * Query Engine version: f09f2815f091dbba658cdcd2264306d88bb5bda6 - */ -export const prismaVersion: PrismaVersion = { - client: "7.0.1", - engine: "f09f2815f091dbba658cdcd2264306d88bb5bda6" -} - -/** - * Utility Types - */ - -export type Bytes = runtime.Bytes -export type JsonObject = runtime.JsonObject -export type JsonArray = runtime.JsonArray -export type JsonValue = runtime.JsonValue -export type InputJsonObject = runtime.InputJsonObject -export type InputJsonArray = runtime.InputJsonArray -export type InputJsonValue = runtime.InputJsonValue - - -export const NullTypes = { - DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull), - JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull), - AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull), -} -/** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const DbNull = runtime.DbNull - -/** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const JsonNull = runtime.JsonNull - -/** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const AnyNull = runtime.AnyNull - - -type SelectAndInclude = { - select: any - include: any -} - -type SelectAndOmit = { - select: any - omit: any -} - -/** - * From T, pick a set of properties whose keys are in the union K - */ -type Prisma__Pick = { - [P in K]: T[P]; -}; - -export type Enumerable = T | Array; - -/** - * Subset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection - */ -export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; -}; - -/** - * SelectSubset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ -export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never -} & - (T extends SelectAndInclude - ? 'Please either choose `select` or `include`.' - : T extends SelectAndOmit - ? 'Please either choose `select` or `omit`.' - : {}) - -/** - * Subset + Intersection - * @desc From `T` pick properties that exist in `U` and intersect `K` - */ -export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never -} & - K - -type Without = { [P in Exclude]?: never }; - -/** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ -export type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - -/** - * Is T a Record? - */ -type IsObject = T extends Array -? False -: T extends Date -? False -: T extends Uint8Array -? False -: T extends BigInt -? False -: T extends object -? True -: False - - -/** - * If it's T[], return T - */ -export type UnEnumerate = T extends Array ? U : T - -/** - * From ts-toolbelt - */ - -type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - -type EitherStrict = Strict<__Either> - -type EitherLoose = ComputeRaw<__Either> - -type _Either< - O extends object, - K extends Key, - strict extends Boolean -> = { - 1: EitherStrict - 0: EitherLoose -}[strict] - -export type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 -> = O extends unknown ? _Either : never - -export type Union = any - -export type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] -} & {} - -/** Helper Types for "Merge" **/ -export type IntersectOf = ( - U extends unknown ? (k: U) => void : never -) extends (k: infer I) => void - ? I - : never - -export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; -} & {}; - -type _Merge = IntersectOf; -}>>; - -type Key = string | number | symbol; -type AtStrict = O[K & keyof O]; -type AtLoose = O extends unknown ? AtStrict : never; -export type At = { - 1: AtStrict; - 0: AtLoose; -}[strict]; - -export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; -} & {}; - -export type OptionalFlat = { - [K in keyof O]?: O[K]; -} & {}; - -type _Record = { - [P in K]: T; -}; - -// cause typescript not to expand types and preserve names -type NoExpand = T extends unknown ? T : never; - -// this type assumes the passed object is entirely optional -export type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? P : never]-?: O[P]} & O - : never>; - -type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - -export type Strict = ComputeRaw<_Strict>; -/** End Helper Types for "Merge" **/ - -export type Merge = ComputeRaw<_Merge>>; - -export type Boolean = True | False - -export type True = 1 - -export type False = 0 - -export type Not = { - 0: 1 - 1: 0 -}[B] - -export type Extends = [A1] extends [never] - ? 0 // anything `never` is false - : A1 extends A2 - ? 1 - : 0 - -export type Has = Not< - Extends, U1> -> - -export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } -}[B1][B2] - -export type Keys = U extends unknown ? keyof U : never - -export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never -} : never - -type FieldPaths< - T, - U = Omit -> = IsObject extends True ? U : T - -export type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K -}[keyof T] - -/** - * Convert tuple to union - */ -type _TupleToUnion = T extends (infer E)[] ? E : never -type TupleToUnion = _TupleToUnion -export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - -/** - * Like `Pick`, but additionally can also accept an array of keys - */ -export type PickEnumerable | keyof T> = Prisma__Pick> - -/** - * Exclude all keys with underscores - */ -export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T - - -export type FieldRef = runtime.FieldRef - -type FieldRefInputType = Model extends never ? never : FieldRef - - -export const ModelName = { - User: 'User', - Session: 'Session', - Account: 'Account', - Verification: 'Verification', - File: 'File' -} as const - -export type ModelName = (typeof ModelName)[keyof typeof ModelName] - - - -export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { - returns: TypeMap -} - -export type TypeMap = { - globalOmitOptions: { - omit: GlobalOmitOptions - } - meta: { - modelProps: "user" | "session" | "account" | "verification" | "file" - txIsolationLevel: TransactionIsolationLevel - } - model: { - User: { - payload: Prisma.$UserPayload - fields: Prisma.UserFieldRefs - operations: { - findUnique: { - args: Prisma.UserFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.UserFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.UserFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.UserFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.UserFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.UserCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.UserCreateManyArgs - result: BatchPayload - } - createManyAndReturn: { - args: Prisma.UserCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - delete: { - args: Prisma.UserDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.UserUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.UserDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.UserUpdateManyArgs - result: BatchPayload - } - updateManyAndReturn: { - args: Prisma.UserUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - upsert: { - args: Prisma.UserUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.UserAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.UserGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.UserCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - Session: { - payload: Prisma.$SessionPayload - fields: Prisma.SessionFieldRefs - operations: { - findUnique: { - args: Prisma.SessionFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.SessionFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.SessionFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.SessionFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.SessionFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.SessionCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.SessionCreateManyArgs - result: BatchPayload - } - createManyAndReturn: { - args: Prisma.SessionCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - delete: { - args: Prisma.SessionDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.SessionUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.SessionDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.SessionUpdateManyArgs - result: BatchPayload - } - updateManyAndReturn: { - args: Prisma.SessionUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - upsert: { - args: Prisma.SessionUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.SessionAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.SessionGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.SessionCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - Account: { - payload: Prisma.$AccountPayload - fields: Prisma.AccountFieldRefs - operations: { - findUnique: { - args: Prisma.AccountFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.AccountFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.AccountFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.AccountFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.AccountFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.AccountCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.AccountCreateManyArgs - result: BatchPayload - } - createManyAndReturn: { - args: Prisma.AccountCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - delete: { - args: Prisma.AccountDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.AccountUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.AccountDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.AccountUpdateManyArgs - result: BatchPayload - } - updateManyAndReturn: { - args: Prisma.AccountUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - upsert: { - args: Prisma.AccountUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.AccountAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.AccountGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.AccountCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - Verification: { - payload: Prisma.$VerificationPayload - fields: Prisma.VerificationFieldRefs - operations: { - findUnique: { - args: Prisma.VerificationFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.VerificationFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.VerificationFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.VerificationFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.VerificationFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.VerificationCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.VerificationCreateManyArgs - result: BatchPayload - } - createManyAndReturn: { - args: Prisma.VerificationCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - delete: { - args: Prisma.VerificationDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.VerificationUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.VerificationDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.VerificationUpdateManyArgs - result: BatchPayload - } - updateManyAndReturn: { - args: Prisma.VerificationUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - upsert: { - args: Prisma.VerificationUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.VerificationAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.VerificationGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.VerificationCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - File: { - payload: Prisma.$FilePayload - fields: Prisma.FileFieldRefs - operations: { - findUnique: { - args: Prisma.FileFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.FileFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.FileFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.FileFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.FileFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.FileCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.FileCreateManyArgs - result: BatchPayload - } - createManyAndReturn: { - args: Prisma.FileCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - delete: { - args: Prisma.FileDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.FileUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.FileDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.FileUpdateManyArgs - result: BatchPayload - } - updateManyAndReturn: { - args: Prisma.FileUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] - } - upsert: { - args: Prisma.FileUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.FileAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.FileGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.FileCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - } -} & { - other: { - payload: any - operations: { - $executeRaw: { - args: [query: TemplateStringsArray | Sql, ...values: any[]], - result: any - } - $executeRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $queryRaw: { - args: [query: TemplateStringsArray | Sql, ...values: any[]], - result: any - } - $queryRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - } - } -} - -/** - * Enums - */ - -export const TransactionIsolationLevel = runtime.makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -} as const) - -export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - -export const UserScalarFieldEnum = { - id: 'id', - name: 'name', - email: 'email', - emailVerified: 'emailVerified', - image: 'image', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] - - -export const RelationLoadStrategy = { - query: 'query', - join: 'join' -} as const - -export type RelationLoadStrategy = (typeof RelationLoadStrategy)[keyof typeof RelationLoadStrategy] - - -export const SessionScalarFieldEnum = { - id: 'id', - expiresAt: 'expiresAt', - token: 'token', - ipAddress: 'ipAddress', - userAgent: 'userAgent', - userId: 'userId', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum] - - -export const AccountScalarFieldEnum = { - id: 'id', - accountId: 'accountId', - providerId: 'providerId', - userId: 'userId', - accessToken: 'accessToken', - refreshToken: 'refreshToken', - idToken: 'idToken', - accessTokenExpiresAt: 'accessTokenExpiresAt', - refreshTokenExpiresAt: 'refreshTokenExpiresAt', - scope: 'scope', - password: 'password', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum] - - -export const VerificationScalarFieldEnum = { - id: 'id', - identifier: 'identifier', - value: 'value', - expiresAt: 'expiresAt', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum] - - -export const FileScalarFieldEnum = { - id: 'id', - storageKey: 'storageKey', - name: 'name', - mimeType: 'mimeType', - sizeBytes: 'sizeBytes', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type FileScalarFieldEnum = (typeof FileScalarFieldEnum)[keyof typeof FileScalarFieldEnum] - - -export const SortOrder = { - asc: 'asc', - desc: 'desc' -} as const - -export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - -export const QueryMode = { - default: 'default', - insensitive: 'insensitive' -} as const - -export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] - - -export const NullsOrder = { - first: 'first', - last: 'last' -} as const - -export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - - -/** - * Field references - */ - - -/** - * Reference to a field of type 'String' - */ -export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> - - - -/** - * Reference to a field of type 'String[]' - */ -export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> - - - -/** - * Reference to a field of type 'Boolean' - */ -export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> - - - -/** - * Reference to a field of type 'DateTime' - */ -export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> - - - -/** - * Reference to a field of type 'DateTime[]' - */ -export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> - - - -/** - * Reference to a field of type 'BigInt' - */ -export type BigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt'> - - - -/** - * Reference to a field of type 'BigInt[]' - */ -export type ListBigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt[]'> - - - -/** - * Reference to a field of type 'Int' - */ -export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> - - - -/** - * Reference to a field of type 'Int[]' - */ -export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> - - - -/** - * Reference to a field of type 'Float' - */ -export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> - - - -/** - * Reference to a field of type 'Float[]' - */ -export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> - - -/** - * Batch Payload for updateMany & deleteMany & createMany - */ -export type BatchPayload = { - count: number -} - -export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> -export type DefaultPrismaClient = PrismaClient -export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' -export type PrismaClientOptions = ({ - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`. - */ - adapter: runtime.SqlDriverAdapterFactory - accelerateUrl?: never -} | { - /** - * Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database. - */ - accelerateUrl: string - adapter?: never -}) & { - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat - /** - * @example - * ``` - * // Shorthand for `emit: 'stdout'` - * log: ['query', 'info', 'warn', 'error'] - * - * // Emit as events only - * log: [ - * { emit: 'event', level: 'query' }, - * { emit: 'event', level: 'info' }, - * { emit: 'event', level: 'warn' } - * { emit: 'event', level: 'error' } - * ] - * - * / Emit as events and log to stdout - * og: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * { emit: 'stdout', level: 'error' } - * - * ``` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: (LogLevel | LogDefinition)[] - /** - * The default values for transactionOptions - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: { - maxWait?: number - timeout?: number - isolationLevel?: TransactionIsolationLevel - } - /** - * Global configuration for omitting model fields by default. - * - * @example - * ``` - * const prisma = new PrismaClient({ - * omit: { - * user: { - * password: true - * } - * } - * }) - * ``` - */ - omit?: GlobalOmitConfig -} -export type GlobalOmitConfig = { - user?: Prisma.UserOmit - session?: Prisma.SessionOmit - account?: Prisma.AccountOmit - verification?: Prisma.VerificationOmit - file?: Prisma.FileOmit -} - -/* Types for Logging */ -export type LogLevel = 'info' | 'query' | 'warn' | 'error' -export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' -} - -export type CheckIsLogLevel = T extends LogLevel ? T : never; - -export type GetLogType = CheckIsLogLevel< - T extends LogDefinition ? T['level'] : T ->; - -export type GetEvents = T extends Array - ? GetLogType - : never; - -export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string -} - -export type LogEvent = { - timestamp: Date - message: string - target: string -} -/* End Types for Logging */ - - -export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'createManyAndReturn' - | 'update' - | 'updateMany' - | 'updateManyAndReturn' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - -/** - * `PrismaClient` proxy available in interactive transactions. - */ -export type TransactionClient = Omit - diff --git a/apps/api/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/apps/api/src/generated/prisma/internal/prismaNamespaceBrowser.ts deleted file mode 100644 index 7854ac3..0000000 --- a/apps/api/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ /dev/null @@ -1,178 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * WARNING: This is an internal file that is subject to change! - * - * 🛑 Under no circumstances should you import this file directly! 🛑 - * - * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. - * While this enables partial backward compatibility, it is not part of the stable public API. - * - * If you are looking for your Models, Enums, and Input Types, please import them from the respective - * model files in the `model` directory! - */ - -import * as runtime from "@prisma/client/runtime/index-browser" - -export type * from '../models' -export type * from './prismaNamespace' - -export const Decimal = runtime.Decimal - - -export const NullTypes = { - DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull), - JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull), - AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull), -} -/** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const DbNull = runtime.DbNull - -/** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const JsonNull = runtime.JsonNull - -/** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const AnyNull = runtime.AnyNull - - -export const ModelName = { - User: 'User', - Session: 'Session', - Account: 'Account', - Verification: 'Verification', - File: 'File' -} as const - -export type ModelName = (typeof ModelName)[keyof typeof ModelName] - -/* - * Enums - */ - -export const TransactionIsolationLevel = { - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -} as const - -export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - -export const UserScalarFieldEnum = { - id: 'id', - name: 'name', - email: 'email', - emailVerified: 'emailVerified', - image: 'image', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] - - -export const RelationLoadStrategy = { - query: 'query', - join: 'join' -} as const - -export type RelationLoadStrategy = (typeof RelationLoadStrategy)[keyof typeof RelationLoadStrategy] - - -export const SessionScalarFieldEnum = { - id: 'id', - expiresAt: 'expiresAt', - token: 'token', - ipAddress: 'ipAddress', - userAgent: 'userAgent', - userId: 'userId', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum] - - -export const AccountScalarFieldEnum = { - id: 'id', - accountId: 'accountId', - providerId: 'providerId', - userId: 'userId', - accessToken: 'accessToken', - refreshToken: 'refreshToken', - idToken: 'idToken', - accessTokenExpiresAt: 'accessTokenExpiresAt', - refreshTokenExpiresAt: 'refreshTokenExpiresAt', - scope: 'scope', - password: 'password', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum] - - -export const VerificationScalarFieldEnum = { - id: 'id', - identifier: 'identifier', - value: 'value', - expiresAt: 'expiresAt', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum] - - -export const FileScalarFieldEnum = { - id: 'id', - storageKey: 'storageKey', - name: 'name', - mimeType: 'mimeType', - sizeBytes: 'sizeBytes', - createdAt: 'createdAt', - updatedAt: 'updatedAt' -} as const - -export type FileScalarFieldEnum = (typeof FileScalarFieldEnum)[keyof typeof FileScalarFieldEnum] - - -export const SortOrder = { - asc: 'asc', - desc: 'desc' -} as const - -export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - -export const QueryMode = { - default: 'default', - insensitive: 'insensitive' -} as const - -export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] - - -export const NullsOrder = { - first: 'first', - last: 'last' -} as const - -export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - diff --git a/apps/api/src/generated/prisma/models.ts b/apps/api/src/generated/prisma/models.ts deleted file mode 100644 index cf2ee85..0000000 --- a/apps/api/src/generated/prisma/models.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This is a barrel export file for all models and their related types. - * - * 🟢 You can import this file directly. - */ -export type * from './models/User' -export type * from './models/Session' -export type * from './models/Account' -export type * from './models/Verification' -export type * from './models/File' -export type * from './commonInputTypes' \ No newline at end of file diff --git a/apps/api/src/generated/prisma/models/Account.ts b/apps/api/src/generated/prisma/models/Account.ts deleted file mode 100644 index 2fbea8c..0000000 --- a/apps/api/src/generated/prisma/models/Account.ts +++ /dev/null @@ -1,1633 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `Account` 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 Account - * - */ -export type AccountModel = runtime.Types.Result.DefaultSelection - -export type AggregateAccount = { - _count: AccountCountAggregateOutputType | null - _min: AccountMinAggregateOutputType | null - _max: AccountMaxAggregateOutputType | null -} - -export type AccountMinAggregateOutputType = { - id: string | null - accountId: string | null - providerId: string | null - userId: string | null - accessToken: string | null - refreshToken: string | null - idToken: string | null - accessTokenExpiresAt: Date | null - refreshTokenExpiresAt: Date | null - scope: string | null - password: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type AccountMaxAggregateOutputType = { - id: string | null - accountId: string | null - providerId: string | null - userId: string | null - accessToken: string | null - refreshToken: string | null - idToken: string | null - accessTokenExpiresAt: Date | null - refreshTokenExpiresAt: Date | null - scope: string | null - password: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type AccountCountAggregateOutputType = { - id: number - accountId: number - providerId: number - userId: number - accessToken: number - refreshToken: number - idToken: number - accessTokenExpiresAt: number - refreshTokenExpiresAt: number - scope: number - password: number - createdAt: number - updatedAt: number - _all: number -} - - -export type AccountMinAggregateInputType = { - id?: true - accountId?: true - providerId?: true - userId?: true - accessToken?: true - refreshToken?: true - idToken?: true - accessTokenExpiresAt?: true - refreshTokenExpiresAt?: true - scope?: true - password?: true - createdAt?: true - updatedAt?: true -} - -export type AccountMaxAggregateInputType = { - id?: true - accountId?: true - providerId?: true - userId?: true - accessToken?: true - refreshToken?: true - idToken?: true - accessTokenExpiresAt?: true - refreshTokenExpiresAt?: true - scope?: true - password?: true - createdAt?: true - updatedAt?: true -} - -export type AccountCountAggregateInputType = { - id?: true - accountId?: true - providerId?: true - userId?: true - accessToken?: true - refreshToken?: true - idToken?: true - accessTokenExpiresAt?: true - refreshTokenExpiresAt?: true - scope?: true - password?: true - createdAt?: true - updatedAt?: true - _all?: true -} - -export type AccountAggregateArgs = { - /** - * Filter which Account to aggregate. - */ - where?: Prisma.AccountWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Accounts to fetch. - */ - orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.AccountWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Accounts 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` Accounts. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Accounts - **/ - _count?: true | AccountCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: AccountMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: AccountMaxAggregateInputType -} - -export type GetAccountAggregateType = { - [P in keyof T & keyof AggregateAccount]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type AccountGroupByArgs = { - where?: Prisma.AccountWhereInput - orderBy?: Prisma.AccountOrderByWithAggregationInput | Prisma.AccountOrderByWithAggregationInput[] - by: Prisma.AccountScalarFieldEnum[] | Prisma.AccountScalarFieldEnum - having?: Prisma.AccountScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: AccountCountAggregateInputType | true - _min?: AccountMinAggregateInputType - _max?: AccountMaxAggregateInputType -} - -export type AccountGroupByOutputType = { - id: string - accountId: string - providerId: string - userId: string - accessToken: string | null - refreshToken: string | null - idToken: string | null - accessTokenExpiresAt: Date | null - refreshTokenExpiresAt: Date | null - scope: string | null - password: string | null - createdAt: Date - updatedAt: Date - _count: AccountCountAggregateOutputType | null - _min: AccountMinAggregateOutputType | null - _max: AccountMaxAggregateOutputType | null -} - -type GetAccountGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof AccountGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type AccountWhereInput = { - AND?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] - OR?: Prisma.AccountWhereInput[] - NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] - id?: Prisma.StringFilter<"Account"> | string - accountId?: Prisma.StringFilter<"Account"> | string - providerId?: Prisma.StringFilter<"Account"> | string - userId?: Prisma.StringFilter<"Account"> | string - accessToken?: Prisma.StringNullableFilter<"Account"> | string | null - refreshToken?: Prisma.StringNullableFilter<"Account"> | string | null - idToken?: Prisma.StringNullableFilter<"Account"> | string | null - accessTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - refreshTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - scope?: Prisma.StringNullableFilter<"Account"> | string | null - password?: Prisma.StringNullableFilter<"Account"> | string | null - createdAt?: Prisma.DateTimeFilter<"Account"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Account"> | Date | string - user?: Prisma.XOR -} - -export type AccountOrderByWithRelationInput = { - id?: Prisma.SortOrder - accountId?: Prisma.SortOrder - providerId?: Prisma.SortOrder - userId?: Prisma.SortOrder - accessToken?: Prisma.SortOrderInput | Prisma.SortOrder - refreshToken?: Prisma.SortOrderInput | Prisma.SortOrder - idToken?: Prisma.SortOrderInput | Prisma.SortOrder - accessTokenExpiresAt?: Prisma.SortOrderInput | Prisma.SortOrder - refreshTokenExpiresAt?: Prisma.SortOrderInput | Prisma.SortOrder - scope?: Prisma.SortOrderInput | Prisma.SortOrder - password?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - user?: Prisma.UserOrderByWithRelationInput -} - -export type AccountWhereUniqueInput = Prisma.AtLeast<{ - id?: string - AND?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] - OR?: Prisma.AccountWhereInput[] - NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] - accountId?: Prisma.StringFilter<"Account"> | string - providerId?: Prisma.StringFilter<"Account"> | string - userId?: Prisma.StringFilter<"Account"> | string - accessToken?: Prisma.StringNullableFilter<"Account"> | string | null - refreshToken?: Prisma.StringNullableFilter<"Account"> | string | null - idToken?: Prisma.StringNullableFilter<"Account"> | string | null - accessTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - refreshTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - scope?: Prisma.StringNullableFilter<"Account"> | string | null - password?: Prisma.StringNullableFilter<"Account"> | string | null - createdAt?: Prisma.DateTimeFilter<"Account"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Account"> | Date | string - user?: Prisma.XOR -}, "id"> - -export type AccountOrderByWithAggregationInput = { - id?: Prisma.SortOrder - accountId?: Prisma.SortOrder - providerId?: Prisma.SortOrder - userId?: Prisma.SortOrder - accessToken?: Prisma.SortOrderInput | Prisma.SortOrder - refreshToken?: Prisma.SortOrderInput | Prisma.SortOrder - idToken?: Prisma.SortOrderInput | Prisma.SortOrder - accessTokenExpiresAt?: Prisma.SortOrderInput | Prisma.SortOrder - refreshTokenExpiresAt?: Prisma.SortOrderInput | Prisma.SortOrder - scope?: Prisma.SortOrderInput | Prisma.SortOrder - password?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.AccountCountOrderByAggregateInput - _max?: Prisma.AccountMaxOrderByAggregateInput - _min?: Prisma.AccountMinOrderByAggregateInput -} - -export type AccountScalarWhereWithAggregatesInput = { - AND?: Prisma.AccountScalarWhereWithAggregatesInput | Prisma.AccountScalarWhereWithAggregatesInput[] - OR?: Prisma.AccountScalarWhereWithAggregatesInput[] - NOT?: Prisma.AccountScalarWhereWithAggregatesInput | Prisma.AccountScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"Account"> | string - accountId?: Prisma.StringWithAggregatesFilter<"Account"> | string - providerId?: Prisma.StringWithAggregatesFilter<"Account"> | string - userId?: Prisma.StringWithAggregatesFilter<"Account"> | string - accessToken?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null - refreshToken?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null - idToken?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null - accessTokenExpiresAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Account"> | Date | string | null - refreshTokenExpiresAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Account"> | Date | string | null - scope?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null - password?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Account"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Account"> | Date | string -} - -export type AccountCreateInput = { - id?: string - accountId: string - providerId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string - user: Prisma.UserCreateNestedOneWithoutAccountsInput -} - -export type AccountUncheckedCreateInput = { - id?: string - accountId: string - providerId: string - userId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type AccountUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput -} - -export type AccountUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - userId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type AccountCreateManyInput = { - id?: string - accountId: string - providerId: string - userId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type AccountUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type AccountUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - userId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type AccountListRelationFilter = { - every?: Prisma.AccountWhereInput - some?: Prisma.AccountWhereInput - none?: Prisma.AccountWhereInput -} - -export type AccountOrderByRelationAggregateInput = { - _count?: Prisma.SortOrder -} - -export type AccountCountOrderByAggregateInput = { - id?: Prisma.SortOrder - accountId?: Prisma.SortOrder - providerId?: Prisma.SortOrder - userId?: Prisma.SortOrder - accessToken?: Prisma.SortOrder - refreshToken?: Prisma.SortOrder - idToken?: Prisma.SortOrder - accessTokenExpiresAt?: Prisma.SortOrder - refreshTokenExpiresAt?: Prisma.SortOrder - scope?: Prisma.SortOrder - password?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type AccountMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - accountId?: Prisma.SortOrder - providerId?: Prisma.SortOrder - userId?: Prisma.SortOrder - accessToken?: Prisma.SortOrder - refreshToken?: Prisma.SortOrder - idToken?: Prisma.SortOrder - accessTokenExpiresAt?: Prisma.SortOrder - refreshTokenExpiresAt?: Prisma.SortOrder - scope?: Prisma.SortOrder - password?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type AccountMinOrderByAggregateInput = { - id?: Prisma.SortOrder - accountId?: Prisma.SortOrder - providerId?: Prisma.SortOrder - userId?: Prisma.SortOrder - accessToken?: Prisma.SortOrder - refreshToken?: Prisma.SortOrder - idToken?: Prisma.SortOrder - accessTokenExpiresAt?: Prisma.SortOrder - refreshTokenExpiresAt?: Prisma.SortOrder - scope?: Prisma.SortOrder - password?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type AccountCreateNestedManyWithoutUserInput = { - create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] - createMany?: Prisma.AccountCreateManyUserInputEnvelope - connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] -} - -export type AccountUncheckedCreateNestedManyWithoutUserInput = { - create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] - createMany?: Prisma.AccountCreateManyUserInputEnvelope - connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] -} - -export type AccountUpdateManyWithoutUserNestedInput = { - create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] - upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutUserInput | Prisma.AccountUpsertWithWhereUniqueWithoutUserInput[] - createMany?: Prisma.AccountCreateManyUserInputEnvelope - set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - update?: Prisma.AccountUpdateWithWhereUniqueWithoutUserInput | Prisma.AccountUpdateWithWhereUniqueWithoutUserInput[] - updateMany?: Prisma.AccountUpdateManyWithWhereWithoutUserInput | Prisma.AccountUpdateManyWithWhereWithoutUserInput[] - deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] -} - -export type AccountUncheckedUpdateManyWithoutUserNestedInput = { - create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] - upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutUserInput | Prisma.AccountUpsertWithWhereUniqueWithoutUserInput[] - createMany?: Prisma.AccountCreateManyUserInputEnvelope - set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] - update?: Prisma.AccountUpdateWithWhereUniqueWithoutUserInput | Prisma.AccountUpdateWithWhereUniqueWithoutUserInput[] - updateMany?: Prisma.AccountUpdateManyWithWhereWithoutUserInput | Prisma.AccountUpdateManyWithWhereWithoutUserInput[] - deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] -} - -export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null -} - -export type AccountCreateWithoutUserInput = { - id?: string - accountId: string - providerId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type AccountUncheckedCreateWithoutUserInput = { - id?: string - accountId: string - providerId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type AccountCreateOrConnectWithoutUserInput = { - where: Prisma.AccountWhereUniqueInput - create: Prisma.XOR -} - -export type AccountCreateManyUserInputEnvelope = { - data: Prisma.AccountCreateManyUserInput | Prisma.AccountCreateManyUserInput[] - skipDuplicates?: boolean -} - -export type AccountUpsertWithWhereUniqueWithoutUserInput = { - where: Prisma.AccountWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type AccountUpdateWithWhereUniqueWithoutUserInput = { - where: Prisma.AccountWhereUniqueInput - data: Prisma.XOR -} - -export type AccountUpdateManyWithWhereWithoutUserInput = { - where: Prisma.AccountScalarWhereInput - data: Prisma.XOR -} - -export type AccountScalarWhereInput = { - AND?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] - OR?: Prisma.AccountScalarWhereInput[] - NOT?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] - id?: Prisma.StringFilter<"Account"> | string - accountId?: Prisma.StringFilter<"Account"> | string - providerId?: Prisma.StringFilter<"Account"> | string - userId?: Prisma.StringFilter<"Account"> | string - accessToken?: Prisma.StringNullableFilter<"Account"> | string | null - refreshToken?: Prisma.StringNullableFilter<"Account"> | string | null - idToken?: Prisma.StringNullableFilter<"Account"> | string | null - accessTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - refreshTokenExpiresAt?: Prisma.DateTimeNullableFilter<"Account"> | Date | string | null - scope?: Prisma.StringNullableFilter<"Account"> | string | null - password?: Prisma.StringNullableFilter<"Account"> | string | null - createdAt?: Prisma.DateTimeFilter<"Account"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Account"> | Date | string -} - -export type AccountCreateManyUserInput = { - id?: string - accountId: string - providerId: string - accessToken?: string | null - refreshToken?: string | null - idToken?: string | null - accessTokenExpiresAt?: Date | string | null - refreshTokenExpiresAt?: Date | string | null - scope?: string | null - password?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type AccountUpdateWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type AccountUncheckedUpdateWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type AccountUncheckedUpdateManyWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - accountId?: Prisma.StringFieldUpdateOperationsInput | string - providerId?: Prisma.StringFieldUpdateOperationsInput | string - accessToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - refreshToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - idToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - accessTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - refreshTokenExpiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - scope?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - - - -export type AccountSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - accountId?: boolean - providerId?: boolean - userId?: boolean - accessToken?: boolean - refreshToken?: boolean - idToken?: boolean - accessTokenExpiresAt?: boolean - refreshTokenExpiresAt?: boolean - scope?: boolean - password?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["account"]> - -export type AccountSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - accountId?: boolean - providerId?: boolean - userId?: boolean - accessToken?: boolean - refreshToken?: boolean - idToken?: boolean - accessTokenExpiresAt?: boolean - refreshTokenExpiresAt?: boolean - scope?: boolean - password?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["account"]> - -export type AccountSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - accountId?: boolean - providerId?: boolean - userId?: boolean - accessToken?: boolean - refreshToken?: boolean - idToken?: boolean - accessTokenExpiresAt?: boolean - refreshTokenExpiresAt?: boolean - scope?: boolean - password?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["account"]> - -export type AccountSelectScalar = { - id?: boolean - accountId?: boolean - providerId?: boolean - userId?: boolean - accessToken?: boolean - refreshToken?: boolean - idToken?: boolean - accessTokenExpiresAt?: boolean - refreshTokenExpiresAt?: boolean - scope?: boolean - password?: boolean - createdAt?: boolean - updatedAt?: boolean -} - -export type AccountOmit = runtime.Types.Extensions.GetOmit<"id" | "accountId" | "providerId" | "userId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password" | "createdAt" | "updatedAt", ExtArgs["result"]["account"]> -export type AccountInclude = { - user?: boolean | Prisma.UserDefaultArgs -} -export type AccountIncludeCreateManyAndReturn = { - user?: boolean | Prisma.UserDefaultArgs -} -export type AccountIncludeUpdateManyAndReturn = { - user?: boolean | Prisma.UserDefaultArgs -} - -export type $AccountPayload = { - name: "Account" - objects: { - user: Prisma.$UserPayload - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - accountId: string - providerId: string - userId: string - accessToken: string | null - refreshToken: string | null - idToken: string | null - accessTokenExpiresAt: Date | null - refreshTokenExpiresAt: Date | null - scope: string | null - password: string | null - createdAt: Date - updatedAt: Date - }, ExtArgs["result"]["account"]> - composites: {} -} - -export type AccountGetPayload = runtime.Types.Result.GetResult - -export type AccountCountArgs = - Omit & { - select?: AccountCountAggregateInputType | true - } - -export interface AccountDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Account'], meta: { name: 'Account' } } - /** - * Find zero or one Account that matches the filter. - * @param {AccountFindUniqueArgs} args - Arguments to find a Account - * @example - * // Get one Account - * const account = await prisma.account.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one Account that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {AccountFindUniqueOrThrowArgs} args - Arguments to find a Account - * @example - * // Get one Account - * const account = await prisma.account.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Account 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 {AccountFindFirstArgs} args - Arguments to find a Account - * @example - * // Get one Account - * const account = await prisma.account.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Account 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 {AccountFindFirstOrThrowArgs} args - Arguments to find a Account - * @example - * // Get one Account - * const account = await prisma.account.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Accounts 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 {AccountFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Accounts - * const accounts = await prisma.account.findMany() - * - * // Get first 10 Accounts - * const accounts = await prisma.account.findMany({ take: 10 }) - * - * // Only select the `id` - * const accountWithIdOnly = await prisma.account.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a Account. - * @param {AccountCreateArgs} args - Arguments to create a Account. - * @example - * // Create one Account - * const Account = await prisma.account.create({ - * data: { - * // ... data to create a Account - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Accounts. - * @param {AccountCreateManyArgs} args - Arguments to create many Accounts. - * @example - * // Create many Accounts - * const account = await prisma.account.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Accounts and returns the data saved in the database. - * @param {AccountCreateManyAndReturnArgs} args - Arguments to create many Accounts. - * @example - * // Create many Accounts - * const account = await prisma.account.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Accounts and only return the `id` - * const accountWithIdOnly = await prisma.account.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 Account. - * @param {AccountDeleteArgs} args - Arguments to delete one Account. - * @example - * // Delete one Account - * const Account = await prisma.account.delete({ - * where: { - * // ... filter to delete one Account - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one Account. - * @param {AccountUpdateArgs} args - Arguments to update one Account. - * @example - * // Update one Account - * const account = await prisma.account.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Accounts. - * @param {AccountDeleteManyArgs} args - Arguments to filter Accounts to delete. - * @example - * // Delete a few Accounts - * const { count } = await prisma.account.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Accounts. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {AccountUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Accounts - * const account = await prisma.account.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Accounts and returns the data updated in the database. - * @param {AccountUpdateManyAndReturnArgs} args - Arguments to update many Accounts. - * @example - * // Update many Accounts - * const account = await prisma.account.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Accounts and only return the `id` - * const accountWithIdOnly = await prisma.account.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 Account. - * @param {AccountUpsertArgs} args - Arguments to update or create a Account. - * @example - * // Update or create a Account - * const account = await prisma.account.upsert({ - * create: { - * // ... data to create a Account - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Account we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Accounts. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {AccountCountArgs} args - Arguments to filter Accounts to count. - * @example - * // Count the number of Accounts - * const count = await prisma.account.count({ - * where: { - * // ... the filter for the Accounts 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 Account. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {AccountAggregateArgs} 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 Account. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {AccountGroupByArgs} 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 AccountGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: AccountGroupByArgs['orderBy'] } - : { orderBy?: AccountGroupByArgs['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 ? GetAccountGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the Account model - */ -readonly fields: AccountFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for Account. - * 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__AccountClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - 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 Account model - */ -export interface AccountFieldRefs { - readonly id: Prisma.FieldRef<"Account", 'String'> - readonly accountId: Prisma.FieldRef<"Account", 'String'> - readonly providerId: Prisma.FieldRef<"Account", 'String'> - readonly userId: Prisma.FieldRef<"Account", 'String'> - readonly accessToken: Prisma.FieldRef<"Account", 'String'> - readonly refreshToken: Prisma.FieldRef<"Account", 'String'> - readonly idToken: Prisma.FieldRef<"Account", 'String'> - readonly accessTokenExpiresAt: Prisma.FieldRef<"Account", 'DateTime'> - readonly refreshTokenExpiresAt: Prisma.FieldRef<"Account", 'DateTime'> - readonly scope: Prisma.FieldRef<"Account", 'String'> - readonly password: Prisma.FieldRef<"Account", 'String'> - readonly createdAt: Prisma.FieldRef<"Account", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Account", 'DateTime'> -} - - -// Custom InputTypes -/** - * Account findUnique - */ -export type AccountFindUniqueArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter, which Account to fetch. - */ - where: Prisma.AccountWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account findUniqueOrThrow - */ -export type AccountFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter, which Account to fetch. - */ - where: Prisma.AccountWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account findFirst - */ -export type AccountFindFirstArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter, which Account to fetch. - */ - where?: Prisma.AccountWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Accounts to fetch. - */ - orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Accounts. - */ - cursor?: Prisma.AccountWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Accounts 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` Accounts. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Accounts. - */ - distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account findFirstOrThrow - */ -export type AccountFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter, which Account to fetch. - */ - where?: Prisma.AccountWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Accounts to fetch. - */ - orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Accounts. - */ - cursor?: Prisma.AccountWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Accounts 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` Accounts. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Accounts. - */ - distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account findMany - */ -export type AccountFindManyArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter, which Accounts to fetch. - */ - where?: Prisma.AccountWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Accounts to fetch. - */ - orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Accounts. - */ - cursor?: Prisma.AccountWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Accounts 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` Accounts. - */ - skip?: number - distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account create - */ -export type AccountCreateArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * The data needed to create a Account. - */ - data: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account createMany - */ -export type AccountCreateManyArgs = { - /** - * The data used to create many Accounts. - */ - data: Prisma.AccountCreateManyInput | Prisma.AccountCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Account createManyAndReturn - */ -export type AccountCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelectCreateManyAndReturn | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * The data used to create many Accounts. - */ - data: Prisma.AccountCreateManyInput | Prisma.AccountCreateManyInput[] - skipDuplicates?: boolean - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountIncludeCreateManyAndReturn | null -} - -/** - * Account update - */ -export type AccountUpdateArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * The data needed to update a Account. - */ - data: Prisma.XOR - /** - * Choose, which Account to update. - */ - where: Prisma.AccountWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account updateMany - */ -export type AccountUpdateManyArgs = { - /** - * The data used to update Accounts. - */ - data: Prisma.XOR - /** - * Filter which Accounts to update - */ - where?: Prisma.AccountWhereInput - /** - * Limit how many Accounts to update. - */ - limit?: number -} - -/** - * Account updateManyAndReturn - */ -export type AccountUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * The data used to update Accounts. - */ - data: Prisma.XOR - /** - * Filter which Accounts to update - */ - where?: Prisma.AccountWhereInput - /** - * Limit how many Accounts to update. - */ - limit?: number - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountIncludeUpdateManyAndReturn | null -} - -/** - * Account upsert - */ -export type AccountUpsertArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * The filter to search for the Account to update in case it exists. - */ - where: Prisma.AccountWhereUniqueInput - /** - * In case the Account found by the `where` argument doesn't exist, create a new Account with this data. - */ - create: Prisma.XOR - /** - * In case the Account was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account delete - */ -export type AccountDeleteArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - /** - * Filter which Account to delete. - */ - where: Prisma.AccountWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Account deleteMany - */ -export type AccountDeleteManyArgs = { - /** - * Filter which Accounts to delete - */ - where?: Prisma.AccountWhereInput - /** - * Limit how many Accounts to delete. - */ - limit?: number -} - -/** - * Account without action - */ -export type AccountDefaultArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null -} diff --git a/apps/api/src/generated/prisma/models/File.ts b/apps/api/src/generated/prisma/models/File.ts deleted file mode 100644 index 221d1bb..0000000 --- a/apps/api/src/generated/prisma/models/File.ts +++ /dev/null @@ -1,1261 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `File` 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 File - * - */ -export type FileModel = runtime.Types.Result.DefaultSelection - -export type AggregateFile = { - _count: FileCountAggregateOutputType | null - _avg: FileAvgAggregateOutputType | null - _sum: FileSumAggregateOutputType | null - _min: FileMinAggregateOutputType | null - _max: FileMaxAggregateOutputType | null -} - -export type FileAvgAggregateOutputType = { - sizeBytes: number | null -} - -export type FileSumAggregateOutputType = { - sizeBytes: bigint | null -} - -export type FileMinAggregateOutputType = { - id: string | null - storageKey: string | null - name: string | null - mimeType: string | null - sizeBytes: bigint | null - createdAt: Date | null - updatedAt: Date | null -} - -export type FileMaxAggregateOutputType = { - id: string | null - storageKey: string | null - name: string | null - mimeType: string | null - sizeBytes: bigint | null - createdAt: Date | null - updatedAt: Date | null -} - -export type FileCountAggregateOutputType = { - id: number - storageKey: number - name: number - mimeType: number - sizeBytes: number - createdAt: number - updatedAt: number - _all: number -} - - -export type FileAvgAggregateInputType = { - sizeBytes?: true -} - -export type FileSumAggregateInputType = { - sizeBytes?: true -} - -export type FileMinAggregateInputType = { - id?: true - storageKey?: true - name?: true - mimeType?: true - sizeBytes?: true - createdAt?: true - updatedAt?: true -} - -export type FileMaxAggregateInputType = { - id?: true - storageKey?: true - name?: true - mimeType?: true - sizeBytes?: true - createdAt?: true - updatedAt?: true -} - -export type FileCountAggregateInputType = { - id?: true - storageKey?: true - name?: true - mimeType?: true - sizeBytes?: true - createdAt?: true - updatedAt?: true - _all?: true -} - -export type FileAggregateArgs = { - /** - * Filter which File to aggregate. - */ - where?: Prisma.FileWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Files to fetch. - */ - orderBy?: Prisma.FileOrderByWithRelationInput | Prisma.FileOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.FileWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Files 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` Files. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Files - **/ - _count?: true | FileCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: FileAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: FileSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: FileMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: FileMaxAggregateInputType -} - -export type GetFileAggregateType = { - [P in keyof T & keyof AggregateFile]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type FileGroupByArgs = { - where?: Prisma.FileWhereInput - orderBy?: Prisma.FileOrderByWithAggregationInput | Prisma.FileOrderByWithAggregationInput[] - by: Prisma.FileScalarFieldEnum[] | Prisma.FileScalarFieldEnum - having?: Prisma.FileScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: FileCountAggregateInputType | true - _avg?: FileAvgAggregateInputType - _sum?: FileSumAggregateInputType - _min?: FileMinAggregateInputType - _max?: FileMaxAggregateInputType -} - -export type FileGroupByOutputType = { - id: string - storageKey: string - name: string - mimeType: string - sizeBytes: bigint - createdAt: Date - updatedAt: Date - _count: FileCountAggregateOutputType | null - _avg: FileAvgAggregateOutputType | null - _sum: FileSumAggregateOutputType | null - _min: FileMinAggregateOutputType | null - _max: FileMaxAggregateOutputType | null -} - -type GetFileGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof FileGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type FileWhereInput = { - AND?: Prisma.FileWhereInput | Prisma.FileWhereInput[] - OR?: Prisma.FileWhereInput[] - NOT?: Prisma.FileWhereInput | Prisma.FileWhereInput[] - id?: Prisma.StringFilter<"File"> | string - storageKey?: Prisma.StringFilter<"File"> | string - name?: Prisma.StringFilter<"File"> | string - mimeType?: Prisma.StringFilter<"File"> | string - sizeBytes?: Prisma.BigIntFilter<"File"> | bigint | number - createdAt?: Prisma.DateTimeFilter<"File"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"File"> | Date | string -} - -export type FileOrderByWithRelationInput = { - id?: Prisma.SortOrder - storageKey?: Prisma.SortOrder - name?: Prisma.SortOrder - mimeType?: Prisma.SortOrder - sizeBytes?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type FileWhereUniqueInput = Prisma.AtLeast<{ - id?: string - storageKey?: string - AND?: Prisma.FileWhereInput | Prisma.FileWhereInput[] - OR?: Prisma.FileWhereInput[] - NOT?: Prisma.FileWhereInput | Prisma.FileWhereInput[] - name?: Prisma.StringFilter<"File"> | string - mimeType?: Prisma.StringFilter<"File"> | string - sizeBytes?: Prisma.BigIntFilter<"File"> | bigint | number - createdAt?: Prisma.DateTimeFilter<"File"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"File"> | Date | string -}, "id" | "storageKey"> - -export type FileOrderByWithAggregationInput = { - id?: Prisma.SortOrder - storageKey?: Prisma.SortOrder - name?: Prisma.SortOrder - mimeType?: Prisma.SortOrder - sizeBytes?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.FileCountOrderByAggregateInput - _avg?: Prisma.FileAvgOrderByAggregateInput - _max?: Prisma.FileMaxOrderByAggregateInput - _min?: Prisma.FileMinOrderByAggregateInput - _sum?: Prisma.FileSumOrderByAggregateInput -} - -export type FileScalarWhereWithAggregatesInput = { - AND?: Prisma.FileScalarWhereWithAggregatesInput | Prisma.FileScalarWhereWithAggregatesInput[] - OR?: Prisma.FileScalarWhereWithAggregatesInput[] - NOT?: Prisma.FileScalarWhereWithAggregatesInput | Prisma.FileScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"File"> | string - storageKey?: Prisma.StringWithAggregatesFilter<"File"> | string - name?: Prisma.StringWithAggregatesFilter<"File"> | string - mimeType?: Prisma.StringWithAggregatesFilter<"File"> | string - sizeBytes?: Prisma.BigIntWithAggregatesFilter<"File"> | bigint | number - createdAt?: Prisma.DateTimeWithAggregatesFilter<"File"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"File"> | Date | string -} - -export type FileCreateInput = { - id?: string - storageKey: string - name: string - mimeType: string - sizeBytes: bigint | number - createdAt?: Date | string - updatedAt?: Date | string -} - -export type FileUncheckedCreateInput = { - id?: string - storageKey: string - name: string - mimeType: string - sizeBytes: bigint | number - createdAt?: Date | string - updatedAt?: Date | string -} - -export type FileUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - storageKey?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - mimeType?: Prisma.StringFieldUpdateOperationsInput | string - sizeBytes?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type FileUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - storageKey?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - mimeType?: Prisma.StringFieldUpdateOperationsInput | string - sizeBytes?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type FileCreateManyInput = { - id?: string - storageKey: string - name: string - mimeType: string - sizeBytes: bigint | number - createdAt?: Date | string - updatedAt?: Date | string -} - -export type FileUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - storageKey?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - mimeType?: Prisma.StringFieldUpdateOperationsInput | string - sizeBytes?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type FileUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - storageKey?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - mimeType?: Prisma.StringFieldUpdateOperationsInput | string - sizeBytes?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type FileCountOrderByAggregateInput = { - id?: Prisma.SortOrder - storageKey?: Prisma.SortOrder - name?: Prisma.SortOrder - mimeType?: Prisma.SortOrder - sizeBytes?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type FileAvgOrderByAggregateInput = { - sizeBytes?: Prisma.SortOrder -} - -export type FileMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - storageKey?: Prisma.SortOrder - name?: Prisma.SortOrder - mimeType?: Prisma.SortOrder - sizeBytes?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type FileMinOrderByAggregateInput = { - id?: Prisma.SortOrder - storageKey?: Prisma.SortOrder - name?: Prisma.SortOrder - mimeType?: Prisma.SortOrder - sizeBytes?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type FileSumOrderByAggregateInput = { - sizeBytes?: Prisma.SortOrder -} - -export type BigIntFieldUpdateOperationsInput = { - set?: bigint | number - increment?: bigint | number - decrement?: bigint | number - multiply?: bigint | number - divide?: bigint | number -} - - - -export type FileSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - storageKey?: boolean - name?: boolean - mimeType?: boolean - sizeBytes?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["file"]> - -export type FileSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - storageKey?: boolean - name?: boolean - mimeType?: boolean - sizeBytes?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["file"]> - -export type FileSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - storageKey?: boolean - name?: boolean - mimeType?: boolean - sizeBytes?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["file"]> - -export type FileSelectScalar = { - id?: boolean - storageKey?: boolean - name?: boolean - mimeType?: boolean - sizeBytes?: boolean - createdAt?: boolean - updatedAt?: boolean -} - -export type FileOmit = runtime.Types.Extensions.GetOmit<"id" | "storageKey" | "name" | "mimeType" | "sizeBytes" | "createdAt" | "updatedAt", ExtArgs["result"]["file"]> - -export type $FilePayload = { - name: "File" - objects: {} - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - storageKey: string - name: string - mimeType: string - sizeBytes: bigint - createdAt: Date - updatedAt: Date - }, ExtArgs["result"]["file"]> - composites: {} -} - -export type FileGetPayload = runtime.Types.Result.GetResult - -export type FileCountArgs = - Omit & { - select?: FileCountAggregateInputType | true - } - -export interface FileDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['File'], meta: { name: 'File' } } - /** - * Find zero or one File that matches the filter. - * @param {FileFindUniqueArgs} args - Arguments to find a File - * @example - * // Get one File - * const file = await prisma.file.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one File that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {FileFindUniqueOrThrowArgs} args - Arguments to find a File - * @example - * // Get one File - * const file = await prisma.file.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first File 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 {FileFindFirstArgs} args - Arguments to find a File - * @example - * // Get one File - * const file = await prisma.file.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first File 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 {FileFindFirstOrThrowArgs} args - Arguments to find a File - * @example - * // Get one File - * const file = await prisma.file.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Files 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 {FileFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Files - * const files = await prisma.file.findMany() - * - * // Get first 10 Files - * const files = await prisma.file.findMany({ take: 10 }) - * - * // Only select the `id` - * const fileWithIdOnly = await prisma.file.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a File. - * @param {FileCreateArgs} args - Arguments to create a File. - * @example - * // Create one File - * const File = await prisma.file.create({ - * data: { - * // ... data to create a File - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Files. - * @param {FileCreateManyArgs} args - Arguments to create many Files. - * @example - * // Create many Files - * const file = await prisma.file.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Files and returns the data saved in the database. - * @param {FileCreateManyAndReturnArgs} args - Arguments to create many Files. - * @example - * // Create many Files - * const file = await prisma.file.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Files and only return the `id` - * const fileWithIdOnly = await prisma.file.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 File. - * @param {FileDeleteArgs} args - Arguments to delete one File. - * @example - * // Delete one File - * const File = await prisma.file.delete({ - * where: { - * // ... filter to delete one File - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one File. - * @param {FileUpdateArgs} args - Arguments to update one File. - * @example - * // Update one File - * const file = await prisma.file.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Files. - * @param {FileDeleteManyArgs} args - Arguments to filter Files to delete. - * @example - * // Delete a few Files - * const { count } = await prisma.file.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Files. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {FileUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Files - * const file = await prisma.file.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Files and returns the data updated in the database. - * @param {FileUpdateManyAndReturnArgs} args - Arguments to update many Files. - * @example - * // Update many Files - * const file = await prisma.file.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Files and only return the `id` - * const fileWithIdOnly = await prisma.file.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 File. - * @param {FileUpsertArgs} args - Arguments to update or create a File. - * @example - * // Update or create a File - * const file = await prisma.file.upsert({ - * create: { - * // ... data to create a File - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the File we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__FileClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Files. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {FileCountArgs} args - Arguments to filter Files to count. - * @example - * // Count the number of Files - * const count = await prisma.file.count({ - * where: { - * // ... the filter for the Files 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 File. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {FileAggregateArgs} 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 File. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {FileGroupByArgs} 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 FileGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: FileGroupByArgs['orderBy'] } - : { orderBy?: FileGroupByArgs['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 ? GetFileGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the File model - */ -readonly fields: FileFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for File. - * 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__FileClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - /** - * 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 File model - */ -export interface FileFieldRefs { - readonly id: Prisma.FieldRef<"File", 'String'> - readonly storageKey: Prisma.FieldRef<"File", 'String'> - readonly name: Prisma.FieldRef<"File", 'String'> - readonly mimeType: Prisma.FieldRef<"File", 'String'> - readonly sizeBytes: Prisma.FieldRef<"File", 'BigInt'> - readonly createdAt: Prisma.FieldRef<"File", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"File", 'DateTime'> -} - - -// Custom InputTypes -/** - * File findUnique - */ -export type FileFindUniqueArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter, which File to fetch. - */ - where: Prisma.FileWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File findUniqueOrThrow - */ -export type FileFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter, which File to fetch. - */ - where: Prisma.FileWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File findFirst - */ -export type FileFindFirstArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter, which File to fetch. - */ - where?: Prisma.FileWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Files to fetch. - */ - orderBy?: Prisma.FileOrderByWithRelationInput | Prisma.FileOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Files. - */ - cursor?: Prisma.FileWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Files 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` Files. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Files. - */ - distinct?: Prisma.FileScalarFieldEnum | Prisma.FileScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File findFirstOrThrow - */ -export type FileFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter, which File to fetch. - */ - where?: Prisma.FileWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Files to fetch. - */ - orderBy?: Prisma.FileOrderByWithRelationInput | Prisma.FileOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Files. - */ - cursor?: Prisma.FileWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Files 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` Files. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Files. - */ - distinct?: Prisma.FileScalarFieldEnum | Prisma.FileScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File findMany - */ -export type FileFindManyArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter, which Files to fetch. - */ - where?: Prisma.FileWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Files to fetch. - */ - orderBy?: Prisma.FileOrderByWithRelationInput | Prisma.FileOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Files. - */ - cursor?: Prisma.FileWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Files 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` Files. - */ - skip?: number - distinct?: Prisma.FileScalarFieldEnum | Prisma.FileScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File create - */ -export type FileCreateArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * The data needed to create a File. - */ - data: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File createMany - */ -export type FileCreateManyArgs = { - /** - * The data used to create many Files. - */ - data: Prisma.FileCreateManyInput | Prisma.FileCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * File createManyAndReturn - */ -export type FileCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelectCreateManyAndReturn | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * The data used to create many Files. - */ - data: Prisma.FileCreateManyInput | Prisma.FileCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * File update - */ -export type FileUpdateArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * The data needed to update a File. - */ - data: Prisma.XOR - /** - * Choose, which File to update. - */ - where: Prisma.FileWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File updateMany - */ -export type FileUpdateManyArgs = { - /** - * The data used to update Files. - */ - data: Prisma.XOR - /** - * Filter which Files to update - */ - where?: Prisma.FileWhereInput - /** - * Limit how many Files to update. - */ - limit?: number -} - -/** - * File updateManyAndReturn - */ -export type FileUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * The data used to update Files. - */ - data: Prisma.XOR - /** - * Filter which Files to update - */ - where?: Prisma.FileWhereInput - /** - * Limit how many Files to update. - */ - limit?: number -} - -/** - * File upsert - */ -export type FileUpsertArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * The filter to search for the File to update in case it exists. - */ - where: Prisma.FileWhereUniqueInput - /** - * In case the File found by the `where` argument doesn't exist, create a new File with this data. - */ - create: Prisma.XOR - /** - * In case the File was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File delete - */ -export type FileDeleteArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null - /** - * Filter which File to delete. - */ - where: Prisma.FileWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * File deleteMany - */ -export type FileDeleteManyArgs = { - /** - * Filter which Files to delete - */ - where?: Prisma.FileWhereInput - /** - * Limit how many Files to delete. - */ - limit?: number -} - -/** - * File without action - */ -export type FileDefaultArgs = { - /** - * Select specific fields to fetch from the File - */ - select?: Prisma.FileSelect | null - /** - * Omit specific fields from the File - */ - omit?: Prisma.FileOmit | null -} diff --git a/apps/api/src/generated/prisma/models/Session.ts b/apps/api/src/generated/prisma/models/Session.ts deleted file mode 100644 index d99763a..0000000 --- a/apps/api/src/generated/prisma/models/Session.ts +++ /dev/null @@ -1,1454 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `Session` 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 Session - * - */ -export type SessionModel = runtime.Types.Result.DefaultSelection - -export type AggregateSession = { - _count: SessionCountAggregateOutputType | null - _min: SessionMinAggregateOutputType | null - _max: SessionMaxAggregateOutputType | null -} - -export type SessionMinAggregateOutputType = { - id: string | null - expiresAt: Date | null - token: string | null - ipAddress: string | null - userAgent: string | null - userId: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type SessionMaxAggregateOutputType = { - id: string | null - expiresAt: Date | null - token: string | null - ipAddress: string | null - userAgent: string | null - userId: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type SessionCountAggregateOutputType = { - id: number - expiresAt: number - token: number - ipAddress: number - userAgent: number - userId: number - createdAt: number - updatedAt: number - _all: number -} - - -export type SessionMinAggregateInputType = { - id?: true - expiresAt?: true - token?: true - ipAddress?: true - userAgent?: true - userId?: true - createdAt?: true - updatedAt?: true -} - -export type SessionMaxAggregateInputType = { - id?: true - expiresAt?: true - token?: true - ipAddress?: true - userAgent?: true - userId?: true - createdAt?: true - updatedAt?: true -} - -export type SessionCountAggregateInputType = { - id?: true - expiresAt?: true - token?: true - ipAddress?: true - userAgent?: true - userId?: true - createdAt?: true - updatedAt?: true - _all?: true -} - -export type SessionAggregateArgs = { - /** - * Filter which Session to aggregate. - */ - where?: Prisma.SessionWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Sessions to fetch. - */ - orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.SessionWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Sessions 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` Sessions. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Sessions - **/ - _count?: true | SessionCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: SessionMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: SessionMaxAggregateInputType -} - -export type GetSessionAggregateType = { - [P in keyof T & keyof AggregateSession]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type SessionGroupByArgs = { - where?: Prisma.SessionWhereInput - orderBy?: Prisma.SessionOrderByWithAggregationInput | Prisma.SessionOrderByWithAggregationInput[] - by: Prisma.SessionScalarFieldEnum[] | Prisma.SessionScalarFieldEnum - having?: Prisma.SessionScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: SessionCountAggregateInputType | true - _min?: SessionMinAggregateInputType - _max?: SessionMaxAggregateInputType -} - -export type SessionGroupByOutputType = { - id: string - expiresAt: Date - token: string - ipAddress: string | null - userAgent: string | null - userId: string - createdAt: Date - updatedAt: Date - _count: SessionCountAggregateOutputType | null - _min: SessionMinAggregateOutputType | null - _max: SessionMaxAggregateOutputType | null -} - -type GetSessionGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof SessionGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type SessionWhereInput = { - AND?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] - OR?: Prisma.SessionWhereInput[] - NOT?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] - id?: Prisma.StringFilter<"Session"> | string - expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string - token?: Prisma.StringFilter<"Session"> | string - ipAddress?: Prisma.StringNullableFilter<"Session"> | string | null - userAgent?: Prisma.StringNullableFilter<"Session"> | string | null - userId?: Prisma.StringFilter<"Session"> | string - createdAt?: Prisma.DateTimeFilter<"Session"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Session"> | Date | string - user?: Prisma.XOR -} - -export type SessionOrderByWithRelationInput = { - id?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - token?: Prisma.SortOrder - ipAddress?: Prisma.SortOrderInput | Prisma.SortOrder - userAgent?: Prisma.SortOrderInput | Prisma.SortOrder - userId?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - user?: Prisma.UserOrderByWithRelationInput -} - -export type SessionWhereUniqueInput = Prisma.AtLeast<{ - id?: string - token?: string - AND?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] - OR?: Prisma.SessionWhereInput[] - NOT?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] - expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string - ipAddress?: Prisma.StringNullableFilter<"Session"> | string | null - userAgent?: Prisma.StringNullableFilter<"Session"> | string | null - userId?: Prisma.StringFilter<"Session"> | string - createdAt?: Prisma.DateTimeFilter<"Session"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Session"> | Date | string - user?: Prisma.XOR -}, "id" | "token"> - -export type SessionOrderByWithAggregationInput = { - id?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - token?: Prisma.SortOrder - ipAddress?: Prisma.SortOrderInput | Prisma.SortOrder - userAgent?: Prisma.SortOrderInput | Prisma.SortOrder - userId?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.SessionCountOrderByAggregateInput - _max?: Prisma.SessionMaxOrderByAggregateInput - _min?: Prisma.SessionMinOrderByAggregateInput -} - -export type SessionScalarWhereWithAggregatesInput = { - AND?: Prisma.SessionScalarWhereWithAggregatesInput | Prisma.SessionScalarWhereWithAggregatesInput[] - OR?: Prisma.SessionScalarWhereWithAggregatesInput[] - NOT?: Prisma.SessionScalarWhereWithAggregatesInput | Prisma.SessionScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"Session"> | string - expiresAt?: Prisma.DateTimeWithAggregatesFilter<"Session"> | Date | string - token?: Prisma.StringWithAggregatesFilter<"Session"> | string - ipAddress?: Prisma.StringNullableWithAggregatesFilter<"Session"> | string | null - userAgent?: Prisma.StringNullableWithAggregatesFilter<"Session"> | string | null - userId?: Prisma.StringWithAggregatesFilter<"Session"> | string - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Session"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Session"> | Date | string -} - -export type SessionCreateInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - updatedAt?: Date | string - user: Prisma.UserCreateNestedOneWithoutSessionsInput -} - -export type SessionUncheckedCreateInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - userId: string - createdAt?: Date | string - updatedAt?: Date | string -} - -export type SessionUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - user?: Prisma.UserUpdateOneRequiredWithoutSessionsNestedInput -} - -export type SessionUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userId?: Prisma.StringFieldUpdateOperationsInput | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type SessionCreateManyInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - userId: string - createdAt?: Date | string - updatedAt?: Date | string -} - -export type SessionUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type SessionUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userId?: Prisma.StringFieldUpdateOperationsInput | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type SessionListRelationFilter = { - every?: Prisma.SessionWhereInput - some?: Prisma.SessionWhereInput - none?: Prisma.SessionWhereInput -} - -export type SessionOrderByRelationAggregateInput = { - _count?: Prisma.SortOrder -} - -export type SessionCountOrderByAggregateInput = { - id?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - token?: Prisma.SortOrder - ipAddress?: Prisma.SortOrder - userAgent?: Prisma.SortOrder - userId?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type SessionMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - token?: Prisma.SortOrder - ipAddress?: Prisma.SortOrder - userAgent?: Prisma.SortOrder - userId?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type SessionMinOrderByAggregateInput = { - id?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - token?: Prisma.SortOrder - ipAddress?: Prisma.SortOrder - userAgent?: Prisma.SortOrder - userId?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type SessionCreateNestedManyWithoutUserInput = { - create?: Prisma.XOR | Prisma.SessionCreateWithoutUserInput[] | Prisma.SessionUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.SessionCreateOrConnectWithoutUserInput | Prisma.SessionCreateOrConnectWithoutUserInput[] - createMany?: Prisma.SessionCreateManyUserInputEnvelope - connect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] -} - -export type SessionUncheckedCreateNestedManyWithoutUserInput = { - create?: Prisma.XOR | Prisma.SessionCreateWithoutUserInput[] | Prisma.SessionUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.SessionCreateOrConnectWithoutUserInput | Prisma.SessionCreateOrConnectWithoutUserInput[] - createMany?: Prisma.SessionCreateManyUserInputEnvelope - connect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] -} - -export type SessionUpdateManyWithoutUserNestedInput = { - create?: Prisma.XOR | Prisma.SessionCreateWithoutUserInput[] | Prisma.SessionUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.SessionCreateOrConnectWithoutUserInput | Prisma.SessionCreateOrConnectWithoutUserInput[] - upsert?: Prisma.SessionUpsertWithWhereUniqueWithoutUserInput | Prisma.SessionUpsertWithWhereUniqueWithoutUserInput[] - createMany?: Prisma.SessionCreateManyUserInputEnvelope - set?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - disconnect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - delete?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - connect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - update?: Prisma.SessionUpdateWithWhereUniqueWithoutUserInput | Prisma.SessionUpdateWithWhereUniqueWithoutUserInput[] - updateMany?: Prisma.SessionUpdateManyWithWhereWithoutUserInput | Prisma.SessionUpdateManyWithWhereWithoutUserInput[] - deleteMany?: Prisma.SessionScalarWhereInput | Prisma.SessionScalarWhereInput[] -} - -export type SessionUncheckedUpdateManyWithoutUserNestedInput = { - create?: Prisma.XOR | Prisma.SessionCreateWithoutUserInput[] | Prisma.SessionUncheckedCreateWithoutUserInput[] - connectOrCreate?: Prisma.SessionCreateOrConnectWithoutUserInput | Prisma.SessionCreateOrConnectWithoutUserInput[] - upsert?: Prisma.SessionUpsertWithWhereUniqueWithoutUserInput | Prisma.SessionUpsertWithWhereUniqueWithoutUserInput[] - createMany?: Prisma.SessionCreateManyUserInputEnvelope - set?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - disconnect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - delete?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - connect?: Prisma.SessionWhereUniqueInput | Prisma.SessionWhereUniqueInput[] - update?: Prisma.SessionUpdateWithWhereUniqueWithoutUserInput | Prisma.SessionUpdateWithWhereUniqueWithoutUserInput[] - updateMany?: Prisma.SessionUpdateManyWithWhereWithoutUserInput | Prisma.SessionUpdateManyWithWhereWithoutUserInput[] - deleteMany?: Prisma.SessionScalarWhereInput | Prisma.SessionScalarWhereInput[] -} - -export type SessionCreateWithoutUserInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type SessionUncheckedCreateWithoutUserInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type SessionCreateOrConnectWithoutUserInput = { - where: Prisma.SessionWhereUniqueInput - create: Prisma.XOR -} - -export type SessionCreateManyUserInputEnvelope = { - data: Prisma.SessionCreateManyUserInput | Prisma.SessionCreateManyUserInput[] - skipDuplicates?: boolean -} - -export type SessionUpsertWithWhereUniqueWithoutUserInput = { - where: Prisma.SessionWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type SessionUpdateWithWhereUniqueWithoutUserInput = { - where: Prisma.SessionWhereUniqueInput - data: Prisma.XOR -} - -export type SessionUpdateManyWithWhereWithoutUserInput = { - where: Prisma.SessionScalarWhereInput - data: Prisma.XOR -} - -export type SessionScalarWhereInput = { - AND?: Prisma.SessionScalarWhereInput | Prisma.SessionScalarWhereInput[] - OR?: Prisma.SessionScalarWhereInput[] - NOT?: Prisma.SessionScalarWhereInput | Prisma.SessionScalarWhereInput[] - id?: Prisma.StringFilter<"Session"> | string - expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string - token?: Prisma.StringFilter<"Session"> | string - ipAddress?: Prisma.StringNullableFilter<"Session"> | string | null - userAgent?: Prisma.StringNullableFilter<"Session"> | string | null - userId?: Prisma.StringFilter<"Session"> | string - createdAt?: Prisma.DateTimeFilter<"Session"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Session"> | Date | string -} - -export type SessionCreateManyUserInput = { - id?: string - expiresAt: Date | string - token: string - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type SessionUpdateWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type SessionUncheckedUpdateWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type SessionUncheckedUpdateManyWithoutUserInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - token?: Prisma.StringFieldUpdateOperationsInput | string - ipAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - - - -export type SessionSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - expiresAt?: boolean - token?: boolean - ipAddress?: boolean - userAgent?: boolean - userId?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["session"]> - -export type SessionSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - expiresAt?: boolean - token?: boolean - ipAddress?: boolean - userAgent?: boolean - userId?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["session"]> - -export type SessionSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - expiresAt?: boolean - token?: boolean - ipAddress?: boolean - userAgent?: boolean - userId?: boolean - createdAt?: boolean - updatedAt?: boolean - user?: boolean | Prisma.UserDefaultArgs -}, ExtArgs["result"]["session"]> - -export type SessionSelectScalar = { - id?: boolean - expiresAt?: boolean - token?: boolean - ipAddress?: boolean - userAgent?: boolean - userId?: boolean - createdAt?: boolean - updatedAt?: boolean -} - -export type SessionOmit = runtime.Types.Extensions.GetOmit<"id" | "expiresAt" | "token" | "ipAddress" | "userAgent" | "userId" | "createdAt" | "updatedAt", ExtArgs["result"]["session"]> -export type SessionInclude = { - user?: boolean | Prisma.UserDefaultArgs -} -export type SessionIncludeCreateManyAndReturn = { - user?: boolean | Prisma.UserDefaultArgs -} -export type SessionIncludeUpdateManyAndReturn = { - user?: boolean | Prisma.UserDefaultArgs -} - -export type $SessionPayload = { - name: "Session" - objects: { - user: Prisma.$UserPayload - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - expiresAt: Date - token: string - ipAddress: string | null - userAgent: string | null - userId: string - createdAt: Date - updatedAt: Date - }, ExtArgs["result"]["session"]> - composites: {} -} - -export type SessionGetPayload = runtime.Types.Result.GetResult - -export type SessionCountArgs = - Omit & { - select?: SessionCountAggregateInputType | true - } - -export interface SessionDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Session'], meta: { name: 'Session' } } - /** - * Find zero or one Session that matches the filter. - * @param {SessionFindUniqueArgs} args - Arguments to find a Session - * @example - * // Get one Session - * const session = await prisma.session.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one Session that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {SessionFindUniqueOrThrowArgs} args - Arguments to find a Session - * @example - * // Get one Session - * const session = await prisma.session.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Session 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 {SessionFindFirstArgs} args - Arguments to find a Session - * @example - * // Get one Session - * const session = await prisma.session.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Session 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 {SessionFindFirstOrThrowArgs} args - Arguments to find a Session - * @example - * // Get one Session - * const session = await prisma.session.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Sessions 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 {SessionFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Sessions - * const sessions = await prisma.session.findMany() - * - * // Get first 10 Sessions - * const sessions = await prisma.session.findMany({ take: 10 }) - * - * // Only select the `id` - * const sessionWithIdOnly = await prisma.session.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a Session. - * @param {SessionCreateArgs} args - Arguments to create a Session. - * @example - * // Create one Session - * const Session = await prisma.session.create({ - * data: { - * // ... data to create a Session - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Sessions. - * @param {SessionCreateManyArgs} args - Arguments to create many Sessions. - * @example - * // Create many Sessions - * const session = await prisma.session.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Sessions and returns the data saved in the database. - * @param {SessionCreateManyAndReturnArgs} args - Arguments to create many Sessions. - * @example - * // Create many Sessions - * const session = await prisma.session.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Sessions and only return the `id` - * const sessionWithIdOnly = await prisma.session.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 Session. - * @param {SessionDeleteArgs} args - Arguments to delete one Session. - * @example - * // Delete one Session - * const Session = await prisma.session.delete({ - * where: { - * // ... filter to delete one Session - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one Session. - * @param {SessionUpdateArgs} args - Arguments to update one Session. - * @example - * // Update one Session - * const session = await prisma.session.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Sessions. - * @param {SessionDeleteManyArgs} args - Arguments to filter Sessions to delete. - * @example - * // Delete a few Sessions - * const { count } = await prisma.session.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Sessions. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {SessionUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Sessions - * const session = await prisma.session.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Sessions and returns the data updated in the database. - * @param {SessionUpdateManyAndReturnArgs} args - Arguments to update many Sessions. - * @example - * // Update many Sessions - * const session = await prisma.session.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Sessions and only return the `id` - * const sessionWithIdOnly = await prisma.session.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 Session. - * @param {SessionUpsertArgs} args - Arguments to update or create a Session. - * @example - * // Update or create a Session - * const session = await prisma.session.upsert({ - * create: { - * // ... data to create a Session - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Session we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SessionClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Sessions. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {SessionCountArgs} args - Arguments to filter Sessions to count. - * @example - * // Count the number of Sessions - * const count = await prisma.session.count({ - * where: { - * // ... the filter for the Sessions 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 Session. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {SessionAggregateArgs} 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 Session. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {SessionGroupByArgs} 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 SessionGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: SessionGroupByArgs['orderBy'] } - : { orderBy?: SessionGroupByArgs['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 ? GetSessionGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the Session model - */ -readonly fields: SessionFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for Session. - * 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__SessionClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - 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 Session model - */ -export interface SessionFieldRefs { - readonly id: Prisma.FieldRef<"Session", 'String'> - readonly expiresAt: Prisma.FieldRef<"Session", 'DateTime'> - readonly token: Prisma.FieldRef<"Session", 'String'> - readonly ipAddress: Prisma.FieldRef<"Session", 'String'> - readonly userAgent: Prisma.FieldRef<"Session", 'String'> - readonly userId: Prisma.FieldRef<"Session", 'String'> - readonly createdAt: Prisma.FieldRef<"Session", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Session", 'DateTime'> -} - - -// Custom InputTypes -/** - * Session findUnique - */ -export type SessionFindUniqueArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter, which Session to fetch. - */ - where: Prisma.SessionWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session findUniqueOrThrow - */ -export type SessionFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter, which Session to fetch. - */ - where: Prisma.SessionWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session findFirst - */ -export type SessionFindFirstArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter, which Session to fetch. - */ - where?: Prisma.SessionWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Sessions to fetch. - */ - orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Sessions. - */ - cursor?: Prisma.SessionWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Sessions 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` Sessions. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Sessions. - */ - distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session findFirstOrThrow - */ -export type SessionFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter, which Session to fetch. - */ - where?: Prisma.SessionWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Sessions to fetch. - */ - orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Sessions. - */ - cursor?: Prisma.SessionWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Sessions 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` Sessions. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Sessions. - */ - distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session findMany - */ -export type SessionFindManyArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter, which Sessions to fetch. - */ - where?: Prisma.SessionWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Sessions to fetch. - */ - orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Sessions. - */ - cursor?: Prisma.SessionWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Sessions 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` Sessions. - */ - skip?: number - distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session create - */ -export type SessionCreateArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * The data needed to create a Session. - */ - data: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session createMany - */ -export type SessionCreateManyArgs = { - /** - * The data used to create many Sessions. - */ - data: Prisma.SessionCreateManyInput | Prisma.SessionCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Session createManyAndReturn - */ -export type SessionCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelectCreateManyAndReturn | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * The data used to create many Sessions. - */ - data: Prisma.SessionCreateManyInput | Prisma.SessionCreateManyInput[] - skipDuplicates?: boolean - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionIncludeCreateManyAndReturn | null -} - -/** - * Session update - */ -export type SessionUpdateArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * The data needed to update a Session. - */ - data: Prisma.XOR - /** - * Choose, which Session to update. - */ - where: Prisma.SessionWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session updateMany - */ -export type SessionUpdateManyArgs = { - /** - * The data used to update Sessions. - */ - data: Prisma.XOR - /** - * Filter which Sessions to update - */ - where?: Prisma.SessionWhereInput - /** - * Limit how many Sessions to update. - */ - limit?: number -} - -/** - * Session updateManyAndReturn - */ -export type SessionUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * The data used to update Sessions. - */ - data: Prisma.XOR - /** - * Filter which Sessions to update - */ - where?: Prisma.SessionWhereInput - /** - * Limit how many Sessions to update. - */ - limit?: number - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionIncludeUpdateManyAndReturn | null -} - -/** - * Session upsert - */ -export type SessionUpsertArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * The filter to search for the Session to update in case it exists. - */ - where: Prisma.SessionWhereUniqueInput - /** - * In case the Session found by the `where` argument doesn't exist, create a new Session with this data. - */ - create: Prisma.XOR - /** - * In case the Session was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session delete - */ -export type SessionDeleteArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - /** - * Filter which Session to delete. - */ - where: Prisma.SessionWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Session deleteMany - */ -export type SessionDeleteManyArgs = { - /** - * Filter which Sessions to delete - */ - where?: Prisma.SessionWhereInput - /** - * Limit how many Sessions to delete. - */ - limit?: number -} - -/** - * Session without action - */ -export type SessionDefaultArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null -} diff --git a/apps/api/src/generated/prisma/models/User.ts b/apps/api/src/generated/prisma/models/User.ts deleted file mode 100644 index 4dc7d73..0000000 --- a/apps/api/src/generated/prisma/models/User.ts +++ /dev/null @@ -1,1533 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `User` 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 User - * - */ -export type UserModel = runtime.Types.Result.DefaultSelection - -export type AggregateUser = { - _count: UserCountAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null -} - -export type UserMinAggregateOutputType = { - id: string | null - name: string | null - email: string | null - emailVerified: boolean | null - image: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type UserMaxAggregateOutputType = { - id: string | null - name: string | null - email: string | null - emailVerified: boolean | null - image: string | null - createdAt: Date | null - updatedAt: Date | null -} - -export type UserCountAggregateOutputType = { - id: number - name: number - email: number - emailVerified: number - image: number - createdAt: number - updatedAt: number - _all: number -} - - -export type UserMinAggregateInputType = { - id?: true - name?: true - email?: true - emailVerified?: true - image?: true - createdAt?: true - updatedAt?: true -} - -export type UserMaxAggregateInputType = { - id?: true - name?: true - email?: true - emailVerified?: true - image?: true - createdAt?: true - updatedAt?: true -} - -export type UserCountAggregateInputType = { - id?: true - name?: true - email?: true - emailVerified?: true - image?: true - createdAt?: true - updatedAt?: true - _all?: true -} - -export type UserAggregateArgs = { - /** - * Filter which User to aggregate. - */ - where?: Prisma.UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users 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` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Users - **/ - _count?: true | UserCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: UserMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: UserMaxAggregateInputType -} - -export type GetUserAggregateType = { - [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type UserGroupByArgs = { - where?: Prisma.UserWhereInput - orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] - by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum - having?: Prisma.UserScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: UserCountAggregateInputType | true - _min?: UserMinAggregateInputType - _max?: UserMaxAggregateInputType -} - -export type UserGroupByOutputType = { - id: string - name: string - email: string - emailVerified: boolean - image: string | null - createdAt: Date - updatedAt: Date - _count: UserCountAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null -} - -type GetUserGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type UserWhereInput = { - AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] - OR?: Prisma.UserWhereInput[] - NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] - id?: Prisma.StringFilter<"User"> | string - name?: Prisma.StringFilter<"User"> | string - email?: Prisma.StringFilter<"User"> | string - emailVerified?: Prisma.BoolFilter<"User"> | boolean - image?: Prisma.StringNullableFilter<"User"> | string | null - createdAt?: Prisma.DateTimeFilter<"User"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string - sessions?: Prisma.SessionListRelationFilter - accounts?: Prisma.AccountListRelationFilter -} - -export type UserOrderByWithRelationInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - email?: Prisma.SortOrder - emailVerified?: Prisma.SortOrder - image?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - sessions?: Prisma.SessionOrderByRelationAggregateInput - accounts?: Prisma.AccountOrderByRelationAggregateInput -} - -export type UserWhereUniqueInput = Prisma.AtLeast<{ - id?: string - email?: string - AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] - OR?: Prisma.UserWhereInput[] - NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] - name?: Prisma.StringFilter<"User"> | string - emailVerified?: Prisma.BoolFilter<"User"> | boolean - image?: Prisma.StringNullableFilter<"User"> | string | null - createdAt?: Prisma.DateTimeFilter<"User"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string - sessions?: Prisma.SessionListRelationFilter - accounts?: Prisma.AccountListRelationFilter -}, "id" | "email"> - -export type UserOrderByWithAggregationInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - email?: Prisma.SortOrder - emailVerified?: Prisma.SortOrder - image?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.UserCountOrderByAggregateInput - _max?: Prisma.UserMaxOrderByAggregateInput - _min?: Prisma.UserMinOrderByAggregateInput -} - -export type UserScalarWhereWithAggregatesInput = { - AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] - OR?: Prisma.UserScalarWhereWithAggregatesInput[] - NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"User"> | string - name?: Prisma.StringWithAggregatesFilter<"User"> | string - email?: Prisma.StringWithAggregatesFilter<"User"> | string - emailVerified?: Prisma.BoolWithAggregatesFilter<"User"> | boolean - image?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string -} - -export type UserCreateInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - sessions?: Prisma.SessionCreateNestedManyWithoutUserInput - accounts?: Prisma.AccountCreateNestedManyWithoutUserInput -} - -export type UserUncheckedCreateInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - sessions?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput - accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput -} - -export type UserUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - sessions?: Prisma.SessionUpdateManyWithoutUserNestedInput - accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput -} - -export type UserUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - sessions?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput - accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput -} - -export type UserCreateManyInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string -} - -export type UserUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type UserUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type UserCountOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - email?: Prisma.SortOrder - emailVerified?: Prisma.SortOrder - image?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type UserMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - email?: Prisma.SortOrder - emailVerified?: Prisma.SortOrder - image?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type UserMinOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - email?: Prisma.SortOrder - emailVerified?: Prisma.SortOrder - image?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type UserScalarRelationFilter = { - is?: Prisma.UserWhereInput - isNot?: Prisma.UserWhereInput -} - -export type StringFieldUpdateOperationsInput = { - set?: string -} - -export type BoolFieldUpdateOperationsInput = { - set?: boolean -} - -export type NullableStringFieldUpdateOperationsInput = { - set?: string | null -} - -export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string -} - -export type UserCreateNestedOneWithoutSessionsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionsInput - connect?: Prisma.UserWhereUniqueInput -} - -export type UserUpdateOneRequiredWithoutSessionsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionsInput - upsert?: Prisma.UserUpsertWithoutSessionsInput - connect?: Prisma.UserWhereUniqueInput - update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutSessionsInput> -} - -export type UserCreateNestedOneWithoutAccountsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput - connect?: Prisma.UserWhereUniqueInput -} - -export type UserUpdateOneRequiredWithoutAccountsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput - upsert?: Prisma.UserUpsertWithoutAccountsInput - connect?: Prisma.UserWhereUniqueInput - update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutAccountsInput> -} - -export type UserCreateWithoutSessionsInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - accounts?: Prisma.AccountCreateNestedManyWithoutUserInput -} - -export type UserUncheckedCreateWithoutSessionsInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput -} - -export type UserCreateOrConnectWithoutSessionsInput = { - where: Prisma.UserWhereUniqueInput - create: Prisma.XOR -} - -export type UserUpsertWithoutSessionsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.UserWhereInput -} - -export type UserUpdateToOneWithWhereWithoutSessionsInput = { - where?: Prisma.UserWhereInput - data: Prisma.XOR -} - -export type UserUpdateWithoutSessionsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput -} - -export type UserUncheckedUpdateWithoutSessionsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput -} - -export type UserCreateWithoutAccountsInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - sessions?: Prisma.SessionCreateNestedManyWithoutUserInput -} - -export type UserUncheckedCreateWithoutAccountsInput = { - id?: string - name: string - email: string - emailVerified: boolean - image?: string | null - createdAt?: Date | string - updatedAt?: Date | string - sessions?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput -} - -export type UserCreateOrConnectWithoutAccountsInput = { - where: Prisma.UserWhereUniqueInput - create: Prisma.XOR -} - -export type UserUpsertWithoutAccountsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.UserWhereInput -} - -export type UserUpdateToOneWithWhereWithoutAccountsInput = { - where?: Prisma.UserWhereInput - data: Prisma.XOR -} - -export type UserUpdateWithoutAccountsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - sessions?: Prisma.SessionUpdateManyWithoutUserNestedInput -} - -export type UserUncheckedUpdateWithoutAccountsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.StringFieldUpdateOperationsInput | string - emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean - image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - sessions?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput -} - - -/** - * Count Type UserCountOutputType - */ - -export type UserCountOutputType = { - sessions: number - accounts: number -} - -export type UserCountOutputTypeSelect = { - sessions?: boolean | UserCountOutputTypeCountSessionsArgs - accounts?: boolean | UserCountOutputTypeCountAccountsArgs -} - -/** - * UserCountOutputType without action - */ -export type UserCountOutputTypeDefaultArgs = { - /** - * Select specific fields to fetch from the UserCountOutputType - */ - select?: Prisma.UserCountOutputTypeSelect | null -} - -/** - * UserCountOutputType without action - */ -export type UserCountOutputTypeCountSessionsArgs = { - where?: Prisma.SessionWhereInput -} - -/** - * UserCountOutputType without action - */ -export type UserCountOutputTypeCountAccountsArgs = { - where?: Prisma.AccountWhereInput -} - - -export type UserSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - email?: boolean - emailVerified?: boolean - image?: boolean - createdAt?: boolean - updatedAt?: boolean - sessions?: boolean | Prisma.User$sessionsArgs - accounts?: boolean | Prisma.User$accountsArgs - _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs -}, ExtArgs["result"]["user"]> - -export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - email?: boolean - emailVerified?: boolean - image?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["user"]> - -export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - email?: boolean - emailVerified?: boolean - image?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["user"]> - -export type UserSelectScalar = { - id?: boolean - name?: boolean - email?: boolean - emailVerified?: boolean - image?: boolean - createdAt?: boolean - updatedAt?: boolean -} - -export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]> -export type UserInclude = { - sessions?: boolean | Prisma.User$sessionsArgs - accounts?: boolean | Prisma.User$accountsArgs - _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs -} -export type UserIncludeCreateManyAndReturn = {} -export type UserIncludeUpdateManyAndReturn = {} - -export type $UserPayload = { - name: "User" - objects: { - sessions: Prisma.$SessionPayload[] - accounts: Prisma.$AccountPayload[] - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - name: string - email: string - emailVerified: boolean - image: string | null - createdAt: Date - updatedAt: Date - }, ExtArgs["result"]["user"]> - composites: {} -} - -export type UserGetPayload = runtime.Types.Result.GetResult - -export type UserCountArgs = - Omit & { - select?: UserCountAggregateInputType | true - } - -export interface UserDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } - /** - * Find zero or one User that matches the filter. - * @param {UserFindUniqueArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one User that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first User 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Users - * const users = await prisma.user.findMany() - * - * // Get first 10 Users - * const users = await prisma.user.findMany({ take: 10 }) - * - * // Only select the `id` - * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a User. - * @param {UserCreateArgs} args - Arguments to create a User. - * @example - * // Create one User - * const User = await prisma.user.create({ - * data: { - * // ... data to create a User - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Users. - * @param {UserCreateManyArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Users and returns the data saved in the database. - * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Users and only return the `id` - * const userWithIdOnly = await prisma.user.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 User. - * @param {UserDeleteArgs} args - Arguments to delete one User. - * @example - * // Delete one User - * const User = await prisma.user.delete({ - * where: { - * // ... filter to delete one User - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one User. - * @param {UserUpdateArgs} args - Arguments to update one User. - * @example - * // Update one User - * const user = await prisma.user.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Users. - * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. - * @example - * // Delete a few Users - * const { count } = await prisma.user.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Users - * const user = await prisma.user.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Users and returns the data updated in the database. - * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. - * @example - * // Update many Users - * const user = await prisma.user.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Users and only return the `id` - * const userWithIdOnly = await prisma.user.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 User. - * @param {UserUpsertArgs} args - Arguments to update or create a User. - * @example - * // Update or create a User - * const user = await prisma.user.upsert({ - * create: { - * // ... data to create a User - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the User we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserCountArgs} args - Arguments to filter Users to count. - * @example - * // Count the number of Users - * const count = await prisma.user.count({ - * where: { - * // ... the filter for the Users 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 User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserAggregateArgs} 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 User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserGroupByArgs} 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 UserGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['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 ? GetUserGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the User model - */ -readonly fields: UserFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for User. - * 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__UserClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - sessions = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - accounts = {}>(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 User model - */ -export interface UserFieldRefs { - readonly id: Prisma.FieldRef<"User", 'String'> - readonly name: Prisma.FieldRef<"User", 'String'> - readonly email: Prisma.FieldRef<"User", 'String'> - readonly emailVerified: Prisma.FieldRef<"User", 'Boolean'> - readonly image: Prisma.FieldRef<"User", 'String'> - readonly createdAt: Prisma.FieldRef<"User", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"User", 'DateTime'> -} - - -// Custom InputTypes -/** - * User findUnique - */ -export type UserFindUniqueArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter, which User to fetch. - */ - where: Prisma.UserWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User findUniqueOrThrow - */ -export type UserFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter, which User to fetch. - */ - where: Prisma.UserWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User findFirst - */ -export type UserFindFirstArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter, which User to fetch. - */ - where?: Prisma.UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: Prisma.UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users 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` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User findFirstOrThrow - */ -export type UserFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter, which User to fetch. - */ - where?: Prisma.UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: Prisma.UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users 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` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User findMany - */ -export type UserFindManyArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter, which Users to fetch. - */ - where?: Prisma.UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Users. - */ - cursor?: Prisma.UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users 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` Users. - */ - skip?: number - distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User create - */ -export type UserCreateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * The data needed to create a User. - */ - data: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User createMany - */ -export type UserCreateManyArgs = { - /** - * The data used to create many Users. - */ - data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * User createManyAndReturn - */ -export type UserCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelectCreateManyAndReturn | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * The data used to create many Users. - */ - data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * User update - */ -export type UserUpdateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * The data needed to update a User. - */ - data: Prisma.XOR - /** - * Choose, which User to update. - */ - where: Prisma.UserWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User updateMany - */ -export type UserUpdateManyArgs = { - /** - * The data used to update Users. - */ - data: Prisma.XOR - /** - * Filter which Users to update - */ - where?: Prisma.UserWhereInput - /** - * Limit how many Users to update. - */ - limit?: number -} - -/** - * User updateManyAndReturn - */ -export type UserUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * The data used to update Users. - */ - data: Prisma.XOR - /** - * Filter which Users to update - */ - where?: Prisma.UserWhereInput - /** - * Limit how many Users to update. - */ - limit?: number -} - -/** - * User upsert - */ -export type UserUpsertArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * The filter to search for the User to update in case it exists. - */ - where: Prisma.UserWhereUniqueInput - /** - * In case the User found by the `where` argument doesn't exist, create a new User with this data. - */ - create: Prisma.XOR - /** - * In case the User was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User delete - */ -export type UserDeleteArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null - /** - * Filter which User to delete. - */ - where: Prisma.UserWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * User deleteMany - */ -export type UserDeleteManyArgs = { - /** - * Filter which Users to delete - */ - where?: Prisma.UserWhereInput - /** - * Limit how many Users to delete. - */ - limit?: number -} - -/** - * User.sessions - */ -export type User$sessionsArgs = { - /** - * Select specific fields to fetch from the Session - */ - select?: Prisma.SessionSelect | null - /** - * Omit specific fields from the Session - */ - omit?: Prisma.SessionOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.SessionInclude | null - where?: Prisma.SessionWhereInput - orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[] - cursor?: Prisma.SessionWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[] -} - -/** - * User.accounts - */ -export type User$accountsArgs = { - /** - * Select specific fields to fetch from the Account - */ - select?: Prisma.AccountSelect | null - /** - * Omit specific fields from the Account - */ - omit?: Prisma.AccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.AccountInclude | null - where?: Prisma.AccountWhereInput - orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] - cursor?: Prisma.AccountWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] -} - -/** - * User without action - */ -export type UserDefaultArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: Prisma.UserSelect | null - /** - * Omit specific fields from the User - */ - omit?: Prisma.UserOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.UserInclude | null -} diff --git a/apps/api/src/generated/prisma/models/Verification.ts b/apps/api/src/generated/prisma/models/Verification.ts deleted file mode 100644 index 0f3232a..0000000 --- a/apps/api/src/generated/prisma/models/Verification.ts +++ /dev/null @@ -1,1181 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `Verification` 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 Verification - * - */ -export type VerificationModel = runtime.Types.Result.DefaultSelection - -export type AggregateVerification = { - _count: VerificationCountAggregateOutputType | null - _min: VerificationMinAggregateOutputType | null - _max: VerificationMaxAggregateOutputType | null -} - -export type VerificationMinAggregateOutputType = { - id: string | null - identifier: string | null - value: string | null - expiresAt: Date | null - createdAt: Date | null - updatedAt: Date | null -} - -export type VerificationMaxAggregateOutputType = { - id: string | null - identifier: string | null - value: string | null - expiresAt: Date | null - createdAt: Date | null - updatedAt: Date | null -} - -export type VerificationCountAggregateOutputType = { - id: number - identifier: number - value: number - expiresAt: number - createdAt: number - updatedAt: number - _all: number -} - - -export type VerificationMinAggregateInputType = { - id?: true - identifier?: true - value?: true - expiresAt?: true - createdAt?: true - updatedAt?: true -} - -export type VerificationMaxAggregateInputType = { - id?: true - identifier?: true - value?: true - expiresAt?: true - createdAt?: true - updatedAt?: true -} - -export type VerificationCountAggregateInputType = { - id?: true - identifier?: true - value?: true - expiresAt?: true - createdAt?: true - updatedAt?: true - _all?: true -} - -export type VerificationAggregateArgs = { - /** - * Filter which Verification to aggregate. - */ - where?: Prisma.VerificationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Verifications to fetch. - */ - orderBy?: Prisma.VerificationOrderByWithRelationInput | Prisma.VerificationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.VerificationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Verifications 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` Verifications. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Verifications - **/ - _count?: true | VerificationCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: VerificationMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: VerificationMaxAggregateInputType -} - -export type GetVerificationAggregateType = { - [P in keyof T & keyof AggregateVerification]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type VerificationGroupByArgs = { - where?: Prisma.VerificationWhereInput - orderBy?: Prisma.VerificationOrderByWithAggregationInput | Prisma.VerificationOrderByWithAggregationInput[] - by: Prisma.VerificationScalarFieldEnum[] | Prisma.VerificationScalarFieldEnum - having?: Prisma.VerificationScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: VerificationCountAggregateInputType | true - _min?: VerificationMinAggregateInputType - _max?: VerificationMaxAggregateInputType -} - -export type VerificationGroupByOutputType = { - id: string - identifier: string - value: string - expiresAt: Date - createdAt: Date - updatedAt: Date - _count: VerificationCountAggregateOutputType | null - _min: VerificationMinAggregateOutputType | null - _max: VerificationMaxAggregateOutputType | null -} - -type GetVerificationGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof VerificationGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type VerificationWhereInput = { - AND?: Prisma.VerificationWhereInput | Prisma.VerificationWhereInput[] - OR?: Prisma.VerificationWhereInput[] - NOT?: Prisma.VerificationWhereInput | Prisma.VerificationWhereInput[] - id?: Prisma.StringFilter<"Verification"> | string - identifier?: Prisma.StringFilter<"Verification"> | string - value?: Prisma.StringFilter<"Verification"> | string - expiresAt?: Prisma.DateTimeFilter<"Verification"> | Date | string - createdAt?: Prisma.DateTimeFilter<"Verification"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Verification"> | Date | string -} - -export type VerificationOrderByWithRelationInput = { - id?: Prisma.SortOrder - identifier?: Prisma.SortOrder - value?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type VerificationWhereUniqueInput = Prisma.AtLeast<{ - id?: string - AND?: Prisma.VerificationWhereInput | Prisma.VerificationWhereInput[] - OR?: Prisma.VerificationWhereInput[] - NOT?: Prisma.VerificationWhereInput | Prisma.VerificationWhereInput[] - identifier?: Prisma.StringFilter<"Verification"> | string - value?: Prisma.StringFilter<"Verification"> | string - expiresAt?: Prisma.DateTimeFilter<"Verification"> | Date | string - createdAt?: Prisma.DateTimeFilter<"Verification"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Verification"> | Date | string -}, "id"> - -export type VerificationOrderByWithAggregationInput = { - id?: Prisma.SortOrder - identifier?: Prisma.SortOrder - value?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.VerificationCountOrderByAggregateInput - _max?: Prisma.VerificationMaxOrderByAggregateInput - _min?: Prisma.VerificationMinOrderByAggregateInput -} - -export type VerificationScalarWhereWithAggregatesInput = { - AND?: Prisma.VerificationScalarWhereWithAggregatesInput | Prisma.VerificationScalarWhereWithAggregatesInput[] - OR?: Prisma.VerificationScalarWhereWithAggregatesInput[] - NOT?: Prisma.VerificationScalarWhereWithAggregatesInput | Prisma.VerificationScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"Verification"> | string - identifier?: Prisma.StringWithAggregatesFilter<"Verification"> | string - value?: Prisma.StringWithAggregatesFilter<"Verification"> | string - expiresAt?: Prisma.DateTimeWithAggregatesFilter<"Verification"> | Date | string - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Verification"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Verification"> | Date | string -} - -export type VerificationCreateInput = { - id?: string - identifier: string - value: string - expiresAt: Date | string - createdAt?: Date | string - updatedAt?: Date | string -} - -export type VerificationUncheckedCreateInput = { - id?: string - identifier: string - value: string - expiresAt: Date | string - createdAt?: Date | string - updatedAt?: Date | string -} - -export type VerificationUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - identifier?: Prisma.StringFieldUpdateOperationsInput | string - value?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type VerificationUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - identifier?: Prisma.StringFieldUpdateOperationsInput | string - value?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type VerificationCreateManyInput = { - id?: string - identifier: string - value: string - expiresAt: Date | string - createdAt?: Date | string - updatedAt?: Date | string -} - -export type VerificationUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - identifier?: Prisma.StringFieldUpdateOperationsInput | string - value?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type VerificationUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - identifier?: Prisma.StringFieldUpdateOperationsInput | string - value?: Prisma.StringFieldUpdateOperationsInput | string - expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type VerificationCountOrderByAggregateInput = { - id?: Prisma.SortOrder - identifier?: Prisma.SortOrder - value?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type VerificationMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - identifier?: Prisma.SortOrder - value?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type VerificationMinOrderByAggregateInput = { - id?: Prisma.SortOrder - identifier?: Prisma.SortOrder - value?: Prisma.SortOrder - expiresAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - - - -export type VerificationSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - identifier?: boolean - value?: boolean - expiresAt?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["verification"]> - -export type VerificationSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - identifier?: boolean - value?: boolean - expiresAt?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["verification"]> - -export type VerificationSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - identifier?: boolean - value?: boolean - expiresAt?: boolean - createdAt?: boolean - updatedAt?: boolean -}, ExtArgs["result"]["verification"]> - -export type VerificationSelectScalar = { - id?: boolean - identifier?: boolean - value?: boolean - expiresAt?: boolean - createdAt?: boolean - updatedAt?: boolean -} - -export type VerificationOmit = runtime.Types.Extensions.GetOmit<"id" | "identifier" | "value" | "expiresAt" | "createdAt" | "updatedAt", ExtArgs["result"]["verification"]> - -export type $VerificationPayload = { - name: "Verification" - objects: {} - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - identifier: string - value: string - expiresAt: Date - createdAt: Date - updatedAt: Date - }, ExtArgs["result"]["verification"]> - composites: {} -} - -export type VerificationGetPayload = runtime.Types.Result.GetResult - -export type VerificationCountArgs = - Omit & { - select?: VerificationCountAggregateInputType | true - } - -export interface VerificationDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Verification'], meta: { name: 'Verification' } } - /** - * Find zero or one Verification that matches the filter. - * @param {VerificationFindUniqueArgs} args - Arguments to find a Verification - * @example - * // Get one Verification - * const verification = await prisma.verification.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one Verification that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {VerificationFindUniqueOrThrowArgs} args - Arguments to find a Verification - * @example - * // Get one Verification - * const verification = await prisma.verification.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Verification 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 {VerificationFindFirstArgs} args - Arguments to find a Verification - * @example - * // Get one Verification - * const verification = await prisma.verification.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Verification 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 {VerificationFindFirstOrThrowArgs} args - Arguments to find a Verification - * @example - * // Get one Verification - * const verification = await prisma.verification.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Verifications 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 {VerificationFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Verifications - * const verifications = await prisma.verification.findMany() - * - * // Get first 10 Verifications - * const verifications = await prisma.verification.findMany({ take: 10 }) - * - * // Only select the `id` - * const verificationWithIdOnly = await prisma.verification.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a Verification. - * @param {VerificationCreateArgs} args - Arguments to create a Verification. - * @example - * // Create one Verification - * const Verification = await prisma.verification.create({ - * data: { - * // ... data to create a Verification - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Verifications. - * @param {VerificationCreateManyArgs} args - Arguments to create many Verifications. - * @example - * // Create many Verifications - * const verification = await prisma.verification.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Verifications and returns the data saved in the database. - * @param {VerificationCreateManyAndReturnArgs} args - Arguments to create many Verifications. - * @example - * // Create many Verifications - * const verification = await prisma.verification.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Verifications and only return the `id` - * const verificationWithIdOnly = await prisma.verification.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 Verification. - * @param {VerificationDeleteArgs} args - Arguments to delete one Verification. - * @example - * // Delete one Verification - * const Verification = await prisma.verification.delete({ - * where: { - * // ... filter to delete one Verification - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one Verification. - * @param {VerificationUpdateArgs} args - Arguments to update one Verification. - * @example - * // Update one Verification - * const verification = await prisma.verification.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Verifications. - * @param {VerificationDeleteManyArgs} args - Arguments to filter Verifications to delete. - * @example - * // Delete a few Verifications - * const { count } = await prisma.verification.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Verifications. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VerificationUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Verifications - * const verification = await prisma.verification.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Verifications and returns the data updated in the database. - * @param {VerificationUpdateManyAndReturnArgs} args - Arguments to update many Verifications. - * @example - * // Update many Verifications - * const verification = await prisma.verification.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Verifications and only return the `id` - * const verificationWithIdOnly = await prisma.verification.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 Verification. - * @param {VerificationUpsertArgs} args - Arguments to update or create a Verification. - * @example - * // Update or create a Verification - * const verification = await prisma.verification.upsert({ - * create: { - * // ... data to create a Verification - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Verification we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Verifications. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VerificationCountArgs} args - Arguments to filter Verifications to count. - * @example - * // Count the number of Verifications - * const count = await prisma.verification.count({ - * where: { - * // ... the filter for the Verifications 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 Verification. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VerificationAggregateArgs} 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 Verification. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {VerificationGroupByArgs} 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 VerificationGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: VerificationGroupByArgs['orderBy'] } - : { orderBy?: VerificationGroupByArgs['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 ? GetVerificationGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the Verification model - */ -readonly fields: VerificationFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for Verification. - * 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__VerificationClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - /** - * 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 Verification model - */ -export interface VerificationFieldRefs { - readonly id: Prisma.FieldRef<"Verification", 'String'> - readonly identifier: Prisma.FieldRef<"Verification", 'String'> - readonly value: Prisma.FieldRef<"Verification", 'String'> - readonly expiresAt: Prisma.FieldRef<"Verification", 'DateTime'> - readonly createdAt: Prisma.FieldRef<"Verification", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Verification", 'DateTime'> -} - - -// Custom InputTypes -/** - * Verification findUnique - */ -export type VerificationFindUniqueArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter, which Verification to fetch. - */ - where: Prisma.VerificationWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification findUniqueOrThrow - */ -export type VerificationFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter, which Verification to fetch. - */ - where: Prisma.VerificationWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification findFirst - */ -export type VerificationFindFirstArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter, which Verification to fetch. - */ - where?: Prisma.VerificationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Verifications to fetch. - */ - orderBy?: Prisma.VerificationOrderByWithRelationInput | Prisma.VerificationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Verifications. - */ - cursor?: Prisma.VerificationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Verifications 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` Verifications. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Verifications. - */ - distinct?: Prisma.VerificationScalarFieldEnum | Prisma.VerificationScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification findFirstOrThrow - */ -export type VerificationFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter, which Verification to fetch. - */ - where?: Prisma.VerificationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Verifications to fetch. - */ - orderBy?: Prisma.VerificationOrderByWithRelationInput | Prisma.VerificationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Verifications. - */ - cursor?: Prisma.VerificationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Verifications 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` Verifications. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Verifications. - */ - distinct?: Prisma.VerificationScalarFieldEnum | Prisma.VerificationScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification findMany - */ -export type VerificationFindManyArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter, which Verifications to fetch. - */ - where?: Prisma.VerificationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Verifications to fetch. - */ - orderBy?: Prisma.VerificationOrderByWithRelationInput | Prisma.VerificationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Verifications. - */ - cursor?: Prisma.VerificationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Verifications 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` Verifications. - */ - skip?: number - distinct?: Prisma.VerificationScalarFieldEnum | Prisma.VerificationScalarFieldEnum[] - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification create - */ -export type VerificationCreateArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * The data needed to create a Verification. - */ - data: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification createMany - */ -export type VerificationCreateManyArgs = { - /** - * The data used to create many Verifications. - */ - data: Prisma.VerificationCreateManyInput | Prisma.VerificationCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Verification createManyAndReturn - */ -export type VerificationCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelectCreateManyAndReturn | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * The data used to create many Verifications. - */ - data: Prisma.VerificationCreateManyInput | Prisma.VerificationCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Verification update - */ -export type VerificationUpdateArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * The data needed to update a Verification. - */ - data: Prisma.XOR - /** - * Choose, which Verification to update. - */ - where: Prisma.VerificationWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification updateMany - */ -export type VerificationUpdateManyArgs = { - /** - * The data used to update Verifications. - */ - data: Prisma.XOR - /** - * Filter which Verifications to update - */ - where?: Prisma.VerificationWhereInput - /** - * Limit how many Verifications to update. - */ - limit?: number -} - -/** - * Verification updateManyAndReturn - */ -export type VerificationUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * The data used to update Verifications. - */ - data: Prisma.XOR - /** - * Filter which Verifications to update - */ - where?: Prisma.VerificationWhereInput - /** - * Limit how many Verifications to update. - */ - limit?: number -} - -/** - * Verification upsert - */ -export type VerificationUpsertArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * The filter to search for the Verification to update in case it exists. - */ - where: Prisma.VerificationWhereUniqueInput - /** - * In case the Verification found by the `where` argument doesn't exist, create a new Verification with this data. - */ - create: Prisma.XOR - /** - * In case the Verification was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification delete - */ -export type VerificationDeleteArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null - /** - * Filter which Verification to delete. - */ - where: Prisma.VerificationWhereUniqueInput - relationLoadStrategy?: Prisma.RelationLoadStrategy -} - -/** - * Verification deleteMany - */ -export type VerificationDeleteManyArgs = { - /** - * Filter which Verifications to delete - */ - where?: Prisma.VerificationWhereInput - /** - * Limit how many Verifications to delete. - */ - limit?: number -} - -/** - * Verification without action - */ -export type VerificationDefaultArgs = { - /** - * Select specific fields to fetch from the Verification - */ - select?: Prisma.VerificationSelect | null - /** - * Omit specific fields from the Verification - */ - omit?: Prisma.VerificationOmit | null -} diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index e8ae071..c07f419 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -2,16 +2,16 @@ import 'dotenv/config'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; -import { ValidationPipe } from '@nestjs/common'; +import { INestApplication, ValidationPipe } from '@nestjs/common'; import { generateOpenApiSpecs } from './utils/openapi'; import chalk from 'chalk'; import { NestExpressApplication } from '@nestjs/platform-express'; import { AppConfig } from './common/config/app.config'; -import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface'; +import { apiReference } from '@scalar/nestjs-api-reference'; async function bootstrap() { const app = await NestFactory.create(AppModule); - const { cors, port } = app.get(AppConfig); + const { cors, port, isProduction } = app.get(AppConfig); /* -------------------------------------------------------------------------- */ /* Middlewares */ @@ -27,20 +27,10 @@ async function bootstrap() { /* -------------------------------------------------------------------------- */ /* OpenAPI */ /* -------------------------------------------------------------------------- */ - const config = new DocumentBuilder() - .setTitle('Cats example') - .setDescription('The cats API description') - .setVersion('1.0') - .addTag('cats') - .build(); - - const document = SwaggerModule.createDocument(app, config); - SwaggerModule.setup('/openapi', app, document, { - jsonDocumentUrl: 'openapi/json', - yamlDocumentUrl: 'openapi/yaml', - }); - - void generateOpenApiSpecs([{ document }]); + if (!isProduction) { + const document = setupSwagger(app); + void generateOpenApiSpecs([{ document }]); + } /* -------------------------------------------------------------------------- */ /* Server */ @@ -51,3 +41,28 @@ async function bootstrap() { } void bootstrap(); + +function setupSwagger(app: INestApplication) { + const { name } = app.get(AppConfig); + + const config = new DocumentBuilder() + .setTitle(`${name} API`) + .setDescription(`The ${name} API`) + .setVersion('1.0') + .addTag(name) + .build(); + + const document = SwaggerModule.createDocument(app, config); + + app.use( + '/openapi', + apiReference({ + sources: [ + { content: document, title: `${name} API` }, + { url: '/auth/client/open-api/generate-schema', title: 'BetterAuth' }, + ], + }), + ); + + return document; +} diff --git a/apps/api/src/repl.ts b/apps/api/src/repl.ts new file mode 100644 index 0000000..e7666bb --- /dev/null +++ b/apps/api/src/repl.ts @@ -0,0 +1,13 @@ +import { repl } from '@nestjs/core'; +import { AppModule } from './app.module'; + +async function bootstrap() { + const replServer = await repl(AppModule); + replServer.setupHistory('.nestjs_repl_history', (err) => { + if (err) { + console.error(err); + } + }); +} + +bootstrap(); \ No newline at end of file diff --git a/apps/api/src/storage/exceptions/storage.exception.ts b/apps/api/src/storage/exceptions/storage.exception.ts deleted file mode 100644 index bd0c2f8..0000000 --- a/apps/api/src/storage/exceptions/storage.exception.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { HttpException, HttpStatus } from '@nestjs/common'; - -export class StorageException extends HttpException { - constructor(message: string, statusCode: HttpStatus = HttpStatus.INTERNAL_SERVER_ERROR) { - super(message, statusCode); - } -} - -export class FileNotFoundException extends StorageException { - constructor(key: string) { - super(`File not found: ${key}`, HttpStatus.NOT_FOUND); - } -} - -export class StorageOperationException extends StorageException { - constructor(operation: string, cause?: Error) { - super( - `Storage operation failed: ${operation}${cause ? ` - ${cause.message}` : ''}`, - HttpStatus.INTERNAL_SERVER_ERROR, - ); - } -} - diff --git a/apps/api/src/storage/files.service.ts b/apps/api/src/storage/files.service.ts new file mode 100644 index 0000000..565b4f9 --- /dev/null +++ b/apps/api/src/storage/files.service.ts @@ -0,0 +1,66 @@ +import { Injectable, NotFoundException } from '@nestjs/common'; +import { S3Service } from './s3.service'; +import { createId } from '@paralleldrive/cuid2'; +import { DrizzleTransactionClient } from 'src/databases/drizzle.provider'; +import { files } from 'src/databases/drizzle.schema'; +import { takeFirstOrThrow } from 'src/databases/drizzle.utils'; +import { eq } from 'drizzle-orm'; +import { StorageConfig } from 'src/common/config/storage.config'; +import { TransactionHost } from '@nestjs-cls/transactional'; + +@Injectable() +export class FilesService { + constructor( + private readonly s3Service: S3Service, + private readonly txHost: TransactionHost, + private readonly storageConfig: StorageConfig, + ) {} + + async create(file: Express.Multer.File) { + const fileRecord = await this.txHost.tx + .insert(files) + .values({ + name: file.originalname, + mimeType: file.mimetype, + sizeBytes: file.size, + storageKey: createId(), + }) + .returning() + .then(takeFirstOrThrow); + + await this.s3Service.putObject({ + bucketName: this.storageConfig.bucketName, + key: fileRecord.storageKey, + file: file.buffer, + }); + + return fileRecord; + } + + async update(key: string, file: Express.Multer.File) { + const fileRecord = await this.txHost.tx.query.files.findFirst({ + where: { + storageKey: key, + }, + }); + if (!fileRecord) throw new NotFoundException('File not found'); + + // Delete old file record and S3 object + await this.txHost.tx.delete(files).where(eq(files.storageKey, key)); + await this.s3Service.deleteObject({ + bucketName: this.storageConfig.bucketName, + key, + }); + + // Create new file record and upload to S3 + return this.create(file); + } + + async delete(key: string) { + await this.txHost.tx.delete(files).where(eq(files.storageKey, key)); + await this.s3Service.deleteObject({ + bucketName: this.storageConfig.bucketName, + key, + }); + } +} diff --git a/apps/api/src/storage/providers/s3-storage.provider.ts b/apps/api/src/storage/providers/s3-storage.provider.ts deleted file mode 100644 index 883d80a..0000000 --- a/apps/api/src/storage/providers/s3-storage.provider.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { - S3Client, - PutObjectCommand, - GetObjectCommand, - DeleteObjectCommand, - HeadObjectCommand, -} from '@aws-sdk/client-s3'; -import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; -import { Readable } from 'stream'; -import { StorageConfig } from 'src/common/config/storage.config'; - -export interface UploadParams { - key: string; - body: Buffer | Readable; - contentType?: string; - metadata?: Record; -} - -export interface UploadResult { - key: string; - url?: string; - etag?: string; -} - -export interface UrlOptions { - expiresIn?: number; // seconds -} - -@Injectable() -export class S3StorageProvider { - private readonly client: S3Client; - private readonly bucket: string; - - constructor(private readonly storageConfig: StorageConfig) { - this.bucket = 'public'; // Could be configurable - this.client = new S3Client({ - endpoint: this.storageConfig.url, - region: this.storageConfig.region, - credentials: { - accessKeyId: this.storageConfig.accessKey, - secretAccessKey: this.storageConfig.secretKey, - }, - forcePathStyle: true, // Required for LocalStack and S3-compatible services - }); - } - - async upload(params: UploadParams): Promise { - const command = new PutObjectCommand({ - Bucket: this.bucket, - Key: params.key, - Body: params.body, - ContentType: params.contentType, - Metadata: params.metadata, - }); - - const result = await this.client.send(command); - - // Generate URL for the uploaded file - const url = await this.getUrl(params.key); - - return { - key: params.key, - url, - etag: result.ETag, - }; - } - - async download(key: string): Promise { - const command = new GetObjectCommand({ - Bucket: this.bucket, - Key: key, - }); - - const response = await this.client.send(command); - - if (!response.Body) { - throw new Error(`File not found: ${key}`); - } - - // Convert stream to buffer - const chunks: Uint8Array[] = []; - const stream = response.Body as Readable; - - return new Promise((resolve, reject) => { - stream.on('data', (chunk) => chunks.push(chunk)); - stream.on('end', () => resolve(Buffer.concat(chunks))); - stream.on('error', reject); - }); - } - - async delete(key: string): Promise { - const command = new DeleteObjectCommand({ - Bucket: this.bucket, - Key: key, - }); - - await this.client.send(command); - } - - async exists(key: string): Promise { - try { - const command = new HeadObjectCommand({ - Bucket: this.bucket, - Key: key, - }); - - await this.client.send(command); - return true; - } catch (error: any) { - if (error.name === 'NotFound' || error.$metadata?.httpStatusCode === 404) { - return false; - } - throw error; - } - } - - async getUrl(key: string, options?: UrlOptions): Promise { - const command = new GetObjectCommand({ - Bucket: this.bucket, - Key: key, - }); - - // Generate presigned URL if expiration is specified, otherwise public URL - if (options?.expiresIn) { - return getSignedUrl(this.client, command, { - expiresIn: options.expiresIn, - }); - } - - // For public buckets, return direct URL - // Format: http://endpoint/bucket/key - const endpoint = this.storageConfig.url.replace(/\/$/, ''); - return `${endpoint}/${this.bucket}/${key}`; - } - - async stream(key: string): Promise { - const command = new GetObjectCommand({ - Bucket: this.bucket, - Key: key, - }); - - const response = await this.client.send(command); - - if (!response.Body) { - throw new Error(`File not found: ${key}`); - } - - return response.Body as Readable; - } -} - diff --git a/apps/api/src/storage/s3.service.ts b/apps/api/src/storage/s3.service.ts new file mode 100644 index 0000000..bdcd5be --- /dev/null +++ b/apps/api/src/storage/s3.service.ts @@ -0,0 +1,148 @@ +import { + CreateBucketCommand, + DeleteBucketCommand, + DeleteObjectCommand, + GetObjectCommand, + HeadBucketCommand, + ListBucketsCommand, + ListObjectsCommand, + PutBucketPolicyCommand, + PutObjectCommand, + S3Client, + S3ClientConfig, +} from '@aws-sdk/client-s3'; +import { Injectable } from '@nestjs/common'; +import { StorageConfig } from 'src/common/config/storage.config'; + +type PublicBucketPolicy = Awaited< + ReturnType +>; + +export type BucketPolicy = PublicBucketPolicy | undefined; + +@Injectable() +export class S3Service { + private readonly client: S3Client; + + constructor(private readonly storageConfig: StorageConfig) { + const config: S3ClientConfig = { + region: this.storageConfig.region, + credentials: { + accessKeyId: this.storageConfig.accessKey, + secretAccessKey: this.storageConfig.secretKey, + }, + endpoint: this.storageConfig.url, + forcePathStyle: true, + }; + this.client = new S3Client(config); + } + + createBucket(bucketName: string) { + return this.client.send( + new CreateBucketCommand({ + Bucket: bucketName, + }), + ); + } + + setBucketPolicy(bucketName: string, policy: BucketPolicy) { + return this.client.send( + new PutBucketPolicyCommand({ + Bucket: bucketName, + Policy: JSON.stringify(policy), + }), + ); + } + + deleteBucket(bucketName: string) { + return this.client.send( + new DeleteBucketCommand({ + Bucket: bucketName, + }), + ); + } + + listBuckets() { + return this.client.send(new ListBucketsCommand({})); + } + + async bucketExists(bucketName: string) { + return this.client + .send(new HeadBucketCommand({ Bucket: bucketName })) + .then(() => true) + .catch(() => false); + } + + listObjects(bucketName: string) { + return this.client.send( + new ListObjectsCommand({ + Bucket: bucketName, + }), + ); + } + + putObject({ + bucketName, + key, + file, + }: { + bucketName: string; + key: string; + file: Buffer; + }) { + return this.client.send( + new PutObjectCommand({ + Bucket: bucketName, + Key: key, + Body: file, + }), + ); + } + + deleteObject({ bucketName, key }: { bucketName: string; key: string }) { + return this.client.send( + new DeleteObjectCommand({ + Bucket: bucketName, + Key: key, + }), + ); + } + + async getObject({ bucketName, key }: { bucketName: string; key: string }) { + const response = await this.client.send( + new GetObjectCommand({ + Bucket: bucketName, + Key: key, + }), + ); + + // get object content + if (response.Body) { + const chunks: Buffer[] = []; + // AWS SDK v3 Body is a Readable stream in Node.js + const body = response.Body as NodeJS.ReadableStream; + + for await (const chunk of body) { + chunks.push(chunk as Buffer); + } + + return Buffer.concat(chunks).toString('utf-8'); + } + throw new Error('Object not found'); + } + + getPublicBucketPolicy(bucketName: string) { + return { + Version: '2012-10-17', + Statement: [ + { + Sid: 'PublicReadGetObject', + Effect: 'Allow', + Principal: '*', + Action: ['s3:GetObject'], + Resource: [`arn:aws:s3:::${bucketName}/*`], + }, + ], + }; + } +} diff --git a/apps/api/src/storage/services/bucket-config.service.ts b/apps/api/src/storage/services/bucket-config.service.ts deleted file mode 100644 index ed38614..0000000 --- a/apps/api/src/storage/services/bucket-config.service.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Injectable, OnModuleInit, Logger } from '@nestjs/common'; -import { - S3Client, - CreateBucketCommand, - HeadBucketCommand, - PutBucketPolicyCommand, -} from '@aws-sdk/client-s3'; -import { StorageConfig } from 'src/common/config/storage.config'; - -@Injectable() -export class BucketConfigService implements OnModuleInit { - private readonly logger = new Logger(BucketConfigService.name); - private readonly client: S3Client; - private readonly bucket = 'public'; - - constructor(private readonly storageConfig: StorageConfig) { - this.client = new S3Client({ - endpoint: this.storageConfig.url, - region: this.storageConfig.region, - credentials: { - accessKeyId: this.storageConfig.accessKey, - secretAccessKey: this.storageConfig.secretKey, - }, - forcePathStyle: true, - }); - } - - async onModuleInit() { - await this.ensureBucketExists(); - await this.ensureBucketPolicy(); - } - - private async ensureBucketExists() { - try { - // Check if bucket exists - await this.client.send(new HeadBucketCommand({ Bucket: this.bucket })); - this.logger.log(`Bucket "${this.bucket}" already exists`); - } catch (error: any) { - // Bucket doesn't exist, create it - if ( - error.name === 'NotFound' || - error.$metadata?.httpStatusCode === 404 - ) { - try { - await this.client.send( - new CreateBucketCommand({ Bucket: this.bucket }), - ); - this.logger.log(`Created bucket "${this.bucket}"`); - } catch (createError) { - this.logger.error( - `Failed to create bucket "${this.bucket}":`, - createError, - ); - throw createError; - } - } else { - this.logger.error(`Failed to check bucket "${this.bucket}":`, error); - throw error; - } - } - } - - private async ensureBucketPolicy() { - try { - const policy = { - Version: '2012-10-17', - Statement: [ - { - Sid: 'PublicReadGetObject', - Effect: 'Allow', - Principal: '*', - Action: ['s3:GetObject'], - Resource: [`arn:aws:s3:::${this.bucket}/*`], - }, - ], - }; - - await this.client.send( - new PutBucketPolicyCommand({ - Bucket: this.bucket, - Policy: JSON.stringify(policy), - }), - ); - - this.logger.log( - `Bucket policy set for "${this.bucket}" (public read access)`, - ); - } catch (error) { - this.logger.warn( - `Failed to set bucket policy for "${this.bucket}":`, - error, - ); - // Don't throw - policy setting is not critical for basic functionality - } - } -} diff --git a/apps/api/src/storage/services/file-metadata.service.ts b/apps/api/src/storage/services/file-metadata.service.ts deleted file mode 100644 index 2cea21a..0000000 --- a/apps/api/src/storage/services/file-metadata.service.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { createId } from '@paralleldrive/cuid2'; -import { TransactionHost } from '@nestjs-cls/transactional'; -import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; -import { PrismaClient } from 'src/generated/prisma/client'; -import { FileNotFoundException } from '../exceptions/storage.exception'; - -export interface CreateFileMetadataParams { - name: string; - mimeType: string; - sizeBytes: number; - storageKey?: string; // Optional, will be generated if not provided -} - -@Injectable() -export class FileMetadataService { - constructor( - private readonly txHost: TransactionHost< - TransactionalAdapterPrisma - >, - ) {} - - /** - * Generate a storage key from file metadata - */ - generateStorageKey(mimeType: string): string { - const extension = mimeType.split('/')[1] ?? 'bin'; - return `${createId()}.${extension}`; - } - - /** - * Create a file metadata record - */ - async create(params: CreateFileMetadataParams) { - const storageKey = params.storageKey ?? this.generateStorageKey(params.mimeType); - - return this.txHost.tx.file.create({ - data: { - name: params.name, - mimeType: params.mimeType, - sizeBytes: params.sizeBytes, - storageKey, - }, - }); - } - - /** - * Get file metadata by ID - */ - async findById(id: string) { - const file = await this.txHost.tx.file.findUnique({ - where: { id }, - }); - - if (!file) { - throw new FileNotFoundException(id); - } - - return file; - } - - /** - * Get file metadata by storage key - */ - async findByStorageKey(storageKey: string) { - return this.txHost.tx.file.findFirst({ - where: { storageKey }, - }); - } - - /** - * Count references to a storage key - * Used for reference counting before deleting files - */ - async countReferencesByStorageKey(storageKey: string): Promise { - return this.txHost.tx.file.count({ - where: { storageKey }, - }); - } - - /** - * Delete a file metadata record - */ - async delete(id: string) { - return this.txHost.tx.file.delete({ - where: { id }, - }); - } - - /** - * Check if a file should be deleted from storage - * Returns true if the file has no other references - */ - async shouldDeleteFromStorage(storageKey: string): Promise { - const count = await this.countReferencesByStorageKey(storageKey); - return count <= 1; - } -} - diff --git a/apps/api/src/storage/services/file-storage.service.ts b/apps/api/src/storage/services/file-storage.service.ts deleted file mode 100644 index 158203b..0000000 --- a/apps/api/src/storage/services/file-storage.service.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { S3StorageProvider } from '../providers/s3-storage.provider'; -import { FileMetadataService } from './file-metadata.service'; -import { StorageOperationException } from '../exceptions/storage.exception'; - -export interface UploadFileResult { - id: string; - name: string; - mimeType: string; - sizeBytes: number; - storageKey: string; - url?: string; -} - -export interface DeleteFileOptions { - /** - * If true, delete from storage even if other references exist - */ - forceDelete?: boolean; -} - -@Injectable() -export class FileStorageService { - constructor( - private readonly storageProvider: S3StorageProvider, - private readonly fileMetadataService: FileMetadataService, - ) {} - - /** - * Upload a file and create metadata record - */ - async upload(file: Express.Multer.File): Promise { - try { - // Create metadata record first - const metadata = await this.fileMetadataService.create({ - name: file.originalname, - mimeType: file.mimetype, - sizeBytes: file.size, - }); - - // Upload to storage - const uploadResult = await this.storageProvider.upload({ - key: metadata.storageKey, - body: file.buffer, - contentType: file.mimetype, - }); - - return { - id: metadata.id, - name: metadata.name, - mimeType: metadata.mimeType, - sizeBytes: Number(metadata.sizeBytes), - storageKey: metadata.storageKey, - url: uploadResult.url, - }; - } catch (error) { - throw new StorageOperationException('upload', error as Error); - } - } - - /** - * Delete a file and its metadata - * Handles reference counting to avoid deleting files that are still referenced - */ - async delete(id: string, options: DeleteFileOptions = {}): Promise { - try { - // Get file metadata - const file = await this.fileMetadataService.findById(id); - - // Check if we should delete from storage - const shouldDeleteFromStorage = - options.forceDelete || - (await this.fileMetadataService.shouldDeleteFromStorage( - file.storageKey, - )); - - // Delete metadata record - await this.fileMetadataService.delete(id); - - // Delete from storage if needed - if (shouldDeleteFromStorage) { - await this.storageProvider.delete(file.storageKey); - } - } catch (error) { - throw new StorageOperationException('delete', error as Error); - } - } - - /** - * Get file download URL - */ - async getUrl(id: string, expiresIn?: number): Promise { - try { - const file = await this.fileMetadataService.findById(id); - return this.storageProvider.getUrl(file.storageKey, { - expiresIn, - }); - } catch (error) { - throw new StorageOperationException('getUrl', error as Error); - } - } - - /** - * Download a file - */ - async download(id: string): Promise { - try { - const file = await this.fileMetadataService.findById(id); - return this.storageProvider.download(file.storageKey); - } catch (error) { - throw new StorageOperationException('download', error as Error); - } - } - - /** - * Stream a file (useful for large files) - */ - async stream(id: string) { - try { - const file = await this.fileMetadataService.findById(id); - return this.storageProvider.stream(file.storageKey); - } catch (error) { - throw new StorageOperationException('stream', error as Error); - } - } -} diff --git a/apps/api/src/storage/services/image-storage.service.ts b/apps/api/src/storage/services/image-storage.service.ts deleted file mode 100644 index 8651afc..0000000 --- a/apps/api/src/storage/services/image-storage.service.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import sharp from 'sharp'; -import { FileStorageService, UploadFileResult } from './file-storage.service'; - -interface UploadImageOptions { - convertToWebp?: boolean; - quality?: number; - resize?: sharp.ResizeOptions; -} - -@Injectable() -export class ImageStorageService { - constructor(private readonly fileStorageService: FileStorageService) {} - - /** - * Upload and process an image - */ - async upload( - file: Express.Multer.File, - options: UploadImageOptions = {}, - ): Promise { - const { convertToWebp = true, quality = 80, resize } = options; - - // Process image - let image = sharp(file.buffer); - - // Apply resize if specified - if (resize) { - image = image.resize(resize.width, resize.height, { - ...resize, - }); - } - - // Convert to WebP if requested - if (convertToWebp) { - image = image.webp({ quality }); - } - - const buffer = await image.toBuffer(); - - // Create a modified file object for upload - const processedFile: Express.Multer.File = { - ...file, - buffer, - mimetype: convertToWebp ? 'image/webp' : file.mimetype, - size: buffer.byteLength, - }; - - return this.fileStorageService.upload(processedFile); - } - - /** - * Delete an image - * Uses reference counting - won't delete if other references exist - */ - async delete(id: string): Promise { - // Don't force delete - use reference counting - return this.fileStorageService.delete(id, { forceDelete: false }); - } - - /** - * Get image URL - */ - async getUrl(id: string, expiresIn?: number): Promise { - return this.fileStorageService.getUrl(id, expiresIn); - } -} diff --git a/apps/api/src/storage/storage.module.ts b/apps/api/src/storage/storage.module.ts index 7407f74..b82c1d1 100644 --- a/apps/api/src/storage/storage.module.ts +++ b/apps/api/src/storage/storage.module.ts @@ -1,21 +1,9 @@ import { Module } from '@nestjs/common'; -import { FileStorageService } from './services/file-storage.service'; -import { ImageStorageService } from './services/image-storage.service'; -import { FileMetadataService } from './services/file-metadata.service'; -import { BucketConfigService } from './services/bucket-config.service'; -import { S3StorageProvider } from './providers/s3-storage.provider'; +import { S3Service } from './s3.service'; +import { FilesService } from './files.service'; @Module({ - providers: [ - S3StorageProvider, - BucketConfigService, - FileMetadataService, - FileStorageService, - ImageStorageService, - ], - exports: [ - FileStorageService, - ImageStorageService, - ], + providers: [S3Service, FilesService], + exports: [FilesService, S3Service], }) export class StorageModule {} diff --git a/apps/api/src/users/users.service.ts b/apps/api/src/users/users.service.ts index 30d142b..0e08ab0 100644 --- a/apps/api/src/users/users.service.ts +++ b/apps/api/src/users/users.service.ts @@ -1,27 +1,28 @@ import { Injectable } from '@nestjs/common'; import { UpdateUserDto } from './dto/update-user.dto'; -import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; -import { TransactionHost } from '@nestjs-cls/transactional'; -import { PrismaClient } from 'src/generated/prisma/client'; +import { Transactional, TransactionHost } from '@nestjs-cls/transactional'; +import { DrizzleTransactionClient } from 'src/databases/drizzle.provider'; +import { eq } from 'drizzle-orm'; +import { users } from 'src/databases/drizzle.schema'; @Injectable() export class UsersService { constructor( - private readonly txHost: TransactionHost< - TransactionalAdapterPrisma - >, + private readonly txHost: TransactionHost, ) {} - async update(id: string, updateUserDto: UpdateUserDto) { - return this.txHost.tx.user.update({ - where: { id }, - data: { + @Transactional() + update(id: string, updateUserDto: UpdateUserDto) { + return this.txHost.tx + .update(users) + .set({ name: updateUserDto.name, - }, - }); + }) + .where(eq(users.id, id)) + .returning(); } findMany() { - return this.txHost.tx.user.findMany(); + return this.txHost.tx.query.users.findMany(); } } diff --git a/apps/web/.cta.json b/apps/web/.cta.json index 5bc4d69..66693b5 100644 --- a/apps/web/.cta.json +++ b/apps/web/.cta.json @@ -1,20 +1,16 @@ { - "projectName": "web", + "projectName": "start-app", "mode": "file-router", "typescript": true, "tailwind": true, "packageManager": "pnpm", "addOnOptions": {}, - "git": false, + "git": true, "version": 1, "framework": "react-cra", "chosenAddOns": [ + "eslint", "nitro", - "start", - "shadcn", - "mcp", - "tanstack-query", - "compiler", - "form" + "start" ] } \ No newline at end of file diff --git a/apps/web/.cursor/mcp.json b/apps/web/.cursor/mcp.json deleted file mode 100644 index bd98b4f..0000000 --- a/apps/web/.cursor/mcp.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "mcpServers": { - "shadcn": { - "command": "npx", - "args": [ - "shadcn@latest", - "mcp" - ] - } - } -} diff --git a/apps/web/.cursor/rules/tanstack-react-router_api.mdc b/apps/web/.cursor/rules/tanstack-react-router_api.mdc new file mode 100644 index 0000000..f8d484d --- /dev/null +++ b/apps/web/.cursor/rules/tanstack-react-router_api.mdc @@ -0,0 +1,4389 @@ +--- +description: TanStack Router: API +globs: src/**/*.ts,src/**/*.tsx +alwaysApply: false +--- +# ActiveLinkOptions type + +The `ActiveLinkOptions` type extends the [`LinkOptions`](../LinkOptionsType.md) type and contains additional options that can be used to describe how a link should be styled when it is active. + +```tsx +type ActiveLinkOptions = LinkOptions & { + activeProps?: + | React.AnchorHTMLAttributes + | (() => React.AnchorHTMLAttributes) + inactiveProps?: + | React.AnchorHTMLAttributes + | (() => React.AnchorHTMLAttributes) +} +``` + +## ActiveLinkOptions properties + +The `ActiveLinkOptions` object accepts/contains the following properties: + +### `activeProps` + +- `React.AnchorHTMLAttributes` +- Optional +- The props that will be applied to the anchor element when the link is active + +### `inactiveProps` + +- Type: `React.AnchorHTMLAttributes` +- Optional +- The props that will be applied to the anchor element when the link is inactive + +# AsyncRouteComponent type + +The `AsyncRouteComponent` type is used to describe a code-split route component that can be preloaded using a `component.preload()` method. + +```tsx +type AsyncRouteComponent = SyncRouteComponent & { + preload?: () => Promise +} +``` + +# FileRoute class + +> [!CAUTION] +> This class has been deprecated and will be removed in the next major version of TanStack Router. +> Please use the [`createFileRoute`](../createFileRouteFunction.md) function instead. + +The `FileRoute` class is a factory that can be used to create a file-based route instance. This route instance can then be used to automatically generate a route tree with the `tsr generate` and `tsr watch` commands. + +## `FileRoute` constructor + +The `FileRoute` constructor accepts a single argument: the `path` of the file that the route will be generated for. + +### Constructor options + +- Type: `string` literal +- Required, but **automatically inserted and updated by the `tsr generate` and `tsr watch` commands**. +- The full path of the file that the route will be generated from. + +### Constructor returns + +- An instance of the `FileRoute` class that can be used to create a route. + +## `FileRoute` methods + +The `FileRoute` class implements the following method(s): + +### `.createRoute` method + +The `createRoute` method is a method that can be used to configure the file route instance. It accepts a single argument: the `options` that will be used to configure the file route instance. + +#### .createRoute options + +- Type: `Omit` +- [`RouteOptions`](../RouteOptionsType.md) +- Optional +- The same options that are available to the `Route` class, but with the `getParentRoute`, `path`, and `id` options omitted since they are unnecessary for file-based routing. + +#### .createRoute returns + +A [`Route`](../RouteType.md) instance that can be used to configure the route to be inserted into the route-tree. + +> ⚠️ Note: For `tsr generate` and `tsr watch` to work properly, the file route instance must be exported from the file using the `Route` identifier. + +### Examples + +```tsx +import { FileRoute } from '@tanstack/react-router' + +export const Route = new FileRoute('/').createRoute({ + loader: () => { + return 'Hello World' + }, + component: IndexComponent, +}) + +function IndexComponent() { + const data = Route.useLoaderData() + return

+} +``` + +# LinkOptions type + +The `LinkOptions` type extends the [`NavigateOptions`](../NavigateOptionsType.md) type and contains additional options that can be used by TanStack Router when handling actual anchor element attributes. + +```tsx +type LinkOptions = NavigateOptions & { + target?: HTMLAnchorElement['target'] + activeOptions?: ActiveOptions + preload?: false | 'intent' + preloadDelay?: number + disabled?: boolean +} +``` + +## LinkOptions properties + +The `LinkOptions` object accepts/contains the following properties: + +### `target` + +- Type: `HTMLAnchorElement['target']` +- Optional +- The standard anchor tag target attribute + +### `activeOptions` + +- Type: `ActiveOptions` +- Optional +- The options that will be used to determine if the link is active + +### `preload` + +- Type: `false | 'intent' | 'viewport' | 'render'` +- Optional +- If set, the link's preloading strategy will be set to this value. +- See the [Preloading guide](../../../guide/preloading.md) for more information. + +### `preloadDelay` + +- Type: `number` +- Optional +- Delay intent preloading by this many milliseconds. If the intent exits before this delay, the preload will be cancelled. + +### `disabled` + +- Type: `boolean` +- Optional +- If true, will render the link without the href attribute + +# LinkProps type + +The `LinkProps` type extends the [`ActiveLinkOptions`](../ActiveLinkOptionsType.md) and `React.AnchorHTMLAttributes` types and contains additional props specific to the `Link` component. + +```tsx +type LinkProps = ActiveLinkOptions & + Omit, 'children'> & { + children?: + | React.ReactNode + | ((state: { isActive: boolean }) => React.ReactNode) + } +``` + +## LinkProps properties + +- All of the props from [`ActiveLinkOptions`](../ActiveLinkOptionsType.md) +- All of the props from `React.AnchorHTMLAttributes` + +#### `children` + +- Type: `React.ReactNode | ((state: { isActive: boolean }) => React.ReactNode)` +- Optional +- The children that will be rendered inside of the anchor element. If a function is provided, it will be called with an object that contains the `isActive` boolean value that can be used to determine if the link is active. + +# MatchRouteOptions type + +The `MatchRouteOptions` type is used to describe the options that can be used when matching a route. + +```tsx +interface MatchRouteOptions { + pending?: boolean + caseSensitive?: boolean /* @deprecated */ + includeSearch?: boolean + fuzzy?: boolean +} +``` + +## MatchRouteOptions properties + +The `MatchRouteOptions` type has the following properties: + +### `pending` property + +- Type: `boolean` +- Optional +- If `true`, will match against pending location instead of the current location + +### ~~`caseSensitive`~~ property (deprecated) + +- Type: `boolean` +- Optional +- If `true`, will match against the current location with case sensitivity +- Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router + +### `includeSearch` property + +- Type: `boolean` +- Optional +- If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }` + +### `fuzzy` property + +- Type: `boolean` +- Optional +- If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123` + +# NavigateOptions type + +The `NavigateOptions` type is used to describe the options that can be used when describing a navigation action in TanStack Router. + +```tsx +type NavigateOptions = ToOptions & { + replace?: boolean + resetScroll?: boolean + hashScrollIntoView?: boolean | ScrollIntoViewOptions + viewTransition?: boolean | ViewTransitionOptions + ignoreBlocker?: boolean + reloadDocument?: boolean + href?: string +} +``` + +## NavigateOptions properties + +The `NavigateOptions` object accepts the following properties: + +### `replace` + +- Type: `boolean` +- Optional +- Defaults to `false`. +- If `true`, the location will be committed to the browser history using `history.replace` instead of `history.push`. + +### `resetScroll` + +- Type: `boolean` +- Optional +- Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history. +- If `false`, the scroll position will not be reset to 0,0 after the location is committed to history. + +### `hashScrollIntoView` + +- Type: `boolean | ScrollIntoViewOptions` +- Optional +- Defaults to `true` so the element with an id matching the hash will be scrolled into view after the location is committed to history. +- If `false`, the element with an id matching the hash will not be scrolled into view after the location is committed to history. +- If an object is provided, it will be passed to the `scrollIntoView` method as options. +- See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`. + +### `viewTransition` + +- Type: `boolean | ViewTransitionOptions` +- Optional +- Defaults to `false`. +- If `true`, navigation will be called using `document.startViewTransition()`. +- If [`ViewTransitionOptions`](../ViewTransitionOptionsType.md), route navigations will be called using `document.startViewTransition({update, types})` where `types` will determine the strings array passed with `ViewTransitionOptions["types"]`. If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed. +- If the browser does not support this api, this option will be ignored. +- See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works. +- See [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types) for more information on viewTransition types + +### `ignoreBlocker` + +- Type: `boolean` +- Optional +- Defaults to `false`. +- If `true`, navigation will ignore any blockers that might prevent it. + +### `reloadDocument` + +- Type: `boolean` +- Optional +- Defaults to `false`. +- If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation. + +### `href` + +- Type: `string` +- Optional +- This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target. + +- [`ToOptions`](../ToOptionsType.md) + +# NotFoundError + +The `NotFoundError` type is used to represent a not-found error in TanStack Router. + +```tsx +export type NotFoundError = { + global?: boolean + data?: any + throw?: boolean + routeId?: string + headers?: HeadersInit +} +``` + +## NotFoundError properties + +The `NotFoundError` object accepts/contains the following properties: + +### `global` property (⚠️ deprecated, use `routeId: rootRouteId` instead) + +- Type: `boolean` +- Optional - `default: false` +- If true, the not-found error will be handled by the `notFoundComponent` of the root route instead of bubbling up from the route that threw it. This has the same behavior as importing the root route and calling `RootRoute.notFound()`. + +### `data` property + +- Type: `any` +- Optional +- Custom data that is passed into to `notFoundComponent` when the not-found error is handled + +### `throw` property + +- Type: `boolean` +- Optional - `default: false` +- If provided, will throw the not-found object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `notFound({ throw: true })` to throw the not-found object instead of returning it. + +### `route` property + +- Type: `string` +- Optional +- The ID of the route that will attempt to handle the not-found error. If the route does not have a `notFoundComponent`, the error will bubble up to the parent route (and be handled by the root route if necessary). By default, TanStack Router will attempt to handle the not-found error with the route that threw it. + +### `headers` property + +- Type: `HeadersInit` +- Optional +- HTTP headers to be included when the not-found error is handled on the server side. + +# NotFoundRoute class + +> [!CAUTION] +> This class has been deprecated and will be removed in the next major version of TanStack Router. +> Please use the `notFoundComponent` route option that is present during route configuration. +> See the [Not Found Errors guide](../../../guide/not-found-errors.md) for more information. + +The `NotFoundRoute` class extends the `Route` class and can be used to create a not found route instance. A not found route instance can be passed to the `routerOptions.notFoundRoute` option to configure a default not-found/404 route for every branch of the route tree. + +## Constructor options + +The `NotFoundRoute` constructor accepts an object as its only argument. + +- Type: + +```tsx +Omit< + RouteOptions, + | 'path' + | 'id' + | 'getParentRoute' + | 'caseSensitive' + | 'parseParams' + | 'stringifyParams' +> +``` + +- [RouteOptions](../RouteOptionsType.md) +- Required +- The options that will be used to configure the not found route instance. + +## Examples + +```tsx +import { NotFoundRoute, createRouter } from '@tanstack/react-router' +import { Route as rootRoute } from './routes/__root' +import { routeTree } from './routeTree.gen' + +const notFoundRoute = new NotFoundRoute({ + getParentRoute: () => rootRoute, + component: () =>
Not found!!!
, +}) + +const router = createRouter({ + routeTree, + notFoundRoute, +}) + +// ... other code +``` + +# ParsedHistoryState type + +The `ParsedHistoryState` type represents a parsed state object. Additionally to `HistoryState`, it contains the index and the unique key of the route. + +```tsx +export type ParsedHistoryState = HistoryState & { + key?: string // TODO: Remove in v2 - use __TSR_key instead + __TSR_key?: string + __TSR_index: number +} +``` + +# ParsedLocation type + +The `ParsedLocation` type represents a parsed location in TanStack Router. It contains a lot of useful information about the current location, including the pathname, search params, hash, location state, and route masking information. + +```tsx +interface ParsedLocation { + href: string + pathname: string + search: TFullSearchSchema + searchStr: string + state: ParsedHistoryState + hash: string + maskedLocation?: ParsedLocation + unmaskOnReload?: boolean +} +``` + +# Redirect type + +The `Redirect` type is used to represent a redirect action in TanStack Router. + +```tsx +export type Redirect = { + statusCode?: number + throw?: any + headers?: HeadersInit +} & NavigateOptions +``` + +- [`NavigateOptions`](../NavigateOptionsType.md) + +## Redirect properties + +The `Redirect` object accepts/contains the following properties: + +### `statusCode` property + +- Type: `number` +- Optional +- The HTTP status code to use when redirecting + +### `throw` property + +- Type: `any` +- Optional +- If provided, will throw the redirect object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `redirect({ throw: true })` to throw the redirect object instead of returning it. + +### `headers` property + +- Type: `HeadersInit` +- Optional +- The HTTP headers to use when redirecting. + +### Navigation Properties + +Since `Redirect` extends `NavigateOptions`, it also supports navigation properties: + +- **`to`**: Use for internal application routes (e.g., `/dashboard`, `../profile`) +- **`href`**: Use for external URLs (e.g., `https://example.com`, `https://authprovider.com`) + +> **Important**: For external URLs, always use the `href` property instead of `to`. The `to` property is designed for internal navigation within your application. + +# Register type + +This type is used to register a route tree with a router instance. Doing so unlocks the full type safety of TanStack Router, including top-level exports from the `@tanstack/react-router` package. + +```tsx +export type Register = { + // router: [Your router type here] +} +``` + +To register a route tree with a router instance, use declaration merging to add the type of your router instance to the Register interface under the `router` property: + +## Examples + +```tsx +const router = createRouter({ + // ... +}) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} +``` + +# RootRoute class + +> [!CAUTION] +> This class has been deprecated and will be removed in the next major version of TanStack Router. +> Please use the [`createRootRoute`](../createRootRouteFunction.md) function instead. + +The `RootRoute` class extends the `Route` class and can be used to create a root route instance. A root route instance can then be used to create a route tree. + +## `RootRoute` constructor + +The `RootRoute` constructor accepts an object as its only argument. + +### Constructor options + +The options that will be used to configure the root route instance. + +- Type: + +```tsx +Omit< + RouteOptions, + | 'path' + | 'id' + | 'getParentRoute' + | 'caseSensitive' + | 'parseParams' + | 'stringifyParams' +> +``` + +- [`RouteOptions`](../RouteOptionsType.md) +- Optional + +## Constructor returns + +A new [`Route`](../RouteType.md) instance. + +## Examples + +```tsx +import { RootRoute, createRouter, Outlet } from '@tanstack/react-router' + +const rootRoute = new RootRoute({ + component: () => , + // ... root route options +}) + +const routeTree = rootRoute.addChildren([ + // ... other routes +]) + +const router = createRouter({ + routeTree, +}) +``` + +# RouteApi class + +> [!CAUTION] +> This class has been deprecated and will be removed in the next major version of TanStack Router. +> Please use the [`getRouteApi`](../getRouteApiFunction.md) function instead. + +The `RouteApi` class provides type-safe version of common hooks like `useParams`, `useSearch`, `useRouteContext`, `useNavigate`, `useLoaderData`, and `useLoaderDeps` that are pre-bound to a specific route ID and corresponding registered route types. + +## Constructor options + +The `RouteApi` constructor accepts a single argument: the `options` that will be used to configure the `RouteApi` instance. + +### `opts.routeId` option + +- Type: `string` +- Required +- The route ID to which the `RouteApi` instance will be bound + +## Constructor returns + +- An instance of the [`RouteApi`](../RouteApiType.md) that is pre-bound to the route ID that it was called with. + +## Examples + +```tsx +import { RouteApi } from '@tanstack/react-router' + +const routeApi = new RouteApi({ id: '/posts' }) + +export function PostsPage() { + const posts = routeApi.useLoaderData() + // ... +} +``` + +# RouteApi Type + +The `RouteApi` describes an instance that provides type-safe versions of common hooks like `useParams`, `useSearch`, `useRouteContext`, `useNavigate`, `useLoaderData`, and `useLoaderDeps` that are pre-bound to a specific route ID and corresponding registered route types. + +## `RouteApi` properties and methods + +The `RouteApi` has the following properties and methods: + +### `useMatch` method + +```tsx + useMatch(opts?: { + select?: (match: TAllContext) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useMatch`](../useMatchHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: RouteMatch) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useMatch`. This value will also be used to determine if the hook should re-render its parent component using shallow equality checks. + - `opts.structuralSharing` + - Optional + - `boolean` + - Configures whether structural sharing is enabled for the value returned by `select`. + - See the [Render Optimizations guide](../../../guide/render-optimizations.md) for more information. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `RouteMatch` object or a loosened version of the `RouteMatch` object if `opts.strict` is `false`. + +### `useRouteContext` method + +```tsx + useRouteContext(opts?: { + select?: (search: TAllContext) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useRouteContext`](../useRouteContextHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: RouteContext) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useRouteContext`. This value will also be used to determine if the hook should re-render its parent component using shallow equality checks. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `RouteContext` object or a loosened version of the `RouteContext` object if `opts.strict` is `false`. + +### `useSearch` method + +```tsx + useSearch(opts?: { + select?: (search: TFullSearchSchema) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useSearch`](../useSearchHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: TFullSearchSchema) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useSearch`. This value will also be used to determine if the hook should re-render its parent component using shallow equality checks. + - `opts.structuralSharing` + - Optional + - `boolean` + - Configures whether structural sharing is enabled for the value returned by `select`. + - See the [Render Optimizations guide](../../../guide/render-optimizations.md) for more information. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `TFullSearchSchema` object or a loosened version of the `TFullSearchSchema` object if `opts.strict` is `false`. + +### `useParams` method + +```tsx + useParams(opts?: { + select?: (params: TAllParams) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useParams`](../useParamsHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: TAllParams) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useParams`. This value will also be used to determine if the hook should re-render its parent component using shallow equality checks. + - `opts.structuralSharing` + - Optional + - `boolean` + - Configures whether structural sharing is enabled for the value returned by `select`. + - See the [Render Optimizations guide](../../../guide/render-optimizations.md) for more information. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `TAllParams` object or a loosened version of the `TAllParams` object if `opts.strict` is `false`. + +### `useLoaderData` method + +```tsx + useLoaderData(opts?: { + select?: (search: TLoaderData) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useLoaderData`](../useLoaderDataHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: TLoaderData) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useLoaderData`. This value will also be used to determine if the hook should re-render its parent component using shallow equality checks. + - `opts.structuralSharing` + - Optional + - `boolean` + - Configures whether structural sharing is enabled for the value returned by `select`. + - See the [Render Optimizations guide](../../../guide/render-optimizations.md) for more information. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `TLoaderData` object or a loosened version of the `TLoaderData` object if `opts.strict` is `false`. + +### `useLoaderDeps` method + +```tsx + useLoaderDeps(opts?: { + select?: (search: TLoaderDeps) => TSelected + }): TSelected +``` + +- A type-safe version of the [`useLoaderDeps`](../useLoaderDepsHook.md) hook that is pre-bound to the route ID that the `RouteApi` instance was created with. +- Options + - `opts.select` + - Optional + - `(match: TLoaderDeps) => TSelected` + - If supplied, this function will be called with the route match and the return value will be returned from `useLoaderDeps`. + - `opts.structuralSharing` + - Optional + - `boolean` + - Configures whether structural sharing is enabled for the value returned by `select`. + - See the [Render Optimizations guide](../../../guide/render-optimizations.md) for more information. +- Returns + - If a `select` function is provided, the return value of the `select` function. + - If no `select` function is provided, the `TLoaderDeps` object. + +### `useNavigate` method + +```tsx + useNavigate(): // navigate function +``` + +- A type-safe version of [`useNavigate`](../useNavigateHook.md) that is pre-bound to the route ID that the `RouteApi` instance was created with. + +# Route class + +> [!CAUTION] +> This class has been deprecated and will be removed in the next major version of TanStack Router. +> Please use the [`createRoute`](../createRouteFunction.md) function instead. + +The `Route` class implements the `RouteApi` class and can be used to create route instances. A route instance can then be used to create a route tree. + +## `Route` constructor + +The `Route` constructor accepts an object as its only argument. + +### Constructor options + +- Type: [`RouteOptions`](../RouteOptionsType.md) +- Required +- The options that will be used to configure the route instance + +### Constructor returns + +A new [`Route`](../RouteType.md) instance. + +## Examples + +```tsx +import { Route } from '@tanstack/react-router' +import { rootRoute } from './__root' + +const indexRoute = new Route({ + getParentRoute: () => rootRoute, + path: '/', + loader: () => { + return 'Hello World' + }, + component: IndexComponent, +}) + +function IndexComponent() { + const data = indexRoute.useLoaderData() + return
{data}
+} +``` + +# RouteMask type + +The `RouteMask` type extends the [`ToOptions`](../ToOptionsType.md) type and has other the necessary properties to create a route mask. + +## RouteMask properties + +The `RouteMask` type accepts an object with the following properties: + +### `...ToOptions` + +- Type: [`ToOptions`](../ToOptionsType.md) +- Required +- The options that will be used to configure the route mask + +### `options.routeTree` + +- Type: `TRouteTree` +- Required +- The route tree that this route mask will support + +### `options.unmaskOnReload` + +- Type: `boolean` +- Optional +- If `true`, the route mask will be removed when the page is reloaded + +# RouteMatch type + +The `RouteMatch` type represents a route match in TanStack Router. + +```tsx +interface RouteMatch { + id: string + routeId: string + pathname: string + params: Route['allParams'] + status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound' + isFetching: false | 'beforeLoad' | 'loader' + showPending: boolean + error: unknown + paramsError: unknown + searchError: unknown + updatedAt: number + loaderData?: Route['loaderData'] + context: Route['allContext'] + search: Route['fullSearchSchema'] + fetchedAt: number + abortController: AbortController + cause: 'enter' | 'stay' + ssr?: boolean | 'data-only' +} +``` + +# RouteOptions type + +The `RouteOptions` type is used to describe the options that can be used when creating a route. + +## RouteOptions properties + +The `RouteOptions` type accepts an object with the following properties: + +### `getParentRoute` method + +- Type: `() => TParentRoute` +- Required +- A function that returns the parent route of the route being created. This is required to provide full type safety to child route configurations and to ensure that the route tree is built correctly. + +### `path` property + +- Type: `string` +- Required, unless an `id` is provided to configure the route as a pathless layout route +- The path segment that will be used to match the route. + +### `id` property + +- Type: `string` +- Optional, but required if a `path` is not provided +- The unique identifier for the route if it is to be configured as a pathless layout route. If provided, the route will not match against the location pathname and its routes will be flattened into its parent route for matching. + +### `component` property + +- Type: `RouteComponent` or `LazyRouteComponent` +- Optional - Defaults to `` +- The content to be rendered when the route is matched. + +### `errorComponent` property + +- Type: `RouteComponent` or `LazyRouteComponent` +- Optional - Defaults to `routerOptions.defaultErrorComponent` +- The content to be rendered when the route encounters an error. + +### `pendingComponent` property + +- Type: `RouteComponent` or `LazyRouteComponent` +- Optional - Defaults to `routerOptions.defaultPendingComponent` +- The content to be rendered if and when the route is pending and has reached its pendingMs threshold. + +### `notFoundComponent` property + +- Type: `NotFoundRouteComponent` or `LazyRouteComponent` +- Optional - Defaults to `routerOptions.defaultNotFoundComponent` +- The content to be rendered when the route is not found. + +### `validateSearch` method + +- Type: `(rawSearchParams: unknown) => TSearchSchema` +- Optional +- A function that will be called when this route is matched and passed the raw search params from the current location and return valid parsed search params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's search params and the return type will be inferred into the rest of the router. +- Optionally, the parameter type can be tagged with the `SearchSchemaInput` type like this: `(searchParams: TSearchSchemaInput & SearchSchemaInput) => TSearchSchema`. If this tag is present, `TSearchSchemaInput` will be used to type the `search` property of `` and `navigate()` **instead of** `TSearchSchema`. The difference between `TSearchSchemaInput` and `TSearchSchema` can be useful, for example, to express optional search parameters. + +### `search.middlewares` property + +- Type: `(({search: TSearchSchema, next: (newSearch: TSearchSchema) => TSearchSchema}) => TSearchSchema)[]` +- Optional +- Search middlewares are functions that transform the search parameters when generating new links for a route or its descendants. +- A search middleware is passed in the current search (if it is the first middleware to run) or is invoked by the previous middleware calling `next`. + +### `parseParams` method (⚠️ deprecated, use `params.parse` instead) + +- Type: `(rawParams: Record) => TParams` +- Optional +- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's params and the return type will be inferred into the rest of the router. + +### `stringifyParams` method (⚠️ deprecated, use `params.stringify` instead) + +- Type: `(params: TParams) => Record` +- Required if `parseParams` is provided +- A function that will be called when this route's parsed params are being used to build a location. This function should return a valid object of `Record` mapping. + +### `params.parse` method + +- Type: `(rawParams: Record) => TParams` +- Optional +- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's params and the return type will be inferred into the rest of the router. + +### `params.stringify` method + +- Type: `(params: TParams) => Record` +- A function that will be called when this route's parsed params are being used to build a location. This function should return a valid object of `Record` mapping. + +### `beforeLoad` method + +- Type: + +```tsx +type beforeLoad = ( + opts: RouteMatch & { + search: TFullSearchSchema + abortController: AbortController + preload: boolean + params: TAllParams + context: TParentContext + location: ParsedLocation + navigate: NavigateFn // @deprecated + buildLocation: BuildLocationFn + cause: 'enter' | 'stay' + }, +) => Promise | TRouteContext | void +``` + +- Optional +- [`ParsedLocation`](../ParsedLocationType.md) +- This async function is called before a route is loaded. If an error is thrown here, the route's loader will not be called and the route will not render. If thrown during a navigation, the navigation will be canceled and the error will be passed to the `onError` function. If thrown during a preload event, the error will be logged to the console and the preload will fail. +- If this function returns a promise, the route will be put into a pending state and cause rendering to suspend until the promise resolves. If this route's pendingMs threshold is reached, the `pendingComponent` will be shown until it resolves. If the promise rejects, the route will be put into an error state and the error will be thrown during render. +- If this function returns a `TRouteContext` object, that object will be merged into the route's context and be made available in the `loader` and other related route components/methods. +- It's common to use this function to check if a user is authenticated and redirect them to a login page if they are not. To do this, you can either return or throw a `redirect` object from this function. + +> 🚧 `opts.navigate` has been deprecated and will be removed in the next major release. Use `throw redirect({ to: '/somewhere' })` instead. Read more about the `redirect` function [here](../redirectFunction.md). + +### `loader` method + +- Type: + +```tsx +type loader = ( + opts: RouteMatch & { + abortController: AbortController + cause: 'preload' | 'enter' | 'stay' + context: TAllContext + deps: TLoaderDeps + location: ParsedLocation + params: TAllParams + preload: boolean + parentMatchPromise: Promise> + navigate: NavigateFn // @deprecated + route: AnyRoute + }, +) => Promise | TLoaderData | void +``` + +- Optional +- [`ParsedLocation`](../ParsedLocationType.md) +- This async function is called when a route is matched and passed the route's match object. If an error is thrown here, the route will be put into an error state and the error will be thrown during render. If thrown during a navigation, the navigation will be canceled and the error will be passed to the `onError` function. If thrown during a preload event, the error will be logged to the console and the preload will fail. +- If this function returns a promise, the route will be put into a pending state and cause rendering to suspend until the promise resolves. If this route's pendingMs threshold is reached, the `pendingComponent` will be shown until it resolves. If the promise rejects, the route will be put into an error state and the error will be thrown during render. +- If this function returns a `TLoaderData` object, that object will be stored on the route match until the route match is no longer active. It can be accessed using the `useLoaderData` hook in any component that is a child of the route match before another `` is rendered. +- Deps must be returned by your `loaderDeps` function in order to appear. + +> 🚧 `opts.navigate` has been deprecated and will be removed in the next major release. Use `throw redirect({ to: '/somewhere' })` instead. Read more about the `redirect` function [here](../redirectFunction.md). + +### `loaderDeps` method + +- Type: + +```tsx +type loaderDeps = (opts: { search: TFullSearchSchema }) => Record +``` + +- Optional +- A function that will be called before this route is matched to provide additional unique identification to the route match and serve as a dependency tracker for when the match should be reloaded. It should return any serializable value that can uniquely identify the route match from navigation to navigation. +- By default, path params are already used to uniquely identify a route match, so it's unnecessary to return these here. +- If your route match relies on search params for unique identification, it's required that you return them here so they can be made available in the `loader`'s `deps` argument. + +### `staleTime` property + +- Type: `number` +- Optional +- Defaults to `routerOptions.defaultStaleTime`, which defaults to `0` +- The amount of time in milliseconds that a route match's loader data will be considered fresh. If a route match is matched again within this time frame, its loader data will not be reloaded. + +### `preloadStaleTime` property + +- Type: `number` +- Optional +- Defaults to `routerOptions.defaultPreloadStaleTime`, which defaults to `30_000` ms (30 seconds) +- The amount of time in milliseconds that a route match's loader data will be considered fresh when preloading. If a route match is preloaded again within this time frame, its loader data will not be reloaded. If a route match is loaded (for navigation) within this time frame, the normal `staleTime` is used instead. + +### `gcTime` property + +- Type: `number` +- Optional +- Defaults to `routerOptions.defaultGcTime`, which defaults to 30 minutes. +- The amount of time in milliseconds that a route match's loader data will be kept in memory after a preload or it is no longer in use. + +### `shouldReload` property + +- Type: `boolean | ((args: LoaderArgs) => boolean)` +- Optional +- If `false` or returns `false`, the route match's loader data will not be reloaded on subsequent matches. +- If `true` or returns `true`, the route match's loader data will be reloaded on subsequent matches. +- If `undefined` or returns `undefined`, the route match's loader data will adhere to the default stale-while-revalidate behavior. + +### `caseSensitive` property + +- Type: `boolean` +- Optional +- If `true`, this route will be matched as case-sensitive. + +### `wrapInSuspense` property + +- Type: `boolean` +- Optional +- If `true`, this route will be forcefully wrapped in a suspense boundary, regardless if a reason is found to do so from inspecting its provided components. + +### `pendingMs` property + +- Type: `number` +- Optional +- Defaults to `routerOptions.defaultPendingMs`, which defaults to `1000` +- The threshold in milliseconds that a route must be pending before its `pendingComponent` is shown. + +### `pendingMinMs` property + +- Type: `number` +- Optional +- Defaults to `routerOptions.defaultPendingMinMs` which defaults to `500` +- The minimum amount of time in milliseconds that the pending component will be shown for if it is shown. This is useful to prevent the pending component from flashing on the screen for a split second. + +### `preloadMaxAge` property + +- Type: `number` +- Optional +- Defaults to `30_000` ms (30 seconds) +- The maximum amount of time in milliseconds that a route's preloaded route data will be cached for. If a route is not matched within this time frame, its loader data will be discarded. + +### `preSearchFilters` property (⚠️ deprecated, use `search.middlewares` instead) + +- Type: `((search: TFullSearchSchema) => TFullSearchSchema)[]` +- Optional +- An array of functions that will be called when generating any new links to this route or its grandchildren. +- Each function will be called with the current search params and should return a new search params object that will be used to generate the link. +- It has a `pre` prefix because it is called before the user-provided function that is passed to `navigate`/`Link` etc has a chance to modify the search params. + +### `postSearchFilters` property (⚠️ deprecated, use `search.middlewares` instead) + +- Type: `((search: TFullSearchSchema) => TFullSearchSchema)[]` +- Optional +- An array of functions that will be called when generating any new links to this route or its grandchildren. +- Each function will be called with the current search params and should return a new search params object that will be used to generate the link. +- It has a `post` prefix because it is called after the user-provided function that is passed to `navigate`/`Link` etc has modified the search params. + +### `onError` property + +- Type: `(error: any) => void` +- Optional +- A function that will be called when an error is thrown during a navigation or preload event. +- If this function throws a [`redirect`](../redirectFunction.md), then the router will process and apply the redirect immediately. + +### `onEnter` property + +- Type: `(match: RouteMatch) => void` +- Optional +- A function that will be called when a route is matched and loaded after not being matched in the previous location. + +### `onStay` property + +- Type: `(match: RouteMatch) => void` +- Optional +- A function that will be called when a route is matched and loaded after being matched in the previous location. + +### `onLeave` property + +- Type: `(match: RouteMatch) => void` +- Optional +- A function that will be called when a route is no longer matched after being matched in the previous location. + +### `onCatch` property + +- Type: `(error: Error, errorInfo: ErrorInfo) => void` +- Optional - Defaults to `routerOptions.defaultOnCatch` +- A function that will be called when errors are caught when the route encounters an error. + +### `remountDeps` method + +- Type: + +```tsx +type remountDeps = (opts: RemountDepsOptions) => any + +interface RemountDepsOptions< + in out TRouteId, + in out TFullSearchSchema, + in out TAllParams, + in out TLoaderDeps, +> { + routeId: TRouteId + search: TFullSearchSchema + params: TAllParams + loaderDeps: TLoaderDeps +} +``` + +- Optional +- A function that will be called to determine whether a route component shall be remounted after navigation. If this function returns a different value than previously, it will remount. +- The return value needs to be JSON serializable. +- By default, a route component will not be remounted if it stays active after a navigation. + +Example: +If you want to configure to remount a route component upon `params` change, use: + +```tsx +remountDeps: ({ params }) => params +``` + +### `headers` method + +- Type: + +```tsx +type headers = (opts: { + matches: Array + match: RouteMatch + params: TAllParams + loaderData?: TLoaderData +}) => Promise> | Record +``` + +- Optional +- Allows you to specify custom HTTP headers to be sent when this route is rendered during SSR. The function receives the current match context and should return a plain object of header name/value pairs. + +### `head` method + +- Type: + +```tsx +type head = (ctx: { + matches: Array + match: RouteMatch + params: TAllParams + loaderData?: TLoaderData +}) => + | Promise<{ + links?: RouteMatch['links'] + scripts?: RouteMatch['headScripts'] + meta?: RouteMatch['meta'] + styles?: RouteMatch['styles'] + }> + | { + links?: RouteMatch['links'] + scripts?: RouteMatch['headScripts'] + meta?: RouteMatch['meta'] + styles?: RouteMatch['styles'] + } +``` + +- Optional +- Returns additional elements to inject into the document `` for this route. Use it to add route-level SEO metadata, preload links, inline styles, or custom scripts. + +### `scripts` method + +- Type: + +```tsx +type scripts = (ctx: { + matches: Array + match: RouteMatch + params: TAllParams + loaderData?: TLoaderData +}) => Promise | RouteMatch['scripts'] +``` + +- Optional +- A shorthand helper to return only `