mezon-js 2.13.78 → 2.13.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/client.ts +3279 -2482
  2. package/dist/client.d.ts +163 -349
  3. package/dist/gateway.api.d.ts +33 -0
  4. package/dist/index.d.ts +2 -4
  5. package/dist/{api.gen.d.ts → mezon-js/api.gen.d.ts} +1 -0
  6. package/dist/mezon-js/client.d.ts +347 -0
  7. package/dist/mezon-js/gateway.api.d.ts +33 -0
  8. package/dist/mezon-js/index.d.ts +23 -0
  9. package/dist/mezon-js/session.d.ts +61 -0
  10. package/dist/mezon-js/socket.d.ts +1212 -0
  11. package/dist/mezon-js/types/index.d.ts +2212 -0
  12. package/dist/mezon-js/utils.d.ts +6 -0
  13. package/dist/mezon-js/web_socket_adapter.d.ts +83 -0
  14. package/dist/mezon-js.cjs.js +9038 -21145
  15. package/dist/mezon-js.esm.mjs +9038 -21145
  16. package/dist/mezon-js.esm.mjs.map +1 -0
  17. package/dist/session.d.ts +11 -11
  18. package/dist/socket.d.ts +385 -386
  19. package/dist/types/index.d.ts +2212 -0
  20. package/dist/utils.d.ts +2 -0
  21. package/dist/webrpc/index.d.ts +3 -0
  22. package/gateway.api.ts +577 -0
  23. package/index.ts +2 -5
  24. package/package.json +3 -2
  25. package/rollup.config.js +64 -30
  26. package/session.ts +22 -22
  27. package/socket.ts +921 -846
  28. package/types/index.ts +3883 -0
  29. package/utils.ts +107 -47
  30. package/api/api.ts +0 -39185
  31. package/api.gen.ts +0 -11777
  32. package/google/protobuf/struct.ts +0 -554
  33. package/google/protobuf/timestamp.ts +0 -223
  34. package/google/protobuf/wrappers.ts +0 -670
  35. /package/dist/{api → mezon-js/api}/api.d.ts +0 -0
  36. /package/dist/{google → mezon-js/google}/protobuf/struct.d.ts +0 -0
  37. /package/dist/{google → mezon-js/google}/protobuf/timestamp.d.ts +0 -0
  38. /package/dist/{google → mezon-js/google}/protobuf/wrappers.d.ts +0 -0
package/socket.ts CHANGED
@@ -62,11 +62,11 @@ import {
62
62
  ApiListChannelAppsResponse,
63
63
  ApiListUserActivity,
64
64
  ApiListClanUnreadMsgIndicatorResponse,
65
- } from "./api.gen";
65
+ ChannelMessage,
66
+ } from "./types";
66
67
  import { Session } from "./session";
67
- import { ChannelMessage } from "./client";
68
68
  import { WebSocketAdapter, WebSocketAdapterText } from "./web_socket_adapter";
69
- import { safeJSONParse } from "./utils";
69
+ import { mapToCamelCase, mapToSnakeCase, safeJSONParse } from "./utils";
70
70
 
71
71
  /** Stores function references for resolve/reject with a DOM Promise. */
72
72
  interface PromiseExecutor {
@@ -76,9 +76,9 @@ interface PromiseExecutor {
76
76
  /** An object which represents a connected user in the server. */
77
77
  export interface Presence {
78
78
  /** The id of the user. */
79
- user_id: string;
79
+ userId: string;
80
80
  /** The session id of the user. */
81
- session_id: string;
81
+ sessionId: string;
82
82
  /** The username of the user. */
83
83
  username: string;
84
84
  /** The node the user is connected to. */
@@ -86,9 +86,9 @@ export interface Presence {
86
86
  /** The status of the user */
87
87
  status: string;
88
88
  // User Mobile
89
- is_mobile: boolean;
89
+ isMobile: boolean;
90
90
  // user status
91
- user_status: string;
91
+ userStatus: string;
92
92
  }
93
93
 
94
94
  export interface NotificationInfo {
@@ -97,23 +97,23 @@ export interface NotificationInfo {
97
97
  /** Content of the notification in JSON. */
98
98
  content?: {};
99
99
  /** The UNIX time when the notification was created. */
100
- create_time?: string;
100
+ createTime?: string;
101
101
  /** ID of the Notification. */
102
102
  id?: string;
103
103
  /** True if this notification was persisted to the database. */
104
104
  persistent?: boolean;
105
105
  /** ID of the sender, if a user. Otherwise 'null'. */
106
- sender_id?: string;
106
+ senderId?: string;
107
107
  /** Subject of the notification. */
108
108
  subject?: string;
109
109
  //
110
- channel_id?: string;
110
+ channelId?: string;
111
111
  //
112
- clan_id?: string;
112
+ clanId?: string;
113
113
  //
114
114
  channel?: ApiChannelDescription;
115
115
  //
116
- topic_id?: string;
116
+ topicId?: string;
117
117
  }
118
118
 
119
119
  /** A response from a channel join operation. */
@@ -121,30 +121,30 @@ export interface Channel {
121
121
  /** The server-assigned channel id. */
122
122
  id: string;
123
123
  // label
124
- chanel_label: string;
124
+ channelLabel: string;
125
125
  /** The presences visible on the chat channel. */
126
126
  presences: Presence[];
127
127
  /** The presence of the current user, i.e. yourself. */
128
128
  self: Presence;
129
129
  // The ID of the first DM user, or an empty string if this message was not sent through a DM chat.
130
- clan_logo: string;
130
+ clanLogo: string;
131
131
  // The ID of the second DM user, or an empty string if this message was not sent through a DM chat.
132
- category_name: string;
132
+ categoryName: string;
133
133
  }
134
134
 
135
135
  export interface ClanJoin {
136
- clan_join: {
137
- clan_id: string;
136
+ clanJoin: {
137
+ clanId: string;
138
138
  };
139
139
  }
140
140
 
141
141
  /** Join a realtime chat channel. */
142
142
  interface ChannelJoin {
143
- channel_join: {
143
+ channelJoin: {
144
144
  /** The id of the channel to join. */
145
- channel_id: string;
145
+ channelId: string;
146
146
  /** The name of the channel to join. */
147
- channel_label: string;
147
+ channelLabel: string;
148
148
  /** The channel type: 1 = Channel, 2 = Direct Message, 3 = Group. */
149
149
  type: number;
150
150
  /** Whether channel messages are persisted in the database. */
@@ -152,213 +152,213 @@ interface ChannelJoin {
152
152
  /** Whether the user's channel presence is hidden when joining. */
153
153
  hidden: boolean;
154
154
  // is public
155
- is_public: boolean;
155
+ isPublic: boolean;
156
156
  };
157
157
  }
158
158
 
159
159
  /** Leave a realtime chat channel. */
160
160
  interface ChannelLeave {
161
- channel_leave: {
161
+ channelLeave: {
162
162
  /** The id of the channel to leave. */
163
- channel_id: string;
163
+ channelId: string;
164
164
  // The mode
165
165
  mode: number;
166
166
  // The channel label
167
- channel_label: string;
167
+ channelLabel: string;
168
168
  // Is public
169
- is_public: boolean;
169
+ isPublic: boolean;
170
170
  };
171
171
  }
172
172
 
173
173
  export interface AddClanUserEvent {
174
174
  //the clan id
175
- clan_id: string;
175
+ clanId: string;
176
176
  // the user
177
177
  user: UserProfileRedis;
178
178
  invitor: string;
179
179
  }
180
180
 
181
181
  export interface BannedUserEvent {
182
- user_ids: Array<string>;
182
+ userIds: Array<string>;
183
183
  action: number;
184
- banner_id: string;
185
- channel_id: string;
186
- clan_id: string;
187
- ban_time: number
184
+ bannerId: string;
185
+ channelId: string;
186
+ clanId: string;
187
+ banTime: number;
188
188
  }
189
189
 
190
190
  export interface UserProfileRedis {
191
191
  /** User IDs to follow. */
192
- user_id: string;
192
+ userId: string;
193
193
  /** Username to follow. */
194
194
  username: string;
195
195
  /** Avatar to follow. */
196
196
  avatar: string;
197
197
  /** Display name */
198
- display_name: string;
198
+ displayName: string;
199
199
  /** custom status */
200
- custom_status: string;
200
+ customStatus: string;
201
201
  /** online */
202
202
  online: boolean;
203
203
  // create time
204
- create_time_second: number;
204
+ createTimeSecond: number;
205
205
  /** clans */
206
- joined_clans: number[];
206
+ joinedClans: number[];
207
207
  // app url
208
- app_url: string;
208
+ appUrl: string;
209
209
  // is bot
210
- is_bot: boolean;
210
+ isBot: boolean;
211
211
  }
212
212
 
213
213
  /** UserChannelAddedEvent */
214
214
  export interface UserChannelAddedEvent {
215
215
  // the channel id
216
- channel_desc: ChannelDescription;
216
+ channelDesc: ChannelDescription;
217
217
  // the user
218
218
  users: UserProfileRedis[];
219
219
  // the custom status
220
220
  status: string;
221
221
  // the clan id
222
- clan_id: string;
222
+ clanId: string;
223
223
  //
224
224
  caller: UserProfileRedis;
225
225
  //
226
- create_time_second: number;
226
+ createTimeSecond: number;
227
227
  //
228
228
  active: number;
229
229
  }
230
230
 
231
231
  export interface UserChannelRemovedEvent {
232
232
  // the channel id
233
- channel_id: string;
234
- // the user_id
235
- user_ids: string[];
233
+ channelId: string;
234
+ // the userId
235
+ userIds: string[];
236
236
  // the channel type
237
- channel_type: number;
237
+ channelType: number;
238
238
  // the clan id
239
- clan_id: string;
240
- // badge_count
241
- badge_counts: number[];
239
+ clanId: string;
240
+ // badgeCount
241
+ badgeCounts: number[];
242
242
  }
243
243
 
244
244
  export interface UserClanRemovedEvent {
245
245
  // the clan id
246
- clan_id: string;
247
- // the user_id
248
- user_ids: string[];
246
+ clanId: string;
247
+ // the userId
248
+ userIds: string[];
249
249
  }
250
250
 
251
251
  /** Last seen message by user */
252
252
  export interface LastPinMessageEvent {
253
253
  /** The channel this message belongs to. */
254
- channel_id: string;
254
+ channelId: string;
255
255
  // The mode
256
256
  mode: number;
257
257
  // The channel label
258
- channel_label: string;
258
+ channelLabel: string;
259
259
  /** The unique ID of this message. */
260
- message_id: string;
260
+ messageId: string;
261
261
  /** user id */
262
- user_id: string;
262
+ userId: string;
263
263
  /** operation */
264
264
  operation: number;
265
265
  // Is public
266
- is_public: boolean;
266
+ isPublic: boolean;
267
267
  // clan Id
268
- clan_id: string;
268
+ clanId: string;
269
269
  // avatar
270
- message_sender_avatar: string;
270
+ messageSenderAvatar: string;
271
271
  // message sender id
272
- message_sender_id: string;
272
+ messageSenderId: string;
273
273
  // message sender username
274
- message_sender_username: string;
274
+ messageSenderUsername: string;
275
275
  // message content
276
- message_content: string;
276
+ messageContent: string;
277
277
  // attachment
278
- message_attachment: string;
278
+ messageAttachment: string;
279
279
  // create time
280
- message_created_time: string;
280
+ messageCreatedTime: string;
281
281
  }
282
282
 
283
283
  export interface UnmuteEvent {
284
284
  // channel id
285
- channel_id: string;
286
- // category_id
287
- category_id: string;
288
- // clan_id
289
- clan_id: string;
285
+ channelId: string;
286
+ // categoryId
287
+ categoryId: string;
288
+ // clanId
289
+ clanId: string;
290
290
  }
291
291
 
292
292
  /** Last seen message by user */
293
293
  export interface LastSeenMessageEvent {
294
294
  // The clan id
295
- clan_id: string;
295
+ clanId: string;
296
296
  /** The channel this message belongs to. */
297
- channel_id: string;
297
+ channelId: string;
298
298
  // The mode
299
299
  mode: number;
300
300
  // The channel label
301
- channel_label: string;
301
+ channelLabel: string;
302
302
  /** The unique ID of this message. */
303
- message_id: string;
303
+ messageId: string;
304
304
  //
305
- badge_count: number;
305
+ badgeCount: number;
306
306
  }
307
307
 
308
308
  /** User is typing */
309
309
  export interface MessageTypingEvent {
310
310
  /** The channel this message belongs to. */
311
- channel_id: string;
311
+ channelId: string;
312
312
  // The mode
313
313
  mode: number;
314
314
  // The channel label
315
- channel_label: string;
315
+ channelLabel: string;
316
316
  /** Message sender, usually a user ID. */
317
- sender_id: string;
317
+ senderId: string;
318
318
  // Is public
319
- is_public: boolean;
319
+ isPublic: boolean;
320
320
  // sender username
321
- sender_username: string;
321
+ senderUsername: string;
322
322
  // sender display name
323
- sender_display_name: string;
323
+ senderDisplayName: string;
324
324
  // topic id
325
- topic_id?: string;
325
+ topicId?: string;
326
326
  }
327
327
 
328
328
  // user profile updated event
329
329
  export interface UserProfileUpdatedEvent {
330
330
  // the user id
331
- user_id: string;
332
- // the display_name
333
- display_name: string;
331
+ userId: string;
332
+ // the displayName
333
+ displayName: string;
334
334
  // the avatar
335
335
  avatar: string;
336
- // the about_me
337
- about_me: string;
338
- // the channel_id
339
- channel_id: string;
340
- // the clan_id
341
- clan_id: string;
342
- // the encrypt_private_key
343
- encrypt_private_key: string;
336
+ // the aboutMe
337
+ aboutMe: string;
338
+ // the channelId
339
+ channelId: string;
340
+ // the clanId
341
+ clanId: string;
342
+ // the encryptPrivateKey
343
+ encryptPrivateKey: string;
344
344
  }
345
345
 
346
346
  /** An acknowledgement received in response to sending a message on a chat channel. */
347
347
  export interface ChannelMessageAck {
348
348
  /** The server-assigned channel ID. */
349
- channel_id: string;
349
+ channelId: string;
350
350
  // The mode
351
351
  mode: number;
352
352
  /** A unique ID for the chat message. */
353
- message_id: string;
353
+ messageId: string;
354
354
  /** A user-defined code for the chat message. */
355
355
  code: number;
356
356
  /** The username of the sender of the message. */
357
357
  username: string;
358
358
  /** The UNIX time when the message was created. */
359
- create_time: string;
359
+ createTime: string;
360
360
  /** The UNIX time when the message was updated. */
361
- update_time: string;
361
+ updateTime: string;
362
362
  /** True if the chat message has been stored in history. */
363
363
  persistence: boolean;
364
364
  }
@@ -367,13 +367,13 @@ export interface ChannelMessageAck {
367
367
  interface ChannelMessageSend {
368
368
  channel_message_send: {
369
369
  /** Clan Id */
370
- clan_id: string;
370
+ clanId: string;
371
371
  /** The server-assigned channel ID. */
372
- channel_id: string;
372
+ channelId: string;
373
373
  // The mode
374
374
  mode: number;
375
375
  // channel label
376
- channel_label: string;
376
+ channelLabel: string;
377
377
  /** The content payload. */
378
378
  content: any;
379
379
  //
@@ -381,38 +381,38 @@ interface ChannelMessageSend {
381
381
  //
382
382
  attachments?: Array<ApiMessageAttachment>;
383
383
  //
384
- anonymous_message?: boolean;
384
+ anonymousMessage?: boolean;
385
385
  //
386
- mention_everyone?: boolean;
386
+ mentionEveryone?: boolean;
387
387
  //
388
388
  avatar: string;
389
389
  // Is public
390
- is_public: boolean;
390
+ isPublic: boolean;
391
391
  // code
392
392
  code: number;
393
393
  //
394
- topic_id?: string;
394
+ topicId?: string;
395
395
  };
396
396
  }
397
397
 
398
398
  interface TransferOwnershipEvent {
399
- clan_id: string;
400
- prev_owner: string;
401
- curr_owner: string;
399
+ clanId: string;
400
+ prevOwner: string;
401
+ currOwner: string;
402
402
  }
403
403
 
404
404
  interface QuickMenuEvent {
405
405
  quick_menu_event: {
406
- menu_name: string,
406
+ menuName: string;
407
407
  message: {
408
408
  /** Clan Id */
409
- clan_id: string;
409
+ clanId: string;
410
410
  /** The server-assigned channel ID. */
411
- channel_id: string;
411
+ channelId: string;
412
412
  // The mode
413
413
  mode: number;
414
414
  // channel label
415
- channel_label: string;
415
+ channelLabel: string;
416
416
  /** The content payload. */
417
417
  content: any;
418
418
  //
@@ -420,33 +420,33 @@ interface QuickMenuEvent {
420
420
  //
421
421
  attachments?: Array<ApiMessageAttachment>;
422
422
  //
423
- anonymous_message?: boolean;
423
+ anonymousMessage?: boolean;
424
424
  //
425
- mention_everyone?: boolean;
425
+ mentionEveryone?: boolean;
426
426
  //
427
427
  avatar: string;
428
428
  // Is public
429
- is_public: boolean;
429
+ isPublic: boolean;
430
430
  // code
431
431
  code: number;
432
432
  //
433
- topic_id?: string;
434
- }
435
- }
433
+ topicId?: string;
434
+ };
435
+ };
436
436
  }
437
437
 
438
438
  interface EphemeralMessageSend {
439
439
  ephemeral_message_send: {
440
- receiver_id: string,
440
+ receiverId: string;
441
441
  message: {
442
442
  /** Clan Id */
443
- clan_id: string;
443
+ clanId: string;
444
444
  /** The server-assigned channel ID. */
445
- channel_id: string;
445
+ channelId: string;
446
446
  // The mode
447
447
  mode: number;
448
448
  // channel label
449
- channel_label: string;
449
+ channelLabel: string;
450
450
  /** The content payload. */
451
451
  content: any;
452
452
  //
@@ -454,28 +454,28 @@ interface EphemeralMessageSend {
454
454
  //
455
455
  attachments?: Array<ApiMessageAttachment>;
456
456
  //
457
- anonymous_message?: boolean;
457
+ anonymousMessage?: boolean;
458
458
  //
459
- mention_everyone?: boolean;
459
+ mentionEveryone?: boolean;
460
460
  //
461
461
  avatar: string;
462
462
  // Is public
463
- is_public: boolean;
463
+ isPublic: boolean;
464
464
  // code
465
465
  code: number;
466
466
  //
467
- topic_id?: string;
468
- }
469
- }
467
+ topicId?: string;
468
+ };
469
+ };
470
470
  }
471
471
 
472
472
  /** Update a message previously sent to a realtime chat channel. */
473
473
  interface ChannelMessageUpdate {
474
474
  channel_message_update: {
475
475
  /** The server-assigned channel ID. */
476
- channel_id: string;
476
+ channelId: string;
477
477
  /** A unique ID for the chat message to be updated. */
478
- message_id: string;
478
+ messageId: string;
479
479
  /** The content payload. */
480
480
  content: any;
481
481
  /** mentions */
@@ -485,13 +485,13 @@ interface ChannelMessageUpdate {
485
485
  /** The mode payload. */
486
486
  mode: number;
487
487
  // Is public
488
- is_public: boolean;
488
+ isPublic: boolean;
489
489
  //
490
- topic_id?: string;
490
+ topicId?: string;
491
491
  //
492
- is_update_msg_topic?: boolean;
492
+ isUpdateMsgTopic?: boolean;
493
493
  //
494
- old_mentions?: string;
494
+ oldMentions?: string;
495
495
  };
496
496
  }
497
497
 
@@ -499,21 +499,21 @@ interface ChannelMessageUpdate {
499
499
  interface ChannelMessageRemove {
500
500
  channel_message_remove: {
501
501
  /** The clan id */
502
- clan_id: string;
502
+ clanId: string;
503
503
  /** The server-assigned channel ID. */
504
- channel_id: string;
504
+ channelId: string;
505
505
  // The mode
506
506
  mode: number;
507
507
  // The channel label
508
- channel_label: string;
508
+ channelLabel: string;
509
509
  /** A unique ID for the chat message to be removed. */
510
- message_id: string;
510
+ messageId: string;
511
511
  // Is public
512
- is_public: boolean;
512
+ isPublic: boolean;
513
513
  /** attachments */
514
- has_attachment?: boolean;
514
+ hasAttachment?: boolean;
515
515
  //
516
- topic_id?: string;
516
+ topicId?: string;
517
517
  // mentions
518
518
  mentions: string;
519
519
  // references
@@ -524,9 +524,9 @@ interface ChannelMessageRemove {
524
524
  /** Presence update for a particular realtime chat channel. */
525
525
  export interface ChannelPresenceEvent {
526
526
  /** The unique identifier of the chat channel. */
527
- channel_id: string;
527
+ channelId: string;
528
528
  // The channel name
529
- channel_label: string;
529
+ channelLabel: string;
530
530
  // The mode
531
531
  mode: number;
532
532
  /** Presences of the users who joined the channel. */
@@ -539,192 +539,192 @@ export interface VoiceEndedEvent {
539
539
  // id voice
540
540
  id: string;
541
541
  // The unique identifier of the chat clan.
542
- clan_id: string;
542
+ clanId: string;
543
543
  // voice channel name
544
- voice_channel_id: string;
544
+ voiceChannelId: string;
545
545
  }
546
546
 
547
547
  export interface VoiceStartedEvent {
548
548
  // id voice
549
549
  id: string;
550
550
  // The unique identifier of the chat clan.
551
- clan_id: string;
551
+ clanId: string;
552
552
  // voice channel name
553
- voice_channel_id: string;
553
+ voiceChannelId: string;
554
554
  }
555
555
 
556
556
  export interface VoiceLeavedEvent {
557
557
  // event id
558
558
  id: string;
559
559
  // clan id
560
- clan_id: string;
560
+ clanId: string;
561
561
  // voice channel name
562
- voice_channel_id: string;
562
+ voiceChannelId: string;
563
563
  // voice user id
564
- voice_user_id: string;
564
+ voiceUserId: string;
565
565
  }
566
566
 
567
567
  export interface VoiceJoinedEvent {
568
568
  /** The unique identifier of the chat channel. */
569
- clan_id: string;
569
+ clanId: string;
570
570
  // The channel name
571
- clan_name: string;
571
+ clanName: string;
572
572
  // id voice
573
573
  id: string;
574
574
  // voice participant
575
575
  participant: string;
576
576
  // user id
577
- user_id: string;
577
+ userId: string;
578
578
  // voice channel label
579
- voice_channel_label: string;
579
+ voiceChannelLabel: string;
580
580
  // voice channel id
581
- voice_channel_id: string;
581
+ voiceChannelId: string;
582
582
  // last screenshot
583
- last_screenshot: string;
583
+ lastScreenshot: string;
584
584
  }
585
585
 
586
586
  export interface CustomStatusEvent {
587
587
  // the clan id
588
- clan_id: string;
588
+ clanId: string;
589
589
  // the user id
590
- user_id: string;
590
+ userId: string;
591
591
  // username
592
592
  username: string;
593
593
  // the status
594
594
  status: string;
595
595
  /** time reset */
596
- time_reset: number;
596
+ timeReset: number;
597
597
  /** no clear */
598
- no_clear: boolean;
598
+ noClear: boolean;
599
599
  }
600
600
 
601
601
  export interface UnpinMessageEvent {
602
602
  id: string;
603
- message_id: string;
604
- channel_id: string;
605
- clan_id: string;
603
+ messageId: string;
604
+ channelId: string;
605
+ clanId: string;
606
606
  }
607
607
 
608
608
  export interface ChannelUpdatedEvent {
609
609
  // clan id
610
- clan_id: string;
610
+ clanId: string;
611
611
  // category
612
- category_id: string;
612
+ categoryId: string;
613
613
  // creator
614
- creator_id: string;
615
- // parent_id
616
- parent_id: string;
614
+ creatorId: string;
615
+ // parentId
616
+ parentId: string;
617
617
  // channel id
618
- channel_id: string;
618
+ channelId: string;
619
619
  // channel label
620
- channel_label: string;
620
+ channelLabel: string;
621
621
  // channel type
622
- channel_type: number;
622
+ channelType: number;
623
623
  // status
624
624
  status: number;
625
625
  // meeting code
626
- meeting_code: string;
626
+ meetingCode: string;
627
627
  // channel private
628
- channel_private: number;
628
+ channelPrivate: number;
629
629
  // is error
630
- is_error: boolean;
630
+ isError: boolean;
631
631
  // app url
632
- app_id: string;
632
+ appId: string;
633
633
  // e2ee
634
634
  e2ee: number;
635
635
  //
636
636
  topic: string;
637
637
  //
638
- age_restricted: number;
638
+ ageRestricted: number;
639
639
  //
640
- is_active_thread: boolean;
640
+ isActiveThread: boolean;
641
641
  //
642
642
  active: number;
643
643
  //
644
- count_mess_unread: number;
644
+ countMessUnread: number;
645
645
  //
646
- role_ids?: Array<string>;
646
+ roleIds?: Array<string>;
647
647
  // The users to add.
648
- user_ids?: Array<string>;
648
+ userIds?: Array<string>;
649
649
  // channel avatar
650
- channel_avatar: string;
650
+ channelAvatar: string;
651
651
  }
652
652
 
653
653
  export interface DeleteAccountEvent {
654
654
  // user id
655
- user_id: string;
655
+ userId: string;
656
656
  }
657
657
 
658
658
  export interface ChannelCreatedEvent {
659
659
  // clan id
660
- clan_id: string;
660
+ clanId: string;
661
661
  // category
662
- category_id: string;
662
+ categoryId: string;
663
663
  // creator
664
- creator_id: string;
665
- // parent_id
666
- parent_id: string;
664
+ creatorId: string;
665
+ // parentId
666
+ parentId: string;
667
667
  // channel id
668
- channel_id: string;
668
+ channelId: string;
669
669
  // channel label
670
- channel_label: string;
670
+ channelLabel: string;
671
671
  // channel private
672
- channel_private: number;
672
+ channelPrivate: number;
673
673
  // channel type
674
- channel_type: number;
674
+ channelType: number;
675
675
  // status
676
676
  status: number;
677
677
  // app url
678
- app_id: string;
679
- // clan_name
680
- clan_name: string;
678
+ appId: string;
679
+ // clanName
680
+ clanName: string;
681
681
  // channel avatar
682
- channel_avatar: string;
682
+ channelAvatar: string;
683
683
  }
684
684
 
685
685
  export interface CategoryEvent {
686
686
  // clan id
687
- clan_id: string;
687
+ clanId: string;
688
688
  // category
689
689
  id: string;
690
690
  // creator
691
- creator_id: string;
692
- // category_name
693
- category_name: string;
691
+ creatorId: string;
692
+ // categoryName
693
+ categoryName: string;
694
694
  // status
695
695
  status: number;
696
696
  }
697
697
 
698
698
  export interface ChannelDeletedEvent {
699
699
  // clan id
700
- clan_id: string;
700
+ clanId: string;
701
701
  // category
702
- category_id: string;
702
+ categoryId: string;
703
703
  // channel id
704
- channel_id: string;
704
+ channelId: string;
705
705
  // deletor
706
706
  deletor: string;
707
707
  // parent id
708
- parent_id: string;
708
+ parentId: string;
709
709
  }
710
710
 
711
711
  export interface StickerCreateEvent {
712
712
  // clan id
713
- clan_id: string;
713
+ clanId: string;
714
714
  // source
715
715
  source: string;
716
716
  // shortname
717
717
  shortname: string;
718
718
  // category
719
719
  category: string;
720
- // creator_id
721
- creator_id: string;
720
+ // creatorId
721
+ creatorId: string;
722
722
  // sticker id
723
723
  sticker_id: string;
724
724
  // logo
725
725
  logo: string;
726
726
  // clan name
727
- clan_name: string;
727
+ clanName: string;
728
728
  }
729
729
 
730
730
  export interface StickerUpdateEvent {
@@ -733,19 +733,19 @@ export interface StickerUpdateEvent {
733
733
  // sticker id
734
734
  sticker_id: string;
735
735
  // user id update
736
- user_id: string;
736
+ userId: string;
737
737
  }
738
738
 
739
739
  export interface StickerDeleteEvent {
740
740
  // sticker id
741
741
  sticker_id: string;
742
742
  // user id delete
743
- user_id: string;
743
+ userId: string;
744
744
  }
745
745
 
746
746
  export interface ClanDeletedEvent {
747
747
  // clan id
748
- clan_id: string;
748
+ clanId: string;
749
749
  // deletor
750
750
  deletor: string;
751
751
  }
@@ -753,9 +753,9 @@ export interface ClanDeletedEvent {
753
753
  // clan updated event
754
754
  export interface ClanUpdatedEvent {
755
755
  // clan id
756
- clan_id: string;
756
+ clanId: string;
757
757
  // clan name
758
- clan_name: string;
758
+ clanName: string;
759
759
  // logo
760
760
  logo: string;
761
761
  // banner
@@ -763,38 +763,38 @@ export interface ClanUpdatedEvent {
763
763
  // status
764
764
  status: number;
765
765
  // is onboarding
766
- is_onboarding: boolean;
766
+ isOnboarding: boolean;
767
767
  // welcome channel id
768
- welcome_channel_id: string;
769
- // onboarding_banner.
770
- onboarding_banner: string;
768
+ welcomeChannelId: string;
769
+ // onboardingBanner.
770
+ onboardingBanner: string;
771
771
  // about
772
772
  about: string;
773
773
  // prevent anonymous
774
- prevent_anonymous: boolean;
774
+ preventAnonymous: boolean;
775
775
  }
776
776
 
777
777
  export interface ClanProfileUpdatedEvent {
778
778
  // the user id
779
- user_id: string;
780
- // the clan_nick
781
- clan_nick: string;
779
+ userId: string;
780
+ // the clanNick
781
+ clanNick: string;
782
782
  // the avatar
783
- clan_avatar: string;
784
- // the clan_id
785
- clan_id: string;
783
+ clanAvatar: string;
784
+ // the clanId
785
+ clanId: string;
786
786
  }
787
787
 
788
- export interface MeetParticipantEvent {
788
+ export interface MeetParticipantEvent {
789
789
  username: string;
790
- room_name: string;
791
- channel_id: string;
792
- clan_id: string;
790
+ roomName: string;
791
+ channelId: string;
792
+ clanId: string;
793
793
  action: number;
794
794
  }
795
795
 
796
796
  export interface AllowAnonymousEvent {
797
- clan_id: string;
797
+ clanId: string;
798
798
  allow: boolean;
799
799
  }
800
800
 
@@ -849,7 +849,7 @@ export interface Status {
849
849
  /** Start receiving status updates for some set of users. */
850
850
  interface StatusFollow {
851
851
  /** The IDs of the users to follow. */
852
- status_follow: { user_ids: string[] };
852
+ status_follow: { userIds: string[] };
853
853
  }
854
854
 
855
855
  /** A batch of status updates for a given user. */
@@ -863,7 +863,7 @@ export interface StatusPresenceEvent {
863
863
  /** Stop receiving status updates for some set of users. */
864
864
  interface StatusUnfollow {
865
865
  /** The IDs of user to unfollow. */
866
- status_unfollow: { user_ids: string[] };
866
+ statusUnfollow: { userIds: string[] };
867
867
  }
868
868
 
869
869
  /** Set the user's own status. */
@@ -872,11 +872,11 @@ interface StatusUpdate {
872
872
  status_update: { status?: string };
873
873
  }
874
874
  export interface CheckNameExistedEvent {
875
- clan_name: string;
875
+ clanName: string;
876
876
  exist: boolean;
877
877
  condition_id: string;
878
878
  type: number;
879
- clan_id: string;
879
+ clanId: string;
880
880
  }
881
881
 
882
882
  /** */
@@ -884,11 +884,11 @@ export interface ClanSticker {
884
884
  //
885
885
  category?: string;
886
886
  //
887
- clan_id?: string;
887
+ clanId?: string;
888
888
  //
889
- create_time?: string;
889
+ createTime?: string;
890
890
  //
891
- creator_id?: string;
891
+ creatorId?: string;
892
892
  //
893
893
  id?: string;
894
894
  //
@@ -898,32 +898,32 @@ export interface ClanSticker {
898
898
  //
899
899
  logo?: string;
900
900
  //
901
- clan_name?: string;
901
+ clanName?: string;
902
902
  //
903
- is_for_sale?: boolean;
903
+ isForSale?: boolean;
904
904
  }
905
905
 
906
906
  export interface RoleEvent {
907
907
  role: ApiRole;
908
908
  status: number;
909
- user_id: string;
910
- user_add_ids: Array<string>;
911
- user_remove_ids: Array<string>;
912
- active_permission_ids: Array<string>;
913
- remove_permission_ids: Array<string>;
909
+ userId: string;
910
+ userAddIds: Array<string>;
911
+ userRemoveIds: Array<string>;
912
+ activePermissionIds: Array<string>;
913
+ removePermissionIds: Array<string>;
914
914
  }
915
915
 
916
916
  export interface EventEmoji {
917
917
  id: string;
918
- clan_id: string;
919
- short_name: string;
918
+ clanId: string;
919
+ shortName: string;
920
920
  source: string;
921
921
  category: string;
922
922
  action: number;
923
- user_id: string;
923
+ userId: string;
924
924
  logo: string;
925
- clan_name: string;
926
- is_for_sale: boolean;
925
+ clanName: string;
926
+ isForSale: boolean;
927
927
  }
928
928
 
929
929
  /** */
@@ -931,7 +931,7 @@ export interface ClanEmoji {
931
931
  //
932
932
  category?: string;
933
933
  //
934
- creator_id?: string;
934
+ creatorId?: string;
935
935
  //
936
936
  id?: string;
937
937
  //
@@ -941,128 +941,128 @@ export interface ClanEmoji {
941
941
  //
942
942
  logo?: string;
943
943
  //
944
- clan_name?: string;
944
+ clanName?: string;
945
945
  //
946
- clan_id?: string;
946
+ clanId?: string;
947
947
  //
948
- is_for_sale?: boolean;
948
+ isForSale?: boolean;
949
949
  }
950
950
 
951
951
  /** */
952
952
  export interface ChannelDescription {
953
953
  // The clan of this channel
954
- clan_id?: string;
954
+ clanId?: string;
955
955
  // The channel this message belongs to.
956
- channel_id?: string;
956
+ channelId?: string;
957
957
  // The channel type.
958
958
  type?: number;
959
959
  // The channel lable
960
- channel_label?: string;
960
+ channelLabel?: string;
961
961
  // The app url
962
- app_url?: string;
962
+ appUrl?: string;
963
963
  // The channel private
964
- channel_private?: number;
964
+ channelPrivate?: number;
965
965
  // meeting code
966
- meeting_code?: string;
966
+ meetingCode?: string;
967
967
  //
968
- clan_name?: string;
968
+ clanName?: string;
969
969
  //
970
- parent_id?: string;
970
+ parentId?: string;
971
971
  //
972
- last_sent_message?: ApiChannelMessageHeader;
972
+ lastSentMessage?: ApiChannelMessageHeader;
973
973
  }
974
974
 
975
975
  // hashtagDM
976
976
  export interface HashtagDm {
977
977
  // The channel id.
978
- channel_id?: string;
978
+ channelId?: string;
979
979
  // The channel lable
980
- channel_label?: string;
980
+ channelLabel?: string;
981
981
  // The clan of this channel
982
- clan_id?: string;
982
+ clanId?: string;
983
983
  // The clan name
984
- clan_name?: string;
984
+ clanName?: string;
985
985
  //
986
- meeting_code?: string;
986
+ meetingCode?: string;
987
987
  //
988
988
  type?: number;
989
989
  //
990
- channel_private?: number;
990
+ channelPrivate?: number;
991
991
  //
992
- parent_id?: string;
992
+ parentId?: string;
993
993
  }
994
994
 
995
995
  export interface NotificationSetting {
996
996
  //
997
997
  id?: string;
998
998
  //
999
- notification_setting_type?: number;
999
+ notificationSettingType?: number;
1000
1000
  }
1001
1001
 
1002
1002
  export interface NotificationChannelCategorySetting {
1003
1003
  // Notification id
1004
1004
  id: string;
1005
1005
  //
1006
- channel_category_label: string;
1006
+ channelCategoryLabel: string;
1007
1007
  // Notification title
1008
- notification_setting_type: number;
1008
+ notificationSettingType: number;
1009
1009
  //
1010
- channel_category_title: string;
1010
+ channelCategoryTitle: string;
1011
1011
  //
1012
1012
  action: number;
1013
1013
  }
1014
1014
 
1015
1015
  export interface UserEmojiUsage {
1016
- user_id: string;
1017
- emoji_id: string;
1018
- clan_id: string;
1019
- create_time: string;
1016
+ userId: string;
1017
+ emojiId: string;
1018
+ clanId: string;
1019
+ createTime: string;
1020
1020
  }
1021
1021
 
1022
1022
  export interface AddFriend {
1023
1023
  //
1024
- user_id: string;// user id
1024
+ userId: string; // user id
1025
1025
  // username
1026
1026
  username: string;
1027
1027
  // display name
1028
- display_name: string;
1028
+ displayName: string;
1029
1029
  // avatar
1030
1030
  avatar: string;
1031
1031
  }
1032
1032
  export interface RemoveFriend {
1033
1033
  //
1034
- user_id: string;
1034
+ userId: string;
1035
1035
  }
1036
1036
 
1037
1037
  export interface BlockFriend {
1038
1038
  //
1039
- user_id: string;
1039
+ userId: string;
1040
1040
  }
1041
1041
 
1042
1042
  export interface UnblockFriend {
1043
1043
  //
1044
- user_id: string;
1044
+ userId: string;
1045
1045
  //
1046
1046
  username: string;
1047
1047
  //
1048
1048
  avatar: string;
1049
1049
  //
1050
- display_name: string;
1050
+ displayName: string;
1051
1051
  //
1052
1052
  status: string;
1053
1053
  //
1054
- user_status: string;
1054
+ userStatus: string;
1055
1055
  }
1056
1056
 
1057
1057
  export interface AddUserEmojiUsageEvent {
1058
- emoji_id: string;
1059
- clan_id: string;
1058
+ emojiId: string;
1059
+ clanId: string;
1060
1060
  }
1061
1061
 
1062
1062
  /** Response cho ListUserEmojiUsage */
1063
1063
  export interface GetUserEmojiUsageEvent {
1064
1064
  clanId: string;
1065
- user_emoji_usage: Array<UserEmojiUsage>;
1065
+ userEmojiUsage: Array<UserEmojiUsage>;
1066
1066
  }
1067
1067
 
1068
1068
  /** On role assign */
@@ -1070,11 +1070,11 @@ export interface RoleAssignedEvent {
1070
1070
  /** The clan of this role */
1071
1071
  ClanId: string;
1072
1072
  /** Role ID */
1073
- role_id: string;
1073
+ roleId: string;
1074
1074
  /** UserIds Assigned */
1075
- user_ids_assigned: string[];
1075
+ userIdsAssigned: string[];
1076
1076
  /** UserIds Removed */
1077
- user_ids_removed: string[];
1077
+ userIdsRemoved: string[];
1078
1078
  }
1079
1079
 
1080
1080
  /** Streaming Joined event */
@@ -1082,144 +1082,144 @@ export interface StreamingLeavedEvent {
1082
1082
  /** id */
1083
1083
  id: string;
1084
1084
  /** The unique identifier of the chat clan. */
1085
- clan_id: string;
1085
+ clanId: string;
1086
1086
  /** streaming channel name */
1087
- streaming_channel_id: string;
1088
- /** streaming user_id */
1089
- streaming_user_id: string;
1087
+ streamingChannelId: string;
1088
+ /** streaming userId */
1089
+ streamingUserId: string;
1090
1090
  }
1091
1091
 
1092
1092
  /** Streaming Joined event */
1093
1093
  export interface StreamingJoinedEvent {
1094
1094
  /** The unique identifier of the chat clan. */
1095
- clan_id: string;
1095
+ clanId: string;
1096
1096
  /** The channel name */
1097
- clan_name: string;
1097
+ clanName: string;
1098
1098
  /** id streaming */
1099
1099
  id: string;
1100
1100
  /** streaming participant */
1101
1101
  participant: string;
1102
1102
  /** user id */
1103
- user_id: string;
1103
+ userId: string;
1104
1104
  /** streaming channel label */
1105
- streaming_channel_label: string;
1105
+ streamingChannelLabel: string;
1106
1106
  /** streaming channel id */
1107
- streaming_channel_id: string;
1107
+ streamingChannelId: string;
1108
1108
  }
1109
1109
 
1110
1110
  /** Streaming start event */
1111
1111
  export interface StreamingStartedEvent {
1112
1112
  /** clan id */
1113
- clan_id: string;
1113
+ clanId: string;
1114
1114
  /** channel id */
1115
- channel_id: string;
1115
+ channelId: string;
1116
1116
  /** stream url */
1117
- streaming_url: string;
1117
+ streamingUrl: string;
1118
1118
  /** status */
1119
- is_streaming: boolean;
1119
+ isStreaming: boolean;
1120
1120
  }
1121
1121
 
1122
1122
  /** Streaming start event */
1123
1123
  export interface StreamingEndedEvent {
1124
1124
  /** clan id */
1125
- clan_id: string;
1125
+ clanId: string;
1126
1126
  /** channel id */
1127
- channel_id: string;
1127
+ channelId: string;
1128
1128
  }
1129
1129
 
1130
1130
  export interface ChannelAppEvent {
1131
- user_id: string;
1131
+ userId: string;
1132
1132
  username: string;
1133
- clan_id: string;
1134
- channel_id: string;
1133
+ clanId: string;
1134
+ channelId: string;
1135
1135
  action: number;
1136
1136
  }
1137
1137
 
1138
1138
  export interface HandleParticipantMeetStateEvent {
1139
1139
  /** clan id */
1140
- clan_id: string;
1140
+ clanId: string;
1141
1141
  /** channel id */
1142
- channel_id: string;
1142
+ channelId: string;
1143
1143
  /** display name */
1144
- display_name: string;
1144
+ displayName: string;
1145
1145
  /** state (0: join, 1: leave) */
1146
1146
  state: number;
1147
1147
  /** room name */
1148
- room_name: string;
1148
+ roomName: string;
1149
1149
  }
1150
1150
 
1151
1151
  export interface PermissionSet {
1152
1152
  /** Role ID */
1153
- role_id: string;
1153
+ roleId: string;
1154
1154
  /** User ID */
1155
- user_id: string;
1155
+ userId: string;
1156
1156
  /** Channel ID */
1157
- channel_id: string;
1157
+ channelId: string;
1158
1158
  /** List permission update */
1159
- permission_updates: ApiPermissionUpdate[];
1159
+ permissionUpdates: ApiPermissionUpdate[];
1160
1160
  /** */
1161
1161
  caller: string;
1162
1162
  }
1163
1163
 
1164
1164
  export interface PermissionChangedEvent {
1165
- user_id: string;
1166
- channel_id: string;
1167
- add_permissions: ApiPermissionUpdate[];
1168
- remove_permissions: ApiPermissionUpdate[];
1169
- default_permissions: ApiPermissionUpdate[];
1165
+ userId: string;
1166
+ channelId: string;
1167
+ addPermissions: ApiPermissionUpdate[];
1168
+ removePermissions: ApiPermissionUpdate[];
1169
+ defaultPermissions: ApiPermissionUpdate[];
1170
1170
  }
1171
1171
 
1172
1172
  export interface DropdownBoxSelected {
1173
- message_id: string;
1174
- channel_id: string;
1175
- selectbox_id: string;
1176
- sender_id: string;
1177
- user_id: string;
1173
+ messageId: string;
1174
+ channelId: string;
1175
+ selectboxId: string;
1176
+ senderId: string;
1177
+ userId: string;
1178
1178
  value: Array<string>;
1179
1179
  }
1180
1180
 
1181
1181
  export interface MessageButtonClicked {
1182
- message_id: string;
1183
- channel_id: string;
1184
- button_id: string;
1185
- sender_id: string;
1186
- user_id: string;
1187
- extra_data: string;
1182
+ messageId: string;
1183
+ channelId: string;
1184
+ buttonId: string;
1185
+ senderId: string;
1186
+ userId: string;
1187
+ extraData: string;
1188
1188
  }
1189
1189
 
1190
1190
  export interface IncomingCallPush {
1191
- receiver_id: string;
1192
- json_data: string;
1193
- channel_id: string;
1194
- caller_id: string;
1191
+ receiverId: string;
1192
+ jsonData: string;
1193
+ channelId: string;
1194
+ callerId: string;
1195
1195
  }
1196
1196
 
1197
1197
  export interface VoiceReactionSend {
1198
1198
  // list emojis
1199
1199
  emojis: Array<string>;
1200
- // channel_id
1201
- channel_id: string;
1200
+ // channelId
1201
+ channelId: string;
1202
1202
  // sender id
1203
- sender_id: string;
1203
+ senderId: string;
1204
1204
  // media type
1205
- media_type: number;
1205
+ mediaType: number;
1206
1206
  }
1207
1207
 
1208
1208
  export interface MarkAsRead {
1209
- // channel id
1210
- channel_id: string;
1211
- // category_id
1212
- category_id: string;
1209
+ // channel id
1210
+ channelId: string;
1211
+ // categoryId
1212
+ categoryId: string;
1213
1213
  // clan id
1214
- clan_id: string;
1214
+ clanId: string;
1215
1215
  }
1216
1216
 
1217
1217
  export interface WebrtcSignalingFwd {
1218
- receiver_id: string;
1219
- data_type: number;
1220
- json_data: string;
1221
- channel_id: string;
1222
- caller_id: string;
1218
+ receiverId: string;
1219
+ dataType: number;
1220
+ jsonData: string;
1221
+ channelId: string;
1222
+ callerId: string;
1223
1223
  }
1224
1224
 
1225
1225
  export interface ListActivity {
@@ -1228,22 +1228,22 @@ export interface ListActivity {
1228
1228
 
1229
1229
  export interface SdTopicEvent {
1230
1230
  id: string;
1231
- clan_id: string;
1232
- channel_id: string;
1233
- message_id: string;
1234
- user_id: string;
1235
- last_sent_message?: ApiChannelMessageHeader;
1231
+ clanId: string;
1232
+ channelId: string;
1233
+ messageId: string;
1234
+ userId: string;
1235
+ lastSentMessage?: ApiChannelMessageHeader;
1236
1236
  message?: ApiChannelMessage;
1237
1237
  }
1238
1238
 
1239
1239
  export interface UserStatusEvent {
1240
- user_id: string;
1241
- custom_status: string;
1240
+ userId: string;
1241
+ customStatus: string;
1242
1242
  }
1243
1243
 
1244
1244
  export interface JoinChannelAppData {
1245
- user_id : string;
1246
- username : string;
1245
+ userId: string;
1246
+ username: string;
1247
1247
  hash: string;
1248
1248
  }
1249
1249
 
@@ -1252,17 +1252,17 @@ export interface ChannelCanvas {
1252
1252
  //
1253
1253
  content?: string;
1254
1254
  //
1255
- creator_id?: string;
1255
+ creatorId?: string;
1256
1256
  //
1257
- editor_id?: string;
1257
+ editorId?: string;
1258
1258
  //
1259
1259
  id?: string;
1260
1260
  //
1261
- is_default?: boolean;
1261
+ isDefault?: boolean;
1262
1262
  //
1263
1263
  title?: string;
1264
1264
  //
1265
- channel_id?: string;
1265
+ channelId?: string;
1266
1266
  //
1267
1267
  status?: number;
1268
1268
  }
@@ -1278,7 +1278,7 @@ export interface ListDataSocket {
1278
1278
  list_channel_users_uc_req?: any;
1279
1279
  channel_users_uc_list?: ApiAllUsersAddChannelResponse;
1280
1280
  list_channel_detail_req?: any;
1281
- channel_desc?: ApiChannelDescription;
1281
+ channelDesc?: ApiChannelDescription;
1282
1282
  list_channel_req?: any;
1283
1283
  list_channel_message_req?: any;
1284
1284
  channel_message_list?: ApiChannelMessageList;
@@ -1290,7 +1290,7 @@ export interface ListDataSocket {
1290
1290
  hashtag_dm_req?: any;
1291
1291
  hashtag_dm_list?: ApiHashtagDmList;
1292
1292
  channel_setting_req?: any;
1293
- channel_setting_list?: ApiChannelSettingListResponse;
1293
+ channelSettingList?: ApiChannelSettingListResponse;
1294
1294
  favorite_channel_req?: any;
1295
1295
  favorite_channel_list?: ApiListFavoriteChannelResponse;
1296
1296
  search_thread_req?: any;
@@ -1310,9 +1310,9 @@ export interface ListDataSocket {
1310
1310
  webhook_list_req?: any;
1311
1311
  webhook_list?: ApiWebhookListResponse;
1312
1312
  permission_list_req?: any;
1313
- permission_list?: ApiPermissionList;
1313
+ permissionList?: ApiPermissionList;
1314
1314
  role_user_req?: any;
1315
- role_user_list?: ApiRoleUserList;
1315
+ roleUserList?: ApiRoleUserList;
1316
1316
  permission_user_req?: any;
1317
1317
  role_list?: ApiRoleList;
1318
1318
  role_list_event_req?: any;
@@ -1321,7 +1321,7 @@ export interface ListDataSocket {
1321
1321
  user_permission_list?: ApiUserPermissionInChannelListResponse;
1322
1322
  permission_role_req?: any;
1323
1323
  permission_role_list?: ApiPermissionRoleChannelListEventResponse;
1324
- emoji_list?: ApiEmojiListedResponse;
1324
+ emojiList?: ApiEmojiListedResponse;
1325
1325
  list_friend_req?: any;
1326
1326
  friend_list?: ApiFriendList;
1327
1327
  list_apps_req?: any;
@@ -1329,8 +1329,8 @@ export interface ListDataSocket {
1329
1329
  user_activity_list?: ApiListUserActivity;
1330
1330
  }
1331
1331
 
1332
- function CreateChannelMessageFromEvent(message: any) {
1333
- var content, reactions, mentions, attachments, references, referencedMessags;
1332
+ function createChannelMessageFromEvent(message: any) {
1333
+ var content, reactions, mentions, attachments, references, referencedMessage;
1334
1334
  try {
1335
1335
  content = safeJSONParse(message.channel_message.content);
1336
1336
  } catch (e) {
@@ -1357,42 +1357,44 @@ function CreateChannelMessageFromEvent(message: any) {
1357
1357
  console.log("references is invalid", e);
1358
1358
  }
1359
1359
  try {
1360
- referencedMessags = safeJSONParse(message.channel_message.referenced_message);
1360
+ referencedMessage = safeJSONParse(
1361
+ message.channel_message.referenced_message
1362
+ );
1361
1363
  } catch (e) {
1362
1364
  console.log("referenced messages is invalid", e);
1363
1365
  }
1364
- var e: ChannelMessage = {
1366
+ var channelMessage: ChannelMessage = {
1365
1367
  id: message.id || message.channel_message.message_id,
1366
1368
  avatar: message.channel_message.avatar,
1367
- channel_id: message.channel_message.channel_id,
1369
+ channelId: message.channel_message.channel_id,
1368
1370
  mode: message.channel_message.mode,
1369
- channel_label: message.channel_message.channel_label,
1370
- clan_id: message.channel_message.clan_id,
1371
+ channelLabel: message.channel_message.channel_label,
1372
+ clanId: message.channel_message.clan_id,
1371
1373
  code: message.channel_message.code,
1372
- create_time: message.channel_message.create_time,
1373
- message_id: message.channel_message.message_id,
1374
- sender_id: message.channel_message.sender_id,
1375
- update_time: message.channel_message.update_time,
1376
- clan_logo: message.channel_message.clan_logo,
1377
- category_name: message.channel_message.category_name,
1374
+ messageId: message.channel_message.message_id,
1375
+ senderId: message.channel_message.sender_id,
1376
+ clanLogo: message.channel_message.clan_logo,
1377
+ categoryName: message.channel_message.category_name,
1378
1378
  username: message.channel_message.username,
1379
- clan_nick: message.channel_message.clan_nick,
1380
- clan_avatar: message.channel_message.clan_avatar,
1381
- display_name: message.channel_message.display_name,
1379
+ clanNick: message.channel_message.clan_nick,
1380
+ clanAvatar: message.channel_message.clan_avatar,
1381
+ displayName: message.channel_message.display_name,
1382
1382
  content: content,
1383
1383
  reactions: reactions,
1384
1384
  mentions: mentions,
1385
1385
  attachments: attachments,
1386
- referenced_message: referencedMessags,
1386
+ referencedMessage: referencedMessage,
1387
1387
  references: references,
1388
- hide_editted: message.channel_message.hide_editted,
1389
- is_public: message.channel_message.is_public,
1390
- create_time_seconds: message.channel_message.create_time_seconds,
1391
- update_time_seconds: message.channel_message.update_time_seconds,
1392
- topic_id: message.channel_message.topic_id,
1388
+ hideEditted: message.channel_message.hide_editted,
1389
+ isPublic: message.channel_message.is_public,
1390
+ createTime: message.channel_message.create_time,
1391
+ updateTime: message.channel_message.update_time,
1392
+ createTimeSeconds: message.channel_message.create_time_seconds,
1393
+ updateTimeSeconds: message.channel_message.update_time_seconds,
1394
+ topicId: message.channel_message.topic_id,
1393
1395
  };
1394
1396
 
1395
- return e;
1397
+ return channelMessage;
1396
1398
  }
1397
1399
 
1398
1400
  /** A socket connection to Mezon server. */
@@ -1413,71 +1415,71 @@ export interface Socket {
1413
1415
  disconnect(fireDisconnectEvent: boolean): void;
1414
1416
 
1415
1417
  /** Subscribe to one or more users for their status updates. */
1416
- followUsers(user_ids: string[]): Promise<Status>;
1418
+ followUsers(userIds: string[]): Promise<Status>;
1417
1419
 
1418
1420
  /** Join clan chat */
1419
- joinClanChat(clan_id: string): Promise<ClanJoin>;
1421
+ joinClanChat(clanId: string): Promise<ClanJoin>;
1420
1422
 
1421
1423
  follower(): Promise<void>;
1422
1424
 
1423
1425
  /** Join a chat channel on the server. */
1424
1426
  joinChat(
1425
- clan_id: string,
1426
- channel_id: string,
1427
- channel_type: number,
1428
- is_public: boolean
1427
+ clanId: string,
1428
+ channelId: string,
1429
+ channelType: number,
1430
+ isPublic: boolean
1429
1431
  ): Promise<Channel>;
1430
1432
 
1431
1433
  /** Leave a chat channel on the server. */
1432
1434
  leaveChat(
1433
- clan_id: string,
1434
- channel_id: string,
1435
- channel_type: number,
1436
- is_public: boolean
1435
+ clanId: string,
1436
+ channelId: string,
1437
+ channelType: number,
1438
+ isPublic: boolean
1437
1439
  ): Promise<void>;
1438
1440
 
1439
1441
  /** handle user join/leave channel voice on the server. */
1440
- handleParticipantMeetState (
1441
- clan_id: string,
1442
- channel_id: string,
1443
- display_name: string,
1442
+ handleParticipantMeetState(
1443
+ clanId: string,
1444
+ channelId: string,
1445
+ displayName: string,
1444
1446
  state: number,
1445
- room_name: string
1446
- ): Promise<void>
1447
+ roomName: string
1448
+ ): Promise<void>;
1447
1449
 
1448
1450
  /** Remove a chat message from a chat channel on the server. */
1449
1451
  removeChatMessage(
1450
- clan_id: string,
1451
- channel_id: string,
1452
+ clanId: string,
1453
+ channelId: string,
1452
1454
  mode: number,
1453
- is_public: boolean,
1454
- message_id: string,
1455
- has_attachment?: boolean,
1456
- topic_id?: string,
1457
- mentions?:string,
1455
+ isPublic: boolean,
1456
+ messageId: string,
1457
+ hasAttachment?: boolean,
1458
+ topicId?: string,
1459
+ mentions?: string,
1458
1460
  references?: string
1459
1461
  ): Promise<ChannelMessageAck>;
1460
1462
 
1461
1463
  /** Execute an RPC function to the server. */
1462
- rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
1464
+ rpc(id?: string, payload?: string, httpKey?: string): Promise<ApiRpc>;
1463
1465
 
1464
1466
  /** Unfollow one or more users from their status updates. */
1465
- unfollowUsers(user_ids: string[]): Promise<void>;
1467
+ unfollowUsers(userIds: string[]): Promise<void>;
1466
1468
 
1467
1469
  /** Update a chat message on a chat channel in the server. */
1468
1470
  updateChatMessage(
1469
- clan_id: string,
1470
- channel_id: string,
1471
+ clanId: string,
1472
+ channelId: string,
1471
1473
  mode: number,
1472
- is_public: boolean,
1473
- message_id: string,
1474
+ isPublic: boolean,
1475
+ messageId: string,
1474
1476
  content: any,
1475
1477
  mentions?: Array<ApiMessageMention>,
1476
1478
  attachments?: Array<ApiMessageAttachment>,
1477
1479
  hideEditted?: boolean,
1478
- topic_id?: string,
1479
- is_update_msg_topic?: boolean,
1480
- old_mentions?: string
1480
+ topicId?: string,
1481
+ isUpdateMsgTopic?: boolean,
1482
+ oldMentions?: string
1481
1483
  ): Promise<ChannelMessageAck>;
1482
1484
 
1483
1485
  /** Update the status for the current user online. */
@@ -1485,126 +1487,123 @@ export interface Socket {
1485
1487
 
1486
1488
  /** Send a chat message to a chat channel on the server. */
1487
1489
  writeChatMessage(
1488
- clan_id: string,
1489
- channel_id: string,
1490
+ clanId: string,
1491
+ channelId: string,
1490
1492
  mode: number,
1491
- is_public: boolean,
1493
+ isPublic: boolean,
1492
1494
  content?: any,
1493
1495
  mentions?: Array<ApiMessageMention>,
1494
1496
  attachments?: Array<ApiMessageAttachment>,
1495
1497
  references?: Array<ApiMessageRef>,
1496
- anonymous_message?: boolean,
1497
- mention_everyone?: boolean,
1498
+ anonymousMessage?: boolean,
1499
+ mentionEveryone?: boolean,
1498
1500
  avatar?: string,
1499
1501
  code?: number,
1500
- topic_id?: string,
1502
+ topicId?: string,
1501
1503
  id?: string
1502
1504
  ): Promise<ChannelMessageAck>;
1503
1505
 
1504
1506
  /** Send a chat message to a chat channel on the server. */
1505
1507
  writeEphemeralMessage(
1506
- receiver_id: string,
1507
- clan_id: string,
1508
- channel_id: string,
1508
+ receiverId: string,
1509
+ clanId: string,
1510
+ channelId: string,
1509
1511
  mode: number,
1510
- is_public: boolean,
1512
+ isPublic: boolean,
1511
1513
  content?: any,
1512
1514
  mentions?: Array<ApiMessageMention>,
1513
1515
  attachments?: Array<ApiMessageAttachment>,
1514
1516
  references?: Array<ApiMessageRef>,
1515
- anonymous_message?: boolean,
1516
- mention_everyone?: boolean,
1517
+ anonymousMessage?: boolean,
1518
+ mentionEveryone?: boolean,
1517
1519
  avatar?: string,
1518
1520
  code?: number,
1519
- topic_id?: string
1521
+ topicId?: string
1520
1522
  ): Promise<ChannelMessageAck>;
1521
1523
 
1522
1524
  /** Send a quick menu event to a chat channel on the server. */
1523
1525
  writeQuickMenuEvent(
1524
- menu_name: string,
1525
- clan_id: string,
1526
- channel_id: string,
1526
+ menuName: string,
1527
+ clanId: string,
1528
+ channelId: string,
1527
1529
  mode: number,
1528
- is_public: boolean,
1530
+ isPublic: boolean,
1529
1531
  content?: any,
1530
1532
  mentions?: Array<ApiMessageMention>,
1531
1533
  attachments?: Array<ApiMessageAttachment>,
1532
1534
  references?: Array<ApiMessageRef>,
1533
- anonymous_message?: boolean,
1534
- mention_everyone?: boolean,
1535
+ anonymousMessage?: boolean,
1536
+ mentionEveryone?: boolean,
1535
1537
  avatar?: string,
1536
1538
  code?: number,
1537
- topic_id?: string,
1539
+ topicId?: string,
1538
1540
  id?: string
1539
1541
  ): Promise<QuickMenuEvent>;
1540
1542
 
1541
1543
  /** Send message typing */
1542
1544
  writeMessageTyping(
1543
- clan_id: string,
1544
- channel_id: string,
1545
+ clanId: string,
1546
+ channelId: string,
1545
1547
  mode: number,
1546
- is_public: boolean,
1547
- sender_display_name: string,
1548
- topic_id?: string
1548
+ isPublic: boolean,
1549
+ senderDisplayName: string,
1550
+ topicId?: string
1549
1551
  ): Promise<MessageTypingEvent>;
1550
1552
 
1551
1553
  /** Send message reaction */
1552
1554
  writeMessageReaction(
1553
1555
  id: string,
1554
- clan_id: string,
1555
- channel_id: string,
1556
+ clanId: string,
1557
+ channelId: string,
1556
1558
  mode: number,
1557
- is_public: boolean,
1558
- message_id: string,
1559
- emoji_id: string,
1559
+ isPublic: boolean,
1560
+ messageId: string,
1561
+ emojiId: string,
1560
1562
  emoji: string,
1561
1563
  count: number,
1562
- message_sender_id: string,
1564
+ messageSenderId: string,
1563
1565
  action_delete: boolean,
1564
- topic_id?: string,
1565
- emoji_recent_id?: string,
1566
- sender_name?: string
1566
+ topicId?: string,
1567
+ emojiRecentId?: string,
1568
+ senderName?: string
1567
1569
  ): Promise<ApiMessageReaction>;
1568
1570
 
1569
1571
  /** Send last seen message */
1570
1572
  writeLastSeenMessage(
1571
- clan_id: string,
1572
- channel_id: string,
1573
+ clanId: string,
1574
+ channelId: string,
1573
1575
  mode: number,
1574
- message_id: string,
1575
- timestamp_seconds: number,
1576
- badge_count: number
1576
+ messageId: string,
1577
+ timestampSeconds: number,
1578
+ badgeCount: number
1577
1579
  ): Promise<LastSeenMessageEvent>;
1578
1580
 
1579
1581
  /** Send last pin message */
1580
1582
  writeLastPinMessage(
1581
- clan_id: string,
1582
- channel_id: string,
1583
+ clanId: string,
1584
+ channelId: string,
1583
1585
  mode: number,
1584
- is_public: boolean,
1585
- message_id: string,
1586
- timestamp_seconds: number,
1586
+ isPublic: boolean,
1587
+ messageId: string,
1588
+ timestampSeconds: number,
1587
1589
  operation: number,
1588
- message_sender_avatar: string,
1589
- message_sender_id: string,
1590
- message_sender_username: string,
1591
- message_content: string,
1592
- message_attachment: string,
1593
- message_created_time: string,
1590
+ messageSenderAvatar: string,
1591
+ messageSenderId: string,
1592
+ messageSenderUsername: string,
1593
+ messageContent: string,
1594
+ messageAttachment: string,
1595
+ messageCreatedTime: string
1594
1596
  ): Promise<LastPinMessageEvent>;
1595
1597
 
1596
1598
  /** Send custom user status */
1597
1599
  writeCustomStatus(
1598
- clan_id: string,
1600
+ clanId: string,
1599
1601
  status: string,
1600
- time_reset: number,
1601
- no_clear: boolean
1602
+ timeReset: number,
1603
+ noClear: boolean
1602
1604
  ): Promise<CustomStatusEvent>;
1603
1605
 
1604
- writeActiveArchivedThread(
1605
- clan_id: string,
1606
- channel_id: string
1607
- ): Promise<void>;
1606
+ writeActiveArchivedThread(clanId: string, channelId: string): Promise<void>;
1608
1607
 
1609
1608
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
1610
1609
  setHeartbeatTimeoutMs(ms: number): void;
@@ -1618,56 +1617,54 @@ export interface Socket {
1618
1617
  name: string,
1619
1618
  condition_id: string,
1620
1619
  type: number,
1621
- clan_id: string,
1620
+ clanId: string
1622
1621
  ): Promise<CheckNameExistedEvent>;
1623
1622
 
1624
1623
  handleMessageButtonClick: (
1625
- message_id: string,
1626
- channel_id: string,
1627
- button_id: string,
1628
- sender_id: string,
1629
- user_id: string,
1630
- extra_data: string
1624
+ messageId: string,
1625
+ channelId: string,
1626
+ buttonId: string,
1627
+ senderId: string,
1628
+ userId: string,
1629
+ extraData: string
1631
1630
  ) => Promise<MessageButtonClicked>;
1632
1631
 
1633
1632
  handleDropdownBoxSelected: (
1634
- message_id: string,
1635
- channel_id: string,
1636
- selectbox_id: string,
1637
- sender_id: string,
1638
- user_id: string,
1633
+ messageId: string,
1634
+ channelId: string,
1635
+ selectboxId: string,
1636
+ senderId: string,
1637
+ userId: string,
1639
1638
  value: Array<string>
1640
1639
  ) => Promise<DropdownBoxSelected>;
1641
1640
 
1642
1641
  writeVoiceReaction: (
1643
1642
  emojis: Array<string>,
1644
- channel_id: string
1645
- ) => Promise<VoiceReactionSend>
1643
+ channelId: string
1644
+ ) => Promise<VoiceReactionSend>;
1646
1645
 
1647
1646
  forwardWebrtcSignaling: (
1648
1647
  receiverId: string,
1649
1648
  dataType: number,
1650
1649
  jsonData: string,
1651
1650
  channelId: string,
1652
- caller_id: string
1651
+ callerId: string
1653
1652
  ) => Promise<WebrtcSignalingFwd>;
1654
1653
 
1655
1654
  makeCallPush: (
1656
1655
  receiverId: string,
1657
1656
  jsonData: string,
1658
1657
  channelId: string,
1659
- caller_id: string
1658
+ callerId: string
1660
1659
  ) => Promise<IncomingCallPush>;
1661
1660
 
1662
1661
  writeChannelAppEvent: (
1663
- clan_id: string,
1664
- channel_id: string,
1662
+ clanId: string,
1663
+ channelId: string,
1665
1664
  action: number
1666
1665
  ) => Promise<ChannelAppEvent>;
1667
1666
 
1668
- listDataSocket(
1669
- request: ListDataSocket
1670
- ): Promise<any>;
1667
+ listDataSocket(request: ListDataSocket): Promise<any>;
1671
1668
 
1672
1669
  /** Handle disconnect events received from the socket. */
1673
1670
  ondisconnect: (evt: Event) => void;
@@ -1799,7 +1796,9 @@ export interface Socket {
1799
1796
 
1800
1797
  oneventemoji: (event_emoji: EventEmoji) => void;
1801
1798
 
1802
- oneventnotiuserchannel: (noti_user_channel: ApiNotificationUserChannel) => void;
1799
+ oneventnotiuserchannel: (
1800
+ noti_user_channel: ApiNotificationUserChannel
1801
+ ) => void;
1803
1802
 
1804
1803
  oneventwebhook: (webhook_event: ApiWebhook) => void;
1805
1804
 
@@ -1845,7 +1844,7 @@ export interface Socket {
1845
1844
 
1846
1845
  onjoinchannelappevent: (join_channel_app_data: JoinChannelAppData) => void;
1847
1846
 
1848
- onunpinmessageevent: (unpin_message_event: UnpinMessageEvent)=> void;
1847
+ onunpinmessageevent: (unpin_message_event: UnpinMessageEvent) => void;
1849
1848
 
1850
1849
  onquickmenuevent: (event: QuickMenuEvent) => void;
1851
1850
 
@@ -1871,7 +1870,8 @@ export const ConnectionState = {
1871
1870
  CONNECTED: "connected",
1872
1871
  } as const;
1873
1872
 
1874
- export type ConnectionStateType = typeof ConnectionState[keyof typeof ConnectionState];
1873
+ export type ConnectionStateType =
1874
+ (typeof ConnectionState)[keyof typeof ConnectionState];
1875
1875
 
1876
1876
  export class DefaultSocket implements Socket {
1877
1877
  public static readonly DefaultHeartbeatTimeoutMs = 10000;
@@ -1921,7 +1921,10 @@ export class DefaultSocket implements Socket {
1921
1921
  return Promise.resolve(session);
1922
1922
  }
1923
1923
 
1924
- if (this._connectionState === ConnectionState.CONNECTING && this._connectPromise) {
1924
+ if (
1925
+ this._connectionState === ConnectionState.CONNECTING &&
1926
+ this._connectPromise
1927
+ ) {
1925
1928
  return this._connectPromise;
1926
1929
  }
1927
1930
 
@@ -1947,6 +1950,8 @@ export class DefaultSocket implements Socket {
1947
1950
  };
1948
1951
 
1949
1952
  this.adapter.onMessage = async (message: any) => {
1953
+ console.log("message:", message);
1954
+
1950
1955
  if (this.verbose && window && window.console) {
1951
1956
  console.log("Response: %o", JSON.stringify(message));
1952
1957
  }
@@ -1958,178 +1963,237 @@ export class DefaultSocket implements Socket {
1958
1963
  this.onnotification(n);
1959
1964
  });
1960
1965
  } else if (message.voice_started_event) {
1961
- this.onvoicestarted(message.voice_started_event);
1966
+ this.onvoicestarted(mapToCamelCase(message.voice_started_event));
1962
1967
  } else if (message.voice_ended_event) {
1963
- this.onvoiceended(message.voice_ended_event);
1968
+ this.onvoiceended(mapToCamelCase(message.voice_ended_event));
1964
1969
  } else if (message.voice_joined_event) {
1965
- this.onvoicejoined(message.voice_joined_event);
1970
+ this.onvoicejoined(mapToCamelCase(message.voice_joined_event));
1966
1971
  } else if (message.voice_leaved_event) {
1967
- this.onvoiceleaved(message.voice_leaved_event);
1972
+ this.onvoiceleaved(mapToCamelCase(message.voice_leaved_event));
1968
1973
  } else if (message.channel_created_event) {
1969
- this.onchannelcreated(message.channel_created_event);
1974
+ this.onchannelcreated(mapToCamelCase(message.channel_created_event));
1970
1975
  } else if (message.category_event) {
1971
- this.oncategoryevent(message.category_event);
1976
+ this.oncategoryevent(mapToCamelCase(message.category_event));
1972
1977
  } else if (message.role_event) {
1973
- this.onroleevent(message.role_event);
1978
+ this.onroleevent(mapToCamelCase(message.role_event));
1974
1979
  } else if (message.event_emoji) {
1975
- this.oneventemoji(message.event_emoji);
1980
+ this.oneventemoji(mapToCamelCase(message.event_emoji));
1976
1981
  } else if (message.noti_user_channel) {
1977
- this.oneventnotiuserchannel(message.noti_user_channel);
1982
+ this.oneventnotiuserchannel(
1983
+ mapToCamelCase(message.noti_user_channel)
1984
+ );
1978
1985
  } else if (message.webhook_event) {
1979
- this.oneventwebhook(message.webhook_event);
1986
+ this.oneventwebhook(mapToCamelCase(message.webhook_event));
1980
1987
  } else if (message.channel_deleted_event) {
1981
- this.onchanneldeleted(message.channel_deleted_event);
1988
+ this.onchanneldeleted(mapToCamelCase(message.channel_deleted_event));
1982
1989
  } else if (message.clan_deleted_event) {
1983
- this.onclandeleted(message.clan_deleted_event);
1990
+ this.onclandeleted(mapToCamelCase(message.clan_deleted_event));
1984
1991
  } else if (message.sticker_create_event) {
1985
- this.onstickercreated(message.sticker_create_event);
1992
+ this.onstickercreated(mapToCamelCase(message.sticker_create_event));
1986
1993
  } else if (message.sticker_update_event) {
1987
- this.onstickerupdated(message.sticker_update_event);
1994
+ this.onstickerupdated(mapToCamelCase(message.sticker_update_event));
1988
1995
  } else if (message.sticker_delete_event) {
1989
- this.onstickerdeleted(message.sticker_delete_event);
1996
+ this.onstickerdeleted(mapToCamelCase(message.sticker_delete_event));
1990
1997
  } else if (message.channel_updated_event) {
1991
- this.onchannelupdated(message.channel_updated_event);
1998
+ this.onchannelupdated(mapToCamelCase(message.channel_updated_event));
1992
1999
  } else if (message.delete_account_event) {
1993
- this.ondeleteaccount(message.delete_account_event);
2000
+ this.ondeleteaccount(mapToCamelCase(message.delete_account_event));
1994
2001
  } else if (message.clan_profile_updated_event) {
1995
- this.onclanprofileupdated(message.clan_profile_updated_event);
2002
+ this.onclanprofileupdated(
2003
+ mapToCamelCase(message.clan_profile_updated_event)
2004
+ );
1996
2005
  } else if (message.clan_updated_event) {
1997
- this.onclanupdated(message.clan_updated_event);
2006
+ this.onclanupdated(mapToCamelCase(message.clan_updated_event));
1998
2007
  } else if (message.last_seen_message_event) {
1999
- this.onlastseenupdated(message.last_seen_message_event);
2008
+ this.onlastseenupdated(
2009
+ mapToCamelCase(message.last_seen_message_event)
2010
+ );
2000
2011
  } else if (message.status_presence_event) {
2001
2012
  this.onstatuspresence(
2002
- <StatusPresenceEvent>message.status_presence_event
2013
+ mapToCamelCase(<StatusPresenceEvent>message.status_presence_event)
2003
2014
  );
2004
2015
  } else if (message.stream_presence_event) {
2005
2016
  this.onstreampresence(
2006
- <StreamPresenceEvent>message.stream_presence_event
2017
+ mapToCamelCase(<StreamPresenceEvent>message.stream_presence_event)
2007
2018
  );
2008
2019
  } else if (message.stream_data) {
2009
- this.onstreamdata(<StreamData>message.stream_data);
2010
- } else if (message.channel_message) {
2011
- const channelMessage = CreateChannelMessageFromEvent(message);
2012
- this.onchannelmessage(channelMessage);
2020
+ this.onstreamdata(mapToCamelCase(<StreamData>message.stream_data));
2021
+ } else if (message.channel_message) {
2022
+ console.log("message.channel_message:", message.channel_message);
2023
+ const channelMessage = createChannelMessageFromEvent(message);
2024
+ this.onchannelmessage(mapToCamelCase(channelMessage));
2013
2025
  } else if (message.message_typing_event) {
2014
2026
  this.onmessagetyping(
2015
- <MessageTypingEvent>message.message_typing_event
2027
+ mapToCamelCase(<MessageTypingEvent>message.message_typing_event)
2016
2028
  );
2017
2029
  } else if (message.message_reaction_event) {
2018
2030
  this.onmessagereaction(
2019
- <ApiMessageReaction>message.message_reaction_event
2031
+ mapToCamelCase(<ApiMessageReaction>message.message_reaction_event)
2020
2032
  );
2021
2033
  } else if (message.channel_presence_event) {
2022
2034
  this.onchannelpresence(
2023
- <ChannelPresenceEvent>message.channel_presence_event
2035
+ mapToCamelCase(<ChannelPresenceEvent>message.channel_presence_event)
2024
2036
  );
2025
2037
  } else if (message.last_pin_message_event) {
2026
2038
  this.onpinmessage(
2027
- <LastPinMessageEvent>message.last_pin_message_event
2039
+ mapToCamelCase(<LastPinMessageEvent>message.last_pin_message_event)
2028
2040
  );
2029
2041
  } else if (message.custom_status_event) {
2030
- this.oncustomstatus(<CustomStatusEvent>message.custom_status_event);
2042
+ this.oncustomstatus(
2043
+ mapToCamelCase(<CustomStatusEvent>message.custom_status_event)
2044
+ );
2031
2045
  } else if (message.canvas_event) {
2032
- this.oncanvasevent(<ChannelCanvas>message.canvas_event);
2046
+ this.oncanvasevent(
2047
+ mapToCamelCase(<ChannelCanvas>message.canvas_event)
2048
+ );
2033
2049
  } else if (message.user_channel_added_event) {
2034
2050
  this.onuserchanneladded(
2035
- <UserChannelAddedEvent>message.user_channel_added_event
2051
+ mapToCamelCase(
2052
+ <UserChannelAddedEvent>message.user_channel_added_event
2053
+ )
2036
2054
  );
2037
2055
  } else if (message.add_clan_user_event) {
2038
- this.onuserclanadded(<AddClanUserEvent>message.add_clan_user_event);
2056
+ this.onuserclanadded(
2057
+ mapToCamelCase(<AddClanUserEvent>message.add_clan_user_event)
2058
+ );
2039
2059
  } else if (message.user_profile_updated_event) {
2040
2060
  this.onuserprofileupdate(
2041
- <UserProfileUpdatedEvent>message.user_profile_updated_event
2061
+ mapToCamelCase(
2062
+ <UserProfileUpdatedEvent>message.user_profile_updated_event
2063
+ )
2042
2064
  );
2043
2065
  } else if (message.user_channel_removed_event) {
2044
2066
  this.onuserchannelremoved(
2045
- <UserChannelRemovedEvent>message.user_channel_removed_event
2067
+ mapToCamelCase(
2068
+ <UserChannelRemovedEvent>message.user_channel_removed_event
2069
+ )
2046
2070
  );
2047
2071
  } else if (message.block_friend) {
2048
- this.onblockfriend(<BlockFriend>message.block_friend);
2072
+ this.onblockfriend(mapToCamelCase(<BlockFriend>message.block_friend));
2049
2073
  } else if (message.un_block_friend) {
2050
- this.onunblockfriend(<UnblockFriend>message.un_block_friend);
2074
+ this.onunblockfriend(
2075
+ mapToCamelCase(<UnblockFriend>message.un_block_friend)
2076
+ );
2051
2077
  } else if (message.add_friend) {
2052
- this.onaddfriend(<AddFriend>message.add_friend);
2078
+ this.onaddfriend(mapToCamelCase(<AddFriend>message.add_friend));
2053
2079
  } else if (message.remove_friend) {
2054
- this.onremovefriend(<RemoveFriend>message.remove_friend);
2080
+ this.onremovefriend(
2081
+ mapToCamelCase(<RemoveFriend>message.remove_friend)
2082
+ );
2055
2083
  } else if (message.user_clan_removed_event) {
2056
2084
  this.onuserclanremoved(
2057
- <UserClanRemovedEvent>message.user_clan_removed_event
2085
+ mapToCamelCase(
2086
+ <UserClanRemovedEvent>message.user_clan_removed_event
2087
+ )
2058
2088
  );
2059
2089
  } else if (message.clan_event_created) {
2060
- this.oneventcreated(message.clan_event_created);
2090
+ this.oneventcreated(mapToCamelCase(message.clan_event_created));
2061
2091
  } else if (message.give_coffee_event) {
2062
- this.oncoffeegiven(<ApiGiveCoffeeEvent>message.give_coffee_event);
2092
+ this.oncoffeegiven(
2093
+ mapToCamelCase(<ApiGiveCoffeeEvent>message.give_coffee_event)
2094
+ );
2063
2095
  } else if (message.role_assign_event) {
2064
- this.onroleassign(<RoleAssignedEvent>message.role_assign_event);
2096
+ this.onroleassign(
2097
+ mapToCamelCase(<RoleAssignedEvent>message.role_assign_event)
2098
+ );
2065
2099
  } else if (message.streaming_started_event) {
2066
2100
  this.onstreamingchannelstarted(
2067
- <StreamingStartedEvent>message.streaming_started_event
2101
+ mapToCamelCase(
2102
+ <StreamingStartedEvent>message.streaming_started_event
2103
+ )
2068
2104
  );
2069
2105
  } else if (message.streaming_ended_event) {
2070
2106
  this.onstreamingchannelended(
2071
- <StreamingEndedEvent>message.streaming_ended_event
2107
+ mapToCamelCase(<StreamingEndedEvent>message.streaming_ended_event)
2072
2108
  );
2073
2109
  } else if (message.streaming_joined_event) {
2074
2110
  this.onstreamingchanneljoined(
2075
- <StreamingJoinedEvent>message.streaming_joined_event
2111
+ mapToCamelCase(<StreamingJoinedEvent>message.streaming_joined_event)
2076
2112
  );
2077
2113
  } else if (message.streaming_leaved_event) {
2078
2114
  this.onstreamingchannelleaved(
2079
- <StreamingLeavedEvent>message.streaming_leaved_event
2115
+ mapToCamelCase(<StreamingLeavedEvent>message.streaming_leaved_event)
2080
2116
  );
2081
2117
  } else if (message.permission_set_event) {
2082
- this.onpermissionset(<PermissionSet>message.permission_set_event);
2118
+ this.onpermissionset(
2119
+ mapToCamelCase(<PermissionSet>message.permission_set_event)
2120
+ );
2083
2121
  } else if (message.permission_changed_event) {
2084
2122
  this.onpermissionchanged(
2085
- <PermissionChangedEvent>message.permission_changed_event
2123
+ mapToCamelCase(
2124
+ <PermissionChangedEvent>message.permission_changed_event
2125
+ )
2086
2126
  );
2087
2127
  } else if (message.unmute_event) {
2088
- this.onunmuteevent(<UnmuteEvent>message.unmute_event);
2128
+ this.onunmuteevent(mapToCamelCase(<UnmuteEvent>message.unmute_event));
2089
2129
  } else if (message.token_sent_event) {
2090
- this.ontokensent(<ApiTokenSentEvent>message.token_sent_event);
2130
+ this.ontokensent(
2131
+ mapToCamelCase(<ApiTokenSentEvent>message.token_sent_event)
2132
+ );
2091
2133
  } else if (message.message_button_clicked) {
2092
2134
  this.onmessagebuttonclicked(
2093
- <MessageButtonClicked>message.message_button_clicked
2135
+ mapToCamelCase(<MessageButtonClicked>message.message_button_clicked)
2094
2136
  );
2095
2137
  } else if (message.dropdown_box_selected) {
2096
2138
  this.onmessagedropdownboxselected(
2097
- <DropdownBoxSelected>message.dropdown_box_selected
2139
+ mapToCamelCase(<DropdownBoxSelected>message.dropdown_box_selected)
2098
2140
  );
2099
2141
  } else if (message.mark_as_read) {
2100
- this.onmarkasread(
2101
- <MarkAsRead>message.mark_as_read
2102
- );
2142
+ this.onmarkasread(mapToCamelCase(<MarkAsRead>message.mark_as_read));
2103
2143
  } else if (message.voice_reaction_send) {
2104
2144
  this.onvoicereactionmessage(
2105
- <VoiceReactionSend>message.voice_reaction_send
2145
+ mapToCamelCase(<VoiceReactionSend>message.voice_reaction_send)
2106
2146
  );
2107
2147
  } else if (message.webrtc_signaling_fwd) {
2108
2148
  this.onwebrtcsignalingfwd(
2109
- <WebrtcSignalingFwd>message.webrtc_signaling_fwd
2149
+ mapToCamelCase(<WebrtcSignalingFwd>message.webrtc_signaling_fwd)
2110
2150
  );
2111
2151
  } else if (message.list_activity) {
2112
- this.onactivityupdated(<ListActivity>message.list_activity);
2152
+ this.onactivityupdated(
2153
+ mapToCamelCase(<ListActivity>message.list_activity)
2154
+ );
2113
2155
  } else if (message.sd_topic_event) {
2114
- this.onsdtopicevent(<SdTopicEvent>message.sd_topic_event);
2156
+ this.onsdtopicevent(
2157
+ mapToCamelCase(<SdTopicEvent>message.sd_topic_event)
2158
+ );
2115
2159
  } else if (message.channel_app_event) {
2116
- this.onchannelappevent(<ChannelAppEvent>message.channel_app_event);
2160
+ this.onchannelappevent(
2161
+ mapToCamelCase(<ChannelAppEvent>message.channel_app_event)
2162
+ );
2117
2163
  } else if (message.user_status_event) {
2118
- this.onuserstatusevent(<UserStatusEvent>message.user_status_event);
2164
+ this.onuserstatusevent(
2165
+ mapToCamelCase(<UserStatusEvent>message.user_status_event)
2166
+ );
2119
2167
  } else if (message.join_channel_app_data) {
2120
- this.onjoinchannelappevent(<JoinChannelAppData>message.join_channel_app_data);
2168
+ this.onjoinchannelappevent(
2169
+ mapToCamelCase(<JoinChannelAppData>message.join_channel_app_data)
2170
+ );
2121
2171
  } else if (message.unpin_message_event) {
2122
- this.onunpinmessageevent(<UnpinMessageEvent>message.unpin_message_event);
2172
+ this.onunpinmessageevent(
2173
+ mapToCamelCase(<UnpinMessageEvent>message.unpin_message_event)
2174
+ );
2123
2175
  } else if (message.quick_menu_event) {
2124
- this.onquickmenuevent(<QuickMenuEvent>message.quick_menu_event);
2176
+ this.onquickmenuevent(
2177
+ mapToCamelCase(<QuickMenuEvent>message.quick_menu_event)
2178
+ );
2125
2179
  } else if (message.meet_participant_event) {
2126
- this.onmeetparticipantevent(<MeetParticipantEvent>message.meet_participant_event);
2180
+ this.onmeetparticipantevent(
2181
+ mapToCamelCase(<MeetParticipantEvent>message.meet_participant_event)
2182
+ );
2127
2183
  } else if (message.transfer_ownership_event) {
2128
- this.ontransferownership(<TransferOwnershipEvent>message.transfer_ownership_event);
2184
+ this.ontransferownership(
2185
+ mapToCamelCase(
2186
+ <TransferOwnershipEvent>message.transfer_ownership_event
2187
+ )
2188
+ );
2129
2189
  } else if (message.ban_user_event) {
2130
- this.onbanneduser(<BannedUserEvent>message.ban_user_event);
2190
+ this.onbanneduser(
2191
+ mapToCamelCase(<BannedUserEvent>message.ban_user_event)
2192
+ );
2131
2193
  } else if (message.allow_anonymous_event) {
2132
- this.onallowanonymousevent(<AllowAnonymousEvent>message.allow_anonymous_event);
2194
+ this.onallowanonymousevent(
2195
+ mapToCamelCase(<AllowAnonymousEvent>message.allow_anonymous_event)
2196
+ );
2133
2197
  } else {
2134
2198
  if (this.verbose && window && window.console) {
2135
2199
  console.log("Unrecognized message received: %o", message);
@@ -2166,7 +2230,7 @@ export class DefaultSocket implements Socket {
2166
2230
  this._connectionState = ConnectionState.CONNECTED;
2167
2231
  this.startHeartbeatLoop();
2168
2232
  this._connectPromise = undefined;
2169
-
2233
+
2170
2234
  resolve(session);
2171
2235
 
2172
2236
  if (isReconnect) {
@@ -2608,7 +2672,7 @@ export class DefaultSocket implements Socket {
2608
2672
  console.log(join_channel_app_data);
2609
2673
  }
2610
2674
  }
2611
-
2675
+
2612
2676
  onunpinmessageevent(unpin_message_event: UnpinMessageEvent) {
2613
2677
  if (this.verbose && window && window.console) {
2614
2678
  console.log(unpin_message_event);
@@ -2629,7 +2693,7 @@ export class DefaultSocket implements Socket {
2629
2693
 
2630
2694
  onbanneduser(event: BannedUserEvent) {
2631
2695
  if (this.verbose && window && window.console) {
2632
- console.log(event)
2696
+ console.log(event);
2633
2697
  }
2634
2698
  }
2635
2699
 
@@ -2671,6 +2735,7 @@ export class DefaultSocket implements Socket {
2671
2735
  | QuickMenuEvent,
2672
2736
  sendTimeout = DefaultSocket.DefaultSendTimeoutMs
2673
2737
  ): Promise<any> {
2738
+ console.log("Sending message:", message);
2674
2739
  const untypedMessage = message as any;
2675
2740
 
2676
2741
  return new Promise<void>((resolve, reject) => {
@@ -2678,21 +2743,30 @@ export class DefaultSocket implements Socket {
2678
2743
  reject("Socket connection has not been established yet.");
2679
2744
  } else {
2680
2745
  if (untypedMessage.channel_message_send) {
2746
+ console.log(
2747
+ "untypedMessage.channel_message_send:",
2748
+ untypedMessage.channel_message_send
2749
+ );
2681
2750
  untypedMessage.channel_message_send.content = JSON.stringify(
2682
2751
  untypedMessage.channel_message_send.content
2683
2752
  );
2753
+ console.log(
2754
+ "untypedMessage.channel_message_send.content:",
2755
+ untypedMessage.channel_message_send.content
2756
+ );
2684
2757
  } else if (untypedMessage.channel_message_update) {
2685
2758
  untypedMessage.channel_message_update.content = JSON.stringify(
2686
2759
  untypedMessage.channel_message_update.content
2687
2760
  );
2688
2761
  } else if (untypedMessage.ephemeral_message_send) {
2689
- untypedMessage.ephemeral_message_send.message.content = JSON.stringify(
2690
- untypedMessage.ephemeral_message_send.message?.content
2691
- );
2762
+ untypedMessage.ephemeral_message_send.message.content =
2763
+ JSON.stringify(
2764
+ untypedMessage.ephemeral_message_send.message?.content
2765
+ );
2692
2766
  } else if (untypedMessage.quick_menu_event) {
2693
2767
  untypedMessage.quick_menu_event.message.content = JSON.stringify(
2694
2768
  untypedMessage.quick_menu_event.message?.content
2695
- );
2769
+ );
2696
2770
  }
2697
2771
 
2698
2772
  const cid = this.generatecid();
@@ -2704,6 +2778,7 @@ export class DefaultSocket implements Socket {
2704
2778
  }
2705
2779
 
2706
2780
  untypedMessage.cid = cid;
2781
+ console.log("untypedMessage:", untypedMessage);
2707
2782
  this.adapter.send(untypedMessage);
2708
2783
  }
2709
2784
  });
@@ -2711,17 +2786,17 @@ export class DefaultSocket implements Socket {
2711
2786
 
2712
2787
  async followUsers(userIds: string[]): Promise<Status> {
2713
2788
  const response = await this.send({ status_follow: { user_ids: userIds } });
2714
- return response.status;
2789
+ return mapToCamelCase(response.status);
2715
2790
  }
2716
2791
 
2717
- async joinClanChat(clan_id: string): Promise<ClanJoin> {
2792
+ async joinClanChat(clanId: string): Promise<ClanJoin> {
2718
2793
  const response = await this.send({
2719
2794
  clan_join: {
2720
- clan_id: clan_id,
2795
+ clan_id: clanId,
2721
2796
  },
2722
2797
  });
2723
2798
 
2724
- return response.clan_join;
2799
+ return mapToCamelCase(response.clanJoin);
2725
2800
  }
2726
2801
 
2727
2802
  async follower(): Promise<void> {
@@ -2729,138 +2804,138 @@ export class DefaultSocket implements Socket {
2729
2804
  follow_event: {},
2730
2805
  });
2731
2806
 
2732
- return response.follow_event;
2807
+ return mapToCamelCase(response.followEvent);
2733
2808
  }
2734
2809
 
2735
2810
  async joinChat(
2736
- clan_id: string,
2737
- channel_id: string,
2738
- channel_type: number,
2739
- is_public: boolean
2811
+ clanId: string,
2812
+ channelId: string,
2813
+ channelType: number,
2814
+ isPublic: boolean
2740
2815
  ): Promise<Channel> {
2741
2816
  const response = await this.send({
2742
2817
  channel_join: {
2743
- clan_id: clan_id,
2744
- channel_id: channel_id,
2745
- channel_type: channel_type,
2746
- is_public: is_public,
2818
+ clan_id: clanId,
2819
+ channel_id: channelId,
2820
+ channel_type: channelType,
2821
+ is_public: isPublic,
2747
2822
  },
2748
2823
  });
2749
2824
 
2750
- return response.channel;
2825
+ return mapToCamelCase(response.channel);
2751
2826
  }
2752
2827
 
2753
- async handleParticipantMeetState (
2754
- clan_id: string,
2755
- channel_id: string,
2756
- display_name: string,
2828
+ async handleParticipantMeetState(
2829
+ clanId: string,
2830
+ channelId: string,
2831
+ displayName: string,
2757
2832
  state: number,
2758
- room_name: string,
2833
+ roomName: string
2759
2834
  ): Promise<void> {
2760
2835
  const response = await this.send({
2761
2836
  handle_participant_meet_state_event: {
2762
- clan_id: clan_id,
2763
- channel_id: channel_id,
2764
- display_name: display_name,
2837
+ clan_id: clanId,
2838
+ channel_id: channelId,
2839
+ display_name: displayName,
2765
2840
  state: state,
2766
- room_name: room_name,
2841
+ room_name: roomName,
2767
2842
  },
2768
2843
  });
2769
2844
 
2770
- return response.handle_participant_meet_state_event;
2845
+ return mapToCamelCase(response.handleParticipantMeetStateEvent);
2771
2846
  }
2772
2847
 
2773
2848
  leaveChat(
2774
- clan_id: string,
2775
- channel_id: string,
2776
- channel_type: number,
2777
- is_public: boolean
2849
+ clanId: string,
2850
+ channelId: string,
2851
+ channelType: number,
2852
+ isPublic: boolean
2778
2853
  ): Promise<void> {
2779
2854
  return this.send({
2780
2855
  channel_leave: {
2781
- clan_id: clan_id,
2782
- channel_id: channel_id,
2783
- channel_type: channel_type,
2784
- is_public: is_public,
2856
+ clan_id: clanId,
2857
+ channel_id: channelId,
2858
+ channel_type: channelType,
2859
+ is_public: isPublic,
2785
2860
  },
2786
2861
  });
2787
2862
  }
2788
2863
 
2789
2864
  async removeChatMessage(
2790
- clan_id: string,
2791
- channel_id: string,
2865
+ clanId: string,
2866
+ channelId: string,
2792
2867
  mode: number,
2793
- is_public: boolean,
2794
- message_id: string,
2795
- has_attachment?: boolean,
2796
- topic_id?: string,
2868
+ isPublic: boolean,
2869
+ messageId: string,
2870
+ hasAttachment?: boolean,
2871
+ topicId?: string,
2797
2872
  mentions?: string,
2798
2873
  references?: string
2799
2874
  ): Promise<ChannelMessageAck> {
2800
2875
  const response = await this.send({
2801
2876
  channel_message_remove: {
2802
- clan_id: clan_id,
2803
- channel_id: channel_id,
2877
+ clan_id: clanId,
2878
+ channel_id: channelId,
2804
2879
  mode: mode,
2805
- message_id: message_id,
2806
- is_public: is_public,
2807
- has_attachment: has_attachment,
2808
- topic_id: topic_id,
2880
+ message_id: messageId,
2881
+ is_public: isPublic,
2882
+ has_attachment: hasAttachment,
2883
+ topic_id: topicId,
2809
2884
  mentions: mentions,
2810
- references: references
2885
+ references: references,
2811
2886
  },
2812
2887
  });
2813
2888
 
2814
- return response.channel_message_ack;
2889
+ return mapToCamelCase(response.channel_message_ack);
2815
2890
  }
2816
2891
 
2817
- async rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc> {
2892
+ async rpc(id?: string, payload?: string, httpKey?: string): Promise<ApiRpc> {
2818
2893
  const response = await this.send({
2819
2894
  rpc: {
2820
2895
  id: id,
2821
2896
  payload: payload,
2822
- http_key: http_key,
2897
+ http_key: httpKey,
2823
2898
  },
2824
2899
  });
2825
2900
 
2826
- return response.rpc;
2901
+ return mapToCamelCase(response.rpc);
2827
2902
  }
2828
2903
 
2829
- unfollowUsers(user_ids: string[]): Promise<void> {
2830
- return this.send({ status_unfollow: { user_ids: user_ids } });
2904
+ unfollowUsers(userIds: string[]): Promise<void> {
2905
+ return this.send({ status_unfollow: { user_ids: userIds } });
2831
2906
  }
2832
2907
 
2833
2908
  async updateChatMessage(
2834
- clan_id: string,
2835
- channel_id: string,
2909
+ clanId: string,
2910
+ channelId: string,
2836
2911
  mode: number,
2837
- is_public: boolean,
2838
- message_id: string,
2912
+ isPublic: boolean,
2913
+ messageId: string,
2839
2914
  content: any,
2840
2915
  mentions?: Array<ApiMessageMention>,
2841
2916
  attachments?: Array<ApiMessageAttachment>,
2842
2917
  hideEditted?: boolean,
2843
- topic_id?: string,
2844
- is_update_msg_topic?: boolean,
2845
- old_mentions?: string
2918
+ topicId?: string,
2919
+ isUpdateMsgTopic?: boolean,
2920
+ oldMentions?: string
2846
2921
  ): Promise<ChannelMessageAck> {
2847
2922
  const response = await this.send({
2848
2923
  channel_message_update: {
2849
- clan_id: clan_id,
2850
- channel_id: channel_id,
2851
- message_id: message_id,
2924
+ clanId: clanId,
2925
+ channelId: channelId,
2926
+ messageId: messageId,
2852
2927
  content: content,
2853
- mentions: mentions,
2854
- attachments: attachments,
2928
+ mentions: mapToSnakeCase(mentions),
2929
+ attachments: mapToSnakeCase(attachments),
2855
2930
  mode: mode,
2856
- is_public: is_public,
2857
- hide_editted: hideEditted,
2858
- topic_id: topic_id,
2859
- is_update_msg_topic: is_update_msg_topic,
2860
- old_mentions: old_mentions
2931
+ isPublic: isPublic,
2932
+ hideEditted: hideEditted,
2933
+ topicId: topicId,
2934
+ isUpdateMsgTopic: isUpdateMsgTopic,
2935
+ oldMentions: oldMentions,
2861
2936
  },
2862
2937
  });
2863
- return response.channel_message_ack;
2938
+ return mapToCamelCase(response.channel_message_ack);
2864
2939
  }
2865
2940
 
2866
2941
  updateStatus(status?: string): Promise<void> {
@@ -2868,259 +2943,262 @@ export class DefaultSocket implements Socket {
2868
2943
  }
2869
2944
 
2870
2945
  async writeQuickMenuEvent(
2871
- menu_name: string,
2872
- clan_id: string,
2873
- channel_id: string,
2946
+ menuName: string,
2947
+ clanId: string,
2948
+ channelId: string,
2874
2949
  mode: number,
2875
- is_public: boolean,
2950
+ isPublic: boolean,
2876
2951
  content: any,
2877
2952
  mentions?: Array<ApiMessageMention>,
2878
2953
  attachments?: Array<ApiMessageAttachment>,
2879
2954
  references?: Array<ApiMessageRef>,
2880
- anonymous_message?: boolean,
2881
- mention_everyone?: Boolean,
2955
+ anonymousMessage?: boolean,
2956
+ mentionEveryone?: Boolean,
2882
2957
  avatar?: string,
2883
2958
  code?: number,
2884
- topic_id?: string
2959
+ topicId?: string
2885
2960
  ): Promise<QuickMenuEvent> {
2886
2961
  const response = await this.send({
2887
2962
  quick_menu_event: {
2888
- menu_name: menu_name,
2963
+ menuName: menuName,
2889
2964
  message: {
2890
- clan_id: clan_id,
2891
- channel_id: channel_id,
2965
+ clan_id: clanId,
2966
+ channel_id: channelId,
2892
2967
  mode: mode,
2893
- is_public: is_public,
2968
+ is_public: isPublic,
2894
2969
  content: content,
2895
- mentions: mentions,
2896
- attachments: attachments,
2897
- references: references,
2898
- anonymous_message: anonymous_message,
2899
- mention_everyone: mention_everyone,
2970
+ mentions: mapToSnakeCase(mentions),
2971
+ attachments: mapToSnakeCase(attachments),
2972
+ references: mapToSnakeCase(references),
2973
+ anonymous_message: anonymousMessage,
2974
+ mention_everyone: mentionEveryone,
2900
2975
  avatar: avatar,
2901
2976
  code: code,
2902
- topic_id: topic_id,
2903
- }
2904
- }
2977
+ topic_id: topicId,
2978
+ },
2979
+ },
2905
2980
  });
2906
- return response.ephemeral_message_send;
2981
+ return mapToCamelCase(response.quick_menu_event);
2907
2982
  }
2908
2983
 
2909
2984
  async writeEphemeralMessage(
2910
- receiver_id: string,
2911
- clan_id: string,
2912
- channel_id: string,
2985
+ receiverId: string,
2986
+ clanId: string,
2987
+ channelId: string,
2913
2988
  mode: number,
2914
- is_public: boolean,
2989
+ isPublic: boolean,
2915
2990
  content: any,
2916
2991
  mentions?: Array<ApiMessageMention>,
2917
2992
  attachments?: Array<ApiMessageAttachment>,
2918
2993
  references?: Array<ApiMessageRef>,
2919
- anonymous_message?: boolean,
2920
- mention_everyone?: Boolean,
2994
+ anonymousMessage?: boolean,
2995
+ mentionEveryone?: Boolean,
2921
2996
  avatar?: string,
2922
2997
  code?: number,
2923
- topic_id?: string,
2998
+ topicId?: string,
2924
2999
  id?: string
2925
3000
  ): Promise<ChannelMessageAck> {
2926
3001
  const response = await this.send({
2927
3002
  ephemeral_message_send: {
2928
- receiver_id: receiver_id,
3003
+ receiver_id: receiverId,
2929
3004
  message: {
2930
- clan_id: clan_id,
2931
- channel_id: channel_id,
3005
+ clan_id: clanId,
3006
+ channel_id: channelId,
2932
3007
  mode: mode,
2933
- is_public: is_public,
3008
+ is_public: isPublic,
2934
3009
  content: content,
2935
- mentions: mentions,
2936
- attachments: attachments,
2937
- references: references,
2938
- anonymous_message: anonymous_message,
2939
- mention_everyone: mention_everyone,
3010
+ mentions: mapToSnakeCase(mentions),
3011
+ attachments: mapToSnakeCase(attachments),
3012
+ references: mapToSnakeCase(references),
3013
+ anonymous_message: anonymousMessage,
3014
+ mention_everyone: mentionEveryone,
2940
3015
  avatar: avatar,
2941
3016
  code: code,
2942
- topic_id: topic_id,
3017
+ topic_id: topicId,
2943
3018
  id: id,
2944
- }
2945
- }
3019
+ },
3020
+ },
2946
3021
  });
2947
- return response.ephemeral_message_send;
3022
+ return mapToCamelCase(response.ephemeral_message_send);
2948
3023
  }
2949
3024
 
2950
3025
  async writeChatMessage(
2951
- clan_id: string,
2952
- channel_id: string,
3026
+ clanId: string,
3027
+ channelId: string,
2953
3028
  mode: number,
2954
- is_public: boolean,
3029
+ isPublic: boolean,
2955
3030
  content: any,
2956
3031
  mentions?: Array<ApiMessageMention>,
2957
3032
  attachments?: Array<ApiMessageAttachment>,
2958
3033
  references?: Array<ApiMessageRef>,
2959
- anonymous_message?: boolean,
2960
- mention_everyone?: Boolean,
3034
+ anonymousMessage?: boolean,
3035
+ mentionEveryone?: Boolean,
2961
3036
  avatar?: string,
2962
3037
  code?: number,
2963
- topic_id?: string
3038
+ topicId?: string
2964
3039
  ): Promise<ChannelMessageAck> {
2965
- const response = await this.send({
2966
- channel_message_send: {
2967
- clan_id: clan_id,
2968
- channel_id: channel_id,
2969
- mode: mode,
2970
- is_public: is_public,
2971
- content: content,
2972
- mentions: mentions,
2973
- attachments: attachments,
2974
- references: references,
2975
- anonymous_message: anonymous_message,
2976
- mention_everyone: mention_everyone,
2977
- avatar: avatar,
2978
- code: code,
2979
- topic_id: topic_id,
3040
+ const response = await this.send(
3041
+ {
3042
+ channel_message_send: {
3043
+ clan_id: clanId,
3044
+ channel_id: channelId,
3045
+ mode: mode,
3046
+ is_public: isPublic,
3047
+ content: content,
3048
+ mentions: mapToSnakeCase(mentions),
3049
+ attachments: mapToSnakeCase(attachments),
3050
+ references: mapToSnakeCase(references),
3051
+ anonymous_message: anonymousMessage,
3052
+ mention_everyone: mentionEveryone,
3053
+ avatar: avatar,
3054
+ code: code,
3055
+ topic_id: topicId,
3056
+ },
2980
3057
  },
2981
- }, Infinity);
2982
- return response.channel_message_ack;
3058
+ Infinity
3059
+ );
3060
+ return mapToCamelCase(response.channel_message_ack);
2983
3061
  }
2984
3062
 
2985
3063
  async writeMessageReaction(
2986
3064
  id: string,
2987
- clan_id: string,
2988
- channel_id: string,
3065
+ clanId: string,
3066
+ channelId: string,
2989
3067
  mode: number,
2990
- is_public: boolean,
2991
- message_id: string,
2992
- emoji_id: string,
3068
+ isPublic: boolean,
3069
+ messageId: string,
3070
+ emojiId: string,
2993
3071
  emoji: string,
2994
3072
  count: number,
2995
- message_sender_id: string,
3073
+ messageSenderId: string,
2996
3074
  action_delete: boolean,
2997
- topic_id?: string,
2998
- emoji_recent_id?: string,
2999
- sender_name?: string
3075
+ topicId?: string,
3076
+ emojiRecentId?: string,
3077
+ senderName?: string
3000
3078
  ): Promise<ApiMessageReaction> {
3001
3079
  const response = await this.send({
3002
3080
  message_reaction_event: {
3003
3081
  id: id,
3004
- clan_id: clan_id,
3005
- channel_id: channel_id,
3082
+ clanId: clanId,
3083
+ channelId: channelId,
3006
3084
  mode: mode,
3007
- is_public: is_public,
3008
- message_id: message_id,
3009
- emoji_id: emoji_id,
3085
+ isPublic: isPublic,
3086
+ messageId: messageId,
3087
+ emojiId: emojiId,
3010
3088
  emoji: emoji,
3011
3089
  count: count,
3012
- message_sender_id: message_sender_id,
3090
+ messageSenderId: messageSenderId,
3013
3091
  action: action_delete,
3014
- topic_id: topic_id,
3015
- emoji_recent_id: emoji_recent_id,
3016
- sender_name: sender_name
3092
+ topicId: topicId,
3093
+ emojiRecentId: emojiRecentId,
3094
+ senderName: senderName,
3017
3095
  },
3018
3096
  });
3019
- return response.message_reaction_event;
3097
+ return mapToCamelCase(response.message_reaction_event);
3020
3098
  }
3021
3099
 
3022
3100
  async writeMessageTyping(
3023
- clan_id: string,
3024
- channel_id: string,
3101
+ clanId: string,
3102
+ channelId: string,
3025
3103
  mode: number,
3026
- is_public: boolean,
3027
- sender_display_name: string,
3028
- topic_id?: string
3104
+ isPublic: boolean,
3105
+ senderDisplayName: string,
3106
+ topicId?: string
3029
3107
  ): Promise<MessageTypingEvent> {
3030
3108
  const response = await this.send({
3031
3109
  message_typing_event: {
3032
- clan_id: clan_id,
3033
- channel_id: channel_id,
3110
+ clan_id: clanId,
3111
+ channel_id: channelId,
3034
3112
  mode: mode,
3035
- is_public: is_public,
3036
- sender_display_name: sender_display_name,
3037
- topic_id: topic_id
3113
+ is_public: isPublic,
3114
+ sender_display_name: senderDisplayName,
3115
+ topic_id: topicId,
3038
3116
  },
3039
3117
  });
3040
- return response.message_typing_event;
3118
+ return mapToCamelCase(response.message_typing_event);
3041
3119
  }
3042
3120
 
3043
3121
  async writeLastSeenMessage(
3044
- clan_id: string,
3045
- channel_id: string,
3122
+ clanId: string,
3123
+ channelId: string,
3046
3124
  mode: number,
3047
- message_id: string,
3048
- timestamp_seconds: number,
3049
- badge_count: number
3125
+ messageId: string,
3126
+ timestampSeconds: number,
3127
+ badgeCount: number
3050
3128
  ): Promise<LastSeenMessageEvent> {
3051
3129
  const response = await this.send({
3052
3130
  last_seen_message_event: {
3053
- clan_id: clan_id,
3054
- channel_id: channel_id,
3131
+ clan_id: clanId,
3132
+ channel_id: channelId,
3055
3133
  mode: mode,
3056
- message_id: message_id,
3057
- timestamp_seconds: timestamp_seconds,
3058
- badge_count: badge_count,
3134
+ message_id: messageId,
3135
+ timestamp_seconds: timestampSeconds,
3136
+ badge_count: badgeCount,
3059
3137
  },
3060
3138
  });
3061
- return response.last_seen_message_event;
3139
+ return mapToCamelCase(response.last_seen_message_event);
3062
3140
  }
3063
3141
 
3064
3142
  async writeLastPinMessage(
3065
- clan_id: string,
3066
- channel_id: string,
3143
+ clanId: string,
3144
+ channelId: string,
3067
3145
  mode: number,
3068
- is_public: boolean,
3069
- message_id: string,
3070
- timestamp_seconds: number,
3146
+ isPublic: boolean,
3147
+ messageId: string,
3148
+ timestampSeconds: number,
3071
3149
  operation: number,
3072
- message_sender_avatar: string,
3073
- message_sender_id: string,
3074
- message_sender_username: string,
3075
- message_content: string,
3076
- message_attachment: string,
3077
- message_created_time: string,
3150
+ messageSenderAvatar: string,
3151
+ messageSenderId: string,
3152
+ messageSenderUsername: string,
3153
+ messageContent: string,
3154
+ messageAttachment: string,
3155
+ messageCreatedTime: string
3078
3156
  ): Promise<LastPinMessageEvent> {
3079
3157
  const response = await this.send({
3080
3158
  last_pin_message_event: {
3081
- clan_id: clan_id,
3082
- channel_id: channel_id,
3159
+ clan_id: clanId,
3160
+ channel_id: channelId,
3083
3161
  mode: mode,
3084
- is_public: is_public,
3085
- message_id: message_id,
3086
- timestamp_seconds: timestamp_seconds,
3162
+ is_public: isPublic,
3163
+ message_id: messageId,
3164
+ timestamp_seconds: timestampSeconds,
3087
3165
  operation: operation,
3088
- message_sender_avatar: message_sender_avatar,
3089
- message_sender_id: message_sender_id,
3090
- message_sender_username: message_sender_username,
3091
- message_content: message_content,
3092
- message_attachment: message_attachment,
3093
- message_created_time: message_created_time,
3166
+ message_sender_avatar: messageSenderAvatar,
3167
+ message_sender_id: messageSenderId,
3168
+ message_sender_username: messageSenderUsername,
3169
+ message_content: messageContent,
3170
+ message_attachment: messageAttachment,
3171
+ message_created_time: messageCreatedTime,
3094
3172
  },
3095
3173
  });
3096
- return response.last_pin_message_event;
3174
+ return mapToCamelCase(response.last_pin_message_event);
3097
3175
  }
3098
3176
 
3099
3177
  async writeCustomStatus(
3100
- clan_id: string,
3178
+ clanId: string,
3101
3179
  status: string,
3102
- time_reset: number,
3103
- no_clear: boolean
3180
+ timeReset: number,
3181
+ noClear: boolean
3104
3182
  ): Promise<CustomStatusEvent> {
3105
3183
  const response = await this.send({
3106
3184
  custom_status_event: {
3107
- clan_id: clan_id,
3185
+ clan_id: clanId,
3108
3186
  status: status,
3109
- time_reset: time_reset,
3110
- no_clear: no_clear,
3187
+ time_reset: timeReset,
3188
+ no_clear: noClear,
3111
3189
  },
3112
3190
  });
3113
- return response.custom_status_event;
3191
+ return mapToCamelCase(response.custom_status_event);
3114
3192
  }
3115
3193
 
3116
3194
  async writeActiveArchivedThread(
3117
- clan_id: string,
3118
- channel_id: string
3195
+ clanId: string,
3196
+ channelId: string
3119
3197
  ): Promise<void> {
3120
3198
  const response = await this.send({
3121
3199
  active_archived_thread: {
3122
- clan_id: clan_id,
3123
- channel_id: channel_id
3200
+ clan_id: clanId,
3201
+ channel_id: channelId,
3124
3202
  },
3125
3203
  });
3126
3204
  return response.active_archived_thread;
@@ -3130,132 +3208,130 @@ export class DefaultSocket implements Socket {
3130
3208
  name: string,
3131
3209
  condition_id: string,
3132
3210
  type: number,
3133
- clan_id: string,
3211
+ clanId: string
3134
3212
  ): Promise<CheckNameExistedEvent> {
3135
3213
  const response = await this.send({
3136
3214
  check_name_existed_event: {
3137
3215
  name: name,
3138
3216
  condition_id: condition_id,
3139
3217
  type: type,
3140
- clan_id: clan_id
3218
+ clan_id: clanId,
3141
3219
  },
3142
3220
  });
3143
- return response.check_name_existed_event;
3221
+ return mapToCamelCase(response.check_name_existed_event);
3144
3222
  }
3145
3223
 
3146
3224
  async writeVoiceReaction(
3147
3225
  emojis: Array<string>,
3148
- channel_id: string
3226
+ channelId: string
3149
3227
  ): Promise<VoiceReactionSend> {
3150
3228
  const response = await this.send({
3151
3229
  voice_reaction_send: {
3152
3230
  emojis: emojis,
3153
- channel_id: channel_id
3154
- }
3231
+ channel_id: channelId,
3232
+ },
3155
3233
  });
3156
- return response.voice_reaction_send;
3234
+ return mapToCamelCase(response.voice_reaction_send);
3157
3235
  }
3158
3236
 
3159
3237
  async forwardWebrtcSignaling(
3160
- receiver_id: string,
3161
- data_type: number,
3162
- json_data: string,
3163
- channel_id: string,
3164
- caller_id: string
3238
+ receiverId: string,
3239
+ dataType: number,
3240
+ jsonData: string,
3241
+ channelId: string,
3242
+ callerId: string
3165
3243
  ): Promise<WebrtcSignalingFwd> {
3166
3244
  const response = await this.send({
3167
3245
  webrtc_signaling_fwd: {
3168
- receiver_id: receiver_id,
3169
- data_type: data_type,
3170
- json_data: json_data,
3171
- channel_id: channel_id,
3172
- caller_id: caller_id,
3246
+ receiver_id: receiverId,
3247
+ data_type: dataType,
3248
+ json_data: jsonData,
3249
+ channel_id: channelId,
3250
+ caller_id: callerId,
3173
3251
  },
3174
3252
  });
3175
- return response.webrtc_signaling_fwd;
3253
+ return mapToCamelCase(response.webrtc_signaling_fwd);
3176
3254
  }
3177
3255
 
3178
3256
  async makeCallPush(
3179
- receiver_id: string,
3180
- json_data: string,
3181
- channel_id: string,
3182
- caller_id: string
3257
+ receiverId: string,
3258
+ jsonData: string,
3259
+ channelId: string,
3260
+ callerId: string
3183
3261
  ): Promise<IncomingCallPush> {
3184
3262
  const response = await this.send({
3185
3263
  incoming_call_push: {
3186
- receiver_id: receiver_id,
3187
- json_data: json_data,
3188
- channel_id: channel_id,
3189
- caller_id: caller_id,
3264
+ receiver_id: receiverId,
3265
+ json_data: jsonData,
3266
+ channel_id: channelId,
3267
+ caller_id: callerId,
3190
3268
  },
3191
3269
  });
3192
- return response.incoming_call_push;
3270
+ return mapToCamelCase(response.incoming_call_push);
3193
3271
  }
3194
3272
 
3195
3273
  async handleDropdownBoxSelected(
3196
- message_id: string,
3197
- channel_id: string,
3198
- selectbox_id: string,
3199
- sender_id: string,
3200
- user_id: string,
3274
+ messageId: string,
3275
+ channelId: string,
3276
+ selectboxId: string,
3277
+ senderId: string,
3278
+ userId: string,
3201
3279
  value: Array<string>
3202
3280
  ): Promise<DropdownBoxSelected> {
3203
3281
  const response = await this.send({
3204
3282
  dropdown_box_selected: {
3205
- message_id: message_id,
3206
- channel_id: channel_id,
3207
- selectbox_id: selectbox_id,
3208
- sender_id: sender_id,
3209
- user_id: user_id,
3283
+ message_id: messageId,
3284
+ channel_id: channelId,
3285
+ selectbox_id: selectboxId,
3286
+ sender_id: senderId,
3287
+ user_id: userId,
3210
3288
  value: value,
3211
3289
  },
3212
3290
  });
3213
- return response.dropdown_box_selected;
3291
+ return mapToCamelCase(response.dropdown_box_selected);
3214
3292
  }
3215
3293
 
3216
3294
  async handleMessageButtonClick(
3217
- message_id: string,
3218
- channel_id: string,
3219
- button_id: string,
3220
- sender_id: string,
3221
- user_id: string,
3222
- extra_data: string
3295
+ messageId: string,
3296
+ channelId: string,
3297
+ buttonId: string,
3298
+ senderId: string,
3299
+ userId: string,
3300
+ extraData: string
3223
3301
  ): Promise<MessageButtonClicked> {
3224
3302
  const response = await this.send({
3225
3303
  message_button_clicked: {
3226
- message_id: message_id,
3227
- channel_id: channel_id,
3228
- button_id: button_id,
3229
- sender_id: sender_id,
3230
- user_id: user_id,
3231
- extra_data: extra_data,
3304
+ message_id: messageId,
3305
+ channel_id: channelId,
3306
+ button_id: buttonId,
3307
+ sender_id: senderId,
3308
+ user_id: userId,
3309
+ extra_data: extraData,
3232
3310
  },
3233
3311
  });
3234
- return response.webrtc_signaling_fwd;
3312
+ return mapToCamelCase(response.webrtc_signaling_fwd);
3235
3313
  }
3236
3314
 
3237
3315
  async writeChannelAppEvent(
3238
- clan_id: string,
3239
- channel_id: string,
3316
+ clanId: string,
3317
+ channelId: string,
3240
3318
  action: number
3241
3319
  ): Promise<ChannelAppEvent> {
3242
3320
  const response = await this.send({
3243
3321
  channel_app_event: {
3244
- clan_id: clan_id,
3245
- channel_id: channel_id,
3322
+ clan_id: clanId,
3323
+ channel_id: channelId,
3246
3324
  action: action,
3247
3325
  },
3248
3326
  });
3249
- return response.channel_app_event;
3327
+ return mapToCamelCase(response.channel_app_event);
3250
3328
  }
3251
3329
 
3252
- async listDataSocket(
3253
- request: ListDataSocket
3254
- ): Promise<any> {
3330
+ async listDataSocket(request: ListDataSocket): Promise<any> {
3255
3331
  const response = await this.send({
3256
- list_data_socket: request,
3332
+ list_data_socket: mapToSnakeCase(request),
3257
3333
  });
3258
- return response.list_data_socket;
3334
+ return mapToCamelCase(response.list_data_socket);
3259
3335
  }
3260
3336
 
3261
3337
  private async pingPong(): Promise<void> {
@@ -3306,4 +3382,3 @@ export class DefaultSocket implements Socket {
3306
3382
  }
3307
3383
  }
3308
3384
  }
3309
-