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.
Files changed (67) hide show
  1. package/dist/nim/msglog.js +8 -0
  2. package/dist/nim/msglog.js.map +1 -1
  3. package/dist/v2/v2_nim_ai_service.js.map +1 -1
  4. package/dist/v2/v2_nim_chatroom_client.js +153 -40
  5. package/dist/v2/v2_nim_chatroom_client.js.map +1 -1
  6. package/dist/v2/v2_nim_chatroom_queue_service.js +148 -0
  7. package/dist/v2/v2_nim_chatroom_queue_service.js.map +1 -0
  8. package/dist/v2/v2_nim_chatroom_service.js +201 -65
  9. package/dist/v2/v2_nim_chatroom_service.js.map +1 -1
  10. package/dist/v2/v2_nim_client.js +116 -25
  11. package/dist/v2/v2_nim_client.js.map +1 -1
  12. package/dist/v2/v2_nim_conversation_group_service.js +57 -9
  13. package/dist/v2/v2_nim_conversation_group_service.js.map +1 -1
  14. package/dist/v2/v2_nim_conversation_service.js +149 -27
  15. package/dist/v2/v2_nim_conversation_service.js.map +1 -1
  16. package/dist/v2/v2_nim_friend_service.js +152 -36
  17. package/dist/v2/v2_nim_friend_service.js.map +1 -1
  18. package/dist/v2/v2_nim_login_service.js +66 -14
  19. package/dist/v2/v2_nim_login_service.js.map +1 -1
  20. package/dist/v2/v2_nim_message_service.js +335 -93
  21. package/dist/v2/v2_nim_message_service.js.map +1 -1
  22. package/dist/v2/v2_nim_notification_service.js +11 -4
  23. package/dist/v2/v2_nim_notification_service.js.map +1 -1
  24. package/dist/v2/v2_nim_passthrough_service.js +39 -0
  25. package/dist/v2/v2_nim_passthrough_service.js.map +1 -0
  26. package/dist/v2/v2_nim_setting_service.js +81 -29
  27. package/dist/v2/v2_nim_setting_service.js.map +1 -1
  28. package/dist/v2/v2_nim_signalling_service.js +172 -44
  29. package/dist/v2/v2_nim_signalling_service.js.map +1 -1
  30. package/dist/v2/v2_nim_storage_service.js +116 -37
  31. package/dist/v2/v2_nim_storage_service.js.map +1 -1
  32. package/dist/v2/v2_nim_subscription_service.js +42 -12
  33. package/dist/v2/v2_nim_subscription_service.js.map +1 -1
  34. package/dist/v2/v2_nim_team_service.js +349 -140
  35. package/dist/v2/v2_nim_team_service.js.map +1 -1
  36. package/dist/v2/v2_nim_user_service.js +62 -19
  37. package/dist/v2/v2_nim_user_service.js.map +1 -1
  38. package/dist/v2/v2_nim_utilities.js +306 -129
  39. package/dist/v2/v2_nim_utilities.js.map +1 -1
  40. package/dist/v2_def/v2_nim_enum_def.js +14 -3
  41. package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
  42. package/dist/v2_def/v2_nim_struct_def.js +0 -2
  43. package/dist/v2_def/v2_nim_struct_def.js.map +1 -1
  44. package/package.json +1 -1
  45. package/types/nim/msglog.d.ts +7 -1
  46. package/types/nim_def/msglog_def.d.ts +2 -0
  47. package/types/v2/v2_nim_ai_service.d.ts +3 -3
  48. package/types/v2/v2_nim_chatroom_client.d.ts +153 -42
  49. package/types/v2/v2_nim_chatroom_queue_service.d.ts +96 -0
  50. package/types/v2/v2_nim_chatroom_service.d.ts +203 -67
  51. package/types/v2/v2_nim_client.d.ts +117 -30
  52. package/types/v2/v2_nim_conversation_group_service.d.ts +59 -11
  53. package/types/v2/v2_nim_conversation_service.d.ts +151 -29
  54. package/types/v2/v2_nim_friend_service.d.ts +139 -39
  55. package/types/v2/v2_nim_login_service.d.ts +70 -15
  56. package/types/v2/v2_nim_message_service.d.ts +337 -95
  57. package/types/v2/v2_nim_notification_service.d.ts +13 -6
  58. package/types/v2/v2_nim_passthrough_service.d.ts +25 -0
  59. package/types/v2/v2_nim_setting_service.d.ts +83 -31
  60. package/types/v2/v2_nim_signalling_service.d.ts +174 -46
  61. package/types/v2/v2_nim_storage_service.d.ts +119 -40
  62. package/types/v2/v2_nim_subscription_service.d.ts +44 -14
  63. package/types/v2/v2_nim_team_service.d.ts +335 -142
  64. package/types/v2/v2_nim_user_service.d.ts +64 -21
  65. package/types/v2/v2_nim_utilities.d.ts +306 -129
  66. package/types/v2_def/v2_nim_enum_def.d.ts +10 -0
  67. 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 V2NIMTeamServiceEvents {
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<V2NIMTeamServiceEvents> {
33
+ export declare class V2NIMTeamService extends EventEmitter<V2NIMTeamListener> {
34
34
  instance: any;
35
35
  constructor();
36
- /** @brief 创建群组 */
37
- /** @param createTeamParams 创建群组参数 */
38
- /** @param inviteeAccountIds 群组创建时, 同时被邀请加入群的成员列表 */
39
- /** @param postscript 群组创建时, 邀请入群的附言 */
40
- /** @param antispamConfig 反垃圾配置 */
41
- /** @return void */
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
- /** @brief 修改群组信息 */
44
- /** @param teamId 群组 id */
45
- /** @param teamType 群组类型 */
46
- /** @param updateTeamInfoParams 修改群组信息参数 */
47
- /** @param antispamConfig 反垃圾配置 */
48
- /** @return void */
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
- /** @brief 退出群组 */
51
- /** @param teamId 群组 id */
52
- /** @param teamType 群组类型 */
53
- /** @return void */
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
- /** @brief 获取群组信息 */
56
- /** @param teamId 群组 id */
57
- /** @param teamType 群组类型 */
58
- /** @return void */
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
- /** @brief 根据群组 ID 获取群组信息 */
61
- /** @param teamIds 群组 id 列表 */
62
- /** @param teamType 群组类型 */
63
- /** @return void */
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
- /** @brief 解散群组 */
66
- /** @param teamId 群组 id */
67
- /** @param teamType 群组类型 */
68
- /** @return void */
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
- /** @brief 邀请成员加入群组 */
71
- /** @param teamId 群组 id */
72
- /** @param teamType 群组类型 */
73
- /** @param inviteeAccountIds 被邀请人 id 列表 */
74
- /** @param postscript 邀请附言 */
75
- /** @return void */
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
- /** @brief 同意邀请入群 */
78
- /** @param teamId 群组 id */
79
- /** @param teamType 群组类型 */
80
- /** @param invitorAccountId 邀请人 id */
81
- /** @return void */
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
- /** @brief 拒绝邀请入群 */
84
- /** @param teamId 群组 id */
85
- /** @param teamType 群组类型 */
86
- /** @param invitorAccountId 邀请人 id */
87
- /** @param postscript 拒绝邀请的理由附言 */
88
- /** @return void */
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
- /** @brief 踢出群组成员 */
91
- /** @param teamId 群组 id */
92
- /** @param teamType 群组类型 */
93
- /** @param memberAccountIds 踢出群组的成员账号列表 */
94
- /** @return void */
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
- /** @brief 申请加入群组 */
97
- /** @param teamId 群组 id */
98
- /** @param teamType 群组类型 */
99
- /** @param postscript 申请入群的附言 */
100
- /** @return void */
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
- /** @brief 接受入群申请 */
103
- /** @param teamId 群组 id */
104
- /** @param teamType 群组类型 */
105
- /** @param applyAccountId 申请人 id */
106
- /** @return void */
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
- /** @brief 拒绝入群申请 */
109
- /** @param teamId 群组 id */
110
- /** @param teamType 群组类型 */
111
- /** @param applyAccountId 申请人 id */
112
- /** @param postscript 拒绝入群申请的附言 */
113
- /** @return void */
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
- /** @brief 设置成员角色 */
116
- /** @param teamId 群组 id */
117
- /** @param teamType 群组类型 */
118
- /** @param memberAccountId 成员 id */
119
- /** @param memberRole 设置新的角色类型 */
120
- /** @return void */
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
- /** @brief 移交群主 */
123
- /** @param teamId 群组 id */
124
- /** @param teamType 群组类型 */
125
- /** @param accountId 新群主 id */
126
- /** @param leave 是否同时退出群组 */
127
- /** @return void */
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
- /** @brief 修改自己的群成员信息 */
130
- /** @param teamId 群组 id */
131
- /** @param teamType 群组类型 */
132
- /** @param memberInfoParams 修改群成员信息参数 */
133
- /** @return void */
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
- /** @brief 修改群成员昵称 */
136
- /** @param teamId 群组 id */
137
- /** @param teamType 群组类型 */
138
- /** @param accountId 群成员 id */
139
- /** @param nick 群成员昵称 */
140
- /** @return void */
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
- /** @brief 设置群组禁言模式 */
143
- /** @param teamId 群组 id */
144
- /** @param teamType 群组类型 */
145
- /** @param chatBannedMode 群组禁言模式 */
146
- /** @return void */
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
- /** @brief 设置群组成员聊天禁言状态 */
149
- /** @param teamId 群组 id */
150
- /** @param teamType 群组类型 */
151
- /** @param accountId 群成员 id */
152
- /** @param chatBanned 是否禁言 */
153
- /** @return void */
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
- /** @brief 获取当前已经加入的群组列表 */
156
- /** @param teamType 群组类型 */
157
- /** @return void */
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
- /** @brief 获取当前已经加入的群组数量 */
160
- /** @param teamTypes 群组类型列表, 为空表示查询所有群类型 */
161
- /** @return number */
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
- /** @brief 获取群组成员列表 */
164
- /** @param teamId 群组 id */
165
- /** @param teamType 群组类型 */
166
- /** @param queryOption 群组成员查询选项 */
167
- /** @return void */
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
- /** @brief 根据账号 ID 列表获取群组成员列表 */
170
- /** @param teamId 群组 id */
171
- /** @param teamType 群组类型 */
172
- /** @param accountIds 账号 ID 列表 */
173
- /** @return void */
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
- /** @brief 根据账号 ID 列表获取群组成员邀请人 */
176
- /** @param teamId 群组 id */
177
- /** @param teamType 群组类型 */
178
- /** @param accountIds 账号 ID 列表 */
179
- /** @return void */
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
- /** @brief 获取群加入相关信息 */
182
- /** @param option 查询参数 */
183
- /** @return void */
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
- /** @brief 根据关键字搜索群组,混合搜索高级群和超大群,使用 LIKE 方式匹配,只搜索群名称 */
186
- /** @param keyword 关键字 */
187
- /** @return Promise<Array<V2NIMTeam>> */
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
- /** @brief 根据关键字搜索群组成员 */
190
- /** @param option 搜索选项 */
191
- /** @return Promise<V2NIMTeamMemberListResult> */
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
- /** @brief 添加特别关注群成员列表 */
194
- /** @param teamId 群组 id */
195
- /** @param teamType 群组类型 */
196
- /** @param accountIds 账号 id 列表 */
197
- /** @return void */
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
- /** @brief 移除特别关注群成员列表 */
200
- /** @param teamId 群组 id */
201
- /** @param teamType 群组类型 */
202
- /** @param accountIds 账号 id 列表 */
203
- /** @return void */
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 V2NIMUserServiceEvents {
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<V2NIMUserServiceEvents> {
12
+ export declare class V2NIMUserService extends EventEmitter<V2NIMUserListener> {
13
13
  instance: any;
14
14
  constructor();
15
- /** @brief 根据用户账号列表获取用户资料 */
16
- /** @param accountIds 用户账号列表 */
17
- /** @return void */
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
- /** @brief 更新自己的用户资料 */
20
- /** @param updateParams 更新参数 */
21
- /** @return void */
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
- /** @brief 添加用户到黑名单中 */
24
- /** @param accountId 用户账号 */
25
- /** @return void */
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
- /** @brief 从黑名单中移除用户 */
28
- /** @param accountId 用户账号 */
29
- /** @return void */
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
- /** @brief 获取黑名单列表 */
32
- /** @return void */
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
- /** @brief 根据用户账号列表从服务器获取用户资料, 主要使用 getUserList ,只有强制需要拉取最新用户信息才需要使用该接口 */
35
- /** @param accountIds 用户账号列表 */
36
- /** @return void */
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
- * @return Promise<Array<V2NIMUser>>
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
  }