mezon-js 2.9.86 → 2.9.87
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 +13 -0
- package/dist/mezon-js.esm.mjs +13 -0
- package/dist/socket.d.ts +15 -7
- package/package.json +1 -1
- package/socket.ts +69 -37
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({
|
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({
|
package/dist/socket.d.ts
CHANGED
@@ -593,6 +593,12 @@ export interface MessageButtonClicked {
|
|
593
593
|
sender_id: string;
|
594
594
|
user_id: string;
|
595
595
|
}
|
596
|
+
export interface IncomingCallPush {
|
597
|
+
receiver_id: string;
|
598
|
+
json_data: string;
|
599
|
+
channel_id: string;
|
600
|
+
caller_id: string;
|
601
|
+
}
|
596
602
|
export interface WebrtcSignalingFwd {
|
597
603
|
receiver_id: string;
|
598
604
|
data_type: number;
|
@@ -663,6 +669,13 @@ export interface Socket {
|
|
663
669
|
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
664
670
|
joinPTTChannel(channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
665
671
|
talkPTTChannel(channelId: string, dataType: number, jsonData: string, state: number): Promise<TalkPTTChannel>;
|
672
|
+
setHeartbeatTimeoutMs(ms: number): void;
|
673
|
+
getHeartbeatTimeoutMs(): number;
|
674
|
+
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
675
|
+
handleMessageButtonClick: (message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string) => Promise<MessageButtonClicked>;
|
676
|
+
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
677
|
+
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
678
|
+
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
666
679
|
/** Handle disconnect events received from the socket. */
|
667
680
|
ondisconnect: (evt: Event) => void;
|
668
681
|
/** Handle error events received from the socket. */
|
@@ -718,12 +731,6 @@ export interface Socket {
|
|
718
731
|
onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
|
719
732
|
onclanupdated: (clan: ClanUpdatedEvent) => void;
|
720
733
|
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
734
|
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
728
735
|
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
729
736
|
onwebrtcsignalingfwd: (event: WebrtcSignalingFwd) => void;
|
@@ -822,7 +829,7 @@ export declare class DefaultSocket implements Socket {
|
|
822
829
|
onactivityupdated(list_activity: ListActivity): void;
|
823
830
|
onjoinpttchannel(join_ptt_channel: JoinPTTChannel): void;
|
824
831
|
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>;
|
832
|
+
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
833
|
followUsers(userIds: string[]): Promise<Status>;
|
827
834
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
828
835
|
joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
@@ -842,6 +849,7 @@ export declare class DefaultSocket implements Socket {
|
|
842
849
|
writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
|
843
850
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
844
851
|
forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
852
|
+
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
845
853
|
handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
|
846
854
|
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string): Promise<MessageButtonClicked>;
|
847
855
|
joinPTTChannel(channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -839,6 +839,13 @@ export interface MessageButtonClicked {
|
|
839
839
|
user_id: string;
|
840
840
|
}
|
841
841
|
|
842
|
+
export interface IncomingCallPush {
|
843
|
+
receiver_id: string;
|
844
|
+
json_data: string;
|
845
|
+
channel_id: string;
|
846
|
+
caller_id: string;
|
847
|
+
}
|
848
|
+
|
842
849
|
export interface WebrtcSignalingFwd {
|
843
850
|
receiver_id: string;
|
844
851
|
data_type: number;
|
@@ -1039,6 +1046,50 @@ export interface Socket {
|
|
1039
1046
|
state: number
|
1040
1047
|
): Promise<TalkPTTChannel>;
|
1041
1048
|
|
1049
|
+
/* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1050
|
+
setHeartbeatTimeoutMs(ms: number): void;
|
1051
|
+
|
1052
|
+
/* Get the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1053
|
+
getHeartbeatTimeoutMs(): number;
|
1054
|
+
|
1055
|
+
checkDuplicateName(
|
1056
|
+
name: string,
|
1057
|
+
condition_id: string,
|
1058
|
+
type: number
|
1059
|
+
): Promise<CheckNameExistedEvent>;
|
1060
|
+
|
1061
|
+
handleMessageButtonClick: (
|
1062
|
+
message_id: string,
|
1063
|
+
channel_id: string,
|
1064
|
+
button_id: string,
|
1065
|
+
sender_id: string,
|
1066
|
+
user_id: string
|
1067
|
+
) => Promise<MessageButtonClicked>;
|
1068
|
+
|
1069
|
+
handleDropdownBoxSelected: (
|
1070
|
+
message_id: string,
|
1071
|
+
channel_id: string,
|
1072
|
+
selectbox_id: string,
|
1073
|
+
sender_id: string,
|
1074
|
+
user_id: string,
|
1075
|
+
value: Array<string>
|
1076
|
+
) => Promise<DropdownBoxSelected>;
|
1077
|
+
|
1078
|
+
forwardWebrtcSignaling: (
|
1079
|
+
receiverId: string,
|
1080
|
+
dataType: number,
|
1081
|
+
jsonData: string,
|
1082
|
+
channelId: string,
|
1083
|
+
caller_id: string
|
1084
|
+
) => Promise<WebrtcSignalingFwd>;
|
1085
|
+
|
1086
|
+
makeCallPush: (
|
1087
|
+
receiverId: string,
|
1088
|
+
jsonData: string,
|
1089
|
+
channelId: string,
|
1090
|
+
caller_id: string
|
1091
|
+
) => Promise<IncomingCallPush>;
|
1092
|
+
|
1042
1093
|
/** Handle disconnect events received from the socket. */
|
1043
1094
|
ondisconnect: (evt: Event) => void;
|
1044
1095
|
|
@@ -1141,43 +1192,6 @@ export interface Socket {
|
|
1141
1192
|
// when user update last seen message
|
1142
1193
|
onlastseenupdated: (event: LastSeenMessageEvent) => void;
|
1143
1194
|
|
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
1195
|
onmessagebuttonclicked: (event: MessageButtonClicked) => void;
|
1182
1196
|
|
1183
1197
|
onmessagedropdownboxselected: (event: DropdownBoxSelected) => void;
|
@@ -1871,6 +1885,7 @@ export class DefaultSocket implements Socket {
|
|
1871
1885
|
| StatusUpdate
|
1872
1886
|
| Ping
|
1873
1887
|
| WebrtcSignalingFwd
|
1888
|
+
| IncomingCallPush
|
1874
1889
|
| MessageButtonClicked
|
1875
1890
|
| DropdownBoxSelected
|
1876
1891
|
| JoinPTTChannel
|
@@ -2227,6 +2242,23 @@ export class DefaultSocket implements Socket {
|
|
2227
2242
|
return response.webrtc_signaling_fwd;
|
2228
2243
|
}
|
2229
2244
|
|
2245
|
+
async makeCallPush(
|
2246
|
+
receiver_id: string,
|
2247
|
+
json_data: string,
|
2248
|
+
channel_id: string,
|
2249
|
+
caller_id: string
|
2250
|
+
): Promise<IncomingCallPush> {
|
2251
|
+
const response = await this.send({
|
2252
|
+
incoming_call_push: {
|
2253
|
+
receiver_id: receiver_id,
|
2254
|
+
json_data: json_data,
|
2255
|
+
channel_id: channel_id,
|
2256
|
+
caller_id: caller_id,
|
2257
|
+
},
|
2258
|
+
});
|
2259
|
+
return response.incoming_call_push;
|
2260
|
+
}
|
2261
|
+
|
2230
2262
|
async handleDropdownBoxSelected(
|
2231
2263
|
message_id: string,
|
2232
2264
|
channel_id: string,
|