обновОЧКИ
This commit is contained in:
@@ -16,15 +16,7 @@ export function qChatMessages() {
|
|||||||
const response = await api.chad.chatMessages({ cursor: pageParam, limit: 25 })
|
const response = await api.chad.chatMessages({ cursor: pageParam, limit: 25 })
|
||||||
|
|
||||||
return response.data
|
return response.data
|
||||||
// return {
|
|
||||||
// messages: response.data.messages.reverse(),
|
|
||||||
// nextCursor: response.data.nextCursor,
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
// select: data => ({
|
|
||||||
// pages: [...data.pages].reverse(),
|
|
||||||
// pageParams: [...data.pageParams].reverse(),
|
|
||||||
// }),
|
|
||||||
select: (data) => {
|
select: (data) => {
|
||||||
return data.pages.flatMap(page => page.messages).toReversed()
|
return data.pages.flatMap(page => page.messages).toReversed()
|
||||||
},
|
},
|
||||||
|
|||||||
62
new-client/src/widgets/chat/ui/ChatAttachment.vue
Normal file
62
new-client/src/widgets/chat/ui/ChatAttachment.vue
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
bem.b(),
|
||||||
|
bem.is('loading', loading),
|
||||||
|
bem.is('error', error),
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
{{ name }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import useBem from '@shared/composables/use-bem.ts'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
name: string
|
||||||
|
loading?: boolean
|
||||||
|
error?: boolean
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const bem = useBem('chat-attachment')
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.chat-attachment {
|
||||||
|
--stripe-width: 20px;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
padding: var(--space-1) var(--space-2);
|
||||||
|
background-color: var(--grey-1);
|
||||||
|
outline: 1px solid var(--ink);
|
||||||
|
outline-offset: -1px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
background-repeat: repeat;
|
||||||
|
color: var(--grey-3);
|
||||||
|
|
||||||
|
&.is-loading {
|
||||||
|
background-image: repeating-linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
transparent 25%,
|
||||||
|
transparent 50%,
|
||||||
|
var(--grey-2) 50%,
|
||||||
|
var(--grey-2) 75%
|
||||||
|
);
|
||||||
|
background-size: var(--stripe-width) var(--stripe-width);
|
||||||
|
animation: loading 500ms infinite linear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
from {
|
||||||
|
background-position-x: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
background-position-x: var(--stripe-width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -17,39 +17,50 @@
|
|||||||
|
|
||||||
<ChadButton
|
<ChadButton
|
||||||
class="chat-input__send"
|
class="chat-input__send"
|
||||||
|
:loading="isUploading"
|
||||||
@click="sendMessage()"
|
@click="sendMessage()"
|
||||||
>
|
>
|
||||||
Send
|
Send
|
||||||
</ChadButton>
|
</ChadButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul v-if="fileUploadApi.acceptedFiles.length > 0" class="chat-input__attachments" v-bind="fileUploadApi.getItemGroupProps()">
|
<div v-if="fileUploadApi.acceptedFiles.length > 0" class="chat-input__attachments" v-bind="fileUploadApi.getItemGroupProps()">
|
||||||
<li
|
<ChatAttachment
|
||||||
v-for="file in fileUploadApi.acceptedFiles"
|
v-for="file in fileUploadApi.acceptedFiles"
|
||||||
:key="file.name"
|
:key="file.name"
|
||||||
|
:loading="uploadStates.get(file)?.status === 'loading'"
|
||||||
|
:error="uploadStates.get(file)?.status === 'error'"
|
||||||
class="chat-input__attachment"
|
class="chat-input__attachment"
|
||||||
v-bind="fileUploadApi.getItemProps({ file })"
|
v-bind="fileUploadApi.getItemProps({ file })"
|
||||||
@click="fileUploadApi.deleteFile(file)"
|
:name="file.name"
|
||||||
>
|
@click="removeFile(file)"
|
||||||
{{ file.name }}
|
/>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
|
||||||
|
|
||||||
<input v-bind="fileUploadApi.getHiddenInputProps()">
|
<input v-bind="fileUploadApi.getHiddenInputProps()">
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NewChatMessagePayload } from '@shared/api/generated-chad-api.ts'
|
import type { FullRequestParams, NewChatMessagePayload } from '@shared/api/generated-chad-api.ts'
|
||||||
import { Plus } from '@lucide/vue'
|
import { Plus } from '@lucide/vue'
|
||||||
|
import api from '@shared/api/client.ts'
|
||||||
|
import { ContentType } from '@shared/api/generated-chad-api.ts'
|
||||||
import ChadButton from '@shared/components/ui/Button.vue'
|
import ChadButton from '@shared/components/ui/Button.vue'
|
||||||
import ChadInput from '@shared/components/ui/Input.vue'
|
import ChadInput from '@shared/components/ui/Input.vue'
|
||||||
import { useEventListener } from '@vueuse/core'
|
import { useEventListener } from '@vueuse/core'
|
||||||
import { useChat } from '@widgets/chat/composables/use-chat.ts'
|
import { useChat } from '@widgets/chat/composables/use-chat.ts'
|
||||||
|
import ChatAttachment from '@widgets/chat/ui/ChatAttachment.vue'
|
||||||
import * as fileUpload from '@zag-js/file-upload'
|
import * as fileUpload from '@zag-js/file-upload'
|
||||||
import { normalizeProps, useMachine } from '@zag-js/vue'
|
import { normalizeProps, useMachine } from '@zag-js/vue'
|
||||||
import { computed, reactive, useId } from 'vue'
|
import { computed, reactive, useId } from 'vue'
|
||||||
|
|
||||||
|
interface UploadStatus {
|
||||||
|
status: 'loading' | 'done' | 'error'
|
||||||
|
uuid?: string
|
||||||
|
abortController: AbortController
|
||||||
|
}
|
||||||
|
|
||||||
const id = useId()
|
const id = useId()
|
||||||
const chat = useChat()
|
const chat = useChat()
|
||||||
|
|
||||||
@@ -58,22 +69,46 @@ const message: NewChatMessagePayload = reactive({
|
|||||||
attachments: [],
|
attachments: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const uploadStates = reactive(new Map<File, UploadStatus>())
|
||||||
|
|
||||||
|
const isUploading = computed(() => {
|
||||||
|
return Array.from(uploadStates.values()).some(s => s.status === 'loading')
|
||||||
|
})
|
||||||
|
|
||||||
const service = useMachine(fileUpload.machine, {
|
const service = useMachine(fileUpload.machine, {
|
||||||
id,
|
id,
|
||||||
maxFiles: 10,
|
maxFiles: 10,
|
||||||
maxFileSize: 100 * 1024 * 1024,
|
maxFileSize: 1000 * 1024 * 1024,
|
||||||
name: 'chat-input',
|
name: 'chat-input',
|
||||||
capture: 'environment',
|
capture: 'environment',
|
||||||
allowDrop: false,
|
allowDrop: false,
|
||||||
onFileAccept: (details) => {
|
onFileAccept: (details) => {
|
||||||
console.log('onFileAccept', details)
|
for (const file of details.files) {
|
||||||
},
|
if (uploadStates.has(file))
|
||||||
// transformFiles: async (files) => {
|
continue
|
||||||
// console.log(files)
|
|
||||||
//
|
|
||||||
// return files
|
|
||||||
// },
|
|
||||||
|
|
||||||
|
const state: UploadStatus = { status: 'loading', abortController: new AbortController() }
|
||||||
|
uploadStates.set(file, state)
|
||||||
|
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
|
||||||
|
try {
|
||||||
|
api.chad.attachmentUpload({
|
||||||
|
body: formData,
|
||||||
|
format: 'text',
|
||||||
|
type: ContentType.FormData,
|
||||||
|
signal: state.abortController.signal,
|
||||||
|
} as FullRequestParams).then((response) => {
|
||||||
|
uploadStates.set(file, { ...state, status: 'done', uuid: response.data })
|
||||||
|
message.attachments!.push(response.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
uploadStates.set(file, { ...state, status: 'error' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileUploadApi = computed(() => fileUpload.connect(service, normalizeProps))
|
const fileUploadApi = computed(() => fileUpload.connect(service, normalizeProps))
|
||||||
@@ -82,7 +117,16 @@ useEventListener(document, 'paste', (event) => {
|
|||||||
fileUploadApi.value.setClipboardFiles(event.clipboardData)
|
fileUploadApi.value.setClipboardFiles(event.clipboardData)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function removeFile(file: File) {
|
||||||
|
uploadStates.get(file)?.abortController.abort('Attachment removed')
|
||||||
|
uploadStates.delete(file)
|
||||||
|
fileUploadApi.value.deleteFile(file)
|
||||||
|
}
|
||||||
|
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
|
if (isUploading.value)
|
||||||
|
return
|
||||||
|
|
||||||
chat.sendMessage(message)
|
chat.sendMessage(message)
|
||||||
|
|
||||||
reset()
|
reset()
|
||||||
@@ -91,6 +135,8 @@ function sendMessage() {
|
|||||||
function reset() {
|
function reset() {
|
||||||
message.text = ''
|
message.text = ''
|
||||||
message.attachments = []
|
message.attachments = []
|
||||||
|
uploadStates.clear()
|
||||||
|
fileUploadApi.value.clearFiles()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -125,14 +171,11 @@ function reset() {
|
|||||||
margin-top: var(--space-2);
|
margin-top: var(--space-2);
|
||||||
outline: var(--border-w) dashed var(--ink);
|
outline: var(--border-w) dashed var(--ink);
|
||||||
outline-offset: calc(var(--border-w) * -1);
|
outline-offset: calc(var(--border-w) * -1);
|
||||||
}
|
overflow: hidden;
|
||||||
|
|
||||||
&__attachment {
|
> * {
|
||||||
padding: var(--space-1) var(--space-2);
|
max-width: 300px;
|
||||||
background-color: var(--grey-1);
|
}
|
||||||
outline: 1px solid var(--ink);
|
|
||||||
outline-offset: -1px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chat-message-attachment" @click="download">
|
<div class="chat-message-attachment" :title="attachment.name" @click="download">
|
||||||
<div class="chat-message-attachment__extension">
|
<div class="chat-message-attachment__extension">
|
||||||
{{ extension }}
|
{{ extension }}
|
||||||
</div>
|
</div>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
{{ attachment.name }}
|
{{ attachment.name }}
|
||||||
</p>
|
</p>
|
||||||
<p class="chat-message-attachment__size">
|
<p class="chat-message-attachment__size">
|
||||||
{{ attachment.size }} KB
|
{{ size }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,18 +18,23 @@
|
|||||||
import type { Attachment } from '@shared/api/generated-chad-api.ts'
|
import type { Attachment } from '@shared/api/generated-chad-api.ts'
|
||||||
import api from '@shared/api/client.ts'
|
import api from '@shared/api/client.ts'
|
||||||
import { downloadFile } from '@zag-js/file-utils'
|
import { downloadFile } from '@zag-js/file-utils'
|
||||||
|
import { formatBytes } from '@zag-js/i18n-utils'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
attachment: Attachment
|
attachment: Attachment
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const extension = computed(() => props.attachment.name.split('.')[1])
|
const extension = computed(() => props.attachment.name.split('.').at(-1))
|
||||||
|
|
||||||
const url = computed(() => {
|
const url = computed(() => {
|
||||||
return `${__API_BASE_URL__}/attachment/${props.attachment.id}`
|
return `${__API_BASE_URL__}/attachment/${props.attachment.id}`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const size = computed(() => {
|
||||||
|
return formatBytes(props.attachment.size, 'en-US', { unitSystem: 'binary' })
|
||||||
|
})
|
||||||
|
|
||||||
async function download() {
|
async function download() {
|
||||||
const response = await api.chad.attachmentGet(props.attachment.id, { format: 'blob' })
|
const response = await api.chad.attachmentGet(props.attachment.id, { format: 'blob' })
|
||||||
|
|
||||||
@@ -46,7 +51,7 @@ async function download() {
|
|||||||
background-color: var(--grey-1);
|
background-color: var(--grey-1);
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
//overflow: hidden;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -68,6 +73,7 @@ async function download() {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
padding: var(--space-3);
|
padding: var(--space-3);
|
||||||
align-self: center;
|
align-self: center;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ const src = computed(() => {
|
|||||||
height: 160px;
|
height: 160px;
|
||||||
|
|
||||||
> img {
|
> img {
|
||||||
|
object-fit: contain;
|
||||||
|
object-position: center;
|
||||||
max-width: 260px;
|
max-width: 260px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const ChatMessageSchema = Type.Object({
|
|||||||
}, { $id: 'ChatMessage' })
|
}, { $id: 'ChatMessage' })
|
||||||
|
|
||||||
export const NewChatMessagePayloadSchema = Type.Object({
|
export const NewChatMessagePayloadSchema = Type.Object({
|
||||||
text: Type.String({ minLength: 1 }),
|
text: Type.String(),
|
||||||
attachments: Type.Optional(Type.Array(Type.String({ format: 'uuid' }))),
|
attachments: Type.Optional(Type.Array(Type.String({ format: 'uuid' }))),
|
||||||
// replyTo: Type.Object({
|
// replyTo: Type.Object({
|
||||||
// messageId: Type.String({ format: 'uuid' }),
|
// messageId: Type.String({ format: 'uuid' }),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -995,6 +995,7 @@ export type UserPreferencesScalarFieldEnum = (typeof UserPreferencesScalarFieldE
|
|||||||
|
|
||||||
export const AttachmentScalarFieldEnum = {
|
export const AttachmentScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
|
username: 'username',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
mimetype: 'mimetype',
|
mimetype: 'mimetype',
|
||||||
size: 'size',
|
size: 'size',
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ export type UserPreferencesScalarFieldEnum = (typeof UserPreferencesScalarFieldE
|
|||||||
|
|
||||||
export const AttachmentScalarFieldEnum = {
|
export const AttachmentScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
|
username: 'username',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
mimetype: 'mimetype',
|
mimetype: 'mimetype',
|
||||||
size: 'size',
|
size: 'size',
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export type AttachmentSumAggregateOutputType = {
|
|||||||
|
|
||||||
export type AttachmentMinAggregateOutputType = {
|
export type AttachmentMinAggregateOutputType = {
|
||||||
id: string | null
|
id: string | null
|
||||||
|
username: string | null
|
||||||
name: string | null
|
name: string | null
|
||||||
mimetype: string | null
|
mimetype: string | null
|
||||||
size: number | null
|
size: number | null
|
||||||
@@ -44,6 +45,7 @@ export type AttachmentMinAggregateOutputType = {
|
|||||||
|
|
||||||
export type AttachmentMaxAggregateOutputType = {
|
export type AttachmentMaxAggregateOutputType = {
|
||||||
id: string | null
|
id: string | null
|
||||||
|
username: string | null
|
||||||
name: string | null
|
name: string | null
|
||||||
mimetype: string | null
|
mimetype: string | null
|
||||||
size: number | null
|
size: number | null
|
||||||
@@ -52,6 +54,7 @@ export type AttachmentMaxAggregateOutputType = {
|
|||||||
|
|
||||||
export type AttachmentCountAggregateOutputType = {
|
export type AttachmentCountAggregateOutputType = {
|
||||||
id: number
|
id: number
|
||||||
|
username: number
|
||||||
name: number
|
name: number
|
||||||
mimetype: number
|
mimetype: number
|
||||||
size: number
|
size: number
|
||||||
@@ -70,6 +73,7 @@ export type AttachmentSumAggregateInputType = {
|
|||||||
|
|
||||||
export type AttachmentMinAggregateInputType = {
|
export type AttachmentMinAggregateInputType = {
|
||||||
id?: true
|
id?: true
|
||||||
|
username?: true
|
||||||
name?: true
|
name?: true
|
||||||
mimetype?: true
|
mimetype?: true
|
||||||
size?: true
|
size?: true
|
||||||
@@ -78,6 +82,7 @@ export type AttachmentMinAggregateInputType = {
|
|||||||
|
|
||||||
export type AttachmentMaxAggregateInputType = {
|
export type AttachmentMaxAggregateInputType = {
|
||||||
id?: true
|
id?: true
|
||||||
|
username?: true
|
||||||
name?: true
|
name?: true
|
||||||
mimetype?: true
|
mimetype?: true
|
||||||
size?: true
|
size?: true
|
||||||
@@ -86,6 +91,7 @@ export type AttachmentMaxAggregateInputType = {
|
|||||||
|
|
||||||
export type AttachmentCountAggregateInputType = {
|
export type AttachmentCountAggregateInputType = {
|
||||||
id?: true
|
id?: true
|
||||||
|
username?: true
|
||||||
name?: true
|
name?: true
|
||||||
mimetype?: true
|
mimetype?: true
|
||||||
size?: true
|
size?: true
|
||||||
@@ -181,6 +187,7 @@ export type AttachmentGroupByArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
|||||||
|
|
||||||
export type AttachmentGroupByOutputType = {
|
export type AttachmentGroupByOutputType = {
|
||||||
id: string
|
id: string
|
||||||
|
username: string | null
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
@@ -212,19 +219,23 @@ export type AttachmentWhereInput = {
|
|||||||
OR?: Prisma.AttachmentWhereInput[]
|
OR?: Prisma.AttachmentWhereInput[]
|
||||||
NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
||||||
id?: Prisma.StringFilter<"Attachment"> | string
|
id?: Prisma.StringFilter<"Attachment"> | string
|
||||||
|
username?: Prisma.StringNullableFilter<"Attachment"> | string | null
|
||||||
name?: Prisma.StringFilter<"Attachment"> | string
|
name?: Prisma.StringFilter<"Attachment"> | string
|
||||||
mimetype?: Prisma.StringFilter<"Attachment"> | string
|
mimetype?: Prisma.StringFilter<"Attachment"> | string
|
||||||
size?: Prisma.IntFilter<"Attachment"> | number
|
size?: Prisma.IntFilter<"Attachment"> | number
|
||||||
createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string
|
||||||
|
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||||
message?: Prisma.MessageAttachmentListRelationFilter
|
message?: Prisma.MessageAttachmentListRelationFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentOrderByWithRelationInput = {
|
export type AttachmentOrderByWithRelationInput = {
|
||||||
id?: Prisma.SortOrder
|
id?: Prisma.SortOrder
|
||||||
|
username?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
mimetype?: Prisma.SortOrder
|
mimetype?: Prisma.SortOrder
|
||||||
size?: Prisma.SortOrder
|
size?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
|
user?: Prisma.UserOrderByWithRelationInput
|
||||||
message?: Prisma.MessageAttachmentOrderByRelationAggregateInput
|
message?: Prisma.MessageAttachmentOrderByRelationAggregateInput
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,15 +244,18 @@ export type AttachmentWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
AND?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
AND?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
||||||
OR?: Prisma.AttachmentWhereInput[]
|
OR?: Prisma.AttachmentWhereInput[]
|
||||||
NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
NOT?: Prisma.AttachmentWhereInput | Prisma.AttachmentWhereInput[]
|
||||||
|
username?: Prisma.StringNullableFilter<"Attachment"> | string | null
|
||||||
name?: Prisma.StringFilter<"Attachment"> | string
|
name?: Prisma.StringFilter<"Attachment"> | string
|
||||||
mimetype?: Prisma.StringFilter<"Attachment"> | string
|
mimetype?: Prisma.StringFilter<"Attachment"> | string
|
||||||
size?: Prisma.IntFilter<"Attachment"> | number
|
size?: Prisma.IntFilter<"Attachment"> | number
|
||||||
createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string
|
||||||
|
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||||
message?: Prisma.MessageAttachmentListRelationFilter
|
message?: Prisma.MessageAttachmentListRelationFilter
|
||||||
}, "id">
|
}, "id">
|
||||||
|
|
||||||
export type AttachmentOrderByWithAggregationInput = {
|
export type AttachmentOrderByWithAggregationInput = {
|
||||||
id?: Prisma.SortOrder
|
id?: Prisma.SortOrder
|
||||||
|
username?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
mimetype?: Prisma.SortOrder
|
mimetype?: Prisma.SortOrder
|
||||||
size?: Prisma.SortOrder
|
size?: Prisma.SortOrder
|
||||||
@@ -258,6 +272,7 @@ export type AttachmentScalarWhereWithAggregatesInput = {
|
|||||||
OR?: Prisma.AttachmentScalarWhereWithAggregatesInput[]
|
OR?: Prisma.AttachmentScalarWhereWithAggregatesInput[]
|
||||||
NOT?: Prisma.AttachmentScalarWhereWithAggregatesInput | Prisma.AttachmentScalarWhereWithAggregatesInput[]
|
NOT?: Prisma.AttachmentScalarWhereWithAggregatesInput | Prisma.AttachmentScalarWhereWithAggregatesInput[]
|
||||||
id?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
id?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
||||||
|
username?: Prisma.StringNullableWithAggregatesFilter<"Attachment"> | string | null
|
||||||
name?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
name?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
||||||
mimetype?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
mimetype?: Prisma.StringWithAggregatesFilter<"Attachment"> | string
|
||||||
size?: Prisma.IntWithAggregatesFilter<"Attachment"> | number
|
size?: Prisma.IntWithAggregatesFilter<"Attachment"> | number
|
||||||
@@ -270,11 +285,13 @@ export type AttachmentCreateInput = {
|
|||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
|
user?: Prisma.UserCreateNestedOneWithoutAttachmentsInput
|
||||||
message?: Prisma.MessageAttachmentCreateNestedManyWithoutAttachmentInput
|
message?: Prisma.MessageAttachmentCreateNestedManyWithoutAttachmentInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentUncheckedCreateInput = {
|
export type AttachmentUncheckedCreateInput = {
|
||||||
id?: string
|
id?: string
|
||||||
|
username?: string | null
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
@@ -288,11 +305,13 @@ export type AttachmentUpdateInput = {
|
|||||||
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
size?: Prisma.IntFieldUpdateOperationsInput | number
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
user?: Prisma.UserUpdateOneWithoutAttachmentsNestedInput
|
||||||
message?: Prisma.MessageAttachmentUpdateManyWithoutAttachmentNestedInput
|
message?: Prisma.MessageAttachmentUpdateManyWithoutAttachmentNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentUncheckedUpdateInput = {
|
export type AttachmentUncheckedUpdateInput = {
|
||||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
username?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
size?: Prisma.IntFieldUpdateOperationsInput | number
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
@@ -302,6 +321,7 @@ export type AttachmentUncheckedUpdateInput = {
|
|||||||
|
|
||||||
export type AttachmentCreateManyInput = {
|
export type AttachmentCreateManyInput = {
|
||||||
id?: string
|
id?: string
|
||||||
|
username?: string | null
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
@@ -318,14 +338,26 @@ export type AttachmentUpdateManyMutationInput = {
|
|||||||
|
|
||||||
export type AttachmentUncheckedUpdateManyInput = {
|
export type AttachmentUncheckedUpdateManyInput = {
|
||||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
username?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
size?: Prisma.IntFieldUpdateOperationsInput | number
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AttachmentListRelationFilter = {
|
||||||
|
every?: Prisma.AttachmentWhereInput
|
||||||
|
some?: Prisma.AttachmentWhereInput
|
||||||
|
none?: Prisma.AttachmentWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentOrderByRelationAggregateInput = {
|
||||||
|
_count?: Prisma.SortOrder
|
||||||
|
}
|
||||||
|
|
||||||
export type AttachmentCountOrderByAggregateInput = {
|
export type AttachmentCountOrderByAggregateInput = {
|
||||||
id?: Prisma.SortOrder
|
id?: Prisma.SortOrder
|
||||||
|
username?: Prisma.SortOrder
|
||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
mimetype?: Prisma.SortOrder
|
mimetype?: Prisma.SortOrder
|
||||||
size?: Prisma.SortOrder
|
size?: Prisma.SortOrder
|
||||||
@@ -338,6 +370,7 @@ export type AttachmentAvgOrderByAggregateInput = {
|
|||||||
|
|
||||||
export type AttachmentMaxOrderByAggregateInput = {
|
export type AttachmentMaxOrderByAggregateInput = {
|
||||||
id?: Prisma.SortOrder
|
id?: Prisma.SortOrder
|
||||||
|
username?: Prisma.SortOrder
|
||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
mimetype?: Prisma.SortOrder
|
mimetype?: Prisma.SortOrder
|
||||||
size?: Prisma.SortOrder
|
size?: Prisma.SortOrder
|
||||||
@@ -346,6 +379,7 @@ export type AttachmentMaxOrderByAggregateInput = {
|
|||||||
|
|
||||||
export type AttachmentMinOrderByAggregateInput = {
|
export type AttachmentMinOrderByAggregateInput = {
|
||||||
id?: Prisma.SortOrder
|
id?: Prisma.SortOrder
|
||||||
|
username?: Prisma.SortOrder
|
||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
mimetype?: Prisma.SortOrder
|
mimetype?: Prisma.SortOrder
|
||||||
size?: Prisma.SortOrder
|
size?: Prisma.SortOrder
|
||||||
@@ -361,6 +395,48 @@ export type AttachmentScalarRelationFilter = {
|
|||||||
isNot?: Prisma.AttachmentWhereInput
|
isNot?: Prisma.AttachmentWhereInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AttachmentCreateNestedManyWithoutUserInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput> | Prisma.AttachmentCreateWithoutUserInput[] | Prisma.AttachmentUncheckedCreateWithoutUserInput[]
|
||||||
|
connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutUserInput | Prisma.AttachmentCreateOrConnectWithoutUserInput[]
|
||||||
|
createMany?: Prisma.AttachmentCreateManyUserInputEnvelope
|
||||||
|
connect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUncheckedCreateNestedManyWithoutUserInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput> | Prisma.AttachmentCreateWithoutUserInput[] | Prisma.AttachmentUncheckedCreateWithoutUserInput[]
|
||||||
|
connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutUserInput | Prisma.AttachmentCreateOrConnectWithoutUserInput[]
|
||||||
|
createMany?: Prisma.AttachmentCreateManyUserInputEnvelope
|
||||||
|
connect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUpdateManyWithoutUserNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput> | Prisma.AttachmentCreateWithoutUserInput[] | Prisma.AttachmentUncheckedCreateWithoutUserInput[]
|
||||||
|
connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutUserInput | Prisma.AttachmentCreateOrConnectWithoutUserInput[]
|
||||||
|
upsert?: Prisma.AttachmentUpsertWithWhereUniqueWithoutUserInput | Prisma.AttachmentUpsertWithWhereUniqueWithoutUserInput[]
|
||||||
|
createMany?: Prisma.AttachmentCreateManyUserInputEnvelope
|
||||||
|
set?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
delete?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
connect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
update?: Prisma.AttachmentUpdateWithWhereUniqueWithoutUserInput | Prisma.AttachmentUpdateWithWhereUniqueWithoutUserInput[]
|
||||||
|
updateMany?: Prisma.AttachmentUpdateManyWithWhereWithoutUserInput | Prisma.AttachmentUpdateManyWithWhereWithoutUserInput[]
|
||||||
|
deleteMany?: Prisma.AttachmentScalarWhereInput | Prisma.AttachmentScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUncheckedUpdateManyWithoutUserNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput> | Prisma.AttachmentCreateWithoutUserInput[] | Prisma.AttachmentUncheckedCreateWithoutUserInput[]
|
||||||
|
connectOrCreate?: Prisma.AttachmentCreateOrConnectWithoutUserInput | Prisma.AttachmentCreateOrConnectWithoutUserInput[]
|
||||||
|
upsert?: Prisma.AttachmentUpsertWithWhereUniqueWithoutUserInput | Prisma.AttachmentUpsertWithWhereUniqueWithoutUserInput[]
|
||||||
|
createMany?: Prisma.AttachmentCreateManyUserInputEnvelope
|
||||||
|
set?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
delete?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
connect?: Prisma.AttachmentWhereUniqueInput | Prisma.AttachmentWhereUniqueInput[]
|
||||||
|
update?: Prisma.AttachmentUpdateWithWhereUniqueWithoutUserInput | Prisma.AttachmentUpdateWithWhereUniqueWithoutUserInput[]
|
||||||
|
updateMany?: Prisma.AttachmentUpdateManyWithWhereWithoutUserInput | Prisma.AttachmentUpdateManyWithWhereWithoutUserInput[]
|
||||||
|
deleteMany?: Prisma.AttachmentScalarWhereInput | Prisma.AttachmentScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
export type IntFieldUpdateOperationsInput = {
|
export type IntFieldUpdateOperationsInput = {
|
||||||
set?: number
|
set?: number
|
||||||
increment?: number
|
increment?: number
|
||||||
@@ -383,16 +459,73 @@ export type AttachmentUpdateOneRequiredWithoutMessageNestedInput = {
|
|||||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AttachmentUpdateToOneWithWhereWithoutMessageInput, Prisma.AttachmentUpdateWithoutMessageInput>, Prisma.AttachmentUncheckedUpdateWithoutMessageInput>
|
update?: Prisma.XOR<Prisma.XOR<Prisma.AttachmentUpdateToOneWithWhereWithoutMessageInput, Prisma.AttachmentUpdateWithoutMessageInput>, Prisma.AttachmentUncheckedUpdateWithoutMessageInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AttachmentCreateWithoutUserInput = {
|
||||||
|
id?: string
|
||||||
|
name: string
|
||||||
|
mimetype: string
|
||||||
|
size: number
|
||||||
|
createdAt?: Date | string
|
||||||
|
message?: Prisma.MessageAttachmentCreateNestedManyWithoutAttachmentInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUncheckedCreateWithoutUserInput = {
|
||||||
|
id?: string
|
||||||
|
name: string
|
||||||
|
mimetype: string
|
||||||
|
size: number
|
||||||
|
createdAt?: Date | string
|
||||||
|
message?: Prisma.MessageAttachmentUncheckedCreateNestedManyWithoutAttachmentInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentCreateOrConnectWithoutUserInput = {
|
||||||
|
where: Prisma.AttachmentWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentCreateManyUserInputEnvelope = {
|
||||||
|
data: Prisma.AttachmentCreateManyUserInput | Prisma.AttachmentCreateManyUserInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUpsertWithWhereUniqueWithoutUserInput = {
|
||||||
|
where: Prisma.AttachmentWhereUniqueInput
|
||||||
|
update: Prisma.XOR<Prisma.AttachmentUpdateWithoutUserInput, Prisma.AttachmentUncheckedUpdateWithoutUserInput>
|
||||||
|
create: Prisma.XOR<Prisma.AttachmentCreateWithoutUserInput, Prisma.AttachmentUncheckedCreateWithoutUserInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUpdateWithWhereUniqueWithoutUserInput = {
|
||||||
|
where: Prisma.AttachmentWhereUniqueInput
|
||||||
|
data: Prisma.XOR<Prisma.AttachmentUpdateWithoutUserInput, Prisma.AttachmentUncheckedUpdateWithoutUserInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUpdateManyWithWhereWithoutUserInput = {
|
||||||
|
where: Prisma.AttachmentScalarWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.AttachmentUpdateManyMutationInput, Prisma.AttachmentUncheckedUpdateManyWithoutUserInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentScalarWhereInput = {
|
||||||
|
AND?: Prisma.AttachmentScalarWhereInput | Prisma.AttachmentScalarWhereInput[]
|
||||||
|
OR?: Prisma.AttachmentScalarWhereInput[]
|
||||||
|
NOT?: Prisma.AttachmentScalarWhereInput | Prisma.AttachmentScalarWhereInput[]
|
||||||
|
id?: Prisma.StringFilter<"Attachment"> | string
|
||||||
|
username?: Prisma.StringNullableFilter<"Attachment"> | string | null
|
||||||
|
name?: Prisma.StringFilter<"Attachment"> | string
|
||||||
|
mimetype?: Prisma.StringFilter<"Attachment"> | string
|
||||||
|
size?: Prisma.IntFilter<"Attachment"> | number
|
||||||
|
createdAt?: Prisma.DateTimeFilter<"Attachment"> | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
export type AttachmentCreateWithoutMessageInput = {
|
export type AttachmentCreateWithoutMessageInput = {
|
||||||
id?: string
|
id?: string
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
|
user?: Prisma.UserCreateNestedOneWithoutAttachmentsInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentUncheckedCreateWithoutMessageInput = {
|
export type AttachmentUncheckedCreateWithoutMessageInput = {
|
||||||
id?: string
|
id?: string
|
||||||
|
username?: string | null
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
@@ -421,9 +554,45 @@ export type AttachmentUpdateWithoutMessageInput = {
|
|||||||
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
size?: Prisma.IntFieldUpdateOperationsInput | number
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
user?: Prisma.UserUpdateOneWithoutAttachmentsNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentUncheckedUpdateWithoutMessageInput = {
|
export type AttachmentUncheckedUpdateWithoutMessageInput = {
|
||||||
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
username?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentCreateManyUserInput = {
|
||||||
|
id?: string
|
||||||
|
name: string
|
||||||
|
mimetype: string
|
||||||
|
size: number
|
||||||
|
createdAt?: Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUpdateWithoutUserInput = {
|
||||||
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
message?: Prisma.MessageAttachmentUpdateManyWithoutAttachmentNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUncheckedUpdateWithoutUserInput = {
|
||||||
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
size?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
message?: Prisma.MessageAttachmentUncheckedUpdateManyWithoutAttachmentNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AttachmentUncheckedUpdateManyWithoutUserInput = {
|
||||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
mimetype?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
@@ -464,53 +633,67 @@ export type AttachmentCountOutputTypeCountMessageArgs<ExtArgs extends runtime.Ty
|
|||||||
|
|
||||||
export type AttachmentSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type AttachmentSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
|
username?: boolean
|
||||||
name?: boolean
|
name?: boolean
|
||||||
mimetype?: boolean
|
mimetype?: boolean
|
||||||
size?: boolean
|
size?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
message?: boolean | Prisma.Attachment$messageArgs<ExtArgs>
|
message?: boolean | Prisma.Attachment$messageArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["attachment"]>
|
}, ExtArgs["result"]["attachment"]>
|
||||||
|
|
||||||
export type AttachmentSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type AttachmentSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
|
username?: boolean
|
||||||
name?: boolean
|
name?: boolean
|
||||||
mimetype?: boolean
|
mimetype?: boolean
|
||||||
size?: boolean
|
size?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["attachment"]>
|
}, ExtArgs["result"]["attachment"]>
|
||||||
|
|
||||||
export type AttachmentSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type AttachmentSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
|
username?: boolean
|
||||||
name?: boolean
|
name?: boolean
|
||||||
mimetype?: boolean
|
mimetype?: boolean
|
||||||
size?: boolean
|
size?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["attachment"]>
|
}, ExtArgs["result"]["attachment"]>
|
||||||
|
|
||||||
export type AttachmentSelectScalar = {
|
export type AttachmentSelectScalar = {
|
||||||
id?: boolean
|
id?: boolean
|
||||||
|
username?: boolean
|
||||||
name?: boolean
|
name?: boolean
|
||||||
mimetype?: boolean
|
mimetype?: boolean
|
||||||
size?: boolean
|
size?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AttachmentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "mimetype" | "size" | "createdAt", ExtArgs["result"]["attachment"]>
|
export type AttachmentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "username" | "name" | "mimetype" | "size" | "createdAt", ExtArgs["result"]["attachment"]>
|
||||||
export type AttachmentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type AttachmentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
message?: boolean | Prisma.Attachment$messageArgs<ExtArgs>
|
message?: boolean | Prisma.Attachment$messageArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.AttachmentCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}
|
}
|
||||||
export type AttachmentIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {}
|
export type AttachmentIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
export type AttachmentIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {}
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
|
}
|
||||||
|
export type AttachmentIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
user?: boolean | Prisma.Attachment$userArgs<ExtArgs>
|
||||||
|
}
|
||||||
|
|
||||||
export type $AttachmentPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type $AttachmentPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
name: "Attachment"
|
name: "Attachment"
|
||||||
objects: {
|
objects: {
|
||||||
|
user: Prisma.$UserPayload<ExtArgs> | null
|
||||||
message: Prisma.$MessageAttachmentPayload<ExtArgs>[]
|
message: Prisma.$MessageAttachmentPayload<ExtArgs>[]
|
||||||
}
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
id: string
|
id: string
|
||||||
|
username: string | null
|
||||||
name: string
|
name: string
|
||||||
mimetype: string
|
mimetype: string
|
||||||
size: number
|
size: number
|
||||||
@@ -909,6 +1092,7 @@ readonly fields: AttachmentFieldRefs;
|
|||||||
*/
|
*/
|
||||||
export interface Prisma__AttachmentClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
export interface Prisma__AttachmentClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||||
|
user<T extends Prisma.Attachment$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Attachment$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||||
message<T extends Prisma.Attachment$messageArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Attachment$messageArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$MessageAttachmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
message<T extends Prisma.Attachment$messageArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Attachment$messageArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$MessageAttachmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
/**
|
/**
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||||
@@ -940,6 +1124,7 @@ export interface Prisma__AttachmentClient<T, Null = never, ExtArgs extends runti
|
|||||||
*/
|
*/
|
||||||
export interface AttachmentFieldRefs {
|
export interface AttachmentFieldRefs {
|
||||||
readonly id: Prisma.FieldRef<"Attachment", 'String'>
|
readonly id: Prisma.FieldRef<"Attachment", 'String'>
|
||||||
|
readonly username: Prisma.FieldRef<"Attachment", 'String'>
|
||||||
readonly name: Prisma.FieldRef<"Attachment", 'String'>
|
readonly name: Prisma.FieldRef<"Attachment", 'String'>
|
||||||
readonly mimetype: Prisma.FieldRef<"Attachment", 'String'>
|
readonly mimetype: Prisma.FieldRef<"Attachment", 'String'>
|
||||||
readonly size: Prisma.FieldRef<"Attachment", 'Int'>
|
readonly size: Prisma.FieldRef<"Attachment", 'Int'>
|
||||||
@@ -1196,6 +1381,10 @@ export type AttachmentCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Exte
|
|||||||
* The data used to create many Attachments.
|
* The data used to create many Attachments.
|
||||||
*/
|
*/
|
||||||
data: Prisma.AttachmentCreateManyInput | Prisma.AttachmentCreateManyInput[]
|
data: Prisma.AttachmentCreateManyInput | Prisma.AttachmentCreateManyInput[]
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.AttachmentIncludeCreateManyAndReturn<ExtArgs> | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1266,6 +1455,10 @@ export type AttachmentUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Exte
|
|||||||
* Limit how many Attachments to update.
|
* Limit how many Attachments to update.
|
||||||
*/
|
*/
|
||||||
limit?: number
|
limit?: number
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.AttachmentIncludeUpdateManyAndReturn<ExtArgs> | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1334,6 +1527,25 @@ export type AttachmentDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.In
|
|||||||
limit?: number
|
limit?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attachment.user
|
||||||
|
*/
|
||||||
|
export type Attachment$userArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
/**
|
||||||
|
* Select specific fields to fetch from the User
|
||||||
|
*/
|
||||||
|
select?: Prisma.UserSelect<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Omit specific fields from the User
|
||||||
|
*/
|
||||||
|
omit?: Prisma.UserOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.UserInclude<ExtArgs> | null
|
||||||
|
where?: Prisma.UserWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attachment.message
|
* Attachment.message
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ export type UserWhereInput = {
|
|||||||
displayName?: Prisma.StringFilter<"User"> | string
|
displayName?: Prisma.StringFilter<"User"> | string
|
||||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentListRelationFilter
|
||||||
Session?: Prisma.SessionListRelationFilter
|
Session?: Prisma.SessionListRelationFilter
|
||||||
UserPreferences?: Prisma.XOR<Prisma.UserPreferencesNullableScalarRelationFilter, Prisma.UserPreferencesWhereInput> | null
|
UserPreferences?: Prisma.XOR<Prisma.UserPreferencesNullableScalarRelationFilter, Prisma.UserPreferencesWhereInput> | null
|
||||||
Messages?: Prisma.MessageListRelationFilter
|
Messages?: Prisma.MessageListRelationFilter
|
||||||
@@ -194,6 +195,7 @@ export type UserOrderByWithRelationInput = {
|
|||||||
displayName?: Prisma.SortOrder
|
displayName?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
|
Attachments?: Prisma.AttachmentOrderByRelationAggregateInput
|
||||||
Session?: Prisma.SessionOrderByRelationAggregateInput
|
Session?: Prisma.SessionOrderByRelationAggregateInput
|
||||||
UserPreferences?: Prisma.UserPreferencesOrderByWithRelationInput
|
UserPreferences?: Prisma.UserPreferencesOrderByWithRelationInput
|
||||||
Messages?: Prisma.MessageOrderByRelationAggregateInput
|
Messages?: Prisma.MessageOrderByRelationAggregateInput
|
||||||
@@ -209,6 +211,7 @@ export type UserWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
displayName?: Prisma.StringFilter<"User"> | string
|
displayName?: Prisma.StringFilter<"User"> | string
|
||||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentListRelationFilter
|
||||||
Session?: Prisma.SessionListRelationFilter
|
Session?: Prisma.SessionListRelationFilter
|
||||||
UserPreferences?: Prisma.XOR<Prisma.UserPreferencesNullableScalarRelationFilter, Prisma.UserPreferencesWhereInput> | null
|
UserPreferences?: Prisma.XOR<Prisma.UserPreferencesNullableScalarRelationFilter, Prisma.UserPreferencesWhereInput> | null
|
||||||
Messages?: Prisma.MessageListRelationFilter
|
Messages?: Prisma.MessageListRelationFilter
|
||||||
@@ -243,6 +246,7 @@ export type UserCreateInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||||
@@ -255,6 +259,7 @@ export type UserUncheckedCreateInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||||
@@ -267,6 +272,7 @@ export type UserUpdateInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||||
@@ -279,6 +285,7 @@ export type UserUncheckedUpdateInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||||
@@ -379,6 +386,22 @@ export type UserUpdateOneRequiredWithoutUserPreferencesNestedInput = {
|
|||||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutUserPreferencesInput, Prisma.UserUpdateWithoutUserPreferencesInput>, Prisma.UserUncheckedUpdateWithoutUserPreferencesInput>
|
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutUserPreferencesInput, Prisma.UserUpdateWithoutUserPreferencesInput>, Prisma.UserUncheckedUpdateWithoutUserPreferencesInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type UserCreateNestedOneWithoutAttachmentsInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.UserCreateWithoutAttachmentsInput, Prisma.UserUncheckedCreateWithoutAttachmentsInput>
|
||||||
|
connectOrCreate?: Prisma.UserCreateOrConnectWithoutAttachmentsInput
|
||||||
|
connect?: Prisma.UserWhereUniqueInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpdateOneWithoutAttachmentsNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.UserCreateWithoutAttachmentsInput, Prisma.UserUncheckedCreateWithoutAttachmentsInput>
|
||||||
|
connectOrCreate?: Prisma.UserCreateOrConnectWithoutAttachmentsInput
|
||||||
|
upsert?: Prisma.UserUpsertWithoutAttachmentsInput
|
||||||
|
disconnect?: Prisma.UserWhereInput | boolean
|
||||||
|
delete?: Prisma.UserWhereInput | boolean
|
||||||
|
connect?: Prisma.UserWhereUniqueInput
|
||||||
|
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutAttachmentsInput, Prisma.UserUpdateWithoutAttachmentsInput>, Prisma.UserUncheckedUpdateWithoutAttachmentsInput>
|
||||||
|
}
|
||||||
|
|
||||||
export type UserCreateNestedOneWithoutMessagesInput = {
|
export type UserCreateNestedOneWithoutMessagesInput = {
|
||||||
create?: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
create?: Prisma.XOR<Prisma.UserCreateWithoutMessagesInput, Prisma.UserUncheckedCreateWithoutMessagesInput>
|
||||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput
|
connectOrCreate?: Prisma.UserCreateOrConnectWithoutMessagesInput
|
||||||
@@ -417,6 +440,7 @@ export type UserCreateWithoutSessionInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||||
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
||||||
@@ -428,6 +452,7 @@ export type UserUncheckedCreateWithoutSessionInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||||
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
||||||
@@ -455,6 +480,7 @@ export type UserUpdateWithoutSessionInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||||
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
||||||
@@ -466,6 +492,7 @@ export type UserUncheckedUpdateWithoutSessionInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||||
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
||||||
@@ -477,6 +504,7 @@ export type UserCreateWithoutUserPreferencesInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||||
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||||
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
||||||
@@ -488,6 +516,7 @@ export type UserUncheckedCreateWithoutUserPreferencesInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||||
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||||
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
||||||
@@ -515,6 +544,7 @@ export type UserUpdateWithoutUserPreferencesInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||||
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
||||||
@@ -526,17 +556,83 @@ export type UserUncheckedUpdateWithoutUserPreferencesInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||||
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type UserCreateWithoutAttachmentsInput = {
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
displayName: string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||||
|
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
||||||
|
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||||
|
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUncheckedCreateWithoutAttachmentsInput = {
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
displayName: string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||||
|
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
||||||
|
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||||
|
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserCreateOrConnectWithoutAttachmentsInput = {
|
||||||
|
where: Prisma.UserWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.UserCreateWithoutAttachmentsInput, Prisma.UserUncheckedCreateWithoutAttachmentsInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpsertWithoutAttachmentsInput = {
|
||||||
|
update: Prisma.XOR<Prisma.UserUpdateWithoutAttachmentsInput, Prisma.UserUncheckedUpdateWithoutAttachmentsInput>
|
||||||
|
create: Prisma.XOR<Prisma.UserCreateWithoutAttachmentsInput, Prisma.UserUncheckedCreateWithoutAttachmentsInput>
|
||||||
|
where?: Prisma.UserWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpdateToOneWithWhereWithoutAttachmentsInput = {
|
||||||
|
where?: Prisma.UserWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.UserUpdateWithoutAttachmentsInput, Prisma.UserUncheckedUpdateWithoutAttachmentsInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpdateWithoutAttachmentsInput = {
|
||||||
|
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||||
|
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
||||||
|
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||||
|
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUncheckedUpdateWithoutAttachmentsInput = {
|
||||||
|
username?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
password?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||||
|
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
||||||
|
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||||
|
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
export type UserCreateWithoutMessagesInput = {
|
export type UserCreateWithoutMessagesInput = {
|
||||||
username: string
|
username: string
|
||||||
password: string
|
password: string
|
||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
||||||
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelCreateNestedManyWithoutOwnerInput
|
||||||
@@ -548,6 +644,7 @@ export type UserUncheckedCreateWithoutMessagesInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
||||||
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
Channels?: Prisma.ChannelUncheckedCreateNestedManyWithoutOwnerInput
|
||||||
@@ -575,6 +672,7 @@ export type UserUpdateWithoutMessagesInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
||||||
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUpdateManyWithoutOwnerNestedInput
|
||||||
@@ -586,6 +684,7 @@ export type UserUncheckedUpdateWithoutMessagesInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
||||||
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
Channels?: Prisma.ChannelUncheckedUpdateManyWithoutOwnerNestedInput
|
||||||
@@ -597,6 +696,7 @@ export type UserCreateWithoutChannelsInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageCreateNestedManyWithoutSenderInput
|
||||||
@@ -608,6 +708,7 @@ export type UserUncheckedCreateWithoutChannelsInput = {
|
|||||||
displayName: string
|
displayName: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedCreateNestedManyWithoutUserInput
|
||||||
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
Session?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedCreateNestedOneWithoutUserInput
|
||||||
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
Messages?: Prisma.MessageUncheckedCreateNestedManyWithoutSenderInput
|
||||||
@@ -635,6 +736,7 @@ export type UserUpdateWithoutChannelsInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUpdateManyWithoutSenderNestedInput
|
||||||
@@ -646,6 +748,7 @@ export type UserUncheckedUpdateWithoutChannelsInput = {
|
|||||||
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
displayName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
Attachments?: Prisma.AttachmentUncheckedUpdateManyWithoutUserNestedInput
|
||||||
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
Session?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||||
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
UserPreferences?: Prisma.UserPreferencesUncheckedUpdateOneWithoutUserNestedInput
|
||||||
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
Messages?: Prisma.MessageUncheckedUpdateManyWithoutSenderNestedInput
|
||||||
@@ -657,12 +760,14 @@ export type UserUncheckedUpdateWithoutChannelsInput = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export type UserCountOutputType = {
|
export type UserCountOutputType = {
|
||||||
|
Attachments: number
|
||||||
Session: number
|
Session: number
|
||||||
Messages: number
|
Messages: number
|
||||||
Channels: number
|
Channels: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UserCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type UserCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
Attachments?: boolean | UserCountOutputTypeCountAttachmentsArgs
|
||||||
Session?: boolean | UserCountOutputTypeCountSessionArgs
|
Session?: boolean | UserCountOutputTypeCountSessionArgs
|
||||||
Messages?: boolean | UserCountOutputTypeCountMessagesArgs
|
Messages?: boolean | UserCountOutputTypeCountMessagesArgs
|
||||||
Channels?: boolean | UserCountOutputTypeCountChannelsArgs
|
Channels?: boolean | UserCountOutputTypeCountChannelsArgs
|
||||||
@@ -678,6 +783,13 @@ export type UserCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensi
|
|||||||
select?: Prisma.UserCountOutputTypeSelect<ExtArgs> | null
|
select?: Prisma.UserCountOutputTypeSelect<ExtArgs> | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UserCountOutputType without action
|
||||||
|
*/
|
||||||
|
export type UserCountOutputTypeCountAttachmentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
where?: Prisma.AttachmentWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UserCountOutputType without action
|
* UserCountOutputType without action
|
||||||
*/
|
*/
|
||||||
@@ -706,6 +818,7 @@ export type UserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
|
|||||||
displayName?: boolean
|
displayName?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
updatedAt?: boolean
|
updatedAt?: boolean
|
||||||
|
Attachments?: boolean | Prisma.User$AttachmentsArgs<ExtArgs>
|
||||||
Session?: boolean | Prisma.User$SessionArgs<ExtArgs>
|
Session?: boolean | Prisma.User$SessionArgs<ExtArgs>
|
||||||
UserPreferences?: boolean | Prisma.User$UserPreferencesArgs<ExtArgs>
|
UserPreferences?: boolean | Prisma.User$UserPreferencesArgs<ExtArgs>
|
||||||
Messages?: boolean | Prisma.User$MessagesArgs<ExtArgs>
|
Messages?: boolean | Prisma.User$MessagesArgs<ExtArgs>
|
||||||
@@ -739,6 +852,7 @@ export type UserSelectScalar = {
|
|||||||
|
|
||||||
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"username" | "password" | "displayName" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]>
|
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"username" | "password" | "displayName" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]>
|
||||||
export type UserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type UserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
Attachments?: boolean | Prisma.User$AttachmentsArgs<ExtArgs>
|
||||||
Session?: boolean | Prisma.User$SessionArgs<ExtArgs>
|
Session?: boolean | Prisma.User$SessionArgs<ExtArgs>
|
||||||
UserPreferences?: boolean | Prisma.User$UserPreferencesArgs<ExtArgs>
|
UserPreferences?: boolean | Prisma.User$UserPreferencesArgs<ExtArgs>
|
||||||
Messages?: boolean | Prisma.User$MessagesArgs<ExtArgs>
|
Messages?: boolean | Prisma.User$MessagesArgs<ExtArgs>
|
||||||
@@ -751,6 +865,7 @@ export type UserIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
|||||||
export type $UserPayload<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"
|
name: "User"
|
||||||
objects: {
|
objects: {
|
||||||
|
Attachments: Prisma.$AttachmentPayload<ExtArgs>[]
|
||||||
Session: Prisma.$SessionPayload<ExtArgs>[]
|
Session: Prisma.$SessionPayload<ExtArgs>[]
|
||||||
UserPreferences: Prisma.$UserPreferencesPayload<ExtArgs> | null
|
UserPreferences: Prisma.$UserPreferencesPayload<ExtArgs> | null
|
||||||
Messages: Prisma.$MessagePayload<ExtArgs>[]
|
Messages: Prisma.$MessagePayload<ExtArgs>[]
|
||||||
@@ -1156,6 +1271,7 @@ 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> {
|
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"
|
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||||
|
Attachments<T extends Prisma.User$AttachmentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$AttachmentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AttachmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
Session<T extends Prisma.User$SessionArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$SessionArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SessionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
Session<T extends Prisma.User$SessionArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$SessionArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SessionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
UserPreferences<T extends Prisma.User$UserPreferencesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$UserPreferencesArgs<ExtArgs>>): Prisma.Prisma__UserPreferencesClient<runtime.Types.Result.GetResult<Prisma.$UserPreferencesPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
UserPreferences<T extends Prisma.User$UserPreferencesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$UserPreferencesArgs<ExtArgs>>): Prisma.Prisma__UserPreferencesClient<runtime.Types.Result.GetResult<Prisma.$UserPreferencesPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||||
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>
|
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>
|
||||||
@@ -1584,6 +1700,30 @@ export type UserDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
|||||||
limit?: number
|
limit?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User.Attachments
|
||||||
|
*/
|
||||||
|
export type User$AttachmentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
/**
|
||||||
|
* Select specific fields to fetch from the Attachment
|
||||||
|
*/
|
||||||
|
select?: Prisma.AttachmentSelect<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Omit specific fields from the Attachment
|
||||||
|
*/
|
||||||
|
omit?: Prisma.AttachmentOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.AttachmentInclude<ExtArgs> | null
|
||||||
|
where?: Prisma.AttachmentWhereInput
|
||||||
|
orderBy?: Prisma.AttachmentOrderByWithRelationInput | Prisma.AttachmentOrderByWithRelationInput[]
|
||||||
|
cursor?: Prisma.AttachmentWhereUniqueInput
|
||||||
|
take?: number
|
||||||
|
skip?: number
|
||||||
|
distinct?: Prisma.AttachmentScalarFieldEnum | Prisma.AttachmentScalarFieldEnum[]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User.Session
|
* User.Session
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- RedefineTables
|
||||||
|
PRAGMA defer_foreign_keys=ON;
|
||||||
|
PRAGMA foreign_keys=OFF;
|
||||||
|
CREATE TABLE "new_Attachment" (
|
||||||
|
"id" TEXT NOT NULL PRIMARY KEY,
|
||||||
|
"username" TEXT,
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
"mimetype" TEXT NOT NULL,
|
||||||
|
"size" INTEGER NOT NULL,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
CONSTRAINT "Attachment_username_fkey" FOREIGN KEY ("username") REFERENCES "User" ("username") ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
INSERT INTO "new_Attachment" ("createdAt", "id", "mimetype", "name", "size") SELECT "createdAt", "id", "mimetype", "name", "size" FROM "Attachment";
|
||||||
|
DROP TABLE "Attachment";
|
||||||
|
ALTER TABLE "new_Attachment" RENAME TO "Attachment";
|
||||||
|
PRAGMA foreign_keys=ON;
|
||||||
|
PRAGMA defer_foreign_keys=OFF;
|
||||||
@@ -14,6 +14,7 @@ model User {
|
|||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
Attachments Attachment[]
|
||||||
Session Session[]
|
Session Session[]
|
||||||
UserPreferences UserPreferences?
|
UserPreferences UserPreferences?
|
||||||
Messages Message[]
|
Messages Message[]
|
||||||
@@ -38,11 +39,13 @@ model UserPreferences {
|
|||||||
|
|
||||||
model Attachment {
|
model Attachment {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
|
username String?
|
||||||
name String
|
name String
|
||||||
mimetype String
|
mimetype String
|
||||||
size Int
|
size Int
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
|
user User? @relation(references: [username], fields: [username], onDelete: Cascade)
|
||||||
message MessageAttachment[]
|
message MessageAttachment[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
async (req, reply) => {
|
async (req, reply) => {
|
||||||
|
const user = req.user!
|
||||||
const data = await req.file()
|
const data = await req.file()
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
@@ -36,6 +37,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
|||||||
const meta = await fastify.prisma.attachment.create({
|
const meta = await fastify.prisma.attachment.create({
|
||||||
data: {
|
data: {
|
||||||
name: data.filename,
|
name: data.filename,
|
||||||
|
username: user.username,
|
||||||
mimetype: data.mimetype,
|
mimetype: data.mimetype,
|
||||||
size: 0,
|
size: 0,
|
||||||
},
|
},
|
||||||
@@ -47,13 +49,25 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
|||||||
|
|
||||||
const filePath = path.join(process.cwd(), 'uploads', meta.id)
|
const filePath = path.join(process.cwd(), 'uploads', meta.id)
|
||||||
|
|
||||||
|
let fileSize = 0
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const writeStream = fs.createWriteStream(filePath)
|
const writeStream = fs.createWriteStream(filePath)
|
||||||
data.file.pipe(writeStream)
|
data.file.pipe(writeStream)
|
||||||
|
data.file.on('data', (chunk) => {
|
||||||
|
fileSize += chunk.length
|
||||||
|
})
|
||||||
data.file.on('end', resolve)
|
data.file.on('end', resolve)
|
||||||
data.file.on('error', reject)
|
data.file.on('error', reject)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await fastify.prisma.attachment.update({
|
||||||
|
where: { id: meta.id },
|
||||||
|
data: { size: fileSize },
|
||||||
|
})
|
||||||
|
|
||||||
|
// await new Promise(resolve => setTimeout(resolve, Math.random() * 10000))
|
||||||
|
|
||||||
return meta.id
|
return meta.id
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -105,7 +105,12 @@ fastify.register(FastifyCors, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
fastify.register(FastifyCookie)
|
fastify.register(FastifyCookie)
|
||||||
fastify.register(FastifyMultipart)
|
fastify.register(FastifyMultipart, {
|
||||||
|
limits: {
|
||||||
|
files: 10,
|
||||||
|
fileSize: 500 * 1024 * 1024,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
fastify.register(FastifyAutoLoad, {
|
fastify.register(FastifyAutoLoad, {
|
||||||
dir: join(__dirname, 'plugins'),
|
dir: join(__dirname, 'plugins'),
|
||||||
|
|||||||
Reference in New Issue
Block a user