@tencentcloud/sdk-mcp 1.0.7 → 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 (328) hide show
  1. package/package.json +1 -1
  2. package/resource/doc/chatuikit/react/components/chat.md +38 -0
  3. package/resource/doc/chatuikit/react/components/chatheader.md +153 -0
  4. package/resource/doc/chatuikit/react/components/conversation-list.md +765 -0
  5. package/resource/doc/chatuikit/react/components/message-input.md +799 -0
  6. package/resource/doc/chatuikit/react/components/message-list.md +385 -0
  7. package/resource/doc/chatuikit/react/components/tuikit.md +64 -0
  8. package/resource/doc/chatuikit/react/create-group.md +22 -0
  9. package/resource/doc/chatuikit/react/login.md +25 -0
  10. package/resource/doc/chatuikit/vue/components/MessageInput.md +546 -0
  11. package/resource/doc/chatuikit/vue/components/avatar.md +105 -0
  12. package/resource/doc/chatuikit/vue/components/chat.md +38 -0
  13. package/resource/doc/chatuikit/vue/components/chatheader.md +153 -0
  14. package/resource/doc/chatuikit/vue/components/component-list.md +90 -0
  15. package/resource/doc/chatuikit/vue/components/conversation-list.md +590 -0
  16. package/resource/doc/chatuikit/vue/components/login.md +29 -0
  17. package/resource/doc/chatuikit/vue/components/message-input.md +546 -0
  18. package/resource/doc/chatuikit/vue/components/message-list.md +548 -0
  19. package/resource/doc/chatuikit/vue/components/tuikit.md +110 -0
  20. package/resource/doc/chatuikit/vue/components/userpicker.md +256 -0
  21. package/resource/doc/chatuikit/vue/create-group.md +26 -0
  22. package/resource/doc/chatuikit/vue/integration.md +218 -0
  23. package/resource/doc/chatuikit/vue/login.md +29 -0
  24. package/resource/doc/chatuikit/vue3/components/MessageList.md +385 -0
  25. package/resource/doc/chatuikit/vue3/integration.md +7 -4
  26. package/tools/call/get-native-call-integration-guide.js +2 -2
  27. package/tools/call/get-native-call-integration-guide.js.map +1 -1
  28. package/tools/call/get-native-call-integration.js +35 -0
  29. package/tools/call/get-native-call-integration.js.map +1 -0
  30. package/tools/call/get-web-call-integration-guide.js +4 -4
  31. package/tools/call/get-web-call-integration-guide.js.map +1 -1
  32. package/tools/call/get-web-call-integration.js +34 -0
  33. package/tools/call/get-web-call-integration.js.map +1 -0
  34. package/tools/chat/auto-create-group.js +44 -0
  35. package/tools/chat/auto-create-group.js.map +1 -0
  36. package/tools/chat/create-group.js +29 -0
  37. package/tools/chat/create-group.js.map +1 -0
  38. package/tools/chat/get-native-chat-integration-guide.js +2 -2
  39. package/tools/chat/get-native-chat-integration-guide.js.map +1 -1
  40. package/tools/chat/get-native-chat-integration.js +33 -0
  41. package/tools/chat/get-native-chat-integration.js.map +1 -0
  42. package/tools/chat/get-web-chat-component-detail.js +8 -5
  43. package/tools/chat/get-web-chat-component-detail.js.map +1 -1
  44. package/tools/chat/get-web-chat-integration-guide.js +16 -8
  45. package/tools/chat/get-web-chat-integration-guide.js.map +1 -1
  46. package/tools/chat/get-web-chat-integration.js +36 -0
  47. package/tools/chat/get-web-chat-integration.js.map +1 -0
  48. package/tools/chat/get-web-chat-uikit-login.js +30 -0
  49. package/tools/chat/get-web-chat-uikit-login.js.map +1 -0
  50. package/tools/common/present-framework-choice.js +9 -18
  51. package/tools/common/present-framework-choice.js.map +1 -1
  52. package/tools/common/record-prompt.js +3 -3
  53. package/tools/common/record-prompt.js.map +1 -1
  54. package/tools/common/record-result.js +6 -6
  55. package/tools/common/record-result.js.map +1 -1
  56. package/tools/index.js +12 -8
  57. package/tools/index.js.map +1 -1
  58. package/utils/handle-component-name.js +12 -0
  59. package/utils/handle-component-name.js.map +1 -0
  60. package/utils/handle-framework.js +9 -0
  61. package/utils/handle-framework.js.map +1 -0
  62. package/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
  63. package/@tencent/aegis-node-sdk/LICENSE +0 -21
  64. package/@tencent/aegis-node-sdk/README.md +0 -562
  65. package/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
  66. package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
  67. package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
  68. package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
  69. package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
  70. package/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
  71. package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
  72. package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
  73. package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
  74. package/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
  75. package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
  76. package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
  77. package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
  78. package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
  79. package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
  80. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
  81. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
  82. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
  83. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
  84. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
  85. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
  86. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
  87. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
  88. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
  89. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
  90. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
  91. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
  92. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
  93. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
  94. package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
  95. package/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
  96. package/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
  97. package/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +0 -2
  98. package/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
  99. package/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
  100. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
  101. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
  102. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
  103. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
  104. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
  105. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
  106. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
  107. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
  108. package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
  109. package/@tencent/aegis-node-sdk/package.json +0 -19
  110. package/@tencent/polaris/README.md +0 -407
  111. package/@tencent/polaris/dist/consumer/health.d.ts +0 -126
  112. package/@tencent/polaris/dist/consumer/health.js +0 -283
  113. package/@tencent/polaris/dist/consumer/health.js.map +0 -1
  114. package/@tencent/polaris/dist/consumer/index.d.ts +0 -120
  115. package/@tencent/polaris/dist/consumer/index.js +0 -348
  116. package/@tencent/polaris/dist/consumer/index.js.map +0 -1
  117. package/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
  118. package/@tencent/polaris/dist/consumer/monitor.js +0 -343
  119. package/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
  120. package/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
  121. package/@tencent/polaris/dist/consumer/selector.js +0 -316
  122. package/@tencent/polaris/dist/consumer/selector.js.map +0 -1
  123. package/@tencent/polaris/dist/errors.d.ts +0 -373
  124. package/@tencent/polaris/dist/errors.js +0 -154
  125. package/@tencent/polaris/dist/errors.js.map +0 -1
  126. package/@tencent/polaris/dist/global.d.ts +0 -16
  127. package/@tencent/polaris/dist/global.js +0 -18
  128. package/@tencent/polaris/dist/global.js.map +0 -1
  129. package/@tencent/polaris/dist/index.d.ts +0 -62
  130. package/@tencent/polaris/dist/index.js +0 -145
  131. package/@tencent/polaris/dist/index.js.map +0 -1
  132. package/@tencent/polaris/dist/instance.d.ts +0 -109
  133. package/@tencent/polaris/dist/instance.js +0 -38
  134. package/@tencent/polaris/dist/instance.js.map +0 -1
  135. package/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
  136. package/@tencent/polaris/dist/limiter/bucket.js +0 -152
  137. package/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
  138. package/@tencent/polaris/dist/limiter/index.d.ts +0 -73
  139. package/@tencent/polaris/dist/limiter/index.js +0 -149
  140. package/@tencent/polaris/dist/limiter/index.js.map +0 -1
  141. package/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
  142. package/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
  143. package/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
  144. package/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
  145. package/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
  146. package/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
  147. package/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
  148. package/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
  149. package/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
  150. package/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
  151. package/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
  152. package/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
  153. package/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
  154. package/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
  155. package/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
  156. package/@tencent/polaris/dist/location.d.ts +0 -48
  157. package/@tencent/polaris/dist/location.js +0 -67
  158. package/@tencent/polaris/dist/location.js.map +0 -1
  159. package/@tencent/polaris/dist/logging.d.ts +0 -106
  160. package/@tencent/polaris/dist/logging.js +0 -130
  161. package/@tencent/polaris/dist/logging.js.map +0 -1
  162. package/@tencent/polaris/dist/metadata.d.ts +0 -78
  163. package/@tencent/polaris/dist/metadata.js +0 -119
  164. package/@tencent/polaris/dist/metadata.js.map +0 -1
  165. package/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
  166. package/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
  167. package/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
  168. package/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
  169. package/@tencent/polaris/dist/plugins/lb/base.js +0 -32
  170. package/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
  171. package/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
  172. package/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
  173. package/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
  174. package/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
  175. package/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
  176. package/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
  177. package/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
  178. package/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
  179. package/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
  180. package/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
  181. package/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
  182. package/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
  183. package/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
  184. package/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
  185. package/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
  186. package/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
  187. package/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
  188. package/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
  189. package/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
  190. package/@tencent/polaris/dist/plugins/logging/console.js +0 -38
  191. package/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
  192. package/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
  193. package/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
  194. package/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
  195. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
  196. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
  197. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
  198. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
  199. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
  200. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
  201. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
  202. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
  203. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
  204. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
  205. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
  206. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
  207. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
  208. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
  209. package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
  210. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
  211. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
  212. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
  213. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
  214. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
  215. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
  216. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
  217. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
  218. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
  219. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
  220. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
  221. package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
  222. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
  223. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
  224. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
  225. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
  226. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
  227. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
  228. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
  229. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
  230. package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
  231. package/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
  232. package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
  233. package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
  234. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
  235. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
  236. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
  237. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
  238. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
  239. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
  240. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
  241. package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
  242. package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
  243. package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
  244. package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
  245. package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
  246. package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
  247. package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
  248. package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
  249. package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
  250. package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
  251. package/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
  252. package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
  253. package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
  254. package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
  255. package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
  256. package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
  257. package/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
  258. package/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
  259. package/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
  260. package/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
  261. package/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
  262. package/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
  263. package/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
  264. package/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
  265. package/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
  266. package/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
  267. package/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
  268. package/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
  269. package/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
  270. package/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
  271. package/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
  272. package/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
  273. package/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
  274. package/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
  275. package/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
  276. package/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
  277. package/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
  278. package/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
  279. package/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
  280. package/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
  281. package/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
  282. package/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
  283. package/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
  284. package/@tencent/polaris/dist/plugins.d.ts +0 -619
  285. package/@tencent/polaris/dist/plugins.js +0 -91
  286. package/@tencent/polaris/dist/plugins.js.map +0 -1
  287. package/@tencent/polaris/dist/polaris.d.ts +0 -33
  288. package/@tencent/polaris/dist/polaris.js +0 -59
  289. package/@tencent/polaris/dist/polaris.js.map +0 -1
  290. package/@tencent/polaris/dist/provider/index.d.ts +0 -102
  291. package/@tencent/polaris/dist/provider/index.js +0 -168
  292. package/@tencent/polaris/dist/provider/index.js.map +0 -1
  293. package/@tencent/polaris/dist/registry.d.ts +0 -174
  294. package/@tencent/polaris/dist/registry.js +0 -660
  295. package/@tencent/polaris/dist/registry.js.map +0 -1
  296. package/@tencent/polaris/dist/rules.d.ts +0 -163
  297. package/@tencent/polaris/dist/rules.js +0 -24
  298. package/@tencent/polaris/dist/rules.js.map +0 -1
  299. package/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
  300. package/@tencent/polaris/dist/scripts/postinstall.js +0 -71
  301. package/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
  302. package/@tencent/polaris/dist/service.d.ts +0 -18
  303. package/@tencent/polaris/dist/service.js +0 -3
  304. package/@tencent/polaris/dist/service.js.map +0 -1
  305. package/@tencent/polaris/dist/skeleton.d.ts +0 -87
  306. package/@tencent/polaris/dist/skeleton.js +0 -282
  307. package/@tencent/polaris/dist/skeleton.js.map +0 -1
  308. package/@tencent/polaris/dist/utils.d.ts +0 -36
  309. package/@tencent/polaris/dist/utils.js +0 -74
  310. package/@tencent/polaris/dist/utils.js.map +0 -1
  311. package/@tencent/polaris/dist/weak.d.ts +0 -11
  312. package/@tencent/polaris/dist/weak.js +0 -44
  313. package/@tencent/polaris/dist/weak.js.map +0 -1
  314. package/@tencent/polaris/package.json +0 -114
  315. package/resource/doc/chatuikit/react/integrate_tuichat_only_react.md +0 -185
  316. package/resource/doc/chatuikit/react/integrate_tuichat_react.md +0 -212
  317. package/resource/doc/chatuikit/vue/integrate_tuichat_only_vue.md +0 -149
  318. package/resource/doc/chatuikit/vue/integrate_tuichat_vue.md +0 -248
  319. package/streamableHttp.js +0 -74
  320. package/streamableHttp.js.map +0 -1
  321. /package/resource/doc/chatuikit/{iOS → ios}/client_api_iOS.md +0 -0
  322. /package/resource/doc/chatuikit/{iOS → ios}/integrate_tuichat_only_iOS.md +0 -0
  323. /package/resource/doc/chatuikit/{iOS → ios}/integrate_tuikit_iOS.md +0 -0
  324. /package/resource/doc/chatuikit/{iOS → ios}/ui_api_iOS.md +0 -0
  325. /package/resource/doc/tuicallkit/{iOS → ios}/api_TUICallKit.md +0 -0
  326. /package/resource/doc/tuicallkit/{iOS → ios}/api_TUICallObserver.md +0 -0
  327. /package/resource/doc/tuicallkit/{iOS → ios}/how_to_integrated_iOS_callkit.md +0 -0
  328. /package/resource/doc/tuicallkit/{iOS → ios}/how_to_run_iOS_callkit_demo.md +0 -0
@@ -1,145 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PolarisNearbyRouter = exports.MatchMode = void 0;
4
- const __1 = require("../../..");
5
- const plugins_1 = require("../../../plugins");
6
- const utils_1 = require("../../../utils");
7
- /** 就近路由匹配模式 */
8
- var MatchMode;
9
- (function (MatchMode) {
10
- /** 不开启就近路由 */
11
- MatchMode[MatchMode["Off"] = 0] = "Off";
12
- /**
13
- * 根据实例元数据信息自动切换,
14
- * 如备选实例中存在任意一个未开启就近路由的实例,则不开启,
15
- * 否则开启
16
- */
17
- MatchMode[MatchMode["Auto"] = 1] = "Auto";
18
- /** 总是开启就近路由 */
19
- MatchMode[MatchMode["Always"] = 2] = "Always";
20
- })(MatchMode = exports.MatchMode || (exports.MatchMode = {}));
21
- const kDefaultOptions = {
22
- /**
23
- * 匹配模式
24
- */
25
- mode: MatchMode.Auto,
26
- /**
27
- * 就近路由最大查询范围
28
- */
29
- maxRange: 0 /* Region */,
30
- /**
31
- * 就近路由最小查询范围
32
- */
33
- minRange: 1 /* Zone */,
34
- /**
35
- * 不健康实例比例达到多少进行降级
36
- * 默认为 1,即全部不健康才降级
37
- */
38
- unhealthyDegrade: 1
39
- };
40
- /**
41
- * 北极星定义的就近路由策略
42
- * 优先匹配最小范围,失败则扩大一级范围重试,直到超过 `maxRange`
43
- */
44
- class PolarisNearbyRouter {
45
- constructor(options) {
46
- this.type = plugins_1.PluginType.ServiceRouter;
47
- this.name = "PolarisNearbyRouter";
48
- this.requisite = plugins_1.RequisiteBitfield.None;
49
- this.options = Object.assign(Object.assign({}, kDefaultOptions), options);
50
- }
51
- *query(callee, rules, caller, args) {
52
- switch (this.options.mode) {
53
- case MatchMode.Auto: {
54
- /** 预查询,检查是否有节点不开启就近路由 */
55
- yield {};
56
- break;
57
- }
58
- case MatchMode.Off: {
59
- yield {
60
- controller: {
61
- [plugins_1.RoutingCondition.Found]: {
62
- [plugins_1.RoutingAction.Bypass]: [this.name]
63
- },
64
- [plugins_1.RoutingCondition.NotFound]: {
65
- [plugins_1.RoutingAction.Bypass]: [this.name]
66
- }
67
- }
68
- };
69
- return;
70
- }
71
- case MatchMode.Always: {
72
- break;
73
- }
74
- default: {
75
- (0, utils_1.UNREACHABLE)();
76
- }
77
- }
78
- // #region 查询特定范围实例
79
- const { maxRange, minRange } = this.getRange(args);
80
- for (let level = minRange; level >= maxRange; level -= 1) {
81
- yield {
82
- destination: {
83
- level
84
- }
85
- };
86
- }
87
- // #endregion
88
- }
89
- filter(instances, { destination }, args) {
90
- /** MatchMode.Auto */
91
- if (destination === undefined) {
92
- /** 如备选实例中存在任意一个未开启就近路由的实例,则不开启就近路由 */
93
- if (instances.some(instance => instance.metadata["internal-enable-nearby"] !== "true")) {
94
- return {
95
- filtered: instances,
96
- action: {
97
- [plugins_1.RoutingAction.Bypass]: [this.name]
98
- }
99
- };
100
- }
101
- /** 开启就近路由,进行实际查询 */
102
- return {
103
- filtered: []
104
- };
105
- }
106
- if (destination.level !== this.getRange(args).maxRange) { /** 还存在其它可能的查询迭代 */
107
- let unhealthyInstance = 0;
108
- const totalInstances = instances.length;
109
- for (let i = 0; i < totalInstances; i += 1) {
110
- if (!(0, __1.isChoosableInstance)(instances[i])) {
111
- unhealthyInstance += 1;
112
- }
113
- }
114
- if (unhealthyInstance / totalInstances >= this.options.unhealthyDegrade) {
115
- return {
116
- filtered: []
117
- };
118
- }
119
- }
120
- return {
121
- filtered: instances
122
- };
123
- }
124
- getRange(args) {
125
- const callArgs = args;
126
- const { maxRange: presetMax, minRange: presetMin } = this.options;
127
- let maxRange = presetMax;
128
- let minRange = presetMin;
129
- if (callArgs) {
130
- const { maxRange: requiredMax, minRange: requiredMin } = callArgs;
131
- if (requiredMax !== undefined) {
132
- maxRange = requiredMax;
133
- }
134
- if (requiredMin !== undefined) {
135
- minRange = requiredMin;
136
- }
137
- }
138
- if (maxRange > minRange) {
139
- throw new __1.ArgumentError(`|maxRange|(${maxRange}) must be larger than or equal to |minRange|(${minRange})`);
140
- }
141
- return { maxRange, minRange };
142
- }
143
- }
144
- exports.PolarisNearbyRouter = PolarisNearbyRouter;
145
- //# sourceMappingURL=nearby.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nearby.js","sourceRoot":"","sources":["../../../../src/plugins/router/polaris/nearby.ts"],"names":[],"mappings":";;;AAAA,gCAAmH;AACnH,8CAAyJ;AACzJ,0CAA6C;AAE7C,eAAe;AACf,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,cAAc;IACd,uCAAG,CAAA;IACH;;;;OAIG;IACH,yCAAI,CAAA;IACJ,eAAe;IACf,6CAAM,CAAA;AACR,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED,MAAM,eAAe,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,IAAI;IAEpB;;OAEG;IACH,QAAQ,gBAA2B;IAEnC;;OAEG;IACH,QAAQ,cAAyB;IAEjC;;;OAGG;IACH,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAKF;;;GAGG;AACH,MAAa,mBAAmB;IAM9B,YAAY,OAA6C;QALhD,SAAI,GAAG,oBAAU,CAAC,aAAa,CAAC;QAChC,SAAI,GAAW,qBAAqB,CAAC;QACrC,cAAS,GAAG,2BAAiB,CAAC,IAAI,CAAC;QAI1C,IAAI,CAAC,OAAO,mCACP,eAAe,GACf,OAAO,CACX,CAAC;IACJ,CAAC;IAED,CAAE,KAAK,CACL,MAAe,EAAE,KAAsB,EAAE,MAAgB,EAAE,IAAqB;QAEhF,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACzB,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;gBACnB,yBAAyB;gBACzB,MAAM,EAAE,CAAC;gBACT,MAAM;aACP;YACD,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC;gBACl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E,QAAQ,EAAE,CAAC;IAChC,CAAC;CACF;AAtHD,kDAsHC"}
@@ -1,11 +0,0 @@
1
- import { DestinationQuery, PluginType, RequisiteBitfield, ServiceRouterPlugin } from "../../../plugins";
2
- import { RoutingRules } from "../../../rules";
3
- import { Service } from "../../../service";
4
- export declare class PolarisRuleRouter implements ServiceRouterPlugin {
5
- readonly type = PluginType.ServiceRouter;
6
- readonly name: string;
7
- readonly requisite: RequisiteBitfield;
8
- private variables?;
9
- setVariables(variables: Record<string, string>): void;
10
- query(callee: Service, rules?: RoutingRules[], caller?: Service): Generator<Partial<DestinationQuery>, void, void>;
11
- }
@@ -1,174 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PolarisRuleRouter = void 0;
4
- const metadata_1 = require("../../../metadata");
5
- const plugins_1 = require("../../../plugins");
6
- const utils_1 = require("../../../utils");
7
- const kMaxPriority = 9;
8
- const kEmptyObject = Object.freeze(Object.create(null));
9
- class PolarisRuleRouter {
10
- constructor() {
11
- this.type = plugins_1.PluginType.ServiceRouter;
12
- this.name = "PolarisRuleRouter";
13
- this.requisite = plugins_1.RequisiteBitfield.Rule;
14
- }
15
- setVariables(variables) {
16
- this.variables = variables;
17
- }
18
- // eslint-disable-next-line max-lines-per-function
19
- *query(callee, rules, caller) {
20
- let service = "";
21
- let metadata;
22
- if (caller) {
23
- ({ service, metadata } = caller);
24
- }
25
- if (!rules) {
26
- (0, utils_1.UNREACHABLE)();
27
- }
28
- const len = rules.length;
29
- /**
30
- * 规则不存在,不走任何规则匹配,
31
- * 直接匹配被调服务名,查询被调全量实例
32
- */
33
- if (len === 0) {
34
- yield {
35
- destination: {
36
- service: callee.service
37
- }
38
- };
39
- return;
40
- }
41
- /*
42
- * Step 1:
43
- * 规则列表由前往后匹配,越靠前优先级越高
44
- */
45
- for (let i = 0; i < len; i += 1) {
46
- let matches;
47
- const rule = rules[i];
48
- /*
49
- * Step 2:
50
- * 匹配 `sources` 源规则
51
- *
52
- * ```ts
53
- * [].every(() => {}) // true
54
- * [].some(() => {}) // false
55
- * ```
56
- */
57
- if (!rule.sources.every((source) => {
58
- /**
59
- * `source.service` 为 "*" 时,匹配所有源 `service`
60
- */
61
- if (source.service !== "*" && source.service !== service) {
62
- return true;
63
- }
64
- if (source.metadata && metadata) {
65
- const result = (0, metadata_1.isMetadataMatch)(metadata, source.metadata, this.variables);
66
- if (result) {
67
- matches = result;
68
- return false;
69
- }
70
- return true;
71
- }
72
- if (source.metadata !== undefined || metadata !== undefined) {
73
- return true;
74
- }
75
- return false;
76
- })) {
77
- /*
78
- * Step 3:
79
- * 依据目标规则优先级 `priority`,由前往后匹配目标规则
80
- */
81
- for (let priority = 0; priority <= kMaxPriority;) {
82
- const destinations = [];
83
- let steps = 0;
84
- rule.destinations.forEach((destination) => {
85
- const delta = destination.priority - priority;
86
- if (delta === 0) {
87
- destinations.push(destination);
88
- }
89
- else if (delta > 0) {
90
- /*
91
- * note:
92
- * 由于各目标规则优先级可能非连续,
93
- * 故计算最接近的下一个优先级的步长 `steps`,
94
- * 以减小循环次数,优化性能
95
- */
96
- if (steps === 0) {
97
- steps = delta;
98
- }
99
- else {
100
- steps = Math.min(delta, steps);
101
- }
102
- }
103
- });
104
- priority += steps;
105
- /*
106
- * Step 4:
107
- * 在同优先级的目标规则中,根据规则权重 `weight` 进行分配
108
- */
109
- if (destinations.length === 1) { /** fast case */
110
- yield {
111
- controller: {
112
- [plugins_1.RoutingCondition.Found]: {
113
- [plugins_1.RoutingAction.Break]: true
114
- }
115
- },
116
- destination: destinations[0],
117
- source: {
118
- parameters: matches !== null && matches !== void 0 ? matches : kEmptyObject
119
- }
120
- };
121
- }
122
- else { /** slow case */
123
- let totalWeight = destinations.reduce((acc, cur) => acc + cur.weight, 0);
124
- /**
125
- * 如果目标规则权重和为 0,则不采用
126
- */
127
- while (totalWeight > 0) {
128
- /*
129
- * 采用随机轮训的方式,选取目标规则
130
- */
131
- const selectedValue = Math.random() * totalWeight;
132
- let beginValue = 0;
133
- let endValue = 0;
134
- for (let idx = 0; idx < destinations.length; idx += 1) {
135
- const destination = destinations[idx];
136
- endValue = beginValue + destination.weight;
137
- if (selectedValue >= beginValue && selectedValue < endValue) {
138
- totalWeight -= destination.weight;
139
- destinations.splice(idx, 1);
140
- yield {
141
- controller: {
142
- [plugins_1.RoutingCondition.Found]: {
143
- [plugins_1.RoutingAction.Break]: true
144
- }
145
- },
146
- source: {
147
- parameters: matches !== null && matches !== void 0 ? matches : kEmptyObject
148
- },
149
- destination
150
- };
151
- break;
152
- }
153
- beginValue = endValue;
154
- }
155
- }
156
- }
157
- /**
158
- * 所有优先级均已遍历完成
159
- */
160
- if (steps === 0) {
161
- break;
162
- }
163
- }
164
- /**
165
- * 一旦命中了一个特定的源规则,
166
- * 则不再匹配剩余规则
167
- */
168
- break;
169
- }
170
- }
171
- }
172
- }
173
- exports.PolarisRuleRouter = PolarisRuleRouter;
174
- //# sourceMappingURL=rule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../../src/plugins/router/polaris/rule.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAC9D,8CAAyI;AAGzI,0CAA6C;AAE7C,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAA0B,CAAC;AAEjF,MAAa,iBAAiB;IAA9B;QACW,SAAI,GAAG,oBAAU,CAAC,aAAa,CAAC;QAChC,SAAI,GAAW,mBAAmB,CAAC;QACnC,cAAS,GAAG,2BAAiB,CAAC,IAAI,CAAC;IA2K9C,CAAC;IAvKC,YAAY,CAAC,SAAiC;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,kDAAkD;IAClD,CAAE,KAAK,CAAC,MAAe,EAAE,KAAsB,EAAE,MAAgB;QAC/D,IAAI,OAAO,GAAG,EAAE,CAA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AAW,GAAG,CAAC,EAAE;4BACtB;;+BAEG;4BACH,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC;4BAClD,IAAI,UAAU,GAAG,CAAC,CAAC;4BACnB,IAAI,QAAQ,GAAG,CAAC,CAAC;4BACjB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,YAAY,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE;gCACrD,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gCACtC,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC;gCAC3C,IAAI,aAAa,IAAI,UAAU,IAAI,aAAa,GAAG,QAAQ,EAAE;oCAC3D,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;oCAClC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;oCAC5B,MAAM;wCACJ,UAAU,EAAE;4CACV,CAAC,0BAAgB,CAAC,KAAK,CAAC,EAAE;gDACxB,CAAC,uBAAa,CAAC,KAAK,CAAC,EAAE,IAAI;6CAC5B;yCACF;wCACD,MAAM,EAAE;4CACN,UAAU,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,YAAY;yCACpC;wCACD,WAAW;qCACZ,CAAC;oCACF,MAAM;iCACP;gCACD,UAAU,GAAG,QAAQ,CAAC;6BACvB;yBACF;qBACF;oBAED;;uBAEG;oBACH,IAAI,KAAK,KAAK,CAAC,EAAE;wBACf,MAAM;qBACP;iBACF;gBAED;;;mBAGG;gBACH,MAAM;aACP;SACF;IACH,CAAC;CACF;AA9KD,8CA8KC"}
@@ -1,25 +0,0 @@
1
- import { PluginType, RequisiteBitfield, ServiceRouterPlugin } from "../../../plugins";
2
- import { RoutingRules } from "../../../rules";
3
- import { Service } from "../../../service";
4
- export declare type CanaryArgs = string;
5
- export declare class TRPCCanaryRouter implements ServiceRouterPlugin {
6
- readonly type = PluginType.ServiceRouter;
7
- readonly name: string;
8
- readonly requisite: RequisiteBitfield;
9
- query<AdditionalArgs = CanaryArgs>(callee: Service, rules?: RoutingRules[], caller?: Service, args?: AdditionalArgs): Generator<{
10
- controller?: undefined;
11
- destination?: undefined;
12
- } | {
13
- controller: {
14
- 0: {
15
- 0: boolean;
16
- };
17
- };
18
- destination: {
19
- service: string;
20
- metadata: {
21
- canary: string;
22
- };
23
- };
24
- }, void, unknown>;
25
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TRPCCanaryRouter = void 0;
4
- const plugins_1 = require("../../../plugins");
5
- class TRPCCanaryRouter {
6
- constructor() {
7
- this.type = plugins_1.PluginType.ServiceRouter;
8
- this.name = "tRPCCanaryRouter";
9
- this.requisite = plugins_1.RequisiteBitfield.None;
10
- }
11
- *query(callee, rules, caller, args) {
12
- // 没有传金丝雀的标签时,不作过滤
13
- if (typeof args === "undefined") {
14
- yield {};
15
- return;
16
- }
17
- // 查找金丝雀标签匹配的实例
18
- yield {
19
- controller: {
20
- [plugins_1.RoutingCondition.Found]: {
21
- [plugins_1.RoutingAction.Break]: true
22
- }
23
- },
24
- destination: {
25
- service: "*",
26
- metadata: {
27
- canary: String(args)
28
- }
29
- }
30
- };
31
- // 金丝雀标签未匹配,则不作过滤
32
- yield {};
33
- }
34
- }
35
- exports.TRPCCanaryRouter = TRPCCanaryRouter;
36
- //# sourceMappingURL=canary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canary.js","sourceRoot":"","sources":["../../../../src/plugins/router/trpc/canary.ts"],"names":[],"mappings":";;;AAAA,8CAAuH;AAMvH,MAAa,gBAAgB;IAA7B;QACW,SAAI,GAAG,oBAAU,CAAC,aAAa,CAAC;QAChC,SAAI,GAAW,kBAAkB,CAAC;QAClC,cAAS,GAAG,2BAAiB,CAAC,IAAI,CAAC;IA6B9C,CAAC;IA3BC,CAAE,KAAK,CACL,MAAe,EAAE,KAAsB,EAAE,MAAgB,EAAE,IAAqB;QAEhF,kBAAkB;QAClB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;YAC/B,MAAM,EAAE,CAAC;YACT,OAAO;SACR;QAED,eAAe;QACf,MAAM;YACJ,UAAU,EAAE;gBACV,CAAC,0BAAgB,CAAC,KAAK,CAAC,EAAE;oBACxB,CAAC,uBAAa,CAAC,KAAK,CAAC,EAAE,IAAI;iBAC5B;aACF;YACD,WAAW,EAAE;gBACX,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE;oBACR,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;iBACrB;aACF;SACF,CAAC;QAEF,iBAAiB;QACjB,MAAM,EAAE,CAAC;IACX,CAAC;CACF;AAhCD,4CAgCC"}
@@ -1,10 +0,0 @@
1
- import { DestinationQuery, PluginType, RequisiteBitfield, ServiceRouterPlugin } from "../../../plugins";
2
- import { RoutingRules } from "../../../rules";
3
- import { Service } from "../../../service";
4
- export declare type EnvArgs = string[];
5
- export declare class TRPCEnvRouter implements ServiceRouterPlugin {
6
- readonly type = PluginType.ServiceRouter;
7
- readonly name: string;
8
- readonly requisite: RequisiteBitfield;
9
- query<AdditionalArgs = EnvArgs>(callee: Service, rules?: RoutingRules[], caller?: Service, args?: AdditionalArgs): Generator<Partial<DestinationQuery>, void, void>;
10
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TRPCEnvRouter = void 0;
4
- const __1 = require("../../..");
5
- const plugins_1 = require("../../../plugins");
6
- class TRPCEnvRouter {
7
- constructor() {
8
- this.type = plugins_1.PluginType.ServiceRouter;
9
- this.name = "tRPCEnvRouter";
10
- this.requisite = plugins_1.RequisiteBitfield.None;
11
- }
12
- *query(callee, rules, caller, args) {
13
- if (!Array.isArray(args)) {
14
- throw new __1.ArgumentError("|args| must be an array");
15
- }
16
- for (let i = 0; i < args.length; i += 1) {
17
- yield {
18
- controller: {
19
- [plugins_1.RoutingCondition.Found]: {
20
- [plugins_1.RoutingAction.Break]: true
21
- }
22
- },
23
- destination: {
24
- service: "*",
25
- metadata: {
26
- env: args[i].toString()
27
- }
28
- }
29
- };
30
- }
31
- }
32
- }
33
- exports.TRPCEnvRouter = TRPCEnvRouter;
34
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../src/plugins/router/trpc/env.ts"],"names":[],"mappings":";;;AAAA,gCAAyC;AACzC,8CAAyI;AAMzI,MAAa,aAAa;IAA1B;QACW,SAAI,GAAG,oBAAU,CAAC,aAAa,CAAC;QAChC,SAAI,GAAW,eAAe,CAAC;QAC/B,cAAS,GAAG,2BAAiB,CAAC,IAAI,CAAC;IAyB9C,CAAC;IAvBC,CAAE,KAAK,CACL,MAAe,EAAE,KAAsB,EAAE,MAAgB,EAAE,IAAqB;QAEhF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACxB,MAAM,IAAI,iBAAa,CAAC,yBAAyB,CAAC,CAAC;SACpD;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YACvC,MAAM;gBACJ,UAAU,EAAE;oBACV,CAAC,0BAAgB,CAAC,KAAK,CAAC,EAAE;wBACxB,CAAC,uBAAa,CAAC,KAAK,CAAC,EAAE,IAAI;qBAC5B;iBACF;gBACD,WAAW,EAAE;oBACX,OAAO,EAAE,GAAG;oBACZ,QAAQ,EAAE;wBACR,GAAG,EAAG,IAAgB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;qBACrC;iBACF;aACF,CAAC;SACH;IACH,CAAC;CACF;AA5BD,sCA4BC"}
@@ -1,56 +0,0 @@
1
- import { Instance } from "../../../instance";
2
- import { DestinationQuery, FilteredResult, PluginType, RequisiteBitfield, ServiceRouterPlugin } from "../../../plugins";
3
- import { RoutingRules } from "../../../rules";
4
- import { Service } from "../../../service";
5
- /** 匹配类型 */
6
- export declare enum MatchType {
7
- /**
8
- * @description
9
- * 旁路此模块,不做 `Set` 路由
10
- */
11
- NoSet = 0,
12
- /**
13
- * @description
14
- * 匹配流程如下:
15
- * 1. 精确匹配,如存在实例(不考虑实例状态)则返回,并旁路就近路由
16
- * 2. 匹配其通配组,Set 组名为 "*",如存在实例(不考虑实例状态)则返回,并旁路就近路由
17
- * 3. 如被调未启用 Set(被调不存在可以匹配上 `Set 名` 的实例)则旁路此模块
18
- */
19
- SourceSet = 1,
20
- /**
21
- * @description
22
- * 匹配流程如下:
23
- * 1. 精确匹配,如存在实例(不考虑实例状态)则返回,并旁路就近路由
24
- * 2. 匹配其通配组,Set 组名为 "*",如存在实例(不考虑实例状态)则返回,并旁路就近路由
25
- */
26
- DestinationSet = 2
27
- }
28
- export interface SetInfo {
29
- /** Set 名 */
30
- name: string;
31
- /** Set 地区 */
32
- area: string;
33
- /** Set 组名 */
34
- group: string;
35
- }
36
- export interface SetArgs {
37
- /**
38
- * 匹配类型
39
- */
40
- match: MatchType;
41
- /**
42
- * 需匹配的 Set 信息
43
- */
44
- set: SetInfo;
45
- /**
46
- * 开启按 Set 就近访问
47
- */
48
- enableNearby?: boolean;
49
- }
50
- export declare class TRPCSetRouter implements ServiceRouterPlugin {
51
- readonly type = PluginType.ServiceRouter;
52
- readonly name: string;
53
- readonly requisite: RequisiteBitfield;
54
- query<AdditionalArgs = SetArgs>(callee: Service, rules?: RoutingRules[], caller?: Service, args?: AdditionalArgs): Generator<Partial<DestinationQuery>, void, void>;
55
- filter?<AdditionalArgs>(instances: Instance[], query: Partial<DestinationQuery>, args?: AdditionalArgs): FilteredResult;
56
- }
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TRPCSetRouter = exports.MatchType = void 0;
4
- const plugins_1 = require("../../../plugins");
5
- /** 匹配类型 */
6
- var MatchType;
7
- (function (MatchType) {
8
- /**
9
- * @description
10
- * 旁路此模块,不做 `Set` 路由
11
- */
12
- MatchType[MatchType["NoSet"] = 0] = "NoSet";
13
- /**
14
- * @description
15
- * 匹配流程如下:
16
- * 1. 精确匹配,如存在实例(不考虑实例状态)则返回,并旁路就近路由
17
- * 2. 匹配其通配组,Set 组名为 "*",如存在实例(不考虑实例状态)则返回,并旁路就近路由
18
- * 3. 如被调未启用 Set(被调不存在可以匹配上 `Set 名` 的实例)则旁路此模块
19
- */
20
- MatchType[MatchType["SourceSet"] = 1] = "SourceSet";
21
- /**
22
- * @description
23
- * 匹配流程如下:
24
- * 1. 精确匹配,如存在实例(不考虑实例状态)则返回,并旁路就近路由
25
- * 2. 匹配其通配组,Set 组名为 "*",如存在实例(不考虑实例状态)则返回,并旁路就近路由
26
- */
27
- MatchType[MatchType["DestinationSet"] = 2] = "DestinationSet";
28
- })(MatchType = exports.MatchType || (exports.MatchType = {}));
29
- /** 预置的旁路行为 */
30
- const presetBypass = {
31
- Set: Object.freeze({
32
- [plugins_1.RoutingAction.Bypass]: ["tRPCSetRouter"]
33
- }),
34
- Nearby: Object.freeze({
35
- [plugins_1.RoutingAction.Bypass]: ["PolarisNearbyRouter"]
36
- })
37
- };
38
- class TRPCSetRouter {
39
- constructor() {
40
- this.type = plugins_1.PluginType.ServiceRouter;
41
- this.name = "tRPCSetRouter";
42
- this.requisite = plugins_1.RequisiteBitfield.None;
43
- }
44
- *query(callee, rules, caller, args) {
45
- const callArgs = args;
46
- if (callArgs === null || callArgs === void 0 ? void 0 : callArgs.match) { /** MatchType.NoSet === 0 */
47
- yield {
48
- destination: {
49
- metadata: {
50
- "internal-enable-set": "Y"
51
- }
52
- }
53
- };
54
- }
55
- else {
56
- yield {};
57
- }
58
- }
59
- filter(instances, query, args) {
60
- const callArgs = args;
61
- if (!callArgs || callArgs.match === MatchType.NoSet) {
62
- return {
63
- filtered: instances,
64
- action: presetBypass.Set
65
- };
66
- }
67
- let enabledSet = false;
68
- const matchedInstances = [];
69
- const genericInstances = [];
70
- const { name, area, group } = callArgs.set;
71
- const exactArea = `${name}.${area}`;
72
- const exactGroup = `${name}.${area}.${group}`;
73
- const genericGroup = `${name}.${area}.*`;
74
- instances.forEach((instance) => {
75
- const instanceSet = instance.metadata["internal-set-name"];
76
- if (instanceSet.startsWith(name)) {
77
- /** 仅当 Set 名匹配时,才认为开启 Set 调用 */
78
- enabledSet = true;
79
- if ((group === "*" && instanceSet.startsWith(exactArea)) /** group 为 "*" 时匹配所有组 */
80
- || instanceSet === exactGroup /** 精确匹配 */) {
81
- matchedInstances.push(instance);
82
- }
83
- else if (instanceSet === genericGroup) { /** 通配组 */
84
- genericInstances.push(instance);
85
- }
86
- }
87
- });
88
- const result = {
89
- filtered: matchedInstances.length > 0 ? matchedInstances : genericInstances
90
- };
91
- /**
92
- * 默认不按 set 开启就近访问,找到可用节点,就会忽略 NearBy 插件
93
- * enableNearby 参数可以开启按 Set 就近访问
94
- */
95
- if (result.filtered.length > 0 && !callArgs.enableNearby) {
96
- result.action = presetBypass.Nearby;
97
- }
98
- else if (!enabledSet && callArgs.match === MatchType.SourceSet) {
99
- result.action = presetBypass.Set;
100
- result.filtered = instances;
101
- }
102
- return result;
103
- }
104
- }
105
- exports.TRPCSetRouter = TRPCSetRouter;
106
- //# sourceMappingURL=set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/plugins/router/trpc/set.ts"],"names":[],"mappings":";;;AACA,8CAAuI;AAIvI,WAAW;AACX,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACnB;;;OAGG;IACH,2CAAS,CAAA;IAET;;;;;;OAMG;IACH,mDAAS,CAAA;IAET;;;;;OAKG;IACH,6DAAc,CAAA;AAChB,CAAC,EAvBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAuBpB;AA8BD,cAAc;AACd,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACjB,CAAC,uBAAa,CAAC,MAAM,CAAC,EAAE,C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, TrafficShapingPlugin } from "../../plugins";
2
- import { RatelimitRule } from "../../rules";
3
- declare const kDefaultOptions: {
4
- /**
5
- * 最长等待时间 (ms)
6
- */
7
- maxWaitingTime: number;
8
- /**
9
- * 空闲回收周期
10
- */
11
- idlePeriod: number;
12
- };
13
- export declare type UnirateTrafficShapingOptions = typeof kDefaultOptions;
14
- /**
15
- * Leaky bucket
16
- * (https://en.wikipedia.org/wiki/Leaky_bucket)
17
- */
18
- export declare class UnirateTrafficShaping implements TrafficShapingPlugin {
19
- readonly type = PluginType.TrafficShaping;
20
- readonly name: string;
21
- private readonly options;
22
- private readonly buckets;
23
- private disposed;
24
- constructor(options?: Partial<UnirateTrafficShapingOptions>);
25
- dispose(): void;
26
- get isDisposed(): boolean;
27
- inFlow(rule: RatelimitRule, partition: number): Promise<void>;
28
- private allocate;
29
- private buildBucket;
30
- }
31
- export {};