@onlive.ai/common-121 0.2.66 → 0.2.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/components/asset/asset-modal-portal.cjs +550 -0
- package/components/asset/asset-modal-portal.d.cts +22 -0
- package/components/asset/asset-modal-portal.d.ts +22 -0
- package/components/asset/asset-modal-portal.js +550 -0
- package/components/asset/asset.cjs +3536 -0
- package/components/asset/asset.d.cts +37 -0
- package/components/asset/asset.d.ts +37 -0
- package/components/asset/asset.js +3536 -0
- package/components/asset/asset.loaders.cjs +2 -0
- package/components/asset/asset.loaders.d.cts +17 -0
- package/components/asset/asset.loaders.d.ts +17 -0
- package/components/asset/asset.loaders.js +2 -0
- package/components/asset/asset.renderer.cjs +2292 -0
- package/components/asset/asset.renderer.d.cts +29 -0
- package/components/asset/asset.renderer.d.ts +29 -0
- package/components/asset/asset.renderer.js +2292 -0
- package/components/asset/asset.styles.cjs +683 -0
- package/components/asset/asset.styles.d.cts +6 -0
- package/components/asset/asset.styles.d.ts +6 -0
- package/components/asset/asset.styles.js +683 -0
- package/components/asset/asset.types.cjs +2 -0
- package/components/asset/asset.types.d.cts +103 -0
- package/components/asset/asset.types.d.ts +103 -0
- package/components/asset/asset.types.js +1 -0
- package/components/asset/index.cjs +3536 -0
- package/components/asset/index.d.cts +8 -0
- package/components/asset/index.d.ts +8 -0
- package/components/asset/index.js +3536 -0
- package/components/player/player.cjs +2044 -0
- package/components/player/player.d.cts +25 -0
- package/components/player/player.d.ts +25 -0
- package/components/player/player.js +2044 -0
- package/components/player/player.styles.cjs +16 -0
- package/components/player/player.styles.d.cts +6 -0
- package/components/player/player.styles.d.ts +6 -0
- package/components/player/player.styles.js +16 -0
- package/components/side-bar/index.cjs +3185 -0
- package/components/side-bar/index.d.cts +11 -0
- package/components/side-bar/index.d.ts +11 -0
- package/components/side-bar/index.js +3185 -0
- package/components/side-bar/side-bar.cjs +3185 -0
- package/components/side-bar/side-bar.d.cts +83 -0
- package/components/side-bar/side-bar.d.ts +83 -0
- package/components/side-bar/side-bar.js +3185 -0
- package/components/side-bar/side-bar.styles.cjs +801 -0
- package/components/side-bar/side-bar.styles.d.cts +6 -0
- package/components/side-bar/side-bar.styles.d.ts +6 -0
- package/components/side-bar/side-bar.styles.js +801 -0
- package/components/side-bar/side-bar.types.cjs +2 -0
- package/components/side-bar/side-bar.types.d.cts +105 -0
- package/components/side-bar/side-bar.types.d.ts +105 -0
- package/components/side-bar/side-bar.types.js +2 -0
- package/components/upload/index.cjs +83 -0
- package/components/upload/index.d.cts +4 -0
- package/components/upload/index.d.ts +4 -0
- package/components/upload/index.js +83 -0
- package/components/upload/upload.cjs +83 -0
- package/components/upload/upload.d.cts +28 -0
- package/components/upload/upload.d.ts +28 -0
- package/components/upload/upload.js +83 -0
- package/components/upload/upload.styles.cjs +65 -0
- package/components/upload/upload.styles.d.cts +6 -0
- package/components/upload/upload.styles.d.ts +6 -0
- package/components/upload/upload.styles.js +65 -0
- package/components/upload/upload.types.cjs +2 -0
- package/components/upload/upload.types.d.cts +16 -0
- package/components/upload/upload.types.d.ts +16 -0
- package/components/upload/upload.types.js +1 -0
- package/index.cjs +4677 -0
- package/index.d.cts +338 -0
- package/index.d.ts +338 -0
- package/index.js +4677 -0
- package/package.json +32 -11
- package/react/components/asset/Asset.cjs +2 -0
- package/react/components/asset/Asset.d.cts +33 -0
- package/react/components/asset/Asset.d.ts +33 -0
- package/react/components/asset/Asset.jsx +2 -0
- package/react/components/side-bar/SideBar.cjs +2 -0
- package/react/components/side-bar/SideBar.d.cts +37 -0
- package/react/components/side-bar/SideBar.d.ts +37 -0
- package/react/components/side-bar/SideBar.jsx +2 -0
- package/react/components/upload/Upload.cjs +2 -0
- package/react/components/upload/Upload.d.cts +23 -0
- package/react/components/upload/Upload.d.ts +23 -0
- package/react/components/upload/Upload.jsx +2 -0
- package/services/audio.service.cjs +2 -2
- package/services/audio.service.d.cts +1 -0
- package/services/audio.service.d.ts +1 -0
- package/services/audio.service.js +2 -2
- package/services/conversation/conversation.service.cjs +2 -0
- package/services/conversation/conversation.service.d.cts +533 -0
- package/services/conversation/conversation.service.d.ts +533 -0
- package/services/conversation/conversation.service.js +2 -0
- package/services/conversation/conversation.types.cjs +2 -0
- package/services/conversation/conversation.types.d.cts +519 -0
- package/services/conversation/conversation.types.d.ts +519 -0
- package/services/conversation/conversation.types.js +2 -0
- package/services/conversation/index.cjs +2 -0
- package/services/conversation/index.d.cts +7 -0
- package/services/conversation/index.d.ts +7 -0
- package/services/conversation/index.js +2 -0
- package/services/faqs/faqs.service.cjs +2 -0
- package/services/faqs/faqs.service.d.cts +16 -0
- package/services/faqs/faqs.service.d.ts +16 -0
- package/services/faqs/faqs.service.js +2 -0
- package/services/faqs/faqs.types.cjs +2 -0
- package/services/faqs/faqs.types.d.cts +60 -0
- package/services/faqs/faqs.types.d.ts +60 -0
- package/services/faqs/faqs.types.js +1 -0
- package/services/faqs/index.cjs +2 -0
- package/services/faqs/index.d.cts +3 -0
- package/services/faqs/index.d.ts +3 -0
- package/services/faqs/index.js +2 -0
- package/services/file/file.service.cjs +2 -0
- package/services/file/file.service.d.cts +66 -0
- package/services/file/file.service.d.ts +66 -0
- package/services/file/file.service.js +2 -0
- package/services/file/file.types.cjs +2 -0
- package/services/file/file.types.d.cts +72 -0
- package/services/file/file.types.d.ts +72 -0
- package/services/file/file.types.js +1 -0
- package/services/file/index.cjs +2 -0
- package/services/file/index.d.cts +3 -0
- package/services/file/index.d.ts +3 -0
- package/services/file/index.js +2 -0
- package/services/firebase/firebase-api.cjs +2 -2
- package/services/firebase/firebase-api.d.cts +25 -9
- package/services/firebase/firebase-api.d.ts +25 -9
- package/services/firebase/firebase-api.js +2 -2
- package/services/multimedia/config.example.cjs +2 -0
- package/services/multimedia/config.example.d.cts +13 -0
- package/services/multimedia/config.example.d.ts +13 -0
- package/services/multimedia/config.example.js +2 -0
- package/services/multimedia/index.cjs +2 -0
- package/services/multimedia/index.d.cts +3 -0
- package/services/multimedia/index.d.ts +3 -0
- package/services/multimedia/index.js +2 -0
- package/services/multimedia/multimedia.service.cjs +2 -0
- package/services/multimedia/multimedia.service.d.cts +28 -0
- package/services/multimedia/multimedia.service.d.ts +28 -0
- package/services/multimedia/multimedia.service.js +2 -0
- package/services/multimedia/multimedia.types.cjs +2 -0
- package/services/multimedia/multimedia.types.d.cts +65 -0
- package/services/multimedia/multimedia.types.d.ts +65 -0
- package/services/multimedia/multimedia.types.js +1 -0
- package/services/product/index.cjs +2 -0
- package/services/product/index.d.cts +3 -0
- package/services/product/index.d.ts +3 -0
- package/services/product/index.js +2 -0
- package/services/product/product.service.cjs +2 -0
- package/services/product/product.service.d.cts +19 -0
- package/services/product/product.service.d.ts +19 -0
- package/services/product/product.service.js +2 -0
- package/services/product/product.types.cjs +2 -0
- package/services/product/product.types.d.cts +78 -0
- package/services/product/product.types.d.ts +78 -0
- package/services/product/product.types.js +1 -0
- package/services/request.provider.cjs +1 -1
- package/services/request.provider.d.cts +1 -0
- package/services/request.provider.d.ts +1 -0
- package/services/request.provider.js +1 -1
- package/services/session.service.cjs +2 -0
- package/services/session.service.d.cts +70 -0
- package/services/session.service.d.ts +70 -0
- package/services/session.service.js +2 -0
- package/services/upload/index.cjs +2 -0
- package/services/upload/index.d.cts +2 -0
- package/services/upload/index.d.ts +2 -0
- package/services/upload/index.js +2 -0
- package/services/upload/upload.service.cjs +2 -0
- package/services/upload/upload.service.d.cts +81 -0
- package/services/upload/upload.service.d.ts +81 -0
- package/services/upload/upload.service.js +2 -0
- package/themes/dark.cjs +4 -1
- package/themes/dark.d.cts +1 -0
- package/themes/dark.d.ts +1 -0
- package/themes/dark.js +4 -1
- package/themes/light.cjs +1 -1
- package/themes/light.d.cts +1 -0
- package/themes/light.d.ts +1 -0
- package/themes/light.js +1 -1
- package/types/globals.cjs +2 -0
- package/types/globals.d.cts +39 -0
- package/types/globals.d.ts +39 -0
- package/types/globals.js +1 -0
- package/types/tracking-options.cjs +2 -2
- package/types/tracking-options.d.cts +8 -6
- package/types/tracking-options.d.ts +8 -6
- package/types/tracking-options.js +1 -1
- package/utils/adopt-styles.cjs +2 -2
- package/utils/adopt-styles.d.cts +1 -0
- package/utils/adopt-styles.d.ts +1 -0
- package/utils/adopt-styles.js +2 -2
- package/utils/browser-preferences.cjs +2 -2
- package/utils/browser-preferences.d.cts +1 -0
- package/utils/browser-preferences.d.ts +1 -0
- package/utils/browser-preferences.js +2 -2
- package/utils/classify-media.cjs +1 -1
- package/utils/classify-media.d.cts +1 -0
- package/utils/classify-media.d.ts +1 -0
- package/utils/classify-media.js +1 -1
- package/utils/decorators.cjs +1 -1
- package/utils/decorators.d.cts +1 -0
- package/utils/decorators.d.ts +1 -0
- package/utils/decorators.js +1 -1
- package/utils/detected-lang.cjs +2 -2
- package/utils/detected-lang.d.cts +1 -0
- package/utils/detected-lang.d.ts +1 -0
- package/utils/detected-lang.js +2 -2
- package/utils/fullscreen.cjs +2 -2
- package/utils/fullscreen.d.cts +6 -5
- package/utils/fullscreen.d.ts +6 -5
- package/utils/fullscreen.js +2 -2
- package/utils/insert-script.cjs +1 -1
- package/utils/insert-script.d.cts +1 -0
- package/utils/insert-script.d.ts +1 -0
- package/utils/insert-script.js +1 -1
- package/utils/is-map-compatible.cjs +1 -1
- package/utils/is-map-compatible.d.cts +1 -0
- package/utils/is-map-compatible.d.ts +1 -0
- package/utils/is-map-compatible.js +1 -1
- package/utils/markdown.cjs +2 -2
- package/utils/markdown.d.cts +1 -0
- package/utils/markdown.d.ts +1 -0
- package/utils/markdown.js +2 -2
- package/utils/merge.cjs +2 -2
- package/utils/merge.d.cts +2 -1
- package/utils/merge.d.ts +2 -1
- package/utils/merge.js +2 -2
- package/utils/multiband-track-volume.cjs +2 -2
- package/utils/multiband-track-volume.d.cts +1 -0
- package/utils/multiband-track-volume.d.ts +1 -0
- package/utils/multiband-track-volume.js +2 -2
- package/utils/onlive-url-params.cjs +1 -1
- package/utils/onlive-url-params.d.cts +1 -0
- package/utils/onlive-url-params.d.ts +1 -0
- package/utils/onlive-url-params.js +1 -1
- package/utils/pretty-distance.cjs +2 -2
- package/utils/pretty-distance.d.cts +2 -1
- package/utils/pretty-distance.d.ts +2 -1
- package/utils/pretty-distance.js +2 -2
- package/utils/pretty-time.cjs +2 -0
- package/utils/pretty-time.d.cts +16 -0
- package/utils/pretty-time.d.ts +16 -0
- package/utils/pretty-time.js +2 -0
- package/utils/random-string.cjs +1 -1
- package/utils/random-string.d.cts +1 -0
- package/utils/random-string.d.ts +1 -0
- package/utils/random-string.js +1 -1
- package/utils/resource-type.cjs +1 -1
- package/utils/resource-type.d.cts +1 -0
- package/utils/resource-type.d.ts +1 -0
- package/utils/resource-type.js +1 -1
- package/utils/round-number.cjs +2 -0
- package/utils/round-number.d.cts +30 -0
- package/utils/round-number.d.ts +30 -0
- package/utils/round-number.js +2 -0
- package/utils/safe-html.cjs +2 -2
- package/utils/safe-html.d.cts +4 -3
- package/utils/safe-html.d.ts +4 -3
- package/utils/safe-html.js +2 -2
- package/utils/sanitize.cjs +2 -2
- package/utils/sanitize.d.cts +1 -0
- package/utils/sanitize.d.ts +1 -0
- package/utils/sanitize.js +2 -2
- package/utils/spread.cjs +2 -2
- package/utils/spread.d.cts +1 -0
- package/utils/spread.d.ts +1 -0
- package/utils/spread.js +2 -2
- package/utils/watch.cjs +1 -1
- package/utils/watch.d.cts +1 -0
- package/utils/watch.d.ts +1 -0
- package/utils/watch.js +1 -1
- package/services/firebase/firebase.service.cjs +0 -2
- package/services/firebase/firebase.service.d.cts +0 -40
- package/services/firebase/firebase.service.d.ts +0 -40
- package/services/firebase/firebase.service.js +0 -2
- package/services/livekit.service.cjs +0 -2
- package/services/livekit.service.d.cts +0 -217
- package/services/livekit.service.d.ts +0 -217
- package/services/livekit.service.js +0 -2
- package/types/window-context.cjs +0 -2
- package/types/window-context.d.cts +0 -8
- package/types/window-context.d.ts +0 -8
- package/types/window-context.js +0 -1
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
import { ReceivedChatMessage } from '@livekit/components-core';
|
|
3
|
+
import { Participant, RoomOptions as RoomOptions$1, Room } from 'livekit-client';
|
|
4
|
+
import { FirebaseConfig } from '../firebase/firebase-api.cjs';
|
|
5
|
+
import 'firebase/database';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extended Room options that wrap LiveKit's room configuration.
|
|
9
|
+
*
|
|
10
|
+
* @property {boolean} [adaptiveStream] - Enable adaptive streaming for video tracks.
|
|
11
|
+
* @property {boolean} [dynacast] - Enable dynamic broadcasting optimization.
|
|
12
|
+
*/
|
|
13
|
+
interface RoomOptions extends Partial<RoomOptions$1> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Extended Room class with additional metadata properties.
|
|
17
|
+
*
|
|
18
|
+
* @property {string} id - Unique identifier of the room.
|
|
19
|
+
* @property {string} groupId - Group identifier for room categorization.
|
|
20
|
+
* @property {string} createdAt - ISO timestamp when the room was created.
|
|
21
|
+
* @property {string} connectedAt - ISO timestamp when the user connected to the room.
|
|
22
|
+
*/
|
|
23
|
+
interface ExtendedRoom extends Room {
|
|
24
|
+
id: string;
|
|
25
|
+
groupId: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
connectedAt: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Room API response structure from the backend.
|
|
31
|
+
*
|
|
32
|
+
* @property {string} id - Room unique identifier.
|
|
33
|
+
* @property {string} groupId - Group identifier for room categorization.
|
|
34
|
+
* @property {string} token - Authentication token for room access.
|
|
35
|
+
* @property {string} wsURL - WebSocket URL for real-time connection.
|
|
36
|
+
* @property {string} createdAt - ISO timestamp of room creation.
|
|
37
|
+
*/
|
|
38
|
+
type RoomApiResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
groupId: string;
|
|
41
|
+
token: string;
|
|
42
|
+
wsURL: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Room list item structure for room listings.
|
|
47
|
+
*
|
|
48
|
+
* @property {string} id - Room unique identifier.
|
|
49
|
+
* @property {string} [name] - Optional room display name.
|
|
50
|
+
* @property {string} [groupId] - Group identifier.
|
|
51
|
+
* @property {string} [organizationId] - Organization that owns the room.
|
|
52
|
+
* @property {string | null} [endedAt] - Timestamp when room ended, null if active.
|
|
53
|
+
* @property {string} createdAt - Room creation timestamp.
|
|
54
|
+
* @property {string} updatedAt - Last update timestamp.
|
|
55
|
+
* @property {ApiMessage[]} [messages] - Array of messages in the room.
|
|
56
|
+
* @property {Record<string, unknown>} [metadata] - Additional room metadata.
|
|
57
|
+
* @property {"active" | "ended" | "pending"} [status] - Current room status.
|
|
58
|
+
* @property {number} [messageCount] - Total number of messages.
|
|
59
|
+
* @property {Array<ParticipantInfo>} participants - Room participants.
|
|
60
|
+
* @property {Array<EvaluationInfo>} evaluations - Room evaluations/ratings.
|
|
61
|
+
* @property {number} [participantCount] - Total participant count.
|
|
62
|
+
* @property {number} [evaluationCount] - Total evaluation count.
|
|
63
|
+
* @property {CountInfo} [_count] - Aggregated counts.
|
|
64
|
+
*/
|
|
65
|
+
type RoomListItem = {
|
|
66
|
+
id: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
groupId?: string;
|
|
69
|
+
organizationId?: string;
|
|
70
|
+
endedAt?: string | null;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
messages?: ApiMessage[];
|
|
74
|
+
metadata?: Record<string, unknown>;
|
|
75
|
+
status?: "active" | "ended" | "pending";
|
|
76
|
+
messageCount?: number;
|
|
77
|
+
participants: Array<{
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
role: "user" | "agent" | "assistant";
|
|
81
|
+
externalId?: string;
|
|
82
|
+
image?: string;
|
|
83
|
+
isAgent?: boolean;
|
|
84
|
+
isLocal?: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
evaluations: Array<{
|
|
87
|
+
id: string;
|
|
88
|
+
rating: number;
|
|
89
|
+
comment?: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
}>;
|
|
92
|
+
participantCount?: number;
|
|
93
|
+
evaluationCount?: number;
|
|
94
|
+
_count?: {
|
|
95
|
+
messages?: number;
|
|
96
|
+
participants?: number;
|
|
97
|
+
evaluations?: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Paginated response for room listings.
|
|
102
|
+
*
|
|
103
|
+
* @property {RoomListItem[]} items - Array of room items.
|
|
104
|
+
* @property {number} count - Total number of items.
|
|
105
|
+
* @property {number} limit - Maximum items per page.
|
|
106
|
+
* @property {number} offset - Current page offset.
|
|
107
|
+
*/
|
|
108
|
+
type RoomsApiResponse = {
|
|
109
|
+
items: RoomListItem[];
|
|
110
|
+
count: number;
|
|
111
|
+
limit: number;
|
|
112
|
+
offset: number;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Participant information with extended user details.
|
|
116
|
+
*
|
|
117
|
+
* @property {string} id - User unique identifier.
|
|
118
|
+
* @property {"user" | "agent" | "assistant"} role - User's role in the conversation.
|
|
119
|
+
* @property {string} [avatar] - URL to user's avatar image.
|
|
120
|
+
* @property {string} [name] - Display name of the user.
|
|
121
|
+
*/
|
|
122
|
+
interface UserFrom extends Participant {
|
|
123
|
+
id: string;
|
|
124
|
+
role: "user" | "agent" | "assistant";
|
|
125
|
+
avatar?: string;
|
|
126
|
+
name?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* User API response after registration.
|
|
130
|
+
*
|
|
131
|
+
* @property {string} id - User unique identifier.
|
|
132
|
+
* @property {string} externalId - External system identifier.
|
|
133
|
+
* @property {string} organizationId - Associated organization ID.
|
|
134
|
+
* @property {string} role - User's assigned role.
|
|
135
|
+
* @property {string} token - Authentication token.
|
|
136
|
+
*/
|
|
137
|
+
type UserApiResponse = {
|
|
138
|
+
id: string;
|
|
139
|
+
externalId: string;
|
|
140
|
+
organizationId: string;
|
|
141
|
+
role: string;
|
|
142
|
+
token: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Agent data for registration.
|
|
146
|
+
*
|
|
147
|
+
* @property {string} name - Agent display name.
|
|
148
|
+
* @property {string} [avatar] - URL to agent's avatar.
|
|
149
|
+
* @property {string} [email] - Agent email address.
|
|
150
|
+
*/
|
|
151
|
+
interface AgentData {
|
|
152
|
+
name: string;
|
|
153
|
+
avatar?: string;
|
|
154
|
+
email?: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Asset attached to a message.
|
|
158
|
+
*
|
|
159
|
+
* @property {string} assetType - Type of asset (product, multimedia, faq, file).
|
|
160
|
+
* @property {string} assetExternalId - External identifier for the asset.
|
|
161
|
+
*/
|
|
162
|
+
interface Assets {
|
|
163
|
+
assetType: string;
|
|
164
|
+
assetExternalId: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Media attachment structure.
|
|
168
|
+
*
|
|
169
|
+
* @property {string} url - URL of the media file.
|
|
170
|
+
* @property {string} ext - File extension.
|
|
171
|
+
* @property {string} [name] - Optional name of the file.
|
|
172
|
+
* @property {string} [type] - Optional media type.
|
|
173
|
+
*/
|
|
174
|
+
interface MediaAttachment {
|
|
175
|
+
name?: string;
|
|
176
|
+
url: string;
|
|
177
|
+
ext: string;
|
|
178
|
+
type?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Report information for a message.
|
|
182
|
+
*
|
|
183
|
+
* @property {string} id - Unique identifier of the report.
|
|
184
|
+
* @property {string} createdAt - ISO timestamp of report creation.
|
|
185
|
+
*/
|
|
186
|
+
interface ReportInfo {
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* API message structure extending LiveKit's received chat message.
|
|
192
|
+
*
|
|
193
|
+
* @property {"standard" | "system"} [type] - Message type classification.
|
|
194
|
+
* @property {string} content - Text content of the message.
|
|
195
|
+
* @property {string} createdAt - ISO timestamp of message creation.
|
|
196
|
+
* @property {UserFrom} [from] - Sender information.
|
|
197
|
+
* @property {Array<MediaAttachment>} [media] - Attached media files.
|
|
198
|
+
* @property {Array<Assets>} [assets] - Attached assets.
|
|
199
|
+
* @property {Array<ReportInfo>} [reports] - Message reports/flags.
|
|
200
|
+
*/
|
|
201
|
+
type ApiMessage = Omit<ReceivedChatMessage, "type"> & {
|
|
202
|
+
type?: "standard" | "system";
|
|
203
|
+
content: string;
|
|
204
|
+
createdAt: string;
|
|
205
|
+
from?: UserFrom;
|
|
206
|
+
media?: MediaAttachment[];
|
|
207
|
+
assets?: Assets[];
|
|
208
|
+
reports?: ReportInfo[];
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Paginated response for messages.
|
|
212
|
+
*
|
|
213
|
+
* @property {ApiMessage[]} items - Array of messages.
|
|
214
|
+
* @property {number} count - Total message count.
|
|
215
|
+
* @property {number} limit - Maximum items per page.
|
|
216
|
+
* @property {number} offset - Current page offset.
|
|
217
|
+
*/
|
|
218
|
+
type MessagesApiResponse = {
|
|
219
|
+
items: ApiMessage[];
|
|
220
|
+
count: number;
|
|
221
|
+
limit: number;
|
|
222
|
+
offset: number;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Typing indicator event structure.
|
|
226
|
+
*
|
|
227
|
+
* @property {"typing"} type - Event type identifier.
|
|
228
|
+
* @property {boolean} isTyping - Whether the participant is currently typing.
|
|
229
|
+
* @property {number} timestamp - Unix timestamp of the event.
|
|
230
|
+
* @property {string} participantId - Identifier of the typing participant.
|
|
231
|
+
*/
|
|
232
|
+
interface TypingIndicator {
|
|
233
|
+
type: "typing";
|
|
234
|
+
isTyping: boolean;
|
|
235
|
+
timestamp: number;
|
|
236
|
+
participantId: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Available contextual event names.
|
|
240
|
+
*/
|
|
241
|
+
type ContextualEventNames = "call_ended" | "interrupt";
|
|
242
|
+
/**
|
|
243
|
+
* Contextual event structure for signaling state changes.
|
|
244
|
+
*
|
|
245
|
+
* @property {ContextualEventNames} eventName - Name of the event.
|
|
246
|
+
* @property {Record<string, unknown>} [eventData] - Additional event data.
|
|
247
|
+
* @property {boolean} [generateResponse] - Whether to trigger AI response.
|
|
248
|
+
*/
|
|
249
|
+
interface ContextualEvent {
|
|
250
|
+
eventName: ContextualEventNames;
|
|
251
|
+
eventData?: Record<string, unknown>;
|
|
252
|
+
generateResponse?: boolean;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Call request structure stored in Firebase.
|
|
256
|
+
*
|
|
257
|
+
* @property {string} guestId - Identifier of the guest requesting the call.
|
|
258
|
+
* @property {string} agentId - Identifier of the assigned agent.
|
|
259
|
+
* @property {string} roomName - Name of the room for the call.
|
|
260
|
+
* @property {string} startedAt - ISO timestamp when call started.
|
|
261
|
+
* @property {string | null} endedAt - ISO timestamp when call ended, null if active.
|
|
262
|
+
*/
|
|
263
|
+
interface Call {
|
|
264
|
+
guestId: string;
|
|
265
|
+
agentId: string;
|
|
266
|
+
roomName: string;
|
|
267
|
+
startedAt: string;
|
|
268
|
+
endedAt: string | null;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Request status for call/room requests.
|
|
272
|
+
*/
|
|
273
|
+
type RequestStatus = "pending" | "accepted" | "cancelled" | "not_response" | "disconnected";
|
|
274
|
+
/**
|
|
275
|
+
* Call request structure for real-time request handling.
|
|
276
|
+
*
|
|
277
|
+
* @property {string} guestId - Identifier of the requesting guest.
|
|
278
|
+
* @property {string} [name] - Display name of the guest.
|
|
279
|
+
* @property {string} createdAt - ISO timestamp of request creation.
|
|
280
|
+
* @property {string} [roomId] - Associated room identifier.
|
|
281
|
+
* @property {RequestStatus} status - Current request status.
|
|
282
|
+
* @property {string | null} assignedAgentId - ID of assigned agent, null if unassigned.
|
|
283
|
+
* @property {string} id - Unique request identifier.
|
|
284
|
+
*/
|
|
285
|
+
interface CallRequest {
|
|
286
|
+
guestId: string;
|
|
287
|
+
name?: string;
|
|
288
|
+
createdAt: string;
|
|
289
|
+
roomId?: string;
|
|
290
|
+
status: RequestStatus;
|
|
291
|
+
assignedAgentId?: string;
|
|
292
|
+
id: string;
|
|
293
|
+
userGroupId?: string;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Room sync notification data structure.
|
|
297
|
+
*
|
|
298
|
+
* @property {boolean} needsSync - Whether the room needs synchronization.
|
|
299
|
+
* @property {string} [reason] - Reason for the sync request.
|
|
300
|
+
* @property {number} [timestamp] - Unix timestamp of the sync event.
|
|
301
|
+
*/
|
|
302
|
+
interface RoomSyncData {
|
|
303
|
+
needsSync: boolean;
|
|
304
|
+
reason?: string;
|
|
305
|
+
timestamp?: number;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* New room request notification data.
|
|
309
|
+
*
|
|
310
|
+
* @property {Object} requestingUser - Information about the requesting user.
|
|
311
|
+
* @property {string} requestingUser.id - User identifier.
|
|
312
|
+
* @property {string} requestingUser.name - User display name.
|
|
313
|
+
* @property {string} requestingUser.role - User role.
|
|
314
|
+
* @property {number} timestamp - Request timestamp.
|
|
315
|
+
* @property {string} [status] - Current request status.
|
|
316
|
+
*/
|
|
317
|
+
interface NewRoomRequestData {
|
|
318
|
+
requestingUser: {
|
|
319
|
+
id: string;
|
|
320
|
+
name: string;
|
|
321
|
+
role: string;
|
|
322
|
+
};
|
|
323
|
+
timestamp: number;
|
|
324
|
+
status?: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Options for creating a new room.
|
|
328
|
+
*
|
|
329
|
+
* @property {string} language - Preferred language code (e.g., "en", "es").
|
|
330
|
+
* @property {string} timezone - IANA timezone identifier.
|
|
331
|
+
* @property {Record<string, unknown>} [affinity] - Agent affinity preferences.
|
|
332
|
+
* @property {boolean} [disablePersistence] - Disable message persistence.
|
|
333
|
+
* @property {Record<string, unknown>} [metadata] - Additional room metadata.
|
|
334
|
+
* @property {ContextualEvent[]} [contextualEvents] - Initial contextual events.
|
|
335
|
+
*/
|
|
336
|
+
type CreateRoomOptions = {
|
|
337
|
+
language: string;
|
|
338
|
+
timezone: string;
|
|
339
|
+
affinity?: Record<string, unknown>;
|
|
340
|
+
disablePersistence?: boolean;
|
|
341
|
+
metadata?: Record<string, unknown>;
|
|
342
|
+
contextualEvents?: ContextualEvent[];
|
|
343
|
+
userGroupId?: string;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Options for fetching messages.
|
|
347
|
+
*
|
|
348
|
+
* @property {string} [roomId] - Filter by room ID.
|
|
349
|
+
* @property {number} [limit] - Maximum messages to return.
|
|
350
|
+
* @property {string} [orderBy] - Field to order by.
|
|
351
|
+
* @property {"asc" | "desc"} [orderDir] - Sort direction.
|
|
352
|
+
* @property {string} [groupId] - Filter by group ID.
|
|
353
|
+
* @property {Object} [affinity] - Agent affinity filters.
|
|
354
|
+
* @property {string[]} [with] - Related entities to include.
|
|
355
|
+
* @property {boolean} [impersonate] - Enable impersonation mode.
|
|
356
|
+
*/
|
|
357
|
+
type GetMessagesOptions = {
|
|
358
|
+
roomId?: string;
|
|
359
|
+
limit?: number;
|
|
360
|
+
orderBy?: string;
|
|
361
|
+
orderDir?: "asc" | "desc";
|
|
362
|
+
groupId?: string;
|
|
363
|
+
affinity?: {
|
|
364
|
+
agentId?: string;
|
|
365
|
+
agentType?: string;
|
|
366
|
+
};
|
|
367
|
+
with?: string[];
|
|
368
|
+
impersonate?: boolean;
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* Options for persisting a message.
|
|
372
|
+
*
|
|
373
|
+
* @property {string} [externalId] - External message identifier.
|
|
374
|
+
* @property {string} roomId - Room to persist message in.
|
|
375
|
+
* @property {string} content - Message content.
|
|
376
|
+
* @property {string} [identity] - Sender identity.
|
|
377
|
+
* @property {number} [kind] - Participant kind.
|
|
378
|
+
*/
|
|
379
|
+
type PersistMessageOptions = {
|
|
380
|
+
externalId?: string;
|
|
381
|
+
roomId: string;
|
|
382
|
+
content: string;
|
|
383
|
+
identity?: string;
|
|
384
|
+
kind?: number;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Options for room evaluation/rating.
|
|
388
|
+
*
|
|
389
|
+
* @property {number} rating - Numeric rating value.
|
|
390
|
+
* @property {string} [comment] - Optional feedback comment.
|
|
391
|
+
* @property {string} [roomId] - Optional room identifier.
|
|
392
|
+
*/
|
|
393
|
+
type EvaluateRoomOptions = {
|
|
394
|
+
rating: number;
|
|
395
|
+
comment?: string;
|
|
396
|
+
roomId?: string;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Options for message reporting.
|
|
400
|
+
*
|
|
401
|
+
* @property {string} messageId - ID of message to report.
|
|
402
|
+
*/
|
|
403
|
+
type MessageReportOptions = {
|
|
404
|
+
messageId: string;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Options for updating message reactions.
|
|
408
|
+
*
|
|
409
|
+
* @property {string} messageId - ID of message to update.
|
|
410
|
+
* @property {string[]} [add] - Reactions to add.
|
|
411
|
+
* @property {string[]} [remove] - Reactions to remove.
|
|
412
|
+
*/
|
|
413
|
+
type MessageReactionOptions = {
|
|
414
|
+
messageId: string;
|
|
415
|
+
add?: string[];
|
|
416
|
+
remove?: string[];
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Options for fetching room listings.
|
|
420
|
+
*
|
|
421
|
+
* @property {number} [limit] - Maximum rooms per page.
|
|
422
|
+
* @property {number} [page] - Page number (1-indexed).
|
|
423
|
+
* @property {number} [offset] - Offset for pagination.
|
|
424
|
+
* @property {"createdAt" | "updatedAt" | "lastMessageAt"} [orderBy] - Sort field.
|
|
425
|
+
* @property {"asc" | "desc"} [orderDir] - Sort direction.
|
|
426
|
+
* @property {string[]} [ids] - Filter by specific room IDs.
|
|
427
|
+
* @property {string[]} [with] - Related entities to include.
|
|
428
|
+
* @property {string[]} [count] - Fields to count.
|
|
429
|
+
* @property {string[]} [participantIds] - Filter by participant IDs.
|
|
430
|
+
* @property {string[]} [participantExternalIds] - Filter by external participant IDs.
|
|
431
|
+
* @property {string} [groupId] - Filter by group ID.
|
|
432
|
+
* @property {boolean} [hasMessages] - Filter rooms with messages.
|
|
433
|
+
* @property {boolean} [latestOnly] - Return only latest room per group.
|
|
434
|
+
* @property {boolean} [includeUnread] - Include unread message count.
|
|
435
|
+
* @property {"active" | "closed"} [roomStatus] - Filter by room status.
|
|
436
|
+
* @property {boolean} [archived] - Include archived rooms.
|
|
437
|
+
*/
|
|
438
|
+
type GetRoomsOptions = {
|
|
439
|
+
limit?: number;
|
|
440
|
+
page?: number;
|
|
441
|
+
offset?: number;
|
|
442
|
+
orderBy?: "createdAt" | "updatedAt" | "lastMessageAt";
|
|
443
|
+
orderDir?: "asc" | "desc";
|
|
444
|
+
ids?: string[];
|
|
445
|
+
with?: string[];
|
|
446
|
+
count?: string[];
|
|
447
|
+
participantIds?: string[];
|
|
448
|
+
participantExternalIds?: string[];
|
|
449
|
+
groupId?: string;
|
|
450
|
+
hasMessages?: boolean;
|
|
451
|
+
latestOnly?: boolean;
|
|
452
|
+
includeUnread?: boolean;
|
|
453
|
+
roomStatus?: "active" | "closed";
|
|
454
|
+
archived?: boolean;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Options for requesting a new room (call transfer).
|
|
458
|
+
*
|
|
459
|
+
* @property {string} originRoom - Source room ID.
|
|
460
|
+
* @property {string} language - Preferred language.
|
|
461
|
+
* @property {string} timezone - User's timezone.
|
|
462
|
+
* @property {Object} [affinity] - Agent preferences.
|
|
463
|
+
* @property {string} [name] - Display name.
|
|
464
|
+
*/
|
|
465
|
+
type RequestNewRoomOptions = {
|
|
466
|
+
originRoom: string;
|
|
467
|
+
language: string;
|
|
468
|
+
timezone: string;
|
|
469
|
+
affinity?: {
|
|
470
|
+
agentType?: string;
|
|
471
|
+
target?: string;
|
|
472
|
+
};
|
|
473
|
+
name?: string;
|
|
474
|
+
userGroupId?: string;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Configuration options for the ConversationService.
|
|
478
|
+
*
|
|
479
|
+
* @property {string} organizationId - Organization identifier.
|
|
480
|
+
* @property {string} apiUrl - Base URL for the conversation API.
|
|
481
|
+
* @property {string} [authUrl] - Optional separate auth service URL.
|
|
482
|
+
* @property {string} [channelTopic] - Custom LiveKit chat topic.
|
|
483
|
+
* @property {string} [transcriptionTopic] - Custom transcription topic.
|
|
484
|
+
* @property {string} [eventsTopic] - Custom events topic.
|
|
485
|
+
* @property {"disabled" | "server" | "client"} [messagePersistence] - Message persistence mode.
|
|
486
|
+
* @property {FirebaseConfig} [firebaseConfig] - Optional Firebase configuration for real-time features.
|
|
487
|
+
*/
|
|
488
|
+
type ConversationServiceOptions = {
|
|
489
|
+
organizationId: string;
|
|
490
|
+
apiUrl: string;
|
|
491
|
+
authUrl?: string;
|
|
492
|
+
channelTopic?: string;
|
|
493
|
+
transcriptionTopic?: string;
|
|
494
|
+
eventsTopic?: string;
|
|
495
|
+
messagePersistence?: "disabled" | "server" | "client";
|
|
496
|
+
firebaseConfig?: FirebaseConfig;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* Callback type for message listeners.
|
|
500
|
+
*/
|
|
501
|
+
type MessageListener<M = ApiMessage> = (messages: M[]) => void;
|
|
502
|
+
/**
|
|
503
|
+
* Callback type for typing indicator listeners.
|
|
504
|
+
*/
|
|
505
|
+
type TypingListener = (indicator: TypingIndicator) => void;
|
|
506
|
+
/**
|
|
507
|
+
* Callback type for call request listeners.
|
|
508
|
+
*/
|
|
509
|
+
type CallRequestListener = (id: string, request: CallRequest) => void;
|
|
510
|
+
/** Default LiveKit chat topic */
|
|
511
|
+
declare const CHAT_TOPIC: "lk.chat";
|
|
512
|
+
/** Default LiveKit transcription topic */
|
|
513
|
+
declare const TRANSCRIPTION_TOPIC: "lk.transcription";
|
|
514
|
+
/** Default LiveKit events topic */
|
|
515
|
+
declare const EVENTS_TOPIC: "lk.events";
|
|
516
|
+
/** Topic for typing indicator messages */
|
|
517
|
+
declare const TYPING_INDICATOR_TOPIC: "typing-indicator";
|
|
518
|
+
|
|
519
|
+
export { type AgentData, type ApiMessage, type Assets, CHAT_TOPIC, type Call, type CallRequest, type CallRequestListener, type ContextualEvent, type ContextualEventNames, type ConversationServiceOptions, type CreateRoomOptions, EVENTS_TOPIC, type EvaluateRoomOptions, type ExtendedRoom, type GetMessagesOptions, type GetRoomsOptions, type MediaAttachment, type MessageListener, type MessageReactionOptions, type MessageReportOptions, type MessagesApiResponse, type NewRoomRequestData, type PersistMessageOptions, type ReportInfo, type RequestNewRoomOptions, type RequestStatus, type RoomApiResponse, type RoomListItem, type RoomOptions, type RoomSyncData, type RoomsApiResponse, TRANSCRIPTION_TOPIC, TYPING_INDICATOR_TOPIC, type TypingIndicator, type TypingListener, type UserApiResponse, type UserFrom };
|