mezon-js 2.10.14 → 2.10.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/api.gen.ts +2 -0
- package/client.ts +4 -1
- package/dist/api.gen.d.ts +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/mezon-js.cjs.js +7 -4
- package/dist/mezon-js.esm.mjs +7 -4
- package/dist/socket.d.ts +5 -4
- package/package.json +1 -1
- package/socket.ts +13 -5
package/api.gen.ts
CHANGED
package/client.ts
CHANGED
@@ -197,10 +197,11 @@ export enum NotificationType {
|
|
197
197
|
}
|
198
198
|
|
199
199
|
export enum WebrtcSignalingType {
|
200
|
+
WEBRTC_SDP_INIT = 0,
|
200
201
|
WEBRTC_SDP_OFFER = 1,
|
201
202
|
WEBRTC_SDP_ANSWER = 2,
|
202
203
|
WEBRTC_ICE_CANDIDATE = 3,
|
203
|
-
WEBRTC_SDP_QUIT = 4
|
204
|
+
WEBRTC_SDP_QUIT = 4
|
204
205
|
}
|
205
206
|
|
206
207
|
/** Response for an RPC function executed on the server. */
|
@@ -269,6 +270,8 @@ export interface ChannelMessage {
|
|
269
270
|
hide_editted?: boolean;
|
270
271
|
//
|
271
272
|
is_public?: boolean;
|
273
|
+
//
|
274
|
+
topic_id?: string;
|
272
275
|
}
|
273
276
|
|
274
277
|
/** A list of channel messages, usually a result of a list operation. */
|
package/dist/api.gen.d.ts
CHANGED
package/dist/client.d.ts
CHANGED
@@ -41,6 +41,7 @@ export declare enum NotificationType {
|
|
41
41
|
NOTHING_MESSAGE = 3
|
42
42
|
}
|
43
43
|
export declare enum WebrtcSignalingType {
|
44
|
+
WEBRTC_SDP_INIT = 0,
|
44
45
|
WEBRTC_SDP_OFFER = 1,
|
45
46
|
WEBRTC_SDP_ANSWER = 2,
|
46
47
|
WEBRTC_ICE_CANDIDATE = 3,
|
@@ -83,6 +84,7 @@ export interface ChannelMessage {
|
|
83
84
|
message_id?: string;
|
84
85
|
hide_editted?: boolean;
|
85
86
|
is_public?: boolean;
|
87
|
+
topic_id?: string;
|
86
88
|
}
|
87
89
|
/** A list of channel messages, usually a result of a list operation. */
|
88
90
|
export interface ChannelMessageList {
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -7765,7 +7765,7 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7765
7765
|
updateStatus(status) {
|
7766
7766
|
return this.send({ status_update: { status } });
|
7767
7767
|
}
|
7768
|
-
writeChatMessage(clan_id, channel_id, mode, is_public, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar, code) {
|
7768
|
+
writeChatMessage(clan_id, channel_id, mode, is_public, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar, code, topic_id) {
|
7769
7769
|
return __async(this, null, function* () {
|
7770
7770
|
const response = yield this.send({
|
7771
7771
|
channel_message_send: {
|
@@ -7780,7 +7780,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7780
7780
|
anonymous_message,
|
7781
7781
|
mention_everyone,
|
7782
7782
|
avatar,
|
7783
|
-
code
|
7783
|
+
code,
|
7784
|
+
topic_id
|
7784
7785
|
}
|
7785
7786
|
});
|
7786
7787
|
return response.channel_message_ack;
|
@@ -7969,11 +7970,12 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7969
7970
|
return response.join_ptt_channel;
|
7970
7971
|
});
|
7971
7972
|
}
|
7972
|
-
talkPTTChannel(channelId) {
|
7973
|
+
talkPTTChannel(channelId, isTalk) {
|
7973
7974
|
return __async(this, null, function* () {
|
7974
7975
|
const response = yield this.send({
|
7975
7976
|
talk_ptt_channel: {
|
7976
|
-
channel_id: channelId
|
7977
|
+
channel_id: channelId,
|
7978
|
+
isTalk
|
7977
7979
|
}
|
7978
7980
|
});
|
7979
7981
|
return response.talk_ptt_channel;
|
@@ -8038,6 +8040,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
8038
8040
|
return NotificationType2;
|
8039
8041
|
})(NotificationType || {});
|
8040
8042
|
var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
|
8043
|
+
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_INIT"] = 0] = "WEBRTC_SDP_INIT";
|
8041
8044
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_OFFER"] = 1] = "WEBRTC_SDP_OFFER";
|
8042
8045
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_ANSWER"] = 2] = "WEBRTC_SDP_ANSWER";
|
8043
8046
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_ICE_CANDIDATE"] = 3] = "WEBRTC_ICE_CANDIDATE";
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7731,7 +7731,7 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7731
7731
|
updateStatus(status) {
|
7732
7732
|
return this.send({ status_update: { status } });
|
7733
7733
|
}
|
7734
|
-
writeChatMessage(clan_id, channel_id, mode, is_public, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar, code) {
|
7734
|
+
writeChatMessage(clan_id, channel_id, mode, is_public, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar, code, topic_id) {
|
7735
7735
|
return __async(this, null, function* () {
|
7736
7736
|
const response = yield this.send({
|
7737
7737
|
channel_message_send: {
|
@@ -7746,7 +7746,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7746
7746
|
anonymous_message,
|
7747
7747
|
mention_everyone,
|
7748
7748
|
avatar,
|
7749
|
-
code
|
7749
|
+
code,
|
7750
|
+
topic_id
|
7750
7751
|
}
|
7751
7752
|
});
|
7752
7753
|
return response.channel_message_ack;
|
@@ -7935,11 +7936,12 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7935
7936
|
return response.join_ptt_channel;
|
7936
7937
|
});
|
7937
7938
|
}
|
7938
|
-
talkPTTChannel(channelId) {
|
7939
|
+
talkPTTChannel(channelId, isTalk) {
|
7939
7940
|
return __async(this, null, function* () {
|
7940
7941
|
const response = yield this.send({
|
7941
7942
|
talk_ptt_channel: {
|
7942
|
-
channel_id: channelId
|
7943
|
+
channel_id: channelId,
|
7944
|
+
isTalk
|
7943
7945
|
}
|
7944
7946
|
});
|
7945
7947
|
return response.talk_ptt_channel;
|
@@ -8004,6 +8006,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
8004
8006
|
return NotificationType2;
|
8005
8007
|
})(NotificationType || {});
|
8006
8008
|
var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
|
8009
|
+
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_INIT"] = 0] = "WEBRTC_SDP_INIT";
|
8007
8010
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_OFFER"] = 1] = "WEBRTC_SDP_OFFER";
|
8008
8011
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_ANSWER"] = 2] = "WEBRTC_SDP_ANSWER";
|
8009
8012
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_ICE_CANDIDATE"] = 3] = "WEBRTC_ICE_CANDIDATE";
|
package/dist/socket.d.ts
CHANGED
@@ -198,6 +198,7 @@ interface ChannelMessageSend {
|
|
198
198
|
avatar: string;
|
199
199
|
is_public: boolean;
|
200
200
|
code: number;
|
201
|
+
topic_id?: string;
|
201
202
|
};
|
202
203
|
}
|
203
204
|
/** Update a message previously sent to a realtime chat channel. */
|
@@ -693,7 +694,7 @@ export interface Socket {
|
|
693
694
|
/** Update the status for the current user online. */
|
694
695
|
updateStatus(status?: string): Promise<void>;
|
695
696
|
/** Send a chat message to a chat channel on the server. */
|
696
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number): Promise<ChannelMessageAck>;
|
697
|
+
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
|
697
698
|
/** Send message typing */
|
698
699
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean): Promise<MessageTypingEvent>;
|
699
700
|
/** Send message reaction */
|
@@ -709,7 +710,7 @@ export interface Socket {
|
|
709
710
|
/** send voice leaved */
|
710
711
|
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
711
712
|
joinPTTChannel(clanId: string, channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
712
|
-
talkPTTChannel(channelId: string): Promise<TalkPTTChannel>;
|
713
|
+
talkPTTChannel(channelId: string, isTalk: boolean): Promise<TalkPTTChannel>;
|
713
714
|
setHeartbeatTimeoutMs(ms: number): void;
|
714
715
|
getHeartbeatTimeoutMs(): number;
|
715
716
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
@@ -886,7 +887,7 @@ export declare class DefaultSocket implements Socket {
|
|
886
887
|
unfollowUsers(user_ids: string[]): Promise<void>;
|
887
888
|
updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean): Promise<ChannelMessageAck>;
|
888
889
|
updateStatus(status?: string): Promise<void>;
|
889
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string, code?: number): Promise<ChannelMessageAck>;
|
890
|
+
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
|
890
891
|
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<ApiMessageReaction>;
|
891
892
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean): Promise<MessageTypingEvent>;
|
892
893
|
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
|
@@ -900,7 +901,7 @@ export declare class DefaultSocket implements Socket {
|
|
900
901
|
handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
|
901
902
|
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string): Promise<MessageButtonClicked>;
|
902
903
|
joinPTTChannel(clanId: string, channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
|
903
|
-
talkPTTChannel(channelId: string): Promise<TalkPTTChannel>;
|
904
|
+
talkPTTChannel(channelId: string, isTalk: boolean): Promise<TalkPTTChannel>;
|
904
905
|
private pingPong;
|
905
906
|
}
|
906
907
|
export {};
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -287,6 +287,8 @@ interface ChannelMessageSend {
|
|
287
287
|
is_public: boolean;
|
288
288
|
// code
|
289
289
|
code: number;
|
290
|
+
//
|
291
|
+
topic_id?: string;
|
290
292
|
};
|
291
293
|
}
|
292
294
|
|
@@ -1010,7 +1012,8 @@ export interface Socket {
|
|
1010
1012
|
anonymous_message?: boolean,
|
1011
1013
|
mention_everyone?: boolean,
|
1012
1014
|
avatar?: string,
|
1013
|
-
code?: number
|
1015
|
+
code?: number,
|
1016
|
+
topic_id?: string,
|
1014
1017
|
): Promise<ChannelMessageAck>;
|
1015
1018
|
|
1016
1019
|
/** Send message typing */
|
@@ -1089,7 +1092,8 @@ export interface Socket {
|
|
1089
1092
|
): Promise<JoinPTTChannel>;
|
1090
1093
|
|
1091
1094
|
talkPTTChannel(
|
1092
|
-
channelId: string
|
1095
|
+
channelId: string,
|
1096
|
+
isTalk: boolean
|
1093
1097
|
): Promise<TalkPTTChannel>;
|
1094
1098
|
|
1095
1099
|
/* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
@@ -2125,7 +2129,8 @@ export class DefaultSocket implements Socket {
|
|
2125
2129
|
anonymous_message?: boolean,
|
2126
2130
|
mention_everyone?: Boolean,
|
2127
2131
|
avatar?: string,
|
2128
|
-
code?: number
|
2132
|
+
code?: number,
|
2133
|
+
topic_id?: string,
|
2129
2134
|
): Promise<ChannelMessageAck> {
|
2130
2135
|
const response = await this.send({
|
2131
2136
|
channel_message_send: {
|
@@ -2141,6 +2146,7 @@ export class DefaultSocket implements Socket {
|
|
2141
2146
|
mention_everyone: mention_everyone,
|
2142
2147
|
avatar: avatar,
|
2143
2148
|
code: code,
|
2149
|
+
topic_id: topic_id,
|
2144
2150
|
},
|
2145
2151
|
});
|
2146
2152
|
return response.channel_message_ack;
|
@@ -2398,11 +2404,13 @@ export class DefaultSocket implements Socket {
|
|
2398
2404
|
}
|
2399
2405
|
|
2400
2406
|
async talkPTTChannel(
|
2401
|
-
channelId: string
|
2407
|
+
channelId: string,
|
2408
|
+
isTalk: boolean
|
2402
2409
|
): Promise<TalkPTTChannel> {
|
2403
2410
|
const response = await this.send({
|
2404
2411
|
talk_ptt_channel: {
|
2405
|
-
channel_id: channelId
|
2412
|
+
channel_id: channelId,
|
2413
|
+
isTalk
|
2406
2414
|
},
|
2407
2415
|
});
|
2408
2416
|
return response.talk_ptt_channel;
|