mezon-js 2.7.96 → 2.7.97

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.
package/api.gen.ts CHANGED
@@ -958,6 +958,10 @@ export interface ApiMessageMention {
958
958
  user_id?: string;
959
959
  //
960
960
  username?: string;
961
+ // role id
962
+ role_id?: string;
963
+ // role name
964
+ rolename?: string;
961
965
  }
962
966
 
963
967
  /** */
package/dist/api.gen.d.ts CHANGED
@@ -551,6 +551,8 @@ export interface ApiMessageMention {
551
551
  id?: string;
552
552
  user_id?: string;
553
553
  username?: string;
554
+ role_id?: string;
555
+ rolename?: string;
554
556
  }
555
557
  /** */
556
558
  export interface ApiMessageReaction {
@@ -4766,6 +4766,10 @@ var _DefaultSocket = class _DefaultSocket {
4766
4766
  this.onchanneldeleted(message.channel_deleted_event);
4767
4767
  } else if (message.channel_updated_event) {
4768
4768
  this.onchannelupdated(message.channel_updated_event);
4769
+ } else if (message.clan_profile_updated_event) {
4770
+ this.onclanprofileupdated(message.clan_profile_updated_event);
4771
+ } else if (message.clan_updated_event) {
4772
+ this.onclanupdated(message.clan_updated_event);
4769
4773
  } else if (message.status_presence_event) {
4770
4774
  this.onstatuspresence(message.status_presence_event);
4771
4775
  } else if (message.stream_presence_event) {
@@ -4969,6 +4973,16 @@ var _DefaultSocket = class _DefaultSocket {
4969
4973
  console.log(channelUpdated);
4970
4974
  }
4971
4975
  }
4976
+ onclanprofileupdated(clanprofile) {
4977
+ if (this.verbose && window && window.console) {
4978
+ console.log(clanprofile);
4979
+ }
4980
+ }
4981
+ onclanupdated(clan) {
4982
+ if (this.verbose && window && window.console) {
4983
+ console.log(clan);
4984
+ }
4985
+ }
4972
4986
  onstreampresence(streamPresence) {
4973
4987
  if (this.verbose && window && window.console) {
4974
4988
  console.log(streamPresence);
@@ -4737,6 +4737,10 @@ var _DefaultSocket = class _DefaultSocket {
4737
4737
  this.onchanneldeleted(message.channel_deleted_event);
4738
4738
  } else if (message.channel_updated_event) {
4739
4739
  this.onchannelupdated(message.channel_updated_event);
4740
+ } else if (message.clan_profile_updated_event) {
4741
+ this.onclanprofileupdated(message.clan_profile_updated_event);
4742
+ } else if (message.clan_updated_event) {
4743
+ this.onclanupdated(message.clan_updated_event);
4740
4744
  } else if (message.status_presence_event) {
4741
4745
  this.onstatuspresence(message.status_presence_event);
4742
4746
  } else if (message.stream_presence_event) {
@@ -4940,6 +4944,16 @@ var _DefaultSocket = class _DefaultSocket {
4940
4944
  console.log(channelUpdated);
4941
4945
  }
4942
4946
  }
4947
+ onclanprofileupdated(clanprofile) {
4948
+ if (this.verbose && window && window.console) {
4949
+ console.log(clanprofile);
4950
+ }
4951
+ }
4952
+ onclanupdated(clan) {
4953
+ if (this.verbose && window && window.console) {
4954
+ console.log(clan);
4955
+ }
4956
+ }
4943
4957
  onstreampresence(streamPresence) {
4944
4958
  if (this.verbose && window && window.console) {
4945
4959
  console.log(streamPresence);
package/dist/socket.d.ts CHANGED
@@ -342,6 +342,16 @@ export interface ChannelDeletedEvent {
342
342
  channel_id: string;
343
343
  deletor: string;
344
344
  }
345
+ export interface ClanUpdatedEvent {
346
+ clan_id: string;
347
+ clan_name: string;
348
+ clan_logo: string;
349
+ }
350
+ export interface ClanProfileUpdatedEvent {
351
+ user_id: string;
352
+ clan_nick: string;
353
+ clan_avatar: string;
354
+ }
345
355
  /** Stream identifier */
346
356
  export interface StreamId {
347
357
  /** The type of stream (e.g. chat). */
@@ -498,6 +508,8 @@ export interface Socket {
498
508
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
499
509
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
500
510
  onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
511
+ onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
512
+ onclanupdated: (clan: ClanUpdatedEvent) => void;
501
513
  setHeartbeatTimeoutMs(ms: number): void;
502
514
  getHeartbeatTimeoutMs(): number;
503
515
  }
@@ -548,6 +560,8 @@ export declare class DefaultSocket implements Socket {
548
560
  onchannelcreated(channelCreated: ChannelCreatedEvent): void;
549
561
  onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
550
562
  onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
563
+ onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
564
+ onclanupdated(clan: ClanUpdatedEvent): void;
551
565
  onstreampresence(streamPresence: StreamPresenceEvent): void;
552
566
  onstreamdata(streamData: StreamData): void;
553
567
  onheartbeattimeout(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.96",
3
+ "version": "2.7.97",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -500,6 +500,24 @@ export interface ChannelDeletedEvent {
500
500
  deletor: string;
501
501
  }
502
502
 
503
+ // clan updated event
504
+ export interface ClanUpdatedEvent {
505
+ // the clan id
506
+ clan_id: string;
507
+ // the clan name
508
+ clan_name: string;
509
+ // the clan logo
510
+ clan_logo: string;
511
+ }
512
+
513
+ export interface ClanProfileUpdatedEvent {
514
+ // the user id
515
+ user_id: string;
516
+ // the clan_nick
517
+ clan_nick: string;
518
+ // the avatar
519
+ clan_avatar: string;
520
+ }
503
521
 
504
522
  /** Stream identifier */
505
523
  export interface StreamId {
@@ -706,12 +724,18 @@ export interface Socket {
706
724
  // when channel is created
707
725
  onchannelcreated: (channelCreated: ChannelCreatedEvent) => void;
708
726
 
709
- // when channel is created
727
+ // when channel is deleted
710
728
  onchanneldeleted: (channelDeleted: ChannelDeletedEvent) => void;
711
729
 
712
- // when channel is created
730
+ // when channel is updated
713
731
  onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
714
732
 
733
+ // when clan profile is updated
734
+ onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
735
+
736
+ // when clan is updated
737
+ onclanupdated: (clan: ClanUpdatedEvent) => void;
738
+
715
739
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
716
740
  setHeartbeatTimeoutMs(ms : number) : void;
717
741
 
@@ -802,6 +826,10 @@ export class DefaultSocket implements Socket {
802
826
  this.onchanneldeleted(message.channel_deleted_event)
803
827
  } else if (message.channel_updated_event) {
804
828
  this.onchannelupdated(message.channel_updated_event)
829
+ } else if (message.clan_profile_updated_event) {
830
+ this.onclanprofileupdated(message.clan_profile_updated_event)
831
+ } else if (message.clan_updated_event) {
832
+ this.onclanupdated(message.clan_updated_event)
805
833
  } else if (message.status_presence_event) {
806
834
  this.onstatuspresence(<StatusPresenceEvent>message.status_presence_event);
807
835
  } else if (message.stream_presence_event) {
@@ -1034,6 +1062,18 @@ export class DefaultSocket implements Socket {
1034
1062
  }
1035
1063
  }
1036
1064
 
1065
+ onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent) {
1066
+ if (this.verbose && window && window.console) {
1067
+ console.log(clanprofile);
1068
+ }
1069
+ }
1070
+
1071
+ onclanupdated(clan: ClanUpdatedEvent) {
1072
+ if (this.verbose && window && window.console) {
1073
+ console.log(clan);
1074
+ }
1075
+ }
1076
+
1037
1077
  onstreampresence(streamPresence: StreamPresenceEvent) {
1038
1078
  if (this.verbose && window && window.console) {
1039
1079
  console.log(streamPresence);