Add first half of cloud attachment uploads
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";
|