mezon-js 2.9.86 → 2.9.88
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 +16 -2
- package/dist/mezon-js.esm.mjs +16 -2
- package/dist/socket.d.ts +17 -8
- package/package.json +1 -1
- package/socket.ts +74 -38
package/dist/mezon-js.cjs.js
CHANGED
@@ -7631,6 +7631,19 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7631
7631
|
return response.webrtc_signaling_fwd;
|
7632
7632
|
});
|
7633
7633
|
}
|
7634
|
+
makeCallPush(receiver_id, json_data, channel_id, caller_id) {
|
7635
|
+
return __async(this, null, function* () {
|
7636
|
+
const response = yield this.send({
|
7637
|
+
incoming_call_push: {
|
7638
|
+
receiver_id,
|
7639
|
+
json_data,
|
7640
|
+
channel_id,
|
7641
|
+
caller_id
|
7642
|
+
}
|
7643
|
+
});
|
7644
|
+
return response.incoming_call_push;
|
7645
|
+
});
|
7646
|
+
}
|
7634
7647
|
handleDropdownBoxSelected(message_id, channel_id, selectbox_id, sender_id, user_id, value) {
|
7635
7648
|
return __async(this, null, function* () {
|
7636
7649
|
const response = yield this.send({
|
@@ -7646,7 +7659,7 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7646
7659
|
return response.dropdown_box_selected;
|
7647
7660
|
});
|
7648
7661
|
}
|
7649
|
-
handleMessageButtonClick(message_id, channel_id, button_id, sender_id, user_id) {
|
7662
|
+
handleMessageButtonClick(message_id, channel_id, button_id, sender_id, user_id, extra_data) {
|
7650
7663
|
return __async(this, null, function* () {
|
7651
7664
|
const response = yield this.send({
|
7652
7665
|
message_button_clicked: {
|
@@ -7654,7 +7667,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7654
7667
|
channel_id,
|
7655
7668
|
button_id,
|
7656
7669
|
sender_id,
|
7657
|
-
user_id
|
7670
|
+
user_id,
|
7671
|
+
extra_data
|
7658
7672
|
}
|
7659
7673
|
});
|
7660
7674
|
return response.webrtc_signaling_fwd;
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7601,6 +7601,19 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7601
7601
|
return response.webrtc_signaling_fwd;
|
7602
7602
|
});
|
7603
7603
|
}
|
7604
|
+
makeCallPush(receiver_id, json_data, channel_id, caller_id) {
|
7605
|
+
return __async(this, null, function* () {
|
7606
|
+
const response = yield this.send({
|
7607
|
+
incoming_call_push: {
|
7608
|
+
receiver_id,
|
7609
|
+
json_data,
|
7610
|
+
channel_id,
|
7611
|
+
caller_id
|
7612
|
+
}
|
7613
|
+
});
|
7614
|
+
return response.incoming_call_push;
|
7615
|
+
});
|
7616
|
+
}
|
7604
7617
|
handleDropdownBoxSelected(message_id, channel_id, selectbox_id, sender_id, user_id, value) {
|
7605
7618
|
return __async(this, null, function* () {
|
7606
7619
|
const response = yield this.send({
|
@@ -7616,7 +7629,7 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7616
7629
|
return response.dropdown_box_selected;
|
7617
7630
|
});
|
7618
7631
|
}
|
7619
|
-
handleMessageButtonClick(message_id, channel_id, button_id, sender_id, user_id) {
|
7632
|
+
handleMessageButtonClick(message_id, channel_id, button_id, sender_id, user_id, extra_data) {
|
7620
7633
|
return __async(this, null, function* () {
|
7621
7634
|
const response = yield this.send({
|
7622
7635
|
message_button_clicked: {
|
@@ -7624,7 +7637,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7624
7637
|
channel_id,
|
7625
7638
|
button_id,
|
7626
7639
|
sender_id,
|
7627
|
-
user_id
|
7640
|
+
user_id,
|
7641
|
+
extra_data
|
7628
7642
|
}
|
7629
7643
|
});
|
7630
7644
|
return response.webrtc_signaling_fwd;
|
package/dist/socket.d.ts
CHANGED
@@ -592,6 +592,13 @@ export interface MessageButtonClicked {
|
|
592
592
|
button_id: string;
|
593
593
|
sender_id: string;
|
594
594
|
user_id: string;
|
595
|
+
extra_data: string;
|
596
|
+
}
|
597
|
+
export interface IncomingCallPush {
|
598
|
+
receiver_id: string;
|
599
|
+
json_data: string;
|
600
|
+
channel_id: string;
|
601
|
+
caller_id: string;
|
595
602
|
}
|
596
603
|
export interface WebrtcSignalingFwd {
|
597
604
|
receiver_id: string;
|
@@ -663,6 +670,13 @@ export interface Socket {
|
|
663
670
|
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
664
671
|
joinPTTChannel(channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
665
672
|
talkPTTChannel(channelId: string, dataType: number, jsonData: string, state: number): Promise<TalkPTTChannel>;
|
673
|
+
setHeartbeatTimeoutMs(ms: number): void;
|
674
|
+
getHeartbeatTimeoutMs(): number;
|
675
|
+
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
676
|
+
handleMessageButtonClick: (message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string) => Promise<MessageButtonClicked>;
|
677
|
+
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
678
|
+
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
679
|
+
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
666
680
|
/** Handle disconnect events received from the socket. */
|
667
681
|
ondisconnect: (evt: Event) => void;
|
668
682
|
/** Handle error events received from the socket. */
|
@@ -718,12 +732,6 @@ export interface Socket {
|
|
718
732
|
onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
|
719
733
|
onclanupdated: (clan: ClanUpdatedEvent) => void;
|
720
734
|
onlastseenupdated: (event: LastSeenMessageEvent) => void;
|
721
|
-
setHeartbeatTimeoutMs(ms: number): void;
|
722
|
-
getHeartbeatTimeoutMs(): number;
|
723
|
-
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
724
|
-
handleMessageButtonClick: (message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string) => Promise<MessageButtonClicked>;
|
725
|
-
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
726
|
-
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
727
735
|
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
728
736
|
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
729
737
|
onwebrtcsignalingfwd: (event: WebrtcSignalingFwd) => void;
|
@@ -822,7 +830,7 @@ export declare class DefaultSocket implements Socket {
|
|
822
830
|
onactivityupdated(list_activity: ListActivity): void;
|
823
831
|
onjoinpttchannel(join_ptt_channel: JoinPTTChannel): void;
|
824
832
|
ontalkpttchannel(talk_ptt_channel: TalkPTTChannel): void;
|
825
|
-
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | MessageButtonClicked | DropdownBoxSelected | JoinPTTChannel | TalkPTTChannel, sendTimeout?: number): Promise<any>;
|
833
|
+
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | JoinPTTChannel | TalkPTTChannel, sendTimeout?: number): Promise<any>;
|
826
834
|
followUsers(userIds: string[]): Promise<Status>;
|
827
835
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
828
836
|
joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
@@ -842,8 +850,9 @@ export declare class DefaultSocket implements Socket {
|
|
842
850
|
writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
|
843
851
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
844
852
|
forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
853
|
+
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
845
854
|
handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
|
846
|
-
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string): Promise<MessageButtonClicked>;
|
855
|
+
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string): Promise<MessageButtonClicked>;
|
847
856
|
joinPTTChannel(channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
848
857
|
talkPTTChannel(channelId: string, dataType: number, jsonData: string, state: number): Promise<TalkPTTChannel>;
|
849
858
|
private pingPong;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -837,6 +837,14 @@ export interface MessageButtonClicked {
|
|
837
837
|
button_id: string;
|
838
838
|
sender_id: string;
|
839
839
|
user_id: string;
|
840
|
+
extra_data: string;
|
841
|
+
}
|
842
|
+
|
843
|
+
export interface IncomingCallPush {
|
844
|
+
receiver_id: string;
|
845
|
+
json_data: string;
|
846
|
+
channel_id: string;
|
847
|
+
caller_id: string;
|
840
848
|
}
|
841
849
|
|
842
850
|
export interface WebrtcSignalingFwd {
|
@@ -1039,6 +1047,51 @@ export interface Socket {
|
|
1039
1047
|
state: number
|
1040
1048
|
): Promise<TalkPTTChannel>;
|
1041
1049
|
|
1050
|
+
/* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1051
|
+
setHeartbeatTimeoutMs(ms: number): void;
|
1052
|
+
|
1053
|
+
/* Get the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1054
|
+
getHeartbeatTimeoutMs(): number;
|
1055
|
+
|
1056
|
+
checkDuplicateName(
|
1057
|
+
name: string,
|
1058
|
+
condition_id: string,
|
1059
|
+
type: number
|
1060
|
+
): Promise<CheckNameExistedEvent>;
|
1061
|
+
|
1062
|
+
handleMessageButtonClick: (
|
1063
|
+
message_id: string,
|
1064
|
+
channel_id: string,
|
1065
|
+
button_id: string,
|
1066
|
+
sender_id: string,
|
1067
|
+
user_id: string,
|
1068
|
+
extra_data: string
|
1069
|
+
) => Promise<MessageButtonClicked>;
|
1070
|
+
|
1071
|
+
handleDropdownBoxSelected: (
|
1072
|
+
message_id: string,
|
1073
|
+
channel_id: string,
|
1074
|
+
selectbox_id: string,
|
1075
|
+
sender_id: string,
|
1076
|
+
user_id: string,
|
1077
|
+
value: Array<string>
|
1078
|
+
) => Promise<DropdownBoxSelected>;
|
1079
|
+
|
1080
|
+
forwardWebrtcSignaling: (
|
1081
|
+
receiverId: string,
|
1082
|
+
dataType: number,
|
1083
|
+
jsonData: string,
|
1084
|
+
channelId: string,
|
1085
|
+
caller_id: string
|
1086
|
+
) => Promise<WebrtcSignalingFwd>;
|
1087
|
+
|
1088
|
+
makeCallPush: (
|
1089
|
+
receiverId: string,
|
1090
|
+
jsonData: string,
|
1091
|
+
channelId: string,
|
1092
|
+
caller_id: string
|
1093
|
+
) => Promise<IncomingCallPush>;
|
1094
|
+
|
1042
1095
|
/** Handle disconnect events received from the socket. */
|
1043
1096
|
ondisconnect: (evt: Event) => void;
|
1044
1097
|
|
@@ -1141,43 +1194,6 @@ export interface Socket {
|
|
1141
1194
|
// when user update last seen message
|
1142
1195
|
onlastseenupdated: (event: LastSeenMessageEvent) => void;
|
1143
1196
|
|
1144
|
-
/* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1145
|
-
setHeartbeatTimeoutMs(ms: number): void;
|
1146
|
-
|
1147
|
-
/* Get the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1148
|
-
getHeartbeatTimeoutMs(): number;
|
1149
|
-
|
1150
|
-
checkDuplicateName(
|
1151
|
-
name: string,
|
1152
|
-
condition_id: string,
|
1153
|
-
type: number
|
1154
|
-
): Promise<CheckNameExistedEvent>;
|
1155
|
-
|
1156
|
-
handleMessageButtonClick: (
|
1157
|
-
message_id: string,
|
1158
|
-
channel_id: string,
|
1159
|
-
button_id: string,
|
1160
|
-
sender_id: string,
|
1161
|
-
user_id: string
|
1162
|
-
) => Promise<MessageButtonClicked>;
|
1163
|
-
|
1164
|
-
handleDropdownBoxSelected: (
|
1165
|
-
message_id: string,
|
1166
|
-
channel_id: string,
|
1167
|
-
selectbox_id: string,
|
1168
|
-
sender_id: string,
|
1169
|
-
user_id: string,
|
1170
|
-
value: Array<string>
|
1171
|
-
) => Promise<DropdownBoxSelected>;
|
1172
|
-
|
1173
|
-
forwardWebrtcSignaling: (
|
1174
|
-
receiverId: string,
|
1175
|
-
dataType: number,
|
1176
|
-
jsonData: string,
|
1177
|
-
channelId: string,
|
1178
|
-
caller_id: string
|
1179
|
-
) => Promise<WebrtcSignalingFwd>;
|
1180
|
-
|
1181
1197
|
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
1182
1198
|
|
1183
1199
|
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
@@ -1871,6 +1887,7 @@ export class DefaultSocket implements Socket {
|
|
1871
1887
|
| StatusUpdate
|
1872
1888
|
| Ping
|
1873
1889
|
| WebrtcSignalingFwd
|
1890
|
+
| IncomingCallPush
|
1874
1891
|
| MessageButtonClicked
|
1875
1892
|
| DropdownBoxSelected
|
1876
1893
|
| JoinPTTChannel
|
@@ -2227,6 +2244,23 @@ export class DefaultSocket implements Socket {
|
|
2227
2244
|
return response.webrtc_signaling_fwd;
|
2228
2245
|
}
|
2229
2246
|
|
2247
|
+
async makeCallPush(
|
2248
|
+
receiver_id: string,
|
2249
|
+
json_data: string,
|
2250
|
+
channel_id: string,
|
2251
|
+
caller_id: string
|
2252
|
+
): Promise<IncomingCallPush> {
|
2253
|
+
const response = await this.send({
|
2254
|
+
incoming_call_push: {
|
2255
|
+
receiver_id: receiver_id,
|
2256
|
+
json_data: json_data,
|
2257
|
+
channel_id: channel_id,
|
2258
|
+
caller_id: caller_id,
|
2259
|
+
},
|
2260
|
+
});
|
2261
|
+
return response.incoming_call_push;
|
2262
|
+
}
|
2263
|
+
|
2230
2264
|
async handleDropdownBoxSelected(
|
2231
2265
|
message_id: string,
|
2232
2266
|
channel_id: string,
|
@@ -2253,7 +2287,8 @@ export class DefaultSocket implements Socket {
|
|
2253
2287
|
channel_id: string,
|
2254
2288
|
button_id: string,
|
2255
2289
|
sender_id: string,
|
2256
|
-
user_id: string
|
2290
|
+
user_id: string,
|
2291
|
+
extra_data: string
|
2257
2292
|
): Promise<MessageButtonClicked> {
|
2258
2293
|
const response = await this.send({
|
2259
2294
|
message_button_clicked: {
|
@@ -2262,6 +2297,7 @@ export class DefaultSocket implements Socket {
|
|
2262
2297
|
button_id: button_id,
|
2263
2298
|
sender_id: sender_id,
|
2264
2299
|
user_id: user_id,
|
2300
|
+
extra_data: extra_data
|
2265
2301
|
},
|
2266
2302
|
});
|
2267
2303
|
return response.webrtc_signaling_fwd;
|