node-nim 9.14.2 → 10.2.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 (179) hide show
  1. package/README.md +7 -1
  2. package/dist/loader.js +35 -35
  3. package/dist/nim/client.js +184 -184
  4. package/dist/nim/client.js.map +1 -1
  5. package/dist/nim/data_sync.js +19 -19
  6. package/dist/nim/friend.js +150 -150
  7. package/dist/nim/global.js +131 -131
  8. package/dist/nim/msglog.js +687 -687
  9. package/dist/nim/nos.js +216 -180
  10. package/dist/nim/nos.js.map +1 -1
  11. package/dist/nim/online_session.js +85 -85
  12. package/dist/nim/pass_through_proxy.js +39 -39
  13. package/dist/nim/plugin.js +65 -65
  14. package/dist/nim/session.js +392 -392
  15. package/dist/nim/subscribe_event.js +142 -142
  16. package/dist/nim/super_team.js +592 -592
  17. package/dist/nim/sysmsg.js +194 -194
  18. package/dist/nim/talk.js +209 -209
  19. package/dist/nim/talk.js.map +1 -1
  20. package/dist/nim/talkex.js +191 -191
  21. package/dist/nim/team.js +818 -818
  22. package/dist/nim/tool.js +119 -119
  23. package/dist/nim/user.js +201 -201
  24. package/dist/nim_def/client_def.js +245 -245
  25. package/dist/nim_def/client_def.js.map +1 -1
  26. package/dist/nim_def/data_sync_def.js +20 -20
  27. package/dist/nim_def/doc_trans_def.js +16 -16
  28. package/dist/nim_def/friend_def.js +37 -37
  29. package/dist/nim_def/global_def.js +39 -39
  30. package/dist/nim_def/msglog_def.js +148 -148
  31. package/dist/nim_def/nos_def.js +16 -16
  32. package/dist/nim_def/online_session_def.js +2 -2
  33. package/dist/nim_def/pass_through_proxy_def.js +10 -10
  34. package/dist/nim_def/plugin_def.js +2 -2
  35. package/dist/nim_def/session_def.js +26 -26
  36. package/dist/nim_def/subscribe_event_def.js +52 -52
  37. package/dist/nim_def/super_team_def.js +64 -64
  38. package/dist/nim_def/sysmsg_def.js +28 -28
  39. package/dist/nim_def/talk_def.js +2 -2
  40. package/dist/nim_def/talkex_def.js +2 -2
  41. package/dist/nim_def/team_def.js +69 -69
  42. package/dist/nim_def/tool_def.js +11 -11
  43. package/dist/nim_def/user_def.js +22 -22
  44. package/dist/node-nim.js +171 -171
  45. package/dist/node-nim.js.map +1 -1
  46. package/dist/qchat/attachment.js +63 -63
  47. package/dist/qchat/channel.js +314 -314
  48. package/dist/qchat/channel_category.js +187 -187
  49. package/dist/qchat/instance.js +77 -77
  50. package/dist/qchat/message.js +285 -285
  51. package/dist/qchat/role.js +423 -423
  52. package/dist/qchat/server.js +453 -453
  53. package/dist/qchat/system_notification.js +74 -74
  54. package/dist/qchat_def/attachment_def.js +2 -2
  55. package/dist/qchat_def/channel_def.js +2 -2
  56. package/dist/qchat_def/instance_def.js +2 -2
  57. package/dist/qchat_def/message_def.js +2 -2
  58. package/dist/qchat_def/public_def.js +649 -649
  59. package/dist/qchat_def/public_def.js.map +1 -1
  60. package/dist/qchat_def/role_def.js +2 -2
  61. package/dist/qchat_def/server_def.js +2 -2
  62. package/dist/qchat_def/system_notification_def.js +2 -2
  63. package/dist/v2/v2_nim_chatroom_client.js +135 -0
  64. package/dist/v2/v2_nim_chatroom_client.js.map +1 -0
  65. package/dist/v2/v2_nim_chatroom_service.js +244 -0
  66. package/dist/v2/v2_nim_chatroom_service.js.map +1 -0
  67. package/dist/v2/v2_nim_client.js +138 -0
  68. package/dist/v2/v2_nim_client.js.map +1 -0
  69. package/dist/v2/v2_nim_conversation_group_service.js +116 -0
  70. package/dist/v2/v2_nim_conversation_group_service.js.map +1 -0
  71. package/dist/v2/v2_nim_conversation_service.js +236 -0
  72. package/dist/v2/v2_nim_conversation_service.js.map +1 -0
  73. package/dist/v2/v2_nim_friend_service.js +128 -0
  74. package/dist/v2/v2_nim_friend_service.js.map +1 -0
  75. package/dist/v2/v2_nim_login_service.js +119 -123
  76. package/dist/v2/v2_nim_login_service.js.map +1 -1
  77. package/dist/v2/v2_nim_message_service.js +382 -0
  78. package/dist/v2/v2_nim_message_service.js.map +1 -0
  79. package/dist/v2/v2_nim_notification_service.js +30 -0
  80. package/dist/v2/v2_nim_notification_service.js.map +1 -0
  81. package/dist/v2/v2_nim_setting_service.js +86 -0
  82. package/dist/v2/v2_nim_setting_service.js.map +1 -0
  83. package/dist/v2/v2_nim_storage_service.js +58 -0
  84. package/dist/v2/v2_nim_storage_service.js.map +1 -0
  85. package/dist/v2/v2_nim_team_service.js +360 -0
  86. package/dist/v2/v2_nim_team_service.js.map +1 -0
  87. package/dist/v2/v2_nim_user_service.js +76 -0
  88. package/dist/v2/v2_nim_user_service.js.map +1 -0
  89. package/dist/v2/v2_nim_utilities.js +276 -0
  90. package/dist/v2/v2_nim_utilities.js.map +1 -0
  91. package/dist/v2_def/v2_nim_callback_def.js +2 -2
  92. package/dist/v2_def/v2_nim_enum_def.js +1087 -325
  93. package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
  94. package/dist/v2_def/v2_nim_struct_def.js +2 -2
  95. package/package.json +74 -74
  96. package/script/download-sdk.js +78 -78
  97. package/script/exec-node-nim-tester.js +17 -17
  98. package/script/publish-to-netease-npm.js +3 -2
  99. package/types/loader.d.ts +2 -2
  100. package/types/nim/client.d.ts +123 -123
  101. package/types/nim/data_sync.d.ts +12 -12
  102. package/types/nim/friend.d.ts +82 -82
  103. package/types/nim/global.d.ts +69 -69
  104. package/types/nim/msglog.d.ts +392 -392
  105. package/types/nim/nos.d.ts +118 -118
  106. package/types/nim/online_session.d.ts +44 -44
  107. package/types/nim/pass_through_proxy.d.ts +24 -24
  108. package/types/nim/plugin.d.ts +39 -39
  109. package/types/nim/session.d.ts +212 -212
  110. package/types/nim/subscribe_event.d.ts +87 -87
  111. package/types/nim/super_team.d.ts +331 -331
  112. package/types/nim/sysmsg.d.ts +105 -105
  113. package/types/nim/talk.d.ts +94 -94
  114. package/types/nim/talkex.d.ts +95 -95
  115. package/types/nim/team.d.ts +461 -461
  116. package/types/nim/tool.d.ts +77 -77
  117. package/types/nim/user.d.ts +111 -111
  118. package/types/nim_def/client_def.d.ts +284 -284
  119. package/types/nim_def/data_sync_def.d.ts +19 -19
  120. package/types/nim_def/doc_trans_def.d.ts +11 -11
  121. package/types/nim_def/friend_def.d.ts +65 -65
  122. package/types/nim_def/global_def.d.ts +62 -62
  123. package/types/nim_def/msglog_def.d.ts +373 -373
  124. package/types/nim_def/nos_def.d.ts +72 -72
  125. package/types/nim_def/online_session_def.d.ts +34 -34
  126. package/types/nim_def/pass_through_proxy_def.d.ts +13 -13
  127. package/types/nim_def/plugin_def.d.ts +8 -8
  128. package/types/nim_def/session_def.d.ts +114 -114
  129. package/types/nim_def/subscribe_event_def.d.ts +83 -83
  130. package/types/nim_def/super_team_def.d.ts +144 -137
  131. package/types/nim_def/sysmsg_def.d.ts +70 -70
  132. package/types/nim_def/talk_def.d.ts +96 -96
  133. package/types/nim_def/talkex_def.d.ts +112 -112
  134. package/types/nim_def/team_def.d.ts +167 -167
  135. package/types/nim_def/tool_def.d.ts +28 -28
  136. package/types/nim_def/user_def.d.ts +59 -59
  137. package/types/node-nim.d.ts +90 -93
  138. package/types/qchat/attachment.d.ts +40 -40
  139. package/types/qchat/channel.d.ts +139 -139
  140. package/types/qchat/channel_category.d.ts +82 -82
  141. package/types/qchat/instance.d.ts +46 -46
  142. package/types/qchat/message.d.ts +128 -128
  143. package/types/qchat/role.d.ts +166 -166
  144. package/types/qchat/server.d.ts +198 -198
  145. package/types/qchat/system_notification.d.ts +39 -39
  146. package/types/qchat_def/attachment_def.d.ts +71 -71
  147. package/types/qchat_def/channel_def.d.ts +643 -643
  148. package/types/qchat_def/instance_def.d.ts +214 -214
  149. package/types/qchat_def/message_def.d.ts +565 -565
  150. package/types/qchat_def/public_def.d.ts +754 -754
  151. package/types/qchat_def/role_def.d.ts +413 -413
  152. package/types/qchat_def/server_def.d.ts +529 -529
  153. package/types/qchat_def/system_notification_def.d.ts +172 -172
  154. package/types/v2/v2_nim_chatroom_client.d.ts +73 -0
  155. package/types/v2/v2_nim_chatroom_service.d.ts +114 -0
  156. package/types/v2/v2_nim_client.d.ts +75 -0
  157. package/types/v2/v2_nim_conversation_group_service.d.ts +54 -0
  158. package/types/v2/v2_nim_conversation_service.d.ts +110 -0
  159. package/types/v2/v2_nim_friend_service.d.ts +58 -0
  160. package/types/v2/v2_nim_login_service.d.ts +80 -96
  161. package/types/v2/v2_nim_message_service.d.ts +143 -0
  162. package/types/v2/v2_nim_notification_service.d.ts +18 -0
  163. package/types/v2/v2_nim_setting_service.d.ts +43 -0
  164. package/types/v2/v2_nim_storage_service.d.ts +28 -0
  165. package/types/v2/v2_nim_team_service.d.ts +184 -0
  166. package/types/v2/v2_nim_user_service.d.ts +34 -0
  167. package/types/v2/v2_nim_utilities.d.ts +168 -0
  168. package/types/v2_def/v2_nim_callback_def.d.ts +7 -20
  169. package/types/v2_def/v2_nim_enum_def.d.ts +1009 -300
  170. package/types/v2_def/v2_nim_struct_def.d.ts +1539 -338
  171. package/dist/chatroom/chatroom.js +0 -263
  172. package/dist/chatroom/chatroom.js.map +0 -1
  173. package/dist/chatroom_def/chatroom_def.js +0 -120
  174. package/dist/chatroom_def/chatroom_def.js.map +0 -1
  175. package/dist/v2/v2_nim_instance.js +0 -44
  176. package/dist/v2/v2_nim_instance.js.map +0 -1
  177. package/types/chatroom/chatroom.d.ts +0 -55
  178. package/types/chatroom_def/chatroom_def.d.ts +0 -448
  179. package/types/v2/v2_nim_instance.d.ts +0 -25
@@ -1,593 +1,593 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NIMSuperTeam = void 0;
7
- const loader_1 = __importDefault(require("../loader"));
8
- const eventemitter3_1 = require("eventemitter3");
9
- class NIMSuperTeam extends eventemitter3_1.EventEmitter {
10
- constructor() {
11
- super();
12
- this.team = new loader_1.default.NIMSuperTeam({ emit: this.emit.bind(this) });
13
- }
14
- /** 注册全局回调 */
15
- initEventHandlers() {
16
- return this.team.InitEventHandlers();
17
- }
18
- /** 邀请
19
- * @param tid 群组id
20
- * @param ids 邀请对象id
21
- * @param invitation_postscript 邀请附言
22
- * @param invitation_attachment 用户可自定义的补充邀请信息
23
- * @param jsonExtension json扩展参数(备用,目前不需要)
24
- * @param cb 邀请的回调函数
25
- * @return boolean 检查参数如果不符合要求则返回失败
26
- * @note
27
- * <pre>
28
- * 200:成功
29
- * 810:如果是高级群,返回810表示邀请成功并带上timetag
30
- * 404:非法用户
31
- * 801:群人数超限
32
- * 802:没有权限
33
- * 803:群不存在
34
- * </pre>
35
- */
36
- inviteAsync(tid, ids, invitationPostscript, invitationAttachment, cb, jsonExtension) {
37
- return new Promise((resolve) => {
38
- if (!this.team.InviteAsync(tid, ids, invitationPostscript, invitationAttachment, (event) => {
39
- if (cb) {
40
- cb(event);
41
- }
42
- resolve([event]);
43
- }, jsonExtension)) {
44
- resolve(null);
45
- }
46
- });
47
- }
48
- /** 踢人
49
- * @param tid 群组id
50
- * @param ids 被踢对象id
51
- * @param jsonExtension json扩展参数(备用,目前不需要)
52
- * @param cb 踢人的回调函数
53
- * @return boolean 检查参数如果不符合要求则返回失败
54
- * @note
55
- * <pre>
56
- * 200:成功
57
- * 403:无超大群功能
58
- * 414:踢人数量超限
59
- * 802:群人数超限、不能踢自己
60
- * 803:群不存在
61
- * 804:用户不在群里面
62
- * </pre>
63
- */
64
- kickAsync(tid, ids, cb, jsonExtension) {
65
- return new Promise((resolve) => {
66
- if (!this.team.KickAsync(tid, ids, (event) => {
67
- if (cb) {
68
- cb(event);
69
- }
70
- resolve([event]);
71
- }, jsonExtension)) {
72
- resolve(null);
73
- }
74
- });
75
- }
76
- /** 离开群
77
- * @param tid 群组id
78
- * @param jsonExtension json扩展参数(备用,目前不需要)
79
- * @param cb 离开群的回调函数
80
- * @return boolean 检查参数如果不符合要求则返回失败
81
- * @note
82
- * <pre>
83
- * 200:成功
84
- * 403:无超大群功能
85
- * 802:没有群权限、群主不能退群
86
- * 803:群不存在
87
- * 804:用户不在群里
88
- * </pre>
89
- */
90
- leaveAsync(tid, cb, jsonExtension) {
91
- return new Promise((resolve) => {
92
- if (!this.team.LeaveAsync(tid, (event) => {
93
- if (cb) {
94
- cb(event);
95
- }
96
- resolve([event]);
97
- }, jsonExtension)) {
98
- resolve(null);
99
- }
100
- });
101
- }
102
- /** 更新群信息
103
- * @param tid 群组id
104
- * @param team_info 群组信息
105
- * @param jsonExtension json扩展参数(备用,目前不需要)
106
- * @param cb 更新群信息的回调函数
107
- * @return boolean 检查参数如果不符合要求则返回失败
108
- * @note
109
- * <pre>
110
- * 200:成功
111
- * 802:没有群权限、群主不能退群
112
- * 803:群不存在
113
- * </pre>
114
- */
115
- updateSuperTeamInfoAsync(tid, info, cb, jsonExtension) {
116
- return new Promise((resolve) => {
117
- if (!this.team.UpdateSuperTeamInfoAsync(tid, info, (event) => {
118
- if (cb) {
119
- cb(event);
120
- }
121
- resolve([event]);
122
- }, jsonExtension)) {
123
- resolve(null);
124
- }
125
- });
126
- }
127
- /** 申请入群
128
- * @param tid 群组id
129
- * @param reason 附言
130
- * @param jsonExtension json扩展参数(备用,目前不需要)
131
- * @param cb 申请入群的回调函数
132
- * @return boolean 检查参数如果不符合要求则返回失败
133
- * @note
134
- * <pre>
135
- * 200:成功
136
- * 802:群验证方式为拒绝所有人申请
137
- * 808:申请成功,等待验证
138
- * 809:已经在群里
139
- * 801:人数限制
140
- * 803:群不存在
141
- * 805:群类型不对
142
- * </pre>
143
- */
144
- applyJoinAsync(tid, reason, cb, jsonExtension) {
145
- return new Promise((resolve) => {
146
- if (!this.team.ApplyJoinAsync(tid, reason, (event) => {
147
- if (cb) {
148
- cb(event);
149
- }
150
- resolve([event]);
151
- }, jsonExtension)) {
152
- resolve(null);
153
- }
154
- });
155
- }
156
- /** 同意入群申请
157
- * @param tid 群组id
158
- * @param applicant_id 申请者id
159
- * @param jsonExtension json扩展参数(备用,目前不需要)
160
- * @param cb 同意入群申请的回调函数
161
- * @return boolean 检查参数如果不符合要求则返回失败
162
- * @note
163
- * <pre>
164
- * 200:成功
165
- * 509:操作已失效
166
- * 809:已经在群里
167
- * 801:人数限制
168
- * 802:没有权限
169
- * 803:群不存在
170
- * 805:群类型不对
171
- * </pre>
172
- */
173
- passJoinApplyAsync(tid, applicantId, cb, jsonExtension) {
174
- return new Promise((resolve) => {
175
- if (!this.team.PassJoinApplyAsync(tid, applicantId, (event) => {
176
- if (cb) {
177
- cb(event);
178
- }
179
- resolve([event]);
180
- }, jsonExtension)) {
181
- resolve(null);
182
- }
183
- });
184
- }
185
- /** 拒绝入群申请
186
- * @param tid 群组id
187
- * @param applicant_id 申请者id
188
- * @param reason 附言
189
- * @param jsonExtension json扩展参数(备用,目前不需要)
190
- * @param cb 拒绝入群申请的回调函数
191
- * @return boolean 检查参数如果不符合要求则返回失败
192
- * @note
193
- * <pre>
194
- * 200:成功,如果用户处于申请状态则会通知申请用户被拒绝
195
- * 509:操作已失效
196
- * 802:没有权限
197
- * 803:群不存在
198
- * 805:群类型不对
199
- * </pre>
200
- */
201
- rejectJoinApplyAsync(tid, applicantId, reason, cb, jsonExtension) {
202
- return new Promise((resolve) => {
203
- if (!this.team.RejectJoinApplyAsync(tid, applicantId, reason, (event) => {
204
- if (cb) {
205
- cb(event);
206
- }
207
- resolve([event]);
208
- }, jsonExtension)) {
209
- resolve(null);
210
- }
211
- });
212
- }
213
- /** 添加管理员
214
- * @param tid 群组id
215
- * @param ids 管理员id
216
- * @param jsonExtension json扩展参数(备用,目前不需要)
217
- * @param cb 添加管理员的回调函数
218
- * @return boolean 检查参数如果不符合要求则返回失败
219
- * @note
220
- * <pre>
221
- * 200:成功
222
- * 802:没有权限
223
- * 803:群不存在
224
- * 805:群类型不对
225
- * </pre>
226
- */
227
- addManagersAsync(tid, ids, cb, jsonExtension) {
228
- return new Promise((resolve) => {
229
- if (!this.team.AddManagersAsync(tid, ids, (event) => {
230
- if (cb) {
231
- cb(event);
232
- }
233
- resolve([event]);
234
- }, jsonExtension)) {
235
- resolve(null);
236
- }
237
- });
238
- }
239
- /** 删除管理员
240
- * @param tid 群组id
241
- * @param ids 管理员id
242
- * @param jsonExtension json扩展参数(备用,目前不需要)
243
- * @param cb 删除管理员的回调函数
244
- * @return boolean 检查参数如果不符合要求则返回失败
245
- * @note
246
- * <pre>
247
- * 200:成功
248
- * 802:没有权限
249
- * 803:群不存在
250
- * 805:群类型不对
251
- * </pre>
252
- */
253
- removeManagersAsync(tid, ids, cb, jsonExtension) {
254
- return new Promise((resolve) => {
255
- if (!this.team.RemoveManagersAsync(tid, ids, (event) => {
256
- if (cb) {
257
- cb(event);
258
- }
259
- resolve([event]);
260
- }, jsonExtension)) {
261
- resolve(null);
262
- }
263
- });
264
- }
265
- /** 移交群主
266
- * @param tid 群组id
267
- * @param new_owner_id 移交对象id
268
- * @param is_leave 是否同时退出群
269
- * @param jsonExtension json扩展参数(备用,目前不需要)
270
- * @param cb 移交群主的回调函数
271
- * @return boolean 检查参数如果不符合要求则返回失败
272
- * @note
273
- * <pre>
274
- * 200:成功
275
- * 802:没有权限
276
- * 803:群不存在
277
- * 805:群类型不对
278
- * 806:群数量上限
279
- * </pre>
280
- */
281
- transferTeamAsync(tid, newOwnerId, isLeave, cb, jsonExtension) {
282
- return new Promise((resolve) => {
283
- if (!this.team.TransferTeamAsync(tid, newOwnerId, isLeave, (event) => {
284
- if (cb) {
285
- cb(event);
286
- }
287
- resolve([event]);
288
- }, jsonExtension)) {
289
- resolve(null);
290
- }
291
- });
292
- }
293
- /** 更新自己的群属性
294
- * @param prop 群成员属性
295
- * @param jsonExtension json扩展参数(备用,目前不需要)
296
- * @param cb 更新自己的群属性的回调函数
297
- * @return boolean 检查参数如果不符合要求则返回失败
298
- * @note
299
- * <pre>
300
- * 200:成功
301
- * 803:群不存在
302
- * 805:群类型不对s
303
- * </pre>
304
- */
305
- updateMyPropertyAsync(prop, cb, jsonExtension) {
306
- return new Promise((resolve) => {
307
- if (!this.team.UpdateMyPropertyAsync(prop, (event) => {
308
- if (cb) {
309
- cb(event);
310
- }
311
- resolve([event]);
312
- }, jsonExtension)) {
313
- resolve(null);
314
- }
315
- });
316
- }
317
- /** 修改别人的群昵称
318
- * @param prop 群成员属性
319
- * @param jsonExtension json扩展参数(备用,目前不需要)
320
- * @param cb 修改别人的群昵称的回调函数
321
- * @return boolean 检查参数如果不符合要求则返回失败
322
- * @note
323
- * <pre>
324
- * 200:成功
325
- * 802:没有权限
326
- * 803:群不存在
327
- * 804:不在群里
328
- * 805:群类型不对
329
- * </pre>
330
- */
331
- updateOtherNickAsync(prop, cb, jsonExtension) {
332
- return new Promise((resolve) => {
333
- if (!this.team.UpdateOtherNickAsync(prop, (event) => {
334
- if (cb) {
335
- cb(event);
336
- }
337
- resolve([event]);
338
- }, jsonExtension)) {
339
- resolve(null);
340
- }
341
- });
342
- }
343
- /** 接受邀请
344
- * @param tid 群组id
345
- * @param invitor_id 邀请者id
346
- * @param jsonExtension json扩展参数(备用,目前不需要)
347
- * @param cb 接受邀请的回调函数
348
- * @return boolean 检查参数如果不符合要求则返回失败
349
- * @note
350
- * <pre>
351
- * 200:成功
352
- * 802:没有权限
353
- * 803:群不存在
354
- * 805:群类型不对
355
- * </pre>
356
- */
357
- acceptInvitationAsync(tid, inviterId, cb, jsonExtension) {
358
- return new Promise((resolve) => {
359
- if (!this.team.AcceptInvitationAsync(tid, inviterId, (event) => {
360
- if (cb) {
361
- cb(event);
362
- }
363
- resolve([event]);
364
- }, jsonExtension)) {
365
- resolve(null);
366
- }
367
- });
368
- }
369
- /** 拒绝邀请
370
- * @param tid 群组id
371
- * @param invitor_id 邀请者id
372
- * @param reason 附言
373
- * @param jsonExtension json扩展参数(备用,目前不需要)
374
- * @param cb 拒绝邀请的回调函数
375
- * @return boolean 检查参数如果不符合要求则返回失败
376
- * @note
377
- * <pre>
378
- * 200:成功
379
- * 802:没有权限
380
- * 803:群不存在
381
- * 805:群类型不对
382
- * </pre>
383
- */
384
- rejectInvitationAsync(tid, inviterId, reason, cb, jsonExtension) {
385
- return new Promise((resolve) => {
386
- if (!this.team.RejectInvitationAsync(tid, inviterId, reason, (event) => {
387
- if (cb) {
388
- cb(event);
389
- }
390
- resolve([event]);
391
- }, jsonExtension)) {
392
- resolve(null);
393
- }
394
- });
395
- }
396
- /** 查询所有群
397
- * @param jsonExtension json扩展参数(备用,目前不需要)
398
- * @param cb 查询所有群的回调函数
399
- * @return void 无返回值
400
- */
401
- queryAllMySuperTeamsAsync(cb, jsonExtension) {
402
- return new Promise((resolve) => {
403
- this.team.QueryAllMySuperTeamsAsync((count, result) => {
404
- if (cb) {
405
- cb(count, result);
406
- }
407
- resolve([count, result]);
408
- }, jsonExtension);
409
- });
410
- }
411
- /** 查询所有群信息
412
- * @param jsonExtension json扩展参数(备用,目前不需要)
413
- * @param cb 查询所有群信息的回调函数
414
- * @return void 无返回值
415
- */
416
- queryAllMySuperTeamsInfoAsync(cb, jsonExtension) {
417
- return new Promise((resolve) => {
418
- this.team.QueryAllMySuperTeamsInfoAsync((count, result) => {
419
- if (cb) {
420
- cb(count, result);
421
- }
422
- resolve([count, result]);
423
- }, jsonExtension);
424
- });
425
- }
426
- /** 查询所有群里我的成员信息(使用场景:获取了所有群列表后,需要查询自己在每个群里自己的成员信息,使用成员信息里的bits字段,可以判断当某个群发来消息后,是否做消息通知)
427
- * @param jsonExtension json扩展参数(备用,目前不需要)
428
- * @param cb 查询所有群里我的成员信息的回调函数
429
- * @return void 无返回值
430
- */
431
- queryMyAllMemberInfosAsync(cb, jsonExtension) {
432
- return new Promise((resolve) => {
433
- this.team.QueryMyAllMemberInfosAsync((count, result) => {
434
- if (cb) {
435
- cb(count, result);
436
- }
437
- resolve([count, result]);
438
- }, jsonExtension);
439
- });
440
- }
441
- /** 查询群成员
442
- * @param tid 群组id
443
- * @param jsonExtension json扩展参数(备用,目前不需要)
444
- * @param cb 查询群成员的回调函数
445
- * @return boolean 检查参数如果不符合要求则返回失败
446
- * @note
447
- * <pre>
448
- * 200:成功
449
- * 406:没有变化
450
- * 802:没有权限
451
- * </pre>
452
- */
453
- querySuperTeamMembersAsync(tid, cb, jsonExtension) {
454
- return new Promise((resolve) => {
455
- if (!this.team.QuerySuperTeamMembersAsync(tid, (rescode, tid, count, result) => {
456
- if (cb) {
457
- cb(rescode, tid, count, result);
458
- }
459
- resolve([rescode, tid, count, result]);
460
- }, jsonExtension)) {
461
- resolve(null);
462
- }
463
- });
464
- }
465
- /** 查询(单个)群成员信息
466
- * @param tid 群组id
467
- * @param id 群成员id
468
- * @param jsonExtension json扩展参数(备用,目前不需要)
469
- * @param cb 查询群成员的回调函数
470
- * @return boolean 检查参数如果不符合要求则返回失败
471
- */
472
- querySuperTeamMemberAsync(tid, id, cb, jsonExtension) {
473
- return new Promise((resolve) => {
474
- this.team.QuerySuperTeamMemberAsync(tid, id, (result) => {
475
- if (cb) {
476
- cb(result);
477
- }
478
- resolve([result]);
479
- }, jsonExtension);
480
- });
481
- }
482
- /** 查询群信息
483
- * @param tid 群组id
484
- * @param jsonExtension json扩展参数(备用,目前不需要)
485
- * @param cb 查询群信息的回调函数
486
- * @return boolean 检查参数如果不符合要求则返回失败
487
- */
488
- querySuperTeamInfoAsync(tid, cb, jsonExtension) {
489
- return new Promise((resolve) => {
490
- if (!this.team.QuerySuperTeamInfoAsync(tid, (tid, result) => {
491
- if (cb) {
492
- cb(tid, result);
493
- }
494
- resolve([tid, result]);
495
- }, jsonExtension)) {
496
- resolve(null);
497
- }
498
- });
499
- }
500
- /** 获取群信息(从服务器获取)
501
- * @param tid 群组id
502
- * @param jsonExtension json扩展参数(备用,目前不需要)
503
- * @param cb 获取群信息的回调函数
504
- * @return boolean 检查参数如果不符合要求则返回失败
505
- * @note
506
- * <pre>
507
- * 200:成功
508
- * 803:群不存在
509
- * </pre>
510
- */
511
- querySuperTeamInfoOnlineAsync(tid, cb, jsonExtension) {
512
- return new Promise((resolve) => {
513
- if (!this.team.QuerySuperTeamInfoOnlineAsync(tid, (result) => {
514
- if (cb) {
515
- cb(result);
516
- }
517
- resolve([result]);
518
- }, jsonExtension)) {
519
- resolve(null);
520
- }
521
- });
522
- }
523
- /** 禁言/解除禁言
524
- * @param tid 群组id
525
- * @param member_id 操作对象id
526
- * @param set_mute 禁言/解除禁言
527
- * @param jsonExtension json扩展参数(备用,目前不需要)
528
- * @param cb 踢人的回调函数
529
- * @return boolean 检查参数如果不符合要求则返回失败
530
- * @note
531
- * <pre>
532
- * 200:成功
533
- * 404:禁言对象不存在
534
- * 414:参数错误
535
- * 803:群不存在
536
- * 802:没有权限
537
- * </pre>
538
- */
539
- muteMemberAsync(tid, member_id, set_mute, cb, jsonExtension) {
540
- return new Promise((resolve) => {
541
- if (!this.team.MuteMemberAsync(tid, member_id, set_mute, (result) => {
542
- if (cb) {
543
- cb(result);
544
- }
545
- resolve([result]);
546
- }, jsonExtension)) {
547
- resolve(null);
548
- }
549
- });
550
- }
551
- /** 群禁言/解除群禁言
552
- * @param tid 群组id
553
- * @param set_mute 禁言/解除禁言
554
- * @param jsonExtension json扩展参数(备用,目前不需要)
555
- * @param cb 踢人的回调函数
556
- * @return boolean 检查参数如果不符合要求则返回失败
557
- * @note
558
- * <pre>
559
- * 200:成功
560
- * 414:参数错误
561
- * </pre>
562
- */
563
- muteAsync(tid, set_mute, cb, jsonExtension) {
564
- return new Promise((resolve) => {
565
- if (!this.team.MuteAsync(tid, set_mute, (result) => {
566
- if (cb) {
567
- cb(result);
568
- }
569
- resolve([result]);
570
- }, jsonExtension)) {
571
- resolve(null);
572
- }
573
- });
574
- }
575
- /** 查询所有群信息
576
- * @param keyword 要查询的关键字
577
- * @param jsonExtension json扩展参数(备用,目前不需要)
578
- * @param cb 查询所有群信息的回调函数
579
- * @return boolean 检查参数如果不符合要求则返回失败
580
- */
581
- querySuperTeamsInfoByKeywordAsync(keyword, cb, jsonExtension) {
582
- return new Promise((resolve) => {
583
- this.team.QuerySuperTeamsInfoByKeywordAsync(keyword, (code, result) => {
584
- if (cb) {
585
- cb(code, result);
586
- }
587
- resolve([code, result]);
588
- }, jsonExtension);
589
- });
590
- }
591
- }
592
- exports.NIMSuperTeam = NIMSuperTeam;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NIMSuperTeam = void 0;
7
+ const loader_1 = __importDefault(require("../loader"));
8
+ const eventemitter3_1 = require("eventemitter3");
9
+ class NIMSuperTeam extends eventemitter3_1.EventEmitter {
10
+ constructor() {
11
+ super();
12
+ this.team = new loader_1.default.NIMSuperTeam({ emit: this.emit.bind(this) });
13
+ }
14
+ /** 注册全局回调 */
15
+ initEventHandlers() {
16
+ return this.team.InitEventHandlers();
17
+ }
18
+ /** 邀请
19
+ * @param tid 群组id
20
+ * @param ids 邀请对象id
21
+ * @param invitation_postscript 邀请附言
22
+ * @param invitation_attachment 用户可自定义的补充邀请信息
23
+ * @param jsonExtension json扩展参数(备用,目前不需要)
24
+ * @param cb 邀请的回调函数
25
+ * @return boolean 检查参数如果不符合要求则返回失败
26
+ * @note
27
+ * <pre>
28
+ * 200:成功
29
+ * 810:如果是高级群,返回810表示邀请成功并带上timetag
30
+ * 404:非法用户
31
+ * 801:群人数超限
32
+ * 802:没有权限
33
+ * 803:群不存在
34
+ * </pre>
35
+ */
36
+ inviteAsync(tid, ids, invitationPostscript, invitationAttachment, cb, jsonExtension) {
37
+ return new Promise((resolve) => {
38
+ if (!this.team.InviteAsync(tid, ids, invitationPostscript, invitationAttachment, (event) => {
39
+ if (cb) {
40
+ cb(event);
41
+ }
42
+ resolve([event]);
43
+ }, jsonExtension)) {
44
+ resolve(null);
45
+ }
46
+ });
47
+ }
48
+ /** 踢人
49
+ * @param tid 群组id
50
+ * @param ids 被踢对象id
51
+ * @param jsonExtension json扩展参数(备用,目前不需要)
52
+ * @param cb 踢人的回调函数
53
+ * @return boolean 检查参数如果不符合要求则返回失败
54
+ * @note
55
+ * <pre>
56
+ * 200:成功
57
+ * 403:无超大群功能
58
+ * 414:踢人数量超限
59
+ * 802:群人数超限、不能踢自己
60
+ * 803:群不存在
61
+ * 804:用户不在群里面
62
+ * </pre>
63
+ */
64
+ kickAsync(tid, ids, cb, jsonExtension) {
65
+ return new Promise((resolve) => {
66
+ if (!this.team.KickAsync(tid, ids, (event) => {
67
+ if (cb) {
68
+ cb(event);
69
+ }
70
+ resolve([event]);
71
+ }, jsonExtension)) {
72
+ resolve(null);
73
+ }
74
+ });
75
+ }
76
+ /** 离开群
77
+ * @param tid 群组id
78
+ * @param jsonExtension json扩展参数(备用,目前不需要)
79
+ * @param cb 离开群的回调函数
80
+ * @return boolean 检查参数如果不符合要求则返回失败
81
+ * @note
82
+ * <pre>
83
+ * 200:成功
84
+ * 403:无超大群功能
85
+ * 802:没有群权限、群主不能退群
86
+ * 803:群不存在
87
+ * 804:用户不在群里
88
+ * </pre>
89
+ */
90
+ leaveAsync(tid, cb, jsonExtension) {
91
+ return new Promise((resolve) => {
92
+ if (!this.team.LeaveAsync(tid, (event) => {
93
+ if (cb) {
94
+ cb(event);
95
+ }
96
+ resolve([event]);
97
+ }, jsonExtension)) {
98
+ resolve(null);
99
+ }
100
+ });
101
+ }
102
+ /** 更新群信息
103
+ * @param tid 群组id
104
+ * @param team_info 群组信息
105
+ * @param jsonExtension json扩展参数(备用,目前不需要)
106
+ * @param cb 更新群信息的回调函数
107
+ * @return boolean 检查参数如果不符合要求则返回失败
108
+ * @note
109
+ * <pre>
110
+ * 200:成功
111
+ * 802:没有群权限、群主不能退群
112
+ * 803:群不存在
113
+ * </pre>
114
+ */
115
+ updateSuperTeamInfoAsync(tid, info, cb, jsonExtension) {
116
+ return new Promise((resolve) => {
117
+ if (!this.team.UpdateSuperTeamInfoAsync(tid, info, (event) => {
118
+ if (cb) {
119
+ cb(event);
120
+ }
121
+ resolve([event]);
122
+ }, jsonExtension)) {
123
+ resolve(null);
124
+ }
125
+ });
126
+ }
127
+ /** 申请入群
128
+ * @param tid 群组id
129
+ * @param reason 附言
130
+ * @param jsonExtension json扩展参数(备用,目前不需要)
131
+ * @param cb 申请入群的回调函数
132
+ * @return boolean 检查参数如果不符合要求则返回失败
133
+ * @note
134
+ * <pre>
135
+ * 200:成功
136
+ * 802:群验证方式为拒绝所有人申请
137
+ * 808:申请成功,等待验证
138
+ * 809:已经在群里
139
+ * 801:人数限制
140
+ * 803:群不存在
141
+ * 805:群类型不对
142
+ * </pre>
143
+ */
144
+ applyJoinAsync(tid, reason, cb, jsonExtension) {
145
+ return new Promise((resolve) => {
146
+ if (!this.team.ApplyJoinAsync(tid, reason, (event) => {
147
+ if (cb) {
148
+ cb(event);
149
+ }
150
+ resolve([event]);
151
+ }, jsonExtension)) {
152
+ resolve(null);
153
+ }
154
+ });
155
+ }
156
+ /** 同意入群申请
157
+ * @param tid 群组id
158
+ * @param applicant_id 申请者id
159
+ * @param jsonExtension json扩展参数(备用,目前不需要)
160
+ * @param cb 同意入群申请的回调函数
161
+ * @return boolean 检查参数如果不符合要求则返回失败
162
+ * @note
163
+ * <pre>
164
+ * 200:成功
165
+ * 509:操作已失效
166
+ * 809:已经在群里
167
+ * 801:人数限制
168
+ * 802:没有权限
169
+ * 803:群不存在
170
+ * 805:群类型不对
171
+ * </pre>
172
+ */
173
+ passJoinApplyAsync(tid, applicantId, cb, jsonExtension) {
174
+ return new Promise((resolve) => {
175
+ if (!this.team.PassJoinApplyAsync(tid, applicantId, (event) => {
176
+ if (cb) {
177
+ cb(event);
178
+ }
179
+ resolve([event]);
180
+ }, jsonExtension)) {
181
+ resolve(null);
182
+ }
183
+ });
184
+ }
185
+ /** 拒绝入群申请
186
+ * @param tid 群组id
187
+ * @param applicant_id 申请者id
188
+ * @param reason 附言
189
+ * @param jsonExtension json扩展参数(备用,目前不需要)
190
+ * @param cb 拒绝入群申请的回调函数
191
+ * @return boolean 检查参数如果不符合要求则返回失败
192
+ * @note
193
+ * <pre>
194
+ * 200:成功,如果用户处于申请状态则会通知申请用户被拒绝
195
+ * 509:操作已失效
196
+ * 802:没有权限
197
+ * 803:群不存在
198
+ * 805:群类型不对
199
+ * </pre>
200
+ */
201
+ rejectJoinApplyAsync(tid, applicantId, reason, cb, jsonExtension) {
202
+ return new Promise((resolve) => {
203
+ if (!this.team.RejectJoinApplyAsync(tid, applicantId, reason, (event) => {
204
+ if (cb) {
205
+ cb(event);
206
+ }
207
+ resolve([event]);
208
+ }, jsonExtension)) {
209
+ resolve(null);
210
+ }
211
+ });
212
+ }
213
+ /** 添加管理员
214
+ * @param tid 群组id
215
+ * @param ids 管理员id
216
+ * @param jsonExtension json扩展参数(备用,目前不需要)
217
+ * @param cb 添加管理员的回调函数
218
+ * @return boolean 检查参数如果不符合要求则返回失败
219
+ * @note
220
+ * <pre>
221
+ * 200:成功
222
+ * 802:没有权限
223
+ * 803:群不存在
224
+ * 805:群类型不对
225
+ * </pre>
226
+ */
227
+ addManagersAsync(tid, ids, cb, jsonExtension) {
228
+ return new Promise((resolve) => {
229
+ if (!this.team.AddManagersAsync(tid, ids, (event) => {
230
+ if (cb) {
231
+ cb(event);
232
+ }
233
+ resolve([event]);
234
+ }, jsonExtension)) {
235
+ resolve(null);
236
+ }
237
+ });
238
+ }
239
+ /** 删除管理员
240
+ * @param tid 群组id
241
+ * @param ids 管理员id
242
+ * @param jsonExtension json扩展参数(备用,目前不需要)
243
+ * @param cb 删除管理员的回调函数
244
+ * @return boolean 检查参数如果不符合要求则返回失败
245
+ * @note
246
+ * <pre>
247
+ * 200:成功
248
+ * 802:没有权限
249
+ * 803:群不存在
250
+ * 805:群类型不对
251
+ * </pre>
252
+ */
253
+ removeManagersAsync(tid, ids, cb, jsonExtension) {
254
+ return new Promise((resolve) => {
255
+ if (!this.team.RemoveManagersAsync(tid, ids, (event) => {
256
+ if (cb) {
257
+ cb(event);
258
+ }
259
+ resolve([event]);
260
+ }, jsonExtension)) {
261
+ resolve(null);
262
+ }
263
+ });
264
+ }
265
+ /** 移交群主
266
+ * @param tid 群组id
267
+ * @param new_owner_id 移交对象id
268
+ * @param is_leave 是否同时退出群
269
+ * @param jsonExtension json扩展参数(备用,目前不需要)
270
+ * @param cb 移交群主的回调函数
271
+ * @return boolean 检查参数如果不符合要求则返回失败
272
+ * @note
273
+ * <pre>
274
+ * 200:成功
275
+ * 802:没有权限
276
+ * 803:群不存在
277
+ * 805:群类型不对
278
+ * 806:群数量上限
279
+ * </pre>
280
+ */
281
+ transferTeamAsync(tid, newOwnerId, isLeave, cb, jsonExtension) {
282
+ return new Promise((resolve) => {
283
+ if (!this.team.TransferTeamAsync(tid, newOwnerId, isLeave, (event) => {
284
+ if (cb) {
285
+ cb(event);
286
+ }
287
+ resolve([event]);
288
+ }, jsonExtension)) {
289
+ resolve(null);
290
+ }
291
+ });
292
+ }
293
+ /** 更新自己的群属性
294
+ * @param prop 群成员属性
295
+ * @param jsonExtension json扩展参数(备用,目前不需要)
296
+ * @param cb 更新自己的群属性的回调函数
297
+ * @return boolean 检查参数如果不符合要求则返回失败
298
+ * @note
299
+ * <pre>
300
+ * 200:成功
301
+ * 803:群不存在
302
+ * 805:群类型不对s
303
+ * </pre>
304
+ */
305
+ updateMyPropertyAsync(prop, cb, jsonExtension) {
306
+ return new Promise((resolve) => {
307
+ if (!this.team.UpdateMyPropertyAsync(prop, (event) => {
308
+ if (cb) {
309
+ cb(event);
310
+ }
311
+ resolve([event]);
312
+ }, jsonExtension)) {
313
+ resolve(null);
314
+ }
315
+ });
316
+ }
317
+ /** 修改别人的群昵称
318
+ * @param prop 群成员属性
319
+ * @param jsonExtension json扩展参数(备用,目前不需要)
320
+ * @param cb 修改别人的群昵称的回调函数
321
+ * @return boolean 检查参数如果不符合要求则返回失败
322
+ * @note
323
+ * <pre>
324
+ * 200:成功
325
+ * 802:没有权限
326
+ * 803:群不存在
327
+ * 804:不在群里
328
+ * 805:群类型不对
329
+ * </pre>
330
+ */
331
+ updateOtherNickAsync(prop, cb, jsonExtension) {
332
+ return new Promise((resolve) => {
333
+ if (!this.team.UpdateOtherNickAsync(prop, (event) => {
334
+ if (cb) {
335
+ cb(event);
336
+ }
337
+ resolve([event]);
338
+ }, jsonExtension)) {
339
+ resolve(null);
340
+ }
341
+ });
342
+ }
343
+ /** 接受邀请
344
+ * @param tid 群组id
345
+ * @param invitor_id 邀请者id
346
+ * @param jsonExtension json扩展参数(备用,目前不需要)
347
+ * @param cb 接受邀请的回调函数
348
+ * @return boolean 检查参数如果不符合要求则返回失败
349
+ * @note
350
+ * <pre>
351
+ * 200:成功
352
+ * 802:没有权限
353
+ * 803:群不存在
354
+ * 805:群类型不对
355
+ * </pre>
356
+ */
357
+ acceptInvitationAsync(tid, inviterId, cb, jsonExtension) {
358
+ return new Promise((resolve) => {
359
+ if (!this.team.AcceptInvitationAsync(tid, inviterId, (event) => {
360
+ if (cb) {
361
+ cb(event);
362
+ }
363
+ resolve([event]);
364
+ }, jsonExtension)) {
365
+ resolve(null);
366
+ }
367
+ });
368
+ }
369
+ /** 拒绝邀请
370
+ * @param tid 群组id
371
+ * @param invitor_id 邀请者id
372
+ * @param reason 附言
373
+ * @param jsonExtension json扩展参数(备用,目前不需要)
374
+ * @param cb 拒绝邀请的回调函数
375
+ * @return boolean 检查参数如果不符合要求则返回失败
376
+ * @note
377
+ * <pre>
378
+ * 200:成功
379
+ * 802:没有权限
380
+ * 803:群不存在
381
+ * 805:群类型不对
382
+ * </pre>
383
+ */
384
+ rejectInvitationAsync(tid, inviterId, reason, cb, jsonExtension) {
385
+ return new Promise((resolve) => {
386
+ if (!this.team.RejectInvitationAsync(tid, inviterId, reason, (event) => {
387
+ if (cb) {
388
+ cb(event);
389
+ }
390
+ resolve([event]);
391
+ }, jsonExtension)) {
392
+ resolve(null);
393
+ }
394
+ });
395
+ }
396
+ /** 查询所有群
397
+ * @param jsonExtension json扩展参数(备用,目前不需要)
398
+ * @param cb 查询所有群的回调函数
399
+ * @return void 无返回值
400
+ */
401
+ queryAllMySuperTeamsAsync(cb, jsonExtension) {
402
+ return new Promise((resolve) => {
403
+ this.team.QueryAllMySuperTeamsAsync((count, result) => {
404
+ if (cb) {
405
+ cb(count, result);
406
+ }
407
+ resolve([count, result]);
408
+ }, jsonExtension);
409
+ });
410
+ }
411
+ /** 查询所有群信息
412
+ * @param jsonExtension json扩展参数(备用,目前不需要)
413
+ * @param cb 查询所有群信息的回调函数
414
+ * @return void 无返回值
415
+ */
416
+ queryAllMySuperTeamsInfoAsync(cb, jsonExtension) {
417
+ return new Promise((resolve) => {
418
+ this.team.QueryAllMySuperTeamsInfoAsync((count, result) => {
419
+ if (cb) {
420
+ cb(count, result);
421
+ }
422
+ resolve([count, result]);
423
+ }, jsonExtension);
424
+ });
425
+ }
426
+ /** 查询所有群里我的成员信息(使用场景:获取了所有群列表后,需要查询自己在每个群里自己的成员信息,使用成员信息里的bits字段,可以判断当某个群发来消息后,是否做消息通知)
427
+ * @param jsonExtension json扩展参数(备用,目前不需要)
428
+ * @param cb 查询所有群里我的成员信息的回调函数
429
+ * @return void 无返回值
430
+ */
431
+ queryMyAllMemberInfosAsync(cb, jsonExtension) {
432
+ return new Promise((resolve) => {
433
+ this.team.QueryMyAllMemberInfosAsync((count, result) => {
434
+ if (cb) {
435
+ cb(count, result);
436
+ }
437
+ resolve([count, result]);
438
+ }, jsonExtension);
439
+ });
440
+ }
441
+ /** 查询群成员
442
+ * @param tid 群组id
443
+ * @param jsonExtension json扩展参数(备用,目前不需要)
444
+ * @param cb 查询群成员的回调函数
445
+ * @return boolean 检查参数如果不符合要求则返回失败
446
+ * @note
447
+ * <pre>
448
+ * 200:成功
449
+ * 406:没有变化
450
+ * 802:没有权限
451
+ * </pre>
452
+ */
453
+ querySuperTeamMembersAsync(tid, cb, jsonExtension) {
454
+ return new Promise((resolve) => {
455
+ if (!this.team.QuerySuperTeamMembersAsync(tid, (rescode, tid, count, result) => {
456
+ if (cb) {
457
+ cb(rescode, tid, count, result);
458
+ }
459
+ resolve([rescode, tid, count, result]);
460
+ }, jsonExtension)) {
461
+ resolve(null);
462
+ }
463
+ });
464
+ }
465
+ /** 查询(单个)群成员信息
466
+ * @param tid 群组id
467
+ * @param id 群成员id
468
+ * @param jsonExtension json扩展参数(备用,目前不需要)
469
+ * @param cb 查询群成员的回调函数
470
+ * @return boolean 检查参数如果不符合要求则返回失败
471
+ */
472
+ querySuperTeamMemberAsync(tid, id, cb, jsonExtension) {
473
+ return new Promise((resolve) => {
474
+ this.team.QuerySuperTeamMemberAsync(tid, id, (result) => {
475
+ if (cb) {
476
+ cb(result);
477
+ }
478
+ resolve([result]);
479
+ }, jsonExtension);
480
+ });
481
+ }
482
+ /** 查询群信息
483
+ * @param tid 群组id
484
+ * @param jsonExtension json扩展参数(备用,目前不需要)
485
+ * @param cb 查询群信息的回调函数
486
+ * @return boolean 检查参数如果不符合要求则返回失败
487
+ */
488
+ querySuperTeamInfoAsync(tid, cb, jsonExtension) {
489
+ return new Promise((resolve) => {
490
+ if (!this.team.QuerySuperTeamInfoAsync(tid, (tid, result) => {
491
+ if (cb) {
492
+ cb(tid, result);
493
+ }
494
+ resolve([tid, result]);
495
+ }, jsonExtension)) {
496
+ resolve(null);
497
+ }
498
+ });
499
+ }
500
+ /** 获取群信息(从服务器获取)
501
+ * @param tid 群组id
502
+ * @param jsonExtension json扩展参数(备用,目前不需要)
503
+ * @param cb 获取群信息的回调函数
504
+ * @return boolean 检查参数如果不符合要求则返回失败
505
+ * @note
506
+ * <pre>
507
+ * 200:成功
508
+ * 803:群不存在
509
+ * </pre>
510
+ */
511
+ querySuperTeamInfoOnlineAsync(tid, cb, jsonExtension) {
512
+ return new Promise((resolve) => {
513
+ if (!this.team.QuerySuperTeamInfoOnlineAsync(tid, (result) => {
514
+ if (cb) {
515
+ cb(result);
516
+ }
517
+ resolve([result]);
518
+ }, jsonExtension)) {
519
+ resolve(null);
520
+ }
521
+ });
522
+ }
523
+ /** 禁言/解除禁言
524
+ * @param tid 群组id
525
+ * @param member_id 操作对象id
526
+ * @param set_mute 禁言/解除禁言
527
+ * @param jsonExtension json扩展参数(备用,目前不需要)
528
+ * @param cb 踢人的回调函数
529
+ * @return boolean 检查参数如果不符合要求则返回失败
530
+ * @note
531
+ * <pre>
532
+ * 200:成功
533
+ * 404:禁言对象不存在
534
+ * 414:参数错误
535
+ * 803:群不存在
536
+ * 802:没有权限
537
+ * </pre>
538
+ */
539
+ muteMemberAsync(tid, member_id, set_mute, cb, jsonExtension) {
540
+ return new Promise((resolve) => {
541
+ if (!this.team.MuteMemberAsync(tid, member_id, set_mute, (result) => {
542
+ if (cb) {
543
+ cb(result);
544
+ }
545
+ resolve([result]);
546
+ }, jsonExtension)) {
547
+ resolve(null);
548
+ }
549
+ });
550
+ }
551
+ /** 群禁言/解除群禁言
552
+ * @param tid 群组id
553
+ * @param set_mute 禁言/解除禁言
554
+ * @param jsonExtension json扩展参数(备用,目前不需要)
555
+ * @param cb 踢人的回调函数
556
+ * @return boolean 检查参数如果不符合要求则返回失败
557
+ * @note
558
+ * <pre>
559
+ * 200:成功
560
+ * 414:参数错误
561
+ * </pre>
562
+ */
563
+ muteAsync(tid, set_mute, cb, jsonExtension) {
564
+ return new Promise((resolve) => {
565
+ if (!this.team.MuteAsync(tid, set_mute, (result) => {
566
+ if (cb) {
567
+ cb(result);
568
+ }
569
+ resolve([result]);
570
+ }, jsonExtension)) {
571
+ resolve(null);
572
+ }
573
+ });
574
+ }
575
+ /** 查询所有群信息
576
+ * @param keyword 要查询的关键字
577
+ * @param jsonExtension json扩展参数(备用,目前不需要)
578
+ * @param cb 查询所有群信息的回调函数
579
+ * @return boolean 检查参数如果不符合要求则返回失败
580
+ */
581
+ querySuperTeamsInfoByKeywordAsync(keyword, cb, jsonExtension) {
582
+ return new Promise((resolve) => {
583
+ this.team.QuerySuperTeamsInfoByKeywordAsync(keyword, (code, result) => {
584
+ if (cb) {
585
+ cb(code, result);
586
+ }
587
+ resolve([code, result]);
588
+ }, jsonExtension);
589
+ });
590
+ }
591
+ }
592
+ exports.NIMSuperTeam = NIMSuperTeam;
593
593
  //# sourceMappingURL=super_team.js.map