@manonero/chat-client-sdk 0.0.1-beta.1

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.
Files changed (110) hide show
  1. package/README.md +2453 -0
  2. package/dist/ChatClient.d.ts +181 -0
  3. package/dist/ChatClient.d.ts.map +1 -0
  4. package/dist/ChatClient.js +246 -0
  5. package/dist/ChatClient.js.map +1 -0
  6. package/dist/errors/ChatApiError.d.ts +45 -0
  7. package/dist/errors/ChatApiError.d.ts.map +1 -0
  8. package/dist/errors/ChatApiError.js +69 -0
  9. package/dist/errors/ChatApiError.js.map +1 -0
  10. package/dist/http/AuthApi.d.ts +26 -0
  11. package/dist/http/AuthApi.d.ts.map +1 -0
  12. package/dist/http/AuthApi.js +35 -0
  13. package/dist/http/AuthApi.js.map +1 -0
  14. package/dist/http/BotApi.d.ts +43 -0
  15. package/dist/http/BotApi.d.ts.map +1 -0
  16. package/dist/http/BotApi.js +60 -0
  17. package/dist/http/BotApi.js.map +1 -0
  18. package/dist/http/ConversationApi.d.ts +92 -0
  19. package/dist/http/ConversationApi.d.ts.map +1 -0
  20. package/dist/http/ConversationApi.js +128 -0
  21. package/dist/http/ConversationApi.js.map +1 -0
  22. package/dist/http/FileApi.d.ts +60 -0
  23. package/dist/http/FileApi.d.ts.map +1 -0
  24. package/dist/http/FileApi.js +91 -0
  25. package/dist/http/FileApi.js.map +1 -0
  26. package/dist/http/HealthApi.d.ts +28 -0
  27. package/dist/http/HealthApi.d.ts.map +1 -0
  28. package/dist/http/HealthApi.js +34 -0
  29. package/dist/http/HealthApi.js.map +1 -0
  30. package/dist/http/HttpClient.d.ts +69 -0
  31. package/dist/http/HttpClient.d.ts.map +1 -0
  32. package/dist/http/HttpClient.js +244 -0
  33. package/dist/http/HttpClient.js.map +1 -0
  34. package/dist/http/MessageApi.d.ts +69 -0
  35. package/dist/http/MessageApi.d.ts.map +1 -0
  36. package/dist/http/MessageApi.js +104 -0
  37. package/dist/http/MessageApi.js.map +1 -0
  38. package/dist/http/ParticipantApi.d.ts +28 -0
  39. package/dist/http/ParticipantApi.d.ts.map +1 -0
  40. package/dist/http/ParticipantApi.js +37 -0
  41. package/dist/http/ParticipantApi.js.map +1 -0
  42. package/dist/http/ProxyApi.d.ts +59 -0
  43. package/dist/http/ProxyApi.d.ts.map +1 -0
  44. package/dist/http/ProxyApi.js +86 -0
  45. package/dist/http/ProxyApi.js.map +1 -0
  46. package/dist/index.d.ts +26 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +18 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/realtime/ChatHubClient.d.ts +143 -0
  51. package/dist/realtime/ChatHubClient.d.ts.map +1 -0
  52. package/dist/realtime/ChatHubClient.js +365 -0
  53. package/dist/realtime/ChatHubClient.js.map +1 -0
  54. package/dist/realtime/NotificationHubClient.d.ts +89 -0
  55. package/dist/realtime/NotificationHubClient.d.ts.map +1 -0
  56. package/dist/realtime/NotificationHubClient.js +191 -0
  57. package/dist/realtime/NotificationHubClient.js.map +1 -0
  58. package/dist/realtime/ReconnectionManager.d.ts +65 -0
  59. package/dist/realtime/ReconnectionManager.d.ts.map +1 -0
  60. package/dist/realtime/ReconnectionManager.js +129 -0
  61. package/dist/realtime/ReconnectionManager.js.map +1 -0
  62. package/dist/types/auth.d.ts +30 -0
  63. package/dist/types/auth.d.ts.map +1 -0
  64. package/dist/types/auth.js +3 -0
  65. package/dist/types/auth.js.map +1 -0
  66. package/dist/types/block.d.ts +163 -0
  67. package/dist/types/block.d.ts.map +1 -0
  68. package/dist/types/block.js +77 -0
  69. package/dist/types/block.js.map +1 -0
  70. package/dist/types/bot.d.ts +42 -0
  71. package/dist/types/bot.d.ts.map +1 -0
  72. package/dist/types/bot.js +3 -0
  73. package/dist/types/bot.js.map +1 -0
  74. package/dist/types/chat-events.d.ts +191 -0
  75. package/dist/types/chat-events.d.ts.map +1 -0
  76. package/dist/types/chat-events.js +3 -0
  77. package/dist/types/chat-events.js.map +1 -0
  78. package/dist/types/common.d.ts +64 -0
  79. package/dist/types/common.d.ts.map +1 -0
  80. package/dist/types/common.js +3 -0
  81. package/dist/types/common.js.map +1 -0
  82. package/dist/types/conversation.d.ts +106 -0
  83. package/dist/types/conversation.d.ts.map +1 -0
  84. package/dist/types/conversation.js +3 -0
  85. package/dist/types/conversation.js.map +1 -0
  86. package/dist/types/file.d.ts +31 -0
  87. package/dist/types/file.d.ts.map +1 -0
  88. package/dist/types/file.js +3 -0
  89. package/dist/types/file.js.map +1 -0
  90. package/dist/types/message.d.ts +84 -0
  91. package/dist/types/message.d.ts.map +1 -0
  92. package/dist/types/message.js +3 -0
  93. package/dist/types/message.js.map +1 -0
  94. package/dist/types/notification-events.d.ts +89 -0
  95. package/dist/types/notification-events.d.ts.map +1 -0
  96. package/dist/types/notification-events.js +3 -0
  97. package/dist/types/notification-events.js.map +1 -0
  98. package/dist/types/participant.d.ts +22 -0
  99. package/dist/types/participant.d.ts.map +1 -0
  100. package/dist/types/participant.js +3 -0
  101. package/dist/types/participant.js.map +1 -0
  102. package/dist/types/signalr.d.ts +84 -0
  103. package/dist/types/signalr.d.ts.map +1 -0
  104. package/dist/types/signalr.js +3 -0
  105. package/dist/types/signalr.js.map +1 -0
  106. package/dist/utils/TypedEventEmitter.d.ts +32 -0
  107. package/dist/utils/TypedEventEmitter.d.ts.map +1 -0
  108. package/dist/utils/TypedEventEmitter.js +60 -0
  109. package/dist/utils/TypedEventEmitter.js.map +1 -0
  110. package/package.json +42 -0
@@ -0,0 +1,191 @@
1
+ import type { MediaReference } from './common.js';
2
+ import type { Block, QuickReply, Mention } from './block.js';
3
+ import type { SenderType, SystemEventInfo } from './message.js';
4
+ /**
5
+ * System event in SignalR context — extends REST SystemEventInfo with display names.
6
+ * Uses TypeScript extends to avoid field duplication.
7
+ */
8
+ export interface SystemEventDto extends SystemEventInfo {
9
+ actorName?: string;
10
+ targetNames?: string[];
11
+ }
12
+ /**
13
+ * Reaction group (SignalR version — flat array, NOT wrapped in ReactionSummary).
14
+ * Compare with REST ReactionSummary: { groups: ReactionGroup[], totalCount }.
15
+ */
16
+ export interface ReactionGroupDto {
17
+ emoji: string;
18
+ count: number;
19
+ participantIds: string[];
20
+ }
21
+ /**
22
+ * Message DTO as sent over ChatHub (SignalR version).
23
+ *
24
+ * Differences from REST MessageDto:
25
+ * - Added: senderName, senderAvatar, senderType
26
+ * - Removed: timestamp, editedAt, isDeleted, deletedAt
27
+ * - Uses updatedAt instead of editedAt
28
+ * - reactions: flat ReactionGroupDto[] (not reactionSummary wrapper)
29
+ * - plainTextContent (not plainTextIndex)
30
+ * - systemEvent: SystemEventDto (not SystemEventInfo)
31
+ */
32
+ export interface ChatMessageDto {
33
+ id: string;
34
+ conversationId: string;
35
+ senderId: string;
36
+ senderName: string;
37
+ /** Có thể null khi server không sẵn signed URL — fallback theo storageKey */
38
+ senderAvatar?: MediaReference | null;
39
+ senderType: SenderType;
40
+ blocks: Block[];
41
+ plainTextContent: string | null;
42
+ replyToMessageId: string | null;
43
+ quickReplies: QuickReply[] | null;
44
+ isEdited: boolean;
45
+ reactions: ReactionGroupDto[] | null;
46
+ mentions: Mention[] | null;
47
+ /** ISO 8601 */
48
+ createdAt: string;
49
+ /** ISO 8601 */
50
+ updatedAt: string | null;
51
+ clientMessageId: string | null;
52
+ systemEvent: SystemEventDto | null;
53
+ }
54
+ export interface MessageUpdatedDto {
55
+ messageId: string;
56
+ conversationId: string;
57
+ blocks: Block[];
58
+ plainTextContent: string | null;
59
+ mentions?: Mention[];
60
+ /** ISO 8601 */
61
+ updatedAt: string;
62
+ /** ID tin nhắn reply mới; null nếu reply reference đã bị xóa */
63
+ replyToMessageId?: string | null;
64
+ }
65
+ export interface MessageDeletedDto {
66
+ messageId: string;
67
+ conversationId: string;
68
+ deletedBy: string;
69
+ /** ISO 8601 */
70
+ deletedAt: string;
71
+ }
72
+ export interface ReactionAddedDto {
73
+ messageId: string;
74
+ conversationId: string;
75
+ participantId: string;
76
+ participantName: string;
77
+ emoji: string;
78
+ /** ISO 8601 */
79
+ createdAt: string;
80
+ }
81
+ /** NOTE: uses removedAt (not createdAt like ReactionAddedDto) */
82
+ export interface ReactionRemovedDto {
83
+ messageId: string;
84
+ conversationId: string;
85
+ participantId: string;
86
+ participantName: string;
87
+ emoji: string;
88
+ /** ISO 8601 */
89
+ removedAt: string;
90
+ }
91
+ export interface TypingDto {
92
+ conversationId: string;
93
+ participantId: string;
94
+ participantName: string;
95
+ }
96
+ /** Thumbnail ready cho một block media trong message */
97
+ export interface MessageThumbnailDto {
98
+ /** Vị trí block trong mảng blocks của message */
99
+ blockIndex: number;
100
+ thumbnail: MediaReference;
101
+ }
102
+ /**
103
+ * Server đã sinh xong thumbnail cho các media block trong message (ảnh/video).
104
+ * Client nên cập nhật URL thumbnail theo blockIndex mà không cần re-fetch toàn bộ message.
105
+ *
106
+ * NOTE: Event này được gửi SAU MessageReceived/StreamCompleted khi server hoàn tất
107
+ * xử lý media bất đồng bộ.
108
+ */
109
+ export interface MessageThumbnailsReadyDto {
110
+ messageId: string;
111
+ conversationId: string;
112
+ thumbnails: MessageThumbnailDto[];
113
+ }
114
+ export interface StreamStartedDto {
115
+ streamId: string;
116
+ messageId: string;
117
+ conversationId: string;
118
+ senderId: string;
119
+ senderName: string;
120
+ /** Có thể null khi server không sẵn signed URL — fallback theo storageKey */
121
+ senderAvatar?: MediaReference | null;
122
+ replyToMessageId?: string | null;
123
+ /** ISO 8601 */
124
+ startedAt: string;
125
+ /** ID tạm của client (echo từ stream_start.clientMessageId). null nếu bot không truyền */
126
+ clientMessageId?: string | null;
127
+ }
128
+ export interface StreamStatusUpdatedDto {
129
+ streamId: string;
130
+ messageId: string;
131
+ conversationId: string;
132
+ /** e.g. "thinking", "searching" */
133
+ status: string;
134
+ detail?: string;
135
+ /** ISO 8601 */
136
+ updatedAt: string;
137
+ }
138
+ export interface StreamChunkReceivedDto {
139
+ streamId: string;
140
+ messageId: string;
141
+ conversationId: string;
142
+ /** Text chunk to append to placeholder */
143
+ text: string;
144
+ /** Zero-based chunk index */
145
+ chunkIndex: number;
146
+ }
147
+ /** One coalesced chunk inside a StreamChunkBatchReceived event */
148
+ export interface StreamChunkPart {
149
+ text: string;
150
+ /** Zero-based chunk index — append in ascending order */
151
+ chunkIndex: number;
152
+ }
153
+ /**
154
+ * Coalesced version of `StreamChunkReceived` — server gathers chunks emitted
155
+ * within `Streaming:ChunkCoalesceWindowMs` (default 50ms) into a single batch.
156
+ *
157
+ * Clients should append `parts[i].text` in ascending `chunkIndex` order.
158
+ * The server may emit `StreamChunkReceived` or `StreamChunkBatchReceived` (or
159
+ * both depending on the deployment) — install both handlers and apply the
160
+ * same append logic.
161
+ */
162
+ export interface StreamChunkBatchReceivedDto {
163
+ streamId: string;
164
+ messageId: string;
165
+ conversationId: string;
166
+ parts: StreamChunkPart[];
167
+ }
168
+ /**
169
+ * Stream completed — contains full message.
170
+ * NOTE: MessageReceived is NOT sent for streaming messages — this is the only completion signal.
171
+ */
172
+ export interface StreamCompletedDto {
173
+ streamId: string;
174
+ messageId: string;
175
+ conversationId: string;
176
+ /** Full ChatMessageDto (SignalR version, NOT REST MessageDto) */
177
+ message: ChatMessageDto;
178
+ /** ISO 8601 */
179
+ completedAt: string;
180
+ /** Lý do kết thúc stream (echo từ stream_end.finishReason). null nếu bot không truyền */
181
+ finishReason?: string | null;
182
+ }
183
+ export interface StreamAbortedDto {
184
+ streamId: string;
185
+ messageId: string;
186
+ conversationId: string;
187
+ reason: string;
188
+ /** ISO 8601 */
189
+ abortedAt: string;
190
+ }
191
+ //# sourceMappingURL=chat-events.d.ts.map
@@ -0,0 +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,O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AAM,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"}
@@ -0,0 +1,3 @@
1
+ // chat-events.ts — ChatHub Server→Client event payload types
2
+ export {};
3
+ //# sourceMappingURL=chat-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-events.js","sourceRoot":"","sources":["../../src/types/chat-events.ts"],"names":[],"mappings":"AAAA,6DAA6D"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Cursor-based paginated result.
3
+ *
4
+ * `nextCursor` is an opaque string — format depends on the endpoint:
5
+ * - Conversation list: composite `"<UnixMs>_<ULID>"` (e.g. `"1743004200000_01JRZABC1234567890ABCDEF"`)
6
+ * - Message history: opaque ULID message ID (e.g. `"01JRZXYZ1234567890ABCDEF"`)
7
+ *
8
+ * Always treat as an opaque string — NEVER cast to number.
9
+ */
10
+ export interface CursorPaginatedResult<T> {
11
+ items: T[];
12
+ /** Opaque cursor string for next page. null when no more pages. */
13
+ nextCursor: string | null;
14
+ hasMore: boolean;
15
+ }
16
+ /** Page-based (offset) paginated result. */
17
+ export interface PagedResult<T> {
18
+ items: T[];
19
+ page: number;
20
+ pageSize: number;
21
+ totalCount: number;
22
+ }
23
+ /**
24
+ * Reference to a stored media file.
25
+ * Internal storage uses storageKey; external URLs use url.
26
+ */
27
+ export interface MediaReference {
28
+ storageKey?: string;
29
+ url?: string;
30
+ }
31
+ /**
32
+ * A single error entry inside the RFC 7807 `errors` array.
33
+ * Present on all handler errors (ErrorOr path → ToProblemResult).
34
+ */
35
+ export interface ProblemError {
36
+ /** Error identifier, e.g. `"Bot.NotFound"`, `"UniqueName"`. */
37
+ code: string;
38
+ /** Human-readable description of the error. */
39
+ description: string;
40
+ /** ErrorType enum value: `"Validation"`, `"NotFound"`, `"Conflict"`, etc. */
41
+ type: string;
42
+ }
43
+ /**
44
+ * RFC 7807 Problem Details error format.
45
+ * Server returns this structure for all REST API errors (spec §3).
46
+ */
47
+ export interface ProblemDetails {
48
+ /** URI reference for the HTTP status — populated automatically by the framework. */
49
+ type: string;
50
+ status: number;
51
+ title: string;
52
+ detail?: string;
53
+ /**
54
+ * Array of structured error details.
55
+ * Present for handler errors (ErrorOr path → ToProblemResult); absent for
56
+ * middleware/filter errors (404 path, 405, 415, etc.).
57
+ */
58
+ errors?: ProblemError[];
59
+ /** W3C trace ID for log correlation. Added automatically by the framework. */
60
+ traceId?: string;
61
+ }
62
+ /** Callback for file upload progress events. */
63
+ export type UploadProgressCallback = (loaded: number, total: number) => void;
64
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +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;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;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"}
@@ -0,0 +1,3 @@
1
+ // common.ts — Shared types used across the SDK
2
+ export {};
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,+CAA+C"}
@@ -0,0 +1,106 @@
1
+ import type { MediaReference } from './common.js';
2
+ import type { MessageDto } from './message.js';
3
+ /** Participant info in the context of a conversation */
4
+ export interface ConversationParticipantDto {
5
+ participantId: string;
6
+ /** ISO 8601 */
7
+ joinedAt: string;
8
+ /** ISO 8601, null if still active */
9
+ leftAt?: string | null;
10
+ isActive: boolean;
11
+ isPinned: boolean;
12
+ /** ISO 8601 */
13
+ pinnedAt?: string | null;
14
+ }
15
+ /** Full conversation object */
16
+ export interface ConversationDto {
17
+ id: string;
18
+ name: string;
19
+ avatar?: MediaReference | null;
20
+ ownerId: string;
21
+ /** ISO 8601, null when no messages yet */
22
+ lastMessageAt?: string | null;
23
+ lastMessageId?: string | null;
24
+ /** ISO 8601 */
25
+ createdAt: string;
26
+ /** ISO 8601 */
27
+ updatedAt: string;
28
+ participants: ConversationParticipantDto[];
29
+ }
30
+ /** Lightweight conversation item for listing (`GET /api/conversations`). */
31
+ export interface ConversationListItemDto {
32
+ id: string;
33
+ name?: string | null;
34
+ avatar?: MediaReference | null;
35
+ /** ISO 8601, null when conversation has no messages yet */
36
+ lastMessageAt?: string | null;
37
+ /** null when conversation has no messages yet */
38
+ lastMessageId?: string | null;
39
+ /** Full message DTO for preview. null when conversation has no messages yet. */
40
+ lastMessage?: MessageDto | null;
41
+ isPinned: boolean;
42
+ /** ISO 8601, null when not pinned */
43
+ pinnedAt?: string | null;
44
+ participantCount: number;
45
+ }
46
+ export interface CreateConversationRequest {
47
+ name: string;
48
+ avatar?: MediaReference;
49
+ participantIds: string[];
50
+ }
51
+ export interface UpdateConversationRequest {
52
+ name?: string;
53
+ avatar?: MediaReference;
54
+ }
55
+ export interface AddParticipantRequest {
56
+ participantId: string;
57
+ }
58
+ /** Filter for the conversation media listing endpoint. Case-insensitive on the wire. */
59
+ export type ConversationMediaKindFilter = 'all' | 'attachment' | 'link';
60
+ /** Categorisation of a media item (matches the server's `kind` field). */
61
+ export type ConversationMediaKind = 'Attachment' | 'Link';
62
+ /** Block type that produced the media item. */
63
+ export type ConversationMediaBlockType = 'Image' | 'Video' | 'Audio' | 'File' | 'LinkPreview';
64
+ /**
65
+ * A single media/link item extracted from a conversation's messages.
66
+ *
67
+ * Returned by `GET /api/conversations/{conversationId}/media`. The server
68
+ * walks every block in every message visible to the caller (subject to the
69
+ * caller's join time) and emits one `ConversationMediaItemDto` per qualifying
70
+ * block. The same message can therefore contribute multiple items.
71
+ */
72
+ export interface ConversationMediaItemDto {
73
+ /** Composite id `{messageId}#{blockIndex:D2}` */
74
+ id: string;
75
+ conversationId: string;
76
+ messageId: string;
77
+ /** 0-based index of the block inside the source message */
78
+ blockIndex: number;
79
+ senderId: string;
80
+ /** `User` | `Bot` | `System` */
81
+ senderType: string;
82
+ kind: ConversationMediaKind;
83
+ blockType: ConversationMediaBlockType;
84
+ /** ISO 8601 — creation time of the source message */
85
+ createdAt: string;
86
+ /** Set when `kind === 'Attachment'` (internal storage). */
87
+ storageKey?: string | null;
88
+ /** Set when `kind === 'Link'` (external URL or LinkPreview). */
89
+ url?: string | null;
90
+ fileName?: string | null;
91
+ mimeType?: string | null;
92
+ fileSizeBytes?: number | null;
93
+ width?: number | null;
94
+ height?: number | null;
95
+ durationSeconds?: number | null;
96
+ caption?: string | null;
97
+ altText?: string | null;
98
+ thumbnailStorageKey?: string | null;
99
+ thumbnailUrl?: string | null;
100
+ linkTitle?: string | null;
101
+ linkDescription?: string | null;
102
+ linkSiteName?: string | null;
103
+ linkImageStorageKey?: string | null;
104
+ linkImageUrl?: string | null;
105
+ }
106
+ //# sourceMappingURL=conversation.d.ts.map
@@ -0,0 +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,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,+BAA+B;AAC/B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI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M,GAAG,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ // conversation.ts — Conversation types
2
+ export {};
3
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/types/conversation.ts"],"names":[],"mappings":"AAAA,uCAAuC"}
@@ -0,0 +1,31 @@
1
+ export interface CreateUploadUrlRequest {
2
+ fileName: string;
3
+ contentType: string;
4
+ /** File size in bytes, max 50MB */
5
+ fileSize: number;
6
+ }
7
+ export interface CreateUploadUrlResponse {
8
+ /**
9
+ * Relative upload URL (e.g. "/api/files/upload?key=...&sig=...").
10
+ * Must be combined with baseUrl before use.
11
+ */
12
+ uploadUrl: string;
13
+ storageKey: string;
14
+ /** ISO 8601 */
15
+ expiresAt: string;
16
+ }
17
+ export interface UploadResponse {
18
+ /**
19
+ * Relative download URL (e.g. "/api/files/01HXABCDEF/photo.jpg").
20
+ * Must be combined with baseUrl before use.
21
+ */
22
+ downloadUrl: string;
23
+ storageKey: string;
24
+ fileName: string;
25
+ contentType: string;
26
+ /** File size in bytes */
27
+ fileSize: number;
28
+ /** ISO 8601 */
29
+ uploadedAt: string;
30
+ }
31
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ // file.ts — File upload/download types
2
+ export {};
3
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/types/file.ts"],"names":[],"mappings":"AAAA,uCAAuC"}
@@ -0,0 +1,84 @@
1
+ import type { Block, QuickReply, Mention } from './block.js';
2
+ export type SenderType = 'User' | 'Bot' | 'System';
3
+ export type SystemEventType = 'ConversationRenamed' | 'AvatarChanged' | 'MemberAdded' | 'MemberRemoved' | 'MemberLeft' | 'Custom';
4
+ /** System event metadata — REST API version */
5
+ export interface SystemEventInfo {
6
+ type: SystemEventType;
7
+ /** null when there is no actor (e.g. MemberLeft — user left voluntarily) */
8
+ actorId?: string | null;
9
+ targetIds?: string[];
10
+ /**
11
+ * All values are strings per spec (e.g. ConversationRenamed → { newName: "..." }).
12
+ * Server may emit `null` (e.g. MemberAdded with no extra metadata).
13
+ */
14
+ metadata?: Record<string, string> | null;
15
+ }
16
+ /** Reaction on a single emoji (REST API version — flat array item) */
17
+ export interface ReactionGroup {
18
+ emoji: string;
19
+ count: number;
20
+ participantIds: string[];
21
+ }
22
+ /**
23
+ * Reaction summary wrapper (REST API version).
24
+ * NOTE: SignalR ChatMessageDto uses a flat ReactionGroupDto[] array instead.
25
+ */
26
+ export interface ReactionSummary {
27
+ groups: ReactionGroup[];
28
+ totalCount: number;
29
+ }
30
+ /**
31
+ * Full message object — REST API version.
32
+ *
33
+ * Differences from SignalR ChatMessageDto:
34
+ * - Has: editedAt, isDeleted, deletedAt, plainTextIndex, reactionSummary
35
+ * - Does NOT have: senderName, senderAvatar, reactions (flat), plainTextContent (SignalR name)
36
+ */
37
+ export interface MessageDto {
38
+ /** ULID assigned by server */
39
+ id: string;
40
+ conversationId: string;
41
+ senderId: string;
42
+ senderType: SenderType;
43
+ blocks: Block[];
44
+ /** Plain text content for search indexing */
45
+ plainTextIndex: string | null;
46
+ replyToMessageId: string | null;
47
+ quickReplies: QuickReply[] | null;
48
+ isEdited: boolean;
49
+ /** ISO 8601 */
50
+ editedAt: string | null;
51
+ isDeleted: boolean;
52
+ /** ISO 8601 */
53
+ deletedAt: string | null;
54
+ reactionSummary: ReactionSummary | null;
55
+ mentions: Mention[] | null;
56
+ /** ISO 8601 — time database record was created */
57
+ createdAt: string;
58
+ /** ISO 8601 */
59
+ updatedAt: string;
60
+ /** Temporary client-generated ID for optimistic rendering */
61
+ clientMessageId: string | null;
62
+ /** Only present when senderType === 'System' */
63
+ systemEvent: SystemEventInfo | null;
64
+ }
65
+ /** Request to send a new message via REST API */
66
+ export interface SendMessageRequest {
67
+ blocks: Block[];
68
+ replyToMessageId?: string;
69
+ quickReplies?: QuickReply[];
70
+ mentions?: Mention[];
71
+ /** Up to 128 characters — for optimistic rendering */
72
+ clientMessageId?: string;
73
+ }
74
+ /**
75
+ * Request to edit a message via REST API.
76
+ * NOTE: Different from SignalR ChatEditMessageRequest which uses newBlocks/newMentions.
77
+ */
78
+ export interface EditMessageRequest {
79
+ blocks: Block[];
80
+ mentions?: Mention[];
81
+ /** Pass null to remove the existing reply reference */
82
+ replyToMessageId?: string | null;
83
+ }
84
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,eAAe,GACvB,qBAAqB,GACrB,eAAe,GACf,aAAa,GACb,eAAe,GACf,YAAY,GACZ,Q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AE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gDAAgD;IAChD,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;CACrC;AAED,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
@@ -0,0 +1,3 @@
1
+ // message.ts — Message types (REST API version)
2
+ export {};
3
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":"AAAA,gDAAgD"}
@@ -0,0 +1,89 @@
1
+ import type { MediaReference } from './common.js';
2
+ /** Notification sent to all participants except the sender when a new message arrives */
3
+ export interface NewMessageNotificationDto {
4
+ conversationId: string;
5
+ conversationName?: string | null;
6
+ messageId: string;
7
+ senderId: string;
8
+ senderName: string;
9
+ /** Có thể null khi server không sẵn signed URL — fallback theo storageKey */
10
+ senderAvatar?: MediaReference | null;
11
+ /** Plain-text preview, truncated to 100 chars by the server */
12
+ contentPreview: string;
13
+ /** ISO 8601 */
14
+ sentAt: string;
15
+ }
16
+ /**
17
+ * Notification when current user is mentioned.
18
+ * NOTE: Does NOT include senderAvatar (unlike NewMessageNotificationDto).
19
+ *
20
+ * Chỉ phát sinh khi tin nhắn chứa mention `type = "User"` với `targetId` hợp lệ.
21
+ * Các mention `All`/`Here`/`Role` không sinh notification riêng — client cần
22
+ * lắng nghe `NewMessageNotification` để xử lý.
23
+ */
24
+ export interface MentionedNotificationDto {
25
+ conversationId: string;
26
+ messageId: string;
27
+ senderId: string;
28
+ senderName: string;
29
+ /** Plain-text preview, truncated to 100 chars by the server */
30
+ contentPreview: string;
31
+ /** ISO 8601 */
32
+ sentAt: string;
33
+ }
34
+ /**
35
+ * Fired when a conversation appears in the user's list — either freshly
36
+ * created or because the user was added to an existing conversation.
37
+ * Recipient: all initial participants (on create) or only the newly added
38
+ * user (on add). Already-present participants receive `ParticipantJoined`.
39
+ */
40
+ export interface ConversationCreatedDto {
41
+ conversationId: string;
42
+ name?: string | null;
43
+ avatar?: MediaReference | null;
44
+ participantCount: number;
45
+ }
46
+ /** Fired when conversation metadata changes (name, avatar, etc.) */
47
+ export interface ConversationUpdatedDto {
48
+ conversationId: string;
49
+ name?: string | null;
50
+ avatar?: MediaReference | null;
51
+ participantCount: number;
52
+ }
53
+ /**
54
+ * Recipient: only existing participants. Newly added users get
55
+ * `ConversationCreated` instead of this event.
56
+ */
57
+ export interface ParticipantJoinedDto {
58
+ conversationId: string;
59
+ participantId: string;
60
+ participantName: string;
61
+ /** Có thể null khi server không sẵn signed URL — fallback theo storageKey */
62
+ participantAvatar?: MediaReference | null;
63
+ /** ISO 8601 */
64
+ changedAt: string;
65
+ }
66
+ /**
67
+ * Same shape as ParticipantJoinedDto.
68
+ * Recipient: remaining participants AND the participant who just left/was
69
+ * removed — so the leaver can sync the removal across their other tabs.
70
+ */
71
+ export interface ParticipantLeftDto {
72
+ conversationId: string;
73
+ participantId: string;
74
+ participantName: string;
75
+ /** Có thể null khi server không sẵn signed URL — fallback theo storageKey */
76
+ participantAvatar?: MediaReference | null;
77
+ /** ISO 8601 */
78
+ changedAt: string;
79
+ }
80
+ export interface ConversationPinnedDto {
81
+ conversationId: string;
82
+ /** ISO 8601 */
83
+ pinnedAt: string;
84
+ }
85
+ /** NOTE: Does NOT include pinnedAt (unlike ConversationPinnedDto) */
86
+ export interface ConversationUnpinnedDto {
87
+ conversationId: string;
88
+ }
89
+ //# sourceMappingURL=notification-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-events.d.ts","sourceRoot":"","sources":["../../src/types/notification-events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,yFAAyF;AACzF,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1C,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1C,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ // notification-events.ts — NotificationHub Server→Client event payload types
2
+ export {};
3
+ //# sourceMappingURL=notification-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-events.js","sourceRoot":"","sources":["../../src/types/notification-events.ts"],"names":[],"mappings":"AAAA,6EAA6E"}