summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-09-23 23:25:08 +0200
committerRory& <root@rory.gay>2025-09-29 18:38:06 +0200
commitdb765d8ff0423ec9eea9b624973895569ddff558 (patch)
tree9ccc902497e8c0bdc91d2c56b70b7444747f2766 /src/util
parentImplement cloning cloud attachments into messages (diff)
downloadserver-ts-db765d8ff0423ec9eea9b624973895569ddff558.tar.xz
Update message schema to handle cloud attachments
Diffstat (limited to 'src/util')
-rw-r--r--src/util/schemas/MessageCreateSchema.ts10
-rw-r--r--src/util/schemas/responses/UploadAttachmentResponseSchema.ts1
2 files changed, 4 insertions, 7 deletions
diff --git a/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts

index 2538d39e..2bd6ccf5 100644 --- a/src/util/schemas/MessageCreateSchema.ts +++ b/src/util/schemas/MessageCreateSchema.ts
@@ -16,12 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { - ActionRowComponent, - Embed, - PollAnswer, - PollMedia, -} from "@spacebar/util"; +import { ActionRowComponent, Embed, PollAnswer, PollMedia, UploadAttachmentResponse } from "@spacebar/util"; +import { CloudAttachment } from "../entities/CloudAttachment"; export type MessageCreateAttachment = { id: string; @@ -57,7 +53,7 @@ export interface MessageCreateSchema { TODO: we should create an interface for attachments TODO: OpenWAAO<-->attachment-style metadata conversion **/ - attachments?: MessageCreateAttachment[]; + attachments?: (MessageCreateAttachment | UploadAttachmentResponse)[]; sticker_ids?: string[]; components?: ActionRowComponent[]; // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled diff --git a/src/util/schemas/responses/UploadAttachmentResponseSchema.ts b/src/util/schemas/responses/UploadAttachmentResponseSchema.ts
index 322137da..eab5f22e 100644 --- a/src/util/schemas/responses/UploadAttachmentResponseSchema.ts +++ b/src/util/schemas/responses/UploadAttachmentResponseSchema.ts
@@ -25,4 +25,5 @@ export interface UploadAttachmentResponse { id?: string; upload_url: string; upload_filename: string; + original_content_type?: string; }