m
This commit is contained in:
@@ -22,3 +22,18 @@ export * from './enums.js';
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Conversation
|
||||
*
|
||||
*/
|
||||
export type Conversation = Prisma.ConversationModel
|
||||
/**
|
||||
* Model ConversationParticipant
|
||||
*
|
||||
*/
|
||||
export type ConversationParticipant = Prisma.ConversationParticipantModel
|
||||
/**
|
||||
* Model Message
|
||||
*
|
||||
*/
|
||||
export type Message = Prisma.MessageModel
|
||||
|
||||
@@ -44,3 +44,18 @@ export { Prisma }
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Conversation
|
||||
*
|
||||
*/
|
||||
export type Conversation = Prisma.ConversationModel
|
||||
/**
|
||||
* Model ConversationParticipant
|
||||
*
|
||||
*/
|
||||
export type ConversationParticipant = Prisma.ConversationParticipantModel
|
||||
/**
|
||||
* Model Message
|
||||
*
|
||||
*/
|
||||
export type Message = Prisma.MessageModel
|
||||
|
||||
@@ -28,6 +28,17 @@ export type StringFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type DateTimeFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[]
|
||||
notIn?: Date[] | string[]
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string
|
||||
}
|
||||
|
||||
export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[]
|
||||
@@ -45,6 +56,50 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_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 DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type SortOrderInput = {
|
||||
sort: Prisma.SortOrder
|
||||
nulls?: Prisma.NullsOrder
|
||||
}
|
||||
|
||||
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedStringFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[]
|
||||
@@ -59,6 +114,17 @@ export type NestedStringFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type NestedDateTimeFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[]
|
||||
notIn?: Date[] | string[]
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string
|
||||
}
|
||||
|
||||
export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[]
|
||||
@@ -87,4 +153,54 @@ export type NestedIntFilter<$PrismaModel = never> = {
|
||||
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 NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
"clientVersion": "7.1.0",
|
||||
"engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
|
||||
"activeProvider": "sqlite",
|
||||
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\ngenerator prismabox {\n provider = \"prismabox\"\n typeboxImportDependencyName = \"elysia\"\n typeboxImportVariableName = \"t\"\n inputModel = true\n output = \"../generated/prismabox\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n username String @unique\n}\n",
|
||||
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\ngenerator prismabox {\n provider = \"prismabox\"\n typeboxImportDependencyName = \"elysia\"\n typeboxImportVariableName = \"t\"\n inputModel = true\n output = \"../generated/prismabox\"\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n username String @unique\n password String\n createdAt DateTime @default(now())\n messages Message[] @relation(\"UserMessages\")\n conversationMemberships ConversationParticipant[] @relation(\"UserConversations\")\n}\n\nmodel Conversation {\n id String @id @default(cuid())\n createdAt DateTime @default(now())\n participants ConversationParticipant[] @relation(\"ConversationParticipants\")\n messages Message[] @relation(\"ConversationMessages\")\n}\n\nmodel ConversationParticipant {\n id String @id @default(cuid())\n conversationId String\n userId String\n conversation Conversation @relation(\"ConversationParticipants\", fields: [conversationId], references: [id], onDelete: Cascade)\n user User @relation(\"UserConversations\", fields: [userId], references: [id], onDelete: Cascade)\n lastReadAt DateTime?\n\n @@unique([conversationId, userId])\n @@index([userId])\n}\n\nmodel Message {\n id String @id @default(cuid())\n conversationId String\n senderId String\n content String\n createdAt DateTime @default(now())\n conversation Conversation @relation(\"ConversationMessages\", fields: [conversationId], references: [id], onDelete: Cascade)\n sender User @relation(\"UserMessages\", fields: [senderId], references: [id], onDelete: Cascade)\n\n @@index([conversationId, createdAt])\n}\n",
|
||||
"runtimeDataModel": {
|
||||
"models": {},
|
||||
"enums": {},
|
||||
@@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
}
|
||||
}
|
||||
|
||||
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
|
||||
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"messages\",\"kind\":\"object\",\"type\":\"Message\",\"relationName\":\"UserMessages\"},{\"name\":\"conversationMemberships\",\"kind\":\"object\",\"type\":\"ConversationParticipant\",\"relationName\":\"UserConversations\"}],\"dbName\":null},\"Conversation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"participants\",\"kind\":\"object\",\"type\":\"ConversationParticipant\",\"relationName\":\"ConversationParticipants\"},{\"name\":\"messages\",\"kind\":\"object\",\"type\":\"Message\",\"relationName\":\"ConversationMessages\"}],\"dbName\":null},\"ConversationParticipant\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"conversationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"conversation\",\"kind\":\"object\",\"type\":\"Conversation\",\"relationName\":\"ConversationParticipants\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserConversations\"},{\"name\":\"lastReadAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Message\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"conversationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"senderId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"conversation\",\"kind\":\"object\",\"type\":\"Conversation\",\"relationName\":\"ConversationMessages\"},{\"name\":\"sender\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserMessages\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
|
||||
|
||||
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
||||
const { Buffer } = await import('node:buffer')
|
||||
@@ -183,6 +183,36 @@ export interface PrismaClient<
|
||||
* ```
|
||||
*/
|
||||
get user(): Prisma.UserDelegate<ExtArgs, { omit: OmitOpts }>;
|
||||
|
||||
/**
|
||||
* `prisma.conversation`: Exposes CRUD operations for the **Conversation** model.
|
||||
* Example usage:
|
||||
* ```ts
|
||||
* // Fetch zero or more Conversations
|
||||
* const conversations = await prisma.conversation.findMany()
|
||||
* ```
|
||||
*/
|
||||
get conversation(): Prisma.ConversationDelegate<ExtArgs, { omit: OmitOpts }>;
|
||||
|
||||
/**
|
||||
* `prisma.conversationParticipant`: Exposes CRUD operations for the **ConversationParticipant** model.
|
||||
* Example usage:
|
||||
* ```ts
|
||||
* // Fetch zero or more ConversationParticipants
|
||||
* const conversationParticipants = await prisma.conversationParticipant.findMany()
|
||||
* ```
|
||||
*/
|
||||
get conversationParticipant(): Prisma.ConversationParticipantDelegate<ExtArgs, { omit: OmitOpts }>;
|
||||
|
||||
/**
|
||||
* `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<ExtArgs, { omit: OmitOpts }>;
|
||||
}
|
||||
|
||||
export function getPrismaClientClass(): PrismaClientConstructor {
|
||||
|
||||
@@ -384,7 +384,10 @@ type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRe
|
||||
|
||||
|
||||
export const ModelName = {
|
||||
User: 'User'
|
||||
User: 'User',
|
||||
Conversation: 'Conversation',
|
||||
ConversationParticipant: 'ConversationParticipant',
|
||||
Message: 'Message'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -400,7 +403,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "user"
|
||||
modelProps: "user" | "conversation" | "conversationParticipant" | "message"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -478,6 +481,228 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
Conversation: {
|
||||
payload: Prisma.$ConversationPayload<ExtArgs>
|
||||
fields: Prisma.ConversationFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.ConversationFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.ConversationFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.ConversationFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.ConversationFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.ConversationFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.ConversationCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.ConversationCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.ConversationCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.ConversationDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.ConversationUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.ConversationDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.ConversationUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.ConversationUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.ConversationUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.ConversationAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateConversation>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.ConversationGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConversationGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.ConversationCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConversationCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
ConversationParticipant: {
|
||||
payload: Prisma.$ConversationParticipantPayload<ExtArgs>
|
||||
fields: Prisma.ConversationParticipantFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.ConversationParticipantFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.ConversationParticipantFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.ConversationParticipantFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.ConversationParticipantFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.ConversationParticipantFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.ConversationParticipantCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.ConversationParticipantCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.ConversationParticipantCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.ConversationParticipantDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.ConversationParticipantUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.ConversationParticipantDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.ConversationParticipantUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.ConversationParticipantUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.ConversationParticipantUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$ConversationParticipantPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.ConversationParticipantAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateConversationParticipant>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.ConversationParticipantGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConversationParticipantGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.ConversationParticipantCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.ConversationParticipantCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
Message: {
|
||||
payload: Prisma.$MessagePayload<ExtArgs>
|
||||
fields: Prisma.MessageFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.MessageFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.MessageFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.MessageFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.MessageFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.MessageFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.MessageCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.MessageCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.MessageCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.MessageDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.MessageUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.MessageDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.MessageUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.MessageUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.MessageUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MessagePayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.MessageAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateMessage>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.MessageGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.MessageGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.MessageCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.MessageCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} & {
|
||||
other: {
|
||||
@@ -517,12 +742,43 @@ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
email: 'email',
|
||||
username: 'username'
|
||||
username: 'username',
|
||||
password: 'password',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConversationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type ConversationScalarFieldEnum = (typeof ConversationScalarFieldEnum)[keyof typeof ConversationScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConversationParticipantScalarFieldEnum = {
|
||||
id: 'id',
|
||||
conversationId: 'conversationId',
|
||||
userId: 'userId',
|
||||
lastReadAt: 'lastReadAt'
|
||||
} as const
|
||||
|
||||
export type ConversationParticipantScalarFieldEnum = (typeof ConversationParticipantScalarFieldEnum)[keyof typeof ConversationParticipantScalarFieldEnum]
|
||||
|
||||
|
||||
export const MessageScalarFieldEnum = {
|
||||
id: 'id',
|
||||
conversationId: 'conversationId',
|
||||
senderId: 'senderId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
@@ -531,6 +787,14 @@ export const SortOrder = {
|
||||
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
||||
|
||||
|
||||
export const NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
} as const
|
||||
|
||||
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Field references
|
||||
@@ -544,6 +808,13 @@ export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'DateTime'
|
||||
*/
|
||||
export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Int'
|
||||
*/
|
||||
@@ -646,6 +917,9 @@ export type PrismaClientOptions = ({
|
||||
}
|
||||
export type GlobalOmitConfig = {
|
||||
user?: Prisma.UserOmit
|
||||
conversation?: Prisma.ConversationOmit
|
||||
conversationParticipant?: Prisma.ConversationParticipantOmit
|
||||
message?: Prisma.MessageOmit
|
||||
}
|
||||
|
||||
/* Types for Logging */
|
||||
|
||||
@@ -51,7 +51,10 @@ export const AnyNull = runtime.AnyNull
|
||||
|
||||
|
||||
export const ModelName = {
|
||||
User: 'User'
|
||||
User: 'User',
|
||||
Conversation: 'Conversation',
|
||||
ConversationParticipant: 'ConversationParticipant',
|
||||
Message: 'Message'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -70,12 +73,43 @@ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
email: 'email',
|
||||
username: 'username'
|
||||
username: 'username',
|
||||
password: 'password',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConversationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type ConversationScalarFieldEnum = (typeof ConversationScalarFieldEnum)[keyof typeof ConversationScalarFieldEnum]
|
||||
|
||||
|
||||
export const ConversationParticipantScalarFieldEnum = {
|
||||
id: 'id',
|
||||
conversationId: 'conversationId',
|
||||
userId: 'userId',
|
||||
lastReadAt: 'lastReadAt'
|
||||
} as const
|
||||
|
||||
export type ConversationParticipantScalarFieldEnum = (typeof ConversationParticipantScalarFieldEnum)[keyof typeof ConversationParticipantScalarFieldEnum]
|
||||
|
||||
|
||||
export const MessageScalarFieldEnum = {
|
||||
id: 'id',
|
||||
conversationId: 'conversationId',
|
||||
senderId: 'senderId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type MessageScalarFieldEnum = (typeof MessageScalarFieldEnum)[keyof typeof MessageScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
@@ -83,3 +117,11 @@ export const SortOrder = {
|
||||
|
||||
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
||||
|
||||
|
||||
export const NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
} as const
|
||||
|
||||
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
||||
|
||||
|
||||
@@ -9,4 +9,7 @@
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
export type * from './models/User.js'
|
||||
export type * from './models/Conversation.js'
|
||||
export type * from './models/ConversationParticipant.js'
|
||||
export type * from './models/Message.js'
|
||||
export type * from './commonInputTypes.js'
|
||||
1326
backend/app/generated/prisma/models/Conversation.ts
Normal file
1326
backend/app/generated/prisma/models/Conversation.ts
Normal file
File diff suppressed because it is too large
Load Diff
1425
backend/app/generated/prisma/models/ConversationParticipant.ts
Normal file
1425
backend/app/generated/prisma/models/ConversationParticipant.ts
Normal file
File diff suppressed because it is too large
Load Diff
1456
backend/app/generated/prisma/models/Message.ts
Normal file
1456
backend/app/generated/prisma/models/Message.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -28,18 +28,24 @@ export type UserMinAggregateOutputType = {
|
||||
id: string | null
|
||||
email: string | null
|
||||
username: string | null
|
||||
password: string | null
|
||||
createdAt: Date | null
|
||||
}
|
||||
|
||||
export type UserMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
email: string | null
|
||||
username: string | null
|
||||
password: string | null
|
||||
createdAt: Date | null
|
||||
}
|
||||
|
||||
export type UserCountAggregateOutputType = {
|
||||
id: number
|
||||
email: number
|
||||
username: number
|
||||
password: number
|
||||
createdAt: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
@@ -48,18 +54,24 @@ export type UserMinAggregateInputType = {
|
||||
id?: true
|
||||
email?: true
|
||||
username?: true
|
||||
password?: true
|
||||
createdAt?: true
|
||||
}
|
||||
|
||||
export type UserMaxAggregateInputType = {
|
||||
id?: true
|
||||
email?: true
|
||||
username?: true
|
||||
password?: true
|
||||
createdAt?: true
|
||||
}
|
||||
|
||||
export type UserCountAggregateInputType = {
|
||||
id?: true
|
||||
email?: true
|
||||
username?: true
|
||||
password?: true
|
||||
createdAt?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -139,6 +151,8 @@ export type UserGroupByOutputType = {
|
||||
id: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt: Date
|
||||
_count: UserCountAggregateOutputType | null
|
||||
_min: UserMinAggregateOutputType | null
|
||||
_max: UserMaxAggregateOutputType | null
|
||||
@@ -166,12 +180,20 @@ export type UserWhereInput = {
|
||||
id?: Prisma.StringFilter<"User"> | string
|
||||
email?: Prisma.StringFilter<"User"> | string
|
||||
username?: Prisma.StringFilter<"User"> | string
|
||||
password?: Prisma.StringFilter<"User"> | string
|
||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
messages?: Prisma.MessageListRelationFilter
|
||||
conversationMemberships?: Prisma.ConversationParticipantListRelationFilter
|
||||
}
|
||||
|
||||
export type UserOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
username?: Prisma.SortOrder
|
||||
password?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
messages?: Prisma.MessageOrderByRelationAggregateInput
|
||||
conversationMemberships?: Prisma.ConversationParticipantOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type UserWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -181,12 +203,18 @@ export type UserWhereUniqueInput = Prisma.AtLeast<{
|
||||
AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
OR?: Prisma.UserWhereInput[]
|
||||
NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
password?: Prisma.StringFilter<"User"> | string
|
||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
messages?: Prisma.MessageListRelationFilter
|
||||
conversationMemberships?: Prisma.ConversationParticipantListRelationFilter
|
||||
}, "id" | "email" | "username">
|
||||
|
||||
export type UserOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
username?: Prisma.SortOrder
|
||||
password?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
_count?: Prisma.UserCountOrderByAggregateInput
|
||||
_max?: Prisma.UserMaxOrderByAggregateInput
|
||||
_min?: Prisma.UserMinOrderByAggregateInput
|
||||
@@ -199,107 +227,339 @@ export type UserScalarWhereWithAggregatesInput = {
|
||||
id?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
email?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
username?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
password?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string
|
||||
}
|
||||
|
||||
export type UserCreateInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||
conversationMemberships?: Prisma.ConversationParticipantCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||
conversationMemberships?: Prisma.ConversationParticipantUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||
conversationMemberships?: Prisma.ConversationParticipantUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||
conversationMemberships?: Prisma.ConversationParticipantUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserCreateManyInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
}
|
||||
|
||||
export type UserUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type UserCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
username?: Prisma.SortOrder
|
||||
password?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
username?: Prisma.SortOrder
|
||||
password?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
username?: Prisma.SortOrder
|
||||
password?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserScalarRelationFilter = {
|
||||
is?: Prisma.UserWhereInput
|
||||
isNot?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type StringFieldUpdateOperationsInput = {
|
||||
set?: string
|
||||
}
|
||||
|
||||
export type DateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string
|
||||
}
|
||||
|
||||
export type UserCreateNestedOneWithoutConversationMembershipsInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutConversationMembershipsInput, Prisma.UserUncheckedCreateWithoutConversationMembershipsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutConversationMembershipsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
}
|
||||
|
||||
export type UserUpdateOneRequiredWithoutConversationMembershipsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutConversationMembershipsInput, Prisma.UserUncheckedCreateWithoutConversationMembershipsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutConversationMembershipsInput
|
||||
upsert?: Prisma.UserUpsertWithoutConversationMembershipsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutConversationMembershipsInput, Prisma.UserUpdateWithoutConversationMembershipsInput>, Prisma.UserUncheckedUpdateWithoutConversationMembershipsInput>
|
||||
}
|
||||
|
||||
export type UserCreateNestedOneWithoutMessagesInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
}
|
||||
|
||||
export type UserUpdateOneRequiredWithoutMessagesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput
|
||||
upsert?: Prisma.UserUpsertWithoutMessagesInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutMessagesInput, Prisma.UserUpdateWithoutMessagesInput>, Prisma.UserUncheckedUpdateWithoutMessagesInput>
|
||||
}
|
||||
|
||||
export type UserCreateWithoutConversationMembershipsInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateWithoutConversationMembershipsInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||
}
|
||||
|
||||
export type UserCreateOrConnectWithoutConversationMembershipsInput = {
|
||||
where: Prisma.UserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutConversationMembershipsInput, Prisma.UserUncheckedCreateWithoutConversationMembershipsInput>
|
||||
}
|
||||
|
||||
export type UserUpsertWithoutConversationMembershipsInput = {
|
||||
update: Prisma.XOR<Prisma.UserUpdateWithoutConversationMembershipsInput, Prisma.UserUncheckedUpdateWithoutConversationMembershipsInput>
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutConversationMembershipsInput, Prisma.UserUncheckedCreateWithoutConversationMembershipsInput>
|
||||
where?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type UserUpdateToOneWithWhereWithoutConversationMembershipsInput = {
|
||||
where?: Prisma.UserWhereInput
|
||||
data: Prisma.XOR<Prisma.UserUpdateWithoutConversationMembershipsInput, Prisma.UserUncheckedUpdateWithoutConversationMembershipsInput>
|
||||
}
|
||||
|
||||
export type UserUpdateWithoutConversationMembershipsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateWithoutConversationMembershipsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||
}
|
||||
|
||||
export type UserCreateWithoutMessagesInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
conversationMemberships?: Prisma.ConversationParticipantCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateWithoutMessagesInput = {
|
||||
id?: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt?: Date | string
|
||||
conversationMemberships?: Prisma.ConversationParticipantUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserCreateOrConnectWithoutMessagesInput = {
|
||||
where: Prisma.UserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
||||
}
|
||||
|
||||
export type UserUpsertWithoutMessagesInput = {
|
||||
update: Prisma.XOR<Prisma.UserUpdateWithoutMessagesInput, Prisma.UserUncheckedUpdateWithoutMessagesInput>
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
||||
where?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type UserUpdateToOneWithWhereWithoutMessagesInput = {
|
||||
where?: Prisma.UserWhereInput
|
||||
data: Prisma.XOR<Prisma.UserUpdateWithoutMessagesInput, Prisma.UserUncheckedUpdateWithoutMessagesInput>
|
||||
}
|
||||
|
||||
export type UserUpdateWithoutMessagesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
conversationMemberships?: Prisma.ConversationParticipantUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateWithoutMessagesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
conversationMemberships?: Prisma.ConversationParticipantUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count Type UserCountOutputType
|
||||
*/
|
||||
|
||||
export type UserCountOutputType = {
|
||||
messages: number
|
||||
conversationMemberships: number
|
||||
}
|
||||
|
||||
export type UserCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
messages?: boolean | UserCountOutputTypeCountMessagesArgs
|
||||
conversationMemberships?: boolean | UserCountOutputTypeCountConversationMembershipsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
export type UserCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the UserCountOutputType
|
||||
*/
|
||||
select?: Prisma.UserCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
export type UserCountOutputTypeCountMessagesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.MessageWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
export type UserCountOutputTypeCountConversationMembershipsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConversationParticipantWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type UserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
email?: boolean
|
||||
username?: boolean
|
||||
password?: boolean
|
||||
createdAt?: boolean
|
||||
messages?: boolean | Prisma.User$messagesArgs<ExtArgs>
|
||||
conversationMemberships?: boolean | Prisma.User$conversationMembershipsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
email?: boolean
|
||||
username?: boolean
|
||||
password?: boolean
|
||||
createdAt?: boolean
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
email?: boolean
|
||||
username?: boolean
|
||||
password?: boolean
|
||||
createdAt?: boolean
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectScalar = {
|
||||
id?: boolean
|
||||
email?: boolean
|
||||
username?: boolean
|
||||
password?: boolean
|
||||
createdAt?: boolean
|
||||
}
|
||||
|
||||
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "email" | "username", ExtArgs["result"]["user"]>
|
||||
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "email" | "username" | "password" | "createdAt", ExtArgs["result"]["user"]>
|
||||
export type UserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
messages?: boolean | Prisma.User$messagesArgs<ExtArgs>
|
||||
conversationMemberships?: boolean | Prisma.User$conversationMembershipsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type UserIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {}
|
||||
export type UserIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {}
|
||||
|
||||
export type $UserPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "User"
|
||||
objects: {}
|
||||
objects: {
|
||||
messages: Prisma.$MessagePayload<ExtArgs>[]
|
||||
conversationMemberships: Prisma.$ConversationParticipantPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
email: string
|
||||
username: string
|
||||
password: string
|
||||
createdAt: Date
|
||||
}, ExtArgs["result"]["user"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -694,6 +954,8 @@ readonly fields: UserFieldRefs;
|
||||
*/
|
||||
export interface Prisma__UserClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
messages<T extends Prisma.User$messagesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$messagesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$MessagePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
conversationMemberships<T extends Prisma.User$conversationMembershipsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$conversationMembershipsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConversationParticipantPayload<ExtArgs>, 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.
|
||||
@@ -726,6 +988,8 @@ export interface UserFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"User", 'String'>
|
||||
readonly email: Prisma.FieldRef<"User", 'String'>
|
||||
readonly username: Prisma.FieldRef<"User", 'String'>
|
||||
readonly password: Prisma.FieldRef<"User", 'String'>
|
||||
readonly createdAt: Prisma.FieldRef<"User", 'DateTime'>
|
||||
}
|
||||
|
||||
|
||||
@@ -742,6 +1006,10 @@ export type UserFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter, which User to fetch.
|
||||
*/
|
||||
@@ -760,6 +1028,10 @@ export type UserFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.I
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter, which User to fetch.
|
||||
*/
|
||||
@@ -778,6 +1050,10 @@ export type UserFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalA
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter, which User to fetch.
|
||||
*/
|
||||
@@ -826,6 +1102,10 @@ export type UserFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter, which User to fetch.
|
||||
*/
|
||||
@@ -874,6 +1154,10 @@ export type UserFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter, which Users to fetch.
|
||||
*/
|
||||
@@ -917,6 +1201,10 @@ export type UserCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* The data needed to create a User.
|
||||
*/
|
||||
@@ -963,6 +1251,10 @@ export type UserUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* The data needed to update a User.
|
||||
*/
|
||||
@@ -1029,6 +1321,10 @@ export type UserUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* The filter to search for the User to update in case it exists.
|
||||
*/
|
||||
@@ -1055,6 +1351,10 @@ export type UserDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
/**
|
||||
* Filter which User to delete.
|
||||
*/
|
||||
@@ -1075,6 +1375,54 @@ export type UserDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* User.messages
|
||||
*/
|
||||
export type User$messagesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Message
|
||||
*/
|
||||
select?: Prisma.MessageSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Message
|
||||
*/
|
||||
omit?: Prisma.MessageOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.MessageInclude<ExtArgs> | null
|
||||
where?: Prisma.MessageWhereInput
|
||||
orderBy?: Prisma.MessageOrderByWithRelationInput | Prisma.MessageOrderByWithRelationInput[]
|
||||
cursor?: Prisma.MessageWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.MessageScalarFieldEnum | Prisma.MessageScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* User.conversationMemberships
|
||||
*/
|
||||
export type User$conversationMembershipsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ConversationParticipant
|
||||
*/
|
||||
select?: Prisma.ConversationParticipantSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ConversationParticipant
|
||||
*/
|
||||
omit?: Prisma.ConversationParticipantOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConversationParticipantInclude<ExtArgs> | null
|
||||
where?: Prisma.ConversationParticipantWhereInput
|
||||
orderBy?: Prisma.ConversationParticipantOrderByWithRelationInput | Prisma.ConversationParticipantOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConversationParticipantWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConversationParticipantScalarFieldEnum | Prisma.ConversationParticipantScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* User without action
|
||||
*/
|
||||
@@ -1087,4 +1435,8 @@ export type UserDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
* Omit specific fields from the User
|
||||
*/
|
||||
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.UserInclude<ExtArgs> | null
|
||||
}
|
||||
|
||||
250
backend/app/generated/prismabox/Conversation.ts
Normal file
250
backend/app/generated/prismabox/Conversation.ts
Normal file
@@ -0,0 +1,250 @@
|
||||
import { t } from "elysia";
|
||||
|
||||
import { __transformDate__ } from "./__transformDate__";
|
||||
|
||||
import { __nullable__ } from "./__nullable__";
|
||||
|
||||
export const ConversationPlain = t.Object(
|
||||
{ id: t.String(), createdAt: t.Date() },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationRelations = t.Object(
|
||||
{
|
||||
participants: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
userId: t.String(),
|
||||
lastReadAt: __nullable__(t.Date()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
messages: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
senderId: t.String(),
|
||||
content: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationPlainInputCreate = t.Object(
|
||||
{},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationPlainInputUpdate = t.Object(
|
||||
{},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationRelationsInputCreate = t.Object(
|
||||
{
|
||||
participants: t.Optional(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
messages: t.Optional(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationRelationsInputUpdate = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
participants: t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
disconnect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
messages: t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
disconnect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationWhere = t.Partial(
|
||||
t.Recursive(
|
||||
(Self) =>
|
||||
t.Object(
|
||||
{
|
||||
AND: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
NOT: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
id: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "Conversation" },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationWhereUnique = t.Recursive(
|
||||
(Self) =>
|
||||
t.Intersect(
|
||||
[
|
||||
t.Partial(
|
||||
t.Object({ id: t.String() }, { additionalProperties: false }),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Union([t.Object({ id: t.String() })], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
t.Partial(
|
||||
t.Object({
|
||||
AND: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
NOT: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
}),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Partial(
|
||||
t.Object(
|
||||
{ id: t.String(), createdAt: t.Date() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "Conversation" },
|
||||
);
|
||||
|
||||
export const ConversationSelect = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Boolean(),
|
||||
createdAt: t.Boolean(),
|
||||
participants: t.Boolean(),
|
||||
messages: t.Boolean(),
|
||||
_count: t.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationInclude = t.Partial(
|
||||
t.Object(
|
||||
{ participants: t.Boolean(), messages: t.Boolean(), _count: t.Boolean() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationOrderBy = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
createdAt: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const Conversation = t.Composite(
|
||||
[ConversationPlain, ConversationRelations],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationInputCreate = t.Composite(
|
||||
[ConversationPlainInputCreate, ConversationRelationsInputCreate],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationInputUpdate = t.Composite(
|
||||
[ConversationPlainInputUpdate, ConversationRelationsInputUpdate],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
245
backend/app/generated/prismabox/ConversationParticipant.ts
Normal file
245
backend/app/generated/prismabox/ConversationParticipant.ts
Normal file
@@ -0,0 +1,245 @@
|
||||
import { t } from "elysia";
|
||||
|
||||
import { __transformDate__ } from "./__transformDate__";
|
||||
|
||||
import { __nullable__ } from "./__nullable__";
|
||||
|
||||
export const ConversationParticipantPlain = t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
userId: t.String(),
|
||||
lastReadAt: __nullable__(t.Date()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantRelations = t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{ id: t.String(), createdAt: t.Date() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
user: t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
email: t.String(),
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantPlainInputCreate = t.Object(
|
||||
{ lastReadAt: t.Optional(__nullable__(t.Date())) },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantPlainInputUpdate = t.Object(
|
||||
{ lastReadAt: t.Optional(__nullable__(t.Date())) },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantRelationsInputCreate = t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
user: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantRelationsInputUpdate = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
user: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationParticipantWhere = t.Partial(
|
||||
t.Recursive(
|
||||
(Self) =>
|
||||
t.Object(
|
||||
{
|
||||
AND: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
NOT: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
userId: t.String(),
|
||||
lastReadAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "ConversationParticipant" },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationParticipantWhereUnique = t.Recursive(
|
||||
(Self) =>
|
||||
t.Intersect(
|
||||
[
|
||||
t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId_userId: t.Object(
|
||||
{ conversationId: t.String(), userId: t.String() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Union(
|
||||
[
|
||||
t.Object({ id: t.String() }),
|
||||
t.Object({
|
||||
conversationId_userId: t.Object(
|
||||
{ conversationId: t.String(), userId: t.String() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
}),
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Partial(
|
||||
t.Object({
|
||||
AND: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
NOT: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
}),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
userId: t.String(),
|
||||
lastReadAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "ConversationParticipant" },
|
||||
);
|
||||
|
||||
export const ConversationParticipantSelect = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Boolean(),
|
||||
conversationId: t.Boolean(),
|
||||
userId: t.Boolean(),
|
||||
conversation: t.Boolean(),
|
||||
user: t.Boolean(),
|
||||
lastReadAt: t.Boolean(),
|
||||
_count: t.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationParticipantInclude = t.Partial(
|
||||
t.Object(
|
||||
{ conversation: t.Boolean(), user: t.Boolean(), _count: t.Boolean() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationParticipantOrderBy = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
conversationId: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
userId: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
lastReadAt: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const ConversationParticipant = t.Composite(
|
||||
[ConversationParticipantPlain, ConversationParticipantRelations],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantInputCreate = t.Composite(
|
||||
[
|
||||
ConversationParticipantPlainInputCreate,
|
||||
ConversationParticipantRelationsInputCreate,
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ConversationParticipantInputUpdate = t.Composite(
|
||||
[
|
||||
ConversationParticipantPlainInputUpdate,
|
||||
ConversationParticipantRelationsInputUpdate,
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
227
backend/app/generated/prismabox/Message.ts
Normal file
227
backend/app/generated/prismabox/Message.ts
Normal file
@@ -0,0 +1,227 @@
|
||||
import { t } from "elysia";
|
||||
|
||||
import { __transformDate__ } from "./__transformDate__";
|
||||
|
||||
import { __nullable__ } from "./__nullable__";
|
||||
|
||||
export const MessagePlain = t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
senderId: t.String(),
|
||||
content: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessageRelations = t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{ id: t.String(), createdAt: t.Date() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
sender: t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
email: t.String(),
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessagePlainInputCreate = t.Object(
|
||||
{ content: t.String() },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessagePlainInputUpdate = t.Object(
|
||||
{ content: t.Optional(t.String()) },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessageRelationsInputCreate = t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
sender: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessageRelationsInputUpdate = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
conversation: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
sender: t.Object(
|
||||
{
|
||||
connect: t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const MessageWhere = t.Partial(
|
||||
t.Recursive(
|
||||
(Self) =>
|
||||
t.Object(
|
||||
{
|
||||
AND: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
NOT: t.Union([Self, t.Array(Self, { additionalProperties: false })]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
senderId: t.String(),
|
||||
content: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "Message" },
|
||||
),
|
||||
);
|
||||
|
||||
export const MessageWhereUnique = t.Recursive(
|
||||
(Self) =>
|
||||
t.Intersect(
|
||||
[
|
||||
t.Partial(
|
||||
t.Object({ id: t.String() }, { additionalProperties: false }),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Union([t.Object({ id: t.String() })], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
t.Partial(
|
||||
t.Object({
|
||||
AND: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
NOT: t.Union([
|
||||
Self,
|
||||
t.Array(Self, { additionalProperties: false }),
|
||||
]),
|
||||
OR: t.Array(Self, { additionalProperties: false }),
|
||||
}),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
senderId: t.String(),
|
||||
content: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
],
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ $id: "Message" },
|
||||
);
|
||||
|
||||
export const MessageSelect = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Boolean(),
|
||||
conversationId: t.Boolean(),
|
||||
senderId: t.Boolean(),
|
||||
content: t.Boolean(),
|
||||
createdAt: t.Boolean(),
|
||||
conversation: t.Boolean(),
|
||||
sender: t.Boolean(),
|
||||
_count: t.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const MessageInclude = t.Partial(
|
||||
t.Object(
|
||||
{ conversation: t.Boolean(), sender: t.Boolean(), _count: t.Boolean() },
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const MessageOrderBy = t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
id: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
conversationId: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
senderId: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
content: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
createdAt: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const Message = t.Composite([MessagePlain, MessageRelations], {
|
||||
additionalProperties: false,
|
||||
});
|
||||
|
||||
export const MessageInputCreate = t.Composite(
|
||||
[MessagePlainInputCreate, MessageRelationsInputCreate],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const MessageInputUpdate = t.Composite(
|
||||
[MessagePlainInputUpdate, MessageRelationsInputUpdate],
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -5,29 +5,155 @@ import { __transformDate__ } from "./__transformDate__";
|
||||
import { __nullable__ } from "./__nullable__";
|
||||
|
||||
export const UserPlain = t.Object(
|
||||
{ id: t.String(), email: t.String(), username: t.String() },
|
||||
{
|
||||
id: t.String(),
|
||||
email: t.String(),
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const UserRelations = t.Object({}, { additionalProperties: false });
|
||||
export const UserRelations = t.Object(
|
||||
{
|
||||
messages: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
senderId: t.String(),
|
||||
content: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
conversationMemberships: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String(),
|
||||
conversationId: t.String(),
|
||||
userId: t.String(),
|
||||
lastReadAt: __nullable__(t.Date()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const UserPlainInputCreate = t.Object(
|
||||
{ email: t.String(), username: t.String() },
|
||||
{ email: t.String(), username: t.String(), password: t.String() },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const UserPlainInputUpdate = t.Object(
|
||||
{ email: t.Optional(t.String()), username: t.Optional(t.String()) },
|
||||
{
|
||||
email: t.Optional(t.String()),
|
||||
username: t.Optional(t.String()),
|
||||
password: t.Optional(t.String()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const UserRelationsInputCreate = t.Object(
|
||||
{},
|
||||
{
|
||||
messages: t.Optional(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
conversationMemberships: t.Optional(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const UserRelationsInputUpdate = t.Partial(
|
||||
t.Object({}, { additionalProperties: false }),
|
||||
t.Object(
|
||||
{
|
||||
messages: t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
disconnect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
conversationMemberships: t.Partial(
|
||||
t.Object(
|
||||
{
|
||||
connect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
disconnect: t.Array(
|
||||
t.Object(
|
||||
{
|
||||
id: t.String({ additionalProperties: false }),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const UserWhere = t.Partial(
|
||||
@@ -41,6 +167,8 @@ export const UserWhere = t.Partial(
|
||||
id: t.String(),
|
||||
email: t.String(),
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
@@ -83,7 +211,13 @@ export const UserWhereUnique = t.Recursive(
|
||||
),
|
||||
t.Partial(
|
||||
t.Object(
|
||||
{ id: t.String(), email: t.String(), username: t.String() },
|
||||
{
|
||||
id: t.String(),
|
||||
email: t.String(),
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
createdAt: t.Date(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
),
|
||||
@@ -99,6 +233,10 @@ export const UserSelect = t.Partial(
|
||||
id: t.Boolean(),
|
||||
email: t.Boolean(),
|
||||
username: t.Boolean(),
|
||||
password: t.Boolean(),
|
||||
createdAt: t.Boolean(),
|
||||
messages: t.Boolean(),
|
||||
conversationMemberships: t.Boolean(),
|
||||
_count: t.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
@@ -106,7 +244,14 @@ export const UserSelect = t.Partial(
|
||||
);
|
||||
|
||||
export const UserInclude = t.Partial(
|
||||
t.Object({ _count: t.Boolean() }, { additionalProperties: false }),
|
||||
t.Object(
|
||||
{
|
||||
messages: t.Boolean(),
|
||||
conversationMemberships: t.Boolean(),
|
||||
_count: t.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
);
|
||||
|
||||
export const UserOrderBy = t.Partial(
|
||||
@@ -121,6 +266,12 @@ export const UserOrderBy = t.Partial(
|
||||
username: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
password: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
createdAt: t.Union([t.Literal("asc"), t.Literal("desc")], {
|
||||
additionalProperties: false,
|
||||
}),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
export * from "./User";
|
||||
export * from "./Conversation";
|
||||
export * from "./ConversationParticipant";
|
||||
export * from "./Message";
|
||||
export * from "./__nullable__";
|
||||
export * from "./__transformDate__";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"email" TEXT NOT NULL,
|
||||
"username" TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `password` to the `User` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"email" TEXT NOT NULL,
|
||||
"username" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL
|
||||
);
|
||||
INSERT INTO "new_User" ("email", "id", "username") SELECT "email", "id", "username" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `password` on the `User` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"email" TEXT NOT NULL,
|
||||
"username" TEXT NOT NULL
|
||||
);
|
||||
INSERT INTO "new_User" ("email", "id", "username") SELECT "email", "id", "username" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -0,0 +1,48 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"email" TEXT NOT NULL,
|
||||
"username" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Conversation" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "ConversationParticipant" (
|
||||
"conversationId" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"lastReadAt" DATETIME,
|
||||
|
||||
PRIMARY KEY ("conversationId", "userId"),
|
||||
CONSTRAINT "ConversationParticipant_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT "ConversationParticipant_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Message" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"conversationId" TEXT NOT NULL,
|
||||
"senderId" TEXT NOT NULL,
|
||||
"content" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT "Message_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT "Message_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "ConversationParticipant_userId_idx" ON "ConversationParticipant"("userId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Message_conversationId_createdAt_idx" ON "Message"("conversationId", "createdAt");
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The primary key for the `ConversationParticipant` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||
- The required column `id` was added to the `ConversationParticipant` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_ConversationParticipant" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"conversationId" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"lastReadAt" DATETIME,
|
||||
CONSTRAINT "ConversationParticipant_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT "ConversationParticipant_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
INSERT INTO "new_ConversationParticipant" ("conversationId", "lastReadAt", "userId") SELECT "conversationId", "lastReadAt", "userId" FROM "ConversationParticipant";
|
||||
DROP TABLE "ConversationParticipant";
|
||||
ALTER TABLE "new_ConversationParticipant" RENAME TO "ConversationParticipant";
|
||||
CREATE INDEX "ConversationParticipant_userId_idx" ON "ConversationParticipant"("userId");
|
||||
CREATE UNIQUE INDEX "ConversationParticipant_conversationId_userId_key" ON "ConversationParticipant"("conversationId", "userId");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -1,7 +1,6 @@
|
||||
generator client {
|
||||
provider = "prisma-client"
|
||||
output = "../generated/prisma"
|
||||
previewFeatures = ["driverAdapters"]
|
||||
}
|
||||
|
||||
datasource db {
|
||||
@@ -17,8 +16,40 @@ generator prismabox {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
username String @unique
|
||||
password String
|
||||
createdAt DateTime @default(now())
|
||||
messages Message[] @relation("UserMessages")
|
||||
conversationMemberships ConversationParticipant[] @relation("UserConversations")
|
||||
}
|
||||
|
||||
model Conversation {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
participants ConversationParticipant[] @relation("ConversationParticipants")
|
||||
messages Message[] @relation("ConversationMessages")
|
||||
}
|
||||
|
||||
model ConversationParticipant {
|
||||
id String @id @default(cuid())
|
||||
conversationId String
|
||||
userId String
|
||||
conversation Conversation @relation("ConversationParticipants", fields: [conversationId], references: [id], onDelete: Cascade)
|
||||
user User @relation("UserConversations", fields: [userId], references: [id], onDelete: Cascade)
|
||||
lastReadAt DateTime?
|
||||
@@unique([conversationId, userId])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model Message {
|
||||
id String @id @default(cuid())
|
||||
conversationId String
|
||||
senderId String
|
||||
content String
|
||||
createdAt DateTime @default(now())
|
||||
conversation Conversation @relation("ConversationMessages", fields: [conversationId], references: [id], onDelete: Cascade)
|
||||
sender User @relation("UserMessages", fields: [senderId], references: [id], onDelete: Cascade)
|
||||
@@index([conversationId, createdAt])
|
||||
}
|
||||
|
||||
@@ -2,11 +2,24 @@ import { Elysia, t } from "elysia";
|
||||
import { prisma } from "../db";
|
||||
import { UserPlainInputCreate, UserPlain } from "../../generated/prismabox/User";
|
||||
|
||||
|
||||
|
||||
export const users = new Elysia({ prefix: "/users" })
|
||||
.post("/", async ({ body }) =>
|
||||
prisma.user.create({
|
||||
.post("/register", async ({ body }) => {
|
||||
|
||||
const hashedPassword = await Bun.password.hash(body.password, {
|
||||
algorithm: "bcrypt",
|
||||
cost: 10,
|
||||
});
|
||||
|
||||
body.password = hashedPassword;
|
||||
|
||||
const user = await prisma.user.create({
|
||||
data: body
|
||||
}),
|
||||
});
|
||||
|
||||
return user
|
||||
},
|
||||
{
|
||||
body: UserPlainInputCreate,
|
||||
response: UserPlain
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Elysia } from 'elysia'
|
||||
import { Elysia, t } from 'elysia'
|
||||
import { jwt } from '@elysiajs/jwt'
|
||||
import { prisma } from "../db";
|
||||
|
||||
export const jwtConfig = jwt({
|
||||
name: 'jwt',
|
||||
@@ -11,8 +12,27 @@ export const auth = new Elysia({ prefix: "/auth" })
|
||||
.use(
|
||||
jwtConfig
|
||||
)
|
||||
.get('/sign/:name', ({ jwt, params: { name } }) => {
|
||||
return jwt.sign({ name })
|
||||
.post('/login', async ({ jwt, body, status }) => {
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: body.username,
|
||||
}
|
||||
})
|
||||
|
||||
if (!user) return status(404, "Username or password is incorrect");
|
||||
|
||||
const isMatch = await Bun.password.verify(body.password, user.password)
|
||||
if (!isMatch) {
|
||||
return status(403, "Username or password is incorrect")
|
||||
}
|
||||
|
||||
return jwt.sign({ name: user.username })
|
||||
}, {
|
||||
body: t.Object({
|
||||
username: t.String(),
|
||||
password: t.String(),
|
||||
})
|
||||
})
|
||||
.get('/profile', async ({ jwt, status, headers: { authorization } }) => {
|
||||
const profile = await jwt.verify(authorization)
|
||||
@@ -30,10 +50,20 @@ export const authGuard = {
|
||||
if (!authHeader) return status(401, "Missing authorization header");
|
||||
|
||||
|
||||
const ok = await jwt.verify(authHeader);
|
||||
if (!ok) return status(401, "Invalid or expired token");
|
||||
const details = await jwt.verify(authHeader);
|
||||
if (!details) return status(401, "Invalid or expired token");
|
||||
|
||||
return { user: ok };
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: details.name
|
||||
}
|
||||
})
|
||||
if (!user) return status(404, "User not found");
|
||||
|
||||
|
||||
|
||||
|
||||
return { user: details };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
import { Elysia, t } from "elysia";
|
||||
import { authGuard, jwtConfig } from "../auth";
|
||||
|
||||
export const ws = new Elysia()
|
||||
.ws("/ws", {
|
||||
body: t.Object({
|
||||
text: t.String(),
|
||||
sender: t.String(),
|
||||
}),
|
||||
open(ws) {
|
||||
const time: string = new Date().toUTCString();
|
||||
console.log(time + " Client connected" + " " + ws.id);
|
||||
ws.subscribe("chat");
|
||||
},
|
||||
message(ws, message) {
|
||||
ws.publish("chat", message);
|
||||
ws.send(message);
|
||||
},
|
||||
close(ws) {
|
||||
const time: string = new Date().toUTCString();
|
||||
console.log(time + " Client connected" + " " + ws.id);
|
||||
ws.unsubscribe("chat");
|
||||
}
|
||||
})
|
||||
.use(jwtConfig)
|
||||
.guard(authGuard, (router) =>
|
||||
router
|
||||
.ws("/ws", {
|
||||
body: t.Object({
|
||||
text: t.String(),
|
||||
sender: t.String(),
|
||||
}),
|
||||
open(ws) {
|
||||
const time: string = new Date().toUTCString();
|
||||
console.log(time + " Client connected" + " " + ws.id);
|
||||
ws.subscribe("chat");
|
||||
},
|
||||
message(ws, message) {
|
||||
ws.publish("chat", message);
|
||||
ws.send(message);
|
||||
},
|
||||
close(ws) {
|
||||
const time: string = new Date().toUTCString();
|
||||
console.log(time + " Client connected" + " " + ws.id);
|
||||
ws.unsubscribe("chat");
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user