mezon-js 2.7.3 → 2.7.4

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.
@@ -3514,6 +3514,10 @@ var _DefaultSocket = class _DefaultSocket {
3514
3514
  this.onvoicejoined(message.voice_joined_event);
3515
3515
  } else if (message.voice_leaved_event) {
3516
3516
  this.onvoiceleaved(message.voice_leaved_event);
3517
+ } else if (message.channel_created_event) {
3518
+ this.onchannelcreated(message.channel_created_event);
3519
+ } else if (message.channel_deleted_event) {
3520
+ this.onchanneldeleted(message.channel_deleted_event);
3517
3521
  } else if (message.status_presence_event) {
3518
3522
  this.onstatuspresence(message.status_presence_event);
3519
3523
  } else if (message.stream_presence_event) {
@@ -3708,6 +3712,16 @@ var _DefaultSocket = class _DefaultSocket {
3708
3712
  console.log(voiceParticipant);
3709
3713
  }
3710
3714
  }
3715
+ onchannelcreated(channelCreated) {
3716
+ if (this.verbose && window && window.console) {
3717
+ console.log(channelCreated);
3718
+ }
3719
+ }
3720
+ onchanneldeleted(channelDeleted) {
3721
+ if (this.verbose && window && window.console) {
3722
+ console.log(channelDeleted);
3723
+ }
3724
+ }
3711
3725
  onstreampresence(streamPresence) {
3712
3726
  if (this.verbose && window && window.console) {
3713
3727
  console.log(streamPresence);
@@ -3486,6 +3486,10 @@ var _DefaultSocket = class _DefaultSocket {
3486
3486
  this.onvoicejoined(message.voice_joined_event);
3487
3487
  } else if (message.voice_leaved_event) {
3488
3488
  this.onvoiceleaved(message.voice_leaved_event);
3489
+ } else if (message.channel_created_event) {
3490
+ this.onchannelcreated(message.channel_created_event);
3491
+ } else if (message.channel_deleted_event) {
3492
+ this.onchanneldeleted(message.channel_deleted_event);
3489
3493
  } else if (message.status_presence_event) {
3490
3494
  this.onstatuspresence(message.status_presence_event);
3491
3495
  } else if (message.stream_presence_event) {
@@ -3680,6 +3684,16 @@ var _DefaultSocket = class _DefaultSocket {
3680
3684
  console.log(voiceParticipant);
3681
3685
  }
3682
3686
  }
3687
+ onchannelcreated(channelCreated) {
3688
+ if (this.verbose && window && window.console) {
3689
+ console.log(channelCreated);
3690
+ }
3691
+ }
3692
+ onchanneldeleted(channelDeleted) {
3693
+ if (this.verbose && window && window.console) {
3694
+ console.log(channelDeleted);
3695
+ }
3696
+ }
3683
3697
  onstreampresence(streamPresence) {
3684
3698
  if (this.verbose && window && window.console) {
3685
3699
  console.log(streamPresence);
package/dist/socket.d.ts CHANGED
@@ -264,6 +264,19 @@ export interface VoiceJoinedEvent {
264
264
  voice_channel_id: string;
265
265
  last_screenshot: string;
266
266
  }
267
+ export interface ChannelCreatedEvent {
268
+ clan_id: string;
269
+ category_id: string;
270
+ creator_id: string;
271
+ channel_id: string;
272
+ channel_label: string;
273
+ }
274
+ export interface ChannelDeletedEvent {
275
+ clan_id: string;
276
+ category_id: string;
277
+ channel_id: string;
278
+ deletor: string;
279
+ }
267
280
  /** Stream identifier */
268
281
  export interface StreamId {
269
282
  /** The type of stream (e.g. chat). */
@@ -591,6 +604,8 @@ export interface Socket {
591
604
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
592
605
  onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
593
606
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
607
+ onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
608
+ onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
594
609
  setHeartbeatTimeoutMs(ms: number): void;
595
610
  getHeartbeatTimeoutMs(): number;
596
611
  }
@@ -639,6 +654,8 @@ export declare class DefaultSocket implements Socket {
639
654
  onstatuspresence(statusPresence: StatusPresenceEvent): void;
640
655
  onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
641
656
  onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
657
+ onchannelcreated(channelCreated: ChannelCreatedEvent): void;
658
+ onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
642
659
  onstreampresence(streamPresence: StreamPresenceEvent): void;
643
660
  onstreamdata(streamData: StreamData): void;
644
661
  onheartbeattimeout(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -364,6 +364,32 @@ export interface VoiceJoinedEvent {
364
364
  last_screenshot: string;
365
365
  }
366
366
 
367
+
368
+ export interface ChannelCreatedEvent {
369
+ // clan id
370
+ clan_id: string;
371
+ // category
372
+ category_id: string;
373
+ // creator
374
+ creator_id: string;
375
+ // channel id
376
+ channel_id: string;
377
+ // channel label
378
+ channel_label: string;
379
+ }
380
+
381
+ export interface ChannelDeletedEvent {
382
+ // clan id
383
+ clan_id: string;
384
+ // category
385
+ category_id: string;
386
+ // channel id
387
+ channel_id: string;
388
+ // deletor
389
+ deletor: string;
390
+ }
391
+
392
+
367
393
  /** Stream identifier */
368
394
  export interface StreamId {
369
395
  /** The type of stream (e.g. chat). */
@@ -762,6 +788,12 @@ export interface Socket {
762
788
  // when someone join to voice room
763
789
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
764
790
 
791
+ // when channel is created
792
+ onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
793
+
794
+ // when channel is created
795
+ onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
796
+
765
797
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
766
798
  setHeartbeatTimeoutMs(ms : number) : void;
767
799
 
@@ -838,6 +870,10 @@ export class DefaultSocket implements Socket {
838
870
  this.onvoicejoined(message.voice_joined_event)
839
871
  } else if (message.voice_leaved_event) {
840
872
  this.onvoiceleaved(message.voice_leaved_event)
873
+ } else if (message.channel_created_event) {
874
+ this.onchannelcreated(message.channel_created_event)
875
+ } else if (message.channel_deleted_event) {
876
+ this.onchanneldeleted(message.channel_deleted_event)
841
877
  } else if (message.status_presence_event) {
842
878
  this.onstatuspresence(<StatusPresenceEvent>message.status_presence_event);
843
879
  } else if (message.stream_presence_event) {
@@ -1062,6 +1098,18 @@ export class DefaultSocket implements Socket {
1062
1098
  }
1063
1099
  }
1064
1100
 
1101
+ onchannelcreated(channelCreated: ChannelCreatedEvent) {
1102
+ if (this.verbose && window && window.console) {
1103
+ console.log(channelCreated);
1104
+ }
1105
+ }
1106
+
1107
+ onchanneldeleted(channelDeleted: ChannelDeletedEvent) {
1108
+ if (this.verbose && window && window.console) {
1109
+ console.log(channelDeleted);
1110
+ }
1111
+ }
1112
+
1065
1113
  onstreampresence(streamPresence: StreamPresenceEvent) {
1066
1114
  if (this.verbose && window && window.console) {
1067
1115
  console.log(streamPresence);