ncloudchat 1.0.33 → 1.0.36
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 +17 -409
- package/{deploy.sh → deploy.sh.bak} +0 -0
- package/dist/ncloudchat.d.ts +1298 -0
- package/dist/ncloudchat.min.js +1 -0
- package/esm/CloudChat.js +72 -62
- package/esm/CloudChat.js.map +1 -1
- package/esm/CoreManager.js +3 -1
- package/esm/CoreManager.js.map +1 -1
- package/esm/Dispatcher.js +3 -1
- package/esm/Dispatcher.js.map +1 -1
- package/esm/Network.js +14 -7
- package/esm/Network.js.map +1 -1
- package/esm/Type.js +7 -4
- package/esm/Type.js.map +1 -1
- package/esm/Util.js +4 -1
- package/esm/Util.js.map +1 -1
- package/esm/graphql/channel.js +10 -7
- package/esm/graphql/channel.js.map +1 -1
- package/esm/graphql/friend.js +8 -5
- package/esm/graphql/friend.js.map +1 -1
- package/esm/graphql/invite.js +4 -1
- package/esm/graphql/invite.js.map +1 -1
- package/esm/graphql/member.js +8 -5
- package/esm/graphql/member.js.map +1 -1
- package/esm/graphql/message.js +8 -5
- package/esm/graphql/message.js.map +1 -1
- package/esm/graphql/pin.js +7 -4
- package/esm/graphql/pin.js.map +1 -1
- package/esm/graphql/subscription.js +8 -5
- package/esm/graphql/subscription.js.map +1 -1
- package/esm/index.js +8 -2
- package/esm/index.js.map +1 -1
- package/esm/logger.js +6 -1
- package/esm/logger.js.map +1 -1
- package/esm/mutations/channel.js +29 -18
- package/esm/mutations/channel.js.map +1 -1
- package/esm/mutations/friend.js +25 -15
- package/esm/mutations/friend.js.map +1 -1
- package/esm/mutations/index.js +23 -7
- package/esm/mutations/index.js.map +1 -1
- package/esm/mutations/invite.js +13 -6
- package/esm/mutations/invite.js.map +1 -1
- package/esm/mutations/member.js +22 -13
- package/esm/mutations/member.js.map +1 -1
- package/esm/mutations/message.js +24 -15
- package/esm/mutations/message.js.map +1 -1
- package/esm/mutations/pin.js +17 -9
- package/esm/mutations/pin.js.map +1 -1
- package/esm/mutations/subscription.js +21 -12
- package/esm/mutations/subscription.js.map +1 -1
- package/esm/queries/channel.js +17 -9
- package/esm/queries/channel.js.map +1 -1
- package/esm/queries/friend.js +13 -6
- package/esm/queries/friend.js.map +1 -1
- package/esm/queries/index.js +24 -8
- package/esm/queries/index.js.map +1 -1
- package/esm/queries/member.js +13 -6
- package/esm/queries/member.js.map +1 -1
- package/esm/queries/memberblocks.js +13 -6
- package/esm/queries/memberblocks.js.map +1 -1
- package/esm/queries/message.js +21 -12
- package/esm/queries/message.js.map +1 -1
- package/esm/queries/pin.js +17 -9
- package/esm/queries/pin.js.map +1 -1
- package/esm/queries/project.js +2 -1
- package/esm/queries/project.js.map +1 -1
- package/esm/queries/subscription.js +17 -9
- package/esm/queries/subscription.js.map +1 -1
- package/package.json +2 -4
- package/tsconfig.json +1 -1
- package/lib/CloudChat.js +0 -2661
- package/lib/CoreManager.js +0 -45
- package/lib/Dispatcher.js +0 -125
- package/lib/Network.js +0 -229
- package/lib/Type.js +0 -44
- package/lib/Util.js +0 -32
- package/lib/graphql/channel.js +0 -32
- package/lib/graphql/friend.js +0 -27
- package/lib/graphql/invite.js +0 -18
- package/lib/graphql/member.js +0 -27
- package/lib/graphql/message.js +0 -27
- package/lib/graphql/pin.js +0 -25
- package/lib/graphql/project.js +0 -7
- package/lib/graphql/subscription.js +0 -27
- package/lib/index.js +0 -18
- package/lib/logger.js +0 -33
- package/lib/mutations/channel.js +0 -354
- package/lib/mutations/friend.js +0 -299
- package/lib/mutations/index.js +0 -109
- package/lib/mutations/invite.js +0 -205
- package/lib/mutations/member.js +0 -304
- package/lib/mutations/message.js +0 -300
- package/lib/mutations/pin.js +0 -229
- package/lib/mutations/subscription.js +0 -281
- package/lib/queries/channel.js +0 -239
- package/lib/queries/friend.js +0 -207
- package/lib/queries/index.js +0 -123
- package/lib/queries/member.js +0 -207
- package/lib/queries/memberblocks.js +0 -207
- package/lib/queries/message.js +0 -273
- package/lib/queries/pin.js +0 -243
- package/lib/queries/project.js +0 -7
- package/lib/queries/subscription.js +0 -241
- package/ncloudchat_javascript.md +0 -289
- package//353/260/260/355/217/254/354/210/234/354/204/234.md +0 -8
|
@@ -0,0 +1,1298 @@
|
|
|
1
|
+
declare module 'ncloudchat/CloudChat' {
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChannelInput, MarkInput, PinInput } from "ncloudchat/Type";
|
|
9
|
+
/**
|
|
10
|
+
* Class NCloudChat holds all the NCloudChat functionalities.
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
*/
|
|
14
|
+
export default class NCloudChat {
|
|
15
|
+
private dp;
|
|
16
|
+
private socket;
|
|
17
|
+
private connected;
|
|
18
|
+
private connectedCount;
|
|
19
|
+
/**
|
|
20
|
+
* Create a `NCloudChat` instance and a Dispatcher.
|
|
21
|
+
*
|
|
22
|
+
* @constructs
|
|
23
|
+
*/
|
|
24
|
+
constructor(debug?: boolean);
|
|
25
|
+
clear(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Initialize a new `NCloudChat` instance of project and user.
|
|
28
|
+
*
|
|
29
|
+
* @function initialize
|
|
30
|
+
* @param {string} projectId - The id of a project.
|
|
31
|
+
*/
|
|
32
|
+
initialize(projectId: string): void;
|
|
33
|
+
getLang(): any;
|
|
34
|
+
setLang(lang: string): void;
|
|
35
|
+
getUser(): any;
|
|
36
|
+
getProjectId(): any;
|
|
37
|
+
setServerUrl(url: string): void;
|
|
38
|
+
setSocketUrl(url: string): void;
|
|
39
|
+
setProjectId(projectId: string): void;
|
|
40
|
+
setToken(token: string): void;
|
|
41
|
+
setUser(user: any): void;
|
|
42
|
+
private inputValidation;
|
|
43
|
+
/**
|
|
44
|
+
* Create a connection between a socket and a client.
|
|
45
|
+
*
|
|
46
|
+
* @async connect
|
|
47
|
+
* @param {any} user
|
|
48
|
+
* @param {string} userToken
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
connect(user: any, userToken?: string): Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Mute channel notifications.
|
|
54
|
+
*
|
|
55
|
+
* @async
|
|
56
|
+
* @function mute
|
|
57
|
+
* @param {string} channel
|
|
58
|
+
* @returns {Promise<any>}
|
|
59
|
+
*/
|
|
60
|
+
mute(channel: string): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Unmute channel notifications.
|
|
63
|
+
*
|
|
64
|
+
* @async
|
|
65
|
+
* @function unmute
|
|
66
|
+
* @param {string} channel
|
|
67
|
+
* @returns {Promise<any>}
|
|
68
|
+
*/
|
|
69
|
+
unmute(channel: string): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Subscribe a channel.
|
|
72
|
+
*
|
|
73
|
+
* @async
|
|
74
|
+
* @function subscibe
|
|
75
|
+
* @param {string} channel - The id of a channel.
|
|
76
|
+
* @param {any} option
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
subscribe(channel: string, option?: any): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Unsubscribe from a channel.
|
|
82
|
+
*
|
|
83
|
+
* @async
|
|
84
|
+
* @function unsubscribe
|
|
85
|
+
* @param {string} channel - The id of a chennel
|
|
86
|
+
* @returns {Promise<any>}
|
|
87
|
+
*/
|
|
88
|
+
unsubscribe(channel: string): Promise<any>;
|
|
89
|
+
/**
|
|
90
|
+
* Translate a message from a souce language to a target language.
|
|
91
|
+
*
|
|
92
|
+
* @async
|
|
93
|
+
* @function translateMessage
|
|
94
|
+
* @param {string} channelId - The id of a channel.
|
|
95
|
+
* @param {string} source - A source language.
|
|
96
|
+
* @param {string} target - A target language.
|
|
97
|
+
* @param {string} message - An message to be translated.
|
|
98
|
+
* @returns {Promise<any>}
|
|
99
|
+
*/
|
|
100
|
+
translateMessage(channelId: string, source: string, target: string, message: string): Promise<any>;
|
|
101
|
+
/**
|
|
102
|
+
* Send a message to a channel.
|
|
103
|
+
*
|
|
104
|
+
* @async
|
|
105
|
+
* @function sendMessage
|
|
106
|
+
* @param {string} channel - The id of a channel.
|
|
107
|
+
* @param {any} opt
|
|
108
|
+
* @returns {Promise<any>}
|
|
109
|
+
*/
|
|
110
|
+
sendMessage(channel: string, opt: any): Promise<any>;
|
|
111
|
+
/**
|
|
112
|
+
* Send an express message to a channel.
|
|
113
|
+
*
|
|
114
|
+
* @async
|
|
115
|
+
* @function sendExpressMessage
|
|
116
|
+
* @param {string} channel - The id of a channel.
|
|
117
|
+
* @param {any} opt
|
|
118
|
+
* @returns {Promise<any>}
|
|
119
|
+
*/
|
|
120
|
+
sendExpressMessage(channel: string, opt: any): Promise<any>;
|
|
121
|
+
/**
|
|
122
|
+
* Send an image to a channel. Only supports png, jpg, jpeg file types.
|
|
123
|
+
*
|
|
124
|
+
* @async
|
|
125
|
+
* @function sendImage
|
|
126
|
+
* @param {string} channelId - The id of a channel.
|
|
127
|
+
* @param {any} file - An image file.
|
|
128
|
+
* @returns {Promise<any>}
|
|
129
|
+
*/
|
|
130
|
+
sendImage(channelId: string, file: any): Promise<any>;
|
|
131
|
+
/**
|
|
132
|
+
* Update a message.
|
|
133
|
+
*
|
|
134
|
+
* @todo
|
|
135
|
+
* @async
|
|
136
|
+
* @function updateMessage
|
|
137
|
+
* @param {string} channel
|
|
138
|
+
* @param {string} message_id
|
|
139
|
+
* @param {string} message
|
|
140
|
+
*/
|
|
141
|
+
updateMessage(channel: string, message_id: string, message: string): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Delete a message.
|
|
144
|
+
* @async
|
|
145
|
+
* @function deleteMessage
|
|
146
|
+
* @param {string} channel
|
|
147
|
+
* @param {string} message_id
|
|
148
|
+
*/
|
|
149
|
+
deleteMessage(channel: string, message_id: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Disconnect from a socket.
|
|
152
|
+
*
|
|
153
|
+
* @async
|
|
154
|
+
* @function disconnect
|
|
155
|
+
* @returns
|
|
156
|
+
*/
|
|
157
|
+
disconnect(): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Check if a client is connected to a socket.
|
|
160
|
+
*
|
|
161
|
+
* @function isConnected
|
|
162
|
+
* @returns {boolean}
|
|
163
|
+
*/
|
|
164
|
+
isConnected(): boolean;
|
|
165
|
+
isSocketConnected(): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Bind fn event handlers.
|
|
168
|
+
*
|
|
169
|
+
* @async
|
|
170
|
+
* @function bind
|
|
171
|
+
* @param {string} id
|
|
172
|
+
* @param {any} fn
|
|
173
|
+
*/
|
|
174
|
+
bind(id: string, fn: any): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Unbind fn event handlers.
|
|
177
|
+
*
|
|
178
|
+
* @async
|
|
179
|
+
* @function unbind
|
|
180
|
+
* @param {string} id
|
|
181
|
+
* @param {any} fn
|
|
182
|
+
*/
|
|
183
|
+
unbind(id: string): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* Unbind all event handlers.
|
|
186
|
+
* @param id
|
|
187
|
+
*/
|
|
188
|
+
unbindall(id: string): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Decodes a base-64 encoded string.
|
|
191
|
+
*
|
|
192
|
+
* @function ObjectId
|
|
193
|
+
* @param {string} id - An encoded string to be decoded.
|
|
194
|
+
* @returns {string} decoded string.
|
|
195
|
+
*/
|
|
196
|
+
ObjectId(id: string): string;
|
|
197
|
+
/**
|
|
198
|
+
* Get current friends list of all status.
|
|
199
|
+
*
|
|
200
|
+
* @async
|
|
201
|
+
* @function getFriendships
|
|
202
|
+
* @param {string} filter - Field value for filter.
|
|
203
|
+
* @param {string} sort - Field value for sorting.
|
|
204
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
205
|
+
* @returns {Promise<any>}
|
|
206
|
+
*/
|
|
207
|
+
getFriendships(filter: any, sort?: any, option?: any): Promise<any>;
|
|
208
|
+
/**
|
|
209
|
+
* Get member blocks.
|
|
210
|
+
*
|
|
211
|
+
* @async
|
|
212
|
+
* @function getBannedUsers
|
|
213
|
+
* @param {string} filter - Field value for filter.
|
|
214
|
+
* @param {string} sort - Field value for sorting.
|
|
215
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
216
|
+
* @returns {Promise<any>}
|
|
217
|
+
*/
|
|
218
|
+
getBannedUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
219
|
+
/**
|
|
220
|
+
* Get information data of the member.
|
|
221
|
+
*
|
|
222
|
+
* @async
|
|
223
|
+
* @function getUsers
|
|
224
|
+
* @param {string} filter - Field value for filter.
|
|
225
|
+
* @param {string} sort - Field value for sorting.
|
|
226
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
227
|
+
* @returns {Promise<any>}
|
|
228
|
+
*/
|
|
229
|
+
getUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
230
|
+
/**
|
|
231
|
+
* Request a friendship to a user.
|
|
232
|
+
*
|
|
233
|
+
* @async
|
|
234
|
+
* @function requestFriend
|
|
235
|
+
* @param {string} friendId - An id of the friend to request.
|
|
236
|
+
* @returns {Promise<any>}
|
|
237
|
+
*/
|
|
238
|
+
requestFriend(friendId: string): Promise<any>;
|
|
239
|
+
/**
|
|
240
|
+
* Accept a friends request.
|
|
241
|
+
*
|
|
242
|
+
* @async
|
|
243
|
+
* @function acceptFriend
|
|
244
|
+
* @param {string} friendId - The id of the friend to accept the request.
|
|
245
|
+
* @returns {Promise<any>}
|
|
246
|
+
*/
|
|
247
|
+
acceptFriend(friendId: string): Promise<any>;
|
|
248
|
+
/**
|
|
249
|
+
* Reject a friend request.
|
|
250
|
+
*
|
|
251
|
+
* @async
|
|
252
|
+
* @function rejectFriend
|
|
253
|
+
* @param {string} friendId - An id of the friend to be rejected.
|
|
254
|
+
* @returns {Promise<any>}
|
|
255
|
+
*/
|
|
256
|
+
rejectFriend(friendId: string): Promise<any>;
|
|
257
|
+
/**
|
|
258
|
+
* Remove a friend.
|
|
259
|
+
*
|
|
260
|
+
* @async
|
|
261
|
+
* @function removeFriend
|
|
262
|
+
* @param {string} friendId - An id of the friend to be removed.
|
|
263
|
+
* @returns {Promise<any>}
|
|
264
|
+
*/
|
|
265
|
+
removeFriend(friendId: string): Promise<any>;
|
|
266
|
+
/**
|
|
267
|
+
* Get a count of unread messages of a channel.
|
|
268
|
+
*
|
|
269
|
+
* @async
|
|
270
|
+
* @function countUnread
|
|
271
|
+
* @param {string} channelId - The id of a channel.
|
|
272
|
+
* @returns {Promise<any>}
|
|
273
|
+
*/
|
|
274
|
+
countUnread(channelId: string): Promise<any>;
|
|
275
|
+
/**
|
|
276
|
+
* Get subscription data of the user.
|
|
277
|
+
*
|
|
278
|
+
* @async
|
|
279
|
+
* @function getSubscription
|
|
280
|
+
* @param {string} channelId - The id of a channel.
|
|
281
|
+
* @param {string} id
|
|
282
|
+
* @returns {Promise<any>}
|
|
283
|
+
*/
|
|
284
|
+
getSubscription(channelId: string, id: string): Promise<any>;
|
|
285
|
+
/**
|
|
286
|
+
* Get data of a single channel from the endpoint.
|
|
287
|
+
*
|
|
288
|
+
* @async
|
|
289
|
+
* @function getChannel
|
|
290
|
+
* @param {string} channelId - An id of the channel.
|
|
291
|
+
* @returns {Promise<any>} The data of the channel.
|
|
292
|
+
*/
|
|
293
|
+
getChannel(channelId: string): Promise<any>;
|
|
294
|
+
/**
|
|
295
|
+
* Get data of multiple channels.
|
|
296
|
+
*
|
|
297
|
+
* @async
|
|
298
|
+
* @function getChannels
|
|
299
|
+
* @param {string} filter - Field value for filter.
|
|
300
|
+
* @param {string} sort - Field value for sorting.
|
|
301
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
302
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
303
|
+
*/
|
|
304
|
+
getChannels(filter: any, sort?: any, option?: any): Promise<any>;
|
|
305
|
+
/**
|
|
306
|
+
* @async
|
|
307
|
+
* @function getMessage
|
|
308
|
+
* @param {string} channelId - The id of a channel.
|
|
309
|
+
* @param {string} messageId - The id of a message.
|
|
310
|
+
* @returns {Promise<any>}
|
|
311
|
+
*/
|
|
312
|
+
getMessage(channelId: string, messageId: string): Promise<any>;
|
|
313
|
+
/**
|
|
314
|
+
* Get data of the all messages.
|
|
315
|
+
*
|
|
316
|
+
* @async
|
|
317
|
+
* @function getMessages
|
|
318
|
+
* @param {string} filter - Field value for filter.
|
|
319
|
+
* @param {string} sort - Field value for sorting.
|
|
320
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
321
|
+
* @returns {Promise<any>}
|
|
322
|
+
*/
|
|
323
|
+
getMessages(filter: any, sort: any, option: any): Promise<any>;
|
|
324
|
+
/**
|
|
325
|
+
* Get a list of subscibed member of the channel.
|
|
326
|
+
* @param {string} filter - Field value for filter.
|
|
327
|
+
* @param {string} sort - Field value for sorting.
|
|
328
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
329
|
+
* @returns {Promise<any>}
|
|
330
|
+
*/
|
|
331
|
+
getSubscriptions(filter: any, sort: any, option: any): Promise<any>;
|
|
332
|
+
/**
|
|
333
|
+
* Create a new channel.
|
|
334
|
+
*
|
|
335
|
+
* @async
|
|
336
|
+
* @function createChannel
|
|
337
|
+
* @param {ChannelInput} channel - Configuration options of the new channel.
|
|
338
|
+
* @returns {Promise<any>} The data of the newly created channel.
|
|
339
|
+
*/
|
|
340
|
+
createChannel(channel: ChannelInput): Promise<any>;
|
|
341
|
+
/**
|
|
342
|
+
* Update channel options.
|
|
343
|
+
*
|
|
344
|
+
* @async
|
|
345
|
+
* @function updateChannel
|
|
346
|
+
* @param {string} channelId - An id of the channel.
|
|
347
|
+
* @param {ChannelInput} channel - New options of the channel.
|
|
348
|
+
* @returns {Promise<any>} The data of the updated channel.
|
|
349
|
+
*/
|
|
350
|
+
updateChannel(channelId: string, channel: ChannelInput): Promise<any>;
|
|
351
|
+
/**
|
|
352
|
+
* Delete a channel.
|
|
353
|
+
*
|
|
354
|
+
* @async
|
|
355
|
+
* @function deleteChannel
|
|
356
|
+
* @param {string} channelId - An channel id.
|
|
357
|
+
* @returns {Promise<any>}
|
|
358
|
+
*/
|
|
359
|
+
deleteChannel(channelId: string): Promise<any>;
|
|
360
|
+
/**
|
|
361
|
+
* Update a subscription information, such as marking message read.
|
|
362
|
+
*
|
|
363
|
+
* @async
|
|
364
|
+
* @function markRead
|
|
365
|
+
* @param {string} channelId - The id of a channel.
|
|
366
|
+
* @param {MarkInput} mark
|
|
367
|
+
* @param {string} option
|
|
368
|
+
* @returns {Promise<any>}
|
|
369
|
+
*/
|
|
370
|
+
markRead(channelId: string, mark: MarkInput, option?: any): Promise<any>;
|
|
371
|
+
/**
|
|
372
|
+
* Add members to the private channel.
|
|
373
|
+
*
|
|
374
|
+
* @async
|
|
375
|
+
* @function addUsers
|
|
376
|
+
* @param {string} channelId - An private channel id.
|
|
377
|
+
* @param {string[]} userIds - An array of member ids to be added.
|
|
378
|
+
* @param {any} options
|
|
379
|
+
* @returns {Promise<any>}
|
|
380
|
+
*/
|
|
381
|
+
addUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
382
|
+
/**
|
|
383
|
+
* Remove members from the private channel.
|
|
384
|
+
*
|
|
385
|
+
* @async
|
|
386
|
+
* @function removeUsers
|
|
387
|
+
* @param {string} channelId - An private channel id.
|
|
388
|
+
* @param {string[]} userIds - An array of the member ids to be deleted.
|
|
389
|
+
* @param {any} options
|
|
390
|
+
* @returns {Promise<any>}
|
|
391
|
+
*/
|
|
392
|
+
removeUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
393
|
+
/**
|
|
394
|
+
* Emit "start typing" to a conneted socket.
|
|
395
|
+
*
|
|
396
|
+
* @async
|
|
397
|
+
* @function startTyping
|
|
398
|
+
* @param {string} channelId - The id of a channel that the typing is happening.
|
|
399
|
+
* @param {string} threadId - The id of a thread that the typing is happening.
|
|
400
|
+
* @returns {Promise<any>}
|
|
401
|
+
*/
|
|
402
|
+
startTyping(channelId: string, threadId?: string): Promise<{
|
|
403
|
+
channelId: string;
|
|
404
|
+
threadId: string;
|
|
405
|
+
}>;
|
|
406
|
+
/**
|
|
407
|
+
* Emit "stop typing" to a connected socket.
|
|
408
|
+
*
|
|
409
|
+
* @async
|
|
410
|
+
* @function
|
|
411
|
+
* @param {string} channelId - The id of a channel that the typing is stopped.
|
|
412
|
+
* @param {string} threadId - The id of a thread that the typing is stopped.
|
|
413
|
+
* @returns {Promise<any>}
|
|
414
|
+
*/
|
|
415
|
+
stopTyping(channelId: string, threadId?: string): Promise<{
|
|
416
|
+
channelId: string;
|
|
417
|
+
threadId: string;
|
|
418
|
+
}>;
|
|
419
|
+
/**
|
|
420
|
+
* Ban a member from a channel.
|
|
421
|
+
*
|
|
422
|
+
* @async
|
|
423
|
+
* @function banUser
|
|
424
|
+
* @param {string} channelId - The id of a channel.
|
|
425
|
+
* @param {string} memberId - The id of a member.
|
|
426
|
+
* @param {any} options
|
|
427
|
+
* @returns {Promise<any>}
|
|
428
|
+
*/
|
|
429
|
+
banUser(channelId: string, memberId: string, options?: any): Promise<any>;
|
|
430
|
+
/**
|
|
431
|
+
* Unban a member from a channel.
|
|
432
|
+
*
|
|
433
|
+
* @async
|
|
434
|
+
* @function unbanUser
|
|
435
|
+
* @param {string} channelId - The id of a channel.
|
|
436
|
+
* @param {string} memberId - The id of a member.
|
|
437
|
+
* @returns {Promise<any>}
|
|
438
|
+
*/
|
|
439
|
+
unbanUser(channelId: string, memberId: string): Promise<any>;
|
|
440
|
+
/**
|
|
441
|
+
* Get data of a single pin from the endpoint.
|
|
442
|
+
*
|
|
443
|
+
* @async
|
|
444
|
+
* @function getPin
|
|
445
|
+
* @param {string} channelId - An id of the channel.
|
|
446
|
+
* @param {string} id - An id of the pin.
|
|
447
|
+
* @returns {Promise<any>} The data of the pin.
|
|
448
|
+
*/
|
|
449
|
+
getPin(channelId: string, id: string): Promise<any>;
|
|
450
|
+
/**
|
|
451
|
+
* Get data of multiple pins.
|
|
452
|
+
*
|
|
453
|
+
* @async
|
|
454
|
+
* @function getPins
|
|
455
|
+
* @param {string} channelId - An id of the channel.
|
|
456
|
+
* @param {string} filter - Field value for filter.
|
|
457
|
+
* @param {string} sort - Field value for sorting.
|
|
458
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
459
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
460
|
+
*/
|
|
461
|
+
getPins(channelId: string, filter: any, sort?: any, option?: any): Promise<any>;
|
|
462
|
+
/**
|
|
463
|
+
* Create a new pin.
|
|
464
|
+
*
|
|
465
|
+
* @async
|
|
466
|
+
* @function createPin
|
|
467
|
+
* @param {string} channelId - An id of the channel.
|
|
468
|
+
* @param {PinInput} pin - Configuration options of the new pin.
|
|
469
|
+
* @returns {Promise<any>} The data of the newly created pin.
|
|
470
|
+
*/
|
|
471
|
+
createPin(channelId: string, pin: PinInput): Promise<any>;
|
|
472
|
+
/**
|
|
473
|
+
* Update pin options.
|
|
474
|
+
*
|
|
475
|
+
* @async
|
|
476
|
+
* @function updatePin
|
|
477
|
+
* @param {string} channelId - An id of the channel.
|
|
478
|
+
* @param {PinInput} pin - New options of the pin.
|
|
479
|
+
* @returns {Promise<any>} The data of the updated pin.
|
|
480
|
+
*/
|
|
481
|
+
updatePin(pinId: string, channelId: string, pin: PinInput): Promise<any>;
|
|
482
|
+
getServerUrl(): Promise<any>;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
}
|
|
486
|
+
declare module 'ncloudchat/CoreManager' {
|
|
487
|
+
/**
|
|
488
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
489
|
+
*
|
|
490
|
+
* This source code is licensed under the MIT license found in the
|
|
491
|
+
* LICENSE file in the root directory of this source tree.
|
|
492
|
+
*/
|
|
493
|
+
const CoreManager: {
|
|
494
|
+
get: (key: string) => any;
|
|
495
|
+
set: (key: string, value: any) => void;
|
|
496
|
+
};
|
|
497
|
+
export default CoreManager;
|
|
498
|
+
|
|
499
|
+
}
|
|
500
|
+
declare module 'ncloudchat/Dispatcher' {
|
|
501
|
+
/**
|
|
502
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
503
|
+
*
|
|
504
|
+
* This source code is licensed under the MIT license found in the
|
|
505
|
+
* LICENSE file in the root directory of this source tree.
|
|
506
|
+
*/
|
|
507
|
+
/**
|
|
508
|
+
* Class DispatcherEvent holds all dispatch events functionallities with callbacks.
|
|
509
|
+
*
|
|
510
|
+
* @class
|
|
511
|
+
*/
|
|
512
|
+
class DispatcherEvent {
|
|
513
|
+
private callbacks;
|
|
514
|
+
/**
|
|
515
|
+
* Create a Dispatcher Event instance with an empty callback.
|
|
516
|
+
*
|
|
517
|
+
* @constructs
|
|
518
|
+
*/
|
|
519
|
+
constructor();
|
|
520
|
+
getCallbacks(): any[];
|
|
521
|
+
register(cb: any): void;
|
|
522
|
+
unregister(cb: any): void;
|
|
523
|
+
execute(param1: any, param2: any, param3: any, param4: any, param5: any, param6: any): void;
|
|
524
|
+
}
|
|
525
|
+
type DispatcherProperty = {
|
|
526
|
+
[key: string]: DispatcherEvent;
|
|
527
|
+
};
|
|
528
|
+
export default class Dispatcher {
|
|
529
|
+
private eventProvider;
|
|
530
|
+
constructor();
|
|
531
|
+
getProvider(): DispatcherProperty;
|
|
532
|
+
dispatch(name: string, param1: any, param2?: any, param3?: any, param4?: any, param5?: any, param6?: any): void;
|
|
533
|
+
on(name: string, callback: any): void;
|
|
534
|
+
off(name: string, callback: any): void;
|
|
535
|
+
offall(name: string): void;
|
|
536
|
+
}
|
|
537
|
+
export {};
|
|
538
|
+
|
|
539
|
+
}
|
|
540
|
+
declare module 'ncloudchat/Network' {
|
|
541
|
+
/**
|
|
542
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
543
|
+
*
|
|
544
|
+
* This source code is licensed under the MIT license found in the
|
|
545
|
+
* LICENSE file in the root directory of this source tree.
|
|
546
|
+
*/
|
|
547
|
+
export const fetchData: (returnKey: string | undefined, query: string, variables: object) => Promise<any>;
|
|
548
|
+
|
|
549
|
+
}
|
|
550
|
+
declare module 'ncloudchat/Type' {
|
|
551
|
+
/**
|
|
552
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
553
|
+
*
|
|
554
|
+
* This source code is licensed under the MIT license found in the
|
|
555
|
+
* LICENSE file in the root directory of this source tree.
|
|
556
|
+
*/
|
|
557
|
+
/**
|
|
558
|
+
* Enum for channel types.
|
|
559
|
+
* @readonly
|
|
560
|
+
* @enum {string}
|
|
561
|
+
*/
|
|
562
|
+
export enum ChannelType {
|
|
563
|
+
PRIVATE = "PRIVATE",
|
|
564
|
+
PUBLIC = "PUBLIC"
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Interface for mark input.
|
|
568
|
+
*
|
|
569
|
+
* @interface
|
|
570
|
+
*/
|
|
571
|
+
export interface MarkInput {
|
|
572
|
+
userId: string;
|
|
573
|
+
messageId: string;
|
|
574
|
+
sortId: string;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Interface for channel input.
|
|
578
|
+
*
|
|
579
|
+
* @interface
|
|
580
|
+
*/
|
|
581
|
+
export interface ChannelInput {
|
|
582
|
+
id: string;
|
|
583
|
+
type: ChannelType;
|
|
584
|
+
name: string;
|
|
585
|
+
uniqueId: string;
|
|
586
|
+
translation: boolean;
|
|
587
|
+
disabled: boolean;
|
|
588
|
+
push: boolean;
|
|
589
|
+
mutes: boolean;
|
|
590
|
+
linkUrl: string;
|
|
591
|
+
customField: string;
|
|
592
|
+
imageUrl: string;
|
|
593
|
+
members: string[];
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Enum for message types.
|
|
597
|
+
* @readonly
|
|
598
|
+
* @enum {string}
|
|
599
|
+
*/
|
|
600
|
+
export enum MessageType {
|
|
601
|
+
text = "text",
|
|
602
|
+
photo = "photo",
|
|
603
|
+
file = "file"
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Interface for message input.
|
|
607
|
+
*
|
|
608
|
+
* @interface
|
|
609
|
+
*/
|
|
610
|
+
export interface MessageInput {
|
|
611
|
+
messageType: MessageType;
|
|
612
|
+
text: string;
|
|
613
|
+
imageUrls: string;
|
|
614
|
+
fileUrls: string;
|
|
615
|
+
thumbUrls: string;
|
|
616
|
+
mentiones: string;
|
|
617
|
+
customData: string[];
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
*
|
|
621
|
+
* Interface for pin input.
|
|
622
|
+
*
|
|
623
|
+
* @interface
|
|
624
|
+
*/
|
|
625
|
+
export interface PinInput {
|
|
626
|
+
pinned: boolean;
|
|
627
|
+
pinnedAt: string;
|
|
628
|
+
expiredAt: string;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
}
|
|
632
|
+
declare module 'ncloudchat/Util' {
|
|
633
|
+
/**
|
|
634
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
635
|
+
*
|
|
636
|
+
* This source code is licensed under the MIT license found in the
|
|
637
|
+
* LICENSE file in the root directory of this source tree.
|
|
638
|
+
*/
|
|
639
|
+
/**
|
|
640
|
+
* Decodes a base-64 encoded string.
|
|
641
|
+
*
|
|
642
|
+
* @function ObjectId
|
|
643
|
+
* @param {string} id - An encoded string to be decoded.
|
|
644
|
+
* @returns {string} decoded string.
|
|
645
|
+
*/
|
|
646
|
+
const ObjectId: (id: string) => string;
|
|
647
|
+
export { ObjectId };
|
|
648
|
+
|
|
649
|
+
}
|
|
650
|
+
declare module 'ncloudchat/graphql/channel' {
|
|
651
|
+
/**
|
|
652
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
653
|
+
*
|
|
654
|
+
* This source code is licensed under the MIT license found in the
|
|
655
|
+
* LICENSE file in the root directory of this source tree.
|
|
656
|
+
*/
|
|
657
|
+
export const getChannelQuery: string;
|
|
658
|
+
export const getChannelsQuery: string;
|
|
659
|
+
export const createChannelQuery: string;
|
|
660
|
+
export const updateChannelQuery: string;
|
|
661
|
+
export const deleteChannelQuery: string;
|
|
662
|
+
export const addChannelMembersQuery: string;
|
|
663
|
+
export const removeChannelMembersQuery: string;
|
|
664
|
+
|
|
665
|
+
}
|
|
666
|
+
declare module 'ncloudchat/graphql/friend' {
|
|
667
|
+
/**
|
|
668
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
669
|
+
*
|
|
670
|
+
* This source code is licensed under the MIT license found in the
|
|
671
|
+
* LICENSE file in the root directory of this source tree.
|
|
672
|
+
*/
|
|
673
|
+
export const requestFriendQuery: string;
|
|
674
|
+
export const acceptFriendQuery: string;
|
|
675
|
+
export const rejectFriendQuery: string;
|
|
676
|
+
export const removeFriendQuery: string;
|
|
677
|
+
export const getFriendshipsQuery: string;
|
|
678
|
+
|
|
679
|
+
}
|
|
680
|
+
declare module 'ncloudchat/graphql/invite' {
|
|
681
|
+
/**
|
|
682
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
683
|
+
*
|
|
684
|
+
* This source code is licensed under the MIT license found in the
|
|
685
|
+
* LICENSE file in the root directory of this source tree.
|
|
686
|
+
*/
|
|
687
|
+
export const createInviteQuery = "mutation (\n $projectId: String!, \n $channelId: String!,\n $friendIds: String!\n ) {\n createInvite(\n input: {\n projectId: $projectId, \n channelId: $channelId,\n friendIds: $friendIds\n }\n ) {\n invite {\n id\n }\n }\n }\n";
|
|
688
|
+
|
|
689
|
+
}
|
|
690
|
+
declare module 'ncloudchat/graphql/member' {
|
|
691
|
+
/**
|
|
692
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
693
|
+
*
|
|
694
|
+
* This source code is licensed under the MIT license found in the
|
|
695
|
+
* LICENSE file in the root directory of this source tree.
|
|
696
|
+
*/
|
|
697
|
+
export const loginQuery = "mutation login(\n $projectId: String!\n $userId: String!\n $name: String\n $profile: String\n $customField: String\n ) {\n login(\n input: {\n projectId: $projectId\n userId: $userId\n name: $name\n profile: $profile\n customField: $customField\n }\n ) {\n token\n }\n }";
|
|
698
|
+
export const createMemberBlockQuery: string;
|
|
699
|
+
export const deleteMemberBlockQuery: string;
|
|
700
|
+
export const getMembersQuery = "query membersForQuery (\n $projectId: String!, \n $option: String!, \n $filter: String!, \n $sort: String \n ) {\n membersForQuery (\n projectId: $projectId, \n option:$option, \n filter:$filter, \n sort:$sort\n ) {\n totalCount\n edges {\n node {\n id\n name\n }\n }\n }\n }\n";
|
|
701
|
+
export const getMemberBlocksQuery = "query memberblocks (\n $projectId: String!, \n $filter: String!, \n $sort: String, \n $option:String\n ) {\n memberblocks(\n projectId: $projectId, \n filter:$filter, \n sort:$sort, \n option:$option\n ) {\n totalCount\n edges {\n node {\n id\n project_id\n member_id\n type\n status\n block_type\n messageMulti {\n lang\n value\n default\n }\n started_at\n ended_at\n created_at\n updated_at\n deleted_at\n }\n }\n }\n }\n";
|
|
702
|
+
|
|
703
|
+
}
|
|
704
|
+
declare module 'ncloudchat/graphql/message' {
|
|
705
|
+
/**
|
|
706
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
707
|
+
*
|
|
708
|
+
* This source code is licensed under the MIT license found in the
|
|
709
|
+
* LICENSE file in the root directory of this source tree.
|
|
710
|
+
*/
|
|
711
|
+
export const translateQuery = "mutation (\n $projectId: String!, \n $channelId: String!, \n $srcLang: String!, \n $text: String!, \n $targetLang:String!\n ) {\n translation(\n input: {\n projectId:$projectId, \n channelId:$channelId,\n srcLang:$srcLang,\n targetLang:$targetLang, \n text:$text \n }\n ) {\n result\n {\n status\n message\n lang\n }\n }\n }\n";
|
|
712
|
+
export const getMessageQuery: string;
|
|
713
|
+
export const getMessagesQuery: string;
|
|
714
|
+
export const unreadCountQuery = "query mark (\n $projectId: String!, \n $channelId: String!\n ) { \n mark (\n projectId: $projectId, \n channelId:$channelId\n ) { \n user_id,\n message_id,\n sort_id, \n unread\n } \n }\n";
|
|
715
|
+
export const messageQuery: string;
|
|
716
|
+
|
|
717
|
+
}
|
|
718
|
+
declare module 'ncloudchat/graphql/pin' {
|
|
719
|
+
/**
|
|
720
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
721
|
+
*
|
|
722
|
+
* This source code is licensed under the MIT license found in the
|
|
723
|
+
* LICENSE file in the root directory of this source tree.
|
|
724
|
+
*/
|
|
725
|
+
export const getPinQuery: string;
|
|
726
|
+
export const getPinsQuery: string;
|
|
727
|
+
export const createPinQuery: string;
|
|
728
|
+
export const updatePinQuery: string;
|
|
729
|
+
|
|
730
|
+
}
|
|
731
|
+
declare module 'ncloudchat/graphql/project' {
|
|
732
|
+
/**
|
|
733
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
734
|
+
*
|
|
735
|
+
* This source code is licensed under the MIT license found in the
|
|
736
|
+
* LICENSE file in the root directory of this source tree.
|
|
737
|
+
*/
|
|
738
|
+
|
|
739
|
+
}
|
|
740
|
+
declare module 'ncloudchat/graphql/subscription' {
|
|
741
|
+
/**
|
|
742
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
743
|
+
*
|
|
744
|
+
* This source code is licensed under the MIT license found in the
|
|
745
|
+
* LICENSE file in the root directory of this source tree.
|
|
746
|
+
*/
|
|
747
|
+
export const createSubscriptionQuery: string;
|
|
748
|
+
export const deleteSubscriptionQuery: string;
|
|
749
|
+
export const updateSubscriptionQuery: string;
|
|
750
|
+
export const getSubscriptionQuery = "query subscription (\n $projectId: String!,\n $channelId: String!, \n $id: String!\n ) {\n subscription (\n projectId: $projectId, \n channelId: $channelId, \n id:$id\n ) {\n id\n user {\n name\n profile\n country\n }\n mark {\n user_id\n message_id\n sort_id\n }\n channel_id\n user_id\n online\n push\n created_at\n }\n }\n";
|
|
751
|
+
export const getSubscriptionsQuery = "query subscriptions (\n $projectId: String!, \n $option: String!, \n $filter: String!, \n $sort: String \n ) {\n subscriptions (\n projectId: $projectId, \n option:$option, \n filter:$filter, \n sort:$sort\n ) {\n totalCount\n edges {\n node {\n id\n user {\n name\n profile\n country\n }\n channel_id\n user_id\n online\n push\n created_at\n }\n }\n }\n }\n";
|
|
752
|
+
|
|
753
|
+
}
|
|
754
|
+
declare module 'ncloudchat/index' {
|
|
755
|
+
/**
|
|
756
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
757
|
+
*
|
|
758
|
+
* This source code is licensed under the MIT license found in the
|
|
759
|
+
* LICENSE file in the root directory of this source tree.
|
|
760
|
+
*/
|
|
761
|
+
import Chat from 'ncloudchat/CloudChat';
|
|
762
|
+
export { Chat };
|
|
763
|
+
|
|
764
|
+
}
|
|
765
|
+
declare module 'ncloudchat/logger' {
|
|
766
|
+
/**
|
|
767
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
768
|
+
*
|
|
769
|
+
* This source code is licensed under the MIT license found in the
|
|
770
|
+
* LICENSE file in the root directory of this source tree.
|
|
771
|
+
*/
|
|
772
|
+
const debug: (value: any) => void;
|
|
773
|
+
const error: (value: any) => void;
|
|
774
|
+
const info: (value: any) => void;
|
|
775
|
+
export { debug, error, info };
|
|
776
|
+
|
|
777
|
+
}
|
|
778
|
+
declare module 'ncloudchat/mutations/channel' {
|
|
779
|
+
/**
|
|
780
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
781
|
+
*
|
|
782
|
+
* This source code is licensed under the MIT license found in the
|
|
783
|
+
* LICENSE file in the root directory of this source tree.
|
|
784
|
+
*/
|
|
785
|
+
import type { ChannelInput } from "ncloudchat/Type";
|
|
786
|
+
/**
|
|
787
|
+
* Create a new channel.
|
|
788
|
+
*
|
|
789
|
+
* @async
|
|
790
|
+
* @function createChannel
|
|
791
|
+
* @param {ChannelInput} channel - Configuration options of the new channel.
|
|
792
|
+
* @returns {Promise<any>} The data of the newly created channel.
|
|
793
|
+
*/
|
|
794
|
+
export const createChannel: (channel: ChannelInput) => Promise<any>;
|
|
795
|
+
/**
|
|
796
|
+
* Update channel options.
|
|
797
|
+
*
|
|
798
|
+
* @async
|
|
799
|
+
* @function updateChannel
|
|
800
|
+
* @param {string} channelId - An id of the channel.
|
|
801
|
+
* @param {ChannelInput} channel - New options of the channel.
|
|
802
|
+
* @returns {Promise<any>} The data of the updated channel.
|
|
803
|
+
*/
|
|
804
|
+
export const updateChannel: (channelId: string, channel: ChannelInput) => Promise<any>;
|
|
805
|
+
/**
|
|
806
|
+
* Delete a channel.
|
|
807
|
+
*
|
|
808
|
+
* @async
|
|
809
|
+
* @function deleteChannel
|
|
810
|
+
* @param {string} channelId - An channel id.
|
|
811
|
+
* @returns {Promise<any>}
|
|
812
|
+
*/
|
|
813
|
+
export const deleteChannel: (channelId: string) => Promise<any>;
|
|
814
|
+
/**
|
|
815
|
+
* Add members to the private channel.
|
|
816
|
+
*
|
|
817
|
+
* @async
|
|
818
|
+
* @function addChannelMembers
|
|
819
|
+
* @param {string} channelId - An private channel id.
|
|
820
|
+
* @param {string[]} memberIds - An array of member ids to be added.
|
|
821
|
+
* @param {any} options
|
|
822
|
+
* @returns {Promise<any>}
|
|
823
|
+
*/
|
|
824
|
+
export const addChannelMembers: (channelId: string, memberIds: any, options: any) => Promise<any>;
|
|
825
|
+
/**
|
|
826
|
+
* Remove members from the private channel.
|
|
827
|
+
*
|
|
828
|
+
* @async
|
|
829
|
+
* @function removeChannelMembers
|
|
830
|
+
* @param {string} channelId - An private channel id.
|
|
831
|
+
* @param {string[]} memberIds - An array of the member ids to be deleted.
|
|
832
|
+
* @returns {Promise<any>}
|
|
833
|
+
*/
|
|
834
|
+
export const removeChannelMembers: (channelId: string, memberIds: any) => Promise<any>;
|
|
835
|
+
|
|
836
|
+
}
|
|
837
|
+
declare module 'ncloudchat/mutations/friend' {
|
|
838
|
+
/**
|
|
839
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
840
|
+
*
|
|
841
|
+
* This source code is licensed under the MIT license found in the
|
|
842
|
+
* LICENSE file in the root directory of this source tree.
|
|
843
|
+
*/
|
|
844
|
+
/**
|
|
845
|
+
* Request a friendship to a user.
|
|
846
|
+
*
|
|
847
|
+
* @async
|
|
848
|
+
* @function requestFriend
|
|
849
|
+
* @param {string} friendId - An id of the friend to request.
|
|
850
|
+
* @returns {Promise<any>}
|
|
851
|
+
*/
|
|
852
|
+
export const requestFriend: (friendId: string) => Promise<any>;
|
|
853
|
+
/**
|
|
854
|
+
* Accept a friends request.
|
|
855
|
+
*
|
|
856
|
+
* @async
|
|
857
|
+
* @function acceptFriend
|
|
858
|
+
* @param {string} friendId - The id of the friend to accept the request.
|
|
859
|
+
* @returns {Promise<any>}
|
|
860
|
+
*/
|
|
861
|
+
export const acceptFriend: (friendId: string) => Promise<any>;
|
|
862
|
+
/**
|
|
863
|
+
* Reject a friend request.
|
|
864
|
+
*
|
|
865
|
+
* @async
|
|
866
|
+
* @function rejectFriend
|
|
867
|
+
* @param {string} friendId - An id of the friend to be rejected.
|
|
868
|
+
* @returns {Promise<any>}
|
|
869
|
+
*/
|
|
870
|
+
export const rejectFriend: (friendId: string) => Promise<any>;
|
|
871
|
+
/**
|
|
872
|
+
* Remove a friend.
|
|
873
|
+
*
|
|
874
|
+
* @async
|
|
875
|
+
* @function removeFriend
|
|
876
|
+
* @param {string} friendId - An id of the friend to be removed.
|
|
877
|
+
* @returns {Promise<any>}
|
|
878
|
+
*/
|
|
879
|
+
export const removeFriend: (friendId: string) => Promise<any>;
|
|
880
|
+
|
|
881
|
+
}
|
|
882
|
+
declare module 'ncloudchat/mutations/index' {
|
|
883
|
+
/**
|
|
884
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
885
|
+
*
|
|
886
|
+
* This source code is licensed under the MIT license found in the
|
|
887
|
+
* LICENSE file in the root directory of this source tree.
|
|
888
|
+
*/
|
|
889
|
+
export * from 'ncloudchat/mutations/member';
|
|
890
|
+
export * from 'ncloudchat/mutations/channel';
|
|
891
|
+
export * from 'ncloudchat/mutations/message';
|
|
892
|
+
export * from 'ncloudchat/mutations/friend';
|
|
893
|
+
export * from 'ncloudchat/mutations/invite';
|
|
894
|
+
export * from 'ncloudchat/mutations/subscription';
|
|
895
|
+
export * from 'ncloudchat/mutations/pin';
|
|
896
|
+
|
|
897
|
+
}
|
|
898
|
+
declare module 'ncloudchat/mutations/invite' {
|
|
899
|
+
/**
|
|
900
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
901
|
+
*
|
|
902
|
+
* This source code is licensed under the MIT license found in the
|
|
903
|
+
* LICENSE file in the root directory of this source tree.
|
|
904
|
+
*/
|
|
905
|
+
/**
|
|
906
|
+
* Create an invite to a friend users to a channel.
|
|
907
|
+
*
|
|
908
|
+
* @async
|
|
909
|
+
* @function createInvite
|
|
910
|
+
* @param {string} channelId - An id of the channel to be invited.
|
|
911
|
+
* @param {string} friendIds - Id of friends to be invited to the channel.
|
|
912
|
+
* @returns {Promise<any>}
|
|
913
|
+
*/
|
|
914
|
+
export const createInvite: (channelId: string, friendIds: any) => Promise<any>;
|
|
915
|
+
|
|
916
|
+
}
|
|
917
|
+
declare module 'ncloudchat/mutations/member' {
|
|
918
|
+
/**
|
|
919
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
920
|
+
*
|
|
921
|
+
* This source code is licensed under the MIT license found in the
|
|
922
|
+
* LICENSE file in the root directory of this source tree.
|
|
923
|
+
*/
|
|
924
|
+
/**
|
|
925
|
+
* Login a user
|
|
926
|
+
*
|
|
927
|
+
* @async
|
|
928
|
+
* @function login
|
|
929
|
+
* @param {string} user_id - The id of a user loggin in.
|
|
930
|
+
* @param {string} name
|
|
931
|
+
* @param {string} profile
|
|
932
|
+
* @param {string} token
|
|
933
|
+
* @returns {Promise<any>}
|
|
934
|
+
*/
|
|
935
|
+
export const login: (user_id: string, name?: string, profile?: string, token?: string, customField?: string) => Promise<any>;
|
|
936
|
+
/**
|
|
937
|
+
* Create a member block followed by the getMemberBlockSchema.
|
|
938
|
+
* The member block is to used to ban a member.
|
|
939
|
+
*
|
|
940
|
+
* @async
|
|
941
|
+
* @function createMemberBlock
|
|
942
|
+
* @param {string} channelId - The id of a channel.
|
|
943
|
+
* @param {string} memberId - The id of a member.
|
|
944
|
+
* @param {string} options
|
|
945
|
+
* @returns {Promise<any>}
|
|
946
|
+
*/
|
|
947
|
+
export const createMemberBlock: (channelId: string, memberId: string, options?: string) => Promise<any>;
|
|
948
|
+
/**
|
|
949
|
+
* Delete a member block.
|
|
950
|
+
* This is used to unban a member from a channel.
|
|
951
|
+
*
|
|
952
|
+
* @async
|
|
953
|
+
* @function deleteMemberBlock
|
|
954
|
+
* @param {string} channelId - The id of a channel that the member is in.
|
|
955
|
+
* @param {string} memberId - The id of a member to be deleted.
|
|
956
|
+
* @returns {Promise<any>}
|
|
957
|
+
*/
|
|
958
|
+
export const deleteMemberBlock: (channelId: string, memberId: string) => Promise<any>;
|
|
959
|
+
|
|
960
|
+
}
|
|
961
|
+
declare module 'ncloudchat/mutations/message' {
|
|
962
|
+
/**
|
|
963
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
964
|
+
*
|
|
965
|
+
* This source code is licensed under the MIT license found in the
|
|
966
|
+
* LICENSE file in the root directory of this source tree.
|
|
967
|
+
*/
|
|
968
|
+
/**
|
|
969
|
+
* Trasnslate a text block to the target language from the source language.
|
|
970
|
+
*
|
|
971
|
+
* @async
|
|
972
|
+
* @function translate
|
|
973
|
+
* @param {string} channelId - The id of a channel.
|
|
974
|
+
* @param {string} srcLang - The source language.
|
|
975
|
+
* @param {string} targetLang - The target language.
|
|
976
|
+
* @param {string} text - The text block to be translated.
|
|
977
|
+
* @returns {Promise<any>}
|
|
978
|
+
*/
|
|
979
|
+
export const translate: (channelId: string, srcLang: string, targetLang: string, text: string) => Promise<any>;
|
|
980
|
+
/**
|
|
981
|
+
* Upload a file to a channel. Only supports png, jpg, jpeg file types.
|
|
982
|
+
*
|
|
983
|
+
* @async
|
|
984
|
+
* @function upload
|
|
985
|
+
* @param {string} channelId - The id of a channel.
|
|
986
|
+
* @param {any} file - An image file.
|
|
987
|
+
* @returns {Promise<any>}
|
|
988
|
+
*/
|
|
989
|
+
export const upload: (channelId: string, file: any) => Promise<any>;
|
|
990
|
+
/**
|
|
991
|
+
* Send a Message
|
|
992
|
+
*
|
|
993
|
+
* @async
|
|
994
|
+
* @function translate
|
|
995
|
+
* @param {string} data - The id of a message.
|
|
996
|
+
* @returns {Promise<any>}
|
|
997
|
+
*/
|
|
998
|
+
export const message: (data: any) => Promise<any>;
|
|
999
|
+
|
|
1000
|
+
}
|
|
1001
|
+
declare module 'ncloudchat/mutations/pin' {
|
|
1002
|
+
/**
|
|
1003
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1004
|
+
*
|
|
1005
|
+
* This source code is licensed under the MIT license found in the
|
|
1006
|
+
* LICENSE file in the root directory of this source tree.
|
|
1007
|
+
*/
|
|
1008
|
+
import type { PinInput } from "ncloudchat/Type";
|
|
1009
|
+
/**
|
|
1010
|
+
* Create a new pin.
|
|
1011
|
+
*
|
|
1012
|
+
* @async
|
|
1013
|
+
* @function createPin
|
|
1014
|
+
* @param {string} channelId - An id of the channel.
|
|
1015
|
+
* @param {PinInput} pin - Configuration options of the new pin.
|
|
1016
|
+
* @returns {Promise<any>} The data of the newly created pin.
|
|
1017
|
+
*/
|
|
1018
|
+
export const createPin: (channelId: string, pin: PinInput) => Promise<any>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Update pin options.
|
|
1021
|
+
*
|
|
1022
|
+
* @async
|
|
1023
|
+
* @function updatePin
|
|
1024
|
+
* @param {string} id - An id of the pin.
|
|
1025
|
+
* @param {string} channelId - An id of the channel.
|
|
1026
|
+
* @param {PinInput} pin - New options of the pin.
|
|
1027
|
+
* @returns {Promise<any>} The data of the updated created pin.
|
|
1028
|
+
*/
|
|
1029
|
+
export const updatePin: (id: string, channelId: string, pin: PinInput) => Promise<any>;
|
|
1030
|
+
|
|
1031
|
+
}
|
|
1032
|
+
declare module 'ncloudchat/mutations/subscription' {
|
|
1033
|
+
/**
|
|
1034
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1035
|
+
*
|
|
1036
|
+
* This source code is licensed under the MIT license found in the
|
|
1037
|
+
* LICENSE file in the root directory of this source tree.
|
|
1038
|
+
*/
|
|
1039
|
+
import type { MarkInput } from "ncloudchat/Type";
|
|
1040
|
+
/**
|
|
1041
|
+
* Create a subscription.
|
|
1042
|
+
*
|
|
1043
|
+
* @async
|
|
1044
|
+
* @function createSubscription
|
|
1045
|
+
* @param {string} channelId - The id of a channel.
|
|
1046
|
+
* @param {string} option
|
|
1047
|
+
* @returns {Promise<any>}
|
|
1048
|
+
*/
|
|
1049
|
+
export const createSubscription: (channelId: string, option?: string) => Promise<any>;
|
|
1050
|
+
/**
|
|
1051
|
+
* Delete a subscription.
|
|
1052
|
+
*
|
|
1053
|
+
* @async
|
|
1054
|
+
* @function deleteSubscription
|
|
1055
|
+
* @param {string} channelId - The id of a channel.
|
|
1056
|
+
* @returns {Promise<any>}
|
|
1057
|
+
*/
|
|
1058
|
+
export const deleteSubscription: (channelId: string) => Promise<any>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Update a subscription information, such as marking message read.
|
|
1061
|
+
*
|
|
1062
|
+
* @async
|
|
1063
|
+
* @function updateSubscription
|
|
1064
|
+
* @param {string} channelId - The id of a channel.
|
|
1065
|
+
* @param {MarkInput} mark
|
|
1066
|
+
* @param {string} option
|
|
1067
|
+
* @returns {Promise<any>}
|
|
1068
|
+
*/
|
|
1069
|
+
export const updateSubscription: (channelId: string, mark: MarkInput, option?: string) => Promise<any>;
|
|
1070
|
+
|
|
1071
|
+
}
|
|
1072
|
+
declare module 'ncloudchat/queries/channel' {
|
|
1073
|
+
/**
|
|
1074
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1075
|
+
*
|
|
1076
|
+
* This source code is licensed under the MIT license found in the
|
|
1077
|
+
* LICENSE file in the root directory of this source tree.
|
|
1078
|
+
*/
|
|
1079
|
+
/**
|
|
1080
|
+
* Get data of a single channel from the endpoint.
|
|
1081
|
+
*
|
|
1082
|
+
* @async
|
|
1083
|
+
* @function getChannel
|
|
1084
|
+
* @param {string} id - An id of the channel.
|
|
1085
|
+
* @returns {Promise<any>} The data of the channel.
|
|
1086
|
+
*/
|
|
1087
|
+
export const getChannel: (id: string) => Promise<any>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Get data of multiple channels.
|
|
1090
|
+
*
|
|
1091
|
+
* @async
|
|
1092
|
+
* @function getChannels
|
|
1093
|
+
* @param {string} filter - Field value for filter.
|
|
1094
|
+
* @param {string} sort - Field value for sorting.
|
|
1095
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1096
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
1097
|
+
*/
|
|
1098
|
+
export const getChannels: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1099
|
+
|
|
1100
|
+
}
|
|
1101
|
+
declare module 'ncloudchat/queries/friend' {
|
|
1102
|
+
/**
|
|
1103
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1104
|
+
*
|
|
1105
|
+
* This source code is licensed under the MIT license found in the
|
|
1106
|
+
* LICENSE file in the root directory of this source tree.
|
|
1107
|
+
*/
|
|
1108
|
+
/**
|
|
1109
|
+
* Get current friends list of all status.
|
|
1110
|
+
*
|
|
1111
|
+
* @async
|
|
1112
|
+
* @function getFriendships
|
|
1113
|
+
* @param {string} filter - Field value for filter.
|
|
1114
|
+
* @param {string} sort - Field value for sorting.
|
|
1115
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1116
|
+
* @returns {Promise<any>}
|
|
1117
|
+
*/
|
|
1118
|
+
export const getFriendships: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1119
|
+
|
|
1120
|
+
}
|
|
1121
|
+
declare module 'ncloudchat/queries/index' {
|
|
1122
|
+
/**
|
|
1123
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1124
|
+
*
|
|
1125
|
+
* This source code is licensed under the MIT license found in the
|
|
1126
|
+
* LICENSE file in the root directory of this source tree.
|
|
1127
|
+
*/
|
|
1128
|
+
export * from 'ncloudchat/queries/project';
|
|
1129
|
+
export * from 'ncloudchat/queries/channel';
|
|
1130
|
+
export * from 'ncloudchat/queries/message';
|
|
1131
|
+
export * from 'ncloudchat/queries/subscription';
|
|
1132
|
+
export * from 'ncloudchat/queries/friend';
|
|
1133
|
+
export * from 'ncloudchat/queries/member';
|
|
1134
|
+
export * from 'ncloudchat/queries/memberblocks';
|
|
1135
|
+
export * from 'ncloudchat/queries/pin';
|
|
1136
|
+
|
|
1137
|
+
}
|
|
1138
|
+
declare module 'ncloudchat/queries/member' {
|
|
1139
|
+
/**
|
|
1140
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1141
|
+
*
|
|
1142
|
+
* This source code is licensed under the MIT license found in the
|
|
1143
|
+
* LICENSE file in the root directory of this source tree.
|
|
1144
|
+
*/
|
|
1145
|
+
/**
|
|
1146
|
+
* Get information data of the member.
|
|
1147
|
+
*
|
|
1148
|
+
* @async
|
|
1149
|
+
* @function getMembers
|
|
1150
|
+
* @param {string} filter - Field value for filter.
|
|
1151
|
+
* @param {string} sort - Field value for sorting.
|
|
1152
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1153
|
+
* @returns {Promise<any>}
|
|
1154
|
+
*/
|
|
1155
|
+
export const getMembers: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1156
|
+
|
|
1157
|
+
}
|
|
1158
|
+
declare module 'ncloudchat/queries/memberblocks' {
|
|
1159
|
+
/**
|
|
1160
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1161
|
+
*
|
|
1162
|
+
* This source code is licensed under the MIT license found in the
|
|
1163
|
+
* LICENSE file in the root directory of this source tree.
|
|
1164
|
+
*/
|
|
1165
|
+
/**
|
|
1166
|
+
* Get member blocks.
|
|
1167
|
+
*
|
|
1168
|
+
* @async
|
|
1169
|
+
* @function getMemberBlocks
|
|
1170
|
+
* @param {string} filter - Field value for filter.
|
|
1171
|
+
* @param {string} sort - Field value for sorting.
|
|
1172
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1173
|
+
* @returns {Promise<any>}
|
|
1174
|
+
*/
|
|
1175
|
+
export const getMemberBlocks: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1176
|
+
|
|
1177
|
+
}
|
|
1178
|
+
declare module 'ncloudchat/queries/message' {
|
|
1179
|
+
/**
|
|
1180
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1181
|
+
*
|
|
1182
|
+
* This source code is licensed under the MIT license found in the
|
|
1183
|
+
* LICENSE file in the root directory of this source tree.
|
|
1184
|
+
*/
|
|
1185
|
+
/**
|
|
1186
|
+
* Get data of the all messages.
|
|
1187
|
+
*
|
|
1188
|
+
* @async
|
|
1189
|
+
* @function getMessages
|
|
1190
|
+
* @param {string} filter - Field value for filter.
|
|
1191
|
+
* @param {string} sort - Field value for sorting.
|
|
1192
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1193
|
+
* @returns {Promise<any>}
|
|
1194
|
+
*/
|
|
1195
|
+
export const getMessages: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Get data of a single message.
|
|
1198
|
+
*
|
|
1199
|
+
* @async
|
|
1200
|
+
* @function getMessage
|
|
1201
|
+
* @param {string} channelId - The id of a channel.
|
|
1202
|
+
* @param {string} messageId - The id of a message.
|
|
1203
|
+
* @returns {Promise<any>}
|
|
1204
|
+
*/
|
|
1205
|
+
export const getMessage: (channelId: string, messageId: string) => Promise<any>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Get a count of unread messages of a channel.
|
|
1208
|
+
*
|
|
1209
|
+
* @async
|
|
1210
|
+
* @function unreadCount
|
|
1211
|
+
* @param {string} channelId - The id of a channel.
|
|
1212
|
+
* @returns {Promise<any>}
|
|
1213
|
+
*/
|
|
1214
|
+
export const unreadCount: (channelId: string) => Promise<any>;
|
|
1215
|
+
|
|
1216
|
+
}
|
|
1217
|
+
declare module 'ncloudchat/queries/pin' {
|
|
1218
|
+
/**
|
|
1219
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1220
|
+
*
|
|
1221
|
+
* This source code is licensed under the MIT license found in the
|
|
1222
|
+
* LICENSE file in the root directory of this source tree.
|
|
1223
|
+
*/
|
|
1224
|
+
/**
|
|
1225
|
+
* Get data of a single pin from the endpoint.
|
|
1226
|
+
*
|
|
1227
|
+
* @async
|
|
1228
|
+
* @function getPin
|
|
1229
|
+
* @param {string} channelId - An id of the channel.
|
|
1230
|
+
* @param {string} id - An id of the pin.
|
|
1231
|
+
* @returns {Promise<any>} The data of the pin.
|
|
1232
|
+
*/
|
|
1233
|
+
export const getPin: (channelId: string, id: string) => Promise<any>;
|
|
1234
|
+
/**
|
|
1235
|
+
* Get data of multiple pins.
|
|
1236
|
+
*
|
|
1237
|
+
* @async
|
|
1238
|
+
* @function getPins
|
|
1239
|
+
* @param {string} channelId - An id of the channel.
|
|
1240
|
+
* @param {string} filter - Field value for filter.
|
|
1241
|
+
* @param {string} sort - Field value for sorting.
|
|
1242
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1243
|
+
* @returns {Promise<any[]>} An array of data of all pins.
|
|
1244
|
+
*/
|
|
1245
|
+
export const getPins: (channelId: string, filter: string, sort: string, option: string) => Promise<any>;
|
|
1246
|
+
|
|
1247
|
+
}
|
|
1248
|
+
declare module 'ncloudchat/queries/project' {
|
|
1249
|
+
/**
|
|
1250
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1251
|
+
*
|
|
1252
|
+
* This source code is licensed under the MIT license found in the
|
|
1253
|
+
* LICENSE file in the root directory of this source tree.
|
|
1254
|
+
*/
|
|
1255
|
+
export {};
|
|
1256
|
+
/**
|
|
1257
|
+
* Get data of a project.
|
|
1258
|
+
*
|
|
1259
|
+
* @async
|
|
1260
|
+
* @function getProject
|
|
1261
|
+
* @returns {Promise<any>}
|
|
1262
|
+
*/
|
|
1263
|
+
|
|
1264
|
+
}
|
|
1265
|
+
declare module 'ncloudchat/queries/subscription' {
|
|
1266
|
+
/**
|
|
1267
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
1268
|
+
*
|
|
1269
|
+
* This source code is licensed under the MIT license found in the
|
|
1270
|
+
* LICENSE file in the root directory of this source tree.
|
|
1271
|
+
*/
|
|
1272
|
+
/**
|
|
1273
|
+
* Get subscription data of the user.
|
|
1274
|
+
*
|
|
1275
|
+
* @async
|
|
1276
|
+
* @function getSubscription
|
|
1277
|
+
* @param {string} channelId - The id of a channel.
|
|
1278
|
+
* @param {string} id
|
|
1279
|
+
* @returns {Promise<any>}
|
|
1280
|
+
*/
|
|
1281
|
+
export const getSubscription: (channelId: string, id: string) => Promise<any>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Get a list of subscibed member of the channel.
|
|
1284
|
+
*
|
|
1285
|
+
* @async
|
|
1286
|
+
* @function getSubscriptions
|
|
1287
|
+
* @param {string} filter - Field value for filter.
|
|
1288
|
+
* @param {string} sort - Field value for sorting.
|
|
1289
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
1290
|
+
* @returns {Promise<any>}
|
|
1291
|
+
*/
|
|
1292
|
+
export const getSubscriptions: (filter: any, sort: any, option: any) => Promise<any>;
|
|
1293
|
+
|
|
1294
|
+
}
|
|
1295
|
+
declare module 'ncloudchat' {
|
|
1296
|
+
import main = require('ncloudchat/index');
|
|
1297
|
+
export = main;
|
|
1298
|
+
}
|