mezon-js 2.12.93 → 2.12.95

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
@@ -5052,8 +5052,8 @@ export class MezonApi {
5052
5052
 
5053
5053
  /** Leave a channel the user is a member of. */
5054
5054
  leaveThread(bearerToken: string,
5055
- channelId:string,
5056
- clanId?:string,
5055
+ clanId:string,
5056
+ channelId:string,
5057
5057
  options: any = {}): Promise<any> {
5058
5058
 
5059
5059
  if (channelId === null || channelId === undefined) {
package/dist/api.gen.d.ts CHANGED
@@ -2030,7 +2030,7 @@ export declare class MezonApi {
2030
2030
  /** store channel encryption method */
2031
2031
  setChanEncryptionMethod(bearerToken: string, channelId: string, body: MezonSetChanEncryptionMethodBody, options?: any): Promise<any>;
2032
2032
  /** Leave a channel the user is a member of. */
2033
- leaveThread(bearerToken: string, channelId: string, clanId?: string, options?: any): Promise<any>;
2033
+ leaveThread(bearerToken: string, clanId: string, channelId: string, options?: any): Promise<any>;
2034
2034
  /** Kick a set of users from a channel. */
2035
2035
  removeChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
2036
2036
  /** List all users that are part of a channel. */
@@ -2033,7 +2033,7 @@ var MezonApi = class {
2033
2033
  ]);
2034
2034
  }
2035
2035
  /** Leave a channel the user is a member of. */
2036
- leaveThread(bearerToken, channelId, clanId, options = {}) {
2036
+ leaveThread(bearerToken, clanId, channelId, options = {}) {
2037
2037
  if (channelId === null || channelId === void 0) {
2038
2038
  throw new Error("'channelId' is a required parameter but is null or undefined.");
2039
2039
  }
@@ -7369,6 +7369,8 @@ var _DefaultSocket = class _DefaultSocket {
7369
7369
  this.onblockfriend(message.block_friend);
7370
7370
  } else if (message.un_block_friend) {
7371
7371
  this.onunblockfriend(message.un_block_friend);
7372
+ } else if (message.add_friend) {
7373
+ this.onaddfriend(message.add_friend);
7372
7374
  } else if (message.remove_friend) {
7373
7375
  this.onremovefriend(message.remove_friend);
7374
7376
  } else if (message.user_clan_removed_event) {
@@ -7547,6 +7549,11 @@ var _DefaultSocket = class _DefaultSocket {
7547
7549
  console.log(user);
7548
7550
  }
7549
7551
  }
7552
+ onaddfriend(user) {
7553
+ if (this.verbose && window && window.console) {
7554
+ console.log(user);
7555
+ }
7556
+ }
7550
7557
  onremovefriend(user) {
7551
7558
  if (this.verbose && window && window.console) {
7552
7559
  console.log(user);
@@ -1999,7 +1999,7 @@ var MezonApi = class {
1999
1999
  ]);
2000
2000
  }
2001
2001
  /** Leave a channel the user is a member of. */
2002
- leaveThread(bearerToken, channelId, clanId, options = {}) {
2002
+ leaveThread(bearerToken, clanId, channelId, options = {}) {
2003
2003
  if (channelId === null || channelId === void 0) {
2004
2004
  throw new Error("'channelId' is a required parameter but is null or undefined.");
2005
2005
  }
@@ -7335,6 +7335,8 @@ var _DefaultSocket = class _DefaultSocket {
7335
7335
  this.onblockfriend(message.block_friend);
7336
7336
  } else if (message.un_block_friend) {
7337
7337
  this.onunblockfriend(message.un_block_friend);
7338
+ } else if (message.add_friend) {
7339
+ this.onaddfriend(message.add_friend);
7338
7340
  } else if (message.remove_friend) {
7339
7341
  this.onremovefriend(message.remove_friend);
7340
7342
  } else if (message.user_clan_removed_event) {
@@ -7513,6 +7515,11 @@ var _DefaultSocket = class _DefaultSocket {
7513
7515
  console.log(user);
7514
7516
  }
7515
7517
  }
7518
+ onaddfriend(user) {
7519
+ if (this.verbose && window && window.console) {
7520
+ console.log(user);
7521
+ }
7522
+ }
7516
7523
  onremovefriend(user) {
7517
7524
  if (this.verbose && window && window.console) {
7518
7525
  console.log(user);
package/dist/socket.d.ts CHANGED
@@ -649,6 +649,12 @@ export interface UserEmojiUsage {
649
649
  clan_id: string;
650
650
  create_time: string;
651
651
  }
652
+ export interface AddFriend {
653
+ user_id: string;
654
+ username: string;
655
+ display_name: string;
656
+ avatar: string;
657
+ }
652
658
  export interface RemoveFriend {
653
659
  user_id: string;
654
660
  }
@@ -987,6 +993,7 @@ export interface Socket {
987
993
  onuserprofileupdate: (user: UserProfileUpdatedEvent) => void;
988
994
  /** Receive channel removed user event */
989
995
  onuserchannelremoved: (user: UserChannelRemovedEvent) => void;
996
+ onaddfriend: (user: AddFriend) => void;
990
997
  onremovefriend: (user: RemoveFriend) => void;
991
998
  onblockfriend: (user: BlockFriend) => void;
992
999
  onunblockfriend: (user: UnblockFriend) => void;
@@ -1076,6 +1083,7 @@ export declare class DefaultSocket implements Socket {
1076
1083
  onuserclanadded(user: AddClanUserEvent): void;
1077
1084
  onuserprofileupdate(user: UserProfileUpdatedEvent): void;
1078
1085
  onuserchannelremoved(user: UserChannelRemovedEvent): void;
1086
+ onaddfriend(user: AddFriend): void;
1079
1087
  onremovefriend(user: RemoveFriend): void;
1080
1088
  onblockfriend(user: BlockFriend): void;
1081
1089
  onunblockfriend(user: UnblockFriend): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.93",
3
+ "version": "2.12.95",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -1000,6 +1000,17 @@ export interface UserEmojiUsage {
1000
1000
  clan_id: string;
1001
1001
  create_time: string;
1002
1002
  }
1003
+
1004
+ export interface AddFriend {
1005
+ //
1006
+ user_id: string;// user id
1007
+ // username
1008
+ username: string;
1009
+ // display name
1010
+ display_name: string;
1011
+ // avatar
1012
+ avatar: string;
1013
+ }
1003
1014
  export interface RemoveFriend {
1004
1015
  //
1005
1016
  user_id: string;
@@ -1674,6 +1685,8 @@ export interface Socket {
1674
1685
  /** Receive channel removed user event */
1675
1686
  onuserchannelremoved: (user: UserChannelRemovedEvent) => void;
1676
1687
 
1688
+ onaddfriend: (user: AddFriend) => void;
1689
+
1677
1690
  onremovefriend: (user: RemoveFriend) => void;
1678
1691
 
1679
1692
  onblockfriend: (user: BlockFriend) => void;
@@ -1969,6 +1982,8 @@ export class DefaultSocket implements Socket {
1969
1982
  this.onblockfriend(<BlockFriend>message.block_friend);
1970
1983
  } else if (message.un_block_friend) {
1971
1984
  this.onunblockfriend(<BlockFriend>message.un_block_friend);
1985
+ } else if (message.add_friend) {
1986
+ this.onaddfriend(<AddFriend>message.add_friend);
1972
1987
  } else if (message.remove_friend) {
1973
1988
  this.onremovefriend(<RemoveFriend>message.remove_friend);
1974
1989
  } else if (message.user_clan_removed_event) {
@@ -2166,6 +2181,12 @@ export class DefaultSocket implements Socket {
2166
2181
  }
2167
2182
  }
2168
2183
 
2184
+ onaddfriend(user: AddFriend) {
2185
+ if (this.verbose && window && window.console) {
2186
+ console.log(user);
2187
+ }
2188
+ }
2189
+
2169
2190
  onremovefriend(user: RemoveFriend) {
2170
2191
  if (this.verbose && window && window.console) {
2171
2192
  console.log(user);