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.
- package/dist/api/index.d.ts +41 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +40 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/messages.d.ts +85 -0
- package/dist/api/messages.d.ts.map +1 -0
- package/dist/api/messages.js +626 -0
- package/dist/api/messages.js.map +1 -0
- package/dist/api/types.d.ts +134 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +8 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/unread_count.d.ts +82 -0
- package/dist/api/unread_count.d.ts.map +1 -0
- package/dist/api/unread_count.js +111 -0
- package/dist/api/unread_count.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat.d.ts +28 -0
- package/dist/components/hazo_chat/hazo_chat.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat.js +230 -0
- package/dist/components/hazo_chat/hazo_chat.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts +17 -0
- package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_attachment_preview.js +60 -0
- package/dist/components/hazo_chat/hazo_chat_attachment_preview.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_context.d.ts +46 -0
- package/dist/components/hazo_chat/hazo_chat_context.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_context.js +277 -0
- package/dist/components/hazo_chat/hazo_chat_context.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts +15 -0
- package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_document_viewer.js +140 -0
- package/dist/components/hazo_chat/hazo_chat_document_viewer.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_header.d.ts +16 -0
- package/dist/components/hazo_chat/hazo_chat_header.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_header.js +45 -0
- package/dist/components/hazo_chat/hazo_chat_header.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_input.d.ts +16 -0
- package/dist/components/hazo_chat/hazo_chat_input.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_input.js +75 -0
- package/dist/components/hazo_chat/hazo_chat_input.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_messages.d.ts +18 -0
- package/dist/components/hazo_chat/hazo_chat_messages.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_messages.js +255 -0
- package/dist/components/hazo_chat/hazo_chat_messages.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts +16 -0
- package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_reference_list.js +59 -0
- package/dist/components/hazo_chat/hazo_chat_reference_list.js.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts +18 -0
- package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts.map +1 -0
- package/dist/components/hazo_chat/hazo_chat_sidebar.js +72 -0
- package/dist/components/hazo_chat/hazo_chat_sidebar.js.map +1 -0
- package/dist/components/hazo_chat/index.d.ts +16 -0
- package/dist/components/hazo_chat/index.d.ts.map +1 -0
- package/dist/components/hazo_chat/index.js +19 -0
- package/dist/components/hazo_chat/index.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +11 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +28 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +16 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +36 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +47 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/chat_bubble.d.ts +18 -0
- package/dist/components/ui/chat_bubble.d.ts.map +1 -0
- package/dist/components/ui/chat_bubble.js +130 -0
- package/dist/components/ui/chat_bubble.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +13 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +17 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/index.d.ts +19 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +21 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input.d.ts +11 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +18 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/loading_skeleton.d.ts +19 -0
- package/dist/components/ui/loading_skeleton.d.ts.map +1 -0
- package/dist/components/ui/loading_skeleton.js +30 -0
- package/dist/components/ui/loading_skeleton.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +12 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +25 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/separator.d.ts +11 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +18 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +9 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +16 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +14 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +30 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use_chat_messages.d.ts +38 -0
- package/dist/hooks/use_chat_messages.d.ts.map +1 -0
- package/dist/hooks/use_chat_messages.js +584 -0
- package/dist/hooks/use_chat_messages.js.map +1 -0
- package/dist/hooks/use_chat_references.d.ts +17 -0
- package/dist/hooks/use_chat_references.d.ts.map +1 -0
- package/dist/hooks/use_chat_references.js +133 -0
- package/dist/hooks/use_chat_references.js.map +1 -0
- package/dist/hooks/use_file_upload.d.ts +26 -0
- package/dist/hooks/use_file_upload.d.ts.map +1 -0
- package/dist/hooks/use_file_upload.js +216 -0
- package/dist/hooks/use_file_upload.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +41 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +93 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +41 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +72 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +9 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/utils.d.ts +17 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +20 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/types/index.d.ts +570 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hazo_chat API Module
|
|
3
|
+
*
|
|
4
|
+
* Provides exportable API route handlers for Next.js applications.
|
|
5
|
+
* These handlers can be imported and re-exported in your API routes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // app/api/hazo_chat/messages/route.ts
|
|
10
|
+
* import { createMessagesHandler } from 'hazo_chat/api';
|
|
11
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
12
|
+
*
|
|
13
|
+
* export const dynamic = 'force-dynamic';
|
|
14
|
+
*
|
|
15
|
+
* const { GET, POST } = createMessagesHandler({
|
|
16
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* export { GET, POST };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // app/api/hazo_chat/messages/[id]/route.ts
|
|
25
|
+
* import { createDeleteHandler } from 'hazo_chat/api';
|
|
26
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
27
|
+
*
|
|
28
|
+
* export const dynamic = 'force-dynamic';
|
|
29
|
+
*
|
|
30
|
+
* const { DELETE } = createDeleteHandler({
|
|
31
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* export { DELETE };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export { createMessagesHandler, createMarkAsReadHandler, createDeleteHandler, } from './messages.js';
|
|
38
|
+
export { createUnreadCountFunction } from './unread_count.js';
|
|
39
|
+
export type { MessagesHandlerOptions, ChatMessageInput, ChatMessageRecord, ApiErrorResponse, ApiSuccessResponse, PaginationMeta, } from './types.js';
|
|
40
|
+
export type { UnreadCountFunctionOptions, UnreadCountResult } from './unread_count.js';
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hazo_chat API Module
|
|
3
|
+
*
|
|
4
|
+
* Provides exportable API route handlers for Next.js applications.
|
|
5
|
+
* These handlers can be imported and re-exported in your API routes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // app/api/hazo_chat/messages/route.ts
|
|
10
|
+
* import { createMessagesHandler } from 'hazo_chat/api';
|
|
11
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
12
|
+
*
|
|
13
|
+
* export const dynamic = 'force-dynamic';
|
|
14
|
+
*
|
|
15
|
+
* const { GET, POST } = createMessagesHandler({
|
|
16
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* export { GET, POST };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // app/api/hazo_chat/messages/[id]/route.ts
|
|
25
|
+
* import { createDeleteHandler } from 'hazo_chat/api';
|
|
26
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
27
|
+
*
|
|
28
|
+
* export const dynamic = 'force-dynamic';
|
|
29
|
+
*
|
|
30
|
+
* const { DELETE } = createDeleteHandler({
|
|
31
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* export { DELETE };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
// Export handler factories
|
|
38
|
+
export { createMessagesHandler, createMarkAsReadHandler, createDeleteHandler, } from './messages.js';
|
|
39
|
+
export { createUnreadCountFunction } from './unread_count.js';
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,2BAA2B;AAC3B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages API Handler Factory
|
|
3
|
+
*
|
|
4
|
+
* Creates GET, POST, and DELETE handlers for the /api/hazo_chat/messages endpoint.
|
|
5
|
+
* These handlers should be used in a Next.js API route.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // app/api/hazo_chat/messages/route.ts
|
|
10
|
+
* import { createMessagesHandler } from 'hazo_chat/api';
|
|
11
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
12
|
+
*
|
|
13
|
+
* export const dynamic = 'force-dynamic';
|
|
14
|
+
*
|
|
15
|
+
* const { GET, POST } = createMessagesHandler({
|
|
16
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* export { GET, POST };
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
23
|
+
import type { MessagesHandlerOptions } from './types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Creates GET and POST handlers for chat messages
|
|
26
|
+
*
|
|
27
|
+
* @param options - Configuration options
|
|
28
|
+
* @returns Object with GET and POST handlers
|
|
29
|
+
*/
|
|
30
|
+
export declare function createMessagesHandler(options: MessagesHandlerOptions): {
|
|
31
|
+
GET: (request: NextRequest) => Promise<NextResponse>;
|
|
32
|
+
POST: (request: NextRequest) => Promise<NextResponse>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Creates a PATCH handler for marking a message as read
|
|
36
|
+
*
|
|
37
|
+
* This handler should be used in a Next.js API route like:
|
|
38
|
+
* /api/hazo_chat/messages/[id]/read/route.ts
|
|
39
|
+
*
|
|
40
|
+
* @param options - Configuration options
|
|
41
|
+
* @returns PATCH handler function
|
|
42
|
+
*/
|
|
43
|
+
export declare function createMarkAsReadHandler(options: MessagesHandlerOptions): {
|
|
44
|
+
PATCH: (request: NextRequest, context: {
|
|
45
|
+
params: {
|
|
46
|
+
id: string;
|
|
47
|
+
} | Promise<{
|
|
48
|
+
id: string;
|
|
49
|
+
}>;
|
|
50
|
+
}) => Promise<NextResponse>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Creates a DELETE handler for soft-deleting a message
|
|
54
|
+
*
|
|
55
|
+
* This handler should be used in a Next.js API route like:
|
|
56
|
+
* /api/hazo_chat/messages/[id]/route.ts
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // app/api/hazo_chat/messages/[id]/route.ts
|
|
61
|
+
* import { createDeleteHandler } from 'hazo_chat/api';
|
|
62
|
+
* import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
|
|
63
|
+
*
|
|
64
|
+
* export const dynamic = 'force-dynamic';
|
|
65
|
+
*
|
|
66
|
+
* const { DELETE } = createDeleteHandler({
|
|
67
|
+
* getHazoConnect: () => getHazoConnectSingleton()
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* export { DELETE };
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param options - Configuration options
|
|
74
|
+
* @returns DELETE handler function
|
|
75
|
+
*/
|
|
76
|
+
export declare function createDeleteHandler(options: MessagesHandlerOptions): {
|
|
77
|
+
DELETE: (request: NextRequest, context: {
|
|
78
|
+
params: {
|
|
79
|
+
id: string;
|
|
80
|
+
} | Promise<{
|
|
81
|
+
id: string;
|
|
82
|
+
}>;
|
|
83
|
+
}) => Promise<NextResponse>;
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/api/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKxD,OAAO,KAAK,EAAE,sBAAsB,EAAkG,MAAM,YAAY,CAAC;AA2FzJ;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB;mBAevC,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;oBA2KlC,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;EAiJjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB;qBAa1D,WAAW,WACX;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,KAC5D,OAAO,CAAC,YAAY,CAAC;EA2IzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB;sBActD,WAAW,WACX;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,KAC5D,OAAO,CAAC,YAAY,CAAC;EAgIzB"}
|