Skip to content

Commit ff919b1

Browse files
committed
ver3.0.55
1 parent 64bd3bc commit ff919b1

File tree

6 files changed

+161
-50
lines changed

6 files changed

+161
-50
lines changed

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,56 @@
11
Changelog
22
=========
33

4+
## v3.0.55
5+
* Added `UserMessageParams` feature.
6+
* This is used in `sendUserMessage()` of channel.
7+
* message: set text message to send. This value is required.
8+
* data: set message data to send.
9+
* customType: set message customType to send.
10+
* targetLanguages: set message translation target language list.
11+
* mentionedUserIds: set mentioned userId.
12+
* mentionedUsers: set mentioned User.
13+
* Added `FileMessageParams` feature.
14+
* This is used in `sendFileMessage()` of channel.
15+
* `file` or `fileUrl` is required.
16+
* file: set file to send.
17+
* fileUrl: set file's url to send.
18+
* fileName: set file's name to send. When you set a file and do not specify this value, it is specified by name of the file. When you set a fileUrl and do not specify this value, it is set as empty string.
19+
* fileSize: set file's size to send. When you set a file and do not specify this value, it is specified by size of the file. When you set a fileUrl and do not specify this value, it is set as 0.
20+
* mimeType: set file's type to send. When you set a file and do not specify this value, it is specified by type of the file. When you set a fileUrl and do not specify this value, it is specified by inferring from fileUrl.
21+
* data: set message data to send.
22+
* customType: set message customType to send.
23+
* thumbnailSizes: set size of the thumbnail to be created. This value only works when you use file not fileUrl.
24+
* mentionedUserIds: set mentioned userId.
25+
* mentionedUsers: set mentioned User.
26+
* Added `sendUserMessage(UserMessageParams, CallBackFunction)` in channel.
27+
* Added `sendFileMessage(FileMessageParams, CallBackFunction)` in channel.
28+
* Added `mentionedUsers` in UserMessage and FileMessage to check mentioned user.
29+
* Added `isEphemeral` in GroupChannel to indicate whether the channel supports message retention.
30+
* Added `myMemberState` in GroupChannel to check my joined state on GroupChannel.
31+
* Added `operator` feature in GroupChannel.
32+
* Added `operators` in `GroupChannelParams` to set operator.
33+
* Added `operatorUserIds` in `GroupChannelParams` to set operator.
34+
* Added `banUser` in `GroupChannel` to ban User.
35+
* Added `banUserWithUserId` in `GroupChannel` to ban User using userId.
36+
* Added `unbanUser ` in `GroupChannel` to remove banned User using User object.
37+
* Added `unbanUserWithUserId` in `GroupChannel` to remove banned User using userId.
38+
* Added `muteUser` in `GroupChannel` to mute User using User object.
39+
* Added `muteUserWithUserId` in `GroupChannel` to mute User using userId.
40+
* Added `unmuteUser` in `GroupChannel` to unmute User using User object.
41+
* Added `unmuteUserWithUserId` in `GroupChannel` to unmute User using userId.
42+
* Added `freeze` in `GroupChannel` not to allow messages from members from the channel.
43+
* Added `unfreeze` in `GroupChannel` to allow messages from members from the channel.
44+
* Added `isFrozen` in `GroupChannel` to check if the channel is frozen or not.
45+
* From now, channel param in callbacks of the ChannelHandler below can come in either GroupChannel or OpenChannel.
46+
* onUserMuted(channel, user)
47+
* onUserUnmuted(channel, user)
48+
* onUserBanned(channel, user)
49+
* onUserUnbanned(channel, user)
50+
* onChannelFrozen(channel)
51+
* onChannelUnfrozen(channel)
52+
* Added `createMemberListQuery()` in `GroupChannel` to search members.
53+
454
## v3.0.54
555
* Minor bugfix for `UserMessage` and `FileMessage`.
656

README.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,56 @@ If you have trouble importing `SendBird`, please check your `tsconfig.json` file
3939
# [Documentation](https://docs.sendbird.com/javascript)
4040

4141

42-
## Upgrading to v3.0.54
43-
If you want to check the record of other version, go to [Change Log](https://github.com/smilefam/SendBird-SDK-JavaScript/blob/master/CHANGELOG.md).
44-
* Minor bugfix for `UserMessage` and `FileMessage`.
42+
## Upgrading to v3.0.55
43+
If you want to check the record of other version, go to [Change Log](https://github.com/smilefam/SendBird-SDK-JavaScript/blob/master/CHANGELOG.md).
44+
* Added `UserMessageParams` feature.
45+
* This is used in `sendUserMessage()` of channel.
46+
* message: set text message to send. This value is required.
47+
* data: set message data to send.
48+
* customType: set message customType to send.
49+
* targetLanguages: set message translation target language list.
50+
* mentionedUserIds: set mentioned userId.
51+
* mentionedUsers: set mentioned User.
52+
* Added `FileMessageParams` feature.
53+
* This is used in `sendFileMessage()` of channel.
54+
* `file` or `fileUrl` is required.
55+
* file: set file to send.
56+
* fileUrl: set file's url to send.
57+
* fileName: set file's name to send. When you set a file and do not specify this value, it is specified by name of the file. When you set a fileUrl and do not specify this value, it is set as empty string.
58+
* fileSize: set file's size to send. When you set a file and do not specify this value, it is specified by size of the file. When you set a fileUrl and do not specify this value, it is set as 0.
59+
* mimeType: set file's type to send. When you set a file and do not specify this value, it is specified by type of the file. When you set a fileUrl and do not specify this value, it is specified by inferring from fileUrl.
60+
* data: set message data to send.
61+
* customType: set message customType to send.
62+
* thumbnailSizes: set size of the thumbnail to be created. This value only works when you use file not fileUrl.
63+
* mentionedUserIds: set mentioned userId.
64+
* mentionedUsers: set mentioned User.
65+
* Added `sendUserMessage(UserMessageParams, CallBackFunction)` in channel.
66+
* Added `sendFileMessage(FileMessageParams, CallBackFunction)` in channel.
67+
* Added `mentionedUsers` in UserMessage and FileMessage to check mentioned user.
68+
* Added `isEphemeral` in GroupChannel to indicate whether the channel supports message retention.
69+
* Added `myMemberState` in GroupChannel to check my joined state on GroupChannel.
70+
* Added `operator` feature in GroupChannel.
71+
* Added `operators` in `GroupChannelParams` to set operator.
72+
* Added `operatorUserIds` in `GroupChannelParams` to set operator.
73+
* Added `banUser` in `GroupChannel` to ban User.
74+
* Added `banUserWithUserId` in `GroupChannel` to ban User using userId.
75+
* Added `unbanUser ` in `GroupChannel` to remove banned User using User object.
76+
* Added `unbanUserWithUserId` in `GroupChannel` to remove banned User using userId.
77+
* Added `muteUser` in `GroupChannel` to mute User using User object.
78+
* Added `muteUserWithUserId` in `GroupChannel` to mute User using userId.
79+
* Added `unmuteUser` in `GroupChannel` to unmute User using User object.
80+
* Added `unmuteUserWithUserId` in `GroupChannel` to unmute User using userId.
81+
* Added `freeze` in `GroupChannel` not to allow messages from members from the channel.
82+
* Added `unfreeze` in `GroupChannel` to allow messages from members from the channel.
83+
* Added `isFrozen` in `GroupChannel` to check if the channel is frozen or not.
84+
* From now, channel param in callbacks of the ChannelHandler below can come in either GroupChannel or OpenChannel.
85+
* onUserMuted(channel, user)
86+
* onUserUnmuted(channel, user)
87+
* onUserBanned(channel, user)
88+
* onUserUnbanned(channel, user)
89+
* onChannelFrozen(channel)
90+
* onChannelUnfrozen(channel)
91+
* Added `createMemberListQuery()` in `GroupChannel` to search members.
4592

4693

4794
## [Change Log](https://github.com/smilefam/SendBird-SDK-JavaScript/blob/master/CHANGELOG.md)

SendBird.d.ts

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Type Definitions for SendBird SDK v3.0.54
2+
* Type Definitions for SendBird SDK v3.0.55
33
* homepage: https://sendbird.com/
44
* git: https://github.com/smilefam/SendBird-SDK-JavaScript
55
*/
@@ -42,6 +42,8 @@ interface SendBirdInstance {
4242
ConnectionHandler: ConnectionHandlerStatic;
4343

4444
GroupChannelParams: GroupChannelParams;
45+
UserMessageParams: UserMessageParams;
46+
FileMessageParams: FileMessageParams;
4547

4648
connect(userId: string, callback?: userCallback): void;
4749
connect(userId: string, apiHost: string, wsHost: string, callback?: userCallback): void;
@@ -144,31 +146,32 @@ interface ChannelHandlerStatic {
144146
new(): ChannelHandler;
145147
}
146148
interface ChannelHandler {
147-
onMessageReceived(channel: GroupChannel|OpenChannel, message: AdminMessage|UserMessage): void;
148-
onMessageDeleted(channel: GroupChannel|OpenChannel, messageId: number): void;
149+
onMessageReceived(channel: OpenChannel|GroupChannel, message: AdminMessage|UserMessage|FileMessage): void;
150+
onMentionReceived(channel: OpenChannel|GroupChannel, message: AdminMessage|UserMessage|FileMessage): void;
151+
onMessageDeleted(channel: OpenChannel|GroupChannel, messageId: number): void;
149152
onReadReceiptUpdated(channel: GroupChannel): void;
150153
onTypingStatusUpdated(channel: GroupChannel): void;
151154
onTypingStatusUpdated(channel: GroupChannel): void;
152155
onUserJoined(channel: GroupChannel, user: User): void;
153156
onUserLeft(channel: GroupChannel, user: User): void;
154157
onUserEntered(channel: OpenChannel, user: User): void;
155158
onUserExited(channel: OpenChannel, user: User): void;
156-
onUserMuted(channel: GroupChannel|OpenChannel, user: User): void;
157-
onUserUnmuted(channel: GroupChannel|OpenChannel, user: User): void;
158-
onUserBanned(channel: GroupChannel|OpenChannel, user: User): void;
159-
onUserUnbanned(channel: GroupChannel|OpenChannel, user: User): void;
160-
onChannelFrozen(channel: GroupChannel|OpenChannel): void;
161-
onChannelUnfrozen(channel: GroupChannel|OpenChannel): void;
159+
onUserMuted(channel: OpenChannel|GroupChannel, user: User): void;
160+
onUserUnmuted(channel: OpenChannel|GroupChannel, user: User): void;
161+
onUserBanned(channel: OpenChannel|GroupChannel, user: User): void;
162+
onUserUnbanned(channel: OpenChannel|GroupChannel, user: User): void;
163+
onChannelFrozen(channel: OpenChannel|GroupChannel): void;
164+
onChannelUnfrozen(channel: OpenChannel|GroupChannel): void;
162165
onChannelChanged(channel: OpenChannel|GroupChannel): void;
163166
onChannelDeleted(channelUrl: string): void;
164167
onUserReceivedInvitation(channel: GroupChannel, inviter: User, invitees: Array<Member>): void;
165168
onUserDeclinedInvitation(channel: GroupChannel, inviter: User, invitee: Array<Member>): void;
166-
onMetaDataCreated(channel: GroupChannel|OpenChannel, metaData: Object): void;
167-
onMetaDataUpdated(channel: GroupChannel|OpenChannel, metaData: Object): void;
168-
onMetaDataDeleted(channel: GroupChannel|OpenChannel, metaData: Array<string>): void;
169-
onMetaCountersCreated(channel: GroupChannel|OpenChannel, metaCounter: Object): void;
170-
onMetaCountersUpdated(channel: GroupChannel|OpenChannel, metaCounter: Object): void;
171-
onMetaCountersDeleted(channel: GroupChannel|OpenChannel, metaCounter: Array<string>): void;
169+
onMetaDataCreated(channel: OpenChannel|GroupChannel, metaData: Object): void;
170+
onMetaDataUpdated(channel: OpenChannel|GroupChannel, metaData: Object): void;
171+
onMetaDataDeleted(channel: OpenChannel|GroupChannel, metaData: Array<string>): void;
172+
onMetaCountersCreated(channel: OpenChannel|GroupChannel, metaCounter: Object): void;
173+
onMetaCountersUpdated(channel: OpenChannel|GroupChannel, metaCounter: Object): void;
174+
onMetaCountersDeleted(channel: OpenChannel|GroupChannel, metaCounter: Array<string>): void;
172175
onChannelHidden(channel: GroupChannel): void;
173176
}
174177

@@ -192,6 +195,7 @@ interface BaseMessageInstance {
192195
messageType: string;
193196
data: string;
194197
customType: string;
198+
mentionedUsers: Array<User>;
195199
createdAt: number;
196200
updatedAt: number;
197201

@@ -210,6 +214,14 @@ interface AdminMessageStatic {
210214
buildFromSerializedData(serializedObject: Object): AdminMessage;
211215
}
212216

217+
interface UserMessageParams {
218+
message: string;
219+
data: string;
220+
customType: string;
221+
targetLanguages: Array<string>;
222+
mentionedUserIds: Array<string>;
223+
mentionedUsers: Array<User>;
224+
}
213225
interface UserMessage extends BaseMessageInstance {
214226
sender: User;
215227
reqId: string;
@@ -219,6 +231,18 @@ interface UserMessageStatic {
219231
buildFromSerializedData(serializedObject: Object): UserMessage;
220232
}
221233

234+
interface FileMessageParams {
235+
file: File;
236+
fileUrl: string;
237+
fileName: string;
238+
fileSize: number;
239+
mimeType: string;
240+
data: string;
241+
customType: string;
242+
thumbnailSizes: Array<ThumbnailSize>;
243+
mentionedUserIds: Array<string>;
244+
mentionedUsers: Array<User>;
245+
}
222246
interface FileMessage extends BaseMessageInstance {
223247
sender: User;
224248
reqId: string;
@@ -300,6 +324,7 @@ interface BaseChannel {
300324
data: string;
301325
customType: string;
302326
isFrozen: boolean;
327+
isEphemeral: boolean;
303328
createdAt: string;
304329

305330
isGroupChannel(): boolean;
@@ -320,6 +345,7 @@ interface BaseChannel {
320345
getPreviousAndNextMessagesByID(messageId: number, prevtResultSize: number, nextResultSize: number, shouldReverse:boolean, messageType: string, customType: string, callback: messageListCallback): void;
321346

322347
/** FileMessage */
348+
sendFileMessage(fileMessageParams: FileMessageParams, callback: messageCallback): FileMessage;
323349
sendFileMessage(file: File, callback: messageCallback): FileMessage;
324350
sendFileMessage(file: File, data: string, callback: messageCallback): FileMessage;
325351
sendFileMessage(file: File, data: string, customType: string, callback: messageCallback): FileMessage;
@@ -328,6 +354,7 @@ interface BaseChannel {
328354
sendFileMessage(file: File, name: string, type: string, size: number, data: string, customType: string, callback: messageCallback): FileMessage;
329355
sendFileMessage(file: File, name: string, type: string, size: number, data: string, customType: string, thumbnailSizes: Array<ThumbnailSize>, callback: messageCallback): FileMessage;
330356

357+
sendFileMessage(fileMessageParams: FileMessageParams, progressHandler: fileUploadprogressHandler, callback: messageCallback): FileMessage;
331358
sendFileMessage(file: File, progressHandler: fileUploadprogressHandler, callback: messageCallback): FileMessage;
332359
sendFileMessage(file: File, data: string, progressHandler: fileUploadprogressHandler, callback: messageCallback): FileMessage;
333360
sendFileMessage(file: File, data: string, customType: string, progressHandler: fileUploadprogressHandler, callback: messageCallback): FileMessage;
@@ -349,6 +376,7 @@ interface BaseChannel {
349376
sendFileMessage(file: string, name: string, type: string, size: number, data: string, customType: string, progressHandler: fileUploadprogressHandler, callback: messageCallback): FileMessage;
350377

351378
/** UserMessage */
379+
sendUserMessage(userMessageParams: UserMessageParams, callback: messageCallback): UserMessage;
352380
sendUserMessage(message: string, callback: messageCallback): UserMessage;
353381
sendUserMessage(message: string, data: string, callback: messageCallback): UserMessage;
354382
sendUserMessage(message: string, data: string, customType: string, callback: messageCallback): UserMessage;
@@ -482,6 +510,7 @@ interface GroupChannelParams {
482510
isDistinct: boolean;
483511
isSuper: boolean;
484512
isPublic: boolean;
513+
isEphemeral: boolean;
485514
channelUrl: string;
486515
name: string;
487516
data: string;
@@ -509,6 +538,7 @@ interface GroupChannel extends BaseChannel {
509538
unreadMessageCount: number;
510539
members: Array<Member>;
511540
memberCount: number;
541+
myMemberState: 'none' | 'joined' | 'invited';
512542
inviter: User;
513543

514544
refresh(callback: groupChannelCallback): void;

SendBird.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
{
22
"name": "sendbird",
3-
"version": "3.0.54",
4-
"authors": [
5-
"SendBird <support@sendbird.com>"
6-
],
3+
"version": "3.0.55",
4+
"authors": ["SendBird <support@sendbird.com>"],
75
"homepage": "https://github.com/smilefam/SendBird-SDK-JavaScript",
86
"description": "SendBird JavaScript SDK",
97
"main": "SendBird.min.js",
108
"moduleType": [],
11-
"keywords": [
12-
"sendbird",
13-
"sendbird.com",
14-
"messaging",
15-
"chat",
16-
"js"
17-
],
9+
"keywords": ["sendbird", "sendbird.com", "messaging", "chat", "js"],
1810
"license": "LICENSE.md",
19-
"ignore": [
20-
"package.json"
21-
]
11+
"ignore": ["package.json"]
2212
}

package.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "sendbird",
3-
"version": "3.0.54",
3+
"version": "3.0.55",
44
"description": "SendBird JavaScript SDK",
55
"main": "SendBird.min.js",
66
"dependencies": {
7-
"websocket": "1.0.24",
8-
"xhr2": "0.1.4",
9-
"agentkeepalive": "2.2.0",
10-
"form-data": "2.1.2"
7+
"websocket": "1.0.24",
8+
"xhr2": "0.1.4",
9+
"agentkeepalive": "2.2.0",
10+
"form-data": "2.1.2"
1111
},
1212
"scripts": {
1313
"test": "echo \"Error: no test specified\" && exit 1"
@@ -16,13 +16,7 @@
1616
"type": "git",
1717
"url": "https://github.com/smilefam/SendBird-SDK-JavaScript"
1818
},
19-
"keywords": [
20-
"sendbird",
21-
"sendbird.com",
22-
"messaging",
23-
"chat",
24-
"js"
25-
],
19+
"keywords": ["sendbird", "sendbird.com", "messaging", "chat", "js"],
2620
"author": "SendBird <support@sendbird.com>",
2721
"license": "SEE LICENSE IN LICENSE.md",
2822
"bugs": {

0 commit comments

Comments
 (0)