@manonero/chat-client-sdk 0.0.1-beta.1 → 0.0.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +391 -137
- package/dist/ChatClient.d.ts +36 -4
- package/dist/ChatClient.d.ts.map +1 -1
- package/dist/ChatClient.js +13 -9
- package/dist/ChatClient.js.map +1 -1
- package/dist/http/BotApi.d.ts +4 -1
- package/dist/http/BotApi.d.ts.map +1 -1
- package/dist/http/BotApi.js +4 -1
- package/dist/http/BotApi.js.map +1 -1
- package/dist/http/ConversationApi.d.ts +8 -5
- package/dist/http/ConversationApi.d.ts.map +1 -1
- package/dist/http/ConversationApi.js +11 -11
- package/dist/http/ConversationApi.js.map +1 -1
- package/dist/http/FileApi.d.ts +9 -11
- package/dist/http/FileApi.d.ts.map +1 -1
- package/dist/http/FileApi.js +8 -12
- package/dist/http/FileApi.js.map +1 -1
- package/dist/http/SearchApi.d.ts +39 -0
- package/dist/http/SearchApi.d.ts.map +1 -0
- package/dist/http/SearchApi.js +44 -0
- package/dist/http/SearchApi.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/realtime/ChatHubClient.d.ts +29 -2
- package/dist/realtime/ChatHubClient.d.ts.map +1 -1
- package/dist/realtime/ChatHubClient.js +36 -5
- package/dist/realtime/ChatHubClient.js.map +1 -1
- package/dist/realtime/NotificationHubClient.d.ts +11 -0
- package/dist/realtime/NotificationHubClient.d.ts.map +1 -1
- package/dist/realtime/NotificationHubClient.js +7 -3
- package/dist/realtime/NotificationHubClient.js.map +1 -1
- package/dist/realtime/ReconnectionManager.d.ts +9 -1
- package/dist/realtime/ReconnectionManager.d.ts.map +1 -1
- package/dist/realtime/ReconnectionManager.js +12 -2
- package/dist/realtime/ReconnectionManager.js.map +1 -1
- package/dist/realtime/connectionOptions.d.ts +32 -0
- package/dist/realtime/connectionOptions.d.ts.map +1 -0
- package/dist/realtime/connectionOptions.js +55 -0
- package/dist/realtime/connectionOptions.js.map +1 -0
- package/dist/types/block.d.ts +1 -0
- package/dist/types/block.d.ts.map +1 -1
- package/dist/types/block.js.map +1 -1
- package/dist/types/bot.d.ts +64 -2
- package/dist/types/bot.d.ts.map +1 -1
- package/dist/types/broadcast.d.ts +50 -0
- package/dist/types/broadcast.d.ts.map +1 -0
- package/dist/types/broadcast.js +3 -0
- package/dist/types/broadcast.js.map +1 -0
- package/dist/types/chat-events.d.ts +21 -18
- package/dist/types/chat-events.d.ts.map +1 -1
- package/dist/types/common.d.ts +14 -4
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/conversation.d.ts +2 -2
- package/dist/types/conversation.d.ts.map +1 -1
- package/dist/types/participant.d.ts +5 -0
- package/dist/types/participant.d.ts.map +1 -1
- package/dist/types/search.d.ts +47 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/search.js +3 -0
- package/dist/types/search.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SenderType } from './message.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sender type for an ephemeral broadcast.
|
|
4
|
+
*
|
|
5
|
+
* A broadcast is always issued by a bot or the SYSTEM user — never a regular
|
|
6
|
+
* `User`. Narrowed from {@link SenderType} so it stays in sync if that union
|
|
7
|
+
* ever changes.
|
|
8
|
+
*/
|
|
9
|
+
export type BroadcastSenderType = Extract<SenderType, 'Bot' | 'System'>;
|
|
10
|
+
/**
|
|
11
|
+
* Ephemeral (non-persisted) real-time broadcast — spec §3.4 / §4.
|
|
12
|
+
*
|
|
13
|
+
* Emitted on BOTH hubs with the identical `EphemeralBroadcast` event:
|
|
14
|
+
* - **ChatHub**: delivered when a broadcast targets `audience="viewers"` of
|
|
15
|
+
* the conversation the client currently has open — `conversationId` is set.
|
|
16
|
+
* - **NotificationHub**: delivered for `audience="members" | "all" | "users"`.
|
|
17
|
+
* For a global broadcast, `conversationId` is `null`.
|
|
18
|
+
*
|
|
19
|
+
* Broadcasts are NOT stored: there is no history, no ack, and no edit/delete.
|
|
20
|
+
* They are pushed by a bot or the SYSTEM user via `POST /api/broadcasts`.
|
|
21
|
+
*
|
|
22
|
+
* The `data` field is a free-form envelope — the client interprets it based on
|
|
23
|
+
* `type`. `TData` lets callers narrow that envelope to a concrete shape while
|
|
24
|
+
* defaulting to `unknown` so untyped usage stays safe:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* interface PromoBanner { title: string; startsAt: string }
|
|
28
|
+
*
|
|
29
|
+
* chat.on('ephemeralBroadcast', (b) => {
|
|
30
|
+
* if (b.type === 'promo_banner') {
|
|
31
|
+
* const promo = b.data as PromoBanner; // narrow by `type`
|
|
32
|
+
* showBanner(promo.title);
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export interface EphemeralBroadcastDto<TData = unknown> {
|
|
38
|
+
/** Sender-defined key; the client interprets `data` based on this. */
|
|
39
|
+
type: string;
|
|
40
|
+
/** `participantId` of the bot, or the literal `"SYSTEM"`. */
|
|
41
|
+
senderId: string;
|
|
42
|
+
senderType: BroadcastSenderType;
|
|
43
|
+
/** Target conversation, or `null` for a global broadcast. */
|
|
44
|
+
conversationId: string | null;
|
|
45
|
+
/** Free-form JSON envelope. `null` when the sender omits it. */
|
|
46
|
+
data: TData | null;
|
|
47
|
+
/** UTC ISO-8601 timestamp of when the broadcast was sent. */
|
|
48
|
+
sentAt: string;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=broadcast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../src/types/broadcast.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,UAAU,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,OAAO;IACpD,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,mBAAmB,CAAC;IAChC,6DAA6D;IAC7D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gEAAgE;IAChE,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IACnB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../src/types/broadcast.ts"],"names":[],"mappings":"AAAA,yFAAyF"}
|
|
@@ -56,7 +56,7 @@ export interface MessageUpdatedDto {
|
|
|
56
56
|
conversationId: string;
|
|
57
57
|
blocks: Block[];
|
|
58
58
|
plainTextContent: string | null;
|
|
59
|
-
mentions?: Mention[];
|
|
59
|
+
mentions?: Mention[] | null;
|
|
60
60
|
/** ISO 8601 */
|
|
61
61
|
updatedAt: string;
|
|
62
62
|
/** ID tin nhắn reply mới; null nếu reply reference đã bị xóa */
|
|
@@ -141,29 +141,32 @@ export interface StreamChunkReceivedDto {
|
|
|
141
141
|
conversationId: string;
|
|
142
142
|
/** Text chunk to append to placeholder */
|
|
143
143
|
text: string;
|
|
144
|
-
/**
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/** Zero-based chunk index — append in ascending order */
|
|
151
|
-
chunkIndex: number;
|
|
144
|
+
/**
|
|
145
|
+
* Server-assigned sequence number (zero-based, increasing). Shared with
|
|
146
|
+
* {@link StreamBlockReceivedDto.sequence} so text and inline blocks can be
|
|
147
|
+
* ordered correctly within a single stream.
|
|
148
|
+
*/
|
|
149
|
+
sequence: number;
|
|
152
150
|
}
|
|
153
151
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* same append logic.
|
|
152
|
+
* An inline content block (widget) emitted mid-stream by the bot, interleaved
|
|
153
|
+
* with text chunks (e.g. card, choice, divider). Client appends `block` to the
|
|
154
|
+
* placeholder message ordered by `sequence` — the same sequence space as
|
|
155
|
+
* {@link StreamChunkReceivedDto} — so text and blocks render in the exact order
|
|
156
|
+
* the bot emitted them. Server sanitizes content and resolves signed URLs for
|
|
157
|
+
* media in the block before broadcasting.
|
|
161
158
|
*/
|
|
162
|
-
export interface
|
|
159
|
+
export interface StreamBlockReceivedDto {
|
|
163
160
|
streamId: string;
|
|
164
161
|
messageId: string;
|
|
165
162
|
conversationId: string;
|
|
166
|
-
|
|
163
|
+
/** Inline content block */
|
|
164
|
+
block: Block;
|
|
165
|
+
/**
|
|
166
|
+
* Server-assigned sequence number (shared with
|
|
167
|
+
* {@link StreamChunkReceivedDto.sequence}).
|
|
168
|
+
*/
|
|
169
|
+
sequence: number;
|
|
167
170
|
}
|
|
168
171
|
/**
|
|
169
172
|
* Stream completed — contains full message.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-events.d.ts","sourceRoot":"","sources":["../../src/types/chat-events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;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MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,OAAO,EAAE,cAAc,CAAC;IACxB,eAAe;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -21,12 +21,22 @@ export interface PagedResult<T> {
|
|
|
21
21
|
totalCount: number;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Reference to a stored media file.
|
|
25
|
-
*
|
|
24
|
+
* Reference to a stored media file (spec §13 — MediaReference).
|
|
25
|
+
*
|
|
26
|
+
* - Internal storage: `{ storageKey, url? }`. Server resolves a presigned
|
|
27
|
+
* `url` before broadcasting to clients.
|
|
28
|
+
* - External URL: `{ url }` with `storageKey` null (e.g. OAuth avatar).
|
|
29
|
+
* - Request body shape: client only needs `storageKey` for internal storage;
|
|
30
|
+
* server ignores `url` on input.
|
|
31
|
+
*
|
|
32
|
+
* Both fields are typed `string | null | undefined` because the server may
|
|
33
|
+
* explicitly emit `null` for the one that does not apply.
|
|
26
34
|
*/
|
|
27
35
|
export interface MediaReference {
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
/** Internal storage key. `null` when the reference is an external URL. */
|
|
37
|
+
storageKey?: string | null;
|
|
38
|
+
/** Direct access URL. `null` when only `storageKey` is set on input. */
|
|
39
|
+
url?: string | null;
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* A single error entry inside the RFC 7807 `errors` array.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,gDAAgD;AAChD,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC"}
|
|
@@ -15,7 +15,7 @@ export interface ConversationParticipantDto {
|
|
|
15
15
|
/** Full conversation object */
|
|
16
16
|
export interface ConversationDto {
|
|
17
17
|
id: string;
|
|
18
|
-
name
|
|
18
|
+
name?: string | null;
|
|
19
19
|
avatar?: MediaReference | null;
|
|
20
20
|
ownerId: string;
|
|
21
21
|
/** ISO 8601, null when no messages yet */
|
|
@@ -44,7 +44,7 @@ export interface ConversationListItemDto {
|
|
|
44
44
|
participantCount: number;
|
|
45
45
|
}
|
|
46
46
|
export interface CreateConversationRequest {
|
|
47
|
-
name
|
|
47
|
+
name?: string;
|
|
48
48
|
avatar?: MediaReference;
|
|
49
49
|
participantIds: string[];
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/types/conversation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,wDAAwD;AACxD,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,OAAO,CAA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;IACnB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,SAAS,EAAE,0BAA0B,CAAC;IACtC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAElB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B"}
|
|
@@ -13,10 +13,15 @@ export interface ParticipantDto {
|
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
}
|
|
15
15
|
export interface CreateOrUpdateParticipantRequest {
|
|
16
|
+
/** Max 100 chars */
|
|
16
17
|
id: string;
|
|
18
|
+
/** Max 50 chars, only [a-zA-Z0-9_] */
|
|
17
19
|
uniqueName: string;
|
|
20
|
+
/** Max 200 chars */
|
|
18
21
|
fullName: string;
|
|
22
|
+
/** When external URL: `url` max 2000 chars */
|
|
19
23
|
avatar?: MediaReference;
|
|
24
|
+
/** Max 20 chars */
|
|
20
25
|
gender?: string;
|
|
21
26
|
}
|
|
22
27
|
//# sourceMappingURL=participant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../src/types/participant.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gCAAgC;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../src/types/participant.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gCAAgC;IAC/C,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ConversationListItemDto } from './conversation.js';
|
|
2
|
+
import type { ConversationDto } from './conversation.js';
|
|
3
|
+
import type { MessageDto } from './message.js';
|
|
4
|
+
/** Search scope for GET /api/search. */
|
|
5
|
+
export type SearchType = 'MESSAGE' | 'CONVERSATION' | 'BOTH';
|
|
6
|
+
/** A group of messages that matched the search query, associated with their conversation. */
|
|
7
|
+
export interface SearchMessageGroup {
|
|
8
|
+
/**
|
|
9
|
+
* The conversation these messages belong to.
|
|
10
|
+
* `null` if the batch fetch for conversation info failed (graceful degrade).
|
|
11
|
+
* `participants` is always `[]` (fetched with `includeParticipants=false`).
|
|
12
|
+
*/
|
|
13
|
+
conversation: ConversationDto | null;
|
|
14
|
+
messages: MessageDto[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Paginated message search results, grouped by conversation.
|
|
18
|
+
* Cursor pagination applies only to messages; conversation ordering follows
|
|
19
|
+
* the first appearance of each conversation in the result set.
|
|
20
|
+
*/
|
|
21
|
+
export interface SearchMessagesResult {
|
|
22
|
+
groups: SearchMessageGroup[];
|
|
23
|
+
nextCursor: string | null;
|
|
24
|
+
hasMore: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Unified search response from GET /api/search.
|
|
28
|
+
*
|
|
29
|
+
* Both keys are always present; the key for the unselected `type` is `null`:
|
|
30
|
+
* - `type=CONVERSATION` → `messages` is `null`
|
|
31
|
+
* - `type=MESSAGE` → `conversations` is `null`
|
|
32
|
+
* - `type=BOTH` → both populated
|
|
33
|
+
*/
|
|
34
|
+
export interface SearchResult {
|
|
35
|
+
/**
|
|
36
|
+
* Matching conversations with `lastMessage` hydrated (same as conversation
|
|
37
|
+
* list items from GET /api/conversations). `null` when `type=MESSAGE`.
|
|
38
|
+
* Client MUST check `lastMessage.isDeleted` before displaying (spec §6.3).
|
|
39
|
+
*/
|
|
40
|
+
conversations: ConversationListItemDto[] | null;
|
|
41
|
+
/**
|
|
42
|
+
* Matching messages grouped by conversation. `null` when `type=CONVERSATION`.
|
|
43
|
+
* Supports cursor pagination for messages.
|
|
44
|
+
*/
|
|
45
|
+
messages: SearchMessagesResult | null;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/types/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;AAE7D,6FAA6F;AAC7F,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,aAAa,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/types/search.ts"],"names":[],"mappings":"AAAA,gFAAgF"}
|