mezon-js 2.7.19 → 2.7.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -3697,6 +3697,8 @@ var _DefaultSocket = class _DefaultSocket {
3697
3697
  this.onchannelcreated(message.channel_created_event);
3698
3698
  } else if (message.channel_deleted_event) {
3699
3699
  this.onchanneldeleted(message.channel_deleted_event);
3700
+ } else if (message.channel_updated_event) {
3701
+ this.onchannelupdated(message.channel_updated_event);
3700
3702
  } else if (message.status_presence_event) {
3701
3703
  this.onstatuspresence(message.status_presence_event);
3702
3704
  } else if (message.stream_presence_event) {
@@ -3900,6 +3902,11 @@ var _DefaultSocket = class _DefaultSocket {
3900
3902
  console.log(channelDeleted);
3901
3903
  }
3902
3904
  }
3905
+ onchannelupdated(channelUpdated) {
3906
+ if (this.verbose && window && window.console) {
3907
+ console.log(channelUpdated);
3908
+ }
3909
+ }
3903
3910
  onstreampresence(streamPresence) {
3904
3911
  if (this.verbose && window && window.console) {
3905
3912
  console.log(streamPresence);
@@ -3669,6 +3669,8 @@ var _DefaultSocket = class _DefaultSocket {
3669
3669
  this.onchannelcreated(message.channel_created_event);
3670
3670
  } else if (message.channel_deleted_event) {
3671
3671
  this.onchanneldeleted(message.channel_deleted_event);
3672
+ } else if (message.channel_updated_event) {
3673
+ this.onchannelupdated(message.channel_updated_event);
3672
3674
  } else if (message.status_presence_event) {
3673
3675
  this.onstatuspresence(message.status_presence_event);
3674
3676
  } else if (message.stream_presence_event) {
@@ -3872,6 +3874,11 @@ var _DefaultSocket = class _DefaultSocket {
3872
3874
  console.log(channelDeleted);
3873
3875
  }
3874
3876
  }
3877
+ onchannelupdated(channelUpdated) {
3878
+ if (this.verbose && window && window.console) {
3879
+ console.log(channelUpdated);
3880
+ }
3881
+ }
3875
3882
  onstreampresence(streamPresence) {
3876
3883
  if (this.verbose && window && window.console) {
3877
3884
  console.log(streamPresence);
package/dist/socket.d.ts CHANGED
@@ -254,6 +254,15 @@ export interface VoiceJoinedEvent {
254
254
  voice_channel_id: string;
255
255
  last_screenshot: string;
256
256
  }
257
+ export interface ChannelUpdatedEvent {
258
+ clan_id: string;
259
+ category_id: string;
260
+ creator_id: string;
261
+ parrent_id: string;
262
+ channel_id: string;
263
+ channel_label: string;
264
+ channel_type: number;
265
+ }
257
266
  export interface ChannelCreatedEvent {
258
267
  clan_id: string;
259
268
  category_id: string;
@@ -594,6 +603,7 @@ export interface Socket {
594
603
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
595
604
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
596
605
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
606
+ onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
597
607
  setHeartbeatTimeoutMs(ms: number): void;
598
608
  getHeartbeatTimeoutMs(): number;
599
609
  }
@@ -643,6 +653,7 @@ export declare class DefaultSocket implements Socket {
643
653
  onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
644
654
  onchannelcreated(channelCreated: ChannelCreatedEvent): void;
645
655
  onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
656
+ onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
646
657
  onstreampresence(streamPresence: StreamPresenceEvent): void;
647
658
  onstreamdata(streamData: StreamData): void;
648
659
  onheartbeattimeout(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.19",
3
+ "version": "2.7.20",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -352,6 +352,23 @@ export interface VoiceJoinedEvent {
352
352
  }
353
353
 
354
354
 
355
+ export interface ChannelUpdatedEvent {
356
+ // clan id
357
+ clan_id: string;
358
+ // category
359
+ category_id: string;
360
+ // creator
361
+ creator_id: string;
362
+ // parrent_id
363
+ parrent_id: string;
364
+ // channel id
365
+ channel_id: string;
366
+ // channel label
367
+ channel_label: string;
368
+ // channel type
369
+ channel_type: number;
370
+ }
371
+
355
372
  export interface ChannelCreatedEvent {
356
373
  // clan id
357
374
  clan_id: string;
@@ -779,6 +796,9 @@ export interface Socket {
779
796
  // when channel is created
780
797
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
781
798
 
799
+ // when channel is created
800
+ onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
801
+
782
802
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
783
803
  setHeartbeatTimeoutMs(ms : number) : void;
784
804
 
@@ -859,6 +879,8 @@ export class DefaultSocket implements Socket {
859
879
  this.onchannelcreated(message.channel_created_event)
860
880
  } else if (message.channel_deleted_event) {
861
881
  this.onchanneldeleted(message.channel_deleted_event)
882
+ } else if (message.channel_updated_event) {
883
+ this.onchannelupdated(message.channel_updated_event)
862
884
  } else if (message.status_presence_event) {
863
885
  this.onstatuspresence(<StatusPresenceEvent>message.status_presence_event);
864
886
  } else if (message.stream_presence_event) {
@@ -1093,6 +1115,12 @@ export class DefaultSocket implements Socket {
1093
1115
  }
1094
1116
  }
1095
1117
 
1118
+ onchannelupdated(channelUpdated: ChannelUpdatedEvent) {
1119
+ if (this.verbose && window && window.console) {
1120
+ console.log(channelUpdated);
1121
+ }
1122
+ }
1123
+
1096
1124
  onstreampresence(streamPresence: StreamPresenceEvent) {
1097
1125
  if (this.verbose && window && window.console) {
1098
1126
  console.log(streamPresence);