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.
Files changed (138) hide show
  1. package/LICENSE.md +1 -1
  2. package/deploy.sh +1 -1
  3. package/esm/CloudChat.d.ts +434 -9
  4. package/esm/CloudChat.js +979 -273
  5. package/esm/CloudChat.js.map +1 -1
  6. package/esm/CoreManager.d.ts +6 -0
  7. package/esm/CoreManager.js +13 -4
  8. package/esm/CoreManager.js.map +1 -1
  9. package/esm/Dispatcher.d.ts +16 -0
  10. package/esm/Dispatcher.js +19 -4
  11. package/esm/Dispatcher.js.map +1 -1
  12. package/esm/Network.d.ts +7 -0
  13. package/esm/Network.js +93 -0
  14. package/esm/Network.js.map +1 -0
  15. package/esm/Type.d.ts +43 -0
  16. package/esm/Type.js +16 -0
  17. package/esm/Type.js.map +1 -1
  18. package/esm/Util.d.ts +13 -0
  19. package/esm/Util.js +13 -0
  20. package/esm/Util.js.map +1 -1
  21. package/esm/graphql/channel.d.ts +13 -0
  22. package/esm/graphql/channel.js +16 -0
  23. package/esm/graphql/channel.js.map +1 -0
  24. package/esm/graphql/friend.d.ts +11 -0
  25. package/esm/graphql/friend.js +13 -0
  26. package/esm/graphql/friend.js.map +1 -0
  27. package/esm/graphql/invite.d.ts +7 -0
  28. package/esm/graphql/invite.js +8 -0
  29. package/esm/graphql/invite.js.map +1 -0
  30. package/esm/graphql/member.d.ts +11 -0
  31. package/esm/graphql/member.js +13 -0
  32. package/esm/graphql/member.js.map +1 -0
  33. package/esm/graphql/message.d.ts +11 -0
  34. package/esm/graphql/message.js +13 -0
  35. package/esm/graphql/message.js.map +1 -0
  36. package/esm/graphql/pin.d.ts +10 -0
  37. package/esm/graphql/pin.js +12 -0
  38. package/esm/graphql/pin.js.map +1 -0
  39. package/esm/graphql/project.d.ts +7 -0
  40. package/esm/graphql/project.js +8 -0
  41. package/esm/graphql/project.js.map +1 -0
  42. package/esm/graphql/subscription.d.ts +11 -0
  43. package/esm/graphql/subscription.js +13 -0
  44. package/esm/graphql/subscription.js.map +1 -0
  45. package/esm/index.d.ts +6 -0
  46. package/esm/index.js +6 -0
  47. package/esm/index.js.map +1 -1
  48. package/esm/logger.d.ts +9 -3
  49. package/esm/logger.js +6 -0
  50. package/esm/logger.js.map +1 -1
  51. package/esm/mutations/channel.d.ts +50 -0
  52. package/esm/mutations/channel.js +97 -176
  53. package/esm/mutations/channel.js.map +1 -1
  54. package/esm/mutations/friend.d.ts +38 -0
  55. package/esm/mutations/friend.js +57 -119
  56. package/esm/mutations/friend.js.map +1 -1
  57. package/esm/mutations/index.d.ts +5 -3
  58. package/esm/mutations/index.js +5 -3
  59. package/esm/mutations/index.js.map +1 -1
  60. package/esm/mutations/invite.d.ts +15 -0
  61. package/esm/mutations/invite.js +23 -32
  62. package/esm/mutations/invite.js.map +1 -1
  63. package/esm/mutations/member.d.ts +39 -2
  64. package/esm/mutations/member.js +64 -111
  65. package/esm/mutations/member.js.map +1 -1
  66. package/esm/mutations/message.d.ts +35 -0
  67. package/esm/mutations/message.js +66 -45
  68. package/esm/mutations/message.js.map +1 -1
  69. package/esm/mutations/pin.d.ts +28 -0
  70. package/esm/mutations/pin.js +88 -0
  71. package/esm/mutations/pin.js.map +1 -0
  72. package/esm/mutations/subscription.d.ts +33 -1
  73. package/esm/mutations/subscription.js +51 -93
  74. package/esm/mutations/subscription.js.map +1 -1
  75. package/esm/queries/channel.d.ts +24 -0
  76. package/esm/queries/channel.js +37 -79
  77. package/esm/queries/channel.js.map +1 -1
  78. package/esm/queries/friend.d.ts +16 -0
  79. package/esm/queries/friend.js +25 -40
  80. package/esm/queries/friend.js.map +1 -1
  81. package/esm/queries/index.d.ts +8 -0
  82. package/esm/queries/index.js +8 -0
  83. package/esm/queries/index.js.map +1 -1
  84. package/esm/queries/member.d.ts +16 -0
  85. package/esm/queries/member.js +25 -40
  86. package/esm/queries/member.js.map +1 -1
  87. package/esm/queries/memberblocks.d.ts +17 -0
  88. package/esm/queries/memberblocks.js +69 -0
  89. package/esm/queries/memberblocks.js.map +1 -0
  90. package/esm/queries/message.d.ts +33 -0
  91. package/esm/queries/message.js +50 -111
  92. package/esm/queries/message.js.map +1 -1
  93. package/esm/queries/pin.d.ts +28 -0
  94. package/esm/queries/pin.js +92 -0
  95. package/esm/queries/pin.js.map +1 -0
  96. package/esm/queries/project.d.ts +13 -0
  97. package/esm/queries/project.js +20 -32
  98. package/esm/queries/project.js.map +1 -1
  99. package/esm/queries/subscription.d.ts +25 -0
  100. package/esm/queries/subscription.js +39 -76
  101. package/esm/queries/subscription.js.map +1 -1
  102. package/lib/CloudChat.js +1230 -321
  103. package/lib/CoreManager.js +13 -3
  104. package/lib/Dispatcher.js +25 -9
  105. package/lib/Network.js +226 -0
  106. package/lib/Type.js +19 -0
  107. package/lib/Util.js +15 -1
  108. package/lib/graphql/channel.js +32 -0
  109. package/lib/graphql/friend.js +27 -0
  110. package/lib/graphql/invite.js +18 -0
  111. package/lib/graphql/member.js +27 -0
  112. package/lib/graphql/message.js +27 -0
  113. package/lib/graphql/pin.js +25 -0
  114. package/lib/graphql/project.js +18 -0
  115. package/lib/graphql/subscription.js +27 -0
  116. package/lib/index.js +2 -2
  117. package/lib/logger.js +6 -0
  118. package/lib/mutations/channel.js +106 -172
  119. package/lib/mutations/friend.js +62 -115
  120. package/lib/mutations/index.js +23 -3
  121. package/lib/mutations/invite.js +27 -33
  122. package/lib/mutations/member.js +73 -100
  123. package/lib/mutations/message.js +86 -48
  124. package/lib/mutations/pin.js +229 -0
  125. package/lib/mutations/subscription.js +56 -95
  126. package/lib/queries/channel.js +40 -84
  127. package/lib/queries/friend.js +29 -45
  128. package/lib/queries/index.js +37 -3
  129. package/lib/queries/member.js +29 -45
  130. package/lib/queries/memberblocks.js +207 -0
  131. package/lib/queries/message.js +56 -109
  132. package/lib/queries/pin.js +243 -0
  133. package/lib/queries/project.js +24 -41
  134. package/lib/queries/subscription.js +42 -78
  135. package/package.json +19 -45
  136. package/tsconfig.json +1 -0
  137. package//353/260/260/355/217/254/354/210/234/354/204/234.md +8 -0
  138. package/package copy.json +0 -74
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 HEROPY <thesecon@gmail.com>
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
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
@@ -1,56 +1,481 @@
1
- import type { ChannelInput, MarkInput } from "./Type";
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
- constructor();
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
- unbind(id: string, fn: any): Promise<void>;
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
- getMembers(filter: any, sort?: any, option?: any): Promise<any>;
35
- getChannels(filter: any, sort?: any, option?: any): Promise<any>;
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
- addMembers(channelId: string, memberIds: any, options: any): Promise<any>;
51
- removeMembers(channelId: string, memberIds: any, options: any): Promise<any>;
52
- startTyping(channelId: string, threadId?: string): Promise<any>;
53
- stopTyping(channelId: string, threadId?: string): Promise<any>;
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
  }