mezon-js 2.12.15 → 2.12.16
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/dist/mezon-js.cjs.js +7 -0
- package/dist/mezon-js.esm.mjs +7 -0
- package/dist/socket.d.ts +26 -1
- package/package.json +1 -1
- package/socket.ts +44 -1
package/dist/mezon-js.cjs.js
CHANGED
@@ -7060,6 +7060,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7060
7060
|
this.onuserchannelremoved(
|
7061
7061
|
message.user_channel_removed_event
|
7062
7062
|
);
|
7063
|
+
} else if (message.block_friend) {
|
7064
|
+
this.onblockfriend(message.block_friend);
|
7063
7065
|
} else if (message.remove_friend) {
|
7064
7066
|
this.onremovefriend(message.remove_friend);
|
7065
7067
|
} else if (message.user_clan_removed_event) {
|
@@ -7236,6 +7238,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7236
7238
|
console.log(user);
|
7237
7239
|
}
|
7238
7240
|
}
|
7241
|
+
onblockfriend(user) {
|
7242
|
+
if (this.verbose && window && window.console) {
|
7243
|
+
console.log(user);
|
7244
|
+
}
|
7245
|
+
}
|
7239
7246
|
onuserclanremoved(user) {
|
7240
7247
|
if (this.verbose && window && window.console) {
|
7241
7248
|
console.log(user);
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7026,6 +7026,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7026
7026
|
this.onuserchannelremoved(
|
7027
7027
|
message.user_channel_removed_event
|
7028
7028
|
);
|
7029
|
+
} else if (message.block_friend) {
|
7030
|
+
this.onblockfriend(message.block_friend);
|
7029
7031
|
} else if (message.remove_friend) {
|
7030
7032
|
this.onremovefriend(message.remove_friend);
|
7031
7033
|
} else if (message.user_clan_removed_event) {
|
@@ -7202,6 +7204,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7202
7204
|
console.log(user);
|
7203
7205
|
}
|
7204
7206
|
}
|
7207
|
+
onblockfriend(user) {
|
7208
|
+
if (this.verbose && window && window.console) {
|
7209
|
+
console.log(user);
|
7210
|
+
}
|
7211
|
+
}
|
7205
7212
|
onuserclanremoved(user) {
|
7206
7213
|
if (this.verbose && window && window.console) {
|
7207
7214
|
console.log(user);
|
package/dist/socket.d.ts
CHANGED
@@ -237,7 +237,27 @@ interface ChannelMessageSend {
|
|
237
237
|
};
|
238
238
|
}
|
239
239
|
interface EphemeralMessageSend {
|
240
|
-
ephemeral_message_send: {
|
240
|
+
ephemeral_message_send: {
|
241
|
+
receiver_id: string;
|
242
|
+
message: {
|
243
|
+
/** Clan Id */
|
244
|
+
clan_id: string;
|
245
|
+
/** The server-assigned channel ID. */
|
246
|
+
channel_id: string;
|
247
|
+
mode: number;
|
248
|
+
channel_label: string;
|
249
|
+
/** The content payload. */
|
250
|
+
content: any;
|
251
|
+
mentions?: Array<ApiMessageMention>;
|
252
|
+
attachments?: Array<ApiMessageAttachment>;
|
253
|
+
anonymous_message?: boolean;
|
254
|
+
mention_everyone?: boolean;
|
255
|
+
avatar: string;
|
256
|
+
is_public: boolean;
|
257
|
+
code: number;
|
258
|
+
topic_id?: string;
|
259
|
+
};
|
260
|
+
};
|
241
261
|
}
|
242
262
|
/** Update a message previously sent to a realtime chat channel. */
|
243
263
|
interface ChannelMessageUpdate {
|
@@ -581,6 +601,9 @@ export interface UserEmojiUsage {
|
|
581
601
|
export interface RemoveFriend {
|
582
602
|
user_id: string;
|
583
603
|
}
|
604
|
+
export interface BlockFriend {
|
605
|
+
user_id: string;
|
606
|
+
}
|
584
607
|
export interface AddUserEmojiUsageEvent {
|
585
608
|
emoji_id: string;
|
586
609
|
clan_id: string;
|
@@ -845,6 +868,7 @@ export interface Socket {
|
|
845
868
|
/** Receive channel removed user event */
|
846
869
|
onuserchannelremoved: (user: UserChannelRemovedEvent) => void;
|
847
870
|
onremovefriend: (user: RemoveFriend) => void;
|
871
|
+
onblockfriend: (user: BlockFriend) => void;
|
848
872
|
/** Receive clan removed user event */
|
849
873
|
onuserclanremoved: (user: UserClanRemovedEvent) => void;
|
850
874
|
onvoicestarted: (voice: VoiceStartedEvent) => void;
|
@@ -929,6 +953,7 @@ export declare class DefaultSocket implements Socket {
|
|
929
953
|
onuserprofileupdate(user: UserProfileUpdatedEvent): void;
|
930
954
|
onuserchannelremoved(user: UserChannelRemovedEvent): void;
|
931
955
|
onremovefriend(user: RemoveFriend): void;
|
956
|
+
onblockfriend(user: BlockFriend): void;
|
932
957
|
onuserclanremoved(user: UserClanRemovedEvent): void;
|
933
958
|
onnotification(notification: ApiNotification): void;
|
934
959
|
onstatuspresence(statusPresence: StatusPresenceEvent): void;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -350,7 +350,35 @@ interface ChannelMessageSend {
|
|
350
350
|
|
351
351
|
interface EphemeralMessageSend {
|
352
352
|
ephemeral_message_send: {
|
353
|
-
|
353
|
+
receiver_id: string,
|
354
|
+
message: {
|
355
|
+
/** Clan Id */
|
356
|
+
clan_id: string;
|
357
|
+
/** The server-assigned channel ID. */
|
358
|
+
channel_id: string;
|
359
|
+
// The mode
|
360
|
+
mode: number;
|
361
|
+
// channel label
|
362
|
+
channel_label: string;
|
363
|
+
/** The content payload. */
|
364
|
+
content: any;
|
365
|
+
//
|
366
|
+
mentions?: Array<ApiMessageMention>;
|
367
|
+
//
|
368
|
+
attachments?: Array<ApiMessageAttachment>;
|
369
|
+
//
|
370
|
+
anonymous_message?: boolean;
|
371
|
+
//
|
372
|
+
mention_everyone?: boolean;
|
373
|
+
//
|
374
|
+
avatar: string;
|
375
|
+
// Is public
|
376
|
+
is_public: boolean;
|
377
|
+
// code
|
378
|
+
code: number;
|
379
|
+
//
|
380
|
+
topic_id?: string;
|
381
|
+
}
|
354
382
|
}
|
355
383
|
}
|
356
384
|
|
@@ -869,6 +897,11 @@ export interface RemoveFriend {
|
|
869
897
|
user_id: string;
|
870
898
|
}
|
871
899
|
|
900
|
+
export interface BlockFriend {
|
901
|
+
//
|
902
|
+
user_id: string;
|
903
|
+
}
|
904
|
+
|
872
905
|
export interface AddUserEmojiUsageEvent {
|
873
906
|
emoji_id: string;
|
874
907
|
clan_id: string;
|
@@ -1429,6 +1462,8 @@ export interface Socket {
|
|
1429
1462
|
|
1430
1463
|
onremovefriend: (user: RemoveFriend) => void;
|
1431
1464
|
|
1465
|
+
onblockfriend: (user: BlockFriend) => void;
|
1466
|
+
|
1432
1467
|
/** Receive clan removed user event */
|
1433
1468
|
onuserclanremoved: (user: UserClanRemovedEvent) => void;
|
1434
1469
|
|
@@ -1709,6 +1744,8 @@ export class DefaultSocket implements Socket {
|
|
1709
1744
|
this.onuserchannelremoved(
|
1710
1745
|
<UserChannelRemovedEvent>message.user_channel_removed_event
|
1711
1746
|
);
|
1747
|
+
} else if (message.block_friend) {
|
1748
|
+
this.onblockfriend(<BlockFriend>message.block_friend);
|
1712
1749
|
} else if (message.remove_friend) {
|
1713
1750
|
this.onremovefriend(<RemoveFriend>message.remove_friend);
|
1714
1751
|
} else if (message.user_clan_removed_event) {
|
@@ -1906,6 +1943,12 @@ export class DefaultSocket implements Socket {
|
|
1906
1943
|
}
|
1907
1944
|
}
|
1908
1945
|
|
1946
|
+
onblockfriend(user: BlockFriend) {
|
1947
|
+
if (this.verbose && window && window.console) {
|
1948
|
+
console.log(user);
|
1949
|
+
}
|
1950
|
+
}
|
1951
|
+
|
1909
1952
|
onuserclanremoved(user: UserClanRemovedEvent) {
|
1910
1953
|
if (this.verbose && window && window.console) {
|
1911
1954
|
console.log(user);
|