mezon-js 2.8.84 → 2.8.87

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 {
@@ -5349,9 +5349,9 @@ var _DefaultSocket = class _DefaultSocket {
5349
5349
  return response.permission_role_channel_list_event;
5350
5350
  });
5351
5351
  }
5352
- listClanStickersByClanId(clan_id) {
5352
+ listStickersByUserId() {
5353
5353
  return __async(this, null, function* () {
5354
- const response = yield this.send({ sticker_listed_event: { clan_id } });
5354
+ const response = yield this.send({ sticker_listed_event: {} });
5355
5355
  return response.sticker_listed_event;
5356
5356
  });
5357
5357
  }
@@ -5385,6 +5385,18 @@ var _DefaultSocket = class _DefaultSocket {
5385
5385
  return response.notification_channel_category_setting_event;
5386
5386
  });
5387
5387
  }
5388
+ addUserEmojiUsage(add_user_emoji_usage_event) {
5389
+ return __async(this, null, function* () {
5390
+ const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
5391
+ return response.add_user_emoji_usage_event;
5392
+ });
5393
+ }
5394
+ getUserEmojiUsage(clanId) {
5395
+ return __async(this, null, function* () {
5396
+ const response = yield this.send({ get_user_emoji_usage_event: { clanId } });
5397
+ return response.get_user_emoji_usage_event;
5398
+ });
5399
+ }
5388
5400
  pingPong() {
5389
5401
  return __async(this, null, function* () {
5390
5402
  if (!this.adapter.isOpen()) {
@@ -5320,9 +5320,9 @@ var _DefaultSocket = class _DefaultSocket {
5320
5320
  return response.permission_role_channel_list_event;
5321
5321
  });
5322
5322
  }
5323
- listClanStickersByClanId(clan_id) {
5323
+ listStickersByUserId() {
5324
5324
  return __async(this, null, function* () {
5325
- const response = yield this.send({ sticker_listed_event: { clan_id } });
5325
+ const response = yield this.send({ sticker_listed_event: {} });
5326
5326
  return response.sticker_listed_event;
5327
5327
  });
5328
5328
  }
@@ -5356,6 +5356,18 @@ var _DefaultSocket = class _DefaultSocket {
5356
5356
  return response.notification_channel_category_setting_event;
5357
5357
  });
5358
5358
  }
5359
+ addUserEmojiUsage(add_user_emoji_usage_event) {
5360
+ return __async(this, null, function* () {
5361
+ const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
5362
+ return response.add_user_emoji_usage_event;
5363
+ });
5364
+ }
5365
+ getUserEmojiUsage(clanId) {
5366
+ return __async(this, null, function* () {
5367
+ const response = yield this.send({ get_user_emoji_usage_event: { clanId } });
5368
+ return response.get_user_emoji_usage_event;
5369
+ });
5370
+ }
5359
5371
  pingPong() {
5360
5372
  return __async(this, null, function* () {
5361
5373
  if (!this.adapter.isOpen()) {
package/dist/socket.d.ts CHANGED
@@ -79,12 +79,28 @@ interface ChannelLeave {
79
79
  }
80
80
  export interface AddClanUserEvent {
81
81
  clan_id: string;
82
- user: AddUsers;
82
+ user: UserProfileRedis;
83
+ }
84
+ export interface UserProfileRedis {
85
+ /** User IDs to follow. */
86
+ user_id: string;
87
+ /** Username to follow. */
88
+ username: string;
89
+ /** Avatar to follow. */
90
+ avatar: string;
91
+ /** Display name */
92
+ display_name: string;
93
+ /** about me */
94
+ about_me: string;
95
+ /** custom status */
96
+ custom_status: string;
97
+ /** create time */
98
+ create_time_second: number;
83
99
  }
84
100
  /** UserChannelAddedEvent */
85
101
  export interface UserChannelAddedEvent {
86
102
  channel_id: string;
87
- users: AddUsers[];
103
+ users: UserProfileRedis[];
88
104
  status: string;
89
105
  clan_id: string;
90
106
  channel_type: number;
@@ -92,11 +108,6 @@ export interface UserChannelAddedEvent {
92
108
  parent_id: string;
93
109
  is_parent_public: boolean;
94
110
  }
95
- export interface AddUsers {
96
- user_id: string;
97
- avatar: string;
98
- username: string;
99
- }
100
111
  export interface UserChannelRemovedEvent {
101
112
  channel_id: string;
102
113
  user_ids: string[];
@@ -396,7 +407,6 @@ export interface ClanNameExistedEvent {
396
407
  }
397
408
  /** */
398
409
  export interface StrickerListedEvent {
399
- clan_id: string;
400
410
  stickers?: Array<ClanSticker>;
401
411
  }
402
412
  /** */
@@ -408,6 +418,8 @@ export interface ClanSticker {
408
418
  id?: string;
409
419
  shortname?: string;
410
420
  source?: string;
421
+ logo?: string;
422
+ clan_name?: string;
411
423
  }
412
424
  /** */
413
425
  export interface EmojiListedEvent {
@@ -510,6 +522,21 @@ export interface NotificationChannelCategorySettingEvent {
510
522
  clan_id?: string;
511
523
  notification_channel_category_settings_list?: NotificationChannelCategorySetting[];
512
524
  }
525
+ export interface UserEmojiUsage {
526
+ user_id: string;
527
+ emoji_id: string;
528
+ clan_id: string;
529
+ create_time: string;
530
+ }
531
+ export interface AddUserEmojiUsageEvent {
532
+ emoji_id: string;
533
+ clan_id: string;
534
+ }
535
+ /** Response cho ListUserEmojiUsage */
536
+ export interface GetUserEmojiUsageEvent {
537
+ clanId: string;
538
+ user_emoji_usage: Array<UserEmojiUsage>;
539
+ }
513
540
  /** A socket connection to Mezon server. */
514
541
  export interface Socket {
515
542
  /** Connection is Open */
@@ -607,7 +634,7 @@ export interface Socket {
607
634
  listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
608
635
  listUserPermissionInChannel(clan_id: string, channel_id: string): Promise<UserPermissionInChannelListEvent>;
609
636
  listRoles(ClanId: string, Limit: number, State: number, Cursor: string): Promise<RoleListEvent>;
610
- listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
637
+ listStickersByUserId(): Promise<StrickerListedEvent>;
611
638
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
612
639
  ListUserClansByUserId(): Promise<AllUserClans>;
613
640
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
@@ -618,6 +645,8 @@ export interface Socket {
618
645
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
619
646
  getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
620
647
  oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
648
+ addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
649
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>;
621
650
  }
622
651
  /** Reports an error received from a socket message. */
623
652
  export interface SocketError {
@@ -701,12 +730,14 @@ export declare class DefaultSocket implements Socket {
701
730
  ListUserClansByUserId(): Promise<AllUserClans>;
702
731
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
703
732
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
704
- listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
733
+ listStickersByUserId(): Promise<StrickerListedEvent>;
705
734
  getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
706
735
  getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
707
736
  getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
708
737
  getNotificationReactMessage(channel_id: string): Promise<NotifiReactMessageEvent>;
709
738
  getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
739
+ addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent): Promise<any>;
740
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>;
710
741
  private pingPong;
711
742
  }
712
743
  export {};
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.84",
3
+
4
+ "version": "2.8.87",
5
+
4
6
  "scripts": {
5
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
8
  },
package/socket.ts CHANGED
@@ -104,7 +104,24 @@ export interface AddClanUserEvent {
104
104
  //the clan id
105
105
  clan_id: string;
106
106
  // the user
107
- user: AddUsers;
107
+ user: UserProfileRedis;
108
+ }
109
+
110
+ export interface UserProfileRedis {
111
+ /** User IDs to follow. */
112
+ user_id: string;
113
+ /** Username to follow. */
114
+ username: string;
115
+ /** Avatar to follow. */
116
+ avatar: string;
117
+ /** Display name */
118
+ display_name: string;
119
+ /** about me */
120
+ about_me: string;
121
+ /** custom status */
122
+ custom_status: string;
123
+ /** create time */
124
+ create_time_second: number;
108
125
  }
109
126
 
110
127
  /** UserChannelAddedEvent */
@@ -112,7 +129,7 @@ export interface UserChannelAddedEvent {
112
129
  // the channel id
113
130
  channel_id: string;
114
131
  // the user
115
- users: AddUsers[];
132
+ users: UserProfileRedis[];
116
133
  // the custom status
117
134
  status: string;
118
135
  // the clan id
@@ -127,15 +144,6 @@ export interface UserChannelAddedEvent {
127
144
  is_parent_public: boolean;
128
145
  }
129
146
 
130
- export interface AddUsers {
131
- // User IDs to follow.
132
- user_id: string;
133
- // Avatar to follow.
134
- avatar: string;
135
- // Username to follow.
136
- username: string;
137
- }
138
-
139
147
  export interface UserChannelRemovedEvent {
140
148
  // the channel id
141
149
  channel_id: string;
@@ -570,8 +578,6 @@ export interface ClanNameExistedEvent {
570
578
 
571
579
  /** */
572
580
  export interface StrickerListedEvent {
573
- // clan id
574
- clan_id: string;
575
581
  // sticker data
576
582
  stickers?: Array<ClanSticker>;
577
583
  }
@@ -592,6 +598,10 @@ export interface ClanSticker {
592
598
  shortname?: string;
593
599
  //
594
600
  source?: string;
601
+ //
602
+ logo?: string;
603
+ //
604
+ clan_name?: string;
595
605
  }
596
606
 
597
607
  /** */
@@ -772,6 +782,23 @@ export interface NotificationChannelCategorySettingEvent {
772
782
  notification_channel_category_settings_list?: NotificationChannelCategorySetting[]
773
783
  }
774
784
 
785
+ export interface UserEmojiUsage {
786
+ user_id: string;
787
+ emoji_id: string;
788
+ clan_id: string;
789
+ create_time: string;
790
+ }
791
+
792
+ export interface AddUserEmojiUsageEvent {
793
+ emoji_id: string;
794
+ clan_id: string;
795
+ }
796
+
797
+ /** Response cho ListUserEmojiUsage */
798
+ export interface GetUserEmojiUsageEvent {
799
+ clanId: string;
800
+ user_emoji_usage: Array<UserEmojiUsage>;
801
+ }
775
802
 
776
803
  /** A socket connection to Mezon server. */
777
804
  export interface Socket {
@@ -934,7 +961,7 @@ export interface Socket {
934
961
 
935
962
  listRoles(ClanId: string, Limit: number, State: number, Cursor: string): Promise<RoleListEvent>;
936
963
 
937
- listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
964
+ listStickersByUserId(): Promise<StrickerListedEvent>;
938
965
 
939
966
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
940
967
 
@@ -955,6 +982,11 @@ export interface Socket {
955
982
  getNotificationChannelCategorySetting(clan_id : string): Promise<NotificationChannelCategorySettingEvent>;
956
983
 
957
984
  oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
985
+
986
+ addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
987
+
988
+ getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent>
989
+
958
990
  }
959
991
 
960
992
  /** Reports an error received from a socket message. */
@@ -1544,8 +1576,8 @@ export class DefaultSocket implements Socket {
1544
1576
  return response.permission_role_channel_list_event
1545
1577
  }
1546
1578
 
1547
- async listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent> {
1548
- const response = await this.send({sticker_listed_event: {clan_id: clan_id}});
1579
+ async listStickersByUserId(): Promise<StrickerListedEvent> {
1580
+ const response = await this.send({sticker_listed_event: {}});
1549
1581
  return response.sticker_listed_event
1550
1582
  }
1551
1583
 
@@ -1574,6 +1606,15 @@ export class DefaultSocket implements Socket {
1574
1606
  return response.notification_channel_category_setting_event
1575
1607
  }
1576
1608
 
1609
+ async addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent) {
1610
+ const response = await this.send({add_user_emoji_usage_event: {add_user_emoji_usage_event: add_user_emoji_usage_event}})
1611
+ return response.add_user_emoji_usage_event
1612
+ }
1613
+
1614
+ async getUserEmojiUsage(clanId: string): Promise<GetUserEmojiUsageEvent> {
1615
+ const response = await this.send({get_user_emoji_usage_event: {clanId: clanId}})
1616
+ return response.get_user_emoji_usage_event
1617
+ }
1577
1618
 
1578
1619
  private async pingPong(): Promise<void> {
1579
1620
  if (!this.adapter.isOpen()) {