@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,662 @@
1
+ # Overview
2
+
3
+ The MessageList component is the core component of the chat UI, responsible for showing the message list and providing abundant interaction features. It supports advanced features like message aggregation, auto-scroll, historical message loading, and read receipts, ideal for building highly customizable chat interfaces. Within the component, it handles scrolling behavior, message loading logic, and message grouping display, delivering a smooth browsing experience for users.
4
+
5
+
6
+ ## Features
7
+ -Message display: support various message types (text, image, video, file, custom message) for rendering and display.
8
+
9
+ - Message aggregation: auto-group adjacent messages based on time interval and sender.
10
+
11
+ - Smart scroll: auto-scroll to the bottom with manual scroll control.
12
+
13
+ - History load: load more historical messages.
14
+
15
+ - Read receipt: support message read status display.
16
+
17
+ - Message operations: support actions such as recall and delete.
18
+
19
+ - Custom rendering: support custom message component and time segmentation component.
20
+
21
+ ## Quick and Easy to Use
22
+
23
+ The following example shows the simplest usage of MessageList.
24
+ ``` typescript
25
+ <template>
26
+ <UIKitProvider>
27
+ <Chat>
28
+ <MessageList />
29
+ <MessageInput />
30
+ </Chat>
31
+ </UIKitProvider>
32
+ </template>
33
+
34
+
35
+
36
+
37
+ <script lang="ts" setup>
38
+ import { UIKitProvider, Chat, MessageList, MessageInput } from '@tencentcloud/chat-uikit-vue3';
39
+ </script>
40
+
41
+
42
+ ```
43
+
44
+ **Note:**
45
+ >
46
+ Practical advice:
47
+ >
48
+ > 1. The MessageList component must be placed in UIKitProvider and Chat containers.
49
+ > 2. MessageList is recommended to be used in conjunction with the MessageInput component.
50
+ > 3. MessageList will default read the currently active session. If you do not integrate the ConversationList component, see the integrated chat only (https://write.woa.com/document/181344022523346944) document.
51
+
52
+
53
+
54
+
55
+ ## Props
56
+ <table>
57
+ <tr>
58
+ <td rowspan="1" colSpan="1" >Field</td>
59
+
60
+
61
+ <td rowspan="1" colSpan="1" >Type</td>
62
+
63
+
64
+ <td rowspan="1" colSpan="1" >Default Value</td>
65
+
66
+
67
+ <td rowspan="1" colSpan="1" >Description</td>
68
+ </tr>
69
+
70
+
71
+ <tr>
72
+ <td rowspan="1" colSpan="1" >[alignment](https://write.woa.com/#alignment)</td>
73
+
74
+
75
+ <td rowspan="1" colSpan="1" >'left' \| 'right' \| 'two-sided'</td>
76
+
77
+
78
+ <td rowspan="1" colSpan="1" >'two-sided'</td>
79
+
80
+
81
+ <td rowspan="1" colSpan="1" >Message alignment mode, supports align left, align right and justify.</td>
82
+ </tr>
83
+
84
+
85
+ <tr>
86
+ <td rowspan="1" colSpan="1" >[messageAggregationTime](https://write.woa.com/#messageAggregationTime)</td>
87
+
88
+
89
+ <td rowspan="1" colSpan="1" >number</td>
90
+
91
+
92
+ <td rowspan="1" colSpan="1" >300 (seconds)</td>
93
+
94
+
95
+ <td rowspan="1" colSpan="1" >Message aggregation interval (seconds). Messages from the same sender sent within this time will be aggregated. Set to 0 to disable message aggregation.</td>
96
+ </tr>
97
+
98
+
99
+ <tr>
100
+ <td rowspan="1" colSpan="1" >[enableReadReceipt](https://write.woa.com/#enableReadReceipt)</td>
101
+
102
+
103
+ <td rowspan="1" colSpan="1" >boolean</td>
104
+
105
+
106
+ <td rowspan="1" colSpan="1" >false</td>
107
+
108
+
109
+ <td rowspan="1" colSpan="1" >Whether to enable the message read receipt feature.</td>
110
+ </tr>
111
+
112
+
113
+ <tr>
114
+ <td rowspan="1" colSpan="1" >[messageActionList](https://write.woa.com/#messageActionList)</td>
115
+
116
+
117
+ <td rowspan="1" colSpan="1" >MessageAction[]</td>
118
+
119
+
120
+ <td rowspan="1" colSpan="1" >undefined</td>
121
+
122
+
123
+ <td rowspan="1" colSpan="1" >Custom message operations list, such as recall and delete.</td>
124
+ </tr>
125
+
126
+
127
+ <tr>
128
+ <td rowspan="1" colSpan="1" >[filter](https://write.woa.com/#filter)</td>
129
+
130
+
131
+ <td rowspan="1" colSpan="1" >(message: MessageModel) => boolean</td>
132
+
133
+
134
+ <td rowspan="1" colSpan="1" >undefined</td>
135
+
136
+
137
+ <td rowspan="1" colSpan="1" >Custom message filter function, used to control which messages should display.</td>
138
+ </tr>
139
+
140
+
141
+ <tr>
142
+ <td rowspan="1" colSpan="1" >[Message](https://write.woa.com/#Message)</td>
143
+
144
+
145
+ <td rowspan="1" colSpan="1" >Component</td>
146
+
147
+
148
+ <td rowspan="1" colSpan="1" >undefined</td>
149
+
150
+
151
+ <td rowspan="1" colSpan="1" >Custom message component for rendering individual messages.</td>
152
+ </tr>
153
+
154
+
155
+ <tr>
156
+ <td rowspan="1" colSpan="1" >[MessageTimeDivider](https://write.woa.com/#MessageTimeDivider)</td>
157
+
158
+
159
+ <td rowspan="1" colSpan="1" >Component</td>
160
+
161
+
162
+ <td rowspan="1" colSpan="1" >undefined</td>
163
+
164
+
165
+ <td rowspan="1" colSpan="1" >Custom message time segmentation component.</td>
166
+ </tr>
167
+ </table>
168
+
169
+
170
+
171
+
172
+ ## Props detailed introduction
173
+
174
+
175
+ ### alignment
176
+ -Type: 'left' | 'right' | 'two-sided'
177
+
178
+
179
+ - Details: Message alignment mode in the list. `'left'` means all messages align left, `'right'` means all messages align right, `'two-sided'` means sender messages align right and recipient messages align left. Default value is `'two-sided'`.
180
+
181
+
182
+ ### messageAggregationTime
183
+ - Type: number
184
+
185
+ - Details: Message aggregation interval in seconds. When the same sender sends multiple messages consecutively within the specified time interval, these messages will be aggregated and displayed. Set to `0` or a negative value to disable the aggregation function, and each message will be displayed independently. Default value is `300` (5 minutes).
186
+
187
+ ### enableReadReceipt
188
+ - Type: boolean
189
+ - Details: Whether to enable the read receipt feature. When set to `true`, the component will attempt to display the read status of messages. Default value is `false`.
190
+
191
+ ### messageActionList
192
+ - Type: MessageAction[]
193
+
194
+ - Details: Defines a list of custom actions that can be performed on messages, such as copy, recall, forward, and delete. This is a complex type that can be customized by importing an array of `MessageAction` objects. Default value is `undefined`, and the component will provide a default action list based on the `useMessageActions` hook.
195
+
196
+
197
+ The current default sequence is: `['copy', 'recall', 'quote', 'forward', 'delete']`.
198
+
199
+ **MessageAction** type definition:
200
+
201
+ ``` typescript
202
+ import type { Component } from 'vue';
203
+ import type { MessageModel } from '@tencentcloud/chat-uikit-vue3';
204
+
205
+ interface MessageAction {
206
+ /** Unique operation identifier */
207
+ key: string;
208
+ /** Display text of the operation */
209
+ label: string;
210
+ /** Icon component or icon name for the operation */
211
+ icon?: Component | string;
212
+ /** Callback function when the operation is clicked */
213
+ onClick?: (message: MessageModel) => void;
214
+ /** Controls the visibility of the operation, can be a boolean value or a function that determines visibility based on the message */
215
+ visible?: boolean | ((message: MessageModel) => boolean);
216
+ /** Customize component, if provided, will replace the default tag and icon */
217
+ component?: Component;
218
+ /** Custom class name */
219
+ className?: string;
220
+ /** Custom style */
221
+ style?: Record<string, any>;
222
+ }
223
+ ```
224
+
225
+
226
+ Use the `useMessageActions` hook to obtain the complete message actions list, then customize as needed. The `useMessageActions` hook accepts an optional parameter, which can be an array of action keys (`string`) or complete `MessageAction` objects. If a `string` array is input, the default operation configuration will be used. If `MessageAction` objects are input, they will merge and override the default configuration.
227
+
228
+
229
+
230
+
231
+ #### Example code 1: Change the order of message actions list
232
+
233
+
234
+ The following code places the `forward` action first in the message actions list.
235
+ ``` typescript
236
+ <template>
237
+ <MessageList :messageActionList="actions" />
238
+ </template>
239
+
240
+
241
+ <script lang="ts" setup>
242
+ import { MessageList, useMessageActions } from '@tencentcloud/chat-uikit-vue3';
243
+
244
+
245
+ const actions = useMessageActions(['forward', 'copy', 'recall', 'quote', 'delete']);
246
+ </script>
247
+ ```
248
+
249
+
250
+ example effect
251
+
252
+
253
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/8eaaf60188a811f0818a52540099c741.png)
254
+
255
+
256
+
257
+
258
+ #### Example code 2: Only show some message actions
259
+
260
+
261
+ Only show `copy` and `recall` operations, hide other operations.
262
+ ``` typescript
263
+ <template>
264
+ <MessageList :messageActionList="actions" />
265
+ </template>
266
+
267
+
268
+ <script lang="ts" setup>
269
+ import { MessageList, useMessageActions } from '@tencentcloud/chat-uikit-vue3';
270
+
271
+
272
+ const actions = useMessageActions(['copy', 'recall']);
273
+ </script>
274
+ ```
275
+
276
+
277
+ example effect
278
+
279
+
280
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/d481cee988a811f0b321525400e889b2.png)
281
+
282
+
283
+ #### Example code 3: Customize message action style and logic
284
+
285
+
286
+ Here is an example of a custom forward operation:
287
+ 1. Change the tag to 'Forward ⚠️'
288
+
289
+
290
+ 2. Change the color to orange
291
+
292
+
293
+ 3. Only messages from others can be forwarded
294
+
295
+
296
+ ``` typescript
297
+ <template>
298
+ <MessageList :messageActionList="actions" />
299
+ </template>
300
+
301
+ <script lang="ts" setup>
302
+ import { MessageList, useMessageActions } from '@tencentcloud/chat-uikit-vue3';
303
+
304
+ const actions = useMessageActions(['copy', {
305
+ key: 'forward',
306
+ label: 'Forward ⚠️',
307
+ style: {
308
+ color: 'orange',
309
+ },
310
+ visible: (message) => message.flow === 'in',
311
+ }, 'quote', 'recall', 'delete']);
312
+ </script>
313
+ ```
314
+
315
+
316
+ example effect
317
+
318
+
319
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/9aa48621824811f0b1df52540044a08e.png)
320
+
321
+
322
+
323
+
324
+ #### Example code 4: Add new custom message action
325
+
326
+
327
+ Assume messages need to be customized, such as only allowing others' sent messages to be tagged as 'like', and inserting this after the 'undo' operation.
328
+ ``` typescript
329
+ <template>
330
+ <MessageList :messageActionList="actions" />
331
+ </template>
332
+
333
+
334
+ <script lang="ts" setup>
335
+ import { MessageList, useMessageActions } from '@tencentcloud/chat-uikit-vue3';
336
+
337
+
338
+ const customLikeAction = {
339
+ key: 'like',
340
+ label: 'Like',
341
+ icon: '🩷',
342
+ visible: (message) => message.flow === 'in',
343
+ onClick: (message) => {
344
+ console.log('like message:', message.ID);
345
+ Implement the like logic here, for example by calling the backend API
346
+ },
347
+ };
348
+
349
+
350
+ const actions = useMessageActions(['forward', 'copy', 'recall', customLikeAction, 'quote', 'delete']);
351
+ </script>
352
+ ```
353
+
354
+
355
+ example effect
356
+
357
+
358
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/9f5aa2e4824b11f0a8ae5254005ef0f7.png)
359
+
360
+
361
+
362
+
363
+ ### filter
364
+ - type:((message: MessageModel) => boolean) | undefined
365
+
366
+
367
+ -A custom filter function for filtering messages before list rendering. The function receives a `MessageModel` message object and returns a boolean value. If it returns `true`, the message will be displayed; if `false`, the message will not be displayed. The default value is `undefined`, meaning no additional filtering is performed (but the component will filter out messages with `isDeleted` set to `true` by default).
368
+
369
+
370
+
371
+
372
+ #### Example code: Filter out text messages sent by robots
373
+
374
+
375
+ This example shows how to use the `filter` prop to filter out specific messages sent by users.
376
+ ``` typescript
377
+ <template>
378
+ <MessageList :filter="customMessageFilter" />
379
+ </template>
380
+
381
+
382
+ <script lang="ts" setup>
383
+ import { MessageList, MessageType } from '@tencentcloud/chat-uikit-vue3';
384
+ import type { MessageModel } from '@tencentcloud/chat-uikit-vue3';
385
+
386
+
387
+ // Define custom message filter function
388
+ const customMessageFilter = (message: MessageModel): boolean => {
389
+ if (
390
+ message.nick?.includes('_robot')
391
+ && message.type === MessageType.TEXT as any
392
+ ) {
393
+ return false;
394
+ }
395
+ return true;
396
+ };
397
+ </script>
398
+ ```
399
+
400
+
401
+ ### Message
402
+ - Type: Component | undefined
403
+
404
+
405
+ -Description: Custom render for individual messages in the message list.
406
+
407
+
408
+
409
+
410
+ If you need full control over message display style and internal logic, you can pass in a Vue component to replace the default message rendering. The custom component will receive props like `message` (IMessageModel type), `alignment`, and `messageActionList`. By default, the internal default message component `Message` is used.
411
+
412
+
413
+
414
+
415
+ #### Example code: CUSTOM message component for message click redirection
416
+
417
+
418
+ This example shows how to create a custom message component to render specific `CUSTOM` messages (`businessID` as `text_link`) as clickable URLs.
419
+ ``` typescript
420
+ <template>
421
+ <MessageList :Message="CustomMessage" />
422
+ </template>
423
+
424
+
425
+ <script lang="ts" setup>
426
+ import { defineComponent, h } from 'vue';
427
+ import { MessageList, Message, MessageType } from '@tencentcloud/chat-uikit-vue3';
428
+ import type { MessageModel } from '@tencentcloud/chat-uikit-vue3';
429
+
430
+
431
+ const CustomMessage = defineComponent({
432
+ name: 'CustomMessage',
433
+ props: {
434
+ message: {
435
+ type: Object as () => MessageModel,
436
+ required: true,
437
+ },
438
+ // MessageList will pass other props, which can be received as needed, such as alignment, messageActionList
439
+ },
440
+ setup(props) {
441
+ return () => {
442
+ const { message } = props;
443
+
444
+
445
+ if (message.type === MessageType.CUSTOM as any) {
446
+ const { businessID, ...restData } = JSON.parse(message.payload.data);
447
+ if (businessID === 'text_link') {
448
+ return h('div', { class: 'custom-text-link-message' }, [
449
+ h('div', restData.text),
450
+ h('a', { href: restData.link, target: '_blank' }, `Redirect to external website address ${restData.link}`),
451
+ ]);
452
+ }
453
+ }
454
+ Other message types use the default message component
455
+ return h(Message, props);
456
+ };
457
+ },
458
+ });
459
+ </script>
460
+
461
+
462
+ <style scoped>
463
+ .custom-text-link-message {
464
+ padding: 8px;
465
+ background-color: #f0f8ff;
466
+ border-radius: 8px;
467
+ max-width: 60%;
468
+ margin-bottom: 4px;
469
+ }
470
+
471
+
472
+ .custom-text-link-message a {
473
+ color: #1890ff;
474
+ text-decoration: underline;
475
+ }
476
+ </style>
477
+ ```
478
+
479
+
480
+ example effect
481
+
482
+
483
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/abd6f2ea825411f0b1df52540044a08e.png)
484
+
485
+
486
+
487
+
488
+ ### MessageTimeDivider
489
+ - Type: Component | undefined
490
+
491
+
492
+ - Description: for custom rendering time segmentation component.
493
+
494
+
495
+
496
+
497
+ You can pass in a Vue component to replace the default time divider rendering. The custom component will receive props like `currentMessage` (the associated message of the current time divider) and `previousMessage` (the previous message), and can determine the display logic and style based on this information. By default, it uses the internal `MessageTimeDivider` component.
498
+
499
+
500
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/4d5e72b688ae11f0974b52540044a08e.png)
501
+
502
+
503
+
504
+
505
+ #### Example code: Custom time divider component to display whether it's working hours
506
+
507
+
508
+ This example shows how to create a custom time dividing line component, determine whether the time of the last message is a working hour, and display the appropriate tag and color.
509
+ ``` typescript
510
+ <template>
511
+ <MessageList :MessageTimeDivider="BusinessTimeDivider" />
512
+ </template>
513
+
514
+
515
+ <script lang="ts" setup>
516
+ import { defineComponent, h } from 'vue';
517
+ import { MessageList } from '@tencentcloud/chat-uikit-vue3';
518
+ import type { MessageModel } from '@tencentcloud/chat-uikit-vue3';
519
+
520
+
521
+ const BusinessTimeDivider = defineComponent({
522
+ name: 'BusinessTimeDivider',
523
+ props: {
524
+ previousMessage: {
525
+ type: Object as () => MessageModel | undefined,
526
+ default: undefined,
527
+ },
528
+ currentMessage: {
529
+ type: Object as () => MessageModel,
530
+ required: true,
531
+ },
532
+ },
533
+ setup(props) {
534
+ if (!props.previousMessage || !props.currentMessage) {
535
+ return () => null;
536
+ }
537
+
538
+
539
+ const currentTime = new Date(props.currentMessage.time * 1000);
540
+ const prevTime = new Date(props.previousMessage.time * 1000);
541
+
542
+
543
+ // Display only when crossing days or the interval exceeds 4 hours
544
+ const shouldShow = currentTime.toDateString() !== prevTime.toDateString()
545
+ || (currentTime.getTime() - prevTime.getTime()) > 4 * 60 * 60 * 1000;
546
+
547
+
548
+ if (!shouldShow) {
549
+ return () => null;
550
+ }
551
+
552
+
553
+ Working hours (9:00-18:00, Monday through Friday)
554
+ const isWorkingTime = () => {
555
+ const hour = currentTime.getHours();
556
+ const day = currentTime.getDay();
557
+ return day >= 1 && day <= 5 && hour >= 9 && hour <= 18;
558
+ };
559
+
560
+
561
+ const timeLabel = isWorkingTime() ? 'Working' : 'Non working';
562
+ const timeColor = isWorkingTime() ? '#52c41a' : '#faad14';
563
+
564
+
565
+ return () =>
566
+ h('div', { style: { textAlign: 'center', margin: '16px 0' } }, [
567
+ h('span', {
568
+ style: {
569
+ backgroundColor: timeColor,
570
+ color: 'white',
571
+ padding: '2px 8px',
572
+ borderRadius: '12px',
573
+ marginRight: '8px',
574
+ },
575
+ }, timeLabel),
576
+ currentTime.toLocaleString(),
577
+ ]);
578
+ },
579
+ });
580
+ </script>
581
+ ```
582
+
583
+
584
+ example effect
585
+
586
+
587
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100033438418/1de6fe94825711f0a8ae5254005ef0f7.png)
588
+
589
+
590
+
591
+
592
+ supplementary information
593
+
594
+
595
+ Common fields of the `MessageModel` type:
596
+ ``` typescript
597
+ // API definition for MessageModel, see the @tencentcloud/chat-uikit-engine document for details
598
+ // This is a complex message model containing properties such as message ID, event type, sender, content, time, and status.
599
+ Sample structure (not a complete definition)
600
+ interface MessageModel {
601
+ ID: string;
602
+ conversationID: string;
603
+ type: MessageType;
604
+ payload: any;
605
+ flow: 'in' | 'out';
606
+ from: string;
607
+ to: string;
608
+ time: number; // Unix timestamp (seconds)
609
+ status: 'unSend' | 'success' | 'fail';
610
+ isDeleted: boolean;
611
+ isRevoked: boolean;
612
+ hasRiskContent: boolean; // whether the content contains risk
613
+ // ... other attributes
614
+ }
615
+
616
+
617
+ enum MessageType {
618
+ TEXT, // Text
619
+ IMAGE
620
+ AUDIO, // Audio
621
+ VIDEO, // Video
622
+ FILE, // File
623
+ FACE, // Large Sticker
624
+ LOCATION, // Location
625
+ GRP_TIP, // Group prompt
626
+ CUSTOM, // Custom
627
+ MERGER, // Combine and forward
628
+ }
629
+
630
+
631
+ ```
632
+
633
+
634
+ For the complete content of MessageModel, see the [TUIChatEngine reference document](https://web.sdk.qcloud.com/im/doc/chat-engine/IMessageModel.html).
635
+
636
+
637
+ Reference
638
+ - [Customize Component - UIKitProvider](https://write.woa.com/document/187032638782849024)
639
+
640
+
641
+ - [Customize Component - ConversationList](https://write.woa.com/document/186960319111872512)
642
+
643
+
644
+ - [Customize Component - Chat](https://write.woa.com/document/187778215983329280)
645
+
646
+
647
+ - [Customize Component - MessageInput](https://write.woa.com/document/187058763983568896)
648
+
649
+
650
+ - [Customize Component - ChatSetting](https://write.woa.com/document/187321409859108864)
651
+
652
+
653
+ - [Customize Component - ContactList](https://write.woa.com/document/187595466274463744)
654
+
655
+
656
+ - [Customize Component - Search](https://write.woa.com/document/187595449195040768)
657
+
658
+
659
+ - [chat-uikit-vue3 npm](https://www.npmjs.com/package/@tencentcloud/chat-uikit-vue3)
660
+
661
+
662
+ - [github Demo](https://github.com/Tencent-RTC/TUIKit_Vue3/tree/main/demos/rtcube-vite-vue3)
@@ -0,0 +1,45 @@
1
+ # TUIKit Introduction
2
+
3
+ TUIKit is a UI component library based on Tencent Cloud Chat SDK. It provides some common UI components, including session, chat, relationship chain, group, audio and video call and other features.
4
+ Based on UI components, you can quickly build your own business logic like building blocks.
5
+ The components in TUIKit implement UI features while calling the appropriate APIs of the IM SDK to handle IM-related logic and data. Therefore, developers using TUIKit only need to consider their business or personalized expansion.
6
+
7
+
8
+ ## TUIKit main features
9
+
10
+ TUIKit is mainly divided into several UI subcomponents: Chat, ConversationList, ChatSetting, ContactList, and Search. Each UI component is responsible for showing different content.
11
+
12
+ ## Chat
13
+
14
+ Chat is primarily responsible for displaying the message interface. You can use it to directly send different types of messages, including text, emoji, images, video, file, and custom message types. You can also long-press messages to forward, recall, or refer to them, as well as check message read receipt details.
15
+
16
+ ## ConversationList
17
+
18
+ ConversationList is primarily responsible for showing and editing the conversation list, including session pinning, mute conversation notifications, delete conversation, and other features.
19
+
20
+ ## Search
21
+
22
+ <table>
23
+ <tr>
24
+ <td rowspan="1" colSpan="1">global search</td>
25
+
26
+
27
+ <td rowspan="1" colSpan="1">in-conversation search</td>
28
+ </tr>
29
+
30
+
31
+ <tr>
32
+ <td rowspan="1" colSpan="1"><br>![Search ALL text containing "hello" via global search](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027119864/bc24fa6e74a311eeb5cb52540099b6dd.gif)<br>Search ALL text containing "hello" via global search</td>
33
+
34
+
35
+ <td rowspan="1" colSpan="1"><br>![Search all file messages in specific conversations](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027119864/c05824eb74a311eeb3675254006b5335.gif)<br>Search all file messages in specific conversations</td>
36
+ </tr>
37
+ </table>
38
+
39
+ ## ChatSetting
40
+
41
+ ChatSetting is primarily responsible for managing group information, group members, and group permissions.
42
+
43
+ ## ContactList
44
+
45
+ ContactList is primarily responsible for showing the contact person and permission setting.