hazo_chat 4.0.2 → 4.0.5

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 (155) hide show
  1. package/README.md +46 -6
  2. package/SETUP_CHECKLIST.md +12 -2
  3. package/dist/api/index.d.ts +41 -0
  4. package/dist/api/index.d.ts.map +1 -0
  5. package/dist/api/index.js +40 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/api/messages.d.ts +85 -0
  8. package/dist/api/messages.d.ts.map +1 -0
  9. package/dist/api/messages.js +626 -0
  10. package/dist/api/messages.js.map +1 -0
  11. package/dist/api/types.d.ts +134 -0
  12. package/dist/api/types.d.ts.map +1 -0
  13. package/dist/api/types.js +8 -0
  14. package/dist/api/types.js.map +1 -0
  15. package/dist/api/unread_count.d.ts +82 -0
  16. package/dist/api/unread_count.d.ts.map +1 -0
  17. package/dist/api/unread_count.js +111 -0
  18. package/dist/api/unread_count.js.map +1 -0
  19. package/dist/components/hazo_chat/hazo_chat.d.ts +28 -0
  20. package/dist/components/hazo_chat/hazo_chat.d.ts.map +1 -0
  21. package/dist/components/hazo_chat/hazo_chat.js +230 -0
  22. package/dist/components/hazo_chat/hazo_chat.js.map +1 -0
  23. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts +17 -0
  24. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts.map +1 -0
  25. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js +60 -0
  26. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js.map +1 -0
  27. package/dist/components/hazo_chat/hazo_chat_context.d.ts +46 -0
  28. package/dist/components/hazo_chat/hazo_chat_context.d.ts.map +1 -0
  29. package/dist/components/hazo_chat/hazo_chat_context.js +277 -0
  30. package/dist/components/hazo_chat/hazo_chat_context.js.map +1 -0
  31. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts +15 -0
  32. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts.map +1 -0
  33. package/dist/components/hazo_chat/hazo_chat_document_viewer.js +140 -0
  34. package/dist/components/hazo_chat/hazo_chat_document_viewer.js.map +1 -0
  35. package/dist/components/hazo_chat/hazo_chat_header.d.ts +16 -0
  36. package/dist/components/hazo_chat/hazo_chat_header.d.ts.map +1 -0
  37. package/dist/components/hazo_chat/hazo_chat_header.js +45 -0
  38. package/dist/components/hazo_chat/hazo_chat_header.js.map +1 -0
  39. package/dist/components/hazo_chat/hazo_chat_input.d.ts +16 -0
  40. package/dist/components/hazo_chat/hazo_chat_input.d.ts.map +1 -0
  41. package/dist/components/hazo_chat/hazo_chat_input.js +75 -0
  42. package/dist/components/hazo_chat/hazo_chat_input.js.map +1 -0
  43. package/dist/components/hazo_chat/hazo_chat_messages.d.ts +18 -0
  44. package/dist/components/hazo_chat/hazo_chat_messages.d.ts.map +1 -0
  45. package/dist/components/hazo_chat/hazo_chat_messages.js +255 -0
  46. package/dist/components/hazo_chat/hazo_chat_messages.js.map +1 -0
  47. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts +16 -0
  48. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts.map +1 -0
  49. package/dist/components/hazo_chat/hazo_chat_reference_list.js +59 -0
  50. package/dist/components/hazo_chat/hazo_chat_reference_list.js.map +1 -0
  51. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts +18 -0
  52. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts.map +1 -0
  53. package/dist/components/hazo_chat/hazo_chat_sidebar.js +72 -0
  54. package/dist/components/hazo_chat/hazo_chat_sidebar.js.map +1 -0
  55. package/dist/components/hazo_chat/index.d.ts +16 -0
  56. package/dist/components/hazo_chat/index.d.ts.map +1 -0
  57. package/dist/components/hazo_chat/index.js +19 -0
  58. package/dist/components/hazo_chat/index.js.map +1 -0
  59. package/dist/components/index.d.ts +9 -0
  60. package/dist/components/index.d.ts.map +1 -0
  61. package/dist/components/index.js +11 -0
  62. package/dist/components/index.js.map +1 -0
  63. package/dist/components/ui/avatar.d.ts +13 -0
  64. package/dist/components/ui/avatar.d.ts.map +1 -0
  65. package/dist/components/ui/avatar.js +28 -0
  66. package/dist/components/ui/avatar.js.map +1 -0
  67. package/dist/components/ui/badge.d.ts +16 -0
  68. package/dist/components/ui/badge.d.ts.map +1 -0
  69. package/dist/components/ui/badge.js +36 -0
  70. package/dist/components/ui/badge.js.map +1 -0
  71. package/dist/components/ui/button.d.ts +18 -0
  72. package/dist/components/ui/button.d.ts.map +1 -0
  73. package/dist/components/ui/button.js +47 -0
  74. package/dist/components/ui/button.js.map +1 -0
  75. package/dist/components/ui/chat_bubble.d.ts +18 -0
  76. package/dist/components/ui/chat_bubble.d.ts.map +1 -0
  77. package/dist/components/ui/chat_bubble.js +130 -0
  78. package/dist/components/ui/chat_bubble.js.map +1 -0
  79. package/dist/components/ui/hover-card.d.ts +13 -0
  80. package/dist/components/ui/hover-card.d.ts.map +1 -0
  81. package/dist/components/ui/hover-card.js +17 -0
  82. package/dist/components/ui/hover-card.js.map +1 -0
  83. package/dist/components/ui/index.d.ts +19 -0
  84. package/dist/components/ui/index.d.ts.map +1 -0
  85. package/dist/components/ui/index.js +21 -0
  86. package/dist/components/ui/index.js.map +1 -0
  87. package/dist/components/ui/input.d.ts +11 -0
  88. package/dist/components/ui/input.d.ts.map +1 -0
  89. package/dist/components/ui/input.js +18 -0
  90. package/dist/components/ui/input.js.map +1 -0
  91. package/dist/components/ui/loading_skeleton.d.ts +19 -0
  92. package/dist/components/ui/loading_skeleton.d.ts.map +1 -0
  93. package/dist/components/ui/loading_skeleton.js +30 -0
  94. package/dist/components/ui/loading_skeleton.js.map +1 -0
  95. package/dist/components/ui/scroll-area.d.ts +12 -0
  96. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  97. package/dist/components/ui/scroll-area.js +25 -0
  98. package/dist/components/ui/scroll-area.js.map +1 -0
  99. package/dist/components/ui/separator.d.ts +11 -0
  100. package/dist/components/ui/separator.d.ts.map +1 -0
  101. package/dist/components/ui/separator.js +18 -0
  102. package/dist/components/ui/separator.js.map +1 -0
  103. package/dist/components/ui/skeleton.d.ts +9 -0
  104. package/dist/components/ui/skeleton.d.ts.map +1 -0
  105. package/dist/components/ui/skeleton.js +16 -0
  106. package/dist/components/ui/skeleton.js.map +1 -0
  107. package/dist/components/ui/textarea.d.ts +11 -0
  108. package/dist/components/ui/textarea.d.ts.map +1 -0
  109. package/dist/components/ui/textarea.js +18 -0
  110. package/dist/components/ui/textarea.js.map +1 -0
  111. package/dist/components/ui/tooltip.d.ts +14 -0
  112. package/dist/components/ui/tooltip.d.ts.map +1 -0
  113. package/dist/components/ui/tooltip.js +30 -0
  114. package/dist/components/ui/tooltip.js.map +1 -0
  115. package/dist/hooks/index.d.ts +10 -0
  116. package/dist/hooks/index.d.ts.map +1 -0
  117. package/dist/hooks/index.js +10 -0
  118. package/dist/hooks/index.js.map +1 -0
  119. package/dist/hooks/use_chat_messages.d.ts +38 -0
  120. package/dist/hooks/use_chat_messages.d.ts.map +1 -0
  121. package/dist/hooks/use_chat_messages.js +584 -0
  122. package/dist/hooks/use_chat_messages.js.map +1 -0
  123. package/dist/hooks/use_chat_references.d.ts +17 -0
  124. package/dist/hooks/use_chat_references.d.ts.map +1 -0
  125. package/dist/hooks/use_chat_references.js +133 -0
  126. package/dist/hooks/use_chat_references.js.map +1 -0
  127. package/dist/hooks/use_file_upload.d.ts +26 -0
  128. package/dist/hooks/use_file_upload.d.ts.map +1 -0
  129. package/dist/hooks/use_file_upload.js +216 -0
  130. package/dist/hooks/use_file_upload.js.map +1 -0
  131. package/dist/index.d.ts +13 -0
  132. package/dist/index.d.ts.map +1 -0
  133. package/dist/index.js +17 -0
  134. package/dist/index.js.map +1 -0
  135. package/dist/lib/config.d.ts +41 -0
  136. package/dist/lib/config.d.ts.map +1 -0
  137. package/dist/lib/config.js +93 -0
  138. package/dist/lib/config.js.map +1 -0
  139. package/dist/lib/constants.d.ts +41 -0
  140. package/dist/lib/constants.d.ts.map +1 -0
  141. package/dist/lib/constants.js +72 -0
  142. package/dist/lib/constants.js.map +1 -0
  143. package/dist/lib/index.d.ts +9 -0
  144. package/dist/lib/index.d.ts.map +1 -0
  145. package/dist/lib/index.js +9 -0
  146. package/dist/lib/index.js.map +1 -0
  147. package/dist/lib/utils.d.ts +17 -0
  148. package/dist/lib/utils.d.ts.map +1 -0
  149. package/dist/lib/utils.js +20 -0
  150. package/dist/lib/utils.js.map +1 -0
  151. package/dist/types/index.d.ts +572 -0
  152. package/dist/types/index.d.ts.map +1 -0
  153. package/dist/types/index.js +11 -0
  154. package/dist/types/index.js.map +1 -0
  155. package/package.json +2 -6
@@ -0,0 +1,572 @@
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
+ /** Read-only mode - hides chat input when true (default: false) */
222
+ read_only?: boolean;
223
+ /** Additional CSS classes */
224
+ className?: string;
225
+ }
226
+ /**
227
+ * Props for HazoChatHeader component
228
+ */
229
+ export interface HazoChatHeaderProps {
230
+ title?: string;
231
+ subtitle?: string;
232
+ on_close?: () => void;
233
+ on_refresh?: () => void;
234
+ is_refreshing?: boolean;
235
+ on_toggle_sidebar?: () => void;
236
+ is_sidebar_open?: boolean;
237
+ /** Show sidebar toggle button (hamburger menu) - default: false */
238
+ show_sidebar_toggle?: boolean;
239
+ className?: string;
240
+ }
241
+ /**
242
+ * Props for HazoChatSidebar component
243
+ */
244
+ export interface HazoChatSidebarProps {
245
+ is_open: boolean;
246
+ on_close: () => void;
247
+ className?: string;
248
+ children?: ReactNode;
249
+ }
250
+ /**
251
+ * Props for HazoChatReferenceList component
252
+ */
253
+ export interface HazoChatReferenceListProps {
254
+ references: ChatReferenceItem[];
255
+ selected_reference_id?: string;
256
+ on_select: (reference: ChatReferenceItem) => void;
257
+ className?: string;
258
+ }
259
+ /**
260
+ * Props for HazoChatDocumentViewer component
261
+ */
262
+ export interface HazoChatDocumentViewerProps {
263
+ reference?: ChatReferenceItem;
264
+ className?: string;
265
+ }
266
+ /**
267
+ * Props for HazoChatMessages component
268
+ */
269
+ export interface HazoChatMessagesProps {
270
+ messages: ChatMessage[];
271
+ current_user_id: string;
272
+ timezone: string;
273
+ is_loading: boolean;
274
+ has_more: boolean;
275
+ on_load_more: () => void;
276
+ on_delete_message: (message_id: string) => void;
277
+ on_mark_as_read?: (message_id: string) => void;
278
+ on_scroll_to_message?: (message_id: string) => void;
279
+ highlighted_message_id?: string;
280
+ /** Show delete button on chat bubbles - default: true */
281
+ show_delete_button?: boolean;
282
+ /** Bubble border radius style - default: 'default' */
283
+ bubble_radius?: 'default' | 'full';
284
+ className?: string;
285
+ }
286
+ /**
287
+ * Props for HazoChatInput component
288
+ */
289
+ export interface HazoChatInputProps {
290
+ on_send: (message: string, attachments: UploadedFile[]) => void;
291
+ pending_attachments: PendingAttachment[];
292
+ on_add_attachment: (files: File[]) => void;
293
+ on_remove_attachment: (attachment_id: string) => void;
294
+ is_disabled?: boolean;
295
+ placeholder?: string;
296
+ className?: string;
297
+ }
298
+ /**
299
+ * Props for HazoChatAttachmentPreview component
300
+ */
301
+ export interface HazoChatAttachmentPreviewProps {
302
+ attachments: PendingAttachment[];
303
+ on_remove: (attachment_id: string) => void;
304
+ className?: string;
305
+ }
306
+ /**
307
+ * Props for ChatBubble component
308
+ */
309
+ export interface ChatBubbleProps {
310
+ message: ChatMessage;
311
+ is_sender: boolean;
312
+ sender_profile?: HazoUserProfile;
313
+ timezone: string;
314
+ on_delete?: () => void;
315
+ on_reference_click?: (reference: ChatReferenceItem) => void;
316
+ is_highlighted?: boolean;
317
+ /** Show delete button on chat bubbles - default: true */
318
+ show_delete_button?: boolean;
319
+ /** Bubble border radius style - default: 'default' */
320
+ bubble_radius?: 'default' | 'full';
321
+ className?: string;
322
+ }
323
+ /**
324
+ * Props for LoadingSkeleton component
325
+ */
326
+ export interface LoadingSkeletonProps {
327
+ type: 'message' | 'reference' | 'viewer';
328
+ count?: number;
329
+ className?: string;
330
+ }
331
+ /**
332
+ * State for HazoChatContext
333
+ */
334
+ export interface HazoChatContextState {
335
+ /** Current authenticated user */
336
+ current_user: HazoUserProfile | null;
337
+ /** Selected reference to display in viewer */
338
+ selected_reference: ChatReferenceItem | null;
339
+ /** ID of message to scroll to and highlight */
340
+ highlighted_message_id: string | null;
341
+ /** Pending file attachments */
342
+ pending_attachments: PendingAttachment[];
343
+ /** Whether sidebar is open (mobile) */
344
+ is_sidebar_open: boolean;
345
+ /** Polling connection status */
346
+ polling_status: PollingStatus;
347
+ /** All references from messages and props */
348
+ all_references: ChatReferenceItem[];
349
+ /** Error message if any */
350
+ error_message: string | null;
351
+ }
352
+ /**
353
+ * Actions for HazoChatContext
354
+ */
355
+ export interface HazoChatContextActions {
356
+ set_selected_reference: (reference: ChatReferenceItem | null) => void;
357
+ set_highlighted_message_id: (message_id: string | null) => void;
358
+ add_pending_attachment: (file: File) => void;
359
+ remove_pending_attachment: (attachment_id: string) => void;
360
+ update_pending_attachment: (attachment_id: string, updates: Partial<PendingAttachment>) => void;
361
+ clear_pending_attachments: () => void;
362
+ toggle_sidebar: () => void;
363
+ set_sidebar_open: (is_open: boolean) => void;
364
+ set_error_message: (message: string | null) => void;
365
+ add_reference: (reference: ChatReferenceItem) => void;
366
+ }
367
+ /**
368
+ * Full HazoChatContext value
369
+ */
370
+ export interface HazoChatContextValue extends HazoChatContextState, HazoChatContextActions {
371
+ /** Logger instance from hazo_logs/ui */
372
+ logger: ClientLogger;
373
+ }
374
+ /**
375
+ * Real-time update mode
376
+ * - 'polling': Automatic polling at configured interval
377
+ * - 'manual': Only update when user triggers refresh
378
+ * - 'websocket': (Future) WebSocket-based real-time updates
379
+ * - 'sse': (Future) Server-Sent Events-based updates
380
+ */
381
+ export type RealtimeMode = 'polling' | 'manual' | 'websocket' | 'sse';
382
+ /**
383
+ * Connection status for real-time updates
384
+ */
385
+ export type PollingStatus = 'connected' | 'reconnecting' | 'error';
386
+ /**
387
+ * Event types that can be received from real-time transport
388
+ */
389
+ export type TransportEventType = 'message_created' | 'message_updated' | 'message_deleted' | 'message_read' | 'typing_started' | 'typing_stopped';
390
+ /**
391
+ * Event payload from real-time transport
392
+ */
393
+ export interface TransportEvent {
394
+ type: TransportEventType;
395
+ payload: ChatMessageDB | {
396
+ message_id: string;
397
+ user_id: string;
398
+ };
399
+ timestamp: string;
400
+ }
401
+ /**
402
+ * Callback for handling transport events
403
+ */
404
+ export type TransportEventHandler = (event: TransportEvent) => void;
405
+ /**
406
+ * Abstract transport interface for real-time communication
407
+ *
408
+ * Implement this interface to add new transport types (WebSocket, SSE, etc.)
409
+ *
410
+ * @example
411
+ * ```typescript
412
+ * class WebSocketTransport implements RealtimeTransport {
413
+ * private ws: WebSocket | null = null;
414
+ *
415
+ * async connect(url: string, options: TransportOptions): Promise<void> {
416
+ * this.ws = new WebSocket(url);
417
+ * // ... setup handlers
418
+ * }
419
+ *
420
+ * async disconnect(): Promise<void> {
421
+ * this.ws?.close();
422
+ * }
423
+ *
424
+ * // ... other methods
425
+ * }
426
+ * ```
427
+ */
428
+ export interface RealtimeTransport {
429
+ /** Connect to the real-time service */
430
+ connect(url: string, options: TransportOptions): Promise<void>;
431
+ /** Disconnect from the real-time service */
432
+ disconnect(): Promise<void>;
433
+ /** Check if currently connected */
434
+ isConnected(): boolean;
435
+ /** Get current connection status */
436
+ getStatus(): PollingStatus;
437
+ /** Subscribe to events for a specific chat group */
438
+ subscribe(chat_group_id: string, reference_id?: string, handler?: TransportEventHandler): void;
439
+ /** Unsubscribe from events */
440
+ unsubscribe(): void;
441
+ /** Register a handler for status changes */
442
+ onStatusChange(handler: (status: PollingStatus) => void): void;
443
+ /** Register a handler for new messages */
444
+ onMessage(handler: (messages: ChatMessageDB[]) => void): void;
445
+ }
446
+ /**
447
+ * Options for configuring a transport
448
+ */
449
+ export interface TransportOptions {
450
+ /** Authentication token or credentials */
451
+ auth_token?: string;
452
+ /** Reconnection settings */
453
+ reconnect?: {
454
+ enabled: boolean;
455
+ max_attempts: number;
456
+ base_delay: number;
457
+ };
458
+ /** Heartbeat/ping interval in ms */
459
+ heartbeat_interval?: number;
460
+ }
461
+ /**
462
+ * Return type for useChatMessages hook
463
+ */
464
+ export interface UseChatMessagesReturn {
465
+ messages: ChatMessage[];
466
+ is_loading: boolean;
467
+ is_loading_more: boolean;
468
+ has_more: boolean;
469
+ error: string | null;
470
+ polling_status: PollingStatus;
471
+ load_more: () => void;
472
+ send_message: (payload: CreateMessagePayload) => Promise<boolean>;
473
+ delete_message: (message_id: string) => Promise<boolean>;
474
+ mark_as_read: (message_id: string) => Promise<void>;
475
+ refresh: () => void;
476
+ }
477
+ /**
478
+ * Return type for useChatReferences hook
479
+ */
480
+ export interface UseChatReferencesReturn {
481
+ references: ChatReferenceItem[];
482
+ selected_reference: ChatReferenceItem | null;
483
+ select_reference: (reference: ChatReferenceItem) => void;
484
+ clear_selection: () => void;
485
+ add_reference: (reference: ChatReferenceItem) => void;
486
+ get_message_for_reference: (reference_id: string) => string | null;
487
+ }
488
+ /**
489
+ * Return type for useFileUpload hook
490
+ */
491
+ export interface UseFileUploadReturn {
492
+ pending_attachments: PendingAttachment[];
493
+ add_files: (files: File[]) => void;
494
+ remove_file: (attachment_id: string) => void;
495
+ upload_all: () => Promise<UploadedFile[]>;
496
+ clear_all: () => void;
497
+ is_uploading: boolean;
498
+ validation_errors: string[];
499
+ }
500
+ /**
501
+ * Chat configuration from hazo_chat_config.ini
502
+ */
503
+ export interface ChatConfig {
504
+ polling_interval: number;
505
+ messages_per_page: number;
506
+ }
507
+ /**
508
+ * Upload configuration from hazo_chat_config.ini
509
+ */
510
+ export interface UploadConfig {
511
+ max_file_size_mb: number;
512
+ allowed_types: string[];
513
+ }
514
+ /**
515
+ * Full configuration object
516
+ */
517
+ export interface HazoChatConfig {
518
+ chat: ChatConfig;
519
+ uploads: UploadConfig;
520
+ }
521
+ /**
522
+ * Pagination metadata returned in list responses
523
+ */
524
+ export interface PaginationInfo {
525
+ limit: number;
526
+ has_more: boolean;
527
+ next_cursor: string | null;
528
+ prev_cursor: string | null;
529
+ }
530
+ /**
531
+ * Response from GET /api/hazo_chat/messages
532
+ */
533
+ export interface MessagesApiResponse {
534
+ success: boolean;
535
+ messages?: ChatMessageDB[];
536
+ current_user_id?: string;
537
+ error?: string;
538
+ pagination?: PaginationInfo;
539
+ }
540
+ /**
541
+ * Response from POST /api/hazo_chat/messages
542
+ */
543
+ export interface SendMessageApiResponse {
544
+ success: boolean;
545
+ message?: ChatMessageDB;
546
+ error?: string;
547
+ }
548
+ /**
549
+ * Response from DELETE /api/hazo_chat/messages/[id]
550
+ */
551
+ export interface DeleteMessageApiResponse {
552
+ success: boolean;
553
+ message?: ChatMessageDB;
554
+ error?: string;
555
+ }
556
+ /**
557
+ * Response from PATCH /api/hazo_chat/messages/[id]/read
558
+ */
559
+ export interface MarkAsReadApiResponse {
560
+ success: boolean;
561
+ message?: ChatMessageDB;
562
+ error?: string;
563
+ }
564
+ /**
565
+ * Response from /api/hazo_auth/profiles
566
+ */
567
+ export interface ProfilesApiResponse {
568
+ success: boolean;
569
+ profiles?: HazoUserProfile[];
570
+ error?: string;
571
+ }
572
+ //# 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;CACh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;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;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.5",
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": {
@@ -75,8 +76,6 @@
75
76
  "date-fns-tz": "^3.1.3",
76
77
  "hazo_config": "^1.0.0",
77
78
  "hazo_pdf": "^1.0.0",
78
- "react": "^18.0.0",
79
- "react-dom": "^18.0.0",
80
79
  "react-icons": "^5.3.0",
81
80
  "tailwind-merge": "^2.5.4"
82
81
  },
@@ -100,9 +99,6 @@
100
99
  "hazo_connect": {
101
100
  "optional": true
102
101
  },
103
- "hazo_logs": {
104
- "optional": true
105
- },
106
102
  "next": {
107
103
  "optional": false
108
104
  }