mezon-js 2.10.40 → 2.10.41
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 +19 -0
- package/dist/mezon-js.esm.mjs +19 -0
- package/dist/socket.d.ts +12 -1
- package/package.json +1 -1
- package/socket.ts +43 -1
package/dist/mezon-js.cjs.js
CHANGED
@@ -7366,6 +7366,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7366
7366
|
this.onpttchannelleaved(message.ptt_leaved_event);
|
7367
7367
|
} else if (message.sd_topic_event) {
|
7368
7368
|
this.onsdtopicevent(message.sd_topic_event);
|
7369
|
+
} else if (message.channel_app_event) {
|
7370
|
+
this.onchannelappevent(message.channel_app_event);
|
7369
7371
|
} else {
|
7370
7372
|
if (this.verbose && window && window.console) {
|
7371
7373
|
console.log("Unrecognized message received: %o", message);
|
@@ -7688,6 +7690,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7688
7690
|
console.log(sd_topic_event);
|
7689
7691
|
}
|
7690
7692
|
}
|
7693
|
+
onchannelappevent(event) {
|
7694
|
+
if (this.verbose && window && window.console) {
|
7695
|
+
console.log(event);
|
7696
|
+
}
|
7697
|
+
}
|
7691
7698
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7692
7699
|
const untypedMessage = message;
|
7693
7700
|
return new Promise((resolve, reject) => {
|
@@ -8004,6 +8011,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
8004
8011
|
return response.webrtc_signaling_fwd;
|
8005
8012
|
});
|
8006
8013
|
}
|
8014
|
+
writeChannelAppEvent(clan_id, channel_id, action) {
|
8015
|
+
return __async(this, null, function* () {
|
8016
|
+
const response = yield this.send({
|
8017
|
+
channel_app_event: {
|
8018
|
+
clan_id,
|
8019
|
+
channel_id,
|
8020
|
+
action
|
8021
|
+
}
|
8022
|
+
});
|
8023
|
+
return response.channel_app_event;
|
8024
|
+
});
|
8025
|
+
}
|
8007
8026
|
pingPong() {
|
8008
8027
|
return __async(this, null, function* () {
|
8009
8028
|
if (!this.adapter.isOpen()) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7332,6 +7332,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7332
7332
|
this.onpttchannelleaved(message.ptt_leaved_event);
|
7333
7333
|
} else if (message.sd_topic_event) {
|
7334
7334
|
this.onsdtopicevent(message.sd_topic_event);
|
7335
|
+
} else if (message.channel_app_event) {
|
7336
|
+
this.onchannelappevent(message.channel_app_event);
|
7335
7337
|
} else {
|
7336
7338
|
if (this.verbose && window && window.console) {
|
7337
7339
|
console.log("Unrecognized message received: %o", message);
|
@@ -7654,6 +7656,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7654
7656
|
console.log(sd_topic_event);
|
7655
7657
|
}
|
7656
7658
|
}
|
7659
|
+
onchannelappevent(event) {
|
7660
|
+
if (this.verbose && window && window.console) {
|
7661
|
+
console.log(event);
|
7662
|
+
}
|
7663
|
+
}
|
7657
7664
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7658
7665
|
const untypedMessage = message;
|
7659
7666
|
return new Promise((resolve, reject) => {
|
@@ -7970,6 +7977,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7970
7977
|
return response.webrtc_signaling_fwd;
|
7971
7978
|
});
|
7972
7979
|
}
|
7980
|
+
writeChannelAppEvent(clan_id, channel_id, action) {
|
7981
|
+
return __async(this, null, function* () {
|
7982
|
+
const response = yield this.send({
|
7983
|
+
channel_app_event: {
|
7984
|
+
clan_id,
|
7985
|
+
channel_id,
|
7986
|
+
action
|
7987
|
+
}
|
7988
|
+
});
|
7989
|
+
return response.channel_app_event;
|
7990
|
+
});
|
7991
|
+
}
|
7973
7992
|
pingPong() {
|
7974
7993
|
return __async(this, null, function* () {
|
7975
7994
|
if (!this.adapter.isOpen()) {
|
package/dist/socket.d.ts
CHANGED
@@ -575,6 +575,13 @@ export interface StreamingEndedEvent {
|
|
575
575
|
/** channel id */
|
576
576
|
channel_id: string;
|
577
577
|
}
|
578
|
+
export interface ChannelAppEvent {
|
579
|
+
user_id: string;
|
580
|
+
username: string;
|
581
|
+
clan_id: string;
|
582
|
+
channel_id: string;
|
583
|
+
action: number;
|
584
|
+
}
|
578
585
|
export interface PermissionSet {
|
579
586
|
/** Role ID */
|
580
587
|
role_id: string;
|
@@ -730,6 +737,7 @@ export interface Socket {
|
|
730
737
|
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
731
738
|
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
732
739
|
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
740
|
+
writeChannelAppEvent: (clan_id: string, channel_id: string, action: number) => Promise<ChannelAppEvent>;
|
733
741
|
/** Handle disconnect events received from the socket. */
|
734
742
|
ondisconnect: (evt: Event) => void;
|
735
743
|
/** Handle error events received from the socket. */
|
@@ -806,6 +814,7 @@ export interface Socket {
|
|
806
814
|
onpttchanneljoined: (ptt_joined_event: PTTJoinedEvent) => void;
|
807
815
|
onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
|
808
816
|
onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
|
817
|
+
onchannelappevent: (event: ChannelAppEvent) => void;
|
809
818
|
}
|
810
819
|
/** Reports an error received from a socket message. */
|
811
820
|
export interface SocketError {
|
@@ -889,7 +898,8 @@ export declare class DefaultSocket implements Socket {
|
|
889
898
|
onjoinpttchannel(join_ptt_channel: JoinPTTChannel): void;
|
890
899
|
ontalkpttchannel(talk_ptt_channel: TalkPTTChannel): void;
|
891
900
|
onsdtopicevent(sd_topic_event: SdTopicEvent): void;
|
892
|
-
|
901
|
+
onchannelappevent(event: ChannelAppEvent): void;
|
902
|
+
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent, sendTimeout?: number): Promise<any>;
|
893
903
|
followUsers(userIds: string[]): Promise<Status>;
|
894
904
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
895
905
|
follower(): Promise<void>;
|
@@ -913,6 +923,7 @@ export declare class DefaultSocket implements Socket {
|
|
913
923
|
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
914
924
|
handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
|
915
925
|
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string): Promise<MessageButtonClicked>;
|
926
|
+
writeChannelAppEvent(clan_id: string, channel_id: string, action: number): Promise<ChannelAppEvent>;
|
916
927
|
private pingPong;
|
917
928
|
}
|
918
929
|
export {};
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -825,6 +825,14 @@ export interface StreamingEndedEvent {
|
|
825
825
|
channel_id: string;
|
826
826
|
}
|
827
827
|
|
828
|
+
export interface ChannelAppEvent {
|
829
|
+
user_id: string;
|
830
|
+
username: string;
|
831
|
+
clan_id: string;
|
832
|
+
channel_id: string;
|
833
|
+
action: number;
|
834
|
+
}
|
835
|
+
|
828
836
|
export interface PermissionSet {
|
829
837
|
/** Role ID */
|
830
838
|
role_id: string;
|
@@ -1151,6 +1159,12 @@ export interface Socket {
|
|
1151
1159
|
caller_id: string
|
1152
1160
|
) => Promise<IncomingCallPush>;
|
1153
1161
|
|
1162
|
+
writeChannelAppEvent: (
|
1163
|
+
clan_id: string,
|
1164
|
+
channel_id: string,
|
1165
|
+
action: number
|
1166
|
+
) => Promise<ChannelAppEvent>;
|
1167
|
+
|
1154
1168
|
/** Handle disconnect events received from the socket. */
|
1155
1169
|
ondisconnect: (evt: Event) => void;
|
1156
1170
|
|
@@ -1302,6 +1316,8 @@ export interface Socket {
|
|
1302
1316
|
onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
|
1303
1317
|
|
1304
1318
|
onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
|
1319
|
+
|
1320
|
+
onchannelappevent: (event: ChannelAppEvent) => void;
|
1305
1321
|
}
|
1306
1322
|
|
1307
1323
|
/** Reports an error received from a socket message. */
|
@@ -1577,6 +1593,8 @@ export class DefaultSocket implements Socket {
|
|
1577
1593
|
this.onpttchannelleaved(<PTTLeavedEvent>message.ptt_leaved_event);
|
1578
1594
|
} else if (message.sd_topic_event) {
|
1579
1595
|
this.onsdtopicevent(<SdTopicEvent>message.sd_topic_event);
|
1596
|
+
} else if (message.channel_app_event) {
|
1597
|
+
this.onchannelappevent(<ChannelAppEvent>message.channel_app_event);
|
1580
1598
|
} else {
|
1581
1599
|
if (this.verbose && window && window.console) {
|
1582
1600
|
console.log("Unrecognized message received: %o", message);
|
@@ -1955,11 +1973,19 @@ export class DefaultSocket implements Socket {
|
|
1955
1973
|
console.log(talk_ptt_channel);
|
1956
1974
|
}
|
1957
1975
|
}
|
1976
|
+
|
1958
1977
|
onsdtopicevent(sd_topic_event: SdTopicEvent) {
|
1959
1978
|
if (this.verbose && window && window.console) {
|
1960
1979
|
console.log(sd_topic_event);
|
1961
1980
|
}
|
1962
1981
|
}
|
1982
|
+
|
1983
|
+
onchannelappevent(event: ChannelAppEvent) {
|
1984
|
+
if (this.verbose && window && window.console) {
|
1985
|
+
console.log(event);
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
|
1963
1989
|
send(
|
1964
1990
|
message:
|
1965
1991
|
| ChannelJoin
|
@@ -1978,7 +2004,8 @@ export class DefaultSocket implements Socket {
|
|
1978
2004
|
| WebrtcSignalingFwd
|
1979
2005
|
| IncomingCallPush
|
1980
2006
|
| MessageButtonClicked
|
1981
|
-
| DropdownBoxSelected
|
2007
|
+
| DropdownBoxSelected
|
2008
|
+
| ChannelAppEvent,
|
1982
2009
|
sendTimeout = DefaultSocket.DefaultSendTimeoutMs
|
1983
2010
|
): Promise<any> {
|
1984
2011
|
const untypedMessage = message as any;
|
@@ -2408,6 +2435,21 @@ export class DefaultSocket implements Socket {
|
|
2408
2435
|
return response.webrtc_signaling_fwd;
|
2409
2436
|
}
|
2410
2437
|
|
2438
|
+
async writeChannelAppEvent(
|
2439
|
+
clan_id: string,
|
2440
|
+
channel_id: string,
|
2441
|
+
action: number
|
2442
|
+
): Promise<ChannelAppEvent> {
|
2443
|
+
const response = await this.send({
|
2444
|
+
channel_app_event: {
|
2445
|
+
clan_id: clan_id,
|
2446
|
+
channel_id: channel_id,
|
2447
|
+
action: action
|
2448
|
+
},
|
2449
|
+
});
|
2450
|
+
return response.channel_app_event;
|
2451
|
+
}
|
2452
|
+
|
2411
2453
|
private async pingPong(): Promise<void> {
|
2412
2454
|
if (!this.adapter.isOpen()) {
|
2413
2455
|
return;
|