mezon-js 2.15.19 → 2.15.21
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/README.md +244 -244
- package/dist/client.d.ts +119 -177
- package/dist/index.d.ts +1 -6
- package/dist/mezon-js.cjs.js +1 -1
- package/dist/mezon-js.esm.mjs +1 -1
- package/dist/mezon-js.iife.js +1 -1
- package/dist/mezon-js.umd.js +1 -1
- package/dist/mezon-js.umd.js.map +1 -1
- package/dist/transport.d.ts +513 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{api.gen.d.ts → types.d.ts} +1188 -426
- package/package.json +71 -71
- package/dist/api.d.ts +0 -2604
- package/dist/config.d.ts +0 -13
- package/dist/socket.d.ts +0 -1194
package/dist/client.d.ts
CHANGED
|
@@ -13,190 +13,112 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ApiAccount, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiListChannelBadgeCountResponse, ApiListUserOnlineResponse, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiClanUserStatusList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiCheckDuplicateNameRequest, ApiCheckDuplicateNameResponse, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiCreatePollRequest, ApiCreatePollResponse, ApiGetPollRequest, ApiGetPollResponse, ApiVotePollRequest, ApiVotePollResponse, ApiClosePollRequest, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiForSaleItemList, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon,
|
|
16
|
+
import { ApiAccount, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiListChannelBadgeCountResponse, ApiListUserOnlineResponse, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiClanUserStatusList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiCheckDuplicateNameRequest, ApiCheckDuplicateNameResponse, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiCreatePollRequest, ApiCreatePollResponse, ApiGetPollRequest, ApiGetPollResponse, ApiVotePollRequest, ApiVotePollResponse, ApiClosePollRequest, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiForSaleItemList, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApiBannedUserList, ApiIsBannedResponse, ChannelMessage, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiListChannelTimelineRequest, ApiListChannelTimelineResponse, ApiCreateChannelTimelineRequest, ApiCreateChannelTimelineResponse, ApiUpdateChannelTimelineRequest, ApiUpdateChannelTimelineResponse, ApiDetailChannelTimelineRequest, ApiDetailChannelTimelineResponse, ApiMutedChannelList, AddClanUserEvent, AddFriend, AiAgentEnabledEvent, AllowAnonymousEvent, ApiMessageReaction, ApiNotification, ApiWebhook, BannedUserEvent, BlockFriend, CategoryEvent, ChannelAppEvent, ChannelCanvas, ChannelCreatedEvent, ChannelDeletedEvent, ChannelPresenceEvent, ChannelUpdatedEvent, ClanDeletedEvent, ClanProfileUpdatedEvent, ClanUpdatedEvent, CustomStatusEvent, DeleteAccountEvent, EventEmoji, JoinChannelAppData, LastPinMessageEvent, LastSeenMessageEvent, ListActivity, ListChannelUsersBannedEvent, MarkAsRead, MeetParticipantEvent, MessageTypingEvent, PermissionChangedEvent, PermissionSet, QuickMenuEvent, RemoveFriend, RoleAssignedEvent, RoleEvent, SdTopicEvent, StatusPresenceEvent, StickerCreateEvent, StickerDeleteEvent, StickerUpdateEvent, StreamingEndedEvent, StreamingJoinedEvent, StreamingLeavedEvent, StreamingStartedEvent, TransferOwnershipEvent, UnblockFriend, UnmuteEvent, UnpinMessageEvent, UserChannelAddedEvent, UserChannelRemovedEvent, UserClanRemovedEvent, UserProfileUpdatedEvent, UserStatusEvent, VoiceEndedEvent, VoiceJoinedEvent, VoiceLeavedEvent, VoiceReactionSend, VoiceStartedEvent, WebrtcSignalingFwd, ChannelMessageList, Friends, ApiUpdateChannelDescRequest, ApiUpdateClanProfileRequest, ApiUpdateRoleRequest, ListDataSocket, IncomingCallPush, Channel, ClanJoin, Status } from "./types";
|
|
17
17
|
import { Session } from "./session";
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
CHANNEL_TYPE_STREAMING = 6,
|
|
26
|
-
CHANNEL_TYPE_THREAD = 7,
|
|
27
|
-
CHANNEL_TYPE_APP = 8,
|
|
28
|
-
CHANNEL_TYPE_ANNOUNCEMENT = 9,
|
|
29
|
-
CHANNEL_TYPE_MEZON_VOICE = 10
|
|
30
|
-
}
|
|
31
|
-
export declare enum ChannelStreamMode {
|
|
32
|
-
STREAM_MODE_CHANNEL = 2,
|
|
33
|
-
STREAM_MODE_GROUP = 3,
|
|
34
|
-
STREAM_MODE_DM = 4,
|
|
35
|
-
STREAM_MODE_CLAN = 5,
|
|
36
|
-
STREAM_MODE_THREAD = 6
|
|
37
|
-
}
|
|
38
|
-
export declare enum NotificationType {
|
|
39
|
-
ALL_MESSAGE = 1,
|
|
40
|
-
MENTION_MESSAGE = 2,
|
|
41
|
-
NOTHING_MESSAGE = 3
|
|
42
|
-
}
|
|
43
|
-
export declare enum WebrtcSignalingType {
|
|
44
|
-
WEBRTC_SDP_INIT = 0,
|
|
45
|
-
WEBRTC_SDP_OFFER = 1,
|
|
46
|
-
WEBRTC_SDP_ANSWER = 2,
|
|
47
|
-
WEBRTC_ICE_CANDIDATE = 3,
|
|
48
|
-
WEBRTC_SDP_QUIT = 4,
|
|
49
|
-
WEBRTC_SDP_TIMEOUT = 5,
|
|
50
|
-
WEBRTC_SDP_NOT_AVAILABLE = 6,
|
|
51
|
-
WEBRTC_SDP_JOINED_OTHER_CALL = 7,
|
|
52
|
-
WEBRTC_SDP_STATUS_REMOTE_MEDIA = 8
|
|
53
|
-
}
|
|
54
|
-
/** Response for an RPC function executed on the server. */
|
|
55
|
-
export interface RpcResponse {
|
|
56
|
-
/** The identifier of the function. */
|
|
57
|
-
id?: string;
|
|
58
|
-
/** The payload of the function which must be a JSON object. */
|
|
59
|
-
payload?: object;
|
|
60
|
-
}
|
|
61
|
-
/** A list of channel messages, usually a result of a list operation. */
|
|
62
|
-
export interface ChannelMessageList {
|
|
63
|
-
/** Cacheable cursor to list newer messages. Durable and designed to be stored, unlike next/prev cursors. */
|
|
64
|
-
cacheable_cursor?: string;
|
|
65
|
-
/**last seen message from user on channel */
|
|
66
|
-
last_seen_message?: ApiChannelMessageHeader;
|
|
67
|
-
/**last sent message from channel */
|
|
68
|
-
last_sent_message?: ApiChannelMessageHeader;
|
|
69
|
-
/** A list of messages. */
|
|
70
|
-
messages?: Array<ChannelMessage>;
|
|
71
|
-
/** The cursor to send when retireving the next page, if any. */
|
|
72
|
-
next_cursor?: string;
|
|
73
|
-
/** The cursor to send when retrieving the previous page, if any. */
|
|
74
|
-
prev_cursor?: string;
|
|
75
|
-
}
|
|
76
|
-
/** A collection of zero or more users. */
|
|
77
|
-
export interface Users {
|
|
78
|
-
/** The User objects. */
|
|
79
|
-
users?: Array<ApiUser>;
|
|
80
|
-
}
|
|
81
|
-
/** A collection of zero or more friends of the user. */
|
|
82
|
-
export interface Friends {
|
|
83
|
-
/** The Friend objects. */
|
|
84
|
-
friends?: Array<ApiFriend>;
|
|
85
|
-
/** Cursor for the next page of results, if any. */
|
|
86
|
-
cursor?: string;
|
|
87
|
-
}
|
|
88
|
-
/** A notification in the server. */
|
|
89
|
-
export interface Notification {
|
|
90
|
-
/** Category code for this notification. */
|
|
91
|
-
code?: number;
|
|
92
|
-
/** Content of the notification in JSON. */
|
|
93
|
-
content?: {};
|
|
94
|
-
/** The UNIX time when the notification was created. */
|
|
95
|
-
create_time_seconds?: number;
|
|
96
|
-
/** ID of the Notification. */
|
|
97
|
-
id?: string;
|
|
98
|
-
/** True if this notification was persisted to the database. */
|
|
99
|
-
persistent?: boolean;
|
|
100
|
-
/** ID of the sender, if a user. Otherwise 'null'. */
|
|
101
|
-
sender_id?: string;
|
|
102
|
-
/** Subject of the notification. */
|
|
103
|
-
subject?: string;
|
|
104
|
-
}
|
|
105
|
-
/** A collection of zero or more notifications. */
|
|
106
|
-
export interface NotificationList {
|
|
107
|
-
/** Use this cursor to paginate notifications. Cache this to catch up to new notifications. */
|
|
108
|
-
cacheable_cursor?: string;
|
|
109
|
-
/** Collection of notifications. */
|
|
110
|
-
notifications?: Array<Notification>;
|
|
111
|
-
}
|
|
112
|
-
/** Update fields in a given channel. */
|
|
113
|
-
export interface ApiUpdateChannelDescRequest {
|
|
114
|
-
/** The ID of the channel to update. */
|
|
115
|
-
channel_id: string;
|
|
116
|
-
/** The channel lable */
|
|
117
|
-
channel_label: string | undefined;
|
|
118
|
-
/** The category of channel */
|
|
119
|
-
category_id: string | undefined;
|
|
120
|
-
/** The app url of channel */
|
|
121
|
-
app_id: string | undefined;
|
|
122
|
-
e2ee?: number;
|
|
123
|
-
topic?: string;
|
|
124
|
-
age_restricted?: number;
|
|
125
|
-
channel_avatar?: string;
|
|
126
|
-
}
|
|
127
|
-
/** Add users to a channel. */
|
|
128
|
-
export interface ApiAddChannelUsersRequest {
|
|
129
|
-
/** The channel to add users to. */
|
|
130
|
-
channel_id: string;
|
|
131
|
-
/** The users to add. */
|
|
132
|
-
user_ids: string[];
|
|
133
|
-
}
|
|
134
|
-
/** Kick a set of users from a channel. */
|
|
135
|
-
export interface ApiKickChannelUsersRequest {
|
|
136
|
-
/** The channel ID to kick from. */
|
|
137
|
-
channel_id: string;
|
|
138
|
-
/** The users to kick. */
|
|
139
|
-
user_ids: string[];
|
|
140
|
-
}
|
|
141
|
-
/** Leave a channel. */
|
|
142
|
-
export interface ApiLeaveChannelRequest {
|
|
143
|
-
/** The channel ID to leave. */
|
|
144
|
-
channel_id: string;
|
|
145
|
-
}
|
|
146
|
-
/** Update Clan profile information */
|
|
147
|
-
export interface ApiUpdateClanDescProfileRequest {
|
|
148
|
-
/** Clan id */
|
|
149
|
-
clan_id: string;
|
|
150
|
-
/** Clan nick name */
|
|
151
|
-
nick_name: string;
|
|
152
|
-
/** Clan profile banner */
|
|
153
|
-
profile_banner: string;
|
|
154
|
-
/** Clan profile theme */
|
|
155
|
-
profile_theme: string;
|
|
156
|
-
/** Clan profile avatar */
|
|
157
|
-
avatar_url: string;
|
|
158
|
-
}
|
|
159
|
-
export interface ApiUpdateClanProfileRequest {
|
|
160
|
-
/** Clan id*/
|
|
161
|
-
clan_id: string;
|
|
162
|
-
/** Clan nick name */
|
|
163
|
-
nick_name: string;
|
|
164
|
-
/** Clan profile avatar */
|
|
165
|
-
avatar: string;
|
|
166
|
-
}
|
|
167
|
-
/** Update fields in a given role. */
|
|
168
|
-
export interface ApiUpdateRoleRequest {
|
|
169
|
-
/** The ID of the role to update. */
|
|
170
|
-
role_id: string;
|
|
171
|
-
/** The users to add. */
|
|
172
|
-
add_user_ids: string[];
|
|
173
|
-
/** The permissions to add. */
|
|
174
|
-
active_permission_ids: string[];
|
|
175
|
-
/** The users to remove. */
|
|
176
|
-
remove_user_ids: string[];
|
|
177
|
-
/** The permissions to remove. */
|
|
178
|
-
remove_permission_ids: string[];
|
|
179
|
-
clan_id: string;
|
|
180
|
-
max_permission_id: string;
|
|
181
|
-
title?: string | undefined;
|
|
182
|
-
color?: string | undefined;
|
|
183
|
-
role_icon?: string | undefined;
|
|
184
|
-
description?: string | undefined;
|
|
185
|
-
display_online?: number | undefined;
|
|
186
|
-
allow_mention?: number | undefined;
|
|
187
|
-
}
|
|
18
|
+
import { ChannelMessageAck, DropdownBoxSelected, MessageButtonClicked, MultipartUploadAttachment, MultipartUploadAttachmentFinishRequest, TransportAdapter } from "mezon-js-protobuf";
|
|
19
|
+
export declare const ConnectionState: {
|
|
20
|
+
readonly DISCONNECTED: "disconnected";
|
|
21
|
+
readonly CONNECTING: "connecting";
|
|
22
|
+
readonly CONNECTED: "connected";
|
|
23
|
+
};
|
|
24
|
+
export type ConnectionStateType = (typeof ConnectionState)[keyof typeof ConnectionState];
|
|
188
25
|
/** A client for Mezon server. */
|
|
189
26
|
export declare class Client {
|
|
190
27
|
readonly serverkey: string;
|
|
191
28
|
readonly timeout: number;
|
|
192
|
-
readonly
|
|
193
|
-
|
|
194
|
-
|
|
29
|
+
readonly autoFallbackHttp: boolean;
|
|
30
|
+
static readonly DefaultHeartbeatTimeoutMs = 10000;
|
|
31
|
+
static readonly DefaultConnectTimeoutMs = 30000;
|
|
32
|
+
verbose: boolean;
|
|
33
|
+
private _heartbeatTimeoutMs;
|
|
34
|
+
private _connectionState;
|
|
35
|
+
private _heartbeatTimer?;
|
|
36
|
+
private _connectTimeoutTimer?;
|
|
37
|
+
private _connectPromise?;
|
|
38
|
+
private readonly transport;
|
|
195
39
|
private readonly refreshTokenManager;
|
|
196
40
|
host: string;
|
|
197
41
|
port: string;
|
|
198
42
|
useSSL: boolean;
|
|
199
|
-
constructor(serverkey?: string, host?: string, port?: string, useSSL?: boolean, timeout?: number,
|
|
43
|
+
constructor(serverkey?: string, host?: string, port?: string, useSSL?: boolean, adapter?: any, timeout?: number, autoFallbackHttp?: boolean);
|
|
44
|
+
isOpen(): boolean;
|
|
45
|
+
setTransportAdapter(transportAdapter: TransportAdapter): void;
|
|
46
|
+
connect(session: Session, createStatus?: boolean, verbose?: boolean, connectTimeoutMs?: number): Promise<Session>;
|
|
47
|
+
private pingPong;
|
|
48
|
+
private startHeartbeatLoop;
|
|
49
|
+
private stopHeartbeatLoop;
|
|
50
|
+
private clearConnectTimeout;
|
|
51
|
+
onreconnect(evt: Event): void;
|
|
52
|
+
ondisconnect(evt: Event): void;
|
|
53
|
+
onerror(evt: Event): void;
|
|
54
|
+
onmessagetyping(messagetyping: MessageTypingEvent): void;
|
|
55
|
+
onmessagereaction(messagereaction: ApiMessageReaction): void;
|
|
56
|
+
onchannelmessage(channelMessage: ChannelMessage): void;
|
|
57
|
+
onchannelpresence(channelPresence: ChannelPresenceEvent): void;
|
|
58
|
+
onuserchanneladded(user: UserChannelAddedEvent): void;
|
|
59
|
+
onuserclanadded(user: AddClanUserEvent): void;
|
|
60
|
+
onuserprofileupdate(user: UserProfileUpdatedEvent): void;
|
|
61
|
+
onuserchannelremoved(user: UserChannelRemovedEvent): void;
|
|
62
|
+
onaddfriend(user: AddFriend): void;
|
|
63
|
+
onremovefriend(user: RemoveFriend): void;
|
|
64
|
+
onblockfriend(user: BlockFriend): void;
|
|
65
|
+
onunblockfriend(user: UnblockFriend): void;
|
|
66
|
+
onuserclanremoved(user: UserClanRemovedEvent): void;
|
|
67
|
+
onnotification(notification: ApiNotification): void;
|
|
68
|
+
onstatuspresence(statusPresence: StatusPresenceEvent): void;
|
|
69
|
+
onpinmessage(pin: LastPinMessageEvent): void;
|
|
70
|
+
onvoiceended(voice: VoiceEndedEvent): void;
|
|
71
|
+
onvoicestarted(voice: VoiceStartedEvent): void;
|
|
72
|
+
onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
|
|
73
|
+
onvoiceleaved(voiceParticipant: VoiceLeavedEvent): void;
|
|
74
|
+
onchannelcreated(channelCreated: ChannelCreatedEvent): void;
|
|
75
|
+
oncategoryevent(categoryEvent: CategoryEvent): void;
|
|
76
|
+
onroleevent(roleEvent: RoleEvent): void;
|
|
77
|
+
oneventemoji(eventEmoji: EventEmoji): void;
|
|
78
|
+
oneventnotiuserchannel(notiUserChannel: ApiNotificationUserChannel): void;
|
|
79
|
+
oneventwebhook(webhook_event: ApiWebhook): void;
|
|
80
|
+
onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
|
|
81
|
+
onclandeleted(clanDeleted: ClanDeletedEvent): void;
|
|
82
|
+
onstickercreated(stickerCreated: StickerCreateEvent): void;
|
|
83
|
+
onstickerdeleted(stickerDeleted: StickerDeleteEvent): void;
|
|
84
|
+
onstickerupdated(stickerUpdated: StickerUpdateEvent): void;
|
|
85
|
+
onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
|
|
86
|
+
ondeleteaccount(deleteAccountEvent: DeleteAccountEvent): void;
|
|
87
|
+
onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
|
|
88
|
+
onclanupdated(clan: ClanUpdatedEvent): void;
|
|
89
|
+
onlastseenupdated(event: LastSeenMessageEvent): void;
|
|
90
|
+
onheartbeattimeout(): void;
|
|
91
|
+
oncustomstatus(statusEvent: CustomStatusEvent): void;
|
|
92
|
+
oncanvasevent(canvasEvent: ChannelCanvas): void;
|
|
93
|
+
oneventcreated(clan_event_created: ApiCreateEventRequest): void;
|
|
94
|
+
oncoffeegiven(give_coffee_event: ApiGiveCoffeeEvent): void;
|
|
95
|
+
onroleassign(role_assign_event: RoleAssignedEvent): void;
|
|
96
|
+
onstreamingchannelstarted(streaming_started_event: StreamingStartedEvent): void;
|
|
97
|
+
onstreamingchannelended(streaming_ended_event: StreamingEndedEvent): void;
|
|
98
|
+
onstreamingchanneljoined(streaming_joined_event: StreamingJoinedEvent): void;
|
|
99
|
+
onstreamingchannelleaved(streaming_leaved_event: StreamingLeavedEvent): void;
|
|
100
|
+
onpermissionset(permission_set_event: PermissionSet): void;
|
|
101
|
+
onpermissionchanged(permission_changed_event: PermissionChangedEvent): void;
|
|
102
|
+
onunmuteevent(unmute_event: UnmuteEvent): void;
|
|
103
|
+
ontokensent(tokenSentEvent: ApiTokenSentEvent): void;
|
|
104
|
+
onmessagebuttonclicked(messageButtonClicked: MessageButtonClicked): void;
|
|
105
|
+
onmessagedropdownboxselected(msg: DropdownBoxSelected): void;
|
|
106
|
+
onmarkasread(event: MarkAsRead): void;
|
|
107
|
+
onvoicereactionmessage(event: VoiceReactionSend): void;
|
|
108
|
+
onwebrtcsignalingfwd(event: WebrtcSignalingFwd): void;
|
|
109
|
+
onactivityupdated(list_activity: ListActivity): void;
|
|
110
|
+
onsdtopicevent(sd_topic_event: SdTopicEvent): void;
|
|
111
|
+
onchannelappevent(event: ChannelAppEvent): void;
|
|
112
|
+
onuserstatusevent(user_status_event: UserStatusEvent): void;
|
|
113
|
+
onjoinchannelappevent(join_channel_app_data: JoinChannelAppData): void;
|
|
114
|
+
onunpinmessageevent(unpin_message_event: UnpinMessageEvent): void;
|
|
115
|
+
onquickmenuevent(event: QuickMenuEvent): void;
|
|
116
|
+
ontransferownership(event: TransferOwnershipEvent): void;
|
|
117
|
+
onbanneduser(event: BannedUserEvent): void;
|
|
118
|
+
onlistchannelusersbanned(event: ListChannelUsersBannedEvent): void;
|
|
119
|
+
onmeetparticipantevent(event: MeetParticipantEvent): void;
|
|
120
|
+
onallowanonymousevent(event: AllowAnonymousEvent): void;
|
|
121
|
+
onaiagentenabled(event: AiAgentEnabledEvent): void;
|
|
200
122
|
/**
|
|
201
123
|
* Called when a token refresh is initiated.
|
|
202
124
|
* This is a placeholder method that subclasses or instances can override
|
|
@@ -247,8 +169,6 @@ export declare class Client {
|
|
|
247
169
|
/** Update action role when delete role */
|
|
248
170
|
deleteRoleChannelDesc(session: Session, request: ApiDeleteRoleRequest): Promise<boolean>;
|
|
249
171
|
deleteApp(session: Session, appId: string): Promise<boolean>;
|
|
250
|
-
/** A socket created with the client's configuration. */
|
|
251
|
-
createSocket(useSSL: boolean | undefined, host: string, port: string, verbose?: boolean, adapter?: WebSocketAdapter, sendTimeoutMs?: number): Socket;
|
|
252
172
|
/** Delete one or more users by ID or username. */
|
|
253
173
|
deleteFriends(session: Session, ids?: Array<string>, usernames?: Array<string>): Promise<boolean>;
|
|
254
174
|
/** Delete a channel by ID. */
|
|
@@ -524,4 +444,26 @@ export declare class Client {
|
|
|
524
444
|
closePoll(session: Session, request: ApiClosePollRequest): Promise<any>;
|
|
525
445
|
/** Get poll details. */
|
|
526
446
|
getPoll(session: Session, request: ApiGetPollRequest): Promise<ApiGetPollResponse>;
|
|
447
|
+
followUsers(session: Session, userIds: string[]): Promise<Status>;
|
|
448
|
+
joinClanChat(session: Session, clan_id: string): Promise<ClanJoin>;
|
|
449
|
+
follower(session: Session): Promise<void>;
|
|
450
|
+
joinChat(session: Session, clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
|
451
|
+
leaveChat(session: Session, clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
|
|
452
|
+
removeChatMessage(session: Session, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
|
|
453
|
+
unfollowUsers(session: Session, user_ids: string[]): Promise<void>;
|
|
454
|
+
updateChatMessage(session: Session, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, is_update_msg_topic?: boolean): Promise<ChannelMessageAck>;
|
|
455
|
+
updateStatus(session: Session, status?: string): Promise<void>;
|
|
456
|
+
writeQuickMenuEvent(session: Session, menu_name: string, 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<QuickMenuEvent>;
|
|
457
|
+
writeEphemeralMessage(session: Session, receiver_ids: string[], 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, id?: string): Promise<ChannelMessageAck>;
|
|
458
|
+
writeChatMessage(session: Session, 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>;
|
|
459
|
+
writeMessageReaction(session: Session, 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, topic_id?: string, emoji_recent_id?: string, sender_name?: string): Promise<ApiMessageReaction>;
|
|
460
|
+
writeMessageTyping(session: Session, clan_id: string, channel_id: string, mode: number, is_public: boolean, sender_display_name: string, topic_id?: string): Promise<MessageTypingEvent>;
|
|
461
|
+
writeLastSeenMessage(session: Session, clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
|
|
462
|
+
writeLastPinMessage(session: Session, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number, message_sender_avatar: string, message_sender_id: string, message_sender_username: string, message_content: string, message_attachment: string, message_created_time: string): Promise<ApiGetPollResponse>;
|
|
463
|
+
writeCustomStatus(session: Session, clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
|
464
|
+
writeVoiceReaction(session: Session, emojis: Array<string>, channel_id: string): Promise<VoiceReactionSend>;
|
|
465
|
+
forwardWebrtcSignaling(session: Session, receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
|
466
|
+
makeCallPush(session: Session, receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
|
467
|
+
writeChannelAppEvent(session: Session, clan_id: string, channel_id: string, action: number): Promise<ChannelAppEvent>;
|
|
468
|
+
listDataSocket(session: Session, request: ListDataSocket): Promise<any>;
|
|
527
469
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,5 @@ import "whatwg-fetch";
|
|
|
17
17
|
export * from "./client";
|
|
18
18
|
export * from "./refresh_token_manager";
|
|
19
19
|
export * from "./session";
|
|
20
|
-
export * from "./socket";
|
|
21
20
|
export * from "./utils";
|
|
22
|
-
export * from "./
|
|
23
|
-
/**
|
|
24
|
-
* Reexported due to duplicate definition of ChannelMessage in [Client]{@link ./client.ts} and [Session]{@link ./session.ts}
|
|
25
|
-
*/
|
|
26
|
-
export type { ChannelMessage } from "./api";
|
|
21
|
+
export * from "./types";
|