m
This commit is contained in:
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 },
|
||||
);
|
||||
Reference in New Issue
Block a user