@tencent-rtc/mcp 1.0.6 → 1.0.9

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 (342) hide show
  1. package/README.md +4 -4
  2. package/index.js +7 -8
  3. package/index.js.map +1 -1
  4. package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +8 -0
  5. package/libs/@tencent/aegis-node-sdk/LICENSE +21 -0
  6. package/libs/@tencent/aegis-node-sdk/README.md +562 -0
  7. package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +1 -0
  8. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +14 -0
  9. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +1 -0
  10. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +9 -0
  11. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +2 -0
  12. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +85 -0
  13. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +3 -0
  14. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +9 -0
  15. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +3 -0
  16. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +9 -0
  17. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +62 -0
  18. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +11 -0
  19. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +4 -0
  20. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +130 -0
  21. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +34 -0
  22. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +2 -0
  23. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +18 -0
  24. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +8 -0
  25. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +8 -0
  26. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +2 -0
  27. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +4 -0
  28. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +10 -0
  29. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +3 -0
  30. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +3 -0
  31. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +34 -0
  32. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +12 -0
  33. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +14 -0
  34. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +2 -0
  35. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +12 -0
  36. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +3 -0
  37. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +33 -0
  38. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
  39. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +2 -0
  40. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +18 -0
  41. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +60 -0
  42. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +15 -0
  43. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +5 -0
  44. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +6 -0
  45. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +18 -0
  46. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +12 -0
  47. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +10 -0
  48. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +20 -0
  49. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +27 -0
  50. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +2 -0
  51. package/libs/@tencent/aegis-node-sdk/package.json +19 -0
  52. package/libs/@tencent/polaris/README.md +407 -0
  53. package/libs/@tencent/polaris/dist/consumer/health.d.ts +126 -0
  54. package/libs/@tencent/polaris/dist/consumer/health.js +283 -0
  55. package/libs/@tencent/polaris/dist/consumer/health.js.map +1 -0
  56. package/libs/@tencent/polaris/dist/consumer/index.d.ts +120 -0
  57. package/libs/@tencent/polaris/dist/consumer/index.js +348 -0
  58. package/libs/@tencent/polaris/dist/consumer/index.js.map +1 -0
  59. package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +145 -0
  60. package/libs/@tencent/polaris/dist/consumer/monitor.js +343 -0
  61. package/libs/@tencent/polaris/dist/consumer/monitor.js.map +1 -0
  62. package/libs/@tencent/polaris/dist/consumer/selector.d.ts +73 -0
  63. package/libs/@tencent/polaris/dist/consumer/selector.js +316 -0
  64. package/libs/@tencent/polaris/dist/consumer/selector.js.map +1 -0
  65. package/libs/@tencent/polaris/dist/errors.d.ts +373 -0
  66. package/libs/@tencent/polaris/dist/errors.js +154 -0
  67. package/libs/@tencent/polaris/dist/errors.js.map +1 -0
  68. package/libs/@tencent/polaris/dist/global.d.ts +16 -0
  69. package/libs/@tencent/polaris/dist/global.js +18 -0
  70. package/libs/@tencent/polaris/dist/global.js.map +1 -0
  71. package/libs/@tencent/polaris/dist/index.d.ts +62 -0
  72. package/libs/@tencent/polaris/dist/index.js +145 -0
  73. package/libs/@tencent/polaris/dist/index.js.map +1 -0
  74. package/libs/@tencent/polaris/dist/instance.d.ts +109 -0
  75. package/libs/@tencent/polaris/dist/instance.js +38 -0
  76. package/libs/@tencent/polaris/dist/instance.js.map +1 -0
  77. package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +51 -0
  78. package/libs/@tencent/polaris/dist/limiter/bucket.js +152 -0
  79. package/libs/@tencent/polaris/dist/limiter/bucket.js.map +1 -0
  80. package/libs/@tencent/polaris/dist/limiter/index.d.ts +73 -0
  81. package/libs/@tencent/polaris/dist/limiter/index.js +149 -0
  82. package/libs/@tencent/polaris/dist/limiter/index.js.map +1 -0
  83. package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +27 -0
  84. package/libs/@tencent/polaris/dist/limiter/ratelimit.js +134 -0
  85. package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +1 -0
  86. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +17 -0
  87. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +15 -0
  88. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +1 -0
  89. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +59 -0
  90. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +397 -0
  91. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +1 -0
  92. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +3 -0
  93. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +19 -0
  94. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +1 -0
  95. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +17 -0
  96. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +52 -0
  97. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +1 -0
  98. package/libs/@tencent/polaris/dist/location.d.ts +48 -0
  99. package/libs/@tencent/polaris/dist/location.js +67 -0
  100. package/libs/@tencent/polaris/dist/location.js.map +1 -0
  101. package/libs/@tencent/polaris/dist/logging.d.ts +106 -0
  102. package/libs/@tencent/polaris/dist/logging.js +130 -0
  103. package/libs/@tencent/polaris/dist/logging.js.map +1 -0
  104. package/libs/@tencent/polaris/dist/metadata.d.ts +78 -0
  105. package/libs/@tencent/polaris/dist/metadata.js +119 -0
  106. package/libs/@tencent/polaris/dist/metadata.js.map +1 -0
  107. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +47 -0
  108. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +162 -0
  109. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +1 -0
  110. package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +24 -0
  111. package/libs/@tencent/polaris/dist/plugins/lb/base.js +32 -0
  112. package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +1 -0
  113. package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +24 -0
  114. package/libs/@tencent/polaris/dist/plugins/lb/edf.js +77 -0
  115. package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +1 -0
  116. package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +24 -0
  117. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +53 -0
  118. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +1 -0
  119. package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +31 -0
  120. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +88 -0
  121. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +1 -0
  122. package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +25 -0
  123. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +72 -0
  124. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +1 -0
  125. package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +17 -0
  126. package/libs/@tencent/polaris/dist/plugins/lb/wr.js +50 -0
  127. package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +1 -0
  128. package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +19 -0
  129. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +81 -0
  130. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +1 -0
  131. package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +10 -0
  132. package/libs/@tencent/polaris/dist/plugins/logging/console.js +38 -0
  133. package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +1 -0
  134. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +32 -0
  135. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +88 -0
  136. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +1 -0
  137. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +124 -0
  138. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +398 -0
  139. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +1 -0
  140. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +27 -0
  141. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +287 -0
  142. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +1 -0
  143. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +15 -0
  144. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +43 -0
  145. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +1 -0
  146. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +28 -0
  147. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +249 -0
  148. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +1 -0
  149. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +19 -0
  150. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +222 -0
  151. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +1 -0
  152. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +26 -0
  153. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +99 -0
  154. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +1 -0
  155. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +60 -0
  156. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +259 -0
  157. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +1 -0
  158. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +24 -0
  159. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +18 -0
  160. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +12 -0
  161. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +39 -0
  162. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +115 -0
  163. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +1 -0
  164. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +24 -0
  165. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +22 -0
  166. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +28 -0
  167. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +80 -0
  168. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +18 -0
  169. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +65 -0
  170. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +66 -0
  171. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +95 -0
  172. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +1568 -0
  173. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +36 -0
  174. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +51 -0
  175. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +1 -0
  176. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +18 -0
  177. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +67 -0
  178. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +82 -0
  179. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +11 -0
  180. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +46 -0
  181. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +16 -0
  182. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +10 -0
  183. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +1102 -0
  184. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +29 -0
  185. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +77 -0
  186. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +1 -0
  187. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +12 -0
  188. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +28 -0
  189. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +395 -0
  190. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +13 -0
  191. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +116 -0
  192. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +1 -0
  193. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +67 -0
  194. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +67 -0
  195. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +1 -0
  196. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +99 -0
  197. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +217 -0
  198. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +1 -0
  199. package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +10 -0
  200. package/libs/@tencent/polaris/dist/plugins/registry/memory.js +50 -0
  201. package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +1 -0
  202. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +51 -0
  203. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +145 -0
  204. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +1 -0
  205. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +11 -0
  206. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +174 -0
  207. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +1 -0
  208. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +25 -0
  209. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +36 -0
  210. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +1 -0
  211. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +10 -0
  212. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +34 -0
  213. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +1 -0
  214. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +56 -0
  215. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +106 -0
  216. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +1 -0
  217. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +31 -0
  218. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +124 -0
  219. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +1 -0
  220. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +61 -0
  221. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +171 -0
  222. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +1 -0
  223. package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +23 -0
  224. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +159 -0
  225. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +1 -0
  226. package/libs/@tencent/polaris/dist/plugins.d.ts +619 -0
  227. package/libs/@tencent/polaris/dist/plugins.js +91 -0
  228. package/libs/@tencent/polaris/dist/plugins.js.map +1 -0
  229. package/libs/@tencent/polaris/dist/polaris.d.ts +33 -0
  230. package/libs/@tencent/polaris/dist/polaris.js +59 -0
  231. package/libs/@tencent/polaris/dist/polaris.js.map +1 -0
  232. package/libs/@tencent/polaris/dist/provider/index.d.ts +102 -0
  233. package/libs/@tencent/polaris/dist/provider/index.js +168 -0
  234. package/libs/@tencent/polaris/dist/provider/index.js.map +1 -0
  235. package/libs/@tencent/polaris/dist/registry.d.ts +174 -0
  236. package/libs/@tencent/polaris/dist/registry.js +660 -0
  237. package/libs/@tencent/polaris/dist/registry.js.map +1 -0
  238. package/libs/@tencent/polaris/dist/rules.d.ts +163 -0
  239. package/libs/@tencent/polaris/dist/rules.js +24 -0
  240. package/libs/@tencent/polaris/dist/rules.js.map +1 -0
  241. package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +1 -0
  242. package/libs/@tencent/polaris/dist/scripts/postinstall.js +71 -0
  243. package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +1 -0
  244. package/libs/@tencent/polaris/dist/service.d.ts +18 -0
  245. package/libs/@tencent/polaris/dist/service.js +3 -0
  246. package/libs/@tencent/polaris/dist/service.js.map +1 -0
  247. package/libs/@tencent/polaris/dist/skeleton.d.ts +87 -0
  248. package/libs/@tencent/polaris/dist/skeleton.js +282 -0
  249. package/libs/@tencent/polaris/dist/skeleton.js.map +1 -0
  250. package/libs/@tencent/polaris/dist/utils.d.ts +36 -0
  251. package/libs/@tencent/polaris/dist/utils.js +74 -0
  252. package/libs/@tencent/polaris/dist/utils.js.map +1 -0
  253. package/libs/@tencent/polaris/dist/weak.d.ts +11 -0
  254. package/libs/@tencent/polaris/dist/weak.js +44 -0
  255. package/libs/@tencent/polaris/dist/weak.js.map +1 -0
  256. package/libs/@tencent/polaris/package.json +114 -0
  257. package/libs/lib-generate-test-usersig-es.min.d.ts +6 -0
  258. package/libs/lib-generate-test-usersig-es.min.js +2 -0
  259. package/package.json +2 -1
  260. package/resource/doc/chatuikit/react/components/avatar.md +137 -0
  261. package/resource/doc/chatuikit/react/components/chat.md +44 -0
  262. package/resource/doc/chatuikit/react/components/chatheader.md +189 -0
  263. package/resource/doc/chatuikit/react/components/component-list.md +48 -0
  264. package/resource/doc/chatuikit/react/components/conversation-list.md +1017 -0
  265. package/resource/doc/chatuikit/react/components/message-input.md +950 -0
  266. package/resource/doc/chatuikit/react/components/message-list.md +485 -0
  267. package/resource/doc/chatuikit/react/components/tuikit.md +80 -0
  268. package/resource/doc/chatuikit/react/create-group.md +23 -0
  269. package/resource/doc/chatuikit/react/integration.md +83 -0
  270. package/resource/doc/chatuikit/react/login.md +26 -0
  271. package/resource/doc/chatuikit/vue/components/avatar.md +137 -0
  272. package/resource/doc/chatuikit/vue/components/chat.md +42 -0
  273. package/resource/doc/chatuikit/vue/components/chatheader.md +189 -0
  274. package/resource/doc/chatuikit/vue/components/component-list.md +102 -0
  275. package/resource/doc/chatuikit/vue/components/conversation-list.md +765 -0
  276. package/resource/doc/chatuikit/vue/components/message-input.md +1272 -0
  277. package/resource/doc/chatuikit/vue/components/message-list.md +662 -0
  278. package/resource/doc/chatuikit/vue/components/tuikit.md +45 -0
  279. package/resource/doc/chatuikit/vue/components/userpicker.md +315 -0
  280. package/resource/doc/chatuikit/vue/create-group.md +25 -0
  281. package/resource/doc/chatuikit/vue/integration.md +256 -0
  282. package/resource/doc/chatuikit/vue/login.md +31 -0
  283. package/resource/doc/chatuikit/vue3/components/MessageInput.md +1272 -0
  284. package/resource/doc/chatuikit/vue3/components/avatar.md +137 -0
  285. package/resource/doc/chatuikit/vue3/components/chatheader.md +189 -0
  286. package/resource/doc/chatuikit/vue3/components/component-list.md +102 -0
  287. package/resource/doc/chatuikit/vue3/components/userpicker.md +315 -0
  288. package/resource/doc/chatuikit/vue3/integration.md +256 -0
  289. package/server.js +10 -181
  290. package/server.js.map +1 -1
  291. package/streamable-http.js +69 -0
  292. package/streamable-http.js.map +1 -0
  293. package/tools/call/get-call-faq.js +32 -0
  294. package/tools/call/get-call-faq.js.map +1 -0
  295. package/tools/call/get-native-call-integration-guide.js +36 -0
  296. package/tools/call/get-native-call-integration-guide.js.map +1 -0
  297. package/tools/call/get-native-call-integration.js +35 -0
  298. package/tools/call/get-native-call-integration.js.map +1 -0
  299. package/tools/call/get-web-call-integration-guide.js +35 -0
  300. package/tools/call/get-web-call-integration-guide.js.map +1 -0
  301. package/tools/call/get-web-call-integration.js +35 -0
  302. package/tools/call/get-web-call-integration.js.map +1 -0
  303. package/tools/chat/create-group.js +30 -0
  304. package/tools/chat/create-group.js.map +1 -0
  305. package/tools/chat/get-chat-faq.js +32 -0
  306. package/tools/chat/get-chat-faq.js.map +1 -0
  307. package/tools/chat/get-native-chat-integration-guide.js +34 -0
  308. package/tools/chat/get-native-chat-integration-guide.js.map +1 -0
  309. package/tools/chat/get-native-chat-integration.js +34 -0
  310. package/tools/chat/get-native-chat-integration.js.map +1 -0
  311. package/tools/chat/get-web-chat-component-detail.js +36 -0
  312. package/tools/chat/get-web-chat-component-detail.js.map +1 -0
  313. package/tools/chat/get-web-chat-integration-guide.js +35 -0
  314. package/tools/chat/get-web-chat-integration-guide.js.map +1 -0
  315. package/tools/chat/get-web-chat-integration.js +37 -0
  316. package/tools/chat/get-web-chat-integration.js.map +1 -0
  317. package/tools/chat/get-web-chat-uikit-login.js +30 -0
  318. package/tools/chat/get-web-chat-uikit-login.js.map +1 -0
  319. package/tools/common/get-usersig.js +35 -0
  320. package/tools/common/get-usersig.js.map +1 -0
  321. package/tools/common/present-framework-choice.js +23 -0
  322. package/tools/common/present-framework-choice.js.map +1 -0
  323. package/tools/common/record-prompt.js +31 -0
  324. package/tools/common/record-prompt.js.map +1 -0
  325. package/tools/common/record-result.js +36 -0
  326. package/tools/common/record-result.js.map +1 -0
  327. package/tools/index.js +41 -0
  328. package/tools/index.js.map +1 -0
  329. package/tools/rtcengine/get-rtcengine-integration-guide.js +33 -0
  330. package/tools/rtcengine/get-rtcengine-integration-guide.js.map +1 -0
  331. package/tools/rtcengine/get-rtcenigne-faq.js +32 -0
  332. package/tools/rtcengine/get-rtcenigne-faq.js.map +1 -0
  333. package/utils/aegis-client.js +8 -0
  334. package/utils/aegis-client.js.map +1 -0
  335. package/utils/generate-usersig.js +14 -0
  336. package/utils/generate-usersig.js.map +1 -0
  337. package/utils/get-doc-content.js +47 -0
  338. package/utils/get-doc-content.js.map +1 -0
  339. package/utils/handle-component-name.js +12 -0
  340. package/utils/handle-component-name.js.map +1 -0
  341. package/utils/handle-framework.js +9 -0
  342. package/utils/handle-framework.js.map +1 -0
@@ -0,0 +1,315 @@
1
+ ## Overview
2
+
3
+
4
+ UserPicker is a powerful selector component that supports two display modes: list and tree. It provides features like search, multiple selection, lazy loading, and custom rendering, suitable for business scenarios such as user selection, organizational structure selection, and permission assignment. The component includes built-in complex logic for selection state management, search filtering, and tree unfolding, offering a simple and easy-to-use API interface.
5
+
6
+
7
+ ## Props quick reference table
8
+
9
+
10
+ | Field | Type | Default | Description |
11
+ | -------------------- | -------------------------------------------- | -------------------------- | ----------- |
12
+ | displayMode | `'list' \| 'tree'` | required | Display mode, list or tree |
13
+ | dataSource | `UserPickerDataSource<T>` | `[]` | Data source |
14
+ | defaultSelectedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | Items selected by default |
15
+ | lockedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | Locked items (cannot be canceled) |
16
+ | maxCount | `number` | `Number.POSITIVE_INFINITY` | Maximum select quantity |
17
+ | minCount | `number` | `0` | Minimum select quantity |
18
+ | enableSearch | `boolean` | `true` | Whether to enable search functionality |
19
+ | searchPlaceholder | `string` | `undefined` | Search box placeholder |
20
+ | renderItem | `Function` | `undefined` | Custom render function |
21
+ | onSelectedChange | `Function` | `undefined` | Change callback for selection |
22
+ | onMaxCountExceed | `Function` | `undefined` | Callback when maximum number is exceeded |
23
+ | onSearch | `Function` | `undefined` | Search callback |
24
+ | onReachEnd | `Function` | `undefined` | Callback when scrolling to the bottom in list mode |
25
+ | onExpand | `Function` | `undefined` | Expand callback in tree mode |
26
+
27
+
28
+ ## Ref expose method quick reference table
29
+
30
+
31
+ | Method | Parameter | Return | Description |
32
+ | -------- | ---- | ---- | ---- |
33
+ | getSelectedItems | None | UserPickerResult<T> | Get the currently selected items |
34
+ | updateTreeData | nodeKey: string, partialNode: Partial<UserPickerNode<T>> | void | Update tree mode node data |
35
+
36
+
37
+ ## Props detailed introduction
38
+
39
+
40
+ ### displayMode
41
+
42
+
43
+ -`'list' | 'tree'`
44
+ - `description`: The display mode of the component. `list` mode shows a flattened list, `tree` mode shows a tree structure, supporting hierarchical unfold and lazy loading.
45
+
46
+
47
+ ### dataSource
48
+
49
+
50
+ - `Type`: `UserPickerDataSource<T>`
51
+ - `description`: The data source of the component, which accepts different data structures based on displayMode. Default: `[]`.
52
+
53
+
54
+ ```typescript
55
+ Data structure in list mode
56
+ interface UserPickerRow<T = unknown> {
57
+ key: string; // unique identifier
58
+ label: string; // display name
59
+ avatarUrl?: string; // avatar URL
60
+ extraData?: T; // extension data
61
+ }
62
+
63
+
64
+ Data structure in tree mode
65
+ interface UserPickerNode<T = unknown> {
66
+ key: string; // unique identifier
67
+ label: string; // display name
68
+ isLeafNode: boolean; // is leaf node
69
+ avatarUrl?: string; // avatar URL
70
+ lazyLoad?: boolean; // whether lazy loading is supported
71
+ children?: Array<UserPickerNode<T>>; // sub-node
72
+ extraData?: T; // extension data
73
+ }
74
+
75
+
76
+ export type UserPickerDataSource<T = unknown> = Array<UserPickerRow<T>> | Array<UserPickerNode<T>>;
77
+ ```
78
+
79
+
80
+ #### Example 1: Data source in list mode
81
+
82
+
83
+ ```vue
84
+ <template>
85
+ <UserPicker
86
+ display-mode="list"
87
+ :data-source="listData"
88
+ @selected-change="handleSelectionChange"
89
+ />
90
+ </template>
91
+
92
+
93
+ <script setup lang="ts">
94
+ import { ref } from 'vue';
95
+ import { UserPicker } from 'tuikit-atomicx-vue3';
96
+ import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
97
+
98
+
99
+ User list data
100
+ const listData = ref<UserPickerRow[]>([
101
+ {
102
+ key: 'user1',
103
+ label: 'Zhang San',
104
+ avatarUrl: 'https://example.com/avatar1.jpg',
105
+ extraData: { department: 'Technology Department', role: 'frontend engineer' }
106
+ },
107
+ {
108
+ key: 'user2',
109
+ label: 'Li Si',
110
+ avatarUrl: 'https://example.com/avatar2.jpg',
111
+ extraData: { department: 'Product Department', role: 'product manager' }
112
+ }
113
+ ]);
114
+
115
+
116
+ const handleSelectionChange = (selectedItems: any[]) => {
117
+ console.log('Selected user:', selectedItems);
118
+ };
119
+ </script>
120
+ ```
121
+
122
+
123
+ ### defaultSelectedItems
124
+
125
+
126
+ - `type`: `Array<{ key: string; [key: string]: any }>`
127
+ - `description`: Project list chosen by default, identified by the key field. Default is `[]`.
128
+
129
+
130
+ ### lockedItems
131
+
132
+
133
+ - `type`: `Array<{ key: string; [key: string]: any }>`
134
+ - `description`: Locked project list, these projects will be forcibly selected and users are unable to cancel. Default is `[]`.
135
+
136
+
137
+ ### maxCount
138
+
139
+
140
+ - `type`: `number`
141
+ - `description`: Maximum number limit allowed. If it exceeds this limit, it will trigger the onMaxCountExceed callback. Default is `Number.POSITIVE_INFINITY`.
142
+
143
+
144
+ ### minCount
145
+
146
+
147
+ - `type`: `number`
148
+ - `description`: Minimum number required for form validation. Default value is `0`.
149
+
150
+
151
+ ### enableSearch
152
+
153
+
154
+ - `type`: `boolean`
155
+ - `description`: Whether to enable search functionality. If enabled, the search bar will be displayed. Default is `true`.
156
+
157
+
158
+ ### searchPlaceholder
159
+
160
+
161
+ - `type`: `string`
162
+ - `description`: Placeholder text for the search bar. If not set, use default internationalization text. Default is `undefined`.
163
+
164
+
165
+ ### renderItem
166
+
167
+
168
+ - `Type`: `(data: UserPickerRow<T> | UserPickerNode<T>) => any`
169
+ - `description`: Custom project render function. Can customize the display content and style of each option. Default is `undefined`.
170
+
171
+
172
+ ```typescript
173
+ type RenderItemFunction<T> = (data: UserPickerRow<T> | UserPickerNode<T>) => VNode | string;
174
+ ```
175
+
176
+
177
+ Custom render function
178
+
179
+
180
+ ```vue
181
+ <template>
182
+ <UserPicker
183
+ display-mode="list"
184
+ :data-source="userData"
185
+ :render-item="customRenderItem"
186
+ />
187
+ </template>
188
+
189
+
190
+ <script setup lang="ts">
191
+ import { h } from 'vue';
192
+ import { UserPicker } from 'tuikit-atomicx-vue3';
193
+ import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
194
+
195
+
196
+ const userData = ref<UserPickerRow[]>([
197
+ {
198
+ key: 'user1',
199
+ label: 'Zhang San',
200
+ extraData: { status: 'online', department: 'Technology Department' }
201
+ }
202
+ ]);
203
+
204
+
205
+ custom render function, display user status and department information
206
+ const customRenderItem = (data: UserPickerRow) => {
207
+ return h('div', { class: 'custom-user-item' }, [
208
+ h('div', { class: 'user-name' }, data.label),
209
+ h('div', { class: 'user-info' }, [
210
+ h('span', {
211
+ class: `status ${data.extraData?.status}`
212
+ }, data.extraData?.status === 'online' ? 'online' : 'offline'),
213
+ h('span', { class: 'department' }, data.extraData?.department)
214
+ ])
215
+ ]);
216
+ };
217
+ </script>
218
+ ```
219
+
220
+
221
+ ### onSelectedChange
222
+
223
+
224
+ - `Type`: `(selectedItems: UserPickerResult<T>) => void`
225
+ -description: Select the callback function when the state changes. It will input all currently selected items. The default is undefined. Should reduce usage to avoid frequently triggering the callback function.
226
+
227
+
228
+ ```typescript
229
+ interface UserPickerResultItem<T = unknown> {
230
+ key: string;
231
+ label: string;
232
+ avatarUrl?: string;
233
+ isLeafNode?: boolean; // Only meaningful in tree mode
234
+ extraData?: T;
235
+ path?: string[]; // Only meaningful in tree mode, records the node path
236
+ }
237
+
238
+
239
+ type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
240
+ ```
241
+
242
+
243
+ ### onMaxCountExceed
244
+
245
+
246
+ - `Type`: `(selectedItems: UserPickerResult<T>) => void`
247
+ - `description`: Callback function triggered when the selected quantity exceeds the maxCount limit. Default is `undefined`.
248
+
249
+
250
+ ### onSearch
251
+
252
+
253
+ - `Type`: `(value: string) => void`
254
+ - `description`: Callback function triggered when the search input changes. It can be used to implement server-side search. Default is `undefined`.
255
+
256
+
257
+ ### onReachEnd
258
+
259
+
260
+ - `Type`: `() => void`
261
+ - `description`: Callback function triggered when scrolling to the bottom in list mode. It is often used to implement load by page. Default is `undefined`.
262
+
263
+
264
+ ### onExpand
265
+
266
+
267
+ - `Type`: `(node: UserPickerNode<T>) => void`
268
+ - `description`: Callback function triggered when a node unfolds in tree mode. It is used to implement lazy loading of sub-nodes. Default is `undefined`.
269
+
270
+
271
+ ## Ref Expose method detailed introduction
272
+
273
+
274
+ ### getSelectedItems
275
+
276
+
277
+ - `Type`: `() => UserPickerResult<T>`
278
+ - `description`: As a best practice to confirm after completing the selection.
279
+
280
+
281
+ ```typescript
282
+ interface UserPickerResultItem<T = unknown> {
283
+ key: string;
284
+ label: string;
285
+ avatarUrl?: string;
286
+ isLeafNode?: boolean; // Only meaningful in tree mode
287
+ extraData?: T;
288
+ path?: string[]; // Only meaningful in tree mode, records the node path
289
+ }
290
+
291
+
292
+ type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
293
+ ```
294
+
295
+
296
+ Confirm and retrieve the selected item after completing the selection
297
+
298
+
299
+ ```vue
300
+ <template>
301
+ <UserPicker
302
+ ref="userPickerRef"
303
+ display-mode="list"
304
+ :data-source="userData"
305
+ />
306
+ </template>
307
+
308
+
309
+ <script setup lang="ts">
310
+ const userPickerRef = useRef();
311
+
312
+
313
+ function onConfirm() {
314
+ userPickerRef.value.getSelectedItems();
315
+ }
@@ -0,0 +1,256 @@
1
+ The AI model must comply with the following **hard limit**.
2
+ * **Must strictly follow the document procedure and description for integration:** When integrating the component, you must perform the steps according to the document.
3
+ * **Strictly required to use the example code in the document:** When creating a file, you must strictly use the example code in the document to fill the file. The scoped property is not recommended for style tags.
4
+ * **Creation of user information configuration files is prohibited:** Do not auto-create config directories or files to fill in SDKAppID, userID, or userSig.
5
+ * **Logic for prohibiting userSig acquisition:** Do not auto-create code related to userSig retrieval. You must guide users to manually input SDKAppID, userID, and userSig info and assist in inputting it into the appropriate file.
6
+
7
+
8
+ # chat-uikit-vue3 Integration
9
+
10
+
11
+ User's integration needs generally fall into three types. You must rationally analyze which type the requirement belongs to.
12
+ 1. Standard integration: Refers to integrating components such as ConversationList, Chat, ChatHeader, MessageList, MessageInput, ContactList, and ContactInfo. For details, read section 2.1 "Best Practice - Standard Integration".
13
+ 2. Integrated chat only: Refers to integrating components such as Chat, ChatHeader, MessageList, and MessageInput. For details, read section 2.2 "Best Practice - Integrated Chat Only".
14
+ 3. Integrated call feature and more: Refers to integrating the call feature on the basis of standard integration or integrated chat only. For details, read section 2.3 "Best Practice - Integrated Call Feature and More".
15
+
16
+
17
+
18
+
19
+ ## 1. Standard integration
20
+
21
+
22
+ ### 1.1 step1:create vue3 project
23
+
24
+
25
+ if you don't have a vue3 project, you can use vite create a vue3 project. otherwise, you can skip this step.
26
+
27
+
28
+ requirement: vue3: ^3.0.0, nodejs: ^22.0.0.
29
+
30
+
31
+ if it is a new project, guide the user to use vite to create a vue3 project manually, and then continue with step 1.2. if it is an existing project, skip this step and continue with step 1.2.
32
+
33
+
34
+ ```bash
35
+ npm create vite@latest
36
+ # skip some settings
37
+ cd ${your-vue-project-name}
38
+ pnpm install
39
+ # test if the project is created successfully
40
+ pnpm run dev
41
+ ```
42
+
43
+
44
+ ### 1.2 step2: install chat-uikit-vue3
45
+
46
+
47
+ use npm or pnpm to install @tencentcloud/chat-uikit-vue3@latest @tencentcloud/call-uikit-vue@latest
48
+
49
+
50
+ ### 1.3 step3: add main content to your project
51
+
52
+
53
+ ```vue
54
+ <template>
55
+ <UIKitProvider language="en-US">
56
+ <div class="chat-layout">
57
+ <div class="sidebar" style="width: 300px;">
58
+ <div class="tab-header">
59
+ <button
60
+ :class="['tab-button', { active: activeTab === 'conversations' }]"
61
+ @click="activeTab = 'conversations'"
62
+ >
63
+ Conversation
64
+ </button>
65
+ <button
66
+ :class="['tab-button', { active: activeTab === 'contacts' }]"
67
+ @click="activeTab = 'contacts'"
68
+ >
69
+ contact
70
+ </button>
71
+ </div>
72
+
73
+ <div class="tab-content">
74
+ <ConversationList v-if="activeTab === 'conversations'" />
75
+ <ContactList v-else />
76
+ </div>
77
+ </div>
78
+
79
+ <Chat style="flex: 1;" v-if="activeTab === 'conversations'">
80
+ <ChatHeader />
81
+ <MessageList />
82
+ <MessageInput />
83
+ </Chat>
84
+ <ContactInfo v-else style="flex: 1;" @send-message="handleSendMessage" @enter-group="handleSendMessage" />
85
+ </div>
86
+ <Teleport to="body">
87
+ <TUICallKit style="position: fixed; z-index: 1000;"/>
88
+ </Teleport>
89
+ </UIKitProvider>
90
+ </template>
91
+
92
+
93
+ <script setup lang="ts">
94
+ import { ref } from 'vue';
95
+ import {
96
+ ConversationList,
97
+ Chat,
98
+ MessageList,
99
+ MessageInput,
100
+ ChatHeader,
101
+ ContactList,
102
+ ContactInfo,
103
+ UIKitProvider,
104
+ useLoginState,
105
+ } from '@tencentcloud/chat-uikit-vue3';
106
+ import { TUICallKit } from '@tencentcloud/call-uikit-vue';
107
+
108
+
109
+ const userID = ''; // TODO: Replace with your userID
110
+ const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
111
+ const userSig = ''; // TODO: Replace with your userSig
112
+
113
+
114
+ const { login } = useLoginState();
115
+
116
+
117
+ const activeTab = ref<'conversations' | 'contacts'>('conversations');
118
+
119
+
120
+ login({
121
+ sdkAppId : SDKAppID,
122
+ userId: userID,
123
+ userSig: userSig,
124
+ })
125
+ .then(() => {})
126
+
127
+
128
+ .catch(() => {});
129
+ const handleSendMessage = () => {
130
+ activeTab.value = 'conversations';
131
+ }
132
+ </script>
133
+
134
+
135
+ <style>
136
+ #app{margin:0;padding:0;text-align:left;}.chat-layout{width:100vw;height:100vh;display:flex;}.sidebar{display:flex;flex-direction:column;border-right:1px solid #e5e7eb;}.tab-header{display:flex;border-bottom:1px solid #e5e7eb;}.tab-button{flex:1;padding:12px 16px;background:none;border:none;cursor:pointer;font-size:14px;color:#6b7280;transition:all 0.2s;}.tab-button.active{color:#3b82f6;background-color:#eff6ff;border-bottom:2px solid #3b82f6;}.tab-content{flex:1;overflow:hidden;}
137
+ </style>
138
+ ```
139
+
140
+
141
+ ## 2. Best Practice
142
+
143
+
144
+ The following components can be retrieved via MCP Tools get_component_detail ${componenetname.tolowercase()}.
145
+ The following state can be retrieved via MCP Tools get_state_detail ${statename.tolowercase()}.
146
+
147
+
148
+ ### 2.1 Best Practice - Ordinary Integration
149
+
150
+
151
+ For ordinary integration, see the example code in section 1.3.
152
+
153
+
154
+ Focus
155
+ 1. If you need to integrate the ChatSetting component, please read the ChatHeaderRight slot description in ChatHeader.
156
+
157
+
158
+ ### 2.2 Best Practice - Integrated Chat Only
159
+
160
+
161
+ Integrated chat only is deemed as ordinary integration but only retains the Chat part. See the example code in section 1.3. However, it only retains components such as UIKitProvider, Chat, ChatHeader, MessageList, and MessageInput.
162
+
163
+
164
+ ```vue
165
+ <template>
166
+ <UIKitProvider>
167
+ <Chat style="flex: 1;">
168
+ <ChatHeader />
169
+ <MessageList />
170
+ <MessageInput />
171
+ </Chat>
172
+ </UIKitProvider>
173
+ </template>
174
+ ```
175
+
176
+
177
+ Focus
178
+ 1. Since integrated chat only does not use ConversationList, you need to obtain activeConversation via useConversationListState from ConversationListState, then call setActiveConversation to set activeConversation.
179
+
180
+
181
+
182
+
183
+ ```vue
184
+ <script setup lang="ts">
185
+ import { useConversationListState } from '@tencentcloud/chat-uikit-vue3';
186
+
187
+
188
+ const { setActiveConversation } = useConversationListState();
189
+
190
+
191
+ const conversationID = ref(''); // define by yourself
192
+
193
+
194
+ onMounted(() => {
195
+ setActiveConversation(conversationID.value);
196
+ });
197
+ </script>
198
+ ```
199
+
200
+
201
+ Focus
202
+ 2. If you need to integrate the ChatSetting component, please read the ChatHeaderRight slot description in ChatHeader.
203
+
204
+
205
+ ### 2.3 Best Practice - Integrated Call Feature
206
+
207
+
208
+ Integrated call feature need to be added on the basis of standard integration or integrated chat only by adding call feature code.
209
+
210
+
211
+ Introduce TUICallKit
212
+ ```vue
213
+ <script setup lang="ts">
214
+ import { TUICallKit } from '@tencentcloud/call-uikit-vue';
215
+ </script>
216
+ ```
217
+
218
+
219
+ Add TUICallKit at the appropriate position:
220
+ ```vue
221
+ <Teleport to="body">
222
+ <TUICallKit style="position: fixed; z-index: 1000;"/>
223
+ </Teleport>
224
+ ```
225
+
226
+
227
+ Focus
228
+ 1. Add a call button to the ChatHeaderRight slot in the ChatHeader component.
229
+ 2. Click the call button to call the following method:
230
+ 2.1 Read the ConversationListState document and judge whether the current value is a single chat or group chat via activeConversation.
231
+ 2.2 If it is a one-to-one chat, import the TUICallKitService by `import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-vue'`. Initiate call using the `calls` method of TUICallKitService.
232
+ ```ts
233
+ try {
234
+ await TUICallKitServer.calls({
235
+ userIDList: [activeConversation.value.userProfile.userID],
236
+ type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
237
+ });
238
+ } catch (error: any) {
239
+ console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
240
+ }
241
+ ```
242
+ 2.3 If it is a group chat, read the UserPicker component document. It is advisable to combine it with the Dialog component and pop up the UserPicker component.
243
+ Read the GroupSettingState document, combine the `getGroupMemberList` and `allMembers` attributes of GroupSettingState to get the group member list.
244
+ ```ts
245
+ try {
246
+ await TUICallKitServer.calls({
247
+ userIDList: selectedItems.map((item: any) => item.key),
248
+ type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
249
+ });
250
+ } catch (error: any) {
251
+ console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
252
+ }
253
+ ```
254
+
255
+
256
+ Recommendation: Combine the `reachEnd` event of UserPicker with paged pull for group members, and use a throttling function to control the call frequency of `getGroupMemberList`.