ncloudchat 1.0.21 → 1.0.31
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/LICENSE.md +1 -1
- package/deploy.sh +1 -1
- package/esm/CloudChat.d.ts +434 -9
- package/esm/CloudChat.js +979 -273
- package/esm/CloudChat.js.map +1 -1
- package/esm/CoreManager.d.ts +6 -0
- package/esm/CoreManager.js +13 -4
- package/esm/CoreManager.js.map +1 -1
- package/esm/Dispatcher.d.ts +16 -0
- package/esm/Dispatcher.js +19 -4
- package/esm/Dispatcher.js.map +1 -1
- package/esm/Network.d.ts +7 -0
- package/esm/Network.js +93 -0
- package/esm/Network.js.map +1 -0
- package/esm/Type.d.ts +43 -0
- package/esm/Type.js +16 -0
- package/esm/Type.js.map +1 -1
- package/esm/Util.d.ts +13 -0
- package/esm/Util.js +13 -0
- package/esm/Util.js.map +1 -1
- package/esm/graphql/channel.d.ts +13 -0
- package/esm/graphql/channel.js +16 -0
- package/esm/graphql/channel.js.map +1 -0
- package/esm/graphql/friend.d.ts +11 -0
- package/esm/graphql/friend.js +13 -0
- package/esm/graphql/friend.js.map +1 -0
- package/esm/graphql/invite.d.ts +7 -0
- package/esm/graphql/invite.js +8 -0
- package/esm/graphql/invite.js.map +1 -0
- package/esm/graphql/member.d.ts +11 -0
- package/esm/graphql/member.js +13 -0
- package/esm/graphql/member.js.map +1 -0
- package/esm/graphql/message.d.ts +11 -0
- package/esm/graphql/message.js +13 -0
- package/esm/graphql/message.js.map +1 -0
- package/esm/graphql/pin.d.ts +10 -0
- package/esm/graphql/pin.js +12 -0
- package/esm/graphql/pin.js.map +1 -0
- package/esm/graphql/project.d.ts +7 -0
- package/esm/graphql/project.js +8 -0
- package/esm/graphql/project.js.map +1 -0
- package/esm/graphql/subscription.d.ts +11 -0
- package/esm/graphql/subscription.js +13 -0
- package/esm/graphql/subscription.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +6 -0
- package/esm/index.js.map +1 -1
- package/esm/logger.d.ts +9 -3
- package/esm/logger.js +6 -0
- package/esm/logger.js.map +1 -1
- package/esm/mutations/channel.d.ts +50 -0
- package/esm/mutations/channel.js +97 -176
- package/esm/mutations/channel.js.map +1 -1
- package/esm/mutations/friend.d.ts +38 -0
- package/esm/mutations/friend.js +57 -119
- package/esm/mutations/friend.js.map +1 -1
- package/esm/mutations/index.d.ts +5 -3
- package/esm/mutations/index.js +5 -3
- package/esm/mutations/index.js.map +1 -1
- package/esm/mutations/invite.d.ts +15 -0
- package/esm/mutations/invite.js +23 -32
- package/esm/mutations/invite.js.map +1 -1
- package/esm/mutations/member.d.ts +39 -2
- package/esm/mutations/member.js +64 -111
- package/esm/mutations/member.js.map +1 -1
- package/esm/mutations/message.d.ts +35 -0
- package/esm/mutations/message.js +66 -45
- package/esm/mutations/message.js.map +1 -1
- package/esm/mutations/pin.d.ts +28 -0
- package/esm/mutations/pin.js +88 -0
- package/esm/mutations/pin.js.map +1 -0
- package/esm/mutations/subscription.d.ts +33 -1
- package/esm/mutations/subscription.js +51 -93
- package/esm/mutations/subscription.js.map +1 -1
- package/esm/queries/channel.d.ts +24 -0
- package/esm/queries/channel.js +37 -79
- package/esm/queries/channel.js.map +1 -1
- package/esm/queries/friend.d.ts +16 -0
- package/esm/queries/friend.js +25 -40
- package/esm/queries/friend.js.map +1 -1
- package/esm/queries/index.d.ts +8 -0
- package/esm/queries/index.js +8 -0
- package/esm/queries/index.js.map +1 -1
- package/esm/queries/member.d.ts +16 -0
- package/esm/queries/member.js +25 -40
- package/esm/queries/member.js.map +1 -1
- package/esm/queries/memberblocks.d.ts +17 -0
- package/esm/queries/memberblocks.js +69 -0
- package/esm/queries/memberblocks.js.map +1 -0
- package/esm/queries/message.d.ts +33 -0
- package/esm/queries/message.js +50 -111
- package/esm/queries/message.js.map +1 -1
- package/esm/queries/pin.d.ts +28 -0
- package/esm/queries/pin.js +92 -0
- package/esm/queries/pin.js.map +1 -0
- package/esm/queries/project.d.ts +13 -0
- package/esm/queries/project.js +20 -32
- package/esm/queries/project.js.map +1 -1
- package/esm/queries/subscription.d.ts +25 -0
- package/esm/queries/subscription.js +39 -76
- package/esm/queries/subscription.js.map +1 -1
- package/lib/CloudChat.js +1230 -321
- package/lib/CoreManager.js +13 -3
- package/lib/Dispatcher.js +25 -9
- package/lib/Network.js +226 -0
- package/lib/Type.js +19 -0
- package/lib/Util.js +15 -1
- package/lib/graphql/channel.js +32 -0
- package/lib/graphql/friend.js +27 -0
- package/lib/graphql/invite.js +18 -0
- package/lib/graphql/member.js +27 -0
- package/lib/graphql/message.js +27 -0
- package/lib/graphql/pin.js +25 -0
- package/lib/graphql/project.js +18 -0
- package/lib/graphql/subscription.js +27 -0
- package/lib/index.js +2 -2
- package/lib/logger.js +6 -0
- package/lib/mutations/channel.js +106 -172
- package/lib/mutations/friend.js +62 -115
- package/lib/mutations/index.js +23 -3
- package/lib/mutations/invite.js +27 -33
- package/lib/mutations/member.js +73 -100
- package/lib/mutations/message.js +86 -48
- package/lib/mutations/pin.js +229 -0
- package/lib/mutations/subscription.js +56 -95
- package/lib/queries/channel.js +40 -84
- package/lib/queries/friend.js +29 -45
- package/lib/queries/index.js +37 -3
- package/lib/queries/member.js +29 -45
- package/lib/queries/memberblocks.js +207 -0
- package/lib/queries/message.js +56 -109
- package/lib/queries/pin.js +243 -0
- package/lib/queries/project.js +24 -41
- package/lib/queries/subscription.js +42 -78
- package/package.json +19 -45
- package/tsconfig.json +1 -0
- package//353/260/260/355/217/254/354/210/234/354/204/234.md +8 -0
- package/package copy.json +0 -74
package/LICENSE.md
CHANGED
package/deploy.sh
CHANGED
|
@@ -16,5 +16,5 @@ aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${V
|
|
|
16
16
|
elif [ "release" = "$1" ]; then
|
|
17
17
|
npm run build
|
|
18
18
|
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${VERSION}.min.js s3://ncloudchat/ --acl public-read
|
|
19
|
-
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${VERSION}.min.js s3://ncloudchat/ncloudchat-lastest.min.js --acl public-read
|
|
19
|
+
# aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${VERSION}.min.js s3://ncloudchat/ncloudchat-lastest.min.js --acl public-read
|
|
20
20
|
fi
|
package/esm/CloudChat.d.ts
CHANGED
|
@@ -1,56 +1,481 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) NBASE CORP. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ChannelInput, MarkInput, PinInput } from "./Type";
|
|
8
|
+
/**
|
|
9
|
+
* Class NCloudChat holds all the NCloudChat functionalities.
|
|
10
|
+
*
|
|
11
|
+
* @class
|
|
12
|
+
*/
|
|
2
13
|
export default class NCloudChat {
|
|
3
14
|
private dp;
|
|
4
15
|
private socket;
|
|
5
16
|
private connected;
|
|
6
17
|
private connectedCount;
|
|
7
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Create a `NCloudChat` instance and a Dispatcher.
|
|
20
|
+
*
|
|
21
|
+
* @constructs
|
|
22
|
+
*/
|
|
23
|
+
constructor(debug?: boolean);
|
|
8
24
|
clear(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Initialize a new `NCloudChat` instance of project and user.
|
|
27
|
+
*
|
|
28
|
+
* @function initialize
|
|
29
|
+
* @param {string} projectId - The id of a project.
|
|
30
|
+
*/
|
|
9
31
|
initialize(projectId: string): void;
|
|
10
32
|
getLang(): string;
|
|
11
33
|
getUser(): any;
|
|
34
|
+
getProjectId(): any;
|
|
12
35
|
setServerUrl(url: string): void;
|
|
13
36
|
setSocketUrl(url: string): void;
|
|
14
37
|
setProjectId(projectId: string): void;
|
|
15
38
|
setToken(token: string): void;
|
|
16
39
|
setUser(user: any): void;
|
|
40
|
+
private inputValidation;
|
|
41
|
+
/**
|
|
42
|
+
* Create a connection between a socket and a client.
|
|
43
|
+
*
|
|
44
|
+
* @async connect
|
|
45
|
+
* @param {any} user
|
|
46
|
+
* @param {string} userToken
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
17
49
|
connect(user: any, userToken?: string): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Mute channel notifications.
|
|
52
|
+
*
|
|
53
|
+
* @async
|
|
54
|
+
* @function mute
|
|
55
|
+
* @param {string} channel
|
|
56
|
+
* @returns {Promise<any>}
|
|
57
|
+
*/
|
|
18
58
|
mute(channel: string): Promise<any>;
|
|
59
|
+
/**
|
|
60
|
+
* Unmute channel notifications.
|
|
61
|
+
*
|
|
62
|
+
* @async
|
|
63
|
+
* @function unmute
|
|
64
|
+
* @param {string} channel
|
|
65
|
+
* @returns {Promise<any>}
|
|
66
|
+
*/
|
|
19
67
|
unmute(channel: string): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Subscribe a channel.
|
|
70
|
+
*
|
|
71
|
+
* @async
|
|
72
|
+
* @function subscibe
|
|
73
|
+
* @param {string} channel - The id of a channel.
|
|
74
|
+
* @param {any} option
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
20
77
|
subscribe(channel: string, option?: any): Promise<any>;
|
|
78
|
+
/**
|
|
79
|
+
* Unsubscribe from a channel.
|
|
80
|
+
*
|
|
81
|
+
* @async
|
|
82
|
+
* @function unsubscribe
|
|
83
|
+
* @param {string} channel - The id of a chennel
|
|
84
|
+
* @returns {Promise<any>}
|
|
85
|
+
*/
|
|
21
86
|
unsubscribe(channel: string): Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* Translate a message from a souce language to a target language.
|
|
89
|
+
*
|
|
90
|
+
* @async
|
|
91
|
+
* @function translateMessage
|
|
92
|
+
* @param {string} channelId - The id of a channel.
|
|
93
|
+
* @param {string} source - A source language.
|
|
94
|
+
* @param {string} target - A target language.
|
|
95
|
+
* @param {string} message - An message to be translated.
|
|
96
|
+
* @returns {Promise<any>}
|
|
97
|
+
*/
|
|
22
98
|
translateMessage(channelId: string, source: string, target: string, message: string): Promise<any>;
|
|
99
|
+
/**
|
|
100
|
+
* Send a message to a channel.
|
|
101
|
+
*
|
|
102
|
+
* @async
|
|
103
|
+
* @function sendMessage
|
|
104
|
+
* @param {string} channel - The id of a channel.
|
|
105
|
+
* @param {any} opt
|
|
106
|
+
* @returns {Promise<any>}
|
|
107
|
+
*/
|
|
23
108
|
sendMessage(channel: string, opt: any): Promise<any>;
|
|
109
|
+
/**
|
|
110
|
+
* Send an express message to a channel.
|
|
111
|
+
*
|
|
112
|
+
* @async
|
|
113
|
+
* @function sendExpressMessage
|
|
114
|
+
* @param {string} channel - The id of a channel.
|
|
115
|
+
* @param {any} opt
|
|
116
|
+
* @returns {Promise<any>}
|
|
117
|
+
*/
|
|
118
|
+
sendExpressMessage(channel: string, opt: any): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* Send an image to a channel. Only supports png, jpg, jpeg file types.
|
|
121
|
+
*
|
|
122
|
+
* @async
|
|
123
|
+
* @function sendImage
|
|
124
|
+
* @param {string} channelId - The id of a channel.
|
|
125
|
+
* @param {any} file - An image file.
|
|
126
|
+
* @returns {Promise<any>}
|
|
127
|
+
*/
|
|
24
128
|
sendImage(channelId: string, file: any): Promise<any>;
|
|
129
|
+
/**
|
|
130
|
+
* Update a message.
|
|
131
|
+
*
|
|
132
|
+
* @todo
|
|
133
|
+
* @async
|
|
134
|
+
* @function updateMessage
|
|
135
|
+
* @param {string} channel
|
|
136
|
+
* @param {string} message_id
|
|
137
|
+
* @param {string} message
|
|
138
|
+
*/
|
|
25
139
|
updateMessage(channel: string, message_id: string, message: string): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Delete a message.
|
|
142
|
+
* @async
|
|
143
|
+
* @function deleteMessage
|
|
144
|
+
* @param {string} channel
|
|
145
|
+
* @param {string} message_id
|
|
146
|
+
*/
|
|
26
147
|
deleteMessage(channel: string, message_id: string): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Disconnect from a socket.
|
|
150
|
+
*
|
|
151
|
+
* @async
|
|
152
|
+
* @function disconnect
|
|
153
|
+
* @returns
|
|
154
|
+
*/
|
|
27
155
|
disconnect(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Check if a client is connected to a socket.
|
|
158
|
+
*
|
|
159
|
+
* @function isConnected
|
|
160
|
+
* @returns {boolean}
|
|
161
|
+
*/
|
|
28
162
|
isConnected(): boolean;
|
|
163
|
+
isSocketConnected(): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Bind fn event handlers.
|
|
166
|
+
*
|
|
167
|
+
* @async
|
|
168
|
+
* @function bind
|
|
169
|
+
* @param {string} id
|
|
170
|
+
* @param {any} fn
|
|
171
|
+
*/
|
|
29
172
|
bind(id: string, fn: any): Promise<void>;
|
|
30
|
-
|
|
173
|
+
/**
|
|
174
|
+
* Unbind fn event handlers.
|
|
175
|
+
*
|
|
176
|
+
* @async
|
|
177
|
+
* @function unbind
|
|
178
|
+
* @param {string} id
|
|
179
|
+
* @param {any} fn
|
|
180
|
+
*/
|
|
181
|
+
unbind(id: string): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Unbind all event handlers.
|
|
184
|
+
* @param id
|
|
185
|
+
*/
|
|
31
186
|
unbindall(id: string): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Decodes a base-64 encoded string.
|
|
189
|
+
*
|
|
190
|
+
* @function ObjectId
|
|
191
|
+
* @param {string} id - An encoded string to be decoded.
|
|
192
|
+
* @returns {string} decoded string.
|
|
193
|
+
*/
|
|
32
194
|
ObjectId(id: string): string;
|
|
195
|
+
/**
|
|
196
|
+
* Get current friends list of all status.
|
|
197
|
+
*
|
|
198
|
+
* @async
|
|
199
|
+
* @function getFriendships
|
|
200
|
+
* @param {string} filter - Field value for filter.
|
|
201
|
+
* @param {string} sort - Field value for sorting.
|
|
202
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
203
|
+
* @returns {Promise<any>}
|
|
204
|
+
*/
|
|
33
205
|
getFriendships(filter: any, sort?: any, option?: any): Promise<any>;
|
|
34
|
-
|
|
35
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Get member blocks.
|
|
208
|
+
*
|
|
209
|
+
* @async
|
|
210
|
+
* @function getBannedUsers
|
|
211
|
+
* @param {string} filter - Field value for filter.
|
|
212
|
+
* @param {string} sort - Field value for sorting.
|
|
213
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
214
|
+
* @returns {Promise<any>}
|
|
215
|
+
*/
|
|
216
|
+
getBannedUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
217
|
+
/**
|
|
218
|
+
* Get information data of the member.
|
|
219
|
+
*
|
|
220
|
+
* @async
|
|
221
|
+
* @function getUsers
|
|
222
|
+
* @param {string} filter - Field value for filter.
|
|
223
|
+
* @param {string} sort - Field value for sorting.
|
|
224
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
225
|
+
* @returns {Promise<any>}
|
|
226
|
+
*/
|
|
227
|
+
getUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
228
|
+
/**
|
|
229
|
+
* Request a friendship to a user.
|
|
230
|
+
*
|
|
231
|
+
* @async
|
|
232
|
+
* @function requestFriend
|
|
233
|
+
* @param {string} friendId - An id of the friend to request.
|
|
234
|
+
* @returns {Promise<any>}
|
|
235
|
+
*/
|
|
36
236
|
requestFriend(friendId: string): Promise<any>;
|
|
237
|
+
/**
|
|
238
|
+
* Accept a friends request.
|
|
239
|
+
*
|
|
240
|
+
* @async
|
|
241
|
+
* @function acceptFriend
|
|
242
|
+
* @param {string} friendId - The id of the friend to accept the request.
|
|
243
|
+
* @returns {Promise<any>}
|
|
244
|
+
*/
|
|
37
245
|
acceptFriend(friendId: string): Promise<any>;
|
|
246
|
+
/**
|
|
247
|
+
* Reject a friend request.
|
|
248
|
+
*
|
|
249
|
+
* @async
|
|
250
|
+
* @function rejectFriend
|
|
251
|
+
* @param {string} friendId - An id of the friend to be rejected.
|
|
252
|
+
* @returns {Promise<any>}
|
|
253
|
+
*/
|
|
38
254
|
rejectFriend(friendId: string): Promise<any>;
|
|
255
|
+
/**
|
|
256
|
+
* Remove a friend.
|
|
257
|
+
*
|
|
258
|
+
* @async
|
|
259
|
+
* @function removeFriend
|
|
260
|
+
* @param {string} friendId - An id of the friend to be removed.
|
|
261
|
+
* @returns {Promise<any>}
|
|
262
|
+
*/
|
|
39
263
|
removeFriend(friendId: string): Promise<any>;
|
|
264
|
+
/**
|
|
265
|
+
* Get a count of unread messages of a channel.
|
|
266
|
+
*
|
|
267
|
+
* @async
|
|
268
|
+
* @function countUnread
|
|
269
|
+
* @param {string} channelId - The id of a channel.
|
|
270
|
+
* @returns {Promise<any>}
|
|
271
|
+
*/
|
|
40
272
|
countUnread(channelId: string): Promise<any>;
|
|
273
|
+
/**
|
|
274
|
+
* Get subscription data of the user.
|
|
275
|
+
*
|
|
276
|
+
* @async
|
|
277
|
+
* @function getSubscription
|
|
278
|
+
* @param {string} channelId - The id of a channel.
|
|
279
|
+
* @param {string} id
|
|
280
|
+
* @returns {Promise<any>}
|
|
281
|
+
*/
|
|
41
282
|
getSubscription(channelId: string, id: string): Promise<any>;
|
|
283
|
+
/**
|
|
284
|
+
* Get data of a single channel from the endpoint.
|
|
285
|
+
*
|
|
286
|
+
* @async
|
|
287
|
+
* @function getChannel
|
|
288
|
+
* @param {string} channelId - An id of the channel.
|
|
289
|
+
* @returns {Promise<any>} The data of the channel.
|
|
290
|
+
*/
|
|
42
291
|
getChannel(channelId: string): Promise<any>;
|
|
292
|
+
/**
|
|
293
|
+
* Get data of multiple channels.
|
|
294
|
+
*
|
|
295
|
+
* @async
|
|
296
|
+
* @function getChannels
|
|
297
|
+
* @param {string} filter - Field value for filter.
|
|
298
|
+
* @param {string} sort - Field value for sorting.
|
|
299
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
300
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
301
|
+
*/
|
|
302
|
+
getChannels(filter: any, sort?: any, option?: any): Promise<any>;
|
|
303
|
+
/**
|
|
304
|
+
* @async
|
|
305
|
+
* @function getMessage
|
|
306
|
+
* @param {string} channelId - The id of a channel.
|
|
307
|
+
* @param {string} messageId - The id of a message.
|
|
308
|
+
* @returns {Promise<any>}
|
|
309
|
+
*/
|
|
43
310
|
getMessage(channelId: string, messageId: string): Promise<any>;
|
|
311
|
+
/**
|
|
312
|
+
* Get data of the all messages.
|
|
313
|
+
*
|
|
314
|
+
* @async
|
|
315
|
+
* @function getMessages
|
|
316
|
+
* @param {string} filter - Field value for filter.
|
|
317
|
+
* @param {string} sort - Field value for sorting.
|
|
318
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
319
|
+
* @returns {Promise<any>}
|
|
320
|
+
*/
|
|
44
321
|
getMessages(filter: any, sort: any, option: any): Promise<any>;
|
|
322
|
+
/**
|
|
323
|
+
* Get a list of subscibed member of the channel.
|
|
324
|
+
* @param {string} filter - Field value for filter.
|
|
325
|
+
* @param {string} sort - Field value for sorting.
|
|
326
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
327
|
+
* @returns {Promise<any>}
|
|
328
|
+
*/
|
|
45
329
|
getSubscriptions(filter: any, sort: any, option: any): Promise<any>;
|
|
330
|
+
/**
|
|
331
|
+
* Create a new channel.
|
|
332
|
+
*
|
|
333
|
+
* @async
|
|
334
|
+
* @function createChannel
|
|
335
|
+
* @param {ChannelInput} channel - Configuration options of the new channel.
|
|
336
|
+
* @returns {Promise<any>} The data of the newly created channel.
|
|
337
|
+
*/
|
|
46
338
|
createChannel(channel: ChannelInput): Promise<any>;
|
|
339
|
+
/**
|
|
340
|
+
* Update channel options.
|
|
341
|
+
*
|
|
342
|
+
* @async
|
|
343
|
+
* @function updateChannel
|
|
344
|
+
* @param {string} channelId - An id of the channel.
|
|
345
|
+
* @param {ChannelInput} channel - New options of the channel.
|
|
346
|
+
* @returns {Promise<any>} The data of the updated channel.
|
|
347
|
+
*/
|
|
47
348
|
updateChannel(channelId: string, channel: ChannelInput): Promise<any>;
|
|
349
|
+
/**
|
|
350
|
+
* Delete a channel.
|
|
351
|
+
*
|
|
352
|
+
* @async
|
|
353
|
+
* @function deleteChannel
|
|
354
|
+
* @param {string} channelId - An channel id.
|
|
355
|
+
* @returns {Promise<any>}
|
|
356
|
+
*/
|
|
48
357
|
deleteChannel(channelId: string): Promise<any>;
|
|
358
|
+
/**
|
|
359
|
+
* Update a subscription information, such as marking message read.
|
|
360
|
+
*
|
|
361
|
+
* @async
|
|
362
|
+
* @function markRead
|
|
363
|
+
* @param {string} channelId - The id of a channel.
|
|
364
|
+
* @param {MarkInput} mark
|
|
365
|
+
* @param {string} option
|
|
366
|
+
* @returns {Promise<any>}
|
|
367
|
+
*/
|
|
49
368
|
markRead(channelId: string, mark: MarkInput, option?: any): Promise<any>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
369
|
+
/**
|
|
370
|
+
* Add members to the private channel.
|
|
371
|
+
*
|
|
372
|
+
* @async
|
|
373
|
+
* @function addUsers
|
|
374
|
+
* @param {string} channelId - An private channel id.
|
|
375
|
+
* @param {string[]} userIds - An array of member ids to be added.
|
|
376
|
+
* @param {any} options
|
|
377
|
+
* @returns {Promise<any>}
|
|
378
|
+
*/
|
|
379
|
+
addUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
380
|
+
/**
|
|
381
|
+
* Remove members from the private channel.
|
|
382
|
+
*
|
|
383
|
+
* @async
|
|
384
|
+
* @function removeUsers
|
|
385
|
+
* @param {string} channelId - An private channel id.
|
|
386
|
+
* @param {string[]} userIds - An array of the member ids to be deleted.
|
|
387
|
+
* @param {any} options
|
|
388
|
+
* @returns {Promise<any>}
|
|
389
|
+
*/
|
|
390
|
+
removeUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
391
|
+
/**
|
|
392
|
+
* Emit "start typing" to a conneted socket.
|
|
393
|
+
*
|
|
394
|
+
* @async
|
|
395
|
+
* @function startTyping
|
|
396
|
+
* @param {string} channelId - The id of a channel that the typing is happening.
|
|
397
|
+
* @param {string} threadId - The id of a thread that the typing is happening.
|
|
398
|
+
* @returns {Promise<any>}
|
|
399
|
+
*/
|
|
400
|
+
startTyping(channelId: string, threadId?: string): Promise<{
|
|
401
|
+
channelId: string;
|
|
402
|
+
threadId: string;
|
|
403
|
+
}>;
|
|
404
|
+
/**
|
|
405
|
+
* Emit "stop typing" to a connected socket.
|
|
406
|
+
*
|
|
407
|
+
* @async
|
|
408
|
+
* @function
|
|
409
|
+
* @param {string} channelId - The id of a channel that the typing is stopped.
|
|
410
|
+
* @param {string} threadId - The id of a thread that the typing is stopped.
|
|
411
|
+
* @returns {Promise<any>}
|
|
412
|
+
*/
|
|
413
|
+
stopTyping(channelId: string, threadId?: string): Promise<{
|
|
414
|
+
channelId: string;
|
|
415
|
+
threadId: string;
|
|
416
|
+
}>;
|
|
417
|
+
/**
|
|
418
|
+
* Ban a member from a channel.
|
|
419
|
+
*
|
|
420
|
+
* @async
|
|
421
|
+
* @function banUser
|
|
422
|
+
* @param {string} channelId - The id of a channel.
|
|
423
|
+
* @param {string} memberId - The id of a member.
|
|
424
|
+
* @param {any} options
|
|
425
|
+
* @returns {Promise<any>}
|
|
426
|
+
*/
|
|
54
427
|
banUser(channelId: string, memberId: string, options?: any): Promise<any>;
|
|
428
|
+
/**
|
|
429
|
+
* Unban a member from a channel.
|
|
430
|
+
*
|
|
431
|
+
* @async
|
|
432
|
+
* @function unbanUser
|
|
433
|
+
* @param {string} channelId - The id of a channel.
|
|
434
|
+
* @param {string} memberId - The id of a member.
|
|
435
|
+
* @returns {Promise<any>}
|
|
436
|
+
*/
|
|
55
437
|
unbanUser(channelId: string, memberId: string): Promise<any>;
|
|
438
|
+
/**
|
|
439
|
+
* Get data of a single pin from the endpoint.
|
|
440
|
+
*
|
|
441
|
+
* @async
|
|
442
|
+
* @function getPin
|
|
443
|
+
* @param {string} channelId - An id of the channel.
|
|
444
|
+
* @param {string} id - An id of the pin.
|
|
445
|
+
* @returns {Promise<any>} The data of the pin.
|
|
446
|
+
*/
|
|
447
|
+
getPin(channelId: string, id: string): Promise<any>;
|
|
448
|
+
/**
|
|
449
|
+
* Get data of multiple pins.
|
|
450
|
+
*
|
|
451
|
+
* @async
|
|
452
|
+
* @function getPins
|
|
453
|
+
* @param {string} channelId - An id of the channel.
|
|
454
|
+
* @param {string} filter - Field value for filter.
|
|
455
|
+
* @param {string} sort - Field value for sorting.
|
|
456
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
457
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
458
|
+
*/
|
|
459
|
+
getPins(channelId: string, filter: any, sort?: any, option?: any): Promise<any>;
|
|
460
|
+
/**
|
|
461
|
+
* Create a new pin.
|
|
462
|
+
*
|
|
463
|
+
* @async
|
|
464
|
+
* @function createPin
|
|
465
|
+
* @param {string} channelId - An id of the channel.
|
|
466
|
+
* @param {PinInput} pin - Configuration options of the new pin.
|
|
467
|
+
* @returns {Promise<any>} The data of the newly created pin.
|
|
468
|
+
*/
|
|
469
|
+
createPin(channelId: string, pin: PinInput): Promise<any>;
|
|
470
|
+
/**
|
|
471
|
+
* Update pin options.
|
|
472
|
+
*
|
|
473
|
+
* @async
|
|
474
|
+
* @function updatePin
|
|
475
|
+
* @param {string} channelId - An id of the channel.
|
|
476
|
+
* @param {PinInput} pin - New options of the pin.
|
|
477
|
+
* @returns {Promise<any>} The data of the updated pin.
|
|
478
|
+
*/
|
|
479
|
+
updatePin(pinId: string, channelId: string, pin: PinInput): Promise<any>;
|
|
480
|
+
getServerUrl(): Promise<any>;
|
|
56
481
|
}
|