Update message schema to handle cloud attachments

This commit is contained in:
Rory& 2025-09-23 23:25:08 +02:00
parent c167a7b541
commit db765d8ff0
3 changed files with 5 additions and 7 deletions

View File

@ -93,6 +93,7 @@ router.post(
id: a.userAttachmentId, id: a.userAttachmentId,
upload_filename: a.uploadFilename, upload_filename: a.uploadFilename,
upload_url: `${cdnUrl}/attachments/${a.uploadFilename}`, upload_url: `${cdnUrl}/attachments/${a.uploadFilename}`,
original_content_type: a.userOriginalContentType
} }
})} as UploadAttachmentResponseSchema); })} as UploadAttachmentResponseSchema);
}, },

View File

@ -16,12 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { import { ActionRowComponent, Embed, PollAnswer, PollMedia, UploadAttachmentResponse } from "@spacebar/util";
ActionRowComponent, import { CloudAttachment } from "../entities/CloudAttachment";
Embed,
PollAnswer,
PollMedia,
} from "@spacebar/util";
export type MessageCreateAttachment = { export type MessageCreateAttachment = {
id: string; id: string;
@ -57,7 +53,7 @@ export interface MessageCreateSchema {
TODO: we should create an interface for attachments TODO: we should create an interface for attachments
TODO: OpenWAAO<-->attachment-style metadata conversion TODO: OpenWAAO<-->attachment-style metadata conversion
**/ **/
attachments?: MessageCreateAttachment[]; attachments?: (MessageCreateAttachment | UploadAttachmentResponse)[];
sticker_ids?: string[]; sticker_ids?: string[];
components?: ActionRowComponent[]; components?: ActionRowComponent[];
// TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled

View File

@ -25,4 +25,5 @@ export interface UploadAttachmentResponse {
id?: string; id?: string;
upload_url: string; upload_url: string;
upload_filename: string; upload_filename: string;
original_content_type?: string;
} }