nim-web-sdk-ng 10.9.80 → 10.9.90

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 (341) hide show
  1. package/README.md +171 -0
  2. package/dist/esm/adapters.d.ts +4 -3
  3. package/dist/esm/nim/src/CloudSessionServiceInterface.d.ts +33 -0
  4. package/dist/esm/nim/src/CloudStorageServiceInterface.d.ts +26 -0
  5. package/dist/esm/nim/src/EventServiceInterface.d.ts +22 -0
  6. package/dist/esm/nim/src/FriendServiceInterface.d.ts +36 -2
  7. package/dist/esm/nim/src/MiscServiceInterface.d.ts +6 -0
  8. package/dist/esm/nim/src/MsgLogServiceInterface.d.ts +10 -0
  9. package/dist/esm/nim/src/MsgServiceInterface.d.ts +34 -0
  10. package/dist/esm/nim/src/OfflinePushInterface.d.ts +13 -1
  11. package/dist/esm/nim/src/PassThroughServiceInterface.d.ts +10 -0
  12. package/dist/esm/nim/src/PluginServiceInterface.d.ts +13 -0
  13. package/dist/esm/nim/src/QChatMediaServiceInterface.d.ts +18 -0
  14. package/dist/esm/nim/src/QChatMsgServiceInterface.d.ts +4 -3
  15. package/dist/esm/nim/src/SessionServiceInterface.d.ts +48 -0
  16. package/dist/esm/nim/src/SignalingServiceInterface.d.ts +85 -0
  17. package/dist/esm/nim/src/SuperTeamServiceInterface.d.ts +117 -0
  18. package/dist/esm/nim/src/SystemMessageServiceInterface.d.ts +15 -0
  19. package/dist/esm/nim/src/TeamServiceInterface.d.ts +153 -8
  20. package/dist/esm/nim/src/UserServiceInterface.d.ts +35 -0
  21. package/dist/esm/nim/src/V2NIMAIService.d.ts +315 -0
  22. package/dist/esm/nim/src/V2NIMConst.d.ts +5 -0
  23. package/dist/esm/nim/src/V2NIMConversationGroupService.d.ts +35 -0
  24. package/dist/esm/nim/src/V2NIMFriendService.d.ts +67 -0
  25. package/dist/esm/nim/src/V2NIMLocalConversationService.d.ts +8 -0
  26. package/dist/esm/nim/src/V2NIMLoginService.d.ts +50 -0
  27. package/dist/esm/nim/src/V2NIMMessageService.d.ts +334 -0
  28. package/dist/esm/nim/src/V2NIMNotificationService.d.ts +4 -0
  29. package/dist/esm/nim/src/V2NIMSettingService.d.ts +44 -0
  30. package/dist/esm/nim/src/V2NIMSignallingService.d.ts +72 -0
  31. package/dist/esm/nim/src/V2NIMStorageService.d.ts +36 -2
  32. package/dist/esm/nim/src/V2NIMSubscriptionService.d.ts +23 -0
  33. package/dist/esm/nim/src/V2NIMTeamService.d.ts +55 -0
  34. package/dist/esm/nim/src/V2NIMTopicService.d.ts +357 -0
  35. package/dist/esm/nim/src/V2NIMUserService.d.ts +33 -0
  36. package/dist/esm/nim/src/index.d.ts +10 -0
  37. package/dist/esm/nim/src/types.d.ts +5 -7
  38. package/dist/esm/nim.js +5 -7
  39. package/dist/v1/CHATROOM_BROWSER_SDK/ChatroomInterface.d.ts +22 -0
  40. package/dist/v1/CHATROOM_BROWSER_SDK/ChatroomMemberServiceInterface.d.ts +35 -2
  41. package/dist/v1/CHATROOM_BROWSER_SDK/ChatroomQueueInterface.d.ts +10 -0
  42. package/dist/v1/CHATROOM_BROWSER_SDK/CloudStorageServiceInterface.d.ts +11 -0
  43. package/dist/v1/CHATROOM_BROWSER_SDK/types.d.ts +4 -6
  44. package/dist/v1/CHATROOM_BROWSER_SDK.js +6 -8
  45. package/dist/v1/CHATROOM_MINIAPP_SDK/ChatroomInterface.d.ts +22 -0
  46. package/dist/v1/CHATROOM_MINIAPP_SDK/ChatroomMemberServiceInterface.d.ts +35 -2
  47. package/dist/v1/CHATROOM_MINIAPP_SDK/ChatroomQueueInterface.d.ts +10 -0
  48. package/dist/v1/CHATROOM_MINIAPP_SDK/CloudStorageServiceInterface.d.ts +11 -0
  49. package/dist/v1/CHATROOM_MINIAPP_SDK/types.d.ts +4 -6
  50. package/dist/v1/CHATROOM_MINIAPP_SDK.js +4 -6
  51. package/dist/v1/CHATROOM_UNIAPP_SDK/ChatroomInterface.d.ts +22 -0
  52. package/dist/v1/CHATROOM_UNIAPP_SDK/ChatroomMemberServiceInterface.d.ts +35 -2
  53. package/dist/v1/CHATROOM_UNIAPP_SDK/ChatroomQueueInterface.d.ts +10 -0
  54. package/dist/v1/CHATROOM_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +11 -0
  55. package/dist/v1/CHATROOM_UNIAPP_SDK/types.d.ts +4 -6
  56. package/dist/v1/CHATROOM_UNIAPP_SDK.js +4 -6
  57. package/dist/v1/NIM_BROWSER_SDK/CloudSessionServiceInterface.d.ts +33 -0
  58. package/dist/v1/NIM_BROWSER_SDK/CloudStorageServiceInterface.d.ts +26 -0
  59. package/dist/v1/NIM_BROWSER_SDK/EventServiceInterface.d.ts +22 -0
  60. package/dist/v1/NIM_BROWSER_SDK/FriendServiceInterface.d.ts +36 -2
  61. package/dist/v1/NIM_BROWSER_SDK/MiscServiceInterface.d.ts +6 -0
  62. package/dist/v1/NIM_BROWSER_SDK/MsgLogServiceInterface.d.ts +10 -0
  63. package/dist/v1/NIM_BROWSER_SDK/MsgServiceInterface.d.ts +34 -0
  64. package/dist/v1/NIM_BROWSER_SDK/OfflinePushInterface.d.ts +13 -1
  65. package/dist/v1/NIM_BROWSER_SDK/PassThroughServiceInterface.d.ts +10 -0
  66. package/dist/v1/NIM_BROWSER_SDK/PluginServiceInterface.d.ts +13 -0
  67. package/dist/v1/NIM_BROWSER_SDK/QChatMediaServiceInterface.d.ts +18 -0
  68. package/dist/v1/NIM_BROWSER_SDK/QChatMsgServiceInterface.d.ts +4 -3
  69. package/dist/v1/NIM_BROWSER_SDK/SessionServiceInterface.d.ts +48 -0
  70. package/dist/v1/NIM_BROWSER_SDK/SignalingServiceInterface.d.ts +85 -0
  71. package/dist/v1/NIM_BROWSER_SDK/SuperTeamServiceInterface.d.ts +117 -0
  72. package/dist/v1/NIM_BROWSER_SDK/SystemMessageServiceInterface.d.ts +15 -0
  73. package/dist/v1/NIM_BROWSER_SDK/TeamServiceInterface.d.ts +153 -8
  74. package/dist/v1/NIM_BROWSER_SDK/UserServiceInterface.d.ts +35 -0
  75. package/dist/v1/NIM_BROWSER_SDK/V2NIMAIService.d.ts +315 -0
  76. package/dist/v1/NIM_BROWSER_SDK/V2NIMConst.d.ts +5 -0
  77. package/dist/v1/NIM_BROWSER_SDK/V2NIMConversationGroupService.d.ts +35 -0
  78. package/dist/v1/NIM_BROWSER_SDK/V2NIMFriendService.d.ts +67 -0
  79. package/dist/v1/NIM_BROWSER_SDK/V2NIMLocalConversationService.d.ts +8 -0
  80. package/dist/v1/NIM_BROWSER_SDK/V2NIMLoginService.d.ts +50 -0
  81. package/dist/v1/NIM_BROWSER_SDK/V2NIMMessageService.d.ts +334 -0
  82. package/dist/v1/NIM_BROWSER_SDK/V2NIMNotificationService.d.ts +4 -0
  83. package/dist/v1/NIM_BROWSER_SDK/V2NIMSettingService.d.ts +44 -0
  84. package/dist/v1/NIM_BROWSER_SDK/V2NIMSignallingService.d.ts +72 -0
  85. package/dist/v1/NIM_BROWSER_SDK/V2NIMStorageService.d.ts +36 -2
  86. package/dist/v1/NIM_BROWSER_SDK/V2NIMSubscriptionService.d.ts +23 -0
  87. package/dist/v1/NIM_BROWSER_SDK/V2NIMTeamService.d.ts +55 -0
  88. package/dist/v1/NIM_BROWSER_SDK/V2NIMTopicService.d.ts +357 -0
  89. package/dist/v1/NIM_BROWSER_SDK/V2NIMUserService.d.ts +33 -0
  90. package/dist/v1/NIM_BROWSER_SDK/index.d.ts +10 -0
  91. package/dist/v1/NIM_BROWSER_SDK/types.d.ts +5 -7
  92. package/dist/v1/NIM_BROWSER_SDK.js +6 -8
  93. package/dist/v1/NIM_MINIAPP_SDK/CloudSessionServiceInterface.d.ts +33 -0
  94. package/dist/v1/NIM_MINIAPP_SDK/CloudStorageServiceInterface.d.ts +26 -0
  95. package/dist/v1/NIM_MINIAPP_SDK/EventServiceInterface.d.ts +22 -0
  96. package/dist/v1/NIM_MINIAPP_SDK/FriendServiceInterface.d.ts +36 -2
  97. package/dist/v1/NIM_MINIAPP_SDK/MiscServiceInterface.d.ts +6 -0
  98. package/dist/v1/NIM_MINIAPP_SDK/MsgLogServiceInterface.d.ts +10 -0
  99. package/dist/v1/NIM_MINIAPP_SDK/MsgServiceInterface.d.ts +34 -0
  100. package/dist/v1/NIM_MINIAPP_SDK/OfflinePushInterface.d.ts +13 -1
  101. package/dist/v1/NIM_MINIAPP_SDK/PassThroughServiceInterface.d.ts +10 -0
  102. package/dist/v1/NIM_MINIAPP_SDK/PluginServiceInterface.d.ts +13 -0
  103. package/dist/v1/NIM_MINIAPP_SDK/QChatMediaServiceInterface.d.ts +18 -0
  104. package/dist/v1/NIM_MINIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  105. package/dist/v1/NIM_MINIAPP_SDK/SessionServiceInterface.d.ts +48 -0
  106. package/dist/v1/NIM_MINIAPP_SDK/SignalingServiceInterface.d.ts +85 -0
  107. package/dist/v1/NIM_MINIAPP_SDK/SuperTeamServiceInterface.d.ts +117 -0
  108. package/dist/v1/NIM_MINIAPP_SDK/SystemMessageServiceInterface.d.ts +15 -0
  109. package/dist/v1/NIM_MINIAPP_SDK/TeamServiceInterface.d.ts +153 -8
  110. package/dist/v1/NIM_MINIAPP_SDK/UserServiceInterface.d.ts +35 -0
  111. package/dist/v1/NIM_MINIAPP_SDK/V2NIMAIService.d.ts +315 -0
  112. package/dist/v1/NIM_MINIAPP_SDK/V2NIMConst.d.ts +5 -0
  113. package/dist/v1/NIM_MINIAPP_SDK/V2NIMConversationGroupService.d.ts +35 -0
  114. package/dist/v1/NIM_MINIAPP_SDK/V2NIMFriendService.d.ts +67 -0
  115. package/dist/v1/NIM_MINIAPP_SDK/V2NIMLocalConversationService.d.ts +8 -0
  116. package/dist/v1/NIM_MINIAPP_SDK/V2NIMLoginService.d.ts +50 -0
  117. package/dist/v1/NIM_MINIAPP_SDK/V2NIMMessageService.d.ts +334 -0
  118. package/dist/v1/NIM_MINIAPP_SDK/V2NIMNotificationService.d.ts +4 -0
  119. package/dist/v1/NIM_MINIAPP_SDK/V2NIMSettingService.d.ts +44 -0
  120. package/dist/v1/NIM_MINIAPP_SDK/V2NIMSignallingService.d.ts +72 -0
  121. package/dist/v1/NIM_MINIAPP_SDK/V2NIMStorageService.d.ts +36 -2
  122. package/dist/v1/NIM_MINIAPP_SDK/V2NIMSubscriptionService.d.ts +23 -0
  123. package/dist/v1/NIM_MINIAPP_SDK/V2NIMTeamService.d.ts +55 -0
  124. package/dist/v1/NIM_MINIAPP_SDK/V2NIMTopicService.d.ts +357 -0
  125. package/dist/v1/NIM_MINIAPP_SDK/V2NIMUserService.d.ts +33 -0
  126. package/dist/v1/NIM_MINIAPP_SDK/index.d.ts +10 -0
  127. package/dist/v1/NIM_MINIAPP_SDK/types.d.ts +5 -7
  128. package/dist/v1/NIM_MINIAPP_SDK.js +4 -6
  129. package/dist/v1/NIM_UNIAPP_SDK/CloudSessionServiceInterface.d.ts +33 -0
  130. package/dist/v1/NIM_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +26 -0
  131. package/dist/v1/NIM_UNIAPP_SDK/EventServiceInterface.d.ts +22 -0
  132. package/dist/v1/NIM_UNIAPP_SDK/FriendServiceInterface.d.ts +36 -2
  133. package/dist/v1/NIM_UNIAPP_SDK/MiscServiceInterface.d.ts +6 -0
  134. package/dist/v1/NIM_UNIAPP_SDK/MsgLogServiceInterface.d.ts +10 -0
  135. package/dist/v1/NIM_UNIAPP_SDK/MsgServiceInterface.d.ts +34 -0
  136. package/dist/v1/NIM_UNIAPP_SDK/OfflinePushInterface.d.ts +13 -1
  137. package/dist/v1/NIM_UNIAPP_SDK/PassThroughServiceInterface.d.ts +10 -0
  138. package/dist/v1/NIM_UNIAPP_SDK/PluginServiceInterface.d.ts +13 -0
  139. package/dist/v1/NIM_UNIAPP_SDK/QChatMediaServiceInterface.d.ts +18 -0
  140. package/dist/v1/NIM_UNIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  141. package/dist/v1/NIM_UNIAPP_SDK/SessionServiceInterface.d.ts +48 -0
  142. package/dist/v1/NIM_UNIAPP_SDK/SignalingServiceInterface.d.ts +85 -0
  143. package/dist/v1/NIM_UNIAPP_SDK/SuperTeamServiceInterface.d.ts +117 -0
  144. package/dist/v1/NIM_UNIAPP_SDK/SystemMessageServiceInterface.d.ts +15 -0
  145. package/dist/v1/NIM_UNIAPP_SDK/TeamServiceInterface.d.ts +153 -8
  146. package/dist/v1/NIM_UNIAPP_SDK/UserServiceInterface.d.ts +35 -0
  147. package/dist/v1/NIM_UNIAPP_SDK/V2NIMAIService.d.ts +315 -0
  148. package/dist/v1/NIM_UNIAPP_SDK/V2NIMConst.d.ts +5 -0
  149. package/dist/v1/NIM_UNIAPP_SDK/V2NIMConversationGroupService.d.ts +35 -0
  150. package/dist/v1/NIM_UNIAPP_SDK/V2NIMFriendService.d.ts +67 -0
  151. package/dist/v1/NIM_UNIAPP_SDK/V2NIMLocalConversationService.d.ts +8 -0
  152. package/dist/v1/NIM_UNIAPP_SDK/V2NIMLoginService.d.ts +50 -0
  153. package/dist/v1/NIM_UNIAPP_SDK/V2NIMMessageService.d.ts +334 -0
  154. package/dist/v1/NIM_UNIAPP_SDK/V2NIMNotificationService.d.ts +4 -0
  155. package/dist/v1/NIM_UNIAPP_SDK/V2NIMSettingService.d.ts +44 -0
  156. package/dist/v1/NIM_UNIAPP_SDK/V2NIMSignallingService.d.ts +72 -0
  157. package/dist/v1/NIM_UNIAPP_SDK/V2NIMStorageService.d.ts +36 -2
  158. package/dist/v1/NIM_UNIAPP_SDK/V2NIMSubscriptionService.d.ts +23 -0
  159. package/dist/v1/NIM_UNIAPP_SDK/V2NIMTeamService.d.ts +55 -0
  160. package/dist/v1/NIM_UNIAPP_SDK/V2NIMTopicService.d.ts +357 -0
  161. package/dist/v1/NIM_UNIAPP_SDK/V2NIMUserService.d.ts +33 -0
  162. package/dist/v1/NIM_UNIAPP_SDK/index.d.ts +10 -0
  163. package/dist/v1/NIM_UNIAPP_SDK/types.d.ts +5 -7
  164. package/dist/v1/NIM_UNIAPP_SDK.js +4 -6
  165. package/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface.d.ts +17 -6
  166. package/dist/v1/QCHAT_BROWSER_SDK/QChatInterface.d.ts +30 -0
  167. package/dist/v1/QCHAT_BROWSER_SDK/QChatMediaServiceInterface.d.ts +45 -0
  168. package/dist/v1/QCHAT_BROWSER_SDK.js +6 -8
  169. package/dist/v1/QCHAT_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +17 -6
  170. package/dist/v1/QCHAT_UNIAPP_SDK/QChatInterface.d.ts +30 -0
  171. package/dist/v1/QCHAT_UNIAPP_SDK/QChatMediaServiceInterface.d.ts +45 -0
  172. package/dist/v1/QCHAT_UNIAPP_SDK.js +4 -6
  173. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMChatroomConst.d.ts +5 -0
  174. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMChatroomService.d.ts +123 -2
  175. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMStatisticsService.d.ts +41 -0
  176. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMStorageService.d.ts +61 -0
  177. package/dist/v2/CHATROOM_BROWSER_SDK/index.d.ts +11 -1
  178. package/dist/v2/CHATROOM_BROWSER_SDK.js +6 -8
  179. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMChatroomConst.d.ts +5 -0
  180. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMChatroomService.d.ts +123 -2
  181. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMStatisticsService.d.ts +41 -0
  182. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMStorageService.d.ts +61 -0
  183. package/dist/v2/CHATROOM_MINIAPP_SDK/index.d.ts +11 -1
  184. package/dist/v2/CHATROOM_MINIAPP_SDK.js +4 -6
  185. package/dist/v2/CHATROOM_RN_SDK/V2NIMChatroomConst.d.ts +5 -0
  186. package/dist/v2/CHATROOM_RN_SDK/V2NIMChatroomService.d.ts +123 -2
  187. package/dist/v2/CHATROOM_RN_SDK/V2NIMStatisticsService.d.ts +41 -0
  188. package/dist/v2/CHATROOM_RN_SDK/V2NIMStorageService.d.ts +61 -0
  189. package/dist/v2/CHATROOM_RN_SDK/index.d.ts +11 -1
  190. package/dist/v2/CHATROOM_RN_SDK.js +4 -6
  191. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMChatroomConst.d.ts +5 -0
  192. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMChatroomService.d.ts +123 -2
  193. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMStatisticsService.d.ts +41 -0
  194. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMStorageService.d.ts +61 -0
  195. package/dist/v2/CHATROOM_UNIAPP_SDK/index.d.ts +11 -1
  196. package/dist/v2/CHATROOM_UNIAPP_SDK.js +4 -6
  197. package/dist/v2/NIM_BROWSER_SDK/CloudSessionServiceInterface.d.ts +33 -0
  198. package/dist/v2/NIM_BROWSER_SDK/CloudStorageServiceInterface.d.ts +26 -0
  199. package/dist/v2/NIM_BROWSER_SDK/EventServiceInterface.d.ts +22 -0
  200. package/dist/v2/NIM_BROWSER_SDK/FriendServiceInterface.d.ts +36 -2
  201. package/dist/v2/NIM_BROWSER_SDK/MiscServiceInterface.d.ts +6 -0
  202. package/dist/v2/NIM_BROWSER_SDK/MsgLogServiceInterface.d.ts +10 -0
  203. package/dist/v2/NIM_BROWSER_SDK/MsgServiceInterface.d.ts +34 -0
  204. package/dist/v2/NIM_BROWSER_SDK/OfflinePushInterface.d.ts +13 -1
  205. package/dist/v2/NIM_BROWSER_SDK/PassThroughServiceInterface.d.ts +10 -0
  206. package/dist/v2/NIM_BROWSER_SDK/PluginServiceInterface.d.ts +13 -0
  207. package/dist/v2/NIM_BROWSER_SDK/QChatMediaServiceInterface.d.ts +18 -0
  208. package/dist/v2/NIM_BROWSER_SDK/QChatMsgServiceInterface.d.ts +4 -3
  209. package/dist/v2/NIM_BROWSER_SDK/SessionServiceInterface.d.ts +48 -0
  210. package/dist/v2/NIM_BROWSER_SDK/SignalingServiceInterface.d.ts +85 -0
  211. package/dist/v2/NIM_BROWSER_SDK/SuperTeamServiceInterface.d.ts +117 -0
  212. package/dist/v2/NIM_BROWSER_SDK/SystemMessageServiceInterface.d.ts +15 -0
  213. package/dist/v2/NIM_BROWSER_SDK/TeamServiceInterface.d.ts +153 -8
  214. package/dist/v2/NIM_BROWSER_SDK/UserServiceInterface.d.ts +35 -0
  215. package/dist/v2/NIM_BROWSER_SDK/V2NIMAIService.d.ts +315 -0
  216. package/dist/v2/NIM_BROWSER_SDK/V2NIMConst.d.ts +5 -0
  217. package/dist/v2/NIM_BROWSER_SDK/V2NIMConversationGroupService.d.ts +35 -0
  218. package/dist/v2/NIM_BROWSER_SDK/V2NIMFriendService.d.ts +67 -0
  219. package/dist/v2/NIM_BROWSER_SDK/V2NIMLocalConversationService.d.ts +8 -0
  220. package/dist/v2/NIM_BROWSER_SDK/V2NIMLoginService.d.ts +50 -0
  221. package/dist/v2/NIM_BROWSER_SDK/V2NIMMessageService.d.ts +334 -0
  222. package/dist/v2/NIM_BROWSER_SDK/V2NIMNotificationService.d.ts +4 -0
  223. package/dist/v2/NIM_BROWSER_SDK/V2NIMSettingService.d.ts +44 -0
  224. package/dist/v2/NIM_BROWSER_SDK/V2NIMSignallingService.d.ts +72 -0
  225. package/dist/v2/NIM_BROWSER_SDK/V2NIMStorageService.d.ts +36 -2
  226. package/dist/v2/NIM_BROWSER_SDK/V2NIMSubscriptionService.d.ts +23 -0
  227. package/dist/v2/NIM_BROWSER_SDK/V2NIMTeamService.d.ts +55 -0
  228. package/dist/v2/NIM_BROWSER_SDK/V2NIMTopicService.d.ts +357 -0
  229. package/dist/v2/NIM_BROWSER_SDK/V2NIMUserService.d.ts +33 -0
  230. package/dist/v2/NIM_BROWSER_SDK/index.d.ts +10 -0
  231. package/dist/v2/NIM_BROWSER_SDK/types.d.ts +5 -7
  232. package/dist/v2/NIM_BROWSER_SDK.js +6 -8
  233. package/dist/v2/NIM_MINIAPP_SDK/CloudSessionServiceInterface.d.ts +33 -0
  234. package/dist/v2/NIM_MINIAPP_SDK/CloudStorageServiceInterface.d.ts +26 -0
  235. package/dist/v2/NIM_MINIAPP_SDK/EventServiceInterface.d.ts +22 -0
  236. package/dist/v2/NIM_MINIAPP_SDK/FriendServiceInterface.d.ts +36 -2
  237. package/dist/v2/NIM_MINIAPP_SDK/MiscServiceInterface.d.ts +6 -0
  238. package/dist/v2/NIM_MINIAPP_SDK/MsgLogServiceInterface.d.ts +10 -0
  239. package/dist/v2/NIM_MINIAPP_SDK/MsgServiceInterface.d.ts +34 -0
  240. package/dist/v2/NIM_MINIAPP_SDK/OfflinePushInterface.d.ts +13 -1
  241. package/dist/v2/NIM_MINIAPP_SDK/PassThroughServiceInterface.d.ts +10 -0
  242. package/dist/v2/NIM_MINIAPP_SDK/PluginServiceInterface.d.ts +13 -0
  243. package/dist/v2/NIM_MINIAPP_SDK/QChatMediaServiceInterface.d.ts +18 -0
  244. package/dist/v2/NIM_MINIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  245. package/dist/v2/NIM_MINIAPP_SDK/SessionServiceInterface.d.ts +48 -0
  246. package/dist/v2/NIM_MINIAPP_SDK/SignalingServiceInterface.d.ts +85 -0
  247. package/dist/v2/NIM_MINIAPP_SDK/SuperTeamServiceInterface.d.ts +117 -0
  248. package/dist/v2/NIM_MINIAPP_SDK/SystemMessageServiceInterface.d.ts +15 -0
  249. package/dist/v2/NIM_MINIAPP_SDK/TeamServiceInterface.d.ts +153 -8
  250. package/dist/v2/NIM_MINIAPP_SDK/UserServiceInterface.d.ts +35 -0
  251. package/dist/v2/NIM_MINIAPP_SDK/V2NIMAIService.d.ts +315 -0
  252. package/dist/v2/NIM_MINIAPP_SDK/V2NIMConst.d.ts +5 -0
  253. package/dist/v2/NIM_MINIAPP_SDK/V2NIMConversationGroupService.d.ts +35 -0
  254. package/dist/v2/NIM_MINIAPP_SDK/V2NIMFriendService.d.ts +67 -0
  255. package/dist/v2/NIM_MINIAPP_SDK/V2NIMLocalConversationService.d.ts +8 -0
  256. package/dist/v2/NIM_MINIAPP_SDK/V2NIMLoginService.d.ts +50 -0
  257. package/dist/v2/NIM_MINIAPP_SDK/V2NIMMessageService.d.ts +334 -0
  258. package/dist/v2/NIM_MINIAPP_SDK/V2NIMNotificationService.d.ts +4 -0
  259. package/dist/v2/NIM_MINIAPP_SDK/V2NIMSettingService.d.ts +44 -0
  260. package/dist/v2/NIM_MINIAPP_SDK/V2NIMSignallingService.d.ts +72 -0
  261. package/dist/v2/NIM_MINIAPP_SDK/V2NIMStorageService.d.ts +36 -2
  262. package/dist/v2/NIM_MINIAPP_SDK/V2NIMSubscriptionService.d.ts +23 -0
  263. package/dist/v2/NIM_MINIAPP_SDK/V2NIMTeamService.d.ts +55 -0
  264. package/dist/v2/NIM_MINIAPP_SDK/V2NIMTopicService.d.ts +357 -0
  265. package/dist/v2/NIM_MINIAPP_SDK/V2NIMUserService.d.ts +33 -0
  266. package/dist/v2/NIM_MINIAPP_SDK/index.d.ts +10 -0
  267. package/dist/v2/NIM_MINIAPP_SDK/types.d.ts +5 -7
  268. package/dist/v2/NIM_MINIAPP_SDK.js +4 -6
  269. package/dist/v2/NIM_RN_SDK/CloudSessionServiceInterface.d.ts +33 -0
  270. package/dist/v2/NIM_RN_SDK/CloudStorageServiceInterface.d.ts +26 -0
  271. package/dist/v2/NIM_RN_SDK/EventServiceInterface.d.ts +22 -0
  272. package/dist/v2/NIM_RN_SDK/FriendServiceInterface.d.ts +36 -2
  273. package/dist/v2/NIM_RN_SDK/MiscServiceInterface.d.ts +6 -0
  274. package/dist/v2/NIM_RN_SDK/MsgLogServiceInterface.d.ts +10 -0
  275. package/dist/v2/NIM_RN_SDK/MsgServiceInterface.d.ts +34 -0
  276. package/dist/v2/NIM_RN_SDK/OfflinePushInterface.d.ts +13 -1
  277. package/dist/v2/NIM_RN_SDK/PassThroughServiceInterface.d.ts +10 -0
  278. package/dist/v2/NIM_RN_SDK/PluginServiceInterface.d.ts +13 -0
  279. package/dist/v2/NIM_RN_SDK/QChatMediaServiceInterface.d.ts +18 -0
  280. package/dist/v2/NIM_RN_SDK/QChatMsgServiceInterface.d.ts +4 -3
  281. package/dist/v2/NIM_RN_SDK/SessionServiceInterface.d.ts +48 -0
  282. package/dist/v2/NIM_RN_SDK/SignalingServiceInterface.d.ts +85 -0
  283. package/dist/v2/NIM_RN_SDK/SuperTeamServiceInterface.d.ts +117 -0
  284. package/dist/v2/NIM_RN_SDK/SystemMessageServiceInterface.d.ts +15 -0
  285. package/dist/v2/NIM_RN_SDK/TeamServiceInterface.d.ts +153 -8
  286. package/dist/v2/NIM_RN_SDK/UserServiceInterface.d.ts +35 -0
  287. package/dist/v2/NIM_RN_SDK/V2NIMAIService.d.ts +315 -0
  288. package/dist/v2/NIM_RN_SDK/V2NIMConst.d.ts +5 -0
  289. package/dist/v2/NIM_RN_SDK/V2NIMConversationGroupService.d.ts +35 -0
  290. package/dist/v2/NIM_RN_SDK/V2NIMFriendService.d.ts +67 -0
  291. package/dist/v2/NIM_RN_SDK/V2NIMLocalConversationService.d.ts +8 -0
  292. package/dist/v2/NIM_RN_SDK/V2NIMLoginService.d.ts +50 -0
  293. package/dist/v2/NIM_RN_SDK/V2NIMMessageService.d.ts +334 -0
  294. package/dist/v2/NIM_RN_SDK/V2NIMNotificationService.d.ts +4 -0
  295. package/dist/v2/NIM_RN_SDK/V2NIMSettingService.d.ts +44 -0
  296. package/dist/v2/NIM_RN_SDK/V2NIMSignallingService.d.ts +72 -0
  297. package/dist/v2/NIM_RN_SDK/V2NIMStorageService.d.ts +36 -2
  298. package/dist/v2/NIM_RN_SDK/V2NIMSubscriptionService.d.ts +23 -0
  299. package/dist/v2/NIM_RN_SDK/V2NIMTeamService.d.ts +55 -0
  300. package/dist/v2/NIM_RN_SDK/V2NIMTopicService.d.ts +357 -0
  301. package/dist/v2/NIM_RN_SDK/V2NIMUserService.d.ts +33 -0
  302. package/dist/v2/NIM_RN_SDK/index.d.ts +10 -0
  303. package/dist/v2/NIM_RN_SDK/types.d.ts +5 -7
  304. package/dist/v2/NIM_RN_SDK.js +5 -7
  305. package/dist/v2/NIM_UNIAPP_SDK/CloudSessionServiceInterface.d.ts +33 -0
  306. package/dist/v2/NIM_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +26 -0
  307. package/dist/v2/NIM_UNIAPP_SDK/EventServiceInterface.d.ts +22 -0
  308. package/dist/v2/NIM_UNIAPP_SDK/FriendServiceInterface.d.ts +36 -2
  309. package/dist/v2/NIM_UNIAPP_SDK/MiscServiceInterface.d.ts +6 -0
  310. package/dist/v2/NIM_UNIAPP_SDK/MsgLogServiceInterface.d.ts +10 -0
  311. package/dist/v2/NIM_UNIAPP_SDK/MsgServiceInterface.d.ts +34 -0
  312. package/dist/v2/NIM_UNIAPP_SDK/OfflinePushInterface.d.ts +13 -1
  313. package/dist/v2/NIM_UNIAPP_SDK/PassThroughServiceInterface.d.ts +10 -0
  314. package/dist/v2/NIM_UNIAPP_SDK/PluginServiceInterface.d.ts +13 -0
  315. package/dist/v2/NIM_UNIAPP_SDK/QChatMediaServiceInterface.d.ts +18 -0
  316. package/dist/v2/NIM_UNIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  317. package/dist/v2/NIM_UNIAPP_SDK/SessionServiceInterface.d.ts +48 -0
  318. package/dist/v2/NIM_UNIAPP_SDK/SignalingServiceInterface.d.ts +85 -0
  319. package/dist/v2/NIM_UNIAPP_SDK/SuperTeamServiceInterface.d.ts +117 -0
  320. package/dist/v2/NIM_UNIAPP_SDK/SystemMessageServiceInterface.d.ts +15 -0
  321. package/dist/v2/NIM_UNIAPP_SDK/TeamServiceInterface.d.ts +153 -8
  322. package/dist/v2/NIM_UNIAPP_SDK/UserServiceInterface.d.ts +35 -0
  323. package/dist/v2/NIM_UNIAPP_SDK/V2NIMAIService.d.ts +315 -0
  324. package/dist/v2/NIM_UNIAPP_SDK/V2NIMConst.d.ts +5 -0
  325. package/dist/v2/NIM_UNIAPP_SDK/V2NIMConversationGroupService.d.ts +35 -0
  326. package/dist/v2/NIM_UNIAPP_SDK/V2NIMFriendService.d.ts +67 -0
  327. package/dist/v2/NIM_UNIAPP_SDK/V2NIMLocalConversationService.d.ts +8 -0
  328. package/dist/v2/NIM_UNIAPP_SDK/V2NIMLoginService.d.ts +50 -0
  329. package/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService.d.ts +334 -0
  330. package/dist/v2/NIM_UNIAPP_SDK/V2NIMNotificationService.d.ts +4 -0
  331. package/dist/v2/NIM_UNIAPP_SDK/V2NIMSettingService.d.ts +44 -0
  332. package/dist/v2/NIM_UNIAPP_SDK/V2NIMSignallingService.d.ts +72 -0
  333. package/dist/v2/NIM_UNIAPP_SDK/V2NIMStorageService.d.ts +36 -2
  334. package/dist/v2/NIM_UNIAPP_SDK/V2NIMSubscriptionService.d.ts +23 -0
  335. package/dist/v2/NIM_UNIAPP_SDK/V2NIMTeamService.d.ts +55 -0
  336. package/dist/v2/NIM_UNIAPP_SDK/V2NIMTopicService.d.ts +357 -0
  337. package/dist/v2/NIM_UNIAPP_SDK/V2NIMUserService.d.ts +33 -0
  338. package/dist/v2/NIM_UNIAPP_SDK/index.d.ts +10 -0
  339. package/dist/v2/NIM_UNIAPP_SDK/types.d.ts +5 -7
  340. package/dist/v2/NIM_UNIAPP_SDK.js +4 -6
  341. package/package.json +1 -1
package/README.md CHANGED
@@ -34,6 +34,10 @@ dist/
34
34
  ├── CHATROOM_MINIAPP_SDK.js v2 聊天室小程序适配版 UMD 格式
35
35
  ├── CHATROOM_UNIAPP_SDK.js v2 聊天室 UNIAPP 适配版 UMD 格式
36
36
  ├── CHATROOM_RN_SDK.js v2 聊天室 RN 适配版 UMD 格式
37
+ |── nodejs
38
+ ├── nim.js v2 IM Node.js 适配版 ESM 格式
39
+ ├── nim.d.ts TypeScript 类型定义入口
40
+ ├── nim/ TypeScript 类型定义目录
37
41
  |── v1
38
42
  ├── CHATROOM_BROWSER_SDK.js v1 聊天室浏览器适配版 UMD 格式
39
43
  ├── CHATROOM_MINIAPP_SDK.js v1 聊天室小程序适配版 UMD 格式
@@ -77,6 +81,173 @@ async function init() {
77
81
  init()
78
82
  ```
79
83
 
84
+ ### Node.js 环境
85
+
86
+ Node.js 版本专为服务端场景设计,支持在 Node.js 环境中使用 NIM SDK 的核心功能。
87
+
88
+ #### 环境要求
89
+
90
+ - **Node.js 版本**: >= 20.0.0(使用原生 `fetch`、`FormData`、`Blob` API)
91
+ - **模块格式**: ESM(ES Modules)
92
+ - **依赖**: `ws`(WebSocket 库,已包含在 SDK 依赖中)
93
+
94
+ #### 安装
95
+
96
+ ```bash
97
+ npm install nim-web-sdk-ng@">=10"
98
+ ```
99
+
100
+ #### 引入方式
101
+
102
+ ```js
103
+ // Node.js 环境专用入口
104
+ import NIM from 'nim-web-sdk-ng/dist/nodejs/nim.js'
105
+ ```
106
+
107
+ #### 支持的服务模块
108
+
109
+ | 服务模块 | 描述 |
110
+ | ------------------------------- | -------------------------------- |
111
+ | `V2NIMLoginService` | 登录服务 |
112
+ | `V2NIMMessageService` | 消息服务(发送/接收消息) |
113
+ | `V2NIMMessageLogUtil` | 消息日志工具(查询历史消息) |
114
+ | `V2NIMMessageExtendUtil` | 消息扩展工具(快捷评论、PIN 等) |
115
+ | `V2NIMLocalConversationService` | 本地会话服务 |
116
+ | `V2NIMConversationService` | 会话服务 |
117
+ | `V2NIMConversationGroupService` | 会话分组服务 |
118
+ | `V2NIMUserService` | 用户服务 |
119
+ | `V2NIMFriendService` | 好友服务 |
120
+ | `V2NIMTeamService` | 群组服务 |
121
+ | `V2NIMNotificationService` | 通知服务 |
122
+ | `V2NIMStorageService` | 存储服务(文件上传下载) |
123
+ | `V2NIMSettingService` | 设置服务 |
124
+ | `V2NIMSyncService` | 同步服务 |
125
+ | `V2NIMAIService` | AI 服务 |
126
+ | `V2NIMSignallingService` | 信令服务 |
127
+ | `V2NIMPassthroughService` | 透传服务 |
128
+
129
+ #### 基础示例
130
+
131
+ ```js
132
+ import NIM from 'nim-web-sdk-ng/dist/nodejs/nim.js'
133
+
134
+ // 创建实例
135
+ const nim = NIM.getInstance({
136
+ appkey: 'YOUR_APPKEY',
137
+ account: 'YOUR_ACCOUNT',
138
+ token: 'YOUR_TOKEN',
139
+ debugLevel: 'debug',
140
+ apiVersion: 'v2'
141
+ })
142
+
143
+ // 监听登录状态
144
+ nim.V2NIMLoginService.on('onLoginStatus', (status) => {
145
+ console.log('登录状态:', status)
146
+ })
147
+
148
+ nim.V2NIMLoginService.on('onConnectStatus', (status) => {
149
+ console.log('连接状态:', status)
150
+ })
151
+
152
+ // 登录
153
+ async function main() {
154
+ try {
155
+ await nim.V2NIMLoginService.login('YOUR_ACCOUNT', 'YOUR_TOKEN')
156
+ console.log('登录成功')
157
+
158
+ // 发送文本消息
159
+ const message = nim.V2NIMMessageCreator.createTextMessage('Hello from Node.js!')
160
+ const conversationId = nim.V2NIMConversationIdUtil.p2pConversationId('TARGET_ACCOUNT')
161
+ await nim.V2NIMMessageService.sendMessage(message, conversationId)
162
+ console.log('消息发送成功')
163
+ } catch (err) {
164
+ console.error('操作失败:', err)
165
+ }
166
+ }
167
+
168
+ main()
169
+ ```
170
+
171
+ #### 发送图片消息
172
+
173
+ ```js
174
+ import NIM from 'nim-web-sdk-ng/dist/nodejs/nim.js'
175
+ import path from 'path'
176
+
177
+ const nim = NIM.getInstance({
178
+ appkey: 'YOUR_APPKEY',
179
+ account: 'YOUR_ACCOUNT',
180
+ token: 'YOUR_TOKEN',
181
+ apiVersion: 'v2'
182
+ })
183
+
184
+ async function sendImage() {
185
+ await nim.V2NIMLoginService.login('YOUR_ACCOUNT', 'YOUR_TOKEN')
186
+
187
+ // 使用文件路径创建图片消息
188
+ const imagePath = path.join(process.cwd(), 'image.png')
189
+ const message = nim.V2NIMMessageCreator.createImageMessage(imagePath, 'image.png')
190
+
191
+ const conversationId = nim.V2NIMConversationIdUtil.p2pConversationId('TARGET_ACCOUNT')
192
+
193
+ // 发送消息,支持上传进度回调
194
+ const result = await nim.V2NIMMessageService.sendMessage(message, conversationId, {}, (progress) => {
195
+ console.log(`上传进度: ${Math.round(progress * 100)}%`)
196
+ })
197
+
198
+ console.log('图片发送成功:', result.attachment?.url)
199
+ }
200
+
201
+ sendImage()
202
+ ```
203
+
204
+ #### 查询历史消息
205
+
206
+ ```js
207
+ async function getHistory() {
208
+ const conversationId = nim.V2NIMConversationIdUtil.p2pConversationId('TARGET_ACCOUNT')
209
+
210
+ const messages = await nim.V2NIMMessageLogUtil.getMessageList({
211
+ conversationId,
212
+ limit: 50
213
+ })
214
+
215
+ messages.forEach((msg) => {
216
+ console.log(`[${msg.senderId}]: ${msg.text || msg.messageType}`)
217
+ })
218
+ }
219
+ ```
220
+
221
+ #### TypeScript 支持
222
+
223
+ Node.js 版本提供完整的 TypeScript 类型定义:
224
+
225
+ ```typescript
226
+ import NIM from 'nim-web-sdk-ng/dist/nodejs/nim.js'
227
+ import type V2NIM from 'nim-web-sdk-ng/dist/nodejs/nim'
228
+
229
+ const nim: V2NIM = NIM.getInstance({
230
+ appkey: 'YOUR_APPKEY',
231
+ account: 'YOUR_ACCOUNT',
232
+ token: 'YOUR_TOKEN',
233
+ apiVersion: 'v2'
234
+ })
235
+ ```
236
+
237
+ #### 注意事项
238
+
239
+ 1. **内存存储**: Node.js 版本使用内存实现 localStorage,数据不会持久化。进程重启后会话和消息缓存将丢失。
240
+
241
+ 2. **网络状态**: 网络状态检测返回固定的"已连接"状态,不支持实时网络状态变化监听。
242
+
243
+ 3. **电源状态**: 电源状态相关 API 为存根实现,不提供实际功能。
244
+
245
+ 4. **文件上传**: 支持通过文件路径上传本地文件,使用原生 `FormData` 和 `fetch` API。
246
+
247
+ 5. **WebSocket**: 使用 `ws` 库实现 WebSocket 连接,需确保网络环境允许 WebSocket 连接。
248
+
249
+ 6. **长连接管理**: 服务端场景建议实现心跳检测和断线重连逻辑,确保连接稳定性。
250
+
80
251
  ## IM V1
81
252
 
82
253
  ### sdk 选择
@@ -48,7 +48,8 @@ export declare const enum HostEnvTypes {
48
48
  QQ = 106,
49
49
  JD = 107,
50
50
  KS = 108,
51
- APP = 110
51
+ APP = 110,
52
+ NODEJS = 111
52
53
  }
53
54
  export declare type GetAdapterType = () => RecursivePartial<AdaptersInterface>;
54
55
  export interface AdaptersInterface {
@@ -263,9 +264,9 @@ export interface AdapterSystemInfo {
263
264
  /**
264
265
  * https://docs.popo.netease.com/lingxi/d722dd9717d940a6bff97b207bc06cb4
265
266
  *
266
- * 登录 44 号字段。客户使用的 SDK 产物为,取值有: BROWSER, UNIAPP, MINIAPP, React Native
267
+ * 登录 44 号字段。客户使用的 SDK 产物为,取值有: BROWSER, UNIAPP, MINIAPP, React Native, NodeJs
267
268
  */
268
- libEnv: 'BROWSER' | 'UNIAPP' | 'MINIAPP' | 'React Native';
269
+ libEnv: 'BROWSER' | 'UNIAPP' | 'MINIAPP' | 'React Native' | 'NodeJs';
269
270
  /**
270
271
  * 登录时的 42 号字段
271
272
  *
@@ -16,6 +16,17 @@ export interface CloudSessionServiceInterface {
16
16
  * @locale en
17
17
  * Query the list of sessions on the server
18
18
  * @locale
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const result = await nim.cloudSession.queryCloudSessionList({
23
+ * minTimestamp: 0,
24
+ * maxTimestamp: Date.now(),
25
+ * limit: 100,
26
+ * includedLastMsg: true
27
+ * })
28
+ * console.log(result.sessionList, result.hasMore)
29
+ * ```
19
30
  */
20
31
  queryCloudSessionList(options: NIMEQueryCloudSessionListOptions): Promise<NIMEQueryCloudSessionListResult>;
21
32
  /**
@@ -27,6 +38,13 @@ export interface CloudSessionServiceInterface {
27
38
  * @locale en
28
39
  * Query a specified session
29
40
  * @locale
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const session = await nim.cloudSession.queryCloudSession({
45
+ * sessionId: 'p2p-user123'
46
+ * })
47
+ * ```
30
48
  */
31
49
  queryCloudSession(options: NIMEQueryCloudSessionOptions): Promise<NIMECloudSession>;
32
50
  /**
@@ -38,6 +56,14 @@ export interface CloudSessionServiceInterface {
38
56
  * @locale en
39
57
  * Update a session on the server
40
58
  * @locale
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await nim.cloudSession.updateCloudSession({
63
+ * sessionId: 'p2p-user123',
64
+ * ext: JSON.stringify({ pinned: true })
65
+ * })
66
+ * ```
41
67
  */
42
68
  updateCloudSession(options: NIMEUpdateCloudSessionOptions): Promise<void>;
43
69
  /**
@@ -49,6 +75,13 @@ export interface CloudSessionServiceInterface {
49
75
  * @locale en
50
76
  * Delete a session on the server
51
77
  * @locale
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * await nim.cloudSession.deleteCloudSessionList({
82
+ * sessionIdList: ['p2p-user123', 'team-456']
83
+ * })
84
+ * ```
52
85
  */
53
86
  deleteCloudSessionList(options: NIMEDeleteCloudSessionListOptions): Promise<void>;
54
87
  }
@@ -15,6 +15,16 @@ export interface CloudStorageServiceInterface {
15
15
  * @locale en
16
16
  * Upload files
17
17
  * @locale
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const result = await nim.cloudStorage.uploadFile({
22
+ * file: fileInput.files[0],
23
+ * type: 'image',
24
+ * onProgress: (progress) => console.log(progress.percentageText)
25
+ * })
26
+ * console.log(result.url)
27
+ * ```
18
28
  */
19
29
  uploadFile(options: IUploadFileOptions): Promise<UploadFileResult>;
20
30
  /**
@@ -26,6 +36,11 @@ export interface CloudStorageServiceInterface {
26
36
  * @locale en
27
37
  * Convert a shortened URL to a full URL.
28
38
  * @locale
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const fullUrl = await nim.cloudStorage.getOriginUrl('https://short.url/abc')
43
+ * ```
29
44
  * */
30
45
  getOriginUrl(options: string): Promise<string>;
31
46
  /**
@@ -36,6 +51,17 @@ export interface CloudStorageServiceInterface {
36
51
  * @locale en
37
52
  * Get the token for the authorization of file access.
38
53
  * @locale
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * // 获取全局token
58
+ * const globalToken = await nim.cloudStorage.getFileToken({ type: 2 })
59
+ * // 获取url鉴权token
60
+ * const urlToken = await nim.cloudStorage.getFileToken({
61
+ * type: 3,
62
+ * urls: ['https://example.com/file1', 'https://example.com/file2']
63
+ * })
64
+ * ```
39
65
  */
40
66
  getFileToken(options: GetFileTokenOptions): Promise<GetFileTokenResult | void>;
41
67
  }
@@ -98,6 +98,17 @@ export interface EventServiceInterface {
98
98
  *
99
99
  * Combine unSubscribeEventsByAccounts and unSubscribeEventsByType of IM1
100
100
  * @locale
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * // 取消订阅指定账户
105
+ * const result = await nim.event.unSubscribeEvents({
106
+ * type: 1,
107
+ * accounts: ['user1', 'user2']
108
+ * })
109
+ * // 取消订阅该类型下所有账户
110
+ * await nim.event.unSubscribeEvents({ type: 1 })
111
+ * ```
101
112
  */
102
113
  unSubscribeEvents(options: UnSubscribeEventsOptions): Promise<UnSubscribeEventsResult>;
103
114
  /**
@@ -111,6 +122,17 @@ export interface EventServiceInterface {
111
122
  *
112
123
  * Combine querySubscribeEventsByAccounts and querySubscribeEventsByType of IM1
113
124
  * @locale
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * // 查询指定账户的订阅关系
129
+ * const subscriptions = await nim.event.querySubscribeEvents({
130
+ * type: 1,
131
+ * accounts: ['user1', 'user2']
132
+ * })
133
+ * // 查询该类型下所有订阅关系
134
+ * const allSubs = await nim.event.querySubscribeEvents({ type: 1 })
135
+ * ```
114
136
  */
115
137
  querySubscribeEvents(options: QuerySubscribeEventsOptions): Promise<MsgEventSubscribe[]>;
116
138
  }
@@ -14,6 +14,11 @@ export interface FriendServiceInterface {
14
14
  * @locale en
15
15
  * Get friend list
16
16
  * @locale
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const friends = await nim.friend.getFriends()
21
+ * ```
17
22
  */
18
23
  getFriends(): Promise<FriendProfile[]>;
19
24
  /**
@@ -35,9 +40,13 @@ export interface FriendServiceInterface {
35
40
  * Add as friends directly
36
41
  *
37
42
  * After user A (the currently logged-in user) directly add user B as a friend, user B does not need to approve it and directly becomes the friend of user A.
38
- * User B will receive a system notification whose type is friendRequest and attach.type is addFriend.
39
- * The value of the “from” field of this type of system notification is the account of the sender (in this case, user A). And the value of the “to” field is the account of the receiver (in this case, user B).
43
+ * The value of the "from" field of this type of system notification is the account of the sender (in this case, user A). And the value of the "to" field is the account of the receiver (in this case, user B).
40
44
  * @locale
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const friend = await nim.friend.addFriend({ account: 'accid1', ps: '我是xxx' })
49
+ * ```
41
50
  */
42
51
  addFriend(options: AddFriendOptions): Promise<FriendProfile>;
43
52
  /**
@@ -56,6 +65,11 @@ export interface FriendServiceInterface {
56
65
  * After user A (sender) sends a friend to User B (receiver), user B will receive a system notification whose type is friendRequest and attach.type is applyFriend.
57
66
  * After receiving the friend request, user B can approve or reject the friend request.
58
67
  * @locale
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * await nim.friend.applyFriend({ account: 'accid1', ps: '请求加为好友' })
72
+ * ```
59
73
  */
60
74
  applyFriend(options: ApplyFriendOptions): Promise<void>;
61
75
  /**
@@ -81,6 +95,11 @@ export interface FriendServiceInterface {
81
95
  *
82
96
  * After user B approves the friend request, user A will receive a system notification whose type is friendRequest, attach.type is passFriendApply,
83
97
  * @locale
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * await nim.friend.passFriendApply({ idServer: '123456', from: 'applicantAccid' })
102
+ * ```
84
103
  */
85
104
  passFriendApply(options: PassFriendApplyOptions): Promise<void>;
86
105
  /**
@@ -101,6 +120,11 @@ export interface FriendServiceInterface {
101
120
  *
102
121
  * After user B rejects the friend request, user A will receive a system notification whose type is friendRequest and attach.type is rejectFriendApply.
103
122
  * @locale
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * await nim.friend.rejectFriendApply({ idServer: '123456', from: 'applicantAccid', ps: '拒绝原因' })
127
+ * ```
104
128
  */
105
129
  rejectFriendApply(options: RejectFriendApplyOptions): Promise<void>;
106
130
  /**
@@ -124,6 +148,11 @@ export interface FriendServiceInterface {
124
148
  * After user B deletes user A from user B’s friend list, user A will receive a system notification whose type is deleteFriend.
125
149
  * The value of the “from” field of this type of system notification is the account of the person who deletes their friend (in this case, user B); and the value of the “to” field is the account of the deleted person (in this case, user A).
126
150
  * @locale
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * await nim.friend.deleteFriend({ account: 'accid1', delAlias: true })
155
+ * ```
127
156
  */
128
157
  deleteFriend(options: DeleteFriendOptions): Promise<void>;
129
158
  /**
@@ -145,6 +174,11 @@ export interface FriendServiceInterface {
145
174
  *
146
175
  * Only remarks and extension fields can be updated.
147
176
  * @locale
177
+ *
178
+ * @example
179
+ * ```ts
180
+ * await nim.friend.updateFriend({ account: 'accid1', alias: '备注名', ext: '扩展字段' })
181
+ * ```
148
182
  */
149
183
  updateFriend(options: UpdateFriendOptions): Promise<void>;
150
184
  }
@@ -13,6 +13,12 @@ export interface MiscServiceInterface {
13
13
  *
14
14
  * @locale en
15
15
  * @locale
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const serverTime = await nim.misc.getServerTime()
20
+ * console.log('Server time:', new Date(serverTime))
21
+ * ```
16
22
  */
17
23
  getServerTime(): Promise<number>;
18
24
  }
@@ -16,6 +16,11 @@ export interface MsgLogServiceInterface {
16
16
  * 要想让下次同步时不再接到这个会话:
17
17
  * 1. resetSessionUnreadCount 重置过这个会话的已读信息
18
18
  * 2. deleteRoamingMsgs 删除服务器漫游消息
19
+ *
20
+ * @example
21
+ * ```js
22
+ * await nim.msgLog.deleteRoamingMsgs({ ids: ['p2p-accid1', 'team-12345'] })
23
+ * ```
19
24
  * @locale
20
25
  *
21
26
  * @locale en
@@ -125,6 +130,11 @@ export interface MsgLogServiceInterface {
125
130
  * <ul>
126
131
  * <li><a href="https://github.com/netease-im/im-code-example-web/blob/master/im-elite/session/%E5%88%A0%E9%99%A4%E4%BC%9A%E8%AF%9D.js" target="_blank">删除会话</a></li>
127
132
  * </ul>
133
+ *
134
+ * @example
135
+ * ```js
136
+ * await nim.msgLog.clearHistoryMsgsFromServer({ scene: 'p2p', to: 'accid1' })
137
+ * ```
128
138
  * @locale
129
139
  *
130
140
  * @locale en
@@ -55,6 +55,15 @@ export interface MsgServiceInterface {
55
55
  *
56
56
  * Reminder messages are used for status reminders in the session, such as the welcome message when entering the session, the prompt message after the session hits a sensitive word, etc.
57
57
  * @locale
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const msg = await nim.msg.sendTipMsg({
62
+ * scene: 'p2p',
63
+ * to: 'accid',
64
+ * body: '欢迎进入会话'
65
+ * })
66
+ * ```
58
67
  */
59
68
  sendTipMsg(options: ISendTipMsgOptions): Promise<IMMessage>;
60
69
  /**
@@ -111,6 +120,15 @@ export interface MsgServiceInterface {
111
120
  * @locale en
112
121
  * Send custom messages
113
122
  * @locale
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const msg = await nim.msg.sendCustomMsg({
127
+ * scene: 'p2p',
128
+ * to: 'accid',
129
+ * attach: JSON.stringify({ type: 'emoji', emoji: '😀' })
130
+ * })
131
+ * ```
114
132
  */
115
133
  sendCustomMsg(options: ISendCustomMsgOptions): Promise<IMMessage>;
116
134
  /**
@@ -533,6 +551,13 @@ export interface MsgServiceInterface {
533
551
  *
534
552
  * If you log in to the same account on multiple devices at the same time, the current device and the other devices will receive a one-way deletion event.
535
553
  * @locale
554
+ *
555
+ * @example
556
+ * ```ts
557
+ * const result = await nim.msg.deleteSelfMsgs({
558
+ * msgs: [{ idClient: 'xxx', idServer: 'yyy', from: 'accid1', to: 'accid2', time: 1234567890 }]
559
+ * })
560
+ * ```
536
561
  */
537
562
  deleteSelfMsgs(options: DeleteSelfMsgsOptions): Promise<DeleteSelfMsgsResult[]>;
538
563
  /**
@@ -619,6 +644,15 @@ export interface MsgServiceInterface {
619
644
  * @locale en
620
645
  * Send message receipt for a group message
621
646
  * @locale
647
+ *
648
+ * @example
649
+ * ```ts
650
+ * await nim.msg.sendTeamMsgReceipt({
651
+ * teamMsgReceipts: [
652
+ * { idClient: 'xxx', idServer: 'yyy', teamId: '12345' }
653
+ * ]
654
+ * })
655
+ * ```
622
656
  */
623
657
  sendTeamMsgReceipt(options: SendTeamMsgReceiptOptions): Promise<void>;
624
658
  /**
@@ -13,6 +13,18 @@ export interface OfflinePushServiceInterface {
13
13
  *
14
14
  * @locale en
15
15
  * @locale
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * nim.offlinePush.setOfflinePushConfig({
20
+ * plugin: NIMUniPlugin,
21
+ * authConfig: {
22
+ * xmAppId: 'YOUR_XIAOMI_APP_ID',
23
+ * xmAppKey: 'YOUR_XIAOMI_APP_KEY',
24
+ * xmCertificateName: 'YOUR_XIAOMI_CERT_NAME'
25
+ * }
26
+ * })
27
+ * ```
16
28
  */
17
29
  setOfflinePushConfig(options: NIMESetOfflinePushConfigOptions): void;
18
30
  }
@@ -129,7 +141,7 @@ export interface NIMEOfflinePushAuthConfig {
129
141
  * @locale
130
142
  *
131
143
  * @locale en
132
- * Dedicated for push notification; update and upload the device token of the manufacturers push notification services (APNs, Xiaomi push, etc.)
144
+ * Dedicated for push notification; update and upload the device token of the manufacturer's push notification services (APNs, Xiaomi push, etc.)
133
145
  * @locale
134
146
  */
135
147
  export interface NIMEUpdatePushTokenOptions {
@@ -14,6 +14,16 @@ export interface PassThroughServiceInterface {
14
14
  * @locale en
15
15
  * Transparent transmission protocol
16
16
  * @locale
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const result = await nim.passThrough.request({
21
+ * path: '/api/custom/endpoint',
22
+ * method: 2, // POST
23
+ * header: JSON.stringify({ 'Content-Type': 'application/json' }),
24
+ * body: JSON.stringify({ key: 'value' })
25
+ * })
26
+ * ```
17
27
  */
18
28
  request(options: RequestProxyOptions): Promise<RequestProxyResult>;
19
29
  }
@@ -18,6 +18,14 @@ export interface PluginServiceInterface {
18
18
  *
19
19
  * Note: It is recommended that you use the HTTP interface to obtain a list of available connection addresses. See the server documentation for details.
20
20
  * @locale
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const addresses = await nim.plugin.getChatroomAddress({
25
+ * chatroomId: '12345',
26
+ * ipType: 0 // IPv4
27
+ * })
28
+ * ```
21
29
  */
22
30
  getChatroomAddress(options: GetChatroomAddressOptions): Promise<string[]>;
23
31
  /**
@@ -33,6 +41,11 @@ export interface PluginServiceInterface {
33
41
  *
34
42
  * Note: It is recommended that you use the HTTP interface to obtain a list of available connection addresses. See the server documentation for details.
35
43
  * @locale
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const addresses = await nim.plugin.getQChatAddress({ ipType: 0 })
48
+ * ```
36
49
  */
37
50
  getQChatAddress(options?: GetQChatAddressOptions): Promise<string[]>;
38
51
  }
@@ -8,14 +8,32 @@ import { NEDeviceBaseInfo, NEDeviceSwitchInfo } from 'neroom-web-sdk';
8
8
  export interface QChatMediaServiceInterface {
9
9
  /**
10
10
  * 初始化
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * await qchat.qchatMedia.initQChatMedia({ debug: false })
15
+ * ```
11
16
  */
12
17
  initQChatMedia(options: InitOptions): Promise<void>;
13
18
  /**
14
19
  * 登录圈组多媒体服务,必须先初始化后在调用该接口
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * await qchat.qchatMedia.loginByIM()
24
+ * ```
15
25
  */
16
26
  loginByIM(): Promise<void>;
17
27
  /**
18
28
  * 连接圈组多媒体频道(房间),必须先登录后再调用该接口
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * await qchat.qchatMedia.connectChannel({
33
+ * serverId: '123456',
34
+ * channelId: '789'
35
+ * })
36
+ * ```
19
37
  */
20
38
  connectChannel(options: ConnectOptions): Promise<void>;
21
39
  /**
@@ -275,10 +275,11 @@ export interface IUploadFileOptions {
275
275
  /**
276
276
  * maxSize 限制文件大小。
277
277
  *
278
- * 只对浏览器生效。
278
+ * 对浏览器生效(v10.0.0+)
279
279
  *
280
- * uni-app,小程序等,由于sdk只能得到一个 filePath 临时路径,不能得到整个文件的信息。
281
- * 所以请开发者自行在选择文件后进行判断,参考那些端的API如 wx.chooseImage,uni.chooseImage
280
+ * 而在 uni-app、小程序等 filePath 上传场景中,调用 stat 方法检测生效 (v10.9.90+)。
281
+ *
282
+ * 若宿主环境不支持文件大小探查,则仍建议开发者在选择文件后自行判断,参考 wx.chooseImage、uni.chooseImage 等端能力。
282
283
  */
283
284
  maxSize?: number;
284
285
  /**