ncloudchat 1.0.35 → 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/LICENSE.md +2 -2
- package/README.md +17 -39
- package/deploy.sh.bak +20 -0
- package/{ncloudchat.d.ts → dist/ncloudchat.d.ts} +0 -0
- package/{ncloudchat.min.js → dist/ncloudchat.min.js} +0 -0
- package/esm/CloudChat.d.ts +482 -0
- package/esm/CloudChat.js +1746 -0
- package/esm/CloudChat.js.map +1 -0
- package/esm/CoreManager.d.ts +11 -0
- package/esm/CoreManager.js +38 -0
- package/esm/CoreManager.js.map +1 -0
- package/esm/Dispatcher.d.ts +37 -0
- package/esm/Dispatcher.js +95 -0
- package/esm/Dispatcher.js.map +1 -0
- package/esm/Network.d.ts +7 -0
- package/esm/Network.js +103 -0
- package/esm/Network.js.map +1 -0
- package/esm/Type.d.ts +79 -0
- package/esm/Type.js +31 -0
- package/esm/Type.js.map +1 -0
- package/esm/Util.d.ts +15 -0
- package/esm/Util.js +23 -0
- package/esm/Util.js.map +1 -0
- package/esm/graphql/channel.d.ts +13 -0
- package/esm/graphql/channel.js +19 -0
- package/esm/graphql/channel.js.map +1 -0
- package/esm/graphql/friend.d.ts +11 -0
- package/esm/graphql/friend.js +16 -0
- package/esm/graphql/friend.js.map +1 -0
- package/esm/graphql/invite.d.ts +7 -0
- package/esm/graphql/invite.js +11 -0
- package/esm/graphql/invite.js.map +1 -0
- package/esm/graphql/member.d.ts +11 -0
- package/esm/graphql/member.js +16 -0
- package/esm/graphql/member.js.map +1 -0
- package/esm/graphql/message.d.ts +11 -0
- package/esm/graphql/message.js +16 -0
- package/esm/graphql/message.js.map +1 -0
- package/esm/graphql/pin.d.ts +10 -0
- package/esm/graphql/pin.js +15 -0
- package/esm/graphql/pin.js.map +1 -0
- package/esm/graphql/project.d.ts +6 -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 +16 -0
- package/esm/graphql/subscription.js.map +1 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +15 -0
- package/esm/index.js.map +1 -0
- package/esm/logger.d.ts +10 -0
- package/esm/logger.js +22 -0
- package/esm/logger.js.map +1 -0
- package/esm/mutations/channel.d.ts +56 -0
- package/esm/mutations/channel.js +181 -0
- package/esm/mutations/channel.js.map +1 -0
- package/esm/mutations/friend.d.ts +42 -0
- package/esm/mutations/friend.js +132 -0
- package/esm/mutations/friend.js.map +1 -0
- package/esm/mutations/index.d.ts +13 -0
- package/esm/mutations/index.js +30 -0
- package/esm/mutations/index.js.map +1 -0
- package/esm/mutations/invite.d.ts +16 -0
- package/esm/mutations/invite.js +74 -0
- package/esm/mutations/invite.js.map +1 -0
- package/esm/mutations/member.d.ts +41 -0
- package/esm/mutations/member.js +138 -0
- package/esm/mutations/member.js.map +1 -0
- package/esm/mutations/message.d.ts +37 -0
- package/esm/mutations/message.js +141 -0
- package/esm/mutations/message.js.map +1 -0
- package/esm/mutations/pin.d.ts +28 -0
- package/esm/mutations/pin.js +96 -0
- package/esm/mutations/pin.js.map +1 -0
- package/esm/mutations/subscription.d.ts +37 -0
- package/esm/mutations/subscription.js +124 -0
- package/esm/mutations/subscription.js.map +1 -0
- package/esm/queries/channel.d.ts +26 -0
- package/esm/queries/channel.js +96 -0
- package/esm/queries/channel.js.map +1 -0
- package/esm/queries/friend.d.ts +17 -0
- package/esm/queries/friend.js +76 -0
- package/esm/queries/friend.js.map +1 -0
- package/esm/queries/index.d.ts +14 -0
- package/esm/queries/index.js +31 -0
- package/esm/queries/index.js.map +1 -0
- package/esm/queries/member.d.ts +17 -0
- package/esm/queries/member.js +76 -0
- package/esm/queries/member.js.map +1 -0
- package/esm/queries/memberblocks.d.ts +17 -0
- package/esm/queries/memberblocks.js +76 -0
- package/esm/queries/memberblocks.js.map +1 -0
- package/esm/queries/message.d.ts +36 -0
- package/esm/queries/message.js +118 -0
- package/esm/queries/message.js.map +1 -0
- package/esm/queries/pin.d.ts +28 -0
- package/esm/queries/pin.js +100 -0
- package/esm/queries/pin.js.map +1 -0
- package/esm/queries/project.d.ts +14 -0
- package/esm/queries/project.js +23 -0
- package/esm/queries/project.js.map +1 -0
- package/esm/queries/subscription.d.ts +27 -0
- package/esm/queries/subscription.js +98 -0
- package/esm/queries/subscription.js.map +1 -0
- package/package.json +38 -19
- package/tsconfig.json +32 -0
- package/types/exif.d.ts +10 -0
- package/types/window.d.ts +5 -0
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2022 NBASE <dev@itsb.io>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
## 실행 방법
|
|
2
|
+
npm install
|
|
3
|
+
npm start
|
|
4
|
+
|
|
5
|
+
빌드
|
|
6
|
+
npm run build
|
|
7
|
+
|
|
8
|
+
## 배포 방법 설명
|
|
9
|
+
각 패키지별 배포 방법을 안내 합니다.
|
|
10
|
+
### Ncloud Chat Version
|
|
11
|
+
네이버 클라우드용 SDK 배포 방법
|
|
12
|
+
npm run deploy
|
|
13
|
+
해당 프로젝트 폴더로 이동 후
|
|
14
|
+
패키지 버전 변경 후
|
|
15
|
+
npm publish
|
|
16
|
+
### NBase Chat Version
|
|
17
|
+
NBASE 용 SDK 배포 방법 설명
|
|
3
18
|
|
|
4
|
-
|
|
5
|
-
Describe how to use the software development kit (SDK) to use Ncloud Chat written in Javascript.
|
|
6
|
-
|
|
7
|
-
## Requirements
|
|
8
|
-
|
|
9
|
-
Requirements to use Ncloud Chat JavaScript SDK are as follows.
|
|
10
|
-
|
|
11
|
-
* Microsoft Edge 13 or later
|
|
12
|
-
* Chrome 16 or later
|
|
13
|
-
* Firewall 11 or later
|
|
14
|
-
* Safari 7 or later
|
|
15
|
-
* Opera 12.1 or later
|
|
16
|
-
* iOS Safari 7 or later
|
|
17
|
-
* Android Browser 4.4 (Kitkat) or later
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```html
|
|
21
|
-
<head>
|
|
22
|
-
<script src="https://unpkg.com/ncloudchat@[VERSION]/ncloudchat.min.js"></script>
|
|
23
|
-
</head>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Version information can be found at https://www.npmjs.com/package/ncloudchat.
|
|
27
|
-
|
|
28
|
-
The Ncloud Chat Javascript SDK is provided as an npm package and is also available through yarn.
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
# using npm
|
|
32
|
-
npm install ncloudchat
|
|
33
|
-
|
|
34
|
-
# using yarn
|
|
35
|
-
yarn add ncloudchat
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Javscript Guide Link
|
|
39
|
-
|
|
40
|
-
<a target="_blank" href="https://guide.ncloud-docs.com/docs/bizapp-ncloudchat-javascriptsdk">https://guide.ncloud-docs.com/docs/bizapp-ncloudchat-javascriptsdk</a>
|
package/deploy.sh.bak
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
VERSION='';
|
|
2
|
+
re="\"(version)\": \"([^\"]*)\"";
|
|
3
|
+
|
|
4
|
+
while read -r l; do
|
|
5
|
+
if [[ $l =~ $re ]]; then
|
|
6
|
+
value="${BASH_REMATCH[2]}";
|
|
7
|
+
VERSION="$value";
|
|
8
|
+
fi
|
|
9
|
+
done < package.json;
|
|
10
|
+
|
|
11
|
+
if [ "dev" == "$1" ]; then
|
|
12
|
+
npm run build
|
|
13
|
+
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${VERSION}.min.js s3://ncloudchat/dev/ --acl public-read
|
|
14
|
+
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat-${VERSION}.min.js s3://ncloudchat/dev/ncloudchat-lastest.min.js --acl public-read
|
|
15
|
+
|
|
16
|
+
elif [ "release" = "$1" ]; then
|
|
17
|
+
npm run build
|
|
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
|
|
20
|
+
fi
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,482 @@
|
|
|
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
|
+
*/
|
|
13
|
+
export default class NCloudChat {
|
|
14
|
+
private dp;
|
|
15
|
+
private socket;
|
|
16
|
+
private connected;
|
|
17
|
+
private connectedCount;
|
|
18
|
+
/**
|
|
19
|
+
* Create a `NCloudChat` instance and a Dispatcher.
|
|
20
|
+
*
|
|
21
|
+
* @constructs
|
|
22
|
+
*/
|
|
23
|
+
constructor(debug?: boolean);
|
|
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
|
+
*/
|
|
31
|
+
initialize(projectId: string): void;
|
|
32
|
+
getLang(): any;
|
|
33
|
+
setLang(lang: string): void;
|
|
34
|
+
getUser(): any;
|
|
35
|
+
getProjectId(): any;
|
|
36
|
+
setServerUrl(url: string): void;
|
|
37
|
+
setSocketUrl(url: string): void;
|
|
38
|
+
setProjectId(projectId: string): void;
|
|
39
|
+
setToken(token: string): void;
|
|
40
|
+
setUser(user: any): void;
|
|
41
|
+
private inputValidation;
|
|
42
|
+
/**
|
|
43
|
+
* Create a connection between a socket and a client.
|
|
44
|
+
*
|
|
45
|
+
* @async connect
|
|
46
|
+
* @param {any} user
|
|
47
|
+
* @param {string} userToken
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
connect(user: any, userToken?: string): Promise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Mute channel notifications.
|
|
53
|
+
*
|
|
54
|
+
* @async
|
|
55
|
+
* @function mute
|
|
56
|
+
* @param {string} channel
|
|
57
|
+
* @returns {Promise<any>}
|
|
58
|
+
*/
|
|
59
|
+
mute(channel: string): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* Unmute channel notifications.
|
|
62
|
+
*
|
|
63
|
+
* @async
|
|
64
|
+
* @function unmute
|
|
65
|
+
* @param {string} channel
|
|
66
|
+
* @returns {Promise<any>}
|
|
67
|
+
*/
|
|
68
|
+
unmute(channel: string): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Subscribe a channel.
|
|
71
|
+
*
|
|
72
|
+
* @async
|
|
73
|
+
* @function subscibe
|
|
74
|
+
* @param {string} channel - The id of a channel.
|
|
75
|
+
* @param {any} option
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
subscribe(channel: string, option?: any): Promise<any>;
|
|
79
|
+
/**
|
|
80
|
+
* Unsubscribe from a channel.
|
|
81
|
+
*
|
|
82
|
+
* @async
|
|
83
|
+
* @function unsubscribe
|
|
84
|
+
* @param {string} channel - The id of a chennel
|
|
85
|
+
* @returns {Promise<any>}
|
|
86
|
+
*/
|
|
87
|
+
unsubscribe(channel: string): Promise<any>;
|
|
88
|
+
/**
|
|
89
|
+
* Translate a message from a souce language to a target language.
|
|
90
|
+
*
|
|
91
|
+
* @async
|
|
92
|
+
* @function translateMessage
|
|
93
|
+
* @param {string} channelId - The id of a channel.
|
|
94
|
+
* @param {string} source - A source language.
|
|
95
|
+
* @param {string} target - A target language.
|
|
96
|
+
* @param {string} message - An message to be translated.
|
|
97
|
+
* @returns {Promise<any>}
|
|
98
|
+
*/
|
|
99
|
+
translateMessage(channelId: string, source: string, target: string, message: string): Promise<any>;
|
|
100
|
+
/**
|
|
101
|
+
* Send a message to a channel.
|
|
102
|
+
*
|
|
103
|
+
* @async
|
|
104
|
+
* @function sendMessage
|
|
105
|
+
* @param {string} channel - The id of a channel.
|
|
106
|
+
* @param {any} opt
|
|
107
|
+
* @returns {Promise<any>}
|
|
108
|
+
*/
|
|
109
|
+
sendMessage(channel: string, opt: any): Promise<any>;
|
|
110
|
+
/**
|
|
111
|
+
* Send an express message to a channel.
|
|
112
|
+
*
|
|
113
|
+
* @async
|
|
114
|
+
* @function sendExpressMessage
|
|
115
|
+
* @param {string} channel - The id of a channel.
|
|
116
|
+
* @param {any} opt
|
|
117
|
+
* @returns {Promise<any>}
|
|
118
|
+
*/
|
|
119
|
+
sendExpressMessage(channel: string, opt: any): Promise<any>;
|
|
120
|
+
/**
|
|
121
|
+
* Send an image to a channel. Only supports png, jpg, jpeg file types.
|
|
122
|
+
*
|
|
123
|
+
* @async
|
|
124
|
+
* @function sendImage
|
|
125
|
+
* @param {string} channelId - The id of a channel.
|
|
126
|
+
* @param {any} file - An image file.
|
|
127
|
+
* @returns {Promise<any>}
|
|
128
|
+
*/
|
|
129
|
+
sendImage(channelId: string, file: any): Promise<any>;
|
|
130
|
+
/**
|
|
131
|
+
* Update a message.
|
|
132
|
+
*
|
|
133
|
+
* @todo
|
|
134
|
+
* @async
|
|
135
|
+
* @function updateMessage
|
|
136
|
+
* @param {string} channel
|
|
137
|
+
* @param {string} message_id
|
|
138
|
+
* @param {string} message
|
|
139
|
+
*/
|
|
140
|
+
updateMessage(channel: string, message_id: string, message: string): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Delete a message.
|
|
143
|
+
* @async
|
|
144
|
+
* @function deleteMessage
|
|
145
|
+
* @param {string} channel
|
|
146
|
+
* @param {string} message_id
|
|
147
|
+
*/
|
|
148
|
+
deleteMessage(channel: string, message_id: string): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Disconnect from a socket.
|
|
151
|
+
*
|
|
152
|
+
* @async
|
|
153
|
+
* @function disconnect
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
disconnect(): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Check if a client is connected to a socket.
|
|
159
|
+
*
|
|
160
|
+
* @function isConnected
|
|
161
|
+
* @returns {boolean}
|
|
162
|
+
*/
|
|
163
|
+
isConnected(): boolean;
|
|
164
|
+
isSocketConnected(): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Bind fn event handlers.
|
|
167
|
+
*
|
|
168
|
+
* @async
|
|
169
|
+
* @function bind
|
|
170
|
+
* @param {string} id
|
|
171
|
+
* @param {any} fn
|
|
172
|
+
*/
|
|
173
|
+
bind(id: string, fn: any): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Unbind fn event handlers.
|
|
176
|
+
*
|
|
177
|
+
* @async
|
|
178
|
+
* @function unbind
|
|
179
|
+
* @param {string} id
|
|
180
|
+
* @param {any} fn
|
|
181
|
+
*/
|
|
182
|
+
unbind(id: string): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* Unbind all event handlers.
|
|
185
|
+
* @param id
|
|
186
|
+
*/
|
|
187
|
+
unbindall(id: string): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Decodes a base-64 encoded string.
|
|
190
|
+
*
|
|
191
|
+
* @function ObjectId
|
|
192
|
+
* @param {string} id - An encoded string to be decoded.
|
|
193
|
+
* @returns {string} decoded string.
|
|
194
|
+
*/
|
|
195
|
+
ObjectId(id: string): string;
|
|
196
|
+
/**
|
|
197
|
+
* Get current friends list of all status.
|
|
198
|
+
*
|
|
199
|
+
* @async
|
|
200
|
+
* @function getFriendships
|
|
201
|
+
* @param {string} filter - Field value for filter.
|
|
202
|
+
* @param {string} sort - Field value for sorting.
|
|
203
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
204
|
+
* @returns {Promise<any>}
|
|
205
|
+
*/
|
|
206
|
+
getFriendships(filter: any, sort?: any, option?: any): Promise<any>;
|
|
207
|
+
/**
|
|
208
|
+
* Get member blocks.
|
|
209
|
+
*
|
|
210
|
+
* @async
|
|
211
|
+
* @function getBannedUsers
|
|
212
|
+
* @param {string} filter - Field value for filter.
|
|
213
|
+
* @param {string} sort - Field value for sorting.
|
|
214
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
215
|
+
* @returns {Promise<any>}
|
|
216
|
+
*/
|
|
217
|
+
getBannedUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
218
|
+
/**
|
|
219
|
+
* Get information data of the member.
|
|
220
|
+
*
|
|
221
|
+
* @async
|
|
222
|
+
* @function getUsers
|
|
223
|
+
* @param {string} filter - Field value for filter.
|
|
224
|
+
* @param {string} sort - Field value for sorting.
|
|
225
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
226
|
+
* @returns {Promise<any>}
|
|
227
|
+
*/
|
|
228
|
+
getUsers(filter: any, sort?: any, option?: any): Promise<any>;
|
|
229
|
+
/**
|
|
230
|
+
* Request a friendship to a user.
|
|
231
|
+
*
|
|
232
|
+
* @async
|
|
233
|
+
* @function requestFriend
|
|
234
|
+
* @param {string} friendId - An id of the friend to request.
|
|
235
|
+
* @returns {Promise<any>}
|
|
236
|
+
*/
|
|
237
|
+
requestFriend(friendId: string): Promise<any>;
|
|
238
|
+
/**
|
|
239
|
+
* Accept a friends request.
|
|
240
|
+
*
|
|
241
|
+
* @async
|
|
242
|
+
* @function acceptFriend
|
|
243
|
+
* @param {string} friendId - The id of the friend to accept the request.
|
|
244
|
+
* @returns {Promise<any>}
|
|
245
|
+
*/
|
|
246
|
+
acceptFriend(friendId: string): Promise<any>;
|
|
247
|
+
/**
|
|
248
|
+
* Reject a friend request.
|
|
249
|
+
*
|
|
250
|
+
* @async
|
|
251
|
+
* @function rejectFriend
|
|
252
|
+
* @param {string} friendId - An id of the friend to be rejected.
|
|
253
|
+
* @returns {Promise<any>}
|
|
254
|
+
*/
|
|
255
|
+
rejectFriend(friendId: string): Promise<any>;
|
|
256
|
+
/**
|
|
257
|
+
* Remove a friend.
|
|
258
|
+
*
|
|
259
|
+
* @async
|
|
260
|
+
* @function removeFriend
|
|
261
|
+
* @param {string} friendId - An id of the friend to be removed.
|
|
262
|
+
* @returns {Promise<any>}
|
|
263
|
+
*/
|
|
264
|
+
removeFriend(friendId: string): Promise<any>;
|
|
265
|
+
/**
|
|
266
|
+
* Get a count of unread messages of a channel.
|
|
267
|
+
*
|
|
268
|
+
* @async
|
|
269
|
+
* @function countUnread
|
|
270
|
+
* @param {string} channelId - The id of a channel.
|
|
271
|
+
* @returns {Promise<any>}
|
|
272
|
+
*/
|
|
273
|
+
countUnread(channelId: string): Promise<any>;
|
|
274
|
+
/**
|
|
275
|
+
* Get subscription data of the user.
|
|
276
|
+
*
|
|
277
|
+
* @async
|
|
278
|
+
* @function getSubscription
|
|
279
|
+
* @param {string} channelId - The id of a channel.
|
|
280
|
+
* @param {string} id
|
|
281
|
+
* @returns {Promise<any>}
|
|
282
|
+
*/
|
|
283
|
+
getSubscription(channelId: string, id: string): Promise<any>;
|
|
284
|
+
/**
|
|
285
|
+
* Get data of a single channel from the endpoint.
|
|
286
|
+
*
|
|
287
|
+
* @async
|
|
288
|
+
* @function getChannel
|
|
289
|
+
* @param {string} channelId - An id of the channel.
|
|
290
|
+
* @returns {Promise<any>} The data of the channel.
|
|
291
|
+
*/
|
|
292
|
+
getChannel(channelId: string): Promise<any>;
|
|
293
|
+
/**
|
|
294
|
+
* Get data of multiple channels.
|
|
295
|
+
*
|
|
296
|
+
* @async
|
|
297
|
+
* @function getChannels
|
|
298
|
+
* @param {string} filter - Field value for filter.
|
|
299
|
+
* @param {string} sort - Field value for sorting.
|
|
300
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
301
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
302
|
+
*/
|
|
303
|
+
getChannels(filter: any, sort?: any, option?: any): Promise<any>;
|
|
304
|
+
/**
|
|
305
|
+
* @async
|
|
306
|
+
* @function getMessage
|
|
307
|
+
* @param {string} channelId - The id of a channel.
|
|
308
|
+
* @param {string} messageId - The id of a message.
|
|
309
|
+
* @returns {Promise<any>}
|
|
310
|
+
*/
|
|
311
|
+
getMessage(channelId: string, messageId: string): Promise<any>;
|
|
312
|
+
/**
|
|
313
|
+
* Get data of the all messages.
|
|
314
|
+
*
|
|
315
|
+
* @async
|
|
316
|
+
* @function getMessages
|
|
317
|
+
* @param {string} filter - Field value for filter.
|
|
318
|
+
* @param {string} sort - Field value for sorting.
|
|
319
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
320
|
+
* @returns {Promise<any>}
|
|
321
|
+
*/
|
|
322
|
+
getMessages(filter: any, sort: any, option: any): Promise<any>;
|
|
323
|
+
/**
|
|
324
|
+
* Get a list of subscibed member of the channel.
|
|
325
|
+
* @param {string} filter - Field value for filter.
|
|
326
|
+
* @param {string} sort - Field value for sorting.
|
|
327
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
328
|
+
* @returns {Promise<any>}
|
|
329
|
+
*/
|
|
330
|
+
getSubscriptions(filter: any, sort: any, option: any): Promise<any>;
|
|
331
|
+
/**
|
|
332
|
+
* Create a new channel.
|
|
333
|
+
*
|
|
334
|
+
* @async
|
|
335
|
+
* @function createChannel
|
|
336
|
+
* @param {ChannelInput} channel - Configuration options of the new channel.
|
|
337
|
+
* @returns {Promise<any>} The data of the newly created channel.
|
|
338
|
+
*/
|
|
339
|
+
createChannel(channel: ChannelInput): Promise<any>;
|
|
340
|
+
/**
|
|
341
|
+
* Update channel options.
|
|
342
|
+
*
|
|
343
|
+
* @async
|
|
344
|
+
* @function updateChannel
|
|
345
|
+
* @param {string} channelId - An id of the channel.
|
|
346
|
+
* @param {ChannelInput} channel - New options of the channel.
|
|
347
|
+
* @returns {Promise<any>} The data of the updated channel.
|
|
348
|
+
*/
|
|
349
|
+
updateChannel(channelId: string, channel: ChannelInput): Promise<any>;
|
|
350
|
+
/**
|
|
351
|
+
* Delete a channel.
|
|
352
|
+
*
|
|
353
|
+
* @async
|
|
354
|
+
* @function deleteChannel
|
|
355
|
+
* @param {string} channelId - An channel id.
|
|
356
|
+
* @returns {Promise<any>}
|
|
357
|
+
*/
|
|
358
|
+
deleteChannel(channelId: string): Promise<any>;
|
|
359
|
+
/**
|
|
360
|
+
* Update a subscription information, such as marking message read.
|
|
361
|
+
*
|
|
362
|
+
* @async
|
|
363
|
+
* @function markRead
|
|
364
|
+
* @param {string} channelId - The id of a channel.
|
|
365
|
+
* @param {MarkInput} mark
|
|
366
|
+
* @param {string} option
|
|
367
|
+
* @returns {Promise<any>}
|
|
368
|
+
*/
|
|
369
|
+
markRead(channelId: string, mark: MarkInput, option?: any): Promise<any>;
|
|
370
|
+
/**
|
|
371
|
+
* Add members to the private channel.
|
|
372
|
+
*
|
|
373
|
+
* @async
|
|
374
|
+
* @function addUsers
|
|
375
|
+
* @param {string} channelId - An private channel id.
|
|
376
|
+
* @param {string[]} userIds - An array of member ids to be added.
|
|
377
|
+
* @param {any} options
|
|
378
|
+
* @returns {Promise<any>}
|
|
379
|
+
*/
|
|
380
|
+
addUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
381
|
+
/**
|
|
382
|
+
* Remove members from the private channel.
|
|
383
|
+
*
|
|
384
|
+
* @async
|
|
385
|
+
* @function removeUsers
|
|
386
|
+
* @param {string} channelId - An private channel id.
|
|
387
|
+
* @param {string[]} userIds - An array of the member ids to be deleted.
|
|
388
|
+
* @param {any} options
|
|
389
|
+
* @returns {Promise<any>}
|
|
390
|
+
*/
|
|
391
|
+
removeUsers(channelId: string, userIds: any, options: any): Promise<any>;
|
|
392
|
+
/**
|
|
393
|
+
* Emit "start typing" to a conneted socket.
|
|
394
|
+
*
|
|
395
|
+
* @async
|
|
396
|
+
* @function startTyping
|
|
397
|
+
* @param {string} channelId - The id of a channel that the typing is happening.
|
|
398
|
+
* @param {string} threadId - The id of a thread that the typing is happening.
|
|
399
|
+
* @returns {Promise<any>}
|
|
400
|
+
*/
|
|
401
|
+
startTyping(channelId: string, threadId?: string): Promise<{
|
|
402
|
+
channelId: string;
|
|
403
|
+
threadId: string;
|
|
404
|
+
}>;
|
|
405
|
+
/**
|
|
406
|
+
* Emit "stop typing" to a connected socket.
|
|
407
|
+
*
|
|
408
|
+
* @async
|
|
409
|
+
* @function
|
|
410
|
+
* @param {string} channelId - The id of a channel that the typing is stopped.
|
|
411
|
+
* @param {string} threadId - The id of a thread that the typing is stopped.
|
|
412
|
+
* @returns {Promise<any>}
|
|
413
|
+
*/
|
|
414
|
+
stopTyping(channelId: string, threadId?: string): Promise<{
|
|
415
|
+
channelId: string;
|
|
416
|
+
threadId: string;
|
|
417
|
+
}>;
|
|
418
|
+
/**
|
|
419
|
+
* Ban a member from a channel.
|
|
420
|
+
*
|
|
421
|
+
* @async
|
|
422
|
+
* @function banUser
|
|
423
|
+
* @param {string} channelId - The id of a channel.
|
|
424
|
+
* @param {string} memberId - The id of a member.
|
|
425
|
+
* @param {any} options
|
|
426
|
+
* @returns {Promise<any>}
|
|
427
|
+
*/
|
|
428
|
+
banUser(channelId: string, memberId: string, options?: any): Promise<any>;
|
|
429
|
+
/**
|
|
430
|
+
* Unban a member from a channel.
|
|
431
|
+
*
|
|
432
|
+
* @async
|
|
433
|
+
* @function unbanUser
|
|
434
|
+
* @param {string} channelId - The id of a channel.
|
|
435
|
+
* @param {string} memberId - The id of a member.
|
|
436
|
+
* @returns {Promise<any>}
|
|
437
|
+
*/
|
|
438
|
+
unbanUser(channelId: string, memberId: string): Promise<any>;
|
|
439
|
+
/**
|
|
440
|
+
* Get data of a single pin from the endpoint.
|
|
441
|
+
*
|
|
442
|
+
* @async
|
|
443
|
+
* @function getPin
|
|
444
|
+
* @param {string} channelId - An id of the channel.
|
|
445
|
+
* @param {string} id - An id of the pin.
|
|
446
|
+
* @returns {Promise<any>} The data of the pin.
|
|
447
|
+
*/
|
|
448
|
+
getPin(channelId: string, id: string): Promise<any>;
|
|
449
|
+
/**
|
|
450
|
+
* Get data of multiple pins.
|
|
451
|
+
*
|
|
452
|
+
* @async
|
|
453
|
+
* @function getPins
|
|
454
|
+
* @param {string} channelId - An id of the channel.
|
|
455
|
+
* @param {string} filter - Field value for filter.
|
|
456
|
+
* @param {string} sort - Field value for sorting.
|
|
457
|
+
* @param {string} option - Optional option: ex) offset, per_page.
|
|
458
|
+
* @returns {Promise<any[]>} An array of data of all channels.
|
|
459
|
+
*/
|
|
460
|
+
getPins(channelId: string, filter: any, sort?: any, option?: any): Promise<any>;
|
|
461
|
+
/**
|
|
462
|
+
* Create a new pin.
|
|
463
|
+
*
|
|
464
|
+
* @async
|
|
465
|
+
* @function createPin
|
|
466
|
+
* @param {string} channelId - An id of the channel.
|
|
467
|
+
* @param {PinInput} pin - Configuration options of the new pin.
|
|
468
|
+
* @returns {Promise<any>} The data of the newly created pin.
|
|
469
|
+
*/
|
|
470
|
+
createPin(channelId: string, pin: PinInput): Promise<any>;
|
|
471
|
+
/**
|
|
472
|
+
* Update pin options.
|
|
473
|
+
*
|
|
474
|
+
* @async
|
|
475
|
+
* @function updatePin
|
|
476
|
+
* @param {string} channelId - An id of the channel.
|
|
477
|
+
* @param {PinInput} pin - New options of the pin.
|
|
478
|
+
* @returns {Promise<any>} The data of the updated pin.
|
|
479
|
+
*/
|
|
480
|
+
updatePin(pinId: string, channelId: string, pin: PinInput): Promise<any>;
|
|
481
|
+
getServerUrl(): Promise<any>;
|
|
482
|
+
}
|