summary refs log tree commit diff
path: root/src/util/schemas
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-09-23 21:05:35 +0200
committerRory& <root@rory.gay>2025-09-29 18:38:06 +0200
commit1e6ed06da142e4aa558cf1ada38204d4adf55c92 (patch)
tree7aaa3c5aa9e3af232e3905012a3722a66f23b522 /src/util/schemas
parentFix schema for preload messages (diff)
downloadserver-ts-1e6ed06da142e4aa558cf1ada38204d4adf55c92.tar.xz
Add first half of cloud attachment uploads
Diffstat (limited to 'src/util/schemas')
-rw-r--r--src/util/schemas/UploadAttachmentRequestSchema.ts30
-rw-r--r--src/util/schemas/index.ts1
-rw-r--r--src/util/schemas/responses/UploadAttachmentResponseSchema.ts28
-rw-r--r--src/util/schemas/responses/index.ts1
4 files changed, 60 insertions, 0 deletions
diff --git a/src/util/schemas/UploadAttachmentRequestSchema.ts b/src/util/schemas/UploadAttachmentRequestSchema.ts
new file mode 100644

index 00000000..06cb65f1 --- /dev/null +++ b/src/util/schemas/UploadAttachmentRequestSchema.ts
@@ -0,0 +1,30 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2024 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + + +export interface UploadAttachmentRequestSchema { + files: UploadAttachmentRequest[]; +} + +export interface UploadAttachmentRequest { + id: string; + filename: string; + file_size: number; + is_clip?: boolean; + original_content_type?: string; +} diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts
index 9bba9cb4..39710425 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts
@@ -81,6 +81,7 @@ export * from "./TemplateModifySchema"; export * from "./TotpDisableSchema"; export * from "./TotpEnableSchema"; export * from "./TotpSchema"; +export * from "./UploadAttachmentRequestSchema"; export * from "./UserDeleteSchema"; export * from "./UserGuildSettingsSchema"; export * from "./UserModifySchema"; diff --git a/src/util/schemas/responses/UploadAttachmentResponseSchema.ts b/src/util/schemas/responses/UploadAttachmentResponseSchema.ts new file mode 100644
index 00000000..322137da --- /dev/null +++ b/src/util/schemas/responses/UploadAttachmentResponseSchema.ts
@@ -0,0 +1,28 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2024 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + + +export interface UploadAttachmentResponseSchema { + attachments: UploadAttachmentResponse[]; +} + +export interface UploadAttachmentResponse { + id?: string; + upload_url: string; + upload_filename: string; +} diff --git a/src/util/schemas/responses/index.ts b/src/util/schemas/responses/index.ts
index 8ca6fc61..561af184 100644 --- a/src/util/schemas/responses/index.ts +++ b/src/util/schemas/responses/index.ts
@@ -58,6 +58,7 @@ export * from "./Tenor"; export * from "./TokenResponse"; export * from "./TypedResponses"; export * from "./UpdatesResponse"; +export * from "./UploadAttachmentResponseSchema"; export * from "./UserNoteResponse"; export * from "./UserProfileResponse"; export * from "./UserRelationshipsResponse";