hazo_chat 4.0.2 → 4.0.3

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 (153) hide show
  1. package/dist/api/index.d.ts +41 -0
  2. package/dist/api/index.d.ts.map +1 -0
  3. package/dist/api/index.js +40 -0
  4. package/dist/api/index.js.map +1 -0
  5. package/dist/api/messages.d.ts +85 -0
  6. package/dist/api/messages.d.ts.map +1 -0
  7. package/dist/api/messages.js +626 -0
  8. package/dist/api/messages.js.map +1 -0
  9. package/dist/api/types.d.ts +134 -0
  10. package/dist/api/types.d.ts.map +1 -0
  11. package/dist/api/types.js +8 -0
  12. package/dist/api/types.js.map +1 -0
  13. package/dist/api/unread_count.d.ts +82 -0
  14. package/dist/api/unread_count.d.ts.map +1 -0
  15. package/dist/api/unread_count.js +111 -0
  16. package/dist/api/unread_count.js.map +1 -0
  17. package/dist/components/hazo_chat/hazo_chat.d.ts +28 -0
  18. package/dist/components/hazo_chat/hazo_chat.d.ts.map +1 -0
  19. package/dist/components/hazo_chat/hazo_chat.js +230 -0
  20. package/dist/components/hazo_chat/hazo_chat.js.map +1 -0
  21. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts +17 -0
  22. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts.map +1 -0
  23. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js +60 -0
  24. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js.map +1 -0
  25. package/dist/components/hazo_chat/hazo_chat_context.d.ts +46 -0
  26. package/dist/components/hazo_chat/hazo_chat_context.d.ts.map +1 -0
  27. package/dist/components/hazo_chat/hazo_chat_context.js +277 -0
  28. package/dist/components/hazo_chat/hazo_chat_context.js.map +1 -0
  29. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts +15 -0
  30. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts.map +1 -0
  31. package/dist/components/hazo_chat/hazo_chat_document_viewer.js +140 -0
  32. package/dist/components/hazo_chat/hazo_chat_document_viewer.js.map +1 -0
  33. package/dist/components/hazo_chat/hazo_chat_header.d.ts +16 -0
  34. package/dist/components/hazo_chat/hazo_chat_header.d.ts.map +1 -0
  35. package/dist/components/hazo_chat/hazo_chat_header.js +45 -0
  36. package/dist/components/hazo_chat/hazo_chat_header.js.map +1 -0
  37. package/dist/components/hazo_chat/hazo_chat_input.d.ts +16 -0
  38. package/dist/components/hazo_chat/hazo_chat_input.d.ts.map +1 -0
  39. package/dist/components/hazo_chat/hazo_chat_input.js +75 -0
  40. package/dist/components/hazo_chat/hazo_chat_input.js.map +1 -0
  41. package/dist/components/hazo_chat/hazo_chat_messages.d.ts +18 -0
  42. package/dist/components/hazo_chat/hazo_chat_messages.d.ts.map +1 -0
  43. package/dist/components/hazo_chat/hazo_chat_messages.js +255 -0
  44. package/dist/components/hazo_chat/hazo_chat_messages.js.map +1 -0
  45. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts +16 -0
  46. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts.map +1 -0
  47. package/dist/components/hazo_chat/hazo_chat_reference_list.js +59 -0
  48. package/dist/components/hazo_chat/hazo_chat_reference_list.js.map +1 -0
  49. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts +18 -0
  50. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts.map +1 -0
  51. package/dist/components/hazo_chat/hazo_chat_sidebar.js +72 -0
  52. package/dist/components/hazo_chat/hazo_chat_sidebar.js.map +1 -0
  53. package/dist/components/hazo_chat/index.d.ts +16 -0
  54. package/dist/components/hazo_chat/index.d.ts.map +1 -0
  55. package/dist/components/hazo_chat/index.js +19 -0
  56. package/dist/components/hazo_chat/index.js.map +1 -0
  57. package/dist/components/index.d.ts +9 -0
  58. package/dist/components/index.d.ts.map +1 -0
  59. package/dist/components/index.js +11 -0
  60. package/dist/components/index.js.map +1 -0
  61. package/dist/components/ui/avatar.d.ts +13 -0
  62. package/dist/components/ui/avatar.d.ts.map +1 -0
  63. package/dist/components/ui/avatar.js +28 -0
  64. package/dist/components/ui/avatar.js.map +1 -0
  65. package/dist/components/ui/badge.d.ts +16 -0
  66. package/dist/components/ui/badge.d.ts.map +1 -0
  67. package/dist/components/ui/badge.js +36 -0
  68. package/dist/components/ui/badge.js.map +1 -0
  69. package/dist/components/ui/button.d.ts +18 -0
  70. package/dist/components/ui/button.d.ts.map +1 -0
  71. package/dist/components/ui/button.js +47 -0
  72. package/dist/components/ui/button.js.map +1 -0
  73. package/dist/components/ui/chat_bubble.d.ts +18 -0
  74. package/dist/components/ui/chat_bubble.d.ts.map +1 -0
  75. package/dist/components/ui/chat_bubble.js +130 -0
  76. package/dist/components/ui/chat_bubble.js.map +1 -0
  77. package/dist/components/ui/hover-card.d.ts +13 -0
  78. package/dist/components/ui/hover-card.d.ts.map +1 -0
  79. package/dist/components/ui/hover-card.js +17 -0
  80. package/dist/components/ui/hover-card.js.map +1 -0
  81. package/dist/components/ui/index.d.ts +19 -0
  82. package/dist/components/ui/index.d.ts.map +1 -0
  83. package/dist/components/ui/index.js +21 -0
  84. package/dist/components/ui/index.js.map +1 -0
  85. package/dist/components/ui/input.d.ts +11 -0
  86. package/dist/components/ui/input.d.ts.map +1 -0
  87. package/dist/components/ui/input.js +18 -0
  88. package/dist/components/ui/input.js.map +1 -0
  89. package/dist/components/ui/loading_skeleton.d.ts +19 -0
  90. package/dist/components/ui/loading_skeleton.d.ts.map +1 -0
  91. package/dist/components/ui/loading_skeleton.js +30 -0
  92. package/dist/components/ui/loading_skeleton.js.map +1 -0
  93. package/dist/components/ui/scroll-area.d.ts +12 -0
  94. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  95. package/dist/components/ui/scroll-area.js +25 -0
  96. package/dist/components/ui/scroll-area.js.map +1 -0
  97. package/dist/components/ui/separator.d.ts +11 -0
  98. package/dist/components/ui/separator.d.ts.map +1 -0
  99. package/dist/components/ui/separator.js +18 -0
  100. package/dist/components/ui/separator.js.map +1 -0
  101. package/dist/components/ui/skeleton.d.ts +9 -0
  102. package/dist/components/ui/skeleton.d.ts.map +1 -0
  103. package/dist/components/ui/skeleton.js +16 -0
  104. package/dist/components/ui/skeleton.js.map +1 -0
  105. package/dist/components/ui/textarea.d.ts +11 -0
  106. package/dist/components/ui/textarea.d.ts.map +1 -0
  107. package/dist/components/ui/textarea.js +18 -0
  108. package/dist/components/ui/textarea.js.map +1 -0
  109. package/dist/components/ui/tooltip.d.ts +14 -0
  110. package/dist/components/ui/tooltip.d.ts.map +1 -0
  111. package/dist/components/ui/tooltip.js +30 -0
  112. package/dist/components/ui/tooltip.js.map +1 -0
  113. package/dist/hooks/index.d.ts +10 -0
  114. package/dist/hooks/index.d.ts.map +1 -0
  115. package/dist/hooks/index.js +10 -0
  116. package/dist/hooks/index.js.map +1 -0
  117. package/dist/hooks/use_chat_messages.d.ts +38 -0
  118. package/dist/hooks/use_chat_messages.d.ts.map +1 -0
  119. package/dist/hooks/use_chat_messages.js +584 -0
  120. package/dist/hooks/use_chat_messages.js.map +1 -0
  121. package/dist/hooks/use_chat_references.d.ts +17 -0
  122. package/dist/hooks/use_chat_references.d.ts.map +1 -0
  123. package/dist/hooks/use_chat_references.js +133 -0
  124. package/dist/hooks/use_chat_references.js.map +1 -0
  125. package/dist/hooks/use_file_upload.d.ts +26 -0
  126. package/dist/hooks/use_file_upload.d.ts.map +1 -0
  127. package/dist/hooks/use_file_upload.js +216 -0
  128. package/dist/hooks/use_file_upload.js.map +1 -0
  129. package/dist/index.d.ts +13 -0
  130. package/dist/index.d.ts.map +1 -0
  131. package/dist/index.js +17 -0
  132. package/dist/index.js.map +1 -0
  133. package/dist/lib/config.d.ts +41 -0
  134. package/dist/lib/config.d.ts.map +1 -0
  135. package/dist/lib/config.js +93 -0
  136. package/dist/lib/config.js.map +1 -0
  137. package/dist/lib/constants.d.ts +41 -0
  138. package/dist/lib/constants.d.ts.map +1 -0
  139. package/dist/lib/constants.js +72 -0
  140. package/dist/lib/constants.js.map +1 -0
  141. package/dist/lib/index.d.ts +9 -0
  142. package/dist/lib/index.d.ts.map +1 -0
  143. package/dist/lib/index.js +9 -0
  144. package/dist/lib/index.js.map +1 -0
  145. package/dist/lib/utils.d.ts +17 -0
  146. package/dist/lib/utils.d.ts.map +1 -0
  147. package/dist/lib/utils.js +20 -0
  148. package/dist/lib/utils.js.map +1 -0
  149. package/dist/types/index.d.ts +570 -0
  150. package/dist/types/index.d.ts.map +1 -0
  151. package/dist/types/index.js +11 -0
  152. package/dist/types/index.js.map +1 -0
  153. package/package.json +2 -1
@@ -0,0 +1,570 @@
1
+ /**
2
+ * Type definitions for the hazo_chat package
3
+ *
4
+ * Contains all TypeScript interfaces and types used across the package
5
+ * for props, messages, references, user profiles, and configuration.
6
+ *
7
+ * This package uses an API-first architecture - all data access is done
8
+ * via fetch() calls to API endpoints, not direct database access.
9
+ */
10
+ import type { ReactNode } from 'react';
11
+ export type { Logger } from 'hazo_logs';
12
+ export type { ClientLogger } from 'hazo_logs/ui';
13
+ import type { ClientLogger } from 'hazo_logs/ui';
14
+ /**
15
+ * Authenticated user information
16
+ */
17
+ export interface HazoAuthUser {
18
+ id: string;
19
+ email?: string;
20
+ }
21
+ /**
22
+ * User profile with display information
23
+ */
24
+ export interface HazoUserProfile {
25
+ id: string;
26
+ name: string;
27
+ email?: string;
28
+ avatar_url?: string;
29
+ }
30
+ /**
31
+ * Database schema for hazo_chat table
32
+ */
33
+ export interface ChatMessageDB {
34
+ id: string;
35
+ reference_id: string;
36
+ reference_type: string;
37
+ sender_user_id: string;
38
+ chat_group_id: string;
39
+ message_text: string | null;
40
+ reference_list: ChatReferenceItem[] | null;
41
+ read_at: string | null;
42
+ deleted_at: string | null;
43
+ created_at: string;
44
+ changed_at: string;
45
+ }
46
+ /**
47
+ * Chat message with user profile data attached
48
+ */
49
+ export interface ChatMessage extends ChatMessageDB {
50
+ sender_profile?: HazoUserProfile;
51
+ is_sender: boolean;
52
+ send_status?: MessageSendStatus;
53
+ }
54
+ /**
55
+ * Status of message sending operation
56
+ */
57
+ export type MessageSendStatus = 'sending' | 'sent' | 'failed';
58
+ /**
59
+ * Payload for creating a new chat message
60
+ */
61
+ export interface CreateMessagePayload {
62
+ reference_id: string;
63
+ reference_type: string;
64
+ chat_group_id: string;
65
+ message_text: string;
66
+ reference_list?: ChatReferenceItem[];
67
+ }
68
+ /**
69
+ * Type of chat group
70
+ * - 'support': Client-to-staff support conversation
71
+ * - 'peer': Peer-to-peer direct message (1:1)
72
+ * - 'group': Multi-user group conversation
73
+ */
74
+ export type ChatGroupType = 'support' | 'peer' | 'group';
75
+ /**
76
+ * Role of a user within a chat group
77
+ * - 'client': Customer/end-user in support scenarios
78
+ * - 'staff': Support personnel in support scenarios
79
+ * - 'owner': Creator of peer/group chats
80
+ * - 'admin': Delegated administrator in group chats
81
+ * - 'member': Standard participant in peer/group chats
82
+ */
83
+ export type ChatGroupUserRole = 'client' | 'staff' | 'owner' | 'admin' | 'member';
84
+ /**
85
+ * Database schema for hazo_chat_group table
86
+ */
87
+ export interface ChatGroup {
88
+ id: string;
89
+ /** The fixed client user (optional - only for support groups) */
90
+ client_user_id?: string | null;
91
+ /** Type of conversation: 'support', 'peer', or 'group' */
92
+ group_type?: ChatGroupType;
93
+ name?: string;
94
+ created_at: string;
95
+ changed_at: string | null;
96
+ }
97
+ /**
98
+ * Database schema for hazo_chat_group_users table
99
+ */
100
+ export interface ChatGroupUser {
101
+ chat_group_id: string;
102
+ user_id: string;
103
+ role: ChatGroupUserRole;
104
+ created_at: string;
105
+ changed_at: string | null;
106
+ }
107
+ /**
108
+ * Chat group with members and profiles attached
109
+ */
110
+ export interface ChatGroupWithMembers extends ChatGroup {
111
+ members: ChatGroupUser[];
112
+ /** Profile of the client user (for support groups) */
113
+ client_profile?: HazoUserProfile;
114
+ /** Profiles of all group members */
115
+ member_profiles?: HazoUserProfile[];
116
+ /** Profile of the group owner (for peer/group chats) */
117
+ owner_profile?: HazoUserProfile;
118
+ }
119
+ /**
120
+ * Type of reference item
121
+ */
122
+ export type ReferenceType = 'document' | 'field' | 'url';
123
+ /**
124
+ * Scope of reference (where it's visible)
125
+ */
126
+ export type ReferenceScope = 'chat' | 'field';
127
+ /**
128
+ * Reference item in reference list or reference_list JSON column
129
+ */
130
+ export interface ChatReferenceItem {
131
+ id: string;
132
+ type: ReferenceType;
133
+ scope: ReferenceScope;
134
+ name: string;
135
+ url: string;
136
+ mime_type?: string;
137
+ file_size?: number;
138
+ message_id?: string;
139
+ }
140
+ /**
141
+ * Reference item passed as prop (external references)
142
+ */
143
+ export interface ReferenceItem {
144
+ id: string;
145
+ type: ReferenceType;
146
+ scope: ReferenceScope;
147
+ name: string;
148
+ url: string;
149
+ mime_type?: string;
150
+ }
151
+ /**
152
+ * Pending file attachment before upload
153
+ */
154
+ export interface PendingAttachment {
155
+ id: string;
156
+ file: File;
157
+ preview_url?: string;
158
+ upload_progress?: number;
159
+ upload_status: 'pending' | 'uploading' | 'uploaded' | 'failed';
160
+ error_message?: string;
161
+ }
162
+ /**
163
+ * Uploaded file result
164
+ */
165
+ export interface UploadedFile {
166
+ id: string;
167
+ name: string;
168
+ url: string;
169
+ mime_type: string;
170
+ file_size: number;
171
+ }
172
+ /**
173
+ * File upload validation result
174
+ */
175
+ export interface FileValidationResult {
176
+ valid: boolean;
177
+ error?: string;
178
+ }
179
+ /**
180
+ * Main HazoChat component props
181
+ *
182
+ * This component uses API calls internally - no database adapters needed.
183
+ * Consumers must set up the required API routes (see SETUP_CHECKLIST.md).
184
+ */
185
+ export interface HazoChatProps {
186
+ /** UUID of the chat group (required) */
187
+ chat_group_id: string;
188
+ /**
189
+ * Logger instance from hazo_logs/ui (required).
190
+ * Create using: createClientLogger({ packageName: 'hazo_chat' })
191
+ */
192
+ logger: ClientLogger;
193
+ /** Main field reference ID for chat context grouping */
194
+ reference_id?: string;
195
+ /** Reference type for the main reference (default: 'chat') */
196
+ reference_type?: string;
197
+ /** Base URL for API endpoints (default: '/api/hazo_chat') */
198
+ api_base_url?: string;
199
+ /** Additional field references (optional) */
200
+ additional_references?: ReferenceItem[];
201
+ /** Timezone for timestamps (default: "GMT+10") */
202
+ timezone?: string;
203
+ /** Chat window title */
204
+ title?: string;
205
+ /** Chat window subtitle */
206
+ subtitle?: string;
207
+ /** Close button callback */
208
+ on_close?: () => void;
209
+ /** Real-time update mode: 'polling' (automatic) or 'manual' (refresh only) */
210
+ realtime_mode?: RealtimeMode;
211
+ /** Polling interval in milliseconds (only used when realtime_mode = 'polling') */
212
+ polling_interval?: number;
213
+ /** Number of messages per page for pagination */
214
+ messages_per_page?: number;
215
+ /** Show sidebar toggle button (hamburger menu) - default: false */
216
+ show_sidebar_toggle?: boolean;
217
+ /** Show delete button on chat bubbles - default: true */
218
+ show_delete_button?: boolean;
219
+ /** Bubble border radius style - default: 'default' */
220
+ bubble_radius?: 'default' | 'full';
221
+ /** Additional CSS classes */
222
+ className?: string;
223
+ }
224
+ /**
225
+ * Props for HazoChatHeader component
226
+ */
227
+ export interface HazoChatHeaderProps {
228
+ title?: string;
229
+ subtitle?: string;
230
+ on_close?: () => void;
231
+ on_refresh?: () => void;
232
+ is_refreshing?: boolean;
233
+ on_toggle_sidebar?: () => void;
234
+ is_sidebar_open?: boolean;
235
+ /** Show sidebar toggle button (hamburger menu) - default: false */
236
+ show_sidebar_toggle?: boolean;
237
+ className?: string;
238
+ }
239
+ /**
240
+ * Props for HazoChatSidebar component
241
+ */
242
+ export interface HazoChatSidebarProps {
243
+ is_open: boolean;
244
+ on_close: () => void;
245
+ className?: string;
246
+ children?: ReactNode;
247
+ }
248
+ /**
249
+ * Props for HazoChatReferenceList component
250
+ */
251
+ export interface HazoChatReferenceListProps {
252
+ references: ChatReferenceItem[];
253
+ selected_reference_id?: string;
254
+ on_select: (reference: ChatReferenceItem) => void;
255
+ className?: string;
256
+ }
257
+ /**
258
+ * Props for HazoChatDocumentViewer component
259
+ */
260
+ export interface HazoChatDocumentViewerProps {
261
+ reference?: ChatReferenceItem;
262
+ className?: string;
263
+ }
264
+ /**
265
+ * Props for HazoChatMessages component
266
+ */
267
+ export interface HazoChatMessagesProps {
268
+ messages: ChatMessage[];
269
+ current_user_id: string;
270
+ timezone: string;
271
+ is_loading: boolean;
272
+ has_more: boolean;
273
+ on_load_more: () => void;
274
+ on_delete_message: (message_id: string) => void;
275
+ on_mark_as_read?: (message_id: string) => void;
276
+ on_scroll_to_message?: (message_id: string) => void;
277
+ highlighted_message_id?: string;
278
+ /** Show delete button on chat bubbles - default: true */
279
+ show_delete_button?: boolean;
280
+ /** Bubble border radius style - default: 'default' */
281
+ bubble_radius?: 'default' | 'full';
282
+ className?: string;
283
+ }
284
+ /**
285
+ * Props for HazoChatInput component
286
+ */
287
+ export interface HazoChatInputProps {
288
+ on_send: (message: string, attachments: UploadedFile[]) => void;
289
+ pending_attachments: PendingAttachment[];
290
+ on_add_attachment: (files: File[]) => void;
291
+ on_remove_attachment: (attachment_id: string) => void;
292
+ is_disabled?: boolean;
293
+ placeholder?: string;
294
+ className?: string;
295
+ }
296
+ /**
297
+ * Props for HazoChatAttachmentPreview component
298
+ */
299
+ export interface HazoChatAttachmentPreviewProps {
300
+ attachments: PendingAttachment[];
301
+ on_remove: (attachment_id: string) => void;
302
+ className?: string;
303
+ }
304
+ /**
305
+ * Props for ChatBubble component
306
+ */
307
+ export interface ChatBubbleProps {
308
+ message: ChatMessage;
309
+ is_sender: boolean;
310
+ sender_profile?: HazoUserProfile;
311
+ timezone: string;
312
+ on_delete?: () => void;
313
+ on_reference_click?: (reference: ChatReferenceItem) => void;
314
+ is_highlighted?: boolean;
315
+ /** Show delete button on chat bubbles - default: true */
316
+ show_delete_button?: boolean;
317
+ /** Bubble border radius style - default: 'default' */
318
+ bubble_radius?: 'default' | 'full';
319
+ className?: string;
320
+ }
321
+ /**
322
+ * Props for LoadingSkeleton component
323
+ */
324
+ export interface LoadingSkeletonProps {
325
+ type: 'message' | 'reference' | 'viewer';
326
+ count?: number;
327
+ className?: string;
328
+ }
329
+ /**
330
+ * State for HazoChatContext
331
+ */
332
+ export interface HazoChatContextState {
333
+ /** Current authenticated user */
334
+ current_user: HazoUserProfile | null;
335
+ /** Selected reference to display in viewer */
336
+ selected_reference: ChatReferenceItem | null;
337
+ /** ID of message to scroll to and highlight */
338
+ highlighted_message_id: string | null;
339
+ /** Pending file attachments */
340
+ pending_attachments: PendingAttachment[];
341
+ /** Whether sidebar is open (mobile) */
342
+ is_sidebar_open: boolean;
343
+ /** Polling connection status */
344
+ polling_status: PollingStatus;
345
+ /** All references from messages and props */
346
+ all_references: ChatReferenceItem[];
347
+ /** Error message if any */
348
+ error_message: string | null;
349
+ }
350
+ /**
351
+ * Actions for HazoChatContext
352
+ */
353
+ export interface HazoChatContextActions {
354
+ set_selected_reference: (reference: ChatReferenceItem | null) => void;
355
+ set_highlighted_message_id: (message_id: string | null) => void;
356
+ add_pending_attachment: (file: File) => void;
357
+ remove_pending_attachment: (attachment_id: string) => void;
358
+ update_pending_attachment: (attachment_id: string, updates: Partial<PendingAttachment>) => void;
359
+ clear_pending_attachments: () => void;
360
+ toggle_sidebar: () => void;
361
+ set_sidebar_open: (is_open: boolean) => void;
362
+ set_error_message: (message: string | null) => void;
363
+ add_reference: (reference: ChatReferenceItem) => void;
364
+ }
365
+ /**
366
+ * Full HazoChatContext value
367
+ */
368
+ export interface HazoChatContextValue extends HazoChatContextState, HazoChatContextActions {
369
+ /** Logger instance from hazo_logs/ui */
370
+ logger: ClientLogger;
371
+ }
372
+ /**
373
+ * Real-time update mode
374
+ * - 'polling': Automatic polling at configured interval
375
+ * - 'manual': Only update when user triggers refresh
376
+ * - 'websocket': (Future) WebSocket-based real-time updates
377
+ * - 'sse': (Future) Server-Sent Events-based updates
378
+ */
379
+ export type RealtimeMode = 'polling' | 'manual' | 'websocket' | 'sse';
380
+ /**
381
+ * Connection status for real-time updates
382
+ */
383
+ export type PollingStatus = 'connected' | 'reconnecting' | 'error';
384
+ /**
385
+ * Event types that can be received from real-time transport
386
+ */
387
+ export type TransportEventType = 'message_created' | 'message_updated' | 'message_deleted' | 'message_read' | 'typing_started' | 'typing_stopped';
388
+ /**
389
+ * Event payload from real-time transport
390
+ */
391
+ export interface TransportEvent {
392
+ type: TransportEventType;
393
+ payload: ChatMessageDB | {
394
+ message_id: string;
395
+ user_id: string;
396
+ };
397
+ timestamp: string;
398
+ }
399
+ /**
400
+ * Callback for handling transport events
401
+ */
402
+ export type TransportEventHandler = (event: TransportEvent) => void;
403
+ /**
404
+ * Abstract transport interface for real-time communication
405
+ *
406
+ * Implement this interface to add new transport types (WebSocket, SSE, etc.)
407
+ *
408
+ * @example
409
+ * ```typescript
410
+ * class WebSocketTransport implements RealtimeTransport {
411
+ * private ws: WebSocket | null = null;
412
+ *
413
+ * async connect(url: string, options: TransportOptions): Promise<void> {
414
+ * this.ws = new WebSocket(url);
415
+ * // ... setup handlers
416
+ * }
417
+ *
418
+ * async disconnect(): Promise<void> {
419
+ * this.ws?.close();
420
+ * }
421
+ *
422
+ * // ... other methods
423
+ * }
424
+ * ```
425
+ */
426
+ export interface RealtimeTransport {
427
+ /** Connect to the real-time service */
428
+ connect(url: string, options: TransportOptions): Promise<void>;
429
+ /** Disconnect from the real-time service */
430
+ disconnect(): Promise<void>;
431
+ /** Check if currently connected */
432
+ isConnected(): boolean;
433
+ /** Get current connection status */
434
+ getStatus(): PollingStatus;
435
+ /** Subscribe to events for a specific chat group */
436
+ subscribe(chat_group_id: string, reference_id?: string, handler?: TransportEventHandler): void;
437
+ /** Unsubscribe from events */
438
+ unsubscribe(): void;
439
+ /** Register a handler for status changes */
440
+ onStatusChange(handler: (status: PollingStatus) => void): void;
441
+ /** Register a handler for new messages */
442
+ onMessage(handler: (messages: ChatMessageDB[]) => void): void;
443
+ }
444
+ /**
445
+ * Options for configuring a transport
446
+ */
447
+ export interface TransportOptions {
448
+ /** Authentication token or credentials */
449
+ auth_token?: string;
450
+ /** Reconnection settings */
451
+ reconnect?: {
452
+ enabled: boolean;
453
+ max_attempts: number;
454
+ base_delay: number;
455
+ };
456
+ /** Heartbeat/ping interval in ms */
457
+ heartbeat_interval?: number;
458
+ }
459
+ /**
460
+ * Return type for useChatMessages hook
461
+ */
462
+ export interface UseChatMessagesReturn {
463
+ messages: ChatMessage[];
464
+ is_loading: boolean;
465
+ is_loading_more: boolean;
466
+ has_more: boolean;
467
+ error: string | null;
468
+ polling_status: PollingStatus;
469
+ load_more: () => void;
470
+ send_message: (payload: CreateMessagePayload) => Promise<boolean>;
471
+ delete_message: (message_id: string) => Promise<boolean>;
472
+ mark_as_read: (message_id: string) => Promise<void>;
473
+ refresh: () => void;
474
+ }
475
+ /**
476
+ * Return type for useChatReferences hook
477
+ */
478
+ export interface UseChatReferencesReturn {
479
+ references: ChatReferenceItem[];
480
+ selected_reference: ChatReferenceItem | null;
481
+ select_reference: (reference: ChatReferenceItem) => void;
482
+ clear_selection: () => void;
483
+ add_reference: (reference: ChatReferenceItem) => void;
484
+ get_message_for_reference: (reference_id: string) => string | null;
485
+ }
486
+ /**
487
+ * Return type for useFileUpload hook
488
+ */
489
+ export interface UseFileUploadReturn {
490
+ pending_attachments: PendingAttachment[];
491
+ add_files: (files: File[]) => void;
492
+ remove_file: (attachment_id: string) => void;
493
+ upload_all: () => Promise<UploadedFile[]>;
494
+ clear_all: () => void;
495
+ is_uploading: boolean;
496
+ validation_errors: string[];
497
+ }
498
+ /**
499
+ * Chat configuration from hazo_chat_config.ini
500
+ */
501
+ export interface ChatConfig {
502
+ polling_interval: number;
503
+ messages_per_page: number;
504
+ }
505
+ /**
506
+ * Upload configuration from hazo_chat_config.ini
507
+ */
508
+ export interface UploadConfig {
509
+ max_file_size_mb: number;
510
+ allowed_types: string[];
511
+ }
512
+ /**
513
+ * Full configuration object
514
+ */
515
+ export interface HazoChatConfig {
516
+ chat: ChatConfig;
517
+ uploads: UploadConfig;
518
+ }
519
+ /**
520
+ * Pagination metadata returned in list responses
521
+ */
522
+ export interface PaginationInfo {
523
+ limit: number;
524
+ has_more: boolean;
525
+ next_cursor: string | null;
526
+ prev_cursor: string | null;
527
+ }
528
+ /**
529
+ * Response from GET /api/hazo_chat/messages
530
+ */
531
+ export interface MessagesApiResponse {
532
+ success: boolean;
533
+ messages?: ChatMessageDB[];
534
+ current_user_id?: string;
535
+ error?: string;
536
+ pagination?: PaginationInfo;
537
+ }
538
+ /**
539
+ * Response from POST /api/hazo_chat/messages
540
+ */
541
+ export interface SendMessageApiResponse {
542
+ success: boolean;
543
+ message?: ChatMessageDB;
544
+ error?: string;
545
+ }
546
+ /**
547
+ * Response from DELETE /api/hazo_chat/messages/[id]
548
+ */
549
+ export interface DeleteMessageApiResponse {
550
+ success: boolean;
551
+ message?: ChatMessageDB;
552
+ error?: string;
553
+ }
554
+ /**
555
+ * Response from PATCH /api/hazo_chat/messages/[id]/read
556
+ */
557
+ export interface MarkAsReadApiResponse {
558
+ success: boolean;
559
+ message?: ChatMessageDB;
560
+ error?: string;
561
+ }
562
+ /**
563
+ * Response from /api/hazo_auth/profiles
564
+ */
565
+ export interface ProfilesApiResponse {
566
+ success: boolean;
567
+ profiles?: HazoUserProfile[];
568
+ error?: string;
569
+ }
570
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC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;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Type definitions for the hazo_chat package
3
+ *
4
+ * Contains all TypeScript interfaces and types used across the package
5
+ * for props, messages, references, user profiles, and configuration.
6
+ *
7
+ * This package uses an API-first architecture - all data access is done
8
+ * via fetch() calls to API endpoints, not direct database access.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_chat",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Chat interface for group-based communication with API-first architecture",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,6 +43,7 @@
43
43
  "build:test-app": "npm run build && cd test-app && npm run build",
44
44
  "clean": "rm -rf dist",
45
45
  "prebuild": "npm run clean",
46
+ "prepublishOnly": "npm run build",
46
47
  "test": "echo \"Error: no test specified\" && exit 1"
47
48
  },
48
49
  "repository": {