mezon-js 2.11.14 → 2.11.16

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.
@@ -7425,6 +7425,8 @@ var _DefaultSocket = class _DefaultSocket {
7425
7425
  this.onvoiceleaved(message.voice_leaved_event);
7426
7426
  } else if (message.channel_created_event) {
7427
7427
  this.onchannelcreated(message.channel_created_event);
7428
+ } else if (message.category_event) {
7429
+ this.oncategoryevent(message.category_event);
7428
7430
  } else if (message.role_event) {
7429
7431
  this.onroleevent(message.role_event);
7430
7432
  } else if (message.event_emoji) {
@@ -7774,6 +7776,11 @@ var _DefaultSocket = class _DefaultSocket {
7774
7776
  console.log(channelCreated);
7775
7777
  }
7776
7778
  }
7779
+ oncategoryevent(categoryEvent) {
7780
+ if (this.verbose && window && window.console) {
7781
+ console.log(categoryEvent);
7782
+ }
7783
+ }
7777
7784
  onroleevent(roleEvent) {
7778
7785
  if (this.verbose && window && window.console) {
7779
7786
  console.log(roleEvent);
@@ -8152,7 +8159,7 @@ var _DefaultSocket = class _DefaultSocket {
8152
8159
  return response.message_typing_event;
8153
8160
  });
8154
8161
  }
8155
- writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
8162
+ writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds, badge_count) {
8156
8163
  return __async(this, null, function* () {
8157
8164
  const response = yield this.send({
8158
8165
  last_seen_message_event: {
@@ -8160,7 +8167,8 @@ var _DefaultSocket = class _DefaultSocket {
8160
8167
  channel_id,
8161
8168
  mode,
8162
8169
  message_id,
8163
- timestamp_seconds
8170
+ timestamp_seconds,
8171
+ badge_count
8164
8172
  }
8165
8173
  });
8166
8174
  return response.last_seen_message_event;
@@ -7391,6 +7391,8 @@ var _DefaultSocket = class _DefaultSocket {
7391
7391
  this.onvoiceleaved(message.voice_leaved_event);
7392
7392
  } else if (message.channel_created_event) {
7393
7393
  this.onchannelcreated(message.channel_created_event);
7394
+ } else if (message.category_event) {
7395
+ this.oncategoryevent(message.category_event);
7394
7396
  } else if (message.role_event) {
7395
7397
  this.onroleevent(message.role_event);
7396
7398
  } else if (message.event_emoji) {
@@ -7740,6 +7742,11 @@ var _DefaultSocket = class _DefaultSocket {
7740
7742
  console.log(channelCreated);
7741
7743
  }
7742
7744
  }
7745
+ oncategoryevent(categoryEvent) {
7746
+ if (this.verbose && window && window.console) {
7747
+ console.log(categoryEvent);
7748
+ }
7749
+ }
7743
7750
  onroleevent(roleEvent) {
7744
7751
  if (this.verbose && window && window.console) {
7745
7752
  console.log(roleEvent);
@@ -8118,7 +8125,7 @@ var _DefaultSocket = class _DefaultSocket {
8118
8125
  return response.message_typing_event;
8119
8126
  });
8120
8127
  }
8121
- writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
8128
+ writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds, badge_count) {
8122
8129
  return __async(this, null, function* () {
8123
8130
  const response = yield this.send({
8124
8131
  last_seen_message_event: {
@@ -8126,7 +8133,8 @@ var _DefaultSocket = class _DefaultSocket {
8126
8133
  channel_id,
8127
8134
  mode,
8128
8135
  message_id,
8129
- timestamp_seconds
8136
+ timestamp_seconds,
8137
+ badge_count
8130
8138
  }
8131
8139
  });
8132
8140
  return response.last_seen_message_event;
package/dist/socket.d.ts CHANGED
@@ -168,6 +168,7 @@ export interface LastSeenMessageEvent {
168
168
  channel_label: string;
169
169
  /** The unique ID of this message. */
170
170
  message_id: string;
171
+ badge_count: number;
171
172
  }
172
173
  /** User is typing */
173
174
  export interface MessageTypingEvent {
@@ -335,6 +336,7 @@ export interface ChannelUpdatedEvent {
335
336
  topic: string;
336
337
  age_restricted: number;
337
338
  is_active_thread: boolean;
339
+ active: number;
338
340
  }
339
341
  export interface ChannelCreatedEvent {
340
342
  clan_id: string;
@@ -349,6 +351,13 @@ export interface ChannelCreatedEvent {
349
351
  app_url: string;
350
352
  clan_name: string;
351
353
  }
354
+ export interface CategoryEvent {
355
+ clan_id: string;
356
+ id: string;
357
+ creator_id: string;
358
+ category_name: string;
359
+ status: number;
360
+ }
352
361
  export interface ChannelDeletedEvent {
353
362
  clan_id: string;
354
363
  category_id: string;
@@ -752,7 +761,7 @@ export interface Socket {
752
761
  /** Send message reaction */
753
762
  writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean, topic_id?: string, emoji_recent_id?: string): Promise<ApiMessageReaction>;
754
763
  /** Send last seen message */
755
- writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
764
+ writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
756
765
  /** Send last pin message */
757
766
  writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
758
767
  /** Send custom user status */
@@ -817,6 +826,7 @@ export interface Socket {
817
826
  onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
818
827
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
819
828
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
829
+ oncategoryevent: (categoryEvent: CategoryEvent) => void;
820
830
  onroleevent: (roleEvent: RoleEvent) => void;
821
831
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
822
832
  onstickercreated: (stickerCreated: StickerCreateEvent) => void;
@@ -900,6 +910,7 @@ export declare class DefaultSocket implements Socket {
900
910
  onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
901
911
  onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
902
912
  onchannelcreated(channelCreated: ChannelCreatedEvent): void;
913
+ oncategoryevent(categoryEvent: CategoryEvent): void;
903
914
  onroleevent(roleEvent: RoleEvent): void;
904
915
  oneventemoji(eventEmoji: EventEmoji): void;
905
916
  oneventnotiuserchannel(notiUserChannel: ApiNotificationUserChannel): void;
@@ -953,7 +964,7 @@ export declare class DefaultSocket implements Socket {
953
964
  writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
954
965
  writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean, topic_id?: string, emoji_recent_id?: string): Promise<ApiMessageReaction>;
955
966
  writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean): Promise<MessageTypingEvent>;
956
- writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
967
+ writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
957
968
  writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
958
969
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
959
970
  writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.11.14",
4
+ "version": "2.11.16",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -245,6 +245,8 @@ export interface LastSeenMessageEvent {
245
245
  channel_label: string;
246
246
  /** The unique ID of this message. */
247
247
  message_id: string;
248
+ //
249
+ badge_count: number;
248
250
  }
249
251
 
250
252
  /** User is typing */
@@ -494,6 +496,8 @@ export interface ChannelUpdatedEvent {
494
496
  age_restricted: number;
495
497
  //
496
498
  is_active_thread: boolean;
499
+ //
500
+ active: number;
497
501
  }
498
502
 
499
503
  export interface ChannelCreatedEvent {
@@ -521,6 +525,19 @@ export interface ChannelCreatedEvent {
521
525
  clan_name: string;
522
526
  }
523
527
 
528
+ export interface CategoryEvent {
529
+ // clan id
530
+ clan_id: string;
531
+ // category
532
+ id: string;
533
+ // creator
534
+ creator_id: string;
535
+ // category_name
536
+ category_name: string;
537
+ // status
538
+ status: number;
539
+ }
540
+
524
541
  export interface ChannelDeletedEvent {
525
542
  // clan id
526
543
  clan_id: string;
@@ -1138,7 +1155,8 @@ export interface Socket {
1138
1155
  channel_id: string,
1139
1156
  mode: number,
1140
1157
  message_id: string,
1141
- timestamp_seconds: number
1158
+ timestamp_seconds: number,
1159
+ badge_count: number
1142
1160
  ): Promise<LastSeenMessageEvent>;
1143
1161
 
1144
1162
  /** Send last pin message */
@@ -1315,6 +1333,8 @@ export interface Socket {
1315
1333
  // when channel is created
1316
1334
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
1317
1335
 
1336
+ oncategoryevent: (categoryEvent: CategoryEvent) => void;
1337
+
1318
1338
  onroleevent: (roleEvent: RoleEvent) => void;
1319
1339
 
1320
1340
  // when channel is deleted
@@ -1493,6 +1513,8 @@ export class DefaultSocket implements Socket {
1493
1513
  this.onvoiceleaved(message.voice_leaved_event);
1494
1514
  } else if (message.channel_created_event) {
1495
1515
  this.onchannelcreated(message.channel_created_event);
1516
+ } else if (message.category_event) {
1517
+ this.oncategoryevent(message.category_event);
1496
1518
  } else if (message.role_event) {
1497
1519
  this.onroleevent(message.role_event);
1498
1520
  } else if (message.event_emoji) {
@@ -1871,6 +1893,12 @@ export class DefaultSocket implements Socket {
1871
1893
  }
1872
1894
  }
1873
1895
 
1896
+ oncategoryevent(categoryEvent: CategoryEvent) {
1897
+ if (this.verbose && window && window.console) {
1898
+ console.log(categoryEvent);
1899
+ }
1900
+ }
1901
+
1874
1902
  onroleevent(roleEvent: RoleEvent) {
1875
1903
  if (this.verbose && window && window.console) {
1876
1904
  console.log(roleEvent);
@@ -2380,7 +2408,8 @@ export class DefaultSocket implements Socket {
2380
2408
  channel_id: string,
2381
2409
  mode: number,
2382
2410
  message_id: string,
2383
- timestamp_seconds: number
2411
+ timestamp_seconds: number,
2412
+ badge_count: number
2384
2413
  ): Promise<LastSeenMessageEvent> {
2385
2414
  const response = await this.send({
2386
2415
  last_seen_message_event: {
@@ -2389,6 +2418,7 @@ export class DefaultSocket implements Socket {
2389
2418
  mode: mode,
2390
2419
  message_id: message_id,
2391
2420
  timestamp_seconds: timestamp_seconds,
2421
+ badge_count: badge_count,
2392
2422
  },
2393
2423
  });
2394
2424
  return response.last_seen_message_event;