easemob-websdk 4.1.4-beta → 4.1.4-beta2
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/CHANGELOG.md +5 -0
- package/Easemob-chat.d.ts +118 -7
- package/Easemob-chat.js +1 -1
- package/chatroom/chatroom.js +1 -1
- package/contact/contact.js +1 -1
- package/group/group.d.ts +84 -6
- package/group/group.js +1 -1
- package/message/audio.d.ts +4 -0
- package/message/channel.d.ts +18 -0
- package/message/cmd.d.ts +4 -0
- package/message/custom.d.ts +4 -0
- package/message/delivery.d.ts +18 -0
- package/message/file.d.ts +4 -0
- package/message/img.d.ts +4 -0
- package/message/location.d.ts +4 -0
- package/message/read.d.ts +18 -0
- package/message/text.d.ts +4 -0
- package/message/video.d.ts +4 -0
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/presence/presence.js +1 -1
- package/readme.md +0 -4
- package/silent/silent.js +1 -1
- package/thread/thread.js +1 -1
- package/translation/translation.js +1 -1
- package/types/common.d.ts +2 -7
- package/types/engineCore.d.ts +40 -0
- package/types/error.d.ts +1 -1
- package/types/eventHandler.d.ts +169 -6
- package/types/groupApi.d.ts +56 -0
- package/types/message.ts +12 -0
- package/types/status.d.ts +331 -0
- package/uniApp/Easemob-chat.js +1 -1
- package/category/category.d.ts +0 -121
- package/category/category.js +0 -1
- package/channel/channel.d.ts +0 -346
- package/channel/channel.js +0 -1
- package/circleSdk/Easemob-chat.d.ts +0 -7899
- package/circleSdk/Easemob-chat.js +0 -1
- package/server/server.d.ts +0 -318
- package/server/server.js +0 -1
- package/types/categoryApi.d.ts +0 -50
- package/types/channelApi.d.ts +0 -162
- package/types/serverApi.d.ts +0 -123
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changes to easemob chat
|
|
2
|
+
## 4.1.4 (Mar 16, 2023)
|
|
2
3
|
|
|
4
|
+
- Add Group Member Attributes feature
|
|
5
|
+
- Fix `getHistoryMessages` catch error failed
|
|
6
|
+
- Optimize the implementation of chat room join and leave to improve performance
|
|
7
|
+
- Add `deliverOnlineOnly` field in the message creation parameters
|
|
3
8
|
## 4.1.3 (Feb 20, 2023)
|
|
4
9
|
|
|
5
10
|
- `getConversationlist` Getting the conversation list supports paging
|
package/Easemob-chat.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export declare namespace EasemobChat {
|
|
|
23
23
|
/** The user ID. */
|
|
24
24
|
type UserId = string;
|
|
25
25
|
|
|
26
|
+
/** The group ID. */
|
|
27
|
+
type GroupId = string;
|
|
28
|
+
|
|
26
29
|
interface CommonRequestResult {
|
|
27
30
|
/** The result of request. */
|
|
28
31
|
result: boolean;
|
|
@@ -133,7 +136,7 @@ export declare namespace EasemobChat {
|
|
|
133
136
|
chatThreadId?: string;
|
|
134
137
|
/** The message thread name. */
|
|
135
138
|
chatThreadName?: string;
|
|
136
|
-
/** The
|
|
139
|
+
/** The ID of the parent message in the message thread. */
|
|
137
140
|
parentId?: string;
|
|
138
141
|
}
|
|
139
142
|
|
|
@@ -148,9 +151,25 @@ export declare namespace EasemobChat {
|
|
|
148
151
|
resource: string;
|
|
149
152
|
}
|
|
150
153
|
|
|
154
|
+
interface GroupMemberAttributesUpdateMultiDeviceInfo {
|
|
155
|
+
/**
|
|
156
|
+
* Custom attributes of a group member.
|
|
157
|
+
*/
|
|
158
|
+
attributes: MemberAttributes;
|
|
159
|
+
/** The user ID of the message sender. */
|
|
160
|
+
from: UserId;
|
|
161
|
+
/** The group ID. */
|
|
162
|
+
id: GroupId;
|
|
163
|
+
/** The name of the multi-device event. */
|
|
164
|
+
operation: 'memberAttributesUpdate';
|
|
165
|
+
/** The user ID of the group member whose custom attributes are set. */
|
|
166
|
+
userId: UserId;
|
|
167
|
+
}
|
|
168
|
+
|
|
151
169
|
type MultiDeviceEvent =
|
|
152
170
|
| ThreadMultiDeviceInfo
|
|
153
|
-
| RoamingDeleteMultiDeviceInfo
|
|
171
|
+
| RoamingDeleteMultiDeviceInfo
|
|
172
|
+
| GroupMemberAttributesUpdateMultiDeviceInfo;
|
|
154
173
|
|
|
155
174
|
interface ConnectionParameters {
|
|
156
175
|
/** The unique application key registered in console. */
|
|
@@ -582,6 +601,32 @@ export declare namespace EasemobChat {
|
|
|
582
601
|
created: number;
|
|
583
602
|
}
|
|
584
603
|
|
|
604
|
+
interface GroupInfo {
|
|
605
|
+
/** The number of existing members. */
|
|
606
|
+
affiliationsCount?: number;
|
|
607
|
+
/** The group name. */
|
|
608
|
+
groupName: string;
|
|
609
|
+
/** The group ID. */
|
|
610
|
+
groupId: string;
|
|
611
|
+
/** The current user role in the group. */
|
|
612
|
+
role?: 'member' | 'admin' | 'owner';
|
|
613
|
+
/** Whether the group disabled. */
|
|
614
|
+
disabled: boolean;
|
|
615
|
+
/** Whether a user requires the approval from the group owner or admin to join the group. -`true`: Yes; -`false`: No. */
|
|
616
|
+
approval: boolean;
|
|
617
|
+
/** Whether to allow group members to invite others to join the group. */
|
|
618
|
+
allowInvites: boolean;
|
|
619
|
+
/** The group description. */
|
|
620
|
+
description: string;
|
|
621
|
+
/** The maximum number of group members. */
|
|
622
|
+
maxUsers: number;
|
|
623
|
+
/** Whether it is a public group. */
|
|
624
|
+
public: boolean;
|
|
625
|
+
}
|
|
626
|
+
type MemberAttributes = Record<string, string>;
|
|
627
|
+
|
|
628
|
+
type GetGroupMembersAttributesResult = Record<UserId, MemberAttributes>;
|
|
629
|
+
|
|
585
630
|
interface GroupModifyInfo {
|
|
586
631
|
/** The name of a group. */
|
|
587
632
|
name?: string;
|
|
@@ -1176,6 +1221,8 @@ export declare namespace EasemobChat {
|
|
|
1176
1221
|
GROUP_MEMBERS_LIMIT = 607,
|
|
1177
1222
|
/** Group disabled */
|
|
1178
1223
|
GROUP_IS_DISABLED = 608,
|
|
1224
|
+
/** Failed to set the custom attributes of a group member. */
|
|
1225
|
+
GROUP_MEMBER_ATTRIBUTES_SET_FAILED = 609,
|
|
1179
1226
|
/** Invalid token or App Key. */
|
|
1180
1227
|
REST_PARAMS_STATUS = 700,
|
|
1181
1228
|
/** The user being operated is not in the chatroom. */
|
|
@@ -2496,9 +2543,11 @@ export declare namespace EasemobChat {
|
|
|
2496
2543
|
* Lists all the groups a user has joined.
|
|
2497
2544
|
*
|
|
2498
2545
|
* @note
|
|
2499
|
-
* If either `needAffiliations` or `needAffiliations` is set
|
|
2546
|
+
* If either `needAffiliations` or `needAffiliations` is set `true`, when you get data with pagination, the current page number (pageNum) starts from 0 and you can get a maximum of 20 groups (pageSize) on each page and
|
|
2547
|
+
* the function return type is `Promise<AsyncResult<GroupTypes.GroupInfo[]>`
|
|
2500
2548
|
*
|
|
2501
|
-
* If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1 and you can get a maximum of 500 groups (pageSize) on each page
|
|
2549
|
+
* If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1 and you can get a maximum of 500 groups (pageSize) on each page and and
|
|
2550
|
+
* the function return type is `Promise<AsyncResult<GroupTypes.BaseGroupInfo[]>`
|
|
2502
2551
|
*
|
|
2503
2552
|
* ```typescript
|
|
2504
2553
|
* connection.getJoinedGroups({
|
|
@@ -2534,10 +2583,12 @@ export declare namespace EasemobChat {
|
|
|
2534
2583
|
* (Default)`false`: No.
|
|
2535
2584
|
*/
|
|
2536
2585
|
needRole?: boolean;
|
|
2537
|
-
success?: (
|
|
2586
|
+
success?: (
|
|
2587
|
+
res: AsyncResult<BaseGroupInfo[] | GroupInfo[]>
|
|
2588
|
+
) => void;
|
|
2538
2589
|
error?: (error: ErrorEvent) => void;
|
|
2539
2590
|
}
|
|
2540
|
-
): Promise<AsyncResult<BaseGroupInfo[]>>;
|
|
2591
|
+
): Promise<AsyncResult<BaseGroupInfo[] | GroupInfo[]>>;
|
|
2541
2592
|
|
|
2542
2593
|
/** @deprecated */
|
|
2543
2594
|
changeOwner(
|
|
@@ -3712,6 +3763,62 @@ export declare namespace EasemobChat {
|
|
|
3712
3763
|
}
|
|
3713
3764
|
): void;
|
|
3714
3765
|
|
|
3766
|
+
/**
|
|
3767
|
+
* Sets custom attributes of a group member.
|
|
3768
|
+
* After custom attributes of a group member are set, other members in the group receive the `operation: 'memberAttributesUpdate'` in the `onGroupEvent` callback and the other devices of the group member receive the the `operation: 'memberAttributesUpdate'` in the `onMultiDeviceEvent` callback.
|
|
3769
|
+
*
|
|
3770
|
+
* ```typescript
|
|
3771
|
+
* connection.setGroupMemberAttributes({groupId: 'groupId', userId: 'userId', memberAttributes: {key: 'value'}})
|
|
3772
|
+
* ```
|
|
3773
|
+
*/
|
|
3774
|
+
setGroupMemberAttributes(
|
|
3775
|
+
this: Connection,
|
|
3776
|
+
params: {
|
|
3777
|
+
/** The group ID. */
|
|
3778
|
+
groupId: string;
|
|
3779
|
+
/** The user ID of the group member. */
|
|
3780
|
+
userId: string;
|
|
3781
|
+
/**
|
|
3782
|
+
* The custom attributes to set in key-value format. In a key-value pair, if the value is set to an empty string, the custom attribute will be deleted.
|
|
3783
|
+
*/
|
|
3784
|
+
memberAttributes: MemberAttributes;
|
|
3785
|
+
}
|
|
3786
|
+
): Promise<void>;
|
|
3787
|
+
|
|
3788
|
+
/**
|
|
3789
|
+
* Gets all custom attributes of a group member.
|
|
3790
|
+
* ```typescript
|
|
3791
|
+
* connection.getGroupMemberAttributes({groupId: 'groupId', userId: 'userId'})
|
|
3792
|
+
* ```
|
|
3793
|
+
*/
|
|
3794
|
+
getGroupMemberAttributes(
|
|
3795
|
+
this: Connection,
|
|
3796
|
+
params: {
|
|
3797
|
+
/** The group ID. */
|
|
3798
|
+
groupId: string;
|
|
3799
|
+
/** The user ID of the group member. */
|
|
3800
|
+
userId: string;
|
|
3801
|
+
}
|
|
3802
|
+
): Promise<AsyncResult<MemberAttributes>>;
|
|
3803
|
+
|
|
3804
|
+
/**
|
|
3805
|
+
* Gets custom attributes of multiple group members by attribute key.
|
|
3806
|
+
* ```typescript
|
|
3807
|
+
* connection.getGroupMembersAttributes({groupId: 'groupId', userIds: ['userId'], keys: ['avatar', 'nickname']})
|
|
3808
|
+
* ```
|
|
3809
|
+
*/
|
|
3810
|
+
getGroupMembersAttributes(
|
|
3811
|
+
this: Connection,
|
|
3812
|
+
params: {
|
|
3813
|
+
/** The group ID. */
|
|
3814
|
+
groupId: string;
|
|
3815
|
+
/** The array of user IDs of group members whose custom attributes are retrieved. */
|
|
3816
|
+
userIds: UserId[];
|
|
3817
|
+
/** The array of keys of custom attributes to be retrieved. If you pass in an empty array or do not set this parameter, the SDK gets all custom attributes of these group members. */
|
|
3818
|
+
keys?: string[];
|
|
3819
|
+
}
|
|
3820
|
+
): Promise<AsyncResult<GetGroupMembersAttributesResult>>;
|
|
3821
|
+
|
|
3715
3822
|
// Contact API
|
|
3716
3823
|
/**
|
|
3717
3824
|
* @deprecated Use {@link getBlocklist} instead.
|
|
@@ -5032,6 +5139,7 @@ export declare namespace EasemobChat {
|
|
|
5032
5139
|
* destroy: Occurs when the group was destroyed.<br/>
|
|
5033
5140
|
* requestToJoin: Occurs when someone applied to join the group. Only the group owner and administrator will receive this event. <br/>
|
|
5034
5141
|
* acceptRequest: Occurs when your group adding application is approved. Only the person who applies for group will receive this event.<br/>
|
|
5142
|
+
* joinPublicGroupDeclined: Occurs when your group adding application is refused. Only the person who applies for group will receive this event.<br/>
|
|
5035
5143
|
* inviteToJoin: Occurs when you receive an invitation to join a group. <br/>
|
|
5036
5144
|
* acceptInvite: Occurs when someone accepted your invitation to join the group. <br/>
|
|
5037
5145
|
* rejectInvite: Occurs when someone refused your invitation to join the group. <br/>
|
|
@@ -5054,12 +5162,14 @@ export declare namespace EasemobChat {
|
|
|
5054
5162
|
* removeAllowlistMember: Occurs when being removed from the allow list. <br/>
|
|
5055
5163
|
* muteAllMembers: Occurs when the group was set with a ban for all members. <br/>
|
|
5056
5164
|
* unmuteAllMembers: Occurs when the group lifted the ban. <br/>
|
|
5165
|
+
* memberAttributesUpdate: Occurs when a custom attributes of a group member is updated. <br/>
|
|
5057
5166
|
*/
|
|
5058
5167
|
operation:
|
|
5059
5168
|
| 'create'
|
|
5060
5169
|
| 'destroy'
|
|
5061
5170
|
| 'requestToJoin'
|
|
5062
5171
|
| 'acceptRequest'
|
|
5172
|
+
| 'joinPublicGroupDeclined'
|
|
5063
5173
|
| 'inviteToJoin'
|
|
5064
5174
|
| 'acceptInvite'
|
|
5065
5175
|
| 'rejectInvite'
|
|
@@ -5081,7 +5191,8 @@ export declare namespace EasemobChat {
|
|
|
5081
5191
|
| 'addUserToAllowlist'
|
|
5082
5192
|
| 'removeAllowlistMember'
|
|
5083
5193
|
| 'muteAllMembers'
|
|
5084
|
-
| 'unmuteAllMembers'
|
|
5194
|
+
| 'unmuteAllMembers'
|
|
5195
|
+
| 'memberAttributesUpdate';
|
|
5085
5196
|
/** The ID of a group. */
|
|
5086
5197
|
id: string;
|
|
5087
5198
|
/** Message sender. */
|