mezon-js 2.8.85 → 2.8.88

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -206,8 +206,16 @@ export interface MezonUpdateRoleDeleteBody {
206
206
 
207
207
  /** Request to get system message by clan and channel IDs. */
208
208
  export interface MezonUpdateSystemMessageBody {
209
+ //
210
+ boost_message?: string;
209
211
  //
210
212
  channel_id?: string;
213
+ //
214
+ setup_tips?: string;
215
+ //
216
+ welcome_random?: string;
217
+ //
218
+ welcome_sticker?: string;
211
219
  }
212
220
 
213
221
  /** */
@@ -1471,20 +1479,36 @@ export interface ApiSortParam {
1471
1479
 
1472
1480
  /** System message details. */
1473
1481
  export interface ApiSystemMessage {
1482
+ //
1483
+ boost_message?: string;
1474
1484
  //
1475
1485
  channel_id?: string;
1476
1486
  //
1477
1487
  clan_id?: string;
1478
1488
  //
1479
1489
  id?: string;
1490
+ //
1491
+ setup_tips?: string;
1492
+ //
1493
+ welcome_random?: string;
1494
+ //
1495
+ welcome_sticker?: string;
1480
1496
  }
1481
1497
 
1482
1498
  /** Request to get system message by clan and channel IDs. */
1483
1499
  export interface ApiSystemMessageRequest {
1500
+ //
1501
+ boost_message?: string;
1484
1502
  //
1485
1503
  channel_id?: string;
1486
1504
  //
1487
1505
  clan_id?: string;
1506
+ //
1507
+ setup_tips?: string;
1508
+ //
1509
+ welcome_random?: string;
1510
+ //
1511
+ welcome_sticker?: string;
1488
1512
  }
1489
1513
 
1490
1514
  /** List of system message. */
package/dist/api.gen.d.ts CHANGED
@@ -118,7 +118,11 @@ export interface MezonUpdateRoleDeleteBody {
118
118
  }
119
119
  /** Request to get system message by clan and channel IDs. */
120
120
  export interface MezonUpdateSystemMessageBody {
121
+ boost_message?: string;
121
122
  channel_id?: string;
123
+ setup_tips?: string;
124
+ welcome_random?: string;
125
+ welcome_sticker?: string;
122
126
  }
123
127
  /** */
124
128
  export interface MezonUpdateUserProfileByClanBody {
@@ -852,14 +856,22 @@ export interface ApiSortParam {
852
856
  }
853
857
  /** System message details. */
854
858
  export interface ApiSystemMessage {
859
+ boost_message?: string;
855
860
  channel_id?: string;
856
861
  clan_id?: string;
857
862
  id?: string;
863
+ setup_tips?: string;
864
+ welcome_random?: string;
865
+ welcome_sticker?: string;
858
866
  }
859
867
  /** Request to get system message by clan and channel IDs. */
860
868
  export interface ApiSystemMessageRequest {
869
+ boost_message?: string;
861
870
  channel_id?: string;
862
871
  clan_id?: string;
872
+ setup_tips?: string;
873
+ welcome_random?: string;
874
+ welcome_sticker?: string;
863
875
  }
864
876
  /** List of system message. */
865
877
  export interface ApiSystemMessagesList {
@@ -4877,6 +4877,8 @@ var _DefaultSocket = class _DefaultSocket {
4877
4877
  this.onchannelcreated(message.channel_created_event);
4878
4878
  } else if (message.channel_deleted_event) {
4879
4879
  this.onchanneldeleted(message.channel_deleted_event);
4880
+ } else if (message.clan_deleted_envet) {
4881
+ this.onclandeleted(message.clan_deleted_envet);
4880
4882
  } else if (message.channel_updated_event) {
4881
4883
  this.onchannelupdated(message.channel_updated_event);
4882
4884
  } else if (message.clan_profile_updated_event) {
@@ -5112,6 +5114,11 @@ var _DefaultSocket = class _DefaultSocket {
5112
5114
  console.log(channelDeleted);
5113
5115
  }
5114
5116
  }
5117
+ onclandeleted(clanDeleted) {
5118
+ if (this.verbose && window && window.console) {
5119
+ console.log(clanDeleted);
5120
+ }
5121
+ }
5115
5122
  onchannelupdated(channelUpdated) {
5116
5123
  if (this.verbose && window && window.console) {
5117
5124
  console.log(channelUpdated);
@@ -5385,6 +5392,18 @@ var _DefaultSocket = class _DefaultSocket {
5385
5392
  return response.notification_channel_category_setting_event;
5386
5393
  });
5387
5394
  }
5395
+ addUserEmojiUsage(add_user_emoji_usage_event) {
5396
+ return __async(this, null, function* () {
5397
+ const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
5398
+ return response.add_user_emoji_usage_event;
5399
+ });
5400
+ }
5401
+ getUserEmojiUsage(clanId) {
5402
+ return __async(this, null, function* () {
5403
+ const response = yield this.send({ get_user_emoji_usage_event: { clanId } });
5404
+ return response.get_user_emoji_usage_event;
5405
+ });
5406
+ }
5388
5407
  pingPong() {
5389
5408
  return __async(this, null, function* () {
5390
5409
  if (!this.adapter.isOpen()) {
@@ -4848,6 +4848,8 @@ var _DefaultSocket = class _DefaultSocket {
4848
4848
  this.onchannelcreated(message.channel_created_event);
4849
4849
  } else if (message.channel_deleted_event) {
4850
4850
  this.onchanneldeleted(message.channel_deleted_event);
4851
+ } else if (message.clan_deleted_envet) {
4852
+ this.onclandeleted(message.clan_deleted_envet);
4851
4853
  } else if (message.channel_updated_event) {
4852
4854
  this.onchannelupdated(message.channel_updated_event);
4853
4855
  } else if (message.clan_profile_updated_event) {
@@ -5083,6 +5085,11 @@ var _DefaultSocket = class _DefaultSocket {
5083
5085
  console.log(channelDeleted);
5084
5086
  }
5085
5087
  }
5088
+ onclandeleted(clanDeleted) {
5089
+ if (this.verbose && window && window.console) {
5090
+ console.log(clanDeleted);
5091
+ }
5092
+ }
5086
5093
  onchannelupdated(channelUpdated) {
5087
5094
  if (this.verbose && window && window.console) {
5088
5095
  console.log(channelUpdated);
@@ -5356,6 +5363,18 @@ var _DefaultSocket = class _DefaultSocket {
5356
5363
  return response.notification_channel_category_setting_event;
5357
5364
  });
5358
5365
  }
5366
+ addUserEmojiUsage(add_user_emoji_usage_event) {
5367
+ return __async(this, null, function* () {
5368
+ const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
5369
+ return response.add_user_emoji_usage_event;
5370
+ });
5371
+ }
5372
+ getUserEmojiUsage(clanId) {
5373
+ return __async(this, null, function* () {
5374
+ const response = yield this.send({ get_user_emoji_usage_event: { clanId } });
5375
+ return response.get_user_emoji_usage_event;
5376
+ });
5377
+ }
5359
5378
  pingPong() {
5360
5379
  return __async(this, null, function* () {
5361
5380
  if (!this.adapter.isOpen()) {
package/dist/socket.d.ts CHANGED
@@ -310,6 +310,10 @@ export interface ChannelDeletedEvent {
310
310
  channel_id: string;
311
311
  deletor: string;
312
312
  }
313
+ export interface ClanDeletedEvent {
314
+ clan_id: string;
315
+ deletor: string;
316
+ }
313
317
  export interface PermissionRoleChannelListEvent {
314
318
  role_id?: string;
315
319
  channel_id?: string;
@@ -522,6 +526,21 @@ export interface NotificationChannelCategorySettingEvent {
522
526
  clan_id?: string;
523
527
  notification_channel_category_settings_list?: NotificationChannelCategorySetting[];
524
528
  }
529
+ export interface UserEmojiUsage {
530
+ user_id: string;
531
+ emoji_id: string;
532
+ clan_id: string;
533
+ create_time: string;
534
+ }
535
+ export interface AddUserEmojiUsageEvent {
536
+ emoji_id: string;
537
+ clan_id: string;
538
+ }
539
+ /** Response cho ListUserEmojiUsage */
540
+ export interface GetUserEmojiUsageEvent {
541
+ clanId: string;
542
+ user_emoji_usage: Array<UserEmojiUsage>;
543
+ }
525
544
  /** A socket connection to Mezon server. */
526
545
  export interface Socket {
527
546
  /** Connection is Open */
@@ -610,6 +629,7 @@ export interface Socket {
610
629
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
611
630
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
612
631
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
632
+ onclandeleted: (clanDeleted: ClanDeletedEvent) => void;
613
633
  onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
614
634
  onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
615
635
  onclanupdated: (clan: ClanUpdatedEvent) => void;
@@ -630,6 +650,8 @@ export interface Socket {
630
650
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
631
651
  getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
632
652
  oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
653
+ addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
654
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>;
633
655
  }
634
656
  /** Reports an error received from a socket message. */
635
657
  export interface SocketError {
@@ -679,6 +701,7 @@ export declare class DefaultSocket implements Socket {
679
701
  onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
680
702
  onchannelcreated(channelCreated: ChannelCreatedEvent): void;
681
703
  onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
704
+ onclandeleted(clanDeleted: ClanDeletedEvent): void;
682
705
  onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
683
706
  onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
684
707
  onclanupdated(clan: ClanUpdatedEvent): void;
@@ -719,6 +742,8 @@ export declare class DefaultSocket implements Socket {
719
742
  getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
720
743
  getNotificationReactMessage(channel_id: string): Promise<NotifiReactMessageEvent>;
721
744
  getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
745
+ addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent): Promise<any>;
746
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>;
722
747
  private pingPong;
723
748
  }
724
749
  export {};
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.85",
3
+
4
+ "version": "2.8.88",
5
+
4
6
  "scripts": {
5
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
8
  },
package/socket.ts CHANGED
@@ -456,6 +456,13 @@ export interface ChannelDeletedEvent {
456
456
  deletor: string;
457
457
  }
458
458
 
459
+ export interface ClanDeletedEvent {
460
+ // clan id
461
+ clan_id: string;
462
+ // deletor
463
+ deletor: string;
464
+ }
465
+
459
466
  // A list of permission role channel.
460
467
  export interface PermissionRoleChannelListEvent {
461
468
  //
@@ -782,6 +789,23 @@ export interface NotificationChannelCategorySettingEvent {
782
789
  notification_channel_category_settings_list?: NotificationChannelCategorySetting[]
783
790
  }
784
791
 
792
+ export interface UserEmojiUsage {
793
+ user_id: string;
794
+ emoji_id: string;
795
+ clan_id: string;
796
+ create_time: string;
797
+ }
798
+
799
+ export interface AddUserEmojiUsageEvent {
800
+ emoji_id: string;
801
+ clan_id: string;
802
+ }
803
+
804
+ /** Response cho ListUserEmojiUsage */
805
+ export interface GetUserEmojiUsageEvent {
806
+ clanId: string;
807
+ user_emoji_usage: Array<UserEmojiUsage>;
808
+ }
785
809
 
786
810
  /** A socket connection to Mezon server. */
787
811
  export interface Socket {
@@ -921,6 +945,9 @@ export interface Socket {
921
945
  // when channel is deleted
922
946
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
923
947
 
948
+ // when clan is deleted
949
+ onclandeleted: (clanDeleted: ClanDeletedEvent) => void;
950
+
924
951
  // when channel is updated
925
952
  onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
926
953
 
@@ -965,6 +992,11 @@ export interface Socket {
965
992
  getNotificationChannelCategorySetting(clan_id : string): Promise<NotificationChannelCategorySettingEvent>;
966
993
 
967
994
  oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
995
+
996
+ addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
997
+
998
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>
999
+
968
1000
  }
969
1001
 
970
1002
  /** Reports an error received from a socket message. */
@@ -1048,6 +1080,8 @@ export class DefaultSocket implements Socket {
1048
1080
  this.onchannelcreated(message.channel_created_event)
1049
1081
  } else if (message.channel_deleted_event) {
1050
1082
  this.onchanneldeleted(message.channel_deleted_event)
1083
+ } else if (message.clan_deleted_envet) {
1084
+ this.onclandeleted(message.clan_deleted_envet)
1051
1085
  } else if (message.channel_updated_event) {
1052
1086
  this.onchannelupdated(message.channel_updated_event)
1053
1087
  } else if (message.clan_profile_updated_event) {
@@ -1317,6 +1351,12 @@ export class DefaultSocket implements Socket {
1317
1351
  }
1318
1352
  }
1319
1353
 
1354
+ onclandeleted(clanDeleted: ClanDeletedEvent) {
1355
+ if (this.verbose && window && window.console) {
1356
+ console.log(clanDeleted);
1357
+ }
1358
+ }
1359
+
1320
1360
  onchannelupdated(channelUpdated: ChannelUpdatedEvent) {
1321
1361
  if (this.verbose && window && window.console) {
1322
1362
  console.log(channelUpdated);
@@ -1584,6 +1624,15 @@ export class DefaultSocket implements Socket {
1584
1624
  return response.notification_channel_category_setting_event
1585
1625
  }
1586
1626
 
1627
+ async addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent) {
1628
+ const response = await this.send({add_user_emoji_usage_event: {add_user_emoji_usage_event: add_user_emoji_usage_event}})
1629
+ return response.add_user_emoji_usage_event
1630
+ }
1631
+
1632
+ async getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent> {
1633
+ const response = await this.send({get_user_emoji_usage_event: {clanId: clanId}})
1634
+ return response.get_user_emoji_usage_event
1635
+ }
1587
1636
 
1588
1637
  private async pingPong(): Promise<void> {
1589
1638
  if (!this.adapter.isOpen()) {