Update message schema to handle cloud attachments
This commit is contained in:
parent
c167a7b541
commit
db765d8ff0
@ -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);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user