mezon-js 2.12.16 → 2.12.18
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 +2 -0
- package/client.ts +3 -0
- package/dist/api.gen.d.ts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/mezon-js.cjs.js +22 -1
- package/dist/mezon-js.esm.mjs +22 -1
- package/dist/socket.d.ts +10 -1
- package/package.json +1 -1
- package/socket.ts +41 -1
package/api.gen.ts
CHANGED
package/client.ts
CHANGED
@@ -353,6 +353,8 @@ export interface Friend {
|
|
353
353
|
state?: number;
|
354
354
|
/** The user object. */
|
355
355
|
user?: User;
|
356
|
+
//Source ID
|
357
|
+
source_id?: string;
|
356
358
|
}
|
357
359
|
|
358
360
|
/** A collection of zero or more friends of the user. */
|
@@ -1895,6 +1897,7 @@ export class Client {
|
|
1895
1897
|
: undefined,
|
1896
1898
|
},
|
1897
1899
|
state: f.state,
|
1900
|
+
source_id: f.source_id,
|
1898
1901
|
});
|
1899
1902
|
});
|
1900
1903
|
return Promise.resolve(result);
|
package/dist/api.gen.d.ts
CHANGED
package/dist/client.d.ts
CHANGED
package/dist/mezon-js.cjs.js
CHANGED
@@ -7108,6 +7108,10 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7108
7108
|
this.onmessagedropdownboxselected(
|
7109
7109
|
message.dropdown_box_selected
|
7110
7110
|
);
|
7111
|
+
} else if (message.voice_reaction_send) {
|
7112
|
+
this.onVoiceReactionMessage(
|
7113
|
+
message.voice_reaction_send
|
7114
|
+
);
|
7111
7115
|
} else if (message.webrtc_signaling_fwd) {
|
7112
7116
|
this.onwebrtcsignalingfwd(
|
7113
7117
|
message.webrtc_signaling_fwd
|
@@ -7453,6 +7457,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7453
7457
|
console.log(msg);
|
7454
7458
|
}
|
7455
7459
|
}
|
7460
|
+
onVoiceReactionMessage(event) {
|
7461
|
+
if (this.verbose && window && window.console) {
|
7462
|
+
console.log(event);
|
7463
|
+
}
|
7464
|
+
}
|
7456
7465
|
onwebrtcsignalingfwd(event) {
|
7457
7466
|
if (this.verbose && window && window.console) {
|
7458
7467
|
console.log(event);
|
@@ -7776,6 +7785,17 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7776
7785
|
return response.check_name_existed_event;
|
7777
7786
|
});
|
7778
7787
|
}
|
7788
|
+
writeVoiceReaction(emojis, channel_id) {
|
7789
|
+
return __async(this, null, function* () {
|
7790
|
+
const response = yield this.send({
|
7791
|
+
voice_reaction_send: {
|
7792
|
+
emojis,
|
7793
|
+
channel_id
|
7794
|
+
}
|
7795
|
+
});
|
7796
|
+
return response.voice_reaction_send;
|
7797
|
+
});
|
7798
|
+
}
|
7779
7799
|
forwardWebrtcSignaling(receiver_id, data_type, json_data, channel_id, caller_id) {
|
7780
7800
|
return __async(this, null, function* () {
|
7781
7801
|
const response = yield this.send({
|
@@ -8769,7 +8789,8 @@ var Client = class {
|
|
8769
8789
|
is_mobile: (_a = f.user) == null ? void 0 : _a.is_mobile,
|
8770
8790
|
metadata: f.user.metadata ? safeJSONParse(f.user.metadata) : void 0
|
8771
8791
|
},
|
8772
|
-
state: f.state
|
8792
|
+
state: f.state,
|
8793
|
+
source_id: f.source_id
|
8773
8794
|
});
|
8774
8795
|
});
|
8775
8796
|
return Promise.resolve(result);
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7074,6 +7074,10 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7074
7074
|
this.onmessagedropdownboxselected(
|
7075
7075
|
message.dropdown_box_selected
|
7076
7076
|
);
|
7077
|
+
} else if (message.voice_reaction_send) {
|
7078
|
+
this.onVoiceReactionMessage(
|
7079
|
+
message.voice_reaction_send
|
7080
|
+
);
|
7077
7081
|
} else if (message.webrtc_signaling_fwd) {
|
7078
7082
|
this.onwebrtcsignalingfwd(
|
7079
7083
|
message.webrtc_signaling_fwd
|
@@ -7419,6 +7423,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7419
7423
|
console.log(msg);
|
7420
7424
|
}
|
7421
7425
|
}
|
7426
|
+
onVoiceReactionMessage(event) {
|
7427
|
+
if (this.verbose && window && window.console) {
|
7428
|
+
console.log(event);
|
7429
|
+
}
|
7430
|
+
}
|
7422
7431
|
onwebrtcsignalingfwd(event) {
|
7423
7432
|
if (this.verbose && window && window.console) {
|
7424
7433
|
console.log(event);
|
@@ -7742,6 +7751,17 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7742
7751
|
return response.check_name_existed_event;
|
7743
7752
|
});
|
7744
7753
|
}
|
7754
|
+
writeVoiceReaction(emojis, channel_id) {
|
7755
|
+
return __async(this, null, function* () {
|
7756
|
+
const response = yield this.send({
|
7757
|
+
voice_reaction_send: {
|
7758
|
+
emojis,
|
7759
|
+
channel_id
|
7760
|
+
}
|
7761
|
+
});
|
7762
|
+
return response.voice_reaction_send;
|
7763
|
+
});
|
7764
|
+
}
|
7745
7765
|
forwardWebrtcSignaling(receiver_id, data_type, json_data, channel_id, caller_id) {
|
7746
7766
|
return __async(this, null, function* () {
|
7747
7767
|
const response = yield this.send({
|
@@ -8735,7 +8755,8 @@ var Client = class {
|
|
8735
8755
|
is_mobile: (_a = f.user) == null ? void 0 : _a.is_mobile,
|
8736
8756
|
metadata: f.user.metadata ? safeJSONParse(f.user.metadata) : void 0
|
8737
8757
|
},
|
8738
|
-
state: f.state
|
8758
|
+
state: f.state,
|
8759
|
+
source_id: f.source_id
|
8739
8760
|
});
|
8740
8761
|
});
|
8741
8762
|
return Promise.resolve(result);
|
package/dist/socket.d.ts
CHANGED
@@ -728,6 +728,11 @@ export interface IncomingCallPush {
|
|
728
728
|
channel_id: string;
|
729
729
|
caller_id: string;
|
730
730
|
}
|
731
|
+
export interface VoiceReactionSend {
|
732
|
+
emojis: Array<string>;
|
733
|
+
channel_id: string;
|
734
|
+
sender_id: string;
|
735
|
+
}
|
731
736
|
export interface WebrtcSignalingFwd {
|
732
737
|
receiver_id: string;
|
733
738
|
data_type: number;
|
@@ -822,6 +827,7 @@ export interface Socket {
|
|
822
827
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
823
828
|
handleMessageButtonClick: (message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string) => Promise<MessageButtonClicked>;
|
824
829
|
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
830
|
+
writeVoiceReaction: (emojis: Array<string>, channel_id: string) => Promise<VoiceReactionSend>;
|
825
831
|
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
826
832
|
forwardSFUSignaling: (user_id: string, data_type: number, json_data: string, channel_id: string, clan_id: string) => Promise<SFUSignalingFwd>;
|
827
833
|
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
@@ -890,6 +896,7 @@ export interface Socket {
|
|
890
896
|
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
891
897
|
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
892
898
|
onwebrtcsignalingfwd: (event: WebrtcSignalingFwd) => void;
|
899
|
+
onVoiceReactionMessage: (event: VoiceReactionSend) => void;
|
893
900
|
onsfusignalingfwd: (event: SFUSignalingFwd) => void;
|
894
901
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
895
902
|
oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
|
@@ -996,6 +1003,7 @@ export declare class DefaultSocket implements Socket {
|
|
996
1003
|
ontokensent(tokenSentEvent: ApiTokenSentEvent): void;
|
997
1004
|
onmessagebuttonclicked(messageButtonClicked: MessageButtonClicked): void;
|
998
1005
|
onmessagedropdownboxselected(msg: DropdownBoxSelected): void;
|
1006
|
+
onVoiceReactionMessage(event: VoiceReactionSend): void;
|
999
1007
|
onwebrtcsignalingfwd(event: WebrtcSignalingFwd): void;
|
1000
1008
|
onsfusignalingfwd(event: SFUSignalingFwd): void;
|
1001
1009
|
onactivityupdated(list_activity: ListActivity): void;
|
@@ -1004,7 +1012,7 @@ export declare class DefaultSocket implements Socket {
|
|
1004
1012
|
onuserstatusevent(user_status_event: UserStatusEvent): void;
|
1005
1013
|
onJoinChannelAppEvent(join_channel_app_data: JoinChannelAppData): void;
|
1006
1014
|
onUnpinMessageEvent(unpin_message_event: UnpinMessageEvent): void;
|
1007
|
-
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent | EphemeralMessageSend, sendTimeout?: number): Promise<any>;
|
1015
|
+
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent | EphemeralMessageSend | VoiceReactionSend, sendTimeout?: number): Promise<any>;
|
1008
1016
|
followUsers(userIds: string[]): Promise<Status>;
|
1009
1017
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
1010
1018
|
follower(): Promise<void>;
|
@@ -1024,6 +1032,7 @@ export declare class DefaultSocket implements Socket {
|
|
1024
1032
|
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
|
1025
1033
|
writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
1026
1034
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
1035
|
+
writeVoiceReaction(emojis: Array<string>, channel_id: string): Promise<VoiceReactionSend>;
|
1027
1036
|
forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
1028
1037
|
forwardSFUSignaling(user_id: string, data_type: number, json_data: string, channel_id: string, clan_id: string): Promise<SFUSignalingFwd>;
|
1029
1038
|
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -1040,6 +1040,15 @@ export interface IncomingCallPush {
|
|
1040
1040
|
caller_id: string;
|
1041
1041
|
}
|
1042
1042
|
|
1043
|
+
export interface VoiceReactionSend {
|
1044
|
+
// list emojis
|
1045
|
+
emojis: Array<string>;
|
1046
|
+
// channel_id
|
1047
|
+
channel_id: string;
|
1048
|
+
// sender id
|
1049
|
+
sender_id: string;
|
1050
|
+
}
|
1051
|
+
|
1043
1052
|
export interface WebrtcSignalingFwd {
|
1044
1053
|
receiver_id: string;
|
1045
1054
|
data_type: number;
|
@@ -1371,6 +1380,11 @@ export interface Socket {
|
|
1371
1380
|
value: Array<string>
|
1372
1381
|
) => Promise<DropdownBoxSelected>;
|
1373
1382
|
|
1383
|
+
writeVoiceReaction: (
|
1384
|
+
emojis: Array<string>,
|
1385
|
+
channel_id: string
|
1386
|
+
) => Promise<VoiceReactionSend>
|
1387
|
+
|
1374
1388
|
forwardWebrtcSignaling: (
|
1375
1389
|
receiverId: string,
|
1376
1390
|
dataType: number,
|
@@ -1519,6 +1533,8 @@ export interface Socket {
|
|
1519
1533
|
|
1520
1534
|
onwebrtcsignalingfwd: (event: WebrtcSignalingFwd) => void;
|
1521
1535
|
|
1536
|
+
onVoiceReactionMessage: (event: VoiceReactionSend) => void;
|
1537
|
+
|
1522
1538
|
onsfusignalingfwd: (event: SFUSignalingFwd) => void;
|
1523
1539
|
|
1524
1540
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
@@ -1792,6 +1808,10 @@ export class DefaultSocket implements Socket {
|
|
1792
1808
|
this.onmessagedropdownboxselected(
|
1793
1809
|
<DropdownBoxSelected>message.dropdown_box_selected
|
1794
1810
|
);
|
1811
|
+
} else if (message.voice_reaction_send) {
|
1812
|
+
this.onVoiceReactionMessage(
|
1813
|
+
<VoiceReactionSend>message.voice_reaction_send
|
1814
|
+
);
|
1795
1815
|
} else if (message.webrtc_signaling_fwd) {
|
1796
1816
|
this.onwebrtcsignalingfwd(
|
1797
1817
|
<WebrtcSignalingFwd>message.webrtc_signaling_fwd
|
@@ -2201,6 +2221,12 @@ export class DefaultSocket implements Socket {
|
|
2201
2221
|
}
|
2202
2222
|
}
|
2203
2223
|
|
2224
|
+
onVoiceReactionMessage(event: VoiceReactionSend) {
|
2225
|
+
if (this.verbose && window && window.console) {
|
2226
|
+
console.log(event);
|
2227
|
+
}
|
2228
|
+
}
|
2229
|
+
|
2204
2230
|
onwebrtcsignalingfwd(event: WebrtcSignalingFwd) {
|
2205
2231
|
if (this.verbose && window && window.console) {
|
2206
2232
|
console.log(event);
|
@@ -2269,7 +2295,8 @@ export class DefaultSocket implements Socket {
|
|
2269
2295
|
| MessageButtonClicked
|
2270
2296
|
| DropdownBoxSelected
|
2271
2297
|
| ChannelAppEvent
|
2272
|
-
| EphemeralMessageSend
|
2298
|
+
| EphemeralMessageSend
|
2299
|
+
| VoiceReactionSend,
|
2273
2300
|
sendTimeout = DefaultSocket.DefaultSendTimeoutMs
|
2274
2301
|
): Promise<any> {
|
2275
2302
|
const untypedMessage = message as any;
|
@@ -2659,6 +2686,19 @@ export class DefaultSocket implements Socket {
|
|
2659
2686
|
return response.check_name_existed_event;
|
2660
2687
|
}
|
2661
2688
|
|
2689
|
+
async writeVoiceReaction(
|
2690
|
+
emojis: Array<string>,
|
2691
|
+
channel_id: string
|
2692
|
+
): Promise<VoiceReactionSend> {
|
2693
|
+
const response = await this.send({
|
2694
|
+
voice_reaction_send: {
|
2695
|
+
emojis: emojis,
|
2696
|
+
channel_id: channel_id
|
2697
|
+
}
|
2698
|
+
});
|
2699
|
+
return response.voice_reaction_send;
|
2700
|
+
}
|
2701
|
+
|
2662
2702
|
async forwardWebrtcSignaling(
|
2663
2703
|
receiver_id: string,
|
2664
2704
|
data_type: number,
|