mezon-js 2.12.76 → 2.12.78

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.
@@ -7345,6 +7345,8 @@ var _DefaultSocket = class _DefaultSocket {
7345
7345
  this.onquickmenuevent(message.quick_menu_event);
7346
7346
  } else if (message.meet_participant_event) {
7347
7347
  this.onmeetparticipantevent(message.meet_participant_event);
7348
+ } else if (message.transfer_ownership_event) {
7349
+ this.ontransferownership(message.transfer_ownership_event);
7348
7350
  } else {
7349
7351
  if (this.verbose && window && window.console) {
7350
7352
  console.log("Unrecognized message received: %o", message);
@@ -7722,6 +7724,11 @@ var _DefaultSocket = class _DefaultSocket {
7722
7724
  console.log(event);
7723
7725
  }
7724
7726
  }
7727
+ ontransferownership(event) {
7728
+ if (this.verbose && window && window.console) {
7729
+ console.log(event);
7730
+ }
7731
+ }
7725
7732
  onmeetparticipantevent(event) {
7726
7733
  if (this.verbose && window && window.console) {
7727
7734
  console.log(event);
@@ -7798,14 +7805,15 @@ var _DefaultSocket = class _DefaultSocket {
7798
7805
  return response.channel;
7799
7806
  });
7800
7807
  }
7801
- handleParticipantMeetState(clan_id, channel_id, display_name, state) {
7808
+ handleParticipantMeetState(clan_id, channel_id, display_name, state, room_name) {
7802
7809
  return __async(this, null, function* () {
7803
7810
  const response = yield this.send({
7804
7811
  handle_participant_meet_state_event: {
7805
7812
  clan_id,
7806
7813
  channel_id,
7807
7814
  display_name,
7808
- state
7815
+ state,
7816
+ room_name
7809
7817
  }
7810
7818
  });
7811
7819
  return response.handle_participant_meet_state_event;
@@ -7311,6 +7311,8 @@ var _DefaultSocket = class _DefaultSocket {
7311
7311
  this.onquickmenuevent(message.quick_menu_event);
7312
7312
  } else if (message.meet_participant_event) {
7313
7313
  this.onmeetparticipantevent(message.meet_participant_event);
7314
+ } else if (message.transfer_ownership_event) {
7315
+ this.ontransferownership(message.transfer_ownership_event);
7314
7316
  } else {
7315
7317
  if (this.verbose && window && window.console) {
7316
7318
  console.log("Unrecognized message received: %o", message);
@@ -7688,6 +7690,11 @@ var _DefaultSocket = class _DefaultSocket {
7688
7690
  console.log(event);
7689
7691
  }
7690
7692
  }
7693
+ ontransferownership(event) {
7694
+ if (this.verbose && window && window.console) {
7695
+ console.log(event);
7696
+ }
7697
+ }
7691
7698
  onmeetparticipantevent(event) {
7692
7699
  if (this.verbose && window && window.console) {
7693
7700
  console.log(event);
@@ -7764,14 +7771,15 @@ var _DefaultSocket = class _DefaultSocket {
7764
7771
  return response.channel;
7765
7772
  });
7766
7773
  }
7767
- handleParticipantMeetState(clan_id, channel_id, display_name, state) {
7774
+ handleParticipantMeetState(clan_id, channel_id, display_name, state, room_name) {
7768
7775
  return __async(this, null, function* () {
7769
7776
  const response = yield this.send({
7770
7777
  handle_participant_meet_state_event: {
7771
7778
  clan_id,
7772
7779
  channel_id,
7773
7780
  display_name,
7774
- state
7781
+ state,
7782
+ room_name
7775
7783
  }
7776
7784
  });
7777
7785
  return response.handle_participant_meet_state_event;
package/dist/socket.d.ts CHANGED
@@ -242,6 +242,11 @@ interface ChannelMessageSend {
242
242
  topic_id?: string;
243
243
  };
244
244
  }
245
+ interface TransferOwnershipEvent {
246
+ clan_id: string;
247
+ prev_owner: string;
248
+ curr_owner: string;
249
+ }
245
250
  interface QuickMenuEvent {
246
251
  quick_menu_event: {
247
252
  menu_name: string;
@@ -734,6 +739,8 @@ export interface HandleParticipantMeetStateEvent {
734
739
  display_name: string;
735
740
  /** state (0: join, 1: leave) */
736
741
  state: number;
742
+ /** room name */
743
+ room_name: string;
737
744
  }
738
745
  export interface PermissionSet {
739
746
  /** Role ID */
@@ -903,7 +910,7 @@ export interface Socket {
903
910
  /** Leave a chat channel on the server. */
904
911
  leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
905
912
  /** handle user join/leave channel voice on the server. */
906
- handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number): Promise<void>;
913
+ handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number, room_name: string): Promise<void>;
907
914
  /** Remove a chat message from a chat channel on the server. */
908
915
  removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
909
916
  /** Execute an RPC function to the server. */
@@ -1028,6 +1035,7 @@ export interface Socket {
1028
1035
  onjoinchannelappevent: (join_channel_app_data: JoinChannelAppData) => void;
1029
1036
  onunpinmessageevent: (unpin_message_event: UnpinMessageEvent) => void;
1030
1037
  onquickmenuevent: (event: QuickMenuEvent) => void;
1038
+ ontransferownership: (event: TransferOwnershipEvent) => void;
1031
1039
  }
1032
1040
  /** Reports an error received from a socket message. */
1033
1041
  export interface SocketError {
@@ -1122,13 +1130,14 @@ export declare class DefaultSocket implements Socket {
1122
1130
  onjoinchannelappevent(join_channel_app_data: JoinChannelAppData): void;
1123
1131
  onunpinmessageevent(unpin_message_event: UnpinMessageEvent): void;
1124
1132
  onquickmenuevent(event: QuickMenuEvent): void;
1133
+ ontransferownership(event: TransferOwnershipEvent): void;
1125
1134
  onmeetparticipantevent(event: MeetParticipantEvent): void;
1126
1135
  send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent | EphemeralMessageSend | VoiceReactionSend | ListDataSocket | QuickMenuEvent, sendTimeout?: number): Promise<any>;
1127
1136
  followUsers(userIds: string[]): Promise<Status>;
1128
1137
  joinClanChat(clan_id: string): Promise<ClanJoin>;
1129
1138
  follower(): Promise<void>;
1130
1139
  joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
1131
- handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number): Promise<void>;
1140
+ handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number, room_name: string): Promise<void>;
1132
1141
  leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
1133
1142
  removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
1134
1143
  rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.76",
3
+ "version": "2.12.78",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -389,6 +389,12 @@ interface ChannelMessageSend {
389
389
  };
390
390
  }
391
391
 
392
+ interface TransferOwnershipEvent {
393
+ clan_id: string;
394
+ prev_owner: string;
395
+ curr_owner: string;
396
+ }
397
+
392
398
  interface QuickMenuEvent {
393
399
  quick_menu_event: {
394
400
  menu_name: string,
@@ -1097,6 +1103,8 @@ export interface HandleParticipantMeetStateEvent {
1097
1103
  display_name: string;
1098
1104
  /** state (0: join, 1: leave) */
1099
1105
  state: number;
1106
+ /** room name */
1107
+ room_name: string;
1100
1108
  }
1101
1109
 
1102
1110
  export interface PermissionSet {
@@ -1390,7 +1398,8 @@ export interface Socket {
1390
1398
  clan_id: string,
1391
1399
  channel_id: string,
1392
1400
  display_name: string,
1393
- state: number
1401
+ state: number,
1402
+ room_name: string
1394
1403
  ): Promise<void>
1395
1404
 
1396
1405
  /** Remove a chat message from a chat channel on the server. */
@@ -1781,6 +1790,8 @@ export interface Socket {
1781
1790
  onunpinmessageevent: (unpin_message_event: UnpinMessageEvent)=> void;
1782
1791
 
1783
1792
  onquickmenuevent: (event: QuickMenuEvent) => void;
1793
+
1794
+ ontransferownership: (event: TransferOwnershipEvent) => void;
1784
1795
  }
1785
1796
 
1786
1797
  /** Reports an error received from a socket message. */
@@ -2030,6 +2041,8 @@ export class DefaultSocket implements Socket {
2030
2041
  this.onquickmenuevent(<QuickMenuEvent>message.quick_menu_event);
2031
2042
  } else if (message.meet_participant_event) {
2032
2043
  this.onmeetparticipantevent(<MeetParticipantEvent>message.meet_participant_event);
2044
+ } else if (message.transfer_ownership_event) {
2045
+ this.ontransferownership(<TransferOwnershipEvent>message.transfer_ownership_event);
2033
2046
  } else {
2034
2047
  if (this.verbose && window && window.console) {
2035
2048
  console.log("Unrecognized message received: %o", message);
@@ -2481,6 +2494,12 @@ export class DefaultSocket implements Socket {
2481
2494
  }
2482
2495
  }
2483
2496
 
2497
+ ontransferownership(event: TransferOwnershipEvent) {
2498
+ if (this.verbose && window && window.console) {
2499
+ console.log(event);
2500
+ }
2501
+ }
2502
+
2484
2503
  onmeetparticipantevent(event: MeetParticipantEvent) {
2485
2504
  if (this.verbose && window && window.console) {
2486
2505
  console.log(event);
@@ -2595,7 +2614,8 @@ export class DefaultSocket implements Socket {
2595
2614
  clan_id: string,
2596
2615
  channel_id: string,
2597
2616
  display_name: string,
2598
- state: number
2617
+ state: number,
2618
+ room_name: string,
2599
2619
  ): Promise<void> {
2600
2620
  const response = await this.send({
2601
2621
  handle_participant_meet_state_event: {
@@ -2603,6 +2623,7 @@ export class DefaultSocket implements Socket {
2603
2623
  channel_id: channel_id,
2604
2624
  display_name: display_name,
2605
2625
  state: state,
2626
+ room_name: room_name,
2606
2627
  },
2607
2628
  });
2608
2629