easemob-websdk 4.1.0-beta → 4.1.0-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.
Files changed (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Easemob-chat.d.ts +108 -940
  3. package/Easemob-chat.js +1 -3
  4. package/chatroom/chatroom.d.ts +590 -0
  5. package/chatroom/chatroom.js +1 -0
  6. package/contact/contact.d.ts +322 -0
  7. package/contact/contact.js +1 -0
  8. package/group/group.d.ts +645 -0
  9. package/group/group.js +1 -0
  10. package/message/audio.d.ts +140 -0
  11. package/message/channel.d.ts +58 -0
  12. package/message/cmd.d.ts +102 -0
  13. package/message/custom.d.ts +94 -0
  14. package/message/delivery.d.ts +53 -0
  15. package/message/file.d.ts +134 -0
  16. package/message/img.d.ts +150 -0
  17. package/message/index.d.ts +147 -0
  18. package/message/location.d.ts +98 -0
  19. package/message/read.d.ts +61 -0
  20. package/message/text.d.ts +107 -0
  21. package/message/video.d.ts +140 -0
  22. package/miniCore/miniCore.d.ts +148 -0
  23. package/miniCore/miniCore.js +1 -0
  24. package/package.json +1 -1
  25. package/presence/presence.d.ts +67 -0
  26. package/presence/presence.js +1 -0
  27. package/silent/silent.d.ts +110 -0
  28. package/silent/silent.js +1 -0
  29. package/thread/thread.d.ts +157 -0
  30. package/thread/thread.js +1 -0
  31. package/translation/translation.d.ts +28 -0
  32. package/translation/translation.js +1 -0
  33. package/types/chatRoomApi.d.ts +198 -0
  34. package/types/common.d.ts +56 -0
  35. package/types/engineCore.d.ts +83 -0
  36. package/types/error.d.ts +12 -0
  37. package/types/eventHandler.d.ts +201 -0
  38. package/types/groupApi.d.ts +235 -0
  39. package/types/indexApi.d.ts +134 -0
  40. package/types/presenceApi.d.ts +66 -0
  41. package/types/reactionApi.d.ts +74 -0
  42. package/types/restApis.d.ts +6 -0
  43. package/types/silentModeApi.d.ts +90 -0
  44. package/types/threadApi.d.ts +169 -0
  45. package/types/translation.d.ts +25 -0
package/Easemob-chat.d.ts CHANGED
@@ -1076,8 +1076,8 @@ export declare namespace EasemobChat {
1076
1076
  NO_PERMISSION = 52,
1077
1077
  /** Unsupported Operation. */
1078
1078
  OPERATION_UNSUPPORTED = 53,
1079
- /** The current operation object does not exist. */
1080
- NOT_EXIST = 54,
1079
+ /** An operation that is not allowed. */
1080
+ OPERATION_NOT_ALLOWED = 54,
1081
1081
  /** The uploading of the file failed. */
1082
1082
  WEBIM_UPLOADFILE_ERROR = 101,
1083
1083
  /** The current user is not logged in when uploading the file. */
@@ -1132,8 +1132,8 @@ export declare namespace EasemobChat {
1132
1132
  PERMISSION_DENIED = 603,
1133
1133
  /** Internal error. */
1134
1134
  WEBIM_LOAD_MSG_ERROR = 604,
1135
- /** The current user has joined. */
1136
- ALREADY_JOINED = 601,
1135
+ /** The current user is already in the group. */
1136
+ GROUP_ALREADY_JOINED = 601,
1137
1137
  /** The maximum number of group members exceeds the limit during group creation. */
1138
1138
  GROUP_MEMBERS_LIMIT = 607,
1139
1139
  /** Group disabled */
@@ -2263,22 +2263,22 @@ export declare namespace EasemobChat {
2263
2263
  ): Promise<AsyncResult<CreateGroupResult>>;
2264
2264
 
2265
2265
  /**
2266
- * Creates group
2267
- *
2268
- * ```typescript
2269
- * connection.createGroup({
2270
- data: {
2271
- groupname: 'groupname',
2272
- desc: 'this is my group',
2273
- members: ['user1', 'user2'],
2274
- public: true,
2275
- approval: false,
2276
- allowinvites: true,
2277
- inviteNeedConfirm: false
2278
- }
2279
- })
2280
- * ```
2281
- */
2266
+ * Creates group
2267
+ *
2268
+ * ```typescript
2269
+ * connection.createGroup({
2270
+ data: {
2271
+ groupname: 'groupname',
2272
+ desc: 'this is my group',
2273
+ members: ['user1', 'user2'],
2274
+ public: true,
2275
+ approval: false,
2276
+ allowinvites: true,
2277
+ inviteNeedConfirm: false
2278
+ }
2279
+ })
2280
+ * ```
2281
+ */
2282
2282
  createGroup(
2283
2283
  this: Connection,
2284
2284
  params: {
@@ -4630,707 +4630,121 @@ export declare namespace EasemobChat {
4630
4630
  ): Promise<AsyncResult<GetReactionDetailResult>>;
4631
4631
 
4632
4632
  /**
4633
- * Creates a server.
4633
+ * Get the chat room all properties.
4634
4634
  *
4635
4635
  * ```typescript
4636
- * connection.createServer({name: 'serverName',icon: '',description: 'the description of the server',ext: 'ext'})
4636
+ * connection.getChatRoomAttributes({chatRoomId: 'roomId')
4637
4637
  * ```
4638
4638
  */
4639
- createServer(
4639
+ getChatRoomAttributes(
4640
4640
  this: Connection,
4641
4641
  params: {
4642
- /** The server name. */
4643
- name: string;
4644
- /** The profile picture of the server. */
4645
- icon?: string;
4646
- /** The description of the server. */
4647
- description?: string;
4648
- /** The extension field. */
4649
- ext?: string;
4650
- }
4651
- ): Promise<AsyncResult<ServerInfo>>;
4652
- /**
4653
- * Deletes a server.
4654
- *
4655
- * ```typescript
4656
- * connection.destroyServer({serverId: 'serverId'})
4657
- * ```
4658
- */
4659
- destroyServer(
4660
- this: Connection,
4661
- params: {
4662
- /** The server ID. */
4663
- serverId: string;
4664
- }
4665
- ): Promise<void>;
4666
-
4667
- /**
4668
- * Updates server.
4669
- *
4670
- * ```typescript
4671
- * connection.updateServer({serverId: 'serverId',name: 'name',icon: '',description: 'new description'})
4672
- * ```
4673
- */
4674
- updateServer(
4675
- this: Connection,
4676
- params: {
4677
- /** The server ID. */
4678
- serverId: string;
4679
- /** The server name. */
4680
- name?: string;
4681
- /** The profile picture of the server. */
4682
- icon?: string;
4683
- /** The description of the server. */
4684
- description?: string;
4685
- /** The extension field. */
4686
- ext?: string;
4687
- }
4688
- ): Promise<AsyncResult<ServerInfo>>;
4689
-
4690
- /**
4691
- * Joins a server.
4692
- *
4693
- * ```typescript
4694
- * connection.joinServer({serverId: 'serverId'})
4695
- * ```
4696
- */
4697
- joinServer(
4698
- this: Connection,
4699
- params: {
4700
- /** The server ID. */
4701
- serverId: string;
4702
- }
4703
- ): Promise<AsyncResult<ServerInfo>>;
4704
-
4705
- /**
4706
- * Leaves the server.
4707
- *
4708
- * ```typescript
4709
- * connection.leaveServer({serverId: 'serverId'})
4710
- * ```
4711
- */
4712
- leaveServer(
4713
- this: Connection,
4714
- params: {
4715
- /** The server ID. */
4716
- serverId: string;
4717
- }
4718
- ): Promise<void>;
4719
-
4720
- /**
4721
- * Removes a member from the server.
4722
- *
4723
- * ```typescript
4724
- * connection.removeServerMember({serverId: 'serverId',userId: 'userId})
4725
- * ```
4726
- */
4727
- removeServerMember(
4728
- this: Connection,
4729
- params: {
4730
- /** The server ID. */
4731
- serverId: string;
4732
- /** The user ID of the member to remove. */
4733
- userId: string;
4734
- }
4735
- ): Promise<void>;
4736
-
4737
- /**
4738
- * Adds tags to server.
4739
- *
4740
- * ```typescript
4741
- * connection.addServerTags({serverId: 'serverId',tags: ['A', 'B']})
4742
- * ```
4743
- */
4744
- addServerTags(
4745
- this: Connection,
4746
- params: {
4747
- /** The server ID. */
4748
- serverId: string;
4749
- /** The tag name list to add. The maximum length of the list is 10. */
4750
- tags: string[];
4751
- }
4752
- ): Promise<AsyncResult<ServerTagList>>;
4753
-
4754
- /**
4755
- * Removes tags from server.
4756
- *
4757
- * ```typescript
4758
- * connection.removeServerTags({serverId: 'serverId',tagIds: ['1', '2']})
4759
- * ```
4760
- */
4761
- removeServerTags(
4762
- this: Connection,
4763
- params: {
4764
- /** The server ID. */
4765
- serverId: string;
4766
- /** The tag ID list to remove. */
4767
- tagIds: string[];
4768
- }
4769
- ): Promise<void>;
4770
-
4771
- /**
4772
- * Use the pagination to get the list of servers by the keyword.Only when the keyword is the full name of the server or the full name of the tag, the method will return results.
4773
- *
4774
- * ```typescript
4775
- * connection.getServers({keyword: 'keyword'})
4776
- * ```
4777
- */
4778
- getServers(
4779
- this: Connection,
4780
- params: {
4781
- /** The key word. */
4782
- keyword: string;
4783
- /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4784
- pageSize?: number;
4785
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4786
- cursor?: string;
4787
- }
4788
- ): Promise<AsyncResult<ServerInfoList>>;
4789
-
4790
- /**
4791
- * Gets the list of joined servers with pagination.
4792
- *
4793
- * ```typescript
4794
- * connection.getJoinedServers({pageSize: '10',cursor: ''})
4795
- * ```
4796
- */
4797
- getJoinedServers(
4798
- this: Connection,
4799
- params: {
4800
- /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4801
- pageSize?: number;
4802
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4803
- cursor?: string;
4804
- }
4805
- ): Promise<AsyncResult<ServerInfoList>>;
4806
-
4807
- /**
4808
- * Gets detail of the server.
4809
- *
4810
- * ```typescript
4811
- * connection.getServerDetail({serverId: 'serverId'})
4812
- * ```
4813
- */
4814
- getServerDetail(
4815
- this: Connection,
4816
- params: {
4817
- /** The server ID. */
4818
- serverId: string;
4819
- }
4820
- ): Promise<AsyncResult<ServerInfo>>;
4821
-
4822
- /**
4823
- * Gets members in the server with pagination.
4824
- *
4825
- * ```typescript
4826
- * connection.getServerMembers({serverId: 'serverId',pageSize:20,cursor:'cursor'})
4827
- * ```
4828
- */
4829
- getServerMembers(
4830
- this: Connection,
4831
- params: {
4832
- /** The server ID. */
4833
- serverId: string;
4834
- /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4835
- pageSize?: number;
4836
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4837
- cursor?: string;
4838
- }
4839
- ): Promise<AsyncResult<ServerMemberData>>;
4840
-
4841
- /**
4842
- * Sets a server admin. Only the server owner can call this method.
4843
- *
4844
- * ```typescript
4845
- * connection.setServerAdmin({serverId: 'serverId',userId:'userId'})
4846
- * ```
4847
- */
4848
- setServerAdmin(
4849
- this: Connection,
4850
- params: {
4851
- /** The server ID. */
4852
- serverId: string;
4853
- /** The user ID to set as admin. */
4854
- userId: string;
4855
- }
4856
- ): Promise<void>;
4857
-
4858
- /**
4859
- * Removes a server admin. Only the server owner can call this method.
4860
- *
4861
- * ```typescript
4862
- * connection.removeServerAdmin({serverId: 'serverId',userId:'userId'})
4863
- * ```
4864
- */
4865
- removeServerAdmin(
4866
- this: Connection,
4867
- params: {
4868
- /** The server ID. */
4869
- serverId: string;
4870
- /** The use ID to remove server admin privileges. */
4871
- userId: string;
4872
- }
4873
- ): Promise<void>;
4874
-
4875
- /**
4876
- * Invites users into a server.
4877
- *
4878
- * ```typescript
4879
- * connection.inviteUserToServer({serverId: 'serverId', userId: 'userId'})
4880
- * ```
4881
- */
4882
-
4883
- inviteUserToServer(
4884
- this: Connection,
4885
- params: {
4886
- /** The server ID. */
4887
- serverId: string;
4888
- /** The Invited user ID. */
4889
- userId: string;
4890
- /** A message inviting users to join the server. */
4891
- message?: string;
4892
- }
4893
- ): Promise<void>;
4894
-
4895
- /**
4896
- * Accepts to the invitation to join the server.
4897
- *
4898
- * ```typescript
4899
- * connection.acceptServerInvite({serverId: 'serverId',inviter: 'uid')
4900
- * ```
4901
- */
4902
- acceptServerInvite(
4903
- this: Connection,
4904
- params: {
4905
- /** The server ID. */
4906
- serverId: string;
4907
- /** The inviter user ID. */
4908
- inviter: string;
4909
- }
4910
- ): Promise<AsyncResult<ServerInfo>>;
4911
-
4912
- /**
4913
- * Rejects to the invitation to join the server.
4914
- *
4915
- * ```typescript
4916
- * connection.rejectServerInvite({serverId: 'serverId',inviter: 'uid')
4917
- * ```
4918
- */
4919
- rejectServerInvite(
4920
- this: Connection,
4921
- params: {
4922
- /** The server ID. */
4923
- serverId: string;
4924
- /** The inviter user ID. */
4925
- inviter: string;
4926
- }
4927
- ): Promise<void>;
4928
-
4929
- /**
4930
- * Gets current user role in the server.
4931
- *
4932
- * ```typescript
4933
- * connection.getServerRole({serverId: 'serverId'})
4934
- * ```
4935
- */
4936
- getServerRole(
4937
- this: Connection,
4938
- params: {
4939
- /** The server ID. */
4940
- serverId: string;
4941
- }
4942
- ): Promise<AsyncResult<ServerRole>>;
4943
-
4944
- /**
4945
- * Checks whether the current member is in the server.
4946
- *
4947
- * ```typescript
4948
- * connection.isInServer({serverId: 'serverId'})
4949
- * ```
4950
- */
4951
- isInServer(
4952
- this: Connection,
4953
- params: {
4954
- /** The server ID. */
4955
- serverId: string;
4642
+ /** The chat room ID. */
4643
+ chatRoomId: string;
4644
+ /** The custom attribute to get. If you pass the attribute key, the SDK returns the attribute value. If you set it as null, the SDK returns all the attributes value. */
4645
+ attributeKeys?: Array<string>;
4956
4646
  }
4957
- ): Promise<AsyncResult<OperationResult>>;
4647
+ ): Promise<AsyncResult<GetChatroomAttributesResult>>;
4958
4648
 
4959
4649
  /**
4960
- * Gets the tag list of the current server.
4650
+ * Set chat room properties in batches.
4961
4651
  *
4962
4652
  * ```typescript
4963
- * connection.getServerTags({serverId: 'serverId'})
4653
+ * connection.setChatRoomAttributes({chatRoomId: 'roomId', attributes: {"key1": "value1","key2":"value2"}, autoDelete: true, isForced: false})
4964
4654
  * ```
4965
4655
  */
4966
- getServerTags(
4656
+ setChatRoomAttributes(
4967
4657
  this: Connection,
4968
4658
  params: {
4969
- /** The server ID. */
4970
- serverId: string;
4659
+ /** The chat room ID. */
4660
+ chatRoomId: string;
4661
+ /** The attributes. */
4662
+ attributes: {
4663
+ [key: string]: string;
4664
+ };
4665
+ /** Whether to delete chat room attributes set by the member when he or she exits the chat room.
4666
+ * (Default)`true`: Yes.
4667
+ * `false`: No. */
4668
+ autoDelete?: boolean;
4669
+ /** Whether to allow a member to overwrite the chat room attribute set by another member.
4670
+ * `true`: Yes.
4671
+ * (Default)`false`: No. */
4672
+ isForced?: boolean;
4971
4673
  }
4972
- ): Promise<AsyncResult<ServerTagList>>;
4674
+ ): Promise<AsyncResult<ChatroomAttributes>>;
4973
4675
 
4974
4676
  /**
4975
- * Creates a channel.
4677
+ * Set chat room properties individually.
4976
4678
  *
4977
4679
  * ```typescript
4978
- * connection.createChannel({
4979
- * serverId: 'serverID',
4980
- * isPublic: true,
4981
- * name: 'channelName',
4982
- * description: 'this is my channel',
4983
- * ext: 'ext'
4984
- * })
4680
+ * connection.setChatroomAttribute({chatRoomId: 'roomId', attributeKey:"key1", attributeValue:"value1", autoDelete: true, isForced: false})
4985
4681
  * ```
4986
4682
  */
4987
- createChannel(
4683
+ setChatRoomAttribute(
4988
4684
  this: Connection,
4989
4685
  params: {
4990
- /** The server ID. */
4991
- serverId: string;
4992
- /** Whether it is a public channel. Public channel: the channel that others can query by calling `getChannels`.
4993
- * - (default)`true`: Yes.
4686
+ /** The chat room ID. */
4687
+ chatRoomId: string;
4688
+ /** The custom attribute key. */
4689
+ attributeKey: string;
4690
+ /** The custom attribute value. */
4691
+ attributeValue: string;
4692
+ /**
4693
+ * Whether to delete chat room attributes set by the member when he or she exits the chat room.
4694
+ * - (Default)`true`: Yes;
4994
4695
  * - `false`: No.
4995
4696
  */
4996
- isPublic?: boolean;
4997
- /** The channel name. */
4998
- name: string;
4999
- /** The description of the channel. */
5000
- description?: string;
5001
- /** The users max amount of the channel.
5002
- * - (default)`0`: 2,000.
5003
- * - `1`: 20,000
5004
- * - `2`: 100,000; */
5005
- rank?: ChannelRank;
5006
- /** The extension field. */
5007
- ext?: string;
5008
- }
5009
- ): Promise<AsyncResult<ChannelInfo>>;
5010
-
5011
- /**
5012
- * Deletes a channel.
5013
- *
5014
- * ```typescript
5015
- * connection.destroyChannel({serverId: 'serverId', channelId: 'channelId'})
5016
- * ```
5017
- */
5018
- destroyChannel(
5019
- this: Connection,
5020
- params: {
5021
- /** The server ID. */
5022
- serverId: string;
5023
- /** The channel ID. */
5024
- channelId: string;
5025
- }
5026
- ): Promise<void>;
5027
-
5028
- /**
5029
- * Updates the channel information.
5030
- *
5031
- * Only the channel admin can call this method.
5032
- *
5033
- * ```typescript
5034
- * connection.updateChannel({
5035
- * serverId: 'serverId',
5036
- * channelId: 'channelId',
5037
- * name: 'the channel name',
5038
- * description: 'the channel description',
5039
- * })
5040
- * ```
5041
- */
5042
- updateChannel(
5043
- this: Connection,
5044
- params: {
5045
- /** The server ID. */
5046
- serverId: string;
5047
- /** The channel ID. */
5048
- channelId: string;
5049
- /** The channel name. */
5050
- name?: string;
5051
- /** The channel description. */
5052
- description?: string;
5053
- /** The users max amount of the channel.
5054
- * - (default)`0`: 2,000.
5055
- * - `1`: 20,000.
5056
- * - `2`: 100,000.
4697
+ autoDelete?: boolean;
4698
+ /**
4699
+ * Whether to allow a member to overwrite the chat room attribute set by another member.
4700
+ * - `true`: Yes;
4701
+ * - (Default)`false`: No.
5057
4702
  */
5058
- rank?: ChannelRank;
5059
- /** The extension field. */
5060
- ext?: string;
5061
- }
5062
- ): Promise<AsyncResult<ChannelInfo>>;
5063
-
5064
- /**
5065
- * Gets the channel detail.
5066
- *
5067
- * ```typescript
5068
- * connection.getChannelDetail({serverId: 'serverId', channelId: 'channelId'})
5069
- * ```
5070
- *
5071
- */
5072
- getChannelDetail(
5073
- this: Connection,
5074
- params: {
5075
- /** The server ID. */
5076
- serverId: string;
5077
- /** The channel ID. */
5078
- channelId: string;
5079
- }
5080
- ): Promise<AsyncResult<ChannelInfo>>;
5081
-
5082
- /**
5083
- * Joins the channel.
5084
- *
5085
- * ```typescript
5086
- * connection.joinChannel({serverId: 'serverId', channelId: 'channelId'})
5087
- * ```
5088
- *
5089
- */
5090
- joinChannel(
5091
- this: Connection,
5092
- params: {
5093
- /** The server ID. */
5094
- serverId: string;
5095
- /** The channel ID. */
5096
- channelId: string;
5097
- }
5098
- ): Promise<AsyncResult<ChannelInfo>>;
5099
-
5100
- /**
5101
- * Leaves the channel.
5102
- *
5103
- * ```typescript
5104
- * connection.leaveChannel({serverId: 'serverId', channelId: 'channelId'})
5105
- * ```
5106
- *
5107
- */
5108
- leaveChannel(
5109
- this: Connection,
5110
- params: {
5111
- /** The server ID. */
5112
- serverId: string;
5113
- /** The channel ID. */
5114
- channelId: string;
5115
- }
5116
- ): Promise<void>;
5117
-
5118
- /**
5119
- * Removes a member from the channel.
5120
- *
5121
- * ```typescript
5122
- * connection.removeChannelMember({serverId: 'serverId', channelId: 'channelId',userId: 'userId'})
5123
- * ```
5124
- *
5125
- */
5126
- removeChannelMember(
5127
- this: Connection,
5128
- params: {
5129
- /** The server ID. */
5130
- serverId: string;
5131
- /** The channel ID. */
5132
- channelId: string;
5133
- /** The user ID. */
5134
- userId: string;
5135
- }
5136
- ): Promise<void>;
5137
-
5138
- /**
5139
- * Gets the list of visible channels with pagination.
5140
- *
5141
- * User can get the joined channels, while the admin and creator can get all private channels.
5142
- *
5143
- * ```typescript
5144
- * connection.getVisiblePrivateChannels({pageSize: 10,cursor: ''})
5145
- * ```
5146
- *
5147
- */
5148
- getVisiblePrivateChannels(
5149
- this: Connection,
5150
- params: {
5151
- /** The server ID. */
5152
- serverId: string;
5153
- /** The number of private channel id that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5154
- pageSize?: number;
5155
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5156
- cursor?: string;
5157
- }
5158
- ): Promise<AsyncResult<ChannelInfoListResult>>;
5159
-
5160
- /**
5161
- * Gets the public channels list in the server with pagination.
5162
- *
5163
- * ```typescript
5164
- * connection.getPublicChannels({pageSize: 10,cursor: ''})
5165
- * ```
5166
- *
5167
- */
5168
- getPublicChannels(
5169
- this: Connection,
5170
- params: {
5171
- /** The server ID. */
5172
- serverId: string;
5173
- /** The number of public channel ID that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5174
- pageSize?: number;
5175
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5176
- cursor?: string;
5177
- }
5178
- ): Promise<AsyncResult<ChannelInfoListResult>>;
5179
-
5180
- /**
5181
- * Gets members in the channel with pagination..
5182
- *
5183
- * ```typescript
5184
- * connection.getChannelMembers({serverId:'serverId', channelId: 'channelId', pageSize: 10,cursor: ''})
5185
- * ```
5186
- *
5187
- */
5188
- getChannelMembers(
5189
- this: Connection,
5190
- params: {
5191
- /** The server ID. */
5192
- serverId: string;
5193
- /** The channel ID. */
5194
- channelId: string;
5195
- /** The number of member that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5196
- pageSize?: number;
5197
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5198
- cursor?: string;
5199
- }
5200
- ): Promise<AsyncResult<ChannelMemberListResult>>;
5201
-
5202
- /**
5203
- * Invites users into a channel.
5204
- *
5205
- * ```typescript
5206
- * connection.inviteUserToChannel({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
5207
- * ```
5208
- */
5209
- inviteUserToChannel(
5210
- this: Connection,
5211
- params: {
5212
- /** The server ID. */
5213
- serverId: string;
5214
- /** The channel ID. */
5215
- channelId: string;
5216
- /** The channel member ID. */
5217
- userId: string;
5218
- /** The invite message. */
5219
- inviteMessage?: string;
5220
- }
5221
- ): Promise<void>;
5222
-
5223
- /**
5224
- * Accepts a channel request.
5225
- *
5226
- * ```typescript
5227
- * connection.acceptChannelInvite({serverId: 'serverId',channelId: 'channelId',inviter:'inviter'})
5228
- * ```
5229
- */
5230
- acceptChannelInvite(
5231
- this: Connection,
5232
- params: {
5233
- /** The server ID. */
5234
- serverId: string;
5235
- /** The channel ID. */
5236
- channelId: string;
5237
- /** The inviter user ID. */
5238
- inviter: string;
5239
- }
5240
- ): Promise<AsyncResult<ChannelInfo>>;
5241
-
5242
- /**
5243
- * Refuses a channel request.
5244
- *
5245
- * ```typescript
5246
- * connection.rejectChannelInvite({serverId: 'serverId',channelId: 'channelId'})
5247
- * ```
5248
- */
5249
- rejectChannelInvite(
5250
- this: Connection,
5251
- params: {
5252
- /** The server ID. */
5253
- serverId: string;
5254
- /** The channel ID. */
5255
- channelId: string;
5256
- /** The inviter user ID. */
5257
- inviter: string;
4703
+ isForced?: boolean;
5258
4704
  }
5259
4705
  ): Promise<void>;
5260
4706
 
5261
4707
  /**
5262
- * Mutes a channel member.
4708
+ * Batch remove chat room attributes.
5263
4709
  *
5264
4710
  * ```typescript
5265
- * connection.muteChannelMember({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
4711
+ * connection.removeChatRoomAttributes({chatRoomId: 'roomId', attributeKeys: ['key1','key2',...], isForced: false })
5266
4712
  * ```
5267
4713
  */
5268
- muteChannelMember(
4714
+ removeChatRoomAttributes(
5269
4715
  this: Connection,
5270
4716
  params: {
5271
- /** The server ID. */
5272
- serverId: string;
5273
- /** The channel ID. */
5274
- channelId: string;
5275
- /** The channel member ID. */
5276
- userId: string;
5277
- /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently.*/
5278
- duration: number;
4717
+ /** The chat room ID. */
4718
+ chatRoomId: string;
4719
+ /** The key of the chat room attribute to delete. */
4720
+ attributeKey: string;
4721
+ /**
4722
+ * Whether to allow a member to delete any chat room attribute set by any member.
4723
+ * - `true`: Yes;
4724
+ * - (Default)`false`: No.
4725
+ */
4726
+ isForced?: boolean;
5279
4727
  }
5280
- ): Promise<void>;
4728
+ ): Promise<AsyncResult<ChatroomAttributes>>;
5281
4729
 
5282
4730
  /**
5283
- * Unmuted a channel member.
4731
+ * Remove chat room attributes individually.
5284
4732
  *
5285
4733
  * ```typescript
5286
- * connection.muteChannelMember({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
4734
+ * connection.removeChatRoomAttribute({chatRoomId: 'roomId', attributeKey: 'attributeValue', isForced: false })
5287
4735
  * ```
5288
4736
  */
5289
- unmuteChannelMember(
4737
+ removeChatRoomAttribute(
5290
4738
  this: Connection,
5291
4739
  params: {
5292
- /** The server ID. */
5293
- serverId: string;
5294
- /** The channel ID. */
5295
- channelId: string;
5296
- /** The channel member ID. */
5297
- userId: string;
4740
+ /** The chat room ID. */
4741
+ chatRoomId: string;
4742
+ /** Delete attribute key. */
4743
+ attributeKey: string;
4744
+ /** remove chatRoom attributes (Allow to delete all contents of the chat room). */
4745
+ isForced?: boolean;
5298
4746
  }
5299
4747
  ): Promise<void>;
5300
-
5301
- /**
5302
- * Gets the mute list of the channel.
5303
- * Only the channel admin or creator can call this method.
5304
- * ```typescript
5305
- * connection.getChannelMutelist({channelId: 'channelId'})
5306
- * ```
5307
- */
5308
- getChannelMutelist(
5309
- this: Connection,
5310
- params: {
5311
- /** The server ID. */
5312
- serverId: string;
5313
- /** The channel ID. */
5314
- channelId: string;
5315
- }
5316
- ): Promise<AsyncResult<ChannelMuteMemberListResult>>;
5317
-
5318
- /**
5319
- * Checks whether the current member is in the channel.
5320
- *
5321
- * ```typescript
5322
- * connection.isInChannel({serverId: 'serverId', channelId: "channelId"})
5323
- * ```
5324
- */
5325
- isInChannel(
5326
- this: Connection,
5327
- params: {
5328
- /** The server ID. */
5329
- serverId: string;
5330
- /** The channel ID. */
5331
- channelId: string;
5332
- }
5333
- ): Promise<AsyncResult<OperationResult>>;
5334
4748
  }
5335
4749
 
5336
4750
  // ----- for EventHandler ------
@@ -5367,271 +4781,31 @@ export declare namespace EasemobChat {
5367
4781
  /** Message sender. */
5368
4782
  from: string;
5369
4783
  /** Message receiver. */
5370
- to: string;
5371
- /** Additional data for the operation event. */
5372
4784
  data?: any;
4785
+ /** ChatRoom Attributes. */
4786
+ /** 聊天室属性。 */
4787
+ attributes?: {
4788
+ [key: string]: string;
4789
+ };
5373
4790
  }
5374
4791
 
5375
- type ServerChangeType =
5376
- | 'update'
5377
- | 'destroy'
5378
- | 'memberPresence'
5379
- | 'memberAbsence'
5380
- | 'inviteToJoin'
5381
- | 'acceptInvite'
5382
- | 'refuseInvite'
5383
- | 'removed'
5384
- | 'updateRole';
5385
-
5386
- type ServerMultiDeviceEventType =
5387
- | 'serverCreate'
5388
- | 'serverDestroy'
5389
- | 'serverUpdate'
5390
- | 'serverJoin'
5391
- | 'serverLeave'
5392
- | 'serverRemoveMember'
5393
- | 'serverInviteUser'
5394
- | 'serverAcceptInvite'
5395
- | 'serverRefuseInvite'
5396
- | 'serverSetRole';
5397
- interface CreateServerResult {
5398
- /** The server ID. */
5399
- serverId: string;
5400
- /** The default channel ID. */
5401
- defaultChannelId: string;
5402
- }
5403
- interface OperationResult {
5404
- result: boolean;
5405
- }
5406
- interface ServerInfo {
5407
- /** The server ID. */
5408
- id: string;
5409
- /** The server name. */
5410
- name: string;
5411
- /** The profile picture of the server. */
5412
- icon?: string;
5413
- /** The default channel ID. */
5414
- defaultChannelId: string;
5415
- /** The owner of the server. */
5416
- owner: string;
5417
- /** The description of the server. */
5418
- description?: string;
5419
- /** The tags list of the server. */
5420
- tags?: ServerTag[];
5421
- /** The extension field. */
5422
- ext?: string;
5423
- /** The Unix timestamp when the server created. The unit is millisecond. */
5424
- created?: number;
5425
- }
5426
- interface ServerInfoList {
5427
- /** The serer information list */
5428
- list: ServerInfo[];
5429
- /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5430
- cursor: string;
5431
- }
5432
-
5433
- interface ServerMember {
5434
- /** The member ID. */
5435
- userId: string;
5436
- /** The member role. */
5437
- role: RoleType;
5438
- }
5439
- interface ServerMemberData {
5440
- /** The server member list. */
5441
- list: ServerMember[];
5442
- /** The position from which to start getting data. At the first method call*/
5443
- cursor?: string;
5444
- }
5445
- interface ServerRole {
5446
- role: RoleType;
5447
- }
5448
- type RoleType = 'owner' | 'moderator' | 'user';
5449
-
5450
- interface ServerTag {
5451
- /** The server tag ID. */
5452
- tagId: string;
5453
- /** The server tag name. */
5454
- tagName: string;
5455
- }
5456
-
5457
- interface ServerTagList {
5458
- /** The server tag list. */
5459
- tags: ServerTag[];
5460
- }
5461
- interface ServerChangeInfo {
5462
- /** The server ID. */
5463
- serverId: string;
5464
- /** The type of operation. */
5465
- operation: ServerChangeType | ServerMultiDeviceEventType;
5466
- /** The operator. */
5467
- operator: string;
5468
- /** The Unix timestamp when the event occurs. The unit is millisecond. */
5469
- timestamp: number;
5470
- /** The operated member ID. */
5471
- userId?: string;
5472
- /** The operated member IDs. */
5473
- userIds?: string[];
5474
- /** The user role. */
5475
- role?: string;
5476
- /** The server name. */
5477
- name?: string;
5478
- /** The description of the server. */
5479
- description?: string;
5480
- /** The extension field. */
5481
- ext?: string;
5482
- /** The profile picture of the server. */
5483
- icon?: string;
5484
- }
5485
-
5486
- enum ChannelRank {
5487
- /** 2,000 channel. */
5488
- RANK_2000,
5489
- /** 20000 channel. */
5490
- RANK_20000,
5491
- /** 100000 channel. */
5492
- RANK_100000,
5493
- }
5494
- interface ChannelInfo {
5495
- /** The server ID. */
5496
- serverId: string;
5497
- /** The channel ID. */
5498
- channelId: string;
5499
- /** The channel name. */
5500
- name: string;
5501
- /** The description of the channel. */
5502
- description: string;
5503
- /** The Unix timestamp when the server created. The unit is millisecond. */
5504
- created?: number;
5505
- /** Whether it is the default channel.
5506
- * - `0`: No.
5507
- * - `1`: Yes.
5508
- */
5509
- defaultChannel: 0 | 1;
5510
- /** The users max amount of the channel.
5511
- * - `0`(default): 2,000.
5512
- * - `1`: 20,000.
5513
- * - `2`: 100,000.
5514
- */
5515
- rank: ChannelRank;
5516
- /** The extension field of the channel. */
5517
- ext: string;
5518
- /** Whether it is a public channel.
5519
- * - `true`: Yes.
5520
- * - `false`: No.
5521
- */
5522
- isPublic: boolean;
5523
- /** Whether the invitee needs to accept the invitation before joining the group.
5524
- - `true`: The invitee's consent is required.
5525
- - `false`: The invitee will be directly added to the group without confirmation.
5526
- */
5527
- inviteNeedConfirm: boolean;
5528
- }
5529
-
5530
- interface ChannelInfoListResult {
5531
- /** The channel information list. */
5532
- list: ChannelInfo[];
5533
- /** The position from which to start getting data. */
5534
- cursor?: string;
5535
- }
5536
-
5537
- interface ChannelMuteMemberItem {
5538
- /** The timestamp when the mute expires. */
5539
- expire: number;
5540
- /** The muted user ID */
5541
- userId: string;
5542
- }
5543
- interface ChannelMuteMemberListResult {
5544
- list: ChannelMuteMemberItem[];
5545
- }
5546
-
5547
- interface ChannelMemberListResult {
5548
- /** The channel member list */
5549
- list: ChannelMember[];
5550
- /** The position from which to start getting data.*/
5551
- cursor?: string;
4792
+ interface GetChatroomAttributesResult {
4793
+ /** ChatRoom ID.*/
4794
+ chatRoomId: string;
4795
+ /** The custom attribute to get. If you pass the attribute key, the SDK returns the attribute value. If you set it as null, the SDK returns all the attributes value. */
4796
+ attributeKeys: Array<string>;
5552
4797
  }
5553
- type ChannelRole = 'owner' | 'moderator' | 'user';
5554
-
5555
- interface ChannelMember {
5556
- /** The member ID. */
5557
- userId: string;
5558
- /** The member role. */
5559
- role: ChannelRole;
4798
+ interface ChatroomAttributes {
4799
+ /** Status code. */
4800
+ status: 'success' | 'fail';
4801
+ /** The keys of failure. */
4802
+ errorKeys: {
4803
+ [key: string]: string;
4804
+ };
4805
+ /** The keys of success. */
4806
+ successKeys: Array<string>;
5560
4807
  }
5561
4808
 
5562
- type ChannelChangeType =
5563
- | 'create'
5564
- | 'destroy'
5565
- | 'update'
5566
- | 'memberAbsence'
5567
- | 'memberPresence'
5568
- | 'removed'
5569
- | 'muteMember'
5570
- | 'unmuteMember'
5571
- | 'inviteToJoin'
5572
- | 'acceptInvite'
5573
- | 'rejectInvite'
5574
- | 'directJoined';
5575
-
5576
- type ChannelMultiDeviceEventType =
5577
- | 'channelCreate'
5578
- | 'channelDestroy'
5579
- | 'channelUpdate'
5580
- | 'channelJoin'
5581
- | 'channelLeave'
5582
- | 'channelRemoveMember'
5583
- | 'channelInviteUser'
5584
- | 'channelMuteMember'
5585
- | 'channelUnMuteMember'
5586
- | 'channelAcceptInvite'
5587
- | 'channelRejectInvite';
5588
-
5589
- interface InviteChannelServerInfo {
5590
- /** The server ID. */
5591
- /** 社区 ID。 */
5592
- id: string;
5593
- /** The profile picture of the server. */
5594
- /** 社区头像。*/
5595
- icon?: string;
5596
- /** The server name. */
5597
- /** 社区名称。 */
5598
- name?: string;
5599
- /** The description of the server. */
5600
- /** 社区描述。 */
5601
- description?: string;
5602
- }
5603
- interface ChannelChangeInfo {
5604
- /** The type of operation. */
5605
- /** 操作类型。 */
5606
- operation: ChannelChangeType | ChannelMultiDeviceEventType;
5607
- /** The channel ID. */
5608
- /** 频道 ID。 */
5609
- id: string;
5610
- /** The channel name. */
5611
- /** 频道名称。 */
5612
- name?: string;
5613
- /** The operator. */
5614
- /** 操作者。 */
5615
- operator: string;
5616
- /** The operated object. */
5617
- /** 被操作的对象。 */
5618
- to: string;
5619
- /** The invite message. */
5620
- /** 邀请用户加入频道的消息。*/
5621
- inviteMessage?: string;
5622
- /** The invite channel server info. */
5623
- /** 邀请加入频道的相关社区信息。*/
5624
- serverInfo?: InviteChannelServerInfo;
5625
- /** The description of the channel. */
5626
- /** 频道描述。 */
5627
- description?: string;
5628
- }
5629
-
5630
- type MultiDeviceData =
5631
- | ThreadMultiDeviceInfo
5632
- | ServerChangeInfo
5633
- | ChannelChangeInfo;
5634
-
5635
4809
  type Event =
5636
4810
  | 'onOpened'
5637
4811
  | 'onPresence'
@@ -5669,9 +4843,7 @@ export declare namespace EasemobChat {
5669
4843
  | 'onChatThreadChange'
5670
4844
  | 'onMultiDeviceEvent'
5671
4845
  | 'onGroupEvent'
5672
- | 'onChatroomEvent'
5673
- | 'onServerEvent'
5674
- | 'onChannelEvent';
4846
+ | 'onChatroomEvent';
5675
4847
 
5676
4848
  interface EventHandlerType {
5677
4849
  /** @deprecated Use { onConnected } instead. */
@@ -5741,17 +4913,13 @@ export declare namespace EasemobChat {
5741
4913
  /** The callback to receive a reaction message. */
5742
4914
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
5743
4915
  /** The callback to receive a multi device event. */
5744
- onMultiDeviceEvent?: (msg: MultiDeviceData) => void;
4916
+ onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
5745
4917
  /** The callback to receive a reaction message. */
5746
4918
  onReactionChange?: (msg: ReactionMessage) => void;
5747
4919
  /** The callback to receive a group event. */
5748
4920
  onGroupEvent?: (eventData: EventData) => void;
5749
4921
  /** The callback to receive a chatroom event. */
5750
4922
  onChatroomEvent?: (eventData: EventData) => void;
5751
- /** The callback to receive a server message. */
5752
- onServerEvent?: (msg: ServerChangeInfo) => void;
5753
- /** The callback to receive a channel message. */
5754
- onChannelEvent?: (msg: ChannelChangeInfo) => void;
5755
4923
  }
5756
4924
 
5757
4925
  interface HandlerData {