diff --git a/client/app/composables/use-auth.ts b/client/app/composables/use-auth.ts index b8590ee..58543f6 100644 --- a/client/app/composables/use-auth.ts +++ b/client/app/composables/use-auth.ts @@ -16,7 +16,7 @@ export const useAuth = createGlobalState(() => { async function login(username: string, password: string): Promise { try { - const result = await chadApi('/login', { + const result = await chadApi('/auth/login', { method: 'POST', body: { username, @@ -33,7 +33,7 @@ export const useAuth = createGlobalState(() => { async function register(username: string, password: string): Promise { try { - const result = await chadApi('/register', { + const result = await chadApi('/auth/register', { method: 'POST', body: { username, @@ -50,7 +50,7 @@ export const useAuth = createGlobalState(() => { async function logout(): Promise { try { - await chadApi('/logout', { method: 'POST' }) + await chadApi('/auth/logout', { method: 'POST' }) setMe(undefined) diff --git a/client/app/composables/use-chat.ts b/client/app/composables/use-chat.ts index a853e39..978d7db 100644 --- a/client/app/composables/use-chat.ts +++ b/client/app/composables/use-chat.ts @@ -1,22 +1,25 @@ +import chadApi from '#shared/chad-api' import { createGlobalState } from '@vueuse/core' export interface ChatClientMessage { text: string - replyTo?: { - messageId: string - } + // replyTo?: { + // messageId: string + // } } export interface ChatMessage { id: string - sender: string + senderId: string text: string createdAt: string - replyTo?: { - messageId: string - sender: string - text: string - } + updatedAt: string + attachments: string[] + // replyTo?: { + // messageId: string + // sender: string + // text: string + // } } export const useChat = createGlobalState(() => { @@ -41,16 +44,16 @@ export const useChat = createGlobalState(() => { }) }, { immediate: true, flush: 'sync' }) - function sendMessage(message: ChatClientMessage) { - if (!signaling.connected.value) - return - + async function sendMessage(message: ChatClientMessage) { message.text = message.text.trim() if (!message.text.length) return - signaling.socket.value!.emit('chat:message', message) + await chadApi('/chat/send', { + method: 'POST', + body: message, + }) } return { diff --git a/client/app/composables/use-preferences.ts b/client/app/composables/use-preferences.ts index f8d7c51..c17c5d4 100644 --- a/client/app/composables/use-preferences.ts +++ b/client/app/composables/use-preferences.ts @@ -42,7 +42,7 @@ export const usePreferences = createGlobalState(() => { async ([toggleInputHotkey, toggleOutputHotkey]) => { try { await chadApi( - '/preferences', + '/user/preferences', { method: 'PATCH', body: { diff --git a/client/app/middleware/01.auth.global.ts b/client/app/middleware/01.auth.global.ts index f612e35..021f9f5 100644 --- a/client/app/middleware/01.auth.global.ts +++ b/client/app/middleware/01.auth.global.ts @@ -5,7 +5,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => { if (!me.value) { try { - setMe(await chadApi('/me', { method: 'GET' })) + setMe(await chadApi('/auth/me', { method: 'GET' })) if (to.meta.auth !== false) return navigateTo({ name: 'Index' }) diff --git a/client/app/middleware/02.user-preferences.global.ts b/client/app/middleware/02.user-preferences.global.ts index b5e0dc3..2d3b0b8 100644 --- a/client/app/middleware/02.user-preferences.global.ts +++ b/client/app/middleware/02.user-preferences.global.ts @@ -13,7 +13,7 @@ export default defineNuxtRouteMiddleware(async () => { return try { - const preferences = await chadApi('/preferences', { method: 'GET' }) + const preferences = await chadApi('/user/preferences', { method: 'GET' }) if (!preferences) return diff --git a/client/app/pages/index.vue b/client/app/pages/index.vue index 1194fdf..8db4c14 100644 --- a/client/app/pages/index.vue +++ b/client/app/pages/index.vue @@ -10,25 +10,35 @@ :key="message.id" class="w-fit max-w-[60%]" :class="{ - 'ml-auto': message.sender === me?.username, + 'ml-auto': message.senderId === me?.userId, }" >

- {{ message.sender }} + {{ message.senderId }}

+

+ +
+

{{ formatDate(message.createdAt) }}

diff --git a/client/app/pages/profile.vue b/client/app/pages/profile.vue index a449a6d..e7f3a59 100644 --- a/client/app/pages/profile.vue +++ b/client/app/pages/profile.vue @@ -52,7 +52,7 @@ async function save() { saving.value = true - const updatedMe = await chadApi('/profile', { + const updatedMe = await chadApi('/user/profile', { method: 'PATCH', body: { displayName: displayName.value, diff --git a/client/src-tauri/tauri.conf.json b/client/src-tauri/tauri.conf.json index 61ef921..c357c0f 100644 --- a/client/src-tauri/tauri.conf.json +++ b/client/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "Chad", - "version": "0.3.0-rc.2", + "version": "0.3.0-rc.3", "identifier": "xyz.koptilnya.chad", "build": { "frontendDist": "../.output/public", diff --git a/server/Api.ts b/server/Api.ts new file mode 100644 index 0000000..bd60361 --- /dev/null +++ b/server/Api.ts @@ -0,0 +1,677 @@ +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseFormat; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} + +export interface HttpResponse + extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; + } + + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } + + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter( + (key) => "undefined" !== typeof query[key], + ); + return keys + .map((key) => + Array.isArray(query[key]) + ? this.addArrayQueryParam(query, key) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + }, + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + protected createAbortSignal = ( + cancelToken: CancelToken, + ): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + + return this.customFetch( + `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), + }, + ).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; + + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title Chad API + * @version 1.0.0 + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + chad = { + /** + * @description Pass file to multipart/form-data + * + * @tags Attachment + * @name AttachmentUpload + * @summary Upload attachment + * @request POST:/chad/attachment/upload + */ + attachmentUpload: (params: RequestParams = {}) => + this.request< + string, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/attachment/upload`, + method: "POST", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Attachment + * @name AttachmentGet + * @summary Get attachment + * @request GET:/chad/attachment/{id} + */ + attachmentGet: (id: string, params: RequestParams = {}) => + this.request< + any, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/attachment/${id}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Auth + * @name AuthRegister + * @summary Register + * @request POST:/chad/auth/register + */ + authRegister: ( + data: { + /** @minLength 1 */ + username: string; + /** @minLength 6 */ + password: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + id: string; + username: string; + displayName: string; + /** @format date-time */ + createdAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/auth/register`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Auth + * @name AuthLogin + * @summary Login + * @request POST:/chad/auth/login + */ + authLogin: ( + data: { + /** @minLength 1 */ + username: string; + /** @minLength 1 */ + password: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + id: string; + username: string; + displayName: string; + /** @format date-time */ + createdAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/auth/login`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Auth + * @name AuthMe + * @summary Me + * @request GET:/chad/auth/me + */ + authMe: (params: RequestParams = {}) => + this.request< + { + id: string; + username: string; + displayName: string; + /** @format date-time */ + createdAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/auth/me`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Auth + * @name AuthLogout + * @summary Logout + * @request POST:/chad/auth/logout + */ + authLogout: (params: RequestParams = {}) => + this.request< + any, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/auth/logout`, + method: "POST", + ...params, + }), + + /** + * No description + * + * @tags Chat + * @name ChatSend + * @summary Send message + * @request POST:/chad/chat/send + */ + chatSend: ( + data: { + /** @minLength 1 */ + text: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + /** @format uuid */ + id: string; + /** @format uuid */ + senderId: string; + /** @minLength 1 */ + text: string; + /** @format date-time */ + createdAt: string; + /** @format date-time */ + updatedAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/chat/send`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags Chat + * @name ChatMessages + * @summary Get messages + * @request GET:/chad/chat + */ + chatMessages: ( + query: { + /** + * Cursor to message + * @format uuid + */ + cursor?: string; + /** + * @min 1 + * @max 100 + * @default 2 + */ + limit: number; + }, + params: RequestParams = {}, + ) => + this.request< + { + messages: { + /** @format uuid */ + id: string; + /** @format uuid */ + senderId: string; + /** @minLength 1 */ + text: string; + /** @format date-time */ + createdAt: string; + /** @format date-time */ + updatedAt: string; + }[]; + /** + * Cursor to last message + * @format uuid + */ + nextCursor?: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/chat`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags User + * @name UserGet + * @summary Get user + * @request GET:/chad/user + */ + userGet: ( + query?: { + username?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + id: string; + username: string; + displayName: string; + /** @format date-time */ + createdAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/user`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags User + * @name UserGetPreferences + * @summary Get preferences + * @request GET:/chad/user/preferences + */ + userGetPreferences: (params: RequestParams = {}) => + this.request< + { + toggleInputHotkey: string; + toggleOutputHotkey: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/user/preferences`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags User + * @name UserUpdatePreferences + * @summary Update preferences + * @request PATCH:/chad/user/preferences + */ + userUpdatePreferences: ( + data: { + toggleInputHotkey?: string; + toggleOutputHotkey?: string; + }, + params: RequestParams = {}, + ) => + this.request< + any, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/user/preferences`, + method: "PATCH", + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags User + * @name UserUpdateProfile + * @summary Update profile + * @request PATCH:/chad/profile + */ + userUpdateProfile: ( + data: { + displayName: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + id: string; + username: string; + displayName: string; + /** @format date-time */ + createdAt: string; + }, + { + statusCode: number; + error: string; + message: string; + } + >({ + path: `/chad/profile`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; +} diff --git a/server/auth/lucia.ts b/server/auth/lucia.ts deleted file mode 100644 index 39626aa..0000000 --- a/server/auth/lucia.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { PrismaAdapter } from '@lucia-auth/adapter-prisma' -import { Lucia } from 'lucia' -import prisma from '../prisma/client.ts' - -declare module 'lucia' { - interface Register { - Lucia: typeof Lucia - UserId: string - DatabaseUserAttributes: DatabaseUserAttributes - } -} - -interface DatabaseUserAttributes { - id: string - displayName: string - username: string -} - -export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), { - sessionCookie: { - attributes: { - sameSite: 'none', - }, - }, - getUserAttributes: ({ id, displayName, username }) => { - return { - id, - displayName, - username, - } - }, -}) - -export type Auth = typeof auth diff --git a/server/nodemon.json b/server/nodemon.json new file mode 100644 index 0000000..739cf7f --- /dev/null +++ b/server/nodemon.json @@ -0,0 +1,6 @@ +{ + "watch": ["."], + "ext": ".ts,.js", + "ignore": ["node_modules", ".idea", "dist"], + "exec": "ts-node --transpile-only server.ts" +} \ No newline at end of file diff --git a/server/package.json b/server/package.json index a71c23c..3664657 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,7 @@ { "name": "server", "scripts": { + "dev": "nodemon", "start": "ts-node --transpile-only server.ts", "db:deploy": "npx prisma migrate deploy && npx prisma generate" }, @@ -11,8 +12,13 @@ "@fastify/cookie": "^11.0.2", "@fastify/cors": "^11.1.0", "@fastify/multipart": "^10.0.0", + "@fastify/sensible": "^6.0.4", + "@fastify/swagger": "^9.7.0", + "@fastify/type-provider-typebox": "^6.1.0", "@lucia-auth/adapter-prisma": "^4.0.1", - "@prisma/client": "^6.17.0", + "@prisma/adapter-better-sqlite3": "^7.7.0", + "@prisma/client": "7", + "@scalar/fastify-api-reference": "^1.52.3", "bcrypt": "^6.0.0", "consola": "^3.4.2", "dotenv": "^17.2.3", @@ -20,8 +26,9 @@ "fastify-plugin": "^5.1.0", "lucia": "^3.2.2", "mediasoup": "^3.19.3", - "prisma": "^6.17.0", + "prisma": "7", "socket.io": "^4.8.1", + "typebox": "^1.1.27", "uuid": "^13.0.0", "ws": "^8.18.3", "zod": "^4.1.12" @@ -29,8 +36,10 @@ "devDependencies": { "@antfu/eslint-config": "^5.4.1", "@types/bcrypt": "^6", + "@types/better-sqlite3": "^7.6.13", "@types/ws": "^8", "eslint": "^9.36.0", + "nodemon": "^3.1.14", "ts-node": "^10.9.2", "typescript": "^5.9.3" }, diff --git a/server/plugins/auth.ts b/server/plugins/auth.ts index 7c5bb75..4dd8d41 100644 --- a/server/plugins/auth.ts +++ b/server/plugins/auth.ts @@ -1,40 +1,76 @@ -import type { Session, User } from 'lucia' +import type { Session } from 'lucia' +import { PrismaAdapter } from '@lucia-auth/adapter-prisma' import fp from 'fastify-plugin' -import { auth } from '../auth/lucia.ts' +import { Lucia } from 'lucia' + +interface DatabaseUserAttributes { + id: string + displayName: string + username: string + createdAt: Date +} + +declare module 'lucia' { + interface Register { + Lucia: Lucia + UserId: string + DatabaseUserAttributes: DatabaseUserAttributes + } +} declare module 'fastify' { + interface FastifyInstance { + lucia: Lucia + } + interface FastifyRequest { - user: User | null + user: DatabaseUserAttributes | null session: Session | null } + + interface FastifyContextConfig { + skipAuth: boolean + } } export default fp(async (fastify) => { + const lucia = new Lucia(new PrismaAdapter(fastify.prisma.session, fastify.prisma.user), { + sessionCookie: { + attributes: { + sameSite: 'none', + }, + }, + getUserAttributes: (attrs) => { + return attrs + }, + }) + + fastify.decorate('lucia', lucia) fastify.decorateRequest('user', null) fastify.decorateRequest('session', null) - fastify.addHook('preHandler', async (req, reply) => { + fastify.addHook('onRequest', async (req, reply) => { try { - const sessionId = auth.readSessionCookie(req.headers.cookie ?? '') + const sessionId = lucia.readSessionCookie(req.headers.cookie ?? '') if (!sessionId) return - const { session, user } = await auth.validateSession(sessionId ?? '') + const { session, user } = await lucia.validateSession(sessionId ?? '') if (session && session.fresh) { - const cookie = auth.createSessionCookie(session.id) + const cookie = lucia.createSessionCookie(session.id) reply.setCookie(cookie.name, cookie.value, cookie.attributes) } if (!session) { - const blank = auth.createBlankSessionCookie() + const blank = lucia.createBlankSessionCookie() reply.setCookie(blank.name, blank.value, blank.attributes) } - req.user = user + req.user = user as DatabaseUserAttributes req.session = session } catch { @@ -42,4 +78,21 @@ export default fp(async (fastify) => { req.session = null } }) + + fastify.addHook('onRequest', (req, reply, done) => { + if (req.is404 || req.routeOptions.schema?.hide || req.routeOptions.config.skipAuth) { + done() + + return + } + + if (!req.user) { + reply.unauthorized() + } + + done() + }) +}, { + name: 'auth', + dependencies: ['prisma'], }) diff --git a/server/plugins/event-bus.ts b/server/plugins/event-bus.ts new file mode 100644 index 0000000..c2d05b8 --- /dev/null +++ b/server/plugins/event-bus.ts @@ -0,0 +1,27 @@ +import type { FastifyPluginAsync } from 'fastify' +import type { Type } from 'typebox' +import type { UserSchema } from '../schemas/auth.ts' +import type { ChatMessageSchema } from '../schemas/chat.ts' +import { EventEmitter } from 'node:events' +import fp from 'fastify-plugin' + +declare module 'fastify' { + interface FastifyInstance { + bus: EventEmitter + } +} + +interface EventMap { + 'chat:new-message': [Type.Static] + 'user:profile-updated': [Type.Static] +} + +const plugin: FastifyPluginAsync = fp(async (fastify) => { + const bus = new EventEmitter() + + fastify.decorate('bus', bus) +}, { + name: 'event-bus', +}) + +export default plugin diff --git a/server/plugins/prisma.ts b/server/plugins/prisma.ts new file mode 100644 index 0000000..03ae09f --- /dev/null +++ b/server/plugins/prisma.ts @@ -0,0 +1,32 @@ +import type { FastifyPluginAsync } from 'fastify' +import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3' +import fp from 'fastify-plugin' +import { PrismaClient } from '../prisma/generated-client/client.ts' + +declare module 'fastify' { + interface FastifyInstance { + prisma: PrismaClient + } +} + +const plugin: FastifyPluginAsync = fp(async (fastify) => { + const prisma = new PrismaClient({ + log: ['query', 'error', 'warn'], + adapter: new PrismaBetterSqlite3({ + url: process.env.DATABASE_URL!, + }), + }) + + await prisma.$connect() + + fastify.log.info('Testing DB Connection. OK') + + fastify.decorate('prisma', prisma) + fastify.addHook('onClose', async (fastify) => { + await fastify.prisma.$disconnect() + }) +}, { + name: 'prisma', +}) + +export default plugin diff --git a/server/plugins/socket.ts b/server/plugins/socket.ts index 74215c5..200b33c 100644 --- a/server/plugins/socket.ts +++ b/server/plugins/socket.ts @@ -1,5 +1,6 @@ import type { FastifyInstance } from 'fastify' import type { ServerOptions } from 'socket.io' +import type { MessageSelect } from '../prisma/generated-client/models/Message.ts' import fp from 'fastify-plugin' import { Server } from 'socket.io' import registerChatSocket from '../socket/chat.ts' @@ -23,9 +24,11 @@ export default fp>( await fastify.io.close() }) - fastify.ready(async () => { - await registerWebrtcSocket(fastify.io, fastify.mediasoupRouter) - await registerChatSocket(fastify.io) + await registerWebrtcSocket(fastify.io, fastify.mediasoupRouter, fastify.prisma) + await registerChatSocket(fastify.io) + + fastify.bus.on('chat:new-message', async (message: MessageSelect) => { + fastify.io.emit('chat:new-message', message) }) }, { name: 'socket-io', dependencies: ['mediasoup-worker', 'mediasoup-router'] }, diff --git a/server/prisma.config.ts b/server/prisma.config.ts new file mode 100644 index 0000000..1996478 --- /dev/null +++ b/server/prisma.config.ts @@ -0,0 +1,13 @@ +import { defineConfig, env } from 'prisma/config' +import 'dotenv/config' + +export default defineConfig({ + schema: './prisma/schema.prisma', + migrations: { + path: './prisma/migrations', + seed: 'ts-node ./prisma/seed.ts', + }, + datasource: { + url: env('DATABASE_URL'), + }, +}) diff --git a/server/prisma/client.ts b/server/prisma/client.ts deleted file mode 100644 index aaf0383..0000000 --- a/server/prisma/client.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PrismaClient } from '@prisma/client' - -const client = new PrismaClient({ - log: ['query', 'error', 'warn'], -}) - -export default client diff --git a/server/prisma/generated-client/browser.ts b/server/prisma/generated-client/browser.ts new file mode 100644 index 0000000..56e11fe --- /dev/null +++ b/server/prisma/generated-client/browser.ts @@ -0,0 +1,54 @@ + +/* !!! 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.ts' +export { Prisma } +export * as $Enums from './enums.ts' +export * from './enums.ts'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Session + * + */ +export type Session = Prisma.SessionModel +/** + * Model UserPreferences + * + */ +export type UserPreferences = Prisma.UserPreferencesModel +/** + * Model Attachment + * + */ +export type Attachment = Prisma.AttachmentModel +/** + * Model Message + * + */ +export type Message = Prisma.MessageModel +/** + * Model MessageAttachment + * + */ +export type MessageAttachment = Prisma.MessageAttachmentModel +/** + * Model Channel + * + */ +export type Channel = Prisma.ChannelModel diff --git a/server/prisma/generated-client/client.ts b/server/prisma/generated-client/client.ts new file mode 100644 index 0000000..c8c79b7 --- /dev/null +++ b/server/prisma/generated-client/client.ts @@ -0,0 +1,78 @@ + +/* !!! 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 { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums.ts" +import * as $Class from "./internal/class.ts" +import * as Prisma from "./internal/prismaNamespace.ts" + +export * as $Enums from './enums.ts' +export * from "./enums.ts" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/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 UserPreferences + * + */ +export type UserPreferences = Prisma.UserPreferencesModel +/** + * Model Attachment + * + */ +export type Attachment = Prisma.AttachmentModel +/** + * Model Message + * + */ +export type Message = Prisma.MessageModel +/** + * Model MessageAttachment + * + */ +export type MessageAttachment = Prisma.MessageAttachmentModel +/** + * Model Channel + * + */ +export type Channel = Prisma.ChannelModel diff --git a/server/prisma/generated-client/commonInputTypes.ts b/server/prisma/generated-client/commonInputTypes.ts new file mode 100644 index 0000000..0a6c9af --- /dev/null +++ b/server/prisma/generated-client/commonInputTypes.ts @@ -0,0 +1,298 @@ + +/* !!! 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.ts" +import type * as Prisma from "./internal/prismaNamespace.ts" + + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + 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 DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + 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 StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + 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 DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + 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 StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | 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 SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | 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 IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + 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 IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +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 NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + 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 NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + 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[] + notIn?: string[] + 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[] + notIn?: number[] + 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 NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + 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 NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | 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 NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | 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[] | null + notIn?: number[] | 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 NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + 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 +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +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> +} + + diff --git a/server/prisma/generated-client/enums.ts b/server/prisma/generated-client/enums.ts new file mode 100644 index 0000000..043572d --- /dev/null +++ b/server/prisma/generated-client/enums.ts @@ -0,0 +1,15 @@ + +/* !!! 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/server/prisma/generated-client/internal/class.ts b/server/prisma/generated-client/internal/class.ts new file mode 100644 index 0000000..741427a --- /dev/null +++ b/server/prisma/generated-client/internal/class.ts @@ -0,0 +1,264 @@ + +/* !!! 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.ts" + + +const config: runtime.GetPrismaClientConfig = { + "previewFeatures": [], + "clientVersion": "7.7.0", + "engineVersion": "75cbdc1eb7150937890ad5465d861175c6624711", + "activeProvider": "sqlite", + "inlineSchema": "datasource db {\n provider = \"sqlite\"\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"./generated-client\"\n}\n\nmodel User {\n id String @id @default(cuid())\n username String @unique\n password String\n displayName String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n Session Session[]\n UserPreferences UserPreferences?\n Messages Message[]\n}\n\nmodel Session {\n id String @id\n userId String\n expiresAt DateTime\n\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n\n @@index([userId])\n}\n\nmodel UserPreferences {\n userId String @id @unique\n toggleInputHotkey String? @default(\"\")\n toggleOutputHotkey String? @default(\"\")\n\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n}\n\nmodel Attachment {\n id String @id @default(uuid())\n name String\n mimetype String\n size Int\n createdAt DateTime @default(now())\n\n message MessageAttachment[]\n}\n\nmodel Message {\n id String @id @default(uuid())\n text String\n senderId String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n sender User? @relation(references: [id], fields: [senderId], onDelete: SetNull)\n attachments MessageAttachment[]\n}\n\nmodel MessageAttachment {\n messageId String\n attachmentId String\n\n message Message @relation(fields: [messageId], references: [id])\n attachment Attachment @relation(fields: [attachmentId], references: [id])\n\n @@id([messageId, attachmentId])\n}\n\nmodel Channel {\n id String @id @default(uuid())\n name String\n persistent Boolean\n}\n", + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "parameterizationSchema": { + "strings": [], + "graph": "" + } +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"displayName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"Session\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"UserPreferences\",\"kind\":\"object\",\"type\":\"UserPreferences\",\"relationName\":\"UserToUserPreferences\"},{\"name\":\"Messages\",\"kind\":\"object\",\"type\":\"Message\",\"relationName\":\"MessageToUser\"}],\"dbName\":null},\"Session\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"SessionToUser\"}],\"dbName\":null},\"UserPreferences\":{\"fields\":[{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"toggleInputHotkey\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"toggleOutputHotkey\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserPreferences\"}],\"dbName\":null},\"Attachment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mimetype\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"size\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"message\",\"kind\":\"object\",\"type\":\"MessageAttachment\",\"relationName\":\"AttachmentToMessageAttachment\"}],\"dbName\":null},\"Message\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"text\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"senderId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sender\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"MessageToUser\"},{\"name\":\"attachments\",\"kind\":\"object\",\"type\":\"MessageAttachment\",\"relationName\":\"MessageToMessageAttachment\"}],\"dbName\":null},\"MessageAttachment\":{\"fields\":[{\"name\":\"messageId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachmentId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"message\",\"kind\":\"object\",\"type\":\"Message\",\"relationName\":\"MessageToMessageAttachment\"},{\"name\":\"attachment\",\"kind\":\"object\",\"type\":\"Attachment\",\"relationName\":\"AttachmentToMessageAttachment\"}],\"dbName\":null},\"Channel\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"persistent\",\"kind\":\"scalar\",\"type\":\"Boolean\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.parameterizationSchema = { + strings: JSON.parse("[\"where\",\"orderBy\",\"cursor\",\"user\",\"Session\",\"UserPreferences\",\"sender\",\"message\",\"_count\",\"attachment\",\"attachments\",\"Messages\",\"User.findUnique\",\"User.findUniqueOrThrow\",\"User.findFirst\",\"User.findFirstOrThrow\",\"User.findMany\",\"data\",\"User.createOne\",\"User.createMany\",\"User.createManyAndReturn\",\"User.updateOne\",\"User.updateMany\",\"User.updateManyAndReturn\",\"create\",\"update\",\"User.upsertOne\",\"User.deleteOne\",\"User.deleteMany\",\"having\",\"_min\",\"_max\",\"User.groupBy\",\"User.aggregate\",\"Session.findUnique\",\"Session.findUniqueOrThrow\",\"Session.findFirst\",\"Session.findFirstOrThrow\",\"Session.findMany\",\"Session.createOne\",\"Session.createMany\",\"Session.createManyAndReturn\",\"Session.updateOne\",\"Session.updateMany\",\"Session.updateManyAndReturn\",\"Session.upsertOne\",\"Session.deleteOne\",\"Session.deleteMany\",\"Session.groupBy\",\"Session.aggregate\",\"UserPreferences.findUnique\",\"UserPreferences.findUniqueOrThrow\",\"UserPreferences.findFirst\",\"UserPreferences.findFirstOrThrow\",\"UserPreferences.findMany\",\"UserPreferences.createOne\",\"UserPreferences.createMany\",\"UserPreferences.createManyAndReturn\",\"UserPreferences.updateOne\",\"UserPreferences.updateMany\",\"UserPreferences.updateManyAndReturn\",\"UserPreferences.upsertOne\",\"UserPreferences.deleteOne\",\"UserPreferences.deleteMany\",\"UserPreferences.groupBy\",\"UserPreferences.aggregate\",\"Attachment.findUnique\",\"Attachment.findUniqueOrThrow\",\"Attachment.findFirst\",\"Attachment.findFirstOrThrow\",\"Attachment.findMany\",\"Attachment.createOne\",\"Attachment.createMany\",\"Attachment.createManyAndReturn\",\"Attachment.updateOne\",\"Attachment.updateMany\",\"Attachment.updateManyAndReturn\",\"Attachment.upsertOne\",\"Attachment.deleteOne\",\"Attachment.deleteMany\",\"_avg\",\"_sum\",\"Attachment.groupBy\",\"Attachment.aggregate\",\"Message.findUnique\",\"Message.findUniqueOrThrow\",\"Message.findFirst\",\"Message.findFirstOrThrow\",\"Message.findMany\",\"Message.createOne\",\"Message.createMany\",\"Message.createManyAndReturn\",\"Message.updateOne\",\"Message.updateMany\",\"Message.updateManyAndReturn\",\"Message.upsertOne\",\"Message.deleteOne\",\"Message.deleteMany\",\"Message.groupBy\",\"Message.aggregate\",\"MessageAttachment.findUnique\",\"MessageAttachment.findUniqueOrThrow\",\"MessageAttachment.findFirst\",\"MessageAttachment.findFirstOrThrow\",\"MessageAttachment.findMany\",\"MessageAttachment.createOne\",\"MessageAttachment.createMany\",\"MessageAttachment.createManyAndReturn\",\"MessageAttachment.updateOne\",\"MessageAttachment.updateMany\",\"MessageAttachment.updateManyAndReturn\",\"MessageAttachment.upsertOne\",\"MessageAttachment.deleteOne\",\"MessageAttachment.deleteMany\",\"MessageAttachment.groupBy\",\"MessageAttachment.aggregate\",\"Channel.findUnique\",\"Channel.findUniqueOrThrow\",\"Channel.findFirst\",\"Channel.findFirstOrThrow\",\"Channel.findMany\",\"Channel.createOne\",\"Channel.createMany\",\"Channel.createManyAndReturn\",\"Channel.updateOne\",\"Channel.updateMany\",\"Channel.updateManyAndReturn\",\"Channel.upsertOne\",\"Channel.deleteOne\",\"Channel.deleteMany\",\"Channel.groupBy\",\"Channel.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"name\",\"persistent\",\"equals\",\"not\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"contains\",\"startsWith\",\"endsWith\",\"messageId\",\"attachmentId\",\"text\",\"senderId\",\"createdAt\",\"updatedAt\",\"mimetype\",\"size\",\"every\",\"some\",\"none\",\"userId\",\"toggleInputHotkey\",\"toggleOutputHotkey\",\"expiresAt\",\"username\",\"password\",\"displayName\",\"messageId_attachmentId\",\"is\",\"isNot\",\"connectOrCreate\",\"upsert\",\"createMany\",\"set\",\"disconnect\",\"delete\",\"connect\",\"updateMany\",\"deleteMany\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), + graph: "7wI-cAwEAADjAQAgBQAA5AEAIAsAAOUBACCEAQAA4gEAMIUBAAANABCGAQAA4gEAMIcBAQAAAAGZAUAA1gEAIZoBQADWAQAhpAEBAAAAAaUBAQDFAQAhpgEBAMUBACEBAAAAAQAgBwMAANsBACCEAQAA6AEAMIUBAAADABCGAQAA6AEAMIcBAQDFAQAhoAEBAMUBACGjAUAA1gEAIQEDAACiAgAgBwMAANsBACCEAQAA6AEAMIUBAAADABCGAQAA6AEAMIcBAQAAAAGgAQEAxQEAIaMBQADWAQAhAwAAAAMAIAEAAAQAMAIAAAUAIAcDAADbAQAghAEAANkBADCFAQAABwAQhgEAANkBADCgAQEAxQEAIaEBAQDaAQAhogEBANoBACEBAAAABwAgCgYAAOcBACAKAADXAQAghAEAAOYBADCFAQAACQAQhgEAAOYBADCHAQEAxQEAIZcBAQDFAQAhmAEBANoBACGZAUAA1gEAIZoBQADWAQAhAwYAAKICACAKAACcAgAgmAEAAPUBACAKBgAA5wEAIAoAANcBACCEAQAA5gEAMIUBAAAJABCGAQAA5gEAMIcBAQAAAAGXAQEAxQEAIZgBAQDaAQAhmQFAANYBACGaAUAA1gEAIQMAAAAJACABAAAKADACAAALACAMBAAA4wEAIAUAAOQBACALAADlAQAghAEAAOIBADCFAQAADQAQhgEAAOIBADCHAQEAxQEAIZkBQADWAQAhmgFAANYBACGkAQEAxQEAIaUBAQDFAQAhpgEBAMUBACEBAAAADQAgBwcAAOABACAJAADhAQAghAEAAN8BADCFAQAADwAQhgEAAN8BADCVAQEAxQEAIZYBAQDFAQAhAgcAANECACAJAADSAgAgCAcAAOABACAJAADhAQAghAEAAN8BADCFAQAADwAQhgEAAN8BADCVAQEAxQEAIZYBAQDFAQAhpwEAAN4BACADAAAADwAgAQAAEAAwAgAAEQAgAwAAAA8AIAEAABAAMAIAABEAIAEAAAAPACABAAAADwAgAQAAAAMAIAEAAAAJACABAAAAAQAgAwQAAM4CACAFAADPAgAgCwAA0AIAIAMAAAANACABAAAZADACAAABACADAAAADQAgAQAAGQAwAgAAAQAgAwAAAA0AIAEAABkAMAIAAAEAIAkEAADLAgAgBQAAzAIAIAsAAM0CACCHAQEAAAABmQFAAAAAAZoBQAAAAAGkAQEAAAABpQEBAAAAAaYBAQAAAAEBEQAAHQAgBocBAQAAAAGZAUAAAAABmgFAAAAAAaQBAQAAAAGlAQEAAAABpgEBAAAAAQERAAAfADABEQAAHwAwCQQAAKsCACAFAACsAgAgCwAArQIAIIcBAQDsAQAhmQFAAPkBACGaAUAA-QEAIaQBAQDsAQAhpQEBAOwBACGmAQEA7AEAIQIAAAABACARAAAiACAGhwEBAOwBACGZAUAA-QEAIZoBQAD5AQAhpAEBAOwBACGlAQEA7AEAIaYBAQDsAQAhAgAAAA0AIBEAACQAIAIAAAANACARAAAkACADAAAAAQAgGAAAHQAgGQAAIgAgAQAAAAEAIAEAAAANACADCAAAqAIAIB4AAKoCACAfAACpAgAgCYQBAADdAQAwhQEAACsAEIYBAADdAQAwhwEBAL0BACGZAUAAygEAIZoBQADKAQAhpAEBAL0BACGlAQEAvQEAIaYBAQC9AQAhAwAAAA0AIAEAACoAMB0AACsAIAMAAAANACABAAAZADACAAABACABAAAABQAgAQAAAAUAIAMAAAADACABAAAEADACAAAFACADAAAAAwAgAQAABAAwAgAABQAgAwAAAAMAIAEAAAQAMAIAAAUAIAQDAACnAgAghwEBAAAAAaABAQAAAAGjAUAAAAABAREAADMAIAOHAQEAAAABoAEBAAAAAaMBQAAAAAEBEQAANQAwAREAADUAMAQDAACmAgAghwEBAOwBACGgAQEA7AEAIaMBQAD5AQAhAgAAAAUAIBEAADgAIAOHAQEA7AEAIaABAQDsAQAhowFAAPkBACECAAAAAwAgEQAAOgAgAgAAAAMAIBEAADoAIAMAAAAFACAYAAAzACAZAAA4ACABAAAABQAgAQAAAAMAIAMIAACjAgAgHgAApQIAIB8AAKQCACAGhAEAANwBADCFAQAAQQAQhgEAANwBADCHAQEAvQEAIaABAQC9AQAhowFAAMoBACEDAAAAAwAgAQAAQAAwHQAAQQAgAwAAAAMAIAEAAAQAMAIAAAUAIAcDAADbAQAghAEAANkBADCFAQAABwAQhgEAANkBADCgAQEAAAABoQEBANoBACGiAQEA2gEAIQEAAABEACABAAAARAAgAwMAAKICACChAQAA9QEAIKIBAAD1AQAgAwAAAAcAIAEAAEcAMAIAAEQAIAMAAAAHACABAABHADACAABEACADAAAABwAgAQAARwAwAgAARAAgBAMAAKECACCgAQEAAAABoQEBAAAAAaIBAQAAAAEBEQAASwAgA6ABAQAAAAGhAQEAAAABogEBAAAAAQERAABNADABEQAATQAwBAMAAKACACCgAQEA7AEAIaEBAQD6AQAhogEBAPoBACECAAAARAAgEQAAUAAgA6ABAQDsAQAhoQEBAPoBACGiAQEA-gEAIQIAAAAHACARAABSACACAAAABwAgEQAAUgAgAwAAAEQAIBgAAEsAIBkAAFAAIAEAAABEACABAAAABwAgBQgAAJ0CACAeAACfAgAgHwAAngIAIKEBAAD1AQAgogEAAPUBACAGhAEAANgBADCFAQAAWQAQhgEAANgBADCgAQEAvQEAIaEBAQDJAQAhogEBAMkBACEDAAAABwAgAQAAWAAwHQAAWQAgAwAAAAcAIAEAAEcAMAIAAEQAIAkHAADXAQAghAEAANQBADCFAQAAXwAQhgEAANQBADCHAQEAAAABiAEBAMUBACGZAUAA1gEAIZsBAQDFAQAhnAECANUBACEBAAAAXAAgAQAAAFwAIAkHAADXAQAghAEAANQBADCFAQAAXwAQhgEAANQBADCHAQEAxQEAIYgBAQDFAQAhmQFAANYBACGbAQEAxQEAIZwBAgDVAQAhAQcAAJwCACADAAAAXwAgAQAAYAAwAgAAXAAgAwAAAF8AIAEAAGAAMAIAAFwAIAMAAABfACABAABgADACAABcACAGBwAAmwIAIIcBAQAAAAGIAQEAAAABmQFAAAAAAZsBAQAAAAGcAQIAAAABAREAAGQAIAWHAQEAAAABiAEBAAAAAZkBQAAAAAGbAQEAAAABnAECAAAAAQERAABmADABEQAAZgAwBgcAAJECACCHAQEA7AEAIYgBAQDsAQAhmQFAAPkBACGbAQEA7AEAIZwBAgCQAgAhAgAAAFwAIBEAAGkAIAWHAQEA7AEAIYgBAQDsAQAhmQFAAPkBACGbAQEA7AEAIZwBAgCQAgAhAgAAAF8AIBEAAGsAIAIAAABfACARAABrACADAAAAXAAgGAAAZAAgGQAAaQAgAQAAAFwAIAEAAABfACAFCAAAiwIAIB4AAI4CACAfAACNAgAgUAAAjAIAIFEAAI8CACAIhAEAANABADCFAQAAcgAQhgEAANABADCHAQEAvQEAIYgBAQC9AQAhmQFAAMoBACGbAQEAvQEAIZwBAgDRAQAhAwAAAF8AIAEAAHEAMB0AAHIAIAMAAABfACABAABgADACAABcACABAAAACwAgAQAAAAsAIAMAAAAJACABAAAKADACAAALACADAAAACQAgAQAACgAwAgAACwAgAwAAAAkAIAEAAAoAMAIAAAsAIAcGAACJAgAgCgAAigIAIIcBAQAAAAGXAQEAAAABmAEBAAAAAZkBQAAAAAGaAUAAAAABAREAAHoAIAWHAQEAAAABlwEBAAAAAZgBAQAAAAGZAUAAAAABmgFAAAAAAQERAAB8ADABEQAAfAAwAQAAAA0AIAcGAAD7AQAgCgAA_AEAIIcBAQDsAQAhlwEBAOwBACGYAQEA-gEAIZkBQAD5AQAhmgFAAPkBACECAAAACwAgEQAAgAEAIAWHAQEA7AEAIZcBAQDsAQAhmAEBAPoBACGZAUAA-QEAIZoBQAD5AQAhAgAAAAkAIBEAAIIBACACAAAACQAgEQAAggEAIAEAAAANACADAAAACwAgGAAAegAgGQAAgAEAIAEAAAALACABAAAACQAgBAgAAPYBACAeAAD4AQAgHwAA9wEAIJgBAAD1AQAgCIQBAADIAQAwhQEAAIoBABCGAQAAyAEAMIcBAQC9AQAhlwEBAL0BACGYAQEAyQEAIZkBQADKAQAhmgFAAMoBACEDAAAACQAgAQAAiQEAMB0AAIoBACADAAAACQAgAQAACgAwAgAACwAgAQAAABEAIAEAAAARACADAAAADwAgAQAAEAAwAgAAEQAgAwAAAA8AIAEAABAAMAIAABEAIAMAAAAPACABAAAQADACAAARACAEBwAA8wEAIAkAAPQBACCVAQEAAAABlgEBAAAAAQERAACSAQAgApUBAQAAAAGWAQEAAAABAREAAJQBADABEQAAlAEAMAQHAADxAQAgCQAA8gEAIJUBAQDsAQAhlgEBAOwBACECAAAAEQAgEQAAlwEAIAKVAQEA7AEAIZYBAQDsAQAhAgAAAA8AIBEAAJkBACACAAAADwAgEQAAmQEAIAMAAAARACAYAACSAQAgGQAAlwEAIAEAAAARACABAAAADwAgAwgAAO4BACAeAADwAQAgHwAA7wEAIAWEAQAAxwEAMIUBAACgAQAQhgEAAMcBADCVAQEAvQEAIZYBAQC9AQAhAwAAAA8AIAEAAJ8BADAdAACgAQAgAwAAAA8AIAEAABAAMAIAABEAIAaEAQAAxAEAMIUBAACmAQAQhgEAAMQBADCHAQEAAAABiAEBAMUBACGJASAAxgEAIQEAAACjAQAgAQAAAKMBACAGhAEAAMQBADCFAQAApgEAEIYBAADEAQAwhwEBAMUBACGIAQEAxQEAIYkBIADGAQAhAAMAAACmAQAgAQAApwEAMAIAAKMBACADAAAApgEAIAEAAKcBADACAACjAQAgAwAAAKYBACABAACnAQAwAgAAowEAIAOHAQEAAAABiAEBAAAAAYkBIAAAAAEBEQAAqwEAIAOHAQEAAAABiAEBAAAAAYkBIAAAAAEBEQAArQEAMAERAACtAQAwA4cBAQDsAQAhiAEBAOwBACGJASAA7QEAIQIAAACjAQAgEQAAsAEAIAOHAQEA7AEAIYgBAQDsAQAhiQEgAO0BACECAAAApgEAIBEAALIBACACAAAApgEAIBEAALIBACADAAAAowEAIBgAAKsBACAZAACwAQAgAQAAAKMBACABAAAApgEAIAMIAADpAQAgHgAA6wEAIB8AAOoBACAGhAEAALwBADCFAQAAuQEAEIYBAAC8AQAwhwEBAL0BACGIAQEAvQEAIYkBIAC-AQAhAwAAAKYBACABAAC4AQAwHQAAuQEAIAMAAACmAQAgAQAApwEAMAIAAKMBACAGhAEAALwBADCFAQAAuQEAEIYBAAC8AQAwhwEBAL0BACGIAQEAvQEAIYkBIAC-AQAhDggAAMABACAeAADDAQAgHwAAwwEAIIoBAQAAAAGLAQEAwgEAIYwBAQAAAASNAQEAAAAEjgEBAAAAAY8BAQAAAAGQAQEAAAABkQEBAAAAAZIBAQAAAAGTAQEAAAABlAEBAAAAAQUIAADAAQAgHgAAwQEAIB8AAMEBACCKASAAAAABiwEgAL8BACEFCAAAwAEAIB4AAMEBACAfAADBAQAgigEgAAAAAYsBIAC_AQAhCIoBAgAAAAGLAQIAwAEAIYwBAgAAAASNAQIAAAAEjgECAAAAAY8BAgAAAAGQAQIAAAABkQECAAAAAQKKASAAAAABiwEgAMEBACEOCAAAwAEAIB4AAMMBACAfAADDAQAgigEBAAAAAYsBAQDCAQAhjAEBAAAABI0BAQAAAASOAQEAAAABjwEBAAAAAZABAQAAAAGRAQEAAAABkgEBAAAAAZMBAQAAAAGUAQEAAAABC4oBAQAAAAGLAQEAwwEAIYwBAQAAAASNAQEAAAAEjgEBAAAAAY8BAQAAAAGQAQEAAAABkQEBAAAAAZIBAQAAAAGTAQEAAAABlAEBAAAAAQaEAQAAxAEAMIUBAACmAQAQhgEAAMQBADCHAQEAxQEAIYgBAQDFAQAhiQEgAMYBACELigEBAAAAAYsBAQDDAQAhjAEBAAAABI0BAQAAAASOAQEAAAABjwEBAAAAAZABAQAAAAGRAQEAAAABkgEBAAAAAZMBAQAAAAGUAQEAAAABAooBIAAAAAGLASAAwQEAIQWEAQAAxwEAMIUBAACgAQAQhgEAAMcBADCVAQEAvQEAIZYBAQC9AQAhCIQBAADIAQAwhQEAAIoBABCGAQAAyAEAMIcBAQC9AQAhlwEBAL0BACGYAQEAyQEAIZkBQADKAQAhmgFAAMoBACEOCAAAzgEAIB4AAM8BACAfAADPAQAgigEBAAAAAYsBAQDNAQAhjAEBAAAABY0BAQAAAAWOAQEAAAABjwEBAAAAAZABAQAAAAGRAQEAAAABkgEBAAAAAZMBAQAAAAGUAQEAAAABCwgAAMABACAeAADMAQAgHwAAzAEAIIoBQAAAAAGLAUAAywEAIYwBQAAAAASNAUAAAAAEjgFAAAAAAY8BQAAAAAGQAUAAAAABkQFAAAAAAQsIAADAAQAgHgAAzAEAIB8AAMwBACCKAUAAAAABiwFAAMsBACGMAUAAAAAEjQFAAAAABI4BQAAAAAGPAUAAAAABkAFAAAAAAZEBQAAAAAEIigFAAAAAAYsBQADMAQAhjAFAAAAABI0BQAAAAASOAUAAAAABjwFAAAAAAZABQAAAAAGRAUAAAAABDggAAM4BACAeAADPAQAgHwAAzwEAIIoBAQAAAAGLAQEAzQEAIYwBAQAAAAWNAQEAAAAFjgEBAAAAAY8BAQAAAAGQAQEAAAABkQEBAAAAAZIBAQAAAAGTAQEAAAABlAEBAAAAAQiKAQIAAAABiwECAM4BACGMAQIAAAAFjQECAAAABY4BAgAAAAGPAQIAAAABkAECAAAAAZEBAgAAAAELigEBAAAAAYsBAQDPAQAhjAEBAAAABY0BAQAAAAWOAQEAAAABjwEBAAAAAZABAQAAAAGRAQEAAAABkgEBAAAAAZMBAQAAAAGUAQEAAAABCIQBAADQAQAwhQEAAHIAEIYBAADQAQAwhwEBAL0BACGIAQEAvQEAIZkBQADKAQAhmwEBAL0BACGcAQIA0QEAIQ0IAADAAQAgHgAAwAEAIB8AAMABACBQAADTAQAgUQAAwAEAIIoBAgAAAAGLAQIA0gEAIYwBAgAAAASNAQIAAAAEjgECAAAAAY8BAgAAAAGQAQIAAAABkQECAAAAAQ0IAADAAQAgHgAAwAEAIB8AAMABACBQAADTAQAgUQAAwAEAIIoBAgAAAAGLAQIA0gEAIYwBAgAAAASNAQIAAAAEjgECAAAAAY8BAgAAAAGQAQIAAAABkQECAAAAAQiKAQgAAAABiwEIANMBACGMAQgAAAAEjQEIAAAABI4BCAAAAAGPAQgAAAABkAEIAAAAAZEBCAAAAAEJBwAA1wEAIIQBAADUAQAwhQEAAF8AEIYBAADUAQAwhwEBAMUBACGIAQEAxQEAIZkBQADWAQAhmwEBAMUBACGcAQIA1QEAIQiKAQIAAAABiwECAMABACGMAQIAAAAEjQECAAAABI4BAgAAAAGPAQIAAAABkAECAAAAAZEBAgAAAAEIigFAAAAAAYsBQADMAQAhjAFAAAAABI0BQAAAAASOAUAAAAABjwFAAAAAAZABQAAAAAGRAUAAAAABA50BAAAPACCeAQAADwAgnwEAAA8AIAaEAQAA2AEAMIUBAABZABCGAQAA2AEAMKABAQC9AQAhoQEBAMkBACGiAQEAyQEAIQcDAADbAQAghAEAANkBADCFAQAABwAQhgEAANkBADCgAQEAxQEAIaEBAQDaAQAhogEBANoBACELigEBAAAAAYsBAQDPAQAhjAEBAAAABY0BAQAAAAWOAQEAAAABjwEBAAAAAZABAQAAAAGRAQEAAAABkgEBAAAAAZMBAQAAAAGUAQEAAAABDgQAAOMBACAFAADkAQAgCwAA5QEAIIQBAADiAQAwhQEAAA0AEIYBAADiAQAwhwEBAMUBACGZAUAA1gEAIZoBQADWAQAhpAEBAMUBACGlAQEAxQEAIaYBAQDFAQAhqAEAAA0AIKkBAAANACAGhAEAANwBADCFAQAAQQAQhgEAANwBADCHAQEAvQEAIaABAQC9AQAhowFAAMoBACEJhAEAAN0BADCFAQAAKwAQhgEAAN0BADCHAQEAvQEAIZkBQADKAQAhmgFAAMoBACGkAQEAvQEAIaUBAQC9AQAhpgEBAL0BACEClQEBAAAAAZYBAQAAAAEHBwAA4AEAIAkAAOEBACCEAQAA3wEAMIUBAAAPABCGAQAA3wEAMJUBAQDFAQAhlgEBAMUBACEMBgAA5wEAIAoAANcBACCEAQAA5gEAMIUBAAAJABCGAQAA5gEAMIcBAQDFAQAhlwEBAMUBACGYAQEA2gEAIZkBQADWAQAhmgFAANYBACGoAQAACQAgqQEAAAkAIAsHAADXAQAghAEAANQBADCFAQAAXwAQhgEAANQBADCHAQEAxQEAIYgBAQDFAQAhmQFAANYBACGbAQEAxQEAIZwBAgDVAQAhqAEAAF8AIKkBAABfACAMBAAA4wEAIAUAAOQBACALAADlAQAghAEAAOIBADCFAQAADQAQhgEAAOIBADCHAQEAxQEAIZkBQADWAQAhmgFAANYBACGkAQEAxQEAIaUBAQDFAQAhpgEBAMUBACEDnQEAAAMAIJ4BAAADACCfAQAAAwAgCQMAANsBACCEAQAA2QEAMIUBAAAHABCGAQAA2QEAMKABAQDFAQAhoQEBANoBACGiAQEA2gEAIagBAAAHACCpAQAABwAgA50BAAAJACCeAQAACQAgnwEAAAkAIAoGAADnAQAgCgAA1wEAIIQBAADmAQAwhQEAAAkAEIYBAADmAQAwhwEBAMUBACGXAQEAxQEAIZgBAQDaAQAhmQFAANYBACGaAUAA1gEAIQ4EAADjAQAgBQAA5AEAIAsAAOUBACCEAQAA4gEAMIUBAAANABCGAQAA4gEAMIcBAQDFAQAhmQFAANYBACGaAUAA1gEAIaQBAQDFAQAhpQEBAMUBACGmAQEAxQEAIagBAAANACCpAQAADQAgBwMAANsBACCEAQAA6AEAMIUBAAADABCGAQAA6AEAMIcBAQDFAQAhoAEBAMUBACGjAUAA1gEAIQAAAAGtAQEAAAABAa0BIAAAAAEAAAAFGAAA6AIAIBkAAO4CACCqAQAA6QIAIKsBAADtAgAgsAEAAAsAIAUYAADmAgAgGQAA6wIAIKoBAADnAgAgqwEAAOoCACCwAQAAXAAgAxgAAOgCACCqAQAA6QIAILABAAALACADGAAA5gIAIKoBAADnAgAgsAEAAFwAIAAAAAABrQFAAAAAAQGtAQEAAAABBxgAAOACACAZAADkAgAgqgEAAOECACCrAQAA4wIAIK4BAAANACCvAQAADQAgsAEAAAEAIAsYAAD9AQAwGQAAggIAMKoBAAD-AQAwqwEAAP8BADCsAQAAgAIAIK0BAACBAgAwrgEAAIECADCvAQAAgQIAMLABAACBAgAwsQEAAIMCADCyAQAAhAIAMAIJAAD0AQAglgEBAAAAAQIAAAARACAYAACIAgAgAwAAABEAIBgAAIgCACAZAACHAgAgAREAAOICADAIBwAA4AEAIAkAAOEBACCEAQAA3wEAMIUBAAAPABCGAQAA3wEAMJUBAQDFAQAhlgEBAMUBACGnAQAA3gEAIAIAAAARACARAACHAgAgAgAAAIUCACARAACGAgAgBYQBAACEAgAwhQEAAIUCABCGAQAAhAIAMJUBAQDFAQAhlgEBAMUBACEFhAEAAIQCADCFAQAAhQIAEIYBAACEAgAwlQEBAMUBACGWAQEAxQEAIQGWAQEA7AEAIQIJAADyAQAglgEBAOwBACECCQAA9AEAIJYBAQAAAAEDGAAA4AIAIKoBAADhAgAgsAEAAAEAIAQYAAD9AQAwqgEAAP4BADCsAQAAgAIAILABAACBAgAwAAAAAAAFrQECAAAAAbMBAgAAAAG0AQIAAAABtQECAAAAAbYBAgAAAAELGAAAkgIAMBkAAJYCADCqAQAAkwIAMKsBAACUAgAwrAEAAJUCACCtAQAAgQIAMK4BAACBAgAwrwEAAIECADCwAQAAgQIAMLEBAACXAgAwsgEAAIQCADACBwAA8wEAIJUBAQAAAAECAAAAEQAgGAAAmgIAIAMAAAARACAYAACaAgAgGQAAmQIAIAERAADfAgAwAgAAABEAIBEAAJkCACACAAAAhQIAIBEAAJgCACABlQEBAOwBACECBwAA8QEAIJUBAQDsAQAhAgcAAPMBACCVAQEAAAABBBgAAJICADCqAQAAkwIAMKwBAACVAgAgsAEAAIECADAAAAAABRgAANoCACAZAADdAgAgqgEAANsCACCrAQAA3AIAILABAAABACADGAAA2gIAIKoBAADbAgAgsAEAAAEAIAMEAADOAgAgBQAAzwIAIAsAANACACAAAAAFGAAA1QIAIBkAANgCACCqAQAA1gIAIKsBAADXAgAgsAEAAAEAIAMYAADVAgAgqgEAANYCACCwAQAAAQAgAAAACxgAAL8CADAZAADEAgAwqgEAAMACADCrAQAAwQIAMKwBAADCAgAgrQEAAMMCADCuAQAAwwIAMK8BAADDAgAwsAEAAMMCADCxAQAAxQIAMLIBAADGAgAwBxgAALoCACAZAAC9AgAgqgEAALsCACCrAQAAvAIAIK4BAAAHACCvAQAABwAgsAEAAEQAIAsYAACuAgAwGQAAswIAMKoBAACvAgAwqwEAALACADCsAQAAsQIAIK0BAACyAgAwrgEAALICADCvAQAAsgIAMLABAACyAgAwsQEAALQCADCyAQAAtQIAMAUKAACKAgAghwEBAAAAAZcBAQAAAAGZAUAAAAABmgFAAAAAAQIAAAALACAYAAC5AgAgAwAAAAsAIBgAALkCACAZAAC4AgAgAREAANQCADAKBgAA5wEAIAoAANcBACCEAQAA5gEAMIUBAAAJABCGAQAA5gEAMIcBAQAAAAGXAQEAxQEAIZgBAQDaAQAhmQFAANYBACGaAUAA1gEAIQIAAAALACARAAC4AgAgAgAAALYCACARAAC3AgAgCIQBAAC1AgAwhQEAALYCABCGAQAAtQIAMIcBAQDFAQAhlwEBAMUBACGYAQEA2gEAIZkBQADWAQAhmgFAANYBACEIhAEAALUCADCFAQAAtgIAEIYBAAC1AgAwhwEBAMUBACGXAQEAxQEAIZgBAQDaAQAhmQFAANYBACGaAUAA1gEAIQSHAQEA7AEAIZcBAQDsAQAhmQFAAPkBACGaAUAA-QEAIQUKAAD8AQAghwEBAOwBACGXAQEA7AEAIZkBQAD5AQAhmgFAAPkBACEFCgAAigIAIIcBAQAAAAGXAQEAAAABmQFAAAAAAZoBQAAAAAECoQEBAAAAAaIBAQAAAAECAAAARAAgGAAAugIAIAMAAAAHACAYAAC6AgAgGQAAvgIAIAQAAAAHACARAAC-AgAgoQEBAPoBACGiAQEA-gEAIQKhAQEA-gEAIaIBAQD6AQAhAocBAQAAAAGjAUAAAAABAgAAAAUAIBgAAMoCACADAAAABQAgGAAAygIAIBkAAMkCACABEQAA0wIAMAcDAADbAQAghAEAAOgBADCFAQAAAwAQhgEAAOgBADCHAQEAAAABoAEBAMUBACGjAUAA1gEAIQIAAAAFACARAADJAgAgAgAAAMcCACARAADIAgAgBoQBAADGAgAwhQEAAMcCABCGAQAAxgIAMIcBAQDFAQAhoAEBAMUBACGjAUAA1gEAIQaEAQAAxgIAMIUBAADHAgAQhgEAAMYCADCHAQEAxQEAIaABAQDFAQAhowFAANYBACEChwEBAOwBACGjAUAA-QEAIQKHAQEA7AEAIaMBQAD5AQAhAocBAQAAAAGjAUAAAAABBBgAAL8CADCqAQAAwAIAMKwBAADCAgAgsAEAAMMCADADGAAAugIAIKoBAAC7AgAgsAEAAEQAIAQYAACuAgAwqgEAAK8CADCsAQAAsQIAILABAACyAgAwAAMDAACiAgAgoQEAAPUBACCiAQAA9QEAIAADBgAAogIAIAoAAJwCACCYAQAA9QEAIAEHAACcAgAgAocBAQAAAAGjAUAAAAABBIcBAQAAAAGXAQEAAAABmQFAAAAAAZoBQAAAAAEIBQAAzAIAIAsAAM0CACCHAQEAAAABmQFAAAAAAZoBQAAAAAGkAQEAAAABpQEBAAAAAaYBAQAAAAECAAAAAQAgGAAA1QIAIAMAAAANACAYAADVAgAgGQAA2QIAIAoAAAANACAFAACsAgAgCwAArQIAIBEAANkCACCHAQEA7AEAIZkBQAD5AQAhmgFAAPkBACGkAQEA7AEAIaUBAQDsAQAhpgEBAOwBACEIBQAArAIAIAsAAK0CACCHAQEA7AEAIZkBQAD5AQAhmgFAAPkBACGkAQEA7AEAIaUBAQDsAQAhpgEBAOwBACEIBAAAywIAIAsAAM0CACCHAQEAAAABmQFAAAAAAZoBQAAAAAGkAQEAAAABpQEBAAAAAaYBAQAAAAECAAAAAQAgGAAA2gIAIAMAAAANACAYAADaAgAgGQAA3gIAIAoAAAANACAEAACrAgAgCwAArQIAIBEAAN4CACCHAQEA7AEAIZkBQAD5AQAhmgFAAPkBACGkAQEA7AEAIaUBAQDsAQAhpgEBAOwBACEIBAAAqwIAIAsAAK0CACCHAQEA7AEAIZkBQAD5AQAhmgFAAPkBACGkAQEA7AEAIaUBAQDsAQAhpgEBAOwBACEBlQEBAAAAAQgEAADLAgAgBQAAzAIAIIcBAQAAAAGZAUAAAAABmgFAAAAAAaQBAQAAAAGlAQEAAAABpgEBAAAAAQIAAAABACAYAADgAgAgAZYBAQAAAAEDAAAADQAgGAAA4AIAIBkAAOUCACAKAAAADQAgBAAAqwIAIAUAAKwCACARAADlAgAghwEBAOwBACGZAUAA-QEAIZoBQAD5AQAhpAEBAOwBACGlAQEA7AEAIaYBAQDsAQAhCAQAAKsCACAFAACsAgAghwEBAOwBACGZAUAA-QEAIZoBQAD5AQAhpAEBAOwBACGlAQEA7AEAIaYBAQDsAQAhBYcBAQAAAAGIAQEAAAABmQFAAAAAAZsBAQAAAAGcAQIAAAABAgAAAFwAIBgAAOYCACAGBgAAiQIAIIcBAQAAAAGXAQEAAAABmAEBAAAAAZkBQAAAAAGaAUAAAAABAgAAAAsAIBgAAOgCACADAAAAXwAgGAAA5gIAIBkAAOwCACAHAAAAXwAgEQAA7AIAIIcBAQDsAQAhiAEBAOwBACGZAUAA-QEAIZsBAQDsAQAhnAECAJACACEFhwEBAOwBACGIAQEA7AEAIZkBQAD5AQAhmwEBAOwBACGcAQIAkAIAIQMAAAAJACAYAADoAgAgGQAA7wIAIAgAAAAJACAGAAD7AQAgEQAA7wIAIIcBAQDsAQAhlwEBAOwBACGYAQEA-gEAIZkBQAD5AQAhmgFAAPkBACEGBgAA-wEAIIcBAQDsAQAhlwEBAOwBACGYAQEA-gEAIZkBQAD5AQAhmgFAAPkBACEEBAYCBQgDCAAJCwwEAQMAAQEDAAEDBg4BCAAIChIFAgcABAkABgIHEwUIAAcBBxQAAQoVAAIEFgALFwAAAAADCAAOHgAPHwAQAAAAAwgADh4ADx8AEAEDAAEBAwABAwgAFR4AFh8AFwAAAAMIABUeABYfABcBAwABAQMAAQMIABweAB0fAB4AAAADCAAcHgAdHwAeAAAFCAAjHgAmHwAnUAAkUQAlAAAAAAAFCAAjHgAmHwAnUAAkUQAlAQZ_AQEGhQEBAwgALB4ALR8ALgAAAAMIACweAC0fAC4CBwAECQAGAgcABAkABgMIADMeADQfADUAAAADCAAzHgA0HwA1AAAAAwgAOx4APB8APQAAAAMIADseADwfAD0MAgENGAEOGgEPGwEQHAESHgETIAoUIQsVIwEWJQoXJgwaJwEbKAEcKQogLA0hLREiLgIjLwIkMAIlMQImMgInNAIoNgopNxIqOQIrOwosPBMtPQIuPgIvPwowQhQxQxgyRQMzRgM0SAM1SQM2SgM3TAM4Tgo5Txk6UQM7Uwo8VBo9VQM-VgM_VwpAWhtBWx9CXQZDXgZEYQZFYgZGYwZHZQZIZwpJaCBKagZLbApMbSFNbgZObwZPcApScyJTdChUdQRVdgRWdwRXeARYeQRZewRafQpbfilcgQEEXYMBCl6EASpfhgEEYIcBBGGIAQpiiwErY4wBL2SNAQVljgEFZo8BBWeQAQVokQEFaZMBBWqVAQprlgEwbJgBBW2aAQpumwExb5wBBXCdAQVxngEKcqEBMnOiATZ0pAE3daUBN3aoATd3qQE3eKoBN3msATd6rgEKe68BOHyxATd9swEKfrQBOX-1ATeAAbYBN4EBtwEKggG6ATqDAbsBPg" +} + +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_fast_bg.sqlite.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.sqlite.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + }, + + importName: "./query_compiler_fast_bg.js" +} + + + +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({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/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({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/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://pris.ly/d/raw-queries). + */ + $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://pris.ly/d/raw-queries). + */ + $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://pris.ly/d/raw-queries). + */ + $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://pris.ly/d/raw-queries). + */ + $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/orm/prisma-client/queries/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.userPreferences`: Exposes CRUD operations for the **UserPreferences** model. + * Example usage: + * ```ts + * // Fetch zero or more UserPreferences + * const userPreferences = await prisma.userPreferences.findMany() + * ``` + */ + get userPreferences(): Prisma.UserPreferencesDelegate; + + /** + * `prisma.attachment`: Exposes CRUD operations for the **Attachment** model. + * Example usage: + * ```ts + * // Fetch zero or more Attachments + * const attachments = await prisma.attachment.findMany() + * ``` + */ + get attachment(): Prisma.AttachmentDelegate; + + /** + * `prisma.message`: Exposes CRUD operations for the **Message** model. + * Example usage: + * ```ts + * // Fetch zero or more Messages + * const messages = await prisma.message.findMany() + * ``` + */ + get message(): Prisma.MessageDelegate; + + /** + * `prisma.messageAttachment`: Exposes CRUD operations for the **MessageAttachment** model. + * Example usage: + * ```ts + * // Fetch zero or more MessageAttachments + * const messageAttachments = await prisma.messageAttachment.findMany() + * ``` + */ + get messageAttachment(): Prisma.MessageAttachmentDelegate; + + /** + * `prisma.channel`: Exposes CRUD operations for the **Channel** model. + * Example usage: + * ```ts + * // Fetch zero or more Channels + * const channels = await prisma.channel.findMany() + * ``` + */ + get channel(): Prisma.ChannelDelegate; +} + +export function getPrismaClientClass(): PrismaClientConstructor { + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/server/prisma/generated-client/internal/prismaNamespace.ts b/server/prisma/generated-client/internal/prismaNamespace.ts new file mode 100644 index 0000000..d31767e --- /dev/null +++ b/server/prisma/generated-client/internal/prismaNamespace.ts @@ -0,0 +1,1256 @@ + +/* !!! 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.ts" +import { type PrismaClient } from "./class.ts" + +export type * from '../models.ts' + +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.7.0 + * Query Engine version: 75cbdc1eb7150937890ad5465d861175c6624711 + */ +export const prismaVersion: PrismaVersion = { + client: "7.7.0", + engine: "75cbdc1eb7150937890ad5465d861175c6624711" +} + +/** + * 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', + UserPreferences: 'UserPreferences', + Attachment: 'Attachment', + Message: 'Message', + MessageAttachment: 'MessageAttachment', + Channel: 'Channel' +} 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" | "userPreferences" | "attachment" | "message" | "messageAttachment" | "channel" + 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 + } + } + } + UserPreferences: { + payload: Prisma.$UserPreferencesPayload + fields: Prisma.UserPreferencesFieldRefs + operations: { + findUnique: { + args: Prisma.UserPreferencesFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserPreferencesFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserPreferencesFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserPreferencesFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserPreferencesFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserPreferencesCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserPreferencesCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserPreferencesCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserPreferencesDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserPreferencesUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserPreferencesDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserPreferencesUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserPreferencesUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserPreferencesUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserPreferencesAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserPreferencesGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserPreferencesCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Attachment: { + payload: Prisma.$AttachmentPayload + fields: Prisma.AttachmentFieldRefs + operations: { + findUnique: { + args: Prisma.AttachmentFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.AttachmentFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.AttachmentFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.AttachmentFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.AttachmentFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.AttachmentCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.AttachmentCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.AttachmentCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.AttachmentDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.AttachmentUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.AttachmentDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.AttachmentUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.AttachmentUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.AttachmentUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.AttachmentAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.AttachmentGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.AttachmentCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Message: { + payload: Prisma.$MessagePayload + fields: Prisma.MessageFieldRefs + operations: { + findUnique: { + args: Prisma.MessageFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.MessageFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.MessageFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.MessageFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.MessageFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.MessageCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.MessageCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.MessageCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.MessageDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.MessageUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.MessageDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.MessageUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.MessageUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.MessageUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.MessageAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.MessageGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.MessageCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + MessageAttachment: { + payload: Prisma.$MessageAttachmentPayload + fields: Prisma.MessageAttachmentFieldRefs + operations: { + findUnique: { + args: Prisma.MessageAttachmentFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.MessageAttachmentFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.MessageAttachmentFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.MessageAttachmentFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.MessageAttachmentFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.MessageAttachmentCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.MessageAttachmentCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.MessageAttachmentCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.MessageAttachmentDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.MessageAttachmentUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.MessageAttachmentDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.MessageAttachmentUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.MessageAttachmentUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.MessageAttachmentUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.MessageAttachmentAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.MessageAttachmentGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.MessageAttachmentCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Channel: { + payload: Prisma.$ChannelPayload + fields: Prisma.ChannelFieldRefs + operations: { + findUnique: { + args: Prisma.ChannelFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ChannelFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ChannelFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ChannelFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ChannelFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ChannelCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ChannelCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.ChannelCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.ChannelDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ChannelUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ChannelDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ChannelUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.ChannelUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.ChannelUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ChannelAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ChannelGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ChannelCountArgs + 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({ + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + username: 'username', + password: 'password', + displayName: 'displayName', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const SessionScalarFieldEnum = { + id: 'id', + userId: 'userId', + expiresAt: 'expiresAt' +} as const + +export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum] + + +export const UserPreferencesScalarFieldEnum = { + userId: 'userId', + toggleInputHotkey: 'toggleInputHotkey', + toggleOutputHotkey: 'toggleOutputHotkey' +} as const + +export type UserPreferencesScalarFieldEnum = (typeof UserPreferencesScalarFieldEnum)[keyof typeof UserPreferencesScalarFieldEnum] + + +export const AttachmentScalarFieldEnum = { + id: 'id', + name: 'name', + mimetype: 'mimetype', + size: 'size', + createdAt: 'createdAt' +} as const + +export type AttachmentScalarFieldEnum = (typeof AttachmentScalarFieldEnum)[keyof typeof AttachmentScalarFieldEnum] + + +export const MessageScalarFieldEnum = { + id: 'id', + text: 'text', + senderId: 'senderId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum] + + +export const MessageAttachmentScalarFieldEnum = { + messageId: 'messageId', + attachmentId: 'attachmentId' +} as const + +export type MessageAttachmentScalarFieldEnum = (typeof MessageAttachmentScalarFieldEnum)[keyof typeof MessageAttachmentScalarFieldEnum] + + +export const ChannelScalarFieldEnum = { + id: 'id', + name: 'name', + persistent: 'persistent' +} as const + +export type ChannelScalarFieldEnum = (typeof ChannelScalarFieldEnum)[keyof typeof ChannelScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +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 'DateTime' + */ +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$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://pris.ly/d/logging). + */ + 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 + /** + * SQL commenter plugins that add metadata to SQL queries as comments. + * Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/ + * + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter, + * comments: [ + * traceContext(), + * queryInsights(), + * ], + * }) + * ``` + */ + comments?: runtime.SqlCommenterPlugin[] +} +export type GlobalOmitConfig = { + user?: Prisma.UserOmit + session?: Prisma.SessionOmit + userPreferences?: Prisma.UserPreferencesOmit + attachment?: Prisma.AttachmentOmit + message?: Prisma.MessageOmit + messageAttachment?: Prisma.MessageAttachmentOmit + channel?: Prisma.ChannelOmit +} + +/* 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/server/prisma/generated-client/internal/prismaNamespaceBrowser.ts b/server/prisma/generated-client/internal/prismaNamespaceBrowser.ts new file mode 100644 index 0000000..686f044 --- /dev/null +++ b/server/prisma/generated-client/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,159 @@ + +/* !!! 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.ts' +export type * from './prismaNamespace.ts' + +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', + UserPreferences: 'UserPreferences', + Attachment: 'Attachment', + Message: 'Message', + MessageAttachment: 'MessageAttachment', + Channel: 'Channel' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + username: 'username', + password: 'password', + displayName: 'displayName', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const SessionScalarFieldEnum = { + id: 'id', + userId: 'userId', + expiresAt: 'expiresAt' +} as const + +export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum] + + +export const UserPreferencesScalarFieldEnum = { + userId: 'userId', + toggleInputHotkey: 'toggleInputHotkey', + toggleOutputHotkey: 'toggleOutputHotkey' +} as const + +export type UserPreferencesScalarFieldEnum = (typeof UserPreferencesScalarFieldEnum)[keyof typeof UserPreferencesScalarFieldEnum] + + +export const AttachmentScalarFieldEnum = { + id: 'id', + name: 'name', + mimetype: 'mimetype', + size: 'size', + createdAt: 'createdAt' +} as const + +export type AttachmentScalarFieldEnum = (typeof AttachmentScalarFieldEnum)[keyof typeof AttachmentScalarFieldEnum] + + +export const MessageScalarFieldEnum = { + id: 'id', + text: 'text', + senderId: 'senderId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum] + + +export const MessageAttachmentScalarFieldEnum = { + messageId: 'messageId', + attachmentId: 'attachmentId' +} as const + +export type MessageAttachmentScalarFieldEnum = (typeof MessageAttachmentScalarFieldEnum)[keyof typeof MessageAttachmentScalarFieldEnum] + + +export const ChannelScalarFieldEnum = { + id: 'id', + name: 'name', + persistent: 'persistent' +} as const + +export type ChannelScalarFieldEnum = (typeof ChannelScalarFieldEnum)[keyof typeof ChannelScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/server/prisma/generated-client/models.ts b/server/prisma/generated-client/models.ts new file mode 100644 index 0000000..e92de30 --- /dev/null +++ b/server/prisma/generated-client/models.ts @@ -0,0 +1,18 @@ + +/* !!! 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.ts' +export type * from './models/Session.ts' +export type * from './models/UserPreferences.ts' +export type * from './models/Attachment.ts' +export type * from './models/Message.ts' +export type * from './models/MessageAttachment.ts' +export type * from './models/Channel.ts' +export type * from './commonInputTypes.ts' \ No newline at end of file diff --git a/server/prisma/generated-client/models/Attachment.ts b/server/prisma/generated-client/models/Attachment.ts new file mode 100644 index 0000000..a52be7c --- /dev/null +++ b/server/prisma/generated-client/models/Attachment.ts @@ -0,0 +1,1377 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Attachment` 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model Attachment + * + */ +export type AttachmentModel = runtime.Types.Result.DefaultSelection + +export type AggregateAttachment = { + _count: AttachmentCountAggregateOutputType | null + _avg: AttachmentAvgAggregateOutputType | null + _sum: AttachmentSumAggregateOutputType | null + _min: AttachmentMinAggregateOutputType | null + _max: AttachmentMaxAggregateOutputType | null +} + +export type AttachmentAvgAggregateOutputType = { + size: number | null +} + +export type AttachmentSumAggregateOutputType = { + size: number | null +} + +export type AttachmentMinAggregateOutputType = { + id: string | null + name: string | null + mimetype: string | null + size: number | null + createdAt: Date | null +} + +export type AttachmentMaxAggregateOutputType = { + id: string | null + name: string | null + mimetype: string | null + size: number | null + createdAt: Date | null +} + +export type AttachmentCountAggregateOutputType = { + id: number + name: number + mimetype: number + size: number + createdAt: number + _all: number +} + + +export type AttachmentAvgAggregateInputType = { + size?: true +} + +export type AttachmentSumAggregateInputType = { + size?: true +} + +export type AttachmentMinAggregateInputType = { + id?: true + name?: true + mimetype?: true + size?: true + createdAt?: true +} + +export type AttachmentMaxAggregateInputType = { + id?: true + name?: true + mimetype?: true + size?: true + createdAt?: true +} + +export type AttachmentCountAggregateInputType = { + id?: true + name?: true + mimetype?: true + size?: true + createdAt?: true + _all?: true +} + +export type AttachmentAggregateArgs = { + /** + * Filter which Attachment to aggregate. + */ + where?: Prisma.AttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Attachments to fetch. + */ + orderBy?: Prisma.AttachmentOrderByWithRelationInput | Prisma.AttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.AttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Attachments 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` Attachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Attachments + **/ + _count?: true | AttachmentCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: AttachmentAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: AttachmentSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: AttachmentMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: AttachmentMaxAggregateInputType +} + +export type GetAttachmentAggregateType = { + [P in keyof T & keyof AggregateAttachment]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type AttachmentGroupByArgs = { + where?: Prisma.AttachmentWhereInput + orderBy?: Prisma.AttachmentOrderByWithAggregationInput | Prisma.AttachmentOrderByWithAggregationInput[] + by: Prisma.AttachmentScalarFieldEnum[] | Prisma.AttachmentScalarFieldEnum + having?: Prisma.AttachmentScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: AttachmentCountAggregateInputType | true + _avg?: AttachmentAvgAggregateInputType + _sum?: AttachmentSumAggregateInputType + _min?: AttachmentMinAggregateInputType + _max?: AttachmentMaxAggregateInputType +} + +export type AttachmentGroupByOutputType = { + id: string + name: string + mimetype: string + size: number + createdAt: Date + _count: AttachmentCountAggregateOutputType | null + _avg: AttachmentAvgAggregateOutputType | null + _sum: AttachmentSumAggregateOutputType | null + _min: AttachmentMinAggregateOutputType | null + _max: AttachmentMaxAggregateOutputType | null +} + +export type GetAttachmentGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof AttachmentGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type AttachmentWhereInput = { + AND?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[] + OR?: Prisma.AttachmentWhereInput[] + NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[] + id?: Prisma.StringFilter<"Attachment"> | string + name?: Prisma.StringFilter<"Attachment"> | string + mimetype?: Prisma.StringFilter<"Attachment"> | string + size?: Prisma.IntFilter<"Attachment"> | number + createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string + message?: Prisma.MessageAttachmentListRelationFilter +} + +export type AttachmentOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + mimetype?: Prisma.SortOrder + size?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + message?: Prisma.MessageAttachmentOrderByRelationAggregateInput +} + +export type AttachmentWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[] + OR?: Prisma.AttachmentWhereInput[] + NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[] + name?: Prisma.StringFilter<"Attachment"> | string + mimetype?: Prisma.StringFilter<"Attachment"> | string + size?: Prisma.IntFilter<"Attachment"> | number + createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string + message?: Prisma.MessageAttachmentListRelationFilter +}, "id"> + +export type AttachmentOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + mimetype?: Prisma.SortOrder + size?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + _count?: Prisma.AttachmentCountOrderByAggregateInput + _avg?: Prisma.AttachmentAvgOrderByAggregateInput + _max?: Prisma.AttachmentMaxOrderByAggregateInput + _min?: Prisma.AttachmentMinOrderByAggregateInput + _sum?: Prisma.AttachmentSumOrderByAggregateInput +} + +export type AttachmentScalarWhereWithAggregatesInput = { + AND?: Prisma.AttachmentScalarWhereWithAggregatesInput | Prisma.AttachmentScalarWhereWithAggregatesInput[] + OR?: Prisma.AttachmentScalarWhereWithAggregatesInput[] + NOT?: Prisma.AttachmentScalarWhereWithAggregatesInput | Prisma.AttachmentScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Attachment"> | string + name?: Prisma.StringWithAggregatesFilter<"Attachment"> | string + mimetype?: Prisma.StringWithAggregatesFilter<"Attachment"> | string + size?: Prisma.IntWithAggregatesFilter<"Attachment"> | number + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Attachment"> | Date | string +} + +export type AttachmentCreateInput = { + id?: string + name: string + mimetype: string + size: number + createdAt?: Date | string + message?: Prisma.MessageAttachmentCreateNestedManyWithoutAttachmentInput +} + +export type AttachmentUncheckedCreateInput = { + id?: string + name: string + mimetype: string + size: number + createdAt?: Date | string + message?: Prisma.MessageAttachmentUncheckedCreateNestedManyWithoutAttachmentInput +} + +export type AttachmentUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + message?: Prisma.MessageAttachmentUpdateManyWithoutAttachmentNestedInput +} + +export type AttachmentUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + message?: Prisma.MessageAttachmentUncheckedUpdateManyWithoutAttachmentNestedInput +} + +export type AttachmentCreateManyInput = { + id?: string + name: string + mimetype: string + size: number + createdAt?: Date | string +} + +export type AttachmentUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type AttachmentUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type AttachmentCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + mimetype?: Prisma.SortOrder + size?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type AttachmentAvgOrderByAggregateInput = { + size?: Prisma.SortOrder +} + +export type AttachmentMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + mimetype?: Prisma.SortOrder + size?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type AttachmentMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + mimetype?: Prisma.SortOrder + size?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type AttachmentSumOrderByAggregateInput = { + size?: Prisma.SortOrder +} + +export type AttachmentScalarRelationFilter = { + is?: Prisma.AttachmentWhereInput + isNot?: Prisma.AttachmentWhereInput +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type AttachmentCreateNestedOneWithoutMessageInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutMessageInput + connect?: Prisma.AttachmentWhereUniqueInput +} + +export type AttachmentUpdateOneRequiredWithoutMessageNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutMessageInput + upsert?: Prisma.AttachmentUpsertWithoutMessageInput + connect?: Prisma.AttachmentWhereUniqueInput + update?: Prisma.XOR, Prisma.AttachmentUncheckedUpdateWithoutMessageInput> +} + +export type AttachmentCreateWithoutMessageInput = { + id?: string + name: string + mimetype: string + size: number + createdAt?: Date | string +} + +export type AttachmentUncheckedCreateWithoutMessageInput = { + id?: string + name: string + mimetype: string + size: number + createdAt?: Date | string +} + +export type AttachmentCreateOrConnectWithoutMessageInput = { + where: Prisma.AttachmentWhereUniqueInput + create: Prisma.XOR +} + +export type AttachmentUpsertWithoutMessageInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.AttachmentWhereInput +} + +export type AttachmentUpdateToOneWithWhereWithoutMessageInput = { + where?: Prisma.AttachmentWhereInput + data: Prisma.XOR +} + +export type AttachmentUpdateWithoutMessageInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type AttachmentUncheckedUpdateWithoutMessageInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + mimetype?: Prisma.StringFieldUpdateOperationsInput | string + size?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type AttachmentCountOutputType + */ + +export type AttachmentCountOutputType = { + message: number +} + +export type AttachmentCountOutputTypeSelect = { + message?: boolean | AttachmentCountOutputTypeCountMessageArgs +} + +/** + * AttachmentCountOutputType without action + */ +export type AttachmentCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the AttachmentCountOutputType + */ + select?: Prisma.AttachmentCountOutputTypeSelect | null +} + +/** + * AttachmentCountOutputType without action + */ +export type AttachmentCountOutputTypeCountMessageArgs = { + where?: Prisma.MessageAttachmentWhereInput +} + + +export type AttachmentSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + mimetype?: boolean + size?: boolean + createdAt?: boolean + message?: boolean | Prisma.Attachment$messageArgs + _count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs +}, ExtArgs["result"]["attachment"]> + +export type AttachmentSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + mimetype?: boolean + size?: boolean + createdAt?: boolean +}, ExtArgs["result"]["attachment"]> + +export type AttachmentSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + mimetype?: boolean + size?: boolean + createdAt?: boolean +}, ExtArgs["result"]["attachment"]> + +export type AttachmentSelectScalar = { + id?: boolean + name?: boolean + mimetype?: boolean + size?: boolean + createdAt?: boolean +} + +export type AttachmentOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "mimetype" | "size" | "createdAt", ExtArgs["result"]["attachment"]> +export type AttachmentInclude = { + message?: boolean | Prisma.Attachment$messageArgs + _count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs +} +export type AttachmentIncludeCreateManyAndReturn = {} +export type AttachmentIncludeUpdateManyAndReturn = {} + +export type $AttachmentPayload = { + name: "Attachment" + objects: { + message: Prisma.$MessageAttachmentPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + mimetype: string + size: number + createdAt: Date + }, ExtArgs["result"]["attachment"]> + composites: {} +} + +export type AttachmentGetPayload = runtime.Types.Result.GetResult + +export type AttachmentCountArgs = + Omit & { + select?: AttachmentCountAggregateInputType | true + } + +export interface AttachmentDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Attachment'], meta: { name: 'Attachment' } } + /** + * Find zero or one Attachment that matches the filter. + * @param {AttachmentFindUniqueArgs} args - Arguments to find a Attachment + * @example + * // Get one Attachment + * const attachment = await prisma.attachment.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Attachment that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {AttachmentFindUniqueOrThrowArgs} args - Arguments to find a Attachment + * @example + * // Get one Attachment + * const attachment = await prisma.attachment.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Attachment 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 {AttachmentFindFirstArgs} args - Arguments to find a Attachment + * @example + * // Get one Attachment + * const attachment = await prisma.attachment.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Attachment 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 {AttachmentFindFirstOrThrowArgs} args - Arguments to find a Attachment + * @example + * // Get one Attachment + * const attachment = await prisma.attachment.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Attachments 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 {AttachmentFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Attachments + * const attachments = await prisma.attachment.findMany() + * + * // Get first 10 Attachments + * const attachments = await prisma.attachment.findMany({ take: 10 }) + * + * // Only select the `id` + * const attachmentWithIdOnly = await prisma.attachment.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Attachment. + * @param {AttachmentCreateArgs} args - Arguments to create a Attachment. + * @example + * // Create one Attachment + * const Attachment = await prisma.attachment.create({ + * data: { + * // ... data to create a Attachment + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Attachments. + * @param {AttachmentCreateManyArgs} args - Arguments to create many Attachments. + * @example + * // Create many Attachments + * const attachment = await prisma.attachment.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Attachments and returns the data saved in the database. + * @param {AttachmentCreateManyAndReturnArgs} args - Arguments to create many Attachments. + * @example + * // Create many Attachments + * const attachment = await prisma.attachment.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Attachments and only return the `id` + * const attachmentWithIdOnly = await prisma.attachment.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 Attachment. + * @param {AttachmentDeleteArgs} args - Arguments to delete one Attachment. + * @example + * // Delete one Attachment + * const Attachment = await prisma.attachment.delete({ + * where: { + * // ... filter to delete one Attachment + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Attachment. + * @param {AttachmentUpdateArgs} args - Arguments to update one Attachment. + * @example + * // Update one Attachment + * const attachment = await prisma.attachment.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Attachments. + * @param {AttachmentDeleteManyArgs} args - Arguments to filter Attachments to delete. + * @example + * // Delete a few Attachments + * const { count } = await prisma.attachment.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Attachments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AttachmentUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Attachments + * const attachment = await prisma.attachment.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Attachments and returns the data updated in the database. + * @param {AttachmentUpdateManyAndReturnArgs} args - Arguments to update many Attachments. + * @example + * // Update many Attachments + * const attachment = await prisma.attachment.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Attachments and only return the `id` + * const attachmentWithIdOnly = await prisma.attachment.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 Attachment. + * @param {AttachmentUpsertArgs} args - Arguments to update or create a Attachment. + * @example + * // Update or create a Attachment + * const attachment = await prisma.attachment.upsert({ + * create: { + * // ... data to create a Attachment + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Attachment we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__AttachmentClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Attachments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AttachmentCountArgs} args - Arguments to filter Attachments to count. + * @example + * // Count the number of Attachments + * const count = await prisma.attachment.count({ + * where: { + * // ... the filter for the Attachments 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 Attachment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AttachmentAggregateArgs} 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 Attachment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AttachmentGroupByArgs} 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 AttachmentGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: AttachmentGroupByArgs['orderBy'] } + : { orderBy?: AttachmentGroupByArgs['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 ? GetAttachmentGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Attachment model + */ +readonly fields: AttachmentFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Attachment. + * 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__AttachmentClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + message = {}>(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 Attachment model + */ +export interface AttachmentFieldRefs { + readonly id: Prisma.FieldRef<"Attachment", 'String'> + readonly name: Prisma.FieldRef<"Attachment", 'String'> + readonly mimetype: Prisma.FieldRef<"Attachment", 'String'> + readonly size: Prisma.FieldRef<"Attachment", 'Int'> + readonly createdAt: Prisma.FieldRef<"Attachment", 'DateTime'> +} + + +// Custom InputTypes +/** + * Attachment findUnique + */ +export type AttachmentFindUniqueArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter, which Attachment to fetch. + */ + where: Prisma.AttachmentWhereUniqueInput +} + +/** + * Attachment findUniqueOrThrow + */ +export type AttachmentFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter, which Attachment to fetch. + */ + where: Prisma.AttachmentWhereUniqueInput +} + +/** + * Attachment findFirst + */ +export type AttachmentFindFirstArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter, which Attachment to fetch. + */ + where?: Prisma.AttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Attachments to fetch. + */ + orderBy?: Prisma.AttachmentOrderByWithRelationInput | Prisma.AttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Attachments. + */ + cursor?: Prisma.AttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Attachments 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` Attachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Attachments. + */ + distinct?: Prisma.AttachmentScalarFieldEnum | Prisma.AttachmentScalarFieldEnum[] +} + +/** + * Attachment findFirstOrThrow + */ +export type AttachmentFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter, which Attachment to fetch. + */ + where?: Prisma.AttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Attachments to fetch. + */ + orderBy?: Prisma.AttachmentOrderByWithRelationInput | Prisma.AttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Attachments. + */ + cursor?: Prisma.AttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Attachments 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` Attachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Attachments. + */ + distinct?: Prisma.AttachmentScalarFieldEnum | Prisma.AttachmentScalarFieldEnum[] +} + +/** + * Attachment findMany + */ +export type AttachmentFindManyArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter, which Attachments to fetch. + */ + where?: Prisma.AttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Attachments to fetch. + */ + orderBy?: Prisma.AttachmentOrderByWithRelationInput | Prisma.AttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Attachments. + */ + cursor?: Prisma.AttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Attachments 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` Attachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Attachments. + */ + distinct?: Prisma.AttachmentScalarFieldEnum | Prisma.AttachmentScalarFieldEnum[] +} + +/** + * Attachment create + */ +export type AttachmentCreateArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * The data needed to create a Attachment. + */ + data: Prisma.XOR +} + +/** + * Attachment createMany + */ +export type AttachmentCreateManyArgs = { + /** + * The data used to create many Attachments. + */ + data: Prisma.AttachmentCreateManyInput | Prisma.AttachmentCreateManyInput[] +} + +/** + * Attachment createManyAndReturn + */ +export type AttachmentCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * The data used to create many Attachments. + */ + data: Prisma.AttachmentCreateManyInput | Prisma.AttachmentCreateManyInput[] +} + +/** + * Attachment update + */ +export type AttachmentUpdateArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * The data needed to update a Attachment. + */ + data: Prisma.XOR + /** + * Choose, which Attachment to update. + */ + where: Prisma.AttachmentWhereUniqueInput +} + +/** + * Attachment updateMany + */ +export type AttachmentUpdateManyArgs = { + /** + * The data used to update Attachments. + */ + data: Prisma.XOR + /** + * Filter which Attachments to update + */ + where?: Prisma.AttachmentWhereInput + /** + * Limit how many Attachments to update. + */ + limit?: number +} + +/** + * Attachment updateManyAndReturn + */ +export type AttachmentUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * The data used to update Attachments. + */ + data: Prisma.XOR + /** + * Filter which Attachments to update + */ + where?: Prisma.AttachmentWhereInput + /** + * Limit how many Attachments to update. + */ + limit?: number +} + +/** + * Attachment upsert + */ +export type AttachmentUpsertArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * The filter to search for the Attachment to update in case it exists. + */ + where: Prisma.AttachmentWhereUniqueInput + /** + * In case the Attachment found by the `where` argument doesn't exist, create a new Attachment with this data. + */ + create: Prisma.XOR + /** + * In case the Attachment was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Attachment delete + */ +export type AttachmentDeleteArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null + /** + * Filter which Attachment to delete. + */ + where: Prisma.AttachmentWhereUniqueInput +} + +/** + * Attachment deleteMany + */ +export type AttachmentDeleteManyArgs = { + /** + * Filter which Attachments to delete + */ + where?: Prisma.AttachmentWhereInput + /** + * Limit how many Attachments to delete. + */ + limit?: number +} + +/** + * Attachment.message + */ +export type Attachment$messageArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + where?: Prisma.MessageAttachmentWhereInput + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + cursor?: Prisma.MessageAttachmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.MessageAttachmentScalarFieldEnum | Prisma.MessageAttachmentScalarFieldEnum[] +} + +/** + * Attachment without action + */ +export type AttachmentDefaultArgs = { + /** + * Select specific fields to fetch from the Attachment + */ + select?: Prisma.AttachmentSelect | null + /** + * Omit specific fields from the Attachment + */ + omit?: Prisma.AttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AttachmentInclude | null +} diff --git a/server/prisma/generated-client/models/Channel.ts b/server/prisma/generated-client/models/Channel.ts new file mode 100644 index 0000000..beed861 --- /dev/null +++ b/server/prisma/generated-client/models/Channel.ts @@ -0,0 +1,1095 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Channel` 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model Channel + * + */ +export type ChannelModel = runtime.Types.Result.DefaultSelection + +export type AggregateChannel = { + _count: ChannelCountAggregateOutputType | null + _min: ChannelMinAggregateOutputType | null + _max: ChannelMaxAggregateOutputType | null +} + +export type ChannelMinAggregateOutputType = { + id: string | null + name: string | null + persistent: boolean | null +} + +export type ChannelMaxAggregateOutputType = { + id: string | null + name: string | null + persistent: boolean | null +} + +export type ChannelCountAggregateOutputType = { + id: number + name: number + persistent: number + _all: number +} + + +export type ChannelMinAggregateInputType = { + id?: true + name?: true + persistent?: true +} + +export type ChannelMaxAggregateInputType = { + id?: true + name?: true + persistent?: true +} + +export type ChannelCountAggregateInputType = { + id?: true + name?: true + persistent?: true + _all?: true +} + +export type ChannelAggregateArgs = { + /** + * Filter which Channel to aggregate. + */ + where?: Prisma.ChannelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Channels to fetch. + */ + orderBy?: Prisma.ChannelOrderByWithRelationInput | Prisma.ChannelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ChannelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Channels 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` Channels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Channels + **/ + _count?: true | ChannelCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ChannelMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ChannelMaxAggregateInputType +} + +export type GetChannelAggregateType = { + [P in keyof T & keyof AggregateChannel]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ChannelGroupByArgs = { + where?: Prisma.ChannelWhereInput + orderBy?: Prisma.ChannelOrderByWithAggregationInput | Prisma.ChannelOrderByWithAggregationInput[] + by: Prisma.ChannelScalarFieldEnum[] | Prisma.ChannelScalarFieldEnum + having?: Prisma.ChannelScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ChannelCountAggregateInputType | true + _min?: ChannelMinAggregateInputType + _max?: ChannelMaxAggregateInputType +} + +export type ChannelGroupByOutputType = { + id: string + name: string + persistent: boolean + _count: ChannelCountAggregateOutputType | null + _min: ChannelMinAggregateOutputType | null + _max: ChannelMaxAggregateOutputType | null +} + +export type GetChannelGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ChannelGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ChannelWhereInput = { + AND?: Prisma.ChannelWhereInput | Prisma.ChannelWhereInput[] + OR?: Prisma.ChannelWhereInput[] + NOT?: Prisma.ChannelWhereInput | Prisma.ChannelWhereInput[] + id?: Prisma.StringFilter<"Channel"> | string + name?: Prisma.StringFilter<"Channel"> | string + persistent?: Prisma.BoolFilter<"Channel"> | boolean +} + +export type ChannelOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + persistent?: Prisma.SortOrder +} + +export type ChannelWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.ChannelWhereInput | Prisma.ChannelWhereInput[] + OR?: Prisma.ChannelWhereInput[] + NOT?: Prisma.ChannelWhereInput | Prisma.ChannelWhereInput[] + name?: Prisma.StringFilter<"Channel"> | string + persistent?: Prisma.BoolFilter<"Channel"> | boolean +}, "id"> + +export type ChannelOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + persistent?: Prisma.SortOrder + _count?: Prisma.ChannelCountOrderByAggregateInput + _max?: Prisma.ChannelMaxOrderByAggregateInput + _min?: Prisma.ChannelMinOrderByAggregateInput +} + +export type ChannelScalarWhereWithAggregatesInput = { + AND?: Prisma.ChannelScalarWhereWithAggregatesInput | Prisma.ChannelScalarWhereWithAggregatesInput[] + OR?: Prisma.ChannelScalarWhereWithAggregatesInput[] + NOT?: Prisma.ChannelScalarWhereWithAggregatesInput | Prisma.ChannelScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Channel"> | string + name?: Prisma.StringWithAggregatesFilter<"Channel"> | string + persistent?: Prisma.BoolWithAggregatesFilter<"Channel"> | boolean +} + +export type ChannelCreateInput = { + id?: string + name: string + persistent: boolean +} + +export type ChannelUncheckedCreateInput = { + id?: string + name: string + persistent: boolean +} + +export type ChannelUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + persistent?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type ChannelUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + persistent?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type ChannelCreateManyInput = { + id?: string + name: string + persistent: boolean +} + +export type ChannelUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + persistent?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type ChannelUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + persistent?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type ChannelCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + persistent?: Prisma.SortOrder +} + +export type ChannelMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + persistent?: Prisma.SortOrder +} + +export type ChannelMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + persistent?: Prisma.SortOrder +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + + + +export type ChannelSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + persistent?: boolean +}, ExtArgs["result"]["channel"]> + +export type ChannelSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + persistent?: boolean +}, ExtArgs["result"]["channel"]> + +export type ChannelSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + persistent?: boolean +}, ExtArgs["result"]["channel"]> + +export type ChannelSelectScalar = { + id?: boolean + name?: boolean + persistent?: boolean +} + +export type ChannelOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "persistent", ExtArgs["result"]["channel"]> + +export type $ChannelPayload = { + name: "Channel" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + persistent: boolean + }, ExtArgs["result"]["channel"]> + composites: {} +} + +export type ChannelGetPayload = runtime.Types.Result.GetResult + +export type ChannelCountArgs = + Omit & { + select?: ChannelCountAggregateInputType | true + } + +export interface ChannelDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Channel'], meta: { name: 'Channel' } } + /** + * Find zero or one Channel that matches the filter. + * @param {ChannelFindUniqueArgs} args - Arguments to find a Channel + * @example + * // Get one Channel + * const channel = await prisma.channel.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Channel that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ChannelFindUniqueOrThrowArgs} args - Arguments to find a Channel + * @example + * // Get one Channel + * const channel = await prisma.channel.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Channel 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 {ChannelFindFirstArgs} args - Arguments to find a Channel + * @example + * // Get one Channel + * const channel = await prisma.channel.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Channel 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 {ChannelFindFirstOrThrowArgs} args - Arguments to find a Channel + * @example + * // Get one Channel + * const channel = await prisma.channel.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Channels 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 {ChannelFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Channels + * const channels = await prisma.channel.findMany() + * + * // Get first 10 Channels + * const channels = await prisma.channel.findMany({ take: 10 }) + * + * // Only select the `id` + * const channelWithIdOnly = await prisma.channel.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Channel. + * @param {ChannelCreateArgs} args - Arguments to create a Channel. + * @example + * // Create one Channel + * const Channel = await prisma.channel.create({ + * data: { + * // ... data to create a Channel + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Channels. + * @param {ChannelCreateManyArgs} args - Arguments to create many Channels. + * @example + * // Create many Channels + * const channel = await prisma.channel.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Channels and returns the data saved in the database. + * @param {ChannelCreateManyAndReturnArgs} args - Arguments to create many Channels. + * @example + * // Create many Channels + * const channel = await prisma.channel.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Channels and only return the `id` + * const channelWithIdOnly = await prisma.channel.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 Channel. + * @param {ChannelDeleteArgs} args - Arguments to delete one Channel. + * @example + * // Delete one Channel + * const Channel = await prisma.channel.delete({ + * where: { + * // ... filter to delete one Channel + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Channel. + * @param {ChannelUpdateArgs} args - Arguments to update one Channel. + * @example + * // Update one Channel + * const channel = await prisma.channel.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Channels. + * @param {ChannelDeleteManyArgs} args - Arguments to filter Channels to delete. + * @example + * // Delete a few Channels + * const { count } = await prisma.channel.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Channels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChannelUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Channels + * const channel = await prisma.channel.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Channels and returns the data updated in the database. + * @param {ChannelUpdateManyAndReturnArgs} args - Arguments to update many Channels. + * @example + * // Update many Channels + * const channel = await prisma.channel.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Channels and only return the `id` + * const channelWithIdOnly = await prisma.channel.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 Channel. + * @param {ChannelUpsertArgs} args - Arguments to update or create a Channel. + * @example + * // Update or create a Channel + * const channel = await prisma.channel.upsert({ + * create: { + * // ... data to create a Channel + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Channel we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ChannelClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Channels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChannelCountArgs} args - Arguments to filter Channels to count. + * @example + * // Count the number of Channels + * const count = await prisma.channel.count({ + * where: { + * // ... the filter for the Channels 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 Channel. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChannelAggregateArgs} 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 Channel. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChannelGroupByArgs} 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 ChannelGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ChannelGroupByArgs['orderBy'] } + : { orderBy?: ChannelGroupByArgs['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 ? GetChannelGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Channel model + */ +readonly fields: ChannelFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Channel. + * 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__ChannelClient 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 Channel model + */ +export interface ChannelFieldRefs { + readonly id: Prisma.FieldRef<"Channel", 'String'> + readonly name: Prisma.FieldRef<"Channel", 'String'> + readonly persistent: Prisma.FieldRef<"Channel", 'Boolean'> +} + + +// Custom InputTypes +/** + * Channel findUnique + */ +export type ChannelFindUniqueArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter, which Channel to fetch. + */ + where: Prisma.ChannelWhereUniqueInput +} + +/** + * Channel findUniqueOrThrow + */ +export type ChannelFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter, which Channel to fetch. + */ + where: Prisma.ChannelWhereUniqueInput +} + +/** + * Channel findFirst + */ +export type ChannelFindFirstArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter, which Channel to fetch. + */ + where?: Prisma.ChannelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Channels to fetch. + */ + orderBy?: Prisma.ChannelOrderByWithRelationInput | Prisma.ChannelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Channels. + */ + cursor?: Prisma.ChannelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Channels 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` Channels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Channels. + */ + distinct?: Prisma.ChannelScalarFieldEnum | Prisma.ChannelScalarFieldEnum[] +} + +/** + * Channel findFirstOrThrow + */ +export type ChannelFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter, which Channel to fetch. + */ + where?: Prisma.ChannelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Channels to fetch. + */ + orderBy?: Prisma.ChannelOrderByWithRelationInput | Prisma.ChannelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Channels. + */ + cursor?: Prisma.ChannelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Channels 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` Channels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Channels. + */ + distinct?: Prisma.ChannelScalarFieldEnum | Prisma.ChannelScalarFieldEnum[] +} + +/** + * Channel findMany + */ +export type ChannelFindManyArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter, which Channels to fetch. + */ + where?: Prisma.ChannelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Channels to fetch. + */ + orderBy?: Prisma.ChannelOrderByWithRelationInput | Prisma.ChannelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Channels. + */ + cursor?: Prisma.ChannelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Channels 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` Channels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Channels. + */ + distinct?: Prisma.ChannelScalarFieldEnum | Prisma.ChannelScalarFieldEnum[] +} + +/** + * Channel create + */ +export type ChannelCreateArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * The data needed to create a Channel. + */ + data: Prisma.XOR +} + +/** + * Channel createMany + */ +export type ChannelCreateManyArgs = { + /** + * The data used to create many Channels. + */ + data: Prisma.ChannelCreateManyInput | Prisma.ChannelCreateManyInput[] +} + +/** + * Channel createManyAndReturn + */ +export type ChannelCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * The data used to create many Channels. + */ + data: Prisma.ChannelCreateManyInput | Prisma.ChannelCreateManyInput[] +} + +/** + * Channel update + */ +export type ChannelUpdateArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * The data needed to update a Channel. + */ + data: Prisma.XOR + /** + * Choose, which Channel to update. + */ + where: Prisma.ChannelWhereUniqueInput +} + +/** + * Channel updateMany + */ +export type ChannelUpdateManyArgs = { + /** + * The data used to update Channels. + */ + data: Prisma.XOR + /** + * Filter which Channels to update + */ + where?: Prisma.ChannelWhereInput + /** + * Limit how many Channels to update. + */ + limit?: number +} + +/** + * Channel updateManyAndReturn + */ +export type ChannelUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * The data used to update Channels. + */ + data: Prisma.XOR + /** + * Filter which Channels to update + */ + where?: Prisma.ChannelWhereInput + /** + * Limit how many Channels to update. + */ + limit?: number +} + +/** + * Channel upsert + */ +export type ChannelUpsertArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * The filter to search for the Channel to update in case it exists. + */ + where: Prisma.ChannelWhereUniqueInput + /** + * In case the Channel found by the `where` argument doesn't exist, create a new Channel with this data. + */ + create: Prisma.XOR + /** + * In case the Channel was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Channel delete + */ +export type ChannelDeleteArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null + /** + * Filter which Channel to delete. + */ + where: Prisma.ChannelWhereUniqueInput +} + +/** + * Channel deleteMany + */ +export type ChannelDeleteManyArgs = { + /** + * Filter which Channels to delete + */ + where?: Prisma.ChannelWhereInput + /** + * Limit how many Channels to delete. + */ + limit?: number +} + +/** + * Channel without action + */ +export type ChannelDefaultArgs = { + /** + * Select specific fields to fetch from the Channel + */ + select?: Prisma.ChannelSelect | null + /** + * Omit specific fields from the Channel + */ + omit?: Prisma.ChannelOmit | null +} diff --git a/server/prisma/generated-client/models/Message.ts b/server/prisma/generated-client/models/Message.ts new file mode 100644 index 0000000..9dba529 --- /dev/null +++ b/server/prisma/generated-client/models/Message.ts @@ -0,0 +1,1498 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Message` 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model Message + * + */ +export type MessageModel = runtime.Types.Result.DefaultSelection + +export type AggregateMessage = { + _count: MessageCountAggregateOutputType | null + _min: MessageMinAggregateOutputType | null + _max: MessageMaxAggregateOutputType | null +} + +export type MessageMinAggregateOutputType = { + id: string | null + text: string | null + senderId: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type MessageMaxAggregateOutputType = { + id: string | null + text: string | null + senderId: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type MessageCountAggregateOutputType = { + id: number + text: number + senderId: number + createdAt: number + updatedAt: number + _all: number +} + + +export type MessageMinAggregateInputType = { + id?: true + text?: true + senderId?: true + createdAt?: true + updatedAt?: true +} + +export type MessageMaxAggregateInputType = { + id?: true + text?: true + senderId?: true + createdAt?: true + updatedAt?: true +} + +export type MessageCountAggregateInputType = { + id?: true + text?: true + senderId?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type MessageAggregateArgs = { + /** + * Filter which Message to aggregate. + */ + where?: Prisma.MessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Messages to fetch. + */ + orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.MessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Messages 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` Messages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Messages + **/ + _count?: true | MessageCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: MessageMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: MessageMaxAggregateInputType +} + +export type GetMessageAggregateType = { + [P in keyof T & keyof AggregateMessage]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type MessageGroupByArgs = { + where?: Prisma.MessageWhereInput + orderBy?: Prisma.MessageOrderByWithAggregationInput | Prisma.MessageOrderByWithAggregationInput[] + by: Prisma.MessageScalarFieldEnum[] | Prisma.MessageScalarFieldEnum + having?: Prisma.MessageScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: MessageCountAggregateInputType | true + _min?: MessageMinAggregateInputType + _max?: MessageMaxAggregateInputType +} + +export type MessageGroupByOutputType = { + id: string + text: string + senderId: string | null + createdAt: Date + updatedAt: Date + _count: MessageCountAggregateOutputType | null + _min: MessageMinAggregateOutputType | null + _max: MessageMaxAggregateOutputType | null +} + +export type GetMessageGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof MessageGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type MessageWhereInput = { + AND?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + OR?: Prisma.MessageWhereInput[] + NOT?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + id?: Prisma.StringFilter<"Message"> | string + text?: Prisma.StringFilter<"Message"> | string + senderId?: Prisma.StringNullableFilter<"Message"> | string | null + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Message"> | Date | string + sender?: Prisma.XOR | null + attachments?: Prisma.MessageAttachmentListRelationFilter +} + +export type MessageOrderByWithRelationInput = { + id?: Prisma.SortOrder + text?: Prisma.SortOrder + senderId?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + sender?: Prisma.UserOrderByWithRelationInput + attachments?: Prisma.MessageAttachmentOrderByRelationAggregateInput +} + +export type MessageWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + OR?: Prisma.MessageWhereInput[] + NOT?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + text?: Prisma.StringFilter<"Message"> | string + senderId?: Prisma.StringNullableFilter<"Message"> | string | null + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Message"> | Date | string + sender?: Prisma.XOR | null + attachments?: Prisma.MessageAttachmentListRelationFilter +}, "id"> + +export type MessageOrderByWithAggregationInput = { + id?: Prisma.SortOrder + text?: Prisma.SortOrder + senderId?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.MessageCountOrderByAggregateInput + _max?: Prisma.MessageMaxOrderByAggregateInput + _min?: Prisma.MessageMinOrderByAggregateInput +} + +export type MessageScalarWhereWithAggregatesInput = { + AND?: Prisma.MessageScalarWhereWithAggregatesInput | Prisma.MessageScalarWhereWithAggregatesInput[] + OR?: Prisma.MessageScalarWhereWithAggregatesInput[] + NOT?: Prisma.MessageScalarWhereWithAggregatesInput | Prisma.MessageScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Message"> | string + text?: Prisma.StringWithAggregatesFilter<"Message"> | string + senderId?: Prisma.StringNullableWithAggregatesFilter<"Message"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Message"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Message"> | Date | string +} + +export type MessageCreateInput = { + id?: string + text: string + createdAt?: Date | string + updatedAt?: Date | string + sender?: Prisma.UserCreateNestedOneWithoutMessagesInput + attachments?: Prisma.MessageAttachmentCreateNestedManyWithoutMessageInput +} + +export type MessageUncheckedCreateInput = { + id?: string + text: string + senderId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + attachments?: Prisma.MessageAttachmentUncheckedCreateNestedManyWithoutMessageInput +} + +export type MessageUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + sender?: Prisma.UserUpdateOneWithoutMessagesNestedInput + attachments?: Prisma.MessageAttachmentUpdateManyWithoutMessageNestedInput +} + +export type MessageUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + senderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + attachments?: Prisma.MessageAttachmentUncheckedUpdateManyWithoutMessageNestedInput +} + +export type MessageCreateManyInput = { + id?: string + text: string + senderId?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type MessageUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type MessageUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + senderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type MessageListRelationFilter = { + every?: Prisma.MessageWhereInput + some?: Prisma.MessageWhereInput + none?: Prisma.MessageWhereInput +} + +export type MessageOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type MessageCountOrderByAggregateInput = { + id?: Prisma.SortOrder + text?: Prisma.SortOrder + senderId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type MessageMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + text?: Prisma.SortOrder + senderId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type MessageMinOrderByAggregateInput = { + id?: Prisma.SortOrder + text?: Prisma.SortOrder + senderId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type MessageScalarRelationFilter = { + is?: Prisma.MessageWhereInput + isNot?: Prisma.MessageWhereInput +} + +export type MessageCreateNestedManyWithoutSenderInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutSenderInput[] | Prisma.MessageUncheckedCreateWithoutSenderInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutSenderInput | Prisma.MessageCreateOrConnectWithoutSenderInput[] + createMany?: Prisma.MessageCreateManySenderInputEnvelope + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] +} + +export type MessageUncheckedCreateNestedManyWithoutSenderInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutSenderInput[] | Prisma.MessageUncheckedCreateWithoutSenderInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutSenderInput | Prisma.MessageCreateOrConnectWithoutSenderInput[] + createMany?: Prisma.MessageCreateManySenderInputEnvelope + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] +} + +export type MessageUpdateManyWithoutSenderNestedInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutSenderInput[] | Prisma.MessageUncheckedCreateWithoutSenderInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutSenderInput | Prisma.MessageCreateOrConnectWithoutSenderInput[] + upsert?: Prisma.MessageUpsertWithWhereUniqueWithoutSenderInput | Prisma.MessageUpsertWithWhereUniqueWithoutSenderInput[] + createMany?: Prisma.MessageCreateManySenderInputEnvelope + set?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + disconnect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + delete?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + update?: Prisma.MessageUpdateWithWhereUniqueWithoutSenderInput | Prisma.MessageUpdateWithWhereUniqueWithoutSenderInput[] + updateMany?: Prisma.MessageUpdateManyWithWhereWithoutSenderInput | Prisma.MessageUpdateManyWithWhereWithoutSenderInput[] + deleteMany?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] +} + +export type MessageUncheckedUpdateManyWithoutSenderNestedInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutSenderInput[] | Prisma.MessageUncheckedCreateWithoutSenderInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutSenderInput | Prisma.MessageCreateOrConnectWithoutSenderInput[] + upsert?: Prisma.MessageUpsertWithWhereUniqueWithoutSenderInput | Prisma.MessageUpsertWithWhereUniqueWithoutSenderInput[] + createMany?: Prisma.MessageCreateManySenderInputEnvelope + set?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + disconnect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + delete?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + update?: Prisma.MessageUpdateWithWhereUniqueWithoutSenderInput | Prisma.MessageUpdateWithWhereUniqueWithoutSenderInput[] + updateMany?: Prisma.MessageUpdateManyWithWhereWithoutSenderInput | Prisma.MessageUpdateManyWithWhereWithoutSenderInput[] + deleteMany?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] +} + +export type MessageCreateNestedOneWithoutAttachmentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutAttachmentsInput + connect?: Prisma.MessageWhereUniqueInput +} + +export type MessageUpdateOneRequiredWithoutAttachmentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutAttachmentsInput + upsert?: Prisma.MessageUpsertWithoutAttachmentsInput + connect?: Prisma.MessageWhereUniqueInput + update?: Prisma.XOR, Prisma.MessageUncheckedUpdateWithoutAttachmentsInput> +} + +export type MessageCreateWithoutSenderInput = { + id?: string + text: string + createdAt?: Date | string + updatedAt?: Date | string + attachments?: Prisma.MessageAttachmentCreateNestedManyWithoutMessageInput +} + +export type MessageUncheckedCreateWithoutSenderInput = { + id?: string + text: string + createdAt?: Date | string + updatedAt?: Date | string + attachments?: Prisma.MessageAttachmentUncheckedCreateNestedManyWithoutMessageInput +} + +export type MessageCreateOrConnectWithoutSenderInput = { + where: Prisma.MessageWhereUniqueInput + create: Prisma.XOR +} + +export type MessageCreateManySenderInputEnvelope = { + data: Prisma.MessageCreateManySenderInput | Prisma.MessageCreateManySenderInput[] +} + +export type MessageUpsertWithWhereUniqueWithoutSenderInput = { + where: Prisma.MessageWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type MessageUpdateWithWhereUniqueWithoutSenderInput = { + where: Prisma.MessageWhereUniqueInput + data: Prisma.XOR +} + +export type MessageUpdateManyWithWhereWithoutSenderInput = { + where: Prisma.MessageScalarWhereInput + data: Prisma.XOR +} + +export type MessageScalarWhereInput = { + AND?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] + OR?: Prisma.MessageScalarWhereInput[] + NOT?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] + id?: Prisma.StringFilter<"Message"> | string + text?: Prisma.StringFilter<"Message"> | string + senderId?: Prisma.StringNullableFilter<"Message"> | string | null + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Message"> | Date | string +} + +export type MessageCreateWithoutAttachmentsInput = { + id?: string + text: string + createdAt?: Date | string + updatedAt?: Date | string + sender?: Prisma.UserCreateNestedOneWithoutMessagesInput +} + +export type MessageUncheckedCreateWithoutAttachmentsInput = { + id?: string + text: string + senderId?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type MessageCreateOrConnectWithoutAttachmentsInput = { + where: Prisma.MessageWhereUniqueInput + create: Prisma.XOR +} + +export type MessageUpsertWithoutAttachmentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.MessageWhereInput +} + +export type MessageUpdateToOneWithWhereWithoutAttachmentsInput = { + where?: Prisma.MessageWhereInput + data: Prisma.XOR +} + +export type MessageUpdateWithoutAttachmentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + sender?: Prisma.UserUpdateOneWithoutMessagesNestedInput +} + +export type MessageUncheckedUpdateWithoutAttachmentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + senderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type MessageCreateManySenderInput = { + id?: string + text: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type MessageUpdateWithoutSenderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + attachments?: Prisma.MessageAttachmentUpdateManyWithoutMessageNestedInput +} + +export type MessageUncheckedUpdateWithoutSenderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + attachments?: Prisma.MessageAttachmentUncheckedUpdateManyWithoutMessageNestedInput +} + +export type MessageUncheckedUpdateManyWithoutSenderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + text?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type MessageCountOutputType + */ + +export type MessageCountOutputType = { + attachments: number +} + +export type MessageCountOutputTypeSelect = { + attachments?: boolean | MessageCountOutputTypeCountAttachmentsArgs +} + +/** + * MessageCountOutputType without action + */ +export type MessageCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the MessageCountOutputType + */ + select?: Prisma.MessageCountOutputTypeSelect | null +} + +/** + * MessageCountOutputType without action + */ +export type MessageCountOutputTypeCountAttachmentsArgs = { + where?: Prisma.MessageAttachmentWhereInput +} + + +export type MessageSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + text?: boolean + senderId?: boolean + createdAt?: boolean + updatedAt?: boolean + sender?: boolean | Prisma.Message$senderArgs + attachments?: boolean | Prisma.Message$attachmentsArgs + _count?: boolean | Prisma.MessageCountOutputTypeDefaultArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + text?: boolean + senderId?: boolean + createdAt?: boolean + updatedAt?: boolean + sender?: boolean | Prisma.Message$senderArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + text?: boolean + senderId?: boolean + createdAt?: boolean + updatedAt?: boolean + sender?: boolean | Prisma.Message$senderArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectScalar = { + id?: boolean + text?: boolean + senderId?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type MessageOmit = runtime.Types.Extensions.GetOmit<"id" | "text" | "senderId" | "createdAt" | "updatedAt", ExtArgs["result"]["message"]> +export type MessageInclude = { + sender?: boolean | Prisma.Message$senderArgs + attachments?: boolean | Prisma.Message$attachmentsArgs + _count?: boolean | Prisma.MessageCountOutputTypeDefaultArgs +} +export type MessageIncludeCreateManyAndReturn = { + sender?: boolean | Prisma.Message$senderArgs +} +export type MessageIncludeUpdateManyAndReturn = { + sender?: boolean | Prisma.Message$senderArgs +} + +export type $MessagePayload = { + name: "Message" + objects: { + sender: Prisma.$UserPayload | null + attachments: Prisma.$MessageAttachmentPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + text: string + senderId: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["message"]> + composites: {} +} + +export type MessageGetPayload = runtime.Types.Result.GetResult + +export type MessageCountArgs = + Omit & { + select?: MessageCountAggregateInputType | true + } + +export interface MessageDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Message'], meta: { name: 'Message' } } + /** + * Find zero or one Message that matches the filter. + * @param {MessageFindUniqueArgs} args - Arguments to find a Message + * @example + * // Get one Message + * const message = await prisma.message.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Message that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {MessageFindUniqueOrThrowArgs} args - Arguments to find a Message + * @example + * // Get one Message + * const message = await prisma.message.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Message 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 {MessageFindFirstArgs} args - Arguments to find a Message + * @example + * // Get one Message + * const message = await prisma.message.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Message 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 {MessageFindFirstOrThrowArgs} args - Arguments to find a Message + * @example + * // Get one Message + * const message = await prisma.message.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Messages 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 {MessageFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Messages + * const messages = await prisma.message.findMany() + * + * // Get first 10 Messages + * const messages = await prisma.message.findMany({ take: 10 }) + * + * // Only select the `id` + * const messageWithIdOnly = await prisma.message.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Message. + * @param {MessageCreateArgs} args - Arguments to create a Message. + * @example + * // Create one Message + * const Message = await prisma.message.create({ + * data: { + * // ... data to create a Message + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Messages. + * @param {MessageCreateManyArgs} args - Arguments to create many Messages. + * @example + * // Create many Messages + * const message = await prisma.message.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Messages and returns the data saved in the database. + * @param {MessageCreateManyAndReturnArgs} args - Arguments to create many Messages. + * @example + * // Create many Messages + * const message = await prisma.message.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Messages and only return the `id` + * const messageWithIdOnly = await prisma.message.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 Message. + * @param {MessageDeleteArgs} args - Arguments to delete one Message. + * @example + * // Delete one Message + * const Message = await prisma.message.delete({ + * where: { + * // ... filter to delete one Message + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Message. + * @param {MessageUpdateArgs} args - Arguments to update one Message. + * @example + * // Update one Message + * const message = await prisma.message.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Messages. + * @param {MessageDeleteManyArgs} args - Arguments to filter Messages to delete. + * @example + * // Delete a few Messages + * const { count } = await prisma.message.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Messages. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Messages + * const message = await prisma.message.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Messages and returns the data updated in the database. + * @param {MessageUpdateManyAndReturnArgs} args - Arguments to update many Messages. + * @example + * // Update many Messages + * const message = await prisma.message.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Messages and only return the `id` + * const messageWithIdOnly = await prisma.message.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 Message. + * @param {MessageUpsertArgs} args - Arguments to update or create a Message. + * @example + * // Update or create a Message + * const message = await prisma.message.upsert({ + * create: { + * // ... data to create a Message + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Message we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__MessageClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Messages. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageCountArgs} args - Arguments to filter Messages to count. + * @example + * // Count the number of Messages + * const count = await prisma.message.count({ + * where: { + * // ... the filter for the Messages 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 Message. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageAggregateArgs} 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 Message. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageGroupByArgs} 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 MessageGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: MessageGroupByArgs['orderBy'] } + : { orderBy?: MessageGroupByArgs['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 ? GetMessageGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Message model + */ +readonly fields: MessageFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Message. + * 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__MessageClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + sender = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + attachments = {}>(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 Message model + */ +export interface MessageFieldRefs { + readonly id: Prisma.FieldRef<"Message", 'String'> + readonly text: Prisma.FieldRef<"Message", 'String'> + readonly senderId: Prisma.FieldRef<"Message", 'String'> + readonly createdAt: Prisma.FieldRef<"Message", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Message", 'DateTime'> +} + + +// Custom InputTypes +/** + * Message findUnique + */ +export type MessageFindUniqueArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter, which Message to fetch. + */ + where: Prisma.MessageWhereUniqueInput +} + +/** + * Message findUniqueOrThrow + */ +export type MessageFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter, which Message to fetch. + */ + where: Prisma.MessageWhereUniqueInput +} + +/** + * Message findFirst + */ +export type MessageFindFirstArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter, which Message to fetch. + */ + where?: Prisma.MessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Messages to fetch. + */ + orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Messages. + */ + cursor?: Prisma.MessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Messages 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` Messages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Messages. + */ + distinct?: Prisma.MessageScalarFieldEnum | Prisma.MessageScalarFieldEnum[] +} + +/** + * Message findFirstOrThrow + */ +export type MessageFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter, which Message to fetch. + */ + where?: Prisma.MessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Messages to fetch. + */ + orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Messages. + */ + cursor?: Prisma.MessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Messages 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` Messages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Messages. + */ + distinct?: Prisma.MessageScalarFieldEnum | Prisma.MessageScalarFieldEnum[] +} + +/** + * Message findMany + */ +export type MessageFindManyArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter, which Messages to fetch. + */ + where?: Prisma.MessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Messages to fetch. + */ + orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Messages. + */ + cursor?: Prisma.MessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Messages 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` Messages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Messages. + */ + distinct?: Prisma.MessageScalarFieldEnum | Prisma.MessageScalarFieldEnum[] +} + +/** + * Message create + */ +export type MessageCreateArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * The data needed to create a Message. + */ + data: Prisma.XOR +} + +/** + * Message createMany + */ +export type MessageCreateManyArgs = { + /** + * The data used to create many Messages. + */ + data: Prisma.MessageCreateManyInput | Prisma.MessageCreateManyInput[] +} + +/** + * Message createManyAndReturn + */ +export type MessageCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * The data used to create many Messages. + */ + data: Prisma.MessageCreateManyInput | Prisma.MessageCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageIncludeCreateManyAndReturn | null +} + +/** + * Message update + */ +export type MessageUpdateArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * The data needed to update a Message. + */ + data: Prisma.XOR + /** + * Choose, which Message to update. + */ + where: Prisma.MessageWhereUniqueInput +} + +/** + * Message updateMany + */ +export type MessageUpdateManyArgs = { + /** + * The data used to update Messages. + */ + data: Prisma.XOR + /** + * Filter which Messages to update + */ + where?: Prisma.MessageWhereInput + /** + * Limit how many Messages to update. + */ + limit?: number +} + +/** + * Message updateManyAndReturn + */ +export type MessageUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * The data used to update Messages. + */ + data: Prisma.XOR + /** + * Filter which Messages to update + */ + where?: Prisma.MessageWhereInput + /** + * Limit how many Messages to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageIncludeUpdateManyAndReturn | null +} + +/** + * Message upsert + */ +export type MessageUpsertArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * The filter to search for the Message to update in case it exists. + */ + where: Prisma.MessageWhereUniqueInput + /** + * In case the Message found by the `where` argument doesn't exist, create a new Message with this data. + */ + create: Prisma.XOR + /** + * In case the Message was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Message delete + */ +export type MessageDeleteArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + /** + * Filter which Message to delete. + */ + where: Prisma.MessageWhereUniqueInput +} + +/** + * Message deleteMany + */ +export type MessageDeleteManyArgs = { + /** + * Filter which Messages to delete + */ + where?: Prisma.MessageWhereInput + /** + * Limit how many Messages to delete. + */ + limit?: number +} + +/** + * Message.sender + */ +export type Message$senderArgs = { + /** + * 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 + where?: Prisma.UserWhereInput +} + +/** + * Message.attachments + */ +export type Message$attachmentsArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + where?: Prisma.MessageAttachmentWhereInput + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + cursor?: Prisma.MessageAttachmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.MessageAttachmentScalarFieldEnum | Prisma.MessageAttachmentScalarFieldEnum[] +} + +/** + * Message without action + */ +export type MessageDefaultArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null +} diff --git a/server/prisma/generated-client/models/MessageAttachment.ts b/server/prisma/generated-client/models/MessageAttachment.ts new file mode 100644 index 0000000..a6574b5 --- /dev/null +++ b/server/prisma/generated-client/models/MessageAttachment.ts @@ -0,0 +1,1345 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `MessageAttachment` 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model MessageAttachment + * + */ +export type MessageAttachmentModel = runtime.Types.Result.DefaultSelection + +export type AggregateMessageAttachment = { + _count: MessageAttachmentCountAggregateOutputType | null + _min: MessageAttachmentMinAggregateOutputType | null + _max: MessageAttachmentMaxAggregateOutputType | null +} + +export type MessageAttachmentMinAggregateOutputType = { + messageId: string | null + attachmentId: string | null +} + +export type MessageAttachmentMaxAggregateOutputType = { + messageId: string | null + attachmentId: string | null +} + +export type MessageAttachmentCountAggregateOutputType = { + messageId: number + attachmentId: number + _all: number +} + + +export type MessageAttachmentMinAggregateInputType = { + messageId?: true + attachmentId?: true +} + +export type MessageAttachmentMaxAggregateInputType = { + messageId?: true + attachmentId?: true +} + +export type MessageAttachmentCountAggregateInputType = { + messageId?: true + attachmentId?: true + _all?: true +} + +export type MessageAttachmentAggregateArgs = { + /** + * Filter which MessageAttachment to aggregate. + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MessageAttachments to fetch. + */ + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.MessageAttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MessageAttachments 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` MessageAttachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned MessageAttachments + **/ + _count?: true | MessageAttachmentCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: MessageAttachmentMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: MessageAttachmentMaxAggregateInputType +} + +export type GetMessageAttachmentAggregateType = { + [P in keyof T & keyof AggregateMessageAttachment]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type MessageAttachmentGroupByArgs = { + where?: Prisma.MessageAttachmentWhereInput + orderBy?: Prisma.MessageAttachmentOrderByWithAggregationInput | Prisma.MessageAttachmentOrderByWithAggregationInput[] + by: Prisma.MessageAttachmentScalarFieldEnum[] | Prisma.MessageAttachmentScalarFieldEnum + having?: Prisma.MessageAttachmentScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: MessageAttachmentCountAggregateInputType | true + _min?: MessageAttachmentMinAggregateInputType + _max?: MessageAttachmentMaxAggregateInputType +} + +export type MessageAttachmentGroupByOutputType = { + messageId: string + attachmentId: string + _count: MessageAttachmentCountAggregateOutputType | null + _min: MessageAttachmentMinAggregateOutputType | null + _max: MessageAttachmentMaxAggregateOutputType | null +} + +export type GetMessageAttachmentGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof MessageAttachmentGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type MessageAttachmentWhereInput = { + AND?: Prisma.MessageAttachmentWhereInput | Prisma.MessageAttachmentWhereInput[] + OR?: Prisma.MessageAttachmentWhereInput[] + NOT?: Prisma.MessageAttachmentWhereInput | Prisma.MessageAttachmentWhereInput[] + messageId?: Prisma.StringFilter<"MessageAttachment"> | string + attachmentId?: Prisma.StringFilter<"MessageAttachment"> | string + message?: Prisma.XOR + attachment?: Prisma.XOR +} + +export type MessageAttachmentOrderByWithRelationInput = { + messageId?: Prisma.SortOrder + attachmentId?: Prisma.SortOrder + message?: Prisma.MessageOrderByWithRelationInput + attachment?: Prisma.AttachmentOrderByWithRelationInput +} + +export type MessageAttachmentWhereUniqueInput = Prisma.AtLeast<{ + messageId_attachmentId?: Prisma.MessageAttachmentMessageIdAttachmentIdCompoundUniqueInput + AND?: Prisma.MessageAttachmentWhereInput | Prisma.MessageAttachmentWhereInput[] + OR?: Prisma.MessageAttachmentWhereInput[] + NOT?: Prisma.MessageAttachmentWhereInput | Prisma.MessageAttachmentWhereInput[] + messageId?: Prisma.StringFilter<"MessageAttachment"> | string + attachmentId?: Prisma.StringFilter<"MessageAttachment"> | string + message?: Prisma.XOR + attachment?: Prisma.XOR +}, "messageId_attachmentId"> + +export type MessageAttachmentOrderByWithAggregationInput = { + messageId?: Prisma.SortOrder + attachmentId?: Prisma.SortOrder + _count?: Prisma.MessageAttachmentCountOrderByAggregateInput + _max?: Prisma.MessageAttachmentMaxOrderByAggregateInput + _min?: Prisma.MessageAttachmentMinOrderByAggregateInput +} + +export type MessageAttachmentScalarWhereWithAggregatesInput = { + AND?: Prisma.MessageAttachmentScalarWhereWithAggregatesInput | Prisma.MessageAttachmentScalarWhereWithAggregatesInput[] + OR?: Prisma.MessageAttachmentScalarWhereWithAggregatesInput[] + NOT?: Prisma.MessageAttachmentScalarWhereWithAggregatesInput | Prisma.MessageAttachmentScalarWhereWithAggregatesInput[] + messageId?: Prisma.StringWithAggregatesFilter<"MessageAttachment"> | string + attachmentId?: Prisma.StringWithAggregatesFilter<"MessageAttachment"> | string +} + +export type MessageAttachmentCreateInput = { + message: Prisma.MessageCreateNestedOneWithoutAttachmentsInput + attachment: Prisma.AttachmentCreateNestedOneWithoutMessageInput +} + +export type MessageAttachmentUncheckedCreateInput = { + messageId: string + attachmentId: string +} + +export type MessageAttachmentUpdateInput = { + message?: Prisma.MessageUpdateOneRequiredWithoutAttachmentsNestedInput + attachment?: Prisma.AttachmentUpdateOneRequiredWithoutMessageNestedInput +} + +export type MessageAttachmentUncheckedUpdateInput = { + messageId?: Prisma.StringFieldUpdateOperationsInput | string + attachmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type MessageAttachmentCreateManyInput = { + messageId: string + attachmentId: string +} + +export type MessageAttachmentUpdateManyMutationInput = { + +} + +export type MessageAttachmentUncheckedUpdateManyInput = { + messageId?: Prisma.StringFieldUpdateOperationsInput | string + attachmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type MessageAttachmentListRelationFilter = { + every?: Prisma.MessageAttachmentWhereInput + some?: Prisma.MessageAttachmentWhereInput + none?: Prisma.MessageAttachmentWhereInput +} + +export type MessageAttachmentOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type MessageAttachmentMessageIdAttachmentIdCompoundUniqueInput = { + messageId: string + attachmentId: string +} + +export type MessageAttachmentCountOrderByAggregateInput = { + messageId?: Prisma.SortOrder + attachmentId?: Prisma.SortOrder +} + +export type MessageAttachmentMaxOrderByAggregateInput = { + messageId?: Prisma.SortOrder + attachmentId?: Prisma.SortOrder +} + +export type MessageAttachmentMinOrderByAggregateInput = { + messageId?: Prisma.SortOrder + attachmentId?: Prisma.SortOrder +} + +export type MessageAttachmentCreateNestedManyWithoutAttachmentInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutAttachmentInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutAttachmentInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput | Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput[] + createMany?: Prisma.MessageAttachmentCreateManyAttachmentInputEnvelope + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] +} + +export type MessageAttachmentUncheckedCreateNestedManyWithoutAttachmentInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutAttachmentInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutAttachmentInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput | Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput[] + createMany?: Prisma.MessageAttachmentCreateManyAttachmentInputEnvelope + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] +} + +export type MessageAttachmentUpdateManyWithoutAttachmentNestedInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutAttachmentInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutAttachmentInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput | Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput[] + upsert?: Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutAttachmentInput | Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutAttachmentInput[] + createMany?: Prisma.MessageAttachmentCreateManyAttachmentInputEnvelope + set?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + disconnect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + delete?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + update?: Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutAttachmentInput | Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutAttachmentInput[] + updateMany?: Prisma.MessageAttachmentUpdateManyWithWhereWithoutAttachmentInput | Prisma.MessageAttachmentUpdateManyWithWhereWithoutAttachmentInput[] + deleteMany?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] +} + +export type MessageAttachmentUncheckedUpdateManyWithoutAttachmentNestedInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutAttachmentInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutAttachmentInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput | Prisma.MessageAttachmentCreateOrConnectWithoutAttachmentInput[] + upsert?: Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutAttachmentInput | Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutAttachmentInput[] + createMany?: Prisma.MessageAttachmentCreateManyAttachmentInputEnvelope + set?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + disconnect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + delete?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + update?: Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutAttachmentInput | Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutAttachmentInput[] + updateMany?: Prisma.MessageAttachmentUpdateManyWithWhereWithoutAttachmentInput | Prisma.MessageAttachmentUpdateManyWithWhereWithoutAttachmentInput[] + deleteMany?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] +} + +export type MessageAttachmentCreateNestedManyWithoutMessageInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutMessageInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutMessageInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput | Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput[] + createMany?: Prisma.MessageAttachmentCreateManyMessageInputEnvelope + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] +} + +export type MessageAttachmentUncheckedCreateNestedManyWithoutMessageInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutMessageInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutMessageInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput | Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput[] + createMany?: Prisma.MessageAttachmentCreateManyMessageInputEnvelope + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] +} + +export type MessageAttachmentUpdateManyWithoutMessageNestedInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutMessageInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutMessageInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput | Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput[] + upsert?: Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutMessageInput | Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutMessageInput[] + createMany?: Prisma.MessageAttachmentCreateManyMessageInputEnvelope + set?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + disconnect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + delete?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + update?: Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutMessageInput | Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutMessageInput[] + updateMany?: Prisma.MessageAttachmentUpdateManyWithWhereWithoutMessageInput | Prisma.MessageAttachmentUpdateManyWithWhereWithoutMessageInput[] + deleteMany?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] +} + +export type MessageAttachmentUncheckedUpdateManyWithoutMessageNestedInput = { + create?: Prisma.XOR | Prisma.MessageAttachmentCreateWithoutMessageInput[] | Prisma.MessageAttachmentUncheckedCreateWithoutMessageInput[] + connectOrCreate?: Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput | Prisma.MessageAttachmentCreateOrConnectWithoutMessageInput[] + upsert?: Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutMessageInput | Prisma.MessageAttachmentUpsertWithWhereUniqueWithoutMessageInput[] + createMany?: Prisma.MessageAttachmentCreateManyMessageInputEnvelope + set?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + disconnect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + delete?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + connect?: Prisma.MessageAttachmentWhereUniqueInput | Prisma.MessageAttachmentWhereUniqueInput[] + update?: Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutMessageInput | Prisma.MessageAttachmentUpdateWithWhereUniqueWithoutMessageInput[] + updateMany?: Prisma.MessageAttachmentUpdateManyWithWhereWithoutMessageInput | Prisma.MessageAttachmentUpdateManyWithWhereWithoutMessageInput[] + deleteMany?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] +} + +export type MessageAttachmentCreateWithoutAttachmentInput = { + message: Prisma.MessageCreateNestedOneWithoutAttachmentsInput +} + +export type MessageAttachmentUncheckedCreateWithoutAttachmentInput = { + messageId: string +} + +export type MessageAttachmentCreateOrConnectWithoutAttachmentInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + create: Prisma.XOR +} + +export type MessageAttachmentCreateManyAttachmentInputEnvelope = { + data: Prisma.MessageAttachmentCreateManyAttachmentInput | Prisma.MessageAttachmentCreateManyAttachmentInput[] +} + +export type MessageAttachmentUpsertWithWhereUniqueWithoutAttachmentInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type MessageAttachmentUpdateWithWhereUniqueWithoutAttachmentInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + data: Prisma.XOR +} + +export type MessageAttachmentUpdateManyWithWhereWithoutAttachmentInput = { + where: Prisma.MessageAttachmentScalarWhereInput + data: Prisma.XOR +} + +export type MessageAttachmentScalarWhereInput = { + AND?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] + OR?: Prisma.MessageAttachmentScalarWhereInput[] + NOT?: Prisma.MessageAttachmentScalarWhereInput | Prisma.MessageAttachmentScalarWhereInput[] + messageId?: Prisma.StringFilter<"MessageAttachment"> | string + attachmentId?: Prisma.StringFilter<"MessageAttachment"> | string +} + +export type MessageAttachmentCreateWithoutMessageInput = { + attachment: Prisma.AttachmentCreateNestedOneWithoutMessageInput +} + +export type MessageAttachmentUncheckedCreateWithoutMessageInput = { + attachmentId: string +} + +export type MessageAttachmentCreateOrConnectWithoutMessageInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + create: Prisma.XOR +} + +export type MessageAttachmentCreateManyMessageInputEnvelope = { + data: Prisma.MessageAttachmentCreateManyMessageInput | Prisma.MessageAttachmentCreateManyMessageInput[] +} + +export type MessageAttachmentUpsertWithWhereUniqueWithoutMessageInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type MessageAttachmentUpdateWithWhereUniqueWithoutMessageInput = { + where: Prisma.MessageAttachmentWhereUniqueInput + data: Prisma.XOR +} + +export type MessageAttachmentUpdateManyWithWhereWithoutMessageInput = { + where: Prisma.MessageAttachmentScalarWhereInput + data: Prisma.XOR +} + +export type MessageAttachmentCreateManyAttachmentInput = { + messageId: string +} + +export type MessageAttachmentUpdateWithoutAttachmentInput = { + message?: Prisma.MessageUpdateOneRequiredWithoutAttachmentsNestedInput +} + +export type MessageAttachmentUncheckedUpdateWithoutAttachmentInput = { + messageId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type MessageAttachmentUncheckedUpdateManyWithoutAttachmentInput = { + messageId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type MessageAttachmentCreateManyMessageInput = { + attachmentId: string +} + +export type MessageAttachmentUpdateWithoutMessageInput = { + attachment?: Prisma.AttachmentUpdateOneRequiredWithoutMessageNestedInput +} + +export type MessageAttachmentUncheckedUpdateWithoutMessageInput = { + attachmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type MessageAttachmentUncheckedUpdateManyWithoutMessageInput = { + attachmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + + + +export type MessageAttachmentSelect = runtime.Types.Extensions.GetSelect<{ + messageId?: boolean + attachmentId?: boolean + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +}, ExtArgs["result"]["messageAttachment"]> + +export type MessageAttachmentSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + messageId?: boolean + attachmentId?: boolean + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +}, ExtArgs["result"]["messageAttachment"]> + +export type MessageAttachmentSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + messageId?: boolean + attachmentId?: boolean + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +}, ExtArgs["result"]["messageAttachment"]> + +export type MessageAttachmentSelectScalar = { + messageId?: boolean + attachmentId?: boolean +} + +export type MessageAttachmentOmit = runtime.Types.Extensions.GetOmit<"messageId" | "attachmentId", ExtArgs["result"]["messageAttachment"]> +export type MessageAttachmentInclude = { + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +} +export type MessageAttachmentIncludeCreateManyAndReturn = { + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +} +export type MessageAttachmentIncludeUpdateManyAndReturn = { + message?: boolean | Prisma.MessageDefaultArgs + attachment?: boolean | Prisma.AttachmentDefaultArgs +} + +export type $MessageAttachmentPayload = { + name: "MessageAttachment" + objects: { + message: Prisma.$MessagePayload + attachment: Prisma.$AttachmentPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + messageId: string + attachmentId: string + }, ExtArgs["result"]["messageAttachment"]> + composites: {} +} + +export type MessageAttachmentGetPayload = runtime.Types.Result.GetResult + +export type MessageAttachmentCountArgs = + Omit & { + select?: MessageAttachmentCountAggregateInputType | true + } + +export interface MessageAttachmentDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['MessageAttachment'], meta: { name: 'MessageAttachment' } } + /** + * Find zero or one MessageAttachment that matches the filter. + * @param {MessageAttachmentFindUniqueArgs} args - Arguments to find a MessageAttachment + * @example + * // Get one MessageAttachment + * const messageAttachment = await prisma.messageAttachment.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one MessageAttachment that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {MessageAttachmentFindUniqueOrThrowArgs} args - Arguments to find a MessageAttachment + * @example + * // Get one MessageAttachment + * const messageAttachment = await prisma.messageAttachment.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MessageAttachment 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 {MessageAttachmentFindFirstArgs} args - Arguments to find a MessageAttachment + * @example + * // Get one MessageAttachment + * const messageAttachment = await prisma.messageAttachment.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MessageAttachment 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 {MessageAttachmentFindFirstOrThrowArgs} args - Arguments to find a MessageAttachment + * @example + * // Get one MessageAttachment + * const messageAttachment = await prisma.messageAttachment.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more MessageAttachments 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 {MessageAttachmentFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all MessageAttachments + * const messageAttachments = await prisma.messageAttachment.findMany() + * + * // Get first 10 MessageAttachments + * const messageAttachments = await prisma.messageAttachment.findMany({ take: 10 }) + * + * // Only select the `messageId` + * const messageAttachmentWithMessageIdOnly = await prisma.messageAttachment.findMany({ select: { messageId: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a MessageAttachment. + * @param {MessageAttachmentCreateArgs} args - Arguments to create a MessageAttachment. + * @example + * // Create one MessageAttachment + * const MessageAttachment = await prisma.messageAttachment.create({ + * data: { + * // ... data to create a MessageAttachment + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many MessageAttachments. + * @param {MessageAttachmentCreateManyArgs} args - Arguments to create many MessageAttachments. + * @example + * // Create many MessageAttachments + * const messageAttachment = await prisma.messageAttachment.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many MessageAttachments and returns the data saved in the database. + * @param {MessageAttachmentCreateManyAndReturnArgs} args - Arguments to create many MessageAttachments. + * @example + * // Create many MessageAttachments + * const messageAttachment = await prisma.messageAttachment.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many MessageAttachments and only return the `messageId` + * const messageAttachmentWithMessageIdOnly = await prisma.messageAttachment.createManyAndReturn({ + * select: { messageId: 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 MessageAttachment. + * @param {MessageAttachmentDeleteArgs} args - Arguments to delete one MessageAttachment. + * @example + * // Delete one MessageAttachment + * const MessageAttachment = await prisma.messageAttachment.delete({ + * where: { + * // ... filter to delete one MessageAttachment + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one MessageAttachment. + * @param {MessageAttachmentUpdateArgs} args - Arguments to update one MessageAttachment. + * @example + * // Update one MessageAttachment + * const messageAttachment = await prisma.messageAttachment.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more MessageAttachments. + * @param {MessageAttachmentDeleteManyArgs} args - Arguments to filter MessageAttachments to delete. + * @example + * // Delete a few MessageAttachments + * const { count } = await prisma.messageAttachment.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MessageAttachments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageAttachmentUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many MessageAttachments + * const messageAttachment = await prisma.messageAttachment.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MessageAttachments and returns the data updated in the database. + * @param {MessageAttachmentUpdateManyAndReturnArgs} args - Arguments to update many MessageAttachments. + * @example + * // Update many MessageAttachments + * const messageAttachment = await prisma.messageAttachment.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more MessageAttachments and only return the `messageId` + * const messageAttachmentWithMessageIdOnly = await prisma.messageAttachment.updateManyAndReturn({ + * select: { messageId: 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 MessageAttachment. + * @param {MessageAttachmentUpsertArgs} args - Arguments to update or create a MessageAttachment. + * @example + * // Update or create a MessageAttachment + * const messageAttachment = await prisma.messageAttachment.upsert({ + * create: { + * // ... data to create a MessageAttachment + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the MessageAttachment we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__MessageAttachmentClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of MessageAttachments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageAttachmentCountArgs} args - Arguments to filter MessageAttachments to count. + * @example + * // Count the number of MessageAttachments + * const count = await prisma.messageAttachment.count({ + * where: { + * // ... the filter for the MessageAttachments 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 MessageAttachment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageAttachmentAggregateArgs} 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 MessageAttachment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MessageAttachmentGroupByArgs} 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 MessageAttachmentGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: MessageAttachmentGroupByArgs['orderBy'] } + : { orderBy?: MessageAttachmentGroupByArgs['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 ? GetMessageAttachmentGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the MessageAttachment model + */ +readonly fields: MessageAttachmentFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for MessageAttachment. + * 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__MessageAttachmentClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + message = {}>(args?: Prisma.Subset>): Prisma.Prisma__MessageClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + attachment = {}>(args?: Prisma.Subset>): Prisma.Prisma__AttachmentClient, 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 MessageAttachment model + */ +export interface MessageAttachmentFieldRefs { + readonly messageId: Prisma.FieldRef<"MessageAttachment", 'String'> + readonly attachmentId: Prisma.FieldRef<"MessageAttachment", 'String'> +} + + +// Custom InputTypes +/** + * MessageAttachment findUnique + */ +export type MessageAttachmentFindUniqueArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter, which MessageAttachment to fetch. + */ + where: Prisma.MessageAttachmentWhereUniqueInput +} + +/** + * MessageAttachment findUniqueOrThrow + */ +export type MessageAttachmentFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter, which MessageAttachment to fetch. + */ + where: Prisma.MessageAttachmentWhereUniqueInput +} + +/** + * MessageAttachment findFirst + */ +export type MessageAttachmentFindFirstArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter, which MessageAttachment to fetch. + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MessageAttachments to fetch. + */ + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MessageAttachments. + */ + cursor?: Prisma.MessageAttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MessageAttachments 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` MessageAttachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MessageAttachments. + */ + distinct?: Prisma.MessageAttachmentScalarFieldEnum | Prisma.MessageAttachmentScalarFieldEnum[] +} + +/** + * MessageAttachment findFirstOrThrow + */ +export type MessageAttachmentFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter, which MessageAttachment to fetch. + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MessageAttachments to fetch. + */ + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MessageAttachments. + */ + cursor?: Prisma.MessageAttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MessageAttachments 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` MessageAttachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MessageAttachments. + */ + distinct?: Prisma.MessageAttachmentScalarFieldEnum | Prisma.MessageAttachmentScalarFieldEnum[] +} + +/** + * MessageAttachment findMany + */ +export type MessageAttachmentFindManyArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter, which MessageAttachments to fetch. + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MessageAttachments to fetch. + */ + orderBy?: Prisma.MessageAttachmentOrderByWithRelationInput | Prisma.MessageAttachmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing MessageAttachments. + */ + cursor?: Prisma.MessageAttachmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MessageAttachments 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` MessageAttachments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MessageAttachments. + */ + distinct?: Prisma.MessageAttachmentScalarFieldEnum | Prisma.MessageAttachmentScalarFieldEnum[] +} + +/** + * MessageAttachment create + */ +export type MessageAttachmentCreateArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * The data needed to create a MessageAttachment. + */ + data: Prisma.XOR +} + +/** + * MessageAttachment createMany + */ +export type MessageAttachmentCreateManyArgs = { + /** + * The data used to create many MessageAttachments. + */ + data: Prisma.MessageAttachmentCreateManyInput | Prisma.MessageAttachmentCreateManyInput[] +} + +/** + * MessageAttachment createManyAndReturn + */ +export type MessageAttachmentCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelectCreateManyAndReturn | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * The data used to create many MessageAttachments. + */ + data: Prisma.MessageAttachmentCreateManyInput | Prisma.MessageAttachmentCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentIncludeCreateManyAndReturn | null +} + +/** + * MessageAttachment update + */ +export type MessageAttachmentUpdateArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * The data needed to update a MessageAttachment. + */ + data: Prisma.XOR + /** + * Choose, which MessageAttachment to update. + */ + where: Prisma.MessageAttachmentWhereUniqueInput +} + +/** + * MessageAttachment updateMany + */ +export type MessageAttachmentUpdateManyArgs = { + /** + * The data used to update MessageAttachments. + */ + data: Prisma.XOR + /** + * Filter which MessageAttachments to update + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * Limit how many MessageAttachments to update. + */ + limit?: number +} + +/** + * MessageAttachment updateManyAndReturn + */ +export type MessageAttachmentUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * The data used to update MessageAttachments. + */ + data: Prisma.XOR + /** + * Filter which MessageAttachments to update + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * Limit how many MessageAttachments to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentIncludeUpdateManyAndReturn | null +} + +/** + * MessageAttachment upsert + */ +export type MessageAttachmentUpsertArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * The filter to search for the MessageAttachment to update in case it exists. + */ + where: Prisma.MessageAttachmentWhereUniqueInput + /** + * In case the MessageAttachment found by the `where` argument doesn't exist, create a new MessageAttachment with this data. + */ + create: Prisma.XOR + /** + * In case the MessageAttachment was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * MessageAttachment delete + */ +export type MessageAttachmentDeleteArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null + /** + * Filter which MessageAttachment to delete. + */ + where: Prisma.MessageAttachmentWhereUniqueInput +} + +/** + * MessageAttachment deleteMany + */ +export type MessageAttachmentDeleteManyArgs = { + /** + * Filter which MessageAttachments to delete + */ + where?: Prisma.MessageAttachmentWhereInput + /** + * Limit how many MessageAttachments to delete. + */ + limit?: number +} + +/** + * MessageAttachment without action + */ +export type MessageAttachmentDefaultArgs = { + /** + * Select specific fields to fetch from the MessageAttachment + */ + select?: Prisma.MessageAttachmentSelect | null + /** + * Omit specific fields from the MessageAttachment + */ + omit?: Prisma.MessageAttachmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageAttachmentInclude | null +} diff --git a/server/prisma/generated-client/models/Session.ts b/server/prisma/generated-client/models/Session.ts new file mode 100644 index 0000000..0c7fc34 --- /dev/null +++ b/server/prisma/generated-client/models/Session.ts @@ -0,0 +1,1272 @@ + +/* !!! 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * 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 + userId: string | null + expiresAt: Date | null +} + +export type SessionMaxAggregateOutputType = { + id: string | null + userId: string | null + expiresAt: Date | null +} + +export type SessionCountAggregateOutputType = { + id: number + userId: number + expiresAt: number + _all: number +} + + +export type SessionMinAggregateInputType = { + id?: true + userId?: true + expiresAt?: true +} + +export type SessionMaxAggregateInputType = { + id?: true + userId?: true + expiresAt?: true +} + +export type SessionCountAggregateInputType = { + id?: true + userId?: true + expiresAt?: 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 + userId: string + expiresAt: Date + _count: SessionCountAggregateOutputType | null + _min: SessionMinAggregateOutputType | null + _max: SessionMaxAggregateOutputType | null +} + +export 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 + userId?: Prisma.StringFilter<"Session"> | string + expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string + user?: Prisma.XOR +} + +export type SessionOrderByWithRelationInput = { + id?: Prisma.SortOrder + userId?: Prisma.SortOrder + expiresAt?: Prisma.SortOrder + user?: Prisma.UserOrderByWithRelationInput +} + +export type SessionWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] + OR?: Prisma.SessionWhereInput[] + NOT?: Prisma.SessionWhereInput | Prisma.SessionWhereInput[] + userId?: Prisma.StringFilter<"Session"> | string + expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string + user?: Prisma.XOR +}, "id"> + +export type SessionOrderByWithAggregationInput = { + id?: Prisma.SortOrder + userId?: Prisma.SortOrder + expiresAt?: 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 + userId?: Prisma.StringWithAggregatesFilter<"Session"> | string + expiresAt?: Prisma.DateTimeWithAggregatesFilter<"Session"> | Date | string +} + +export type SessionCreateInput = { + id: string + expiresAt: Date | string + user: Prisma.UserCreateNestedOneWithoutSessionInput +} + +export type SessionUncheckedCreateInput = { + id: string + userId: string + expiresAt: Date | string +} + +export type SessionUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutSessionNestedInput +} + +export type SessionUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SessionCreateManyInput = { + id: string + userId: string + expiresAt: Date | string +} + +export type SessionUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SessionUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: 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 + userId?: Prisma.SortOrder + expiresAt?: Prisma.SortOrder +} + +export type SessionMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + userId?: Prisma.SortOrder + expiresAt?: Prisma.SortOrder +} + +export type SessionMinOrderByAggregateInput = { + id?: Prisma.SortOrder + userId?: Prisma.SortOrder + expiresAt?: 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 +} + +export type SessionUncheckedCreateWithoutUserInput = { + id: string + expiresAt: Date | string +} + +export type SessionCreateOrConnectWithoutUserInput = { + where: Prisma.SessionWhereUniqueInput + create: Prisma.XOR +} + +export type SessionCreateManyUserInputEnvelope = { + data: Prisma.SessionCreateManyUserInput | Prisma.SessionCreateManyUserInput[] +} + +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 + userId?: Prisma.StringFilter<"Session"> | string + expiresAt?: Prisma.DateTimeFilter<"Session"> | Date | string +} + +export type SessionCreateManyUserInput = { + id: string + expiresAt: Date | string +} + +export type SessionUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SessionUncheckedUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SessionUncheckedUpdateManyWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type SessionSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + userId?: boolean + expiresAt?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["session"]> + +export type SessionSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + userId?: boolean + expiresAt?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["session"]> + +export type SessionSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + userId?: boolean + expiresAt?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["session"]> + +export type SessionSelectScalar = { + id?: boolean + userId?: boolean + expiresAt?: boolean +} + +export type SessionOmit = runtime.Types.Extensions.GetOmit<"id" | "userId" | "expiresAt", 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 + userId: string + expiresAt: 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 userId: Prisma.FieldRef<"Session", 'String'> + readonly expiresAt: 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 +} + +/** + * 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 +} + +/** + * 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[] +} + +/** + * 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[] +} + +/** + * 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 + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Sessions. + */ + distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[] +} + +/** + * 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 +} + +/** + * Session createMany + */ +export type SessionCreateManyArgs = { + /** + * The data used to create many Sessions. + */ + data: Prisma.SessionCreateManyInput | Prisma.SessionCreateManyInput[] +} + +/** + * 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[] + /** + * 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 +} + +/** + * 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 +} + +/** + * 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 +} + +/** + * 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/server/prisma/generated-client/models/User.ts b/server/prisma/generated-client/models/User.ts new file mode 100644 index 0000000..79bc323 --- /dev/null +++ b/server/prisma/generated-client/models/User.ts @@ -0,0 +1,1602 @@ + +/* !!! 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * 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 + username: string | null + password: string | null + displayName: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type UserMaxAggregateOutputType = { + id: string | null + username: string | null + password: string | null + displayName: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type UserCountAggregateOutputType = { + id: number + username: number + password: number + displayName: number + createdAt: number + updatedAt: number + _all: number +} + + +export type UserMinAggregateInputType = { + id?: true + username?: true + password?: true + displayName?: true + createdAt?: true + updatedAt?: true +} + +export type UserMaxAggregateInputType = { + id?: true + username?: true + password?: true + displayName?: true + createdAt?: true + updatedAt?: true +} + +export type UserCountAggregateInputType = { + id?: true + username?: true + password?: true + displayName?: 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 + username: string + password: string + displayName: string + createdAt: Date + updatedAt: Date + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export 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 + username?: Prisma.StringFilter<"User"> | string + password?: Prisma.StringFilter<"User"> | string + displayName?: Prisma.StringFilter<"User"> | string + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + Session?: Prisma.SessionListRelationFilter + UserPreferences?: Prisma.XOR | null + Messages?: Prisma.MessageListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + password?: Prisma.SortOrder + displayName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + Session?: Prisma.SessionOrderByRelationAggregateInput + UserPreferences?: Prisma.UserPreferencesOrderByWithRelationInput + Messages?: Prisma.MessageOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: string + username?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + password?: Prisma.StringFilter<"User"> | string + displayName?: Prisma.StringFilter<"User"> | string + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + Session?: Prisma.SessionListRelationFilter + UserPreferences?: Prisma.XOR | null + Messages?: Prisma.MessageListRelationFilter +}, "id" | "username"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + password?: Prisma.SortOrder + displayName?: 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 + username?: Prisma.StringWithAggregatesFilter<"User"> | string + password?: Prisma.StringWithAggregatesFilter<"User"> | string + displayName?: Prisma.StringWithAggregatesFilter<"User"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string +} + +export type UserCreateInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionCreateNestedManyWithoutUserInput + UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput + Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput +} + +export type UserUncheckedCreateInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput + UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput + Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput +} + +export type UserUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUpdateManyWithoutUserNestedInput + UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput + Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput + UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput + Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput +} + +export type UserCreateManyInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type UserUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + password?: Prisma.SortOrder + displayName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + password?: Prisma.SortOrder + displayName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + password?: Prisma.SortOrder + displayName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type UserNullableScalarRelationFilter = { + is?: Prisma.UserWhereInput | null + isNot?: Prisma.UserWhereInput | null +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type UserCreateNestedOneWithoutSessionInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutSessionNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionInput + upsert?: Prisma.UserUpsertWithoutSessionInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutSessionInput> +} + +export type UserCreateNestedOneWithoutUserPreferencesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutUserPreferencesInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutUserPreferencesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutUserPreferencesInput + upsert?: Prisma.UserUpsertWithoutUserPreferencesInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutUserPreferencesInput> +} + +export type UserCreateNestedOneWithoutMessagesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneWithoutMessagesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput + upsert?: Prisma.UserUpsertWithoutMessagesInput + disconnect?: Prisma.UserWhereInput | boolean + delete?: Prisma.UserWhereInput | boolean + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutMessagesInput> +} + +export type UserCreateWithoutSessionInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput + Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput +} + +export type UserUncheckedCreateWithoutSessionInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput + Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput +} + +export type UserCreateOrConnectWithoutSessionInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutSessionInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutSessionInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutSessionInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput + Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput +} + +export type UserUncheckedUpdateWithoutSessionInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput + Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput +} + +export type UserCreateWithoutUserPreferencesInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionCreateNestedManyWithoutUserInput + Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput +} + +export type UserUncheckedCreateWithoutUserPreferencesInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput + Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput +} + +export type UserCreateOrConnectWithoutUserPreferencesInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutUserPreferencesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutUserPreferencesInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutUserPreferencesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUpdateManyWithoutUserNestedInput + Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput +} + +export type UserUncheckedUpdateWithoutUserPreferencesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput + Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput +} + +export type UserCreateWithoutMessagesInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionCreateNestedManyWithoutUserInput + UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput +} + +export type UserUncheckedCreateWithoutMessagesInput = { + id?: string + username: string + password: string + displayName: string + createdAt?: Date | string + updatedAt?: Date | string + Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput + UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput +} + +export type UserCreateOrConnectWithoutMessagesInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutMessagesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutMessagesInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutMessagesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUpdateManyWithoutUserNestedInput + UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput +} + +export type UserUncheckedUpdateWithoutMessagesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + password?: Prisma.StringFieldUpdateOperationsInput | string + displayName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput + UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + Session: number + Messages: number +} + +export type UserCountOutputTypeSelect = { + Session?: boolean | UserCountOutputTypeCountSessionArgs + Messages?: boolean | UserCountOutputTypeCountMessagesArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountSessionArgs = { + where?: Prisma.SessionWhereInput +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountMessagesArgs = { + where?: Prisma.MessageWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + username?: boolean + password?: boolean + displayName?: boolean + createdAt?: boolean + updatedAt?: boolean + Session?: boolean | Prisma.User$SessionArgs + UserPreferences?: boolean | Prisma.User$UserPreferencesArgs + Messages?: boolean | Prisma.User$MessagesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + username?: boolean + password?: boolean + displayName?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + username?: boolean + password?: boolean + displayName?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + username?: boolean + password?: boolean + displayName?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "username" | "password" | "displayName" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]> +export type UserInclude = { + Session?: boolean | Prisma.User$SessionArgs + UserPreferences?: boolean | Prisma.User$UserPreferencesArgs + Messages?: boolean | Prisma.User$MessagesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + Session: Prisma.$SessionPayload[] + UserPreferences: Prisma.$UserPreferencesPayload | null + Messages: Prisma.$MessagePayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + username: string + password: string + displayName: string + 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" + Session = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + UserPreferences = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserPreferencesClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + Messages = {}>(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 username: Prisma.FieldRef<"User", 'String'> + readonly password: Prisma.FieldRef<"User", 'String'> + readonly displayName: 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 +} + +/** + * 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 +} + +/** + * 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[] +} + +/** + * 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[] +} + +/** + * 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 + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * 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 +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] +} + +/** + * 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[] +} + +/** + * 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 +} + +/** + * 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 +} + +/** + * 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 +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.Session + */ +export type User$SessionArgs = { + /** + * 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.UserPreferences + */ +export type User$UserPreferencesArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + where?: Prisma.UserPreferencesWhereInput +} + +/** + * User.Messages + */ +export type User$MessagesArgs = { + /** + * Select specific fields to fetch from the Message + */ + select?: Prisma.MessageSelect | null + /** + * Omit specific fields from the Message + */ + omit?: Prisma.MessageOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MessageInclude | null + where?: Prisma.MessageWhereInput + orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[] + cursor?: Prisma.MessageWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.MessageScalarFieldEnum | Prisma.MessageScalarFieldEnum[] +} + +/** + * 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/server/prisma/generated-client/models/UserPreferences.ts b/server/prisma/generated-client/models/UserPreferences.ts new file mode 100644 index 0000000..32e3c70 --- /dev/null +++ b/server/prisma/generated-client/models/UserPreferences.ts @@ -0,0 +1,1233 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `UserPreferences` 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.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model UserPreferences + * + */ +export type UserPreferencesModel = runtime.Types.Result.DefaultSelection + +export type AggregateUserPreferences = { + _count: UserPreferencesCountAggregateOutputType | null + _min: UserPreferencesMinAggregateOutputType | null + _max: UserPreferencesMaxAggregateOutputType | null +} + +export type UserPreferencesMinAggregateOutputType = { + userId: string | null + toggleInputHotkey: string | null + toggleOutputHotkey: string | null +} + +export type UserPreferencesMaxAggregateOutputType = { + userId: string | null + toggleInputHotkey: string | null + toggleOutputHotkey: string | null +} + +export type UserPreferencesCountAggregateOutputType = { + userId: number + toggleInputHotkey: number + toggleOutputHotkey: number + _all: number +} + + +export type UserPreferencesMinAggregateInputType = { + userId?: true + toggleInputHotkey?: true + toggleOutputHotkey?: true +} + +export type UserPreferencesMaxAggregateInputType = { + userId?: true + toggleInputHotkey?: true + toggleOutputHotkey?: true +} + +export type UserPreferencesCountAggregateInputType = { + userId?: true + toggleInputHotkey?: true + toggleOutputHotkey?: true + _all?: true +} + +export type UserPreferencesAggregateArgs = { + /** + * Filter which UserPreferences to aggregate. + */ + where?: Prisma.UserPreferencesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserPreferences to fetch. + */ + orderBy?: Prisma.UserPreferencesOrderByWithRelationInput | Prisma.UserPreferencesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserPreferencesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserPreferences 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` UserPreferences. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned UserPreferences + **/ + _count?: true | UserPreferencesCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserPreferencesMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserPreferencesMaxAggregateInputType +} + +export type GetUserPreferencesAggregateType = { + [P in keyof T & keyof AggregateUserPreferences]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserPreferencesGroupByArgs = { + where?: Prisma.UserPreferencesWhereInput + orderBy?: Prisma.UserPreferencesOrderByWithAggregationInput | Prisma.UserPreferencesOrderByWithAggregationInput[] + by: Prisma.UserPreferencesScalarFieldEnum[] | Prisma.UserPreferencesScalarFieldEnum + having?: Prisma.UserPreferencesScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserPreferencesCountAggregateInputType | true + _min?: UserPreferencesMinAggregateInputType + _max?: UserPreferencesMaxAggregateInputType +} + +export type UserPreferencesGroupByOutputType = { + userId: string + toggleInputHotkey: string | null + toggleOutputHotkey: string | null + _count: UserPreferencesCountAggregateOutputType | null + _min: UserPreferencesMinAggregateOutputType | null + _max: UserPreferencesMaxAggregateOutputType | null +} + +export type GetUserPreferencesGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserPreferencesGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserPreferencesWhereInput = { + AND?: Prisma.UserPreferencesWhereInput | Prisma.UserPreferencesWhereInput[] + OR?: Prisma.UserPreferencesWhereInput[] + NOT?: Prisma.UserPreferencesWhereInput | Prisma.UserPreferencesWhereInput[] + userId?: Prisma.StringFilter<"UserPreferences"> | string + toggleInputHotkey?: Prisma.StringNullableFilter<"UserPreferences"> | string | null + toggleOutputHotkey?: Prisma.StringNullableFilter<"UserPreferences"> | string | null + user?: Prisma.XOR +} + +export type UserPreferencesOrderByWithRelationInput = { + userId?: Prisma.SortOrder + toggleInputHotkey?: Prisma.SortOrderInput | Prisma.SortOrder + toggleOutputHotkey?: Prisma.SortOrderInput | Prisma.SortOrder + user?: Prisma.UserOrderByWithRelationInput +} + +export type UserPreferencesWhereUniqueInput = Prisma.AtLeast<{ + userId?: string + AND?: Prisma.UserPreferencesWhereInput | Prisma.UserPreferencesWhereInput[] + OR?: Prisma.UserPreferencesWhereInput[] + NOT?: Prisma.UserPreferencesWhereInput | Prisma.UserPreferencesWhereInput[] + toggleInputHotkey?: Prisma.StringNullableFilter<"UserPreferences"> | string | null + toggleOutputHotkey?: Prisma.StringNullableFilter<"UserPreferences"> | string | null + user?: Prisma.XOR +}, "userId" | "userId"> + +export type UserPreferencesOrderByWithAggregationInput = { + userId?: Prisma.SortOrder + toggleInputHotkey?: Prisma.SortOrderInput | Prisma.SortOrder + toggleOutputHotkey?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserPreferencesCountOrderByAggregateInput + _max?: Prisma.UserPreferencesMaxOrderByAggregateInput + _min?: Prisma.UserPreferencesMinOrderByAggregateInput +} + +export type UserPreferencesScalarWhereWithAggregatesInput = { + AND?: Prisma.UserPreferencesScalarWhereWithAggregatesInput | Prisma.UserPreferencesScalarWhereWithAggregatesInput[] + OR?: Prisma.UserPreferencesScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserPreferencesScalarWhereWithAggregatesInput | Prisma.UserPreferencesScalarWhereWithAggregatesInput[] + userId?: Prisma.StringWithAggregatesFilter<"UserPreferences"> | string + toggleInputHotkey?: Prisma.StringNullableWithAggregatesFilter<"UserPreferences"> | string | null + toggleOutputHotkey?: Prisma.StringNullableWithAggregatesFilter<"UserPreferences"> | string | null +} + +export type UserPreferencesCreateInput = { + toggleInputHotkey?: string | null + toggleOutputHotkey?: string | null + user: Prisma.UserCreateNestedOneWithoutUserPreferencesInput +} + +export type UserPreferencesUncheckedCreateInput = { + userId: string + toggleInputHotkey?: string | null + toggleOutputHotkey?: string | null +} + +export type UserPreferencesUpdateInput = { + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + user?: Prisma.UserUpdateOneRequiredWithoutUserPreferencesNestedInput +} + +export type UserPreferencesUncheckedUpdateInput = { + userId?: Prisma.StringFieldUpdateOperationsInput | string + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserPreferencesCreateManyInput = { + userId: string + toggleInputHotkey?: string | null + toggleOutputHotkey?: string | null +} + +export type UserPreferencesUpdateManyMutationInput = { + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserPreferencesUncheckedUpdateManyInput = { + userId?: Prisma.StringFieldUpdateOperationsInput | string + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserPreferencesNullableScalarRelationFilter = { + is?: Prisma.UserPreferencesWhereInput | null + isNot?: Prisma.UserPreferencesWhereInput | null +} + +export type UserPreferencesCountOrderByAggregateInput = { + userId?: Prisma.SortOrder + toggleInputHotkey?: Prisma.SortOrder + toggleOutputHotkey?: Prisma.SortOrder +} + +export type UserPreferencesMaxOrderByAggregateInput = { + userId?: Prisma.SortOrder + toggleInputHotkey?: Prisma.SortOrder + toggleOutputHotkey?: Prisma.SortOrder +} + +export type UserPreferencesMinOrderByAggregateInput = { + userId?: Prisma.SortOrder + toggleInputHotkey?: Prisma.SortOrder + toggleOutputHotkey?: Prisma.SortOrder +} + +export type UserPreferencesCreateNestedOneWithoutUserInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserPreferencesCreateOrConnectWithoutUserInput + connect?: Prisma.UserPreferencesWhereUniqueInput +} + +export type UserPreferencesUncheckedCreateNestedOneWithoutUserInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserPreferencesCreateOrConnectWithoutUserInput + connect?: Prisma.UserPreferencesWhereUniqueInput +} + +export type UserPreferencesUpdateOneWithoutUserNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserPreferencesCreateOrConnectWithoutUserInput + upsert?: Prisma.UserPreferencesUpsertWithoutUserInput + disconnect?: Prisma.UserPreferencesWhereInput | boolean + delete?: Prisma.UserPreferencesWhereInput | boolean + connect?: Prisma.UserPreferencesWhereUniqueInput + update?: Prisma.XOR, Prisma.UserPreferencesUncheckedUpdateWithoutUserInput> +} + +export type UserPreferencesUncheckedUpdateOneWithoutUserNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserPreferencesCreateOrConnectWithoutUserInput + upsert?: Prisma.UserPreferencesUpsertWithoutUserInput + disconnect?: Prisma.UserPreferencesWhereInput | boolean + delete?: Prisma.UserPreferencesWhereInput | boolean + connect?: Prisma.UserPreferencesWhereUniqueInput + update?: Prisma.XOR, Prisma.UserPreferencesUncheckedUpdateWithoutUserInput> +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type UserPreferencesCreateWithoutUserInput = { + toggleInputHotkey?: string | null + toggleOutputHotkey?: string | null +} + +export type UserPreferencesUncheckedCreateWithoutUserInput = { + toggleInputHotkey?: string | null + toggleOutputHotkey?: string | null +} + +export type UserPreferencesCreateOrConnectWithoutUserInput = { + where: Prisma.UserPreferencesWhereUniqueInput + create: Prisma.XOR +} + +export type UserPreferencesUpsertWithoutUserInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserPreferencesWhereInput +} + +export type UserPreferencesUpdateToOneWithWhereWithoutUserInput = { + where?: Prisma.UserPreferencesWhereInput + data: Prisma.XOR +} + +export type UserPreferencesUpdateWithoutUserInput = { + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserPreferencesUncheckedUpdateWithoutUserInput = { + toggleInputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + toggleOutputHotkey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + + +export type UserPreferencesSelect = runtime.Types.Extensions.GetSelect<{ + userId?: boolean + toggleInputHotkey?: boolean + toggleOutputHotkey?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["userPreferences"]> + +export type UserPreferencesSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + userId?: boolean + toggleInputHotkey?: boolean + toggleOutputHotkey?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["userPreferences"]> + +export type UserPreferencesSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + userId?: boolean + toggleInputHotkey?: boolean + toggleOutputHotkey?: boolean + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["userPreferences"]> + +export type UserPreferencesSelectScalar = { + userId?: boolean + toggleInputHotkey?: boolean + toggleOutputHotkey?: boolean +} + +export type UserPreferencesOmit = runtime.Types.Extensions.GetOmit<"userId" | "toggleInputHotkey" | "toggleOutputHotkey", ExtArgs["result"]["userPreferences"]> +export type UserPreferencesInclude = { + user?: boolean | Prisma.UserDefaultArgs +} +export type UserPreferencesIncludeCreateManyAndReturn = { + user?: boolean | Prisma.UserDefaultArgs +} +export type UserPreferencesIncludeUpdateManyAndReturn = { + user?: boolean | Prisma.UserDefaultArgs +} + +export type $UserPreferencesPayload = { + name: "UserPreferences" + objects: { + user: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + userId: string + toggleInputHotkey: string | null + toggleOutputHotkey: string | null + }, ExtArgs["result"]["userPreferences"]> + composites: {} +} + +export type UserPreferencesGetPayload = runtime.Types.Result.GetResult + +export type UserPreferencesCountArgs = + Omit & { + select?: UserPreferencesCountAggregateInputType | true + } + +export interface UserPreferencesDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['UserPreferences'], meta: { name: 'UserPreferences' } } + /** + * Find zero or one UserPreferences that matches the filter. + * @param {UserPreferencesFindUniqueArgs} args - Arguments to find a UserPreferences + * @example + * // Get one UserPreferences + * const userPreferences = await prisma.userPreferences.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one UserPreferences that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserPreferencesFindUniqueOrThrowArgs} args - Arguments to find a UserPreferences + * @example + * // Get one UserPreferences + * const userPreferences = await prisma.userPreferences.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first UserPreferences 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 {UserPreferencesFindFirstArgs} args - Arguments to find a UserPreferences + * @example + * // Get one UserPreferences + * const userPreferences = await prisma.userPreferences.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first UserPreferences 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 {UserPreferencesFindFirstOrThrowArgs} args - Arguments to find a UserPreferences + * @example + * // Get one UserPreferences + * const userPreferences = await prisma.userPreferences.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more UserPreferences 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 {UserPreferencesFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all UserPreferences + * const userPreferences = await prisma.userPreferences.findMany() + * + * // Get first 10 UserPreferences + * const userPreferences = await prisma.userPreferences.findMany({ take: 10 }) + * + * // Only select the `userId` + * const userPreferencesWithUserIdOnly = await prisma.userPreferences.findMany({ select: { userId: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a UserPreferences. + * @param {UserPreferencesCreateArgs} args - Arguments to create a UserPreferences. + * @example + * // Create one UserPreferences + * const UserPreferences = await prisma.userPreferences.create({ + * data: { + * // ... data to create a UserPreferences + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many UserPreferences. + * @param {UserPreferencesCreateManyArgs} args - Arguments to create many UserPreferences. + * @example + * // Create many UserPreferences + * const userPreferences = await prisma.userPreferences.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many UserPreferences and returns the data saved in the database. + * @param {UserPreferencesCreateManyAndReturnArgs} args - Arguments to create many UserPreferences. + * @example + * // Create many UserPreferences + * const userPreferences = await prisma.userPreferences.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many UserPreferences and only return the `userId` + * const userPreferencesWithUserIdOnly = await prisma.userPreferences.createManyAndReturn({ + * select: { userId: 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 UserPreferences. + * @param {UserPreferencesDeleteArgs} args - Arguments to delete one UserPreferences. + * @example + * // Delete one UserPreferences + * const UserPreferences = await prisma.userPreferences.delete({ + * where: { + * // ... filter to delete one UserPreferences + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one UserPreferences. + * @param {UserPreferencesUpdateArgs} args - Arguments to update one UserPreferences. + * @example + * // Update one UserPreferences + * const userPreferences = await prisma.userPreferences.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more UserPreferences. + * @param {UserPreferencesDeleteManyArgs} args - Arguments to filter UserPreferences to delete. + * @example + * // Delete a few UserPreferences + * const { count } = await prisma.userPreferences.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more UserPreferences. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserPreferencesUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many UserPreferences + * const userPreferences = await prisma.userPreferences.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more UserPreferences and returns the data updated in the database. + * @param {UserPreferencesUpdateManyAndReturnArgs} args - Arguments to update many UserPreferences. + * @example + * // Update many UserPreferences + * const userPreferences = await prisma.userPreferences.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more UserPreferences and only return the `userId` + * const userPreferencesWithUserIdOnly = await prisma.userPreferences.updateManyAndReturn({ + * select: { userId: 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 UserPreferences. + * @param {UserPreferencesUpsertArgs} args - Arguments to update or create a UserPreferences. + * @example + * // Update or create a UserPreferences + * const userPreferences = await prisma.userPreferences.upsert({ + * create: { + * // ... data to create a UserPreferences + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the UserPreferences we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserPreferencesClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of UserPreferences. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserPreferencesCountArgs} args - Arguments to filter UserPreferences to count. + * @example + * // Count the number of UserPreferences + * const count = await prisma.userPreferences.count({ + * where: { + * // ... the filter for the UserPreferences 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 UserPreferences. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserPreferencesAggregateArgs} 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 UserPreferences. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserPreferencesGroupByArgs} 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 UserPreferencesGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserPreferencesGroupByArgs['orderBy'] } + : { orderBy?: UserPreferencesGroupByArgs['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 ? GetUserPreferencesGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the UserPreferences model + */ +readonly fields: UserPreferencesFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for UserPreferences. + * 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__UserPreferencesClient 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 UserPreferences model + */ +export interface UserPreferencesFieldRefs { + readonly userId: Prisma.FieldRef<"UserPreferences", 'String'> + readonly toggleInputHotkey: Prisma.FieldRef<"UserPreferences", 'String'> + readonly toggleOutputHotkey: Prisma.FieldRef<"UserPreferences", 'String'> +} + + +// Custom InputTypes +/** + * UserPreferences findUnique + */ +export type UserPreferencesFindUniqueArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter, which UserPreferences to fetch. + */ + where: Prisma.UserPreferencesWhereUniqueInput +} + +/** + * UserPreferences findUniqueOrThrow + */ +export type UserPreferencesFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter, which UserPreferences to fetch. + */ + where: Prisma.UserPreferencesWhereUniqueInput +} + +/** + * UserPreferences findFirst + */ +export type UserPreferencesFindFirstArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter, which UserPreferences to fetch. + */ + where?: Prisma.UserPreferencesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserPreferences to fetch. + */ + orderBy?: Prisma.UserPreferencesOrderByWithRelationInput | Prisma.UserPreferencesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserPreferences. + */ + cursor?: Prisma.UserPreferencesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserPreferences 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` UserPreferences. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserPreferences. + */ + distinct?: Prisma.UserPreferencesScalarFieldEnum | Prisma.UserPreferencesScalarFieldEnum[] +} + +/** + * UserPreferences findFirstOrThrow + */ +export type UserPreferencesFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter, which UserPreferences to fetch. + */ + where?: Prisma.UserPreferencesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserPreferences to fetch. + */ + orderBy?: Prisma.UserPreferencesOrderByWithRelationInput | Prisma.UserPreferencesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserPreferences. + */ + cursor?: Prisma.UserPreferencesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserPreferences 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` UserPreferences. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserPreferences. + */ + distinct?: Prisma.UserPreferencesScalarFieldEnum | Prisma.UserPreferencesScalarFieldEnum[] +} + +/** + * UserPreferences findMany + */ +export type UserPreferencesFindManyArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter, which UserPreferences to fetch. + */ + where?: Prisma.UserPreferencesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserPreferences to fetch. + */ + orderBy?: Prisma.UserPreferencesOrderByWithRelationInput | Prisma.UserPreferencesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing UserPreferences. + */ + cursor?: Prisma.UserPreferencesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserPreferences 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` UserPreferences. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserPreferences. + */ + distinct?: Prisma.UserPreferencesScalarFieldEnum | Prisma.UserPreferencesScalarFieldEnum[] +} + +/** + * UserPreferences create + */ +export type UserPreferencesCreateArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * The data needed to create a UserPreferences. + */ + data: Prisma.XOR +} + +/** + * UserPreferences createMany + */ +export type UserPreferencesCreateManyArgs = { + /** + * The data used to create many UserPreferences. + */ + data: Prisma.UserPreferencesCreateManyInput | Prisma.UserPreferencesCreateManyInput[] +} + +/** + * UserPreferences createManyAndReturn + */ +export type UserPreferencesCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelectCreateManyAndReturn | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * The data used to create many UserPreferences. + */ + data: Prisma.UserPreferencesCreateManyInput | Prisma.UserPreferencesCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesIncludeCreateManyAndReturn | null +} + +/** + * UserPreferences update + */ +export type UserPreferencesUpdateArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * The data needed to update a UserPreferences. + */ + data: Prisma.XOR + /** + * Choose, which UserPreferences to update. + */ + where: Prisma.UserPreferencesWhereUniqueInput +} + +/** + * UserPreferences updateMany + */ +export type UserPreferencesUpdateManyArgs = { + /** + * The data used to update UserPreferences. + */ + data: Prisma.XOR + /** + * Filter which UserPreferences to update + */ + where?: Prisma.UserPreferencesWhereInput + /** + * Limit how many UserPreferences to update. + */ + limit?: number +} + +/** + * UserPreferences updateManyAndReturn + */ +export type UserPreferencesUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * The data used to update UserPreferences. + */ + data: Prisma.XOR + /** + * Filter which UserPreferences to update + */ + where?: Prisma.UserPreferencesWhereInput + /** + * Limit how many UserPreferences to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesIncludeUpdateManyAndReturn | null +} + +/** + * UserPreferences upsert + */ +export type UserPreferencesUpsertArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * The filter to search for the UserPreferences to update in case it exists. + */ + where: Prisma.UserPreferencesWhereUniqueInput + /** + * In case the UserPreferences found by the `where` argument doesn't exist, create a new UserPreferences with this data. + */ + create: Prisma.XOR + /** + * In case the UserPreferences was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * UserPreferences delete + */ +export type UserPreferencesDeleteArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null + /** + * Filter which UserPreferences to delete. + */ + where: Prisma.UserPreferencesWhereUniqueInput +} + +/** + * UserPreferences deleteMany + */ +export type UserPreferencesDeleteManyArgs = { + /** + * Filter which UserPreferences to delete + */ + where?: Prisma.UserPreferencesWhereInput + /** + * Limit how many UserPreferences to delete. + */ + limit?: number +} + +/** + * UserPreferences without action + */ +export type UserPreferencesDefaultArgs = { + /** + * Select specific fields to fetch from the UserPreferences + */ + select?: Prisma.UserPreferencesSelect | null + /** + * Omit specific fields from the UserPreferences + */ + omit?: Prisma.UserPreferencesOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserPreferencesInclude | null +} diff --git a/server/prisma/migrations/20260423085538_attachment/migration.sql b/server/prisma/migrations/20260423085538_attachment/migration.sql new file mode 100644 index 0000000..ac8db82 --- /dev/null +++ b/server/prisma/migrations/20260423085538_attachment/migration.sql @@ -0,0 +1,28 @@ +/* + Warnings: + + - You are about to drop the column `volumes` on the `UserPreferences` table. All the data in the column will be lost. + +*/ +-- CreateTable +CREATE TABLE "Attachment" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "mimetype" TEXT NOT NULL, + "size" INTEGER NOT NULL +); + +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_UserPreferences" ( + "userId" TEXT NOT NULL PRIMARY KEY, + "toggleInputHotkey" TEXT DEFAULT '', + "toggleOutputHotkey" TEXT DEFAULT '', + CONSTRAINT "UserPreferences_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); +INSERT INTO "new_UserPreferences" ("toggleInputHotkey", "toggleOutputHotkey", "userId") SELECT "toggleInputHotkey", "toggleOutputHotkey", "userId" FROM "UserPreferences"; +DROP TABLE "UserPreferences"; +ALTER TABLE "new_UserPreferences" RENAME TO "UserPreferences"; +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/server/prisma/migrations/20260423092603_attachment_created_at/migration.sql b/server/prisma/migrations/20260423092603_attachment_created_at/migration.sql new file mode 100644 index 0000000..a8e80c6 --- /dev/null +++ b/server/prisma/migrations/20260423092603_attachment_created_at/migration.sql @@ -0,0 +1,15 @@ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_Attachment" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "mimetype" TEXT NOT NULL, + "size" INTEGER NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +); +INSERT INTO "new_Attachment" ("id", "mimetype", "name", "size") SELECT "id", "mimetype", "name", "size" FROM "Attachment"; +DROP TABLE "Attachment"; +ALTER TABLE "new_Attachment" RENAME TO "Attachment"; +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/server/prisma/migrations/20260423122556_mandatory_user_preferences/migration.sql b/server/prisma/migrations/20260423122556_mandatory_user_preferences/migration.sql new file mode 100644 index 0000000..2a3cc31 --- /dev/null +++ b/server/prisma/migrations/20260423122556_mandatory_user_preferences/migration.sql @@ -0,0 +1,27 @@ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_User" ( + "id" TEXT NOT NULL PRIMARY KEY, + "username" TEXT NOT NULL, + "password" TEXT NOT NULL, + "displayName" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL, + CONSTRAINT "User_id_fkey" FOREIGN KEY ("id") REFERENCES "UserPreferences" ("userId") ON DELETE CASCADE ON UPDATE CASCADE +); +INSERT INTO "new_User" ("createdAt", "displayName", "id", "password", "updatedAt", "username") SELECT "createdAt", "displayName", "id", "password", "updatedAt", "username" FROM "User"; +DROP TABLE "User"; +ALTER TABLE "new_User" RENAME TO "User"; +CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); +CREATE TABLE "new_UserPreferences" ( + "userId" TEXT NOT NULL PRIMARY KEY, + "toggleInputHotkey" TEXT DEFAULT '', + "toggleOutputHotkey" TEXT DEFAULT '' +); +INSERT INTO "new_UserPreferences" ("toggleInputHotkey", "toggleOutputHotkey", "userId") SELECT "toggleInputHotkey", "toggleOutputHotkey", "userId" FROM "UserPreferences"; +DROP TABLE "UserPreferences"; +ALTER TABLE "new_UserPreferences" RENAME TO "UserPreferences"; +CREATE UNIQUE INDEX "UserPreferences_userId_key" ON "UserPreferences"("userId"); +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/server/prisma/migrations/20260423124042_rollback_mandatory_user_preferences/migration.sql b/server/prisma/migrations/20260423124042_rollback_mandatory_user_preferences/migration.sql new file mode 100644 index 0000000..1f8cc6a --- /dev/null +++ b/server/prisma/migrations/20260423124042_rollback_mandatory_user_preferences/migration.sql @@ -0,0 +1,27 @@ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_User" ( + "id" TEXT NOT NULL PRIMARY KEY, + "username" TEXT NOT NULL, + "password" TEXT NOT NULL, + "displayName" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL +); +INSERT INTO "new_User" ("createdAt", "displayName", "id", "password", "updatedAt", "username") SELECT "createdAt", "displayName", "id", "password", "updatedAt", "username" FROM "User"; +DROP TABLE "User"; +ALTER TABLE "new_User" RENAME TO "User"; +CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); +CREATE TABLE "new_UserPreferences" ( + "userId" TEXT NOT NULL PRIMARY KEY, + "toggleInputHotkey" TEXT DEFAULT '', + "toggleOutputHotkey" TEXT DEFAULT '', + CONSTRAINT "UserPreferences_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); +INSERT INTO "new_UserPreferences" ("toggleInputHotkey", "toggleOutputHotkey", "userId") SELECT "toggleInputHotkey", "toggleOutputHotkey", "userId" FROM "UserPreferences"; +DROP TABLE "UserPreferences"; +ALTER TABLE "new_UserPreferences" RENAME TO "UserPreferences"; +CREATE UNIQUE INDEX "UserPreferences_userId_key" ON "UserPreferences"("userId"); +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/server/prisma/migrations/20260423170214_message/migration.sql b/server/prisma/migrations/20260423170214_message/migration.sql new file mode 100644 index 0000000..25cc4b9 --- /dev/null +++ b/server/prisma/migrations/20260423170214_message/migration.sql @@ -0,0 +1,9 @@ +-- CreateTable +CREATE TABLE "Message" ( + "id" TEXT NOT NULL PRIMARY KEY, + "text" TEXT NOT NULL, + "senderId" TEXT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL, + CONSTRAINT "Message_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE +); diff --git a/server/prisma/migrations/20260424090705_message_attachment/migration.sql b/server/prisma/migrations/20260424090705_message_attachment/migration.sql new file mode 100644 index 0000000..25f393e --- /dev/null +++ b/server/prisma/migrations/20260424090705_message_attachment/migration.sql @@ -0,0 +1,9 @@ +-- CreateTable +CREATE TABLE "MessageAttachment" ( + "messageId" TEXT NOT NULL, + "attachmentId" TEXT NOT NULL, + + PRIMARY KEY ("messageId", "attachmentId"), + CONSTRAINT "MessageAttachment_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, + CONSTRAINT "MessageAttachment_attachmentId_fkey" FOREIGN KEY ("attachmentId") REFERENCES "Attachment" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); diff --git a/server/prisma/migrations/20260424153707_channel/migration.sql b/server/prisma/migrations/20260424153707_channel/migration.sql new file mode 100644 index 0000000..0776ea6 --- /dev/null +++ b/server/prisma/migrations/20260424153707_channel/migration.sql @@ -0,0 +1,6 @@ +-- CreateTable +CREATE TABLE "Channel" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "persistent" BOOLEAN NOT NULL +); diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index 8477571..f3ee444 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -1,11 +1,10 @@ datasource db { provider = "sqlite" - url = env("DATABASE_URL") } generator client { - provider = "prisma-client-js" - // output = "./generated/client" + provider = "prisma-client" + output = "./generated-client" } model User { @@ -18,6 +17,7 @@ model User { Session Session[] UserPreferences UserPreferences? + Messages Message[] } model Session { @@ -25,16 +25,52 @@ model Session { userId String expiresAt DateTime - user User @relation(references: [id], fields: [userId], onDelete: Cascade) + user User @relation(references: [id], fields: [userId], onDelete: Cascade) @@index([userId]) } model UserPreferences { - userId String @id + userId String @id @unique toggleInputHotkey String? @default("") toggleOutputHotkey String? @default("") - volumes Json? @default("{}") - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + user User @relation(references: [id], fields: [userId], onDelete: Cascade) +} + +model Attachment { + id String @id @default(uuid()) + name String + mimetype String + size Int + createdAt DateTime @default(now()) + + message MessageAttachment[] +} + +model Message { + id String @id @default(uuid()) + text String + senderId String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + sender User? @relation(references: [id], fields: [senderId], onDelete: SetNull) + attachments MessageAttachment[] +} + +model MessageAttachment { + messageId String + attachmentId String + + message Message @relation(fields: [messageId], references: [id]) + attachment Attachment @relation(fields: [attachmentId], references: [id]) + + @@id([messageId, attachmentId]) +} + +model Channel { + id String @id @default(uuid()) + name String + persistent Boolean } \ No newline at end of file diff --git a/server/prisma/seed.ts b/server/prisma/seed.ts new file mode 100644 index 0000000..fadf209 --- /dev/null +++ b/server/prisma/seed.ts @@ -0,0 +1,33 @@ +import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3' +import { PrismaClient } from './generated-client/client.ts' +import 'dotenv/config' + +const prisma = new PrismaClient({ + adapter: new PrismaBetterSqlite3({ + url: process.env.DATABASE_URL!, + }), +}) +async function main() { + const _now = new Date() + + await prisma.channel.upsert({ + where: { id: 'default' }, + create: { + id: 'default', + name: 'Default channel', + persistent: true, + }, + update: { + persistent: true, + }, + }) +} +main() + .then(async () => { + await prisma.$disconnect() + }) + .catch(async (e) => { + console.error(e) + await prisma.$disconnect() + process.exit(1) + }) diff --git a/server/routes/attachment.ts b/server/routes/attachment.ts new file mode 100644 index 0000000..a18ac18 --- /dev/null +++ b/server/routes/attachment.ts @@ -0,0 +1,96 @@ +import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' +import * as fs from 'node:fs' +import * as path from 'node:path' +import { Type } from 'typebox' + +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + const uploadDir = path.join(process.cwd(), 'uploads') + + if (!fs.existsSync(uploadDir)) { + fs.mkdirSync(uploadDir, { recursive: true }) + } + + fastify.post( + '/attachment/upload', + { + schema: { + summary: 'Upload attachment', + tags: ['Attachment'], + operationId: 'attachment.upload', + description: 'Pass file to multipart/form-data', + response: { + 200: Type.String({ format: 'uuid', description: 'Attachment UUID' }), + }, + }, + }, + async (req, reply) => { + const data = await req.file() + + if (!data) { + return reply.notAcceptable() + } + + const meta = await fastify.prisma.attachment.create({ + data: { + name: data.filename, + mimetype: data.mimetype, + size: 0, + }, + }) + + if (!meta) { + return reply.notAcceptable() + } + + const filePath = path.join(process.cwd(), 'uploads', meta.id) + + await new Promise((resolve, reject) => { + const writeStream = fs.createWriteStream(filePath) + data.file.pipe(writeStream) + data.file.on('end', resolve) + data.file.on('error', reject) + }) + + return meta.id + }, + ) + + fastify.get( + '/attachment/:id', + { + schema: { + summary: 'Get attachment', + tags: ['Attachment'], + operationId: 'attachment.get', + params: Type.Object({ + id: Type.String({ format: 'uuid' }), + }), + response: { + 200: Type.Any({ description: 'Attachment content' }), + }, + }, + config: { + skipAuth: true, + }, + }, + async (req, reply) => { + const meta = await fastify.prisma.attachment.findFirst({ + where: { id: req.params.id }, + }) + + if (!meta) { + return reply.notFound('Attachment not found') + } + + const filePath = path.join(process.cwd(), 'uploads', meta.id) + + reply.type(meta.mimetype) + reply.header('Cache-Control', 'public, max-age=31536000') + reply.header('Content-Disposition', `inline; filename="${meta.name}"`) + + return fs.createReadStream(filePath) + }, + ) +} + +export default plugin diff --git a/server/routes/attachments.ts b/server/routes/attachments.ts deleted file mode 100644 index 6f4f806..0000000 --- a/server/routes/attachments.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { FastifyInstance } from 'fastify' -import bcrypt from 'bcrypt' -import { z } from 'zod' - -export default function (fastify: FastifyInstance) { - fastify.post('/attachments/upload', async (req, reply) => { - try { - const schema = z.object({ - file: z.file(), - }) - const input = schema.parse(req.body) - - // const file = req.file({ limits: { } }) - - const id = await bcrypt.hash(input.file, 10) - - return { - id, - } - } - catch (err) { - fastify.log.error(err) - reply.code(400) - - if (err instanceof z.ZodError) { - reply.send({ error: z.prettifyError(err) }) - } - else { - reply.send({ error: err.message }) - } - } - }) -} diff --git a/server/routes/auth.ts b/server/routes/auth.ts index 8cfdf1a..a1c798f 100644 --- a/server/routes/auth.ts +++ b/server/routes/auth.ts @@ -1,118 +1,146 @@ -import type { FastifyInstance } from 'fastify' +import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' import bcrypt from 'bcrypt' -import { z } from 'zod' -import { auth } from '../auth/lucia.ts' -import prisma from '../prisma/client.ts' +import { Type } from 'typebox' +import { CreateUserSchema, UserSchema } from '../schemas/auth.ts' -export default function (fastify: FastifyInstance) { - fastify.post('/register', async (req, reply) => { - try { - const schema = z.object({ - username: z.string().min(1), - password: z.string().min(6), - }) - const input = schema.parse(req.body) - - const hashed = await bcrypt.hash(input.password, 10) - const user = await prisma.user.create({ +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.post( + '/auth/register', + { + schema: { + summary: 'Register', + tags: ['Auth'], + operationId: 'auth.register', + body: CreateUserSchema, + response: { + 200: UserSchema, + }, + }, + config: { + skipAuth: true, + }, + }, + async (req, reply) => { + const hashed = await bcrypt.hash(req.body.password, 10) + const user = await fastify.prisma.user.create({ data: { - username: input.username, + username: req.body.username, password: hashed, - displayName: input.username, + displayName: req.body.username, + UserPreferences: { + create: {}, + }, }, }) - const session = await auth.createSession(user.id, {}) - const cookie = auth.createSessionCookie(session.id) + const session = await fastify.lucia.createSession(user.id, {}) + const cookie = fastify.lucia.createSessionCookie(session.id) reply.setCookie(cookie.name, cookie.value, cookie.attributes) return { id: user.id, username: user.username, - displayName: user.displayName, + displayName: user.username, + createdAt: user.createdAt.toISOString(), } - } - catch (err) { - fastify.log.error(err) - reply.code(400) + }, + ) - if (err instanceof z.ZodError) { - reply.send({ error: z.prettifyError(err) }) - } - else { - reply.send({ error: err.message }) - } - } - }) - - fastify.post('/login', async (req, reply) => { - try { - const schema = z.object({ - username: z.string().min(1), - password: z.string(), - }) - const input = schema.parse(req.body) - - const user = await prisma.user.findFirst({ - where: { username: input.username }, + fastify.post( + '/auth/login', + { + schema: { + summary: 'Login', + tags: ['Auth'], + operationId: 'auth.login', + body: Type.Object({ + username: Type.String({ minLength: 1 }), + password: Type.String({ minLength: 1 }), + }), + response: { + 200: UserSchema, + }, + }, + config: { + skipAuth: true, + }, + }, + async (req, reply) => { + const user = await fastify.prisma.user.findFirst({ + where: { username: req.body.username }, + select: { + id: true, + username: true, + displayName: true, + createdAt: true, + password: true, + }, }) if (!user) { - return reply.code(404).send({ error: 'Incorrect username or password' }) + return reply.notFound('Incorrect username or password') } - const validPassword = await bcrypt.compare(input.password, user.password) + const validPassword = await bcrypt.compare(req.body.password, user.password) if (!validPassword) { - return reply.code(404).send({ error: 'Incorrect username or password' }) + return reply.notFound('Incorrect username or password') } - const session = await auth.createSession(user.id, {}) - const cookie = auth.createSessionCookie(session.id) + const session = await fastify.lucia.createSession(user.id, {}) + const cookie = fastify.lucia.createSessionCookie(session.id) reply.setCookie(cookie.name, cookie.value, cookie.attributes) + return { + ...user, + createdAt: user.createdAt.toISOString(), + } + }, + ) + + fastify.get( + '/auth/me', + { + schema: { + summary: 'Me', + tags: ['Auth'], + operationId: 'auth.me', + response: { + 200: UserSchema, + }, + }, + }, + async (req) => { + const user = req.user! + return { id: user.id, username: user.username, displayName: user.displayName, + createdAt: user.createdAt.toISOString(), } - } - catch (err) { - fastify.log.error(err) - reply.code(400) + }, + ) - if (err instanceof z.ZodError) { - reply.send({ error: z.prettifyError(err) }) - } - else { - reply.send({ error: err.message }) - } - } - }) - - fastify.get('/me', async (req, reply) => { - if (req.user) { - return req.user - } - - reply.code(401).send(false) - }) - - fastify.post('/logout', async (req, reply) => { - try { + fastify.post( + '/auth/logout', + { + schema: { + summary: 'Logout', + tags: ['Auth'], + operationId: 'auth.logout', + }, + }, + async (req, reply) => { if (req.session) - await auth.invalidateSession(req.session.id) + await fastify.lucia.invalidateSession(req.session.id) - const blank = auth.createBlankSessionCookie() + const blank = fastify.lucia.createBlankSessionCookie() reply.setCookie(blank.name, blank.value, blank.attributes) - - return true - } - catch (err) { - fastify.log.error(err) - reply.code(400).send({ error: err.message }) - } - }) + }, + ) } + +export default plugin diff --git a/server/routes/chat.ts b/server/routes/chat.ts new file mode 100644 index 0000000..b5d7c12 --- /dev/null +++ b/server/routes/chat.ts @@ -0,0 +1,111 @@ +import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' +import { Type } from 'typebox' +import { ChatMessageSchema, NewChatMessageSchema } from '../schemas/chat.ts' + +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.post( + '/chat/send', + { + schema: { + summary: 'Send message', + tags: ['Chat'], + operationId: 'chat.send', + body: NewChatMessageSchema, + response: { + 200: ChatMessageSchema, + }, + }, + }, + async (req, reply) => { + const user = req.user! + + const message = await fastify.prisma.message.create({ + data: { + text: req.body.text, + senderId: user.id, + attachments: { + create: (req.body.attachments ?? []).map((attachmentId) => { + return { + attachment: { + connect: { + id: attachmentId, + }, + }, + } + }), + }, + }, + }) + + if (!message) { + return reply.unprocessableEntity() + } + + const response = { + id: message.id, + senderId: user.id, + text: message.text, + createdAt: message.createdAt.toISOString(), + updatedAt: message.updatedAt.toISOString(), + attachments: req.body.attachments ?? [], + } + + fastify.bus.emit('chat:new-message', response) + + return response + }, + ) + + fastify.get( + '/chat', + { + schema: { + summary: 'Get messages', + tags: ['Chat'], + operationId: 'chat.messages', + querystring: Type.Object({ + cursor: Type.Optional(Type.String({ format: 'uuid', description: 'Cursor to message' })), + limit: Type.Number({ minimum: 1, maximum: 100, default: 10 }), + }), + response: { + 200: Type.Object({ + messages: Type.Array(ChatMessageSchema), + nextCursor: Type.Optional(Type.String({ format: 'uuid', description: 'Cursor to last message' })), + }), + }, + }, + }, + // eslint-disable-next-line ts/ban-ts-comment + // @ts-expect-error + async (req) => { + const messages = await fastify.prisma.message.findMany({ + orderBy: { createdAt: 'desc' }, + take: req.query.limit + 1, + include: { attachments: true }, + ...(req.query.cursor && { + cursor: { + id: req.query.cursor, + }, + // skip: 1, + }), + }) + + const hasMore = messages.length > req.query.limit + const cursorMessage = hasMore ? messages.pop() : undefined + + return { + messages: messages.map((message) => { + return { + ...message, + createdAt: message.createdAt.toISOString(), + updatedAt: message.updatedAt.toISOString(), + attachments: message.attachments.map(({ attachmentId }) => attachmentId), + } + }), + nextCursor: cursorMessage?.id, + } + }, + ) +} + +export default plugin diff --git a/server/routes/user.ts b/server/routes/user.ts index 6272104..340ae9e 100644 --- a/server/routes/user.ts +++ b/server/routes/user.ts @@ -1,97 +1,158 @@ -import type { FastifyInstance } from 'fastify' -import type { Namespace } from '../types/webrtc.ts' -import { z } from 'zod' -import prisma from '../prisma/client.ts' -import { socketToClient } from '../utils/socket-to-client.ts' +import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' +import { Type } from 'typebox' +import { UserSchema } from '../schemas/auth.ts' +import { UpdateUserPreferencesSchema, UserPreferencesSchema } from '../schemas/user.ts' -export default function (fastify: FastifyInstance) { - fastify.get('/preferences', async (req, reply) => { - if (req.user) { - return prisma.userPreferences.findFirst({ where: { userId: req.user.id } }) - } - - reply.code(401).send(false) - }) - - fastify.patch('/preferences', async (req, reply) => { - if (!req.user) { - reply.code(401).send(false) - - return - } - - try { - const schema = z.object({ - toggleInputHotkey: z.string().optional(), - toggleOutputHotkey: z.string().optional(), - volumes: z.record(z.string(), z.number()).optional(), +const plugin: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.get( + '/user', + { + schema: { + summary: 'Get user', + tags: ['User'], + operationId: 'user.get', + querystring: Type.Partial(Type.Object({ + username: Type.String(), + })), + response: { + 200: UserSchema, + }, + }, + }, + async (req, reply) => { + const user = await fastify.prisma.user.findFirst({ + where: { username: req.query.username }, + select: { + id: true, + username: true, + displayName: true, + createdAt: true, + }, }) - const input = schema.parse(req.body) - return prisma.userPreferences.upsert({ - where: { userId: req.user.id }, + if (!user) { + return reply.notFound('User not found') + } + + return { + ...user, + createdAt: user.createdAt.toISOString(), + } + }, + ) + + fastify.get( + '/user/preferences', + { + schema: { + summary: 'Get preferences', + tags: ['User'], + operationId: 'user.getPreferences', + response: { + 200: UserPreferencesSchema, + }, + }, + }, + async (req, reply) => { + const user = req.user! + + const preferences = await fastify.prisma.userPreferences.upsert({ + where: { userId: user.id }, + create: { userId: user.id }, + update: {}, + }) + + if (!preferences) { + return reply.notFound('User preferences not found') + } + + return { + toggleInputHotkey: preferences.toggleInputHotkey || '', + toggleOutputHotkey: preferences.toggleOutputHotkey || '', + } + }, + ) + + fastify.patch( + '/user/preferences', + { + schema: { + summary: 'Update preferences', + tags: ['User'], + operationId: 'user.updatePreferences', + body: UpdateUserPreferencesSchema, + }, + }, + async (req) => { + const user = req.user! + + return fastify.prisma.userPreferences.upsert({ + where: { userId: user.id }, create: { - userId: req.user.id, - ...input, + userId: user.id, + ...req.body, }, - update: input, + update: req.body, }) - } - catch (err) { - fastify.log.error(err) - reply.code(400) + }, + ) - if (err instanceof z.ZodError) { - reply.send({ error: z.prettifyError(err) }) - } - else { - reply.send({ error: err.message }) - } - } - }) + fastify.patch( + '/profile', + { + schema: { + summary: 'Update profile', + tags: ['User'], + operationId: 'user.updateProfile', + body: Type.Object({ + displayName: Type.String(), + }), + response: { + 200: UserSchema, + }, + }, + }, + async (req, reply) => { + const user = req.user! - fastify.patch('/profile', async (req, reply) => { - if (!req.user) { - reply.code(401).send(false) - - return - } - - try { - const schema = z.object({ - displayName: z.string().optional(), - }) - const input = schema.parse(req.body) - - const updatedUser = prisma.user.update({ - where: { id: req.user.id }, + const updatedUser = await fastify.prisma.user.update({ + where: { id: user.id }, data: { - displayName: input.displayName, + displayName: req.body.displayName, + }, + select: { + id: true, + username: true, + displayName: true, + createdAt: true, }, }) - const namespace: Namespace = fastify.io.of('/webrtc') - const sockets = await namespace.fetchSockets() - - const found = sockets.find(socket => socket.data.joined && socket.data.userId === req.user!.id) - - if (found) { - found.data.displayName = input.displayName - namespace.emit('clientChanged', found.id, socketToClient(found)) + if (!updatedUser) { + return reply.notFound('User not found') } - return updatedUser - } - catch (err) { - fastify.log.error(err) - reply.code(400) + const response = { + ...updatedUser, + createdAt: updatedUser.createdAt.toISOString(), + } - if (err instanceof z.ZodError) { - reply.send({ error: z.prettifyError(err) }) - } - else { - reply.send({ error: err.message }) - } - } - }) + fastify.bus.emit('user:profile-updated', response) + + // TODO: подписаться в webrtc + // const namespace: Namespace = fastify.io.of('/webrtc') + // const sockets = await namespace.fetchSockets() + // + // const found = sockets.find(socket => socket.data.joined && socket.data.userId === req.user!.id) + // + // if (found) { + // found.data.displayName = req.body.displayName + // namespace.emit('clientChanged', found.id, socketToClient(found)) + // } + + return response + }, + ) } + +export default plugin diff --git a/server/schemas/attachment.ts b/server/schemas/attachment.ts new file mode 100644 index 0000000..25bdf36 --- /dev/null +++ b/server/schemas/attachment.ts @@ -0,0 +1,11 @@ +import { Type } from 'typebox' + +export const AttachmentSchema = Type.Object({ + id: Type.String(), + name: Type.String(), + mimetype: Type.String(), + size: Type.Number({ minimum: 0 }), + createdAt: Type.String({ format: 'date-time' }), + + // message: Type.MessageAttachment(), +}, { title: 'Attachment', description: 'Attachment' }) diff --git a/server/schemas/auth.ts b/server/schemas/auth.ts new file mode 100644 index 0000000..84a86a1 --- /dev/null +++ b/server/schemas/auth.ts @@ -0,0 +1,13 @@ +import { Type } from 'typebox' + +export const UserSchema = Type.Object({ + id: Type.String(), + username: Type.String(), + displayName: Type.String(), + createdAt: Type.String({ format: 'date-time' }), +}, { title: 'User', description: 'User' }) + +export const CreateUserSchema = Type.Object({ + username: Type.String({ minLength: 1 }), + password: Type.String({ minLength: 6 }), +}, { title: 'CreateUser' }) diff --git a/server/schemas/chat.ts b/server/schemas/chat.ts new file mode 100644 index 0000000..2b2da65 --- /dev/null +++ b/server/schemas/chat.ts @@ -0,0 +1,26 @@ +import { Type } from 'typebox' + +export const ReplySchema = Type.Object({ + messageId: Type.String({ format: 'uuid' }), + senderId: Type.String({ format: 'uuid' }), + text: Type.String(), +}, { title: 'Reply', description: 'Reply' }) + +export const ChatMessageSchema = Type.Object({ + id: Type.String({ format: 'uuid' }), + senderId: Type.String({ format: 'uuid' }), + text: Type.String({ minLength: 1 }), + createdAt: Type.String({ format: 'date-time' }), + updatedAt: Type.String({ format: 'date-time' }), + + attachments: Type.Array(Type.String({ format: 'uuid' })), + // replyTo: ReplySchema, +}, { title: 'ChatMessage', description: 'ChatMessage' }) + +export const NewChatMessageSchema = Type.Object({ + text: Type.String({ minLength: 1 }), + attachments: Type.Optional(Type.Array(Type.String({ format: 'uuid' }))), + // replyTo: Type.Object({ + // messageId: Type.String({ format: 'uuid' }), + // }), +}, { title: 'NewChatMessage', description: 'NewChatMessage' }) diff --git a/server/schemas/common.ts b/server/schemas/common.ts new file mode 100644 index 0000000..141197d --- /dev/null +++ b/server/schemas/common.ts @@ -0,0 +1,7 @@ +import { Type } from 'typebox' + +export const ErrorReplySchema = Type.Object({ + statusCode: Type.Number(), + error: Type.String(), + message: Type.String(), +}, { title: 'ResponseError', description: 'Response Error' }) diff --git a/server/schemas/user.ts b/server/schemas/user.ts new file mode 100644 index 0000000..f9c0a5e --- /dev/null +++ b/server/schemas/user.ts @@ -0,0 +1,11 @@ +import { Type } from 'typebox' + +export const UserPreferencesSchema = Type.Object({ + toggleInputHotkey: Type.String(), + toggleOutputHotkey: Type.String(), +}, { title: 'UserPreferences', description: 'UserPreferences' }) + +export const UpdateUserPreferencesSchema = Type.Partial( + UserPreferencesSchema, + { title: 'UpdateUserPreferences', description: 'UpdateUserPreferences' }, +) diff --git a/server/server.ts b/server/server.ts index 18a60a8..6a6242c 100644 --- a/server/server.ts +++ b/server/server.ts @@ -1,19 +1,80 @@ +import type { TypeBoxTypeProvider } from '@fastify/type-provider-typebox' import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' import FastifyAutoLoad from '@fastify/autoload' import FastifyCookie from '@fastify/cookie' import FastifyCors from '@fastify/cors' import FastifyMultipart from '@fastify/multipart' +import FastifySensible from '@fastify/sensible' +import FastifySwagger from '@fastify/swagger' +import FastifyApiReference from '@scalar/fastify-api-reference' import Fastify from 'fastify' -import prisma from './prisma/client.ts' - -console.log(process.env.DATABASE_URL) +import { Prisma } from './prisma/generated-client/client.ts' +import { ErrorReplySchema } from './schemas/common.ts' +import 'dotenv/config' const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) const fastify = Fastify({ logger: true, +}).withTypeProvider() + +fastify.register(FastifySensible) + +fastify.setErrorHandler((error, request, reply) => { + if (error instanceof Prisma.PrismaClientValidationError) { + reply.notAcceptable() + + return + } + + if (error.statusCode) { + reply.getHttpError(error.statusCode, error.message) + + return + } + + reply.badRequest(error.message) +}) + +fastify.register(FastifySwagger, { + openapi: { + info: { + version: '1.0.0', + title: 'Chad API', + }, + }, + transform: ({ schema, url }) => { + if (!url.startsWith('/chad')) + return { schema, url } + + const transformedSchema: typeof schema = schema ?? {} + const responseSchema: any = transformedSchema.response ?? {} + + responseSchema['4xx'] ??= ErrorReplySchema + responseSchema['5xx'] ??= ErrorReplySchema + + transformedSchema.response = responseSchema + + return { schema: transformedSchema, url } + }, +}) + +fastify.register(FastifyApiReference, { + routePrefix: '/reference', + configuration: { + showOperationId: true, + showDeveloperTools: 'never', + pageTitle: 'Chad API', + customCss: ` + .scalar-mcp-layer, + .agent-button-container, + .t-doc__sidebar > div > button:last-child { + display: none !important; + } + `, + }, }) fastify.register(FastifyCors, { @@ -44,9 +105,6 @@ fastify.register(FastifyAutoLoad, { try { await fastify.listen({ port, host: '0.0.0.0' }) - - await prisma.$connect() - fastify.log.info('Testing DB Connection. OK') } catch (err) { fastify.log.error(err) diff --git a/server/socket/chat.ts b/server/socket/chat.ts index cabbc5a..96900ac 100644 --- a/server/socket/chat.ts +++ b/server/socket/chat.ts @@ -1,28 +1,7 @@ import type { Server as SocketServer } from 'socket.io' -import type { ChatClientMessage, ChatMessage } from '../types/chat.ts' -import { v4 as uuidv4 } from 'uuid' export default async function (io: SocketServer) { - const messages: ChatMessage[] = [] - io.on('connection', async (socket) => { - socket.on('chat:message', async (clientMessage: ChatClientMessage, cb) => { - const message: ChatMessage = { - id: uuidv4(), - createdAt: new Date().toISOString(), - sender: socket.data.username, - text: clientMessage.text, - } - console.log(message) - - messages.push(message) - - if (messages.length > 5000) { - messages.shift() - } - - io.emit('chat:new-message', message) - }) }) } diff --git a/server/socket/webrtc.ts b/server/socket/webrtc.ts index c309bad..09282af 100644 --- a/server/socket/webrtc.ts +++ b/server/socket/webrtc.ts @@ -1,14 +1,14 @@ import type { types } from 'mediasoup' import type { Server as SocketServer } from 'socket.io' +import type { PrismaClient } from '../prisma/generated-client/client.ts' import type { ChadClient, SomeSocket, } from '../types/webrtc.ts' import { consola } from 'consola' -import prisma from '../prisma/client.ts' import { socketToClient } from '../utils/socket-to-client.ts' -export default async function (io: SocketServer, router: types.Router) { +export default async function (io: SocketServer, router: types.Router, prisma: PrismaClient) { const audioLevelObserver = await router.createAudioLevelObserver({ maxEntries: 10, threshold: -80, diff --git a/server/uploads/25fad78d-59b1-4e74-8a71-f1c661b3bbfe b/server/uploads/25fad78d-59b1-4e74-8a71-f1c661b3bbfe new file mode 100644 index 0000000..ae23083 Binary files /dev/null and b/server/uploads/25fad78d-59b1-4e74-8a71-f1c661b3bbfe differ diff --git a/server/uploads/6563029c-b0b4-4010-87b8-27ba0b841290 b/server/uploads/6563029c-b0b4-4010-87b8-27ba0b841290 new file mode 100644 index 0000000..0f65c84 Binary files /dev/null and b/server/uploads/6563029c-b0b4-4010-87b8-27ba0b841290 differ diff --git a/server/uploads/664e8db8-05af-465c-9bd0-d196f3dc1563 b/server/uploads/664e8db8-05af-465c-9bd0-d196f3dc1563 new file mode 100644 index 0000000..0f65c84 Binary files /dev/null and b/server/uploads/664e8db8-05af-465c-9bd0-d196f3dc1563 differ diff --git a/server/uploads/c7c0ae6d-593d-4d17-a43b-c9415d698576 b/server/uploads/c7c0ae6d-593d-4d17-a43b-c9415d698576 new file mode 100644 index 0000000..900fb94 Binary files /dev/null and b/server/uploads/c7c0ae6d-593d-4d17-a43b-c9415d698576 differ diff --git a/server/uploads/d56501cb-c6d2-4af1-88a9-5ba75479b356 b/server/uploads/d56501cb-c6d2-4af1-88a9-5ba75479b356 new file mode 100644 index 0000000..36160ce Binary files /dev/null and b/server/uploads/d56501cb-c6d2-4af1-88a9-5ba75479b356 differ diff --git a/server/yarn.lock b/server/yarn.lock index 8016aa9..f9c6ae9 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -149,6 +149,33 @@ __metadata: languageName: node linkType: hard +"@electric-sql/pglite-socket@npm:0.1.1": + version: 0.1.1 + resolution: "@electric-sql/pglite-socket@npm:0.1.1" + peerDependencies: + "@electric-sql/pglite": 0.4.1 + bin: + pglite-server: dist/scripts/server.js + checksum: 10c0/9cb0b49b8919f40fa414f2afef3a51404c98d58e77c5e73850a62ca1856692ce06818eb84062ea461eb9cea12994447c62dc81cb9eec4c926d777a120b758525 + languageName: node + linkType: hard + +"@electric-sql/pglite-tools@npm:0.3.1": + version: 0.3.1 + resolution: "@electric-sql/pglite-tools@npm:0.3.1" + peerDependencies: + "@electric-sql/pglite": 0.4.1 + checksum: 10c0/564dfc5977a409a50ce1a0761910dd34390dee7b3b32c3ea1a1229b82b064ed0e49a6b66c2051959afb595adccc3a05b54ad4e51f5d7fedc6dce7c29a61c34e7 + languageName: node + linkType: hard + +"@electric-sql/pglite@npm:0.4.1": + version: 0.4.1 + resolution: "@electric-sql/pglite@npm:0.4.1" + checksum: 10c0/42b7735cf6953804541ff308bb8c892458e4edc50975f440bab3b6ecb40a59dc67d0b59611d512d53b42f7615aa19de61d1a80be32c3443d9f5710b25f6e9110 + languageName: node + linkType: hard + "@es-joy/jsdoccomment@npm:^0.50.2": version: 0.50.2 resolution: "@es-joy/jsdoccomment@npm:0.50.2" @@ -420,6 +447,52 @@ __metadata: languageName: node linkType: hard +"@fastify/sensible@npm:^6.0.4": + version: 6.0.4 + resolution: "@fastify/sensible@npm:6.0.4" + dependencies: + "@lukeed/ms": "npm:^2.0.2" + dequal: "npm:^2.0.3" + fastify-plugin: "npm:^5.0.0" + forwarded: "npm:^0.2.0" + http-errors: "npm:^2.0.0" + type-is: "npm:^2.0.1" + vary: "npm:^1.1.2" + checksum: 10c0/036373f35c462a37557201f75c10dea22e9583922987a2cff5062a26307d18359b48a6fb43c35965e9c857924a17f9d0ef60bbc86ddff98f6df7d6f8552cb8b5 + languageName: node + linkType: hard + +"@fastify/swagger@npm:^9.7.0": + version: 9.7.0 + resolution: "@fastify/swagger@npm:9.7.0" + dependencies: + fastify-plugin: "npm:^5.0.0" + json-schema-resolver: "npm:^3.0.0" + openapi-types: "npm:^12.1.3" + rfdc: "npm:^1.3.1" + yaml: "npm:^2.4.2" + checksum: 10c0/85a7d45382f77a20064336a5053ddbf47f7b25d3cf4b9f97bf19b8682c9d5f5ec2c348829b7f8d536245cc596f3dcf75481cc910c2934e5ae1fab04f21dd4de3 + languageName: node + linkType: hard + +"@fastify/type-provider-typebox@npm:^6.1.0": + version: 6.1.0 + resolution: "@fastify/type-provider-typebox@npm:6.1.0" + peerDependencies: + typebox: ^1.0.13 + checksum: 10c0/a1411b5292bdbf48fa473650b751861b9f7a2f1b0412f442f2a5f86a1503eb39e6147829832987bf5dba3e389e47704bff92c9a669e6d4398fcb486d92f90e28 + languageName: node + linkType: hard + +"@hono/node-server@npm:1.19.11": + version: 1.19.11 + resolution: "@hono/node-server@npm:1.19.11" + peerDependencies: + hono: ^4 + checksum: 10c0/34b1c29c249c5cd95469980b5c359370f3cbab49b3603f324a4afbf895d68b8d5485c71f1887769eabeb3499276c49e7102084234b4feb3853edb748aaa85f50 + languageName: node + linkType: hard + "@humanfs/core@npm:^0.19.1": version: 0.19.1 resolution: "@humanfs/core@npm:0.19.1" @@ -498,6 +571,13 @@ __metadata: languageName: node linkType: hard +"@kurkle/color@npm:^0.3.0": + version: 0.3.4 + resolution: "@kurkle/color@npm:0.3.4" + checksum: 10c0/0e9fd55c614b005c5f0c4c755bca19ec0293bc7513b4ea3ec1725234f9c2fa81afbc78156baf555c8b9cb0d305619253c3f5bca016067daeebb3d00ebb4ea683 + languageName: node + linkType: hard + "@lucia-auth/adapter-prisma@npm:^4.0.1": version: 4.0.1 resolution: "@lucia-auth/adapter-prisma@npm:4.0.1" @@ -508,6 +588,13 @@ __metadata: languageName: node linkType: hard +"@lukeed/ms@npm:^2.0.2": + version: 2.0.2 + resolution: "@lukeed/ms@npm:2.0.2" + checksum: 10c0/843b922717313bcde4943f478145d8bc13115b9b91d83bbaed53739b5644122984412310aed574792f4e6b492f2cbda178175f601856d310f67e14834c3f17a0 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -604,76 +691,383 @@ __metadata: languageName: node linkType: hard -"@prisma/client@npm:^6.17.0": - version: 6.17.0 - resolution: "@prisma/client@npm:6.17.0" +"@prisma/adapter-better-sqlite3@npm:^7.7.0": + version: 7.7.0 + resolution: "@prisma/adapter-better-sqlite3@npm:7.7.0" + dependencies: + "@prisma/driver-adapter-utils": "npm:7.7.0" + better-sqlite3: "npm:^12.6.0" + checksum: 10c0/e9c5adfadea56b15c0731bb8c1361e20100090e952f67d1b8e37b573dd2c77324bf4af98bf3b34b1d248a35bf246b972c5ccd575359dc01cf795c738773c9676 + languageName: node + linkType: hard + +"@prisma/client-runtime-utils@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/client-runtime-utils@npm:7.7.0" + checksum: 10c0/357cc0fc2a27c7facba40f6d7fae6d82165db7d30dd9d548059553c15e873187faa8352928d5179bc05c216d7aff9dc7925db6982556778ad1bb3496ba69bdeb + languageName: node + linkType: hard + +"@prisma/client@npm:7": + version: 7.7.0 + resolution: "@prisma/client@npm:7.7.0" + dependencies: + "@prisma/client-runtime-utils": "npm:7.7.0" peerDependencies: prisma: "*" - typescript: ">=5.1.0" + typescript: ">=5.4.0" peerDependenciesMeta: prisma: optional: true typescript: optional: true - checksum: 10c0/4089fded6544df4ec3c17818a6aeb2fed555134234cd30978f27a793e382037d93d951de96c369fbef44cec261b074963150b0f4d206c81f2ad1abc95514f023 + checksum: 10c0/07437c95c72b58e6e895cda5b51c2a6d88167bbd05f4c33d820d7e6ab8eadc69a9c46d6cec339a76e5fd1a9f08905ef8066e96742a65c4a50cc43ed0c1739c1a languageName: node linkType: hard -"@prisma/config@npm:6.17.0": - version: 6.17.0 - resolution: "@prisma/config@npm:6.17.0" +"@prisma/config@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/config@npm:7.7.0" dependencies: c12: "npm:3.1.0" deepmerge-ts: "npm:7.1.5" - effect: "npm:3.16.12" + effect: "npm:3.20.0" empathic: "npm:2.0.0" - checksum: 10c0/8bcffb8b8d8e433027f3acbf2ff45ef399edaefc248ff4097f26715ad0a3082830cf7db40ea7955230985cfb67e1be4f436e8c41c56ace55a8067829b8326b24 + checksum: 10c0/24f47479a1452cf19dce11d2159734064378db54d3fb6d94a19f79f065fff03f04585b89fa34a223c96b880ea3d939ad95a17a16779c3a2cdfbb06e431aa4f5d languageName: node linkType: hard -"@prisma/debug@npm:6.17.0": - version: 6.17.0 - resolution: "@prisma/debug@npm:6.17.0" - checksum: 10c0/6a89c24083c9759adcdfa8b4f056f3f724c931e6a6f4c10653ed1d1e1d734e3cce4fb5564398085fabf500e405a45dcbb7208198dc4407d39acda718eacb902a +"@prisma/debug@npm:7.2.0": + version: 7.2.0 + resolution: "@prisma/debug@npm:7.2.0" + checksum: 10c0/eabdb738c2486abedb4abae510507166ee15dbe1d444bfc0b1406ed4c7145753ae17366cb2fef5ae70b0fa1a97de860ad69ddc3c43e3936722a9bce0aa375290 languageName: node linkType: hard -"@prisma/engines-version@npm:6.17.0-16.c0aafc03b8ef6cdced8654b9a817999e02457d6a": - version: 6.17.0-16.c0aafc03b8ef6cdced8654b9a817999e02457d6a - resolution: "@prisma/engines-version@npm:6.17.0-16.c0aafc03b8ef6cdced8654b9a817999e02457d6a" - checksum: 10c0/0ae1747e95b4cc8437fa2bc6fd068bc00fd87a2507f861f8efcd47e0bb317f50ddac77e747e02db7c00638185c6e6e8de92f9a3ba0a68f3e8f6f4926d1b64d3e +"@prisma/debug@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/debug@npm:7.7.0" + checksum: 10c0/875254a15686dd73054740c29604808163c4a4ded344be30a1ae12af433483725e436a1faff1b69525492ad72954ca4821e9fa6cad4e91882fae3f46bbfa84f1 languageName: node linkType: hard -"@prisma/engines@npm:6.17.0": - version: 6.17.0 - resolution: "@prisma/engines@npm:6.17.0" +"@prisma/dev@npm:0.24.3": + version: 0.24.3 + resolution: "@prisma/dev@npm:0.24.3" dependencies: - "@prisma/debug": "npm:6.17.0" - "@prisma/engines-version": "npm:6.17.0-16.c0aafc03b8ef6cdced8654b9a817999e02457d6a" - "@prisma/fetch-engine": "npm:6.17.0" - "@prisma/get-platform": "npm:6.17.0" - checksum: 10c0/516ddff330428ba2ad73de4fb9b0c0ea49645a396b1d82db4b988a7d0d8281a365d96058b3e41210039e2fcbd4a43ac16506b8e72b5325a8e707f68fac46df22 + "@electric-sql/pglite": "npm:0.4.1" + "@electric-sql/pglite-socket": "npm:0.1.1" + "@electric-sql/pglite-tools": "npm:0.3.1" + "@hono/node-server": "npm:1.19.11" + "@prisma/get-platform": "npm:7.2.0" + "@prisma/query-plan-executor": "npm:7.2.0" + "@prisma/streams-local": "npm:0.1.2" + foreground-child: "npm:3.3.1" + get-port-please: "npm:3.2.0" + hono: "npm:^4.12.8" + http-status-codes: "npm:2.3.0" + pathe: "npm:2.0.3" + proper-lockfile: "npm:4.1.2" + remeda: "npm:2.33.4" + std-env: "npm:3.10.0" + valibot: "npm:1.2.0" + zeptomatch: "npm:2.1.0" + checksum: 10c0/9494f86f02ce820ea959cb20ada0d462940ef212aa32c9e68556fa47271ecca14b71c3cb26a7dc477c1ae8f618156ec16dd5ab42b9d46c627240e152e0076d66 languageName: node linkType: hard -"@prisma/fetch-engine@npm:6.17.0": - version: 6.17.0 - resolution: "@prisma/fetch-engine@npm:6.17.0" +"@prisma/driver-adapter-utils@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/driver-adapter-utils@npm:7.7.0" dependencies: - "@prisma/debug": "npm:6.17.0" - "@prisma/engines-version": "npm:6.17.0-16.c0aafc03b8ef6cdced8654b9a817999e02457d6a" - "@prisma/get-platform": "npm:6.17.0" - checksum: 10c0/0a631532ff7f0b969f99784e032e49fb2509b11c6b191c8e131d73793d5f52d6ee064603195b2a6d94b0efc384e614c904aa59b6de4312d601ab7aab54a3dfbf + "@prisma/debug": "npm:7.7.0" + checksum: 10c0/7b68ae78422427b3e858ff5ffcf44e4dbfb66dcb5e69c637f9fb46ad3b6b367f36c540b754791a906c5a2bf9aa41fbb39fb9819fb4a555223532755b585130e4 languageName: node linkType: hard -"@prisma/get-platform@npm:6.17.0": - version: 6.17.0 - resolution: "@prisma/get-platform@npm:6.17.0" +"@prisma/engines-version@npm:7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711": + version: 7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711 + resolution: "@prisma/engines-version@npm:7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711" + checksum: 10c0/a0c2dc95b9956a67ddd71ceaa0116d9356210cfe82e84594785175e736ebb12ed6eed4162373803f3a023b01c1468fe330fce0597780d3b123fd023d4267e7c0 + languageName: node + linkType: hard + +"@prisma/engines@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/engines@npm:7.7.0" dependencies: - "@prisma/debug": "npm:6.17.0" - checksum: 10c0/edafada774827d95c8214f957a80772786bf29e1a7a31ba5e0e815e1339a6799121f42bd47cb20f2c5f90634b06cc4b14a27e4e92a7959f66adc254bc76c41bd + "@prisma/debug": "npm:7.7.0" + "@prisma/engines-version": "npm:7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711" + "@prisma/fetch-engine": "npm:7.7.0" + "@prisma/get-platform": "npm:7.7.0" + checksum: 10c0/ed1baad7446985434420712a4066435462d9a2a796516194c7812cbc495b808276d5f520916ba30afe32bcfeb713fafe1b0415551a2fff872e169f9b25af3031 + languageName: node + linkType: hard + +"@prisma/fetch-engine@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/fetch-engine@npm:7.7.0" + dependencies: + "@prisma/debug": "npm:7.7.0" + "@prisma/engines-version": "npm:7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711" + "@prisma/get-platform": "npm:7.7.0" + checksum: 10c0/2dd000ef78da57d5c612665e2ae280c8967270d03a8f9cce540ff0628ca2c19fb334102b1c05695571af85a43c68e3eae748700e00b8f17cf225003b30a000c6 + languageName: node + linkType: hard + +"@prisma/get-platform@npm:7.2.0": + version: 7.2.0 + resolution: "@prisma/get-platform@npm:7.2.0" + dependencies: + "@prisma/debug": "npm:7.2.0" + checksum: 10c0/8a14f19079821ebe1631e75c9905935317fd324edcfe1580a493ce6f13ed9015486c4675d8bfb066fb9c4946c8cb93fb682c54be2bd0b9f1bcfc20feadc8200f + languageName: node + linkType: hard + +"@prisma/get-platform@npm:7.7.0": + version: 7.7.0 + resolution: "@prisma/get-platform@npm:7.7.0" + dependencies: + "@prisma/debug": "npm:7.7.0" + checksum: 10c0/06007cabe48b54e8866b59d6bdfe658379a77843efdb9ddbd8b40563cc26dfb104b502d6bc65590fa036a6f309e2f9d1f787034ab03a1aeb5b95ffa0444da9bd + languageName: node + linkType: hard + +"@prisma/query-plan-executor@npm:7.2.0": + version: 7.2.0 + resolution: "@prisma/query-plan-executor@npm:7.2.0" + checksum: 10c0/24b247c39609f205a20d5b6858af9b258dec876a6027eb28f8d1c91c2213e475a7312ada3002b1c3f79732347b0ec67bbd760bc114d79fdefe052786f503bb37 + languageName: node + linkType: hard + +"@prisma/streams-local@npm:0.1.2": + version: 0.1.2 + resolution: "@prisma/streams-local@npm:0.1.2" + dependencies: + ajv: "npm:^8.12.0" + better-result: "npm:^2.7.0" + env-paths: "npm:^3.0.0" + proper-lockfile: "npm:^4.1.2" + checksum: 10c0/1f491f247d2f792cdc8ba476ee5d41b2a1f02d5d54a59c3bc612f6ffb3a853f15638ffc8341870927520b305f0a6f9591abc2e8da96b1fd14c9b403145c807c3 + languageName: node + linkType: hard + +"@prisma/studio-core@npm:0.27.3": + version: 0.27.3 + resolution: "@prisma/studio-core@npm:0.27.3" + dependencies: + "@radix-ui/react-toggle": "npm:1.1.10" + chart.js: "npm:4.5.1" + peerDependencies: + "@types/react": ^18.0.0 || ^19.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 10c0/1e9706ec2192de0b6989315ccccbf9ee9c65e94778c6c18da84ee3f402afc7f4a344cba1b9074c141e77a0c94d2198566e6dd4a68a7ba1776ab9d4ad79a77553 + languageName: node + linkType: hard + +"@radix-ui/primitive@npm:1.1.3": + version: 1.1.3 + resolution: "@radix-ui/primitive@npm:1.1.3" + checksum: 10c0/88860165ee7066fa2c179f32ffcd3ee6d527d9dcdc0e8be85e9cb0e2c84834be8e3c1a976c74ba44b193f709544e12f54455d892b28e32f0708d89deda6b9f1d + languageName: node + linkType: hard + +"@radix-ui/react-compose-refs@npm:1.1.2": + version: 1.1.2 + resolution: "@radix-ui/react-compose-refs@npm:1.1.2" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/d36a9c589eb75d634b9b139c80f916aadaf8a68a7c1c4b8c6c6b88755af1a92f2e343457042089f04cc3f23073619d08bb65419ced1402e9d4e299576d970771 + languageName: node + linkType: hard + +"@radix-ui/react-primitive@npm:2.1.3": + version: 2.1.3 + resolution: "@radix-ui/react-primitive@npm:2.1.3" + dependencies: + "@radix-ui/react-slot": "npm:1.2.3" + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 10c0/fdff9b84913bb4172ef6d3af7442fca5f9bba5f2709cba08950071f819d7057aec3a4a2d9ef44cf9cbfb8014d02573c6884a04cff175895823aaef809ebdb034 + languageName: node + linkType: hard + +"@radix-ui/react-slot@npm:1.2.3": + version: 1.2.3 + resolution: "@radix-ui/react-slot@npm:1.2.3" + dependencies: + "@radix-ui/react-compose-refs": "npm:1.1.2" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/5913aa0d760f505905779515e4b1f0f71a422350f077cc8d26d1aafe53c97f177fec0e6d7fbbb50d8b5e498aa9df9f707ca75ae3801540c283b26b0136138eef + languageName: node + linkType: hard + +"@radix-ui/react-toggle@npm:1.1.10": + version: 1.1.10 + resolution: "@radix-ui/react-toggle@npm:1.1.10" + dependencies: + "@radix-ui/primitive": "npm:1.1.3" + "@radix-ui/react-primitive": "npm:2.1.3" + "@radix-ui/react-use-controllable-state": "npm:1.2.2" + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 10c0/5406cdf5dd7299ae6cfdb4865dc5fd43ca3c475ebcd4e86830bd296d734255b61f749c9bde452ebfaad126033f92dd1112ee9d95982344ffad34491238dcc9b1 + languageName: node + linkType: hard + +"@radix-ui/react-use-controllable-state@npm:1.2.2": + version: 1.2.2 + resolution: "@radix-ui/react-use-controllable-state@npm:1.2.2" + dependencies: + "@radix-ui/react-use-effect-event": "npm:0.0.2" + "@radix-ui/react-use-layout-effect": "npm:1.1.1" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/f55c4b06e895293aed4b44c9ef26fb24432539f5346fcd6519c7745800535b571058685314e83486a45bf61dc83887e24826490d3068acc317fb0a9010516e63 + languageName: node + linkType: hard + +"@radix-ui/react-use-effect-event@npm:0.0.2": + version: 0.0.2 + resolution: "@radix-ui/react-use-effect-event@npm:0.0.2" + dependencies: + "@radix-ui/react-use-layout-effect": "npm:1.1.1" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/e84ff72a3e76c5ae9c94941028bb4b6472f17d4104481b9eab773deab3da640ecea035e54da9d6f4df8d84c18ef6913baf92b7511bee06930dc58bd0c0add417 + languageName: node + linkType: hard + +"@radix-ui/react-use-layout-effect@npm:1.1.1": + version: 1.1.1 + resolution: "@radix-ui/react-use-layout-effect@npm:1.1.1" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/9f98fdaba008dfc58050de60a77670b885792df473cf82c1cef8daee919a5dd5a77d270209f5f0b0abfaac78cb1627396e3ff56c81b735be550409426fe8b040 + languageName: node + linkType: hard + +"@scalar/client-side-rendering@npm:0.1.2": + version: 0.1.2 + resolution: "@scalar/client-side-rendering@npm:0.1.2" + dependencies: + "@scalar/types": "npm:0.9.1" + checksum: 10c0/49d7fa71f76fc40a0308f1047a8e31018a6361ebc46c804a62e3bb5e2a708a0861be7ee94dae4dc6c92812c038bb86c847928f6b3f2c18dbb2cdd509f0087015 + languageName: node + linkType: hard + +"@scalar/fastify-api-reference@npm:^1.52.3": + version: 1.52.3 + resolution: "@scalar/fastify-api-reference@npm:1.52.3" + dependencies: + "@scalar/client-side-rendering": "npm:0.1.2" + "@scalar/openapi-parser": "npm:0.25.10" + "@scalar/openapi-types": "npm:0.7.0" + fastify-plugin: "npm:^4.5.1" + github-slugger: "npm:2.0.0" + checksum: 10c0/f0f962f8d1cb8173e33e170a7b3615730fce2bdc4b5bd80f33e0234b0ca7d58cefc4efe96540a3df98b87f3598cb6b449ad3590e5eca466edd195d99cc4c310c + languageName: node + linkType: hard + +"@scalar/helpers@npm:0.5.1": + version: 0.5.1 + resolution: "@scalar/helpers@npm:0.5.1" + checksum: 10c0/571a4f6f711a34f31c3d1bd4abb17bc649c186d42d3c411e7b8de7b372a13b96fe65fe43f91e0692c62a6127f116a065d4f51aa1240bdf720f9afd2861fe5c2f + languageName: node + linkType: hard + +"@scalar/json-magic@npm:0.12.7": + version: 0.12.7 + resolution: "@scalar/json-magic@npm:0.12.7" + dependencies: + "@scalar/helpers": "npm:0.5.1" + pathe: "npm:^2.0.3" + yaml: "npm:^2.8.0" + checksum: 10c0/9350f8c836f1679e826d3c8e83d8a1da6d27c7381240b3c1c818bff4accb1cb8e309b39beba30c0f2d2df5032717b765b021aec6b961884dc3765e424d2ca170 + languageName: node + linkType: hard + +"@scalar/openapi-parser@npm:0.25.10": + version: 0.25.10 + resolution: "@scalar/openapi-parser@npm:0.25.10" + dependencies: + "@scalar/helpers": "npm:0.5.1" + "@scalar/json-magic": "npm:0.12.7" + "@scalar/openapi-types": "npm:0.7.0" + "@scalar/openapi-upgrader": "npm:0.2.5" + ajv: "npm:^8.17.1" + ajv-draft-04: "npm:^1.0.0" + ajv-formats: "npm:^3.0.1" + jsonpointer: "npm:^5.0.1" + leven: "npm:^4.0.0" + yaml: "npm:^2.8.0" + checksum: 10c0/41b50b6ab2e1c200c642fa8fdded4df379cfc789b8d35b24103a957a474b5568a2d8f97bfe69a825be6265c470f47d71c3ee039ef8e0d09e6bc256dc9e0e07c4 + languageName: node + linkType: hard + +"@scalar/openapi-types@npm:0.7.0": + version: 0.7.0 + resolution: "@scalar/openapi-types@npm:0.7.0" + checksum: 10c0/9e1d5c5ee77c2bf6f4aaf1e88fc72b05f69bab3a48f0acebf84b20695fd677eb1118a5a889963664dc6625daa6be08a75191c1f4d66753589b6887899e1555e6 + languageName: node + linkType: hard + +"@scalar/openapi-upgrader@npm:0.2.5": + version: 0.2.5 + resolution: "@scalar/openapi-upgrader@npm:0.2.5" + dependencies: + "@scalar/openapi-types": "npm:0.7.0" + checksum: 10c0/969228508d74ed70fe2ffccd5a97c4e1d5addd02ade431deb9aba7e779912fd3adefc7d8a3409f5e500c5f85127effada97b42df776dfa70d637ae7a4920978d + languageName: node + linkType: hard + +"@scalar/types@npm:0.9.1": + version: 0.9.1 + resolution: "@scalar/types@npm:0.9.1" + dependencies: + "@scalar/helpers": "npm:0.5.1" + nanoid: "npm:^5.1.6" + type-fest: "npm:^5.3.1" + zod: "npm:^4.3.5" + checksum: 10c0/e98c47dd829d572ffd8a038c69630662cd39cd73641ec055d47c8d146c2dbe50ccbda0b35179d9fee7a5dc5586165682600140c7445c389dd1e6b8b3e416610d languageName: node linkType: hard @@ -744,6 +1138,15 @@ __metadata: languageName: node linkType: hard +"@types/better-sqlite3@npm:^7.6.13": + version: 7.6.13 + resolution: "@types/better-sqlite3@npm:7.6.13" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/c4336e7b92343eb0e988ded007c53fa9887b98a38d61175226e86124a1a2c28b1a4e3892873c5041e350b7bfa2901f85c82db1542c4f0eed1d3a899682c92106 + languageName: node + linkType: hard + "@types/cors@npm:^2.8.12": version: 2.8.19 resolution: "@types/cors@npm:2.8.19" @@ -1038,6 +1441,18 @@ __metadata: languageName: node linkType: hard +"ajv-draft-04@npm:^1.0.0": + version: 1.0.0 + resolution: "ajv-draft-04@npm:1.0.0" + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + checksum: 10c0/6044310bd38c17d77549fd326bd40ce1506fa10b0794540aa130180808bf94117fac8c9b448c621512bea60e4a947278f6a978e87f10d342950c15b33ddd9271 + languageName: node + linkType: hard + "ajv-formats@npm:^3.0.1": version: 3.0.1 resolution: "ajv-formats@npm:3.0.1" @@ -1076,6 +1491,18 @@ __metadata: languageName: node linkType: hard +"ajv@npm:^8.17.1": + version: 8.18.0 + resolution: "ajv@npm:8.18.0" + dependencies: + fast-deep-equal: "npm:^3.1.3" + fast-uri: "npm:^3.0.1" + json-schema-traverse: "npm:^1.0.0" + require-from-string: "npm:^2.0.2" + checksum: 10c0/e7517c426173513a07391be951879932bdf3348feaebd2199f5b901c20f99d60db8cd1591502d4d551dc82f594e82a05c4fe1c70139b15b8937f7afeaed9532f + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -1113,6 +1540,16 @@ __metadata: languageName: node linkType: hard +"anymatch@npm:~3.1.2": + version: 3.1.3 + resolution: "anymatch@npm:3.1.3" + dependencies: + normalize-path: "npm:^3.0.0" + picomatch: "npm:^2.0.4" + checksum: 10c0/57b06ae984bc32a0d22592c87384cd88fe4511b1dd7581497831c56d41939c8a001b28e7b853e1450f2bf61992dfcaa8ae2d0d161a0a90c4fb631ef07098fbac + languageName: node + linkType: hard + "are-docs-informative@npm:^0.0.2": version: 0.0.2 resolution: "are-docs-informative@npm:0.0.2" @@ -1151,6 +1588,13 @@ __metadata: languageName: node linkType: hard +"aws-ssl-profiles@npm:^1.1.1": + version: 1.1.2 + resolution: "aws-ssl-profiles@npm:1.1.2" + checksum: 10c0/e5f59a4146fe3b88ad2a84f814886c788557b80b744c8cbcb1cbf8cf5ba19cc006a7a12e88819adc614ecda9233993f8f1d1f3b612cbc2f297196df9e8f4f66e + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -1158,6 +1602,20 @@ __metadata: languageName: node linkType: hard +"balanced-match@npm:^4.0.2": + version: 4.0.4 + resolution: "balanced-match@npm:4.0.4" + checksum: 10c0/07e86102a3eb2ee2a6a1a89164f29d0dbaebd28f2ca3f5ca786f36b8b23d9e417eb3be45a4acf754f837be5ac0a2317de90d3fcb7f4f4dc95720a1f36b26a17b + languageName: node + linkType: hard + +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf + languageName: node + linkType: hard + "base64id@npm:2.0.0, base64id@npm:~2.0.0": version: 2.0.0 resolution: "base64id@npm:2.0.0" @@ -1185,6 +1643,51 @@ __metadata: languageName: node linkType: hard +"better-result@npm:^2.7.0": + version: 2.8.2 + resolution: "better-result@npm:2.8.2" + checksum: 10c0/071ab92e1138d54177e85668ab1a9fc0a9ee8da98fb85057a3f9a41d7619d9f5619752e7ef352f80f6d50cc36360b92859e5b2e8fcc45f252414b9275d6e72ba + languageName: node + linkType: hard + +"better-sqlite3@npm:^12.6.0": + version: 12.9.0 + resolution: "better-sqlite3@npm:12.9.0" + dependencies: + bindings: "npm:^1.5.0" + node-gyp: "npm:latest" + prebuild-install: "npm:^7.1.1" + checksum: 10c0/69ee0d908fa6a5c8643872aa664686ed02476e88cb654fe37f0fef5845081430d4280c82f5d370e169c2abe7a14a85d9bc718ea720058abf4f7cd9a8dbe227f0 + languageName: node + linkType: hard + +"binary-extensions@npm:^2.0.0": + version: 2.3.0 + resolution: "binary-extensions@npm:2.3.0" + checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 + languageName: node + linkType: hard + +"bindings@npm:^1.5.0": + version: 1.5.0 + resolution: "bindings@npm:1.5.0" + dependencies: + file-uri-to-path: "npm:1.0.0" + checksum: 10c0/3dab2491b4bb24124252a91e656803eac24292473e56554e35bbfe3cc1875332cfa77600c3bac7564049dc95075bf6fcc63a4609920ff2d64d0fe405fcf0d4ba + languageName: node + linkType: hard + +"bl@npm:^4.0.3": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: "npm:^5.5.0" + inherits: "npm:^2.0.4" + readable-stream: "npm:^3.4.0" + checksum: 10c0/02847e1d2cb089c9dc6958add42e3cdeaf07d13f575973963335ac0fdece563a50ac770ac4c8fa06492d2dd276f6cc3b7f08c7cd9c7a7ad0f8d388b2a28def5f + languageName: node + linkType: hard + "boolbase@npm:^1.0.0": version: 1.0.0 resolution: "boolbase@npm:1.0.0" @@ -1211,7 +1714,16 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.3": +"brace-expansion@npm:^5.0.5": + version: 5.0.5 + resolution: "brace-expansion@npm:5.0.5" + dependencies: + balanced-match: "npm:^4.0.2" + checksum: 10c0/4d238e14ed4f5cc9c07285550a41cef23121ca08ba99fa9eb5b55b580dcb6bf868b8210aa10526bdc9f8dc97f33ca2a7259039c4cc131a93042beddb424c48e3 + languageName: node + linkType: hard + +"braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -1235,6 +1747,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: "npm:^1.3.1" + ieee754: "npm:^1.1.13" + checksum: 10c0/27cac81cff434ed2876058d72e7c4789d11ff1120ef32c9de48f59eab58179b66710c488987d295ae89a228f835fc66d088652dffeb8e3ba8659f80eb091d55e + languageName: node + linkType: hard + "builtin-modules@npm:^5.0.0": version: 5.0.0 resolution: "builtin-modules@npm:5.0.0" @@ -1339,6 +1861,34 @@ __metadata: languageName: node linkType: hard +"chart.js@npm:4.5.1": + version: 4.5.1 + resolution: "chart.js@npm:4.5.1" + dependencies: + "@kurkle/color": "npm:^0.3.0" + checksum: 10c0/3f2a11dcaae9079e8e6b8ad077e2ae311f04996f9da14815730891e66215ee8b5f2c0eb70b5a156e5bde0f89a41bae13506dc6153e50fd22dcb282b21eec706f + languageName: node + linkType: hard + +"chokidar@npm:^3.5.2": + version: 3.6.0 + resolution: "chokidar@npm:3.6.0" + dependencies: + anymatch: "npm:~3.1.2" + braces: "npm:~3.0.2" + fsevents: "npm:~2.3.2" + glob-parent: "npm:~5.1.2" + is-binary-path: "npm:~2.1.0" + is-glob: "npm:~4.0.1" + normalize-path: "npm:~3.0.0" + readdirp: "npm:~3.6.0" + dependenciesMeta: + fsevents: + optional: true + checksum: 10c0/8361dcd013f2ddbe260eacb1f3cb2f2c6f2b0ad118708a343a5ed8158941a39cb8fb1d272e0f389712e74ee90ce8ba864eece9e0e62b9705cb468a2f6d917462 + languageName: node + linkType: hard + "chokidar@npm:^4.0.3": version: 4.0.3 resolution: "chokidar@npm:4.0.3" @@ -1348,6 +1898,13 @@ __metadata: languageName: node linkType: hard +"chownr@npm:^1.1.1": + version: 1.1.4 + resolution: "chownr@npm:1.1.4" + checksum: 10c0/ed57952a84cc0c802af900cf7136de643d3aba2eecb59d29344bc2f3f9bf703a301b9d84cdc71f82c3ffc9ccde831b0d92f5b45f91727d6c9da62f23aef9d9db + languageName: node + linkType: hard + "chownr@npm:^3.0.0": version: 3.0.0 resolution: "chownr@npm:3.0.0" @@ -1431,6 +1988,13 @@ __metadata: languageName: node linkType: hard +"content-type@npm:^1.0.5": + version: 1.0.5 + resolution: "content-type@npm:1.0.5" + checksum: 10c0/b76ebed15c000aee4678c3707e0860cb6abd4e680a598c0a26e17f0bfae723ec9cc2802f0ff1bc6e4d80603719010431d2231018373d4dde10f9ccff9dadf5af + languageName: node + linkType: hard + "cookie@npm:^1.0.0, cookie@npm:^1.0.1": version: 1.0.2 resolution: "cookie@npm:1.0.2" @@ -1498,7 +2062,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.4.0, debug@npm:^4.4.3": +"debug@npm:4, debug@npm:^4, debug@npm:^4.0.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.4.0, debug@npm:^4.4.3": version: 4.4.3 resolution: "debug@npm:4.4.3" dependencies: @@ -1531,6 +2095,22 @@ __metadata: languageName: node linkType: hard +"decompress-response@npm:^6.0.0": + version: 6.0.0 + resolution: "decompress-response@npm:6.0.0" + dependencies: + mimic-response: "npm:^3.1.0" + checksum: 10c0/bd89d23141b96d80577e70c54fb226b2f40e74a6817652b80a116d7befb8758261ad073a8895648a29cc0a5947021ab66705cb542fa9c143c82022b27c5b175e + languageName: node + linkType: hard + +"deep-extend@npm:^0.6.0": + version: 0.6.0 + resolution: "deep-extend@npm:0.6.0" + checksum: 10c0/1c6b0abcdb901e13a44c7d699116d3d4279fdb261983122a3783e7273844d5f2537dc2e1c454a23fcf645917f93fbf8d07101c1d03c015a87faa662755212566 + languageName: node + linkType: hard + "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -1552,6 +2132,20 @@ __metadata: languageName: node linkType: hard +"denque@npm:^2.1.0": + version: 2.1.0 + resolution: "denque@npm:2.1.0" + checksum: 10c0/f9ef81aa0af9c6c614a727cb3bd13c5d7db2af1abf9e6352045b86e85873e629690f6222f4edd49d10e4ccf8f078bbeec0794fafaf61b659c0589d0c511ec363 + languageName: node + linkType: hard + +"depd@npm:~2.0.0": + version: 2.0.0 + resolution: "depd@npm:2.0.0" + checksum: 10c0/58bd06ec20e19529b06f7ad07ddab60e504d9e0faca4bd23079fac2d279c3594334d736508dc350e06e510aba5e22e4594483b3a6562ce7c17dd797f4cc4ad2c + languageName: node + linkType: hard + "dequal@npm:^2.0.0, dequal@npm:^2.0.3": version: 2.0.3 resolution: "dequal@npm:2.0.3" @@ -1566,6 +2160,13 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^2.0.0": + version: 2.1.2 + resolution: "detect-libc@npm:2.1.2" + checksum: 10c0/acc675c29a5649fa1fb6e255f993b8ee829e510b6b56b0910666949c80c364738833417d0edb5f90e4e46be17228b0f2b66a010513984e18b15deeeac49369c4 + languageName: node + linkType: hard + "devlop@npm:^1.0.0, devlop@npm:^1.1.0": version: 1.1.0 resolution: "devlop@npm:1.1.0" @@ -1603,13 +2204,13 @@ __metadata: languageName: node linkType: hard -"effect@npm:3.16.12": - version: 3.16.12 - resolution: "effect@npm:3.16.12" +"effect@npm:3.20.0": + version: 3.20.0 + resolution: "effect@npm:3.20.0" dependencies: "@standard-schema/spec": "npm:^1.0.0" fast-check: "npm:^3.23.1" - checksum: 10c0/43b73cece506926ff086fdaf62943c2706a83c4192f81f6cba5ff85761e05f5da3c72a547936678ad432a6ea7585cf8f9c38f2f6344492f132e986fd04425c58 + checksum: 10c0/7dedae57f8eab18ae4d08a0b993ad8551c15aef4f0f5d7728bc00aba8664d9d01eab6dd1e8e544ecfec8bc0dcfe472e80a7e581c4ac80258c316445536446e3d languageName: node linkType: hard @@ -1650,6 +2251,15 @@ __metadata: languageName: node linkType: hard +"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": + version: 1.4.5 + resolution: "end-of-stream@npm:1.4.5" + dependencies: + once: "npm:^1.4.0" + checksum: 10c0/b0701c92a10b89afb1cb45bf54a5292c6f008d744eb4382fa559d54775ff31617d1d7bc3ef617575f552e24fad2c7c1a1835948c66b3f3a4be0a6c1f35c883d8 + languageName: node + linkType: hard + "engine.io-parser@npm:~5.2.1": version: 5.2.3 resolution: "engine.io-parser@npm:5.2.3" @@ -1691,6 +2301,13 @@ __metadata: languageName: node linkType: hard +"env-paths@npm:^3.0.0": + version: 3.0.0 + resolution: "env-paths@npm:3.0.0" + checksum: 10c0/76dec878cee47f841103bacd7fae03283af16f0702dad65102ef0a556f310b98a377885e0f32943831eb08b5ab37842a323d02529f3dfd5d0a40ca71b01b435f + languageName: node + linkType: hard + "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -2184,6 +2801,13 @@ __metadata: languageName: node linkType: hard +"expand-template@npm:^2.0.3": + version: 2.0.3 + resolution: "expand-template@npm:2.0.3" + checksum: 10c0/1c9e7afe9acadf9d373301d27f6a47b34e89b3391b1ef38b7471d381812537ef2457e620ae7f819d2642ce9c43b189b3583813ec395e2938319abe356a9b2f51 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.2 resolution: "exponential-backoff@npm:3.1.2" @@ -2271,13 +2895,20 @@ __metadata: languageName: node linkType: hard -"fast-uri@npm:^3.0.0, fast-uri@npm:^3.0.1": +"fast-uri@npm:^3.0.0, fast-uri@npm:^3.0.1, fast-uri@npm:^3.0.5": version: 3.1.0 resolution: "fast-uri@npm:3.1.0" checksum: 10c0/44364adca566f70f40d1e9b772c923138d47efeac2ae9732a872baafd77061f26b097ba2f68f0892885ad177becd065520412b8ffeec34b16c99433c5b9e2de7 languageName: node linkType: hard +"fastify-plugin@npm:^4.5.1": + version: 4.5.1 + resolution: "fastify-plugin@npm:4.5.1" + checksum: 10c0/f58f79cd9d3c88fd7f79a3270276c6339fc57bbe72ef14d20b73779193c404e317ac18e8eae2c5071b3909ebee45d7eb6871da4e65464ac64ed0d9746b4e9b9f + languageName: node + linkType: hard + "fastify-plugin@npm:^5.0.0, fastify-plugin@npm:^5.1.0": version: 5.1.0 resolution: "fastify-plugin@npm:5.1.0" @@ -2357,6 +2988,13 @@ __metadata: languageName: node linkType: hard +"file-uri-to-path@npm:1.0.0": + version: 1.0.0 + resolution: "file-uri-to-path@npm:1.0.0" + checksum: 10c0/3b545e3a341d322d368e880e1c204ef55f1d45cdea65f7efc6c6ce9e0c4d22d802d5629320eb779d006fe59624ac17b0e848d83cc5af7cd101f206cb704f5519 + languageName: node + linkType: hard + "fill-range@npm:^7.1.1": version: 7.1.1 resolution: "fill-range@npm:7.1.1" @@ -2418,7 +3056,7 @@ __metadata: languageName: node linkType: hard -"foreground-child@npm:^3.1.0": +"foreground-child@npm:3.3.1, foreground-child@npm:^3.1.0": version: 3.3.1 resolution: "foreground-child@npm:3.3.1" dependencies: @@ -2444,6 +3082,20 @@ __metadata: languageName: node linkType: hard +"forwarded@npm:^0.2.0": + version: 0.2.0 + resolution: "forwarded@npm:0.2.0" + checksum: 10c0/9b67c3fac86acdbc9ae47ba1ddd5f2f81526fa4c8226863ede5600a3f7c7416ef451f6f1e240a3cc32d0fd79fcfe6beb08fd0da454f360032bde70bf80afbb33 + languageName: node + linkType: hard + +"fs-constants@npm:^1.0.0": + version: 1.0.0 + resolution: "fs-constants@npm:1.0.0" + checksum: 10c0/a0cde99085f0872f4d244e83e03a46aa387b74f5a5af750896c6b05e9077fac00e9932fdf5aef84f2f16634cd473c63037d7a512576da7d5c2b9163d1909f3a8 + languageName: node + linkType: hard + "fs-minipass@npm:^3.0.0": version: 3.0.3 resolution: "fs-minipass@npm:3.0.3" @@ -2453,6 +3105,41 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.3.2": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: "npm:latest" + checksum: 10c0/a1f0c44595123ed717febbc478aa952e47adfc28e2092be66b8ab1635147254ca6cfe1df792a8997f22716d4cbafc73309899ff7bfac2ac3ad8cf2e4ecc3ec60 + conditions: os=darwin + languageName: node + linkType: hard + +"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: "npm:latest" + conditions: os=darwin + languageName: node + linkType: hard + +"generate-function@npm:^2.3.1": + version: 2.3.1 + resolution: "generate-function@npm:2.3.1" + dependencies: + is-property: "npm:^1.0.2" + checksum: 10c0/4645cf1da90375e46a6f1dc51abc9933e5eafa4cd1a44c2f7e3909a30a4e9a1a08c14cd7d5b32da039da2dba2a085e1ed4597b580c196c3245b2d35d8bc0de5d + languageName: node + linkType: hard + +"get-port-please@npm:3.2.0": + version: 3.2.0 + resolution: "get-port-please@npm:3.2.0" + checksum: 10c0/7e48443110b463e76ef47efc381c9f16d78798f9ea9f6d928dad2b5cee53a199cf64e6e2f22603e5f8a1f742e3d4a144cd367f6ef82ac48759bfd2beb48ee9e5 + languageName: node + linkType: hard + "get-tsconfig@npm:^4.8.1": version: 4.10.1 resolution: "get-tsconfig@npm:4.10.1" @@ -2478,14 +3165,21 @@ __metadata: languageName: node linkType: hard -"github-slugger@npm:^2.0.0": +"github-from-package@npm:0.0.0": + version: 0.0.0 + resolution: "github-from-package@npm:0.0.0" + checksum: 10c0/737ee3f52d0a27e26332cde85b533c21fcdc0b09fb716c3f8e522cfaa9c600d4a631dec9fcde179ec9d47cca89017b7848ed4d6ae6b6b78f936c06825b1fcc12 + languageName: node + linkType: hard + +"github-slugger@npm:2.0.0, github-slugger@npm:^2.0.0": version: 2.0.0 resolution: "github-slugger@npm:2.0.0" checksum: 10c0/21b912b6b1e48f1e5a50b2292b48df0ff6abeeb0691b161b3d93d84f4ae6b1acd6ae23702e914af7ea5d441c096453cf0f621b72d57893946618d21dd1a1c486 languageName: node linkType: hard -"glob-parent@npm:^5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -2554,6 +3248,13 @@ __metadata: languageName: node linkType: hard +"grammex@npm:^3.1.11": + version: 3.1.12 + resolution: "grammex@npm:3.1.12" + checksum: 10c0/6c096ef84e1a6a0e4a50a6ba11b582b5d61d60b76830d38a5cee0383529ccdb2ac1b419695edb9877bf93717bb0ff71fba54e1e2a76bbfb61a2cca456164ef44 + languageName: node + linkType: hard + "graphemer@npm:^1.4.0": version: 1.4.0 resolution: "graphemer@npm:1.4.0" @@ -2561,6 +3262,13 @@ __metadata: languageName: node linkType: hard +"graphmatch@npm:^1.1.0": + version: 1.1.1 + resolution: "graphmatch@npm:1.1.1" + checksum: 10c0/98570352e8e62f5e18e397fb9a1ca90a31f18c46240529d5f9ee0020efa3642857337643ae731bd2667957821956dc315badc98243db284d7e5c76aedcf49b4d + languageName: node + linkType: hard + "h264-profile-level-id@npm:^2.2.3": version: 2.3.1 resolution: "h264-profile-level-id@npm:2.3.1" @@ -2570,6 +3278,13 @@ __metadata: languageName: node linkType: hard +"has-flag@npm:^3.0.0": + version: 3.0.0 + resolution: "has-flag@npm:3.0.0" + checksum: 10c0/1c6c83b14b8b1b3c25b0727b8ba3e3b647f99e9e6e13eb7322107261de07a4c1be56fc0d45678fc376e09772a3a1642ccdaf8fc69bdf123b6c086598397ce473 + languageName: node + linkType: hard + "has-flag@npm:^4.0.0": version: 4.0.0 resolution: "has-flag@npm:4.0.0" @@ -2577,6 +3292,13 @@ __metadata: languageName: node linkType: hard +"hono@npm:^4.12.8": + version: 4.12.14 + resolution: "hono@npm:4.12.14" + checksum: 10c0/78de4c98a9a3da0f067e38dcc4bd27f0d82b45d146ac39f5ca688515ee482c0a2e704d2ac6c1ee91ad17596b7c52b3e4b9483acd9c238d42f6ebcb43414a71b6 + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.2.0 resolution: "http-cache-semantics@npm:4.2.0" @@ -2584,6 +3306,19 @@ __metadata: languageName: node linkType: hard +"http-errors@npm:^2.0.0": + version: 2.0.1 + resolution: "http-errors@npm:2.0.1" + dependencies: + depd: "npm:~2.0.0" + inherits: "npm:~2.0.4" + setprototypeof: "npm:~1.2.0" + statuses: "npm:~2.0.2" + toidentifier: "npm:~1.0.1" + checksum: 10c0/fb38906cef4f5c83952d97661fe14dc156cb59fe54812a42cd448fa57b5c5dfcb38a40a916957737bd6b87aab257c0648d63eb5b6a9ca9f548e105b6072712d4 + languageName: node + linkType: hard + "http-proxy-agent@npm:^7.0.0": version: 7.0.2 resolution: "http-proxy-agent@npm:7.0.2" @@ -2594,6 +3329,13 @@ __metadata: languageName: node linkType: hard +"http-status-codes@npm:2.3.0": + version: 2.3.0 + resolution: "http-status-codes@npm:2.3.0" + checksum: 10c0/c2412188929e8eed6623eef468c62d0c3c082919c03e9b74fd79cfd060d11783dba44603e38a3cee52d26563fe32005913eaf6120aa8ba907da1238f3eaad5fe + languageName: node + linkType: hard + "https-proxy-agent@npm:^7.0.1": version: 7.0.6 resolution: "https-proxy-agent@npm:7.0.6" @@ -2613,6 +3355,29 @@ __metadata: languageName: node linkType: hard +"iconv-lite@npm:^0.7.0": + version: 0.7.2 + resolution: "iconv-lite@npm:0.7.2" + dependencies: + safer-buffer: "npm:>= 2.1.2 < 3.0.0" + checksum: 10c0/3c228920f3bd307f56bf8363706a776f4a060eb042f131cd23855ceca962951b264d0997ab38a1ad340e1c5df8499ed26e1f4f0db6b2a2ad9befaff22f14b722 + languageName: node + linkType: hard + +"ieee754@npm:^1.1.13": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: 10c0/b0782ef5e0935b9f12883a2e2aa37baa75da6e66ce6515c168697b42160807d9330de9a32ec1ed73149aea02e0d822e572bca6f1e22bdcbd2149e13b050b17bb + languageName: node + linkType: hard + +"ignore-by-default@npm:^1.0.1": + version: 1.0.1 + resolution: "ignore-by-default@npm:1.0.1" + checksum: 10c0/9ab6e70e80f7cc12735def7ecb5527cfa56ab4e1152cd64d294522827f2dcf1f6d85531241537dc3713544e88dd888f65cb3c49c7b2cddb9009087c75274e533 + languageName: node + linkType: hard + "ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.2": version: 5.3.2 resolution: "ignore@npm:5.3.2" @@ -2651,6 +3416,13 @@ __metadata: languageName: node linkType: hard +"inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.4": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 + languageName: node + linkType: hard + "ini@npm:^5.0.0": version: 5.0.0 resolution: "ini@npm:5.0.0" @@ -2658,6 +3430,13 @@ __metadata: languageName: node linkType: hard +"ini@npm:~1.3.0": + version: 1.3.8 + resolution: "ini@npm:1.3.8" + checksum: 10c0/ec93838d2328b619532e4f1ff05df7909760b6f66d9c9e2ded11e5c1897d6f2f9980c54dd638f88654b00919ce31e827040631eab0a3969e4d1abefa0719516a + languageName: node + linkType: hard + "ip-address@npm:^10.0.1": version: 10.0.1 resolution: "ip-address@npm:10.0.1" @@ -2672,6 +3451,15 @@ __metadata: languageName: node linkType: hard +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: "npm:^2.0.0" + checksum: 10c0/a16eaee59ae2b315ba36fad5c5dcaf8e49c3e27318f8ab8fa3cdb8772bf559c8d1ba750a589c2ccb096113bb64497084361a25960899cb6172a6925ab6123d38 + languageName: node + linkType: hard + "is-builtin-module@npm:^5.0.0": version: 5.0.0 resolution: "is-builtin-module@npm:5.0.0" @@ -2695,7 +3483,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -2711,6 +3499,13 @@ __metadata: languageName: node linkType: hard +"is-property@npm:^1.0.2": + version: 1.0.2 + resolution: "is-property@npm:1.0.2" + checksum: 10c0/33ab65a136e4ba3f74d4f7d9d2a013f1bd207082e11cedb160698e8d5394644e873c39668d112a402175ccbc58a087cef87198ed46829dbddb479115a0257283 + languageName: node + linkType: hard + "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -2813,6 +3608,17 @@ __metadata: languageName: node linkType: hard +"json-schema-resolver@npm:^3.0.0": + version: 3.0.0 + resolution: "json-schema-resolver@npm:3.0.0" + dependencies: + debug: "npm:^4.1.1" + fast-uri: "npm:^3.0.5" + rfdc: "npm:^1.1.4" + checksum: 10c0/f84edefb65da8833ee5949415abf599ebe18bec82ebf8f154b3565490552eaf1d9c6389d7310e5cdb611a21e655baaf20025f005c9222885ab69a092afd3f011 + languageName: node + linkType: hard + "json-schema-traverse@npm:^0.4.1": version: 0.4.1 resolution: "json-schema-traverse@npm:0.4.1" @@ -2846,6 +3652,13 @@ __metadata: languageName: node linkType: hard +"jsonpointer@npm:^5.0.1": + version: 5.0.1 + resolution: "jsonpointer@npm:5.0.1" + checksum: 10c0/89929e58b400fcb96928c0504fcf4fc3f919d81e9543ceb055df125538470ee25290bb4984251e172e6ef8fcc55761eb998c118da763a82051ad89d4cb073fe7 + languageName: node + linkType: hard + "keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -2855,6 +3668,13 @@ __metadata: languageName: node linkType: hard +"leven@npm:^4.0.0": + version: 4.1.0 + resolution: "leven@npm:4.1.0" + checksum: 10c0/de45316555624d7616c562055ce4773ad44dff7486a1696be300b040eb85472a429c2f18fd0f6352101b1fb01b336405b893f048d88d30f6fb7f8a2a2999a0c0 + languageName: node + linkType: hard + "levn@npm:^0.4.1": version: 0.4.1 resolution: "levn@npm:0.4.1" @@ -2910,6 +3730,13 @@ __metadata: languageName: node linkType: hard +"long@npm:^5.2.1": + version: 5.3.2 + resolution: "long@npm:5.3.2" + checksum: 10c0/7130fe1cbce2dca06734b35b70d380ca3f70271c7f8852c922a7c62c86c4e35f0c39290565eca7133c625908d40e126ac57c02b1b1a4636b9457d77e1e60b981 + languageName: node + linkType: hard + "longest-streak@npm:^3.0.0": version: 3.1.0 resolution: "longest-streak@npm:3.1.0" @@ -2924,6 +3751,13 @@ __metadata: languageName: node linkType: hard +"lru.min@npm:^1.0.0, lru.min@npm:^1.1.0": + version: 1.1.4 + resolution: "lru.min@npm:1.1.4" + checksum: 10c0/d9cce4d9988ced2b2dd199f47016adefda27e8405a7f63b86a54e574d254bb0099ff9e91846b0c20379348e7a03d6f4de8b8f8cdfd5265b36eb3ec07bcf72f96 + languageName: node + linkType: hard + "lucia@npm:^3.2.2": version: 3.2.2 resolution: "lucia@npm:3.2.2" @@ -3126,6 +3960,13 @@ __metadata: languageName: node linkType: hard +"media-typer@npm:^1.1.0": + version: 1.1.0 + resolution: "media-typer@npm:1.1.0" + checksum: 10c0/7b4baa40b25964bb90e2121ee489ec38642127e48d0cc2b6baa442688d3fde6262bfdca86d6bbf6ba708784afcac168c06840c71facac70e390f5f759ac121b9 + languageName: node + linkType: hard + "mediasoup@npm:^3.19.3": version: 3.19.3 resolution: "mediasoup@npm:3.19.3" @@ -3507,6 +4348,22 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:^1.54.0": + version: 1.54.0 + resolution: "mime-db@npm:1.54.0" + checksum: 10c0/8d907917bc2a90fa2df842cdf5dfeaf509adc15fe0531e07bb2f6ab15992416479015828d6a74200041c492e42cce3ebf78e5ce714388a0a538ea9c53eece284 + languageName: node + linkType: hard + +"mime-types@npm:^3.0.0": + version: 3.0.2 + resolution: "mime-types@npm:3.0.2" + dependencies: + mime-db: "npm:^1.54.0" + checksum: 10c0/35a0dd1035d14d185664f346efcdb72e93ef7a9b6e9ae808bd1f6358227010267fab52657b37562c80fc888ff76becb2b2938deb5e730818b7983bf8bd359767 + languageName: node + linkType: hard + "mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" @@ -3516,6 +4373,22 @@ __metadata: languageName: node linkType: hard +"mimic-response@npm:^3.1.0": + version: 3.1.0 + resolution: "mimic-response@npm:3.1.0" + checksum: 10c0/0d6f07ce6e03e9e4445bee655202153bdb8a98d67ee8dc965ac140900d7a2688343e6b4c9a72cfc9ef2f7944dfd76eef4ab2482eb7b293a68b84916bac735362 + languageName: node + linkType: hard + +"minimatch@npm:^10.2.1": + version: 10.2.5 + resolution: "minimatch@npm:10.2.5" + dependencies: + brace-expansion: "npm:^5.0.5" + checksum: 10c0/6bb058bd6324104b9ec2f763476a35386d05079c1f5fe4fbf1f324a25237cd4534d6813ecd71f48208f4e635c1221899bef94c3c89f7df55698fe373aaae20fd + languageName: node + linkType: hard + "minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -3534,6 +4407,13 @@ __metadata: languageName: node linkType: hard +"minimist@npm:^1.2.0, minimist@npm:^1.2.3": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6 + languageName: node + linkType: hard + "minipass-collect@npm:^2.0.1": version: 2.0.1 resolution: "minipass-collect@npm:2.0.1" @@ -3610,6 +4490,13 @@ __metadata: languageName: node linkType: hard +"mkdirp-classic@npm:^0.5.2, mkdirp-classic@npm:^0.5.3": + version: 0.5.3 + resolution: "mkdirp-classic@npm:0.5.3" + checksum: 10c0/95371d831d196960ddc3833cc6907e6b8f67ac5501a6582f47dfae5eb0f092e9f8ce88e0d83afcae95d6e2b61a01741ba03714eeafb6f7a6e9dcc158ac85b168 + languageName: node + linkType: hard + "mlly@npm:^1.7.4": version: 1.8.0 resolution: "mlly@npm:1.8.0" @@ -3629,6 +4516,48 @@ __metadata: languageName: node linkType: hard +"mysql2@npm:3.15.3": + version: 3.15.3 + resolution: "mysql2@npm:3.15.3" + dependencies: + aws-ssl-profiles: "npm:^1.1.1" + denque: "npm:^2.1.0" + generate-function: "npm:^2.3.1" + iconv-lite: "npm:^0.7.0" + long: "npm:^5.2.1" + lru.min: "npm:^1.0.0" + named-placeholders: "npm:^1.1.3" + seq-queue: "npm:^0.0.5" + sqlstring: "npm:^2.3.2" + checksum: 10c0/e10c51eebb2b2783837b732f1f4edc9e0ea15d9c5d80167e739b1dc97a323c786f5b3261e229f586b2903c44abcc71422c473113dfb261fa6215efcbbb5fe6ef + languageName: node + linkType: hard + +"named-placeholders@npm:^1.1.3": + version: 1.1.6 + resolution: "named-placeholders@npm:1.1.6" + dependencies: + lru.min: "npm:^1.1.0" + checksum: 10c0/65b7ffaf932a371602e4153808601e8f377d7fc85fa15b491ee821418e52ab4950155b840803a6eaf3d5b94d6e8aedc1bee723475541cb4713feb3544dca9336 + languageName: node + linkType: hard + +"nanoid@npm:^5.1.6": + version: 5.1.9 + resolution: "nanoid@npm:5.1.9" + bin: + nanoid: bin/nanoid.js + checksum: 10c0/02cb4e48d30469eee3959795e2af6c113342e7f492906e43bd1e3c264d2dcee6c8236b0e441d4a9895b58c4ddb1c7c02170f63a2ca854a229cc4c7a544699cc1 + languageName: node + linkType: hard + +"napi-build-utils@npm:^2.0.0": + version: 2.0.0 + resolution: "napi-build-utils@npm:2.0.0" + checksum: 10c0/5833aaeb5cc5c173da47a102efa4680a95842c13e0d9cc70428bd3ee8d96bb2172f8860d2811799b5daa5cbeda779933601492a2028a6a5351c6d0fcf6de83db + languageName: node + linkType: hard + "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -3657,6 +4586,15 @@ __metadata: languageName: node linkType: hard +"node-abi@npm:^3.3.0": + version: 3.89.0 + resolution: "node-abi@npm:3.89.0" + dependencies: + semver: "npm:^7.3.5" + checksum: 10c0/73abbee70833fbf91c7a0bb52bef9f1ccde190b1597f0bf8f15226b3aef8a4ade78605488fbd0aa47ec4fefe20e748672ba045c9075c58a56416bde8d9097586 + languageName: node + linkType: hard + "node-addon-api@npm:^8.3.0": version: 8.5.0 resolution: "node-addon-api@npm:8.5.0" @@ -3729,6 +4667,26 @@ __metadata: languageName: node linkType: hard +"nodemon@npm:^3.1.14": + version: 3.1.14 + resolution: "nodemon@npm:3.1.14" + dependencies: + chokidar: "npm:^3.5.2" + debug: "npm:^4" + ignore-by-default: "npm:^1.0.1" + minimatch: "npm:^10.2.1" + pstree.remy: "npm:^1.1.8" + semver: "npm:^7.5.3" + simple-update-notifier: "npm:^2.0.0" + supports-color: "npm:^5.5.0" + touch: "npm:^3.1.0" + undefsafe: "npm:^2.0.5" + bin: + nodemon: bin/nodemon.js + checksum: 10c0/074f2056051a148ad11cda0d6c3f905bdef93a878792385f16e1dff0c63dcf07f23ebe1ab3763dca7314d0266e12129f066070545d817a205ee050a22eff50b0 + languageName: node + linkType: hard + "nopt@npm:^8.0.0": version: 8.1.0 resolution: "nopt@npm:8.1.0" @@ -3740,6 +4698,13 @@ __metadata: languageName: node linkType: hard +"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": + version: 3.0.0 + resolution: "normalize-path@npm:3.0.0" + checksum: 10c0/e008c8142bcc335b5e38cf0d63cfd39d6cf2d97480af9abdbe9a439221fd4d749763bab492a8ee708ce7a194bb00c9da6d0a115018672310850489137b3da046 + languageName: node + linkType: hard + "nth-check@npm:^2.1.1": version: 2.1.1 resolution: "nth-check@npm:2.1.1" @@ -3794,6 +4759,22 @@ __metadata: languageName: node linkType: hard +"once@npm:^1.3.1, once@npm:^1.4.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" + dependencies: + wrappy: "npm:1" + checksum: 10c0/5d48aca287dfefabd756621c5dfce5c91a549a93e9fdb7b8246bc4c4790aa2ec17b34a260530474635147aeb631a2dcc8b32c613df0675f96041cbb8244517d0 + languageName: node + linkType: hard + +"openapi-types@npm:^12.1.3": + version: 12.1.3 + resolution: "openapi-types@npm:12.1.3" + checksum: 10c0/4ad4eb91ea834c237edfa6ab31394e87e00c888fc2918009763389c00d02342345195d6f302d61c3fd807f17723cd48df29b47b538b68375b3827b3758cd520f + languageName: node + linkType: hard + "optionator@npm:^0.9.3": version: 0.9.4 resolution: "optionator@npm:0.9.4" @@ -3903,7 +4884,7 @@ __metadata: languageName: node linkType: hard -"pathe@npm:^2.0.1, pathe@npm:^2.0.3": +"pathe@npm:2.0.3, pathe@npm:^2.0.1, pathe@npm:^2.0.3": version: 2.0.3 resolution: "pathe@npm:2.0.3" checksum: 10c0/c118dc5a8b5c4166011b2b70608762e260085180bb9e33e80a50dcdb1e78c010b1624f4280c492c92b05fc276715a4c357d1f9edc570f8f1b3d90b6839ebaca1 @@ -3924,6 +4905,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1": + version: 2.3.2 + resolution: "picomatch@npm:2.3.2" + checksum: 10c0/a554d1709e59be97d1acb9eaedbbc700a5c03dbd4579807baed95100b00420bc729335440ef15004ae2378984e2487a7c1cebd743cfdb72b6fa9ab69223c0d61 + languageName: node + linkType: hard + "picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -4023,6 +5011,35 @@ __metadata: languageName: node linkType: hard +"postgres@npm:3.4.7": + version: 3.4.7 + resolution: "postgres@npm:3.4.7" + checksum: 10c0/b2e61b1064d38e7e1df8291f6d5a7e11f892a3240e00cf2b5e5542bf9abbfe97f3963164aeb56b42c1ab6b8aae3454c57f5bbc1791df0769375542740a7cde72 + languageName: node + linkType: hard + +"prebuild-install@npm:^7.1.1": + version: 7.1.3 + resolution: "prebuild-install@npm:7.1.3" + dependencies: + detect-libc: "npm:^2.0.0" + expand-template: "npm:^2.0.3" + github-from-package: "npm:0.0.0" + minimist: "npm:^1.2.3" + mkdirp-classic: "npm:^0.5.3" + napi-build-utils: "npm:^2.0.0" + node-abi: "npm:^3.3.0" + pump: "npm:^3.0.0" + rc: "npm:^1.2.7" + simple-get: "npm:^4.0.0" + tar-fs: "npm:^2.0.0" + tunnel-agent: "npm:^0.6.0" + bin: + prebuild-install: bin.js + checksum: 10c0/25919a42b52734606a4036ab492d37cfe8b601273d8dfb1fa3c84e141a0a475e7bad3ab848c741d2f810cef892fcf6059b8c7fe5b29f98d30e0c29ad009bedff + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -4030,20 +5047,27 @@ __metadata: languageName: node linkType: hard -"prisma@npm:^6.17.0": - version: 6.17.0 - resolution: "prisma@npm:6.17.0" +"prisma@npm:7": + version: 7.7.0 + resolution: "prisma@npm:7.7.0" dependencies: - "@prisma/config": "npm:6.17.0" - "@prisma/engines": "npm:6.17.0" + "@prisma/config": "npm:7.7.0" + "@prisma/dev": "npm:0.24.3" + "@prisma/engines": "npm:7.7.0" + "@prisma/studio-core": "npm:0.27.3" + mysql2: "npm:3.15.3" + postgres: "npm:3.4.7" peerDependencies: - typescript: ">=5.1.0" + better-sqlite3: ">=9.0.0" + typescript: ">=5.4.0" peerDependenciesMeta: + better-sqlite3: + optional: true typescript: optional: true bin: prisma: build/index.js - checksum: 10c0/88958d86f8a91626345bdf9a552602570148ac742bd71902ba55a967bad78ab3f9415e129fccba9ee9fd5756aaadceeba1667583502c49e0e5110b0cba2dcae6 + checksum: 10c0/5efa04c196595020503f5ca303a800d76e39e743788faf7f20a674d9c2be0adb8f48f8b1b4fab1f47a593645f9096d86ad34fc48112ec5407c379f13c3053285 languageName: node linkType: hard @@ -4078,6 +5102,34 @@ __metadata: languageName: node linkType: hard +"proper-lockfile@npm:4.1.2, proper-lockfile@npm:^4.1.2": + version: 4.1.2 + resolution: "proper-lockfile@npm:4.1.2" + dependencies: + graceful-fs: "npm:^4.2.4" + retry: "npm:^0.12.0" + signal-exit: "npm:^3.0.2" + checksum: 10c0/2f265dbad15897a43110a02dae55105c04d356ec4ed560723dcb9f0d34bc4fb2f13f79bb930e7561be10278e2314db5aca2527d5d3dcbbdee5e6b331d1571f6d + languageName: node + linkType: hard + +"pstree.remy@npm:^1.1.8": + version: 1.1.8 + resolution: "pstree.remy@npm:1.1.8" + checksum: 10c0/30f78c88ce6393cb3f7834216cb6e282eb83c92ccb227430d4590298ab2811bc4a4745f850a27c5178e79a8f3e316591de0fec87abc19da648c2b3c6eb766d14 + languageName: node + linkType: hard + +"pump@npm:^3.0.0": + version: 3.0.4 + resolution: "pump@npm:3.0.4" + dependencies: + end-of-stream: "npm:^1.1.0" + once: "npm:^1.3.1" + checksum: 10c0/2780e66b5471c19e3e3e1063b84f3f6a3a08367f24c5ed552f98cd5901e6ada27c7ad6495d4244f553fd03b01884a4561933064f053f47c8994d84fd352768ea + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -4123,6 +5175,31 @@ __metadata: languageName: node linkType: hard +"rc@npm:^1.2.7": + version: 1.2.8 + resolution: "rc@npm:1.2.8" + dependencies: + deep-extend: "npm:^0.6.0" + ini: "npm:~1.3.0" + minimist: "npm:^1.2.0" + strip-json-comments: "npm:~2.0.1" + bin: + rc: ./cli.js + checksum: 10c0/24a07653150f0d9ac7168e52943cc3cb4b7a22c0e43c7dff3219977c2fdca5a2760a304a029c20811a0e79d351f57d46c9bde216193a0f73978496afc2b85b15 + languageName: node + linkType: hard + +"readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: "npm:^2.0.3" + string_decoder: "npm:^1.1.1" + util-deprecate: "npm:^1.0.1" + checksum: 10c0/e37be5c79c376fdd088a45fa31ea2e423e5d48854be7a22a58869b4e84d25047b193f6acb54f1012331e1bcd667ffb569c01b99d36b0bd59658fb33f513511b7 + languageName: node + linkType: hard + "readdirp@npm:^4.0.1": version: 4.1.2 resolution: "readdirp@npm:4.1.2" @@ -4130,6 +5207,15 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" + dependencies: + picomatch: "npm:^2.2.1" + checksum: 10c0/6fa848cf63d1b82ab4e985f4cf72bd55b7dcfd8e0a376905804e48c3634b7e749170940ba77b32804d5fe93b3cc521aa95a8d7e7d725f830da6d93f3669ce66b + languageName: node + linkType: hard + "real-require@npm:^0.2.0": version: 0.2.0 resolution: "real-require@npm:0.2.0" @@ -4176,6 +5262,13 @@ __metadata: languageName: node linkType: hard +"remeda@npm:2.33.4": + version: 2.33.4 + resolution: "remeda@npm:2.33.4" + checksum: 10c0/6597e47e42a110347349003ae95f926d8e0a34345111e9f25042415964106c31efba519f44ddeb8abc1ef4fe3e4d4c72e3220424eb72366de6c51e42d7b7c331 + languageName: node + linkType: hard + "require-from-string@npm:^2.0.2": version: 2.0.2 resolution: "require-from-string@npm:2.0.2" @@ -4218,7 +5311,7 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.2.0, rfdc@npm:^1.3.1": +"rfdc@npm:^1.1.4, rfdc@npm:^1.2.0, rfdc@npm:^1.3.1": version: 1.4.1 resolution: "rfdc@npm:1.4.1" checksum: 10c0/4614e4292356cafade0b6031527eea9bc90f2372a22c012313be1dcc69a3b90c7338158b414539be863fa95bfcb2ddcd0587be696841af4e6679d85e62c060c7 @@ -4234,6 +5327,13 @@ __metadata: languageName: node linkType: hard +"safe-buffer@npm:^5.0.1, safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: 10c0/6501914237c0a86e9675d4e51d89ca3c21ffd6a31642efeba25ad65720bce6921c9e7e974e5be91a786b25aa058b5303285d3c15dbabf983a919f5f630d349f3 + languageName: node + linkType: hard + "safe-regex2@npm:^5.0.0": version: 5.0.0 resolution: "safe-regex2@npm:5.0.0" @@ -4284,6 +5384,22 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.5.3": + version: 7.7.4 + resolution: "semver@npm:7.7.4" + bin: + semver: bin/semver.js + checksum: 10c0/5215ad0234e2845d4ea5bb9d836d42b03499546ddafb12075566899fc617f68794bb6f146076b6881d755de17d6c6cc73372555879ec7dce2c2feee947866ad2 + languageName: node + linkType: hard + +"seq-queue@npm:^0.0.5": + version: 0.0.5 + resolution: "seq-queue@npm:0.0.5" + checksum: 10c0/ec870fc392f0e6e99ec0e551c3041c1a66144d1580efabae7358e572de127b0ad2f844c95a4861d2e6203f836adea4c8196345b37bed55331ead8f22d99ac84c + languageName: node + linkType: hard + "server@workspace:.": version: 0.0.0-use.local resolution: "server@workspace:." @@ -4293,9 +5409,15 @@ __metadata: "@fastify/cookie": "npm:^11.0.2" "@fastify/cors": "npm:^11.1.0" "@fastify/multipart": "npm:^10.0.0" + "@fastify/sensible": "npm:^6.0.4" + "@fastify/swagger": "npm:^9.7.0" + "@fastify/type-provider-typebox": "npm:^6.1.0" "@lucia-auth/adapter-prisma": "npm:^4.0.1" - "@prisma/client": "npm:^6.17.0" + "@prisma/adapter-better-sqlite3": "npm:^7.7.0" + "@prisma/client": "npm:7" + "@scalar/fastify-api-reference": "npm:^1.52.3" "@types/bcrypt": "npm:^6" + "@types/better-sqlite3": "npm:^7.6.13" "@types/ws": "npm:^8" bcrypt: "npm:^6.0.0" consola: "npm:^3.4.2" @@ -4305,9 +5427,11 @@ __metadata: fastify-plugin: "npm:^5.1.0" lucia: "npm:^3.2.2" mediasoup: "npm:^3.19.3" - prisma: "npm:^6.17.0" + nodemon: "npm:^3.1.14" + prisma: "npm:7" socket.io: "npm:^4.8.1" ts-node: "npm:^10.9.2" + typebox: "npm:^1.1.27" typescript: "npm:^5.9.3" uuid: "npm:^13.0.0" ws: "npm:^8.18.3" @@ -4322,6 +5446,13 @@ __metadata: languageName: node linkType: hard +"setprototypeof@npm:~1.2.0": + version: 1.2.0 + resolution: "setprototypeof@npm:1.2.0" + checksum: 10c0/68733173026766fa0d9ecaeb07f0483f4c2dc70ca376b3b7c40b7cda909f94b0918f6c5ad5ce27a9160bdfb475efaa9d5e705a11d8eaae18f9835d20976028bc + languageName: node + linkType: hard + "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -4338,6 +5469,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^3.0.2": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 + languageName: node + linkType: hard + "signal-exit@npm:^4.0.1": version: 4.1.0 resolution: "signal-exit@npm:4.1.0" @@ -4345,6 +5483,33 @@ __metadata: languageName: node linkType: hard +"simple-concat@npm:^1.0.0": + version: 1.0.1 + resolution: "simple-concat@npm:1.0.1" + checksum: 10c0/62f7508e674414008910b5397c1811941d457dfa0db4fd5aa7fa0409eb02c3609608dfcd7508cace75b3a0bf67a2a77990711e32cd213d2c76f4fd12ee86d776 + languageName: node + linkType: hard + +"simple-get@npm:^4.0.0": + version: 4.0.1 + resolution: "simple-get@npm:4.0.1" + dependencies: + decompress-response: "npm:^6.0.0" + once: "npm:^1.3.1" + simple-concat: "npm:^1.0.0" + checksum: 10c0/b0649a581dbca741babb960423248899203165769747142033479a7dc5e77d7b0fced0253c731cd57cf21e31e4d77c9157c3069f4448d558ebc96cf9e1eebcf0 + languageName: node + linkType: hard + +"simple-update-notifier@npm:^2.0.0": + version: 2.0.0 + resolution: "simple-update-notifier@npm:2.0.0" + dependencies: + semver: "npm:^7.5.3" + checksum: 10c0/2a00bd03bfbcbf8a737c47ab230d7920f8bfb92d1159d421bdd194479f6d01ebc995d13fbe13d45dace23066a78a3dc6642999b4e3b38b847e6664191575b20c + languageName: node + linkType: hard + "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -4462,6 +5627,13 @@ __metadata: languageName: node linkType: hard +"sqlstring@npm:^2.3.2": + version: 2.3.3 + resolution: "sqlstring@npm:2.3.3" + checksum: 10c0/3b5dd7badb3d6312f494cfa6c9a381ee630fbe3dbd571c4c9eb8ecdb99a7bf5a1f7a5043191d768797f6b3c04eed5958ac6a5f948b998f0a138294c6d3125fbd + languageName: node + linkType: hard + "ssri@npm:^12.0.0": version: 12.0.0 resolution: "ssri@npm:12.0.0" @@ -4471,6 +5643,20 @@ __metadata: languageName: node linkType: hard +"statuses@npm:~2.0.2": + version: 2.0.2 + resolution: "statuses@npm:2.0.2" + checksum: 10c0/a9947d98ad60d01f6b26727570f3bcceb6c8fa789da64fe6889908fe2e294d57503b14bf2b5af7605c2d36647259e856635cd4c49eab41667658ec9d0080ec3f + languageName: node + linkType: hard + +"std-env@npm:3.10.0": + version: 3.10.0 + resolution: "std-env@npm:3.10.0" + checksum: 10c0/1814927a45004d36dde6707eaf17552a546769bc79a6421be2c16ce77d238158dfe5de30910b78ec30d95135cc1c59ea73ee22d2ca170f8b9753f84da34c427f + languageName: node + linkType: hard + "string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0": version: 4.2.3 resolution: "string-width@npm:4.2.3" @@ -4493,6 +5679,15 @@ __metadata: languageName: node linkType: hard +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: "npm:~5.2.0" + checksum: 10c0/810614ddb030e271cd591935dcd5956b2410dd079d64ff92a1844d6b7588bf992b3e1b69b0f4d34a3e06e0bd73046ac646b5264c1987b20d0601f81ef35d731d + languageName: node + linkType: hard + "strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" @@ -4525,6 +5720,13 @@ __metadata: languageName: node linkType: hard +"strip-json-comments@npm:~2.0.1": + version: 2.0.1 + resolution: "strip-json-comments@npm:2.0.1" + checksum: 10c0/b509231cbdee45064ff4f9fd73609e2bcc4e84a4d508e9dd0f31f70356473fde18abfb5838c17d56fb236f5a06b102ef115438de0600b749e818a35fbbc48c43 + languageName: node + linkType: hard + "supports-color@npm:^10.2.2": version: 10.2.2 resolution: "supports-color@npm:10.2.2" @@ -4532,6 +5734,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^5.5.0": + version: 5.5.0 + resolution: "supports-color@npm:5.5.0" + dependencies: + has-flag: "npm:^3.0.0" + checksum: 10c0/6ae5ff319bfbb021f8a86da8ea1f8db52fac8bd4d499492e30ec17095b58af11f0c55f8577390a749b1c4dde691b6a0315dab78f5f54c9b3d83f8fb5905c1c05 + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -4550,6 +5761,13 @@ __metadata: languageName: node linkType: hard +"tagged-tag@npm:^1.0.0": + version: 1.0.0 + resolution: "tagged-tag@npm:1.0.0" + checksum: 10c0/91d25c9ffb86a91f20522cefb2cbec9b64caa1febe27ad0df52f08993ff60888022d771e868e6416cf2e72dab68449d2139e8709ba009b74c6c7ecd4000048d1 + languageName: node + linkType: hard + "tapable@npm:^2.2.0": version: 2.2.3 resolution: "tapable@npm:2.2.3" @@ -4557,6 +5775,31 @@ __metadata: languageName: node linkType: hard +"tar-fs@npm:^2.0.0": + version: 2.1.4 + resolution: "tar-fs@npm:2.1.4" + dependencies: + chownr: "npm:^1.1.1" + mkdirp-classic: "npm:^0.5.2" + pump: "npm:^3.0.0" + tar-stream: "npm:^2.1.4" + checksum: 10c0/decb25acdc6839182c06ec83cba6136205bda1db984e120c8ffd0d80182bc5baa1d916f9b6c5c663ea3f9975b4dd49e3c6bb7b1707cbcdaba4e76042f43ec84c + languageName: node + linkType: hard + +"tar-stream@npm:^2.1.4": + version: 2.2.0 + resolution: "tar-stream@npm:2.2.0" + dependencies: + bl: "npm:^4.0.3" + end-of-stream: "npm:^1.4.1" + fs-constants: "npm:^1.0.0" + inherits: "npm:^2.0.3" + readable-stream: "npm:^3.1.1" + checksum: 10c0/2f4c910b3ee7196502e1ff015a7ba321ec6ea837667220d7bcb8d0852d51cb04b87f7ae471008a6fb8f5b1a1b5078f62f3a82d30c706f20ada1238ac797e7692 + languageName: node + linkType: hard + "tar@npm:^7.4.3, tar@npm:^7.4.4": version: 7.5.1 resolution: "tar@npm:7.5.1" @@ -4612,6 +5855,13 @@ __metadata: languageName: node linkType: hard +"toidentifier@npm:~1.0.1": + version: 1.0.1 + resolution: "toidentifier@npm:1.0.1" + checksum: 10c0/93937279934bd66cc3270016dd8d0afec14fb7c94a05c72dc57321f8bd1fa97e5bea6d1f7c89e728d077ca31ea125b78320a616a6c6cd0e6b9cb94cb864381c1 + languageName: node + linkType: hard + "toml-eslint-parser@npm:^0.10.0": version: 0.10.0 resolution: "toml-eslint-parser@npm:0.10.0" @@ -4621,6 +5871,15 @@ __metadata: languageName: node linkType: hard +"touch@npm:^3.1.0": + version: 3.1.1 + resolution: "touch@npm:3.1.1" + bin: + nodetouch: bin/nodetouch.js + checksum: 10c0/d2e4d269a42c846a22a29065b9af0b263de58effc85a1764bb7a2e8fc4b47700e9e2fcbd7eb1f5bffbb7c73d860f93600cef282b93ddac8f0b62321cb498b36e + languageName: node + linkType: hard + "ts-api-utils@npm:^2.1.0": version: 2.1.0 resolution: "ts-api-utils@npm:2.1.0" @@ -4679,6 +5938,15 @@ __metadata: languageName: node linkType: hard +"tunnel-agent@npm:^0.6.0": + version: 0.6.0 + resolution: "tunnel-agent@npm:0.6.0" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 10c0/4c7a1b813e7beae66fdbf567a65ec6d46313643753d0beefb3c7973d66fcec3a1e7f39759f0a0b4465883499c6dc8b0750ab8b287399af2e583823e40410a17a + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -4695,6 +5963,33 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^5.3.1": + version: 5.6.0 + resolution: "type-fest@npm:5.6.0" + dependencies: + tagged-tag: "npm:^1.0.0" + checksum: 10c0/5468a8ffda7f3904e6f7bbd8069eb8b6dd4bd9156e206df7a01d09a73e28cd1afedf74ead9d0fc12841c8c90074194859feca240511c50800962fde1bd9ddcbc + languageName: node + linkType: hard + +"type-is@npm:^2.0.1": + version: 2.0.1 + resolution: "type-is@npm:2.0.1" + dependencies: + content-type: "npm:^1.0.5" + media-typer: "npm:^1.1.0" + mime-types: "npm:^3.0.0" + checksum: 10c0/7f7ec0a060b16880bdad36824ab37c26019454b67d73e8a465ed5a3587440fbe158bc765f0da68344498235c877e7dbbb1600beccc94628ed05599d667951b99 + languageName: node + linkType: hard + +"typebox@npm:^1.1.27": + version: 1.1.27 + resolution: "typebox@npm:1.1.27" + checksum: 10c0/62f2de2df90e2853de90538eb3190889c72bc1e27bf7306a3a23dba1f1385e2efded0bee4070d2c19b1827aa819bf2522a883b1220b2e89a2f40fba401745a34 + languageName: node + linkType: hard + "typescript@npm:^5.9.3": version: 5.9.3 resolution: "typescript@npm:5.9.3" @@ -4722,6 +6017,13 @@ __metadata: languageName: node linkType: hard +"undefsafe@npm:^2.0.5": + version: 2.0.5 + resolution: "undefsafe@npm:2.0.5" + checksum: 10c0/96c0466a5fbf395917974a921d5d4eee67bca4b30d3a31ce7e621e0228c479cf893e783a109af6e14329b52fe2f0cb4108665fad2b87b0018c0df6ac771261d5 + languageName: node + linkType: hard + "undici-types@npm:~7.12.0": version: 7.12.0 resolution: "undici-types@npm:7.12.0" @@ -4809,7 +6111,7 @@ __metadata: languageName: node linkType: hard -"util-deprecate@npm:^1.0.2": +"util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" checksum: 10c0/41a5bdd214df2f6c3ecf8622745e4a366c4adced864bc3c833739791aeeeb1838119af7daed4ba36428114b5c67dcda034a79c882e97e43c03e66a4dd7389942 @@ -4832,7 +6134,19 @@ __metadata: languageName: node linkType: hard -"vary@npm:^1": +"valibot@npm:1.2.0": + version: 1.2.0 + resolution: "valibot@npm:1.2.0" + peerDependencies: + typescript: ">=5" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/e6897ed2008fc900380a6ce39b62bc5fca45fd5e070f70571c6380ede3ba026d0b7016230215d87f7f3d672a28dbde5a0522d39830b493fdc3dccd1a59ef4ee6 + languageName: node + linkType: hard + +"vary@npm:^1, vary@npm:^1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" checksum: 10c0/f15d588d79f3675135ba783c91a4083dcd290a2a5be9fcb6514220a1634e23df116847b1cc51f66bfb0644cf9353b2abb7815ae499bab06e46dd33c1a6bf1f4f @@ -4913,6 +6227,13 @@ __metadata: languageName: node linkType: hard +"wrappy@npm:1": + version: 1.0.2 + resolution: "wrappy@npm:1.0.2" + checksum: 10c0/56fece1a4018c6a6c8e28fbc88c87e0fbf4ea8fd64fc6c63b18f4acc4bd13e0ad2515189786dd2c30d3eec9663d70f4ecf699330002f8ccb547e4a18231fc9f0 + languageName: node + linkType: hard + "ws@npm:^8.18.3": version: 8.18.3 resolution: "ws@npm:8.18.3" @@ -4983,6 +6304,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.4.2, yaml@npm:^2.8.0": + version: 2.8.3 + resolution: "yaml@npm:2.8.3" + bin: + yaml: bin.mjs + checksum: 10c0/ddff0e11c1b467728d7eb4633db61c5f5de3d8e9373cf84d08fb0cdee03e1f58f02b9f1c51a4a8a865751695addbd465a77f73f1079be91fe5493b29c305fd77 + languageName: node + linkType: hard + "yn@npm:3.1.1": version: 3.1.1 resolution: "yn@npm:3.1.1" @@ -4997,6 +6327,16 @@ __metadata: languageName: node linkType: hard +"zeptomatch@npm:2.1.0": + version: 2.1.0 + resolution: "zeptomatch@npm:2.1.0" + dependencies: + grammex: "npm:^3.1.11" + graphmatch: "npm:^1.1.0" + checksum: 10c0/6baa15863f1bbf0131a50f80df82bdc1d174f45e81587ff6a2ac2ad13a0c4a1f80e883794d5711ad31acdd85195ebe052375e43db5c4bcbaff98f040c082234e + languageName: node + linkType: hard + "zod@npm:^4.1.12": version: 4.1.12 resolution: "zod@npm:4.1.12" @@ -5004,6 +6344,13 @@ __metadata: languageName: node linkType: hard +"zod@npm:^4.3.5": + version: 4.3.6 + resolution: "zod@npm:4.3.6" + checksum: 10c0/860d25a81ab41d33aa25f8d0d07b091a04acb426e605f396227a796e9e800c44723ed96d0f53a512b57be3d1520f45bf69c0cb3b378a232a00787a2609625307 + languageName: node + linkType: hard + "zwitch@npm:^2.0.0": version: 2.0.4 resolution: "zwitch@npm:2.0.4"