fix: chat accepts quotes now
This commit is contained in:
+17
-1
@@ -168,7 +168,8 @@ export type AttachmentKind =
|
||||
| "audio"
|
||||
| "file"
|
||||
| "link"
|
||||
| "entity";
|
||||
| "entity"
|
||||
| "quote";
|
||||
|
||||
export type Attachment = {
|
||||
id: string;
|
||||
@@ -259,6 +260,7 @@ export const chat = {
|
||||
replyToId?: string;
|
||||
previewUrl?: string;
|
||||
attachments?: UploadedAttachment[];
|
||||
quote?: QuotePayload;
|
||||
},
|
||||
) =>
|
||||
call<ChatMessage>(`/chat/conversations/${conversationId}/messages`, {
|
||||
@@ -270,6 +272,7 @@ export const chat = {
|
||||
// Only the URL: the BFF fetches the card's contents itself.
|
||||
preview_url: opts?.previewUrl ?? null,
|
||||
attachments: opts?.attachments ?? [],
|
||||
quote: opts?.quote ?? null,
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -399,6 +402,19 @@ export const chat = {
|
||||
};
|
||||
|
||||
/** A file already uploaded to the private bucket, ready to attach on send. */
|
||||
/**
|
||||
* A passage shared from the library.
|
||||
*
|
||||
* `path` is app-relative on purpose — the BFF refuses anything absolute or
|
||||
* protocol-relative, because a quote renders as trusted in-app content and
|
||||
* must not be able to carry the reader off-site.
|
||||
*/
|
||||
export type QuotePayload = {
|
||||
path: string;
|
||||
title: string;
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type UploadedAttachment = {
|
||||
key: string;
|
||||
mime: string;
|
||||
|
||||
Reference in New Issue
Block a user