mezon-js 2.7.3 → 2.7.5

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -9,7 +9,7 @@ export interface ChannelUserListChannelUser {
9
9
  //
10
10
  id?: string;
11
11
  //Their relationship to the role.
12
- role_id?: string;
12
+ role_id?: Array<string>;
13
13
  //
14
14
  thread_id?: string;
15
15
  //User.
package/dist/api.gen.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** A single user-role pair. */
2
2
  export interface ChannelUserListChannelUser {
3
3
  id?: string;
4
- role_id?: string;
4
+ role_id?: Array<string>;
5
5
  thread_id?: string;
6
6
  user?: ApiUser;
7
7
  }
@@ -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,20 @@ 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
+ parrent_id: string;
272
+ channel_id: string;
273
+ channel_label: string;
274
+ }
275
+ export interface ChannelDeletedEvent {
276
+ clan_id: string;
277
+ category_id: string;
278
+ channel_id: string;
279
+ deletor: string;
280
+ }
267
281
  /** Stream identifier */
268
282
  export interface StreamId {
269
283
  /** The type of stream (e.g. chat). */
@@ -591,6 +605,8 @@ export interface Socket {
591
605
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
592
606
  onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
593
607
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
608
+ onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
609
+ onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
594
610
  setHeartbeatTimeoutMs(ms: number): void;
595
611
  getHeartbeatTimeoutMs(): number;
596
612
  }
@@ -639,6 +655,8 @@ export declare class DefaultSocket implements Socket {
639
655
  onstatuspresence(statusPresence: StatusPresenceEvent): void;
640
656
  onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
641
657
  onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
658
+ onchannelcreated(channelCreated: ChannelCreatedEvent): void;
659
+ onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
642
660
  onstreampresence(streamPresence: StreamPresenceEvent): void;
643
661
  onstreamdata(streamData: StreamData): void;
644
662
  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.5",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -364,6 +364,34 @@ 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
+ // parrent_id
376
+ parrent_id: string;
377
+ // channel id
378
+ channel_id: string;
379
+ // channel label
380
+ channel_label: string;
381
+ }
382
+
383
+ export interface ChannelDeletedEvent {
384
+ // clan id
385
+ clan_id: string;
386
+ // category
387
+ category_id: string;
388
+ // channel id
389
+ channel_id: string;
390
+ // deletor
391
+ deletor: string;
392
+ }
393
+
394
+
367
395
  /** Stream identifier */
368
396
  export interface StreamId {
369
397
  /** The type of stream (e.g. chat). */
@@ -762,6 +790,12 @@ export interface Socket {
762
790
  // when someone join to voice room
763
791
  onvoiceleaved: (voiceParticipant: VoiceLeavedEvent) => void;
764
792
 
793
+ // when channel is created
794
+ onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
795
+
796
+ // when channel is created
797
+ onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
798
+
765
799
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
766
800
  setHeartbeatTimeoutMs(ms : number) : void;
767
801
 
@@ -838,6 +872,10 @@ export class DefaultSocket implements Socket {
838
872
  this.onvoicejoined(message.voice_joined_event)
839
873
  } else if (message.voice_leaved_event) {
840
874
  this.onvoiceleaved(message.voice_leaved_event)
875
+ } else if (message.channel_created_event) {
876
+ this.onchannelcreated(message.channel_created_event)
877
+ } else if (message.channel_deleted_event) {
878
+ this.onchanneldeleted(message.channel_deleted_event)
841
879
  } else if (message.status_presence_event) {
842
880
  this.onstatuspresence(<StatusPresenceEvent>message.status_presence_event);
843
881
  } else if (message.stream_presence_event) {
@@ -1062,6 +1100,18 @@ export class DefaultSocket implements Socket {
1062
1100
  }
1063
1101
  }
1064
1102
 
1103
+ onchannelcreated(channelCreated: ChannelCreatedEvent) {
1104
+ if (this.verbose && window && window.console) {
1105
+ console.log(channelCreated);
1106
+ }
1107
+ }
1108
+
1109
+ onchanneldeleted(channelDeleted: ChannelDeletedEvent) {
1110
+ if (this.verbose && window && window.console) {
1111
+ console.log(channelDeleted);
1112
+ }
1113
+ }
1114
+
1065
1115
  onstreampresence(streamPresence: StreamPresenceEvent) {
1066
1116
  if (this.verbose && window && window.console) {
1067
1117
  console.log(streamPresence);