commit 2a16dca46916fb4f0a534c1a78e6d4b15cc17708 Author: clawd Date: Tue Jan 27 17:47:41 2026 -0800 Initial MVP: multiplexer + chat DB diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3eaa684 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules +.env +.env.* +dev.db +*.db +prisma/migrations +.DS_Store +dist diff --git a/README.md b/README.md new file mode 100644 index 0000000..d295871 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# llm-backend + +Backend API for: +- LLM multiplexer (OpenAI / Anthropic / xAI (Grok)) +- Personal chat database (chats/messages + LLM call log) + +## Stack +- Node.js + TypeScript +- Fastify (HTTP) +- Prisma + SQLite (dev) + +## Quick start + +```bash +cd llm-backend +cp .env.example .env +npm run db:migrate +npm run dev +``` + +Open docs: `http://localhost:8787/docs` + +## Auth + +Set `ADMIN_TOKEN` and send: + +`Authorization: Bearer ` + +If `ADMIN_TOKEN` is not set, the server runs in open mode (dev). + +## Env +- `OPENAI_API_KEY` +- `ANTHROPIC_API_KEY` +- `XAI_API_KEY` + +## API +- `GET /health` +- `GET /v1/chats` +- `POST /v1/chats` +- `GET /v1/chats/:chatId` +- `POST /v1/chats/:chatId/messages` +- `POST /v1/chat-completions` + +`POST /v1/chat-completions` body example: + +```json +{ + "chatId": "", + "provider": "openai", + "model": "gpt-4.1-mini", + "messages": [ + {"role":"system","content":"You are helpful."}, + {"role":"user","content":"Say hi"} + ], + "temperature": 0.2, + "maxTokens": 256 +} +``` + +## Next steps (planned) +- SSE streaming (`/v1/chat-completions:stream`) +- Tool/function calling normalization +- User accounts + per-device API keys +- Postgres support + migrations for prod +- Attachments + embeddings + semantic search diff --git a/generated/prisma/browser.ts b/generated/prisma/browser.ts new file mode 100644 index 0000000..bec34dc --- /dev/null +++ b/generated/prisma/browser.ts @@ -0,0 +1,39 @@ + +/* !!! 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.js' +export { Prisma } +export * as $Enums from './enums.js' +export * from './enums.js'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Chat + * + */ +export type Chat = Prisma.ChatModel +/** + * Model Message + * + */ +export type Message = Prisma.MessageModel +/** + * Model LlmCall + * + */ +export type LlmCall = Prisma.LlmCallModel diff --git a/generated/prisma/client.ts b/generated/prisma/client.ts new file mode 100644 index 0000000..530a8b6 --- /dev/null +++ b/generated/prisma/client.ts @@ -0,0 +1,61 @@ + +/* !!! 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.js" +import * as $Class from "./internal/class.js" +import * as Prisma from "./internal/prismaNamespace.js" + +export * as $Enums from './enums.js' +export * from "./enums.js" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/client). + */ +export const PrismaClient = $Class.getPrismaClientClass() +export type PrismaClient = $Class.PrismaClient +export { Prisma } + +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Chat + * + */ +export type Chat = Prisma.ChatModel +/** + * Model Message + * + */ +export type Message = Prisma.MessageModel +/** + * Model LlmCall + * + */ +export type LlmCall = Prisma.LlmCallModel diff --git a/generated/prisma/commonInputTypes.ts b/generated/prisma/commonInputTypes.ts new file mode 100644 index 0000000..7c25de3 --- /dev/null +++ b/generated/prisma/commonInputTypes.ts @@ -0,0 +1,460 @@ + +/* !!! 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.js" +import type * as Prisma from "./internal/prismaNamespace.js" + + +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 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 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 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 EnumMessageRoleFilter<$PrismaModel = never> = { + equals?: $Enums.MessageRole | Prisma.EnumMessageRoleFieldRefInput<$PrismaModel> + in?: $Enums.MessageRole[] + notIn?: $Enums.MessageRole[] + not?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> | $Enums.MessageRole +} + +export type JsonNullableFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonNullableFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + +export type EnumMessageRoleWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MessageRole | Prisma.EnumMessageRoleFieldRefInput<$PrismaModel> + in?: $Enums.MessageRole[] + notIn?: $Enums.MessageRole[] + not?: Prisma.NestedEnumMessageRoleWithAggregatesFilter<$PrismaModel> | $Enums.MessageRole + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> + _max?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> +} + +export type JsonNullableWithAggregatesFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedJsonNullableFilter<$PrismaModel> + _max?: Prisma.NestedJsonNullableFilter<$PrismaModel> +} + +export type EnumProviderFilter<$PrismaModel = never> = { + equals?: $Enums.Provider | Prisma.EnumProviderFieldRefInput<$PrismaModel> + in?: $Enums.Provider[] + notIn?: $Enums.Provider[] + not?: Prisma.NestedEnumProviderFilter<$PrismaModel> | $Enums.Provider +} + +export type JsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + +export type IntNullableFilter<$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 EnumProviderWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.Provider | Prisma.EnumProviderFieldRefInput<$PrismaModel> + in?: $Enums.Provider[] + notIn?: $Enums.Provider[] + not?: Prisma.NestedEnumProviderWithAggregatesFilter<$PrismaModel> | $Enums.Provider + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumProviderFilter<$PrismaModel> + _max?: Prisma.NestedEnumProviderFilter<$PrismaModel> +} + +export type JsonWithAggregatesFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedJsonFilter<$PrismaModel> + _max?: Prisma.NestedJsonFilter<$PrismaModel> +} + +export type IntNullableWithAggregatesFilter<$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.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$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 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 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 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 NestedEnumMessageRoleFilter<$PrismaModel = never> = { + equals?: $Enums.MessageRole | Prisma.EnumMessageRoleFieldRefInput<$PrismaModel> + in?: $Enums.MessageRole[] + notIn?: $Enums.MessageRole[] + not?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> | $Enums.MessageRole +} + +export type NestedEnumMessageRoleWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MessageRole | Prisma.EnumMessageRoleFieldRefInput<$PrismaModel> + in?: $Enums.MessageRole[] + notIn?: $Enums.MessageRole[] + not?: Prisma.NestedEnumMessageRoleWithAggregatesFilter<$PrismaModel> | $Enums.MessageRole + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> + _max?: Prisma.NestedEnumMessageRoleFilter<$PrismaModel> +} + +export type NestedJsonNullableFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type NestedJsonNullableFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + +export type NestedEnumProviderFilter<$PrismaModel = never> = { + equals?: $Enums.Provider | Prisma.EnumProviderFieldRefInput<$PrismaModel> + in?: $Enums.Provider[] + notIn?: $Enums.Provider[] + not?: Prisma.NestedEnumProviderFilter<$PrismaModel> | $Enums.Provider +} + +export type NestedEnumProviderWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.Provider | Prisma.EnumProviderFieldRefInput<$PrismaModel> + in?: $Enums.Provider[] + notIn?: $Enums.Provider[] + not?: Prisma.NestedEnumProviderWithAggregatesFilter<$PrismaModel> | $Enums.Provider + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumProviderFilter<$PrismaModel> + _max?: Prisma.NestedEnumProviderFilter<$PrismaModel> +} + +export type NestedJsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type NestedJsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + +export type NestedIntNullableWithAggregatesFilter<$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.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +} + +export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null +} + + diff --git a/generated/prisma/enums.ts b/generated/prisma/enums.ts new file mode 100644 index 0000000..67c8c7f --- /dev/null +++ b/generated/prisma/enums.ts @@ -0,0 +1,28 @@ + +/* !!! 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. +*/ + +export const Provider = { + openai: 'openai', + anthropic: 'anthropic', + xai: 'xai' +} as const + +export type Provider = (typeof Provider)[keyof typeof Provider] + + +export const MessageRole = { + system: 'system', + user: 'user', + assistant: 'assistant', + tool: 'tool' +} as const + +export type MessageRole = (typeof MessageRole)[keyof typeof MessageRole] diff --git a/generated/prisma/internal/class.ts b/generated/prisma/internal/class.ts new file mode 100644 index 0000000..be4242c --- /dev/null +++ b/generated/prisma/internal/class.ts @@ -0,0 +1,222 @@ + +/* !!! 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.js" + + +const config: runtime.GetPrismaClientConfig = { + "previewFeatures": [], + "clientVersion": "7.3.0", + "engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735", + "activeProvider": "sqlite", + "inlineSchema": "// Prisma schema for the personal chat DB + LLM call log\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nenum Provider {\n openai\n anthropic\n xai\n}\n\nenum MessageRole {\n system\n user\n assistant\n tool\n}\n\nmodel User {\n id String @id @default(cuid())\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n // minimal for now (single-user is fine). Keep extensible.\n handle String? @unique\n\n chats Chat[]\n}\n\nmodel Chat {\n id String @id @default(cuid())\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n title String?\n\n user User? @relation(fields: [userId], references: [id])\n userId String?\n\n messages Message[]\n calls LlmCall[]\n\n @@index([userId])\n}\n\nmodel Message {\n id String @id @default(cuid())\n createdAt DateTime @default(now())\n\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n chatId String\n\n role MessageRole\n content String\n\n // for tool messages or attachments later\n name String?\n metadata Json?\n\n @@index([chatId, createdAt])\n}\n\nmodel LlmCall {\n id String @id @default(cuid())\n createdAt DateTime @default(now())\n\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n chatId String\n\n provider Provider\n model String\n\n // request/response snapshots for debugging + replay\n request Json\n response Json?\n\n // usage/cost basics\n inputTokens Int?\n outputTokens Int?\n totalTokens Int?\n\n latencyMs Int?\n\n error String?\n\n @@index([chatId, createdAt])\n @@index([provider, model, createdAt])\n}\n", + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + } +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"handle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"chats\",\"kind\":\"object\",\"type\":\"Chat\",\"relationName\":\"ChatToUser\"}],\"dbName\":null},\"Chat\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"ChatToUser\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"messages\",\"kind\":\"object\",\"type\":\"Message\",\"relationName\":\"ChatToMessage\"},{\"name\":\"calls\",\"kind\":\"object\",\"type\":\"LlmCall\",\"relationName\":\"ChatToLlmCall\"}],\"dbName\":null},\"Message\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"chat\",\"kind\":\"object\",\"type\":\"Chat\",\"relationName\":\"ChatToMessage\"},{\"name\":\"chatId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"MessageRole\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"Json\"}],\"dbName\":null},\"LlmCall\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"chat\",\"kind\":\"object\",\"type\":\"Chat\",\"relationName\":\"ChatToLlmCall\"},{\"name\":\"chatId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider\",\"kind\":\"enum\",\"type\":\"Provider\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"request\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"response\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"inputTokens\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"outputTokens\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalTokens\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"latencyMs\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"error\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_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() + * // 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() + * // 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/concepts/components/prisma-client/transactions). + */ + $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.chat`: Exposes CRUD operations for the **Chat** model. + * Example usage: + * ```ts + * // Fetch zero or more Chats + * const chats = await prisma.chat.findMany() + * ``` + */ + get chat(): Prisma.ChatDelegate; + + /** + * `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.llmCall`: Exposes CRUD operations for the **LlmCall** model. + * Example usage: + * ```ts + * // Fetch zero or more LlmCalls + * const llmCalls = await prisma.llmCall.findMany() + * ``` + */ + get llmCall(): Prisma.LlmCallDelegate; +} + +export function getPrismaClientClass(): PrismaClientConstructor { + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/generated/prisma/internal/prismaNamespace.ts b/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 0000000..da797e2 --- /dev/null +++ b/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,1064 @@ + +/* !!! 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.js" +import { type PrismaClient } from "./class.js" + +export type * from '../models.js' + +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.3.0 + * Query Engine version: 9d6ad21cbbceab97458517b147a6a09ff43aa735 + */ +export const prismaVersion: PrismaVersion = { + client: "7.3.0", + engine: "9d6ad21cbbceab97458517b147a6a09ff43aa735" +} + +/** + * 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', + Chat: 'Chat', + Message: 'Message', + LlmCall: 'LlmCall' +} 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" | "chat" | "message" | "llmCall" + 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 + } + } + } + Chat: { + payload: Prisma.$ChatPayload + fields: Prisma.ChatFieldRefs + operations: { + findUnique: { + args: Prisma.ChatFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ChatFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ChatFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ChatFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ChatFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ChatCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ChatCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.ChatCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.ChatDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ChatUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ChatDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ChatUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.ChatUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.ChatUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ChatAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ChatGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ChatCountArgs + 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 + } + } + } + LlmCall: { + payload: Prisma.$LlmCallPayload + fields: Prisma.LlmCallFieldRefs + operations: { + findUnique: { + args: Prisma.LlmCallFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.LlmCallFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.LlmCallFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.LlmCallFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.LlmCallFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.LlmCallCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.LlmCallCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.LlmCallCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.LlmCallDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.LlmCallUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.LlmCallDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.LlmCallUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.LlmCallUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.LlmCallUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.LlmCallAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.LlmCallGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.LlmCallCountArgs + 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', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + handle: 'handle' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const ChatScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + title: 'title', + userId: 'userId' +} as const + +export type ChatScalarFieldEnum = (typeof ChatScalarFieldEnum)[keyof typeof ChatScalarFieldEnum] + + +export const MessageScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + chatId: 'chatId', + role: 'role', + content: 'content', + name: 'name', + metadata: 'metadata' +} as const + +export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum] + + +export const LlmCallScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + chatId: 'chatId', + provider: 'provider', + model: 'model', + request: 'request', + response: 'response', + inputTokens: 'inputTokens', + outputTokens: 'outputTokens', + totalTokens: 'totalTokens', + latencyMs: 'latencyMs', + error: 'error' +} as const + +export type LlmCallScalarFieldEnum = (typeof LlmCallScalarFieldEnum)[keyof typeof LlmCallScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const NullableJsonNullValueInput = { + DbNull: DbNull, + JsonNull: JsonNull +} as const + +export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + +export const JsonNullValueInput = { + JsonNull: JsonNull +} as const + +export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + +export const JsonNullValueFilter = { + DbNull: DbNull, + JsonNull: JsonNull, + AnyNull: AnyNull +} as const + +export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + +/** + * 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 'MessageRole' + */ +export type EnumMessageRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'MessageRole'> + + + +/** + * Reference to a field of type 'Json' + */ +export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> + + + +/** + * Reference to a field of type 'QueryMode' + */ +export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'> + + + +/** + * Reference to a field of type 'Provider' + */ +export type EnumProviderFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Provider'> + + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * 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 + chat?: Prisma.ChatOmit + message?: Prisma.MessageOmit + llmCall?: Prisma.LlmCallOmit +} + +/* 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/generated/prisma/internal/prismaNamespaceBrowser.ts b/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 0000000..e95969a --- /dev/null +++ b/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,171 @@ + +/* !!! 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.js' +export type * from './prismaNamespace.js' + +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', + Chat: 'Chat', + Message: 'Message', + LlmCall: 'LlmCall' +} 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', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + handle: 'handle' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const ChatScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + title: 'title', + userId: 'userId' +} as const + +export type ChatScalarFieldEnum = (typeof ChatScalarFieldEnum)[keyof typeof ChatScalarFieldEnum] + + +export const MessageScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + chatId: 'chatId', + role: 'role', + content: 'content', + name: 'name', + metadata: 'metadata' +} as const + +export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum] + + +export const LlmCallScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + chatId: 'chatId', + provider: 'provider', + model: 'model', + request: 'request', + response: 'response', + inputTokens: 'inputTokens', + outputTokens: 'outputTokens', + totalTokens: 'totalTokens', + latencyMs: 'latencyMs', + error: 'error' +} as const + +export type LlmCallScalarFieldEnum = (typeof LlmCallScalarFieldEnum)[keyof typeof LlmCallScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const NullableJsonNullValueInput = { + DbNull: DbNull, + JsonNull: JsonNull +} as const + +export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + +export const JsonNullValueInput = { + JsonNull: JsonNull +} as const + +export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + +export const JsonNullValueFilter = { + DbNull: DbNull, + JsonNull: JsonNull, + AnyNull: AnyNull +} as const + +export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + diff --git a/generated/prisma/models.ts b/generated/prisma/models.ts new file mode 100644 index 0000000..b6ad112 --- /dev/null +++ b/generated/prisma/models.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 is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/User.js' +export type * from './models/Chat.js' +export type * from './models/Message.js' +export type * from './models/LlmCall.js' +export type * from './commonInputTypes.js' \ No newline at end of file diff --git a/generated/prisma/models/Chat.ts b/generated/prisma/models/Chat.ts new file mode 100644 index 0000000..f7bf7f3 --- /dev/null +++ b/generated/prisma/models/Chat.ts @@ -0,0 +1,1611 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Chat` 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.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Chat + * + */ +export type ChatModel = runtime.Types.Result.DefaultSelection + +export type AggregateChat = { + _count: ChatCountAggregateOutputType | null + _min: ChatMinAggregateOutputType | null + _max: ChatMaxAggregateOutputType | null +} + +export type ChatMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + title: string | null + userId: string | null +} + +export type ChatMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + title: string | null + userId: string | null +} + +export type ChatCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + title: number + userId: number + _all: number +} + + +export type ChatMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + userId?: true +} + +export type ChatMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + userId?: true +} + +export type ChatCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + userId?: true + _all?: true +} + +export type ChatAggregateArgs = { + /** + * Filter which Chat to aggregate. + */ + where?: Prisma.ChatWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Chats to fetch. + */ + orderBy?: Prisma.ChatOrderByWithRelationInput | Prisma.ChatOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ChatWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Chats 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` Chats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Chats + **/ + _count?: true | ChatCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ChatMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ChatMaxAggregateInputType +} + +export type GetChatAggregateType = { + [P in keyof T & keyof AggregateChat]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ChatGroupByArgs = { + where?: Prisma.ChatWhereInput + orderBy?: Prisma.ChatOrderByWithAggregationInput | Prisma.ChatOrderByWithAggregationInput[] + by: Prisma.ChatScalarFieldEnum[] | Prisma.ChatScalarFieldEnum + having?: Prisma.ChatScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ChatCountAggregateInputType | true + _min?: ChatMinAggregateInputType + _max?: ChatMaxAggregateInputType +} + +export type ChatGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + title: string | null + userId: string | null + _count: ChatCountAggregateOutputType | null + _min: ChatMinAggregateOutputType | null + _max: ChatMaxAggregateOutputType | null +} + +type GetChatGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ChatGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ChatWhereInput = { + AND?: Prisma.ChatWhereInput | Prisma.ChatWhereInput[] + OR?: Prisma.ChatWhereInput[] + NOT?: Prisma.ChatWhereInput | Prisma.ChatWhereInput[] + id?: Prisma.StringFilter<"Chat"> | string + createdAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + title?: Prisma.StringNullableFilter<"Chat"> | string | null + userId?: Prisma.StringNullableFilter<"Chat"> | string | null + user?: Prisma.XOR | null + messages?: Prisma.MessageListRelationFilter + calls?: Prisma.LlmCallListRelationFilter +} + +export type ChatOrderByWithRelationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrderInput | Prisma.SortOrder + userId?: Prisma.SortOrderInput | Prisma.SortOrder + user?: Prisma.UserOrderByWithRelationInput + messages?: Prisma.MessageOrderByRelationAggregateInput + calls?: Prisma.LlmCallOrderByRelationAggregateInput +} + +export type ChatWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.ChatWhereInput | Prisma.ChatWhereInput[] + OR?: Prisma.ChatWhereInput[] + NOT?: Prisma.ChatWhereInput | Prisma.ChatWhereInput[] + createdAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + title?: Prisma.StringNullableFilter<"Chat"> | string | null + userId?: Prisma.StringNullableFilter<"Chat"> | string | null + user?: Prisma.XOR | null + messages?: Prisma.MessageListRelationFilter + calls?: Prisma.LlmCallListRelationFilter +}, "id"> + +export type ChatOrderByWithAggregationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrderInput | Prisma.SortOrder + userId?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.ChatCountOrderByAggregateInput + _max?: Prisma.ChatMaxOrderByAggregateInput + _min?: Prisma.ChatMinOrderByAggregateInput +} + +export type ChatScalarWhereWithAggregatesInput = { + AND?: Prisma.ChatScalarWhereWithAggregatesInput | Prisma.ChatScalarWhereWithAggregatesInput[] + OR?: Prisma.ChatScalarWhereWithAggregatesInput[] + NOT?: Prisma.ChatScalarWhereWithAggregatesInput | Prisma.ChatScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Chat"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Chat"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Chat"> | Date | string + title?: Prisma.StringNullableWithAggregatesFilter<"Chat"> | string | null + userId?: Prisma.StringNullableWithAggregatesFilter<"Chat"> | string | null +} + +export type ChatCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + user?: Prisma.UserCreateNestedOneWithoutChatsInput + messages?: Prisma.MessageCreateNestedManyWithoutChatInput + calls?: Prisma.LlmCallCreateNestedManyWithoutChatInput +} + +export type ChatUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + userId?: string | null + messages?: Prisma.MessageUncheckedCreateNestedManyWithoutChatInput + calls?: Prisma.LlmCallUncheckedCreateNestedManyWithoutChatInput +} + +export type ChatUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + user?: Prisma.UserUpdateOneWithoutChatsNestedInput + messages?: Prisma.MessageUpdateManyWithoutChatNestedInput + calls?: Prisma.LlmCallUpdateManyWithoutChatNestedInput +} + +export type ChatUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + messages?: Prisma.MessageUncheckedUpdateManyWithoutChatNestedInput + calls?: Prisma.LlmCallUncheckedUpdateManyWithoutChatNestedInput +} + +export type ChatCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + userId?: string | null +} + +export type ChatUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type ChatUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type ChatListRelationFilter = { + every?: Prisma.ChatWhereInput + some?: Prisma.ChatWhereInput + none?: Prisma.ChatWhereInput +} + +export type ChatOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type ChatCountOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + userId?: Prisma.SortOrder +} + +export type ChatMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + userId?: Prisma.SortOrder +} + +export type ChatMinOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + userId?: Prisma.SortOrder +} + +export type ChatScalarRelationFilter = { + is?: Prisma.ChatWhereInput + isNot?: Prisma.ChatWhereInput +} + +export type ChatCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.ChatCreateWithoutUserInput[] | Prisma.ChatUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutUserInput | Prisma.ChatCreateOrConnectWithoutUserInput[] + createMany?: Prisma.ChatCreateManyUserInputEnvelope + connect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] +} + +export type ChatUncheckedCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.ChatCreateWithoutUserInput[] | Prisma.ChatUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutUserInput | Prisma.ChatCreateOrConnectWithoutUserInput[] + createMany?: Prisma.ChatCreateManyUserInputEnvelope + connect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] +} + +export type ChatUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.ChatCreateWithoutUserInput[] | Prisma.ChatUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutUserInput | Prisma.ChatCreateOrConnectWithoutUserInput[] + upsert?: Prisma.ChatUpsertWithWhereUniqueWithoutUserInput | Prisma.ChatUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.ChatCreateManyUserInputEnvelope + set?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + disconnect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + delete?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + connect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + update?: Prisma.ChatUpdateWithWhereUniqueWithoutUserInput | Prisma.ChatUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.ChatUpdateManyWithWhereWithoutUserInput | Prisma.ChatUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.ChatScalarWhereInput | Prisma.ChatScalarWhereInput[] +} + +export type ChatUncheckedUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.ChatCreateWithoutUserInput[] | Prisma.ChatUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutUserInput | Prisma.ChatCreateOrConnectWithoutUserInput[] + upsert?: Prisma.ChatUpsertWithWhereUniqueWithoutUserInput | Prisma.ChatUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.ChatCreateManyUserInputEnvelope + set?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + disconnect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + delete?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + connect?: Prisma.ChatWhereUniqueInput | Prisma.ChatWhereUniqueInput[] + update?: Prisma.ChatUpdateWithWhereUniqueWithoutUserInput | Prisma.ChatUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.ChatUpdateManyWithWhereWithoutUserInput | Prisma.ChatUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.ChatScalarWhereInput | Prisma.ChatScalarWhereInput[] +} + +export type ChatCreateNestedOneWithoutMessagesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutMessagesInput + connect?: Prisma.ChatWhereUniqueInput +} + +export type ChatUpdateOneRequiredWithoutMessagesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutMessagesInput + upsert?: Prisma.ChatUpsertWithoutMessagesInput + connect?: Prisma.ChatWhereUniqueInput + update?: Prisma.XOR, Prisma.ChatUncheckedUpdateWithoutMessagesInput> +} + +export type ChatCreateNestedOneWithoutCallsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutCallsInput + connect?: Prisma.ChatWhereUniqueInput +} + +export type ChatUpdateOneRequiredWithoutCallsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ChatCreateOrConnectWithoutCallsInput + upsert?: Prisma.ChatUpsertWithoutCallsInput + connect?: Prisma.ChatWhereUniqueInput + update?: Prisma.XOR, Prisma.ChatUncheckedUpdateWithoutCallsInput> +} + +export type ChatCreateWithoutUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + messages?: Prisma.MessageCreateNestedManyWithoutChatInput + calls?: Prisma.LlmCallCreateNestedManyWithoutChatInput +} + +export type ChatUncheckedCreateWithoutUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + messages?: Prisma.MessageUncheckedCreateNestedManyWithoutChatInput + calls?: Prisma.LlmCallUncheckedCreateNestedManyWithoutChatInput +} + +export type ChatCreateOrConnectWithoutUserInput = { + where: Prisma.ChatWhereUniqueInput + create: Prisma.XOR +} + +export type ChatCreateManyUserInputEnvelope = { + data: Prisma.ChatCreateManyUserInput | Prisma.ChatCreateManyUserInput[] +} + +export type ChatUpsertWithWhereUniqueWithoutUserInput = { + where: Prisma.ChatWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ChatUpdateWithWhereUniqueWithoutUserInput = { + where: Prisma.ChatWhereUniqueInput + data: Prisma.XOR +} + +export type ChatUpdateManyWithWhereWithoutUserInput = { + where: Prisma.ChatScalarWhereInput + data: Prisma.XOR +} + +export type ChatScalarWhereInput = { + AND?: Prisma.ChatScalarWhereInput | Prisma.ChatScalarWhereInput[] + OR?: Prisma.ChatScalarWhereInput[] + NOT?: Prisma.ChatScalarWhereInput | Prisma.ChatScalarWhereInput[] + id?: Prisma.StringFilter<"Chat"> | string + createdAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Chat"> | Date | string + title?: Prisma.StringNullableFilter<"Chat"> | string | null + userId?: Prisma.StringNullableFilter<"Chat"> | string | null +} + +export type ChatCreateWithoutMessagesInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + user?: Prisma.UserCreateNestedOneWithoutChatsInput + calls?: Prisma.LlmCallCreateNestedManyWithoutChatInput +} + +export type ChatUncheckedCreateWithoutMessagesInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + userId?: string | null + calls?: Prisma.LlmCallUncheckedCreateNestedManyWithoutChatInput +} + +export type ChatCreateOrConnectWithoutMessagesInput = { + where: Prisma.ChatWhereUniqueInput + create: Prisma.XOR +} + +export type ChatUpsertWithoutMessagesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ChatWhereInput +} + +export type ChatUpdateToOneWithWhereWithoutMessagesInput = { + where?: Prisma.ChatWhereInput + data: Prisma.XOR +} + +export type ChatUpdateWithoutMessagesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + user?: Prisma.UserUpdateOneWithoutChatsNestedInput + calls?: Prisma.LlmCallUpdateManyWithoutChatNestedInput +} + +export type ChatUncheckedUpdateWithoutMessagesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + calls?: Prisma.LlmCallUncheckedUpdateManyWithoutChatNestedInput +} + +export type ChatCreateWithoutCallsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + user?: Prisma.UserCreateNestedOneWithoutChatsInput + messages?: Prisma.MessageCreateNestedManyWithoutChatInput +} + +export type ChatUncheckedCreateWithoutCallsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null + userId?: string | null + messages?: Prisma.MessageUncheckedCreateNestedManyWithoutChatInput +} + +export type ChatCreateOrConnectWithoutCallsInput = { + where: Prisma.ChatWhereUniqueInput + create: Prisma.XOR +} + +export type ChatUpsertWithoutCallsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ChatWhereInput +} + +export type ChatUpdateToOneWithWhereWithoutCallsInput = { + where?: Prisma.ChatWhereInput + data: Prisma.XOR +} + +export type ChatUpdateWithoutCallsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + user?: Prisma.UserUpdateOneWithoutChatsNestedInput + messages?: Prisma.MessageUpdateManyWithoutChatNestedInput +} + +export type ChatUncheckedUpdateWithoutCallsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + messages?: Prisma.MessageUncheckedUpdateManyWithoutChatNestedInput +} + +export type ChatCreateManyUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + title?: string | null +} + +export type ChatUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + messages?: Prisma.MessageUpdateManyWithoutChatNestedInput + calls?: Prisma.LlmCallUpdateManyWithoutChatNestedInput +} + +export type ChatUncheckedUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + messages?: Prisma.MessageUncheckedUpdateManyWithoutChatNestedInput + calls?: Prisma.LlmCallUncheckedUpdateManyWithoutChatNestedInput +} + +export type ChatUncheckedUpdateManyWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type ChatCountOutputType + */ + +export type ChatCountOutputType = { + messages: number + calls: number +} + +export type ChatCountOutputTypeSelect = { + messages?: boolean | ChatCountOutputTypeCountMessagesArgs + calls?: boolean | ChatCountOutputTypeCountCallsArgs +} + +/** + * ChatCountOutputType without action + */ +export type ChatCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the ChatCountOutputType + */ + select?: Prisma.ChatCountOutputTypeSelect | null +} + +/** + * ChatCountOutputType without action + */ +export type ChatCountOutputTypeCountMessagesArgs = { + where?: Prisma.MessageWhereInput +} + +/** + * ChatCountOutputType without action + */ +export type ChatCountOutputTypeCountCallsArgs = { + where?: Prisma.LlmCallWhereInput +} + + +export type ChatSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + userId?: boolean + user?: boolean | Prisma.Chat$userArgs + messages?: boolean | Prisma.Chat$messagesArgs + calls?: boolean | Prisma.Chat$callsArgs + _count?: boolean | Prisma.ChatCountOutputTypeDefaultArgs +}, ExtArgs["result"]["chat"]> + +export type ChatSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + userId?: boolean + user?: boolean | Prisma.Chat$userArgs +}, ExtArgs["result"]["chat"]> + +export type ChatSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + userId?: boolean + user?: boolean | Prisma.Chat$userArgs +}, ExtArgs["result"]["chat"]> + +export type ChatSelectScalar = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + userId?: boolean +} + +export type ChatOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "updatedAt" | "title" | "userId", ExtArgs["result"]["chat"]> +export type ChatInclude = { + user?: boolean | Prisma.Chat$userArgs + messages?: boolean | Prisma.Chat$messagesArgs + calls?: boolean | Prisma.Chat$callsArgs + _count?: boolean | Prisma.ChatCountOutputTypeDefaultArgs +} +export type ChatIncludeCreateManyAndReturn = { + user?: boolean | Prisma.Chat$userArgs +} +export type ChatIncludeUpdateManyAndReturn = { + user?: boolean | Prisma.Chat$userArgs +} + +export type $ChatPayload = { + name: "Chat" + objects: { + user: Prisma.$UserPayload | null + messages: Prisma.$MessagePayload[] + calls: Prisma.$LlmCallPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + createdAt: Date + updatedAt: Date + title: string | null + userId: string | null + }, ExtArgs["result"]["chat"]> + composites: {} +} + +export type ChatGetPayload = runtime.Types.Result.GetResult + +export type ChatCountArgs = + Omit & { + select?: ChatCountAggregateInputType | true + } + +export interface ChatDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Chat'], meta: { name: 'Chat' } } + /** + * Find zero or one Chat that matches the filter. + * @param {ChatFindUniqueArgs} args - Arguments to find a Chat + * @example + * // Get one Chat + * const chat = await prisma.chat.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Chat that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ChatFindUniqueOrThrowArgs} args - Arguments to find a Chat + * @example + * // Get one Chat + * const chat = await prisma.chat.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Chat 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 {ChatFindFirstArgs} args - Arguments to find a Chat + * @example + * // Get one Chat + * const chat = await prisma.chat.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Chat 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 {ChatFindFirstOrThrowArgs} args - Arguments to find a Chat + * @example + * // Get one Chat + * const chat = await prisma.chat.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Chats 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 {ChatFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Chats + * const chats = await prisma.chat.findMany() + * + * // Get first 10 Chats + * const chats = await prisma.chat.findMany({ take: 10 }) + * + * // Only select the `id` + * const chatWithIdOnly = await prisma.chat.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Chat. + * @param {ChatCreateArgs} args - Arguments to create a Chat. + * @example + * // Create one Chat + * const Chat = await prisma.chat.create({ + * data: { + * // ... data to create a Chat + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Chats. + * @param {ChatCreateManyArgs} args - Arguments to create many Chats. + * @example + * // Create many Chats + * const chat = await prisma.chat.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Chats and returns the data saved in the database. + * @param {ChatCreateManyAndReturnArgs} args - Arguments to create many Chats. + * @example + * // Create many Chats + * const chat = await prisma.chat.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Chats and only return the `id` + * const chatWithIdOnly = await prisma.chat.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 Chat. + * @param {ChatDeleteArgs} args - Arguments to delete one Chat. + * @example + * // Delete one Chat + * const Chat = await prisma.chat.delete({ + * where: { + * // ... filter to delete one Chat + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Chat. + * @param {ChatUpdateArgs} args - Arguments to update one Chat. + * @example + * // Update one Chat + * const chat = await prisma.chat.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Chats. + * @param {ChatDeleteManyArgs} args - Arguments to filter Chats to delete. + * @example + * // Delete a few Chats + * const { count } = await prisma.chat.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Chats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChatUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Chats + * const chat = await prisma.chat.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Chats and returns the data updated in the database. + * @param {ChatUpdateManyAndReturnArgs} args - Arguments to update many Chats. + * @example + * // Update many Chats + * const chat = await prisma.chat.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Chats and only return the `id` + * const chatWithIdOnly = await prisma.chat.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 Chat. + * @param {ChatUpsertArgs} args - Arguments to update or create a Chat. + * @example + * // Update or create a Chat + * const chat = await prisma.chat.upsert({ + * create: { + * // ... data to create a Chat + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Chat we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ChatClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Chats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChatCountArgs} args - Arguments to filter Chats to count. + * @example + * // Count the number of Chats + * const count = await prisma.chat.count({ + * where: { + * // ... the filter for the Chats 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 Chat. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChatAggregateArgs} 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 Chat. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ChatGroupByArgs} 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 ChatGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ChatGroupByArgs['orderBy'] } + : { orderBy?: ChatGroupByArgs['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 ? GetChatGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Chat model + */ +readonly fields: ChatFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Chat. + * 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__ChatClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + messages = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + calls = {}>(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 Chat model + */ +export interface ChatFieldRefs { + readonly id: Prisma.FieldRef<"Chat", 'String'> + readonly createdAt: Prisma.FieldRef<"Chat", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Chat", 'DateTime'> + readonly title: Prisma.FieldRef<"Chat", 'String'> + readonly userId: Prisma.FieldRef<"Chat", 'String'> +} + + +// Custom InputTypes +/** + * Chat findUnique + */ +export type ChatFindUniqueArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter, which Chat to fetch. + */ + where: Prisma.ChatWhereUniqueInput +} + +/** + * Chat findUniqueOrThrow + */ +export type ChatFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter, which Chat to fetch. + */ + where: Prisma.ChatWhereUniqueInput +} + +/** + * Chat findFirst + */ +export type ChatFindFirstArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter, which Chat to fetch. + */ + where?: Prisma.ChatWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Chats to fetch. + */ + orderBy?: Prisma.ChatOrderByWithRelationInput | Prisma.ChatOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Chats. + */ + cursor?: Prisma.ChatWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Chats 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` Chats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Chats. + */ + distinct?: Prisma.ChatScalarFieldEnum | Prisma.ChatScalarFieldEnum[] +} + +/** + * Chat findFirstOrThrow + */ +export type ChatFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter, which Chat to fetch. + */ + where?: Prisma.ChatWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Chats to fetch. + */ + orderBy?: Prisma.ChatOrderByWithRelationInput | Prisma.ChatOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Chats. + */ + cursor?: Prisma.ChatWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Chats 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` Chats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Chats. + */ + distinct?: Prisma.ChatScalarFieldEnum | Prisma.ChatScalarFieldEnum[] +} + +/** + * Chat findMany + */ +export type ChatFindManyArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter, which Chats to fetch. + */ + where?: Prisma.ChatWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Chats to fetch. + */ + orderBy?: Prisma.ChatOrderByWithRelationInput | Prisma.ChatOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Chats. + */ + cursor?: Prisma.ChatWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Chats 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` Chats. + */ + skip?: number + distinct?: Prisma.ChatScalarFieldEnum | Prisma.ChatScalarFieldEnum[] +} + +/** + * Chat create + */ +export type ChatCreateArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * The data needed to create a Chat. + */ + data: Prisma.XOR +} + +/** + * Chat createMany + */ +export type ChatCreateManyArgs = { + /** + * The data used to create many Chats. + */ + data: Prisma.ChatCreateManyInput | Prisma.ChatCreateManyInput[] +} + +/** + * Chat createManyAndReturn + */ +export type ChatCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * The data used to create many Chats. + */ + data: Prisma.ChatCreateManyInput | Prisma.ChatCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatIncludeCreateManyAndReturn | null +} + +/** + * Chat update + */ +export type ChatUpdateArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * The data needed to update a Chat. + */ + data: Prisma.XOR + /** + * Choose, which Chat to update. + */ + where: Prisma.ChatWhereUniqueInput +} + +/** + * Chat updateMany + */ +export type ChatUpdateManyArgs = { + /** + * The data used to update Chats. + */ + data: Prisma.XOR + /** + * Filter which Chats to update + */ + where?: Prisma.ChatWhereInput + /** + * Limit how many Chats to update. + */ + limit?: number +} + +/** + * Chat updateManyAndReturn + */ +export type ChatUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * The data used to update Chats. + */ + data: Prisma.XOR + /** + * Filter which Chats to update + */ + where?: Prisma.ChatWhereInput + /** + * Limit how many Chats to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatIncludeUpdateManyAndReturn | null +} + +/** + * Chat upsert + */ +export type ChatUpsertArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * The filter to search for the Chat to update in case it exists. + */ + where: Prisma.ChatWhereUniqueInput + /** + * In case the Chat found by the `where` argument doesn't exist, create a new Chat with this data. + */ + create: Prisma.XOR + /** + * In case the Chat was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Chat delete + */ +export type ChatDeleteArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + /** + * Filter which Chat to delete. + */ + where: Prisma.ChatWhereUniqueInput +} + +/** + * Chat deleteMany + */ +export type ChatDeleteManyArgs = { + /** + * Filter which Chats to delete + */ + where?: Prisma.ChatWhereInput + /** + * Limit how many Chats to delete. + */ + limit?: number +} + +/** + * Chat.user + */ +export type Chat$userArgs = { + /** + * 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 +} + +/** + * Chat.messages + */ +export type Chat$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[] +} + +/** + * Chat.calls + */ +export type Chat$callsArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + where?: Prisma.LlmCallWhereInput + orderBy?: Prisma.LlmCallOrderByWithRelationInput | Prisma.LlmCallOrderByWithRelationInput[] + cursor?: Prisma.LlmCallWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.LlmCallScalarFieldEnum | Prisma.LlmCallScalarFieldEnum[] +} + +/** + * Chat without action + */ +export type ChatDefaultArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null +} diff --git a/generated/prisma/models/LlmCall.ts b/generated/prisma/models/LlmCall.ts new file mode 100644 index 0000000..88754cd --- /dev/null +++ b/generated/prisma/models/LlmCall.ts @@ -0,0 +1,1644 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `LlmCall` 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.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model LlmCall + * + */ +export type LlmCallModel = runtime.Types.Result.DefaultSelection + +export type AggregateLlmCall = { + _count: LlmCallCountAggregateOutputType | null + _avg: LlmCallAvgAggregateOutputType | null + _sum: LlmCallSumAggregateOutputType | null + _min: LlmCallMinAggregateOutputType | null + _max: LlmCallMaxAggregateOutputType | null +} + +export type LlmCallAvgAggregateOutputType = { + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null +} + +export type LlmCallSumAggregateOutputType = { + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null +} + +export type LlmCallMinAggregateOutputType = { + id: string | null + createdAt: Date | null + chatId: string | null + provider: $Enums.Provider | null + model: string | null + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null + error: string | null +} + +export type LlmCallMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + chatId: string | null + provider: $Enums.Provider | null + model: string | null + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null + error: string | null +} + +export type LlmCallCountAggregateOutputType = { + id: number + createdAt: number + chatId: number + provider: number + model: number + request: number + response: number + inputTokens: number + outputTokens: number + totalTokens: number + latencyMs: number + error: number + _all: number +} + + +export type LlmCallAvgAggregateInputType = { + inputTokens?: true + outputTokens?: true + totalTokens?: true + latencyMs?: true +} + +export type LlmCallSumAggregateInputType = { + inputTokens?: true + outputTokens?: true + totalTokens?: true + latencyMs?: true +} + +export type LlmCallMinAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + provider?: true + model?: true + inputTokens?: true + outputTokens?: true + totalTokens?: true + latencyMs?: true + error?: true +} + +export type LlmCallMaxAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + provider?: true + model?: true + inputTokens?: true + outputTokens?: true + totalTokens?: true + latencyMs?: true + error?: true +} + +export type LlmCallCountAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + provider?: true + model?: true + request?: true + response?: true + inputTokens?: true + outputTokens?: true + totalTokens?: true + latencyMs?: true + error?: true + _all?: true +} + +export type LlmCallAggregateArgs = { + /** + * Filter which LlmCall to aggregate. + */ + where?: Prisma.LlmCallWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of LlmCalls to fetch. + */ + orderBy?: Prisma.LlmCallOrderByWithRelationInput | Prisma.LlmCallOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.LlmCallWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` LlmCalls 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` LlmCalls. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned LlmCalls + **/ + _count?: true | LlmCallCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: LlmCallAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: LlmCallSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: LlmCallMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: LlmCallMaxAggregateInputType +} + +export type GetLlmCallAggregateType = { + [P in keyof T & keyof AggregateLlmCall]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type LlmCallGroupByArgs = { + where?: Prisma.LlmCallWhereInput + orderBy?: Prisma.LlmCallOrderByWithAggregationInput | Prisma.LlmCallOrderByWithAggregationInput[] + by: Prisma.LlmCallScalarFieldEnum[] | Prisma.LlmCallScalarFieldEnum + having?: Prisma.LlmCallScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: LlmCallCountAggregateInputType | true + _avg?: LlmCallAvgAggregateInputType + _sum?: LlmCallSumAggregateInputType + _min?: LlmCallMinAggregateInputType + _max?: LlmCallMaxAggregateInputType +} + +export type LlmCallGroupByOutputType = { + id: string + createdAt: Date + chatId: string + provider: $Enums.Provider + model: string + request: runtime.JsonValue + response: runtime.JsonValue | null + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null + error: string | null + _count: LlmCallCountAggregateOutputType | null + _avg: LlmCallAvgAggregateOutputType | null + _sum: LlmCallSumAggregateOutputType | null + _min: LlmCallMinAggregateOutputType | null + _max: LlmCallMaxAggregateOutputType | null +} + +type GetLlmCallGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof LlmCallGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type LlmCallWhereInput = { + AND?: Prisma.LlmCallWhereInput | Prisma.LlmCallWhereInput[] + OR?: Prisma.LlmCallWhereInput[] + NOT?: Prisma.LlmCallWhereInput | Prisma.LlmCallWhereInput[] + id?: Prisma.StringFilter<"LlmCall"> | string + createdAt?: Prisma.DateTimeFilter<"LlmCall"> | Date | string + chatId?: Prisma.StringFilter<"LlmCall"> | string + provider?: Prisma.EnumProviderFilter<"LlmCall"> | $Enums.Provider + model?: Prisma.StringFilter<"LlmCall"> | string + request?: Prisma.JsonFilter<"LlmCall"> + response?: Prisma.JsonNullableFilter<"LlmCall"> + inputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + outputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + totalTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + latencyMs?: Prisma.IntNullableFilter<"LlmCall"> | number | null + error?: Prisma.StringNullableFilter<"LlmCall"> | string | null + chat?: Prisma.XOR +} + +export type LlmCallOrderByWithRelationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + provider?: Prisma.SortOrder + model?: Prisma.SortOrder + request?: Prisma.SortOrder + response?: Prisma.SortOrderInput | Prisma.SortOrder + inputTokens?: Prisma.SortOrderInput | Prisma.SortOrder + outputTokens?: Prisma.SortOrderInput | Prisma.SortOrder + totalTokens?: Prisma.SortOrderInput | Prisma.SortOrder + latencyMs?: Prisma.SortOrderInput | Prisma.SortOrder + error?: Prisma.SortOrderInput | Prisma.SortOrder + chat?: Prisma.ChatOrderByWithRelationInput +} + +export type LlmCallWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.LlmCallWhereInput | Prisma.LlmCallWhereInput[] + OR?: Prisma.LlmCallWhereInput[] + NOT?: Prisma.LlmCallWhereInput | Prisma.LlmCallWhereInput[] + createdAt?: Prisma.DateTimeFilter<"LlmCall"> | Date | string + chatId?: Prisma.StringFilter<"LlmCall"> | string + provider?: Prisma.EnumProviderFilter<"LlmCall"> | $Enums.Provider + model?: Prisma.StringFilter<"LlmCall"> | string + request?: Prisma.JsonFilter<"LlmCall"> + response?: Prisma.JsonNullableFilter<"LlmCall"> + inputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + outputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + totalTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + latencyMs?: Prisma.IntNullableFilter<"LlmCall"> | number | null + error?: Prisma.StringNullableFilter<"LlmCall"> | string | null + chat?: Prisma.XOR +}, "id"> + +export type LlmCallOrderByWithAggregationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + provider?: Prisma.SortOrder + model?: Prisma.SortOrder + request?: Prisma.SortOrder + response?: Prisma.SortOrderInput | Prisma.SortOrder + inputTokens?: Prisma.SortOrderInput | Prisma.SortOrder + outputTokens?: Prisma.SortOrderInput | Prisma.SortOrder + totalTokens?: Prisma.SortOrderInput | Prisma.SortOrder + latencyMs?: Prisma.SortOrderInput | Prisma.SortOrder + error?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.LlmCallCountOrderByAggregateInput + _avg?: Prisma.LlmCallAvgOrderByAggregateInput + _max?: Prisma.LlmCallMaxOrderByAggregateInput + _min?: Prisma.LlmCallMinOrderByAggregateInput + _sum?: Prisma.LlmCallSumOrderByAggregateInput +} + +export type LlmCallScalarWhereWithAggregatesInput = { + AND?: Prisma.LlmCallScalarWhereWithAggregatesInput | Prisma.LlmCallScalarWhereWithAggregatesInput[] + OR?: Prisma.LlmCallScalarWhereWithAggregatesInput[] + NOT?: Prisma.LlmCallScalarWhereWithAggregatesInput | Prisma.LlmCallScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"LlmCall"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"LlmCall"> | Date | string + chatId?: Prisma.StringWithAggregatesFilter<"LlmCall"> | string + provider?: Prisma.EnumProviderWithAggregatesFilter<"LlmCall"> | $Enums.Provider + model?: Prisma.StringWithAggregatesFilter<"LlmCall"> | string + request?: Prisma.JsonWithAggregatesFilter<"LlmCall"> + response?: Prisma.JsonNullableWithAggregatesFilter<"LlmCall"> + inputTokens?: Prisma.IntNullableWithAggregatesFilter<"LlmCall"> | number | null + outputTokens?: Prisma.IntNullableWithAggregatesFilter<"LlmCall"> | number | null + totalTokens?: Prisma.IntNullableWithAggregatesFilter<"LlmCall"> | number | null + latencyMs?: Prisma.IntNullableWithAggregatesFilter<"LlmCall"> | number | null + error?: Prisma.StringNullableWithAggregatesFilter<"LlmCall"> | string | null +} + +export type LlmCallCreateInput = { + id?: string + createdAt?: Date | string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null + chat: Prisma.ChatCreateNestedOneWithoutCallsInput +} + +export type LlmCallUncheckedCreateInput = { + id?: string + createdAt?: Date | string + chatId: string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null +} + +export type LlmCallUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + chat?: Prisma.ChatUpdateOneRequiredWithoutCallsNestedInput +} + +export type LlmCallUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + chatId?: Prisma.StringFieldUpdateOperationsInput | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type LlmCallCreateManyInput = { + id?: string + createdAt?: Date | string + chatId: string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null +} + +export type LlmCallUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type LlmCallUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + chatId?: Prisma.StringFieldUpdateOperationsInput | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type LlmCallListRelationFilter = { + every?: Prisma.LlmCallWhereInput + some?: Prisma.LlmCallWhereInput + none?: Prisma.LlmCallWhereInput +} + +export type LlmCallOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type LlmCallCountOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + provider?: Prisma.SortOrder + model?: Prisma.SortOrder + request?: Prisma.SortOrder + response?: Prisma.SortOrder + inputTokens?: Prisma.SortOrder + outputTokens?: Prisma.SortOrder + totalTokens?: Prisma.SortOrder + latencyMs?: Prisma.SortOrder + error?: Prisma.SortOrder +} + +export type LlmCallAvgOrderByAggregateInput = { + inputTokens?: Prisma.SortOrder + outputTokens?: Prisma.SortOrder + totalTokens?: Prisma.SortOrder + latencyMs?: Prisma.SortOrder +} + +export type LlmCallMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + provider?: Prisma.SortOrder + model?: Prisma.SortOrder + inputTokens?: Prisma.SortOrder + outputTokens?: Prisma.SortOrder + totalTokens?: Prisma.SortOrder + latencyMs?: Prisma.SortOrder + error?: Prisma.SortOrder +} + +export type LlmCallMinOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + provider?: Prisma.SortOrder + model?: Prisma.SortOrder + inputTokens?: Prisma.SortOrder + outputTokens?: Prisma.SortOrder + totalTokens?: Prisma.SortOrder + latencyMs?: Prisma.SortOrder + error?: Prisma.SortOrder +} + +export type LlmCallSumOrderByAggregateInput = { + inputTokens?: Prisma.SortOrder + outputTokens?: Prisma.SortOrder + totalTokens?: Prisma.SortOrder + latencyMs?: Prisma.SortOrder +} + +export type LlmCallCreateNestedManyWithoutChatInput = { + create?: Prisma.XOR | Prisma.LlmCallCreateWithoutChatInput[] | Prisma.LlmCallUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.LlmCallCreateOrConnectWithoutChatInput | Prisma.LlmCallCreateOrConnectWithoutChatInput[] + createMany?: Prisma.LlmCallCreateManyChatInputEnvelope + connect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] +} + +export type LlmCallUncheckedCreateNestedManyWithoutChatInput = { + create?: Prisma.XOR | Prisma.LlmCallCreateWithoutChatInput[] | Prisma.LlmCallUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.LlmCallCreateOrConnectWithoutChatInput | Prisma.LlmCallCreateOrConnectWithoutChatInput[] + createMany?: Prisma.LlmCallCreateManyChatInputEnvelope + connect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] +} + +export type LlmCallUpdateManyWithoutChatNestedInput = { + create?: Prisma.XOR | Prisma.LlmCallCreateWithoutChatInput[] | Prisma.LlmCallUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.LlmCallCreateOrConnectWithoutChatInput | Prisma.LlmCallCreateOrConnectWithoutChatInput[] + upsert?: Prisma.LlmCallUpsertWithWhereUniqueWithoutChatInput | Prisma.LlmCallUpsertWithWhereUniqueWithoutChatInput[] + createMany?: Prisma.LlmCallCreateManyChatInputEnvelope + set?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + disconnect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + delete?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + connect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + update?: Prisma.LlmCallUpdateWithWhereUniqueWithoutChatInput | Prisma.LlmCallUpdateWithWhereUniqueWithoutChatInput[] + updateMany?: Prisma.LlmCallUpdateManyWithWhereWithoutChatInput | Prisma.LlmCallUpdateManyWithWhereWithoutChatInput[] + deleteMany?: Prisma.LlmCallScalarWhereInput | Prisma.LlmCallScalarWhereInput[] +} + +export type LlmCallUncheckedUpdateManyWithoutChatNestedInput = { + create?: Prisma.XOR | Prisma.LlmCallCreateWithoutChatInput[] | Prisma.LlmCallUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.LlmCallCreateOrConnectWithoutChatInput | Prisma.LlmCallCreateOrConnectWithoutChatInput[] + upsert?: Prisma.LlmCallUpsertWithWhereUniqueWithoutChatInput | Prisma.LlmCallUpsertWithWhereUniqueWithoutChatInput[] + createMany?: Prisma.LlmCallCreateManyChatInputEnvelope + set?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + disconnect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + delete?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + connect?: Prisma.LlmCallWhereUniqueInput | Prisma.LlmCallWhereUniqueInput[] + update?: Prisma.LlmCallUpdateWithWhereUniqueWithoutChatInput | Prisma.LlmCallUpdateWithWhereUniqueWithoutChatInput[] + updateMany?: Prisma.LlmCallUpdateManyWithWhereWithoutChatInput | Prisma.LlmCallUpdateManyWithWhereWithoutChatInput[] + deleteMany?: Prisma.LlmCallScalarWhereInput | Prisma.LlmCallScalarWhereInput[] +} + +export type EnumProviderFieldUpdateOperationsInput = { + set?: $Enums.Provider +} + +export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type LlmCallCreateWithoutChatInput = { + id?: string + createdAt?: Date | string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null +} + +export type LlmCallUncheckedCreateWithoutChatInput = { + id?: string + createdAt?: Date | string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null +} + +export type LlmCallCreateOrConnectWithoutChatInput = { + where: Prisma.LlmCallWhereUniqueInput + create: Prisma.XOR +} + +export type LlmCallCreateManyChatInputEnvelope = { + data: Prisma.LlmCallCreateManyChatInput | Prisma.LlmCallCreateManyChatInput[] +} + +export type LlmCallUpsertWithWhereUniqueWithoutChatInput = { + where: Prisma.LlmCallWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type LlmCallUpdateWithWhereUniqueWithoutChatInput = { + where: Prisma.LlmCallWhereUniqueInput + data: Prisma.XOR +} + +export type LlmCallUpdateManyWithWhereWithoutChatInput = { + where: Prisma.LlmCallScalarWhereInput + data: Prisma.XOR +} + +export type LlmCallScalarWhereInput = { + AND?: Prisma.LlmCallScalarWhereInput | Prisma.LlmCallScalarWhereInput[] + OR?: Prisma.LlmCallScalarWhereInput[] + NOT?: Prisma.LlmCallScalarWhereInput | Prisma.LlmCallScalarWhereInput[] + id?: Prisma.StringFilter<"LlmCall"> | string + createdAt?: Prisma.DateTimeFilter<"LlmCall"> | Date | string + chatId?: Prisma.StringFilter<"LlmCall"> | string + provider?: Prisma.EnumProviderFilter<"LlmCall"> | $Enums.Provider + model?: Prisma.StringFilter<"LlmCall"> | string + request?: Prisma.JsonFilter<"LlmCall"> + response?: Prisma.JsonNullableFilter<"LlmCall"> + inputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + outputTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + totalTokens?: Prisma.IntNullableFilter<"LlmCall"> | number | null + latencyMs?: Prisma.IntNullableFilter<"LlmCall"> | number | null + error?: Prisma.StringNullableFilter<"LlmCall"> | string | null +} + +export type LlmCallCreateManyChatInput = { + id?: string + createdAt?: Date | string + provider: $Enums.Provider + model: string + request: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: number | null + outputTokens?: number | null + totalTokens?: number | null + latencyMs?: number | null + error?: string | null +} + +export type LlmCallUpdateWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type LlmCallUncheckedUpdateWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type LlmCallUncheckedUpdateManyWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + provider?: Prisma.EnumProviderFieldUpdateOperationsInput | $Enums.Provider + model?: Prisma.StringFieldUpdateOperationsInput | string + request?: Prisma.JsonNullValueInput | runtime.InputJsonValue + response?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + inputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + outputTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + totalTokens?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + latencyMs?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + error?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + + +export type LlmCallSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + provider?: boolean + model?: boolean + request?: boolean + response?: boolean + inputTokens?: boolean + outputTokens?: boolean + totalTokens?: boolean + latencyMs?: boolean + error?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["llmCall"]> + +export type LlmCallSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + provider?: boolean + model?: boolean + request?: boolean + response?: boolean + inputTokens?: boolean + outputTokens?: boolean + totalTokens?: boolean + latencyMs?: boolean + error?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["llmCall"]> + +export type LlmCallSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + provider?: boolean + model?: boolean + request?: boolean + response?: boolean + inputTokens?: boolean + outputTokens?: boolean + totalTokens?: boolean + latencyMs?: boolean + error?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["llmCall"]> + +export type LlmCallSelectScalar = { + id?: boolean + createdAt?: boolean + chatId?: boolean + provider?: boolean + model?: boolean + request?: boolean + response?: boolean + inputTokens?: boolean + outputTokens?: boolean + totalTokens?: boolean + latencyMs?: boolean + error?: boolean +} + +export type LlmCallOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "chatId" | "provider" | "model" | "request" | "response" | "inputTokens" | "outputTokens" | "totalTokens" | "latencyMs" | "error", ExtArgs["result"]["llmCall"]> +export type LlmCallInclude = { + chat?: boolean | Prisma.ChatDefaultArgs +} +export type LlmCallIncludeCreateManyAndReturn = { + chat?: boolean | Prisma.ChatDefaultArgs +} +export type LlmCallIncludeUpdateManyAndReturn = { + chat?: boolean | Prisma.ChatDefaultArgs +} + +export type $LlmCallPayload = { + name: "LlmCall" + objects: { + chat: Prisma.$ChatPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + createdAt: Date + chatId: string + provider: $Enums.Provider + model: string + request: runtime.JsonValue + response: runtime.JsonValue | null + inputTokens: number | null + outputTokens: number | null + totalTokens: number | null + latencyMs: number | null + error: string | null + }, ExtArgs["result"]["llmCall"]> + composites: {} +} + +export type LlmCallGetPayload = runtime.Types.Result.GetResult + +export type LlmCallCountArgs = + Omit & { + select?: LlmCallCountAggregateInputType | true + } + +export interface LlmCallDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['LlmCall'], meta: { name: 'LlmCall' } } + /** + * Find zero or one LlmCall that matches the filter. + * @param {LlmCallFindUniqueArgs} args - Arguments to find a LlmCall + * @example + * // Get one LlmCall + * const llmCall = await prisma.llmCall.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one LlmCall that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {LlmCallFindUniqueOrThrowArgs} args - Arguments to find a LlmCall + * @example + * // Get one LlmCall + * const llmCall = await prisma.llmCall.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first LlmCall 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 {LlmCallFindFirstArgs} args - Arguments to find a LlmCall + * @example + * // Get one LlmCall + * const llmCall = await prisma.llmCall.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first LlmCall 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 {LlmCallFindFirstOrThrowArgs} args - Arguments to find a LlmCall + * @example + * // Get one LlmCall + * const llmCall = await prisma.llmCall.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more LlmCalls 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 {LlmCallFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all LlmCalls + * const llmCalls = await prisma.llmCall.findMany() + * + * // Get first 10 LlmCalls + * const llmCalls = await prisma.llmCall.findMany({ take: 10 }) + * + * // Only select the `id` + * const llmCallWithIdOnly = await prisma.llmCall.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a LlmCall. + * @param {LlmCallCreateArgs} args - Arguments to create a LlmCall. + * @example + * // Create one LlmCall + * const LlmCall = await prisma.llmCall.create({ + * data: { + * // ... data to create a LlmCall + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many LlmCalls. + * @param {LlmCallCreateManyArgs} args - Arguments to create many LlmCalls. + * @example + * // Create many LlmCalls + * const llmCall = await prisma.llmCall.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many LlmCalls and returns the data saved in the database. + * @param {LlmCallCreateManyAndReturnArgs} args - Arguments to create many LlmCalls. + * @example + * // Create many LlmCalls + * const llmCall = await prisma.llmCall.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many LlmCalls and only return the `id` + * const llmCallWithIdOnly = await prisma.llmCall.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 LlmCall. + * @param {LlmCallDeleteArgs} args - Arguments to delete one LlmCall. + * @example + * // Delete one LlmCall + * const LlmCall = await prisma.llmCall.delete({ + * where: { + * // ... filter to delete one LlmCall + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one LlmCall. + * @param {LlmCallUpdateArgs} args - Arguments to update one LlmCall. + * @example + * // Update one LlmCall + * const llmCall = await prisma.llmCall.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more LlmCalls. + * @param {LlmCallDeleteManyArgs} args - Arguments to filter LlmCalls to delete. + * @example + * // Delete a few LlmCalls + * const { count } = await prisma.llmCall.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more LlmCalls. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LlmCallUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many LlmCalls + * const llmCall = await prisma.llmCall.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more LlmCalls and returns the data updated in the database. + * @param {LlmCallUpdateManyAndReturnArgs} args - Arguments to update many LlmCalls. + * @example + * // Update many LlmCalls + * const llmCall = await prisma.llmCall.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more LlmCalls and only return the `id` + * const llmCallWithIdOnly = await prisma.llmCall.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 LlmCall. + * @param {LlmCallUpsertArgs} args - Arguments to update or create a LlmCall. + * @example + * // Update or create a LlmCall + * const llmCall = await prisma.llmCall.upsert({ + * create: { + * // ... data to create a LlmCall + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the LlmCall we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__LlmCallClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of LlmCalls. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LlmCallCountArgs} args - Arguments to filter LlmCalls to count. + * @example + * // Count the number of LlmCalls + * const count = await prisma.llmCall.count({ + * where: { + * // ... the filter for the LlmCalls 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 LlmCall. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LlmCallAggregateArgs} 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 LlmCall. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LlmCallGroupByArgs} 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 LlmCallGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: LlmCallGroupByArgs['orderBy'] } + : { orderBy?: LlmCallGroupByArgs['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 ? GetLlmCallGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the LlmCall model + */ +readonly fields: LlmCallFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for LlmCall. + * 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__LlmCallClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + chat = {}>(args?: Prisma.Subset>): Prisma.Prisma__ChatClient, 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 LlmCall model + */ +export interface LlmCallFieldRefs { + readonly id: Prisma.FieldRef<"LlmCall", 'String'> + readonly createdAt: Prisma.FieldRef<"LlmCall", 'DateTime'> + readonly chatId: Prisma.FieldRef<"LlmCall", 'String'> + readonly provider: Prisma.FieldRef<"LlmCall", 'Provider'> + readonly model: Prisma.FieldRef<"LlmCall", 'String'> + readonly request: Prisma.FieldRef<"LlmCall", 'Json'> + readonly response: Prisma.FieldRef<"LlmCall", 'Json'> + readonly inputTokens: Prisma.FieldRef<"LlmCall", 'Int'> + readonly outputTokens: Prisma.FieldRef<"LlmCall", 'Int'> + readonly totalTokens: Prisma.FieldRef<"LlmCall", 'Int'> + readonly latencyMs: Prisma.FieldRef<"LlmCall", 'Int'> + readonly error: Prisma.FieldRef<"LlmCall", 'String'> +} + + +// Custom InputTypes +/** + * LlmCall findUnique + */ +export type LlmCallFindUniqueArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter, which LlmCall to fetch. + */ + where: Prisma.LlmCallWhereUniqueInput +} + +/** + * LlmCall findUniqueOrThrow + */ +export type LlmCallFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter, which LlmCall to fetch. + */ + where: Prisma.LlmCallWhereUniqueInput +} + +/** + * LlmCall findFirst + */ +export type LlmCallFindFirstArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter, which LlmCall to fetch. + */ + where?: Prisma.LlmCallWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of LlmCalls to fetch. + */ + orderBy?: Prisma.LlmCallOrderByWithRelationInput | Prisma.LlmCallOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for LlmCalls. + */ + cursor?: Prisma.LlmCallWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` LlmCalls 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` LlmCalls. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of LlmCalls. + */ + distinct?: Prisma.LlmCallScalarFieldEnum | Prisma.LlmCallScalarFieldEnum[] +} + +/** + * LlmCall findFirstOrThrow + */ +export type LlmCallFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter, which LlmCall to fetch. + */ + where?: Prisma.LlmCallWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of LlmCalls to fetch. + */ + orderBy?: Prisma.LlmCallOrderByWithRelationInput | Prisma.LlmCallOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for LlmCalls. + */ + cursor?: Prisma.LlmCallWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` LlmCalls 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` LlmCalls. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of LlmCalls. + */ + distinct?: Prisma.LlmCallScalarFieldEnum | Prisma.LlmCallScalarFieldEnum[] +} + +/** + * LlmCall findMany + */ +export type LlmCallFindManyArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter, which LlmCalls to fetch. + */ + where?: Prisma.LlmCallWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of LlmCalls to fetch. + */ + orderBy?: Prisma.LlmCallOrderByWithRelationInput | Prisma.LlmCallOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing LlmCalls. + */ + cursor?: Prisma.LlmCallWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` LlmCalls 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` LlmCalls. + */ + skip?: number + distinct?: Prisma.LlmCallScalarFieldEnum | Prisma.LlmCallScalarFieldEnum[] +} + +/** + * LlmCall create + */ +export type LlmCallCreateArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * The data needed to create a LlmCall. + */ + data: Prisma.XOR +} + +/** + * LlmCall createMany + */ +export type LlmCallCreateManyArgs = { + /** + * The data used to create many LlmCalls. + */ + data: Prisma.LlmCallCreateManyInput | Prisma.LlmCallCreateManyInput[] +} + +/** + * LlmCall createManyAndReturn + */ +export type LlmCallCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelectCreateManyAndReturn | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * The data used to create many LlmCalls. + */ + data: Prisma.LlmCallCreateManyInput | Prisma.LlmCallCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallIncludeCreateManyAndReturn | null +} + +/** + * LlmCall update + */ +export type LlmCallUpdateArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * The data needed to update a LlmCall. + */ + data: Prisma.XOR + /** + * Choose, which LlmCall to update. + */ + where: Prisma.LlmCallWhereUniqueInput +} + +/** + * LlmCall updateMany + */ +export type LlmCallUpdateManyArgs = { + /** + * The data used to update LlmCalls. + */ + data: Prisma.XOR + /** + * Filter which LlmCalls to update + */ + where?: Prisma.LlmCallWhereInput + /** + * Limit how many LlmCalls to update. + */ + limit?: number +} + +/** + * LlmCall updateManyAndReturn + */ +export type LlmCallUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * The data used to update LlmCalls. + */ + data: Prisma.XOR + /** + * Filter which LlmCalls to update + */ + where?: Prisma.LlmCallWhereInput + /** + * Limit how many LlmCalls to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallIncludeUpdateManyAndReturn | null +} + +/** + * LlmCall upsert + */ +export type LlmCallUpsertArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * The filter to search for the LlmCall to update in case it exists. + */ + where: Prisma.LlmCallWhereUniqueInput + /** + * In case the LlmCall found by the `where` argument doesn't exist, create a new LlmCall with this data. + */ + create: Prisma.XOR + /** + * In case the LlmCall was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * LlmCall delete + */ +export type LlmCallDeleteArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null + /** + * Filter which LlmCall to delete. + */ + where: Prisma.LlmCallWhereUniqueInput +} + +/** + * LlmCall deleteMany + */ +export type LlmCallDeleteManyArgs = { + /** + * Filter which LlmCalls to delete + */ + where?: Prisma.LlmCallWhereInput + /** + * Limit how many LlmCalls to delete. + */ + limit?: number +} + +/** + * LlmCall without action + */ +export type LlmCallDefaultArgs = { + /** + * Select specific fields to fetch from the LlmCall + */ + select?: Prisma.LlmCallSelect | null + /** + * Omit specific fields from the LlmCall + */ + omit?: Prisma.LlmCallOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LlmCallInclude | null +} diff --git a/generated/prisma/models/Message.ts b/generated/prisma/models/Message.ts new file mode 100644 index 0000000..2d7050b --- /dev/null +++ b/generated/prisma/models/Message.ts @@ -0,0 +1,1405 @@ + +/* !!! 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.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * 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 + createdAt: Date | null + chatId: string | null + role: $Enums.MessageRole | null + content: string | null + name: string | null +} + +export type MessageMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + chatId: string | null + role: $Enums.MessageRole | null + content: string | null + name: string | null +} + +export type MessageCountAggregateOutputType = { + id: number + createdAt: number + chatId: number + role: number + content: number + name: number + metadata: number + _all: number +} + + +export type MessageMinAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + role?: true + content?: true + name?: true +} + +export type MessageMaxAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + role?: true + content?: true + name?: true +} + +export type MessageCountAggregateInputType = { + id?: true + createdAt?: true + chatId?: true + role?: true + content?: true + name?: true + metadata?: 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 + createdAt: Date + chatId: string + role: $Enums.MessageRole + content: string + name: string | null + metadata: runtime.JsonValue | null + _count: MessageCountAggregateOutputType | null + _min: MessageMinAggregateOutputType | null + _max: MessageMaxAggregateOutputType | null +} + +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 + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + chatId?: Prisma.StringFilter<"Message"> | string + role?: Prisma.EnumMessageRoleFilter<"Message"> | $Enums.MessageRole + content?: Prisma.StringFilter<"Message"> | string + name?: Prisma.StringNullableFilter<"Message"> | string | null + metadata?: Prisma.JsonNullableFilter<"Message"> + chat?: Prisma.XOR +} + +export type MessageOrderByWithRelationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + role?: Prisma.SortOrder + content?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + metadata?: Prisma.SortOrderInput | Prisma.SortOrder + chat?: Prisma.ChatOrderByWithRelationInput +} + +export type MessageWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + OR?: Prisma.MessageWhereInput[] + NOT?: Prisma.MessageWhereInput | Prisma.MessageWhereInput[] + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + chatId?: Prisma.StringFilter<"Message"> | string + role?: Prisma.EnumMessageRoleFilter<"Message"> | $Enums.MessageRole + content?: Prisma.StringFilter<"Message"> | string + name?: Prisma.StringNullableFilter<"Message"> | string | null + metadata?: Prisma.JsonNullableFilter<"Message"> + chat?: Prisma.XOR +}, "id"> + +export type MessageOrderByWithAggregationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + role?: Prisma.SortOrder + content?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + metadata?: Prisma.SortOrderInput | 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 + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Message"> | Date | string + chatId?: Prisma.StringWithAggregatesFilter<"Message"> | string + role?: Prisma.EnumMessageRoleWithAggregatesFilter<"Message"> | $Enums.MessageRole + content?: Prisma.StringWithAggregatesFilter<"Message"> | string + name?: Prisma.StringNullableWithAggregatesFilter<"Message"> | string | null + metadata?: Prisma.JsonNullableWithAggregatesFilter<"Message"> +} + +export type MessageCreateInput = { + id?: string + createdAt?: Date | string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + chat: Prisma.ChatCreateNestedOneWithoutMessagesInput +} + +export type MessageUncheckedCreateInput = { + id?: string + createdAt?: Date | string + chatId: string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue + chat?: Prisma.ChatUpdateOneRequiredWithoutMessagesNestedInput +} + +export type MessageUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + chatId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageCreateManyInput = { + id?: string + createdAt?: Date | string + chatId: string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + chatId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageListRelationFilter = { + every?: Prisma.MessageWhereInput + some?: Prisma.MessageWhereInput + none?: Prisma.MessageWhereInput +} + +export type MessageOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type MessageCountOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + role?: Prisma.SortOrder + content?: Prisma.SortOrder + name?: Prisma.SortOrder + metadata?: Prisma.SortOrder +} + +export type MessageMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + role?: Prisma.SortOrder + content?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type MessageMinOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + chatId?: Prisma.SortOrder + role?: Prisma.SortOrder + content?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type MessageCreateNestedManyWithoutChatInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutChatInput[] | Prisma.MessageUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutChatInput | Prisma.MessageCreateOrConnectWithoutChatInput[] + createMany?: Prisma.MessageCreateManyChatInputEnvelope + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] +} + +export type MessageUncheckedCreateNestedManyWithoutChatInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutChatInput[] | Prisma.MessageUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutChatInput | Prisma.MessageCreateOrConnectWithoutChatInput[] + createMany?: Prisma.MessageCreateManyChatInputEnvelope + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] +} + +export type MessageUpdateManyWithoutChatNestedInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutChatInput[] | Prisma.MessageUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutChatInput | Prisma.MessageCreateOrConnectWithoutChatInput[] + upsert?: Prisma.MessageUpsertWithWhereUniqueWithoutChatInput | Prisma.MessageUpsertWithWhereUniqueWithoutChatInput[] + createMany?: Prisma.MessageCreateManyChatInputEnvelope + set?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + disconnect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + delete?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + update?: Prisma.MessageUpdateWithWhereUniqueWithoutChatInput | Prisma.MessageUpdateWithWhereUniqueWithoutChatInput[] + updateMany?: Prisma.MessageUpdateManyWithWhereWithoutChatInput | Prisma.MessageUpdateManyWithWhereWithoutChatInput[] + deleteMany?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] +} + +export type MessageUncheckedUpdateManyWithoutChatNestedInput = { + create?: Prisma.XOR | Prisma.MessageCreateWithoutChatInput[] | Prisma.MessageUncheckedCreateWithoutChatInput[] + connectOrCreate?: Prisma.MessageCreateOrConnectWithoutChatInput | Prisma.MessageCreateOrConnectWithoutChatInput[] + upsert?: Prisma.MessageUpsertWithWhereUniqueWithoutChatInput | Prisma.MessageUpsertWithWhereUniqueWithoutChatInput[] + createMany?: Prisma.MessageCreateManyChatInputEnvelope + set?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + disconnect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + delete?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + connect?: Prisma.MessageWhereUniqueInput | Prisma.MessageWhereUniqueInput[] + update?: Prisma.MessageUpdateWithWhereUniqueWithoutChatInput | Prisma.MessageUpdateWithWhereUniqueWithoutChatInput[] + updateMany?: Prisma.MessageUpdateManyWithWhereWithoutChatInput | Prisma.MessageUpdateManyWithWhereWithoutChatInput[] + deleteMany?: Prisma.MessageScalarWhereInput | Prisma.MessageScalarWhereInput[] +} + +export type EnumMessageRoleFieldUpdateOperationsInput = { + set?: $Enums.MessageRole +} + +export type MessageCreateWithoutChatInput = { + id?: string + createdAt?: Date | string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUncheckedCreateWithoutChatInput = { + id?: string + createdAt?: Date | string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageCreateOrConnectWithoutChatInput = { + where: Prisma.MessageWhereUniqueInput + create: Prisma.XOR +} + +export type MessageCreateManyChatInputEnvelope = { + data: Prisma.MessageCreateManyChatInput | Prisma.MessageCreateManyChatInput[] +} + +export type MessageUpsertWithWhereUniqueWithoutChatInput = { + where: Prisma.MessageWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type MessageUpdateWithWhereUniqueWithoutChatInput = { + where: Prisma.MessageWhereUniqueInput + data: Prisma.XOR +} + +export type MessageUpdateManyWithWhereWithoutChatInput = { + 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 + createdAt?: Prisma.DateTimeFilter<"Message"> | Date | string + chatId?: Prisma.StringFilter<"Message"> | string + role?: Prisma.EnumMessageRoleFilter<"Message"> | $Enums.MessageRole + content?: Prisma.StringFilter<"Message"> | string + name?: Prisma.StringNullableFilter<"Message"> | string | null + metadata?: Prisma.JsonNullableFilter<"Message"> +} + +export type MessageCreateManyChatInput = { + id?: string + createdAt?: Date | string + role: $Enums.MessageRole + content: string + name?: string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUpdateWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUncheckedUpdateWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + +export type MessageUncheckedUpdateManyWithoutChatInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + role?: Prisma.EnumMessageRoleFieldUpdateOperationsInput | $Enums.MessageRole + content?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue +} + + + +export type MessageSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + role?: boolean + content?: boolean + name?: boolean + metadata?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + role?: boolean + content?: boolean + name?: boolean + metadata?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + chatId?: boolean + role?: boolean + content?: boolean + name?: boolean + metadata?: boolean + chat?: boolean | Prisma.ChatDefaultArgs +}, ExtArgs["result"]["message"]> + +export type MessageSelectScalar = { + id?: boolean + createdAt?: boolean + chatId?: boolean + role?: boolean + content?: boolean + name?: boolean + metadata?: boolean +} + +export type MessageOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "chatId" | "role" | "content" | "name" | "metadata", ExtArgs["result"]["message"]> +export type MessageInclude = { + chat?: boolean | Prisma.ChatDefaultArgs +} +export type MessageIncludeCreateManyAndReturn = { + chat?: boolean | Prisma.ChatDefaultArgs +} +export type MessageIncludeUpdateManyAndReturn = { + chat?: boolean | Prisma.ChatDefaultArgs +} + +export type $MessagePayload = { + name: "Message" + objects: { + chat: Prisma.$ChatPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + createdAt: Date + chatId: string + role: $Enums.MessageRole + content: string + name: string | null + metadata: runtime.JsonValue | null + }, 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" + chat = {}>(args?: Prisma.Subset>): Prisma.Prisma__ChatClient, 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 Message model + */ +export interface MessageFieldRefs { + readonly id: Prisma.FieldRef<"Message", 'String'> + readonly createdAt: Prisma.FieldRef<"Message", 'DateTime'> + readonly chatId: Prisma.FieldRef<"Message", 'String'> + readonly role: Prisma.FieldRef<"Message", 'MessageRole'> + readonly content: Prisma.FieldRef<"Message", 'String'> + readonly name: Prisma.FieldRef<"Message", 'String'> + readonly metadata: Prisma.FieldRef<"Message", 'Json'> +} + + +// 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 + 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 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/generated/prisma/models/User.ts b/generated/prisma/models/User.ts new file mode 100644 index 0000000..bbffe29 --- /dev/null +++ b/generated/prisma/models/User.ts @@ -0,0 +1,1302 @@ + +/* !!! 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.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * 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 + createdAt: Date | null + updatedAt: Date | null + handle: string | null +} + +export type UserMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + handle: string | null +} + +export type UserCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + handle: number + _all: number +} + + +export type UserMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + handle?: true +} + +export type UserMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + handle?: true +} + +export type UserCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + handle?: 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 + createdAt: Date + updatedAt: Date + handle: string | null + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.StringFilter<"User"> | string + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + handle?: Prisma.StringNullableFilter<"User"> | string | null + chats?: Prisma.ChatListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + handle?: Prisma.SortOrderInput | Prisma.SortOrder + chats?: Prisma.ChatOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: string + handle?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + chats?: Prisma.ChatListRelationFilter +}, "id" | "handle"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + handle?: Prisma.SortOrderInput | 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 + createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + handle?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null +} + +export type UserCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + handle?: string | null + chats?: Prisma.ChatCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + handle?: string | null + chats?: Prisma.ChatUncheckedCreateNestedManyWithoutUserInput +} + +export type UserUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + chats?: Prisma.ChatUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + chats?: Prisma.ChatUncheckedUpdateManyWithoutUserNestedInput +} + +export type UserCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + handle?: string | null +} + +export type UserUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + handle?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + handle?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + handle?: Prisma.SortOrder +} + +export type UserNullableScalarRelationFilter = { + is?: Prisma.UserWhereInput | null + isNot?: Prisma.UserWhereInput | null +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type UserCreateNestedOneWithoutChatsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutChatsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneWithoutChatsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutChatsInput + upsert?: Prisma.UserUpsertWithoutChatsInput + disconnect?: Prisma.UserWhereInput | boolean + delete?: Prisma.UserWhereInput | boolean + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutChatsInput> +} + +export type UserCreateWithoutChatsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + handle?: string | null +} + +export type UserUncheckedCreateWithoutChatsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + handle?: string | null +} + +export type UserCreateOrConnectWithoutChatsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutChatsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutChatsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutChatsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateWithoutChatsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + handle?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + chats: number +} + +export type UserCountOutputTypeSelect = { + chats?: boolean | UserCountOutputTypeCountChatsArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountChatsArgs = { + where?: Prisma.ChatWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + handle?: boolean + chats?: boolean | Prisma.User$chatsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + handle?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + handle?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + handle?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "updatedAt" | "handle", ExtArgs["result"]["user"]> +export type UserInclude = { + chats?: boolean | Prisma.User$chatsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + chats: Prisma.$ChatPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + createdAt: Date + updatedAt: Date + handle: string | null + }, 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" + chats = {}>(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 createdAt: Prisma.FieldRef<"User", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"User", 'DateTime'> + readonly handle: Prisma.FieldRef<"User", 'String'> +} + + +// 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 + 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.chats + */ +export type User$chatsArgs = { + /** + * Select specific fields to fetch from the Chat + */ + select?: Prisma.ChatSelect | null + /** + * Omit specific fields from the Chat + */ + omit?: Prisma.ChatOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ChatInclude | null + where?: Prisma.ChatWhereInput + orderBy?: Prisma.ChatOrderByWithRelationInput | Prisma.ChatOrderByWithRelationInput[] + cursor?: Prisma.ChatWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ChatScalarFieldEnum | Prisma.ChatScalarFieldEnum[] +} + +/** + * 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/package-lock.json b/package-lock.json new file mode 100644 index 0000000..4c2f3c8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2327 @@ +{ + "name": "llm-backend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "llm-backend", + "version": "0.1.0", + "dependencies": { + "@anthropic-ai/sdk": "^0.71.2", + "@fastify/cors": "^11.2.0", + "@fastify/sensible": "^6.0.4", + "@fastify/swagger": "^9.6.1", + "@fastify/swagger-ui": "^5.2.5", + "@prisma/client": "^6.16.1", + "dotenv": "^17.2.3", + "fastify": "^5.7.2", + "openai": "^6.16.0", + "pino-pretty": "^13.1.3", + "zod": "^4.3.6" + }, + "devDependencies": { + "@types/node": "^25.0.10", + "prisma": "^6.16.1", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + } + }, + "node_modules/@anthropic-ai/sdk": { + "version": "0.71.2", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.71.2.tgz", + "integrity": "sha512-TGNDEUuEstk/DKu0/TflXAEt+p+p/WhTlFzEnoosvbaDU2LTjm42igSdlL0VijrKpWejtOKxX0b8A7uc+XiSAQ==", + "license": "MIT", + "dependencies": { + "json-schema-to-ts": "^3.1.1" + }, + "bin": { + "anthropic-ai-sdk": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", + "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@fastify/accept-negotiator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-2.0.1.tgz", + "integrity": "sha512-/c/TW2bO/v9JeEgoD/g1G5GxGeCF1Hafdf79WPmUlgYiBXummY0oX3VVq4yFkKKVBKDNlaDUYoab7g38RpPqCQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.5.tgz", + "integrity": "sha512-KoWKW+MhvfTRWL4qrhUwAAZoaChluo0m0vbiJlGMt2GXvL4LVPQEjt8kSpHI3IBq5Rez8fg+XeH3cneztq+C7A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0" + } + }, + "node_modules/@fastify/cors": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@fastify/cors/-/cors-11.2.0.tgz", + "integrity": "sha512-LbLHBuSAdGdSFZYTLVA3+Ch2t+sA6nq3Ejc6XLAKiQ6ViS2qFnvicpj0htsx03FyYeLs04HfRNBsz/a8SvbcUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/@fastify/error": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", + "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.0.3.tgz", + "integrity": "sha512-uik7yYHkLr6fxd8hJSZ8c+xF4WafPK+XzneQDPU+D10r5X19GW8lJcom2YijX2+qtFF1ENJlHXKFM9ouXNJYgQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fast-json-stringify": "^6.0.0" + } + }, + "node_modules/@fastify/forwarded": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@fastify/forwarded/-/forwarded-3.0.1.tgz", + "integrity": "sha512-JqDochHFqXs3C3Ml3gOY58zM7OqO9ENqPo0UqAjAjH8L01fRZqwX9iLeX34//kiJubF7r2ZQHtBRU36vONbLlw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.1.tgz", + "integrity": "sha512-OA3KGBCy6KtIvLf8DINC5880o5iBlDX4SxzLQS8HorJAbqluzLRn80UXU0bxZn7UOFhFgpRJDasfwn9nG4FG4A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@fastify/proxy-addr": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fastify/proxy-addr/-/proxy-addr-5.1.0.tgz", + "integrity": "sha512-INS+6gh91cLUjB+PVHfu1UqcB76Sqtpyp7bnL+FYojhjygvOPA9ctiD/JDKsyD9Xgu4hUhCSJBPig/w7duNajw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/forwarded": "^3.0.0", + "ipaddr.js": "^2.1.0" + } + }, + "node_modules/@fastify/send": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-4.1.0.tgz", + "integrity": "sha512-TMYeQLCBSy2TOFmV95hQWkiTYgC/SEx7vMdV+wnZVX4tt8VBLKzmH8vV9OzJehV0+XBfg+WxPMt5wp+JBUKsVw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "^2.0.0", + "mime": "^3" + } + }, + "node_modules/@fastify/sensible": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@fastify/sensible/-/sensible-6.0.4.tgz", + "integrity": "sha512-1vxcCUlPMew6WroK8fq+LVOwbsLtX+lmuRuqpcp6eYqu6vmkLwbKTdBWAZwbeaSgCfW4tzUpTIHLLvTiQQ1BwQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "dequal": "^2.0.3", + "fastify-plugin": "^5.0.0", + "forwarded": "^0.2.0", + "http-errors": "^2.0.0", + "type-is": "^2.0.1", + "vary": "^1.1.2" + } + }, + "node_modules/@fastify/static": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-9.0.0.tgz", + "integrity": "sha512-r64H8Woe/vfilg5RTy7lwWlE8ZZcTrc3kebYFMEUBrMqlydhQyoiExQXdYAy2REVpST/G35+stAM8WYp1WGmMA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/accept-negotiator": "^2.0.0", + "@fastify/send": "^4.0.0", + "content-disposition": "^1.0.1", + "fastify-plugin": "^5.0.0", + "fastq": "^1.17.1", + "glob": "^13.0.0" + } + }, + "node_modules/@fastify/swagger": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-9.6.1.tgz", + "integrity": "sha512-fKlpJqFMWoi4H3EdUkDaMteEYRCfQMEkK0HJJ0eaf4aRlKd8cbq0pVkOfXDXmtvMTXYcnx3E+l023eFDBsA1HA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "json-schema-resolver": "^3.0.0", + "openapi-types": "^12.1.3", + "rfdc": "^1.3.1", + "yaml": "^2.4.2" + } + }, + "node_modules/@fastify/swagger-ui": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-5.2.5.tgz", + "integrity": "sha512-ky3I0LAkXKX/prwSDpoQ3kscBKsj2Ha6Gp1/JfgQSqyx0bm9F2bE//XmGVGj2cR9l5hUjZYn60/hqn7e+OLgWQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/static": "^9.0.0", + "fastify-plugin": "^5.0.0", + "openapi-types": "^12.1.3", + "rfdc": "^1.3.1", + "yaml": "^2.4.1" + } + }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@pinojs/redact": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", + "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", + "license": "MIT" + }, + "node_modules/@prisma/client": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.1.tgz", + "integrity": "sha512-QaBCOY29lLAxEFFJgBPyW3WInCW52fJeQTmWx/h6YsP5u0bwuqP51aP0uhqFvhK9DaZPwvai/M4tSDYLVE9vRg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*", + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@prisma/config": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.16.1.tgz", + "integrity": "sha512-sz3uxRPNL62QrJ0EYiujCFkIGZ3hg+9hgC1Ae1HjoYuj0BxCqHua4JNijYvYCrh9LlofZDZcRBX3tHBfLvAngA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "c12": "3.1.0", + "deepmerge-ts": "7.1.5", + "effect": "3.16.12", + "empathic": "2.0.0" + } + }, + "node_modules/@prisma/debug": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.16.1.tgz", + "integrity": "sha512-RWv/VisW5vJE4cDRTuAHeVedtGoItXTnhuLHsSlJ9202QKz60uiXWywBlVcqXVq8bFeIZoCoWH+R1duZJPwqLw==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.16.1.tgz", + "integrity": "sha512-EOnEM5HlosPudBqbI+jipmaW/vQEaF0bKBo4gVkGabasINHR6RpC6h44fKZEqx4GD8CvH+einD2+b49DQrwrAg==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.16.1", + "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "@prisma/fetch-engine": "6.16.1", + "@prisma/get-platform": "6.16.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43.tgz", + "integrity": "sha512-ThvlDaKIVrnrv97ujNFDYiQbeMQpLa0O86HFA2mNoip4mtFqM7U5GSz2ie1i2xByZtvPztJlNRgPsXGeM/kqAA==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.16.1.tgz", + "integrity": "sha512-fl/PKQ8da5YTayw86WD3O9OmKJEM43gD3vANy2hS5S1CnfW2oPXk+Q03+gUWqcKK306QqhjjIHRFuTZ31WaosQ==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.16.1", + "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "@prisma/get-platform": "6.16.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.16.1.tgz", + "integrity": "sha512-kUfg4vagBG7dnaGRcGd1c0ytQFcDj2SUABiuveIpL3bthFdTLI6PJeLEia6Q8Dgh+WhPdo0N2q0Fzjk63XTyaA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.16.1" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.10.tgz", + "integrity": "sha512-zWW5KPngR/yvakJgGOmZ5vTBemDoSqF3AcV/LrO5u5wTWyEAVVh+IT39G4gtyAkh3CtTZs8aX/yRM82OfzHJRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==", + "license": "MIT" + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/avvio": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-9.1.0.tgz", + "integrity": "sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==", + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, + "node_modules/c12": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^16.6.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.4.2", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/c12/node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "devOptional": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT" + }, + "node_modules/confbox": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge-ts": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", + "devOptional": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/dotenv": { + "version": "17.2.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", + "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/effect": { + "version": "3.16.12", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.16.12.tgz", + "integrity": "sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "fast-check": "^3.23.1" + } + }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/exsolve": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", + "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "devOptional": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/fast-copy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-4.0.2.tgz", + "integrity": "sha512-ybA6PDXIXOXivLJK/z9e+Otk7ve13I4ckBvGO5I2RRmBU1gMHLVDJYEuJYhGwez7YNlYji2M2DvVU+a9mSFDlw==", + "license": "MIT" + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-json-stringify": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-6.2.0.tgz", + "integrity": "sha512-Eaf/KNIDwHkzfyeQFNfLXJnQ7cl1XQI3+zRqmPlvtkMigbXnAcasTrvJQmquBSxKfFGeRA6PFog8t+hFmpDoWw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/merge-json-schemas": "^0.2.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0", + "json-schema-ref-resolver": "^3.0.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "license": "MIT", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fastify": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-5.7.2.tgz", + "integrity": "sha512-dBJolW+hm6N/yJVf6J5E1BxOBNkuXNl405nrfeR8SpvGWG3aCC2XDHyiFBdow8Win1kj7sjawQc257JlYY6M/A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/ajv-compiler": "^4.0.5", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "@fastify/proxy-addr": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^6.0.0", + "find-my-way": "^9.0.0", + "light-my-request": "^6.0.0", + "pino": "^10.1.0", + "process-warning": "^5.0.0", + "rfdc": "^1.3.1", + "secure-json-parse": "^4.0.0", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify-plugin": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.1.0.tgz", + "integrity": "sha512-FAIDA8eovSt5qcDgcBvDuX/v0Cjz0ohGhENZ/wpc3y+oZCY2afZ9Baqql3g/lC+OHRnciQol4ww7tuthOb9idw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/find-my-way": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.4.0.tgz", + "integrity": "sha512-5Ye4vHsypZRYtS01ob/iwHzGRUDELlsoCftI/OZFhcLs1M0tkGPcXldE80TAZC5yYuJMBPJQQ43UHlqbJWiX2w==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^5.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/giget": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/glob": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz", + "integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "path-scurry": "^2.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==", + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.3.0.tgz", + "integrity": "sha512-Zv/pA+ciVFbCSBBjGfaKUya/CcGmUHzTydLMaTwrUUEM2DIEO3iZvueGxmacvmN50fGpGVKeTXpb2LcYQxeVdg==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "devOptional": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/json-schema-ref-resolver": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.0.tgz", + "integrity": "sha512-hOrZIVL5jyYFjzk7+y7n5JDzGlU8rfWDuYyHwGa2WA8/pcmMHezp2xsVwxrebD/Q9t8Nc5DboieySDpCp4WG4A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/json-schema-resolver": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-schema-resolver/-/json-schema-resolver-3.0.0.tgz", + "integrity": "sha512-HqMnbz0tz2DaEJ3ntsqtx3ezzZyDE7G56A/pPY/NGmrPu76UzsWquOpHFRAf5beTNXoH2LU5cQePVvRli1nchA==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "fast-uri": "^3.0.5", + "rfdc": "^1.1.4" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/Eomm/json-schema-resolver?sponsor=1" + } + }, + "node_modules/json-schema-to-ts": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/json-schema-to-ts/-/json-schema-to-ts-3.1.1.tgz", + "integrity": "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "ts-algebra": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/light-my-request": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.6.0.tgz", + "integrity": "sha512-CHYbu8RtboSIoVsHZ6Ye4cj4Aw/yg2oAFimlF7mNvfDV192LR7nDiKtSIfCuLT7KokPSTn/9kfVLm5OGN0A28A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "cookie": "^1.0.1", + "process-warning": "^4.0.0", + "set-cookie-parser": "^2.6.0" + } + }, + "node_modules/light-my-request/node_modules/process-warning": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.1.tgz", + "integrity": "sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "11.2.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.5.tgz", + "integrity": "sha512-vFrFJkWtJvJnD5hg+hJvVE8Lh/TcMzKnTgCWmtBipwI5yLX/iX+5UB2tfuyODF5E7k9xEzMdYgGqaSb1c0c5Yw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimatch": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/nypm": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.4.tgz", + "integrity": "sha512-1TvCKjZyyklN+JJj2TS3P4uSQEInrM/HkkuSXsEzm1ApPgBffOn8gFguNnZf07r/1X6vlryfIqMUkJKQMzlZiw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "citty": "^0.2.0", + "pathe": "^2.0.3", + "tinyexec": "^1.0.2" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nypm/node_modules/citty": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.2.0.tgz", + "integrity": "sha512-8csy5IBFI2ex2hTVpaHN2j+LNE199AgiI7y4dMintrr8i0lQiFn+0AWMZrWdHKIgMOer65f8IThysYhoReqjWA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/openai": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-6.16.0.tgz", + "integrity": "sha512-fZ1uBqjFUjXzbGc35fFtYKEOxd20kd9fDpFeqWtsOZWiubY8CZ1NAlXHW3iathaFvqmNtCWMIsosCuyeI7Joxg==", + "license": "Apache-2.0", + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "ws": "^8.18.0", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "ws": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", + "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/pino": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-10.3.0.tgz", + "integrity": "sha512-0GNPNzHXBKw6U/InGe79A3Crzyk9bcSyObF9/Gfo9DLEf5qj5RF50RSjsu0W1rZ6ZqRGdzDFCRBQvi9/rSGPtA==", + "license": "MIT", + "dependencies": { + "@pinojs/redact": "^0.4.0", + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^3.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^4.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz", + "integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-pretty": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-13.1.3.tgz", + "integrity": "sha512-ttXRkkOz6WWC95KeY9+xxWL6AtImwbyMHrL1mSwqwW9u+vLp/WIElvHvCSDg0xO/Dzrggz1zv3rN5ovTRVowKg==", + "license": "MIT", + "dependencies": { + "colorette": "^2.0.7", + "dateformat": "^4.6.3", + "fast-copy": "^4.0.0", + "fast-safe-stringify": "^2.1.1", + "help-me": "^5.0.0", + "joycon": "^3.1.1", + "minimist": "^1.2.6", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^3.0.0", + "pump": "^3.0.0", + "secure-json-parse": "^4.0.0", + "sonic-boom": "^4.0.1", + "strip-json-comments": "^5.0.2" + }, + "bin": { + "pino-pretty": "bin.js" + } + }, + "node_modules/pino-std-serializers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz", + "integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==", + "license": "MIT" + }, + "node_modules/pkg-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" + } + }, + "node_modules/prisma": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.16.1.tgz", + "integrity": "sha512-MFkMU0eaDDKAT4R/By2IA9oQmwLTxokqv2wegAErr9Rf+oIe7W2sYpE/Uxq0H2DliIR7vnV63PkC1bEwUtl98w==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/config": "6.16.1", + "@prisma/engines": "6.16.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/process-warning": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", + "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "devOptional": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" + }, + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/ret": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", + "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, + "node_modules/safe-regex2": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.0.0.tgz", + "integrity": "sha512-YwJwe5a51WlK7KbOJREPdjNrpViQBI3p4T50lfwPuDhZnE3XGVTlGvi+aolc5+RvxDD6bnUmjVsU9n1eboLUYw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/secure-json-parse": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.0.tgz", + "integrity": "sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sonic-boom": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/thread-stream": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.0.0.tgz", + "integrity": "sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA==", + "license": "MIT", + "dependencies": { + "real-require": "^0.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/tinyexec": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/toad-cache": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", + "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-algebra": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-2.0.0.tgz", + "integrity": "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==", + "license": "MIT" + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3db4e82 --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "llm-backend", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "LLM multiplexer + personal chat database backend", + "scripts": { + "dev": "tsx watch src/index.ts", + "start": "node dist/index.js", + "build": "tsc -p tsconfig.json", + "prisma:generate": "prisma generate", + "db:migrate": "prisma migrate dev", + "db:studio": "prisma studio" + }, + "dependencies": { + "@anthropic-ai/sdk": "^0.71.2", + "@fastify/cors": "^11.2.0", + "@fastify/sensible": "^6.0.4", + "@fastify/swagger": "^9.6.1", + "@fastify/swagger-ui": "^5.2.5", + "@prisma/client": "^6.16.1", + "dotenv": "^17.2.3", + "fastify": "^5.7.2", + "openai": "^6.16.0", + "pino-pretty": "^13.1.3", + "zod": "^4.3.6" + }, + "devDependencies": { + "@types/node": "^25.0.10", + "prisma": "^6.16.1", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + } +} diff --git a/prisma.config.ts.bak b/prisma.config.ts.bak new file mode 100644 index 0000000..831a20f --- /dev/null +++ b/prisma.config.ts.bak @@ -0,0 +1,14 @@ +// This file was generated by Prisma, and assumes you have installed the following: +// npm install --save-dev prisma dotenv +import "dotenv/config"; +import { defineConfig } from "prisma/config"; + +export default defineConfig({ + schema: "prisma/schema.prisma", + migrations: { + path: "prisma/migrations", + }, + datasource: { + url: process.env["DATABASE_URL"], + }, +}); diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..b6888e3 --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,94 @@ +// Prisma schema for the personal chat DB + LLM call log + +generator client { + provider = "prisma-client-js" +} + +datasource db { + provider = "sqlite" + url = env("DATABASE_URL") +} + +enum Provider { + openai + anthropic + xai +} + +enum MessageRole { + system + user + assistant + tool +} + +model User { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // minimal for now (single-user is fine). Keep extensible. + handle String? @unique + + chats Chat[] +} + +model Chat { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + title String? + + user User? @relation(fields: [userId], references: [id]) + userId String? + + messages Message[] + calls LlmCall[] + + @@index([userId]) +} + +model Message { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + + chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade) + chatId String + + role MessageRole + content String + + // for tool messages or attachments later + name String? + metadata Json? + + @@index([chatId, createdAt]) +} + +model LlmCall { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + + chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade) + chatId String + + provider Provider + model String + + // request/response snapshots for debugging + replay + request Json + response Json? + + // usage/cost basics + inputTokens Int? + outputTokens Int? + totalTokens Int? + + latencyMs Int? + + error String? + + @@index([chatId, createdAt]) + @@index([provider, model, createdAt]) +} diff --git a/src/auth.ts b/src/auth.ts new file mode 100644 index 0000000..24106f5 --- /dev/null +++ b/src/auth.ts @@ -0,0 +1,22 @@ +import type { FastifyRequest } from "fastify"; +import { env } from "./env.js"; + +export function requireAdmin(req: FastifyRequest) { + // If ADMIN_TOKEN isn't set, run in "open" mode (dev). + if (!env.ADMIN_TOKEN) return; + + const auth = req.headers.authorization; + if (!auth?.startsWith("Bearer ")) { + const err = new Error("missing bearer token"); + // @ts-expect-error attach status + err.statusCode = 401; + throw err; + } + const token = auth.slice("Bearer ".length); + if (token !== env.ADMIN_TOKEN) { + const err = new Error("invalid bearer token"); + // @ts-expect-error attach status + err.statusCode = 403; + throw err; + } +} diff --git a/src/db.ts b/src/db.ts new file mode 100644 index 0000000..a815714 --- /dev/null +++ b/src/db.ts @@ -0,0 +1,16 @@ +import { PrismaClient } from "@prisma/client"; + +export const prisma = new PrismaClient({ + log: [ + { emit: "event", level: "error" }, + { emit: "event", level: "warn" }, + ], +}); + +prisma.$on("error", (e: any) => { + console.error("[prisma:error]", e); +}); + +prisma.$on("warn", (e: any) => { + console.warn("[prisma:warn]", e); +}); diff --git a/src/env.ts b/src/env.ts new file mode 100644 index 0000000..1f66166 --- /dev/null +++ b/src/env.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; +import "dotenv/config"; + +const EnvSchema = z.object({ + PORT: z.coerce.number().int().positive().default(8787), + HOST: z.string().default("0.0.0.0"), + + // simple bearer-token auth for your personal backend + ADMIN_TOKEN: z.string().min(20).optional(), + + // provider keys + OPENAI_API_KEY: z.string().optional(), + ANTHROPIC_API_KEY: z.string().optional(), + XAI_API_KEY: z.string().optional(), +}); + +export type Env = z.infer; + +export const env: Env = EnvSchema.parse(process.env); diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..ffca1ff --- /dev/null +++ b/src/index.ts @@ -0,0 +1,45 @@ +import Fastify from "fastify"; +import cors from "@fastify/cors"; +import swagger from "@fastify/swagger"; +import swaggerUI from "@fastify/swagger-ui"; +import sensible from "@fastify/sensible"; +import { env } from "./env.js"; +import { registerRoutes } from "./routes.js"; + +const app = Fastify({ + logger: { + transport: { + target: "pino-pretty", + options: { colorize: true, translateTime: "SYS:standard" }, + }, + }, +}); + +await app.register(cors, { origin: true, credentials: true }); + +await app.register(swagger, { + openapi: { + info: { + title: "LLM Multiplexer Backend", + version: "0.1.0", + }, + }, +}); + +await app.register(swaggerUI, { routePrefix: "/docs" }); +await app.register(sensible); + +app.setErrorHandler((err, _req, reply) => { + const e = err as any; + const statusCode = e.statusCode ?? 500; + reply.status(statusCode).send({ + error: true, + message: e.message ?? String(e), + statusCode, + }); +}); + +await registerRoutes(app); + +await app.listen({ port: env.PORT, host: env.HOST }); +app.log.info(`listening on http://${env.HOST}:${env.PORT}`); diff --git a/src/llm/multiplexer.ts b/src/llm/multiplexer.ts new file mode 100644 index 0000000..ac0884d --- /dev/null +++ b/src/llm/multiplexer.ts @@ -0,0 +1,124 @@ +import { performance } from "node:perf_hooks"; +import { prisma } from "../db.js"; +import { anthropicClient, openaiClient, xaiClient } from "./providers.js"; +import type { MultiplexRequest, MultiplexResponse, Provider } from "./types.js"; + +function asProviderEnum(p: Provider) { + // Prisma enum values match these strings. + return p; +} + +export async function runMultiplex(req: MultiplexRequest): Promise { + const t0 = performance.now(); + + // Persist call record early so we can attach errors. + const call = await prisma.llmCall.create({ + data: { + chatId: req.chatId ?? (await prisma.chat.create({ data: {} })).id, + provider: asProviderEnum(req.provider) as any, + model: req.model, + request: req as any, + }, + select: { id: true, chatId: true }, + }); + + try { + let outText = ""; + let usage: MultiplexResponse["usage"] | undefined; + let raw: unknown; + + if (req.provider === "openai" || req.provider === "xai") { + const client = req.provider === "openai" ? openaiClient() : xaiClient(); + const r = await client.chat.completions.create({ + model: req.model, + // OpenAI SDK has very specific message union types; our normalized schema is compatible. + messages: req.messages.map((m) => ({ role: m.role, content: m.content, name: m.name })) as any, + temperature: req.temperature, + max_tokens: req.maxTokens, + }); + raw = r; + outText = r.choices?.[0]?.message?.content ?? ""; + usage = r.usage + ? { + inputTokens: r.usage.prompt_tokens, + outputTokens: r.usage.completion_tokens, + totalTokens: r.usage.total_tokens, + } + : undefined; + } else if (req.provider === "anthropic") { + const client = anthropicClient(); + + // Anthropic splits system prompt. We'll convert first system message into system string. + const system = req.messages.find((m) => m.role === "system")?.content; + const msgs = req.messages + .filter((m) => m.role !== "system") + .map((m) => ({ role: m.role === "assistant" ? "assistant" : "user", content: m.content })); + + const r = await client.messages.create({ + model: req.model, + system, + max_tokens: req.maxTokens ?? 1024, + temperature: req.temperature, + messages: msgs as any, + }); + raw = r; + outText = r.content + .map((c: any) => (c.type === "text" ? c.text : "")) + .join("") + .trim(); + + // Anthropic usage (SDK typing varies by version) + const ru: any = (r as any).usage; + if (ru) { + usage = { + inputTokens: ru.input_tokens, + outputTokens: ru.output_tokens, + totalTokens: (ru.input_tokens ?? 0) + (ru.output_tokens ?? 0), + }; + } + } else { + throw new Error(`unknown provider: ${req.provider}`); + } + + const latencyMs = Math.round(performance.now() - t0); + + // Store assistant message + call record + await prisma.$transaction([ + prisma.message.create({ + data: { + chatId: call.chatId, + role: "assistant" as any, + content: outText, + }, + }), + prisma.llmCall.update({ + where: { id: call.id }, + data: { + response: raw as any, + latencyMs, + inputTokens: usage?.inputTokens, + outputTokens: usage?.outputTokens, + totalTokens: usage?.totalTokens, + }, + }), + ]); + + return { + provider: req.provider, + model: req.model, + message: { role: "assistant", content: outText }, + usage, + raw, + }; + } catch (e: any) { + const latencyMs = Math.round(performance.now() - t0); + await prisma.llmCall.update({ + where: { id: call.id }, + data: { + error: e?.message ?? String(e), + latencyMs, + }, + }); + throw e; + } +} diff --git a/src/llm/providers.ts b/src/llm/providers.ts new file mode 100644 index 0000000..31fd476 --- /dev/null +++ b/src/llm/providers.ts @@ -0,0 +1,19 @@ +import OpenAI from "openai"; +import Anthropic from "@anthropic-ai/sdk"; +import { env } from "../env.js"; + +export function openaiClient() { + if (!env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY not set"); + return new OpenAI({ apiKey: env.OPENAI_API_KEY }); +} + +// xAI (Grok) is OpenAI-compatible at https://api.x.ai/v1 +export function xaiClient() { + if (!env.XAI_API_KEY) throw new Error("XAI_API_KEY not set"); + return new OpenAI({ apiKey: env.XAI_API_KEY, baseURL: "https://api.x.ai/v1" }); +} + +export function anthropicClient() { + if (!env.ANTHROPIC_API_KEY) throw new Error("ANTHROPIC_API_KEY not set"); + return new Anthropic({ apiKey: env.ANTHROPIC_API_KEY }); +} diff --git a/src/llm/types.ts b/src/llm/types.ts new file mode 100644 index 0000000..bde093a --- /dev/null +++ b/src/llm/types.ts @@ -0,0 +1,28 @@ +export type Provider = "openai" | "anthropic" | "xai"; + +export type ChatMessage = { + role: "system" | "user" | "assistant" | "tool"; + content: string; + name?: string; +}; + +export type MultiplexRequest = { + chatId?: string; + provider: Provider; + model: string; + messages: ChatMessage[]; + temperature?: number; + maxTokens?: number; +}; + +export type MultiplexResponse = { + provider: Provider; + model: string; + message: { role: "assistant"; content: string }; + usage?: { + inputTokens?: number; + outputTokens?: number; + totalTokens?: number; + }; + raw: unknown; +}; diff --git a/src/routes.ts b/src/routes.ts new file mode 100644 index 0000000..5288497 --- /dev/null +++ b/src/routes.ts @@ -0,0 +1,111 @@ +import { z } from "zod"; +import type { FastifyInstance } from "fastify"; +import { prisma } from "./db.js"; +import { requireAdmin } from "./auth.js"; +import { runMultiplex } from "./llm/multiplexer.js"; + +export async function registerRoutes(app: FastifyInstance) { + app.get("/health", async () => ({ ok: true })); + + app.get("/v1/chats", async (req) => { + requireAdmin(req); + const chats = await prisma.chat.findMany({ + orderBy: { updatedAt: "desc" }, + take: 100, + select: { id: true, title: true, createdAt: true, updatedAt: true }, + }); + return { chats }; + }); + + app.post("/v1/chats", async (req) => { + requireAdmin(req); + const Body = z.object({ title: z.string().optional() }); + const body = Body.parse(req.body ?? {}); + const chat = await prisma.chat.create({ data: { title: body.title } }); + return { chat }; + }); + + app.get("/v1/chats/:chatId", async (req) => { + requireAdmin(req); + const Params = z.object({ chatId: z.string() }); + const { chatId } = Params.parse(req.params); + + const chat = await prisma.chat.findUnique({ + where: { id: chatId }, + include: { messages: { orderBy: { createdAt: "asc" } }, calls: { orderBy: { createdAt: "desc" } } }, + }); + if (!chat) return app.httpErrors.notFound("chat not found"); + return { chat }; + }); + + app.post("/v1/chats/:chatId/messages", async (req) => { + requireAdmin(req); + const Params = z.object({ chatId: z.string() }); + const Body = z.object({ + role: z.enum(["system", "user", "assistant", "tool"]), + content: z.string(), + name: z.string().optional(), + metadata: z.unknown().optional(), + }); + + const { chatId } = Params.parse(req.params); + const body = Body.parse(req.body); + + const msg = await prisma.message.create({ + data: { + chatId, + role: body.role as any, + content: body.content, + name: body.name, + metadata: body.metadata as any, + }, + }); + + return { message: msg }; + }); + + // Main: create a completion via provider+model and store everything. + app.post("/v1/chat-completions", async (req) => { + requireAdmin(req); + + const Body = z.object({ + chatId: z.string().optional(), + provider: z.enum(["openai", "anthropic", "xai"]), + model: z.string().min(1), + messages: z.array( + z.object({ + role: z.enum(["system", "user", "assistant", "tool"]), + content: z.string(), + name: z.string().optional(), + }) + ), + temperature: z.number().min(0).max(2).optional(), + maxTokens: z.number().int().positive().optional(), + }); + + const body = Body.parse(req.body); + + // ensure chat exists if provided + if (body.chatId) { + const exists = await prisma.chat.findUnique({ where: { id: body.chatId }, select: { id: true } }); + if (!exists) return app.httpErrors.notFound("chat not found"); + } + + // store user messages (anything not assistant) for DB fidelity + if (body.chatId) { + const toInsert = body.messages.filter((m) => m.role !== "assistant"); + if (toInsert.length) { + await prisma.message.createMany({ + data: toInsert.map((m) => ({ chatId: body.chatId!, role: m.role as any, content: m.content, name: m.name })), + }); + } + } + + const result = await runMultiplex(body); + + return { + chatId: body.chatId ?? null, + ...result, + }; + }); +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3f13407 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"] +}