mezon-js 2.15.19 → 2.15.21
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 +244 -244
- package/dist/client.d.ts +119 -177
- package/dist/index.d.ts +1 -6
- package/dist/mezon-js.cjs.js +1 -1
- package/dist/mezon-js.esm.mjs +1 -1
- package/dist/mezon-js.iife.js +1 -1
- package/dist/mezon-js.umd.js +1 -1
- package/dist/mezon-js.umd.js.map +1 -1
- package/dist/transport.d.ts +513 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{api.gen.d.ts → types.d.ts} +1188 -426
- package/package.json +71 -71
- package/dist/api.d.ts +0 -2604
- package/dist/config.d.ts +0 -13
- package/dist/socket.d.ts +0 -1194
package/dist/socket.d.ts
DELETED
|
@@ -1,1194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020 The Mezon Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { ApiChannelDescription, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiNotificationUserChannel, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook, ChannelMessage, ApiUser } from "./api";
|
|
17
|
-
import { Session } from "./session";
|
|
18
|
-
import { ClanBadgeCount, WebSocketAdapter } from "mezon-js-protobuf";
|
|
19
|
-
/** An object which represents a connected user in the server. */
|
|
20
|
-
export interface Presence {
|
|
21
|
-
/** The id of the user. */
|
|
22
|
-
user_id: string;
|
|
23
|
-
/** The session id of the user. */
|
|
24
|
-
session_id: string;
|
|
25
|
-
/** The username of the user. */
|
|
26
|
-
username: string;
|
|
27
|
-
/** The node the user is connected to. */
|
|
28
|
-
node: string;
|
|
29
|
-
/** The status of the user */
|
|
30
|
-
status: string;
|
|
31
|
-
is_mobile: boolean;
|
|
32
|
-
user_status: string;
|
|
33
|
-
}
|
|
34
|
-
export interface NotificationInfo {
|
|
35
|
-
/** Category code for this notification. */
|
|
36
|
-
code?: number;
|
|
37
|
-
/** Content of the notification in JSON. */
|
|
38
|
-
content?: {};
|
|
39
|
-
/** The UNIX time when the notification was created. */
|
|
40
|
-
create_time_seconds?: number;
|
|
41
|
-
/** ID of the Notification. */
|
|
42
|
-
id?: string;
|
|
43
|
-
/** True if this notification was persisted to the database. */
|
|
44
|
-
persistent?: boolean;
|
|
45
|
-
/** ID of the sender, if a user. Otherwise 'null'. */
|
|
46
|
-
sender_id?: string;
|
|
47
|
-
/** Subject of the notification. */
|
|
48
|
-
subject?: string;
|
|
49
|
-
channel_id?: string;
|
|
50
|
-
clan_id?: string;
|
|
51
|
-
channel?: ApiChannelDescription;
|
|
52
|
-
topic_id?: string;
|
|
53
|
-
}
|
|
54
|
-
/** A response from a channel join operation. */
|
|
55
|
-
export interface Channel {
|
|
56
|
-
/** The server-assigned channel id. */
|
|
57
|
-
id: string;
|
|
58
|
-
chanel_label: string;
|
|
59
|
-
/** The presences visible on the chat channel. */
|
|
60
|
-
presences: Presence[];
|
|
61
|
-
/** The presence of the current user, i.e. yourself. */
|
|
62
|
-
self: Presence;
|
|
63
|
-
clan_logo: string;
|
|
64
|
-
category_name: string;
|
|
65
|
-
}
|
|
66
|
-
export interface ClanJoin {
|
|
67
|
-
clan_join: {
|
|
68
|
-
clan_id: string;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
/** Join a realtime chat channel. */
|
|
72
|
-
interface ChannelJoin {
|
|
73
|
-
channel_join: {
|
|
74
|
-
/** The id of the channel to join. */
|
|
75
|
-
channel_id: string;
|
|
76
|
-
/** The name of the channel to join. */
|
|
77
|
-
channel_label: string;
|
|
78
|
-
/** The channel type: 1 = Channel, 2 = Direct Message, 3 = Group. */
|
|
79
|
-
type: number;
|
|
80
|
-
/** Whether channel messages are persisted in the database. */
|
|
81
|
-
persistence: boolean;
|
|
82
|
-
/** Whether the user's channel presence is hidden when joining. */
|
|
83
|
-
hidden: boolean;
|
|
84
|
-
is_public: boolean;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
/** Leave a realtime chat channel. */
|
|
88
|
-
interface ChannelLeave {
|
|
89
|
-
channel_leave: {
|
|
90
|
-
/** The id of the channel to leave. */
|
|
91
|
-
channel_id: string;
|
|
92
|
-
mode: number;
|
|
93
|
-
channel_label: string;
|
|
94
|
-
is_public: boolean;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export interface AddClanUserEvent {
|
|
98
|
-
clan_id: string;
|
|
99
|
-
user: UserProfile;
|
|
100
|
-
invitor: string;
|
|
101
|
-
}
|
|
102
|
-
export interface BannedUserEvent {
|
|
103
|
-
user_ids: Array<string>;
|
|
104
|
-
action: number;
|
|
105
|
-
banner_id: string;
|
|
106
|
-
channel_id: string;
|
|
107
|
-
clan_id: string;
|
|
108
|
-
ban_time: number;
|
|
109
|
-
}
|
|
110
|
-
export interface ListChannelUsersBannedEvent {
|
|
111
|
-
banned_user_ids: Array<string>;
|
|
112
|
-
}
|
|
113
|
-
export interface AiAgentEnabledEvent {
|
|
114
|
-
clan_id: string;
|
|
115
|
-
channel_id: string;
|
|
116
|
-
enabled: boolean;
|
|
117
|
-
}
|
|
118
|
-
export interface UserProfile {
|
|
119
|
-
/** User IDs to follow. */
|
|
120
|
-
user_id: string;
|
|
121
|
-
/** Username to follow. */
|
|
122
|
-
username: string;
|
|
123
|
-
/** Avatar to follow. */
|
|
124
|
-
avatar: string;
|
|
125
|
-
/** Display name */
|
|
126
|
-
display_name: string;
|
|
127
|
-
/** custom status */
|
|
128
|
-
custom_status: string;
|
|
129
|
-
/** online */
|
|
130
|
-
online: boolean;
|
|
131
|
-
create_time_second: number;
|
|
132
|
-
/** clans */
|
|
133
|
-
joined_clans: number[];
|
|
134
|
-
app_url: string;
|
|
135
|
-
is_bot: boolean;
|
|
136
|
-
}
|
|
137
|
-
/** UserChannelAddedEvent */
|
|
138
|
-
export interface UserChannelAddedEvent {
|
|
139
|
-
channel_desc: ChannelDescription;
|
|
140
|
-
users: UserProfile[];
|
|
141
|
-
status: string;
|
|
142
|
-
clan_id: string;
|
|
143
|
-
caller: UserProfile;
|
|
144
|
-
create_time_second: number;
|
|
145
|
-
active: number;
|
|
146
|
-
}
|
|
147
|
-
export interface UserChannelRemovedEvent {
|
|
148
|
-
channel_id: string;
|
|
149
|
-
user_ids: string[];
|
|
150
|
-
channel_type: number;
|
|
151
|
-
clan_id: string;
|
|
152
|
-
badge_counts: number[];
|
|
153
|
-
}
|
|
154
|
-
export interface UserClanRemovedEvent {
|
|
155
|
-
clan_id: string;
|
|
156
|
-
user_ids: string[];
|
|
157
|
-
}
|
|
158
|
-
/** Last seen message by user */
|
|
159
|
-
export interface LastPinMessageEvent {
|
|
160
|
-
/** The channel this message belongs to. */
|
|
161
|
-
channel_id: string;
|
|
162
|
-
mode: number;
|
|
163
|
-
channel_label: string;
|
|
164
|
-
/** The unique ID of this message. */
|
|
165
|
-
message_id: string;
|
|
166
|
-
/** user id */
|
|
167
|
-
user_id: string;
|
|
168
|
-
/** operation */
|
|
169
|
-
operation: number;
|
|
170
|
-
is_public: boolean;
|
|
171
|
-
clan_id: string;
|
|
172
|
-
message_sender_avatar: string;
|
|
173
|
-
message_sender_id: string;
|
|
174
|
-
message_sender_username: string;
|
|
175
|
-
message_content: string;
|
|
176
|
-
message_attachment: string;
|
|
177
|
-
message_created_time: string;
|
|
178
|
-
}
|
|
179
|
-
export interface UnmuteEvent {
|
|
180
|
-
channel_id: string;
|
|
181
|
-
category_id: string;
|
|
182
|
-
clan_id: string;
|
|
183
|
-
}
|
|
184
|
-
/** Last seen message by user */
|
|
185
|
-
export interface LastSeenMessageEvent {
|
|
186
|
-
clan_id: string;
|
|
187
|
-
/** The channel this message belongs to. */
|
|
188
|
-
channel_id: string;
|
|
189
|
-
mode: number;
|
|
190
|
-
channel_label: string;
|
|
191
|
-
/** The unique ID of this message. */
|
|
192
|
-
message_id: string;
|
|
193
|
-
badge_count: number;
|
|
194
|
-
}
|
|
195
|
-
/** User is typing */
|
|
196
|
-
export interface MessageTypingEvent {
|
|
197
|
-
/** The channel this message belongs to. */
|
|
198
|
-
channel_id: string;
|
|
199
|
-
mode: number;
|
|
200
|
-
channel_label: string;
|
|
201
|
-
/** Message sender, usually a user ID. */
|
|
202
|
-
sender_id: string;
|
|
203
|
-
is_public: boolean;
|
|
204
|
-
sender_username: string;
|
|
205
|
-
sender_display_name: string;
|
|
206
|
-
topic_id?: string;
|
|
207
|
-
}
|
|
208
|
-
export interface UserProfileUpdatedEvent {
|
|
209
|
-
user_id: string;
|
|
210
|
-
display_name: string;
|
|
211
|
-
avatar: string;
|
|
212
|
-
about_me: string;
|
|
213
|
-
channel_id: string;
|
|
214
|
-
clan_id: string;
|
|
215
|
-
encrypt_private_key: string;
|
|
216
|
-
}
|
|
217
|
-
/** An acknowledgement received in response to sending a message on a chat channel. */
|
|
218
|
-
export interface ChannelMessageAck {
|
|
219
|
-
/** The server-assigned channel ID. */
|
|
220
|
-
channel_id: string;
|
|
221
|
-
mode: number;
|
|
222
|
-
/** A unique ID for the chat message. */
|
|
223
|
-
message_id: string;
|
|
224
|
-
/** A user-defined code for the chat message. */
|
|
225
|
-
code: number;
|
|
226
|
-
/** The username of the sender of the message. */
|
|
227
|
-
username: string;
|
|
228
|
-
/** The UNIX time when the message was created. */
|
|
229
|
-
create_time: string;
|
|
230
|
-
/** The UNIX time when the message was updated. */
|
|
231
|
-
update_time: string;
|
|
232
|
-
/** True if the chat message has been stored in history. */
|
|
233
|
-
persistence: boolean;
|
|
234
|
-
}
|
|
235
|
-
/** Send a message to a realtime chat channel. */
|
|
236
|
-
interface ChannelMessageSend {
|
|
237
|
-
channel_message_send: {
|
|
238
|
-
/** Clan Id */
|
|
239
|
-
clan_id: string;
|
|
240
|
-
/** The server-assigned channel ID. */
|
|
241
|
-
channel_id: string;
|
|
242
|
-
mode: number;
|
|
243
|
-
channel_label: string;
|
|
244
|
-
/** The content payload. */
|
|
245
|
-
content: any;
|
|
246
|
-
mentions?: Array<ApiMessageMention>;
|
|
247
|
-
attachments?: Array<ApiMessageAttachment>;
|
|
248
|
-
anonymous_message?: boolean;
|
|
249
|
-
mention_everyone?: boolean;
|
|
250
|
-
avatar: string;
|
|
251
|
-
is_public: boolean;
|
|
252
|
-
code: number;
|
|
253
|
-
topic_id?: string;
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
interface TransferOwnershipEvent {
|
|
257
|
-
clan_id: string;
|
|
258
|
-
prev_owner: string;
|
|
259
|
-
curr_owner: string;
|
|
260
|
-
}
|
|
261
|
-
interface QuickMenuEvent {
|
|
262
|
-
quick_menu_event: {
|
|
263
|
-
menu_name: string;
|
|
264
|
-
message: {
|
|
265
|
-
/** Clan Id */
|
|
266
|
-
clan_id: string;
|
|
267
|
-
/** The server-assigned channel ID. */
|
|
268
|
-
channel_id: string;
|
|
269
|
-
mode: number;
|
|
270
|
-
channel_label: string;
|
|
271
|
-
/** The content payload. */
|
|
272
|
-
content: any;
|
|
273
|
-
mentions?: Array<ApiMessageMention>;
|
|
274
|
-
attachments?: Array<ApiMessageAttachment>;
|
|
275
|
-
anonymous_message?: boolean;
|
|
276
|
-
mention_everyone?: boolean;
|
|
277
|
-
avatar: string;
|
|
278
|
-
is_public: boolean;
|
|
279
|
-
code: number;
|
|
280
|
-
topic_id?: string;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
interface EphemeralMessageSend {
|
|
285
|
-
ephemeral_message_send: {
|
|
286
|
-
receiver_ids: string[];
|
|
287
|
-
message: {
|
|
288
|
-
/** Clan Id */
|
|
289
|
-
clan_id: string;
|
|
290
|
-
/** The server-assigned channel ID. */
|
|
291
|
-
channel_id: string;
|
|
292
|
-
mode: number;
|
|
293
|
-
channel_label: string;
|
|
294
|
-
/** The content payload. */
|
|
295
|
-
content: any;
|
|
296
|
-
mentions?: Array<ApiMessageMention>;
|
|
297
|
-
attachments?: Array<ApiMessageAttachment>;
|
|
298
|
-
anonymous_message?: boolean;
|
|
299
|
-
mention_everyone?: boolean;
|
|
300
|
-
avatar: string;
|
|
301
|
-
is_public: boolean;
|
|
302
|
-
code: number;
|
|
303
|
-
topic_id?: string;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
/** Update a message previously sent to a realtime chat channel. */
|
|
308
|
-
interface ChannelMessageUpdate {
|
|
309
|
-
channel_message_update: {
|
|
310
|
-
/** The server-assigned channel ID. */
|
|
311
|
-
channel_id: string;
|
|
312
|
-
/** A unique ID for the chat message to be updated. */
|
|
313
|
-
message_id: string;
|
|
314
|
-
/** The content payload. */
|
|
315
|
-
content: any;
|
|
316
|
-
/** mentions */
|
|
317
|
-
mentions?: Array<ApiMessageMention>;
|
|
318
|
-
/** attachments */
|
|
319
|
-
attachments?: Array<ApiMessageAttachment>;
|
|
320
|
-
/** The mode payload. */
|
|
321
|
-
mode: number;
|
|
322
|
-
is_public: boolean;
|
|
323
|
-
topic_id?: string;
|
|
324
|
-
is_update_msg_topic?: boolean;
|
|
325
|
-
old_mentions?: string;
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
/** Remove a message previously sent to a realtime chat channel. */
|
|
329
|
-
interface ChannelMessageRemove {
|
|
330
|
-
channel_message_remove: {
|
|
331
|
-
/** The clan id */
|
|
332
|
-
clan_id: string;
|
|
333
|
-
/** The server-assigned channel ID. */
|
|
334
|
-
channel_id: string;
|
|
335
|
-
mode: number;
|
|
336
|
-
channel_label: string;
|
|
337
|
-
/** A unique ID for the chat message to be removed. */
|
|
338
|
-
message_id: string;
|
|
339
|
-
is_public: boolean;
|
|
340
|
-
/** attachments */
|
|
341
|
-
has_attachment?: boolean;
|
|
342
|
-
topic_id?: string;
|
|
343
|
-
mentions: string;
|
|
344
|
-
references: string;
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
/** Presence update for a particular realtime chat channel. */
|
|
348
|
-
export interface ChannelPresenceEvent {
|
|
349
|
-
/** The unique identifier of the chat channel. */
|
|
350
|
-
channel_id: string;
|
|
351
|
-
channel_label: string;
|
|
352
|
-
mode: number;
|
|
353
|
-
/** Presences of the users who joined the channel. */
|
|
354
|
-
joins: Presence[];
|
|
355
|
-
/** Presences of users who left the channel. */
|
|
356
|
-
leaves: Presence[];
|
|
357
|
-
}
|
|
358
|
-
export interface VoiceEndedEvent {
|
|
359
|
-
id: string;
|
|
360
|
-
clan_id: string;
|
|
361
|
-
voice_channel_id: string;
|
|
362
|
-
}
|
|
363
|
-
export interface VoiceStartedEvent {
|
|
364
|
-
id: string;
|
|
365
|
-
clan_id: string;
|
|
366
|
-
voice_channel_id: string;
|
|
367
|
-
}
|
|
368
|
-
export interface VoiceLeavedEvent {
|
|
369
|
-
id: string;
|
|
370
|
-
clan_id: string;
|
|
371
|
-
voice_channel_id: string;
|
|
372
|
-
voice_user_id: string;
|
|
373
|
-
}
|
|
374
|
-
export interface VoiceJoinedEvent {
|
|
375
|
-
/** The unique identifier of the chat channel. */
|
|
376
|
-
clan_id: string;
|
|
377
|
-
clan_name: string;
|
|
378
|
-
id: string;
|
|
379
|
-
participant: string;
|
|
380
|
-
user_id: string;
|
|
381
|
-
voice_channel_label: string;
|
|
382
|
-
voice_channel_id: string;
|
|
383
|
-
last_screenshot: string;
|
|
384
|
-
}
|
|
385
|
-
export interface CustomStatusEvent {
|
|
386
|
-
clan_id: string;
|
|
387
|
-
user_id: string;
|
|
388
|
-
username: string;
|
|
389
|
-
status: string;
|
|
390
|
-
/** time reset */
|
|
391
|
-
time_reset: number;
|
|
392
|
-
/** no clear */
|
|
393
|
-
no_clear: boolean;
|
|
394
|
-
}
|
|
395
|
-
export interface UnpinMessageEvent {
|
|
396
|
-
id: string;
|
|
397
|
-
message_id: string;
|
|
398
|
-
channel_id: string;
|
|
399
|
-
clan_id: string;
|
|
400
|
-
}
|
|
401
|
-
export interface ChannelUpdatedEvent {
|
|
402
|
-
clan_id: string;
|
|
403
|
-
category_id: string;
|
|
404
|
-
creator_id: string;
|
|
405
|
-
parent_id: string;
|
|
406
|
-
channel_id: string;
|
|
407
|
-
channel_label: string;
|
|
408
|
-
channel_type: number;
|
|
409
|
-
status: number;
|
|
410
|
-
meeting_code: string;
|
|
411
|
-
channel_private: number;
|
|
412
|
-
is_error: boolean;
|
|
413
|
-
app_id: string;
|
|
414
|
-
e2ee: number;
|
|
415
|
-
topic: string;
|
|
416
|
-
age_restricted: number;
|
|
417
|
-
is_active_thread: boolean;
|
|
418
|
-
active: number;
|
|
419
|
-
count_mess_unread: number;
|
|
420
|
-
role_ids?: Array<string>;
|
|
421
|
-
user_ids?: Array<string>;
|
|
422
|
-
channel_avatar: string;
|
|
423
|
-
}
|
|
424
|
-
export interface DeleteAccountEvent {
|
|
425
|
-
user_id: string;
|
|
426
|
-
}
|
|
427
|
-
export interface ChannelCreatedEvent {
|
|
428
|
-
clan_id: string;
|
|
429
|
-
category_id: string;
|
|
430
|
-
creator_id: string;
|
|
431
|
-
parent_id: string;
|
|
432
|
-
channel_id: string;
|
|
433
|
-
channel_label: string;
|
|
434
|
-
channel_private: number;
|
|
435
|
-
channel_type: number;
|
|
436
|
-
status: number;
|
|
437
|
-
app_id: string;
|
|
438
|
-
clan_name: string;
|
|
439
|
-
channel_avatar: string;
|
|
440
|
-
}
|
|
441
|
-
export interface CategoryEvent {
|
|
442
|
-
clan_id: string;
|
|
443
|
-
id: string;
|
|
444
|
-
creator_id: string;
|
|
445
|
-
category_name: string;
|
|
446
|
-
status: number;
|
|
447
|
-
}
|
|
448
|
-
export interface ChannelDeletedEvent {
|
|
449
|
-
clan_id: string;
|
|
450
|
-
category_id: string;
|
|
451
|
-
channel_id: string;
|
|
452
|
-
deletor: string;
|
|
453
|
-
parent_id: string;
|
|
454
|
-
}
|
|
455
|
-
export interface StickerCreateEvent {
|
|
456
|
-
clan_id: string;
|
|
457
|
-
source: string;
|
|
458
|
-
shortname: string;
|
|
459
|
-
category: string;
|
|
460
|
-
creator_id: string;
|
|
461
|
-
sticker_id: string;
|
|
462
|
-
logo: string;
|
|
463
|
-
clan_name: string;
|
|
464
|
-
}
|
|
465
|
-
export interface StickerUpdateEvent {
|
|
466
|
-
shortname: string;
|
|
467
|
-
sticker_id: string;
|
|
468
|
-
user_id: string;
|
|
469
|
-
}
|
|
470
|
-
export interface StickerDeleteEvent {
|
|
471
|
-
sticker_id: string;
|
|
472
|
-
user_id: string;
|
|
473
|
-
}
|
|
474
|
-
export interface ClanDeletedEvent {
|
|
475
|
-
clan_id: string;
|
|
476
|
-
deletor: string;
|
|
477
|
-
}
|
|
478
|
-
export interface ClanUpdatedEvent {
|
|
479
|
-
clan_id: string;
|
|
480
|
-
clan_name: string;
|
|
481
|
-
logo: string;
|
|
482
|
-
banner: string;
|
|
483
|
-
status: number;
|
|
484
|
-
is_onboarding: boolean;
|
|
485
|
-
welcome_channel_id: string;
|
|
486
|
-
onboarding_banner: string;
|
|
487
|
-
about: string;
|
|
488
|
-
prevent_anonymous: boolean;
|
|
489
|
-
}
|
|
490
|
-
export interface ClanProfileUpdatedEvent {
|
|
491
|
-
user_id: string;
|
|
492
|
-
clan_nick: string;
|
|
493
|
-
clan_avatar: string;
|
|
494
|
-
clan_id: string;
|
|
495
|
-
}
|
|
496
|
-
export interface MeetParticipantEvent {
|
|
497
|
-
username: string;
|
|
498
|
-
room_name: string;
|
|
499
|
-
channel_id: string;
|
|
500
|
-
clan_id: string;
|
|
501
|
-
action: number;
|
|
502
|
-
}
|
|
503
|
-
export interface AllowAnonymousEvent {
|
|
504
|
-
clan_id: string;
|
|
505
|
-
allow: boolean;
|
|
506
|
-
}
|
|
507
|
-
/** Stream identifier */
|
|
508
|
-
export interface StreamId {
|
|
509
|
-
/** The type of stream (e.g. chat). */
|
|
510
|
-
mode: number;
|
|
511
|
-
/** The primary stream subject, usually a user id. */
|
|
512
|
-
subject: string;
|
|
513
|
-
/** A secondary stream subject, for example for a direct chat. */
|
|
514
|
-
descriptor: string;
|
|
515
|
-
/** Meta-information (e.g. chat room name). */
|
|
516
|
-
label: string;
|
|
517
|
-
}
|
|
518
|
-
/** Stream data. */
|
|
519
|
-
export interface StreamData {
|
|
520
|
-
/** The stream identifier. */
|
|
521
|
-
stream: StreamId;
|
|
522
|
-
/** A reference to the user presence that sent this data, if any. */
|
|
523
|
-
sender?: Presence;
|
|
524
|
-
/** Arbitrary contents of the data message. */
|
|
525
|
-
data: string;
|
|
526
|
-
/** True if this data was delivered reliably. */
|
|
527
|
-
reliable?: boolean;
|
|
528
|
-
}
|
|
529
|
-
/** Presence updates. */
|
|
530
|
-
export interface StreamPresenceEvent {
|
|
531
|
-
/** The stream identifier. */
|
|
532
|
-
stream: StreamId;
|
|
533
|
-
/** Presences of users who joined the stream. */
|
|
534
|
-
joins: Presence[];
|
|
535
|
-
/** Presences of users who left the stream. */
|
|
536
|
-
leaves: Presence[];
|
|
537
|
-
}
|
|
538
|
-
/** Execute an Lua function on the server. */
|
|
539
|
-
interface Rpc {
|
|
540
|
-
rpc: ApiRpc;
|
|
541
|
-
}
|
|
542
|
-
/** Application-level heartbeat ping. */
|
|
543
|
-
interface Ping {
|
|
544
|
-
}
|
|
545
|
-
/** A snapshot of statuses for some set of users. */
|
|
546
|
-
export interface Status {
|
|
547
|
-
/** The user presences to view statuses of. */
|
|
548
|
-
presences: Presence[];
|
|
549
|
-
}
|
|
550
|
-
/** Start receiving status updates for some set of users. */
|
|
551
|
-
interface StatusFollow {
|
|
552
|
-
/** The IDs of the users to follow. */
|
|
553
|
-
status_follow: {
|
|
554
|
-
user_ids: string[];
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
/** A batch of status updates for a given user. */
|
|
558
|
-
export interface StatusPresenceEvent {
|
|
559
|
-
/** This join information is in response to a subscription made to be notified when a user comes online. */
|
|
560
|
-
joins: Presence[];
|
|
561
|
-
/** This join information is in response to a subscription made to be notified when a user goes offline. */
|
|
562
|
-
leaves: Presence[];
|
|
563
|
-
}
|
|
564
|
-
/** Stop receiving status updates for some set of users. */
|
|
565
|
-
interface StatusUnfollow {
|
|
566
|
-
/** The IDs of user to unfollow. */
|
|
567
|
-
status_unfollow: {
|
|
568
|
-
user_ids: string[];
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
/** Set the user's own status. */
|
|
572
|
-
interface StatusUpdate {
|
|
573
|
-
/** Status string to set, if not present the user will appear offline. */
|
|
574
|
-
status_update: {
|
|
575
|
-
status?: string;
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
export interface CheckNameExistedEvent {
|
|
579
|
-
clan_name: string;
|
|
580
|
-
exist: boolean;
|
|
581
|
-
condition_id: string;
|
|
582
|
-
type: number;
|
|
583
|
-
clan_id: string;
|
|
584
|
-
}
|
|
585
|
-
/** */
|
|
586
|
-
export interface ClanSticker {
|
|
587
|
-
category?: string;
|
|
588
|
-
clan_id?: string;
|
|
589
|
-
create_time_seconds?: number;
|
|
590
|
-
creator_id?: string;
|
|
591
|
-
id?: string;
|
|
592
|
-
shortname?: string;
|
|
593
|
-
source?: string;
|
|
594
|
-
logo?: string;
|
|
595
|
-
clan_name?: string;
|
|
596
|
-
is_for_sale?: boolean;
|
|
597
|
-
}
|
|
598
|
-
export interface RoleEvent {
|
|
599
|
-
role: ApiRole;
|
|
600
|
-
status: number;
|
|
601
|
-
user_id: string;
|
|
602
|
-
user_add_ids: Array<string>;
|
|
603
|
-
user_remove_ids: Array<string>;
|
|
604
|
-
active_permission_ids: Array<string>;
|
|
605
|
-
remove_permission_ids: Array<string>;
|
|
606
|
-
}
|
|
607
|
-
export interface EventEmoji {
|
|
608
|
-
id: string;
|
|
609
|
-
clan_id: string;
|
|
610
|
-
short_name: string;
|
|
611
|
-
source: string;
|
|
612
|
-
category: string;
|
|
613
|
-
action: number;
|
|
614
|
-
user_id: string;
|
|
615
|
-
logo: string;
|
|
616
|
-
clan_name: string;
|
|
617
|
-
is_for_sale: boolean;
|
|
618
|
-
}
|
|
619
|
-
/** */
|
|
620
|
-
export interface ClanEmoji {
|
|
621
|
-
category?: string;
|
|
622
|
-
creator_id?: string;
|
|
623
|
-
id?: string;
|
|
624
|
-
shortname?: string;
|
|
625
|
-
src?: string;
|
|
626
|
-
logo?: string;
|
|
627
|
-
clan_name?: string;
|
|
628
|
-
clan_id?: string;
|
|
629
|
-
is_for_sale?: boolean;
|
|
630
|
-
}
|
|
631
|
-
/** */
|
|
632
|
-
export interface ChannelDescription {
|
|
633
|
-
clan_id?: string;
|
|
634
|
-
channel_id?: string;
|
|
635
|
-
type?: number;
|
|
636
|
-
channel_label?: string;
|
|
637
|
-
app_url?: string;
|
|
638
|
-
channel_private?: number;
|
|
639
|
-
meeting_code?: string;
|
|
640
|
-
clan_name?: string;
|
|
641
|
-
parent_id?: string;
|
|
642
|
-
last_sent_message?: ApiChannelMessageHeader;
|
|
643
|
-
}
|
|
644
|
-
export interface HashtagDm {
|
|
645
|
-
channel_id?: string;
|
|
646
|
-
channel_label?: string;
|
|
647
|
-
clan_id?: string;
|
|
648
|
-
clan_name?: string;
|
|
649
|
-
meeting_code?: string;
|
|
650
|
-
type?: number;
|
|
651
|
-
channel_private?: number;
|
|
652
|
-
parent_id?: string;
|
|
653
|
-
}
|
|
654
|
-
export interface NotificationSetting {
|
|
655
|
-
id?: string;
|
|
656
|
-
notification_setting_type?: number;
|
|
657
|
-
}
|
|
658
|
-
export interface NotificationChannelCategorySetting {
|
|
659
|
-
id: string;
|
|
660
|
-
channel_category_label: string;
|
|
661
|
-
notification_setting_type: number;
|
|
662
|
-
channel_category_title: string;
|
|
663
|
-
action: number;
|
|
664
|
-
}
|
|
665
|
-
export interface UserEmojiUsage {
|
|
666
|
-
user_id: string;
|
|
667
|
-
emoji_id: string;
|
|
668
|
-
clan_id: string;
|
|
669
|
-
create_time: string;
|
|
670
|
-
}
|
|
671
|
-
export interface AddFriend {
|
|
672
|
-
user_id: string;
|
|
673
|
-
username: string;
|
|
674
|
-
display_name: string;
|
|
675
|
-
avatar: string;
|
|
676
|
-
}
|
|
677
|
-
export interface RemoveFriend {
|
|
678
|
-
user_id: string;
|
|
679
|
-
}
|
|
680
|
-
export interface BlockFriend {
|
|
681
|
-
user_id: string;
|
|
682
|
-
}
|
|
683
|
-
export interface UnblockFriend {
|
|
684
|
-
user_id: string;
|
|
685
|
-
username: string;
|
|
686
|
-
avatar: string;
|
|
687
|
-
display_name: string;
|
|
688
|
-
status: string;
|
|
689
|
-
user_status: string;
|
|
690
|
-
}
|
|
691
|
-
export interface AddUserEmojiUsageEvent {
|
|
692
|
-
emoji_id: string;
|
|
693
|
-
clan_id: string;
|
|
694
|
-
}
|
|
695
|
-
/** Response cho ListUserEmojiUsage */
|
|
696
|
-
export interface GetUserEmojiUsageEvent {
|
|
697
|
-
clanId: string;
|
|
698
|
-
user_emoji_usage: Array<UserEmojiUsage>;
|
|
699
|
-
}
|
|
700
|
-
/** On role assign */
|
|
701
|
-
export interface RoleAssignedEvent {
|
|
702
|
-
/** The clan of this role */
|
|
703
|
-
ClanId: string;
|
|
704
|
-
/** Role ID */
|
|
705
|
-
role_id: string;
|
|
706
|
-
/** UserIds Assigned */
|
|
707
|
-
user_ids_assigned: string[];
|
|
708
|
-
/** UserIds Removed */
|
|
709
|
-
user_ids_removed: string[];
|
|
710
|
-
}
|
|
711
|
-
/** Streaming Joined event */
|
|
712
|
-
export interface StreamingLeavedEvent {
|
|
713
|
-
/** id */
|
|
714
|
-
id: string;
|
|
715
|
-
/** The unique identifier of the chat clan. */
|
|
716
|
-
clan_id: string;
|
|
717
|
-
/** streaming channel name */
|
|
718
|
-
streaming_channel_id: string;
|
|
719
|
-
/** streaming user_id */
|
|
720
|
-
streaming_user_id: string;
|
|
721
|
-
}
|
|
722
|
-
/** Streaming Joined event */
|
|
723
|
-
export interface StreamingJoinedEvent {
|
|
724
|
-
/** The unique identifier of the chat clan. */
|
|
725
|
-
clan_id: string;
|
|
726
|
-
/** The channel name */
|
|
727
|
-
clan_name: string;
|
|
728
|
-
/** id streaming */
|
|
729
|
-
id: string;
|
|
730
|
-
/** streaming participant */
|
|
731
|
-
participant: string;
|
|
732
|
-
/** user id */
|
|
733
|
-
user_id: string;
|
|
734
|
-
/** streaming channel label */
|
|
735
|
-
streaming_channel_label: string;
|
|
736
|
-
/** streaming channel id */
|
|
737
|
-
streaming_channel_id: string;
|
|
738
|
-
}
|
|
739
|
-
/** Streaming start event */
|
|
740
|
-
export interface StreamingStartedEvent {
|
|
741
|
-
/** clan id */
|
|
742
|
-
clan_id: string;
|
|
743
|
-
/** channel id */
|
|
744
|
-
channel_id: string;
|
|
745
|
-
/** stream url */
|
|
746
|
-
streaming_url: string;
|
|
747
|
-
/** status */
|
|
748
|
-
is_streaming: boolean;
|
|
749
|
-
}
|
|
750
|
-
/** Streaming start event */
|
|
751
|
-
export interface StreamingEndedEvent {
|
|
752
|
-
/** clan id */
|
|
753
|
-
clan_id: string;
|
|
754
|
-
/** channel id */
|
|
755
|
-
channel_id: string;
|
|
756
|
-
}
|
|
757
|
-
export interface ChannelAppEvent {
|
|
758
|
-
user_id: string;
|
|
759
|
-
username: string;
|
|
760
|
-
clan_id: string;
|
|
761
|
-
channel_id: string;
|
|
762
|
-
action: number;
|
|
763
|
-
}
|
|
764
|
-
export interface HandleParticipantMeetStateEvent {
|
|
765
|
-
/** clan id */
|
|
766
|
-
clan_id: string;
|
|
767
|
-
/** channel id */
|
|
768
|
-
channel_id: string;
|
|
769
|
-
/** display name */
|
|
770
|
-
display_name: string;
|
|
771
|
-
/** state (0: join, 1: leave) */
|
|
772
|
-
state: number;
|
|
773
|
-
/** room name */
|
|
774
|
-
room_name: string;
|
|
775
|
-
}
|
|
776
|
-
export interface PermissionSet {
|
|
777
|
-
/** Role ID */
|
|
778
|
-
role_id: string;
|
|
779
|
-
/** User ID */
|
|
780
|
-
user_id: string;
|
|
781
|
-
/** Channel ID */
|
|
782
|
-
channel_id: string;
|
|
783
|
-
/** List permission update */
|
|
784
|
-
permission_updates: ApiPermissionUpdate[];
|
|
785
|
-
/** */
|
|
786
|
-
caller: string;
|
|
787
|
-
}
|
|
788
|
-
export interface PermissionChangedEvent {
|
|
789
|
-
user_id: string;
|
|
790
|
-
channel_id: string;
|
|
791
|
-
add_permissions: ApiPermissionUpdate[];
|
|
792
|
-
remove_permissions: ApiPermissionUpdate[];
|
|
793
|
-
default_permissions: ApiPermissionUpdate[];
|
|
794
|
-
}
|
|
795
|
-
export interface DropdownBoxSelected {
|
|
796
|
-
message_id: string;
|
|
797
|
-
channel_id: string;
|
|
798
|
-
selectbox_id: string;
|
|
799
|
-
sender_id: string;
|
|
800
|
-
user_id: string;
|
|
801
|
-
value: Array<string>;
|
|
802
|
-
}
|
|
803
|
-
export interface MessageButtonClicked {
|
|
804
|
-
message_id: string;
|
|
805
|
-
channel_id: string;
|
|
806
|
-
button_id: string;
|
|
807
|
-
sender_id: string;
|
|
808
|
-
user_id: string;
|
|
809
|
-
extra_data: string;
|
|
810
|
-
}
|
|
811
|
-
export interface IncomingCallPush {
|
|
812
|
-
receiver_id: string;
|
|
813
|
-
json_data: string;
|
|
814
|
-
channel_id: string;
|
|
815
|
-
caller_id: string;
|
|
816
|
-
}
|
|
817
|
-
export interface VoiceReactionSend {
|
|
818
|
-
emojis: Array<string>;
|
|
819
|
-
channel_id: string;
|
|
820
|
-
sender_id: string;
|
|
821
|
-
media_type: number;
|
|
822
|
-
}
|
|
823
|
-
export interface MarkAsRead {
|
|
824
|
-
channel_id: string;
|
|
825
|
-
category_id: string;
|
|
826
|
-
clan_id: string;
|
|
827
|
-
}
|
|
828
|
-
export interface WebrtcSignalingFwd {
|
|
829
|
-
receiver_id: string;
|
|
830
|
-
data_type: number;
|
|
831
|
-
json_data: string;
|
|
832
|
-
channel_id: string;
|
|
833
|
-
caller_id: string;
|
|
834
|
-
}
|
|
835
|
-
export interface ListActivity {
|
|
836
|
-
acts: ApiUserActivity[];
|
|
837
|
-
}
|
|
838
|
-
export interface SdTopicEvent {
|
|
839
|
-
id: string;
|
|
840
|
-
clan_id: string;
|
|
841
|
-
channel_id: string;
|
|
842
|
-
message_id: string;
|
|
843
|
-
user_id: string;
|
|
844
|
-
last_sent_message?: ApiChannelMessageHeader;
|
|
845
|
-
message?: ChannelMessage;
|
|
846
|
-
}
|
|
847
|
-
export interface UserStatusEvent {
|
|
848
|
-
user_id: string;
|
|
849
|
-
custom_status: string;
|
|
850
|
-
}
|
|
851
|
-
export interface JoinChannelAppData {
|
|
852
|
-
user_id: string;
|
|
853
|
-
username: string;
|
|
854
|
-
hash: string;
|
|
855
|
-
}
|
|
856
|
-
/** */
|
|
857
|
-
export interface ChannelCanvas {
|
|
858
|
-
content?: string;
|
|
859
|
-
creator_id?: string;
|
|
860
|
-
editor_id?: string;
|
|
861
|
-
id?: string;
|
|
862
|
-
is_default?: boolean;
|
|
863
|
-
title?: string;
|
|
864
|
-
channel_id?: string;
|
|
865
|
-
status?: number;
|
|
866
|
-
}
|
|
867
|
-
export interface ApiListChannelBadgeCountRequest {
|
|
868
|
-
clan_id?: string;
|
|
869
|
-
}
|
|
870
|
-
export interface ApiListUserOnlineRequest {
|
|
871
|
-
clan_id?: string;
|
|
872
|
-
}
|
|
873
|
-
export interface ApiLogedDevice {
|
|
874
|
-
device_id?: string;
|
|
875
|
-
device_name?: string;
|
|
876
|
-
login_at_seconds?: number;
|
|
877
|
-
status?: number;
|
|
878
|
-
platform?: string;
|
|
879
|
-
ip?: string;
|
|
880
|
-
last_active_seconds?: string;
|
|
881
|
-
location?: string;
|
|
882
|
-
is_current?: boolean;
|
|
883
|
-
}
|
|
884
|
-
export interface ApiLogedDeviceList {
|
|
885
|
-
devices?: Array<ApiLogedDevice>;
|
|
886
|
-
}
|
|
887
|
-
export interface ApiLogedDeviceList {
|
|
888
|
-
}
|
|
889
|
-
export interface ApiListUserOnlineResponse {
|
|
890
|
-
users: Array<ApiUser>;
|
|
891
|
-
}
|
|
892
|
-
export interface ApiListChannelBadgeCountResponse {
|
|
893
|
-
channeldesc?: Array<ApiChannelDescription>;
|
|
894
|
-
}
|
|
895
|
-
export interface ApiListClanBadgeCountResponse {
|
|
896
|
-
list_badge?: Array<ClanBadgeCount>;
|
|
897
|
-
}
|
|
898
|
-
export interface ListDataSocket {
|
|
899
|
-
api_name?: string;
|
|
900
|
-
list_channel_badge_count_req?: ApiListChannelBadgeCountRequest;
|
|
901
|
-
channel_badge_count?: ApiListChannelBadgeCountResponse;
|
|
902
|
-
clan_badge_count?: ApiListClanBadgeCountResponse;
|
|
903
|
-
list_loged_device?: ApiLogedDeviceList;
|
|
904
|
-
list_user_online_req?: ApiListUserOnlineRequest;
|
|
905
|
-
user_online_list?: ApiListUserOnlineResponse;
|
|
906
|
-
}
|
|
907
|
-
/** A socket connection to Mezon server. */
|
|
908
|
-
export interface Socket {
|
|
909
|
-
/** Connection is Open */
|
|
910
|
-
isOpen(): boolean;
|
|
911
|
-
/** Connect to the server. */
|
|
912
|
-
connect(session: Session, createStatus: boolean, platform: string, connectTimeoutMs?: number, signal?: AbortSignal): Promise<Session>;
|
|
913
|
-
/** Disconnect from the server. */
|
|
914
|
-
disconnect(fireDisconnectEvent: boolean): void;
|
|
915
|
-
/** Subscribe to one or more users for their status updates. */
|
|
916
|
-
followUsers(user_ids: string[]): Promise<Status>;
|
|
917
|
-
/** Join clan chat */
|
|
918
|
-
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
|
919
|
-
follower(): Promise<void>;
|
|
920
|
-
/** Join a chat channel on the server. */
|
|
921
|
-
joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
|
922
|
-
/** Leave a chat channel on the server. */
|
|
923
|
-
leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
|
|
924
|
-
/** Remove a chat message from a chat channel on the server. */
|
|
925
|
-
removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
|
|
926
|
-
/** Execute an RPC function to the server. */
|
|
927
|
-
rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
|
|
928
|
-
/** Unfollow one or more users from their status updates. */
|
|
929
|
-
unfollowUsers(user_ids: string[]): Promise<void>;
|
|
930
|
-
/** Update a chat message on a chat channel in the server. */
|
|
931
|
-
updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, is_update_msg_topic?: boolean): Promise<ChannelMessageAck>;
|
|
932
|
-
/** Update the status for the current user online. */
|
|
933
|
-
updateStatus(status?: string): Promise<void>;
|
|
934
|
-
/** Send a chat message to a chat channel on the server. */
|
|
935
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string, id?: string): Promise<ChannelMessageAck>;
|
|
936
|
-
/** Send a chat message to a chat channel on the server. */
|
|
937
|
-
writeEphemeralMessage(receiver_ids: string[], clan_id: string, channel_id: string, mode: number, is_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
|
|
938
|
-
/** Send a quick menu event to a chat channel on the server. */
|
|
939
|
-
writeQuickMenuEvent(menu_name: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string, id?: string): Promise<QuickMenuEvent>;
|
|
940
|
-
/** Send message typing */
|
|
941
|
-
writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean, sender_display_name: string, topic_id?: string): Promise<MessageTypingEvent>;
|
|
942
|
-
/** Send message reaction */
|
|
943
|
-
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean, topic_id?: string, emoji_recent_id?: string, sender_name?: string): Promise<ApiMessageReaction>;
|
|
944
|
-
/** Send last seen message */
|
|
945
|
-
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
|
|
946
|
-
/** Send last pin message */
|
|
947
|
-
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number, message_sender_avatar: string, message_sender_id: string, message_sender_username: string, message_content: string, message_attachment: string, message_created_time: string): Promise<LastPinMessageEvent>;
|
|
948
|
-
/** Send custom user status */
|
|
949
|
-
writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
|
950
|
-
setHeartbeatTimeoutMs(ms: number): void;
|
|
951
|
-
getHeartbeatTimeoutMs(): number;
|
|
952
|
-
onreconnect: (evt: Event) => void;
|
|
953
|
-
checkDuplicateName(name: string, condition_id: string, type: number, clan_id: string): Promise<CheckNameExistedEvent>;
|
|
954
|
-
writeVoiceReaction: (emojis: Array<string>, channel_id: string) => Promise<VoiceReactionSend>;
|
|
955
|
-
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
|
956
|
-
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
|
957
|
-
writeChannelAppEvent: (clan_id: string, channel_id: string, action: number) => Promise<ChannelAppEvent>;
|
|
958
|
-
listDataSocket(request: ListDataSocket): Promise<any>;
|
|
959
|
-
/** Handle disconnect events received from the socket. */
|
|
960
|
-
ondisconnect: (evt: Event) => void;
|
|
961
|
-
/** Handle error events received from the socket. */
|
|
962
|
-
onerror: (evt: Event) => void;
|
|
963
|
-
/** Receive notifications from the socket. */
|
|
964
|
-
onnotification: (notification: ApiNotification) => void;
|
|
965
|
-
/** Receive status presence updates. */
|
|
966
|
-
onstatuspresence: (statusPresence: StatusPresenceEvent) => void;
|
|
967
|
-
/** Receive stream presence updates. */
|
|
968
|
-
onstreampresence: (streamPresence: StreamPresenceEvent) => void;
|
|
969
|
-
/** Receive stream data. */
|
|
970
|
-
onstreamdata: (streamData: StreamData) => void;
|
|
971
|
-
/**
|
|
972
|
-
* An application-level heartbeat timeout that fires after the client does not receive a pong from the server after the heartbeat interval.
|
|
973
|
-
* Most browsers maintain an internal heartbeat, in which case its unlikely you'll need to use this callback. However, Chrome does not implement an internal heartbeat.
|
|
974
|
-
* We fire this separately from `onclose` because heartbeats fail when there's no connectivity, and many browsers don't fire `onclose` until the closing handshake either succeeds or fails.
|
|
975
|
-
* In any case, be aware that `onclose` will still fire if there is a heartbeat timeout in a potentially delayed manner.
|
|
976
|
-
*/
|
|
977
|
-
onheartbeattimeout: () => void;
|
|
978
|
-
oncustomstatus: (statusEvent: CustomStatusEvent) => void;
|
|
979
|
-
oncanvasevent: (canvasEvent: ChannelCanvas) => void;
|
|
980
|
-
/** Receive channel message. */
|
|
981
|
-
onchannelmessage: (channelMessage: ChannelMessage) => void;
|
|
982
|
-
/** Receive typing event */
|
|
983
|
-
onmessagetyping: (messageTypingEvent: MessageTypingEvent) => void;
|
|
984
|
-
/** Receive reaction event */
|
|
985
|
-
onmessagereaction: (messageReactionEvent: ApiMessageReaction) => void;
|
|
986
|
-
/** Receive channel presence updates. */
|
|
987
|
-
onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
|
|
988
|
-
/** pin message event */
|
|
989
|
-
onpinmessage: (pin: LastPinMessageEvent) => void;
|
|
990
|
-
/** Receive added user event */
|
|
991
|
-
onuserchanneladded: (user: UserChannelAddedEvent) => void;
|
|
992
|
-
/** Receive added user clan event */
|
|
993
|
-
onuserclanadded: (user: AddClanUserEvent) => void;
|
|
994
|
-
/** Receive update user event */
|
|
995
|
-
onuserprofileupdate: (user: UserProfileUpdatedEvent) => void;
|
|
996
|
-
/** Receive channel removed user event */
|
|
997
|
-
onuserchannelremoved: (user: UserChannelRemovedEvent) => void;
|
|
998
|
-
onaddfriend: (user: AddFriend) => void;
|
|
999
|
-
onremovefriend: (user: RemoveFriend) => void;
|
|
1000
|
-
onblockfriend: (user: BlockFriend) => void;
|
|
1001
|
-
onunblockfriend: (user: UnblockFriend) => void;
|
|
1002
|
-
/** Receive clan removed user event */
|
|
1003
|
-
onuserclanremoved: (user: UserClanRemovedEvent) => void;
|
|
1004
|
-
onvoicestarted: (voice: VoiceStartedEvent) => void;
|
|
1005
|
-
onvoiceended: (voice: VoiceEndedEvent) => void;
|
|
1006
|
-
onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
|
|
1007
|
-
onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
|
|
1008
|
-
onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
|
|
1009
|
-
oncategoryevent: (categoryEvent: CategoryEvent) => void;
|
|
1010
|
-
onroleevent: (roleEvent: RoleEvent) => void;
|
|
1011
|
-
onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
|
|
1012
|
-
onstickercreated: (stickerCreated: StickerCreateEvent) => void;
|
|
1013
|
-
onstickerupdated: (stickerUpdated: StickerUpdateEvent) => void;
|
|
1014
|
-
onstickerdeleted: (stickerDeleted: StickerDeleteEvent) => void;
|
|
1015
|
-
onclandeleted: (clanDeleted: ClanDeletedEvent) => void;
|
|
1016
|
-
onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
|
|
1017
|
-
onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
|
|
1018
|
-
onclanupdated: (clan: ClanUpdatedEvent) => void;
|
|
1019
|
-
onlastseenupdated: (event: LastSeenMessageEvent) => void;
|
|
1020
|
-
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
|
1021
|
-
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
|
1022
|
-
onwebrtcsignalingfwd: (event: WebrtcSignalingFwd) => void;
|
|
1023
|
-
onvoicereactionmessage: (event: VoiceReactionSend) => void;
|
|
1024
|
-
onmarkasread: (event: MarkAsRead) => void;
|
|
1025
|
-
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
|
1026
|
-
oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
|
|
1027
|
-
oneventemoji: (event_emoji: EventEmoji) => void;
|
|
1028
|
-
oneventnotiuserchannel: (noti_user_channel: ApiNotificationUserChannel) => void;
|
|
1029
|
-
oneventwebhook: (webhook_event: ApiWebhook) => void;
|
|
1030
|
-
onroleassign: (role_assign_event: RoleAssignedEvent) => void;
|
|
1031
|
-
ondeleteaccount: (delete_account_event: DeleteAccountEvent) => void;
|
|
1032
|
-
onmeetparticipantevent: (event: MeetParticipantEvent) => void;
|
|
1033
|
-
onallowanonymousevent: (event: AllowAnonymousEvent) => void;
|
|
1034
|
-
onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
|
|
1035
|
-
onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
|
|
1036
|
-
onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
|
|
1037
|
-
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
|
1038
|
-
onpermissionset: (permission_set_event: PermissionSet) => void;
|
|
1039
|
-
onpermissionchanged: (permission_changed_event: PermissionChangedEvent) => void;
|
|
1040
|
-
onunmuteevent: (unmute_event: UnmuteEvent) => void;
|
|
1041
|
-
ontokensent: (token: ApiTokenSentEvent) => void;
|
|
1042
|
-
onactivityupdated: (list_activity: ListActivity) => void;
|
|
1043
|
-
onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
|
|
1044
|
-
onchannelappevent: (event: ChannelAppEvent) => void;
|
|
1045
|
-
onuserstatusevent: (user_status_event: UserStatusEvent) => void;
|
|
1046
|
-
onjoinchannelappevent: (join_channel_app_data: JoinChannelAppData) => void;
|
|
1047
|
-
onunpinmessageevent: (unpin_message_event: UnpinMessageEvent) => void;
|
|
1048
|
-
onquickmenuevent: (event: QuickMenuEvent) => void;
|
|
1049
|
-
ontransferownership: (event: TransferOwnershipEvent) => void;
|
|
1050
|
-
onbanneduser: (event: BannedUserEvent) => void;
|
|
1051
|
-
onlistchannelusersbanned: (event: ListChannelUsersBannedEvent) => void;
|
|
1052
|
-
onaiagentenabled: (event: AiAgentEnabledEvent) => void;
|
|
1053
|
-
}
|
|
1054
|
-
/** Reports an error received from a socket message. */
|
|
1055
|
-
export interface SocketError {
|
|
1056
|
-
/** The error code. */
|
|
1057
|
-
code: number;
|
|
1058
|
-
/** A message in English to help developers debug the response. */
|
|
1059
|
-
message: string;
|
|
1060
|
-
}
|
|
1061
|
-
export declare const ConnectionState: {
|
|
1062
|
-
readonly DISCONNECTED: "disconnected";
|
|
1063
|
-
readonly CONNECTING: "connecting";
|
|
1064
|
-
readonly CONNECTED: "connected";
|
|
1065
|
-
};
|
|
1066
|
-
export type ConnectionStateType = typeof ConnectionState[keyof typeof ConnectionState];
|
|
1067
|
-
export declare class DefaultSocket implements Socket {
|
|
1068
|
-
readonly host: string;
|
|
1069
|
-
readonly port: string;
|
|
1070
|
-
readonly useSSL: boolean;
|
|
1071
|
-
verbose: boolean;
|
|
1072
|
-
readonly adapter: WebSocketAdapter;
|
|
1073
|
-
readonly sendTimeoutMs: number;
|
|
1074
|
-
static readonly DefaultHeartbeatTimeoutMs = 10000;
|
|
1075
|
-
static readonly DefaultSendTimeoutMs = 10000;
|
|
1076
|
-
static readonly DefaultConnectTimeoutMs = 30000;
|
|
1077
|
-
private readonly cIds;
|
|
1078
|
-
private nextCid;
|
|
1079
|
-
private _heartbeatTimeoutMs;
|
|
1080
|
-
private _connectionState;
|
|
1081
|
-
private _heartbeatTimer?;
|
|
1082
|
-
private _connectTimeoutTimer?;
|
|
1083
|
-
private _connectPromise?;
|
|
1084
|
-
constructor(host: string, port: string, useSSL?: boolean, verbose?: boolean, adapter?: WebSocketAdapter, sendTimeoutMs?: number);
|
|
1085
|
-
generatecid(): string;
|
|
1086
|
-
isOpen(): boolean;
|
|
1087
|
-
connect(session: Session, createStatus?: boolean, platform?: string, connectTimeoutMs?: number, signal?: AbortSignal): Promise<Session>;
|
|
1088
|
-
disconnect(fireDisconnectEvent?: boolean): void;
|
|
1089
|
-
setHeartbeatTimeoutMs(ms: number): void;
|
|
1090
|
-
getHeartbeatTimeoutMs(): number;
|
|
1091
|
-
onreconnect(evt: Event): void;
|
|
1092
|
-
ondisconnect(evt: Event): void;
|
|
1093
|
-
onerror(evt: Event): void;
|
|
1094
|
-
onmessagetyping(messagetyping: MessageTypingEvent): void;
|
|
1095
|
-
onmessagereaction(messagereaction: ApiMessageReaction): void;
|
|
1096
|
-
onchannelmessage(channelMessage: ChannelMessage): void;
|
|
1097
|
-
onchannelpresence(channelPresence: ChannelPresenceEvent): void;
|
|
1098
|
-
onuserchanneladded(user: UserChannelAddedEvent): void;
|
|
1099
|
-
onuserclanadded(user: AddClanUserEvent): void;
|
|
1100
|
-
onuserprofileupdate(user: UserProfileUpdatedEvent): void;
|
|
1101
|
-
onuserchannelremoved(user: UserChannelRemovedEvent): void;
|
|
1102
|
-
onaddfriend(user: AddFriend): void;
|
|
1103
|
-
onremovefriend(user: RemoveFriend): void;
|
|
1104
|
-
onblockfriend(user: BlockFriend): void;
|
|
1105
|
-
onunblockfriend(user: UnblockFriend): void;
|
|
1106
|
-
onuserclanremoved(user: UserClanRemovedEvent): void;
|
|
1107
|
-
onnotification(notification: ApiNotification): void;
|
|
1108
|
-
onstatuspresence(statusPresence: StatusPresenceEvent): void;
|
|
1109
|
-
onpinmessage(pin: LastPinMessageEvent): void;
|
|
1110
|
-
onvoiceended(voice: VoiceEndedEvent): void;
|
|
1111
|
-
onvoicestarted(voice: VoiceStartedEvent): void;
|
|
1112
|
-
onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
|
|
1113
|
-
onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
|
|
1114
|
-
onchannelcreated(channelCreated: ChannelCreatedEvent): void;
|
|
1115
|
-
oncategoryevent(categoryEvent: CategoryEvent): void;
|
|
1116
|
-
onroleevent(roleEvent: RoleEvent): void;
|
|
1117
|
-
oneventemoji(eventEmoji: EventEmoji): void;
|
|
1118
|
-
oneventnotiuserchannel(notiUserChannel: ApiNotificationUserChannel): void;
|
|
1119
|
-
oneventwebhook(webhook_event: ApiWebhook): void;
|
|
1120
|
-
onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
|
|
1121
|
-
onclandeleted(clanDeleted: ClanDeletedEvent): void;
|
|
1122
|
-
onstickercreated(stickerCreated: StickerCreateEvent): void;
|
|
1123
|
-
onstickerdeleted(stickerDeleted: StickerDeleteEvent): void;
|
|
1124
|
-
onstickerupdated(stickerUpdated: StickerUpdateEvent): void;
|
|
1125
|
-
onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
|
|
1126
|
-
ondeleteaccount(deleteAccountEvent: DeleteAccountEvent): void;
|
|
1127
|
-
onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
|
|
1128
|
-
onclanupdated(clan: ClanUpdatedEvent): void;
|
|
1129
|
-
onlastseenupdated(event: LastSeenMessageEvent): void;
|
|
1130
|
-
onstreampresence(streamPresence: StreamPresenceEvent): void;
|
|
1131
|
-
onstreamdata(streamData: StreamData): void;
|
|
1132
|
-
onheartbeattimeout(): void;
|
|
1133
|
-
oncustomstatus(statusEvent: CustomStatusEvent): void;
|
|
1134
|
-
oncanvasevent(canvasEvent: ChannelCanvas): void;
|
|
1135
|
-
oneventcreated(clan_event_created: ApiCreateEventRequest): void;
|
|
1136
|
-
oncoffeegiven(give_coffee_event: ApiGiveCoffeeEvent): void;
|
|
1137
|
-
onroleassign(role_assign_event: RoleAssignedEvent): void;
|
|
1138
|
-
onstreamingchannelstarted(streaming_started_event: StreamingStartedEvent): void;
|
|
1139
|
-
onstreamingchannelended(streaming_ended_event: StreamingEndedEvent): void;
|
|
1140
|
-
onstreamingchanneljoined(streaming_joined_event: StreamingJoinedEvent): void;
|
|
1141
|
-
onstreamingchannelleaved(streaming_leaved_event: StreamingLeavedEvent): void;
|
|
1142
|
-
onpermissionset(permission_set_event: PermissionSet): void;
|
|
1143
|
-
onpermissionchanged(permission_changed_event: PermissionChangedEvent): void;
|
|
1144
|
-
onunmuteevent(unmute_event: UnmuteEvent): void;
|
|
1145
|
-
ontokensent(tokenSentEvent: ApiTokenSentEvent): void;
|
|
1146
|
-
onmessagebuttonclicked(messageButtonClicked: MessageButtonClicked): void;
|
|
1147
|
-
onmessagedropdownboxselected(msg: DropdownBoxSelected): void;
|
|
1148
|
-
onmarkasread(event: MarkAsRead): void;
|
|
1149
|
-
onvoicereactionmessage(event: VoiceReactionSend): void;
|
|
1150
|
-
onwebrtcsignalingfwd(event: WebrtcSignalingFwd): void;
|
|
1151
|
-
onactivityupdated(list_activity: ListActivity): void;
|
|
1152
|
-
onsdtopicevent(sd_topic_event: SdTopicEvent): void;
|
|
1153
|
-
onchannelappevent(event: ChannelAppEvent): void;
|
|
1154
|
-
onuserstatusevent(user_status_event: UserStatusEvent): void;
|
|
1155
|
-
onjoinchannelappevent(join_channel_app_data: JoinChannelAppData): void;
|
|
1156
|
-
onunpinmessageevent(unpin_message_event: UnpinMessageEvent): void;
|
|
1157
|
-
onquickmenuevent(event: QuickMenuEvent): void;
|
|
1158
|
-
ontransferownership(event: TransferOwnershipEvent): void;
|
|
1159
|
-
onbanneduser(event: BannedUserEvent): void;
|
|
1160
|
-
onlistchannelusersbanned(event: ListChannelUsersBannedEvent): void;
|
|
1161
|
-
onmeetparticipantevent(event: MeetParticipantEvent): void;
|
|
1162
|
-
onallowanonymousevent(event: AllowAnonymousEvent): void;
|
|
1163
|
-
onaiagentenabled(event: AiAgentEnabledEvent): void;
|
|
1164
|
-
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent | EphemeralMessageSend | VoiceReactionSend | ListDataSocket | QuickMenuEvent, sendTimeout?: number): Promise<any>;
|
|
1165
|
-
followUsers(userIds: string[]): Promise<Status>;
|
|
1166
|
-
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
|
1167
|
-
follower(): Promise<void>;
|
|
1168
|
-
joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
|
1169
|
-
leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
|
|
1170
|
-
removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
|
|
1171
|
-
rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
|
|
1172
|
-
unfollowUsers(user_ids: string[]): Promise<void>;
|
|
1173
|
-
updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, is_update_msg_topic?: boolean): Promise<ChannelMessageAck>;
|
|
1174
|
-
updateStatus(status?: string): Promise<void>;
|
|
1175
|
-
writeQuickMenuEvent(menu_name: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string): Promise<QuickMenuEvent>;
|
|
1176
|
-
writeEphemeralMessage(receiver_ids: string[], clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string, id?: string): Promise<ChannelMessageAck>;
|
|
1177
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
|
|
1178
|
-
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean, topic_id?: string, emoji_recent_id?: string, sender_name?: string): Promise<ApiMessageReaction>;
|
|
1179
|
-
writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean, sender_display_name: string, topic_id?: string): Promise<MessageTypingEvent>;
|
|
1180
|
-
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
|
|
1181
|
-
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number, message_sender_avatar: string, message_sender_id: string, message_sender_username: string, message_content: string, message_attachment: string, message_created_time: string): Promise<LastPinMessageEvent>;
|
|
1182
|
-
writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
|
1183
|
-
checkDuplicateName(name: string, condition_id: string, type: number, clan_id: string): Promise<CheckNameExistedEvent>;
|
|
1184
|
-
writeVoiceReaction(emojis: Array<string>, channel_id: string): Promise<VoiceReactionSend>;
|
|
1185
|
-
forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
|
1186
|
-
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
|
1187
|
-
writeChannelAppEvent(clan_id: string, channel_id: string, action: number): Promise<ChannelAppEvent>;
|
|
1188
|
-
listDataSocket(request: ListDataSocket): Promise<any>;
|
|
1189
|
-
private pingPong;
|
|
1190
|
-
private startHeartbeatLoop;
|
|
1191
|
-
private stopHeartbeatLoop;
|
|
1192
|
-
private clearConnectTimeout;
|
|
1193
|
-
}
|
|
1194
|
-
export {};
|