mezon-sdk 2.7.39 → 2.7.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/cjs/api/api.d.ts +114 -402
- package/dist/cjs/api/api.js +7675 -3514
- package/dist/cjs/api/api.js.map +1 -1
- package/dist/cjs/client.d.ts +5 -3
- package/dist/cjs/client.js +46 -13
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/constants/enum.d.ts +33 -8
- package/dist/cjs/constants/enum.js +37 -10
- package/dist/cjs/constants/enum.js.map +1 -1
- package/dist/cjs/google/protobuf/struct.d.ts +3 -3
- package/dist/cjs/google/protobuf/struct.js +126 -61
- package/dist/cjs/google/protobuf/struct.js.map +1 -1
- package/dist/cjs/google/protobuf/timestamp.d.ts +1 -1
- package/dist/cjs/google/protobuf/timestamp.js +31 -27
- package/dist/cjs/google/protobuf/timestamp.js.map +1 -1
- package/dist/cjs/google/protobuf/wrappers.d.ts +1 -1
- package/dist/cjs/google/protobuf/wrappers.js +137 -91
- package/dist/cjs/google/protobuf/wrappers.js.map +1 -1
- package/dist/cjs/interfaces/api.d.ts +1 -0
- package/dist/cjs/interfaces/client.d.ts +34 -14
- package/dist/cjs/interfaces/client.js +6 -0
- package/dist/cjs/interfaces/client.js.map +1 -1
- package/dist/cjs/interfaces/index.d.ts +1 -0
- package/dist/cjs/interfaces/index.js +1 -0
- package/dist/cjs/interfaces/index.js.map +1 -1
- package/dist/cjs/interfaces/socket.d.ts +512 -0
- package/dist/cjs/interfaces/socket.js +3 -0
- package/dist/cjs/interfaces/socket.js.map +1 -0
- package/dist/cjs/message-socket-events/base_event.d.ts +8 -0
- package/dist/cjs/message-socket-events/base_event.js +15 -0
- package/dist/cjs/message-socket-events/base_event.js.map +1 -0
- package/dist/cjs/message-socket-events/index.d.ts +3 -0
- package/dist/cjs/message-socket-events/index.js +5 -0
- package/dist/cjs/message-socket-events/index.js.map +1 -0
- package/dist/cjs/message-socket-events/user_channel_added.d.ts +6 -0
- package/dist/cjs/message-socket-events/user_channel_added.js +25 -0
- package/dist/cjs/message-socket-events/user_channel_added.js.map +1 -0
- package/dist/cjs/rtapi/realtime.d.ts +369 -110
- package/dist/cjs/rtapi/realtime.js +3348 -1485
- package/dist/cjs/rtapi/realtime.js.map +1 -1
- package/dist/cjs/socket.d.ts +4 -553
- package/dist/cjs/socket.js +17 -244
- package/dist/cjs/socket.js.map +1 -1
- package/dist/cjs/utils/format_message_input.d.ts +3 -0
- package/dist/cjs/utils/format_message_input.js +57 -0
- package/dist/cjs/utils/format_message_input.js.map +1 -0
- package/dist/cjs/utils/generate_reply_message.d.ts +27 -0
- package/dist/cjs/utils/generate_reply_message.js +56 -0
- package/dist/cjs/utils/generate_reply_message.js.map +1 -0
- package/dist/cjs/utils/helper.d.ts +3 -0
- package/dist/cjs/utils/helper.js +21 -0
- package/dist/cjs/utils/helper.js.map +1 -0
- package/dist/esm/api/api.d.ts +114 -402
- package/dist/esm/api/api.js +7616 -3508
- package/dist/esm/api/api.js.map +1 -1
- package/dist/esm/client.d.ts +5 -3
- package/dist/esm/client.js +46 -13
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/constants/enum.d.ts +33 -8
- package/dist/esm/constants/enum.js +35 -8
- package/dist/esm/constants/enum.js.map +1 -1
- package/dist/esm/google/protobuf/struct.d.ts +3 -3
- package/dist/esm/google/protobuf/struct.js +125 -61
- package/dist/esm/google/protobuf/struct.js.map +1 -1
- package/dist/esm/google/protobuf/timestamp.d.ts +1 -1
- package/dist/esm/google/protobuf/timestamp.js +31 -27
- package/dist/esm/google/protobuf/timestamp.js.map +1 -1
- package/dist/esm/google/protobuf/wrappers.d.ts +1 -1
- package/dist/esm/google/protobuf/wrappers.js +137 -91
- package/dist/esm/google/protobuf/wrappers.js.map +1 -1
- package/dist/esm/interfaces/api.d.ts +1 -0
- package/dist/esm/interfaces/client.d.ts +34 -14
- package/dist/esm/interfaces/client.js +5 -1
- package/dist/esm/interfaces/client.js.map +1 -1
- package/dist/esm/interfaces/index.d.ts +1 -0
- package/dist/esm/interfaces/index.js +1 -0
- package/dist/esm/interfaces/index.js.map +1 -1
- package/dist/esm/interfaces/socket.d.ts +512 -0
- package/dist/esm/interfaces/socket.js +2 -0
- package/dist/esm/interfaces/socket.js.map +1 -0
- package/dist/esm/message-socket-events/base_event.d.ts +8 -0
- package/dist/esm/message-socket-events/base_event.js +12 -0
- package/dist/esm/message-socket-events/base_event.js.map +1 -0
- package/dist/esm/message-socket-events/index.d.ts +3 -0
- package/dist/esm/message-socket-events/index.js +3 -0
- package/dist/esm/message-socket-events/index.js.map +1 -0
- package/dist/esm/message-socket-events/user_channel_added.d.ts +6 -0
- package/dist/esm/message-socket-events/user_channel_added.js +18 -0
- package/dist/esm/message-socket-events/user_channel_added.js.map +1 -0
- package/dist/esm/rtapi/realtime.d.ts +369 -110
- package/dist/esm/rtapi/realtime.js +3325 -1488
- package/dist/esm/rtapi/realtime.js.map +1 -1
- package/dist/esm/socket.d.ts +4 -553
- package/dist/esm/socket.js +14 -244
- package/dist/esm/socket.js.map +1 -1
- package/dist/esm/utils/format_message_input.d.ts +3 -0
- package/dist/esm/utils/format_message_input.js +54 -0
- package/dist/esm/utils/format_message_input.js.map +1 -0
- package/dist/esm/utils/generate_reply_message.d.ts +27 -0
- package/dist/esm/utils/generate_reply_message.js +50 -0
- package/dist/esm/utils/generate_reply_message.js.map +1 -0
- package/dist/esm/utils/helper.d.ts +3 -0
- package/dist/esm/utils/helper.js +16 -0
- package/dist/esm/utils/helper.js.map +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { CloseEvent, ErrorEvent } from "ws";
|
|
3
|
+
import { ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef } from "./client";
|
|
4
|
+
import { Session } from "../session";
|
|
5
|
+
import { EventEmitter } from "stream";
|
|
6
|
+
/** An object which represents a connected user in the server. */
|
|
7
|
+
export interface Presence {
|
|
8
|
+
/** The id of the user. */
|
|
9
|
+
user_id: string;
|
|
10
|
+
/** The session id of the user. */
|
|
11
|
+
session_id: string;
|
|
12
|
+
/** The username of the user. */
|
|
13
|
+
username: string;
|
|
14
|
+
/** The node the user is connected to. */
|
|
15
|
+
node: string;
|
|
16
|
+
/** The status of the user */
|
|
17
|
+
status: string;
|
|
18
|
+
}
|
|
19
|
+
/** A response from a channel join operation. */
|
|
20
|
+
export interface Channel {
|
|
21
|
+
/** The server-assigned channel id. */
|
|
22
|
+
id: string;
|
|
23
|
+
chanel_label: string;
|
|
24
|
+
/** The presences visible on the chat channel. */
|
|
25
|
+
presences: Presence[];
|
|
26
|
+
/** The presence of the current user, i.e. yourself. */
|
|
27
|
+
self: Presence;
|
|
28
|
+
clan_logo: string;
|
|
29
|
+
category_name: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ClanJoin {
|
|
32
|
+
clan_join: {
|
|
33
|
+
clan_id: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Join a realtime chat channel. */
|
|
37
|
+
export interface ChannelJoin {
|
|
38
|
+
channel_join: {
|
|
39
|
+
/** The id of the channel to join. */
|
|
40
|
+
channel_id: string;
|
|
41
|
+
/** The name of the channel to join. */
|
|
42
|
+
channel_label: string;
|
|
43
|
+
/** The channel type: 1 = Channel, 2 = Direct Message, 3 = Group. */
|
|
44
|
+
type: number;
|
|
45
|
+
/** Whether channel messages are persisted in the database. */
|
|
46
|
+
persistence: boolean;
|
|
47
|
+
/** Whether the user's channel presence is hidden when joining. */
|
|
48
|
+
hidden: boolean;
|
|
49
|
+
is_public: boolean;
|
|
50
|
+
parent_id: string;
|
|
51
|
+
is_parent_public: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Leave a realtime chat channel. */
|
|
55
|
+
export interface ChannelLeave {
|
|
56
|
+
channel_leave: {
|
|
57
|
+
/** The id of the channel to leave. */
|
|
58
|
+
channel_id: string;
|
|
59
|
+
mode: number;
|
|
60
|
+
channel_label: string;
|
|
61
|
+
is_public: boolean;
|
|
62
|
+
parent_id: string;
|
|
63
|
+
is_parent_public: boolean;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** UserChannelAddedEvent */
|
|
67
|
+
export interface UserChannelAddedEvent {
|
|
68
|
+
channel_id: string;
|
|
69
|
+
users: AddUsers[];
|
|
70
|
+
status: string;
|
|
71
|
+
clan_id: string;
|
|
72
|
+
channel_type: number;
|
|
73
|
+
is_public: boolean;
|
|
74
|
+
parent_id: string;
|
|
75
|
+
is_parent_public: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface AddUsers {
|
|
78
|
+
user_id: string;
|
|
79
|
+
avatar: string;
|
|
80
|
+
username: string;
|
|
81
|
+
}
|
|
82
|
+
export interface UserChannelRemovedEvent {
|
|
83
|
+
channel_id: string;
|
|
84
|
+
user_ids: string[];
|
|
85
|
+
}
|
|
86
|
+
export interface UserClanRemovedEvent {
|
|
87
|
+
clan_id: string;
|
|
88
|
+
user_ids: string[];
|
|
89
|
+
}
|
|
90
|
+
/** Last seen message by user */
|
|
91
|
+
export interface LastPinMessageEvent {
|
|
92
|
+
/** The channel this message belongs to. */
|
|
93
|
+
channel_id: string;
|
|
94
|
+
mode: number;
|
|
95
|
+
channel_label: string;
|
|
96
|
+
/** The unique ID of this message. */
|
|
97
|
+
message_id: string;
|
|
98
|
+
/** user id */
|
|
99
|
+
user_id: string;
|
|
100
|
+
/** operation */
|
|
101
|
+
operation: number;
|
|
102
|
+
is_public: boolean;
|
|
103
|
+
parent_id?: string;
|
|
104
|
+
is_parent_public?: string;
|
|
105
|
+
}
|
|
106
|
+
/** Last seen message by user */
|
|
107
|
+
export interface LastSeenMessageEvent {
|
|
108
|
+
/** The channel this message belongs to. */
|
|
109
|
+
channel_id: string;
|
|
110
|
+
mode: number;
|
|
111
|
+
channel_label: string;
|
|
112
|
+
/** The unique ID of this message. */
|
|
113
|
+
message_id: string;
|
|
114
|
+
}
|
|
115
|
+
/** User is typing */
|
|
116
|
+
export interface MessageTypingEvent {
|
|
117
|
+
/** The channel this message belongs to. */
|
|
118
|
+
channel_id: string;
|
|
119
|
+
mode: number;
|
|
120
|
+
channel_label: string;
|
|
121
|
+
/** Message sender, usually a user ID. */
|
|
122
|
+
sender_id: string;
|
|
123
|
+
is_public: boolean;
|
|
124
|
+
parent_id?: string;
|
|
125
|
+
is_parent_public?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface UserProfileUpdatedEvent {
|
|
128
|
+
user_id: string;
|
|
129
|
+
display_name: string;
|
|
130
|
+
avatar: string;
|
|
131
|
+
about_me: string;
|
|
132
|
+
channel_id: string;
|
|
133
|
+
clan_id: string;
|
|
134
|
+
}
|
|
135
|
+
/** An acknowledgement received in response to sending a message on a chat channel. */
|
|
136
|
+
export interface ChannelMessageAck {
|
|
137
|
+
/** The server-assigned channel ID. */
|
|
138
|
+
channel_id: string;
|
|
139
|
+
mode: number;
|
|
140
|
+
/** A unique ID for the chat message. */
|
|
141
|
+
message_id: string;
|
|
142
|
+
/** A user-defined code for the chat message. */
|
|
143
|
+
code: number;
|
|
144
|
+
/** The username of the sender of the message. */
|
|
145
|
+
username: string;
|
|
146
|
+
/** The UNIX time when the message was created. */
|
|
147
|
+
create_time: string;
|
|
148
|
+
/** The UNIX time when the message was updated. */
|
|
149
|
+
update_time: string;
|
|
150
|
+
/** True if the chat message has been stored in history. */
|
|
151
|
+
persistence: boolean;
|
|
152
|
+
}
|
|
153
|
+
/** Send a message to a realtime chat channel. */
|
|
154
|
+
export interface ChannelMessageSend {
|
|
155
|
+
channel_message_send: {
|
|
156
|
+
/** Clan Id */
|
|
157
|
+
clan_id: string;
|
|
158
|
+
/** The server-assigned channel ID. */
|
|
159
|
+
channel_id: string;
|
|
160
|
+
mode: number;
|
|
161
|
+
channel_label: string;
|
|
162
|
+
/** The content payload. */
|
|
163
|
+
content: any;
|
|
164
|
+
mentions?: Array<ApiMessageMention>;
|
|
165
|
+
attachments?: Array<ApiMessageAttachment>;
|
|
166
|
+
anonymous_message?: boolean;
|
|
167
|
+
mention_everyone?: boolean;
|
|
168
|
+
avatar: string;
|
|
169
|
+
is_public: boolean;
|
|
170
|
+
parent_id?: string;
|
|
171
|
+
is_parent_public?: boolean;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** Update a message previously sent to a realtime chat channel. */
|
|
175
|
+
export interface ChannelMessageUpdate {
|
|
176
|
+
channel_message_update: {
|
|
177
|
+
/** The server-assigned channel ID. */
|
|
178
|
+
channel_id: string;
|
|
179
|
+
/** A unique ID for the chat message to be updated. */
|
|
180
|
+
message_id: string;
|
|
181
|
+
/** The content payload. */
|
|
182
|
+
content: any;
|
|
183
|
+
/** mentions */
|
|
184
|
+
mentions?: Array<ApiMessageMention>;
|
|
185
|
+
/** attachments */
|
|
186
|
+
attachments?: Array<ApiMessageAttachment>;
|
|
187
|
+
/** The mode payload. */
|
|
188
|
+
mode: number;
|
|
189
|
+
is_public: boolean;
|
|
190
|
+
parent_id?: string;
|
|
191
|
+
is_parent_public?: boolean;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** Remove a message previously sent to a realtime chat channel. */
|
|
195
|
+
export interface ChannelMessageRemove {
|
|
196
|
+
channel_message_remove: {
|
|
197
|
+
/** The server-assigned channel ID. */
|
|
198
|
+
channel_id: string;
|
|
199
|
+
mode: number;
|
|
200
|
+
channel_label: string;
|
|
201
|
+
/** A unique ID for the chat message to be removed. */
|
|
202
|
+
message_id: string;
|
|
203
|
+
is_public: boolean;
|
|
204
|
+
parent_id?: string;
|
|
205
|
+
is_parent_public?: boolean;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** Presence update for a particular realtime chat channel. */
|
|
209
|
+
export interface ChannelPresenceEvent {
|
|
210
|
+
/** The unique identifier of the chat channel. */
|
|
211
|
+
channel_id: string;
|
|
212
|
+
channel_label: string;
|
|
213
|
+
mode: number;
|
|
214
|
+
/** Presences of the users who joined the channel. */
|
|
215
|
+
joins: Presence[];
|
|
216
|
+
/** Presences of users who left the channel. */
|
|
217
|
+
leaves: Presence[];
|
|
218
|
+
}
|
|
219
|
+
export interface VoiceEndedEvent {
|
|
220
|
+
id: string;
|
|
221
|
+
clan_id: string;
|
|
222
|
+
voice_channel_id: string;
|
|
223
|
+
}
|
|
224
|
+
export interface VoiceStartedEvent {
|
|
225
|
+
id: string;
|
|
226
|
+
clan_id: string;
|
|
227
|
+
voice_channel_id: string;
|
|
228
|
+
}
|
|
229
|
+
export interface VoiceLeavedEvent {
|
|
230
|
+
id: string;
|
|
231
|
+
clan_id: string;
|
|
232
|
+
voice_channel_id: string;
|
|
233
|
+
voice_user_id: string;
|
|
234
|
+
}
|
|
235
|
+
export interface VoiceJoinedEvent {
|
|
236
|
+
/** The unique identifier of the chat channel. */
|
|
237
|
+
clan_id: string;
|
|
238
|
+
clan_name: string;
|
|
239
|
+
id: string;
|
|
240
|
+
participant: string;
|
|
241
|
+
user_id: string;
|
|
242
|
+
voice_channel_label: string;
|
|
243
|
+
voice_channel_id: string;
|
|
244
|
+
last_screenshot: string;
|
|
245
|
+
}
|
|
246
|
+
export interface CustomStatusEvent {
|
|
247
|
+
clan_id: string;
|
|
248
|
+
user_id: string;
|
|
249
|
+
username: string;
|
|
250
|
+
status: string;
|
|
251
|
+
}
|
|
252
|
+
export interface ChannelUpdatedEvent {
|
|
253
|
+
clan_id: string;
|
|
254
|
+
category_id: string;
|
|
255
|
+
creator_id: string;
|
|
256
|
+
parrent_id: string;
|
|
257
|
+
channel_id: string;
|
|
258
|
+
channel_label: string;
|
|
259
|
+
channel_type: number;
|
|
260
|
+
status: number;
|
|
261
|
+
}
|
|
262
|
+
export interface ChannelCreatedEvent {
|
|
263
|
+
clan_id: string;
|
|
264
|
+
category_id: string;
|
|
265
|
+
creator_id: string;
|
|
266
|
+
parrent_id: string;
|
|
267
|
+
channel_id: string;
|
|
268
|
+
channel_label: string;
|
|
269
|
+
channel_private: number;
|
|
270
|
+
channel_type: number;
|
|
271
|
+
status: number;
|
|
272
|
+
parent_id: string;
|
|
273
|
+
is_parent_public: boolean;
|
|
274
|
+
}
|
|
275
|
+
export interface ChannelDeletedEvent {
|
|
276
|
+
clan_id: string;
|
|
277
|
+
category_id: string;
|
|
278
|
+
channel_id: string;
|
|
279
|
+
deletor: string;
|
|
280
|
+
}
|
|
281
|
+
export interface ClanUpdatedEvent {
|
|
282
|
+
clan_id: string;
|
|
283
|
+
clan_name: string;
|
|
284
|
+
clan_logo: string;
|
|
285
|
+
}
|
|
286
|
+
export interface ClanProfileUpdatedEvent {
|
|
287
|
+
user_id: string;
|
|
288
|
+
clan_nick: string;
|
|
289
|
+
clan_avatar: string;
|
|
290
|
+
clan_id: string;
|
|
291
|
+
}
|
|
292
|
+
/** Stream identifier */
|
|
293
|
+
export interface StreamId {
|
|
294
|
+
/** The type of stream (e.g. chat). */
|
|
295
|
+
mode: number;
|
|
296
|
+
/** The primary stream subject, usually a user id. */
|
|
297
|
+
subject: string;
|
|
298
|
+
/** A secondary stream subject, for example for a direct chat. */
|
|
299
|
+
descriptor: string;
|
|
300
|
+
/** Meta-information (e.g. chat room name). */
|
|
301
|
+
label: string;
|
|
302
|
+
}
|
|
303
|
+
/** Stream data. */
|
|
304
|
+
export interface StreamData {
|
|
305
|
+
/** The stream identifier. */
|
|
306
|
+
stream: StreamId;
|
|
307
|
+
/** A reference to the user presence that sent this data, if any. */
|
|
308
|
+
sender?: Presence;
|
|
309
|
+
/** Arbitrary contents of the data message. */
|
|
310
|
+
data: string;
|
|
311
|
+
/** True if this data was delivered reliably. */
|
|
312
|
+
reliable?: boolean;
|
|
313
|
+
}
|
|
314
|
+
/** Presence updates. */
|
|
315
|
+
export interface StreamPresenceEvent {
|
|
316
|
+
/** The stream identifier. */
|
|
317
|
+
stream: StreamId;
|
|
318
|
+
/** Presences of users who joined the stream. */
|
|
319
|
+
joins: Presence[];
|
|
320
|
+
/** Presences of users who left the stream. */
|
|
321
|
+
leaves: Presence[];
|
|
322
|
+
}
|
|
323
|
+
/** Execute an Lua function on the server. */
|
|
324
|
+
export interface Rpc {
|
|
325
|
+
rpc: ApiRpc;
|
|
326
|
+
}
|
|
327
|
+
/** Execute an Lua function on the server. */
|
|
328
|
+
export interface ApiRpc {
|
|
329
|
+
http_key?: string;
|
|
330
|
+
id?: string;
|
|
331
|
+
payload?: string;
|
|
332
|
+
}
|
|
333
|
+
/** Application-level heartbeat ping. */
|
|
334
|
+
export interface Ping {
|
|
335
|
+
}
|
|
336
|
+
/** A snapshot of statuses for some set of users. */
|
|
337
|
+
export interface Status {
|
|
338
|
+
/** The user presences to view statuses of. */
|
|
339
|
+
presences: Presence[];
|
|
340
|
+
}
|
|
341
|
+
/** Start receiving status updates for some set of users. */
|
|
342
|
+
export interface StatusFollow {
|
|
343
|
+
/** The IDs of the users to follow. */
|
|
344
|
+
status_follow: {
|
|
345
|
+
user_ids: string[];
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/** A batch of status updates for a given user. */
|
|
349
|
+
export interface StatusPresenceEvent {
|
|
350
|
+
/** This join information is in response to a subscription made to be notified when a user comes online. */
|
|
351
|
+
joins: Presence[];
|
|
352
|
+
/** This join information is in response to a subscription made to be notified when a user goes offline. */
|
|
353
|
+
leaves: Presence[];
|
|
354
|
+
}
|
|
355
|
+
/** Stop receiving status updates for some set of users. */
|
|
356
|
+
export interface StatusUnfollow {
|
|
357
|
+
/** The IDs of user to unfollow. */
|
|
358
|
+
status_unfollow: {
|
|
359
|
+
user_ids: string[];
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/** Set the user's own status. */
|
|
363
|
+
export interface StatusUpdate {
|
|
364
|
+
/** Status string to set, if not present the user will appear offline. */
|
|
365
|
+
status_update: {
|
|
366
|
+
status?: string;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export interface ClanNameExistedEvent {
|
|
370
|
+
clan_name: string;
|
|
371
|
+
exist: boolean;
|
|
372
|
+
}
|
|
373
|
+
/** */
|
|
374
|
+
export interface StrickerListedEvent {
|
|
375
|
+
clan_id: string;
|
|
376
|
+
stickers?: Array<ClanSticker>;
|
|
377
|
+
}
|
|
378
|
+
/** */
|
|
379
|
+
export interface ClanSticker {
|
|
380
|
+
category?: string;
|
|
381
|
+
clan_id?: string;
|
|
382
|
+
create_time?: string;
|
|
383
|
+
creator_id?: string;
|
|
384
|
+
id?: string;
|
|
385
|
+
shortname?: string;
|
|
386
|
+
source?: string;
|
|
387
|
+
}
|
|
388
|
+
/** */
|
|
389
|
+
export interface EmojiListedEvent {
|
|
390
|
+
clan_id: string;
|
|
391
|
+
emoji_list?: Array<ClanEmoji>;
|
|
392
|
+
}
|
|
393
|
+
/** */
|
|
394
|
+
export interface ClanEmoji {
|
|
395
|
+
category?: string;
|
|
396
|
+
creator_id?: string;
|
|
397
|
+
id?: string;
|
|
398
|
+
shortname?: string;
|
|
399
|
+
src?: string;
|
|
400
|
+
}
|
|
401
|
+
/** */
|
|
402
|
+
export interface ChannelDescListEvent {
|
|
403
|
+
channeldesc?: Array<ChannelDescription>;
|
|
404
|
+
}
|
|
405
|
+
/** */
|
|
406
|
+
export interface ChannelDescription {
|
|
407
|
+
clan_id?: string;
|
|
408
|
+
channel_id?: string;
|
|
409
|
+
type?: number;
|
|
410
|
+
channel_label?: string;
|
|
411
|
+
channel_private?: number;
|
|
412
|
+
meeting_code?: string;
|
|
413
|
+
clan_name?: string;
|
|
414
|
+
parrent_id?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface HashtagDmListEvent {
|
|
417
|
+
user_id?: Array<string>;
|
|
418
|
+
limit?: number;
|
|
419
|
+
hashtag_dm?: Array<HashtagDm>;
|
|
420
|
+
}
|
|
421
|
+
export interface HashtagDm {
|
|
422
|
+
channel_id?: string;
|
|
423
|
+
channel_label?: string;
|
|
424
|
+
clan_id?: string;
|
|
425
|
+
clan_name?: string;
|
|
426
|
+
meeting_code?: string;
|
|
427
|
+
type?: number;
|
|
428
|
+
channel_private?: number;
|
|
429
|
+
parrent_id?: string;
|
|
430
|
+
}
|
|
431
|
+
export interface NotificationChannelSettingEvent {
|
|
432
|
+
channel_id?: string;
|
|
433
|
+
notification_user_channel?: NotificationUserChannel;
|
|
434
|
+
}
|
|
435
|
+
export interface NotificationUserChannel {
|
|
436
|
+
active?: number;
|
|
437
|
+
id?: string;
|
|
438
|
+
notification_setting_type?: number;
|
|
439
|
+
time_mute?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface NotificationCategorySettingEvent {
|
|
442
|
+
category_id?: string;
|
|
443
|
+
notification_user_channel?: NotificationUserChannel;
|
|
444
|
+
}
|
|
445
|
+
export interface NotificationClanSettingEvent {
|
|
446
|
+
clan_id?: string;
|
|
447
|
+
notification_setting?: NotificationSetting;
|
|
448
|
+
}
|
|
449
|
+
export interface NotificationSetting {
|
|
450
|
+
id?: string;
|
|
451
|
+
notification_setting_type?: number;
|
|
452
|
+
}
|
|
453
|
+
export interface NotifiReactMessageEvent {
|
|
454
|
+
channel_id?: string;
|
|
455
|
+
notifi_react_message?: NotifiReactMessage;
|
|
456
|
+
}
|
|
457
|
+
export interface NotifiReactMessage {
|
|
458
|
+
id?: string;
|
|
459
|
+
user_id?: string;
|
|
460
|
+
channel_id_req?: string;
|
|
461
|
+
}
|
|
462
|
+
export interface AddClanUserEvent {
|
|
463
|
+
clan_id: string;
|
|
464
|
+
user: AddUsers;
|
|
465
|
+
}
|
|
466
|
+
/** A socket connection to Mezon server. */
|
|
467
|
+
export interface Socket {
|
|
468
|
+
[key: string]: any;
|
|
469
|
+
socketEvents: EventEmitter;
|
|
470
|
+
/** Connection is Open */
|
|
471
|
+
isOpen(): boolean;
|
|
472
|
+
/** Connect to the server. */
|
|
473
|
+
connect(session: Session, createStatus: boolean): Promise<Session>;
|
|
474
|
+
/** Disconnect from the server. */
|
|
475
|
+
disconnect(fireDisconnectEvent: boolean): void;
|
|
476
|
+
/** Join clan chat */
|
|
477
|
+
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
|
478
|
+
/** Join a chat channel on the server. */
|
|
479
|
+
joinChat(clan_id: string, parent_id: string, channel_id: string, channel_type: number, is_public: boolean, is_parent_public: boolean): Promise<Channel>;
|
|
480
|
+
/** Leave a chat channel on the server. */
|
|
481
|
+
leaveChat(clan_id: string, parent_id: string, channel_id: string, channel_type: number, is_public: boolean, is_parent_public: boolean): Promise<void>;
|
|
482
|
+
/** Remove a chat message from a chat channel on the server. */
|
|
483
|
+
removeChatMessage(clan_id: string, parent_id: string, channel_id: string, mode: number, is_public: boolean, is_parent_public: boolean, message_id: string): Promise<ChannelMessageAck>;
|
|
484
|
+
/** Update a chat message on a chat channel in the server. */
|
|
485
|
+
updateChatMessage(clan_id: string, parent_id: string, channel_id: string, mode: number, is_public: boolean, is_parent_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean): Promise<ChannelMessageAck>;
|
|
486
|
+
/** Update the status for the current user online. */
|
|
487
|
+
updateStatus(status?: string): Promise<void>;
|
|
488
|
+
/** Send a chat message to a chat channel on the server. */
|
|
489
|
+
writeChatMessage(clan_id: string, parent_id: string, channel_id: string, mode: number, is_public: boolean, is_parent_public: boolean, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string): Promise<ChannelMessageAck>;
|
|
490
|
+
/** Send message typing */
|
|
491
|
+
writeMessageTyping(clan_id: string, parent_id: string, channel_id: string, mode: number, is_public: boolean, is_parent_public: boolean): Promise<MessageTypingEvent>;
|
|
492
|
+
/** Send message reaction */
|
|
493
|
+
writeMessageReaction(id: string, clan_id: string, parent_id: string, channel_id: string, mode: number, is_public: boolean, is_parent_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<ApiMessageReaction>;
|
|
494
|
+
/** Handle disconnect events received from the socket. */
|
|
495
|
+
ondisconnect: (evt: CloseEvent) => void;
|
|
496
|
+
/** Handle error events received from the socket. */
|
|
497
|
+
onerror: (evt: ErrorEvent) => void;
|
|
498
|
+
/**
|
|
499
|
+
* An application-level heartbeat timeout that fires after the client does not receive a pong from the server after the heartbeat interval.
|
|
500
|
+
* Most browsers maintain an internal heartbeat, in which case its unlikely you'll need to use this callback. However, Chrome does not implement an internal heartbeat.
|
|
501
|
+
* We fire this separately from `onclose` because heartbeats fail when there's no connectivity, and many browsers don't fire `onclose` until the closing handshake either succeeds or fails.
|
|
502
|
+
* In any case, be aware that `onclose` will still fire if there is a heartbeat timeout in a potentially delayed manner.
|
|
503
|
+
*/
|
|
504
|
+
onheartbeattimeout: () => void;
|
|
505
|
+
}
|
|
506
|
+
/** Reports an error received from a socket message. */
|
|
507
|
+
export interface SocketError {
|
|
508
|
+
/** The error code. */
|
|
509
|
+
code: number;
|
|
510
|
+
/** A message in English to help developers debug the response. */
|
|
511
|
+
message: string;
|
|
512
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../src/interfaces/socket.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base_event.js","sourceRoot":"","sources":["../../../src/message-socket-events/base_event.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,eAAe;IAKX;IAAtB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAE,CAAC;IAEvC,MAAM;QACF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/message-socket-events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InternalEventsSocket, } from "../constants";
|
|
2
|
+
import { BaseSocketEvent } from "./base_event";
|
|
3
|
+
export class UserChannelAdded extends BaseSocketEvent {
|
|
4
|
+
handleFunctions = [this.joinChannel];
|
|
5
|
+
event = InternalEventsSocket.UserChannelAddedEvent;
|
|
6
|
+
async joinChannel(input) {
|
|
7
|
+
console.log(input);
|
|
8
|
+
// await this.socket.joinChat(
|
|
9
|
+
// input.clan_id,
|
|
10
|
+
// input.parent_id,
|
|
11
|
+
// input.channel_id,
|
|
12
|
+
// input.channel_type,
|
|
13
|
+
// input.is_public,
|
|
14
|
+
// input.is_parent_public
|
|
15
|
+
// );
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=user_channel_added.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user_channel_added.js","sourceRoot":"","sources":["../../../src/message-socket-events/user_channel_added.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC5C,eAAe,GAAiC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnE,KAAK,GAAW,oBAAoB,CAAC,qBAAqB,CAAC;IAElE,KAAK,CAAC,WAAW,CAAC,KAAU;QAC1B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,8BAA8B;QAC9B,mBAAmB;QACnB,qBAAqB;QACrB,sBAAsB;QACtB,wBAAwB;QACxB,qBAAqB;QACrB,2BAA2B;QAC3B,KAAK;IACP,CAAC;CACF"}
|