node-nim 10.5.2 → 10.6.0
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/dist/nim/msglog.js +8 -0
- package/dist/nim/msglog.js.map +1 -1
- package/dist/v2/v2_nim_ai_service.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_client.js +153 -40
- package/dist/v2/v2_nim_chatroom_client.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_queue_service.js +148 -0
- package/dist/v2/v2_nim_chatroom_queue_service.js.map +1 -0
- package/dist/v2/v2_nim_chatroom_service.js +201 -65
- package/dist/v2/v2_nim_chatroom_service.js.map +1 -1
- package/dist/v2/v2_nim_client.js +116 -25
- package/dist/v2/v2_nim_client.js.map +1 -1
- package/dist/v2/v2_nim_conversation_group_service.js +57 -9
- package/dist/v2/v2_nim_conversation_group_service.js.map +1 -1
- package/dist/v2/v2_nim_conversation_service.js +149 -27
- package/dist/v2/v2_nim_conversation_service.js.map +1 -1
- package/dist/v2/v2_nim_friend_service.js +152 -36
- package/dist/v2/v2_nim_friend_service.js.map +1 -1
- package/dist/v2/v2_nim_login_service.js +66 -14
- package/dist/v2/v2_nim_login_service.js.map +1 -1
- package/dist/v2/v2_nim_message_service.js +335 -93
- package/dist/v2/v2_nim_message_service.js.map +1 -1
- package/dist/v2/v2_nim_notification_service.js +11 -4
- package/dist/v2/v2_nim_notification_service.js.map +1 -1
- package/dist/v2/v2_nim_passthrough_service.js +39 -0
- package/dist/v2/v2_nim_passthrough_service.js.map +1 -0
- package/dist/v2/v2_nim_setting_service.js +81 -29
- package/dist/v2/v2_nim_setting_service.js.map +1 -1
- package/dist/v2/v2_nim_signalling_service.js +172 -44
- package/dist/v2/v2_nim_signalling_service.js.map +1 -1
- package/dist/v2/v2_nim_storage_service.js +116 -37
- package/dist/v2/v2_nim_storage_service.js.map +1 -1
- package/dist/v2/v2_nim_subscription_service.js +42 -12
- package/dist/v2/v2_nim_subscription_service.js.map +1 -1
- package/dist/v2/v2_nim_team_service.js +349 -140
- package/dist/v2/v2_nim_team_service.js.map +1 -1
- package/dist/v2/v2_nim_user_service.js +62 -19
- package/dist/v2/v2_nim_user_service.js.map +1 -1
- package/dist/v2/v2_nim_utilities.js +306 -129
- package/dist/v2/v2_nim_utilities.js.map +1 -1
- package/dist/v2_def/v2_nim_enum_def.js +14 -3
- package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
- package/dist/v2_def/v2_nim_struct_def.js +0 -2
- package/dist/v2_def/v2_nim_struct_def.js.map +1 -1
- package/package.json +1 -1
- package/types/nim/msglog.d.ts +7 -1
- package/types/nim_def/msglog_def.d.ts +2 -0
- package/types/v2/v2_nim_ai_service.d.ts +3 -3
- package/types/v2/v2_nim_chatroom_client.d.ts +153 -42
- package/types/v2/v2_nim_chatroom_queue_service.d.ts +96 -0
- package/types/v2/v2_nim_chatroom_service.d.ts +203 -67
- package/types/v2/v2_nim_client.d.ts +117 -30
- package/types/v2/v2_nim_conversation_group_service.d.ts +59 -11
- package/types/v2/v2_nim_conversation_service.d.ts +151 -29
- package/types/v2/v2_nim_friend_service.d.ts +139 -39
- package/types/v2/v2_nim_login_service.d.ts +70 -15
- package/types/v2/v2_nim_message_service.d.ts +337 -95
- package/types/v2/v2_nim_notification_service.d.ts +13 -6
- package/types/v2/v2_nim_passthrough_service.d.ts +25 -0
- package/types/v2/v2_nim_setting_service.d.ts +83 -31
- package/types/v2/v2_nim_signalling_service.d.ts +174 -46
- package/types/v2/v2_nim_storage_service.d.ts +119 -40
- package/types/v2/v2_nim_subscription_service.d.ts +44 -14
- package/types/v2/v2_nim_team_service.d.ts +335 -142
- package/types/v2/v2_nim_user_service.d.ts +64 -21
- package/types/v2/v2_nim_utilities.d.ts +306 -129
- package/types/v2_def/v2_nim_enum_def.d.ts +10 -0
- package/types/v2_def/v2_nim_struct_def.d.ts +48 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { V2NIMCreateTeamParams, V2NIMAntispamConfig, V2NIMCreateTeamResult, V2NIMError, V2NIMUpdateTeamInfoParams, V2NIMTeam, V2NIMUpdateSelfMemberInfoParams, V2NIMTeamMemberQueryOption, V2NIMTeamMemberListResult, V2NIMTeamMember, V2NIMTeamJoinActionInfo, V2NIMTeamJoinActionInfoResult, V2NIMTeamJoinActionInfoQueryOption, V2NIMTeamMemberSearchOption } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import { V2NIMTeamChatBannedMode, V2NIMTeamMemberRole, V2NIMTeamType } from 'ts/v2_def/v2_nim_enum_def';
|
|
4
|
-
export declare interface
|
|
4
|
+
export declare interface V2NIMTeamListener {
|
|
5
5
|
/** 群组信息同步开始 */
|
|
6
6
|
syncStarted: [];
|
|
7
7
|
/** 群组信息同步完成 */
|
|
@@ -30,176 +30,369 @@ export declare interface V2NIMTeamServiceEvents {
|
|
|
30
30
|
receiveTeamJoinActionInfo: [V2NIMTeamJoinActionInfo];
|
|
31
31
|
}
|
|
32
32
|
/** @brief 存储服务 */
|
|
33
|
-
export declare class V2NIMTeamService extends EventEmitter<
|
|
33
|
+
export declare class V2NIMTeamService extends EventEmitter<V2NIMTeamListener> {
|
|
34
34
|
instance: any;
|
|
35
35
|
constructor();
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @brief 创建群组
|
|
38
|
+
* @param createTeamParams 创建群组参数
|
|
39
|
+
* @param inviteeAccountIds 群组创建时, 同时被邀请加入群的成员列表
|
|
40
|
+
* @param postscript 群组创建时, 邀请入群的附言
|
|
41
|
+
* @param antispamConfig 反垃圾配置
|
|
42
|
+
* @returns Promise<V2NIMCreateTeamResult>
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* const result = await v2.teamService.createTeam({
|
|
46
|
+
* name: 'team1',
|
|
47
|
+
* teamType: 0,
|
|
48
|
+
* }, inviteeAccountIds, postscript, antispamConfig)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
42
51
|
createTeam(createTeamParams: V2NIMCreateTeamParams, inviteeAccountIds: Array<string>, postscript: string, antispamConfig: V2NIMAntispamConfig): Promise<V2NIMCreateTeamResult>;
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @brief 修改群组信息
|
|
54
|
+
* @param teamId 群组 id
|
|
55
|
+
* @param teamType 群组类型
|
|
56
|
+
* @param updateTeamInfoParams 修改群组信息参数
|
|
57
|
+
* @param antispamConfig 反垃圾配置
|
|
58
|
+
* @returns void
|
|
59
|
+
* @example
|
|
60
|
+
* ```javascript
|
|
61
|
+
* await v2.teamService.updateTeamInfo(teamId, teamType, {
|
|
62
|
+
* name: 'team1',
|
|
63
|
+
* }, antispamConfig)
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
49
66
|
updateTeamInfo(teamId: string, teamType: V2NIMTeamType, updateTeamInfoParams: V2NIMUpdateTeamInfoParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
/**
|
|
68
|
+
* @brief 退出群组
|
|
69
|
+
* @param teamId 群组 id
|
|
70
|
+
* @param teamType 群组类型
|
|
71
|
+
* @returns void
|
|
72
|
+
* @example
|
|
73
|
+
* ```javascript
|
|
74
|
+
* await v2.teamService.leaveTeam(teamId, teamType)
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
54
77
|
leaveTeam(teamId: string, teamType: V2NIMTeamType): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @brief 获取群组信息
|
|
80
|
+
* @param teamId 群组 id
|
|
81
|
+
* @param teamType 群组类型
|
|
82
|
+
* @returns Promise<V2NIMTeam>
|
|
83
|
+
* @example
|
|
84
|
+
* ```javascript
|
|
85
|
+
* const team = await v2.teamService.getTeamInfo(teamId, teamType)
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
59
88
|
getTeamInfo(teamId: string, teamType: V2NIMTeamType): Promise<V2NIMTeam>;
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
/**
|
|
90
|
+
* @brief 根据群组 ID 获取群组信息
|
|
91
|
+
* @param teamIds 群组 id 列表
|
|
92
|
+
* @param teamType 群组类型
|
|
93
|
+
* @returns Promise<Array<V2NIMTeam>>
|
|
94
|
+
* @example
|
|
95
|
+
* ```javascript
|
|
96
|
+
* const teams = await v2.teamService.getTeamInfoByIds(teamIds, teamType)
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
64
99
|
getTeamInfoByIds(teamIds: Array<string>, teamType: V2NIMTeamType): Promise<Array<V2NIMTeam>>;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @brief 解散群组
|
|
102
|
+
* @param teamId 群组 id
|
|
103
|
+
* @param teamType 群组类型
|
|
104
|
+
* @returns void
|
|
105
|
+
* @example
|
|
106
|
+
* ```javascript
|
|
107
|
+
* await v2.teamService.dismissTeam(teamId, teamType)
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
69
110
|
dismissTeam(teamId: string, teamType: V2NIMTeamType): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
111
|
+
/**
|
|
112
|
+
* @brief 邀请成员加入群组
|
|
113
|
+
* @param teamId 群组 id
|
|
114
|
+
* @param teamType 群组类型
|
|
115
|
+
* @param inviteeAccountIds 被邀请人 id 列表
|
|
116
|
+
* @param postscript 邀请附言
|
|
117
|
+
* @returns Promise<Array<string>>
|
|
118
|
+
* @example
|
|
119
|
+
* ```javascript
|
|
120
|
+
* const accountIds = await v2.teamService.inviteMember(teamId, teamType, inviteeAccountIds, postscript)
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
76
123
|
inviteMember(teamId: string, teamType: V2NIMTeamType, inviteeAccountIds: Array<string>, postscript: string): Promise<Array<string>>;
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
124
|
+
/**
|
|
125
|
+
* @brief 同意邀请入群
|
|
126
|
+
* @param invitationInfo 邀请信息
|
|
127
|
+
* @returns Promise<V2NIMTeam>
|
|
128
|
+
* @example
|
|
129
|
+
* ```javascript
|
|
130
|
+
* const team = await v2.teamService.acceptInvitation(invitationInfo)
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
82
133
|
acceptInvitation(invitationInfo: V2NIMTeamJoinActionInfo): Promise<V2NIMTeam>;
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
134
|
+
/**
|
|
135
|
+
* @brief 拒绝邀请入群
|
|
136
|
+
* @param invitationInfo 邀请信息
|
|
137
|
+
* @param postscript 拒绝邀请的理由附言
|
|
138
|
+
* @returns void
|
|
139
|
+
* @example
|
|
140
|
+
* ```javascript
|
|
141
|
+
* await v2.teamService.rejectInvitation(invitationInfo, postscript)
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
89
144
|
rejectInvitation(invitationInfo: V2NIMTeamJoinActionInfo, postscript: string): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @brief 踢出群组成员
|
|
147
|
+
* @param teamId 群组 id
|
|
148
|
+
* @param teamType 群组类型
|
|
149
|
+
* @param memberAccountIds 踢出群组的成员账号列表
|
|
150
|
+
* @returns void
|
|
151
|
+
* @example
|
|
152
|
+
* ```javascript
|
|
153
|
+
* await v2.teamService.kickMember(teamId, teamType, memberAccountIds)
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
95
156
|
kickMember(teamId: string, teamType: V2NIMTeamType, memberAccountIds: Array<string>): Promise<void>;
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
157
|
+
/**
|
|
158
|
+
* @brief 申请加入群组
|
|
159
|
+
* @param teamId 群组 id
|
|
160
|
+
* @param teamType 群组类型
|
|
161
|
+
* @param postscript 申请入群的附言
|
|
162
|
+
* @returns Promise<V2NIMTeam>
|
|
163
|
+
* @example
|
|
164
|
+
* ```javascript
|
|
165
|
+
* const team = await v2.teamService.applyJoinTeam(teamId, teamType, postscript)
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
101
168
|
applyJoinTeam(teamId: string, teamType: V2NIMTeamType, postscript: string): Promise<V2NIMTeam>;
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
169
|
+
/**
|
|
170
|
+
* @brief 接受入群申请
|
|
171
|
+
* @param applicationInfo 申请信息
|
|
172
|
+
* @returns void
|
|
173
|
+
* @example
|
|
174
|
+
* ```javascript
|
|
175
|
+
* await v2.teamService.acceptJoinApplication(applicationInfo)
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
107
178
|
acceptJoinApplication(applicationInfo: V2NIMTeamJoinActionInfo): Promise<void>;
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
179
|
+
/**
|
|
180
|
+
* @brief 拒绝入群申请
|
|
181
|
+
* @param applicationInfo 申请信息
|
|
182
|
+
* @param postscript 拒绝入群申请的附言
|
|
183
|
+
* @returns void
|
|
184
|
+
* @example
|
|
185
|
+
* ```javascript
|
|
186
|
+
* await v2.teamService.rejectJoinApplication(applicationInfo, postscript)
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
114
189
|
rejectJoinApplication(applicationInfo: V2NIMTeamJoinActionInfo, postscript: string): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
190
|
+
/**
|
|
191
|
+
* @brief 设置成员角色
|
|
192
|
+
* @param teamId 群组 id
|
|
193
|
+
* @param teamType 群组类型
|
|
194
|
+
* @param memberAccountIds 成员 id 列表
|
|
195
|
+
* @param memberRole 设置新的角色类型
|
|
196
|
+
* @returns void
|
|
197
|
+
* @example
|
|
198
|
+
* ```javascript
|
|
199
|
+
* await v2.teamService.updateTeamMemberRole(teamId, teamType, memberAccountIds, memberRole)
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
121
202
|
updateTeamMemberRole(teamId: string, teamType: V2NIMTeamType, memberAccountIds: Array<string>, memberRole: V2NIMTeamMemberRole): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
203
|
+
/**
|
|
204
|
+
* @brief 移交群主
|
|
205
|
+
* @param teamId 群组 id
|
|
206
|
+
* @param teamType 群组类型
|
|
207
|
+
* @param accountId 新群主 id
|
|
208
|
+
* @param leave 是否同时退出群组
|
|
209
|
+
* @returns void
|
|
210
|
+
* @example
|
|
211
|
+
* ```javascript
|
|
212
|
+
* await v2.teamService.transferTeamOwner(teamId, teamType, accountId, leave)
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
128
215
|
transferTeamOwner(teamId: string, teamType: V2NIMTeamType, accountId: string, leave: boolean): Promise<void>;
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
216
|
+
/**
|
|
217
|
+
* @brief 修改自己的群成员信息
|
|
218
|
+
* @param teamId 群组 id
|
|
219
|
+
* @param teamType 群组类型
|
|
220
|
+
* @param memberInfoParams 修改群成员信息参数
|
|
221
|
+
* @returns void
|
|
222
|
+
* @example
|
|
223
|
+
* ```javascript
|
|
224
|
+
* await v2.teamService.updateSelfTeamMemberInfo(teamId, teamType, memberInfoParams)
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
134
227
|
updateSelfTeamMemberInfo(teamId: string, teamType: V2NIMTeamType, memberInfoParams: V2NIMUpdateSelfMemberInfoParams): Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
228
|
+
/**
|
|
229
|
+
* @brief 修改群成员昵称
|
|
230
|
+
* @param teamId 群组 id
|
|
231
|
+
* @param teamType 群组类型
|
|
232
|
+
* @param accountId 群成员 id
|
|
233
|
+
* @param nick 群成员昵称
|
|
234
|
+
* @returns void
|
|
235
|
+
* @example
|
|
236
|
+
* ```javascript
|
|
237
|
+
* await v2.teamService.updateTeamMemberNick(teamId, teamType, accountId, teamNick)
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
141
240
|
updateTeamMemberNick(teamId: string, teamType: V2NIMTeamType, accountId: string, teamNick: string): Promise<void>;
|
|
142
|
-
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
241
|
+
/**
|
|
242
|
+
* @brief 设置群组禁言模式
|
|
243
|
+
* @param teamId 群组 id
|
|
244
|
+
* @param teamType 群组类型
|
|
245
|
+
* @param chatBannedMode 群组禁言模式
|
|
246
|
+
* @returns void
|
|
247
|
+
* @example
|
|
248
|
+
* ```javascript
|
|
249
|
+
* await v2.teamService.setTeamChatBannedMode(teamId, teamType, chatBannedMode)
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
147
252
|
setTeamChatBannedMode(teamId: string, teamType: V2NIMTeamType, chatBannedMode: V2NIMTeamChatBannedMode): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
253
|
+
/**
|
|
254
|
+
* @brief 设置群组成员聊天禁言状态
|
|
255
|
+
* @param teamId 群组 id
|
|
256
|
+
* @param teamType 群组类型
|
|
257
|
+
* @param accountId 群成员 id
|
|
258
|
+
* @param chatBanned 是否禁言
|
|
259
|
+
* @returns void
|
|
260
|
+
* @example
|
|
261
|
+
* ```javascript
|
|
262
|
+
* await v2.teamService.setTeamMemberChatBannedStatus(teamId, teamType, accountId, chatBanned)
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
154
265
|
setTeamMemberChatBannedStatus(teamId: string, teamType: V2NIMTeamType, accountId: string, chatBanned: boolean): Promise<void>;
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
266
|
+
/**
|
|
267
|
+
* @brief 获取当前已经加入的群组列表
|
|
268
|
+
* @param teamType 群组类型
|
|
269
|
+
* @returns Promise<Array<V2NIMTeam>>
|
|
270
|
+
* @example
|
|
271
|
+
* ```javascript
|
|
272
|
+
* const teams = await v2.teamService.getJoinedTeamList(teamTypes)
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
158
275
|
getJoinedTeamList(teamTypes: Array<V2NIMTeamType>): Promise<Array<V2NIMTeam>>;
|
|
159
|
-
/**
|
|
160
|
-
|
|
161
|
-
|
|
276
|
+
/**
|
|
277
|
+
* @brief 获取当前已经加入的群组数量
|
|
278
|
+
* @param teamTypes 群组类型列表, 为空表示查询所有群类型
|
|
279
|
+
* @returns number
|
|
280
|
+
* @example
|
|
281
|
+
* ```javascript
|
|
282
|
+
* const count = v2.teamService.getJoinedTeamCount(teamTypes)
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
162
285
|
getJoinedTeamCount(teamTypes: Array<V2NIMTeamType>): number;
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
286
|
+
/**
|
|
287
|
+
* @brief 获取群组成员列表
|
|
288
|
+
* @param teamId 群组 id
|
|
289
|
+
* @param teamType 群组类型
|
|
290
|
+
* @param queryOption 群组成员查询选项
|
|
291
|
+
* @returns Promise<V2NIMTeamMemberListResult>
|
|
292
|
+
* @example
|
|
293
|
+
* ```javascript
|
|
294
|
+
* const result = await v2.teamService.getTeamMemberList(teamId, teamType, {
|
|
295
|
+
* limit: 10,
|
|
296
|
+
* nextToken: ''
|
|
297
|
+
* })
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
168
300
|
getTeamMemberList(teamId: string, teamType: V2NIMTeamType, queryOption: V2NIMTeamMemberQueryOption): Promise<V2NIMTeamMemberListResult>;
|
|
169
|
-
/**
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
301
|
+
/**
|
|
302
|
+
* @brief 根据账号 ID 列表获取群组成员列表
|
|
303
|
+
* @param teamId 群组 id
|
|
304
|
+
* @param teamType 群组类型
|
|
305
|
+
* @param accountIds 账号 ID 列表
|
|
306
|
+
* @returns Promise<Array<V2NIMTeamMember>>
|
|
307
|
+
* @example
|
|
308
|
+
* ```javascript
|
|
309
|
+
* const members = await v2.teamService.getTeamMemberListByIds(teamId, teamType, accountIds)
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
174
312
|
getTeamMemberListByIds(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<Array<V2NIMTeamMember>>;
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
313
|
+
/**
|
|
314
|
+
* @brief 根据账号 ID 列表获取群组成员邀请人
|
|
315
|
+
* @param teamId 群组 id
|
|
316
|
+
* @param teamType 群组类型
|
|
317
|
+
* @param accountIds 账号 ID 列表
|
|
318
|
+
* @returns Promise<Map<string, string>>
|
|
319
|
+
* @example
|
|
320
|
+
* ```javascript
|
|
321
|
+
* const invitorMap = await v2.teamService.getTeamMemberInvitor(teamId, teamType, accountIds)
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
180
324
|
getTeamMemberInvitor(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<Map<string, string>>;
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
|
|
325
|
+
/**
|
|
326
|
+
* @brief 获取群加入相关信息
|
|
327
|
+
* @param option 查询参数
|
|
328
|
+
* @returns Promise<V2NIMTeamJoinActionInfoResult>
|
|
329
|
+
* @example
|
|
330
|
+
* ```javascript
|
|
331
|
+
* const result = await v2.teamService.getTeamJoinActionInfoList(option)
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
184
334
|
getTeamJoinActionInfoList(option: V2NIMTeamJoinActionInfoQueryOption): Promise<V2NIMTeamJoinActionInfoResult>;
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
|
|
335
|
+
/**
|
|
336
|
+
* @brief 根据关键字搜索群组,混合搜索高级群和超大群,使用 LIKE 方式匹配,只搜索群名称
|
|
337
|
+
* @param keyword 关键字
|
|
338
|
+
* @returns Promise<Array<V2NIMTeam>>
|
|
339
|
+
* @example
|
|
340
|
+
* ```javascript
|
|
341
|
+
* const teams = await v2.teamService.searchTeamByKeyword(keyword)
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
188
344
|
searchTeamByKeyword(keyword: string): Promise<Array<V2NIMTeam>>;
|
|
189
|
-
/**
|
|
190
|
-
|
|
191
|
-
|
|
345
|
+
/**
|
|
346
|
+
* @brief 根据关键字搜索群组成员
|
|
347
|
+
* @param option 搜索选项
|
|
348
|
+
* @returns Promise<V2NIMTeamMemberListResult>
|
|
349
|
+
* @example
|
|
350
|
+
* ```javascript
|
|
351
|
+
* const result = await v2.teamService.searchTeamMembers(option)
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
192
354
|
searchTeamMembers(option: V2NIMTeamMemberSearchOption): Promise<V2NIMTeamMemberListResult>;
|
|
193
|
-
/**
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
355
|
+
/**
|
|
356
|
+
* @brief 添加特别关注群成员列表
|
|
357
|
+
* @param teamId 群组 id
|
|
358
|
+
* @param teamType 群组类型
|
|
359
|
+
* @param accountIds 账号 id 列表
|
|
360
|
+
* @returns void
|
|
361
|
+
* @example
|
|
362
|
+
* ```javascript
|
|
363
|
+
* await v2.teamService.addTeamMembersFollow(teamId, teamType, accountIds)
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
198
366
|
addTeamMembersFollow(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<void>;
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
367
|
+
/**
|
|
368
|
+
* @brief 移除特别关注群成员列表
|
|
369
|
+
* @param teamId 群组 id
|
|
370
|
+
* @param teamType 群组类型
|
|
371
|
+
* @param accountIds 账号 id 列表
|
|
372
|
+
* @returns void
|
|
373
|
+
* @example
|
|
374
|
+
* ```javascript
|
|
375
|
+
* await v2.teamService.removeTeamMembersFollow(teamId, teamType, accountIds)
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
204
378
|
removeTeamMembersFollow(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* @brief 清空所有群申请
|
|
381
|
+
* @returns void
|
|
382
|
+
* @example
|
|
383
|
+
* ```javascript
|
|
384
|
+
* await v2.teamService.clearAllTeamJoinActionInfo()
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
clearAllTeamJoinActionInfo(): Promise<void>;
|
|
388
|
+
/**
|
|
389
|
+
* @brief 删除群申请
|
|
390
|
+
* @param applicationInfo 群申请信息
|
|
391
|
+
* @returns void
|
|
392
|
+
* @example
|
|
393
|
+
* ```javascript
|
|
394
|
+
* await v2.teamService.deleteTeamJoinActionInfo(applicationInfo)
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
deleteTeamJoinActionInfo(applicationInfo: V2NIMTeamJoinActionInfo): Promise<void>;
|
|
205
398
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { V2NIMUser, V2NIMUserUpdateParams, V2NIMUserSearchOption } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
|
-
export declare interface
|
|
3
|
+
export declare interface V2NIMUserListener {
|
|
4
4
|
/** 用户资料变更 */
|
|
5
5
|
userProfileChanged: [Array<V2NIMUser>];
|
|
6
6
|
/** 添加黑名单 */
|
|
@@ -9,36 +9,79 @@ export declare interface V2NIMUserServiceEvents {
|
|
|
9
9
|
blockListRemoved: [string];
|
|
10
10
|
}
|
|
11
11
|
/** @brief 用户资料服务 */
|
|
12
|
-
export declare class V2NIMUserService extends EventEmitter<
|
|
12
|
+
export declare class V2NIMUserService extends EventEmitter<V2NIMUserListener> {
|
|
13
13
|
instance: any;
|
|
14
14
|
constructor();
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @brief 根据用户账号列表获取用户资料
|
|
17
|
+
* @param accountIds 用户账号列表
|
|
18
|
+
* @returns void
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const users = await v2.userService.getUserList(accountIds)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
18
24
|
getUserList(accountIds: Array<string>): Promise<Array<V2NIMUser>>;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @brief 更新自己的用户资料
|
|
27
|
+
* @param updateParams 更新参数
|
|
28
|
+
* @returns void
|
|
29
|
+
* @example
|
|
30
|
+
* ```javascript
|
|
31
|
+
* await v2.userService.updateSelfUserProfile(updateParams)
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
22
34
|
updateSelfUserProfile(updateParams: V2NIMUserUpdateParams): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @brief 添加用户到黑名单中
|
|
37
|
+
* @param accountId 用户账号
|
|
38
|
+
* @returns void
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* await v2.userService.addUserToBlockList(accountId)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
26
44
|
addUserToBlockList(accountId: string): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
/**
|
|
46
|
+
* @brief 从黑名单中移除用户
|
|
47
|
+
* @param accountId 用户账号
|
|
48
|
+
* @returns void
|
|
49
|
+
* @example
|
|
50
|
+
* ```javascript
|
|
51
|
+
* await v2.userService.removeUserFromBlockList(accountId)
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
30
54
|
removeUserFromBlockList(accountId: string): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @brief 获取黑名单列表
|
|
57
|
+
* @returns void
|
|
58
|
+
* @example
|
|
59
|
+
* ```javascript
|
|
60
|
+
* const blockList = await v2.userService.getBlockList()
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
33
63
|
getBlockList(): Promise<Array<string>>;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
64
|
+
/**
|
|
65
|
+
* @brief 根据用户账号列表从服务器获取用户资料, 主要使用 getUserList ,只有强制需要拉取最新用户信息才需要使用该接口
|
|
66
|
+
* @param accountIds 用户账号列表
|
|
67
|
+
* @returns void
|
|
68
|
+
* @example
|
|
69
|
+
* ```javascript
|
|
70
|
+
* const users = await v2.userService.getUserListFromCloud(accountIds)
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
37
73
|
getUserListFromCloud(accountIds: Array<string>): Promise<Array<V2NIMUser>>;
|
|
38
74
|
/**
|
|
39
|
-
* 根据关键字搜索好友信息
|
|
75
|
+
* @brief 根据关键字搜索好友信息
|
|
40
76
|
* @param option 搜索选项 @see V2NIMUserSearchOption
|
|
41
|
-
* @
|
|
77
|
+
* @returns Promise<Array<V2NIMUser>>
|
|
78
|
+
* @example
|
|
79
|
+
* ```javascript
|
|
80
|
+
* const users = await v2.userService.searchUserByOption({
|
|
81
|
+
* keyword: 'Alice',
|
|
82
|
+
* searchName: true
|
|
83
|
+
* })
|
|
84
|
+
* ```
|
|
42
85
|
*/
|
|
43
86
|
searchUserByOption(option: V2NIMUserSearchOption): Promise<Array<V2NIMUser>>;
|
|
44
87
|
}
|