@scalemule/chat 0.0.5 → 0.0.8
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/chat.embed.global.js +1 -1
- package/dist/chat.umd.global.js +288 -12
- package/dist/{chunk-ZLMMNFZL.js → chunk-5O5YLRJL.js} +386 -16
- package/dist/chunk-GTMAK3IA.js +285 -0
- package/dist/chunk-TRCELAZQ.cjs +287 -0
- package/dist/{chunk-YDLRISR7.cjs → chunk-W2PWFS3E.cjs} +386 -15
- package/dist/element.cjs +542 -51
- package/dist/element.js +541 -50
- package/dist/index.cjs +34 -5
- package/dist/index.js +29 -4
- package/dist/react.cjs +1260 -50
- package/dist/react.js +1212 -13
- package/dist/support-widget.global.js +485 -157
- package/package.json +5 -2
- package/dist/ChatClient-BoZaTtyM.d.cts +0 -88
- package/dist/ChatClient-COmdEJ11.d.ts +0 -88
- package/dist/element.d.cts +0 -2
- package/dist/element.d.ts +0 -2
- package/dist/iframe.d.cts +0 -17
- package/dist/iframe.d.ts +0 -17
- package/dist/index.d.cts +0 -77
- package/dist/index.d.ts +0 -77
- package/dist/react.d.cts +0 -49
- package/dist/react.d.ts +0 -49
- package/dist/types-BmD7f1gV.d.cts +0 -232
- package/dist/types-BmD7f1gV.d.ts +0 -232
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
interface ChatConfig {
|
|
2
|
-
apiKey?: string;
|
|
3
|
-
embedToken?: string;
|
|
4
|
-
apiBaseUrl?: string;
|
|
5
|
-
wsUrl?: string;
|
|
6
|
-
applicationId?: string;
|
|
7
|
-
userId?: string;
|
|
8
|
-
sessionToken?: string;
|
|
9
|
-
getToken?: () => Promise<string | null>;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
reconnect?: {
|
|
12
|
-
maxRetries?: number;
|
|
13
|
-
baseDelay?: number;
|
|
14
|
-
maxDelay?: number;
|
|
15
|
-
};
|
|
16
|
-
messageCache?: {
|
|
17
|
-
maxMessages?: number;
|
|
18
|
-
maxConversations?: number;
|
|
19
|
-
};
|
|
20
|
-
offlineQueue?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface ApiResponse<T> {
|
|
23
|
-
data: T | null;
|
|
24
|
-
error: ApiError | null;
|
|
25
|
-
}
|
|
26
|
-
interface ApiError {
|
|
27
|
-
code: string;
|
|
28
|
-
message: string;
|
|
29
|
-
status: number;
|
|
30
|
-
details?: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
interface Conversation {
|
|
33
|
-
id: string;
|
|
34
|
-
conversation_type: 'direct' | 'group' | 'broadcast' | 'ephemeral' | 'large_room' | 'support';
|
|
35
|
-
name?: string;
|
|
36
|
-
created_by?: string;
|
|
37
|
-
participant_count?: number;
|
|
38
|
-
last_message_at?: string;
|
|
39
|
-
unread_count?: number;
|
|
40
|
-
last_message_preview?: string;
|
|
41
|
-
last_message_sender_id?: string;
|
|
42
|
-
counterparty_user_id?: string;
|
|
43
|
-
created_at: string;
|
|
44
|
-
participants?: Participant[];
|
|
45
|
-
}
|
|
46
|
-
interface Participant {
|
|
47
|
-
user_id: string;
|
|
48
|
-
role: string;
|
|
49
|
-
joined_at: string;
|
|
50
|
-
}
|
|
51
|
-
interface ChatMessage {
|
|
52
|
-
id: string;
|
|
53
|
-
content: string;
|
|
54
|
-
message_type: 'text' | 'image' | 'file' | 'system';
|
|
55
|
-
sender_id: string;
|
|
56
|
-
sender_type?: string;
|
|
57
|
-
sender_agent_model?: string;
|
|
58
|
-
attachments?: Attachment[];
|
|
59
|
-
reactions?: ReactionSummary[];
|
|
60
|
-
is_edited: boolean;
|
|
61
|
-
created_at: string;
|
|
62
|
-
}
|
|
63
|
-
interface ReactionSummary {
|
|
64
|
-
emoji: string;
|
|
65
|
-
count: number;
|
|
66
|
-
user_ids: string[];
|
|
67
|
-
}
|
|
68
|
-
interface Attachment {
|
|
69
|
-
file_id: string;
|
|
70
|
-
file_name: string;
|
|
71
|
-
file_size: number;
|
|
72
|
-
mime_type: string;
|
|
73
|
-
presigned_url?: string;
|
|
74
|
-
thumbnail_url?: string;
|
|
75
|
-
}
|
|
76
|
-
interface ReadStatus {
|
|
77
|
-
user_id: string;
|
|
78
|
-
last_read_at?: string;
|
|
79
|
-
}
|
|
80
|
-
interface ChatReaction {
|
|
81
|
-
id: string;
|
|
82
|
-
message_id: string;
|
|
83
|
-
user_id: string;
|
|
84
|
-
emoji: string;
|
|
85
|
-
}
|
|
86
|
-
interface PresenceMember {
|
|
87
|
-
user_id: string;
|
|
88
|
-
user_data?: unknown;
|
|
89
|
-
joined_at: string;
|
|
90
|
-
}
|
|
91
|
-
interface ChannelSettings {
|
|
92
|
-
publisher_user_ids?: string[];
|
|
93
|
-
linked_session_id?: string;
|
|
94
|
-
expires_at?: string;
|
|
95
|
-
max_participants?: number;
|
|
96
|
-
slow_mode_seconds?: number;
|
|
97
|
-
}
|
|
98
|
-
interface ChannelWithSettings {
|
|
99
|
-
id: string;
|
|
100
|
-
channel_type: string;
|
|
101
|
-
name?: string;
|
|
102
|
-
created_at: string;
|
|
103
|
-
linked_session_id?: string;
|
|
104
|
-
expires_at?: string;
|
|
105
|
-
participant_count: number;
|
|
106
|
-
}
|
|
107
|
-
interface CreateEphemeralChannelOptions {
|
|
108
|
-
linked_session_id: string;
|
|
109
|
-
name?: string;
|
|
110
|
-
ttl_minutes?: number;
|
|
111
|
-
}
|
|
112
|
-
interface CreateLargeRoomOptions {
|
|
113
|
-
name: string;
|
|
114
|
-
linked_session_id?: string;
|
|
115
|
-
max_participants?: number;
|
|
116
|
-
slow_mode_seconds?: number;
|
|
117
|
-
}
|
|
118
|
-
interface ChatEventMap {
|
|
119
|
-
connected: void;
|
|
120
|
-
disconnected: void;
|
|
121
|
-
reconnecting: {
|
|
122
|
-
attempt: number;
|
|
123
|
-
};
|
|
124
|
-
'message': {
|
|
125
|
-
message: ChatMessage;
|
|
126
|
-
conversationId: string;
|
|
127
|
-
};
|
|
128
|
-
'message:updated': {
|
|
129
|
-
message: ChatMessage;
|
|
130
|
-
conversationId: string;
|
|
131
|
-
};
|
|
132
|
-
'message:deleted': {
|
|
133
|
-
messageId: string;
|
|
134
|
-
conversationId: string;
|
|
135
|
-
};
|
|
136
|
-
'typing': {
|
|
137
|
-
userId: string;
|
|
138
|
-
conversationId: string;
|
|
139
|
-
};
|
|
140
|
-
'typing:stop': {
|
|
141
|
-
userId: string;
|
|
142
|
-
conversationId: string;
|
|
143
|
-
};
|
|
144
|
-
'presence:join': {
|
|
145
|
-
userId: string;
|
|
146
|
-
conversationId: string;
|
|
147
|
-
userData?: unknown;
|
|
148
|
-
};
|
|
149
|
-
'presence:leave': {
|
|
150
|
-
userId: string;
|
|
151
|
-
conversationId: string;
|
|
152
|
-
};
|
|
153
|
-
'presence:update': {
|
|
154
|
-
userId: string;
|
|
155
|
-
conversationId: string;
|
|
156
|
-
status: string;
|
|
157
|
-
userData?: unknown;
|
|
158
|
-
};
|
|
159
|
-
'presence:state': {
|
|
160
|
-
conversationId: string;
|
|
161
|
-
members: PresenceMember[];
|
|
162
|
-
};
|
|
163
|
-
'read': {
|
|
164
|
-
userId: string;
|
|
165
|
-
conversationId: string;
|
|
166
|
-
lastReadAt: string;
|
|
167
|
-
};
|
|
168
|
-
'reaction': {
|
|
169
|
-
reaction: ChatReaction;
|
|
170
|
-
conversationId: string;
|
|
171
|
-
};
|
|
172
|
-
'room_upgraded': {
|
|
173
|
-
conversationId: string;
|
|
174
|
-
newType: 'large_room';
|
|
175
|
-
};
|
|
176
|
-
'delivery': {
|
|
177
|
-
messageId: string;
|
|
178
|
-
status: 'sent' | 'delivered' | 'read';
|
|
179
|
-
};
|
|
180
|
-
'inbox:update': {
|
|
181
|
-
conversationId: string;
|
|
182
|
-
messageId: string;
|
|
183
|
-
senderId: string;
|
|
184
|
-
preview: string;
|
|
185
|
-
};
|
|
186
|
-
'support:new': {
|
|
187
|
-
conversationId: string;
|
|
188
|
-
visitorName?: string;
|
|
189
|
-
};
|
|
190
|
-
'support:assigned': {
|
|
191
|
-
conversationId: string;
|
|
192
|
-
visitorName?: string;
|
|
193
|
-
visitorEmail?: string;
|
|
194
|
-
};
|
|
195
|
-
'error': {
|
|
196
|
-
code: string;
|
|
197
|
-
message: string;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
201
|
-
interface SendMessageOptions {
|
|
202
|
-
content: string;
|
|
203
|
-
message_type?: 'text' | 'image' | 'file';
|
|
204
|
-
attachments?: Attachment[];
|
|
205
|
-
}
|
|
206
|
-
interface ListConversationsOptions {
|
|
207
|
-
page?: number;
|
|
208
|
-
per_page?: number;
|
|
209
|
-
conversation_type?: 'direct' | 'group' | 'broadcast' | 'ephemeral' | 'large_room' | 'support';
|
|
210
|
-
}
|
|
211
|
-
interface UnreadTotalResponse {
|
|
212
|
-
unread_conversations: number;
|
|
213
|
-
unread_messages: number;
|
|
214
|
-
}
|
|
215
|
-
interface GetMessagesOptions {
|
|
216
|
-
limit?: number;
|
|
217
|
-
before?: string;
|
|
218
|
-
after?: string;
|
|
219
|
-
}
|
|
220
|
-
interface CreateConversationOptions {
|
|
221
|
-
conversation_type?: 'direct' | 'group';
|
|
222
|
-
name?: string;
|
|
223
|
-
participant_ids: string[];
|
|
224
|
-
}
|
|
225
|
-
interface MessagesResponse {
|
|
226
|
-
messages: ChatMessage[];
|
|
227
|
-
has_more?: boolean;
|
|
228
|
-
oldest_id?: string;
|
|
229
|
-
newest_id?: string;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export type { ApiResponse as A, ChatConfig as C, GetMessagesOptions as G, ListConversationsOptions as L, MessagesResponse as M, Participant as P, ReactionSummary as R, SendMessageOptions as S, UnreadTotalResponse as U, ChatMessage as a, ConnectionStatus as b, Conversation as c, ApiError as d, Attachment as e, ChannelSettings as f, ChannelWithSettings as g, ChatEventMap as h, ChatReaction as i, CreateConversationOptions as j, CreateEphemeralChannelOptions as k, CreateLargeRoomOptions as l, PresenceMember as m, ReadStatus as n };
|
package/dist/types-BmD7f1gV.d.ts
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
interface ChatConfig {
|
|
2
|
-
apiKey?: string;
|
|
3
|
-
embedToken?: string;
|
|
4
|
-
apiBaseUrl?: string;
|
|
5
|
-
wsUrl?: string;
|
|
6
|
-
applicationId?: string;
|
|
7
|
-
userId?: string;
|
|
8
|
-
sessionToken?: string;
|
|
9
|
-
getToken?: () => Promise<string | null>;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
reconnect?: {
|
|
12
|
-
maxRetries?: number;
|
|
13
|
-
baseDelay?: number;
|
|
14
|
-
maxDelay?: number;
|
|
15
|
-
};
|
|
16
|
-
messageCache?: {
|
|
17
|
-
maxMessages?: number;
|
|
18
|
-
maxConversations?: number;
|
|
19
|
-
};
|
|
20
|
-
offlineQueue?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface ApiResponse<T> {
|
|
23
|
-
data: T | null;
|
|
24
|
-
error: ApiError | null;
|
|
25
|
-
}
|
|
26
|
-
interface ApiError {
|
|
27
|
-
code: string;
|
|
28
|
-
message: string;
|
|
29
|
-
status: number;
|
|
30
|
-
details?: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
interface Conversation {
|
|
33
|
-
id: string;
|
|
34
|
-
conversation_type: 'direct' | 'group' | 'broadcast' | 'ephemeral' | 'large_room' | 'support';
|
|
35
|
-
name?: string;
|
|
36
|
-
created_by?: string;
|
|
37
|
-
participant_count?: number;
|
|
38
|
-
last_message_at?: string;
|
|
39
|
-
unread_count?: number;
|
|
40
|
-
last_message_preview?: string;
|
|
41
|
-
last_message_sender_id?: string;
|
|
42
|
-
counterparty_user_id?: string;
|
|
43
|
-
created_at: string;
|
|
44
|
-
participants?: Participant[];
|
|
45
|
-
}
|
|
46
|
-
interface Participant {
|
|
47
|
-
user_id: string;
|
|
48
|
-
role: string;
|
|
49
|
-
joined_at: string;
|
|
50
|
-
}
|
|
51
|
-
interface ChatMessage {
|
|
52
|
-
id: string;
|
|
53
|
-
content: string;
|
|
54
|
-
message_type: 'text' | 'image' | 'file' | 'system';
|
|
55
|
-
sender_id: string;
|
|
56
|
-
sender_type?: string;
|
|
57
|
-
sender_agent_model?: string;
|
|
58
|
-
attachments?: Attachment[];
|
|
59
|
-
reactions?: ReactionSummary[];
|
|
60
|
-
is_edited: boolean;
|
|
61
|
-
created_at: string;
|
|
62
|
-
}
|
|
63
|
-
interface ReactionSummary {
|
|
64
|
-
emoji: string;
|
|
65
|
-
count: number;
|
|
66
|
-
user_ids: string[];
|
|
67
|
-
}
|
|
68
|
-
interface Attachment {
|
|
69
|
-
file_id: string;
|
|
70
|
-
file_name: string;
|
|
71
|
-
file_size: number;
|
|
72
|
-
mime_type: string;
|
|
73
|
-
presigned_url?: string;
|
|
74
|
-
thumbnail_url?: string;
|
|
75
|
-
}
|
|
76
|
-
interface ReadStatus {
|
|
77
|
-
user_id: string;
|
|
78
|
-
last_read_at?: string;
|
|
79
|
-
}
|
|
80
|
-
interface ChatReaction {
|
|
81
|
-
id: string;
|
|
82
|
-
message_id: string;
|
|
83
|
-
user_id: string;
|
|
84
|
-
emoji: string;
|
|
85
|
-
}
|
|
86
|
-
interface PresenceMember {
|
|
87
|
-
user_id: string;
|
|
88
|
-
user_data?: unknown;
|
|
89
|
-
joined_at: string;
|
|
90
|
-
}
|
|
91
|
-
interface ChannelSettings {
|
|
92
|
-
publisher_user_ids?: string[];
|
|
93
|
-
linked_session_id?: string;
|
|
94
|
-
expires_at?: string;
|
|
95
|
-
max_participants?: number;
|
|
96
|
-
slow_mode_seconds?: number;
|
|
97
|
-
}
|
|
98
|
-
interface ChannelWithSettings {
|
|
99
|
-
id: string;
|
|
100
|
-
channel_type: string;
|
|
101
|
-
name?: string;
|
|
102
|
-
created_at: string;
|
|
103
|
-
linked_session_id?: string;
|
|
104
|
-
expires_at?: string;
|
|
105
|
-
participant_count: number;
|
|
106
|
-
}
|
|
107
|
-
interface CreateEphemeralChannelOptions {
|
|
108
|
-
linked_session_id: string;
|
|
109
|
-
name?: string;
|
|
110
|
-
ttl_minutes?: number;
|
|
111
|
-
}
|
|
112
|
-
interface CreateLargeRoomOptions {
|
|
113
|
-
name: string;
|
|
114
|
-
linked_session_id?: string;
|
|
115
|
-
max_participants?: number;
|
|
116
|
-
slow_mode_seconds?: number;
|
|
117
|
-
}
|
|
118
|
-
interface ChatEventMap {
|
|
119
|
-
connected: void;
|
|
120
|
-
disconnected: void;
|
|
121
|
-
reconnecting: {
|
|
122
|
-
attempt: number;
|
|
123
|
-
};
|
|
124
|
-
'message': {
|
|
125
|
-
message: ChatMessage;
|
|
126
|
-
conversationId: string;
|
|
127
|
-
};
|
|
128
|
-
'message:updated': {
|
|
129
|
-
message: ChatMessage;
|
|
130
|
-
conversationId: string;
|
|
131
|
-
};
|
|
132
|
-
'message:deleted': {
|
|
133
|
-
messageId: string;
|
|
134
|
-
conversationId: string;
|
|
135
|
-
};
|
|
136
|
-
'typing': {
|
|
137
|
-
userId: string;
|
|
138
|
-
conversationId: string;
|
|
139
|
-
};
|
|
140
|
-
'typing:stop': {
|
|
141
|
-
userId: string;
|
|
142
|
-
conversationId: string;
|
|
143
|
-
};
|
|
144
|
-
'presence:join': {
|
|
145
|
-
userId: string;
|
|
146
|
-
conversationId: string;
|
|
147
|
-
userData?: unknown;
|
|
148
|
-
};
|
|
149
|
-
'presence:leave': {
|
|
150
|
-
userId: string;
|
|
151
|
-
conversationId: string;
|
|
152
|
-
};
|
|
153
|
-
'presence:update': {
|
|
154
|
-
userId: string;
|
|
155
|
-
conversationId: string;
|
|
156
|
-
status: string;
|
|
157
|
-
userData?: unknown;
|
|
158
|
-
};
|
|
159
|
-
'presence:state': {
|
|
160
|
-
conversationId: string;
|
|
161
|
-
members: PresenceMember[];
|
|
162
|
-
};
|
|
163
|
-
'read': {
|
|
164
|
-
userId: string;
|
|
165
|
-
conversationId: string;
|
|
166
|
-
lastReadAt: string;
|
|
167
|
-
};
|
|
168
|
-
'reaction': {
|
|
169
|
-
reaction: ChatReaction;
|
|
170
|
-
conversationId: string;
|
|
171
|
-
};
|
|
172
|
-
'room_upgraded': {
|
|
173
|
-
conversationId: string;
|
|
174
|
-
newType: 'large_room';
|
|
175
|
-
};
|
|
176
|
-
'delivery': {
|
|
177
|
-
messageId: string;
|
|
178
|
-
status: 'sent' | 'delivered' | 'read';
|
|
179
|
-
};
|
|
180
|
-
'inbox:update': {
|
|
181
|
-
conversationId: string;
|
|
182
|
-
messageId: string;
|
|
183
|
-
senderId: string;
|
|
184
|
-
preview: string;
|
|
185
|
-
};
|
|
186
|
-
'support:new': {
|
|
187
|
-
conversationId: string;
|
|
188
|
-
visitorName?: string;
|
|
189
|
-
};
|
|
190
|
-
'support:assigned': {
|
|
191
|
-
conversationId: string;
|
|
192
|
-
visitorName?: string;
|
|
193
|
-
visitorEmail?: string;
|
|
194
|
-
};
|
|
195
|
-
'error': {
|
|
196
|
-
code: string;
|
|
197
|
-
message: string;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
201
|
-
interface SendMessageOptions {
|
|
202
|
-
content: string;
|
|
203
|
-
message_type?: 'text' | 'image' | 'file';
|
|
204
|
-
attachments?: Attachment[];
|
|
205
|
-
}
|
|
206
|
-
interface ListConversationsOptions {
|
|
207
|
-
page?: number;
|
|
208
|
-
per_page?: number;
|
|
209
|
-
conversation_type?: 'direct' | 'group' | 'broadcast' | 'ephemeral' | 'large_room' | 'support';
|
|
210
|
-
}
|
|
211
|
-
interface UnreadTotalResponse {
|
|
212
|
-
unread_conversations: number;
|
|
213
|
-
unread_messages: number;
|
|
214
|
-
}
|
|
215
|
-
interface GetMessagesOptions {
|
|
216
|
-
limit?: number;
|
|
217
|
-
before?: string;
|
|
218
|
-
after?: string;
|
|
219
|
-
}
|
|
220
|
-
interface CreateConversationOptions {
|
|
221
|
-
conversation_type?: 'direct' | 'group';
|
|
222
|
-
name?: string;
|
|
223
|
-
participant_ids: string[];
|
|
224
|
-
}
|
|
225
|
-
interface MessagesResponse {
|
|
226
|
-
messages: ChatMessage[];
|
|
227
|
-
has_more?: boolean;
|
|
228
|
-
oldest_id?: string;
|
|
229
|
-
newest_id?: string;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export type { ApiResponse as A, ChatConfig as C, GetMessagesOptions as G, ListConversationsOptions as L, MessagesResponse as M, Participant as P, ReactionSummary as R, SendMessageOptions as S, UnreadTotalResponse as U, ChatMessage as a, ConnectionStatus as b, Conversation as c, ApiError as d, Attachment as e, ChannelSettings as f, ChannelWithSettings as g, ChatEventMap as h, ChatReaction as i, CreateConversationOptions as j, CreateEphemeralChannelOptions as k, CreateLargeRoomOptions as l, PresenceMember as m, ReadStatus as n };
|